var $lime_init = (function ($hx_exports, $global) { "use strict"; var $hx_script = (function (exports, global) { // Generated by Haxe 4.3.1
(function ($hx_exports, $global) { "use strict";
$hx_exports["lime"] = $hx_exports["lime"] || {};
var $hxClasses = {},$estr = function() { return js_Boot.__string_rec(this,''); },$hxEnums = $hxEnums || {},$_;
function $extend(from, fields) {
	var proto = Object.create(from);
	for (var name in fields) proto[name] = fields[name];
	if( fields.toString !== Object.prototype.toString ) proto.toString = fields.toString;
	return proto;
}
var lime_app_IModule = function() { };
$hxClasses["lime.app.IModule"] = lime_app_IModule;
lime_app_IModule.__name__ = "lime.app.IModule";
lime_app_IModule.__isInterface__ = true;
lime_app_IModule.prototype = {
	__registerLimeModule: null
	,__unregisterLimeModule: null
	,__class__: lime_app_IModule
};
var lime_app_Module = function() {
	this.onExit = new lime_app__$Event_$Int_$Void();
};
$hxClasses["lime.app.Module"] = lime_app_Module;
lime_app_Module.__name__ = "lime.app.Module";
lime_app_Module.__interfaces__ = [lime_app_IModule];
lime_app_Module.prototype = {
	onExit: null
	,__registerLimeModule: function(application) {
	}
	,__unregisterLimeModule: function(application) {
	}
	,__class__: lime_app_Module
};
var lime__$internal_backend_html5_HTML5Application = function(parent) {
	this.gameDeviceCache = new haxe_ds_IntMap();
	this.parent = parent;
	this.currentUpdate = 0;
	this.lastUpdate = 0;
	this.nextUpdate = 0;
	this.framePeriod = -1;
	lime_media_AudioManager.init();
	this.accelerometer = lime_system_Sensor.registerSensor(lime_system_SensorType.ACCELEROMETER,0);
};
$hxClasses["lime._internal.backend.html5.HTML5Application"] = lime__$internal_backend_html5_HTML5Application;
lime__$internal_backend_html5_HTML5Application.__name__ = "lime._internal.backend.html5.HTML5Application";
lime__$internal_backend_html5_HTML5Application.prototype = {
	accelerometer: null
	,currentUpdate: null
	,deltaTime: null
	,framePeriod: null
	,gameDeviceCache: null
	,hidden: null
	,lastUpdate: null
	,nextUpdate: null
	,parent: null
	,convertKeyCode: function(keyCode) {
		if(keyCode >= 65 && keyCode <= 90) {
			return keyCode + 32;
		}
		switch(keyCode) {
		case 12:
			return 1073741980;
		case 16:
			return 1073742049;
		case 17:
			return 1073742048;
		case 18:
			return 1073742050;
		case 19:
			return 1073741896;
		case 20:
			return 1073741881;
		case 33:
			return 1073741899;
		case 34:
			return 1073741902;
		case 35:
			return 1073741901;
		case 36:
			return 1073741898;
		case 37:
			return 1073741904;
		case 38:
			return 1073741906;
		case 39:
			return 1073741903;
		case 40:
			return 1073741905;
		case 41:
			return 1073741943;
		case 43:
			return 1073741940;
		case 44:
			return 1073741894;
		case 45:
			return 1073741897;
		case 46:
			return 127;
		case 91:
			return 1073742051;
		case 92:
			return 1073742055;
		case 93:
			return 1073742055;
		case 95:
			return 1073742106;
		case 96:
			return 1073741922;
		case 97:
			return 1073741913;
		case 98:
			return 1073741914;
		case 99:
			return 1073741915;
		case 100:
			return 1073741916;
		case 101:
			return 1073741917;
		case 102:
			return 1073741918;
		case 103:
			return 1073741919;
		case 104:
			return 1073741920;
		case 105:
			return 1073741921;
		case 106:
			return 1073741909;
		case 107:
			return 1073741911;
		case 108:
			return 1073741923;
		case 109:
			return 1073741910;
		case 110:
			return 1073741923;
		case 111:
			return 1073741908;
		case 112:
			return 1073741882;
		case 113:
			return 1073741883;
		case 114:
			return 1073741884;
		case 115:
			return 1073741885;
		case 116:
			return 1073741886;
		case 117:
			return 1073741887;
		case 118:
			return 1073741888;
		case 119:
			return 1073741889;
		case 120:
			return 1073741890;
		case 121:
			return 1073741891;
		case 122:
			return 1073741892;
		case 123:
			return 1073741893;
		case 124:
			return 1073741928;
		case 125:
			return 1073741929;
		case 126:
			return 1073741930;
		case 127:
			return 1073741931;
		case 128:
			return 1073741932;
		case 129:
			return 1073741933;
		case 130:
			return 1073741934;
		case 131:
			return 1073741935;
		case 132:
			return 1073741936;
		case 133:
			return 1073741937;
		case 134:
			return 1073741938;
		case 135:
			return 1073741939;
		case 144:
			return 1073741907;
		case 145:
			return 1073741895;
		case 160:
			return 94;
		case 161:
			return 33;
		case 163:
			return 35;
		case 164:
			return 36;
		case 166:
			return 1073742094;
		case 167:
			return 1073742095;
		case 168:
			return 1073742097;
		case 169:
			return 41;
		case 170:
			return 42;
		case 171:
			return 96;
		case 172:
			return 1073741898;
		case 173:
			return 45;
		case 174:
			return 1073741953;
		case 175:
			return 1073741952;
		case 176:
			return 1073742082;
		case 177:
			return 1073742083;
		case 178:
			return 1073742084;
		case 179:
			return 1073742085;
		case 180:
			return 1073742089;
		case 181:
			return 1073742086;
		case 182:
			return 1073741953;
		case 183:
			return 1073741952;
		case 186:
			return 59;
		case 187:
			return 61;
		case 188:
			return 44;
		case 189:
			return 45;
		case 190:
			return 46;
		case 191:
			return 47;
		case 192:
			return 96;
		case 193:
			return 63;
		case 194:
			return 1073741923;
		case 219:
			return 91;
		case 220:
			return 92;
		case 221:
			return 93;
		case 222:
			return 39;
		case 223:
			return 96;
		case 224:
			return 1073742051;
		case 226:
			return 92;
		}
		return keyCode;
	}
	,exec: function() {
		window.addEventListener("keydown",$bind(this,this.handleKeyEvent),false);
		window.addEventListener("keyup",$bind(this,this.handleKeyEvent),false);
		window.addEventListener("focus",$bind(this,this.handleWindowEvent),false);
		window.addEventListener("blur",$bind(this,this.handleWindowEvent),false);
		window.addEventListener("resize",$bind(this,this.handleWindowEvent),false);
		window.addEventListener("beforeunload",$bind(this,this.handleWindowEvent),false);
		var o = window;
		if(Object.prototype.hasOwnProperty.call(o,"Accelerometer")) {
			window.addEventListener("devicemotion",$bind(this,this.handleSensorEvent),false);
		}
		
			if (!CanvasRenderingContext2D.prototype.isPointInStroke) {
				CanvasRenderingContext2D.prototype.isPointInStroke = function (path, x, y) {
					return false;
				};
			}
			if (!CanvasRenderingContext2D.prototype.isPointInPath) {
				CanvasRenderingContext2D.prototype.isPointInPath = function (path, x, y) {
					return false;
				};
			}

			if ('performance' in window == false) {
				window.performance = {};
			}

			if ('now' in window.performance == false) {
				var offset = Date.now();
				if (performance.timing && performance.timing.navigationStart) {
					offset = performance.timing.navigationStart
				}
				window.performance.now = function now() {
					return Date.now() - offset;
				}
			}

			var lastTime = 0;
			var vendors = ['ms', 'moz', 'webkit', 'o'];
			for (var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) {
				window.requestAnimationFrame = window[vendors[x]+'RequestAnimationFrame'];
				window.cancelAnimationFrame = window[vendors[x]+'CancelAnimationFrame'] || window[vendors[x]+'CancelRequestAnimationFrame'];
			}

			if (!window.requestAnimationFrame)
				window.requestAnimationFrame = function(callback, element) {
					var currTime = window.performance.now();
					var timeToCall = Math.max(0, 16 - (currTime - lastTime));
					var id = window.setTimeout(function() { callback(currTime + timeToCall); },
					  timeToCall);
					lastTime = currTime + timeToCall;
					return id;
				};

			if (!window.cancelAnimationFrame)
				window.cancelAnimationFrame = function(id) {
					clearTimeout(id);
				};

			window.requestAnimFrame = window.requestAnimationFrame;
		;
		this.lastUpdate = window.performance.now();
		this.handleApplicationEvent();
		return 0;
	}
	,exit: function() {
	}
	,getDeviceOrientation: function() {
		if(window.screen.orientation != null) {
			switch(window.screen.orientation.type) {
			case "landscape-primary":
				return 1;
			case "landscape-secondary":
				return 2;
			case "portrait-primary":
				return 3;
			case "portrait-secondary":
				return 4;
			default:
			}
		}
		return 0;
	}
	,handleApplicationEvent: function(__) {
		var _g = 0;
		var _g1 = this.parent.__windows;
		while(_g < _g1.length) {
			var window1 = _g1[_g];
			++_g;
			window1.__backend.updateSize();
		}
		this.updateGameDevices();
		this.currentUpdate = window.performance.now();
		if(this.currentUpdate >= this.nextUpdate) {
			this.deltaTime = this.currentUpdate - this.lastUpdate;
			var _g = 0;
			var _g1 = this.parent.__windows;
			while(_g < _g1.length) {
				var window1 = _g1[_g];
				++_g;
				this.parent.onUpdate.dispatch(this.deltaTime | 0);
				if(window1.context != null) {
					window1.onRender.dispatch(window1.context);
				}
			}
			if(this.framePeriod < 0) {
				this.nextUpdate = this.currentUpdate;
			} else {
				this.nextUpdate = this.currentUpdate - this.currentUpdate % this.framePeriod + this.framePeriod;
			}
			this.lastUpdate = this.currentUpdate;
		}
		window.requestAnimationFrame($bind(this,this.handleApplicationEvent));
	}
	,handleKeyEvent: function(event) {
		if(this.parent.__window != null) {
			var keyCode = this.convertKeyCode(event.keyCode != null ? event.keyCode : event.which);
			var modifier = (event.shiftKey ? 3 : 0) | (event.ctrlKey ? 192 : 0) | (event.altKey ? 768 : 0) | (event.metaKey ? 3072 : 0);
			if(event.type == "keydown") {
				this.parent.__window.onKeyDown.dispatch(keyCode,modifier);
				if(this.parent.__window.onKeyDown.canceled && event.cancelable) {
					event.preventDefault();
				}
			} else {
				this.parent.__window.onKeyUp.dispatch(keyCode,modifier);
				if(this.parent.__window.onKeyUp.canceled && event.cancelable) {
					event.preventDefault();
				}
			}
		}
	}
	,handleSensorEvent: function(event) {
		this.accelerometer.onUpdate.dispatch(event.accelerationIncludingGravity.x,event.accelerationIncludingGravity.y,event.accelerationIncludingGravity.z);
	}
	,handleWindowEvent: function(event) {
		if(this.parent.__window != null) {
			switch(event.type) {
			case "beforeunload":
				break;
			case "blur":
				if(!this.hidden) {
					this.parent.__window.onFocusOut.dispatch();
					this.parent.__window.onDeactivate.dispatch();
					this.hidden = true;
				}
				break;
			case "focus":
				if(this.hidden) {
					this.parent.__window.onFocusIn.dispatch();
					this.parent.__window.onActivate.dispatch();
					this.hidden = false;
				}
				break;
			case "resize":
				this.parent.__window.__backend.handleResizeEvent(event);
				break;
			case "visibilitychange":
				if(window.document.hidden) {
					if(!this.hidden) {
						this.parent.__window.onFocusOut.dispatch();
						this.parent.__window.onDeactivate.dispatch();
						this.hidden = true;
					}
				} else if(this.hidden) {
					this.parent.__window.onFocusIn.dispatch();
					this.parent.__window.onActivate.dispatch();
					this.hidden = false;
				}
				break;
			}
		}
	}
	,updateGameDevices: function() {
		var devices = lime_ui_Joystick.__getDeviceData();
		if(devices == null) {
			return;
		}
		var id;
		var gamepad;
		var joystick;
		var data;
		var cache;
		var _g = 0;
		var _g1 = devices.length;
		while(_g < _g1) {
			var i = _g++;
			id = i;
			data = devices[id];
			if(data == null) {
				continue;
			}
			if(!this.gameDeviceCache.h.hasOwnProperty(id)) {
				cache = new lime__$internal_backend_html5_GameDeviceData();
				cache.id = id;
				cache.connected = data.connected;
				var _g2 = 0;
				var _g3 = data.buttons.length;
				while(_g2 < _g3) {
					var i1 = _g2++;
					cache.buttons.push(data.buttons[i1].value);
				}
				var _g4 = 0;
				var _g5 = data.axes.length;
				while(_g4 < _g5) {
					var i2 = _g4++;
					cache.axes.push(data.axes[i2]);
				}
				if(data.mapping == "standard") {
					cache.isGamepad = true;
				}
				this.gameDeviceCache.h[id] = cache;
				if(data.connected) {
					lime_ui_Joystick.__connect(id);
					if(cache.isGamepad) {
						lime_ui_Gamepad.__connect(id);
					}
				}
			}
			cache = this.gameDeviceCache.h[id];
			joystick = lime_ui_Joystick.devices.h[id];
			gamepad = lime_ui_Gamepad.devices.h[id];
			if(data.connected) {
				var button;
				var value;
				var _g6 = 0;
				var _g7 = data.buttons.length;
				while(_g6 < _g7) {
					var i3 = _g6++;
					value = data.buttons[i3].value;
					if(value != cache.buttons[i3]) {
						if(i3 == 6) {
							joystick.onAxisMove.dispatch(data.axes.length,value);
							if(gamepad != null) {
								gamepad.onAxisMove.dispatch(4,value);
							}
						} else if(i3 == 7) {
							joystick.onAxisMove.dispatch(data.axes.length + 1,value);
							if(gamepad != null) {
								gamepad.onAxisMove.dispatch(5,value);
							}
						} else {
							if(value > 0) {
								joystick.onButtonDown.dispatch(i3);
							} else {
								joystick.onButtonUp.dispatch(i3);
							}
							if(gamepad != null) {
								switch(i3) {
								case 0:
									button = 0;
									break;
								case 1:
									button = 1;
									break;
								case 2:
									button = 2;
									break;
								case 3:
									button = 3;
									break;
								case 4:
									button = 9;
									break;
								case 5:
									button = 10;
									break;
								case 8:
									button = 4;
									break;
								case 9:
									button = 6;
									break;
								case 10:
									button = 7;
									break;
								case 11:
									button = 8;
									break;
								case 12:
									button = 11;
									break;
								case 13:
									button = 12;
									break;
								case 14:
									button = 13;
									break;
								case 15:
									button = 14;
									break;
								case 16:
									button = 5;
									break;
								default:
									continue;
								}
								if(value > 0) {
									gamepad.onButtonDown.dispatch(button);
								} else {
									gamepad.onButtonUp.dispatch(button);
								}
							}
						}
						cache.buttons[i3] = value;
					}
				}
				var _g8 = 0;
				var _g9 = data.axes.length;
				while(_g8 < _g9) {
					var i4 = _g8++;
					if(data.axes[i4] != cache.axes[i4]) {
						joystick.onAxisMove.dispatch(i4,data.axes[i4]);
						if(gamepad != null) {
							gamepad.onAxisMove.dispatch(i4,data.axes[i4]);
						}
						cache.axes[i4] = data.axes[i4];
					}
				}
			} else if(cache.connected) {
				cache.connected = false;
				lime_ui_Joystick.__disconnect(id);
				lime_ui_Gamepad.__disconnect(id);
			}
		}
	}
	,__class__: lime__$internal_backend_html5_HTML5Application
};
var lime_app_Application = function() {
	this.onDeviceOrientationChange = new lime_app__$Event_$lime_$system_$Orientation_$Void();
	this.onDisplayOrientationChange = new lime_app__$Event_$Int_$lime_$system_$Orientation_$Void();
	this.onCreateWindow = new lime_app__$Event_$lime_$ui_$Window_$Void();
	this.onUpdate = new lime_app__$Event_$Int_$Void();
	lime_app_Module.call(this);
	if(lime_app_Application.current == null) {
		lime_app_Application.current = this;
	}
	this.meta = new haxe_ds_StringMap();
	this.modules = [];
	this.__windowByID = new haxe_ds_IntMap();
	this.__windows = [];
	this.__backend = new lime__$internal_backend_html5_HTML5Application(this);
	this.__registerLimeModule(this);
	this.__preloader = new lime_utils_Preloader();
	this.__preloader.onProgress.add($bind(this,this.onPreloadProgress));
	this.__preloader.onComplete.add($bind(this,this.onPreloadComplete));
};
$hxClasses["lime.app.Application"] = lime_app_Application;
lime_app_Application.__name__ = "lime.app.Application";
lime_app_Application.__super__ = lime_app_Module;
lime_app_Application.prototype = $extend(lime_app_Module.prototype,{
	meta: null
	,modules: null
	,onUpdate: null
	,onCreateWindow: null
	,onDisplayOrientationChange: null
	,onDeviceOrientationChange: null
	,preloader: null
	,window: null
	,windows: null
	,__backend: null
	,__preloader: null
	,__window: null
	,__windowByID: null
	,__windows: null
	,addModule: function(module) {
		module.__registerLimeModule(this);
		this.modules.push(module);
	}
	,createWindow: function(attributes) {
		var window1 = this.__createWindow(attributes);
		this.__addWindow(window1);
		return window1;
	}
	,exec: function() {
		lime_app_Application.current = this;
		return this.__backend.exec();
	}
	,onGamepadAxisMove: function(gamepad,axis,value) {
	}
	,onGamepadButtonDown: function(gamepad,button) {
	}
	,onGamepadButtonUp: function(gamepad,button) {
	}
	,onGamepadConnect: function(gamepad) {
	}
	,onGamepadDisconnect: function(gamepad) {
	}
	,onJoystickAxisMove: function(joystick,axis,value) {
	}
	,onJoystickButtonDown: function(joystick,button) {
	}
	,onJoystickButtonUp: function(joystick,button) {
	}
	,onJoystickConnect: function(joystick) {
	}
	,onJoystickDisconnect: function(joystick) {
	}
	,onJoystickHatMove: function(joystick,hat,position) {
	}
	,onKeyDown: function(keyCode,modifier) {
	}
	,onKeyUp: function(keyCode,modifier) {
	}
	,onModuleExit: function(code) {
	}
	,onMouseDown: function(x,y,button) {
	}
	,onMouseMove: function(x,y) {
	}
	,onMouseMoveRelative: function(x,y) {
	}
	,onMouseUp: function(x,y,button) {
	}
	,onMouseWheel: function(deltaX,deltaY,deltaMode) {
	}
	,onPreloadComplete: function() {
	}
	,onPreloadProgress: function(loaded,total) {
	}
	,onRenderContextLost: function() {
	}
	,onRenderContextRestored: function(context) {
	}
	,onTextEdit: function(text,start,length) {
	}
	,onTextInput: function(text) {
	}
	,onTouchCancel: function(touch) {
	}
	,onTouchEnd: function(touch) {
	}
	,onTouchMove: function(touch) {
	}
	,onTouchStart: function(touch) {
	}
	,onWindowActivate: function() {
	}
	,onWindowClose: function() {
	}
	,onWindowCreate: function() {
	}
	,onWindowDeactivate: function() {
	}
	,onWindowDropFile: function(file) {
	}
	,onWindowEnter: function() {
	}
	,onWindowExpose: function() {
	}
	,onWindowFocusIn: function() {
	}
	,onWindowFocusOut: function() {
	}
	,onWindowFullscreen: function() {
	}
	,onWindowLeave: function() {
	}
	,onWindowMove: function(x,y) {
	}
	,onWindowMinimize: function() {
	}
	,onWindowResize: function(width,height) {
	}
	,onWindowRestore: function() {
	}
	,removeModule: function(module) {
		if(module != null) {
			module.__unregisterLimeModule(this);
			HxOverrides.remove(this.modules,module);
		}
	}
	,render: function(context) {
	}
	,update: function(deltaTime) {
	}
	,__addWindow: function(window1) {
		if(window1 != null) {
			this.__windows.push(window1);
			this.__windowByID.h[window1.id] = window1;
			var _g = this;
			var window2 = window1;
			var tmp = function() {
				_g.__onWindowClose(window2);
			};
			window1.onClose.add(tmp,false,-10000);
			if(this.__window == null) {
				this.__window = window1;
				window1.onActivate.add($bind(this,this.onWindowActivate));
				window1.onRenderContextLost.add($bind(this,this.onRenderContextLost));
				window1.onRenderContextRestored.add($bind(this,this.onRenderContextRestored));
				window1.onDeactivate.add($bind(this,this.onWindowDeactivate));
				window1.onDropFile.add($bind(this,this.onWindowDropFile));
				window1.onEnter.add($bind(this,this.onWindowEnter));
				window1.onExpose.add($bind(this,this.onWindowExpose));
				window1.onFocusIn.add($bind(this,this.onWindowFocusIn));
				window1.onFocusOut.add($bind(this,this.onWindowFocusOut));
				window1.onFullscreen.add($bind(this,this.onWindowFullscreen));
				window1.onKeyDown.add($bind(this,this.onKeyDown));
				window1.onKeyUp.add($bind(this,this.onKeyUp));
				window1.onLeave.add($bind(this,this.onWindowLeave));
				window1.onMinimize.add($bind(this,this.onWindowMinimize));
				window1.onMouseDown.add($bind(this,this.onMouseDown));
				window1.onMouseMove.add($bind(this,this.onMouseMove));
				window1.onMouseMoveRelative.add($bind(this,this.onMouseMoveRelative));
				window1.onMouseUp.add($bind(this,this.onMouseUp));
				window1.onMouseWheel.add($bind(this,this.onMouseWheel));
				window1.onMove.add($bind(this,this.onWindowMove));
				window1.onRender.add($bind(this,this.render));
				window1.onResize.add($bind(this,this.onWindowResize));
				window1.onRestore.add($bind(this,this.onWindowRestore));
				window1.onTextEdit.add($bind(this,this.onTextEdit));
				window1.onTextInput.add($bind(this,this.onTextInput));
				this.onWindowCreate();
			}
			this.onCreateWindow.dispatch(window1);
		}
	}
	,__createWindow: function(attributes) {
		var window1 = new lime_ui_Window(this,attributes);
		if(window1.id == -1) {
			return null;
		}
		return window1;
	}
	,__registerLimeModule: function(application) {
		application.onUpdate.add($bind(this,this.update));
		application.onExit.add($bind(this,this.onModuleExit),false,0);
		application.onExit.add($bind(this,this.__onModuleExit),false,-1000);
		var gamepad = lime_ui_Gamepad.devices.iterator();
		while(gamepad.hasNext()) {
			var gamepad1 = gamepad.next();
			this.__onGamepadConnect(gamepad1);
		}
		lime_ui_Gamepad.onConnect.add($bind(this,this.__onGamepadConnect));
		var joystick = lime_ui_Joystick.devices.iterator();
		while(joystick.hasNext()) {
			var joystick1 = joystick.next();
			this.__onJoystickConnect(joystick1);
		}
		lime_ui_Joystick.onConnect.add($bind(this,this.__onJoystickConnect));
		lime_ui_Touch.onCancel.add($bind(this,this.onTouchCancel));
		lime_ui_Touch.onStart.add($bind(this,this.onTouchStart));
		lime_ui_Touch.onMove.add($bind(this,this.onTouchMove));
		lime_ui_Touch.onEnd.add($bind(this,this.onTouchEnd));
	}
	,__removeWindow: function(window1) {
		if(window1 != null && this.__windowByID.h.hasOwnProperty(window1.id)) {
			if(this.__window == window1) {
				this.__window = null;
			}
			HxOverrides.remove(this.__windows,window1);
			this.__windowByID.remove(window1.id);
			window1.close();
			this.__checkForAllWindowsClosed();
		}
	}
	,__checkForAllWindowsClosed: function() {
		if(this.__windows.length == 0) {
			lime_system_System.exit(0);
		}
	}
	,__onGamepadConnect: function(gamepad) {
		this.onGamepadConnect(gamepad);
		var _g = this;
		var gamepad1 = gamepad;
		var tmp = function(axis,value) {
			_g.onGamepadAxisMove(gamepad1,axis,value);
		};
		gamepad.onAxisMove.add(tmp);
		var _g1 = this;
		var gamepad2 = gamepad;
		var tmp = function(button) {
			_g1.onGamepadButtonDown(gamepad2,button);
		};
		gamepad.onButtonDown.add(tmp);
		var _g2 = this;
		var gamepad3 = gamepad;
		var tmp = function(button) {
			_g2.onGamepadButtonUp(gamepad3,button);
		};
		gamepad.onButtonUp.add(tmp);
		var _g3 = this;
		var gamepad4 = gamepad;
		var tmp = function() {
			_g3.onGamepadDisconnect(gamepad4);
		};
		gamepad.onDisconnect.add(tmp);
	}
	,__onJoystickConnect: function(joystick) {
		this.onJoystickConnect(joystick);
		var _g = this;
		var joystick1 = joystick;
		var tmp = function(axis,value) {
			_g.onJoystickAxisMove(joystick1,axis,value);
		};
		joystick.onAxisMove.add(tmp);
		var _g1 = this;
		var joystick2 = joystick;
		var tmp = function(button) {
			_g1.onJoystickButtonDown(joystick2,button);
		};
		joystick.onButtonDown.add(tmp);
		var _g2 = this;
		var joystick3 = joystick;
		var tmp = function(button) {
			_g2.onJoystickButtonUp(joystick3,button);
		};
		joystick.onButtonUp.add(tmp);
		var _g3 = this;
		var joystick4 = joystick;
		var tmp = function() {
			_g3.onJoystickDisconnect(joystick4);
		};
		joystick.onDisconnect.add(tmp);
		var _g4 = this;
		var joystick5 = joystick;
		var tmp = function(hat,position) {
			_g4.onJoystickHatMove(joystick5,hat,position);
		};
		joystick.onHatMove.add(tmp);
	}
	,__onModuleExit: function(code) {
		if(this.onExit.canceled) {
			return;
		}
		this.__unregisterLimeModule(this);
		this.__backend.exit();
		if(lime_app_Application.current == this) {
			lime_app_Application.current = null;
		}
	}
	,__onWindowClose: function(window1) {
		if(this.__window == window1) {
			this.onWindowClose();
		}
		this.__removeWindow(window1);
	}
	,__unregisterLimeModule: function(application) {
		application.onUpdate.remove($bind(this,this.update));
		application.onExit.remove($bind(this,this.__onModuleExit));
		application.onExit.remove($bind(this,this.onModuleExit));
		lime_ui_Gamepad.onConnect.remove($bind(this,this.__onGamepadConnect));
		lime_ui_Joystick.onConnect.remove($bind(this,this.__onJoystickConnect));
		lime_ui_Touch.onCancel.remove($bind(this,this.onTouchCancel));
		lime_ui_Touch.onStart.remove($bind(this,this.onTouchStart));
		lime_ui_Touch.onMove.remove($bind(this,this.onTouchMove));
		lime_ui_Touch.onEnd.remove($bind(this,this.onTouchEnd));
	}
	,get_preloader: function() {
		return this.__preloader;
	}
	,get_window: function() {
		return this.__window;
	}
	,get_windows: function() {
		return this.__windows;
	}
	,get_deviceOrientation: function() {
		return this.__backend.getDeviceOrientation();
	}
	,__class__: lime_app_Application
	,__properties__: {get_windows:"get_windows",get_window:"get_window",get_preloader:"get_preloader",get_deviceOrientation:"get_deviceOrientation"}
});
var ApplicationMain = function() { };
$hxClasses["ApplicationMain"] = ApplicationMain;
ApplicationMain.__name__ = "ApplicationMain";
ApplicationMain.main = function() {
	lime_system_System.__registerEntryPoint("TilBuci",ApplicationMain.create);
};
ApplicationMain.create = function(config) {
	var app = new openfl_display_Application();
	ManifestResources.init(config);
	app.meta.h["build"] = "102";
	app.meta.h["company"] = "VAR";
	app.meta.h["file"] = "TilBuci";
	app.meta.h["name"] = "TilBuci";
	app.meta.h["packageName"] = "br.com.tilbuci";
	app.meta.h["version"] = "1.0.0";
	var attributes = { allowHighDPI : true, alwaysOnTop : false, borderless : false, element : null, frameRate : 60, height : 0, hidden : false, maximized : false, minimized : false, parameters : { }, resizable : true, title : "TilBuci", width : 0, x : null, y : null};
	attributes.context = { antialiasing : 0, background : 0, colorDepth : 32, depth : true, hardware : true, stencil : true, type : null, vsync : false};
	if(app.__window == null) {
		if(config != null) {
			var _g = 0;
			var _g1 = Reflect.fields(config);
			while(_g < _g1.length) {
				var field = _g1[_g];
				++_g;
				if(Object.prototype.hasOwnProperty.call(attributes,field)) {
					attributes[field] = Reflect.field(config,field);
				} else if(Object.prototype.hasOwnProperty.call(attributes.context,field)) {
					attributes.context[field] = Reflect.field(config,field);
				}
			}
		}
	}
	app.createWindow(attributes);
	var preloader = new openfl_display_Preloader(new Preloader());
	app.__preloader.onProgress.add(function(loaded,total) {
		preloader.update(loaded,total);
	});
	app.__preloader.onComplete.add(function() {
		preloader.start();
	});
	var stage = app.__window.stage;
	var tmp = function() {
		ApplicationMain.start(stage);
	};
	preloader.onComplete.add(tmp);
	var _g = 0;
	var _g1 = ManifestResources.preloadLibraries;
	while(_g < _g1.length) {
		var library = _g1[_g];
		++_g;
		app.__preloader.addLibrary(library);
	}
	var _g = 0;
	var _g1 = ManifestResources.preloadLibraryNames;
	while(_g < _g1.length) {
		var name = _g1[_g];
		++_g;
		app.__preloader.addLibraryName(name);
	}
	app.__preloader.load();
	var result = app.exec();
};
ApplicationMain.start = function(stage) {
	if(stage.__uncaughtErrorEvents.__enabled) {
		try {
			var current = stage.getChildAt(0);
			if(current == null || !((current) instanceof openfl_display_DisplayObjectContainer)) {
				current = new openfl_display_MovieClip();
				stage.addChild(current);
			}
			new DocumentClass(current);
			stage.dispatchEvent(new openfl_events_Event("resize",false,false));
			if(stage.window.__fullscreen) {
				stage.dispatchEvent(new openfl_events_FullScreenEvent("fullScreen",false,false,true,true));
			}
		} catch( _g ) {
			haxe_NativeStackTrace.lastError = _g;
			var e = haxe_Exception.caught(_g).unwrap();
			stage.__handleError(e);
		}
	} else {
		var current = stage.getChildAt(0);
		if(current == null || !((current) instanceof openfl_display_DisplayObjectContainer)) {
			current = new openfl_display_MovieClip();
			stage.addChild(current);
		}
		new DocumentClass(current);
		stage.dispatchEvent(new openfl_events_Event("resize",false,false));
		if(stage.window.__fullscreen) {
			stage.dispatchEvent(new openfl_events_FullScreenEvent("fullScreen",false,false,true,true));
		}
	}
};
var openfl_events_IEventDispatcher = function() { };
$hxClasses["openfl.events.IEventDispatcher"] = openfl_events_IEventDispatcher;
openfl_events_IEventDispatcher.__name__ = "openfl.events.IEventDispatcher";
openfl_events_IEventDispatcher.__isInterface__ = true;
openfl_events_IEventDispatcher.prototype = {
	addEventListener: null
	,dispatchEvent: null
	,hasEventListener: null
	,removeEventListener: null
	,willTrigger: null
	,__class__: openfl_events_IEventDispatcher
};
var openfl_events_EventDispatcher = function(target) {
	if(target != null) {
		this.__targetDispatcher = target;
	}
};
$hxClasses["openfl.events.EventDispatcher"] = openfl_events_EventDispatcher;
openfl_events_EventDispatcher.__name__ = "openfl.events.EventDispatcher";
openfl_events_EventDispatcher.__interfaces__ = [openfl_events_IEventDispatcher];
openfl_events_EventDispatcher.prototype = {
	__eventMap: null
	,__iterators: null
	,__targetDispatcher: null
	,addEventListener: function(type,listener,useCapture,priority,useWeakReference) {
		if(useWeakReference == null) {
			useWeakReference = false;
		}
		if(priority == null) {
			priority = 0;
		}
		if(useCapture == null) {
			useCapture = false;
		}
		if(listener == null) {
			return;
		}
		if(this.__eventMap == null) {
			this.__eventMap = new haxe_ds_StringMap();
			this.__iterators = new haxe_ds_StringMap();
		}
		if(!Object.prototype.hasOwnProperty.call(this.__eventMap.h,type)) {
			var list = [];
			list.push(new openfl_events__$EventDispatcher_Listener(listener,useCapture,priority,useWeakReference));
			var iterator = new openfl_events__$EventDispatcher_DispatchIterator(list);
			this.__eventMap.h[type] = list;
			this.__iterators.h[type] = [iterator];
		} else {
			var list = this.__eventMap.h[type];
			var _g = 0;
			var _g1 = list.length;
			while(_g < _g1) {
				var i = _g++;
				if(list[i].match(listener,useCapture)) {
					return;
				}
			}
			var iterators = this.__iterators.h[type];
			var _g = 0;
			while(_g < iterators.length) {
				var iterator = iterators[_g];
				++_g;
				if(iterator.active) {
					iterator.copy();
				}
			}
			this.__addListenerByPriority(list,new openfl_events__$EventDispatcher_Listener(listener,useCapture,priority,useWeakReference));
		}
	}
	,dispatchEvent: function(event) {
		if(this.__targetDispatcher != null) {
			event.target = this.__targetDispatcher;
		} else {
			event.target = this;
		}
		return this.__dispatchEvent(event);
	}
	,hasEventListener: function(type) {
		if(this.__eventMap == null) {
			return false;
		}
		return Object.prototype.hasOwnProperty.call(this.__eventMap.h,type);
	}
	,removeEventListener: function(type,listener,useCapture) {
		if(useCapture == null) {
			useCapture = false;
		}
		if(this.__eventMap == null || listener == null) {
			return;
		}
		var list = this.__eventMap.h[type];
		if(list == null) {
			return;
		}
		var iterators = this.__iterators.h[type];
		var _g = 0;
		var _g1 = list.length;
		while(_g < _g1) {
			var i = _g++;
			if(list[i].match(listener,useCapture)) {
				var _g2 = 0;
				while(_g2 < iterators.length) {
					var iterator = iterators[_g2];
					++_g2;
					iterator.remove(list[i],i);
				}
				list.splice(i,1);
				break;
			}
		}
		if(list.length == 0) {
			var _this = this.__eventMap;
			var key = type;
			if(Object.prototype.hasOwnProperty.call(_this.h,key)) {
				delete(_this.h[key]);
			}
			var _this = this.__iterators;
			var key = type;
			if(Object.prototype.hasOwnProperty.call(_this.h,key)) {
				delete(_this.h[key]);
			}
		}
		var h = this.__eventMap.h;
		var inlStringMapValueIterator_h = h;
		var inlStringMapValueIterator_keys = Object.keys(h);
		var inlStringMapValueIterator_length = inlStringMapValueIterator_keys.length;
		var inlStringMapValueIterator_current = 0;
		if(inlStringMapValueIterator_current >= inlStringMapValueIterator_length) {
			this.__eventMap = null;
			this.__iterators = null;
		}
	}
	,toString: function() {
		var c = js_Boot.getClass(this);
		var full = c.__name__;
		var short = full.split(".").pop();
		return "[object " + short + "]";
	}
	,willTrigger: function(type) {
		return this.hasEventListener(type);
	}
	,__dispatchEvent: function(event) {
		if(this.__eventMap == null || event == null) {
			return true;
		}
		var type = event.type;
		var list = this.__eventMap.h[type];
		if(list == null) {
			return true;
		}
		if(event.target == null) {
			if(this.__targetDispatcher != null) {
				event.target = this.__targetDispatcher;
			} else {
				event.target = this;
			}
		}
		event.currentTarget = this;
		var capture = event.eventPhase == 1;
		var iterators = this.__iterators.h[type];
		var iterator = iterators[0];
		if(iterator.active) {
			iterator = new openfl_events__$EventDispatcher_DispatchIterator(list);
			iterators.push(iterator);
		}
		iterator.start();
		var listener = iterator;
		while(listener.hasNext()) {
			var listener1 = listener.next();
			if(listener1 == null) {
				continue;
			}
			if(listener1.useCapture == capture) {
				if(listener1.useWeakReference && listener1.weakRefCallback != null) {
					var weakCallback = listener1.weakRefCallback.deref();
					if(weakCallback == null) {
						var indexToRemove = iterator.index - 1;
						list.splice(indexToRemove,1);
						iterator.remove(listener1,indexToRemove);
					} else if(openfl_Lib.get_current() != null && openfl_Lib.get_current().stage != null && openfl_Lib.get_current().stage.__uncaughtErrorEvents.__enabled) {
						try {
							weakCallback(event);
						} catch( _g ) {
							haxe_NativeStackTrace.lastError = _g;
							var e = haxe_Exception.caught(_g).unwrap();
							if(!((event) instanceof openfl_events_UncaughtErrorEvent)) {
								openfl_Lib.get_current().stage.__handleError(e);
							}
						}
					} else {
						weakCallback(event);
					}
				} else if(openfl_Lib.get_current() != null && openfl_Lib.get_current().stage != null && openfl_Lib.get_current().stage.__uncaughtErrorEvents.__enabled) {
					try {
						listener1.callback(event);
					} catch( _g1 ) {
						haxe_NativeStackTrace.lastError = _g1;
						var e1 = haxe_Exception.caught(_g1).unwrap();
						if(!((event) instanceof openfl_events_UncaughtErrorEvent)) {
							openfl_Lib.get_current().stage.__handleError(e1);
						}
					}
				} else {
					listener1.callback(event);
				}
				if(event.__isCanceledNow) {
					break;
				}
			}
		}
		iterator.stop();
		if(iterator != iterators[0]) {
			HxOverrides.remove(iterators,iterator);
		} else {
			iterator.reset(list);
		}
		return !event.isDefaultPrevented();
	}
	,__removeAllListeners: function() {
		this.__eventMap = null;
		this.__iterators = null;
	}
	,__addListenerByPriority: function(list,listener) {
		var numElements = list.length;
		var addAtPosition = numElements;
		var _g = 0;
		var _g1 = numElements;
		while(_g < _g1) {
			var i = _g++;
			if(list[i].priority < listener.priority) {
				addAtPosition = i;
				break;
			}
		}
		list.splice(addAtPosition,0,listener);
	}
	,__class__: openfl_events_EventDispatcher
};
var openfl_display_IBitmapDrawable = function() { };
$hxClasses["openfl.display.IBitmapDrawable"] = openfl_display_IBitmapDrawable;
openfl_display_IBitmapDrawable.__name__ = "openfl.display.IBitmapDrawable";
openfl_display_IBitmapDrawable.__isInterface__ = true;
openfl_display_IBitmapDrawable.prototype = {
	__blendMode: null
	,__drawableType: null
	,__isMask: null
	,__renderable: null
	,__renderTransform: null
	,__transform: null
	,__worldAlpha: null
	,__worldColorTransform: null
	,__worldTransform: null
	,__getBounds: null
	,__update: null
	,__updateTransforms: null
	,__mask: null
	,__scrollRect: null
	,__class__: openfl_display_IBitmapDrawable
};
var openfl_Vector = {};
openfl_Vector.__properties__ = {set_length:"set_length",get_length:"get_length",set_fixed:"set_fixed",get_fixed:"get_fixed"};
openfl_Vector.concat = function(this1,vec) {
	return this1.concat(vec);
};
openfl_Vector.copy = function(this1) {
	return this1.copy();
};
openfl_Vector.every = function(this1,callback,thisObject) {
	var _g = 0;
	var _g1 = this1.get_length();
	while(_g < _g1) {
		var i = _g++;
		this1.__tempIndex = i;
		if(thisObject != null) {
			if(callback.apply(thisObject,[this1.get(i),i,this1]) == false) {
				break;
			}
		} else if(callback(this1.get(i),i,this1) == false) {
			break;
		}
	}
	return this1.__tempIndex == this1.get_length() - 1;
};
openfl_Vector.filter = function(this1,callback) {
	return this1.filter(callback);
};
openfl_Vector.get = function(this1,index) {
	return this1.get(index);
};
openfl_Vector.indexOf = function(this1,searchElement,fromIndex) {
	if(fromIndex == null) {
		fromIndex = 0;
	}
	return this1.indexOf(searchElement,fromIndex);
};
openfl_Vector.insertAt = function(this1,index,element) {
	this1.insertAt(index,element);
};
openfl_Vector.iterator = function(this1) {
	return this1.iterator();
};
openfl_Vector.join = function(this1,sep) {
	if(sep == null) {
		sep = ",";
	}
	return this1.join(sep);
};
openfl_Vector.lastIndexOf = function(this1,searchElement,fromIndex) {
	return this1.lastIndexOf(searchElement,fromIndex);
};
openfl_Vector.pop = function(this1) {
	return this1.pop();
};
openfl_Vector.removeAt = function(this1,index) {
	return this1.removeAt(index);
};
openfl_Vector.reverse = function(this1) {
	return this1.reverse();
};
openfl_Vector.set = function(this1,index,value) {
	return this1.set(index,value);
};
openfl_Vector.shift = function(this1) {
	return this1.shift();
};
openfl_Vector.slice = function(this1,startIndex,endIndex) {
	if(startIndex == null) {
		startIndex = 0;
	}
	return this1.slice(startIndex,endIndex);
};
openfl_Vector.some = function(this1,callback,thisObject) {
	var _g = 0;
	var _g1 = this1.get_length();
	while(_g < _g1) {
		var i = _g++;
		this1.__tempIndex = i;
		if(thisObject != null) {
			if(callback.apply(thisObject,[this1.get(i),i,this1]) == true) {
				break;
			}
		} else if(callback(this1.get(i),i,this1)) {
			break;
		}
		if(i == this1.get_length() - 1) {
			this1.__tempIndex++;
		}
	}
	return this1.__tempIndex < this1.get_length() - 1;
};
openfl_Vector.sort = function(this1,sortBehavior) {
	this1.sort(sortBehavior);
};
openfl_Vector.splice = function(this1,startIndex,deleteCount) {
	var $l=arguments.length;
	var items = new Array($l>3?$l-3:0);
	for(var $i=3;$i<$l;++$i){items[$i-3]=arguments[$i];}
	this1.__tempIndex = startIndex;
	var _g_current = 0;
	var _g_args = items;
	while(_g_current < _g_args.length) {
		var item = _g_args[_g_current++];
		this1.insertAt(this1.__tempIndex,item);
		this1.__tempIndex++;
	}
	return this1.splice(this1.__tempIndex,deleteCount);
};
openfl_Vector.toString = function(this1) {
	if(this1 != null) {
		return this1.toString();
	} else {
		return null;
	}
};
openfl_Vector.ofValues = function() {
	var $l=arguments.length;
	var values = new Array($l>0?$l-0:0);
	for(var $i=0;$i<$l;++$i){values[$i-0]=arguments[$i];}
	var vector = openfl_Vector.toNullVector(null);
	var _g = 0;
	var _g1 = values.length;
	while(_g < _g1) {
		var i = _g++;
		vector.set(i,values[i]);
	}
	return vector;
};
openfl_Vector.convert = function(vec) {
	return vec;
};
openfl_Vector.toBoolVector = function(t,length,fixed,array) {
	return new openfl__$Vector_BoolVector(length,fixed,array);
};
openfl_Vector.toIntVector = function(t,length,fixed,array) {
	return new openfl__$Vector_IntVector(length,fixed,array);
};
openfl_Vector.toFloatVector = function(t,length,fixed,array) {
	return new openfl__$Vector_FloatVector(length,fixed,array,true);
};
openfl_Vector.toFunctionVector = function(t,length,fixed,array) {
	return new openfl__$Vector_FunctionVector(length,fixed,array);
};
openfl_Vector.toObjectVector = function(t,length,fixed,array) {
	return new openfl__$Vector_ObjectVector(length,fixed,array,true);
};
openfl_Vector.toNullVector = function(t,length,fixed,array) {
	return new openfl__$Vector_ObjectVector(length,fixed,array,true);
};
openfl_Vector.fromBoolVector = function(vector) {
	return vector;
};
openfl_Vector.fromIntVector = function(vector) {
	return vector;
};
openfl_Vector.fromFloatVector = function(vector) {
	return vector;
};
openfl_Vector.fromFunctionVector = function(vector) {
	return vector;
};
openfl_Vector.fromObjectVector = function(vector) {
	return vector;
};
openfl_Vector.get_fixed = function(this1) {
	return this1.fixed;
};
openfl_Vector.set_fixed = function(this1,value) {
	return this1.fixed = value;
};
openfl_Vector.get_length = function(this1) {
	return this1.get_length();
};
openfl_Vector.set_length = function(this1,value) {
	return this1.set_length(value);
};
var lime_utils_ObjectPool = function(create,clean,size) {
	this.__pool = new haxe_ds_ObjectMap();
	this.activeObjects = 0;
	this.inactiveObjects = 0;
	this.__inactiveObject0 = null;
	this.__inactiveObject1 = null;
	this.__inactiveObjectList = new haxe_ds_List();
	if(create != null) {
		this.create = create;
	}
	if(clean != null) {
		this.clean = clean;
	}
	if(size != null) {
		this.set_size(size);
	}
};
$hxClasses["lime.utils.ObjectPool"] = lime_utils_ObjectPool;
lime_utils_ObjectPool.__name__ = "lime.utils.ObjectPool";
lime_utils_ObjectPool.prototype = {
	activeObjects: null
	,inactiveObjects: null
	,__inactiveObject0: null
	,__inactiveObject1: null
	,__inactiveObjectList: null
	,__pool: null
	,__size: null
	,add: function(object) {
		if(object != null && !this.__pool.exists(object)) {
			this.__pool.set(object,false);
			this.clean(object);
			if(this.__inactiveObject0 == null) {
				this.__inactiveObject0 = object;
			} else if(this.__inactiveObject1 == null) {
				this.__inactiveObject1 = object;
			} else {
				this.__inactiveObjectList.add(object);
			}
			this.inactiveObjects++;
		}
	}
	,clean: function(object) {
	}
	,clear: function() {
		this.__pool = new haxe_ds_ObjectMap();
		this.activeObjects = 0;
		this.inactiveObjects = 0;
		this.__inactiveObject0 = null;
		this.__inactiveObject1 = null;
		this.__inactiveObjectList.clear();
	}
	,create: function() {
		return null;
	}
	,get: function() {
		var object = null;
		if(this.inactiveObjects > 0) {
			var object1 = null;
			if(this.__inactiveObject0 != null) {
				object1 = this.__inactiveObject0;
				this.__inactiveObject0 = null;
			} else if(this.__inactiveObject1 != null) {
				object1 = this.__inactiveObject1;
				this.__inactiveObject1 = null;
			} else {
				object1 = this.__inactiveObjectList.pop();
				if(this.__inactiveObjectList.length > 0) {
					this.__inactiveObject0 = this.__inactiveObjectList.pop();
				}
				if(this.__inactiveObjectList.length > 0) {
					this.__inactiveObject1 = this.__inactiveObjectList.pop();
				}
			}
			this.inactiveObjects--;
			this.activeObjects++;
			object = object1;
		} else if(this.__size == null || this.activeObjects < this.__size) {
			object = this.create();
			if(object != null) {
				this.__pool.set(object,true);
				this.activeObjects++;
			}
		}
		return object;
	}
	,release: function(object) {
		this.activeObjects--;
		if(this.__size == null || this.activeObjects + this.inactiveObjects < this.__size) {
			this.clean(object);
			if(this.__inactiveObject0 == null) {
				this.__inactiveObject0 = object;
			} else if(this.__inactiveObject1 == null) {
				this.__inactiveObject1 = object;
			} else {
				this.__inactiveObjectList.add(object);
			}
			this.inactiveObjects++;
		} else {
			this.__pool.remove(object);
		}
	}
	,remove: function(object) {
		if(object != null && this.__pool.exists(object)) {
			this.__pool.remove(object);
			if(this.__inactiveObject0 == object) {
				this.__inactiveObject0 = null;
				this.inactiveObjects--;
			} else if(this.__inactiveObject1 == object) {
				this.__inactiveObject1 = null;
				this.inactiveObjects--;
			} else if(this.__inactiveObjectList.remove(object)) {
				this.inactiveObjects--;
			} else {
				this.activeObjects--;
			}
		}
	}
	,__addInactive: function(object) {
		if(this.__inactiveObject0 == null) {
			this.__inactiveObject0 = object;
		} else if(this.__inactiveObject1 == null) {
			this.__inactiveObject1 = object;
		} else {
			this.__inactiveObjectList.add(object);
		}
		this.inactiveObjects++;
	}
	,__getInactive: function() {
		var object = null;
		if(this.__inactiveObject0 != null) {
			object = this.__inactiveObject0;
			this.__inactiveObject0 = null;
		} else if(this.__inactiveObject1 != null) {
			object = this.__inactiveObject1;
			this.__inactiveObject1 = null;
		} else {
			object = this.__inactiveObjectList.pop();
			if(this.__inactiveObjectList.length > 0) {
				this.__inactiveObject0 = this.__inactiveObjectList.pop();
			}
			if(this.__inactiveObjectList.length > 0) {
				this.__inactiveObject1 = this.__inactiveObjectList.pop();
			}
		}
		this.inactiveObjects--;
		this.activeObjects++;
		return object;
	}
	,__removeInactive: function(count) {
		if(count <= 0 || this.inactiveObjects == 0) {
			return;
		}
		if(this.__inactiveObject0 != null) {
			this.__pool.remove(this.__inactiveObject0);
			this.__inactiveObject0 = null;
			this.inactiveObjects--;
			--count;
		}
		if(count == 0 || this.inactiveObjects == 0) {
			return;
		}
		if(this.__inactiveObject1 != null) {
			this.__pool.remove(this.__inactiveObject1);
			this.__inactiveObject1 = null;
			this.inactiveObjects--;
			--count;
		}
		if(count == 0 || this.inactiveObjects == 0) {
			return;
		}
		var _g_head = this.__inactiveObjectList.h;
		while(_g_head != null) {
			var val = _g_head.item;
			_g_head = _g_head.next;
			var object = val;
			this.__pool.remove(object);
			this.__inactiveObjectList.remove(object);
			this.inactiveObjects--;
			--count;
			if(count == 0 || this.inactiveObjects == 0) {
				return;
			}
		}
	}
	,get_size: function() {
		return this.__size;
	}
	,set_size: function(value) {
		if(value == null) {
			this.__size = null;
		} else {
			var current = this.inactiveObjects + this.activeObjects;
			this.__size = value;
			if(current > value) {
				this.__removeInactive(current - value);
			} else if(value > current) {
				var object;
				var _g = 0;
				var _g1 = value - current;
				while(_g < _g1) {
					var i = _g++;
					object = this.create();
					if(object != null) {
						this.__pool.set(object,false);
						this.__inactiveObjectList.add(object);
						this.inactiveObjects++;
					} else {
						break;
					}
				}
			}
		}
		return value;
	}
	,__class__: lime_utils_ObjectPool
	,__properties__: {set_size:"set_size",get_size:"get_size"}
};
var haxe_IMap = function() { };
$hxClasses["haxe.IMap"] = haxe_IMap;
haxe_IMap.__name__ = "haxe.IMap";
haxe_IMap.__isInterface__ = true;
haxe_IMap.prototype = {
	get: null
	,set: null
	,exists: null
	,remove: null
	,keys: null
	,iterator: null
	,keyValueIterator: null
	,__class__: haxe_IMap
};
var haxe_ds_ObjectMap = function() {
	this.h = { __keys__ : { }};
};
$hxClasses["haxe.ds.ObjectMap"] = haxe_ds_ObjectMap;
haxe_ds_ObjectMap.__name__ = "haxe.ds.ObjectMap";
haxe_ds_ObjectMap.__interfaces__ = [haxe_IMap];
haxe_ds_ObjectMap.prototype = {
	h: null
	,set: function(key,value) {
		var id = key.__id__;
		if(id == null) {
			id = (key.__id__ = $global.$haxeUID++);
		}
		this.h[id] = value;
		this.h.__keys__[id] = key;
	}
	,get: function(key) {
		return this.h[key.__id__];
	}
	,exists: function(key) {
		return this.h.__keys__[key.__id__] != null;
	}
	,remove: function(key) {
		var id = key.__id__;
		if(this.h.__keys__[id] == null) {
			return false;
		}
		delete(this.h[id]);
		delete(this.h.__keys__[id]);
		return true;
	}
	,keys: function() {
		var a = [];
		for( var key in this.h.__keys__ ) {
		if(this.h.hasOwnProperty(key)) {
			a.push(this.h.__keys__[key]);
		}
		}
		return new haxe_iterators_ArrayIterator(a);
	}
	,iterator: function() {
		return { ref : this.h, it : this.keys(), hasNext : function() {
			return this.it.hasNext();
		}, next : function() {
			var i = this.it.next();
			return this.ref[i.__id__];
		}};
	}
	,keyValueIterator: function() {
		return new haxe_iterators_MapKeyValueIterator(this);
	}
	,toString: function() {
		var s_b = "";
		s_b += "[";
		var it = this.keys();
		var i = it;
		while(i.hasNext()) {
			var i1 = i.next();
			s_b += Std.string(Std.string(i1));
			s_b += " => ";
			s_b += Std.string(Std.string(this.h[i1.__id__]));
			if(it.hasNext()) {
				s_b += ", ";
			}
		}
		s_b += "]";
		return s_b;
	}
	,__class__: haxe_ds_ObjectMap
};
var haxe_ds_List = function() {
	this.length = 0;
};
$hxClasses["haxe.ds.List"] = haxe_ds_List;
haxe_ds_List.__name__ = "haxe.ds.List";
haxe_ds_List.prototype = {
	h: null
	,q: null
	,length: null
	,add: function(item) {
		var x = new haxe_ds__$List_ListNode(item,null);
		if(this.h == null) {
			this.h = x;
		} else {
			this.q.next = x;
		}
		this.q = x;
		this.length++;
	}
	,push: function(item) {
		var x = new haxe_ds__$List_ListNode(item,this.h);
		this.h = x;
		if(this.q == null) {
			this.q = x;
		}
		this.length++;
	}
	,pop: function() {
		if(this.h == null) {
			return null;
		}
		var x = this.h.item;
		this.h = this.h.next;
		if(this.h == null) {
			this.q = null;
		}
		this.length--;
		return x;
	}
	,isEmpty: function() {
		return this.h == null;
	}
	,clear: function() {
		this.h = null;
		this.q = null;
		this.length = 0;
	}
	,remove: function(v) {
		var prev = null;
		var l = this.h;
		while(l != null) {
			if(l.item == v) {
				if(prev == null) {
					this.h = l.next;
				} else {
					prev.next = l.next;
				}
				if(this.q == l) {
					this.q = prev;
				}
				this.length--;
				return true;
			}
			prev = l;
			l = l.next;
		}
		return false;
	}
	,iterator: function() {
		return new haxe_ds__$List_ListIterator(this.h);
	}
	,__class__: haxe_ds_List
};
var openfl_display_DisplayObject = function() {
	this.__hasClippingLayer = false;
	openfl_events_EventDispatcher.call(this);
	this.__drawableType = 1;
	this.__alpha = 1;
	this.__blendMode = 10;
	this.__cacheAsBitmap = false;
	this.__transform = new openfl_geom_Matrix();
	this.__visible = true;
	this.__rotation = 0;
	this.__rotationSine = 0;
	this.__rotationCosine = 1;
	this.__scaleX = 1;
	this.__scaleY = 1;
	this.__worldAlpha = 1;
	this.__worldBlendMode = 10;
	this.__worldTransform = new openfl_geom_Matrix();
	this.__worldColorTransform = new openfl_geom_ColorTransform();
	this.__renderTransform = new openfl_geom_Matrix();
	this.__worldVisible = true;
	this.set_name("instance" + ++openfl_display_DisplayObject.__instanceCount);
	if(openfl_display_DisplayObject.__initStage != null) {
		this.stage = openfl_display_DisplayObject.__initStage;
		openfl_display_DisplayObject.__initStage = null;
		this.stage.addChild(this);
	}
};
$hxClasses["openfl.display.DisplayObject"] = openfl_display_DisplayObject;
openfl_display_DisplayObject.__name__ = "openfl.display.DisplayObject";
openfl_display_DisplayObject.__interfaces__ = [openfl_display_IBitmapDrawable];
openfl_display_DisplayObject.__calculateAbsoluteTransform = function(local,parentTransform,target) {
	target.a = local.a * parentTransform.a + local.b * parentTransform.c;
	target.b = local.a * parentTransform.b + local.b * parentTransform.d;
	target.c = local.c * parentTransform.a + local.d * parentTransform.c;
	target.d = local.c * parentTransform.b + local.d * parentTransform.d;
	target.tx = local.tx * parentTransform.a + local.ty * parentTransform.c + parentTransform.tx;
	target.ty = local.tx * parentTransform.b + local.ty * parentTransform.d + parentTransform.ty;
};
openfl_display_DisplayObject.__super__ = openfl_events_EventDispatcher;
openfl_display_DisplayObject.prototype = $extend(openfl_events_EventDispatcher.prototype,{
	__hasClippingLayer: null
	,opaqueBackground: null
	,parent: null
	,stage: null
	,__alpha: null
	,__blendMode: null
	,__cacheAsBitmap: null
	,__cacheAsBitmapMatrix: null
	,__cacheBitmap: null
	,__cacheBitmapBackground: null
	,__cacheBitmapColorTransform: null
	,__cacheBitmapData: null
	,__cacheBitmapData2: null
	,__cacheBitmapData3: null
	,__cacheBitmapMatrix: null
	,__cacheBitmapRenderer: null
	,__cairo: null
	,__children: null
	,__customRenderClear: null
	,__customRenderEvent: null
	,__drawableType: null
	,__filters: null
	,__graphics: null
	,__interactive: null
	,__isCacheBitmapRender: null
	,__isMask: null
	,__loaderInfo: null
	,__mask: null
	,__maskTarget: null
	,__metaData: null
	,__name: null
	,__objectTransform: null
	,__renderable: null
	,__renderDirty: null
	,__renderParent: null
	,__renderTransform: null
	,__renderTransformCache: null
	,__renderTransformChanged: null
	,__rotation: null
	,__rotationCosine: null
	,__rotationSine: null
	,__scale9Grid: null
	,__scaleX: null
	,__scaleY: null
	,__scrollRect: null
	,__shader: null
	,__tempPoint: null
	,__transform: null
	,__transformDirty: null
	,__visible: null
	,__worldAlpha: null
	,__worldAlphaChanged: null
	,__worldBlendMode: null
	,__worldClip: null
	,__worldClipChanged: null
	,__worldColorTransform: null
	,__worldShader: null
	,__worldScale9Grid: null
	,__worldTransform: null
	,__worldVisible: null
	,__worldVisibleChanged: null
	,__worldTransformInvalid: null
	,__worldZ: null
	,__canvas: null
	,__context: null
	,__style: null
	,addEventListener: function(type,listener,useCapture,priority,useWeakReference) {
		if(useWeakReference == null) {
			useWeakReference = false;
		}
		if(priority == null) {
			priority = 0;
		}
		if(useCapture == null) {
			useCapture = false;
		}
		switch(type) {
		case "activate":case "deactivate":case "enterFrame":case "exitFrame":case "frameConstructed":case "render":
			if(!Object.prototype.hasOwnProperty.call(openfl_display_DisplayObject.__broadcastEvents.h,type)) {
				openfl_display_DisplayObject.__broadcastEvents.h[type] = [];
			}
			var dispatchers = openfl_display_DisplayObject.__broadcastEvents.h[type];
			if(dispatchers.indexOf(this) == -1) {
				dispatchers.push(this);
			}
			break;
		case "clearDOM":case "renderCairo":case "renderCanvas":case "renderDOM":case "renderOpenGL":
			if(this.__customRenderEvent == null) {
				this.__customRenderEvent = new openfl_events_RenderEvent(null);
				this.__customRenderEvent.objectColorTransform = new openfl_geom_ColorTransform();
				this.__customRenderEvent.objectMatrix = new openfl_geom_Matrix();
				this.__customRenderClear = true;
			}
			break;
		default:
		}
		openfl_events_EventDispatcher.prototype.addEventListener.call(this,type,listener,useCapture,priority,useWeakReference);
	}
	,dispatchEvent: function(event) {
		if(((event) instanceof openfl_events_MouseEvent)) {
			var mouseEvent = event;
			var _this = this.__getRenderTransform();
			mouseEvent.stageX = mouseEvent.localX * _this.a + mouseEvent.localY * _this.c + _this.tx;
			var _this = this.__getRenderTransform();
			mouseEvent.stageY = mouseEvent.localX * _this.b + mouseEvent.localY * _this.d + _this.ty;
		} else if(((event) instanceof openfl_events_TouchEvent)) {
			var touchEvent = event;
			var _this = this.__getRenderTransform();
			touchEvent.stageX = touchEvent.localX * _this.a + touchEvent.localY * _this.c + _this.tx;
			var _this = this.__getRenderTransform();
			touchEvent.stageY = touchEvent.localX * _this.b + touchEvent.localY * _this.d + _this.ty;
		}
		event.target = this;
		return this.__dispatchWithCapture(event);
	}
	,getBounds: function(targetCoordinateSpace) {
		var matrix = openfl_geom_Matrix.__pool.get();
		if(targetCoordinateSpace != null && targetCoordinateSpace != this) {
			matrix.copyFrom(this.__getWorldTransform());
			var targetMatrix = openfl_geom_Matrix.__pool.get();
			targetMatrix.copyFrom(targetCoordinateSpace.__getWorldTransform());
			targetMatrix.invert();
			matrix.concat(targetMatrix);
			openfl_geom_Matrix.__pool.release(targetMatrix);
		} else {
			matrix.identity();
		}
		var bounds = new openfl_geom_Rectangle();
		this.__getBounds(bounds,matrix);
		openfl_geom_Matrix.__pool.release(matrix);
		return bounds;
	}
	,getRect: function(targetCoordinateSpace) {
		return this.getBounds(targetCoordinateSpace);
	}
	,globalToLocal: function(pos) {
		return this.__globalToLocal(pos,new openfl_geom_Point());
	}
	,hitTestObject: function(obj) {
		if(obj != null && obj.parent != null && this.parent != null) {
			var currentBounds = this.getBounds(this);
			var targetBounds = obj.getBounds(this);
			return currentBounds.intersects(targetBounds);
		}
		return false;
	}
	,hitTestPoint: function(x,y,shapeFlag) {
		if(shapeFlag == null) {
			shapeFlag = false;
		}
		if(this.stage != null) {
			return this.__hitTest(x,y,shapeFlag,null,false,this);
		} else {
			return false;
		}
	}
	,invalidate: function() {
		if(!this.__renderDirty) {
			this.__renderDirty = true;
			this.__setParentRenderDirty();
		}
	}
	,localToGlobal: function(point) {
		return this.__getRenderTransform().transformPoint(point);
	}
	,removeEventListener: function(type,listener,useCapture) {
		if(useCapture == null) {
			useCapture = false;
		}
		openfl_events_EventDispatcher.prototype.removeEventListener.call(this,type,listener,useCapture);
		switch(type) {
		case "activate":case "deactivate":case "enterFrame":case "exitFrame":case "frameConstructed":case "render":
			if(!this.hasEventListener(type)) {
				if(Object.prototype.hasOwnProperty.call(openfl_display_DisplayObject.__broadcastEvents.h,type)) {
					HxOverrides.remove(openfl_display_DisplayObject.__broadcastEvents.h[type],this);
				}
			}
			break;
		case "clearDOM":case "renderCairo":case "renderCanvas":case "renderDOM":case "renderOpenGL":
			if(!this.hasEventListener("clearDOM") && !this.hasEventListener("renderCairo") && !this.hasEventListener("renderCanvas") && !this.hasEventListener("renderDOM") && !this.hasEventListener("renderOpenGL")) {
				this.__customRenderEvent = null;
			}
			break;
		default:
		}
	}
	,__cleanup: function() {
		this.__cairo = null;
		if(this.__canvas != null) {
			this.__canvas.width = 0;
			this.__canvas.height = 0;
			this.__canvas = null;
		}
		if(this.__context != null) {
			this.__context.clearRect(0,0,0,0);
			this.__context = null;
		}
		if(this.__graphics != null) {
			this.__graphics.__cleanup();
		}
		if(this.__cacheBitmap != null) {
			this.__cacheBitmap.__cleanup();
			this.__cacheBitmap = null;
		}
		if(this.__cacheBitmapData != null) {
			this.__cacheBitmapData.dispose();
			this.__cacheBitmapData = null;
		}
		if(this.__cacheBitmapData2 != null) {
			this.__cacheBitmapData2.dispose();
			this.__cacheBitmapData2 = null;
		}
		if(this.__cacheBitmapData3 != null) {
			this.__cacheBitmapData3.dispose();
			this.__cacheBitmapData3 = null;
		}
	}
	,__dispatch: function(event) {
		if(this.__eventMap != null && this.hasEventListener(event.type)) {
			var result = openfl_events_EventDispatcher.prototype.__dispatchEvent.call(this,event);
			if(event.__isCanceled) {
				return true;
			}
			return result;
		}
		return true;
	}
	,__dispatchChildren: function(event) {
	}
	,__dispatchEvent: function(event) {
		var parent = event.bubbles ? this.parent : null;
		var result = openfl_events_EventDispatcher.prototype.__dispatchEvent.call(this,event);
		if(event.__isCanceled) {
			return true;
		}
		if(parent != null && parent != this) {
			event.eventPhase = 3;
			if(event.target == null) {
				event.target = this;
			}
			parent.__dispatchEvent(event);
		}
		return result;
	}
	,__dispatchWithCapture: function(event) {
		if(event.target == null) {
			event.target = this;
		}
		if(this.parent != null) {
			event.eventPhase = 1;
			if(this.parent == this.stage) {
				this.parent.__dispatch(event);
			} else {
				var stack = openfl_display_DisplayObject.__tempStack.get();
				var parent = this.parent;
				var i = 0;
				while(parent != null) {
					stack.set(i,parent);
					parent = parent.parent;
					++i;
				}
				var _g = 0;
				var _g1 = i;
				while(_g < _g1) {
					var j = _g++;
					stack.get(i - j - 1).__dispatch(event);
				}
				openfl_display_DisplayObject.__tempStack.release(stack);
			}
		}
		event.eventPhase = 2;
		return this.__dispatchEvent(event);
	}
	,__enterFrame: function(deltaTime) {
	}
	,__getBounds: function(rect,matrix) {
		if(this.__graphics != null) {
			this.__graphics.__getBounds(rect,matrix);
		}
	}
	,__getCursor: function() {
		return null;
	}
	,__getFilterBounds: function(rect,matrix) {
		this.__getRenderBounds(rect,matrix);
		if(this.__filters != null) {
			var extension = openfl_geom_Rectangle.__pool.get();
			var _g = 0;
			var _g1 = this.__filters;
			while(_g < _g1.length) {
				var filter = _g1[_g];
				++_g;
				extension.__expand(-filter.__leftExtension,-filter.__topExtension,filter.__leftExtension + filter.__rightExtension,filter.__topExtension + filter.__bottomExtension);
			}
			rect.width += extension.width;
			rect.height += extension.height;
			rect.x += extension.x;
			rect.y += extension.y;
			openfl_geom_Rectangle.__pool.release(extension);
		}
	}
	,__getInteractive: function(stack) {
		return false;
	}
	,__getLocalBounds: function(rect) {
		this.__getBounds(rect,this.__transform);
		rect.x -= this.__transform.tx;
		rect.y -= this.__transform.ty;
	}
	,__getRenderBounds: function(rect,matrix) {
		if(this.__scrollRect == null) {
			this.__getBounds(rect,matrix);
		} else {
			var r = openfl_geom_Rectangle.__pool.get();
			r.copyFrom(this.__scrollRect);
			r.__transform(r,matrix);
			rect.__expand(r.x,r.y,r.width,r.height);
			openfl_geom_Rectangle.__pool.release(r);
		}
	}
	,__getRenderTransform: function() {
		this.__getWorldTransform();
		return this.__renderTransform;
	}
	,__getWorldTransform: function() {
		var transformDirty = this.__transformDirty || this.__worldTransformInvalid;
		if(transformDirty) {
			var list = [];
			var current = this;
			if(this.parent == null) {
				this.__update(true,false);
			} else {
				while(current != this.stage) {
					list.push(current);
					current = current.parent;
					if(current == null) {
						break;
					}
				}
			}
			var i = list.length;
			while(--i >= 0) {
				current = list[i];
				current.__update(true,false);
			}
		}
		return this.__worldTransform;
	}
	,__globalToLocal: function(global,local) {
		this.__getRenderTransform();
		if(global == local) {
			var _this = this.__renderTransform;
			var norm = _this.a * _this.d - _this.b * _this.c;
			if(norm == 0) {
				global.x = -_this.tx;
				global.y = -_this.ty;
			} else {
				var px = 1.0 / norm * (_this.c * (_this.ty - global.y) + _this.d * (global.x - _this.tx));
				global.y = 1.0 / norm * (_this.a * (global.y - _this.ty) + _this.b * (_this.tx - global.x));
				global.x = px;
			}
		} else {
			var _this = this.__renderTransform;
			var norm = _this.a * _this.d - _this.b * _this.c;
			local.x = norm == 0 ? -_this.tx : 1.0 / norm * (_this.c * (_this.ty - global.y) + _this.d * (global.x - _this.tx));
			var _this = this.__renderTransform;
			var norm = _this.a * _this.d - _this.b * _this.c;
			local.y = norm == 0 ? -_this.ty : 1.0 / norm * (_this.a * (global.y - _this.ty) + _this.b * (_this.tx - global.x));
		}
		return local;
	}
	,__hitTest: function(x,y,shapeFlag,stack,interactiveOnly,hitObject) {
		if(this.__graphics != null) {
			if(!hitObject.__visible || this.__isMask) {
				return false;
			}
			if(this.get_mask() != null && !this.get_mask().__hitTestMask(x,y)) {
				return false;
			}
			if(this.__graphics.__hitTest(x,y,shapeFlag,this.__getRenderTransform())) {
				if(stack != null && !interactiveOnly) {
					stack.push(hitObject);
				}
				return true;
			}
		}
		return false;
	}
	,__hitTestMask: function(x,y) {
		if(this.__graphics != null) {
			if(this.__graphics.__hitTest(x,y,true,this.__getRenderTransform())) {
				return true;
			}
		}
		return false;
	}
	,__readGraphicsData: function(graphicsData,recurse) {
		if(this.__graphics != null) {
			this.__graphics.__readGraphicsData(graphicsData);
		}
	}
	,__setParentRenderDirty: function() {
		var renderParent = this.__renderParent != null ? this.__renderParent : this.parent;
		if(renderParent != null && !renderParent.__renderDirty) {
			renderParent.__renderDirty = true;
			renderParent.__setParentRenderDirty();
		}
	}
	,__setRenderDirty: function() {
		if(!this.__renderDirty) {
			this.__renderDirty = true;
			this.__setParentRenderDirty();
		}
	}
	,__setStageReference: function(stage) {
		this.stage = stage;
	}
	,__setTransformDirty: function() {
		if(!this.__transformDirty) {
			this.__transformDirty = true;
			this.__setWorldTransformInvalid();
			this.__setParentRenderDirty();
		}
	}
	,__setWorldTransformInvalid: function() {
		this.__worldTransformInvalid = true;
	}
	,__stopAllMovieClips: function() {
	}
	,__update: function(transformOnly,updateChildren) {
		var renderParent = this.__renderParent != null ? this.__renderParent : this.parent;
		if(this.__isMask && renderParent == null) {
			renderParent = this.__maskTarget;
		}
		this.__renderable = this.__visible && this.__scaleX != 0 && this.__scaleY != 0 && !this.__isMask && (renderParent == null || !renderParent.__isMask);
		this.__updateTransforms();
		this.__transformDirty = false;
		this.__worldTransformInvalid = false;
		if(!transformOnly) {
			if(openfl_display_DisplayObject.__supportDOM) {
				this.__renderTransformChanged = !this.__renderTransform.equals(this.__renderTransformCache);
				if(this.__renderTransformCache == null) {
					this.__renderTransformCache = this.__renderTransform.clone();
				} else {
					this.__renderTransformCache.copyFrom(this.__renderTransform);
				}
			}
			if(renderParent != null) {
				if(openfl_display_DisplayObject.__supportDOM) {
					var worldVisible = renderParent.__worldVisible && this.__visible;
					this.__worldVisibleChanged = this.__worldVisible != worldVisible;
					this.__worldVisible = worldVisible;
				}
				var worldAlpha = this.get_alpha() * renderParent.__worldAlpha;
				this.__worldAlphaChanged = this.__worldAlpha != worldAlpha;
				this.__worldAlpha = worldAlpha;
				if(this.__objectTransform != null) {
					this.__worldColorTransform.__copyFrom(this.__objectTransform.__colorTransform);
					this.__worldColorTransform.__combine(renderParent.__worldColorTransform);
				} else {
					this.__worldColorTransform.__copyFrom(renderParent.__worldColorTransform);
				}
				if(this.__blendMode == null || this.__blendMode == 10) {
					this.__worldBlendMode = renderParent.__worldBlendMode;
				} else {
					this.__worldBlendMode = this.__blendMode;
				}
				if(this.__shader == null) {
					this.__worldShader = renderParent.__shader;
				} else {
					this.__worldShader = this.__shader;
				}
				if(this.__scale9Grid == null) {
					this.__worldScale9Grid = renderParent.__scale9Grid;
				} else {
					this.__worldScale9Grid = this.__scale9Grid;
				}
			} else {
				this.__worldAlpha = this.get_alpha();
				if(openfl_display_DisplayObject.__supportDOM) {
					this.__worldVisibleChanged = this.__worldVisible != this.__visible;
					this.__worldVisible = this.__visible;
				}
				this.__worldAlphaChanged = this.__worldAlpha != this.get_alpha();
				if(this.__objectTransform != null) {
					this.__worldColorTransform.__copyFrom(this.__objectTransform.__colorTransform);
				} else {
					this.__worldColorTransform.__identity();
				}
				this.__worldBlendMode = this.__blendMode;
				this.__worldShader = this.__shader;
				this.__worldScale9Grid = this.__scale9Grid;
			}
		}
		if(updateChildren && this.get_mask() != null) {
			this.get_mask().__update(transformOnly,true);
		}
	}
	,__updateTransforms: function(overrideTransform) {
		var overrided = overrideTransform != null;
		var local = overrided ? overrideTransform : this.__transform;
		if(this.__worldTransform == null) {
			this.__worldTransform = new openfl_geom_Matrix();
		}
		if(this.__renderTransform == null) {
			this.__renderTransform = new openfl_geom_Matrix();
		}
		var renderParent = this.__renderParent != null ? this.__renderParent : this.parent;
		if(!overrided && this.parent != null) {
			var parentTransform = this.parent.__worldTransform;
			var target = this.__worldTransform;
			target.a = local.a * parentTransform.a + local.b * parentTransform.c;
			target.b = local.a * parentTransform.b + local.b * parentTransform.d;
			target.c = local.c * parentTransform.a + local.d * parentTransform.c;
			target.d = local.c * parentTransform.b + local.d * parentTransform.d;
			target.tx = local.tx * parentTransform.a + local.ty * parentTransform.c + parentTransform.tx;
			target.ty = local.tx * parentTransform.b + local.ty * parentTransform.d + parentTransform.ty;
		} else {
			this.__worldTransform.copyFrom(local);
		}
		if(!overrided && renderParent != null) {
			var parentTransform = renderParent.__renderTransform;
			var target = this.__renderTransform;
			target.a = local.a * parentTransform.a + local.b * parentTransform.c;
			target.b = local.a * parentTransform.b + local.b * parentTransform.d;
			target.c = local.c * parentTransform.a + local.d * parentTransform.c;
			target.d = local.c * parentTransform.b + local.d * parentTransform.d;
			target.tx = local.tx * parentTransform.a + local.ty * parentTransform.c + parentTransform.tx;
			target.ty = local.tx * parentTransform.b + local.ty * parentTransform.d + parentTransform.ty;
		} else {
			this.__renderTransform.copyFrom(local);
		}
		if(this.__scrollRect != null) {
			var _this = this.__renderTransform;
			var px = -this.__scrollRect.x;
			var py = -this.__scrollRect.y;
			_this.tx = px * _this.a + py * _this.c + _this.tx;
			_this.ty = px * _this.b + py * _this.d + _this.ty;
		}
	}
	,__setMask: function(value) {
		if(value != this.__mask) {
			this.__setTransformDirty();
			if(!this.__renderDirty) {
				this.__renderDirty = true;
				this.__setParentRenderDirty();
			}
		}
		if(this.__mask != null) {
			this.__mask.__isMask = false;
			this.__mask.__maskTarget = null;
			this.__mask.__setTransformDirty();
			var _this = this.__mask;
			if(!_this.__renderDirty) {
				_this.__renderDirty = true;
				_this.__setParentRenderDirty();
			}
		}
		if(value != null) {
			value.__isMask = true;
			value.__maskTarget = this;
			value.__setWorldTransformInvalid();
		}
		if(this.__cacheBitmap != null && this.__cacheBitmap.get_clippingLayer() != value) {
			this.__cacheBitmap.set_clippingLayer(value);
		}
		this.__mask = value;
	}
	,get_alpha: function() {
		return this.__alpha;
	}
	,set_alpha: function(value) {
		if(value != value) {
			value = 0.0;
		} else if(value > 1.0) {
			value = 1.0;
		} else if(value < 0.0) {
			value = 0.0;
		}
		if(value != this.__alpha && !this.get_cacheAsBitmap()) {
			if(!this.__renderDirty) {
				this.__renderDirty = true;
				this.__setParentRenderDirty();
			}
		}
		return this.__alpha = value;
	}
	,get_blendMode: function() {
		return this.__blendMode;
	}
	,set_blendMode: function(value) {
		if(value == null) {
			value = 10;
		}
		if(value != this.__blendMode) {
			if(!this.__renderDirty) {
				this.__renderDirty = true;
				this.__setParentRenderDirty();
			}
		}
		return this.__blendMode = value;
	}
	,get_cacheAsBitmap: function() {
		if(this.__filters == null) {
			return this.__cacheAsBitmap;
		} else {
			return true;
		}
	}
	,set_cacheAsBitmap: function(value) {
		if(value != this.__cacheAsBitmap) {
			if(!this.__renderDirty) {
				this.__renderDirty = true;
				this.__setParentRenderDirty();
			}
		}
		return this.__cacheAsBitmap = value;
	}
	,get_cacheAsBitmapMatrix: function() {
		return this.__cacheAsBitmapMatrix;
	}
	,set_cacheAsBitmapMatrix: function(value) {
		if(!this.__renderDirty) {
			this.__renderDirty = true;
			this.__setParentRenderDirty();
		}
		return this.__cacheAsBitmapMatrix = value != null ? value.clone() : value;
	}
	,get_filters: function() {
		if(this.__filters == null) {
			return [];
		} else {
			return this.__filters.slice();
		}
	}
	,set_filters: function(value) {
		if(value != null && value.length > 0) {
			var clonedFilters = [];
			var _g = 0;
			while(_g < value.length) {
				var filter = value[_g];
				++_g;
				var clonedFilter = filter.clone();
				clonedFilter.__renderDirty = true;
				clonedFilters.push(clonedFilter);
			}
			this.__filters = clonedFilters;
			if(!this.__renderDirty) {
				this.__renderDirty = true;
				this.__setParentRenderDirty();
			}
		} else if(this.__filters != null) {
			this.__filters = null;
			if(!this.__renderDirty) {
				this.__renderDirty = true;
				this.__setParentRenderDirty();
			}
		}
		return value;
	}
	,get_height: function() {
		var rect = openfl_geom_Rectangle.__pool.get();
		this.__getLocalBounds(rect);
		var height = rect.height;
		openfl_geom_Rectangle.__pool.release(rect);
		return height;
	}
	,set_height: function(value) {
		var rect = openfl_geom_Rectangle.__pool.get();
		var matrix = openfl_geom_Matrix.__pool.get();
		matrix.identity();
		this.__getBounds(rect,matrix);
		if(value != rect.height) {
			this.set_scaleY(value / rect.height);
		} else {
			this.set_scaleY(1);
		}
		openfl_geom_Rectangle.__pool.release(rect);
		openfl_geom_Matrix.__pool.release(matrix);
		return value;
	}
	,get_loaderInfo: function() {
		if(this.stage != null) {
			return openfl_utils__$internal_Lib.current.__loaderInfo;
		}
		return null;
	}
	,get_mask: function() {
		return this.__mask;
	}
	,set_mask: function(value) {
		if(value == this.__mask) {
			return value;
		}
		if(value != null && value.__maskTarget != null) {
			value.__maskTarget.set_mask(null);
		}
		this.__setMask(value);
		return this.__mask;
	}
	,get_metaData: function() {
		return this.__metaData;
	}
	,set_metaData: function(value) {
		return this.__metaData = value;
	}
	,get_clippingLayer: function() {
		if(!this.__hasClippingLayer) {
			return null;
		}
		return this.__mask;
	}
	,set_clippingLayer: function(value) {
		this.__hasClippingLayer = value != null;
		this.__setMask(value);
		return this.__mask;
	}
	,get_mouseX: function() {
		var mouseX = this.stage != null ? this.stage.__mouseX : openfl_utils__$internal_Lib.current.stage.__mouseX;
		var mouseY = this.stage != null ? this.stage.__mouseY : openfl_utils__$internal_Lib.current.stage.__mouseY;
		var _this = this.__getRenderTransform();
		var norm = _this.a * _this.d - _this.b * _this.c;
		if(norm == 0) {
			return -_this.tx;
		} else {
			return 1.0 / norm * (_this.c * (_this.ty - mouseY) + _this.d * (mouseX - _this.tx));
		}
	}
	,get_mouseY: function() {
		var mouseX = this.stage != null ? this.stage.__mouseX : openfl_utils__$internal_Lib.current.stage.__mouseX;
		var mouseY = this.stage != null ? this.stage.__mouseY : openfl_utils__$internal_Lib.current.stage.__mouseY;
		var _this = this.__getRenderTransform();
		var norm = _this.a * _this.d - _this.b * _this.c;
		if(norm == 0) {
			return -_this.ty;
		} else {
			return 1.0 / norm * (_this.a * (mouseY - _this.ty) + _this.b * (_this.tx - mouseX));
		}
	}
	,get_name: function() {
		return this.__name;
	}
	,set_name: function(value) {
		return this.__name = value;
	}
	,get_root: function() {
		if(this.stage != null) {
			return openfl_utils__$internal_Lib.current;
		}
		return null;
	}
	,get_rotation: function() {
		return this.__rotation;
	}
	,set_rotation: function(value) {
		if(value != this.__rotation) {
			value %= 360.0;
			if(value > 180.0) {
				value -= 360.0;
			} else if(value < -180.0) {
				value += 360.0;
			}
			this.__rotation = value;
			var radians = this.__rotation * (Math.PI / 180);
			this.__rotationSine = Math.sin(radians);
			this.__rotationCosine = Math.cos(radians);
			this.__transform.a = this.__rotationCosine * this.__scaleX;
			this.__transform.b = this.__rotationSine * this.__scaleX;
			this.__transform.c = -this.__rotationSine * this.__scaleY;
			this.__transform.d = this.__rotationCosine * this.__scaleY;
			this.__setTransformDirty();
		}
		return value;
	}
	,get_scale9Grid: function() {
		if(this.__scale9Grid == null) {
			return null;
		}
		return this.__scale9Grid.clone();
	}
	,set_scale9Grid: function(value) {
		if(value == null && this.__scale9Grid == null) {
			return value;
		}
		if(value != null && this.__scale9Grid != null && this.__scale9Grid.equals(value)) {
			return value;
		}
		if(value != null) {
			if(this.__scale9Grid == null) {
				this.__scale9Grid = new openfl_geom_Rectangle();
			}
			this.__scale9Grid.copyFrom(value);
		} else {
			this.__scale9Grid = null;
		}
		if(!this.__renderDirty) {
			this.__renderDirty = true;
			this.__setParentRenderDirty();
		}
		return value;
	}
	,get_scaleX: function() {
		return this.__scaleX;
	}
	,set_scaleX: function(value) {
		if(value != this.__scaleX) {
			this.__scaleX = value;
			if(this.__rotation == 0) {
				if(value != this.__transform.a) {
					this.__setTransformDirty();
				}
				this.__transform.a = value;
			} else {
				var a = this.__rotationCosine * value;
				var b = this.__rotationSine * value;
				if(this.__transform.a != a || this.__transform.b != b) {
					this.__setTransformDirty();
				}
				this.__transform.a = a;
				this.__transform.b = b;
			}
		}
		return value;
	}
	,get_scaleY: function() {
		return this.__scaleY;
	}
	,set_scaleY: function(value) {
		if(value != this.__scaleY) {
			this.__scaleY = value;
			if(this.__rotation == 0) {
				if(value != this.__transform.d) {
					this.__setTransformDirty();
				}
				this.__transform.d = value;
			} else {
				var c = -this.__rotationSine * value;
				var d = this.__rotationCosine * value;
				if(this.__transform.d != d || this.__transform.c != c) {
					this.__setTransformDirty();
				}
				this.__transform.c = c;
				this.__transform.d = d;
			}
		}
		return value;
	}
	,get_scrollRect: function() {
		if(this.__scrollRect == null) {
			return null;
		}
		return this.__scrollRect.clone();
	}
	,set_scrollRect: function(value) {
		if(value == null && this.__scrollRect == null) {
			return value;
		}
		if(value != null && this.__scrollRect != null && this.__scrollRect.equals(value)) {
			return value;
		}
		if(value != null) {
			if(this.__scrollRect == null) {
				this.__scrollRect = new openfl_geom_Rectangle();
			}
			this.__scrollRect.copyFrom(value);
			if(this.__scrollRect.width < 0.0) {
				this.__scrollRect.width = 0.0;
			}
			if(this.__scrollRect.height < 0.0) {
				this.__scrollRect.height = 0.0;
			}
		} else {
			this.__scrollRect = null;
		}
		this.__setTransformDirty();
		if(openfl_display_DisplayObject.__supportDOM) {
			if(!this.__renderDirty) {
				this.__renderDirty = true;
				this.__setParentRenderDirty();
			}
		}
		return this.__scrollRect;
	}
	,get_shader: function() {
		return this.__shader;
	}
	,set_shader: function(value) {
		this.__shader = value;
		if(!this.__renderDirty) {
			this.__renderDirty = true;
			this.__setParentRenderDirty();
		}
		return value;
	}
	,get_transform: function() {
		if(this.__objectTransform == null) {
			this.__objectTransform = new openfl_geom_Transform(this);
		}
		return this.__objectTransform;
	}
	,set_transform: function(value) {
		if(value == null) {
			throw new openfl_errors_TypeError("Parameter transform must be non-null.");
		}
		if(this.__objectTransform == null) {
			this.__objectTransform = new openfl_geom_Transform(this);
		}
		this.__setTransformDirty();
		if(value.__hasMatrix) {
			var other = value.__displayObject.__transform;
			this.__objectTransform.__setTransform(other.a,other.b,other.c,other.d,other.tx,other.ty);
		} else {
			this.__objectTransform.__hasMatrix = false;
		}
		if(!this.__objectTransform.__colorTransform.__equals(value.__colorTransform,true) || !this.get_cacheAsBitmap() && this.__objectTransform.__colorTransform.alphaMultiplier != value.__colorTransform.alphaMultiplier) {
			this.__objectTransform.__colorTransform.__copyFrom(value.get_colorTransform());
			if(!this.__renderDirty) {
				this.__renderDirty = true;
				this.__setParentRenderDirty();
			}
		}
		return this.__objectTransform;
	}
	,get_visible: function() {
		return this.__visible;
	}
	,set_visible: function(value) {
		if(value != this.__visible) {
			if(!this.__renderDirty) {
				this.__renderDirty = true;
				this.__setParentRenderDirty();
			}
		}
		return this.__visible = value;
	}
	,get_width: function() {
		var rect = openfl_geom_Rectangle.__pool.get();
		this.__getLocalBounds(rect);
		var width = rect.width;
		openfl_geom_Rectangle.__pool.release(rect);
		return width;
	}
	,set_width: function(value) {
		var rect = openfl_geom_Rectangle.__pool.get();
		var matrix = openfl_geom_Matrix.__pool.get();
		matrix.identity();
		this.__getBounds(rect,matrix);
		if(value != rect.width) {
			this.set_scaleX(value / rect.width);
		} else {
			this.set_scaleX(1);
		}
		openfl_geom_Rectangle.__pool.release(rect);
		openfl_geom_Matrix.__pool.release(matrix);
		return value;
	}
	,get_x: function() {
		return this.__transform.tx;
	}
	,set_x: function(value) {
		if(value != value) {
			value = 0.0;
		}
		if(value != this.__transform.tx) {
			this.__setTransformDirty();
		}
		return this.__transform.tx = value;
	}
	,get_y: function() {
		return this.__transform.ty;
	}
	,set_y: function(value) {
		if(value != value) {
			value = 0.0;
		}
		if(value != this.__transform.ty) {
			this.__setTransformDirty();
		}
		return this.__transform.ty = value;
	}
	,__class__: openfl_display_DisplayObject
	,__properties__: {set_y:"set_y",get_y:"get_y",set_x:"set_x",get_x:"get_x",set_width:"set_width",get_width:"get_width",set_visible:"set_visible",get_visible:"get_visible",set_transform:"set_transform",get_transform:"get_transform",set_shader:"set_shader",get_shader:"get_shader",set_scrollRect:"set_scrollRect",get_scrollRect:"get_scrollRect",set_scaleY:"set_scaleY",get_scaleY:"get_scaleY",set_scaleX:"set_scaleX",get_scaleX:"get_scaleX",set_scale9Grid:"set_scale9Grid",get_scale9Grid:"get_scale9Grid",set_rotation:"set_rotation",get_rotation:"get_rotation",get_root:"get_root",set_name:"set_name",get_name:"get_name",get_mouseY:"get_mouseY",get_mouseX:"get_mouseX",set_clippingLayer:"set_clippingLayer",get_clippingLayer:"get_clippingLayer",set_metaData:"set_metaData",get_metaData:"get_metaData",set_mask:"set_mask",get_mask:"get_mask",get_loaderInfo:"get_loaderInfo",set_height:"set_height",get_height:"get_height",set_filters:"set_filters",get_filters:"get_filters",set_cacheAsBitmapMatrix:"set_cacheAsBitmapMatrix",get_cacheAsBitmapMatrix:"get_cacheAsBitmapMatrix",set_cacheAsBitmap:"set_cacheAsBitmap",get_cacheAsBitmap:"get_cacheAsBitmap",set_blendMode:"set_blendMode",get_blendMode:"get_blendMode",set_alpha:"set_alpha",get_alpha:"get_alpha"}
});
var openfl_display_InteractiveObject = function() {
	openfl_display_DisplayObject.call(this);
	this.doubleClickEnabled = false;
	this.mouseEnabled = true;
	this.needsSoftKeyboard = false;
	this.__tabEnabled = null;
	this.__tabIndex = -1;
};
$hxClasses["openfl.display.InteractiveObject"] = openfl_display_InteractiveObject;
openfl_display_InteractiveObject.__name__ = "openfl.display.InteractiveObject";
openfl_display_InteractiveObject.__super__ = openfl_display_DisplayObject;
openfl_display_InteractiveObject.prototype = $extend(openfl_display_DisplayObject.prototype,{
	doubleClickEnabled: null
	,focusRect: null
	,mouseEnabled: null
	,needsSoftKeyboard: null
	,softKeyboardInputAreaOfInterest: null
	,__tabEnabled: null
	,__tabIndex: null
	,requestSoftKeyboard: function() {
		openfl_utils__$internal_Lib.notImplemented({ fileName : "openfl/display/InteractiveObject.hx", lineNumber : 1255, className : "openfl.display.InteractiveObject", methodName : "requestSoftKeyboard"});
		return false;
	}
	,__allowMouseFocus: function() {
		if(this.mouseEnabled) {
			return this.get_tabEnabled();
		} else {
			return false;
		}
	}
	,__getInteractive: function(stack) {
		if(stack != null) {
			stack.push(this);
			if(this.parent != null) {
				this.parent.__getInteractive(stack);
			}
		}
		return true;
	}
	,__hitTest: function(x,y,shapeFlag,stack,interactiveOnly,hitObject) {
		if(!hitObject.get_visible() || this.__isMask || interactiveOnly && !this.mouseEnabled) {
			return false;
		}
		return openfl_display_DisplayObject.prototype.__hitTest.call(this,x,y,shapeFlag,stack,interactiveOnly,hitObject);
	}
	,__tabTest: function(stack) {
		if(this.get_tabEnabled()) {
			stack.push(this);
		}
	}
	,get_tabEnabled: function() {
		if(this.__tabEnabled == true) {
			return true;
		} else {
			return false;
		}
	}
	,set_tabEnabled: function(value) {
		if(this.__tabEnabled != value) {
			this.__tabEnabled = value;
			this.dispatchEvent(new openfl_events_Event("tabEnabledChange",true,false));
		}
		return this.__tabEnabled;
	}
	,get_tabIndex: function() {
		return this.__tabIndex;
	}
	,set_tabIndex: function(value) {
		if(this.__tabIndex != value) {
			if(value < -1) {
				throw new openfl_errors_RangeError("Parameter tabIndex must be a non-negative number; got " + value);
			}
			this.__tabIndex = value;
			this.dispatchEvent(new openfl_events_Event("tabIndexChange",true,false));
		}
		return this.__tabIndex;
	}
	,__class__: openfl_display_InteractiveObject
	,__properties__: $extend(openfl_display_DisplayObject.prototype.__properties__,{set_tabIndex:"set_tabIndex",get_tabIndex:"get_tabIndex",set_tabEnabled:"set_tabEnabled",get_tabEnabled:"get_tabEnabled"})
});
var openfl_display_DisplayObjectContainer = function() {
	openfl_display_InteractiveObject.call(this);
	this.mouseChildren = true;
	this.__tabChildren = true;
	this.__children = [];
	this.__removedChildren = openfl_Vector.toObjectVector(null);
};
$hxClasses["openfl.display.DisplayObjectContainer"] = openfl_display_DisplayObjectContainer;
openfl_display_DisplayObjectContainer.__name__ = "openfl.display.DisplayObjectContainer";
openfl_display_DisplayObjectContainer.__super__ = openfl_display_InteractiveObject;
openfl_display_DisplayObjectContainer.prototype = $extend(openfl_display_InteractiveObject.prototype,{
	mouseChildren: null
	,__removedChildren: null
	,__tabChildren: null
	,addChild: function(child) {
		return this.addChildAt(child,this.get_numChildren());
	}
	,addChildAt: function(child,index) {
		if(child == null) {
			var error = new openfl_errors_TypeError("Error #2007: Parameter child must be non-null.");
			error.errorID = 2007;
			throw error;
		} else if(child == this) {
			var error = new openfl_errors_ArgumentError("Error #2024: An object cannot be added as a child of itself.");
			error.errorID = 2024;
			throw error;
		} else if(child.stage == child) {
			var error = new openfl_errors_ArgumentError("Error #3783: A Stage object cannot be added as the child of another object.");
			error.errorID = 3783;
			throw error;
		}
		if(index > this.__children.length || index < 0) {
			throw haxe_Exception.thrown("Invalid index position " + index);
		}
		if(child.parent == this) {
			if(this.__children[index] != child) {
				HxOverrides.remove(this.__children,child);
				this.__children.splice(index,0,child);
				if(!this.__renderDirty) {
					this.__renderDirty = true;
					this.__setParentRenderDirty();
				}
			}
		} else {
			if(child.parent != null) {
				child.parent.removeChild(child);
			}
			this.__children.splice(index,0,child);
			child.parent = this;
			var addedToStage = this.stage != null && child.stage == null;
			if(addedToStage) {
				child.__setStageReference(this.stage);
			}
			child.__setTransformDirty();
			if(!child.__renderDirty) {
				child.__renderDirty = true;
				child.__setParentRenderDirty();
			}
			if(!this.__renderDirty) {
				this.__renderDirty = true;
				this.__setParentRenderDirty();
			}
			var event = new openfl_events_Event("added");
			event.bubbles = true;
			event.target = child;
			child.__dispatchWithCapture(event);
			if(addedToStage) {
				event = new openfl_events_Event("addedToStage",false,false);
				child.__dispatchWithCapture(event);
				child.__dispatchChildren(event);
			}
		}
		return child;
	}
	,areInaccessibleObjectsUnderPoint: function(point) {
		return false;
	}
	,contains: function(child) {
		while(child != this && child != null) child = child.parent;
		return child == this;
	}
	,getChildAt: function(index) {
		if(index >= 0 && index < this.__children.length) {
			return this.__children[index];
		}
		return null;
	}
	,getChildByName: function(name) {
		var _g = 0;
		var _g1 = this.__children;
		while(_g < _g1.length) {
			var child = _g1[_g];
			++_g;
			if(child.get_name() == name) {
				return child;
			}
		}
		return null;
	}
	,getChildIndex: function(child) {
		var _g = 0;
		var _g1 = this.__children.length;
		while(_g < _g1) {
			var i = _g++;
			if(this.__children[i] == child) {
				return i;
			}
		}
		return -1;
	}
	,getObjectsUnderPoint: function(point) {
		var stack = [];
		this.__hitTest(point.x,point.y,false,stack,false,this);
		stack.reverse();
		return stack;
	}
	,removeChild: function(child) {
		if(child != null && child.parent == this) {
			child.__setTransformDirty();
			if(!child.__renderDirty) {
				child.__renderDirty = true;
				child.__setParentRenderDirty();
			}
			if(!this.__renderDirty) {
				this.__renderDirty = true;
				this.__setParentRenderDirty();
			}
			var event = new openfl_events_Event("removed",true);
			child.__dispatchWithCapture(event);
			if(this.stage != null) {
				if(child.stage != null && this.stage.get_focus() == child) {
					this.stage.set_focus(null);
				}
				var event = new openfl_events_Event("removedFromStage",false,false);
				child.__dispatchWithCapture(event);
				child.__dispatchChildren(event);
				child.__setStageReference(null);
			}
			child.parent = null;
			HxOverrides.remove(this.__children,child);
			this.__removedChildren.push(child);
			child.__setTransformDirty();
		}
		return child;
	}
	,removeChildAt: function(index) {
		if(index >= 0 && index < this.__children.length) {
			return this.removeChild(this.__children[index]);
		}
		return null;
	}
	,removeChildren: function(beginIndex,endIndex) {
		if(endIndex == null) {
			endIndex = 2147483647;
		}
		if(beginIndex == null) {
			beginIndex = 0;
		}
		if(endIndex == 2147483647) {
			endIndex = this.__children.length - 1;
			if(endIndex < 0) {
				return;
			}
		}
		if(beginIndex > this.__children.length - 1) {
			return;
		} else if(endIndex < beginIndex || beginIndex < 0 || endIndex > this.__children.length) {
			throw new openfl_errors_RangeError("The supplied index is out of bounds.");
		}
		var numRemovals = endIndex - beginIndex;
		while(numRemovals >= 0) {
			this.removeChildAt(beginIndex);
			--numRemovals;
		}
	}
	,resolve: function(fieldName) {
		if(this.__children == null) {
			return null;
		}
		var _g = 0;
		var _g1 = this.__children;
		while(_g < _g1.length) {
			var child = _g1[_g];
			++_g;
			if(child.get_name() == fieldName) {
				return child;
			}
		}
		return null;
	}
	,setChildIndex: function(child,index) {
		if(index >= 0 && index <= this.__children.length && child.parent == this) {
			HxOverrides.remove(this.__children,child);
			this.__children.splice(index,0,child);
		}
	}
	,stopAllMovieClips: function() {
		this.__stopAllMovieClips();
	}
	,swapChildren: function(child1,child2) {
		if(child1.parent == this && child2.parent == this) {
			var index1 = this.__children.indexOf(child1);
			var index2 = this.__children.indexOf(child2);
			this.__children[index1] = child2;
			this.__children[index2] = child1;
			if(!this.__renderDirty) {
				this.__renderDirty = true;
				this.__setParentRenderDirty();
			}
		}
	}
	,swapChildrenAt: function(index1,index2) {
		var swap = this.__children[index1];
		this.__children[index1] = this.__children[index2];
		this.__children[index2] = swap;
		swap = null;
		if(!this.__renderDirty) {
			this.__renderDirty = true;
			this.__setParentRenderDirty();
		}
	}
	,__cleanup: function() {
		openfl_display_InteractiveObject.prototype.__cleanup.call(this);
		var _g = 0;
		var _g1 = this.__children;
		while(_g < _g1.length) {
			var child = _g1[_g];
			++_g;
			child.__cleanup();
		}
		var orphan = this.__removedChildren.iterator();
		while(orphan.hasNext()) {
			var orphan1 = orphan.next();
			if(orphan1.stage == null) {
				orphan1.__cleanup();
			}
		}
		this.__removedChildren.set_length(0);
	}
	,__cleanupRemovedChildren: function() {
		var orphan = this.__removedChildren.iterator();
		while(orphan.hasNext()) {
			var orphan1 = orphan.next();
			if(orphan1.stage == null) {
				orphan1.__cleanup();
			}
		}
		this.__removedChildren.set_length(0);
	}
	,__dispatchChildren: function(event) {
		if(this.__children != null) {
			var _g = 0;
			var _g1 = this.__children;
			while(_g < _g1.length) {
				var child = _g1[_g];
				++_g;
				event.target = child;
				if(!child.__dispatchWithCapture(event)) {
					break;
				}
				child.__dispatchChildren(event);
			}
		}
	}
	,__enterFrame: function(deltaTime) {
		var _g = 0;
		var _g1 = this.__children;
		while(_g < _g1.length) {
			var child = _g1[_g];
			++_g;
			child.__enterFrame(deltaTime);
		}
	}
	,__getBounds: function(rect,matrix) {
		openfl_display_InteractiveObject.prototype.__getBounds.call(this,rect,matrix);
		if(this.__children.length == 0) {
			return;
		}
		var childWorldTransform = openfl_geom_Matrix.__pool.get();
		var _g = 0;
		var _g1 = this.__children;
		while(_g < _g1.length) {
			var child = _g1[_g];
			++_g;
			if(child.__scaleX == 0 && child.__scaleY == 0) {
				continue;
			}
			var local = child.__transform;
			childWorldTransform.a = local.a * matrix.a + local.b * matrix.c;
			childWorldTransform.b = local.a * matrix.b + local.b * matrix.d;
			childWorldTransform.c = local.c * matrix.a + local.d * matrix.c;
			childWorldTransform.d = local.c * matrix.b + local.d * matrix.d;
			childWorldTransform.tx = local.tx * matrix.a + local.ty * matrix.c + matrix.tx;
			childWorldTransform.ty = local.tx * matrix.b + local.ty * matrix.d + matrix.ty;
			child.__getBounds(rect,childWorldTransform);
		}
		openfl_geom_Matrix.__pool.release(childWorldTransform);
	}
	,__getFilterBounds: function(rect,matrix) {
		openfl_display_InteractiveObject.prototype.__getFilterBounds.call(this,rect,matrix);
		if(this.__scrollRect != null) {
			return;
		}
		if(this.__children.length == 0) {
			return;
		}
		var childWorldTransform = openfl_geom_Matrix.__pool.get();
		var _g = 0;
		var _g1 = this.__children;
		while(_g < _g1.length) {
			var child = _g1[_g];
			++_g;
			if(child.__scaleX == 0 || child.__scaleY == 0 || child.__isMask) {
				continue;
			}
			var local = child.__transform;
			childWorldTransform.a = local.a * matrix.a + local.b * matrix.c;
			childWorldTransform.b = local.a * matrix.b + local.b * matrix.d;
			childWorldTransform.c = local.c * matrix.a + local.d * matrix.c;
			childWorldTransform.d = local.c * matrix.b + local.d * matrix.d;
			childWorldTransform.tx = local.tx * matrix.a + local.ty * matrix.c + matrix.tx;
			childWorldTransform.ty = local.tx * matrix.b + local.ty * matrix.d + matrix.ty;
			var childRect = openfl_geom_Rectangle.__pool.get();
			child.__getFilterBounds(childRect,childWorldTransform);
			rect.__expand(childRect.x,childRect.y,childRect.width,childRect.height);
			openfl_geom_Rectangle.__pool.release(childRect);
		}
		openfl_geom_Matrix.__pool.release(childWorldTransform);
	}
	,__getRenderBounds: function(rect,matrix) {
		if(this.__scrollRect != null) {
			openfl_display_InteractiveObject.prototype.__getRenderBounds.call(this,rect,matrix);
			return;
		} else {
			openfl_display_InteractiveObject.prototype.__getBounds.call(this,rect,matrix);
		}
		if(this.__children.length == 0) {
			return;
		}
		var childWorldTransform = openfl_geom_Matrix.__pool.get();
		var _g = 0;
		var _g1 = this.__children;
		while(_g < _g1.length) {
			var child = _g1[_g];
			++_g;
			if(child.__scaleX == 0 || child.__scaleY == 0 || child.__isMask) {
				continue;
			}
			var local = child.__transform;
			childWorldTransform.a = local.a * matrix.a + local.b * matrix.c;
			childWorldTransform.b = local.a * matrix.b + local.b * matrix.d;
			childWorldTransform.c = local.c * matrix.a + local.d * matrix.c;
			childWorldTransform.d = local.c * matrix.b + local.d * matrix.d;
			childWorldTransform.tx = local.tx * matrix.a + local.ty * matrix.c + matrix.tx;
			childWorldTransform.ty = local.tx * matrix.b + local.ty * matrix.d + matrix.ty;
			child.__getRenderBounds(rect,childWorldTransform);
		}
		openfl_geom_Matrix.__pool.release(childWorldTransform);
	}
	,__hitTest: function(x,y,shapeFlag,stack,interactiveOnly,hitObject) {
		if(!hitObject.get_visible() || this.__isMask || interactiveOnly && !this.mouseEnabled && !this.mouseChildren) {
			return false;
		}
		if(this.get_mask() != null && !this.get_mask().__hitTestMask(x,y)) {
			return false;
		}
		if(this.__scrollRect != null) {
			var point = openfl_geom_Point.__pool.get();
			point.setTo(x,y);
			var _this = this.__getRenderTransform();
			var norm = _this.a * _this.d - _this.b * _this.c;
			if(norm == 0) {
				point.x = -_this.tx;
				point.y = -_this.ty;
			} else {
				var px = 1.0 / norm * (_this.c * (_this.ty - point.y) + _this.d * (point.x - _this.tx));
				point.y = 1.0 / norm * (_this.a * (point.y - _this.ty) + _this.b * (_this.tx - point.x));
				point.x = px;
			}
			if(!this.__scrollRect.containsPoint(point)) {
				openfl_geom_Point.__pool.release(point);
				return false;
			}
			openfl_geom_Point.__pool.release(point);
		}
		var i = this.__children.length;
		if(interactiveOnly) {
			if(stack == null || !this.mouseChildren) {
				while(--i >= 0) if(this.__children[i].__hitTest(x,y,shapeFlag,null,true,this.__children[i])) {
					if(stack != null) {
						stack.push(hitObject);
					}
					return true;
				}
			} else if(stack != null) {
				var length = stack.length;
				var interactive = false;
				var hitTest = false;
				while(--i >= 0) {
					interactive = this.__children[i].__getInteractive(null);
					if(interactive || this.mouseEnabled && !hitTest) {
						if(this.__children[i].__hitTest(x,y,shapeFlag,stack,true,this.__children[i])) {
							hitTest = true;
							if(interactive && stack.length > length) {
								break;
							}
						}
					}
				}
				if(hitTest) {
					stack.splice(length,0,hitObject);
					return true;
				}
			}
		} else {
			var hitTest = false;
			while(--i >= 0) if(this.__children[i].__hitTest(x,y,shapeFlag,stack,false,this.__children[i])) {
				hitTest = true;
				if(stack == null) {
					break;
				}
			}
			return hitTest;
		}
		return false;
	}
	,__hitTestMask: function(x,y) {
		var i = this.__children.length;
		while(--i >= 0) if(this.__children[i].__hitTestMask(x,y)) {
			return true;
		}
		return false;
	}
	,__readGraphicsData: function(graphicsData,recurse) {
		openfl_display_InteractiveObject.prototype.__readGraphicsData.call(this,graphicsData,recurse);
		if(recurse) {
			var _g = 0;
			var _g1 = this.__children;
			while(_g < _g1.length) {
				var child = _g1[_g];
				++_g;
				child.__readGraphicsData(graphicsData,recurse);
			}
		}
	}
	,__setStageReference: function(stage) {
		openfl_display_InteractiveObject.prototype.__setStageReference.call(this,stage);
		if(this.__children != null) {
			var _g = 0;
			var _g1 = this.__children;
			while(_g < _g1.length) {
				var child = _g1[_g];
				++_g;
				child.__setStageReference(stage);
			}
		}
	}
	,__setWorldTransformInvalid: function() {
		if(!this.__worldTransformInvalid) {
			this.__worldTransformInvalid = true;
			if(this.__children != null) {
				var _g = 0;
				var _g1 = this.__children;
				while(_g < _g1.length) {
					var child = _g1[_g];
					++_g;
					child.__setWorldTransformInvalid();
				}
			}
		}
	}
	,__stopAllMovieClips: function() {
		var _g = 0;
		var _g1 = this.__children;
		while(_g < _g1.length) {
			var child = _g1[_g];
			++_g;
			child.__stopAllMovieClips();
		}
	}
	,__tabTest: function(stack) {
		openfl_display_InteractiveObject.prototype.__tabTest.call(this,stack);
		if(!this.get_tabChildren()) {
			return;
		}
		var interactive = false;
		var interactiveObject = null;
		var _g = 0;
		var _g1 = this.__children;
		while(_g < _g1.length) {
			var child = _g1[_g];
			++_g;
			interactive = child.__getInteractive(null);
			if(interactive) {
				interactiveObject = child;
				interactiveObject.__tabTest(stack);
			}
		}
	}
	,__update: function(transformOnly,updateChildren) {
		openfl_display_InteractiveObject.prototype.__update.call(this,transformOnly,updateChildren);
		if(updateChildren) {
			var _g = 0;
			var _g1 = this.__children;
			while(_g < _g1.length) {
				var child = _g1[_g];
				++_g;
				child.__update(transformOnly,true);
			}
		}
	}
	,get_numChildren: function() {
		return this.__children.length;
	}
	,get_tabChildren: function() {
		return this.__tabChildren;
	}
	,set_tabChildren: function(value) {
		if(this.__tabChildren != value) {
			this.__tabChildren = value;
			this.dispatchEvent(new openfl_events_Event("tabChildrenChange",true,false));
		}
		return this.__tabChildren;
	}
	,__class__: openfl_display_DisplayObjectContainer
	,__properties__: $extend(openfl_display_InteractiveObject.prototype.__properties__,{set_tabChildren:"set_tabChildren",get_tabChildren:"get_tabChildren",get_numChildren:"get_numChildren"})
});
var openfl_display_Sprite = function() {
	openfl_display_DisplayObjectContainer.call(this);
	this.__drawableType = 4;
	this.__buttonMode = false;
	this.useHandCursor = true;
	if(this.__pendingBindLibrary != null) {
		var library = this.__pendingBindLibrary;
		var className = this.__pendingBindClassName;
		this.__pendingBindLibrary = null;
		this.__pendingBindClassName = null;
		library.bind(className,this);
	} else if(openfl_display_Sprite.__constructor != null) {
		var method = openfl_display_Sprite.__constructor;
		openfl_display_Sprite.__constructor = null;
		method(this);
	}
};
$hxClasses["openfl.display.Sprite"] = openfl_display_Sprite;
openfl_display_Sprite.__name__ = "openfl.display.Sprite";
openfl_display_Sprite.fromTimeline = function(timeline) {
	var sprite = new openfl_display_Sprite();
	timeline.initializeSprite(sprite);
	return sprite;
};
openfl_display_Sprite.__super__ = openfl_display_DisplayObjectContainer;
openfl_display_Sprite.prototype = $extend(openfl_display_DisplayObjectContainer.prototype,{
	dropTarget: null
	,hitArea: null
	,useHandCursor: null
	,__buttonMode: null
	,__pendingBindClassName: null
	,__pendingBindLibrary: null
	,startDrag: function(lockCenter,bounds) {
		if(lockCenter == null) {
			lockCenter = false;
		}
		if(this.stage != null) {
			this.stage.__startDrag(this,lockCenter,bounds);
		}
	}
	,stopDrag: function() {
		if(this.stage != null) {
			this.stage.__stopDrag(this);
		}
	}
	,__setStageReference: function(stage) {
		if(this.stage != stage && this.stage != null && this.stage.__dragObject == this) {
			this.stopDrag();
		}
		openfl_display_DisplayObjectContainer.prototype.__setStageReference.call(this,stage);
	}
	,__bind: function(library,className) {
		if(this.__worldTransform == null) {
			this.__pendingBindLibrary = library;
			this.__pendingBindClassName = className;
		} else if(library == null || className == null || !library.bind(className,this)) {
			lime_utils_Log.error("Cannot bind class name \"" + className + "\"",{ fileName : "openfl/display/Sprite.hx", lineNumber : 297, className : "openfl.display.Sprite", methodName : "__bind"});
		}
	}
	,__getCursor: function() {
		if(this.__buttonMode && this.useHandCursor) {
			return "button";
		} else {
			return null;
		}
	}
	,__hitTest: function(x,y,shapeFlag,stack,interactiveOnly,hitObject) {
		if(interactiveOnly && !this.mouseEnabled && !this.mouseChildren) {
			return false;
		}
		if(!hitObject.get_visible() || this.__isMask) {
			return this.__hitTestHitArea(x,y,shapeFlag,stack,interactiveOnly,hitObject);
		}
		if(this.get_mask() != null && !this.get_mask().__hitTestMask(x,y)) {
			return this.__hitTestHitArea(x,y,shapeFlag,stack,interactiveOnly,hitObject);
		}
		if(this.__scrollRect != null) {
			var point = openfl_geom_Point.__pool.get();
			point.setTo(x,y);
			var _this = this.__getRenderTransform();
			var norm = _this.a * _this.d - _this.b * _this.c;
			if(norm == 0) {
				point.x = -_this.tx;
				point.y = -_this.ty;
			} else {
				var px = 1.0 / norm * (_this.c * (_this.ty - point.y) + _this.d * (point.x - _this.tx));
				point.y = 1.0 / norm * (_this.a * (point.y - _this.ty) + _this.b * (_this.tx - point.x));
				point.x = px;
			}
			if(!this.__scrollRect.containsPoint(point)) {
				openfl_geom_Point.__pool.release(point);
				return this.__hitTestHitArea(x,y,shapeFlag,stack,true,hitObject);
			}
			openfl_geom_Point.__pool.release(point);
		}
		if(openfl_display_DisplayObjectContainer.prototype.__hitTest.call(this,x,y,shapeFlag,stack,interactiveOnly,hitObject)) {
			if(stack != null) {
				return interactiveOnly;
			} else {
				return true;
			}
		} else if(this.hitArea == null && this.__graphics != null && this.__graphics.__hitTest(x,y,shapeFlag,this.__getRenderTransform())) {
			if(stack != null && (!interactiveOnly || this.mouseEnabled)) {
				stack.push(hitObject);
			}
			return true;
		}
		return this.__hitTestHitArea(x,y,shapeFlag,stack,interactiveOnly,hitObject);
	}
	,__hitTestHitArea: function(x,y,shapeFlag,stack,interactiveOnly,hitObject) {
		if(this.hitArea != null) {
			if(!this.hitArea.mouseEnabled) {
				this.hitArea.mouseEnabled = true;
				var hitTest = this.hitArea.__hitTest(x,y,shapeFlag,null,true,hitObject);
				this.hitArea.mouseEnabled = false;
				if(stack != null && hitTest) {
					stack[stack.length] = hitObject;
				}
				return hitTest;
			}
		}
		return false;
	}
	,__hitTestMask: function(x,y) {
		if(openfl_display_DisplayObjectContainer.prototype.__hitTestMask.call(this,x,y)) {
			return true;
		} else if(this.__graphics != null && this.__graphics.__hitTest(x,y,true,this.__getRenderTransform())) {
			return true;
		}
		return false;
	}
	,get_graphics: function() {
		if(this.__graphics == null) {
			this.__graphics = new openfl_display_Graphics(this);
		}
		return this.__graphics;
	}
	,get_tabEnabled: function() {
		if(this.__tabEnabled == null) {
			return this.__buttonMode;
		} else {
			return this.__tabEnabled;
		}
	}
	,get_buttonMode: function() {
		return this.__buttonMode;
	}
	,set_buttonMode: function(value) {
		return this.__buttonMode = value;
	}
	,__class__: openfl_display_Sprite
	,__properties__: $extend(openfl_display_DisplayObjectContainer.prototype.__properties__,{get_graphics:"get_graphics",set_buttonMode:"set_buttonMode",get_buttonMode:"get_buttonMode"})
});
var feathers_core_IValidating = function() { };
$hxClasses["feathers.core.IValidating"] = feathers_core_IValidating;
feathers_core_IValidating.__name__ = "feathers.core.IValidating";
feathers_core_IValidating.__isInterface__ = true;
feathers_core_IValidating.prototype = {
	get_depth: null
	,validateNow: null
	,__class__: feathers_core_IValidating
	,__properties__: {get_depth:"get_depth"}
};
var feathers_core_ValidatingSprite = function() {
	this._setInvalidationFlagsOnly = false;
	this._ignoreInvalidationFlags = false;
	this._depth = -1;
	this._validationQueue = null;
	this._setInvalidCount = 0;
	this._delayedInvalidationFlags = new haxe_ds_EnumValueMap();
	this._invalidationFlags = new haxe_ds_EnumValueMap();
	this._allInvalidDelayed = false;
	this._allInvalid = false;
	this._validating = false;
	openfl_display_Sprite.call(this);
	this.addEventListener("addedToStage",$bind(this,this.validatingSprite_addedToStageHandler));
	this.addEventListener("removedFromStage",$bind(this,this.validatingSprite_removedFromStageHandler));
};
$hxClasses["feathers.core.ValidatingSprite"] = feathers_core_ValidatingSprite;
feathers_core_ValidatingSprite.__name__ = "feathers.core.ValidatingSprite";
feathers_core_ValidatingSprite.__interfaces__ = [feathers_core_IValidating];
feathers_core_ValidatingSprite.__super__ = openfl_display_Sprite;
feathers_core_ValidatingSprite.prototype = $extend(openfl_display_Sprite.prototype,{
	_validating: null
	,get_validating: function() {
		return this._validating;
	}
	,_allInvalid: null
	,_allInvalidDelayed: null
	,_invalidationFlags: null
	,_delayedInvalidationFlags: null
	,_setInvalidCount: null
	,_validationQueue: null
	,_depth: null
	,get_depth: function() {
		return this._depth;
	}
	,isInvalid: function(flag) {
		if(this._allInvalid) {
			return true;
		}
		if(flag == null) {
			return this._invalidationFlags.keys().hasNext();
		}
		return this._invalidationFlags.exists(flag);
	}
	,_ignoreInvalidationFlags: null
	,runWithoutInvalidation: function(callback) {
		var oldIgnoreValidation = this._ignoreInvalidationFlags;
		this._ignoreInvalidationFlags = true;
		callback();
		this._ignoreInvalidationFlags = oldIgnoreValidation;
	}
	,_setInvalidationFlagsOnly: null
	,runWithInvalidationFlagsOnly: function(callback) {
		var oldValue = this._setInvalidationFlagsOnly;
		this._setInvalidationFlagsOnly = true;
		callback();
		this._setInvalidationFlagsOnly = oldValue;
	}
	,setInvalid: function(flag) {
		if(this._ignoreInvalidationFlags) {
			return;
		}
		if(this._setInvalidationFlagsOnly) {
			if(flag == null) {
				this._allInvalid = true;
			} else {
				this.setInvalidationFlag(flag);
			}
			return;
		}
		var alreadyInvalid = this.isInvalid();
		var alreadyDelayedInvalid = false;
		if(this._validating) {
			alreadyDelayedInvalid = this._delayedInvalidationFlags.keys().hasNext();
		}
		if(flag == null) {
			if(this._validating) {
				this._allInvalidDelayed = true;
			} else {
				this._allInvalid = true;
			}
		} else if(this._validating) {
			this._delayedInvalidationFlags.set(flag,true);
		} else if(flag != null && !this._invalidationFlags.exists(flag)) {
			this._invalidationFlags.set(flag,true);
		}
		if(this._validationQueue == null) {
			return;
		}
		if(this._validating) {
			if(alreadyDelayedInvalid) {
				return;
			}
			this._setInvalidCount++;
			if(this._setInvalidCount >= 10) {
				var c = js_Boot.getClass(this);
				throw new openfl_errors_IllegalOperationError(c.__name__ + " returned to validation queue too many times during validation. This may be an infinite loop. Try to avoid doing anything that calls setInvalid() during validation.");
			}
			this._validationQueue.addControl(this);
			return;
		}
		if(alreadyInvalid) {
			return;
		}
		this._setInvalidCount = 0;
		this._validationQueue.addControl(this);
	}
	,validateNow: function() {
		if(!this.isInvalid()) {
			return;
		}
		if(this._validating) {
			return;
		}
		this._validating = true;
		this.update();
		this._allInvalid = this._allInvalidDelayed;
		this._allInvalidDelayed = false;
		this._invalidationFlags.clear();
		var flag = this._delayedInvalidationFlags.keys();
		while(flag.hasNext()) {
			var flag1 = flag.next();
			this._invalidationFlags.set(flag1,true);
		}
		this._delayedInvalidationFlags.clear();
		this._validating = false;
	}
	,setInvalidationFlag: function(flag) {
		if(this._ignoreInvalidationFlags) {
			return;
		}
		if(this._invalidationFlags.exists(flag)) {
			return;
		}
		this._invalidationFlags.set(flag,true);
	}
	,update: function() {
	}
	,validatingSprite_addedToStageHandler: function(event) {
		this._depth = feathers_utils_DisplayUtil.getDisplayObjectDepthFromStage(this);
		this._validationQueue = feathers_core_ValidationQueue.forStage(this.stage);
		if(this._validationQueue != null && this.isInvalid()) {
			this._setInvalidCount = 0;
			this._validationQueue.addControl(this);
		}
	}
	,validatingSprite_removedFromStageHandler: function(event) {
		this._depth = -1;
		this._validationQueue = null;
	}
	,__class__: feathers_core_ValidatingSprite
	,__properties__: $extend(openfl_display_Sprite.prototype.__properties__,{get_depth:"get_depth",get_validating:"get_validating"})
});
var feathers_core_IDisplayObject = function() { };
$hxClasses["feathers.core.IDisplayObject"] = feathers_core_IDisplayObject;
feathers_core_IDisplayObject.__name__ = "feathers.core.IDisplayObject";
feathers_core_IDisplayObject.__isInterface__ = true;
feathers_core_IDisplayObject.__interfaces__ = [openfl_events_IEventDispatcher];
feathers_core_IDisplayObject.prototype = {
	get_x: null
	,set_x: null
	,get_y: null
	,set_y: null
	,get_alpha: null
	,set_alpha: null
	,get_width: null
	,set_width: null
	,get_height: null
	,set_height: null
	,get_scaleX: null
	,set_scaleX: null
	,get_scaleY: null
	,set_scaleY: null
	,get_visible: null
	,set_visible: null
	,parent: null
	,stage: null
	,__class__: feathers_core_IDisplayObject
	,__properties__: {set_visible:"set_visible",get_visible:"get_visible",set_scaleY:"set_scaleY",get_scaleY:"get_scaleY",set_scaleX:"set_scaleX",get_scaleX:"get_scaleX",set_height:"set_height",get_height:"get_height",set_width:"set_width",get_width:"get_width",set_alpha:"set_alpha",get_alpha:"get_alpha",set_y:"set_y",get_y:"get_y",set_x:"set_x",get_x:"get_x"}
};
var feathers_core_IMeasureObject = function() { };
$hxClasses["feathers.core.IMeasureObject"] = feathers_core_IMeasureObject;
feathers_core_IMeasureObject.__name__ = "feathers.core.IMeasureObject";
feathers_core_IMeasureObject.__isInterface__ = true;
feathers_core_IMeasureObject.__interfaces__ = [feathers_core_IDisplayObject];
feathers_core_IMeasureObject.prototype = {
	get_explicitWidth: null
	,get_explicitHeight: null
	,get_explicitMinWidth: null
	,get_explicitMinHeight: null
	,get_explicitMaxWidth: null
	,get_explicitMaxHeight: null
	,get_minWidth: null
	,set_minWidth: null
	,get_minHeight: null
	,set_minHeight: null
	,get_maxWidth: null
	,set_maxWidth: null
	,get_maxHeight: null
	,set_maxHeight: null
	,resetWidth: null
	,resetHeight: null
	,resetMinWidth: null
	,resetMinHeight: null
	,resetMaxWidth: null
	,resetMaxHeight: null
	,__class__: feathers_core_IMeasureObject
	,__properties__: {set_maxHeight:"set_maxHeight",get_maxHeight:"get_maxHeight",set_maxWidth:"set_maxWidth",get_maxWidth:"get_maxWidth",set_minHeight:"set_minHeight",get_minHeight:"get_minHeight",set_minWidth:"set_minWidth",get_minWidth:"get_minWidth",get_explicitMaxHeight:"get_explicitMaxHeight",get_explicitMaxWidth:"get_explicitMaxWidth",get_explicitMinHeight:"get_explicitMinHeight",get_explicitMinWidth:"get_explicitMinWidth",get_explicitHeight:"get_explicitHeight",get_explicitWidth:"get_explicitWidth"}
};
var feathers_core_MeasureSprite = function() {
	this._explicitMaxHeight = null;
	this._explicitMaxWidth = null;
	this._explicitMinHeight = null;
	this._explicitMinWidth = null;
	this._explicitHeight = null;
	this._explicitWidth = null;
	this.scaledActualMaxHeight = 1.0 / 0.0;
	this.scaledActualMaxWidth = 1.0 / 0.0;
	this.scaledActualMinHeight = 0.0;
	this.scaledActualMinWidth = 0.0;
	this.scaledActualHeight = 0.0;
	this.scaledActualWidth = 0.0;
	this.actualMaxHeight = 1.0 / 0.0;
	this.actualMaxWidth = 1.0 / 0.0;
	this.actualMinHeight = 0.0;
	this.actualMinWidth = 0.0;
	this.actualHeight = 0.0;
	this.actualWidth = 0.0;
	feathers_core_ValidatingSprite.call(this);
};
$hxClasses["feathers.core.MeasureSprite"] = feathers_core_MeasureSprite;
feathers_core_MeasureSprite.__name__ = "feathers.core.MeasureSprite";
feathers_core_MeasureSprite.__interfaces__ = [feathers_core_IMeasureObject];
feathers_core_MeasureSprite.__super__ = feathers_core_ValidatingSprite;
feathers_core_MeasureSprite.prototype = $extend(feathers_core_ValidatingSprite.prototype,{
	actualWidth: null
	,actualHeight: null
	,actualMinWidth: null
	,actualMinHeight: null
	,actualMaxWidth: null
	,actualMaxHeight: null
	,scaledActualWidth: null
	,scaledActualHeight: null
	,scaledActualMinWidth: null
	,scaledActualMinHeight: null
	,scaledActualMaxWidth: null
	,scaledActualMaxHeight: null
	,get_width: function() {
		return this.scaledActualWidth;
	}
	,set_width: function(value) {
		if(this.get_scaleX() != 1.0) {
			value /= this.get_scaleX();
		}
		this.set_explicitWidth(value);
		return this.scaledActualWidth;
	}
	,get_height: function() {
		return this.scaledActualHeight;
	}
	,set_height: function(value) {
		if(this.get_scaleY() != 1.0) {
			value /= this.get_scaleY();
		}
		this.set_explicitHeight(value);
		return this.scaledActualHeight;
	}
	,set_scaleX: function(value) {
		feathers_core_ValidatingSprite.prototype.set_scaleX.call(this,value);
		this.saveMeasurements(this.actualWidth,this.actualHeight,this.actualMinWidth,this.actualMinHeight,this.actualMaxWidth,this.actualMaxHeight);
		return this.get_scaleX();
	}
	,set_scaleY: function(value) {
		feathers_core_ValidatingSprite.prototype.set_scaleY.call(this,value);
		this.saveMeasurements(this.actualWidth,this.actualHeight,this.actualMinWidth,this.actualMinHeight,this.actualMaxWidth,this.actualMaxHeight);
		return this.get_scaleY();
	}
	,_explicitWidth: null
	,get_explicitWidth: function() {
		return this._explicitWidth;
	}
	,set_explicitWidth: function(value) {
		if(this._explicitWidth == value) {
			return this._explicitWidth;
		}
		this._explicitWidth = value;
		if(value == null) {
			this.actualWidth = 0.0;
			this.scaledActualWidth = 0.0;
			this.setInvalid(feathers_core_InvalidationFlag.SIZE);
		} else {
			var result = this.saveMeasurements(value,this.actualHeight,this.actualMinWidth,this.actualMinHeight,this.actualMaxWidth,this.actualMaxHeight);
			if(result) {
				this.setInvalid(feathers_core_InvalidationFlag.SIZE);
			}
		}
		return this._explicitWidth;
	}
	,_explicitHeight: null
	,get_explicitHeight: function() {
		return this._explicitHeight;
	}
	,set_explicitHeight: function(value) {
		if(this._explicitHeight == value) {
			return this._explicitHeight;
		}
		this._explicitHeight = value;
		if(value == null) {
			this.actualHeight = 0.0;
			this.scaledActualHeight = 0.0;
			this.setInvalid(feathers_core_InvalidationFlag.SIZE);
		} else {
			var result = this.saveMeasurements(this.actualWidth,value,this.actualMinWidth,this.actualMinHeight,this.actualMaxWidth,this.actualMaxHeight);
			if(result) {
				this.setInvalid(feathers_core_InvalidationFlag.SIZE);
			}
		}
		return this._explicitHeight;
	}
	,_explicitMinWidth: null
	,get_explicitMinWidth: function() {
		return this._explicitMinWidth;
	}
	,set_explicitMinWidth: function(value) {
		if(this._explicitMinWidth == value) {
			return this._explicitMinWidth;
		}
		var oldValue = this._explicitMinWidth;
		this._explicitMinWidth = value;
		if(value == null) {
			this.actualMinWidth = 0.0;
			this.scaledActualMinWidth = 0.0;
			this.setInvalid(feathers_core_InvalidationFlag.SIZE);
		} else {
			var actualWidth = this.actualWidth;
			this.saveMeasurements(this.actualWidth,this.actualHeight,value,this.actualMinHeight,this.actualMaxWidth,this.actualMaxHeight);
			if(this._explicitWidth == null && (actualWidth < value || actualWidth == oldValue)) {
				this.setInvalid(feathers_core_InvalidationFlag.SIZE);
			}
		}
		return this._explicitMinWidth;
	}
	,_explicitMinHeight: null
	,get_explicitMinHeight: function() {
		return this._explicitMinHeight;
	}
	,set_explicitMinHeight: function(value) {
		if(this._explicitMinHeight == value) {
			return this._explicitMinHeight;
		}
		var oldValue = this._explicitMinHeight;
		this._explicitMinHeight = value;
		if(value == null) {
			this.actualMinHeight = 0.0;
			this.scaledActualMinHeight = 0.0;
			this.setInvalid(feathers_core_InvalidationFlag.SIZE);
		} else {
			var actualHeight = this.actualHeight;
			this.saveMeasurements(this.actualWidth,this.actualHeight,this.actualMinWidth,value,this.actualMaxWidth,this.actualMaxHeight);
			if(this._explicitHeight == null && (actualHeight < value || actualHeight == oldValue)) {
				this.setInvalid(feathers_core_InvalidationFlag.SIZE);
			}
		}
		return this._explicitMinHeight;
	}
	,get_minWidth: function() {
		return this.scaledActualMinWidth;
	}
	,set_minWidth: function(value) {
		if(this.get_scaleX() != 1) {
			value /= this.get_scaleX();
		}
		this.set_explicitMinWidth(value);
		return this.scaledActualMinWidth;
	}
	,get_minHeight: function() {
		return this.scaledActualMinHeight;
	}
	,set_minHeight: function(value) {
		if(this.get_scaleY() != 1) {
			value /= this.get_scaleY();
		}
		this.set_explicitMinHeight(value);
		return this.scaledActualMinHeight;
	}
	,_explicitMaxWidth: null
	,get_explicitMaxWidth: function() {
		return this._explicitMaxWidth;
	}
	,set_explicitMaxWidth: function(value) {
		if(this._explicitMaxWidth == value) {
			return this._explicitMaxWidth;
		}
		var oldValue = this._explicitMaxWidth;
		this._explicitMaxWidth = value;
		if(value == null) {
			this.actualMaxWidth = 1.0 / 0.0;
			this.scaledActualMaxWidth = 1.0 / 0.0;
			this.setInvalid(feathers_core_InvalidationFlag.SIZE);
		} else {
			var actualWidth = this.actualWidth;
			this.saveMeasurements(this.actualWidth,this.actualHeight,this.actualMinWidth,this.actualMinHeight,value,this.actualMaxHeight);
			if(this._explicitWidth == null && (actualWidth > value || actualWidth == oldValue)) {
				this.setInvalid(feathers_core_InvalidationFlag.SIZE);
			}
		}
		return this._explicitMaxWidth;
	}
	,_explicitMaxHeight: null
	,get_explicitMaxHeight: function() {
		return this._explicitMaxHeight;
	}
	,set_explicitMaxHeight: function(value) {
		if(this._explicitMaxHeight == value) {
			return this._explicitMaxHeight;
		}
		var oldValue = this._explicitMaxHeight;
		this._explicitMaxHeight = value;
		if(value == null) {
			this.actualMaxHeight = 1.0 / 0.0;
			this.scaledActualMaxHeight = 1.0 / 0.0;
			this.setInvalid(feathers_core_InvalidationFlag.SIZE);
		} else {
			var actualHeight = this.actualHeight;
			this.saveMeasurements(this.actualWidth,this.actualHeight,this.actualMinWidth,this.actualMinHeight,this.actualMaxWidth,value);
			if(this._explicitHeight == null && (actualHeight > value || actualHeight == oldValue)) {
				this.setInvalid(feathers_core_InvalidationFlag.SIZE);
			}
		}
		return this._explicitMaxHeight;
	}
	,get_maxWidth: function() {
		return this.scaledActualMaxWidth;
	}
	,set_maxWidth: function(value) {
		if(this.get_scaleX() != 1) {
			value /= this.get_scaleX();
		}
		this.set_explicitMaxWidth(value);
		return this.scaledActualMaxWidth;
	}
	,get_maxHeight: function() {
		return this.scaledActualMaxHeight;
	}
	,set_maxHeight: function(value) {
		if(this.get_scaleY() != 1) {
			value /= this.get_scaleY();
		}
		this.set_explicitMaxHeight(value);
		return this.scaledActualMaxHeight;
	}
	,resetWidth: function() {
		this.set_explicitWidth(null);
	}
	,resetHeight: function() {
		this.set_explicitHeight(null);
	}
	,resetMinWidth: function() {
		this.set_explicitMinWidth(null);
	}
	,resetMinHeight: function() {
		this.set_explicitMinHeight(null);
	}
	,resetMaxWidth: function() {
		this.set_explicitMaxWidth(null);
	}
	,resetMaxHeight: function() {
		this.set_explicitMaxHeight(null);
	}
	,__getBoundsHelperMatrix1: null
	,__getBoundsHelperMatrix2: null
	,getBounds: function(targetCoordinateSpace) {
		if(this.__getBoundsHelperMatrix1 == null) {
			this.__getBoundsHelperMatrix1 = new openfl_geom_Matrix();
		} else {
			this.__getBoundsHelperMatrix1.identity();
		}
		if(targetCoordinateSpace != null && targetCoordinateSpace != this) {
			if(this.__getBoundsHelperMatrix2 == null) {
				this.__getBoundsHelperMatrix2 = new openfl_geom_Matrix();
			}
			var worldTransform1 = this.__getWorldTransform();
			this.__getBoundsHelperMatrix1.copyFrom(worldTransform1);
			var worldTransform2 = targetCoordinateSpace.__getWorldTransform();
			this.__getBoundsHelperMatrix2.copyFrom(worldTransform2);
			this.__getBoundsHelperMatrix2.invert();
			this.__getBoundsHelperMatrix1.concat(this.__getBoundsHelperMatrix2);
			this.__getBoundsHelperMatrix2.identity();
		}
		var x = this.__getBoundsHelperMatrix1.tx;
		var y = this.__getBoundsHelperMatrix1.ty;
		var w = this.actualWidth * this.__getBoundsHelperMatrix1.a + this.actualHeight * this.__getBoundsHelperMatrix1.c + this.__getBoundsHelperMatrix1.tx - x;
		var h = this.actualWidth * this.__getBoundsHelperMatrix1.b + this.actualHeight * this.__getBoundsHelperMatrix1.d + this.__getBoundsHelperMatrix1.ty - y;
		this.__getBoundsHelperMatrix1.identity();
		return new openfl_geom_Rectangle(x,y,w,h);
	}
	,saveMeasurements: function(width,height,minWidth,minHeight,maxWidth,maxHeight) {
		if(minHeight == null) {
			minHeight = 0.0;
		}
		if(minWidth == null) {
			minWidth = 0.0;
		}
		if(maxWidth == null) {
			maxWidth = 1.0 / 0.0;
		}
		if(maxHeight == null) {
			maxHeight = 1.0 / 0.0;
		}
		if(this._explicitMinWidth != null) {
			minWidth = this._explicitMinWidth;
		}
		if(this._explicitMinHeight != null) {
			minHeight = this._explicitMinHeight;
		}
		if(this._explicitMaxWidth != null) {
			maxWidth = this._explicitMaxWidth;
		} else if(maxWidth == null) {
			maxWidth = 1.0 / 0.0;
		}
		if(this._explicitMaxHeight != null) {
			maxHeight = this._explicitMaxHeight;
		} else if(maxHeight == null) {
			maxHeight = 1.0 / 0.0;
		}
		if(this._explicitMaxWidth == null && maxWidth < minWidth) {
			maxWidth = minWidth;
		}
		if(this._explicitMinWidth == null && minWidth > maxWidth) {
			minWidth = maxWidth;
		}
		if(this._explicitMaxHeight == null && maxHeight < minHeight) {
			maxHeight = minHeight;
		}
		if(this._explicitMinHeight == null && minHeight > maxHeight) {
			minHeight = maxHeight;
		}
		if(this._explicitWidth != null) {
			width = this._explicitWidth;
		} else if(width < minWidth) {
			width = minWidth;
		} else if(width > maxWidth) {
			width = maxWidth;
		}
		if(this._explicitHeight != null) {
			height = this._explicitHeight;
		} else if(height < minHeight) {
			height = minHeight;
		} else if(height > maxHeight) {
			height = maxHeight;
		}
		var scaleX = this.get_scaleX();
		if(scaleX < 0.0) {
			scaleX = -scaleX;
		}
		var scaleY = this.get_scaleY();
		if(scaleY < 0.0) {
			scaleY = -scaleY;
		}
		var resized = false;
		if(this.actualWidth != width) {
			this.actualWidth = width;
			resized = true;
		}
		if(this.actualHeight != height) {
			this.actualHeight = height;
			resized = true;
		}
		if(this.actualMinWidth != minWidth) {
			this.actualMinWidth = minWidth;
			resized = true;
		}
		if(this.actualMinHeight != minHeight) {
			this.actualMinHeight = minHeight;
			resized = true;
		}
		if(this.actualMaxWidth != maxWidth) {
			this.actualMaxWidth = maxWidth;
			resized = true;
		}
		if(this.actualMaxHeight != maxHeight) {
			this.actualMaxHeight = maxHeight;
			resized = true;
		}
		width = this.scaledActualWidth;
		height = this.scaledActualHeight;
		this.scaledActualWidth = this.actualWidth * scaleX;
		this.scaledActualHeight = this.actualHeight * scaleY;
		this.scaledActualMinWidth = this.actualMinWidth * scaleX;
		this.scaledActualMinHeight = this.actualMinHeight * scaleY;
		this.scaledActualMaxWidth = this.actualMaxWidth * scaleX;
		this.scaledActualMaxHeight = this.actualMaxHeight * scaleY;
		if(width != this.scaledActualWidth || height != this.scaledActualHeight) {
			resized = true;
			feathers_events_FeathersEvent.dispatch(this,"resize");
		}
		return resized;
	}
	,__class__: feathers_core_MeasureSprite
	,__properties__: $extend(feathers_core_ValidatingSprite.prototype.__properties__,{set_maxHeight:"set_maxHeight",get_maxHeight:"get_maxHeight",set_maxWidth:"set_maxWidth",get_maxWidth:"get_maxWidth",set_explicitMaxHeight:"set_explicitMaxHeight",get_explicitMaxHeight:"get_explicitMaxHeight",set_explicitMaxWidth:"set_explicitMaxWidth",get_explicitMaxWidth:"get_explicitMaxWidth",set_minHeight:"set_minHeight",get_minHeight:"get_minHeight",set_minWidth:"set_minWidth",get_minWidth:"get_minWidth",set_explicitMinHeight:"set_explicitMinHeight",get_explicitMinHeight:"get_explicitMinHeight",set_explicitMinWidth:"set_explicitMinWidth",get_explicitMinWidth:"get_explicitMinWidth",set_explicitHeight:"set_explicitHeight",get_explicitHeight:"get_explicitHeight",set_explicitWidth:"set_explicitWidth",get_explicitWidth:"get_explicitWidth"})
});
var feathers_layout_ILayoutObject = function() { };
$hxClasses["feathers.layout.ILayoutObject"] = feathers_layout_ILayoutObject;
feathers_layout_ILayoutObject.__name__ = "feathers.layout.ILayoutObject";
feathers_layout_ILayoutObject.__isInterface__ = true;
feathers_layout_ILayoutObject.__interfaces__ = [openfl_events_IEventDispatcher];
feathers_layout_ILayoutObject.prototype = {
	get_includeInLayout: null
	,set_includeInLayout: null
	,get_layoutData: null
	,set_layoutData: null
	,__class__: feathers_layout_ILayoutObject
	,__properties__: {set_layoutData:"set_layoutData",get_layoutData:"get_layoutData",set_includeInLayout:"set_includeInLayout",get_includeInLayout:"get_includeInLayout"}
};
var feathers_style_IStyleObject = function() { };
$hxClasses["feathers.style.IStyleObject"] = feathers_style_IStyleObject;
feathers_style_IStyleObject.__name__ = "feathers.style.IStyleObject";
feathers_style_IStyleObject.__isInterface__ = true;
feathers_style_IStyleObject.prototype = {
	get_themeEnabled: null
	,set_themeEnabled: null
	,__class__: feathers_style_IStyleObject
	,__properties__: {set_themeEnabled:"set_themeEnabled",get_themeEnabled:"get_themeEnabled"}
};
var feathers_style_IVariantStyleObject = function() { };
$hxClasses["feathers.style.IVariantStyleObject"] = feathers_style_IVariantStyleObject;
feathers_style_IVariantStyleObject.__name__ = "feathers.style.IVariantStyleObject";
feathers_style_IVariantStyleObject.__isInterface__ = true;
feathers_style_IVariantStyleObject.__interfaces__ = [feathers_style_IStyleObject];
feathers_style_IVariantStyleObject.prototype = {
	get_styleContext: null
	,get_variant: null
	,set_variant: null
	,__class__: feathers_style_IVariantStyleObject
	,__properties__: {set_variant:"set_variant",get_variant:"get_variant",get_styleContext:"get_styleContext"}
};
var feathers_core_IUIControl = function() { };
$hxClasses["feathers.core.IUIControl"] = feathers_core_IUIControl;
feathers_core_IUIControl.__name__ = "feathers.core.IUIControl";
feathers_core_IUIControl.__isInterface__ = true;
feathers_core_IUIControl.__interfaces__ = [feathers_core_IDisplayObject];
feathers_core_IUIControl.prototype = {
	get_enabled: null
	,set_enabled: null
	,get_toolTip: null
	,set_toolTip: null
	,initializeNow: null
	,dispose: null
	,__class__: feathers_core_IUIControl
	,__properties__: {set_toolTip:"set_toolTip",get_toolTip:"get_toolTip",set_enabled:"set_enabled",get_enabled:"get_enabled"}
};
var feathers_core_FeathersControl = function() {
	this._restrictedStyles = [];
	this._styleProviderStyles = [];
	this._clearingStyles = false;
	this._applyingStyles = false;
	this._focusPaddingLeft = 0.0;
	this._focusPaddingBottom = 0.0;
	this._focusPaddingRight = 0.0;
	this._focusPaddingTop = 0.0;
	this._focusRectSkin = null;
	this._alwaysShowFocus = false;
	this._currentFocusRectSkin = null;
	this._focusEnabled = true;
	this._focusManager = null;
	this._disabledAlpha = null;
	this._explicitAlpha = 1.0;
	this._includeInLayout = true;
	this._customStyleProvider = null;
	this._currentStyleProvider = null;
	this._themeEnabled = true;
	this._toolTip = null;
	this._enabled = true;
	this._created = false;
	this._initialized = false;
	this._initializing = false;
	this._waitingToApplyStyles = false;
	feathers_core_MeasureSprite.call(this);
	this.set_tabEnabled(js_Boot.__implements(this,feathers_core_IFocusObject));
	this.addEventListener("addedToStage",$bind(this,this.feathersControl_addedToStageHandler));
	this.addEventListener("removedFromStage",$bind(this,this.feathersControl_removedFromStageHandler));
	this.addEventListener("focusIn",$bind(this,this.feathersControl_focusInHandler));
	this.addEventListener("focusOut",$bind(this,this.feathersControl_focusOutHandler));
};
$hxClasses["feathers.core.FeathersControl"] = feathers_core_FeathersControl;
feathers_core_FeathersControl.__name__ = "feathers.core.FeathersControl";
feathers_core_FeathersControl.__interfaces__ = [feathers_layout_ILayoutObject,feathers_style_IVariantStyleObject,feathers_core_IUIControl];
feathers_core_FeathersControl.__super__ = feathers_core_MeasureSprite;
feathers_core_FeathersControl.prototype = $extend(feathers_core_MeasureSprite.prototype,{
	_waitingToApplyStyles: null
	,_initializing: null
	,_initialized: null
	,get_initialized: function() {
		return this._initialized;
	}
	,_created: null
	,get_created: function() {
		return this._created;
	}
	,_enabled: null
	,get_enabled: function() {
		return this._enabled;
	}
	,set_enabled: function(value) {
		if(this._enabled == value) {
			return this._enabled;
		}
		this._enabled = value;
		if(this._enabled || this._disabledAlpha == null) {
			feathers_core_MeasureSprite.prototype.set_alpha.call(this,this._explicitAlpha);
		} else if(!this._enabled && this._disabledAlpha != null) {
			feathers_core_MeasureSprite.prototype.set_alpha.call(this,this._disabledAlpha);
		}
		this.setInvalid(feathers_core_InvalidationFlag.STATE);
		if(this._enabled) {
			feathers_events_FeathersEvent.dispatch(this,"enable");
		} else {
			feathers_events_FeathersEvent.dispatch(this,"disable");
		}
		return this._enabled;
	}
	,_toolTip: null
	,get_toolTip: function() {
		return this._toolTip;
	}
	,set_toolTip: function(value) {
		if(this._toolTip == value) {
			return this._toolTip;
		}
		this._toolTip = value;
		return this._toolTip;
	}
	,_themeEnabled: null
	,get_themeEnabled: function() {
		return this._themeEnabled;
	}
	,set_themeEnabled: function(value) {
		if(this._themeEnabled == value) {
			return this._themeEnabled;
		}
		this._themeEnabled = value;
		if(this._initialized && this.stage != null) {
			this.applyStyles();
		} else {
			this._waitingToApplyStyles = true;
		}
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this._themeEnabled;
	}
	,_currentStyleProvider: null
	,_customStyleProvider: null
	,get_styleProvider: function() {
		if(this._customStyleProvider != null) {
			return this._customStyleProvider;
		}
		return this._currentStyleProvider;
	}
	,set_styleProvider: function(value) {
		if(this._customStyleProvider == value) {
			return this._customStyleProvider;
		}
		if(this._customStyleProvider != null) {
			this._customStyleProvider.removeEventListener("clear",$bind(this,this.feathersControl_customStyleProvider_clearHandler));
		}
		this._customStyleProvider = value;
		if(this._customStyleProvider != null) {
			this._customStyleProvider.addEventListener("clear",$bind(this,this.feathersControl_customStyleProvider_clearHandler),false,0,true);
		}
		if(this._initialized && this.stage != null) {
			this.applyStyles();
		} else {
			this._waitingToApplyStyles = true;
		}
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this._customStyleProvider;
	}
	,get_styleContext: function() {
		return null;
	}
	,_includeInLayout: null
	,get_includeInLayout: function() {
		return this._includeInLayout;
	}
	,set_includeInLayout: function(value) {
		if(this._includeInLayout == value) {
			return this._includeInLayout;
		}
		this._includeInLayout = value;
		feathers_events_FeathersEvent.dispatch(this,"layoutDataChange");
		return this._includeInLayout;
	}
	,_layoutData: null
	,get_layoutData: function() {
		return this._layoutData;
	}
	,set_layoutData: function(value) {
		if(!this.setStyle("layoutData")) {
			return this._layoutData;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_layoutData);
		return this.setLayoutDataInternal(value);
	}
	,_explicitAlpha: null
	,set_alpha: function(value) {
		this._explicitAlpha = value;
		if(this._enabled || this._disabledAlpha == null) {
			feathers_core_MeasureSprite.prototype.set_alpha.call(this,value);
		}
		return this._explicitAlpha;
	}
	,_disabledAlpha: null
	,get_disabledAlpha: function() {
		return this._disabledAlpha;
	}
	,set_disabledAlpha: function(value) {
		if(!this.setStyle("disabledAlpha")) {
			return this._disabledAlpha;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_disabledAlpha);
		this._disabledAlpha = value;
		if(this._enabled || this._disabledAlpha == null) {
			feathers_core_MeasureSprite.prototype.set_alpha.call(this,this._explicitAlpha);
		} else if(!this._enabled && this._disabledAlpha != null) {
			feathers_core_MeasureSprite.prototype.set_alpha.call(this,this._disabledAlpha);
		}
		return this._disabledAlpha;
	}
	,_focusManager: null
	,get_focusManager: function() {
		return this._focusManager;
	}
	,set_focusManager: function(value) {
		if(this._focusManager == value) {
			return this._focusManager;
		}
		if(this._focusManager != null) {
			this.showFocus(false);
		}
		this._focusManager = value;
		return this._focusManager;
	}
	,_focusOwner: null
	,get_focusOwner: function() {
		return this._focusOwner;
	}
	,set_focusOwner: function(value) {
		if(this._focusOwner == value) {
			return this._focusOwner;
		}
		this._focusOwner = value;
		return this._focusOwner;
	}
	,get_rawTabEnabled: function() {
		return feathers_core_MeasureSprite.prototype.get_tabEnabled.call(this);
	}
	,_focusEnabled: null
	,get_focusEnabled: function() {
		if(this._enabled) {
			return this._focusEnabled;
		} else {
			return false;
		}
	}
	,set_focusEnabled: function(value) {
		if(this._focusEnabled == value) {
			return this._focusEnabled;
		}
		this._focusEnabled = value;
		return this._focusEnabled;
	}
	,get_tabEnabled: function() {
		if(this._enabled) {
			return feathers_core_MeasureSprite.prototype.get_tabEnabled.call(this);
		} else {
			return false;
		}
	}
	,_currentFocusRectSkin: null
	,_alwaysShowFocus: null
	,get_alwaysShowFocus: function() {
		return this._alwaysShowFocus;
	}
	,set_alwaysShowFocus: function(value) {
		if(!this.setStyle("alwaysShowFocus")) {
			return this._alwaysShowFocus;
		}
		var wasFocused = this._focusManager != null && js_Boot.__implements(this,feathers_core_IFocusObject) && this._focusManager.get_focus() == this || this._focusRectSkin.parent != null;
		if(wasFocused) {
			this.showFocus(false);
		}
		this._alwaysShowFocus = value;
		if(wasFocused) {
			this.showFocus(true);
		}
		return this._alwaysShowFocus;
	}
	,_focusRectSkin: null
	,get_focusRectSkin: function() {
		return this._focusRectSkin;
	}
	,set_focusRectSkin: function(value) {
		if(!this.setStyle("focusRectSkin")) {
			return this._focusRectSkin;
		}
		this.showFocus(false);
		this._previousClearStyle = $bind(this,this.clearStyle_focusRectSkin);
		this._focusRectSkin = value;
		return this._focusRectSkin;
	}
	,_focusPaddingTop: null
	,get_focusPaddingTop: function() {
		return this._focusPaddingTop;
	}
	,set_focusPaddingTop: function(value) {
		if(!this.setStyle("focusPaddingTop")) {
			return this._focusPaddingTop;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_focusPaddingTop);
		this._focusPaddingTop = value;
		return this._focusPaddingTop;
	}
	,_focusPaddingRight: null
	,get_focusPaddingRight: function() {
		return this._focusPaddingRight;
	}
	,set_focusPaddingRight: function(value) {
		if(!this.setStyle("focusPaddingRight")) {
			return this._focusPaddingRight;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_focusPaddingRight);
		this._focusPaddingRight = value;
		return this._focusPaddingRight;
	}
	,_focusPaddingBottom: null
	,get_focusPaddingBottom: function() {
		return this._focusPaddingBottom;
	}
	,set_focusPaddingBottom: function(value) {
		if(!this.setStyle("focusPaddingBottom")) {
			return this._focusPaddingBottom;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_focusPaddingBottom);
		this._focusPaddingBottom = value;
		return this._focusPaddingBottom;
	}
	,_focusPaddingLeft: null
	,get_focusPaddingLeft: function() {
		return this._focusPaddingLeft;
	}
	,set_focusPaddingLeft: function(value) {
		if(!this.setStyle("focusPaddingLeft")) {
			return this._focusPaddingLeft;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_focusPaddingLeft);
		this._focusPaddingLeft = value;
		return this._focusPaddingLeft;
	}
	,setFocusPadding: function(value) {
		this.set_focusPaddingTop(value);
		this.set_focusPaddingRight(value);
		this.set_focusPaddingBottom(value);
		this.set_focusPaddingLeft(value);
	}
	,showFocus: function(show) {
		this._currentFocusRectSkin = this.getCurrentFocusRectSkin();
		if(this._focusManager == null || this._currentFocusRectSkin == null) {
			return;
		}
		if(show) {
			this._focusManager.get_focusPane().addChild(this._currentFocusRectSkin);
			this.addEventListener("enterFrame",$bind(this,this.feathersControl_focusRect_enterFrameHandler));
			this.positionFocusRect();
		} else if(this._currentFocusRectSkin.parent != null) {
			this.removeEventListener("enterFrame",$bind(this,this.feathersControl_focusRect_enterFrameHandler));
			this._currentFocusRectSkin.parent.removeChild(this._currentFocusRectSkin);
		}
	}
	,getCurrentFocusRectSkin: function() {
		return this._focusRectSkin;
	}
	,clearStyle_layoutData: function() {
		return this.setLayoutDataInternal(null);
	}
	,clearStyle_focusRectSkin: function() {
		this.showFocus(false);
		this._focusRectSkin = null;
		return this._focusRectSkin;
	}
	,clearStyle_disabledAlpha: function() {
		this._disabledAlpha = null;
		feathers_core_MeasureSprite.prototype.set_alpha.call(this,this._explicitAlpha);
		return this._disabledAlpha;
	}
	,clearStyle_focusPaddingTop: function() {
		this._focusPaddingTop = 0.0;
		return this._focusPaddingTop;
	}
	,clearStyle_focusPaddingRight: function() {
		this._focusPaddingRight = 0.0;
		return this._focusPaddingRight;
	}
	,clearStyle_focusPaddingBottom: function() {
		this._focusPaddingBottom = 0.0;
		return this._focusPaddingBottom;
	}
	,clearStyle_focusPaddingLeft: function() {
		this._focusPaddingLeft = 0.0;
		return this._focusPaddingLeft;
	}
	,positionFocusRect: function() {
		if(this._focusManager == null || this._currentFocusRectSkin == null || this._currentFocusRectSkin.parent == null) {
			return;
		}
		var point = new openfl_geom_Point(-this._focusPaddingLeft,-this._focusPaddingTop);
		point = this.localToGlobal(point);
		point = this._focusManager.get_focusPane().globalToLocal(point);
		this._currentFocusRectSkin.set_x(point.x);
		this._currentFocusRectSkin.set_y(point.y);
		point.setTo(this.actualWidth + this._focusPaddingRight,this.actualHeight + this._focusPaddingBottom);
		point = this.localToGlobal(point);
		point = this._focusManager.get_focusPane().globalToLocal(point);
		this._currentFocusRectSkin.set_width(point.x - this._currentFocusRectSkin.get_x());
		this._currentFocusRectSkin.set_height(point.y - this._currentFocusRectSkin.get_y());
	}
	,setLayoutDataInternal: function(value) {
		if(this._layoutData == value) {
			return this._layoutData;
		}
		if(this._layoutData != null) {
			this._layoutData.removeEventListener("change",$bind(this,this.feathersControl_layoutData_changeHandler));
		}
		this._layoutData = value;
		if(this._layoutData != null) {
			this._layoutData.addEventListener("change",$bind(this,this.feathersControl_layoutData_changeHandler),false,0,true);
		}
		feathers_events_FeathersEvent.dispatch(this,"layoutDataChange");
		return this._layoutData;
	}
	,_variant: null
	,get_variant: function() {
		return this._variant;
	}
	,set_variant: function(value) {
		if(this._variant == value) {
			return this._variant;
		}
		this._variant = value;
		if(this._initialized && this.stage != null) {
			this.applyStyles();
		} else {
			this._waitingToApplyStyles = true;
		}
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this._variant;
	}
	,_applyingStyles: null
	,_clearingStyles: null
	,_styleProviderStyles: null
	,_restrictedStyles: null
	,validateNow: function() {
		if(!this._initialized) {
			if(this._initializing) {
				throw new openfl_errors_IllegalOperationError("A component cannot validate until after it has finished initializing.");
			}
			this.initializeNow();
		}
		if(this._waitingToApplyStyles) {
			this.applyStyles();
		}
		feathers_core_MeasureSprite.prototype.validateNow.call(this);
		if(!this._created) {
			this._created = true;
			feathers_events_FeathersEvent.dispatch(this,"creationComplete");
		}
	}
	,initializeNow: function() {
		if(this._initialized || this._initializing) {
			return;
		}
		this._waitingToApplyStyles = true;
		this._initializing = true;
		this.initialize();
		this.setInvalid();
		this._initializing = false;
		this._initialized = true;
		feathers_events_FeathersEvent.dispatch(this,"initialize");
	}
	,move: function(x,y) {
		this.set_x(x);
		this.set_y(y);
	}
	,setSize: function(width,height) {
		this.set_width(width);
		this.set_height(height);
	}
	,dispose: function() {
		this.clearStyles();
		var _g = 0;
		var _g1 = this.get_numChildren();
		while(_g < _g1) {
			var i = _g++;
			var child = this.getChildAt(i);
			if(js_Boot.__implements(child,feathers_core_IUIControl)) {
				child.dispose();
			}
		}
	}
	,initialize: function() {
	}
	,setStyle: function(styleName,state) {
		var styleDef = state == null ? feathers_core__$FeathersControl_StyleDefinition.Name(styleName) : feathers_core__$FeathersControl_StyleDefinition.NameAndState(styleName,state);
		var restricted = this.containsStyleDef(this._restrictedStyles,styleDef);
		if(this._applyingStyles && restricted) {
			return false;
		}
		if(this._applyingStyles) {
			if(!this._clearingStyles && !this.containsStyleDef(this._styleProviderStyles,styleDef)) {
				this._styleProviderStyles.push(styleDef);
			}
		} else if(!restricted) {
			if(!this._clearingStyles && this.containsStyleDef(this._styleProviderStyles,styleDef)) {
				HxOverrides.remove(this._styleProviderStyles,styleDef);
			}
			this._restrictedStyles.push(styleDef);
		}
		return true;
	}
	,isStyleRestricted: function(styleName,state) {
		var styleDef = state == null ? feathers_core__$FeathersControl_StyleDefinition.Name(styleName) : feathers_core__$FeathersControl_StyleDefinition.NameAndState(styleName,state);
		return this.containsStyleDef(this._restrictedStyles,styleDef);
	}
	,containsStyleDef: function(target,styleDef) {
		var _g = 0;
		while(_g < target.length) {
			var other = target[_g];
			++_g;
			if(Type.enumEq(styleDef,other)) {
				return true;
			}
		}
		return false;
	}
	,applyStyles: function() {
		if(!this._initialized) {
			throw new openfl_errors_IllegalOperationError("Cannot apply styles until after a Feathers UI component has initialized.");
		}
		this._waitingToApplyStyles = false;
		var styleProvider = this._customStyleProvider;
		if(styleProvider == null) {
			var theme = feathers_style_Theme.getTheme(this);
			if(theme != null) {
				styleProvider = theme.getStyleProvider(this);
			}
		}
		if(this._themeEnabled && styleProvider == null) {
			var theme = feathers_style_Theme.get_fallbackTheme();
			if(theme != null) {
				styleProvider = theme.getStyleProvider(this);
			}
		}
		if(styleProvider == null) {
			styleProvider = this._currentStyleProvider;
		}
		if(this._currentStyleProvider != styleProvider) {
			if(this._currentStyleProvider != null) {
				this._currentStyleProvider.removeEventListener("stylesChange",$bind(this,this.feathersControl_styleProvider_stylesChangeHandler));
				this._currentStyleProvider.removeEventListener("clear",$bind(this,this.feathersControl_styleProvider_clearHandler));
			}
			this._currentStyleProvider = styleProvider;
			if(this._currentStyleProvider != null) {
				this._currentStyleProvider.addEventListener("stylesChange",$bind(this,this.feathersControl_styleProvider_stylesChangeHandler),false,0,true);
				this._currentStyleProvider.addEventListener("clear",$bind(this,this.feathersControl_styleProvider_clearHandler),false,0,true);
			}
		}
		var oldApplyingStyles = this._applyingStyles;
		this._applyingStyles = true;
		this.clearStyles();
		if(this._currentStyleProvider != null) {
			this._currentStyleProvider.applyStyles(this);
		}
		this._applyingStyles = oldApplyingStyles;
	}
	,_previousClearStyle: null
	,clearStyles: function() {
		var oldClearingStyles = this._clearingStyles;
		this._clearingStyles = true;
		var _g = 0;
		var _g1 = this._styleProviderStyles;
		while(_g < _g1.length) {
			var styleDef = _g1[_g];
			++_g;
			switch(styleDef._hx_index) {
			case 0:
				var name = styleDef.name;
				var clearMethodName = "clearStyle_" + name;
				var clearMethod = Reflect.field(this,clearMethodName);
				if(clearMethod == null) {
					throw new openfl_errors_ArgumentError("Missing @style method: '" + clearMethodName + "'");
				}
				clearMethod.apply(this,[]);
				break;
			case 1:
				var name1 = styleDef.name;
				var state = styleDef.state;
				var method = Reflect.field(this,name1);
				method.apply(this,[state,null]);
				break;
			}
		}
		this._styleProviderStyles = [];
		this._clearingStyles = oldClearingStyles;
	}
	,clearStyleProvider: function() {
		if(this._currentStyleProvider == null) {
			return;
		}
		this._currentStyleProvider.removeEventListener("stylesChange",$bind(this,this.feathersControl_styleProvider_stylesChangeHandler));
		this._currentStyleProvider.removeEventListener("clear",$bind(this,this.feathersControl_styleProvider_clearHandler));
		this._currentStyleProvider = null;
		this._waitingToApplyStyles = true;
	}
	,feathersControl_addedToStageHandler: function(event) {
		if(!this._initialized) {
			this.initializeNow();
		}
		if(this._waitingToApplyStyles) {
			this.applyStyles();
		}
	}
	,feathersControl_removedFromStageHandler: function(event) {
		this.showFocus(false);
		this.clearStyleProvider();
	}
	,feathersControl_focusInHandler: function(event) {
		var focusThis = null;
		if(js_Boot.__implements(this,feathers_core_IFocusObject)) {
			focusThis = this;
		}
		if(this._focusManager == null || !this._focusManager.get_showFocusIndicator() && !this.get_alwaysShowFocus() || this._focusManager.get_focus() != focusThis) {
			return;
		}
		this.showFocus(true);
	}
	,feathersControl_focusOutHandler: function(event) {
		if(this._focusManager == null) {
			return;
		}
		this.showFocus(false);
	}
	,feathersControl_styleProvider_stylesChangeHandler: function(event) {
		if(!event.affectsTarget(this)) {
			return;
		}
		if(this.stage != null) {
			this.applyStyles();
		} else {
			this._waitingToApplyStyles = true;
		}
	}
	,feathersControl_customStyleProvider_clearHandler: function(event) {
		this._customStyleProvider.removeEventListener("clear",$bind(this,this.feathersControl_customStyleProvider_clearHandler));
		this._customStyleProvider = null;
	}
	,feathersControl_styleProvider_clearHandler: function(event) {
		this.clearStyleProvider();
		if(this.stage != null) {
			this.applyStyles();
		}
	}
	,feathersControl_layoutData_changeHandler: function(event) {
		feathers_events_FeathersEvent.dispatch(this,"layoutDataChange");
	}
	,feathersControl_focusRect_enterFrameHandler: function(event) {
		this.positionFocusRect();
	}
	,__class__: feathers_core_FeathersControl
	,__properties__: $extend(feathers_core_MeasureSprite.prototype.__properties__,{set_variant:"set_variant",get_variant:"get_variant",set_focusPaddingLeft:"set_focusPaddingLeft",get_focusPaddingLeft:"get_focusPaddingLeft",set_focusPaddingBottom:"set_focusPaddingBottom",get_focusPaddingBottom:"get_focusPaddingBottom",set_focusPaddingRight:"set_focusPaddingRight",get_focusPaddingRight:"get_focusPaddingRight",set_focusPaddingTop:"set_focusPaddingTop",get_focusPaddingTop:"get_focusPaddingTop",set_focusRectSkin:"set_focusRectSkin",get_focusRectSkin:"get_focusRectSkin",set_alwaysShowFocus:"set_alwaysShowFocus",get_alwaysShowFocus:"get_alwaysShowFocus",set_focusEnabled:"set_focusEnabled",get_focusEnabled:"get_focusEnabled",get_rawTabEnabled:"get_rawTabEnabled",set_focusOwner:"set_focusOwner",get_focusOwner:"get_focusOwner",set_focusManager:"set_focusManager",get_focusManager:"get_focusManager",set_disabledAlpha:"set_disabledAlpha",get_disabledAlpha:"get_disabledAlpha",set_layoutData:"set_layoutData",get_layoutData:"get_layoutData",set_includeInLayout:"set_includeInLayout",get_includeInLayout:"get_includeInLayout",get_styleContext:"get_styleContext",set_styleProvider:"set_styleProvider",get_styleProvider:"get_styleProvider",set_themeEnabled:"set_themeEnabled",get_themeEnabled:"get_themeEnabled",set_toolTip:"set_toolTip",get_toolTip:"get_toolTip",set_enabled:"set_enabled",get_enabled:"get_enabled",get_created:"get_created",get_initialized:"get_initialized"})
});
var feathers_controls_LayoutGroup = function() {
	this.__maskSkin = null;
	this.__disabledBackgroundSkin = null;
	this.__backgroundSkin = null;
	this.__layout = null;
	this._layoutChanged = false;
	this._layoutActive = false;
	this._xmlContent = null;
	this._autoSizeMode = feathers_layout_AutoSizeMode.CONTENT;
	this._currentMaskSkin = null;
	this._backgroundSkinMeasurements = null;
	this._currentBackgroundSkin = null;
	this._ignoreLayoutChanges = false;
	this._ignoreChangesButSetFlags = false;
	this._ignoreChildChanges = false;
	this._layoutMeasurements = new feathers_layout_Measurements();
	this._layoutResult = new feathers_layout_LayoutBoundsResult();
	this.items = [];
	this.initializeLayoutGroupTheme();
	feathers_core_FeathersControl.call(this);
	this.addEventListener("addedToStage",$bind(this,this.layoutGroup_addedToStageHandler));
};
$hxClasses["feathers.controls.LayoutGroup"] = feathers_controls_LayoutGroup;
feathers_controls_LayoutGroup.__name__ = "feathers.controls.LayoutGroup";
feathers_controls_LayoutGroup.__super__ = feathers_core_FeathersControl;
feathers_controls_LayoutGroup.prototype = $extend(feathers_core_FeathersControl.prototype,{
	items: null
	,_layoutResult: null
	,_layoutMeasurements: null
	,_ignoreChildChanges: null
	,_ignoreChangesButSetFlags: null
	,_ignoreLayoutChanges: null
	,_currentBackgroundSkin: null
	,_backgroundSkinMeasurements: null
	,_currentMaskSkin: null
	,_autoSizeMode: null
	,get_autoSizeMode: function() {
		return this._autoSizeMode;
	}
	,set_autoSizeMode: function(value) {
		if(this._autoSizeMode == value) {
			return this._autoSizeMode;
		}
		this._autoSizeMode = value;
		this.setInvalid(feathers_core_InvalidationFlag.SIZE);
		if(this.stage != null) {
			if(this._autoSizeMode == feathers_layout_AutoSizeMode.STAGE) {
				this.stage.addEventListener("resize",$bind(this,this.layoutGroup_stage_resizeHandler),false,0,true);
				this.addEventListener("removedFromStage",$bind(this,this.layoutGroup_removedFromStageHandler));
			} else {
				this.stage.removeEventListener("resize",$bind(this,this.layoutGroup_stage_resizeHandler));
				this.removeEventListener("removedFromStage",$bind(this,this.layoutGroup_removedFromStageHandler));
			}
		}
		return this._autoSizeMode;
	}
	,_disabledOverlay: null
	,_currentLayout: null
	,get_numChildren: function() {
		return this.items.length;
	}
	,get__numChildren: function() {
		return feathers_core_FeathersControl.prototype.get_numChildren.call(this);
	}
	,addChildAt: function(child,index) {
		var oldIndex = this.items.indexOf(child);
		if(oldIndex == index) {
			return child;
		}
		var privateIndex = this.getPrivateIndexForPublicIndex(index);
		if(oldIndex >= 0) {
			this.items.splice(oldIndex,1);
		}
		this.items.splice(index,0,child);
		var result = this._addChildAt(child,privateIndex);
		child.addEventListener("resize",$bind(this,this.layoutGroup_child_resizeHandler));
		if(js_Boot.__implements(child,feathers_layout_ILayoutObject)) {
			child.addEventListener("layoutDataChange",$bind(this,this.layoutGroup_child_layoutDataChangeHandler),false,0,true);
		}
		if(this._ignoreChangesButSetFlags) {
			this.setInvalidationFlag(feathers_core_InvalidationFlag.LAYOUT);
		} else {
			this.setInvalid(feathers_core_InvalidationFlag.LAYOUT);
		}
		return result;
	}
	,_addChild: function(child) {
		return feathers_core_FeathersControl.prototype.addChildAt.call(this,child,this.get__numChildren());
	}
	,_addChildAt: function(child,index) {
		return feathers_core_FeathersControl.prototype.addChildAt.call(this,child,index);
	}
	,removeChild: function(child) {
		if(child == null || child.parent != this) {
			return child;
		}
		HxOverrides.remove(this.items,child);
		var result = this._removeChild(child);
		child.removeEventListener("resize",$bind(this,this.layoutGroup_child_resizeHandler));
		if(js_Boot.__implements(child,feathers_layout_ILayoutObject)) {
			child.removeEventListener("layoutDataChange",$bind(this,this.layoutGroup_child_layoutDataChangeHandler));
		}
		if(this._ignoreChangesButSetFlags) {
			this.setInvalidationFlag(feathers_core_InvalidationFlag.LAYOUT);
		} else {
			this.setInvalid(feathers_core_InvalidationFlag.LAYOUT);
		}
		return result;
	}
	,_removeChild: function(child) {
		return feathers_core_FeathersControl.prototype.removeChild.call(this,child);
	}
	,removeChildAt: function(index) {
		if(index >= 0 && index < this.items.length) {
			return this.removeChild(this.items[index]);
		}
		return null;
	}
	,_removeChildAt: function(index) {
		return feathers_core_FeathersControl.prototype.removeChildAt.call(this,index);
	}
	,getChildIndex: function(child) {
		return this.items.indexOf(child);
	}
	,_getChildIndex: function(child) {
		return feathers_core_FeathersControl.prototype.getChildIndex.call(this,child);
	}
	,getChildByName: function(name) {
		var _g = 0;
		var _g1 = this.items;
		while(_g < _g1.length) {
			var child = _g1[_g];
			++_g;
			if(child.get_name() == name) {
				return child;
			}
		}
		return null;
	}
	,_getChildByName: function(name) {
		return feathers_core_FeathersControl.prototype.getChildByName.call(this,name);
	}
	,removeChildren: function(beginIndex,endIndex) {
		if(endIndex == null) {
			endIndex = 2147483647;
		}
		if(beginIndex == null) {
			beginIndex = 0;
		}
		if(endIndex == 2147483647) {
			endIndex = this.items.length - 1;
			if(endIndex < 0) {
				return;
			}
		}
		if(beginIndex > this.items.length - 1) {
			return;
		} else if(endIndex < beginIndex || beginIndex < 0 || endIndex > this.items.length) {
			throw new openfl_errors_RangeError("The supplied index is out of bounds.");
		}
		var numRemovals = endIndex - beginIndex;
		while(numRemovals >= 0) {
			this.removeChildAt(beginIndex);
			--numRemovals;
		}
	}
	,_removeChildren: function(beginIndex,endIndex) {
		if(endIndex == null) {
			endIndex = 2147483647;
		}
		if(beginIndex == null) {
			beginIndex = 0;
		}
		feathers_core_FeathersControl.prototype.removeChildren.call(this,beginIndex,endIndex);
	}
	,setChildIndex: function(child,index) {
		var oldIndex = this.getChildIndex(child);
		if(oldIndex == index) {
			return;
		}
		this._setChildIndex(child,this.getPrivateIndexForPublicIndex(index));
		HxOverrides.remove(this.items,child);
		this.items.splice(index,0,child);
		if(this._ignoreChangesButSetFlags) {
			this.setInvalidationFlag(feathers_core_InvalidationFlag.LAYOUT);
		} else {
			this.setInvalid(feathers_core_InvalidationFlag.LAYOUT);
		}
	}
	,_setChildIndex: function(child,index) {
		feathers_core_FeathersControl.prototype.setChildIndex.call(this,child,index);
	}
	,getChildAt: function(index) {
		return this.items[index];
	}
	,_getChildAt: function(index) {
		return feathers_core_FeathersControl.prototype.getChildAt.call(this,index);
	}
	,readjustLayout: function() {
		this.setInvalid(feathers_core_InvalidationFlag.LAYOUT);
	}
	,initializeLayoutGroupTheme: function() {
		feathers_themes_steel_components_SteelLayoutGroupStyles.initialize();
	}
	,getPrivateIndexForPublicIndex: function(publicIndex) {
		if(this.items.length > 0) {
			return publicIndex + this._getChildIndex(this.items[0]);
		} else if(this.get__numChildren() > 0) {
			return publicIndex + this.get__numChildren();
		}
		return publicIndex;
	}
	,_xmlContent: null
	,get_xmlContent: function() {
		return this._xmlContent;
	}
	,set_xmlContent: function(value) {
		if(this._xmlContent == value) {
			return this._xmlContent;
		}
		if(this._xmlContent != null) {
			var _g = 0;
			var _g1 = this._xmlContent;
			while(_g < _g1.length) {
				var child = _g1[_g];
				++_g;
				this.removeChild(child);
			}
		}
		this._xmlContent = value;
		if(this._xmlContent != null) {
			var _g = 0;
			var _g1 = this._xmlContent;
			while(_g < _g1.length) {
				var child = _g1[_g];
				++_g;
				this.addChild(child);
			}
		}
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this._xmlContent;
	}
	,_layoutActive: null
	,_layoutChanged: null
	,collectChildren: function(result) {
		if(result == null) {
			return this.items.slice();
		}
		var _g = 0;
		var _g1 = this.items;
		while(_g < _g1.length) {
			var item = _g1[_g];
			++_g;
			result.push(item);
		}
		return result;
	}
	,validateNow: function() {
		var oldIgnoreChildChanges = this._ignoreChangesButSetFlags;
		this._ignoreChangesButSetFlags = true;
		feathers_core_FeathersControl.prototype.validateNow.call(this);
		this._ignoreChangesButSetFlags = oldIgnoreChildChanges;
	}
	,update: function() {
		var _gthis = this;
		this._ignoreChangesButSetFlags = false;
		var layoutInvalid = this.isInvalid(feathers_core_InvalidationFlag.LAYOUT);
		var sizeInvalid = this.isInvalid(feathers_core_InvalidationFlag.SIZE);
		var stylesInvalid = this.isInvalid(feathers_core_InvalidationFlag.STYLES);
		var stateInvalid = this.isInvalid(feathers_core_InvalidationFlag.STATE);
		if(stylesInvalid || stateInvalid) {
			this.refreshBackgroundSkin();
		}
		if(stylesInvalid) {
			this.refreshMaskSkin();
			this.refreshLayout();
		}
		if(sizeInvalid || layoutInvalid || stylesInvalid || stateInvalid) {
			this.refreshViewPortBounds();
			this.runWithInvalidationFlagsOnly(function() {
				_gthis._layoutActive = true;
				var loopCount = 0;
				do {
					_gthis._layoutChanged = false;
					_gthis.handleLayout();
					++loopCount;
					if(loopCount >= 10) {
						_gthis._layoutActive = false;
						var c = js_Boot.getClass(_gthis);
						var className = c.__name__;
						var layoutClassName;
						if(_gthis.get_layout() != null) {
							var c1 = js_Boot.getClass(_gthis.get_layout());
							layoutClassName = c1.__name__;
						} else {
							layoutClassName = "The layout";
						}
						throw new openfl_errors_IllegalOperationError("" + className + " is stuck in an infinite loop during layout. " + layoutClassName + " may be dispatching Event.CHANGE too frequently.");
					}
				} while(_gthis._layoutChanged);
				_gthis._layoutActive = false;
			});
			this.refreshBackgroundLayout();
			this.refreshDisabledOverlay();
			this.refreshMaskLayout();
			this.validateChildren();
		}
	}
	,refreshDisabledOverlay: function() {
		if(!this._enabled) {
			if(this._disabledOverlay == null) {
				this._disabledOverlay = new openfl_display_Sprite();
				this._disabledOverlay.get_graphics().beginFill(16711935,0.0);
				this._disabledOverlay.get_graphics().drawRect(0.0,0.0,1.0,1.0);
				this._disabledOverlay.get_graphics().endFill();
				this._addChild(this._disabledOverlay);
			} else {
				this._setChildIndex(this._disabledOverlay,this.get__numChildren() - 1);
			}
		}
		if(this._disabledOverlay != null) {
			this._disabledOverlay.set_visible(!this._enabled);
			this._disabledOverlay.set_x(0.0);
			this._disabledOverlay.set_y(0.0);
			this._disabledOverlay.set_width(this.actualWidth);
			this._disabledOverlay.set_height(this.actualHeight);
		}
	}
	,refreshLayout: function() {
		var newLayout = this.get_layout();
		if(this._currentLayout == newLayout) {
			return;
		}
		if(this._currentLayout != null) {
			this._currentLayout.removeEventListener("change",$bind(this,this.layoutGroup_layout_changeHandler));
		}
		this._currentLayout = newLayout;
		if(this._currentLayout != null) {
			this._currentLayout.addEventListener("change",$bind(this,this.layoutGroup_layout_changeHandler));
		}
	}
	,refreshBackgroundSkin: function() {
		var oldSkin = this._currentBackgroundSkin;
		this._currentBackgroundSkin = this.getCurrentBackgroundSkin();
		if(this._currentBackgroundSkin == oldSkin) {
			return;
		}
		this.removeCurrentBackgroundSkin(oldSkin);
		this.addCurrentBackgroundSkin(this._currentBackgroundSkin);
	}
	,getCurrentBackgroundSkin: function() {
		if(!this._enabled && this.get_disabledBackgroundSkin() != null) {
			return this.get_disabledBackgroundSkin();
		}
		return this.get_backgroundSkin();
	}
	,addCurrentBackgroundSkin: function(skin) {
		if(skin == null) {
			this._backgroundSkinMeasurements = null;
			return;
		}
		if(js_Boot.__implements(skin,feathers_core_IUIControl)) {
			skin.initializeNow();
		}
		if(this._backgroundSkinMeasurements == null) {
			this._backgroundSkinMeasurements = new feathers_layout_Measurements(skin);
		} else {
			this._backgroundSkinMeasurements.save(skin);
		}
		if(js_Boot.__implements(skin,feathers_skins_IProgrammaticSkin)) {
			skin.set_uiContext(this);
		}
		this._addChildAt(skin,0);
	}
	,removeCurrentBackgroundSkin: function(skin) {
		if(skin == null) {
			return;
		}
		if(js_Boot.__implements(skin,feathers_skins_IProgrammaticSkin)) {
			skin.set_uiContext(null);
		}
		this._backgroundSkinMeasurements.restore(skin);
		if(skin.parent == this) {
			this._removeChild(skin);
		}
	}
	,refreshMaskSkin: function() {
		var oldSkin = this._currentMaskSkin;
		this._currentMaskSkin = this.getCurrentMaskSkin();
		if(this._currentMaskSkin == oldSkin) {
			return;
		}
		this.removeCurrentMaskSkin(oldSkin);
		this.addCurrentMaskSkin(this._currentMaskSkin);
	}
	,getCurrentMaskSkin: function() {
		return this.get_maskSkin();
	}
	,addCurrentMaskSkin: function(skin) {
		if(skin == null) {
			return;
		}
		if(js_Boot.__implements(skin,feathers_core_IUIControl)) {
			skin.initializeNow();
		}
		if(js_Boot.__implements(skin,feathers_skins_IProgrammaticSkin)) {
			skin.set_uiContext(this);
		}
		this._addChild(skin);
		this.set_mask(skin);
	}
	,removeCurrentMaskSkin: function(skin) {
		if(skin == null) {
			return;
		}
		if(js_Boot.__implements(skin,feathers_skins_IProgrammaticSkin)) {
			skin.set_uiContext(null);
		}
		if(skin.parent == this) {
			this._removeChild(skin);
		}
		this.set_mask(null);
	}
	,refreshViewPortBounds: function() {
		var needsWidth = this.get_explicitWidth() == null;
		var needsHeight = this.get_explicitHeight() == null;
		var needsMinWidth = this.get_explicitMinWidth() == null;
		var needsMinHeight = this.get_explicitMinHeight() == null;
		var needsMaxWidth = this.get_explicitMaxWidth() == null;
		var needsMaxHeight = this.get_explicitMaxHeight() == null;
		if(this._currentBackgroundSkin != null) {
			feathers_utils_MeasurementsUtil.resetFluidlyWithParent(this._backgroundSkinMeasurements,this._currentBackgroundSkin,this);
			if(js_Boot.__implements(this._currentBackgroundSkin,feathers_core_IValidating)) {
				this._currentBackgroundSkin.validateNow();
			}
		}
		var needsToMeasureContent = this._autoSizeMode == feathers_layout_AutoSizeMode.CONTENT || this.stage == null;
		var stageWidth = 0.0;
		var stageHeight = 0.0;
		if(!needsToMeasureContent) {
			var topLeft = this.globalToLocal(new openfl_geom_Point());
			var bottomRight = this.globalToLocal(new openfl_geom_Point(this.stage.stageWidth,this.stage.stageHeight));
			stageWidth = bottomRight.x - topLeft.x;
			stageHeight = bottomRight.y - topLeft.y;
		}
		if(needsWidth && !needsToMeasureContent) {
			this._layoutMeasurements.width = stageWidth;
		} else {
			this._layoutMeasurements.width = this.get_explicitWidth();
		}
		if(needsHeight && !needsToMeasureContent) {
			this._layoutMeasurements.height = stageHeight;
		} else {
			this._layoutMeasurements.height = this.get_explicitHeight();
		}
		var viewPortMinWidth = this.get_explicitMinWidth();
		if(needsMinWidth) {
			viewPortMinWidth = 0.0;
		}
		var viewPortMinHeight = this.get_explicitMinHeight();
		if(needsMinHeight) {
			viewPortMinHeight = 0.0;
		}
		var viewPortMaxWidth = this.get_explicitMaxWidth();
		if(needsMaxWidth) {
			viewPortMaxWidth = 1.0 / 0.0;
		}
		var viewPortMaxHeight = this.get_explicitMaxHeight();
		if(needsMaxHeight) {
			viewPortMaxHeight = 1.0 / 0.0;
		}
		if(this._backgroundSkinMeasurements != null) {
			if(this._backgroundSkinMeasurements.width != null) {
				if(this._backgroundSkinMeasurements.width > viewPortMinWidth) {
					viewPortMinWidth = this._backgroundSkinMeasurements.width;
				}
			} else if(this._backgroundSkinMeasurements.minWidth != null) {
				if(this._backgroundSkinMeasurements.minWidth > viewPortMinWidth) {
					viewPortMinWidth = this._backgroundSkinMeasurements.minWidth;
				}
			}
			if(this._backgroundSkinMeasurements.height != null) {
				if(this._backgroundSkinMeasurements.height > viewPortMinHeight) {
					viewPortMinHeight = this._backgroundSkinMeasurements.height;
				}
			} else if(this._backgroundSkinMeasurements.minHeight != null) {
				if(this._backgroundSkinMeasurements.minHeight > viewPortMinHeight) {
					viewPortMinHeight = this._backgroundSkinMeasurements.minHeight;
				}
			}
		}
		this._layoutMeasurements.minWidth = viewPortMinWidth;
		this._layoutMeasurements.minHeight = viewPortMinHeight;
		this._layoutMeasurements.maxWidth = viewPortMaxWidth;
		this._layoutMeasurements.maxHeight = viewPortMaxHeight;
	}
	,handleLayout: function() {
		if(this._currentLayout != null) {
			this.handleCustomLayout();
		} else {
			this.handleManualLayout();
		}
		this.handleLayoutResult();
	}
	,handleCustomLayout: function() {
		var oldIgnoreChildChanges = this._ignoreChildChanges;
		this._ignoreChildChanges = true;
		this._layoutResult.reset();
		this._currentLayout.layout(this.items,this._layoutMeasurements,this._layoutResult);
		this._ignoreChildChanges = oldIgnoreChildChanges;
	}
	,handleManualLayout: function() {
		var maxX = this._layoutMeasurements.width;
		if(maxX == null) {
			maxX = 0.0;
		}
		var maxY = this._layoutMeasurements.height;
		if(maxY == null) {
			maxY = 0.0;
		}
		var oldIgnoreChildChanges = this._ignoreChildChanges;
		this._ignoreChildChanges = true;
		var _g = 0;
		var _g1 = this.items;
		while(_g < _g1.length) {
			var item = _g1[_g];
			++_g;
			if(js_Boot.__implements(item,feathers_layout_ILayoutObject) && !item.get_includeInLayout()) {
				continue;
			}
			if(js_Boot.__implements(item,feathers_core_IValidating)) {
				item.validateNow();
			}
			var itemMaxX = item.get_x() + item.get_width();
			var itemMaxY = item.get_y() + item.get_height();
			if(maxX < itemMaxX) {
				maxX = itemMaxX;
			}
			if(maxY < itemMaxY) {
				maxY = itemMaxY;
			}
		}
		this._ignoreChildChanges = oldIgnoreChildChanges;
		this._layoutResult.contentX = 0.0;
		this._layoutResult.contentY = 0.0;
		this._layoutResult.contentWidth = maxX;
		this._layoutResult.contentHeight = maxY;
		if(this._layoutMeasurements.width != null) {
			this._layoutResult.viewPortWidth = this._layoutMeasurements.width;
		} else {
			if(this._layoutMeasurements.minWidth != null && maxX < this._layoutMeasurements.minWidth) {
				maxX = this._layoutMeasurements.minWidth;
			} else if(this._layoutMeasurements.maxWidth != null && maxX > this._layoutMeasurements.maxWidth) {
				maxX = this._layoutMeasurements.maxWidth;
			}
			this._layoutResult.viewPortWidth = maxX;
		}
		if(this._layoutMeasurements.height != null) {
			this._layoutResult.viewPortHeight = this._layoutMeasurements.height;
		} else {
			if(this._layoutMeasurements.minHeight != null && maxY < this._layoutMeasurements.minHeight) {
				maxY = this._layoutMeasurements.minHeight;
			} else if(this._layoutMeasurements.maxHeight != null && maxY > this._layoutMeasurements.maxHeight) {
				maxY = this._layoutMeasurements.maxHeight;
			}
			this._layoutResult.viewPortHeight = maxY;
		}
	}
	,handleLayoutResult: function() {
		var viewPortWidth = this._layoutResult.viewPortWidth;
		var viewPortHeight = this._layoutResult.viewPortHeight;
		this.saveMeasurements(viewPortWidth,viewPortHeight,viewPortWidth,viewPortHeight);
	}
	,refreshMaskLayout: function() {
		if(this._currentMaskSkin == null) {
			return;
		}
		this._currentMaskSkin.set_x(0.0);
		this._currentMaskSkin.set_y(0.0);
		this._currentMaskSkin.set_width(this.actualWidth);
		this._currentMaskSkin.set_height(this.actualHeight);
		if(js_Boot.__implements(this._currentMaskSkin,feathers_core_IValidating)) {
			this._currentMaskSkin.validateNow();
		}
	}
	,refreshBackgroundLayout: function() {
		if(this._currentBackgroundSkin == null) {
			return;
		}
		this._currentBackgroundSkin.set_x(0.0);
		this._currentBackgroundSkin.set_y(0.0);
		if(this._currentBackgroundSkin.get_width() != this.actualWidth) {
			this._currentBackgroundSkin.set_width(this.actualWidth);
		}
		if(this._currentBackgroundSkin.get_height() != this.actualHeight) {
			this._currentBackgroundSkin.set_height(this.actualHeight);
		}
		if(js_Boot.__implements(this._currentBackgroundSkin,feathers_core_IValidating)) {
			this._currentBackgroundSkin.validateNow();
		}
	}
	,validateChildren: function() {
		if(js_Boot.__implements(this._currentBackgroundSkin,feathers_core_IValidating)) {
			this._currentBackgroundSkin.validateNow();
		}
		var _g = 0;
		var _g1 = this.items;
		while(_g < _g1.length) {
			var item = _g1[_g];
			++_g;
			if(js_Boot.__implements(item,feathers_core_IValidating)) {
				item.validateNow();
			}
		}
	}
	,layoutGroup_addedToStageHandler: function(event) {
		if(this._autoSizeMode == feathers_layout_AutoSizeMode.STAGE) {
			this.setInvalid(feathers_core_InvalidationFlag.SIZE);
			this.addEventListener("removedFromStage",$bind(this,this.layoutGroup_removedFromStageHandler));
			this.stage.addEventListener("resize",$bind(this,this.layoutGroup_stage_resizeHandler),false,0,true);
		}
	}
	,layoutGroup_removedFromStageHandler: function(event) {
		this.removeEventListener("removedFromStage",$bind(this,this.layoutGroup_removedFromStageHandler));
		this.stage.removeEventListener("resize",$bind(this,this.layoutGroup_stage_resizeHandler));
	}
	,layoutGroup_stage_resizeHandler: function(event) {
		this.setInvalid(feathers_core_InvalidationFlag.SIZE);
	}
	,layoutGroup_child_resizeHandler: function(event) {
		if(this._ignoreChildChanges) {
			return;
		}
		if(this._ignoreChangesButSetFlags) {
			this.setInvalidationFlag(feathers_core_InvalidationFlag.LAYOUT);
			return;
		}
		this.setInvalid(feathers_core_InvalidationFlag.LAYOUT);
	}
	,layoutGroup_child_layoutDataChangeHandler: function(event) {
		if(this._ignoreChildChanges) {
			return;
		}
		if(this._ignoreChangesButSetFlags) {
			this.setInvalidationFlag(feathers_core_InvalidationFlag.LAYOUT);
			return;
		}
		this.setInvalid(feathers_core_InvalidationFlag.LAYOUT);
	}
	,layoutGroup_layout_changeHandler: function(event) {
		if(this._ignoreLayoutChanges) {
			return;
		}
		if(this._layoutActive) {
			this._layoutChanged = true;
			return;
		}
		if(this._ignoreChangesButSetFlags) {
			this.setInvalidationFlag(feathers_core_InvalidationFlag.LAYOUT);
			return;
		}
		this.setInvalid(feathers_core_InvalidationFlag.LAYOUT);
	}
	,__layout: null
	,get_layout: function() {
		return this.__layout;
	}
	,set_layout: function(value) {
		if(!this.setStyle("layout")) {
			return this.__layout;
		}
		if(this.__layout == value) {
			return this.__layout;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_layout);
		this.__layout = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__layout;
	}
	,clearStyle_layout: function() {
		this.set_layout(null);
		return this.get_layout();
	}
	,__backgroundSkin: null
	,get_backgroundSkin: function() {
		return this.__backgroundSkin;
	}
	,set_backgroundSkin: function(value) {
		if(!this.setStyle("backgroundSkin")) {
			return this.__backgroundSkin;
		}
		if(this.__backgroundSkin == value) {
			return this.__backgroundSkin;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_backgroundSkin);
		this.__backgroundSkin = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__backgroundSkin;
	}
	,clearStyle_backgroundSkin: function() {
		this.set_backgroundSkin(null);
		return this.get_backgroundSkin();
	}
	,__disabledBackgroundSkin: null
	,get_disabledBackgroundSkin: function() {
		return this.__disabledBackgroundSkin;
	}
	,set_disabledBackgroundSkin: function(value) {
		if(!this.setStyle("disabledBackgroundSkin")) {
			return this.__disabledBackgroundSkin;
		}
		if(this.__disabledBackgroundSkin == value) {
			return this.__disabledBackgroundSkin;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_disabledBackgroundSkin);
		this.__disabledBackgroundSkin = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__disabledBackgroundSkin;
	}
	,clearStyle_disabledBackgroundSkin: function() {
		this.set_disabledBackgroundSkin(null);
		return this.get_disabledBackgroundSkin();
	}
	,__maskSkin: null
	,get_maskSkin: function() {
		return this.__maskSkin;
	}
	,set_maskSkin: function(value) {
		if(!this.setStyle("maskSkin")) {
			return this.__maskSkin;
		}
		if(this.__maskSkin == value) {
			return this.__maskSkin;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_maskSkin);
		this.__maskSkin = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__maskSkin;
	}
	,clearStyle_maskSkin: function() {
		this.set_maskSkin(null);
		return this.get_maskSkin();
	}
	,get_styleContext: function() {
		return feathers_controls_LayoutGroup;
	}
	,__class__: feathers_controls_LayoutGroup
	,__properties__: $extend(feathers_core_FeathersControl.prototype.__properties__,{set_xmlContent:"set_xmlContent",get_xmlContent:"get_xmlContent",get__numChildren:"get__numChildren",set_autoSizeMode:"set_autoSizeMode",get_autoSizeMode:"get_autoSizeMode",set_maskSkin:"set_maskSkin",get_maskSkin:"get_maskSkin",set_disabledBackgroundSkin:"set_disabledBackgroundSkin",get_disabledBackgroundSkin:"get_disabledBackgroundSkin",set_backgroundSkin:"set_backgroundSkin",get_backgroundSkin:"get_backgroundSkin",set_layout:"set_layout",get_layout:"get_layout"})
});
var feathers_core_IFocusManagerAware = function() { };
$hxClasses["feathers.core.IFocusManagerAware"] = feathers_core_IFocusManagerAware;
feathers_core_IFocusManagerAware.__name__ = "feathers.core.IFocusManagerAware";
feathers_core_IFocusManagerAware.__isInterface__ = true;
feathers_core_IFocusManagerAware.prototype = {
	get_focusManager: null
	,set_focusManager: null
	,__class__: feathers_core_IFocusManagerAware
	,__properties__: {set_focusManager:"set_focusManager",get_focusManager:"get_focusManager"}
};
var feathers_controls_Application = function() {
	this.__scaleManager = null;
	this._scaleFactor = 1.0;
	if(feathers_controls_Application._topLevelApplication == null) {
		feathers_controls_Application._topLevelApplication = this;
	}
	this.initializeApplicationTheme();
	feathers_controls_LayoutGroup.call(this);
	this.addEventListener("addedToStage",$bind(this,this.application_addedToStageHandler),false,100);
};
$hxClasses["feathers.controls.Application"] = feathers_controls_Application;
feathers_controls_Application.__name__ = "feathers.controls.Application";
feathers_controls_Application.__interfaces__ = [feathers_core_IFocusManagerAware];
feathers_controls_Application.__properties__ = {get_topLevelApplication:"get_topLevelApplication"};
feathers_controls_Application.get_topLevelApplication = function() {
	return feathers_controls_Application._topLevelApplication;
};
feathers_controls_Application.defaultPopUpContainerFactory = function() {
	return new openfl_display_Sprite();
};
feathers_controls_Application.__super__ = feathers_controls_LayoutGroup;
feathers_controls_Application.prototype = $extend(feathers_controls_LayoutGroup.prototype,{
	_scaleFactor: null
	,get_scaleFactor: function() {
		return this._scaleFactor;
	}
	,_currentScaleManager: null
	,popUpContainerFactory: null
	,_applicationPopUpContainer: null
	,_applicationFocusManager: null
	,_applicationToolTipManager: null
	,initializeApplicationTheme: function() {
		feathers_themes_steel_components_SteelApplicationStyles.initialize();
	}
	,update: function() {
		var sizeInvalid = this.isInvalid(feathers_core_InvalidationFlag.SIZE);
		var stylesInvalid = this.isInvalid(feathers_core_InvalidationFlag.STYLES);
		if(sizeInvalid || stylesInvalid) {
			this.refreshScaleManager();
		}
		feathers_controls_LayoutGroup.prototype.update.call(this);
	}
	,refreshScaleManager: function() {
		var _gthis = this;
		var oldScaleManager = this._currentScaleManager;
		this._currentScaleManager = this.get_scaleManager();
		if(this._currentScaleManager == oldScaleManager) {
			return;
		}
		if(oldScaleManager != null) {
			oldScaleManager.removeEventListener("change",$bind(this,this.application_scaleManager_changeHandler));
			oldScaleManager.set_target(null);
		}
		if(this._currentScaleManager != null) {
			this._currentScaleManager.addEventListener("change",$bind(this,this.application_scaleManager_changeHandler),false,0,true);
			this.runWithInvalidationFlagsOnly(function() {
				_gthis._currentScaleManager.set_target(_gthis);
			});
		}
	}
	,refreshDimensions: function() {
		if(this._currentScaleManager == null) {
			return;
		}
		this._scaleFactor = this._currentScaleManager.getScale();
		this.set_scaleX(this._scaleFactor);
		this.set_scaleY(this._scaleFactor);
		var bounds = this._currentScaleManager.getBounds();
		this.set_x(bounds.x);
		this.set_y(bounds.y);
		this.set_width(bounds.width);
		this.set_height(bounds.height);
		if(this._applicationPopUpContainer != null) {
			this._applicationPopUpContainer.set_scaleX(this._scaleFactor);
			this._applicationPopUpContainer.set_scaleY(this._scaleFactor);
		}
	}
	,preparePopUpManager: function() {
		if(this._applicationPopUpContainer == null) {
			var factory = this.popUpContainerFactory;
			if(factory == null) {
				factory = feathers_controls_Application.defaultPopUpContainerFactory;
			}
			this._applicationPopUpContainer = factory();
		}
		this._applicationPopUpContainer.set_scaleX(this._scaleFactor);
		this._applicationPopUpContainer.set_scaleY(this._scaleFactor);
		this.stage.addChild(this._applicationPopUpContainer);
		var popUpManager = feathers_core_PopUpManager.forStage(this.stage);
		popUpManager.set_root(this._applicationPopUpContainer);
	}
	,cleanupPopUpManager: function() {
		var popUpManager = feathers_core_PopUpManager.forStage(this.stage);
		if(popUpManager.get_root() == this._applicationPopUpContainer) {
			popUpManager.set_root(this.stage);
		}
		this.stage.removeChild(this._applicationPopUpContainer);
		this._applicationPopUpContainer = null;
	}
	,prepareFocusManager: function() {
		if(!feathers_core_FocusManager.hasRoot(this.stage)) {
			this._applicationFocusManager = feathers_core_FocusManager.addRoot(this.stage);
		}
	}
	,cleanupFocusManager: function() {
		if(this._applicationFocusManager != null) {
			this._applicationFocusManager = null;
			feathers_core_FocusManager.removeRoot(this.stage);
		}
	}
	,prepareToolTipManager: function() {
		if(!feathers_core_ToolTipManager.hasRoot(this.stage)) {
			this._applicationToolTipManager = feathers_core_ToolTipManager.addRoot(this.stage);
		}
	}
	,cleanupToolTipManager: function() {
		if(this._applicationToolTipManager != null) {
			this._applicationToolTipManager = null;
			feathers_core_ToolTipManager.removeRoot(this.stage);
		}
	}
	,application_addedToStageHandler: function(event) {
		this.addEventListener("removedFromStage",$bind(this,this.application_removedFromStageHandler));
		this.prepareFocusManager();
		this.preparePopUpManager();
		this.prepareToolTipManager();
	}
	,application_removedFromStageHandler: function(event) {
		this.removeEventListener("removedFromStage",$bind(this,this.application_removedFromStageHandler));
		this.cleanupToolTipManager();
		this.cleanupPopUpManager();
		this.cleanupFocusManager();
	}
	,application_scaleManager_changeHandler: function(event) {
		this.refreshDimensions();
	}
	,get_styleContext: function() {
		return feathers_controls_Application;
	}
	,__scaleManager: null
	,get_scaleManager: function() {
		return this.__scaleManager;
	}
	,set_scaleManager: function(value) {
		if(!this.setStyle("scaleManager")) {
			return this.__scaleManager;
		}
		if(this.__scaleManager == value) {
			return this.__scaleManager;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_scaleManager);
		this.__scaleManager = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__scaleManager;
	}
	,clearStyle_scaleManager: function() {
		this.set_scaleManager(null);
		return this.get_scaleManager();
	}
	,__class__: feathers_controls_Application
	,__properties__: $extend(feathers_controls_LayoutGroup.prototype.__properties__,{set_scaleManager:"set_scaleManager",get_scaleManager:"get_scaleManager",get_scaleFactor:"get_scaleFactor"})
});
var Main = function() {
	var theme = js_Boot.__cast(feathers_style_Theme.get_fallbackTheme() , feathers_style_IDarkModeTheme);
	theme.set_darkMode(true);
	feathers_controls_Application.call(this);
	this.set_layout(new feathers_layout_AnchorLayout());
	Main.mode = "player";
	Main.movie = "";
	Main.scene = "";
	var o = this.get_loaderInfo().parameters;
	if(Object.prototype.hasOwnProperty.call(o,"mode")) {
		if(Reflect.field(this.get_loaderInfo().parameters,"mode") == "editor") {
			Main.mode = "editor";
		}
	}
	var o = this.get_loaderInfo().parameters;
	if(Object.prototype.hasOwnProperty.call(o,"movie")) {
		Main.movie = Reflect.field(this.get_loaderInfo().parameters,"movie");
		var o = this.get_loaderInfo().parameters;
		if(Object.prototype.hasOwnProperty.call(o,"scene")) {
			Main.scene = Reflect.field(this.get_loaderInfo().parameters,"scene");
		}
	}
	var o = this.get_loaderInfo().parameters;
	if(Object.prototype.hasOwnProperty.call(o,"decrypt")) {
		com_tilbuci_data_DataLoader.customDecrypt = Reflect.field(this.get_loaderInfo().parameters,"decrypt");
	}
	var tmp;
	var o = this.get_loaderInfo().parameters;
	if(Object.prototype.hasOwnProperty.call(o,"us")) {
		var o = this.get_loaderInfo().parameters;
		tmp = Object.prototype.hasOwnProperty.call(o,"uk");
	} else {
		tmp = false;
	}
	if(tmp) {
		Main.us = Reflect.field(this.get_loaderInfo().parameters,"us");
		Main.uk = Reflect.field(this.get_loaderInfo().parameters,"uk");
	} else {
		Main.us = Main.uk = "";
	}
	if(this.stage == null) {
		this.addEventListener("addedToStage",$bind(this,this.onStage));
	} else {
		this.onStage();
	}
};
$hxClasses["Main"] = Main;
Main.__name__ = "Main";
Main.__super__ = feathers_controls_Application;
Main.prototype = $extend(feathers_controls_Application.prototype,{
	_player: null
	,_editor: null
	,onStage: function(evt) {
		if(this.hasEventListener("addedToStage")) {
			this.removeEventListener("addedToStage",$bind(this,this.onStage));
		}
		if(Main.mode == "editor") {
			this._editor = new com_tilbuci_Editor("editor.json");
			this._editor.registerPlugin(new plugins_DebugPlugin());
			this._editor.registerPlugin(new plugins_SharePlugin());
			this._editor.registerPlugin(new plugins_GoogleAnalyticsPlugin());
			this._editor.registerPlugin(new plugins_ServerCallPlugin());
			this._editor.registerPlugin(new plugins_OverlayPlugin());
			this.addChild(this._editor);
		} else {
			this.stage.set_scaleMode(2);
			Main.mode = "player";
			this._player = new com_tilbuci_Player("player.json","player","landscape");
			this._player.registerPlugin(new plugins_DebugPlugin());
			this._player.registerPlugin(new plugins_SharePlugin());
			this._player.registerPlugin(new plugins_GoogleAnalyticsPlugin());
			this._player.registerPlugin(new plugins_ServerCallPlugin());
			this._player.registerPlugin(new plugins_OverlayPlugin());
			this._player.setSize(this.stage.stageWidth,this.stage.stageHeight);
			this.stage.addChild(this._player);
			this.stage.addEventListener("resize",$bind(this,this.onStageResize));
		}
		this.debug();
	}
	,onStageResize: function(evt) {
		this._player.setSize(this.stage.stageWidth,this.stage.stageHeight);
	}
	,debug: function() {
	}
	,__class__: Main
});
var DocumentClass = function(current) {
	current.addChild(this);
	Main.call(this);
	this.dispatchEvent(new openfl_events_Event("addedToStage",false,false));
};
$hxClasses["DocumentClass"] = DocumentClass;
DocumentClass.__name__ = "DocumentClass";
DocumentClass.__super__ = Main;
DocumentClass.prototype = $extend(Main.prototype,{
	__class__: DocumentClass
});
var DateTools = function() { };
$hxClasses["DateTools"] = DateTools;
DateTools.__name__ = "DateTools";
DateTools.__format_get = function(d,e) {
	switch(e) {
	case "%":
		return "%";
	case "A":
		return DateTools.DAY_NAMES[d.getDay()];
	case "B":
		return DateTools.MONTH_NAMES[d.getMonth()];
	case "C":
		return StringTools.lpad(Std.string(d.getFullYear() / 100 | 0),"0",2);
	case "D":
		return DateTools.__format(d,"%m/%d/%y");
	case "F":
		return DateTools.__format(d,"%Y-%m-%d");
	case "M":
		return StringTools.lpad(Std.string(d.getMinutes()),"0",2);
	case "R":
		return DateTools.__format(d,"%H:%M");
	case "S":
		return StringTools.lpad(Std.string(d.getSeconds()),"0",2);
	case "T":
		return DateTools.__format(d,"%H:%M:%S");
	case "Y":
		return Std.string(d.getFullYear());
	case "a":
		return DateTools.DAY_SHORT_NAMES[d.getDay()];
	case "d":
		return StringTools.lpad(Std.string(d.getDate()),"0",2);
	case "e":
		return Std.string(d.getDate());
	case "b":case "h":
		return DateTools.MONTH_SHORT_NAMES[d.getMonth()];
	case "H":case "k":
		return StringTools.lpad(Std.string(d.getHours()),e == "H" ? "0" : " ",2);
	case "I":case "l":
		var hour = d.getHours() % 12;
		return StringTools.lpad(Std.string(hour == 0 ? 12 : hour),e == "I" ? "0" : " ",2);
	case "m":
		return StringTools.lpad(Std.string(d.getMonth() + 1),"0",2);
	case "n":
		return "\n";
	case "p":
		if(d.getHours() > 11) {
			return "PM";
		} else {
			return "AM";
		}
		break;
	case "r":
		return DateTools.__format(d,"%I:%M:%S %p");
	case "s":
		return Std.string(d.getTime() / 1000 | 0);
	case "t":
		return "\t";
	case "u":
		var t = d.getDay();
		if(t == 0) {
			return "7";
		} else if(t == null) {
			return "null";
		} else {
			return "" + t;
		}
		break;
	case "w":
		return Std.string(d.getDay());
	case "y":
		return StringTools.lpad(Std.string(d.getFullYear() % 100),"0",2);
	default:
		throw new haxe_exceptions_NotImplementedException("Date.format %" + e + "- not implemented yet.",null,{ fileName : "DateTools.hx", lineNumber : 101, className : "DateTools", methodName : "__format_get"});
	}
};
DateTools.__format = function(d,f) {
	var r_b = "";
	var p = 0;
	while(true) {
		var np = f.indexOf("%",p);
		if(np < 0) {
			break;
		}
		var len = np - p;
		r_b += len == null ? HxOverrides.substr(f,p,null) : HxOverrides.substr(f,p,len);
		r_b += Std.string(DateTools.__format_get(d,HxOverrides.substr(f,np + 1,1)));
		p = np + 2;
	}
	var len = f.length - p;
	r_b += len == null ? HxOverrides.substr(f,p,null) : HxOverrides.substr(f,p,len);
	return r_b;
};
DateTools.format = function(d,f) {
	return DateTools.__format(d,f);
};
var EReg = function(r,opt) {
	this.r = new RegExp(r,opt.split("u").join(""));
};
$hxClasses["EReg"] = EReg;
EReg.__name__ = "EReg";
EReg.prototype = {
	r: null
	,match: function(s) {
		if(this.r.global) {
			this.r.lastIndex = 0;
		}
		this.r.m = this.r.exec(s);
		this.r.s = s;
		return this.r.m != null;
	}
	,matched: function(n) {
		if(this.r.m != null && n >= 0 && n < this.r.m.length) {
			return this.r.m[n];
		} else {
			throw haxe_Exception.thrown("EReg::matched");
		}
	}
	,matchedRight: function() {
		if(this.r.m == null) {
			throw haxe_Exception.thrown("No string matched");
		}
		var sz = this.r.m.index + this.r.m[0].length;
		return HxOverrides.substr(this.r.s,sz,this.r.s.length - sz);
	}
	,matchedPos: function() {
		if(this.r.m == null) {
			throw haxe_Exception.thrown("No string matched");
		}
		return { pos : this.r.m.index, len : this.r.m[0].length};
	}
	,matchSub: function(s,pos,len) {
		if(len == null) {
			len = -1;
		}
		if(this.r.global) {
			this.r.lastIndex = pos;
			this.r.m = this.r.exec(len < 0 ? s : HxOverrides.substr(s,0,pos + len));
			var b = this.r.m != null;
			if(b) {
				this.r.s = s;
			}
			return b;
		} else {
			var b = this.match(len < 0 ? HxOverrides.substr(s,pos,null) : HxOverrides.substr(s,pos,len));
			if(b) {
				this.r.s = s;
				this.r.m.index += pos;
			}
			return b;
		}
	}
	,split: function(s) {
		var d = "#__delim__#";
		return s.replace(this.r,d).split(d);
	}
	,map: function(s,f) {
		var offset = 0;
		var buf_b = "";
		do {
			if(offset >= s.length) {
				break;
			} else if(!this.matchSub(s,offset)) {
				buf_b += Std.string(HxOverrides.substr(s,offset,null));
				break;
			}
			var p = this.matchedPos();
			buf_b += Std.string(HxOverrides.substr(s,offset,p.pos - offset));
			buf_b += Std.string(f(this));
			if(p.len == 0) {
				buf_b += Std.string(HxOverrides.substr(s,p.pos,1));
				offset = p.pos + 1;
			} else {
				offset = p.pos + p.len;
			}
		} while(this.r.global);
		if(!this.r.global && offset > 0 && offset < s.length) {
			buf_b += Std.string(HxOverrides.substr(s,offset,null));
		}
		return buf_b;
	}
	,__class__: EReg
};
var HxOverrides = function() { };
$hxClasses["HxOverrides"] = HxOverrides;
HxOverrides.__name__ = "HxOverrides";
HxOverrides.dateStr = function(date) {
	var m = date.getMonth() + 1;
	var d = date.getDate();
	var h = date.getHours();
	var mi = date.getMinutes();
	var s = date.getSeconds();
	return date.getFullYear() + "-" + (m < 10 ? "0" + m : "" + m) + "-" + (d < 10 ? "0" + d : "" + d) + " " + (h < 10 ? "0" + h : "" + h) + ":" + (mi < 10 ? "0" + mi : "" + mi) + ":" + (s < 10 ? "0" + s : "" + s);
};
HxOverrides.strDate = function(s) {
	switch(s.length) {
	case 8:
		var k = s.split(":");
		var d = new Date();
		d["setTime"](0);
		d["setUTCHours"](k[0]);
		d["setUTCMinutes"](k[1]);
		d["setUTCSeconds"](k[2]);
		return d;
	case 10:
		var k = s.split("-");
		return new Date(k[0],k[1] - 1,k[2],0,0,0);
	case 19:
		var k = s.split(" ");
		var y = k[0].split("-");
		var t = k[1].split(":");
		return new Date(y[0],y[1] - 1,y[2],t[0],t[1],t[2]);
	default:
		throw haxe_Exception.thrown("Invalid date format : " + s);
	}
};
HxOverrides.cca = function(s,index) {
	var x = s.charCodeAt(index);
	if(x != x) {
		return undefined;
	}
	return x;
};
HxOverrides.substr = function(s,pos,len) {
	if(len == null) {
		len = s.length;
	} else if(len < 0) {
		if(pos == 0) {
			len = s.length + len;
		} else {
			return "";
		}
	}
	return s.substr(pos,len);
};
HxOverrides.remove = function(a,obj) {
	var i = a.indexOf(obj);
	if(i == -1) {
		return false;
	}
	a.splice(i,1);
	return true;
};
HxOverrides.keyValueIter = function(a) {
	return new haxe_iterators_ArrayKeyValueIterator(a);
};
HxOverrides.now = function() {
	return Date.now();
};
var IntIterator = function(min,max) {
	this.min = min;
	this.max = max;
};
$hxClasses["IntIterator"] = IntIterator;
IntIterator.__name__ = "IntIterator";
IntIterator.prototype = {
	min: null
	,max: null
	,hasNext: function() {
		return this.min < this.max;
	}
	,next: function() {
		return this.min++;
	}
	,__class__: IntIterator
};
var Lambda = function() { };
$hxClasses["Lambda"] = Lambda;
Lambda.__name__ = "Lambda";
Lambda.array = function(it) {
	var a = [];
	var i = $getIterator(it);
	while(i.hasNext()) {
		var i1 = i.next();
		a.push(i1);
	}
	return a;
};
Lambda.count = function(it,pred) {
	var n = 0;
	if(pred == null) {
		var _ = $getIterator(it);
		while(_.hasNext()) {
			var _1 = _.next();
			++n;
		}
	} else {
		var x = $getIterator(it);
		while(x.hasNext()) {
			var x1 = x.next();
			if(pred(x1)) {
				++n;
			}
		}
	}
	return n;
};
var ManifestResources = function() { };
$hxClasses["ManifestResources"] = ManifestResources;
ManifestResources.__name__ = "ManifestResources";
ManifestResources.init = function(config) {
	ManifestResources.preloadLibraries = [];
	ManifestResources.preloadLibraryNames = [];
	ManifestResources.rootPath = null;
	if(config != null && Object.prototype.hasOwnProperty.call(config,"rootPath")) {
		ManifestResources.rootPath = Reflect.field(config,"rootPath");
		if(!StringTools.endsWith(ManifestResources.rootPath,"/")) {
			ManifestResources.rootPath += "/";
		}
	}
	if(ManifestResources.rootPath == null) {
		ManifestResources.rootPath = "./";
	}
	var bundle;
	var data = "{\"name\":null,\"assets\":\"aoy4:pathy24:assets%2Fbuild-base.jsony4:sizei216y4:typey4:TEXTy2:idR1y7:preloadtgoR0y19:assets%2Fbuild.jsonR2i224R3R4R5R7R6tgoR0y26:assets%2Ficons%2FbtAll.pngR2i4176R3y5:IMAGER5R8R6tgoR0y27:assets%2Ficons%2FbtBack.pngR2i923R3R9R5R10R6tgoR0y29:assets%2Ficons%2FbtBlocks.pngR2i441R3R9R5R11R6tgoR0y27:assets%2Ficons%2FbtBool.pngR2i425R3R9R5R12R6tgoR0y28:assets%2Ficons%2FbtClose.pngR2i1090R3R9R5R13R6tgoR0y27:assets%2Ficons%2FbtCode.pngR2i772R3R9R5R14R6tgoR0y31:assets%2Ficons%2FbtCompress.pngR2i612R3R9R5R15R6tgoR0y35:assets%2Ficons%2FbtContraptions.pngR2i836R3R9R5R16R6tgoR0y27:assets%2Ficons%2FbtCopy.pngR2i559R3R9R5R17R6tgoR0y27:assets%2Ficons%2FbtData.pngR2i969R3R9R5R18R6tgoR0y26:assets%2Ficons%2FbtDel.pngR2i524R3R9R5R19R6tgoR0y34:assets%2Ficons%2FbtDistributeH.pngR2i4391R3R9R5R20R6tgoR0y34:assets%2Ficons%2FbtDistributeV.pngR2i4367R3R9R5R21R6tgoR0y27:assets%2Ficons%2FbtDown.pngR2i450R3R9R5R22R6tgoR0y27:assets%2Ficons%2FbtEdit.pngR2i720R3R9R5R23R6tgoR0y31:assets%2Ficons%2FbtExchange.pngR2i730R3R9R5R24R6tgoR0y29:assets%2Ficons%2FbtExpand.pngR2i595R3R9R5R25R6tgoR0y28:assets%2Ficons%2FbtFloat.pngR2i501R3R9R5R26R6tgoR0y29:assets%2Ficons%2FbtFolder.pngR2i484R3R9R5R27R6tgoR0y33:assets%2Ficons%2FbtFullscreen.pngR2i725R3R9R5R28R6tgoR0y30:assets%2Ficons%2FbtInteger.pngR2i501R3R9R5R29R6tgoR0y31:assets%2Ficons%2FbtKeyframe.pngR2i704R3R9R5R30R6tgoR0y27:assets%2Ficons%2FbtLeft.pngR2i497R3R9R5R31R6tgoR0y27:assets%2Ficons%2FbtLock.pngR2i380R3R9R5R32R6tgoR0y28:assets%2Ficons%2FbtMedia.pngR2i833R3R9R5R33R6tgoR0y28:assets%2Ficons%2FbtMovie.pngR2i847R3R9R5R34R6tgoR0y33:assets%2Ficons%2FbtMovieScene.pngR2i1084R3R9R5R35R6tgoR0y32:assets%2Ficons%2FbtNarrative.pngR2i642R3R9R5R36R6tgoR0y27:assets%2Ficons%2FbtNone.pngR2i4899R3R9R5R37R6tgoR0y28:assets%2Ficons%2FbtNotes.pngR2i777R3R9R5R38R6tgoR0y25:assets%2Ficons%2FbtOk.pngR2i2027R3R9R5R39R6tgoR0y31:assets%2Ficons%2FbtOpenfile.pngR2i728R3R9R5R40R6tgoR0y28:assets%2Ficons%2FbtPaste.pngR2i4453R3R9R5R41R6tgoR0y28:assets%2Ficons%2FbtPause.pngR2i441R3R9R5R42R6tgoR0y27:assets%2Ficons%2FbtPlay.pngR2i614R3R9R5R43R6tgoR0y29:assets%2Ficons%2FbtPlugin.pngR2i971R3R9R5R44R6tgoR0y27:assets%2Ficons%2FbtPlus.pngR2i894R3R9R5R45R6tgoR0y28:assets%2Ficons%2FbtRight.pngR2i498R3R9R5R46R6tgoR0y28:assets%2Ficons%2FbtScene.pngR2i1287R3R9R5R47R6tgoR0y29:assets%2Ficons%2FbtScreen.pngR2i884R3R9R5R48R6tgoR0y38:assets%2Ficons%2FbtSelectionBottom.pngR2i4041R3R9R5R49R6tgoR0y38:assets%2Ficons%2FbtSelectionCenter.pngR2i4087R3R9R5R50R6tgoR0y36:assets%2Ficons%2FbtSelectionLeft.pngR2i4057R3R9R5R51R6tgoR0y38:assets%2Ficons%2FbtSelectionMiddle.pngR2i4101R3R9R5R52R6tgoR0y37:assets%2Ficons%2FbtSelectionRight.pngR2i4070R3R9R5R53R6tgoR0y35:assets%2Ficons%2FbtSelectionTop.pngR2i4076R3R9R5R54R6tgoR0y28:assets%2Ficons%2FbtSetup.pngR2i1544R3R9R5R55R6tgoR0y34:assets%2Ficons%2FbtStageBottom.pngR2i4166R3R9R5R56R6tgoR0y34:assets%2Ficons%2FbtStageCenter.pngR2i4374R3R9R5R57R6tgoR0y32:assets%2Ficons%2FbtStageLeft.pngR2i4241R3R9R5R58R6tgoR0y34:assets%2Ficons%2FbtStageMiddle.pngR2i4268R3R9R5R59R6tgoR0y33:assets%2Ficons%2FbtStageRight.pngR2i4227R3R9R5R60R6tgoR0y31:assets%2Ficons%2FbtStageTop.pngR2i4199R3R9R5R61R6tgoR0y27:assets%2Ficons%2FbtStop.pngR2i443R3R9R5R62R6tgoR0y29:assets%2Ficons%2FbtString.pngR2i425R3R9R5R63R6tgoR0y31:assets%2Ficons%2FbtToCenter.pngR2i420R3R9R5R64R6tgoR0y29:assets%2Ficons%2FbtToDown.pngR2i429R3R9R5R65R6tgoR0y29:assets%2Ficons%2FbtToggle.pngR2i1026R3R9R5R66R6tgoR0y29:assets%2Ficons%2FbtToLeft.pngR2i429R3R9R5R67R6tgoR0y31:assets%2Ficons%2FbtToMiddle.pngR2i430R3R9R5R68R6tgoR0y30:assets%2Ficons%2FbtToRight.pngR2i414R3R9R5R69R6tgoR0y28:assets%2Ficons%2FbtToTop.pngR2i431R3R9R5R70R6tgoR0y25:assets%2Ficons%2FbtUp.pngR2i461R3R9R5R71R6tgoR0y32:assets%2Ficons%2FbtVariables.pngR2i822R3R9R5R72R6tgoR0y31:assets%2Ficons%2FbtVisitors.pngR2i902R3R9R5R73R6tgoR0y32:assets%2Ficons%2FbtWorkspace.pngR2i605R3R9R5R74R6tgoR0y30:assets%2Ficons%2FbtZoom100.pngR2i818R3R9R5R75R6tgoR0y30:assets%2Ficons%2FbtZoomFit.pngR2i671R3R9R5R76R6tgoR0y28:assets%2Ficons%2FbtZoomM.pngR2i837R3R9R5R77R6tgoR0y28:assets%2Ficons%2FbtZoomP.pngR2i896R3R9R5R78R6tgoR0y25:assets%2Ficons%2Fbuci.pngR2i731219R3R9R5R79R6tgoR0y34:assets%2Ficons%2FicContraption.pngR2i1727R3R9R5R80R6tgoR0y27:assets%2Ficons%2FicData.pngR2i483R3R9R5R81R6tgoR0y28:assets%2Ficons%2FicDebug.pngR2i488R3R9R5R82R6tgoR0y29:assets%2Ficons%2FicGoogle.pngR2i453R3R9R5R83R6tgoR0y28:assets%2Ficons%2FicInput.pngR2i375R3R9R5R84R6tgoR0y32:assets%2Ficons%2FicNarrative.pngR2i464R3R9R5R85R6tgoR0y29:assets%2Ficons%2FiconDown.pngR2i280R3R9R5R86R6tgoR0y31:assets%2Ficons%2FiconFolder.pngR2i268R3R9R5R87R6tgoR0y40:assets%2Ficons%2FiconInteractingDown.pngR2i994R3R9R5R88R6tgoR0y38:assets%2Ficons%2FiconInteractingUp.pngR2i1015R3R9R5R89R6tgoR0y34:assets%2Ficons%2FiconLandscape.pngR2i350R3R9R5R90R6tgoR0y29:assets%2Ficons%2FiconLock.pngR2i381R3R9R5R91R6tgoR0y30:assets%2Ficons%2FiconMinus.pngR2i473R3R9R5R92R6tgoR0y29:assets%2Ficons%2FiconMove.pngR2i448R3R9R5R93R6tgoR0y29:assets%2Ficons%2FiconPlus.pngR2i468R3R9R5R94R6tgoR0y33:assets%2Ficons%2FiconPortrait.pngR2i288R3R9R5R95R6tgoR0y34:assets%2Ficons%2FiconPublished.pngR2i435R3R9R5R96R6tgoR0y31:assets%2Ficons%2FiconResize.pngR2i537R3R9R5R97R6tgoR0y32:assets%2Ficons%2FiconResizeH.pngR2i441R3R9R5R98R6tgoR0y32:assets%2Ficons%2FiconResizeV.pngR2i427R3R9R5R99R6tgoR0y27:assets%2Ficons%2FiconUp.pngR2i254R3R9R5R100R6tgoR0y32:assets%2Ficons%2FiconUpLevel.pngR2i368R3R9R5R101R6tgoR0y30:assets%2Ficons%2FicReplace.pngR2i452R3R9R5R102R6tgoR0y29:assets%2Ficons%2FicServer.pngR2i416R3R9R5R103R6tgoR0y28:assets%2Ficons%2FicShare.pngR2i417R3R9R5R104R6tgoR0y31:assets%2Ficons%2FicSnippets.pngR2i434R3R9R5R105R6tgoR0y29:assets%2Ficons%2FicSystem.pngR2i422R3R9R5R106R6tgoR0y29:assets%2Ficons%2FicTarget.pngR2i3525R3R9R5R107R6tgoR0y27:assets%2Ficons%2FicText.pngR2i420R3R9R5R108R6tgoR0y28:assets%2Ficons%2FicTimer.pngR2i429R3R9R5R109R6tgoR0y27:assets%2Ficons%2FicUser.pngR2i384R3R9R5R110R6tgoR0y30:assets%2Ficons%2FtilBuci01.pngR2i4225R3R9R5R111R6tgoR0y30:assets%2Ficons%2FtilBuci02.pngR2i4241R3R9R5R112R6tgoR0y30:assets%2Ficons%2FtilBuci03.pngR2i4278R3R9R5R113R6tgoR0y30:assets%2Ficons%2FtilBuci04.pngR2i4096R3R9R5R114R6tgoR0y30:assets%2Ficons%2FtilBuci05.pngR2i4211R3R9R5R115R6tgoR0y32:assets%2Flanguage%2Fdefault.jsonR2i155698R3R4R5R116R6tgoR0y21:assets%2Flicense.htmlR2i20302R3R4R5R117R6tgoR0R7R2i224R3R4R5y9:buildInfoR6tgoR0R117R2i20302R3R4R5y7:licenseR6tgoR0R116R2i155698R3R4R5y11:langDefaultR6tgoR0R79R2i731219R3R9R5y4:buciR6tgoR0R111R2i4225R3R9R5y9:tilBuci01R6tgoR0R112R2i4241R3R9R5y9:tilBuci02R6tgoR0R113R2i4278R3R9R5y9:tilBuci03R6tgoR0R114R2i4096R3R9R5y9:tilBuci04R6tgoR0R115R2i4211R3R9R5y9:tilBuci05R6tgoR0R10R2i923R3R9R5y6:btBackR6tgoR0R13R2i1090R3R9R5y7:btCloseR6tgoR0R39R2i2027R3R9R5y4:btOkR6tgoR0R34R2i847R3R9R5y7:btMovieR6tgoR0R47R2i1287R3R9R5y7:btSceneR6tgoR0R35R2i1084R3R9R5y12:btMovieSceneR6tgoR0R18R2i969R3R9R5y6:btDataR6tgoR0R81R2i483R3R9R5y6:icDataR6tgoR0R84R2i375R3R9R5y7:icInputR6tgoR0R106R2i422R3R9R5y8:icSystemR6tgoR0R102R2i452R3R9R5y9:icReplaceR6tgoR0R105R2i434R3R9R5y10:icSnippetsR6tgoR0R108R2i420R3R9R5y6:icTextR6tgoR0R109R2i429R3R9R5y7:icTimerR6tgoR0R110R2i384R3R9R5y6:icUserR6tgoR0R82R2i488R3R9R5y7:icDebugR6tgoR0R104R2i417R3R9R5y7:icShareR6tgoR0R83R2i453R3R9R5y8:icGoogleR6tgoR0R80R2i1727R3R9R5y13:icContraptionR6tgoR0R85R2i464R3R9R5y11:icNarrativeR6tgoR0R103R2i416R3R9R5y8:icServerR6tgoR0R45R2i894R3R9R5y6:btPlusR6tgoR0R44R2i971R3R9R5y8:btPluginR6tgoR0R55R2i1544R3R9R5y7:btSetupR6tgoR0R66R2i1026R3R9R5y8:btToggleR6tgoR0R78R2i896R3R9R5y7:btZoomPR6tgoR0R77R2i837R3R9R5y7:btZoomMR6tgoR0R76R2i671R3R9R5y9:btZoomFitR6tgoR0R75R2i818R3R9R5y9:btZoom100R6tgoR0R33R2i833R3R9R5y7:btMediaR6tgoR0R27R2i484R3R9R5y8:btFolderR6tgoR0R87R2i268R3R9R5y10:iconFolderR6tgoR0R101R2i368R3R9R5y11:iconUpLevelR6tgoR0R96R2i435R3R9R5y13:iconPublishedR6tgoR0R43R2i614R3R9R5y6:btPlayR6tgoR0R42R2i441R3R9R5y7:btPauseR6tgoR0R62R2i443R3R9R5y6:btStopR6tgoR0R31R2i497R3R9R5y6:btLeftR6tgoR0R46R2i498R3R9R5y7:btRightR6tgoR0R71R2i461R3R9R5y4:btUpR6tgoR0R22R2i450R3R9R5y6:btDownR6tgoR0R30R2i704R3R9R5y10:btKeyframeR6tgoR0R28R2i725R3R9R5y12:btFullscreenR6tgoR0R74R2i605R3R9R5y11:btWorkspaceR6tgoR0R48R2i884R3R9R5y8:btScreenR6tgoR0R40R2i728R3R9R5y10:btOpenfileR6tgoR0R17R2i559R3R9R5y6:btCopyR6tgoR0R41R2i4453R3R9R5y7:btPasteR6tgoR0R37R2i4899R3R9R5y6:btNoneR6tgoR0R8R2i4176R3R9R5y5:btAllR6tgoR0R58R2i4241R3R9R5y11:btStageLeftR6tgoR0R57R2i4374R3R9R5y13:btStageCenterR6tgoR0R60R2i4227R3R9R5y12:btStageRightR6tgoR0R61R2i4199R3R9R5y10:btStageTopR6tgoR0R59R2i4268R3R9R5y13:btStageMiddleR6tgoR0R56R2i4166R3R9R5y13:btStageBottomR6tgoR0R51R2i4057R3R9R5y15:btSelectionLeftR6tgoR0R50R2i4087R3R9R5y17:btSelectionCenterR6tgoR0R53R2i4070R3R9R5y16:btSelectionRightR6tgoR0R54R2i4076R3R9R5y14:btSelectionTopR6tgoR0R52R2i4101R3R9R5y17:btSelectionMiddleR6tgoR0R49R2i4041R3R9R5y17:btSelectionBottomR6tgoR0R20R2i4391R3R9R5y13:btDistributeHR6tgoR0R21R2i4367R3R9R5y13:btDistributeVR6tgoR0R12R2i425R3R9R5y6:btBoolR6tgoR0R29R2i501R3R9R5y9:btIntegerR6tgoR0R26R2i501R3R9R5y7:btFloatR6tgoR0R63R2i425R3R9R5y8:btStringR6tgoR0R72R2i822R3R9R5y11:btVariablesR6tgoR0R67R2i429R3R9R5y8:btToLeftR6tgoR0R69R2i414R3R9R5y9:btToRightR6tgoR0R64R2i420R3R9R5y10:btToCenterR6tgoR0R70R2i431R3R9R5y7:btToTopR6tgoR0R65R2i429R3R9R5y8:btToDownR6tgoR0R68R2i430R3R9R5y10:btToMiddleR6tgoR0R24R2i730R3R9R5y10:btExchangeR6tgoR0R73R2i902R3R9R5y10:btVisitorsR6tgoR0R16R2i836R3R9R5y14:btContraptionsR6tgoR0R36R2i642R3R9R5y11:btNarrativeR6tgoR0R93R2i448R3R9R5y8:iconMoveR6tgoR0R98R2i441R3R9R5y11:iconResizeHR6tgoR0R99R2i427R3R9R5y11:iconResizeVR6tgoR0R97R2i537R3R9R5y10:iconResizeR6tgoR0R94R2i468R3R9R5y8:iconPlusR6tgoR0R92R2i473R3R9R5y9:iconMinusR6tgoR0R86R2i280R3R9R5y8:iconDownR6tgoR0R100R2i254R3R9R5y6:iconUpR6tgoR0R91R2i381R3R9R5y8:iconLockR6tgoR0R90R2i350R3R9R5y9:landscapeR6tgoR0R95R2i288R3R9R5y8:portraitR6tgoR0R11R2i441R3R9R5y8:btBlocksR6tgoR0R14R2i772R3R9R5y6:btCodeR6tgoR0R19R2i524R3R9R5y5:btDelR6tgoR0R23R2i720R3R9R5y6:btEditR6tgoR0R25R2i595R3R9R5y8:btExpandR6tgoR0R15R2i612R3R9R5y10:btCompressR6tgoR0R38R2i777R3R9R5y7:btNotesR6tgoR0R32R2i380R3R9R5y6:btLockR6tgoR0R107R2i3525R3R9R5y8:icTargetR6tgh\",\"rootPath\":null,\"version\":2,\"libraryArgs\":[],\"libraryType\":null}";
	var manifest = lime_utils_AssetManifest.parse(data,ManifestResources.rootPath);
	var library = lime_utils_AssetLibrary.fromManifest(manifest);
	lime_utils_Assets.registerLibrary("default",library);
	library = lime_utils_Assets.getLibrary("default");
	if(library != null) {
		ManifestResources.preloadLibraries.push(library);
	} else {
		ManifestResources.preloadLibraryNames.push("default");
	}
};
Math.__name__ = "Math";
var Preloader = function() {
	openfl_display_Sprite.call(this);
	if(this.stage != null) {
		this.get_graphics().beginFill(6710886);
		this.get_graphics().drawRect(0,0,this.stage.stageWidth,this.stage.stageHeight);
		this.get_graphics().endFill();
	}
	this.addEventListener("complete",$bind(this,this.onComplete));
	this.addEventListener("progress",$bind(this,this.onProgress));
};
$hxClasses["Preloader"] = Preloader;
Preloader.__name__ = "Preloader";
Preloader.__super__ = openfl_display_Sprite;
Preloader.prototype = $extend(openfl_display_Sprite.prototype,{
	onProgress: function(evt) {
		if(this.stage != null) {
			this.get_graphics().clear();
			this.get_graphics().beginFill(6710886);
			this.get_graphics().drawRect(0,0,this.stage.stageWidth,this.stage.stageHeight);
			this.get_graphics().endFill();
			if(evt.bytesTotal > 0) {
				var wd = this.stage.stageWidth * (evt.bytesLoaded / evt.bytesTotal);
				var ht = this.stage.stageHeight * (evt.bytesLoaded / evt.bytesTotal);
				this.get_graphics().beginFill(0);
				this.get_graphics().drawRect(this.stage.stageWidth / 2 - wd / 2,this.stage.stageHeight / 2 - ht / 2,wd,ht);
				this.get_graphics().endFill();
			}
		}
	}
	,onComplete: function(evt) {
		this.get_graphics().clear();
		evt.preventDefault();
		this.dispatchEvent(new openfl_events_Event("unload"));
	}
	,__class__: Preloader
});
var Reflect = function() { };
$hxClasses["Reflect"] = Reflect;
Reflect.__name__ = "Reflect";
Reflect.field = function(o,field) {
	try {
		return o[field];
	} catch( _g ) {
		haxe_NativeStackTrace.lastError = _g;
		return null;
	}
};
Reflect.getProperty = function(o,field) {
	var tmp;
	if(o == null) {
		return null;
	} else {
		var tmp1;
		if(o.__properties__) {
			tmp = o.__properties__["get_" + field];
			tmp1 = tmp;
		} else {
			tmp1 = false;
		}
		if(tmp1) {
			return o[tmp]();
		} else {
			return o[field];
		}
	}
};
Reflect.setProperty = function(o,field,value) {
	var tmp;
	var tmp1;
	if(o.__properties__) {
		tmp = o.__properties__["set_" + field];
		tmp1 = tmp;
	} else {
		tmp1 = false;
	}
	if(tmp1) {
		o[tmp](value);
	} else {
		o[field] = value;
	}
};
Reflect.fields = function(o) {
	var a = [];
	if(o != null) {
		var hasOwnProperty = Object.prototype.hasOwnProperty;
		for( var f in o ) {
		if(f != "__id__" && f != "hx__closures__" && hasOwnProperty.call(o,f)) {
			a.push(f);
		}
		}
	}
	return a;
};
Reflect.isFunction = function(f) {
	if(typeof(f) == "function") {
		return !(f.__name__ || f.__ename__);
	} else {
		return false;
	}
};
Reflect.compare = function(a,b) {
	if(a == b) {
		return 0;
	} else if(a > b) {
		return 1;
	} else {
		return -1;
	}
};
Reflect.isObject = function(v) {
	if(v == null) {
		return false;
	}
	var t = typeof(v);
	if(!(t == "string" || t == "object" && v.__enum__ == null)) {
		if(t == "function") {
			return (v.__name__ || v.__ename__) != null;
		} else {
			return false;
		}
	} else {
		return true;
	}
};
Reflect.isEnumValue = function(v) {
	if(v != null) {
		return v.__enum__ != null;
	} else {
		return false;
	}
};
Reflect.deleteField = function(o,field) {
	if(!Object.prototype.hasOwnProperty.call(o,field)) {
		return false;
	}
	delete(o[field]);
	return true;
};
Reflect.makeVarArgs = function(f) {
	return function() {
		var a = Array.prototype.slice;
		var a1 = arguments;
		var a2 = a.call(a1);
		return f(a2);
	};
};
var Std = function() { };
$hxClasses["Std"] = Std;
Std.__name__ = "Std";
Std.string = function(s) {
	return js_Boot.__string_rec(s,"");
};
Std.parseInt = function(x) {
	var v = parseInt(x);
	if(isNaN(v)) {
		return null;
	}
	return v;
};
Std.random = function(x) {
	if(x <= 0) {
		return 0;
	} else {
		return Math.floor(Math.random() * x);
	}
};
var StringBuf = function() {
	this.b = "";
};
$hxClasses["StringBuf"] = StringBuf;
StringBuf.__name__ = "StringBuf";
StringBuf.prototype = {
	b: null
	,__class__: StringBuf
};
var StringTools = function() { };
$hxClasses["StringTools"] = StringTools;
StringTools.__name__ = "StringTools";
StringTools.htmlEscape = function(s,quotes) {
	var buf_b = "";
	var _g_offset = 0;
	var _g_s = s;
	while(_g_offset < _g_s.length) {
		var s = _g_s;
		var index = _g_offset++;
		var c = s.charCodeAt(index);
		if(c >= 55296 && c <= 56319) {
			c = c - 55232 << 10 | s.charCodeAt(index + 1) & 1023;
		}
		var c1 = c;
		if(c1 >= 65536) {
			++_g_offset;
		}
		var code = c1;
		switch(code) {
		case 34:
			if(quotes) {
				buf_b += "&quot;";
			} else {
				buf_b += String.fromCodePoint(code);
			}
			break;
		case 38:
			buf_b += "&amp;";
			break;
		case 39:
			if(quotes) {
				buf_b += "&#039;";
			} else {
				buf_b += String.fromCodePoint(code);
			}
			break;
		case 60:
			buf_b += "&lt;";
			break;
		case 62:
			buf_b += "&gt;";
			break;
		default:
			buf_b += String.fromCodePoint(code);
		}
	}
	return buf_b;
};
StringTools.htmlUnescape = function(s) {
	return s.split("&gt;").join(">").split("&lt;").join("<").split("&quot;").join("\"").split("&#039;").join("'").split("&amp;").join("&");
};
StringTools.startsWith = function(s,start) {
	if(s.length >= start.length) {
		return s.lastIndexOf(start,0) == 0;
	} else {
		return false;
	}
};
StringTools.endsWith = function(s,end) {
	var elen = end.length;
	var slen = s.length;
	if(slen >= elen) {
		return s.indexOf(end,slen - elen) == slen - elen;
	} else {
		return false;
	}
};
StringTools.isSpace = function(s,pos) {
	var c = HxOverrides.cca(s,pos);
	if(!(c > 8 && c < 14)) {
		return c == 32;
	} else {
		return true;
	}
};
StringTools.ltrim = function(s) {
	var l = s.length;
	var r = 0;
	while(r < l && StringTools.isSpace(s,r)) ++r;
	if(r > 0) {
		return HxOverrides.substr(s,r,l - r);
	} else {
		return s;
	}
};
StringTools.rtrim = function(s) {
	var l = s.length;
	var r = 0;
	while(r < l && StringTools.isSpace(s,l - r - 1)) ++r;
	if(r > 0) {
		return HxOverrides.substr(s,0,l - r);
	} else {
		return s;
	}
};
StringTools.trim = function(s) {
	return StringTools.ltrim(StringTools.rtrim(s));
};
StringTools.lpad = function(s,c,l) {
	if(c.length <= 0) {
		return s;
	}
	var buf_b = "";
	l -= s.length;
	while(buf_b.length < l) buf_b += c == null ? "null" : "" + c;
	buf_b += s == null ? "null" : "" + s;
	return buf_b;
};
StringTools.rpad = function(s,c,l) {
	if(c.length <= 0) {
		return s;
	}
	var buf_b = "";
	buf_b += s == null ? "null" : "" + s;
	while(buf_b.length < l) buf_b += c == null ? "null" : "" + c;
	return buf_b;
};
StringTools.replace = function(s,sub,by) {
	return s.split(sub).join(by);
};
StringTools.hex = function(n,digits) {
	var s = "";
	var hexChars = "0123456789ABCDEF";
	do {
		s = hexChars.charAt(n & 15) + s;
		n >>>= 4;
	} while(n > 0);
	if(digits != null) {
		while(s.length < digits) s = "0" + s;
	}
	return s;
};
var ValueType = $hxEnums["ValueType"] = { __ename__:"ValueType",__constructs__:null
	,TNull: {_hx_name:"TNull",_hx_index:0,__enum__:"ValueType",toString:$estr}
	,TInt: {_hx_name:"TInt",_hx_index:1,__enum__:"ValueType",toString:$estr}
	,TFloat: {_hx_name:"TFloat",_hx_index:2,__enum__:"ValueType",toString:$estr}
	,TBool: {_hx_name:"TBool",_hx_index:3,__enum__:"ValueType",toString:$estr}
	,TObject: {_hx_name:"TObject",_hx_index:4,__enum__:"ValueType",toString:$estr}
	,TFunction: {_hx_name:"TFunction",_hx_index:5,__enum__:"ValueType",toString:$estr}
	,TClass: ($_=function(c) { return {_hx_index:6,c:c,__enum__:"ValueType",toString:$estr}; },$_._hx_name="TClass",$_.__params__ = ["c"],$_)
	,TEnum: ($_=function(e) { return {_hx_index:7,e:e,__enum__:"ValueType",toString:$estr}; },$_._hx_name="TEnum",$_.__params__ = ["e"],$_)
	,TUnknown: {_hx_name:"TUnknown",_hx_index:8,__enum__:"ValueType",toString:$estr}
};
ValueType.__constructs__ = [ValueType.TNull,ValueType.TInt,ValueType.TFloat,ValueType.TBool,ValueType.TObject,ValueType.TFunction,ValueType.TClass,ValueType.TEnum,ValueType.TUnknown];
var Type = function() { };
$hxClasses["Type"] = Type;
Type.__name__ = "Type";
Type.resolveEnum = function(name) {
	return $hxEnums[name];
};
Type.createInstance = function(cl,args) {
	var ctor = Function.prototype.bind.apply(cl,[null].concat(args));
	return new (ctor);
};
Type.createEnum = function(e,constr,params) {
	var f = Reflect.field(e,constr);
	if(f == null) {
		throw haxe_Exception.thrown("No such constructor " + constr);
	}
	if(Reflect.isFunction(f)) {
		if(params == null) {
			throw haxe_Exception.thrown("Constructor " + constr + " need parameters");
		}
		return f.apply(e,params);
	}
	if(params != null && params.length != 0) {
		throw haxe_Exception.thrown("Constructor " + constr + " does not need parameters");
	}
	return f;
};
Type.getInstanceFields = function(c) {
	var a = [];
	for(var i in c.prototype) a.push(i);
	HxOverrides.remove(a,"__class__");
	HxOverrides.remove(a,"__properties__");
	return a;
};
Type.typeof = function(v) {
	switch(typeof(v)) {
	case "boolean":
		return ValueType.TBool;
	case "function":
		if(v.__name__ || v.__ename__) {
			return ValueType.TObject;
		}
		return ValueType.TFunction;
	case "number":
		if(Math.ceil(v) == v % 2147483648.0) {
			return ValueType.TInt;
		}
		return ValueType.TFloat;
	case "object":
		if(v == null) {
			return ValueType.TNull;
		}
		var e = v.__enum__;
		if(e != null) {
			return ValueType.TEnum($hxEnums[e]);
		}
		var c = js_Boot.getClass(v);
		if(c != null) {
			return ValueType.TClass(c);
		}
		return ValueType.TObject;
	case "string":
		return ValueType.TClass(String);
	case "undefined":
		return ValueType.TNull;
	default:
		return ValueType.TUnknown;
	}
};
Type.enumEq = function(a,b) {
	if(a == b) {
		return true;
	}
	try {
		var e = a.__enum__;
		if(e == null || e != b.__enum__) {
			return false;
		}
		if(a._hx_index != b._hx_index) {
			return false;
		}
		var enm = $hxEnums[e];
		var params = enm.__constructs__[a._hx_index].__params__;
		var _g = 0;
		while(_g < params.length) {
			var f = params[_g];
			++_g;
			if(!Type.enumEq(a[f],b[f])) {
				return false;
			}
		}
	} catch( _g ) {
		haxe_NativeStackTrace.lastError = _g;
		return false;
	}
	return true;
};
Type.enumParameters = function(e) {
	var enm = $hxEnums[e.__enum__];
	var params = enm.__constructs__[e._hx_index].__params__;
	if(params != null) {
		var _g = [];
		var _g1 = 0;
		while(_g1 < params.length) {
			var p = params[_g1];
			++_g1;
			_g.push(e[p]);
		}
		return _g;
	} else {
		return [];
	}
};
var UInt = {};
UInt.gt = function(a,b) {
	var aNeg = a < 0;
	var bNeg = b < 0;
	if(aNeg != bNeg) {
		return aNeg;
	} else {
		return a > b;
	}
};
UInt.toFloat = function(this1) {
	var int = this1;
	if(int < 0) {
		return 4294967296.0 + int;
	} else {
		return int + 0.0;
	}
};
var XmlType = {};
XmlType.toString = function(this1) {
	switch(this1) {
	case 0:
		return "Element";
	case 1:
		return "PCData";
	case 2:
		return "CData";
	case 3:
		return "Comment";
	case 4:
		return "DocType";
	case 5:
		return "ProcessingInstruction";
	case 6:
		return "Document";
	}
};
var Xml = function(nodeType) {
	this.nodeType = nodeType;
	this.children = [];
	this.attributeMap = new haxe_ds_StringMap();
};
$hxClasses["Xml"] = Xml;
Xml.__name__ = "Xml";
Xml.parse = function(str) {
	return haxe_xml_Parser.parse(str);
};
Xml.createElement = function(name) {
	var xml = new Xml(Xml.Element);
	if(xml.nodeType != Xml.Element) {
		throw haxe_Exception.thrown("Bad node type, expected Element but found " + (xml.nodeType == null ? "null" : XmlType.toString(xml.nodeType)));
	}
	xml.nodeName = name;
	return xml;
};
Xml.createPCData = function(data) {
	var xml = new Xml(Xml.PCData);
	if(xml.nodeType == Xml.Document || xml.nodeType == Xml.Element) {
		throw haxe_Exception.thrown("Bad node type, unexpected " + (xml.nodeType == null ? "null" : XmlType.toString(xml.nodeType)));
	}
	xml.nodeValue = data;
	return xml;
};
Xml.createCData = function(data) {
	var xml = new Xml(Xml.CData);
	if(xml.nodeType == Xml.Document || xml.nodeType == Xml.Element) {
		throw haxe_Exception.thrown("Bad node type, unexpected " + (xml.nodeType == null ? "null" : XmlType.toString(xml.nodeType)));
	}
	xml.nodeValue = data;
	return xml;
};
Xml.createComment = function(data) {
	var xml = new Xml(Xml.Comment);
	if(xml.nodeType == Xml.Document || xml.nodeType == Xml.Element) {
		throw haxe_Exception.thrown("Bad node type, unexpected " + (xml.nodeType == null ? "null" : XmlType.toString(xml.nodeType)));
	}
	xml.nodeValue = data;
	return xml;
};
Xml.createDocType = function(data) {
	var xml = new Xml(Xml.DocType);
	if(xml.nodeType == Xml.Document || xml.nodeType == Xml.Element) {
		throw haxe_Exception.thrown("Bad node type, unexpected " + (xml.nodeType == null ? "null" : XmlType.toString(xml.nodeType)));
	}
	xml.nodeValue = data;
	return xml;
};
Xml.createProcessingInstruction = function(data) {
	var xml = new Xml(Xml.ProcessingInstruction);
	if(xml.nodeType == Xml.Document || xml.nodeType == Xml.Element) {
		throw haxe_Exception.thrown("Bad node type, unexpected " + (xml.nodeType == null ? "null" : XmlType.toString(xml.nodeType)));
	}
	xml.nodeValue = data;
	return xml;
};
Xml.createDocument = function() {
	return new Xml(Xml.Document);
};
Xml.prototype = {
	nodeType: null
	,nodeName: null
	,nodeValue: null
	,parent: null
	,children: null
	,attributeMap: null
	,get: function(att) {
		if(this.nodeType != Xml.Element) {
			throw haxe_Exception.thrown("Bad node type, expected Element but found " + (this.nodeType == null ? "null" : XmlType.toString(this.nodeType)));
		}
		return this.attributeMap.h[att];
	}
	,set: function(att,value) {
		if(this.nodeType != Xml.Element) {
			throw haxe_Exception.thrown("Bad node type, expected Element but found " + (this.nodeType == null ? "null" : XmlType.toString(this.nodeType)));
		}
		this.attributeMap.h[att] = value;
	}
	,exists: function(att) {
		if(this.nodeType != Xml.Element) {
			throw haxe_Exception.thrown("Bad node type, expected Element but found " + (this.nodeType == null ? "null" : XmlType.toString(this.nodeType)));
		}
		return Object.prototype.hasOwnProperty.call(this.attributeMap.h,att);
	}
	,attributes: function() {
		if(this.nodeType != Xml.Element) {
			throw haxe_Exception.thrown("Bad node type, expected Element but found " + (this.nodeType == null ? "null" : XmlType.toString(this.nodeType)));
		}
		return new haxe_ds__$StringMap_StringMapKeyIterator(this.attributeMap.h);
	}
	,addChild: function(x) {
		if(this.nodeType != Xml.Document && this.nodeType != Xml.Element) {
			throw haxe_Exception.thrown("Bad node type, expected Element or Document but found " + (this.nodeType == null ? "null" : XmlType.toString(this.nodeType)));
		}
		if(x.parent != null) {
			x.parent.removeChild(x);
		}
		this.children.push(x);
		x.parent = this;
	}
	,removeChild: function(x) {
		if(this.nodeType != Xml.Document && this.nodeType != Xml.Element) {
			throw haxe_Exception.thrown("Bad node type, expected Element or Document but found " + (this.nodeType == null ? "null" : XmlType.toString(this.nodeType)));
		}
		if(HxOverrides.remove(this.children,x)) {
			x.parent = null;
			return true;
		}
		return false;
	}
	,toString: function() {
		return haxe_xml_Printer.print(this);
	}
	,__class__: Xml
};
var feathers_core_IFocusExclusions = function() { };
$hxClasses["feathers.core.IFocusExclusions"] = feathers_core_IFocusExclusions;
feathers_core_IFocusExclusions.__name__ = "feathers.core.IFocusExclusions";
feathers_core_IFocusExclusions.__isInterface__ = true;
feathers_core_IFocusExclusions.__interfaces__ = [feathers_core_IFocusManagerAware];
feathers_core_IFocusExclusions.prototype = {
	get_focusExclusions: null
	,__class__: feathers_core_IFocusExclusions
	,__properties__: {get_focusExclusions:"get_focusExclusions"}
};
var feathers_core_IOpenCloseToggle = function() { };
$hxClasses["feathers.core.IOpenCloseToggle"] = feathers_core_IOpenCloseToggle;
feathers_core_IOpenCloseToggle.__name__ = "feathers.core.IOpenCloseToggle";
feathers_core_IOpenCloseToggle.__isInterface__ = true;
feathers_core_IOpenCloseToggle.__interfaces__ = [feathers_core_IUIControl];
feathers_core_IOpenCloseToggle.prototype = {
	get_opened: null
	,set_opened: null
	,__class__: feathers_core_IOpenCloseToggle
	,__properties__: {set_opened:"set_opened",get_opened:"get_opened"}
};
var feathers_controls_Drawer = function(content,drawer) {
	this.__overlaySkin = null;
	this._animateOpenedProperty = true;
	this._swipeOpenEnabled = true;
	this._swipeCloseEnabled = true;
	this._clickOverlayToClose = true;
	this._clickStartY = 0.0;
	this._clickStartX = 0.0;
	this._simulateTouch = false;
	this._autoSizeMode = feathers_layout_AutoSizeMode.STAGE;
	this._opened = false;
	this._pendingAnimation = false;
	this._pendingOpened = null;
	this._pullableEdge = feathers_layout_RelativePosition.LEFT;
	this._ignoreContentResize = false;
	this._ignoreDrawerResize = false;
	this._focusExclusions = [];
	this.initializeDrawerTheme();
	feathers_core_FeathersControl.call(this);
	this.set_content(content);
	this.set_drawer(drawer);
	this.addEventListener("addedToStage",$bind(this,this.drawer_addedToStageHandler));
};
$hxClasses["feathers.controls.Drawer"] = feathers_controls_Drawer;
feathers_controls_Drawer.__name__ = "feathers.controls.Drawer";
feathers_controls_Drawer.__interfaces__ = [feathers_core_IFocusExclusions,feathers_core_IOpenCloseToggle];
feathers_controls_Drawer.__super__ = feathers_core_FeathersControl;
feathers_controls_Drawer.prototype = $extend(feathers_core_FeathersControl.prototype,{
	_focusExclusions: null
	,get_focusExclusions: function() {
		if(this._edgePuller != null && (this._edgePuller.get_opened() || this._edgePuller.get_active())) {
			return this._focusExclusions;
		}
		return null;
	}
	,_edgePuller: null
	,_drawerMeasurements: null
	,_ignoreDrawerResize: null
	,_drawer: null
	,get_drawer: function() {
		return this._drawer;
	}
	,set_drawer: function(value) {
		if(this._drawer == value) {
			return this._drawer;
		}
		if(this._drawer != null) {
			this._drawer.removeEventListener("resize",$bind(this,this.drawer_drawer_resizeHandler));
			this._drawerMeasurements.restore(this._drawer);
			if(this._drawer.parent == this) {
				this.removeChild(this._drawer);
			}
		}
		this._drawer = value;
		if(this._drawer != null) {
			this._drawer.set_visible(false);
			this.addChild(this._drawer);
			if(js_Boot.__implements(this._drawer,feathers_core_IUIControl)) {
				this._drawer.initializeNow();
			}
			if(this._drawerMeasurements == null) {
				this._drawerMeasurements = new feathers_layout_Measurements(this._drawer);
			} else {
				this._drawerMeasurements.save(this._drawer);
			}
			this._drawer.addEventListener("resize",$bind(this,this.drawer_drawer_resizeHandler),false,0,true);
		}
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		return this._drawer;
	}
	,_contentMeasurements: null
	,_ignoreContentResize: null
	,_content: null
	,get_content: function() {
		return this._content;
	}
	,set_content: function(value) {
		if(this._content == value) {
			return this._content;
		}
		if(this._content != null) {
			this._content.removeEventListener("resize",$bind(this,this.drawer_content_resizeHandler));
			this._contentMeasurements.restore(this._content);
			if(this._content.parent == this) {
				this.removeChild(this._content);
			}
			HxOverrides.remove(this._focusExclusions,this._content);
		}
		this._content = value;
		if(this._content != null) {
			this.addChildAt(this._content,0);
			if(js_Boot.__implements(this._content,feathers_core_IUIControl)) {
				this._content.initializeNow();
			}
			if(this._contentMeasurements == null) {
				this._contentMeasurements = new feathers_layout_Measurements(this._content);
			} else {
				this._contentMeasurements.save(this._content);
			}
			this._content.addEventListener("resize",$bind(this,this.drawer_content_resizeHandler),false,0,true);
			this._focusExclusions.push(this._content);
		}
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		return this._content;
	}
	,_pullableEdge: null
	,get_pullableEdge: function() {
		return this._pullableEdge;
	}
	,set_pullableEdge: function(value) {
		if(this._pullableEdge == value) {
			return this._pullableEdge;
		}
		this._pullableEdge = value;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		return this._pullableEdge;
	}
	,_pendingOpened: null
	,_pendingAnimation: null
	,_opened: null
	,get_opened: function() {
		if(this._pendingOpened != null) {
			return this._pendingOpened;
		}
		return this._opened;
	}
	,set_opened: function(value) {
		if(value) {
			this.openDrawer(this._animateOpenedProperty);
		} else {
			this.closeDrawer(this._animateOpenedProperty);
		}
		if(this._pendingOpened != null) {
			return this._pendingOpened;
		}
		return this._opened;
	}
	,_autoSizeMode: null
	,get_autoSizeMode: function() {
		return this._autoSizeMode;
	}
	,set_autoSizeMode: function(value) {
		if(this._autoSizeMode == value) {
			return this._autoSizeMode;
		}
		this._autoSizeMode = value;
		this.setInvalid(feathers_core_InvalidationFlag.SIZE);
		if(this.stage != null) {
			if(this._autoSizeMode == feathers_layout_AutoSizeMode.STAGE) {
				this.stage.addEventListener("resize",$bind(this,this.drawer_stage_resizeHandler));
				this.addEventListener("removedFromStage",$bind(this,this.drawer_removedFromStageHandler));
			} else {
				this.stage.removeEventListener("resize",$bind(this,this.drawer_stage_resizeHandler));
				this.removeEventListener("removedFromStage",$bind(this,this.drawer_removedFromStageHandler));
			}
		}
		return this._autoSizeMode;
	}
	,_simulateTouch: null
	,get_simulateTouch: function() {
		return this._simulateTouch;
	}
	,set_simulateTouch: function(value) {
		if(this._simulateTouch == value) {
			return this._simulateTouch;
		}
		this._simulateTouch = value;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		return this._simulateTouch;
	}
	,_currentOverlaySkin: null
	,_overlaySkinMeasurements: null
	,_overlaySkinAlpha: null
	,_fallbackOverlaySkin: null
	,_clickStartX: null
	,_clickStartY: null
	,_clickOverlayToClose: null
	,get_clickOverlayToClose: function() {
		return this._clickOverlayToClose;
	}
	,set_clickOverlayToClose: function(value) {
		this._clickOverlayToClose = value;
		return this._clickOverlayToClose;
	}
	,_swipeCloseEnabled: null
	,get_swipeCloseEnabled: function() {
		return this._swipeCloseEnabled;
	}
	,set_swipeCloseEnabled: function(value) {
		if(this._swipeCloseEnabled == value) {
			return this._swipeCloseEnabled;
		}
		this._swipeCloseEnabled = value;
		this.setInvalid(feathers_core_InvalidationFlag.STATE);
		return this._swipeCloseEnabled;
	}
	,_swipeOpenEnabled: null
	,get_swipeOpenEnabled: function() {
		return this._swipeOpenEnabled;
	}
	,set_swipeOpenEnabled: function(value) {
		if(this._swipeOpenEnabled == value) {
			return this._swipeOpenEnabled;
		}
		this._swipeOpenEnabled = value;
		this.setInvalid(feathers_core_InvalidationFlag.STATE);
		return this._swipeOpenEnabled;
	}
	,_animateOpenedProperty: null
	,get_animateOpenedProperty: function() {
		return this._animateOpenedProperty;
	}
	,set_animateOpenedProperty: function(value) {
		this._animateOpenedProperty = value;
		return this._animateOpenedProperty;
	}
	,dispose: function() {
		if(this._content != null) {
			this.set_content(null);
		}
		if(this._drawer != null) {
			this.set_drawer(null);
		}
		feathers_core_FeathersControl.prototype.dispose.call(this);
	}
	,openDrawer: function(animate) {
		if(animate == null) {
			animate = true;
		}
		this._pendingAnimation = animate;
		if(this._pendingOpened != null && this._pendingOpened) {
			return;
		}
		this._pendingOpened = true;
		if(this._drawer == null) {
			throw new openfl_errors_ArgumentError("Cannot set opened property to true because drawer property is null");
		}
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
	}
	,closeDrawer: function(animate) {
		if(animate == null) {
			animate = true;
		}
		this._pendingAnimation = animate;
		if(this._pendingOpened != null && !this._pendingOpened) {
			return;
		}
		this._pendingOpened = false;
		if(this._drawer == null) {
			throw new openfl_errors_ArgumentError("Cannot set opened property to true because drawer property is null");
		}
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
	}
	,initializeDrawerTheme: function() {
		feathers_themes_steel_components_SteelDrawerStyles.initialize();
	}
	,initialize: function() {
		feathers_core_FeathersControl.prototype.initialize.call(this);
		if(this._edgePuller == null) {
			this._edgePuller = new feathers_utils_EdgePuller(this._content);
		}
		this._edgePuller.addEventListener("opening",$bind(this,this.drawer_edgePuller_openingHandler));
		this._edgePuller.addEventListener("closing",$bind(this,this.drawer_edgePuller_closingHandler));
		this._edgePuller.addEventListener("open",$bind(this,this.drawer_edgePuller_openHandler));
		this._edgePuller.addEventListener("close",$bind(this,this.drawer_edgePuller_closeHandler));
		this._edgePuller.addEventListener("cancel",$bind(this,this.drawer_edgePuller_cancelHandler));
		this._edgePuller.addEventListener("change",$bind(this,this.drawer_edgePuller_changeHandler));
	}
	,update: function() {
		var dataInvalid = this.isInvalid(feathers_core_InvalidationFlag.DATA);
		var stateInvalid = this.isInvalid(feathers_core_InvalidationFlag.STATE);
		var stylesInvalid = this.isInvalid(feathers_core_InvalidationFlag.STYLES);
		if(dataInvalid) {
			this._edgePuller.set_target(this._content);
			this._edgePuller.set_pullableEdge(this._pullableEdge);
			this._edgePuller.simulateTouch = this._simulateTouch;
		}
		if(stylesInvalid) {
			this.refreshOverlaySkin();
		}
		if(stateInvalid || dataInvalid) {
			this.refreshEnabled();
		}
		this.measure();
		this.layoutChildren();
		if(dataInvalid) {
			if(this._pendingOpened != null) {
				var savedSnapDuration = this._edgePuller.get_snapDuration();
				if(!this._pendingAnimation) {
					this._edgePuller.set_snapDuration(0.0);
				}
				this._edgePuller.set_opened(this._pendingOpened);
				if(!this._pendingAnimation) {
					this._edgePuller.set_snapDuration(savedSnapDuration);
				}
				this._pendingOpened = null;
			} else {
				this._edgePuller.set_opened(this._opened);
			}
		}
	}
	,measure: function() {
		var needsWidth = this.get_explicitWidth() == null;
		var needsHeight = this.get_explicitHeight() == null;
		var needsMinWidth = this.get_explicitMinWidth() == null;
		var needsMinHeight = this.get_explicitMinHeight() == null;
		var needsMaxWidth = this.get_explicitMaxWidth() == null;
		var needsMaxHeight = this.get_explicitMaxHeight() == null;
		if(!needsWidth && !needsHeight && !needsMinWidth && !needsMinHeight && !needsMaxWidth && !needsMaxHeight) {
			return false;
		}
		var needsToMeasureContent = this._autoSizeMode == feathers_layout_AutoSizeMode.CONTENT || this.stage == null;
		var stageWidth = 0.0;
		var stageHeight = 0.0;
		if(!needsToMeasureContent) {
			var topLeft = this.globalToLocal(new openfl_geom_Point());
			var bottomRight = this.globalToLocal(new openfl_geom_Point(this.stage.stageWidth,this.stage.stageHeight));
			stageWidth = bottomRight.x - topLeft.x;
			stageHeight = bottomRight.y - topLeft.y;
			return this.saveMeasurements(stageWidth,stageHeight,stageWidth,stageHeight);
		}
		var measureContent = null;
		if(js_Boot.__implements(this._content,feathers_core_IMeasureObject)) {
			measureContent = this._content;
		}
		if(this._content != null) {
			var oldIgnoreContentResize = this._ignoreContentResize;
			this._ignoreContentResize = true;
			feathers_utils_MeasurementsUtil.resetFluidlyWithParentValues(this._contentMeasurements,this._content,this.get_explicitWidth(),this.get_explicitHeight(),this.get_explicitMinWidth(),this.get_explicitMinHeight(),this.get_explicitMaxWidth(),this.get_explicitMaxHeight());
			if(js_Boot.__implements(this._content,feathers_core_IValidating)) {
				this._content.validateNow();
			}
			this._ignoreContentResize = oldIgnoreContentResize;
		}
		var newWidth = this.get_explicitWidth();
		if(needsWidth) {
			newWidth = 0.0;
			if(this._content != null) {
				newWidth = this._content.get_width();
			}
		}
		var newHeight = this.get_explicitHeight();
		if(needsHeight) {
			newHeight = 0.0;
			if(this._content != null) {
				newHeight = this._content.get_height();
			}
		}
		var newMinWidth = this.get_explicitMinWidth();
		if(needsMinWidth) {
			if(measureContent != null) {
				newMinWidth = measureContent.get_minWidth();
			} else if(this._contentMeasurements != null && this._contentMeasurements.minWidth != null) {
				newMinWidth = this._contentMeasurements.minWidth;
			} else {
				newMinWidth = 0.0;
			}
		}
		var newMinHeight = this.get_explicitMinHeight();
		if(needsMinHeight) {
			if(measureContent != null) {
				newMinHeight = measureContent.get_minHeight();
			} else if(this._contentMeasurements != null && this._contentMeasurements.minHeight != null) {
				newMinHeight = this._contentMeasurements.minHeight;
			} else {
				newMinHeight = 0.0;
			}
		}
		var newMaxWidth = this.get_explicitMaxWidth();
		if(needsMaxWidth) {
			if(measureContent != null) {
				newMaxWidth = measureContent.get_maxWidth();
			} else if(this._contentMeasurements != null && this._contentMeasurements.maxWidth != null) {
				newMaxWidth = this._contentMeasurements.maxWidth;
			} else {
				newMaxWidth = 1.0 / 0.0;
			}
		}
		var newMaxHeight = this.get_explicitMaxHeight();
		if(needsMaxHeight) {
			if(measureContent != null) {
				newMaxHeight = measureContent.get_maxHeight();
			} else if(this._contentMeasurements != null && this._contentMeasurements.maxHeight != null) {
				newMaxHeight = this._contentMeasurements.maxHeight;
			} else {
				newMaxHeight = 1.0 / 0.0;
			}
		}
		return this.saveMeasurements(newWidth,newHeight,newMinWidth,newMinHeight,newMaxWidth,newMaxHeight);
	}
	,refreshEnabled: function() {
		this._edgePuller.enabled = this._enabled && this._drawer != null && (this._opened && this._swipeCloseEnabled || !this._opened && this._swipeOpenEnabled);
		if(js_Boot.__implements(this._content,feathers_core_IUIControl)) {
			this._content.set_enabled(this._enabled);
		}
		if(js_Boot.__implements(this._drawer,feathers_core_IUIControl)) {
			this._drawer.set_enabled(this._enabled);
		}
	}
	,refreshOverlaySkin: function() {
		var oldSkin = this._currentOverlaySkin;
		this._currentOverlaySkin = this.getCurrentOverlaySkin();
		if(this._currentOverlaySkin == oldSkin) {
			return;
		}
		this.removeCurrentOverlaySkin(oldSkin);
		if(this._currentOverlaySkin == null) {
			this._overlaySkinMeasurements = null;
			return;
		}
		if(js_Boot.__implements(this._currentOverlaySkin,feathers_core_IUIControl)) {
			this._currentOverlaySkin.initializeNow();
		}
		if(this._overlaySkinMeasurements == null) {
			this._overlaySkinMeasurements = new feathers_layout_Measurements(this._currentOverlaySkin);
		} else {
			this._overlaySkinMeasurements.save(this._currentOverlaySkin);
		}
		this._overlaySkinAlpha = this._currentOverlaySkin.get_alpha();
		if(js_Boot.__implements(this._currentOverlaySkin,feathers_skins_IProgrammaticSkin)) {
			this._currentOverlaySkin.set_uiContext(this);
		}
		this._currentOverlaySkin.addEventListener("mouseDown",$bind(this,this.drawer_overlaySkin_mouseDownHandler),false,0,true);
		this._currentOverlaySkin.addEventListener("click",$bind(this,this.drawer_overlaySkin_clickHandler),false,0,true);
		this._currentOverlaySkin.addEventListener("touchBegin",$bind(this,this.drawer_overlaySkin_touchBeginHandler),false,0,true);
		this._currentOverlaySkin.addEventListener("touchTap",$bind(this,this.drawer_overlaySkin_touchTapHandler),false,0,true);
		this._currentOverlaySkin.set_visible(false);
		var index = -1;
		if(this._drawer != null) {
			index = this.getChildIndex(this._drawer);
		}
		if(index == -1) {
			index = this.get_numChildren();
		}
		this.addChildAt(this._currentOverlaySkin,index);
	}
	,getCurrentOverlaySkin: function() {
		if(this.get_overlaySkin() == null) {
			if(this._fallbackOverlaySkin == null) {
				this._fallbackOverlaySkin = new openfl_display_Sprite();
				this._fallbackOverlaySkin.get_graphics().beginFill(16711935,0.0);
				this._fallbackOverlaySkin.get_graphics().drawRect(0.0,0.0,1.0,1.0);
				this._fallbackOverlaySkin.get_graphics().endFill();
			}
			return this._fallbackOverlaySkin;
		}
		return this.get_overlaySkin();
	}
	,removeCurrentOverlaySkin: function(skin) {
		if(skin == null) {
			return;
		}
		skin.removeEventListener("mouseDown",$bind(this,this.drawer_overlaySkin_mouseDownHandler));
		skin.removeEventListener("click",$bind(this,this.drawer_overlaySkin_clickHandler));
		skin.removeEventListener("touchBegin",$bind(this,this.drawer_overlaySkin_touchBeginHandler));
		skin.removeEventListener("touchTap",$bind(this,this.drawer_overlaySkin_touchTapHandler));
		if(js_Boot.__implements(skin,feathers_skins_IProgrammaticSkin)) {
			skin.set_uiContext(null);
		}
		this._overlaySkinMeasurements.restore(skin);
		this._currentOverlaySkin.set_alpha(this._overlaySkinAlpha);
		if(skin.parent == this) {
			this.removeChild(skin);
		}
	}
	,layoutChildren: function() {
		var oldIgnoreContentResize = this._ignoreContentResize;
		this._ignoreContentResize = true;
		if(this._content != null) {
			this._content.set_x(0.0);
			this._content.set_y(0.0);
			if(this._content.get_width() != this.actualWidth) {
				this._content.set_width(this.actualWidth);
			}
			if(this._content.get_height() != this.actualHeight) {
				this._content.set_height(this.actualHeight);
			}
			if(js_Boot.__implements(this._content,feathers_core_IValidating)) {
				this._content.validateNow();
			}
		}
		this._ignoreContentResize = oldIgnoreContentResize;
		if(this._currentOverlaySkin != null) {
			this._currentOverlaySkin.set_x(0.0);
			this._currentOverlaySkin.set_y(0.0);
			this._currentOverlaySkin.set_width(this.actualWidth);
			this._currentOverlaySkin.set_height(this.actualHeight);
		}
		var oldIgnoreDrawerResize = this._ignoreDrawerResize;
		this._ignoreDrawerResize = true;
		if(this._drawer != null) {
			switch(this._pullableEdge._hx_index) {
			case 0:
				this._drawer.set_x(0.0);
				this._drawer.set_width(this.actualWidth);
				break;
			case 1:
				this._drawer.set_y(0.0);
				this._drawer.set_height(this.actualHeight);
				break;
			case 2:
				this._drawer.set_x(0.0);
				this._drawer.set_width(this.actualWidth);
				break;
			case 3:
				this._drawer.set_y(0.0);
				this._drawer.set_height(this.actualHeight);
				break;
			default:
				throw new openfl_errors_ArgumentError("Unknown pullable edge position: " + Std.string(this._pullableEdge));
			}
			if(js_Boot.__implements(this._drawer,feathers_core_IValidating)) {
				this._drawer.validateNow();
			}
			var maxPullDistance = 0.0;
			if(this._drawer != null) {
				switch(this._pullableEdge._hx_index) {
				case 0:
					maxPullDistance = this._drawer.get_height();
					break;
				case 1:
					maxPullDistance = this._drawer.get_width();
					break;
				case 2:
					maxPullDistance = this._drawer.get_height();
					break;
				case 3:
					maxPullDistance = this._drawer.get_width();
					break;
				default:
					throw new openfl_errors_ArgumentError("Unknown pullable edge position: " + Std.string(this._pullableEdge));
				}
			}
			this._edgePuller.set_maxPullDistance(maxPullDistance);
		}
		this._ignoreDrawerResize = oldIgnoreDrawerResize;
	}
	,updateWithPullDistance: function() {
		switch(this._pullableEdge._hx_index) {
		case 0:
			this._drawer.set_y(-this._drawer.get_height() + this._edgePuller.get_pullDistance());
			break;
		case 1:
			this._drawer.set_x(this.actualWidth - this._edgePuller.get_pullDistance());
			break;
		case 2:
			this._drawer.set_y(this.actualHeight - this._edgePuller.get_pullDistance());
			break;
		case 3:
			this._drawer.set_x(-this._drawer.get_width() + this._edgePuller.get_pullDistance());
			break;
		default:
			throw new openfl_errors_ArgumentError("Unknown pullable edge position: " + Std.string(this._pullableEdge));
		}
		if(this._currentOverlaySkin != null) {
			this._currentOverlaySkin.set_alpha(this._overlaySkinAlpha * (this._edgePuller.get_pullDistance() / this.getMaxPullDistance()));
		}
	}
	,getMaxPullDistance: function() {
		if(this._edgePuller.get_maxPullDistance() != null) {
			return this._edgePuller.get_maxPullDistance();
		}
		if(this._content == null) {
			return 0.0;
		}
		switch(this._pullableEdge._hx_index) {
		case 0:
			return this._content.get_height();
		case 1:
			return this._content.get_width();
		case 2:
			return this._content.get_height();
		case 3:
			return this._content.get_width();
		default:
			throw new openfl_errors_ArgumentError("Unknown pullable edge position: " + Std.string(this._pullableEdge));
		}
	}
	,clearFocusOnOpening: function() {
		if(this._focusManager != null) {
			if(this._focusManager.get_focus() == null) {
				return;
			}
			if(js_Boot.__implements(this._content,feathers_core_IFocusObject) && this._focusManager.get_focus() == this._content) {
				this._focusManager.set_focus(null);
			} else if(((this._content) instanceof openfl_display_DisplayObjectContainer) && this._content.contains(this._focusManager.get_focus())) {
				this._focusManager.set_focus(null);
			}
		}
		if(this.stage.get_focus() == null) {
			return;
		}
		if(this.stage.get_focus() == this._content || ((this._content) instanceof openfl_display_DisplayObjectContainer) && this._content.contains(this.stage.get_focus())) {
			this.stage.set_focus(this.stage);
		}
	}
	,drawer_edgePuller_openingHandler: function(event) {
		var touchPointID = this._edgePuller.get_touchPointID();
		if(touchPointID != null) {
			var exclusivePointer = feathers_utils_ExclusivePointer.forStage(this.stage);
			if(this._edgePuller.get_touchPointIsSimulated()) {
				var result = exclusivePointer.claimMouse(this);
				if(!result) {
					event.preventDefault();
					return;
				}
			} else {
				var result = exclusivePointer.claimTouch(touchPointID,this);
				if(!result) {
					event.preventDefault();
					return;
				}
			}
		}
		var result = feathers_events_FeathersEvent.dispatch(this,"opening");
		if(!result) {
			event.preventDefault();
			return;
		}
		this.clearFocusOnOpening();
		this.updateWithPullDistance();
		this._drawer.set_visible(true);
		if(this._currentOverlaySkin != null) {
			this._currentOverlaySkin.set_visible(true);
		}
	}
	,drawer_edgePuller_closingHandler: function(event) {
		var result = feathers_events_FeathersEvent.dispatch(this,"closing");
		if(!result) {
			event.preventDefault();
			return;
		}
		this.updateWithPullDistance();
		this._drawer.set_visible(true);
		if(this._currentOverlaySkin != null) {
			this._currentOverlaySkin.set_visible(true);
		}
	}
	,drawer_edgePuller_openHandler: function(event) {
		if(this._currentOverlaySkin != null) {
			this._currentOverlaySkin.set_alpha(this._overlaySkinAlpha);
			this._currentOverlaySkin.set_visible(true);
		}
		this._opened = true;
		feathers_events_FeathersEvent.dispatch(this,"open");
		this.setInvalid(feathers_core_InvalidationFlag.STATE);
	}
	,drawer_edgePuller_closeHandler: function(event) {
		this._drawer.set_visible(false);
		if(this._currentOverlaySkin != null) {
			this._currentOverlaySkin.set_alpha(this._overlaySkinAlpha);
			this._currentOverlaySkin.set_visible(false);
		}
		this._opened = false;
		feathers_events_FeathersEvent.dispatch(this,"close");
		this.setInvalid(feathers_core_InvalidationFlag.STATE);
	}
	,drawer_edgePuller_cancelHandler: function(event) {
		if(!this._opened) {
			this._drawer.set_visible(false);
			if(this._currentOverlaySkin != null) {
				this._currentOverlaySkin.set_alpha(this._overlaySkinAlpha);
				this._currentOverlaySkin.set_visible(false);
			}
		}
		feathers_events_FeathersEvent.dispatch(this,"cancel");
		this.setInvalid(feathers_core_InvalidationFlag.STATE);
	}
	,drawer_edgePuller_changeHandler: function(event) {
		this.updateWithPullDistance();
	}
	,drawer_addedToStageHandler: function(event) {
		if(this._autoSizeMode == feathers_layout_AutoSizeMode.STAGE) {
			this.setInvalid(feathers_core_InvalidationFlag.SIZE);
			this.addEventListener("removedFromStage",$bind(this,this.drawer_removedFromStageHandler));
			this.stage.addEventListener("resize",$bind(this,this.drawer_stage_resizeHandler));
		}
	}
	,drawer_removedFromStageHandler: function(event) {
		this.removeEventListener("removedFromStage",$bind(this,this.drawer_removedFromStageHandler));
		this.stage.removeEventListener("resize",$bind(this,this.drawer_stage_resizeHandler));
	}
	,drawer_stage_resizeHandler: function(event) {
		this.setInvalid(feathers_core_InvalidationFlag.SIZE);
	}
	,drawer_overlaySkin_mouseDownHandler: function(event) {
		if(!this._enabled) {
			return;
		}
		this._clickStartX = event.localX;
		this._clickStartY = event.localY;
	}
	,drawer_overlaySkin_clickHandler: function(event) {
		if(!this._enabled || !this._clickOverlayToClose) {
			return;
		}
		var movementX = Math.abs(event.localX - this._clickStartX);
		var movementY = Math.abs(event.localY - this._clickStartY);
		if(movementX > feathers_controls_Drawer.MAX_CLICK_DISTANCE_FOR_CLOSE || movementY > feathers_controls_Drawer.MAX_CLICK_DISTANCE_FOR_CLOSE) {
			return;
		}
		this.set_opened(false);
	}
	,drawer_overlaySkin_touchBeginHandler: function(event) {
		if(!this._enabled) {
			return;
		}
		if(event.isPrimaryTouchPoint) {
			return;
		}
		this._clickStartX = event.localX;
		this._clickStartY = event.localY;
	}
	,drawer_overlaySkin_touchTapHandler: function(event) {
		if(!this._enabled) {
			return;
		}
		if(event.isPrimaryTouchPoint) {
			return;
		}
		var movementX = Math.abs(event.localX - this._clickStartX);
		var movementY = Math.abs(event.localY - this._clickStartY);
		if(movementX > feathers_controls_Drawer.MAX_CLICK_DISTANCE_FOR_CLOSE || movementY > feathers_controls_Drawer.MAX_CLICK_DISTANCE_FOR_CLOSE) {
			return;
		}
		this.set_opened(false);
	}
	,drawer_drawer_resizeHandler: function(event) {
		if(this._ignoreDrawerResize) {
			return;
		}
		this.setInvalid(feathers_core_InvalidationFlag.SIZE);
	}
	,drawer_content_resizeHandler: function(event) {
		if(this._ignoreContentResize) {
			return;
		}
		this._contentMeasurements.save(this.get_content());
		this.setInvalid(feathers_core_InvalidationFlag.SIZE);
	}
	,__overlaySkin: null
	,get_overlaySkin: function() {
		return this.__overlaySkin;
	}
	,set_overlaySkin: function(value) {
		if(!this.setStyle("overlaySkin")) {
			return this.__overlaySkin;
		}
		if(this.__overlaySkin == value) {
			return this.__overlaySkin;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_overlaySkin);
		this.__overlaySkin = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__overlaySkin;
	}
	,clearStyle_overlaySkin: function() {
		this.set_overlaySkin(null);
		return this.get_overlaySkin();
	}
	,get_styleContext: function() {
		return feathers_controls_Drawer;
	}
	,__class__: feathers_controls_Drawer
	,__properties__: $extend(feathers_core_FeathersControl.prototype.__properties__,{set_animateOpenedProperty:"set_animateOpenedProperty",get_animateOpenedProperty:"get_animateOpenedProperty",set_swipeOpenEnabled:"set_swipeOpenEnabled",get_swipeOpenEnabled:"get_swipeOpenEnabled",set_swipeCloseEnabled:"set_swipeCloseEnabled",get_swipeCloseEnabled:"get_swipeCloseEnabled",set_clickOverlayToClose:"set_clickOverlayToClose",get_clickOverlayToClose:"get_clickOverlayToClose",set_overlaySkin:"set_overlaySkin",get_overlaySkin:"get_overlaySkin",set_simulateTouch:"set_simulateTouch",get_simulateTouch:"get_simulateTouch",set_autoSizeMode:"set_autoSizeMode",get_autoSizeMode:"get_autoSizeMode",set_opened:"set_opened",get_opened:"get_opened",set_pullableEdge:"set_pullableEdge",get_pullableEdge:"get_pullableEdge",set_content:"set_content",get_content:"get_content",set_drawer:"set_drawer",get_drawer:"get_drawer",get_focusExclusions:"get_focusExclusions"})
});
var com_tilbuci_Editor = function(path,nocache) {
	if(nocache == null) {
		nocache = true;
	}
	this._windows = new haxe_ds_StringMap();
	this._menus = new haxe_ds_StringMap();
	this._nocache = true;
	feathers_controls_Drawer.call(this);
	this.build = new com_tilbuci_data_BuildInfo();
	this._nocache = nocache;
	com_tilbuci_data_Global.econfig = new com_tilbuci_data_EditorConfig(path,$bind(this,this.onConfig),nocache);
};
$hxClasses["com.tilbuci.Editor"] = com_tilbuci_Editor;
com_tilbuci_Editor.__name__ = "com.tilbuci.Editor";
com_tilbuci_Editor.__super__ = feathers_controls_Drawer;
com_tilbuci_Editor.prototype = $extend(feathers_controls_Drawer.prototype,{
	build: null
	,_player: null
	,_nocache: null
	,_interface: null
	,_leftArea: null
	,_rightArea: null
	,_centertArea: null
	,_playerControls: null
	,_menus: null
	,_windows: null
	,_devTimer: null
	,_playback: null
	,registerPlugin: function(pl) {
		var this1 = com_tilbuci_data_Global.plugins;
		var k = pl.get_plname();
		this1.h[k] = pl;
		if(this._player != null) {
			this._player.player.registerPlugin(pl);
		}
	}
	,kill: function() {
		this.removeEventListener("resize",$bind(this,this.redraw));
		this.removeChildren();
		this.set_opened(false);
		this.set_drawer(null);
		this._interface.removeChildren();
		this._interface = null;
		this._leftArea.kill();
		this._leftArea = null;
		var h = this._menus.h;
		var mn_h = h;
		var mn_keys = Object.keys(h);
		var mn_length = mn_keys.length;
		var mn_current = 0;
		while(mn_current < mn_length) {
			var mn = mn_h[mn_keys[mn_current++]];
			mn.kill();
		}
		var h = this._menus.h;
		var mn_h = h;
		var mn_keys = Object.keys(h);
		var mn_length = mn_keys.length;
		var mn_current = 0;
		while(mn_current < mn_length) {
			var mn = mn_keys[mn_current++];
			var _this = this._menus;
			if(Object.prototype.hasOwnProperty.call(_this.h,mn)) {
				delete(_this.h[mn]);
			}
		}
		this._menus = null;
		var h = this._windows.h;
		var wd_h = h;
		var wd_keys = Object.keys(h);
		var wd_length = wd_keys.length;
		var wd_current = 0;
		while(wd_current < wd_length) {
			var wd = wd_h[wd_keys[wd_current++]];
			wd.kill();
		}
		var h = this._windows.h;
		var wd_h = h;
		var wd_keys = Object.keys(h);
		var wd_length = wd_keys.length;
		var wd_current = 0;
		while(wd_current < wd_length) {
			var wd = wd_keys[wd_current++];
			var _this = this._windows;
			if(Object.prototype.hasOwnProperty.call(_this.h,wd)) {
				delete(_this.h[wd]);
			}
		}
		this._windows = null;
		com_tilbuci_data_Global.econfig.kill();
		com_tilbuci_data_Global.econfig = null;
		com_tilbuci_data_Global.ln.kill();
		com_tilbuci_data_Global.ln = null;
		com_tilbuci_data_Global.ws.kill();
		com_tilbuci_data_Global.ws = null;
		com_tilbuci_data_Global.up.kill();
		com_tilbuci_data_Global.up = null;
	}
	,halt: function(cause) {
		this.removeChildren();
		var msg = "System down :-(";
		switch(cause) {
		case "config":
			com_tilbuci_data_Global.econfig.kill();
			com_tilbuci_data_Global.econfig = null;
			msg = "Error while loading the basic system configuration.";
			break;
		case "language":
			com_tilbuci_data_Global.econfig.kill();
			com_tilbuci_data_Global.econfig = null;
			com_tilbuci_data_Global.ln.kill();
			com_tilbuci_data_Global.ln = null;
			msg = "Error while loading the default language file.";
			break;
		case "sysconfig":
			com_tilbuci_data_Global.econfig.kill();
			com_tilbuci_data_Global.econfig = null;
			com_tilbuci_data_Global.ln.kill();
			com_tilbuci_data_Global.ln = null;
			com_tilbuci_data_Global.ws.kill();
			com_tilbuci_data_Global.ws = null;
			msg = "Error while loading the system configuration.";
			break;
		}
		var popup = new feathers_controls_Panel();
		popup.set_layout(new feathers_layout_AnchorLayout());
		popup.setPadding(10);
		var message = new feathers_controls_Label();
		message.set_text(msg);
		message.set_layoutData(feathers_layout_AnchorLayoutData.center());
		popup.addChild(message);
		feathers_core_PopUpManager.addPopUp(popup,this);
	}
	,onConfig: function(ok) {
		if(ok) {
			com_tilbuci_data_Global.ln = new com_tilbuci_data_Language();
			if(com_tilbuci_data_Global.ln.get_ok()) {
				com_tilbuci_data_Global.ws = new com_tilbuci_ws_Webservice(com_tilbuci_data_Global.econfig.get_ws());
				var params = new haxe_ds_StringMap();
				if(Main.us != "" && Main.uk != "") {
					var v = Main.us;
					params.h["us"] = v;
					var v = Main.uk;
					params.h["uk"] = v;
				}
				com_tilbuci_data_Global.ws.send("System/GetConfig",params,$bind(this,this.onSysConfig));
			} else {
				this.halt("language");
			}
		} else {
			this.halt("config");
		}
	}
	,onSysConfig: function(ok,ld) {
		if(!ok) {
			this.halt("sysconfig");
		} else if(ld.map.h["e"] != 0) {
			this.halt("sysconfig");
		} else {
			com_tilbuci_data_Global.singleUser = ld.map.h["singleUser"];
			com_tilbuci_data_Global.validEmail = ld.map.h["validEmail"];
			com_tilbuci_data_Global.showWindow = $bind(this,this.showWindow);
			if(Object.prototype.hasOwnProperty.call(ld.map.h,"host")) {
				com_tilbuci_data_Global.host = ld.map.h["host"];
			}
			var fnt = ld.map.h["fonts"];
			var _g = 0;
			var _g1 = fnt.length;
			while(_g < _g1) {
				var n = _g++;
				new com_tilbuci_font_EmbedFont(com_tilbuci_data_Global.econfig.get_font() + Std.string(fnt[n].v),fnt[n].n);
			}
			com_tilbuci_data_Global.acInfo = new com_tilbuci_script_ActionInfo();
			this.startInterface();
			if(ld.map.h["autouser"] != "" && ld.map.h["autokey"] != "") {
				com_tilbuci_data_Global.userLevel = ld.map.h["autolevel"];
				com_tilbuci_data_Global.ws.setUser(ld.map.h["autouser"],ld.map.h["autokey"],ld.map.h["autolevel"]);
			} else if(ld.map.h["singleUser"]) {
				com_tilbuci_data_Global.userLevel = 0;
				com_tilbuci_data_Global.ws.setUser("single",ld.map.h["userKey"],0);
			} else {
				this.showWindow("login");
			}
			com_tilbuci_data_Global.up = new com_tilbuci_data_FileUpload(this.stage);
			window.TBB_startTabsChannel($bind(this,this.onChannelMessage));
			this._devTimer = new haxe_Timer(1000);
			this._devTimer.run = $bind(this,this.devStart);
		}
	}
	,onChannelMessage: function(type,message) {
		if(type == "copy") {
			com_tilbuci_data_Global.copy.receiveMessage(message);
		}
	}
	,devStart: function() {
		try {
			this._devTimer.stop();
		} catch( _g ) {
		}
		this._devTimer = null;
		if(com_tilbuci_data_Global.ws.get_user() == "single") {
			if(Main.scene != "") {
				com_tilbuci_data_Global.sceneToLoad = Main.scene;
			}
			if(Main.movie != "") {
				this._player.player.load(Main.movie);
			}
		}
	}
	,startInterface: function() {
		com_tilbuci_data_Global.stage = this.stage;
		this._interface = new feathers_controls_HDividedBox();
		this._interface.set_layoutData(feathers_layout_AnchorLayoutData.fill());
		this._interface.set_backgroundSkin(new com_tilbuci_ui_base_BackgroundSkin());
		this.set_content(this._interface);
		this._leftArea = new com_tilbuci_ui_main_LeftInterface($bind(this,this.actionLeftInterface));
		this._centertArea = new feathers_controls_ScrollContainer();
		this._centertArea.set_layout(new feathers_layout_AnchorLayout());
		var centerSkin = new feathers_skins_RectangleSkin();
		centerSkin.set_fill(feathers_graphics_FillStyle.SolidColor(10066329));
		this._centertArea.set_backgroundSkin(centerSkin);
		this._player = new com_tilbuci_ui_PlayerHolder(com_tilbuci_data_Global.econfig.get_player(),$bind(this,this.playerCallback));
		this._playerControls = new com_tilbuci_ui_PlayerControls(this._player,$bind(this,this.playerCallback));
		this._centertArea.addChild(this._playerControls);
		var h = com_tilbuci_data_Global.plugins.h;
		var pl_h = h;
		var pl_keys = Object.keys(h);
		var pl_length = pl_keys.length;
		var pl_current = 0;
		while(pl_current < pl_length) {
			var pl = pl_h[pl_keys[pl_current++]];
			this._player.player.registerPlugin(pl);
		}
		com_tilbuci_data_Global.editorActions = $bind(this,this.editorActions);
		com_tilbuci_data_Global.history = new com_tilbuci_data_History();
		this._rightArea = new com_tilbuci_ui_main_RightInterface(($_=this._playerControls,$bind($_,$_.centerPlayer)),$bind(this,this.startWindow));
		var this1 = this._menus;
		var v = new com_tilbuci_ui_menu_MenuMovie($bind(this,this.actionMenuMovie));
		this1.h["left-movie"] = v;
		var this1 = this._menus;
		var v = new com_tilbuci_ui_menu_MenuScene($bind(this,this.actionMenuScene));
		this1.h["left-scene"] = v;
		var this1 = this._menus;
		var v = new com_tilbuci_ui_menu_MenuMedia($bind(this,this.actionMenuMedia));
		this1.h["left-media"] = v;
		var this1 = this._menus;
		var v = new com_tilbuci_ui_menu_MenuContraptions($bind(this,this.actionMenuContraptions));
		this1.h["left-contraptions"] = v;
		var this1 = this._menus;
		var v = new com_tilbuci_ui_menu_MenuNarrative($bind(this,this.actionMenuNarrative));
		this1.h["left-narrative"] = v;
		var this1 = this._menus;
		var v = new com_tilbuci_ui_menu_MenuExchange($bind(this,this.actionMenuExchange));
		this1.h["left-exchange"] = v;
		var this1 = this._menus;
		var v = new com_tilbuci_ui_menu_MenuKeyframe($bind(this,this.actionMenuKeyframe));
		this1.h["left-keyframe"] = v;
		this._playback = new com_tilbuci_ui_component_EditorPlayback(($_=this._playerControls,$bind($_,$_.centerPlayer)));
		this.addEventListener("resize",$bind(this,this.redraw));
		this.redraw();
	}
	,editorActions: function(name,data) {
		switch(name) {
		case "addleftbutton":
			this._leftArea.addButton(data.h["name"],data.h["callback"],data.h["top"],data.h["asset"]);
			return true;
		case "hidewindow":
			var wd = data.h["wd"];
			feathers_core_PopUpManager.removePopUp(wd);
			return true;
		case "showwindow":
			var wd = data.h["wd"];
			feathers_core_PopUpManager.addPopUp(wd,this);
			wd.redraw();
			wd.acStart();
			return true;
		default:
			return false;
		}
	}
	,actionLeftInterface: function(ac) {
		switch(ac) {
		case "close-interface":
			this.redraw();
			break;
		case "contraptions":
			this.set_drawer(this._menus.h["left-contraptions"]);
			this.set_opened(true);
			this._menus.h["left-contraptions"].onShow();
			break;
		case "exchange":
			this.set_drawer(this._menus.h["left-exchange"]);
			this.set_opened(true);
			this._menus.h["left-exchange"].onShow();
			break;
		case "keyframe":
			this.set_drawer(this._menus.h["left-keyframe"]);
			this.set_opened(true);
			this._menus.h["left-keyframe"].onShow();
			break;
		case "media":
			this.set_drawer(this._menus.h["left-media"]);
			this.set_opened(true);
			this._menus.h["left-media"].onShow();
			break;
		case "movie":
			this.set_drawer(this._menus.h["left-movie"]);
			this.set_opened(true);
			this._menus.h["left-movie"].onShow();
			break;
		case "narrative":
			this.set_drawer(this._menus.h["left-narrative"]);
			this.set_opened(true);
			this._menus.h["left-narrative"].onShow();
			break;
		case "open-interface":
			this.redraw();
			break;
		case "scene":
			this.set_drawer(this._menus.h["left-scene"]);
			this.set_opened(true);
			this._menus.h["left-scene"].onShow();
			break;
		case "setup":
			this.showWindow("setup");
			break;
		case "visitors":
			this.showWindow("visitors");
			break;
		}
	}
	,actionMenuMovie: function(ac) {
		switch(ac) {
		case "menu-close":
			this.set_opened(false);
			break;
		case "navigation":
			this.set_opened(false);
			this.showWindow("seqmovie");
			break;
		case "new":
			this.set_opened(false);
			this.showWindow("newmovie");
			break;
		case "notes":
			this.set_opened(false);
			this.showWindow("designnotes");
			break;
		case "open":
			this.set_opened(false);
			this.showWindow("openmovie");
			break;
		case "prop":
			this.set_opened(false);
			this.showWindow("propmovie");
			break;
		case "remove":
			this.set_opened(false);
			this.showWindow("removemovie");
			break;
		case "republish":
			this.set_opened(false);
			this.showWindow("republish");
			break;
		case "snippets":
			this.set_opened(false);
			this.showWindow("snippets");
			break;
		case "users":
			this.set_opened(false);
			this.showWindow("usermovie");
			break;
		case "window-notes":
			this.showWindow("designnotes");
			break;
		}
	}
	,actionMenuScene: function(ac) {
		switch(ac) {
		case "dflow":
			this.set_opened(false);
			this.showWindow("dflowscene");
			break;
		case "menu-close":
			this.set_opened(false);
			break;
		case "new":
			this.set_opened(false);
			this.showWindow("newscene");
			break;
		case "open":
			this.set_opened(false);
			this.showWindow("openscene");
			break;
		case "prop":
			this.set_opened(false);
			this.showWindow("propscene");
			break;
		case "publish":
			this.set_opened(false);
			this.saveScene(true);
			break;
		case "save":
			this.set_opened(false);
			this.saveScene();
			break;
		case "saveas":
			this.set_opened(false);
			this.showWindow("saveasscene");
			break;
		case "version":
			this.set_opened(false);
			this.showWindow("versionscene");
			break;
		case "window-notes":
			this.showWindow("designnotes");
			break;
		}
	}
	,actionMenuKeyframe: function(ac) {
		switch(ac) {
		case "add":
			this._player.addKeyframe();
			this.set_opened(false);
			break;
		case "manage":
			this.showWindow("kfmanage");
			this.set_opened(false);
			break;
		case "menu-close":
			this.set_opened(false);
			break;
		case "remove":
			if(com_tilbuci_data_GlobalPlayer.movie.scene.keyframes.length > 1) {
				this._player.removeKeyframe();
			} else {
				com_tilbuci_data_Global.showMsg(com_tilbuci_data_Global.ln.get("window-kfmanage-onlyone"));
			}
			this._playerControls.updateInfo();
			this.set_opened(false);
			break;
		case "window-notes":
			this.showWindow("designnotes");
			break;
		}
	}
	,startWindow: function(name,data) {
		switch(name) {
		case "assetbase":
			this.set_opened(false);
			this.showWindow("assetbase");
			this._windows.h["assetbase"].action("start",data);
			return true;
		case "collectionbase":
			this.set_opened(false);
			this.showWindow("collectionbase");
			this._windows.h["collectionbase"].action("start",data);
			return true;
		case "timedaction":
			this.set_opened(false);
			this.showWindow("timedaction");
			this._windows.h["timedaction"].action("start",data);
			return true;
		default:
			return false;
		}
	}
	,actionMenuMedia: function(ac) {
		switch(ac) {
		case "audio":
			this.set_opened(false);
			this.showWindow("mediaaudio");
			break;
		case "collection":
			this.set_opened(false);
			this.showWindow("mediacollection");
			break;
		case "collectionadd":
			this.set_opened(false);
			this.showWindow("mediacollectionadd");
			break;
		case "collectionrm":
			this.set_opened(false);
			this.showWindow("mediacollectionrm");
			break;
		case "embed":
			this.set_opened(false);
			this.showWindow("mediaembed");
			break;
		case "html":
			this.set_opened(false);
			this.showWindow("mediahtml");
			break;
		case "menu-close":
			this.set_opened(false);
			break;
		case "paragraph":
			this.set_opened(false);
			this.showWindow("mediaparagraph");
			break;
		case "picture":
			this.set_opened(false);
			this.showWindow("mediapicture");
			break;
		case "shape":
			this.set_opened(false);
			this.showWindow("mediashape");
			break;
		case "spritemap":
			this.set_opened(false);
			this.showWindow("mediaspritemap");
			break;
		case "strings":
			this.set_opened(false);
			this.showWindow("mediastrings");
			break;
		case "text":
			this.set_opened(false);
			this.showWindow("mediatext");
			break;
		case "video":
			this.set_opened(false);
			this.showWindow("mediavideo");
			break;
		case "window-notes":
			this.showWindow("designnotes");
			break;
		}
	}
	,actionMenuContraptions: function(ac) {
		switch(ac) {
		case "background":
			this.set_opened(false);
			this.showWindow("background");
			break;
		case "cover":
			this.set_opened(false);
			this.showWindow("cover");
			break;
		case "form":
			this.set_opened(false);
			this.showWindow("form");
			break;
		case "interfaces":
			this.set_opened(false);
			this.showWindow("interfaces");
			break;
		case "menu-close":
			this.set_opened(false);
			break;
		case "menus":
			this.set_opened(false);
			this.showWindow("menus");
			break;
		case "messages":
			this.set_opened(false);
			this.showWindow("messages");
			break;
		case "music":
			this.set_opened(false);
			this.showWindow("music");
			break;
		case "sound":
			this.set_opened(false);
			this.showWindow("sound");
			break;
		case "targets":
			this.set_opened(false);
			this.showWindow("targets");
			break;
		case "window-notes":
			this.showWindow("designnotes");
			break;
		}
	}
	,actionMenuNarrative: function(ac) {
		switch(ac) {
		case "battle":
			this.set_opened(false);
			this.showWindow("narrative-battle");
			break;
		case "char":
			this.set_opened(false);
			this.showWindow("narrative-char");
			break;
		case "dflow":
			this.set_opened(false);
			this.showWindow("narrative-dflow");
			break;
		case "diag":
			this.set_opened(false);
			this.showWindow("narrative-diag");
			break;
		case "inventory":
			this.set_opened(false);
			this.showWindow("narrative-inventory");
			break;
		case "menu-close":
			this.set_opened(false);
			break;
		case "window-notes":
			this.showWindow("designnotes");
			break;
		}
	}
	,actionMenuExchange: function(ac) {
		switch(ac) {
		case "cordova":
			this.set_opened(false);
			this.showWindow("exchangecord");
			break;
		case "desktop":
			this.set_opened(false);
			this.showWindow("exchangedesk");
			break;
		case "export":
			this.set_opened(false);
			this.showWindow("exchangeexport");
			break;
		case "iframe":
			this.set_opened(false);
			this.showWindow("exchangeiframe");
			break;
		case "import":
			this.set_opened(false);
			this.showWindow("exchangeimport");
			break;
		case "menu-close":
			this.set_opened(false);
			break;
		case "publish":
			this.set_opened(false);
			this.showWindow("exchangepub");
			break;
		case "pwa":
			this.set_opened(false);
			this.showWindow("exchangepwa");
			break;
		case "website":
			this.set_opened(false);
			this.showWindow("exchangewebsite");
			break;
		case "window-notes":
			this.showWindow("designnotes");
			break;
		}
	}
	,actionWindowSetup: function(ac,data) {
		switch(ac) {
		case "menu-close":
			this.set_opened(false);
			break;
		case "window-notes":
			this.showWindow("designnotes");
			break;
		}
	}
	,actionWindowTestingActions: function(ac,data) {
		switch(ac) {
		case "menu-close":
			this.set_opened(false);
			break;
		case "window-notes":
			this.showWindow("designnotes");
			break;
		}
	}
	,actionWindowVisitors: function(ac,data) {
		switch(ac) {
		case "menu-close":
			this.set_opened(false);
			break;
		case "window-notes":
			this.showWindow("designnotes");
			break;
		}
	}
	,actionWindowNotes: function(ac,data) {
		switch(ac) {
		case "menu-close":
			this.set_opened(false);
			break;
		case "window-notes":
			this.showWindow("designnotes");
			break;
		}
	}
	,actionWindowContrMenu: function(ac,data) {
		switch(ac) {
		case "menu-close":
			this.set_opened(false);
			break;
		case "menubrowseimgbg":
			var this1 = com_tilbuci_data_Global.temp;
			var _g = new haxe_ds_StringMap();
			_g.h["type"] = "picture";
			_g.h["call"] = "menubrowseimgbg";
			var v = _g;
			this1.h["Media/Single"] = v;
			this.showWindow("mediapicture");
			var tmp = this._windows.h["mediapicture"];
			var _g = new haxe_ds_StringMap();
			_g.h["mode"] = "single";
			tmp.action("setmode",_g);
			break;
		case "menubrowseimgbt":
			var this1 = com_tilbuci_data_Global.temp;
			var _g = new haxe_ds_StringMap();
			_g.h["type"] = "picture";
			_g.h["call"] = "menubrowseimgbt";
			var v = _g;
			this1.h["Media/Single"] = v;
			this.showWindow("mediapicture");
			var tmp = this._windows.h["mediapicture"];
			var _g = new haxe_ds_StringMap();
			_g.h["mode"] = "single";
			tmp.action("setmode",_g);
			break;
		case "window-notes":
			this.showWindow("designnotes");
			break;
		}
	}
	,actionWindowContrMessages: function(ac,data) {
		switch(ac) {
		case "menu-close":
			this.set_opened(false);
			break;
		case "messagesbrowseimgbg":
			var this1 = com_tilbuci_data_Global.temp;
			var _g = new haxe_ds_StringMap();
			_g.h["type"] = "picture";
			_g.h["call"] = "messagesbrowseimgbg";
			var v = _g;
			this1.h["Media/Single"] = v;
			this.showWindow("mediapicture");
			var tmp = this._windows.h["mediapicture"];
			var _g = new haxe_ds_StringMap();
			_g.h["mode"] = "single";
			tmp.action("setmode",_g);
			break;
		case "messagesbrowseimgbt0":
			var this1 = com_tilbuci_data_Global.temp;
			var _g = new haxe_ds_StringMap();
			_g.h["type"] = "picture";
			_g.h["call"] = "messagesbrowseimgbt0";
			var v = _g;
			this1.h["Media/Single"] = v;
			this.showWindow("mediapicture");
			var tmp = this._windows.h["mediapicture"];
			var _g = new haxe_ds_StringMap();
			_g.h["mode"] = "single";
			tmp.action("setmode",_g);
			break;
		case "messagesbrowseimgbt1":
			var this1 = com_tilbuci_data_Global.temp;
			var _g = new haxe_ds_StringMap();
			_g.h["type"] = "picture";
			_g.h["call"] = "messagesbrowseimgbt1";
			var v = _g;
			this1.h["Media/Single"] = v;
			this.showWindow("mediapicture");
			var tmp = this._windows.h["mediapicture"];
			var _g = new haxe_ds_StringMap();
			_g.h["mode"] = "single";
			tmp.action("setmode",_g);
			break;
		case "messagesbrowseimgbt2":
			var this1 = com_tilbuci_data_Global.temp;
			var _g = new haxe_ds_StringMap();
			_g.h["type"] = "picture";
			_g.h["call"] = "messagesbrowseimgbt2";
			var v = _g;
			this1.h["Media/Single"] = v;
			this.showWindow("mediapicture");
			var tmp = this._windows.h["mediapicture"];
			var _g = new haxe_ds_StringMap();
			_g.h["mode"] = "single";
			tmp.action("setmode",_g);
			break;
		case "window-notes":
			this.showWindow("designnotes");
			break;
		}
	}
	,actionWindowContrCover: function(ac,data) {
		switch(ac) {
		case "landscape":
			var this1 = com_tilbuci_data_Global.temp;
			var _g = new haxe_ds_StringMap();
			_g.h["type"] = "picture";
			_g.h["call"] = "landscapecover";
			var v = _g;
			this1.h["Media/Single"] = v;
			this.showWindow("mediapicture");
			var tmp = this._windows.h["mediapicture"];
			var _g = new haxe_ds_StringMap();
			_g.h["mode"] = "single";
			tmp.action("setmode",_g);
			break;
		case "menu-close":
			this.set_opened(false);
			break;
		case "portrait":
			var this1 = com_tilbuci_data_Global.temp;
			var _g = new haxe_ds_StringMap();
			_g.h["type"] = "picture";
			_g.h["call"] = "portraitcover";
			var v = _g;
			this1.h["Media/Single"] = v;
			this.showWindow("mediapicture");
			var tmp = this._windows.h["mediapicture"];
			var _g = new haxe_ds_StringMap();
			_g.h["mode"] = "single";
			tmp.action("setmode",_g);
			break;
		case "window-notes":
			this.showWindow("designnotes");
			break;
		}
	}
	,actionWindowContrBackground: function(ac,data) {
		switch(ac) {
		case "landscape":
			var this1 = com_tilbuci_data_Global.temp;
			var _g = new haxe_ds_StringMap();
			_g.h["type"] = "picture";
			_g.h["call"] = "landscapebackground";
			var v = _g;
			this1.h["Media/Single"] = v;
			this.showWindow("mediapicture");
			var tmp = this._windows.h["mediapicture"];
			var _g = new haxe_ds_StringMap();
			_g.h["mode"] = "single";
			tmp.action("setmode",_g);
			break;
		case "menu-close":
			this.set_opened(false);
			break;
		case "portrait":
			var this1 = com_tilbuci_data_Global.temp;
			var _g = new haxe_ds_StringMap();
			_g.h["type"] = "picture";
			_g.h["call"] = "portraitbackground";
			var v = _g;
			this1.h["Media/Single"] = v;
			this.showWindow("mediapicture");
			var tmp = this._windows.h["mediapicture"];
			var _g = new haxe_ds_StringMap();
			_g.h["mode"] = "single";
			tmp.action("setmode",_g);
			break;
		case "window-notes":
			this.showWindow("designnotes");
			break;
		}
	}
	,actionWindowContrTarget: function(ac,data) {
		switch(ac) {
		case "default":
			var this1 = com_tilbuci_data_Global.temp;
			var _g = new haxe_ds_StringMap();
			_g.h["type"] = "picture";
			_g.h["call"] = "targetdefault";
			var v = _g;
			this1.h["Media/Single"] = v;
			this.showWindow("mediapicture");
			var tmp = this._windows.h["mediapicture"];
			var _g = new haxe_ds_StringMap();
			_g.h["mode"] = "single";
			tmp.action("setmode",_g);
			break;
		case "inst1":
			var this1 = com_tilbuci_data_Global.temp;
			var _g = new haxe_ds_StringMap();
			_g.h["type"] = "picture";
			_g.h["call"] = "targetinst1";
			var v = _g;
			this1.h["Media/Single"] = v;
			this.showWindow("mediapicture");
			var tmp = this._windows.h["mediapicture"];
			var _g = new haxe_ds_StringMap();
			_g.h["mode"] = "single";
			tmp.action("setmode",_g);
			break;
		case "inst2":
			var this1 = com_tilbuci_data_Global.temp;
			var _g = new haxe_ds_StringMap();
			_g.h["type"] = "picture";
			_g.h["call"] = "targetinst2";
			var v = _g;
			this1.h["Media/Single"] = v;
			this.showWindow("mediapicture");
			var tmp = this._windows.h["mediapicture"];
			var _g = new haxe_ds_StringMap();
			_g.h["mode"] = "single";
			tmp.action("setmode",_g);
			break;
		case "inst3":
			var this1 = com_tilbuci_data_Global.temp;
			var _g = new haxe_ds_StringMap();
			_g.h["type"] = "picture";
			_g.h["call"] = "targetinst3";
			var v = _g;
			this1.h["Media/Single"] = v;
			this.showWindow("mediapicture");
			var tmp = this._windows.h["mediapicture"];
			var _g = new haxe_ds_StringMap();
			_g.h["mode"] = "single";
			tmp.action("setmode",_g);
			break;
		case "interf":
			var this1 = com_tilbuci_data_Global.temp;
			var _g = new haxe_ds_StringMap();
			_g.h["type"] = "picture";
			_g.h["call"] = "targetinterf";
			var v = _g;
			this1.h["Media/Single"] = v;
			this.showWindow("mediapicture");
			var tmp = this._windows.h["mediapicture"];
			var _g = new haxe_ds_StringMap();
			_g.h["mode"] = "single";
			tmp.action("setmode",_g);
			break;
		case "menu-close":
			this.set_opened(false);
			break;
		case "menus":
			var this1 = com_tilbuci_data_Global.temp;
			var _g = new haxe_ds_StringMap();
			_g.h["type"] = "picture";
			_g.h["call"] = "targetmenus";
			var v = _g;
			this1.h["Media/Single"] = v;
			this.showWindow("mediapicture");
			var tmp = this._windows.h["mediapicture"];
			var _g = new haxe_ds_StringMap();
			_g.h["mode"] = "single";
			tmp.action("setmode",_g);
			break;
		case "window-notes":
			this.showWindow("designnotes");
			break;
		}
	}
	,actionWindowContrForm: function(ac,data) {
		switch(ac) {
		case "formbackground":
			var this1 = com_tilbuci_data_Global.temp;
			var _g = new haxe_ds_StringMap();
			_g.h["type"] = "picture";
			_g.h["call"] = "formbackground";
			var v = _g;
			this1.h["Media/Single"] = v;
			this.showWindow("mediapicture");
			var tmp = this._windows.h["mediapicture"];
			var _g = new haxe_ds_StringMap();
			_g.h["mode"] = "single";
			tmp.action("setmode",_g);
			break;
		case "formbtcancel":
			var this1 = com_tilbuci_data_Global.temp;
			var _g = new haxe_ds_StringMap();
			_g.h["type"] = "picture";
			_g.h["call"] = "formbtcancel";
			var v = _g;
			this1.h["Media/Single"] = v;
			this.showWindow("mediapicture");
			var tmp = this._windows.h["mediapicture"];
			var _g = new haxe_ds_StringMap();
			_g.h["mode"] = "single";
			tmp.action("setmode",_g);
			break;
		case "formbtok":
			var this1 = com_tilbuci_data_Global.temp;
			var _g = new haxe_ds_StringMap();
			_g.h["type"] = "picture";
			_g.h["call"] = "formbtok";
			var v = _g;
			this1.h["Media/Single"] = v;
			this.showWindow("mediapicture");
			var tmp = this._windows.h["mediapicture"];
			var _g = new haxe_ds_StringMap();
			_g.h["mode"] = "single";
			tmp.action("setmode",_g);
			break;
		case "menu-close":
			this.set_opened(false);
			break;
		case "window-notes":
			this.showWindow("designnotes");
			break;
		}
	}
	,actionWindowContrInterf: function(ac,data) {
		switch(ac) {
		case "intanim":
			var this1 = com_tilbuci_data_Global.temp;
			var _g = new haxe_ds_StringMap();
			_g.h["type"] = "spritemap";
			_g.h["call"] = "intanim";
			var v = _g;
			this1.h["Media/Single"] = v;
			this.showWindow("mediaspritemap");
			var tmp = this._windows.h["mediaspritemap"];
			var _g = new haxe_ds_StringMap();
			_g.h["mode"] = "single";
			tmp.action("setmode",_g);
			break;
		case "intbackground":
			var this1 = com_tilbuci_data_Global.temp;
			var _g = new haxe_ds_StringMap();
			_g.h["type"] = "picture";
			_g.h["call"] = "intbackground";
			var v = _g;
			this1.h["Media/Single"] = v;
			this.showWindow("mediapicture");
			var tmp = this._windows.h["mediapicture"];
			var _g = new haxe_ds_StringMap();
			_g.h["mode"] = "single";
			tmp.action("setmode",_g);
			break;
		case "intimage":
			var this1 = com_tilbuci_data_Global.temp;
			var _g = new haxe_ds_StringMap();
			_g.h["type"] = "picture";
			_g.h["call"] = "intimage";
			var v = _g;
			this1.h["Media/Single"] = v;
			this.showWindow("mediapicture");
			var tmp = this._windows.h["mediapicture"];
			var _g = new haxe_ds_StringMap();
			_g.h["mode"] = "single";
			tmp.action("setmode",_g);
			break;
		case "menu-close":
			this.set_opened(false);
			break;
		case "window-notes":
			this.showWindow("designnotes");
			break;
		}
	}
	,actionWindowContrMusic: function(ac,data) {
		switch(ac) {
		case "menu-close":
			this.set_opened(false);
			break;
		case "music":
			var this1 = com_tilbuci_data_Global.temp;
			var _g = new haxe_ds_StringMap();
			_g.h["type"] = "audio";
			_g.h["call"] = "music";
			var v = _g;
			this1.h["Media/Single"] = v;
			this.showWindow("mediaaudio");
			var tmp = this._windows.h["mediaaudio"];
			var _g = new haxe_ds_StringMap();
			_g.h["mode"] = "single";
			tmp.action("setmode",_g);
			break;
		case "window-notes":
			this.showWindow("designnotes");
			break;
		}
	}
	,actionWindowContrSound: function(ac,data) {
		switch(ac) {
		case "menu-close":
			this.set_opened(false);
			break;
		case "sound":
			var this1 = com_tilbuci_data_Global.temp;
			var _g = new haxe_ds_StringMap();
			_g.h["type"] = "audio";
			_g.h["call"] = "sound";
			var v = _g;
			this1.h["Media/Single"] = v;
			this.showWindow("mediaaudio");
			var tmp = this._windows.h["mediaaudio"];
			var _g = new haxe_ds_StringMap();
			_g.h["mode"] = "single";
			tmp.action("setmode",_g);
			break;
		case "window-notes":
			this.showWindow("designnotes");
			break;
		}
	}
	,actionWindowNarrChar: function(ac,data) {
		switch(ac) {
		case "menu-close":
			this.set_opened(false);
			break;
		case "window-notes":
			this.showWindow("designnotes");
			break;
		}
	}
	,actionWindowNarrDflow: function(ac,data) {
		switch(ac) {
		case "dflowbrowseimgbt":
			var this1 = com_tilbuci_data_Global.temp;
			var _g = new haxe_ds_StringMap();
			_g.h["type"] = "picture";
			_g.h["call"] = "dflowbrowseimgbt";
			var v = _g;
			this1.h["Media/Single"] = v;
			this.showWindow("mediapicture");
			var tmp = this._windows.h["mediapicture"];
			var _g = new haxe_ds_StringMap();
			_g.h["mode"] = "single";
			tmp.action("setmode",_g);
			break;
		case "menu-close":
			this.set_opened(false);
			break;
		case "window-notes":
			this.showWindow("designnotes");
			break;
		}
	}
	,actionWindowNarrInventory: function(ac,data) {
		switch(ac) {
		case "inventclose":
			var this1 = com_tilbuci_data_Global.temp;
			var _g = new haxe_ds_StringMap();
			_g.h["type"] = "picture";
			_g.h["call"] = "inventclose";
			var v = _g;
			this1.h["Media/Single"] = v;
			this.showWindow("mediapicture");
			var tmp = this._windows.h["mediapicture"];
			var _g = new haxe_ds_StringMap();
			_g.h["mode"] = "single";
			tmp.action("setmode",_g);
			break;
		case "inventh":
			var this1 = com_tilbuci_data_Global.temp;
			var _g = new haxe_ds_StringMap();
			_g.h["type"] = "picture";
			_g.h["call"] = "inventh";
			var v = _g;
			this1.h["Media/Single"] = v;
			this.showWindow("mediapicture");
			var tmp = this._windows.h["mediapicture"];
			var _g = new haxe_ds_StringMap();
			_g.h["mode"] = "single";
			tmp.action("setmode",_g);
			break;
		case "inventitem":
			var this1 = com_tilbuci_data_Global.temp;
			var _g = new haxe_ds_StringMap();
			_g.h["type"] = "picture";
			_g.h["call"] = "inventitem";
			var v = _g;
			this1.h["Media/Single"] = v;
			this.showWindow("mediapicture");
			var tmp = this._windows.h["mediapicture"];
			var _g = new haxe_ds_StringMap();
			_g.h["mode"] = "single";
			tmp.action("setmode",_g);
			break;
		case "inventv":
			var this1 = com_tilbuci_data_Global.temp;
			var _g = new haxe_ds_StringMap();
			_g.h["type"] = "picture";
			_g.h["call"] = "inventv";
			var v = _g;
			this1.h["Media/Single"] = v;
			this.showWindow("mediapicture");
			var tmp = this._windows.h["mediapicture"];
			var _g = new haxe_ds_StringMap();
			_g.h["mode"] = "single";
			tmp.action("setmode",_g);
			break;
		case "menu-close":
			this.set_opened(false);
			break;
		case "window-notes":
			this.showWindow("designnotes");
			break;
		}
	}
	,actionWindowNarrBattle: function(ac,data) {
		switch(ac) {
		case "battleattr":
			var this1 = com_tilbuci_data_Global.temp;
			var _g = new haxe_ds_StringMap();
			_g.h["type"] = "picture";
			_g.h["call"] = "battleattr";
			var v = _g;
			this1.h["Media/Single"] = v;
			this.showWindow("mediapicture");
			var tmp = this._windows.h["mediapicture"];
			var _g = new haxe_ds_StringMap();
			_g.h["mode"] = "single";
			tmp.action("setmode",_g);
			break;
		case "battleclose":
			var this1 = com_tilbuci_data_Global.temp;
			var _g = new haxe_ds_StringMap();
			_g.h["type"] = "picture";
			_g.h["call"] = "battleclose";
			var v = _g;
			this1.h["Media/Single"] = v;
			this.showWindow("mediapicture");
			var tmp = this._windows.h["mediapicture"];
			var _g = new haxe_ds_StringMap();
			_g.h["mode"] = "single";
			tmp.action("setmode",_g);
			break;
		case "battleh":
			var this1 = com_tilbuci_data_Global.temp;
			var _g = new haxe_ds_StringMap();
			_g.h["type"] = "picture";
			_g.h["call"] = "battleh";
			var v = _g;
			this1.h["Media/Single"] = v;
			this.showWindow("mediapicture");
			var tmp = this._windows.h["mediapicture"];
			var _g = new haxe_ds_StringMap();
			_g.h["mode"] = "single";
			tmp.action("setmode",_g);
			break;
		case "battlev":
			var this1 = com_tilbuci_data_Global.temp;
			var _g = new haxe_ds_StringMap();
			_g.h["type"] = "picture";
			_g.h["call"] = "battlev";
			var v = _g;
			this1.h["Media/Single"] = v;
			this.showWindow("mediapicture");
			var tmp = this._windows.h["mediapicture"];
			var _g = new haxe_ds_StringMap();
			_g.h["mode"] = "single";
			tmp.action("setmode",_g);
			break;
		case "imgcard":
			var this1 = com_tilbuci_data_Global.temp;
			var _g = new haxe_ds_StringMap();
			_g.h["type"] = "picture";
			_g.h["call"] = "imgcard";
			var v = _g;
			this1.h["Media/Single"] = v;
			this.showWindow("mediapicture");
			var tmp = this._windows.h["mediapicture"];
			var _g = new haxe_ds_StringMap();
			_g.h["mode"] = "single";
			tmp.action("setmode",_g);
			break;
		case "itgraphic":
			var this1 = com_tilbuci_data_Global.temp;
			var _g = new haxe_ds_StringMap();
			_g.h["type"] = "picture";
			_g.h["call"] = "itgraphic";
			var v = _g;
			this1.h["Media/Single"] = v;
			this.showWindow("mediapicture");
			var tmp = this._windows.h["mediapicture"];
			var _g = new haxe_ds_StringMap();
			_g.h["mode"] = "single";
			tmp.action("setmode",_g);
			break;
		case "menu-close":
			this.set_opened(false);
			break;
		case "window-notes":
			this.showWindow("designnotes");
			break;
		}
	}
	,actionWindowDiagChar: function(ac,data) {
		switch(ac) {
		case "audio":
			var this1 = com_tilbuci_data_Global.temp;
			var _g = new haxe_ds_StringMap();
			_g.h["type"] = "audio";
			_g.h["call"] = "audiodialogue";
			var v = _g;
			this1.h["Media/Single"] = v;
			this.showWindow("mediaaudio");
			var tmp = this._windows.h["mediaaudio"];
			var _g = new haxe_ds_StringMap();
			_g.h["mode"] = "single";
			tmp.action("setmode",_g);
			break;
		case "menu-close":
			this.set_opened(false);
			break;
		case "window-notes":
			this.showWindow("designnotes");
			break;
		}
	}
	,actionMovie: function(ac,data) {
		switch(ac) {
		case "browsefavicon":
			var this1 = com_tilbuci_data_Global.temp;
			var _g = new haxe_ds_StringMap();
			_g.h["type"] = "´picture";
			_g.h["call"] = "browsefavicon";
			var v = _g;
			this1.h["Media/Single"] = v;
			this.showWindow("mediapicture");
			var tmp = this._windows.h["mediapicture"];
			var _g = new haxe_ds_StringMap();
			_g.h["mode"] = "single";
			tmp.action("setmode",_g);
			break;
		case "browseimage":
			var this1 = com_tilbuci_data_Global.temp;
			var _g = new haxe_ds_StringMap();
			_g.h["type"] = "´picture";
			_g.h["call"] = "browseimage";
			var v = _g;
			this1.h["Media/Single"] = v;
			this.showWindow("mediapicture");
			var tmp = this._windows.h["mediapicture"];
			var _g = new haxe_ds_StringMap();
			_g.h["mode"] = "single";
			tmp.action("setmode",_g);
			break;
		case "browseloadingic":
			var this1 = com_tilbuci_data_Global.temp;
			var _g = new haxe_ds_StringMap();
			_g.h["type"] = "spritemap";
			_g.h["call"] = "browseloadingic";
			var v = _g;
			this1.h["Media/Single"] = v;
			this.showWindow("mediaspritemap");
			var tmp = this._windows.h["mediaspritemap"];
			var _g = new haxe_ds_StringMap();
			_g.h["mode"] = "single";
			tmp.action("setmode",_g);
			break;
		case "menu-close":
			this.set_opened(false);
			break;
		case "movieload":
			this._player.player.load(data.h["id"]);
			break;
		case "window-notes":
			this.showWindow("designnotes");
			break;
		}
	}
	,actionScene: function(ac,data) {
		switch(ac) {
		case "browsesceneimage":
			var this1 = com_tilbuci_data_Global.temp;
			var _g = new haxe_ds_StringMap();
			_g.h["type"] = "picture";
			_g.h["call"] = "browsesceneimage";
			var v = _g;
			this1.h["Media/Single"] = v;
			this.showWindow("mediapicture");
			var tmp = this._windows.h["mediapicture"];
			var _g = new haxe_ds_StringMap();
			_g.h["mode"] = "single";
			tmp.action("setmode",_g);
			break;
		case "menu-close":
			this.set_opened(false);
			break;
		case "sceneload":
			if(com_tilbuci_data_GlobalPlayer.movie.get_mvId() != "") {
				com_tilbuci_data_GlobalPlayer.movie.loadScene(data.h["id"]);
			}
			break;
		case "sceneversionload":
			if(com_tilbuci_data_GlobalPlayer.movie.get_mvId() != "") {
				com_tilbuci_data_GlobalPlayer.movie.loadScene(null,data.h["id"]);
			}
			break;
		case "window-notes":
			this.showWindow("designnotes");
			break;
		}
	}
	,actionExchange: function(ac,data) {
		switch(ac) {
		case "browsecordovaicon":
			var this1 = com_tilbuci_data_Global.temp;
			var _g = new haxe_ds_StringMap();
			_g.h["type"] = "picture";
			_g.h["call"] = "browsecordovaicon";
			var v = _g;
			this1.h["Media/Single"] = v;
			this.showWindow("mediapicture");
			var tmp = this._windows.h["mediapicture"];
			var _g = new haxe_ds_StringMap();
			_g.h["mode"] = "single";
			tmp.action("setmode",_g);
			break;
		case "menu-close":
			this.set_opened(false);
			break;
		case "window-notes":
			this.showWindow("designnotes");
			break;
		}
	}
	,actionAssistant: function(ac,data) {
		switch(ac) {
		case "menu-close":
			this.set_opened(false);
			break;
		case "window-notes":
			this.showWindow("designnotes");
			break;
		}
	}
	,actionKeyframe: function(ac,data) {
		switch(ac) {
		case "add":
			this._player.addKeyframe();
			this._playerControls.reCenter();
			this._playerControls.updateInfo();
			break;
		case "menu-close":
			this.set_opened(false);
			break;
		case "reload":
			this._playerControls.reCenter();
			this._playerControls.updateInfo();
			break;
		case "remove":
			this._player.removeKeyframe();
			this._playerControls.reCenter();
			this._playerControls.updateInfo();
			break;
		case "window-notes":
			this.showWindow("designnotes");
			break;
		}
	}
	,saveScene: function(pub) {
		if(pub == null) {
			pub = false;
		}
		var cols = { };
		var h = com_tilbuci_data_GlobalPlayer.movie.collections.h;
		var k_h = h;
		var k_keys = Object.keys(h);
		var k_length = k_keys.length;
		var k_current = 0;
		while(k_current < k_length) {
			var k = k_keys[k_current++];
			cols[k] = com_tilbuci_data_GlobalPlayer.movie.collections.h[k].toJson();
		}
		var tmp = com_tilbuci_data_Global.ws;
		var _g = new haxe_ds_StringMap();
		var value = com_tilbuci_data_GlobalPlayer.movie.get_mvId();
		_g.h["movie"] = value;
		var value = com_tilbuci_data_GlobalPlayer.movie.get_scId();
		_g.h["id"] = value;
		var value = com_tilbuci_data_GlobalPlayer.movie.scene.toJson();
		_g.h["scene"] = value;
		_g.h["collections"] = cols;
		_g.h["pub"] = pub;
		tmp.send("Scene/Save",_g,$bind(this,this.onSaveReturn));
	}
	,onSaveReturn: function(ok,ld) {
		if(!ok) {
			com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("scene-save-windowtitle"),com_tilbuci_data_Global.ln.get("scene-save-error"),300,180,com_tilbuci_data_Global.ln.get("default-ok"));
		} else if(ld.map.h["e"] == 0) {
			if(!ld.map.h["pub"]) {
				com_tilbuci_data_Global.showMsg(com_tilbuci_data_Global.ln.get("scene-save-ok"));
			} else {
				com_tilbuci_data_Global.showMsg(com_tilbuci_data_Global.ln.get("scene-save-okpublish"));
			}
		} else {
			com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("scene-save-windowtitle"),com_tilbuci_data_Global.ln.get("scene-save-error"),300,180,com_tilbuci_data_Global.ln.get("default-ok"));
		}
	}
	,actionCollection: function(ac,data) {
		if(ac == "window-notes") {
			this.showWindow("designnotes");
		}
	}
	,actionTimed: function(ac,data) {
		if(ac == "window-notes") {
			this.showWindow("designnotes");
		}
	}
	,actionAsset: function(ac,data) {
		switch(ac) {
		case "file":
			switch(data.h["type"]) {
			case "audio":
				this.showWindow("mediaaudio");
				var tmp = this._windows.h["mediaaudio"];
				var _g = new haxe_ds_StringMap();
				_g.h["mode"] = "assetsingle";
				_g.h["num"] = data.h["num"];
				tmp.action("setmode",_g);
				break;
			case "html":
				this.showWindow("mediahtml");
				var tmp = this._windows.h["mediahtml"];
				var _g = new haxe_ds_StringMap();
				_g.h["mode"] = "assetsingle";
				_g.h["num"] = data.h["num"];
				tmp.action("setmode",_g);
				break;
			case "paragraph":
				this.showWindow("mediaparagraph");
				var tmp = this._windows.h["mediaparagraph"];
				var _g = new haxe_ds_StringMap();
				_g.h["mode"] = "assetsingle";
				_g.h["num"] = data.h["num"];
				_g.h["current"] = data.h["current"];
				tmp.action("setmode",_g);
				break;
			case "picture":
				this.showWindow("mediapicture");
				var tmp = this._windows.h["mediapicture"];
				var _g = new haxe_ds_StringMap();
				_g.h["mode"] = "assetsingle";
				_g.h["num"] = data.h["num"];
				tmp.action("setmode",_g);
				break;
			case "shape":
				this.showWindow("mediashape");
				var tmp = this._windows.h["mediashape"];
				var _g = new haxe_ds_StringMap();
				_g.h["mode"] = "assetsingle";
				_g.h["num"] = data.h["num"];
				_g.h["current"] = data.h["current"];
				tmp.action("setmode",_g);
				break;
			case "spritemap":
				this.showWindow("mediaspritemap");
				var tmp = this._windows.h["mediaspritemap"];
				var _g = new haxe_ds_StringMap();
				_g.h["mode"] = "assetsingle";
				_g.h["num"] = data.h["num"];
				tmp.action("setmode",_g);
				break;
			case "text":
				this.showWindow("mediatext");
				var tmp = this._windows.h["mediatext"];
				var _g = new haxe_ds_StringMap();
				_g.h["mode"] = "assetsingle";
				_g.h["num"] = data.h["num"];
				_g.h["current"] = data.h["current"];
				tmp.action("setmode",_g);
				break;
			case "video":
				this.showWindow("mediavideo");
				var tmp = this._windows.h["mediavideo"];
				var _g = new haxe_ds_StringMap();
				_g.h["mode"] = "assetsingle";
				_g.h["num"] = data.h["num"];
				tmp.action("setmode",_g);
				break;
			}
			break;
		case "window-notes":
			this.showWindow("designnotes");
			break;
		}
	}
	,actionMedia: function(ac,data) {
		switch(ac) {
		case "addasset":
			var tmp = this._windows.h["mediacollection"];
			var _g = new haxe_ds_StringMap();
			_g.h["file"] = data.h["path"] + data.h["file"];
			_g.h["num"] = data.h["num"];
			_g.h["frames"] = data.h["frames"];
			_g.h["frtime"] = data.h["frtime"];
			tmp.action("setfile",_g);
			break;
		case "addcollection":
			break;
		case "addinstance":
			var instid = HxOverrides.substr(com_tilbuci_statictools_StringStatic.md5(data.h["asset"]),0,10);
			while(true) {
				var this1 = com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[com_tilbuci_data_GlobalPlayer.area.get_currentKf()];
				if(!Object.prototype.hasOwnProperty.call(this1.h,instid)) {
					break;
				}
				instid = HxOverrides.substr(com_tilbuci_statictools_StringStatic.md5(instid),0,10);
			}
			var ordH = -1;
			var ordV = -1;
			if(Lambda.count(com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[com_tilbuci_data_GlobalPlayer.area.get_currentKf()]) > 0) {
				var h = com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[com_tilbuci_data_GlobalPlayer.area.get_currentKf()].h;
				var i_h = h;
				var i_keys = Object.keys(h);
				var i_length = i_keys.length;
				var i_current = 0;
				while(i_current < i_length) {
					var i = i_keys[i_current++];
					if(com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[com_tilbuci_data_GlobalPlayer.area.get_currentKf()].h[i].horizontal.order > ordH) {
						ordH = com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[com_tilbuci_data_GlobalPlayer.area.get_currentKf()].h[i].horizontal.order + 1;
					}
					if(com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[com_tilbuci_data_GlobalPlayer.area.get_currentKf()].h[i].vertical.order > ordV) {
						ordV = com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[com_tilbuci_data_GlobalPlayer.area.get_currentKf()].h[i].vertical.order + 1;
					}
				}
			} else {
				ordV = 0;
				ordH = ordV;
			}
			this._player.addInstance(instid,{ collection : data.h["collection"], asset : data.h["asset"], action : "", play : true, horizontal : { order : ordH, x : 0, y : 0, alpha : 1, width : 320, height : 320, rotation : 0, visible : true, color : "0xFFFFFF", colorAlpha : 0, volume : 1, pan : 0, blur : "", dropshadow : "", textFont : "sans", textSize : 20, textColor : "0xFFFFFF", textBold : false, textItalic : false, textLeading : 10, textSpacing : 0, textBackground : "", textAlign : "left"}, vertical : { order : ordV, x : 0, y : 0, alpha : 1, width : 320, height : 320, rotation : 0, visible : true, color : "0xFFFFFF", colorAlpha : 0, volume : 1, pan : 0, blur : "", dropshadow : "", textFont : "sans", textSize : 20, textColor : "0xFFFFFF", textBold : false, textItalic : false, textLeading : 10, textSpacing : 0, textBackground : "", textAlign : "left"}});
			break;
		case "addnewasset":
			var tmp = this._windows.h["mediacollection"];
			var _g = new haxe_ds_StringMap();
			_g.h["file"] = data.h["path"] + data.h["file"];
			_g.h["type"] = data.h["type"];
			_g.h["name"] = data.h["file"];
			_g.h["frames"] = data.h["frames"];
			_g.h["frtime"] = data.h["frtime"];
			tmp.action("addasset",_g);
			break;
		case "addstage":
			com_tilbuci_data_Global.temp.h["media/addstage"] = data;
			if(data.h["type"] == "shape") {
				this._player.createCollection(com_tilbuci_data_Global.ln.get("menu-media-shape") + " " + HxOverrides.dateStr(new Date()),$bind(this,this.onMediaAddStage),data.h["file"]);
			} else if(data.h["type"] == "paragraph") {
				this._player.createCollection(com_tilbuci_data_Global.ln.get("menu-media-paragraph") + " " + HxOverrides.dateStr(new Date()),$bind(this,this.onMediaAddStage),data.h["file"]);
			} else if(data.h["type"] == "text") {
				this._player.createCollection(com_tilbuci_data_Global.ln.get("menu-media-text") + " " + HxOverrides.dateStr(new Date()),$bind(this,this.onMediaAddStage),data.h["file"]);
			} else {
				this._player.createCollection(data.h["file"],$bind(this,this.onMediaAddStage),data.h["file"]);
			}
			break;
		case "addtocol":
			var astname = "media";
			if(data.h["type"] == "shape") {
				astname = com_tilbuci_data_Global.ln.get("menu-media-shape");
			} else if(data.h["type"] == "paragraph") {
				astname = com_tilbuci_data_Global.ln.get("menu-media-paragraph");
			} else if(data.h["type"] == "text") {
				astname = com_tilbuci_data_Global.ln.get("menu-media-text");
			} else {
				astname = data.h["file"];
			}
			var idast = HxOverrides.substr(com_tilbuci_statictools_StringStatic.md5(astname),0,10);
			while(Object.prototype.hasOwnProperty.call(com_tilbuci_data_GlobalPlayer.movie.collections.h[data.h["col"]].assets.h,idast)) idast = HxOverrides.substr(com_tilbuci_statictools_StringStatic.md5(idast),0,10);
			var this1 = com_tilbuci_data_GlobalPlayer.movie.collections.h[data.h["col"]].assets;
			var v = new com_tilbuci_def_AssetData({ name : astname, type : data.h["type"], order : Lambda.count(com_tilbuci_data_GlobalPlayer.movie.collections.h[data.h["col"]].assets), time : 5, action : "loop", frames : Std.parseInt(data.h["frames"]), frtime : Std.parseInt(data.h["frtime"]), file : { "@1" : data.h["path"] + data.h["file"], "@2" : data.h["path"] + data.h["file"], "@3" : data.h["path"] + data.h["file"], "@4" : data.h["path"] + data.h["file"], "@5" : data.h["path"] + data.h["file"]}});
			this1.h[idast] = v;
			com_tilbuci_data_GlobalPlayer.movie.collections.h[data.h["col"]].assetOrder.push(idast);
			if(data.h["stage"] == "true") {
				var instid = HxOverrides.substr(com_tilbuci_statictools_StringStatic.md5(idast),0,10);
				while(true) {
					var this1 = com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[com_tilbuci_data_GlobalPlayer.area.get_currentKf()];
					if(!Object.prototype.hasOwnProperty.call(this1.h,instid)) {
						break;
					}
					instid = HxOverrides.substr(com_tilbuci_statictools_StringStatic.md5(instid),0,10);
				}
				var ordH = -1;
				var ordV = -1;
				if(Lambda.count(com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[com_tilbuci_data_GlobalPlayer.area.get_currentKf()]) > 0) {
					var h = com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[com_tilbuci_data_GlobalPlayer.area.get_currentKf()].h;
					var i_h = h;
					var i_keys = Object.keys(h);
					var i_length = i_keys.length;
					var i_current = 0;
					while(i_current < i_length) {
						var i = i_keys[i_current++];
						if(com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[com_tilbuci_data_GlobalPlayer.area.get_currentKf()].h[i].horizontal.order > ordH) {
							ordH = com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[com_tilbuci_data_GlobalPlayer.area.get_currentKf()].h[i].horizontal.order + 1;
						}
						if(com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[com_tilbuci_data_GlobalPlayer.area.get_currentKf()].h[i].vertical.order > ordV) {
							ordV = com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[com_tilbuci_data_GlobalPlayer.area.get_currentKf()].h[i].vertical.order + 1;
						}
					}
				} else {
					ordV = 0;
					ordH = ordV;
				}
				this._player.addInstance(instid,{ collection : data.h["col"], asset : idast, action : "", play : true, horizontal : { order : ordH, x : 0, y : 0, alpha : 1, width : 320, height : 320, rotation : 0, visible : true, color : "0xFFFFFF", colorAlpha : 0, volume : 1, pan : 0, blur : "", dropshadow : "", textFont : "sans", textSize : 20, textColor : "0xFFFFFF", textBold : false, textItalic : false, textLeading : 10, textSpacing : 0, textBackground : "", textAlign : "left"}, vertical : { order : ordV, x : 0, y : 0, alpha : 1, width : 320, height : 320, rotation : 0, visible : true, color : "0xFFFFFF", colorAlpha : 0, volume : 1, pan : 0, blur : "", dropshadow : "", textFont : "sans", textSize : 20, textColor : "0xFFFFFF", textBold : false, textItalic : false, textLeading : 10, textSpacing : 0, textBackground : "", textAlign : "left"}});
			}
			break;
		case "assetsingle":
			var tmp = this._windows.h["assetbase"];
			var _g = new haxe_ds_StringMap();
			_g.h["file"] = data.h["path"] + data.h["file"];
			_g.h["type"] = data.h["type"];
			_g.h["name"] = data.h["file"];
			_g.h["frames"] = data.h["frames"];
			_g.h["frtime"] = data.h["frtime"];
			tmp.action("setfile",_g);
			break;
		case "file":
			switch(data.h["type"]) {
			case "audio":
				this.showWindow("mediaaudio");
				var tmp = this._windows.h["mediaaudio"];
				var _g = new haxe_ds_StringMap();
				_g.h["mode"] = "asset";
				_g.h["num"] = data.h["num"];
				tmp.action("setmode",_g);
				break;
			case "html":
				this.showWindow("mediahtml");
				var tmp = this._windows.h["mediahtml"];
				var _g = new haxe_ds_StringMap();
				_g.h["mode"] = "asset";
				_g.h["num"] = data.h["num"];
				tmp.action("setmode",_g);
				break;
			case "paragraph":
				this.showWindow("mediaparagraph");
				var tmp = this._windows.h["mediaparagraph"];
				var _g = new haxe_ds_StringMap();
				_g.h["mode"] = "asset";
				_g.h["num"] = data.h["num"];
				_g.h["current"] = data.h["current"];
				tmp.action("setmode",_g);
				break;
			case "picture":
				this.showWindow("mediapicture");
				var tmp = this._windows.h["mediapicture"];
				var _g = new haxe_ds_StringMap();
				_g.h["mode"] = "asset";
				_g.h["num"] = data.h["num"];
				tmp.action("setmode",_g);
				break;
			case "shape":
				this.showWindow("mediashape");
				var tmp = this._windows.h["mediashape"];
				var _g = new haxe_ds_StringMap();
				_g.h["mode"] = "asset";
				_g.h["num"] = data.h["num"];
				_g.h["current"] = data.h["current"];
				tmp.action("setmode",_g);
				break;
			case "spritemap":
				this.showWindow("mediaspritemap");
				var tmp = this._windows.h["mediaspritemap"];
				var _g = new haxe_ds_StringMap();
				_g.h["mode"] = "asset";
				_g.h["num"] = data.h["num"];
				tmp.action("setmode",_g);
				break;
			case "text":
				this.showWindow("mediatext");
				var tmp = this._windows.h["mediatext"];
				var _g = new haxe_ds_StringMap();
				_g.h["mode"] = "asset";
				_g.h["num"] = data.h["num"];
				_g.h["current"] = data.h["current"];
				tmp.action("setmode",_g);
				break;
			case "video":
				this.showWindow("mediavideo");
				var tmp = this._windows.h["mediavideo"];
				var _g = new haxe_ds_StringMap();
				_g.h["mode"] = "asset";
				_g.h["num"] = data.h["num"];
				tmp.action("setmode",_g);
				break;
			}
			break;
		case "menu-close":
			this.set_opened(false);
			break;
		case "newasset":
			switch(data.h["type"]) {
			case "audio":
				this.showWindow("mediaaudio");
				var tmp = this._windows.h["mediaaudio"];
				var _g = new haxe_ds_StringMap();
				_g.h["mode"] = "newasset";
				tmp.action("setmode",_g);
				break;
			case "html":
				this.showWindow("mediahtml");
				var tmp = this._windows.h["mediahtml"];
				var _g = new haxe_ds_StringMap();
				_g.h["mode"] = "newasset";
				tmp.action("setmode",_g);
				break;
			case "paragraph":
				this.showWindow("mediaparagraph");
				var tmp = this._windows.h["mediaparagraph"];
				var _g = new haxe_ds_StringMap();
				_g.h["mode"] = "newasset";
				tmp.action("setmode",_g);
				break;
			case "picture":
				this.showWindow("mediapicture");
				var tmp = this._windows.h["mediapicture"];
				var _g = new haxe_ds_StringMap();
				_g.h["mode"] = "newasset";
				tmp.action("setmode",_g);
				break;
			case "shape":
				this.showWindow("mediashape");
				var tmp = this._windows.h["mediashape"];
				var _g = new haxe_ds_StringMap();
				_g.h["mode"] = "newasset";
				tmp.action("setmode",_g);
				break;
			case "spritemap":
				this.showWindow("mediaspritemap");
				var tmp = this._windows.h["mediaspritemap"];
				var _g = new haxe_ds_StringMap();
				_g.h["mode"] = "newasset";
				tmp.action("setmode",_g);
				break;
			case "text":
				this.showWindow("mediatext");
				var tmp = this._windows.h["mediatext"];
				var _g = new haxe_ds_StringMap();
				_g.h["mode"] = "newasset";
				tmp.action("setmode",_g);
				break;
			case "video":
				this.showWindow("mediavideo");
				var tmp = this._windows.h["mediavideo"];
				var _g = new haxe_ds_StringMap();
				_g.h["mode"] = "newasset";
				tmp.action("setmode",_g);
				break;
			}
			break;
		case "single":
			if(Object.prototype.hasOwnProperty.call(com_tilbuci_data_Global.temp.h,"Media/Single")) {
				switch(com_tilbuci_data_Global.temp.h["Media/Single"].h["call"]) {
				case "audiodialogue":
					var tmp = this._windows.h["narrative-diag"];
					var _g = new haxe_ds_StringMap();
					_g.h["file"] = data.h["path"] + data.h["file"];
					_g.h["type"] = data.h["type"];
					_g.h["name"] = data.h["file"];
					tmp.action("audio",_g);
					break;
				case "battleattr":
					var tmp = this._windows.h["narrative-battle"];
					var _g = new haxe_ds_StringMap();
					_g.h["file"] = data.h["path"] + data.h["file"];
					_g.h["type"] = data.h["type"];
					_g.h["name"] = data.h["file"];
					tmp.action("battleattr",_g);
					break;
				case "battleclose":
					var tmp = this._windows.h["narrative-battle"];
					var _g = new haxe_ds_StringMap();
					_g.h["file"] = data.h["path"] + data.h["file"];
					_g.h["type"] = data.h["type"];
					_g.h["name"] = data.h["file"];
					tmp.action("battleclose",_g);
					break;
				case "battleh":
					var tmp = this._windows.h["narrative-battle"];
					var _g = new haxe_ds_StringMap();
					_g.h["file"] = data.h["path"] + data.h["file"];
					_g.h["type"] = data.h["type"];
					_g.h["name"] = data.h["file"];
					tmp.action("battleh",_g);
					break;
				case "battlev":
					var tmp = this._windows.h["narrative-battle"];
					var _g = new haxe_ds_StringMap();
					_g.h["file"] = data.h["path"] + data.h["file"];
					_g.h["type"] = data.h["type"];
					_g.h["name"] = data.h["file"];
					tmp.action("battlev",_g);
					break;
				case "browsecordovaicon":
					var tmp = this._windows.h["exchangecord"];
					var _g = new haxe_ds_StringMap();
					_g.h["file"] = data.h["path"] + data.h["file"];
					_g.h["type"] = data.h["type"];
					_g.h["name"] = data.h["file"];
					tmp.action("browsecordovaicon",_g);
					break;
				case "browsefavicon":
					var tmp = this._windows.h["propmovie"];
					var _g = new haxe_ds_StringMap();
					_g.h["file"] = data.h["path"] + data.h["file"];
					_g.h["type"] = data.h["type"];
					_g.h["name"] = data.h["file"];
					tmp.action("browsefavicon",_g);
					break;
				case "browseimage":
					var tmp = this._windows.h["propmovie"];
					var _g = new haxe_ds_StringMap();
					_g.h["file"] = data.h["path"] + data.h["file"];
					_g.h["type"] = data.h["type"];
					_g.h["name"] = data.h["file"];
					tmp.action("browseimage",_g);
					break;
				case "browseloadingic":
					var tmp = this._windows.h["propmovie"];
					var _g = new haxe_ds_StringMap();
					_g.h["file"] = data.h["path"] + data.h["file"];
					_g.h["type"] = data.h["type"];
					_g.h["name"] = data.h["file"];
					_g.h["frames"] = data.h["frames"];
					_g.h["frtime"] = data.h["frtime"];
					tmp.action("browseloadingic",_g);
					break;
				case "browsesceneimage":
					var tmp = this._windows.h["propscene"];
					var _g = new haxe_ds_StringMap();
					_g.h["file"] = data.h["path"] + data.h["file"];
					_g.h["type"] = data.h["type"];
					_g.h["name"] = data.h["file"];
					tmp.action("browsesceneimage",_g);
					break;
				case "dflowbrowseimgbt":
					var tmp = this._windows.h["narrative-dflow"];
					var _g = new haxe_ds_StringMap();
					_g.h["file"] = data.h["path"] + data.h["file"];
					_g.h["type"] = data.h["type"];
					_g.h["name"] = data.h["file"];
					tmp.action("dflowbrowseimgbt",_g);
					break;
				case "formbackground":
					var tmp = this._windows.h["form"];
					var _g = new haxe_ds_StringMap();
					_g.h["file"] = data.h["path"] + data.h["file"];
					_g.h["type"] = data.h["type"];
					_g.h["name"] = data.h["file"];
					tmp.action("formbackground",_g);
					break;
				case "formbtcancel":
					var tmp = this._windows.h["form"];
					var _g = new haxe_ds_StringMap();
					_g.h["file"] = data.h["path"] + data.h["file"];
					_g.h["type"] = data.h["type"];
					_g.h["name"] = data.h["file"];
					tmp.action("formbtcancel",_g);
					break;
				case "formbtok":
					var tmp = this._windows.h["form"];
					var _g = new haxe_ds_StringMap();
					_g.h["file"] = data.h["path"] + data.h["file"];
					_g.h["type"] = data.h["type"];
					_g.h["name"] = data.h["file"];
					tmp.action("formbtok",_g);
					break;
				case "imgcard":
					var tmp = this._windows.h["narrative-battle"];
					var _g = new haxe_ds_StringMap();
					_g.h["file"] = data.h["path"] + data.h["file"];
					_g.h["type"] = data.h["type"];
					_g.h["name"] = data.h["file"];
					tmp.action("imgcard",_g);
					break;
				case "intanim":
					var tmp = this._windows.h["interfaces"];
					var _g = new haxe_ds_StringMap();
					_g.h["file"] = data.h["path"] + data.h["file"];
					_g.h["type"] = data.h["type"];
					_g.h["name"] = data.h["file"];
					_g.h["frames"] = data.h["frames"];
					_g.h["frtime"] = data.h["frtime"];
					tmp.action("intanim",_g);
					break;
				case "intbackground":
					var tmp = this._windows.h["interfaces"];
					var _g = new haxe_ds_StringMap();
					_g.h["file"] = data.h["path"] + data.h["file"];
					_g.h["type"] = data.h["type"];
					_g.h["name"] = data.h["file"];
					tmp.action("intbackground",_g);
					break;
				case "intimage":
					var tmp = this._windows.h["interfaces"];
					var _g = new haxe_ds_StringMap();
					_g.h["file"] = data.h["path"] + data.h["file"];
					_g.h["type"] = data.h["type"];
					_g.h["name"] = data.h["file"];
					tmp.action("intimage",_g);
					break;
				case "inventclose":
					var tmp = this._windows.h["narrative-inventory"];
					var _g = new haxe_ds_StringMap();
					_g.h["file"] = data.h["path"] + data.h["file"];
					_g.h["type"] = data.h["type"];
					_g.h["name"] = data.h["file"];
					tmp.action("inventclose",_g);
					break;
				case "inventh":
					var tmp = this._windows.h["narrative-inventory"];
					var _g = new haxe_ds_StringMap();
					_g.h["file"] = data.h["path"] + data.h["file"];
					_g.h["type"] = data.h["type"];
					_g.h["name"] = data.h["file"];
					tmp.action("inventh",_g);
					break;
				case "inventitem":
					var tmp = this._windows.h["narrative-inventory"];
					var _g = new haxe_ds_StringMap();
					_g.h["file"] = data.h["path"] + data.h["file"];
					_g.h["type"] = data.h["type"];
					_g.h["name"] = data.h["file"];
					tmp.action("inventitem",_g);
					break;
				case "inventv":
					var tmp = this._windows.h["narrative-inventory"];
					var _g = new haxe_ds_StringMap();
					_g.h["file"] = data.h["path"] + data.h["file"];
					_g.h["type"] = data.h["type"];
					_g.h["name"] = data.h["file"];
					tmp.action("inventv",_g);
					break;
				case "itgraphic":
					var tmp = this._windows.h["narrative-battle"];
					var _g = new haxe_ds_StringMap();
					_g.h["file"] = data.h["path"] + data.h["file"];
					_g.h["type"] = data.h["type"];
					_g.h["name"] = data.h["file"];
					tmp.action("itgraphic",_g);
					break;
				case "landscapebackground":
					var tmp = this._windows.h["background"];
					var _g = new haxe_ds_StringMap();
					_g.h["file"] = data.h["path"] + data.h["file"];
					_g.h["type"] = data.h["type"];
					_g.h["name"] = data.h["file"];
					tmp.action("landscape",_g);
					break;
				case "landscapecover":
					var tmp = this._windows.h["cover"];
					var _g = new haxe_ds_StringMap();
					_g.h["file"] = data.h["path"] + data.h["file"];
					_g.h["type"] = data.h["type"];
					_g.h["name"] = data.h["file"];
					tmp.action("landscape",_g);
					break;
				case "menubrowseimgbg":
					var tmp = this._windows.h["menus"];
					var _g = new haxe_ds_StringMap();
					_g.h["file"] = data.h["path"] + data.h["file"];
					_g.h["type"] = data.h["type"];
					_g.h["name"] = data.h["file"];
					tmp.action("menubrowseimgbg",_g);
					break;
				case "menubrowseimgbt":
					var tmp = this._windows.h["menus"];
					var _g = new haxe_ds_StringMap();
					_g.h["file"] = data.h["path"] + data.h["file"];
					_g.h["type"] = data.h["type"];
					_g.h["name"] = data.h["file"];
					tmp.action("menubrowseimgbt",_g);
					break;
				case "messagesbrowseimgbg":
					var tmp = this._windows.h["messages"];
					var _g = new haxe_ds_StringMap();
					_g.h["file"] = data.h["path"] + data.h["file"];
					_g.h["type"] = data.h["type"];
					_g.h["name"] = data.h["file"];
					tmp.action("messagesbrowseimgbg",_g);
					break;
				case "messagesbrowseimgbt0":
					var tmp = this._windows.h["messages"];
					var _g = new haxe_ds_StringMap();
					_g.h["file"] = data.h["path"] + data.h["file"];
					_g.h["type"] = data.h["type"];
					_g.h["name"] = data.h["file"];
					tmp.action("messagesbrowseimgbt0",_g);
					break;
				case "messagesbrowseimgbt1":
					var tmp = this._windows.h["messages"];
					var _g = new haxe_ds_StringMap();
					_g.h["file"] = data.h["path"] + data.h["file"];
					_g.h["type"] = data.h["type"];
					_g.h["name"] = data.h["file"];
					tmp.action("messagesbrowseimgbt1",_g);
					break;
				case "messagesbrowseimgbt2":
					var tmp = this._windows.h["messages"];
					var _g = new haxe_ds_StringMap();
					_g.h["file"] = data.h["path"] + data.h["file"];
					_g.h["type"] = data.h["type"];
					_g.h["name"] = data.h["file"];
					tmp.action("messagesbrowseimgbt2",_g);
					break;
				case "music":
					var tmp = this._windows.h["music"];
					var _g = new haxe_ds_StringMap();
					_g.h["file"] = data.h["path"] + data.h["file"];
					_g.h["type"] = data.h["type"];
					_g.h["name"] = data.h["file"];
					tmp.action("music",_g);
					break;
				case "portraitbackground":
					var tmp = this._windows.h["background"];
					var _g = new haxe_ds_StringMap();
					_g.h["file"] = data.h["path"] + data.h["file"];
					_g.h["type"] = data.h["type"];
					_g.h["name"] = data.h["file"];
					tmp.action("portrait",_g);
					break;
				case "portraitcover":
					var tmp = this._windows.h["cover"];
					var _g = new haxe_ds_StringMap();
					_g.h["file"] = data.h["path"] + data.h["file"];
					_g.h["type"] = data.h["type"];
					_g.h["name"] = data.h["file"];
					tmp.action("portrait",_g);
					break;
				case "sound":
					var tmp = this._windows.h["sound"];
					var _g = new haxe_ds_StringMap();
					_g.h["file"] = data.h["path"] + data.h["file"];
					_g.h["type"] = data.h["type"];
					_g.h["name"] = data.h["file"];
					tmp.action("sound",_g);
					break;
				case "targetdefault":
					var tmp = this._windows.h["targets"];
					var _g = new haxe_ds_StringMap();
					_g.h["file"] = data.h["path"] + data.h["file"];
					_g.h["type"] = data.h["type"];
					_g.h["name"] = data.h["file"];
					tmp.action("default",_g);
					break;
				case "targetinst1":
					var tmp = this._windows.h["targets"];
					var _g = new haxe_ds_StringMap();
					_g.h["file"] = data.h["path"] + data.h["file"];
					_g.h["type"] = data.h["type"];
					_g.h["name"] = data.h["file"];
					tmp.action("inst1",_g);
					break;
				case "targetinst2":
					var tmp = this._windows.h["targets"];
					var _g = new haxe_ds_StringMap();
					_g.h["file"] = data.h["path"] + data.h["file"];
					_g.h["type"] = data.h["type"];
					_g.h["name"] = data.h["file"];
					tmp.action("inst2",_g);
					break;
				case "targetinst3":
					var tmp = this._windows.h["targets"];
					var _g = new haxe_ds_StringMap();
					_g.h["file"] = data.h["path"] + data.h["file"];
					_g.h["type"] = data.h["type"];
					_g.h["name"] = data.h["file"];
					tmp.action("inst3",_g);
					break;
				case "targetinterf":
					var tmp = this._windows.h["targets"];
					var _g = new haxe_ds_StringMap();
					_g.h["file"] = data.h["path"] + data.h["file"];
					_g.h["type"] = data.h["type"];
					_g.h["name"] = data.h["file"];
					tmp.action("interf",_g);
					break;
				case "targetmenus":
					var tmp = this._windows.h["targets"];
					var _g = new haxe_ds_StringMap();
					_g.h["file"] = data.h["path"] + data.h["file"];
					_g.h["type"] = data.h["type"];
					_g.h["name"] = data.h["file"];
					tmp.action("menus",_g);
					break;
				}
				var _this = com_tilbuci_data_Global.temp;
				if(Object.prototype.hasOwnProperty.call(_this.h,"Media/Single")) {
					delete(_this.h["Media/Single"]);
				}
			}
			break;
		case "window-notes":
			this.showWindow("designnotes");
			break;
		}
	}
	,onMediaAddStage: function(ok,ld) {
		if(ok) {
			if(ld.map.h["e"] == 0) {
				if(Object.prototype.hasOwnProperty.call(com_tilbuci_data_Global.temp.h,"media/addstage")) {
					var aid = com_tilbuci_data_Global.temp.h["media/addstage"].h["file"];
					var instname = com_tilbuci_data_Global.temp.h["media/addstage"].h["file"];
					if(com_tilbuci_data_Global.temp.h["media/addstage"].h["type"] == "shape") {
						instname = com_tilbuci_data_Global.ln.get("menu-media-shape");
					} else if(com_tilbuci_data_Global.temp.h["media/addstage"].h["type"] == "paragraph") {
						instname = com_tilbuci_data_Global.ln.get("menu-media-paragraph");
					} else if(com_tilbuci_data_Global.temp.h["media/addstage"].h["type"] == "text") {
						instname = com_tilbuci_data_Global.ln.get("menu-media-text");
					}
					aid = HxOverrides.substr(com_tilbuci_statictools_StringStatic.md5(aid),0,10);
					var tmp = this._player;
					var tmp1 = ld.map.h["id"];
					var tmp2 = ld.map.h["name"];
					var _g = new haxe_ds_StringMap();
					_g.h[aid] = { name : instname, type : com_tilbuci_data_Global.temp.h["media/addstage"].h["type"], order : 0, time : 5, action : "", frames : Std.parseInt(com_tilbuci_data_Global.temp.h["media/addstage"].h["frames"]), frtime : Std.parseInt(com_tilbuci_data_Global.temp.h["media/addstage"].h["frtime"]), file : { "@1" : com_tilbuci_data_Global.temp.h["media/addstage"].h["path"] + com_tilbuci_data_Global.temp.h["media/addstage"].h["file"], "@2" : com_tilbuci_data_Global.temp.h["media/addstage"].h["path"] + com_tilbuci_data_Global.temp.h["media/addstage"].h["file"], "@3" : com_tilbuci_data_Global.temp.h["media/addstage"].h["path"] + com_tilbuci_data_Global.temp.h["media/addstage"].h["file"], "@4" : com_tilbuci_data_Global.temp.h["media/addstage"].h["path"] + com_tilbuci_data_Global.temp.h["media/addstage"].h["file"], "@5" : com_tilbuci_data_Global.temp.h["media/addstage"].h["path"] + com_tilbuci_data_Global.temp.h["media/addstage"].h["file"]}};
					tmp.setCollection(tmp1,tmp2,"alpha",1,_g);
					var ordH = -1;
					var ordV = -1;
					if(Lambda.count(com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[com_tilbuci_data_GlobalPlayer.area.get_currentKf()]) > 0) {
						var h = com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[com_tilbuci_data_GlobalPlayer.area.get_currentKf()].h;
						var i_h = h;
						var i_keys = Object.keys(h);
						var i_length = i_keys.length;
						var i_current = 0;
						while(i_current < i_length) {
							var i = i_keys[i_current++];
							if(com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[com_tilbuci_data_GlobalPlayer.area.get_currentKf()].h[i].horizontal.order > ordH) {
								ordH = com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[com_tilbuci_data_GlobalPlayer.area.get_currentKf()].h[i].horizontal.order + 1;
							}
							if(com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[com_tilbuci_data_GlobalPlayer.area.get_currentKf()].h[i].vertical.order > ordV) {
								ordV = com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[com_tilbuci_data_GlobalPlayer.area.get_currentKf()].h[i].vertical.order + 1;
							}
						}
					} else {
						ordV = 0;
						ordH = ordV;
					}
					this._player.addInstance(aid,{ collection : ld.map.h["id"], asset : aid, action : "", play : true, horizontal : { order : ordH, x : 0, y : 0, alpha : 1, width : 320, height : 320, rotation : 0, visible : true, color : "0xFFFFFF", colorAlpha : 0, volume : 1, pan : 0, blur : "", dropshadow : "", textFont : "sans", textSize : 20, textColor : "0xFFFFFF", textBold : false, textItalic : false, textLeading : 10, textSpacing : 0, textBackground : "", textAlign : "left"}, vertical : { order : ordV, x : 0, y : 0, alpha : 1, width : 320, height : 320, rotation : 0, visible : true, color : "0xFFFFFF", colorAlpha : 0, volume : 1, pan : 0, blur : "", dropshadow : "", textFont : "sans", textSize : 20, textColor : "0xFFFFFF", textBold : false, textItalic : false, textLeading : 10, textSpacing : 0, textBackground : "", textAlign : "left"}});
					var _this = com_tilbuci_data_Global.temp;
					if(Object.prototype.hasOwnProperty.call(_this.h,"media/addstage")) {
						delete(_this.h["media/addstage"]);
					}
				} else {
					com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("window-media-title"),com_tilbuci_data_Global.ln.get("window-media-addstageer"),300,180,com_tilbuci_data_Global.ln.get("default-ok"));
				}
			} else {
				com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("window-media-title"),com_tilbuci_data_Global.ln.get("window-media-addstageer"),300,180,com_tilbuci_data_Global.ln.get("default-ok"));
			}
		} else {
			com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("window-media-title"),com_tilbuci_data_Global.ln.get("window-media-addstageer"),300,180,com_tilbuci_data_Global.ln.get("default-ok"));
		}
	}
	,actionWindowLogin: function(ac,data) {
		if(ac == "check-login") {
			com_tilbuci_data_Global.ws.send("System/Login",data,$bind(this,this.onLogin));
		}
	}
	,onLogin: function(ok,ld) {
		if(!ok) {
			this._windows.h["login"].action("login-error");
		} else {
			switch(ld.map.h["e"]) {
			case 0:
				com_tilbuci_data_Global.ws.setUser(ld.map.h["userMail"],ld.map.h["userKey"],ld.map.h["userLevel"]);
				this._windows.h["login"].action("login-ok");
				feathers_core_PopUpManager.removePopUp(this._windows.h["login"]);
				break;
			case 1:
				this._windows.h["login"].action("login-notfound");
				break;
			case 2:
				this._windows.h["login"].action("login-password");
				break;
			case 3:
				this._windows.h["login"].action("login-nokey");
				break;
			}
		}
	}
	,redraw: function(evt) {
		this._interface.removeChildren();
		this._interface.addChild(this._leftArea);
		this._interface.addChild(this._centertArea);
		this._interface.addChild(this._rightArea);
		var h = this._windows.h;
		var wd_h = h;
		var wd_keys = Object.keys(h);
		var wd_length = wd_keys.length;
		var wd_current = 0;
		while(wd_current < wd_length) {
			var wd = wd_h[wd_keys[wd_current++]];
			wd.set_maxWidth(this.stage.stageWidth * 0.7);
			wd.set_maxHeight(this.stage.stageHeight * 0.6);
		}
	}
	,showWindow: function(name) {
		if(Object.prototype.hasOwnProperty.call(this._windows.h,name)) {
			feathers_core_PopUpManager.addPopUp(this._windows.h[name],this);
			this._windows.h[name].redraw();
			this._windows.h[name].acStart();
			return true;
		} else {
			var ok = true;
			switch(name) {
			case "assetbase":
				var this1 = this._windows;
				var v = new com_tilbuci_ui_window_media_WindowAssetBase($bind(this,this.actionAsset));
				this1.h["assetbase"] = v;
				break;
			case "assistantcontraptions":
				var this1 = this._windows;
				var v = new com_tilbuci_script_AssistContraptions($bind(this,this.actionAssistant));
				this1.h["assistantcontraptions"] = v;
				break;
			case "assistantdata":
				var this1 = this._windows;
				var v = new com_tilbuci_script_AssistDataInput($bind(this,this.actionAssistant));
				this1.h["assistantdata"] = v;
				break;
			case "assistantinstance":
				var this1 = this._windows;
				var v = new com_tilbuci_script_AssistInstance($bind(this,this.actionAssistant));
				this1.h["assistantinstance"] = v;
				break;
			case "assistantnarrative":
				var this1 = this._windows;
				var v = new com_tilbuci_script_AssistNarrative($bind(this,this.actionAssistant));
				this1.h["assistantnarrative"] = v;
				break;
			case "assistantplugin":
				var this1 = this._windows;
				var v = new com_tilbuci_script_AssistPlugin($bind(this,this.actionAssistant));
				this1.h["assistantplugin"] = v;
				break;
			case "assistantplus":
				var this1 = this._windows;
				var v = new com_tilbuci_script_AssistPlus($bind(this,this.actionAssistant));
				this1.h["assistantplus"] = v;
				break;
			case "assistantruntime":
				var this1 = this._windows;
				var v = new com_tilbuci_script_AssistRuntime($bind(this,this.actionAssistant));
				this1.h["assistantruntime"] = v;
				break;
			case "assistantscene":
				var this1 = this._windows;
				var v = new com_tilbuci_script_AssistScene($bind(this,this.actionAssistant));
				this1.h["assistantscene"] = v;
				break;
			case "assistantvariables":
				var this1 = this._windows;
				var v = new com_tilbuci_script_AssistVariables($bind(this,this.actionAssistant));
				this1.h["assistantvariables"] = v;
				break;
			case "background":
				var this1 = this._windows;
				var v = new com_tilbuci_ui_window_contraptions_WindowContrBackground($bind(this,this.actionWindowContrBackground));
				this1.h["background"] = v;
				break;
			case "collectionbase":
				var this1 = this._windows;
				var v = new com_tilbuci_ui_window_media_WindowCollectionBase($bind(this,this.actionCollection));
				this1.h["collectionbase"] = v;
				break;
			case "cover":
				var this1 = this._windows;
				var v = new com_tilbuci_ui_window_contraptions_WindowContrCover($bind(this,this.actionWindowContrCover));
				this1.h["cover"] = v;
				break;
			case "designnotes":
				var this1 = this._windows;
				var v = new com_tilbuci_ui_window_WindowNotes($bind(this,this.actionWindowNotes));
				this1.h["designnotes"] = v;
				break;
			case "dflowscene":
				var this1 = this._windows;
				var v = new com_tilbuci_ui_window_scene_WindowSceneDflow($bind(this,this.actionScene));
				this1.h["dflowscene"] = v;
				break;
			case "exchangecord":
				var this1 = this._windows;
				var v = new com_tilbuci_ui_window_exchange_WindowExchangeCordova($bind(this,this.actionExchange));
				this1.h["exchangecord"] = v;
				break;
			case "exchangedesk":
				var this1 = this._windows;
				var v = new com_tilbuci_ui_window_exchange_WindowExchangeDesktop($bind(this,this.actionExchange));
				this1.h["exchangedesk"] = v;
				break;
			case "exchangeexport":
				var this1 = this._windows;
				var v = new com_tilbuci_ui_window_exchange_WindowExchangeExport($bind(this,this.actionExchange));
				this1.h["exchangeexport"] = v;
				break;
			case "exchangeiframe":
				var this1 = this._windows;
				var v = new com_tilbuci_ui_window_exchange_WindowExchangeIframe($bind(this,this.actionExchange));
				this1.h["exchangeiframe"] = v;
				break;
			case "exchangeimport":
				var this1 = this._windows;
				var v = new com_tilbuci_ui_window_exchange_WindowExchangeImport($bind(this,this.actionExchange));
				this1.h["exchangeimport"] = v;
				break;
			case "exchangepub":
				var this1 = this._windows;
				var v = new com_tilbuci_ui_window_exchange_WindowExchangePublish($bind(this,this.actionExchange));
				this1.h["exchangepub"] = v;
				break;
			case "exchangepwa":
				var this1 = this._windows;
				var v = new com_tilbuci_ui_window_exchange_WindowExchangePwa($bind(this,this.actionExchange));
				this1.h["exchangepwa"] = v;
				break;
			case "exchangewebsite":
				var this1 = this._windows;
				var v = new com_tilbuci_ui_window_exchange_WindowExchangeWebsite($bind(this,this.actionExchange));
				this1.h["exchangewebsite"] = v;
				break;
			case "form":
				var this1 = this._windows;
				var v = new com_tilbuci_ui_window_contraptions_WindowContrForm($bind(this,this.actionWindowContrForm));
				this1.h["form"] = v;
				break;
			case "interfaces":
				var this1 = this._windows;
				var v = new com_tilbuci_ui_window_contraptions_WindowContrInterf($bind(this,this.actionWindowContrInterf));
				this1.h["interfaces"] = v;
				break;
			case "kfmanage":
				var this1 = this._windows;
				var v = new com_tilbuci_ui_window_keyframe_WindowKeyframeManage($bind(this,this.actionKeyframe));
				this1.h["kfmanage"] = v;
				break;
			case "login":
				var this1 = this._windows;
				var v = new com_tilbuci_ui_window_WindowLogin($bind(this,this.actionWindowLogin));
				this1.h["login"] = v;
				break;
			case "mediaaudio":
				var this1 = this._windows;
				var v = new com_tilbuci_ui_window_media_WindowMediaAudio($bind(this,this.actionMedia),"simple");
				this1.h["mediaaudio"] = v;
				break;
			case "mediacollection":
				var this1 = this._windows;
				var v = new com_tilbuci_ui_window_media_WindowCollections($bind(this,this.actionMedia));
				this1.h["mediacollection"] = v;
				break;
			case "mediacollectionadd":
				var this1 = this._windows;
				var v = new com_tilbuci_ui_window_media_WindowCollectionsAdd($bind(this,this.actionMedia));
				this1.h["mediacollectionadd"] = v;
				break;
			case "mediacollectionrm":
				var this1 = this._windows;
				var v = new com_tilbuci_ui_window_media_WindowCollectionsRm($bind(this,this.actionMedia));
				this1.h["mediacollectionrm"] = v;
				break;
			case "mediaembed":
				var this1 = this._windows;
				var v = new com_tilbuci_ui_window_media_WindowMediaEmbed($bind(this,this.actionMedia));
				this1.h["mediaembed"] = v;
				break;
			case "mediahtml":
				var this1 = this._windows;
				var v = new com_tilbuci_ui_window_media_WindowMediaHtml($bind(this,this.actionMedia),"simple");
				this1.h["mediahtml"] = v;
				break;
			case "mediaparagraph":
				var this1 = this._windows;
				var v = new com_tilbuci_ui_window_media_WindowMediaParagraph($bind(this,this.actionMedia),"simple");
				this1.h["mediaparagraph"] = v;
				break;
			case "mediapicture":
				var this1 = this._windows;
				var v = new com_tilbuci_ui_window_media_WindowMediaPicture($bind(this,this.actionMedia),"simple");
				this1.h["mediapicture"] = v;
				break;
			case "mediashape":
				var this1 = this._windows;
				var v = new com_tilbuci_ui_window_media_WindowMediaShape($bind(this,this.actionMedia),"simple");
				this1.h["mediashape"] = v;
				break;
			case "mediaspritemap":
				var this1 = this._windows;
				var v = new com_tilbuci_ui_window_media_WindowMediaSpritemap($bind(this,this.actionMedia),"simple");
				this1.h["mediaspritemap"] = v;
				break;
			case "mediastrings":
				var this1 = this._windows;
				var v = new com_tilbuci_ui_window_media_WindowMediaStrings($bind(this,this.actionMedia));
				this1.h["mediastrings"] = v;
				break;
			case "mediatext":
				var this1 = this._windows;
				var v = new com_tilbuci_ui_window_media_WindowMediaText($bind(this,this.actionMedia),"simple");
				this1.h["mediatext"] = v;
				break;
			case "mediavideo":
				var this1 = this._windows;
				var v = new com_tilbuci_ui_window_media_WindowMediaVideo($bind(this,this.actionMedia),"simple");
				this1.h["mediavideo"] = v;
				break;
			case "menus":
				var this1 = this._windows;
				var v = new com_tilbuci_ui_window_contraptions_WindowContrMenu($bind(this,this.actionWindowContrMenu));
				this1.h["menus"] = v;
				break;
			case "messages":
				var this1 = this._windows;
				var v = new com_tilbuci_ui_window_contraptions_WindowContrMessages($bind(this,this.actionWindowContrMessages));
				this1.h["messages"] = v;
				break;
			case "music":
				var this1 = this._windows;
				var v = new com_tilbuci_ui_window_contraptions_WindowContrMusic($bind(this,this.actionWindowContrMusic));
				this1.h["music"] = v;
				break;
			case "narrative-battle":
				var this1 = this._windows;
				var v = new com_tilbuci_ui_window_narrative_WindowNarrBattle($bind(this,this.actionWindowNarrBattle));
				this1.h["narrative-battle"] = v;
				break;
			case "narrative-char":
				var this1 = this._windows;
				var v = new com_tilbuci_ui_window_narrative_WindowNarrChar($bind(this,this.actionWindowNarrChar));
				this1.h["narrative-char"] = v;
				break;
			case "narrative-dflow":
				var this1 = this._windows;
				var v = new com_tilbuci_ui_window_narrative_WindowNarrDflow($bind(this,this.actionWindowNarrDflow));
				this1.h["narrative-dflow"] = v;
				break;
			case "narrative-diag":
				var this1 = this._windows;
				var v = new com_tilbuci_ui_window_narrative_WindowDiagChar($bind(this,this.actionWindowDiagChar));
				this1.h["narrative-diag"] = v;
				break;
			case "narrative-inventory":
				var this1 = this._windows;
				var v = new com_tilbuci_ui_window_narrative_WindowNarrInv($bind(this,this.actionWindowNarrInventory));
				this1.h["narrative-inventory"] = v;
				break;
			case "newmovie":
				var this1 = this._windows;
				var v = new com_tilbuci_ui_window_movie_WindowMovieNew($bind(this,this.actionMovie));
				this1.h["newmovie"] = v;
				break;
			case "newscene":
				var this1 = this._windows;
				var v = new com_tilbuci_ui_window_scene_WindowSceneNew($bind(this,this.actionScene));
				this1.h["newscene"] = v;
				break;
			case "openmovie":
				var this1 = this._windows;
				var v = new com_tilbuci_ui_window_movie_WindowMovieOpen($bind(this,this.actionMovie));
				this1.h["openmovie"] = v;
				break;
			case "openscene":
				var this1 = this._windows;
				var v = new com_tilbuci_ui_window_scene_WindowSceneOpen($bind(this,this.actionScene));
				this1.h["openscene"] = v;
				break;
			case "pluginmovie":
				var this1 = this._windows;
				var v = new com_tilbuci_ui_window_movie_WindowMoviePlugins($bind(this,this.actionMovie));
				this1.h["pluginmovie"] = v;
				break;
			case "propmovie":
				var this1 = this._windows;
				var v = new com_tilbuci_ui_window_movie_WindowMovieProperties($bind(this,this.actionMovie));
				this1.h["propmovie"] = v;
				break;
			case "propscene":
				var this1 = this._windows;
				var v = new com_tilbuci_ui_window_scene_WindowSceneProperties($bind(this,this.actionScene));
				this1.h["propscene"] = v;
				break;
			case "removemovie":
				var this1 = this._windows;
				var v = new com_tilbuci_ui_window_movie_WindowMovieRemove($bind(this,this.actionMovie));
				this1.h["removemovie"] = v;
				break;
			case "republish":
				var this1 = this._windows;
				var v = new com_tilbuci_ui_window_movie_WindowMovieRepublish($bind(this,this.actionMovie));
				this1.h["republish"] = v;
				break;
			case "saveasscene":
				var this1 = this._windows;
				var v = new com_tilbuci_ui_window_scene_WindowSceneSaveas($bind(this,this.actionScene));
				this1.h["saveasscene"] = v;
				break;
			case "seqmovie":
				var this1 = this._windows;
				var v = new com_tilbuci_ui_window_movie_WindowMovieSequences($bind(this,this.actionMovie));
				this1.h["seqmovie"] = v;
				break;
			case "setup":
				var this1 = this._windows;
				var v = new com_tilbuci_ui_window_WindowSetup($bind(this,this.actionWindowSetup),this.build);
				this1.h["setup"] = v;
				break;
			case "snippets":
				var this1 = this._windows;
				var v = new com_tilbuci_ui_window_movie_WindowMovieSnippets($bind(this,this.actionMovie));
				this1.h["snippets"] = v;
				break;
			case "sound":
				var this1 = this._windows;
				var v = new com_tilbuci_ui_window_contraptions_WindowContrSound($bind(this,this.actionWindowContrSound));
				this1.h["sound"] = v;
				break;
			case "targets":
				var this1 = this._windows;
				var v = new com_tilbuci_ui_window_contraptions_WindowContrTarget($bind(this,this.actionWindowContrTarget));
				this1.h["targets"] = v;
				break;
			case "testactions":
				var this1 = this._windows;
				var v = new com_tilbuci_ui_window_WindowTestingActions($bind(this,this.actionWindowTestingActions));
				this1.h["testactions"] = v;
				break;
			case "timedaction":
				var this1 = this._windows;
				var v = new com_tilbuci_ui_window_media_WindowTimedAction($bind(this,this.actionTimed));
				this1.h["timedaction"] = v;
				break;
			case "usermovie":
				var this1 = this._windows;
				var v = new com_tilbuci_ui_window_movie_WindowMovieUsers($bind(this,this.actionMovie));
				this1.h["usermovie"] = v;
				break;
			case "versionscene":
				var this1 = this._windows;
				var v = new com_tilbuci_ui_window_scene_WindowSceneVersions($bind(this,this.actionScene));
				this1.h["versionscene"] = v;
				break;
			case "visitors":
				var this1 = this._windows;
				var v = new com_tilbuci_ui_window_WindowVisitors($bind(this,this.actionWindowVisitors),this.build);
				this1.h["visitors"] = v;
				break;
			default:
				ok = false;
			}
			if(ok) {
				feathers_core_PopUpManager.addPopUp(this._windows.h[name],this);
				this._windows.h[name].redraw();
				this._windows.h[name].acStart();
			}
			return ok;
		}
	}
	,playerCallback: function(ev,data) {
		switch(ev) {
		case "loadkeyframe":
			this._rightArea.updateInstances();
			break;
		case "movieload":
			var tmp = com_tilbuci_data_Global.ws;
			var _g = new haxe_ds_StringMap();
			var value = com_tilbuci_data_GlobalPlayer.movie.get_mvId();
			_g.h["id"] = value;
			tmp.send("Movie/Info",_g,$bind(this,this.onMovieInfo));
			if(com_tilbuci_data_GlobalPlayer.mdata.screen.type == "portrait") {
				com_tilbuci_data_Global.displayType = "portrait";
			} else {
				com_tilbuci_data_Global.displayType = "landscape";
			}
			this._playerControls.centerPlayer();
			this._playerControls.updateDisplay();
			break;
		case "play":
			this._playback.show(this.stage,this._player);
			break;
		case "sceneload":
			if(com_tilbuci_data_Global.sceneObj != null) {
				com_tilbuci_data_GlobalPlayer.movie.scene.fromObject(com_tilbuci_data_Global.sceneObj);
				com_tilbuci_data_Global.sceneObj = null;
			}
			if(com_tilbuci_data_Global.kfToLoad >= 0) {
				com_tilbuci_data_GlobalPlayer.area.loadKeyframe(com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[com_tilbuci_data_Global.kfToLoad],com_tilbuci_data_Global.kfToLoad);
				com_tilbuci_data_Global.kfToLoad = -1;
			}
			this._playerControls.updateDisplay();
			break;
		case "selectimage":
			this._rightArea.setInstance(data);
			break;
		case "testactions":
			this.showWindow("testactions");
			break;
		}
	}
	,onMovieInfo: function(ok,ld) {
		com_tilbuci_data_Global.mvOwner = false;
		com_tilbuci_data_Global.mvCollaborator = false;
		if(ok) {
			if(ld.map.h["e"] == 0) {
				com_tilbuci_data_Global.mvOwner = js_Boot.__cast(Reflect.field(ld.map.h["info"],"isOwner") , Bool);
				com_tilbuci_data_Global.mvCollaborator = js_Boot.__cast(Reflect.field(ld.map.h["info"],"isCollaborator") , Bool);
			}
			this._playerControls.updateDisplay();
			if(com_tilbuci_data_Global.sceneToLoad != "") {
				com_tilbuci_data_GlobalPlayer.movie.loadScene(com_tilbuci_data_Global.sceneToLoad);
				com_tilbuci_data_Global.sceneToLoad = "";
			}
			com_tilbuci_data_Global.acInfo.loadInfo(true);
		}
	}
	,__class__: com_tilbuci_Editor
});
var com_tilbuci_Player = function(path,mode,sOrient,nocache,callback) {
	if(nocache == null) {
		nocache = true;
	}
	this._lastmwheel = 0.0;
	this._touchStartTime = 0;
	this._touchDistanceCheck = 0;
	this._touchDistance = 0;
	this._touchStart = new openfl_geom_Point();
	this._toggles = new haxe_ds_StringMap();
	this._numerics = new haxe_ds_StringMap();
	this._tareas = new haxe_ds_StringMap();
	this._inputs = new haxe_ds_StringMap();
	this.inputArea = null;
	this._frames = 0;
	this._firstScene = false;
	this._lastMovie = "";
	this._firstMovie = false;
	this._rHeight = 0;
	this._rWidth = 0;
	openfl_display_Sprite.call(this);
	com_tilbuci_data_GlobalPlayer.session = DateTools.format(new Date(),"%Y-%m-%d_%H:%M:%S") + "_" + com_tilbuci_statictools_StringStatic.random();
	com_tilbuci_data_GlobalPlayer.session = HxOverrides.substr(com_tilbuci_data_GlobalPlayer.session,0,32);
	if(sOrient == null) {
		sOrient = "landscape";
	}
	if(mode == null) {
		mode = "player";
	}
	this.setMode(mode);
	com_tilbuci_data_GlobalPlayer.build = new com_tilbuci_data_BuildInfo(mode == "player" && path != null);
	com_tilbuci_data_GlobalPlayer.nocache = nocache;
	com_tilbuci_data_GlobalPlayer.callback = callback;
	if(path == null) {
		nocache = false;
		com_tilbuci_data_GlobalPlayer.nocache = nocache;
		this.onPlayerConf(true,null,true);
	} else {
		var cache = null;
		if(nocache) {
			var _g = new haxe_ds_StringMap();
			var value = Math.ceil(Math.random() * 10000);
			_g.h["rand"] = value;
			cache = _g;
		}
		new com_tilbuci_data_DataLoader(true,path,"GET",cache,4,$bind(this,this.onPlayerConf));
	}
	if(this.stage == null) {
		this.addEventListener("addedToStage",$bind(this,this.onStage));
	} else {
		this.onStage(null);
	}
};
$hxClasses["com.tilbuci.Player"] = com_tilbuci_Player;
com_tilbuci_Player.__name__ = "com.tilbuci.Player";
com_tilbuci_Player.__super__ = openfl_display_Sprite;
com_tilbuci_Player.prototype = $extend(openfl_display_Sprite.prototype,{
	rWidth: null
	,_rWidth: null
	,get_rWidth: function() {
		return this._rWidth;
	}
	,rHeight: null
	,_rHeight: null
	,get_rHeight: function() {
		return this._rHeight;
	}
	,tHeight: null
	,get_tHeight: function() {
		com_tilbuci_data_GlobalPlayer.area.setOverlay(false);
		this.removeChild(this._uiArea);
		var ht = this.get_height();
		com_tilbuci_data_GlobalPlayer.area.setOverlay(true);
		this.addChild(this._uiArea);
		return ht;
	}
	,mWidth: null
	,get_mWidth: function() {
		return com_tilbuci_data_GlobalPlayer.area.get_aWidth();
	}
	,mHeight: null
	,get_mHeight: function() {
		return com_tilbuci_data_GlobalPlayer.area.get_aHeight();
	}
	,_bgarea: null
	,_firstMovie: null
	,_lastMovie: null
	,_firstScene: null
	,_display: null
	,_mask: null
	,_background: null
	,_scrOrient: null
	,_frames: null
	,_frameTimer: null
	,_fpsStart: null
	,_uiArea: null
	,inputArea: null
	,_inputs: null
	,_tareas: null
	,_numerics: null
	,_toggles: null
	,_touchStart: null
	,_touchDistance: null
	,_touchDistanceCheck: null
	,_touchStartTime: null
	,_touchHoldTimer: null
	,_touchTimer: null
	,_lastmwheel: null
	,setMode: function(md) {
		if(md == "editor") {
			com_tilbuci_data_GlobalPlayer.mode = "editor";
		} else {
			com_tilbuci_data_GlobalPlayer.mode = "player";
		}
	}
	,setSize: function(w,h) {
		this._rWidth = w;
		this._rHeight = h;
		if(com_tilbuci_data_GlobalPlayer.area != null) {
			com_tilbuci_data_GlobalPlayer.area.setArea();
		}
	}
	,load: function(path) {
		this._lastMovie = com_tilbuci_data_GlobalPlayer.movie.get_mvId();
		this._firstScene = true;
		com_tilbuci_data_GlobalPlayer.movie.loadMovie(path);
	}
	,registerPlugin: function(obj) {
		var this1 = com_tilbuci_data_GlobalPlayer.plugins;
		var k = obj.get_plname();
		this1.h[k] = obj;
		if(com_tilbuci_data_GlobalPlayer.ready) {
			this.initializePlugins();
		}
	}
	,removePlugin: function(name) {
		if(Object.prototype.hasOwnProperty.call(com_tilbuci_data_GlobalPlayer.plugins.h,name)) {
			com_tilbuci_data_GlobalPlayer.plugins.h[name].kill();
			var _this = com_tilbuci_data_GlobalPlayer.plugins;
			if(Object.prototype.hasOwnProperty.call(_this.h,name)) {
				delete(_this.h[name]);
			}
			return true;
		} else {
			return false;
		}
	}
	,initializePlugins: function() {
		var h = com_tilbuci_data_GlobalPlayer.plugins.h;
		var pl_h = h;
		var pl_keys = Object.keys(h);
		var pl_length = pl_keys.length;
		var pl_current = 0;
		while(pl_current < pl_length) {
			var pl = pl_h[pl_keys[pl_current++]];
			if(!pl.get_ready()) {
				pl.initialize(new com_tilbuci_plugin_PluginAccess(com_tilbuci_data_GlobalPlayer.parser.getVarRef("string"),com_tilbuci_data_GlobalPlayer.parser.getVarRef("float"),com_tilbuci_data_GlobalPlayer.parser.getVarRef("int"),com_tilbuci_data_GlobalPlayer.parser.getVarRef("bool"),com_tilbuci_data_GlobalPlayer.parser));
			}
		}
	}
	,halt: function(cause) {
		this.removeChildren();
		var msg = "System down :-(";
		switch(cause) {
		case "language":
			msg = "Error while loading the default language file.";
			break;
		case "noconf":
			msg = "Error while loading the basic system configuration.";
			break;
		case "nomovie":
			msg = com_tilbuci_data_GlobalPlayer.ln.get("player-nomovie");
			break;
		case "noscene":
			msg = com_tilbuci_data_GlobalPlayer.ln.get("player-noscene");
			break;
		}
		var popup = new feathers_controls_Panel();
		popup.set_layout(new feathers_layout_AnchorLayout());
		popup.setPadding(10);
		var message = new feathers_controls_Label();
		message.set_text(msg);
		message.set_layoutData(feathers_layout_AnchorLayoutData.center());
		popup.addChild(message);
		feathers_core_PopUpManager.addPopUp(popup,this);
	}
	,onPlayerConf: function(ok,ld,local) {
		if(local == null) {
			local = false;
		}
		if(local) {
			com_tilbuci_data_GlobalPlayer.ln = new com_tilbuci_data_Language();
			com_tilbuci_data_GlobalPlayer.base = "./";
			com_tilbuci_data_GlobalPlayer.font = "./font/";
			com_tilbuci_data_GlobalPlayer.render = "webgl";
			com_tilbuci_data_GlobalPlayer.share = "never";
			com_tilbuci_data_GlobalPlayer.fps = "free";
			com_tilbuci_data_GlobalPlayer.secret = haxe_io_Bytes.ofHex("");
			if(Object.prototype.hasOwnProperty.call(Main,"ws") && Reflect.field(Main,"ws") != "") {
				com_tilbuci_data_GlobalPlayer.ws = new com_tilbuci_ws_WebserviceP(Reflect.field(Main,"ws"),"");
				com_tilbuci_data_GlobalPlayer.server = true;
			} else {
				com_tilbuci_data_GlobalPlayer.ws = new com_tilbuci_ws_WebserviceP("./ws/","");
				com_tilbuci_data_GlobalPlayer.server = false;
			}
			com_tilbuci_data_GlobalPlayer.movie = new com_tilbuci_data_MovieInfo($bind(this,this.onMovie),$bind(this,this.onScene));
			com_tilbuci_data_GlobalPlayer.parser = new com_tilbuci_script_ScriptParser();
			com_tilbuci_data_GlobalPlayer.parser.eventSend = $bind(this,this.warnListeners);
			com_tilbuci_data_GlobalPlayer.ready = true;
			if(com_tilbuci_data_GlobalPlayer.mode == "player" && Main.us != "" && Main.uk != "") {
				com_tilbuci_data_GlobalPlayer.ws.checkVisitorKey(Main.us,Main.uk,$bind(this,this.onKeyCheck));
			}
			this._bgarea = new openfl_display_Sprite();
			if(com_tilbuci_data_GlobalPlayer.mode != "editor") {
				this.addChild(this._bgarea);
			}
			this._uiArea = new openfl_display_Sprite();
			com_tilbuci_data_GlobalPlayer.area = new com_tilbuci_player_MovieArea(this,this._bgarea,this._uiArea);
			this.addChild(com_tilbuci_data_GlobalPlayer.area);
			this.addChild(this._uiArea);
			this.initializePlugins();
			var joystick = new com_tilbuci_player_Joystick();
			if(com_tilbuci_data_GlobalPlayer.mode == "player") {
				this._firstMovie = true;
				this._firstScene = true;
			}
		} else if(!ok) {
			this.halt("noconf");
		} else {
			com_tilbuci_data_GlobalPlayer.ln = new com_tilbuci_data_Language();
			if(com_tilbuci_data_GlobalPlayer.ln.get_ok()) {
				com_tilbuci_data_GlobalPlayer.server = ld.map.h["server"];
				com_tilbuci_data_GlobalPlayer.base = ld.map.h["base"];
				com_tilbuci_data_GlobalPlayer.font = ld.map.h["font"];
				com_tilbuci_data_GlobalPlayer.render = ld.map.h["render"];
				com_tilbuci_data_GlobalPlayer.share = ld.map.h["share"];
				com_tilbuci_data_GlobalPlayer.fps = ld.map.h["fps"];
				com_tilbuci_data_GlobalPlayer.secret = haxe_io_Bytes.ofHex(ld.map.h["secret"]);
				com_tilbuci_data_GlobalPlayer.ws = new com_tilbuci_ws_WebserviceP(ld.map.h["ws"],"");
				com_tilbuci_data_GlobalPlayer.movie = new com_tilbuci_data_MovieInfo($bind(this,this.onMovie),$bind(this,this.onScene));
				com_tilbuci_data_GlobalPlayer.parser = new com_tilbuci_script_ScriptParser();
				com_tilbuci_data_GlobalPlayer.parser.eventSend = $bind(this,this.warnListeners);
				if(com_tilbuci_data_GlobalPlayer.mode == "player") {
					if(Object.prototype.hasOwnProperty.call(ld.map.h,"systemfonts")) {
						var sysfonts = ld.map.h["systemfonts"];
						var _g = 0;
						var _g1 = sysfonts.length;
						while(_g < _g1) {
							var i = _g++;
							new com_tilbuci_font_EmbedFont(com_tilbuci_data_GlobalPlayer.font + sysfonts[i].file,sysfonts[i].name);
						}
					}
					if(Main.us != "" && Main.uk != "") {
						com_tilbuci_data_GlobalPlayer.ws.checkVisitorKey(Main.us,Main.uk,$bind(this,this.onKeyCheck));
					}
				}
				var joystick = new com_tilbuci_player_Joystick();
				com_tilbuci_data_GlobalPlayer.ready = true;
				this._bgarea = new openfl_display_Sprite();
				if(com_tilbuci_data_GlobalPlayer.mode != "editor") {
					this.addChild(this._bgarea);
				}
				this._uiArea = new openfl_display_Sprite();
				com_tilbuci_data_GlobalPlayer.area = new com_tilbuci_player_MovieArea(this,this._bgarea,this._uiArea);
				this.addChild(com_tilbuci_data_GlobalPlayer.area);
				this.addChild(this._uiArea);
				this.initializePlugins();
				if(com_tilbuci_data_GlobalPlayer.mode == "player") {
					this._firstMovie = true;
					this._firstScene = true;
					var mainMovie = "";
					if(Object.prototype.hasOwnProperty.call(Main,"movie")) {
						mainMovie = Reflect.field(Main,"movie");
					}
					if(mainMovie == "") {
						this.load(ld.map.h["start"]);
					} else {
						this.load(mainMovie);
						if(Object.prototype.hasOwnProperty.call(Main,"movie")) {
							Main["movie"] = "";
						}
					}
				}
				if(com_tilbuci_data_GlobalPlayer.fps != "free" && com_tilbuci_data_GlobalPlayer.fps != "calc") {
					var fps = Std.parseInt(com_tilbuci_data_GlobalPlayer.fps);
					this.stage.window.__backend.setFrameRate(fps);
				}
			} else {
				this.halt("language");
			}
		}
	}
	,onKeyCheck: function(ok,ld) {
		if(ok) {
			if(ld.map.h["e"] == 0) {
				com_tilbuci_data_GlobalPlayer.ws.setUser(Main.us,ld.map.h["key"],ld.map.h["groups"]);
			}
		}
	}
	,onMovie: function(ok) {
		if(com_tilbuci_data_GlobalPlayer.mode == "player" && !ok) {
			if(this._firstMovie) {
				this.halt("nomovie");
			} else if(this._lastMovie != "") {
				this._firstMovie = true;
				this.load(this._lastMovie);
			} else {
				this.halt("nomovie");
			}
		} else if(ok) {
			com_tilbuci_data_GlobalPlayer.area.hideTarget();
			com_tilbuci_data_GlobalPlayer.area.clearTarget();
			com_tilbuci_data_GlobalPlayer.area.setArea();
			if(com_tilbuci_data_GlobalPlayer.mdata.key != "" && com_tilbuci_data_GlobalPlayer.mode == "player") {
				if(com_tilbuci_data_GlobalPlayer.mdata.key != com_tilbuci_data_GlobalPlayer.secretKey) {
					var msg = "Please type the access key.";
					if(Object.prototype.hasOwnProperty.call(com_tilbuci_data_GlobalPlayer.mdata.texts.h,"secretkey")) {
						msg = com_tilbuci_data_GlobalPlayer.mdata.texts.h["secretkey"];
					}
					com_tilbuci_data_GlobalPlayer.area.showSecretKeyInput(msg);
				}
			}
			var plgs = [];
			var h = com_tilbuci_data_GlobalPlayer.plugins.h;
			var p_h = h;
			var p_keys = Object.keys(h);
			var p_length = p_keys.length;
			var p_current = 0;
			while(p_current < p_length) {
				var p = p_h[p_keys[p_current++]];
				if(p.active) {
					plgs.push(p.get_pltitle() + " (" + p.get_plname() + ")");
					p.info.onNewMovie(com_tilbuci_data_GlobalPlayer.mdata.title,com_tilbuci_data_GlobalPlayer.movie.get_mvId(),com_tilbuci_data_GlobalPlayer.mdata.screen.big,com_tilbuci_data_GlobalPlayer.mdata.screen.small);
				}
			}
			if(com_tilbuci_data_GlobalPlayer.callback != null) {
				var tmp = com_tilbuci_data_GlobalPlayer.callback;
				var _g = new haxe_ds_StringMap();
				var value = com_tilbuci_data_GlobalPlayer.movie.get_mvId();
				_g.h["id"] = value;
				tmp("movieload",_g);
			}
			haxe_Log.trace(com_tilbuci_data_GlobalPlayer.mdata.title + " movie loaded.",{ fileName : "Source/com/tilbuci/Player.hx", lineNumber : 584, className : "com.tilbuci.Player", methodName : "onMovie"});
			if(plgs.length == 0) {
				haxe_Log.trace("No plugins used.",{ fileName : "Source/com/tilbuci/Player.hx", lineNumber : 585, className : "com.tilbuci.Player", methodName : "onMovie"});
			} else {
				haxe_Log.trace("Plugins used: " + plgs.join(", ") + ".",{ fileName : "Source/com/tilbuci/Player.hx", lineNumber : 586, className : "com.tilbuci.Player", methodName : "onMovie"});
			}
			var _g = new haxe_ds_StringMap();
			var value = com_tilbuci_data_GlobalPlayer.movie.get_mvId();
			_g.h["id"] = value;
			_g.h["title"] = com_tilbuci_data_GlobalPlayer.mdata.title;
			this.dispatchEvent(new com_tilbuci_event_TilBuciEvent("movie_loaded",_g));
		}
	}
	,onScene: function(ok) {
		if(com_tilbuci_data_GlobalPlayer.mode == "player" && !ok && this._firstScene) {
			this.halt("noscene");
		}
		com_tilbuci_data_GlobalPlayer.area.noMouseOver();
		var h = com_tilbuci_data_GlobalPlayer.plugins.h;
		var p_h = h;
		var p_keys = Object.keys(h);
		var p_length = p_keys.length;
		var p_current = 0;
		while(p_current < p_length) {
			var p = p_h[p_keys[p_current++]];
			if(p.active && p.get_ready()) {
				p.info.onNewScene(com_tilbuci_data_GlobalPlayer.movie.scene.title,com_tilbuci_data_GlobalPlayer.movie.get_scId(),com_tilbuci_data_GlobalPlayer.movie.scene.keyframes.length);
			}
		}
		if(com_tilbuci_data_GlobalPlayer.mode == "player") {
			if(com_tilbuci_data_GlobalPlayer.share == "scene") {
				window.TBB_setAddress(com_tilbuci_data_GlobalPlayer.base + "app/?mv=" + com_tilbuci_data_GlobalPlayer.movie.get_mvId() + "&sc=" + com_tilbuci_data_GlobalPlayer.movie.get_scId(),com_tilbuci_data_GlobalPlayer.mdata.title + " > " + com_tilbuci_data_GlobalPlayer.movie.scene.title);
			} else if(com_tilbuci_data_GlobalPlayer.share == "movie") {
				window.TBB_setAddress(com_tilbuci_data_GlobalPlayer.base + "app/?mv=" + com_tilbuci_data_GlobalPlayer.movie.get_mvId(),com_tilbuci_data_GlobalPlayer.mdata.title);
			} else if(com_tilbuci_data_GlobalPlayer.share == "website") {
				if(com_tilbuci_data_GlobalPlayer.mdata.start == com_tilbuci_data_GlobalPlayer.movie.get_scId()) {
					window.TBB_setAddress(com_tilbuci_data_GlobalPlayer.base,com_tilbuci_data_GlobalPlayer.mdata.title);
				} else {
					window.TBB_setAddress(com_tilbuci_data_GlobalPlayer.base + com_tilbuci_data_GlobalPlayer.movie.get_scId() + ".html",com_tilbuci_data_GlobalPlayer.mdata.title);
				}
			}
		}
		com_tilbuci_data_GlobalPlayer.area.loadKeyframe(com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[0],0);
		if(this._firstScene) {
			if(com_tilbuci_data_GlobalPlayer.mode != "editor") {
				if(com_tilbuci_data_GlobalPlayer.movie.data.acstart != "") {
					com_tilbuci_data_GlobalPlayer.parser.run(com_tilbuci_data_GlobalPlayer.movie.data.acstart);
				}
			}
		}
		if(com_tilbuci_data_GlobalPlayer.movie.scene.acstart != "" && com_tilbuci_data_GlobalPlayer.mode != "editor") {
			com_tilbuci_data_GlobalPlayer.parser.run(com_tilbuci_data_GlobalPlayer.movie.scene.acstart);
		}
		if(com_tilbuci_data_GlobalPlayer.mode == "player" && com_tilbuci_data_GlobalPlayer.fps == "calc") {
			if(this._frameTimer != null) {
				try {
					this._frameTimer.stop();
				} catch( _g ) {
				}
				this._frameTimer = null;
			}
			this._fpsStart = new haxe_Timer(2000);
			this._fpsStart.run = $bind(this,this.fpsCount);
		}
		if(com_tilbuci_data_GlobalPlayer.callback != null) {
			var tmp = com_tilbuci_data_GlobalPlayer.callback;
			var _g = new haxe_ds_StringMap();
			var value = com_tilbuci_data_GlobalPlayer.movie.get_scId();
			_g.h["id"] = value;
			tmp("sceneload",_g);
		}
		var _g = new haxe_ds_StringMap();
		var value = com_tilbuci_data_GlobalPlayer.movie.get_scId();
		_g.h["id"] = value;
		_g.h["title"] = com_tilbuci_data_GlobalPlayer.movie.scene.title;
		this.dispatchEvent(new com_tilbuci_event_TilBuciEvent("scene_loaded",_g));
		this._firstMovie = false;
		this._firstScene = false;
	}
	,fpsCount: function() {
		var _gthis = this;
		if(com_tilbuci_data_GlobalPlayer.mode == "player" && com_tilbuci_data_GlobalPlayer.fps == "calc") {
			if(this._fpsStart != null) {
				try {
					this._fpsStart.stop();
				} catch( _g ) {
				}
				this._fpsStart = null;
			}
			if(this.stage.hasEventListener("enterFrame")) {
				this.removeEventListener("enterFrame",$bind(this,this.onFrame));
			}
			if(this._fpsStart != null) {
				try {
					this._fpsStart.stop();
				} catch( _g ) {
				}
				this._fpsStart = null;
			}
			if(this.stage != null) {
				this.stage.window.__backend.setFrameRate(80);
				this._frames = 0;
				this.addEventListener("enterFrame",$bind(this,this.onFrame));
				this._frameTimer = new haxe_Timer(2000);
				this._frameTimer.run = function() {
					try {
						_gthis._frameTimer.stop();
					} catch( _g ) {
					}
					_gthis._frameTimer = null;
					if(_gthis.stage.hasEventListener("enterFrame")) {
						_gthis.removeEventListener("enterFrame",$bind(_gthis,_gthis.onFrame));
					}
					var sum = Math.round(_gthis._frames / 2);
					if(sum <= 29) {
						_gthis.stage.window.__backend.setFrameRate(20);
					} else if(sum <= 39) {
						_gthis.stage.window.__backend.setFrameRate(30);
					} else if(sum <= 49) {
						_gthis.stage.window.__backend.setFrameRate(40);
					} else if(sum <= 59) {
						_gthis.stage.window.__backend.setFrameRate(50);
					} else {
						_gthis.stage.window.__backend.setFrameRate(60);
					}
				};
			}
		} else if(com_tilbuci_data_GlobalPlayer.fps != "free") {
			var fps = Std.parseInt(com_tilbuci_data_GlobalPlayer.fps);
			this.stage.window.__backend.setFrameRate(fps);
		}
	}
	,onFrame: function(e) {
		this._frames++;
	}
	,onStage: function(evt) {
		if(this.hasEventListener("addedToStage")) {
			this.removeEventListener("addedToStage",$bind(this,this.onStage));
		}
		if(com_tilbuci_data_GlobalPlayer.mode == "player") {
			this.stage.addEventListener("touchBegin",$bind(this,this.onTouchBegin));
			this.stage.addEventListener("touchEnd",$bind(this,this.onTouchEnd));
			this.stage.addEventListener("keyDown",$bind(this,this.onKeyboard));
			this.stage.addEventListener("mouseWheel",$bind(this,this.onMouseWheel));
			this.stage.addEventListener("middleClick",$bind(this,this.onMouseMiddle));
			this.stage.addEventListener("rightClick",$bind(this,this.onMouseRight));
			this.stage.addEventListener("click",$bind(this,this.onLeftClick));
		}
	}
	,listenInput: function() {
		this.stage.addEventListener("touchBegin",$bind(this,this.onTouchBegin));
		this.stage.addEventListener("touchEnd",$bind(this,this.onTouchEnd));
		this.stage.addEventListener("keyDown",$bind(this,this.onKeyboard));
		this.stage.addEventListener("mouseWheel",$bind(this,this.onMouseWheel));
		this.stage.addEventListener("middleClick",$bind(this,this.onMouseMiddle));
		this.stage.addEventListener("rightClick",$bind(this,this.onMouseRight));
	}
	,listenInputRemove: function() {
		this.stage.removeEventListener("touchBegin",$bind(this,this.onTouchBegin));
		this.stage.removeEventListener("touchEnd",$bind(this,this.onTouchEnd));
		this.stage.removeEventListener("keyDown",$bind(this,this.onKeyboard));
		this.stage.removeEventListener("mouseWheel",$bind(this,this.onMouseWheel));
		this.stage.removeEventListener("middleClick",$bind(this,this.onMouseMiddle));
		this.stage.removeEventListener("rightClick",$bind(this,this.onMouseRight));
	}
	,onTouchMove: function(evt) {
		if(evt.touchPointID == 1) {
			if(new Date().getTime() - this._touchDistanceCheck >= 250) {
				var dist = Math.sqrt(Math.pow(evt.stageX - this._touchStart.x,2) + Math.pow(evt.stageY - this._touchStart.y,2));
				if(dist - this._touchDistance > 0) {
					if(Math.abs(dist - this._touchDistance) > com_tilbuci_data_GlobalPlayer.area.get_aWidth() / 20) {
						com_tilbuci_data_GlobalPlayer.parser.runInput("pinchopen");
					}
				} else if(Math.abs(dist - this._touchDistance) > com_tilbuci_data_GlobalPlayer.area.get_aWidth() / 20) {
					com_tilbuci_data_GlobalPlayer.parser.runInput("pinchclose");
				}
				this._touchDistanceCheck = new Date().getTime();
			}
		}
	}
	,onTouchBegin: function(evt) {
		if(evt.touchPointID == 0) {
			this._touchStart.x = evt.stageX;
			this._touchStart.y = evt.stageY;
			this._touchStartTime = new Date().getTime();
		} else if(evt.touchPointID == 1) {
			this._touchDistance = Math.sqrt(Math.pow(evt.stageX - this._touchStart.x,2) + Math.pow(evt.stageY - this._touchStart.y,2));
			this._touchDistanceCheck = new Date().getTime();
			this.stage.addEventListener("touchMove",$bind(this,this.onTouchMove));
			if(com_tilbuci_data_GlobalPlayer.parser.onDrag != null) {
				com_tilbuci_data_GlobalPlayer.parser.onDragMoveStop(null);
			}
		}
	}
	,onTouchEnd: function(evt) {
		if(evt.touchPointID == 0) {
			if(new Date().getTime() - this._touchStartTime < 300) {
				var difx = this._touchStart.x - evt.stageX;
				var dify = this._touchStart.y - evt.stageY;
				if(Math.abs(difx) > Math.abs(dify)) {
					if(Math.abs(difx) > this.stage.stageWidth / 15) {
						com_tilbuci_data_GlobalPlayer.canTrigger = false;
						if(difx > 0) {
							com_tilbuci_data_GlobalPlayer.parser.runInput("swiperight");
						} else {
							com_tilbuci_data_GlobalPlayer.parser.runInput("swipeleft");
						}
						if(this._touchTimer != null) {
							try {
								this._touchTimer.stop();
							} catch( _g ) {
							}
							this._touchTimer = null;
						}
						this._touchTimer = new haxe_Timer(300);
						this._touchTimer.run = $bind(this,this.endTouch);
					}
				} else if(Math.abs(dify) > this.stage.stageHeight / 15) {
					com_tilbuci_data_GlobalPlayer.canTrigger = false;
					if(dify > 0) {
						com_tilbuci_data_GlobalPlayer.parser.runInput("swipebottom");
					} else {
						com_tilbuci_data_GlobalPlayer.parser.runInput("swipetop");
					}
					if(this._touchTimer != null) {
						try {
							this._touchTimer.stop();
						} catch( _g ) {
						}
						this._touchTimer = null;
					}
					this._touchTimer = new haxe_Timer(300);
					this._touchTimer.run = $bind(this,this.endTouch);
				}
			} else if(new Date().getTime() - this._touchStartTime > 1200) {
				com_tilbuci_data_GlobalPlayer.canTrigger = false;
				if(!com_tilbuci_data_GlobalPlayer.parser.runInput("touchhold")) {
					com_tilbuci_data_GlobalPlayer.canTrigger = true;
				}
				if(!com_tilbuci_data_GlobalPlayer.canTrigger) {
					if(this._touchTimer != null) {
						try {
							this._touchTimer.stop();
						} catch( _g ) {
						}
						this._touchTimer = null;
					}
					this._touchTimer = new haxe_Timer(300);
					this._touchTimer.run = $bind(this,this.endTouch);
				}
			}
			this._touchStart.x = evt.stageX;
			this._touchStart.y = evt.stageY;
		} else if(evt.touchPointID == 1) {
			var dist = Math.sqrt(Math.pow(evt.stageX - this._touchStart.x,2) + Math.pow(evt.stageY - this._touchStart.y,2));
			if(dist - this._touchDistance > 0) {
				if(Math.abs(dist - this._touchDistance) > com_tilbuci_data_GlobalPlayer.area.get_aWidth() / 20) {
					com_tilbuci_data_GlobalPlayer.parser.runInput("pinchopen");
				}
			} else if(Math.abs(dist - this._touchDistance) > com_tilbuci_data_GlobalPlayer.area.get_aWidth() / 20) {
				com_tilbuci_data_GlobalPlayer.parser.runInput("pinchclose");
			}
			if(this.stage.hasEventListener("touchMove")) {
				this.stage.removeEventListener("touchMove",$bind(this,this.onTouchMove));
			}
		}
	}
	,endTouch: function() {
		if(this._touchTimer != null) {
			try {
				this._touchTimer.stop();
			} catch( _g ) {
			}
			this._touchTimer = null;
		}
		com_tilbuci_data_GlobalPlayer.canTrigger = true;
	}
	,onKeyboard: function(evt) {
		var found = com_tilbuci_data_GlobalPlayer.parser.checkKeyboard(evt.keyCode);
		if(!found) {
			var h = com_tilbuci_data_GlobalPlayer.plugins.h;
			var p_h = h;
			var p_keys = Object.keys(h);
			var p_length = p_keys.length;
			var p_current = 0;
			while(p_current < p_length) {
				var p = p_h[p_keys[p_current++]];
				if(p.active && !found) {
					found = p.checkKeyboard(evt.keyCode);
				}
			}
		}
	}
	,onMouseWheel: function(evt) {
		if(((this.stage.get_focus()) instanceof openfl_display_Stage)) {
			if(this._lastmwheel < new Date().getTime() - 750) {
				this._lastmwheel = new Date().getTime();
				if(evt.delta < 0) {
					com_tilbuci_data_GlobalPlayer.parser.checkMouse("mousewheeldown");
				} else if(evt.delta > 0) {
					com_tilbuci_data_GlobalPlayer.parser.checkMouse("mousewheelup");
				}
			}
		}
	}
	,onMouseMiddle: function(evt) {
		if(((this.stage.get_focus()) instanceof openfl_display_Stage)) {
			com_tilbuci_data_GlobalPlayer.parser.checkMouse("mousemiddle");
			com_tilbuci_data_GlobalPlayer.parser.hadInteraction = true;
		}
	}
	,onMouseRight: function(evt) {
		this.stage.showDefaultContextMenu = true;
		if(((this.stage.get_focus()) instanceof openfl_display_Stage)) {
			if(com_tilbuci_data_GlobalPlayer.parser.checkMouse("mouseright")) {
				this.stage.showDefaultContextMenu = false;
				com_tilbuci_data_GlobalPlayer.parser.hadInteraction = true;
			}
		}
	}
	,onLeftClick: function(evt) {
		this.stage.removeEventListener("click",$bind(this,this.onLeftClick));
		com_tilbuci_data_GlobalPlayer.parser.hadInteraction = true;
	}
	,warnListeners: function(data) {
		this.dispatchEvent(new com_tilbuci_event_TilBuciEvent("event",data));
		if(com_tilbuci_data_GlobalPlayer.callback != null) {
			com_tilbuci_data_GlobalPlayer.callback("custom",data);
		}
	}
	,getStringValue: function(name) {
		return com_tilbuci_data_GlobalPlayer.parser.getString(name);
	}
	,getFloatValue: function(name) {
		return com_tilbuci_data_GlobalPlayer.parser.getFloat(name);
	}
	,getIntValue: function(name) {
		return com_tilbuci_data_GlobalPlayer.parser.getInt(name);
	}
	,getBoolValue: function(name) {
		return com_tilbuci_data_GlobalPlayer.parser.getBool(name);
	}
	,runAction: function(ac) {
		return com_tilbuci_data_GlobalPlayer.parser.run(ac);
	}
	,addInput: function(name,px,py,width,placeholder) {
		if(placeholder == null) {
			placeholder = "";
		}
		if(this.inputArea != null) {
			if(!Object.prototype.hasOwnProperty.call(this._inputs.h,name)) {
				var this1 = this._inputs;
				var v = new feathers_controls_TextInput();
				this1.h[name] = v;
				if(placeholder != "") {
					this._inputs.h[name].set_prompt(placeholder);
				}
				this.inputArea.addChild(this._inputs.h[name]);
			}
			this.placeInput(name,px,py,width);
		}
	}
	,addTarea: function(name,px,py,width,height) {
		if(this.inputArea != null) {
			if(!Object.prototype.hasOwnProperty.call(this._tareas.h,name)) {
				var this1 = this._tareas;
				var v = new feathers_controls_TextArea();
				this1.h[name] = v;
				this.inputArea.addChild(this._tareas.h[name]);
			}
			this.placeTarea(name,px,py,width,height);
		}
	}
	,placeInput: function(name,px,py,width) {
		if(this.inputArea != null) {
			if(Object.prototype.hasOwnProperty.call(this._inputs.h,name)) {
				this._inputs.h[name].set_x(px);
				this._inputs.h[name].set_y(py);
				this._inputs.h[name].set_width(width);
			}
		}
	}
	,placeTarea: function(name,px,py,width,height) {
		if(this.inputArea != null) {
			if(Object.prototype.hasOwnProperty.call(this._tareas.h,name)) {
				this._tareas.h[name].set_x(px);
				this._tareas.h[name].set_y(py);
				this._tareas.h[name].set_width(width);
				this._tareas.h[name].set_height(height);
			}
		}
	}
	,removeInput: function(name) {
		if(this.inputArea != null) {
			if(Object.prototype.hasOwnProperty.call(this._inputs.h,name)) {
				this.inputArea.removeChild(this._inputs.h[name]);
				var _this = this._inputs;
				if(Object.prototype.hasOwnProperty.call(_this.h,name)) {
					delete(_this.h[name]);
				}
			}
		}
	}
	,removeTarea: function(name) {
		if(this.inputArea != null) {
			if(Object.prototype.hasOwnProperty.call(this._tareas.h,name)) {
				this.inputArea.removeChild(this._tareas.h[name]);
				var _this = this._tareas;
				if(Object.prototype.hasOwnProperty.call(_this.h,name)) {
					delete(_this.h[name]);
				}
			}
		}
	}
	,removeAllInputs: function() {
		if(this.inputArea != null) {
			var h = this._inputs.h;
			var k_h = h;
			var k_keys = Object.keys(h);
			var k_length = k_keys.length;
			var k_current = 0;
			while(k_current < k_length) {
				var k = k_keys[k_current++];
				this.removeInput(k);
			}
		}
	}
	,removeAllTareas: function() {
		if(this.inputArea != null) {
			var h = this._tareas.h;
			var k_h = h;
			var k_keys = Object.keys(h);
			var k_length = k_keys.length;
			var k_current = 0;
			while(k_current < k_length) {
				var k = k_keys[k_current++];
				this.removeTarea(k);
			}
		}
	}
	,getInputText: function(name) {
		if(Object.prototype.hasOwnProperty.call(this._inputs.h,name)) {
			return this._inputs.h[name].get_text();
		} else {
			return "";
		}
	}
	,getTareaText: function(name) {
		if(Object.prototype.hasOwnProperty.call(this._tareas.h,name)) {
			return this._tareas.h[name].get_text();
		} else {
			return "";
		}
	}
	,setInputText: function(name,value) {
		if(Object.prototype.hasOwnProperty.call(this._inputs.h,name)) {
			this._inputs.h[name].set_text(value);
		}
	}
	,setTareaText: function(name,value) {
		if(Object.prototype.hasOwnProperty.call(this._tareas.h,name)) {
			this._tareas.h[name].set_text(value);
		}
	}
	,setInputPassword: function(name,pass) {
		if(Object.prototype.hasOwnProperty.call(this._inputs.h,name)) {
			this._inputs.h[name].set_displayAsPassword(pass);
		}
	}
	,addNumeric: function(name,value,minimum,maximum,step) {
		if(this.inputArea != null) {
			if(!Object.prototype.hasOwnProperty.call(this._numerics.h,name)) {
				var this1 = this._numerics;
				var v = new feathers_controls_NumericStepper(value,minimum,maximum);
				this1.h[name] = v;
				this._numerics.h[name].set_step(step);
				this._numerics.h[name].set_value(value);
				this.inputArea.addChild(this._numerics.h[name]);
			}
		}
	}
	,placeNumeric: function(name,px,py,width) {
		if(this.inputArea != null) {
			if(Object.prototype.hasOwnProperty.call(this._numerics.h,name)) {
				this._numerics.h[name].set_x(px);
				this._numerics.h[name].set_y(py);
				this._numerics.h[name].set_width(width);
			}
		}
	}
	,removeNumeric: function(name) {
		if(this.inputArea != null) {
			if(Object.prototype.hasOwnProperty.call(this._numerics.h,name)) {
				this.inputArea.removeChild(this._numerics.h[name]);
				var _this = this._numerics;
				if(Object.prototype.hasOwnProperty.call(_this.h,name)) {
					delete(_this.h[name]);
				}
			}
		}
	}
	,removeAllNumerics: function() {
		if(this.inputArea != null) {
			var h = this._numerics.h;
			var k_h = h;
			var k_keys = Object.keys(h);
			var k_length = k_keys.length;
			var k_current = 0;
			while(k_current < k_length) {
				var k = k_keys[k_current++];
				this.removeNumeric(k);
			}
		}
	}
	,getNumericValue: function(name) {
		if(Object.prototype.hasOwnProperty.call(this._numerics.h,name)) {
			return Math.round(this._numerics.h[name].get_value());
		} else {
			return 0;
		}
	}
	,setNumericValue: function(name,value) {
		if(Object.prototype.hasOwnProperty.call(this._numerics.h,name)) {
			this._numerics.h[name].set_value(value);
		}
	}
	,setNumericBounds: function(name,minimum,maximum,step) {
		if(Object.prototype.hasOwnProperty.call(this._numerics.h,name)) {
			this._numerics.h[name].set_minimum(minimum);
			this._numerics.h[name].set_maximum(maximum);
			this._numerics.h[name].set_step(step);
		}
	}
	,addToggle: function(name,value,px,py) {
		if(this.inputArea != null) {
			if(!Object.prototype.hasOwnProperty.call(this._toggles.h,name)) {
				var this1 = this._toggles;
				var v = new feathers_controls_ToggleSwitch(value);
				this1.h[name] = v;
				this.inputArea.addChild(this._toggles.h[name]);
			}
			this.placeToggle(name,px,py);
		}
	}
	,placeToggle: function(name,px,py) {
		if(this.inputArea != null) {
			if(Object.prototype.hasOwnProperty.call(this._toggles.h,name)) {
				this._toggles.h[name].set_x(px);
				this._toggles.h[name].set_y(py);
			}
		}
	}
	,removeToggle: function(name) {
		if(this.inputArea != null) {
			if(Object.prototype.hasOwnProperty.call(this._toggles.h,name)) {
				this.inputArea.removeChild(this._toggles.h[name]);
				var _this = this._toggles;
				if(Object.prototype.hasOwnProperty.call(_this.h,name)) {
					delete(_this.h[name]);
				}
			}
		}
	}
	,removeAllToggles: function() {
		if(this.inputArea != null) {
			var h = this._toggles.h;
			var k_h = h;
			var k_keys = Object.keys(h);
			var k_length = k_keys.length;
			var k_current = 0;
			while(k_current < k_length) {
				var k = k_keys[k_current++];
				this.removeToggle(k);
			}
		}
	}
	,getToggleValue: function(name) {
		if(Object.prototype.hasOwnProperty.call(this._toggles.h,name)) {
			return this._toggles.h[name].get_selected();
		} else {
			return false;
		}
	}
	,setToggleValue: function(name,value) {
		if(Object.prototype.hasOwnProperty.call(this._toggles.h,name)) {
			this._toggles.h[name].set_selected(value);
		}
	}
	,invertToggle: function(name) {
		if(Object.prototype.hasOwnProperty.call(this._toggles.h,name)) {
			this._toggles.h[name].set_selected(!this._toggles.h[name].get_selected());
		}
	}
	,__class__: com_tilbuci_Player
	,__properties__: $extend(openfl_display_Sprite.prototype.__properties__,{get_mHeight:"get_mHeight",get_mWidth:"get_mWidth",get_tHeight:"get_tHeight",get_rHeight:"get_rHeight",get_rWidth:"get_rWidth"})
});
var com_tilbuci_contraptions_BackgroundContraption = function(data) {
	this.ok = false;
	openfl_display_Sprite.call(this);
	if(data != null) {
		this.load(data);
	}
};
$hxClasses["com.tilbuci.contraptions.BackgroundContraption"] = com_tilbuci_contraptions_BackgroundContraption;
com_tilbuci_contraptions_BackgroundContraption.__name__ = "com.tilbuci.contraptions.BackgroundContraption";
com_tilbuci_contraptions_BackgroundContraption.__super__ = openfl_display_Sprite;
com_tilbuci_contraptions_BackgroundContraption.prototype = $extend(openfl_display_Sprite.prototype,{
	ok: null
	,id: null
	,landscape: null
	,portrait: null
	,_landscape: null
	,_portrait: null
	,create: function(bts,ac) {
		if(this.ok) {
			this.removeChildren();
		}
		return this;
	}
	,remove: function() {
		this.removeChildren();
		if(this.parent != null) {
			this.parent.removeChild(this);
		}
	}
	,clone: function() {
		return new com_tilbuci_contraptions_BackgroundContraption(this.toObject());
	}
	,getCover: function() {
		this.removeChildren();
		if(com_tilbuci_data_GlobalPlayer.area.get_pOrientation() == "horizontal") {
			if(this._landscape != null) {
				this._landscape.set_width(com_tilbuci_data_GlobalPlayer.mdata.screen.big);
				this._landscape.set_height(com_tilbuci_data_GlobalPlayer.mdata.screen.small);
				this.addChild(this._landscape);
			} else {
				this._portrait.set_width(com_tilbuci_data_GlobalPlayer.mdata.screen.big);
				this._portrait.set_height(com_tilbuci_data_GlobalPlayer.mdata.screen.small);
				this.addChild(this._portrait);
			}
		} else if(this._portrait != null) {
			this._portrait.set_width(com_tilbuci_data_GlobalPlayer.mdata.screen.small);
			this._portrait.set_height(com_tilbuci_data_GlobalPlayer.mdata.screen.big);
			this.addChild(this._portrait);
		} else {
			this._landscape.set_width(com_tilbuci_data_GlobalPlayer.mdata.screen.small);
			this._landscape.set_height(com_tilbuci_data_GlobalPlayer.mdata.screen.big);
			this.addChild(this._landscape);
		}
		return this;
	}
	,load: function(data) {
		this.ok = false;
		if(Object.prototype.hasOwnProperty.call(data,"id")) {
			this.id = Reflect.field(data,"id");
			if(Object.prototype.hasOwnProperty.call(data,"portrait")) {
				this.portrait = Reflect.field(data,"portrait");
				if(this.portrait != "") {
					this._portrait = new com_tilbuci_display_PictureImage($bind(this,this.onPicLoad));
					this._portrait.set_visible(true);
				}
			} else {
				this.portrait = "";
			}
			if(Object.prototype.hasOwnProperty.call(data,"landscape")) {
				this.landscape = Reflect.field(data,"landscape");
				if(this.landscape != "") {
					this._landscape = new com_tilbuci_display_PictureImage($bind(this,this.onPicLoad));
					this._landscape.set_visible(true);
				}
			} else {
				this.landscape = "";
			}
			if(this.portrait == null) {
				this.portrait = "";
			}
			if(this.landscape == null) {
				this.landscape = "";
			}
			if(this.landscape != "" || this.portrait != "") {
				if(this._landscape != null) {
					this._landscape.load(this.landscape);
				}
				if(this._portrait != null) {
					this._portrait.load(this.portrait);
				}
				this.mouseEnabled = false;
				this.mouseChildren = false;
				return true;
			} else {
				return false;
			}
		} else {
			return false;
		}
	}
	,onPicLoad: function(ok) {
		if(com_tilbuci_data_GlobalPlayer.area.get_pOrientation() == "horizontal") {
			if(this._landscape != null) {
				this._landscape.set_width(com_tilbuci_data_GlobalPlayer.mdata.screen.big);
				this._landscape.set_height(com_tilbuci_data_GlobalPlayer.mdata.screen.small);
			} else {
				this._portrait.set_width(com_tilbuci_data_GlobalPlayer.mdata.screen.big);
				this._portrait.set_height(com_tilbuci_data_GlobalPlayer.mdata.screen.small);
			}
		} else if(this._portrait != null) {
			this._portrait.set_width(com_tilbuci_data_GlobalPlayer.mdata.screen.small);
			this._portrait.set_height(com_tilbuci_data_GlobalPlayer.mdata.screen.big);
		} else {
			this._landscape.set_width(com_tilbuci_data_GlobalPlayer.mdata.screen.small);
			this._landscape.set_height(com_tilbuci_data_GlobalPlayer.mdata.screen.big);
		}
	}
	,kill: function() {
		if(this.parent != null) {
			this.parent.removeChild(this);
		}
		this.removeChildren();
		if(this._landscape != null) {
			this._landscape.kill();
		}
		if(this._portrait != null) {
			this._portrait.kill();
		}
		this._landscape = null;
		this._portrait = null;
		this.landscape = null;
		this.portrait = null;
		this.id = null;
	}
	,toObject: function() {
		return { id : this.id, landscape : this.landscape, portrait : this.portrait};
	}
	,__class__: com_tilbuci_contraptions_BackgroundContraption
});
var com_tilbuci_contraptions_BattleContraption = function() {
	this._timerParam = 0;
	this._won = false;
	this._onwin = null;
	this._onloose = null;
	this.attributes = [];
	this.soundtie = "";
	this.soundloose = "";
	this.soundwin = "";
	this.soundpick = "";
	this.attrbg = "";
	this.card = "";
	this.close = "";
	this.vertical = "";
	this.horizontal = "";
	this.fontsize = 20;
	this.fontcolor = "0xffffff";
	this.font = "sans";
	this.ok = false;
	openfl_display_Sprite.call(this);
	this._playerData = new com_tilbuci_contraptions_BattleData();
	this._opponentData = new com_tilbuci_contraptions_BattleData();
};
$hxClasses["com.tilbuci.contraptions.BattleContraption"] = com_tilbuci_contraptions_BattleContraption;
com_tilbuci_contraptions_BattleContraption.__name__ = "com.tilbuci.contraptions.BattleContraption";
com_tilbuci_contraptions_BattleContraption.__super__ = openfl_display_Sprite;
com_tilbuci_contraptions_BattleContraption.prototype = $extend(openfl_display_Sprite.prototype,{
	ok: null
	,id: null
	,font: null
	,fontcolor: null
	,fontsize: null
	,horizontal: null
	,vertical: null
	,close: null
	,card: null
	,attrbg: null
	,soundpick: null
	,soundwin: null
	,soundloose: null
	,soundtie: null
	,attributes: null
	,_hbitmap: null
	,_vbitmap: null
	,_cbitmap: null
	,_abitmap: null
	,_onloose: null
	,_onwin: null
	,_player: null
	,_playerCurent: null
	,_opponent: null
	,_opponentCurent: null
	,_pcards: null
	,_ocards: null
	,_cardsize: null
	,_playerData: null
	,_opponentData: null
	,_won: null
	,_timer: null
	,_timerParam: null
	,compare: function(num) {
		if(this._timer == null) {
			this._opponent.showAttrVal(num);
			if(this.soundpick != "") {
				com_tilbuci_data_GlobalPlayer.contraptions.soundPlay(com_tilbuci_data_GlobalPlayer.parser.parseString(this.soundpick));
			}
			this._player.pulse(num);
			this._opponent.pulse(num);
			this._timerParam = num;
			this._timer = new haxe_Timer(500);
			this._timer.run = $bind(this,this.evaluateCompare);
		}
	}
	,evaluateCompare: function() {
		try {
			this._timer.stop();
		} catch( _g ) {
		}
		this._timer = null;
		var valP = this._playerData.getValue(this._timerParam);
		var valO = this._opponentData.getValue(this._timerParam);
		if(valP < valO) {
			if(this.soundloose != "") {
				com_tilbuci_data_GlobalPlayer.contraptions.soundPlay(com_tilbuci_data_GlobalPlayer.parser.parseString(this.soundloose));
			}
			com_tilbuci_statictools_SpriteStatic.shake(this._player,0.5,10);
			com_tilbuci_statictools_SpriteStatic.quickJump(this._opponent,0.5,30);
			this._timer = new haxe_Timer(500);
			this._timer.run = $bind(this,this.onLoose);
		} else if(valP > valO) {
			if(this.soundwin != "") {
				com_tilbuci_data_GlobalPlayer.contraptions.soundPlay(com_tilbuci_data_GlobalPlayer.parser.parseString(this.soundwin));
			}
			com_tilbuci_statictools_SpriteStatic.quickJump(this._player,0.5,30);
			com_tilbuci_statictools_SpriteStatic.shake(this._opponent,0.5,10);
			this._timer = new haxe_Timer(500);
			this._timer.run = $bind(this,this.onWin);
		} else {
			if(this.soundtie != "") {
				com_tilbuci_data_GlobalPlayer.contraptions.soundPlay(com_tilbuci_data_GlobalPlayer.parser.parseString(this.soundtie));
			}
			com_tilbuci_statictools_SpriteStatic.shake(this._player,0.5,5);
			com_tilbuci_statictools_SpriteStatic.shake(this._opponent,0.5,5);
		}
	}
	,onLoose: function() {
		try {
			this._timer.stop();
		} catch( _g ) {
		}
		this._timer = null;
		var index = this._playerData.current + 1;
		this._playerCurent.updateDisplay(index);
		if(index >= this._pcards.length) {
			this._won = false;
			this.onClose();
		} else {
			this._playerData.loadCard(this._pcards[index],index);
			this._player.draw(this._pcards[index]);
		}
	}
	,onWin: function() {
		try {
			this._timer.stop();
		} catch( _g ) {
		}
		this._timer = null;
		var index = this._opponentData.current + 1;
		this._opponentCurent.updateDisplay(index);
		if(index >= this._ocards.length) {
			this._won = true;
			this.onClose();
		} else {
			this._opponentData.loadCard(this._ocards[index],index);
			this._opponent.draw(this._ocards[index]);
		}
	}
	,setAttributes: function(pl,attr,gain,add,rem) {
		if(attr < 0) {
			attr = 0;
		}
		if(attr > 4) {
			attr = 4;
		}
		if(pl) {
			this._playerData.setAttr(attr,gain,add,rem);
		} else {
			this._opponentData.setAttr(attr,gain,add,rem);
		}
	}
	,create: function(win,loose,pcards,ocards) {
		this.removeChildren();
		this._cbitmap.set_visible(true);
		this._hbitmap.set_visible(this._vbitmap.set_visible(false));
		if(this.ok) {
			if(this._player == null) {
				this._player = new com_tilbuci_contraptions_BattleCard($bind(this,this.draw),true,$bind(this,this.compare),this._playerData);
			}
			if(this._opponent == null) {
				this._opponent = new com_tilbuci_contraptions_BattleCard($bind(this,this.draw),false,null,this._opponentData);
			}
			this._pcards = pcards;
			this._ocards = ocards;
			this._playerData.loadCard(pcards[0],0);
			this._opponentData.loadCard(ocards[0],0);
			this._player.draw(this._pcards[0]);
			this._opponent.draw(this._ocards[0]);
			if(this._playerCurent == null) {
				this._playerCurent = new com_tilbuci_contraptions_CurrentCards($bind(this,this.draw));
			}
			if(this._opponentCurent == null) {
				this._opponentCurent = new com_tilbuci_contraptions_CurrentCards($bind(this,this.draw));
			}
			this._playerCurent.draw(this._pcards);
			this._opponentCurent.draw(this._ocards);
			if(com_tilbuci_data_GlobalPlayer.area.get_pOrientation() == "horizontal") {
				this.addChild(this._hbitmap);
				this._hbitmap.set_x(this._hbitmap.set_y(0));
				this._hbitmap.set_width(com_tilbuci_data_GlobalPlayer.mdata.screen.big);
				this._hbitmap.set_height(com_tilbuci_data_GlobalPlayer.mdata.screen.small);
				this._cbitmap.set_x(this._hbitmap.get_width() - this._cbitmap.get_width());
				this._hbitmap.set_visible(true);
				this._player.set_x(this._cbitmap.get_width());
				this._player.set_y(this._cbitmap.get_height());
				this._opponent.set_x(this._hbitmap.get_width() / 2 + this._cbitmap.get_width() / 2);
				this._opponent.set_y(this._cbitmap.get_height());
				this._playerCurent.set_x(this._player.get_x());
				this._opponentCurent.set_x(this._opponent.get_x());
				this._playerCurent.set_y(com_tilbuci_data_GlobalPlayer.mdata.screen.small - this.btAtrHeight() * 1.5);
				this._opponentCurent.set_y(com_tilbuci_data_GlobalPlayer.mdata.screen.small - this.btAtrHeight() * 1.5);
				this._cardsize = new openfl_geom_Point(com_tilbuci_data_GlobalPlayer.mdata.screen.big / 2 - 1.5 * this._cbitmap.get_width(),com_tilbuci_data_GlobalPlayer.mdata.screen.small - this._cbitmap.get_height() - this.btAtrHeight() * 2);
			} else {
				this.addChild(this._vbitmap);
				this._vbitmap.set_x(this._vbitmap.set_y(0));
				this._vbitmap.set_width(com_tilbuci_data_GlobalPlayer.mdata.screen.small);
				this._vbitmap.set_height(com_tilbuci_data_GlobalPlayer.mdata.screen.big);
				this._cbitmap.set_x(this._vbitmap.get_width() - this._cbitmap.get_width());
				this._vbitmap.set_visible(true);
				this._player.set_x(this._cbitmap.get_width());
				this._player.set_y(this._cbitmap.get_height());
				this._opponent.set_x(this._cbitmap.get_width());
				this._opponent.set_y(this._vbitmap.get_height() / 2 + this._cbitmap.get_height() / 2);
				this._playerCurent.set_x(this._player.get_x());
				this._opponentCurent.set_x(this._opponent.get_x());
				this._playerCurent.set_y(this._vbitmap.get_height() / 2 - this.btAtrHeight() * 0.5);
				this._opponentCurent.set_y(this._vbitmap.get_height() - this.btAtrHeight() * 1.5);
				this._cardsize = new openfl_geom_Point(this._vbitmap.get_width() - 2 * this._cbitmap.get_width(),this._vbitmap.get_height() / 2 - this._cbitmap.get_height() / 2 - this.btAtrHeight() * 2);
			}
			this._cbitmap.set_y(0);
			this.addChild(this._cbitmap);
			this.addChild(this._player);
			this.addChild(this._opponent);
			this.addChild(this._playerCurent);
			this.addChild(this._opponentCurent);
			this._onloose = loose;
			this._onwin = win;
			this._won = false;
		}
		return this;
	}
	,draw: function() {
		this._player.set_width(this._cardsize.x);
		this._player.set_scaleY(this._player.get_scaleX());
		if(this._player.get_height() > this._cardsize.y) {
			this._player.set_height(this._cardsize.y);
			this._player.set_scaleX(this._player.get_scaleY());
		}
		this._opponent.set_width(this._cardsize.x);
		this._opponent.set_scaleY(this._opponent.get_scaleX());
		if(this._opponent.get_height() > this._cardsize.y) {
			this._opponent.set_height(this._cardsize.y);
			this._opponent.set_scaleX(this._opponent.get_scaleY());
		}
		if(com_tilbuci_data_GlobalPlayer.area.get_pOrientation() == "horizontal") {
			this._player.set_x(this._cbitmap.get_width() + (this._cardsize.x - this._player.get_width()) / 2);
			this._player.set_y(this._cbitmap.get_height() + (this._cardsize.y - this._player.get_height()) / 2);
			this._opponent.set_x(this._hbitmap.get_width() / 2 + this._cbitmap.get_width() / 2 + (this._cardsize.x - this._opponent.get_width()) / 2);
			this._opponent.set_y(this._cbitmap.get_height() + (this._cardsize.y - this._opponent.get_height()) / 2);
		} else {
			this._player.set_x(this._cbitmap.get_width() + (this._cardsize.x - this._player.get_width()) / 2);
			this._opponent.set_x(this._cbitmap.get_width() + (this._cardsize.x - this._opponent.get_width()) / 2);
			this._player.set_y(this._cbitmap.get_height() + (this._cardsize.y - this._player.get_height()) / 2);
			this._opponent.set_y(this._vbitmap.get_height() / 2 + this._cbitmap.get_height() / 2 + (this._cardsize.y - this._opponent.get_height()) / 2);
		}
		this._playerCurent.set_x(this._player.get_x() + (this._player.get_width() - this._playerCurent.get_width()) / 2);
		this._opponentCurent.set_x(this._opponent.get_x() + (this._opponent.get_width() - this._opponentCurent.get_width()) / 2);
	}
	,checkCollision: function(obj) {
		var found = false;
		if(this.ok) {
			found = this._cbitmap.hitTestObject(obj);
			if(found) {
				this.onClose();
			} else {
				found = this._player.checkCollision(obj);
			}
		}
		return found;
	}
	,checkOver: function(obj) {
		var found = false;
		if(this.ok) {
			found = this._cbitmap.hitTestObject(obj);
			if(!found) {
				found = this._player.checkOver(obj);
			}
		}
		return found;
	}
	,remove: function() {
		this.removeChildren();
		if(this.parent != null) {
			this.parent.removeChild(this);
		}
	}
	,clone: function() {
		var mn = new com_tilbuci_contraptions_BattleContraption();
		mn.load({ id : this.id, font : this.font, fontcolor : this.fontcolor, fontsize : this.fontsize, horizontal : this.horizontal, vertical : this.vertical, close : this.close, attrbg : this.attrbg, attributes : this.attributes, card : this.card, soundpick : this.soundpick, soundwin : this.soundwin, soundloose : this.soundloose, soundtie : this.soundtie});
		return mn;
	}
	,load: function(data) {
		this.ok = false;
		if(Object.prototype.hasOwnProperty.call(data,"id")) {
			this.id = Reflect.field(data,"id");
			if(Object.prototype.hasOwnProperty.call(data,"font")) {
				this.font = Reflect.field(data,"font");
			} else {
				this.font = "sans";
			}
			if(Object.prototype.hasOwnProperty.call(data,"fontcolor")) {
				this.fontcolor = Reflect.field(data,"fontcolor");
			} else {
				this.fontcolor = "0xffffff";
			}
			if(Object.prototype.hasOwnProperty.call(data,"fontsize")) {
				this.fontsize = Reflect.field(data,"fontsize");
			} else {
				this.fontsize = 20;
			}
			if(Object.prototype.hasOwnProperty.call(data,"vertical")) {
				this.vertical = Reflect.field(data,"vertical");
			} else {
				this.vertical = "";
			}
			if(Object.prototype.hasOwnProperty.call(data,"horizontal")) {
				this.horizontal = Reflect.field(data,"horizontal");
			} else {
				this.horizontal = "";
			}
			if(Object.prototype.hasOwnProperty.call(data,"close")) {
				this.close = Reflect.field(data,"close");
			} else {
				this.close = "";
			}
			if(Object.prototype.hasOwnProperty.call(data,"attrbg")) {
				this.attrbg = Reflect.field(data,"attrbg");
			} else {
				this.attrbg = "";
			}
			if(Object.prototype.hasOwnProperty.call(data,"card")) {
				this.card = Reflect.field(data,"card");
			} else {
				this.card = "";
			}
			if(Object.prototype.hasOwnProperty.call(data,"soundpick")) {
				this.soundpick = Reflect.field(data,"soundpick");
			} else {
				this.soundpick = "";
			}
			if(Object.prototype.hasOwnProperty.call(data,"soundwin")) {
				this.soundwin = Reflect.field(data,"soundwin");
			} else {
				this.soundwin = "";
			}
			if(Object.prototype.hasOwnProperty.call(data,"soundloose")) {
				this.soundloose = Reflect.field(data,"soundloose");
			} else {
				this.soundloose = "";
			}
			if(Object.prototype.hasOwnProperty.call(data,"soundtie")) {
				this.soundtie = Reflect.field(data,"soundtie");
			} else {
				this.soundtie = "";
			}
			if(Object.prototype.hasOwnProperty.call(data,"attributes")) {
				var atr = Reflect.field(data,"attributes");
				if(atr == null) {
					this.attributes = [];
				} else {
					this.attributes = atr;
				}
			} else {
				this.attributes = [];
			}
			if(this.font == null) {
				this.font = "sans";
			}
			if(this.fontcolor == null) {
				this.fontcolor = "0xffffff";
			}
			if(this.fontsize == null) {
				this.fontsize = 20;
			}
			if(this.horizontal == null) {
				this.horizontal = "";
			}
			if(this.vertical == null) {
				this.vertical = "";
			}
			if(this.close == null) {
				this.close = "";
			}
			if(this.attrbg == null) {
				this.attrbg = "";
			}
			if(this.card == null) {
				this.card = "";
			}
			if(this.soundpick == null) {
				this.soundpick = "";
			}
			if(this.soundwin == null) {
				this.soundwin = "";
			}
			if(this.soundloose == null) {
				this.soundloose = "";
			}
			if(this.soundtie == null) {
				this.soundtie = "";
			}
			this.fontcolor = com_tilbuci_statictools_StringStatic.colorHex(this.fontcolor,"#FFFFFF");
			if(this.horizontal != "" || this.vertical != "") {
				if(this.horizontal == "") {
					this.horizontal = this.vertical;
				}
				if(this.vertical == "") {
					this.vertical = this.horizontal;
				}
			}
			if(this._cbitmap == null) {
				this._cbitmap = new com_tilbuci_display_PictureImage($bind(this,this.onBTLoad));
			}
			this._cbitmap.load(this.close);
			return true;
		} else {
			return false;
		}
	}
	,loadGraphics: function() {
		this.ok = false;
		this.fontcolor = com_tilbuci_statictools_StringStatic.colorHex(this.fontcolor,"#FFFFFF");
		if(this.horizontal != "" || this.vertical != "") {
			if(this.horizontal == "") {
				this.horizontal = this.vertical;
			}
			if(this.vertical == "") {
				this.vertical = this.horizontal;
			}
		}
		if(this._cbitmap == null) {
			this._cbitmap = new com_tilbuci_display_PictureImage($bind(this,this.onBTLoad));
		}
		this._cbitmap.load(this.close);
	}
	,kill: function() {
		if(this.parent != null) {
			this.parent.removeChild(this);
		}
		this.removeChildren();
		this.id = this.font = this.fontcolor = this.horizontal = this.vertical = this.close = null;
		this.soundpick = this.soundwin = this.soundloose = this.soundtie = null;
		if(this.parent != null) {
			this.parent.removeChild(this);
		}
		if(this._cbitmap != null) {
			if(this._cbitmap.hasEventListener("click")) {
				this._cbitmap.removeEventListener("click",$bind(this,this.onClose));
				this._cbitmap.removeEventListener("mouseOver",$bind(this,this.onCloseOver));
				this._cbitmap.removeEventListener("mouseOut",$bind(this,this.onCloseOut));
			}
			this._cbitmap.kill();
		}
		this._cbitmap = null;
		if(this._hbitmap != null) {
			this._hbitmap.kill();
		}
		this._hbitmap = null;
		if(this._vbitmap != null) {
			this._vbitmap.kill();
		}
		this._vbitmap = null;
		if(this._abitmap != null) {
			this._abitmap.kill();
		}
		this._abitmap = null;
		while(this.attributes.length > 0) this.attributes.shift();
		this.attributes = null;
		if(this._player != null) {
			this._player.kill();
		}
		this._player = null;
		if(this._opponent != null) {
			this._opponent.kill();
		}
		this._opponent = null;
		if(this._playerCurent != null) {
			this._playerCurent.kill();
		}
		this._playerCurent = null;
		if(this._opponentCurent != null) {
			this._opponentCurent.kill();
		}
		this._opponentCurent = null;
		if(this._pcards != null) {
			while(this._pcards.length > 0) this._pcards.shift();
		}
		this._pcards = null;
		if(this._ocards != null) {
			while(this._ocards.length > 0) this._ocards.shift();
		}
		this._ocards = null;
		this._onwin = null;
		this._onloose = null;
		if(this._playerData != null) {
			this._playerData.kill();
		}
		if(this._opponentData != null) {
			this._opponentData.kill();
		}
		this._playerData = null;
		this._opponentData = null;
	}
	,toObject: function() {
		this.id = "bs";
		return { id : this.id, font : this.font, fontcolor : this.fontcolor, fontsize : this.fontsize, horizontal : this.horizontal, vertical : this.vertical, close : this.close, attrbg : this.attrbg, attributes : this.attributes, card : this.card, soundpick : this.soundpick, soundwin : this.soundwin, soundloose : this.soundloose, soundtie : this.soundtie};
	}
	,bsClose: function() {
		this.onCloseOut(null);
		this.removeChildren();
		if(this._won) {
			this._won = false;
			if(this._onwin != null) {
				com_tilbuci_data_GlobalPlayer.parser.run(this._onwin,true);
			}
		} else if(this._onloose != null) {
			com_tilbuci_data_GlobalPlayer.parser.run(this._onloose,true);
		}
		this._onloose = null;
		this._onwin = null;
	}
	,btAtrWidth: function() {
		if(this.ok) {
			return this._abitmap.oWidth;
		} else {
			return 0;
		}
	}
	,btAtrHeight: function() {
		if(this.ok) {
			return this._abitmap.oHeight;
		} else {
			return 0;
		}
	}
	,onBTLoad: function(ok) {
		this.ok = ok;
		if(ok) {
			if(this._abitmap == null) {
				this._abitmap = new com_tilbuci_display_PictureImage($bind(this,this.onAttrLoad));
			}
			this._abitmap.load(this.attrbg);
		}
	}
	,onAttrLoad: function(ok) {
		this.ok = ok;
		if(ok) {
			if(this._hbitmap == null) {
				this._hbitmap = new com_tilbuci_display_PictureImage($bind(this,this.onBgLoad));
			}
			this._hbitmap.load(this.horizontal);
			if(this._vbitmap == null) {
				this._vbitmap = new com_tilbuci_display_PictureImage($bind(this,this.onBgLoad));
			}
			this._vbitmap.load(this.vertical);
			this._cbitmap.addEventListener("click",$bind(this,this.onClose));
			this._cbitmap.addEventListener("mouseOver",$bind(this,this.onCloseOver));
			this._cbitmap.addEventListener("mouseOut",$bind(this,this.onCloseOut));
		}
	}
	,onBgLoad: function(ok) {
		if(!ok) {
			this.ok = false;
		}
	}
	,onClose: function(evt) {
		com_tilbuci_data_GlobalPlayer.parser.run("[ { \"ac\": \"battle.close\", \"param\": [ ] } ]");
	}
	,onCloseOver: function(evt) {
		if(com_tilbuci_data_GlobalPlayer.cursorVisible) {
			if(com_tilbuci_data_GlobalPlayer.mode != "editor" && com_tilbuci_data_GlobalPlayer.mdata.highlightInt != null && !com_tilbuci_data_GlobalPlayer.isMobile()) {
				this._cbitmap.set_filters([new openfl_filters_GlowFilter(com_tilbuci_data_GlobalPlayer.mdata.highlightInt,1,4,4,255,1,true)]);
			}
		}
	}
	,onCloseOut: function(evt) {
		this._cbitmap.set_filters([]);
	}
	,__class__: com_tilbuci_contraptions_BattleContraption
});
var com_tilbuci_contraptions_BattleCard = function(draw,pl,cp,data) {
	this._totalAttr = 5;
	this._player = false;
	this.attributes = [];
	openfl_display_Sprite.call(this);
	if(Object.prototype.hasOwnProperty.call(com_tilbuci_data_GlobalPlayer.contraptions.bs.h,"bs") && com_tilbuci_data_GlobalPlayer.contraptions.bs.h["bs"].card != "") {
		this._totalAttr = 0;
		var _g = 0;
		var _g1 = com_tilbuci_data_GlobalPlayer.contraptions.bs.h["bs"].attributes;
		while(_g < _g1.length) {
			var i = _g1[_g];
			++_g;
			if(i != "") {
				this._totalAttr++;
			}
		}
	}
	this._holder = new openfl_display_Sprite();
	this.graphic = new com_tilbuci_display_PictureImage($bind(this,this.onPic));
	this.background = new com_tilbuci_display_PictureImage($bind(this,this.onBg));
	this.attributes.push(new com_tilbuci_contraptions_AttributeButton(0,pl,cp));
	this.attributes.push(new com_tilbuci_contraptions_AttributeButton(1,pl,cp));
	this.attributes.push(new com_tilbuci_contraptions_AttributeButton(2,pl,cp));
	this.attributes.push(new com_tilbuci_contraptions_AttributeButton(3,pl,cp));
	this.attributes.push(new com_tilbuci_contraptions_AttributeButton(4,pl,cp));
	if(Object.prototype.hasOwnProperty.call(com_tilbuci_data_GlobalPlayer.contraptions.bs.h,"bs") && com_tilbuci_data_GlobalPlayer.contraptions.bs.h["bs"].card != "") {
		this.background.load(com_tilbuci_data_GlobalPlayer.contraptions.bs.h["bs"].card);
	}
	this._draw = draw;
	this._player = pl;
	this._data = data;
};
$hxClasses["com.tilbuci.contraptions.BattleCard"] = com_tilbuci_contraptions_BattleCard;
com_tilbuci_contraptions_BattleCard.__name__ = "com.tilbuci.contraptions.BattleCard";
com_tilbuci_contraptions_BattleCard.__super__ = openfl_display_Sprite;
com_tilbuci_contraptions_BattleCard.prototype = $extend(openfl_display_Sprite.prototype,{
	graphic: null
	,attributes: null
	,background: null
	,_holder: null
	,_draw: null
	,_player: null
	,_data: null
	,_totalAttr: null
	,draw: function(cardid) {
		this.removeChildren();
		if(Object.prototype.hasOwnProperty.call(com_tilbuci_data_GlobalPlayer.narrative.cards.h,cardid)) {
			var _g = 0;
			var _g1 = this.attributes;
			while(_g < _g1.length) {
				var a = _g1[_g];
				++_g;
				a.set_visible(false);
			}
			var _g = 0;
			var _g1 = com_tilbuci_data_GlobalPlayer.contraptions.bs.h["bs"].attributes.length;
			while(_g < _g1) {
				var i = _g++;
				this.attributes[i].draw(i,this._data.getValue(i,true),this._data.add[i],this._data.rem[i]);
			}
			this.graphic.load(com_tilbuci_data_GlobalPlayer.narrative.cards.h[cardid].cardgraphic);
			if(this.background.get_lastMedia() != com_tilbuci_data_GlobalPlayer.contraptions.bs.h["bs"].card) {
				this.background.load(com_tilbuci_data_GlobalPlayer.contraptions.bs.h["bs"].card);
			}
		}
	}
	,showAttrVal: function(num) {
		this.attributes[num].showValue(this._data.getValue(num,true),this._data.add[num],this._data.rem[num]);
	}
	,kill: function() {
		this.removeChildren();
		this._holder.removeChildren();
		this.graphic.kill();
		this.graphic = null;
		this.background.kill();
		this.background = null;
		while(this.attributes.length > 0) this.attributes.shift().kill();
		this.attributes = null;
		this._draw = null;
		this._data = null;
	}
	,checkOver: function(obj) {
		var found = false;
		var _g = 0;
		var _g1 = this.attributes;
		while(_g < _g1.length) {
			var at = _g1[_g];
			++_g;
			if(!found) {
				if(obj.hitTestObject(at)) {
					found = true;
				}
			}
		}
		return found;
	}
	,checkCollision: function(obj) {
		var found = false;
		var _g = 0;
		var _g1 = this.attributes;
		while(_g < _g1.length) {
			var at = _g1[_g];
			++_g;
			if(!found) {
				if(obj.hitTestObject(at)) {
					found = true;
					at.onClick();
				}
			}
		}
		return found;
	}
	,pulse: function(num) {
		this._holder.removeChild(this.attributes[num]);
		this._holder.addChild(this.attributes[num]);
		com_tilbuci_statictools_SpriteStatic.pulse(this.attributes[num],0.5,1.5,2);
	}
	,onPic: function(ok) {
		this._holder.removeChildren();
		this.graphic.set_width(this.graphic.set_height(com_tilbuci_data_GlobalPlayer.contraptions.bs.h["bs"].btAtrHeight() * 3));
		this.graphic.set_x((com_tilbuci_data_GlobalPlayer.contraptions.bs.h["bs"].btAtrWidth() - this.graphic.get_width()) / 2);
		this.graphic.set_y(0);
		this.graphic.set_visible(true);
		this._holder.addChild(this.graphic);
		var _g = 0;
		var _g1 = this.attributes.length;
		while(_g < _g1) {
			var i = _g++;
			if(this.attributes[i].get_visible()) {
				this.attributes[i].set_x(0);
				this.attributes[i].set_y(this.graphic.get_height() + com_tilbuci_data_GlobalPlayer.contraptions.bs.h["bs"].btAtrHeight() / 2 + i * com_tilbuci_data_GlobalPlayer.contraptions.bs.h["bs"].btAtrHeight() / this._totalAttr + i * com_tilbuci_data_GlobalPlayer.contraptions.bs.h["bs"].btAtrHeight());
				this._holder.addChild(this.attributes[i]);
			}
		}
		this.place();
	}
	,onBg: function(ok) {
		this.background.set_width(this.background.oWidth);
		this.background.set_height(this.background.oHeight);
		this.background.set_visible(true);
		this.place();
	}
	,place: function() {
		this.removeChildren();
		this.background.set_width(this.background.oWidth);
		this.background.set_height(this.background.oHeight);
		this.background.set_x(this.background.set_y(0));
		this._holder.set_width(this.background.get_width() - 2 * com_tilbuci_data_GlobalPlayer.contraptions.bs.h["bs"].btAtrHeight() / this._totalAttr);
		this._holder.set_scaleY(this._holder.get_scaleX());
		if(this._holder.get_height() > this.background.get_height() - 2 * com_tilbuci_data_GlobalPlayer.contraptions.bs.h["bs"].btAtrHeight() / this._totalAttr) {
			this._holder.set_height(this.background.get_height() - 2 * com_tilbuci_data_GlobalPlayer.contraptions.bs.h["bs"].btAtrHeight() / this._totalAttr);
			this._holder.set_scaleX(this._holder.get_scaleY());
		}
		this._holder.set_x((this.background.get_width() - this._holder.get_width()) / 2);
		this._holder.set_y((this.background.get_height() - this._holder.get_height()) / 2);
		this.addChild(this.background);
		this.addChild(this._holder);
		this._draw();
	}
	,__class__: com_tilbuci_contraptions_BattleCard
});
var com_tilbuci_contraptions_AttributeButton = function(id,pl,cp) {
	this._player = false;
	openfl_display_Sprite.call(this);
	this.id = id;
	this._player = pl;
	this._compare = cp;
	this.graphic = new com_tilbuci_display_PictureImage($bind(this,this.onPic));
	this.text = new openfl_text_TextField();
	this.value = new openfl_text_TextField();
	this.addChild(this.graphic);
	this.addChild(this.text);
	this.addChild(this.value);
	this.mouseChildren = false;
	if(Object.prototype.hasOwnProperty.call(com_tilbuci_data_GlobalPlayer.contraptions.bs.h,"bs") && com_tilbuci_data_GlobalPlayer.contraptions.bs.h["bs"].attrbg != "") {
		this.graphic.load(com_tilbuci_data_GlobalPlayer.contraptions.bs.h["bs"].attrbg);
	}
	if(pl) {
		this.addEventListener("click",$bind(this,this.onClick));
		this.addEventListener("mouseOver",$bind(this,this.onOver));
		this.addEventListener("mouseOut",$bind(this,this.onOut));
	}
};
$hxClasses["com.tilbuci.contraptions.AttributeButton"] = com_tilbuci_contraptions_AttributeButton;
com_tilbuci_contraptions_AttributeButton.__name__ = "com.tilbuci.contraptions.AttributeButton";
com_tilbuci_contraptions_AttributeButton.__super__ = openfl_display_Sprite;
com_tilbuci_contraptions_AttributeButton.prototype = $extend(openfl_display_Sprite.prototype,{
	id: null
	,graphic: null
	,text: null
	,value: null
	,_player: null
	,_compare: null
	,showValue: function(val,add,rem) {
		if(add == 0 && rem == 0) {
			this.value.set_text(val + "");
		} else {
			if(rem != 0) {
				this.value.set_text(val - rem + " ... ");
			} else {
				this.value.set_text(val + " ... ");
			}
			if(add != 0) {
				var fh = this.value;
				fh.set_text(fh.get_text() + (val + add + ""));
			} else {
				var fh = this.value;
				fh.set_text(fh.get_text() + (val + ""));
			}
		}
	}
	,draw: function(attr,val,add,rem) {
		this.set_visible(true);
		this.text.set_defaultTextFormat(new openfl_text_TextFormat(com_tilbuci_data_GlobalPlayer.contraptions.bs.h["bs"].font,com_tilbuci_data_GlobalPlayer.contraptions.bs.h["bs"].fontsize,com_tilbuci_statictools_StringStatic.colorInt(com_tilbuci_data_GlobalPlayer.contraptions.bs.h["bs"].fontcolor),null,null,null,null,null,openfl_text_TextFormatAlign.fromString("left")));
		this.value.set_defaultTextFormat(new openfl_text_TextFormat(com_tilbuci_data_GlobalPlayer.contraptions.bs.h["bs"].font,com_tilbuci_data_GlobalPlayer.contraptions.bs.h["bs"].fontsize,com_tilbuci_statictools_StringStatic.colorInt(com_tilbuci_data_GlobalPlayer.contraptions.bs.h["bs"].fontcolor),null,null,null,null,null,openfl_text_TextFormatAlign.fromString("right")));
		if(this._player) {
			this.text.set_text(com_tilbuci_data_GlobalPlayer.parser.parseString(com_tilbuci_data_GlobalPlayer.contraptions.bs.h["bs"].attributes[attr]));
			if(add == 0 && rem == 0) {
				this.value.set_text(val + "");
			} else {
				if(rem != 0) {
					this.value.set_text(val - rem + " ... ");
				} else {
					this.value.set_text(val + " ... ");
				}
				if(add != 0) {
					var fh = this.value;
					fh.set_text(fh.get_text() + (val + add + ""));
				} else {
					var fh = this.value;
					fh.set_text(fh.get_text() + (val + ""));
				}
			}
		} else {
			this.text.set_text(com_tilbuci_data_GlobalPlayer.parser.parseString(com_tilbuci_data_GlobalPlayer.contraptions.bs.h["bs"].attributes[attr]));
			this.value.set_text("?");
		}
		if(this.graphic.get_lastMedia() != com_tilbuci_data_GlobalPlayer.contraptions.bs.h["bs"].attrbg) {
			this.graphic.load(com_tilbuci_data_GlobalPlayer.contraptions.bs.h["bs"].attrbg);
		} else {
			this.onPic(true);
		}
	}
	,kill: function() {
		this.removeChildren();
		if(this._player) {
			this.removeEventListener("click",$bind(this,this.onClick));
			this.removeEventListener("mouseOver",$bind(this,this.onOver));
			this.removeEventListener("mouseOut",$bind(this,this.onOut));
		}
		this.text = null;
		this.value = null;
		this.graphic.kill();
		this.graphic = null;
		this._compare = null;
	}
	,onPic: function(ok) {
		this.graphic.set_visible(true);
		this.graphic.set_width(this.graphic.oWidth);
		this.graphic.set_height(this.graphic.oHeight);
		this.text.set_height(this.text.get_textHeight() + 4);
		this.text.set_y((this.graphic.oHeight - this.text.get_height()) / 2);
		this.text.set_visible(true);
		this.value.set_height(this.value.get_textHeight() + 4);
		this.value.set_y((this.graphic.oHeight - this.value.get_height()) / 2);
		this.value.set_visible(true);
		this.text.set_width(this.value.set_width(this.graphic.get_width() - this.graphic.get_height()));
		this.text.set_x(this.value.set_x(this.graphic.get_height() / 2));
	}
	,onClick: function(evt) {
		this._compare(this.id);
	}
	,onOver: function(evt) {
		if(com_tilbuci_data_GlobalPlayer.cursorVisible) {
			if(com_tilbuci_data_GlobalPlayer.mode != "editor" && com_tilbuci_data_GlobalPlayer.mdata.highlightInt != null && !com_tilbuci_data_GlobalPlayer.isMobile()) {
				this.set_filters([new openfl_filters_GlowFilter(com_tilbuci_data_GlobalPlayer.mdata.highlightInt,1,4,4,255,1,true)]);
			}
		}
	}
	,onOut: function(evt) {
		this.set_filters([]);
	}
	,__class__: com_tilbuci_contraptions_AttributeButton
});
var com_tilbuci_contraptions_CurrentCards = function(draw) {
	this.cards = [];
	openfl_display_Sprite.call(this);
	this.mouseEnabled = false;
	this.cards.push(new com_tilbuci_display_PictureImage($bind(this,this.onCard)));
	this.cards.push(new com_tilbuci_display_PictureImage($bind(this,this.onCard)));
	this.cards.push(new com_tilbuci_display_PictureImage($bind(this,this.onCard)));
	this.cards.push(new com_tilbuci_display_PictureImage($bind(this,this.onCard)));
	this.cards.push(new com_tilbuci_display_PictureImage($bind(this,this.onCard)));
	this._draw = draw;
};
$hxClasses["com.tilbuci.contraptions.CurrentCards"] = com_tilbuci_contraptions_CurrentCards;
com_tilbuci_contraptions_CurrentCards.__name__ = "com.tilbuci.contraptions.CurrentCards";
com_tilbuci_contraptions_CurrentCards.__super__ = openfl_display_Sprite;
com_tilbuci_contraptions_CurrentCards.prototype = $extend(openfl_display_Sprite.prototype,{
	cards: null
	,_draw: null
	,updateDisplay: function(current) {
		var _g = 0;
		var _g1 = this.cards.length;
		while(_g < _g1) {
			var i = _g++;
			if(i >= current) {
				this.cards[i].set_alpha(1);
			} else {
				this.cards[i].set_alpha(0.25);
			}
		}
	}
	,draw: function(list) {
		this.removeChildren();
		var _g = 0;
		var _g1 = this.cards;
		while(_g < _g1.length) {
			var c = _g1[_g];
			++_g;
			c.set_visible(false);
			c.unload();
		}
		var _g = 0;
		var _g1 = list.length;
		while(_g < _g1) {
			var i = _g++;
			if(i < this.cards.length) {
				if(Object.prototype.hasOwnProperty.call(com_tilbuci_data_GlobalPlayer.narrative.cards.h,list[i])) {
					this.cards[i].load(com_tilbuci_data_GlobalPlayer.narrative.cards.h[list[i]].cardgraphic);
					this.cards[i].set_alpha(1);
				}
			}
		}
	}
	,kill: function() {
		this.removeChildren();
		while(this.cards.length > 0) this.cards.shift().kill();
		this.cards = null;
		this._draw = null;
	}
	,onCard: function(ok) {
		this.removeChildren();
		var _g = 0;
		var _g1 = this.cards.length;
		while(_g < _g1) {
			var i = _g++;
			if(this.cards[i].get_mediaLoaded()) {
				this.cards[i].set_width(this.cards[i].set_height(com_tilbuci_data_GlobalPlayer.contraptions.bs.h["bs"].btAtrHeight() / 2));
				this.cards[i].set_y(0);
				this.cards[i].set_x(i * (com_tilbuci_data_GlobalPlayer.contraptions.bs.h["bs"].btAtrHeight() / 2 + 0.5 * com_tilbuci_data_GlobalPlayer.contraptions.bs.h["bs"].btAtrHeight() / 3));
				this.cards[i].set_visible(true);
				this.addChild(this.cards[i]);
			}
		}
		this._draw();
	}
	,__class__: com_tilbuci_contraptions_CurrentCards
});
var com_tilbuci_contraptions_BattleData = function() {
	this.rem = [0,0,0,0,0];
	this.add = [0,0,0,0,0];
	this.gain = [0,0,0,0,0];
	this.attr = [0,0,0,0,0];
	this.current = -1;
};
$hxClasses["com.tilbuci.contraptions.BattleData"] = com_tilbuci_contraptions_BattleData;
com_tilbuci_contraptions_BattleData.__name__ = "com.tilbuci.contraptions.BattleData";
com_tilbuci_contraptions_BattleData.prototype = {
	current: null
	,attr: null
	,gain: null
	,add: null
	,rem: null
	,clear: function() {
		this.current = 0;
	}
	,loadCard: function(name,index) {
		if(Object.prototype.hasOwnProperty.call(com_tilbuci_data_GlobalPlayer.narrative.cards.h,name)) {
			while(this.attr.length > 0) this.attr.shift();
			var _g = 0;
			var _g1 = com_tilbuci_data_GlobalPlayer.narrative.cards.h[name].cardattributes;
			while(_g < _g1.length) {
				var i = _g1[_g];
				++_g;
				this.attr.push(i);
			}
			this.current = index;
		}
	}
	,setAttr: function(attr,gain,add,rem) {
		this.gain[attr] = gain;
		this.add[attr] = add;
		this.rem[attr] = rem;
	}
	,getValue: function(attr,base) {
		if(base == null) {
			base = false;
		}
		if(base) {
			return this.attr[attr] + this.gain[attr];
		} else {
			return this.attr[attr] + this.gain[attr] + (Math.random() * this.add[attr] | 0) - (Math.random() * this.rem[attr] | 0);
		}
	}
	,kill: function() {
		while(this.attr.length > 0) this.attr.shift();
		while(this.gain.length > 0) this.gain.shift();
		while(this.add.length > 0) this.add.shift();
		while(this.rem.length > 0) this.rem.shift();
		this.attr = null;
		this.gain = null;
		this.add = null;
		this.rem = null;
	}
	,__class__: com_tilbuci_contraptions_BattleData
};
var com_tilbuci_contraptions_ContraptionButton = function(val,action,image,text,font,ftsize,ftcolor) {
	openfl_display_Sprite.call(this);
	this.value = val;
	this._ac = action;
	if(com_tilbuci_data_GlobalPlayer.mdata.highlightInt != null && !com_tilbuci_data_GlobalPlayer.isMobile()) {
		this.addEventListener("mouseOver",$bind(this,this.onMouseOver));
		this.addEventListener("mouseOut",$bind(this,this.onMouseOut));
	}
	this._img = new com_tilbuci_display_PictureImage($bind(this,this.onLoad));
	this._img.load(image);
	this.addChild(this._img);
	this._img.set_visible(true);
	this._text = new openfl_text_TextField();
	this._text.set_defaultTextFormat(new openfl_text_TextFormat(font,ftsize,ftcolor,null,null,null,null,null,0));
	this._text.set_multiline(false);
	this._text.set_wordWrap(false);
	this._text.set_text(com_tilbuci_data_GlobalPlayer.parser.parseString(text));
	this._text.set_visible(false);
	this._text.set_selectable(false);
	this.addChild(this._text);
	this.mouseChildren = false;
	this.addEventListener("click",$bind(this,this.onClick));
};
$hxClasses["com.tilbuci.contraptions.ContraptionButton"] = com_tilbuci_contraptions_ContraptionButton;
com_tilbuci_contraptions_ContraptionButton.__name__ = "com.tilbuci.contraptions.ContraptionButton";
com_tilbuci_contraptions_ContraptionButton.__super__ = openfl_display_Sprite;
com_tilbuci_contraptions_ContraptionButton.prototype = $extend(openfl_display_Sprite.prototype,{
	_img: null
	,_text: null
	,value: null
	,_ac: null
	,kill: function() {
		this.removeChildren();
		if(this.hasEventListener("mouseOver")) {
			this.removeEventListener("mouseOver",$bind(this,this.onMouseOver));
			this.removeEventListener("mouseOut",$bind(this,this.onMouseOut));
		}
		this.removeEventListener("click",$bind(this,this.onClick));
		this._img.kill();
		this._img = null;
		this._text = null;
		this.value = null;
		this._ac = null;
	}
	,onLoad: function(ok) {
		if(ok) {
			this._text.set_width(this._img.oWidth);
			this._text.set_height(this._text.get_textHeight() + 4);
			this._text.set_y((this._img.oHeight - this._text.get_height()) / 2);
			this._text.set_visible(true);
		}
	}
	,onMouseOver: function(evt) {
		if(com_tilbuci_data_GlobalPlayer.cursorVisible) {
			this.set_filters([new openfl_filters_GlowFilter(com_tilbuci_data_GlobalPlayer.mdata.highlightInt,1,4,4,255,1,true)]);
		}
	}
	,onMouseOut: function(evt) {
		this.set_filters([]);
	}
	,onClick: function(evt) {
		this.set_filters([]);
		this._ac(this.value);
	}
	,__class__: com_tilbuci_contraptions_ContraptionButton
});
var com_tilbuci_contraptions_Contraptions = function() {
	this.interf = new haxe_ds_StringMap();
	this._formcurrent = "";
	this.forms = new haxe_ds_StringMap();
	this.sounds = new haxe_ds_StringMap();
	this.musics = new haxe_ds_StringMap();
	this.backgrounds = new haxe_ds_StringMap();
	this.targets = new haxe_ds_StringMap();
	this.covers = new haxe_ds_StringMap();
	this.usingMessages = false;
	this._messagesCurrent = null;
	this.messages = new haxe_ds_StringMap();
	this.usingBs = false;
	this._bsCurrent = null;
	this.bs = new haxe_ds_StringMap();
	this.usingInv = false;
	this._invCurrent = null;
	this.inv = new haxe_ds_StringMap();
	this.usingDflow = false;
	this._dflowCurrent = null;
	this.dflow = new haxe_ds_StringMap();
	this.usingMenu = false;
	this._menuCurrent = null;
	this.menus = new haxe_ds_StringMap();
};
$hxClasses["com.tilbuci.contraptions.Contraptions"] = com_tilbuci_contraptions_Contraptions;
com_tilbuci_contraptions_Contraptions.__name__ = "com.tilbuci.contraptions.Contraptions";
com_tilbuci_contraptions_Contraptions.prototype = {
	menus: null
	,_menusOverlay: null
	,_menuAction: null
	,_menuVariable: null
	,_menuCurrent: null
	,usingMenu: null
	,dflow: null
	,_dflowOverlay: null
	,_dflowCurrent: null
	,usingDflow: null
	,inv: null
	,_invOverlay: null
	,_invCurrent: null
	,usingInv: null
	,bs: null
	,_bsOverlay: null
	,_bsCurrent: null
	,usingBs: null
	,messages: null
	,_messagesOverlay: null
	,_messagesAction: null
	,_messagesVariable: null
	,_messagesCurrent: null
	,usingMessages: null
	,covers: null
	,_coverOverlay: null
	,targets: null
	,backgrounds: null
	,_backgroundOverlay: null
	,_loadingOverlay: null
	,_loadingIc: null
	,_zoomOverlay: null
	,_zoomPicture: null
	,_zoomVideo: null
	,musics: null
	,sounds: null
	,forms: null
	,_formsOverlay: null
	,_formcurrent: null
	,interf: null
	,_interfaceOverlay: null
	,getLayers: function() {
		if(this._coverOverlay == null) {
			this._coverOverlay = com_tilbuci_data_GlobalPlayer.area.getOverlay("contraptions-cover");
		}
		this._coverOverlay.mouseEnabled = false;
		if(this._backgroundOverlay == null) {
			this._backgroundOverlay = com_tilbuci_data_GlobalPlayer.area.getOverlay("contraptions-background",true);
		}
		this._backgroundOverlay.mouseEnabled = false;
		if(this._zoomOverlay == null) {
			this._zoomOverlay = com_tilbuci_data_GlobalPlayer.area.getOverlay("contraptions-zoom");
		}
		if(this._formsOverlay == null) {
			this._formsOverlay = com_tilbuci_data_GlobalPlayer.area.getOverlay("contraptions-forms");
		}
		if(this._menusOverlay == null) {
			this._menusOverlay = com_tilbuci_data_GlobalPlayer.area.getOverlay("contraptions-menu");
		}
		if(this._interfaceOverlay == null) {
			this._interfaceOverlay = com_tilbuci_data_GlobalPlayer.area.getOverlay("contraptions-interface");
		}
		if(this._dflowOverlay == null) {
			this._dflowOverlay = com_tilbuci_data_GlobalPlayer.area.getOverlay("contraptions-dflow");
		}
		if(this._invOverlay == null) {
			this._invOverlay = com_tilbuci_data_GlobalPlayer.area.getOverlay("contraptions-inventory");
		}
		if(this._bsOverlay == null) {
			this._bsOverlay = com_tilbuci_data_GlobalPlayer.area.getOverlay("contraptions-battle");
		}
		if(this._messagesOverlay == null) {
			this._messagesOverlay = com_tilbuci_data_GlobalPlayer.area.getOverlay("contraptions-messages");
		}
		if(this._loadingOverlay == null) {
			this._loadingOverlay = com_tilbuci_data_GlobalPlayer.area.getOverlay("contraptions-loading");
		}
		this._loadingOverlay.mouseEnabled = false;
	}
	,clear: function() {
		this.getLayers();
		var h = this.covers.h;
		var k_h = h;
		var k_keys = Object.keys(h);
		var k_length = k_keys.length;
		var k_current = 0;
		while(k_current < k_length) {
			var k = k_keys[k_current++];
			this.covers.h[k].kill();
			var _this = this.covers;
			if(Object.prototype.hasOwnProperty.call(_this.h,k)) {
				delete(_this.h[k]);
			}
		}
		this._coverOverlay.get_graphics().clear();
		var h = this.backgrounds.h;
		var k_h = h;
		var k_keys = Object.keys(h);
		var k_length = k_keys.length;
		var k_current = 0;
		while(k_current < k_length) {
			var k = k_keys[k_current++];
			this.backgrounds.h[k].kill();
			var _this = this.backgrounds;
			if(Object.prototype.hasOwnProperty.call(_this.h,k)) {
				delete(_this.h[k]);
			}
		}
		this._backgroundOverlay.get_graphics().clear();
		var h = this.menus.h;
		var k_h = h;
		var k_keys = Object.keys(h);
		var k_length = k_keys.length;
		var k_current = 0;
		while(k_current < k_length) {
			var k = k_keys[k_current++];
			this.menus.h[k].kill();
			var _this = this.menus;
			if(Object.prototype.hasOwnProperty.call(_this.h,k)) {
				delete(_this.h[k]);
			}
		}
		this._menusOverlay.get_graphics().clear();
		var h = this.dflow.h;
		var k_h = h;
		var k_keys = Object.keys(h);
		var k_length = k_keys.length;
		var k_current = 0;
		while(k_current < k_length) {
			var k = k_keys[k_current++];
			this.dflow.h[k].kill();
			var _this = this.dflow;
			if(Object.prototype.hasOwnProperty.call(_this.h,k)) {
				delete(_this.h[k]);
			}
		}
		this._dflowOverlay.get_graphics().clear();
		var h = this.inv.h;
		var k_h = h;
		var k_keys = Object.keys(h);
		var k_length = k_keys.length;
		var k_current = 0;
		while(k_current < k_length) {
			var k = k_keys[k_current++];
			this.inv.h[k].kill();
			var _this = this.inv;
			if(Object.prototype.hasOwnProperty.call(_this.h,k)) {
				delete(_this.h[k]);
			}
		}
		this._invOverlay.get_graphics().clear();
		var h = this.bs.h;
		var k_h = h;
		var k_keys = Object.keys(h);
		var k_length = k_keys.length;
		var k_current = 0;
		while(k_current < k_length) {
			var k = k_keys[k_current++];
			this.bs.h[k].kill();
			var _this = this.bs;
			if(Object.prototype.hasOwnProperty.call(_this.h,k)) {
				delete(_this.h[k]);
			}
		}
		this._bsOverlay.get_graphics().clear();
		var h = this.messages.h;
		var k_h = h;
		var k_keys = Object.keys(h);
		var k_length = k_keys.length;
		var k_current = 0;
		while(k_current < k_length) {
			var k = k_keys[k_current++];
			this.messages.h[k].kill();
			var _this = this.messages;
			if(Object.prototype.hasOwnProperty.call(_this.h,k)) {
				delete(_this.h[k]);
			}
		}
		this._messagesOverlay.get_graphics().clear();
		var h = this.forms.h;
		var k_h = h;
		var k_keys = Object.keys(h);
		var k_length = k_keys.length;
		var k_current = 0;
		while(k_current < k_length) {
			var k = k_keys[k_current++];
			this.forms.h[k].kill();
			var _this = this.forms;
			if(Object.prototype.hasOwnProperty.call(_this.h,k)) {
				delete(_this.h[k]);
			}
		}
		this._formsOverlay.get_graphics().clear();
		var h = this.interf.h;
		var k_h = h;
		var k_keys = Object.keys(h);
		var k_length = k_keys.length;
		var k_current = 0;
		while(k_current < k_length) {
			var k = k_keys[k_current++];
			this.interf.h[k].kill();
			var _this = this.interf;
			if(Object.prototype.hasOwnProperty.call(_this.h,k)) {
				delete(_this.h[k]);
			}
		}
		this._interfaceOverlay.get_graphics().clear();
	}
	,removeAll: function() {
		var h = this.menus.h;
		var k_h = h;
		var k_keys = Object.keys(h);
		var k_length = k_keys.length;
		var k_current = 0;
		while(k_current < k_length) {
			var k = k_keys[k_current++];
			this.menus.h[k].kill();
			var _this = this.menus;
			if(Object.prototype.hasOwnProperty.call(_this.h,k)) {
				delete(_this.h[k]);
			}
		}
		var h = this.dflow.h;
		var k_h = h;
		var k_keys = Object.keys(h);
		var k_length = k_keys.length;
		var k_current = 0;
		while(k_current < k_length) {
			var k = k_keys[k_current++];
			this.dflow.h[k].kill();
			var _this = this.dflow;
			if(Object.prototype.hasOwnProperty.call(_this.h,k)) {
				delete(_this.h[k]);
			}
		}
		var h = this.inv.h;
		var k_h = h;
		var k_keys = Object.keys(h);
		var k_length = k_keys.length;
		var k_current = 0;
		while(k_current < k_length) {
			var k = k_keys[k_current++];
			this.inv.h[k].kill();
			var _this = this.inv;
			if(Object.prototype.hasOwnProperty.call(_this.h,k)) {
				delete(_this.h[k]);
			}
		}
		var h = this.bs.h;
		var k_h = h;
		var k_keys = Object.keys(h);
		var k_length = k_keys.length;
		var k_current = 0;
		while(k_current < k_length) {
			var k = k_keys[k_current++];
			this.bs.h[k].kill();
			var _this = this.bs;
			if(Object.prototype.hasOwnProperty.call(_this.h,k)) {
				delete(_this.h[k]);
			}
		}
		var h = this.messages.h;
		var k_h = h;
		var k_keys = Object.keys(h);
		var k_length = k_keys.length;
		var k_current = 0;
		while(k_current < k_length) {
			var k = k_keys[k_current++];
			this.messages.h[k].kill();
			var _this = this.messages;
			if(Object.prototype.hasOwnProperty.call(_this.h,k)) {
				delete(_this.h[k]);
			}
		}
		var h = this.covers.h;
		var k_h = h;
		var k_keys = Object.keys(h);
		var k_length = k_keys.length;
		var k_current = 0;
		while(k_current < k_length) {
			var k = k_keys[k_current++];
			this.covers.h[k].kill();
			var _this = this.covers;
			if(Object.prototype.hasOwnProperty.call(_this.h,k)) {
				delete(_this.h[k]);
			}
		}
		var h = this.backgrounds.h;
		var k_h = h;
		var k_keys = Object.keys(h);
		var k_length = k_keys.length;
		var k_current = 0;
		while(k_current < k_length) {
			var k = k_keys[k_current++];
			this.backgrounds.h[k].kill();
			var _this = this.backgrounds;
			if(Object.prototype.hasOwnProperty.call(_this.h,k)) {
				delete(_this.h[k]);
			}
		}
		var h = this.musics.h;
		var k_h = h;
		var k_keys = Object.keys(h);
		var k_length = k_keys.length;
		var k_current = 0;
		while(k_current < k_length) {
			var k = k_keys[k_current++];
			this.musics.h[k].kill();
			var _this = this.musics;
			if(Object.prototype.hasOwnProperty.call(_this.h,k)) {
				delete(_this.h[k]);
			}
		}
		var h = this.sounds.h;
		var k_h = h;
		var k_keys = Object.keys(h);
		var k_length = k_keys.length;
		var k_current = 0;
		while(k_current < k_length) {
			var k = k_keys[k_current++];
			this.sounds.h[k].kill();
			var _this = this.sounds;
			if(Object.prototype.hasOwnProperty.call(_this.h,k)) {
				delete(_this.h[k]);
			}
		}
		var h = this.targets.h;
		var k_h = h;
		var k_keys = Object.keys(h);
		var k_length = k_keys.length;
		var k_current = 0;
		while(k_current < k_length) {
			var k = k_keys[k_current++];
			this.targets.h[k].kill();
			var _this = this.targets;
			if(Object.prototype.hasOwnProperty.call(_this.h,k)) {
				delete(_this.h[k]);
			}
		}
		var h = this.forms.h;
		var k_h = h;
		var k_keys = Object.keys(h);
		var k_length = k_keys.length;
		var k_current = 0;
		while(k_current < k_length) {
			var k = k_keys[k_current++];
			this.forms.h[k].kill();
			var _this = this.forms;
			if(Object.prototype.hasOwnProperty.call(_this.h,k)) {
				delete(_this.h[k]);
			}
		}
		var h = this.interf.h;
		var k_h = h;
		var k_keys = Object.keys(h);
		var k_length = k_keys.length;
		var k_current = 0;
		while(k_current < k_length) {
			var k = k_keys[k_current++];
			this.interf.h[k].kill();
			var _this = this.interf;
			if(Object.prototype.hasOwnProperty.call(_this.h,k)) {
				delete(_this.h[k]);
			}
		}
	}
	,getData: function() {
		var data = new haxe_ds_StringMap();
		var v = [];
		data.h["covers"] = v;
		var h = this.covers.h;
		var cv_h = h;
		var cv_keys = Object.keys(h);
		var cv_length = cv_keys.length;
		var cv_current = 0;
		while(cv_current < cv_length) {
			var cv = cv_h[cv_keys[cv_current++]];
			data.h["covers"].push(cv.toObject());
		}
		var v = [];
		data.h["backgrounds"] = v;
		var h = this.backgrounds.h;
		var cv_h = h;
		var cv_keys = Object.keys(h);
		var cv_length = cv_keys.length;
		var cv_current = 0;
		while(cv_current < cv_length) {
			var cv = cv_h[cv_keys[cv_current++]];
			data.h["backgrounds"].push(cv.toObject());
		}
		var v = [];
		data.h["menus"] = v;
		var h = this.menus.h;
		var mn_h = h;
		var mn_keys = Object.keys(h);
		var mn_length = mn_keys.length;
		var mn_current = 0;
		while(mn_current < mn_length) {
			var mn = mn_h[mn_keys[mn_current++]];
			data.h["menus"].push(mn.toObject());
		}
		var v = [];
		data.h["dflow"] = v;
		var h = this.dflow.h;
		var df_h = h;
		var df_keys = Object.keys(h);
		var df_length = df_keys.length;
		var df_current = 0;
		while(df_current < df_length) {
			var df = df_h[df_keys[df_current++]];
			data.h["dflow"].push(df.toObject());
		}
		var v = [];
		data.h["inv"] = v;
		var h = this.inv.h;
		var ic_h = h;
		var ic_keys = Object.keys(h);
		var ic_length = ic_keys.length;
		var ic_current = 0;
		while(ic_current < ic_length) {
			var ic = ic_h[ic_keys[ic_current++]];
			data.h["inv"].push(ic.toObject());
		}
		var v = [];
		data.h["bs"] = v;
		var h = this.bs.h;
		var bc_h = h;
		var bc_keys = Object.keys(h);
		var bc_length = bc_keys.length;
		var bc_current = 0;
		while(bc_current < bc_length) {
			var bc = bc_h[bc_keys[bc_current++]];
			data.h["bs"].push(bc.toObject());
		}
		var v = [];
		data.h["messages"] = v;
		var h = this.messages.h;
		var ms_h = h;
		var ms_keys = Object.keys(h);
		var ms_length = ms_keys.length;
		var ms_current = 0;
		while(ms_current < ms_length) {
			var ms = ms_h[ms_keys[ms_current++]];
			data.h["messages"].push(ms.toObject());
		}
		var v = [];
		data.h["musics"] = v;
		var h = this.musics.h;
		var ms_h = h;
		var ms_keys = Object.keys(h);
		var ms_length = ms_keys.length;
		var ms_current = 0;
		while(ms_current < ms_length) {
			var ms = ms_h[ms_keys[ms_current++]];
			data.h["musics"].push(ms.toObject());
		}
		var v = [];
		data.h["sounds"] = v;
		var h = this.sounds.h;
		var snd_h = h;
		var snd_keys = Object.keys(h);
		var snd_length = snd_keys.length;
		var snd_current = 0;
		while(snd_current < snd_length) {
			var snd = snd_h[snd_keys[snd_current++]];
			data.h["sounds"].push(snd.toObject());
		}
		var v = [];
		data.h["forms"] = v;
		var h = this.forms.h;
		var ms_h = h;
		var ms_keys = Object.keys(h);
		var ms_length = ms_keys.length;
		var ms_current = 0;
		while(ms_current < ms_length) {
			var ms = ms_h[ms_keys[ms_current++]];
			data.h["forms"].push(ms.toObject());
		}
		var v = [];
		data.h["interf"] = v;
		var h = this.interf.h;
		var ms_h = h;
		var ms_keys = Object.keys(h);
		var ms_length = ms_keys.length;
		var ms_current = 0;
		while(ms_current < ms_length) {
			var ms = ms_h[ms_keys[ms_current++]];
			data.h["interf"].push(ms.toObject());
		}
		var v = [];
		data.h["targets"] = v;
		var h = this.targets.h;
		var ms_h = h;
		var ms_keys = Object.keys(h);
		var ms_length = ms_keys.length;
		var ms_current = 0;
		while(ms_current < ms_length) {
			var ms = ms_h[ms_keys[ms_current++]];
			data.h["targets"].push(ms.toObject());
		}
		return com_tilbuci_statictools_StringStatic.jsonStringify(data);
	}
	,menuShow: function(name,options,variable,actions,pos,px,py) {
		this.menuHide();
		if(Object.prototype.hasOwnProperty.call(this.menus.h,name) && com_tilbuci_data_GlobalPlayer.mode != "editor") {
			this._menuCurrent = this.menus.h[name];
			if(this._menuCurrent.ok) {
				this._menusOverlay.get_graphics().clear();
				if(this._menuCurrent.bgalpha > 0) {
					this._menusOverlay.get_graphics().beginFill(Std.parseInt(StringTools.replace("#","0x",this._menuCurrent.bgcolor)),this._menuCurrent.bgalpha);
					this._menusOverlay.get_graphics().drawRect(0,0,com_tilbuci_data_GlobalPlayer.area.get_aWidth(),com_tilbuci_data_GlobalPlayer.area.get_aHeight());
					this._menusOverlay.get_graphics().endFill();
				}
				this._menusOverlay.addChild(this._menuCurrent.create(options,$bind(this,this.onMenuSelect)));
				switch(pos) {
				case "absolute":
					this._menuCurrent.set_x(px);
					this._menuCurrent.set_y(py);
					break;
				case "bottom":
					this._menuCurrent.set_x((com_tilbuci_data_GlobalPlayer.area.get_aWidth() - this._menuCurrent.get_width()) / 2);
					this._menuCurrent.set_y(com_tilbuci_data_GlobalPlayer.area.get_aHeight() - this._menuCurrent.get_height() - py);
					break;
				case "bottomleft":
					this._menuCurrent.set_x(px);
					this._menuCurrent.set_y(com_tilbuci_data_GlobalPlayer.area.get_aHeight() - this._menuCurrent.get_height() - py);
					break;
				case "bottomright":
					this._menuCurrent.set_x(com_tilbuci_data_GlobalPlayer.area.get_aWidth() - this._menuCurrent.get_width() - px);
					this._menuCurrent.set_y(com_tilbuci_data_GlobalPlayer.area.get_aHeight() - this._menuCurrent.get_height() - py);
					break;
				case "centerleft":
					this._menuCurrent.set_x(px);
					this._menuCurrent.set_y((com_tilbuci_data_GlobalPlayer.area.get_aHeight() - this._menuCurrent.get_height()) / 2);
					break;
				case "centerright":
					this._menuCurrent.set_x(com_tilbuci_data_GlobalPlayer.area.get_aWidth() - this._menuCurrent.get_width() - px);
					this._menuCurrent.set_y((com_tilbuci_data_GlobalPlayer.area.get_aHeight() - this._menuCurrent.get_height()) / 2);
					break;
				case "top":
					this._menuCurrent.set_x((com_tilbuci_data_GlobalPlayer.area.get_aWidth() - this._menuCurrent.get_width()) / 2);
					this._menuCurrent.set_y(py);
					break;
				case "topleft":
					this._menuCurrent.set_x(px);
					this._menuCurrent.set_y(py);
					break;
				case "topright":
					this._menuCurrent.set_x(com_tilbuci_data_GlobalPlayer.area.get_aWidth() - this._menuCurrent.get_width() - px);
					this._menuCurrent.set_y(py);
					break;
				default:
					this._menuCurrent.set_x((com_tilbuci_data_GlobalPlayer.area.get_aWidth() - this._menuCurrent.get_width()) / 2);
					this._menuCurrent.set_y((com_tilbuci_data_GlobalPlayer.area.get_aHeight() - this._menuCurrent.get_height()) / 2);
				}
				this._menuAction = actions;
				this._menuVariable = variable;
				this.usingMenu = true;
				return true;
			} else {
				this._menuCurrent = null;
				return false;
			}
		} else {
			this._menuCurrent = null;
			return false;
		}
	}
	,checkMenuCollision: function(obj) {
		if(this._menuCurrent != null) {
			return this._menuCurrent.checkCollision(obj);
		} else {
			return false;
		}
	}
	,checkMenuOver: function(obj) {
		if(this._menuCurrent != null) {
			if(this._menuCurrent.hitTestObject(obj)) {
				return true;
			} else {
				return false;
			}
		} else {
			return false;
		}
	}
	,showingDflow: function() {
		return this._dflowOverlay.get_numChildren() > 0;
	}
	,showingInventory: function() {
		return this._invOverlay.get_numChildren() > 0;
	}
	,showingBattle: function() {
		return this._bsOverlay.get_numChildren() > 0;
	}
	,dflowShow: function(options) {
		this.dflowHide();
		if(com_tilbuci_data_GlobalPlayer.mode != "editor" && Object.prototype.hasOwnProperty.call(this.dflow.h,"dflow")) {
			this._dflowCurrent = this.dflow.h["dflow"];
			if(this._dflowCurrent.ok) {
				this._dflowOverlay.get_graphics().clear();
				this._dflowOverlay.addChild(this._dflowCurrent.create(options));
				switch(this._dflowCurrent.position) {
				case "bottom":
					this._dflowCurrent.set_x((com_tilbuci_data_GlobalPlayer.area.get_aWidth() - this._dflowCurrent.menuSize.x) / 2);
					this._dflowCurrent.set_y(com_tilbuci_data_GlobalPlayer.area.get_aHeight() - this._dflowCurrent.menuSize.y - this._dflowCurrent.gap);
					break;
				case "bottomleft":
					this._dflowCurrent.set_x(this._dflowCurrent.gap);
					this._dflowCurrent.set_y(com_tilbuci_data_GlobalPlayer.area.get_aHeight() - this._dflowCurrent.menuSize.y - this._dflowCurrent.gap);
					break;
				case "bottomright":
					this._dflowCurrent.set_x(com_tilbuci_data_GlobalPlayer.area.get_aWidth() - this._dflowCurrent.menuSize.x - this._dflowCurrent.gap);
					this._dflowCurrent.set_y(com_tilbuci_data_GlobalPlayer.area.get_aHeight() - this._dflowCurrent.menuSize.y - this._dflowCurrent.gap);
					break;
				case "centerleft":
					this._dflowCurrent.set_x(this._dflowCurrent.gap);
					this._dflowCurrent.set_y((com_tilbuci_data_GlobalPlayer.area.get_aHeight() - this._dflowCurrent.menuSize.y) / 2);
					break;
				case "centerright":
					this._dflowCurrent.set_x(com_tilbuci_data_GlobalPlayer.area.get_aWidth() - this._dflowCurrent.menuSize.x - this._dflowCurrent.gap);
					this._dflowCurrent.set_y((com_tilbuci_data_GlobalPlayer.area.get_aHeight() - this._dflowCurrent.menuSize.y) / 2);
					break;
				case "top":
					this._dflowCurrent.set_x((com_tilbuci_data_GlobalPlayer.area.get_aWidth() - this._dflowCurrent.menuSize.x) / 2);
					this._dflowCurrent.set_y(this._dflowCurrent.gap);
					break;
				case "topleft":
					this._dflowCurrent.set_x(this._dflowCurrent.gap);
					this._dflowCurrent.set_y(this._dflowCurrent.gap);
					break;
				case "topright":
					this._dflowCurrent.set_x(com_tilbuci_data_GlobalPlayer.area.get_aWidth() - this._dflowCurrent.menuSize.x - this._dflowCurrent.gap);
					this._dflowCurrent.set_y(this._dflowCurrent.gap);
					break;
				default:
					this._dflowCurrent.set_x((com_tilbuci_data_GlobalPlayer.area.get_aWidth() - this._dflowCurrent.menuSize.x) / 2);
					this._dflowCurrent.set_y((com_tilbuci_data_GlobalPlayer.area.get_aHeight() - this._dflowCurrent.menuSize.y) / 2);
				}
				this.usingDflow = true;
				return true;
			} else {
				this._dflowCurrent = null;
				return false;
			}
		} else {
			this._dflowCurrent = null;
			return false;
		}
	}
	,inventoryShow: function(closeac) {
		this.invHide();
		if(com_tilbuci_data_GlobalPlayer.mode != "editor" && Object.prototype.hasOwnProperty.call(this.inv.h,"inv")) {
			this._invCurrent = this.inv.h["inv"];
			if(this._invCurrent.ok) {
				this._invOverlay.addChild(this._invCurrent.create(closeac));
				this._invCurrent.draw();
				this.usingInv = true;
				return true;
			} else {
				this._invCurrent = null;
				return false;
			}
		} else {
			this._invCurrent = null;
			return false;
		}
	}
	,battleShow: function(onwin,onloose,player,opponent) {
		this.bsHide();
		if(com_tilbuci_data_GlobalPlayer.mode != "editor" && Object.prototype.hasOwnProperty.call(this.bs.h,"bs")) {
			this._bsCurrent = this.bs.h["bs"];
			if(this._bsCurrent.ok) {
				this._bsOverlay.addChild(this._bsCurrent.create(onwin,onloose,player,opponent));
				this.usingBs = true;
				return true;
			} else {
				this._bsCurrent = null;
				return false;
			}
		} else {
			this._bsCurrent = null;
			return false;
		}
	}
	,checkDflowCollision: function(obj) {
		if(this._dflowCurrent != null) {
			return this._dflowCurrent.checkCollision(obj);
		} else {
			return false;
		}
	}
	,checkInvCollision: function(obj) {
		if(this._invCurrent != null) {
			return this._invCurrent.checkCollision(obj);
		} else {
			return false;
		}
	}
	,checkBsCollision: function(obj) {
		if(this._bsCurrent != null) {
			return this._bsCurrent.checkCollision(obj);
		} else {
			return false;
		}
	}
	,checkDflowOver: function(obj) {
		if(this._dflowCurrent != null) {
			if(this._dflowCurrent.hitTestObject(obj)) {
				return true;
			} else {
				return false;
			}
		} else {
			return false;
		}
	}
	,checkInvOver: function(obj) {
		if(this._invCurrent != null) {
			return this._invCurrent.checkOver(obj);
		} else {
			return false;
		}
	}
	,checkBsOver: function(obj) {
		if(this._bsCurrent != null) {
			return this._bsCurrent.checkOver(obj);
		} else {
			return false;
		}
	}
	,messagesShow: function(name,msg,options,variable,actions) {
		this.messagesHide();
		if(Object.prototype.hasOwnProperty.call(this.messages.h,name)) {
			this._messagesCurrent = this.messages.h[name];
			if(this._messagesCurrent.ok) {
				this._messagesOverlay.get_graphics().clear();
				this._messagesOverlay.get_graphics().beginFill(0,0.5);
				this._messagesOverlay.get_graphics().drawRect(0,0,com_tilbuci_data_GlobalPlayer.area.get_aWidth(),com_tilbuci_data_GlobalPlayer.area.get_aHeight());
				this._messagesOverlay.get_graphics().endFill();
				this._messagesOverlay.addChild(this._messagesCurrent.create(msg,options,$bind(this,this.onMessagesSelect)));
				this._messagesCurrent.set_x((com_tilbuci_data_GlobalPlayer.area.get_aWidth() - this._messagesCurrent.get_width()) / 2);
				this._messagesCurrent.set_y((com_tilbuci_data_GlobalPlayer.area.get_aHeight() - this._messagesCurrent.get_height()) / 2);
				this._messagesAction = actions;
				this._messagesVariable = variable;
				this.usingMessages = true;
				return true;
			} else {
				this._messagesCurrent = null;
				return false;
			}
		} else {
			this._messagesCurrent = null;
			return false;
		}
	}
	,checkMessagesCollision: function(obj) {
		if(this._messagesCurrent != null) {
			return this._messagesCurrent.checkCollision(obj);
		} else {
			return false;
		}
	}
	,checkMessagesOver: function(obj) {
		if(this._messagesCurrent != null) {
			if(this._messagesCurrent.hitTestObject(obj)) {
				return true;
			} else {
				return false;
			}
		} else {
			return false;
		}
	}
	,changeDisplay: function() {
		this.getLayers();
		if(this._backgroundOverlay.get_visible() && this._backgroundOverlay.get_numChildren() > 0) {
			var bcg = this._backgroundOverlay.getChildAt(0);
			bcg.getCover();
		}
		if(this._coverOverlay.get_visible() && this._coverOverlay.get_numChildren() > 0) {
			var cov = this._coverOverlay.getChildAt(0);
			cov.getCover();
		}
	}
	,removeContraptions: function(all) {
		if(all == null) {
			all = false;
		}
		this.menuHide();
		this.messagesHide();
		this.dflowHide();
		this.invHide();
		this.bsHide();
		this.hideForm();
		this.hideLoadingIc();
		this.removeZoom();
		if(all) {
			this.musicStop();
			this.soundStop();
			this.hideCover();
			this.hideBackground();
			this.hideAllInterfaces();
		}
	}
	,musicPlay: function(name) {
		if(Object.prototype.hasOwnProperty.call(this.musics.h,name)) {
			var h = this.musics.h;
			var ms_h = h;
			var ms_keys = Object.keys(h);
			var ms_length = ms_keys.length;
			var ms_current = 0;
			while(ms_current < ms_length) {
				var ms = ms_h[ms_keys[ms_current++]];
				if(ms.id == name) {
					ms.play();
				} else {
					ms.pause();
				}
			}
			return true;
		} else {
			return false;
		}
	}
	,soundPlay: function(name) {
		if(Object.prototype.hasOwnProperty.call(this.sounds.h,name)) {
			var h = this.sounds.h;
			var snd_h = h;
			var snd_keys = Object.keys(h);
			var snd_length = snd_keys.length;
			var snd_current = 0;
			while(snd_current < snd_length) {
				var snd = snd_h[snd_keys[snd_current++]];
				if(snd.id == name) {
					snd.play();
				}
			}
			return true;
		} else {
			return false;
		}
	}
	,musicPause: function() {
		var h = this.musics.h;
		var ms_h = h;
		var ms_keys = Object.keys(h);
		var ms_length = ms_keys.length;
		var ms_current = 0;
		while(ms_current < ms_length) {
			var ms = ms_h[ms_keys[ms_current++]];
			ms.pause();
		}
	}
	,soundPause: function(name) {
		if(name == null) {
			name = "";
		}
		if(name == "") {
			var h = this.sounds.h;
			var snd_h = h;
			var snd_keys = Object.keys(h);
			var snd_length = snd_keys.length;
			var snd_current = 0;
			while(snd_current < snd_length) {
				var snd = snd_h[snd_keys[snd_current++]];
				snd.pause();
			}
		} else if(Object.prototype.hasOwnProperty.call(this.sounds.h,name)) {
			var h = this.sounds.h;
			var snd_h = h;
			var snd_keys = Object.keys(h);
			var snd_length = snd_keys.length;
			var snd_current = 0;
			while(snd_current < snd_length) {
				var snd = snd_h[snd_keys[snd_current++]];
				if(snd.id == name) {
					snd.pause();
				}
			}
		}
	}
	,musicStop: function() {
		var h = this.musics.h;
		var ms_h = h;
		var ms_keys = Object.keys(h);
		var ms_length = ms_keys.length;
		var ms_current = 0;
		while(ms_current < ms_length) {
			var ms = ms_h[ms_keys[ms_current++]];
			ms.stop();
		}
	}
	,soundStop: function(name) {
		if(name == null) {
			name = "";
		}
		if(name == "") {
			var h = this.sounds.h;
			var snd_h = h;
			var snd_keys = Object.keys(h);
			var snd_length = snd_keys.length;
			var snd_current = 0;
			while(snd_current < snd_length) {
				var snd = snd_h[snd_keys[snd_current++]];
				snd.stop();
			}
		} else if(Object.prototype.hasOwnProperty.call(this.sounds.h,name)) {
			var h = this.sounds.h;
			var snd_h = h;
			var snd_keys = Object.keys(h);
			var snd_length = snd_keys.length;
			var snd_current = 0;
			while(snd_current < snd_length) {
				var snd = snd_h[snd_keys[snd_current++]];
				if(snd.id == name) {
					snd.stop();
				}
			}
		}
	}
	,musicVolume: function(vol) {
		var h = this.musics.h;
		var ms_h = h;
		var ms_keys = Object.keys(h);
		var ms_length = ms_keys.length;
		var ms_current = 0;
		while(ms_current < ms_length) {
			var ms = ms_h[ms_keys[ms_current++]];
			ms.volume(vol);
		}
	}
	,soundVolume: function(vol,name) {
		if(name == null) {
			name = "";
		}
		if(name == "") {
			var h = this.sounds.h;
			var snd_h = h;
			var snd_keys = Object.keys(h);
			var snd_length = snd_keys.length;
			var snd_current = 0;
			while(snd_current < snd_length) {
				var snd = snd_h[snd_keys[snd_current++]];
				snd.volume(vol);
			}
		} else if(Object.prototype.hasOwnProperty.call(this.sounds.h,name)) {
			var h = this.sounds.h;
			var snd_h = h;
			var snd_keys = Object.keys(h);
			var snd_length = snd_keys.length;
			var snd_current = 0;
			while(snd_current < snd_length) {
				var snd = snd_h[snd_keys[snd_current++]];
				if(snd.id == name) {
					snd.volume(vol);
				}
			}
		}
	}
	,menuHide: function() {
		if(this._coverOverlay == null) {
			this._coverOverlay = com_tilbuci_data_GlobalPlayer.area.getOverlay("contraptions-cover");
		}
		var h = this.menus.h;
		var mn_h = h;
		var mn_keys = Object.keys(h);
		var mn_length = mn_keys.length;
		var mn_current = 0;
		while(mn_current < mn_length) {
			var mn = mn_h[mn_keys[mn_current++]];
			mn.remove();
		}
		this.getLayers();
		this._menusOverlay.get_graphics().clear();
		this._menusOverlay.removeChildren();
		this._menuCurrent = null;
		this.usingMenu = false;
	}
	,dflowHide: function() {
		if(this._coverOverlay == null) {
			this._coverOverlay = com_tilbuci_data_GlobalPlayer.area.getOverlay("contraptions-cover");
		}
		var h = this.dflow.h;
		var mn_h = h;
		var mn_keys = Object.keys(h);
		var mn_length = mn_keys.length;
		var mn_current = 0;
		while(mn_current < mn_length) {
			var mn = mn_h[mn_keys[mn_current++]];
			mn.remove();
		}
		this.getLayers();
		this._dflowOverlay.get_graphics().clear();
		this._dflowCurrent = null;
		this.usingDflow = false;
	}
	,invHide: function() {
		if(this._coverOverlay == null) {
			this._coverOverlay = com_tilbuci_data_GlobalPlayer.area.getOverlay("contraptions-cover");
		}
		var h = this.inv.h;
		var mn_h = h;
		var mn_keys = Object.keys(h);
		var mn_length = mn_keys.length;
		var mn_current = 0;
		while(mn_current < mn_length) {
			var mn = mn_h[mn_keys[mn_current++]];
			mn.remove();
		}
		this.getLayers();
		this._invOverlay.get_graphics().clear();
		if(this._invCurrent != null) {
			this._invCurrent.invClose();
		}
		this._invCurrent = null;
		this.usingInv = false;
	}
	,bsHide: function() {
		if(this._coverOverlay == null) {
			this._coverOverlay = com_tilbuci_data_GlobalPlayer.area.getOverlay("contraptions-cover");
		}
		var h = this.bs.h;
		var mn_h = h;
		var mn_keys = Object.keys(h);
		var mn_length = mn_keys.length;
		var mn_current = 0;
		while(mn_current < mn_length) {
			var mn = mn_h[mn_keys[mn_current++]];
			mn.remove();
		}
		this.getLayers();
		this._bsOverlay.get_graphics().clear();
		if(this._bsCurrent != null) {
			this._bsCurrent.bsClose();
		}
		this._bsCurrent = null;
		this.usingBs = false;
	}
	,messagesHide: function() {
		if(this._coverOverlay == null) {
			this._coverOverlay = com_tilbuci_data_GlobalPlayer.area.getOverlay("contraptions-cover");
		}
		var h = this.messages.h;
		var mn_h = h;
		var mn_keys = Object.keys(h);
		var mn_length = mn_keys.length;
		var mn_current = 0;
		while(mn_current < mn_length) {
			var mn = mn_h[mn_keys[mn_current++]];
			mn.remove();
		}
		this.getLayers();
		this._messagesOverlay.get_graphics().clear();
		this._messagesCurrent = null;
		this.usingMessages = false;
	}
	,onMenuSelect: function(val) {
		com_tilbuci_data_GlobalPlayer.parser.setInt(this._menuVariable,val);
		if(this._menuAction != null) {
			com_tilbuci_data_GlobalPlayer.parser.run(this._menuAction,true);
		}
	}
	,onMessagesSelect: function(val) {
		com_tilbuci_data_GlobalPlayer.parser.setInt(this._messagesVariable,val);
		if(this._messagesAction != null) {
			com_tilbuci_data_GlobalPlayer.parser.run(this._messagesAction,true);
		}
	}
	,loadLoadingIc: function() {
		if(this._loadingOverlay == null) {
			this.getLayers();
			this._loadingOverlay.set_visible(false);
			this._loadingIc = new com_tilbuci_display_SpritemapImage($bind(this,this.onLoadingIc));
			this._loadingOverlay.addChild(this._loadingIc);
		} else if(this._loadingIc == null) {
			this._loadingOverlay.set_visible(false);
			this._loadingIc = new com_tilbuci_display_SpritemapImage($bind(this,this.onLoadingIc));
			this._loadingOverlay.addChild(this._loadingIc);
		}
		this._loadingIc.set_visible(false);
		this._loadingOverlay.set_visible(false);
		this._loadingIc.unload();
		if(com_tilbuci_data_GlobalPlayer.mdata.loadingic[0] != "") {
			this._loadingIc.frames = Std.parseInt(com_tilbuci_data_GlobalPlayer.mdata.loadingic[1]);
			this._loadingIc.frtime = Std.parseInt(com_tilbuci_data_GlobalPlayer.mdata.loadingic[2]);
			this._loadingIc.load(com_tilbuci_data_GlobalPlayer.mdata.loadingic[0]);
		}
	}
	,showLoadingIc: function() {
		if(this._loadingIc.get_mediaLoaded()) {
			this._loadingIc.set_visible(true);
			this._loadingOverlay.set_visible(true);
		} else {
			this._loadingIc.set_visible(false);
			this._loadingOverlay.set_visible(false);
		}
	}
	,hideLoadingIc: function() {
		this._loadingIc.set_visible(false);
		this._loadingOverlay.set_visible(false);
	}
	,onLoadingIc: function(ok) {
		if(ok) {
			this._loadingIc.set_x((com_tilbuci_data_GlobalPlayer.area.get_aWidth() - this._loadingIc.get_width()) / 2);
			this._loadingIc.set_y((com_tilbuci_data_GlobalPlayer.area.get_aHeight() - this._loadingIc.get_height()) / 2);
		} else {
			this._loadingIc.set_visible(false);
			this._loadingOverlay.set_visible(false);
		}
	}
	,zoomInstance: function(inst) {
		if(this._zoomOverlay == null) {
			this.getLayers();
			this._zoomOverlay.set_visible(false);
			this._zoomPicture = new com_tilbuci_display_PictureImage($bind(this,this.onZoomPic));
			this._zoomPicture.set_visible(false);
			this._zoomOverlay.addChild(this._zoomPicture);
			this._zoomVideo = new com_tilbuci_display_VideoImage($bind(this,this.onZoomVideo),$bind(this,this.onZoomVideoEnd));
			this._zoomVideo.set_visible(false);
			this._zoomOverlay.addChild(this._zoomVideo);
		}
		var inst1 = com_tilbuci_data_GlobalPlayer.area.pickInstance(inst);
		if(inst1 == null) {
			this._zoomOverlay.set_visible(false);
			this._zoomPicture.set_visible(false);
			this._zoomVideo.set_visible(false);
			this._zoomPicture.unload();
			this._zoomVideo.unload();
			return false;
		} else if(inst1.get_currentType() == "picture") {
			this._zoomPicture.load(inst1.get_currentMedia());
			return true;
		} else if(inst1.get_currentType() == "video") {
			this._zoomVideo.load(inst1.get_currentMedia());
			return true;
		} else {
			this._zoomOverlay.set_visible(false);
			this._zoomPicture.set_visible(false);
			this._zoomVideo.set_visible(false);
			this._zoomPicture.unload();
			this._zoomVideo.unload();
			return false;
		}
	}
	,onZoomPic: function(ok) {
		this._zoomOverlay.set_visible(false);
		this._zoomPicture.set_visible(false);
		this._zoomVideo.set_visible(false);
		if(ok) {
			this._zoomOverlay.get_graphics().clear();
			this._zoomOverlay.get_graphics().beginFill(0,0.5);
			this._zoomOverlay.get_graphics().drawRect(0,0,com_tilbuci_data_GlobalPlayer.area.get_aWidth(),com_tilbuci_data_GlobalPlayer.area.get_aHeight());
			this._zoomOverlay.get_graphics().endFill();
			com_tilbuci_data_GlobalPlayer.area.pause();
			this._zoomPicture.set_width(com_tilbuci_data_GlobalPlayer.area.get_aWidth() - 10);
			this._zoomPicture.set_height(this._zoomPicture.get_width() * (this._zoomPicture.oHeight / this._zoomPicture.oWidth));
			if(this._zoomPicture.get_height() > com_tilbuci_data_GlobalPlayer.area.get_aHeight() - 10) {
				this._zoomPicture.set_height(com_tilbuci_data_GlobalPlayer.area.get_aHeight() - 10);
				this._zoomPicture.set_width(this._zoomPicture.get_height() * (this._zoomPicture.oWidth / this._zoomPicture.oHeight));
			}
			this._zoomPicture.set_visible(true);
			this._zoomOverlay.set_visible(true);
			this._zoomPicture.set_x((com_tilbuci_data_GlobalPlayer.area.get_aWidth() - this._zoomPicture.get_width()) / 2);
			this._zoomPicture.set_y((com_tilbuci_data_GlobalPlayer.area.get_aHeight() - this._zoomPicture.get_height()) / 2);
			this._zoomPicture.addEventListener("click",$bind(this,this.onZoomPClick));
		} else {
			this._zoomPicture.unload();
			this._zoomVideo.unload();
		}
	}
	,onZoomVideo: function(ok) {
		this._zoomOverlay.set_visible(false);
		this._zoomPicture.set_visible(false);
		this._zoomVideo.set_visible(false);
		if(ok) {
			this._zoomOverlay.get_graphics().clear();
			this._zoomOverlay.get_graphics().beginFill(0,0.5);
			this._zoomOverlay.get_graphics().drawRect(0,0,com_tilbuci_data_GlobalPlayer.area.get_aWidth(),com_tilbuci_data_GlobalPlayer.area.get_aHeight());
			this._zoomOverlay.get_graphics().endFill();
			com_tilbuci_data_GlobalPlayer.area.pause();
			this._zoomVideo.set_width(com_tilbuci_data_GlobalPlayer.area.get_aWidth() - 10);
			this._zoomVideo.set_height(this._zoomVideo.get_width() * (this._zoomVideo.oHeight / this._zoomVideo.oWidth));
			if(this._zoomVideo.get_height() > com_tilbuci_data_GlobalPlayer.area.get_aHeight() - 10) {
				this._zoomVideo.set_height(com_tilbuci_data_GlobalPlayer.area.get_aHeight() - 10);
				this._zoomVideo.set_width(this._zoomVideo.get_height() * (this._zoomVideo.oWidth / this._zoomVideo.oHeight));
			}
			this._zoomVideo.set_visible(true);
			this._zoomOverlay.set_visible(true);
			this._zoomVideo.play();
			this._zoomVideo.addEventListener("click",$bind(this,this.onZoomVClick));
		} else {
			this._zoomPicture.unload();
			this._zoomVideo.unload();
		}
	}
	,onZoomVideoEnd: function() {
		this._zoomVideo.setTime(0);
		this._zoomVideo.play();
	}
	,onZoomPClick: function(evt) {
		this._zoomPicture.removeEventListener("click",$bind(this,this.onZoomPClick));
		this._zoomOverlay.set_visible(false);
		this._zoomPicture.set_visible(false);
		this._zoomVideo.set_visible(false);
		this._zoomPicture.unload();
		this._zoomVideo.unload();
		com_tilbuci_data_GlobalPlayer.area.play();
	}
	,onZoomVClick: function(evt) {
		this._zoomVideo.removeEventListener("click",$bind(this,this.onZoomVClick));
		this._zoomOverlay.set_visible(false);
		this._zoomPicture.set_visible(false);
		this._zoomVideo.set_visible(false);
		this._zoomPicture.unload();
		this._zoomVideo.unload();
		com_tilbuci_data_GlobalPlayer.area.play();
	}
	,removeZoom: function() {
		if(this._zoomOverlay != null) {
			if(this._zoomPicture != null) {
				if(this._zoomPicture.hasEventListener("click")) {
					this._zoomPicture.removeEventListener("click",$bind(this,this.onZoomPClick));
				}
				this._zoomPicture.set_visible(false);
				this._zoomPicture.unload();
			}
			if(this._zoomVideo != null) {
				if(this._zoomVideo.hasEventListener("click")) {
					this._zoomVideo.removeEventListener("click",$bind(this,this.onZoomVClick));
				}
				this._zoomVideo.set_visible(false);
				this._zoomVideo.unload();
			}
			this._zoomOverlay.set_visible(false);
		}
	}
	,showCover: function(name) {
		this.getLayers();
		if(Object.prototype.hasOwnProperty.call(this.covers.h,name)) {
			this._coverOverlay.removeChildren();
			this._coverOverlay.addChild(this.covers.h[name].getCover());
			this._coverOverlay.mouseEnabled = this.covers.h[name].holdClick;
			this._coverOverlay.set_visible(true);
			return true;
		} else {
			return false;
		}
	}
	,hideCover: function() {
		this.getLayers();
		this._coverOverlay.removeChildren();
		this._coverOverlay.set_visible(false);
		this._coverOverlay.mouseEnabled = false;
	}
	,showBackground: function(name) {
		this.getLayers();
		if(Object.prototype.hasOwnProperty.call(this.backgrounds.h,name)) {
			this._backgroundOverlay.removeChildren();
			this._backgroundOverlay.addChild(this.backgrounds.h[name].getCover());
			this._backgroundOverlay.set_visible(true);
			return true;
		} else {
			return false;
		}
	}
	,hideBackground: function() {
		this.getLayers();
		this._backgroundOverlay.removeChildren();
		this._backgroundOverlay.set_visible(false);
		this._backgroundOverlay.mouseEnabled = false;
	}
	,hideForm: function() {
		this._formsOverlay.removeChildren();
		this._formsOverlay.set_visible(false);
	}
	,showForm: function(nm,px,py,acok,accancel) {
		this.hideForm();
		if(Object.prototype.hasOwnProperty.call(this.forms.h,nm)) {
			this.forms.h[nm].start(acok,accancel);
			this.forms.h[nm].set_x(px);
			this.forms.h[nm].set_y(py);
			this._formsOverlay.addChild(this.forms.h[nm]);
			this._formsOverlay.set_visible(true);
			this._formcurrent = nm;
			return true;
		} else {
			return false;
		}
	}
	,setFormValue: function(nm,val) {
		if(this._formcurrent == "") {
			return false;
		} else {
			return this.forms.h[this._formcurrent].setValue(nm,val);
		}
	}
	,setFormStepper: function(nm,min,max,stp) {
		if(this._formcurrent == "") {
			return false;
		} else {
			return this.forms.h[this._formcurrent].setStepper(nm,min,max,stp);
		}
	}
	,getFormValue: function(nm) {
		if(this._formcurrent == "") {
			return "";
		} else {
			return this.forms.h[this._formcurrent].getValue(nm);
		}
	}
	,hideAllInterfaces: function() {
		this._interfaceOverlay.removeChildren();
		this._interfaceOverlay.set_visible(false);
	}
	,hideInterface: function(nm) {
		if(Object.prototype.hasOwnProperty.call(this.interf.h,nm)) {
			this.interf.h[nm].remove();
		}
		if(this._interfaceOverlay.get_numChildren() == 0) {
			this._interfaceOverlay.set_visible(false);
		}
	}
	,showInterface: function(nm,px,py) {
		this.hideInterface(nm);
		if(Object.prototype.hasOwnProperty.call(this.interf.h,nm)) {
			this.interf.h[nm].start();
			this.interf.h[nm].set_x(px);
			this.interf.h[nm].set_y(py);
			this._interfaceOverlay.addChild(this.interf.h[nm]);
			this._interfaceOverlay.set_visible(true);
			return true;
		} else {
			return false;
		}
	}
	,checkInterfaceCollision: function(obj) {
		if(this._interfaceOverlay.get_visible()) {
			var ret = false;
			var _g = 0;
			var _g1 = this._interfaceOverlay.get_numChildren();
			while(_g < _g1) {
				var i = _g++;
				if(!ret) {
					var intf = this._interfaceOverlay.getChildAt(i);
					if(intf != null) {
						ret = intf.checkCollision(obj);
					}
				}
			}
			return ret;
		} else {
			return false;
		}
	}
	,checkInterfaceOver: function(obj) {
		if(this._interfaceOverlay.get_visible()) {
			var ret = false;
			var _g = 0;
			var _g1 = this._interfaceOverlay.get_numChildren();
			while(_g < _g1) {
				var i = _g++;
				if(this._interfaceOverlay.getChildAt(i).hitTestObject(obj)) {
					ret = true;
				}
			}
			return ret;
		} else {
			return false;
		}
	}
	,setInterfaceText: function(nm,tx) {
		if(Object.prototype.hasOwnProperty.call(this.interf.h,nm)) {
			return this.interf.h[nm].setText(tx);
		} else {
			return false;
		}
	}
	,setInterfaceFrame: function(nm,fr) {
		if(Object.prototype.hasOwnProperty.call(this.interf.h,nm)) {
			return this.interf.h[nm].setMapFrame(fr);
		} else {
			return false;
		}
	}
	,pauseInterface: function(nm) {
		if(Object.prototype.hasOwnProperty.call(this.interf.h,nm)) {
			return this.interf.h[nm].pauseMap();
		} else {
			return false;
		}
	}
	,playInterface: function(nm) {
		if(Object.prototype.hasOwnProperty.call(this.interf.h,nm)) {
			return this.interf.h[nm].playMap();
		} else {
			return false;
		}
	}
	,__class__: com_tilbuci_contraptions_Contraptions
};
var com_tilbuci_contraptions_CoverContraption = function(data) {
	this.ok = false;
	openfl_display_Sprite.call(this);
	if(data != null) {
		this.load(data);
	}
};
$hxClasses["com.tilbuci.contraptions.CoverContraption"] = com_tilbuci_contraptions_CoverContraption;
com_tilbuci_contraptions_CoverContraption.__name__ = "com.tilbuci.contraptions.CoverContraption";
com_tilbuci_contraptions_CoverContraption.__super__ = openfl_display_Sprite;
com_tilbuci_contraptions_CoverContraption.prototype = $extend(openfl_display_Sprite.prototype,{
	ok: null
	,id: null
	,holdClick: null
	,landscape: null
	,portrait: null
	,_landscape: null
	,_portrait: null
	,create: function(bts,ac) {
		if(this.ok) {
			this.removeChildren();
		}
		return this;
	}
	,remove: function() {
		this.removeChildren();
		if(this.parent != null) {
			this.parent.removeChild(this);
		}
	}
	,clone: function() {
		return new com_tilbuci_contraptions_CoverContraption(this.toObject());
	}
	,getCover: function() {
		this.removeChildren();
		if(com_tilbuci_data_GlobalPlayer.area.get_pOrientation() == "horizontal") {
			if(this._landscape != null) {
				this._landscape.set_width(com_tilbuci_data_GlobalPlayer.mdata.screen.big);
				this._landscape.set_height(com_tilbuci_data_GlobalPlayer.mdata.screen.small);
				this.addChild(this._landscape);
			} else {
				this._portrait.set_width(com_tilbuci_data_GlobalPlayer.mdata.screen.big);
				this._portrait.set_height(com_tilbuci_data_GlobalPlayer.mdata.screen.small);
				this.addChild(this._portrait);
			}
		} else if(this._portrait != null) {
			this._portrait.set_width(com_tilbuci_data_GlobalPlayer.mdata.screen.small);
			this._portrait.set_height(com_tilbuci_data_GlobalPlayer.mdata.screen.big);
			this.addChild(this._portrait);
		} else {
			this._landscape.set_width(com_tilbuci_data_GlobalPlayer.mdata.screen.small);
			this._landscape.set_height(com_tilbuci_data_GlobalPlayer.mdata.screen.big);
			this.addChild(this._landscape);
		}
		return this;
	}
	,load: function(data) {
		this.ok = false;
		if(Object.prototype.hasOwnProperty.call(data,"id")) {
			this.id = Reflect.field(data,"id");
			if(Object.prototype.hasOwnProperty.call(data,"click")) {
				this.holdClick = Reflect.field(data,"click");
			} else {
				this.holdClick = false;
			}
			if(Object.prototype.hasOwnProperty.call(data,"portrait")) {
				this.portrait = Reflect.field(data,"portrait");
				if(this.portrait != "") {
					this._portrait = new com_tilbuci_display_PictureImage($bind(this,this.onPicLoad));
					this._portrait.set_visible(true);
				}
			} else {
				this.portrait = "";
			}
			if(Object.prototype.hasOwnProperty.call(data,"landscape")) {
				this.landscape = Reflect.field(data,"landscape");
				if(this.landscape != "") {
					this._landscape = new com_tilbuci_display_PictureImage($bind(this,this.onPicLoad));
					this._landscape.set_visible(true);
				}
			} else {
				this.landscape = "";
			}
			if(this.holdClick == null) {
				this.holdClick = false;
			}
			if(this.portrait == null) {
				this.portrait = "";
			}
			if(this.landscape == null) {
				this.landscape = "";
			}
			if(this.landscape != "" || this.portrait != "") {
				if(this._landscape != null) {
					this._landscape.load(this.landscape);
				}
				if(this._portrait != null) {
					this._portrait.load(this.portrait);
				}
				if(this.holdClick) {
					this.addEventListener("click",$bind(this,this.onClick));
					this.mouseEnabled = true;
				} else {
					this.mouseEnabled = false;
				}
				this.mouseChildren = false;
				return true;
			} else {
				return false;
			}
		} else {
			return false;
		}
	}
	,onPicLoad: function(ok) {
		if(com_tilbuci_data_GlobalPlayer.area.get_pOrientation() == "horizontal") {
			if(this._landscape != null) {
				this._landscape.set_width(com_tilbuci_data_GlobalPlayer.mdata.screen.big);
				this._landscape.set_height(com_tilbuci_data_GlobalPlayer.mdata.screen.small);
			} else {
				this._portrait.set_width(com_tilbuci_data_GlobalPlayer.mdata.screen.big);
				this._portrait.set_height(com_tilbuci_data_GlobalPlayer.mdata.screen.small);
			}
		} else if(this._portrait != null) {
			this._portrait.set_width(com_tilbuci_data_GlobalPlayer.mdata.screen.small);
			this._portrait.set_height(com_tilbuci_data_GlobalPlayer.mdata.screen.big);
		} else {
			this._landscape.set_width(com_tilbuci_data_GlobalPlayer.mdata.screen.small);
			this._landscape.set_height(com_tilbuci_data_GlobalPlayer.mdata.screen.big);
		}
	}
	,kill: function() {
		if(this.parent != null) {
			this.parent.removeChild(this);
		}
		this.removeChildren();
		if(this._landscape != null) {
			this._landscape.kill();
		}
		if(this._portrait != null) {
			this._portrait.kill();
		}
		this._landscape = null;
		this._portrait = null;
		this.landscape = null;
		this.portrait = null;
		this.id = null;
		if(this.hasEventListener("click")) {
			this.removeEventListener("click",$bind(this,this.onClick));
		}
	}
	,toObject: function() {
		return { id : this.id, click : this.holdClick, landscape : this.landscape, portrait : this.portrait};
	}
	,onClick: function(evt) {
	}
	,__class__: com_tilbuci_contraptions_CoverContraption
});
var com_tilbuci_contraptions_DflowContraption = function() {
	this._options = [];
	this._buttons = [];
	this.menuSize = new openfl_geom_Point();
	this.gap = 10;
	this.position = "center";
	this.buton = "";
	this.fontsize = 20;
	this.fontcolor = "0xffffff";
	this.font = "sans";
	this.ok = false;
	openfl_display_Sprite.call(this);
};
$hxClasses["com.tilbuci.contraptions.DflowContraption"] = com_tilbuci_contraptions_DflowContraption;
com_tilbuci_contraptions_DflowContraption.__name__ = "com.tilbuci.contraptions.DflowContraption";
com_tilbuci_contraptions_DflowContraption.__super__ = openfl_display_Sprite;
com_tilbuci_contraptions_DflowContraption.prototype = $extend(openfl_display_Sprite.prototype,{
	ok: null
	,id: null
	,font: null
	,fontcolor: null
	,fontsize: null
	,buton: null
	,position: null
	,gap: null
	,menuSize: null
	,_btbitmap: null
	,_btsize: null
	,_buttons: null
	,_options: null
	,create: function(bts) {
		if(this.ok) {
			this.removeChildren();
			while(this._buttons.length > 0) this._buttons.shift().kill();
			this._options = bts;
			var iused = 0;
			var _g = 0;
			var _g1 = bts.length;
			while(_g < _g1) {
				var i = _g++;
				if(bts[i][0] != "" && bts[i][1] != "") {
					var cb = new com_tilbuci_contraptions_ContraptionButton(i == null ? "null" : "" + i,$bind(this,this.onClick),this.buton,bts[i][0],this.font,this.fontsize,com_tilbuci_statictools_StringStatic.colorInt(this.fontcolor));
					cb.set_x(0);
					cb.set_y((this.gap + this._btsize.y) * iused);
					this._buttons.push(cb);
					this.addChild(cb);
					++iused;
				}
			}
			this.menuSize.x = this._btsize.x;
			this.menuSize.y = this._buttons.length * this._btsize.y + this.gap * (this._buttons.length - 1);
		}
		return this;
	}
	,checkCollision: function(obj) {
		var found = false;
		if(this.ok) {
			var _g = 0;
			var _g1 = this._buttons;
			while(_g < _g1.length) {
				var k = _g1[_g];
				++_g;
				var bt = k;
				if(bt != null) {
					if(obj.hitTestObject(bt)) {
						found = true;
						this.onClick(bt.value);
					}
				}
			}
		}
		return found;
	}
	,remove: function() {
		this.removeChildren();
		while(this._buttons.length > 0) this._buttons.shift().kill();
		this._options = [];
		if(this.parent != null) {
			this.parent.removeChild(this);
		}
	}
	,clone: function() {
		var mn = new com_tilbuci_contraptions_DflowContraption();
		mn.load({ id : this.id, font : this.font, fontcolor : this.fontcolor, fontsize : this.fontsize, buton : this.buton, position : this.position, gap : this.gap});
		return mn;
	}
	,load: function(data) {
		this.ok = false;
		if(Object.prototype.hasOwnProperty.call(data,"id")) {
			this.id = Reflect.field(data,"id");
			if(Object.prototype.hasOwnProperty.call(data,"font")) {
				this.font = Reflect.field(data,"font");
			} else {
				this.font = "sans";
			}
			if(Object.prototype.hasOwnProperty.call(data,"fontcolor")) {
				this.fontcolor = Reflect.field(data,"fontcolor");
			} else {
				this.fontcolor = "0xffffff";
			}
			if(Object.prototype.hasOwnProperty.call(data,"fontsize")) {
				this.fontsize = Reflect.field(data,"fontsize");
			} else {
				this.fontsize = 20;
			}
			if(Object.prototype.hasOwnProperty.call(data,"buton")) {
				this.buton = Reflect.field(data,"buton");
			} else {
				this.buton = "";
			}
			if(Object.prototype.hasOwnProperty.call(data,"gap")) {
				this.gap = Reflect.field(data,"gap");
			} else {
				this.gap = 10;
			}
			if(Object.prototype.hasOwnProperty.call(data,"position")) {
				this.position = Reflect.field(data,"position");
			} else {
				this.position = "center";
			}
			if(this.font == null) {
				this.font = "sans";
			}
			if(this.fontcolor == null) {
				this.fontcolor = "0xffffff";
			}
			if(this.fontsize == null) {
				this.fontsize = 20;
			}
			if(this.buton == null) {
				this.buton = "";
			}
			if(this.gap == null) {
				this.gap = 10;
			}
			if(this.position == null) {
				this.position = "center";
			}
			this.fontcolor = com_tilbuci_statictools_StringStatic.colorHex(this.fontcolor,"#FFFFFF");
			if(this._btbitmap == null) {
				this._btbitmap = new com_tilbuci_display_PictureImage($bind(this,this.onBTLoad));
			}
			this._btbitmap.load(this.buton);
			return true;
		} else {
			return false;
		}
	}
	,kill: function() {
		if(this.parent != null) {
			this.parent.removeChild(this);
		}
		this.removeChildren();
		this.id = this.font = this.fontcolor = this.buton = this.position = null;
		while(this._buttons.length > 0) this._buttons.shift().kill();
		this._buttons = null;
		this._options = null;
		this.menuSize = null;
		if(this.parent != null) {
			this.parent.removeChild(this);
		}
	}
	,toObject: function() {
		return { id : this.id, font : this.font, fontcolor : this.fontcolor, fontsize : this.fontsize, buton : this.buton, position : this.position, gap : this.gap};
	}
	,onBTLoad: function(ok) {
		this.ok = ok;
		if(ok) {
			this._btsize = new openfl_geom_Point(this._btbitmap.oWidth,this._btbitmap.oHeight);
		}
	}
	,onClick: function(val) {
		if(this._options[Std.parseInt(val)][1] != "") {
			com_tilbuci_data_GlobalPlayer.parser.run("{\"ac\":\"scene.load\",\"param\":[\"" + this._options[Std.parseInt(val)][1] + "\"]}");
		}
		this.remove();
	}
	,__class__: com_tilbuci_contraptions_DflowContraption
});
var com_tilbuci_contraptions_FormContraption = function(data) {
	this._inputs = new haxe_ds_StringMap();
	this._graphics = new haxe_ds_StringMap();
	this._created = false;
	this.elem = [];
	this.ok = false;
	openfl_display_Sprite.call(this);
	if(data != null) {
		this.load(data);
	}
};
$hxClasses["com.tilbuci.contraptions.FormContraption"] = com_tilbuci_contraptions_FormContraption;
com_tilbuci_contraptions_FormContraption.__name__ = "com.tilbuci.contraptions.FormContraption";
com_tilbuci_contraptions_FormContraption.__super__ = openfl_display_Sprite;
com_tilbuci_contraptions_FormContraption.prototype = $extend(openfl_display_Sprite.prototype,{
	ok: null
	,id: null
	,elem: null
	,_created: null
	,_graphics: null
	,_ok: null
	,_cancel: null
	,_inputs: null
	,setValue: function(nm,value) {
		if(this._created) {
			if(Object.prototype.hasOwnProperty.call(this._inputs.h,nm)) {
				var found = false;
				if(((this._inputs.h[nm]) instanceof feathers_controls_TextInput)) {
					var timp = this._inputs.h[nm];
					timp.set_text(com_tilbuci_data_GlobalPlayer.parser.parseString(value));
					found = true;
				} else if(((this._inputs.h[nm]) instanceof feathers_controls_NumericStepper)) {
					var nimp = this._inputs.h[nm];
					nimp.set_value(com_tilbuci_data_GlobalPlayer.parser.parseInt(value));
					found = true;
				} else if(((this._inputs.h[nm]) instanceof feathers_controls_ToggleButton)) {
					var tgimp = this._inputs.h[nm];
					tgimp.set_selected(com_tilbuci_data_GlobalPlayer.parser.parseBool(value));
					found = true;
				} else if(((this._inputs.h[nm]) instanceof feathers_controls_TextArea)) {
					var tximp = this._inputs.h[nm];
					tximp.set_text(com_tilbuci_data_GlobalPlayer.parser.parseString(value));
					found = true;
				} else if(((this._inputs.h[nm]) instanceof feathers_controls_PopUpListView)) {
					var simp = this._inputs.h[nm];
					var _g = 0;
					var _g1 = simp.get_dataProvider().get_length();
					while(_g < _g1) {
						var i = _g++;
						if(simp.get_dataProvider().get(i).text == com_tilbuci_data_GlobalPlayer.parser.parseString(value)) {
							simp.set_selectedIndex(i);
						}
					}
					found = true;
				}
				return found;
			} else {
				return false;
			}
		} else {
			return false;
		}
	}
	,getValue: function(nm) {
		if(this._created) {
			if(Object.prototype.hasOwnProperty.call(this._inputs.h,nm)) {
				var found = "";
				if(((this._inputs.h[nm]) instanceof feathers_controls_TextInput)) {
					var timp = this._inputs.h[nm];
					found = timp.get_text();
				} else if(((this._inputs.h[nm]) instanceof feathers_controls_NumericStepper)) {
					var nimp = this._inputs.h[nm];
					found = Std.string(nimp.get_value());
				} else if(((this._inputs.h[nm]) instanceof feathers_controls_ToggleButton)) {
					var tgimp = this._inputs.h[nm];
					if(tgimp.get_selected()) {
						found = "true";
					} else {
						found = "false";
					}
				} else if(((this._inputs.h[nm]) instanceof feathers_controls_TextArea)) {
					var tximp = this._inputs.h[nm];
					found = tximp.get_text();
				} else if(((this._inputs.h[nm]) instanceof feathers_controls_PopUpListView)) {
					var simp = this._inputs.h[nm];
					found = simp.get_selectedItem().text;
				}
				return found;
			} else {
				return "";
			}
		} else {
			return "";
		}
	}
	,setStepper: function(nm,min,max,stp) {
		if(this._created) {
			if(Object.prototype.hasOwnProperty.call(this._inputs.h,nm)) {
				if(((this._inputs.h[nm]) instanceof feathers_controls_NumericStepper)) {
					var nimp = this._inputs.h[nm];
					nimp.set_minimum(min);
					nimp.set_maximum(max);
					nimp.set_step(stp);
					return true;
				} else {
					return false;
				}
			} else {
				return false;
			}
		} else {
			return false;
		}
	}
	,start: function(acok,accancel) {
		if(this.ok) {
			this._ok = acok;
			this._cancel = accancel;
			if(!this._created) {
				var _g = 0;
				var _g1 = this.elem;
				while(_g < _g1.length) {
					var el = _g1[_g];
					++_g;
					switch(el.type) {
					case "background":
						if(el.file != "") {
							var this1 = this._graphics;
							var v = new com_tilbuci_display_PictureImage();
							this1.h["background"] = v;
							this._graphics.h["background"].load(el.file);
							this._graphics.h["background"].set_visible(true);
						}
						break;
					case "btcancel":
						if(el.file != "") {
							var this2 = this._graphics;
							var v1 = new com_tilbuci_display_PictureImage();
							this2.h["btcancel"] = v1;
							this._graphics.h["btcancel"].load(el.file);
							this._graphics.h["btcancel"].set_visible(true);
							this._graphics.h["btcancel"].set_x(el.x);
							this._graphics.h["btcancel"].set_y(el.y);
							this._graphics.h["btcancel"].addEventListener("click",$bind(this,this.onCancel));
							this._graphics.h["btcancel"].addEventListener("mouseOver",$bind(this,this.onCancelOver));
							this._graphics.h["btcancel"].addEventListener("mouseOut",$bind(this,this.onCancelOut));
						}
						break;
					case "btok":
						var this3 = this._graphics;
						var v2 = new com_tilbuci_display_PictureImage();
						this3.h["btok"] = v2;
						this._graphics.h["btok"].load(el.file);
						this._graphics.h["btok"].set_visible(true);
						this._graphics.h["btok"].set_x(el.x);
						this._graphics.h["btok"].set_y(el.y);
						this._graphics.h["btok"].addEventListener("click",$bind(this,this.onOk));
						this._graphics.h["btok"].addEventListener("mouseOver",$bind(this,this.onOkOver));
						this._graphics.h["btok"].addEventListener("mouseOut",$bind(this,this.onOkOut));
						break;
					case "input":
						var this4 = this._inputs;
						var k = el.name;
						var v3 = new feathers_controls_TextInput();
						this4.h[k] = v3;
						this._inputs.h[el.name].set_x(el.x);
						this._inputs.h[el.name].set_y(el.y);
						this._inputs.h[el.name].set_width(el.width);
						break;
					case "numeric":
						var nst = new feathers_controls_NumericStepper();
						nst.set_minimum(0);
						nst.set_maximum(10000);
						nst.set_step(1);
						this._inputs.h[el.name] = nst;
						this._inputs.h[el.name].set_x(el.x);
						this._inputs.h[el.name].set_y(el.y);
						this._inputs.h[el.name].set_width(el.width);
						break;
					case "password":
						var tpass = new feathers_controls_TextInput();
						tpass.set_displayAsPassword(true);
						this._inputs.h[el.name] = tpass;
						this._inputs.h[el.name].set_x(el.x);
						this._inputs.h[el.name].set_y(el.y);
						this._inputs.h[el.name].set_width(el.width);
						break;
					case "select":
						var selinput = new feathers_controls_PopUpListView();
						var sellist = el.options.split(";");
						if(sellist.length == 0) {
							sellist.push("?");
						}
						var values = [];
						var _g2 = 0;
						while(_g2 < sellist.length) {
							var val = sellist[_g2];
							++_g2;
							values.push({ text : val});
						}
						selinput.set_dataProvider(new feathers_data_ArrayCollection(values));
						selinput.itemToText = function(item) {
							return item.text;
						};
						this._inputs.h[el.name] = selinput;
						this._inputs.h[el.name].set_x(el.x);
						this._inputs.h[el.name].set_y(el.y);
						this._inputs.h[el.name].set_width(el.width);
						break;
					case "textarea":
						var this5 = this._inputs;
						var k1 = el.name;
						var v4 = new feathers_controls_TextArea();
						this5.h[k1] = v4;
						this._inputs.h[el.name].set_x(el.x);
						this._inputs.h[el.name].set_y(el.y);
						this._inputs.h[el.name].set_width(el.width);
						break;
					case "toggle":
						var this6 = this._inputs;
						var k2 = el.name;
						var v5 = new feathers_controls_ToggleButton();
						this6.h[k2] = v5;
						this._inputs.h[el.name].set_x(el.x);
						this._inputs.h[el.name].set_y(el.y);
						break;
					}
				}
				if(Object.prototype.hasOwnProperty.call(this._graphics.h,"background")) {
					this.addChild(this._graphics.h["background"]);
				}
				if(Object.prototype.hasOwnProperty.call(this._graphics.h,"btok")) {
					this.addChild(this._graphics.h["btok"]);
				}
				if(Object.prototype.hasOwnProperty.call(this._graphics.h,"btcancel")) {
					this.addChild(this._graphics.h["btcancel"]);
				}
				var h = this._inputs.h;
				var k_h = h;
				var k_keys = Object.keys(h);
				var k_length = k_keys.length;
				var k_current = 0;
				while(k_current < k_length) {
					var k = k_keys[k_current++];
					this.addChild(this._inputs.h[k]);
				}
			}
			this._created = true;
			return true;
		} else {
			return false;
		}
	}
	,remove: function() {
		this.removeChildren();
		if(this.parent != null) {
			this.parent.removeChild(this);
		}
	}
	,clone: function() {
		return new com_tilbuci_contraptions_FormContraption(this.toObject());
	}
	,load: function(data) {
		this.ok = false;
		while(this.elem.length > 0) this.elem.shift();
		if(Object.prototype.hasOwnProperty.call(data,"id")) {
			this.id = Reflect.field(data,"id");
			if(Object.prototype.hasOwnProperty.call(data,"elem")) {
				var delem = Reflect.field(data,"elem");
				var _g = 0;
				var _g1 = Reflect.fields(delem);
				while(_g < _g1.length) {
					var el = _g1[_g];
					++_g;
					var formel = Reflect.field(delem,el);
					this.elem.push(formel);
				}
				this.ok = true;
				return true;
			} else {
				return false;
			}
		} else {
			return false;
		}
	}
	,kill: function() {
		if(this.parent != null) {
			this.parent.removeChild(this);
		}
		this.removeChildren();
		this.id = null;
		while(this.elem.length > 0) this.elem.shift();
		this.elem = null;
		if(Object.prototype.hasOwnProperty.call(this._graphics.h,"btok")) {
			this._graphics.h["btok"].removeEventListener("click",$bind(this,this.onOk));
			this._graphics.h["btok"].removeEventListener("mouseOver",$bind(this,this.onOkOver));
			this._graphics.h["btok"].removeEventListener("mouseOut",$bind(this,this.onOkOut));
		}
		if(Object.prototype.hasOwnProperty.call(this._graphics.h,"btcancel")) {
			this._graphics.h["btcancel"].removeEventListener("click",$bind(this,this.onCancel));
			this._graphics.h["btcancel"].removeEventListener("mouseOver",$bind(this,this.onCancelOver));
			this._graphics.h["btcancel"].removeEventListener("mouseOut",$bind(this,this.onCancelOut));
		}
		var h = this._graphics.h;
		var k_h = h;
		var k_keys = Object.keys(h);
		var k_length = k_keys.length;
		var k_current = 0;
		while(k_current < k_length) {
			var k = k_keys[k_current++];
			this._graphics.h[k].kill();
			var _this = this._graphics;
			if(Object.prototype.hasOwnProperty.call(_this.h,k)) {
				delete(_this.h[k]);
			}
		}
		this._graphics = null;
		this._ok = this._cancel = null;
		var h = this._inputs.h;
		var k_h = h;
		var k_keys = Object.keys(h);
		var k_length = k_keys.length;
		var k_current = 0;
		while(k_current < k_length) {
			var k = k_keys[k_current++];
			var _this = this._inputs;
			if(Object.prototype.hasOwnProperty.call(_this.h,k)) {
				delete(_this.h[k]);
			}
		}
		this._inputs = null;
	}
	,toObject: function() {
		return { id : this.id, elem : this.elem};
	}
	,onOk: function(evt) {
		this.onOkOut(null);
		this.onCancelOut(null);
		if(this._ok != null) {
			com_tilbuci_data_GlobalPlayer.parser.run(this._ok,true);
		}
		this._ok = this._cancel = null;
		com_tilbuci_data_GlobalPlayer.contraptions.hideForm();
	}
	,onOkOver: function(evt) {
		if(com_tilbuci_data_GlobalPlayer.cursorVisible) {
			if(com_tilbuci_data_GlobalPlayer.mdata.highlight != "") {
				this._graphics.h["btok"].set_filters([new openfl_filters_GlowFilter(com_tilbuci_data_GlobalPlayer.mdata.highlightInt,1,4,4,255,1,true)]);
			}
		}
	}
	,onOkOut: function(evt) {
		this._graphics.h["btok"].set_filters([]);
	}
	,onCancel: function(evt) {
		this.onOkOut(null);
		this.onCancelOut(null);
		if(this._cancel != null) {
			com_tilbuci_data_GlobalPlayer.parser.run(this._cancel,true);
		}
		this._ok = this._cancel = null;
		com_tilbuci_data_GlobalPlayer.contraptions.hideForm();
	}
	,onCancelOver: function(evt) {
		if(com_tilbuci_data_GlobalPlayer.cursorVisible) {
			if(com_tilbuci_data_GlobalPlayer.mdata.highlight != "") {
				this._graphics.h["btcancel"].set_filters([new openfl_filters_GlowFilter(com_tilbuci_data_GlobalPlayer.mdata.highlightInt,1,4,4,255,1,true)]);
			}
		}
	}
	,onCancelOut: function(evt) {
		this._graphics.h["btcancel"].set_filters([]);
	}
	,__class__: com_tilbuci_contraptions_FormContraption
});
var com_tilbuci_contraptions_InterfaceContraption = function(data) {
	this._graphics = new haxe_ds_StringMap();
	this._created = false;
	this.elem = [];
	this.ok = false;
	openfl_display_Sprite.call(this);
	if(data != null) {
		this.load(data);
	}
};
$hxClasses["com.tilbuci.contraptions.InterfaceContraption"] = com_tilbuci_contraptions_InterfaceContraption;
com_tilbuci_contraptions_InterfaceContraption.__name__ = "com.tilbuci.contraptions.InterfaceContraption";
com_tilbuci_contraptions_InterfaceContraption.__super__ = openfl_display_Sprite;
com_tilbuci_contraptions_InterfaceContraption.prototype = $extend(openfl_display_Sprite.prototype,{
	ok: null
	,id: null
	,elem: null
	,_created: null
	,_graphics: null
	,_smap: null
	,_text: null
	,start: function() {
		if(this.ok) {
			if(!this._created) {
				var imnum = 1;
				var _g = 0;
				var _g1 = this.elem;
				while(_g < _g1.length) {
					var el = _g1[_g];
					++_g;
					var pi;
					var opt;
					switch(el.type) {
					case "background":
						if(el.file != "") {
							pi = new com_tilbuci_display_PictureImage();
							pi.load(el.file);
							pi.set_visible(true);
							this._graphics.h["background"] = pi;
						}
						break;
					case "spritemap":
						opt = el.options.split(";");
						if(opt.length == 2) {
							this._smap = new com_tilbuci_display_SpritemapImage();
							this._smap.frames = Std.parseInt(opt[0]);
							this._smap.frtime = Std.parseInt(opt[1]);
							this._smap.playOnLoad = false;
							this._smap.load(el.file);
							this._smap.set_visible(true);
							this._smap.set_x(el.x);
							this._smap.set_y(el.y);
							if(el.action != "") {
								this._smap.extraInfo.push(el.action);
								this._smap.addEventListener("click",$bind(this,this.onClick));
								this._smap.addEventListener("mouseOver",$bind(this,this.onOver));
								this._smap.addEventListener("mouseOut",$bind(this,this.onOut));
							}
							var v = this._smap;
							this._graphics.h["spritemap"] = v;
						}
						break;
					case "text":
						opt = el.options.split(";");
						if(opt.length == 7) {
							this._text = new openfl_text_TextField();
							this._text.set_selectable(false);
							this._text.mouseEnabled = false;
							this._text.set_x(el.x);
							this._text.set_y(el.y);
							this._text.set_width(Std.parseInt(opt[0]));
							var format = new openfl_text_TextFormat(opt[1],Std.parseInt(opt[2]),com_tilbuci_statictools_StringStatic.colorInt(opt[3]),opt[4] == "true",opt[5] == "true",null,null,null,openfl_text_TextFormatAlign.fromString(opt[6]));
							this._text.set_defaultTextFormat(format);
							this._text.set_height(Std.parseInt(opt[2]) + 12);
						}
						break;
					default:
						if(el.file != "") {
							pi = new com_tilbuci_display_PictureImage();
							pi.set_x(el.x);
							pi.set_y(el.y);
							if(el.rot != null) {
								pi.set_rotation(el.rot);
							}
							if(el.alpha != null) {
								pi.set_alpha(el.alpha / 100);
							}
							if(el.action != "") {
								pi.extraInfo.push(el.action);
								pi.addEventListener("click",$bind(this,this.onClick));
								pi.addEventListener("mouseOver",$bind(this,this.onOver));
								pi.addEventListener("mouseOut",$bind(this,this.onOut));
							}
							pi.load(el.file);
							pi.set_visible(true);
							this._graphics.h["im" + imnum] = pi;
							++imnum;
						}
					}
				}
				if(Object.prototype.hasOwnProperty.call(this._graphics.h,"background")) {
					this.addChild(this._graphics.h["background"]);
				}
				var h = this._graphics.h;
				var k_h = h;
				var k_keys = Object.keys(h);
				var k_length = k_keys.length;
				var k_current = 0;
				while(k_current < k_length) {
					var k = k_keys[k_current++];
					if(k != "background") {
						this.addChild(this._graphics.h[k]);
					}
				}
				if(this._text != null) {
					this.addChild(this._text);
				}
			}
			this._created = true;
			return true;
		} else {
			return false;
		}
	}
	,checkCollision: function(obj) {
		var ret = false;
		var h = this._graphics.h;
		var k_h = h;
		var k_keys = Object.keys(h);
		var k_length = k_keys.length;
		var k_current = 0;
		while(k_current < k_length) {
			var k = k_h[k_keys[k_current++]];
			if(!ret) {
				if(k.hasEventListener("click") && k.extraInfo.length > 0) {
					if(obj.hitTestObject(k)) {
						var this1 = com_tilbuci_data_GlobalPlayer.mvActions;
						var key = com_tilbuci_data_GlobalPlayer.parser.parseString(k.extraInfo[0]);
						if(Object.prototype.hasOwnProperty.call(this1.h,key)) {
							var tmp = com_tilbuci_data_GlobalPlayer.parser;
							var this2 = com_tilbuci_data_GlobalPlayer.mvActions;
							var key1 = com_tilbuci_data_GlobalPlayer.parser.parseString(k.extraInfo[0]);
							tmp.run(this2.h[key1]);
							ret = true;
						}
					}
				}
			}
		}
		return ret;
	}
	,remove: function() {
		if(this.parent != null) {
			this.parent.removeChild(this);
		}
	}
	,clone: function() {
		return new com_tilbuci_contraptions_InterfaceContraption(this.toObject());
	}
	,load: function(data) {
		this.ok = false;
		while(this.elem.length > 0) this.elem.shift();
		if(Object.prototype.hasOwnProperty.call(data,"id")) {
			this.id = Reflect.field(data,"id");
			if(Object.prototype.hasOwnProperty.call(data,"elem")) {
				var delem = Reflect.field(data,"elem");
				var _g = 0;
				var _g1 = Reflect.fields(delem);
				while(_g < _g1.length) {
					var el = _g1[_g];
					++_g;
					var inel = Reflect.field(delem,el);
					this.elem.push(inel);
				}
				this.ok = true;
				return true;
			} else {
				return false;
			}
		} else {
			return false;
		}
	}
	,kill: function() {
		if(this.parent != null) {
			this.parent.removeChild(this);
		}
		this.removeChildren();
		this.id = null;
		while(this.elem.length > 0) this.elem.shift();
		this.elem = null;
		this._text = null;
		this._smap = null;
		var h = this._graphics.h;
		var k_h = h;
		var k_keys = Object.keys(h);
		var k_length = k_keys.length;
		var k_current = 0;
		while(k_current < k_length) {
			var k = k_keys[k_current++];
			if(this._graphics.h[k].hasEventListener("click")) {
				this._graphics.h[k].removeEventListener("click",$bind(this,this.onClick));
				this._graphics.h[k].removeEventListener("mouseOver",$bind(this,this.onOver));
				this._graphics.h[k].removeEventListener("mouseOut",$bind(this,this.onOut));
			}
			this._graphics.h[k].kill();
			var _this = this._graphics;
			if(Object.prototype.hasOwnProperty.call(_this.h,k)) {
				delete(_this.h[k]);
			}
		}
		this._graphics = null;
	}
	,toObject: function() {
		return { id : this.id, elem : this.elem};
	}
	,setText: function(tx) {
		if(this._text == null) {
			return false;
		} else {
			this._text.set_text(tx);
			return true;
		}
	}
	,setMapFrame: function(fr) {
		if(this._smap == null) {
			return false;
		} else {
			return this._smap.setFrame(fr);
		}
	}
	,pauseMap: function() {
		if(this._smap == null) {
			return false;
		} else {
			this._smap.pause();
			return true;
		}
	}
	,playMap: function() {
		if(this._smap == null) {
			return false;
		} else {
			this._smap.play();
			return true;
		}
	}
	,onClick: function(evt) {
		this.onOut(evt);
		var img = evt.target;
		if(img.extraInfo.length > 0) {
			var this1 = com_tilbuci_data_GlobalPlayer.mvActions;
			var key = com_tilbuci_data_GlobalPlayer.parser.parseString(img.extraInfo[0]);
			if(Object.prototype.hasOwnProperty.call(this1.h,key)) {
				var tmp = com_tilbuci_data_GlobalPlayer.parser;
				var this1 = com_tilbuci_data_GlobalPlayer.mvActions;
				var key = com_tilbuci_data_GlobalPlayer.parser.parseString(img.extraInfo[0]);
				tmp.run(this1.h[key]);
			}
		}
	}
	,onOver: function(evt) {
		var img = evt.target;
		if(com_tilbuci_data_GlobalPlayer.cursorVisible) {
			if(com_tilbuci_data_GlobalPlayer.mdata.highlight != "") {
				img.set_filters([new openfl_filters_GlowFilter(com_tilbuci_data_GlobalPlayer.mdata.highlightInt,1,4,4,255,1,true)]);
			}
		}
	}
	,onOut: function(evt) {
		var img = evt.target;
		img.set_filters([]);
	}
	,__class__: com_tilbuci_contraptions_InterfaceContraption
});
var com_tilbuci_contraptions_InventoryContraption = function() {
	this._rows = [];
	this._closeac = null;
	this.sound = "";
	this.mode = "a";
	this.close = "";
	this.vertical = "";
	this.horizontal = "";
	this.fontsize = 20;
	this.fontcolor = "0xffffff";
	this.font = "sans";
	this.ok = false;
	openfl_display_Sprite.call(this);
	var rw = new com_tilbuci_contraptions_InvItemRow($bind(this,this.draw));
	this._rows.push(rw);
	var rw = new com_tilbuci_contraptions_InvItemRow($bind(this,this.draw));
	this._rows.push(rw);
	var rw = new com_tilbuci_contraptions_InvItemRow($bind(this,this.draw));
	this._rows.push(rw);
};
$hxClasses["com.tilbuci.contraptions.InventoryContraption"] = com_tilbuci_contraptions_InventoryContraption;
com_tilbuci_contraptions_InventoryContraption.__name__ = "com.tilbuci.contraptions.InventoryContraption";
com_tilbuci_contraptions_InventoryContraption.__super__ = openfl_display_Sprite;
com_tilbuci_contraptions_InventoryContraption.prototype = $extend(openfl_display_Sprite.prototype,{
	ok: null
	,id: null
	,font: null
	,fontcolor: null
	,fontsize: null
	,horizontal: null
	,vertical: null
	,close: null
	,mode: null
	,sound: null
	,_hbitmap: null
	,_vbitmap: null
	,_cbitmap: null
	,_closeac: null
	,_rows: null
	,create: function(closeac) {
		this.removeChildren();
		this._cbitmap.set_visible(true);
		this._hbitmap.set_visible(this._vbitmap.set_visible(false));
		if(this.ok) {
			if(com_tilbuci_data_GlobalPlayer.area.get_pOrientation() == "horizontal") {
				this.addChild(this._hbitmap);
				this._hbitmap.set_x(this._hbitmap.set_y(0));
				this._hbitmap.set_width(com_tilbuci_data_GlobalPlayer.mdata.screen.big);
				this._hbitmap.set_height(com_tilbuci_data_GlobalPlayer.mdata.screen.small);
				this._cbitmap.set_x(this._hbitmap.get_width() - this._cbitmap.get_width());
				this._hbitmap.set_visible(true);
			} else {
				this.addChild(this._vbitmap);
				this._vbitmap.set_x(this._vbitmap.set_y(0));
				this._vbitmap.set_width(com_tilbuci_data_GlobalPlayer.mdata.screen.small);
				this._vbitmap.set_height(com_tilbuci_data_GlobalPlayer.mdata.screen.big);
				this._cbitmap.set_x(this._vbitmap.get_width() - this._cbitmap.get_width());
				this._vbitmap.set_visible(true);
			}
			var _g = 0;
			var _g1 = this._rows;
			while(_g < _g1.length) {
				var r = _g1[_g];
				++_g;
				this.addChild(r);
			}
			this._cbitmap.set_y(0);
			this.addChild(this._cbitmap);
			this._closeac = closeac;
		}
		return this;
	}
	,draw: function() {
		var _g = 0;
		var _g1 = this._rows;
		while(_g < _g1.length) {
			var r = _g1[_g];
			++_g;
			r.setText(this.font,this.fontsize,com_tilbuci_statictools_StringStatic.colorInt(this.fontcolor));
		}
		this._rows[0].setData(com_tilbuci_data_GlobalPlayer.narrative.keyItems);
		var cons1names = [];
		var cons1amounts = [];
		var cons2names = [];
		var cons2amounts = [];
		if(com_tilbuci_data_GlobalPlayer.narrative.consItNames.length > 0) {
			if(com_tilbuci_data_GlobalPlayer.narrative.consItNames.length > 0) {
				cons1names.push(com_tilbuci_data_GlobalPlayer.narrative.consItNames[0]);
				cons1amounts.push(com_tilbuci_data_GlobalPlayer.narrative.consItAmounts[0]);
			}
			if(com_tilbuci_data_GlobalPlayer.narrative.consItNames.length > 1) {
				cons1names.push(com_tilbuci_data_GlobalPlayer.narrative.consItNames[1]);
				cons1amounts.push(com_tilbuci_data_GlobalPlayer.narrative.consItAmounts[1]);
			}
			if(com_tilbuci_data_GlobalPlayer.narrative.consItNames.length > 2) {
				cons1names.push(com_tilbuci_data_GlobalPlayer.narrative.consItNames[2]);
				cons1amounts.push(com_tilbuci_data_GlobalPlayer.narrative.consItAmounts[2]);
			}
			if(com_tilbuci_data_GlobalPlayer.narrative.consItNames.length > 3) {
				cons1names.push(com_tilbuci_data_GlobalPlayer.narrative.consItNames[3]);
				cons1amounts.push(com_tilbuci_data_GlobalPlayer.narrative.consItAmounts[3]);
			}
		}
		if(com_tilbuci_data_GlobalPlayer.narrative.consItNames.length > 4) {
			if(com_tilbuci_data_GlobalPlayer.narrative.consItNames.length > 4) {
				cons2names.push(com_tilbuci_data_GlobalPlayer.narrative.consItNames[4]);
				cons2amounts.push(com_tilbuci_data_GlobalPlayer.narrative.consItAmounts[4]);
			}
			if(com_tilbuci_data_GlobalPlayer.narrative.consItNames.length > 5) {
				cons2names.push(com_tilbuci_data_GlobalPlayer.narrative.consItNames[5]);
				cons2amounts.push(com_tilbuci_data_GlobalPlayer.narrative.consItAmounts[5]);
			}
			if(com_tilbuci_data_GlobalPlayer.narrative.consItNames.length > 6) {
				cons2names.push(com_tilbuci_data_GlobalPlayer.narrative.consItNames[6]);
				cons2amounts.push(com_tilbuci_data_GlobalPlayer.narrative.consItAmounts[6]);
			}
			if(com_tilbuci_data_GlobalPlayer.narrative.consItNames.length > 7) {
				cons2names.push(com_tilbuci_data_GlobalPlayer.narrative.consItNames[7]);
				cons2amounts.push(com_tilbuci_data_GlobalPlayer.narrative.consItAmounts[7]);
			}
		}
		this._rows[1].setData(cons1names,cons1amounts);
		this._rows[2].setData(cons2names,cons2amounts);
		var areax = 0;
		var areay = 0;
		var rowref = 0;
		if(this._hbitmap.get_visible()) {
			areax = this._hbitmap.get_width() - 2 * this._cbitmap.get_width();
			areay = this._hbitmap.get_height() - 2 * this._cbitmap.get_height();
			rowref = areay / 5;
			if(this.mode == "k") {
				this._rows[0].set_x(this._cbitmap.get_width());
				this._rows[0].set_y(this._cbitmap.get_height() + rowref * 2);
				this._rows[0].draw("h",areax,rowref);
				this._rows[1].set_visible(this._rows[2].set_visible(false));
			} else if(this.mode == "c") {
				this._rows[1].set_x(this._rows[2].set_x(this._cbitmap.get_width()));
				this._rows[1].set_y(this._cbitmap.get_height() + rowref);
				this._rows[2].set_y(this._cbitmap.get_height() + rowref * 3);
				this._rows[1].draw("h",areax,rowref);
				this._rows[2].draw("h",areax,rowref);
				this._rows[0].set_visible(false);
			} else {
				var _g = 0;
				var _g1 = this._rows.length;
				while(_g < _g1) {
					var r = _g++;
					this._rows[r].set_x(this._cbitmap.get_width());
					this._rows[r].set_y(this._cbitmap.get_height() + r * rowref * 2);
					this._rows[r].draw("h",areax,rowref);
				}
			}
		} else {
			areax = this._vbitmap.get_width() - 2 * this._cbitmap.get_width();
			areay = this._vbitmap.get_height() - 2 * this._cbitmap.get_height();
			rowref = areax / 5;
			if(this.mode == "k") {
				this._rows[0].set_y(this._cbitmap.get_height());
				this._rows[0].set_x(this._cbitmap.get_width() + rowref * 2);
				this._rows[0].draw("v",areay,rowref);
				this._rows[1].set_visible(this._rows[2].set_visible(false));
			} else if(this.mode == "c") {
				this._rows[1].set_y(this._rows[2].set_y(this._cbitmap.get_height()));
				this._rows[1].set_x(this._cbitmap.get_width() + rowref);
				this._rows[2].set_x(this._cbitmap.get_width() + rowref * 3);
				this._rows[1].draw("v",areay,rowref);
				this._rows[2].draw("v",areay,rowref);
				this._rows[0].set_visible(false);
			} else {
				var _g = 0;
				var _g1 = this._rows.length;
				while(_g < _g1) {
					var r = _g++;
					this._rows[r].set_y(this._cbitmap.get_height());
					this._rows[r].set_x(this._cbitmap.get_width() + r * rowref * 2);
					this._rows[r].draw("v",areay,rowref);
				}
			}
		}
	}
	,checkCollision: function(obj) {
		var found = false;
		if(this.ok) {
			found = this._cbitmap.hitTestObject(obj);
			if(found) {
				this.onClose();
			} else {
				if(!found) {
					found = this._rows[0].checkCollision(obj);
				}
				if(!found) {
					found = this._rows[1].checkCollision(obj);
				}
				if(!found) {
					found = this._rows[2].checkCollision(obj);
				}
			}
		}
		return found;
	}
	,checkOver: function(obj) {
		var found = false;
		if(this.ok) {
			found = this._cbitmap.hitTestObject(obj);
			if(!found) {
				found = this._rows[0].checkOver(obj);
			}
			if(!found) {
				found = this._rows[1].checkOver(obj);
			}
			if(!found) {
				found = this._rows[2].checkOver(obj);
			}
		}
		return found;
	}
	,remove: function() {
		this.removeChildren();
		if(this.parent != null) {
			this.parent.removeChild(this);
		}
	}
	,clone: function() {
		var mn = new com_tilbuci_contraptions_InventoryContraption();
		mn.load({ id : this.id, font : this.font, fontcolor : this.fontcolor, fontsize : this.fontsize, horizontal : this.horizontal, vertical : this.vertical, close : this.close, mode : this.mode, sound : this.sound});
		return mn;
	}
	,load: function(data) {
		this.ok = false;
		if(Object.prototype.hasOwnProperty.call(data,"id")) {
			this.id = Reflect.field(data,"id");
			if(Object.prototype.hasOwnProperty.call(data,"font")) {
				this.font = Reflect.field(data,"font");
			} else {
				this.font = "sans";
			}
			if(Object.prototype.hasOwnProperty.call(data,"fontcolor")) {
				this.fontcolor = Reflect.field(data,"fontcolor");
			} else {
				this.fontcolor = "0xffffff";
			}
			if(Object.prototype.hasOwnProperty.call(data,"fontsize")) {
				this.fontsize = Reflect.field(data,"fontsize");
			} else {
				this.fontsize = 20;
			}
			if(Object.prototype.hasOwnProperty.call(data,"vertical")) {
				this.vertical = Reflect.field(data,"vertical");
			} else {
				this.vertical = "";
			}
			if(Object.prototype.hasOwnProperty.call(data,"horizontal")) {
				this.horizontal = Reflect.field(data,"horizontal");
			} else {
				this.horizontal = "";
			}
			if(Object.prototype.hasOwnProperty.call(data,"close")) {
				this.close = Reflect.field(data,"close");
			} else {
				this.close = "";
			}
			if(Object.prototype.hasOwnProperty.call(data,"mode")) {
				this.mode = Reflect.field(data,"mode");
			} else {
				this.mode = "a";
			}
			if(Object.prototype.hasOwnProperty.call(data,"sound")) {
				this.sound = Reflect.field(data,"sound");
			} else {
				this.sound = "";
			}
			if(this.font == null) {
				this.font = "sans";
			}
			if(this.fontcolor == null) {
				this.fontcolor = "0xffffff";
			}
			if(this.fontsize == null) {
				this.fontsize = 20;
			}
			if(this.vertical == null) {
				this.vertical = "";
			}
			if(this.horizontal == null) {
				this.horizontal = "";
			}
			if(this.close == null) {
				this.close = "";
			}
			if(this.mode == null) {
				this.mode = "a";
			}
			if(this.sound == null) {
				this.sound = "";
			}
			this.fontcolor = com_tilbuci_statictools_StringStatic.colorHex(this.fontcolor,"#FFFFFF");
			if(this.horizontal != "" || this.vertical != "") {
				if(this.horizontal == "") {
					this.horizontal = this.vertical;
				}
				if(this.vertical == "") {
					this.vertical = this.horizontal;
				}
			}
			if(this._cbitmap == null) {
				this._cbitmap = new com_tilbuci_display_PictureImage($bind(this,this.onBTLoad));
			}
			if(this.close != "") {
				this._cbitmap.load(this.close);
			}
			return true;
		} else {
			return false;
		}
	}
	,kill: function() {
		if(this.parent != null) {
			this.parent.removeChild(this);
		}
		this.removeChildren();
		this.id = this.font = this.fontcolor = this.horizontal = this.vertical = this.close = this.sound = null;
		if(this.parent != null) {
			this.parent.removeChild(this);
		}
		if(this._cbitmap != null) {
			if(this._cbitmap.hasEventListener("click")) {
				this._cbitmap.removeEventListener("click",$bind(this,this.onClose));
				this._cbitmap.removeEventListener("mouseOver",$bind(this,this.onCloseOver));
				this._cbitmap.removeEventListener("mouseOut",$bind(this,this.onCloseOut));
			}
			this._cbitmap.kill();
		}
		this._cbitmap = null;
		if(this._hbitmap != null) {
			this._hbitmap.kill();
		}
		this._hbitmap = null;
		if(this._vbitmap != null) {
			this._vbitmap.kill();
		}
		this._vbitmap = null;
		while(this._rows.length > 0) this._rows.shift().kill();
		this._rows = null;
	}
	,toObject: function() {
		return { id : this.id, font : this.font, fontcolor : this.fontcolor, fontsize : this.fontsize, horizontal : this.horizontal, vertical : this.vertical, close : this.close, mode : this.mode, sound : this.sound};
	}
	,invClose: function() {
		this.onCloseOut(null);
		this.removeChildren();
		if(this._closeac != null) {
			com_tilbuci_data_GlobalPlayer.parser.run(this._closeac,true);
			this._closeac = null;
		}
	}
	,onBTLoad: function(ok) {
		this.ok = ok;
		if(ok) {
			if(this._hbitmap == null) {
				this._hbitmap = new com_tilbuci_display_PictureImage($bind(this,this.onBgLoad));
			}
			this._hbitmap.load(this.horizontal);
			if(this._vbitmap == null) {
				this._vbitmap = new com_tilbuci_display_PictureImage($bind(this,this.onBgLoad));
			}
			this._vbitmap.load(this.vertical);
			this._cbitmap.addEventListener("click",$bind(this,this.onClose));
			this._cbitmap.addEventListener("mouseOver",$bind(this,this.onCloseOver));
			this._cbitmap.addEventListener("mouseOut",$bind(this,this.onCloseOut));
		}
	}
	,onBgLoad: function(ok) {
		if(!ok) {
			this.ok = false;
		}
	}
	,onClose: function(evt) {
		com_tilbuci_data_GlobalPlayer.parser.run("[ { \"ac\": \"inventory.close\", \"param\": [ ] } ]");
	}
	,onCloseOver: function(evt) {
		if(com_tilbuci_data_GlobalPlayer.cursorVisible) {
			if(com_tilbuci_data_GlobalPlayer.mode != "editor" && com_tilbuci_data_GlobalPlayer.mdata.highlightInt != null && !com_tilbuci_data_GlobalPlayer.isMobile()) {
				this._cbitmap.set_filters([new openfl_filters_GlowFilter(com_tilbuci_data_GlobalPlayer.mdata.highlightInt,1,4,4,255,1,true)]);
			}
		}
	}
	,onCloseOut: function(evt) {
		this._cbitmap.set_filters([]);
	}
	,__class__: com_tilbuci_contraptions_InventoryContraption
});
var com_tilbuci_contraptions_InvItemRow = function(dr) {
	this._draw = null;
	this._size = 0;
	this._texts = [];
	this.boxes = [];
	openfl_display_Sprite.call(this);
	this.set_visible(false);
	this._draw = dr;
	var box = new com_tilbuci_display_PictureImage($bind(this,this.onBox));
	box.extraInfo.push("");
	box.addEventListener("click",$bind(this,this.onBoxClick));
	box.addEventListener("mouseOver",$bind(this,this.onBoxOver));
	box.addEventListener("mouseOut",$bind(this,this.onBoxOut));
	this.addChild(box);
	this.boxes.push(box);
	var text = new openfl_text_TextField();
	text.set_visible(false);
	this.addChild(text);
	this._texts.push(text);
	var box = new com_tilbuci_display_PictureImage($bind(this,this.onBox));
	box.extraInfo.push("");
	box.addEventListener("click",$bind(this,this.onBoxClick));
	box.addEventListener("mouseOver",$bind(this,this.onBoxOver));
	box.addEventListener("mouseOut",$bind(this,this.onBoxOut));
	this.addChild(box);
	this.boxes.push(box);
	var text = new openfl_text_TextField();
	text.set_visible(false);
	this.addChild(text);
	this._texts.push(text);
	var box = new com_tilbuci_display_PictureImage($bind(this,this.onBox));
	box.extraInfo.push("");
	box.addEventListener("click",$bind(this,this.onBoxClick));
	box.addEventListener("mouseOver",$bind(this,this.onBoxOver));
	box.addEventListener("mouseOut",$bind(this,this.onBoxOut));
	this.addChild(box);
	this.boxes.push(box);
	var text = new openfl_text_TextField();
	text.set_visible(false);
	this.addChild(text);
	this._texts.push(text);
	var box = new com_tilbuci_display_PictureImage($bind(this,this.onBox));
	box.extraInfo.push("");
	box.addEventListener("click",$bind(this,this.onBoxClick));
	box.addEventListener("mouseOver",$bind(this,this.onBoxOver));
	box.addEventListener("mouseOut",$bind(this,this.onBoxOut));
	this.addChild(box);
	this.boxes.push(box);
	var text = new openfl_text_TextField();
	text.set_visible(false);
	this.addChild(text);
	this._texts.push(text);
};
$hxClasses["com.tilbuci.contraptions.InvItemRow"] = com_tilbuci_contraptions_InvItemRow;
com_tilbuci_contraptions_InvItemRow.__name__ = "com.tilbuci.contraptions.InvItemRow";
com_tilbuci_contraptions_InvItemRow.__super__ = openfl_display_Sprite;
com_tilbuci_contraptions_InvItemRow.prototype = $extend(openfl_display_Sprite.prototype,{
	boxes: null
	,_texts: null
	,_size: null
	,_draw: null
	,setData: function(names,amounts) {
		this.set_visible(false);
		if(amounts == null) {
			amounts = [0,0,0,0];
		}
		var _g = 0;
		var _g1 = this.boxes.length;
		while(_g < _g1) {
			var i = _g++;
			this.boxes[i].set_visible(false);
			this.boxes[i].extraInfo[0] = "";
			this.boxes[i].extraInfo[1] = i == null ? "null" : "" + i;
			this.boxes[i].unload();
			this._texts[i].set_visible(false);
			this._texts[i].set_text("");
		}
		var _g = 0;
		var _g1 = names.length;
		while(_g < _g1) {
			var i = _g++;
			if(i < 4) {
				if(Object.prototype.hasOwnProperty.call(com_tilbuci_data_GlobalPlayer.narrative.items.h,names[i])) {
					this.boxes[i].extraInfo[0] = names[i];
					this.boxes[i].load(com_tilbuci_data_GlobalPlayer.narrative.items.h[names[i]].itgraphic);
					if(amounts[i] != 0) {
						this._texts[i].set_text(Std.string(amounts[i]));
					}
				}
			}
		}
	}
	,draw: function(orientation,size,iconsize) {
		this._size = iconsize;
		var spacer = size / 9;
		var _g = 0;
		var _g1 = this.boxes.length;
		while(_g < _g1) {
			var i = _g++;
			this.boxes[i].set_width(this.boxes[i].set_height(this._size));
			if(orientation == "h") {
				this.boxes[i].set_y(0);
				this.boxes[i].set_x(spacer + i * 2 * spacer);
			} else {
				this.boxes[i].set_x(0);
				this.boxes[i].set_y(spacer + i * 2 * spacer);
			}
		}
	}
	,onBox: function(ok) {
		var _g = 0;
		var _g1 = this.boxes.length;
		while(_g < _g1) {
			var i = _g++;
			this.boxes[i].set_visible(this.boxes[i].get_mediaLoaded());
			if(this.boxes[i].get_mediaLoaded()) {
				this.set_visible(true);
				this.boxes[i].set_width(this.boxes[i].set_height(this._size));
				if(this._texts[i].get_text() != "") {
					this._texts[i].set_width(this._size);
					this._texts[i].set_x(this.boxes[i].get_x());
					this._texts[i].set_y(this.boxes[i].get_y() + this._size + 5);
					this._texts[i].set_visible(true);
				}
			}
		}
	}
	,kill: function() {
		this.removeChildren();
		while(this.boxes.length > 0) {
			this.boxes[0].removeEventListener("click",$bind(this,this.onBoxClick));
			this.boxes[0].removeEventListener("mouseOver",$bind(this,this.onBoxOver));
			this.boxes[0].removeEventListener("mouseOut",$bind(this,this.onBoxOut));
			this.boxes.shift().kill();
		}
		this.boxes = null;
		while(this._texts.length > 0) this._texts.shift();
		this._texts = null;
		this._draw = null;
	}
	,setText: function(font,size,color) {
		var _g = 0;
		var _g1 = this._texts;
		while(_g < _g1.length) {
			var t = _g1[_g];
			++_g;
			t.set_defaultTextFormat(new openfl_text_TextFormat(font,size,color,null,null,null,null,null,openfl_text_TextFormatAlign.fromString("center")));
		}
	}
	,checkCollision: function(obj) {
		var found = false;
		var _g = 0;
		var _g1 = this.boxes;
		while(_g < _g1.length) {
			var b = _g1[_g];
			++_g;
			if(!found && b.get_visible()) {
				if(b.hitTestObject(obj)) {
					if(Object.prototype.hasOwnProperty.call(com_tilbuci_data_GlobalPlayer.narrative.items.h,b.extraInfo[0])) {
						if(com_tilbuci_data_GlobalPlayer.narrative.items.h[b.extraInfo[0]].itaction != "") {
							found = true;
							var ac = com_tilbuci_data_GlobalPlayer.narrative.items.h[b.extraInfo[0]].itaction;
							if(this._texts[Std.parseInt(b.extraInfo[1])].get_text() != "") {
								com_tilbuci_data_GlobalPlayer.narrative.consumeItem(b.extraInfo[0]);
								this._draw();
							}
							com_tilbuci_statictools_SpriteStatic.quickJump(b,0.3,5);
							if(com_tilbuci_data_GlobalPlayer.contraptions.inv.h["inv"].sound != "") {
								com_tilbuci_data_GlobalPlayer.contraptions.soundPlay(com_tilbuci_data_GlobalPlayer.parser.parseString(com_tilbuci_data_GlobalPlayer.contraptions.inv.h["inv"].sound));
							}
							com_tilbuci_data_GlobalPlayer.parser.run(ac);
						}
					}
				}
			}
		}
		return found;
	}
	,checkOver: function(obj) {
		var found = false;
		var _g = 0;
		var _g1 = this.boxes;
		while(_g < _g1.length) {
			var b = _g1[_g];
			++_g;
			if(!found && b.get_visible()) {
				if(b.hitTestObject(obj)) {
					if(Object.prototype.hasOwnProperty.call(com_tilbuci_data_GlobalPlayer.narrative.items.h,b.extraInfo[0])) {
						if(com_tilbuci_data_GlobalPlayer.narrative.items.h[b.extraInfo[0]].itaction != "") {
							found = true;
						}
					}
				}
			}
		}
		return found;
	}
	,onBoxClick: function(evt) {
		var box = evt.target;
		if(Object.prototype.hasOwnProperty.call(com_tilbuci_data_GlobalPlayer.narrative.items.h,box.extraInfo[0])) {
			if(com_tilbuci_data_GlobalPlayer.narrative.items.h[box.extraInfo[0]].itaction != "") {
				var ac = com_tilbuci_data_GlobalPlayer.narrative.items.h[box.extraInfo[0]].itaction;
				if(this._texts[Std.parseInt(box.extraInfo[1])].get_text() != "") {
					com_tilbuci_data_GlobalPlayer.narrative.consumeItem(box.extraInfo[0]);
					this._draw();
				}
				com_tilbuci_statictools_SpriteStatic.quickJump(box,0.3,5);
				if(com_tilbuci_data_GlobalPlayer.contraptions.inv.h["inv"].sound != "") {
					com_tilbuci_data_GlobalPlayer.contraptions.soundPlay(com_tilbuci_data_GlobalPlayer.parser.parseString(com_tilbuci_data_GlobalPlayer.contraptions.inv.h["inv"].sound));
				}
				com_tilbuci_data_GlobalPlayer.parser.run(ac);
			}
		}
	}
	,onBoxOver: function(evt) {
		if(com_tilbuci_data_GlobalPlayer.cursorVisible) {
			if(com_tilbuci_data_GlobalPlayer.mode != "editor" && com_tilbuci_data_GlobalPlayer.mdata.highlightInt != null && !com_tilbuci_data_GlobalPlayer.isMobile()) {
				var box = evt.target;
				if(Object.prototype.hasOwnProperty.call(com_tilbuci_data_GlobalPlayer.narrative.items.h,box.extraInfo[0])) {
					if(com_tilbuci_data_GlobalPlayer.narrative.items.h[box.extraInfo[0]].itaction != "") {
						box.set_filters([new openfl_filters_GlowFilter(com_tilbuci_data_GlobalPlayer.mdata.highlightInt,1,4,4,255,1,true)]);
					}
				}
			}
		}
	}
	,onBoxOut: function(evt) {
		var box = evt.target;
		box.set_filters([]);
	}
	,__class__: com_tilbuci_contraptions_InvItemRow
});
var com_tilbuci_contraptions_MenuContraption = function() {
	this._buttons = [];
	this.bgalpha = 0;
	this.bgcolor = "0x000000";
	this.buton = "";
	this.background = "";
	this.fontsize = 20;
	this.fontcolor = "0xffffff";
	this.font = "sans";
	this.mode = "v";
	this.ok = false;
	openfl_display_Sprite.call(this);
};
$hxClasses["com.tilbuci.contraptions.MenuContraption"] = com_tilbuci_contraptions_MenuContraption;
com_tilbuci_contraptions_MenuContraption.__name__ = "com.tilbuci.contraptions.MenuContraption";
com_tilbuci_contraptions_MenuContraption.__super__ = openfl_display_Sprite;
com_tilbuci_contraptions_MenuContraption.prototype = $extend(openfl_display_Sprite.prototype,{
	ok: null
	,id: null
	,mode: null
	,font: null
	,fontcolor: null
	,fontsize: null
	,background: null
	,buton: null
	,bgcolor: null
	,bgalpha: null
	,_bgbitmap: null
	,_btbitmap: null
	,_btsize: null
	,_buttons: null
	,_ac: null
	,create: function(bts,ac) {
		if(this.ok) {
			this.removeChildren();
			this._bgbitmap.set_visible(true);
			this.addChild(this._bgbitmap);
			while(this._buttons.length > 0) this._buttons.shift().kill();
			var _g = 0;
			var _g1 = bts.length;
			while(_g < _g1) {
				var i = _g++;
				this._buttons.push(new com_tilbuci_contraptions_ContraptionButton(Std.string(i + 1),$bind(this,this.onClick),this.buton,bts[i],this.font,this.fontsize,com_tilbuci_statictools_StringStatic.colorInt(this.fontcolor)));
			}
			var px = (this._bgbitmap.oWidth - this._btsize.x) / 2;
			var gap = (this._bgbitmap.oHeight - this._btsize.y * this._buttons.length) / (this._buttons.length + 1);
			if(gap < 0) {
				gap = 5;
			}
			var _g = 0;
			var _g1 = this._buttons.length;
			while(_g < _g1) {
				var i = _g++;
				this._buttons[i].set_x(px);
				this._buttons[i].set_y((i + 1) * gap + i * this._btsize.y);
				this.addChild(this._buttons[i]);
			}
			this._ac = ac;
		}
		return this;
	}
	,checkCollision: function(obj) {
		var found = false;
		if(this.ok) {
			var _g = 0;
			var _g1 = this._buttons;
			while(_g < _g1.length) {
				var k = _g1[_g];
				++_g;
				var bt = k;
				if(bt != null) {
					if(obj.hitTestObject(bt)) {
						found = true;
						this._ac(bt.value);
					}
				}
			}
		}
		return found;
	}
	,remove: function() {
		this.removeChildren();
		this._ac = null;
		while(this._buttons.length > 0) this._buttons.shift().kill();
		if(this.parent != null) {
			this.parent.removeChild(this);
		}
	}
	,clone: function() {
		var mn = new com_tilbuci_contraptions_MenuContraption();
		mn.load({ id : this.id, mode : this.mode, font : this.font, fontcolor : this.fontcolor, fontsize : this.fontsize, background : this.background, buton : this.buton, bgcolor : this.bgcolor, bgalpha : this.bgalpha});
		return mn;
	}
	,load: function(data) {
		this.ok = false;
		if(Object.prototype.hasOwnProperty.call(data,"id")) {
			this.id = Reflect.field(data,"id");
			if(Object.prototype.hasOwnProperty.call(data,"font")) {
				this.font = Reflect.field(data,"font");
			} else {
				this.font = "sans";
			}
			if(Object.prototype.hasOwnProperty.call(data,"fontcolor")) {
				this.fontcolor = Reflect.field(data,"fontcolor");
			} else {
				this.fontcolor = "0xffffff";
			}
			if(Object.prototype.hasOwnProperty.call(data,"fontsize")) {
				this.fontsize = Reflect.field(data,"fontsize");
			} else {
				this.fontsize = 20;
			}
			if(Object.prototype.hasOwnProperty.call(data,"background")) {
				this.background = Reflect.field(data,"background");
			} else {
				this.background = "";
			}
			if(Object.prototype.hasOwnProperty.call(data,"buton")) {
				this.buton = Reflect.field(data,"buton");
			} else {
				this.buton = "";
			}
			if(Object.prototype.hasOwnProperty.call(data,"bgcolor")) {
				this.bgcolor = Reflect.field(data,"bgcolor");
			} else {
				this.bgcolor = "0x000000";
			}
			if(Object.prototype.hasOwnProperty.call(data,"bgalpha")) {
				this.bgalpha = Reflect.field(data,"bgalpha");
			} else {
				this.bgalpha = 0;
			}
			if(Object.prototype.hasOwnProperty.call(data,"mode")) {
				this.mode = Reflect.field(data,"mode");
			} else {
				this.mode = "v";
			}
			if(this.font == null) {
				this.font = "sans";
			}
			if(this.fontcolor == null) {
				this.fontcolor = "0xffffff";
			}
			if(this.fontsize == null) {
				this.fontsize = 20;
			}
			if(this.background == null) {
				this.background = "";
			}
			if(this.buton == null) {
				this.buton = "";
			}
			if(this.bgcolor == null) {
				this.bgcolor = "0x000000";
			}
			if(this.bgalpha == null) {
				this.bgalpha = 0;
			}
			if(this.mode == null) {
				this.mode = "v";
			}
			this.fontcolor = com_tilbuci_statictools_StringStatic.colorHex(this.fontcolor,"#FFFFFF");
			this.bgcolor = com_tilbuci_statictools_StringStatic.colorHex(this.bgcolor,"#000000");
			if(this._bgbitmap == null) {
				this._bgbitmap = new com_tilbuci_display_PictureImage($bind(this,this.onBGLoad));
			}
			this._bgbitmap.load(this.background);
			return true;
		} else {
			return false;
		}
	}
	,kill: function() {
		if(this.parent != null) {
			this.parent.removeChild(this);
		}
		this.removeChildren();
		this.id = this.font = this.fontcolor = this.background = this.buton = this.bgcolor = this.mode = null;
		if(this._bgbitmap != null) {
			this._bgbitmap.kill();
			this._bgbitmap = null;
		}
		this._ac = null;
		while(this._buttons.length > 0) this._buttons.shift().kill();
		this._buttons = null;
		if(this.parent != null) {
			this.parent.removeChild(this);
		}
	}
	,toObject: function() {
		return { id : this.id, mode : this.mode, font : this.font, fontcolor : this.fontcolor, fontsize : this.fontsize, background : this.background, buton : this.buton, bgcolor : this.bgcolor, bgalpha : this.bgalpha};
	}
	,onBGLoad: function(ok) {
		if(ok) {
			if(this._btbitmap == null) {
				this._btbitmap = new com_tilbuci_display_PictureImage($bind(this,this.onBTLoad));
			}
			this._btbitmap.load(this.buton);
		}
	}
	,onBTLoad: function(ok) {
		this.ok = ok;
		if(ok) {
			this._btsize = new openfl_geom_Point(this._btbitmap.oWidth,this._btbitmap.oHeight);
		}
	}
	,onClick: function(val) {
		this._ac(val);
	}
	,__class__: com_tilbuci_contraptions_MenuContraption
});
var com_tilbuci_contraptions_MessagesContraption = function() {
	this._buttons = [];
	this._btbitmap = [null,null,null];
	this._bgbitmap = null;
	this.gap = 10;
	this.buton = ["","",""];
	this.background = "";
	this.fontsize = 20;
	this.fontcolor = "0xffffff";
	this.font = "sans";
	this.ok = false;
	openfl_display_Sprite.call(this);
};
$hxClasses["com.tilbuci.contraptions.MessagesContraption"] = com_tilbuci_contraptions_MessagesContraption;
com_tilbuci_contraptions_MessagesContraption.__name__ = "com.tilbuci.contraptions.MessagesContraption";
com_tilbuci_contraptions_MessagesContraption.__super__ = openfl_display_Sprite;
com_tilbuci_contraptions_MessagesContraption.prototype = $extend(openfl_display_Sprite.prototype,{
	ok: null
	,id: null
	,font: null
	,fontcolor: null
	,fontsize: null
	,background: null
	,buton: null
	,gap: null
	,_bgbitmap: null
	,_btbitmap: null
	,_buttons: null
	,_text: null
	,_ac: null
	,create: function(msg,bts,ac) {
		if(this.ok) {
			this.removeChildren();
			this._bgbitmap.set_visible(true);
			this.addChild(this._bgbitmap);
			haxe_Log.trace("adicionar texto",{ fileName : "Source/com/tilbuci/contraptions/MessagesContraption.hx", lineNumber : 58, className : "com.tilbuci.contraptions.MessagesContraption", methodName : "create", customParams : [msg]});
			this._text = new openfl_text_TextField();
			this._text.set_width(this._bgbitmap.get_width() - this.gap * 2);
			this._text.set_height(this._bgbitmap.get_height() - this.gap * 2);
			this._text.set_x(this._text.set_y(this.gap));
			this._text.set_defaultTextFormat(new openfl_text_TextFormat(this.font,this.fontsize,com_tilbuci_statictools_StringStatic.colorInt(this.fontcolor),null,null,null,null,null,0));
			this._text.set_multiline(true);
			this._text.set_wordWrap(true);
			this._text.set_text(msg);
			this._text.set_visible(true);
			this._text.set_selectable(false);
			this.addChild(this._text);
			while(bts.length > 3) bts.pop();
			while(this._buttons.length > 0) this._buttons.shift().kill();
			var _g = 0;
			var _g1 = bts.length;
			while(_g < _g1) {
				var i = _g++;
				var cb = new com_tilbuci_contraptions_ContraptionButton(i == null ? "null" : "" + i,$bind(this,this.onClick),this.buton[i],bts[i],this.font,this.fontsize,com_tilbuci_statictools_StringStatic.colorInt(this.fontcolor));
				cb.set_x((this._bgbitmap.get_width() - this._btbitmap[i].get_width()) / 2);
				if(i == 0) {
					cb.set_y(this._bgbitmap.get_height() - this.gap - this._btbitmap[0].get_height());
					var fh = this._text;
					fh.set_height(fh.get_height() - (this.gap + this._btbitmap[0].get_height()));
				} else if(i == 1) {
					cb.set_y(this._bgbitmap.get_height() - this.gap - this._btbitmap[0].get_height() - this.gap - this._btbitmap[1].get_height());
					var fh1 = this._text;
					fh1.set_height(fh1.get_height() - (this.gap + this._btbitmap[1].get_height()));
				} else if(i == 2) {
					cb.set_y(this._bgbitmap.get_height() - this.gap - this._btbitmap[0].get_height() - this.gap - this._btbitmap[1].get_height() - this.gap - this._btbitmap[2].get_height());
					var fh2 = this._text;
					fh2.set_height(fh2.get_height() - (this.gap + this._btbitmap[2].get_height()));
				}
				this._buttons.push(cb);
				this.addChild(cb);
			}
			this._ac = ac;
		}
		return this;
	}
	,checkCollision: function(obj) {
		var found = false;
		if(this.ok) {
			var _g = 0;
			var _g1 = this._buttons;
			while(_g < _g1.length) {
				var k = _g1[_g];
				++_g;
				var bt = k;
				if(bt != null) {
					if(obj.hitTestObject(bt)) {
						found = true;
						this._ac(bt.value);
					}
				}
			}
		}
		return found;
	}
	,remove: function() {
		this.removeChildren();
		this._text = null;
		this._ac = null;
		while(this._buttons.length > 0) this._buttons.shift().kill();
		if(this.parent != null) {
			this.parent.removeChild(this);
		}
	}
	,clone: function() {
		var mn = new com_tilbuci_contraptions_MessagesContraption();
		mn.load({ id : this.id, font : this.font, fontcolor : this.fontcolor, fontsize : this.fontsize, background : this.background, gap : this.gap, buton0 : this.buton[0], buton1 : this.buton[1], buton2 : this.buton[2]});
		return mn;
	}
	,load: function(data) {
		this.ok = false;
		if(Object.prototype.hasOwnProperty.call(data,"id")) {
			this.id = Reflect.field(data,"id");
			if(Object.prototype.hasOwnProperty.call(data,"font")) {
				this.font = Reflect.field(data,"font");
			} else {
				this.font = "sans";
			}
			if(Object.prototype.hasOwnProperty.call(data,"fontcolor")) {
				this.fontcolor = Reflect.field(data,"fontcolor");
			} else {
				this.fontcolor = "0xffffff";
			}
			if(Object.prototype.hasOwnProperty.call(data,"fontsize")) {
				this.fontsize = Reflect.field(data,"fontsize");
			} else {
				this.fontsize = 20;
			}
			if(Object.prototype.hasOwnProperty.call(data,"gap")) {
				this.gap = Reflect.field(data,"gap");
			} else {
				this.gap = 10;
			}
			if(Object.prototype.hasOwnProperty.call(data,"background")) {
				this.background = Reflect.field(data,"background");
			} else {
				this.background = "";
			}
			if(Object.prototype.hasOwnProperty.call(data,"buton0") && Object.prototype.hasOwnProperty.call(data,"buton1") && Object.prototype.hasOwnProperty.call(data,"buton2")) {
				this.buton = [Reflect.field(data,"buton0"),Reflect.field(data,"buton1"),Reflect.field(data,"buton2")];
			} else {
				this.buton = ["","",""];
			}
			if(this.font == null) {
				this.font = "sans";
			}
			if(this.fontcolor == null) {
				this.fontcolor = "0xffffff";
			}
			if(this.fontsize == null) {
				this.fontsize = 20;
			}
			if(this.gap == null) {
				this.gap = 10;
			}
			if(this.background == null) {
				this.background = "";
			}
			if(this.buton == null) {
				this.buton = ["","",""];
			}
			var _g = 0;
			var _g1 = this.buton.length;
			while(_g < _g1) {
				var i = _g++;
				if(this.buton[i] == null) {
					this.buton[i] = "";
				}
			}
			if(this.buton[1] == "") {
				this.buton[1] = this.buton[0];
			}
			if(this.buton[2] == "") {
				this.buton[2] = this.buton[0];
			}
			this.fontcolor = com_tilbuci_statictools_StringStatic.colorHex(this.fontcolor,"#FFFFFF");
			if(this._bgbitmap == null) {
				this._bgbitmap = new com_tilbuci_display_PictureImage($bind(this,this.onBGLoad));
			}
			this._bgbitmap.load(this.background);
			return true;
		} else {
			return false;
		}
	}
	,kill: function() {
		if(this.parent != null) {
			this.parent.removeChild(this);
		}
		this.removeChildren();
		this.id = this.font = this.fontcolor = this.background = null;
		while(this.buton.length > 0) this.buton.shift();
		this.buton = null;
		this._bgbitmap.kill();
		this._bgbitmap = null;
		while(this._btbitmap.length > 0) this._btbitmap.shift().kill();
		this._btbitmap = null;
		this._ac = null;
		while(this._buttons.length > 0) this._buttons.shift().kill();
		this._buttons = null;
		if(this.parent != null) {
			this.parent.removeChild(this);
		}
	}
	,toObject: function() {
		return { id : this.id, font : this.font, fontcolor : this.fontcolor, fontsize : this.fontsize, background : this.background, gap : this.gap, buton0 : this.buton[0], buton1 : this.buton[1], buton2 : this.buton[2]};
	}
	,onBGLoad: function(ok) {
		if(ok) {
			if(this._btbitmap[0] == null) {
				this._btbitmap[0] = new com_tilbuci_display_PictureImage($bind(this,this.onBTLoad0));
			}
			this._btbitmap[0].load(this.buton[0]);
		} else {
			this.ok = false;
		}
	}
	,onBTLoad0: function(ok) {
		if(ok) {
			this._btbitmap[0].set_width(this._btbitmap[0].oWidth);
			this._btbitmap[0].set_height(this._btbitmap[0].oHeight);
			this.ok = true;
			if(this._btbitmap[1] == null) {
				this._btbitmap[1] = new com_tilbuci_display_PictureImage($bind(this,this.onBTLoad1));
			}
			if(this._btbitmap[2] == null) {
				this._btbitmap[2] = new com_tilbuci_display_PictureImage($bind(this,this.onBTLoad2));
			}
			this._btbitmap[1].load(this.buton[1]);
			this._btbitmap[2].load(this.buton[2]);
		}
	}
	,onBTLoad1: function(ok) {
		if(ok) {
			this._btbitmap[1].set_width(this._btbitmap[1].oWidth);
			this._btbitmap[1].set_height(this._btbitmap[1].oHeight);
		} else {
			this.ok = false;
		}
	}
	,onBTLoad2: function(ok) {
		if(ok) {
			this._btbitmap[2].set_width(this._btbitmap[2].oWidth);
			this._btbitmap[2].set_height(this._btbitmap[2].oHeight);
		} else {
			this.ok = false;
		}
	}
	,onClick: function(val) {
		this._ac(val);
	}
	,__class__: com_tilbuci_contraptions_MessagesContraption
});
var com_tilbuci_contraptions_MusicContraption = function(data) {
	this.ok = false;
	openfl_display_Sprite.call(this);
	if(data != null) {
		this.load(data);
	}
};
$hxClasses["com.tilbuci.contraptions.MusicContraption"] = com_tilbuci_contraptions_MusicContraption;
com_tilbuci_contraptions_MusicContraption.__name__ = "com.tilbuci.contraptions.MusicContraption";
com_tilbuci_contraptions_MusicContraption.__super__ = openfl_display_Sprite;
com_tilbuci_contraptions_MusicContraption.prototype = $extend(openfl_display_Sprite.prototype,{
	ok: null
	,id: null
	,media: null
	,_music: null
	,clone: function() {
		return new com_tilbuci_contraptions_MusicContraption(this.toObject());
	}
	,load: function(data) {
		this.ok = false;
		if(Object.prototype.hasOwnProperty.call(data,"id")) {
			this.id = Reflect.field(data,"id");
			if(Object.prototype.hasOwnProperty.call(data,"media")) {
				this.media = Reflect.field(data,"media");
				if(this.media == null) {
					this.media = "";
				}
				this._music = new com_tilbuci_display_AudioImage($bind(this,this.onLoad),$bind(this,this.onEnd));
				this.ok = true;
				return true;
			} else {
				return false;
			}
		} else {
			return false;
		}
	}
	,kill: function() {
		if(this._music != null) {
			this._music.stop();
			this._music.kill();
		}
		this.media = null;
	}
	,toObject: function() {
		return { id : this.id, media : this.media};
	}
	,play: function() {
		if(this._music != null) {
			if(this._music.get_lastMedia() != this.media) {
				this._music.load(this.media);
			} else {
				this._music.play();
			}
		}
	}
	,pause: function() {
		if(this._music != null) {
			this._music.pause();
		}
	}
	,stop: function() {
		if(this._music != null) {
			this._music.stop();
		}
	}
	,volume: function(vol) {
		if(vol > 100) {
			vol = 100;
		} else if(vol < 0) {
			vol = 0;
		}
		if(this._music != null) {
			this._music.iterateSound(vol / 100);
		}
	}
	,onLoad: function(ok) {
		this._music.play();
	}
	,onEnd: function() {
		this._music.play();
	}
	,__class__: com_tilbuci_contraptions_MusicContraption
});
var com_tilbuci_contraptions_SoundContraption = function(data) {
	this.ok = false;
	openfl_display_Sprite.call(this);
	if(data != null) {
		this.load(data);
	}
};
$hxClasses["com.tilbuci.contraptions.SoundContraption"] = com_tilbuci_contraptions_SoundContraption;
com_tilbuci_contraptions_SoundContraption.__name__ = "com.tilbuci.contraptions.SoundContraption";
com_tilbuci_contraptions_SoundContraption.__super__ = openfl_display_Sprite;
com_tilbuci_contraptions_SoundContraption.prototype = $extend(openfl_display_Sprite.prototype,{
	ok: null
	,id: null
	,media: null
	,_sound: null
	,clone: function() {
		return new com_tilbuci_contraptions_SoundContraption(this.toObject());
	}
	,load: function(data) {
		this.ok = false;
		if(Object.prototype.hasOwnProperty.call(data,"id")) {
			this.id = Reflect.field(data,"id");
			if(Object.prototype.hasOwnProperty.call(data,"media")) {
				this.media = Reflect.field(data,"media");
				if(this.media == null) {
					this.media = "";
				}
				this._sound = new com_tilbuci_display_AudioImage($bind(this,this.onLoad),$bind(this,this.onEnd));
				this.ok = true;
				return true;
			} else {
				return false;
			}
		} else {
			return false;
		}
	}
	,kill: function() {
		if(this._sound != null) {
			this._sound.stop();
			this._sound.kill();
		}
		this.media = null;
	}
	,toObject: function() {
		return { id : this.id, media : this.media};
	}
	,play: function() {
		if(this._sound != null) {
			if(this._sound.get_lastMedia() != this.media) {
				this._sound.load(this.media);
			} else {
				this._sound.play();
			}
		}
	}
	,pause: function() {
		if(this._sound != null) {
			this._sound.pause();
		}
	}
	,stop: function() {
		if(this._sound != null) {
			this._sound.stop();
		}
	}
	,volume: function(vol) {
		if(vol > 100) {
			vol = 100;
		} else if(vol < 0) {
			vol = 0;
		}
		if(this._sound != null) {
			this._sound.iterateSound(vol / 100);
		}
	}
	,onLoad: function(ok) {
		this._sound.play();
	}
	,onEnd: function() {
	}
	,__class__: com_tilbuci_contraptions_SoundContraption
});
var com_tilbuci_contraptions_TargetContraption = function(data) {
	this.inst3name = "";
	this.inst3 = "";
	this.inst2name = "";
	this.inst2 = "";
	this.inst1name = "";
	this.inst1 = "";
	this.interf = "";
	this.menus = "";
	this.defaultp = "";
	this.id = "";
	this.ok = false;
	if(data != null) {
		this.load(data);
	}
};
$hxClasses["com.tilbuci.contraptions.TargetContraption"] = com_tilbuci_contraptions_TargetContraption;
com_tilbuci_contraptions_TargetContraption.__name__ = "com.tilbuci.contraptions.TargetContraption";
com_tilbuci_contraptions_TargetContraption.prototype = {
	ok: null
	,id: null
	,defaultp: null
	,menus: null
	,interf: null
	,inst1: null
	,inst1name: null
	,inst2: null
	,inst2name: null
	,inst3: null
	,inst3name: null
	,clone: function() {
		return new com_tilbuci_contraptions_TargetContraption(this.toObject());
	}
	,load: function(data) {
		this.ok = false;
		if(Object.prototype.hasOwnProperty.call(data,"id")) {
			this.id = Reflect.field(data,"id");
			if(Object.prototype.hasOwnProperty.call(data,"defaultp")) {
				this.defaultp = Reflect.field(data,"defaultp");
				if(Object.prototype.hasOwnProperty.call(data,"menus")) {
					this.menus = Reflect.field(data,"menus");
				}
				if(Object.prototype.hasOwnProperty.call(data,"interf")) {
					this.interf = Reflect.field(data,"interf");
				}
				if(Object.prototype.hasOwnProperty.call(data,"inst1")) {
					this.inst1 = Reflect.field(data,"inst1");
				}
				if(Object.prototype.hasOwnProperty.call(data,"inst1name")) {
					this.inst1name = Reflect.field(data,"inst1name");
				}
				if(Object.prototype.hasOwnProperty.call(data,"inst2")) {
					this.inst2 = Reflect.field(data,"inst2");
				}
				if(Object.prototype.hasOwnProperty.call(data,"inst2name")) {
					this.inst2name = Reflect.field(data,"inst2name");
				}
				if(Object.prototype.hasOwnProperty.call(data,"inst3")) {
					this.inst3 = Reflect.field(data,"inst3");
				}
				if(Object.prototype.hasOwnProperty.call(data,"inst3name")) {
					this.inst3name = Reflect.field(data,"inst3name");
				}
				if(this.menus == null) {
					this.menus = "";
				}
				if(this.interf == null) {
					this.interf = "";
				}
				if(this.inst1 == null) {
					this.inst1 = "";
				}
				if(this.inst1name == null) {
					this.inst1name = "";
				}
				if(this.inst2 == null) {
					this.inst2 = "";
				}
				if(this.inst2name == null) {
					this.inst2name = "";
				}
				if(this.inst3 == null) {
					this.inst3 = "";
				}
				if(this.inst3name == null) {
					this.inst3name = "";
				}
				this.ok = true;
				return true;
			} else {
				return false;
			}
		} else {
			return false;
		}
	}
	,kill: function() {
		this.ok = false;
		this.id = null;
		this.defaultp = null;
		this.menus = null;
		this.interf = null;
		this.inst1 = null;
		this.inst1name = null;
		this.inst2 = null;
		this.inst2name = null;
		this.inst3 = null;
		this.inst3name = null;
	}
	,toObject: function() {
		return { id : this.id, defaultp : this.defaultp, menus : this.menus, interf : this.interf, inst1 : this.inst1, inst1name : this.inst1name, inst2 : this.inst2, inst2name : this.inst2name, inst3 : this.inst3, inst3name : this.inst3name};
	}
	,__class__: com_tilbuci_contraptions_TargetContraption
};
var com_tilbuci_data_BuildInfo = function(showinfo) {
	if(showinfo == null) {
		showinfo = true;
	}
	this._thanks = [];
	this._languages = new haxe_ds_StringMap();
	this._build = "";
	this._version = "";
	if(showinfo) {
		var str = openfl_utils_Assets.getText("buildInfo");
		var file = com_tilbuci_statictools_StringStatic.jsonParse(str);
		if(file != false) {
			this._version = Reflect.field(file,"version");
			this._build = Reflect.field(file,"build");
			var _g = 0;
			var _g1 = Reflect.fields(Reflect.field(file,"languages"));
			while(_g < _g1.length) {
				var n = _g1[_g];
				++_g;
				var v = Reflect.field(Reflect.field(file,"languages"),n);
				this._languages.h[n] = v;
			}
			var _g = 0;
			var _g1 = Reflect.fields(Reflect.field(file,"thanks"));
			while(_g < _g1.length) {
				var n = _g1[_g];
				++_g;
				this._thanks.push(Reflect.field(Reflect.field(file,"thanks"),n));
			}
			haxe_Log.trace("Tilbuci player " + this._version + " build " + this._build + ".",{ fileName : "Source/com/tilbuci/data/BuildInfo.hx", lineNumber : 61, className : "com.tilbuci.data.BuildInfo", methodName : "new"});
		}
	} else {
		this._version = "custom";
		this._build = "custom";
	}
};
$hxClasses["com.tilbuci.data.BuildInfo"] = com_tilbuci_data_BuildInfo;
com_tilbuci_data_BuildInfo.__name__ = "com.tilbuci.data.BuildInfo";
com_tilbuci_data_BuildInfo.prototype = {
	version: null
	,get_version: function() {
		return this._version;
	}
	,_version: null
	,build: null
	,get_build: function() {
		return this._build;
	}
	,_build: null
	,languages: null
	,get_languages: function() {
		return this._languages;
	}
	,_languages: null
	,thanks: null
	,get_thanks: function() {
		return this._thanks;
	}
	,_thanks: null
	,__class__: com_tilbuci_data_BuildInfo
	,__properties__: {get_thanks:"get_thanks",get_languages:"get_languages",get_build:"get_build",get_version:"get_version"}
};
var com_tilbuci_data_CopyData = function() {
	this._has = false;
	this._instances = new haxe_ds_StringMap();
	this._collections = new haxe_ds_StringMap();
};
$hxClasses["com.tilbuci.data.CopyData"] = com_tilbuci_data_CopyData;
com_tilbuci_data_CopyData.__name__ = "com.tilbuci.data.CopyData";
com_tilbuci_data_CopyData.prototype = {
	_collections: null
	,_instances: null
	,_has: null
	,updateDisplay: null
	,hasCopy: function() {
		return this._has;
	}
	,clear: function() {
		var h = this._collections.h;
		var k_h = h;
		var k_keys = Object.keys(h);
		var k_length = k_keys.length;
		var k_current = 0;
		while(k_current < k_length) {
			var k = k_keys[k_current++];
			var _this = this._collections;
			if(Object.prototype.hasOwnProperty.call(_this.h,k)) {
				delete(_this.h[k]);
			}
		}
		var h = this._instances.h;
		var k_h = h;
		var k_keys = Object.keys(h);
		var k_length = k_keys.length;
		var k_current = 0;
		while(k_current < k_length) {
			var k = k_keys[k_current++];
			var _this = this._instances;
			if(Object.prototype.hasOwnProperty.call(_this.h,k)) {
				delete(_this.h[k]);
			}
		}
		this._has = false;
	}
	,addCollection: function(name) {
		if(Object.prototype.hasOwnProperty.call(com_tilbuci_data_GlobalPlayer.movie.collections.h,name)) {
			var v = com_tilbuci_data_GlobalPlayer.movie.collections.h[name];
			this._collections.h[name] = v;
			return true;
		} else {
			return false;
		}
	}
	,addInstance: function(name,data) {
		this._instances.h[name] = data;
		this._has = true;
	}
	,broadcast: function() {
		if(this._has) {
			var col = new haxe_ds_StringMap();
			var h = this._collections.h;
			var k_h = h;
			var k_keys = Object.keys(h);
			var k_length = k_keys.length;
			var k_current = 0;
			while(k_current < k_length) {
				var k = k_keys[k_current++];
				var v = this._collections.h[k].toJson();
				col.h[k] = v;
			}
			var inst = new haxe_ds_StringMap();
			var h = this._instances.h;
			var k_h = h;
			var k_keys = Object.keys(h);
			var k_length = k_keys.length;
			var k_current = 0;
			while(k_current < k_length) {
				var k = k_keys[k_current++];
				var v = this._instances.h[k].toJson();
				inst.h[k] = v;
			}
			var msg = new haxe_ds_StringMap();
			var v = com_tilbuci_data_GlobalPlayer.movie.get_mvId();
			msg.h["movie"] = v;
			var v = com_tilbuci_data_GlobalPlayer.movie.get_scId();
			msg.h["scene"] = v;
			msg.h["collections"] = col;
			msg.h["instances"] = inst;
			window.TBB_sendTabsMessage("copy",com_tilbuci_statictools_StringStatic.jsonStringify(msg));
			this.receiveMessage(com_tilbuci_statictools_StringStatic.jsonStringify(msg));
		}
	}
	,receiveMessage: function(msg) {
		var msg1 = com_tilbuci_statictools_StringStatic.jsonAsMap(msg);
		if(Object.prototype.hasOwnProperty.call(msg1.h,"movie") && Object.prototype.hasOwnProperty.call(msg1.h,"collections") && Object.prototype.hasOwnProperty.call(msg1.h,"instances")) {
			if(msg1.h["movie"] == com_tilbuci_data_GlobalPlayer.movie.get_mvId()) {
				this.clear();
				var _g = 0;
				var _g1 = Reflect.fields(msg1.h["collections"]);
				while(_g < _g1.length) {
					var k = _g1[_g];
					++_g;
					var col = new com_tilbuci_def_CollectionData(k,null,false);
					if(col.fromJson(Reflect.field(msg1.h["collections"],k))) {
						this._collections.h[k] = col;
					}
				}
				var _g = 0;
				var _g1 = Reflect.fields(msg1.h["instances"]);
				while(_g < _g1.length) {
					var k = _g1[_g];
					++_g;
					var inst = new com_tilbuci_def_InstanceData(com_tilbuci_statictools_StringStatic.jsonParse(Reflect.field(msg1.h["instances"],k)));
					if(inst.ok && Object.prototype.hasOwnProperty.call(this._collections.h,inst.collection)) {
						this._instances.h[k] = inst;
						this._has = true;
					}
				}
				if(this.updateDisplay != null) {
					this.updateDisplay();
				}
			}
		}
	}
	,pasteInstances: function() {
		if(this._has) {
			var h = this._collections.h;
			var k_h = h;
			var k_keys = Object.keys(h);
			var k_length = k_keys.length;
			var k_current = 0;
			while(k_current < k_length) {
				var k = k_keys[k_current++];
				var v = this._collections.h[k];
				com_tilbuci_data_GlobalPlayer.movie.collections.h[k] = v;
			}
			var h = this._instances.h;
			var k_h = h;
			var k_keys = Object.keys(h);
			var k_length = k_keys.length;
			var k_current = 0;
			while(k_current < k_length) {
				var k = k_keys[k_current++];
				var this1 = com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[com_tilbuci_data_GlobalPlayer.area.get_currentKf()];
				var v = this._instances.h[k];
				this1.h[k] = v;
			}
			com_tilbuci_data_GlobalPlayer.area.updateOrder();
			com_tilbuci_data_GlobalPlayer.area.loadKeyframe(com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[com_tilbuci_data_GlobalPlayer.area.get_currentKf()],com_tilbuci_data_GlobalPlayer.area.get_currentKf());
		}
	}
	,__class__: com_tilbuci_data_CopyData
};
var com_tilbuci_data_DataLoader = function(single,url,method,params,mode,ac,pr,key,secret,end,extra,timeout) {
	if(timeout == null) {
		timeout = 0;
	}
	if(mode == null) {
		mode = 0;
	}
	if(method == null) {
		method = "POST";
	}
	if(single == null) {
		single = false;
	}
	this.extra = null;
	this.map = null;
	this.json = null;
	this.rawtext = null;
	this.binary = null;
	this.url = "";
	this._mode = 0;
	openfl_events_EventDispatcher.call(this);
	this._loader = new openfl_net_URLLoader();
	this._loader.addEventListener("complete",$bind(this,this.onLoaderComplete));
	this._loader.addEventListener("ioError",$bind(this,this.onLoaderIOError));
	this._loader.addEventListener("securityError",$bind(this,this.onLoaderSecurityError));
	this._loader.addEventListener("progress",$bind(this,this.onLoaderProgress));
	this._single = single;
	if(url != null) {
		this.load(url,method,params,mode,ac,pr,key,secret,end,extra,timeout);
	}
};
$hxClasses["com.tilbuci.data.DataLoader"] = com_tilbuci_data_DataLoader;
com_tilbuci_data_DataLoader.__name__ = "com.tilbuci.data.DataLoader";
com_tilbuci_data_DataLoader.__super__ = openfl_events_EventDispatcher;
com_tilbuci_data_DataLoader.prototype = $extend(openfl_events_EventDispatcher.prototype,{
	_loader: null
	,_ac: null
	,_end: null
	,_pr: null
	,_single: null
	,_mode: null
	,url: null
	,binary: null
	,rawtext: null
	,json: null
	,map: null
	,extra: null
	,setAction: function(ac) {
		this._ac = ac;
	}
	,load: function(url,method,params,mode,ac,pr,key,secret,end,extra,timeout) {
		if(timeout == null) {
			timeout = 0;
		}
		if(mode == null) {
			mode = 0;
		}
		if(method == null) {
			method = "POST";
		}
		switch(mode) {
		case 1:
			this._mode = 1;
			this._loader.dataFormat = 1;
			break;
		case 3:
			this._mode = 3;
			this._loader.dataFormat = 1;
			break;
		case 4:
			this._mode = 4;
			this._loader.dataFormat = 1;
			break;
		case 5:
			this._mode = 5;
			this._loader.dataFormat = 0;
			break;
		case 6:
			this._mode = 6;
			this._loader.dataFormat = 0;
			break;
		default:
			this._mode = 0;
			this._loader.dataFormat = 0;
		}
		this._end = end;
		this._ac = ac;
		this._pr = pr;
		this.extra = extra;
		var variables = openfl_net_URLVariables._new();
		if(params != null) {
			var h = params.h;
			var name_h = h;
			var name_keys = Object.keys(h);
			var name_length = name_keys.length;
			var name_current = 0;
			while(name_current < name_length) {
				var name = name_keys[name_current++];
				variables[name] = params.h[name];
			}
		}
		var req = new openfl_net_URLRequest(url);
		req.data = variables;
		req.method = method;
		if(timeout > 0) {
			req.idleTimeout = timeout;
		}
		this.url = url;
		this._loader.load(req);
	}
	,cancel: function() {
		if(this._loader != null) {
			try {
				this._loader.close();
			} catch( _g ) {
			}
			if(this._end != null) {
				this._end();
			}
			if(this._single) {
				this.kill();
			}
		}
	}
	,kill: function() {
		this._loader.removeEventListener("complete",$bind(this,this.onLoaderComplete));
		this._loader.removeEventListener("ioError",$bind(this,this.onLoaderIOError));
		this._loader.removeEventListener("securityError",$bind(this,this.onLoaderSecurityError));
		this._loader.removeEventListener("progress",$bind(this,this.onLoaderProgress));
		try {
			this._loader.close();
		} catch( _g ) {
		}
		this._loader = null;
		this._ac = null;
		this._pr = null;
		this.binary = null;
		this.rawtext = null;
		this.json = null;
		this.map = null;
		this.url = null;
		this._end = null;
		this.extra = null;
	}
	,finalText: function(loaded) {
		if(com_tilbuci_data_DataLoader.customDecrypt != null) {
			return com_tilbuci_data_DataLoader.customDecrypt(loaded);
		} else if(HxOverrides.substr(loaded,0,2) == "TB" && HxOverrides.substr(loaded,-10,1) == "b") {
			return com_tilbuci_statictools_StringStatic.decrypt(loaded,com_tilbuci_statictools_StringStatic.md5(com_tilbuci_data_GlobalPlayer.loadingMovie + HxOverrides.substr(com_tilbuci_data_GlobalPlayer.loadingMovie,2,null)).toLowerCase());
		} else {
			return loaded;
		}
	}
	,onLoaderComplete: function(evt) {
		this.binary = null;
		this.rawtext = null;
		this.json = null;
		this.map = null;
		var ok = false;
		switch(this._mode) {
		case 1:
			this.rawtext = this.finalText(this._loader.data);
			ok = true;
			break;
		case 3:
			this.rawtext = this.finalText(this._loader.data);
			var js = com_tilbuci_statictools_StringStatic.jsonParse(this.rawtext);
			if(js == false) {
				ok = false;
				this.rawtext = null;
			} else {
				this.json = js;
				ok = true;
			}
			break;
		case 4:
			this.rawtext = this.finalText(this._loader.data);
			var js = com_tilbuci_statictools_StringStatic.jsonParse(this.rawtext);
			if(js == false) {
				ok = false;
				this.rawtext = null;
			} else {
				this.json = js;
				this.map = new haxe_ds_StringMap();
				var _g = 0;
				var _g1 = Reflect.fields(js);
				while(_g < _g1.length) {
					var k = _g1[_g];
					++_g;
					var v = Reflect.field(js,k);
					this.map.h[k] = v;
				}
				ok = true;
			}
			break;
		case 5:
			this.binary = this._loader.data;
			this.rawtext = this.finalText(haxe_crypto_Base64.encode(openfl_utils_ByteArray.toBytes(this.binary)));
			break;
		case 6:
			this.binary = this._loader.data;
			this.rawtext = this.finalText(haxe_crypto_Base64.encode(openfl_utils_ByteArray.toBytes(this.binary)));
			var js = com_tilbuci_statictools_StringStatic.jsonParse(this.rawtext);
			if(js == false) {
				ok = false;
				this.rawtext = null;
				this.binary = null;
			} else {
				this.json = js;
				this.map = new haxe_ds_StringMap();
				var _g = 0;
				var _g1 = Reflect.fields(js);
				while(_g < _g1.length) {
					var k = _g1[_g];
					++_g;
					var v = Reflect.field(js,k);
					this.map.h[k] = v;
				}
				ok = true;
			}
			break;
		default:
			this.binary = this._loader.data;
			ok = true;
		}
		if(this._end != null) {
			this._end();
		}
		if(this._ac != null) {
			if(ok) {
				this._ac(true,this);
			} else {
				haxe_Log.trace("erro ws",{ fileName : "Source/com/tilbuci/data/DataLoader.hx", lineNumber : 339, className : "com.tilbuci.data.DataLoader", methodName : "onLoaderComplete", customParams : [this._loader.data]});
				this._ac(false,null);
			}
		}
		this.dispatchEvent(evt);
		if(this._single) {
			this.kill();
		}
	}
	,onLoaderIOError: function(evt) {
		if(this._end != null) {
			this._end();
		}
		if(this._ac != null) {
			this._ac(false,null);
		}
		this.dispatchEvent(evt);
		if(this._single) {
			this.kill();
		}
	}
	,onLoaderSecurityError: function(evt) {
		if(this._end != null) {
			this._end();
		}
		if(this._ac != null) {
			this._ac(false,null);
		}
		this.dispatchEvent(evt);
		if(this._single) {
			this.kill();
		}
	}
	,onLoaderProgress: function(evt) {
		if(this._pr != null) {
			this._pr(evt.bytesLoaded,evt.bytesTotal);
		}
		this.dispatchEvent(evt);
	}
	,__class__: com_tilbuci_data_DataLoader
});
var com_tilbuci_data_EditorConfig = function(path,ac,nocache) {
	this._dateFile = true;
	this._language = [];
	this._font = "";
	this._ws = "";
	this._player = "";
	this._base = "";
	this._loaded = false;
	openfl_events_EventDispatcher.call(this);
	var cache = null;
	this._callback = ac;
	if(nocache) {
		var _g = new haxe_ds_StringMap();
		var value = Math.ceil(Math.random() * 10000);
		_g.h["rand"] = value;
		cache = _g;
	}
	new com_tilbuci_data_DataLoader(true,path,"GET",cache,3,$bind(this,this.dataLoaded));
};
$hxClasses["com.tilbuci.data.EditorConfig"] = com_tilbuci_data_EditorConfig;
com_tilbuci_data_EditorConfig.__name__ = "com.tilbuci.data.EditorConfig";
com_tilbuci_data_EditorConfig.__super__ = openfl_events_EventDispatcher;
com_tilbuci_data_EditorConfig.prototype = $extend(openfl_events_EventDispatcher.prototype,{
	loaded: null
	,_loaded: null
	,get_loaded: function() {
		return this._loaded;
	}
	,base: null
	,_base: null
	,get_base: function() {
		return this._base;
	}
	,player: null
	,_player: null
	,get_player: function() {
		return this._player;
	}
	,ws: null
	,_ws: null
	,get_ws: function() {
		return this._ws;
	}
	,font: null
	,_font: null
	,get_font: function() {
		return this._font;
	}
	,language: null
	,_language: null
	,get_language: function() {
		return this._language;
	}
	,dateFile: null
	,_dateFile: null
	,get_dateFile: function() {
		return this._dateFile;
	}
	,_callback: null
	,kill: function() {
		this._ws = null;
		this._base = null;
		this._font = null;
		if(this._language != null) {
			while(this._language.length > 0) this._language.pop();
		}
		this._language = null;
		this._callback = null;
	}
	,dataLoaded: function(ok,ld) {
		this._loaded = ok;
		if(!ok) {
			this._callback(false);
		} else {
			if(!Object.prototype.hasOwnProperty.call(ld.json,"base")) {
				this._loaded = false;
			}
			if(this._loaded && !Object.prototype.hasOwnProperty.call(ld.json,"player")) {
				this._loaded = false;
			}
			if(this._loaded && !Object.prototype.hasOwnProperty.call(ld.json,"ws")) {
				this._loaded = false;
			}
			if(this._loaded && !Object.prototype.hasOwnProperty.call(ld.json,"font")) {
				this._loaded = false;
			}
			if(this._loaded && !Object.prototype.hasOwnProperty.call(ld.json,"language")) {
				this._language = [new com_tilbuci_def_InterfaceLang("English","default")];
			} else {
				this._language = ld.json.language;
			}
			if(this._loaded) {
				this._base = com_tilbuci_statictools_StringStatic.slashURL(ld.json.base);
				this._player = com_tilbuci_statictools_StringStatic.slashURL(ld.json.player);
				this._ws = com_tilbuci_statictools_StringStatic.slashURL(ld.json.ws);
				this._font = com_tilbuci_statictools_StringStatic.slashURL(ld.json.font);
			}
			this._callback(this._loaded);
		}
		this._callback = null;
	}
	,__class__: com_tilbuci_data_EditorConfig
	,__properties__: {get_dateFile:"get_dateFile",get_language:"get_language",get_font:"get_font",get_ws:"get_ws",get_player:"get_player",get_base:"get_base",get_loaded:"get_loaded"}
});
var com_tilbuci_data_FileUpload = function(st) {
	this._externName = "";
	this._uploadType = "";
	this._extra = new haxe_ds_StringMap();
	openfl_events_EventDispatcher.call(this);
	this._ref = new openfl_net_FileReference();
	this._ref.addEventListener("select",$bind(this,this.onFileSelect));
	this._ref.addEventListener("cancel",$bind(this,this.onFileCancel));
	this._ref.addEventListener("complete",$bind(this,this.onLoadComplete));
	this._ref.addEventListener("ioError",$bind(this,this.onLoadIOError));
	this._stage = st;
	this._interface = new feathers_controls_Panel();
	var lay = new feathers_layout_VerticalLayout();
	lay.setPadding(10);
	lay.set_gap(20);
	lay.set_verticalAlign(feathers_layout_VerticalAlign.TOP);
	lay.set_horizontalAlign(feathers_layout_HorizontalAlign.LEFT);
	this._interface.set_backgroundSkin(new com_tilbuci_ui_base_BackgroundSkin(3684408));
	this._interface.set_layout(lay);
	this._interface.set_width(500);
	this._interface.set_height(180);
	var hd = new feathers_controls_Header();
	hd.set_text(com_tilbuci_data_Global.ln.get("uploader-title"));
	this._interface.set_header(hd);
	this._fname = new feathers_controls_Label();
	this._fname.set_text("");
	this._fname.set_wordWrap(false);
	this._fname.set_width(this._interface.get_width() - 30);
	this._interface.addChild(this._fname);
	this._bar = new feathers_controls_HProgressBar(0,0,1);
	this._bar.set_width(this._interface.get_width() - 30);
	this._interface.addChild(this._bar);
	this._bt = new feathers_controls_Button();
	this._bt.set_text(com_tilbuci_data_Global.ln.get("default-cancel"));
	this._bt.addEventListener("trigger",$bind(this,this.onCancel));
	this._bt.set_width(this._interface.get_width() - 30);
	this._interface.addChild(this._bt);
	this._localLoad = new openfl_net_FileReference();
	this._localLoad.addEventListener("select",$bind(this,this.onLocalLoaded));
	this._localLoad.addEventListener("complete",$bind(this,this.onLocalComplete));
	this._localLoad.addEventListener("ioError",$bind(this,this.onLocalError));
	this._localLoad.addEventListener("securityError",$bind(this,this.onLocalError));
};
$hxClasses["com.tilbuci.data.FileUpload"] = com_tilbuci_data_FileUpload;
com_tilbuci_data_FileUpload.__name__ = "com.tilbuci.data.FileUpload";
com_tilbuci_data_FileUpload.TBU_setFile = $hx_exports["TBU_setFile"] = function(name,size,type,pieces) {
	com_tilbuci_data_Global.up.onFileSelectExtern(name);
};
com_tilbuci_data_FileUpload.TBU_setProgress = $hx_exports["TBU_setProgress"] = function(part,total,complete,data) {
	if(data == null) {
		data = "";
	}
	com_tilbuci_data_Global.up.onProgressExtern(part,total);
	if(complete) {
		com_tilbuci_data_Global.up.onUploadExtern(true,data);
	}
};
com_tilbuci_data_FileUpload.TBU_setFailed = $hx_exports["TBU_setFailed"] = function() {
	com_tilbuci_data_Global.up.onCancelExtern();
};
com_tilbuci_data_FileUpload.TBU_setAborted = $hx_exports["TBU_setAborted"] = function() {
	com_tilbuci_data_Global.up.onCancelExtern();
};
com_tilbuci_data_FileUpload.__super__ = openfl_events_EventDispatcher;
com_tilbuci_data_FileUpload.prototype = $extend(openfl_events_EventDispatcher.prototype,{
	_ref: null
	,_ac: null
	,_extra: null
	,_uploadType: null
	,_stage: null
	,_interface: null
	,_fname: null
	,_bar: null
	,_bt: null
	,_loader: null
	,_localLoad: null
	,_llComplete: null
	,_externName: null
	,selectedName: null
	,get_selectedName: function() {
		var nm = "";
		nm = this._externName;
		return nm;
	}
	,browseForFont: function(ac) {
		this._ac = ac;
		window.TBU_browse(".woff2,.woff");
		return true;
	}
	,uploadFont: function(ac,extra) {
		if(com_tilbuci_statictools_StringStatic.stringContains(this.get_selectedName(),[".woff"])) {
			this._uploadType = "Font";
			this._ac = ac;
			this._extra = extra;
			if(Object.prototype.hasOwnProperty.call(this._extra.h,"movie")) {
				var v = "../movie/" + Std.string(this._extra.h["movie"]) + ".movie/media/font/";
				this._extra.h["path"] = v;
			} else {
				this._extra.h["path"] = "../font/";
			}
			this._fname.set_text(this.get_selectedName());
			this._bar.set_minimum(this._bar.set_value(0));
			this._bar.set_maximum(100);
			feathers_core_PopUpManager.addPopUp(this._interface,this._stage);
			this.sendExtern("File/ExtFont");
			return true;
		} else {
			return false;
		}
	}
	,browseForMedia: function(ac,type) {
		var ext = "";
		var title = "";
		switch(type) {
		case "audio":
			ext = ".mp3,.m4a";
			title = com_tilbuci_data_Global.ln.get("uploader-audioname");
			break;
		case "embed":
			ext = ".zip";
			title = com_tilbuci_data_Global.ln.get("uploader-embedname");
			break;
		case "html":
			ext = ".html,.htm";
			title = com_tilbuci_data_Global.ln.get("uploader-htmlname");
			break;
		case "movie":
			ext = ".zip";
			title = com_tilbuci_data_Global.ln.get("uploader-moviename");
			break;
		case "picture":
			ext = ".jpg,.png,.jpeg";
			title = com_tilbuci_data_Global.ln.get("uploader-picturename");
			break;
		case "snippets":
			ext = ".json";
			title = com_tilbuci_data_Global.ln.get("uploader-stringsname");
			break;
		case "spritemap":
			ext = ".png";
			title = com_tilbuci_data_Global.ln.get("uploader-spritemapname");
			break;
		case "strings":
			break;
		case "update":
			ext = ".zip";
			title = com_tilbuci_data_Global.ln.get("uploader-updatename");
			break;
		case "video":
			ext = ".mp4,.webm";
			title = com_tilbuci_data_Global.ln.get("uploader-videoname");
			break;
		case "zip":
			ext = ".zip";
			title = com_tilbuci_data_Global.ln.get("uploader-mediazip");
			break;
		}
		if(ext != "") {
			this._ac = ac;
			window.TBU_browse(ext);
			return true;
		} else {
			return false;
		}
	}
	,uploadMedia: function(ac,extra) {
		this._uploadType = extra.h["type"];
		this._ac = ac;
		this._extra = extra;
		this._fname.set_text(this.get_selectedName());
		this._bar.set_minimum(this._bar.set_value(0));
		this._bar.set_maximum(100);
		feathers_core_PopUpManager.addPopUp(this._interface,this._stage);
		this.sendExtern("Media/ExtUpload");
	}
	,kill: function() {
		this._ref.removeEventListener("select",$bind(this,this.onFileSelect));
		this._ref.removeEventListener("cancel",$bind(this,this.onFileCancel));
		this._ref.removeEventListener("complete",$bind(this,this.onLoadComplete));
		this._ref.removeEventListener("ioError",$bind(this,this.onLoadIOError));
		this._ref = null;
		this._ac = null;
		this._extra = null;
		this._loader = null;
		this._stage = null;
		this._interface.removeChildren();
		this._interface = null;
		this._fname = null;
		this._bar = null;
		this._bt.removeEventListener("trigger",$bind(this,this.onCancel));
		this._bt = null;
	}
	,send: function(to,content) {
		var _g = new haxe_ds_StringMap();
		var value = this.get_selectedName();
		_g.h["fname"] = value;
		_g.h["fcontent"] = content;
		var req = _g;
		if(this._extra != null) {
			var h = this._extra.h;
			var name_h = h;
			var name_keys = Object.keys(h);
			var name_length = name_keys.length;
			var name_current = 0;
			while(name_current < name_length) {
				var name = name_keys[name_current++];
				var v = this._extra.h[name];
				req.h[name] = v;
			}
		}
		var txt = com_tilbuci_statictools_StringStatic.jsonStringify(req);
		var tmp = com_tilbuci_data_Global.ws.get_url();
		var _g = new haxe_ds_StringMap();
		_g.h["r"] = txt;
		var value = com_tilbuci_statictools_StringStatic.md5(com_tilbuci_data_Global.ws.get_key() + txt);
		_g.h["s"] = value;
		var value = com_tilbuci_data_Global.ws.get_user();
		_g.h["u"] = value;
		_g.h["a"] = to;
		this._loader = new com_tilbuci_data_DataLoader(true,tmp,"POST",_g,4,$bind(this,this.onUpload),$bind(this,this.onProgress));
	}
	,sendExtern: function(to) {
		var _g = new haxe_ds_StringMap();
		var value = this.get_selectedName();
		_g.h["fname"] = value;
		var req = _g;
		if(this._extra != null) {
			var h = this._extra.h;
			var name_h = h;
			var name_keys = Object.keys(h);
			var name_length = name_keys.length;
			var name_current = 0;
			while(name_current < name_length) {
				var name = name_keys[name_current++];
				var v = this._extra.h[name];
				req.h[name] = v;
			}
		}
		var txt = com_tilbuci_statictools_StringStatic.jsonStringify(req);
		window.TBU_upload(to,txt,com_tilbuci_data_Global.ws.get_user(),com_tilbuci_statictools_StringStatic.md5(com_tilbuci_data_Global.ws.get_key() + txt),com_tilbuci_data_Global.ws.get_url());
	}
	,onUpload: function(ok,ld) {
		feathers_core_PopUpManager.removePopUp(this._interface);
		this._loader = null;
		if(ok) {
			this._ac(true,ld.map);
		} else {
			this._ac(false,null);
		}
		this._ac = null;
	}
	,onUploadExtern: function(ok,data) {
		feathers_core_PopUpManager.removePopUp(this._interface);
		if(ok) {
			this._ac(true,com_tilbuci_statictools_StringStatic.jsonAsMap(data));
		} else {
			this._ac(false,null);
		}
		this._ac = null;
	}
	,onProgress: function(loaded,total) {
		if(total > 0) {
			this._bar.set_minimum(0);
			this._bar.set_value(loaded);
			this._bar.set_maximum(total);
		}
	}
	,onProgressExtern: function(current,total) {
		if(total > 0) {
			this._bar.set_minimum(0);
			this._bar.set_value(current);
			this._bar.set_maximum(total);
		}
	}
	,onCancel: function(evt) {
		window.TBU_cancelUpload();
	}
	,onCancelExtern: function() {
		this._extra = null;
		feathers_core_PopUpManager.removePopUp(this._interface);
		this._ac(false);
		this._ac = null;
	}
	,onFileCancel: function(evt) {
		this._ac(false);
	}
	,onFileSelect: function(evt) {
		this._ac(true);
	}
	,onFileSelectExtern: function(name) {
		this._externName = name;
		this._ac(true);
	}
	,onLoadComplete: function(evt) {
		this.send("File/" + this._uploadType,haxe_crypto_Base64.encode(openfl_utils_ByteArray.toBytes(this._ref.data)));
	}
	,onLoadIOError: function(evt) {
		this._uploadType = "";
		this._ac(false);
		this._ac = null;
	}
	,selectFile: function(ac,name,ext) {
		this._llComplete = ac;
		var filter = new openfl_net_FileFilter(name,ext);
		this._localLoad.browse([filter]);
	}
	,onLocalLoaded: function(evt) {
		this._localLoad.load();
	}
	,onLocalComplete: function(evt) {
		this._llComplete(true,this._localLoad.data);
	}
	,onLocalError: function(evt) {
		this._llComplete(false);
	}
	,__class__: com_tilbuci_data_FileUpload
	,__properties__: {get_selectedName:"get_selectedName"}
});
var com_tilbuci_data_Global = function() { };
$hxClasses["com.tilbuci.data.Global"] = com_tilbuci_data_Global;
com_tilbuci_data_Global.__name__ = "com.tilbuci.data.Global";
com_tilbuci_data_Global.showActionWindow = function(current,onOk,onCancel) {
	if(com_tilbuci_data_Global.acwindow == null) {
		com_tilbuci_data_Global.acwindow = new com_tilbuci_ui_component_WindowAction();
		com_tilbuci_data_Global.acwindow.startInterface();
	}
	com_tilbuci_data_Global.acwindow.setContent(current,onOk,onCancel);
	feathers_core_PopUpManager.addPopUp(com_tilbuci_data_Global.acwindow,com_tilbuci_data_Global.stage);
};
com_tilbuci_data_Global.showNewBlockWindow = function(onOk) {
	if(com_tilbuci_data_Global.acblock == null) {
		com_tilbuci_data_Global.acblock = new com_tilbuci_ui_component_WindowActionBlock();
		com_tilbuci_data_Global.acblock.startInterface();
	}
	com_tilbuci_data_Global.acInfo.loadInfo();
	com_tilbuci_data_Global.acblock.setContent(onOk);
	feathers_core_PopUpManager.addPopUp(com_tilbuci_data_Global.acblock,com_tilbuci_data_Global.stage);
};
com_tilbuci_data_Global.showEditBlockWindow = function(ac,onOk,index,current) {
	if(index == null) {
		index = -1;
	}
	if(com_tilbuci_data_Global.edblock == null) {
		com_tilbuci_data_Global.edblock = new com_tilbuci_ui_component_WindowBlockEdit();
		com_tilbuci_data_Global.edblock.startInterface();
	}
	com_tilbuci_data_Global.edblock.setContent(ac,onOk,index,current);
	feathers_core_PopUpManager.addPopUp(com_tilbuci_data_Global.edblock,com_tilbuci_data_Global.stage);
};
com_tilbuci_data_Global.showPopup = function(tit,txt,wd,ht,oktxt,ac,mode,canceltxt) {
	if(canceltxt == null) {
		canceltxt = "";
	}
	if(mode == null) {
		mode = "warn";
	}
	var cf = new com_tilbuci_ui_base_ConfirmWindow(tit,txt,wd,ht,oktxt,ac,mode,canceltxt);
	feathers_core_PopUpManager.addPopUp(cf,com_tilbuci_data_Global.stage);
};
com_tilbuci_data_Global.evaluate = function(expr) {
	if(com_tilbuci_data_Global.parser == null) {
		com_tilbuci_data_Global.parser = new hscript_Parser();
	}
	if(com_tilbuci_data_Global.interp == null) {
		com_tilbuci_data_Global.interp = new hscript_Interp();
	}
	var ret;
	try {
		ret = com_tilbuci_data_Global.interp.execute(com_tilbuci_data_Global.parser.parseString(expr));
	} catch( _g ) {
		ret = null;
	}
	return ret;
};
com_tilbuci_data_Global.setBrowserAddress = function(url,title) {
	window.TBB_setAddress(url,title);
	return true;
};
com_tilbuci_data_Global.copyText = function(text) {
	var ok = false;
	try {
		window.TBB_copyText(text);
		ok = true;
	} catch( _g ) {
		haxe_Log.trace(text,{ fileName : "Source/com/tilbuci/data/Global.hx", lineNumber : 325, className : "com.tilbuci.data.Global", methodName : "copyText"});
		ok = false;
	}
	return ok;
};
var openfl_geom_Point = function(x,y) {
	if(y == null) {
		y = 0;
	}
	if(x == null) {
		x = 0;
	}
	this.x = x;
	this.y = y;
};
$hxClasses["openfl.geom.Point"] = openfl_geom_Point;
openfl_geom_Point.__name__ = "openfl.geom.Point";
openfl_geom_Point.distance = function(pt1,pt2) {
	var dx = pt1.x - pt2.x;
	var dy = pt1.y - pt2.y;
	return Math.sqrt(dx * dx + dy * dy);
};
openfl_geom_Point.interpolate = function(pt1,pt2,f) {
	return new openfl_geom_Point(pt2.x + f * (pt1.x - pt2.x),pt2.y + f * (pt1.y - pt2.y));
};
openfl_geom_Point.interpolateToOutput = function(pt1,pt2,f,output) {
	if(output != null) {
		output.setTo(pt2.x + f * (pt1.x - pt2.x),pt2.y + f * (pt1.y - pt2.y));
		return output;
	}
	return new openfl_geom_Point(pt2.x + f * (pt1.x - pt2.x),pt2.y + f * (pt1.y - pt2.y));
};
openfl_geom_Point.polar = function(len,angle) {
	return new openfl_geom_Point(len * Math.cos(angle),len * Math.sin(angle));
};
openfl_geom_Point.polarToOutput = function(len,angle,output) {
	if(output != null) {
		output.setTo(len * Math.cos(angle),len * Math.sin(angle));
		return output;
	}
	return new openfl_geom_Point(len * Math.cos(angle),len * Math.sin(angle));
};
openfl_geom_Point.prototype = {
	x: null
	,y: null
	,add: function(v) {
		return new openfl_geom_Point(v.x + this.x,v.y + this.y);
	}
	,addToOutput: function(v,output) {
		if(output != null) {
			output.setTo(v.x + this.x,v.y + this.y);
			return output;
		}
		return new openfl_geom_Point(v.x + this.x,v.y + this.y);
	}
	,clone: function() {
		return new openfl_geom_Point(this.x,this.y);
	}
	,copyFrom: function(sourcePoint) {
		this.x = sourcePoint.x;
		this.y = sourcePoint.y;
	}
	,equals: function(toCompare) {
		if(toCompare != null && toCompare.x == this.x) {
			return toCompare.y == this.y;
		} else {
			return false;
		}
	}
	,normalize: function(thickness) {
		if(this.x == 0 && this.y == 0) {
			return;
		} else {
			var norm = thickness / Math.sqrt(this.x * this.x + this.y * this.y);
			this.x *= norm;
			this.y *= norm;
		}
	}
	,offset: function(dx,dy) {
		this.x += dx;
		this.y += dy;
	}
	,setTo: function(xa,ya) {
		this.x = xa;
		this.y = ya;
	}
	,subtract: function(v) {
		return new openfl_geom_Point(this.x - v.x,this.y - v.y);
	}
	,subtractToOutput: function(v,output) {
		if(output != null) {
			output.setTo(this.x - v.x,this.y - v.y);
			return output;
		}
		return new openfl_geom_Point(this.x - v.x,this.y - v.y);
	}
	,toString: function() {
		return "(x=" + this.x + ", y=" + this.y + ")";
	}
	,__toLimeVector2: function() {
		if(openfl_geom_Point.__limeVector2 == null) {
			openfl_geom_Point.__limeVector2 = new lime_math_Vector2();
		}
		var _this = openfl_geom_Point.__limeVector2;
		_this.x = this.x;
		_this.y = this.y;
		return openfl_geom_Point.__limeVector2;
	}
	,get_length: function() {
		return Math.sqrt(this.x * this.x + this.y * this.y);
	}
	,__class__: openfl_geom_Point
	,__properties__: {get_length:"get_length"}
};
var com_tilbuci_narrative_Narrative = function() {
	this.cards = new haxe_ds_StringMap();
	this.consItAmounts = [];
	this.consItNames = [];
	this.keyItems = [];
	this.items = new haxe_ds_StringMap();
	this.dialogues = new haxe_ds_StringMap();
	this.chars = new haxe_ds_StringMap();
	this.diagSpeech = new com_tilbuci_display_AudioImage($bind(this,this.onSpeechLoad),$bind(this,this.onSpeechEnd));
};
$hxClasses["com.tilbuci.narrative.Narrative"] = com_tilbuci_narrative_Narrative;
com_tilbuci_narrative_Narrative.__name__ = "com.tilbuci.narrative.Narrative";
com_tilbuci_narrative_Narrative.prototype = {
	chars: null
	,dialogues: null
	,diagSpeech: null
	,items: null
	,keyItems: null
	,consItNames: null
	,consItAmounts: null
	,cards: null
	,clear: function() {
		var h = this.chars.h;
		var k_h = h;
		var k_keys = Object.keys(h);
		var k_length = k_keys.length;
		var k_current = 0;
		while(k_current < k_length) {
			var k = k_keys[k_current++];
			this.chars.h[k].kill();
			var _this = this.chars;
			if(Object.prototype.hasOwnProperty.call(_this.h,k)) {
				delete(_this.h[k]);
			}
		}
		var h = this.dialogues.h;
		var k_h = h;
		var k_keys = Object.keys(h);
		var k_length = k_keys.length;
		var k_current = 0;
		while(k_current < k_length) {
			var k = k_keys[k_current++];
			this.dialogues.h[k].kill();
			var _this = this.dialogues;
			if(Object.prototype.hasOwnProperty.call(_this.h,k)) {
				delete(_this.h[k]);
			}
		}
		var h = this.items.h;
		var k_h = h;
		var k_keys = Object.keys(h);
		var k_length = k_keys.length;
		var k_current = 0;
		while(k_current < k_length) {
			var k = k_keys[k_current++];
			this.items.h[k].kill();
			var _this = this.items;
			if(Object.prototype.hasOwnProperty.call(_this.h,k)) {
				delete(_this.h[k]);
			}
		}
		var h = this.cards.h;
		var k_h = h;
		var k_keys = Object.keys(h);
		var k_length = k_keys.length;
		var k_current = 0;
		while(k_current < k_length) {
			var k = k_keys[k_current++];
			this.cards.h[k].kill();
			var _this = this.cards;
			if(Object.prototype.hasOwnProperty.call(_this.h,k)) {
				delete(_this.h[k]);
			}
		}
		while(this.keyItems.length > 0) this.keyItems.shift();
		while(this.consItNames.length > 0) this.consItNames.shift();
		while(this.consItAmounts.length > 0) this.consItAmounts.shift();
	}
	,clearDialogues: function() {
		if(com_tilbuci_data_GlobalPlayer.mode == "player") {
			var h = this.dialogues.h;
			var diag_h = h;
			var diag_keys = Object.keys(h);
			var diag_length = diag_keys.length;
			var diag_current = 0;
			while(diag_current < diag_length) {
				var diag = diag_h[diag_keys[diag_current++]];
				diag.clear();
			}
		}
	}
	,addKeyItem: function(id) {
		if(this.keyItems.length < 4) {
			if(Object.prototype.hasOwnProperty.call(this.items.h,id)) {
				if(this.keyItems.indexOf(id) == -1) {
					this.keyItems.push(id);
				}
			}
		}
	}
	,removeKeyItem: function(id) {
		if(Object.prototype.hasOwnProperty.call(this.items.h,id)) {
			var indx = this.keyItems.indexOf(id);
			if(indx > -1) {
				this.keyItems.splice(indx,1);
			}
		}
	}
	,clearKeyItems: function() {
		while(this.keyItems.length > 0) this.keyItems.shift();
	}
	,hasKeyItem: function(id) {
		if(Object.prototype.hasOwnProperty.call(this.items.h,id)) {
			return this.keyItems.indexOf(id) != -1;
		} else {
			return false;
		}
	}
	,addConsumableItem: function(name,amount) {
		if(this.consItNames.indexOf(name) != -1) {
			var pos = this.consItNames.indexOf(name);
			this.consItAmounts[pos] += amount;
		} else if(this.consItNames.length < 8) {
			this.consItNames.push(name);
			this.consItAmounts.push(amount);
		}
	}
	,removeConsumableItem: function(name) {
		if(this.consItNames.indexOf(name) != -1) {
			var pos = this.consItNames.indexOf(name);
			this.consItNames.splice(pos,1);
			this.consItAmounts.splice(pos,1);
		}
	}
	,consumeItem: function(name) {
		if(this.consItNames.indexOf(name) != -1) {
			var pos = this.consItNames.indexOf(name);
			this.consItAmounts[pos] -= 1;
			if(this.consItAmounts[pos] <= 0) {
				this.consItNames.splice(pos,1);
				this.consItAmounts.splice(pos,1);
			}
		}
	}
	,clearConsumableItems: function() {
		while(this.consItNames.length > 0) this.consItNames.shift();
		while(this.consItAmounts.length > 0) this.consItAmounts.shift();
	}
	,consumableAmount: function(name) {
		if(this.consItNames.indexOf(name) != -1) {
			var pos = this.consItNames.indexOf(name);
			return this.consItAmounts[pos];
		} else {
			return 0;
		}
	}
	,currentItems: function() {
		return com_tilbuci_statictools_StringStatic.jsonStringify({ k : this.keyItems, c : this.consItNames, a : this.consItAmounts});
	}
	,loadItems: function(str) {
		var json = com_tilbuci_statictools_StringStatic.jsonParse(str);
		if(json == false) {
			return false;
		} else if(Object.prototype.hasOwnProperty.call(json,"k") && Object.prototype.hasOwnProperty.call(json,"c") && Object.prototype.hasOwnProperty.call(json,"a")) {
			var kAr = Reflect.field(json,"k");
			var cAr = Reflect.field(json,"c");
			var aAr = Reflect.field(json,"a");
			if(kAr != null && cAr != null && aAr != null) {
				this.keyItems = kAr;
				this.consItNames = cAr;
				this.consItAmounts = aAr;
				return true;
			} else {
				return false;
			}
		} else {
			return false;
		}
	}
	,currentKeyItems: function() {
		return com_tilbuci_statictools_StringStatic.jsonStringify({ k : this.keyItems});
	}
	,loadKeyItems: function(str) {
		var json = com_tilbuci_statictools_StringStatic.jsonParse(str);
		if(json == false) {
			return false;
		} else if(Object.prototype.hasOwnProperty.call(json,"k")) {
			var kAr = Reflect.field(json,"k");
			if(kAr != null) {
				this.keyItems = kAr;
				return true;
			} else {
				return false;
			}
		} else {
			return false;
		}
	}
	,currentConsItems: function() {
		return com_tilbuci_statictools_StringStatic.jsonStringify({ c : this.consItNames, a : this.consItAmounts});
	}
	,loadConsItems: function(str) {
		var json = com_tilbuci_statictools_StringStatic.jsonParse(str);
		if(json == false) {
			return false;
		} else if(Object.prototype.hasOwnProperty.call(json,"c") && Object.prototype.hasOwnProperty.call(json,"a")) {
			var cAr = Reflect.field(json,"c");
			var aAr = Reflect.field(json,"a");
			if(cAr != null && aAr != null) {
				this.consItNames = cAr;
				this.consItAmounts = aAr;
				return true;
			} else {
				return false;
			}
		} else {
			return false;
		}
	}
	,getData: function() {
		var data = new haxe_ds_StringMap();
		var v = [];
		data.h["chars"] = v;
		var h = this.chars.h;
		var k_h = h;
		var k_keys = Object.keys(h);
		var k_length = k_keys.length;
		var k_current = 0;
		while(k_current < k_length) {
			var k = k_h[k_keys[k_current++]];
			data.h["chars"].push(k.toObject());
		}
		var v = [];
		data.h["dialogues"] = v;
		var v = [];
		data.h["diagcontent"] = v;
		var h = this.dialogues.h;
		var k_h = h;
		var k_keys = Object.keys(h);
		var k_length = k_keys.length;
		var k_current = 0;
		while(k_current < k_length) {
			var k = k_h[k_keys[k_current++]];
			data.h["dialogues"].push(k.idObject());
			if(k.numDiags() > 0) {
				data.h["diagcontent"].push(k.toObject());
			}
		}
		var v = [];
		data.h["items"] = v;
		var h = this.items.h;
		var k_h = h;
		var k_keys = Object.keys(h);
		var k_length = k_keys.length;
		var k_current = 0;
		while(k_current < k_length) {
			var k = k_h[k_keys[k_current++]];
			data.h["items"].push(k.toObject());
		}
		var v = [];
		data.h["cards"] = v;
		var h = this.cards.h;
		var k_h = h;
		var k_keys = Object.keys(h);
		var k_length = k_keys.length;
		var k_current = 0;
		while(k_current < k_length) {
			var k = k_h[k_keys[k_current++]];
			data.h["cards"].push(k.toObject());
		}
		return com_tilbuci_statictools_StringStatic.jsonStringify(data);
	}
	,onSpeechLoad: function(ok) {
		this.diagSpeech.play();
	}
	,onSpeechEnd: function() {
		this.diagSpeech.stop();
	}
	,__class__: com_tilbuci_narrative_Narrative
};
var com_tilbuci_display_BaseImage = function(tp,at,ol) {
	this.oHeight = 0;
	this.oWidth = 0;
	this._autoTimer = false;
	this.extraInfo = [];
	this.type = "";
	openfl_display_Sprite.call(this);
	this.type = tp;
	this._autoTimer = at;
	this._onLoad = ol;
	this._mediaLoaded = false;
	this.set_visible(false);
	this._lastMedia = "";
	this.mouseChildren = false;
};
$hxClasses["com.tilbuci.display.BaseImage"] = com_tilbuci_display_BaseImage;
com_tilbuci_display_BaseImage.__name__ = "com.tilbuci.display.BaseImage";
com_tilbuci_display_BaseImage.__super__ = openfl_display_Sprite;
com_tilbuci_display_BaseImage.prototype = $extend(openfl_display_Sprite.prototype,{
	type: null
	,extraInfo: null
	,_autoTimer: null
	,_onLoad: null
	,oWidth: null
	,oHeight: null
	,mediaLoaded: null
	,get_mediaLoaded: function() {
		return this._mediaLoaded;
	}
	,_mediaLoaded: null
	,lastMedia: null
	,get_lastMedia: function() {
		return this._lastMedia;
	}
	,_lastMedia: null
	,kill: function() {
		this.removeChildren();
		this.type = null;
		this._onLoad = null;
		while(this.extraInfo.length > 0) this.extraInfo.shift();
		this.extraInfo = null;
	}
	,__class__: com_tilbuci_display_BaseImage
	,__properties__: $extend(openfl_display_Sprite.prototype.__properties__,{get_lastMedia:"get_lastMedia",get_mediaLoaded:"get_mediaLoaded"})
});
var com_tilbuci_display_AudioImage = function(ol,end,ta) {
	this._channelPos = -1;
	this._currentTime = 0;
	this._loaded = false;
	com_tilbuci_display_BaseImage.call(this,"audio",true,ol);
	this._onEnd = end;
	this._sound = new openfl_media_Sound();
	this._sound.addEventListener("complete",$bind(this,this.onComplete));
	this._sound.addEventListener("ioError",$bind(this,this.onError));
	this._onTimedAc = ta;
};
$hxClasses["com.tilbuci.display.AudioImage"] = com_tilbuci_display_AudioImage;
com_tilbuci_display_AudioImage.__name__ = "com.tilbuci.display.AudioImage";
com_tilbuci_display_AudioImage.__super__ = com_tilbuci_display_BaseImage;
com_tilbuci_display_AudioImage.prototype = $extend(com_tilbuci_display_BaseImage.prototype,{
	_sound: null
	,_channel: null
	,_loaded: null
	,_onEnd: null
	,_timer: null
	,_currentTime: null
	,_channelPos: null
	,_transform: null
	,_onTimedAc: null
	,getTime: function() {
		if(this._loaded) {
			return Math.round(this._channel.get_position() / 1000);
		} else {
			return 0;
		}
	}
	,setTime: function(to) {
		var tmp = this._loaded;
	}
	,load: function(media) {
		media = StringTools.replace(media,com_tilbuci_data_GlobalPlayer.path + "media/audio/","");
		this._lastMedia = media;
		this._loaded = false;
		this._channelPos = -1;
		this._transform = null;
		if(this._channel != null) {
			this._channel.removeEventListener("soundComplete",$bind(this,this.soundComplete));
			this._channel.stop();
			this._channel = null;
		}
		var path = com_tilbuci_data_GlobalPlayer.parser.parsePath(com_tilbuci_data_GlobalPlayer.path + "media/audio/" + media);
		this._sound.load(new openfl_net_URLRequest(path));
	}
	,iterateSound: function(vol,pan) {
		if(pan == null) {
			pan = 0;
		}
		if(this._channel != null) {
			motion_Actuate.transform(this._channel,com_tilbuci_data_GlobalPlayer.mdata.time).sound(vol,null);
			this._transform = new openfl_media_SoundTransform(vol,0);
		}
	}
	,stopSound: function() {
		motion_Actuate.stop(this._sound);
	}
	,kill: function() {
		com_tilbuci_display_BaseImage.prototype.kill.call(this);
		this._loaded = false;
		this._onEnd = null;
		try {
			this._sound.close();
		} catch( _g ) {
		}
		this._sound.removeEventListener("complete",$bind(this,this.onComplete));
		this._sound.removeEventListener("ioError",$bind(this,this.onError));
		this._sound = null;
		if(this._channel != null) {
			this._channel.removeEventListener("soundComplete",$bind(this,this.soundComplete));
			this._channel.stop();
			this._channel = null;
		}
		this._onTimedAc = null;
		if(this._timer != null) {
			try {
				this._timer.stop();
			} catch( _g ) {
			}
			this._timer = null;
		}
	}
	,play: function() {
		if(this._loaded) {
			var pos = 0;
			if(this._channelPos > 0) {
				pos = this._channelPos;
			}
			this._channelPos = -1;
			if(this._channel != null) {
				this._channel.removeEventListener("soundComplete",$bind(this,this.soundComplete));
				this._channel.stop();
				this._channel = null;
			}
			this._channel = this._sound.play(pos,0,this._transform);
			this._channel.addEventListener("soundComplete",$bind(this,this.soundComplete));
			if(this._timer != null) {
				try {
					this._timer.stop();
				} catch( _g ) {
				}
				this._timer = null;
			}
			this._currentTime = Math.round(pos / 1000);
			this._timer = new haxe_Timer(1000);
			this._timer.run = $bind(this,this.onTimer);
		}
	}
	,pause: function() {
		if(this._loaded) {
			this._channelPos = this._channel.get_position();
			this._channel.stop();
		}
	}
	,stop: function() {
		if(this._loaded) {
			this._channel.stop();
			if(this._timer != null) {
				try {
					this._timer.stop();
				} catch( _g ) {
				}
				this._timer = null;
			}
			this._channelPos = -1;
		}
	}
	,onTimer: function() {
		var tm = Math.round(this._channel.get_position() / 1000);
		if(this._currentTime != tm) {
			if(this._onTimedAc != null) {
				this._currentTime = tm;
				this._onTimedAc(tm);
			}
		}
	}
	,onComplete: function(evt) {
		this._loaded = true;
		if(this._channel != null) {
			this._channel.removeEventListener("soundComplete",$bind(this,this.soundComplete));
			this._channel.stop();
			this._channel = null;
		}
		this._channel = this._sound.play(0);
		this._channel.addEventListener("soundComplete",$bind(this,this.soundComplete));
		this._onLoad(true);
	}
	,onError: function(evt) {
		this._loaded = false;
		this._onLoad(false);
	}
	,soundComplete: function(evt) {
		this._onEnd();
	}
	,__class__: com_tilbuci_display_AudioImage
});
var openfl_media_Sound = function(stream,context) {
	this.__webAudioContext = null;
	this.__urlLoading = false;
	openfl_events_EventDispatcher.call(this,this);
	this.bytesLoaded = 0;
	this.bytesTotal = 0;
	this.isBuffering = false;
	this.url = null;
	if(stream != null) {
		this.load(stream,context);
	}
	if(stream == null && lime_media_AudioManager.context != null) {
		if(lime_media_AudioManager.context.type == "web") {
			this.__webAudioContext = lime_media_AudioManager.context.web;
		}
	}
};
$hxClasses["openfl.media.Sound"] = openfl_media_Sound;
openfl_media_Sound.__name__ = "openfl.media.Sound";
openfl_media_Sound.fromAudioBuffer = function(buffer) {
	var sound = new openfl_media_Sound();
	sound.__buffer = buffer;
	return sound;
};
openfl_media_Sound.fromFile = function(path) {
	var buffer = lime_media_AudioBuffer.fromFile(path);
	if(buffer == null) {
		throw new openfl_errors_IOError("Error loading sound from file: " + path);
	}
	return openfl_media_Sound.fromAudioBuffer(buffer);
};
openfl_media_Sound.loadFromFile = function(path) {
	return lime_media_AudioBuffer.loadFromFile(path).then(function(audioBuffer) {
		return lime_app_Future.withValue(openfl_media_Sound.fromAudioBuffer(audioBuffer));
	});
};
openfl_media_Sound.loadFromFiles = function(paths) {
	return lime_media_AudioBuffer.loadFromFiles(paths).then(function(audioBuffer) {
		return lime_app_Future.withValue(openfl_media_Sound.fromAudioBuffer(audioBuffer));
	});
};
openfl_media_Sound.__super__ = openfl_events_EventDispatcher;
openfl_media_Sound.prototype = $extend(openfl_events_EventDispatcher.prototype,{
	bytesLoaded: null
	,bytesTotal: null
	,isBuffering: null
	,url: null
	,__urlLoading: null
	,__pendingSoundChannel: null
	,__pendingAudioSource: null
	,__buffer: null
	,__webAudioContext: null
	,close: function() {
		if(this.__buffer != null) {
			openfl_media_SoundMixer.__unregisterSoundChannelByBuffer(this.__buffer);
			this.__buffer.dispose();
			this.__buffer = null;
		}
	}
	,load: function(stream,context) {
		var _gthis = this;
		this.url = stream.url;
		this.__urlLoading = true;
		this.dispatchEvent(new openfl_events_Event("open"));
		var defaultLibrary = lime_utils_Assets.getLibrary("default");
		if(defaultLibrary != null && Object.prototype.hasOwnProperty.call(defaultLibrary.cachedAudioBuffers.h,this.url)) {
			var audioBuffer = defaultLibrary.cachedAudioBuffers.h[this.url];
			var byteLength = audioBuffer != null && audioBuffer.data != null ? audioBuffer.data.byteLength : 0;
			this.AudioBuffer_onURLProgress(byteLength,byteLength);
			this.AudioBuffer_onURLLoad(audioBuffer);
		} else {
			lime_media_AudioBuffer.loadFromFile(this.url).onProgress($bind(this,this.AudioBuffer_onURLProgress)).onComplete($bind(this,this.AudioBuffer_onURLLoad)).onError(function(_) {
				_gthis.AudioBuffer_onURLLoad(null);
			});
		}
	}
	,loadCompressedDataFromByteArray: function(bytes,bytesLength) {
		if(bytes == null || bytesLength <= 0) {
			this.dispatchEvent(new openfl_events_IOErrorEvent("ioError"));
			return;
		}
		if(UInt.gt(bytes.position,0) || UInt.gt(openfl_utils_ByteArray.get_length(bytes),bytesLength)) {
			var length = bytesLength;
			if(length == null) {
				length = 0;
			}
			var copy = new openfl_utils_ByteArrayData(length);
			var offset = bytes.position;
			var length = bytesLength;
			if(length == null) {
				length = 0;
			}
			if(offset == null) {
				offset = 0;
			}
			copy.writeBytes(bytes,offset,length);
			bytes = copy;
		}
		this.__buffer = lime_media_AudioBuffer.fromBytes(openfl_utils_ByteArray.toBytes(bytes));
		if(this.__buffer == null) {
			this.dispatchEvent(new openfl_events_IOErrorEvent("ioError"));
		} else {
			this.dispatchEvent(new openfl_events_Event("open"));
			this.dispatchEvent(new openfl_events_ProgressEvent("progress",false,false,UInt.toFloat(openfl_utils_ByteArray.get_length(bytes)),UInt.toFloat(openfl_utils_ByteArray.get_length(bytes))));
			this.dispatchEvent(new openfl_events_Event("complete"));
		}
	}
	,loadPCMFromByteArray: function(bytes,samples,format,stereo,sampleRate) {
		if(sampleRate == null) {
			sampleRate = 44100;
		}
		if(stereo == null) {
			stereo = true;
		}
		if(format == null) {
			format = "float";
		}
		if(bytes == null) {
			this.dispatchEvent(new openfl_events_IOErrorEvent("ioError"));
			return;
		}
		var bitsPerSample = format == "float" ? 32 : 16;
		var channels = stereo ? 2 : 1;
		var bytesLength = samples * channels * (bitsPerSample / 8) | 0;
		if(UInt.gt(bytes.position,0) || UInt.gt(openfl_utils_ByteArray.get_length(bytes),bytesLength)) {
			var length = bytesLength;
			if(length == null) {
				length = 0;
			}
			var copy = new openfl_utils_ByteArrayData(length);
			var offset = bytes.position;
			var length = bytesLength;
			if(length == null) {
				length = 0;
			}
			if(offset == null) {
				offset = 0;
			}
			copy.writeBytes(bytes,offset,length);
			bytes = copy;
		}
		var audioBuffer = new lime_media_AudioBuffer();
		audioBuffer.bitsPerSample = bitsPerSample;
		audioBuffer.channels = channels;
		var elements = null;
		var array = null;
		var vector = null;
		var view = null;
		var buffer = openfl_utils_ByteArray.toArrayBuffer(bytes);
		var len = null;
		var this1;
		if(elements != null) {
			this1 = new Uint8Array(elements);
		} else if(array != null) {
			this1 = new Uint8Array(array);
		} else if(vector != null) {
			this1 = new Uint8Array(vector.__array);
		} else if(view != null) {
			this1 = new Uint8Array(view);
		} else if(buffer != null) {
			if(len == null) {
				this1 = new Uint8Array(buffer,0);
			} else {
				this1 = new Uint8Array(buffer,0,len);
			}
		} else {
			this1 = null;
		}
		audioBuffer.data = this1;
		audioBuffer.sampleRate = sampleRate | 0;
		this.__buffer = audioBuffer;
		this.dispatchEvent(new openfl_events_Event("open"));
		this.dispatchEvent(new openfl_events_ProgressEvent("progress",false,false,UInt.toFloat(openfl_utils_ByteArray.get_length(bytes)),UInt.toFloat(openfl_utils_ByteArray.get_length(bytes))));
		this.dispatchEvent(new openfl_events_Event("complete"));
	}
	,play: function(startTime,loops,sndTransform) {
		if(loops == null) {
			loops = 0;
		}
		if(startTime == null) {
			startTime = 0.0;
		}
		if(openfl_media_SoundMixer.__soundChannels.length >= 32) {
			return null;
		}
		if(sndTransform == null) {
			sndTransform = new openfl_media_SoundTransform();
		} else {
			sndTransform = sndTransform.clone();
		}
		var pan = openfl_media_SoundMixer.__soundTransform.pan + sndTransform.pan;
		if(pan > 1) {
			pan = 1;
		}
		if(pan < -1) {
			pan = -1;
		}
		var volume = openfl_media_SoundMixer.__soundTransform.volume * sndTransform.volume;
		var audioSource = new lime_media_AudioSource(this.__buffer);
		audioSource.offset = startTime | 0;
		if(loops > 1) {
			audioSource.set_loops(loops - 1);
		}
		audioSource.set_gain(volume);
		var position = audioSource.get_position();
		position.x = pan;
		position.z = -1 * Math.sqrt(1 - Math.pow(pan,2));
		audioSource.set_position(position);
		var soundChannel = new openfl_media_SoundChannel(this,this.__urlLoading ? null : audioSource,sndTransform);
		if(this.__urlLoading) {
			this.__pendingAudioSource = audioSource;
			this.__pendingSoundChannel = soundChannel;
		} else if(this.__buffer == null) {
			if(this.__webAudioContext != null) {
				soundChannel.__startSampleData();
			}
		}
		return soundChannel;
	}
	,get_sampleRate: function() {
		return this.__webAudioContext.sampleRate | 0;
	}
	,get_id3: function() {
		return new openfl_media_ID3Info();
	}
	,get_length: function() {
		if(this.__buffer != null) {
			return this.__buffer.get_src().duration() * 1000 | 0;
		}
		return 0;
	}
	,AudioBuffer_onURLLoad: function(buffer) {
		this.__urlLoading = false;
		if(buffer == null) {
			this.dispatchEvent(new openfl_events_IOErrorEvent("ioError"));
		} else {
			this.__buffer = buffer;
			var byteLength = 1;
			if(this.__buffer.data != null) {
				byteLength = this.__buffer.data.length;
			}
			this.dispatchEvent(new openfl_events_ProgressEvent("progress",false,false,byteLength,byteLength));
			this.dispatchEvent(new openfl_events_Event("complete"));
			if(this.__pendingSoundChannel != null) {
				this.__pendingAudioSource.buffer = this.__buffer;
				this.__pendingAudioSource.init();
				this.__pendingSoundChannel.__initAudioSource(this.__pendingAudioSource);
			}
		}
		this.__pendingSoundChannel = null;
		this.__pendingAudioSource = null;
	}
	,AudioBuffer_onURLProgress: function(bytesLoaded,bytesTotal) {
		var progressEvent = new openfl_events_ProgressEvent("progress");
		progressEvent.bytesLoaded = bytesLoaded;
		progressEvent.bytesTotal = bytesTotal;
		this.dispatchEvent(progressEvent);
	}
	,__class__: openfl_media_Sound
	,__properties__: {get_sampleRate:"get_sampleRate",get_length:"get_length",get_id3:"get_id3"}
});
var lime_media_AudioManager = function() { };
$hxClasses["lime.media.AudioManager"] = lime_media_AudioManager;
lime_media_AudioManager.__name__ = "lime.media.AudioManager";
lime_media_AudioManager.init = function(context) {
	if(lime_media_AudioManager.context == null) {
		if(context == null) {
			lime_media_AudioManager.context = new lime_media_AudioContext();
			context = lime_media_AudioManager.context;
			if(context.type == "openal") {
				var alc = context.openal;
				var device = alc.openDevice();
				if(device != null) {
					var ctx = alc.createContext(device);
					alc.makeContextCurrent(ctx);
					alc.processContext(ctx);
				}
			}
		}
		lime_media_AudioManager.context = context;
	}
};
lime_media_AudioManager.resume = function() {
	if(lime_media_AudioManager.context != null && lime_media_AudioManager.context.type == "openal") {
		var alc = lime_media_AudioManager.context.openal;
		var currentContext = alc.getCurrentContext();
		if(currentContext != null) {
			var device = alc.getContextsDevice(currentContext);
			alc.resumeDevice(device);
			alc.processContext(currentContext);
		}
	}
};
lime_media_AudioManager.shutdown = function() {
	if(lime_media_AudioManager.context != null && lime_media_AudioManager.context.type == "openal") {
		var alc = lime_media_AudioManager.context.openal;
		var currentContext = alc.getCurrentContext();
		if(currentContext != null) {
			var device = alc.getContextsDevice(currentContext);
			alc.makeContextCurrent(null);
			alc.destroyContext(currentContext);
			if(device != null) {
				alc.closeDevice(device);
			}
		}
	}
	lime_media_AudioManager.context = null;
};
lime_media_AudioManager.suspend = function() {
	if(lime_media_AudioManager.context != null && lime_media_AudioManager.context.type == "openal") {
		var alc = lime_media_AudioManager.context.openal;
		var currentContext = alc.getCurrentContext();
		if(currentContext != null) {
			alc.suspendContext(currentContext);
			var device = alc.getContextsDevice(currentContext);
			if(device != null) {
				alc.pauseDevice(device);
			}
		}
	}
};
var lime_math_Matrix3 = {};
lime_math_Matrix3.__properties__ = {set_ty:"set_ty",get_ty:"get_ty",set_tx:"set_tx",get_tx:"get_tx",set_d:"set_d",get_d:"get_d",set_c:"set_c",get_c:"get_c",set_b:"set_b",get_b:"get_b",set_a:"set_a",get_a:"get_a"};
lime_math_Matrix3._new = function(a,b,c,d,tx,ty) {
	if(ty == null) {
		ty = 0;
	}
	if(tx == null) {
		tx = 0;
	}
	if(d == null) {
		d = 1;
	}
	if(c == null) {
		c = 0;
	}
	if(b == null) {
		b = 0;
	}
	if(a == null) {
		a = 1;
	}
	var elements = null;
	var array = [a,b,0,c,d,0,tx,ty,1];
	var vector = null;
	var view = null;
	var buffer = null;
	var len = null;
	var this1;
	if(elements != null) {
		this1 = new Float32Array(elements);
	} else if(array != null) {
		this1 = new Float32Array(array);
	} else if(vector != null) {
		this1 = new Float32Array(vector.__array);
	} else if(view != null) {
		this1 = new Float32Array(view);
	} else if(buffer != null) {
		if(len == null) {
			this1 = new Float32Array(buffer,0);
		} else {
			this1 = new Float32Array(buffer,0,len);
		}
	} else {
		this1 = null;
	}
	return this1;
};
lime_math_Matrix3.clone = function(this1) {
	return lime_math_Matrix3._new(this1[0],this1[1],this1[3],this1[4],this1[6],this1[7]);
};
lime_math_Matrix3.concat = function(this1,m) {
	var a1 = this1[0] * m[0] + this1[1] * m[3];
	this1[1] = this1[0] * m[1] + this1[1] * m[4];
	this1[0] = a1;
	var c1 = this1[3] * m[0] + this1[4] * m[3];
	this1[4] = this1[3] * m[1] + this1[4] * m[4];
	this1[3] = c1;
	var tx1 = this1[6] * m[0] + this1[7] * m[3] + m[6];
	this1[7] = this1[6] * m[1] + this1[7] * m[4] + m[7];
	this1[6] = tx1;
};
lime_math_Matrix3.copyColumnFrom = function(this1,column,vector4) {
	if(column > 2) {
		throw haxe_Exception.thrown("Column " + column + " out of bounds (2)");
	} else if(column == 0) {
		this1[0] = vector4.x;
		this1[1] = vector4.y;
	} else if(column == 1) {
		this1[3] = vector4.x;
		this1[4] = vector4.y;
	} else {
		this1[6] = vector4.x;
		this1[7] = vector4.y;
	}
};
lime_math_Matrix3.copyColumnTo = function(this1,column,vector4) {
	if(column > 2) {
		throw haxe_Exception.thrown("Column " + column + " out of bounds (2)");
	} else if(column == 0) {
		vector4.x = this1[0];
		vector4.y = this1[1];
		vector4.z = 0;
	} else if(column == 1) {
		vector4.x = this1[3];
		vector4.y = this1[4];
		vector4.z = 0;
	} else {
		vector4.x = this1[6];
		vector4.y = this1[7];
		vector4.z = 1;
	}
};
lime_math_Matrix3.copyFrom = function(this1,sourceMatrix3) {
	this1[0] = sourceMatrix3[0];
	this1[1] = sourceMatrix3[1];
	this1[3] = sourceMatrix3[3];
	this1[4] = sourceMatrix3[4];
	this1[6] = sourceMatrix3[6];
	this1[7] = sourceMatrix3[7];
};
lime_math_Matrix3.copyRowFrom = function(this1,row,vector4) {
	if(row > 2) {
		throw haxe_Exception.thrown("Row " + row + " out of bounds (2)");
	} else if(row == 0) {
		this1[0] = vector4.x;
		this1[3] = vector4.y;
		this1[6] = vector4.z;
	} else if(row == 1) {
		this1[1] = vector4.x;
		this1[4] = vector4.y;
		this1[7] = vector4.z;
	}
};
lime_math_Matrix3.copyRowTo = function(this1,row,vector4) {
	if(row > 2) {
		throw haxe_Exception.thrown("Row " + row + " out of bounds (2)");
	} else if(row == 0) {
		vector4.x = this1[0];
		vector4.y = this1[3];
		vector4.z = this1[6];
	} else if(row == 1) {
		vector4.x = this1[1];
		vector4.y = this1[4];
		vector4.z = this1[7];
	} else {
		vector4.x = 0;
		vector4.y = 0;
		vector4.z = 1;
	}
};
lime_math_Matrix3.createBox = function(this1,scaleX,scaleY,rotation,xTranslate,yTranslate) {
	if(yTranslate == null) {
		yTranslate = 0;
	}
	if(xTranslate == null) {
		xTranslate = 0;
	}
	if(rotation == null) {
		rotation = 0;
	}
	if(rotation != 0) {
		var cos = Math.cos(rotation);
		var sin = Math.sin(rotation);
		this1[0] = cos * scaleX;
		this1[1] = sin * scaleY;
		this1[3] = -sin * scaleX;
		this1[4] = cos * scaleY;
	} else {
		this1[0] = scaleX;
		this1[1] = 0;
		this1[3] = 0;
		this1[4] = scaleY;
	}
	this1[6] = xTranslate;
	this1[7] = yTranslate;
};
lime_math_Matrix3.createGradientBox = function(this1,width,height,rotation,xTranslate,yTranslate) {
	if(yTranslate == null) {
		yTranslate = 0;
	}
	if(xTranslate == null) {
		xTranslate = 0;
	}
	if(rotation == null) {
		rotation = 0;
	}
	this1[0] = width / 1638.4;
	this1[4] = height / 1638.4;
	if(rotation != 0) {
		var cos = Math.cos(rotation);
		var sin = Math.sin(rotation);
		this1[1] = sin * this1[4];
		this1[3] = -sin * this1[0];
		this1[0] *= cos;
		this1[4] *= cos;
	} else {
		this1[1] = 0;
		this1[3] = 0;
	}
	this1[6] = xTranslate + width / 2;
	this1[7] = yTranslate + height / 2;
};
lime_math_Matrix3.equals = function(this1,matrix3) {
	if(matrix3 != null && this1[6] == matrix3[6] && this1[7] == matrix3[7] && this1[0] == matrix3[0] && this1[1] == matrix3[1] && this1[3] == matrix3[3]) {
		return this1[4] == matrix3[4];
	} else {
		return false;
	}
};
lime_math_Matrix3.deltaTransformVector = function(this1,Vector2,result) {
	if(result == null) {
		result = new lime_math_Vector2();
	}
	result.x = Vector2.x * this1[0] + Vector2.y * this1[3];
	result.y = Vector2.x * this1[1] + Vector2.y * this1[4];
	return result;
};
lime_math_Matrix3.fromCairoMatrix3 = function(matrix) {
	return lime_math_Matrix3._new(matrix.a,matrix.b,matrix.c,matrix.d,matrix.tx,matrix.ty);
};
lime_math_Matrix3.fromFloat32Array = function(array) {
	if(array.length != 9) {
		throw haxe_Exception.thrown("Expected array of length 9, got " + array.length);
	}
	return array;
};
lime_math_Matrix3.identity = function(this1) {
	this1[0] = 1;
	this1[1] = 0;
	this1[3] = 0;
	this1[4] = 1;
	this1[6] = 0;
	this1[7] = 0;
};
lime_math_Matrix3.invert = function(this1) {
	var norm = this1[0] * this1[4] - this1[1] * this1[3];
	if(norm == 0) {
		this1[0] = this1[1] = this1[3] = this1[4] = 0;
		this1[6] = -this1[6];
		this1[7] = -this1[7];
	} else {
		norm = 1.0 / norm;
		var a1 = this1[4] * norm;
		this1[4] = this1[0] * norm;
		this1[0] = a1;
		this1[1] *= -norm;
		this1[3] *= -norm;
		var tx1 = -this1[0] * this1[6] - this1[3] * this1[7];
		this1[7] = -this1[1] * this1[6] - this1[4] * this1[7];
		this1[6] = tx1;
	}
	if(this1.length != 9) {
		throw haxe_Exception.thrown("Expected array of length 9, got " + this1.length);
	}
	return this1;
};
lime_math_Matrix3.rotate = function(this1,theta) {
	var cos = Math.cos(theta);
	var sin = Math.sin(theta);
	var a1 = this1[0] * cos - this1[1] * sin;
	this1[1] = this1[0] * sin + this1[1] * cos;
	this1[0] = a1;
	var c1 = this1[3] * cos - this1[4] * sin;
	this1[4] = this1[3] * sin + this1[4] * cos;
	this1[3] = c1;
	var tx1 = this1[6] * cos - this1[7] * sin;
	this1[7] = this1[6] * sin + this1[7] * cos;
	this1[6] = tx1;
};
lime_math_Matrix3.scale = function(this1,sx,sy) {
	this1[0] *= sx;
	this1[1] *= sy;
	this1[3] *= sx;
	this1[4] *= sy;
	this1[6] *= sx;
	this1[7] *= sy;
};
lime_math_Matrix3.setRotation = function(this1,theta,scale) {
	if(scale == null) {
		scale = 1;
	}
	this1[0] = Math.cos(theta) * scale;
	this1[3] = Math.sin(theta) * scale;
	this1[1] = -this1[3];
	this1[4] = this1[0];
};
lime_math_Matrix3.setTo = function(this1,a,b,c,d,tx,ty) {
	this1[0] = a;
	this1[1] = b;
	this1[3] = c;
	this1[4] = d;
	this1[6] = tx;
	this1[7] = ty;
};
lime_math_Matrix3.toCairoMatrix3 = function(this1) {
	return new lime_math_CairoMatrix3(this1[0],this1[1],this1[3],this1[4],this1[6],this1[7]);
};
lime_math_Matrix3.toString = function(this1) {
	return "matrix(" + this1[0] + ", " + this1[1] + ", " + this1[3] + ", " + this1[4] + ", " + this1[6] + ", " + this1[7] + ")";
};
lime_math_Matrix3.transformRect = function(this1,rect,result) {
	if(result == null) {
		result = new lime_math_Rectangle();
	}
	var tx0 = this1[0] * rect.x + this1[3] * rect.y;
	var tx1 = tx0;
	var ty0 = this1[1] * rect.x + this1[4] * rect.y;
	var ty1 = ty0;
	var tx = this1[0] * (rect.x + rect.width) + this1[3] * rect.y;
	var ty = this1[1] * (rect.x + rect.width) + this1[4] * rect.y;
	if(tx < tx0) {
		tx0 = tx;
	}
	if(ty < ty0) {
		ty0 = ty;
	}
	if(tx > tx1) {
		tx1 = tx;
	}
	if(ty > ty1) {
		ty1 = ty;
	}
	tx = this1[0] * (rect.x + rect.width) + this1[3] * (rect.y + rect.height);
	ty = this1[1] * (rect.x + rect.width) + this1[4] * (rect.y + rect.height);
	if(tx < tx0) {
		tx0 = tx;
	}
	if(ty < ty0) {
		ty0 = ty;
	}
	if(tx > tx1) {
		tx1 = tx;
	}
	if(ty > ty1) {
		ty1 = ty;
	}
	tx = this1[0] * rect.x + this1[3] * (rect.y + rect.height);
	ty = this1[1] * rect.x + this1[4] * (rect.y + rect.height);
	if(tx < tx0) {
		tx0 = tx;
	}
	if(ty < ty0) {
		ty0 = ty;
	}
	if(tx > tx1) {
		tx1 = tx;
	}
	if(ty > ty1) {
		ty1 = ty;
	}
	result.setTo(tx0 + tx,ty0 + ty,tx1 - tx0,ty1 - ty0);
	return result;
};
lime_math_Matrix3.transformVector = function(this1,pos,result) {
	if(result == null) {
		result = new lime_math_Vector2();
	}
	result.x = pos.x * this1[0] + pos.y * this1[3] + this1[6];
	result.y = pos.x * this1[1] + pos.y * this1[4] + this1[7];
	return result;
};
lime_math_Matrix3.translate = function(this1,dx,dy) {
	this1[6] += dx;
	this1[7] += dy;
};
lime_math_Matrix3.get_a = function(this1) {
	return this1[0];
};
lime_math_Matrix3.set_a = function(this1,value) {
	return this1[0] = value;
};
lime_math_Matrix3.get_b = function(this1) {
	return this1[1];
};
lime_math_Matrix3.set_b = function(this1,value) {
	return this1[1] = value;
};
lime_math_Matrix3.get_c = function(this1) {
	return this1[3];
};
lime_math_Matrix3.set_c = function(this1,value) {
	return this1[3] = value;
};
lime_math_Matrix3.get_d = function(this1) {
	return this1[4];
};
lime_math_Matrix3.set_d = function(this1,value) {
	return this1[4] = value;
};
lime_math_Matrix3.get_tx = function(this1) {
	return this1[6];
};
lime_math_Matrix3.set_tx = function(this1,value) {
	return this1[6] = value;
};
lime_math_Matrix3.get_ty = function(this1) {
	return this1[7];
};
lime_math_Matrix3.set_ty = function(this1,value) {
	return this1[7] = value;
};
lime_math_Matrix3.get = function(this1,index) {
	return this1[index];
};
lime_math_Matrix3.set = function(this1,index,value) {
	this1[index] = value;
	return value;
};
var openfl_geom_Matrix = function(a,b,c,d,tx,ty) {
	if(ty == null) {
		ty = 0;
	}
	if(tx == null) {
		tx = 0;
	}
	if(d == null) {
		d = 1;
	}
	if(c == null) {
		c = 0;
	}
	if(b == null) {
		b = 0;
	}
	if(a == null) {
		a = 1;
	}
	this.a = a;
	this.b = b;
	this.c = c;
	this.d = d;
	this.tx = tx;
	this.ty = ty;
};
$hxClasses["openfl.geom.Matrix"] = openfl_geom_Matrix;
openfl_geom_Matrix.__name__ = "openfl.geom.Matrix";
openfl_geom_Matrix.prototype = {
	a: null
	,b: null
	,c: null
	,d: null
	,tx: null
	,ty: null
	,__array: null
	,clone: function() {
		return new openfl_geom_Matrix(this.a,this.b,this.c,this.d,this.tx,this.ty);
	}
	,concat: function(m) {
		var a1 = this.a * m.a + this.b * m.c;
		this.b = this.a * m.b + this.b * m.d;
		this.a = a1;
		var c1 = this.c * m.a + this.d * m.c;
		this.d = this.c * m.b + this.d * m.d;
		this.c = c1;
		var tx1 = this.tx * m.a + this.ty * m.c + m.tx;
		this.ty = this.tx * m.b + this.ty * m.d + m.ty;
		this.tx = tx1;
	}
	,copyColumnFrom: function(column,vector3D) {
		if(column > 2) {
			throw haxe_Exception.thrown("Column " + column + " out of bounds (2)");
		} else if(column == 0) {
			this.a = vector3D.x;
			this.b = vector3D.y;
		} else if(column == 1) {
			this.c = vector3D.x;
			this.d = vector3D.y;
		} else {
			this.tx = vector3D.x;
			this.ty = vector3D.y;
		}
	}
	,copyColumnTo: function(column,vector3D) {
		if(column > 2) {
			throw haxe_Exception.thrown("Column " + column + " out of bounds (2)");
		} else if(column == 0) {
			vector3D.x = this.a;
			vector3D.y = this.b;
			vector3D.z = 0;
		} else if(column == 1) {
			vector3D.x = this.c;
			vector3D.y = this.d;
			vector3D.z = 0;
		} else {
			vector3D.x = this.tx;
			vector3D.y = this.ty;
			vector3D.z = 1;
		}
	}
	,copyFrom: function(sourceMatrix) {
		this.a = sourceMatrix.a;
		this.b = sourceMatrix.b;
		this.c = sourceMatrix.c;
		this.d = sourceMatrix.d;
		this.tx = sourceMatrix.tx;
		this.ty = sourceMatrix.ty;
	}
	,copyRowFrom: function(row,vector3D) {
		if(row > 2) {
			throw haxe_Exception.thrown("Row " + row + " out of bounds (2)");
		} else if(row == 0) {
			this.a = vector3D.x;
			this.c = vector3D.y;
			this.tx = vector3D.z;
		} else if(row == 1) {
			this.b = vector3D.x;
			this.d = vector3D.y;
			this.ty = vector3D.z;
		}
	}
	,copyRowTo: function(row,vector3D) {
		if(row > 2) {
			throw haxe_Exception.thrown("Row " + row + " out of bounds (2)");
		} else if(row == 0) {
			vector3D.x = this.a;
			vector3D.y = this.c;
			vector3D.z = this.tx;
		} else if(row == 1) {
			vector3D.x = this.b;
			vector3D.y = this.d;
			vector3D.z = this.ty;
		} else {
			vector3D.setTo(0,0,1);
		}
	}
	,createBox: function(scaleX,scaleY,rotation,tx,ty) {
		if(ty == null) {
			ty = 0;
		}
		if(tx == null) {
			tx = 0;
		}
		if(rotation == null) {
			rotation = 0;
		}
		if(rotation != 0) {
			var cos = Math.cos(rotation);
			var sin = Math.sin(rotation);
			this.a = cos * scaleX;
			this.b = sin * scaleY;
			this.c = -sin * scaleX;
			this.d = cos * scaleY;
		} else {
			this.a = scaleX;
			this.b = 0;
			this.c = 0;
			this.d = scaleY;
		}
		this.tx = tx;
		this.ty = ty;
	}
	,createGradientBox: function(width,height,rotation,tx,ty) {
		if(ty == null) {
			ty = 0;
		}
		if(tx == null) {
			tx = 0;
		}
		if(rotation == null) {
			rotation = 0;
		}
		this.a = width / 1638.4;
		this.d = height / 1638.4;
		if(rotation != 0) {
			var cos = Math.cos(rotation);
			var sin = Math.sin(rotation);
			this.b = sin * this.d;
			this.c = -sin * this.a;
			this.a *= cos;
			this.d *= cos;
		} else {
			this.b = 0;
			this.c = 0;
		}
		this.tx = tx + width / 2;
		this.ty = ty + height / 2;
	}
	,deltaTransformPoint: function(point) {
		return new openfl_geom_Point(point.x * this.a + point.y * this.c,point.x * this.b + point.y * this.d);
	}
	,deltaTransformPointToOutput: function(point,output) {
		if(output != null) {
			output.setTo(point.x * this.a + point.y * this.c,point.x * this.b + point.y * this.d);
			return output;
		}
		return new openfl_geom_Point(point.x * this.a + point.y * this.c,point.x * this.b + point.y * this.d);
	}
	,equals: function(matrix) {
		if(matrix != null && this.tx == matrix.tx && this.ty == matrix.ty && this.a == matrix.a && this.b == matrix.b && this.c == matrix.c) {
			return this.d == matrix.d;
		} else {
			return false;
		}
	}
	,identity: function() {
		this.a = 1;
		this.b = 0;
		this.c = 0;
		this.d = 1;
		this.tx = 0;
		this.ty = 0;
	}
	,invert: function() {
		var norm = this.a * this.d - this.b * this.c;
		if(norm == 0) {
			this.a = this.b = this.c = this.d = 0;
			this.tx = -this.tx;
			this.ty = -this.ty;
		} else {
			norm = 1.0 / norm;
			var a1 = this.d * norm;
			this.d = this.a * norm;
			this.a = a1;
			this.b *= -norm;
			this.c *= -norm;
			var tx1 = -this.a * this.tx - this.c * this.ty;
			this.ty = -this.b * this.tx - this.d * this.ty;
			this.tx = tx1;
		}
		return this;
	}
	,rotate: function(theta) {
		var cos = Math.cos(theta);
		var sin = Math.sin(theta);
		var a1 = this.a * cos - this.b * sin;
		this.b = this.a * sin + this.b * cos;
		this.a = a1;
		var c1 = this.c * cos - this.d * sin;
		this.d = this.c * sin + this.d * cos;
		this.c = c1;
		var tx1 = this.tx * cos - this.ty * sin;
		this.ty = this.tx * sin + this.ty * cos;
		this.tx = tx1;
	}
	,scale: function(sx,sy) {
		this.a *= sx;
		this.b *= sy;
		this.c *= sx;
		this.d *= sy;
		this.tx *= sx;
		this.ty *= sy;
	}
	,setRotation: function(theta,scale) {
		if(scale == null) {
			scale = 1;
		}
		this.a = Math.cos(theta) * scale;
		this.c = Math.sin(theta) * scale;
		this.b = -this.c;
		this.d = this.a;
	}
	,setTo: function(a,b,c,d,tx,ty) {
		this.a = a;
		this.b = b;
		this.c = c;
		this.d = d;
		this.tx = tx;
		this.ty = ty;
	}
	,to3DString: function(roundPixels) {
		if(roundPixels == null) {
			roundPixels = false;
		}
		if(roundPixels) {
			return "matrix3d(" + this.a + ", " + this.b + ", 0, 0, " + this.c + ", " + this.d + ", 0, 0, 0, 0, 1, 0, " + (this.tx | 0) + ", " + (this.ty | 0) + ", 0, 1)";
		} else {
			return "matrix3d(" + this.a + ", " + this.b + ", 0, 0, " + this.c + ", " + this.d + ", 0, 0, 0, 0, 1, 0, " + this.tx + ", " + this.ty + ", 0, 1)";
		}
	}
	,toMozString: function() {
		return "matrix(" + this.a + ", " + this.b + ", " + this.c + ", " + this.d + ", " + this.tx + "px, " + this.ty + "px)";
	}
	,toString: function() {
		return "matrix(" + this.a + ", " + this.b + ", " + this.c + ", " + this.d + ", " + this.tx + ", " + this.ty + ")";
	}
	,transformPoint: function(pos) {
		return new openfl_geom_Point(pos.x * this.a + pos.y * this.c + this.tx,pos.x * this.b + pos.y * this.d + this.ty);
	}
	,transformPointToOutput: function(pos,output) {
		if(output != null) {
			output.setTo(pos.x * this.a + pos.y * this.c + this.tx,pos.x * this.b + pos.y * this.d + this.ty);
			return output;
		}
		return new openfl_geom_Point(pos.x * this.a + pos.y * this.c + this.tx,pos.x * this.b + pos.y * this.d + this.ty);
	}
	,translate: function(dx,dy) {
		this.tx += dx;
		this.ty += dy;
	}
	,toArray: function(transpose) {
		if(transpose == null) {
			transpose = false;
		}
		if(this.__array == null) {
			var array = null;
			var vector = null;
			var view = null;
			var buffer = null;
			var len = null;
			this.__array = new Float32Array(9);
		}
		if(transpose) {
			this.__array[0] = this.a;
			this.__array[1] = this.b;
			this.__array[2] = 0;
			this.__array[3] = this.c;
			this.__array[4] = this.d;
			this.__array[5] = 0;
			this.__array[6] = this.tx;
			this.__array[7] = this.ty;
			this.__array[8] = 1;
		} else {
			this.__array[0] = this.a;
			this.__array[1] = this.c;
			this.__array[2] = this.tx;
			this.__array[3] = this.b;
			this.__array[4] = this.d;
			this.__array[5] = this.ty;
			this.__array[6] = 0;
			this.__array[7] = 0;
			this.__array[8] = 1;
		}
		return this.__array;
	}
	,__cleanValues: function() {
		this.a = Math.round(this.a * 1000) / 1000;
		this.b = Math.round(this.b * 1000) / 1000;
		this.c = Math.round(this.c * 1000) / 1000;
		this.d = Math.round(this.d * 1000) / 1000;
		this.tx = Math.round(this.tx * 10) / 10;
		this.ty = Math.round(this.ty * 10) / 10;
	}
	,__toMatrix3: function() {
		lime_math_Matrix3.setTo(openfl_geom_Matrix.__matrix3,this.a,this.b,this.c,this.d,this.tx,this.ty);
		return openfl_geom_Matrix.__matrix3;
	}
	,__transformInversePoint: function(point) {
		var norm = this.a * this.d - this.b * this.c;
		if(norm == 0) {
			point.x = -this.tx;
			point.y = -this.ty;
		} else {
			var px = 1.0 / norm * (this.c * (this.ty - point.y) + this.d * (point.x - this.tx));
			point.y = 1.0 / norm * (this.a * (point.y - this.ty) + this.b * (this.tx - point.x));
			point.x = px;
		}
	}
	,__transformInverseX: function(px,py) {
		var norm = this.a * this.d - this.b * this.c;
		if(norm == 0) {
			return -this.tx;
		} else {
			return 1.0 / norm * (this.c * (this.ty - py) + this.d * (px - this.tx));
		}
	}
	,__transformInverseY: function(px,py) {
		var norm = this.a * this.d - this.b * this.c;
		if(norm == 0) {
			return -this.ty;
		} else {
			return 1.0 / norm * (this.a * (py - this.ty) + this.b * (this.tx - px));
		}
	}
	,__transformPoint: function(point) {
		var px = point.x;
		var py = point.y;
		point.x = px * this.a + py * this.c + this.tx;
		point.y = px * this.b + py * this.d + this.ty;
	}
	,__transformX: function(px,py) {
		return px * this.a + py * this.c + this.tx;
	}
	,__transformY: function(px,py) {
		return px * this.b + py * this.d + this.ty;
	}
	,__translateTransformed: function(px,py) {
		this.tx = px * this.a + py * this.c + this.tx;
		this.ty = px * this.b + py * this.d + this.ty;
	}
	,__class__: openfl_geom_Matrix
};
var openfl_geom_ColorTransform = function(redMultiplier,greenMultiplier,blueMultiplier,alphaMultiplier,redOffset,greenOffset,blueOffset,alphaOffset) {
	if(alphaOffset == null) {
		alphaOffset = 0;
	}
	if(blueOffset == null) {
		blueOffset = 0;
	}
	if(greenOffset == null) {
		greenOffset = 0;
	}
	if(redOffset == null) {
		redOffset = 0;
	}
	if(alphaMultiplier == null) {
		alphaMultiplier = 1;
	}
	if(blueMultiplier == null) {
		blueMultiplier = 1;
	}
	if(greenMultiplier == null) {
		greenMultiplier = 1;
	}
	if(redMultiplier == null) {
		redMultiplier = 1;
	}
	this.redMultiplier = redMultiplier;
	this.greenMultiplier = greenMultiplier;
	this.blueMultiplier = blueMultiplier;
	this.alphaMultiplier = alphaMultiplier;
	this.redOffset = redOffset;
	this.greenOffset = greenOffset;
	this.blueOffset = blueOffset;
	this.alphaOffset = alphaOffset;
};
$hxClasses["openfl.geom.ColorTransform"] = openfl_geom_ColorTransform;
openfl_geom_ColorTransform.__name__ = "openfl.geom.ColorTransform";
openfl_geom_ColorTransform.prototype = {
	alphaMultiplier: null
	,alphaOffset: null
	,blueMultiplier: null
	,blueOffset: null
	,greenMultiplier: null
	,greenOffset: null
	,redMultiplier: null
	,redOffset: null
	,concat: function(second) {
		this.redOffset = second.redOffset * this.redMultiplier + this.redOffset;
		this.greenOffset = second.greenOffset * this.greenMultiplier + this.greenOffset;
		this.blueOffset = second.blueOffset * this.blueMultiplier + this.blueOffset;
		this.alphaOffset = second.alphaOffset * this.alphaMultiplier + this.alphaOffset;
		this.redMultiplier *= second.redMultiplier;
		this.greenMultiplier *= second.greenMultiplier;
		this.blueMultiplier *= second.blueMultiplier;
		this.alphaMultiplier *= second.alphaMultiplier;
	}
	,toString: function() {
		return "(redMultiplier=" + this.redMultiplier + ", greenMultiplier=" + this.greenMultiplier + ", blueMultiplier=" + this.blueMultiplier + ", alphaMultiplier=" + this.alphaMultiplier + ", redOffset=" + this.redOffset + ", greenOffset=" + this.greenOffset + ", blueOffset=" + this.blueOffset + ", alphaOffset=" + this.alphaOffset + ")";
	}
	,__clone: function() {
		return new openfl_geom_ColorTransform(this.redMultiplier,this.greenMultiplier,this.blueMultiplier,this.alphaMultiplier,this.redOffset,this.greenOffset,this.blueOffset,this.alphaOffset);
	}
	,__copyFrom: function(ct) {
		this.redMultiplier = ct.redMultiplier;
		this.greenMultiplier = ct.greenMultiplier;
		this.blueMultiplier = ct.blueMultiplier;
		this.alphaMultiplier = ct.alphaMultiplier;
		this.redOffset = ct.redOffset;
		this.greenOffset = ct.greenOffset;
		this.blueOffset = ct.blueOffset;
		this.alphaOffset = ct.alphaOffset;
	}
	,__combine: function(ct) {
		this.redMultiplier *= ct.redMultiplier;
		this.greenMultiplier *= ct.greenMultiplier;
		this.blueMultiplier *= ct.blueMultiplier;
		this.alphaMultiplier *= ct.alphaMultiplier;
		this.redOffset += ct.redOffset;
		this.greenOffset += ct.greenOffset;
		this.blueOffset += ct.blueOffset;
		this.alphaOffset += ct.alphaOffset;
	}
	,__identity: function() {
		this.redMultiplier = 1;
		this.greenMultiplier = 1;
		this.blueMultiplier = 1;
		this.alphaMultiplier = 1;
		this.redOffset = 0;
		this.greenOffset = 0;
		this.blueOffset = 0;
		this.alphaOffset = 0;
	}
	,__invert: function() {
		this.redMultiplier = this.redMultiplier != 0 ? 1 / this.redMultiplier : 1;
		this.greenMultiplier = this.greenMultiplier != 0 ? 1 / this.greenMultiplier : 1;
		this.blueMultiplier = this.blueMultiplier != 0 ? 1 / this.blueMultiplier : 1;
		this.alphaMultiplier = this.alphaMultiplier != 0 ? 1 / this.alphaMultiplier : 1;
		this.redOffset = -this.redOffset;
		this.greenOffset = -this.greenOffset;
		this.blueOffset = -this.blueOffset;
		this.alphaOffset = -this.alphaOffset;
	}
	,__equals: function(ct,ignoreAlphaMultiplier) {
		if(ct != null && this.redMultiplier == ct.redMultiplier && this.greenMultiplier == ct.greenMultiplier && this.blueMultiplier == ct.blueMultiplier && (ignoreAlphaMultiplier || this.alphaMultiplier == ct.alphaMultiplier) && this.redOffset == ct.redOffset && this.greenOffset == ct.greenOffset && this.blueOffset == ct.blueOffset) {
			return this.alphaOffset == ct.alphaOffset;
		} else {
			return false;
		}
	}
	,__isDefault: function(ignoreAlphaMultiplier) {
		if(ignoreAlphaMultiplier) {
			if(this.redMultiplier == 1 && this.greenMultiplier == 1 && this.blueMultiplier == 1 && this.redOffset == 0 && this.greenOffset == 0 && this.blueOffset == 0) {
				return this.alphaOffset == 0;
			} else {
				return false;
			}
		} else if(this.redMultiplier == 1 && this.greenMultiplier == 1 && this.blueMultiplier == 1 && this.alphaMultiplier == 1 && this.redOffset == 0 && this.greenOffset == 0 && this.blueOffset == 0) {
			return this.alphaOffset == 0;
		} else {
			return false;
		}
	}
	,__setArrays: function(colorMultipliers,colorOffsets) {
		colorMultipliers[0] = this.redMultiplier;
		colorMultipliers[1] = this.greenMultiplier;
		colorMultipliers[2] = this.blueMultiplier;
		colorMultipliers[3] = this.alphaMultiplier;
		colorOffsets[0] = this.redOffset;
		colorOffsets[1] = this.greenOffset;
		colorOffsets[2] = this.blueOffset;
		colorOffsets[3] = this.alphaOffset;
	}
	,get_color: function() {
		return (this.redOffset | 0) << 16 | (this.greenOffset | 0) << 8 | (this.blueOffset | 0);
	}
	,set_color: function(value) {
		this.redOffset = value >> 16 & 255;
		this.greenOffset = value >> 8 & 255;
		this.blueOffset = value & 255;
		this.redMultiplier = 0;
		this.greenMultiplier = 0;
		this.blueMultiplier = 0;
		return this.get_color();
	}
	,__toLimeColorMatrix: function() {
		if(openfl_geom_ColorTransform.__limeColorMatrix == null) {
			var array = null;
			var vector = null;
			var view = null;
			var buffer = null;
			var len = null;
			openfl_geom_ColorTransform.__limeColorMatrix = new Float32Array(20);
		}
		openfl_geom_ColorTransform.__limeColorMatrix[0] = this.redMultiplier;
		openfl_geom_ColorTransform.__limeColorMatrix[4] = this.redOffset / 255;
		openfl_geom_ColorTransform.__limeColorMatrix[6] = this.greenMultiplier;
		openfl_geom_ColorTransform.__limeColorMatrix[9] = this.greenOffset / 255;
		openfl_geom_ColorTransform.__limeColorMatrix[12] = this.blueMultiplier;
		openfl_geom_ColorTransform.__limeColorMatrix[14] = this.blueOffset / 255;
		openfl_geom_ColorTransform.__limeColorMatrix[18] = this.alphaMultiplier;
		openfl_geom_ColorTransform.__limeColorMatrix[19] = this.alphaOffset / 255;
		return openfl_geom_ColorTransform.__limeColorMatrix;
	}
	,__class__: openfl_geom_ColorTransform
	,__properties__: {set_color:"set_color",get_color:"get_color"}
};
var openfl_text_StyleSheet = function() {
	openfl_events_EventDispatcher.call(this);
	this.clear();
};
$hxClasses["openfl.text.StyleSheet"] = openfl_text_StyleSheet;
openfl_text_StyleSheet.__name__ = "openfl.text.StyleSheet";
openfl_text_StyleSheet.__super__ = openfl_events_EventDispatcher;
openfl_text_StyleSheet.prototype = $extend(openfl_events_EventDispatcher.prototype,{
	__styleNames: null
	,__styleNamesDirty: null
	,__styles: null
	,clear: function() {
		this.__styleNamesDirty = false;
		this.__styleNames = null;
		this.__styles = new haxe_ds_StringMap();
	}
	,getStyle: function(styleName) {
		styleName = styleName.toLowerCase();
		if(Object.prototype.hasOwnProperty.call(this.__styles.h,styleName)) {
			return this.__styles.h[styleName];
		} else {
			return null;
		}
	}
	,parseCSS: function(CSSText) {
		var _g = new haxe_ds_StringMap();
		_g.h["silent"] = true;
		var parser = new openfl_text__$internal_CSSParser(_g);
		var ast = parser.parse(CSSText);
		if(ast != null) {
			var rules = ast.h["rules"];
			var _g = 0;
			while(_g < rules.length) {
				var rule = rules[_g];
				++_g;
				var styleName = Object.prototype.hasOwnProperty.call(rule.h,"selectors") ? rule.h["selectors"] : null;
				if(styleName != null) {
					styleName = styleName.toLowerCase();
					if(!Object.prototype.hasOwnProperty.call(this.__styles.h,styleName)) {
						this.__styles.h[styleName] = { };
						this.__styleNamesDirty = true;
					}
					var object = this.__styles.h[styleName];
					var declarations = rule.h["declarations"];
					if(declarations != null) {
						var _g1 = 0;
						while(_g1 < declarations.length) {
							var declaration = declarations[_g1];
							++_g1;
							var property = declaration.h["property"];
							var value = Std.string(declaration.h["value"]);
							if(property != null) {
								if(property == null) {
									object[property] = value;
								} else {
									switch(property) {
									case "font-family":
										var value1 = StringTools.replace(value,"\"","");
										var this1 = object;
										if(this1 != null) {
											Reflect.setProperty(this1,"fontFamily",value1);
										}
										break;
									case "font-size":
										var this2 = object;
										if(this2 != null) {
											Reflect.setProperty(this2,"fontSize",value);
										}
										break;
									case "font-style":
										var this3 = object;
										if(this3 != null) {
											Reflect.setProperty(this3,"fontStyle",value);
										}
										break;
									case "font-weight":
										var this4 = object;
										if(this4 != null) {
											Reflect.setProperty(this4,"fontWeight",value);
										}
										break;
									case "letter-spacing":
										var this5 = object;
										if(this5 != null) {
											Reflect.setProperty(this5,"letterSpacing",value);
										}
										break;
									case "margin-left":
										var this6 = object;
										if(this6 != null) {
											Reflect.setProperty(this6,"marginLeft",value);
										}
										break;
									case "text-align":
										var this7 = object;
										if(this7 != null) {
											Reflect.setProperty(this7,"textAlign",value);
										}
										break;
									case "text-decoration":
										var this8 = object;
										if(this8 != null) {
											Reflect.setProperty(this8,"textDecoration",value);
										}
										break;
									case "text-indent":
										var this9 = object;
										if(this9 != null) {
											Reflect.setProperty(this9,"textIndent",value);
										}
										break;
									default:
										object[property] = value;
									}
								}
							}
						}
					}
				}
			}
		}
	}
	,setStyle: function(styleName,styleObject) {
		styleName = styleName.toLowerCase();
		if(styleObject == null) {
			if(Object.prototype.hasOwnProperty.call(this.__styles.h,styleName)) {
				var _this = this.__styles;
				if(Object.prototype.hasOwnProperty.call(_this.h,styleName)) {
					delete(_this.h[styleName]);
				}
			}
		} else {
			var object = { };
			var _g = 0;
			var _g1 = Reflect.fields(styleObject);
			while(_g < _g1.length) {
				var field = _g1[_g];
				++_g;
				object[field] = Reflect.field(styleObject,field);
			}
			this.__styles.h[styleName] = object;
		}
	}
	,transform: function(formatObject) {
		var format = new openfl_text_TextFormat();
		this.__applyStyleObject(formatObject,format);
		return format;
	}
	,__applyStyle: function(styleName,textFormat) {
		styleName = styleName.toLowerCase();
		if(Object.prototype.hasOwnProperty.call(this.__styles.h,styleName)) {
			var style = this.__styles.h[styleName];
			this.__applyStyleObject(style,textFormat);
		}
	}
	,__applyStyleObject: function(styleObject,textFormat) {
		if(styleObject != null) {
			var hex = new EReg("[0-9A-Fa-f]+","");
			var numeric = new EReg("[0-9]+","");
			var tmp;
			var this1 = styleObject;
			if(this1 != null && Object.prototype.hasOwnProperty.call(this1,"color")) {
				var this1 = openfl_utils_Object.__get(styleObject,"color");
				tmp = hex.match(this1 == null ? null : Std.string(this1));
			} else {
				tmp = false;
			}
			if(tmp) {
				textFormat.color = Std.parseInt("0x" + hex.matched(0));
			}
			var this1 = styleObject;
			if(this1 != null && Object.prototype.hasOwnProperty.call(this1,"fontFamily")) {
				var this1 = openfl_utils_Object.__get(styleObject,"fontFamily");
				textFormat.set_font(this.__parseFont(this1 == null ? null : Std.string(this1)));
			}
			var tmp;
			var this1 = styleObject;
			if(this1 != null && Object.prototype.hasOwnProperty.call(this1,"fontSize")) {
				var this1 = openfl_utils_Object.__get(styleObject,"fontSize");
				tmp = numeric.match(this1 == null ? null : Std.string(this1));
			} else {
				tmp = false;
			}
			if(tmp) {
				textFormat.set_size(Std.parseInt(numeric.matched(0)));
			}
			var this1 = styleObject;
			if(this1 != null && Object.prototype.hasOwnProperty.call(this1,"fontStyle")) {
				switch(openfl_utils_Object.__get(styleObject,"fontStyle")) {
				case "italic":
					textFormat.set_italic(true);
					break;
				case "normal":
					textFormat.set_italic(false);
					break;
				default:
				}
			}
			var this1 = styleObject;
			if(this1 != null && Object.prototype.hasOwnProperty.call(this1,"fontWeight")) {
				switch(openfl_utils_Object.__get(styleObject,"fontWeight")) {
				case "bold":
					textFormat.set_bold(true);
					break;
				case "normal":
					textFormat.set_bold(false);
					break;
				default:
				}
			}
			var tmp;
			var this1 = styleObject;
			if(this1 != null && Object.prototype.hasOwnProperty.call(this1,"leading")) {
				var this1 = openfl_utils_Object.__get(styleObject,"leading");
				tmp = numeric.match(this1 == null ? null : Std.string(this1));
			} else {
				tmp = false;
			}
			if(tmp) {
				textFormat.leading = Std.parseInt(numeric.matched(0));
			}
			var tmp;
			var this1 = styleObject;
			if(this1 != null && Object.prototype.hasOwnProperty.call(this1,"letterSpacing")) {
				var this1 = openfl_utils_Object.__get(styleObject,"letterSpacing");
				tmp = numeric.match(this1 == null ? null : Std.string(this1));
			} else {
				tmp = false;
			}
			if(tmp) {
				textFormat.letterSpacing = parseFloat(numeric.matched(0));
			}
			var tmp;
			var this1 = styleObject;
			if(this1 != null && Object.prototype.hasOwnProperty.call(this1,"marginLeft")) {
				var this1 = openfl_utils_Object.__get(styleObject,"marginLeft");
				tmp = numeric.match(this1 == null ? null : Std.string(this1));
			} else {
				tmp = false;
			}
			if(tmp) {
				textFormat.leftMargin = Std.parseInt(numeric.matched(0));
			}
			var tmp;
			var this1 = styleObject;
			if(this1 != null && Object.prototype.hasOwnProperty.call(this1,"marginRight")) {
				var this1 = openfl_utils_Object.__get(styleObject,"marginRight");
				tmp = numeric.match(this1 == null ? null : Std.string(this1));
			} else {
				tmp = false;
			}
			if(tmp) {
				textFormat.rightMargin = Std.parseInt(numeric.matched(0));
			}
			var this1 = styleObject;
			if(this1 != null && Object.prototype.hasOwnProperty.call(this1,"textAlign")) {
				switch(openfl_utils_Object.__get(styleObject,"textAlign")) {
				case "center":
					textFormat.align = 0;
					break;
				case "justify":
					textFormat.align = 2;
					break;
				case "left":
					textFormat.align = 3;
					break;
				case "right":
					textFormat.align = 4;
					break;
				default:
				}
			}
			var this1 = styleObject;
			if(this1 != null && Object.prototype.hasOwnProperty.call(this1,"textDecoration")) {
				switch(openfl_utils_Object.__get(styleObject,"textDecoration")) {
				case "none":
					textFormat.underline = false;
					break;
				case "underline":
					textFormat.underline = true;
					break;
				default:
				}
			}
			var tmp;
			var this1 = styleObject;
			if(this1 != null && Object.prototype.hasOwnProperty.call(this1,"textIndent")) {
				var this1 = openfl_utils_Object.__get(styleObject,"textIndent");
				tmp = numeric.match(this1 == null ? null : Std.string(this1));
			} else {
				tmp = false;
			}
			if(tmp) {
				textFormat.blockIndent = Std.parseInt(numeric.matched(0));
			}
		}
	}
	,__parseFont: function(fontFamily) {
		if(fontFamily == null) {
			return null;
		}
		if(fontFamily.indexOf(",") > -1) {
			fontFamily = HxOverrides.substr(fontFamily,0,fontFamily.indexOf(","));
		}
		switch(fontFamily) {
		case "mono":
			return "_typewriter";
		case "sans-serif":
			return "_sans";
		case "serif":
			return "_serif";
		default:
			return fontFamily;
		}
	}
	,get_styleNames: function() {
		if(this.__styleNames == null || this.__styleNamesDirty) {
			this.__styleNames = [];
			var h = this.__styles.h;
			var style_h = h;
			var style_keys = Object.keys(h);
			var style_length = style_keys.length;
			var style_current = 0;
			while(style_current < style_length) {
				var style = style_keys[style_current++];
				this.__styleNames.push(style);
			}
			this.__styleNamesDirty = false;
		}
		return this.__styleNames;
	}
	,__class__: openfl_text_StyleSheet
	,__properties__: {get_styleNames:"get_styleNames"}
});
var com_tilbuci_data_GlobalPlayer = function() { };
$hxClasses["com.tilbuci.data.GlobalPlayer"] = com_tilbuci_data_GlobalPlayer;
com_tilbuci_data_GlobalPlayer.__name__ = "com.tilbuci.data.GlobalPlayer";
com_tilbuci_data_GlobalPlayer.copyText = function(text) {
	var ok = false;
	try {
		window.TBB_copyText(text);
		ok = true;
	} catch( _g ) {
		haxe_Log.trace(text,{ fileName : "Source/com/tilbuci/data/GlobalPlayer.hx", lineNumber : 233, className : "com.tilbuci.data.GlobalPlayer", methodName : "copyText"});
		ok = false;
	}
	return ok;
};
com_tilbuci_data_GlobalPlayer.isMobile = function() {
	var ok = true;
	try {
		ok = window.TBB_isMobile();
	} catch( _g ) {
		ok = true;
	}
	return ok;
};
com_tilbuci_data_GlobalPlayer.appQuit = function() {
	var ok = false;
	try {
		ok = false;
	} catch( _g ) {
		ok = false;
	}
	return ok;
};
com_tilbuci_data_GlobalPlayer.pwaInstall = function() {
	var ok = false;
	try {
		window.TBB_showInstallPrompt();
		ok = true;
	} catch( _g ) {
		ok = false;
	}
	return ok;
};
com_tilbuci_data_GlobalPlayer.fullscreen = function() {
	var ok = false;
	try {
		window.TBB_fullscreen();
		ok = true;
	} catch( _g ) {
		ok = false;
	}
	return ok;
};
com_tilbuci_data_GlobalPlayer.saveFile = function(name,content) {
	var ok = false;
	try {
		window.TBB_saveFile(name,content);
		ok = true;
	} catch( _g ) {
		ok = false;
	}
	return ok;
};
com_tilbuci_data_GlobalPlayer.existsFile = function(name) {
	var ok = false;
	return ok;
};
com_tilbuci_data_GlobalPlayer.loadFile = function(name,ext,callback) {
	var ok = false;
	try {
		window.TBB_loadFile(ext,callback);
		ok = true;
	} catch( _g ) {
		ok = false;
	}
	return ok;
};
var com_tilbuci_data_History = function() {
	this._max = 20;
	this.propDisplay = [];
	this._current = 0;
	this.states = [];
};
$hxClasses["com.tilbuci.data.History"] = com_tilbuci_data_History;
com_tilbuci_data_History.__name__ = "com.tilbuci.data.History";
com_tilbuci_data_History.prototype = {
	states: null
	,current: null
	,get_current: function() {
		return this._current;
	}
	,_current: null
	,historyDisplay: null
	,propDisplay: null
	,_max: null
	,addState: function(name) {
		if(name == null) {
			name = "";
		}
		while(this.states.length > this._current + 1) this.states.pop();
		this.states.push({ title : DateTools.format(new Date(),"%H:%M:%S"), state : com_tilbuci_data_GlobalPlayer.movie.scene.toObject(), orientation : com_tilbuci_data_Global.displayType, keyframe : com_tilbuci_data_GlobalPlayer.area.get_currentKf(), name : name});
		while(this.states.length > this._max) this.states.shift();
		this._current = this.states.length - 1;
		if(this.historyDisplay != null) {
			this.historyDisplay();
		}
	}
	,updateProperties: function() {
		var _g = 0;
		var _g1 = this.propDisplay;
		while(_g < _g1.length) {
			var pd = _g1[_g];
			++_g;
			pd();
		}
	}
	,loadState: function(num) {
		if(this.states.length > num) {
			com_tilbuci_data_Global.displayType = this.states[num].orientation;
			com_tilbuci_data_GlobalPlayer.movie.scene.fromObject(this.states[num].state);
			this._current = num;
			return true;
		} else {
			return false;
		}
	}
	,clear: function() {
		while(this.states.length > 0) this.states.shift();
		this._current = -1;
		if(this.historyDisplay != null) {
			this.historyDisplay();
		}
	}
	,__class__: com_tilbuci_data_History
	,__properties__: {get_current:"get_current"}
};
var com_tilbuci_data_Language = function() {
	this._texts = new haxe_ds_StringMap();
	this._current = "";
	this._ok = false;
	openfl_events_EventDispatcher.call(this);
	this._ok = this.load("langDefault");
};
$hxClasses["com.tilbuci.data.Language"] = com_tilbuci_data_Language;
com_tilbuci_data_Language.__name__ = "com.tilbuci.data.Language";
com_tilbuci_data_Language.__super__ = openfl_events_EventDispatcher;
com_tilbuci_data_Language.prototype = $extend(openfl_events_EventDispatcher.prototype,{
	ok: null
	,get_ok: function() {
		return this._ok;
	}
	,_ok: null
	,current: null
	,get_current: function() {
		return this._current;
	}
	,_current: null
	,_texts: null
	,load: function(lang) {
		var ok = false;
		var str = openfl_utils_Assets.getText(lang);
		var file = com_tilbuci_statictools_StringStatic.jsonParse(str);
		if(file == false) {
			ok = false;
		} else {
			var _g = 0;
			var _g1 = Reflect.fields(file);
			while(_g < _g1.length) {
				var n = _g1[_g];
				++_g;
				var v = Reflect.field(file,n);
				this._texts.h[n] = v;
			}
			this._current = lang;
			ok = true;
		}
		return ok;
	}
	,get: function(name) {
		if(Object.prototype.hasOwnProperty.call(this._texts.h,name)) {
			return this._texts.h[name];
		} else {
			return "";
		}
	}
	,kill: function() {
		var h = this._texts.h;
		var name_h = h;
		var name_keys = Object.keys(h);
		var name_length = name_keys.length;
		var name_current = 0;
		while(name_current < name_length) {
			var name = name_keys[name_current++];
			var _this = this._texts;
			if(Object.prototype.hasOwnProperty.call(_this.h,name)) {
				delete(_this.h[name]);
			}
		}
		this._texts = null;
	}
	,__class__: com_tilbuci_data_Language
	,__properties__: {get_current:"get_current",get_ok:"get_ok"}
});
var com_tilbuci_data_MovieInfo = function(onMovie,onScene) {
	this._scId = "";
	this._mvId = "";
	this._colLoad = 0;
	this._cacheScene = new haxe_ds_StringMap();
	this._actions = new haxe_ds_StringMap();
	this.preventHistory = false;
	this.collections = new haxe_ds_StringMap();
	this.data = new com_tilbuci_def_MovieData();
	this.scene = new com_tilbuci_def_SceneData();
	var v = onMovie;
	this._actions.h["movie"] = v;
	var v = onScene;
	this._actions.h["scene"] = v;
};
$hxClasses["com.tilbuci.data.MovieInfo"] = com_tilbuci_data_MovieInfo;
com_tilbuci_data_MovieInfo.__name__ = "com.tilbuci.data.MovieInfo";
com_tilbuci_data_MovieInfo.prototype = {
	data: null
	,scene: null
	,collections: null
	,preventHistory: null
	,_path: null
	,_actions: null
	,_cacheScene: null
	,_colLoad: null
	,mvId: null
	,_mvId: null
	,get_mvId: function() {
		return this._mvId;
	}
	,mvLoaded: null
	,get_mvLoaded: function() {
		return this._mvId != "";
	}
	,scId: null
	,_scId: null
	,get_scId: function() {
		return this._scId;
	}
	,scLoaded: null
	,get_scLoaded: function() {
		return this._scId != "";
	}
	,kill: function() {
		this.data.kill();
		this.data = null;
		this.scene.kill();
		this.scene = null;
		var h = this._actions.h;
		var n_h = h;
		var n_keys = Object.keys(h);
		var n_length = n_keys.length;
		var n_current = 0;
		while(n_current < n_length) {
			var n = n_keys[n_current++];
			var _this = this._actions;
			if(Object.prototype.hasOwnProperty.call(_this.h,n)) {
				delete(_this.h[n]);
			}
		}
		this._actions = null;
		var h = this._cacheScene.h;
		var n_h = h;
		var n_keys = Object.keys(h);
		var n_length = n_keys.length;
		var n_current = 0;
		while(n_current < n_length) {
			var n = n_keys[n_current++];
			var _this = this._cacheScene;
			if(Object.prototype.hasOwnProperty.call(_this.h,n)) {
				delete(_this.h[n]);
			}
		}
		this._cacheScene = null;
	}
	,loadMovie: function(path) {
		while(com_tilbuci_data_GlobalPlayer.history.length > 0) com_tilbuci_data_GlobalPlayer.history.shift();
		com_tilbuci_data_GlobalPlayer.loadingMovie = path;
		this._mvId = "";
		this._scId = "";
		this.data.clear();
		this.scene.clear();
		com_tilbuci_data_GlobalPlayer.parser.clearStringFile();
		com_tilbuci_data_GlobalPlayer.area.clear();
		var h = this._cacheScene.h;
		var n_h = h;
		var n_keys = Object.keys(h);
		var n_length = n_keys.length;
		var n_current = 0;
		while(n_current < n_length) {
			var n = n_keys[n_current++];
			var _this = this._cacheScene;
			if(Object.prototype.hasOwnProperty.call(_this.h,n)) {
				delete(_this.h[n]);
			}
		}
		if(HxOverrides.substr(path,0,4) != "http" && HxOverrides.substr(path,0,4) != "file") {
			path = com_tilbuci_data_GlobalPlayer.base + "movie/" + path;
		}
		if(HxOverrides.substr(path,-6,null) != ".movie") {
			path += ".movie";
		}
		com_tilbuci_data_GlobalPlayer.path = this._path = path + "/";
		path += "/movie.json";
		var cache = null;
		if(com_tilbuci_data_GlobalPlayer.nocache) {
			var _g = new haxe_ds_StringMap();
			var value = Math.ceil(Math.random() * 10000);
			_g.h["rand"] = value;
			cache = _g;
		}
		new com_tilbuci_data_DataLoader(true,path,"GET",cache,4,$bind(this,this.onMovieLoaded));
	}
	,loadScene: function(id,uid) {
		if(uid == null) {
			uid = 0;
		}
		if(this.get_mvLoaded()) {
			com_tilbuci_data_GlobalPlayer.contraptions.showLoadingIc();
			if(com_tilbuci_data_GlobalPlayer.mode == "editor" || com_tilbuci_data_GlobalPlayer.mode == "editorplayer" || com_tilbuci_data_GlobalPlayer.mode == "player" && com_tilbuci_data_GlobalPlayer.mdata.identify) {
				if(com_tilbuci_data_GlobalPlayer.mode == "player" && com_tilbuci_data_GlobalPlayer.mdata.identify) {
					com_tilbuci_data_GlobalPlayer.ws.loadScene(id,$bind(this,this.onSceneLoaded));
				} else if(id == null) {
					var tmp = com_tilbuci_data_Global.ws;
					var _g = new haxe_ds_StringMap();
					var value = com_tilbuci_data_GlobalPlayer.movie.get_mvId();
					_g.h["movie"] = value;
					_g.h["uid"] = uid;
					tmp.send("Scene/LoadUid",_g,$bind(this,this.onSceneLoadedEditor));
				} else {
					var tmp = com_tilbuci_data_Global.ws;
					var _g = new haxe_ds_StringMap();
					var value = com_tilbuci_data_GlobalPlayer.movie.get_mvId();
					_g.h["movie"] = value;
					_g.h["id"] = id;
					tmp.send("Scene/Load",_g,$bind(this,this.onSceneLoadedEditor));
				}
				return true;
			} else if(Object.prototype.hasOwnProperty.call(this._cacheScene.h,id)) {
				if(this.scene.load(com_tilbuci_statictools_StringStatic.jsonAsMap(this._cacheScene.h[id]))) {
					this._scId = id;
				} else {
					this._scId = "";
				}
				this._actions.h["scene"](this.get_scLoaded());
				return this.get_scLoaded();
			} else {
				var cache = null;
				if(com_tilbuci_data_GlobalPlayer.nocache) {
					var _g = new haxe_ds_StringMap();
					var value = Math.ceil(Math.random() * 10000);
					_g.h["rand"] = value;
					cache = _g;
				}
				new com_tilbuci_data_DataLoader(true,this._path + "scene/" + id + ".json","GET",cache,4,$bind(this,this.onSceneLoaded));
				return true;
			}
		} else {
			this._actions.h["scene"](false);
			return false;
		}
	}
	,noScene: function() {
		this._scId = "";
	}
	,cacheScene: function(id) {
		if(this.get_mvLoaded()) {
			if(!Object.prototype.hasOwnProperty.call(this._cacheScene.h,id)) {
				var cache = null;
				if(com_tilbuci_data_GlobalPlayer.nocache) {
					var _g = new haxe_ds_StringMap();
					var value = Math.ceil(Math.random() * 10000);
					_g.h["rand"] = value;
					cache = _g;
				}
				new com_tilbuci_data_DataLoader(true,this._path + "scene/" + id + ".json","GET",cache,4,$bind(this,this.onSceneCache));
			}
			return true;
		} else {
			return false;
		}
	}
	,onMovieLoaded: function(ok,ld) {
		if(ok) {
			if(this.data.load(ld.map)) {
				var pathAr = StringTools.replace(this._path,".movie/","").split("/");
				this._mvId = pathAr[pathAr.length - 1];
			}
		}
		if(!this.get_mvLoaded()) {
			this._path = "";
			this._actions.h["movie"](this.get_mvLoaded());
		} else {
			var groupok = false;
			if(com_tilbuci_data_GlobalPlayer.mdata.vsgroups.length == 0) {
				groupok = true;
			} else {
				var _g = 0;
				var _g1 = com_tilbuci_data_GlobalPlayer.mdata.vsgroups;
				while(_g < _g1.length) {
					var gr = _g1[_g];
					++_g;
					if(com_tilbuci_data_GlobalPlayer.ws.get_groups().indexOf(gr) != -1) {
						groupok = true;
					}
				}
			}
			if(com_tilbuci_data_GlobalPlayer.mdata.identify && !com_tilbuci_data_GlobalPlayer.ws.userLogged() && com_tilbuci_data_GlobalPlayer.mode == "player") {
				this._mvId = "";
				this._path = "";
				if(com_tilbuci_data_GlobalPlayer.mdata.fallback != "") {
					if(Object.prototype.hasOwnProperty.call(Main,"scene")) {
						Main["scene"] = "";
					}
					this.loadMovie(com_tilbuci_data_GlobalPlayer.mdata.fallback);
				}
			} else if(!groupok && com_tilbuci_data_GlobalPlayer.mode == "player") {
				this._mvId = "";
				this._path = "";
				if(com_tilbuci_data_GlobalPlayer.mdata.fallback != "") {
					if(Object.prototype.hasOwnProperty.call(Main,"scene")) {
						Main["scene"] = "";
					}
					this.loadMovie(com_tilbuci_data_GlobalPlayer.mdata.fallback);
				}
			} else {
				com_tilbuci_data_GlobalPlayer.parser.loadStringsJson();
				if(com_tilbuci_data_GlobalPlayer.mode == "player") {
					var mainScene = "";
					if(Object.prototype.hasOwnProperty.call(Main,"scene")) {
						mainScene = Reflect.field(Main,"scene");
					}
					if(mainScene == "") {
						this.loadScene(ld.map.h["start"]);
					} else {
						this.loadScene(mainScene);
						if(Object.prototype.hasOwnProperty.call(Main,"scene")) {
							Main["scene"] = "";
						}
					}
				}
			}
			this._actions.h["movie"](true);
		}
	}
	,loadCollection: function(id) {
		var this1 = this.collections;
		var v = new com_tilbuci_def_CollectionData(this._path + "collection/" + id + ".json",null);
		this1.h[id] = v;
	}
	,onSceneLoadedEditor: function(ok,ld) {
		if(ok) {
			com_tilbuci_data_GlobalPlayer.movie.scene.clear();
			if(ld.map.h["e"] == 0) {
				var info = new haxe_ds_StringMap();
				var _g = 0;
				var _g1 = Reflect.fields(ld.map.h["info"]);
				while(_g < _g1.length) {
					var k = _g1[_g];
					++_g;
					var v = Reflect.field(ld.map.h["info"],k);
					info.h[k] = v;
				}
				if(this.scene.load(info)) {
					this._scId = info.h["id"];
					this._colLoad = 0;
					var _g = 0;
					var _g1 = this.scene.collections;
					while(_g < _g1.length) {
						var c = _g1[_g];
						++_g;
						if(c != "") {
							if(Object.prototype.hasOwnProperty.call(this.collections.h,c)) {
								this.collections.h[c].kill();
								var _this = this.collections;
								if(Object.prototype.hasOwnProperty.call(_this.h,c)) {
									delete(_this.h[c]);
								}
							}
							this._colLoad++;
							var this1 = this.collections;
							var v = new com_tilbuci_def_CollectionData(this._path + "collection/" + c + ".json",$bind(this,this.onColLoad));
							this1.h[c] = v;
						}
					}
					if(this._colLoad == 0) {
						this.onColLoad();
					}
				} else {
					com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("scene-load-windowtitle"),com_tilbuci_data_Global.ln.get("scene-load-error"),320,160,com_tilbuci_data_Global.ln.get("default-ok"));
				}
			} else {
				com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("scene-load-windowtitle"),com_tilbuci_data_Global.ln.get("scene-load-error"),320,160,com_tilbuci_data_Global.ln.get("default-ok"));
			}
		} else {
			com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("scene-load-windowtitle"),com_tilbuci_data_Global.ln.get("scene-load-error"),320,160,com_tilbuci_data_Global.ln.get("default-ok"));
		}
	}
	,onSceneLoaded: function(ok,ld) {
		if(ok) {
			if(!com_tilbuci_data_GlobalPlayer.movie.preventHistory && this._scId != "") {
				com_tilbuci_data_GlobalPlayer.history.push(this._scId);
			}
			com_tilbuci_data_GlobalPlayer.movie.preventHistory = false;
			com_tilbuci_data_GlobalPlayer.movie.scene.clear();
			if(this.scene.load(ld.map)) {
				if(ld.url.indexOf(".json") != -1) {
					var pathAr = StringTools.replace(ld.url,".json","").split("/");
					this._scId = pathAr[pathAr.length - 1];
				} else if(Object.prototype.hasOwnProperty.call(ld.map.h,"id")) {
					this._scId = ld.map.h["id"];
				}
				var v = ld.rawtext;
				this._cacheScene.h[this._scId] = v;
				this._colLoad = 0;
				var _g = 0;
				var _g1 = this.scene.collections;
				while(_g < _g1.length) {
					var c = _g1[_g];
					++_g;
					var okc = true;
					try {
						okc = Object.prototype.hasOwnProperty.call(this.collections.h,c);
					} catch( _g2 ) {
						okc = false;
					}
					if(okc) {
						if(!this.collections.h[c].ok) {
							this.collections.h[c].kill();
							this._colLoad++;
							var this1 = this.collections;
							var v = new com_tilbuci_def_CollectionData(this._path + "collection/" + c + ".json",$bind(this,this.onColLoad));
							this1.h[c] = v;
						}
					} else {
						this._colLoad++;
						var this2 = this.collections;
						var v1 = new com_tilbuci_def_CollectionData(this._path + "collection/" + c + ".json",$bind(this,this.onColLoad));
						this2.h[c] = v1;
					}
				}
				if(this._colLoad == 0) {
					this.onColLoad();
				}
			}
		}
	}
	,onSceneCache: function(ok,ld) {
		var scid = HxOverrides.substr(ld.url,-37,32);
		if(ok && this.scene.checkFields(ld.map)) {
			var v = ld.rawtext;
			this._cacheScene.h[scid] = v;
		} else if(Object.prototype.hasOwnProperty.call(this._cacheScene.h,scid)) {
			var _this = this._cacheScene;
			if(Object.prototype.hasOwnProperty.call(_this.h,scid)) {
				delete(_this.h[scid]);
			}
		}
	}
	,onColLoad: function() {
		this._colLoad--;
		if(this._colLoad <= 0) {
			this._colLoad = 0;
			this._actions.h["scene"](this.get_scLoaded());
		}
	}
	,__class__: com_tilbuci_data_MovieInfo
	,__properties__: {get_scLoaded:"get_scLoaded",get_scId:"get_scId",get_mvLoaded:"get_mvLoaded",get_mvId:"get_mvId"}
};
var com_tilbuci_def_AssetData = function(data) {
	this.frtime = 100;
	this.frames = 1;
	this.order = 0;
	this.action = "";
	this.ok = false;
	this.ok = true;
	if(Object.prototype.hasOwnProperty.call(data,"name")) {
		this.name = Reflect.field(data,"name");
	} else {
		this.ok = false;
	}
	if(this.ok && Object.prototype.hasOwnProperty.call(data,"type")) {
		this.type = Reflect.field(data,"type");
	} else {
		this.ok = false;
	}
	if(this.ok && Object.prototype.hasOwnProperty.call(data,"order")) {
		this.order = Reflect.field(data,"order");
	} else {
		this.ok = false;
	}
	if(this.ok && Object.prototype.hasOwnProperty.call(data,"time")) {
		this.time = Reflect.field(data,"time");
	} else {
		this.ok = false;
	}
	if(this.ok && Object.prototype.hasOwnProperty.call(data,"action")) {
		this.action = Reflect.field(data,"action");
	} else {
		this.ok = false;
	}
	if(this.ok && Object.prototype.hasOwnProperty.call(data,"frames")) {
		this.frames = Reflect.field(data,"frames");
	} else {
		this.ok = false;
	}
	if(this.ok && Object.prototype.hasOwnProperty.call(data,"frtime")) {
		this.frtime = Reflect.field(data,"frtime");
	} else {
		this.ok = false;
	}
	if(this.ok && Object.prototype.hasOwnProperty.call(data,"file")) {
		var fl = Reflect.field(data,"file");
		if(Object.prototype.hasOwnProperty.call(fl,"@1")) {
			this.file = new haxe_ds_StringMap();
			var v = Reflect.field(fl,"@1");
			this.file.h["@1"] = v;
			if(Object.prototype.hasOwnProperty.call(fl,"@2")) {
				var v = Reflect.field(fl,"@2");
				this.file.h["@2"] = v;
				if(this.file.h["@2"] == "") {
					var v = this.file.h["@1"];
					this.file.h["@2"] = v;
				}
			} else {
				var v = this.file.h["@1"];
				this.file.h["@2"] = v;
			}
			if(Object.prototype.hasOwnProperty.call(fl,"@3")) {
				var v = Reflect.field(fl,"@3");
				this.file.h["@3"] = v;
				if(this.file.h["@3"] == "") {
					var v = this.file.h["@2"];
					this.file.h["@3"] = v;
				}
			} else {
				var v = this.file.h["@2"];
				this.file.h["@3"] = v;
			}
			if(Object.prototype.hasOwnProperty.call(fl,"@4")) {
				var v = Reflect.field(fl,"@4");
				this.file.h["@4"] = v;
				if(this.file.h["@4"] == "") {
					var v = this.file.h["@3"];
					this.file.h["@4"] = v;
				}
			} else {
				var v = this.file.h["@3"];
				this.file.h["@4"] = v;
			}
			if(Object.prototype.hasOwnProperty.call(fl,"@5")) {
				var v = Reflect.field(fl,"@5");
				this.file.h["@5"] = v;
				if(this.file.h["@5"] == "") {
					var v = this.file.h["@4"];
					this.file.h["@5"] = v;
				}
			} else {
				var v = this.file.h["@4"];
				this.file.h["@5"] = v;
			}
		} else {
			this.ok = false;
		}
		this.time = Reflect.field(data,"time");
	} else {
		this.ok = false;
	}
};
$hxClasses["com.tilbuci.def.AssetData"] = com_tilbuci_def_AssetData;
com_tilbuci_def_AssetData.__name__ = "com.tilbuci.def.AssetData";
com_tilbuci_def_AssetData.prototype = {
	ok: null
	,name: null
	,type: null
	,time: null
	,action: null
	,order: null
	,frames: null
	,frtime: null
	,file: null
	,kill: function() {
		this.ok = false;
		this.name = null;
		this.type = null;
		this.action = null;
		this.time = 0;
		var h = this.file.h;
		var n_h = h;
		var n_keys = Object.keys(h);
		var n_length = n_keys.length;
		var n_current = 0;
		while(n_current < n_length) {
			var n = n_h[n_keys[n_current++]];
			var _this = this.file;
			if(Object.prototype.hasOwnProperty.call(_this.h,n)) {
				delete(_this.h[n]);
			}
		}
		this.file = null;
	}
	,toObject: function() {
		return { order : this.order, name : this.name, type : this.type, time : this.time, action : this.action, frames : this.frames, frtime : this.frtime, file : { "@1" : this.file.h["@1"], "@2" : this.file.h["@2"], "@3" : this.file.h["@3"], "@4" : this.file.h["@4"], "@5" : this.file.h["@5"]}};
	}
	,__class__: com_tilbuci_def_AssetData
};
var com_tilbuci_def_DefBase = function(rq) {
	this.reqFields = [];
	if(rq != null) {
		this.reqFields = rq;
	}
};
$hxClasses["com.tilbuci.def.DefBase"] = com_tilbuci_def_DefBase;
com_tilbuci_def_DefBase.__name__ = "com.tilbuci.def.DefBase";
com_tilbuci_def_DefBase.prototype = {
	reqFields: null
	,checkFields: function(data) {
		var ok = true;
		var _g = 0;
		var _g1 = this.reqFields.length;
		while(_g < _g1) {
			var n = _g++;
			if(!Object.prototype.hasOwnProperty.call(data.h,this.reqFields[n])) {
				ok = false;
			}
		}
		return ok;
	}
	,kill: function() {
		while(this.reqFields.length > 0) this.reqFields.shift();
		this.reqFields = null;
	}
	,__class__: com_tilbuci_def_DefBase
};
var com_tilbuci_def_CollectionData = function(id,acLoad,load) {
	if(load == null) {
		load = true;
	}
	this.assetOrder = [];
	this.assets = new haxe_ds_StringMap();
	this.time = 1;
	this.transition = "none";
	this.name = "";
	this.ok = false;
	com_tilbuci_def_DefBase.call(this,["name","transition","time","assets"]);
	this._acLoad = acLoad;
	if(load) {
		var cache = null;
		if(com_tilbuci_data_GlobalPlayer.nocache) {
			var _g = new haxe_ds_StringMap();
			var value = Math.ceil(Math.random() * 10000);
			_g.h["rand"] = value;
			cache = _g;
		}
		new com_tilbuci_data_DataLoader(true,id,"GET",cache,4,$bind(this,this.onLoad));
	}
};
$hxClasses["com.tilbuci.def.CollectionData"] = com_tilbuci_def_CollectionData;
com_tilbuci_def_CollectionData.__name__ = "com.tilbuci.def.CollectionData";
com_tilbuci_def_CollectionData.__super__ = com_tilbuci_def_DefBase;
com_tilbuci_def_CollectionData.prototype = $extend(com_tilbuci_def_DefBase.prototype,{
	ok: null
	,name: null
	,transition: null
	,time: null
	,assets: null
	,assetOrder: null
	,_acLoad: null
	,toJson: function() {
		return haxe_format_JsonPrinter.print(this.toObject(),null,null);
	}
	,fromJson: function(txt) {
		var data = com_tilbuci_statictools_StringStatic.jsonAsMap(txt);
		if(Object.prototype.hasOwnProperty.call(data.h,"name")) {
			this.ok = true;
			this.name = data.h["name"];
			this.transition = data.h["transition"];
			this.time = data.h["time"];
			var _g = 0;
			var _g1 = Reflect.fields(data.h["assets"]);
			while(_g < _g1.length) {
				var c = _g1[_g];
				++_g;
				var this1 = this.assets;
				var v = new com_tilbuci_def_AssetData(Reflect.field(data.h["assets"],c));
				this1.h[c] = v;
				this.assetOrder.push("");
			}
			var h = this.assets.h;
			var a_h = h;
			var a_keys = Object.keys(h);
			var a_length = a_keys.length;
			var a_current = 0;
			while(a_current < a_length) {
				var a = a_keys[a_current++];
				this.assetOrder[this.assets.h[a].order] = a;
			}
			return true;
		} else {
			return false;
		}
	}
	,toObject: function() {
		var asts = { };
		var h = this.assets.h;
		var k_h = h;
		var k_keys = Object.keys(h);
		var k_length = k_keys.length;
		var k_current = 0;
		while(k_current < k_length) {
			var k = k_keys[k_current++];
			asts[k] = this.assets.h[k].toObject();
		}
		return { name : this.name, transition : this.transition, time : this.time, assets : asts};
	}
	,cloneData: function() {
		var clone = { name : this.name, transition : this.transition, time : this.time, assets : this.assets, assetOrder : this.assetOrder};
		return clone;
	}
	,kill: function() {
		com_tilbuci_def_DefBase.prototype.kill.call(this);
		this.name = null;
		this.transition = null;
		var h = this.assets.h;
		var a_h = h;
		var a_keys = Object.keys(h);
		var a_length = a_keys.length;
		var a_current = 0;
		while(a_current < a_length) {
			var a = a_keys[a_current++];
			this.assets.h[a].kill();
			var _this = this.assets;
			if(Object.prototype.hasOwnProperty.call(_this.h,a)) {
				delete(_this.h[a]);
			}
		}
		this.assets = null;
		while(this.assetOrder.length > 0) this.assetOrder.shift();
		this.assetOrder = null;
	}
	,onLoad: function(ok,ld) {
		this.ok = false;
		if(ok) {
			if(this.checkFields(ld.map)) {
				this.ok = true;
				this.name = ld.map.h["name"];
				this.transition = ld.map.h["transition"];
				this.time = ld.map.h["time"];
				var _g = 0;
				var _g1 = Reflect.fields(ld.map.h["assets"]);
				while(_g < _g1.length) {
					var c = _g1[_g];
					++_g;
					var this1 = this.assets;
					var v = new com_tilbuci_def_AssetData(Reflect.field(ld.map.h["assets"],c));
					this1.h[c] = v;
					this.assetOrder.push("");
				}
				var h = this.assets.h;
				var a_h = h;
				var a_keys = Object.keys(h);
				var a_length = a_keys.length;
				var a_current = 0;
				while(a_current < a_length) {
					var a = a_keys[a_current++];
					this.assetOrder[this.assets.h[a].order] = a;
				}
			}
		}
		if(this._acLoad != null) {
			this._acLoad();
		}
		this._acLoad = null;
	}
	,__class__: com_tilbuci_def_CollectionData
});
var com_tilbuci_def_InstanceData = function(data) {
	this.playOnLoad = true;
	this.timedAc = new haxe_ds_StringMap();
	this.ok = true;
	if(this.ok && Object.prototype.hasOwnProperty.call(data,"collection")) {
		this.collection = Reflect.field(data,"collection");
	} else {
		this.ok = false;
	}
	if(this.ok && Object.prototype.hasOwnProperty.call(data,"asset")) {
		this.asset = Reflect.field(data,"asset");
	} else {
		this.ok = false;
	}
	if(this.ok && Object.prototype.hasOwnProperty.call(data,"action")) {
		this.action = Reflect.field(data,"action");
	} else {
		this.ok = false;
	}
	if(this.ok && Object.prototype.hasOwnProperty.call(data,"play")) {
		this.playOnLoad = Reflect.field(data,"play");
	} else {
		this.ok = false;
	}
	if(this.ok && Object.prototype.hasOwnProperty.call(data,"horizontal")) {
		this.horizontal = new com_tilbuci_def_InstanceDesc(Reflect.field(data,"horizontal"));
	} else {
		this.ok = false;
	}
	if(this.ok && Object.prototype.hasOwnProperty.call(data,"vertical")) {
		this.vertical = new com_tilbuci_def_InstanceDesc(Reflect.field(data,"vertical"));
	} else {
		this.ok = false;
	}
	if(this.ok) {
		if(!this.horizontal.ok || !this.vertical.ok) {
			this.ok = false;
		}
	}
	if(this.ok) {
		this.asset = HxOverrides.substr(this.asset,0,32);
	}
	if(this.ok && Object.prototype.hasOwnProperty.call(data,"actionover")) {
		this.actionover = Reflect.field(data,"actionover");
	} else {
		this.actionover = "";
	}
	if(this.ok && Object.prototype.hasOwnProperty.call(data,"timedac")) {
		var tmdac = Std.string(Reflect.field(data,"timedac"));
		if(tmdac == "") {
			this.timedAc = new haxe_ds_StringMap();
		} else {
			var js = com_tilbuci_statictools_StringStatic.jsonParse(tmdac);
			if(js == false) {
				this.timedAc = new haxe_ds_StringMap();
			} else {
				var _g = 0;
				var _g1 = Reflect.fields(js);
				while(_g < _g1.length) {
					var tm = _g1[_g];
					++_g;
					var v = Reflect.field(js,tm);
					this.timedAc.h[tm] = v;
				}
			}
		}
	} else {
		this.timedAc = new haxe_ds_StringMap();
	}
};
$hxClasses["com.tilbuci.def.InstanceData"] = com_tilbuci_def_InstanceData;
com_tilbuci_def_InstanceData.__name__ = "com.tilbuci.def.InstanceData";
com_tilbuci_def_InstanceData.prototype = {
	ok: null
	,collection: null
	,asset: null
	,action: null
	,actionover: null
	,timedAc: null
	,playOnLoad: null
	,horizontal: null
	,vertical: null
	,kill: function() {
		this.ok = false;
		this.collection = null;
		this.asset = null;
		this.action = null;
		this.actionover = null;
		this.horizontal.kill();
		this.horizontal = null;
		this.vertical.kill();
		this.vertical = null;
		var h = this.timedAc.h;
		var k_h = h;
		var k_keys = Object.keys(h);
		var k_length = k_keys.length;
		var k_current = 0;
		while(k_current < k_length) {
			var k = k_keys[k_current++];
			var _this = this.timedAc;
			if(Object.prototype.hasOwnProperty.call(_this.h,k)) {
				delete(_this.h[k]);
			}
		}
		this.timedAc = null;
	}
	,toObject: function() {
		var tmac = "";
		if(Lambda.count(this.timedAc) > 0) {
			tmac = com_tilbuci_statictools_StringStatic.jsonStringify(this.timedAc);
		}
		return { collection : this.collection, asset : this.asset, action : this.action, actionover : this.actionover, timedac : tmac, play : this.playOnLoad, horizontal : this.horizontal.toObject(), vertical : this.vertical.toObject()};
	}
	,toJson: function() {
		return com_tilbuci_statictools_StringStatic.jsonStringify(this.toObject());
	}
	,clone: function() {
		return new com_tilbuci_def_InstanceData(this.toObject());
	}
	,__class__: com_tilbuci_def_InstanceData
};
var com_tilbuci_def_InstanceDesc = function(data) {
	this.textAlign = "left";
	this.textBackground = "";
	this.textSpacing = 0;
	this.textLeading = 0;
	this.textItalic = false;
	this.textBold = false;
	this.textColor = "0xFFFFFF";
	this.textSize = 12;
	this.textFont = "_sans";
	this.glow = [];
	this.dropshadow = [];
	this.blur = [];
	this.blend = "normal";
	this.pan = 0;
	this.volume = 1;
	this.colorAlpha = 0;
	this.color = "0x000000";
	this.visible = true;
	this.rotation = 0;
	this.ok = true;
	if(this.ok && Object.prototype.hasOwnProperty.call(data,"order")) {
		this.order = Reflect.field(data,"order");
	} else {
		this.ok = false;
	}
	if(this.ok && Object.prototype.hasOwnProperty.call(data,"x")) {
		this.x = Reflect.field(data,"x");
	} else {
		this.ok = false;
	}
	if(this.ok && Object.prototype.hasOwnProperty.call(data,"y")) {
		this.y = Reflect.field(data,"y");
	} else {
		this.ok = false;
	}
	if(this.ok && Object.prototype.hasOwnProperty.call(data,"alpha")) {
		this.alpha = Reflect.field(data,"alpha");
	} else {
		this.ok = false;
	}
	if(this.ok && Object.prototype.hasOwnProperty.call(data,"width")) {
		this.width = Reflect.field(data,"width");
	} else {
		this.ok = false;
	}
	if(this.ok && Object.prototype.hasOwnProperty.call(data,"height")) {
		this.height = Reflect.field(data,"height");
	} else {
		this.ok = false;
	}
	if(this.ok && Object.prototype.hasOwnProperty.call(data,"rotation")) {
		this.rotation = Reflect.field(data,"rotation");
	} else {
		this.ok = false;
	}
	if(this.ok && Object.prototype.hasOwnProperty.call(data,"visible")) {
		this.visible = Reflect.field(data,"visible");
	} else {
		this.ok = false;
	}
	if(this.ok && Object.prototype.hasOwnProperty.call(data,"color")) {
		this.color = Reflect.field(data,"color");
	} else {
		this.ok = false;
	}
	if(this.ok && Object.prototype.hasOwnProperty.call(data,"colorAlpha")) {
		this.colorAlpha = Reflect.field(data,"colorAlpha");
	} else {
		this.ok = false;
	}
	if(this.ok && Object.prototype.hasOwnProperty.call(data,"volume")) {
		this.volume = Reflect.field(data,"volume");
	} else {
		this.ok = false;
	}
	if(this.ok && Object.prototype.hasOwnProperty.call(data,"pan")) {
		this.pan = Reflect.field(data,"pan");
	} else {
		this.ok = false;
	}
	if(this.ok && Object.prototype.hasOwnProperty.call(data,"blur")) {
		this.blur = Reflect.field(data,"blur").split(";");
		if(this.blur.length != 2) {
			this.blur = [];
		}
	} else {
		this.ok = false;
	}
	if(this.ok && Object.prototype.hasOwnProperty.call(data,"dropshadow")) {
		this.dropshadow = Reflect.field(data,"dropshadow").split(";");
		if(this.dropshadow.length != 8) {
			this.dropshadow = [];
		}
	} else {
		this.ok = false;
	}
	if(this.ok && Object.prototype.hasOwnProperty.call(data,"textFont")) {
		this.textFont = Reflect.field(data,"textFont");
	} else {
		this.ok = false;
	}
	if(this.ok && Object.prototype.hasOwnProperty.call(data,"textSize")) {
		this.textSize = Reflect.field(data,"textSize");
	} else {
		this.ok = false;
	}
	if(this.ok && Object.prototype.hasOwnProperty.call(data,"textColor")) {
		this.textColor = Reflect.field(data,"textColor");
	} else {
		this.ok = false;
	}
	if(this.ok && Object.prototype.hasOwnProperty.call(data,"textBold")) {
		this.textBold = Reflect.field(data,"textBold");
	} else {
		this.ok = false;
	}
	if(this.ok && Object.prototype.hasOwnProperty.call(data,"textItalic")) {
		this.textItalic = Reflect.field(data,"textItalic");
	} else {
		this.ok = false;
	}
	if(this.ok && Object.prototype.hasOwnProperty.call(data,"textLeading")) {
		this.textLeading = Reflect.field(data,"textLeading");
	} else {
		this.ok = false;
	}
	if(this.ok && Object.prototype.hasOwnProperty.call(data,"textSpacing")) {
		this.textSpacing = Reflect.field(data,"textSpacing");
	} else {
		this.ok = false;
	}
	if(this.ok && Object.prototype.hasOwnProperty.call(data,"textBackground")) {
		this.textBackground = Reflect.field(data,"textBackground");
	} else {
		this.ok = false;
	}
	if(this.ok && Object.prototype.hasOwnProperty.call(data,"textAlign")) {
		this.textAlign = Reflect.field(data,"textAlign");
	} else {
		this.ok = false;
	}
	if(this.ok && Object.prototype.hasOwnProperty.call(data,"glow")) {
		this.glow = Reflect.field(data,"glow").split(";");
		if(this.glow.length != 5) {
			this.glow = [];
		}
	} else {
		this.glow = [];
	}
	if(this.ok && Object.prototype.hasOwnProperty.call(data,"blend")) {
		this.blend = Reflect.field(data,"blend");
	} else {
		this.blend = "normal";
	}
};
$hxClasses["com.tilbuci.def.InstanceDesc"] = com_tilbuci_def_InstanceDesc;
com_tilbuci_def_InstanceDesc.__name__ = "com.tilbuci.def.InstanceDesc";
com_tilbuci_def_InstanceDesc.prototype = {
	ok: null
	,order: null
	,x: null
	,y: null
	,alpha: null
	,width: null
	,height: null
	,rotation: null
	,visible: null
	,color: null
	,colorAlpha: null
	,volume: null
	,pan: null
	,blend: null
	,blur: null
	,dropshadow: null
	,glow: null
	,textFont: null
	,textSize: null
	,textColor: null
	,textBold: null
	,textItalic: null
	,textLeading: null
	,textSpacing: null
	,textBackground: null
	,textAlign: null
	,kill: function() {
		this.ok = false;
		while(this.blur.length > 0) this.blur.shift();
		this.blur = null;
		while(this.dropshadow.length > 0) this.dropshadow.shift();
		this.dropshadow = null;
		while(this.glow.length > 0) this.glow.shift();
		this.glow = null;
		this.color = null;
		this.textFont = null;
		this.textColor = null;
		this.textBackground = null;
		this.textAlign = null;
		this.blend = null;
	}
	,toObject: function() {
		return { order : this.order, x : this.x, y : this.y, alpha : this.alpha, width : this.width, height : this.height, rotation : this.rotation, visible : this.visible, color : this.color, colorAlpha : this.colorAlpha, volume : this.volume, pan : this.pan, blur : this.blur.join(";"), dropshadow : this.dropshadow.join(";"), glow : this.glow.join(";"), blend : this.blend, textFont : this.textFont, textSize : this.textSize, textColor : this.textColor, textBold : this.textBold, textItalic : this.textItalic, textLeading : this.textLeading, textSpacing : this.textSpacing, textBackground : this.textBackground, textAlign : this.textAlign};
	}
	,__class__: com_tilbuci_def_InstanceDesc
};
var com_tilbuci_def_InterfaceLang = function(n,f) {
	this.name = n;
	this.file = f;
};
$hxClasses["com.tilbuci.def.InterfaceLang"] = com_tilbuci_def_InterfaceLang;
com_tilbuci_def_InterfaceLang.__name__ = "com.tilbuci.def.InterfaceLang";
com_tilbuci_def_InterfaceLang.prototype = {
	name: null
	,file: null
	,__class__: com_tilbuci_def_InterfaceLang
};
var com_tilbuci_def_MovieData = function() {
	this.inputs = new haxe_ds_StringMap();
	this.highlightInt = null;
	this.encrypted = false;
	this.loadingic = ["","",""];
	this.highlight = "";
	this.plugins = new haxe_ds_StringMap();
	this.flags = new haxe_ds_StringMap();
	this.numbers = new haxe_ds_StringMap();
	this.texts = new haxe_ds_StringMap();
	this.theme = "";
	this.actions = [];
	this.style = "";
	this.fonts = [];
	this.animation = "linear";
	this.origin = "center";
	this.time = 1;
	this.vsgroups = [];
	this.identify = false;
	com_tilbuci_def_DefBase.call(this,["version","title","author","copyright","copyleft","description","favicon","image","key","start","acstart","tags","screen","time","origin","animation","fonts","style","theme","texts","numbers","flags","plugins"]);
	this.screen = new com_tilbuci_def_MovieDataScreen();
	this.clear();
};
$hxClasses["com.tilbuci.def.MovieData"] = com_tilbuci_def_MovieData;
com_tilbuci_def_MovieData.__name__ = "com.tilbuci.def.MovieData";
com_tilbuci_def_MovieData.__super__ = com_tilbuci_def_DefBase;
com_tilbuci_def_MovieData.prototype = $extend(com_tilbuci_def_DefBase.prototype,{
	version: null
	,title: null
	,author: null
	,copyright: null
	,copyleft: null
	,description: null
	,favicon: null
	,image: null
	,key: null
	,fallback: null
	,identify: null
	,vsgroups: null
	,start: null
	,acstart: null
	,tags: null
	,screen: null
	,time: null
	,origin: null
	,animation: null
	,fonts: null
	,style: null
	,actions: null
	,theme: null
	,texts: null
	,numbers: null
	,flags: null
	,plugins: null
	,highlight: null
	,loadingic: null
	,encrypted: null
	,highlightInt: null
	,inputs: null
	,clear: function() {
		this.version = 0;
		this.title = "";
		this.author = "";
		this.copyright = "";
		this.copyleft = "";
		this.description = "";
		this.favicon = "";
		this.image = "";
		this.key = "";
		this.fallback = "";
		this.identify = false;
		this.vsgroups = [];
		this.start = "";
		this.acstart = "";
		this.tags = [];
		this.time = 1;
		this.origin = "center";
		this.animation = "linear";
		this.highlight = "";
		this.highlightInt = null;
		this.loadingic = ["","",""];
		this.encrypted = false;
		this.screen.clear();
		while(this.fonts.length > 0) {
			var ft = this.fonts.shift();
			ft.name = null;
			ft.file = null;
			ft = null;
		}
		while(this.actions.length > 0) {
			var ac = this.actions.shift();
			ac.name = null;
			ac.ac = null;
			ac = null;
		}
		this.style = "";
		this.theme = "";
		var h = this.texts.h;
		var t_h = h;
		var t_keys = Object.keys(h);
		var t_length = t_keys.length;
		var t_current = 0;
		while(t_current < t_length) {
			var t = t_keys[t_current++];
			var _this = this.texts;
			if(Object.prototype.hasOwnProperty.call(_this.h,t)) {
				delete(_this.h[t]);
			}
		}
		var h = this.numbers.h;
		var t_h = h;
		var t_keys = Object.keys(h);
		var t_length = t_keys.length;
		var t_current = 0;
		while(t_current < t_length) {
			var t = t_keys[t_current++];
			var _this = this.numbers;
			if(Object.prototype.hasOwnProperty.call(_this.h,t)) {
				delete(_this.h[t]);
			}
		}
		var h = this.flags.h;
		var t_h = h;
		var t_keys = Object.keys(h);
		var t_length = t_keys.length;
		var t_current = 0;
		while(t_current < t_length) {
			var t = t_keys[t_current++];
			var _this = this.flags;
			if(Object.prototype.hasOwnProperty.call(_this.h,t)) {
				delete(_this.h[t]);
			}
		}
		var h = this.plugins.h;
		var t_h = h;
		var t_keys = Object.keys(h);
		var t_length = t_keys.length;
		var t_current = 0;
		while(t_current < t_length) {
			var t = t_keys[t_current++];
			var _this = this.plugins;
			if(Object.prototype.hasOwnProperty.call(_this.h,t)) {
				delete(_this.h[t]);
			}
		}
		var h = com_tilbuci_data_GlobalPlayer.plugins.h;
		var n_h = h;
		var n_keys = Object.keys(h);
		var n_length = n_keys.length;
		var n_current = 0;
		while(n_current < n_length) {
			var n = n_keys[n_current++];
			com_tilbuci_data_GlobalPlayer.plugins.h[n].active = false;
		}
		com_tilbuci_data_GlobalPlayer.style.clear();
		var h = com_tilbuci_data_GlobalPlayer.mvActions.h;
		var ac_h = h;
		var ac_keys = Object.keys(h);
		var ac_length = ac_keys.length;
		var ac_current = 0;
		while(ac_current < ac_length) {
			var ac = ac_keys[ac_current++];
			var _this = com_tilbuci_data_GlobalPlayer.mvActions;
			if(Object.prototype.hasOwnProperty.call(_this.h,ac)) {
				delete(_this.h[ac]);
			}
		}
		motion_Actuate.defaultEase = motion_easing_Linear.get_easeNone();
		var _g = new haxe_ds_StringMap();
		_g.h["keyup"] = "up";
		_g.h["keydown"] = "down";
		_g.h["keyleft"] = "left";
		_g.h["keyright"] = "right";
		_g.h["keyspace"] = "";
		_g.h["keyenter"] = "target";
		_g.h["keypup"] = "nout";
		_g.h["keypdown"] = "nin";
		_g.h["keyhome"] = "nothing";
		_g.h["keyend"] = "nothing";
		_g.h["swiperight"] = "right";
		_g.h["swipeleft"] = "left";
		_g.h["swipetop"] = "up";
		_g.h["swipebottom"] = "down";
		_g.h["touchhold"] = "nothing";
		_g.h["pinchopen"] = "nothing";
		_g.h["pinchclose"] = "nothing";
		_g.h["mousemiddle"] = "nothing";
		_g.h["mouseright"] = "nothing";
		_g.h["mousewheelup"] = "nothing";
		_g.h["mousewheeldown"] = "nothing";
		this.inputs = _g;
	}
	,load: function(data) {
		if(this.checkFields(data)) {
			this.version = data.h["version"];
			this.title = data.h["title"];
			this.author = data.h["author"];
			this.copyright = data.h["copyright"];
			this.copyleft = data.h["copyleft"];
			this.description = data.h["description"];
			this.favicon = data.h["favicon"];
			this.image = data.h["image"];
			this.key = data.h["key"];
			this.start = data.h["start"];
			this.acstart = data.h["acstart"];
			this.tags = data.h["tags"];
			this.screen.big = data.h["screen"].big;
			this.screen.small = data.h["screen"].small;
			this.screen.type = data.h["screen"].type;
			this.screen.bgcolor = Std.parseInt(data.h["screen"].bgcolor);
			this.time = data.h["time"];
			this.origin = data.h["origin"];
			this.animation = data.h["animation"];
			this.fonts = data.h["fonts"];
			this.style = data.h["style"];
			this.actions = data.h["actions"];
			this.theme = data.h["theme"];
			if(Object.prototype.hasOwnProperty.call(data.h,"fallback")) {
				this.fallback = data.h["fallback"];
			} else {
				this.fallback = "";
			}
			if(Object.prototype.hasOwnProperty.call(data.h,"identify")) {
				this.identify = data.h["identify"];
			} else {
				this.identify = false;
			}
			if(Object.prototype.hasOwnProperty.call(data.h,"vsgroups")) {
				this.vsgroups = data.h["vsgroups"];
			} else {
				this.vsgroups = [];
			}
			if(this.vsgroups.length > 0) {
				this.identify = true;
			}
			if(Object.prototype.hasOwnProperty.call(data.h,"highlight")) {
				this.highlight = data.h["highlight"];
				this.highlightInt = Std.parseInt(this.highlight);
			} else {
				this.highlight = "";
				this.highlightInt = null;
			}
			if(Object.prototype.hasOwnProperty.call(data.h,"inputs")) {
				var _g = 0;
				var _g1 = Reflect.fields(data.h["inputs"]);
				while(_g < _g1.length) {
					var t = _g1[_g];
					++_g;
					var v = Reflect.field(data.h["inputs"],t);
					this.inputs.h[t] = v;
				}
			}
			if(Object.prototype.hasOwnProperty.call(data.h,"loadingic")) {
				if(data.h["loadingic"] == "") {
					this.loadingic = ["","",""];
				} else {
					this.loadingic = com_tilbuci_statictools_StringStatic.jsonParse(data.h["loadingic"]);
				}
			} else {
				this.loadingic = ["","",""];
			}
			if(Object.prototype.hasOwnProperty.call(data.h,"encrypted")) {
				this.encrypted = data.h["encrypted"];
			} else {
				this.encrypted = false;
			}
			com_tilbuci_data_GlobalPlayer.mdata = this;
			switch(this.animation) {
			case "bounce.in":
				motion_Actuate.defaultEase = motion_easing_Bounce.easeIn;
				break;
			case "bounce.inout":
				motion_Actuate.defaultEase = motion_easing_Bounce.easeInOut;
				break;
			case "bounce.out":
				motion_Actuate.defaultEase = motion_easing_Bounce.easeOut;
				break;
			case "cubic.in":
				motion_Actuate.defaultEase = motion_easing_Cubic.easeIn;
				break;
			case "cubic.inout":
				motion_Actuate.defaultEase = motion_easing_Cubic.easeInOut;
				break;
			case "cubic.out":
				motion_Actuate.defaultEase = motion_easing_Cubic.easeOut;
				break;
			case "elastic.in":
				motion_Actuate.defaultEase = motion_easing_Elastic.easeIn;
				break;
			case "elastic.inout":
				motion_Actuate.defaultEase = motion_easing_Elastic.easeInOut;
				break;
			case "elastic.out":
				motion_Actuate.defaultEase = motion_easing_Elastic.easeOut;
				break;
			case "expo.in":
				motion_Actuate.defaultEase = motion_easing_Expo.easeIn;
				break;
			case "expo.inout":
				motion_Actuate.defaultEase = motion_easing_Expo.easeInOut;
				break;
			case "expo.out":
				motion_Actuate.defaultEase = motion_easing_Expo.easeOut;
				break;
			case "quad.in":
				motion_Actuate.defaultEase = motion_easing_Quad.easeIn;
				break;
			case "quad.inout":
				motion_Actuate.defaultEase = motion_easing_Quad.easeInOut;
				break;
			case "quad.out":
				motion_Actuate.defaultEase = motion_easing_Quad.easeOut;
				break;
			case "quart.in":
				motion_Actuate.defaultEase = motion_easing_Quart.easeIn;
				break;
			case "quart.inout":
				motion_Actuate.defaultEase = motion_easing_Quart.easeInOut;
				break;
			case "quart.out":
				motion_Actuate.defaultEase = motion_easing_Quart.easeOut;
				break;
			case "quint.in":
				motion_Actuate.defaultEase = motion_easing_Quint.easeIn;
				break;
			case "quint.inout":
				motion_Actuate.defaultEase = motion_easing_Quint.easeInOut;
				break;
			case "quint.out":
				motion_Actuate.defaultEase = motion_easing_Quint.easeOut;
				break;
			case "sine.in":
				motion_Actuate.defaultEase = motion_easing_Sine.easeIn;
				break;
			case "sine.inout":
				motion_Actuate.defaultEase = motion_easing_Sine.easeInOut;
				break;
			case "sine.out":
				motion_Actuate.defaultEase = motion_easing_Sine.easeOut;
				break;
			default:
				this.animation = "linear";
				motion_Actuate.defaultEase = motion_easing_Linear.get_easeNone();
			}
			var _g = 0;
			var _g1 = this.fonts;
			while(_g < _g1.length) {
				var ft = _g1[_g];
				++_g;
				new com_tilbuci_font_EmbedFont(com_tilbuci_data_GlobalPlayer.path + "media/font/" + ft.file,ft.name,null,false);
			}
			var h = com_tilbuci_data_GlobalPlayer.mvActions.h;
			var ac_h = h;
			var ac_keys = Object.keys(h);
			var ac_length = ac_keys.length;
			var ac_current = 0;
			while(ac_current < ac_length) {
				var ac = ac_keys[ac_current++];
				var _this = com_tilbuci_data_GlobalPlayer.mvActions;
				if(Object.prototype.hasOwnProperty.call(_this.h,ac)) {
					delete(_this.h[ac]);
				}
			}
			var _g = 0;
			var _g1 = this.actions;
			while(_g < _g1.length) {
				var ac = _g1[_g];
				++_g;
				var v = ac.ac;
				com_tilbuci_data_GlobalPlayer.mvActions.h[ac.name] = v;
			}
			var h = this.texts.h;
			var t_h = h;
			var t_keys = Object.keys(h);
			var t_length = t_keys.length;
			var t_current = 0;
			while(t_current < t_length) {
				var t = t_keys[t_current++];
				var _this = this.texts;
				if(Object.prototype.hasOwnProperty.call(_this.h,t)) {
					delete(_this.h[t]);
				}
			}
			var _g = 0;
			var _g1 = Reflect.fields(data.h["texts"]);
			while(_g < _g1.length) {
				var t = _g1[_g];
				++_g;
				var v = Reflect.field(data.h["texts"],t);
				this.texts.h[t] = v;
			}
			var h = this.numbers.h;
			var t_h = h;
			var t_keys = Object.keys(h);
			var t_length = t_keys.length;
			var t_current = 0;
			while(t_current < t_length) {
				var t = t_keys[t_current++];
				var _this = this.numbers;
				if(Object.prototype.hasOwnProperty.call(_this.h,t)) {
					delete(_this.h[t]);
				}
			}
			var _g = 0;
			var _g1 = Reflect.fields(data.h["numbers"]);
			while(_g < _g1.length) {
				var t = _g1[_g];
				++_g;
				var v = Reflect.field(data.h["numbers"],t);
				this.numbers.h[t] = v;
			}
			var h = this.flags.h;
			var t_h = h;
			var t_keys = Object.keys(h);
			var t_length = t_keys.length;
			var t_current = 0;
			while(t_current < t_length) {
				var t = t_keys[t_current++];
				var _this = this.flags;
				if(Object.prototype.hasOwnProperty.call(_this.h,t)) {
					delete(_this.h[t]);
				}
			}
			var _g = 0;
			var _g1 = Reflect.fields(data.h["flags"]);
			while(_g < _g1.length) {
				var t = _g1[_g];
				++_g;
				var v = Reflect.field(data.h["flags"],t);
				this.flags.h[t] = v;
			}
			var h = com_tilbuci_data_GlobalPlayer.plugins.h;
			var n_h = h;
			var n_keys = Object.keys(h);
			var n_length = n_keys.length;
			var n_current = 0;
			while(n_current < n_length) {
				var n = n_keys[n_current++];
				com_tilbuci_data_GlobalPlayer.plugins.h[n].active = false;
			}
			var h = this.plugins.h;
			var t_h = h;
			var t_keys = Object.keys(h);
			var t_length = t_keys.length;
			var t_current = 0;
			while(t_current < t_length) {
				var t = t_keys[t_current++];
				var _this = this.plugins;
				if(Object.prototype.hasOwnProperty.call(_this.h,t)) {
					delete(_this.h[t]);
				}
			}
			var _g = 0;
			var _g1 = Reflect.fields(data.h["plugins"]);
			while(_g < _g1.length) {
				var t = _g1[_g];
				++_g;
				var v = Reflect.field(data.h["plugins"],t);
				this.plugins.h[t] = v;
			}
			this.applySets();
			return true;
		} else {
			return false;
		}
	}
	,applySets: function(clearvars) {
		if(clearvars == null) {
			clearvars = false;
		}
		com_tilbuci_data_GlobalPlayer.style.clear();
		com_tilbuci_data_GlobalPlayer.style.parseCSS(this.style);
		var h = com_tilbuci_data_GlobalPlayer.mvActions.h;
		var ac_h = h;
		var ac_keys = Object.keys(h);
		var ac_length = ac_keys.length;
		var ac_current = 0;
		while(ac_current < ac_length) {
			var ac = ac_keys[ac_current++];
			var _this = com_tilbuci_data_GlobalPlayer.mvActions;
			if(Object.prototype.hasOwnProperty.call(_this.h,ac)) {
				delete(_this.h[ac]);
			}
		}
		var _g = 0;
		var _g1 = this.actions;
		while(_g < _g1.length) {
			var ac = _g1[_g];
			++_g;
			var v = ac.ac;
			com_tilbuci_data_GlobalPlayer.mvActions.h[ac.name] = v;
		}
		if(clearvars) {
			com_tilbuci_data_GlobalPlayer.parser.clearVars();
		}
		var h = this.texts.h;
		var k_h = h;
		var k_keys = Object.keys(h);
		var k_length = k_keys.length;
		var k_current = 0;
		while(k_current < k_length) {
			var k = k_keys[k_current++];
			com_tilbuci_data_GlobalPlayer.parser.setString(k,this.texts.h[k]);
		}
		var h = this.flags.h;
		var k_h = h;
		var k_keys = Object.keys(h);
		var k_length = k_keys.length;
		var k_current = 0;
		while(k_current < k_length) {
			var k = k_keys[k_current++];
			com_tilbuci_data_GlobalPlayer.parser.setBool(k,this.flags.h[k]);
		}
		var h = this.numbers.h;
		var k_h = h;
		var k_keys = Object.keys(h);
		var k_length = k_keys.length;
		var k_current = 0;
		while(k_current < k_length) {
			var k = k_keys[k_current++];
			com_tilbuci_data_GlobalPlayer.parser.setFloat(k,this.numbers.h[k]);
			com_tilbuci_data_GlobalPlayer.parser.setInt(k,Math.round(this.numbers.h[k]));
		}
		var h = com_tilbuci_data_GlobalPlayer.plugins.h;
		var n_h = h;
		var n_keys = Object.keys(h);
		var n_length = n_keys.length;
		var n_current = 0;
		while(n_current < n_length) {
			var n = n_keys[n_current++];
			com_tilbuci_data_GlobalPlayer.plugins.h[n].active = false;
		}
		var h = com_tilbuci_data_GlobalPlayer.plugins.h;
		var t_h = h;
		var t_keys = Object.keys(h);
		var t_length = t_keys.length;
		var t_current = 0;
		while(t_current < t_length) {
			var t = t_keys[t_current++];
			if(Object.prototype.hasOwnProperty.call(this.plugins.h,t)) {
				com_tilbuci_data_GlobalPlayer.plugins.h[t].active = this.plugins.h[t].active;
				com_tilbuci_data_GlobalPlayer.plugins.h[t].setConfig(this.plugins.h[t].config);
			} else {
				com_tilbuci_data_GlobalPlayer.plugins.h[t].active = false;
			}
		}
		var applyTheme = true;
		if(Object.prototype.hasOwnProperty.call(Main,"mode")) {
			if(Reflect.field(Main,"mode") == "editor") {
				applyTheme = false;
			}
		}
		if(applyTheme) {
			com_tilbuci_data_GlobalPlayer.theme = new com_tilbuci_ui_PlayerTheme(this.theme);
			feathers_style_Theme.setTheme(com_tilbuci_data_GlobalPlayer.theme);
		}
		com_tilbuci_data_GlobalPlayer.contraptions.loadLoadingIc();
	}
	,toJson: function() {
		return haxe_format_JsonPrinter.print({ version : this.version, title : this.title, author : this.author, copyright : this.copyright, copyleft : this.copyleft, start : this.start, acstart : this.acstart, description : this.description, favicon : this.favicon, key : this.key, identify : this.identify, vsgroups : this.vsgroups, image : this.image, tags : this.tags, screen : { big : this.screen.big, small : this.screen.small, type : this.screen.type, bgcolor : "0x" + StringTools.hex(this.screen.bgcolor)}, time : this.time, origin : this.origin, animation : this.animation, fonts : this.fonts, highlight : this.highlight, loadingic : this.loadingic, encrypted : this.encrypted, inputs : this.inputs},null,null);
	}
	,kill: function() {
		com_tilbuci_def_DefBase.prototype.kill.call(this);
		this.title = null;
		this.author = null;
		this.copyright = null;
		this.copyleft = null;
		this.description = null;
		this.favicon = null;
		this.image = null;
		this.start = null;
		this.acstart = null;
		while(this.tags.length > 0) this.tags.shift();
		this.tags = null;
		this.screen.kill();
		this.screen = null;
		this.time = 1;
		this.origin = null;
		this.animation = null;
		while(this.fonts.length > 0) {
			var ft = this.fonts.shift();
			ft.name = null;
			ft.file = null;
			ft = null;
		}
		this.fonts = null;
		this.style = null;
		this.theme = null;
		while(this.actions.length > 0) {
			var ac = this.actions.shift();
			ac.name = null;
			ac.ac = null;
			ac = null;
		}
		this.actions = null;
		var h = this.texts.h;
		var t_h = h;
		var t_keys = Object.keys(h);
		var t_length = t_keys.length;
		var t_current = 0;
		while(t_current < t_length) {
			var t = t_keys[t_current++];
			var _this = this.texts;
			if(Object.prototype.hasOwnProperty.call(_this.h,t)) {
				delete(_this.h[t]);
			}
		}
		this.texts = null;
		var h = this.numbers.h;
		var t_h = h;
		var t_keys = Object.keys(h);
		var t_length = t_keys.length;
		var t_current = 0;
		while(t_current < t_length) {
			var t = t_keys[t_current++];
			var _this = this.numbers;
			if(Object.prototype.hasOwnProperty.call(_this.h,t)) {
				delete(_this.h[t]);
			}
		}
		this.numbers = null;
		var h = this.flags.h;
		var t_h = h;
		var t_keys = Object.keys(h);
		var t_length = t_keys.length;
		var t_current = 0;
		while(t_current < t_length) {
			var t = t_keys[t_current++];
			var _this = this.flags;
			if(Object.prototype.hasOwnProperty.call(_this.h,t)) {
				delete(_this.h[t]);
			}
		}
		this.flags = null;
		var h = this.plugins.h;
		var t_h = h;
		var t_keys = Object.keys(h);
		var t_length = t_keys.length;
		var t_current = 0;
		while(t_current < t_length) {
			var t = t_keys[t_current++];
			var _this = this.plugins;
			if(Object.prototype.hasOwnProperty.call(_this.h,t)) {
				delete(_this.h[t]);
			}
		}
		this.plugins = null;
		this.highlight = null;
		this.highlightInt = null;
		while(this.loadingic.length > 0) this.loadingic.shift();
		this.loadingic = null;
		var h = this.inputs.h;
		var k_h = h;
		var k_keys = Object.keys(h);
		var k_length = k_keys.length;
		var k_current = 0;
		while(k_current < k_length) {
			var k = k_keys[k_current++];
			var _this = this.inputs;
			if(Object.prototype.hasOwnProperty.call(_this.h,k)) {
				delete(_this.h[k]);
			}
		}
		this.inputs = null;
	}
	,__class__: com_tilbuci_def_MovieData
});
var com_tilbuci_def_MovieDataScreen = function() {
	this.clear();
};
$hxClasses["com.tilbuci.def.MovieDataScreen"] = com_tilbuci_def_MovieDataScreen;
com_tilbuci_def_MovieDataScreen.__name__ = "com.tilbuci.def.MovieDataScreen";
com_tilbuci_def_MovieDataScreen.prototype = {
	big: null
	,small: null
	,type: null
	,bgcolor: null
	,clear: function() {
		this.big = 0;
		this.small = 0;
		this.type = "";
		this.bgcolor = 0;
	}
	,kill: function() {
		this.type = null;
	}
	,__class__: com_tilbuci_def_MovieDataScreen
};
var com_tilbuci_def_SceneData = function() {
	this.dflow = [];
	this.navigation = new haxe_ds_StringMap();
	this.ackeyframes = [];
	this.acstart = "";
	this.loop = 0;
	this.keyframes = [];
	this.collections = [];
	this.staticsc = false;
	this.image = "";
	this.about = "";
	this.title = "";
	com_tilbuci_def_DefBase.call(this,["title","about","image","navigation","collections","keyframes","loop","acstart","ackeyframes"]);
	this.clear();
};
$hxClasses["com.tilbuci.def.SceneData"] = com_tilbuci_def_SceneData;
com_tilbuci_def_SceneData.__name__ = "com.tilbuci.def.SceneData";
com_tilbuci_def_SceneData.__super__ = com_tilbuci_def_DefBase;
com_tilbuci_def_SceneData.prototype = $extend(com_tilbuci_def_DefBase.prototype,{
	title: null
	,about: null
	,image: null
	,staticsc: null
	,collections: null
	,keyframes: null
	,loop: null
	,acstart: null
	,ackeyframes: null
	,navigation: null
	,dflow: null
	,clear: function() {
		this.title = "";
		this.about = "";
		this.image = "";
		this.staticsc = false;
		var h = this.navigation.h;
		var nv_h = h;
		var nv_keys = Object.keys(h);
		var nv_length = nv_keys.length;
		var nv_current = 0;
		while(nv_current < nv_length) {
			var nv = nv_keys[nv_current++];
			var _this = this.navigation;
			if(Object.prototype.hasOwnProperty.call(_this.h,nv)) {
				delete(_this.h[nv]);
			}
		}
		var _g = new haxe_ds_StringMap();
		_g.h["up"] = "";
		_g.h["down"] = "";
		_g.h["left"] = "";
		_g.h["right"] = "";
		_g.h["nin"] = "";
		_g.h["nout"] = "";
		this.navigation = _g;
		this.dflow = [["",""],["",""],["",""],["",""]];
		this.loop = 0;
		while(this.collections.length > 0) this.collections.shift();
		while(this.keyframes.length > 0) {
			var kf = this.keyframes.shift();
			var h = kf.h;
			var i_h = h;
			var i_keys = Object.keys(h);
			var i_length = i_keys.length;
			var i_current = 0;
			while(i_current < i_length) {
				var i = i_keys[i_current++];
				kf.h[i].kill();
				if(Object.prototype.hasOwnProperty.call(kf.h,i)) {
					delete(kf.h[i]);
				}
			}
		}
		this.acstart = "";
		while(this.ackeyframes.length > 0) this.ackeyframes.shift();
	}
	,load: function(data) {
		com_tilbuci_data_GlobalPlayer.contraptions.removeContraptions();
		com_tilbuci_data_GlobalPlayer.contraptions.usingDflow = false;
		if(this.checkFields(data)) {
			this.title = data.h["title"];
			this.about = data.h["about"];
			this.image = data.h["image"];
			var _g = new haxe_ds_StringMap();
			_g.h["up"] = data.h["navigation"].up;
			_g.h["down"] = data.h["navigation"].down;
			_g.h["left"] = data.h["navigation"].left;
			_g.h["right"] = data.h["navigation"].right;
			_g.h["nin"] = data.h["navigation"].nin;
			_g.h["nout"] = data.h["navigation"].nout;
			this.navigation = _g;
			while(this.collections.length > 0) this.collections.shift();
			var carr = data.h["collections"];
			if(carr.length > 0) {
				var _g = 0;
				while(_g < carr.length) {
					var v = carr[_g];
					++_g;
					this.collections.push(v);
				}
			}
			while(this.keyframes.length > 0) {
				var inst = this.keyframes.shift();
				var h = inst.h;
				var k_h = h;
				var k_keys = Object.keys(h);
				var k_length = k_keys.length;
				var k_current = 0;
				while(k_current < k_length) {
					var k = k_keys[k_current++];
					inst.h[k].kill();
					if(Object.prototype.hasOwnProperty.call(inst.h,k)) {
						delete(inst.h[k]);
					}
				}
			}
			var _g = 0;
			var _g1 = Reflect.fields(data.h["keyframes"]);
			while(_g < _g1.length) {
				var k = _g1[_g];
				++_g;
				var inst = new haxe_ds_StringMap();
				var _g2 = 0;
				var _g3 = Reflect.fields(Reflect.field(data.h["keyframes"],k));
				while(_g2 < _g3.length) {
					var i = _g3[_g2];
					++_g2;
					var v = new com_tilbuci_def_InstanceData(Reflect.field(Reflect.field(data.h["keyframes"],k),i));
					inst.h[i] = v;
				}
				this.keyframes.push(inst);
			}
			this.loop = data.h["loop"];
			if(this.loop >= this.keyframes.length || this.loop < 0) {
				this.loop = 0;
			}
			this.acstart = data.h["acstart"];
			while(this.ackeyframes.length > 0) this.ackeyframes.shift();
			var _g = 0;
			var _g1 = Reflect.fields(data.h["ackeyframes"]);
			while(_g < _g1.length) {
				var k = _g1[_g];
				++_g;
				this.ackeyframes.push(Reflect.field(data.h["ackeyframes"],k));
			}
			if(Object.prototype.hasOwnProperty.call(data.h,"staticsc")) {
				this.staticsc = data.h["staticsc"];
			} else {
				this.staticsc = false;
			}
			if(Object.prototype.hasOwnProperty.call(data.h,"dflow")) {
				this.dflow = [["",""],["",""],["",""],["",""]];
				var ki = 0;
				var _g = 0;
				var _g1 = Reflect.fields(data.h["dflow"]);
				while(_g < _g1.length) {
					var k = _g1[_g];
					++_g;
					var fl = Reflect.field(data.h["dflow"],k);
					if(fl != null) {
						this.dflow[ki] = fl;
					}
					++ki;
				}
			}
			com_tilbuci_data_GlobalPlayer.contraptions.hideLoadingIc();
			return true;
		} else {
			com_tilbuci_data_GlobalPlayer.contraptions.hideLoadingIc();
			return false;
		}
	}
	,toJson: function() {
		return haxe_format_JsonPrinter.print(this.toObject(),null,null);
	}
	,toObject: function() {
		var kfs = [];
		var _g = 0;
		var _g1 = this.keyframes.length;
		while(_g < _g1) {
			var n = _g++;
			var kf = { };
			var h = this.keyframes[n].h;
			var k_h = h;
			var k_keys = Object.keys(h);
			var k_length = k_keys.length;
			var k_current = 0;
			while(k_current < k_length) {
				var k = k_keys[k_current++];
				kf[k] = this.keyframes[n].h[k].toObject();
			}
			kfs.push(kf);
		}
		return { title : this.title, about : this.about, image : this.image, staticsc : this.staticsc, navigation : { up : this.navigation.h["up"], down : this.navigation.h["down"], left : this.navigation.h["left"], right : this.navigation.h["right"], nin : this.navigation.h["nin"], nout : this.navigation.h["nout"]}, dflow : this.dflow, collections : this.collections, loop : this.loop, acstart : this.acstart, ackeyframes : this.ackeyframes, keyframes : kfs};
	}
	,fromObject: function(obj) {
		if(Object.prototype.hasOwnProperty.call(obj,"title")) {
			this.title = Reflect.field(obj,"title");
		}
		if(Object.prototype.hasOwnProperty.call(obj,"about")) {
			this.about = Reflect.field(obj,"about");
		}
		if(Object.prototype.hasOwnProperty.call(obj,"image")) {
			this.image = Reflect.field(obj,"image");
		}
		if(Object.prototype.hasOwnProperty.call(obj,"staticsc")) {
			this.staticsc = Reflect.field(obj,"staticsc");
		}
		if(Object.prototype.hasOwnProperty.call(obj,"loop")) {
			this.loop = Reflect.field(obj,"loop");
		}
		if(Object.prototype.hasOwnProperty.call(obj,"acstart")) {
			this.acstart = Reflect.field(obj,"acstart");
		}
		if(Object.prototype.hasOwnProperty.call(obj,"ackeyframes")) {
			this.ackeyframes = Reflect.field(obj,"ackeyframes");
		}
		if(Object.prototype.hasOwnProperty.call(obj,"collections")) {
			this.collections = Reflect.field(obj,"collections");
		}
		if(Object.prototype.hasOwnProperty.call(obj,"navigation")) {
			var navigation = Reflect.field(obj,"navigation");
			if(Object.prototype.hasOwnProperty.call(navigation,"up")) {
				var v = Reflect.field(navigation,"up");
				this.navigation.h["up"] = v;
			}
			if(Object.prototype.hasOwnProperty.call(navigation,"down")) {
				var v = Reflect.field(navigation,"down");
				this.navigation.h["down"] = v;
			}
			if(Object.prototype.hasOwnProperty.call(navigation,"left")) {
				var v = Reflect.field(navigation,"left");
				this.navigation.h["left"] = v;
			}
			if(Object.prototype.hasOwnProperty.call(navigation,"right")) {
				var v = Reflect.field(navigation,"right");
				this.navigation.h["right"] = v;
			}
			if(Object.prototype.hasOwnProperty.call(navigation,"nin")) {
				var v = Reflect.field(navigation,"nin");
				this.navigation.h["nin"] = v;
			}
			if(Object.prototype.hasOwnProperty.call(navigation,"nout")) {
				var v = Reflect.field(navigation,"nout");
				this.navigation.h["nout"] = v;
			}
		}
		if(Object.prototype.hasOwnProperty.call(obj,"dflow")) {
			this.dflow = [["",""],["",""],["",""],["",""]];
			var dfobj = Reflect.field(obj,"dflow");
			var ki = 0;
			var _g = 0;
			var _g1 = Reflect.fields(dfobj);
			while(_g < _g1.length) {
				var k = _g1[_g];
				++_g;
				var fl = Reflect.field(dfobj,k);
				if(fl != null) {
					this.dflow[ki] = fl;
				}
				++ki;
			}
		}
		if(Object.prototype.hasOwnProperty.call(obj,"keyframes")) {
			while(this.keyframes.length > 0) {
				var kf = this.keyframes.shift();
				var h = kf.h;
				var k_h = h;
				var k_keys = Object.keys(h);
				var k_length = k_keys.length;
				var k_current = 0;
				while(k_current < k_length) {
					var k = k_keys[k_current++];
					kf.h[k].kill();
					if(Object.prototype.hasOwnProperty.call(kf.h,k)) {
						delete(kf.h[k]);
					}
				}
			}
			var kfs = Reflect.field(obj,"keyframes");
			var _g = 0;
			var _g1 = Reflect.fields(kfs);
			while(_g < _g1.length) {
				var k = _g1[_g];
				++_g;
				var inst = new haxe_ds_StringMap();
				var _g2 = 0;
				var _g3 = Reflect.fields(Reflect.field(kfs,k));
				while(_g2 < _g3.length) {
					var i = _g3[_g2];
					++_g2;
					var v = new com_tilbuci_def_InstanceData(Reflect.field(Reflect.field(kfs,k),i));
					inst.h[i] = v;
				}
				this.keyframes.push(inst);
			}
		}
	}
	,hasDflow: function() {
		if(!(this.dflow[0][1] != "" || this.dflow[1][1] != "" || this.dflow[2][1] != "")) {
			return this.dflow[3][1] != "";
		} else {
			return true;
		}
	}
	,kill: function() {
		com_tilbuci_def_DefBase.prototype.kill.call(this);
		this.title = null;
		this.about = null;
		this.image = null;
		var h = this.navigation.h;
		var nv_h = h;
		var nv_keys = Object.keys(h);
		var nv_length = nv_keys.length;
		var nv_current = 0;
		while(nv_current < nv_length) {
			var nv = nv_keys[nv_current++];
			var _this = this.navigation;
			if(Object.prototype.hasOwnProperty.call(_this.h,nv)) {
				delete(_this.h[nv]);
			}
		}
		this.navigation = null;
		while(this.collections.length > 0) this.collections.shift();
		this.collections = null;
		while(this.keyframes.length > 0) {
			var inst = this.keyframes.shift();
			var h = inst.h;
			var i_h = h;
			var i_keys = Object.keys(h);
			var i_length = i_keys.length;
			var i_current = 0;
			while(i_current < i_length) {
				var i = i_keys[i_current++];
				inst.h[i].kill();
				if(Object.prototype.hasOwnProperty.call(inst.h,i)) {
					delete(inst.h[i]);
				}
			}
		}
		while(this.dflow.length > 0) this.dflow.shift();
		this.dflow = null;
		this.keyframes = null;
		this.acstart = null;
		while(this.ackeyframes.length > 0) this.ackeyframes.shift();
		this.ackeyframes = null;
	}
	,__class__: com_tilbuci_def_SceneData
});
var com_tilbuci_def_TBArray = function() {
	this._cursor = -1;
	this._data = [];
	this._data = [];
	this._cursor = -1;
};
$hxClasses["com.tilbuci.def.TBArray"] = com_tilbuci_def_TBArray;
com_tilbuci_def_TBArray.__name__ = "com.tilbuci.def.TBArray";
com_tilbuci_def_TBArray.prototype = {
	_data: null
	,_cursor: null
	,kill: function() {
		while(this._data.length > 0) this._data.shift();
		this._data = null;
	}
	,current: function() {
		if(this._cursor < 0 && this._data.length > 0) {
			this._cursor = 0;
		}
		if(this._cursor >= 0 && this._data.length > this._cursor) {
			return com_tilbuci_data_GlobalPlayer.parser.parseString(this._data[this._cursor]);
		} else {
			return "";
		}
	}
	,currentInt: function() {
		if(this._cursor < 0 && this._data.length > 0) {
			this._cursor = 0;
		}
		if(this._cursor >= 0 && this._data.length > this._cursor) {
			return com_tilbuci_data_GlobalPlayer.parser.parseInt(this._data[this._cursor]);
		} else {
			return 0;
		}
	}
	,currentFloat: function() {
		if(this._cursor < 0 && this._data.length > 0) {
			this._cursor = 0;
		}
		if(this._cursor >= 0 && this._data.length > this._cursor) {
			return com_tilbuci_data_GlobalPlayer.parser.parseFloat(this._data[this._cursor]);
		} else {
			return 0;
		}
	}
	,currentBool: function() {
		if(this._cursor < 0 && this._data.length > 0) {
			this._cursor = 0;
		}
		if(this._cursor >= 0 && this._data.length > this._cursor) {
			return com_tilbuci_data_GlobalPlayer.parser.parseBool(this._data[this._cursor]);
		} else {
			return false;
		}
	}
	,next: function() {
		this._cursor++;
		if(this._data.length == 0) {
			this._cursor = -1;
		} else if(this._cursor >= this._data.length) {
			this._cursor = 0;
		} else if(this._cursor < 0) {
			this._cursor = this._data.length - 1;
		}
		return this.current();
	}
	,nextInt: function() {
		this._cursor++;
		if(this._data.length == 0) {
			this._cursor = -1;
		} else if(this._cursor >= this._data.length) {
			this._cursor = 0;
		} else if(this._cursor < 0) {
			this._cursor = this._data.length - 1;
		}
		return this.currentInt();
	}
	,nextFloat: function() {
		this._cursor++;
		if(this._data.length == 0) {
			this._cursor = -1;
		} else if(this._cursor >= this._data.length) {
			this._cursor = 0;
		} else if(this._cursor < 0) {
			this._cursor = this._data.length - 1;
		}
		return this.currentFloat();
	}
	,nextBool: function() {
		this._cursor++;
		if(this._data.length == 0) {
			this._cursor = -1;
		} else if(this._cursor >= this._data.length) {
			this._cursor = 0;
		} else if(this._cursor < 0) {
			this._cursor = this._data.length - 1;
		}
		return this.currentBool();
	}
	,previous: function() {
		this._cursor--;
		if(this._data.length == 0) {
			this._cursor = -1;
		} else if(this._cursor >= this._data.length) {
			this._cursor = 0;
		} else if(this._cursor < 0) {
			this._cursor = this._data.length - 1;
		}
		return this.current();
	}
	,previousInt: function() {
		this._cursor--;
		if(this._data.length == 0) {
			this._cursor = -1;
		} else if(this._cursor >= this._data.length) {
			this._cursor = 0;
		} else if(this._cursor < 0) {
			this._cursor = this._data.length - 1;
		}
		return this.currentInt();
	}
	,previousFloat: function() {
		this._cursor--;
		if(this._data.length == 0) {
			this._cursor = -1;
		} else if(this._cursor >= this._data.length) {
			this._cursor = 0;
		} else if(this._cursor < 0) {
			this._cursor = this._data.length - 1;
		}
		return this.currentFloat();
	}
	,previousBool: function() {
		this._cursor--;
		if(this._data.length == 0) {
			this._cursor = -1;
		} else if(this._cursor >= this._data.length) {
			this._cursor = 0;
		} else if(this._cursor < 0) {
			this._cursor = this._data.length - 1;
		}
		return this.currentBool();
	}
	,setIndex: function(to) {
		if(this._data.length == 0) {
			this._cursor = -1;
		} else if(to >= this._data.length) {
			this._cursor = this._data.length - 1;
		} else if(to < 0) {
			this._cursor = 0;
		} else {
			this._cursor = to;
		}
	}
	,currentIndex: function() {
		return this._cursor;
	}
	,toJson: function() {
		return com_tilbuci_statictools_StringStatic.jsonStringify(this._data);
	}
	,fromJson: function(txt) {
		this._data = com_tilbuci_statictools_StringStatic.jsonParse(txt);
		if(this._data == null) {
			this._data = [];
			this._cursor = -1;
			return false;
		} else if(this._data.length > 0) {
			this._cursor = 0;
			return true;
		} else {
			this._cursor = -1;
			return false;
		}
	}
	,push: function(val) {
		this._data.push(val);
	}
	,clear: function() {
		while(this._data.length > 0) this._data.shift();
		this._cursor = -1;
	}
	,set: function(index,val) {
		if(index >= 0) {
			while(this._data.length <= index) this._data.push("");
			this._data[index] = val;
		}
	}
	,get: function(index) {
		if(index >= 0 && this._data.length > index) {
			return com_tilbuci_data_GlobalPlayer.parser.parseString(this._data[index]);
		} else {
			return "";
		}
	}
	,getInt: function(index) {
		if(index >= 0 && this._data.length > index) {
			return com_tilbuci_data_GlobalPlayer.parser.parseInt(this._data[index]);
		} else {
			return 0;
		}
	}
	,getFloat: function(index) {
		if(index >= 0 && this._data.length > index) {
			return com_tilbuci_data_GlobalPlayer.parser.parseFloat(this._data[index]);
		} else {
			return 0;
		}
	}
	,getBool: function(index) {
		if(index >= 0 && this._data.length > index) {
			return com_tilbuci_data_GlobalPlayer.parser.parseBool(this._data[index]);
		} else {
			return false;
		}
	}
	,__class__: com_tilbuci_def_TBArray
};
var com_tilbuci_display_HtmlImage = function(ol) {
	this._scrollPos = 0;
	com_tilbuci_display_BaseImage.call(this,"html",false,ol);
	this._text = new openfl_text_TextField();
	this._text.set_selectable(false);
	this._format = new openfl_text_TextFormat();
	this._format.align = 3;
	this._text.set_defaultTextFormat(this._format);
	this._text.set_wordWrap(true);
	this._text.set_multiline(true);
	this._text.set_embedFonts(true);
	this._text.set_cacheAsBitmap(true);
	this._text.condenseWhite = true;
	this._text.set_styleSheet(com_tilbuci_data_GlobalPlayer.style);
	this.addChild(this._text);
	this._loader = new openfl_net_URLLoader();
	this._loader.addEventListener("complete",$bind(this,this.onOk));
	this._loader.addEventListener("ioError",$bind(this,this.onError));
	this._loader.addEventListener("securityError",$bind(this,this.onError));
};
$hxClasses["com.tilbuci.display.HtmlImage"] = com_tilbuci_display_HtmlImage;
com_tilbuci_display_HtmlImage.__name__ = "com.tilbuci.display.HtmlImage";
com_tilbuci_display_HtmlImage.__super__ = com_tilbuci_display_BaseImage;
com_tilbuci_display_HtmlImage.prototype = $extend(com_tilbuci_display_BaseImage.prototype,{
	_text: null
	,_format: null
	,_loader: null
	,_scrollPos: null
	,setFormat: function(font,size,color,bold,italic,leading,spacing,bg,align) {
		this._format.set_font(font);
		this._format.set_size(size);
		this._format.color = Std.parseInt(color);
		this._format.set_bold(bold);
		this._format.set_italic(italic);
		this._format.leading = leading;
		this._format.letterSpacing = spacing;
		switch(align) {
		case "center":
			this._format.align = 0;
			break;
		case "justify":
			this._format.align = 2;
			break;
		case "right":
			this._format.align = 4;
			break;
		default:
			this._format.align = 3;
		}
		this._text.set_defaultTextFormat(this._format);
		if(bg == "") {
			this._text.set_background(false);
		} else {
			this._text.set_backgroundColor(Std.parseInt(bg));
			this._text.set_background(true);
		}
	}
	,setTextSize: function(wd,ht) {
		this._text.set_width(this.oWidth = wd);
		this._text.set_height(this.oHeight = ht);
		this._text.set_scrollV(this._scrollPos);
	}
	,textScroll: function(val) {
		switch(val) {
		case -1:
			if(this._scrollPos > 0) {
				this._scrollPos = this._text.set_scrollV(this._scrollPos - 1);
			}
			break;
		case 0:
			this._scrollPos = this._text.set_scrollV(0);
			break;
		case 1:
			if(this._scrollPos < this._text.get_maxScrollV()) {
				this._scrollPos = this._text.set_scrollV(this._scrollPos + 1);
			}
			break;
		case 2:
			this._scrollPos = this._text.set_scrollV(this._text.get_maxScrollV());
			break;
		}
	}
	,setText: function(txt) {
		txt = com_tilbuci_data_GlobalPlayer.parser.parseString(txt);
		this._text.set_htmlText(txt);
		this._scrollPos = this._text.set_scrollV(0);
	}
	,getText: function() {
		return this._text.get_text();
	}
	,load: function(media) {
		media = StringTools.replace(media,com_tilbuci_data_GlobalPlayer.path + "media/html/","");
		var path = com_tilbuci_data_GlobalPlayer.parser.parsePath(com_tilbuci_data_GlobalPlayer.path + "media/html/" + media);
		this._loader.load(new openfl_net_URLRequest(path));
	}
	,kill: function() {
		com_tilbuci_display_BaseImage.prototype.kill.call(this);
		this._loader.removeEventListener("complete",$bind(this,this.onOk));
		this._loader.removeEventListener("ioError",$bind(this,this.onError));
		this._loader.removeEventListener("securityError",$bind(this,this.onError));
		this._loader = null;
		this._text = null;
		this._format = null;
	}
	,onOk: function(evt) {
		var txt = this._loader.data;
		this._text.set_htmlText(com_tilbuci_data_GlobalPlayer.parser.parseString(txt));
		this.oWidth = this._text.get_width();
		this.oHeight = this._text.get_height();
		this._onLoad(true);
	}
	,onError: function(evt) {
		this._text.set_htmlText("");
		this._onLoad(false);
	}
	,__class__: com_tilbuci_display_HtmlImage
});
var com_tilbuci_display_InstanceImage = function(nm,onSel) {
	this.selected = false;
	this._dragging = false;
	this._changeAsset = "";
	this._playOnLoad = true;
	this._firstLoad = true;
	this.keep = true;
	this._asset = "";
	this._collection = "";
	this._path = "";
	this._current = 1;
	this.lastClick = new openfl_geom_Point();
	openfl_display_Sprite.call(this);
	this._name = nm;
	this._onSelect = onSel;
	this._display = new openfl_display_Sprite();
	this._mask = new openfl_display_Shape();
	this._mask.get_graphics().beginFill(0);
	this._mask.get_graphics().drawRect(0,0,64,64);
	this._mask.get_graphics().endFill();
	this.addChild(this._display);
	this.addChild(this._mask);
	this._display.set_mask(this._mask);
	this._im1 = new com_tilbuci_display_TilBuciImage($bind(this,this.onLoad),nm,$bind(this,this.onTimedAc));
	this._im2 = new com_tilbuci_display_TilBuciImage($bind(this,this.onLoad),nm,$bind(this,this.onTimedAc));
	this._imCurrent = this._im1;
	this._imOther = this._im2;
	this._current = 1;
	this._display.addChild(this._im1);
	this._display.addChild(this._im2);
	this._multSize = new openfl_geom_Point(1,1);
	if(com_tilbuci_data_GlobalPlayer.mdata.origin != "none") {
		this.set_alpha(0);
	}
	this.set_rotation(0);
	if(com_tilbuci_data_GlobalPlayer.movie.data.screen.type == "landscape") {
		this.set_x(com_tilbuci_data_GlobalPlayer.mdata.screen.big / 2);
		this.set_y(com_tilbuci_data_GlobalPlayer.mdata.screen.small / 2);
	} else if(com_tilbuci_data_GlobalPlayer.movie.data.screen.type == "portrait") {
		this.set_x(com_tilbuci_data_GlobalPlayer.mdata.screen.small / 2);
		this.set_y(com_tilbuci_data_GlobalPlayer.mdata.screen.big / 2);
	} else if(com_tilbuci_data_GlobalPlayer.orientation == "horizontal") {
		this.set_x(com_tilbuci_data_GlobalPlayer.mdata.screen.big / 2);
		this.set_y(com_tilbuci_data_GlobalPlayer.mdata.screen.small / 2);
	} else {
		this.set_x(com_tilbuci_data_GlobalPlayer.mdata.screen.small / 2);
		this.set_y(com_tilbuci_data_GlobalPlayer.mdata.screen.big / 2);
	}
	this._lastH = this._lastW = this.set_width(this.set_height(10));
	this._set = new com_tilbuci_display_ImageSet();
	this.addEventListener("mouseDown",$bind(this,this.onClick));
	this.addEventListener("mouseOver",$bind(this,this.onMouseOver));
	this.addEventListener("mouseOut",$bind(this,this.onMouseOut));
};
$hxClasses["com.tilbuci.display.InstanceImage"] = com_tilbuci_display_InstanceImage;
com_tilbuci_display_InstanceImage.__name__ = "com.tilbuci.display.InstanceImage";
com_tilbuci_display_InstanceImage.__super__ = openfl_display_Sprite;
com_tilbuci_display_InstanceImage.prototype = $extend(openfl_display_Sprite.prototype,{
	lastClick: null
	,_name: null
	,_display: null
	,_mask: null
	,_im1: null
	,_im2: null
	,_imCurrent: null
	,_imOther: null
	,_current: null
	,_data: null
	,_multSize: null
	,_desc: null
	,_path: null
	,_lastW: null
	,_lastH: null
	,_collection: null
	,_asset: null
	,keep: null
	,_firstLoad: null
	,_playOnLoad: null
	,_set: null
	,_changeAsset: null
	,_dragging: null
	,_onSelect: null
	,selected: null
	,playing: null
	,get_playing: function() {
		return this._imCurrent.get_playing();
	}
	,currentType: null
	,get_currentType: function() {
		return this._imCurrent.get_currentType();
	}
	,currentMedia: null
	,get_currentMedia: function() {
		return this._imCurrent.get_currentMedia();
	}
	,displayWidth: null
	,get_displayWidth: function() {
		if(com_tilbuci_data_GlobalPlayer.orientation == "horizontal") {
			return this._data.horizontal.width;
		} else {
			return this._data.vertical.width;
		}
	}
	,displayHeight: null
	,get_displayHeight: function() {
		if(com_tilbuci_data_GlobalPlayer.orientation == "horizontal") {
			return this._data.horizontal.height;
		} else {
			return this._data.vertical.height;
		}
	}
	,transition: null
	,get_transition: function() {
		if(Object.prototype.hasOwnProperty.call(com_tilbuci_data_GlobalPlayer.movie.collections.h,this._collection)) {
			return com_tilbuci_data_GlobalPlayer.movie.collections.h[this._collection].transition;
		} else {
			return "";
		}
	}
	,get_width: function() {
		if(this._mask != null) {
			return this._mask.get_width();
		} else {
			return openfl_display_Sprite.prototype.get_width.call(this);
		}
	}
	,get_height: function() {
		if(this._mask != null) {
			return this._mask.get_height();
		} else {
			return openfl_display_Sprite.prototype.get_height.call(this);
		}
	}
	,set_width: function(to) {
		if(this._mask != null) {
			this._mask.set_width(to);
			this._im1.set_width(to);
			this._im2.set_width(to);
		}
		return to;
	}
	,set_height: function(to) {
		if(this._mask != null) {
			this._mask.set_height(to);
			this._im1.set_height(to);
			this._im2.set_height(to);
		}
		return to;
	}
	,changeId: function(oldid,newid) {
		if(this._name == oldid) {
			this._name = newid;
			return true;
		} else {
			return false;
		}
	}
	,load: function(inf) {
		if(inf.ok) {
			if(Object.prototype.hasOwnProperty.call(com_tilbuci_data_GlobalPlayer.movie.collections.h,inf.collection)) {
				if(com_tilbuci_data_GlobalPlayer.movie.collections.h[inf.collection].ok && Object.prototype.hasOwnProperty.call(com_tilbuci_data_GlobalPlayer.movie.collections.h[inf.collection].assets.h,inf.asset)) {
					this._data = inf;
					var pth = com_tilbuci_data_GlobalPlayer.movie.collections.h[inf.collection].assets.h[inf.asset].file.h["@" + com_tilbuci_data_GlobalPlayer.multiply];
					if(pth == this._path) {
						return true;
					} else {
						this._path = pth;
						this._playOnLoad = inf.playOnLoad;
						if(this._imOther.load(inf)) {
							this._collection = inf.collection;
							this._asset = inf.asset;
							this._imCurrent.stopTimer();
							return true;
						} else {
							this.set_visible(false);
							return false;
						}
					}
				} else {
					this.set_visible(false);
					return false;
				}
			} else {
				this.set_visible(false);
				return false;
			}
		} else {
			this.set_visible(false);
			return false;
		}
	}
	,getProp: function(name) {
		switch(name) {
		case "alpha":
			return this._desc.alpha;
		case "colorAlpha":
			return this._desc.colorAlpha;
		case "fontLeading":
			return this._imCurrent.getProp("fontLeading");
		case "fontSize":
			return this._imCurrent.getProp("fontSize");
		case "fontSpacing":
			return this._imCurrent.getProp("fontSpacing");
		case "height":
			return this._desc.height;
		case "order":
			return this._desc.order;
		case "pan":
			return this._desc.pan;
		case "rotation":
			return this._desc.rotation;
		case "volume":
			return this._desc.volume;
		case "width":
			return this._desc.width;
		case "x":
			return this._desc.x;
		case "y":
			return this._desc.y;
		default:
			return 0;
		}
	}
	,getBoolProp: function(name) {
		switch(name) {
		case "fontBold":
			return this._imCurrent.getBoolProp("fontBold");
		case "fontItalic":
			return this._imCurrent.getBoolProp("fontItalic");
		case "visible":
			return this.get_visible();
		default:
			return false;
		}
	}
	,getStringProp: function(name) {
		switch(name) {
		case "color":
			return this._desc.color;
		case "font":
			return this._imCurrent.getStringProp("font");
		case "fontColor":
			return this._imCurrent.getStringProp("fontColor");
		case "text":
			return this._imCurrent.getStringProp("text");
		default:
			return "";
		}
	}
	,kill: function() {
		this.removeEventListener("mouseDown",$bind(this,this.onClick));
		this.removeEventListener("mouseOver",$bind(this,this.onMouseOver));
		this.removeEventListener("mouseOut",$bind(this,this.onMouseOut));
		this.removeChildren();
		this._display.set_mask(null);
		this._display.removeChildren();
		this._display = null;
		this._mask.get_graphics().clear();
		this._mask = null;
		this._imCurrent = null;
		this._imOther = null;
		this._im1.kill();
		this._im1 = null;
		this._im2.kill();
		this._im2 = null;
		this._data = null;
		this._multSize = null;
		this._desc = null;
		this._path = null;
		this._set.kill();
		this._set = null;
		this._collection = null;
		this._asset = null;
		this._changeAsset = null;
		this._onSelect = null;
	}
	,place: function() {
		motion_Actuate.stop(this,null,false,false);
		if(this.keep && this._data != null) {
			this._set.load(this._data.horizontal,this._data.vertical);
			if(com_tilbuci_data_GlobalPlayer.movie.data.screen.type == "landscape") {
				this._desc = this._set.horizontal;
			} else if(com_tilbuci_data_GlobalPlayer.movie.data.screen.type == "portrait") {
				this._desc = this._set.vertical;
			} else if(com_tilbuci_data_GlobalPlayer.orientation == "horizontal") {
				this._desc = this._set.horizontal;
			} else {
				this._desc = this._set.vertical;
			}
			this._lastW = this._multSize.x * this._desc.width;
			this._lastH = this._multSize.y * this._desc.height;
			this._imCurrent.formatText(this._desc.textFont,this._desc.textSize,this._desc.textColor,this._desc.textBold,this._desc.textItalic,this._desc.textLeading,this._desc.textSpacing,this._desc.textBackground,this._desc.textAlign);
			this._imCurrent.setTextSize(this._desc.width,this._desc.height);
			motion_Actuate.tween(this,com_tilbuci_data_GlobalPlayer.mdata.time,{ x : this._desc.x, y : this._desc.y, width : this._multSize.x * this._desc.width, height : this._multSize.y * this._desc.height, alpha : this._desc.alpha, rotation : this._desc.rotation}).smartRotation().autoVisible(false);
			motion_Actuate.transform(this,com_tilbuci_data_GlobalPlayer.mdata.time).color(Std.parseInt(this._desc.color),this._desc.colorAlpha);
			this._imOther.stopSound();
			this._imCurrent.stopSound();
			this._imCurrent.iterateSound(this._desc.volume,this._desc.pan);
			var ft = [];
			if(this._desc.dropshadow.length == 8) {
				ft.push(new openfl_filters_DropShadowFilter(Std.parseInt(this._desc.dropshadow[0]),parseFloat(this._desc.dropshadow[1]),Std.parseInt(this._desc.dropshadow[2]),parseFloat(this._desc.dropshadow[3]),parseFloat(this._desc.dropshadow[4]),parseFloat(this._desc.dropshadow[5]),parseFloat(this._desc.dropshadow[6]),1,this._desc.dropshadow[7] == "1"));
			}
			if(this._desc.blur.length == 2) {
				ft.push(new openfl_filters_BlurFilter(parseFloat(this._desc.blur[0]),parseFloat(this._desc.blur[1])));
			}
			if(this._desc.glow.length == 5) {
				ft.push(new openfl_filters_GlowFilter(Std.parseInt(this._desc.glow[0]),parseFloat(this._desc.glow[1]),Std.parseInt(this._desc.glow[2]),Std.parseInt(this._desc.glow[2]),Std.parseInt(this._desc.glow[3]),1,this._desc.glow[4] == "1"));
			}
			this.set_filters(ft);
			switch(this._desc.blend) {
			case "add":
				this.set_blendMode(0);
				break;
			case "difference":
				this.set_blendMode(3);
				break;
			case "invert":
				this.set_blendMode(6);
				break;
			case "multiply":
				this.set_blendMode(9);
				break;
			case "screen":
				this.set_blendMode(12);
				break;
			case "subtract":
				this.set_blendMode(14);
				break;
			default:
				this.set_blendMode(10);
			}
			if(com_tilbuci_data_GlobalPlayer.mode == "editor") {
				motion_Actuate.stop(this,null,true);
			}
			this.set_visible(this._desc.visible);
		} else {
			var endX = this.get_x();
			var endY = this.get_y();
			var endW = this.get_width();
			var endH = this.get_height();
			var endAlpha = this.get_alpha();
			var screenW;
			var screenH;
			if(com_tilbuci_data_GlobalPlayer.movie.data.screen.type == "landscape") {
				screenW = com_tilbuci_data_GlobalPlayer.mdata.screen.big;
				screenH = com_tilbuci_data_GlobalPlayer.mdata.screen.small;
			} else if(com_tilbuci_data_GlobalPlayer.movie.data.screen.type == "portrait") {
				screenH = com_tilbuci_data_GlobalPlayer.mdata.screen.big;
				screenW = com_tilbuci_data_GlobalPlayer.mdata.screen.small;
			} else if(com_tilbuci_data_GlobalPlayer.orientation == "horizontal") {
				screenW = com_tilbuci_data_GlobalPlayer.mdata.screen.big;
				screenH = com_tilbuci_data_GlobalPlayer.mdata.screen.small;
			} else {
				screenH = com_tilbuci_data_GlobalPlayer.mdata.screen.big;
				screenW = com_tilbuci_data_GlobalPlayer.mdata.screen.small;
			}
			switch(com_tilbuci_data_GlobalPlayer.mdata.origin) {
			case "alpha":
				endAlpha = 0;
				break;
			case "bottom":
				endY = -10 - this.get_height();
				break;
			case "bottomkeep":
				endY = -10 - screenH + this.get_y();
				break;
			case "left":
				endX = screenW + 10;
				break;
			case "leftkeep":
				endX = screenW + 10 + this.get_x();
				break;
			case "none":
				this.set_alpha(0);
				endAlpha = 0;
				break;
			case "right":
				endX = -10 - this.get_width();
				break;
			case "rightkeep":
				endX = -10 - screenW + this.get_x();
				break;
			case "top":
				endY = screenH + 10;
				break;
			case "topkeep":
				endY = screenH + 10 + this.get_y();
				break;
			default:
				endW = 1;
				endH = 1;
				endX = screenW / 2;
				endY = screenH / 2;
				endAlpha = 0;
			}
			motion_Actuate.tween(this,com_tilbuci_data_GlobalPlayer.mdata.time,{ x : endX, y : endY, width : endW, height : endH, alpha : endAlpha}).autoVisible(false);
			this.pause();
		}
		if(this._desc != null) {
			this.parent.swapChildrenAt(this.parent.getChildIndex(this),this._desc.order);
		}
	}
	,setTextSize: function(w,h) {
		this._imCurrent.setTextSize(w,h);
		this._imOther.setTextSize(w,h);
		this._mask.set_width(this._im1.set_width(this._im2.get_width()));
		this._mask.set_height(this._im1.set_height(this._im2.get_height()));
	}
	,formatText: function(font,size,color,bold,italic,leading,spacing,bg,align) {
		this._imCurrent.formatText(font,size,color,bold,italic,leading,spacing,bg,align);
		this._imOther.formatText(font,size,color,bold,italic,leading,spacing,bg,align);
	}
	,getOrder: function() {
		var ord = 0;
		if(com_tilbuci_data_Global.displayType == "portrait") {
			ord = com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[com_tilbuci_data_GlobalPlayer.area.get_currentKf()].h[this._name].vertical.order;
		} else {
			ord = com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[com_tilbuci_data_GlobalPlayer.area.get_currentKf()].h[this._name].horizontal.order;
		}
		return ord;
	}
	,setOrder: function(to,updDisplay) {
		if(updDisplay == null) {
			updDisplay = true;
		}
		if(com_tilbuci_data_Global.displayType == "portrait") {
			com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[com_tilbuci_data_GlobalPlayer.area.get_currentKf()].h[this._name].vertical.order = to;
		} else {
			com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[com_tilbuci_data_GlobalPlayer.area.get_currentKf()].h[this._name].horizontal.order = to;
		}
		if(updDisplay) {
			this.parent.swapChildrenAt(this.parent.getChildIndex(this),to);
		}
	}
	,next: function() {
		var next = this._imCurrent.assetOrder + 1;
		if(next >= com_tilbuci_data_GlobalPlayer.movie.collections.h[this._collection].assetOrder.length) {
			next = 0;
		}
		this._imCurrent.stopTimer();
		this._changeAsset = "next";
		this._imOther.loadAsset(com_tilbuci_data_GlobalPlayer.movie.collections.h[this._collection].assets.h[com_tilbuci_data_GlobalPlayer.movie.collections.h[this._collection].assetOrder[next]]);
	}
	,previous: function() {
		var prev = this._imCurrent.assetOrder - 1;
		if(prev < 0) {
			prev = com_tilbuci_data_GlobalPlayer.movie.collections.h[this._collection].assetOrder.length - 1;
		}
		this._imCurrent.stopTimer();
		this._changeAsset = "previous";
		this._imOther.loadAsset(com_tilbuci_data_GlobalPlayer.movie.collections.h[this._collection].assets.h[com_tilbuci_data_GlobalPlayer.movie.collections.h[this._collection].assetOrder[prev]]);
	}
	,loadAsset: function(name) {
		if(Object.prototype.hasOwnProperty.call(com_tilbuci_data_GlobalPlayer.movie.collections.h[this._collection].assets.h,name)) {
			this._imCurrent.stopTimer();
			this._changeAsset = "set";
			this._imOther.loadAsset(com_tilbuci_data_GlobalPlayer.movie.collections.h[this._collection].assets.h[name]);
			return true;
		} else {
			return false;
		}
	}
	,loadCollectionAsset: function(col,ast) {
		if(Object.prototype.hasOwnProperty.call(com_tilbuci_data_GlobalPlayer.movie.collections.h,col)) {
			if(Object.prototype.hasOwnProperty.call(com_tilbuci_data_GlobalPlayer.movie.collections.h[col].assets.h,ast)) {
				this._imCurrent.stopTimer();
				this._changeAsset = "set";
				this._imOther.loadAsset(com_tilbuci_data_GlobalPlayer.movie.collections.h[col].assets.h[ast]);
				return true;
			} else {
				return false;
			}
		} else {
			return false;
		}
	}
	,playPause: function() {
		this._imCurrent.playPause();
		this._playOnLoad = this._imCurrent.get_playing();
	}
	,play: function() {
		this._playOnLoad = true;
		this._imCurrent.play();
	}
	,pause: function() {
		this._playOnLoad = false;
		this._imCurrent.pause();
	}
	,stop: function() {
		this._playOnLoad = false;
		this._imCurrent.stop();
		this._imOther.stop();
	}
	,getTime: function() {
		return this._imCurrent.getTime();
	}
	,seek: function(time) {
		this._imCurrent.seek(time);
	}
	,updateFrames: function(fr,tm) {
		this._imCurrent.updateFrames(fr,tm);
	}
	,fixProp: function(prop,h,v) {
		this._set.fixProp(prop,h,v);
	}
	,textScroll: function(val) {
		this._imCurrent.textScroll(val);
	}
	,setText: function(txt) {
		this._imCurrent.setText(txt);
		this._imOther.setText(txt);
	}
	,updateText: function() {
		this._imCurrent.updateText();
		this._imOther.updateText();
	}
	,releaseProp: function(prop) {
		this._set.releaseProp(prop);
	}
	,releaseAll: function() {
		this._set.releaseAll();
	}
	,oWidth: function() {
		if(this._imCurrent != null) {
			return this._imCurrent.oWidth();
		} else {
			return 0;
		}
	}
	,oHeight: function() {
		if(this._imCurrent != null) {
			return this._imCurrent.oHeight();
		} else {
			return 0;
		}
	}
	,onLoad: function(ok) {
		if(ok) {
			this._im1.set_width(this._im2.set_width(com_tilbuci_data_GlobalPlayer.mdata.screen.big / 2 * com_tilbuci_data_GlobalPlayer.multiply));
			this._im1.set_height(this._im2.set_height(com_tilbuci_data_GlobalPlayer.mdata.screen.big / 2 * com_tilbuci_data_GlobalPlayer.multiply));
			this._imCurrent.stop();
			if(this._current == 1) {
				this._current = 2;
				this._imCurrent = this._im2;
				this._imOther = this._im1;
			} else {
				this._current = 1;
				this._imCurrent = this._im1;
				this._imOther = this._im2;
			}
			motion_Actuate.stop(this._imCurrent);
			motion_Actuate.stop(this._imOther);
			var trans = com_tilbuci_data_GlobalPlayer.movie.collections.h[this._data.collection].transition;
			if(this._changeAsset == "previous") {
				switch(trans) {
				case "bottom":
					trans = "top";
					break;
				case "left":
					trans = "right";
					break;
				case "right":
					trans = "left";
					break;
				case "top":
					trans = "bottom";
					break;
				}
			}
			switch(trans) {
			case "alpha":
				this._multSize.x = this._multSize.y = 1;
				this._imCurrent.set_x(this._imOther.set_x(this._imCurrent.set_y(this._imOther.set_y(0))));
				this._imCurrent.set_alpha(0);
				this._imOther.set_alpha(1);
				motion_Actuate.tween(this._imCurrent,com_tilbuci_data_GlobalPlayer.movie.collections.h[this._data.collection].time,{ alpha : 1});
				motion_Actuate.tween(this._imOther,com_tilbuci_data_GlobalPlayer.movie.collections.h[this._data.collection].time,{ alpha : 0});
				break;
			case "bottom":
				this._multSize.x = 1;
				this._multSize.y = 1;
				this._imCurrent.set_y(this._imCurrent.get_height());
				this._imOther.set_y(0);
				this._imCurrent.set_x(this._imOther.set_x(0));
				this._imCurrent.set_alpha(1);
				this._imOther.set_alpha(1);
				motion_Actuate.tween(this._imCurrent,com_tilbuci_data_GlobalPlayer.movie.collections.h[this._data.collection].time,{ y : 0});
				motion_Actuate.tween(this._imOther,com_tilbuci_data_GlobalPlayer.movie.collections.h[this._data.collection].time,{ y : -this._imCurrent.get_height()});
				break;
			case "left":
				this._multSize.x = 1;
				this._multSize.y = 1;
				this._imCurrent.set_x(-this._imCurrent.get_width());
				this._imOther.set_x(0);
				this._imCurrent.set_y(this._imOther.set_y(0));
				this._imCurrent.set_alpha(1);
				this._imOther.set_alpha(1);
				motion_Actuate.tween(this._imCurrent,com_tilbuci_data_GlobalPlayer.movie.collections.h[this._data.collection].time,{ x : 0});
				motion_Actuate.tween(this._imOther,com_tilbuci_data_GlobalPlayer.movie.collections.h[this._data.collection].time,{ x : this._imCurrent.get_width()});
				break;
			case "right":
				this._multSize.x = 1;
				this._multSize.y = 1;
				this._imCurrent.set_x(this._imCurrent.get_width());
				this._imOther.set_x(0);
				this._imCurrent.set_y(this._imOther.set_y(0));
				this._imCurrent.set_alpha(1);
				this._imOther.set_alpha(1);
				motion_Actuate.tween(this._imCurrent,com_tilbuci_data_GlobalPlayer.movie.collections.h[this._data.collection].time,{ x : 0});
				motion_Actuate.tween(this._imOther,com_tilbuci_data_GlobalPlayer.movie.collections.h[this._data.collection].time,{ x : -this._imCurrent.get_width()});
				break;
			case "top":
				this._multSize.x = 1;
				this._multSize.y = 1;
				this._imCurrent.set_y(-this._imCurrent.get_height());
				this._imOther.set_y(0);
				this._imCurrent.set_x(this._imOther.set_x(0));
				this._imCurrent.set_alpha(1);
				this._imOther.set_alpha(1);
				motion_Actuate.tween(this._imCurrent,com_tilbuci_data_GlobalPlayer.movie.collections.h[this._data.collection].time,{ y : 0});
				motion_Actuate.tween(this._imOther,com_tilbuci_data_GlobalPlayer.movie.collections.h[this._data.collection].time,{ y : this._imCurrent.get_height()});
				break;
			default:
				this._multSize.x = this._multSize.y = 1;
				this._imCurrent.set_x(this._imOther.set_x(this._imCurrent.set_y(this._imOther.set_y(0))));
				this._imCurrent.set_alpha(1);
				this._imOther.set_alpha(0);
			}
			this._mask.set_x(this._display.set_x(this._mask.set_y(this._display.set_y(0))));
			this._display.setChildIndex(this._imCurrent,1);
			this._display.setChildIndex(this._imOther,0);
			if(this._firstLoad) {
				var screenW;
				var screenH;
				if(com_tilbuci_data_GlobalPlayer.movie.data.screen.type == "landscape") {
					this._desc = this._data.horizontal;
					screenW = com_tilbuci_data_GlobalPlayer.mdata.screen.big;
					screenH = com_tilbuci_data_GlobalPlayer.mdata.screen.small;
				} else if(com_tilbuci_data_GlobalPlayer.movie.data.screen.type == "portrait") {
					this._desc = this._data.vertical;
					screenW = com_tilbuci_data_GlobalPlayer.mdata.screen.small;
					screenH = com_tilbuci_data_GlobalPlayer.mdata.screen.big;
				} else if(com_tilbuci_data_GlobalPlayer.orientation == "horizontal") {
					this._desc = this._data.horizontal;
					screenW = com_tilbuci_data_GlobalPlayer.mdata.screen.big;
					screenH = com_tilbuci_data_GlobalPlayer.mdata.screen.small;
				} else {
					this._desc = this._data.vertical;
					screenW = com_tilbuci_data_GlobalPlayer.mdata.screen.small;
					screenH = com_tilbuci_data_GlobalPlayer.mdata.screen.big;
				}
				switch(com_tilbuci_data_GlobalPlayer.mdata.origin) {
				case "alpha":
					this.set_x(this._desc.x);
					this.set_y(this._desc.y);
					this.set_width(this._desc.width * this._multSize.x);
					this.set_height(this._desc.height * this._multSize.y);
					this.set_alpha(0);
					this.set_rotation(this._desc.rotation);
					break;
				case "bottom":
					this.set_width(this._desc.width * this._multSize.x);
					this.set_height(this._desc.height * this._multSize.y);
					this.set_alpha(this._desc.alpha);
					this.set_rotation(this._desc.rotation);
					this.set_x(this._desc.x);
					this.set_y(screenH + 10);
					break;
				case "bottomkeep":
					this.set_width(this._desc.width * this._multSize.x);
					this.set_height(this._desc.height * this._multSize.y);
					this.set_alpha(this._desc.alpha);
					this.set_rotation(this._desc.rotation);
					this.set_x(this._desc.x);
					this.set_y(screenH + 10 + this._desc.y);
					break;
				case "left":
					this.set_width(this._desc.width * this._multSize.x);
					this.set_height(this._desc.height * this._multSize.y);
					this.set_alpha(this._desc.alpha);
					this.set_rotation(this._desc.rotation);
					this.set_y(this._desc.y);
					this.set_x(-10 - this.get_width());
					break;
				case "leftkeep":
					this.set_width(this._desc.width * this._multSize.x);
					this.set_height(this._desc.height * this._multSize.y);
					this.set_alpha(this._desc.alpha);
					this.set_rotation(this._desc.rotation);
					this.set_y(this._desc.y);
					this.set_x(-10 - screenW + this._desc.x);
					break;
				case "none":
					this.set_x(this._desc.x);
					this.set_y(this._desc.y);
					this.set_width(this._desc.width * this._multSize.x);
					this.set_height(this._desc.height * this._multSize.y);
					this.set_alpha(this._desc.alpha);
					this.set_rotation(this._desc.rotation);
					break;
				case "right":
					this.set_width(this._desc.width * this._multSize.x);
					this.set_height(this._desc.height * this._multSize.y);
					this.set_alpha(this._desc.alpha);
					this.set_rotation(this._desc.rotation);
					this.set_y(this._desc.y);
					this.set_x(screenW + 10);
					break;
				case "rightkeep":
					this.set_width(this._desc.width * this._multSize.x);
					this.set_height(this._desc.height * this._multSize.y);
					this.set_alpha(this._desc.alpha);
					this.set_rotation(this._desc.rotation);
					this.set_y(this._desc.y);
					this.set_x(screenW + 10 + this._desc.x);
					break;
				case "top":
					this.set_width(this._desc.width * this._multSize.x);
					this.set_height(this._desc.height * this._multSize.y);
					this.set_alpha(this._desc.alpha);
					this.set_rotation(this._desc.rotation);
					this.set_x(this._desc.x);
					this.set_y(-10 - this.get_height());
					break;
				case "topkeep":
					this.set_width(this._desc.width * this._multSize.x);
					this.set_height(this._desc.height * this._multSize.y);
					this.set_alpha(this._desc.alpha);
					this.set_rotation(this._desc.rotation);
					this.set_x(this._desc.x);
					this.set_y(-10 - screenH + this._desc.y);
					break;
				}
			}
			this._firstLoad = false;
			this._imOther.stopTimer();
			this._imOther.stop();
			if(this._playOnLoad) {
				this._imCurrent.startTimer();
			} else {
				this._imCurrent.stopTimer();
			}
			if(this._changeAsset == "") {
				this.place();
			}
			this._changeAsset = "";
		}
	}
	,onTimedAc: function(time) {
		if(com_tilbuci_data_GlobalPlayer.canTrigger) {
			if(Object.prototype.hasOwnProperty.call(this._data.timedAc.h,time + "s")) {
				com_tilbuci_data_GlobalPlayer.parser.run(this._data.timedAc.h[time + "s"]);
			}
		}
	}
	,onClick: function(evt) {
		if(com_tilbuci_data_GlobalPlayer.canTrigger) {
			if(com_tilbuci_data_GlobalPlayer.mode != "editor") {
				if(this._data.action != "") {
					if(evt != null) {
						this.lastClick = this.globalToLocal(new openfl_geom_Point(evt.stageX,evt.stageY));
					}
					com_tilbuci_data_GlobalPlayer.parser.run(this._data.action);
				}
			} else {
				this._onSelect(this._name);
				if(com_tilbuci_data_GlobalPlayer.callback != null) {
					var tmp = com_tilbuci_data_GlobalPlayer.callback;
					var _g = new haxe_ds_StringMap();
					_g.h["nm"] = this._name;
					tmp("selectimage",_g);
				}
			}
		}
	}
	,onMouseOver: function(evt) {
		if(com_tilbuci_data_GlobalPlayer.cursorVisible) {
			if(com_tilbuci_data_GlobalPlayer.mode != "editor" && this._data.action != "" && com_tilbuci_data_GlobalPlayer.mdata.highlightInt != null && !com_tilbuci_data_GlobalPlayer.isMobile()) {
				this._imCurrent.set_filters(this._imOther.set_filters([new openfl_filters_GlowFilter(com_tilbuci_data_GlobalPlayer.mdata.highlightInt,1,4,4,255,1,true)]));
			}
		}
		if(com_tilbuci_data_GlobalPlayer.canTrigger) {
			if(com_tilbuci_data_GlobalPlayer.mode != "editor") {
				if(this._data.actionover != "") {
					com_tilbuci_data_GlobalPlayer.parser.run(this._data.actionover);
				}
			}
		}
	}
	,onTargetOver: function() {
		if(com_tilbuci_data_GlobalPlayer.canTrigger) {
			if(com_tilbuci_data_GlobalPlayer.mode != "editor") {
				if(this._data.actionover != "") {
					com_tilbuci_data_GlobalPlayer.parser.run(this._data.actionover);
				}
			}
		}
	}
	,onMouseOut: function(evt) {
		this._imCurrent.set_filters(this._imOther.set_filters([]));
	}
	,dragImageStart: function() {
		if(com_tilbuci_data_GlobalPlayer.mode == "editor") {
			this._dragging = true;
			this.startDrag();
		}
	}
	,finishDrag: function() {
		if(this._dragging) {
			this._dragging = false;
			this.stopDrag();
		}
	}
	,updateInstance: function() {
		if(com_tilbuci_data_Global.displayType == "portrait") {
			com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[com_tilbuci_data_GlobalPlayer.area.get_currentKf()].h[this._name].vertical.x = this.get_x();
			com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[com_tilbuci_data_GlobalPlayer.area.get_currentKf()].h[this._name].vertical.y = this.get_y();
			com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[com_tilbuci_data_GlobalPlayer.area.get_currentKf()].h[this._name].vertical.width = this.get_displayWidth();
			com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[com_tilbuci_data_GlobalPlayer.area.get_currentKf()].h[this._name].vertical.height = this.get_displayHeight();
		} else {
			com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[com_tilbuci_data_GlobalPlayer.area.get_currentKf()].h[this._name].horizontal.x = this.get_x();
			com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[com_tilbuci_data_GlobalPlayer.area.get_currentKf()].h[this._name].horizontal.y = this.get_y();
			com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[com_tilbuci_data_GlobalPlayer.area.get_currentKf()].h[this._name].horizontal.width = this.get_displayWidth();
			com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[com_tilbuci_data_GlobalPlayer.area.get_currentKf()].h[this._name].horizontal.height = this.get_displayHeight();
		}
		com_tilbuci_data_Global.history.addState(com_tilbuci_data_Global.ln.get("rightbar-history-move"));
		com_tilbuci_data_Global.history.updateProperties();
	}
	,setDescWidth: function(to) {
		if(com_tilbuci_data_Global.displayType == "portrait") {
			com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[com_tilbuci_data_GlobalPlayer.area.get_currentKf()].h[this._name].vertical.width = to;
		} else {
			com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[com_tilbuci_data_GlobalPlayer.area.get_currentKf()].h[this._name].horizontal.width = to;
		}
	}
	,setDescHeight: function(to) {
		if(com_tilbuci_data_Global.displayType == "portrait") {
			com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[com_tilbuci_data_GlobalPlayer.area.get_currentKf()].h[this._name].vertical.height = to;
		} else {
			com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[com_tilbuci_data_GlobalPlayer.area.get_currentKf()].h[this._name].horizontal.height = to;
		}
	}
	,getCurrentNum: function(name) {
		var desc;
		if(com_tilbuci_data_Global.displayType == "portrait") {
			desc = com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[com_tilbuci_data_GlobalPlayer.area.get_currentKf()].h[this._name].vertical;
		} else {
			desc = com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[com_tilbuci_data_GlobalPlayer.area.get_currentKf()].h[this._name].horizontal;
		}
		switch(name) {
		case "alpha":
			return desc.alpha;
		case "coloralpha":
			return desc.colorAlpha;
		case "height":
			return desc.height;
		case "order":
			return desc.order;
		case "rotation":
			return desc.rotation;
		case "textleading":
			return desc.textLeading;
		case "textsize":
			return desc.textSize;
		case "textspacing":
			return desc.textSpacing;
		case "volume":
			return desc.volume;
		case "width":
			return desc.width;
		case "x":
			return desc.x;
		case "y":
			return desc.y;
		default:
			return 0;
		}
	}
	,getCurrentStr: function(name) {
		var desc;
		if(com_tilbuci_data_Global.displayType == "portrait") {
			desc = com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[com_tilbuci_data_GlobalPlayer.area.get_currentKf()].h[this._name].vertical;
		} else {
			desc = com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[com_tilbuci_data_GlobalPlayer.area.get_currentKf()].h[this._name].horizontal;
		}
		switch(name) {
		case "asset":
			return this._asset;
		case "blend":
			return desc.blend;
		case "collection":
			return this._collection;
		case "color":
			return desc.color;
		case "instance":
			return this._name;
		case "textalign":
			return desc.textAlign;
		case "textbackground":
			return desc.textBackground;
		case "textcolor":
			return desc.textColor;
		case "textfont":
			return desc.textFont;
		default:
			return "";
		}
	}
	,getCurrentBool: function(name) {
		var desc;
		if(com_tilbuci_data_Global.displayType == "portrait") {
			desc = com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[com_tilbuci_data_GlobalPlayer.area.get_currentKf()].h[this._name].vertical;
		} else {
			desc = com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[com_tilbuci_data_GlobalPlayer.area.get_currentKf()].h[this._name].horizontal;
		}
		switch(name) {
		case "blur":
			return desc.blur.length == 2;
		case "dropshadow":
			return desc.dropshadow.length == 8;
		case "glow":
			return desc.glow.length == 5;
		case "textbold":
			return desc.textBold;
		case "textitalic":
			return desc.textItalic;
		case "visible":
			return desc.visible;
		default:
			return false;
		}
	}
	,getCurrentArr: function(name) {
		var desc;
		if(com_tilbuci_data_Global.displayType == "portrait") {
			desc = com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[com_tilbuci_data_GlobalPlayer.area.get_currentKf()].h[this._name].vertical;
		} else {
			desc = com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[com_tilbuci_data_GlobalPlayer.area.get_currentKf()].h[this._name].horizontal;
		}
		switch(name) {
		case "blur":
			if(desc.blur.length == 2) {
				return desc.blur;
			} else {
				return ["4","4"];
			}
			break;
		case "dropshadow":
			if(desc.dropshadow.length == 8) {
				return desc.dropshadow;
			} else {
				return ["1","45","0x000000","1","4","4","1","0"];
			}
			break;
		case "glow":
			if(desc.glow.length == 5) {
				return desc.glow;
			} else {
				return ["0xFFFFFF","1","6","1","0"];
			}
			break;
		default:
			return [];
		}
	}
	,getInstName: function() {
		return this._name;
	}
	,setSound: function(volume,pan) {
		if(pan == null) {
			pan = 0;
		}
		this._imCurrent.iterateSound(volume,pan);
	}
	,playOnLoad: function() {
		var this1 = com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[com_tilbuci_data_GlobalPlayer.area.get_currentKf()];
		if(Object.prototype.hasOwnProperty.call(this1.h,this._name)) {
			return com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[com_tilbuci_data_GlobalPlayer.area.get_currentKf()].h[this._name].playOnLoad;
		} else {
			return false;
		}
	}
	,__class__: com_tilbuci_display_InstanceImage
	,__properties__: $extend(openfl_display_Sprite.prototype.__properties__,{get_transition:"get_transition",get_displayHeight:"get_displayHeight",get_displayWidth:"get_displayWidth",get_currentMedia:"get_currentMedia",get_currentType:"get_currentType",get_playing:"get_playing"})
});
var com_tilbuci_display_ImageSet = function() {
	this._fixed = [];
	this.horizontal = new com_tilbuci_def_InstanceDesc([]);
	this.vertical = new com_tilbuci_def_InstanceDesc([]);
	this.horizontal.ok = this.vertical.ok = true;
};
$hxClasses["com.tilbuci.display.ImageSet"] = com_tilbuci_display_ImageSet;
com_tilbuci_display_ImageSet.__name__ = "com.tilbuci.display.ImageSet";
com_tilbuci_display_ImageSet.prototype = {
	_fixed: null
	,horizontal: null
	,vertical: null
	,load: function(hr,vt) {
		this.setProp("order",hr.order,vt.order);
		this.setProp("x",hr.x,vt.x);
		this.setProp("y",hr.y,vt.y);
		this.setProp("alpha",hr.alpha,vt.alpha);
		this.setProp("width",hr.width,vt.width);
		this.setProp("height",hr.height,vt.height);
		this.setProp("rotation",hr.rotation,vt.rotation);
		this.setProp("visible",hr.visible,vt.visible);
		this.setProp("color",hr.color,vt.color);
		this.setProp("blend",hr.blend,vt.blend);
		this.setProp("colorAlpha",hr.colorAlpha,vt.colorAlpha);
		this.setProp("volume",hr.volume,vt.volume);
		this.setProp("pan",hr.pan,vt.pan);
		this.setProp("blur",hr.blur,vt.blur);
		this.setProp("dropshadow",hr.dropshadow,vt.dropshadow);
		this.setProp("glow",hr.glow,vt.glow);
		this.setProp("textFont",hr.textFont,vt.textFont);
		this.setProp("textSize",hr.textSize,vt.textSize);
		this.setProp("textColor",hr.textColor,vt.textColor);
		this.setProp("textBold",hr.textBold,vt.textBold);
		this.setProp("textItalic",hr.textItalic,vt.textItalic);
		this.setProp("textLeading",hr.textLeading,vt.textLeading);
		this.setProp("textSpacing",hr.textSpacing,vt.textSpacing);
		this.setProp("textBackground",hr.textBackground,vt.textBackground);
		this.setProp("textAlign",hr.textAlign,vt.textAlign);
	}
	,setProp: function(prop,valH,valV) {
		if(!this.isFixed(prop)) {
			switch(prop) {
			case "alpha":
				this.horizontal.alpha = valH;
				this.vertical.alpha = valV;
				break;
			case "blend":
				this.horizontal.blend = valH;
				this.vertical.blend = valV;
				break;
			case "blur":
				this.horizontal.blur = valH;
				this.vertical.blur = valV;
				break;
			case "color":
				this.horizontal.color = valH;
				this.vertical.color = valV;
				break;
			case "colorAlpha":
				this.horizontal.colorAlpha = valH;
				this.vertical.colorAlpha = valV;
				break;
			case "dropshadow":
				this.horizontal.dropshadow = valH;
				this.vertical.dropshadow = valV;
				break;
			case "glow":
				this.horizontal.glow = valH;
				this.vertical.glow = valV;
				break;
			case "height":
				this.horizontal.height = valH;
				this.vertical.height = valV;
				break;
			case "order":
				this.horizontal.order = valH;
				this.vertical.order = valV;
				break;
			case "pan":
				this.horizontal.pan = valH;
				this.vertical.pan = valV;
				break;
			case "rotation":
				this.horizontal.rotation = valH;
				this.vertical.rotation = valV;
				break;
			case "textAlign":
				this.horizontal.textAlign = valH;
				this.vertical.textAlign = valV;
				break;
			case "textBackground":
				this.horizontal.textBackground = valH;
				this.vertical.textBackground = valV;
				break;
			case "textBold":
				this.horizontal.textBold = valH;
				this.vertical.textBold = valV;
				break;
			case "textColor":
				this.horizontal.textColor = valH;
				this.vertical.textColor = valV;
				break;
			case "textFont":
				this.horizontal.textFont = valH;
				this.vertical.textFont = valV;
				break;
			case "textItalic":
				this.horizontal.textItalic = valH;
				this.vertical.textItalic = valV;
				break;
			case "textLeading":
				this.horizontal.textLeading = valH;
				this.vertical.textLeading = valV;
				break;
			case "textSize":
				this.horizontal.textSize = valH;
				this.vertical.textSize = valV;
				break;
			case "textSpacing":
				this.horizontal.textSpacing = valH;
				this.vertical.textSpacing = valV;
				break;
			case "visible":
				this.horizontal.visible = valH;
				this.vertical.visible = valV;
				break;
			case "volume":
				this.horizontal.volume = valH;
				this.vertical.volume = valV;
				break;
			case "width":
				this.horizontal.width = valH;
				this.vertical.width = valV;
				break;
			case "x":
				this.horizontal.x = valH;
				this.vertical.x = valV;
				break;
			case "y":
				this.horizontal.y = valH;
				this.vertical.y = valV;
				break;
			}
			return true;
		} else {
			return false;
		}
	}
	,isFixed: function(prop) {
		return this._fixed.indexOf(prop) != -1;
	}
	,fixProp: function(prop,valH,valV) {
		if(!this.isFixed(prop)) {
			this._fixed.push(prop);
		}
		switch(prop) {
		case "alpha":
			this.horizontal.alpha = valH;
			this.vertical.alpha = valV;
			break;
		case "blend":
			this.horizontal.blend = valH;
			this.vertical.blend = valV;
			break;
		case "blur":
			this.horizontal.blur = valH;
			this.vertical.blur = valV;
			break;
		case "color":
			this.horizontal.color = valH;
			this.vertical.color = valV;
			break;
		case "colorAlpha":
			this.horizontal.colorAlpha = valH;
			this.vertical.colorAlpha = valV;
			break;
		case "dropshadow":
			this.horizontal.dropshadow = valH;
			this.vertical.dropshadow = valV;
			break;
		case "glow":
			this.horizontal.glow = valH;
			this.vertical.glow = valV;
			break;
		case "height":
			this.horizontal.height = valH;
			this.vertical.height = valV;
			break;
		case "order":
			this.horizontal.order = valH;
			this.vertical.order = valV;
			break;
		case "pan":
			this.horizontal.pan = valH;
			this.vertical.pan = valV;
			break;
		case "rotation":
			this.horizontal.rotation = valH;
			this.vertical.rotation = valV;
			break;
		case "textAlign":
			this.horizontal.textAlign = valH;
			this.vertical.textAlign = valV;
			break;
		case "textBackground":
			this.horizontal.textBackground = valH;
			this.vertical.textBackground = valV;
			break;
		case "textBold":
			this.horizontal.textBold = valH;
			this.vertical.textBold = valV;
			break;
		case "textColor":
			this.horizontal.textColor = valH;
			this.vertical.textColor = valV;
			break;
		case "textFont":
			this.horizontal.textFont = valH;
			this.vertical.textFont = valV;
			break;
		case "textItalic":
			this.horizontal.textItalic = valH;
			this.vertical.textItalic = valV;
			break;
		case "textLeading":
			this.horizontal.textLeading = valH;
			this.vertical.textLeading = valV;
			break;
		case "textSize":
			this.horizontal.textSize = valH;
			this.vertical.textSize = valV;
			break;
		case "textSpacing":
			this.horizontal.textSpacing = valH;
			this.vertical.textSpacing = valV;
			break;
		case "visible":
			this.horizontal.visible = valH;
			this.vertical.visible = valV;
			break;
		case "volume":
			this.horizontal.volume = valH;
			this.vertical.volume = valV;
			break;
		case "width":
			this.horizontal.width = valH;
			this.vertical.width = valV;
			break;
		case "x":
			this.horizontal.x = valH;
			this.vertical.x = valV;
			break;
		case "y":
			this.horizontal.y = valH;
			this.vertical.y = valV;
			break;
		}
	}
	,releaseProp: function(prop) {
		if(this.isFixed(prop)) {
			HxOverrides.remove(this._fixed,prop);
		}
	}
	,releaseAll: function() {
		while(this._fixed.length > 0) this._fixed.shift();
	}
	,kill: function() {
		while(this._fixed.length > 0) this._fixed.shift();
		this._fixed = null;
		this.horizontal.kill();
		this.horizontal = null;
		this.vertical.kill();
		this.vertical = null;
	}
	,__class__: com_tilbuci_display_ImageSet
};
var com_tilbuci_display_InstanceSelect = function() {
	this._updating = "";
	openfl_display_Sprite.call(this);
	this._borders = new openfl_display_Shape();
	this.addChild(this._borders);
	this._move = new openfl_display_Sprite();
	var mvIcon = new openfl_display_Bitmap();
	mvIcon = new openfl_display_Bitmap(openfl_utils_Assets.getBitmapData("iconMove"));
	mvIcon.smoothing = true;
	this._move.addChild(mvIcon);
	this.addChild(this._move);
	this._resizeH = new openfl_display_Sprite();
	var iconResizeH = new openfl_display_Bitmap(openfl_utils_Assets.getBitmapData("iconResizeH"));
	iconResizeH.smoothing = true;
	this._resizeH.addChild(iconResizeH);
	this.addChild(this._resizeH);
	this._resizeV = new openfl_display_Sprite();
	var iconResizeV = new openfl_display_Bitmap(openfl_utils_Assets.getBitmapData("iconResizeV"));
	iconResizeV.smoothing = true;
	this._resizeV.addChild(iconResizeV);
	this.addChild(this._resizeV);
	this._resize = new openfl_display_Sprite();
	var iconResize = new openfl_display_Bitmap(openfl_utils_Assets.getBitmapData("iconResize"));
	iconResize.smoothing = true;
	this._resize.addChild(iconResize);
	this.addChild(this._resize);
	this._limits = new openfl_geom_Point(3 * mvIcon.get_width(),3 * mvIcon.get_height());
	this._stagepos = new openfl_geom_Point();
	this.set_visible(false);
};
$hxClasses["com.tilbuci.display.InstanceSelect"] = com_tilbuci_display_InstanceSelect;
com_tilbuci_display_InstanceSelect.__name__ = "com.tilbuci.display.InstanceSelect";
com_tilbuci_display_InstanceSelect.__super__ = openfl_display_Sprite;
com_tilbuci_display_InstanceSelect.prototype = $extend(openfl_display_Sprite.prototype,{
	image: null
	,_move: null
	,_resizeH: null
	,_resizeV: null
	,_resize: null
	,_borders: null
	,_limits: null
	,_stagepos: null
	,_updating: null
	,stg: null
	,setInstance: function(inst) {
		this.image = inst;
		this.place();
		this.set_visible(true);
		this._move.addEventListener("mouseDown",$bind(this,this.onMoveStart));
		this._resizeH.addEventListener("mouseDown",$bind(this,this.onResizeHStart));
		this._resizeV.addEventListener("mouseDown",$bind(this,this.onResizeVStart));
		this._resize.addEventListener("mouseDown",$bind(this,this.onResizeStart));
	}
	,clearInstance: function() {
		this.image = null;
		this.set_visible(false);
		this.set_x(this.set_y(0));
		if(this._move.hasEventListener("mouseDown")) {
			try {
				this._move.removeEventListener("mouseDown",$bind(this,this.onMoveStart));
			} catch( _g ) {
			}
		}
		if(this._resizeH.hasEventListener("mouseDown")) {
			try {
				this._resizeH.removeEventListener("mouseDown",$bind(this,this.onResizeHStart));
			} catch( _g ) {
			}
		}
		if(this._resizeV.hasEventListener("mouseDown")) {
			try {
				this._resizeV.removeEventListener("mouseDown",$bind(this,this.onResizeVStart));
			} catch( _g ) {
			}
		}
		if(this._resize.hasEventListener("mouseDown")) {
			try {
				this._resize.removeEventListener("mouseDown",$bind(this,this.onResizeStart));
			} catch( _g ) {
			}
		}
		if(this.stg != null && this.stg.hasEventListener("mouseMove")) {
			try {
				this.stg.removeEventListener("mouseMove",$bind(this,this.onMove));
			} catch( _g ) {
			}
			this.stg = null;
		}
	}
	,setAsPrecache: function() {
		var tmp = this.image;
		var this1 = com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[com_tilbuci_data_GlobalPlayer.area.get_currentKf()];
		var key = this.image.getInstName();
		tmp.set_x(this1.h[key].horizontal.x = -100);
		var tmp = this.image;
		var this1 = com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[com_tilbuci_data_GlobalPlayer.area.get_currentKf()];
		var key = this.image.getInstName();
		tmp.set_y(this1.h[key].horizontal.y = -100);
		var tmp = this.image;
		var this1 = com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[com_tilbuci_data_GlobalPlayer.area.get_currentKf()];
		var key = this.image.getInstName();
		tmp.set_width(this1.h[key].horizontal.width = 5);
		var tmp = this.image;
		var this1 = com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[com_tilbuci_data_GlobalPlayer.area.get_currentKf()];
		var key = this.image.getInstName();
		tmp.set_height(this1.h[key].horizontal.height = 5);
		var tmp = this.image;
		var this1 = com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[com_tilbuci_data_GlobalPlayer.area.get_currentKf()];
		var key = this.image.getInstName();
		tmp.set_alpha(this1.h[key].horizontal.alpha = 0);
		var this1 = com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[com_tilbuci_data_GlobalPlayer.area.get_currentKf()];
		var key = this.image.getInstName();
		this1.h[key].horizontal.volume = 0;
		this.image.setSound(0);
		var tmp = this.image;
		var this1 = com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[com_tilbuci_data_GlobalPlayer.area.get_currentKf()];
		var key = this.image.getInstName();
		tmp.set_visible(this1.h[key].horizontal.visible = false);
		var this1 = com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[com_tilbuci_data_GlobalPlayer.area.get_currentKf()];
		var key = this.image.getInstName();
		this1.h[key].vertical.x = -100;
		var this1 = com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[com_tilbuci_data_GlobalPlayer.area.get_currentKf()];
		var key = this.image.getInstName();
		this1.h[key].vertical.y = -100;
		var this1 = com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[com_tilbuci_data_GlobalPlayer.area.get_currentKf()];
		var key = this.image.getInstName();
		this1.h[key].vertical.width = 5;
		var this1 = com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[com_tilbuci_data_GlobalPlayer.area.get_currentKf()];
		var key = this.image.getInstName();
		this1.h[key].vertical.height = 5;
		var this1 = com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[com_tilbuci_data_GlobalPlayer.area.get_currentKf()];
		var key = this.image.getInstName();
		this1.h[key].vertical.alpha = 0;
		var this1 = com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[com_tilbuci_data_GlobalPlayer.area.get_currentKf()];
		var key = this.image.getInstName();
		this1.h[key].vertical.volume = 0;
		var this1 = com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[com_tilbuci_data_GlobalPlayer.area.get_currentKf()];
		var key = this.image.getInstName();
		this1.h[key].vertical.visible = false;
		var this1 = com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[com_tilbuci_data_GlobalPlayer.area.get_currentKf()];
		var key = this.image.getInstName();
		this1.h[key].playOnLoad = false;
		this.place();
	}
	,setCurrentNum: function(name,val) {
		var desc;
		if(com_tilbuci_data_Global.displayType == "portrait") {
			var this1 = com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[com_tilbuci_data_GlobalPlayer.area.get_currentKf()];
			var key = this.image.getInstName();
			desc = this1.h[key].vertical;
		} else {
			var this1 = com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[com_tilbuci_data_GlobalPlayer.area.get_currentKf()];
			var key = this.image.getInstName();
			desc = this1.h[key].horizontal;
		}
		switch(name) {
		case "alpha":
			desc.alpha = this.image.set_alpha(val);
			break;
		case "coloralpha":
			desc.colorAlpha = val;
			motion_Actuate.transform(this.image,0.01).color(Std.parseInt(desc.color),desc.colorAlpha);
			break;
		case "height":
			desc.height = val;
			var newval = val;
			if(this.image.get_transition() == "top" || this.image.get_transition() == "bottom") {
				newval = val;
			}
			if(this.image.get_currentType() == "paragraph" || this.image.get_currentType() == "html") {
				this.image.setTextSize(this.image.get_width(),newval);
				this.image.set_height(newval);
			} else {
				this.image.set_height(newval);
			}
			break;
		case "rotation":
			desc.rotation = Math.round(val);
			this.image.set_rotation(val);
			break;
		case "textleading":
			desc.textLeading = Math.round(val);
			break;
		case "textsize":
			desc.textSize = Math.round(val);
			break;
		case "textspacing":
			desc.textSpacing = val;
			break;
		case "volume":
			desc.volume = val;
			this.image.setSound(val);
			break;
		case "width":
			desc.width = val;
			var newval = val;
			if(this.image.get_transition() == "right" || this.image.get_transition() == "left") {
				newval = val;
			}
			if(this.image.get_currentType() == "paragraph" || this.image.get_currentType() == "html") {
				this.image.setTextSize(newval,this.image.get_height());
				this.image.set_width(newval);
			} else {
				this.image.set_width(newval);
			}
			break;
		case "x":
			desc.x = this.image.set_x(val);
			break;
		case "y":
			desc.y = this.image.set_y(val);
			break;
		}
		this.place();
	}
	,setCurrentStr: function(name,val) {
		var desc;
		if(com_tilbuci_data_Global.displayType == "portrait") {
			var this1 = com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[com_tilbuci_data_GlobalPlayer.area.get_currentKf()];
			var key = this.image.getInstName();
			desc = this1.h[key].vertical;
		} else {
			var this1 = com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[com_tilbuci_data_GlobalPlayer.area.get_currentKf()];
			var key = this.image.getInstName();
			desc = this1.h[key].horizontal;
		}
		switch(name) {
		case "asset":
			var asinfo = val.split("|:|");
			var this1 = com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[com_tilbuci_data_GlobalPlayer.area.get_currentKf()];
			var key = this.image.getInstName();
			this1.h[key].collection = asinfo[0];
			var this1 = com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[com_tilbuci_data_GlobalPlayer.area.get_currentKf()];
			var key = this.image.getInstName();
			this1.h[key].asset = asinfo[1];
			var tmp = this.image;
			var this1 = com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[com_tilbuci_data_GlobalPlayer.area.get_currentKf()];
			var key = this.image.getInstName();
			tmp.load(this1.h[key]);
			break;
		case "blend":
			desc.blend = val;
			break;
		case "color":
			desc.color = val;
			motion_Actuate.stop(this.image,null,true);
			motion_Actuate.transform(this.image,0.01).color(Std.parseInt(desc.color),desc.colorAlpha);
			break;
		case "instance":
			var oldid = this.image.getInstName();
			if(com_tilbuci_data_GlobalPlayer.area.swapInstance(this.image.getInstName(),val)) {
				var dt = com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[com_tilbuci_data_GlobalPlayer.area.get_currentKf()].h[oldid];
				var _this = com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[com_tilbuci_data_GlobalPlayer.area.get_currentKf()];
				if(Object.prototype.hasOwnProperty.call(_this.h,oldid)) {
					delete(_this.h[oldid]);
				}
				com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[com_tilbuci_data_GlobalPlayer.area.get_currentKf()].h[val] = dt;
			}
			break;
		case "textalign":
			desc.textAlign = val;
			break;
		case "textbackground":
			desc.textBackground = val;
			break;
		case "textcolor":
			desc.textColor = val;
			break;
		case "textfont":
			desc.textFont = val;
			break;
		}
		this.place();
	}
	,setCurrentBool: function(name,val) {
		var desc;
		if(com_tilbuci_data_Global.displayType == "portrait") {
			var this1 = com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[com_tilbuci_data_GlobalPlayer.area.get_currentKf()];
			var key = this.image.getInstName();
			desc = this1.h[key].vertical;
		} else {
			var this1 = com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[com_tilbuci_data_GlobalPlayer.area.get_currentKf()];
			var key = this.image.getInstName();
			desc = this1.h[key].horizontal;
		}
		switch(name) {
		case "blur":
			if(!val) {
				desc.blur = [];
			}
			break;
		case "dropshadow":
			if(!val) {
				desc.dropshadow = [];
			}
			break;
		case "glow":
			if(!val) {
				desc.glow = [];
			}
			break;
		case "textbold":
			desc.textBold = val;
			break;
		case "textitalic":
			desc.textItalic = val;
			break;
		case "visible":
			desc.visible = this.image.set_visible(val);
			break;
		}
		if(name == "blur" || name == "dropshadow" || name == "glow") {
			var ft = [];
			if(desc.dropshadow.length == 8) {
				ft.push(new openfl_filters_DropShadowFilter(Std.parseInt(desc.dropshadow[0]),parseFloat(desc.dropshadow[1]),Std.parseInt(desc.dropshadow[2]),parseFloat(desc.dropshadow[3]),parseFloat(desc.dropshadow[4]),parseFloat(desc.dropshadow[5]),parseFloat(desc.dropshadow[6]),1,desc.dropshadow[7] == "1"));
			}
			if(desc.blur.length == 2) {
				ft.push(new openfl_filters_BlurFilter(parseFloat(desc.blur[0]),parseFloat(desc.blur[1])));
			}
			if(desc.glow.length == 5) {
				ft.push(new openfl_filters_GlowFilter(Std.parseInt(desc.glow[0]),parseFloat(desc.glow[1]),Std.parseInt(desc.glow[2]),Std.parseInt(desc.glow[2]),Std.parseInt(desc.glow[3]),1,desc.glow[4] == "1"));
			}
			this.image.set_filters(ft);
		}
		this.place();
	}
	,setCurrentArray: function(name,val) {
		var desc;
		if(com_tilbuci_data_Global.displayType == "portrait") {
			var this1 = com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[com_tilbuci_data_GlobalPlayer.area.get_currentKf()];
			var key = this.image.getInstName();
			desc = this1.h[key].vertical;
		} else {
			var this1 = com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[com_tilbuci_data_GlobalPlayer.area.get_currentKf()];
			var key = this.image.getInstName();
			desc = this1.h[key].horizontal;
		}
		switch(name) {
		case "blur":
			if(val.length == 2) {
				desc.blur = val;
			} else {
				desc.blur = [];
			}
			break;
		case "dropshadow":
			if(val.length == 8) {
				desc.dropshadow = val;
			} else {
				desc.dropshadow = [];
			}
			break;
		case "glow":
			if(val.length == 5) {
				desc.glow = val;
			} else {
				desc.glow = [];
			}
			break;
		}
		this.place();
	}
	,applyText: function() {
		var desc;
		if(com_tilbuci_data_Global.displayType == "portrait") {
			var this1 = com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[com_tilbuci_data_GlobalPlayer.area.get_currentKf()];
			var key = this.image.getInstName();
			desc = this1.h[key].vertical;
		} else {
			var this1 = com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[com_tilbuci_data_GlobalPlayer.area.get_currentKf()];
			var key = this.image.getInstName();
			desc = this1.h[key].horizontal;
		}
		this.image.formatText(desc.textFont,desc.textSize,desc.textColor,desc.textBold,desc.textItalic,desc.textLeading,desc.textSpacing,desc.textBackground,desc.textAlign);
	}
	,place: function() {
		if(this.image != null) {
			this.set_x(this.image.get_x());
			this.set_y(this.image.get_y());
			this._borders.get_graphics().clear();
			this._borders.get_graphics().lineStyle(2,0);
			this._borders.get_graphics().drawRect(0,0,this.image.get_displayWidth(),this.image.get_displayHeight());
			this._borders.get_graphics().lineStyle(2,16777215);
			this._borders.get_graphics().drawRect(2,2,this.image.get_displayWidth() - 4,this.image.get_displayHeight() - 4);
			this.set_rotation(this.image.get_rotation());
			if(this.image.get_displayWidth() <= this._limits.x || this.image.get_displayHeight() <= this._limits.y) {
				this._move.set_visible(true);
				this._resizeH.set_visible(false);
				this._resizeV.set_visible(false);
				this._resize.set_visible(false);
			} else {
				this._move.set_visible(true);
				this._resizeH.set_visible(true);
				this._resizeV.set_visible(true);
				this._resize.set_visible(true);
				this._resizeH.set_x(this.image.get_displayWidth() - this._resizeH.get_width());
				this._resizeH.set_y((this.image.get_displayHeight() - this._resizeH.get_height()) / 2);
				this._resizeV.set_y(this.image.get_displayHeight() - this._resizeH.get_height());
				this._resizeV.set_x((this.image.get_displayWidth() - this._resizeH.get_width()) / 2);
				this._resize.set_x(this.image.get_displayWidth() - this._resize.get_width());
				this._resize.set_y(this.image.get_displayHeight() - this._resize.get_height());
			}
		}
	}
	,endPropSet: function() {
		if(this.image != null) {
			if(this._updating == "move") {
				this.image.finishDrag();
			}
			this._updating = "";
			this.place();
			if(this.stg != null && this.stg.hasEventListener("mouseMove")) {
				this.stg.removeEventListener("mouseMove",$bind(this,this.onMove));
				this.stg = null;
			}
			this.image.updateInstance();
		}
	}
	,onMoveStart: function(evt) {
		if(this.image != null) {
			if(com_tilbuci_data_Global.history.states.length == 0) {
				com_tilbuci_data_Global.history.addState(com_tilbuci_data_Global.ln.get("rightbar-history-original"));
			}
			this._updating = "move";
			this.image.dragImageStart();
			this.stage.addEventListener("mouseMove",$bind(this,this.onMove));
		}
	}
	,onResizeHStart: function(evt) {
		if(this.image != null) {
			if(com_tilbuci_data_Global.history.states.length == 0) {
				com_tilbuci_data_Global.history.addState(com_tilbuci_data_Global.ln.get("rightbar-history-original"));
			}
			this._updating = "resizeh";
			this._stagepos.x = this.getBounds(this.stage).x;
			var tmp = this.image.get_width();
			this._stagepos.y = tmp / this.getBounds(this.stage).width;
			this.stage.addEventListener("mouseMove",$bind(this,this.onMove));
		}
	}
	,onResizeVStart: function(evt) {
		if(this.image != null) {
			if(com_tilbuci_data_Global.history.states.length == 0) {
				com_tilbuci_data_Global.history.addState(com_tilbuci_data_Global.ln.get("rightbar-history-original"));
			}
			this._updating = "resizev";
			this._stagepos.x = this.getBounds(this.stage).y;
			var tmp = this.image.get_height();
			this._stagepos.y = tmp / this.getBounds(this.stage).height;
			this.stage.addEventListener("mouseMove",$bind(this,this.onMove));
		}
	}
	,onResizeStart: function(evt) {
		if(this.image != null) {
			if(com_tilbuci_data_Global.history.states.length == 0) {
				com_tilbuci_data_Global.history.addState(com_tilbuci_data_Global.ln.get("rightbar-history-original"));
			}
			this._updating = "resize";
			this._stagepos.x = this.getBounds(this.stage).y;
			var tmp = this.image.get_height();
			this._stagepos.y = tmp / this.getBounds(this.stage).height;
			this.stage.addEventListener("mouseMove",$bind(this,this.onMove));
			this.stg = this.stage;
		}
	}
	,onMove: function(evt) {
		if(this.image != null) {
			switch(this._updating) {
			case "move":
				this.set_x(this.image.get_x());
				this.set_y(this.image.get_y());
				break;
			case "resize":
				var wd = (evt.stageX - this._stagepos.x) * this._stagepos.y;
				var ht = wd * this.image.oHeight() / this.image.oWidth();
				if(wd > this._limits.x && ht > this._limits.y) {
					var newval = wd;
					if(this.image.get_transition() == "right" || this.image.get_transition() == "left") {
						newval = wd * 2;
					}
					if(this.image.get_currentType() == "paragraph" || this.image.get_currentType() == "html") {
						this.image.setTextSize(newval,this.image.get_height());
					}
					this.image.set_width(wd);
					this.image.setDescWidth(newval);
					newval = ht;
					if(this.image.get_transition() == "top" || this.image.get_transition() == "bottom") {
						newval = ht / 2;
					}
					if(this.image.get_currentType() == "paragraph" || this.image.get_currentType() == "html") {
						this.image.setTextSize(this.image.get_width(),newval);
					}
					this.image.set_height(ht);
					this.image.setDescHeight(newval);
					this.place();
				}
				break;
			case "resizeh":
				var wd = (evt.stageX - this._stagepos.x) * this._stagepos.y;
				if(wd > this._limits.x) {
					var newval = wd;
					if(this.image.get_transition() == "right" || this.image.get_transition() == "left") {
						newval = wd * 2;
					}
					if(this.image.get_currentType() == "paragraph" || this.image.get_currentType() == "html") {
						this.image.setTextSize(newval,this.image.get_height());
					}
					this.image.set_width(wd);
					this.image.setDescWidth(newval);
					this.place();
				}
				break;
			case "resizev":
				var ht = (evt.stageY - this._stagepos.x) * this._stagepos.y;
				if(ht > this._limits.y) {
					var newval = ht;
					if(this.image.get_transition() == "top" || this.image.get_transition() == "bottom") {
						newval = ht / 2;
					}
					if(this.image.get_currentType() == "paragraph" || this.image.get_currentType() == "html") {
						this.image.setTextSize(this.image.get_width(),newval);
					}
					this.image.set_height(ht);
					this.image.setDescHeight(newval);
					this.place();
				}
				break;
			}
		}
	}
	,__class__: com_tilbuci_display_InstanceSelect
});
var com_tilbuci_display_MultiSelect = function() {
	this.size = new openfl_geom_Point();
	this.position = new openfl_geom_Point();
	this.instances = [];
	openfl_display_Sprite.call(this);
	this.mouseEnabled = false;
	this.mouseChildren = false;
};
$hxClasses["com.tilbuci.display.MultiSelect"] = com_tilbuci_display_MultiSelect;
com_tilbuci_display_MultiSelect.__name__ = "com.tilbuci.display.MultiSelect";
com_tilbuci_display_MultiSelect.__super__ = openfl_display_Sprite;
com_tilbuci_display_MultiSelect.prototype = $extend(openfl_display_Sprite.prototype,{
	instances: null
	,position: null
	,size: null
	,isAvailable: function() {
		return this.instances.length > 1;
	}
	,clear: function() {
		this.get_graphics().clear();
		while(this.instances.length > 0) this.instances.shift();
		this.position.x = this.position.y = 0;
		this.size.x = this.size.y = 0;
	}
	,add: function(inst) {
		var im = com_tilbuci_data_GlobalPlayer.area.pickInstance(inst);
		if(im != null) {
			this.get_graphics().lineStyle(2,0,0.7);
			this.get_graphics().beginFill(16777215,0.2);
			this.get_graphics().drawRect(im.get_x(),im.get_y(),im.get_width(),im.get_height());
			this.get_graphics().endFill();
			this.instances.push(inst);
		}
	}
	,__class__: com_tilbuci_display_MultiSelect
});
var com_tilbuci_display_ParagraphImage = function(ol) {
	this._scrollPos = 0;
	com_tilbuci_display_BaseImage.call(this,"paragraph",false,ol);
	this._text = new openfl_text_TextField();
	this._text.set_selectable(false);
	this._format = new openfl_text_TextFormat();
	this._format.align = 3;
	this._text.set_defaultTextFormat(this._format);
	this._text.set_wordWrap(true);
	this._text.set_multiline(true);
	this.addChild(this._text);
};
$hxClasses["com.tilbuci.display.ParagraphImage"] = com_tilbuci_display_ParagraphImage;
com_tilbuci_display_ParagraphImage.__name__ = "com.tilbuci.display.ParagraphImage";
com_tilbuci_display_ParagraphImage.__super__ = com_tilbuci_display_BaseImage;
com_tilbuci_display_ParagraphImage.prototype = $extend(com_tilbuci_display_BaseImage.prototype,{
	_text: null
	,_format: null
	,_loadTimer: null
	,_scrollPos: null
	,setFormat: function(font,size,color,bold,italic,leading,spacing,bg,align) {
		this._format.set_font(font);
		this._format.set_size(size);
		this._format.color = Std.parseInt(color);
		this._format.set_bold(bold);
		this._format.set_italic(italic);
		this._format.leading = leading;
		this._format.letterSpacing = spacing;
		switch(align) {
		case "center":
			this._format.align = 0;
			break;
		case "justify":
			this._format.align = 2;
			break;
		case "right":
			this._format.align = 4;
			break;
		default:
			this._format.align = 3;
		}
		this._text.set_defaultTextFormat(this._format);
		if(bg == "") {
			this._text.set_background(false);
		} else {
			this._text.set_backgroundColor(Std.parseInt(bg));
			this._text.set_background(true);
		}
	}
	,getProp: function(name) {
		switch(name) {
		case "fontLeading":
			return this._format.leading * 1.0;
		case "fontSize":
			return this._format.size * 1.0;
		case "fontSpacing":
			return this._format.letterSpacing;
		default:
			return 0;
		}
	}
	,getBoolProp: function(name) {
		switch(name) {
		case "fontBold":
			return this._format.bold;
		case "fontItalic":
			return this._format.italic;
		default:
			return false;
		}
	}
	,getStringlProp: function(name) {
		switch(name) {
		case "font":
			return this._format.font;
		case "fontColor":
			return "0x" + StringTools.hex(this._format.color);
		default:
			return "";
		}
	}
	,setTextSize: function(wd,ht) {
		this._text.set_width(this.oWidth = wd);
		this._text.set_height(this.oHeight = ht);
		this._text.set_scrollV(this._scrollPos);
	}
	,textScroll: function(val) {
		switch(val) {
		case -1:
			if(this._scrollPos > 0) {
				this._scrollPos = this._text.set_scrollV(this._scrollPos - 1);
			}
			break;
		case 0:
			this._scrollPos = this._text.set_scrollV(0);
			break;
		case 1:
			if(this._scrollPos < this._text.get_maxScrollV()) {
				this._scrollPos = this._text.set_scrollV(this._scrollPos + 1);
			}
			break;
		case 2:
			this._scrollPos = this._text.set_scrollV(this._text.get_maxScrollV());
			break;
		}
	}
	,setText: function(txt) {
		txt = com_tilbuci_data_GlobalPlayer.parser.parseString(txt);
		this._text.set_text(txt);
		this._scrollPos = this._text.set_scrollV(0);
	}
	,updateText: function() {
		this._text.set_text(com_tilbuci_data_GlobalPlayer.parser.parseString(this._text.get_text()));
	}
	,getText: function() {
		return this._text.get_text();
	}
	,load: function(txt) {
		txt = com_tilbuci_data_GlobalPlayer.parser.parseString(txt);
		this._lastMedia = txt;
		this._text.set_text(txt);
		this._text.set_scrollV(this._scrollPos = 0);
		if(this._loadTimer != null) {
			try {
				this._loadTimer.stop();
			} catch( _g ) {
			}
			this._loadTimer = null;
		}
		this._loadTimer = new haxe_Timer(100);
		this._loadTimer.run = $bind(this,this.onOk);
	}
	,kill: function() {
		com_tilbuci_display_BaseImage.prototype.kill.call(this);
		if(this._loadTimer != null) {
			try {
				this._loadTimer.stop();
			} catch( _g ) {
			}
			this._loadTimer = null;
		}
		this._text = null;
		this._format = null;
	}
	,onOk: function() {
		if(this._loadTimer != null) {
			try {
				this._loadTimer.stop();
			} catch( _g ) {
			}
			this._loadTimer = null;
		}
		this.oWidth = this._text.get_width();
		this.oHeight = this._text.get_height();
		this._onLoad(true);
	}
	,__class__: com_tilbuci_display_ParagraphImage
});
var com_tilbuci_display_PictureImage = function(ol) {
	com_tilbuci_display_BaseImage.call(this,"picture",false,ol);
	this._lastMedia = "";
	this._loader = new openfl_display_Loader();
	this._loader.contentLoaderInfo.addEventListener("complete",$bind(this,this.onOk));
	this._loader.contentLoaderInfo.addEventListener("ioError",$bind(this,this.onError));
	this._loader.contentLoaderInfo.addEventListener("securityError",$bind(this,this.onError));
	this.addChild(this._loader);
};
$hxClasses["com.tilbuci.display.PictureImage"] = com_tilbuci_display_PictureImage;
com_tilbuci_display_PictureImage.__name__ = "com.tilbuci.display.PictureImage";
com_tilbuci_display_PictureImage.__super__ = com_tilbuci_display_BaseImage;
com_tilbuci_display_PictureImage.prototype = $extend(com_tilbuci_display_BaseImage.prototype,{
	_loader: null
	,load: function(media) {
		media = StringTools.replace(media,com_tilbuci_data_GlobalPlayer.path + "media/picture/","");
		this._mediaLoaded = false;
		this._lastMedia = media;
		var path = com_tilbuci_data_GlobalPlayer.parser.parsePath(com_tilbuci_data_GlobalPlayer.path + "media/picture/" + media);
		this._loader.load(new openfl_net_URLRequest(path));
	}
	,unload: function() {
		this._mediaLoaded = false;
		this._lastMedia = "";
		try {
			this._loader.unload();
		} catch( _g ) {
		}
	}
	,kill: function() {
		com_tilbuci_display_BaseImage.prototype.kill.call(this);
		try {
			this._loader.unload();
		} catch( _g ) {
		}
		this._loader.contentLoaderInfo.removeEventListener("complete",$bind(this,this.onOk));
		this._loader.contentLoaderInfo.removeEventListener("ioError",$bind(this,this.onError));
		this._loader.contentLoaderInfo.removeEventListener("securityError",$bind(this,this.onError));
		this._loader = null;
		this._lastMedia = null;
	}
	,onOk: function(e) {
		this.oWidth = this._loader.content.get_width();
		this.oHeight = this._loader.content.get_height();
		var cont = this._loader.content;
		cont.smoothing = true;
		this._mediaLoaded = true;
		if(this._onLoad != null) {
			this._onLoad(true);
		}
	}
	,onError: function(e) {
		this._lastMedia = "";
		this._mediaLoaded = false;
		if(this._onLoad != null) {
			this._onLoad(false);
		}
	}
	,__class__: com_tilbuci_display_PictureImage
});
var com_tilbuci_display_ShapeImage = function(ol) {
	com_tilbuci_display_BaseImage.call(this,"shape",false,ol);
	this._shape = new openfl_display_Shape();
	this.addChild(this._shape);
};
$hxClasses["com.tilbuci.display.ShapeImage"] = com_tilbuci_display_ShapeImage;
com_tilbuci_display_ShapeImage.__name__ = "com.tilbuci.display.ShapeImage";
com_tilbuci_display_ShapeImage.__super__ = com_tilbuci_display_BaseImage;
com_tilbuci_display_ShapeImage.prototype = $extend(com_tilbuci_display_BaseImage.prototype,{
	_shape: null
	,_loadTimer: null
	,load: function(txt) {
		var ok = true;
		this._shape.set_rotation(0);
		this._shape.set_x(0);
		this._shape.set_y(0);
		this._shape.get_graphics().clear();
		var json = com_tilbuci_statictools_StringStatic.jsonParse(txt);
		if(json == false) {
			ok = false;
		} else if(Object.prototype.hasOwnProperty.call(json,"type") && Object.prototype.hasOwnProperty.call(json,"color") && Object.prototype.hasOwnProperty.call(json,"alpha") && Object.prototype.hasOwnProperty.call(json,"border") && Object.prototype.hasOwnProperty.call(json,"bdcolor") && Object.prototype.hasOwnProperty.call(json,"bdalpha") && Object.prototype.hasOwnProperty.call(json,"rotation")) {
			this._shape.get_graphics().beginFill(0,0);
			this._shape.get_graphics().drawRect(0,0,256,256);
			this._shape.get_graphics().endFill();
			this._shape.get_graphics().beginFill(Std.parseInt(Reflect.field(json,"color")),Reflect.field(json,"alpha"));
			if(Reflect.field(json,"border") > 0) {
				this._shape.get_graphics().lineStyle(Reflect.field(json,"border"),Std.parseInt(Reflect.field(json,"bdcolor")),Reflect.field(json,"bdalpha"));
			} else {
				json.border = 0.2;
				this._shape.get_graphics().lineStyle(0.2,Std.parseInt(Reflect.field(json,"color")),Reflect.field(json,"alpha"));
			}
			switch(Reflect.field(json,"type")) {
			case "circle":
				this._shape.get_graphics().drawCircle(128,128,128 - 2 * Reflect.field(json,"border"));
				ok = true;
				break;
			case "decagon":
				this._shape.get_graphics().moveTo(87,6);
				this._shape.get_graphics().lineTo(169,6);
				this._shape.get_graphics().lineTo(231,53);
				this._shape.get_graphics().lineTo(256 - Reflect.field(json,"border") / 2,128);
				this._shape.get_graphics().lineTo(231,203);
				this._shape.get_graphics().lineTo(169,250);
				this._shape.get_graphics().lineTo(87,250);
				this._shape.get_graphics().lineTo(25,203);
				this._shape.get_graphics().lineTo(Reflect.field(json,"border") / 2,128);
				this._shape.get_graphics().lineTo(25,53);
				this._shape.get_graphics().lineTo(87,6);
				ok = true;
				break;
			case "eneagon":
				this._shape.get_graphics().moveTo(128,3);
				this._shape.get_graphics().lineTo(210,34);
				this._shape.get_graphics().lineTo(256 - Reflect.field(json,"border") / 2,110);
				this._shape.get_graphics().lineTo(239,196);
				this._shape.get_graphics().lineTo(173,253);
				this._shape.get_graphics().lineTo(83,253);
				this._shape.get_graphics().lineTo(17,196);
				this._shape.get_graphics().lineTo(Reflect.field(json,"border") / 2,110);
				this._shape.get_graphics().lineTo(46,34);
				this._shape.get_graphics().lineTo(128,3);
				ok = true;
				break;
			case "heptagon":
				this._shape.get_graphics().moveTo(128,3);
				this._shape.get_graphics().lineTo(228,54);
				this._shape.get_graphics().lineTo(256 - Reflect.field(json,"border") / 2,165);
				this._shape.get_graphics().lineTo(183,253);
				this._shape.get_graphics().lineTo(73,253);
				this._shape.get_graphics().lineTo(Reflect.field(json,"border") / 2,165);
				this._shape.get_graphics().lineTo(28,54);
				this._shape.get_graphics().lineTo(128,3);
				ok = true;
				break;
			case "hexagon":
				this._shape.get_graphics().moveTo(65,0);
				this._shape.get_graphics().lineTo(191,0);
				this._shape.get_graphics().lineTo(256 - Reflect.field(json,"border") / 2,108);
				this._shape.get_graphics().lineTo(191,216);
				this._shape.get_graphics().lineTo(65,216);
				this._shape.get_graphics().lineTo(Reflect.field(json,"border") / 2,108);
				this._shape.get_graphics().lineTo(65,0);
				ok = true;
				break;
			case "isoscelestriangle":
				this._shape.get_graphics().moveTo(128,Reflect.field(json,"border") / 2);
				this._shape.get_graphics().lineTo(256 - Reflect.field(json,"border") / 2,256 - Reflect.field(json,"border") / 2);
				this._shape.get_graphics().lineTo(Reflect.field(json,"border") / 2,256 - Reflect.field(json,"border") / 2);
				this._shape.get_graphics().lineTo(128,Reflect.field(json,"border") / 2);
				ok = true;
				break;
			case "octagon":
				this._shape.get_graphics().moveTo(75,Reflect.field(json,"border") / 2);
				this._shape.get_graphics().lineTo(181,Reflect.field(json,"border") / 2);
				this._shape.get_graphics().lineTo(256 - Reflect.field(json,"border") / 2,75);
				this._shape.get_graphics().lineTo(256 - Reflect.field(json,"border") / 2,181);
				this._shape.get_graphics().lineTo(181,256 - Reflect.field(json,"border") / 2);
				this._shape.get_graphics().lineTo(75,256 - Reflect.field(json,"border") / 2);
				this._shape.get_graphics().lineTo(Reflect.field(json,"border") / 2,181);
				this._shape.get_graphics().lineTo(Reflect.field(json,"border") / 2,75);
				this._shape.get_graphics().lineTo(75,Reflect.field(json,"border") / 2);
				ok = true;
				break;
			case "pentagon":
				this._shape.get_graphics().moveTo(128,Reflect.field(json,"border") / 2);
				this._shape.get_graphics().lineTo(256 - Reflect.field(json,"border") / 2,98);
				this._shape.get_graphics().lineTo(206,256 - Reflect.field(json,"border") / 2);
				this._shape.get_graphics().lineTo(50,256 - Reflect.field(json,"border") / 2);
				this._shape.get_graphics().lineTo(Reflect.field(json,"border") / 2,98);
				this._shape.get_graphics().lineTo(128,Reflect.field(json,"border") / 2);
				ok = true;
				break;
			case "righttriangle":
				this._shape.get_graphics().moveTo(Reflect.field(json,"border") / 2,Reflect.field(json,"border") / 2);
				this._shape.get_graphics().lineTo(256 - Reflect.field(json,"border") / 2,256 - Reflect.field(json,"border") / 2);
				this._shape.get_graphics().lineTo(Reflect.field(json,"border") / 2,256 - Reflect.field(json,"border") / 2);
				this._shape.get_graphics().lineTo(Reflect.field(json,"border") / 2,Reflect.field(json,"border") / 2);
				ok = true;
				break;
			case "square":
				this._shape.get_graphics().drawRect(Reflect.field(json,"border") / 2,Reflect.field(json,"border") / 2,256 - 2 * Reflect.field(json,"border"),256 - 2 * Reflect.field(json,"border"));
				ok = true;
				break;
			case "triangle":
				this._shape.get_graphics().moveTo(128,0);
				this._shape.get_graphics().lineTo(256 - Reflect.field(json,"border") / 2,220);
				this._shape.get_graphics().lineTo(Reflect.field(json,"border") / 2,220);
				this._shape.get_graphics().lineTo(128,0);
				ok = true;
				break;
			default:
				ok = false;
			}
			this._shape.get_graphics().endFill();
			this._shape.set_rotation(Reflect.field(json,"rotation"));
			var bounds = this._shape.getBounds(this);
			this._shape.set_x(-bounds.x);
			this._shape.set_y(-bounds.y);
			this.oWidth = bounds.width;
			this.oHeight = bounds.height;
		} else {
			ok = false;
		}
		if(this._loadTimer != null) {
			try {
				this._loadTimer.stop();
			} catch( _g ) {
			}
			this._loadTimer = null;
		}
		this._loadTimer = new haxe_Timer(100);
		if(ok) {
			this._loadTimer.run = $bind(this,this.onOk);
		} else {
			this._loadTimer.run = $bind(this,this.onError);
		}
	}
	,kill: function() {
		com_tilbuci_display_BaseImage.prototype.kill.call(this);
		if(this._loadTimer != null) {
			try {
				this._loadTimer.stop();
			} catch( _g ) {
			}
			this._loadTimer = null;
		}
		this._shape.get_graphics().clear();
		this._shape = null;
	}
	,onOk: function() {
		if(this._loadTimer != null) {
			try {
				this._loadTimer.stop();
			} catch( _g ) {
			}
			this._loadTimer = null;
		}
		this._onLoad(true);
	}
	,onError: function() {
		if(this._loadTimer != null) {
			try {
				this._loadTimer.stop();
			} catch( _g ) {
			}
			this._loadTimer = null;
		}
		this._onLoad(false);
	}
	,__class__: com_tilbuci_display_ShapeImage
});
var com_tilbuci_display_SpritemapImage = function(ol) {
	this._display = [];
	this._current = 0;
	this._warn = true;
	this.playOnLoad = true;
	this.frtime = 100;
	this.frames = 1;
	com_tilbuci_display_BaseImage.call(this,"spritemap",false,ol);
	this._loader = new openfl_display_Loader();
	this._loader.contentLoaderInfo.addEventListener("complete",$bind(this,this.onOk));
	this._loader.contentLoaderInfo.addEventListener("ioError",$bind(this,this.onError));
	this._loader.contentLoaderInfo.addEventListener("securityError",$bind(this,this.onError));
};
$hxClasses["com.tilbuci.display.SpritemapImage"] = com_tilbuci_display_SpritemapImage;
com_tilbuci_display_SpritemapImage.__name__ = "com.tilbuci.display.SpritemapImage";
com_tilbuci_display_SpritemapImage.__super__ = com_tilbuci_display_BaseImage;
com_tilbuci_display_SpritemapImage.prototype = $extend(com_tilbuci_display_BaseImage.prototype,{
	frames: null
	,frtime: null
	,playOnLoad: null
	,_loader: null
	,_warn: null
	,_current: null
	,_timer: null
	,_display: null
	,load: function(media) {
		media = StringTools.replace(media,com_tilbuci_data_GlobalPlayer.path + "media/spritemap/","");
		this._lastMedia = media;
		this._mediaLoaded = false;
		if(this._timer != null) {
			try {
				this._timer.stop();
			} catch( _g ) {
			}
			this._timer = null;
		}
		this.removeChildren();
		while(this._display.length > 0) {
			var bmp = this._display.shift();
			bmp.get_bitmapData().dispose();
			bmp = null;
		}
		var path = com_tilbuci_data_GlobalPlayer.parser.parsePath(com_tilbuci_data_GlobalPlayer.path + "media/spritemap/" + media);
		this._loader.load(new openfl_net_URLRequest(path));
	}
	,unload: function() {
		this._mediaLoaded = false;
		this._lastMedia = "";
		try {
			this._loader.unload();
		} catch( _g ) {
		}
		if(this._timer != null) {
			try {
				this._timer.stop();
			} catch( _g ) {
			}
			this._timer = null;
		}
	}
	,kill: function() {
		com_tilbuci_display_BaseImage.prototype.kill.call(this);
		try {
			this._loader.unload();
		} catch( _g ) {
		}
		this._loader.contentLoaderInfo.removeEventListener("complete",$bind(this,this.onOk));
		this._loader.contentLoaderInfo.removeEventListener("ioError",$bind(this,this.onError));
		this._loader.contentLoaderInfo.removeEventListener("securityError",$bind(this,this.onError));
		this._loader = null;
		while(this._display.length > 0) {
			var bmp = this._display.shift();
			bmp.get_bitmapData().dispose();
			bmp = null;
		}
		this._display = null;
		if(this._timer != null) {
			try {
				this._timer.stop();
			} catch( _g ) {
			}
			this._timer = null;
		}
	}
	,updateFrames: function(fr,tm) {
		if(this._mediaLoaded) {
			this.frames = fr;
			this.frtime = tm;
			this._warn = false;
			this.load(this._lastMedia);
		}
	}
	,onOk: function(e) {
		if(this._timer != null) {
			try {
				this._timer.stop();
			} catch( _g ) {
			}
			this._timer = null;
		}
		this._mediaLoaded = true;
		this.oWidth = this._loader.content.get_width() / this.frames;
		this.oHeight = this._loader.content.get_height();
		var _g = 0;
		var _g1 = this.frames;
		while(_g < _g1) {
			var i = _g++;
			var bdata = new openfl_display_BitmapData(Math.ceil(this.oWidth),Math.ceil(this.oHeight),true,0);
			bdata.draw(this._loader,new openfl_geom_Matrix(1,0,0,1,-i * this.oWidth,0),null,null,new openfl_geom_Rectangle(0,0,this.oWidth,this.oHeight));
			var bmp = new openfl_display_Bitmap(bdata);
			bmp.smoothing = true;
			this._display.push(bmp);
		}
		this._loader.unload();
		this._current = 0;
		this.loadFrame();
		if(this._warn && this._onLoad != null) {
			this._onLoad(true);
		}
		if(this.playOnLoad) {
			this._timer = new haxe_Timer(this.frtime);
			this._timer.run = $bind(this,this.nextFrame);
		}
		this._warn = true;
	}
	,pause: function() {
		this.playOnLoad = false;
		if(this._timer != null) {
			try {
				this._timer.stop();
				this._timer = null;
			} catch( _g ) {
			}
		}
	}
	,play: function() {
		this.pause();
		this.playOnLoad = true;
		this._timer = new haxe_Timer(this.frtime);
		this._timer.run = $bind(this,this.nextFrame);
	}
	,setFrame: function(num) {
		if(num > 0 && num <= this.frames) {
			this.pause();
			this._current = num - 1;
			this.loadFrame();
			return true;
		} else {
			return false;
		}
	}
	,loadFrame: function() {
		this.removeChildren();
		this.addChild(this._display[this._current]);
	}
	,nextFrame: function() {
		this._current++;
		if(this._current >= this.frames) {
			this._current = 0;
		}
		this.loadFrame();
	}
	,onError: function(e) {
		this._warn = true;
		this._mediaLoaded = false;
		if(this._onLoad != null) {
			this._onLoad(false);
		}
	}
	,__class__: com_tilbuci_display_SpritemapImage
});
var com_tilbuci_display_TextImage = function(ol) {
	com_tilbuci_display_BaseImage.call(this,"text",false,ol);
	this._text = new openfl_text_TextField();
	this._text.set_selectable(false);
	this._format = new openfl_text_TextFormat();
	this._format.align = 3;
	this._text.set_defaultTextFormat(this._format);
	this._text.set_wordWrap(false);
	this._text.set_multiline(false);
	this._text.set_embedFonts(true);
	this._text.set_cacheAsBitmap(true);
	this.addChild(this._text);
};
$hxClasses["com.tilbuci.display.TextImage"] = com_tilbuci_display_TextImage;
com_tilbuci_display_TextImage.__name__ = "com.tilbuci.display.TextImage";
com_tilbuci_display_TextImage.__super__ = com_tilbuci_display_BaseImage;
com_tilbuci_display_TextImage.prototype = $extend(com_tilbuci_display_BaseImage.prototype,{
	_text: null
	,_format: null
	,_loadTimer: null
	,setFormat: function(font,size,color,bold,italic,leading,spacing,bg) {
		this._format.set_font(font);
		this._format.set_size(size);
		this._format.color = Std.parseInt(color);
		this._format.set_bold(bold);
		this._format.set_italic(italic);
		this._format.leading = leading;
		this._format.letterSpacing = spacing;
		this._text.set_defaultTextFormat(this._format);
		if(bg == "") {
			this._text.set_background(false);
		} else {
			this._text.set_backgroundColor(Std.parseInt(bg));
			this._text.set_background(true);
		}
	}
	,getText: function() {
		return this._text.get_text();
	}
	,load: function(txt) {
		txt = txt.split("\r").join("");
		txt = com_tilbuci_data_GlobalPlayer.parser.parseString(txt);
		var wd = 0;
		this._format.align = 3;
		this._text.set_autoSize(1);
		var _g = 0;
		var _g1 = txt.length;
		while(_g < _g1) {
			var i = _g++;
			this._text.set_text(txt.charAt(i).toUpperCase());
			var metrics = this._text.getLineMetrics(0);
			wd += metrics.width;
		}
		this._format.align = 0;
		this._text.set_autoSize(2);
		this._text.set_width(wd - txt.length * 0.4);
		this._text.set_text(txt);
		if(this._loadTimer != null) {
			try {
				this._loadTimer.stop();
			} catch( _g ) {
			}
			this._loadTimer = null;
		}
		this._loadTimer = new haxe_Timer(100);
		this._loadTimer.run = $bind(this,this.onOk);
	}
	,kill: function() {
		com_tilbuci_display_BaseImage.prototype.kill.call(this);
		if(this._loadTimer != null) {
			try {
				this._loadTimer.stop();
			} catch( _g ) {
			}
			this._loadTimer = null;
		}
		this._text = null;
		this._format = null;
	}
	,onOk: function() {
		if(this._loadTimer != null) {
			try {
				this._loadTimer.stop();
			} catch( _g ) {
			}
			this._loadTimer = null;
		}
		this.oWidth = this._text.get_width();
		this.oHeight = this._text.get_height();
		this._onLoad(true);
	}
	,__class__: com_tilbuci_display_TextImage
});
var com_tilbuci_display_TilBuciImage = function(ol,name,tac) {
	this._playing = false;
	this._useTimer = false;
	this._name = "";
	this._loadOK = false;
	this._oHeight = 0;
	this._oWidth = 0;
	this.assetOrder = 0;
	this._currentAction = "";
	this._currentTime = 0;
	this._totalTime = 1;
	openfl_display_Sprite.call(this);
	this._onLoad = ol;
	this.get_graphics().beginFill(0,0);
	this.get_graphics().drawRect(0,0,8,8);
	this.get_graphics().endFill();
	this._name = name;
	this._onTimedAc = tac;
	this._picture = new com_tilbuci_display_PictureImage($bind(this,this.onLoad));
	this.addChild(this._picture);
	this._video = new com_tilbuci_display_VideoImage($bind(this,this.onLoad),$bind(this,this.onEnd),tac);
	this.addChild(this._video);
	this._audio = new com_tilbuci_display_AudioImage($bind(this,this.onLoad),$bind(this,this.onEnd),tac);
	this.addChild(this._audio);
	this._text = new com_tilbuci_display_TextImage($bind(this,this.onLoad));
	this.addChild(this._text);
	this._paragraph = new com_tilbuci_display_ParagraphImage($bind(this,this.onLoad));
	this.addChild(this._paragraph);
	this._html = new com_tilbuci_display_HtmlImage($bind(this,this.onLoad));
	this.addChild(this._html);
	this._spritemap = new com_tilbuci_display_SpritemapImage($bind(this,this.onLoad));
	this.addChild(this._spritemap);
	this._shape = new com_tilbuci_display_ShapeImage($bind(this,this.onLoad));
	this.addChild(this._shape);
};
$hxClasses["com.tilbuci.display.TilBuciImage"] = com_tilbuci_display_TilBuciImage;
com_tilbuci_display_TilBuciImage.__name__ = "com.tilbuci.display.TilBuciImage";
com_tilbuci_display_TilBuciImage.__super__ = openfl_display_Sprite;
com_tilbuci_display_TilBuciImage.prototype = $extend(openfl_display_Sprite.prototype,{
	_picture: null
	,_video: null
	,_audio: null
	,_text: null
	,_paragraph: null
	,_html: null
	,_spritemap: null
	,_shape: null
	,_currentType: null
	,_totalTime: null
	,_currentTime: null
	,_currentAction: null
	,assetOrder: null
	,_onLoad: null
	,_oWidth: null
	,_oHeight: null
	,_loadOK: null
	,_name: null
	,_timer: null
	,_useTimer: null
	,playing: null
	,_playing: null
	,get_playing: function() {
		return this._playing;
	}
	,currentType: null
	,get_currentType: function() {
		return this._currentType;
	}
	,currentMedia: null
	,get_currentMedia: function() {
		switch(this._currentType) {
		case "audio":
			return this._audio.get_lastMedia();
		case "paragraph":
			return this._paragraph.get_lastMedia();
		case "picture":
			return this._picture.get_lastMedia();
		case "spritemap":
			return this._spritemap.get_lastMedia();
		case "video":
			return this._video.get_lastMedia();
		default:
			return "";
		}
	}
	,_onTimedAc: null
	,load: function(inf) {
		if(inf.ok) {
			var ret = false;
			switch(com_tilbuci_data_GlobalPlayer.movie.collections.h[inf.collection].assets.h[inf.asset].type) {
			case "audio":
				this._audio.load(com_tilbuci_data_GlobalPlayer.movie.collections.h[inf.collection].assets.h[inf.asset].file.h["@" + com_tilbuci_data_GlobalPlayer.multiply]);
				this._currentType = "audio";
				this._useTimer = false;
				break;
			case "html":
				this._html.load(com_tilbuci_data_GlobalPlayer.movie.collections.h[inf.collection].assets.h[inf.asset].file.h["@" + com_tilbuci_data_GlobalPlayer.multiply]);
				this._currentType = "html";
				this._useTimer = true;
				break;
			case "paragraph":
				this._paragraph.load(com_tilbuci_data_GlobalPlayer.movie.collections.h[inf.collection].assets.h[inf.asset].file.h["@" + com_tilbuci_data_GlobalPlayer.multiply]);
				this._currentType = "paragraph";
				this._useTimer = true;
				break;
			case "picture":
				this._picture.load(com_tilbuci_data_GlobalPlayer.movie.collections.h[inf.collection].assets.h[inf.asset].file.h["@" + com_tilbuci_data_GlobalPlayer.multiply]);
				this._currentType = "picture";
				this._useTimer = true;
				break;
			case "shape":
				this._shape.load(com_tilbuci_data_GlobalPlayer.movie.collections.h[inf.collection].assets.h[inf.asset].file.h["@" + com_tilbuci_data_GlobalPlayer.multiply]);
				this._currentType = "shape";
				this._useTimer = true;
				break;
			case "spritemap":
				this._spritemap.frames = com_tilbuci_data_GlobalPlayer.movie.collections.h[inf.collection].assets.h[inf.asset].frames;
				this._spritemap.frtime = com_tilbuci_data_GlobalPlayer.movie.collections.h[inf.collection].assets.h[inf.asset].frtime;
				this._spritemap.load(com_tilbuci_data_GlobalPlayer.movie.collections.h[inf.collection].assets.h[inf.asset].file.h["@" + com_tilbuci_data_GlobalPlayer.multiply]);
				this._currentType = "spritemap";
				this._useTimer = true;
				break;
			case "text":
				this._text.load(com_tilbuci_data_GlobalPlayer.movie.collections.h[inf.collection].assets.h[inf.asset].file.h["@" + com_tilbuci_data_GlobalPlayer.multiply]);
				this._currentType = "text";
				this._useTimer = true;
				break;
			case "video":
				this._video.load(com_tilbuci_data_GlobalPlayer.movie.collections.h[inf.collection].assets.h[inf.asset].file.h["@" + com_tilbuci_data_GlobalPlayer.multiply]);
				this._currentType = "video";
				this._useTimer = false;
				break;
			}
			this._totalTime = com_tilbuci_data_GlobalPlayer.movie.collections.h[inf.collection].assets.h[inf.asset].time;
			this._currentAction = com_tilbuci_data_GlobalPlayer.movie.collections.h[inf.collection].assets.h[inf.asset].action;
			this.assetOrder = com_tilbuci_data_GlobalPlayer.movie.collections.h[inf.collection].assets.h[inf.asset].order;
			this._loadOK = false;
			return true;
		} else {
			this._loadOK = false;
			return false;
		}
	}
	,loadAsset: function(asset) {
		switch(asset.type) {
		case "audio":
			this._audio.load(asset.file.h["@" + com_tilbuci_data_GlobalPlayer.multiply]);
			this._currentType = "audio";
			this._useTimer = false;
			break;
		case "html":
			this._html.load(asset.file.h["@" + com_tilbuci_data_GlobalPlayer.multiply]);
			this._currentType = "html";
			this._useTimer = true;
			break;
		case "paragraph":
			this._paragraph.load(asset.file.h["@" + com_tilbuci_data_GlobalPlayer.multiply]);
			this._currentType = "paragraph";
			this._useTimer = true;
			break;
		case "picture":
			this._picture.load(asset.file.h["@" + com_tilbuci_data_GlobalPlayer.multiply]);
			this._currentType = "picture";
			this._useTimer = true;
			break;
		case "shape":
			this._shape.load(asset.file.h["@" + com_tilbuci_data_GlobalPlayer.multiply]);
			this._currentType = "shape";
			this._useTimer = true;
			break;
		case "spritemap":
			this._spritemap.frames = asset.frames;
			this._spritemap.frtime = asset.frtime;
			this._spritemap.load(asset.file.h["@" + com_tilbuci_data_GlobalPlayer.multiply]);
			this._currentType = "spritemap";
			this._useTimer = true;
			break;
		case "text":
			this._text.load(asset.file.h["@" + com_tilbuci_data_GlobalPlayer.multiply]);
			this._currentType = "text";
			this._useTimer = true;
			break;
		case "video":
			this._video.load(asset.file.h["@" + com_tilbuci_data_GlobalPlayer.multiply]);
			this._currentType = "video";
			this._useTimer = false;
			break;
		}
		this._totalTime = asset.time;
		this._currentAction = asset.action;
		this.assetOrder = asset.order;
		this._loadOK = false;
		return true;
	}
	,updateFrames: function(fr,tm) {
		if(this._currentType == "spritemap") {
			this._spritemap.updateFrames(fr,tm);
		}
	}
	,startTimer: function() {
		if(this._timer != null) {
			try {
				this._timer.stop();
			} catch( _g ) {
			}
			this._timer = null;
		}
		if(this._useTimer) {
			this._currentTime = 0;
			if(this._loadOK) {
				this._timer = new haxe_Timer(1000);
				this._timer.run = $bind(this,this.onTimer);
			}
		} else if(this._currentType == "video") {
			this._video.play();
		} else if(this._currentType == "audio") {
			this._audio.play();
		}
		this._playing = true;
	}
	,stopTimer: function() {
		this._currentTime = 0;
		if(this._timer != null) {
			try {
				this._timer.stop();
			} catch( _g ) {
			}
			this._timer = null;
		}
		this._video.pause();
		this._audio.pause();
		this._playing = false;
	}
	,getTime: function() {
		if(this._useTimer) {
			return this._currentTime;
		} else if(this._currentType == "video") {
			return this._video.getTime();
		} else if(this._currentType == "audio") {
			return this._audio.getTime();
		} else {
			return 0;
		}
	}
	,getProp: function(name) {
		switch(name) {
		case "fontLeading":
			return this._paragraph.getProp("fontLeading");
		case "fontSize":
			return this._paragraph.getProp("fontSize");
		case "fontSpacing":
			return this._paragraph.getProp("fontSpacing");
		default:
			return 0;
		}
	}
	,getBoolProp: function(name) {
		switch(name) {
		case "fontBold":
			return this._paragraph.getBoolProp("fontBold");
		case "fontItalic":
			return this._paragraph.getBoolProp("fontItalic");
		default:
			return false;
		}
	}
	,getStringProp: function(name) {
		switch(name) {
		case "font":
			return this._paragraph.getStringlProp("font");
		case "fontColor":
			return this._paragraph.getStringlProp("fontColor");
		case "text":
			if(this._currentType == "text") {
				return this._text.getText();
			} else if(this._currentType == "paragraph") {
				return this._paragraph.getText();
			} else if(this._currentType == "html") {
				return this._html.getText();
			} else {
				return "";
			}
			break;
		default:
			return "";
		}
	}
	,playPause: function() {
		if(this._useTimer) {
			if(this._timer != null) {
				try {
					this._timer.stop();
				} catch( _g ) {
				}
				this._timer = null;
				this._playing = false;
			} else {
				this._timer = new haxe_Timer(1000);
				this._timer.run = $bind(this,this.onTimer);
				this._playing = true;
			}
		} else {
			if(this._playing) {
				if(this._currentType == "video") {
					this._video.pause();
				} else if(this._currentType == "audio") {
					this._audio.pause();
				}
			} else if(this._currentType == "video") {
				this._video.play();
			} else if(this._currentType == "audio") {
				this._audio.play();
			}
			this._playing = !this._playing;
		}
	}
	,play: function() {
		if(this._useTimer) {
			if(this._timer == null) {
				this._timer = new haxe_Timer(1000);
				this._timer.run = $bind(this,this.onTimer);
			}
		} else if(this._currentType == "video") {
			this._video.play();
		} else if(this._currentType == "audio") {
			this._audio.play();
		}
		this._playing = true;
	}
	,pause: function() {
		if(this._useTimer) {
			if(this._timer != null) {
				try {
					this._timer.stop();
				} catch( _g ) {
				}
				this._timer = null;
			}
		} else if(this._currentType == "video") {
			this._video.pause();
		} else if(this._currentType == "audio") {
			this._audio.pause();
		}
		this._playing = false;
	}
	,stop: function() {
		if(this._timer != null) {
			try {
				this._timer.stop();
			} catch( _g ) {
			}
			this._timer = null;
		}
		this._playing = false;
		this._currentTime = 0;
		this._video.stop();
		this._audio.stop();
	}
	,seek: function(time) {
		if(time < 0) {
			time = 0;
		}
		if(this._useTimer) {
			this._currentTime = time;
		} else if(this._currentType == "video") {
			this._video.setTime(time);
		} else if(this._currentType == "audio") {
			this._audio.setTime(time);
		}
	}
	,formatText: function(font,size,color,bold,italic,leading,spacing,bg,align) {
		this._text.setFormat(font,size,color,bold,italic,leading,spacing,bg);
		this._paragraph.setFormat(font,size,color,bold,italic,leading,spacing,bg,align);
		this._html.setFormat(font,size,color,bold,italic,leading,spacing,bg,align);
	}
	,setTextSize: function(wd,ht) {
		this._paragraph.setTextSize(wd,ht);
		this._html.setTextSize(wd,ht);
		if(this._currentType == "paragraph" || this._currentType == "html") {
			this._oWidth = wd;
			this._oHeight = ht;
		}
	}
	,textScroll: function(val) {
		if(this._currentType == "paragraph") {
			this._paragraph.textScroll(val);
		} else if(this._currentType == "html") {
			this._html.textScroll(val);
		}
	}
	,setText: function(txt) {
		if(this._currentType == "paragraph") {
			this._paragraph.setText(txt);
		} else if(this._currentType == "html") {
			this._html.setText(txt);
		}
	}
	,updateText: function() {
		if(this._currentType == "paragraph") {
			this._paragraph.updateText();
		}
	}
	,iterateSound: function(vol,pan) {
		this._video.iterateSound(vol,pan);
		this._audio.iterateSound(vol,pan);
	}
	,stopSound: function() {
		this._video.stopSound();
		this._audio.stopSound();
	}
	,onTimer: function() {
		this._currentTime++;
		this._onTimedAc(this._currentTime);
		if(this._currentTime >= this._totalTime) {
			this._currentTime = 0;
			if(this._useTimer) {
				this.endAction();
			}
		}
	}
	,onEnd: function() {
		this._playing = true;
		if(this._currentType == "video") {
			if(this._currentAction != "next" && this._currentAction != "previous" && this._currentAction != "stop") {
				this._video.setTime(0);
				this._video.play();
			}
		} else if(this._currentType == "audio") {
			if(this._currentAction != "next" && this._currentAction != "previous" && this._currentAction != "stop") {
				this._audio.setTime(0);
				this._audio.play();
			}
		}
		this.endAction();
	}
	,endAction: function() {
		if(this._currentAction != "") {
			switch(this._currentAction) {
			case "":
				break;
			case "loop":
				break;
			case "next":
				com_tilbuci_data_GlobalPlayer.parser.run("{\"ac\":\"instance.next\",\"param\":[\"" + this._name + "\"]}");
				break;
			case "previous":
				com_tilbuci_data_GlobalPlayer.parser.run("{\"ac\":\"instance.previous\",\"param\":[\"" + this._name + "\"]}");
				break;
			case "stop":
				com_tilbuci_data_GlobalPlayer.parser.run("{\"ac\":\"instance.stop\",\"param\":[\"" + this._name + "\"]}");
				break;
			default:
				com_tilbuci_data_GlobalPlayer.parser.run(this._currentAction);
			}
		}
	}
	,kill: function() {
		this.removeChildren();
		this.get_graphics().clear();
		this._picture.kill();
		this._picture = null;
		this._video.kill();
		this._video = null;
		this._audio.kill();
		this._audio = null;
		this._text.kill();
		this._text = null;
		this._paragraph.kill();
		this._paragraph = null;
		this._html.kill();
		this._html = null;
		this._spritemap.kill();
		this._spritemap = null;
		this._shape.kill();
		this._shape = null;
		this._onLoad = null;
		this._currentType = null;
		this._currentAction = null;
		if(this._timer != null) {
			try {
				this._timer.stop();
			} catch( _g ) {
			}
			this._timer = null;
			this._playing = false;
		}
		this._name = null;
		this._onTimedAc = null;
	}
	,oWidth: function() {
		return this._oWidth;
	}
	,oHeight: function() {
		return this._oHeight;
	}
	,loadOK: function() {
		return this._loadOK;
	}
	,onLoad: function(ok) {
		if(ok) {
			this._picture.set_visible(false);
			this._video.set_visible(false);
			this._audio.set_visible(false);
			this._text.set_visible(false);
			this._paragraph.set_visible(false);
			this._html.set_visible(false);
			this._spritemap.set_visible(false);
			this._shape.set_visible(false);
			this.removeChildren();
			switch(this._currentType) {
			case "audio":
				this._audio.set_visible(true);
				this._oWidth = this._audio.set_width(8);
				this._oHeight = this._audio.set_height(8);
				this.addChild(this._audio);
				break;
			case "html":
				this._html.set_visible(true);
				this._html.set_width(this._oWidth = this._html.oWidth);
				this._html.set_height(this._oHeight = this._html.oHeight);
				this._html.set_cacheAsBitmap(true);
				this.addChild(this._html);
				break;
			case "paragraph":
				this._paragraph.set_visible(true);
				this._paragraph.set_width(this._oWidth = this._paragraph.oWidth);
				this._paragraph.set_height(this._oHeight = this._paragraph.oHeight);
				this._paragraph.set_cacheAsBitmap(true);
				this.addChild(this._paragraph);
				break;
			case "picture":
				this._picture.set_visible(true);
				this._picture.set_width(this._oWidth = this._picture.oWidth);
				this._picture.set_height(this._oHeight = this._picture.oHeight);
				this.addChild(this._picture);
				break;
			case "shape":
				this._shape.set_visible(true);
				this._shape.set_width(this._oWidth = this._shape.oWidth);
				this._shape.set_height(this._oHeight = this._shape.oHeight);
				this._shape.set_cacheAsBitmap(true);
				this.addChild(this._shape);
				break;
			case "spritemap":
				this._spritemap.set_visible(true);
				this._spritemap.set_width(this._oWidth = this._spritemap.oWidth);
				this._spritemap.set_height(this._oHeight = this._spritemap.oHeight);
				this._spritemap.set_cacheAsBitmap(true);
				this.addChild(this._spritemap);
				break;
			case "text":
				this._text.set_visible(true);
				this._text.set_width(this._oWidth = this._text.oWidth);
				this._text.set_height(this._oHeight = this._text.oHeight);
				this._text.set_cacheAsBitmap(true);
				this.addChild(this._text);
				break;
			case "video":
				this._video.set_visible(true);
				this._oWidth = this._video.set_width(this._video.oWidth);
				this._oHeight = this._video.set_height(this._video.oHeight);
				this.addChild(this._video);
				break;
			}
		}
		this.set_width(this.set_height(com_tilbuci_data_GlobalPlayer.mdata.screen.big / 2 * com_tilbuci_data_GlobalPlayer.multiply));
		this._loadOK = ok;
		this._onLoad(ok);
	}
	,__class__: com_tilbuci_display_TilBuciImage
	,__properties__: $extend(openfl_display_Sprite.prototype.__properties__,{get_currentMedia:"get_currentMedia",get_currentType:"get_currentType",get_playing:"get_playing"})
});
var com_tilbuci_display_VideoImage = function(ol,end,ta) {
	this._lasttime = 0;
	this._current = "";
	this._loaded = false;
	com_tilbuci_display_BaseImage.call(this,"video",true,ol);
	this._onEnd = end;
	this._onTimedAc = ta;
	this._bg = new openfl_display_Shape();
	this._bg.get_graphics().beginFill(0);
	this._bg.get_graphics().drawRect(0,0,32,32);
	this._bg.get_graphics().endFill();
	this.addChild(this._bg);
	this._video = new openfl_media_Video();
	this._video.smoothing = true;
	this.addChild(this._video);
	this._connection = new openfl_net_NetConnection();
	this._connection.addEventListener("securityError",$bind(this,this.securityErrorHandler));
	this._connection.addEventListener("ioError",$bind(this,this.ioErrorHandler));
	this._connection.addEventListener("netStatus",$bind(this,this.netStatusHandler));
	this._connection.addEventListener("asyncError",$bind(this,this.asyncErrorHandler));
	this._connection.connect(null);
	this._stream = new openfl_net_NetStream(this._connection);
	this._stream.checkPolicyFile = true;
	this._stream.addEventListener("asyncError",$bind(this,this.asyncErrorHandler));
	this._stream.addEventListener("ioError",$bind(this,this.ioErrorHandler));
	this._stream.addEventListener("netStatus",$bind(this,this.netStatusHandler));
	var clientObj = { "onMetaData" : $bind(this,this.metadataEvent), "onImageData" : $bind(this,this.imagedataEvent), "onPlayStatus" : $bind(this,this.playstatusEvent), "onCuePoint" : $bind(this,this.cuepointEvent)};
	this._stream.client = clientObj;
	this._video.attachNetStream(this._stream);
};
$hxClasses["com.tilbuci.display.VideoImage"] = com_tilbuci_display_VideoImage;
com_tilbuci_display_VideoImage.__name__ = "com.tilbuci.display.VideoImage";
com_tilbuci_display_VideoImage.__super__ = com_tilbuci_display_BaseImage;
com_tilbuci_display_VideoImage.prototype = $extend(com_tilbuci_display_BaseImage.prototype,{
	_video: null
	,_connection: null
	,_stream: null
	,_loaded: null
	,_bg: null
	,_onEnd: null
	,_current: null
	,_lasttime: null
	,_onTimedAc: null
	,getTime: function() {
		if(this._loaded) {
			return Math.round(this._stream.time);
		} else {
			return 0;
		}
	}
	,setTime: function(to) {
		if(this._loaded) {
			this._stream.seek(to);
		}
	}
	,load: function(media) {
		media = StringTools.replace(media,com_tilbuci_data_GlobalPlayer.path + "media/video/","");
		this._lastMedia = media;
		var path = com_tilbuci_data_GlobalPlayer.parser.parsePath(com_tilbuci_data_GlobalPlayer.path + "media/video/" + media);
		if(com_tilbuci_data_GlobalPlayer.mode == "editor") {
			this._loaded = false;
			this._current = "";
			this._stream.play(path);
		} else if(this._current != media) {
			this._loaded = false;
			this._current = media;
			this._stream.play(path);
		} else {
			this._loaded = false;
			this._stream.seek(0);
			this._stream.play(path);
		}
	}
	,iterateSound: function(vol,pan) {
		motion_Actuate.transform(this._stream,com_tilbuci_data_GlobalPlayer.mdata.time).sound(vol,null);
	}
	,stopSound: function() {
		motion_Actuate.stop(this._stream);
	}
	,kill: function() {
		com_tilbuci_display_BaseImage.prototype.kill.call(this);
		this._bg.get_graphics().clear();
		this._bg = null;
		this._video.attachNetStream(null);
		this._video = null;
		this._connection.removeEventListener("securityError",$bind(this,this.securityErrorHandler));
		this._connection.removeEventListener("ioError",$bind(this,this.ioErrorHandler));
		this._connection.removeEventListener("netStatus",$bind(this,this.netStatusHandler));
		this._connection.removeEventListener("asyncError",$bind(this,this.asyncErrorHandler));
		this._connection = null;
		this._stream.client = null;
		this._stream.removeEventListener("asyncError",$bind(this,this.asyncErrorHandler));
		this._stream.removeEventListener("ioError",$bind(this,this.ioErrorHandler));
		this._stream.removeEventListener("netStatus",$bind(this,this.netStatusHandler));
		this._stream = null;
		this._onEnd = null;
		this._current = null;
		this._onTimedAc = null;
	}
	,play: function() {
		if(this._loaded) {
			this._stream.resume();
		}
	}
	,pause: function() {
		if(this._loaded) {
			this._stream.pause();
		}
	}
	,stop: function() {
		this._stream.pause();
		this._stream.seek(0);
	}
	,unload: function() {
		if(this._loaded) {
			this._stream.pause();
			this._stream.seek(0);
		}
		this._lastMedia = "";
		this._loaded = false;
	}
	,netStatusHandler: function(event) {
		switch(event.info.code) {
		case "NetStream.Play.Complete":
			this._onEnd();
			break;
		case "NetStream.Play.Start":
			if(!this._loaded) {
				this._loaded = true;
				this._bg.set_width(this._video.set_width(this.oWidth));
				this._bg.set_height(this._video.set_height(this.oHeight));
				this._onLoad(true);
				if(com_tilbuci_data_GlobalPlayer.mode == "editor") {
					this.stop();
				}
			}
			break;
		}
	}
	,ioErrorHandler: function(evt) {
		this._onLoad(false);
	}
	,securityErrorHandler: function(evt) {
		this._onLoad(false);
	}
	,asyncErrorHandler: function(evt) {
		this._onLoad(false);
	}
	,metadataEvent: function(data) {
		this.oWidth = data.width;
		this.oHeight = data.height;
		if(com_tilbuci_data_GlobalPlayer.mode == "editor") {
			this._loaded = true;
			this._bg.set_width(this._video.set_width(this.oWidth = data.width));
			this._bg.set_height(this._video.set_height(this.oHeight = data.height));
			this._onLoad(true);
			this.stop();
		}
	}
	,imagedataEvent: function(data) {
	}
	,playstatusEvent: function(data) {
		if(this._stream.time != null) {
			if(this._onTimedAc != null) {
				var time = Math.round(this._stream.time);
				if(time != this._lasttime) {
					this._lasttime = time;
					this._onTimedAc(time);
				}
			}
		}
	}
	,cuepointEvent: function(data) {
	}
	,__class__: com_tilbuci_display_VideoImage
});
var openfl_events_Event = function(type,bubbles,cancelable) {
	if(cancelable == null) {
		cancelable = false;
	}
	if(bubbles == null) {
		bubbles = false;
	}
	this.type = type;
	this.bubbles = bubbles;
	this.cancelable = cancelable;
	this.eventPhase = 2;
};
$hxClasses["openfl.events.Event"] = openfl_events_Event;
openfl_events_Event.__name__ = "openfl.events.Event";
openfl_events_Event.prototype = {
	bubbles: null
	,cancelable: null
	,currentTarget: null
	,eventPhase: null
	,target: null
	,type: null
	,__isCanceled: null
	,__isCanceledNow: null
	,__preventDefault: null
	,clone: function() {
		var event = new openfl_events_Event(this.type,this.bubbles,this.cancelable);
		event.eventPhase = this.eventPhase;
		event.target = this.target;
		event.currentTarget = this.currentTarget;
		return event;
	}
	,formatToString: function(className,p1,p2,p3,p4,p5) {
		var parameters = [];
		if(p1 != null) {
			parameters.push(p1);
		}
		if(p2 != null) {
			parameters.push(p2);
		}
		if(p3 != null) {
			parameters.push(p3);
		}
		if(p4 != null) {
			parameters.push(p4);
		}
		if(p5 != null) {
			parameters.push(p5);
		}
		return $bind(this,this.__formatToString).apply(this,[className,parameters]);
	}
	,isDefaultPrevented: function() {
		return this.__preventDefault;
	}
	,preventDefault: function() {
		if(this.cancelable) {
			this.__preventDefault = true;
		}
	}
	,stopImmediatePropagation: function() {
		this.__isCanceled = true;
		this.__isCanceledNow = true;
	}
	,stopPropagation: function() {
		this.__isCanceled = true;
	}
	,toString: function() {
		return this.__formatToString("Event",["type","bubbles","cancelable"]);
	}
	,__formatToString: function(className,parameters) {
		var output = "[" + className;
		var arg = null;
		var _g = 0;
		while(_g < parameters.length) {
			var param = parameters[_g];
			++_g;
			arg = Reflect.field(this,param);
			if(typeof(arg) == "string") {
				output += " " + param + "=\"" + Std.string(arg) + "\"";
			} else {
				output += " " + param + "=" + Std.string(arg);
			}
		}
		output += "]";
		return output;
	}
	,__init: function() {
		this.target = null;
		this.currentTarget = null;
		this.bubbles = false;
		this.cancelable = false;
		this.eventPhase = 2;
		this.__isCanceled = false;
		this.__isCanceledNow = false;
		this.__preventDefault = false;
	}
	,__class__: openfl_events_Event
};
var com_tilbuci_event_TilBuciEvent = function(type,info,bubbles,cancelable) {
	if(cancelable == null) {
		cancelable = false;
	}
	if(bubbles == null) {
		bubbles = false;
	}
	openfl_events_Event.call(this,type,bubbles,cancelable);
	this.info = info;
};
$hxClasses["com.tilbuci.event.TilBuciEvent"] = com_tilbuci_event_TilBuciEvent;
com_tilbuci_event_TilBuciEvent.__name__ = "com.tilbuci.event.TilBuciEvent";
com_tilbuci_event_TilBuciEvent.__super__ = openfl_events_Event;
com_tilbuci_event_TilBuciEvent.prototype = $extend(openfl_events_Event.prototype,{
	info: null
	,__class__: com_tilbuci_event_TilBuciEvent
});
var com_tilbuci_font_EmbedFont = function(path,name,ac,addToGlobal) {
	if(addToGlobal == null) {
		addToGlobal = true;
	}
	this._addToGlobal = true;
	this._fname = "";
	path = StringTools.replace(path,".ttf",".woff2");
	path = StringTools.replace(path,".otf",".woff2");
	this._addToGlobal = addToGlobal;
	this._fname = name;
	this._ac = ac;
	new com_tilbuci_data_DataLoader(true,path,"GET",null,0,$bind(this,this.onLoad));
};
$hxClasses["com.tilbuci.font.EmbedFont"] = com_tilbuci_font_EmbedFont;
com_tilbuci_font_EmbedFont.__name__ = "com.tilbuci.font.EmbedFont";
com_tilbuci_font_EmbedFont.prototype = {
	fname: null
	,_fname: null
	,get_fname: function() {
		return this._fname;
	}
	,_ac: null
	,_addToGlobal: null
	,onLoad: function(ok,ld) {
		var _gthis = this;
		if(ok) {
			var buffer = new ArrayBuffer(openfl_utils_ByteArray.get_length(ld.binary));
			var view = new DataView(buffer,0,buffer.byteLength);
			var _g = 0;
			var _g1 = openfl_utils_ByteArray.get_length(ld.binary);
			while(_g < _g1) {
				var i = _g++;
				view.setUint8(i,ld.binary.b[i]);
			}
			var face = new FontFace(this._fname,buffer);
			window.document.fonts.add(face);
			face.load().then(function(_) {
				var future = openfl_text_Font.loadFromName(_gthis._fname);
				future.onComplete(function(font) {
					if(_gthis._addToGlobal) {
						com_tilbuci_data_Global.fonts.push(_gthis._fname);
					}
					if(_gthis._ac != null) {
						_gthis._ac(true,_gthis);
					}
					_gthis._ac = null;
				});
			});
		} else {
			this._fname = "";
			if(this._ac = null) {
				this._ac(false,this);
			}
			this._ac = null;
		}
	}
	,__class__: com_tilbuci_font_EmbedFont
	,__properties__: {get_fname:"get_fname"}
};
var com_tilbuci_narrative_BattleCardNarrative = function(data) {
	this.ok = false;
	if(data != null) {
		this.load(data);
	}
};
$hxClasses["com.tilbuci.narrative.BattleCardNarrative"] = com_tilbuci_narrative_BattleCardNarrative;
com_tilbuci_narrative_BattleCardNarrative.__name__ = "com.tilbuci.narrative.BattleCardNarrative";
com_tilbuci_narrative_BattleCardNarrative.prototype = {
	ok: null
	,cardname: null
	,cardgraphic: null
	,cardattributes: null
	,clone: function() {
		return new com_tilbuci_narrative_BattleCardNarrative(this.toObject());
	}
	,load: function(data) {
		this.ok = false;
		if(Object.prototype.hasOwnProperty.call(data,"cardname") && Object.prototype.hasOwnProperty.call(data,"cardgraphic") && Object.prototype.hasOwnProperty.call(data,"cardattributes")) {
			this.cardname = Reflect.field(data,"cardname");
			this.cardgraphic = Reflect.field(data,"cardgraphic");
			this.cardattributes = Reflect.field(data,"cardattributes");
			if(this.cardattributes == null) {
				this.cardattributes = [0,0,0,0,0];
			}
			this.ok = true;
			return true;
		} else {
			return false;
		}
	}
	,kill: function() {
		this.cardname = null;
		this.cardgraphic = null;
		while(this.cardattributes.length > 0) this.cardattributes.shift();
		this.cardattributes = null;
	}
	,toObject: function() {
		return { cardname : this.cardname, cardgraphic : this.cardgraphic, cardattributes : this.cardattributes};
	}
	,__class__: com_tilbuci_narrative_BattleCardNarrative
};
var com_tilbuci_narrative_CharacterNarrative = function(data) {
	this.ok = false;
	openfl_display_Sprite.call(this);
	if(data != null) {
		this.load(data);
	}
};
$hxClasses["com.tilbuci.narrative.CharacterNarrative"] = com_tilbuci_narrative_CharacterNarrative;
com_tilbuci_narrative_CharacterNarrative.__name__ = "com.tilbuci.narrative.CharacterNarrative";
com_tilbuci_narrative_CharacterNarrative.__super__ = openfl_display_Sprite;
com_tilbuci_narrative_CharacterNarrative.prototype = $extend(openfl_display_Sprite.prototype,{
	ok: null
	,id: null
	,chname: null
	,about: null
	,collection: null
	,clone: function() {
		return new com_tilbuci_narrative_CharacterNarrative(this.toObject());
	}
	,load: function(data) {
		this.ok = false;
		if(Object.prototype.hasOwnProperty.call(data,"id") && Object.prototype.hasOwnProperty.call(data,"chname") && Object.prototype.hasOwnProperty.call(data,"about") && Object.prototype.hasOwnProperty.call(data,"collection")) {
			this.id = Reflect.field(data,"id");
			this.chname = Reflect.field(data,"chname");
			this.about = Reflect.field(data,"about");
			this.collection = Reflect.field(data,"collection");
			this.ok = true;
			return true;
		} else {
			return false;
		}
	}
	,kill: function() {
		if(this.parent != null) {
			this.parent.removeChild(this);
		}
		this.removeChildren();
		this.id = null;
		this.chname = null;
		this.about = null;
		this.collection = null;
	}
	,toObject: function() {
		return { id : this.id, chname : this.chname, about : this.about, collection : this.collection};
	}
	,__class__: com_tilbuci_narrative_CharacterNarrative
});
var com_tilbuci_narrative_DialogueFolderNarrative = function(data) {
	this.diags = new haxe_ds_StringMap();
	this.loaded = false;
	this.code = "";
	this.ok = false;
	openfl_display_Sprite.call(this);
	if(data != null) {
		this.load(data);
	}
};
$hxClasses["com.tilbuci.narrative.DialogueFolderNarrative"] = com_tilbuci_narrative_DialogueFolderNarrative;
com_tilbuci_narrative_DialogueFolderNarrative.__name__ = "com.tilbuci.narrative.DialogueFolderNarrative";
com_tilbuci_narrative_DialogueFolderNarrative.__super__ = openfl_display_Sprite;
com_tilbuci_narrative_DialogueFolderNarrative.prototype = $extend(openfl_display_Sprite.prototype,{
	ok: null
	,id: null
	,code: null
	,loaded: null
	,diags: null
	,_callback: null
	,clone: function() {
		return new com_tilbuci_narrative_DialogueFolderNarrative(this.toObject());
	}
	,load: function(data) {
		this.ok = false;
		if(Object.prototype.hasOwnProperty.call(data,"id")) {
			this.id = Reflect.field(data,"id");
			if(Object.prototype.hasOwnProperty.call(data,"code")) {
				this.code = Reflect.field(data,"code");
			}
			var h = this.diags.h;
			var k_h = h;
			var k_keys = Object.keys(h);
			var k_length = k_keys.length;
			var k_current = 0;
			while(k_current < k_length) {
				var k = k_keys[k_current++];
				this.diags.h[k].kill();
				var _this = this.diags;
				if(Object.prototype.hasOwnProperty.call(_this.h,k)) {
					delete(_this.h[k]);
				}
			}
			if(Object.prototype.hasOwnProperty.call(data,"diags")) {
				var diag = Reflect.field(data,"diags");
				var _g = 0;
				var _g1 = Reflect.fields(diag);
				while(_g < _g1.length) {
					var k = _g1[_g];
					++_g;
					var dn = new com_tilbuci_narrative_DialogueNarrative();
					if(dn.load(Reflect.field(diag,k))) {
						this.diags.h[dn.id] = dn;
					}
				}
			}
			this.ok = true;
			return true;
		} else {
			return false;
		}
	}
	,clear: function() {
		if(this.ok) {
			var h = this.diags.h;
			var k_h = h;
			var k_keys = Object.keys(h);
			var k_length = k_keys.length;
			var k_current = 0;
			while(k_current < k_length) {
				var k = k_keys[k_current++];
				this.diags.h[k].kill();
				var _this = this.diags;
				if(Object.prototype.hasOwnProperty.call(_this.h,k)) {
					delete(_this.h[k]);
				}
			}
			this.diags = new haxe_ds_StringMap();
		}
	}
	,loadContents: function(callback) {
		if(this.ok) {
			com_tilbuci_data_GlobalPlayer.narrative.clearDialogues();
			this._callback = callback;
			if(com_tilbuci_data_GlobalPlayer.nocache) {
				var tmp = com_tilbuci_data_GlobalPlayer.base + "movie/" + com_tilbuci_data_GlobalPlayer.movie.get_mvId() + ".movie/media/dialogues/" + this.code + ".json";
				var _g = new haxe_ds_StringMap();
				var value = new Date().getTime();
				_g.h["rand"] = value;
				new com_tilbuci_data_DataLoader(true,tmp,"GET",_g,3,$bind(this,this.onContents));
			} else {
				new com_tilbuci_data_DataLoader(true,com_tilbuci_data_GlobalPlayer.base + "movie/" + com_tilbuci_data_GlobalPlayer.movie.get_mvId() + ".movie/media/dialogues/" + this.code + ".json","GET",new haxe_ds_StringMap(),3,$bind(this,this.onContents));
			}
			return true;
		} else {
			return false;
		}
	}
	,onContents: function(ok,ld) {
		if(ok) {
			if(this.load(ld.json)) {
				this._callback(true);
			} else {
				this._callback(false);
			}
		} else {
			this._callback(false);
		}
	}
	,numDiags: function() {
		return Lambda.count(this.diags);
	}
	,kill: function() {
		if(this.parent != null) {
			this.parent.removeChild(this);
		}
		this.removeChildren();
		this.id = null;
		var h = this.diags.h;
		var k_h = h;
		var k_keys = Object.keys(h);
		var k_length = k_keys.length;
		var k_current = 0;
		while(k_current < k_length) {
			var k = k_keys[k_current++];
			this.diags.h[k].kill();
			var _this = this.diags;
			if(Object.prototype.hasOwnProperty.call(_this.h,k)) {
				delete(_this.h[k]);
			}
		}
		this.diags = null;
		this._callback = null;
	}
	,idObject: function() {
		return { id : this.id, code : this.code, loaded : this.loaded};
	}
	,toObject: function() {
		var diagobj = [];
		var h = this.diags.h;
		var k_h = h;
		var k_keys = Object.keys(h);
		var k_length = k_keys.length;
		var k_current = 0;
		while(k_current < k_length) {
			var k = k_h[k_keys[k_current++]];
			diagobj.push(k.toObject());
		}
		return { id : this.id, code : this.code, loaded : this.loaded, diags : diagobj};
	}
	,__class__: com_tilbuci_narrative_DialogueFolderNarrative
});
var com_tilbuci_narrative_DialogueLineNarrative = function(data) {
	this.asset = "";
	this.character = "";
	this.audio = "";
	this.ok = false;
	openfl_display_Sprite.call(this);
	if(data != null) {
		this.load(data);
	}
};
$hxClasses["com.tilbuci.narrative.DialogueLineNarrative"] = com_tilbuci_narrative_DialogueLineNarrative;
com_tilbuci_narrative_DialogueLineNarrative.__name__ = "com.tilbuci.narrative.DialogueLineNarrative";
com_tilbuci_narrative_DialogueLineNarrative.__super__ = openfl_display_Sprite;
com_tilbuci_narrative_DialogueLineNarrative.prototype = $extend(openfl_display_Sprite.prototype,{
	ok: null
	,text: null
	,audio: null
	,character: null
	,asset: null
	,clone: function() {
		return new com_tilbuci_narrative_DialogueLineNarrative(this.toObject());
	}
	,load: function(data) {
		this.ok = false;
		if(Object.prototype.hasOwnProperty.call(data,"text")) {
			this.text = Reflect.field(data,"text");
			this.audio = Reflect.field(data,"audio");
			this.character = Reflect.field(data,"character");
			this.asset = Reflect.field(data,"asset");
			this.ok = true;
			return true;
		} else {
			return false;
		}
	}
	,kill: function() {
		if(this.parent != null) {
			this.parent.removeChild(this);
		}
		this.removeChildren();
		this.text = null;
		this.audio = null;
		this.character = null;
		this.asset = null;
	}
	,toObject: function() {
		return { text : this.text, audio : this.audio, character : this.character, asset : this.asset};
	}
	,__class__: com_tilbuci_narrative_DialogueLineNarrative
});
var com_tilbuci_narrative_DialogueNarrative = function(data) {
	this._lastast = "";
	this._lastcol = "";
	this.lines = [];
	this.current = 0;
	this.instexpr = "";
	this.instname = "";
	this.insttext = "";
	this.navend = "";
	this.navnext = "";
	this.navprev = "";
	this.ok = false;
	openfl_display_Sprite.call(this);
	if(data != null) {
		this.load(data);
	}
};
$hxClasses["com.tilbuci.narrative.DialogueNarrative"] = com_tilbuci_narrative_DialogueNarrative;
com_tilbuci_narrative_DialogueNarrative.__name__ = "com.tilbuci.narrative.DialogueNarrative";
com_tilbuci_narrative_DialogueNarrative.__super__ = openfl_display_Sprite;
com_tilbuci_narrative_DialogueNarrative.prototype = $extend(openfl_display_Sprite.prototype,{
	ok: null
	,id: null
	,navprev: null
	,navnext: null
	,navend: null
	,insttext: null
	,instname: null
	,instexpr: null
	,current: null
	,lines: null
	,_lastcol: null
	,_lastast: null
	,clone: function() {
		return new com_tilbuci_narrative_DialogueNarrative(this.toObject());
	}
	,load: function(data) {
		this.ok = false;
		if(Object.prototype.hasOwnProperty.call(data,"id")) {
			this.id = Reflect.field(data,"id");
			if(Object.prototype.hasOwnProperty.call(data,"navprev")) {
				this.navprev = Reflect.field(data,"navprev");
			}
			if(Object.prototype.hasOwnProperty.call(data,"navnext")) {
				this.navnext = Reflect.field(data,"navnext");
			}
			if(Object.prototype.hasOwnProperty.call(data,"navend")) {
				this.navend = Reflect.field(data,"navend");
			}
			if(Object.prototype.hasOwnProperty.call(data,"insttext")) {
				this.insttext = Reflect.field(data,"insttext");
			}
			if(Object.prototype.hasOwnProperty.call(data,"instname")) {
				this.instname = Reflect.field(data,"instname");
			}
			if(Object.prototype.hasOwnProperty.call(data,"instexpr")) {
				this.instexpr = Reflect.field(data,"instexpr");
			}
			if(Object.prototype.hasOwnProperty.call(data,"lines")) {
				var line = Reflect.field(data,"lines");
				var _g = 0;
				var _g1 = Reflect.fields(line);
				while(_g < _g1.length) {
					var k = _g1[_g];
					++_g;
					var ln = new com_tilbuci_narrative_DialogueLineNarrative();
					if(ln.load(Reflect.field(line,k))) {
						this.lines.push(ln);
					}
				}
			}
			this.ok = true;
			return true;
		} else {
			return false;
		}
	}
	,kill: function() {
		if(this.parent != null) {
			this.parent.removeChild(this);
		}
		this.removeChildren();
		this.id = null;
		while(this.lines.length > 0) this.lines.shift().kill();
		this.lines = null;
		this.navprev = null;
		this.navnext = null;
		this.navend = null;
		this.insttext = null;
		this.instname = null;
		this.instexpr = null;
	}
	,toObject: function() {
		var lineobj = [];
		var _g = 0;
		var _g1 = this.lines;
		while(_g < _g1.length) {
			var k = _g1[_g];
			++_g;
			lineobj.push(k.toObject());
		}
		return { id : this.id, lines : lineobj, navprev : this.navprev, navnext : this.navnext, navend : this.navend, insttext : this.insttext, instname : this.instname, instexpr : this.instexpr};
	}
	,numLines: function() {
		return this.lines.length;
	}
	,next: function() {
		this.current++;
		if(this.current >= this.lines.length) {
			this.current = this.lines.length - 1;
		}
		this.show(this.current);
	}
	,previous: function() {
		this.current--;
		if(this.current < 0) {
			this.current = 0;
		}
		this.show(this.current);
	}
	,last: function() {
		this.current = this.lines.length - 1;
		this.show(this.current);
	}
	,first: function() {
		this.current = 0;
		this.show(this.current);
	}
	,show: function(line) {
		if(line == null) {
			line = -1;
		}
		if(line >= 0) {
			this.current = line;
		}
		if(this.current >= this.lines.length) {
			this.current = 0;
		}
		if(this.insttext != null && this.insttext != "") {
			com_tilbuci_data_GlobalPlayer.area.setText(this.insttext,this.lines[this.current].text);
		}
		if(this.navprev != null && this.navprev != "") {
			if(this.current == 0) {
				com_tilbuci_data_GlobalPlayer.area.setVisible(this.navprev,false);
			} else {
				com_tilbuci_data_GlobalPlayer.area.setVisible(this.navprev,true);
			}
		}
		if(this.navnext != null && this.navnext != "") {
			if(this.current >= this.lines.length - 1) {
				com_tilbuci_data_GlobalPlayer.area.setVisible(this.navnext,false);
			} else {
				com_tilbuci_data_GlobalPlayer.area.setVisible(this.navnext,true);
			}
		}
		if(this.navend != null && this.navend != "") {
			if(this.current >= this.lines.length - 1) {
				com_tilbuci_data_GlobalPlayer.area.setVisible(this.navend,true);
			} else {
				com_tilbuci_data_GlobalPlayer.area.setVisible(this.navend,false);
			}
		}
		if(this.instname != null && this.instname != "") {
			if(this.lines[this.current].character == "") {
				com_tilbuci_data_GlobalPlayer.area.setText(this.instname,"");
			} else if(Object.prototype.hasOwnProperty.call(com_tilbuci_data_GlobalPlayer.narrative.chars.h,this.lines[this.current].character)) {
				com_tilbuci_data_GlobalPlayer.area.setText(this.instname,com_tilbuci_data_GlobalPlayer.narrative.chars.h[this.lines[this.current].character].chname);
			} else {
				com_tilbuci_data_GlobalPlayer.area.setText(this.instname,"");
			}
		}
		if(this.instexpr != null && this.instexpr != "") {
			if(this.lines[this.current].asset == "") {
				com_tilbuci_data_GlobalPlayer.area.setVisible(this.instexpr,false);
			} else if(Object.prototype.hasOwnProperty.call(com_tilbuci_data_GlobalPlayer.narrative.chars.h,this.lines[this.current].character)) {
				if(Object.prototype.hasOwnProperty.call(com_tilbuci_data_GlobalPlayer.movie.collections.h,com_tilbuci_data_GlobalPlayer.narrative.chars.h[this.lines[this.current].character].collection)) {
					if(this._lastcol != com_tilbuci_data_GlobalPlayer.narrative.chars.h[this.lines[this.current].character].collection && this._lastast != this.lines[this.current].asset) {
						com_tilbuci_data_GlobalPlayer.area.loadCollectionAsset(this.instexpr,com_tilbuci_data_GlobalPlayer.narrative.chars.h[this.lines[this.current].character].collection,this.lines[this.current].asset);
					}
					this._lastcol = com_tilbuci_data_GlobalPlayer.narrative.chars.h[this.lines[this.current].character].collection;
					this._lastast = this.lines[this.current].asset;
					com_tilbuci_data_GlobalPlayer.area.setVisible(this.instexpr,true);
				} else {
					com_tilbuci_data_GlobalPlayer.area.setVisible(this.instexpr,false);
				}
			} else {
				com_tilbuci_data_GlobalPlayer.area.setVisible(this.instexpr,false);
			}
		}
		if(this.lines[this.current].audio == "") {
			com_tilbuci_data_GlobalPlayer.narrative.diagSpeech.stop();
		} else {
			com_tilbuci_data_GlobalPlayer.narrative.diagSpeech.load(this.lines[this.current].audio);
		}
	}
	,close: function() {
		if(this.navprev != null && this.navprev != "") {
			com_tilbuci_data_GlobalPlayer.area.releaseProperty(this.navprev,"visible");
		}
		if(this.navnext != null && this.navnext != "") {
			com_tilbuci_data_GlobalPlayer.area.releaseProperty(this.navnext,"visible");
		}
		if(this.navend != null && this.navend != "") {
			com_tilbuci_data_GlobalPlayer.area.releaseProperty(this.navend,"visible");
		}
		if(this.instexpr != null && this.instexpr != "") {
			com_tilbuci_data_GlobalPlayer.area.releaseProperty(this.instexpr,"visible");
		}
		com_tilbuci_data_GlobalPlayer.narrative.diagSpeech.stop();
		this._lastast = this._lastcol = "";
	}
	,__class__: com_tilbuci_narrative_DialogueNarrative
});
var com_tilbuci_narrative_InvItemNarrative = function(data) {
	this.ok = false;
	if(data != null) {
		this.load(data);
	}
};
$hxClasses["com.tilbuci.narrative.InvItemNarrative"] = com_tilbuci_narrative_InvItemNarrative;
com_tilbuci_narrative_InvItemNarrative.__name__ = "com.tilbuci.narrative.InvItemNarrative";
com_tilbuci_narrative_InvItemNarrative.prototype = {
	ok: null
	,itname: null
	,ittype: null
	,itgraphic: null
	,itaction: null
	,clone: function() {
		return new com_tilbuci_narrative_InvItemNarrative(this.toObject());
	}
	,load: function(data) {
		this.ok = false;
		if(Object.prototype.hasOwnProperty.call(data,"itname") && Object.prototype.hasOwnProperty.call(data,"ittype") && Object.prototype.hasOwnProperty.call(data,"itgraphic") && Object.prototype.hasOwnProperty.call(data,"itaction")) {
			this.itname = Reflect.field(data,"itname");
			this.ittype = Reflect.field(data,"ittype");
			this.itgraphic = Reflect.field(data,"itgraphic");
			this.itaction = Reflect.field(data,"itaction");
			this.ok = true;
			return true;
		} else {
			return false;
		}
	}
	,kill: function() {
		this.itname = null;
		this.ittype = null;
		this.itgraphic = null;
		this.itaction = null;
	}
	,toObject: function() {
		return { itname : this.itname, ittype : this.ittype, itgraphic : this.itgraphic, itaction : this.itaction};
	}
	,__class__: com_tilbuci_narrative_InvItemNarrative
};
var com_tilbuci_player_Joystick = function() {
	this._directionclick = [true,true,true,true];
	this._counterd = 0;
	this._buttonclick = [true,true,true,true];
	this._counter = 0;
	this._controls = new haxe_ds_StringMap();
	this._gameInput = new openfl_ui_GameInput();
	this._gameInput.addEventListener("deviceAdded",$bind(this,this.onDeviceAdded));
	this._gameInput.addEventListener("deviceRemoved",$bind(this,this.onDeviceRemoved));
};
$hxClasses["com.tilbuci.player.Joystick"] = com_tilbuci_player_Joystick;
com_tilbuci_player_Joystick.__name__ = "com.tilbuci.player.Joystick";
com_tilbuci_player_Joystick.prototype = {
	_gameInput: null
	,_device: null
	,_controls: null
	,_timer: null
	,_counter: null
	,_buttonclick: null
	,_counterd: null
	,_directionclick: null
	,onDeviceRemoved: function(e) {
		if(this._timer != null) {
			try {
				this._timer.stop();
			} catch( _g ) {
			}
		}
		this._timer = null;
	}
	,onDeviceAdded: function(e) {
		this._device = e.device;
		this._device.enabled = true;
		var h = this._controls.h;
		var k_h = h;
		var k_keys = Object.keys(h);
		var k_length = k_keys.length;
		var k_current = 0;
		while(k_current < k_length) {
			var k = k_keys[k_current++];
			var _this = this._controls;
			if(Object.prototype.hasOwnProperty.call(_this.h,k)) {
				delete(_this.h[k]);
			}
		}
		var _g = 0;
		var _g1 = this._device.get_numControls();
		while(_g < _g1) {
			var i = _g++;
			var control = this._device.getControlAt(i);
			switch(control.id) {
			case "AXIS_0":
				this._controls.h["HL"] = control;
				break;
			case "AXIS_1":
				this._controls.h["VL"] = control;
				break;
			case "AXIS_2":
				this._controls.h["HR"] = control;
				break;
			case "AXIS_3":
				this._controls.h["VR"] = control;
				break;
			case "BUTTON_0":
				this._controls.h["B0"] = control;
				break;
			case "BUTTON_1":
				this._controls.h["B1"] = control;
				break;
			case "BUTTON_2":
				this._controls.h["B2"] = control;
				break;
			case "BUTTON_3":
				this._controls.h["B3"] = control;
				break;
			case "DPAD_DOWN":
				this._controls.h["DD"] = control;
				break;
			case "DPAD_LEFT":
				this._controls.h["DL"] = control;
				break;
			case "DPAD_RIGHT":
				this._controls.h["DR"] = control;
				break;
			case "DPAD_UP":
				this._controls.h["DU"] = control;
				break;
			}
			this._controls.h[control.id] = control;
		}
		if(this._timer != null) {
			try {
				this._timer.stop();
			} catch( _g ) {
			}
		}
		this._counter = 0;
		this._buttonclick = [true,true,true,true];
		this._counterd = 0;
		this._directionclick = [true,true,true,true];
		this._timer = new haxe_Timer(32);
		this._timer.run = $bind(this,this.checkInput);
	}
	,checkInput: function() {
		if(com_tilbuci_data_GlobalPlayer.usingTarget > 0) {
			var h = this._controls.h;
			var k_h = h;
			var k_keys = Object.keys(h);
			var k_length = k_keys.length;
			var k_current = 0;
			while(k_current < k_length) {
				var k = k_keys[k_current++];
				if(this._controls.h[k].value < -0.5 || this._controls.h[k].value > 0.5) {
					switch(k) {
					case "B0":
						if(this._buttonclick[0]) {
							com_tilbuci_data_GlobalPlayer.parser.checkJoystick("0");
							this._buttonclick[0] = false;
							this._counter = 0;
						}
						break;
					case "B1":
						if(this._buttonclick[1]) {
							com_tilbuci_data_GlobalPlayer.parser.checkJoystick("1");
							this._buttonclick[1] = false;
							this._counter = 0;
						}
						break;
					case "B2":
						if(this._buttonclick[2]) {
							com_tilbuci_data_GlobalPlayer.parser.checkJoystick("2");
							this._buttonclick[2] = false;
							this._counter = 0;
						}
						break;
					case "B3":
						if(this._buttonclick[3]) {
							com_tilbuci_data_GlobalPlayer.parser.checkJoystick("3");
							this._buttonclick[3] = false;
							this._counter = 0;
						}
						break;
					case "DD":
						com_tilbuci_data_GlobalPlayer.parser.checkJoystick("d");
						break;
					case "DL":
						com_tilbuci_data_GlobalPlayer.parser.checkJoystick("l");
						break;
					case "DR":
						com_tilbuci_data_GlobalPlayer.parser.checkJoystick("r");
						break;
					case "DU":
						com_tilbuci_data_GlobalPlayer.parser.checkJoystick("u");
						break;
					case "HL":
						if(this._controls.h[k].value < 0) {
							com_tilbuci_data_GlobalPlayer.parser.checkJoystick("l");
						} else {
							com_tilbuci_data_GlobalPlayer.parser.checkJoystick("r");
						}
						break;
					case "HR":
						if(this._controls.h[k].value < 0) {
							com_tilbuci_data_GlobalPlayer.parser.checkJoystick("l");
						} else {
							com_tilbuci_data_GlobalPlayer.parser.checkJoystick("r");
						}
						break;
					case "VL":
						if(this._controls.h[k].value < 0) {
							com_tilbuci_data_GlobalPlayer.parser.checkJoystick("u");
						} else {
							com_tilbuci_data_GlobalPlayer.parser.checkJoystick("d");
						}
						break;
					case "VR":
						if(this._controls.h[k].value < 0) {
							com_tilbuci_data_GlobalPlayer.parser.checkJoystick("u");
						} else {
							com_tilbuci_data_GlobalPlayer.parser.checkJoystick("d");
						}
						break;
					}
				}
			}
		} else {
			var h = this._controls.h;
			var k_h = h;
			var k_keys = Object.keys(h);
			var k_length = k_keys.length;
			var k_current = 0;
			while(k_current < k_length) {
				var k = k_keys[k_current++];
				if(this._controls.h[k].value < -0.5 || this._controls.h[k].value > 0.5) {
					switch(k) {
					case "B0":
						if(this._buttonclick[0]) {
							com_tilbuci_data_GlobalPlayer.parser.checkJoystick("0");
							this._buttonclick[0] = false;
							this._counter = 0;
						}
						break;
					case "B1":
						if(this._buttonclick[1]) {
							com_tilbuci_data_GlobalPlayer.parser.checkJoystick("1");
							this._buttonclick[1] = false;
							this._counter = 0;
						}
						break;
					case "B2":
						if(this._buttonclick[2]) {
							com_tilbuci_data_GlobalPlayer.parser.checkJoystick("2");
							this._buttonclick[2] = false;
							this._counter = 0;
						}
						break;
					case "B3":
						if(this._buttonclick[3]) {
							com_tilbuci_data_GlobalPlayer.parser.checkJoystick("3");
							this._buttonclick[3] = false;
							this._counter = 0;
						}
						break;
					case "DD":
						if(this._directionclick[2]) {
							com_tilbuci_data_GlobalPlayer.parser.checkJoystick("d");
							this._directionclick[2] = false;
							this._counterd = 0;
						}
						break;
					case "DL":
						if(this._directionclick[3]) {
							com_tilbuci_data_GlobalPlayer.parser.checkJoystick("l");
							this._directionclick[3] = false;
							this._counterd = 0;
						}
						break;
					case "DR":
						if(this._directionclick[1]) {
							com_tilbuci_data_GlobalPlayer.parser.checkJoystick("r");
							this._directionclick[1] = false;
							this._counterd = 0;
						}
						break;
					case "DU":
						if(this._directionclick[0]) {
							com_tilbuci_data_GlobalPlayer.parser.checkJoystick("u");
							this._directionclick[0] = false;
							this._counterd = 0;
						}
						break;
					case "HL":
						if(this._controls.h[k].value < 0) {
							if(this._directionclick[3]) {
								com_tilbuci_data_GlobalPlayer.parser.checkJoystick("l");
								this._directionclick[3] = false;
								this._counterd = 0;
							}
						} else if(this._directionclick[1]) {
							com_tilbuci_data_GlobalPlayer.parser.checkJoystick("r");
							this._directionclick[1] = false;
							this._counterd = 0;
						}
						break;
					case "HR":
						if(this._controls.h[k].value < 0) {
							if(this._directionclick[3]) {
								com_tilbuci_data_GlobalPlayer.parser.checkJoystick("l");
								this._directionclick[3] = false;
								this._counterd = 0;
							}
						} else if(this._directionclick[1]) {
							com_tilbuci_data_GlobalPlayer.parser.checkJoystick("r");
							this._directionclick[1] = false;
							this._counterd = 0;
						}
						break;
					case "VL":
						if(this._controls.h[k].value < 0) {
							if(this._directionclick[0]) {
								com_tilbuci_data_GlobalPlayer.parser.checkJoystick("u");
								this._directionclick[0] = false;
								this._counterd = 0;
							}
						} else if(this._directionclick[2]) {
							com_tilbuci_data_GlobalPlayer.parser.checkJoystick("d");
							this._directionclick[2] = false;
							this._counterd = 0;
						}
						break;
					case "VR":
						if(this._controls.h[k].value < 0) {
							if(this._directionclick[0]) {
								com_tilbuci_data_GlobalPlayer.parser.checkJoystick("u");
								this._directionclick[0] = false;
								this._counterd = 0;
							}
						} else if(this._directionclick[2]) {
							com_tilbuci_data_GlobalPlayer.parser.checkJoystick("d");
							this._directionclick[2] = false;
							this._counterd = 0;
						}
						break;
					}
				}
			}
		}
		this._counter++;
		if(this._counter >= 10) {
			this._buttonclick = [true,true,true,true];
			this._counter = 0;
		}
		this._counterd++;
		if(this._counterd >= 10) {
			this._directionclick = [true,true,true,true];
			this._counterd = 0;
		}
	}
	,__class__: com_tilbuci_player_Joystick
};
var com_tilbuci_player_MovieArea = function(pl,bgarea,uiArea) {
	this._targetTime = 0.0075;
	this._target = new com_tilbuci_player_Target();
	this.kfPercent = 0;
	this._currentKf = -1;
	this._instances = new haxe_ds_StringMap();
	this._scale = 1;
	this._bloverlays = new haxe_ds_StringMap();
	this._overlays = new haxe_ds_StringMap();
	this._kftoLoad = -1;
	this._playing = true;
	openfl_display_Sprite.call(this);
	this._player = pl;
	this._bgarea = bgarea;
	this._bg = new openfl_display_Shape();
	this._scene = new openfl_display_Sprite();
	this._inputArea = new openfl_display_Sprite();
	this._player.inputArea = this._inputArea;
	this._mask = new openfl_display_Shape();
	this._holder = new openfl_display_Sprite();
	this._overlay = new openfl_display_Sprite();
	this._bloverlay = new openfl_display_Sprite();
	this._uiBg = new openfl_display_Shape();
	this._uiBg.get_graphics().beginFill(0,0.5);
	this._uiBg.get_graphics().drawRect(0,0,32,32);
	this._uiBg.get_graphics().endFill();
	this._uiBg.set_visible(false);
	this._uiArea = uiArea;
	this._uiArea.addChild(this._uiBg);
	this._inputPanel = new com_tilbuci_ui_PlayerInput(this._uiBg);
	this._uiArea.addChild(this._inputPanel);
	this._holder.addChild(this._bg);
	this._holder.addChild(this._bloverlay);
	this._holder.addChild(this._scene);
	this._holder.addChild(this._inputArea);
	this._holder.addChild(this._overlay);
	this.addChild(this._holder);
	this.addChild(this._mask);
	if(com_tilbuci_data_GlobalPlayer.mode == "player") {
		this._holder.set_mask(this._mask);
	} else {
		this._mask.set_visible(false);
	}
	if(this.stage == null) {
		this.addEventListener("addedToStage",$bind(this,this.onStage));
	} else {
		this.addEventListener("mouseUp",$bind(this,this.onMouseUp));
	}
	this._select = new com_tilbuci_display_InstanceSelect();
	this.addChild(this._select);
	this._multiSelect = new com_tilbuci_display_MultiSelect();
	this.addChild(this._multiSelect);
};
$hxClasses["com.tilbuci.player.MovieArea"] = com_tilbuci_player_MovieArea;
com_tilbuci_player_MovieArea.__name__ = "com.tilbuci.player.MovieArea";
com_tilbuci_player_MovieArea.__super__ = openfl_display_Sprite;
com_tilbuci_player_MovieArea.prototype = $extend(openfl_display_Sprite.prototype,{
	aWidth: null
	,get_aWidth: function() {
		return this._mask.get_width();
	}
	,aHeight: null
	,get_aHeight: function() {
		return this._mask.get_height();
	}
	,aOrientation: null
	,get_aOrientation: function() {
		if(this.get_aWidth() == this.get_aHeight()) {
			return "square";
		} else if(this.get_aHeight() > this.get_aWidth()) {
			return "vertical";
		} else {
			return "horizontal";
		}
	}
	,pOrientation: null
	,get_pOrientation: function() {
		if(this._player.get_rWidth() < this._player.get_rHeight()) {
			return "vertical";
		} else {
			return "horizontal";
		}
	}
	,playing: null
	,_playing: null
	,get_playing: function() {
		return this._playing;
	}
	,_kftoLoad: null
	,_player: null
	,_bgarea: null
	,_holder: null
	,_mask: null
	,_scene: null
	,_inputArea: null
	,_overlay: null
	,_overlays: null
	,_bloverlay: null
	,_bloverlays: null
	,_bg: null
	,_scale: null
	,_instances: null
	,currentKf: null
	,get_currentKf: function() {
		return this._currentKf;
	}
	,_currentKf: null
	,kfPercent: null
	,_uiArea: null
	,_uiBg: null
	,_inputPanel: null
	,_select: null
	,_multiSelect: null
	,_target: null
	,_targetTime: null
	,showTarget: function() {
		this._holder.addChild(this._target);
		this._target.show();
		if(this._target.timer != null) {
			try {
				this._target.timer.stop();
			} catch( _g ) {
			}
			this._target.timer = null;
		}
		this._target.timer = new haxe_Timer(500);
		this._target.timer.run = $bind(this,this.checkTargetOver);
		this._target.lastInstOver = "";
	}
	,hideTarget: function() {
		if(this._target.parent != null) {
			this._holder.removeChild(this._target);
		}
		this._target.hide();
		if(this._target.timer != null) {
			try {
				this._target.timer.stop();
			} catch( _g ) {
			}
			this._target.timer = null;
		}
		this._target.lastInstOver = "";
	}
	,toggleTarget: function() {
		if(this._target.get_visible()) {
			this.hideTarget();
		} else {
			this.showTarget();
		}
	}
	,clearTarget: function() {
		this._target.clear();
	}
	,setTarget: function(nm) {
		if(Object.prototype.hasOwnProperty.call(com_tilbuci_data_GlobalPlayer.contraptions.targets.h,nm)) {
			if(com_tilbuci_data_GlobalPlayer.contraptions.targets.h[nm].ok) {
				return this._target.load(nm);
			} else {
				return false;
			}
		} else {
			return false;
		}
	}
	,moveTarget: function(to) {
		switch(to) {
		case "down":
			if(this._target.get_y() < com_tilbuci_data_GlobalPlayer.area.get_aHeight()) {
				var fh = this._target;
				fh.set_y(fh.get_y() + com_tilbuci_data_GlobalPlayer.usingTarget);
			}
			break;
		case "left":
			if(this._target.get_x() > 0) {
				var fh = this._target;
				fh.set_x(fh.get_x() - com_tilbuci_data_GlobalPlayer.usingTarget);
			}
			break;
		case "right":
			if(this._target.get_x() < com_tilbuci_data_GlobalPlayer.area.get_aWidth()) {
				var fh = this._target;
				fh.set_x(fh.get_x() + com_tilbuci_data_GlobalPlayer.usingTarget);
			}
			break;
		case "up":
			if(this._target.get_y() > 0) {
				var fh = this._target;
				fh.set_y(fh.get_y() - com_tilbuci_data_GlobalPlayer.usingTarget);
			}
			break;
		}
		if(com_tilbuci_data_GlobalPlayer.parser.onDrag != null) {
			var px = Math.round(this._target.get_x() - com_tilbuci_data_GlobalPlayer.parser.onDrag.lastClick.x);
			var py = Math.round(this._target.get_y() - com_tilbuci_data_GlobalPlayer.parser.onDrag.lastClick.y);
			com_tilbuci_data_GlobalPlayer.area.setProperty(com_tilbuci_data_GlobalPlayer.parser.onDrag.getInstName(),"x",px,px);
			com_tilbuci_data_GlobalPlayer.area.setProperty(com_tilbuci_data_GlobalPlayer.parser.onDrag.getInstName(),"y",py,py);
			this._target.set_alpha(0);
		}
	}
	,setTargetPos: function(x,y) {
		if(!this._target.get_visible()) {
			this.showTarget();
		}
		this._target.targetX = this._target.set_x(x);
		this._target.targetY = this._target.set_y(y);
	}
	,triggerTarget: function() {
		if(com_tilbuci_data_GlobalPlayer.parser.onDrag != null) {
			com_tilbuci_data_GlobalPlayer.parser.onDragMoveStop(null);
			this._target.set_alpha(1);
		} else if(!(com_tilbuci_data_GlobalPlayer.contraptions.usingMessages && com_tilbuci_data_GlobalPlayer.contraptions.checkMessagesCollision(this._target))) {
			if(!(com_tilbuci_data_GlobalPlayer.contraptions.usingInv && com_tilbuci_data_GlobalPlayer.contraptions.checkInvCollision(this._target))) {
				if(!(com_tilbuci_data_GlobalPlayer.contraptions.usingBs && com_tilbuci_data_GlobalPlayer.contraptions.checkBsCollision(this._target))) {
					if(!(com_tilbuci_data_GlobalPlayer.contraptions.usingMenu && com_tilbuci_data_GlobalPlayer.contraptions.checkMenuCollision(this._target))) {
						if(!(com_tilbuci_data_GlobalPlayer.contraptions.usingDflow && com_tilbuci_data_GlobalPlayer.contraptions.checkDflowCollision(this._target))) {
							if(!com_tilbuci_data_GlobalPlayer.contraptions.checkInterfaceCollision(this._target)) {
								var inst;
								var found = null;
								var _g = 0;
								var _g1 = this._scene.get_numChildren();
								while(_g < _g1) {
									var i = _g++;
									inst = this._scene.getChildAt(i);
									if(inst != null) {
										if(inst.get_visible()) {
											if(this._target.hitTestObject(inst)) {
												found = inst;
											}
										}
									}
								}
								if(found != null) {
									var tmp = this._target.get_x();
									var tmp1 = found.get_x();
									found.lastClick.x = tmp - tmp1;
									var tmp = this._target.get_y();
									var tmp1 = found.get_y();
									found.lastClick.y = tmp - tmp1;
									found.onClick();
								}
							}
						}
					}
				}
			}
		}
	}
	,checkTargetOver: function() {
		if(this._target.get_visible()) {
			var over = "";
			var inst;
			var _g = 0;
			var _g1 = this._scene.get_numChildren();
			while(_g < _g1) {
				var i = _g++;
				inst = this._scene.getChildAt(i);
				if(inst != null) {
					if(inst.get_visible()) {
						if(this._target.hitTestObject(inst)) {
							over = inst.getInstName();
						}
					}
				}
			}
			if(com_tilbuci_data_GlobalPlayer.contraptions.checkMenuOver(this._target) || com_tilbuci_data_GlobalPlayer.contraptions.checkDflowOver(this._target) || com_tilbuci_data_GlobalPlayer.contraptions.checkMessagesOver(this._target) || com_tilbuci_data_GlobalPlayer.contraptions.checkInvOver(this._target) || com_tilbuci_data_GlobalPlayer.contraptions.checkBsOver(this._target)) {
				over = "_menu_";
			}
			if(com_tilbuci_data_GlobalPlayer.contraptions.checkInterfaceOver(this._target)) {
				over = "_interface_";
			}
			this._target.setGraphic(over);
			if(over != "_menu_" && over != "_interface_" && over != this._target.lastInstOver) {
				this._target.lastInstOver = over;
				if(Object.prototype.hasOwnProperty.call(this._instances.h,over)) {
					this._instances.h[over].onTargetOver();
				}
			}
		} else {
			this.hideTarget();
		}
	}
	,loadKeyframe: function(kf,num) {
		if(!this._playing && com_tilbuci_data_GlobalPlayer.mode != "editor") {
			this.playPause();
		}
		motion_Actuate.stop(this,{ kfPercent : 100},false,false);
		this._select.clearInstance();
		this._multiSelect.clear();
		this._currentKf = num;
		var h = this._instances.h;
		var i_h = h;
		var i_keys = Object.keys(h);
		var i_length = i_keys.length;
		var i_current = 0;
		while(i_current < i_length) {
			var i = i_keys[i_current++];
			if(!this._instances.h[i].keep) {
				this._scene.removeChild(this._instances.h[i]);
				this._instances.h[i].stop();
				this._instances.h[i].kill();
				var _this = this._instances;
				if(Object.prototype.hasOwnProperty.call(_this.h,i)) {
					delete(_this.h[i]);
				}
			} else {
				this._instances.h[i].keep = false;
			}
		}
		var h = kf.h;
		var i_h = h;
		var i_keys = Object.keys(h);
		var i_length = i_keys.length;
		var i_current = 0;
		while(i_current < i_length) {
			var i = i_keys[i_current++];
			if(!Object.prototype.hasOwnProperty.call(this._instances.h,i)) {
				var this1 = this._instances;
				var v = new com_tilbuci_display_InstanceImage(i,$bind(this,this.imgSelect));
				this1.h[i] = v;
				this._instances.h[i].load(kf.h[i]);
				this._instances.h[i].set_visible(false);
				this._scene.addChild(this._instances.h[i]);
			} else {
				this._instances.h[i].keep = true;
				this._instances.h[i].load(kf.h[i]);
			}
		}
		var h = this._instances.h;
		var i_h = h;
		var i_keys = Object.keys(h);
		var i_length = i_keys.length;
		var i_current = 0;
		while(i_current < i_length) {
			var i = i_keys[i_current++];
			this._instances.h[i].place();
		}
		if(com_tilbuci_data_GlobalPlayer.mode == "editor") {
			var h = this._instances.h;
			var i_h = h;
			var i_keys = Object.keys(h);
			var i_length = i_keys.length;
			var i_current = 0;
			while(i_current < i_length) {
				var i = i_keys[i_current++];
				if(!this._instances.h[i].keep) {
					this._scene.removeChild(this._instances.h[i]);
					this._instances.h[i].kill();
					var _this = this._instances;
					if(Object.prototype.hasOwnProperty.call(_this.h,i)) {
						delete(_this.h[i]);
					}
				} else {
					this._instances.h[i].stop();
				}
			}
		}
		if(com_tilbuci_data_GlobalPlayer.mode != "editor") {
			this.kfPercent = 0;
			motion_Actuate.tween(this,com_tilbuci_data_GlobalPlayer.mdata.time,{ kfPercent : 100}).onComplete($bind(this,this.nextKeyframe));
		} else {
			this.kfPercent = 100;
		}
		var h = com_tilbuci_data_GlobalPlayer.plugins.h;
		var p_h = h;
		var p_keys = Object.keys(h);
		var p_length = p_keys.length;
		var p_current = 0;
		while(p_current < p_length) {
			var p = p_h[p_keys[p_current++]];
			if(p.get_ready()) {
				p.info.onNewKeyframe(num);
			}
		}
		if(com_tilbuci_data_GlobalPlayer.callback != null) {
			var tmp = com_tilbuci_data_GlobalPlayer.callback;
			var _g = new haxe_ds_StringMap();
			var value = this.get_currentKf();
			_g.h["kf"] = value;
			tmp("loadkeyframe",_g);
		}
		if(com_tilbuci_data_GlobalPlayer.mode != "editor") {
			if(this.get_currentKf() == com_tilbuci_data_GlobalPlayer.movie.scene.keyframes.length - 1) {
				if(!com_tilbuci_data_GlobalPlayer.contraptions.showingDflow()) {
					if(com_tilbuci_data_GlobalPlayer.movie.scene.hasDflow()) {
						com_tilbuci_data_GlobalPlayer.contraptions.dflowShow(com_tilbuci_data_GlobalPlayer.movie.scene.dflow);
					}
				}
			}
		}
	}
	,imgSelect: function(nm) {
		this._select.clearInstance();
		this._multiSelect.clear();
		var h = this._instances.h;
		var i_h = h;
		var i_keys = Object.keys(h);
		var i_length = i_keys.length;
		var i_current = 0;
		while(i_current < i_length) {
			var i = i_keys[i_current++];
			if(nm == null) {
				this._instances.h[i].selected = false;
			} else if(i == nm) {
				this._instances.h[i].selected = true;
				this._select.setInstance(this._instances.h[i]);
			} else {
				this._instances.h[i].selected = false;
			}
		}
	}
	,imgSelectMultiple: function(insts) {
		if(insts.length > 1) {
			this.imgSelect(null);
			this._multiSelect.clear();
			var _g = 0;
			while(_g < insts.length) {
				var i = insts[_g];
				++_g;
				this._multiSelect.add(i);
			}
		}
	}
	,setCurrentPrecache: function() {
		this._select.setAsPrecache();
	}
	,setCurrentNum: function(name,val) {
		this._select.setCurrentNum(name,val);
	}
	,setCurrentStr: function(name,val) {
		this._select.setCurrentStr(name,val);
	}
	,setCurrentBool: function(name,val) {
		this._select.setCurrentBool(name,val);
	}
	,setCurrentArray: function(name,val) {
		this._select.setCurrentArray(name,val);
	}
	,applyText: function() {
		this._select.applyText();
	}
	,setPropertyNum: function(name,prop,val) {
		var inst = this.pickInstance(name);
		if(inst != null) {
			var desc;
			if(com_tilbuci_data_Global.displayType == "portrait") {
				desc = com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[com_tilbuci_data_GlobalPlayer.area.get_currentKf()].h[name].vertical;
			} else {
				desc = com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[com_tilbuci_data_GlobalPlayer.area.get_currentKf()].h[name].horizontal;
			}
			switch(prop) {
			case "alpha":
				desc.alpha = inst.set_alpha(val);
				break;
			case "coloralpha":
				desc.colorAlpha = val;
				motion_Actuate.transform(inst,0.01).color(Std.parseInt(desc.color),desc.colorAlpha);
				break;
			case "height":
				desc.height = val;
				var newval = val;
				if(inst.get_transition() == "top" || inst.get_transition() == "bottom") {
					newval = val;
				}
				if(inst.get_currentType() == "paragraph" || inst.get_currentType() == "html") {
					inst.setTextSize(inst.get_width(),newval);
					inst.set_height(newval);
				} else {
					inst.set_height(newval);
				}
				break;
			case "rotation":
				desc.rotation = Math.round(val);
				inst.set_rotation(val);
				break;
			case "textleading":
				desc.textLeading = Math.round(val);
				break;
			case "textsize":
				desc.textSize = Math.round(val);
				break;
			case "textspacing":
				desc.textSpacing = val;
				break;
			case "volume":
				desc.volume = val;
				inst.setSound(val);
				break;
			case "width":
				desc.width = val;
				var newval = val;
				if(inst.get_transition() == "right" || inst.get_transition() == "left") {
					newval = val;
				}
				if(inst.get_currentType() == "paragraph" || inst.get_currentType() == "html") {
					inst.setTextSize(newval,inst.get_height());
					inst.set_width(newval);
				} else {
					inst.set_width(newval);
				}
				break;
			case "x":
				desc.x = inst.set_x(val);
				break;
			case "y":
				desc.y = inst.set_y(val);
				break;
			}
		}
	}
	,orderUp: function() {
		if(this._select.image != null) {
			var tot = 0;
			var h = this._instances.h;
			var n_h = h;
			var n_keys = Object.keys(h);
			var n_length = n_keys.length;
			var n_current = 0;
			while(n_current < n_length) {
				var n = n_h[n_keys[n_current++]];
				++tot;
			}
			if(this._select.image.getOrder() < tot - 1) {
				this._select.image.setOrder(this._select.image.getOrder() + 1);
				this.updateOrder();
			}
		}
	}
	,orderDown: function() {
		if(this._select.image != null) {
			if(this._select.image.getOrder() > 0) {
				this._select.image.setOrder(this._select.image.getOrder() - 1);
				this.updateOrder();
			}
		}
	}
	,updateOrder: function() {
		var h = this._instances.h;
		var imk_h = h;
		var imk_keys = Object.keys(h);
		var imk_length = imk_keys.length;
		var imk_current = 0;
		while(imk_current < imk_length) {
			var imk = imk_keys[imk_current++];
			this._instances.h[imk].setOrder(this._scene.getChildIndex(this._instances.h[imk]),false);
		}
		var hord = [];
		var vord = [];
		var h = com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[com_tilbuci_data_GlobalPlayer.area.get_currentKf()].h;
		var i_h = h;
		var i_keys = Object.keys(h);
		var i_length = i_keys.length;
		var i_current = 0;
		while(i_current < i_length) {
			var i = i_keys[i_current++];
			var inst = com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[com_tilbuci_data_GlobalPlayer.area.get_currentKf()].h[i];
			while(hord.length < inst.horizontal.order + 1) hord.push("");
			if(hord[inst.horizontal.order] == "") {
				hord[inst.horizontal.order] = i;
			} else {
				hord.splice(inst.horizontal.order,0,i);
			}
			while(vord.length < inst.vertical.order + 1) vord.push("");
			if(vord[inst.vertical.order] == "") {
				vord[inst.vertical.order] = i;
			} else {
				vord.splice(inst.vertical.order,0,i);
			}
		}
		var hind = 0;
		var _g = 0;
		var _g1 = hord.length;
		while(_g < _g1) {
			var ih = _g++;
			if(hord[ih] != "") {
				com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[com_tilbuci_data_GlobalPlayer.area.get_currentKf()].h[hord[ih]].horizontal.order = hind;
				++hind;
			}
		}
		var vind = 0;
		var _g = 0;
		var _g1 = vord.length;
		while(_g < _g1) {
			var iv = _g++;
			if(vord[iv] != "") {
				com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[com_tilbuci_data_GlobalPlayer.area.get_currentKf()].h[vord[iv]].vertical.order = vind;
				++vind;
			}
		}
	}
	,removeInstance: function(name,clearhist) {
		if(clearhist == null) {
			clearhist = false;
		}
		if(Object.prototype.hasOwnProperty.call(this._instances.h,name) && Object.prototype.hasOwnProperty.call(com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[this._currentKf].h,name)) {
			if(clearhist) {
				com_tilbuci_data_Global.history.clear();
			}
			com_tilbuci_data_Global.history.addState(com_tilbuci_data_Global.ln.get("rightbar-history-removeinst"));
			this._scene.removeChild(this._instances.h[name]);
			var _this = this._instances;
			if(Object.prototype.hasOwnProperty.call(_this.h,name)) {
				delete(_this.h[name]);
			}
			var _this = com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[this._currentKf];
			if(Object.prototype.hasOwnProperty.call(_this.h,name)) {
				delete(_this.h[name]);
			}
			this.updateOrder();
			return true;
		} else {
			return false;
		}
	}
	,onStage: function(evt) {
		this.removeEventListener("addedToStage",$bind(this,this.onStage));
		this.addEventListener("mouseUp",$bind(this,this.onMouseUp));
	}
	,onMouseUp: function(evt) {
		if(com_tilbuci_data_GlobalPlayer.mode == "editor") {
			if(this._select.image != null) {
				this._select.endPropSet();
			}
		}
	}
	,nextKeyframe: function() {
		if(com_tilbuci_data_GlobalPlayer.movie.scene.ackeyframes.length > this._currentKf) {
			if(com_tilbuci_data_GlobalPlayer.movie.scene.ackeyframes[this._currentKf] != "") {
				com_tilbuci_data_GlobalPlayer.parser.run(com_tilbuci_data_GlobalPlayer.movie.scene.ackeyframes[this._currentKf]);
			}
		}
		if(!com_tilbuci_data_GlobalPlayer.movie.scene.staticsc) {
			this._currentKf++;
			if(this._currentKf >= com_tilbuci_data_GlobalPlayer.movie.scene.keyframes.length) {
				this._currentKf = com_tilbuci_data_GlobalPlayer.movie.scene.loop;
			}
			this._kftoLoad = this._currentKf;
			if(this._playing) {
				this._kftoLoad = -1;
				this.loadKeyframe(com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[this._currentKf],this._currentKf);
			}
		} else {
			this.loadKeyframe(com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[this._currentKf],this._currentKf);
		}
	}
	,playPause: function() {
		if(this._playing) {
			motion_Actuate.pauseAll();
			this._playing = false;
		} else {
			motion_Actuate.resumeAll();
			if(this._kftoLoad >= 0) {
				this._kftoLoad = -1;
				this.loadKeyframe(com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[this._currentKf],this._currentKf);
			}
			this._playing = true;
		}
	}
	,play: function() {
		if(!this._playing) {
			if(com_tilbuci_data_GlobalPlayer.mode != "editorplayerwait") {
				motion_Actuate.resumeAll();
			} else {
				this._currentKf++;
				if(this._currentKf >= com_tilbuci_data_GlobalPlayer.movie.scene.keyframes.length) {
					this._currentKf = com_tilbuci_data_GlobalPlayer.movie.scene.loop;
				}
				this._kftoLoad = this._currentKf;
				com_tilbuci_data_GlobalPlayer.mode = "editorplayer";
			}
			if(this._kftoLoad >= 0) {
				this._kftoLoad = -1;
				this.loadKeyframe(com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[this._currentKf],this._currentKf);
			}
			var h = this._instances.h;
			var k_h = h;
			var k_keys = Object.keys(h);
			var k_length = k_keys.length;
			var k_current = 0;
			while(k_current < k_length) {
				var k = k_keys[k_current++];
				if(this._instances.h[k].playOnLoad()) {
					this._instances.h[k].play();
				}
			}
			this._playing = true;
		}
	}
	,pause: function() {
		if(this._playing) {
			motion_Actuate.pauseAll();
			this._playing = false;
			var h = this._instances.h;
			var k_h = h;
			var k_keys = Object.keys(h);
			var k_length = k_keys.length;
			var k_current = 0;
			while(k_current < k_length) {
				var k = k_keys[k_current++];
				this._instances.h[k].pause();
			}
		}
	}
	,playPauseInstance: function(name) {
		if(Object.prototype.hasOwnProperty.call(this._instances.h,name)) {
			this._instances.h[name].playPause();
			return true;
		} else {
			return false;
		}
	}
	,playInstance: function(name) {
		if(Object.prototype.hasOwnProperty.call(this._instances.h,name)) {
			this._instances.h[name].play();
			return true;
		} else {
			return false;
		}
	}
	,pauseInstance: function(name) {
		if(Object.prototype.hasOwnProperty.call(this._instances.h,name)) {
			this._instances.h[name].pause();
			return true;
		} else {
			return false;
		}
	}
	,stopInstance: function(name) {
		if(Object.prototype.hasOwnProperty.call(this._instances.h,name)) {
			this._instances.h[name].stop();
			return true;
		} else {
			return false;
		}
	}
	,instancePlaying: function(name) {
		if(Object.prototype.hasOwnProperty.call(this._instances.h,name)) {
			return this._instances.h[name].get_playing();
		} else {
			return false;
		}
	}
	,instanceSeek: function(name,time) {
		if(Object.prototype.hasOwnProperty.call(this._instances.h,name)) {
			this._instances.h[name].seek(time);
			return true;
		} else {
			return false;
		}
	}
	,instanceRef: function(name) {
		if(Object.prototype.hasOwnProperty.call(this._instances.h,name)) {
			return this._instances.h[name];
		} else {
			return null;
		}
	}
	,instanceProp: function(name,prop) {
		if(Object.prototype.hasOwnProperty.call(this._instances.h,name)) {
			return this._instances.h[name].getProp(prop);
		} else {
			return 0;
		}
	}
	,instanceBoolProp: function(name,prop) {
		if(Object.prototype.hasOwnProperty.call(this._instances.h,name)) {
			return this._instances.h[name].getBoolProp(prop);
		} else {
			return false;
		}
	}
	,instanceStringProp: function(name,prop) {
		if(Object.prototype.hasOwnProperty.call(this._instances.h,name)) {
			return this._instances.h[name].getStringProp(prop);
		} else {
			return "";
		}
	}
	,setAnimation: function(to) {
		switch(to) {
		case "bounce.in":
			motion_Actuate.defaultEase = motion_easing_Bounce.easeIn;
			break;
		case "bounce.inout":
			motion_Actuate.defaultEase = motion_easing_Bounce.easeInOut;
			break;
		case "bounce.out":
			motion_Actuate.defaultEase = motion_easing_Bounce.easeOut;
			break;
		case "cubic.in":
			motion_Actuate.defaultEase = motion_easing_Cubic.easeIn;
			break;
		case "cubic.inout":
			motion_Actuate.defaultEase = motion_easing_Cubic.easeInOut;
			break;
		case "cubic.out":
			motion_Actuate.defaultEase = motion_easing_Cubic.easeOut;
			break;
		case "elastic.in":
			motion_Actuate.defaultEase = motion_easing_Elastic.easeIn;
			break;
		case "elastic.inout":
			motion_Actuate.defaultEase = motion_easing_Elastic.easeInOut;
			break;
		case "elastic.out":
			motion_Actuate.defaultEase = motion_easing_Elastic.easeOut;
			break;
		case "expo.in":
			motion_Actuate.defaultEase = motion_easing_Expo.easeIn;
			break;
		case "expo.inout":
			motion_Actuate.defaultEase = motion_easing_Expo.easeInOut;
			break;
		case "expo.out":
			motion_Actuate.defaultEase = motion_easing_Expo.easeOut;
			break;
		case "linear":
			motion_Actuate.defaultEase = motion_easing_Linear.get_easeNone();
			break;
		case "quad.in":
			motion_Actuate.defaultEase = motion_easing_Quad.easeIn;
			break;
		case "quad.inout":
			motion_Actuate.defaultEase = motion_easing_Quad.easeInOut;
			break;
		case "quad.out":
			motion_Actuate.defaultEase = motion_easing_Quad.easeOut;
			break;
		case "quart.in":
			motion_Actuate.defaultEase = motion_easing_Quart.easeIn;
			break;
		case "quart.inout":
			motion_Actuate.defaultEase = motion_easing_Quart.easeInOut;
			break;
		case "quart.out":
			motion_Actuate.defaultEase = motion_easing_Quart.easeOut;
			break;
		case "quint.in":
			motion_Actuate.defaultEase = motion_easing_Quint.easeIn;
			break;
		case "quint.inout":
			motion_Actuate.defaultEase = motion_easing_Quint.easeInOut;
			break;
		case "quint.out":
			motion_Actuate.defaultEase = motion_easing_Quint.easeOut;
			break;
		case "sine.in":
			motion_Actuate.defaultEase = motion_easing_Sine.easeIn;
			break;
		case "sine.inout":
			motion_Actuate.defaultEase = motion_easing_Sine.easeInOut;
			break;
		case "sine.out":
			motion_Actuate.defaultEase = motion_easing_Sine.easeOut;
			break;
		}
	}
	,textScroll: function(inst,val) {
		if(Object.prototype.hasOwnProperty.call(this._instances.h,inst)) {
			this._instances.h[inst].textScroll(val);
			return true;
		} else {
			return false;
		}
	}
	,updateTexts: function() {
		var h = this._instances.h;
		var i_h = h;
		var i_keys = Object.keys(h);
		var i_length = i_keys.length;
		var i_current = 0;
		while(i_current < i_length) {
			var i = i_h[i_keys[i_current++]];
			i.updateText();
		}
	}
	,setText: function(inst,txt) {
		if(Object.prototype.hasOwnProperty.call(this._instances.h,inst)) {
			this._instances.h[inst].setText(txt);
			return true;
		} else {
			return false;
		}
	}
	,setVisible: function(inst,vis) {
		if(Object.prototype.hasOwnProperty.call(this._instances.h,inst)) {
			this._instances.h[inst].set_visible(vis);
			this.setProperty(inst,"visible",vis,vis);
			return true;
		} else {
			return false;
		}
	}
	,setProperty: function(inst,prop,vH,vV) {
		if(Object.prototype.hasOwnProperty.call(this._instances.h,inst)) {
			this._instances.h[inst].fixProp(prop,vH,vV);
			return true;
		} else {
			return false;
		}
	}
	,releaseProperty: function(inst,prop) {
		if(Object.prototype.hasOwnProperty.call(this._instances.h,inst)) {
			this._instances.h[inst].releaseProp(prop);
			return true;
		} else {
			return false;
		}
	}
	,releaseAllProperties: function(inst) {
		if(inst == null) {
			inst = "";
		}
		if(inst == "") {
			var h = this._instances.h;
			var ins_h = h;
			var ins_keys = Object.keys(h);
			var ins_length = ins_keys.length;
			var ins_current = 0;
			while(ins_current < ins_length) {
				var ins = ins_h[ins_keys[ins_current++]];
				ins.releaseAll();
			}
			return true;
		} else if(Object.prototype.hasOwnProperty.call(this._instances.h,inst)) {
			this._instances.h[inst].releaseAll();
			return true;
		} else {
			return false;
		}
	}
	,next: function(inst) {
		if(Object.prototype.hasOwnProperty.call(this._instances.h,inst)) {
			this._instances.h[inst].next();
			return true;
		} else {
			return false;
		}
	}
	,previous: function(inst) {
		if(Object.prototype.hasOwnProperty.call(this._instances.h,inst)) {
			this._instances.h[inst].previous();
			return true;
		} else {
			return false;
		}
	}
	,loadAsset: function(inst,name) {
		if(Object.prototype.hasOwnProperty.call(this._instances.h,inst)) {
			return this._instances.h[inst].loadAsset(name);
		} else {
			return false;
		}
	}
	,loadCollectionAsset: function(inst,col,ast) {
		if(Object.prototype.hasOwnProperty.call(this._instances.h,inst)) {
			return this._instances.h[inst].loadCollectionAsset(col,ast);
		} else {
			return false;
		}
	}
	,getOverlay: function(name,below) {
		if(below == null) {
			below = false;
		}
		if(below) {
			if(!Object.prototype.hasOwnProperty.call(this._bloverlays.h,name)) {
				var this1 = this._bloverlays;
				var v = new openfl_display_Sprite();
				this1.h[name] = v;
				this._bloverlay.addChild(this._bloverlays.h[name]);
			}
			return this._bloverlays.h[name];
		} else {
			if(!Object.prototype.hasOwnProperty.call(this._overlays.h,name)) {
				var this1 = this._overlays;
				var v = new openfl_display_Sprite();
				this1.h[name] = v;
				this._overlay.addChild(this._overlays.h[name]);
			}
			return this._overlays.h[name];
		}
	}
	,removeOverlay: function(name,below) {
		if(below == null) {
			below = false;
		}
		if(below) {
			if(Object.prototype.hasOwnProperty.call(this._bloverlays.h,name)) {
				this._bloverlay.removeChild(this._bloverlays.h[name]);
				this._bloverlays.h[name].removeChildren();
				this._bloverlays.h[name].get_graphics().clear();
				var _this = this._bloverlays;
				if(Object.prototype.hasOwnProperty.call(_this.h,name)) {
					delete(_this.h[name]);
				}
				return true;
			} else {
				return false;
			}
		} else if(Object.prototype.hasOwnProperty.call(this._overlays.h,name)) {
			this._overlay.removeChild(this._overlays.h[name]);
			this._overlays.h[name].removeChildren();
			this._overlays.h[name].get_graphics().clear();
			var _this = this._overlays;
			if(Object.prototype.hasOwnProperty.call(_this.h,name)) {
				delete(_this.h[name]);
			}
			return true;
		} else {
			return false;
		}
	}
	,overlayTop: function(name) {
		if(Object.prototype.hasOwnProperty.call(this._overlays.h,name)) {
			this._overlay.swapChildrenAt(this._overlay.get_numChildren() - 1,this._overlay.getChildIndex(this._overlays.h[name]));
			return true;
		} else {
			return false;
		}
	}
	,overlayBottom: function(name) {
		if(Object.prototype.hasOwnProperty.call(this._overlays.h,name)) {
			this._overlay.swapChildrenAt(0,this._overlay.getChildIndex(this._overlays.h[name]));
			return true;
		} else {
			return false;
		}
	}
	,kill: function() {
		this.removeEventListener("mouseUp",$bind(this,this.onMouseUp));
		this._bgarea.removeChildren();
		this._bgarea.get_graphics().clear();
		this._bgarea = null;
		this._player = null;
		this.removeChildren();
		this._holder.removeChildren();
		this._holder.set_mask(null);
		this._holder = null;
		this._bg.get_graphics().clear();
		this._bg = null;
		this._mask.get_graphics().clear();
		this._mask = null;
		this._scene.removeChildren();
		this._scene = null;
		var h = this._overlays.h;
		var o_h = h;
		var o_keys = Object.keys(h);
		var o_length = o_keys.length;
		var o_current = 0;
		while(o_current < o_length) {
			var o = o_keys[o_current++];
			this.removeOverlay(o);
		}
		this._overlays = null;
		this._overlay.removeChildren();
		this._overlay = null;
		var h = this._bloverlays.h;
		var o_h = h;
		var o_keys = Object.keys(h);
		var o_length = o_keys.length;
		var o_current = 0;
		while(o_current < o_length) {
			var o = o_keys[o_current++];
			this.removeOverlay(o,true);
		}
		this._bloverlays = null;
		this._bloverlay.removeChildren();
		this._bloverlay = null;
		var h = this._instances.h;
		var i_h = h;
		var i_keys = Object.keys(h);
		var i_length = i_keys.length;
		var i_current = 0;
		while(i_current < i_length) {
			var i = i_keys[i_current++];
			this._instances.h[i].kill();
			var _this = this._instances;
			if(Object.prototype.hasOwnProperty.call(_this.h,i)) {
				delete(_this.h[i]);
			}
		}
		this._instances = null;
		this._uiArea.removeChildren();
		this._uiArea = null;
		this._uiBg.get_graphics().clear();
		this._uiBg = null;
		this._inputPanel.kill();
		this._inputPanel = null;
	}
	,clear: function() {
		motion_Actuate.stop(this,{ kfPercent : 100},false,false);
		this._currentKf = 0;
		this._scene.removeChildren();
		var h = this._instances.h;
		var i_h = h;
		var i_keys = Object.keys(h);
		var i_length = i_keys.length;
		var i_current = 0;
		while(i_current < i_length) {
			var i = i_keys[i_current++];
			this._instances.h[i].kill();
			var _this = this._instances;
			if(Object.prototype.hasOwnProperty.call(_this.h,i)) {
				delete(_this.h[i]);
			}
		}
		this._uiBg.set_visible(false);
		this._inputPanel.set_visible(false);
	}
	,setArea: function() {
		this._bg.get_graphics().clear();
		this._mask.get_graphics().clear();
		this._bg.get_graphics().beginFill(com_tilbuci_data_GlobalPlayer.movie.data.screen.bgcolor);
		this._mask.get_graphics().beginFill(0);
		if(com_tilbuci_data_GlobalPlayer.movie.data.screen.type == "square") {
			this._bg.get_graphics().drawRect(0,0,com_tilbuci_data_GlobalPlayer.movie.data.screen.big,com_tilbuci_data_GlobalPlayer.movie.data.screen.big);
			this._mask.get_graphics().drawRect(0,0,com_tilbuci_data_GlobalPlayer.movie.data.screen.big,com_tilbuci_data_GlobalPlayer.movie.data.screen.big);
		} else if(com_tilbuci_data_GlobalPlayer.movie.data.screen.type == "horizontal" || com_tilbuci_data_GlobalPlayer.movie.data.screen.type == "landscape") {
			this._bg.get_graphics().drawRect(0,0,com_tilbuci_data_GlobalPlayer.movie.data.screen.big,com_tilbuci_data_GlobalPlayer.movie.data.screen.small);
			this._mask.get_graphics().drawRect(0,0,com_tilbuci_data_GlobalPlayer.movie.data.screen.big,com_tilbuci_data_GlobalPlayer.movie.data.screen.small);
		} else if(com_tilbuci_data_GlobalPlayer.movie.data.screen.type == "vertical" || com_tilbuci_data_GlobalPlayer.movie.data.screen.type == "portrait") {
			this._bg.get_graphics().drawRect(0,0,com_tilbuci_data_GlobalPlayer.movie.data.screen.small,com_tilbuci_data_GlobalPlayer.movie.data.screen.big);
			this._mask.get_graphics().drawRect(0,0,com_tilbuci_data_GlobalPlayer.movie.data.screen.small,com_tilbuci_data_GlobalPlayer.movie.data.screen.big);
		} else if(this.get_pOrientation() == "vertical") {
			this._bg.get_graphics().drawRect(0,0,com_tilbuci_data_GlobalPlayer.movie.data.screen.small,com_tilbuci_data_GlobalPlayer.movie.data.screen.big);
			this._mask.get_graphics().drawRect(0,0,com_tilbuci_data_GlobalPlayer.movie.data.screen.small,com_tilbuci_data_GlobalPlayer.movie.data.screen.big);
		} else {
			this._bg.get_graphics().drawRect(0,0,com_tilbuci_data_GlobalPlayer.movie.data.screen.big,com_tilbuci_data_GlobalPlayer.movie.data.screen.small);
			this._mask.get_graphics().drawRect(0,0,com_tilbuci_data_GlobalPlayer.movie.data.screen.big,com_tilbuci_data_GlobalPlayer.movie.data.screen.small);
		}
		this._bg.get_graphics().endFill();
		this._mask.get_graphics().endFill();
		this._uiBg.set_width(this._mask.get_width() * this._scale);
		this._uiBg.set_height(this._mask.get_height() * this._scale);
		this._bgarea.get_graphics().clear();
		this._bgarea.get_graphics().beginFill(0);
		this._bgarea.get_graphics().drawRect(0,0,this._player.get_rWidth(),this._player.get_rHeight());
		this._bgarea.get_graphics().endFill();
		com_tilbuci_data_GlobalPlayer.contraptions.changeDisplay();
		this.place();
	}
	,showLoginInput: function(acOk,acCancel) {
		var logintitle = com_tilbuci_data_GlobalPlayer.parser.parseString("$_TEXTS:logintitle");
		if(logintitle == "") {
			logintitle = "Login";
		}
		var logintext = com_tilbuci_data_GlobalPlayer.parser.parseString("$_TEXTS:logintext");
		if(logintext == "") {
			logintext = "Please type your e-mail address. You'll receive a 6 digit code to confirm your identity.";
		}
		var termsagree = com_tilbuci_data_GlobalPlayer.parser.parseString("$_TEXTS:termsagree");
		if(termsagree == "") {
			termsagree = "I agree with the above terms.";
		}
		var invalidemail = com_tilbuci_data_GlobalPlayer.parser.parseString("$_TEXTS:invalidemail");
		if(invalidemail == "") {
			invalidemail = "Please provide a valid e-mail address.";
		}
		var emailwait = com_tilbuci_data_GlobalPlayer.parser.parseString("$_TEXTS:emailwait");
		if(emailwait == "") {
			emailwait = "Please wait while a confirmation code is sent to your e-mail.";
		}
		var noemailsent = com_tilbuci_data_GlobalPlayer.parser.parseString("$_TEXTS:noemailsent");
		if(noemailsent == "") {
			noemailsent = "Error while sending the code by e-mail. Please try again.";
		}
		var checkforcode = com_tilbuci_data_GlobalPlayer.parser.parseString("$_TEXTS:checkforcode");
		if(checkforcode == "") {
			checkforcode = "Please check out your e-mail inbox. Type below the 6 digit code you received. If you do not find the message, take a look at you spam folder.";
		}
		var codewait = com_tilbuci_data_GlobalPlayer.parser.parseString("$_TEXTS:codewait");
		if(codewait == "") {
			codewait = "Please wait while the provided code is checked.";
		}
		var invalidcode = com_tilbuci_data_GlobalPlayer.parser.parseString("$_TEXTS:invalidcode");
		if(invalidcode == "") {
			invalidcode = "The provided code is invalid. Please try again.";
		}
		var emailsubject = com_tilbuci_data_GlobalPlayer.parser.parseString("$_TEXTS:emailsubject");
		if(emailsubject == "") {
			emailsubject = "TilBuci login";
		}
		var emailbody = com_tilbuci_data_GlobalPlayer.parser.parseString("$_TEXTS:emailbody");
		if(emailbody == "") {
			emailbody = "Hi, you are receiving this message to confirm your login at TilBuci. Please provide the code below to proceed:\r\n\r\n[CODE]\r\n\r\nIf you did'nt request this code, don't worry: just ignore this message.";
		}
		var emailsender = com_tilbuci_data_GlobalPlayer.parser.parseString("$_TEXTS:emailsender");
		if(emailsender == "") {
			emailsender = "TilBuci";
		}
		this._inputPanel.askLogin(logintitle,logintext,termsagree,invalidemail,emailwait,noemailsent,checkforcode,codewait,invalidcode,emailsubject,emailbody,emailsender,acOk,acCancel);
	}
	,showStatesInput: function(acOk,acCancel) {
		var titlestates = com_tilbuci_data_GlobalPlayer.parser.parseString("$_TEXTS:titlestates");
		if(titlestates == "") {
			titlestates = "Select a state to load";
		}
		var waistates = com_tilbuci_data_GlobalPlayer.parser.parseString("$_TEXTS:waistates");
		if(waistates == "") {
			waistates = "Please wait while a list of available saves states is loaded.";
		}
		var selectstate = com_tilbuci_data_GlobalPlayer.parser.parseString("$_TEXTS:selectstate");
		if(selectstate == "") {
			selectstate = "Select a state to load.";
		}
		var nostates = com_tilbuci_data_GlobalPlayer.parser.parseString("$_TEXTS:nostates");
		if(nostates == "") {
			nostates = "Sorry, no saved states found to load.";
		}
		var dateformat = com_tilbuci_data_GlobalPlayer.parser.parseString("$_TEXTS:dateformat");
		if(dateformat == "") {
			dateformat = "Y-m-d h:i a";
		}
		this._inputPanel.askStates(titlestates,waistates,selectstate,nostates,dateformat,acOk,acCancel);
	}
	,showTextInput: function(varname,title,acOk,acCancel) {
		this._inputPanel.askText(varname,title,acOk,acCancel);
	}
	,showSecretKeyInput: function(title) {
		this._inputPanel.askSecret(title);
	}
	,showMessageInput: function(title,text,acOk,acCancel) {
		this._inputPanel.setWarn(title,text,acOk,acCancel);
	}
	,showEmailInput: function(varname,title,domains,acOk,acCancel) {
		this._inputPanel.askEmail(varname,title,domains,acOk,acCancel);
	}
	,showListInput: function(varname,title,options,acOk,acCancel) {
		this._inputPanel.askList(varname,title,options,acOk,acCancel);
	}
	,showNumericInput: function(type,varname,title,acOk,acCancel,step,min,max) {
		if(max == null) {
			max = 100;
		}
		if(min == null) {
			min = 0;
		}
		if(step == null) {
			step = 0;
		}
		this._inputPanel.askNumeric(type,varname,title,acOk,acCancel,step,min,max);
	}
	,swapInstance: function(oldid,newid) {
		if(Object.prototype.hasOwnProperty.call(this._instances.h,oldid)) {
			var img = this._instances.h[oldid];
			if(img.changeId(oldid,newid)) {
				var _this = this._instances;
				if(Object.prototype.hasOwnProperty.call(_this.h,oldid)) {
					delete(_this.h[oldid]);
				}
				this._instances.h[newid] = img;
				return true;
			} else {
				return false;
			}
		} else {
			return false;
		}
	}
	,getInstances: function() {
		var list = [];
		var h = this._instances.h;
		var k_h = h;
		var k_keys = Object.keys(h);
		var k_length = k_keys.length;
		var k_current = 0;
		while(k_current < k_length) {
			var k = k_keys[k_current++];
			list.push(k);
		}
		return list;
	}
	,pickInstance: function(name) {
		if(Object.prototype.hasOwnProperty.call(this._instances.h,name)) {
			return this._instances.h[name];
		} else {
			return null;
		}
	}
	,maskArea: function(to) {
		if(to) {
			this._mask.set_visible(true);
			this._holder.set_mask(this._mask);
		} else {
			this._holder.set_mask(null);
			this._mask.set_visible(false);
		}
	}
	,setOverlay: function(to) {
		if(to && this._overlay.parent == null) {
			this._holder.addChild(this._overlay);
		} else if(!to && this._overlay.parent != null) {
			this._holder.removeChild(this._overlay);
		}
	}
	,place: function() {
		this._holder.removeChild(this._target);
		this._holder.removeChild(this._overlay);
		this._holder.removeChild(this._bloverlay);
		if(this.get_pOrientation() == "vertical") {
			this._scale = this._player.get_rWidth() / this.get_aWidth();
			if(this.get_aHeight() * this._scale > this._player.get_rHeight()) {
				this._scale = this._player.get_rHeight() / this.get_aHeight();
			}
		} else {
			this._scale = this._player.get_rHeight() / this.get_aHeight();
			if(this.get_aWidth() * this._scale > this._player.get_rWidth()) {
				this._scale = this._player.get_rWidth() / this.get_aWidth();
			}
		}
		this.set_scaleX(this.set_scaleY(this._scale));
		this._uiBg.set_width(this._mask.get_width() * this._scale);
		this._uiBg.set_height(this._mask.get_height() * this._scale);
		if(this._player.get_rWidth() - this.get_aWidth() * this._scale < this._player.get_rHeight() - this.get_aHeight() * this._scale) {
			this._uiArea.set_x(this.set_x(0));
			this._uiArea.set_y(this.set_y((this._player.get_rHeight() - this.get_aHeight() * this._scale) / 2));
		} else {
			this._uiArea.set_x(this.set_x((this._player.get_rWidth() - this.get_aWidth() * this._scale) / 2));
			this._uiArea.set_y(this.set_y(0));
		}
		com_tilbuci_data_GlobalPlayer.contentPosition.x = this._uiArea.get_x();
		com_tilbuci_data_GlobalPlayer.contentPosition.y = this._uiArea.get_y();
		com_tilbuci_data_GlobalPlayer.contentWidth = this._uiBg.get_width();
		com_tilbuci_data_GlobalPlayer.contentHeight = this._uiBg.get_height();
		if(this._player.get_rWidth() >= this._player.get_rHeight()) {
			com_tilbuci_data_GlobalPlayer.orientation = "horizontal";
			com_tilbuci_data_GlobalPlayer.multiply = Math.round(this._player.get_rWidth() / this.get_aWidth());
		} else {
			com_tilbuci_data_GlobalPlayer.orientation = "vertical";
			com_tilbuci_data_GlobalPlayer.multiply = Math.round(this._player.get_rHeight() / this.get_aHeight());
		}
		if(com_tilbuci_data_GlobalPlayer.multiply < 1) {
			com_tilbuci_data_GlobalPlayer.multiply = 1;
		} else if(com_tilbuci_data_GlobalPlayer.multiply > 5) {
			com_tilbuci_data_GlobalPlayer.multiply = 5;
		}
		this._holder.removeChildren();
		this._holder.addChild(this._bg);
		this._holder.addChild(this._bloverlay);
		this._holder.addChild(this._scene);
		this._holder.addChild(this._inputArea);
		this._holder.addChild(this._overlay);
		var h = com_tilbuci_data_GlobalPlayer.plugins.h;
		var p_h = h;
		var p_keys = Object.keys(h);
		var p_length = p_keys.length;
		var p_current = 0;
		while(p_current < p_length) {
			var p = p_h[p_keys[p_current++]];
			if(p.get_ready()) {
				p.info.onDisplayResize(com_tilbuci_data_GlobalPlayer.orientation,com_tilbuci_data_GlobalPlayer.multiply);
			}
		}
	}
	,removeInputInterfaces: function() {
		this.removeAllInputs();
		this.removeAllTareas();
		this.removeAllNumerics();
		this.removeAllToggles();
	}
	,addInput: function(name,px,py,width,placeholder) {
		if(placeholder == null) {
			placeholder = "";
		}
		this._player.addInput(name,px,py,width,placeholder);
	}
	,placeInput: function(name,px,py,width) {
		this._player.placeInput(name,px,py,width);
	}
	,removeInput: function(name) {
		this._player.removeInput(name);
	}
	,removeAllInputs: function() {
		this._player.removeAllInputs();
	}
	,getInputText: function(name) {
		return this._player.getInputText(name);
	}
	,setInputText: function(name,value) {
		this._player.setInputText(name,value);
	}
	,setInputPassword: function(name,pass) {
		this._player.setInputPassword(name,pass);
	}
	,addTarea: function(name,px,py,width,height) {
		this._player.addTarea(name,px,py,width,height);
	}
	,placeTarea: function(name,px,py,width,height) {
		this._player.placeTarea(name,px,py,width,height);
	}
	,removeTarea: function(name) {
		this._player.removeTarea(name);
	}
	,removeAllTareas: function() {
		this._player.removeAllTareas();
	}
	,getTareaText: function(name) {
		return this._player.getTareaText(name);
	}
	,setTareaText: function(name,value) {
		this._player.setTareaText(name,value);
	}
	,addNumeric: function(name,value,minimum,maximum,step) {
		this._player.addNumeric(name,value,minimum,maximum,step);
	}
	,placeNumeric: function(name,px,py,width) {
		this._player.placeNumeric(name,px,py,width);
	}
	,removeNumeric: function(name) {
		this._player.removeNumeric(name);
	}
	,removeAllNumerics: function() {
		this._player.removeAllNumerics();
	}
	,getNumericValue: function(name) {
		return this._player.getNumericValue(name);
	}
	,setNumericValue: function(name,value) {
		this._player.setNumericValue(name,value);
	}
	,setNumericBounds: function(name,minimum,maximum,step) {
		this._player.setNumericBounds(name,minimum,maximum,step);
	}
	,addToggle: function(name,value,px,py) {
		this._player.addToggle(name,value,px,py);
	}
	,placeToggle: function(name,px,py) {
		this._player.placeToggle(name,px,py);
	}
	,removeToggle: function(name) {
		this._player.removeToggle(name);
	}
	,removeAllToggles: function() {
		this._player.removeAllToggles();
	}
	,getToggleValue: function(name) {
		return this._player.getToggleValue(name);
	}
	,setToggleValue: function(name,value) {
		this._player.setToggleValue(name,value);
	}
	,invertToggle: function(name) {
		this._player.invertToggle(name);
	}
	,noMouseOver: function() {
		var h = this._instances.h;
		var inst_h = h;
		var inst_keys = Object.keys(h);
		var inst_length = inst_keys.length;
		var inst_current = 0;
		while(inst_current < inst_length) {
			var inst = inst_h[inst_keys[inst_current++]];
			inst.onMouseOut();
		}
	}
	,__class__: com_tilbuci_player_MovieArea
	,__properties__: $extend(openfl_display_Sprite.prototype.__properties__,{get_currentKf:"get_currentKf",get_playing:"get_playing",get_pOrientation:"get_pOrientation",get_aOrientation:"get_aOrientation",get_aHeight:"get_aHeight",get_aWidth:"get_aWidth"})
});
var com_tilbuci_player_Target = function() {
	this._lastname = "xxx";
	this._inst3len = 0;
	this._inst2len = 0;
	this._inst1len = 0;
	this._tgname = "";
	this.targetY = 0;
	this.targetX = 0;
	this.lastInstOver = "";
	openfl_display_Sprite.call(this);
	this.set_visible(false);
	com_tilbuci_data_GlobalPlayer.usingTarget = 0;
	this._custom = new com_tilbuci_display_PictureImage($bind(this,this.onLoad));
	this.clear();
};
$hxClasses["com.tilbuci.player.Target"] = com_tilbuci_player_Target;
com_tilbuci_player_Target.__name__ = "com.tilbuci.player.Target";
com_tilbuci_player_Target.__super__ = openfl_display_Sprite;
com_tilbuci_player_Target.prototype = $extend(openfl_display_Sprite.prototype,{
	timer: null
	,lastInstOver: null
	,targetX: null
	,targetY: null
	,_bmp: null
	,_tgname: null
	,_custom: null
	,_inst1len: null
	,_inst2len: null
	,_inst3len: null
	,_lastname: null
	,clear: function() {
		this.removeChildren();
		this._tgname = "";
		this._lastname = "xxx";
		this._inst1len = this._inst2len = this._inst3len = 0;
		if(this._bmp != null) {
			this._bmp.get_bitmapData().dispose();
		}
		this._bmp = new openfl_display_Bitmap(openfl_utils_Assets.getBitmapData("icTarget"));
		this._bmp.set_x(-(this._bmp.get_width() / 2));
		this._bmp.set_y(-(this._bmp.get_height() / 2));
		this.addChild(this._bmp);
	}
	,load: function(nm) {
		if(Object.prototype.hasOwnProperty.call(com_tilbuci_data_GlobalPlayer.contraptions.targets.h,nm)) {
			if(com_tilbuci_data_GlobalPlayer.contraptions.targets.h[nm].ok) {
				this.clear();
				this._tgname = nm;
				this._lastname = "";
				this._custom.load(com_tilbuci_data_GlobalPlayer.contraptions.targets.h[nm].defaultp);
				if(com_tilbuci_data_GlobalPlayer.contraptions.targets.h[nm].inst1name != "") {
					this._inst1len = com_tilbuci_data_GlobalPlayer.contraptions.targets.h[nm].inst1name.length;
				}
				if(com_tilbuci_data_GlobalPlayer.contraptions.targets.h[nm].inst2name != "") {
					this._inst2len = com_tilbuci_data_GlobalPlayer.contraptions.targets.h[nm].inst2name.length;
				}
				if(com_tilbuci_data_GlobalPlayer.contraptions.targets.h[nm].inst3name != "") {
					this._inst3len = com_tilbuci_data_GlobalPlayer.contraptions.targets.h[nm].inst3name.length;
				}
				return true;
			} else {
				return false;
			}
		} else {
			return false;
		}
	}
	,setGraphic: function(nm) {
		if(this._tgname != "" && nm != this._lastname) {
			this._lastname = nm;
			if(nm == "") {
				if(this._custom.get_lastMedia() != com_tilbuci_data_GlobalPlayer.contraptions.targets.h[this._tgname].defaultp) {
					this._custom.load(com_tilbuci_data_GlobalPlayer.contraptions.targets.h[this._tgname].defaultp);
				}
			} else if(nm == "_menu_" && com_tilbuci_data_GlobalPlayer.contraptions.targets.h[this._tgname].menus != "") {
				this._custom.load(com_tilbuci_data_GlobalPlayer.contraptions.targets.h[this._tgname].menus);
			} else if(nm == "_interface_" && com_tilbuci_data_GlobalPlayer.contraptions.targets.h[this._tgname].interf != "") {
				this._custom.load(com_tilbuci_data_GlobalPlayer.contraptions.targets.h[this._tgname].interf);
			} else if(this._inst1len > 0 && HxOverrides.substr(nm,0,this._inst1len) == com_tilbuci_data_GlobalPlayer.contraptions.targets.h[this._tgname].inst1name) {
				if(this._custom.get_lastMedia() != com_tilbuci_data_GlobalPlayer.contraptions.targets.h[this._tgname].inst1) {
					this._custom.load(com_tilbuci_data_GlobalPlayer.contraptions.targets.h[this._tgname].inst1);
				}
			} else if(this._inst2len > 0 && HxOverrides.substr(nm,0,this._inst2len) == com_tilbuci_data_GlobalPlayer.contraptions.targets.h[this._tgname].inst2name) {
				if(this._custom.get_lastMedia() != com_tilbuci_data_GlobalPlayer.contraptions.targets.h[this._tgname].inst2) {
					this._custom.load(com_tilbuci_data_GlobalPlayer.contraptions.targets.h[this._tgname].inst2);
				}
			} else if(this._inst3len > 0 && HxOverrides.substr(nm,0,this._inst3len) == com_tilbuci_data_GlobalPlayer.contraptions.targets.h[this._tgname].inst3name) {
				if(this._custom.get_lastMedia() != com_tilbuci_data_GlobalPlayer.contraptions.targets.h[this._tgname].inst3) {
					this._custom.load(com_tilbuci_data_GlobalPlayer.contraptions.targets.h[this._tgname].inst3);
				}
			} else if(this._custom.get_lastMedia() != com_tilbuci_data_GlobalPlayer.contraptions.targets.h[this._tgname].defaultp) {
				this._custom.load(com_tilbuci_data_GlobalPlayer.contraptions.targets.h[this._tgname].defaultp);
			}
		}
	}
	,show: function() {
		this.targetX = this.set_x(com_tilbuci_data_GlobalPlayer.area.get_aWidth() / 2);
		this.targetY = this.set_y(com_tilbuci_data_GlobalPlayer.area.get_aHeight() / 2);
		this.set_visible(true);
		com_tilbuci_data_GlobalPlayer.usingTarget = Math.round(com_tilbuci_data_GlobalPlayer.area.get_aWidth() / 64);
		if(com_tilbuci_data_GlobalPlayer.area.get_aHeight() / 64 < com_tilbuci_data_GlobalPlayer.usingTarget) {
			com_tilbuci_data_GlobalPlayer.usingTarget = Math.round(com_tilbuci_data_GlobalPlayer.area.get_aHeight() / 64);
		}
		com_tilbuci_data_GlobalPlayer.parser.onDragMoveStop(null);
		this.set_alpha(1);
	}
	,hide: function() {
		com_tilbuci_data_GlobalPlayer.usingTarget = 0;
		this.set_visible(false);
		com_tilbuci_data_GlobalPlayer.parser.onDragMoveStop(null);
	}
	,onLoad: function(ok) {
		if(!ok) {
			this.clear();
		} else {
			this.removeChildren();
			this._custom.set_visible(true);
			this._custom.set_x(-(this._custom.get_width() / 2));
			this._custom.set_y(-(this._custom.get_height() / 2));
			this.addChild(this._custom);
		}
	}
	,__class__: com_tilbuci_player_Target
});
var com_tilbuci_plugin_Plugin = function(nm,tt,fl,index,ws) {
	if(ws == null) {
		ws = false;
	}
	if(index == null) {
		index = false;
	}
	if(fl == null) {
		fl = "";
	}
	this._actions = new haxe_ds_StringMap();
	this.active = false;
	this.config = new haxe_ds_StringMap();
	this._ready = false;
	this._plws = false;
	this._plindex = false;
	openfl_events_EventDispatcher.call(this);
	this._plname = nm;
	this._pltitle = tt;
	this._plfile = fl;
	this._plindex = index;
	this._plws = ws;
	this._ready = false;
	this.info = new com_tilbuci_plugin_SystemInfo();
};
$hxClasses["com.tilbuci.plugin.Plugin"] = com_tilbuci_plugin_Plugin;
com_tilbuci_plugin_Plugin.__name__ = "com.tilbuci.plugin.Plugin";
com_tilbuci_plugin_Plugin.__super__ = openfl_events_EventDispatcher;
com_tilbuci_plugin_Plugin.prototype = $extend(openfl_events_EventDispatcher.prototype,{
	plname: null
	,_plname: null
	,get_plname: function() {
		return this._plname;
	}
	,pltitle: null
	,_pltitle: null
	,get_pltitle: function() {
		if(this._pltitle == null || this._pltitle == "") {
			return this._plname;
		} else {
			return this._pltitle;
		}
	}
	,plfile: null
	,_plfile: null
	,get_plfile: function() {
		return this._plfile;
	}
	,_plindex: null
	,_plws: null
	,ready: null
	,_ready: null
	,get_ready: function() {
		return this._ready;
	}
	,config: null
	,info: null
	,active: null
	,_actions: null
	,_access: null
	,initialize: function(ac) {
		var index = "0";
		if(this._plindex) {
			index = "1";
		}
		var ws = "0";
		if(this._plws) {
			ws = "1";
		}
		var tmp = com_tilbuci_data_GlobalPlayer.ws;
		var _g = new haxe_ds_StringMap();
		_g.h["name"] = this._plname;
		_g.h["file"] = this._plfile;
		_g.h["index"] = index;
		_g.h["ws"] = ws;
		tmp.send("Plugin/GetConfig",_g,$bind(this,this.onConfig));
		this._access = ac;
	}
	,onConfig: function(ok,ld) {
		if(ok) {
			if(ld.map.h["e"] == 0) {
				if(Object.prototype.hasOwnProperty.call(ld.map.h,"conf")) {
					var _g = 0;
					var _g1 = Reflect.fields(ld.map.h["conf"]);
					while(_g < _g1.length) {
						var f = _g1[_g];
						++_g;
						var v = Reflect.field(ld.map.h["conf"],f);
						this.config.h[f] = v;
					}
				}
			}
		}
		this._ready = true;
	}
	,addMenu: function(name,callback,top) {
		if(top == null) {
			top = true;
		}
		if(com_tilbuci_data_GlobalPlayer.mode == "editor") {
			var tmp = com_tilbuci_data_Global.editorActions;
			var _g = new haxe_ds_StringMap();
			_g.h["name"] = name;
			_g.h["callback"] = callback;
			_g.h["top"] = top;
			_g.h["asset"] = "btPlugin";
			tmp("addleftbutton",_g);
		}
	}
	,showWindow: function(wd) {
		var tmp = com_tilbuci_data_Global.editorActions;
		var _g = new haxe_ds_StringMap();
		_g.h["wd"] = wd;
		tmp("showwindow",_g);
	}
	,hideWindow: function(wd) {
		var tmp = com_tilbuci_data_Global.editorActions;
		var _g = new haxe_ds_StringMap();
		_g.h["wd"] = wd;
		tmp("hidewindow",_g);
	}
	,updateConfig: function(callback) {
		var index = "0";
		if(this._plindex) {
			index = "1";
		}
		var ws = "0";
		if(this._plws) {
			ws = "1";
		}
		var _g = new haxe_ds_StringMap();
		_g.h["name"] = this._plname;
		_g.h["file"] = this._plfile;
		_g.h["index"] = index;
		_g.h["ws"] = ws;
		var value = com_tilbuci_statictools_StringStatic.jsonStringify(this.config);
		_g.h["conf"] = value;
		var data = _g;
		com_tilbuci_data_Global.ws.send("Plugin/SetConfig",data,callback);
	}
	,setAction: function(name,func) {
		var v = func;
		this._actions.h[name] = v;
	}
	,removeAction: function(name) {
		if(Object.prototype.hasOwnProperty.call(this._actions.h,name)) {
			var _this = this._actions;
			if(Object.prototype.hasOwnProperty.call(_this.h,name)) {
				delete(_this.h[name]);
			}
			return true;
		} else {
			return false;
		}
	}
	,hasAction: function(name) {
		return Object.prototype.hasOwnProperty.call(this._actions.h,name);
	}
	,runAction: function(name,param,after) {
		if(this.hasAction(name)) {
			return this._actions.h[name](param,after);
		} else {
			return false;
		}
	}
	,checkKeyboard: function(code) {
		return false;
	}
	,getOverlay: function(name) {
		return com_tilbuci_data_GlobalPlayer.area.getOverlay(name);
	}
	,removeOverlay: function(name) {
		return com_tilbuci_data_GlobalPlayer.area.removeOverlay(name);
	}
	,overlayTop: function(name) {
		return com_tilbuci_data_GlobalPlayer.area.overlayTop(name);
	}
	,overlayBottom: function(name) {
		return com_tilbuci_data_GlobalPlayer.area.overlayBottom(name);
	}
	,parseBool: function(str) {
		return { found : false, value : false};
	}
	,parseString: function(str) {
		return { found : false, value : ""};
	}
	,parseFloat: function(str) {
		return { found : false, value : 0};
	}
	,parseInt: function(str) {
		return { found : false, value : 0};
	}
	,addActionGroupDescription: function(ag) {
		com_tilbuci_data_GlobalPlayer.parser.addAvailableGroup(ag);
	}
	,addGlobalVarGroupDescription: function(gg) {
		com_tilbuci_data_GlobalPlayer.parser.addAvailableGlobal(gg);
	}
	,getConfig: function(interf) {
		if(interf == null) {
			interf = true;
		}
		return { };
	}
	,setConfig: function(to) {
	}
	,getSceneConfig: function(sc,interf) {
		if(interf == null) {
			interf = true;
		}
		return { };
	}
	,setSceneConfig: function(sc,to) {
	}
	,kill: function() {
		this._ready = false;
		var h = this._actions.h;
		var k_h = h;
		var k_keys = Object.keys(h);
		var k_length = k_keys.length;
		var k_current = 0;
		while(k_current < k_length) {
			var k = k_keys[k_current++];
			var _this = this._actions;
			if(Object.prototype.hasOwnProperty.call(_this.h,k)) {
				delete(_this.h[k]);
			}
		}
		this._actions = null;
		this._access.kill();
		this._access = null;
		this.info.kill();
		this.info = null;
	}
	,__class__: com_tilbuci_plugin_Plugin
	,__properties__: {get_ready:"get_ready",get_plfile:"get_plfile",get_pltitle:"get_pltitle",get_plname:"get_plname"}
});
var com_tilbuci_plugin_PluginAccess = function(vS,vF,vI,vB,pr) {
	this.varString = vS;
	this.varFloat = vF;
	this.varInt = vI;
	this.varBool = vB;
	this.parser = pr;
};
$hxClasses["com.tilbuci.plugin.PluginAccess"] = com_tilbuci_plugin_PluginAccess;
com_tilbuci_plugin_PluginAccess.__name__ = "com.tilbuci.plugin.PluginAccess";
com_tilbuci_plugin_PluginAccess.prototype = {
	varString: null
	,varFloat: null
	,varInt: null
	,varBool: null
	,parser: null
	,kill: function() {
		this.varString = null;
		this.varFloat = null;
		this.varInt = null;
		this.varBool = null;
		this.parser = null;
	}
	,__class__: com_tilbuci_plugin_PluginAccess
};
var com_tilbuci_plugin_PluginEvent = function(type,ok,ext,bubbles,cancelable) {
	if(cancelable == null) {
		cancelable = false;
	}
	if(bubbles == null) {
		bubbles = false;
	}
	if(ok == null) {
		ok = true;
	}
	this.extra = new haxe_ds_StringMap();
	this.ok = true;
	openfl_events_Event.call(this,type,bubbles,cancelable);
	this.ok = ok;
	if(ext != null) {
		this.extra = ext;
	}
};
$hxClasses["com.tilbuci.plugin.PluginEvent"] = com_tilbuci_plugin_PluginEvent;
com_tilbuci_plugin_PluginEvent.__name__ = "com.tilbuci.plugin.PluginEvent";
com_tilbuci_plugin_PluginEvent.__super__ = openfl_events_Event;
com_tilbuci_plugin_PluginEvent.prototype = $extend(openfl_events_Event.prototype,{
	ok: null
	,extra: null
	,__class__: com_tilbuci_plugin_PluginEvent
});
var feathers_core_IFocusObject = function() { };
$hxClasses["feathers.core.IFocusObject"] = feathers_core_IFocusObject;
feathers_core_IFocusObject.__name__ = "feathers.core.IFocusObject";
feathers_core_IFocusObject.__isInterface__ = true;
feathers_core_IFocusObject.__interfaces__ = [feathers_core_IDisplayObject,feathers_core_IFocusManagerAware];
feathers_core_IFocusObject.prototype = {
	get_focusEnabled: null
	,set_focusEnabled: null
	,get_focusOwner: null
	,set_focusOwner: null
	,showFocus: null
	,__class__: feathers_core_IFocusObject
	,__properties__: {set_focusOwner:"set_focusOwner",get_focusOwner:"get_focusOwner",set_focusEnabled:"set_focusEnabled",get_focusEnabled:"get_focusEnabled"}
};
var feathers_core_InvalidationFlag = $hxEnums["feathers.core.InvalidationFlag"] = { __ename__:"feathers.core.InvalidationFlag",__constructs__:null
	,STATE: {_hx_name:"STATE",_hx_index:0,__enum__:"feathers.core.InvalidationFlag",toString:$estr}
	,SIZE: {_hx_name:"SIZE",_hx_index:1,__enum__:"feathers.core.InvalidationFlag",toString:$estr}
	,STYLES: {_hx_name:"STYLES",_hx_index:2,__enum__:"feathers.core.InvalidationFlag",toString:$estr}
	,SKIN: {_hx_name:"SKIN",_hx_index:3,__enum__:"feathers.core.InvalidationFlag",toString:$estr}
	,LAYOUT: {_hx_name:"LAYOUT",_hx_index:4,__enum__:"feathers.core.InvalidationFlag",toString:$estr}
	,DATA: {_hx_name:"DATA",_hx_index:5,__enum__:"feathers.core.InvalidationFlag",toString:$estr}
	,SCROLL: {_hx_name:"SCROLL",_hx_index:6,__enum__:"feathers.core.InvalidationFlag",toString:$estr}
	,SELECTION: {_hx_name:"SELECTION",_hx_index:7,__enum__:"feathers.core.InvalidationFlag",toString:$estr}
	,FOCUS: {_hx_name:"FOCUS",_hx_index:8,__enum__:"feathers.core.InvalidationFlag",toString:$estr}
	,SORT: {_hx_name:"SORT",_hx_index:9,__enum__:"feathers.core.InvalidationFlag",toString:$estr}
	,CUSTOM: ($_=function(value) { return {_hx_index:10,value:value,__enum__:"feathers.core.InvalidationFlag",toString:$estr}; },$_._hx_name="CUSTOM",$_.__params__ = ["value"],$_)
};
feathers_core_InvalidationFlag.__constructs__ = [feathers_core_InvalidationFlag.STATE,feathers_core_InvalidationFlag.SIZE,feathers_core_InvalidationFlag.STYLES,feathers_core_InvalidationFlag.SKIN,feathers_core_InvalidationFlag.LAYOUT,feathers_core_InvalidationFlag.DATA,feathers_core_InvalidationFlag.SCROLL,feathers_core_InvalidationFlag.SELECTION,feathers_core_InvalidationFlag.FOCUS,feathers_core_InvalidationFlag.SORT,feathers_core_InvalidationFlag.CUSTOM];
var feathers_utils_DisplayObjectFactory = function() {
};
$hxClasses["feathers.utils.DisplayObjectFactory"] = feathers_utils_DisplayObjectFactory;
feathers_utils_DisplayObjectFactory.__name__ = "feathers.utils.DisplayObjectFactory";
feathers_utils_DisplayObjectFactory.withDisplayObject = function(displayObject,destroy) {
	var item = new feathers_utils_DisplayObjectFactory();
	item.create = function() {
		return displayObject;
	};
	item.destroy = destroy;
	return item;
};
feathers_utils_DisplayObjectFactory.withClass = function(displayObjectType,destroy) {
	if(destroy == null) {
		destroy = function(target) {
			if(js_Boot.__implements(target,feathers_core_IUIControl)) {
				target.dispose();
			}
		};
	}
	var item = new feathers_utils_DisplayObjectFactory();
	item.create = function() {
		return Type.createInstance(displayObjectType,[]);
	};
	item.destroy = destroy;
	return item;
};
feathers_utils_DisplayObjectFactory.withFunction = function(create,destroy) {
	var item = new feathers_utils_DisplayObjectFactory();
	item.create = create;
	item.destroy = destroy;
	return item;
};
feathers_utils_DisplayObjectFactory.prototype = {
	create: function() {
		return null;
	}
	,destroy: function(target) {
	}
	,__class__: feathers_utils_DisplayObjectFactory
};
var js_Boot = function() { };
$hxClasses["js.Boot"] = js_Boot;
js_Boot.__name__ = "js.Boot";
js_Boot.getClass = function(o) {
	if(o == null) {
		return null;
	} else if(((o) instanceof Array)) {
		return Array;
	} else {
		var cl = o.__class__;
		if(cl != null) {
			return cl;
		}
		var name = js_Boot.__nativeClassName(o);
		if(name != null) {
			return js_Boot.__resolveNativeClass(name);
		}
		return null;
	}
};
js_Boot.__string_rec = function(o,s) {
	if(o == null) {
		return "null";
	}
	if(s.length >= 5) {
		return "<...>";
	}
	var t = typeof(o);
	if(t == "function" && (o.__name__ || o.__ename__)) {
		t = "object";
	}
	switch(t) {
	case "function":
		return "<function>";
	case "object":
		if(o.__enum__) {
			var e = $hxEnums[o.__enum__];
			var con = e.__constructs__[o._hx_index];
			var n = con._hx_name;
			if(con.__params__) {
				s = s + "\t";
				return n + "(" + ((function($this) {
					var $r;
					var _g = [];
					{
						var _g1 = 0;
						var _g2 = con.__params__;
						while(true) {
							if(!(_g1 < _g2.length)) {
								break;
							}
							var p = _g2[_g1];
							_g1 = _g1 + 1;
							_g.push(js_Boot.__string_rec(o[p],s));
						}
					}
					$r = _g;
					return $r;
				}(this))).join(",") + ")";
			} else {
				return n;
			}
		}
		if(((o) instanceof Array)) {
			var str = "[";
			s += "\t";
			var _g = 0;
			var _g1 = o.length;
			while(_g < _g1) {
				var i = _g++;
				str += (i > 0 ? "," : "") + js_Boot.__string_rec(o[i],s);
			}
			str += "]";
			return str;
		}
		var tostr;
		try {
			tostr = o.toString;
		} catch( _g ) {
			haxe_NativeStackTrace.lastError = _g;
			return "???";
		}
		if(tostr != null && tostr != Object.toString && typeof(tostr) == "function") {
			var s2 = o.toString();
			if(s2 != "[object Object]") {
				return s2;
			}
		}
		var str = "{\n";
		s += "\t";
		var hasp = o.hasOwnProperty != null;
		var k = null;
		for( k in o ) {
		if(hasp && !o.hasOwnProperty(k)) {
			continue;
		}
		if(k == "prototype" || k == "__class__" || k == "__super__" || k == "__interfaces__" || k == "__properties__") {
			continue;
		}
		if(str.length != 2) {
			str += ", \n";
		}
		str += s + k + " : " + js_Boot.__string_rec(o[k],s);
		}
		s = s.substring(1);
		str += "\n" + s + "}";
		return str;
	case "string":
		return o;
	default:
		return String(o);
	}
};
js_Boot.__interfLoop = function(cc,cl) {
	if(cc == null) {
		return false;
	}
	if(cc == cl) {
		return true;
	}
	var intf = cc.__interfaces__;
	if(intf != null) {
		var _g = 0;
		var _g1 = intf.length;
		while(_g < _g1) {
			var i = _g++;
			var i1 = intf[i];
			if(i1 == cl || js_Boot.__interfLoop(i1,cl)) {
				return true;
			}
		}
	}
	return js_Boot.__interfLoop(cc.__super__,cl);
};
js_Boot.__instanceof = function(o,cl) {
	if(cl == null) {
		return false;
	}
	switch(cl) {
	case Array:
		return ((o) instanceof Array);
	case Bool:
		return typeof(o) == "boolean";
	case Dynamic:
		return o != null;
	case Float:
		return typeof(o) == "number";
	case Int:
		if(typeof(o) == "number") {
			return ((o | 0) === o);
		} else {
			return false;
		}
		break;
	case String:
		return typeof(o) == "string";
	default:
		if(o != null) {
			if(typeof(cl) == "function") {
				if(js_Boot.__downcastCheck(o,cl)) {
					return true;
				}
			} else if(typeof(cl) == "object" && js_Boot.__isNativeObj(cl)) {
				if(((o) instanceof cl)) {
					return true;
				}
			}
		} else {
			return false;
		}
		if(cl == Class ? o.__name__ != null : false) {
			return true;
		}
		if(cl == Enum ? o.__ename__ != null : false) {
			return true;
		}
		return o.__enum__ != null ? $hxEnums[o.__enum__] == cl : false;
	}
};
js_Boot.__downcastCheck = function(o,cl) {
	if(!((o) instanceof cl)) {
		if(cl.__isInterface__) {
			return js_Boot.__interfLoop(js_Boot.getClass(o),cl);
		} else {
			return false;
		}
	} else {
		return true;
	}
};
js_Boot.__implements = function(o,iface) {
	return js_Boot.__interfLoop(js_Boot.getClass(o),iface);
};
js_Boot.__cast = function(o,t) {
	if(o == null || js_Boot.__instanceof(o,t)) {
		return o;
	} else {
		throw haxe_Exception.thrown("Cannot cast " + Std.string(o) + " to " + Std.string(t));
	}
};
js_Boot.__nativeClassName = function(o) {
	var name = js_Boot.__toStr.call(o).slice(8,-1);
	if(name == "Object" || name == "Function" || name == "Math" || name == "JSON") {
		return null;
	}
	return name;
};
js_Boot.__isNativeObj = function(o) {
	return js_Boot.__nativeClassName(o) != null;
};
js_Boot.__resolveNativeClass = function(name) {
	return $global[name];
};
var feathers_controls_IRange = function() { };
$hxClasses["feathers.controls.IRange"] = feathers_controls_IRange;
feathers_controls_IRange.__name__ = "feathers.controls.IRange";
feathers_controls_IRange.__isInterface__ = true;
feathers_controls_IRange.__interfaces__ = [feathers_core_IUIControl];
feathers_controls_IRange.prototype = {
	get_value: null
	,set_value: null
	,get_minimum: null
	,set_minimum: null
	,get_maximum: null
	,set_maximum: null
	,__class__: feathers_controls_IRange
	,__properties__: {set_maximum:"set_maximum",get_maximum:"get_maximum",set_minimum:"set_minimum",get_minimum:"get_minimum",set_value:"set_value",get_value:"get_value"}
};
var feathers_controls_IScrollBar = function() { };
$hxClasses["feathers.controls.IScrollBar"] = feathers_controls_IScrollBar;
feathers_controls_IScrollBar.__name__ = "feathers.controls.IScrollBar";
feathers_controls_IScrollBar.__isInterface__ = true;
feathers_controls_IScrollBar.__interfaces__ = [feathers_controls_IRange];
feathers_controls_IScrollBar.prototype = {
	get_step: null
	,set_step: null
	,get_page: null
	,set_page: null
	,__class__: feathers_controls_IScrollBar
	,__properties__: {set_page:"set_page",get_page:"get_page",set_step:"set_step",get_step:"get_step"}
};
var feathers_core_IStateContext = function() { };
$hxClasses["feathers.core.IStateContext"] = feathers_core_IStateContext;
feathers_core_IStateContext.__name__ = "feathers.core.IStateContext";
feathers_core_IStateContext.__isInterface__ = true;
feathers_core_IStateContext.__interfaces__ = [openfl_events_IEventDispatcher];
feathers_core_IStateContext.prototype = {
	get_currentState: null
	,__class__: feathers_core_IStateContext
	,__properties__: {get_currentState:"get_currentState"}
};
var feathers_controls_ITriggerView = function() { };
$hxClasses["feathers.controls.ITriggerView"] = feathers_controls_ITriggerView;
feathers_controls_ITriggerView.__name__ = "feathers.controls.ITriggerView";
feathers_controls_ITriggerView.__isInterface__ = true;
feathers_controls_ITriggerView.__interfaces__ = [feathers_core_IUIControl];
var feathers_controls_BasicButton = function(triggerListener) {
	this.__backgroundSkin = null;
	this.__keepDownStateOnRollOut = false;
	this._stateToSkin = new haxe_ds_EnumValueMap();
	this._currentBackgroundSkin = null;
	this._backgroundSkinMeasurements = null;
	this._pointerTrigger = null;
	this._keyToState = null;
	this._pointerToState = null;
	this._currentState = feathers_controls_ButtonState.UP;
	feathers_core_FeathersControl.call(this);
	this.mouseChildren = false;
	this.set_buttonMode(true);
	this.useHandCursor = false;
	this.addEventListener("click",$bind(this,this.basicButton_clickHandler));
	this.addEventListener("touchTap",$bind(this,this.basicButton_touchTapHandler));
	if(triggerListener != null) {
		this.addEventListener("trigger",triggerListener);
	}
};
$hxClasses["feathers.controls.BasicButton"] = feathers_controls_BasicButton;
feathers_controls_BasicButton.__name__ = "feathers.controls.BasicButton";
feathers_controls_BasicButton.__interfaces__ = [feathers_core_IStateContext,feathers_controls_ITriggerView];
feathers_controls_BasicButton.__super__ = feathers_core_FeathersControl;
feathers_controls_BasicButton.prototype = $extend(feathers_core_FeathersControl.prototype,{
	_currentState: null
	,get_currentState: function() {
		return this._currentState;
	}
	,set_enabled: function(value) {
		feathers_core_FeathersControl.prototype.set_enabled.call(this,value);
		if(this._enabled) {
			if(this._currentState == feathers_controls_ButtonState.DISABLED) {
				this.changeState(feathers_controls_ButtonState.UP);
			}
		} else {
			this.changeState(feathers_controls_ButtonState.DISABLED);
		}
		return this._enabled;
	}
	,_pointerToState: null
	,_keyToState: null
	,_pointerTrigger: null
	,_backgroundSkinMeasurements: null
	,_currentBackgroundSkin: null
	,_stateToSkin: null
	,getSkinForState: function(state) {
		return this._stateToSkin.get(state);
	}
	,setSkinForState: function(state,skin) {
		if(!this.setStyle("setSkinForState",state)) {
			return;
		}
		var oldSkin = this._stateToSkin.get(state);
		if(oldSkin != null && oldSkin == this._currentBackgroundSkin) {
			this.removeCurrentBackgroundSkin(oldSkin);
			this._currentBackgroundSkin = null;
		}
		if(skin == null) {
			this._stateToSkin.remove(state);
		} else {
			this._stateToSkin.set(state,skin);
		}
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
	}
	,initialize: function() {
		feathers_core_FeathersControl.prototype.initialize.call(this);
		if(this._pointerToState == null) {
			this._pointerToState = new feathers_utils_PointerToState(this,$bind(this,this.changeState),feathers_controls_ButtonState.UP,feathers_controls_ButtonState.DOWN,feathers_controls_ButtonState.HOVER);
		}
		if(this._keyToState == null) {
			this._keyToState = new feathers_utils_KeyToState(this,$bind(this,this.changeState),feathers_controls_ButtonState.UP,feathers_controls_ButtonState.DOWN);
		}
		if(this._pointerTrigger == null) {
			this._pointerTrigger = new feathers_utils_PointerTrigger(this);
		}
	}
	,update: function() {
		this.commitChanges();
		this.measure();
		this.layoutContent();
	}
	,commitChanges: function() {
		var stylesInvalid = this.isInvalid(feathers_core_InvalidationFlag.STYLES);
		var stateInvalid = this.isInvalid(feathers_core_InvalidationFlag.STATE);
		if(stylesInvalid || stateInvalid) {
			this.refreshBackgroundSkin();
		}
		if(stylesInvalid) {
			this.refreshInteractivity();
		}
	}
	,layoutContent: function() {
		this.layoutBackgroundSkin();
	}
	,refreshInteractivity: function() {
		this._pointerToState.set_keepDownStateOnRollOut(this.get_keepDownStateOnRollOut());
	}
	,refreshBackgroundSkin: function() {
		var oldSkin = this._currentBackgroundSkin;
		this._currentBackgroundSkin = this.getCurrentBackgroundSkin();
		if(this._currentBackgroundSkin == oldSkin) {
			return;
		}
		this.removeCurrentBackgroundSkin(oldSkin);
		this.addCurrentBackgroundSkin(this._currentBackgroundSkin);
	}
	,getCurrentBackgroundSkin: function() {
		var result = this._stateToSkin.get(this._currentState);
		if(result != null) {
			return result;
		}
		return this.get_backgroundSkin();
	}
	,addCurrentBackgroundSkin: function(skin) {
		if(skin == null) {
			this._backgroundSkinMeasurements = null;
			return;
		}
		if(js_Boot.__implements(skin,feathers_core_IUIControl)) {
			skin.initializeNow();
		}
		if(this._backgroundSkinMeasurements == null) {
			this._backgroundSkinMeasurements = new feathers_layout_Measurements(skin);
		} else {
			this._backgroundSkinMeasurements.save(skin);
		}
		if(js_Boot.__implements(skin,feathers_skins_IProgrammaticSkin)) {
			skin.set_uiContext(this);
		}
		if(js_Boot.__implements(skin,feathers_core_IStateObserver)) {
			skin.set_stateContext(this);
		}
		this.addChildAt(skin,0);
	}
	,removeCurrentBackgroundSkin: function(skin) {
		if(skin == null) {
			return;
		}
		if(js_Boot.__implements(skin,feathers_skins_IProgrammaticSkin)) {
			skin.set_uiContext(null);
		}
		if(js_Boot.__implements(skin,feathers_core_IStateObserver)) {
			skin.set_stateContext(null);
		}
		this._backgroundSkinMeasurements.restore(skin);
		if(skin.parent == this) {
			this.removeChild(skin);
		}
	}
	,measure: function() {
		var needsWidth = this.get_explicitWidth() == null;
		var needsHeight = this.get_explicitHeight() == null;
		var needsMinWidth = this.get_explicitMinWidth() == null;
		var needsMinHeight = this.get_explicitMinHeight() == null;
		var needsMaxWidth = this.get_explicitMaxWidth() == null;
		var needsMaxHeight = this.get_explicitMaxHeight() == null;
		if(!needsWidth && !needsHeight && !needsMinWidth && !needsMinHeight && !needsMaxWidth && !needsMaxHeight) {
			return false;
		}
		if(this._currentBackgroundSkin != null) {
			feathers_utils_MeasurementsUtil.resetFluidlyWithParent(this._backgroundSkinMeasurements,this._currentBackgroundSkin,this);
		}
		var measureSkin = null;
		if(js_Boot.__implements(this._currentBackgroundSkin,feathers_core_IMeasureObject)) {
			measureSkin = this._currentBackgroundSkin;
		}
		if(js_Boot.__implements(this._currentBackgroundSkin,feathers_core_IValidating)) {
			this._currentBackgroundSkin.validateNow();
		}
		var newWidth = this.get_explicitWidth();
		if(needsWidth) {
			if(this._currentBackgroundSkin != null) {
				newWidth = this._currentBackgroundSkin.get_width();
			} else {
				newWidth = 0.0;
			}
		}
		var newHeight = this.get_explicitHeight();
		if(needsHeight) {
			if(this._currentBackgroundSkin != null) {
				newHeight = this._currentBackgroundSkin.get_height();
			} else {
				newHeight = 0.0;
			}
		}
		var newMinWidth = this.get_explicitMinWidth();
		if(needsMinWidth) {
			if(measureSkin != null) {
				newMinWidth = measureSkin.get_minWidth();
			} else if(this._backgroundSkinMeasurements != null && this._backgroundSkinMeasurements.minWidth != null) {
				newMinWidth = this._backgroundSkinMeasurements.minWidth;
			} else {
				newMinWidth = 0.0;
			}
		}
		var newMinHeight = this.get_explicitMinHeight();
		if(needsMinHeight) {
			if(measureSkin != null) {
				newMinHeight = measureSkin.get_minHeight();
			} else if(this._backgroundSkinMeasurements != null && this._backgroundSkinMeasurements.minHeight != null) {
				newMinHeight = this._backgroundSkinMeasurements.minHeight;
			} else {
				newMinHeight = 0.0;
			}
		}
		var newMaxWidth = this.get_explicitMaxWidth();
		if(needsMaxWidth) {
			if(measureSkin != null) {
				newMaxWidth = measureSkin.get_maxWidth();
			} else if(this._backgroundSkinMeasurements != null && this._backgroundSkinMeasurements.maxWidth != null) {
				newMaxWidth = this._backgroundSkinMeasurements.maxWidth;
			} else {
				newMaxWidth = 1.0 / 0.0;
			}
		}
		var newMaxHeight = this.get_explicitMaxHeight();
		if(needsMaxHeight) {
			if(measureSkin != null) {
				newMaxHeight = measureSkin.get_maxHeight();
			} else if(this._backgroundSkinMeasurements != null && this._backgroundSkinMeasurements.maxHeight != null) {
				newMaxHeight = this._backgroundSkinMeasurements.maxHeight;
			} else {
				newMaxHeight = 1.0 / 0.0;
			}
		}
		return this.saveMeasurements(newWidth,newHeight,newMinWidth,newMinHeight,newMaxWidth,newMaxHeight);
	}
	,layoutBackgroundSkin: function() {
		if(this._currentBackgroundSkin == null) {
			return;
		}
		this._currentBackgroundSkin.set_x(0.0);
		this._currentBackgroundSkin.set_y(0.0);
		if(this._currentBackgroundSkin.get_width() != this.actualWidth) {
			this._currentBackgroundSkin.set_width(this.actualWidth);
		}
		if(this._currentBackgroundSkin.get_height() != this.actualHeight) {
			this._currentBackgroundSkin.set_height(this.actualHeight);
		}
		if(js_Boot.__implements(this._currentBackgroundSkin,feathers_core_IValidating)) {
			this._currentBackgroundSkin.validateNow();
		}
	}
	,changeState: function(state) {
		if(!this._enabled) {
			state = feathers_controls_ButtonState.DISABLED;
		}
		if(this._currentState == state) {
			return;
		}
		this._currentState = state;
		this.setInvalid(feathers_core_InvalidationFlag.STATE);
		feathers_events_FeathersEvent.dispatch(this,"stateChange");
	}
	,basicButton_clickHandler: function(event) {
		if(!this._enabled) {
			event.stopImmediatePropagation();
			return;
		}
	}
	,basicButton_touchTapHandler: function(event) {
		if(!this._enabled) {
			event.stopImmediatePropagation();
			return;
		}
	}
	,__keepDownStateOnRollOut: null
	,get_keepDownStateOnRollOut: function() {
		return this.__keepDownStateOnRollOut;
	}
	,set_keepDownStateOnRollOut: function(value) {
		if(!this.setStyle("keepDownStateOnRollOut")) {
			return this.__keepDownStateOnRollOut;
		}
		if(this.__keepDownStateOnRollOut == value) {
			return this.__keepDownStateOnRollOut;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_keepDownStateOnRollOut);
		this.__keepDownStateOnRollOut = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__keepDownStateOnRollOut;
	}
	,clearStyle_keepDownStateOnRollOut: function() {
		this.set_keepDownStateOnRollOut(false);
		return this.get_keepDownStateOnRollOut();
	}
	,__backgroundSkin: null
	,get_backgroundSkin: function() {
		return this.__backgroundSkin;
	}
	,set_backgroundSkin: function(value) {
		if(!this.setStyle("backgroundSkin")) {
			return this.__backgroundSkin;
		}
		if(this.__backgroundSkin == value) {
			return this.__backgroundSkin;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_backgroundSkin);
		this.__backgroundSkin = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__backgroundSkin;
	}
	,clearStyle_backgroundSkin: function() {
		this.set_backgroundSkin(null);
		return this.get_backgroundSkin();
	}
	,__class__: feathers_controls_BasicButton
	,__properties__: $extend(feathers_core_FeathersControl.prototype.__properties__,{set_backgroundSkin:"set_backgroundSkin",get_backgroundSkin:"get_backgroundSkin",set_keepDownStateOnRollOut:"set_keepDownStateOnRollOut",get_keepDownStateOnRollOut:"get_keepDownStateOnRollOut",get_currentState:"get_currentState"})
});
var feathers_core_IHTMLTextControl = function() { };
$hxClasses["feathers.core.IHTMLTextControl"] = feathers_core_IHTMLTextControl;
feathers_core_IHTMLTextControl.__name__ = "feathers.core.IHTMLTextControl";
feathers_core_IHTMLTextControl.__isInterface__ = true;
feathers_core_IHTMLTextControl.__interfaces__ = [feathers_core_IUIControl];
feathers_core_IHTMLTextControl.prototype = {
	get_htmlText: null
	,set_htmlText: null
	,__class__: feathers_core_IHTMLTextControl
	,__properties__: {set_htmlText:"set_htmlText",get_htmlText:"get_htmlText"}
};
var feathers_core_ITextControl = function() { };
$hxClasses["feathers.core.ITextControl"] = feathers_core_ITextControl;
feathers_core_ITextControl.__name__ = "feathers.core.ITextControl";
feathers_core_ITextControl.__isInterface__ = true;
feathers_core_ITextControl.__interfaces__ = [feathers_core_IUIControl];
feathers_core_ITextControl.prototype = {
	get_text: null
	,set_text: null
	,get_baseline: null
	,__class__: feathers_core_ITextControl
	,__properties__: {get_baseline:"get_baseline",set_text:"set_text",get_text:"get_text"}
};
var feathers_controls_Button = function(text,triggerListener) {
	this.__showText = true;
	this.__textOffsetY = 0.0;
	this.__textOffsetX = 0.0;
	this.__iconOffsetY = 0.0;
	this.__iconOffsetX = 0.0;
	this.__minGap = 0.0;
	this.__gap = 0.0;
	this.__iconPosition = feathers_layout_RelativePosition.LEFT;
	this.__verticalAlign = feathers_layout_VerticalAlign.MIDDLE;
	this.__horizontalAlign = feathers_layout_HorizontalAlign.CENTER;
	this.__paddingLeft = 0.0;
	this.__paddingBottom = 0.0;
	this.__paddingRight = 0.0;
	this.__paddingTop = 0.0;
	this.__icon = null;
	this.__wordWrap = false;
	this.__embedFonts = false;
	this.__disabledTextFormat = null;
	this.__styleSheet = null;
	this.__textFormat = null;
	this._stateToTextFormat = new haxe_ds_EnumValueMap();
	this._wrappedOnMeasure = false;
	this._ignoreIconResizes = false;
	this._currentIcon = null;
	this._iconMeasurements = null;
	this._stateToIcon = new haxe_ds_EnumValueMap();
	this._htmlText = null;
	this._updatedTextStyles = false;
	this._previousSimpleTextFormat = null;
	this._previousTextFormat = null;
	this._previousHTMLText = null;
	this._previousText = null;
	this.initializeButtonTheme();
	feathers_controls_BasicButton.call(this,triggerListener);
	this.set_text(text);
	this.set_tabEnabled(true);
	this.set_tabChildren(false);
	this.focusRect = false;
	this.addEventListener("keyDown",$bind(this,this.button_keyDownHandler));
	this.addEventListener("focusIn",$bind(this,this.button_focusInHandler));
	this.addEventListener("focusOut",$bind(this,this.button_focusOutHandler));
};
$hxClasses["feathers.controls.Button"] = feathers_controls_Button;
feathers_controls_Button.__name__ = "feathers.controls.Button";
feathers_controls_Button.__interfaces__ = [feathers_core_IFocusObject,feathers_core_IHTMLTextControl,feathers_core_ITextControl];
feathers_controls_Button.__super__ = feathers_controls_BasicButton;
feathers_controls_Button.prototype = $extend(feathers_controls_BasicButton.prototype,{
	textField: null
	,_previousText: null
	,_previousHTMLText: null
	,_previousTextFormat: null
	,_previousSimpleTextFormat: null
	,_updatedTextStyles: null
	,_text: null
	,get_text: function() {
		return this._text;
	}
	,set_text: function(value) {
		if(this._text == value) {
			return this._text;
		}
		this._text = value;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		return this._text;
	}
	,_htmlText: null
	,get_htmlText: function() {
		return this._htmlText;
	}
	,set_htmlText: function(value) {
		if(this._htmlText == value) {
			return this._htmlText;
		}
		this._htmlText = value;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		return this._htmlText;
	}
	,get_baseline: function() {
		if(this.textField == null) {
			return 0.0;
		}
		var hasText = this._text != null && this._text.length > 0;
		var hasHTMLText = this._htmlText != null && this._htmlText.length > 0;
		if(!this.get_showText() || !hasText && !hasHTMLText) {
			var textFieldY = this.textField.get_y();
			if(!this.get_showText() || this._text == null && this._htmlText == null) {
				if(this._currentIcon != null) {
					textFieldY = this._currentIcon.get_y() + (this._currentIcon.get_height() - this._textMeasuredHeight) / 2.0;
				} else if(this._currentBackgroundSkin != null) {
					textFieldY = (this._currentBackgroundSkin.get_height() - this._textMeasuredHeight) / 2.0;
				} else {
					return 0.0;
				}
			}
			this.textField.set_text("​");
			var textFieldBaseline = textFieldY + this.textField.getLineMetrics(0).ascent;
			this.textField.set_text("");
			return textFieldBaseline;
		}
		return this.textField.get_y() + this.textField.getLineMetrics(0).ascent;
	}
	,_stateToIcon: null
	,_iconMeasurements: null
	,_currentIcon: null
	,_ignoreIconResizes: null
	,_textMeasuredWidth: null
	,_textMeasuredHeight: null
	,_wrappedOnMeasure: null
	,_stateToTextFormat: null
	,getTextFormatForState: function(state) {
		return this._stateToTextFormat.get(state);
	}
	,setTextFormatForState: function(state,textFormat) {
		if(!this.setStyle("setTextFormatForState",state)) {
			return;
		}
		if(textFormat == null) {
			this._stateToTextFormat.remove(state);
		} else {
			this._stateToTextFormat.set(state,textFormat);
		}
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
	}
	,getIconForState: function(state) {
		return this._stateToIcon.get(state);
	}
	,setIconForState: function(state,icon) {
		if(!this.setStyle("setIconForState",state)) {
			return;
		}
		var oldIcon = this._stateToIcon.get(state);
		if(oldIcon != null && oldIcon == this._currentIcon) {
			this.removeCurrentIcon(oldIcon);
			this._currentIcon = null;
		}
		if(icon == null) {
			this._stateToIcon.remove(state);
		} else {
			this._stateToIcon.set(state,icon);
		}
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
	}
	,setPadding: function(value) {
		this.set_paddingTop(value);
		this.set_paddingRight(value);
		this.set_paddingBottom(value);
		this.set_paddingLeft(value);
	}
	,initializeButtonTheme: function() {
		feathers_themes_steel_components_SteelButtonStyles.initialize();
	}
	,initialize: function() {
		feathers_controls_BasicButton.prototype.initialize.call(this);
		if(this.textField == null) {
			this.textField = new openfl_text_TextField();
			this.textField.set_selectable(false);
			this.textField.set_multiline(true);
			this.addChild(this.textField);
		}
	}
	,commitChanges: function() {
		feathers_controls_BasicButton.prototype.commitChanges.call(this);
		var dataInvalid = this.isInvalid(feathers_core_InvalidationFlag.DATA);
		var sizeInvalid = this.isInvalid(feathers_core_InvalidationFlag.SIZE);
		var stateInvalid = this.isInvalid(feathers_core_InvalidationFlag.STATE);
		var stylesInvalid = this.isInvalid(feathers_core_InvalidationFlag.STYLES);
		this._updatedTextStyles = false;
		if(stylesInvalid || stateInvalid) {
			this.refreshIcon();
		}
		if(stylesInvalid || stateInvalid) {
			this.refreshTextStyles();
		}
		if(dataInvalid || stylesInvalid || stateInvalid || sizeInvalid) {
			this.refreshText(sizeInvalid);
		}
	}
	,measure: function() {
		var needsWidth = this.get_explicitWidth() == null;
		var needsHeight = this.get_explicitHeight() == null;
		var needsMinWidth = this.get_explicitMinWidth() == null;
		var needsMinHeight = this.get_explicitMinHeight() == null;
		var needsMaxWidth = this.get_explicitMaxWidth() == null;
		var needsMaxHeight = this.get_explicitMaxHeight() == null;
		if(!needsWidth && !needsHeight && !needsMinWidth && !needsMinHeight && !needsMaxWidth && !needsMaxHeight) {
			return false;
		}
		var hasText = this.get_showText() && this._text != null;
		var hasHTMLText = this.get_showText() && this._htmlText != null && this._htmlText.length > 0;
		if(hasText || hasHTMLText) {
			this.refreshTextFieldDimensions(true);
		}
		if(this._currentBackgroundSkin != null) {
			feathers_utils_MeasurementsUtil.resetFluidlyWithParent(this._backgroundSkinMeasurements,this._currentBackgroundSkin,this);
		}
		var measureSkin = null;
		if(js_Boot.__implements(this._currentBackgroundSkin,feathers_core_IMeasureObject)) {
			measureSkin = this._currentBackgroundSkin;
		}
		if(js_Boot.__implements(this._currentBackgroundSkin,feathers_core_IValidating)) {
			this._currentBackgroundSkin.validateNow();
		}
		if(js_Boot.__implements(this._currentIcon,feathers_core_IValidating)) {
			var oldIgnoreIconResizes = this._ignoreIconResizes;
			this._ignoreIconResizes = true;
			this._currentIcon.validateNow();
			this._ignoreIconResizes = oldIgnoreIconResizes;
		}
		var newWidth = this.get_explicitWidth();
		if(needsWidth) {
			newWidth = this.measureContentWidth();
			newWidth += this.get_paddingLeft() + this.get_paddingRight();
			if(this._currentBackgroundSkin != null) {
				newWidth = Math.max(this._currentBackgroundSkin.get_width(),newWidth);
			}
		}
		var newHeight = this.get_explicitHeight();
		if(needsHeight) {
			newHeight = this.measureContentHeight();
			newHeight += this.get_paddingTop() + this.get_paddingBottom();
			if(this._currentBackgroundSkin != null) {
				newHeight = Math.max(this._currentBackgroundSkin.get_height(),newHeight);
			}
		}
		var newMinWidth = this.get_explicitMinWidth();
		if(needsMinWidth) {
			newMinWidth = this.measureContentMinWidth();
			newMinWidth += this.get_paddingLeft() + this.get_paddingRight();
			if(measureSkin != null) {
				newMinWidth = Math.max(measureSkin.get_minWidth(),newMinWidth);
			} else if(this._backgroundSkinMeasurements != null && this._backgroundSkinMeasurements.minWidth != null) {
				newMinWidth = Math.max(this._backgroundSkinMeasurements.minWidth,newMinWidth);
			}
		}
		var newMinHeight = this.get_explicitMinHeight();
		if(needsMinHeight) {
			newMinHeight = this.measureContentMinHeight();
			newMinHeight += this.get_paddingTop() + this.get_paddingBottom();
			if(measureSkin != null) {
				newMinHeight = Math.max(measureSkin.get_minHeight(),newMinHeight);
			} else if(this._backgroundSkinMeasurements != null && this._backgroundSkinMeasurements.minHeight != null) {
				newMinHeight = Math.max(this._backgroundSkinMeasurements.minHeight,newMinHeight);
			}
		}
		var newMaxWidth = this.get_explicitMaxWidth();
		if(needsMaxWidth) {
			if(measureSkin != null) {
				newMaxWidth = measureSkin.get_maxWidth();
			} else if(this._backgroundSkinMeasurements != null && this._backgroundSkinMeasurements.maxWidth != null) {
				newMaxWidth = this._backgroundSkinMeasurements.maxWidth;
			} else {
				newMaxWidth = 1.0 / 0.0;
			}
		}
		var newMaxHeight = this.get_explicitMaxHeight();
		if(needsMaxHeight) {
			if(measureSkin != null) {
				newMaxHeight = measureSkin.get_maxHeight();
			} else if(this._backgroundSkinMeasurements != null && this._backgroundSkinMeasurements.maxHeight != null) {
				newMaxHeight = this._backgroundSkinMeasurements.maxHeight;
			} else {
				newMaxHeight = 1.0 / 0.0;
			}
		}
		return this.saveMeasurements(newWidth,newHeight,newMinWidth,newMinHeight,newMaxWidth,newMaxHeight);
	}
	,calculateExplicitWidthForTextMeasurement: function() {
		var textFieldExplicitWidth = null;
		if(this.get_explicitWidth() != null) {
			textFieldExplicitWidth = this.get_explicitWidth();
		} else if(this.get_explicitMaxWidth() != null) {
			textFieldExplicitWidth = this.get_explicitMaxWidth();
		} else if(this._backgroundSkinMeasurements != null && this._backgroundSkinMeasurements.maxWidth != null) {
			textFieldExplicitWidth = this._backgroundSkinMeasurements.maxWidth;
		}
		if(textFieldExplicitWidth == null) {
			return textFieldExplicitWidth;
		}
		textFieldExplicitWidth -= this.get_paddingLeft() + this.get_paddingRight();
		var adjustedGap = this.get_gap();
		if(adjustedGap == 1.0 / 0.0) {
			adjustedGap = this.get_minGap();
		}
		if(this._currentIcon != null) {
			if(this.get_iconPosition() == feathers_layout_RelativePosition.LEFT || this.get_iconPosition() == feathers_layout_RelativePosition.RIGHT) {
				if(js_Boot.__implements(this._currentIcon,feathers_core_IValidating)) {
					this._currentIcon.validateNow();
				}
				textFieldExplicitWidth -= this._currentIcon.get_width() + adjustedGap;
			}
		}
		if(textFieldExplicitWidth < 0.0) {
			textFieldExplicitWidth = 0.0;
		}
		return textFieldExplicitWidth;
	}
	,measureContentWidth: function() {
		var adjustedGap = this.get_gap();
		if(adjustedGap == 1.0 / 0.0) {
			adjustedGap = this.get_minGap();
		}
		var hasText = this.get_showText() && this._text != null;
		var hasHTMLText = this.get_showText() && this._htmlText != null && this._htmlText.length > 0;
		var contentWidth = hasText || hasHTMLText ? this._textMeasuredWidth : 0.0;
		if(this._currentIcon != null) {
			if(this.get_iconPosition() == feathers_layout_RelativePosition.LEFT || this.get_iconPosition() == feathers_layout_RelativePosition.RIGHT) {
				if(hasText || hasHTMLText) {
					contentWidth += adjustedGap;
				}
				contentWidth += this._currentIcon.get_width();
			} else if(this.get_iconPosition() == feathers_layout_RelativePosition.TOP || this.get_iconPosition() == feathers_layout_RelativePosition.BOTTOM) {
				contentWidth = Math.max(contentWidth,this._currentIcon.get_width());
			}
		}
		return contentWidth;
	}
	,measureContentHeight: function() {
		var adjustedGap = this.get_gap();
		if(adjustedGap == 1.0 / 0.0) {
			adjustedGap = this.get_minGap();
		}
		var hasText = this.get_showText() && this._text != null;
		var hasHTMLText = this.get_showText() && this._htmlText != null && this._htmlText.length > 0;
		var contentHeight = hasText || hasHTMLText ? this._textMeasuredHeight : 0.0;
		if(this._currentIcon != null) {
			if(this.get_iconPosition() == feathers_layout_RelativePosition.TOP || this.get_iconPosition() == feathers_layout_RelativePosition.BOTTOM) {
				if(hasText || hasHTMLText) {
					contentHeight += adjustedGap;
				}
				contentHeight += this._currentIcon.get_height();
			} else if(this.get_iconPosition() == feathers_layout_RelativePosition.LEFT || this.get_iconPosition() == feathers_layout_RelativePosition.RIGHT) {
				contentHeight = Math.max(contentHeight,this._currentIcon.get_height());
			}
		}
		return contentHeight;
	}
	,measureContentMinWidth: function() {
		var adjustedGap = this.get_gap();
		if(adjustedGap == 1.0 / 0.0) {
			adjustedGap = this.get_minGap();
		}
		var hasText = this.get_showText() && this._text != null;
		var hasHTMLText = this.get_showText() && this._htmlText != null && this._htmlText.length > 0;
		var contentMinWidth = hasText || hasHTMLText ? this._textMeasuredWidth : 0.0;
		if(this._currentIcon != null) {
			if(this.get_iconPosition() == feathers_layout_RelativePosition.LEFT || this.get_iconPosition() == feathers_layout_RelativePosition.RIGHT) {
				if(hasText || hasHTMLText) {
					contentMinWidth += adjustedGap;
				}
				contentMinWidth += this._currentIcon.get_width();
			} else if(this.get_iconPosition() == feathers_layout_RelativePosition.TOP || this.get_iconPosition() == feathers_layout_RelativePosition.BOTTOM) {
				contentMinWidth = Math.max(contentMinWidth,this._currentIcon.get_width());
			}
		}
		return contentMinWidth;
	}
	,measureContentMinHeight: function() {
		var adjustedGap = this.get_gap();
		if(adjustedGap == 1.0 / 0.0) {
			adjustedGap = this.get_minGap();
		}
		var hasText = this.get_showText() && this._text != null;
		var hasHTMLText = this.get_showText() && this._htmlText != null && this._htmlText.length > 0;
		var contentMinHeight = hasText || hasHTMLText ? this._textMeasuredHeight : 0.0;
		if(this._currentIcon != null) {
			if(this.get_iconPosition() == feathers_layout_RelativePosition.TOP || this.get_iconPosition() == feathers_layout_RelativePosition.BOTTOM) {
				if(hasText || hasHTMLText) {
					contentMinHeight += adjustedGap;
				}
				contentMinHeight += this._currentIcon.get_height();
			} else if(this.get_iconPosition() == feathers_layout_RelativePosition.LEFT || this.get_iconPosition() == feathers_layout_RelativePosition.RIGHT) {
				contentMinHeight = Math.max(contentMinHeight,this._currentIcon.get_height());
			}
		}
		return contentMinHeight;
	}
	,refreshTextStyles: function() {
		if(this.textField.get_wordWrap() != this.get_wordWrap()) {
			this.textField.set_wordWrap(this.get_wordWrap());
			this._updatedTextStyles = true;
		}
		if(this.textField.get_embedFonts() != this.get_embedFonts()) {
			this.textField.set_embedFonts(this.get_embedFonts());
			this._updatedTextStyles = true;
		}
		if(this.textField.get_styleSheet() != this.get_styleSheet()) {
			this.textField.set_styleSheet(this.get_styleSheet());
			this._updatedTextStyles = true;
		}
		var textFormat = this.getCurrentTextFormat();
		var simpleTextFormat = textFormat != null ? textFormat.toSimpleTextFormat() : null;
		if(simpleTextFormat == this._previousSimpleTextFormat) {
			return;
		}
		if(this._previousTextFormat != null) {
			this._previousTextFormat.removeEventListener("change",$bind(this,this.button_textFormat_changeHandler));
		}
		if(textFormat != null) {
			textFormat.addEventListener("change",$bind(this,this.button_textFormat_changeHandler),false,0,true);
			this.textField.set_defaultTextFormat(simpleTextFormat);
			this._updatedTextStyles = true;
		}
		this._previousTextFormat = textFormat;
		this._previousSimpleTextFormat = simpleTextFormat;
	}
	,refreshText: function(forceMeasurement) {
		var hasText = this.get_showText() && this._text != null && this._text.length > 0;
		var hasHTMLText = this.get_showText() && this._htmlText != null && this._htmlText.length > 0;
		this.textField.set_visible(hasText || hasHTMLText);
		if(this._text == this._previousText && this._htmlText == this._previousHTMLText && !this._updatedTextStyles && !forceMeasurement) {
			return;
		}
		this.textField.set_autoSize(1);
		if(hasHTMLText) {
			this.textField.set_htmlText(this._htmlText);
		} else if(hasText) {
			this.textField.set_text(this._text);
		} else {
			this.textField.set_text("​");
		}
		if(this.get_wordWrap()) {
			this.textField.set_wordWrap(false);
		}
		this._textMeasuredWidth = this.textField.get_textWidth() + 4;
		this._wrappedOnMeasure = false;
		if(this.get_wordWrap()) {
			var textFieldExplicitWidth = this.calculateExplicitWidthForTextMeasurement();
			if(textFieldExplicitWidth != null && this._textMeasuredWidth > textFieldExplicitWidth) {
				this.textField.set_wordWrap(true);
				this.textField.set_width(textFieldExplicitWidth);
				this._textMeasuredWidth = this.textField.get_width();
				this._wrappedOnMeasure = true;
			}
		}
		this._textMeasuredHeight = this.textField.get_height();
		this.textField.set_autoSize(2);
		if(this.textField.get_wordWrap() != this.get_wordWrap()) {
			this.textField.set_wordWrap(this.get_wordWrap());
		}
		if(!hasText && !hasHTMLText) {
			this.textField.set_text("");
		}
		this._previousText = this._text;
		this._previousHTMLText = this._htmlText;
	}
	,getCurrentTextFormat: function() {
		if(this.get_styleSheet() != null) {
			return null;
		}
		var result = this._stateToTextFormat.get(this._currentState);
		if(result != null) {
			return result;
		}
		if(!this._enabled && this.get_disabledTextFormat() != null) {
			return this.get_disabledTextFormat();
		}
		return this.get_textFormat();
	}
	,layoutContent: function() {
		feathers_controls_BasicButton.prototype.layoutContent.call(this);
		this.layoutChildren();
	}
	,layoutChildren: function() {
		this.refreshTextFieldDimensions(false);
		var hasText = this.get_showText() && this._text != null;
		var hasHTMLText = this.get_showText() && this._htmlText != null && this._htmlText.length > 0;
		var iconIsInLayout = this._currentIcon != null && this.get_iconPosition() != feathers_layout_RelativePosition.MANUAL;
		if((hasText || hasHTMLText) && iconIsInLayout) {
			this.positionSingleChild(this.textField);
			this.positionTextAndIcon();
		} else if(hasText || hasHTMLText) {
			this.positionSingleChild(this.textField);
		} else if(iconIsInLayout) {
			this.positionSingleChild(this._currentIcon);
		}
		if(this._currentIcon != null) {
			if(this.get_iconPosition() == feathers_layout_RelativePosition.MANUAL) {
				this._currentIcon.set_x(this.get_paddingLeft());
				this._currentIcon.set_y(this.get_paddingTop());
			}
			var fh = this._currentIcon;
			fh.set_x(fh.get_x() + this.get_iconOffsetX());
			var fh = this._currentIcon;
			fh.set_y(fh.get_y() + this.get_iconOffsetY());
		}
		if(hasText || hasHTMLText) {
			var fh = this.textField;
			fh.set_x(fh.get_x() + this.get_textOffsetX());
			var fh = this.textField;
			fh.set_y(fh.get_y() + this.get_textOffsetY());
		}
	}
	,refreshTextFieldDimensions: function(forMeasurement) {
		var oldIgnoreIconResizes = this._ignoreIconResizes;
		this._ignoreIconResizes = true;
		if(js_Boot.__implements(this._currentIcon,feathers_core_IValidating)) {
			this._currentIcon.validateNow();
		}
		this._ignoreIconResizes = oldIgnoreIconResizes;
		var hasText = this.get_showText() && this._text != null;
		var hasHTMLText = this.get_showText() && this._htmlText != null && this._htmlText.length > 0;
		if(!hasText && !hasHTMLText) {
			return;
		}
		var calculatedWidth = this.actualWidth;
		var calculatedHeight = this.actualHeight;
		if(forMeasurement) {
			calculatedWidth = 0.0;
			var explicitCalculatedWidth = this.get_explicitWidth();
			if(explicitCalculatedWidth == null) {
				explicitCalculatedWidth = this.get_explicitMaxWidth();
			}
			if(explicitCalculatedWidth != null) {
				calculatedWidth = explicitCalculatedWidth;
			}
			calculatedHeight = 0.0;
			var explicitCalculatedHeight = this.get_explicitHeight();
			if(explicitCalculatedHeight == null) {
				explicitCalculatedHeight = this.get_explicitMaxHeight();
			}
			if(explicitCalculatedHeight != null) {
				calculatedHeight = explicitCalculatedHeight;
			}
		}
		calculatedWidth -= this.get_paddingLeft() + this.get_paddingRight();
		calculatedHeight -= this.get_paddingTop() + this.get_paddingBottom();
		if(this._currentIcon != null) {
			var adjustedGap = this.get_gap();
			if(adjustedGap == 1.0 / 0.0) {
				adjustedGap = this.get_minGap();
			}
			if(this.get_iconPosition() == feathers_layout_RelativePosition.LEFT || this.get_iconPosition() == feathers_layout_RelativePosition.RIGHT) {
				calculatedWidth -= this._currentIcon.get_width() + adjustedGap;
			}
			if(this.get_iconPosition() == feathers_layout_RelativePosition.TOP || this.get_iconPosition() == feathers_layout_RelativePosition.BOTTOM) {
				calculatedHeight -= this._currentIcon.get_height() + adjustedGap;
			}
		}
		if(calculatedWidth > this._textMeasuredWidth) {
			calculatedWidth = this._textMeasuredWidth;
		}
		if(calculatedHeight > this._textMeasuredHeight) {
			calculatedHeight = this._textMeasuredHeight;
		}
		if(calculatedWidth < 0.0) {
			calculatedWidth = 0.0;
		}
		if(calculatedHeight < 0.0) {
			calculatedHeight = 0.0;
		}
		this.textField.set_width(calculatedWidth);
		var wordWrap = this.get_wordWrap();
		if(wordWrap && !this._wrappedOnMeasure && calculatedWidth >= this._textMeasuredWidth) {
			wordWrap = false;
		}
		if(this.textField.get_wordWrap() != wordWrap) {
			this.textField.set_wordWrap(wordWrap);
		}
		this.textField.set_height(calculatedHeight);
	}
	,positionSingleChild: function(displayObject) {
		if(this.get_horizontalAlign() == feathers_layout_HorizontalAlign.LEFT) {
			displayObject.set_x(this.get_paddingLeft());
		} else if(this.get_horizontalAlign() == feathers_layout_HorizontalAlign.RIGHT) {
			displayObject.set_x(this.actualWidth - this.get_paddingRight() - displayObject.get_width());
		} else {
			displayObject.set_x(this.get_paddingLeft() + (this.actualWidth - this.get_paddingLeft() - this.get_paddingRight() - displayObject.get_width()) / 2.0);
		}
		if(this.get_verticalAlign() == feathers_layout_VerticalAlign.TOP) {
			displayObject.set_y(this.get_paddingTop());
		} else if(this.get_verticalAlign() == feathers_layout_VerticalAlign.BOTTOM) {
			displayObject.set_y(this.actualHeight - this.get_paddingBottom() - displayObject.get_height());
		} else {
			displayObject.set_y(this.get_paddingTop() + (this.actualHeight - this.get_paddingTop() - this.get_paddingBottom() - displayObject.get_height()) / 2.0);
		}
	}
	,positionTextAndIcon: function() {
		if(this.get_iconPosition() == feathers_layout_RelativePosition.TOP) {
			if(this.get_gap() == 1.0 / 0.0) {
				this._currentIcon.set_y(this.get_paddingTop());
				this.textField.set_y(this.actualHeight - this.get_paddingBottom() - this.textField.get_height());
			} else {
				if(this.get_verticalAlign() == feathers_layout_VerticalAlign.TOP) {
					var fh = this.textField;
					fh.set_y(fh.get_y() + (this._currentIcon.get_height() + this.get_gap()));
				} else if(this.get_verticalAlign() == feathers_layout_VerticalAlign.MIDDLE) {
					var fh = this.textField;
					fh.set_y(fh.get_y() + (this._currentIcon.get_height() + this.get_gap()) / 2.0);
				}
				this._currentIcon.set_y(this.textField.get_y() - this._currentIcon.get_height() - this.get_gap());
			}
		} else if(this.get_iconPosition() == feathers_layout_RelativePosition.RIGHT) {
			if(this.get_gap() == 1.0 / 0.0) {
				this.textField.set_x(this.get_paddingLeft());
				this._currentIcon.set_x(this.actualWidth - this.get_paddingRight() - this._currentIcon.get_width());
			} else {
				if(this.get_horizontalAlign() == feathers_layout_HorizontalAlign.RIGHT) {
					var fh = this.textField;
					fh.set_x(fh.get_x() - (this._currentIcon.get_width() + this.get_gap()));
				} else if(this.get_horizontalAlign() == feathers_layout_HorizontalAlign.CENTER) {
					var fh = this.textField;
					fh.set_x(fh.get_x() - (this._currentIcon.get_width() + this.get_gap()) / 2.0);
				}
				this._currentIcon.set_x(this.textField.get_x() + this.textField.get_width() + this.get_gap());
			}
		} else if(this.get_iconPosition() == feathers_layout_RelativePosition.BOTTOM) {
			if(this.get_gap() == 1.0 / 0.0) {
				this.textField.set_y(this.get_paddingTop());
				this._currentIcon.set_y(this.actualHeight - this.get_paddingBottom() - this._currentIcon.get_height());
			} else {
				if(this.get_verticalAlign() == feathers_layout_VerticalAlign.BOTTOM) {
					var fh = this.textField;
					fh.set_y(fh.get_y() - (this._currentIcon.get_height() + this.get_gap()));
				} else if(this.get_verticalAlign() == feathers_layout_VerticalAlign.MIDDLE) {
					var fh = this.textField;
					fh.set_y(fh.get_y() - (this._currentIcon.get_height() + this.get_gap()) / 2.0);
				}
				this._currentIcon.set_y(this.textField.get_y() + this.textField.get_height() + this.get_gap());
			}
		} else if(this.get_iconPosition() == feathers_layout_RelativePosition.LEFT) {
			if(this.get_gap() == 1.0 / 0.0) {
				this._currentIcon.set_x(this.get_paddingLeft());
				this.textField.set_x(this.actualWidth - this.get_paddingRight() - this.textField.get_width());
			} else {
				if(this.get_horizontalAlign() == feathers_layout_HorizontalAlign.LEFT) {
					var fh = this.textField;
					fh.set_x(fh.get_x() + (this.get_gap() + this._currentIcon.get_width()));
				} else if(this.get_horizontalAlign() == feathers_layout_HorizontalAlign.CENTER) {
					var fh = this.textField;
					fh.set_x(fh.get_x() + (this.get_gap() + this._currentIcon.get_width()) / 2.0);
				}
				this._currentIcon.set_x(this.textField.get_x() - this.get_gap() - this._currentIcon.get_width());
			}
		}
		if(this.get_iconPosition() == feathers_layout_RelativePosition.LEFT || this.get_iconPosition() == feathers_layout_RelativePosition.RIGHT) {
			if(this.get_verticalAlign() == feathers_layout_VerticalAlign.TOP) {
				this._currentIcon.set_y(this.get_paddingTop());
			} else if(this.get_verticalAlign() == feathers_layout_VerticalAlign.BOTTOM) {
				this._currentIcon.set_y(this.actualHeight - this.get_paddingBottom() - this._currentIcon.get_height());
			} else {
				this._currentIcon.set_y(this.get_paddingTop() + (this.actualHeight - this.get_paddingTop() - this.get_paddingBottom() - this._currentIcon.get_height()) / 2.0);
			}
		} else if(this.get_horizontalAlign() == feathers_layout_HorizontalAlign.LEFT) {
			this._currentIcon.set_x(this.get_paddingLeft());
		} else if(this.get_horizontalAlign() == feathers_layout_HorizontalAlign.RIGHT) {
			this._currentIcon.set_x(this.actualWidth - this.get_paddingRight() - this._currentIcon.get_width());
		} else {
			this._currentIcon.set_x(this.get_paddingLeft() + (this.actualWidth - this.get_paddingLeft() - this.get_paddingRight() - this._currentIcon.get_width()) / 2.0);
		}
	}
	,refreshIcon: function() {
		var oldIcon = this._currentIcon;
		this._currentIcon = this.getCurrentIcon();
		if(this._currentIcon == oldIcon) {
			return;
		}
		this.removeCurrentIcon(oldIcon);
		this.addCurrentIcon(this._currentIcon);
	}
	,addCurrentIcon: function(icon) {
		if(icon == null) {
			this._iconMeasurements = null;
			return;
		}
		if(js_Boot.__implements(icon,feathers_core_IUIControl)) {
			icon.initializeNow();
		}
		if(this._iconMeasurements == null) {
			this._iconMeasurements = new feathers_layout_Measurements(icon);
		} else {
			this._iconMeasurements.save(icon);
		}
		if(js_Boot.__implements(icon,feathers_skins_IProgrammaticSkin)) {
			icon.set_uiContext(this);
		}
		if(js_Boot.__implements(icon,feathers_core_IStateObserver)) {
			icon.set_stateContext(this);
		}
		icon.addEventListener("resize",$bind(this,this.button_icon_resizeHandler),false,0,true);
		var index = this.getChildIndex(this.textField);
		this.addChildAt(icon,index);
	}
	,getCurrentIcon: function() {
		var result = this._stateToIcon.get(this._currentState);
		if(result != null) {
			return result;
		}
		return this.get_icon();
	}
	,removeCurrentIcon: function(icon) {
		if(icon == null) {
			return;
		}
		icon.removeEventListener("resize",$bind(this,this.button_icon_resizeHandler));
		if(js_Boot.__implements(icon,feathers_skins_IProgrammaticSkin)) {
			icon.set_uiContext(null);
		}
		if(js_Boot.__implements(icon,feathers_core_IStateObserver)) {
			icon.set_stateContext(null);
		}
		this._iconMeasurements.restore(icon);
		if(icon.parent == this) {
			this.removeChild(icon);
		}
	}
	,button_keyDownHandler: function(event) {
		if(!this._enabled || this.get_buttonMode() && this.focusRect == true) {
			return;
		}
		if(this._focusManager != null && this._focusManager.get_focus() != this) {
			return;
		}
		if(event.keyCode != 32 && event.keyCode != 13) {
			return;
		}
		event.preventDefault();
		this.dispatchEvent(new openfl_events_MouseEvent("click"));
	}
	,button_focusInHandler: function(event) {
		this._keyToState.set_enabled(this._enabled);
	}
	,button_focusOutHandler: function(event) {
		this._keyToState.set_enabled(false);
	}
	,button_textFormat_changeHandler: function(event) {
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
	}
	,button_icon_resizeHandler: function(event) {
		if(this._ignoreIconResizes) {
			return;
		}
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
	}
	,get_styleContext: function() {
		return feathers_controls_Button;
	}
	,__textFormat: null
	,get_textFormat: function() {
		return this.__textFormat;
	}
	,set_textFormat: function(value) {
		if(!this.setStyle("textFormat")) {
			return this.__textFormat;
		}
		if(this.__textFormat == value) {
			return this.__textFormat;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_textFormat);
		this.__textFormat = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__textFormat;
	}
	,clearStyle_textFormat: function() {
		this.set_textFormat(null);
		return this.get_textFormat();
	}
	,__styleSheet: null
	,get_styleSheet: function() {
		return this.__styleSheet;
	}
	,set_styleSheet: function(value) {
		if(!this.setStyle("styleSheet")) {
			return this.__styleSheet;
		}
		if(this.__styleSheet == value) {
			return this.__styleSheet;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_styleSheet);
		this.__styleSheet = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__styleSheet;
	}
	,clearStyle_styleSheet: function() {
		this.set_styleSheet(null);
		return this.get_styleSheet();
	}
	,__disabledTextFormat: null
	,get_disabledTextFormat: function() {
		return this.__disabledTextFormat;
	}
	,set_disabledTextFormat: function(value) {
		if(!this.setStyle("disabledTextFormat")) {
			return this.__disabledTextFormat;
		}
		if(this.__disabledTextFormat == value) {
			return this.__disabledTextFormat;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_disabledTextFormat);
		this.__disabledTextFormat = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__disabledTextFormat;
	}
	,clearStyle_disabledTextFormat: function() {
		this.set_disabledTextFormat(null);
		return this.get_disabledTextFormat();
	}
	,__embedFonts: null
	,get_embedFonts: function() {
		return this.__embedFonts;
	}
	,set_embedFonts: function(value) {
		if(!this.setStyle("embedFonts")) {
			return this.__embedFonts;
		}
		if(this.__embedFonts == value) {
			return this.__embedFonts;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_embedFonts);
		this.__embedFonts = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__embedFonts;
	}
	,clearStyle_embedFonts: function() {
		this.set_embedFonts(false);
		return this.get_embedFonts();
	}
	,__wordWrap: null
	,get_wordWrap: function() {
		return this.__wordWrap;
	}
	,set_wordWrap: function(value) {
		if(!this.setStyle("wordWrap")) {
			return this.__wordWrap;
		}
		if(this.__wordWrap == value) {
			return this.__wordWrap;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_wordWrap);
		this.__wordWrap = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__wordWrap;
	}
	,clearStyle_wordWrap: function() {
		this.set_wordWrap(false);
		return this.get_wordWrap();
	}
	,__icon: null
	,get_icon: function() {
		return this.__icon;
	}
	,set_icon: function(value) {
		if(!this.setStyle("icon")) {
			return this.__icon;
		}
		if(this.__icon == value) {
			return this.__icon;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_icon);
		this.__icon = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__icon;
	}
	,clearStyle_icon: function() {
		this.set_icon(null);
		return this.get_icon();
	}
	,__paddingTop: null
	,get_paddingTop: function() {
		return this.__paddingTop;
	}
	,set_paddingTop: function(value) {
		if(!this.setStyle("paddingTop")) {
			return this.__paddingTop;
		}
		if(this.__paddingTop == value) {
			return this.__paddingTop;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_paddingTop);
		this.__paddingTop = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__paddingTop;
	}
	,clearStyle_paddingTop: function() {
		this.set_paddingTop(0.0);
		return this.get_paddingTop();
	}
	,__paddingRight: null
	,get_paddingRight: function() {
		return this.__paddingRight;
	}
	,set_paddingRight: function(value) {
		if(!this.setStyle("paddingRight")) {
			return this.__paddingRight;
		}
		if(this.__paddingRight == value) {
			return this.__paddingRight;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_paddingRight);
		this.__paddingRight = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__paddingRight;
	}
	,clearStyle_paddingRight: function() {
		this.set_paddingRight(0.0);
		return this.get_paddingRight();
	}
	,__paddingBottom: null
	,get_paddingBottom: function() {
		return this.__paddingBottom;
	}
	,set_paddingBottom: function(value) {
		if(!this.setStyle("paddingBottom")) {
			return this.__paddingBottom;
		}
		if(this.__paddingBottom == value) {
			return this.__paddingBottom;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_paddingBottom);
		this.__paddingBottom = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__paddingBottom;
	}
	,clearStyle_paddingBottom: function() {
		this.set_paddingBottom(0.0);
		return this.get_paddingBottom();
	}
	,__paddingLeft: null
	,get_paddingLeft: function() {
		return this.__paddingLeft;
	}
	,set_paddingLeft: function(value) {
		if(!this.setStyle("paddingLeft")) {
			return this.__paddingLeft;
		}
		if(this.__paddingLeft == value) {
			return this.__paddingLeft;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_paddingLeft);
		this.__paddingLeft = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__paddingLeft;
	}
	,clearStyle_paddingLeft: function() {
		this.set_paddingLeft(0.0);
		return this.get_paddingLeft();
	}
	,__horizontalAlign: null
	,get_horizontalAlign: function() {
		return this.__horizontalAlign;
	}
	,set_horizontalAlign: function(value) {
		if(!this.setStyle("horizontalAlign")) {
			return this.__horizontalAlign;
		}
		if(this.__horizontalAlign == value) {
			return this.__horizontalAlign;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_horizontalAlign);
		this.__horizontalAlign = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__horizontalAlign;
	}
	,clearStyle_horizontalAlign: function() {
		this.set_horizontalAlign(feathers_layout_HorizontalAlign.CENTER);
		return this.get_horizontalAlign();
	}
	,__verticalAlign: null
	,get_verticalAlign: function() {
		return this.__verticalAlign;
	}
	,set_verticalAlign: function(value) {
		if(!this.setStyle("verticalAlign")) {
			return this.__verticalAlign;
		}
		if(this.__verticalAlign == value) {
			return this.__verticalAlign;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_verticalAlign);
		this.__verticalAlign = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__verticalAlign;
	}
	,clearStyle_verticalAlign: function() {
		this.set_verticalAlign(feathers_layout_VerticalAlign.MIDDLE);
		return this.get_verticalAlign();
	}
	,__iconPosition: null
	,get_iconPosition: function() {
		return this.__iconPosition;
	}
	,set_iconPosition: function(value) {
		if(!this.setStyle("iconPosition")) {
			return this.__iconPosition;
		}
		if(this.__iconPosition == value) {
			return this.__iconPosition;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_iconPosition);
		this.__iconPosition = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__iconPosition;
	}
	,clearStyle_iconPosition: function() {
		this.set_iconPosition(feathers_layout_RelativePosition.LEFT);
		return this.get_iconPosition();
	}
	,__gap: null
	,get_gap: function() {
		return this.__gap;
	}
	,set_gap: function(value) {
		if(!this.setStyle("gap")) {
			return this.__gap;
		}
		if(this.__gap == value) {
			return this.__gap;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_gap);
		this.__gap = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__gap;
	}
	,clearStyle_gap: function() {
		this.set_gap(0.0);
		return this.get_gap();
	}
	,__minGap: null
	,get_minGap: function() {
		return this.__minGap;
	}
	,set_minGap: function(value) {
		if(!this.setStyle("minGap")) {
			return this.__minGap;
		}
		if(this.__minGap == value) {
			return this.__minGap;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_minGap);
		this.__minGap = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__minGap;
	}
	,clearStyle_minGap: function() {
		this.set_minGap(0.0);
		return this.get_minGap();
	}
	,__iconOffsetX: null
	,get_iconOffsetX: function() {
		return this.__iconOffsetX;
	}
	,set_iconOffsetX: function(value) {
		if(!this.setStyle("iconOffsetX")) {
			return this.__iconOffsetX;
		}
		if(this.__iconOffsetX == value) {
			return this.__iconOffsetX;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_iconOffsetX);
		this.__iconOffsetX = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__iconOffsetX;
	}
	,clearStyle_iconOffsetX: function() {
		this.set_iconOffsetX(0.0);
		return this.get_iconOffsetX();
	}
	,__iconOffsetY: null
	,get_iconOffsetY: function() {
		return this.__iconOffsetY;
	}
	,set_iconOffsetY: function(value) {
		if(!this.setStyle("iconOffsetY")) {
			return this.__iconOffsetY;
		}
		if(this.__iconOffsetY == value) {
			return this.__iconOffsetY;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_iconOffsetY);
		this.__iconOffsetY = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__iconOffsetY;
	}
	,clearStyle_iconOffsetY: function() {
		this.set_iconOffsetY(0.0);
		return this.get_iconOffsetY();
	}
	,__textOffsetX: null
	,get_textOffsetX: function() {
		return this.__textOffsetX;
	}
	,set_textOffsetX: function(value) {
		if(!this.setStyle("textOffsetX")) {
			return this.__textOffsetX;
		}
		if(this.__textOffsetX == value) {
			return this.__textOffsetX;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_textOffsetX);
		this.__textOffsetX = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__textOffsetX;
	}
	,clearStyle_textOffsetX: function() {
		this.set_textOffsetX(0.0);
		return this.get_textOffsetX();
	}
	,__textOffsetY: null
	,get_textOffsetY: function() {
		return this.__textOffsetY;
	}
	,set_textOffsetY: function(value) {
		if(!this.setStyle("textOffsetY")) {
			return this.__textOffsetY;
		}
		if(this.__textOffsetY == value) {
			return this.__textOffsetY;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_textOffsetY);
		this.__textOffsetY = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__textOffsetY;
	}
	,clearStyle_textOffsetY: function() {
		this.set_textOffsetY(0.0);
		return this.get_textOffsetY();
	}
	,__showText: null
	,get_showText: function() {
		return this.__showText;
	}
	,set_showText: function(value) {
		if(!this.setStyle("showText")) {
			return this.__showText;
		}
		if(this.__showText == value) {
			return this.__showText;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_showText);
		this.__showText = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__showText;
	}
	,clearStyle_showText: function() {
		this.set_showText(true);
		return this.get_showText();
	}
	,__class__: feathers_controls_Button
	,__properties__: $extend(feathers_controls_BasicButton.prototype.__properties__,{set_showText:"set_showText",get_showText:"get_showText",set_textOffsetY:"set_textOffsetY",get_textOffsetY:"get_textOffsetY",set_textOffsetX:"set_textOffsetX",get_textOffsetX:"get_textOffsetX",set_iconOffsetY:"set_iconOffsetY",get_iconOffsetY:"get_iconOffsetY",set_iconOffsetX:"set_iconOffsetX",get_iconOffsetX:"get_iconOffsetX",set_minGap:"set_minGap",get_minGap:"get_minGap",set_gap:"set_gap",get_gap:"get_gap",set_iconPosition:"set_iconPosition",get_iconPosition:"get_iconPosition",set_verticalAlign:"set_verticalAlign",get_verticalAlign:"get_verticalAlign",set_horizontalAlign:"set_horizontalAlign",get_horizontalAlign:"get_horizontalAlign",set_paddingLeft:"set_paddingLeft",get_paddingLeft:"get_paddingLeft",set_paddingBottom:"set_paddingBottom",get_paddingBottom:"get_paddingBottom",set_paddingRight:"set_paddingRight",get_paddingRight:"get_paddingRight",set_paddingTop:"set_paddingTop",get_paddingTop:"get_paddingTop",set_icon:"set_icon",get_icon:"get_icon",set_wordWrap:"set_wordWrap",get_wordWrap:"get_wordWrap",set_embedFonts:"set_embedFonts",get_embedFonts:"get_embedFonts",set_disabledTextFormat:"set_disabledTextFormat",get_disabledTextFormat:"get_disabledTextFormat",set_styleSheet:"set_styleSheet",get_styleSheet:"get_styleSheet",set_textFormat:"set_textFormat",get_textFormat:"get_textFormat",get_baseline:"get_baseline",set_htmlText:"set_htmlText",get_htmlText:"get_htmlText",set_text:"set_text",get_text:"get_text"})
});
var feathers_controls_supportClasses_BaseScrollBar = function(value,minimum,maximum,changeListener) {
	if(maximum == null) {
		maximum = 1.0;
	}
	if(minimum == null) {
		minimum = 0.0;
	}
	if(value == null) {
		value = 0.0;
	}
	this.__hideThumbWhenDisabled = false;
	this.__paddingLeft = 0.0;
	this.__paddingBottom = 0.0;
	this.__paddingRight = 0.0;
	this.__paddingTop = 0.0;
	this.__fixedThumbSize = false;
	this.__secondaryTrackSkin = null;
	this.__trackSkin = null;
	this.__thumbSkin = null;
	this.__customIncrementButtonVariant = null;
	this.__customDecrementButtonVariant = null;
	this._previousFallbackTrackHeight = 0.0;
	this._previousFallbackTrackWidth = 0.0;
	this._thumbStartY = 0.0;
	this._thumbStartX = 0.0;
	this._pointerStartY = 0.0;
	this._pointerStartX = 0.0;
	this._dragging = false;
	this._secondaryTrackSkinMeasurements = null;
	this._currentSecondaryTrackSkin = null;
	this._trackSkinMeasurements = null;
	this._currentTrackSkin = null;
	this._thumbSkinMeasurements = null;
	this._currentThumbSkin = null;
	this._previousCustomIncrementButtonVariant = null;
	this._previousCustomDecrementButtonVariant = null;
	this.showDecrementAndIncrementButtons = false;
	this._enableButtonsAtRangeLimits = true;
	this.liveDragging = true;
	this._page = 0.0;
	this._snapInterval = 0.0;
	this._step = 0.01;
	this._maximum = 1.0;
	this._minimum = 0.0;
	this._value = 0.0;
	this._isDefaultValue = true;
	this.incrementButtonMeasurements = new feathers_layout_Measurements();
	this.decrementButtonMeasurements = new feathers_layout_Measurements();
	feathers_core_FeathersControl.call(this);
	this.set_tabChildren(false);
	this.focusRect = null;
	this.set_minimum(minimum);
	this.set_maximum(maximum);
	this.set_value(value);
	if(changeListener != null) {
		this.addEventListener("change",changeListener);
	}
};
$hxClasses["feathers.controls.supportClasses.BaseScrollBar"] = feathers_controls_supportClasses_BaseScrollBar;
feathers_controls_supportClasses_BaseScrollBar.__name__ = "feathers.controls.supportClasses.BaseScrollBar";
feathers_controls_supportClasses_BaseScrollBar.__interfaces__ = [feathers_controls_IScrollBar];
feathers_controls_supportClasses_BaseScrollBar.__super__ = feathers_core_FeathersControl;
feathers_controls_supportClasses_BaseScrollBar.prototype = $extend(feathers_core_FeathersControl.prototype,{
	decrementButton: null
	,incrementButton: null
	,decrementButtonMeasurements: null
	,incrementButtonMeasurements: null
	,_isDefaultValue: null
	,_value: null
	,get_value: function() {
		return this._value;
	}
	,set_value: function(value) {
		if(this._value == value) {
			return this._value;
		}
		this._isDefaultValue = false;
		this._value = value;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		if(this.liveDragging || !this._dragging) {
			feathers_events_FeathersEvent.dispatch(this,"change");
		}
		return this._value;
	}
	,_minimum: null
	,get_minimum: function() {
		return this._minimum;
	}
	,set_minimum: function(value) {
		if(this._minimum == value) {
			return this._minimum;
		}
		this._minimum = value;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		return this._minimum;
	}
	,_maximum: null
	,get_maximum: function() {
		return this._maximum;
	}
	,set_maximum: function(value) {
		if(this._maximum == value) {
			return this._maximum;
		}
		this._maximum = value;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		return this._maximum;
	}
	,_step: null
	,get_step: function() {
		return this._step;
	}
	,set_step: function(value) {
		if(this._step == value) {
			return this._step;
		}
		this._step = value;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		return this._step;
	}
	,_snapInterval: null
	,get_snapInterval: function() {
		return this._snapInterval;
	}
	,set_snapInterval: function(value) {
		if(this._snapInterval == value) {
			return this._snapInterval;
		}
		this._snapInterval = value;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		return this._snapInterval;
	}
	,_page: null
	,get_page: function() {
		return this._page;
	}
	,set_page: function(value) {
		if(this._page == value) {
			return this._page;
		}
		this._page = value;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		return this._page;
	}
	,liveDragging: null
	,_enableButtonsAtRangeLimits: null
	,get_enableButtonsAtRangeLimits: function() {
		return this._enableButtonsAtRangeLimits;
	}
	,set_enableButtonsAtRangeLimits: function(value) {
		if(this._enableButtonsAtRangeLimits == value) {
			return this._enableButtonsAtRangeLimits;
		}
		this._enableButtonsAtRangeLimits = value;
		this.setInvalid(feathers_core_InvalidationFlag.STATE);
		return this._enableButtonsAtRangeLimits;
	}
	,showDecrementAndIncrementButtons: null
	,_oldDecrementButtonFactory: null
	,_decrementButtonFactory: null
	,get_decrementButtonFactory: function() {
		return this._decrementButtonFactory;
	}
	,set_decrementButtonFactory: function(value) {
		if(this._decrementButtonFactory == value) {
			return this._decrementButtonFactory;
		}
		this._decrementButtonFactory = value;
		this.setInvalid(feathers_controls_supportClasses_BaseScrollBar.INVALIDATION_FLAG_DECREMENT_BUTTON_FACTORY);
		return this._decrementButtonFactory;
	}
	,_oldIncrementButtonFactory: null
	,_incrementButtonFactory: null
	,get_incrementButtonFactory: function() {
		return this._incrementButtonFactory;
	}
	,set_incrementButtonFactory: function(value) {
		if(this._incrementButtonFactory == value) {
			return this._incrementButtonFactory;
		}
		this._incrementButtonFactory = value;
		this.setInvalid(feathers_controls_supportClasses_BaseScrollBar.INVALIDATION_FLAG_INCREMENT_BUTTON_FACTORY);
		return this._incrementButtonFactory;
	}
	,_previousCustomDecrementButtonVariant: null
	,_previousCustomIncrementButtonVariant: null
	,_currentThumbSkin: null
	,_thumbSkinMeasurements: null
	,_currentTrackSkin: null
	,_trackSkinMeasurements: null
	,_currentSecondaryTrackSkin: null
	,_secondaryTrackSkinMeasurements: null
	,_dragging: null
	,_pointerStartX: null
	,_pointerStartY: null
	,_thumbStartX: null
	,_thumbStartY: null
	,_previousFallbackTrackWidth: null
	,_previousFallbackTrackHeight: null
	,setPadding: function(value) {
		this.set_paddingTop(value);
		this.set_paddingRight(value);
		this.set_paddingBottom(value);
		this.set_paddingLeft(value);
	}
	,applyValueRestrictions: function() {
		this.set_value(this.restrictValue(this._value));
	}
	,dispose: function() {
		this.destroyDecrementButton();
		this.destroyIncrementButton();
		feathers_core_FeathersControl.prototype.dispose.call(this);
	}
	,initialize: function() {
		feathers_core_FeathersControl.prototype.initialize.call(this);
		if(this._isDefaultValue) {
			this.set_value(this.restrictValue(this._value));
		}
	}
	,update: function() {
		var sizeInvalid = this.isInvalid(feathers_core_InvalidationFlag.SIZE);
		var stateInvalid = this.isInvalid(feathers_core_InvalidationFlag.STATE);
		var stylesInvalid = this.isInvalid(feathers_core_InvalidationFlag.STYLES);
		if(this._previousCustomDecrementButtonVariant != this.get_customDecrementButtonVariant()) {
			this.setInvalidationFlag(feathers_controls_supportClasses_BaseScrollBar.INVALIDATION_FLAG_DECREMENT_BUTTON_FACTORY);
		}
		if(this._previousCustomIncrementButtonVariant != this.get_customIncrementButtonVariant()) {
			this.setInvalidationFlag(feathers_controls_supportClasses_BaseScrollBar.INVALIDATION_FLAG_INCREMENT_BUTTON_FACTORY);
		}
		var decrementButtonFactoryInvalid = this.isInvalid(feathers_controls_supportClasses_BaseScrollBar.INVALIDATION_FLAG_DECREMENT_BUTTON_FACTORY);
		var incrementButtonFactoryInvalid = this.isInvalid(feathers_controls_supportClasses_BaseScrollBar.INVALIDATION_FLAG_INCREMENT_BUTTON_FACTORY);
		if(stylesInvalid) {
			this.refreshThumb();
			this.refreshTrack();
			this.refreshSecondaryTrack();
		}
		if(decrementButtonFactoryInvalid) {
			this.createDecrementButton();
		}
		if(incrementButtonFactoryInvalid) {
			this.createIncrementButton();
		}
		if(stateInvalid || stylesInvalid) {
			this.refreshEnabled();
		}
		if(this.measure()) {
			sizeInvalid = true;
		}
		this.layoutContent();
		this._previousCustomDecrementButtonVariant = this.get_customDecrementButtonVariant();
		this._previousCustomIncrementButtonVariant = this.get_customIncrementButtonVariant();
	}
	,measure: function() {
		var c = js_Boot.getClass(this);
		throw new openfl_errors_TypeError("Missing override for 'measure' in type " + c.__name__);
	}
	,refreshThumb: function() {
		var oldSkin = this._currentThumbSkin;
		this._currentThumbSkin = this.get_thumbSkin();
		if(this._currentThumbSkin == oldSkin) {
			return;
		}
		if(oldSkin != null) {
			if(js_Boot.__implements(oldSkin,feathers_skins_IProgrammaticSkin)) {
				oldSkin.set_uiContext(null);
			}
			oldSkin.removeEventListener("mouseDown",$bind(this,this.thumbSkin_mouseDownHandler));
			this.removeChild(oldSkin);
		}
		if(this._currentThumbSkin != null) {
			if(js_Boot.__implements(this._currentThumbSkin,feathers_core_IUIControl)) {
				this._currentThumbSkin.initializeNow();
			}
			if(this._thumbSkinMeasurements == null) {
				this._thumbSkinMeasurements = new feathers_layout_Measurements(this._currentThumbSkin);
			} else {
				this._thumbSkinMeasurements.save(this._currentThumbSkin);
			}
			this.addChild(this._currentThumbSkin);
			this._currentThumbSkin.addEventListener("mouseDown",$bind(this,this.thumbSkin_mouseDownHandler));
			if(js_Boot.__implements(this._currentThumbSkin,feathers_skins_IProgrammaticSkin)) {
				this._currentThumbSkin.set_uiContext(this);
			}
		} else {
			this._thumbSkinMeasurements = null;
		}
	}
	,refreshTrack: function() {
		var oldSkin = this._currentTrackSkin;
		this._currentTrackSkin = this.get_trackSkin();
		if(this._currentTrackSkin == oldSkin) {
			return;
		}
		if(oldSkin != null) {
			if(js_Boot.__implements(oldSkin,feathers_skins_IProgrammaticSkin)) {
				oldSkin.set_uiContext(null);
			}
			this.removeChild(oldSkin);
			oldSkin.removeEventListener("mouseDown",$bind(this,this.trackSkin_mouseDownHandler));
		}
		if(this._currentTrackSkin != null) {
			if(js_Boot.__implements(this._currentTrackSkin,feathers_core_IUIControl)) {
				this._currentTrackSkin.initializeNow();
			}
			if(this._trackSkinMeasurements == null) {
				this._trackSkinMeasurements = new feathers_layout_Measurements(this._currentTrackSkin);
			} else {
				this._trackSkinMeasurements.save(this._currentTrackSkin);
			}
			this.addChildAt(this._currentTrackSkin,0);
			this._currentTrackSkin.addEventListener("mouseDown",$bind(this,this.trackSkin_mouseDownHandler));
			if(js_Boot.__implements(this._currentTrackSkin,feathers_skins_IProgrammaticSkin)) {
				this._currentTrackSkin.set_uiContext(this);
			}
		} else {
			this._trackSkinMeasurements = null;
		}
	}
	,refreshSecondaryTrack: function() {
		var oldSkin = this._currentSecondaryTrackSkin;
		this._currentSecondaryTrackSkin = this.get_secondaryTrackSkin();
		if(this._currentSecondaryTrackSkin == oldSkin) {
			return;
		}
		if(oldSkin != null) {
			if(js_Boot.__implements(oldSkin,feathers_skins_IProgrammaticSkin)) {
				oldSkin.set_uiContext(null);
			}
			this.removeChild(oldSkin);
			oldSkin.removeEventListener("mouseDown",$bind(this,this.trackSkin_mouseDownHandler));
		}
		if(this._currentSecondaryTrackSkin != null) {
			if(js_Boot.__implements(this._currentSecondaryTrackSkin,feathers_core_IUIControl)) {
				this._currentSecondaryTrackSkin.initializeNow();
			}
			if(this._secondaryTrackSkinMeasurements == null) {
				this._secondaryTrackSkinMeasurements = new feathers_layout_Measurements(this._currentSecondaryTrackSkin);
			} else {
				this._secondaryTrackSkinMeasurements.save(this._currentSecondaryTrackSkin);
			}
			var index = this._currentTrackSkin != null ? 1 : 0;
			this.addChildAt(this._currentSecondaryTrackSkin,index);
			this._currentSecondaryTrackSkin.addEventListener("mouseDown",$bind(this,this.trackSkin_mouseDownHandler));
			if(js_Boot.__implements(this._currentSecondaryTrackSkin,feathers_skins_IProgrammaticSkin)) {
				this._currentSecondaryTrackSkin.set_uiContext(this);
			}
		} else {
			this._secondaryTrackSkinMeasurements = null;
		}
	}
	,refreshEnabled: function() {
		if(js_Boot.__implements(this._currentThumbSkin,feathers_core_IUIControl)) {
			this._currentThumbSkin.set_enabled(this._enabled);
		}
		if(this.decrementButton != null) {
			this.decrementButton.set_enabled(this._enabled && (this._enableButtonsAtRangeLimits || this._value != this._minimum));
		}
		if(this.incrementButton != null) {
			this.incrementButton.set_enabled(this._enabled && (this._enableButtonsAtRangeLimits || this._value != this._maximum));
		}
	}
	,layoutContent: function() {
		this.layoutButtons();
		if(this._currentTrackSkin != null && this._currentSecondaryTrackSkin != null) {
			this.get_graphics().clear();
			this.layoutSplitTrack();
		} else if(this._currentTrackSkin != null) {
			this.get_graphics().clear();
			this.layoutSingleTrack();
		} else {
			this.drawFallbackTrack();
		}
		this.layoutThumb();
	}
	,layoutButtons: function() {
		if(!this.showDecrementAndIncrementButtons) {
			return;
		}
		var c = js_Boot.getClass(this);
		throw new openfl_errors_TypeError("Missing override for 'layoutButtons' in type " + c.__name__);
	}
	,layoutSplitTrack: function() {
		var c = js_Boot.getClass(this);
		throw new openfl_errors_TypeError("Missing override for 'layoutSplitTrack' in type " + c.__name__);
	}
	,layoutSingleTrack: function() {
		var c = js_Boot.getClass(this);
		throw new openfl_errors_TypeError("Missing override for 'layoutSingleTrack' in type " + c.__name__);
	}
	,layoutThumb: function() {
		var c = js_Boot.getClass(this);
		throw new openfl_errors_TypeError("Missing override for 'layoutThumb' in type " + c.__name__);
	}
	,createDecrementButton: function() {
		this.destroyDecrementButton();
		if(!this.showDecrementAndIncrementButtons) {
			return;
		}
		var factory = this._decrementButtonFactory != null ? this._decrementButtonFactory : feathers_controls_supportClasses_BaseScrollBar.defaultDecrementButtonFactory;
		this._oldDecrementButtonFactory = factory;
		this.decrementButton = factory.create();
		if(this.decrementButton.get_variant() == null) {
			var defaultVariant = this.get_customDecrementButtonVariant();
			if(defaultVariant == null) {
				if(((this) instanceof feathers_controls_VScrollBar)) {
					defaultVariant = feathers_controls_VScrollBar.CHILD_VARIANT_DECREMENT_BUTTON;
				} else if(((this) instanceof feathers_controls_HScrollBar)) {
					defaultVariant = feathers_controls_HScrollBar.CHILD_VARIANT_DECREMENT_BUTTON;
				}
			}
			this.decrementButton.set_variant(defaultVariant);
		}
		this.decrementButton.addEventListener("mouseDown",$bind(this,this.baseScrollBar_decrementButton_mouseDownHandler));
		this.decrementButton.addEventListener("touchBegin",$bind(this,this.baseScrollBar_decrementButton_touchBeginHandler));
		this.decrementButton.initializeNow();
		this.decrementButtonMeasurements.save(this.decrementButton);
		this.addChild(this.decrementButton);
	}
	,destroyDecrementButton: function() {
		if(this.decrementButton == null) {
			return;
		}
		this.decrementButton.removeEventListener("mouseDown",$bind(this,this.baseScrollBar_decrementButton_mouseDownHandler));
		this.decrementButton.removeEventListener("touchBegin",$bind(this,this.baseScrollBar_decrementButton_touchBeginHandler));
		this.removeChild(this.decrementButton);
		if(this._oldDecrementButtonFactory.destroy != null) {
			this._oldDecrementButtonFactory.destroy(this.decrementButton);
		}
		this._oldDecrementButtonFactory = null;
		this.decrementButton = null;
	}
	,createIncrementButton: function() {
		this.destroyIncrementButton();
		if(!this.showDecrementAndIncrementButtons) {
			return;
		}
		var factory = this._incrementButtonFactory != null ? this._incrementButtonFactory : feathers_controls_supportClasses_BaseScrollBar.defaultIncrementButtonFactory;
		this._oldIncrementButtonFactory = factory;
		this.incrementButton = factory.create();
		if(this.incrementButton.get_variant() == null) {
			var defaultVariant = this.get_customIncrementButtonVariant();
			if(defaultVariant == null) {
				if(((this) instanceof feathers_controls_VScrollBar)) {
					defaultVariant = feathers_controls_VScrollBar.CHILD_VARIANT_INCREMENT_BUTTON;
				} else if(((this) instanceof feathers_controls_HScrollBar)) {
					defaultVariant = feathers_controls_HScrollBar.CHILD_VARIANT_INCREMENT_BUTTON;
				}
			}
			this.incrementButton.set_variant(defaultVariant);
		}
		this.incrementButton.addEventListener("mouseDown",$bind(this,this.baseScrollBar_incrementButton_mouseDownHandler));
		this.incrementButton.addEventListener("touchBegin",$bind(this,this.baseScrollBar_incrementButton_touchBeginHandler));
		this.incrementButton.initializeNow();
		this.incrementButtonMeasurements.save(this.incrementButton);
		this.addChild(this.incrementButton);
	}
	,destroyIncrementButton: function() {
		if(this.incrementButton == null) {
			return;
		}
		this.incrementButton.removeEventListener("mouseDown",$bind(this,this.baseScrollBar_incrementButton_mouseDownHandler));
		this.incrementButton.removeEventListener("touchBegin",$bind(this,this.baseScrollBar_incrementButton_touchBeginHandler));
		this.removeChild(this.incrementButton);
		if(this._oldIncrementButtonFactory.destroy != null) {
			this._oldIncrementButtonFactory.destroy(this.incrementButton);
		}
		this._oldIncrementButtonFactory = null;
		this.incrementButton = null;
	}
	,drawFallbackTrack: function() {
		if(this.actualWidth == this._previousFallbackTrackWidth && this.actualHeight == this._previousFallbackTrackHeight) {
			return;
		}
		this.get_graphics().clear();
		this.get_graphics().beginFill(16711935,0.0);
		this.get_graphics().drawRect(0,0,this.actualWidth,this.actualHeight);
		this.get_graphics().endFill();
		this._previousFallbackTrackWidth = this.actualWidth;
		this._previousFallbackTrackHeight = this.actualHeight;
	}
	,normalizeValue: function(value) {
		var normalized = 0.0;
		if(this._minimum != this._maximum) {
			normalized = (value - this._minimum) / (this._maximum - this._minimum);
			if(normalized < 0.0) {
				normalized = 0.0;
			} else if(normalized > 1.0) {
				normalized = 1.0;
			}
		}
		return normalized;
	}
	,restrictValue: function(value) {
		if(this._snapInterval != 0.0 && value != this._minimum && value != this._maximum) {
			value = feathers_utils_MathUtil.roundToNearest(value,this._snapInterval);
		}
		if(value < this._minimum) {
			value = this._minimum;
		} else if(value > this._maximum) {
			value = this._maximum;
		}
		return value;
	}
	,valueToLocation: function(value) {
		var c = js_Boot.getClass(this);
		throw new openfl_errors_TypeError("Missing override for 'valueToLocation' in type " + c.__name__);
	}
	,locationToValue: function(x,y) {
		var c = js_Boot.getClass(this);
		throw new openfl_errors_TypeError("Missing override for 'locationToValue' in type " + c.__name__);
	}
	,saveThumbStart: function(x,y) {
		var c = js_Boot.getClass(this);
		throw new openfl_errors_TypeError("Missing override for 'saveThumbStart' in type " + c.__name__);
	}
	,getAdjustedPage: function() {
		var range = this._maximum - this._minimum;
		var adjustedPage = this._page;
		if(adjustedPage == 0.0) {
			adjustedPage = this._step;
		} else if(adjustedPage > range) {
			adjustedPage = range;
		}
		return adjustedPage;
	}
	,decrement: function() {
		var newValue = this._value - this._step;
		newValue = this.restrictValue(newValue);
		this.set_value(newValue);
	}
	,increment: function() {
		var newValue = this._value + this._step;
		newValue = this.restrictValue(newValue);
		this.set_value(newValue);
	}
	,thumbSkin_mouseDownHandler: function(event) {
		if(!this._enabled || this.stage == null) {
			return;
		}
		var exclusivePointer = feathers_utils_ExclusivePointer.forStage(this.stage);
		var result = exclusivePointer.claimMouse(this);
		if(!result) {
			return;
		}
		this.stage.addEventListener("mouseMove",$bind(this,this.thumbSkin_stage_mouseMoveHandler),false,0,true);
		this.stage.addEventListener("mouseUp",$bind(this,this.thumbSkin_stage_mouseUpHandler),false,0,true);
		this._thumbStartX = this._currentThumbSkin.get_x();
		this._thumbStartY = this._currentThumbSkin.get_y();
		this._pointerStartX = this.get_mouseX();
		this._pointerStartY = this.get_mouseY();
		this._dragging = true;
		feathers_events_ScrollEvent.dispatch(this,"scrollStart");
	}
	,thumbSkin_stage_mouseMoveHandler: function(event) {
		var newValue = this.locationToValue(this.get_mouseX(),this.get_mouseY());
		newValue = this.restrictValue(newValue);
		this.set_value(newValue);
	}
	,thumbSkin_stage_mouseUpHandler: function(event) {
		var stage = js_Boot.__cast(event.currentTarget , openfl_display_Stage);
		stage.removeEventListener("mouseMove",$bind(this,this.thumbSkin_stage_mouseMoveHandler));
		stage.removeEventListener("mouseUp",$bind(this,this.thumbSkin_stage_mouseUpHandler));
		this._dragging = false;
		feathers_events_ScrollEvent.dispatch(this,"scrollComplete");
		if(!this.liveDragging) {
			feathers_events_FeathersEvent.dispatch(this,"change");
		}
	}
	,trackSkin_mouseDownHandler: function(event) {
		if(!this._enabled || this.stage == null) {
			return;
		}
		var exclusivePointer = feathers_utils_ExclusivePointer.forStage(this.stage);
		var result = exclusivePointer.claimMouse(this);
		if(!result) {
			return;
		}
		this.stage.addEventListener("mouseMove",$bind(this,this.trackSkin_stage_mouseMoveHandler),false,0,true);
		this.stage.addEventListener("mouseUp",$bind(this,this.trackSkin_stage_mouseUpHandler),false,0,true);
		this.saveThumbStart(this.get_mouseX(),this.get_mouseY());
		this._pointerStartX = this.get_mouseX();
		this._pointerStartY = this.get_mouseY();
		this._dragging = true;
		feathers_events_ScrollEvent.dispatch(this,"scrollStart");
		var newValue = this.locationToValue(this.get_mouseX(),this.get_mouseY());
		newValue = this.restrictValue(newValue);
		this.set_value(newValue);
	}
	,trackSkin_stage_mouseMoveHandler: function(event) {
		var newValue = this.locationToValue(this.get_mouseX(),this.get_mouseY());
		newValue = this.restrictValue(newValue);
		this.set_value(newValue);
	}
	,trackSkin_stage_mouseUpHandler: function(event) {
		var stage = js_Boot.__cast(event.currentTarget , openfl_display_Stage);
		stage.removeEventListener("mouseMove",$bind(this,this.trackSkin_stage_mouseMoveHandler));
		stage.removeEventListener("mouseUp",$bind(this,this.trackSkin_stage_mouseUpHandler));
		this._dragging = false;
		feathers_events_ScrollEvent.dispatch(this,"scrollComplete");
		if(!this.liveDragging) {
			feathers_events_FeathersEvent.dispatch(this,"change");
		}
	}
	,baseScrollBar_decrementButton_mouseDownHandler: function(event) {
		if(!this._enabled || !this.decrementButton.get_enabled() || this.stage == null) {
			return;
		}
		var exclusivePointer = feathers_utils_ExclusivePointer.forStage(this.stage);
		var result = exclusivePointer.claimMouse(this);
		if(!result) {
			return;
		}
		this.decrement();
	}
	,baseScrollBar_decrementButton_touchBeginHandler: function(event) {
		if(event.isPrimaryTouchPoint) {
			return;
		}
		if(!this._enabled || !this.decrementButton.get_enabled() || this.stage == null) {
			return;
		}
		var exclusivePointer = feathers_utils_ExclusivePointer.forStage(this.stage);
		var result = exclusivePointer.claimMouse(this);
		if(!result) {
			return;
		}
		this.decrement();
	}
	,baseScrollBar_incrementButton_mouseDownHandler: function(event) {
		if(!this._enabled || !this.incrementButton.get_enabled() || this.stage == null) {
			return;
		}
		var exclusivePointer = feathers_utils_ExclusivePointer.forStage(this.stage);
		var result = exclusivePointer.claimMouse(this);
		if(!result) {
			return;
		}
		this.increment();
	}
	,baseScrollBar_incrementButton_touchBeginHandler: function(event) {
		if(event.isPrimaryTouchPoint) {
			return;
		}
		if(!this._enabled || !this.incrementButton.get_enabled() || this.stage == null) {
			return;
		}
		var exclusivePointer = feathers_utils_ExclusivePointer.forStage(this.stage);
		var result = exclusivePointer.claimMouse(this);
		if(!result) {
			return;
		}
		this.increment();
	}
	,__customDecrementButtonVariant: null
	,get_customDecrementButtonVariant: function() {
		return this.__customDecrementButtonVariant;
	}
	,set_customDecrementButtonVariant: function(value) {
		if(!this.setStyle("customDecrementButtonVariant")) {
			return this.__customDecrementButtonVariant;
		}
		if(this.__customDecrementButtonVariant == value) {
			return this.__customDecrementButtonVariant;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_customDecrementButtonVariant);
		this.__customDecrementButtonVariant = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__customDecrementButtonVariant;
	}
	,clearStyle_customDecrementButtonVariant: function() {
		this.set_customDecrementButtonVariant(null);
		return this.get_customDecrementButtonVariant();
	}
	,__customIncrementButtonVariant: null
	,get_customIncrementButtonVariant: function() {
		return this.__customIncrementButtonVariant;
	}
	,set_customIncrementButtonVariant: function(value) {
		if(!this.setStyle("customIncrementButtonVariant")) {
			return this.__customIncrementButtonVariant;
		}
		if(this.__customIncrementButtonVariant == value) {
			return this.__customIncrementButtonVariant;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_customIncrementButtonVariant);
		this.__customIncrementButtonVariant = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__customIncrementButtonVariant;
	}
	,clearStyle_customIncrementButtonVariant: function() {
		this.set_customIncrementButtonVariant(null);
		return this.get_customIncrementButtonVariant();
	}
	,__thumbSkin: null
	,get_thumbSkin: function() {
		return this.__thumbSkin;
	}
	,set_thumbSkin: function(value) {
		if(!this.setStyle("thumbSkin")) {
			return this.__thumbSkin;
		}
		if(this.__thumbSkin == value) {
			return this.__thumbSkin;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_thumbSkin);
		this.__thumbSkin = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__thumbSkin;
	}
	,clearStyle_thumbSkin: function() {
		this.set_thumbSkin(null);
		return this.get_thumbSkin();
	}
	,__trackSkin: null
	,get_trackSkin: function() {
		return this.__trackSkin;
	}
	,set_trackSkin: function(value) {
		if(!this.setStyle("trackSkin")) {
			return this.__trackSkin;
		}
		if(this.__trackSkin == value) {
			return this.__trackSkin;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_trackSkin);
		this.__trackSkin = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__trackSkin;
	}
	,clearStyle_trackSkin: function() {
		this.set_trackSkin(null);
		return this.get_trackSkin();
	}
	,__secondaryTrackSkin: null
	,get_secondaryTrackSkin: function() {
		return this.__secondaryTrackSkin;
	}
	,set_secondaryTrackSkin: function(value) {
		if(!this.setStyle("secondaryTrackSkin")) {
			return this.__secondaryTrackSkin;
		}
		if(this.__secondaryTrackSkin == value) {
			return this.__secondaryTrackSkin;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_secondaryTrackSkin);
		this.__secondaryTrackSkin = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__secondaryTrackSkin;
	}
	,clearStyle_secondaryTrackSkin: function() {
		this.set_secondaryTrackSkin(null);
		return this.get_secondaryTrackSkin();
	}
	,__fixedThumbSize: null
	,get_fixedThumbSize: function() {
		return this.__fixedThumbSize;
	}
	,set_fixedThumbSize: function(value) {
		if(!this.setStyle("fixedThumbSize")) {
			return this.__fixedThumbSize;
		}
		if(this.__fixedThumbSize == value) {
			return this.__fixedThumbSize;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_fixedThumbSize);
		this.__fixedThumbSize = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__fixedThumbSize;
	}
	,clearStyle_fixedThumbSize: function() {
		this.set_fixedThumbSize(false);
		return this.get_fixedThumbSize();
	}
	,__paddingTop: null
	,get_paddingTop: function() {
		return this.__paddingTop;
	}
	,set_paddingTop: function(value) {
		if(!this.setStyle("paddingTop")) {
			return this.__paddingTop;
		}
		if(this.__paddingTop == value) {
			return this.__paddingTop;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_paddingTop);
		this.__paddingTop = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__paddingTop;
	}
	,clearStyle_paddingTop: function() {
		this.set_paddingTop(0.0);
		return this.get_paddingTop();
	}
	,__paddingRight: null
	,get_paddingRight: function() {
		return this.__paddingRight;
	}
	,set_paddingRight: function(value) {
		if(!this.setStyle("paddingRight")) {
			return this.__paddingRight;
		}
		if(this.__paddingRight == value) {
			return this.__paddingRight;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_paddingRight);
		this.__paddingRight = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__paddingRight;
	}
	,clearStyle_paddingRight: function() {
		this.set_paddingRight(0.0);
		return this.get_paddingRight();
	}
	,__paddingBottom: null
	,get_paddingBottom: function() {
		return this.__paddingBottom;
	}
	,set_paddingBottom: function(value) {
		if(!this.setStyle("paddingBottom")) {
			return this.__paddingBottom;
		}
		if(this.__paddingBottom == value) {
			return this.__paddingBottom;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_paddingBottom);
		this.__paddingBottom = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__paddingBottom;
	}
	,clearStyle_paddingBottom: function() {
		this.set_paddingBottom(0.0);
		return this.get_paddingBottom();
	}
	,__paddingLeft: null
	,get_paddingLeft: function() {
		return this.__paddingLeft;
	}
	,set_paddingLeft: function(value) {
		if(!this.setStyle("paddingLeft")) {
			return this.__paddingLeft;
		}
		if(this.__paddingLeft == value) {
			return this.__paddingLeft;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_paddingLeft);
		this.__paddingLeft = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__paddingLeft;
	}
	,clearStyle_paddingLeft: function() {
		this.set_paddingLeft(0.0);
		return this.get_paddingLeft();
	}
	,__hideThumbWhenDisabled: null
	,get_hideThumbWhenDisabled: function() {
		return this.__hideThumbWhenDisabled;
	}
	,set_hideThumbWhenDisabled: function(value) {
		if(!this.setStyle("hideThumbWhenDisabled")) {
			return this.__hideThumbWhenDisabled;
		}
		if(this.__hideThumbWhenDisabled == value) {
			return this.__hideThumbWhenDisabled;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_hideThumbWhenDisabled);
		this.__hideThumbWhenDisabled = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__hideThumbWhenDisabled;
	}
	,clearStyle_hideThumbWhenDisabled: function() {
		this.set_hideThumbWhenDisabled(false);
		return this.get_hideThumbWhenDisabled();
	}
	,__class__: feathers_controls_supportClasses_BaseScrollBar
	,__properties__: $extend(feathers_core_FeathersControl.prototype.__properties__,{set_hideThumbWhenDisabled:"set_hideThumbWhenDisabled",get_hideThumbWhenDisabled:"get_hideThumbWhenDisabled",set_paddingLeft:"set_paddingLeft",get_paddingLeft:"get_paddingLeft",set_paddingBottom:"set_paddingBottom",get_paddingBottom:"get_paddingBottom",set_paddingRight:"set_paddingRight",get_paddingRight:"get_paddingRight",set_paddingTop:"set_paddingTop",get_paddingTop:"get_paddingTop",set_fixedThumbSize:"set_fixedThumbSize",get_fixedThumbSize:"get_fixedThumbSize",set_secondaryTrackSkin:"set_secondaryTrackSkin",get_secondaryTrackSkin:"get_secondaryTrackSkin",set_trackSkin:"set_trackSkin",get_trackSkin:"get_trackSkin",set_thumbSkin:"set_thumbSkin",get_thumbSkin:"get_thumbSkin",set_customIncrementButtonVariant:"set_customIncrementButtonVariant",get_customIncrementButtonVariant:"get_customIncrementButtonVariant",set_customDecrementButtonVariant:"set_customDecrementButtonVariant",get_customDecrementButtonVariant:"get_customDecrementButtonVariant",set_incrementButtonFactory:"set_incrementButtonFactory",get_incrementButtonFactory:"get_incrementButtonFactory",set_decrementButtonFactory:"set_decrementButtonFactory",get_decrementButtonFactory:"get_decrementButtonFactory",set_enableButtonsAtRangeLimits:"set_enableButtonsAtRangeLimits",get_enableButtonsAtRangeLimits:"get_enableButtonsAtRangeLimits",set_page:"set_page",get_page:"get_page",set_snapInterval:"set_snapInterval",get_snapInterval:"get_snapInterval",set_step:"set_step",get_step:"get_step",set_maximum:"set_maximum",get_maximum:"get_maximum",set_minimum:"set_minimum",get_minimum:"get_minimum",set_value:"set_value",get_value:"get_value"})
});
var feathers_controls_HScrollBar = function(value,minimum,maximum,changeListener) {
	if(maximum == null) {
		maximum = 1.0;
	}
	if(minimum == null) {
		minimum = 0.0;
	}
	if(value == null) {
		value = 0.0;
	}
	this.initializeHScrollBarTheme();
	feathers_controls_supportClasses_BaseScrollBar.call(this,value,minimum,maximum,changeListener);
};
$hxClasses["feathers.controls.HScrollBar"] = feathers_controls_HScrollBar;
feathers_controls_HScrollBar.__name__ = "feathers.controls.HScrollBar";
feathers_controls_HScrollBar.__super__ = feathers_controls_supportClasses_BaseScrollBar;
feathers_controls_HScrollBar.prototype = $extend(feathers_controls_supportClasses_BaseScrollBar.prototype,{
	initializeHScrollBarTheme: function() {
		feathers_themes_steel_components_SteelHScrollBarStyles.initialize();
	}
	,valueToLocation: function(value) {
		if(js_Boot.__implements(this._currentThumbSkin,feathers_core_IValidating)) {
			this._currentThumbSkin.validateNow();
		}
		if(this.showDecrementAndIncrementButtons) {
			this.decrementButton.validateNow();
			this.incrementButton.validateNow();
		}
		var normalized = this.normalizeValue(value);
		var trackScrollableWidth = this.actualWidth - this.get_paddingLeft() - this.get_paddingRight() - this._currentThumbSkin.get_width();
		if(this.showDecrementAndIncrementButtons) {
			trackScrollableWidth -= this.decrementButton.get_width() + this.incrementButton.get_width();
		}
		var result = this.get_paddingLeft() + trackScrollableWidth * normalized;
		if(this.showDecrementAndIncrementButtons) {
			result += this.decrementButton.get_width();
		}
		return result;
	}
	,locationToValue: function(x,y) {
		var percentage = 0.0;
		var minXPosition = this.get_paddingLeft();
		var trackScrollableWidth = this.actualWidth - this.get_paddingLeft() - this.get_paddingRight() - this._currentThumbSkin.get_width();
		if(this.showDecrementAndIncrementButtons) {
			minXPosition += this.decrementButton.get_width();
			trackScrollableWidth -= this.decrementButton.get_width() + this.incrementButton.get_width();
		}
		var xOffset = x - this._pointerStartX;
		var xPosition = Math.min(Math.max(0.0,this._thumbStartX + xOffset - minXPosition),trackScrollableWidth);
		percentage = xPosition / trackScrollableWidth;
		return this._minimum + percentage * (this._maximum - this._minimum);
	}
	,saveThumbStart: function(x,y) {
		var trackWidthMinusThumbWidth = this.actualWidth;
		var locationMinusHalfThumbWidth = x;
		if(this._currentThumbSkin != null) {
			trackWidthMinusThumbWidth -= this._currentThumbSkin.get_width();
			locationMinusHalfThumbWidth -= this._currentThumbSkin.get_width() / 2.0;
		}
		this._thumbStartX = Math.min(trackWidthMinusThumbWidth,locationMinusHalfThumbWidth);
		this._thumbStartY = y;
	}
	,measure: function() {
		var needsWidth = this.get_explicitWidth() == null;
		var needsHeight = this.get_explicitHeight() == null;
		var needsMinWidth = this.get_explicitMinWidth() == null;
		var needsMinHeight = this.get_explicitMinHeight() == null;
		var needsMaxWidth = this.get_explicitMaxWidth() == null;
		var needsMaxHeight = this.get_explicitMaxHeight() == null;
		if(!needsWidth && !needsHeight && !needsMinWidth && !needsMinHeight && !needsMaxWidth && !needsMaxHeight) {
			return false;
		}
		if(this.decrementButton != null) {
			this.decrementButtonMeasurements.restore(this.decrementButton);
			this.decrementButton.validateNow();
		}
		if(this.incrementButton != null) {
			this.incrementButtonMeasurements.restore(this.incrementButton);
			this.incrementButton.validateNow();
		}
		if(this._currentThumbSkin != null) {
			this._thumbSkinMeasurements.restore(this._currentThumbSkin);
			if(js_Boot.__implements(this._currentThumbSkin,feathers_core_IValidating)) {
				this._currentThumbSkin.validateNow();
			}
		}
		if(this._currentTrackSkin != null) {
			this._trackSkinMeasurements.restore(this._currentTrackSkin);
			if(js_Boot.__implements(this._currentTrackSkin,feathers_core_IValidating)) {
				this._currentTrackSkin.validateNow();
			}
		}
		if(this._currentSecondaryTrackSkin != null) {
			this._secondaryTrackSkinMeasurements.restore(this._currentSecondaryTrackSkin);
			if(js_Boot.__implements(this._currentSecondaryTrackSkin,feathers_core_IValidating)) {
				this._currentSecondaryTrackSkin.validateNow();
			}
		}
		var newWidth = this.get_explicitWidth();
		if(needsWidth) {
			newWidth = 0.0;
			if(this._currentTrackSkin != null) {
				newWidth += this._currentTrackSkin.get_width();
				if(this._currentSecondaryTrackSkin != null) {
					newWidth += this._currentSecondaryTrackSkin.get_width();
				}
			}
			var thumbWidth = this.get_paddingLeft() + this.get_paddingRight();
			if(this._currentThumbSkin != null) {
				thumbWidth += this._currentThumbSkin.get_width();
			}
			if(newWidth < thumbWidth) {
				newWidth = thumbWidth;
			}
			if(this.showDecrementAndIncrementButtons) {
				newWidth += this.decrementButton.get_width() + this.incrementButton.get_width();
			}
		}
		var newHeight = this.get_explicitHeight();
		if(needsHeight) {
			newHeight = this.get_paddingTop() + this.get_paddingBottom();
			if(this._currentThumbSkin != null) {
				newHeight += this._currentThumbSkin.get_height();
			}
			if(this._currentTrackSkin != null) {
				if(newHeight < this._currentTrackSkin.get_height()) {
					newHeight = this._currentTrackSkin.get_height();
				}
				if(this._currentSecondaryTrackSkin != null && newHeight < this._currentSecondaryTrackSkin.get_height()) {
					newHeight = this._currentSecondaryTrackSkin.get_height();
				}
			}
			if(this.showDecrementAndIncrementButtons) {
				var buttonHeight = Math.max(this.decrementButton.get_height(),this.incrementButton.get_height());
				if(newHeight < buttonHeight) {
					newHeight = buttonHeight;
				}
			}
		}
		var newMinWidth = newWidth;
		var newMinHeight = newHeight;
		var newMaxHeight = newHeight;
		return this.saveMeasurements(newWidth,newHeight,newMinWidth,newMinHeight,null,newMaxHeight);
	}
	,layoutButtons: function() {
		if(!this.showDecrementAndIncrementButtons) {
			return;
		}
		if(this.decrementButton != null) {
			this.decrementButton.validateNow();
		}
		this.decrementButton.set_x(0.0);
		this.decrementButton.set_y((this.actualHeight - this.decrementButton.get_height()) / 2.0);
		if(this.incrementButton != null) {
			this.incrementButton.validateNow();
		}
		this.incrementButton.set_x(this.actualWidth - this.incrementButton.get_width());
		this.incrementButton.set_y((this.actualHeight - this.incrementButton.get_height()) / 2.0);
	}
	,layoutSplitTrack: function() {
		var location = this.valueToLocation(this.get_value());
		if(this._currentThumbSkin != null) {
			if(js_Boot.__implements(this._currentThumbSkin,feathers_core_IValidating)) {
				this._currentThumbSkin.validateNow();
			}
			location += Math.round(this._currentThumbSkin.get_width() / 2.0);
		}
		var minTrackX = 0.0;
		var maxTrackX = this.actualWidth;
		if(this.showDecrementAndIncrementButtons) {
			minTrackX = this.decrementButton.get_width();
			maxTrackX -= this.incrementButton.get_width();
		}
		this._currentTrackSkin.set_x(minTrackX);
		this._currentTrackSkin.set_width(location);
		this._currentSecondaryTrackSkin.set_x(location);
		this._currentSecondaryTrackSkin.set_width(maxTrackX - location);
		if(js_Boot.__implements(this._currentTrackSkin,feathers_core_IValidating)) {
			this._currentTrackSkin.validateNow();
		}
		if(js_Boot.__implements(this._currentSecondaryTrackSkin,feathers_core_IValidating)) {
			this._currentSecondaryTrackSkin.validateNow();
		}
		this._currentTrackSkin.set_y((this.actualHeight - this._currentTrackSkin.get_height()) / 2.0);
		this._currentSecondaryTrackSkin.set_y((this.actualHeight - this._currentSecondaryTrackSkin.get_height()) / 2.0);
	}
	,layoutSingleTrack: function() {
		if(this._currentTrackSkin == null) {
			return;
		}
		var minTrackX = 0.0;
		var maxTrackX = this.actualWidth;
		if(this.showDecrementAndIncrementButtons) {
			minTrackX = this.decrementButton.get_width();
			maxTrackX -= this.incrementButton.get_width();
		}
		this._currentTrackSkin.set_x(minTrackX);
		this._currentTrackSkin.set_width(maxTrackX - minTrackX);
		if(js_Boot.__implements(this._currentTrackSkin,feathers_core_IValidating)) {
			this._currentTrackSkin.validateNow();
		}
		this._currentTrackSkin.set_y((this.actualHeight - this._currentTrackSkin.get_height()) / 2.0);
	}
	,layoutThumb: function() {
		if(this._currentThumbSkin == null) {
			return;
		}
		var range = this._maximum - this._minimum;
		this._currentThumbSkin.set_visible((!this.get_hideThumbWhenDisabled() || this._enabled) && range > 0.0);
		if(!this._currentThumbSkin.get_visible()) {
			return;
		}
		if(js_Boot.__implements(this._currentThumbSkin,feathers_core_IValidating)) {
			this._currentThumbSkin.validateNow();
		}
		var valueOffset = 0.0;
		if(this._value < this._minimum) {
			valueOffset = this._minimum - this._value;
		} else if(this._value > this._maximum) {
			valueOffset = this._value - this._maximum;
		}
		var contentWidth = this.actualWidth - this.get_paddingLeft() - this.get_paddingRight();
		var contentHeight = this.actualHeight - this.get_paddingTop() - this.get_paddingBottom();
		if(this.get_fixedThumbSize()) {
			if(this._thumbSkinMeasurements.width != null) {
				this._currentThumbSkin.set_width(this._thumbSkinMeasurements.width);
			}
		} else {
			var adjustedPage = this.getAdjustedPage();
			var thumbWidth = contentWidth * adjustedPage / (range + adjustedPage);
			if(thumbWidth > 0.0) {
				var widthOffset = contentWidth - thumbWidth;
				if(widthOffset > thumbWidth) {
					widthOffset = thumbWidth;
				}
				widthOffset *= valueOffset / (range * thumbWidth / contentWidth);
				thumbWidth -= widthOffset;
			}
			if(this._thumbSkinMeasurements.minWidth != null) {
				if(thumbWidth < this._thumbSkinMeasurements.minWidth) {
					thumbWidth = this._thumbSkinMeasurements.minWidth;
				}
			} else if(js_Boot.__implements(this._currentThumbSkin,feathers_core_IMeasureObject)) {
				var measureSkin = this._currentThumbSkin;
				if(thumbWidth < measureSkin.get_minWidth()) {
					thumbWidth = measureSkin.get_minWidth();
				}
			}
			if(thumbWidth < 0.0) {
				thumbWidth = 0.0;
			}
			this._currentThumbSkin.set_width(thumbWidth);
		}
		this._currentThumbSkin.set_x(this.valueToLocation(this._value));
		this._currentThumbSkin.set_y(this.get_paddingTop() + (contentHeight - this._currentThumbSkin.get_height()) / 2.0);
	}
	,get_styleContext: function() {
		return feathers_controls_HScrollBar;
	}
	,__class__: feathers_controls_HScrollBar
});
var feathers_controls_VScrollBar = function(value,minimum,maximum,changeListener) {
	if(maximum == null) {
		maximum = 1.0;
	}
	if(minimum == null) {
		minimum = 0.0;
	}
	if(value == null) {
		value = 0.0;
	}
	this.initializeVScrollBarTheme();
	feathers_controls_supportClasses_BaseScrollBar.call(this,value,minimum,maximum,changeListener);
};
$hxClasses["feathers.controls.VScrollBar"] = feathers_controls_VScrollBar;
feathers_controls_VScrollBar.__name__ = "feathers.controls.VScrollBar";
feathers_controls_VScrollBar.__super__ = feathers_controls_supportClasses_BaseScrollBar;
feathers_controls_VScrollBar.prototype = $extend(feathers_controls_supportClasses_BaseScrollBar.prototype,{
	initializeVScrollBarTheme: function() {
		feathers_themes_steel_components_SteelVScrollBarStyles.initialize();
	}
	,valueToLocation: function(value) {
		if(js_Boot.__implements(this._currentThumbSkin,feathers_core_IValidating)) {
			this._currentThumbSkin.validateNow();
		}
		if(this.showDecrementAndIncrementButtons) {
			this.decrementButton.validateNow();
			this.incrementButton.validateNow();
		}
		var normalized = this.normalizeValue(value);
		var trackScrollableHeight = this.actualHeight - this.get_paddingTop() - this.get_paddingBottom() - this._currentThumbSkin.get_height();
		if(this.showDecrementAndIncrementButtons) {
			trackScrollableHeight -= this.decrementButton.get_height() + this.incrementButton.get_height();
		}
		var result = this.get_paddingTop() + trackScrollableHeight * normalized;
		if(this.showDecrementAndIncrementButtons) {
			result += this.decrementButton.get_height();
		}
		return result;
	}
	,locationToValue: function(x,y) {
		var percentage = 0.0;
		var minYPosition = this.get_paddingTop();
		var trackScrollableHeight = this.actualHeight - this.get_paddingTop() - this.get_paddingBottom() - this._currentThumbSkin.get_height();
		if(this.showDecrementAndIncrementButtons) {
			minYPosition += this.decrementButton.get_height();
			trackScrollableHeight -= this.decrementButton.get_height() + this.incrementButton.get_height();
		}
		var yOffset = y - this._pointerStartY;
		var yPosition = Math.min(Math.max(0.0,this._thumbStartY + yOffset - minYPosition),trackScrollableHeight);
		percentage = yPosition / trackScrollableHeight;
		return this._minimum + percentage * (this._maximum - this._minimum);
	}
	,saveThumbStart: function(x,y) {
		var trackHeightMinusThumbHeight = this.actualHeight;
		var locationMinusHalfThumbHeight = y;
		if(this._currentThumbSkin != null) {
			trackHeightMinusThumbHeight -= this._currentThumbSkin.get_height();
			locationMinusHalfThumbHeight -= this._currentThumbSkin.get_height() / 2.0;
		}
		this._thumbStartX = x;
		this._thumbStartY = Math.min(trackHeightMinusThumbHeight,locationMinusHalfThumbHeight);
	}
	,measure: function() {
		var needsWidth = this.get_explicitWidth() == null;
		var needsHeight = this.get_explicitHeight() == null;
		var needsMinWidth = this.get_explicitMinWidth() == null;
		var needsMinHeight = this.get_explicitMinHeight() == null;
		var needsMaxWidth = this.get_explicitMaxWidth() == null;
		var needsMaxHeight = this.get_explicitMaxHeight() == null;
		if(!needsWidth && !needsHeight && !needsMinWidth && !needsMinHeight && !needsMaxWidth && !needsMaxHeight) {
			return false;
		}
		if(this.decrementButton != null) {
			this.decrementButtonMeasurements.restore(this.decrementButton);
			this.decrementButton.validateNow();
		}
		if(this.incrementButton != null) {
			this.incrementButtonMeasurements.restore(this.incrementButton);
			this.incrementButton.validateNow();
		}
		if(this._currentThumbSkin != null) {
			this._thumbSkinMeasurements.restore(this._currentThumbSkin);
			if(js_Boot.__implements(this._currentThumbSkin,feathers_core_IValidating)) {
				this._currentThumbSkin.validateNow();
			}
		}
		if(this._currentTrackSkin != null) {
			this._trackSkinMeasurements.restore(this._currentTrackSkin);
			if(js_Boot.__implements(this._currentTrackSkin,feathers_core_IValidating)) {
				this._currentTrackSkin.validateNow();
			}
		}
		if(this._currentSecondaryTrackSkin != null) {
			this._secondaryTrackSkinMeasurements.restore(this._currentSecondaryTrackSkin);
			if(js_Boot.__implements(this._currentSecondaryTrackSkin,feathers_core_IValidating)) {
				this._currentSecondaryTrackSkin.validateNow();
			}
		}
		var newWidth = this.get_explicitWidth();
		if(needsWidth) {
			newWidth = this.get_paddingLeft() + this.get_paddingRight();
			if(this._currentThumbSkin != null) {
				newWidth += this._currentThumbSkin.get_width();
			}
			if(this._currentTrackSkin != null) {
				if(newWidth < this._currentTrackSkin.get_width()) {
					newWidth = this._currentTrackSkin.get_width();
				}
				if(this._currentSecondaryTrackSkin != null && newWidth < this._currentSecondaryTrackSkin.get_width()) {
					newWidth = this._currentSecondaryTrackSkin.get_width();
				}
			}
			if(this.showDecrementAndIncrementButtons) {
				var buttonWidth = Math.max(this.decrementButton.get_width(),this.incrementButton.get_width());
				if(newWidth < buttonWidth) {
					newWidth = buttonWidth;
				}
			}
		}
		var newHeight = this.get_explicitHeight();
		if(needsHeight) {
			newHeight = 0.0;
			if(this._currentTrackSkin != null) {
				newHeight += this._currentTrackSkin.get_height();
				if(this._currentSecondaryTrackSkin != null) {
					newHeight += this._currentSecondaryTrackSkin.get_height();
				}
			}
			var thumbHeight = this.get_paddingTop() + this.get_paddingBottom();
			if(this._currentThumbSkin != null) {
				thumbHeight += this._currentThumbSkin.get_height();
			}
			if(newHeight < thumbHeight) {
				newHeight = thumbHeight;
			}
			if(this.showDecrementAndIncrementButtons) {
				newHeight += this.decrementButton.get_height() + this.incrementButton.get_height();
			}
		}
		var newMinWidth = newWidth;
		var newMinHeight = newHeight;
		var newMaxWidth = newWidth;
		return this.saveMeasurements(newWidth,newHeight,newMinWidth,newMinHeight,newMaxWidth,null);
	}
	,layoutButtons: function() {
		if(!this.showDecrementAndIncrementButtons) {
			return;
		}
		if(this.decrementButton != null) {
			this.decrementButton.validateNow();
		}
		this.decrementButton.set_x((this.actualWidth - this.decrementButton.get_width()) / 2.0);
		this.decrementButton.set_y(0.0);
		if(this.incrementButton != null) {
			this.incrementButton.validateNow();
		}
		this.incrementButton.set_x((this.actualWidth - this.incrementButton.get_width()) / 2.0);
		this.incrementButton.set_y(this.actualHeight - this.incrementButton.get_height());
	}
	,layoutSplitTrack: function() {
		var location = this.valueToLocation(this.get_value());
		if(this._currentThumbSkin != null) {
			if(js_Boot.__implements(this._currentThumbSkin,feathers_core_IValidating)) {
				this._currentThumbSkin.validateNow();
			}
			location += Math.round(this._currentThumbSkin.get_height() / 2.0);
		}
		var minTrackY = 0.0;
		var maxTrackY = this.actualHeight;
		if(this.showDecrementAndIncrementButtons) {
			minTrackY = this.decrementButton.get_height();
			maxTrackY -= this.incrementButton.get_height();
		}
		this._currentSecondaryTrackSkin.set_y(minTrackY);
		this._currentSecondaryTrackSkin.set_height(location);
		this._currentTrackSkin.set_y(location);
		this._currentTrackSkin.set_height(maxTrackY - location);
		if(js_Boot.__implements(this._currentSecondaryTrackSkin,feathers_core_IValidating)) {
			this._currentSecondaryTrackSkin.validateNow();
		}
		if(js_Boot.__implements(this._currentTrackSkin,feathers_core_IValidating)) {
			this._currentTrackSkin.validateNow();
		}
		this._currentSecondaryTrackSkin.set_x((this.actualWidth - this._currentSecondaryTrackSkin.get_width()) / 2.0);
		this._currentTrackSkin.set_x((this.actualWidth - this._currentTrackSkin.get_width()) / 2.0);
	}
	,layoutSingleTrack: function() {
		if(this._currentTrackSkin == null) {
			return;
		}
		var minTrackY = 0.0;
		var maxTrackY = this.actualHeight;
		if(this.showDecrementAndIncrementButtons) {
			minTrackY = this.decrementButton.get_height();
			maxTrackY -= this.incrementButton.get_height();
		}
		this._currentTrackSkin.set_y(minTrackY);
		this._currentTrackSkin.set_height(maxTrackY - minTrackY);
		if(js_Boot.__implements(this._currentTrackSkin,feathers_core_IValidating)) {
			this._currentTrackSkin.validateNow();
		}
		this._currentTrackSkin.set_x((this.actualWidth - this._currentTrackSkin.get_width()) / 2.0);
	}
	,layoutThumb: function() {
		if(this._currentThumbSkin == null) {
			return;
		}
		var range = this._maximum - this._minimum;
		this._currentThumbSkin.set_visible((!this.get_hideThumbWhenDisabled() || this._enabled) && range > 0.0);
		if(!this._currentThumbSkin.get_visible()) {
			return;
		}
		if(js_Boot.__implements(this._currentThumbSkin,feathers_core_IValidating)) {
			this._currentThumbSkin.validateNow();
		}
		var valueOffset = 0.0;
		if(this._value < this._minimum) {
			valueOffset = this._minimum - this._value;
		} else if(this._value > this._maximum) {
			valueOffset = this._value - this._maximum;
		}
		var contentWidth = this.actualWidth - this.get_paddingLeft() - this.get_paddingRight();
		var contentHeight = this.actualHeight - this.get_paddingTop() - this.get_paddingBottom();
		if(this.get_fixedThumbSize()) {
			if(this._thumbSkinMeasurements.height != null) {
				this._currentThumbSkin.set_height(this._thumbSkinMeasurements.height);
			}
		} else {
			var adjustedPage = this.getAdjustedPage();
			var thumbHeight = contentHeight * adjustedPage / (range + adjustedPage);
			if(thumbHeight > 0.0) {
				var heightOffset = contentHeight - thumbHeight;
				if(heightOffset > thumbHeight) {
					heightOffset = thumbHeight;
				}
				heightOffset *= valueOffset / (range * thumbHeight / contentHeight);
				thumbHeight -= heightOffset;
			}
			if(this._thumbSkinMeasurements.minHeight != null) {
				if(thumbHeight < this._thumbSkinMeasurements.minHeight) {
					thumbHeight = this._thumbSkinMeasurements.minHeight;
				}
			} else if(js_Boot.__implements(this._currentThumbSkin,feathers_core_IMeasureObject)) {
				var measureSkin = this._currentThumbSkin;
				if(thumbHeight < measureSkin.get_minHeight()) {
					thumbHeight = measureSkin.get_minHeight();
				}
			}
			if(thumbHeight < 0.0) {
				thumbHeight = 0.0;
			}
			this._currentThumbSkin.set_height(thumbHeight);
		}
		this._currentThumbSkin.set_x(this.get_paddingLeft() + (contentWidth - this._currentThumbSkin.get_width()) / 2.0);
		this._currentThumbSkin.set_y(this.valueToLocation(this._value));
	}
	,get_styleContext: function() {
		return feathers_controls_VScrollBar;
	}
	,__class__: feathers_controls_VScrollBar
});
var feathers_controls_supportClasses_BaseScrollContainer = function() {
	this.__scrollPixelSnapping = false;
	this.__hideScrollBarEase = motion_easing_Quart.easeOut;
	this.__hideScrollBarDuration = 0.2;
	this.__showScrollBarMinimumDuration = 0.5;
	this.__scrollBarYPosition = feathers_layout_RelativePosition.RIGHT;
	this.__scrollBarXPosition = feathers_layout_RelativePosition.BOTTOM;
	this.__autoHideScrollBars = true;
	this.__showScrollBars = true;
	this.__fixedScrollBars = false;
	this.__scrollBarsCornerSkin = null;
	this.__viewPortMaskSkin = null;
	this.__maskSkin = null;
	this.__disabledBackgroundSkin = null;
	this.__backgroundSkin = null;
	this.__paddingLeft = 0.0;
	this.__paddingBottom = 0.0;
	this.__paddingRight = 0.0;
	this.__paddingTop = 0.0;
	this._scrollMode = feathers_controls_ScrollMode.MASK;
	this._ignoreViewPortResizing = false;
	this._settingScrollerDimensions = false;
	this._ignoreScrollerChanges = false;
	this._scrollRect2 = new openfl_geom_Rectangle();
	this._scrollRect1 = new openfl_geom_Rectangle();
	this._prevMaxScrollY = 0.0;
	this._prevMinScrollY = 0.0;
	this._prevMaxScrollX = 0.0;
	this._prevMinScrollX = 0.0;
	this._hideScrollBarY = null;
	this._hideScrollBarX = null;
	this._scrollPolicyY = feathers_controls_ScrollPolicy.AUTO;
	this._scrollPolicyX = feathers_controls_ScrollPolicy.AUTO;
	this._scrollStepY = 1.0;
	this._scrollStepX = 1.0;
	this._temporaryRestrictedScrollY = null;
	this._temporaryScrollY = null;
	this._temporaryRestrictedScrollX = null;
	this._temporaryScrollX = null;
	this.showScrollBarY = false;
	this.showScrollBarX = false;
	this._ignoreScrollBarYChange = false;
	this._ignoreScrollBarXChange = false;
	this.chromeMeasuredMaxHeight = 1.0 / 0.0;
	this.chromeMeasuredMinHeight = 0.0;
	this.chromeMeasuredHeight = 0.0;
	this.chromeMeasuredMaxWidth = 1.0 / 0.0;
	this.chromeMeasuredMinWidth = 0.0;
	this.chromeMeasuredWidth = 0.0;
	this.leftViewPortOffset = 0.0;
	this.bottomViewPortOffset = 0.0;
	this.rightViewPortOffset = 0.0;
	this.topViewPortOffset = 0.0;
	this._fallbackViewPortMaskSkin = null;
	this._currentViewPortMaskSkin = null;
	this._currentMaskSkin = null;
	this._backgroundSkinMeasurements = null;
	this._currentBackgroundSkin = null;
	this._scrollBarYHover = false;
	this._scrollBarXHover = false;
	this._scrollerDraggingY = false;
	this._scrollerDraggingX = false;
	feathers_core_FeathersControl.call(this);
	this.set_tabEnabled(true);
	this.set_tabChildren(true);
	this.focusRect = null;
	this.addEventListener("keyDown",$bind(this,this.baseScrollContainer_keyDownHandler));
	this.addEventListener("addedToStage",$bind(this,this.baseScrollContainer_addedToStageHandler));
	this.addEventListener("removedFromStage",$bind(this,this.baseScrollContainer_removedFromStageHandler));
};
$hxClasses["feathers.controls.supportClasses.BaseScrollContainer"] = feathers_controls_supportClasses_BaseScrollContainer;
feathers_controls_supportClasses_BaseScrollContainer.__name__ = "feathers.controls.supportClasses.BaseScrollContainer";
feathers_controls_supportClasses_BaseScrollContainer.__interfaces__ = [feathers_core_IFocusObject];
feathers_controls_supportClasses_BaseScrollContainer.__super__ = feathers_core_FeathersControl;
feathers_controls_supportClasses_BaseScrollContainer.prototype = $extend(feathers_core_FeathersControl.prototype,{
	_viewPort: null
	,get_viewPort: function() {
		return this._viewPort;
	}
	,set_viewPort: function(value) {
		if(this._viewPort == value) {
			return this._viewPort;
		}
		if(this._viewPort != null) {
			this._viewPort.removeEventListener("resize",$bind(this,this.viewPort_resizeHandler));
		}
		if(this.scroller != null) {
			this.scroller.set_target(null);
		}
		this._viewPort = value;
		if(this._viewPort != null) {
			this._viewPort.addEventListener("resize",$bind(this,this.viewPort_resizeHandler));
		}
		this.setInvalid(feathers_core_InvalidationFlag.SCROLL);
		return this._viewPort;
	}
	,scroller: null
	,_scrollerDraggingX: null
	,_scrollerDraggingY: null
	,_scrollBarXHover: null
	,_scrollBarYHover: null
	,_currentBackgroundSkin: null
	,_backgroundSkinMeasurements: null
	,_currentMaskSkin: null
	,_currentViewPortMaskSkin: null
	,_fallbackViewPortMaskSkin: null
	,topViewPortOffset: null
	,rightViewPortOffset: null
	,bottomViewPortOffset: null
	,leftViewPortOffset: null
	,chromeMeasuredWidth: null
	,chromeMeasuredMinWidth: null
	,chromeMeasuredMaxWidth: null
	,chromeMeasuredHeight: null
	,chromeMeasuredMinHeight: null
	,chromeMeasuredMaxHeight: null
	,get_tabEnabled: function() {
		if(this.get_maxScrollY() != this.get_minScrollY() || this.get_maxScrollX() != this.get_minScrollX()) {
			return this.get_rawTabEnabled();
		} else {
			return false;
		}
	}
	,_currentScrollBarsCornerSkin: null
	,scrollBarX: null
	,scrollBarY: null
	,_ignoreScrollBarXChange: null
	,_ignoreScrollBarYChange: null
	,showScrollBarX: null
	,showScrollBarY: null
	,_oldScrollBarXFactory: null
	,_scrollBarXFactory: null
	,get_scrollBarXFactory: function() {
		return this._scrollBarXFactory;
	}
	,set_scrollBarXFactory: function(value) {
		if(this._scrollBarXFactory == value) {
			return this._scrollBarXFactory;
		}
		this._scrollBarXFactory = value;
		this.setInvalid(feathers_controls_supportClasses_BaseScrollContainer.INVALIDATION_FLAG_SCROLL_BAR_FACTORY);
		return this._scrollBarXFactory;
	}
	,_oldScrollBarYFactory: null
	,_scrollBarYFactory: null
	,get_scrollBarYFactory: function() {
		return this._scrollBarYFactory;
	}
	,set_scrollBarYFactory: function(value) {
		if(this._scrollBarYFactory == value) {
			return this._scrollBarYFactory;
		}
		this._scrollBarYFactory = value;
		this.setInvalid(feathers_controls_supportClasses_BaseScrollContainer.INVALIDATION_FLAG_SCROLL_BAR_FACTORY);
		return this._scrollBarYFactory;
	}
	,_scrollerFactory: null
	,get_scrollerFactory: function() {
		return this._scrollerFactory;
	}
	,set_scrollerFactory: function(value) {
		if(this._scrollerFactory == value) {
			return this._scrollerFactory;
		}
		this._scrollerFactory = value;
		this.setInvalid(feathers_controls_supportClasses_BaseScrollContainer.INVALIDATION_FLAG_SCROLLER_FACTORY);
		return this._scrollerFactory;
	}
	,_temporaryScrollX: null
	,_temporaryRestrictedScrollX: null
	,get_scrollX: function() {
		if(this.scroller == null) {
			if(this._temporaryRestrictedScrollX != null) {
				return this._temporaryRestrictedScrollX;
			}
			if(this._temporaryScrollX != null) {
				return this._temporaryScrollX;
			}
			return 0.0;
		}
		return this.scroller.get_scrollX();
	}
	,set_scrollX: function(value) {
		if(this.scroller == null) {
			this._temporaryScrollX = value;
			this._temporaryRestrictedScrollX = null;
			feathers_events_ScrollEvent.dispatch(this,"scroll",false,false,this._temporaryScrollX,this._temporaryScrollY);
			return this._temporaryScrollX;
		}
		this.scroller.set_scrollX(value);
		return this.scroller.get_scrollX();
	}
	,get_restrictedScrollX: function() {
		if(this.scroller == null) {
			return this.get_scrollX();
		}
		return this.scroller.get_restrictedScrollX();
	}
	,set_restrictedScrollX: function(value) {
		if(this.scroller == null) {
			this._temporaryRestrictedScrollX = value;
			this._temporaryScrollX = null;
			feathers_events_ScrollEvent.dispatch(this,"scroll",false,false,this._temporaryScrollX,this._temporaryScrollY);
			return this._temporaryRestrictedScrollX;
		}
		this.scroller.set_restrictedScrollX(value);
		return this.scroller.get_restrictedScrollX();
	}
	,_temporaryScrollY: null
	,_temporaryRestrictedScrollY: null
	,get_scrollY: function() {
		if(this.scroller == null) {
			if(this._temporaryRestrictedScrollY != null) {
				return this._temporaryRestrictedScrollY;
			}
			if(this._temporaryScrollY != null) {
				return this._temporaryScrollY;
			}
			return 0.0;
		}
		return this.scroller.get_scrollY();
	}
	,set_scrollY: function(value) {
		if(this.scroller == null) {
			this._temporaryScrollY = value;
			this._temporaryRestrictedScrollY = null;
			feathers_events_ScrollEvent.dispatch(this,"scroll",false,false,this._temporaryScrollX,this._temporaryScrollY);
			return this._temporaryScrollY;
		}
		this.scroller.set_scrollY(value);
		return this.scroller.get_scrollY();
	}
	,get_restrictedScrollY: function() {
		if(this.scroller == null) {
			this.get_scrollY();
		}
		return this.scroller.get_restrictedScrollY();
	}
	,set_restrictedScrollY: function(value) {
		if(this.scroller == null) {
			this._temporaryRestrictedScrollY = value;
			this._temporaryScrollY = null;
			feathers_events_ScrollEvent.dispatch(this,"scroll",false,false,this._temporaryScrollX,this._temporaryScrollY);
			return this._temporaryRestrictedScrollY;
		}
		this.scroller.set_restrictedScrollY(value);
		return this.scroller.get_restrictedScrollY();
	}
	,get_minScrollX: function() {
		if(this.scroller == null) {
			return 0.0;
		}
		return this.scroller.get_minScrollX();
	}
	,get_minScrollY: function() {
		if(this.scroller == null) {
			return 0.0;
		}
		return this.scroller.get_minScrollY();
	}
	,get_maxScrollX: function() {
		if(this.scroller == null) {
			return 0.0;
		}
		return this.scroller.get_maxScrollX();
	}
	,get_maxScrollY: function() {
		if(this.scroller == null) {
			return 0.0;
		}
		return this.scroller.get_maxScrollY();
	}
	,_scrollStepX: null
	,get_scrollStepX: function() {
		return this._scrollStepX;
	}
	,set_scrollStepX: function(value) {
		if(this._scrollStepX == value) {
			return this._scrollStepX;
		}
		this._scrollStepX = value;
		this.setInvalid(feathers_core_InvalidationFlag.SCROLL);
		return this._scrollStepX;
	}
	,_scrollStepY: null
	,get_scrollStepY: function() {
		return this._scrollStepY;
	}
	,set_scrollStepY: function(value) {
		if(this._scrollStepY == value) {
			return this._scrollStepY;
		}
		this._scrollStepY = value;
		this.setInvalid(feathers_core_InvalidationFlag.SCROLL);
		return this._scrollStepY;
	}
	,_scrollPolicyX: null
	,get_scrollPolicyX: function() {
		return this._scrollPolicyX;
	}
	,set_scrollPolicyX: function(value) {
		if(this._scrollPolicyX == value) {
			return this._scrollPolicyX;
		}
		this._scrollPolicyX = value;
		this.setInvalid(feathers_core_InvalidationFlag.SCROLL);
		return this._scrollPolicyX;
	}
	,_scrollPolicyY: null
	,get_scrollPolicyY: function() {
		return this._scrollPolicyY;
	}
	,set_scrollPolicyY: function(value) {
		if(this._scrollPolicyY == value) {
			return this._scrollPolicyY;
		}
		this._scrollPolicyY = value;
		this.setInvalid(feathers_core_InvalidationFlag.SCROLL);
		return this._scrollPolicyY;
	}
	,_scrollBarXRevealTime: null
	,_scrollBarYRevealTime: null
	,_hideScrollBarX: null
	,_hideScrollBarY: null
	,_prevMinScrollX: null
	,_prevMaxScrollX: null
	,_prevMinScrollY: null
	,_prevMaxScrollY: null
	,_currentScrollRect: null
	,_scrollRect1: null
	,_scrollRect2: null
	,_ignoreScrollerChanges: null
	,_settingScrollerDimensions: null
	,_ignoreViewPortResizing: null
	,get_measureViewPort: function() {
		return true;
	}
	,_scrollMode: null
	,get_scrollMode: function() {
		return this._scrollMode;
	}
	,set_scrollMode: function(value) {
		if(this._scrollMode == value) {
			return this._scrollMode;
		}
		this._scrollMode = value;
		this.setInvalid(feathers_core_InvalidationFlag.LAYOUT);
		return this._scrollMode;
	}
	,setPadding: function(value) {
		this.set_paddingTop(value);
		this.set_paddingRight(value);
		this.set_paddingBottom(value);
		this.set_paddingLeft(value);
	}
	,getViewPortVisibleBounds: function(result) {
		var viewPortX = this.leftViewPortOffset + this.get_paddingLeft();
		var viewPortY = this.topViewPortOffset + this.get_paddingTop();
		if(result == null) {
			result = new openfl_geom_Rectangle(viewPortX,viewPortY,this._viewPort.get_visibleWidth(),this._viewPort.get_visibleHeight());
		} else {
			result.setTo(viewPortX,viewPortY,this._viewPort.get_visibleWidth(),this._viewPort.get_visibleHeight());
		}
		return result;
	}
	,dispose: function() {
		this.destroyScroller();
		this.destroyScrollBarX();
		this.destroyScrollBarY();
		feathers_core_FeathersControl.prototype.dispose.call(this);
	}
	,update: function() {
		var stylesInvalid = this.isInvalid(feathers_core_InvalidationFlag.STYLES);
		var sizeInvalid = this.isInvalid(feathers_core_InvalidationFlag.SIZE);
		var stateInvalid = this.isInvalid(feathers_core_InvalidationFlag.STATE);
		var scrollerInvalid = this.isInvalid(feathers_controls_supportClasses_BaseScrollContainer.INVALIDATION_FLAG_SCROLLER_FACTORY);
		var scrollBarFactoryInvalid = this.isInvalid(feathers_controls_supportClasses_BaseScrollContainer.INVALIDATION_FLAG_SCROLL_BAR_FACTORY);
		var oldIgnoreScrollerChanges = this._ignoreScrollerChanges;
		this._ignoreScrollerChanges = true;
		if(scrollerInvalid) {
			this.createScroller();
		}
		if(stylesInvalid || stateInvalid) {
			this.refreshBackgroundSkin();
		}
		if(stylesInvalid) {
			this.refreshMaskSkin();
			this.refreshViewPortMaskSkin();
			this.refreshScrollBarsCornerSkin();
		}
		if(scrollBarFactoryInvalid) {
			this.createScrollBars();
		}
		this.refreshEnabled();
		this.refreshScrollerValues();
		this.refreshViewPort();
		this.applyTemporaryScrollPositions();
		this.refreshScrollRect();
		this.refreshScrollBarValues();
		this.layoutChildren();
		this._ignoreScrollerChanges = oldIgnoreScrollerChanges;
	}
	,applyTemporaryScrollPositions: function() {
		if(this._temporaryScrollX != null) {
			this.scroller.set_scrollX(this._temporaryScrollX);
		} else if(this._temporaryRestrictedScrollX != null) {
			this.scroller.set_restrictedScrollX(this._temporaryRestrictedScrollX);
		}
		if(this._temporaryScrollY != null) {
			this.scroller.set_scrollY(this._temporaryScrollY);
		} else if(this._temporaryRestrictedScrollY != null) {
			this.scroller.set_restrictedScrollY(this._temporaryRestrictedScrollY);
		}
		this._temporaryScrollX = null;
		this._temporaryScrollY = null;
		this._temporaryRestrictedScrollX = null;
		this._temporaryRestrictedScrollY = null;
	}
	,needsMeasurement: function() {
		if(!(this.isInvalid(feathers_core_InvalidationFlag.SCROLL) && this.needsScrollMeasurement() || this.isInvalid(feathers_core_InvalidationFlag.DATA) || this.isInvalid(feathers_core_InvalidationFlag.SIZE) || this.isInvalid(feathers_core_InvalidationFlag.STYLES) || this.isInvalid(feathers_controls_supportClasses_BaseScrollContainer.INVALIDATION_FLAG_SCROLL_BAR_FACTORY) || this.isInvalid(feathers_core_InvalidationFlag.STATE))) {
			return this.isInvalid(feathers_core_InvalidationFlag.LAYOUT);
		} else {
			return true;
		}
	}
	,needsScrollMeasurement: function() {
		return false;
	}
	,createScroller: function() {
		this.destroyScroller();
		this.scroller = this._scrollerFactory != null ? this._scrollerFactory() : new feathers_utils_Scroller();
		this.scroller.addEventListener("scroll",$bind(this,this.baseScrollContainer_scroller_scrollHandler));
		this.scroller.addEventListener("scrollStart",$bind(this,this.baseScrollContainer_scroller_scrollStartHandler));
		this.scroller.addEventListener("scrollComplete",$bind(this,this.baseScrollContainer_scroller_scrollCompleteHandler));
	}
	,destroyScroller: function() {
		if(this.scroller == null) {
			return;
		}
		this._temporaryScrollX = this.scroller.get_scrollX();
		this._temporaryScrollY = this.scroller.get_scrollY();
		this._temporaryRestrictedScrollX = null;
		this._temporaryRestrictedScrollY = null;
		this.scroller.set_target(null);
		this.scroller.removeEventListener("scroll",$bind(this,this.baseScrollContainer_scroller_scrollHandler));
		this.scroller.removeEventListener("scrollStart",$bind(this,this.baseScrollContainer_scroller_scrollStartHandler));
		this.scroller.removeEventListener("scrollComplete",$bind(this,this.baseScrollContainer_scroller_scrollCompleteHandler));
		this.scroller = null;
		this.setInvalidationFlag(feathers_controls_supportClasses_BaseScrollContainer.INVALIDATION_FLAG_SCROLLER_FACTORY);
	}
	,createScrollBars: function() {
		this.createScrollBarX();
		this.createScrollBarY();
	}
	,createScrollBarX: function() {
		this.destroyScrollBarX();
		var factory = this._scrollBarXFactory != null ? this._scrollBarXFactory : feathers_controls_supportClasses_BaseScrollContainer.defaultScrollBarXFactory;
		this._oldScrollBarXFactory = factory;
		this.scrollBarX = factory.create();
		if(this.get_autoHideScrollBars()) {
			this.scrollBarX.set_alpha(0.0);
		}
		this.scrollBarX.addEventListener("change",$bind(this,this.scrollBarX_changeHandler));
		this.scrollBarX.addEventListener("rollOver",$bind(this,this.scrollBarX_rollOverHandler));
		this.scrollBarX.addEventListener("rollOut",$bind(this,this.scrollBarX_rollOutHandler));
		this.scrollBarX.addEventListener("scrollStart",$bind(this,this.scrollBarX_scrollStartHandler));
		this.scrollBarX.addEventListener("scrollComplete",$bind(this,this.scrollBarX_scrollCompleteHandler));
		this.addChild(js_Boot.__cast(this.scrollBarX , openfl_display_DisplayObject));
	}
	,destroyScrollBarX: function() {
		if(this.scrollBarX == null) {
			return;
		}
		this.scrollBarX.removeEventListener("change",$bind(this,this.scrollBarX_changeHandler));
		this.scrollBarX.removeEventListener("rollOver",$bind(this,this.scrollBarX_rollOverHandler));
		this.scrollBarX.removeEventListener("rollOut",$bind(this,this.scrollBarX_rollOutHandler));
		this.scrollBarX.removeEventListener("scrollStart",$bind(this,this.scrollBarX_scrollStartHandler));
		this.scrollBarX.removeEventListener("scrollComplete",$bind(this,this.scrollBarX_scrollCompleteHandler));
		this.removeChild(js_Boot.__cast(this.scrollBarX , openfl_display_DisplayObject));
		if(this._oldScrollBarXFactory.destroy != null) {
			this._oldScrollBarXFactory.destroy(this.scrollBarX);
		}
		this._oldScrollBarXFactory = null;
		this.scrollBarX = null;
	}
	,createScrollBarY: function() {
		this.destroyScrollBarY();
		var factory = this._scrollBarYFactory != null ? this._scrollBarYFactory : feathers_controls_supportClasses_BaseScrollContainer.defaultScrollBarYFactory;
		this._oldScrollBarYFactory = factory;
		this.scrollBarY = factory.create();
		if(this.get_autoHideScrollBars()) {
			this.scrollBarY.set_alpha(0.0);
		}
		this.scrollBarY.addEventListener("change",$bind(this,this.scrollBarY_changeHandler));
		this.scrollBarY.addEventListener("rollOver",$bind(this,this.scrollBarY_rollOverHandler));
		this.scrollBarY.addEventListener("rollOut",$bind(this,this.scrollBarY_rollOutHandler));
		this.scrollBarY.addEventListener("scrollStart",$bind(this,this.scrollBarY_scrollStartHandler));
		this.scrollBarY.addEventListener("scrollComplete",$bind(this,this.scrollBarY_scrollCompleteHandler));
		this.addChild(js_Boot.__cast(this.scrollBarY , openfl_display_DisplayObject));
	}
	,destroyScrollBarY: function() {
		if(this.scrollBarY == null) {
			return;
		}
		this.scrollBarY.removeEventListener("change",$bind(this,this.scrollBarY_changeHandler));
		this.scrollBarY.removeEventListener("rollOver",$bind(this,this.scrollBarY_rollOverHandler));
		this.scrollBarY.removeEventListener("rollOut",$bind(this,this.scrollBarY_rollOutHandler));
		this.scrollBarY.removeEventListener("scrollStart",$bind(this,this.scrollBarY_scrollStartHandler));
		this.scrollBarY.removeEventListener("scrollComplete",$bind(this,this.scrollBarY_scrollCompleteHandler));
		this.removeChild(js_Boot.__cast(this.scrollBarY , openfl_display_DisplayObject));
		if(this._oldScrollBarYFactory.destroy != null) {
			this._oldScrollBarYFactory.destroy(this.scrollBarY);
		}
		this._oldScrollBarYFactory = null;
		this.scrollBarY = null;
	}
	,refreshEnabled: function() {
		this._viewPort.set_enabled(this._enabled);
		if(this.scrollBarX != null) {
			this.scrollBarX.set_enabled(this._enabled);
		}
		if(this.scrollBarY != null) {
			this.scrollBarY.set_enabled(this._enabled);
		}
	}
	,restrictScrollAfterRefreshViewPort: function() {
		if(this.scroller.get_scrolling()) {
			return;
		}
		var currentScrollX = this.scroller.get_scrollX();
		var currentScrollY = this.scroller.get_scrollY();
		if(this._prevMinScrollX != this.scroller.get_minScrollX() && currentScrollX < this.scroller.get_minScrollX()) {
			this.scroller.set_restrictedScrollX(currentScrollX);
		} else if(this._prevMaxScrollX != this.scroller.get_maxScrollX() && currentScrollX > this.scroller.get_maxScrollX()) {
			this.scroller.set_restrictedScrollX(currentScrollX);
		}
		if(this._prevMinScrollY != this.scroller.get_minScrollY() && currentScrollY < this.scroller.get_minScrollY()) {
			this.scroller.set_restrictedScrollY(currentScrollY);
		} else if(this._prevMaxScrollY != this.scroller.get_maxScrollY() && currentScrollY > this.scroller.get_maxScrollY()) {
			this.scroller.set_restrictedScrollY(currentScrollY);
		}
		if(currentScrollX != this.scroller.get_scrollX() || currentScrollY != this.scroller.get_scrollY()) {
			feathers_events_ScrollEvent.dispatch(this,"scroll",false,false,this.scroller.get_scrollX(),this.scroller.get_scrollY());
		}
	}
	,refreshViewPort: function() {
		if(js_Boot.__implements(this.scrollBarX,feathers_core_IValidating)) {
			this.scrollBarX.validateNow();
		}
		if(js_Boot.__implements(this.scrollBarY,feathers_core_IValidating)) {
			this.scrollBarY.validateNow();
		}
		this._viewPort.set_scrollX(this.get_scrollX());
		this._viewPort.set_scrollY(this.get_scrollY());
		this._prevMinScrollX = this.scroller.get_minScrollX();
		this._prevMaxScrollX = this.scroller.get_maxScrollX();
		this._prevMinScrollY = this.scroller.get_minScrollY();
		this._prevMaxScrollY = this.scroller.get_maxScrollY();
		if(!this.needsMeasurement()) {
			this._viewPort.validateNow();
			var oldSettingScrollerDimensions = this._settingScrollerDimensions;
			this._settingScrollerDimensions = true;
			this.scroller.setDimensions(this._viewPort.get_visibleWidth(),this._viewPort.get_visibleHeight(),this._viewPort.get_width(),this._viewPort.get_height());
			this._settingScrollerDimensions = oldSettingScrollerDimensions;
			this.restrictScrollAfterRefreshViewPort();
			return;
		}
		this.resetViewPortOffsets();
		this.calculateViewPortOffsets(false,false);
		this.refreshViewPortBoundsForMeasurement();
		if(this.get_scrollPolicyX() == feathers_controls_ScrollPolicy.AUTO) {
			var oldShowScrollBarX = this.showScrollBarX;
			this.calculateViewPortOffsetsForFixedScrollBarX(false);
			if(this.get_fixedScrollBars() && this.showScrollBarX != oldShowScrollBarX) {
				this.refreshViewPortBoundsForMeasurement();
			}
		}
		if(this.get_scrollPolicyY() == feathers_controls_ScrollPolicy.AUTO) {
			var oldShowScrollBarY = this.showScrollBarY;
			this.calculateViewPortOffsetsForFixedScrollBarY(false);
			if(this.get_fixedScrollBars() && this.showScrollBarY != oldShowScrollBarY) {
				this.refreshViewPortBoundsForMeasurement();
			}
		}
		if(this.get_fixedScrollBars() && !this.showScrollBarX && this.showScrollBarY && this.get_scrollPolicyX() == feathers_controls_ScrollPolicy.AUTO && this.get_scrollPolicyY() == feathers_controls_ScrollPolicy.AUTO) {
			var oldShowScrollBarX = this.showScrollBarX;
			this.calculateViewPortOffsetsForFixedScrollBarX(false);
			if(this.showScrollBarX != oldShowScrollBarX) {
				this.refreshViewPortBoundsForMeasurement();
			}
		}
		var oldSettingScrollerDimensions = this._settingScrollerDimensions;
		this._settingScrollerDimensions = true;
		this.scroller.setDimensions(this._viewPort.get_visibleWidth(),this._viewPort.get_visibleHeight(),this._viewPort.get_width(),this._viewPort.get_height());
		this._settingScrollerDimensions = oldSettingScrollerDimensions;
		this.measure();
		this.resetViewPortOffsets();
		this.calculateViewPortOffsets(false,true);
		this.refreshViewPortBoundsForLayout();
		if(this.get_scrollPolicyX() == feathers_controls_ScrollPolicy.AUTO) {
			var oldShowScrollBarX = this.showScrollBarX;
			this.calculateViewPortOffsetsForFixedScrollBarX(true);
			if(this.get_fixedScrollBars() && this.showScrollBarX != oldShowScrollBarX) {
				this.refreshViewPortBoundsForLayout();
			}
		}
		if(this.get_scrollPolicyY() == feathers_controls_ScrollPolicy.AUTO) {
			var oldShowScrollBarY = this.showScrollBarY;
			this.calculateViewPortOffsetsForFixedScrollBarY(true);
			if(this.get_fixedScrollBars() && this.showScrollBarY != oldShowScrollBarY) {
				this.refreshViewPortBoundsForLayout();
			}
		}
		if(this.get_fixedScrollBars() && !this.showScrollBarX && this.showScrollBarY && this.get_scrollPolicyX() == feathers_controls_ScrollPolicy.AUTO && this.get_scrollPolicyY() == feathers_controls_ScrollPolicy.AUTO) {
			var oldShowScrollBarX = this.showScrollBarX;
			this.calculateViewPortOffsetsForFixedScrollBarX(true);
			if(this.showScrollBarX != oldShowScrollBarX) {
				this.refreshViewPortBoundsForLayout();
			}
		}
		var oldSettingScrollerDimensions = this._settingScrollerDimensions;
		this._settingScrollerDimensions = true;
		this.scroller.setDimensions(this._viewPort.get_visibleWidth(),this._viewPort.get_visibleHeight(),this._viewPort.get_width(),this._viewPort.get_height());
		this._settingScrollerDimensions = oldSettingScrollerDimensions;
		this.restrictScrollAfterRefreshViewPort();
	}
	,resetViewPortOffsets: function() {
		this.showScrollBarX = this.get_showScrollBars() && (this._scrollPolicyX == feathers_controls_ScrollPolicy.ON || this._scrollPolicyX == feathers_controls_ScrollPolicy.AUTO && this.scroller.get_minScrollX() != this.scroller.get_maxScrollX());
		this.showScrollBarY = this.get_showScrollBars() && (this._scrollPolicyX == feathers_controls_ScrollPolicy.ON || this._scrollPolicyY == feathers_controls_ScrollPolicy.AUTO && this.scroller.get_minScrollY() != this.scroller.get_maxScrollY());
		this.topViewPortOffset = this.get_fixedScrollBars() && this.showScrollBarX && this.get_scrollBarXPosition() == feathers_layout_RelativePosition.TOP ? this.scrollBarX.get_height() : 0.0;
		this.bottomViewPortOffset = this.get_fixedScrollBars() && this.showScrollBarX && this.get_scrollBarXPosition() == feathers_layout_RelativePosition.BOTTOM ? this.scrollBarX.get_height() : 0.0;
		this.leftViewPortOffset = this.get_fixedScrollBars() && this.showScrollBarY && this.get_scrollBarYPosition() == feathers_layout_RelativePosition.LEFT ? this.scrollBarY.get_width() : 0.0;
		this.rightViewPortOffset = this.get_fixedScrollBars() && this.showScrollBarY && this.get_scrollBarYPosition() == feathers_layout_RelativePosition.RIGHT ? this.scrollBarY.get_width() : 0.0;
		this.chromeMeasuredWidth = 0.0;
		this.chromeMeasuredMinWidth = 0.0;
		this.chromeMeasuredMaxWidth = 1.0 / 0.0;
		this.chromeMeasuredHeight = 0.0;
		this.chromeMeasuredMinHeight = 0.0;
		this.chromeMeasuredMaxHeight = 1.0 / 0.0;
	}
	,calculateViewPortOffsets: function(forceScrollBars,useActualBounds) {
	}
	,calculateViewPortOffsetsForFixedScrollBarX: function(useActualBounds) {
		if(this.scrollBarX == null) {
			return;
		}
		var newShowScrollBarX = false;
		if(this.get_showScrollBars() && this.get_scrollPolicyX() != feathers_controls_ScrollPolicy.OFF) {
			newShowScrollBarX = this.get_scrollPolicyX() == feathers_controls_ScrollPolicy.ON;
			if(!newShowScrollBarX && this.get_scrollPolicyX() == feathers_controls_ScrollPolicy.AUTO) {
				var availableWidth = useActualBounds ? this.actualWidth : this.get_explicitWidth();
				if(availableWidth != null) {
					availableWidth -= this.get_paddingLeft() + this.get_paddingRight() + this.leftViewPortOffset + this.rightViewPortOffset;
					if(availableWidth < 0.0) {
						availableWidth = 0.0;
					}
				}
				if(availableWidth == null && !useActualBounds) {
					availableWidth = this._viewPort.get_visibleWidth();
				}
				var totalContentWidth = this._viewPort.get_width();
				newShowScrollBarX = availableWidth != null && totalContentWidth > availableWidth && !feathers_utils_MathUtil.fuzzyEquals(totalContentWidth,availableWidth);
				if(!newShowScrollBarX) {
					var maxAvailableWidth = this.get_explicitMaxWidth();
					if(maxAvailableWidth != null) {
						maxAvailableWidth -= this.get_paddingLeft() + this.get_paddingRight() + this.leftViewPortOffset + this.rightViewPortOffset;
						if(maxAvailableWidth < 0.0) {
							maxAvailableWidth = 0.0;
						}
					}
					newShowScrollBarX = maxAvailableWidth != null && totalContentWidth > maxAvailableWidth && !feathers_utils_MathUtil.fuzzyEquals(totalContentWidth,maxAvailableWidth);
				}
			}
		}
		if(this.showScrollBarX == newShowScrollBarX) {
			return;
		}
		this.showScrollBarX = newShowScrollBarX;
		if(!this.get_fixedScrollBars()) {
			return;
		}
		var offset = this.scrollBarX.get_height();
		if(!this.showScrollBarX) {
			offset = -offset;
		}
		if(this.get_scrollBarXPosition() == feathers_layout_RelativePosition.TOP) {
			this.topViewPortOffset += offset;
		} else {
			this.bottomViewPortOffset += offset;
		}
	}
	,calculateViewPortOffsetsForFixedScrollBarY: function(useActualBounds) {
		if(this.scrollBarY == null) {
			return;
		}
		var newShowScrollBarY = false;
		if(this.get_showScrollBars() && this.get_scrollPolicyY() != feathers_controls_ScrollPolicy.OFF) {
			newShowScrollBarY = this.get_scrollPolicyY() == feathers_controls_ScrollPolicy.ON;
			if(!newShowScrollBarY && this.get_scrollPolicyY() == feathers_controls_ScrollPolicy.AUTO) {
				var availableHeight = useActualBounds ? this.actualHeight : this.get_explicitHeight();
				if(availableHeight != null) {
					availableHeight -= this.get_paddingTop() + this.get_paddingBottom() + this.topViewPortOffset + this.bottomViewPortOffset;
					if(availableHeight < 0.0) {
						availableHeight = 0.0;
					}
				}
				if(availableHeight == null && !useActualBounds) {
					availableHeight = this._viewPort.get_visibleHeight();
				}
				var totalContentHeight = this._viewPort.get_height();
				newShowScrollBarY = availableHeight != null && totalContentHeight > availableHeight && !feathers_utils_MathUtil.fuzzyEquals(totalContentHeight,availableHeight);
				if(!newShowScrollBarY) {
					var maxAvailableHeight = this.get_explicitMaxHeight();
					if(maxAvailableHeight != null) {
						maxAvailableHeight -= this.get_paddingTop() + this.get_paddingBottom() + this.topViewPortOffset + this.bottomViewPortOffset;
						if(maxAvailableHeight < 0.0) {
							maxAvailableHeight = 0.0;
						}
					}
					newShowScrollBarY = maxAvailableHeight != null && totalContentHeight > maxAvailableHeight && !feathers_utils_MathUtil.fuzzyEquals(totalContentHeight,maxAvailableHeight);
				}
			}
		}
		if(this.showScrollBarY == newShowScrollBarY) {
			return;
		}
		this.showScrollBarY = newShowScrollBarY;
		if(!this.get_fixedScrollBars()) {
			return;
		}
		var offset = this.scrollBarY.get_width();
		if(!this.showScrollBarY) {
			offset = -offset;
		}
		if(this.get_scrollBarYPosition() == feathers_layout_RelativePosition.LEFT) {
			this.leftViewPortOffset += offset;
		} else {
			this.rightViewPortOffset += offset;
		}
	}
	,refreshViewPortBoundsForMeasurement: function() {
		var oldIgnoreViewPortResizing = this._ignoreViewPortResizing;
		this._ignoreViewPortResizing = true;
		var viewPortX = this.get_paddingLeft() + this.leftViewPortOffset;
		var viewPortY = this.get_paddingTop() + this.topViewPortOffset;
		if(this._scrollMode == feathers_controls_ScrollMode.MASK || this._scrollMode == feathers_controls_ScrollMode.MASKLESS || this._currentViewPortMaskSkin != null) {
			viewPortX -= this.get_scrollX();
			viewPortY -= this.get_scrollY();
		}
		this._viewPort.set_x(viewPortX);
		this._viewPort.set_y(viewPortY);
		if(this.get_explicitWidth() != null) {
			var visibleWidth = this.get_explicitWidth() - this.leftViewPortOffset - this.rightViewPortOffset - this.get_paddingLeft() - this.get_paddingRight();
			if(visibleWidth < 0.0) {
				visibleWidth = 0.0;
			}
			this._viewPort.set_visibleWidth(visibleWidth);
		} else {
			this._viewPort.set_visibleWidth(null);
		}
		if(this.get_explicitHeight() != null) {
			var visibleHeight = this.get_explicitHeight() - this.topViewPortOffset - this.bottomViewPortOffset - this.get_paddingTop() - this.get_paddingBottom();
			if(visibleHeight < 0.0) {
				visibleHeight = 0.0;
			}
			this._viewPort.set_visibleHeight(visibleHeight);
		} else {
			this._viewPort.set_visibleHeight(null);
		}
		if(this.get_explicitMinWidth() != null) {
			var minVisibleWidth = this.get_explicitMinWidth() - this.leftViewPortOffset - this.rightViewPortOffset - this.get_paddingLeft() - this.get_paddingRight();
			if(minVisibleWidth < 0.0) {
				minVisibleWidth = 0.0;
			}
			this._viewPort.set_minVisibleWidth(minVisibleWidth);
		} else {
			this._viewPort.set_minVisibleWidth(null);
		}
		if(this.get_explicitMinHeight() != null) {
			var minVisibleHeight = this.get_explicitMinHeight() - this.topViewPortOffset - this.bottomViewPortOffset - this.get_paddingTop() - this.get_paddingBottom();
			if(minVisibleHeight < 0.0) {
				minVisibleHeight = 0.0;
			}
			this._viewPort.set_minVisibleHeight(minVisibleHeight);
		} else {
			this._viewPort.set_minVisibleHeight(null);
		}
		if(this.get_explicitMaxWidth() != null) {
			var maxVisibleWidth = this.get_explicitMaxWidth() - this.leftViewPortOffset - this.rightViewPortOffset - this.get_paddingLeft() - this.get_paddingRight();
			if(maxVisibleWidth < 0.0) {
				maxVisibleWidth = 0.0;
			}
			this._viewPort.set_maxVisibleWidth(maxVisibleWidth);
		} else if(this._backgroundSkinMeasurements != null && this._backgroundSkinMeasurements.maxWidth != null) {
			var maxVisibleWidth = this._backgroundSkinMeasurements.maxWidth - this.leftViewPortOffset - this.rightViewPortOffset - this.get_paddingLeft() - this.get_paddingRight();
			if(maxVisibleWidth < 0.0) {
				maxVisibleWidth = 0.0;
			}
			this._viewPort.set_maxVisibleWidth(maxVisibleWidth);
		} else {
			this._viewPort.set_maxVisibleWidth(1.0 / 0.0);
		}
		if(this.get_explicitMaxHeight() != null) {
			var maxVisibleHeight = this.get_explicitMaxHeight() - this.topViewPortOffset - this.bottomViewPortOffset - this.get_paddingTop() - this.get_paddingBottom();
			if(maxVisibleHeight < 0.0) {
				maxVisibleHeight = 0.0;
			}
			this._viewPort.set_maxVisibleHeight(maxVisibleHeight);
		} else if(this._backgroundSkinMeasurements != null && this._backgroundSkinMeasurements.maxHeight != null) {
			var maxVisibleHeight = this._backgroundSkinMeasurements.maxHeight - this.topViewPortOffset - this.bottomViewPortOffset - this.get_paddingTop() - this.get_paddingBottom();
			if(maxVisibleHeight < 0.0) {
				maxVisibleHeight = 0.0;
			}
			this._viewPort.set_maxVisibleHeight(maxVisibleHeight);
		} else {
			this._viewPort.set_maxVisibleHeight(1.0 / 0.0);
		}
		this._viewPort.validateNow();
		this._ignoreViewPortResizing = oldIgnoreViewPortResizing;
	}
	,refreshViewPortBoundsForLayout: function() {
		var oldIgnoreViewPortResizing = this._ignoreViewPortResizing;
		this._ignoreViewPortResizing = true;
		var visibleWidth = this.actualWidth - this.leftViewPortOffset - this.rightViewPortOffset - this.get_paddingLeft() - this.get_paddingRight();
		if(visibleWidth < 0.0) {
			visibleWidth = 0.0;
		}
		var visibleHeight = this.actualHeight - this.topViewPortOffset - this.bottomViewPortOffset - this.get_paddingTop() - this.get_paddingBottom();
		if(visibleHeight < 0.0) {
			visibleHeight = 0.0;
		}
		var minVisibleWidth = this.actualMinWidth - this.leftViewPortOffset - this.rightViewPortOffset - this.get_paddingLeft() - this.get_paddingRight();
		if(minVisibleWidth < 0.0) {
			minVisibleWidth = 0.0;
		}
		var minVisibleHeight = this.actualMinHeight - this.topViewPortOffset - this.bottomViewPortOffset - this.get_paddingTop() - this.get_paddingBottom();
		if(minVisibleHeight < 0.0) {
			minVisibleHeight = 0.0;
		}
		var maxVisibleWidth = this.actualMaxWidth - this.leftViewPortOffset - this.rightViewPortOffset - this.get_paddingLeft() - this.get_paddingRight();
		if(maxVisibleWidth < 0.0) {
			maxVisibleWidth = 0.0;
		}
		var maxVisibleHeight = this.actualMaxHeight - this.topViewPortOffset - this.bottomViewPortOffset - this.get_paddingTop() - this.get_paddingBottom();
		if(maxVisibleHeight < 0.0) {
			maxVisibleHeight = 0.0;
		}
		var viewPortX = this.get_paddingLeft() + this.leftViewPortOffset;
		var viewPortY = this.get_paddingTop() + this.topViewPortOffset;
		if(this._scrollMode == feathers_controls_ScrollMode.MASK || this._scrollMode == feathers_controls_ScrollMode.MASKLESS || this._currentViewPortMaskSkin != null) {
			viewPortX -= this.get_scrollX();
			viewPortY -= this.get_scrollY();
		}
		this._viewPort.set_x(viewPortX);
		this._viewPort.set_y(viewPortY);
		this._viewPort.set_visibleWidth(visibleWidth);
		this._viewPort.set_visibleHeight(visibleHeight);
		this._viewPort.set_minVisibleWidth(minVisibleWidth);
		this._viewPort.set_minVisibleHeight(minVisibleHeight);
		this._viewPort.set_maxVisibleWidth(maxVisibleWidth);
		this._viewPort.set_maxVisibleHeight(maxVisibleHeight);
		this._viewPort.validateNow();
		this._ignoreViewPortResizing = oldIgnoreViewPortResizing;
	}
	,refreshScrollerValues: function() {
		if(this.stage != null) {
			this.scroller.set_target(js_Boot.__cast(this._viewPort , openfl_display_InteractiveObject));
		}
		this.scroller.enabledX = this._enabled && this._scrollPolicyX != feathers_controls_ScrollPolicy.OFF;
		this.scroller.enabledY = this._enabled && this._scrollPolicyY != feathers_controls_ScrollPolicy.OFF;
	}
	,refreshScrollBarValues: function() {
		if(this.scrollBarX != null) {
			var oldIgnoreScrollBarXChange = this._ignoreScrollBarXChange;
			this._ignoreScrollBarXChange = true;
			this.scrollBarX.set_minimum(this.scroller.get_minScrollX());
			this.scrollBarX.set_maximum(this.scroller.get_maxScrollX());
			this.scrollBarX.set_value(this.scroller.get_scrollX());
			this.scrollBarX.set_page((this.scroller.get_maxScrollX() - this.scroller.get_minScrollX()) * this._viewPort.get_visibleWidth() / this._viewPort.get_width());
			this.scrollBarX.set_step(this._scrollStepX);
			var displayScrollBarX = js_Boot.__cast(this.scrollBarX , openfl_display_DisplayObjectContainer);
			displayScrollBarX.set_visible(this.showScrollBarX);
			if(this.get_fixedScrollBars() || !this.get_autoHideScrollBars()) {
				this.scrollBarX.set_alpha(1.0);
			}
			this._ignoreScrollBarXChange = oldIgnoreScrollBarXChange;
		}
		if(this.scrollBarY != null) {
			var oldIgnoreScrollBarYChange = this._ignoreScrollBarYChange;
			this._ignoreScrollBarYChange = true;
			this.scrollBarY.set_minimum(this.scroller.get_minScrollY());
			this.scrollBarY.set_maximum(this.scroller.get_maxScrollY());
			this.scrollBarY.set_value(this.scroller.get_scrollY());
			this.scrollBarY.set_page((this.scroller.get_maxScrollY() - this.scroller.get_minScrollY()) * this._viewPort.get_visibleHeight() / this._viewPort.get_height());
			this.scrollBarY.set_step(this._scrollStepY);
			var displayScrollBarY = js_Boot.__cast(this.scrollBarY , openfl_display_DisplayObjectContainer);
			displayScrollBarY.set_visible(this.showScrollBarY);
			if(this.get_fixedScrollBars() || !this.get_autoHideScrollBars()) {
				this.scrollBarY.set_alpha(1.0);
			}
			this._ignoreScrollBarYChange = oldIgnoreScrollBarYChange;
		}
	}
	,measure: function() {
		var needsWidth = this.get_explicitWidth() == null;
		var needsHeight = this.get_explicitHeight() == null;
		var needsMinWidth = this.get_explicitMinWidth() == null;
		var needsMinHeight = this.get_explicitMinHeight() == null;
		var needsMaxWidth = this.get_explicitMaxWidth() == null;
		var needsMaxHeight = this.get_explicitMaxHeight() == null;
		if(!needsWidth && !needsHeight && !needsMinWidth && !needsMinHeight && !needsMaxWidth && !needsMaxHeight) {
			return false;
		}
		if(this._currentBackgroundSkin != null) {
			feathers_utils_MeasurementsUtil.resetFluidlyWithParent(this._backgroundSkinMeasurements,this._currentBackgroundSkin,this);
		}
		var measureSkin = null;
		if(js_Boot.__implements(this._currentBackgroundSkin,feathers_core_IMeasureObject)) {
			measureSkin = this._currentBackgroundSkin;
		}
		if(js_Boot.__implements(this._currentBackgroundSkin,feathers_core_IValidating)) {
			this._currentBackgroundSkin.validateNow();
		}
		var newWidth = this.get_explicitWidth();
		if(needsWidth) {
			if(this.get_measureViewPort()) {
				newWidth = this._viewPort.get_visibleWidth();
			} else {
				newWidth = 0.0;
			}
			newWidth += this.leftViewPortOffset + this.rightViewPortOffset;
			newWidth = Math.max(newWidth,this.chromeMeasuredWidth);
			newWidth += this.get_paddingLeft() + this.get_paddingRight();
			if(this._currentBackgroundSkin != null) {
				newWidth = Math.max(newWidth,this._currentBackgroundSkin.get_width());
			}
		}
		var newHeight = this.get_explicitHeight();
		if(needsHeight) {
			if(this.get_measureViewPort()) {
				newHeight = this._viewPort.get_visibleHeight();
			} else {
				newHeight = 0.0;
			}
			newHeight += this.topViewPortOffset + this.bottomViewPortOffset;
			newHeight = Math.max(newHeight,this.chromeMeasuredHeight);
			newHeight += this.get_paddingTop() + this.get_paddingBottom();
			if(this._currentBackgroundSkin != null) {
				newHeight = Math.max(newHeight,this._currentBackgroundSkin.get_height());
			}
		}
		var newMinWidth = this.get_explicitMinWidth();
		if(needsMinWidth) {
			if(this.get_measureViewPort()) {
				newMinWidth = this._viewPort.get_minVisibleWidth();
			} else {
				newMinWidth = 0.0;
			}
			newMinWidth += this.leftViewPortOffset + this.rightViewPortOffset;
			newMinWidth = Math.max(newMinWidth,this.chromeMeasuredMinWidth);
			newMinWidth += this.get_paddingLeft() + this.get_paddingRight();
			if(measureSkin != null) {
				newMinWidth = Math.max(newMinWidth,measureSkin.get_minWidth());
			} else if(this._backgroundSkinMeasurements != null && this._backgroundSkinMeasurements.minWidth != null) {
				newMinWidth = Math.max(newMinWidth,this._backgroundSkinMeasurements.minWidth);
			}
		}
		var newMinHeight = this.get_explicitMinHeight();
		if(needsMinHeight) {
			if(this.get_measureViewPort()) {
				newMinHeight = this._viewPort.get_minVisibleHeight();
			} else {
				newMinHeight = 0.0;
			}
			newMinHeight += this.topViewPortOffset + this.bottomViewPortOffset;
			newMinHeight = Math.max(newMinHeight,this.chromeMeasuredMinHeight);
			newMinHeight += this.get_paddingTop() + this.get_paddingBottom();
			if(measureSkin != null) {
				newMinHeight = Math.max(newMinHeight,measureSkin.get_minHeight());
			} else if(this._backgroundSkinMeasurements != null && this._backgroundSkinMeasurements.minHeight != null) {
				newMinHeight = Math.max(newMinHeight,this._backgroundSkinMeasurements.minHeight);
			}
		}
		var newMaxWidth = this.get_explicitMaxWidth();
		if(needsMaxWidth) {
			if(this.get_measureViewPort()) {
				newMaxWidth = this._viewPort.get_maxVisibleWidth();
			} else {
				newMaxWidth = 1.0 / 0.0;
			}
			newMaxWidth += this.leftViewPortOffset + this.rightViewPortOffset;
			newMaxWidth = Math.min(newMaxWidth,this.chromeMeasuredMaxWidth);
			newMaxWidth += this.get_paddingLeft() + this.get_paddingRight();
			if(measureSkin != null) {
				newMaxWidth = Math.min(newMaxWidth,measureSkin.get_maxWidth());
			} else if(this._backgroundSkinMeasurements != null && this._backgroundSkinMeasurements.maxWidth != null) {
				newMaxWidth = Math.min(newMaxWidth,this._backgroundSkinMeasurements.maxWidth);
			}
		}
		var newMaxHeight = this.get_explicitMaxHeight();
		if(needsMaxHeight) {
			if(this.get_measureViewPort()) {
				newMaxHeight = this._viewPort.get_maxVisibleHeight();
			} else {
				newMaxHeight = 1.0 / 0.0;
			}
			newMaxHeight += this.topViewPortOffset + this.bottomViewPortOffset;
			newMaxHeight = Math.min(newMaxHeight,this.chromeMeasuredMaxHeight);
			newMaxHeight += this.get_paddingTop() + this.get_paddingBottom();
			if(measureSkin != null) {
				newMaxHeight = Math.min(newMaxHeight,measureSkin.get_maxHeight());
			} else if(this._backgroundSkinMeasurements != null && this._backgroundSkinMeasurements.maxHeight != null) {
				newMaxHeight = Math.min(newMaxHeight,this._backgroundSkinMeasurements.maxHeight);
			}
		}
		return this.saveMeasurements(newWidth,newHeight,newMinWidth,newMinHeight,newMaxWidth,newMaxHeight);
	}
	,refreshBackgroundSkin: function() {
		var oldSkin = this._currentBackgroundSkin;
		this._currentBackgroundSkin = this.getCurrentBackgroundSkin();
		if(this._currentBackgroundSkin == oldSkin) {
			return;
		}
		this.removeCurrentBackgroundSkin(oldSkin);
		this.addCurrentBackgroundSkin(this._currentBackgroundSkin);
	}
	,getCurrentBackgroundSkin: function() {
		if(!this._enabled && this.get_disabledBackgroundSkin() != null) {
			return this.get_disabledBackgroundSkin();
		}
		return this.get_backgroundSkin();
	}
	,addCurrentBackgroundSkin: function(skin) {
		if(skin == null) {
			this._backgroundSkinMeasurements = null;
			return;
		}
		if(js_Boot.__implements(skin,feathers_core_IUIControl)) {
			skin.initializeNow();
		}
		if(this._backgroundSkinMeasurements == null) {
			this._backgroundSkinMeasurements = new feathers_layout_Measurements(skin);
		} else {
			this._backgroundSkinMeasurements.save(skin);
		}
		if(js_Boot.__implements(skin,feathers_skins_IProgrammaticSkin)) {
			skin.set_uiContext(this);
		}
		this.addChildAt(skin,0);
	}
	,removeCurrentBackgroundSkin: function(skin) {
		if(skin == null) {
			return;
		}
		if(js_Boot.__implements(skin,feathers_skins_IProgrammaticSkin)) {
			skin.set_uiContext(null);
		}
		this._backgroundSkinMeasurements.restore(skin);
		if(skin.parent == this) {
			this.removeChild(skin);
		}
	}
	,refreshMaskSkin: function() {
		var oldSkin = this._currentMaskSkin;
		this._currentMaskSkin = this.getCurrentMaskSkin();
		if(this._currentMaskSkin == oldSkin) {
			return;
		}
		this.removeCurrentMaskSkin(oldSkin);
		this.addCurrentMaskSkin(this._currentMaskSkin);
	}
	,getCurrentMaskSkin: function() {
		return this.get_maskSkin();
	}
	,addCurrentMaskSkin: function(skin) {
		if(skin == null) {
			return;
		}
		if(js_Boot.__implements(skin,feathers_core_IUIControl)) {
			skin.initializeNow();
		}
		if(js_Boot.__implements(skin,feathers_skins_IProgrammaticSkin)) {
			skin.set_uiContext(this);
		}
		this.addChild(skin);
		this.set_mask(skin);
	}
	,removeCurrentMaskSkin: function(skin) {
		if(skin == null) {
			return;
		}
		if(js_Boot.__implements(skin,feathers_skins_IProgrammaticSkin)) {
			skin.set_uiContext(null);
		}
		if(skin.parent == this) {
			this.removeChild(skin);
		}
		this.set_mask(null);
	}
	,refreshViewPortMaskSkin: function() {
		var oldSkin = this._currentViewPortMaskSkin;
		this._currentViewPortMaskSkin = this.getCurrentViewPortMaskSkin();
		if(this._currentViewPortMaskSkin == oldSkin) {
			return;
		}
		this.removeCurrentViewPortMaskSkin(oldSkin);
		this.addCurrentViewPortMaskSkin(this._currentViewPortMaskSkin);
	}
	,getCurrentViewPortMaskSkin: function() {
		if(this.get_viewPortMaskSkin() != null) {
			return this.get_viewPortMaskSkin();
		}
		if(this._scrollMode == feathers_controls_ScrollMode.MASK) {
			if(this._fallbackViewPortMaskSkin == null) {
				this._fallbackViewPortMaskSkin = new feathers_skins_RectangleSkin(feathers_graphics_FillStyle.SolidColor(16711935));
			}
			return this._fallbackViewPortMaskSkin;
		}
		return null;
	}
	,addCurrentViewPortMaskSkin: function(skin) {
		if(skin == null) {
			return;
		}
		if(js_Boot.__implements(skin,feathers_core_IUIControl)) {
			skin.initializeNow();
		}
		if(js_Boot.__implements(skin,feathers_skins_IProgrammaticSkin)) {
			skin.set_uiContext(this);
		}
		this.addChild(skin);
		(js_Boot.__cast(this._viewPort , openfl_display_DisplayObject)).set_mask(skin);
	}
	,removeCurrentViewPortMaskSkin: function(skin) {
		if(skin == null) {
			return;
		}
		if(js_Boot.__implements(skin,feathers_skins_IProgrammaticSkin)) {
			skin.set_uiContext(null);
		}
		if(skin.parent == this) {
			this.removeChild(skin);
		}
		(js_Boot.__cast(this._viewPort , openfl_display_DisplayObject)).set_mask(null);
	}
	,refreshScrollBarsCornerSkin: function() {
		var oldSkin = this._currentScrollBarsCornerSkin;
		this._currentScrollBarsCornerSkin = this.getCurrentScrollBarsCornerSkin();
		if(this._currentScrollBarsCornerSkin == oldSkin) {
			return;
		}
		this.removeCurrentScrollBarsCornerSkin(oldSkin);
		this.addCurrentScrollBarsCornerSkin(this._currentScrollBarsCornerSkin);
	}
	,getCurrentScrollBarsCornerSkin: function() {
		return this.get_scrollBarsCornerSkin();
	}
	,addCurrentScrollBarsCornerSkin: function(skin) {
		if(skin == null) {
			return;
		}
		if(js_Boot.__implements(skin,feathers_core_IUIControl)) {
			skin.initializeNow();
		}
		if(js_Boot.__implements(skin,feathers_skins_IProgrammaticSkin)) {
			skin.set_uiContext(this);
		}
		this.addChild(skin);
	}
	,removeCurrentScrollBarsCornerSkin: function(skin) {
		if(skin == null) {
			return;
		}
		if(js_Boot.__implements(skin,feathers_skins_IProgrammaticSkin)) {
			skin.set_uiContext(null);
		}
		if(skin.parent == this) {
			this.removeChild(skin);
		}
	}
	,layoutChildren: function() {
		this.layoutBackgroundSkin();
		this.layoutMaskSkin();
		this.layoutViewPortMaskSkin();
		this.layoutScrollBars();
	}
	,layoutBackgroundSkin: function() {
		if(this._currentBackgroundSkin == null) {
			return;
		}
		this._currentBackgroundSkin.set_x(0.0);
		this._currentBackgroundSkin.set_y(0.0);
		if(this._currentBackgroundSkin.get_width() != this.actualWidth) {
			this._currentBackgroundSkin.set_width(this.actualWidth);
		}
		if(this._currentBackgroundSkin.get_height() != this.actualHeight) {
			this._currentBackgroundSkin.set_height(this.actualHeight);
		}
		if(js_Boot.__implements(this._currentBackgroundSkin,feathers_core_IValidating)) {
			this._currentBackgroundSkin.validateNow();
		}
	}
	,layoutMaskSkin: function() {
		if(this._currentMaskSkin == null) {
			return;
		}
		this._currentMaskSkin.set_x(0.0);
		this._currentMaskSkin.set_y(0.0);
		this._currentMaskSkin.set_width(this.actualWidth);
		this._currentMaskSkin.set_height(this.actualHeight);
		if(js_Boot.__implements(this._currentMaskSkin,feathers_core_IValidating)) {
			this._currentMaskSkin.validateNow();
		}
	}
	,layoutViewPortMaskSkin: function() {
		if(this._currentViewPortMaskSkin == null) {
			return;
		}
		var maskX = this.get_paddingLeft() + this.leftViewPortOffset;
		var maskY = this.get_paddingTop() + this.topViewPortOffset;
		var maskWidth = this._viewPort.get_visibleWidth();
		var maskHeight = this._viewPort.get_visibleHeight();
		if(this.get_fixedScrollBars() && this.scrollBarY.get_visible()) {
			maskWidth += this.scrollBarY.get_width();
			if(this.get_scrollBarYPosition() == feathers_layout_RelativePosition.LEFT) {
				maskX -= this.scrollBarY.get_width();
			}
		}
		if(this.get_fixedScrollBars() && this.scrollBarX.get_visible()) {
			maskHeight += this.scrollBarX.get_height();
			if(this.get_scrollBarXPosition() == feathers_layout_RelativePosition.TOP) {
				maskX -= this.scrollBarX.get_height();
			}
		}
		this._currentViewPortMaskSkin.set_x(maskX);
		this._currentViewPortMaskSkin.set_y(maskY);
		this._currentViewPortMaskSkin.set_width(maskWidth);
		this._currentViewPortMaskSkin.set_height(maskHeight);
		if(js_Boot.__implements(this._currentViewPortMaskSkin,feathers_core_IValidating)) {
			this._currentViewPortMaskSkin.validateNow();
		}
	}
	,layoutScrollBars: function() {
		var visibleWidth = this.actualWidth - this.leftViewPortOffset - this.rightViewPortOffset - this.get_paddingLeft() - this.get_paddingRight();
		if(visibleWidth < 0.0) {
			visibleWidth = 0.0;
		}
		var visibleHeight = this.actualHeight - this.topViewPortOffset - this.bottomViewPortOffset - this.get_paddingTop() - this.get_paddingBottom();
		if(visibleHeight < 0.0) {
			visibleHeight = 0.0;
		}
		if(this.scrollBarX != null && js_Boot.__implements(this.scrollBarX,feathers_core_IValidating)) {
			this.scrollBarX.validateNow();
		}
		if(this.scrollBarY != null && js_Boot.__implements(this.scrollBarY,feathers_core_IValidating)) {
			this.scrollBarY.validateNow();
		}
		if(this.scrollBarX != null) {
			if(this.get_scrollBarXPosition()._hx_index == 0) {
				this.scrollBarX.set_y(this.get_paddingTop());
			} else {
				this.scrollBarX.set_y(this.get_paddingTop() + this.topViewPortOffset + visibleHeight);
			}
			this.scrollBarX.set_x(this.get_paddingLeft() + this.leftViewPortOffset);
			if(!this.get_fixedScrollBars()) {
				var fh = this.scrollBarX;
				fh.set_y(fh.get_y() - this.scrollBarX.get_height());
				if((this.showScrollBarY || this._hideScrollBarY != null) && this.scrollBarY != null) {
					var scrollBarXWidth = visibleWidth - this.scrollBarY.get_width();
					if(scrollBarXWidth < 0.0) {
						scrollBarXWidth = 0.0;
					}
					this.scrollBarX.set_width(scrollBarXWidth);
				} else {
					this.scrollBarX.set_width(visibleWidth);
				}
			} else {
				this.scrollBarX.set_width(visibleWidth);
			}
		}
		if(this.scrollBarY != null) {
			if(this.get_scrollBarYPosition()._hx_index == 3) {
				this.scrollBarY.set_x(this.get_paddingLeft());
			} else {
				this.scrollBarY.set_x(this.get_paddingLeft() + this.leftViewPortOffset + visibleWidth);
			}
			this.scrollBarY.set_y(this.get_paddingTop() + this.topViewPortOffset);
			if(!this.get_fixedScrollBars()) {
				var fh = this.scrollBarY;
				fh.set_x(fh.get_x() - this.scrollBarY.get_width());
				if((this.showScrollBarX || this._hideScrollBarX != null) && this.scrollBarX != null) {
					var scrollBarYHeight = visibleHeight - this.scrollBarX.get_height();
					if(scrollBarYHeight < 0.0) {
						scrollBarYHeight = 0.0;
					}
					this.scrollBarY.set_height(scrollBarYHeight);
				} else {
					this.scrollBarY.set_height(visibleHeight);
				}
			} else {
				this.scrollBarY.set_height(visibleHeight);
			}
		}
		if(this._currentScrollBarsCornerSkin != null) {
			if(this.get_fixedScrollBars() && this.scrollBarX != null && this.scrollBarY != null && this.scrollBarX.get_visible() && this.scrollBarY.get_visible()) {
				this._currentScrollBarsCornerSkin.set_x(this.scrollBarY.get_x());
				this._currentScrollBarsCornerSkin.set_width(this.scrollBarY.get_width());
				this._currentScrollBarsCornerSkin.set_y(this.scrollBarX.get_y());
				this._currentScrollBarsCornerSkin.set_height(this.scrollBarX.get_height());
				this._currentScrollBarsCornerSkin.set_visible(true);
			} else {
				this._currentScrollBarsCornerSkin.set_visible(false);
			}
		}
	}
	,refreshScrollRect: function() {
		var scrollX = this.scroller.get_scrollX();
		var scrollY = this.scroller.get_scrollY();
		if(this.get_scrollPixelSnapping()) {
			var scaleFactorX = feathers_utils_DisplayUtil.getConcatenatedScaleX(this);
			var scaleFactorY = feathers_utils_DisplayUtil.getConcatenatedScaleY(this);
			scrollX = Math.round(scrollX / scaleFactorX) * scaleFactorX;
			scrollY = Math.round(scrollY / scaleFactorY) * scaleFactorY;
		}
		if(this._scrollMode == feathers_controls_ScrollMode.MASK || this._scrollMode == feathers_controls_ScrollMode.MASKLESS || this._currentViewPortMaskSkin != null) {
			var displayViewPort = js_Boot.__cast(this._viewPort , openfl_display_DisplayObject);
			displayViewPort.set_scrollRect(null);
			this._viewPort.set_x(this.get_paddingLeft() + this.leftViewPortOffset - scrollX);
			this._viewPort.set_y(this.get_paddingTop() + this.topViewPortOffset - scrollY);
		} else if(this._scrollMode == feathers_controls_ScrollMode.SCROLL_RECT) {
			var scrollRect = this._scrollRect1;
			if(this._currentScrollRect == scrollRect) {
				scrollRect = this._scrollRect2;
			}
			this._currentScrollRect = scrollRect;
			var scrollRectWidth = this.actualWidth - this.leftViewPortOffset - this.rightViewPortOffset - this.get_paddingLeft() - this.get_paddingRight();
			if(scrollRectWidth < 0.0) {
				scrollRectWidth = 0.0;
			}
			var scrollRectHeight = this.actualHeight - this.topViewPortOffset - this.bottomViewPortOffset - this.get_paddingTop() - this.get_paddingBottom();
			if(scrollRectHeight < 0.0) {
				scrollRectHeight = 0.0;
			}
			scrollRect.setTo(scrollX,scrollY,scrollRectWidth,scrollRectHeight);
			var displayViewPort = js_Boot.__cast(this._viewPort , openfl_display_DisplayObject);
			displayViewPort.set_scrollRect(scrollRect);
		} else {
			throw new openfl_errors_ArgumentError("Unknown scrollMode: " + Std.string(this._scrollMode));
		}
	}
	,revealScrollBarX: function() {
		if(this.scrollBarX == null || this.scroller.get_minScrollX() == this.scroller.get_maxScrollX()) {
			return;
		}
		if(this._hideScrollBarX != null) {
			motion_Actuate.stop(this._hideScrollBarX);
		}
		this.scrollBarX.set_alpha(1.0);
		this._scrollBarXRevealTime = openfl_Lib.getTimer();
	}
	,revealScrollBarY: function() {
		if(this.scrollBarY == null || this.scroller.get_minScrollY() == this.scroller.get_maxScrollY()) {
			return;
		}
		if(this._hideScrollBarY != null) {
			motion_Actuate.stop(this._hideScrollBarY);
		}
		this.scrollBarY.set_alpha(1.0);
		this._scrollBarYRevealTime = openfl_Lib.getTimer();
	}
	,hideScrollBarX: function() {
		var _gthis = this;
		if(this.scrollBarX == null || this._hideScrollBarX != null) {
			return;
		}
		if(this.scrollBarX.get_alpha() == 0.0) {
			return;
		}
		if(this.get_hideScrollBarDuration() == 0.0) {
			this.scrollBarX.set_alpha(0.0);
			return;
		}
		var tween = motion_Actuate.update(function(alpha) {
			return _gthis.scrollBarX.set_alpha(alpha);
		},this.get_hideScrollBarDuration(),[this.scrollBarX.get_alpha()],[0.0],true);
		this._hideScrollBarX = tween;
		this._hideScrollBarX.ease(this.get_hideScrollBarEase());
		this._hideScrollBarX.autoVisible(false);
		var visibleTime = (openfl_Lib.getTimer() - this._scrollBarXRevealTime) / 1000.0;
		if(visibleTime < this.get_showScrollBarMinimumDuration()) {
			this._hideScrollBarX.delay(this.get_showScrollBarMinimumDuration() - visibleTime);
		}
		this._hideScrollBarX.onComplete($bind(this,this.hideScrollBarX_onComplete));
	}
	,hideScrollBarY: function() {
		var _gthis = this;
		if(this.scrollBarY == null || this._hideScrollBarY != null) {
			return;
		}
		if(this.scrollBarY.get_alpha() == 0.0) {
			return;
		}
		if(this.get_hideScrollBarDuration() == 0.0) {
			this.scrollBarY.set_alpha(0.0);
			return;
		}
		var tween = motion_Actuate.update(function(alpha) {
			return _gthis.scrollBarY.set_alpha(alpha);
		},this.get_hideScrollBarDuration(),[this.scrollBarY.get_alpha()],[0.0],true);
		this._hideScrollBarY = tween;
		this._hideScrollBarY.ease(this.get_hideScrollBarEase());
		this._hideScrollBarY.autoVisible(false);
		var visibleTime = (openfl_Lib.getTimer() - this._scrollBarYRevealTime) / 1000.0;
		if(visibleTime < this.get_showScrollBarMinimumDuration()) {
			this._hideScrollBarY.delay(this.get_showScrollBarMinimumDuration() - visibleTime);
		}
		this._hideScrollBarY.onComplete($bind(this,this.hideScrollBarY_onComplete));
	}
	,checkForRevealScrollBars: function() {
		if(!this._scrollerDraggingX && this.scroller.get_draggingX()) {
			this._scrollerDraggingX = true;
			this.revealScrollBarX();
		}
		if(!this._scrollerDraggingY && this.scroller.get_draggingY()) {
			this._scrollerDraggingY = true;
			this.revealScrollBarY();
		}
	}
	,scrollWithKeyboard: function(event) {
		if(this._scrollPolicyY == feathers_controls_ScrollPolicy.OFF && this._scrollPolicyX == feathers_controls_ScrollPolicy.OFF) {
			return;
		}
		var stepX = this._scrollStepX;
		if(stepX <= 0.0) {
			stepX = 1.0;
		}
		var stepY = this._scrollStepY;
		if(stepY <= 0.0) {
			stepY = 1.0;
		}
		var newScrollX = this.get_scrollX();
		var newScrollY = this.get_scrollY();
		switch(event.keyCode) {
		case 33:
			newScrollY = this.get_scrollY() - this._viewPort.get_visibleHeight();
			break;
		case 34:
			newScrollY = this.get_scrollY() + this._viewPort.get_visibleHeight();
			break;
		case 35:
			newScrollY = this.get_maxScrollY();
			break;
		case 36:
			newScrollY = this.get_minScrollY();
			break;
		case 37:
			newScrollX = this.get_scrollX() - stepX;
			break;
		case 38:
			newScrollY = this.get_scrollY() - stepY;
			break;
		case 39:
			newScrollX = this.get_scrollX() + stepX;
			break;
		case 40:
			newScrollY = this.get_scrollY() + stepY;
			break;
		default:
			return;
		}
		if(newScrollY < this.get_minScrollY()) {
			newScrollY = this.get_minScrollY();
		} else if(newScrollY > this.get_maxScrollY()) {
			newScrollY = this.get_maxScrollY();
		}
		if(newScrollX < this.get_minScrollX()) {
			newScrollX = this.get_minScrollX();
		} else if(newScrollX > this.get_maxScrollX()) {
			newScrollX = this.get_maxScrollX();
		}
		var scrolled = false;
		if(this.get_scrollY() != newScrollY && this._scrollPolicyY != feathers_controls_ScrollPolicy.OFF) {
			scrolled = true;
			this.set_scrollY(newScrollY);
		}
		if(this.get_scrollX() != newScrollX && this._scrollPolicyX != feathers_controls_ScrollPolicy.OFF) {
			scrolled = true;
			this.set_scrollX(newScrollX);
		}
		if(scrolled) {
			event.preventDefault();
		}
	}
	,baseScrollContainer_addedToStageHandler: function(event) {
		this.setInvalid(feathers_core_InvalidationFlag.SCROLL);
	}
	,baseScrollContainer_removedFromStageHandler: function(event) {
		if(this.scroller != null) {
			this.scroller.set_target(null);
		}
	}
	,baseScrollContainer_keyDownHandler: function(event) {
		if(!this._enabled || event.isDefaultPrevented()) {
			return;
		}
		if(this.stage != null && ((this.stage.get_focus()) instanceof openfl_text_TextField)) {
			var textField = this.stage.get_focus();
			if(textField.get_type() == 1) {
				return;
			}
		}
		this.scrollWithKeyboard(event);
	}
	,baseScrollContainer_scroller_scrollStartHandler: function(event) {
		var touchPointID = this.scroller.get_touchPointID();
		if(this.scroller.get_touchPointIsSimulated()) {
			var exclusivePointer = feathers_utils_ExclusivePointer.forStage(this.stage);
			var result = exclusivePointer.claimMouse(this);
			if(!result) {
				this.scroller.stop();
				return;
			}
		} else if(touchPointID != null) {
			var exclusivePointer = feathers_utils_ExclusivePointer.forStage(this.stage);
			var result = exclusivePointer.claimTouch(touchPointID,this);
			if(!result) {
				this.scroller.stop();
				return;
			}
		}
		this._viewPort.addEventListener("mouseDown",$bind(this,this.baseScrollContainer_viewPort_mouseDownHandler));
		this._viewPort.addEventListener("touchBegin",$bind(this,this.baseScrollContainer_viewPort_touchBeginHandler));
		this._scrollerDraggingX = false;
		this._scrollerDraggingY = false;
		this.checkForRevealScrollBars();
		feathers_events_ScrollEvent.dispatch(this,"scrollStart",false,false,this.scroller.get_scrollX(),this.scroller.get_scrollY());
	}
	,baseScrollContainer_scroller_scrollHandler: function(event) {
		if(this._ignoreScrollerChanges) {
			if(this._settingScrollerDimensions && this.needsScrollMeasurement()) {
				this.setInvalid(feathers_core_InvalidationFlag.SCROLL);
			} else {
				this._viewPort.set_scrollX(this.get_scrollX());
				this._viewPort.set_scrollY(this.get_scrollY());
			}
			return;
		}
		this.checkForRevealScrollBars();
		if(this.needsScrollMeasurement()) {
			this.setInvalid(feathers_core_InvalidationFlag.SCROLL);
		} else {
			this._viewPort.set_scrollX(this.get_scrollX());
			this._viewPort.set_scrollY(this.get_scrollY());
			this.refreshScrollRect();
			this.refreshScrollBarValues();
		}
		feathers_events_ScrollEvent.dispatch(this,"scroll",false,false,this.scroller.get_scrollX(),this.scroller.get_scrollY());
	}
	,baseScrollContainer_scroller_scrollCompleteHandler: function(event) {
		this._viewPort.removeEventListener("mouseDown",$bind(this,this.baseScrollContainer_viewPort_mouseDownHandler));
		this._viewPort.removeEventListener("touchBegin",$bind(this,this.baseScrollContainer_viewPort_touchBeginHandler));
		this._scrollerDraggingX = false;
		this._scrollerDraggingY = false;
		if(!this._scrollBarXHover && !this.get_fixedScrollBars() && this.get_autoHideScrollBars()) {
			this.hideScrollBarX();
		}
		if(!this._scrollBarYHover && !this.get_fixedScrollBars() && this.get_autoHideScrollBars()) {
			this.hideScrollBarY();
		}
		feathers_events_ScrollEvent.dispatch(this,"scrollComplete",false,false,this.scroller.get_scrollX(),this.scroller.get_scrollY());
	}
	,reclaimMouse: function() {
		if(!this.scroller.get_touchPointIsSimulated()) {
			return;
		}
		var exclusivePointer = feathers_utils_ExclusivePointer.forStage(this.stage);
		var claim = exclusivePointer.getMouseClaim();
		if(claim != null) {
			return;
		}
		exclusivePointer.claimMouse(this);
	}
	,reclaimTouch: function(touchPointID) {
		if(this.scroller.get_touchPointIsSimulated() || this.scroller.get_touchPointID() == null || this.scroller.get_touchPointID() != touchPointID) {
			return;
		}
		var exclusivePointer = feathers_utils_ExclusivePointer.forStage(this.stage);
		var claim = exclusivePointer.getTouchClaim(touchPointID);
		if(claim != null) {
			return;
		}
		exclusivePointer.claimTouch(touchPointID,this);
	}
	,baseScrollContainer_viewPort_mouseDownHandler: function(event) {
		this.reclaimMouse();
	}
	,baseScrollContainer_viewPort_touchBeginHandler: function(event) {
		this.reclaimTouch(event.touchPointID);
	}
	,scrollBarX_changeHandler: function(event) {
		if(this._ignoreScrollBarXChange) {
			return;
		}
		this.scroller.set_scrollX(this.scrollBarX.get_value());
	}
	,scrollBarY_changeHandler: function(event) {
		if(this._ignoreScrollBarYChange) {
			return;
		}
		this.scroller.set_scrollY(this.scrollBarY.get_value());
	}
	,scrollBarX_rollOverHandler: function(event) {
		this._scrollBarXHover = true;
		this.revealScrollBarX();
	}
	,scrollBarX_rollOutHandler: function(event) {
		if(!this._scrollBarXHover) {
			return;
		}
		this._scrollBarXHover = false;
		if(!this._scrollerDraggingX && !this.get_fixedScrollBars() && this.get_autoHideScrollBars()) {
			this.hideScrollBarX();
		}
	}
	,scrollBarY_rollOverHandler: function(event) {
		this._scrollBarYHover = true;
		this.revealScrollBarY();
	}
	,scrollBarY_rollOutHandler: function(event) {
		if(!this._scrollBarYHover) {
			return;
		}
		this._scrollBarYHover = false;
		if(!this._scrollerDraggingY && !this.get_fixedScrollBars() && this.get_autoHideScrollBars()) {
			this.hideScrollBarY();
		}
	}
	,scrollBarX_scrollStartHandler: function(event) {
		this.scroller.stop();
		this._scrollerDraggingX = true;
		feathers_events_ScrollEvent.dispatch(this,"scrollStart",false,false,this.scroller.get_scrollX(),this.scroller.get_scrollY());
	}
	,scrollBarX_scrollCompleteHandler: function(event) {
		this._scrollerDraggingX = false;
		if(!this._scrollBarXHover && !this.get_fixedScrollBars() && this.get_autoHideScrollBars()) {
			this.hideScrollBarX();
		}
		feathers_events_ScrollEvent.dispatch(this,"scrollComplete",false,false,this.scroller.get_scrollX(),this.scroller.get_scrollY());
	}
	,scrollBarY_scrollStartHandler: function(event) {
		this.scroller.stop();
		this._scrollerDraggingY = true;
		feathers_events_ScrollEvent.dispatch(this,"scrollStart",false,false,this.scroller.get_scrollX(),this.scroller.get_scrollY());
	}
	,scrollBarY_scrollCompleteHandler: function(event) {
		this._scrollerDraggingY = false;
		if(!this._scrollBarYHover && !this.get_fixedScrollBars() && this.get_autoHideScrollBars()) {
			this.hideScrollBarY();
		}
		feathers_events_ScrollEvent.dispatch(this,"scrollComplete",false,false,this.scroller.get_scrollX(),this.scroller.get_scrollY());
	}
	,hideScrollBarX_onComplete: function() {
		this._hideScrollBarX = null;
	}
	,hideScrollBarY_onComplete: function() {
		this._hideScrollBarY = null;
	}
	,viewPort_resizeHandler: function(event) {
		if(this._ignoreViewPortResizing) {
			return;
		}
		this.setInvalid(feathers_core_InvalidationFlag.SIZE);
	}
	,__paddingTop: null
	,get_paddingTop: function() {
		return this.__paddingTop;
	}
	,set_paddingTop: function(value) {
		if(!this.setStyle("paddingTop")) {
			return this.__paddingTop;
		}
		if(this.__paddingTop == value) {
			return this.__paddingTop;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_paddingTop);
		this.__paddingTop = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__paddingTop;
	}
	,clearStyle_paddingTop: function() {
		this.set_paddingTop(0.0);
		return this.get_paddingTop();
	}
	,__paddingRight: null
	,get_paddingRight: function() {
		return this.__paddingRight;
	}
	,set_paddingRight: function(value) {
		if(!this.setStyle("paddingRight")) {
			return this.__paddingRight;
		}
		if(this.__paddingRight == value) {
			return this.__paddingRight;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_paddingRight);
		this.__paddingRight = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__paddingRight;
	}
	,clearStyle_paddingRight: function() {
		this.set_paddingRight(0.0);
		return this.get_paddingRight();
	}
	,__paddingBottom: null
	,get_paddingBottom: function() {
		return this.__paddingBottom;
	}
	,set_paddingBottom: function(value) {
		if(!this.setStyle("paddingBottom")) {
			return this.__paddingBottom;
		}
		if(this.__paddingBottom == value) {
			return this.__paddingBottom;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_paddingBottom);
		this.__paddingBottom = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__paddingBottom;
	}
	,clearStyle_paddingBottom: function() {
		this.set_paddingBottom(0.0);
		return this.get_paddingBottom();
	}
	,__paddingLeft: null
	,get_paddingLeft: function() {
		return this.__paddingLeft;
	}
	,set_paddingLeft: function(value) {
		if(!this.setStyle("paddingLeft")) {
			return this.__paddingLeft;
		}
		if(this.__paddingLeft == value) {
			return this.__paddingLeft;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_paddingLeft);
		this.__paddingLeft = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__paddingLeft;
	}
	,clearStyle_paddingLeft: function() {
		this.set_paddingLeft(0.0);
		return this.get_paddingLeft();
	}
	,__backgroundSkin: null
	,get_backgroundSkin: function() {
		return this.__backgroundSkin;
	}
	,set_backgroundSkin: function(value) {
		if(!this.setStyle("backgroundSkin")) {
			return this.__backgroundSkin;
		}
		if(this.__backgroundSkin == value) {
			return this.__backgroundSkin;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_backgroundSkin);
		this.__backgroundSkin = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__backgroundSkin;
	}
	,clearStyle_backgroundSkin: function() {
		this.set_backgroundSkin(null);
		return this.get_backgroundSkin();
	}
	,__disabledBackgroundSkin: null
	,get_disabledBackgroundSkin: function() {
		return this.__disabledBackgroundSkin;
	}
	,set_disabledBackgroundSkin: function(value) {
		if(!this.setStyle("disabledBackgroundSkin")) {
			return this.__disabledBackgroundSkin;
		}
		if(this.__disabledBackgroundSkin == value) {
			return this.__disabledBackgroundSkin;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_disabledBackgroundSkin);
		this.__disabledBackgroundSkin = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__disabledBackgroundSkin;
	}
	,clearStyle_disabledBackgroundSkin: function() {
		this.set_disabledBackgroundSkin(null);
		return this.get_disabledBackgroundSkin();
	}
	,__maskSkin: null
	,get_maskSkin: function() {
		return this.__maskSkin;
	}
	,set_maskSkin: function(value) {
		if(!this.setStyle("maskSkin")) {
			return this.__maskSkin;
		}
		if(this.__maskSkin == value) {
			return this.__maskSkin;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_maskSkin);
		this.__maskSkin = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__maskSkin;
	}
	,clearStyle_maskSkin: function() {
		this.set_maskSkin(null);
		return this.get_maskSkin();
	}
	,__viewPortMaskSkin: null
	,get_viewPortMaskSkin: function() {
		return this.__viewPortMaskSkin;
	}
	,set_viewPortMaskSkin: function(value) {
		if(!this.setStyle("viewPortMaskSkin")) {
			return this.__viewPortMaskSkin;
		}
		if(this.__viewPortMaskSkin == value) {
			return this.__viewPortMaskSkin;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_viewPortMaskSkin);
		this.__viewPortMaskSkin = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__viewPortMaskSkin;
	}
	,clearStyle_viewPortMaskSkin: function() {
		this.set_viewPortMaskSkin(null);
		return this.get_viewPortMaskSkin();
	}
	,__scrollBarsCornerSkin: null
	,get_scrollBarsCornerSkin: function() {
		return this.__scrollBarsCornerSkin;
	}
	,set_scrollBarsCornerSkin: function(value) {
		if(!this.setStyle("scrollBarsCornerSkin")) {
			return this.__scrollBarsCornerSkin;
		}
		if(this.__scrollBarsCornerSkin == value) {
			return this.__scrollBarsCornerSkin;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_scrollBarsCornerSkin);
		this.__scrollBarsCornerSkin = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__scrollBarsCornerSkin;
	}
	,clearStyle_scrollBarsCornerSkin: function() {
		this.set_scrollBarsCornerSkin(null);
		return this.get_scrollBarsCornerSkin();
	}
	,__fixedScrollBars: null
	,get_fixedScrollBars: function() {
		return this.__fixedScrollBars;
	}
	,set_fixedScrollBars: function(value) {
		if(!this.setStyle("fixedScrollBars")) {
			return this.__fixedScrollBars;
		}
		if(this.__fixedScrollBars == value) {
			return this.__fixedScrollBars;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_fixedScrollBars);
		this.__fixedScrollBars = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__fixedScrollBars;
	}
	,clearStyle_fixedScrollBars: function() {
		this.set_fixedScrollBars(false);
		return this.get_fixedScrollBars();
	}
	,__showScrollBars: null
	,get_showScrollBars: function() {
		return this.__showScrollBars;
	}
	,set_showScrollBars: function(value) {
		if(!this.setStyle("showScrollBars")) {
			return this.__showScrollBars;
		}
		if(this.__showScrollBars == value) {
			return this.__showScrollBars;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_showScrollBars);
		this.__showScrollBars = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__showScrollBars;
	}
	,clearStyle_showScrollBars: function() {
		this.set_showScrollBars(true);
		return this.get_showScrollBars();
	}
	,__autoHideScrollBars: null
	,get_autoHideScrollBars: function() {
		return this.__autoHideScrollBars;
	}
	,set_autoHideScrollBars: function(value) {
		if(!this.setStyle("autoHideScrollBars")) {
			return this.__autoHideScrollBars;
		}
		if(this.__autoHideScrollBars == value) {
			return this.__autoHideScrollBars;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_autoHideScrollBars);
		this.__autoHideScrollBars = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__autoHideScrollBars;
	}
	,clearStyle_autoHideScrollBars: function() {
		this.set_autoHideScrollBars(true);
		return this.get_autoHideScrollBars();
	}
	,__scrollBarXPosition: null
	,get_scrollBarXPosition: function() {
		return this.__scrollBarXPosition;
	}
	,set_scrollBarXPosition: function(value) {
		if(!this.setStyle("scrollBarXPosition")) {
			return this.__scrollBarXPosition;
		}
		if(this.__scrollBarXPosition == value) {
			return this.__scrollBarXPosition;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_scrollBarXPosition);
		this.__scrollBarXPosition = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__scrollBarXPosition;
	}
	,clearStyle_scrollBarXPosition: function() {
		this.set_scrollBarXPosition(feathers_layout_RelativePosition.BOTTOM);
		return this.get_scrollBarXPosition();
	}
	,__scrollBarYPosition: null
	,get_scrollBarYPosition: function() {
		return this.__scrollBarYPosition;
	}
	,set_scrollBarYPosition: function(value) {
		if(!this.setStyle("scrollBarYPosition")) {
			return this.__scrollBarYPosition;
		}
		if(this.__scrollBarYPosition == value) {
			return this.__scrollBarYPosition;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_scrollBarYPosition);
		this.__scrollBarYPosition = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__scrollBarYPosition;
	}
	,clearStyle_scrollBarYPosition: function() {
		this.set_scrollBarYPosition(feathers_layout_RelativePosition.RIGHT);
		return this.get_scrollBarYPosition();
	}
	,__showScrollBarMinimumDuration: null
	,get_showScrollBarMinimumDuration: function() {
		return this.__showScrollBarMinimumDuration;
	}
	,set_showScrollBarMinimumDuration: function(value) {
		if(!this.setStyle("showScrollBarMinimumDuration")) {
			return this.__showScrollBarMinimumDuration;
		}
		if(this.__showScrollBarMinimumDuration == value) {
			return this.__showScrollBarMinimumDuration;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_showScrollBarMinimumDuration);
		this.__showScrollBarMinimumDuration = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__showScrollBarMinimumDuration;
	}
	,clearStyle_showScrollBarMinimumDuration: function() {
		this.set_showScrollBarMinimumDuration(0.5);
		return this.get_showScrollBarMinimumDuration();
	}
	,__hideScrollBarDuration: null
	,get_hideScrollBarDuration: function() {
		return this.__hideScrollBarDuration;
	}
	,set_hideScrollBarDuration: function(value) {
		if(!this.setStyle("hideScrollBarDuration")) {
			return this.__hideScrollBarDuration;
		}
		if(this.__hideScrollBarDuration == value) {
			return this.__hideScrollBarDuration;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_hideScrollBarDuration);
		this.__hideScrollBarDuration = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__hideScrollBarDuration;
	}
	,clearStyle_hideScrollBarDuration: function() {
		this.set_hideScrollBarDuration(0.2);
		return this.get_hideScrollBarDuration();
	}
	,__hideScrollBarEase: null
	,get_hideScrollBarEase: function() {
		return this.__hideScrollBarEase;
	}
	,set_hideScrollBarEase: function(value) {
		if(!this.setStyle("hideScrollBarEase")) {
			return this.__hideScrollBarEase;
		}
		if(this.__hideScrollBarEase == value) {
			return this.__hideScrollBarEase;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_hideScrollBarEase);
		this.__hideScrollBarEase = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__hideScrollBarEase;
	}
	,clearStyle_hideScrollBarEase: function() {
		this.set_hideScrollBarEase(motion_easing_Quart.easeOut);
		return this.get_hideScrollBarEase();
	}
	,__scrollPixelSnapping: null
	,get_scrollPixelSnapping: function() {
		return this.__scrollPixelSnapping;
	}
	,set_scrollPixelSnapping: function(value) {
		if(!this.setStyle("scrollPixelSnapping")) {
			return this.__scrollPixelSnapping;
		}
		if(this.__scrollPixelSnapping == value) {
			return this.__scrollPixelSnapping;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_scrollPixelSnapping);
		this.__scrollPixelSnapping = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__scrollPixelSnapping;
	}
	,clearStyle_scrollPixelSnapping: function() {
		this.set_scrollPixelSnapping(false);
		return this.get_scrollPixelSnapping();
	}
	,__class__: feathers_controls_supportClasses_BaseScrollContainer
	,__properties__: $extend(feathers_core_FeathersControl.prototype.__properties__,{set_scrollMode:"set_scrollMode",get_scrollMode:"get_scrollMode",get_measureViewPort:"get_measureViewPort",set_scrollPixelSnapping:"set_scrollPixelSnapping",get_scrollPixelSnapping:"get_scrollPixelSnapping",set_hideScrollBarEase:"set_hideScrollBarEase",get_hideScrollBarEase:"get_hideScrollBarEase",set_hideScrollBarDuration:"set_hideScrollBarDuration",get_hideScrollBarDuration:"get_hideScrollBarDuration",set_showScrollBarMinimumDuration:"set_showScrollBarMinimumDuration",get_showScrollBarMinimumDuration:"get_showScrollBarMinimumDuration",set_scrollBarYPosition:"set_scrollBarYPosition",get_scrollBarYPosition:"get_scrollBarYPosition",set_scrollBarXPosition:"set_scrollBarXPosition",get_scrollBarXPosition:"get_scrollBarXPosition",set_scrollPolicyY:"set_scrollPolicyY",get_scrollPolicyY:"get_scrollPolicyY",set_scrollPolicyX:"set_scrollPolicyX",get_scrollPolicyX:"get_scrollPolicyX",set_scrollStepY:"set_scrollStepY",get_scrollStepY:"get_scrollStepY",set_scrollStepX:"set_scrollStepX",get_scrollStepX:"get_scrollStepX",get_maxScrollY:"get_maxScrollY",get_maxScrollX:"get_maxScrollX",get_minScrollY:"get_minScrollY",get_minScrollX:"get_minScrollX",set_restrictedScrollY:"set_restrictedScrollY",get_restrictedScrollY:"get_restrictedScrollY",set_scrollY:"set_scrollY",get_scrollY:"get_scrollY",set_restrictedScrollX:"set_restrictedScrollX",get_restrictedScrollX:"get_restrictedScrollX",set_scrollX:"set_scrollX",get_scrollX:"get_scrollX",set_scrollerFactory:"set_scrollerFactory",get_scrollerFactory:"get_scrollerFactory",set_scrollBarYFactory:"set_scrollBarYFactory",get_scrollBarYFactory:"get_scrollBarYFactory",set_scrollBarXFactory:"set_scrollBarXFactory",get_scrollBarXFactory:"get_scrollBarXFactory",set_autoHideScrollBars:"set_autoHideScrollBars",get_autoHideScrollBars:"get_autoHideScrollBars",set_showScrollBars:"set_showScrollBars",get_showScrollBars:"get_showScrollBars",set_fixedScrollBars:"set_fixedScrollBars",get_fixedScrollBars:"get_fixedScrollBars",set_scrollBarsCornerSkin:"set_scrollBarsCornerSkin",get_scrollBarsCornerSkin:"get_scrollBarsCornerSkin",set_viewPortMaskSkin:"set_viewPortMaskSkin",get_viewPortMaskSkin:"get_viewPortMaskSkin",set_maskSkin:"set_maskSkin",get_maskSkin:"get_maskSkin",set_disabledBackgroundSkin:"set_disabledBackgroundSkin",get_disabledBackgroundSkin:"get_disabledBackgroundSkin",set_backgroundSkin:"set_backgroundSkin",get_backgroundSkin:"get_backgroundSkin",set_paddingLeft:"set_paddingLeft",get_paddingLeft:"get_paddingLeft",set_paddingBottom:"set_paddingBottom",get_paddingBottom:"get_paddingBottom",set_paddingRight:"set_paddingRight",get_paddingRight:"get_paddingRight",set_paddingTop:"set_paddingTop",get_paddingTop:"get_paddingTop",set_viewPort:"set_viewPort",get_viewPort:"get_viewPort"})
});
var feathers_core_IFocusContainer = function() { };
$hxClasses["feathers.core.IFocusContainer"] = feathers_core_IFocusContainer;
feathers_core_IFocusContainer.__name__ = "feathers.core.IFocusContainer";
feathers_core_IFocusContainer.__isInterface__ = true;
feathers_core_IFocusContainer.__interfaces__ = [feathers_core_IFocusObject];
feathers_core_IFocusContainer.prototype = {
	get_childFocusEnabled: null
	,set_childFocusEnabled: null
	,__class__: feathers_core_IFocusContainer
	,__properties__: {set_childFocusEnabled:"set_childFocusEnabled",get_childFocusEnabled:"get_childFocusEnabled"}
};
var feathers_controls_ScrollContainer = function() {
	this.__layout = null;
	this._manageChildVisibility = false;
	this._autoSizeMode = feathers_layout_AutoSizeMode.CONTENT;
	this._childFocusEnabled = true;
	this._xmlContent = null;
	this.items = [];
	this._displayListBypassEnabled = true;
	this._ignoreChangesButSetFlags = false;
	this._ignoreChildChanges = false;
	this._ignoreRemovedEvent = false;
	this.initializeScrollContainerTheme();
	feathers_controls_supportClasses_BaseScrollContainer.call(this);
	if(this.get_viewPort() == null) {
		this.layoutViewPort = new feathers_controls_supportClasses_LayoutViewPort();
		this.addRawChild(this.layoutViewPort);
		this.set_viewPort(this.layoutViewPort);
	}
	this.addEventListener("addedToStage",$bind(this,this.scrollContainer_addedToStageHandler));
};
$hxClasses["feathers.controls.ScrollContainer"] = feathers_controls_ScrollContainer;
feathers_controls_ScrollContainer.__name__ = "feathers.controls.ScrollContainer";
feathers_controls_ScrollContainer.__interfaces__ = [feathers_core_IFocusContainer];
feathers_controls_ScrollContainer.__super__ = feathers_controls_supportClasses_BaseScrollContainer;
feathers_controls_ScrollContainer.prototype = $extend(feathers_controls_supportClasses_BaseScrollContainer.prototype,{
	layoutViewPort: null
	,_ignoreRemovedEvent: null
	,_ignoreChildChanges: null
	,_ignoreChangesButSetFlags: null
	,_displayListBypassEnabled: null
	,items: null
	,_xmlContent: null
	,get_xmlContent: function() {
		return this._xmlContent;
	}
	,set_xmlContent: function(value) {
		if(this._xmlContent == value) {
			return this._xmlContent;
		}
		if(this._xmlContent != null) {
			var _g = 0;
			var _g1 = this._xmlContent;
			while(_g < _g1.length) {
				var child = _g1[_g];
				++_g;
				this.removeChild(child);
			}
		}
		this._xmlContent = value;
		if(this._xmlContent != null) {
			var _g = 0;
			var _g1 = this._xmlContent;
			while(_g < _g1.length) {
				var child = _g1[_g];
				++_g;
				this.addChild(child);
			}
		}
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this._xmlContent;
	}
	,_childFocusEnabled: null
	,get_childFocusEnabled: function() {
		if(this._enabled) {
			return this._childFocusEnabled;
		} else {
			return false;
		}
	}
	,set_childFocusEnabled: function(value) {
		if(this._childFocusEnabled == value) {
			return this._childFocusEnabled;
		}
		this._childFocusEnabled = value;
		return this._childFocusEnabled;
	}
	,_autoSizeMode: null
	,get_autoSizeMode: function() {
		return this._autoSizeMode;
	}
	,set_autoSizeMode: function(value) {
		if(this._autoSizeMode == value) {
			return this._autoSizeMode;
		}
		this._autoSizeMode = value;
		this.setInvalid(feathers_core_InvalidationFlag.SIZE);
		if(this.stage != null) {
			if(this._autoSizeMode == feathers_layout_AutoSizeMode.STAGE) {
				this.stage.addEventListener("resize",$bind(this,this.scrollContainer_stage_resizeHandler),false,0,true);
				this.addEventListener("removedFromStage",$bind(this,this.scrollContainer_removedFromStageHandler));
			} else {
				this.stage.removeEventListener("resize",$bind(this,this.scrollContainer_stage_resizeHandler));
				this.removeEventListener("removedFromStage",$bind(this,this.scrollContainer_removedFromStageHandler));
			}
		}
		return this._autoSizeMode;
	}
	,_manageChildVisibility: null
	,get_manageChildVisibility: function() {
		return this._manageChildVisibility;
	}
	,set_manageChildVisibility: function(value) {
		if(this._manageChildVisibility == value) {
			return this._manageChildVisibility;
		}
		this._manageChildVisibility = value;
		this.setInvalid(feathers_core_InvalidationFlag.LAYOUT);
		return this._manageChildVisibility;
	}
	,get_numRawChildren: function() {
		var oldBypass = this._displayListBypassEnabled;
		this._displayListBypassEnabled = false;
		var result = this.get_numChildren();
		this._displayListBypassEnabled = oldBypass;
		return result;
	}
	,get_numChildren: function() {
		if(!this._displayListBypassEnabled) {
			return feathers_controls_supportClasses_BaseScrollContainer.prototype.get_numChildren.call(this);
		}
		return this.layoutViewPort.get_numChildren();
	}
	,addChild: function(child) {
		if(!this._displayListBypassEnabled) {
			return feathers_controls_supportClasses_BaseScrollContainer.prototype.addChild.call(this,child);
		}
		return this.addChildAt(child,this.layoutViewPort.get_numChildren());
	}
	,addChildAt: function(child,index) {
		if(!this._displayListBypassEnabled) {
			return feathers_controls_supportClasses_BaseScrollContainer.prototype.addChildAt.call(this,child,index);
		}
		var oldIndex = this.items.indexOf(child);
		if(oldIndex == index) {
			return child;
		}
		if(oldIndex >= 0) {
			HxOverrides.remove(this.items,child);
		}
		this.items.splice(index,0,child);
		var result = this.layoutViewPort.addChildAt(child,index);
		child.addEventListener("resize",$bind(this,this.scrollContainer_child_resizeHandler));
		if(js_Boot.__implements(child,feathers_layout_ILayoutObject)) {
			child.addEventListener("layoutDataChange",$bind(this,this.scrollContainer_child_layoutDataChangeHandler),false,0,true);
		}
		child.addEventListener("removed",$bind(this,this.scrollContainer_child_removedHandler));
		if(this._ignoreChangesButSetFlags) {
			this.setInvalidationFlag(feathers_core_InvalidationFlag.LAYOUT);
		} else {
			this.setInvalid(feathers_core_InvalidationFlag.LAYOUT);
		}
		return result;
	}
	,removeChild: function(child) {
		return this.removeChildInternal(child,true);
	}
	,removeChildInternal: function(child,removeFromViewPort) {
		if(!this._displayListBypassEnabled) {
			return feathers_controls_supportClasses_BaseScrollContainer.prototype.removeChild.call(this,child);
		}
		if(child == null || child.parent != this.layoutViewPort) {
			return child;
		}
		HxOverrides.remove(this.items,child);
		var result = child;
		if(removeFromViewPort) {
			var oldIgnoreRemovedEvent = this._ignoreRemovedEvent;
			this._ignoreRemovedEvent = true;
			result = this.layoutViewPort.removeChild(child);
			this._ignoreRemovedEvent = oldIgnoreRemovedEvent;
		}
		child.removeEventListener("resize",$bind(this,this.scrollContainer_child_resizeHandler));
		if(js_Boot.__implements(child,feathers_layout_ILayoutObject)) {
			child.removeEventListener("layoutDataChange",$bind(this,this.scrollContainer_child_layoutDataChangeHandler));
		}
		child.removeEventListener("removed",$bind(this,this.scrollContainer_child_removedHandler));
		if(this._ignoreChangesButSetFlags) {
			this.setInvalidationFlag(feathers_core_InvalidationFlag.LAYOUT);
		} else {
			this.setInvalid(feathers_core_InvalidationFlag.LAYOUT);
		}
		return result;
	}
	,removeChildAt: function(index) {
		if(!this._displayListBypassEnabled) {
			return feathers_controls_supportClasses_BaseScrollContainer.prototype.removeChildAt.call(this,index);
		}
		return this.removeChild(this.layoutViewPort.getChildAt(index));
	}
	,getChildAt: function(index) {
		if(!this._displayListBypassEnabled) {
			return feathers_controls_supportClasses_BaseScrollContainer.prototype.removeChildAt.call(this,index);
		}
		return this.layoutViewPort.getChildAt(index);
	}
	,getChildIndex: function(child) {
		if(!this._displayListBypassEnabled) {
			return feathers_controls_supportClasses_BaseScrollContainer.prototype.getChildIndex.call(this,child);
		}
		return this.items.indexOf(child);
	}
	,setChildIndex: function(child,index) {
		if(!this._displayListBypassEnabled) {
			feathers_controls_supportClasses_BaseScrollContainer.prototype.setChildIndex.call(this,child,index);
			return;
		}
		var oldIndex = this.getChildIndex(child);
		if(oldIndex == index) {
			return;
		}
		HxOverrides.remove(this.items,child);
		this.items.splice(index,0,child);
		if(this._ignoreChangesButSetFlags) {
			this.setInvalidationFlag(feathers_core_InvalidationFlag.LAYOUT);
		} else {
			this.setInvalid(feathers_core_InvalidationFlag.LAYOUT);
		}
	}
	,getChildByName: function(name) {
		if(!this._displayListBypassEnabled) {
			return feathers_controls_supportClasses_BaseScrollContainer.prototype.getChildByName.call(this,name);
		}
		var _g = 0;
		var _g1 = this.items;
		while(_g < _g1.length) {
			var child = _g1[_g];
			++_g;
			if(child.get_name() == name) {
				return child;
			}
		}
		return null;
	}
	,addRawChild: function(child) {
		var oldBypass = this._displayListBypassEnabled;
		this._displayListBypassEnabled = false;
		var result = this.addChild(child);
		this._displayListBypassEnabled = oldBypass;
		return result;
	}
	,addRawChildAt: function(child,index) {
		var oldBypass = this._displayListBypassEnabled;
		this._displayListBypassEnabled = false;
		var result = this.addChildAt(child,index);
		this._displayListBypassEnabled = oldBypass;
		return result;
	}
	,removeRawChild: function(child) {
		var oldBypass = this._displayListBypassEnabled;
		this._displayListBypassEnabled = false;
		var result = this.removeChild(child);
		this._displayListBypassEnabled = oldBypass;
		return result;
	}
	,removeRawChildAt: function(index) {
		var oldBypass = this._displayListBypassEnabled;
		this._displayListBypassEnabled = false;
		var result = this.removeChildAt(index);
		this._displayListBypassEnabled = oldBypass;
		return result;
	}
	,getRawChildByName: function(name) {
		var oldBypass = this._displayListBypassEnabled;
		this._displayListBypassEnabled = false;
		var result = this.getChildByName(name);
		this._displayListBypassEnabled = oldBypass;
		return result;
	}
	,getRawChildAt: function(index) {
		var oldBypass = this._displayListBypassEnabled;
		this._displayListBypassEnabled = false;
		var result = this.getChildAt(index);
		this._displayListBypassEnabled = oldBypass;
		return result;
	}
	,getRawChildIndex: function(child) {
		var oldBypass = this._displayListBypassEnabled;
		this._displayListBypassEnabled = false;
		var result = this.getChildIndex(child);
		this._displayListBypassEnabled = oldBypass;
		return result;
	}
	,setRawChildIndex: function(child,index) {
		var oldBypass = this._displayListBypassEnabled;
		this._displayListBypassEnabled = false;
		this.setChildIndex(child,index);
		this._displayListBypassEnabled = oldBypass;
	}
	,removeChildren: function(beginIndex,endIndex) {
		if(endIndex == null) {
			endIndex = 2147483647;
		}
		if(beginIndex == null) {
			beginIndex = 0;
		}
		if(!this._displayListBypassEnabled) {
			feathers_controls_supportClasses_BaseScrollContainer.prototype.removeChildren.call(this,beginIndex,endIndex);
			return;
		}
		if(endIndex == 2147483647) {
			endIndex = this.items.length - 1;
			if(endIndex < 0) {
				return;
			}
		}
		if(beginIndex > this.items.length - 1) {
			return;
		} else if(endIndex < beginIndex || beginIndex < 0 || endIndex > this.items.length) {
			throw new openfl_errors_RangeError("The supplied index is out of bounds.");
		}
		var numRemovals = endIndex - beginIndex;
		while(numRemovals >= 0) {
			this.removeChildAt(beginIndex);
			--numRemovals;
		}
	}
	,removeRawChildren: function(beginIndex,endIndex) {
		if(endIndex == null) {
			endIndex = 2147483647;
		}
		if(beginIndex == null) {
			beginIndex = 0;
		}
		var oldBypass = this._displayListBypassEnabled;
		this._displayListBypassEnabled = false;
		this.removeChildren(beginIndex,endIndex);
		this._displayListBypassEnabled = oldBypass;
	}
	,readjustLayout: function() {
		this.setInvalid(feathers_core_InvalidationFlag.LAYOUT);
	}
	,initializeScrollContainerTheme: function() {
		feathers_themes_steel_components_SteelScrollContainerStyles.initialize();
	}
	,collectChildren: function(result) {
		if(result == null) {
			return this.items.slice();
		}
		var _g = 0;
		var _g1 = this.items;
		while(_g < _g1.length) {
			var item = _g1[_g];
			++_g;
			result.push(item);
		}
		return result;
	}
	,dispatchEvent: function(event) {
		var oldBypass = this._displayListBypassEnabled;
		this._displayListBypassEnabled = true;
		var result = feathers_controls_supportClasses_BaseScrollContainer.prototype.dispatchEvent.call(this,event);
		this._displayListBypassEnabled = oldBypass;
		return result;
	}
	,validateNow: function() {
		var oldIgnoreChildChanges = this._ignoreChangesButSetFlags;
		this._ignoreChangesButSetFlags = true;
		feathers_controls_supportClasses_BaseScrollContainer.prototype.validateNow.call(this);
		this._ignoreChangesButSetFlags = oldIgnoreChildChanges;
	}
	,update: function() {
		this._ignoreChangesButSetFlags = false;
		var layoutInvalid = this.isInvalid(feathers_core_InvalidationFlag.LAYOUT);
		var stylesInvalid = this.isInvalid(feathers_core_InvalidationFlag.STYLES);
		if(layoutInvalid || stylesInvalid) {
			this.refreshLayout();
		}
		var oldBypass = this._displayListBypassEnabled;
		this._displayListBypassEnabled = false;
		var oldIgnoreChildChanges = this._ignoreChildChanges;
		this._ignoreChildChanges = true;
		feathers_controls_supportClasses_BaseScrollContainer.prototype.update.call(this);
		this._ignoreChildChanges = oldIgnoreChildChanges;
		this._displayListBypassEnabled = oldBypass;
	}
	,measure: function() {
		var needsWidth = this.get_explicitWidth() == null;
		var needsHeight = this.get_explicitHeight() == null;
		var needsMinWidth = this.get_explicitMinWidth() == null;
		var needsMinHeight = this.get_explicitMinHeight() == null;
		var needsMaxWidth = this.get_explicitMaxWidth() == null;
		var needsMaxHeight = this.get_explicitMaxHeight() == null;
		if(!needsWidth && !needsHeight && !needsMinWidth && !needsMinHeight && !needsMaxWidth && !needsMaxHeight) {
			return false;
		}
		if(this._autoSizeMode == feathers_layout_AutoSizeMode.STAGE && this.stage != null) {
			var topLeft = this.globalToLocal(new openfl_geom_Point());
			var bottomRight = this.globalToLocal(new openfl_geom_Point(this.stage.stageWidth,this.stage.stageHeight));
			var stageWidth = bottomRight.x - topLeft.x;
			var stageHeight = bottomRight.y - topLeft.y;
			return this.saveMeasurements(stageWidth,stageHeight,stageWidth,stageHeight);
		}
		return feathers_controls_supportClasses_BaseScrollContainer.prototype.measure.call(this);
	}
	,refreshViewPortBoundsForMeasurement: function() {
		var oldBypass = this._displayListBypassEnabled;
		this._displayListBypassEnabled = true;
		feathers_controls_supportClasses_BaseScrollContainer.prototype.refreshViewPortBoundsForMeasurement.call(this);
		this._displayListBypassEnabled = oldBypass;
	}
	,refreshViewPortBoundsForLayout: function() {
		var oldBypass = this._displayListBypassEnabled;
		this._displayListBypassEnabled = true;
		feathers_controls_supportClasses_BaseScrollContainer.prototype.refreshViewPortBoundsForLayout.call(this);
		this._displayListBypassEnabled = oldBypass;
	}
	,refreshScrollerValues: function() {
		feathers_controls_supportClasses_BaseScrollContainer.prototype.refreshScrollerValues.call(this);
		if(js_Boot.__implements(this.get_layout(),feathers_layout_IScrollLayout)) {
			var scrollLayout = this.get_layout();
			this.scroller.forceElasticTop = scrollLayout.get_elasticTop();
			this.scroller.forceElasticRight = scrollLayout.get_elasticRight();
			this.scroller.forceElasticBottom = scrollLayout.get_elasticBottom();
			this.scroller.forceElasticLeft = scrollLayout.get_elasticLeft();
		} else {
			this.scroller.forceElasticTop = false;
			this.scroller.forceElasticRight = false;
			this.scroller.forceElasticBottom = false;
			this.scroller.forceElasticLeft = false;
		}
		this.scroller.snapPositionsX = this.layoutViewPort.get_snapPositionsX();
		this.scroller.snapPositionsY = this.layoutViewPort.get_snapPositionsY();
	}
	,needsScrollMeasurement: function() {
		return js_Boot.__implements(this.get_layout(),feathers_layout_IScrollLayout);
	}
	,refreshLayout: function() {
		this.layoutViewPort.set_manageChildVisibility(this._manageChildVisibility);
		this.layoutViewPort.set_layout(this.get_layout());
	}
	,scrollContainer_addedToStageHandler: function(event) {
		if(this._autoSizeMode == feathers_layout_AutoSizeMode.STAGE) {
			this.setInvalid(feathers_core_InvalidationFlag.SIZE);
			this.addEventListener("removedFromStage",$bind(this,this.scrollContainer_removedFromStageHandler));
			this.stage.addEventListener("resize",$bind(this,this.scrollContainer_stage_resizeHandler),false,0,true);
		}
	}
	,scrollContainer_removedFromStageHandler: function(event) {
		this.removeEventListener("removedFromStage",$bind(this,this.scrollContainer_removedFromStageHandler));
		this.stage.removeEventListener("resize",$bind(this,this.scrollContainer_stage_resizeHandler));
	}
	,scrollContainer_stage_resizeHandler: function(event) {
		this.setInvalid(feathers_core_InvalidationFlag.SIZE);
	}
	,scrollContainer_child_layoutDataChangeHandler: function(event) {
		if(this._ignoreChildChanges) {
			return;
		}
		if(this._ignoreChangesButSetFlags) {
			this.setInvalidationFlag(feathers_core_InvalidationFlag.LAYOUT);
			return;
		}
		this.setInvalid(feathers_core_InvalidationFlag.LAYOUT);
	}
	,scrollContainer_child_resizeHandler: function(event) {
		if(this._ignoreChildChanges) {
			return;
		}
		if(this._ignoreChangesButSetFlags) {
			this.setInvalidationFlag(feathers_core_InvalidationFlag.LAYOUT);
			return;
		}
		this.setInvalid(feathers_core_InvalidationFlag.LAYOUT);
	}
	,scrollContainer_child_removedHandler: function(event) {
		if(this._ignoreRemovedEvent || openfl_utils_Object.__neq(event.target,event.currentTarget)) {
			return;
		}
		var child = js_Boot.__cast(event.currentTarget , openfl_display_DisplayObject);
		this.removeChildInternal(child,false);
	}
	,get_styleContext: function() {
		return feathers_controls_ScrollContainer;
	}
	,__layout: null
	,get_layout: function() {
		return this.__layout;
	}
	,set_layout: function(value) {
		if(!this.setStyle("layout")) {
			return this.__layout;
		}
		if(this.__layout == value) {
			return this.__layout;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_layout);
		this.__layout = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__layout;
	}
	,clearStyle_layout: function() {
		this.set_layout(null);
		return this.get_layout();
	}
	,__class__: feathers_controls_ScrollContainer
	,__properties__: $extend(feathers_controls_supportClasses_BaseScrollContainer.prototype.__properties__,{get_numRawChildren:"get_numRawChildren",set_manageChildVisibility:"set_manageChildVisibility",get_manageChildVisibility:"get_manageChildVisibility",set_autoSizeMode:"set_autoSizeMode",get_autoSizeMode:"get_autoSizeMode",set_childFocusEnabled:"set_childFocusEnabled",get_childFocusEnabled:"get_childFocusEnabled",set_xmlContent:"set_xmlContent",get_xmlContent:"get_xmlContent",set_layout:"set_layout",get_layout:"get_layout"})
});
var feathers_core_IFocusExtras = function() { };
$hxClasses["feathers.core.IFocusExtras"] = feathers_core_IFocusExtras;
feathers_core_IFocusExtras.__name__ = "feathers.core.IFocusExtras";
feathers_core_IFocusExtras.__isInterface__ = true;
feathers_core_IFocusExtras.__interfaces__ = [feathers_core_IFocusManagerAware];
feathers_core_IFocusExtras.prototype = {
	get_focusExtrasBefore: null
	,get_focusExtrasAfter: null
	,__class__: feathers_core_IFocusExtras
	,__properties__: {get_focusExtrasAfter:"get_focusExtrasAfter",get_focusExtrasBefore:"get_focusExtrasBefore"}
};
var feathers_controls_Panel = function() {
	this._focusExtrasAfter = [];
	this._focusExtrasBefore = [];
	this._footer = null;
	this._footerMeasurements = null;
	this._ignoreFooterResize = false;
	this._header = null;
	this._headerMeasurements = null;
	this._ignoreHeaderResize = false;
	this.initializePanelTheme();
	feathers_controls_ScrollContainer.call(this);
};
$hxClasses["feathers.controls.Panel"] = feathers_controls_Panel;
feathers_controls_Panel.__name__ = "feathers.controls.Panel";
feathers_controls_Panel.__interfaces__ = [feathers_core_IFocusExtras];
feathers_controls_Panel.__super__ = feathers_controls_ScrollContainer;
feathers_controls_Panel.prototype = $extend(feathers_controls_ScrollContainer.prototype,{
	_ignoreHeaderResize: null
	,_headerMeasurements: null
	,_header: null
	,get_header: function() {
		return this._header;
	}
	,set_header: function(value) {
		if(this._header == value) {
			return this._header;
		}
		if(this._header != null) {
			this._header.removeEventListener("resize",$bind(this,this.panel_header_resizeHandler));
			HxOverrides.remove(this._focusExtrasBefore,this._header);
			this.removeRawChild(this._header);
		}
		this._header = value;
		if(this._header != null) {
			this._focusExtrasBefore.push(this._header);
			var index = this.layoutViewPort != null ? this.getRawChildIndex(this.layoutViewPort) + 1 : 0;
			this.addRawChildAt(this._header,index);
			if(js_Boot.__implements(this._header,feathers_core_IUIControl)) {
				this._header.initializeNow();
			}
			if(this._headerMeasurements == null) {
				this._headerMeasurements = new feathers_layout_Measurements(this._header);
			} else {
				this._headerMeasurements.save(this._header);
			}
			this._header.addEventListener("resize",$bind(this,this.panel_header_resizeHandler),false,0,true);
		} else {
			this._headerMeasurements = null;
		}
		this.setInvalid(feathers_core_InvalidationFlag.LAYOUT);
		return this._header;
	}
	,_ignoreFooterResize: null
	,_footerMeasurements: null
	,_footer: null
	,get_footer: function() {
		return this._footer;
	}
	,set_footer: function(value) {
		if(this._footer == value) {
			return this._footer;
		}
		if(this._footer != null) {
			this._footer.removeEventListener("resize",$bind(this,this.panel_footer_resizeHandler));
			HxOverrides.remove(this._focusExtrasAfter,this._footer);
			this.removeRawChild(this._footer);
		}
		this._footer = value;
		if(this._footer != null) {
			this._focusExtrasAfter.push(this._footer);
			this.addRawChild(this._footer);
			if(js_Boot.__implements(this._footer,feathers_core_IUIControl)) {
				this._footer.initializeNow();
			}
			if(this._footerMeasurements == null) {
				this._footerMeasurements = new feathers_layout_Measurements(this._footer);
			} else {
				this._footerMeasurements.save(this._footer);
			}
			this._footer.addEventListener("resize",$bind(this,this.panel_footer_resizeHandler),false,0,true);
		} else {
			this._footerMeasurements = null;
		}
		this.setInvalid(feathers_core_InvalidationFlag.LAYOUT);
		return this._footer;
	}
	,_focusExtrasBefore: null
	,get_focusExtrasBefore: function() {
		return this._focusExtrasBefore;
	}
	,_focusExtrasAfter: null
	,get_focusExtrasAfter: function() {
		return this._focusExtrasAfter;
	}
	,dispose: function() {
		if(this._header != null) {
			this.set_header(null);
		}
		if(this._footer != null) {
			this.set_footer(null);
		}
		feathers_controls_ScrollContainer.prototype.dispose.call(this);
	}
	,initializePanelTheme: function() {
		feathers_themes_steel_components_SteelPanelStyles.initialize();
	}
	,update: function() {
		this._ignoreChangesButSetFlags = false;
		feathers_controls_ScrollContainer.prototype.update.call(this);
		var oldIgnoreHeaderResize = this._ignoreHeaderResize;
		this._ignoreHeaderResize = true;
		this.layoutHeader();
		this._ignoreHeaderResize = oldIgnoreHeaderResize;
		var oldIgnoreFooterResize = this._ignoreFooterResize;
		this._ignoreFooterResize = true;
		this.layoutFooter();
		this._ignoreFooterResize = oldIgnoreFooterResize;
	}
	,calculateViewPortOffsets: function(forceScrollBars,useActualBounds) {
		if(this._header != null) {
			var oldIgnoreHeaderResize = this._ignoreHeaderResize;
			this._ignoreHeaderResize = true;
			if(this._headerMeasurements != null) {
				this._headerMeasurements.restore(this._header);
			}
			if(useActualBounds) {
				this._header.set_width(this.actualWidth - this.get_paddingLeft() - this.get_paddingRight());
			} else if(this.get_explicitWidth() != null) {
				this._header.set_width(this.get_explicitWidth() - this.get_paddingLeft() - this.get_paddingRight());
			}
			if(js_Boot.__implements(this._header,feathers_core_IValidating)) {
				this._header.validateNow();
			}
			this.topViewPortOffset += this._header.get_height();
			this.chromeMeasuredWidth = Math.max(this.chromeMeasuredWidth,this._header.get_width());
			if(js_Boot.__implements(this._header,feathers_core_IMeasureObject)) {
				var measureHeader = this._header;
				this.chromeMeasuredMinWidth = Math.max(this.chromeMeasuredMinWidth,measureHeader.get_minWidth());
			}
			this._ignoreHeaderResize = oldIgnoreHeaderResize;
		}
		if(this._footer != null) {
			var oldIgnoreFooterResize = this._ignoreFooterResize;
			this._ignoreFooterResize = true;
			if(this._footerMeasurements != null) {
				this._footerMeasurements.restore(this._footer);
			}
			if(useActualBounds) {
				this._footer.set_width(this.actualWidth - this.get_paddingLeft() - this.get_paddingRight());
			} else if(this.get_explicitWidth() != null) {
				this._footer.set_width(this.get_explicitWidth() - this.get_paddingLeft() - this.get_paddingRight());
			}
			if(js_Boot.__implements(this._footer,feathers_core_IValidating)) {
				this._footer.validateNow();
			}
			this.bottomViewPortOffset += this._footer.get_height();
			this.chromeMeasuredWidth = Math.max(this.chromeMeasuredWidth,this._footer.get_width());
			if(js_Boot.__implements(this._footer,feathers_core_IMeasureObject)) {
				var measureFooter = this._footer;
				this.chromeMeasuredMinWidth = Math.max(this.chromeMeasuredMinWidth,measureFooter.get_minWidth());
			}
			this._ignoreFooterResize = oldIgnoreFooterResize;
		}
		feathers_controls_ScrollContainer.prototype.calculateViewPortOffsets.call(this,forceScrollBars,useActualBounds);
	}
	,layoutHeader: function() {
		if(this._header == null) {
			return;
		}
		this._header.set_x(this.get_paddingLeft());
		this._header.set_y(this.get_paddingTop());
		this._header.set_width(this.actualWidth - this.get_paddingLeft() - this.get_paddingRight());
		if(js_Boot.__implements(this._header,feathers_core_IValidating)) {
			this._header.validateNow();
		}
	}
	,layoutFooter: function() {
		if(this._footer == null) {
			return;
		}
		this._footer.set_x(this.get_paddingLeft());
		this._footer.set_width(this.actualWidth - this.get_paddingLeft() - this.get_paddingRight());
		if(js_Boot.__implements(this._footer,feathers_core_IValidating)) {
			this._footer.validateNow();
		}
		this._footer.set_y(this.actualHeight - this._footer.get_height() - this.get_paddingBottom());
	}
	,panel_header_resizeHandler: function(event) {
		if(this._ignoreHeaderResize) {
			return;
		}
		if(this._headerMeasurements != null) {
			this._headerMeasurements.save(this._header);
		}
		this.setInvalid(feathers_core_InvalidationFlag.SIZE);
	}
	,panel_footer_resizeHandler: function(event) {
		if(this._ignoreFooterResize) {
			return;
		}
		if(this._footerMeasurements != null) {
			this._footerMeasurements.save(this._footer);
		}
		this.setInvalid(feathers_core_InvalidationFlag.SIZE);
	}
	,get_styleContext: function() {
		return feathers_controls_Panel;
	}
	,__class__: feathers_controls_Panel
	,__properties__: $extend(feathers_controls_ScrollContainer.prototype.__properties__,{get_focusExtrasAfter:"get_focusExtrasAfter",get_focusExtrasBefore:"get_focusExtrasBefore",set_footer:"set_footer",get_footer:"get_footer",set_header:"set_header",get_header:"get_header"})
});
var com_tilbuci_ui_window_PopupWindow = function(ac,tit,wd,ht,tabs,close,notes) {
	if(notes == null) {
		notes = false;
	}
	if(close == null) {
		close = true;
	}
	if(tabs == null) {
		tabs = true;
	}
	if(ht == null) {
		ht = 0;
	}
	if(wd == null) {
		wd = 0;
	}
	this._withTabs = false;
	this._padding = 10;
	this._interfaces = [];
	feathers_controls_Panel.call(this);
	this.ui = new com_tilbuci_ui_base_InterfaceFactory(this._padding);
	this.set_backgroundSkin(new com_tilbuci_ui_base_BackgroundSkin(3684408));
	this.set_layout(new feathers_layout_AnchorLayout());
	this.setPadding(0);
	this._ac = ac;
	if(wd > 0) {
		this.set_width(wd);
	} else {
		this.set_width(500);
	}
	if(ht > 0) {
		this.set_height(ht);
	} else {
		this.set_height(400);
	}
	this._head = new feathers_controls_Header();
	this._head.set_text(tit);
	this.set_header(this._head);
	var hdbuttons = new feathers_controls_LayoutGroup();
	var btlay = new feathers_layout_HorizontalLayout();
	btlay.set_gap(10);
	hdbuttons.set_layout(btlay);
	if(notes) {
		this._btNotes = new feathers_controls_Button();
		var bmp = new openfl_display_Bitmap(openfl_utils_Assets.getBitmapData("btNotes"));
		bmp.set_width(bmp.set_height(20));
		bmp.smoothing = true;
		this._btNotes.set_icon(bmp);
		this._btNotes.set_width(40);
		this._btNotes.set_height(30);
		this._btNotes.addEventListener("trigger",$bind(this,this.notesWindow));
		hdbuttons.addChild(this._btNotes);
	}
	if(close) {
		this._btClose = new feathers_controls_Button();
		var bmp = new openfl_display_Bitmap(openfl_utils_Assets.getBitmapData("btClose"));
		bmp.set_width(bmp.set_height(20));
		bmp.smoothing = true;
		this._btClose.set_icon(bmp);
		this._btClose.set_width(40);
		this._btClose.set_height(30);
		this._btClose.addEventListener("trigger",$bind(this,this.closeWindow));
		hdbuttons.addChild(this._btClose);
	}
	this._head.set_rightView(hdbuttons);
	this._tabs = new feathers_controls_navigators_TabNavigator();
	this._tabs.set_dataProvider(new feathers_data_ArrayCollection());
	this._tabs.set_layoutData(feathers_layout_AnchorLayoutData.fill());
	this._tabs.addEventListener("change",$bind(this,this.onTab));
	if(tabs) {
		this.addChild(this._tabs);
	}
	this._vLayout = new feathers_layout_VerticalLayout();
	this._vLayout.setPadding(0);
	this._vLayout.set_gap(0);
	this._vLayout.set_verticalAlign(feathers_layout_VerticalAlign.TOP);
	this._vLayout.set_horizontalAlign(feathers_layout_HorizontalAlign.LEFT);
	this._forms = new feathers_controls_ScrollContainer();
	this._forms.set_backgroundSkin(new com_tilbuci_ui_base_BackgroundSkin());
	this._forms.set_layout(this._vLayout);
	this._forms.set_width(this.get_width());
	if(!tabs) {
		this.addChild(this._forms);
	}
	this._withTabs = tabs;
	if(this.stage != null) {
		this.initialize();
	} else {
		this.addEventListener("addedToStage",$bind(this,this.startInterface));
	}
};
$hxClasses["com.tilbuci.ui.window.PopupWindow"] = com_tilbuci_ui_window_PopupWindow;
com_tilbuci_ui_window_PopupWindow.__name__ = "com.tilbuci.ui.window.PopupWindow";
com_tilbuci_ui_window_PopupWindow.__super__ = feathers_controls_Panel;
com_tilbuci_ui_window_PopupWindow.prototype = $extend(feathers_controls_Panel.prototype,{
	_head: null
	,_btClose: null
	,_btNotes: null
	,_tabs: null
	,_forms: null
	,_interfaces: null
	,_ac: null
	,_vLayout: null
	,_padding: null
	,_withTabs: null
	,ui: null
	,acStart: function() {
	}
	,startInterface: function(evt) {
		if(this.hasEventListener("addedToStage")) {
			this.removeEventListener("addedToStage",$bind(this,this.startInterface));
		}
		this.redraw();
	}
	,addForm: function(tit,form) {
		form.set_width(this.get_width());
		form.set_minHeight(this.get_height() - 2 * this._padding);
		var c = js_Boot.getClass(form);
		if(c.__name__ == "com.tilbuci.ui.base.InterfaceColumns") {
			var cols = form;
			cols.left.set_width(cols.right.set_width(this.get_width() / 2));
		}
		this._interfaces.push(form);
		if(this._withTabs) {
			this._tabs.get_dataProvider().add(feathers_controls_navigators_TabItem.withDisplayObject(tit,form));
		} else {
			this._forms.addChild(form);
		}
	}
	,kill: function() {
		this.removeEventListener("addedToStage",$bind(this,this.redraw));
		this._tabs.removeEventListener("change",$bind(this,this.onTab));
		this.removeChildren();
		while(this._interfaces.length > 0) this._interfaces.shift();
		this._interfaces = null;
		this._head.removeChildren();
		this._head = null;
		this._btClose.removeChildren();
		this._btClose = null;
		this._tabs.removeChildren();
		this._tabs.removeAllItems();
		this._tabs = null;
		this._forms.removeChildren();
		this._forms = null;
		this.ui.kill();
		this.ui = null;
		this._ac = null;
	}
	,redraw: function(evt) {
		var _g = 0;
		var _g1 = this._interfaces.length;
		while(_g < _g1) {
			var n = _g++;
			this._interfaces[n].set_width(this.get_width());
			this._interfaces[n].set_minHeight(this.get_height() - 2 * this._padding);
			var c = js_Boot.getClass(this._interfaces[n]);
			if(c.__name__ == "com.tilbuci.ui.base.InterfaceColumns") {
				var cols = this._interfaces[n];
				cols.left.set_width(cols.right.set_width(this.get_width() / 2));
			}
		}
		this.ui.redraw();
	}
	,action: function(ac,data) {
	}
	,closeWindow: function(evt) {
		feathers_core_PopUpManager.removePopUp(this);
		if(this._ac != null) {
			this._ac("window-close");
		}
	}
	,notesWindow: function(evt) {
		if(this._ac != null) {
			this._ac("window-notes");
		}
	}
	,onTab: function(evt) {
		this.redraw();
	}
	,__class__: com_tilbuci_ui_window_PopupWindow
});
var com_tilbuci_plugin_PluginWindow = function(title,wd,ht,tabs) {
	if(tabs == null) {
		tabs = false;
	}
	com_tilbuci_ui_window_PopupWindow.call(this,null,title,wd,ht,tabs);
};
$hxClasses["com.tilbuci.plugin.PluginWindow"] = com_tilbuci_plugin_PluginWindow;
com_tilbuci_plugin_PluginWindow.__name__ = "com.tilbuci.plugin.PluginWindow";
com_tilbuci_plugin_PluginWindow.__super__ = com_tilbuci_ui_window_PopupWindow;
com_tilbuci_plugin_PluginWindow.prototype = $extend(com_tilbuci_ui_window_PopupWindow.prototype,{
	__class__: com_tilbuci_plugin_PluginWindow
});
var com_tilbuci_plugin_SystemInfo = function(target) {
	this.orientation = "";
	this.displayMultiply = 1;
	this.displaySmaller = 0;
	this.displayBigger = 0;
	this.keyframeCurrent = 0;
	this.keyframeTotal = 0;
	this.sceneId = "";
	this.sceneName = "";
	this.movieId = "";
	this.movieName = "";
	openfl_events_EventDispatcher.call(this,target);
};
$hxClasses["com.tilbuci.plugin.SystemInfo"] = com_tilbuci_plugin_SystemInfo;
com_tilbuci_plugin_SystemInfo.__name__ = "com.tilbuci.plugin.SystemInfo";
com_tilbuci_plugin_SystemInfo.__super__ = openfl_events_EventDispatcher;
com_tilbuci_plugin_SystemInfo.prototype = $extend(openfl_events_EventDispatcher.prototype,{
	movieName: null
	,movieId: null
	,sceneName: null
	,sceneId: null
	,keyframeTotal: null
	,keyframeCurrent: null
	,displayBigger: null
	,displaySmaller: null
	,displayMultiply: null
	,orientation: null
	,kill: function() {
		this.movieName = this.movieId = null;
		this.sceneName = this.sceneId = null;
	}
	,onNewMovie: function(nm,id,bs,ss) {
		this.movieName = nm;
		this.movieId = id;
		this.displayBigger = bs;
		this.displaySmaller = ss;
		this.dispatchEvent(new com_tilbuci_plugin_PluginEvent("movieload"));
	}
	,onNewScene: function(nm,id,kfs) {
		this.sceneName = nm;
		this.sceneId = id;
		this.keyframeTotal = kfs;
		this.keyframeCurrent = 0;
		this.dispatchEvent(new com_tilbuci_plugin_PluginEvent("sceneload"));
	}
	,onNewKeyframe: function(kf) {
		this.keyframeCurrent = kf;
		this.dispatchEvent(new com_tilbuci_plugin_PluginEvent("keyframeload"));
	}
	,onDisplayResize: function(or,mt) {
		this.orientation = or;
		this.displayMultiply = mt;
		this.dispatchEvent(new com_tilbuci_plugin_PluginEvent("displayresize"));
	}
	,__class__: com_tilbuci_plugin_SystemInfo
});
var com_tilbuci_script_ActionInfo = function() {
	this._mnPlacement = new haxe_ds_StringMap();
	this._scDirections = new haxe_ds_StringMap();
	this._mvOrigins = new haxe_ds_StringMap();
	this.selScenes = [];
	this.scenes = new haxe_ds_StringMap();
	this.selMovies = [];
	this.movies = new haxe_ds_StringMap();
	this.groups = [];
	var _g = new haxe_ds_StringMap();
	var value = com_tilbuci_data_Global.ln.get("window-movieprop-ornone");
	_g.h["none"] = value;
	var value = com_tilbuci_data_Global.ln.get("window-movieprop-oralpha");
	_g.h["alpha"] = value;
	var value = com_tilbuci_data_Global.ln.get("window-movieprop-orcenter");
	_g.h["center"] = value;
	var value = com_tilbuci_data_Global.ln.get("window-movieprop-ortop");
	_g.h["top"] = value;
	var value = com_tilbuci_data_Global.ln.get("window-movieprop-ortopkeep");
	_g.h["topkeep"] = value;
	var value = com_tilbuci_data_Global.ln.get("window-movieprop-orbottom");
	_g.h["bottom"] = value;
	var value = com_tilbuci_data_Global.ln.get("window-movieprop-orbottomkeep");
	_g.h["bottomkeep"] = value;
	var value = com_tilbuci_data_Global.ln.get("window-movieprop-orleft");
	_g.h["left"] = value;
	var value = com_tilbuci_data_Global.ln.get("window-movieprop-orleftkeep");
	_g.h["leftkeep"] = value;
	var value = com_tilbuci_data_Global.ln.get("window-movieprop-orright");
	_g.h["righ"] = value;
	var value = com_tilbuci_data_Global.ln.get("window-movieprop-orrightkeep");
	_g.h["rightkeep"] = value;
	this._mvOrigins = _g;
	var _g = new haxe_ds_StringMap();
	var value = com_tilbuci_data_Global.ln.get("window-movieprop-input-opup");
	_g.h["up"] = value;
	var value = com_tilbuci_data_Global.ln.get("window-movieprop-input-opdown");
	_g.h["down"] = value;
	var value = com_tilbuci_data_Global.ln.get("window-movieprop-input-opleft");
	_g.h["left"] = value;
	var value = com_tilbuci_data_Global.ln.get("window-movieprop-input-opright");
	_g.h["right"] = value;
	var value = com_tilbuci_data_Global.ln.get("window-movieprop-input-opnin");
	_g.h["nin"] = value;
	var value = com_tilbuci_data_Global.ln.get("window-movieprop-input-opnout");
	_g.h["nout"] = value;
	this._scDirections = _g;
	var _g = new haxe_ds_StringMap();
	var value = com_tilbuci_data_Global.ln.get("placement-center");
	_g.h["center"] = value;
	var value = com_tilbuci_data_Global.ln.get("placement-centerleft");
	_g.h["centerleft"] = value;
	var value = com_tilbuci_data_Global.ln.get("placement-centerright");
	_g.h["centerright"] = value;
	var value = com_tilbuci_data_Global.ln.get("placement-top");
	_g.h["top"] = value;
	var value = com_tilbuci_data_Global.ln.get("placement-topleft");
	_g.h["topleft"] = value;
	var value = com_tilbuci_data_Global.ln.get("placement-topright");
	_g.h["topright"] = value;
	var value = com_tilbuci_data_Global.ln.get("placement-bottom");
	_g.h["bottom"] = value;
	var value = com_tilbuci_data_Global.ln.get("placement-bottomleft");
	_g.h["bottomleft"] = value;
	var value = com_tilbuci_data_Global.ln.get("placement-bottomright");
	_g.h["bottomright"] = value;
	var value = com_tilbuci_data_Global.ln.get("placement-absolute");
	_g.h["absolute"] = value;
	this._mnPlacement = _g;
	this.groups.push(new com_tilbuci_script_ActionInfoGroup(com_tilbuci_data_Global.ln.get("window-acbmovie-title"),[{ n : com_tilbuci_data_Global.ln.get("acinfo-movieload"), a : "movie.load", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-movieload-p1"), v : "movies"}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-sceneload"), a : "scene.load", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-sceneload-p1"), v : "scenes"}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-scenehistoryback"), a : "scene.historyback", p : [], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-scenenavigate"), a : "scene.navigate", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-scenenavigate-p1"), v : "navigation"}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-scenepause"), a : "scene.pause", p : [], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-sceneplay"), a : "scene.play", p : [], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-sceneplaypause"), a : "scene.playpause", p : [], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-scenenextkf"), a : "scene.nextkeyframe", p : [], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-scenepreviouskf"), a : "scene.previouskeyframe", p : [], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-scenefirstkf"), a : "scene.loadfirstkeyframe", p : [], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-scenelastkf"), a : "scene.loadlastkeyframe", p : [], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-sceneloadkf"), a : "scene.loadkeyframe", p : [{ t : "i", n : com_tilbuci_data_Global.ln.get("acinfo-sceneloadkf-p1"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-sceneshake"), a : "scene.shake", p : [{ t : "f", n : com_tilbuci_data_Global.ln.get("acinfo-sceneshake-p1"), v : ""},{ t : "f", n : com_tilbuci_data_Global.ln.get("acinfo-sceneshake-p2"), v : ""}], e : ["end"]}]));
	this.groups.push(new com_tilbuci_script_ActionInfoGroup(com_tilbuci_data_Global.ln.get("window-acbbool-title"),[{ n : com_tilbuci_data_Global.ln.get("acinfo-boolset"), a : "bool.set", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-boolset-p1"), v : ""},{ t : "b", n : com_tilbuci_data_Global.ln.get("acinfo-boolset-p2"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-ifbool"), a : "if.bool", p : [{ t : "b", n : com_tilbuci_data_Global.ln.get("acinfo-ifbool-p1"), v : ""},{ t : "b", n : com_tilbuci_data_Global.ln.get("acinfo-ifbool-p2"), v : ""}], e : ["then","else"]},{ n : com_tilbuci_data_Global.ln.get("acinfo-boolsetinverse"), a : "bool.setinverse", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-boolsetinverse-p1"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-ifboolset"), a : "if.boolset", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-ifboolset-p1"), v : ""}], e : ["then","else"]},{ n : com_tilbuci_data_Global.ln.get("acinfo-boolclear"), a : "bool.clear", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-boolclear-p1"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-boolclearall"), a : "bool.clearall", p : [], e : []}]));
	this.groups.push(new com_tilbuci_script_ActionInfoGroup(com_tilbuci_data_Global.ln.get("window-acbstring-title"),[{ n : com_tilbuci_data_Global.ln.get("acinfo-stringset"), a : "string.set", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-stringset-p1"), v : ""},{ t : "e", n : com_tilbuci_data_Global.ln.get("acinfo-stringset-p2"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-stringconcat"), a : "string.concat", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-stringconcat-p1"), v : ""},{ t : "", n : com_tilbuci_data_Global.ln.get("acinfo-stringconcat-p2"), v : ""},{ t : "", n : com_tilbuci_data_Global.ln.get("acinfo-stringconcat-p3"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-stringreplace"), a : "string.replace", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-stringreplace-p1"), v : ""},{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-stringreplace-p2"), v : ""},{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-stringreplace-p3"), v : ""},{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-stringreplace-p4"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-stringclear"), a : "string.clear", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-stringclear-p1"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-stringtoint"), a : "string.toint", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-stringtoint-p1"), v : ""},{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-stringtoint-p2"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-stringtofloat"), a : "string.tofloat", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-stringtofloat-p1"), v : ""},{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-stringtofloat-p2"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-stringsload"), a : "string.loadfile", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-stringsload-p1"), v : ""}], e : ["success","error"]},{ n : com_tilbuci_data_Global.ln.get("acinfo-stringsetgroup"), a : "string.setgroup", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-stringsetgroup-p1"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-stringclearall"), a : "string.clearall", p : [], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-stringsetglobal"), a : "string.setglobal", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-stringsetglobal-p1"), v : ""},{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-stringsetglobal-p2"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-stringclearglobal"), a : "string.clearglobal", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-stringclearglobal-p1"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-ifstringsequal"), a : "if.stringsequal", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-ifstringsequal-p1"), v : ""},{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-ifstringsequal-p2"), v : ""}], e : ["then","else"]},{ n : com_tilbuci_data_Global.ln.get("acinfo-ifstringsdifferent"), a : "if.stringsdifferent", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-ifstringsdifferent-p1"), v : ""},{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-ifstringsdifferent-p2"), v : ""}], e : ["then","else"]},{ n : com_tilbuci_data_Global.ln.get("acinfo-ifstringset"), a : "if.stringset", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-ifstringset-p1"), v : ""}], e : ["then","else"]},{ n : com_tilbuci_data_Global.ln.get("acinfo-ifstringcontains"), a : "if.stringcontains", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-ifstringcontains-p1"), v : ""},{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-ifstringcontains-p2"), v : ""}], e : ["then","else"]},{ n : com_tilbuci_data_Global.ln.get("acinfo-ifstringstartswith"), a : "if.stringstartswith", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-ifstringstartswith-p1"), v : ""},{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-ifstringstartswith-p2"), v : ""}], e : ["then","else"]},{ n : com_tilbuci_data_Global.ln.get("acinfo-ifstringendswith"), a : "if.stringendswith", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-ifstringendswith-p1"), v : ""},{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-ifstringendswith-p2"), v : ""}], e : ["then","else"]},{ n : com_tilbuci_data_Global.ln.get("acinfo-ifstringemail"), a : "if.stringemail", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-ifstringemail-p1"), v : ""}], e : ["then","else"]}]));
	this.groups.push(new com_tilbuci_script_ActionInfoGroup(com_tilbuci_data_Global.ln.get("window-acbint-title"),[{ n : com_tilbuci_data_Global.ln.get("acinfo-intset"), a : "int.set", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-intset-p1"), v : ""},{ t : "f", n : com_tilbuci_data_Global.ln.get("acinfo-intset-p2"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-intsum"), a : "int.sum", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-intsum-p1"), v : ""},{ t : "f", n : com_tilbuci_data_Global.ln.get("acinfo-intsum-p2"), v : ""},{ t : "f", n : com_tilbuci_data_Global.ln.get("acinfo-intsum-p3"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-intsubtract"), a : "int.subtract", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-intsubtract-p1"), v : ""},{ t : "f", n : com_tilbuci_data_Global.ln.get("acinfo-intsubtract-p2"), v : ""},{ t : "f", n : com_tilbuci_data_Global.ln.get("acinfo-intsubtract-p3"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-intmultiply"), a : "int.multiply", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-intmultiply-p1"), v : ""},{ t : "f", n : com_tilbuci_data_Global.ln.get("acinfo-intmultiply-p2"), v : ""},{ t : "f", n : com_tilbuci_data_Global.ln.get("acinfo-intmultiply-p3"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-intdivide"), a : "int.divide", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-intdivide-p1"), v : ""},{ t : "f", n : com_tilbuci_data_Global.ln.get("acinfo-intdivide-p2"), v : ""},{ t : "f", n : com_tilbuci_data_Global.ln.get("acinfo-intdivide-p3"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-intmax"), a : "int.max", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-intmax-p1"), v : ""},{ t : "f", n : com_tilbuci_data_Global.ln.get("acinfo-intmax-p2"), v : ""},{ t : "f", n : com_tilbuci_data_Global.ln.get("acinfo-intmax-p3"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-intmin"), a : "int.min", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-intmin-p1"), v : ""},{ t : "f", n : com_tilbuci_data_Global.ln.get("acinfo-intmin-p2"), v : ""},{ t : "f", n : com_tilbuci_data_Global.ln.get("acinfo-intmin-p3"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-intrandom"), a : "int.random", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-intrandom-p1"), v : ""},{ t : "f", n : com_tilbuci_data_Global.ln.get("acinfo-intrandom-p2"), v : ""},{ t : "f", n : com_tilbuci_data_Global.ln.get("acinfo-intrandom-p3"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-intabs"), a : "int.abs", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-intabs-p1"), v : ""},{ t : "f", n : com_tilbuci_data_Global.ln.get("acinfo-intabs-p2"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-intclear"), a : "int.clear", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-intclear-p1"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-intclearall"), a : "int.clearall", p : [], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-inttofloat"), a : "int.tofloat", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-inttofloat-p1"), v : ""},{ t : "f", n : com_tilbuci_data_Global.ln.get("acinfo-inttofloat-p2"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-inttostring"), a : "int.tostring", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-inttostring-p1"), v : ""},{ t : "f", n : com_tilbuci_data_Global.ln.get("acinfo-inttostring-p2"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-ifintsequal"), a : "if.intsequal", p : [{ t : "f", n : com_tilbuci_data_Global.ln.get("acinfo-ifintsequal-p1"), v : ""},{ t : "f", n : com_tilbuci_data_Global.ln.get("acinfo-ifintsequal-p2"), v : ""}], e : ["then","else"]},{ n : com_tilbuci_data_Global.ln.get("acinfo-ifintsdifferent"), a : "if.intsdifferent", p : [{ t : "f", n : com_tilbuci_data_Global.ln.get("acinfo-ifintsdifferent-p1"), v : ""},{ t : "f", n : com_tilbuci_data_Global.ln.get("acinfo-ifintsdifferent-p2"), v : ""}], e : ["then","else"]},{ n : com_tilbuci_data_Global.ln.get("acinfo-ifintgreater"), a : "if.intgreater", p : [{ t : "f", n : com_tilbuci_data_Global.ln.get("acinfo-ifintgreater-p1"), v : ""},{ t : "f", n : com_tilbuci_data_Global.ln.get("acinfo-ifintgreater-p2"), v : ""}], e : ["then","else"]},{ n : com_tilbuci_data_Global.ln.get("acinfo-ifintlower"), a : "if.intlower", p : [{ t : "f", n : com_tilbuci_data_Global.ln.get("acinfo-ifintlower-p1"), v : ""},{ t : "f", n : com_tilbuci_data_Global.ln.get("acinfo-ifintlower-p2"), v : ""}], e : ["then","else"]},{ n : com_tilbuci_data_Global.ln.get("acinfo-ifintgreaterequal"), a : "if.intgreaterequal", p : [{ t : "f", n : com_tilbuci_data_Global.ln.get("acinfo-ifintgreaterequal-p1"), v : ""},{ t : "f", n : com_tilbuci_data_Global.ln.get("acinfo-ifintgreaterequal-p2"), v : ""}], e : ["then","else"]},{ n : com_tilbuci_data_Global.ln.get("acinfo-ifintlowerequal"), a : "if.intlowerequal", p : [{ t : "f", n : com_tilbuci_data_Global.ln.get("acinfo-ifintlowerequal-p1"), v : ""},{ t : "f", n : com_tilbuci_data_Global.ln.get("acinfo-ifintlowerequal-p2"), v : ""}], e : ["then","else"]},{ n : com_tilbuci_data_Global.ln.get("acinfo-ifintset"), a : "if.intset", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-ifintset-p1"), v : ""}], e : ["then","else"]}]));
	this.groups.push(new com_tilbuci_script_ActionInfoGroup(com_tilbuci_data_Global.ln.get("window-acbfloat-title"),[{ n : com_tilbuci_data_Global.ln.get("acinfo-floatset"), a : "float.set", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-floatset-p1"), v : ""},{ t : "f", n : com_tilbuci_data_Global.ln.get("acinfo-floatset-p2"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-floatsum"), a : "float.sum", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-floatsum-p1"), v : ""},{ t : "f", n : com_tilbuci_data_Global.ln.get("acinfo-floatsum-p2"), v : ""},{ t : "f", n : com_tilbuci_data_Global.ln.get("acinfo-floatsum-p3"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-floatsubtract"), a : "float.subtract", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-floatsubtract-p1"), v : ""},{ t : "f", n : com_tilbuci_data_Global.ln.get("acinfo-floatsubtract-p2"), v : ""},{ t : "f", n : com_tilbuci_data_Global.ln.get("acinfo-floatsubtract-p3"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-floatmultiply"), a : "float.multiply", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-floatmultiply-p1"), v : ""},{ t : "f", n : com_tilbuci_data_Global.ln.get("acinfo-floatmultiply-p2"), v : ""},{ t : "f", n : com_tilbuci_data_Global.ln.get("acinfo-floatmultiply-p3"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-floatdivide"), a : "float.divide", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-floatdivide-p1"), v : ""},{ t : "f", n : com_tilbuci_data_Global.ln.get("acinfo-floatdivide-p2"), v : ""},{ t : "f", n : com_tilbuci_data_Global.ln.get("acinfo-floatdivide-p3"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-floatmax"), a : "float.max", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-floatmax-p1"), v : ""},{ t : "f", n : com_tilbuci_data_Global.ln.get("acinfo-floatmax-p2"), v : ""},{ t : "f", n : com_tilbuci_data_Global.ln.get("acinfo-floatmax-p3"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-floatmin"), a : "float.min", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-floatmin-p1"), v : ""},{ t : "f", n : com_tilbuci_data_Global.ln.get("acinfo-floatmin-p2"), v : ""},{ t : "f", n : com_tilbuci_data_Global.ln.get("acinfo-floatmin-p3"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-floatrandom"), a : "float.random", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-floatrandom-p1"), v : ""},{ t : "f", n : com_tilbuci_data_Global.ln.get("acinfo-floatrandom-p2"), v : ""},{ t : "f", n : com_tilbuci_data_Global.ln.get("acinfo-floatrandom-p3"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-floatabs"), a : "float.abs", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-floatabs-p1"), v : ""},{ t : "f", n : com_tilbuci_data_Global.ln.get("acinfo-floatabs-p2"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-floatclear"), a : "float.clear", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-floatclear-p1"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-floatclearall"), a : "float.clearall", p : [], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-floattoint"), a : "float.toint", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-floattoint-p1"), v : ""},{ t : "f", n : com_tilbuci_data_Global.ln.get("acinfo-floattoint-p2"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-floattostring"), a : "float.tostring", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-floattostring-p1"), v : ""},{ t : "f", n : com_tilbuci_data_Global.ln.get("acinfo-floattostring-p2"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-iffloatsequal"), a : "if.floatsequal", p : [{ t : "f", n : com_tilbuci_data_Global.ln.get("acinfo-iffloatsequal-p1"), v : ""},{ t : "f", n : com_tilbuci_data_Global.ln.get("acinfo-iffloatsequal-p2"), v : ""}], e : ["then","else"]},{ n : com_tilbuci_data_Global.ln.get("acinfo-iffloatsdifferent"), a : "if.floatsdifferent", p : [{ t : "f", n : com_tilbuci_data_Global.ln.get("acinfo-iffloatsdifferent-p1"), v : ""},{ t : "f", n : com_tilbuci_data_Global.ln.get("acinfo-iffloatsdifferent-p2"), v : ""}], e : ["then","else"]},{ n : com_tilbuci_data_Global.ln.get("acinfo-iffloatgreater"), a : "if.floatgreater", p : [{ t : "f", n : com_tilbuci_data_Global.ln.get("acinfo-iffloatgreater-p1"), v : ""},{ t : "f", n : com_tilbuci_data_Global.ln.get("acinfo-iffloatgreater-p2"), v : ""}], e : ["then","else"]},{ n : com_tilbuci_data_Global.ln.get("acinfo-iffloatlower"), a : "if.floatlower", p : [{ t : "f", n : com_tilbuci_data_Global.ln.get("acinfo-iffloatlower-p1"), v : ""},{ t : "f", n : com_tilbuci_data_Global.ln.get("acinfo-iffloatlower-p2"), v : ""}], e : ["then","else"]},{ n : com_tilbuci_data_Global.ln.get("acinfo-iffloatgreaterequal"), a : "if.floatgreaterequal", p : [{ t : "f", n : com_tilbuci_data_Global.ln.get("acinfo-iffloatgreaterequal-p1"), v : ""},{ t : "f", n : com_tilbuci_data_Global.ln.get("acinfo-iffloatgreaterequal-p2"), v : ""}], e : ["then","else"]},{ n : com_tilbuci_data_Global.ln.get("acinfo-iffloatlowerequal"), a : "if.floatlowerequal", p : [{ t : "f", n : com_tilbuci_data_Global.ln.get("acinfo-iffloatlowerequal-p1"), v : ""},{ t : "f", n : com_tilbuci_data_Global.ln.get("acinfo-iffloatlowerequal-p2"), v : ""}], e : ["then","else"]},{ n : com_tilbuci_data_Global.ln.get("acinfo-iffloatset"), a : "if.floatset", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-iffloatset-p1"), v : ""}], e : ["then","else"]}]));
	this.groups.push(new com_tilbuci_script_ActionInfoGroup(com_tilbuci_data_Global.ln.get("window-acbarray-title"),[{ n : com_tilbuci_data_Global.ln.get("acinfo-arrayload"), a : "array.loadfile", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-arrayload-p1"), v : ""}], e : ["success","error"]},{ n : com_tilbuci_data_Global.ln.get("acinfo-arraycreate"), a : "array.create", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-arraycreate-p1"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-arrayremove"), a : "array.remove", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-arrayremove-p1"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-arraypush"), a : "array.push", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-arraypush-p1"), v : ""},{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-arraypush-p2"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-arrayset"), a : "array.set", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-arrayset-p1"), v : ""},{ t : "i", n : com_tilbuci_data_Global.ln.get("acinfo-arrayset-p2"), v : ""},{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-arrayset-p3"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-arrayget"), a : "array.get", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-arrayget-p1"), v : ""},{ t : "i", n : com_tilbuci_data_Global.ln.get("acinfo-arrayget-p2"), v : ""},{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-arrayget-p3"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-arraygetint"), a : "array.getint", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-arraygetint-p1"), v : ""},{ t : "i", n : com_tilbuci_data_Global.ln.get("acinfo-arraygetint-p2"), v : ""},{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-arraygetint-p3"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-arraygetfloat"), a : "array.getfloat", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-arraygetfloat-p1"), v : ""},{ t : "i", n : com_tilbuci_data_Global.ln.get("acinfo-arraygetfloat-p2"), v : ""},{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-arraygetfloat-p3"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-arraygetbool"), a : "array.getbool", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-arraygetbool-p1"), v : ""},{ t : "i", n : com_tilbuci_data_Global.ln.get("acinfo-arraygetbool-p2"), v : ""},{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-arraygetbool-p3"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-arrayclear"), a : "array.clear", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-arrayclear-p1"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-arraycurrent"), a : "array.current", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-arraycurrent-p1"), v : ""},{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-arraycurrent-p2"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-arraynext"), a : "array.next", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-arraynext-p1"), v : ""},{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-arraynext-p2"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-arrayprevious"), a : "array.previous", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-arrayprevious-p1"), v : ""},{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-arrayprevious-p2"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-arraycurrentint"), a : "array.currentint", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-arraycurrentint-p1"), v : ""},{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-arraycurrentint-p2"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-arraynextint"), a : "array.nextint", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-arraynextint-p1"), v : ""},{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-arraynextint-p2"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-arraypreviousint"), a : "array.previousint", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-arraypreviousint-p1"), v : ""},{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-arraypreviousint-p2"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-arraycurrentfloat"), a : "array.currentfloat", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-arraycurrentfloat-p1"), v : ""},{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-arraycurrentfloat-p2"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-arraynextfloat"), a : "array.nextfloat", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-arraynextfloat-p1"), v : ""},{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-arraynextfloat-p2"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-arraypreviousfloat"), a : "array.previousfloat", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-arraypreviousfloat-p1"), v : ""},{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-arraypreviousfloat-p2"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-arraycurrentbool"), a : "array.currentbool", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-arraycurrentbool-p1"), v : ""},{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-arraycurrentbool-p2"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-arraynextbool"), a : "array.nextbool", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-arraynextbool-p1"), v : ""},{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-arraynextbool-p2"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-arraypreviousbool"), a : "array.previousbool", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-arraypreviousbool-p1"), v : ""},{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-arraypreviousbool-p2"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-arraysetindex"), a : "array.setindex", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-arraysetindex-p1"), v : ""},{ t : "i", n : com_tilbuci_data_Global.ln.get("acinfo-arraysetindex-p2"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-arraygetindex"), a : "array.getindex", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-arraygetindex-p1"), v : ""},{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-arraygetindex-p2"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-arraytostring"), a : "array.tostring", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-arraytostring-p1"), v : ""},{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-arraytostring-p2"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-arrayfromstring"), a : "array.fromstring", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-arrayfromstring-p1"), v : ""},{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-arrayfromstring-p2"), v : ""}], e : []}]));
	this.groups.push(new com_tilbuci_script_ActionInfoGroup(com_tilbuci_data_Global.ln.get("window-acbinstance-title"),[{ n : com_tilbuci_data_Global.ln.get("acinfo-instancemorezoom"), a : "instance.morezoom", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-instancemorezoom-p1"), v : "instances"},{ t : "i", n : com_tilbuci_data_Global.ln.get("acinfo-instancemorezoom-p2"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-instancelesszoom"), a : "instance.lesszoom", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-instancelesszoom-p1"), v : "instances"},{ t : "i", n : com_tilbuci_data_Global.ln.get("acinfo-instancelesszoom-p2"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-instanceclearzoom"), a : "instance.clearzoom", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-instanceclearzoom-p1"), v : "instances"}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-instancemoveup"), a : "instance.moveup", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-instancemoveup-p1"), v : "instances"},{ t : "i", n : com_tilbuci_data_Global.ln.get("acinfo-instancemoveup-p2"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-instancemovedown"), a : "instance.movedown", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-instancemovedown-p1"), v : "instances"},{ t : "i", n : com_tilbuci_data_Global.ln.get("acinfo-instancemovedown-p2"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-instancemoveleft"), a : "instance.moveleft", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-instancemoveleft-p1"), v : "instances"},{ t : "i", n : com_tilbuci_data_Global.ln.get("acinfo-instancemoveleft-p2"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-instancemoveright"), a : "instance.moveright", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-instancemoveright-p1"), v : "instances"},{ t : "i", n : com_tilbuci_data_Global.ln.get("acinfo-instancemoveright-p2"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-instanceclearmove"), a : "instance.clearmove", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-instanceclearmove-p1"), v : "instances"}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-instancestartdrag"), a : "instance.startdrag", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-instancestartdrag-p1"), v : "instances"}], e : ["complete"]},{ n : com_tilbuci_data_Global.ln.get("acinfo-instancestopdrag"), a : "instance.stopdrag", p : [], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-instanceisoverlapping"), a : "instance.isoverlapping", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-instanceisoverlapping-p1"), v : "instances"},{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-instanceisoverlapping-p2"), v : "instances"}], e : ["then","else"]},{ n : com_tilbuci_data_Global.ln.get("acinfo-instancepause"), a : "instance.pause", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-instancepause-p1"), v : "instances"}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-instanceplay"), a : "instance.play", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-instanceplay-p1"), v : "instances"}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-instanceplaypause"), a : "instance.playpause", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-instanceplaypause-p1"), v : "instances"}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-instancestop"), a : "instance.stop", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-instancestop-p1"), v : "instances"}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-instancenext"), a : "instance.next", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-instancenext-p1"), v : "instances"}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-instanceprevious"), a : "instance.previous", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-instanceprevious-p1"), v : "instances"}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-instanceseek"), a : "instance.seek", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-instanceseek-p1"), v : "instances"},{ t : "i", n : com_tilbuci_data_Global.ln.get("acinfo-instanceseek-p2"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-instancezoom"), a : "instance.zoom", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-instancezoom-p1"), v : "instances"}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-instancesetparagraph"), a : "instance.setparagraph", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-instancesetparagraph-p1"), v : "instances"},{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-instancesetparagraph-p2"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-instanceloadasset"), a : "instance.loadasset", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-instanceloadasset-p1"), v : "instances"},{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-instanceloadasset-p2"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-instancesetx"), a : "instance.setx", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-instancesetx-p1"), v : "instances"},{ t : "f", n : com_tilbuci_data_Global.ln.get("acinfo-instancesetx-p2"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-instancesety"), a : "instance.sety", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-instancesety-p1"), v : "instances"},{ t : "f", n : com_tilbuci_data_Global.ln.get("acinfo-instancesety-p2"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-instancesetwidth"), a : "instance.setwidth", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-instancesetwidth-p1"), v : "instances"},{ t : "f", n : com_tilbuci_data_Global.ln.get("acinfo-instancesetwidth-p2"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-instancesetheight"), a : "instance.setheight", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-instancesetheight-p1"), v : "instances"},{ t : "f", n : com_tilbuci_data_Global.ln.get("acinfo-instancesetheight-p2"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-instancesetvisible"), a : "instance.setvisible", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-instancesetvisible-p1"), v : "instances"},{ t : "b", n : com_tilbuci_data_Global.ln.get("acinfo-instancesetvisible-p2"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-instancesetalpha"), a : "instance.setalpha", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-instancesetalpha-p1"), v : "instances"},{ t : "f", n : com_tilbuci_data_Global.ln.get("acinfo-instancesetalpha-p2"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-instancesetwidth"), a : "instance.setwidth", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-instancesetwidth-p1"), v : "instances"},{ t : "f", n : com_tilbuci_data_Global.ln.get("acinfo-instancesetwidth-p2"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-instancesetorder"), a : "instance.setorder", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-instancesetorder-p1"), v : "instances"},{ t : "i", n : com_tilbuci_data_Global.ln.get("acinfo-instancesetorder-p2"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-instancesetcolor"), a : "instance.setcolor", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-instancesetcolor-p1"), v : "instances"},{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-instancesetcolor-p2"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-instancesetcoloralpha"), a : "instance.setcoloralpha", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-instancesetcoloralpha-p1"), v : "instances"},{ t : "f", n : com_tilbuci_data_Global.ln.get("acinfo-instancesetcoloralpha-p2"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-instancesetfont"), a : "instance.setfont", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-instancesetfont-p1"), v : "instances"},{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-instancesetfont-p2"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-instancesetfontsize"), a : "instance.setfontsize", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-instancesetfontsize-p1"), v : "instances"},{ t : "i", n : com_tilbuci_data_Global.ln.get("acinfo-instancesetfontsize-p2"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-instancesetfontalign"), a : "instance.setfontalign", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-instancesetfontalign-p1"), v : "instances"},{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-instancesetfontalign-p2"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-instancesetfontbackground"), a : "instance.setfontbackground", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-instancesetfontbackground-p1"), v : "instances"},{ t : "e", n : com_tilbuci_data_Global.ln.get("acinfo-instancesetfontbackground-p2"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-instancesetfontbold"), a : "instance.setfontbold", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-instancesetfontbold-p1"), v : "instances"},{ t : "b", n : com_tilbuci_data_Global.ln.get("acinfo-instancesetfontbold-p2"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-instancesetfontitalic"), a : "instance.setfontitalic", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-instancesetfontitalic-p1"), v : "instances"},{ t : "b", n : com_tilbuci_data_Global.ln.get("acinfo-instancesetfontitalic-p2"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-instancesetfontcolor"), a : "instance.setfontcolor", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-instancesetfontcolor-p1"), v : "instances"},{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-instancesetfontcolor-p2"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-instancesetfontleading"), a : "instance.setfontleading", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-instancesetfontleading-p1"), v : "instances"},{ t : "i", n : com_tilbuci_data_Global.ln.get("acinfo-instancesetfontleading-p2"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-instancesetvolume"), a : "instance.setvolume", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-instancesetvolume-p1"), v : "instances"},{ t : "f", n : com_tilbuci_data_Global.ln.get("acinfo-instancesetvolume-p2"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-instancesetrotation"), a : "instance.setrotation", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-instancesetrotation-p1"), v : "instances"},{ t : "i", n : com_tilbuci_data_Global.ln.get("acinfo-instancesetrotation-p2"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-instancescrolldown"), a : "instance.scrolldown", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-instancescrolldown-p1"), v : "instances"}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-instancescrollup"), a : "instance.scrollup", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-instancescrollup-p1"), v : "instances"}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-instancescrollbottom"), a : "instance.scrollbottom", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-instancescrollbottom-p1"), v : "instances"}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-instancescrolltop"), a : "instance.scrolltop", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-instancescrolltop-p1"), v : "instances"}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-instanceclearall"), a : "instance.clearall", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-instanceclearall-p1"), v : "instances"}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-instanceclearx"), a : "instance.clearx", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-instanceclearx-p1"), v : "instances"}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-instancecleary"), a : "instance.cleary", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-instancecleary-p1"), v : "instances"}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-instanceclearwidth"), a : "instance.clearwidth", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-instanceclearwidth-p1"), v : "instances"}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-instanceclearheight"), a : "instance.clearheight", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-instanceclearheight-p1"), v : "instances"}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-instanceclearvisible"), a : "instance.clearvisible", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-instanceclearvisible-p1"), v : "instances"}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-instanceclearalpha"), a : "instance.clearalpha", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-instanceclearalpha-p1"), v : "instances"}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-instanceclearwidth"), a : "instance.clearwidth", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-instanceclearwidth-p1"), v : "instances"}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-instanceclearorder"), a : "instance.clearorder", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-instanceclearorder-p1"), v : "instances"}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-instanceclearcolor"), a : "instance.clearcolor", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-instanceclearcolor-p1"), v : "instances"}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-instanceclearcoloralpha"), a : "instance.clearcoloralpha", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-instanceclearcoloralpha-p1"), v : "instances"}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-instanceclearfont"), a : "instance.clearfont", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-instanceclearfont-p1"), v : "instances"}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-instanceclearfontsize"), a : "instance.clearfontsize", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-instanceclearfontsize-p1"), v : "instances"}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-instanceclearfontalign"), a : "instance.clearfontalign", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-instanceclearfontalign-p1"), v : "instances"}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-instanceclearfontbackground"), a : "instance.clearfontbackground", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-instanceclearfontbackground-p1"), v : "instances"}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-instanceclearfontbold"), a : "instance.clearfontbold", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-instanceclearfontbold-p1"), v : "instances"}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-instanceclearfontitalic"), a : "instance.clearfontitalic", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-instanceclearfontitalic-p1"), v : "instances"}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-instanceclearfontcolor"), a : "instance.clearfontcolor", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-instanceclearfontcolor-p1"), v : "instances"}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-instanceclearfontleading"), a : "instance.clearfontleading", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-instanceclearfontleading-p1"), v : "instances"}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-instanceclearvolume"), a : "instance.clearvolume", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-instanceclearvolume-p1"), v : "instances"}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-instanceclearrotation"), a : "instance.clearrotation", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-instanceclearrotation-p1"), v : "instances"}], e : []}]));
	this.groups.push(new com_tilbuci_script_ActionInfoGroup(com_tilbuci_data_Global.ln.get("window-acbdata-title"),[{ n : com_tilbuci_data_Global.ln.get("acinfo-dataevent"), a : "data.event", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-dataevent-p1"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-dataeventclear"), a : "data.eventclear", p : [], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-dataliststates"), a : "data.liststates", p : [], e : ["success","error"]},{ n : com_tilbuci_data_Global.ln.get("acinfo-dataload"), a : "data.load", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-dataload-p1"), v : ""}], e : ["success","error"]},{ n : com_tilbuci_data_Global.ln.get("acinfo-dataloadlocal"), a : "data.loadlocal", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-dataloadlocal-p1"), v : ""}], e : ["success","error"]},{ n : com_tilbuci_data_Global.ln.get("acinfo-dataloadquickstate"), a : "data.loadquickstate", p : [], e : ["success","error"]},{ n : com_tilbuci_data_Global.ln.get("acinfo-dataloadstatelocal"), a : "data.loadstatelocal", p : [], e : ["success","error"]},{ n : com_tilbuci_data_Global.ln.get("acinfo-datasave"), a : "data.save", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-datasave-p1"), v : ""},{ t : "v", n : com_tilbuci_data_Global.ln.get("acinfo-datasave-p2"), v : ""}], e : ["success","error"]},{ n : com_tilbuci_data_Global.ln.get("acinfo-datasavelocal"), a : "data.savelocal", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-datasavelocal-p1"), v : ""},{ t : "v", n : com_tilbuci_data_Global.ln.get("acinfo-datasavelocal-p2"), v : ""}], e : ["success","error"]},{ n : com_tilbuci_data_Global.ln.get("acinfo-datasavestate"), a : "data.savestate", p : [], e : ["success","error"]},{ n : com_tilbuci_data_Global.ln.get("acinfo-datasavequickstate"), a : "data.savequickstate", p : [], e : ["success","error"]},{ n : com_tilbuci_data_Global.ln.get("acinfo-datasavestatelocal"), a : "data.savestatelocal", p : [], e : ["success","error"]}]));
	this.groups.push(new com_tilbuci_script_ActionInfoGroup(com_tilbuci_data_Global.ln.get("window-acbinput-title"),[{ n : com_tilbuci_data_Global.ln.get("acinfo-targetshow"), a : "target.show", p : [], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-targethide"), a : "target.hide", p : [], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-targettoggle"), a : "target.toggle", p : [], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-targetsetposition"), a : "target.setposition", p : [{ t : "i", n : com_tilbuci_data_Global.ln.get("acinfo-targetsetposition-p1"), v : ""},{ t : "i", n : com_tilbuci_data_Global.ln.get("acinfo-targetsetposition-p2"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-targetclear"), a : "target.clear", p : [], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-targetset"), a : "target.set", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-targetset-p1"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-mousehide"), a : "mouse.hide", p : [], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-mouseshow"), a : "mouse.show", p : [], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-inputmessage"), a : "input.message", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-inputmessage-p1"), v : ""},{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-inputmessage-p2"), v : ""}], e : ["ok","cancel"]},{ n : com_tilbuci_data_Global.ln.get("acinfo-inputstring"), a : "input.string", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-inputstring-p1"), v : ""},{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-inputstring-p2"), v : ""}], e : ["ok","cancel"]},{ n : com_tilbuci_data_Global.ln.get("acinfo-inputint"), a : "input.int", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-inputint-p1"), v : ""},{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-inputint-p2"), v : ""},{ t : "i", n : com_tilbuci_data_Global.ln.get("acinfo-inputint-p3"), v : ""},{ t : "i", n : com_tilbuci_data_Global.ln.get("acinfo-inputint-p4"), v : ""},{ t : "i", n : com_tilbuci_data_Global.ln.get("acinfo-inputint-p5"), v : ""}], e : ["ok","cancel"]},{ n : com_tilbuci_data_Global.ln.get("acinfo-inputfloat"), a : "input.float", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-inputfloat-p1"), v : ""},{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-inputfloat-p2"), v : ""},{ t : "f", n : com_tilbuci_data_Global.ln.get("acinfo-inputfloat-p3"), v : ""},{ t : "f", n : com_tilbuci_data_Global.ln.get("acinfo-inputfloat-p4"), v : ""},{ t : "f", n : com_tilbuci_data_Global.ln.get("acinfo-inputfloat-p5"), v : ""}], e : ["ok","cancel"]},{ n : com_tilbuci_data_Global.ln.get("acinfo-inputlist"), a : "input.list", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-inputlist-p1"), v : ""},{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-inputlist-p2"), v : ""},{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-inputlist-p3"), v : ""},{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-inputlist-p4"), v : ""}], e : ["ok","cancel"]},{ n : com_tilbuci_data_Global.ln.get("acinfo-inputlogin"), a : "input.login", p : [], e : ["ok","cancel"]},{ n : com_tilbuci_data_Global.ln.get("acinfo-inputemail"), a : "input.email", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-inputemail-p1"), v : ""},{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-inputemail-p2"), v : ""}], e : ["ok","cancel"]},{ n : com_tilbuci_data_Global.ln.get("acinfo-inputadd"), a : "input.add", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-inputadd-p1"), v : ""},{ t : "f", n : com_tilbuci_data_Global.ln.get("acinfo-inputadd-p2"), v : ""},{ t : "f", n : com_tilbuci_data_Global.ln.get("acinfo-inputadd-p3"), v : ""},{ t : "f", n : com_tilbuci_data_Global.ln.get("acinfo-inputadd-p4"), v : ""},{ t : "e", n : com_tilbuci_data_Global.ln.get("acinfo-inputadd-p5"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-inputplace"), a : "input.place", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-inputplace-p1"), v : ""},{ t : "f", n : com_tilbuci_data_Global.ln.get("acinfo-inputplace-p2"), v : ""},{ t : "f", n : com_tilbuci_data_Global.ln.get("acinfo-inputplace-p3"), v : ""},{ t : "f", n : com_tilbuci_data_Global.ln.get("acinfo-inputplace-p4"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-inputsettext"), a : "input.settext", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-inputsettext-p1"), v : ""},{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-inputsettext-p2"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-inputsetpassword"), a : "input.setpassword", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-inputsetpassword-p1"), v : ""},{ t : "b", n : com_tilbuci_data_Global.ln.get("acinfo-inputsetpassword-p2"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-inputremove"), a : "input.remove", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-inputremove-p1"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-inputremoveall"), a : "input.removeall", p : [], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-inputaddtarea"), a : "input.addtarea", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-inputaddtarea-p1"), v : ""},{ t : "f", n : com_tilbuci_data_Global.ln.get("acinfo-inputaddtarea-p2"), v : ""},{ t : "f", n : com_tilbuci_data_Global.ln.get("acinfo-inputaddtarea-p3"), v : ""},{ t : "f", n : com_tilbuci_data_Global.ln.get("acinfo-inputaddtarea-p4"), v : ""},{ t : "f", n : com_tilbuci_data_Global.ln.get("acinfo-inputaddtarea-p5"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-inputplacetarea"), a : "input.placetarea", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-inputplacetarea-p1"), v : ""},{ t : "f", n : com_tilbuci_data_Global.ln.get("acinfo-inputplacetarea-p2"), v : ""},{ t : "f", n : com_tilbuci_data_Global.ln.get("acinfo-inputplacetarea-p3"), v : ""},{ t : "f", n : com_tilbuci_data_Global.ln.get("acinfo-inputplacetarea-p4"), v : ""},{ t : "f", n : com_tilbuci_data_Global.ln.get("acinfo-inputplacetarea-p5"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-inputsettextarea"), a : "input.settextarea", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-inputsettextarea-p1"), v : ""},{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-inputsettextarea-p2"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-inputremovetarea"), a : "input.removetarea", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-inputremovetarea-p1"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-inputremovealltareas"), a : "input.removealltareas", p : [], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-inputaddnumeric"), a : "input.addnumeric", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-inputaddnumeric-p1"), v : ""},{ t : "i", n : com_tilbuci_data_Global.ln.get("acinfo-inputaddnumeric-p2"), v : ""},{ t : "i", n : com_tilbuci_data_Global.ln.get("acinfo-inputaddnumeric-p3"), v : ""},{ t : "i", n : com_tilbuci_data_Global.ln.get("acinfo-inputaddnumeric-p4"), v : ""},{ t : "i", n : com_tilbuci_data_Global.ln.get("acinfo-inputaddnumeric-p5"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-inputplacenumeric"), a : "input.placenumeric", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-inputplacenumeric-p1"), v : ""},{ t : "f", n : com_tilbuci_data_Global.ln.get("acinfo-inputplacenumeric-p2"), v : ""},{ t : "f", n : com_tilbuci_data_Global.ln.get("acinfo-inputplacenumeric-p3"), v : ""},{ t : "f", n : com_tilbuci_data_Global.ln.get("acinfo-inputplacenumeric-p4"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-inputsetnumeric"), a : "input.setnumeric", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-inputsetnumeric-p1"), v : ""},{ t : "i", n : com_tilbuci_data_Global.ln.get("acinfo-inputsetnumeric-p2"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-inputsetnumericbounds"), a : "input.setnumericbounds", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-inputsetnumericbounds-p1"), v : ""},{ t : "f", n : com_tilbuci_data_Global.ln.get("acinfo-inputsetnumericbounds-p2"), v : ""},{ t : "f", n : com_tilbuci_data_Global.ln.get("acinfo-inputsetnumericbounds-p3"), v : ""},{ t : "f", n : com_tilbuci_data_Global.ln.get("acinfo-inputsetnumericbounds-p4"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-inputremovenumeric"), a : "input.removenumeric", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-inputremovenumeric-p1"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-inputremoveallnumerics"), a : "input.removeallnumerics", p : [], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-inputaddaddtoggle"), a : "input.addtoggle", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-inputaddaddtoggle-p1"), v : ""},{ t : "b", n : com_tilbuci_data_Global.ln.get("acinfo-inputaddaddtoggle-p2"), v : ""},{ t : "i", n : com_tilbuci_data_Global.ln.get("acinfo-inputaddaddtoggle-p3"), v : ""},{ t : "i", n : com_tilbuci_data_Global.ln.get("acinfo-inputaddaddtoggle-p4"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-inputplacetoggle"), a : "input.placetoggle", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-inputplacetoggle-p1"), v : ""},{ t : "b", n : com_tilbuci_data_Global.ln.get("acinfo-inputplacetoggle-p2"), v : ""},{ t : "i", n : com_tilbuci_data_Global.ln.get("acinfo-inputplacetoggle-p3"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-inputsettoggle"), a : "input.settoggle", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-inputsettoggle-p1"), v : ""},{ t : "b", n : com_tilbuci_data_Global.ln.get("acinfo-inputsettoggle-p2"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-inputinverttoggle"), a : "input.inverttoggle", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-inputinverttoggle-p1"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-inputremovetoggle"), a : "input.removetoggle", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-inputremovetoggle-p1"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-inputrremovealltoggles"), a : "input.removealltoggles", p : [], e : []}]));
	this.groups.push(new com_tilbuci_script_ActionInfoGroup(com_tilbuci_data_Global.ln.get("window-acbsystem-title"),[{ n : com_tilbuci_data_Global.ln.get("acinfo-run"), a : "run", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-run-p1"), v : ""},{ t : "e", n : com_tilbuci_data_Global.ln.get("acinfo-run-p2"), v : ""},{ t : "e", n : com_tilbuci_data_Global.ln.get("acinfo-run-p3"), v : ""},{ t : "e", n : com_tilbuci_data_Global.ln.get("acinfo-run-p4"), v : ""},{ t : "e", n : com_tilbuci_data_Global.ln.get("acinfo-run-p5"), v : ""},{ t : "e", n : com_tilbuci_data_Global.ln.get("acinfo-run-p6"), v : ""},{ t : "e", n : com_tilbuci_data_Global.ln.get("acinfo-run-p7"), v : ""},{ t : "e", n : com_tilbuci_data_Global.ln.get("acinfo-run-p8"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-snippetsload"), a : "snippets.load", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-snippetsload-p1"), v : ""}], e : ["success","error"]},{ n : com_tilbuci_data_Global.ln.get("acinfo-snippetsunload"), a : "snippets.unload", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-snippetsunload-p1"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-systemfullscreen"), a : "system.fullscreen", p : [], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-systemopenembed"), a : "system.openembed", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-systemopenembed-p1"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-systemcloseembed"), a : "system.closeembed", p : [], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-systemsembedplace"), a : "system.embedplace", p : [{ t : "f", n : com_tilbuci_data_Global.ln.get("acinfo-systemsembedplace-p1"), v : ""},{ t : "f", n : com_tilbuci_data_Global.ln.get("acinfo-systemsembedplace-p2"), v : ""},{ t : "f", n : com_tilbuci_data_Global.ln.get("acinfo-systemsembedplace-p3"), v : ""},{ t : "f", n : com_tilbuci_data_Global.ln.get("acinfo-systemsembedplace-p4"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-systemembedreset"), a : "system.embedreset", p : [], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-systemopenurl"), a : "system.openurl", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-systemopenurl-p1"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-systemcopytext"), a : "system.copytext", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-systemcopytext-p1"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-systemifhorizontal"), a : "system.ifhorizontal", p : [], e : ["then","else"]},{ n : com_tilbuci_data_Global.ln.get("acinfo-systemifvertical"), a : "system.ifvertical", p : [], e : ["then","else"]},{ n : com_tilbuci_data_Global.ln.get("acinfo-systemifwebsite"), a : "system.ifwebsite", p : [], e : ["then","else"]},{ n : com_tilbuci_data_Global.ln.get("acinfo-systemifpwa"), a : "system.ifpwa", p : [], e : ["then","else"]},{ n : com_tilbuci_data_Global.ln.get("acinfo-systemifpwainstalled"), a : "system.ifpwainstalled", p : [], e : ["then","else"]},{ n : com_tilbuci_data_Global.ln.get("acinfo-systemifdesktop"), a : "system.ifdesktop", p : [], e : ["then","else"]},{ n : com_tilbuci_data_Global.ln.get("acinfo-systemifmobile"), a : "system.ifmobile", p : [], e : ["then","else"]},{ n : com_tilbuci_data_Global.ln.get("acinfo-systemifpublish"), a : "system.ifpublish", p : [], e : ["then","else"]},{ n : com_tilbuci_data_Global.ln.get("acinfo-systemifplayer"), a : "system.ifplayer", p : [], e : ["then","else"]},{ n : com_tilbuci_data_Global.ln.get("acinfo-systemvisitoringroup"), a : "system.visitoringroup", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-systemvisitoringroup-p1"), v : ""}], e : ["then","else"]},{ n : com_tilbuci_data_Global.ln.get("acinfo-systemlogout"), a : "system.logout", p : [], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-systemsendevent"), a : "system.sendevent", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-systemsendevent-p1"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-systemsetkftime"), a : "system.setkftime", p : [{ t : "i", n : com_tilbuci_data_Global.ln.get("acinfo-systemsetkftime-p1"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-systemcalljs"), a : "system.calljs", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-systemcalljs-p1"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-cssset"), a : "css.set", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-cssset-p1"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-cssclear"), a : "css.clear", p : [], e : []}]));
	this.groups.push(new com_tilbuci_script_ActionInfoGroup(com_tilbuci_data_Global.ln.get("window-acbtimer-title"),[{ n : com_tilbuci_data_Global.ln.get("acinfo-timerset"), a : "timer.set", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-timerset-p1"), v : ""},{ t : "i", n : com_tilbuci_data_Global.ln.get("acinfo-timerset-p2"), v : ""},{ t : "i", n : com_tilbuci_data_Global.ln.get("acinfo-timerset-p3"), v : ""}], e : ["tick","end"]},{ n : com_tilbuci_data_Global.ln.get("acinfo-timerclear"), a : "timer.clear", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-timerclear-p1"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-timerclearall"), a : "timer.clearall", p : [], e : []}]));
	this.groups.push(new com_tilbuci_script_ActionInfoGroup(com_tilbuci_data_Global.ln.get("window-acbreplace-title"),[{ n : com_tilbuci_data_Global.ln.get("acinfo-replaceorigin"), a : "replace.origin", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-replaceorigin-p1"), v : "origins"}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-replacesetstring"), a : "replace.setstring", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-replacesetstring-p1"), v : ""},{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-replacesetstring-p2"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-replacesetfile"), a : "replace.setfile", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-replacesetfile-p1"), v : ""},{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-replacesetfile-p2"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-replaceclearstring"), a : "replace.clearstring", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-replaceclearstring-p1"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-replaceclearfile"), a : "replace.clearfile", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-replaceclearfile-p1"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-replaceclearallstrings"), a : "replace.clearallstrings", p : [], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-replaceclearallfiles"), a : "replace.clearallfiles", p : [], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-ifreplacestringset"), a : "if.replacestringset", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-ifreplacestringset-p1"), v : ""}], e : ["then","else"]},{ n : com_tilbuci_data_Global.ln.get("acinfo-ifreplacefileset"), a : "if.replacefileset", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-ifreplacefileset-p1"), v : ""}], e : ["then","else"]}]));
	this.groups.push(new com_tilbuci_script_ActionInfoGroup(com_tilbuci_data_Global.ln.get("window-acbcontraptions-title"),[{ n : com_tilbuci_data_Global.ln.get("acinfo-showmessage"), a : "contraption.message", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-showmessage-p1"), v : ""},{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-showmessage-p2"), v : ""},{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-showmessage-p3"), v : ""},{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-showmessage-p4"), v : ""}], e : ["select"]},{ n : com_tilbuci_data_Global.ln.get("acinfo-hidemessage"), a : "contraption.messagehide", p : [], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-showmenu"), a : "contraption.menu", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-showmenu-p1"), v : ""},{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-showmenu-p2"), v : ""},{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-showmenu-p3"), v : ""},{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-showmenu-p4"), v : "placement"},{ t : "i", n : com_tilbuci_data_Global.ln.get("acinfo-showmenu-p5"), v : ""},{ t : "i", n : com_tilbuci_data_Global.ln.get("acinfo-showmenu-p6"), v : ""}], e : ["select"]},{ n : com_tilbuci_data_Global.ln.get("acinfo-hidemenu"), a : "contraption.menuhide", p : [], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-showcover"), a : "contraption.cover", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-showcover-p1"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-hidecover"), a : "contraption.coverhide", p : [], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-showbg"), a : "contraption.background", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-showbg-p1"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-hidebg"), a : "contraption.backgroundhide", p : [], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-showloading"), a : "contraption.showloading", p : [], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-hideloading"), a : "contraption.hideloading", p : [], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-musicplay"), a : "contraption.musicplay", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-musicplay-p1"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-musicpause"), a : "contraption.musicpause", p : [], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-musicstop"), a : "contraption.musicstop", p : [], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-musicvolume"), a : "contraption.musicvolume", p : [{ t : "i", n : com_tilbuci_data_Global.ln.get("acinfo-musicvolume-p1"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-soundplay"), a : "contraption.soundplay", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-soundplay-p1"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-soundpause"), a : "contraption.soundpause", p : [{ t : "e", n : com_tilbuci_data_Global.ln.get("acinfo-soundpause-p1"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-soundstop"), a : "contraption.soundstop", p : [{ t : "e", n : com_tilbuci_data_Global.ln.get("acinfo-soundstop-p1"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-soundvolume"), a : "contraption.soundvolume", p : [{ t : "i", n : com_tilbuci_data_Global.ln.get("acinfo-soundvolume-p1"), v : ""},{ t : "e", n : com_tilbuci_data_Global.ln.get("acinfo-soundvolume-p2"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-showform"), a : "contraption.form", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-showform-p1"), v : ""},{ t : "i", n : com_tilbuci_data_Global.ln.get("acinfo-showform-p2"), v : ""},{ t : "i", n : com_tilbuci_data_Global.ln.get("acinfo-showform-p3"), v : ""}], e : ["ok","cancel"]},{ n : com_tilbuci_data_Global.ln.get("acinfo-setformvalue"), a : "contraption.formvalue", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-setformvalue-p1"), v : ""},{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-setformvalue-p2"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-setformstepper"), a : "contraption.formsetstepper", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-setformstepper-p1"), v : ""},{ t : "i", n : com_tilbuci_data_Global.ln.get("acinfo-setformstepper-p2"), v : ""},{ t : "i", n : com_tilbuci_data_Global.ln.get("acinfo-setformstepper-p3"), v : ""},{ t : "i", n : com_tilbuci_data_Global.ln.get("acinfo-setformstepper-p4"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-hideform"), a : "contraption.formhide", p : [], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-showinterf"), a : "contraption.interface", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-showinterf-p1"), v : ""},{ t : "i", n : com_tilbuci_data_Global.ln.get("acinfo-showinterf-p2"), v : ""},{ t : "i", n : com_tilbuci_data_Global.ln.get("acinfo-showinterf-p3"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-hideinterf"), a : "contraption.interfacehide", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-hideinterf-p1"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-hideallinterf"), a : "contraption.interfacehideall", p : [], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-interftext"), a : "contraption.interfacetext", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-interftext-p1"), v : ""},{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-interftext-p2"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-interfframe"), a : "contraption.interfaceanimframe", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-interfframe-p1"), v : ""},{ t : "i", n : com_tilbuci_data_Global.ln.get("acinfo-interfframe-p2"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-interfplay"), a : "contraption.interfaceanimplay", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-interfplay-p1"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-interfpause"), a : "contraption.interfaceanimpause", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-interfpause-p1"), v : ""}], e : []}]));
	this.groups.push(new com_tilbuci_script_ActionInfoGroup(com_tilbuci_data_Global.ln.get("window-acbnarrative-title"),[{ n : com_tilbuci_data_Global.ln.get("acinfo-invshow"), a : "inventory.show", p : [], e : ["complete"]},{ n : com_tilbuci_data_Global.ln.get("acinfo-invclose"), a : "inventory.close", p : [], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-invaddkey"), a : "inventory.addkeyitem", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-invaddkey-p1"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-invremkey"), a : "inventory.removekeyitem", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-invremkey-p1"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-invclearkey"), a : "inventory.clearkeyitems", p : [], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-invhaskey"), a : "inventory.haskeyitem", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-invhaskey-p1"), v : ""}], e : ["then","else"]},{ n : com_tilbuci_data_Global.ln.get("acinfo-invaddcons"), a : "inventory.addconsumable", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-invaddcons-p1"), v : ""},{ t : "i", n : com_tilbuci_data_Global.ln.get("acinfo-invaddcons-p2"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-invremcons"), a : "inventory.removeconsumable", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-invremcons-p1"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-invconsume"), a : "inventory.consumeitem", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-invconsume-p1"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-invclearcons"), a : "inventory.clearconsumables", p : [], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-invtostring"), a : "inventory.tostring", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-invtostring-p1"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-invfromstring"), a : "inventory.fromstring", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-invfromstring-p1"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-invtostringk"), a : "inventory.keytostring", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-invtostringk-p1"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-invfromstringk"), a : "inventory.keyfromstring", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-invfromstringk-p1"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-invtostringc"), a : "inventory.constostring", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-invtostringc-p1"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-invfromstringc"), a : "inventory.consfromstring", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-invfromstringc-p1"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-battleshow"), a : "battle.show", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-battleshow-p1"), v : ""},{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-battleshow-p2"), v : ""}], e : ["win","loose"]},{ n : com_tilbuci_data_Global.ln.get("acinfo-battleclose"), a : "battle.close", p : [], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-battlesetattr"), a : "battle.setattribute", p : [{ t : "i", n : com_tilbuci_data_Global.ln.get("acinfo-battlesetattr-p1"), v : ""},{ t : "i", n : com_tilbuci_data_Global.ln.get("acinfo-battlesetattr-p2"), v : ""},{ t : "i", n : com_tilbuci_data_Global.ln.get("acinfo-battlesetattr-p3"), v : ""},{ t : "i", n : com_tilbuci_data_Global.ln.get("acinfo-battlesetattr-p4"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-battlesetoppo"), a : "battle.setopponent", p : [{ t : "i", n : com_tilbuci_data_Global.ln.get("acinfo-battlesetoppo-p1"), v : ""},{ t : "i", n : com_tilbuci_data_Global.ln.get("acinfo-battlesetoppo-p2"), v : ""},{ t : "i", n : com_tilbuci_data_Global.ln.get("acinfo-battlesetoppo-p3"), v : ""},{ t : "i", n : com_tilbuci_data_Global.ln.get("acinfo-battlesetoppo-p4"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-diagloadgroup"), a : "dialogue.loadgroup", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-diagloadgroup-p1"), v : ""}], e : ["success","error"]},{ n : com_tilbuci_data_Global.ln.get("acinfo-diagstart"), a : "dialogue.start", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-diagstart-p1"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-diagnext"), a : "dialogue.next", p : [], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-diagprevious"), a : "dialogue.previous", p : [], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-diaglast"), a : "dialogue.last", p : [], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-diagfirst"), a : "dialogue.first", p : [], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-diagclose"), a : "dialogue.close", p : [], e : []}]));
	this.groups.push(new com_tilbuci_script_ActionInfoGroup(com_tilbuci_data_Global.ln.get("window-acbruntime-title"),[{ n : com_tilbuci_data_Global.ln.get("acinfo-runinstall"), a : "runtime.install", p : [], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-runquit"), a : "runtime.quit", p : [], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-runsavedata"), a : "runtime.savedata", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-runsavedata-p1"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-runloaddata"), a : "runtime.loaddata", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-runloaddata-p1"), v : ""}], e : ["success","error"]},{ n : com_tilbuci_data_Global.ln.get("acinfo-runifdataexist"), a : "runtime.ifdataexist", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-runifdataexist-p1"), v : ""}], e : ["then","else"]},{ n : com_tilbuci_data_Global.ln.get("acinfo-runbrowser"), a : "runtime.ifbrowser", p : [], e : ["then","else"]},{ n : com_tilbuci_data_Global.ln.get("acinfo-startkiosk"), a : "runtime.startkiosk", p : [], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-endkiosk"), a : "runtime.endkiosk", p : [], e : []}]));
	this.groups.push(new com_tilbuci_script_ActionInfoGroup(com_tilbuci_data_Global.ln.get("window-acbserver-title"),[{ n : com_tilbuci_data_Global.ln.get("acinfo-callprocess"), a : "call.process", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-callprocess-p1"), v : ""},{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-callprocess-p2"), v : ""}], e : ["success","error"]},{ n : com_tilbuci_data_Global.ln.get("acinfo-callsdprocess"), a : "call.sdprocess", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-callsdprocess-p1"), v : ""},{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-callsdprocess-p2"), v : ""}], e : ["success","error"]},{ n : com_tilbuci_data_Global.ln.get("acinfo-callurl"), a : "call.url", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-callurl-p1"), v : ""},{ t : "e", n : com_tilbuci_data_Global.ln.get("acinfo-callurl-p2"), v : ""}], e : ["success","error"]}]));
	this.groups.push(new com_tilbuci_script_ActionInfoGroup(com_tilbuci_data_Global.ln.get("window-acbdebug-title"),[{ n : com_tilbuci_data_Global.ln.get("acinfo-debugtrace"), a : "trace", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-debugtrace-p1"), v : ""}], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-debugtracebools"), a : "trace.bools", p : [], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-debugtraceints"), a : "trace.ints", p : [], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-debugtracefloats"), a : "trace.floats", p : [], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-debugtracestrings"), a : "trace.strings", p : [], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-debuginfoshow"), a : "debuginfo.show", p : [], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-debuginfohide"), a : "debuginfo.hide", p : [], e : []}]));
	this.groups.push(new com_tilbuci_script_ActionInfoGroup(com_tilbuci_data_Global.ln.get("window-acbanalytics-title"),[{ n : com_tilbuci_data_Global.ln.get("acinfo-analyticsevent"), a : "analytics.event", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-analyticsevent-p1"), v : ""},{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-analyticsevent-p2"), v : ""}], e : []}]));
	this.groups.push(new com_tilbuci_script_ActionInfoGroup(com_tilbuci_data_Global.ln.get("window-acbshare-title"),[{ n : com_tilbuci_data_Global.ln.get("acinfo-sharefacebook"), a : "share.facebook", p : [], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-sharelinkedin"), a : "share.linkedin", p : [], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-sharepinterest"), a : "share.pinterest", p : [], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-sharereddit"), a : "share.reddit", p : [], e : []},{ n : com_tilbuci_data_Global.ln.get("acinfo-sharex"), a : "share.x", p : [], e : []}]));
	this.groups.push(new com_tilbuci_script_ActionInfoGroup(com_tilbuci_data_Global.ln.get("window-acboverlay-title"),[{ n : com_tilbuci_data_Global.ln.get("acinfo-overlayshow"), a : "overlay.show", p : [{ t : "s", n : com_tilbuci_data_Global.ln.get("acinfo-overlayshow-p1"), v : ""},{ t : "e", n : com_tilbuci_data_Global.ln.get("acinfo-overlayshow-p2"), v : ""},{ t : "b", n : com_tilbuci_data_Global.ln.get("acinfo-overlayshow-p3"), v : ""},{ t : "e", n : com_tilbuci_data_Global.ln.get("acinfo-overlayshow-p4"), v : ""}], e : ["success","error"]}]));
};
$hxClasses["com.tilbuci.script.ActionInfo"] = com_tilbuci_script_ActionInfo;
com_tilbuci_script_ActionInfo.__name__ = "com.tilbuci.script.ActionInfo";
com_tilbuci_script_ActionInfo.prototype = {
	groups: null
	,movies: null
	,selMovies: null
	,scenes: null
	,selScenes: null
	,_lastUpdate: null
	,_mvOrigins: null
	,_scDirections: null
	,_mnPlacement: null
	,getAcName: function(ac) {
		var _g = 0;
		var _g1 = this.groups;
		while(_g < _g1.length) {
			var gr = _g1[_g];
			++_g;
			if(Object.prototype.hasOwnProperty.call(gr.actions.h,ac)) {
				ac = gr.actions.h[ac].n;
			}
		}
		return ac;
	}
	,getNumParams: function(ac) {
		var ret = 0;
		var _g = 0;
		var _g1 = this.groups;
		while(_g < _g1.length) {
			var gr = _g1[_g];
			++_g;
			if(Object.prototype.hasOwnProperty.call(gr.actions.h,ac)) {
				ret = gr.actions.h[ac].p.length;
			}
		}
		return ret;
	}
	,getParamLine: function(ac,pr) {
		var ret = "";
		var _g = 0;
		var _g1 = this.groups;
		while(_g < _g1.length) {
			var gr = _g1[_g];
			++_g;
			if(Object.prototype.hasOwnProperty.call(gr.actions.h,ac)) {
				if(gr.actions.h[ac].p.length > 0) {
					var ps = [];
					var _g2 = 0;
					var _g3 = gr.actions.h[ac].p.length;
					while(_g2 < _g3) {
						var i = _g2++;
						if(pr.length > i) {
							if(pr[i] != "") {
								if(gr.actions.h[ac].p[i].v == "movies") {
									ps.push(this.getMovieName(pr[i]));
								} else if(gr.actions.h[ac].p[i].v == "scenes") {
									ps.push(this.getSceneName(pr[i]));
								} else if(gr.actions.h[ac].p[i].v == "origins") {
									if(Object.prototype.hasOwnProperty.call(this._mvOrigins.h,pr[i])) {
										ps.push(this._mvOrigins.h[pr[i]]);
									} else {
										ps.push(pr[i]);
									}
								} else if(gr.actions.h[ac].p[i].v == "navigation") {
									if(Object.prototype.hasOwnProperty.call(this._scDirections.h,pr[i])) {
										ps.push(this._scDirections.h[pr[i]]);
									} else {
										ps.push(pr[i]);
									}
								} else if(gr.actions.h[ac].p[i].v == "placement") {
									if(Object.prototype.hasOwnProperty.call(this._mnPlacement.h,pr[i])) {
										ps.push(this._mnPlacement.h[pr[i]]);
									} else {
										ps.push(pr[i]);
									}
								} else {
									ps.push(pr[i]);
								}
							}
						}
					}
					if(ps.length > 0) {
						ret = " (" + ps.join(", ") + ")";
					}
				}
			}
		}
		return ret;
	}
	,getAcParam: function(ac,num,val) {
		var ret = "#" + (num + 1) + ": ";
		var pv = "";
		var _g = 0;
		var _g1 = this.groups;
		while(_g < _g1.length) {
			var gr = _g1[_g];
			++_g;
			if(Object.prototype.hasOwnProperty.call(gr.actions.h,ac)) {
				if(gr.actions.h[ac].p.length > num) {
					ret = gr.actions.h[ac].p[num].n + ": ";
					pv = gr.actions.h[ac].p[num].v;
				}
			}
		}
		if(val != null) {
			switch(pv) {
			case "movies":
				ret += this.getMovieName(val);
				break;
			case "navigation":
				if(Object.prototype.hasOwnProperty.call(this._scDirections.h,val)) {
					ret += this._scDirections.h[val];
				} else {
					ret += val;
				}
				break;
			case "origins":
				if(Object.prototype.hasOwnProperty.call(this._mvOrigins.h,val)) {
					ret += this._mvOrigins.h[val];
				} else {
					ret += val;
				}
				break;
			case "placement":
				if(Object.prototype.hasOwnProperty.call(this._mnPlacement.h,val)) {
					ret += this._mnPlacement.h[val];
				} else {
					ret += val;
				}
				break;
			case "scenes":
				ret += this.getSceneName(val);
				break;
			default:
				ret += val;
			}
		}
		return ret;
	}
	,getExtra1: function(ac) {
		var ret = "";
		var _g = 0;
		var _g1 = this.groups;
		while(_g < _g1.length) {
			var gr = _g1[_g];
			++_g;
			if(Object.prototype.hasOwnProperty.call(gr.actions.h,ac)) {
				if(gr.actions.h[ac].e.length > 0) {
					ret = gr.actions.h[ac].e[0];
				}
			}
		}
		return ret;
	}
	,getExtra2: function(ac) {
		var ret = "";
		var _g = 0;
		var _g1 = this.groups;
		while(_g < _g1.length) {
			var gr = _g1[_g];
			++_g;
			if(Object.prototype.hasOwnProperty.call(gr.actions.h,ac)) {
				if(gr.actions.h[ac].e.length > 1) {
					ret = gr.actions.h[ac].e[1];
				}
			}
		}
		return ret;
	}
	,getMovieName: function(id) {
		if(Object.prototype.hasOwnProperty.call(this.movies.h,id)) {
			id = this.movies.h[id];
		}
		return id;
	}
	,getSceneName: function(id) {
		if(Object.prototype.hasOwnProperty.call(this.scenes.h,id)) {
			id = this.scenes.h[id];
		}
		return id;
	}
	,loadInfo: function(force) {
		if(force == null) {
			force = false;
		}
		if(force) {
			this._lastUpdate = new Date().getTime();
			var tmp = com_tilbuci_data_Global.ws;
			var _g = new haxe_ds_StringMap();
			var value = com_tilbuci_data_GlobalPlayer.movie.get_mvId();
			_g.h["id"] = value;
			tmp.send("Movie/AcInfo",_g,$bind(this,this.onInfo),0,false);
		} else {
			var now = new Date().getTime();
			if(now - this._lastUpdate > 600000) {
				this._lastUpdate = now;
				var tmp = com_tilbuci_data_Global.ws;
				var _g = new haxe_ds_StringMap();
				var value = com_tilbuci_data_GlobalPlayer.movie.get_mvId();
				_g.h["id"] = value;
				tmp.send("Movie/AcInfo",_g,$bind(this,this.onInfo),0,false);
			}
		}
	}
	,onInfo: function(ok,ld) {
		if(ok) {
			if(ld.map.h["e"] == 0) {
				if(Object.prototype.hasOwnProperty.call(ld.map.h,"movies")) {
					var h = this.movies.h;
					var k_h = h;
					var k_keys = Object.keys(h);
					var k_length = k_keys.length;
					var k_current = 0;
					while(k_current < k_length) {
						var k = k_keys[k_current++];
						var _this = this.movies;
						if(Object.prototype.hasOwnProperty.call(_this.h,k)) {
							delete(_this.h[k]);
						}
					}
					while(this.selMovies.length > 0) this.selMovies.shift();
					var _g = 0;
					var _g1 = Reflect.fields(ld.map.h["movies"]);
					while(_g < _g1.length) {
						var k = _g1[_g];
						++_g;
						var it = Reflect.field(ld.map.h["movies"],k);
						this.selMovies.push({ text : it.title, value : it.id});
						var v = it.title;
						this.movies.h[it.id] = v;
					}
				}
				if(Object.prototype.hasOwnProperty.call(ld.map.h,"scenes")) {
					var h = this.scenes.h;
					var k_h = h;
					var k_keys = Object.keys(h);
					var k_length = k_keys.length;
					var k_current = 0;
					while(k_current < k_length) {
						var k = k_keys[k_current++];
						var _this = this.scenes;
						if(Object.prototype.hasOwnProperty.call(_this.h,k)) {
							delete(_this.h[k]);
						}
					}
					while(this.selScenes.length > 0) this.selScenes.shift();
					var _g = 0;
					var _g1 = Reflect.fields(ld.map.h["scenes"]);
					while(_g < _g1.length) {
						var k = _g1[_g];
						++_g;
						var it = Reflect.field(ld.map.h["scenes"],k);
						this.selScenes.push({ text : it.title, value : it.id});
						var v = it.title;
						this.scenes.h[it.id] = v;
					}
				}
			}
		}
	}
	,__class__: com_tilbuci_script_ActionInfo
};
var com_tilbuci_script_ActionInfoGroup = function(nm,ac) {
	this.actions = new haxe_ds_StringMap();
	this.name = "";
	this.name = nm;
	var _g = 0;
	var _g1 = Reflect.fields(ac);
	while(_g < _g1.length) {
		var f = _g1[_g];
		++_g;
		var acf = Reflect.field(ac,f);
		var this1 = this.actions;
		var k = acf.a;
		var v = new com_tilbuci_script_ActionInfoAc(acf);
		this1.h[k] = v;
	}
};
$hxClasses["com.tilbuci.script.ActionInfoGroup"] = com_tilbuci_script_ActionInfoGroup;
com_tilbuci_script_ActionInfoGroup.__name__ = "com.tilbuci.script.ActionInfoGroup";
com_tilbuci_script_ActionInfoGroup.prototype = {
	name: null
	,actions: null
	,__class__: com_tilbuci_script_ActionInfoGroup
};
var com_tilbuci_script_ActionInfoAc = function(ac) {
	this.e = [];
	this.p = [];
	this.n = "";
	this.a = "";
	this.a = ac.a;
	this.n = ac.n;
	var _g = 0;
	var _g1 = Reflect.fields(ac.p);
	while(_g < _g1.length) {
		var f = _g1[_g];
		++_g;
		this.p.push(new com_tilbuci_script_ActionInfoParam(Reflect.field(ac.p,f)));
	}
	this.e = ac.e;
};
$hxClasses["com.tilbuci.script.ActionInfoAc"] = com_tilbuci_script_ActionInfoAc;
com_tilbuci_script_ActionInfoAc.__name__ = "com.tilbuci.script.ActionInfoAc";
com_tilbuci_script_ActionInfoAc.prototype = {
	a: null
	,n: null
	,p: null
	,e: null
	,__class__: com_tilbuci_script_ActionInfoAc
};
var com_tilbuci_script_ActionInfoParam = function(pr) {
	this.v = "";
	this.n = "";
	this.t = "s";
	this.t = pr.t;
	this.n = pr.n;
	this.v = pr.v;
};
$hxClasses["com.tilbuci.script.ActionInfoParam"] = com_tilbuci_script_ActionInfoParam;
com_tilbuci_script_ActionInfoParam.__name__ = "com.tilbuci.script.ActionInfoParam";
com_tilbuci_script_ActionInfoParam.prototype = {
	t: null
	,n: null
	,v: null
	,__class__: com_tilbuci_script_ActionInfoParam
};
var com_tilbuci_script_ActionTimer = function(nm,interv,stp,ac,end) {
	this.name = nm;
	this._steps = stp;
	this._current = 0;
	this._action = ac;
	this._acend = end;
	this._timer = new haxe_Timer(interv);
	this._timer.run = $bind(this,this.runAction);
};
$hxClasses["com.tilbuci.script.ActionTimer"] = com_tilbuci_script_ActionTimer;
com_tilbuci_script_ActionTimer.__name__ = "com.tilbuci.script.ActionTimer";
com_tilbuci_script_ActionTimer.prototype = {
	name: null
	,_timer: null
	,_action: null
	,_acend: null
	,_current: null
	,_steps: null
	,clear: function() {
		try {
			this._timer.stop();
		} catch( _g ) {
		}
		this._timer = null;
		this.name = null;
		this._acend = null;
		this._action = null;
	}
	,runAction: function() {
		if(this._action != null) {
			if(com_tilbuci_data_GlobalPlayer.mode != "editor") {
				com_tilbuci_data_GlobalPlayer.parser.run(this._action,true);
			}
		}
		this._current++;
		if(this._current >= this._steps) {
			if(this._acend != null) {
				if(com_tilbuci_data_GlobalPlayer.mode != "editor") {
					com_tilbuci_data_GlobalPlayer.parser.run(this._acend,true);
				}
			}
			this.clear();
		}
	}
	,__class__: com_tilbuci_script_ActionTimer
};
var com_tilbuci_script_AssistBase = function(ac,title,about) {
	this._actions = new haxe_ds_StringMap();
	this._idbuttons = new haxe_ds_StringMap();
	com_tilbuci_ui_window_PopupWindow.call(this,ac,title,800,com_tilbuci_ui_base_InterfaceFactory.pickValue(700,710),false);
	var this1 = this._idbuttons;
	var v = new com_tilbuci_ui_component_IDButton("btCopy",$bind(this,this.onCopy),com_tilbuci_data_Global.ln.get("window-acvariable-create"),openfl_utils_Assets.getBitmapData("btCopy"));
	this1.h["btCopy"] = v;
	var this1 = this._idbuttons;
	var v = new com_tilbuci_ui_component_IDButton("btShow",$bind(this,this.onShow),com_tilbuci_data_Global.ln.get("window-acvariable-show"));
	this1.h["btShow"] = v;
	var this1 = this._idbuttons;
	var v = new com_tilbuci_ui_component_IDButton("ggeneral",$bind(this,this.onGeneral),com_tilbuci_data_Global.ln.get("window-globals-get"),openfl_utils_Assets.getBitmapData("btCopy"));
	this1.h["ggeneral"] = v;
	var this1 = this._idbuttons;
	var v = new com_tilbuci_ui_component_IDButton("instance",$bind(this,this.onInstance),com_tilbuci_data_Global.ln.get("window-globals-get"),openfl_utils_Assets.getBitmapData("btCopy"));
	this1.h["ginstance"] = v;
	var this1 = this._idbuttons;
	var v = new com_tilbuci_ui_component_IDButton("movie",$bind(this,this.onMovie),com_tilbuci_data_Global.ln.get("window-globals-get"),openfl_utils_Assets.getBitmapData("btCopy"));
	this1.h["gmovie"] = v;
	var tmp = this.ui;
	var tmp1 = this.ui;
	var tmp2 = { tp : "Label", id : "params", tx : com_tilbuci_data_Global.ln.get("window-acvariable-param"), vr : ""};
	var tmp3 = { tp : "Custom", cont : this._idbuttons.h["btCopy"]};
	var tmp4 = { tp : "Custom", cont : this._idbuttons.h["btShow"]};
	var tmp5 = com_tilbuci_data_Global.ln.get("window-actions-close");
	var tmp6 = tmp1.forge("left",[{ tp : "Label", id : "list", tx : about, vr : ""},{ tp : "List", id : "list", vl : [], sl : [], ht : 195},tmp2,{ tp : "TInput", id : "p1", tx : ""},{ tp : "TInput", id : "p2", tx : ""},{ tp : "TInput", id : "p3", tx : ""},{ tp : "TInput", id : "p4", tx : ""},{ tp : "TInput", id : "p5", tx : ""},{ tp : "TInput", id : "p6", tx : ""},{ tp : "TInput", id : "p7", tx : ""},tmp3,tmp4,{ tp : "Button", id : "close", tx : tmp5, ac : $bind(this,this.onClose)}]);
	var tmp1 = this.ui;
	var tmp2 = { tp : "Label", id : "ggeneral", tx : com_tilbuci_data_Global.ln.get("window-globals-general"), vr : ""};
	var tmp3 = { tp : "List", id : "ggeneral", vl : [{ text : com_tilbuci_data_Global.ln.get("window-globals-playing"), value : "?_PLAYING", asset : "btBool"},{ text : com_tilbuci_data_Global.ln.get("window-globals-server"), value : "?_SERVER", asset : "btBool"},{ text : com_tilbuci_data_Global.ln.get("window-globals-userlogged"), value : "?_USERLOGGED", asset : "btBool"},{ text : com_tilbuci_data_Global.ln.get("window-globals-hadinteraction"), value : "?_HADINTERACTION", asset : "btBool"},{ text : com_tilbuci_data_Global.ln.get("window-globals-keyframe"), value : "#_KEYFRAME", asset : "btFloat"},{ text : com_tilbuci_data_Global.ln.get("window-globals-areabig"), value : "#_AREABIG", asset : "btFloat"},{ text : com_tilbuci_data_Global.ln.get("window-globals-areasmall"), value : "#_AREASMALL", asset : "btFloat"},{ text : com_tilbuci_data_Global.ln.get("window-globals-contentx"), value : "#_CONTENTX", asset : "btFloat"},{ text : com_tilbuci_data_Global.ln.get("window-globals-contenty"), value : "#_CONTENTY", asset : "btFloat"},{ text : com_tilbuci_data_Global.ln.get("window-globals-contentwidth"), value : "#_CONTENTWIDTH", asset : "btFloat"},{ text : com_tilbuci_data_Global.ln.get("window-globals-contentheight"), value : "#_CONTENTHEIGHT", asset : "btFloat"},{ text : com_tilbuci_data_Global.ln.get("window-globals-movietitle"), value : "$_MOVIETITLE", asset : "btString"},{ text : com_tilbuci_data_Global.ln.get("window-globals-movieid"), value : "$_MOVIEID", asset : "btString"},{ text : com_tilbuci_data_Global.ln.get("window-globals-scenetitle"), value : "$_SCENETITLE", asset : "btString"},{ text : com_tilbuci_data_Global.ln.get("window-globals-sceneid"), value : "$_SCENEID", asset : "btString"},{ text : com_tilbuci_data_Global.ln.get("window-globals-orientation"), value : "$_ORIENTATION", asset : "btString"},{ text : com_tilbuci_data_Global.ln.get("window-globals-urlmovie"), value : "$_URLMOVIE", asset : "btString"},{ text : com_tilbuci_data_Global.ln.get("window-globals-urlscene"), value : "$_URLSCENE", asset : "btString"},{ text : com_tilbuci_data_Global.ln.get("window-globals-username"), value : "$_USERNAME", asset : "btString"},{ text : com_tilbuci_data_Global.ln.get("window-globals-runtime"), value : "$_RUNTIME", asset : "btString"},{ text : com_tilbuci_data_Global.ln.get("window-globals-wsserver"), value : "$_WSSERVER", asset : "btString"},{ text : com_tilbuci_data_Global.ln.get("window-globals-version"), value : "$_VERSION", asset : "btString"},{ text : com_tilbuci_data_Global.ln.get("window-globals-session"), value : "$_SESSION", asset : "btString"},{ text : com_tilbuci_data_Global.ln.get("window-globals-date"), value : "$_DATE", asset : "btString"},{ text : com_tilbuci_data_Global.ln.get("window-globals-time"), value : "$_TIME", asset : "btString"},{ text : com_tilbuci_data_Global.ln.get("window-globals-year"), value : "$_YEAR", asset : "btString"},{ text : com_tilbuci_data_Global.ln.get("window-globals-month"), value : "$_MONTH", asset : "btString"},{ text : com_tilbuci_data_Global.ln.get("window-globals-day"), value : "$_DAY", asset : "btString"},{ text : com_tilbuci_data_Global.ln.get("window-globals-hour"), value : "$_HOUR", asset : "btString"},{ text : com_tilbuci_data_Global.ln.get("window-globals-minute"), value : "$_MINUTE", asset : "btString"},{ text : com_tilbuci_data_Global.ln.get("window-globals-second"), value : "$_SECOND", asset : "btString"}], sl : [], ht : 184};
	var tmp4 = { tp : "Custom", cont : this._idbuttons.h["ggeneral"]};
	var tmp5 = { tp : "Label", id : "ginstance", tx : com_tilbuci_data_Global.ln.get("window-globals-instance"), vr : ""};
	var tmp7 = { tp : "Label", id : "ginstancep", tx : com_tilbuci_data_Global.ln.get("window-globals-instancep"), vr : feathers_controls_Label.VARIANT_DETAIL};
	var tmp8 = { tp : "Select", id : "ginstancep", vl : [{ text : com_tilbuci_data_Global.ln.get("window-globals-instplaying"), value : "?_INSTANCEPLAYING:"},{ text : com_tilbuci_data_Global.ln.get("window-globals-instvisible"), value : "?_INSTANCEVISIBLE:"},{ text : com_tilbuci_data_Global.ln.get("window-globals-instfontbold"), value : "?_INSTANCEFONTBOLD:"},{ text : com_tilbuci_data_Global.ln.get("window-globals-instfontitalic"), value : "?_INSTANCEFONTITALIC:"},{ text : com_tilbuci_data_Global.ln.get("window-acinstance-px"), value : "#_INSTANCEX:"},{ text : com_tilbuci_data_Global.ln.get("window-acinstance-py"), value : "#_INSTANCEY:"},{ text : com_tilbuci_data_Global.ln.get("window-acinstance-pwidth"), value : "#_INSTANCEWIDTH:"},{ text : com_tilbuci_data_Global.ln.get("window-acinstance-pheight"), value : "#_INSTANCEHEIGHT:"},{ text : com_tilbuci_data_Global.ln.get("window-acinstance-palpha"), value : "#_INSTANCEALPHA:"},{ text : com_tilbuci_data_Global.ln.get("window-acinstance-pvolume"), value : "#_INSTANCEVOLUME:"},{ text : com_tilbuci_data_Global.ln.get("window-acinstance-porder"), value : "#_INSTANCEORDER:"},{ text : com_tilbuci_data_Global.ln.get("window-acinstance-pcoloralpha"), value : "#_INSTANCECOLORALPHA:"},{ text : com_tilbuci_data_Global.ln.get("window-acinstance-pfontsize"), value : "#_INSTANCEFONTSIZE:"},{ text : com_tilbuci_data_Global.ln.get("window-acinstance-pfontleading"), value : "#_INSTANCEFONTLEADING:"},{ text : com_tilbuci_data_Global.ln.get("window-acinstance-pcolor"), value : "$_INSTANCECOLOR:"},{ text : com_tilbuci_data_Global.ln.get("window-globals-insttext"), value : "$_INSTANCETEXT:"},{ text : com_tilbuci_data_Global.ln.get("window-acinstance-pfont"), value : "$_INSTANCEFONT:"},{ text : com_tilbuci_data_Global.ln.get("window-acinstance-pfontcolor"), value : "$_INSTANCEFONTCOLOR:"}], sl : []};
	var tmp9 = { tp : "Label", id : "ginstancen", tx : com_tilbuci_data_Global.ln.get("window-globals-instancen"), vr : feathers_controls_Label.VARIANT_DETAIL};
	var tmp10 = { tp : "Custom", cont : this._idbuttons.h["ginstance"]};
	var tmp11 = { tp : "Label", id : "gmovie", tx : com_tilbuci_data_Global.ln.get("window-globals-movie"), vr : ""};
	var tmp12 = { tp : "Select", id : "gmovie", vl : [{ text : com_tilbuci_data_Global.ln.get("window-globals-text"), value : "$_TEXTS:"},{ text : com_tilbuci_data_Global.ln.get("window-globals-number"), value : "#_NUMBERS:"},{ text : com_tilbuci_data_Global.ln.get("window-globals-flag"), value : "?_FLAGS:"},{ text : com_tilbuci_data_Global.ln.get("window-acinput-text"), value : "$_INPUT:"},{ text : com_tilbuci_data_Global.ln.get("window-acform-text"), value : "$_FORM:"},{ text : com_tilbuci_data_Global.ln.get("window-acparam-text"), value : "$_PARAM:"},{ text : com_tilbuci_data_Global.ln.get("window-acnumeric-text"), value : "#_NUMERIC:"},{ text : com_tilbuci_data_Global.ln.get("window-actoggle-text"), value : "?_TOGGLE:"}], sl : [], ht : 95};
	var tmp13 = com_tilbuci_data_Global.ln.get("window-globals-name");
	this.addForm(title,tmp.createColumnHolder("form",tmp6,tmp1.forge("right",[tmp2,tmp3,tmp4,tmp5,tmp7,tmp8,tmp9,{ tp : "Select", id : "ginstancen", vl : [], sl : []},tmp10,tmp11,tmp12,{ tp : "Label", id : "gname", tx : tmp13, vr : ""},{ tp : "TInput", id : "gname", tx : "", vr : ""},{ tp : "Custom", cont : this._idbuttons.h["gmovie"]}]),this.ui.forge("bottom",[{ tp : "Label", id : "showAction", tx : com_tilbuci_data_Global.ln.get("window-globals-showaction"), vr : feathers_controls_Label.VARIANT_DETAIL},{ tp : "TInput", id : "showAction", tx : ""}]),565));
	this.ui.listDbClick("list",$bind(this,this.onCopy));
	this.ui.setListToIcon("list");
	this.ui.setListToIcon("ggeneral");
};
$hxClasses["com.tilbuci.script.AssistBase"] = com_tilbuci_script_AssistBase;
com_tilbuci_script_AssistBase.__name__ = "com.tilbuci.script.AssistBase";
com_tilbuci_script_AssistBase.__super__ = com_tilbuci_ui_window_PopupWindow;
com_tilbuci_script_AssistBase.prototype = $extend(com_tilbuci_ui_window_PopupWindow.prototype,{
	_idbuttons: null
	,_actions: null
	,setActions: function(ac) {
		this._actions = ac;
		var list = [];
		var h = this._actions.h;
		var k_h = h;
		var k_keys = Object.keys(h);
		var k_length = k_keys.length;
		var k_current = 0;
		while(k_current < k_length) {
			var k = k_keys[k_current++];
			list.push({ text : k, value : k, asset : this._actions.h[k].ic});
		}
		this.ui.setListValues("list",list);
	}
	,acStart: function() {
		com_tilbuci_ui_window_PopupWindow.prototype.acStart.call(this);
		this.ui.setListSelectValue("list",null);
		this.ui.inputs.h["p1"].set_text("");
		this.ui.inputs.h["p2"].set_text("");
		this.ui.inputs.h["p3"].set_text("");
		this.ui.inputs.h["p4"].set_text("");
		this.ui.inputs.h["p5"].set_text("");
		this.ui.inputs.h["p6"].set_text("");
		this.ui.inputs.h["p7"].set_text("");
		this.ui.inputs.h["showAction"].set_text("");
		var list = [];
		var _g = 0;
		var _g1 = com_tilbuci_data_GlobalPlayer.area.getInstances();
		while(_g < _g1.length) {
			var k = _g1[_g];
			++_g;
			list.push({ text : k, value : k});
		}
		this.ui.setSelectOptions("ginstancen",list);
	}
	,startInterface: function(evt) {
		com_tilbuci_ui_window_PopupWindow.prototype.startInterface.call(this,evt);
		var h = this._idbuttons.h;
		var k_h = h;
		var k_keys = Object.keys(h);
		var k_length = k_keys.length;
		var k_current = 0;
		while(k_current < k_length) {
			var k = k_keys[k_current++];
			this._idbuttons.h[k].set_width(this.ui.buttons.h["close"].get_width());
		}
	}
	,onCopy: function(evt) {
		if(this.ui.lists.h["list"].get_selectedItem() != null) {
			var k = this.ui.lists.h["list"].get_selectedItem().value;
			if(Object.prototype.hasOwnProperty.call(this._actions.h,k)) {
				var ac = "{ \"ac\": \"" + k + "\", ";
				if(this._actions.h[k].p.length == 0) {
					ac += "\"param\": [ ] ";
				} else if(this._actions.h[k].p.length == 1) {
					ac += "\"param\": [ \"" + this.ui.inputs.h["p1"].get_text() + "\" ]";
				} else if(this._actions.h[k].p.length == 2) {
					ac += "\"param\": [ \"" + this.ui.inputs.h["p1"].get_text() + "\", \"" + this.ui.inputs.h["p2"].get_text() + "\" ]";
				} else if(this._actions.h[k].p.length == 3) {
					ac += "\"param\": [ \"" + this.ui.inputs.h["p1"].get_text() + "\", \"" + this.ui.inputs.h["p2"].get_text() + "\", \"" + this.ui.inputs.h["p3"].get_text() + "\" ]";
				} else if(this._actions.h[k].p.length == 4) {
					ac += "\"param\": [ \"" + this.ui.inputs.h["p1"].get_text() + "\", \"" + this.ui.inputs.h["p2"].get_text() + "\", \"" + this.ui.inputs.h["p3"].get_text() + "\", \"" + this.ui.inputs.h["p4"].get_text() + "\" ]";
				} else if(this._actions.h[k].p.length == 5) {
					ac += "\"param\": [ \"" + this.ui.inputs.h["p1"].get_text() + "\", \"" + this.ui.inputs.h["p2"].get_text() + "\", \"" + this.ui.inputs.h["p3"].get_text() + "\", \"" + this.ui.inputs.h["p4"].get_text() + "\", \"" + this.ui.inputs.h["p5"].get_text() + "\" ]";
				} else if(this._actions.h[k].p.length == 6) {
					ac += "\"param\": [ \"" + this.ui.inputs.h["p1"].get_text() + "\", \"" + this.ui.inputs.h["p2"].get_text() + "\", \"" + this.ui.inputs.h["p3"].get_text() + "\", \"" + this.ui.inputs.h["p4"].get_text() + "\", \"" + this.ui.inputs.h["p5"].get_text() + "\", \"" + this.ui.inputs.h["p6"].get_text() + "\" ]";
				} else {
					ac += "\"param\": [ \"" + this.ui.inputs.h["p1"].get_text() + "\", \"" + this.ui.inputs.h["p2"].get_text() + "\", \"" + this.ui.inputs.h["p3"].get_text() + "\", \"" + this.ui.inputs.h["p4"].get_text() + "\", \"" + this.ui.inputs.h["p5"].get_text() + "\", \"" + this.ui.inputs.h["p6"].get_text() + "\", \"" + this.ui.inputs.h["p7"].get_text() + "\" ]";
				}
				if(this._actions.h[k].c) {
					ac += ", \"then\": [ ], \"else\": [ ]";
				}
				if(this._actions.h[k].t) {
					ac += ", \"tick\": [ ], \"end\": [ ]";
				}
				if(this._actions.h[k].i) {
					ac += ", \"ok\": [ ], \"cancel\": [ ]";
				}
				if(this._actions.h[k].d) {
					ac += ", \"success\": [ ], \"error\": [ ]";
				}
				if(this._actions.h[k].s) {
					ac += ", \"select\": [ ]";
				}
				ac += " }";
				com_tilbuci_data_Global.copyText(ac);
				feathers_core_PopUpManager.removePopUp(this);
			}
		}
	}
	,onShow: function(evt) {
		if(this.ui.lists.h["list"].get_selectedItem() != null) {
			var k = this.ui.lists.h["list"].get_selectedItem().value;
			if(Object.prototype.hasOwnProperty.call(this._actions.h,k)) {
				var ac = "{ \"ac\": \"" + k + "\", ";
				if(this._actions.h[k].p.length == 0) {
					ac += "\"param\": [ ] ";
				} else if(this._actions.h[k].p.length == 1) {
					ac += "\"param\": [ \"" + this.ui.inputs.h["p1"].get_text() + "\" ]";
				} else if(this._actions.h[k].p.length == 2) {
					ac += "\"param\": [ \"" + this.ui.inputs.h["p1"].get_text() + "\", \"" + this.ui.inputs.h["p2"].get_text() + "\" ]";
				} else if(this._actions.h[k].p.length == 3) {
					ac += "\"param\": [ \"" + this.ui.inputs.h["p1"].get_text() + "\", \"" + this.ui.inputs.h["p2"].get_text() + "\", \"" + this.ui.inputs.h["p3"].get_text() + "\" ]";
				} else if(this._actions.h[k].p.length == 4) {
					ac += "\"param\": [ \"" + this.ui.inputs.h["p1"].get_text() + "\", \"" + this.ui.inputs.h["p2"].get_text() + "\", \"" + this.ui.inputs.h["p3"].get_text() + "\", \"" + this.ui.inputs.h["p4"].get_text() + "\" ]";
				} else if(this._actions.h[k].p.length == 5) {
					ac += "\"param\": [ \"" + this.ui.inputs.h["p1"].get_text() + "\", \"" + this.ui.inputs.h["p2"].get_text() + "\", \"" + this.ui.inputs.h["p3"].get_text() + "\", \"" + this.ui.inputs.h["p4"].get_text() + "\", \"" + this.ui.inputs.h["p5"].get_text() + "\" ]";
				} else if(this._actions.h[k].p.length == 6) {
					ac += "\"param\": [ \"" + this.ui.inputs.h["p1"].get_text() + "\", \"" + this.ui.inputs.h["p2"].get_text() + "\", \"" + this.ui.inputs.h["p3"].get_text() + "\", \"" + this.ui.inputs.h["p4"].get_text() + "\", \"" + this.ui.inputs.h["p5"].get_text() + "\", \"" + this.ui.inputs.h["p6"].get_text() + "\" ]";
				} else {
					ac += "\"param\": [ \"" + this.ui.inputs.h["p1"].get_text() + "\", \"" + this.ui.inputs.h["p2"].get_text() + "\", \"" + this.ui.inputs.h["p3"].get_text() + "\", \"" + this.ui.inputs.h["p4"].get_text() + "\", \"" + this.ui.inputs.h["p5"].get_text() + "\", \"" + this.ui.inputs.h["p6"].get_text() + "\", \"" + this.ui.inputs.h["p7"].get_text() + "\" ]";
				}
				if(this._actions.h[k].c) {
					ac += ", \"then\": [ ], \"else\": [ ]";
				}
				if(this._actions.h[k].t) {
					ac += ", \"tick\": [ ], \"end\": [ ]";
				}
				if(this._actions.h[k].i) {
					ac += ", \"ok\": [ ], \"cancel\": [ ]";
				}
				if(this._actions.h[k].d) {
					ac += ", \"success\": [ ], \"error\": [ ]";
				}
				if(this._actions.h[k].s) {
					ac += ", \"select\": [ ]";
				}
				ac += " }";
				this.ui.inputs.h["showAction"].set_text(ac);
			}
		}
	}
	,onGeneral: function(evt) {
		if(this.ui.lists.h["ggeneral"].get_selectedItem() != null) {
			this.ui.inputs.h["showAction"].set_text(this.ui.lists.h["ggeneral"].get_selectedItem().value);
			com_tilbuci_data_Global.copyText(this.ui.lists.h["ggeneral"].get_selectedItem().value);
		}
	}
	,onInstance: function(evt) {
		if(this.ui.selects.h["ginstancep"].get_selectedItem() != null) {
			if(this.ui.selects.h["ginstancen"].get_selectedItem() != null) {
				com_tilbuci_data_Global.copyText(this.ui.selects.h["ginstancep"].get_selectedItem().value + this.ui.selects.h["ginstancen"].get_selectedItem().value);
				this.ui.inputs.h["showAction"].set_text(this.ui.selects.h["ginstancep"].get_selectedItem().value + this.ui.selects.h["ginstancen"].get_selectedItem().value);
			}
		}
	}
	,onMovie: function(evt) {
		if(this.ui.selects.h["gmovie"].get_selectedItem() != null) {
			if(this.ui.inputs.h["gname"].get_text() != "") {
				com_tilbuci_data_Global.copyText(Std.string(this.ui.selects.h["gmovie"].get_selectedItem().value) + this.ui.inputs.h["gname"].get_text());
				this.ui.inputs.h["showAction"].set_text(Std.string(this.ui.selects.h["gmovie"].get_selectedItem().value) + this.ui.inputs.h["gname"].get_text());
			}
		}
	}
	,onClose: function(evt) {
		feathers_core_PopUpManager.removePopUp(this);
	}
	,__class__: com_tilbuci_script_AssistBase
});
var com_tilbuci_script_AssistContraptions = function(ac) {
	com_tilbuci_script_AssistBase.call(this,ac,com_tilbuci_data_Global.ln.get("window-contraptions-title"),com_tilbuci_data_Global.ln.get("window-contraptions-list"));
	var _g = new haxe_ds_StringMap();
	_g.h["contraption.message"] = { p : ["s","s","s","s"], c : false, t : false, i : false, d : false, s : true, ic : "icContraption"};
	_g.h["contraption.messagehide"] = { p : [], c : false, t : false, i : false, d : false, s : false, ic : "icContraption"};
	_g.h["contraption.menu"] = { p : ["s","s","s","s","i","i"], c : false, t : false, i : false, d : false, s : true, ic : "icContraption"};
	_g.h["contraption.menuhide"] = { p : [], c : false, t : false, i : false, d : false, s : false, ic : "icContraption"};
	_g.h["contraption.cover"] = { p : ["s"], c : false, t : false, i : false, d : false, s : true, ic : "icContraption"};
	_g.h["contraption.coverhide"] = { p : [], c : false, t : false, i : false, d : false, s : false, ic : "icContraption"};
	_g.h["contraption.background"] = { p : ["s"], c : false, t : false, i : false, d : false, s : true, ic : "icContraption"};
	_g.h["contraption.backgroundhide"] = { p : [], c : false, t : false, i : false, d : false, s : false, ic : "icContraption"};
	_g.h["contraption.showloading"] = { p : [], c : false, t : false, i : false, d : false, s : false, ic : "icContraption"};
	_g.h["contraption.hideloading"] = { p : [], c : false, t : false, i : false, d : false, s : false, ic : "icContraption"};
	_g.h["contraption.musicplay"] = { p : ["s"], c : false, t : false, i : false, d : false, s : true, ic : "icContraption"};
	_g.h["contraption.musicpause"] = { p : [], c : false, t : false, i : false, d : false, s : false, ic : "icContraption"};
	_g.h["contraption.musicstop"] = { p : [], c : false, t : false, i : false, d : false, s : false, ic : "icContraption"};
	_g.h["contraption.musicvolume"] = { p : ["i"], c : false, t : false, i : false, d : false, s : false, ic : "icContraption"};
	_g.h["contraption.form"] = { p : ["s","i","i"], c : false, t : false, i : true, d : false, s : true, ic : "icContraption"};
	_g.h["contraption.formvalue"] = { p : ["s","s"], c : false, t : false, i : false, d : false, s : true, ic : "icContraption"};
	_g.h["contraption.formsetstepper"] = { p : ["s","i","i","i"], c : false, t : false, i : false, d : false, s : true, ic : "icContraption"};
	_g.h["contraption.formhide"] = { p : [], c : false, t : false, i : false, d : false, s : false, ic : "icContraption"};
	_g.h["contraption.interface"] = { p : ["s","i","i"], c : false, t : false, i : false, d : false, s : true, ic : "icContraption"};
	_g.h["contraption.interfacehide"] = { p : ["s"], c : false, t : false, i : false, d : false, s : true, ic : "icContraption"};
	_g.h["contraption.interfacehideall"] = { p : [], c : false, t : false, i : false, d : false, s : true, ic : "icContraption"};
	_g.h["contraption.interfacetext"] = { p : ["s","s"], c : false, t : false, i : false, d : false, s : true, ic : "icContraption"};
	_g.h["contraption.interfaceanimframe"] = { p : ["s","i"], c : false, t : false, i : false, d : false, s : true, ic : "icContraption"};
	_g.h["contraption.interfaceanimplay"] = { p : ["s"], c : false, t : false, i : false, d : false, s : true, ic : "icContraption"};
	_g.h["contraption.interfaceanimpause"] = { p : ["s"], c : false, t : false, i : false, d : false, s : true, ic : "icContraption"};
	this.setActions(_g);
};
$hxClasses["com.tilbuci.script.AssistContraptions"] = com_tilbuci_script_AssistContraptions;
com_tilbuci_script_AssistContraptions.__name__ = "com.tilbuci.script.AssistContraptions";
com_tilbuci_script_AssistContraptions.__super__ = com_tilbuci_script_AssistBase;
com_tilbuci_script_AssistContraptions.prototype = $extend(com_tilbuci_script_AssistBase.prototype,{
	__class__: com_tilbuci_script_AssistContraptions
});
var com_tilbuci_script_AssistDataInput = function(ac) {
	com_tilbuci_script_AssistBase.call(this,ac,com_tilbuci_data_Global.ln.get("window-acdata-title"),com_tilbuci_data_Global.ln.get("window-acdata-list"));
	var _g = new haxe_ds_StringMap();
	_g.h["data.event"] = { p : ["s"], s : false, c : false, t : false, i : false, d : false, ic : "icData"};
	_g.h["data.eventclear"] = { p : [], s : false, c : false, t : false, i : false, d : false, ic : "icData"};
	_g.h["data.liststates"] = { p : [], s : false, c : false, t : false, i : false, d : true, ic : "icData"};
	_g.h["data.load"] = { p : ["s"], s : false, c : false, t : false, i : false, d : true, ic : "icData"};
	_g.h["data.loadlocal"] = { p : ["s"], s : false, c : false, t : false, i : false, d : true, ic : "icData"};
	_g.h["data.loadquickstate"] = { p : ["s"], s : false, c : false, t : false, i : false, d : true, ic : "icData"};
	_g.h["data.loadstatelocal"] = { p : [], s : false, c : false, t : false, i : false, d : true, ic : "icData"};
	_g.h["data.save"] = { p : ["s","s"], s : false, c : false, t : false, i : false, d : true, ic : "icData"};
	_g.h["data.savelocal"] = { p : ["s","s"], s : false, c : false, t : false, i : false, d : true, ic : "icData"};
	_g.h["data.savequickstate"] = { p : ["s"], s : false, c : false, t : false, i : false, d : true, ic : "icData"};
	_g.h["data.savestate"] = { p : ["s"], s : false, c : false, t : false, i : false, d : true, ic : "icData"};
	_g.h["data.savestatelocal"] = { p : [], s : false, c : false, t : false, i : false, d : true, ic : "icData"};
	_g.h["target.show"] = { p : [], s : false, c : false, t : false, i : false, d : false, ic : "icInput"};
	_g.h["target.hide"] = { p : [], s : false, c : false, t : false, i : false, d : false, ic : "icInput"};
	_g.h["target.toggle"] = { p : [], s : false, c : false, t : false, i : false, d : false, ic : "icInput"};
	_g.h["target.setposition"] = { p : ["i","i"], s : false, c : false, t : false, i : false, d : false, ic : "icInput"};
	_g.h["target.clear"] = { p : [], s : false, c : false, t : false, i : false, d : false, ic : "icInput"};
	_g.h["target.set"] = { p : ["s"], s : false, c : false, t : false, i : false, d : false, ic : "icInput"};
	_g.h["mouse.hide"] = { p : [], s : false, c : false, t : false, i : false, d : false, ic : "icInput"};
	_g.h["mouse.show"] = { p : [], s : false, c : false, t : false, i : false, d : false, ic : "icInput"};
	_g.h["input.email"] = { p : ["s","s"], s : false, c : false, t : false, i : true, d : false, ic : "icInput"};
	_g.h["input.float"] = { p : ["s","s","f","f","f"], s : false, c : false, t : false, i : true, d : false, ic : "icInput"};
	_g.h["input.int"] = { p : ["s","s","i","i","i"], s : false, c : false, t : false, i : true, d : false, ic : "icInput"};
	_g.h["input.list"] = { p : ["s","s","s","s"], s : false, c : false, t : false, i : true, d : false, ic : "icInput"};
	_g.h["input.login"] = { p : [], s : false, c : false, t : false, i : true, d : false, ic : "icInput"};
	_g.h["input.message"] = { p : ["s","s"], s : false, c : false, t : false, i : true, d : false, ic : "icInput"};
	_g.h["input.string"] = { p : ["s","s"], s : false, c : false, t : false, i : true, d : false, ic : "icInput"};
	_g.h["input.add"] = { p : ["s","i","i","i","s"], s : false, c : false, t : false, i : false, d : false, ic : "icInput"};
	_g.h["input.place"] = { p : ["s","i","i","i"], s : false, c : false, t : false, i : false, d : false, ic : "icInput"};
	_g.h["input.remove"] = { p : ["s"], s : false, c : false, t : false, i : false, d : false, ic : "icInput"};
	_g.h["input.removeall"] = { p : [], s : false, c : false, t : false, i : false, d : false, ic : "icInput"};
	_g.h["input.settext"] = { p : ["s","s"], s : false, c : false, t : false, i : false, d : false, ic : "icInput"};
	_g.h["input.addtarea"] = { p : ["s","i","i","i","i"], s : false, c : false, t : false, i : false, d : false, ic : "icInput"};
	_g.h["input.placetarea"] = { p : ["s","i","i","i","i"], s : false, c : false, t : false, i : false, d : false, ic : "icInput"};
	_g.h["input.removetarea"] = { p : ["s"], s : false, c : false, t : false, i : false, d : false, ic : "icInput"};
	_g.h["input.removealltareas"] = { p : [], s : false, c : false, t : false, i : false, d : false, ic : "icInput"};
	_g.h["input.settextarea"] = { p : ["s","s"], s : false, c : false, t : false, i : false, d : false, ic : "icInput"};
	_g.h["input.setpassword"] = { p : ["s","b"], s : false, c : false, t : false, i : false, d : false, ic : "icInput"};
	_g.h["input.addnumeric"] = { p : ["s","i","i","i","i"], s : false, c : false, t : false, i : false, d : false, ic : "icInput"};
	_g.h["input.placenumeric"] = { p : ["s","i","i","i"], s : false, c : false, t : false, i : false, d : false, ic : "icInput"};
	_g.h["input.removenumeric"] = { p : ["s"], s : false, c : false, t : false, i : false, d : false, ic : "icInput"};
	_g.h["input.removeallnumerics"] = { p : [], s : false, c : false, t : false, i : false, d : false, ic : "icInput"};
	_g.h["input.setnumeric"] = { p : ["s","i"], s : false, c : false, t : false, i : false, d : false, ic : "icInput"};
	_g.h["input.setnumericbounds"] = { p : ["s","i","i","i"], s : false, c : false, t : false, i : false, d : false, ic : "icInput"};
	_g.h["input.addtoggle"] = { p : ["s","b","i","i"], s : false, c : false, t : false, i : false, d : false, ic : "icInput"};
	_g.h["input.placetoggle"] = { p : ["s","i","i"], s : false, c : false, t : false, i : false, d : false, ic : "icInput"};
	_g.h["input.removetoggle"] = { p : ["s"], s : false, c : false, t : false, i : false, d : false, ic : "icInput"};
	_g.h["input.removealltoggles"] = { p : [], s : false, c : false, t : false, i : false, d : false, ic : "icInput"};
	_g.h["input.settoggle"] = { p : ["s","b"], s : false, c : false, t : false, i : false, d : false, ic : "icInput"};
	_g.h["input.inverttoggle"] = { p : ["s"], s : false, c : false, t : false, i : false, d : false, ic : "icInput"};
	this.setActions(_g);
};
$hxClasses["com.tilbuci.script.AssistDataInput"] = com_tilbuci_script_AssistDataInput;
com_tilbuci_script_AssistDataInput.__name__ = "com.tilbuci.script.AssistDataInput";
com_tilbuci_script_AssistDataInput.__super__ = com_tilbuci_script_AssistBase;
com_tilbuci_script_AssistDataInput.prototype = $extend(com_tilbuci_script_AssistBase.prototype,{
	__class__: com_tilbuci_script_AssistDataInput
});
var com_tilbuci_script_AssistInstance = function(ac) {
	this._idbuttons = new haxe_ds_StringMap();
	com_tilbuci_ui_window_PopupWindow.call(this,ac,com_tilbuci_data_Global.ln.get("window-acinstance-title"),800,com_tilbuci_ui_base_InterfaceFactory.pickValue(630,690),false);
	var this1 = this._idbuttons;
	var v = new com_tilbuci_ui_component_IDButton("create",$bind(this,this.onCopy),com_tilbuci_data_Global.ln.get("window-acinstance-create"),openfl_utils_Assets.getBitmapData("btCopy"));
	this1.h["create"] = v;
	var this1 = this._idbuttons;
	var v = new com_tilbuci_ui_component_IDButton("btShow",$bind(this,this.onShow),com_tilbuci_data_Global.ln.get("window-acvariable-show"));
	this1.h["btShow"] = v;
	var this1 = this._idbuttons;
	var v = new com_tilbuci_ui_component_IDButton("cpasset",$bind(this,this.onAsset),com_tilbuci_data_Global.ln.get("window-acinstance-cpasset"),openfl_utils_Assets.getBitmapData("btCopy"));
	this1.h["cpasset"] = v;
	var this1 = this._idbuttons;
	var v = new com_tilbuci_ui_component_IDButton("ggeneral",$bind(this,this.onGeneral),com_tilbuci_data_Global.ln.get("window-globals-get"),openfl_utils_Assets.getBitmapData("btCopy"));
	this1.h["ggeneral"] = v;
	var this1 = this._idbuttons;
	var v = new com_tilbuci_ui_component_IDButton("instance",$bind(this,this.onInstance),com_tilbuci_data_Global.ln.get("window-globals-get"),openfl_utils_Assets.getBitmapData("btCopy"));
	this1.h["ginstance"] = v;
	var this1 = this._idbuttons;
	var v = new com_tilbuci_ui_component_IDButton("movie",$bind(this,this.onMovie),com_tilbuci_data_Global.ln.get("window-globals-get"),openfl_utils_Assets.getBitmapData("btCopy"));
	this1.h["gmovie"] = v;
	var tmp = com_tilbuci_data_Global.ln.get("window-acinstance-title");
	var tmp1 = this.ui;
	var tmp2 = this.ui;
	var tmp3 = { tp : "Label", id : "list", tx : com_tilbuci_data_Global.ln.get("window-acinstance-current"), vr : ""};
	var tmp4 = { tp : "Label", id : "actions", tx : com_tilbuci_data_Global.ln.get("window-acinstance-action"), vr : ""};
	var tmp5 = { tp : "Select", id : "actions", vl : [{ text : com_tilbuci_data_Global.ln.get("window-acinstance-set"), value : "set"},{ text : com_tilbuci_data_Global.ln.get("window-acinstance-clear"), value : "clear"},{ text : com_tilbuci_data_Global.ln.get("window-acinstance-clearall"), value : "clearall"},{ text : com_tilbuci_data_Global.ln.get("window-acinstance-play"), value : "play"},{ text : com_tilbuci_data_Global.ln.get("window-acinstance-pause"), value : "pause"},{ text : com_tilbuci_data_Global.ln.get("window-acinstance-stop"), value : "stop"},{ text : com_tilbuci_data_Global.ln.get("window-acinstance-next"), value : "next"},{ text : com_tilbuci_data_Global.ln.get("window-acinstance-previous"), value : "previous"},{ text : com_tilbuci_data_Global.ln.get("window-acinstance-seek"), value : "seek"},{ text : com_tilbuci_data_Global.ln.get("window-acinstance-zoom"), value : "zoom"},{ text : com_tilbuci_data_Global.ln.get("window-acinstance-scrollbottom"), value : "scrollbottom"},{ text : com_tilbuci_data_Global.ln.get("window-acinstance-scrolltop"), value : "scrolltop"},{ text : com_tilbuci_data_Global.ln.get("window-acinstance-scrolldown"), value : "scrolldown"},{ text : com_tilbuci_data_Global.ln.get("window-acinstance-scrollup"), value : "scrollup"},{ text : com_tilbuci_data_Global.ln.get("window-acinstance-loasasset"), value : "loadasset"}], sl : null};
	var tmp6 = { tp : "Label", id : "property", tx : com_tilbuci_data_Global.ln.get("window-acinstance-property"), vr : ""};
	var tmp7 = { tp : "Select", id : "property", vl : [{ text : com_tilbuci_data_Global.ln.get("window-acinstance-px"), value : "x"},{ text : com_tilbuci_data_Global.ln.get("window-acinstance-py"), value : "y"},{ text : com_tilbuci_data_Global.ln.get("window-acinstance-pwidth"), value : "width"},{ text : com_tilbuci_data_Global.ln.get("window-acinstance-pheight"), value : "height"},{ text : com_tilbuci_data_Global.ln.get("window-acinstance-palpha"), value : "alpha"},{ text : com_tilbuci_data_Global.ln.get("window-acinstance-porder"), value : "order"},{ text : com_tilbuci_data_Global.ln.get("window-acinstance-pvisible"), value : "visible"},{ text : com_tilbuci_data_Global.ln.get("window-acinstance-pcolor"), value : "color"},{ text : com_tilbuci_data_Global.ln.get("window-acinstance-pcoloralpha"), value : "coloralpha"},{ text : com_tilbuci_data_Global.ln.get("window-acinstance-pfont"), value : "font"},{ text : com_tilbuci_data_Global.ln.get("window-acinstance-pfontsize"), value : "fontsize"},{ text : com_tilbuci_data_Global.ln.get("window-acinstance-pfontalign"), value : "fontalign"},{ text : com_tilbuci_data_Global.ln.get("window-acinstance-pfontbackground"), value : "fontbackground"},{ text : com_tilbuci_data_Global.ln.get("window-acinstance-pfontcolor"), value : "fontcolor"},{ text : com_tilbuci_data_Global.ln.get("window-acinstance-pfontbold"), value : "fontbold"},{ text : com_tilbuci_data_Global.ln.get("window-acinstance-pfontitalic"), value : "fontitalic"},{ text : com_tilbuci_data_Global.ln.get("window-acinstance-pfontleading"), value : "fontleading"},{ text : com_tilbuci_data_Global.ln.get("window-acinstance-pparagraph"), value : "paragraph"},{ text : com_tilbuci_data_Global.ln.get("window-acinstance-pvolume"), value : "volume"},{ text : com_tilbuci_data_Global.ln.get("window-acinstance-protation"), value : "rotation"}], sl : null};
	var tmp8 = { tp : "Label", id : "horizontal", tx : com_tilbuci_data_Global.ln.get("window-acinstance-horizontal"), vr : ""};
	var tmp9 = { tp : "Label", id : "vertical", tx : com_tilbuci_data_Global.ln.get("window-acinstance-vertical"), vr : ""};
	var tmp10 = { tp : "Label", id : "other", tx : com_tilbuci_data_Global.ln.get("window-acinstance-other"), vr : ""};
	var tmp11 = { tp : "Custom", cont : this._idbuttons.h["create"]};
	var tmp12 = { tp : "Custom", cont : this._idbuttons.h["btShow"]};
	var tmp13 = { tp : "Button", id : "close", tx : com_tilbuci_data_Global.ln.get("window-actions-close"), ac : $bind(this,this.onClose)};
	var tmp14 = com_tilbuci_data_Global.ln.get("window-globals-showaction");
	var tmp15 = tmp2.forge("left",[tmp3,{ tp : "List", id : "list", vl : [], sl : [], ht : 108},tmp4,tmp5,tmp6,tmp7,tmp8,{ tp : "TInput", id : "horizontal", vl : "", vr : ""},tmp9,{ tp : "TInput", id : "vertical", vl : "", vr : ""},tmp10,{ tp : "TInput", id : "other", vl : "", vr : ""},tmp11,tmp12,tmp13,{ tp : "Spacer", id : "showAction", ht : 5, ln : false},{ tp : "Label", id : "showAction", tx : tmp14, vr : feathers_controls_Label.VARIANT_DETAIL},{ tp : "TInput", id : "showAction", tx : ""}]);
	var tmp2 = this.ui;
	var tmp3 = { tp : "Label", id : "collections", tx : com_tilbuci_data_Global.ln.get("window-acinstance-collections"), vr : ""};
	var tmp4 = { tp : "Label", id : "assets", tx : com_tilbuci_data_Global.ln.get("window-acinstance-assets"), vr : ""};
	var tmp5 = { tp : "Custom", cont : this._idbuttons.h["cpasset"]};
	var tmp6 = { tp : "Label", id : "ggeneral", tx : com_tilbuci_data_Global.ln.get("window-globals-general"), vr : ""};
	var tmp7 = { tp : "Select", id : "ggeneral", vl : [{ text : com_tilbuci_data_Global.ln.get("window-globals-playing"), value : "?_PLAYING", asset : "btBool"},{ text : com_tilbuci_data_Global.ln.get("window-globals-userlogged"), value : "?_USERLOGGED", asset : "btBool"},{ text : com_tilbuci_data_Global.ln.get("window-globals-hadinteraction"), value : "?_HADINTERACTION", asset : "btBool"},{ text : com_tilbuci_data_Global.ln.get("window-globals-server"), value : "?_SERVER", asset : "btBool"},{ text : com_tilbuci_data_Global.ln.get("window-globals-keyframe"), value : "#_KEYFRAME", asset : "btFloat"},{ text : com_tilbuci_data_Global.ln.get("window-globals-areabig"), value : "#_AREABIG", asset : "btFloat"},{ text : com_tilbuci_data_Global.ln.get("window-globals-areasmall"), value : "#_AREASMALL", asset : "btFloat"},{ text : com_tilbuci_data_Global.ln.get("window-globals-contentx"), value : "#_CONTENTX", asset : "btFloat"},{ text : com_tilbuci_data_Global.ln.get("window-globals-contenty"), value : "#_CONTENTY", asset : "btFloat"},{ text : com_tilbuci_data_Global.ln.get("window-globals-contentwidth"), value : "#_CONTENTWIDTH", asset : "btFloat"},{ text : com_tilbuci_data_Global.ln.get("window-globals-contentheight"), value : "#_CONTENTHEIGHT", asset : "btFloat"},{ text : com_tilbuci_data_Global.ln.get("window-globals-movietitle"), value : "$_MOVIETITLE", asset : "btString"},{ text : com_tilbuci_data_Global.ln.get("window-globals-movieid"), value : "$_MOVIEID", asset : "btString"},{ text : com_tilbuci_data_Global.ln.get("window-globals-scenetitle"), value : "$_SCENETITLE", asset : "btString"},{ text : com_tilbuci_data_Global.ln.get("window-globals-sceneid"), value : "$_SCENEID", asset : "btString"},{ text : com_tilbuci_data_Global.ln.get("window-globals-orientation"), value : "$_ORIENTATION", asset : "btString"},{ text : com_tilbuci_data_Global.ln.get("window-globals-urlmovie"), value : "$_URLMOVIE", asset : "btString"},{ text : com_tilbuci_data_Global.ln.get("window-globals-urlscene"), value : "$_URLSCENE", asset : "btString"},{ text : com_tilbuci_data_Global.ln.get("window-globals-username"), value : "$_USERNAME", asset : "btString"},{ text : com_tilbuci_data_Global.ln.get("window-globals-runtime"), value : "$_RUNTIME", asset : "btString"},{ text : com_tilbuci_data_Global.ln.get("window-globals-wsserver"), value : "$_WSSERVER", asset : "btString"},{ text : com_tilbuci_data_Global.ln.get("window-globals-version"), value : "$_VERSION", asset : "btString"},{ text : com_tilbuci_data_Global.ln.get("window-globals-session"), value : "$_SESSION", asset : "btString"},{ text : com_tilbuci_data_Global.ln.get("window-globals-date"), value : "$_DATE", asset : "btString"},{ text : com_tilbuci_data_Global.ln.get("window-globals-time"), value : "$_TIME", asset : "btString"},{ text : com_tilbuci_data_Global.ln.get("window-globals-year"), value : "$_YEAR", asset : "btString"},{ text : com_tilbuci_data_Global.ln.get("window-globals-month"), value : "$_MONTH", asset : "btString"},{ text : com_tilbuci_data_Global.ln.get("window-globals-day"), value : "$_DAY", asset : "btString"},{ text : com_tilbuci_data_Global.ln.get("window-globals-hour"), value : "$_HOUR", asset : "btString"},{ text : com_tilbuci_data_Global.ln.get("window-globals-minute"), value : "$_MINUTE", asset : "btString"},{ text : com_tilbuci_data_Global.ln.get("window-globals-second"), value : "$_SECOND", asset : "btString"}], sl : []};
	var tmp8 = { tp : "Custom", cont : this._idbuttons.h["ggeneral"]};
	var tmp9 = { tp : "Label", id : "ginstance", tx : com_tilbuci_data_Global.ln.get("window-globals-instance"), vr : ""};
	var tmp10 = { tp : "Label", id : "ginstancep", tx : com_tilbuci_data_Global.ln.get("window-globals-instancep"), vr : feathers_controls_Label.VARIANT_DETAIL};
	var tmp11 = { tp : "Select", id : "ginstancep", vl : [{ text : com_tilbuci_data_Global.ln.get("window-globals-instplaying"), value : "?_INSTANCEPLAYING:"},{ text : com_tilbuci_data_Global.ln.get("window-globals-instvisible"), value : "?_INSTANCEVISIBLE:"},{ text : com_tilbuci_data_Global.ln.get("window-globals-instfontbold"), value : "?_INSTANCEFONTBOLD:"},{ text : com_tilbuci_data_Global.ln.get("window-globals-instfontitalic"), value : "?_INSTANCEFONTITALIC:"},{ text : com_tilbuci_data_Global.ln.get("window-acinstance-px"), value : "#_INSTANCEX:"},{ text : com_tilbuci_data_Global.ln.get("window-acinstance-py"), value : "#_INSTANCEY:"},{ text : com_tilbuci_data_Global.ln.get("window-acinstance-pwidth"), value : "#_INSTANCEWIDTH:"},{ text : com_tilbuci_data_Global.ln.get("window-acinstance-pheight"), value : "#_INSTANCEHEIGHT:"},{ text : com_tilbuci_data_Global.ln.get("window-acinstance-palpha"), value : "#_INSTANCEALPHA:"},{ text : com_tilbuci_data_Global.ln.get("window-acinstance-pvolume"), value : "#_INSTANCEVOLUME:"},{ text : com_tilbuci_data_Global.ln.get("window-acinstance-porder"), value : "#_INSTANCEORDER:"},{ text : com_tilbuci_data_Global.ln.get("window-acinstance-pcoloralpha"), value : "#_INSTANCECOLORALPHA:"},{ text : com_tilbuci_data_Global.ln.get("window-acinstance-protation"), value : "#_INSTANCEROTATION:"},{ text : com_tilbuci_data_Global.ln.get("window-acinstance-pfontsize"), value : "#_INSTANCEFONTSIZE:"},{ text : com_tilbuci_data_Global.ln.get("window-acinstance-pfontleading"), value : "#_INSTANCEFONTLEADING:"},{ text : com_tilbuci_data_Global.ln.get("window-acinstance-pcolor"), value : "$_INSTANCECOLOR:"},{ text : com_tilbuci_data_Global.ln.get("window-globals-insttext"), value : "$_INSTANCETEXT:"},{ text : com_tilbuci_data_Global.ln.get("window-acinstance-pfont"), value : "$_INSTANCEFONT:"},{ text : com_tilbuci_data_Global.ln.get("window-acinstance-pfontcolor"), value : "$_INSTANCEFONTCOLOR:"}], sl : []};
	var tmp12 = { tp : "Label", id : "ginstancen", tx : com_tilbuci_data_Global.ln.get("window-globals-instancen"), vr : feathers_controls_Label.VARIANT_DETAIL};
	var tmp13 = { tp : "Custom", cont : this._idbuttons.h["ginstance"]};
	var tmp14 = { tp : "Label", id : "gmovie", tx : com_tilbuci_data_Global.ln.get("window-globals-movie"), vr : ""};
	var tmp16 = { tp : "Select", id : "gmovie", vl : [{ text : com_tilbuci_data_Global.ln.get("window-globals-text"), value : "$_TEXTS:"},{ text : com_tilbuci_data_Global.ln.get("window-globals-number"), value : "#_NUMBERS:"},{ text : com_tilbuci_data_Global.ln.get("window-globals-flag"), value : "?_FLAGS:"},{ text : com_tilbuci_data_Global.ln.get("window-acinput-text"), value : "$_INPUT:"},{ text : com_tilbuci_data_Global.ln.get("window-acform-text"), value : "$_FORM:"},{ text : com_tilbuci_data_Global.ln.get("window-acparam-text"), value : "$_PARAM:"},{ text : com_tilbuci_data_Global.ln.get("window-acnumeric-text"), value : "#_NUMERIC:"},{ text : com_tilbuci_data_Global.ln.get("window-actoggle-text"), value : "?_TOGGLE:"}], sl : [], ht : 95};
	var tmp17 = com_tilbuci_data_Global.ln.get("window-globals-name");
	this.addForm(tmp,tmp1.createColumnHolder("form",tmp15,tmp2.forge("right",[tmp3,{ tp : "Select", id : "collections", vl : [], sl : [], ch : $bind(this,this.onCollection)},tmp4,{ tp : "Select", id : "assets", vl : [], sl : []},tmp5,{ tp : "Spacer", id : "cpasset", ht : 38, ln : true},tmp6,tmp7,tmp8,tmp9,tmp10,tmp11,tmp12,{ tp : "Select", id : "ginstancen", vl : [], sl : []},tmp13,tmp14,tmp16,{ tp : "Label", id : "gname", tx : tmp17, vr : ""},{ tp : "TInput", id : "gname", tx : "", vr : ""},{ tp : "Custom", cont : this._idbuttons.h["gmovie"]}])));
};
$hxClasses["com.tilbuci.script.AssistInstance"] = com_tilbuci_script_AssistInstance;
com_tilbuci_script_AssistInstance.__name__ = "com.tilbuci.script.AssistInstance";
com_tilbuci_script_AssistInstance.__super__ = com_tilbuci_ui_window_PopupWindow;
com_tilbuci_script_AssistInstance.prototype = $extend(com_tilbuci_ui_window_PopupWindow.prototype,{
	_idbuttons: null
	,acStart: function() {
		com_tilbuci_ui_window_PopupWindow.prototype.acStart.call(this);
		var list = [];
		var _g = 0;
		var _g1 = com_tilbuci_data_GlobalPlayer.area.getInstances();
		while(_g < _g1.length) {
			var k = _g1[_g];
			++_g;
			list.push({ text : k, value : k});
		}
		this.ui.setListValues("list",list);
		this.ui.setSelectOptions("ginstancen",list);
		var collist = [];
		var h = com_tilbuci_data_GlobalPlayer.movie.collections.h;
		var k_h = h;
		var k_keys = Object.keys(h);
		var k_length = k_keys.length;
		var k_current = 0;
		while(k_current < k_length) {
			var k = k_keys[k_current++];
			collist.push({ text : com_tilbuci_data_GlobalPlayer.movie.collections.h[k].name, value : k});
		}
		this.ui.setSelectOptions("collections",collist);
		this.onCollection();
	}
	,startInterface: function(evt) {
		com_tilbuci_ui_window_PopupWindow.prototype.startInterface.call(this,evt);
		var h = this._idbuttons.h;
		var k_h = h;
		var k_keys = Object.keys(h);
		var k_length = k_keys.length;
		var k_current = 0;
		while(k_current < k_length) {
			var k = k_keys[k_current++];
			this._idbuttons.h[k].set_width(this.ui.buttons.h["close"].get_width());
		}
	}
	,onCopy: function(evt) {
		if(this.ui.lists.h["list"].get_selectedItem() != null) {
			switch(this.ui.selects.h["actions"].get_selectedItem().value) {
			case "clear":
				if(this.ui.selects.h["property"].get_selectedItem().value != "paragraph") {
					com_tilbuci_data_Global.copyText("{ \"ac\": \"instance.clear" + Std.string(this.ui.selects.h["property"].get_selectedItem().value) + "\", \"param\": [ \"" + Std.string(this.ui.lists.h["list"].get_selectedItem().value) + "\" ] }");
					feathers_core_PopUpManager.removePopUp(this);
				}
				break;
			case "loadasset":
				com_tilbuci_data_Global.copyText("{ \"ac\": \"instance." + Std.string(this.ui.selects.h["actions"].get_selectedItem().value) + "\", \"param\": [ \"" + Std.string(this.ui.lists.h["list"].get_selectedItem().value) + "\", \"" + this.ui.inputs.h["other"].get_text() + "\" ] }");
				feathers_core_PopUpManager.removePopUp(this);
				break;
			case "seek":
				com_tilbuci_data_Global.copyText("{ \"ac\": \"instance." + Std.string(this.ui.selects.h["actions"].get_selectedItem().value) + "\", \"param\": [ \"" + Std.string(this.ui.lists.h["list"].get_selectedItem().value) + "\", \"" + this.ui.inputs.h["other"].get_text() + "\" ] }");
				feathers_core_PopUpManager.removePopUp(this);
				break;
			case "set":
				if(this.ui.selects.h["property"].get_selectedItem().value == "paragraph") {
					com_tilbuci_data_Global.copyText("{ \"ac\": \"instance.setparagraph\", \"param\": [ \"" + Std.string(this.ui.lists.h["list"].get_selectedItem().value) + "\", \"" + this.ui.inputs.h["other"].get_text() + "\" ] }");
					feathers_core_PopUpManager.removePopUp(this);
				} else {
					com_tilbuci_data_Global.copyText("{ \"ac\": \"instance.set" + Std.string(this.ui.selects.h["property"].get_selectedItem().value) + "\", \"param\": [ \"" + Std.string(this.ui.lists.h["list"].get_selectedItem().value) + "\", \"" + this.ui.inputs.h["horizontal"].get_text() + "\", \"" + this.ui.inputs.h["vertical"].get_text() + "\" ] }");
					feathers_core_PopUpManager.removePopUp(this);
				}
				break;
			default:
				com_tilbuci_data_Global.copyText("{ \"ac\": \"instance." + Std.string(this.ui.selects.h["actions"].get_selectedItem().value) + "\", \"param\": [ \"" + Std.string(this.ui.lists.h["list"].get_selectedItem().value) + "\" ] }");
				feathers_core_PopUpManager.removePopUp(this);
			}
		}
	}
	,onShow: function(evt) {
		if(this.ui.lists.h["list"].get_selectedItem() != null) {
			switch(this.ui.selects.h["actions"].get_selectedItem().value) {
			case "clear":
				if(this.ui.selects.h["property"].get_selectedItem().value != "paragraph") {
					this.ui.inputs.h["showAction"].set_text("{ \"ac\": \"instance.clear" + Std.string(this.ui.selects.h["property"].get_selectedItem().value) + "\", \"param\": [ \"" + Std.string(this.ui.lists.h["list"].get_selectedItem().value) + "\" ] }");
				}
				break;
			case "loadasset":
				this.ui.inputs.h["showAction"].set_text("{ \"ac\": \"instance." + Std.string(this.ui.selects.h["actions"].get_selectedItem().value) + "\", \"param\": [ \"" + Std.string(this.ui.lists.h["list"].get_selectedItem().value) + "\", \"" + this.ui.inputs.h["other"].get_text() + "\" ] }");
				break;
			case "seek":
				this.ui.inputs.h["showAction"].set_text("{ \"ac\": \"instance." + Std.string(this.ui.selects.h["actions"].get_selectedItem().value) + "\", \"param\": [ \"" + Std.string(this.ui.lists.h["list"].get_selectedItem().value) + "\", \"" + this.ui.inputs.h["other"].get_text() + "\" ] }");
				break;
			case "set":
				if(this.ui.selects.h["property"].get_selectedItem().value == "paragraph") {
					this.ui.inputs.h["showAction"].set_text("{ \"ac\": \"instance.setparagraph\", \"param\": [ \"" + Std.string(this.ui.lists.h["list"].get_selectedItem().value) + "\", \"" + this.ui.inputs.h["other"].get_text() + "\" ] }");
				} else {
					this.ui.inputs.h["showAction"].set_text("{ \"ac\": \"instance.set" + Std.string(this.ui.selects.h["property"].get_selectedItem().value) + "\", \"param\": [ \"" + Std.string(this.ui.lists.h["list"].get_selectedItem().value) + "\", \"" + this.ui.inputs.h["horizontal"].get_text() + "\", \"" + this.ui.inputs.h["vertical"].get_text() + "\" ] }");
				}
				break;
			default:
				this.ui.inputs.h["showAction"].set_text("{ \"ac\": \"instance." + Std.string(this.ui.selects.h["actions"].get_selectedItem().value) + "\", \"param\": [ \"" + Std.string(this.ui.lists.h["list"].get_selectedItem().value) + "\" ] }");
			}
		}
	}
	,onCollection: function(evt) {
		if(this.ui.selects.h["collections"].get_selectedItem() != null) {
			var list = [];
			var this1 = com_tilbuci_data_GlobalPlayer.movie.collections;
			var key = this.ui.selects.h["collections"].get_selectedItem().value;
			var h = this1.h[key].assets.h;
			var k_h = h;
			var k_keys = Object.keys(h);
			var k_length = k_keys.length;
			var k_current = 0;
			while(k_current < k_length) {
				var k = k_keys[k_current++];
				var this1 = com_tilbuci_data_GlobalPlayer.movie.collections;
				var key = this.ui.selects.h["collections"].get_selectedItem().value;
				list.push({ text : this1.h[key].assets.h[k].name, value : k});
			}
			this.ui.setSelectOptions("assets",list);
			this.ui.setSelectValue("assets",null);
		}
	}
	,onAsset: function(evt) {
		if(this.ui.selects.h["assets"].get_selectedItem() != null) {
			this.ui.inputs.h["showAction"].set_text(this.ui.selects.h["assets"].get_selectedItem().value);
			com_tilbuci_data_Global.copyText(this.ui.selects.h["assets"].get_selectedItem().value);
		}
	}
	,onGeneral: function(evt) {
		if(this.ui.selects.h["ggeneral"].get_selectedItem() != null) {
			this.ui.inputs.h["showAction"].set_text(this.ui.selects.h["ggeneral"].get_selectedItem().value);
			com_tilbuci_data_Global.copyText(this.ui.selects.h["ggeneral"].get_selectedItem().value);
		}
	}
	,onInstance: function(evt) {
		if(this.ui.selects.h["ginstancep"].get_selectedItem() != null) {
			if(this.ui.selects.h["ginstancen"].get_selectedItem() != null) {
				this.ui.inputs.h["showAction"].set_text(this.ui.selects.h["ginstancep"].get_selectedItem().value + this.ui.selects.h["ginstancen"].get_selectedItem().value);
				com_tilbuci_data_Global.copyText(this.ui.selects.h["ginstancep"].get_selectedItem().value + this.ui.selects.h["ginstancen"].get_selectedItem().value);
			}
		}
	}
	,onMovie: function(evt) {
		if(this.ui.selects.h["gmovie"].get_selectedItem() != null) {
			if(this.ui.inputs.h["gname"].get_text() != "") {
				this.ui.inputs.h["showAction"].set_text(Std.string(this.ui.selects.h["gmovie"].get_selectedItem().value) + this.ui.inputs.h["gname"].get_text());
				com_tilbuci_data_Global.copyText(Std.string(this.ui.selects.h["gmovie"].get_selectedItem().value) + this.ui.inputs.h["gname"].get_text());
			}
		}
	}
	,onClose: function(evt) {
		feathers_core_PopUpManager.removePopUp(this);
	}
	,__class__: com_tilbuci_script_AssistInstance
});
var com_tilbuci_script_AssistNarrative = function(ac) {
	com_tilbuci_script_AssistBase.call(this,ac,com_tilbuci_data_Global.ln.get("window-narrative-title"),com_tilbuci_data_Global.ln.get("window-narrative-list"));
	var _g = new haxe_ds_StringMap();
	_g.h["dialogue.loadgroup"] = { p : ["s"], s : false, c : false, t : false, i : false, d : true, ic : "icNarrative"};
	_g.h["dialogue.start"] = { p : ["s"], s : false, c : false, t : false, i : false, d : false, ic : "icNarrative"};
	_g.h["dialogue.next"] = { p : [], s : false, c : false, t : false, i : false, d : false, ic : "icNarrative"};
	_g.h["dialogue.previous"] = { p : [], s : false, c : false, t : false, i : false, d : false, ic : "icNarrative"};
	_g.h["dialogue.last"] = { p : [], s : false, c : false, t : false, i : false, d : false, ic : "icNarrative"};
	_g.h["dialogue.first"] = { p : [], s : false, c : false, t : false, i : false, d : false, ic : "icNarrative"};
	_g.h["dialogue.close"] = { p : [], s : false, c : false, t : false, i : false, d : false, ic : "icNarrative"};
	this.setActions(_g);
};
$hxClasses["com.tilbuci.script.AssistNarrative"] = com_tilbuci_script_AssistNarrative;
com_tilbuci_script_AssistNarrative.__name__ = "com.tilbuci.script.AssistNarrative";
com_tilbuci_script_AssistNarrative.__super__ = com_tilbuci_script_AssistBase;
com_tilbuci_script_AssistNarrative.prototype = $extend(com_tilbuci_script_AssistBase.prototype,{
	__class__: com_tilbuci_script_AssistNarrative
});
var com_tilbuci_script_AssistPlugin = function(ac) {
	com_tilbuci_script_AssistBase.call(this,ac,com_tilbuci_data_Global.ln.get("window-plugin-title"),com_tilbuci_data_Global.ln.get("window-plugin-list"));
	var _g = new haxe_ds_StringMap();
	_g.h["analytics.event"] = { p : ["s","s"], s : false, c : false, t : false, i : false, d : false, ic : "icGoogle"};
	_g.h["call.sdprocess"] = { p : ["s","s"], s : false, c : false, t : false, i : false, d : true, ic : "icServer"};
	_g.h["call.process"] = { p : ["s","s"], s : false, c : false, t : false, i : false, d : true, ic : "icServer"};
	_g.h["call.url"] = { p : ["s"], s : false, c : false, t : false, i : false, d : true, ic : "icServer"};
	_g.h["debuginfo.hide"] = { p : [], s : false, c : false, t : false, i : false, d : false, ic : "icDebug"};
	_g.h["debuginfo.show"] = { p : [], s : false, c : false, t : false, i : false, d : false, ic : "icDebug"};
	_g.h["overlay.show"] = { p : ["s","s"], s : false, c : false, t : false, i : false, d : true, ic : "icServer"};
	_g.h["share.facebook"] = { p : ["b"], s : false, c : false, t : false, i : false, d : false, ic : "icShare"};
	_g.h["share.linkedin"] = { p : ["b"], s : false, c : false, t : false, i : false, d : false, ic : "icShare"};
	_g.h["share.pinterest"] = { p : ["b"], s : false, c : false, t : false, i : false, d : false, ic : "icShare"};
	_g.h["share.reddit"] = { p : ["b"], s : false, c : false, t : false, i : false, d : false, ic : "icShare"};
	_g.h["share.x"] = { p : ["b"], s : false, c : false, t : false, i : false, d : false, ic : "icShare"};
	_g.h["trace"] = { p : ["s"], s : false, c : false, t : false, i : false, d : false, ic : "icDebug"};
	_g.h["trace.bools"] = { p : [], s : false, c : false, t : false, i : false, d : false, ic : "icDebug"};
	_g.h["trace.ints"] = { p : [], s : false, c : false, t : false, i : false, d : false, ic : "icDebug"};
	_g.h["trace.floats"] = { p : [], s : false, c : false, t : false, i : false, d : false, ic : "icDebug"};
	_g.h["trace.strings"] = { p : [], s : false, c : false, t : false, i : false, d : false, ic : "icDebug"};
	_g.h["trace.vars"] = { p : [], s : false, c : false, t : false, i : false, d : false, ic : "icDebug"};
	this.setActions(_g);
};
$hxClasses["com.tilbuci.script.AssistPlugin"] = com_tilbuci_script_AssistPlugin;
com_tilbuci_script_AssistPlugin.__name__ = "com.tilbuci.script.AssistPlugin";
com_tilbuci_script_AssistPlugin.__super__ = com_tilbuci_script_AssistBase;
com_tilbuci_script_AssistPlugin.prototype = $extend(com_tilbuci_script_AssistBase.prototype,{
	__class__: com_tilbuci_script_AssistPlugin
});
var com_tilbuci_script_AssistPlus = function(ac) {
	com_tilbuci_script_AssistBase.call(this,ac,com_tilbuci_data_Global.ln.get("window-acplus-title"),com_tilbuci_data_Global.ln.get("window-acplus-list"));
	var _g = new haxe_ds_StringMap();
	_g.h["replace.clearfile"] = { p : ["s"], s : false, c : false, t : false, i : false, d : false, ic : "icReplace"};
	_g.h["replace.clearstring"] = { p : ["s"], s : false, c : false, t : false, i : false, d : false, ic : "icReplace"};
	_g.h["replace.clearallfiles"] = { p : [], s : false, c : false, t : false, i : false, d : false, ic : "icReplace"};
	_g.h["replace.clearallstrings"] = { p : [], s : false, c : false, t : false, i : false, d : false, ic : "icReplace"};
	_g.h["replace.origin"] = { p : ["s"], s : false, c : false, t : false, i : false, d : false, ic : "icReplace"};
	_g.h["replace.setfile"] = { p : ["s","s"], s : false, c : false, t : false, i : false, d : false, ic : "icReplace"};
	_g.h["replace.setstring"] = { p : ["s","s"], s : false, c : false, t : false, i : false, d : false, ic : "icReplace"};
	_g.h["run"] = { p : ["s"], s : false, c : false, t : false, i : false, d : false, ic : "icSnippets"};
	_g.h["system.copytext"] = { p : ["s"], s : false, c : false, t : false, i : false, d : false, ic : "icSystem"};
	_g.h["system.fullscreen"] = { p : [], s : false, c : false, t : false, i : false, d : false, ic : "icSystem"};
	_g.h["system.visitoringroup"] = { p : ["s"], s : false, c : true, t : false, i : false, d : false, ic : "icSystem"};
	_g.h["system.logout"] = { p : [], s : false, c : false, t : false, i : false, d : false, ic : "icSystem"};
	_g.h["system.openembed"] = { p : ["s"], s : false, c : false, t : false, i : false, d : false, ic : "icSystem"};
	_g.h["system.closeembed"] = { p : [], s : false, c : false, t : false, i : false, d : false, ic : "icSystem"};
	_g.h["system.embedplace"] = { p : ["i","i","i","i"], s : false, c : false, t : false, i : false, d : false, ic : "icSystem"};
	_g.h["system.embedreset"] = { p : [], s : false, c : false, t : false, i : false, d : false, ic : "icSystem"};
	_g.h["system.openurl"] = { p : ["s"], s : false, c : false, t : false, i : false, d : false, ic : "icSystem"};
	_g.h["system.ifhorizontal"] = { p : [], s : false, c : true, t : false, i : false, d : false, ic : "icSystem"};
	_g.h["system.ifvertical"] = { p : [], s : false, c : true, t : false, i : false, d : false, ic : "icSystem"};
	_g.h["system.ifwebsite"] = { p : [], s : false, c : true, t : false, i : false, d : false, ic : "icSystem"};
	_g.h["system.ifpwa"] = { p : [], s : false, c : true, t : false, i : false, d : false, ic : "icSystem"};
	_g.h["system.ifpwainstalled"] = { p : [], s : false, c : true, t : false, i : false, d : false, ic : "icSystem"};
	_g.h["system.ifdesktop"] = { p : [], s : false, c : true, t : false, i : false, d : false, ic : "icSystem"};
	_g.h["system.ifmobile"] = { p : [], s : false, c : true, t : false, i : false, d : false, ic : "icSystem"};
	_g.h["system.ifpublish"] = { p : [], s : false, c : true, t : false, i : false, d : false, ic : "icSystem"};
	_g.h["system.ifplayer"] = { p : [], s : false, c : true, t : false, i : false, d : false, ic : "icSystem"};
	_g.h["system.sendevent"] = { p : ["s"], s : false, c : false, t : false, i : false, d : false, ic : "icSystem"};
	_g.h["system.setkftime"] = { p : ["i"], s : false, c : false, t : false, i : false, d : false, ic : "icSystem"};
	_g.h["css.clear"] = { p : [], s : false, c : false, t : false, i : false, d : false, ic : "icText"};
	_g.h["css.set"] = { p : ["s"], s : false, c : false, t : false, i : false, d : false, ic : "icText"};
	_g.h["timer.clear"] = { p : ["s"], s : false, c : false, t : false, i : false, d : false, ic : "icTimer"};
	_g.h["timer.clearall"] = { p : [], s : false, c : false, t : false, i : false, d : false, ic : "icTimer"};
	_g.h["timer.set"] = { p : ["s","i","i"], s : false, c : false, t : true, i : false, d : false, ic : "icTimer"};
	this.setActions(_g);
};
$hxClasses["com.tilbuci.script.AssistPlus"] = com_tilbuci_script_AssistPlus;
com_tilbuci_script_AssistPlus.__name__ = "com.tilbuci.script.AssistPlus";
com_tilbuci_script_AssistPlus.__super__ = com_tilbuci_script_AssistBase;
com_tilbuci_script_AssistPlus.prototype = $extend(com_tilbuci_script_AssistBase.prototype,{
	__class__: com_tilbuci_script_AssistPlus
});
var com_tilbuci_script_AssistRuntime = function(ac) {
	com_tilbuci_script_AssistBase.call(this,ac,com_tilbuci_data_Global.ln.get("window-runtime-title"),com_tilbuci_data_Global.ln.get("window-runtime-list"));
	var _g = new haxe_ds_StringMap();
	_g.h["runtime.install"] = { p : [], s : false, c : false, t : false, i : false, d : false, ic : "icSystem"};
	_g.h["runtime.quit"] = { p : [], s : false, c : false, t : false, i : false, d : false, ic : "icSystem"};
	_g.h["runtime.savedata"] = { p : ["s"], s : false, c : false, t : false, i : false, d : false, ic : "icSystem"};
	_g.h["runtime.loaddata"] = { p : ["s"], s : false, c : false, t : false, i : false, d : true, ic : "icSystem"};
	_g.h["runtime.ifdataexist"] = { p : ["s"], s : false, c : true, t : false, i : false, d : false, ic : "icSystem"};
	_g.h["runtime.ifbrowser"] = { p : [], s : false, c : true, t : false, i : false, d : false, ic : "icSystem"};
	this.setActions(_g);
};
$hxClasses["com.tilbuci.script.AssistRuntime"] = com_tilbuci_script_AssistRuntime;
com_tilbuci_script_AssistRuntime.__name__ = "com.tilbuci.script.AssistRuntime";
com_tilbuci_script_AssistRuntime.__super__ = com_tilbuci_script_AssistBase;
com_tilbuci_script_AssistRuntime.prototype = $extend(com_tilbuci_script_AssistBase.prototype,{
	__class__: com_tilbuci_script_AssistRuntime
});
var com_tilbuci_script_AssistScene = function(ac) {
	this._idbuttons = new haxe_ds_StringMap();
	com_tilbuci_ui_window_PopupWindow.call(this,ac,com_tilbuci_data_Global.ln.get("window-acscene-title"),500,com_tilbuci_ui_base_InterfaceFactory.pickValue(630,690),false);
	var this1 = this._idbuttons;
	var v = new com_tilbuci_ui_component_IDButton("copymovieload",$bind(this,this.onCopyMovieLoad),com_tilbuci_data_Global.ln.get("window-acmovie-copyload"),openfl_utils_Assets.getBitmapData("btCopy"));
	this1.h["btCopyMovieLoad"] = v;
	var this1 = this._idbuttons;
	var v = new com_tilbuci_ui_component_IDButton("showmovieload",$bind(this,this.onShowMovieLoad),com_tilbuci_data_Global.ln.get("window-acvariable-show"));
	this1.h["btShowMovieLoad"] = v;
	var this1 = this._idbuttons;
	var v = new com_tilbuci_ui_component_IDButton("copyid",$bind(this,this.onCopyId),com_tilbuci_data_Global.ln.get("window-acscene-copyid"),openfl_utils_Assets.getBitmapData("btCopy"));
	this1.h["btCopyId"] = v;
	var this1 = this._idbuttons;
	var v = new com_tilbuci_ui_component_IDButton("copyload",$bind(this,this.onCopyLoad),com_tilbuci_data_Global.ln.get("window-acscene-copyload"),openfl_utils_Assets.getBitmapData("btCopy"));
	this1.h["btCopyLoad"] = v;
	var this1 = this._idbuttons;
	var v = new com_tilbuci_ui_component_IDButton("showload",$bind(this,this.onShowLoad),com_tilbuci_data_Global.ln.get("window-acvariable-show"));
	this1.h["btShowLoad"] = v;
	var this1 = this._idbuttons;
	var v = new com_tilbuci_ui_component_IDButton("copyac",$bind(this,this.onCopy),com_tilbuci_data_Global.ln.get("window-acscene-btaction"),openfl_utils_Assets.getBitmapData("btCopy"));
	this1.h["btCopyAc"] = v;
	var this1 = this._idbuttons;
	var v = new com_tilbuci_ui_component_IDButton("showac",$bind(this,this.onShow),com_tilbuci_data_Global.ln.get("window-acvariable-show"));
	this1.h["btShowAc"] = v;
	var tmp = com_tilbuci_data_Global.ln.get("window-acscene-title");
	var tmp1 = this.ui;
	var tmp2 = { tp : "Label", id : "movielist", tx : com_tilbuci_data_Global.ln.get("window-acmovie-list"), vr : ""};
	var tmp3 = { tp : "Custom", cont : this._idbuttons.h["btCopyMovieLoad"]};
	var tmp4 = { tp : "Custom", cont : this._idbuttons.h["btShowMovieLoad"]};
	var tmp5 = { tp : "Label", id : "list", tx : com_tilbuci_data_Global.ln.get("window-acscene-list"), vr : ""};
	var tmp6 = { tp : "Custom", cont : this._idbuttons.h["btCopyId"]};
	var tmp7 = { tp : "Custom", cont : this._idbuttons.h["btCopyLoad"]};
	var tmp8 = { tp : "Custom", cont : this._idbuttons.h["btShowLoad"]};
	var tmp9 = { tp : "Label", id : "actions", tx : com_tilbuci_data_Global.ln.get("window-acscene-actions"), vr : ""};
	var tmp10 = { tp : "Label", id : "navigate", tx : com_tilbuci_data_Global.ln.get("window-acscene-navigate"), vr : ""};
	var tmp11 = { tp : "Custom", cont : this._idbuttons.h["btCopyAc"]};
	var tmp12 = { tp : "Custom", cont : this._idbuttons.h["btShowAc"]};
	var tmp13 = { tp : "Button", id : "close", tx : com_tilbuci_data_Global.ln.get("window-actions-close"), ac : $bind(this,this.onClose)};
	var tmp14 = com_tilbuci_data_Global.ln.get("window-globals-showaction");
	this.addForm(tmp,tmp1.forge("form",[tmp2,{ tp : "Select", id : "movielist", vl : [], sl : []},tmp3,tmp4,{ tp : "Spacer", id : "acmovie", ht : 15, ln : true},tmp5,{ tp : "Select", id : "list", vl : [], sl : [], ht : 150},tmp6,tmp7,tmp8,{ tp : "Spacer", id : "ac", ht : 15, ln : true},tmp9,{ tp : "Select", id : "actions", vl : [{ text : "scene.navigate", value : "scene.navigate"},{ text : "scene.pause", value : "scene.pause"},{ text : "scene.play", value : "scene.play"},{ text : "scene.playpause", value : "scene.playpause"},{ text : "scene.nextkeyframe", value : "scene.nextkeyframe"},{ text : "scene.previouskeyframe", value : "scene.previouskeyframe"},{ text : "scene.loadfirstkeyframe", value : "scene.loadfirstkeyframe"},{ text : "scene.loadlastkeyframe", value : "scene.loadlastkeyframe"}], sl : null},tmp10,{ tp : "Select", id : "navigate", vl : [{ text : "right", value : "right"},{ text : "left", value : "left"},{ text : "up", value : "up"},{ text : "down", value : "down"},{ text : "nin", value : "nin"},{ text : "nout", value : "nout"}], sl : null},tmp11,tmp12,tmp13,{ tp : "Spacer", id : "showAction", ht : 10, ln : false},{ tp : "Label", id : "showAction", tx : tmp14, vr : feathers_controls_Label.VARIANT_DETAIL},{ tp : "TInput", id : "showAction", tx : ""}]));
};
$hxClasses["com.tilbuci.script.AssistScene"] = com_tilbuci_script_AssistScene;
com_tilbuci_script_AssistScene.__name__ = "com.tilbuci.script.AssistScene";
com_tilbuci_script_AssistScene.__super__ = com_tilbuci_ui_window_PopupWindow;
com_tilbuci_script_AssistScene.prototype = $extend(com_tilbuci_ui_window_PopupWindow.prototype,{
	_idbuttons: null
	,acStart: function() {
		com_tilbuci_ui_window_PopupWindow.prototype.acStart.call(this);
		this.ui.setSelectOptions("movielist",[]);
		this.ui.setSelectValue("movielist",null);
		this.ui.setSelectOptions("list",[]);
		this.ui.setSelectValue("list",null);
		com_tilbuci_data_Global.ws.send("Movie/List",new haxe_ds_StringMap(),$bind(this,this.onList));
	}
	,startInterface: function(evt) {
		com_tilbuci_ui_window_PopupWindow.prototype.startInterface.call(this,evt);
		var h = this._idbuttons.h;
		var k_h = h;
		var k_keys = Object.keys(h);
		var k_length = k_keys.length;
		var k_current = 0;
		while(k_current < k_length) {
			var k = k_keys[k_current++];
			this._idbuttons.h[k].set_width(this.ui.buttons.h["close"].get_width());
		}
	}
	,onCopyId: function(evt) {
		if(this.ui.selects.h["list"].get_selectedItem() != null) {
			com_tilbuci_data_Global.copyText(this.ui.selects.h["list"].get_selectedItem().value);
			feathers_core_PopUpManager.removePopUp(this);
		}
	}
	,onCopyLoad: function(evt) {
		if(this.ui.selects.h["list"].get_selectedItem() != null) {
			com_tilbuci_data_Global.copyText("{ \"ac\": \"scene.load\", \"param\": [ \"" + Std.string(this.ui.selects.h["list"].get_selectedItem().value) + "\" ] }");
			feathers_core_PopUpManager.removePopUp(this);
		}
	}
	,onShowLoad: function(evt) {
		if(this.ui.selects.h["list"].get_selectedItem() != null) {
			this.ui.inputs.h["showAction"].set_text("{ \"ac\": \"scene.load\", \"param\": [ \"" + Std.string(this.ui.selects.h["list"].get_selectedItem().value) + "\" ] }");
		}
	}
	,onCopyMovieLoad: function(evt) {
		if(this.ui.selects.h["movielist"].get_selectedItem() != null) {
			com_tilbuci_data_Global.copyText("{ \"ac\": \"movie.load\", \"param\": [ \"" + Std.string(this.ui.selects.h["movielist"].get_selectedItem().value) + "\" ] }");
			feathers_core_PopUpManager.removePopUp(this);
		}
	}
	,onShowMovieLoad: function(evt) {
		if(this.ui.selects.h["movielist"].get_selectedItem() != null) {
			this.ui.inputs.h["showAction"].set_text("{ \"ac\": \"movie.load\", \"param\": [ \"" + Std.string(this.ui.selects.h["movielist"].get_selectedItem().value) + "\" ] }");
		}
	}
	,onCopy: function(evt) {
		if(this.ui.selects.h["actions"].get_selectedItem() != null) {
			if(this.ui.selects.h["actions"].get_selectedItem().value == "scene.navigate") {
				com_tilbuci_data_Global.copyText("{ \"ac\": \"" + Std.string(this.ui.selects.h["actions"].get_selectedItem().value) + "\", \"param\": [ \"" + Std.string(this.ui.selects.h["navigate"].get_selectedItem().value) + "\" ] }");
			} else {
				com_tilbuci_data_Global.copyText("{ \"ac\": \"" + Std.string(this.ui.selects.h["actions"].get_selectedItem().value) + "\", \"param\": [ ] }");
			}
			feathers_core_PopUpManager.removePopUp(this);
		}
	}
	,onShow: function(evt) {
		if(this.ui.selects.h["actions"].get_selectedItem() != null) {
			if(this.ui.selects.h["actions"].get_selectedItem().value == "scene.navigate") {
				this.ui.inputs.h["showAction"].set_text("{ \"ac\": \"" + Std.string(this.ui.selects.h["actions"].get_selectedItem().value) + "\", \"param\": [ \"" + Std.string(this.ui.selects.h["navigate"].get_selectedItem().value) + "\" ] }");
			} else {
				this.ui.inputs.h["showAction"].set_text("{ \"ac\": \"" + Std.string(this.ui.selects.h["actions"].get_selectedItem().value) + "\", \"param\": [ ] }");
			}
		}
	}
	,onClose: function(evt) {
		feathers_core_PopUpManager.removePopUp(this);
	}
	,onList: function(ok,ld) {
		var list = [];
		if(ok) {
			if(ld.map.h["e"] == 0) {
				var _g = 0;
				var _g1 = Reflect.fields(ld.map.h["list"]);
				while(_g < _g1.length) {
					var n = _g1[_g];
					++_g;
					var it = Reflect.field(ld.map.h["list"],n);
					if(Object.prototype.hasOwnProperty.call(it,"id")) {
						list.push({ text : Reflect.field(it,"title"), value : Reflect.field(it,"id")});
					}
				}
			}
		}
		this.ui.setSelectOptions("movielist",list);
		var tmp = com_tilbuci_data_Global.ws;
		var _g = new haxe_ds_StringMap();
		var value = com_tilbuci_data_GlobalPlayer.movie.get_mvId();
		_g.h["movie"] = value;
		tmp.send("Scene/List",_g,$bind(this,this.onSceneList));
	}
	,onSceneList: function(ok,ld) {
		var list = [];
		if(ok) {
			if(ld.map.h["e"] == 0) {
				var _g = 0;
				var _g1 = Reflect.fields(ld.map.h["list"]);
				while(_g < _g1.length) {
					var n = _g1[_g];
					++_g;
					var it = Reflect.field(ld.map.h["list"],n);
					if(Object.prototype.hasOwnProperty.call(it,"id")) {
						list.push({ text : Reflect.field(it,"title"), value : Reflect.field(it,"id")});
					}
				}
			}
		}
		this.ui.setSelectOptions("list",list);
	}
	,__class__: com_tilbuci_script_AssistScene
});
var com_tilbuci_script_AssistVariables = function(ac) {
	com_tilbuci_script_AssistBase.call(this,ac,com_tilbuci_data_Global.ln.get("window-acvariable-title"),com_tilbuci_data_Global.ln.get("window-acvariable-list"));
	var _g = new haxe_ds_StringMap();
	_g.h["int.abs"] = { p : ["s","i"], s : false, c : false, t : false, i : false, d : false, ic : "btInteger"};
	_g.h["int.clear"] = { p : ["s"], s : false, c : false, t : false, i : false, d : false, ic : "btInteger"};
	_g.h["int.clearall"] = { p : [], s : false, c : false, t : false, i : false, d : false, ic : "btInteger"};
	_g.h["int.divide"] = { p : ["s","i","i"], s : false, c : false, t : false, i : false, d : false, ic : "btInteger"};
	_g.h["int.max"] = { p : ["s","i","i"], s : false, c : false, t : false, i : false, d : false, ic : "btInteger"};
	_g.h["int.min"] = { p : ["s","i","i"], s : false, c : false, t : false, i : false, d : false, ic : "btInteger"};
	_g.h["int.multiply"] = { p : ["s","i","i"], s : false, c : false, t : false, i : false, d : false, ic : "btInteger"};
	_g.h["int.random"] = { p : ["s","i","i"], s : false, c : false, t : false, i : false, d : false, ic : "btInteger"};
	_g.h["int.set"] = { p : ["s","i"], s : false, c : false, t : false, i : false, d : false, ic : "btInteger"};
	_g.h["int.subtract"] = { p : ["s","i","i"], s : false, c : false, t : false, i : false, d : false, ic : "btInteger"};
	_g.h["int.sum"] = { p : ["s","i","i"], s : false, c : false, t : false, i : false, d : false, ic : "btInteger"};
	_g.h["int.tofloat"] = { p : ["s","i"], s : false, c : false, t : false, i : false, d : false, ic : "btInteger"};
	_g.h["int.tostring"] = { p : ["s","i"], s : false, c : false, t : false, i : false, d : false, ic : "btInteger"};
	_g.h["bool.clear"] = { p : ["s"], s : false, c : false, t : false, i : false, d : false, ic : "btBool"};
	_g.h["bool.clearall"] = { p : [], s : false, c : false, t : false, i : false, d : false, ic : "btBool"};
	_g.h["bool.set"] = { p : ["s","b"], s : false, c : false, t : false, i : false, d : false, ic : "btBool"};
	_g.h["bool.setinverse"] = { p : ["s"], s : false, c : false, t : false, i : false, d : false, ic : "btBool"};
	_g.h["float.abs"] = { p : ["s","b"], s : false, c : false, t : false, i : false, d : false, ic : "btFloat"};
	_g.h["float.clear"] = { p : ["s"], s : false, c : false, t : false, i : false, d : false, ic : "btFloat"};
	_g.h["float.clearall"] = { p : [], s : false, c : false, t : false, i : false, d : false, ic : "btFloat"};
	_g.h["float.divide"] = { p : ["s","f","f"], s : false, c : false, t : false, i : false, d : false, ic : "btFloat"};
	_g.h["float.max"] = { p : ["s","f","f"], s : false, c : false, t : false, i : false, d : false, ic : "btFloat"};
	_g.h["float.min"] = { p : ["s","f","f"], s : false, c : false, t : false, i : false, d : false, ic : "btFloat"};
	_g.h["float.multiply"] = { p : ["s","f","f"], s : false, c : false, t : false, i : false, d : false, ic : "btFloat"};
	_g.h["float.random"] = { p : ["s","f","f"], s : false, c : false, t : false, i : false, d : false, ic : "btFloat"};
	_g.h["float.set"] = { p : ["s","f"], s : false, c : false, t : false, i : false, d : false, ic : "btFloat"};
	_g.h["float.subtract"] = { p : ["s","f","f"], s : false, c : false, t : false, i : false, d : false, ic : "btFloat"};
	_g.h["float.sum"] = { p : ["s","f","f"], s : false, c : false, t : false, i : false, d : false, ic : "btFloat"};
	_g.h["float.toint"] = { p : ["s","f"], s : false, c : false, t : false, i : false, d : false, ic : "btFloat"};
	_g.h["float.tostring"] = { p : ["s","f"], s : false, c : false, t : false, i : false, d : false, ic : "btFloat"};
	_g.h["string.clear"] = { p : ["s"], s : false, c : false, t : false, i : false, d : false, ic : "btString"};
	_g.h["string.clearall"] = { p : [], s : false, c : false, t : false, i : false, d : false, ic : "btString"};
	_g.h["string.clearglobal"] = { p : ["s"], s : false, c : false, t : false, i : false, d : false, ic : "btString"};
	_g.h["string.concat"] = { p : ["s","s","s"], s : false, c : false, t : false, i : false, d : false, ic : "btString"};
	_g.h["string.replace"] = { p : ["s","s","s","s"], s : false, c : false, t : false, i : false, d : false, ic : "btString"};
	_g.h["string.set"] = { p : ["s","s"], s : false, c : false, t : false, i : false, d : false, ic : "btString"};
	_g.h["string.setglobal"] = { p : ["s","s"], s : false, c : false, t : false, i : false, d : false, ic : "btString"};
	_g.h["string.setgroup"] = { p : ["s"], s : false, c : false, t : false, i : false, d : false, ic : "btString"};
	_g.h["string.loadfile"] = { p : ["s"], s : false, c : false, t : false, i : false, d : true, ic : "btString"};
	_g.h["string.tofloat"] = { p : ["s","s"], s : false, c : false, t : false, i : false, d : false, ic : "btString"};
	_g.h["string.toint"] = { p : ["s","s"], s : false, c : false, t : false, i : false, d : false, ic : "btString"};
	_g.h["if.intsdifferent"] = { p : ["i","i"], s : false, c : true, t : false, i : false, d : false, ic : "btInteger"};
	_g.h["if.intsequal"] = { p : ["i","i"], s : false, c : true, t : false, i : false, d : false, ic : "btInteger"};
	_g.h["if.intgreater"] = { p : ["i","i"], s : false, c : true, t : false, i : false, d : false, ic : "btInteger"};
	_g.h["if.intgreaterequal"] = { p : ["i","i"], s : false, c : true, t : false, i : false, d : false, ic : "btInteger"};
	_g.h["if.intlower"] = { p : ["i","i"], s : false, c : true, t : false, i : false, d : false, ic : "btInteger"};
	_g.h["if.intlowerequal"] = { p : ["i","i"], s : false, c : true, t : false, i : false, d : false, ic : "btInteger"};
	_g.h["if.bool"] = { p : ["s"], s : false, c : true, t : false, i : false, d : false, ic : "btBool"};
	_g.h["if.floatsdifferent"] = { p : ["f","f"], s : false, c : true, t : false, i : false, d : false, ic : "btFloat"};
	_g.h["if.floatsequal"] = { p : ["f","f"], s : false, c : true, t : false, i : false, d : false, ic : "btFloat"};
	_g.h["if.floatgreater"] = { p : ["f","f"], s : false, c : true, t : false, i : false, d : false, ic : "btFloat"};
	_g.h["if.floatgreaterequal"] = { p : ["f","f"], s : false, c : true, t : false, i : false, d : false, ic : "btFloat"};
	_g.h["if.floatlower"] = { p : ["f","f"], s : false, c : true, t : false, i : false, d : false, ic : "btFloat"};
	_g.h["if.floatlowerequal"] = { p : ["f","f"], s : false, c : true, t : false, i : false, d : false, ic : "btFloat"};
	_g.h["if.stringcontains"] = { p : ["s","s"], s : false, c : true, t : false, i : false, d : false, ic : "btString"};
	_g.h["if.stringendswith"] = { p : ["s","s"], s : false, c : true, t : false, i : false, d : false, ic : "btString"};
	_g.h["if.stringsdifferent"] = { p : ["s","s"], s : false, c : true, t : false, i : false, d : false, ic : "btString"};
	_g.h["if.stringsequal"] = { p : ["s","s"], s : false, c : true, t : false, i : false, d : false, ic : "btString"};
	_g.h["if.stringstartswith"] = { p : ["s","s"], s : false, c : true, t : false, i : false, d : false, ic : "btString"};
	_g.h["if.stringemail"] = { p : ["s"], s : false, c : true, t : false, i : false, d : false, ic : "btString"};
	this.setActions(_g);
};
$hxClasses["com.tilbuci.script.AssistVariables"] = com_tilbuci_script_AssistVariables;
com_tilbuci_script_AssistVariables.__name__ = "com.tilbuci.script.AssistVariables";
com_tilbuci_script_AssistVariables.__super__ = com_tilbuci_script_AssistBase;
com_tilbuci_script_AssistVariables.prototype = $extend(com_tilbuci_script_AssistBase.prototype,{
	__class__: com_tilbuci_script_AssistVariables
});
var com_tilbuci_script_ScriptParser = function() {
	this.onDrag = null;
	this._sngroup = "";
	this._dSnippets = new haxe_ds_StringMap();
	this._currDiag = "";
	this._snpParam = ["","","","","","",""];
	this._stringfile = new haxe_ds_StringMap();
	this._lastEvent = new haxe_ds_StringMap();
	this.hadInteraction = false;
	this.eventSend = null;
	this.globalAvailable = [];
	this.available = [];
	this._currentArray = "";
	this._arrays = new haxe_ds_StringMap();
	this._bools = new haxe_ds_StringMap();
	this._ints = new haxe_ds_StringMap();
	this._floats = new haxe_ds_StringMap();
	this._timers = new haxe_ds_StringMap();
	this._replacefile = new haxe_ds_StringMap();
	this._replacestr = new haxe_ds_StringMap();
	this._jsongropup = "";
	this._stringsjson = new haxe_ds_StringMap();
	this._strings = new haxe_ds_StringMap();
};
$hxClasses["com.tilbuci.script.ScriptParser"] = com_tilbuci_script_ScriptParser;
com_tilbuci_script_ScriptParser.__name__ = "com.tilbuci.script.ScriptParser";
com_tilbuci_script_ScriptParser.tilbuci_getstring = $hx_exports["tilbuci_getstring"] = function(name) {
	return com_tilbuci_data_GlobalPlayer.parser.getString(name);
};
com_tilbuci_script_ScriptParser.tilbuci_getfloat = $hx_exports["tilbuci_getfloat"] = function(name) {
	return com_tilbuci_data_GlobalPlayer.parser.getFloat(name);
};
com_tilbuci_script_ScriptParser.tilbuci_getint = $hx_exports["tilbuci_getint"] = function(name) {
	return com_tilbuci_data_GlobalPlayer.parser.getInt(name);
};
com_tilbuci_script_ScriptParser.tilbuci_getbool = $hx_exports["tilbuci_getbool"] = function(name) {
	return com_tilbuci_data_GlobalPlayer.parser.getBool(name);
};
com_tilbuci_script_ScriptParser.tilbuci_setstring = $hx_exports["tilbuci_setstring"] = function(name,value) {
	com_tilbuci_data_GlobalPlayer.parser.setString(name,value);
};
com_tilbuci_script_ScriptParser.tilbuci_setfloat = $hx_exports["tilbuci_setfloat"] = function(name,value) {
	com_tilbuci_data_GlobalPlayer.parser.setFloat(name,value);
};
com_tilbuci_script_ScriptParser.tilbuci_setint = $hx_exports["tilbuci_setint"] = function(name,value) {
	com_tilbuci_data_GlobalPlayer.parser.setInt(name,value);
};
com_tilbuci_script_ScriptParser.tilbuci_setbool = $hx_exports["tilbuci_setbool"] = function(name,value) {
	com_tilbuci_data_GlobalPlayer.parser.setBool(name,value);
};
com_tilbuci_script_ScriptParser.tilbuci_runaction = $hx_exports["tilbuci_runaction"] = function(action) {
	return com_tilbuci_data_GlobalPlayer.parser.run(action);
};
com_tilbuci_script_ScriptParser.prototype = {
	_strings: null
	,_stringsjson: null
	,_jsongropup: null
	,_replacestr: null
	,_replacefile: null
	,_timers: null
	,_floats: null
	,_ints: null
	,_bools: null
	,_arrays: null
	,_currentArray: null
	,available: null
	,globalAvailable: null
	,eventSend: null
	,hadInteraction: null
	,_acOk: null
	,_acError: null
	,_lastEvent: null
	,_stringfile: null
	,_snpParam: null
	,_currDiag: null
	,_diagInfo: null
	,_dSnippets: null
	,_sngroup: null
	,onDrag: null
	,getVarRef: function(type) {
		switch(type) {
		case "bool":
			return this._bools;
		case "float":
			return this._floats;
		case "int":
			return this._ints;
		case "string":
			return this._strings;
		default:
			return null;
		}
	}
	,addAvailableGroup: function(ag) {
		this.available.push(ag);
	}
	,addAvailableGlobal: function(gg) {
		this.globalAvailable.push(gg);
	}
	,kill: function() {
		var h = this._strings.h;
		var k_h = h;
		var k_keys = Object.keys(h);
		var k_length = k_keys.length;
		var k_current = 0;
		while(k_current < k_length) {
			var k = k_keys[k_current++];
			var _this = this._strings;
			if(Object.prototype.hasOwnProperty.call(_this.h,k)) {
				delete(_this.h[k]);
			}
		}
		var h = this._floats.h;
		var k_h = h;
		var k_keys = Object.keys(h);
		var k_length = k_keys.length;
		var k_current = 0;
		while(k_current < k_length) {
			var k = k_keys[k_current++];
			var _this = this._floats;
			if(Object.prototype.hasOwnProperty.call(_this.h,k)) {
				delete(_this.h[k]);
			}
		}
		var h = this._ints.h;
		var k_h = h;
		var k_keys = Object.keys(h);
		var k_length = k_keys.length;
		var k_current = 0;
		while(k_current < k_length) {
			var k = k_keys[k_current++];
			var _this = this._ints;
			if(Object.prototype.hasOwnProperty.call(_this.h,k)) {
				delete(_this.h[k]);
			}
		}
		var h = this._bools.h;
		var k_h = h;
		var k_keys = Object.keys(h);
		var k_length = k_keys.length;
		var k_current = 0;
		while(k_current < k_length) {
			var k = k_keys[k_current++];
			var _this = this._bools;
			if(Object.prototype.hasOwnProperty.call(_this.h,k)) {
				delete(_this.h[k]);
			}
		}
		var h = this._arrays.h;
		var k_h = h;
		var k_keys = Object.keys(h);
		var k_length = k_keys.length;
		var k_current = 0;
		while(k_current < k_length) {
			var k = k_keys[k_current++];
			this._arrays.h[k].kill();
			var _this = this._arrays;
			if(Object.prototype.hasOwnProperty.call(_this.h,k)) {
				delete(_this.h[k]);
			}
		}
		var h = this._dSnippets.h;
		var k_h = h;
		var k_keys = Object.keys(h);
		var k_length = k_keys.length;
		var k_current = 0;
		while(k_current < k_length) {
			var k = k_keys[k_current++];
			var _this = this._dSnippets;
			if(Object.prototype.hasOwnProperty.call(_this.h,k)) {
				delete(_this.h[k]);
			}
		}
		this._strings = null;
		this._floats = null;
		this._ints = null;
		this._bools = null;
		this._arrays = null;
		this._dSnippets = null;
		while(this.available.length > 0) {
			var ag = this.available.shift();
			while(ag.a.length > 0) {
				var ac = ag.a.shift();
				while(ac.p.length > 0) {
					var pr = ac.p.shift();
					pr = null;
				}
				ac = null;
			}
			ag = null;
		}
		this.available = null;
		while(this.globalAvailable.length > 0) {
			var vg = this.globalAvailable.shift();
			while(vg.v.length > 0) vg.v.shift();
			vg = null;
		}
		this.clearStringFile();
		this._stringfile = null;
		this.globalAvailable = null;
	}
	,clearVars: function(what) {
		if(what == null) {
			what = "";
		}
		switch(what) {
		case "arrays":
			var h = this._arrays.h;
			var k_h = h;
			var k_keys = Object.keys(h);
			var k_length = k_keys.length;
			var k_current = 0;
			while(k_current < k_length) {
				var k = k_keys[k_current++];
				this._arrays.h[k].kill();
				var _this = this._arrays;
				if(Object.prototype.hasOwnProperty.call(_this.h,k)) {
					delete(_this.h[k]);
				}
			}
			break;
		case "bools":
			var h = this._bools.h;
			var k_h = h;
			var k_keys = Object.keys(h);
			var k_length = k_keys.length;
			var k_current = 0;
			while(k_current < k_length) {
				var k = k_keys[k_current++];
				var _this = this._strings;
				if(Object.prototype.hasOwnProperty.call(_this.h,k)) {
					delete(_this.h[k]);
				}
			}
			break;
		case "floats":
			var h = this._floats.h;
			var k_h = h;
			var k_keys = Object.keys(h);
			var k_length = k_keys.length;
			var k_current = 0;
			while(k_current < k_length) {
				var k = k_keys[k_current++];
				var _this = this._floats;
				if(Object.prototype.hasOwnProperty.call(_this.h,k)) {
					delete(_this.h[k]);
				}
			}
			break;
		case "ints":
			var h = this._ints.h;
			var k_h = h;
			var k_keys = Object.keys(h);
			var k_length = k_keys.length;
			var k_current = 0;
			while(k_current < k_length) {
				var k = k_keys[k_current++];
				var _this = this._ints;
				if(Object.prototype.hasOwnProperty.call(_this.h,k)) {
					delete(_this.h[k]);
				}
			}
			break;
		case "strings":
			var h = this._strings.h;
			var k_h = h;
			var k_keys = Object.keys(h);
			var k_length = k_keys.length;
			var k_current = 0;
			while(k_current < k_length) {
				var k = k_keys[k_current++];
				var _this = this._strings;
				if(Object.prototype.hasOwnProperty.call(_this.h,k)) {
					delete(_this.h[k]);
				}
			}
			break;
		default:
			var h = this._strings.h;
			var k_h = h;
			var k_keys = Object.keys(h);
			var k_length = k_keys.length;
			var k_current = 0;
			while(k_current < k_length) {
				var k = k_keys[k_current++];
				var _this = this._strings;
				if(Object.prototype.hasOwnProperty.call(_this.h,k)) {
					delete(_this.h[k]);
				}
			}
			var h = this._floats.h;
			var k_h = h;
			var k_keys = Object.keys(h);
			var k_length = k_keys.length;
			var k_current = 0;
			while(k_current < k_length) {
				var k = k_keys[k_current++];
				var _this = this._floats;
				if(Object.prototype.hasOwnProperty.call(_this.h,k)) {
					delete(_this.h[k]);
				}
			}
			var h = this._ints.h;
			var k_h = h;
			var k_keys = Object.keys(h);
			var k_length = k_keys.length;
			var k_current = 0;
			while(k_current < k_length) {
				var k = k_keys[k_current++];
				var _this = this._ints;
				if(Object.prototype.hasOwnProperty.call(_this.h,k)) {
					delete(_this.h[k]);
				}
			}
			var h = this._bools.h;
			var k_h = h;
			var k_keys = Object.keys(h);
			var k_length = k_keys.length;
			var k_current = 0;
			while(k_current < k_length) {
				var k = k_keys[k_current++];
				var _this = this._bools;
				if(Object.prototype.hasOwnProperty.call(_this.h,k)) {
					delete(_this.h[k]);
				}
			}
			var h = this._arrays.h;
			var k_h = h;
			var k_keys = Object.keys(h);
			var k_length = k_keys.length;
			var k_current = 0;
			while(k_current < k_length) {
				var k = k_keys[k_current++];
				this._arrays.h[k].kill();
				var _this = this._arrays;
				if(Object.prototype.hasOwnProperty.call(_this.h,k)) {
					delete(_this.h[k]);
				}
			}
		}
		return true;
	}
	,loadStringsJson: function() {
		this._stringsjson = new haxe_ds_StringMap();
		this._jsongropup = "";
		if(com_tilbuci_data_GlobalPlayer.nocache) {
			var tmp = com_tilbuci_data_GlobalPlayer.base + "movie/" + com_tilbuci_data_GlobalPlayer.movie.get_mvId() + ".movie/strings.json";
			var _g = new haxe_ds_StringMap();
			var value = new Date().getTime();
			_g.h["rand"] = value;
			new com_tilbuci_data_DataLoader(true,tmp,"GET",_g,3,$bind(this,this.onStringsJSON));
		} else {
			new com_tilbuci_data_DataLoader(true,com_tilbuci_data_GlobalPlayer.base + "movie/" + com_tilbuci_data_GlobalPlayer.movie.get_mvId() + ".movie/strings.json","GET",new haxe_ds_StringMap(),3,$bind(this,this.onStringsJSON));
		}
	}
	,onStringsJSON: function(ok,ld) {
		if(ok) {
			var _g = 0;
			var _g1 = Reflect.fields(ld.json);
			while(_g < _g1.length) {
				var k = _g1[_g];
				++_g;
				var kdata = Reflect.field(ld.json,k);
				var mapk = new haxe_ds_StringMap();
				var _g2 = 0;
				var _g3 = Reflect.fields(kdata);
				while(_g2 < _g3.length) {
					var k2 = _g3[_g2];
					++_g2;
					var v = Reflect.field(kdata,k2);
					mapk.h["$" + k2] = v;
				}
				this._stringsjson.h[k] = mapk;
			}
		}
		this.loadContraptions();
		this.loadNarrative();
	}
	,loadContraptions: function() {
		if(com_tilbuci_data_GlobalPlayer.nocache) {
			var tmp = com_tilbuci_data_GlobalPlayer.base + "movie/" + com_tilbuci_data_GlobalPlayer.movie.get_mvId() + ".movie/contraptions.json";
			var _g = new haxe_ds_StringMap();
			var value = new Date().getTime();
			_g.h["rand"] = value;
			new com_tilbuci_data_DataLoader(true,tmp,"GET",_g,3,$bind(this,this.onContraptions));
		} else {
			new com_tilbuci_data_DataLoader(true,com_tilbuci_data_GlobalPlayer.base + "movie/" + com_tilbuci_data_GlobalPlayer.movie.get_mvId() + ".movie/contraptions.json","GET",new haxe_ds_StringMap(),3,$bind(this,this.onContraptions));
		}
	}
	,loadNarrative: function() {
		if(com_tilbuci_data_GlobalPlayer.nocache) {
			var tmp = com_tilbuci_data_GlobalPlayer.base + "movie/" + com_tilbuci_data_GlobalPlayer.movie.get_mvId() + ".movie/narrative.json";
			var _g = new haxe_ds_StringMap();
			var value = new Date().getTime();
			_g.h["rand"] = value;
			new com_tilbuci_data_DataLoader(true,tmp,"GET",_g,3,$bind(this,this.onNarrative));
		} else {
			new com_tilbuci_data_DataLoader(true,com_tilbuci_data_GlobalPlayer.base + "movie/" + com_tilbuci_data_GlobalPlayer.movie.get_mvId() + ".movie/narrative.json","GET",new haxe_ds_StringMap(),3,$bind(this,this.onNarrative));
		}
	}
	,clearStringFile: function() {
		var h = this._stringfile.h;
		var k_h = h;
		var k_keys = Object.keys(h);
		var k_length = k_keys.length;
		var k_current = 0;
		while(k_current < k_length) {
			var k = k_keys[k_current++];
			var _this = this._stringfile;
			if(Object.prototype.hasOwnProperty.call(_this.h,k)) {
				delete(_this.h[k]);
			}
		}
	}
	,onStringFile: function(ok,ld) {
		if(ok) {
			this.clearStringFile();
			var h = ld.map.h;
			var k_h = h;
			var k_keys = Object.keys(h);
			var k_length = k_keys.length;
			var k_current = 0;
			while(k_current < k_length) {
				var k = k_keys[k_current++];
				var v = ld.map.h[k];
				this._stringfile.h[k] = v;
			}
			if(this._acOk != null) {
				this.run(this._acOk,true);
			}
		} else if(this._acError != null) {
			this.run(this._acError,true);
		}
	}
	,onSnippetFile: function(ok,ld) {
		if(ok && this._sngroup != "") {
			var v = [];
			this._dSnippets.h[this._sngroup] = v;
			var h = ld.map.h;
			var k_h = h;
			var k_keys = Object.keys(h);
			var k_length = k_keys.length;
			var k_current = 0;
			while(k_current < k_length) {
				var k = k_keys[k_current++];
				this._dSnippets.h[this._sngroup].push({ name : k, code : Std.string(ld.map.h[k])});
			}
			this._sngroup = "";
			if(this._acOk != null) {
				this.run(this._acOk,true);
			}
		} else {
			this._sngroup = "";
			if(this._acError != null) {
				this.run(this._acError,true);
			}
		}
	}
	,onArrayFile: function(ok,ld) {
		if(ok) {
			if(this._currentArray != "") {
				if(!Object.prototype.hasOwnProperty.call(this._arrays.h,this._currentArray)) {
					var this1 = this._arrays;
					var k = this._currentArray;
					var v = new com_tilbuci_def_TBArray();
					this1.h[k] = v;
				}
				if(this._arrays.h[this._currentArray].fromJson(ld.rawtext)) {
					this._currentArray = "";
					if(this._acOk != null) {
						this.run(this._acOk,true);
					}
				} else {
					this._currentArray = "";
					if(this._acError != null) {
						this.run(this._acError,true);
					}
				}
			} else if(this._acError != null) {
				this.run(this._acError,true);
			}
		} else {
			this._currentArray = "";
			if(this._acError != null) {
				this.run(this._acError,true);
			}
		}
	}
	,onVariablesFile: function(ok,text) {
		if(ok) {
			text = com_tilbuci_statictools_StringStatic.decrypt(text,com_tilbuci_statictools_StringStatic.md5(com_tilbuci_data_GlobalPlayer.movie.get_mvId() + HxOverrides.substr(com_tilbuci_data_GlobalPlayer.movie.get_mvId(),2,null)).toLowerCase());
			var json = com_tilbuci_statictools_StringStatic.jsonParse(text);
			if(json == false) {
				if(this._acError != null) {
					this.run(this._acError,true);
				}
			} else {
				var _g = 0;
				var _g1 = Reflect.fields(json);
				while(_g < _g1.length) {
					var k = _g1[_g];
					++_g;
					var vinfo = Reflect.field(json,k);
					if(vinfo != null) {
						switch(vinfo.t) {
						case "b":
							var v = vinfo.v;
							this._bools.h[vinfo.n] = v;
							break;
						case "f":
							var v1 = vinfo.v;
							this._floats.h[vinfo.n] = v1;
							break;
						case "i":
							var v2 = vinfo.v;
							this._ints.h[vinfo.n] = v2;
							break;
						case "s":
							var v3 = vinfo.v;
							this._strings.h[vinfo.n] = v3;
							break;
						}
					}
				}
				if(this._acOk != null) {
					this.run(this._acOk,true);
				}
			}
		} else if(this._acError != null) {
			this.run(this._acError,true);
		}
	}
	,onDiagGroup: function(ok) {
		if(ok) {
			if(this._acOk != null) {
				this.run(this._acOk,true);
			}
		} else {
			this._currDiag = "";
			if(this._acError != null) {
				this.run(this._acError,true);
			}
		}
	}
	,onContraptions: function(ok,ld) {
		com_tilbuci_data_GlobalPlayer.contraptions.removeAll();
		com_tilbuci_data_GlobalPlayer.contraptions.clear();
		if(ok) {
			var _g = 0;
			var _g1 = Reflect.fields(ld.json);
			while(_g < _g1.length) {
				var k = _g1[_g];
				++_g;
				if(k == "covers") {
					var _g2 = 0;
					var _g3 = Reflect.fields(Reflect.field(ld.json,"covers"));
					while(_g2 < _g3.length) {
						var k2 = _g3[_g2];
						++_g2;
						var cv = new com_tilbuci_contraptions_CoverContraption();
						if(cv.load(Reflect.field(Reflect.field(ld.json,"covers"),k2))) {
							com_tilbuci_data_GlobalPlayer.contraptions.covers.h[cv.id] = cv;
						} else {
							cv.kill();
						}
					}
				} else if(k == "backgrounds") {
					var _g4 = 0;
					var _g5 = Reflect.fields(Reflect.field(ld.json,"backgrounds"));
					while(_g4 < _g5.length) {
						var k21 = _g5[_g4];
						++_g4;
						var bg = new com_tilbuci_contraptions_BackgroundContraption();
						if(bg.load(Reflect.field(Reflect.field(ld.json,"backgrounds"),k21))) {
							com_tilbuci_data_GlobalPlayer.contraptions.backgrounds.h[bg.id] = bg;
						} else {
							bg.kill();
						}
					}
				} else if(k == "menus") {
					var _g6 = 0;
					var _g7 = Reflect.fields(Reflect.field(ld.json,"menus"));
					while(_g6 < _g7.length) {
						var k22 = _g7[_g6];
						++_g6;
						var mn = new com_tilbuci_contraptions_MenuContraption();
						if(mn.load(Reflect.field(Reflect.field(ld.json,"menus"),k22))) {
							com_tilbuci_data_GlobalPlayer.contraptions.menus.h[mn.id] = mn;
						} else {
							mn.kill();
						}
					}
				} else if(k == "messages") {
					var _g8 = 0;
					var _g9 = Reflect.fields(Reflect.field(ld.json,"messages"));
					while(_g8 < _g9.length) {
						var k23 = _g9[_g8];
						++_g8;
						var msg = new com_tilbuci_contraptions_MessagesContraption();
						if(msg.load(Reflect.field(Reflect.field(ld.json,"messages"),k23))) {
							com_tilbuci_data_GlobalPlayer.contraptions.messages.h[msg.id] = msg;
						} else {
							msg.kill();
						}
					}
				} else if(k == "dflow") {
					var _g10 = 0;
					var _g11 = Reflect.fields(Reflect.field(ld.json,"dflow"));
					while(_g10 < _g11.length) {
						var k24 = _g11[_g10];
						++_g10;
						var dfl = new com_tilbuci_contraptions_DflowContraption();
						if(dfl.load(Reflect.field(Reflect.field(ld.json,"dflow"),k24))) {
							com_tilbuci_data_GlobalPlayer.contraptions.dflow.h[dfl.id] = dfl;
						} else {
							dfl.kill();
						}
					}
				} else if(k == "inv") {
					var _g12 = 0;
					var _g13 = Reflect.fields(Reflect.field(ld.json,"inv"));
					while(_g12 < _g13.length) {
						var k25 = _g13[_g12];
						++_g12;
						var inv = new com_tilbuci_contraptions_InventoryContraption();
						if(inv.load(Reflect.field(Reflect.field(ld.json,"inv"),k25))) {
							com_tilbuci_data_GlobalPlayer.contraptions.inv.h["inv"] = inv;
						} else {
							inv.kill();
						}
					}
				} else if(k == "bs") {
					var _g14 = 0;
					var _g15 = Reflect.fields(Reflect.field(ld.json,"bs"));
					while(_g14 < _g15.length) {
						var k26 = _g15[_g14];
						++_g14;
						var bs = new com_tilbuci_contraptions_BattleContraption();
						if(bs.load(Reflect.field(Reflect.field(ld.json,"bs"),k26))) {
							com_tilbuci_data_GlobalPlayer.contraptions.bs.h["bs"] = bs;
						} else {
							bs.kill();
						}
					}
				} else if(k == "musics") {
					var _g16 = 0;
					var _g17 = Reflect.fields(Reflect.field(ld.json,"musics"));
					while(_g16 < _g17.length) {
						var k27 = _g17[_g16];
						++_g16;
						var ms = new com_tilbuci_contraptions_MusicContraption();
						if(ms.load(Reflect.field(Reflect.field(ld.json,"musics"),k27))) {
							com_tilbuci_data_GlobalPlayer.contraptions.musics.h[ms.id] = ms;
						} else {
							ms.kill();
						}
					}
				} else if(k == "sounds") {
					var _g18 = 0;
					var _g19 = Reflect.fields(Reflect.field(ld.json,"sounds"));
					while(_g18 < _g19.length) {
						var k28 = _g19[_g18];
						++_g18;
						var snd = new com_tilbuci_contraptions_SoundContraption();
						if(snd.load(Reflect.field(Reflect.field(ld.json,"sounds"),k28))) {
							com_tilbuci_data_GlobalPlayer.contraptions.sounds.h[snd.id] = snd;
						} else {
							snd.kill();
						}
					}
				} else if(k == "targets") {
					var _g20 = 0;
					var _g21 = Reflect.fields(Reflect.field(ld.json,"targets"));
					while(_g20 < _g21.length) {
						var k29 = _g21[_g20];
						++_g20;
						var tg = new com_tilbuci_contraptions_TargetContraption();
						if(tg.load(Reflect.field(Reflect.field(ld.json,"targets"),k29))) {
							com_tilbuci_data_GlobalPlayer.contraptions.targets.h[tg.id] = tg;
						} else {
							tg.kill();
						}
					}
				} else if(k == "forms") {
					var _g22 = 0;
					var _g23 = Reflect.fields(Reflect.field(ld.json,"forms"));
					while(_g22 < _g23.length) {
						var k210 = _g23[_g22];
						++_g22;
						var fc = new com_tilbuci_contraptions_FormContraption();
						if(fc.load(Reflect.field(Reflect.field(ld.json,"forms"),k210))) {
							com_tilbuci_data_GlobalPlayer.contraptions.forms.h[fc.id] = fc;
						} else {
							fc.kill();
						}
					}
				} else if(k == "interf") {
					var _g24 = 0;
					var _g25 = Reflect.fields(Reflect.field(ld.json,"interf"));
					while(_g24 < _g25.length) {
						var k211 = _g25[_g24];
						++_g24;
						var it = new com_tilbuci_contraptions_InterfaceContraption();
						if(it.load(Reflect.field(Reflect.field(ld.json,"interf"),k211))) {
							com_tilbuci_data_GlobalPlayer.contraptions.interf.h[it.id] = it;
						} else {
							it.kill();
						}
					}
				}
			}
		}
	}
	,onNarrative: function(ok,ld) {
		com_tilbuci_data_GlobalPlayer.narrative.clear();
		if(ok) {
			var _g = 0;
			var _g1 = Reflect.fields(ld.json);
			while(_g < _g1.length) {
				var k = _g1[_g];
				++_g;
				if(k == "chars") {
					var _g2 = 0;
					var _g3 = Reflect.fields(Reflect.field(ld.json,"chars"));
					while(_g2 < _g3.length) {
						var k2 = _g3[_g2];
						++_g2;
						var chnar = new com_tilbuci_narrative_CharacterNarrative();
						if(chnar.load(Reflect.field(Reflect.field(ld.json,"chars"),k2))) {
							com_tilbuci_data_GlobalPlayer.narrative.chars.h[chnar.id] = chnar;
						} else {
							chnar.kill();
						}
					}
				} else if(k == "dialogues") {
					var _g4 = 0;
					var _g5 = Reflect.fields(Reflect.field(ld.json,"dialogues"));
					while(_g4 < _g5.length) {
						var k21 = _g5[_g4];
						++_g4;
						var dnar = new com_tilbuci_narrative_DialogueFolderNarrative();
						if(dnar.load(Reflect.field(Reflect.field(ld.json,"dialogues"),k21))) {
							com_tilbuci_data_GlobalPlayer.narrative.dialogues.h[dnar.id] = dnar;
						} else {
							dnar.kill();
						}
					}
				} else if(k == "items") {
					var _g6 = 0;
					var _g7 = Reflect.fields(Reflect.field(ld.json,"items"));
					while(_g6 < _g7.length) {
						var k22 = _g7[_g6];
						++_g6;
						var itnar = new com_tilbuci_narrative_InvItemNarrative();
						if(itnar.load(Reflect.field(Reflect.field(ld.json,"items"),k22))) {
							com_tilbuci_data_GlobalPlayer.narrative.items.h[itnar.itname] = itnar;
						} else {
							itnar.kill();
						}
					}
				} else if(k == "cards") {
					var _g8 = 0;
					var _g9 = Reflect.fields(Reflect.field(ld.json,"cards"));
					while(_g8 < _g9.length) {
						var k23 = _g9[_g8];
						++_g8;
						var crdar = new com_tilbuci_narrative_BattleCardNarrative();
						if(crdar.load(Reflect.field(Reflect.field(ld.json,"cards"),k23))) {
							com_tilbuci_data_GlobalPlayer.narrative.cards.h[crdar.cardname] = crdar;
						} else {
							crdar.kill();
						}
					}
				}
			}
			var h = com_tilbuci_data_GlobalPlayer.narrative.chars.h;
			var char_h = h;
			var char_keys = Object.keys(h);
			var char_length = char_keys.length;
			var char_current = 0;
			while(char_current < char_length) {
				var char = char_h[char_keys[char_current++]];
				if(char.collection != "") {
					com_tilbuci_data_GlobalPlayer.movie.loadCollection(char.collection);
				}
			}
		}
	}
	,getString: function(name) {
		if(Object.prototype.hasOwnProperty.call(this._strings.h,name)) {
			return this._strings.h[name];
		} else {
			return "";
		}
	}
	,setString: function(name,value) {
		var this1 = this._strings;
		var k = this.parseString(name);
		var v = this.parseString(value);
		this1.h[k] = v;
		return true;
	}
	,clearString: function(name) {
		var this1 = this._strings;
		var key = this.parseString(name);
		if(Object.prototype.hasOwnProperty.call(this1.h,key)) {
			var this1 = this._strings;
			var key = this.parseString(name);
			var _this = this1;
			if(Object.prototype.hasOwnProperty.call(_this.h,key)) {
				delete(_this.h[key]);
			}
		}
		return true;
	}
	,concatString: function(name,str1,str2) {
		if(HxOverrides.substr(str1,0,1) == "#") {
			if(Object.prototype.hasOwnProperty.call(this._ints.h,HxOverrides.substr(str1,1,null))) {
				str1 = Std.string(this._ints.h[HxOverrides.substr(str1,1,null)]);
			} else if(Object.prototype.hasOwnProperty.call(this._floats.h,HxOverrides.substr(str1,1,null))) {
				str1 = Std.string(this._floats.h[HxOverrides.substr(str1,1,null)]);
			} else {
				str1 = this.parseString(str1);
			}
		} else if(HxOverrides.substr(str1,0,1) == "?") {
			if(Object.prototype.hasOwnProperty.call(this._bools.h,HxOverrides.substr(str1,1,null))) {
				if(this._bools.h[HxOverrides.substr(str1,1,null)]) {
					str1 = "true";
				} else {
					str1 = "false";
				}
			} else {
				str1 = this.parseString(str1);
			}
		} else {
			str1 = this.parseString(str1);
		}
		if(HxOverrides.substr(str2,0,1) == "#") {
			if(Object.prototype.hasOwnProperty.call(this._ints.h,HxOverrides.substr(str2,1,null))) {
				str2 = Std.string(this._ints.h[HxOverrides.substr(str2,1,null)]);
			} else if(Object.prototype.hasOwnProperty.call(this._floats.h,HxOverrides.substr(str2,1,null))) {
				str2 = Std.string(this._floats.h[HxOverrides.substr(str2,1,null)]);
			} else {
				str2 = this.parseString(str2);
			}
		} else if(HxOverrides.substr(str2,0,1) == "?") {
			if(Object.prototype.hasOwnProperty.call(this._bools.h,HxOverrides.substr(str2,1,null))) {
				if(this._bools.h[HxOverrides.substr(str2,1,null)]) {
					str2 = "true";
				} else {
					str2 = "false";
				}
			} else {
				str2 = this.parseString(str2);
			}
		} else {
			str2 = this.parseString(str2);
		}
		var this1 = this._strings;
		var k = this.parseString(name);
		var v = str1 + str2;
		this1.h[k] = v;
		return true;
	}
	,getFloat: function(name) {
		if(Object.prototype.hasOwnProperty.call(this._floats.h,name)) {
			return this._floats.h[name];
		} else {
			return 0.0;
		}
	}
	,clearFloat: function(name) {
		var this1 = this._floats;
		var key = this.parseString(name);
		if(Object.prototype.hasOwnProperty.call(this1.h,key)) {
			var this1 = this._floats;
			var key = this.parseString(name);
			var _this = this1;
			if(Object.prototype.hasOwnProperty.call(_this.h,key)) {
				delete(_this.h[key]);
			}
		}
		return true;
	}
	,setFloat: function(name,value) {
		name = this.parseString(name);
		if(Type.typeof(value) == ValueType.TFloat || Type.typeof(value) == ValueType.TInt) {
			var v = value;
			this._floats.h[name] = v;
		} else {
			var this1 = this._floats;
			var v = this.parseFloat(value);
			this1.h[name] = v;
		}
		return true;
	}
	,getInt: function(name) {
		if(Object.prototype.hasOwnProperty.call(this._ints.h,name)) {
			return this._ints.h[name];
		} else {
			return 0;
		}
	}
	,clearInt: function(name) {
		var this1 = this._ints;
		var key = this.parseString(name);
		if(Object.prototype.hasOwnProperty.call(this1.h,key)) {
			var this1 = this._ints;
			var key = this.parseString(name);
			var _this = this1;
			if(Object.prototype.hasOwnProperty.call(_this.h,key)) {
				delete(_this.h[key]);
			}
		}
		return true;
	}
	,setInt: function(name,value) {
		name = this.parseString(name);
		if(Type.typeof(value) == ValueType.TInt) {
			var v = value;
			this._ints.h[name] = v;
		} else if(Type.typeof(value) == ValueType.TFloat) {
			var v = Math.round(value);
			this._ints.h[name] = v;
		} else {
			var this1 = this._ints;
			var v = this.parseInt(value);
			this1.h[name] = v;
		}
		return true;
	}
	,getBool: function(name) {
		if(Object.prototype.hasOwnProperty.call(this._bools.h,name)) {
			return this._bools.h[name];
		} else {
			return false;
		}
	}
	,clearBool: function(name) {
		var this1 = this._bools;
		var key = this.parseString(name);
		if(Object.prototype.hasOwnProperty.call(this1.h,key)) {
			var this1 = this._bools;
			var key = this.parseString(name);
			var _this = this1;
			if(Object.prototype.hasOwnProperty.call(_this.h,key)) {
				delete(_this.h[key]);
			}
		}
		return true;
	}
	,setBool: function(name,value,invert) {
		if(invert == null) {
			invert = false;
		}
		name = this.parseString(name);
		if(Type.typeof(value) == ValueType.TBool) {
			if(invert) {
				var v = !value;
				this._bools.h[name] = v;
			} else {
				var v = value;
				this._bools.h[name] = v;
			}
		} else if(invert) {
			var this1 = this._bools;
			var v = !this.parseBool(value);
			this1.h[name] = v;
		} else {
			var this1 = this._bools;
			var v = this.parseBool(value);
			this1.h[name] = v;
		}
		return true;
	}
	,run: function(scr,parsed) {
		if(parsed == null) {
			parsed = false;
		}
		var json;
		if(parsed) {
			if(scr == null) {
				return true;
			} else {
				json = scr;
			}
		} else {
			json = com_tilbuci_statictools_StringStatic.jsonParse(scr);
		}
		if(json == false) {
			return false;
		} else if(Type.typeof(json) != ValueType.TObject) {
			var arcmd = [];
			var ok = false;
			try {
				arcmd = js_Boot.__cast(json , Array);
				ok = true;
			} catch( _g ) {
				ok = false;
			}
			if(ok) {
				var _g = 0;
				while(_g < arcmd.length) {
					var obj = arcmd[_g];
					++_g;
					if(!this.run(obj,true)) {
						ok = false;
					}
				}
				return ok;
			} else {
				return false;
			}
		} else {
			return this.exec(json);
		}
	}
	,checkJoystick: function(code) {
		var found = false;
		switch(code) {
		case "0":
			if(com_tilbuci_data_GlobalPlayer.usingTarget > 0) {
				com_tilbuci_data_GlobalPlayer.area.triggerTarget();
				found = true;
			} else {
				found = this.runInput("keyspace");
			}
			break;
		case "1":
			found = this.runInput("keyenter");
			break;
		case "2":
			found = this.runInput("keypup");
			break;
		case "3":
			found = this.runInput("keypdown");
			break;
		case "d":
			if(com_tilbuci_data_GlobalPlayer.usingTarget > 0) {
				com_tilbuci_data_GlobalPlayer.area.moveTarget("down");
				found = true;
			} else {
				found = this.runInput("keydown");
			}
			break;
		case "l":
			if(com_tilbuci_data_GlobalPlayer.usingTarget > 0) {
				com_tilbuci_data_GlobalPlayer.area.moveTarget("left");
				found = true;
			} else {
				found = this.runInput("keyleft");
			}
			break;
		case "r":
			if(com_tilbuci_data_GlobalPlayer.usingTarget > 0) {
				com_tilbuci_data_GlobalPlayer.area.moveTarget("right");
				found = true;
			} else {
				found = this.runInput("keyright");
			}
			break;
		case "u":
			if(com_tilbuci_data_GlobalPlayer.usingTarget > 0) {
				com_tilbuci_data_GlobalPlayer.area.moveTarget("up");
				found = true;
			} else {
				found = this.runInput("keyup");
			}
			break;
		}
		return found;
	}
	,checkKeyboard: function(keyCode) {
		var found = false;
		switch(keyCode) {
		case 13:
			found = this.runInput("keyenter");
			break;
		case 32:
			if(com_tilbuci_data_GlobalPlayer.usingTarget > 0) {
				com_tilbuci_data_GlobalPlayer.area.triggerTarget();
				found = true;
			} else {
				found = this.runInput("keyspace");
			}
			break;
		case 33:
			found = this.runInput("keypup");
			break;
		case 34:
			found = this.runInput("keypdown");
			break;
		case 35:
			found = this.runInput("keyend");
			break;
		case 36:
			found = this.runInput("keyhome");
			break;
		case 37:
			if(com_tilbuci_data_GlobalPlayer.usingTarget > 0) {
				com_tilbuci_data_GlobalPlayer.area.moveTarget("left");
				found = true;
			} else {
				found = this.runInput("keyleft");
				if(!found) {
					found = this.runInput("keyletf");
				}
			}
			break;
		case 38:
			if(com_tilbuci_data_GlobalPlayer.usingTarget > 0) {
				com_tilbuci_data_GlobalPlayer.area.moveTarget("up");
				found = true;
			} else {
				found = this.runInput("keyup");
			}
			break;
		case 39:
			if(com_tilbuci_data_GlobalPlayer.usingTarget > 0) {
				com_tilbuci_data_GlobalPlayer.area.moveTarget("right");
				found = true;
			} else {
				found = this.runInput("keyright");
			}
			break;
		case 40:
			if(com_tilbuci_data_GlobalPlayer.usingTarget > 0) {
				com_tilbuci_data_GlobalPlayer.area.moveTarget("down");
				found = true;
			} else {
				found = this.runInput("keydown");
			}
			break;
		}
		return found;
	}
	,checkMouse: function(inpt) {
		var found = false;
		switch(inpt) {
		case "mousemiddle":
			found = this.runInput("mousemiddle");
			break;
		case "mouseright":
			found = this.runInput("mouseright");
			break;
		case "mousewheeldown":
			found = this.runInput("mousewheeldown");
			break;
		case "mousewheelup":
			found = this.runInput("mousewheelup");
			break;
		}
		return found;
	}
	,runInput: function(name) {
		var found = false;
		if(Object.prototype.hasOwnProperty.call(com_tilbuci_data_GlobalPlayer.mdata.inputs.h,name)) {
			var _g = com_tilbuci_data_GlobalPlayer.mdata.inputs.h[name];
			if(_g == null) {
				found = this.run("{ \"ac\": \"run\", \"param\": [ \"" + com_tilbuci_data_GlobalPlayer.mdata.inputs.h[name] + "\" ] }");
			} else {
				switch(_g) {
				case "down":
					this.run("{ \"ac\": \"scene.navigate\", \"param\": [ \"down\" ] }");
					found = true;
					break;
				case "firstkf":
					this.run("{ \"ac\": \"scene.loadfirstkeyframe\", \"param\": [ \"\" ] }");
					found = true;
					break;
				case "lastkf":
					this.run("{ \"ac\": \"scene.loadlastkeyframe\", \"param\": [ \"\" ] }");
					found = true;
					break;
				case "left":
					this.run("{ \"ac\": \"scene.navigate\", \"param\": [ \"left\" ] }");
					found = true;
					break;
				case "nextkf":
					this.run("{ \"ac\": \"scene.nextkeyframe\", \"param\": [ \"\" ] }");
					found = true;
					break;
				case "nin":
					this.run("{ \"ac\": \"scene.navigate\", \"param\": [ \"nin\" ] }");
					found = true;
					break;
				case "nothing":
					found = false;
					break;
				case "nout":
					this.run("{ \"ac\": \"scene.navigate\", \"param\": [ \"nout\" ] }");
					found = true;
					break;
				case "prevkf":
					this.run("{ \"ac\": \"scene.previouskeyframe\", \"param\": [ \"\" ] }");
					found = true;
					break;
				case "right":
					this.run("{ \"ac\": \"scene.navigate\", \"param\": [ \"right\" ] }");
					found = true;
					break;
				case "target":
					this.run("{ \"ac\": \"target.toggle\", \"param\": [ \"\" ] }");
					found = true;
					break;
				case "up":
					this.run("{ \"ac\": \"scene.navigate\", \"param\": [ \"up\" ] }");
					found = true;
					break;
				default:
					found = this.run("{ \"ac\": \"run\", \"param\": [ \"" + com_tilbuci_data_GlobalPlayer.mdata.inputs.h[name] + "\" ] }");
				}
			}
		}
		return found;
	}
	,exec: function(inf) {
		if(Object.prototype.hasOwnProperty.call(inf,"ac") && Object.prototype.hasOwnProperty.call(inf,"param") && Type.typeof(Reflect.field(inf,"param")) != ValueType.TObject) {
			var param = [];
			var ok = false;
			try {
				param = js_Boot.__cast(Reflect.field(inf,"param") , Array);
				ok = true;
			} catch( _g ) {
				ok = false;
			}
			if(!ok) {
				return false;
			} else {
				switch(Reflect.field(inf,"ac")) {
				case "animation.method":
					com_tilbuci_data_GlobalPlayer.area.setAnimation(this.parseString(param[0]));
					return true;
				case "array.clear":
					if(param.length > 0) {
						var this1 = this._arrays;
						var key = this.parseString(param[0]);
						if(Object.prototype.hasOwnProperty.call(this1.h,key)) {
							var this1 = this._arrays;
							var key = this.parseString(param[0]);
							this1.h[key].clear();
							return true;
						} else {
							return false;
						}
					} else {
						return false;
					}
					break;
				case "array.create":
					if(param.length > 0) {
						var this1 = this._arrays;
						var key = this.parseString(param[0]);
						if(Object.prototype.hasOwnProperty.call(this1.h,key)) {
							return false;
						} else {
							var this1 = this._arrays;
							var k = this.parseString(param[0]);
							var v = new com_tilbuci_def_TBArray();
							this1.h[k] = v;
							return true;
						}
					} else {
						return false;
					}
					break;
				case "array.current":
					if(param.length > 1) {
						var this1 = this._arrays;
						var key = this.parseString(param[0]);
						if(Object.prototype.hasOwnProperty.call(this1.h,key)) {
							var this1 = this._strings;
							var k = this.parseString(param[1]);
							var this2 = this._arrays;
							var key = this.parseString(param[0]);
							var v = this2.h[key].current();
							this1.h[k] = v;
							return true;
						} else {
							return false;
						}
					} else {
						return false;
					}
					break;
				case "array.currentbool":
					if(param.length > 1) {
						var this1 = this._arrays;
						var key = this.parseString(param[0]);
						if(Object.prototype.hasOwnProperty.call(this1.h,key)) {
							var this1 = this._bools;
							var k = this.parseString(param[1]);
							var this2 = this._arrays;
							var key = this.parseString(param[0]);
							var v = this2.h[key].currentBool();
							this1.h[k] = v;
							return true;
						} else {
							return false;
						}
					} else {
						return false;
					}
					break;
				case "array.currentfloat":
					if(param.length > 1) {
						var this1 = this._arrays;
						var key = this.parseString(param[0]);
						if(Object.prototype.hasOwnProperty.call(this1.h,key)) {
							var this1 = this._floats;
							var k = this.parseString(param[1]);
							var this2 = this._arrays;
							var key = this.parseString(param[0]);
							var v = this2.h[key].currentFloat();
							this1.h[k] = v;
							return true;
						} else {
							return false;
						}
					} else {
						return false;
					}
					break;
				case "array.currentint":
					if(param.length > 1) {
						var this1 = this._arrays;
						var key = this.parseString(param[0]);
						if(Object.prototype.hasOwnProperty.call(this1.h,key)) {
							var this1 = this._ints;
							var k = this.parseString(param[1]);
							var this2 = this._arrays;
							var key = this.parseString(param[0]);
							var v = this2.h[key].currentInt();
							this1.h[k] = v;
							return true;
						} else {
							return false;
						}
					} else {
						return false;
					}
					break;
				case "array.fromstring":
					if(param.length > 1) {
						var this1 = this._arrays;
						var key = this.parseString(param[0]);
						if(!Object.prototype.hasOwnProperty.call(this1.h,key)) {
							var this1 = this._arrays;
							var k = this.parseString(param[0]);
							var v = new com_tilbuci_def_TBArray();
							this1.h[k] = v;
						}
						var this1 = this._arrays;
						var key = this.parseString(param[0]);
						var tmp = this1.h[key];
						var this1 = this._strings;
						var key = this.parseString(param[1]);
						return tmp.fromJson(this1.h[key]);
					} else {
						return false;
					}
					break;
				case "array.get":
					if(param.length > 2) {
						var this1 = this._strings;
						var k = this.parseString(param[2]);
						var this2 = this._arrays;
						var key = this.parseString(param[0]);
						var v = this2.h[key].get(this.parseInt(param[1]));
						this1.h[k] = v;
						return true;
					} else {
						return false;
					}
					break;
				case "array.getbool":
					if(param.length > 2) {
						var this1 = this._bools;
						var k = this.parseString(param[2]);
						var this2 = this._arrays;
						var key = this.parseString(param[0]);
						var v = this2.h[key].getBool(this.parseInt(param[1]));
						this1.h[k] = v;
						return true;
					} else {
						return false;
					}
					break;
				case "array.getfloat":
					if(param.length > 2) {
						var this1 = this._floats;
						var k = this.parseString(param[2]);
						var this2 = this._arrays;
						var key = this.parseString(param[0]);
						var v = this2.h[key].getFloat(this.parseInt(param[1]));
						this1.h[k] = v;
						return true;
					} else {
						return false;
					}
					break;
				case "array.getindex":
					if(param.length > 1) {
						var this1 = this._arrays;
						var key = this.parseString(param[0]);
						if(Object.prototype.hasOwnProperty.call(this1.h,key)) {
							var this1 = this._ints;
							var k = this.parseString(param[1]);
							var this2 = this._arrays;
							var key = this.parseString(param[0]);
							var v = this2.h[key].currentIndex();
							this1.h[k] = v;
							return true;
						} else {
							return false;
						}
					} else {
						return false;
					}
					break;
				case "array.getint":
					if(param.length > 2) {
						var this1 = this._ints;
						var k = this.parseString(param[2]);
						var this2 = this._arrays;
						var key = this.parseString(param[0]);
						var v = this2.h[key].getInt(this.parseInt(param[1]));
						this1.h[k] = v;
						return true;
					} else {
						return false;
					}
					break;
				case "array.loadfile":
					if(param.length > 0) {
						this._acOk = this._acError = null;
						if(Object.prototype.hasOwnProperty.call(inf,"success")) {
							this._acOk = Reflect.field(inf,"success");
						}
						if(Object.prototype.hasOwnProperty.call(inf,"error")) {
							this._acError = Reflect.field(inf,"error");
						}
						var cache = null;
						this._currentArray = this.parseString(param[0]);
						if(com_tilbuci_data_GlobalPlayer.nocache) {
							var _g = new haxe_ds_StringMap();
							var value = Math.ceil(Math.random() * 10000);
							_g.h["rand"] = value;
							cache = _g;
						}
						new com_tilbuci_data_DataLoader(true,com_tilbuci_data_GlobalPlayer.path + "media/strings/" + this.parseString(param[0]) + ".json","GET",cache,1,$bind(this,this.onArrayFile));
						return true;
					} else {
						if(Object.prototype.hasOwnProperty.call(inf,"error")) {
							this.run(Reflect.field(inf,"error"),true);
						}
						return false;
					}
					break;
				case "array.next":
					if(param.length > 1) {
						var this1 = this._arrays;
						var key = this.parseString(param[0]);
						if(Object.prototype.hasOwnProperty.call(this1.h,key)) {
							var this1 = this._strings;
							var k = this.parseString(param[1]);
							var this2 = this._arrays;
							var key = this.parseString(param[0]);
							var v = this2.h[key].next();
							this1.h[k] = v;
							return true;
						} else {
							return false;
						}
					} else {
						return false;
					}
					break;
				case "array.nextbool":
					if(param.length > 1) {
						var this1 = this._arrays;
						var key = this.parseString(param[0]);
						if(Object.prototype.hasOwnProperty.call(this1.h,key)) {
							var this1 = this._bools;
							var k = this.parseString(param[1]);
							var this2 = this._arrays;
							var key = this.parseString(param[0]);
							var v = this2.h[key].nextBool();
							this1.h[k] = v;
							return true;
						} else {
							return false;
						}
					} else {
						return false;
					}
					break;
				case "array.nextfloat":
					if(param.length > 1) {
						var this1 = this._arrays;
						var key = this.parseString(param[0]);
						if(Object.prototype.hasOwnProperty.call(this1.h,key)) {
							var this1 = this._floats;
							var k = this.parseString(param[1]);
							var this2 = this._arrays;
							var key = this.parseString(param[0]);
							var v = this2.h[key].nextFloat();
							this1.h[k] = v;
							return true;
						} else {
							return false;
						}
					} else {
						return false;
					}
					break;
				case "array.nextint":
					if(param.length > 1) {
						var this1 = this._arrays;
						var key = this.parseString(param[0]);
						if(Object.prototype.hasOwnProperty.call(this1.h,key)) {
							var this1 = this._ints;
							var k = this.parseString(param[1]);
							var this2 = this._arrays;
							var key = this.parseString(param[0]);
							var v = this2.h[key].nextInt();
							this1.h[k] = v;
							return true;
						} else {
							return false;
						}
					} else {
						return false;
					}
					break;
				case "array.previous":
					if(param.length > 1) {
						var this1 = this._arrays;
						var key = this.parseString(param[0]);
						if(Object.prototype.hasOwnProperty.call(this1.h,key)) {
							var this1 = this._strings;
							var k = this.parseString(param[1]);
							var this2 = this._arrays;
							var key = this.parseString(param[0]);
							var v = this2.h[key].previous();
							this1.h[k] = v;
							return true;
						} else {
							return false;
						}
					} else {
						return false;
					}
					break;
				case "array.previousbool":
					if(param.length > 1) {
						var this1 = this._arrays;
						var key = this.parseString(param[0]);
						if(Object.prototype.hasOwnProperty.call(this1.h,key)) {
							var this1 = this._bools;
							var k = this.parseString(param[1]);
							var this2 = this._arrays;
							var key = this.parseString(param[0]);
							var v = this2.h[key].previousBool();
							this1.h[k] = v;
							return true;
						} else {
							return false;
						}
					} else {
						return false;
					}
					break;
				case "array.previousfloat":
					if(param.length > 1) {
						var this1 = this._arrays;
						var key = this.parseString(param[0]);
						if(Object.prototype.hasOwnProperty.call(this1.h,key)) {
							var this1 = this._floats;
							var k = this.parseString(param[1]);
							var this2 = this._arrays;
							var key = this.parseString(param[0]);
							var v = this2.h[key].previousFloat();
							this1.h[k] = v;
							return true;
						} else {
							return false;
						}
					} else {
						return false;
					}
					break;
				case "array.previousint":
					if(param.length > 1) {
						var this1 = this._arrays;
						var key = this.parseString(param[0]);
						if(Object.prototype.hasOwnProperty.call(this1.h,key)) {
							var this1 = this._ints;
							var k = this.parseString(param[1]);
							var this2 = this._arrays;
							var key = this.parseString(param[0]);
							var v = this2.h[key].previousInt();
							this1.h[k] = v;
							return true;
						} else {
							return false;
						}
					} else {
						return false;
					}
					break;
				case "array.push":
					if(param.length > 1) {
						var this1 = this._arrays;
						var key = this.parseString(param[0]);
						this1.h[key].push(Std.string(param[1]));
						return true;
					} else {
						return false;
					}
					break;
				case "array.remove":
					if(param.length > 0) {
						var this1 = this._arrays;
						var key = this.parseString(param[0]);
						if(Object.prototype.hasOwnProperty.call(this1.h,key)) {
							var this1 = this._arrays;
							var key = this.parseString(param[0]);
							this1.h[key].kill();
							var this1 = this._arrays;
							var key = this.parseString(param[0]);
							var _this = this1;
							if(Object.prototype.hasOwnProperty.call(_this.h,key)) {
								delete(_this.h[key]);
							}
							return true;
						} else {
							return false;
						}
					} else {
						return false;
					}
					break;
				case "array.set":
					if(param.length > 2) {
						var this1 = this._arrays;
						var key = this.parseString(param[0]);
						this1.h[key].set(this.parseInt(param[1]),Std.string(param[2]));
						return true;
					} else {
						return false;
					}
					break;
				case "array.setindex":
					if(param.length > 1) {
						var this1 = this._arrays;
						var key = this.parseString(param[0]);
						if(Object.prototype.hasOwnProperty.call(this1.h,key)) {
							var this1 = this._arrays;
							var key = this.parseString(param[0]);
							this1.h[key].setIndex(this.parseInt(param[1]));
							return true;
						} else {
							return false;
						}
					} else {
						return false;
					}
					break;
				case "array.tostring":
					if(param.length > 1) {
						var this1 = this._arrays;
						var key = this.parseString(param[0]);
						if(Object.prototype.hasOwnProperty.call(this1.h,key)) {
							var this1 = this._strings;
							var k = this.parseString(param[1]);
							var this2 = this._arrays;
							var key = this.parseString(param[0]);
							var v = this2.h[key].toJson();
							this1.h[k] = v;
							return true;
						} else {
							return false;
						}
					} else {
						return false;
					}
					break;
				case "battle.close":
					com_tilbuci_data_GlobalPlayer.contraptions.bsHide();
					return true;
				case "battle.setattribute":
					if(param.length > 3) {
						if(Object.prototype.hasOwnProperty.call(com_tilbuci_data_GlobalPlayer.contraptions.bs.h,"bs")) {
							com_tilbuci_data_GlobalPlayer.contraptions.bs.h["bs"].setAttributes(true,this.parseInt(param[0]) - 1,this.parseInt(param[1]),this.parseInt(param[2]),this.parseInt(param[3]));
							return true;
						} else {
							return false;
						}
					} else {
						return false;
					}
					break;
				case "battle.setopponent":
					if(param.length > 3) {
						if(Object.prototype.hasOwnProperty.call(com_tilbuci_data_GlobalPlayer.contraptions.bs.h,"bs")) {
							com_tilbuci_data_GlobalPlayer.contraptions.bs.h["bs"].setAttributes(false,this.parseInt(param[0]) - 1,this.parseInt(param[1]),this.parseInt(param[2]),this.parseInt(param[3]));
							return true;
						} else {
							return false;
						}
					} else {
						return false;
					}
					break;
				case "battle.show":
					if(param.length > 1) {
						var pl = this.parseString(param[0]).split(",");
						var op = this.parseString(param[1]).split(",");
						var plfinal = [];
						var opfinal = [];
						var _g = 0;
						var _g1 = pl.length;
						while(_g < _g1) {
							var i = _g++;
							if(i < 5) {
								plfinal.push(this.parseString(StringTools.trim(pl[i])));
							}
						}
						var _g = 0;
						var _g1 = op.length;
						while(_g < _g1) {
							var i = _g++;
							if(i < 5) {
								opfinal.push(this.parseString(StringTools.trim(op[i])));
							}
						}
						var onwin = null;
						var onloose = null;
						if(Object.prototype.hasOwnProperty.call(inf,"win")) {
							onwin = Reflect.field(inf,"win");
						}
						if(Object.prototype.hasOwnProperty.call(inf,"loose")) {
							onloose = Reflect.field(inf,"loose");
						}
						com_tilbuci_data_GlobalPlayer.contraptions.battleShow(onwin,onloose,plfinal,opfinal);
						return true;
					} else {
						return false;
					}
					break;
				case "bool.clear":
					return this.clearBool(param[0]);
				case "bool.clearall":
					return this.clearVars("bools");
				case "bool.set":
					return this.setBool(param[0],param[1]);
				case "bool.setinverse":
					return this.setBool(param[0],param[1],true);
				case "contraption.background":
					if(param.length > 0) {
						return com_tilbuci_data_GlobalPlayer.contraptions.showBackground(this.parseString(param[0]));
					} else {
						return false;
					}
					break;
				case "contraption.backgroundhide":
					com_tilbuci_data_GlobalPlayer.contraptions.hideBackground();
					return true;
				case "contraption.cover":
					if(param.length > 0) {
						return com_tilbuci_data_GlobalPlayer.contraptions.showCover(this.parseString(param[0]));
					} else {
						return false;
					}
					break;
				case "contraption.coverhide":
					com_tilbuci_data_GlobalPlayer.contraptions.hideCover();
					return true;
				case "contraption.form":
					if(param.length > 2) {
						var acOk = null;
						var acCancel = null;
						if(Object.prototype.hasOwnProperty.call(inf,"ok")) {
							acOk = Reflect.field(inf,"ok");
						}
						if(Object.prototype.hasOwnProperty.call(inf,"cancel")) {
							acCancel = Reflect.field(inf,"cancel");
						}
						return com_tilbuci_data_GlobalPlayer.contraptions.showForm(this.parseString(param[0]),this.parseInt(param[1]),this.parseInt(param[2]),acOk,acCancel);
					} else {
						return false;
					}
					break;
				case "contraption.formhide":
					com_tilbuci_data_GlobalPlayer.contraptions.hideForm();
					return true;
				case "contraption.formsetstepper":
					if(param.length > 3) {
						return com_tilbuci_data_GlobalPlayer.contraptions.setFormStepper(this.parseString(param[0]),this.parseInt(param[1]),this.parseInt(param[2]),this.parseInt(param[3]));
					} else {
						return false;
					}
					break;
				case "contraption.formvalue":
					if(param.length > 1) {
						return com_tilbuci_data_GlobalPlayer.contraptions.setFormValue(this.parseString(param[0]),param[1]);
					} else {
						return false;
					}
					break;
				case "contraption.hideloading":
					com_tilbuci_data_GlobalPlayer.contraptions.hideLoadingIc();
					return true;
				case "contraption.interface":
					if(param.length > 2) {
						return com_tilbuci_data_GlobalPlayer.contraptions.showInterface(this.parseString(param[0]),this.parseInt(param[1]),this.parseInt(param[2]));
					} else {
						return false;
					}
					break;
				case "contraption.interfaceanimframe":
					if(param.length > 1) {
						return com_tilbuci_data_GlobalPlayer.contraptions.setInterfaceFrame(this.parseString(param[0]),this.parseInt(param[1]));
					} else {
						return false;
					}
					break;
				case "contraption.interfaceanimpause":
					if(param.length > 0) {
						return com_tilbuci_data_GlobalPlayer.contraptions.pauseInterface(this.parseString(param[0]));
					} else {
						return false;
					}
					break;
				case "contraption.interfaceanimplay":
					if(param.length > 0) {
						return com_tilbuci_data_GlobalPlayer.contraptions.playInterface(this.parseString(param[0]));
					} else {
						return false;
					}
					break;
				case "contraption.interfacehide":
					if(param.length > 0) {
						com_tilbuci_data_GlobalPlayer.contraptions.hideInterface(this.parseString(param[0]));
						return true;
					} else {
						return false;
					}
					break;
				case "contraption.interfacehideall":
					com_tilbuci_data_GlobalPlayer.contraptions.hideAllInterfaces();
					return true;
				case "contraption.interfacetext":
					if(param.length > 1) {
						return com_tilbuci_data_GlobalPlayer.contraptions.setInterfaceText(this.parseString(param[0]),this.parseString(param[1]));
					} else {
						return false;
					}
					break;
				case "contraption.menu":
					if(param.length >= 6) {
						var mn = this.parseString(param[0]);
						if(Object.prototype.hasOwnProperty.call(com_tilbuci_data_GlobalPlayer.contraptions.menus.h,mn)) {
							var bts = this.parseString(param[1]).split(";");
							var bts2 = [];
							var _g = 0;
							while(_g < bts.length) {
								var mnit = bts[_g];
								++_g;
								bts2.push(this.parseString(StringTools.trim(mnit)));
							}
							var acSelect = null;
							if(Object.prototype.hasOwnProperty.call(inf,"select")) {
								acSelect = Reflect.field(inf,"select");
							}
							return com_tilbuci_data_GlobalPlayer.contraptions.menuShow(mn,bts2,this.parseString(param[2]),acSelect,this.parseString(param[3]),this.parseInt(param[4]),this.parseInt(param[5]));
						} else {
							return false;
						}
					} else {
						return false;
					}
					break;
				case "contraption.menuhide":
					com_tilbuci_data_GlobalPlayer.contraptions.menuHide();
					return true;
				case "contraption.message":
					if(param.length >= 4) {
						var mn = this.parseString(param[0]);
						if(Object.prototype.hasOwnProperty.call(com_tilbuci_data_GlobalPlayer.contraptions.messages.h,mn)) {
							var bts = this.parseString(param[2]).split(";");
							var acSelect = null;
							if(Object.prototype.hasOwnProperty.call(inf,"select")) {
								acSelect = Reflect.field(inf,"select");
							}
							return com_tilbuci_data_GlobalPlayer.contraptions.messagesShow(mn,this.parseString(param[1]),bts,this.parseString(param[3]),acSelect);
						} else {
							return false;
						}
					} else {
						return false;
					}
					break;
				case "contraption.messagehide":
					com_tilbuci_data_GlobalPlayer.contraptions.messagesHide();
					return true;
				case "contraption.musicpause":
					com_tilbuci_data_GlobalPlayer.contraptions.musicPause();
					return true;
				case "contraption.musicplay":
					if(param.length > 0) {
						return com_tilbuci_data_GlobalPlayer.contraptions.musicPlay(this.parseString(param[0]));
					} else {
						return false;
					}
					break;
				case "contraption.musicstop":
					com_tilbuci_data_GlobalPlayer.contraptions.musicStop();
					return true;
				case "contraption.musicvolume":
					if(param.length > 0) {
						com_tilbuci_data_GlobalPlayer.contraptions.musicVolume(this.parseInt(param[0]));
						return true;
					} else {
						return false;
					}
					break;
				case "contraption.showloading":
					com_tilbuci_data_GlobalPlayer.contraptions.showLoadingIc();
					return true;
				case "contraption.soudstop":
					if(param.length > 0) {
						com_tilbuci_data_GlobalPlayer.contraptions.soundStop(this.parseString(param[0]));
					} else {
						com_tilbuci_data_GlobalPlayer.contraptions.soundStop();
					}
					return true;
				case "contraption.soundpause":
					if(param.length > 0) {
						com_tilbuci_data_GlobalPlayer.contraptions.soundPause(this.parseString(param[0]));
					} else {
						com_tilbuci_data_GlobalPlayer.contraptions.soundPause();
					}
					return true;
				case "contraption.soundplay":
					if(param.length > 0) {
						return com_tilbuci_data_GlobalPlayer.contraptions.soundPlay(this.parseString(param[0]));
					} else {
						return false;
					}
					break;
				case "contraption.soundvolume":
					if(param.length > 1) {
						com_tilbuci_data_GlobalPlayer.contraptions.soundVolume(this.parseInt(param[0]),this.parseString(param[1]));
						return true;
					} else if(param.length > 0) {
						com_tilbuci_data_GlobalPlayer.contraptions.soundVolume(this.parseInt(param[0]));
						return true;
					} else {
						return false;
					}
					break;
				case "css.clear":
					com_tilbuci_data_GlobalPlayer.style.clear();
					return true;
				case "css.set":
					com_tilbuci_data_GlobalPlayer.style.parseCSS(this.parseString(param[0]));
					return true;
				case "data.event":
					var prData = [];
					if(param.length > 1) {
						var _g = 1;
						var _g1 = param.length;
						while(_g < _g1) {
							var i = _g++;
							if(HxOverrides.substr(Std.string(param[i]),0,1) == "#") {
								if(Object.prototype.hasOwnProperty.call(this._ints.h,HxOverrides.substr(Std.string(param[i]),1,null))) {
									prData.push(this._ints.h[HxOverrides.substr(Std.string(param[i]),1,null)]);
								} else if(Object.prototype.hasOwnProperty.call(this._floats.h,HxOverrides.substr(Std.string(param[i]),1,null))) {
									prData.push(this._floats.h[HxOverrides.substr(Std.string(param[i]),1,null)]);
								} else {
									prData.push(this.parseString(param[i]));
								}
							} else if(HxOverrides.substr(Std.string(param[i]),0,1) == "?") {
								if(Object.prototype.hasOwnProperty.call(this._bools.h,HxOverrides.substr(Std.string(param[i]),1,null))) {
									prData.push(this._bools.h[HxOverrides.substr(Std.string(param[i]),1,null)]);
								} else {
									prData.push(this.parseString(param[i]));
								}
							} else {
								prData.push(this.parseString(param[i]));
							}
						}
					}
					var _g = new haxe_ds_StringMap();
					var value = this.parseString(param[0]);
					_g.h["name"] = value;
					var value = HxOverrides.dateStr(new Date());
					_g.h["when"] = value;
					var value = com_tilbuci_statictools_StringStatic.jsonStringify(prData);
					_g.h["data"] = value;
					var value = com_tilbuci_data_GlobalPlayer.movie.get_mvId();
					_g.h["movieid"] = value;
					var value = com_tilbuci_data_GlobalPlayer.movie.get_scId();
					_g.h["sceneid"] = value;
					_g.h["movietitle"] = com_tilbuci_data_GlobalPlayer.mdata.title;
					_g.h["scenetitle"] = com_tilbuci_data_GlobalPlayer.movie.scene.title;
					var value = com_tilbuci_data_GlobalPlayer.ws.get_user();
					_g.h["visitor"] = value;
					_g.h["sessionid"] = com_tilbuci_data_GlobalPlayer.session;
					this._lastEvent = _g;
					com_tilbuci_data_GlobalPlayer.ws.send("Visitor/Event",this._lastEvent,$bind(this,this.onDataEvent));
					return true;
				case "data.eventclear":
					try {
						var eventData = openfl_net_SharedObject.getLocal(com_tilbuci_data_GlobalPlayer.movie.get_mvId() + "_eventsheld");
						eventData.data.events = [];
						eventData.flush();
						eventData.close();
					} catch( _g ) {
					}
					return true;
				case "data.liststates":
					this._acOk = this._acError = null;
					if(Object.prototype.hasOwnProperty.call(inf,"success")) {
						this._acOk = Reflect.field(inf,"success");
					}
					if(Object.prototype.hasOwnProperty.call(inf,"error")) {
						this._acError = Reflect.field(inf,"error");
					}
					com_tilbuci_data_GlobalPlayer.area.showStatesInput(this._acOk,this._acError);
					return true;
				case "data.load":
					this._acOk = this._acError = null;
					if(com_tilbuci_data_GlobalPlayer.ws.userLogged() && param.length > 0) {
						if(Object.prototype.hasOwnProperty.call(inf,"success")) {
							this._acOk = Reflect.field(inf,"success");
						}
						if(Object.prototype.hasOwnProperty.call(inf,"error")) {
							this._acError = Reflect.field(inf,"error");
						}
						com_tilbuci_data_GlobalPlayer.ws.dataLoad(this.parseString(param[0]),$bind(this,this.onDataLoad));
						return true;
					} else {
						if(Object.prototype.hasOwnProperty.call(inf,"error")) {
							this.run(Reflect.field(inf,"error"),true);
						}
						return false;
					}
					break;
				case "data.loadlocal":
					this._acOk = this._acError = null;
					if(param.length > 0) {
						try {
							var shared = openfl_net_SharedObject.getLocal(com_tilbuci_data_GlobalPlayer.movie.get_mvId() + "_" + this.parseString(param[0]));
							if(Object.prototype.hasOwnProperty.call(shared.data,"values")) {
								var vals = com_tilbuci_statictools_StringStatic.jsonParse(Reflect.field(shared.data,"values"));
								if(vals == false) {
									if(Object.prototype.hasOwnProperty.call(inf,"error")) {
										this.run(Reflect.field(inf,"error"),true);
									}
								} else {
									var _g = 0;
									var _g1 = Reflect.fields(vals);
									while(_g < _g1.length) {
										var i = _g1[_g];
										++_g;
										var obj = Reflect.field(vals,i);
										switch(Reflect.field(obj,"t")) {
										case "B":
											var v = Reflect.field(obj,"v");
											this._bools.h[Reflect.field(obj,"n")] = v;
											break;
										case "F":
											var v1 = Reflect.field(obj,"v");
											this._floats.h[Reflect.field(obj,"n")] = v1;
											break;
										case "I":
											var v2 = Reflect.field(obj,"v");
											this._ints.h[Reflect.field(obj,"n")] = v2;
											break;
										case "S":
											var v3 = Reflect.field(obj,"v");
											this._strings.h[Reflect.field(obj,"n")] = v3;
											break;
										}
									}
									if(Object.prototype.hasOwnProperty.call(inf,"success")) {
										this.run(Reflect.field(inf,"success"),true);
									}
								}
							} else if(Object.prototype.hasOwnProperty.call(inf,"error")) {
								this.run(Reflect.field(inf,"error"),true);
							}
						} catch( _g ) {
							if(Object.prototype.hasOwnProperty.call(inf,"error")) {
								this.run(Reflect.field(inf,"error"),true);
							}
						}
						return true;
					} else {
						if(Object.prototype.hasOwnProperty.call(inf,"error")) {
							this.run(Reflect.field(inf,"error"),true);
						}
						return false;
					}
					break;
				case "data.loadquickstate":
					this._acOk = this._acError = null;
					if(com_tilbuci_data_GlobalPlayer.ws.userLogged()) {
						if(Object.prototype.hasOwnProperty.call(inf,"success")) {
							this._acOk = Reflect.field(inf,"success");
						}
						if(Object.prototype.hasOwnProperty.call(inf,"error")) {
							this._acError = Reflect.field(inf,"error");
						}
						com_tilbuci_data_GlobalPlayer.ws.stateLoad("",true,$bind(this,this.onStateLoad));
						return true;
					} else {
						if(Object.prototype.hasOwnProperty.call(inf,"error")) {
							this.run(Reflect.field(inf,"error"),true);
						}
						return false;
					}
					break;
				case "data.loadstate":
					this._acOk = this._acError = null;
					if(com_tilbuci_data_GlobalPlayer.ws.userLogged() && param.length > 0) {
						if(Object.prototype.hasOwnProperty.call(inf,"success")) {
							this._acOk = Reflect.field(inf,"success");
						}
						if(Object.prototype.hasOwnProperty.call(inf,"error")) {
							this._acError = Reflect.field(inf,"error");
						}
						com_tilbuci_data_GlobalPlayer.ws.stateLoad(this.parseString(param[0]),false,$bind(this,this.onStateLoad));
						return true;
					} else {
						if(Object.prototype.hasOwnProperty.call(inf,"error")) {
							this.run(Reflect.field(inf,"error"),true);
						}
						return false;
					}
					break;
				case "data.loadstatelocal":
					this._acOk = this._acError = null;
					try {
						var shared = openfl_net_SharedObject.getLocal(com_tilbuci_data_GlobalPlayer.movie.get_mvId() + "_state");
						if(Object.prototype.hasOwnProperty.call(shared.data,"values") && Object.prototype.hasOwnProperty.call(shared.data,"scene")) {
							var vals = com_tilbuci_statictools_StringStatic.jsonParse(Reflect.field(shared.data,"values"));
							if(vals == false) {
								if(Object.prototype.hasOwnProperty.call(inf,"error")) {
									this.run(Reflect.field(inf,"error"),true);
								}
							} else {
								var _g = 0;
								var _g1 = Reflect.fields(vals);
								while(_g < _g1.length) {
									var i = _g1[_g];
									++_g;
									var obj = Reflect.field(vals,i);
									switch(Reflect.field(obj,"t")) {
									case "B":
										var v = Reflect.field(obj,"v");
										this._bools.h[Reflect.field(obj,"n")] = v;
										break;
									case "F":
										var v1 = Reflect.field(obj,"v");
										this._floats.h[Reflect.field(obj,"n")] = v1;
										break;
									case "I":
										var v2 = Reflect.field(obj,"v");
										this._ints.h[Reflect.field(obj,"n")] = v2;
										break;
									case "S":
										var v3 = Reflect.field(obj,"v");
										this._strings.h[Reflect.field(obj,"n")] = v3;
										break;
									}
								}
								if(Object.prototype.hasOwnProperty.call(inf,"success")) {
									this.run(Reflect.field(inf,"success"),true);
								}
							}
						} else if(Object.prototype.hasOwnProperty.call(inf,"error")) {
							this.run(Reflect.field(inf,"error"),true);
						}
					} catch( _g ) {
						if(Object.prototype.hasOwnProperty.call(inf,"error")) {
							this.run(Reflect.field(inf,"error"),true);
						}
					}
					return true;
				case "data.save":
					this._acOk = this._acError = null;
					if(com_tilbuci_data_GlobalPlayer.ws.userLogged() && param.length > 1) {
						var values = [];
						var _g = 1;
						var _g1 = param.length;
						while(_g < _g1) {
							var i = _g++;
							var obj = this.getValueObj(param[i]);
							if(obj != null) {
								values.push(obj);
							}
						}
						if(values.length == 0) {
							if(Object.prototype.hasOwnProperty.call(inf,"error")) {
								this.run(Reflect.field(inf,"error"),true);
							}
						} else {
							if(Object.prototype.hasOwnProperty.call(inf,"success")) {
								this._acOk = Reflect.field(inf,"success");
							}
							if(Object.prototype.hasOwnProperty.call(inf,"error")) {
								this._acError = Reflect.field(inf,"error");
							}
							com_tilbuci_data_GlobalPlayer.ws.dataSave(this.parseString(param[0]),values,$bind(this,this.onDataSave));
						}
						return true;
					} else {
						if(Object.prototype.hasOwnProperty.call(inf,"error")) {
							this.run(Reflect.field(inf,"error"),true);
						}
						return false;
					}
					break;
				case "data.savelocal":
					this._acOk = this._acError = null;
					if(param.length > 1) {
						var values = [];
						var _g = 1;
						var _g1 = param.length;
						while(_g < _g1) {
							var i = _g++;
							var obj = this.getValueObj(param[i]);
							if(obj != null) {
								values.push(obj);
							}
						}
						if(values.length == 0) {
							if(Object.prototype.hasOwnProperty.call(inf,"error")) {
								this.run(Reflect.field(inf,"error"),true);
							}
						} else {
							try {
								var shared = openfl_net_SharedObject.getLocal(com_tilbuci_data_GlobalPlayer.movie.get_mvId() + "_" + this.parseString(param[0]));
								shared.data.values = com_tilbuci_statictools_StringStatic.jsonStringify(values);
								shared.flush();
								if(Object.prototype.hasOwnProperty.call(inf,"success")) {
									this.run(Reflect.field(inf,"success"),true);
								}
							} catch( _g ) {
								if(Object.prototype.hasOwnProperty.call(inf,"error")) {
									this.run(Reflect.field(inf,"error"),true);
								}
							}
						}
						return true;
					} else {
						if(Object.prototype.hasOwnProperty.call(inf,"error")) {
							this.run(Reflect.field(inf,"error"),true);
						}
						return false;
					}
					break;
				case "data.savequickstate":
					this._acOk = this._acError = null;
					if(com_tilbuci_data_GlobalPlayer.ws.userLogged()) {
						var values = [];
						var h = this._strings.h;
						var i_h = h;
						var i_keys = Object.keys(h);
						var i_length = i_keys.length;
						var i_current = 0;
						while(i_current < i_length) {
							var i = i_keys[i_current++];
							values.push({ n : i, t : "S", v : this._strings.h[i]});
						}
						var h = this._floats.h;
						var i_h = h;
						var i_keys = Object.keys(h);
						var i_length = i_keys.length;
						var i_current = 0;
						while(i_current < i_length) {
							var i = i_keys[i_current++];
							values.push({ n : i, t : "F", v : this._floats.h[i]});
						}
						var h = this._ints.h;
						var i_h = h;
						var i_keys = Object.keys(h);
						var i_length = i_keys.length;
						var i_current = 0;
						while(i_current < i_length) {
							var i = i_keys[i_current++];
							values.push({ n : i, t : "I", v : this._ints.h[i]});
						}
						var h = this._bools.h;
						var i_h = h;
						var i_keys = Object.keys(h);
						var i_length = i_keys.length;
						var i_current = 0;
						while(i_current < i_length) {
							var i = i_keys[i_current++];
							values.push({ n : i, t : "B", v : this._bools.h[i]});
						}
						if(Object.prototype.hasOwnProperty.call(inf,"success")) {
							this._acOk = Reflect.field(inf,"success");
						}
						if(Object.prototype.hasOwnProperty.call(inf,"error")) {
							this._acError = Reflect.field(inf,"error");
						}
						var about = "";
						if(param.length > 0) {
							about = this.parseString(param[0]);
						}
						com_tilbuci_data_GlobalPlayer.ws.stateSave(values,true,about,$bind(this,this.onDataSave));
						return true;
					} else {
						if(Object.prototype.hasOwnProperty.call(inf,"error")) {
							this.run(Reflect.field(inf,"error"),true);
						}
						return false;
					}
					break;
				case "data.savestate":
					this._acOk = this._acError = null;
					if(com_tilbuci_data_GlobalPlayer.ws.userLogged()) {
						var values = [];
						var h = this._strings.h;
						var i_h = h;
						var i_keys = Object.keys(h);
						var i_length = i_keys.length;
						var i_current = 0;
						while(i_current < i_length) {
							var i = i_keys[i_current++];
							values.push({ n : i, t : "S", v : this._strings.h[i]});
						}
						var h = this._floats.h;
						var i_h = h;
						var i_keys = Object.keys(h);
						var i_length = i_keys.length;
						var i_current = 0;
						while(i_current < i_length) {
							var i = i_keys[i_current++];
							values.push({ n : i, t : "F", v : this._floats.h[i]});
						}
						var h = this._ints.h;
						var i_h = h;
						var i_keys = Object.keys(h);
						var i_length = i_keys.length;
						var i_current = 0;
						while(i_current < i_length) {
							var i = i_keys[i_current++];
							values.push({ n : i, t : "I", v : this._ints.h[i]});
						}
						var h = this._bools.h;
						var i_h = h;
						var i_keys = Object.keys(h);
						var i_length = i_keys.length;
						var i_current = 0;
						while(i_current < i_length) {
							var i = i_keys[i_current++];
							values.push({ n : i, t : "B", v : this._bools.h[i]});
						}
						if(Object.prototype.hasOwnProperty.call(inf,"success")) {
							this._acOk = Reflect.field(inf,"success");
						}
						if(Object.prototype.hasOwnProperty.call(inf,"error")) {
							this._acError = Reflect.field(inf,"error");
						}
						var about = "";
						if(param.length > 0) {
							about = this.parseString(param[0]);
						}
						com_tilbuci_data_GlobalPlayer.ws.stateSave(values,false,about,$bind(this,this.onDataSave));
						return true;
					} else {
						if(Object.prototype.hasOwnProperty.call(inf,"error")) {
							this.run(Reflect.field(inf,"error"),true);
						}
						return false;
					}
					break;
				case "data.savestatelocal":
					this._acOk = this._acError = null;
					var values = [];
					var h = this._strings.h;
					var i_h = h;
					var i_keys = Object.keys(h);
					var i_length = i_keys.length;
					var i_current = 0;
					while(i_current < i_length) {
						var i = i_keys[i_current++];
						values.push({ n : i, t : "S", v : this._strings.h[i]});
					}
					var h = this._floats.h;
					var i_h = h;
					var i_keys = Object.keys(h);
					var i_length = i_keys.length;
					var i_current = 0;
					while(i_current < i_length) {
						var i = i_keys[i_current++];
						values.push({ n : i, t : "F", v : this._floats.h[i]});
					}
					var h = this._ints.h;
					var i_h = h;
					var i_keys = Object.keys(h);
					var i_length = i_keys.length;
					var i_current = 0;
					while(i_current < i_length) {
						var i = i_keys[i_current++];
						values.push({ n : i, t : "I", v : this._ints.h[i]});
					}
					var h = this._bools.h;
					var i_h = h;
					var i_keys = Object.keys(h);
					var i_length = i_keys.length;
					var i_current = 0;
					while(i_current < i_length) {
						var i = i_keys[i_current++];
						values.push({ n : i, t : "B", v : this._bools.h[i]});
					}
					if(Object.prototype.hasOwnProperty.call(inf,"success")) {
						this._acOk = Reflect.field(inf,"success");
					}
					if(Object.prototype.hasOwnProperty.call(inf,"error")) {
						this._acError = Reflect.field(inf,"error");
					}
					try {
						var shared = openfl_net_SharedObject.getLocal(com_tilbuci_data_GlobalPlayer.movie.get_mvId() + "_state");
						shared.data.values = com_tilbuci_statictools_StringStatic.jsonStringify(values);
						shared.data.scene = com_tilbuci_data_GlobalPlayer.movie.get_scId();
						shared.flush();
						if(Object.prototype.hasOwnProperty.call(inf,"success")) {
							this.run(Reflect.field(inf,"success"),true);
						}
					} catch( _g ) {
						if(Object.prototype.hasOwnProperty.call(inf,"error")) {
							this.run(Reflect.field(inf,"error"),true);
						}
					}
					return true;
				case "dialogue.close":
					if(this._diagInfo != null) {
						this._diagInfo.close();
						this._diagInfo = null;
						return true;
					} else {
						return false;
					}
					break;
				case "dialogue.first":
					if(this._diagInfo != null) {
						this._diagInfo.first();
						return true;
					} else {
						return false;
					}
					break;
				case "dialogue.last":
					if(this._diagInfo != null) {
						this._diagInfo.last();
						return true;
					} else {
						return false;
					}
					break;
				case "dialogue.loadgroup":
					this._currDiag = "";
					this._diagInfo = null;
					if(param.length > 0) {
						this._acOk = this._acError = null;
						var this1 = com_tilbuci_data_GlobalPlayer.narrative.dialogues;
						var key = this.parseString(param[0]);
						if(Object.prototype.hasOwnProperty.call(this1.h,key)) {
							this._currDiag = this.parseString(param[0]);
							if(Object.prototype.hasOwnProperty.call(inf,"success")) {
								this._acOk = Reflect.field(inf,"success");
							}
							if(Object.prototype.hasOwnProperty.call(inf,"error")) {
								this._acError = Reflect.field(inf,"error");
							}
							var this1 = com_tilbuci_data_GlobalPlayer.narrative.dialogues;
							var key = this.parseString(param[0]);
							this1.h[key].loadContents($bind(this,this.onDiagGroup));
							return true;
						} else {
							if(Object.prototype.hasOwnProperty.call(inf,"error")) {
								this.run(Reflect.field(inf,"error"),true);
							}
							return false;
						}
					} else {
						if(Object.prototype.hasOwnProperty.call(inf,"error")) {
							this.run(Reflect.field(inf,"error"),true);
						}
						return false;
					}
					break;
				case "dialogue.next":
					if(this._diagInfo != null) {
						this._diagInfo.next();
						return true;
					} else {
						return false;
					}
					break;
				case "dialogue.previous":
					if(this._diagInfo != null) {
						this._diagInfo.previous();
						return true;
					} else {
						return false;
					}
					break;
				case "dialogue.start":
					this._diagInfo = null;
					if(param.length == 0 || this._currDiag == "" || !Object.prototype.hasOwnProperty.call(com_tilbuci_data_GlobalPlayer.narrative.dialogues.h,this._currDiag)) {
						return false;
					} else {
						var this1 = com_tilbuci_data_GlobalPlayer.narrative.dialogues.h[this._currDiag].diags;
						var key = this.parseString(param[0]);
						if(!Object.prototype.hasOwnProperty.call(this1.h,key)) {
							return false;
						} else {
							var this1 = com_tilbuci_data_GlobalPlayer.narrative.dialogues.h[this._currDiag].diags;
							var key = this.parseString(param[0]);
							this._diagInfo = this1.h[key];
							this._diagInfo.show(0);
							return true;
						}
					}
					break;
				case "float.abs":
					if(param.length > 1) {
						var this1 = this._floats;
						var k = this.parseString(param[0]);
						var v = Math.abs(this.parseFloat(param[1]));
						this1.h[k] = v;
						return true;
					} else {
						return false;
					}
					break;
				case "float.clear":
					return this.clearFloat(param[0]);
				case "float.clearall":
					return this.clearVars("floats");
				case "float.divide":
					if(param.length > 2) {
						var varname = this.parseString(param[0]);
						var this1 = this._floats;
						var v = this.parseFloat(param[1]) / this.parseFloat(param[2]);
						this1.h[varname] = v;
						if(param.length > 3) {
							var _g = 3;
							var _g1 = param.length;
							while(_g < _g1) {
								var i = _g++;
								var this1 = this._floats;
								var v = this._floats.h[varname] / this.parseFloat(param[i]);
								this1.h[varname] = v;
							}
						}
						return true;
					} else {
						return false;
					}
					break;
				case "float.max":
					if(param.length > 2) {
						var this1 = this._floats;
						var k = this.parseString(param[0]);
						var v = Math.max(this.parseFloat(param[1]),this.parseFloat(param[2]));
						this1.h[k] = v;
						return true;
					} else {
						return false;
					}
					break;
				case "float.min":
					if(param.length > 2) {
						var this1 = this._floats;
						var k = this.parseString(param[0]);
						var v = Math.min(this.parseFloat(param[1]),this.parseFloat(param[2]));
						this1.h[k] = v;
						return true;
					} else {
						return false;
					}
					break;
				case "float.multiply":
					if(param.length > 2) {
						var varname = this.parseString(param[0]);
						var this1 = this._floats;
						var v = this.parseFloat(param[1]) * this.parseFloat(param[2]);
						this1.h[varname] = v;
						if(param.length > 3) {
							var _g = 3;
							var _g1 = param.length;
							while(_g < _g1) {
								var i = _g++;
								var _g2 = varname;
								var _g3 = this._floats;
								var v = _g3.h[_g2] * this.parseFloat(param[i]);
								_g3.h[_g2] = v;
							}
						}
						return true;
					} else {
						return false;
					}
					break;
				case "float.random":
					if(param.length > 2) {
						var start = this.parseFloat(param[1]);
						var dif = Math.abs(this.parseFloat(param[2]) - start);
						var this1 = this._floats;
						var k = this.parseString(param[0]);
						var v = start + Math.random() * dif;
						this1.h[k] = v;
						return true;
					} else {
						return false;
					}
					break;
				case "float.set":
					return this.setFloat(param[0],param[1]);
				case "float.subtract":
					if(param.length > 2) {
						var varname = this.parseString(param[0]);
						var this1 = this._floats;
						var v = this.parseFloat(param[1]) - this.parseFloat(param[2]);
						this1.h[varname] = v;
						if(param.length > 3) {
							var _g = 3;
							var _g1 = param.length;
							while(_g < _g1) {
								var i = _g++;
								var _g2 = varname;
								var _g3 = this._floats;
								var v = _g3.h[_g2] - this.parseFloat(param[i]);
								_g3.h[_g2] = v;
							}
						}
						return true;
					} else {
						return false;
					}
					break;
				case "float.sum":
					if(param.length > 2) {
						var varname = this.parseString(param[0]);
						var this1 = this._floats;
						var v = this.parseFloat(param[1]) + this.parseFloat(param[2]);
						this1.h[varname] = v;
						if(param.length > 3) {
							var _g = 3;
							var _g1 = param.length;
							while(_g < _g1) {
								var i = _g++;
								var _g2 = varname;
								var _g3 = this._floats;
								var v = _g3.h[_g2] + this.parseFloat(param[i]);
								_g3.h[_g2] = v;
							}
						}
						return true;
					} else {
						return false;
					}
					break;
				case "float.toint":
					if(param.length > 1) {
						var this1 = this._ints;
						var k = this.parseString(param[0]);
						var v = Math.round(this.parseFloat(param[1]));
						this1.h[k] = v;
						return true;
					} else {
						return false;
					}
					break;
				case "float.tostring":
					if(param.length > 1) {
						var this1 = this._strings;
						var k = this.parseString(param[0]);
						var v = Std.string(this.parseFloat(param[1]));
						this1.h[k] = v;
						return true;
					} else {
						return false;
					}
					break;
				case "if.bool":
					if(param.length > 0 && Object.prototype.hasOwnProperty.call(inf,"then")) {
						if(this.parseBool(param[0])) {
							return this.run(Reflect.field(inf,"then"),true);
						} else if(Object.prototype.hasOwnProperty.call(inf,"else")) {
							return this.run(Reflect.field(inf,"else"),true);
						} else {
							return true;
						}
					} else {
						return false;
					}
					break;
				case "if.boolset":
					if(param.length > 0) {
						var this1 = this._bools;
						var key = this.parseString(param[0]);
						if(Object.prototype.hasOwnProperty.call(this1.h,key)) {
							return this.run(Reflect.field(inf,"then"),true);
						} else if(Object.prototype.hasOwnProperty.call(inf,"else")) {
							return this.run(Reflect.field(inf,"else"),true);
						} else {
							return true;
						}
					} else {
						return false;
					}
					break;
				case "if.floatgreater":
					if(param.length > 1 && Object.prototype.hasOwnProperty.call(inf,"then")) {
						if(this.parseFloat(param[0]) > this.parseFloat(param[1])) {
							return this.run(Reflect.field(inf,"then"),true);
						} else if(Object.prototype.hasOwnProperty.call(inf,"else")) {
							return this.run(Reflect.field(inf,"else"),true);
						} else {
							return true;
						}
					} else {
						return false;
					}
					break;
				case "if.floatgreaterequal":
					if(param.length > 1 && Object.prototype.hasOwnProperty.call(inf,"then")) {
						if(this.parseFloat(param[0]) >= this.parseFloat(param[1])) {
							return this.run(Reflect.field(inf,"then"),true);
						} else if(Object.prototype.hasOwnProperty.call(inf,"else")) {
							return this.run(Reflect.field(inf,"else"),true);
						} else {
							return true;
						}
					} else {
						return false;
					}
					break;
				case "if.floatlower":
					if(param.length > 1 && Object.prototype.hasOwnProperty.call(inf,"then")) {
						if(this.parseFloat(param[0]) < this.parseFloat(param[1])) {
							return this.run(Reflect.field(inf,"then"),true);
						} else if(Object.prototype.hasOwnProperty.call(inf,"else")) {
							return this.run(Reflect.field(inf,"else"),true);
						} else {
							return true;
						}
					} else {
						return false;
					}
					break;
				case "if.floatlowerequal":
					if(param.length > 1 && Object.prototype.hasOwnProperty.call(inf,"then")) {
						if(this.parseFloat(param[0]) <= this.parseFloat(param[1])) {
							return this.run(Reflect.field(inf,"then"),true);
						} else if(Object.prototype.hasOwnProperty.call(inf,"else")) {
							return this.run(Reflect.field(inf,"else"),true);
						} else {
							return true;
						}
					} else {
						return false;
					}
					break;
				case "if.floatsdifferent":
					if(param.length > 1 && Object.prototype.hasOwnProperty.call(inf,"then")) {
						if(this.parseFloat(param[0]) != this.parseFloat(param[1])) {
							return this.run(Reflect.field(inf,"then"),true);
						} else if(Object.prototype.hasOwnProperty.call(inf,"else")) {
							return this.run(Reflect.field(inf,"else"),true);
						} else {
							return true;
						}
					} else {
						return false;
					}
					break;
				case "if.floatsequal":
					if(param.length > 1 && Object.prototype.hasOwnProperty.call(inf,"then")) {
						if(this.parseFloat(param[0]) == this.parseFloat(param[1])) {
							return this.run(Reflect.field(inf,"then"),true);
						} else if(Object.prototype.hasOwnProperty.call(inf,"else")) {
							return this.run(Reflect.field(inf,"else"),true);
						} else {
							return true;
						}
					} else {
						return false;
					}
					break;
				case "if.floatset":
					if(param.length > 0) {
						var this1 = this._floats;
						var key = this.parseString(param[0]);
						if(Object.prototype.hasOwnProperty.call(this1.h,key)) {
							return this.run(Reflect.field(inf,"then"),true);
						} else if(Object.prototype.hasOwnProperty.call(inf,"else")) {
							return this.run(Reflect.field(inf,"else"),true);
						} else {
							return true;
						}
					} else {
						return false;
					}
					break;
				case "if.intgreater":
					if(param.length > 1 && Object.prototype.hasOwnProperty.call(inf,"then")) {
						if(this.parseInt(param[0]) > this.parseInt(param[1])) {
							return this.run(Reflect.field(inf,"then"),true);
						} else if(Object.prototype.hasOwnProperty.call(inf,"else")) {
							return this.run(Reflect.field(inf,"else"),true);
						} else {
							return true;
						}
					} else {
						return false;
					}
					break;
				case "if.intgreaterequal":
					if(param.length > 1 && Object.prototype.hasOwnProperty.call(inf,"then")) {
						if(this.parseInt(param[0]) >= this.parseInt(param[1])) {
							return this.run(Reflect.field(inf,"then"),true);
						} else if(Object.prototype.hasOwnProperty.call(inf,"else")) {
							return this.run(Reflect.field(inf,"else"),true);
						} else {
							return true;
						}
					} else {
						return false;
					}
					break;
				case "if.intlower":
					if(param.length > 1 && Object.prototype.hasOwnProperty.call(inf,"then")) {
						if(this.parseInt(param[0]) < this.parseInt(param[1])) {
							return this.run(Reflect.field(inf,"then"),true);
						} else if(Object.prototype.hasOwnProperty.call(inf,"else")) {
							return this.run(Reflect.field(inf,"else"),true);
						} else {
							return true;
						}
					} else {
						return false;
					}
					break;
				case "if.intlowerequal":
					if(param.length > 1 && Object.prototype.hasOwnProperty.call(inf,"then")) {
						if(this.parseInt(param[0]) <= this.parseInt(param[1])) {
							return this.run(Reflect.field(inf,"then"),true);
						} else if(Object.prototype.hasOwnProperty.call(inf,"else")) {
							return this.run(Reflect.field(inf,"else"),true);
						} else {
							return true;
						}
					} else {
						return false;
					}
					break;
				case "if.intsdifferent":
					if(param.length > 1 && Object.prototype.hasOwnProperty.call(inf,"then")) {
						if(this.parseInt(param[0]) != this.parseInt(param[1])) {
							return this.run(Reflect.field(inf,"then"),true);
						} else if(Object.prototype.hasOwnProperty.call(inf,"else")) {
							return this.run(Reflect.field(inf,"else"),true);
						} else {
							return true;
						}
					} else {
						return false;
					}
					break;
				case "if.intsequal":
					if(param.length > 1 && Object.prototype.hasOwnProperty.call(inf,"then")) {
						if(this.parseInt(param[0]) == this.parseInt(param[1])) {
							return this.run(Reflect.field(inf,"then"),true);
						} else if(Object.prototype.hasOwnProperty.call(inf,"else")) {
							return this.run(Reflect.field(inf,"else"),true);
						} else {
							return true;
						}
					} else {
						return false;
					}
					break;
				case "if.intset":
					if(param.length > 0) {
						var this1 = this._ints;
						var key = this.parseString(param[0]);
						if(Object.prototype.hasOwnProperty.call(this1.h,key)) {
							return this.run(Reflect.field(inf,"then"),true);
						} else if(Object.prototype.hasOwnProperty.call(inf,"else")) {
							return this.run(Reflect.field(inf,"else"),true);
						} else {
							return true;
						}
					} else {
						return false;
					}
					break;
				case "if.replacefileset":
					if(param.length > 0) {
						var this1 = this._replacefile;
						var key = this.parseString(param[0]);
						if(Object.prototype.hasOwnProperty.call(this1.h,key)) {
							return this.run(Reflect.field(inf,"then"),true);
						} else if(Object.prototype.hasOwnProperty.call(inf,"else")) {
							return this.run(Reflect.field(inf,"else"),true);
						} else {
							return true;
						}
					} else {
						return false;
					}
					break;
				case "if.replacestringset":
					if(param.length > 0) {
						var this1 = this._replacestr;
						var key = this.parseString(param[0]);
						if(Object.prototype.hasOwnProperty.call(this1.h,key)) {
							return this.run(Reflect.field(inf,"then"),true);
						} else if(Object.prototype.hasOwnProperty.call(inf,"else")) {
							return this.run(Reflect.field(inf,"else"),true);
						} else {
							return true;
						}
					} else {
						return false;
					}
					break;
				case "if.stringcontains":
					if(param.length > 1 && Object.prototype.hasOwnProperty.call(inf,"then")) {
						if(this.parseString(param[0]).indexOf(this.parseString(param[1])) != -1) {
							return this.run(Reflect.field(inf,"then"),true);
						} else if(Object.prototype.hasOwnProperty.call(inf,"else")) {
							return this.run(Reflect.field(inf,"else"),true);
						} else {
							return true;
						}
					} else {
						return false;
					}
					break;
				case "if.stringemail":
					if(param.length > 0 && Object.prototype.hasOwnProperty.call(inf,"then")) {
						if(com_tilbuci_statictools_StringStatic.validateEmail(this.parseString(param[0]))) {
							return this.run(Reflect.field(inf,"then"),true);
						} else if(Object.prototype.hasOwnProperty.call(inf,"else")) {
							return this.run(Reflect.field(inf,"else"),true);
						} else {
							return true;
						}
					} else {
						return false;
					}
					break;
				case "if.stringendswith":
					if(param.length > 1 && Object.prototype.hasOwnProperty.call(inf,"then")) {
						if(StringTools.endsWith(this.parseString(param[0]),this.parseString(param[1]))) {
							return this.run(Reflect.field(inf,"then"),true);
						} else if(Object.prototype.hasOwnProperty.call(inf,"else")) {
							return this.run(Reflect.field(inf,"else"),true);
						} else {
							return true;
						}
					} else {
						return false;
					}
					break;
				case "if.stringsdifferent":
					if(param.length > 1 && Object.prototype.hasOwnProperty.call(inf,"then")) {
						if(this.parseString(param[0]) != this.parseString(param[1])) {
							return this.run(Reflect.field(inf,"then"),true);
						} else if(Object.prototype.hasOwnProperty.call(inf,"else")) {
							return this.run(Reflect.field(inf,"else"),true);
						} else {
							return true;
						}
					} else {
						return false;
					}
					break;
				case "if.stringsequal":
					if(param.length > 1 && Object.prototype.hasOwnProperty.call(inf,"then")) {
						if(this.parseString(param[0]) == this.parseString(param[1])) {
							return this.run(Reflect.field(inf,"then"),true);
						} else if(Object.prototype.hasOwnProperty.call(inf,"else")) {
							return this.run(Reflect.field(inf,"else"),true);
						} else {
							return true;
						}
					} else {
						return false;
					}
					break;
				case "if.stringset":
					if(param.length > 0) {
						var this1 = this._strings;
						var key = this.parseString(param[0]);
						if(Object.prototype.hasOwnProperty.call(this1.h,key)) {
							return this.run(Reflect.field(inf,"then"),true);
						} else if(Object.prototype.hasOwnProperty.call(inf,"else")) {
							return this.run(Reflect.field(inf,"else"),true);
						} else {
							return true;
						}
					} else {
						return false;
					}
					break;
				case "if.stringstartswith":
					if(param.length > 1 && Object.prototype.hasOwnProperty.call(inf,"then")) {
						if(StringTools.startsWith(this.parseString(param[0]),this.parseString(param[1]))) {
							return this.run(Reflect.field(inf,"then"),true);
						} else if(Object.prototype.hasOwnProperty.call(inf,"else")) {
							return this.run(Reflect.field(inf,"else"),true);
						} else {
							return true;
						}
					} else {
						return false;
					}
					break;
				case "input.add":
					if(com_tilbuci_data_GlobalPlayer.mode == "editor") {
						return true;
					} else if(param.length == 4) {
						com_tilbuci_data_GlobalPlayer.area.addInput(this.parseString(param[0]),this.parseInt(param[1]),this.parseInt(param[2]),this.parseInt(param[3]));
						return true;
					} else if(param.length > 4) {
						com_tilbuci_data_GlobalPlayer.area.addInput(this.parseString(param[0]),this.parseInt(param[1]),this.parseInt(param[2]),this.parseInt(param[3]),this.parseString(param[4]));
						return true;
					} else {
						return false;
					}
					break;
				case "input.addnumeric":
					if(com_tilbuci_data_GlobalPlayer.mode == "editor") {
						return true;
					} else if(param.length > 4) {
						com_tilbuci_data_GlobalPlayer.area.addNumeric(this.parseString(param[0]),this.parseInt(param[1]),this.parseInt(param[2]),this.parseInt(param[3]),this.parseInt(param[4]));
						return true;
					} else {
						return false;
					}
					break;
				case "input.addtarea":
					if(com_tilbuci_data_GlobalPlayer.mode == "editor") {
						return true;
					} else if(param.length == 5) {
						com_tilbuci_data_GlobalPlayer.area.addTarea(this.parseString(param[0]),this.parseInt(param[1]),this.parseInt(param[2]),this.parseInt(param[3]),this.parseInt(param[4]));
						return true;
					} else {
						return false;
					}
					break;
				case "input.addtoggle":
					if(com_tilbuci_data_GlobalPlayer.mode == "editor") {
						return true;
					} else if(param.length > 3) {
						com_tilbuci_data_GlobalPlayer.area.addToggle(this.parseString(param[0]),this.parseBool(param[1]),this.parseInt(param[2]),this.parseInt(param[3]));
						return true;
					} else {
						return false;
					}
					break;
				case "input.email":
					if(param.length > 1) {
						var acOk = null;
						var acCancel = null;
						if(Object.prototype.hasOwnProperty.call(inf,"ok")) {
							acOk = Reflect.field(inf,"ok");
						}
						if(Object.prototype.hasOwnProperty.call(inf,"cancel")) {
							acCancel = Reflect.field(inf,"cancel");
						}
						var domains = [];
						if(param.length > 2) {
							var _g = 2;
							var _g1 = param.length;
							while(_g < _g1) {
								var i = _g++;
								domains.push(this.parseString(param[i]));
							}
						}
						com_tilbuci_data_GlobalPlayer.area.showEmailInput(this.parseString(param[0]),this.parseString(param[1]),domains,acOk,acCancel);
						return true;
					} else {
						return false;
					}
					break;
				case "input.float":
					if(param.length > 1) {
						var acOk = null;
						var acCancel = null;
						if(Object.prototype.hasOwnProperty.call(inf,"ok")) {
							acOk = Reflect.field(inf,"ok");
						}
						if(Object.prototype.hasOwnProperty.call(inf,"cancel")) {
							acCancel = Reflect.field(inf,"cancel");
						}
						var step = 1;
						var min = 0;
						var max = 100;
						if(param.length > 2) {
							step = this.parseInt(param[2]);
						}
						if(param.length > 3) {
							min = this.parseInt(param[3]);
						}
						if(param.length > 4) {
							max = this.parseInt(param[4]);
						}
						com_tilbuci_data_GlobalPlayer.area.showNumericInput("float",this.parseString(param[0]),this.parseString(param[1]),acOk,acCancel,step,min,max);
						return true;
					} else {
						return false;
					}
					break;
				case "input.int":
					if(param.length > 1) {
						var acOk = null;
						var acCancel = null;
						if(Object.prototype.hasOwnProperty.call(inf,"ok")) {
							acOk = Reflect.field(inf,"ok");
						}
						if(Object.prototype.hasOwnProperty.call(inf,"cancel")) {
							acCancel = Reflect.field(inf,"cancel");
						}
						var step = 1;
						var min = 0;
						var max = 100;
						if(param.length > 2) {
							step = this.parseInt(param[2]);
						}
						if(param.length > 3) {
							min = this.parseInt(param[3]);
						}
						if(param.length > 4) {
							max = this.parseInt(param[4]);
						}
						com_tilbuci_data_GlobalPlayer.area.showNumericInput("int",this.parseString(param[0]),this.parseString(param[1]),acOk,acCancel,step,min,max);
						return true;
					} else {
						return false;
					}
					break;
				case "input.inverttoggle":
					if(param.length > 0) {
						com_tilbuci_data_GlobalPlayer.area.invertToggle(this.parseString(param[0]));
						return true;
					} else {
						return false;
					}
					break;
				case "input.list":
					if(param.length > 3) {
						var acOk = null;
						var acCancel = null;
						if(Object.prototype.hasOwnProperty.call(inf,"ok")) {
							acOk = Reflect.field(inf,"ok");
						}
						if(Object.prototype.hasOwnProperty.call(inf,"cancel")) {
							acCancel = Reflect.field(inf,"cancel");
						}
						var op = [];
						var _g = 2;
						var _g1 = param.length;
						while(_g < _g1) {
							var i = _g++;
							op.push(this.parseString(param[i]));
						}
						com_tilbuci_data_GlobalPlayer.area.showListInput(this.parseString(param[0]),this.parseString(param[1]),op,acOk,acCancel);
						return true;
					} else {
						return false;
					}
					break;
				case "input.login":
					var acOk = null;
					var acCancel = null;
					if(Object.prototype.hasOwnProperty.call(inf,"ok")) {
						acOk = Reflect.field(inf,"ok");
					}
					if(Object.prototype.hasOwnProperty.call(inf,"cancel")) {
						acCancel = Reflect.field(inf,"cancel");
					}
					com_tilbuci_data_GlobalPlayer.area.showLoginInput(acOk,acCancel);
					return true;
				case "input.message":
					if(param.length > 1) {
						var acOk = null;
						var acCancel = null;
						if(Object.prototype.hasOwnProperty.call(inf,"ok")) {
							acOk = Reflect.field(inf,"ok");
						}
						if(Object.prototype.hasOwnProperty.call(inf,"cancel")) {
							acCancel = Reflect.field(inf,"cancel");
						}
						var arcmd = [];
						var ok = false;
						try {
							arcmd = js_Boot.__cast(acCancel , Array);
							ok = true;
						} catch( _g ) {
							ok = false;
						}
						if(!ok) {
							acCancel = null;
						}
						com_tilbuci_data_GlobalPlayer.area.showMessageInput(this.parseString(param[0]),this.parseString(param[1]),acOk,acCancel);
						return true;
					} else {
						return false;
					}
					break;
				case "input.place":
					if(param.length > 3) {
						com_tilbuci_data_GlobalPlayer.area.placeInput(this.parseString(param[0]),this.parseInt(param[1]),this.parseInt(param[2]),this.parseInt(param[3]));
						return true;
					} else {
						return false;
					}
					break;
				case "input.placenumeric":
					if(param.length > 3) {
						com_tilbuci_data_GlobalPlayer.area.placeNumeric(this.parseString(param[0]),this.parseInt(param[1]),this.parseInt(param[2]),this.parseInt(param[3]));
						return true;
					} else {
						return false;
					}
					break;
				case "input.placetarea":
					if(param.length > 4) {
						com_tilbuci_data_GlobalPlayer.area.placeTarea(this.parseString(param[0]),this.parseInt(param[1]),this.parseInt(param[2]),this.parseInt(param[3]),this.parseInt(param[4]));
						return true;
					} else {
						return false;
					}
					break;
				case "input.placetoggle":
					if(param.length > 2) {
						com_tilbuci_data_GlobalPlayer.area.placeToggle(this.parseString(param[0]),this.parseInt(param[1]),this.parseInt(param[2]));
						return true;
					} else {
						return false;
					}
					break;
				case "input.remove":
					if(param.length > 0) {
						com_tilbuci_data_GlobalPlayer.area.removeInput(this.parseString(param[0]));
						return true;
					} else {
						return false;
					}
					break;
				case "input.removeall":
					com_tilbuci_data_GlobalPlayer.area.removeAllInputs();
					return true;
				case "input.removeallnumerics":
					com_tilbuci_data_GlobalPlayer.area.removeAllNumerics();
					return true;
				case "input.removealltareas":
					com_tilbuci_data_GlobalPlayer.area.removeAllTareas();
					return true;
				case "input.removealltoggles":
					com_tilbuci_data_GlobalPlayer.area.removeAllToggles();
					return true;
				case "input.removenumeric":
					if(param.length > 0) {
						com_tilbuci_data_GlobalPlayer.area.removeNumeric(this.parseString(param[0]));
						return true;
					} else {
						return false;
					}
					break;
				case "input.removetarea":
					if(param.length > 0) {
						com_tilbuci_data_GlobalPlayer.area.removeTarea(this.parseString(param[0]));
						return true;
					} else {
						return false;
					}
					break;
				case "input.removetoggle":
					if(param.length > 0) {
						com_tilbuci_data_GlobalPlayer.area.removeToggle(this.parseString(param[0]));
						return true;
					} else {
						return false;
					}
					break;
				case "input.setnumeric":
					if(param.length > 1) {
						com_tilbuci_data_GlobalPlayer.area.setNumericValue(this.parseString(param[0]),this.parseInt(param[1]));
						return true;
					} else {
						return false;
					}
					break;
				case "input.setnumericbounds":
					if(param.length > 1) {
						com_tilbuci_data_GlobalPlayer.area.setNumericBounds(this.parseString(param[0]),this.parseInt(param[1]),this.parseInt(param[2]),this.parseInt(param[3]));
						return true;
					} else {
						return false;
					}
					break;
				case "input.setpassword":
					if(param.length > 1) {
						com_tilbuci_data_GlobalPlayer.area.setInputPassword(this.parseString(param[0]),this.parseBool(param[1]));
						return true;
					} else {
						return false;
					}
					break;
				case "input.settext":
					if(param.length > 1) {
						com_tilbuci_data_GlobalPlayer.area.setInputText(this.parseString(param[0]),this.parseString(param[1]));
						return true;
					} else {
						return false;
					}
					break;
				case "input.settextarea":
					if(param.length > 1) {
						com_tilbuci_data_GlobalPlayer.area.setTareaText(this.parseString(param[0]),this.parseString(param[1]));
						return true;
					} else {
						return false;
					}
					break;
				case "input.settoggle":
					if(param.length > 1) {
						com_tilbuci_data_GlobalPlayer.area.setToggleValue(this.parseString(param[0]),this.parseBool(param[1]));
						return true;
					} else {
						return false;
					}
					break;
				case "input.string":
					if(param.length > 1) {
						var acOk = null;
						var acCancel = null;
						if(Object.prototype.hasOwnProperty.call(inf,"ok")) {
							acOk = Reflect.field(inf,"ok");
						}
						if(Object.prototype.hasOwnProperty.call(inf,"cancel")) {
							acCancel = Reflect.field(inf,"cancel");
						}
						com_tilbuci_data_GlobalPlayer.area.showTextInput(this.parseString(param[0]),this.parseString(param[1]),acOk,acCancel);
						return true;
					} else {
						return false;
					}
					break;
				case "instance.clearall":
					return com_tilbuci_data_GlobalPlayer.area.releaseAllProperties(this.parseString(param[0]));
				case "instance.clearalpha":
					return com_tilbuci_data_GlobalPlayer.area.releaseProperty(this.parseString(param[0]),"alpha");
				case "instance.clearcolor":
					return com_tilbuci_data_GlobalPlayer.area.releaseProperty(this.parseString(param[0]),"color");
				case "instance.clearcoloralpha":
					return com_tilbuci_data_GlobalPlayer.area.releaseProperty(this.parseString(param[0]),"colorAlpha");
				case "instance.clearfont":
					return com_tilbuci_data_GlobalPlayer.area.releaseProperty(this.parseString(param[0]),"textFont");
				case "instance.clearfontalign":
					return com_tilbuci_data_GlobalPlayer.area.releaseProperty(this.parseString(param[0]),"textAlign");
				case "instance.clearfontbackground":
					return com_tilbuci_data_GlobalPlayer.area.releaseProperty(this.parseString(param[0]),"textBackground");
				case "instance.clearfontbold":
					return com_tilbuci_data_GlobalPlayer.area.releaseProperty(this.parseString(param[0]),"textBold");
				case "instance.clearfontcolor":
					return com_tilbuci_data_GlobalPlayer.area.releaseProperty(this.parseString(param[0]),"textColor");
				case "instance.clearfontitalic":
					return com_tilbuci_data_GlobalPlayer.area.releaseProperty(this.parseString(param[0]),"textItalic");
				case "instance.clearfontleading":
					return com_tilbuci_data_GlobalPlayer.area.releaseProperty(this.parseString(param[0]),"textLeading");
				case "instance.clearfontsize":
					return com_tilbuci_data_GlobalPlayer.area.releaseProperty(this.parseString(param[0]),"textSize");
				case "instance.clearfontspacing":
					return com_tilbuci_data_GlobalPlayer.area.releaseProperty(this.parseString(param[0]),"textSpacing");
				case "instance.clearheight":
					return com_tilbuci_data_GlobalPlayer.area.releaseProperty(this.parseString(param[0]),"height");
				case "instance.clearmove":
					if(param.length > 0) {
						var inst = com_tilbuci_data_GlobalPlayer.area.pickInstance(this.parseString(param[0]));
						if(inst == null) {
							return false;
						} else {
							com_tilbuci_data_GlobalPlayer.area.releaseProperty(inst.getInstName(),"x");
							com_tilbuci_data_GlobalPlayer.area.releaseProperty(inst.getInstName(),"y");
							return true;
						}
					} else {
						return false;
					}
					break;
				case "instance.clearorder":
					return com_tilbuci_data_GlobalPlayer.area.releaseProperty(this.parseString(param[0]),"order");
				case "instance.clearpan":
					return com_tilbuci_data_GlobalPlayer.area.releaseProperty(this.parseString(param[0]),"pan");
				case "instance.clearrotation":
					return com_tilbuci_data_GlobalPlayer.area.releaseProperty(this.parseString(param[0]),"rotation");
				case "instance.clearvisible":
					return com_tilbuci_data_GlobalPlayer.area.releaseProperty(this.parseString(param[0]),"visible");
				case "instance.clearvolume":
					return com_tilbuci_data_GlobalPlayer.area.releaseProperty(this.parseString(param[0]),"volume");
				case "instance.clearwidth":
					return com_tilbuci_data_GlobalPlayer.area.releaseProperty(this.parseString(param[0]),"width");
				case "instance.clearx":
					return com_tilbuci_data_GlobalPlayer.area.releaseProperty(this.parseString(param[0]),"x");
				case "instance.cleary":
					return com_tilbuci_data_GlobalPlayer.area.releaseProperty(this.parseString(param[0]),"y");
				case "instance.clearzoom":
					if(param.length > 0) {
						var inst = com_tilbuci_data_GlobalPlayer.area.pickInstance(this.parseString(param[0]));
						if(inst == null) {
							return false;
						} else {
							com_tilbuci_data_GlobalPlayer.area.releaseProperty(inst.getInstName(),"width");
							com_tilbuci_data_GlobalPlayer.area.releaseProperty(inst.getInstName(),"height");
							com_tilbuci_data_GlobalPlayer.area.releaseProperty(inst.getInstName(),"x");
							com_tilbuci_data_GlobalPlayer.area.releaseProperty(inst.getInstName(),"y");
							return true;
						}
					} else {
						return false;
					}
					break;
				case "instance.isoverlapping":
					if(param.length > 1) {
						var inst1 = com_tilbuci_data_GlobalPlayer.area.pickInstance(this.parseString(param[0]));
						var inst2 = com_tilbuci_data_GlobalPlayer.area.pickInstance(this.parseString(param[1]));
						if(inst1 == null || inst2 == null) {
							if(Object.prototype.hasOwnProperty.call(inf,"else")) {
								return this.run(Reflect.field(inf,"else"),true);
							} else {
								return true;
							}
						} else if(inst1.hitTestObject(inst2)) {
							if(Object.prototype.hasOwnProperty.call(inf,"then")) {
								return this.run(Reflect.field(inf,"then"),true);
							} else {
								return true;
							}
						} else if(Object.prototype.hasOwnProperty.call(inf,"else")) {
							return this.run(Reflect.field(inf,"else"),true);
						} else {
							return true;
						}
					} else {
						return false;
					}
					break;
				case "instance.lesszoom":
					if(param.length > 1) {
						var inst = com_tilbuci_data_GlobalPlayer.area.pickInstance(this.parseString(param[0]));
						if(inst == null) {
							return false;
						} else {
							var factor = this.parseFloat(param[1]);
							var wd = inst.get_width() * (1 - factor / 100);
							var ht = inst.get_height() * (1 - factor / 100);
							var px = inst.get_x() - (wd - inst.get_width()) / 2;
							var py = inst.get_y() - (ht - inst.get_height()) / 2;
							com_tilbuci_data_GlobalPlayer.area.setProperty(inst.getInstName(),"width",wd,wd);
							com_tilbuci_data_GlobalPlayer.area.setProperty(inst.getInstName(),"height",ht,ht);
							com_tilbuci_data_GlobalPlayer.area.setProperty(inst.getInstName(),"x",px,px);
							com_tilbuci_data_GlobalPlayer.area.setProperty(inst.getInstName(),"y",py,py);
							return true;
						}
					} else {
						return false;
					}
					break;
				case "instance.loadasset":
					return com_tilbuci_data_GlobalPlayer.area.loadAsset(this.parseString(param[0]),this.parseString(param[1]));
				case "instance.morezoom":
					if(param.length > 1) {
						var inst = com_tilbuci_data_GlobalPlayer.area.pickInstance(this.parseString(param[0]));
						if(inst == null) {
							return false;
						} else {
							var factor = this.parseFloat(param[1]);
							var wd = inst.get_width() * (1 + factor / 100);
							var ht = inst.get_height() * (1 + factor / 100);
							var px = inst.get_x() - (wd - inst.get_width()) / 2;
							var py = inst.get_y() - (ht - inst.get_height()) / 2;
							com_tilbuci_data_GlobalPlayer.area.setProperty(inst.getInstName(),"width",wd,wd);
							com_tilbuci_data_GlobalPlayer.area.setProperty(inst.getInstName(),"height",ht,ht);
							com_tilbuci_data_GlobalPlayer.area.setProperty(inst.getInstName(),"x",px,px);
							com_tilbuci_data_GlobalPlayer.area.setProperty(inst.getInstName(),"y",py,py);
							return true;
						}
					} else {
						return false;
					}
					break;
				case "instance.movedown":
					if(param.length > 1) {
						var inst = com_tilbuci_data_GlobalPlayer.area.pickInstance(this.parseString(param[0]));
						if(inst == null) {
							return false;
						} else {
							com_tilbuci_data_GlobalPlayer.area.setProperty(inst.getInstName(),"y",inst.get_y() + this.parseFloat(param[1]),inst.get_y() - this.parseFloat(param[1]));
							return true;
						}
					} else {
						return false;
					}
					break;
				case "instance.moveleft":
					if(param.length > 1) {
						var inst = com_tilbuci_data_GlobalPlayer.area.pickInstance(this.parseString(param[0]));
						if(inst == null) {
							return false;
						} else {
							com_tilbuci_data_GlobalPlayer.area.setProperty(inst.getInstName(),"x",inst.get_x() - this.parseFloat(param[1]),inst.get_x() - this.parseFloat(param[1]));
							return true;
						}
					} else {
						return false;
					}
					break;
				case "instance.moveright":
					if(param.length > 1) {
						var inst = com_tilbuci_data_GlobalPlayer.area.pickInstance(this.parseString(param[0]));
						if(inst == null) {
							return false;
						} else {
							com_tilbuci_data_GlobalPlayer.area.setProperty(inst.getInstName(),"x",inst.get_x() + this.parseFloat(param[1]),inst.get_x() - this.parseFloat(param[1]));
							return true;
						}
					} else {
						return false;
					}
					break;
				case "instance.moveup":
					if(param.length > 1) {
						var inst = com_tilbuci_data_GlobalPlayer.area.pickInstance(this.parseString(param[0]));
						if(inst == null) {
							return false;
						} else {
							com_tilbuci_data_GlobalPlayer.area.setProperty(inst.getInstName(),"y",inst.get_y() - this.parseFloat(param[1]),inst.get_y() - this.parseFloat(param[1]));
							return true;
						}
					} else {
						return false;
					}
					break;
				case "instance.next":
					return com_tilbuci_data_GlobalPlayer.area.next(this.parseString(param[0]));
				case "instance.pause":
					return com_tilbuci_data_GlobalPlayer.area.pauseInstance(this.parseString(param[0]));
				case "instance.play":
					return com_tilbuci_data_GlobalPlayer.area.playInstance(this.parseString(param[0]));
				case "instance.playpause":
					return com_tilbuci_data_GlobalPlayer.area.playPauseInstance(this.parseString(param[0]));
				case "instance.previous":
					return com_tilbuci_data_GlobalPlayer.area.previous(this.parseString(param[0]));
				case "instance.scrollbottom":
					return com_tilbuci_data_GlobalPlayer.area.textScroll(this.parseString(param[0]),2);
				case "instance.scrolldown":
					return com_tilbuci_data_GlobalPlayer.area.textScroll(this.parseString(param[0]),1);
				case "instance.scrolltop":
					return com_tilbuci_data_GlobalPlayer.area.textScroll(this.parseString(param[0]),0);
				case "instance.scrollup":
					return com_tilbuci_data_GlobalPlayer.area.textScroll(this.parseString(param[0]),-1);
				case "instance.seek":
					return com_tilbuci_data_GlobalPlayer.area.instanceSeek(this.parseString(param[0]),this.parseInt(param[1]));
				case "instance.setalpha":
					if(param.length == 2) {
						return com_tilbuci_data_GlobalPlayer.area.setProperty(this.parseString(param[0]),"alpha",this.parseFloat(param[1]),this.parseFloat(param[1]));
					} else if(param.length >= 3) {
						return com_tilbuci_data_GlobalPlayer.area.setProperty(this.parseString(param[0]),"alpha",this.parseFloat(param[1]),this.parseFloat(param[2]));
					} else {
						return false;
					}
					break;
				case "instance.setcolor":
					if(param.length == 2) {
						return com_tilbuci_data_GlobalPlayer.area.setProperty(this.parseString(param[0]),"color",this.parseString(param[1]),this.parseString(param[1]));
					} else if(param.length >= 3) {
						return com_tilbuci_data_GlobalPlayer.area.setProperty(this.parseString(param[0]),"color",this.parseString(param[1]),this.parseString(param[2]));
					} else {
						return false;
					}
					break;
				case "instance.setcoloralpha":
					if(param.length == 2) {
						return com_tilbuci_data_GlobalPlayer.area.setProperty(this.parseString(param[0]),"colorAlpha",this.parseFloat(param[1]),this.parseFloat(param[1]));
					} else if(param.length >= 3) {
						return com_tilbuci_data_GlobalPlayer.area.setProperty(this.parseString(param[0]),"colorAlpha",this.parseFloat(param[1]),this.parseFloat(param[2]));
					} else {
						return false;
					}
					break;
				case "instance.setfont":
					if(param.length == 2) {
						return com_tilbuci_data_GlobalPlayer.area.setProperty(this.parseString(param[0]),"textFont",this.parseString(param[1]),this.parseString(param[1]));
					} else if(param.length >= 3) {
						return com_tilbuci_data_GlobalPlayer.area.setProperty(this.parseString(param[0]),"textFont",this.parseString(param[1]),this.parseString(param[2]));
					} else {
						return false;
					}
					break;
				case "instance.setfontalign":
					if(param.length == 2) {
						return com_tilbuci_data_GlobalPlayer.area.setProperty(this.parseString(param[0]),"textAlign",this.parseString(param[1]),this.parseString(param[1]));
					} else if(param.length >= 3) {
						return com_tilbuci_data_GlobalPlayer.area.setProperty(this.parseString(param[0]),"textAlign",this.parseString(param[1]),this.parseString(param[2]));
					} else {
						return false;
					}
					break;
				case "instance.setfontbackground":
					if(param.length == 2) {
						return com_tilbuci_data_GlobalPlayer.area.setProperty(this.parseString(param[0]),"textBackground",this.parseString(param[1]),this.parseString(param[1]));
					} else if(param.length >= 3) {
						return com_tilbuci_data_GlobalPlayer.area.setProperty(this.parseString(param[0]),"textBackground",this.parseString(param[1]),this.parseString(param[2]));
					} else {
						return false;
					}
					break;
				case "instance.setfontbold":
					if(param.length == 2) {
						return com_tilbuci_data_GlobalPlayer.area.setProperty(this.parseString(param[0]),"textBold",this.parseBool(param[1]),this.parseBool(param[1]));
					} else if(param.length >= 3) {
						return com_tilbuci_data_GlobalPlayer.area.setProperty(this.parseString(param[0]),"textBold",this.parseBool(param[1]),this.parseBool(param[2]));
					} else {
						return false;
					}
					break;
				case "instance.setfontcolor":
					if(param.length == 2) {
						return com_tilbuci_data_GlobalPlayer.area.setProperty(this.parseString(param[0]),"textColor",this.parseString(param[1]),this.parseString(param[1]));
					} else if(param.length >= 3) {
						return com_tilbuci_data_GlobalPlayer.area.setProperty(this.parseString(param[0]),"textColor",this.parseString(param[1]),this.parseString(param[2]));
					} else {
						return false;
					}
					break;
				case "instance.setfontitalic":
					if(param.length == 2) {
						return com_tilbuci_data_GlobalPlayer.area.setProperty(this.parseString(param[0]),"textItalic",this.parseBool(param[1]),this.parseBool(param[1]));
					} else if(param.length >= 3) {
						return com_tilbuci_data_GlobalPlayer.area.setProperty(this.parseString(param[0]),"textItalic",this.parseBool(param[1]),this.parseBool(param[2]));
					} else {
						return false;
					}
					break;
				case "instance.setfontleading":
					if(param.length == 2) {
						return com_tilbuci_data_GlobalPlayer.area.setProperty(this.parseString(param[0]),"textLeading",this.parseInt(param[1]),this.parseInt(param[1]));
					} else if(param.length >= 3) {
						return com_tilbuci_data_GlobalPlayer.area.setProperty(this.parseString(param[0]),"textLeading",this.parseInt(param[1]),this.parseInt(param[2]));
					} else {
						return false;
					}
					break;
				case "instance.setfontsize":
					if(param.length == 2) {
						return com_tilbuci_data_GlobalPlayer.area.setProperty(this.parseString(param[0]),"textSize",this.parseInt(param[1]),this.parseInt(param[1]));
					} else if(param.length >= 3) {
						return com_tilbuci_data_GlobalPlayer.area.setProperty(this.parseString(param[0]),"textSize",this.parseInt(param[1]),this.parseInt(param[2]));
					} else {
						return false;
					}
					break;
				case "instance.setfontspacing":
					if(param.length == 2) {
						return com_tilbuci_data_GlobalPlayer.area.setProperty(this.parseString(param[0]),"textSpacing",this.parseFloat(param[1]),this.parseFloat(param[1]));
					} else if(param.length >= 3) {
						return com_tilbuci_data_GlobalPlayer.area.setProperty(this.parseString(param[0]),"textSpacing",this.parseFloat(param[1]),this.parseFloat(param[2]));
					} else {
						return false;
					}
					break;
				case "instance.setheight":
					if(param.length == 2) {
						return com_tilbuci_data_GlobalPlayer.area.setProperty(this.parseString(param[0]),"height",this.parseFloat(param[1]),this.parseFloat(param[1]));
					} else if(param.length >= 3) {
						return com_tilbuci_data_GlobalPlayer.area.setProperty(this.parseString(param[0]),"height",this.parseFloat(param[1]),this.parseFloat(param[2]));
					} else {
						return false;
					}
					break;
				case "instance.setorder":
					if(param.length == 2) {
						return com_tilbuci_data_GlobalPlayer.area.setProperty(this.parseString(param[0]),"order",this.parseInt(param[1]),this.parseInt(param[1]));
					} else if(param.length >= 3) {
						return com_tilbuci_data_GlobalPlayer.area.setProperty(this.parseString(param[0]),"order",this.parseInt(param[1]),this.parseInt(param[2]));
					} else {
						return false;
					}
					break;
				case "instance.setpan":
					if(param.length == 2) {
						return com_tilbuci_data_GlobalPlayer.area.setProperty(this.parseString(param[0]),"pan",this.parseFloat(param[1]),this.parseFloat(param[1]));
					} else if(param.length >= 3) {
						return com_tilbuci_data_GlobalPlayer.area.setProperty(this.parseString(param[0]),"pan",this.parseFloat(param[1]),this.parseFloat(param[2]));
					} else {
						return false;
					}
					break;
				case "instance.setparagraph":
					return com_tilbuci_data_GlobalPlayer.area.setText(this.parseString(param[0]),this.parseString(param[1]));
				case "instance.setrotation":
					if(param.length == 2) {
						return com_tilbuci_data_GlobalPlayer.area.setProperty(this.parseString(param[0]),"rotation",this.parseFloat(param[1]),this.parseFloat(param[1]));
					} else if(param.length >= 3) {
						return com_tilbuci_data_GlobalPlayer.area.setProperty(this.parseString(param[0]),"rotation",this.parseFloat(param[1]),this.parseFloat(param[2]));
					} else {
						return false;
					}
					break;
				case "instance.setvisible":
					if(param.length == 2) {
						return com_tilbuci_data_GlobalPlayer.area.setProperty(this.parseString(param[0]),"visible",this.parseBool(param[1]),this.parseBool(param[1]));
					} else if(param.length >= 3) {
						return com_tilbuci_data_GlobalPlayer.area.setProperty(this.parseString(param[0]),"visible",this.parseBool(param[1]),this.parseBool(param[2]));
					} else {
						return false;
					}
					break;
				case "instance.setvolume":
					if(param.length == 2) {
						return com_tilbuci_data_GlobalPlayer.area.setProperty(this.parseString(param[0]),"volume",this.parseFloat(param[1]),this.parseFloat(param[1]));
					} else if(param.length >= 3) {
						return com_tilbuci_data_GlobalPlayer.area.setProperty(this.parseString(param[0]),"volume",this.parseFloat(param[1]),this.parseFloat(param[2]));
					} else {
						return false;
					}
					break;
				case "instance.setwidth":
					if(param.length == 2) {
						return com_tilbuci_data_GlobalPlayer.area.setProperty(this.parseString(param[0]),"width",this.parseFloat(param[1]),this.parseFloat(param[1]));
					} else if(param.length >= 3) {
						return com_tilbuci_data_GlobalPlayer.area.setProperty(this.parseString(param[0]),"width",this.parseFloat(param[1]),this.parseFloat(param[2]));
					} else {
						return false;
					}
					break;
				case "instance.setx":
					if(param.length == 2) {
						return com_tilbuci_data_GlobalPlayer.area.setProperty(this.parseString(param[0]),"x",this.parseFloat(param[1]),this.parseFloat(param[1]));
					} else if(param.length >= 3) {
						return com_tilbuci_data_GlobalPlayer.area.setProperty(this.parseString(param[0]),"x",this.parseFloat(param[1]),this.parseFloat(param[2]));
					} else {
						return false;
					}
					break;
				case "instance.sety":
					if(param.length == 2) {
						return com_tilbuci_data_GlobalPlayer.area.setProperty(this.parseString(param[0]),"y",this.parseFloat(param[1]),this.parseFloat(param[1]));
					} else if(param.length >= 3) {
						return com_tilbuci_data_GlobalPlayer.area.setProperty(this.parseString(param[0]),"y",this.parseFloat(param[1]),this.parseFloat(param[2]));
					} else {
						return false;
					}
					break;
				case "instance.startdrag":
					if(param.length > 0) {
						var inst = com_tilbuci_data_GlobalPlayer.area.pickInstance(this.parseString(param[0]));
						if(inst == null) {
							return false;
						} else {
							this._acOk = null;
							if(Object.prototype.hasOwnProperty.call(inf,"complete")) {
								this._acOk = Reflect.field(inf,"complete");
							}
							this.onDrag = inst;
							if(com_tilbuci_data_GlobalPlayer.usingTarget == 0) {
								if(!com_tilbuci_data_GlobalPlayer.area.hasEventListener("mouseMove")) {
									com_tilbuci_data_GlobalPlayer.area.addEventListener("mouseMove",$bind(this,this.onDragMove));
								}
								if(!com_tilbuci_data_GlobalPlayer.area.stage.hasEventListener("mouseUp")) {
									com_tilbuci_data_GlobalPlayer.area.stage.addEventListener("mouseUp",$bind(this,this.onDragMoveStop));
								}
							}
							return true;
						}
					} else {
						return false;
					}
					break;
				case "instance.stop":
					return com_tilbuci_data_GlobalPlayer.area.stopInstance(this.parseString(param[0]));
				case "instance.stopdrag":
					this.onDragMoveStop(null);
					return true;
				case "instance.zoom":
					if(param.length > 0) {
						return com_tilbuci_data_GlobalPlayer.contraptions.zoomInstance(this.parseString(param[0]));
					} else {
						return false;
					}
					break;
				case "int.abs":
					if(param.length > 1) {
						var this1 = this._ints;
						var k = this.parseString(param[0]);
						var v = Math.round(Math.abs(this.parseInt(param[1])));
						this1.h[k] = v;
						return true;
					} else {
						return false;
					}
					break;
				case "int.clear":
					return this.clearInt(param[0]);
				case "int.clearall":
					return this.clearVars("ints");
				case "int.divide":
					if(param.length > 2) {
						var varname = this.parseString(param[0]);
						var this1 = this._ints;
						var v = Math.round(this.parseInt(param[1]) / this.parseInt(param[2]));
						this1.h[varname] = v;
						if(param.length > 3) {
							var _g = 3;
							var _g1 = param.length;
							while(_g < _g1) {
								var i = _g++;
								var this1 = this._ints;
								var v = Math.round(this._ints.h[varname] / this.parseInt(param[i]));
								this1.h[varname] = v;
							}
						}
						return true;
					} else {
						return false;
					}
					break;
				case "int.max":
					if(param.length > 2) {
						var this1 = this._ints;
						var k = this.parseString(param[0]);
						var v = Math.round(Math.max(this.parseInt(param[1]),this.parseInt(param[2])));
						this1.h[k] = v;
						return true;
					} else {
						return false;
					}
					break;
				case "int.min":
					if(param.length > 2) {
						var this1 = this._ints;
						var k = this.parseString(param[0]);
						var v = Math.round(Math.min(this.parseInt(param[1]),this.parseInt(param[2])));
						this1.h[k] = v;
						return true;
					} else {
						return false;
					}
					break;
				case "int.multiply":
					if(param.length > 2) {
						var varname = this.parseString(param[0]);
						var this1 = this._ints;
						var v = this.parseInt(param[1]) * this.parseInt(param[2]);
						this1.h[varname] = v;
						if(param.length > 3) {
							var _g = 3;
							var _g1 = param.length;
							while(_g < _g1) {
								var i = _g++;
								var _g2 = varname;
								var _g3 = this._ints;
								var v = _g3.h[_g2] * this.parseInt(param[i]);
								_g3.h[_g2] = v;
							}
						}
						return true;
					} else {
						return false;
					}
					break;
				case "int.random":
					if(param.length > 2) {
						var start = this.parseInt(param[1]);
						var dif = Math.round(Math.abs(this.parseInt(param[2]) - start));
						var this1 = this._ints;
						var k = this.parseString(param[0]);
						var v = start + Math.round(Math.random() * dif);
						this1.h[k] = v;
						return true;
					} else {
						return false;
					}
					break;
				case "int.set":
					return this.setInt(param[0],param[1]);
				case "int.subtract":
					if(param.length > 2) {
						var varname = this.parseString(param[0]);
						var this1 = this._ints;
						var v = this.parseInt(param[1]) - this.parseInt(param[2]);
						this1.h[varname] = v;
						if(param.length > 3) {
							var _g = 3;
							var _g1 = param.length;
							while(_g < _g1) {
								var i = _g++;
								var _g2 = varname;
								var _g3 = this._ints;
								var v = _g3.h[_g2] - this.parseInt(param[i]);
								_g3.h[_g2] = v;
							}
						}
						return true;
					} else {
						return false;
					}
					break;
				case "int.sum":
					if(param.length > 2) {
						var varname = this.parseString(param[0]);
						var this1 = this._ints;
						var v = this.parseInt(param[1]) + this.parseInt(param[2]);
						this1.h[varname] = v;
						if(param.length > 3) {
							var _g = 3;
							var _g1 = param.length;
							while(_g < _g1) {
								var i = _g++;
								var _g2 = varname;
								var _g3 = this._ints;
								var v = _g3.h[_g2] + this.parseInt(param[i]);
								_g3.h[_g2] = v;
							}
						}
						return true;
					} else {
						return false;
					}
					break;
				case "int.tofloat":
					if(param.length > 1) {
						var this1 = this._floats;
						var k = this.parseString(param[0]);
						var v = this.parseInt(param[1]) * 1.0;
						this1.h[k] = v;
						return true;
					} else {
						return false;
					}
					break;
				case "int.tostring":
					if(param.length > 1) {
						var this1 = this._strings;
						var k = this.parseString(param[0]);
						var v = Std.string(this.parseInt(param[1]));
						this1.h[k] = v;
						return true;
					} else {
						return false;
					}
					break;
				case "inventory.addconsumable":
					if(param.length > 1) {
						com_tilbuci_data_GlobalPlayer.narrative.addConsumableItem(this.parseString(param[0]),this.parseInt(param[1]));
						return true;
					} else {
						return false;
					}
					break;
				case "inventory.addkeyitem":
					if(param.length > 0) {
						com_tilbuci_data_GlobalPlayer.narrative.addKeyItem(this.parseString(param[0]));
						return true;
					} else {
						return false;
					}
					break;
				case "inventory.clearconsumables":
					com_tilbuci_data_GlobalPlayer.narrative.clearConsumableItems();
					return true;
				case "inventory.clearkeyitems":
					com_tilbuci_data_GlobalPlayer.narrative.clearKeyItems();
					return true;
				case "inventory.close":
					com_tilbuci_data_GlobalPlayer.contraptions.invHide();
					return true;
				case "inventory.consfromstring":
					if(param.length > 0) {
						var tmp = com_tilbuci_data_GlobalPlayer.narrative;
						var this1 = this._strings;
						var key = this.parseString(param[0]);
						tmp.loadConsItems(this1.h[key]);
						return true;
					} else {
						return false;
					}
					break;
				case "inventory.constostring":
					if(param.length > 0) {
						var this1 = this._strings;
						var k = this.parseString(param[0]);
						var v = com_tilbuci_data_GlobalPlayer.narrative.currentConsItems();
						this1.h[k] = v;
						return true;
					} else {
						return false;
					}
					break;
				case "inventory.consumeitem":
					if(param.length > 0) {
						com_tilbuci_data_GlobalPlayer.narrative.consumeItem(this.parseString(param[0]));
						return true;
					} else {
						return false;
					}
					break;
				case "inventory.fromstring":
					if(param.length > 0) {
						var tmp = com_tilbuci_data_GlobalPlayer.narrative;
						var this1 = this._strings;
						var key = this.parseString(param[0]);
						tmp.loadItems(this1.h[key]);
						return true;
					} else {
						return false;
					}
					break;
				case "inventory.haskeyitem":
					if(param.length > 0) {
						if(com_tilbuci_data_GlobalPlayer.narrative.hasKeyItem(this.parseString(param[0]))) {
							if(Object.prototype.hasOwnProperty.call(inf,"then")) {
								this.run(Reflect.field(inf,"then"),true);
							}
						} else if(Object.prototype.hasOwnProperty.call(inf,"else")) {
							this.run(Reflect.field(inf,"else"),true);
						}
						return true;
					} else {
						return false;
					}
					break;
				case "inventory.keyfromstring":
					if(param.length > 0) {
						var tmp = com_tilbuci_data_GlobalPlayer.narrative;
						var this1 = this._strings;
						var key = this.parseString(param[0]);
						tmp.loadKeyItems(this1.h[key]);
						return true;
					} else {
						return false;
					}
					break;
				case "inventory.keytostring":
					if(param.length > 0) {
						var this1 = this._strings;
						var k = this.parseString(param[0]);
						var v = com_tilbuci_data_GlobalPlayer.narrative.currentKeyItems();
						this1.h[k] = v;
						return true;
					} else {
						return false;
					}
					break;
				case "inventory.removeconsumable":
					if(param.length > 0) {
						com_tilbuci_data_GlobalPlayer.narrative.removeConsumableItem(this.parseString(param[0]));
						return true;
					} else {
						return false;
					}
					break;
				case "inventory.removekeyitem":
					if(param.length > 0) {
						com_tilbuci_data_GlobalPlayer.narrative.removeKeyItem(this.parseString(param[0]));
						return true;
					} else {
						return false;
					}
					break;
				case "inventory.show":
					var invclose = null;
					if(Object.prototype.hasOwnProperty.call(inf,"complete")) {
						invclose = Reflect.field(inf,"complete");
					}
					com_tilbuci_data_GlobalPlayer.contraptions.inventoryShow(invclose);
					return true;
				case "inventory.tostring":
					if(param.length > 0) {
						var this1 = this._strings;
						var k = this.parseString(param[0]);
						var v = com_tilbuci_data_GlobalPlayer.narrative.currentItems();
						this1.h[k] = v;
						return true;
					} else {
						return false;
					}
					break;
				case "mouse.hide":
					openfl_ui_Mouse.hide();
					com_tilbuci_data_GlobalPlayer.cursorVisible = false;
					com_tilbuci_data_GlobalPlayer.area.noMouseOver();
					return true;
				case "mouse.show":
					com_tilbuci_data_GlobalPlayer.cursorVisible = true;
					openfl_ui_Mouse.show();
					return true;
				case "movie.load":
					com_tilbuci_data_GlobalPlayer.contraptions.removeContraptions(true);
					com_tilbuci_data_GlobalPlayer.movie.loadMovie(this.parseString(param[0]));
					return true;
				case "replace.clearallfiles":
					this._replacefile = new haxe_ds_StringMap();
					return true;
				case "replace.clearallstrings":
					this._replacestr = new haxe_ds_StringMap();
					return true;
				case "replace.clearfile":
					if(param.length > 0) {
						var this1 = this._replacefile;
						var key = this.parseString(param[0]);
						if(Object.prototype.hasOwnProperty.call(this1.h,key)) {
							var this1 = this._replacefile;
							var key = this.parseString(param[0]);
							var _this = this1;
							if(Object.prototype.hasOwnProperty.call(_this.h,key)) {
								delete(_this.h[key]);
							}
						}
						return true;
					} else {
						return false;
					}
					break;
				case "replace.clearstring":
					if(param.length > 0) {
						var this1 = this._replacestr;
						var key = this.parseString(param[0]);
						if(Object.prototype.hasOwnProperty.call(this1.h,key)) {
							var this1 = this._replacestr;
							var key = this.parseString(param[0]);
							var _this = this1;
							if(Object.prototype.hasOwnProperty.call(_this.h,key)) {
								delete(_this.h[key]);
							}
						}
						return true;
					} else {
						return false;
					}
					break;
				case "replace.origin":
					if(param.length > 0) {
						switch(this.parseString(param[0])) {
						case "bottom":
							com_tilbuci_data_GlobalPlayer.mdata.origin = this.parseString(param[0]);
							break;
						case "bottomkeep":
							com_tilbuci_data_GlobalPlayer.mdata.origin = this.parseString(param[0]);
							break;
						case "center":
							com_tilbuci_data_GlobalPlayer.mdata.origin = this.parseString(param[0]);
							break;
						case "left":
							com_tilbuci_data_GlobalPlayer.mdata.origin = this.parseString(param[0]);
							break;
						case "leftkeep":
							com_tilbuci_data_GlobalPlayer.mdata.origin = this.parseString(param[0]);
							break;
						case "none":
							com_tilbuci_data_GlobalPlayer.mdata.origin = this.parseString(param[0]);
							break;
						case "right":
							com_tilbuci_data_GlobalPlayer.mdata.origin = this.parseString(param[0]);
							break;
						case "rightkeep":
							com_tilbuci_data_GlobalPlayer.mdata.origin = this.parseString(param[0]);
							break;
						case "top":
							com_tilbuci_data_GlobalPlayer.mdata.origin = this.parseString(param[0]);
							break;
						case "topkeep":
							com_tilbuci_data_GlobalPlayer.mdata.origin = this.parseString(param[0]);
							break;
						default:
							com_tilbuci_data_GlobalPlayer.mdata.origin = "alpha";
						}
						return true;
					} else {
						return false;
					}
					break;
				case "replace.setfile":
					if(param.length > 1) {
						var this1 = this._replacefile;
						var k = this.parseString(param[0]);
						var v = this.parseString(param[1]);
						this1.h[k] = v;
						return true;
					} else {
						return false;
					}
					break;
				case "replace.setstring":
					if(param.length > 1) {
						var this1 = this._replacestr;
						var k = this.parseString(param[0]);
						var v = this.parseString(param[1]);
						this1.h[k] = v;
						return true;
					} else {
						return false;
					}
					break;
				case "run":
					if(param.length > 0) {
						this._snpParam = ["","","","","","",""];
						if(param.length >= 2) {
							this._snpParam[0] = param[1];
						}
						if(param.length >= 3) {
							this._snpParam[1] = param[2];
						}
						if(param.length >= 4) {
							this._snpParam[2] = param[3];
						}
						if(param.length >= 5) {
							this._snpParam[3] = param[4];
						}
						if(param.length >= 6) {
							this._snpParam[4] = param[5];
						}
						if(param.length >= 7) {
							this._snpParam[5] = param[6];
						}
						if(param.length >= 8) {
							this._snpParam[6] = param[7];
						}
						var found = "";
						var h = this._dSnippets.h;
						var k_h = h;
						var k_keys = Object.keys(h);
						var k_length = k_keys.length;
						var k_current = 0;
						while(k_current < k_length) {
							var k = k_keys[k_current++];
							var _g = 0;
							var _g1 = this._dSnippets.h[k];
							while(_g < _g1.length) {
								var s = _g1[_g];
								++_g;
								if(s.name == this.parseString(param[0])) {
									found = s.code;
								}
							}
						}
						if(found == "") {
							var this1 = com_tilbuci_data_GlobalPlayer.mvActions;
							var key = this.parseString(param[0]);
							if(Object.prototype.hasOwnProperty.call(this1.h,key)) {
								var this1 = com_tilbuci_data_GlobalPlayer.mvActions;
								var key = this.parseString(param[0]);
								return this.run(this1.h[key]);
							} else {
								return false;
							}
						} else {
							return this.run(found);
						}
					} else {
						return false;
					}
					break;
				case "runtime.endkiosk":
					return false;
				case "runtime.ifbrowser":
					var ifbrowserthen = null;
					var ifbrowserelse = null;
					if(Object.prototype.hasOwnProperty.call(inf,"then")) {
						ifbrowserthen = Reflect.field(inf,"then");
					}
					if(Object.prototype.hasOwnProperty.call(inf,"else")) {
						ifbrowserelse = Reflect.field(inf,"else");
					}
					if(ifbrowserthen != null) {
						return this.run(ifbrowserthen,true);
					} else {
						return true;
					}
					break;
				case "runtime.ifdataexist":
					if(param.length > 0) {
						if(com_tilbuci_data_GlobalPlayer.existsFile(this.parseString(param[0]) + "." + com_tilbuci_data_GlobalPlayer.movie.get_mvId())) {
							if(Object.prototype.hasOwnProperty.call(inf,"then")) {
								this.run(Reflect.field(inf,"then"),true);
							}
						} else if(Object.prototype.hasOwnProperty.call(inf,"else")) {
							this.run(Reflect.field(inf,"else"),true);
						}
						return true;
					} else {
						if(Object.prototype.hasOwnProperty.call(inf,"else")) {
							this.run(Reflect.field(inf,"else"),true);
						}
						return false;
					}
					break;
				case "runtime.install":
					return false;
				case "runtime.loaddata":
					this._acOk = this._acError = null;
					if(Object.prototype.hasOwnProperty.call(inf,"success")) {
						this._acOk = Reflect.field(inf,"success");
					}
					if(Object.prototype.hasOwnProperty.call(inf,"error")) {
						this._acError = Reflect.field(inf,"error");
					}
					if(param.length > 0) {
						return com_tilbuci_data_GlobalPlayer.loadFile(this.parseString(param[0]) + "." + com_tilbuci_data_GlobalPlayer.movie.get_mvId(),com_tilbuci_data_GlobalPlayer.movie.get_mvId(),$bind(this,this.onVariablesFile));
					} else {
						if(this._acError != null) {
							this.run(this._acError,true);
						}
						return false;
					}
					break;
				case "runtime.quit":
					return com_tilbuci_data_GlobalPlayer.appQuit();
				case "runtime.savedata":
					if(param.length > 0) {
						var data = [];
						var h = this._strings.h;
						var k_h = h;
						var k_keys = Object.keys(h);
						var k_length = k_keys.length;
						var k_current = 0;
						while(k_current < k_length) {
							var k = k_keys[k_current++];
							data.push({ n : k, t : "s", v : this._strings.h[k]});
						}
						var h = this._ints.h;
						var k_h = h;
						var k_keys = Object.keys(h);
						var k_length = k_keys.length;
						var k_current = 0;
						while(k_current < k_length) {
							var k = k_keys[k_current++];
							data.push({ n : k, t : "i", v : this._ints.h[k]});
						}
						var h = this._floats.h;
						var k_h = h;
						var k_keys = Object.keys(h);
						var k_length = k_keys.length;
						var k_current = 0;
						while(k_current < k_length) {
							var k = k_keys[k_current++];
							data.push({ n : k, t : "f", v : this._floats.h[k]});
						}
						var h = this._bools.h;
						var k_h = h;
						var k_keys = Object.keys(h);
						var k_length = k_keys.length;
						var k_current = 0;
						while(k_current < k_length) {
							var k = k_keys[k_current++];
							data.push({ n : k, t : "b", v : this._bools.h[k]});
						}
						var encdata = com_tilbuci_statictools_StringStatic.encrypt(com_tilbuci_statictools_StringStatic.jsonStringify(data),com_tilbuci_statictools_StringStatic.md5(com_tilbuci_data_GlobalPlayer.movie.get_mvId() + HxOverrides.substr(com_tilbuci_data_GlobalPlayer.movie.get_mvId(),2,null)).toLowerCase());
						return com_tilbuci_data_GlobalPlayer.saveFile(this.parseString(param[0]) + "." + com_tilbuci_data_GlobalPlayer.movie.get_mvId(),encdata);
					} else {
						return false;
					}
					break;
				case "runtime.startkiosk":
					return false;
				case "scene.historyback":
					if(com_tilbuci_data_GlobalPlayer.history.length > 0) {
						com_tilbuci_data_GlobalPlayer.movie.preventHistory = true;
						return com_tilbuci_data_GlobalPlayer.movie.loadScene(com_tilbuci_data_GlobalPlayer.history.pop());
					} else {
						return false;
					}
					break;
				case "scene.load":
					return com_tilbuci_data_GlobalPlayer.movie.loadScene(this.parseString(param[0]));
				case "scene.loadfirstkeyframe":
					com_tilbuci_data_GlobalPlayer.area.loadKeyframe(com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[0],0);
					return true;
				case "scene.loadkeyframe":
					if(param.length > 0) {
						var lkf = this.parseInt(param[0]) - 1;
						if(lkf < 0 || lkf > com_tilbuci_data_GlobalPlayer.movie.scene.keyframes.length - 1) {
							return false;
						} else {
							com_tilbuci_data_GlobalPlayer.area.loadKeyframe(com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[lkf],lkf);
							return true;
						}
					} else {
						return false;
					}
					break;
				case "scene.loadlastkeyframe":
					com_tilbuci_data_GlobalPlayer.area.loadKeyframe(com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[com_tilbuci_data_GlobalPlayer.movie.scene.keyframes.length - 1],com_tilbuci_data_GlobalPlayer.movie.scene.keyframes.length - 1);
					return true;
				case "scene.navigate":
					if(param.length > 0) {
						if(Object.prototype.hasOwnProperty.call(com_tilbuci_data_GlobalPlayer.movie.scene.navigation.h,param[0])) {
							if(com_tilbuci_data_GlobalPlayer.movie.scene.navigation.h[param[0]] != "") {
								return com_tilbuci_data_GlobalPlayer.movie.loadScene(this.parseString(com_tilbuci_data_GlobalPlayer.movie.scene.navigation.h[param[0]]));
							} else {
								return false;
							}
						} else {
							return false;
						}
					} else {
						return false;
					}
					break;
				case "scene.nextkeyframe":
					var nkf = com_tilbuci_data_GlobalPlayer.area.get_currentKf() + 1;
					if(nkf >= com_tilbuci_data_GlobalPlayer.movie.scene.keyframes.length) {
						nkf = 0;
					}
					com_tilbuci_data_GlobalPlayer.area.loadKeyframe(com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[nkf],nkf);
					return true;
				case "scene.pause":
					com_tilbuci_data_GlobalPlayer.area.pause();
					return true;
				case "scene.play":
					com_tilbuci_data_GlobalPlayer.area.play();
					return true;
				case "scene.playpause":
					com_tilbuci_data_GlobalPlayer.area.playPause();
					return true;
				case "scene.previouskeyframe":
					var pkf = com_tilbuci_data_GlobalPlayer.area.get_currentKf() - 1;
					if(pkf < 0) {
						pkf = com_tilbuci_data_GlobalPlayer.movie.scene.keyframes.length - 1;
					}
					com_tilbuci_data_GlobalPlayer.area.loadKeyframe(com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[pkf],pkf);
					return true;
				case "scene.shake":
					if(param.length > 1) {
						var end = null;
						if(Object.prototype.hasOwnProperty.call(inf,"end")) {
							end = Reflect.field(inf,"end");
						}
						com_tilbuci_statictools_SpriteStatic.shake(com_tilbuci_data_GlobalPlayer.area,this.parseFloat(param[0]),this.parseFloat(param[1]),end);
						return true;
					} else {
						return false;
					}
					break;
				case "snippets.load":
					if(param.length > 0) {
						this._acOk = this._acError = null;
						if(Object.prototype.hasOwnProperty.call(inf,"success")) {
							this._acOk = Reflect.field(inf,"success");
						}
						if(Object.prototype.hasOwnProperty.call(inf,"error")) {
							this._acError = Reflect.field(inf,"error");
						}
						var cache = null;
						if(com_tilbuci_data_GlobalPlayer.nocache) {
							var _g = new haxe_ds_StringMap();
							var value = Math.ceil(Math.random() * 10000);
							_g.h["rand"] = value;
							cache = _g;
						}
						this._sngroup = this.parseString(param[0]);
						new com_tilbuci_data_DataLoader(true,com_tilbuci_data_GlobalPlayer.path + "media/snippets/" + this.parseString(param[0]) + ".json","GET",cache,4,$bind(this,this.onSnippetFile));
						return true;
					} else {
						if(Object.prototype.hasOwnProperty.call(inf,"error")) {
							this.run(Reflect.field(inf,"error"),true);
						}
						return false;
					}
					break;
				case "snippets.unload":
					if(param.length > 0) {
						var this1 = this._dSnippets;
						var key = this.parseString(param[0]);
						if(Object.prototype.hasOwnProperty.call(this1.h,key)) {
							var this1 = this._dSnippets;
							var key = this.parseString(param[0]);
							var _this = this1;
							if(Object.prototype.hasOwnProperty.call(_this.h,key)) {
								delete(_this.h[key]);
							}
						}
						return true;
					} else {
						return false;
					}
					break;
				case "string.clear":
					return this.clearString(param[0]);
				case "string.clearall":
					return this.clearVars("strings");
				case "string.clearglobal":
					if(param.length > 1) {
						var this1 = com_tilbuci_data_GlobalPlayer.mdata.texts;
						var key = this.parseString(param[0]);
						if(Object.prototype.hasOwnProperty.call(this1.h,key)) {
							var this1 = com_tilbuci_data_GlobalPlayer.mdata.texts;
							var key = this.parseString(param[0]);
							var _this = this1;
							if(Object.prototype.hasOwnProperty.call(_this.h,key)) {
								delete(_this.h[key]);
							}
						}
						return true;
					} else {
						return false;
					}
					break;
				case "string.concat":
					if(param.length > 2) {
						var varname = this.parseString(param[0]);
						this.concatString(varname,param[1],param[2]);
						if(param.length > 3) {
							var _g = 3;
							var _g1 = param.length;
							while(_g < _g1) {
								var i = _g++;
								this.concatString(varname,"$" + varname,param[i]);
							}
						}
						return true;
					} else {
						return false;
					}
					break;
				case "string.loadfile":
					if(param.length > 0) {
						this._acOk = this._acError = null;
						if(Object.prototype.hasOwnProperty.call(inf,"success")) {
							this._acOk = Reflect.field(inf,"success");
						}
						if(Object.prototype.hasOwnProperty.call(inf,"error")) {
							this._acError = Reflect.field(inf,"error");
						}
						var cache = null;
						if(com_tilbuci_data_GlobalPlayer.nocache) {
							var _g = new haxe_ds_StringMap();
							var value = Math.ceil(Math.random() * 10000);
							_g.h["rand"] = value;
							cache = _g;
						}
						new com_tilbuci_data_DataLoader(true,com_tilbuci_data_GlobalPlayer.path + "media/strings/" + this.parseString(param[0]) + ".json","GET",cache,4,$bind(this,this.onStringFile));
						return true;
					} else {
						if(Object.prototype.hasOwnProperty.call(inf,"error")) {
							this.run(Reflect.field(inf,"error"),true);
						}
						return false;
					}
					break;
				case "string.replace":
					if(param.length > 3) {
						var this1 = this._strings;
						var k = this.parseString(param[0]);
						var v = StringTools.replace(this.parseString(param[1]),this.parseString(param[2]),this.parseString(param[3]));
						this1.h[k] = v;
						return true;
					} else {
						return false;
					}
					break;
				case "string.set":
					if(param.length > 1) {
						return this.setString(param[0],param[1]);
					} else {
						return false;
					}
					break;
				case "string.setglobal":
					if(param.length > 1) {
						var this1 = com_tilbuci_data_GlobalPlayer.mdata.texts;
						var k = this.parseString(param[0]);
						var v = this.parseString(param[1]);
						this1.h[k] = v;
						return true;
					} else {
						return false;
					}
					break;
				case "string.setgroup":
					if(param.length > 0) {
						var this1 = this._stringsjson;
						var key = this.parseString(param[0]);
						if(Object.prototype.hasOwnProperty.call(this1.h,key)) {
							this._jsongropup = this.parseString(param[0]);
						} else {
							this._jsongropup = "";
						}
						return true;
					} else {
						return false;
					}
					break;
				case "string.tofloat":
					if(param.length > 1) {
						var this1 = this._floats;
						var k = this.parseString(param[0]);
						var v = parseFloat(this.parseString(param[1]));
						this1.h[k] = v;
						return true;
					} else {
						return false;
					}
					break;
				case "string.toint":
					if(param.length > 1) {
						var this1 = this._ints;
						var k = this.parseString(param[0]);
						var v = Std.parseInt(this.parseString(param[1]));
						this1.h[k] = v;
						return true;
					} else {
						return false;
					}
					break;
				case "system.calljs":
					if(param.length > 0) {
						var args = [];
						if(param.length > 1) {
							args.push(this.parseString(param[1]));
						}
						if(param.length > 2) {
							args.push(this.parseString(param[2]));
						}
						if(param.length > 3) {
							args.push(this.parseString(param[3]));
						}
						if(param.length > 4) {
							args.push(this.parseString(param[4]));
						}
						if(param.length > 5) {
							args.push(this.parseString(param[5]));
						}
						if(param.length > 6) {
							args.push(this.parseString(param[6]));
						}
						return window.TBB_callJs(this.parseString(param[0]),args);
					} else {
						return false;
					}
					break;
				case "system.closeembed":
					window.embed_close();
					return true;
				case "system.copytext":
					if(param.length > 0) {
						return com_tilbuci_data_GlobalPlayer.copyText(this.parseString(param[0]));
					} else {
						return false;
					}
					break;
				case "system.embedplace":
					if(param.length > 3) {
						window.embed_setposition(this.parseInt(param[0]),this.parseInt(param[1]),this.parseInt(param[2]),this.parseInt(param[3]));
						return true;
					} else {
						return false;
					}
					break;
				case "system.embedreset":
					window.embed_setfull();
					return true;
				case "system.fullscreen":
					return com_tilbuci_data_GlobalPlayer.fullscreen();
				case "system.ifdesktop":
					if(Object.prototype.hasOwnProperty.call(inf,"else")) {
						return this.run(Reflect.field(inf,"else"),true);
					} else {
						return true;
					}
					break;
				case "system.ifhorizontal":
					if(com_tilbuci_data_GlobalPlayer.area.get_pOrientation() == "horizontal") {
						if(Object.prototype.hasOwnProperty.call(inf,"then")) {
							return this.run(Reflect.field(inf,"then"),true);
						} else {
							return true;
						}
					} else if(Object.prototype.hasOwnProperty.call(inf,"else")) {
						return this.run(Reflect.field(inf,"else"),true);
					} else {
						return true;
					}
					break;
				case "system.ifmobile":
					if(Object.prototype.hasOwnProperty.call(inf,"else")) {
						return this.run(Reflect.field(inf,"else"),true);
					} else {
						return true;
					}
					break;
				case "system.ifplayer":
					if(Object.prototype.hasOwnProperty.call(inf,"else")) {
						return this.run(Reflect.field(inf,"else"),true);
					} else {
						return true;
					}
					break;
				case "system.ifpublish":
					if(Object.prototype.hasOwnProperty.call(inf,"else")) {
						return this.run(Reflect.field(inf,"else"),true);
					} else {
						return true;
					}
					break;
				case "system.ifpwa":
					if(Object.prototype.hasOwnProperty.call(inf,"else")) {
						return this.run(Reflect.field(inf,"else"),true);
					} else {
						return true;
					}
					break;
				case "system.ifpwainstalled":
					if(Object.prototype.hasOwnProperty.call(inf,"else")) {
						return this.run(Reflect.field(inf,"else"),true);
					} else {
						return true;
					}
					break;
				case "system.ifvertical":
					if(com_tilbuci_data_GlobalPlayer.area.get_pOrientation() == "vertical") {
						if(Object.prototype.hasOwnProperty.call(inf,"then")) {
							return this.run(Reflect.field(inf,"then"),true);
						} else {
							return true;
						}
					} else if(Object.prototype.hasOwnProperty.call(inf,"else")) {
						return this.run(Reflect.field(inf,"else"),true);
					} else {
						return true;
					}
					break;
				case "system.ifwebsite":
					if(Object.prototype.hasOwnProperty.call(inf,"else")) {
						return this.run(Reflect.field(inf,"else"),true);
					} else {
						return true;
					}
					break;
				case "system.logout":
					com_tilbuci_data_GlobalPlayer.ws.clearUser();
					return true;
				case "system.openembed":
					if(com_tilbuci_data_GlobalPlayer.mode == "editor") {
						return true;
					} else if(param.length > 0) {
						window.embed_place("../movie/" + com_tilbuci_data_GlobalPlayer.movie.get_mvId() + ".movie/media/embed/" + this.parseString(param[0]) + "/index.html");
						return true;
					} else {
						return false;
					}
					break;
				case "system.openurl":
					if(param.length > 0) {
						var req = new openfl_net_URLRequest(param[0]);
						req.method = "GET";
						openfl_Lib.getURL(req);
						return true;
					} else {
						return false;
					}
					break;
				case "system.pwainstall":
					return false;
				case "system.quit":
					return false;
				case "system.sendevent":
					if(this.eventSend == null) {
						return false;
					} else {
						var map = new haxe_ds_StringMap();
						var _g = 0;
						var _g1 = param.length;
						while(_g < _g1) {
							var i = _g++;
							var v = this.parseString(param[i]);
							map.h["v" + i] = v;
						}
						this.eventSend(map);
						return true;
					}
					break;
				case "system.setkftime":
					if(param.length > 0) {
						var kftime = this.parseInt(param[0]);
						if(kftime >= 250) {
							com_tilbuci_data_GlobalPlayer.mdata.time = kftime / 1000;
							return true;
						} else {
							return false;
						}
					} else {
						return false;
					}
					break;
				case "system.visitoringroup":
					if(param.length > 0 && Object.prototype.hasOwnProperty.call(inf,"then")) {
						if(com_tilbuci_data_GlobalPlayer.ws.get_groups().indexOf(this.parseString(param[0])) != -1) {
							return this.run(Reflect.field(inf,"then"),true);
						} else if(Object.prototype.hasOwnProperty.call(inf,"else")) {
							return this.run(Reflect.field(inf,"else"),true);
						} else {
							return true;
						}
					} else {
						return false;
					}
					break;
				case "target.clear":
					com_tilbuci_data_GlobalPlayer.area.clearTarget();
					return true;
				case "target.hide":
					com_tilbuci_data_GlobalPlayer.area.hideTarget();
					return true;
				case "target.set":
					if(param.length > 0) {
						return com_tilbuci_data_GlobalPlayer.area.setTarget(this.parseString(param[0]));
					} else {
						return false;
					}
					break;
				case "target.setposition":
					if(param.length > 1) {
						com_tilbuci_data_GlobalPlayer.area.setTargetPos(this.parseInt(param[0]),this.parseInt(param[1]));
						return true;
					} else {
						return false;
					}
					break;
				case "target.show":
					com_tilbuci_data_GlobalPlayer.area.showTarget();
					return true;
				case "target.toggle":
					com_tilbuci_data_GlobalPlayer.area.toggleTarget();
					return true;
				case "timer.clear":
					if(com_tilbuci_data_GlobalPlayer.mode == "editor") {
						return true;
					} else {
						var h = this._timers.h;
						var k_h = h;
						var k_keys = Object.keys(h);
						var k_length = k_keys.length;
						var k_current = 0;
						while(k_current < k_length) {
							var k = k_keys[k_current++];
							if(this._timers.h[k].name == null) {
								var _this = this._timers;
								if(Object.prototype.hasOwnProperty.call(_this.h,k)) {
									delete(_this.h[k]);
								}
							}
						}
						if(param.length >= 1) {
							if(Object.prototype.hasOwnProperty.call(this._timers.h,param[0])) {
								try {
									this._timers.h[param[0]].clear();
								} catch( _g ) {
								}
								var _this = this._timers;
								var key = param[0];
								if(Object.prototype.hasOwnProperty.call(_this.h,key)) {
									delete(_this.h[key]);
								}
								return true;
							} else {
								return false;
							}
						} else {
							return false;
						}
					}
					break;
				case "timer.clearall":
					if(com_tilbuci_data_GlobalPlayer.mode == "editor") {
						return true;
					} else {
						var h = this._timers.h;
						var k_h = h;
						var k_keys = Object.keys(h);
						var k_length = k_keys.length;
						var k_current = 0;
						while(k_current < k_length) {
							var k = k_keys[k_current++];
							this._timers.h[k].clear();
							var _this = this._timers;
							if(Object.prototype.hasOwnProperty.call(_this.h,k)) {
								delete(_this.h[k]);
							}
						}
						return true;
					}
					break;
				case "timer.set":
					if(com_tilbuci_data_GlobalPlayer.mode == "editor") {
						return true;
					} else {
						var h = this._timers.h;
						var k_h = h;
						var k_keys = Object.keys(h);
						var k_length = k_keys.length;
						var k_current = 0;
						while(k_current < k_length) {
							var k = k_keys[k_current++];
							if(this._timers.h[k].name == null) {
								var _this = this._timers;
								if(Object.prototype.hasOwnProperty.call(_this.h,k)) {
									delete(_this.h[k]);
								}
							}
						}
						if(Object.prototype.hasOwnProperty.call(inf,"tick")) {
							if(param.length == 3) {
								var inter = Std.parseInt(param[1]);
								if(inter == null || inter < 250) {
									return false;
								} else {
									var stp = Std.parseInt(param[2]);
									if(stp == null || stp < 1) {
										return false;
									} else {
										if(Object.prototype.hasOwnProperty.call(this._timers.h,param[0])) {
											this._timers.h[param[0]].clear();
											var _this = this._timers;
											var key = param[0];
											if(Object.prototype.hasOwnProperty.call(_this.h,key)) {
												delete(_this.h[key]);
											}
										}
										var end = null;
										if(Object.prototype.hasOwnProperty.call(inf,"end")) {
											end = Reflect.field(inf,"end");
										}
										var this1 = this._timers;
										var v = new com_tilbuci_script_ActionTimer(param[0],inter,stp,Reflect.field(inf,"tick"),end);
										this1.h[param[0]] = v;
										return true;
									}
								}
							} else {
								return false;
							}
						} else {
							return false;
						}
					}
					break;
				default:
					var found = false;
					var ret = false;
					var after = { onthen : null, onelse : null, onok : null, oncancel : null, ontick : null, onend : null, onsuccess : null, onerror : null};
					if(Object.prototype.hasOwnProperty.call(inf,"then")) {
						after.onthen = Reflect.field(inf,"then");
					}
					if(Object.prototype.hasOwnProperty.call(inf,"else")) {
						after.onelse = Reflect.field(inf,"else");
					}
					if(Object.prototype.hasOwnProperty.call(inf,"ok")) {
						after.onok = Reflect.field(inf,"ok");
					}
					if(Object.prototype.hasOwnProperty.call(inf,"cancel")) {
						after.oncancel = Reflect.field(inf,"cancel");
					}
					if(Object.prototype.hasOwnProperty.call(inf,"tick")) {
						after.ontick = Reflect.field(inf,"tick");
					}
					if(Object.prototype.hasOwnProperty.call(inf,"end")) {
						after.onend = Reflect.field(inf,"end");
					}
					if(Object.prototype.hasOwnProperty.call(inf,"success")) {
						after.onsuccess = Reflect.field(inf,"success");
					}
					if(Object.prototype.hasOwnProperty.call(inf,"error")) {
						after.onerror = Reflect.field(inf,"error");
					}
					var h = com_tilbuci_data_GlobalPlayer.plugins.h;
					var p_h = h;
					var p_keys = Object.keys(h);
					var p_length = p_keys.length;
					var p_current = 0;
					while(p_current < p_length) {
						var p = p_h[p_keys[p_current++]];
						if(p.active && !found) {
							if(p.hasAction(Reflect.field(inf,"ac"))) {
								ret = p.runAction(Reflect.field(inf,"ac"),param,after);
								found = true;
							}
						}
					}
					return ret;
				}
			}
		} else {
			return false;
		}
	}
	,parsePath: function(path) {
		var h = this._replacefile.h;
		var k_h = h;
		var k_keys = Object.keys(h);
		var k_length = k_keys.length;
		var k_current = 0;
		while(k_current < k_length) {
			var k = k_keys[k_current++];
			path = StringTools.replace(path,k,this._replacefile.h[k]);
		}
		return path;
	}
	,parseString: function(str) {
		var str1 = this.parseStringVar(str);
		var h = this._replacestr.h;
		var k_h = h;
		var k_keys = Object.keys(h);
		var k_length = k_keys.length;
		var k_current = 0;
		while(k_current < k_length) {
			var k = k_keys[k_current++];
			str1 = StringTools.replace(str1,k,this._replacestr.h[k]);
		}
		return str1;
	}
	,parseStringVar: function(str) {
		if(str.charAt(0) == "$") {
			var h = com_tilbuci_data_GlobalPlayer.plugins.h;
			var p_h = h;
			var p_keys = Object.keys(h);
			var p_length = p_keys.length;
			var p_current = 0;
			while(p_current < p_length) {
				var p = p_h[p_keys[p_current++]];
				if(p.active) {
					var plparse = p.parseString(str);
					if(plparse.found) {
						return plparse.value;
					}
				}
			}
			if(HxOverrides.substr(str,0,10) == "$_INSTANCE") {
				var arstr = str.split(":");
				if(arstr.length == 2) {
					switch(arstr[0]) {
					case "$_INSTANCECOLOR":
						return com_tilbuci_data_GlobalPlayer.area.instanceStringProp(this.parseString(arstr[1]),"color");
					case "$_INSTANCEFONT":
						return com_tilbuci_data_GlobalPlayer.area.instanceStringProp(this.parseString(arstr[1]),"font");
					case "$_INSTANCEFONTCOLOR":
						return com_tilbuci_data_GlobalPlayer.area.instanceStringProp(this.parseString(arstr[1]),"fontColor");
					case "$_INSTANCETEXT":
						return com_tilbuci_data_GlobalPlayer.area.instanceStringProp(this.parseString(arstr[1]),"text");
					default:
						return str;
					}
				} else {
					return str;
				}
			} else if(HxOverrides.substr(str,0,7) == "$_INPUT") {
				var arstr = str.split(":");
				if(arstr.length == 2) {
					return com_tilbuci_data_GlobalPlayer.area.getInputText(arstr[1]);
				} else {
					return str;
				}
			} else if(HxOverrides.substr(str,0,7) == "$_TAREA") {
				var arstr = str.split(":");
				if(arstr.length == 2) {
					return com_tilbuci_data_GlobalPlayer.area.getTareaText(arstr[1]);
				} else {
					return str;
				}
			} else if(HxOverrides.substr(str,0,7) == "$_TEXTS") {
				var arstr = str.split(":");
				if(arstr.length == 2) {
					var this1 = com_tilbuci_data_GlobalPlayer.mdata.texts;
					var key = this.parseString(arstr[1]);
					if(Object.prototype.hasOwnProperty.call(this1.h,key)) {
						var this1 = com_tilbuci_data_GlobalPlayer.mdata.texts;
						var key = this.parseString(arstr[1]);
						return this1.h[key];
					} else {
						return "";
					}
				} else {
					return "";
				}
			} else if(HxOverrides.substr(str,0,6) == "$_FORM") {
				var arstr = str.split(":");
				if(arstr.length == 2) {
					return com_tilbuci_data_GlobalPlayer.contraptions.getFormValue(arstr[1]);
				} else {
					return "";
				}
			} else if(HxOverrides.substr(str,0,7) == "$_PARAM") {
				var arstr = str.split(":");
				if(arstr.length == 2) {
					switch(arstr[1]) {
					case "1":
						return this._snpParam[0];
					case "2":
						return this._snpParam[1];
					case "3":
						return this._snpParam[2];
					case "4":
						return this._snpParam[3];
					case "5":
						return this._snpParam[4];
					case "6":
						return this._snpParam[5];
					case "7":
						return this._snpParam[6];
					default:
						return "";
					}
				} else {
					return "";
				}
			} else if(this._jsongropup != "" && Object.prototype.hasOwnProperty.call(this._stringsjson.h,this._jsongropup) && Object.prototype.hasOwnProperty.call(this._stringsjson.h[this._jsongropup].h,str)) {
				return this._stringsjson.h[this._jsongropup].h[str];
			} else {
				switch(str) {
				case "$_DATE":
					return DateTools.format(new Date(),"%Y-%m-%d");
				case "$_DAY":
					return DateTools.format(new Date(),"%d");
				case "$_HOUR":
					return DateTools.format(new Date(),"%H");
				case "$_MINUTE":
					return DateTools.format(new Date(),"%M");
				case "$_MONTH":
					return DateTools.format(new Date(),"%m");
				case "$_MOVIEID":
					return com_tilbuci_data_GlobalPlayer.movie.get_mvId();
				case "$_MOVIETITLE":
					return com_tilbuci_data_GlobalPlayer.movie.data.title;
				case "$_ORIENTATION":
					return com_tilbuci_data_GlobalPlayer.area.get_pOrientation();
				case "$_RENDER":
					return "webgl";
				case "$_RUNTIME":
					return "tilbuci";
				case "$_SCENEID":
					return com_tilbuci_data_GlobalPlayer.movie.get_scId();
				case "$_SCENETITLE":
					return com_tilbuci_data_GlobalPlayer.movie.scene.title;
				case "$_SECOND":
					return DateTools.format(new Date(),"%S");
				case "$_SESSION":
					return com_tilbuci_data_GlobalPlayer.session;
				case "$_TIME":
					return DateTools.format(new Date(),"%H:%M:%S");
				case "$_URLMOVIE":
					return com_tilbuci_data_GlobalPlayer.base + "app?mv=" + com_tilbuci_data_GlobalPlayer.movie.get_mvId();
				case "$_URLSCENE":
					return com_tilbuci_data_GlobalPlayer.base + "app?mv=" + com_tilbuci_data_GlobalPlayer.movie.get_mvId() + "&sc=" + com_tilbuci_data_GlobalPlayer.movie.get_scId();
				case "$_USERNAME":
					return com_tilbuci_data_GlobalPlayer.ws.getUser();
				case "$_VERSION":
					return com_tilbuci_data_GlobalPlayer.build.get_version();
				case "$_WSSERVER":
					return com_tilbuci_data_GlobalPlayer.ws.get_url();
				case "$_YEAR":
					return DateTools.format(new Date(),"%Y");
				default:
					if(Object.prototype.hasOwnProperty.call(this._strings.h,HxOverrides.substr(str,1,null))) {
						return this._strings.h[HxOverrides.substr(str,1,null)];
					} else if(Object.prototype.hasOwnProperty.call(this._stringfile.h,HxOverrides.substr(str,1,null))) {
						return this._stringfile.h[HxOverrides.substr(str,1,null)];
					} else {
						return str;
					}
				}
			}
		} else {
			return str;
		}
	}
	,parseBool: function(str) {
		if(str.charAt(0) == "?") {
			var h = com_tilbuci_data_GlobalPlayer.plugins.h;
			var p_h = h;
			var p_keys = Object.keys(h);
			var p_length = p_keys.length;
			var p_current = 0;
			while(p_current < p_length) {
				var p = p_h[p_keys[p_current++]];
				if(p.active) {
					var plparse = p.parseBool(str);
					if(plparse.found) {
						return plparse.value;
					}
				}
			}
			if(HxOverrides.substr(str,0,10) == "?_INSTANCE") {
				var arstr = str.split(":");
				if(arstr.length == 2) {
					switch(arstr[0]) {
					case "?_INSTANCEFONTBOLD":
						return com_tilbuci_data_GlobalPlayer.area.instanceBoolProp(this.parseString(arstr[1]),"fontBold");
					case "?_INSTANCEFONTITALIC":
						return com_tilbuci_data_GlobalPlayer.area.instanceBoolProp(this.parseString(arstr[1]),"fontItalic");
					case "?_INSTANCEPLAYING":
						return com_tilbuci_data_GlobalPlayer.area.instancePlaying(this.parseString(arstr[1]));
					case "?_INSTANCEVISIBLE":
						return com_tilbuci_data_GlobalPlayer.area.instanceBoolProp(this.parseString(arstr[1]),"visible");
					default:
						return false;
					}
				} else {
					return false;
				}
			} else if(HxOverrides.substr(str,0,8) == "?_TOGGLE") {
				var arstr = str.split(":");
				if(arstr.length == 2) {
					return com_tilbuci_data_GlobalPlayer.area.getToggleValue(this.parseString(arstr[1]));
				} else {
					return false;
				}
			} else if(HxOverrides.substr(str,0,7) == "?_FLAGS") {
				var arstr = str.split(":");
				if(arstr.length == 2) {
					var this1 = com_tilbuci_data_GlobalPlayer.mdata.flags;
					var key = this.parseString(arstr[1]);
					if(Object.prototype.hasOwnProperty.call(this1.h,key)) {
						var this1 = com_tilbuci_data_GlobalPlayer.mdata.flags;
						var key = this.parseString(arstr[1]);
						return this1.h[key];
					} else {
						return false;
					}
				} else {
					return false;
				}
			} else {
				switch(str) {
				case "?_HADINTERACTION":
					return this.hadInteraction;
				case "?_PLAYING":
					return com_tilbuci_data_GlobalPlayer.area.get_playing();
				case "?_SERVER":
					return com_tilbuci_data_GlobalPlayer.server;
				case "?_USERLOGGED":
					return com_tilbuci_data_GlobalPlayer.ws.userLogged();
				default:
					if(Object.prototype.hasOwnProperty.call(this._bools.h,HxOverrides.substr(str,1,null))) {
						return this._bools.h[HxOverrides.substr(str,1,null)];
					} else if(HxOverrides.substr(str,1,null).toLowerCase() != "true") {
						return HxOverrides.substr(str,1,null).toLowerCase() == "1";
					} else {
						return true;
					}
				}
			}
		} else if(str.toLowerCase() != "true") {
			return str == "1";
		} else {
			return true;
		}
	}
	,parseFloat: function(str) {
		if(str.charAt(0) == "#") {
			var h = com_tilbuci_data_GlobalPlayer.plugins.h;
			var p_h = h;
			var p_keys = Object.keys(h);
			var p_length = p_keys.length;
			var p_current = 0;
			while(p_current < p_length) {
				var p = p_h[p_keys[p_current++]];
				if(p.active) {
					var plparse = p.parseFloat(str);
					if(plparse.found) {
						return plparse.value;
					}
				}
			}
			if(HxOverrides.substr(str,0,10) == "#_INSTANCE") {
				var arstr = str.split(":");
				if(arstr.length == 2) {
					switch(arstr[0]) {
					case "#_INSTANCEALPHA":
						return com_tilbuci_data_GlobalPlayer.area.instanceProp(this.parseString(arstr[1]),"alpha");
					case "#_INSTANCECOLORALPHA":
						return com_tilbuci_data_GlobalPlayer.area.instanceProp(this.parseString(arstr[1]),"colorAlpha");
					case "#_INSTANCEFONTLEADING":
						return com_tilbuci_data_GlobalPlayer.area.instanceProp(this.parseString(arstr[1]),"fontLeading");
					case "#_INSTANCEFONTSIZE":
						return com_tilbuci_data_GlobalPlayer.area.instanceProp(this.parseString(arstr[1]),"fontSize");
					case "#_INSTANCEFONTSPACING":
						return com_tilbuci_data_GlobalPlayer.area.instanceProp(this.parseString(arstr[1]),"fontSpacing");
					case "#_INSTANCEHEIGHT":
						return com_tilbuci_data_GlobalPlayer.area.instanceProp(this.parseString(arstr[1]),"height");
					case "#_INSTANCEORDER":
						return com_tilbuci_data_GlobalPlayer.area.instanceProp(this.parseString(arstr[1]),"order");
					case "#_INSTANCEPAN":
						return com_tilbuci_data_GlobalPlayer.area.instanceProp(this.parseString(arstr[1]),"pan");
					case "#_INSTANCEROTATION":
						return com_tilbuci_data_GlobalPlayer.area.instanceProp(this.parseString(arstr[1]),"rotation");
					case "#_INSTANCEVOLUME":
						return com_tilbuci_data_GlobalPlayer.area.instanceProp(this.parseString(arstr[1]),"volume");
					case "#_INSTANCEWIDTH":
						return com_tilbuci_data_GlobalPlayer.area.instanceProp(this.parseString(arstr[1]),"width");
					case "#_INSTANCEX":
						return com_tilbuci_data_GlobalPlayer.area.instanceProp(this.parseString(arstr[1]),"x");
					case "#_INSTANCEY":
						return com_tilbuci_data_GlobalPlayer.area.instanceProp(this.parseString(arstr[1]),"y");
					default:
						return 0;
					}
				} else {
					return 0;
				}
			} else if(HxOverrides.substr(str,0,9) == "#_NUMERIC") {
				var arstr = str.split(":");
				if(arstr.length == 2) {
					return com_tilbuci_data_GlobalPlayer.area.getNumericValue(this.parseString(arstr[1]));
				} else {
					return 0;
				}
			} else if(HxOverrides.substr(str,0,9) == "#_NUMBERS") {
				var arstr = str.split(":");
				if(arstr.length == 2) {
					var this1 = com_tilbuci_data_GlobalPlayer.mdata.numbers;
					var key = this.parseString(arstr[1]);
					if(Object.prototype.hasOwnProperty.call(this1.h,key)) {
						var this1 = com_tilbuci_data_GlobalPlayer.mdata.numbers;
						var key = this.parseString(arstr[1]);
						return this1.h[key];
					} else {
						return 0;
					}
				} else {
					return 0;
				}
			} else {
				switch(str) {
				case "#_AREABIG":
					return com_tilbuci_data_GlobalPlayer.mdata.screen.big * 1.0;
				case "#_AREASMALL":
					return com_tilbuci_data_GlobalPlayer.mdata.screen.small * 1.0;
				case "#_CONTENTHEIGHT":
					return com_tilbuci_data_GlobalPlayer.contentHeight;
				case "#_CONTENTWIDTH":
					return com_tilbuci_data_GlobalPlayer.contentWidth;
				case "#_CONTENTX":
					return com_tilbuci_data_GlobalPlayer.contentPosition.x;
				case "#_CONTENTY":
					return com_tilbuci_data_GlobalPlayer.contentPosition.y;
				case "#_KEYFRAME":
					return com_tilbuci_data_GlobalPlayer.area.get_currentKf() * 1.0;
				default:
					if(Object.prototype.hasOwnProperty.call(this._floats.h,HxOverrides.substr(str,1,null))) {
						return this._floats.h[HxOverrides.substr(str,1,null)];
					} else {
						return parseFloat(HxOverrides.substr(str,1,null));
					}
				}
			}
		} else {
			return parseFloat(str);
		}
	}
	,parseInt: function(str) {
		if(str.charAt(0) == "#") {
			var h = com_tilbuci_data_GlobalPlayer.plugins.h;
			var p_h = h;
			var p_keys = Object.keys(h);
			var p_length = p_keys.length;
			var p_current = 0;
			while(p_current < p_length) {
				var p = p_h[p_keys[p_current++]];
				if(p.active) {
					var plparse = p.parseInt(str);
					if(plparse.found) {
						return plparse.value;
					}
				}
			}
			if(HxOverrides.substr(str,0,10) == "#_INSTANCE") {
				var arstr = str.split(":");
				if(arstr.length == 2) {
					switch(arstr[0]) {
					case "#_INSTANCEALPHA":
						return Math.round(com_tilbuci_data_GlobalPlayer.area.instanceProp(this.parseString(arstr[1]),"alpha"));
					case "#_INSTANCECOLORALPHA":
						return Math.round(com_tilbuci_data_GlobalPlayer.area.instanceProp(this.parseString(arstr[1]),"colorAlpha"));
					case "#_INSTANCEFONTLEADING":
						return Math.round(com_tilbuci_data_GlobalPlayer.area.instanceProp(this.parseString(arstr[1]),"fontLeading"));
					case "#_INSTANCEFONTSIZE":
						return Math.round(com_tilbuci_data_GlobalPlayer.area.instanceProp(this.parseString(arstr[1]),"fontSize"));
					case "#_INSTANCEFONTSPACING":
						return Math.round(com_tilbuci_data_GlobalPlayer.area.instanceProp(this.parseString(arstr[1]),"fontSpacing"));
					case "#_INSTANCEHEIGHT":
						return Math.round(com_tilbuci_data_GlobalPlayer.area.instanceProp(this.parseString(arstr[1]),"height"));
					case "#_INSTANCEORDER":
						return Math.round(com_tilbuci_data_GlobalPlayer.area.instanceProp(this.parseString(arstr[1]),"order"));
					case "#_INSTANCEPAN":
						return Math.round(com_tilbuci_data_GlobalPlayer.area.instanceProp(this.parseString(arstr[1]),"pan"));
					case "#_INSTANCEROTATION":
						return Math.round(com_tilbuci_data_GlobalPlayer.area.instanceProp(this.parseString(arstr[1]),"rotation"));
					case "#_INSTANCEVOLUME":
						return Math.round(com_tilbuci_data_GlobalPlayer.area.instanceProp(this.parseString(arstr[1]),"volume"));
					case "#_INSTANCEWIDTH":
						return Math.round(com_tilbuci_data_GlobalPlayer.area.instanceProp(this.parseString(arstr[1]),"width"));
					case "#_INSTANCEX":
						return Math.round(com_tilbuci_data_GlobalPlayer.area.instanceProp(this.parseString(arstr[1]),"x"));
					case "#_INSTANCEY":
						return Math.round(com_tilbuci_data_GlobalPlayer.area.instanceProp(this.parseString(arstr[1]),"y"));
					default:
						return 0;
					}
				} else {
					return 0;
				}
			} else if(HxOverrides.substr(str,0,15) == "#_INVCONSUMABLE") {
				var arstr = str.split(":");
				if(arstr.length == 2) {
					return com_tilbuci_data_GlobalPlayer.narrative.consumableAmount(this.parseString(arstr[1]));
				} else {
					return 0;
				}
			} else if(HxOverrides.substr(str,0,9) == "#_NUMERIC") {
				var arstr = str.split(":");
				if(arstr.length == 2) {
					return com_tilbuci_data_GlobalPlayer.area.getNumericValue(this.parseString(arstr[1]));
				} else {
					return 0;
				}
			} else if(HxOverrides.substr(str,0,9) == "#_NUMBERS") {
				var arstr = str.split(":");
				if(arstr.length == 2) {
					var this1 = com_tilbuci_data_GlobalPlayer.mdata.numbers;
					var key = this.parseString(arstr[1]);
					if(Object.prototype.hasOwnProperty.call(this1.h,key)) {
						var this1 = com_tilbuci_data_GlobalPlayer.mdata.numbers;
						var key = this.parseString(arstr[1]);
						return Math.round(this1.h[key]);
					} else {
						return 0;
					}
				} else {
					return 0;
				}
			} else {
				switch(str) {
				case "#_AREABIG":
					return com_tilbuci_data_GlobalPlayer.mdata.screen.big;
				case "#_AREASMALL":
					return com_tilbuci_data_GlobalPlayer.mdata.screen.small;
				case "#_CONTENTHEIGHT":
					return Math.round(com_tilbuci_data_GlobalPlayer.contentHeight);
				case "#_CONTENTWIDTH":
					return Math.round(com_tilbuci_data_GlobalPlayer.contentWidth);
				case "#_CONTENTX":
					return Math.round(com_tilbuci_data_GlobalPlayer.contentPosition.x);
				case "#_CONTENTY":
					return Math.round(com_tilbuci_data_GlobalPlayer.contentPosition.y);
				case "#_KEYFRAME":
					return com_tilbuci_data_GlobalPlayer.area.get_currentKf();
				default:
					if(Object.prototype.hasOwnProperty.call(this._ints.h,HxOverrides.substr(str,1,null))) {
						return this._ints.h[HxOverrides.substr(str,1,null)];
					} else {
						return Std.parseInt(HxOverrides.substr(str,1,null));
					}
				}
			}
		} else {
			return Std.parseInt(str);
		}
	}
	,getValueObj: function(name) {
		var varname = this.parseString(name).split(":");
		if(varname.length == 2) {
			switch(varname[0]) {
			case "B":
				return { n : varname[1], t : "B", v : this.parseBool("?" + varname[1])};
			case "F":
				return { n : varname[1], t : "F", v : this.parseFloat("#" + varname[1])};
			case "I":
				return { n : varname[1], t : "I", v : this.parseInt("#" + varname[1])};
			case "S":
				return { n : varname[1], t : "S", v : this.parseString("$" + varname[1])};
			default:
				return null;
			}
		} else {
			return null;
		}
	}
	,onDataSave: function(ok,ld) {
		if(!ok) {
			if(this._acError != null) {
				this.run(this._acError,true);
			}
		} else if(ld.map.h["e"] == 0) {
			if(this._acOk != null) {
				this.run(this._acOk,true);
			}
		} else if(this._acError != null) {
			this.run(this._acError,true);
		}
	}
	,onDataLoad: function(ok,ld) {
		if(!ok) {
			if(this._acError != null) {
				this.run(this._acError,true);
			}
		} else if(ld.map.h["e"] == 0) {
			var vals = com_tilbuci_statictools_StringStatic.jsonParse(ld.map.h["values"]);
			if(vals == false) {
				if(this._acError != null) {
					this.run(this._acError,true);
				}
			} else {
				var _g = 0;
				var _g1 = Reflect.fields(vals);
				while(_g < _g1.length) {
					var i = _g1[_g];
					++_g;
					var obj = Reflect.field(vals,i);
					switch(Reflect.field(obj,"t")) {
					case "B":
						var v = Reflect.field(obj,"v");
						this._bools.h[Reflect.field(obj,"n")] = v;
						break;
					case "F":
						var v1 = Reflect.field(obj,"v");
						this._floats.h[Reflect.field(obj,"n")] = v1;
						break;
					case "I":
						var v2 = Reflect.field(obj,"v");
						this._ints.h[Reflect.field(obj,"n")] = v2;
						break;
					case "S":
						var v3 = Reflect.field(obj,"v");
						this._strings.h[Reflect.field(obj,"n")] = v3;
						break;
					}
				}
				if(this._acOk != null) {
					this.run(this._acOk,true);
				}
			}
		} else if(this._acError != null) {
			this.run(this._acError,true);
		}
	}
	,onStateLoad: function(ok,ld) {
		if(!ok) {
			if(this._acError != null) {
				this.run(this._acError,true);
			}
		} else if(ld.map.h["e"] == 0) {
			var vals = com_tilbuci_statictools_StringStatic.jsonParse(ld.map.h["values"]);
			if(vals == false) {
				if(this._acError != null) {
					this.run(this._acError,true);
				}
			} else {
				var _g = 0;
				var _g1 = Reflect.fields(vals);
				while(_g < _g1.length) {
					var i = _g1[_g];
					++_g;
					var obj = Reflect.field(vals,i);
					switch(Reflect.field(obj,"t")) {
					case "B":
						var v = Reflect.field(obj,"v");
						this._bools.h[Reflect.field(obj,"n")] = v;
						break;
					case "F":
						var v1 = Reflect.field(obj,"v");
						this._floats.h[Reflect.field(obj,"n")] = v1;
						break;
					case "I":
						var v2 = Reflect.field(obj,"v");
						this._ints.h[Reflect.field(obj,"n")] = v2;
						break;
					case "S":
						var v3 = Reflect.field(obj,"v");
						this._strings.h[Reflect.field(obj,"n")] = v3;
						break;
					}
				}
				if(this._acOk != null) {
					this.run(this._acOk,true);
				}
			}
		} else if(this._acError != null) {
			this.run(this._acError,true);
		}
	}
	,onDragMove: function(evt) {
		if(this.onDrag != null) {
			var localpt = this.onDrag.parent.globalToLocal(new openfl_geom_Point(evt.stageX,evt.stageY));
			var px = Math.round(localpt.x - this.onDrag.lastClick.x);
			var py = Math.round(localpt.y - this.onDrag.lastClick.y);
			com_tilbuci_data_GlobalPlayer.area.setProperty(this.onDrag.getInstName(),"x",px,px);
			com_tilbuci_data_GlobalPlayer.area.setProperty(this.onDrag.getInstName(),"y",py,py);
		}
	}
	,onDragMoveStop: function(evt) {
		this.onDrag = null;
		if(com_tilbuci_data_GlobalPlayer.area.hasEventListener("mouseMove")) {
			com_tilbuci_data_GlobalPlayer.area.removeEventListener("mouseMove",$bind(this,this.onDragMove));
		}
		if(com_tilbuci_data_GlobalPlayer.area.stage.hasEventListener("mouseUp")) {
			com_tilbuci_data_GlobalPlayer.area.stage.removeEventListener("mouseUp",$bind(this,this.onDragMoveStop));
		}
		if(this._acOk != null) {
			this.run(this._acOk,true);
		}
		this._acOk = null;
	}
	,onDataEvent: function(ok,ld) {
		var hold = false;
		var eventheld = [];
		try {
			var eventData = openfl_net_SharedObject.getLocal(com_tilbuci_data_GlobalPlayer.movie.get_mvId() + "_eventsheld");
			var _g = 0;
			var _g1 = Reflect.fields(eventData.data.events);
			while(_g < _g1.length) {
				var k = _g1[_g];
				++_g;
				eventheld.push(Reflect.field(eventData.data.events,k));
			}
			eventData.close();
		} catch( _g ) {
		}
		if(!ok) {
			if(Object.prototype.hasOwnProperty.call(this._lastEvent.h,"name")) {
				hold = true;
			}
		} else if(ld.map.h["e"] != 0) {
			if(Object.prototype.hasOwnProperty.call(this._lastEvent.h,"name")) {
				hold = true;
			}
		} else if(eventheld.length > 0) {
			if(!Object.prototype.hasOwnProperty.call(this._lastEvent.h,"name")) {
				eventheld.shift();
			}
			if(eventheld.length > 0) {
				com_tilbuci_data_GlobalPlayer.ws.send("Visitor/Event",eventheld[0],$bind(this,this.onDataEvent));
			}
		}
		if(hold) {
			eventheld.push(this._lastEvent);
			while(eventheld.length > 100) eventheld.shift();
			try {
				var eventData = openfl_net_SharedObject.getLocal(com_tilbuci_data_GlobalPlayer.movie.get_mvId() + "_eventsheld");
				eventData.data.events = eventheld;
				eventData.flush();
				eventData.close();
			} catch( _g ) {
			}
		}
		this._lastEvent = new haxe_ds_StringMap();
	}
	,__class__: com_tilbuci_script_ScriptParser
};
var com_tilbuci_statictools_SpriteStatic = function() { };
$hxClasses["com.tilbuci.statictools.SpriteStatic"] = com_tilbuci_statictools_SpriteStatic;
com_tilbuci_statictools_SpriteStatic.__name__ = "com.tilbuci.statictools.SpriteStatic";
com_tilbuci_statictools_SpriteStatic.shake = function(target,duration,intensity,end) {
	var originalX = target.get_x();
	var originalY = target.get_y();
	motion_Actuate.timer(duration).onUpdate(function() {
		target.set_x(originalX + (Math.random() * intensity * 2 - intensity));
		target.set_y(originalY + (Math.random() * intensity * 2 - intensity));
	}).onComplete(function() {
		target.set_x(originalX);
		target.set_y(originalY);
		if(end != null) {
			com_tilbuci_data_GlobalPlayer.parser.run(end,true);
		}
	});
};
com_tilbuci_statictools_SpriteStatic.quickJump = function(target,duration,intensity,end) {
	var originalY = target.get_y();
	motion_Actuate.tween(target,duration / 2,{ y : originalY - intensity}).ease(motion_easing_Quad.easeOut).onComplete(function() {
		motion_Actuate.tween(target,duration / 2,{ y : originalY}).ease(motion_easing_Quad.easeIn).onComplete(function() {
			if(end != null) {
				com_tilbuci_data_GlobalPlayer.parser.run(end,true);
			}
		});
	});
};
com_tilbuci_statictools_SpriteStatic.pulse = function(target,duration,intensity,iteractions,end) {
	var originalScaleX = target.get_scaleX();
	var originalScaleY = target.get_scaleY();
	var originalX = target.get_x();
	var originalY = target.get_y();
	var newX = target.get_x() - (target.get_width() * intensity - target.get_width()) / 2;
	var newY = target.get_y() - (target.get_height() * intensity - target.get_height()) / 2;
	var zoomIn = null;
	var zoomOut = null;
	var remaining = iteractions;
	duration /= 2 * iteractions;
	zoomIn = function() {
		if(remaining > 0) {
			remaining -= 1;
			motion_Actuate.tween(target,duration,{ scaleX : intensity, scaleY : intensity, x : newX, y : newY}).ease(motion_easing_Quad.easeOut).onComplete(zoomOut);
		} else if(end != null) {
			com_tilbuci_data_GlobalPlayer.parser.run(end,true);
		}
	};
	zoomOut = function() {
		motion_Actuate.tween(target,duration,{ scaleX : originalScaleX, scaleY : originalScaleY, x : originalX, y : originalY}).ease(motion_easing_Quad.easeIn).onComplete(zoomIn);
	};
	zoomIn();
};
var com_tilbuci_statictools_StringStatic = function() { };
$hxClasses["com.tilbuci.statictools.StringStatic"] = com_tilbuci_statictools_StringStatic;
com_tilbuci_statictools_StringStatic.__name__ = "com.tilbuci.statictools.StringStatic";
com_tilbuci_statictools_StringStatic.slashURL = function(url) {
	if(url.charAt(url.length - 1) == "/") {
		return url;
	} else {
		return url + "/";
	}
};
com_tilbuci_statictools_StringStatic.jsonParse = function(txt) {
	var json = null;
	try {
		json = new haxe_format_JsonParser(txt).doParse();
	} catch( _g ) {
		json = false;
	}
	return json;
};
com_tilbuci_statictools_StringStatic.jsonStringify = function(data,space) {
	return haxe_format_JsonPrinter.print(data,null,space);
};
com_tilbuci_statictools_StringStatic.jsonAsMap = function(data) {
	var map = new haxe_ds_StringMap();
	var js = com_tilbuci_statictools_StringStatic.jsonParse(data);
	if(js != false) {
		var _g = 0;
		var _g1 = Reflect.fields(js);
		while(_g < _g1.length) {
			var k = _g1[_g];
			++_g;
			var v = Reflect.field(js,k);
			map.h[k] = v;
		}
	}
	return map;
};
com_tilbuci_statictools_StringStatic.md5 = function(txt) {
	return haxe_crypto_Md5.encode(txt);
};
com_tilbuci_statictools_StringStatic.validateEmail = function(email) {
	var ereg = new EReg(".+@.+","i");
	return ereg.match(email);
};
com_tilbuci_statictools_StringStatic.stringContains = function(str,check) {
	str = str.toLowerCase();
	var has = false;
	var _g = 0;
	var _g1 = check.length;
	while(_g < _g1) {
		var n = _g++;
		if(str.indexOf(check[n].toLowerCase()) != -1) {
			has = true;
		}
	}
	return has;
};
com_tilbuci_statictools_StringStatic.encryptKey = function(txt,key,secret) {
	var bytestxt = haxe_io_Bytes.ofString(txt);
	var byteskey = haxe_io_Bytes.ofString(key);
	var aes = new haxe_crypto_Aes(byteskey,secret);
	return aes.encrypt("ctr",bytestxt,"NoPadding").toHex();
};
com_tilbuci_statictools_StringStatic.decryptKey = function(txt,key,secret) {
	var bytestxt = haxe_io_Bytes.ofHex(txt);
	var byteskey = haxe_io_Bytes.ofString(key);
	var aes = new haxe_crypto_Aes(byteskey,secret);
	return aes.decrypt("ctr",bytestxt,"NoPadding").toString();
};
com_tilbuci_statictools_StringStatic.decrypt = function(txt,key) {
	txt = HxOverrides.substr(txt,0,txt.length - 10) + HxOverrides.substr(txt,-9,null);
	txt = HxOverrides.substr(txt,2,null);
	try {
		var combined = haxe_crypto_Base64.decode(txt);
		var iv = combined.sub(0,16);
		var ciphertext = combined.sub(16,combined.length - 16);
		var keyBytes = haxe_io_Bytes.ofString(key);
		var aes = new haxe_crypto_Aes();
		aes.init(keyBytes,iv);
		var decrypted = aes.decrypt("cbc",ciphertext,"PKCS7");
		txt = decrypted.toString();
	} catch( _g ) {
		txt = "";
	}
	return txt;
};
com_tilbuci_statictools_StringStatic.encrypt = function(txt,key) {
	var aes = new haxe_crypto_Aes();
	var keyBytes = haxe_io_Bytes.ofString(key);
	var iv = haxe_io_Bytes.ofString(HxOverrides.substr(com_tilbuci_statictools_StringStatic.random(),0,16));
	aes.init(keyBytes,iv);
	var txtbytes = haxe_io_Bytes.ofString(txt);
	var combined = new haxe_io_Bytes(new ArrayBuffer(iv.length + txtbytes.length));
	combined.blit(0,iv,0,iv.length);
	combined.blit(iv.length,txtbytes,0,txtbytes.length);
	var encrypted = aes.encrypt("cbc",combined,"PKCS7");
	txt = haxe_crypto_Base64.encode(encrypted);
	txt = "TB" + HxOverrides.substr(txt,0,txt.length - 9) + "b" + HxOverrides.substr(txt,-9,null);
	return txt;
};
com_tilbuci_statictools_StringStatic.rgbToHex = function(red,green,blue) {
	var hex = "0x";
	if(red < 16) {
		hex += "0" + StringTools.hex(Math.round(red));
	} else if(red > 255) {
		hex += "FF";
	} else {
		hex += StringTools.hex(Math.round(red));
	}
	if(green < 16) {
		hex += "0" + StringTools.hex(Math.round(green));
	} else if(green > 255) {
		hex += "FF";
	} else {
		hex += StringTools.hex(Math.round(green));
	}
	if(blue < 16) {
		hex += "0" + StringTools.hex(Math.round(blue));
	} else if(blue > 255) {
		hex += "FF";
	} else {
		hex += StringTools.hex(Math.round(blue));
	}
	return hex;
};
com_tilbuci_statictools_StringStatic.colorHex = function(color,onerror) {
	if(onerror == null) {
		onerror = "#FFFFFF";
	}
	if(color == null) {
		color = onerror;
	}
	color = StringTools.replace(color,"#","0x");
	if(HxOverrides.substr(color,0,2) != "0x") {
		color = "0x" + color;
	}
	var col = Std.parseInt(color);
	if(col == null) {
		color = onerror;
	} else {
		color = "#" + StringTools.hex(col,6);
	}
	return color.toUpperCase();
};
com_tilbuci_statictools_StringStatic.colorInt = function(colorstr,onerror) {
	if(onerror == null) {
		onerror = "0xFFFFFF";
	}
	colorstr = StringTools.replace(colorstr,"#","0x");
	if(HxOverrides.substr(colorstr,0,2) != "0x" && HxOverrides.substr(colorstr,0,2) != "0X") {
		colorstr = "0x" + colorstr;
	}
	var colorint = Std.parseInt(colorstr);
	if(colorint == null) {
		colorint = Std.parseInt(onerror);
	}
	return colorint;
};
com_tilbuci_statictools_StringStatic.random = function() {
	return com_tilbuci_statictools_StringStatic.md5(Std.string(Math.random() * 100000));
};
var feathers_controls_supportClasses_BaseDividedBox = function() {
	this.__resizeDraggingSkin = null;
	this.__disabledBackgroundSkin = null;
	this.__backgroundSkin = null;
	this._xmlContent = null;
	this.layout = null;
	this._layoutResult = new feathers_layout_LayoutBoundsResult();
	this._layoutMeasurements = new feathers_layout_Measurements();
	this._ignoreChildChanges = false;
	this._displayListBypassEnabled = true;
	this._layoutItems = [];
	this.dividers = [];
	this.items = [];
	this.liveDragging = true;
	this._backgroundSkinMeasurements = null;
	this._currentBackgroundSkin = null;
	this._autoSizeMode = feathers_layout_AutoSizeMode.CONTENT;
	this._resizingDividerIndex = -1;
	this._resizingTouchPointIsMouse = false;
	this._resizingTouchPointID = null;
	feathers_core_FeathersControl.call(this);
	this.addEventListener("addedToStage",$bind(this,this.baseDividedBox_addedToStageHandler));
};
$hxClasses["feathers.controls.supportClasses.BaseDividedBox"] = feathers_controls_supportClasses_BaseDividedBox;
feathers_controls_supportClasses_BaseDividedBox.__name__ = "feathers.controls.supportClasses.BaseDividedBox";
feathers_controls_supportClasses_BaseDividedBox.__super__ = feathers_core_FeathersControl;
feathers_controls_supportClasses_BaseDividedBox.prototype = $extend(feathers_core_FeathersControl.prototype,{
	resizeCursor: null
	,_oldDividerMouseCursor: null
	,_resizingTouchPointID: null
	,_resizingTouchPointIsMouse: null
	,_resizingDividerIndex: null
	,_autoSizeMode: null
	,get_autoSizeMode: function() {
		return this._autoSizeMode;
	}
	,set_autoSizeMode: function(value) {
		if(this._autoSizeMode == value) {
			return this._autoSizeMode;
		}
		this._autoSizeMode = value;
		this.setInvalid(feathers_core_InvalidationFlag.SIZE);
		if(this.stage != null) {
			if(this._autoSizeMode == feathers_layout_AutoSizeMode.STAGE) {
				this.stage.addEventListener("resize",$bind(this,this.baseDividedBox_stage_resizeHandler));
				this.addEventListener("removedFromStage",$bind(this,this.baseDividedBox_removedFromStageHandler));
			} else {
				this.stage.removeEventListener("resize",$bind(this,this.baseDividedBox_stage_resizeHandler));
				this.removeEventListener("removedFromStage",$bind(this,this.baseDividedBox_removedFromStageHandler));
			}
		}
		return this._autoSizeMode;
	}
	,_currentBackgroundSkin: null
	,_backgroundSkinMeasurements: null
	,_currentResizeDraggingSkin: null
	,liveDragging: null
	,_dividerFactory: null
	,get_dividerFactory: function() {
		return this._dividerFactory;
	}
	,set_dividerFactory: function(value) {
		if(this._dividerFactory == value) {
			return this._dividerFactory;
		}
		if(this.items.length > 1) {
			var _g = 1;
			var _g1 = this.items.length;
			while(_g < _g1) {
				var i = _g++;
				var layoutIndex = i * 2;
				var childIndex = layoutIndex + (this._currentBackgroundSkin != null ? 1 : 0);
				var oldDivider = this.removeRawChildAt(childIndex - 1);
				this.destroyDivider(js_Boot.__cast(oldDivider , openfl_display_InteractiveObject),this._dividerFactory);
			}
		}
		this._dividerFactory = value;
		if(this.items.length > 1) {
			var _g = 1;
			var _g1 = this.items.length;
			while(_g < _g1) {
				var i = _g++;
				var layoutIndex = i * 2;
				var childIndex = layoutIndex + (this._currentBackgroundSkin != null ? 1 : 0);
				var newDivider = this.createDivider();
				this.addRawChildAt(newDivider,childIndex - 1);
				this.dividers[i - 1] = newDivider;
				this._layoutItems[layoutIndex - 1] = newDivider;
			}
		}
		this.setInvalid(feathers_core_InvalidationFlag.LAYOUT);
		return this._dividerFactory;
	}
	,items: null
	,dividers: null
	,_layoutItems: null
	,_displayListBypassEnabled: null
	,_ignoreChildChanges: null
	,_layoutMeasurements: null
	,_layoutResult: null
	,layout: null
	,_xmlContent: null
	,get_xmlContent: function() {
		return this._xmlContent;
	}
	,set_xmlContent: function(value) {
		if(this._xmlContent == value) {
			return this._xmlContent;
		}
		if(this._xmlContent != null) {
			var _g = 0;
			var _g1 = this._xmlContent;
			while(_g < _g1.length) {
				var child = _g1[_g];
				++_g;
				this.removeChild(child);
			}
		}
		this._xmlContent = value;
		if(this._xmlContent != null) {
			var _g = 0;
			var _g1 = this._xmlContent;
			while(_g < _g1.length) {
				var child = _g1[_g];
				++_g;
				this.addChild(child);
			}
		}
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this._xmlContent;
	}
	,get_numRawChildren: function() {
		var oldBypass = this._displayListBypassEnabled;
		this._displayListBypassEnabled = false;
		var result = this.get_numChildren();
		this._displayListBypassEnabled = oldBypass;
		return result;
	}
	,get_numChildren: function() {
		if(!this._displayListBypassEnabled) {
			return feathers_core_FeathersControl.prototype.get_numChildren.call(this);
		}
		return this.items.length;
	}
	,addChild: function(child) {
		if(!this._displayListBypassEnabled) {
			return feathers_core_FeathersControl.prototype.addChild.call(this,child);
		}
		return this.addChildAt(child,this.items.length);
	}
	,addChildAt: function(child,index) {
		if(!this._displayListBypassEnabled) {
			return feathers_core_FeathersControl.prototype.addChildAt.call(this,child,index);
		}
		var oldIndex = this.items.indexOf(child);
		if(oldIndex == index) {
			return child;
		}
		if(oldIndex >= 0) {
			this.removeItem(child);
		}
		var result = this.addItemAt(child,index);
		child.addEventListener("resize",$bind(this,this.baseDividedBox_child_resizeHandler));
		child.addEventListener("layoutDataChange",$bind(this,this.baseDividedBox_child_layoutDataChangeHandler));
		this.setInvalid(feathers_core_InvalidationFlag.LAYOUT);
		return result;
	}
	,removeChild: function(child) {
		if(!this._displayListBypassEnabled) {
			return feathers_core_FeathersControl.prototype.removeChild.call(this,child);
		}
		if(child == null || child.parent != this) {
			return child;
		}
		var result = this.removeItem(child);
		child.removeEventListener("resize",$bind(this,this.baseDividedBox_child_resizeHandler));
		child.removeEventListener("layoutDataChange",$bind(this,this.baseDividedBox_child_layoutDataChangeHandler));
		this.setInvalid(feathers_core_InvalidationFlag.LAYOUT);
		return result;
	}
	,removeChildAt: function(index) {
		if(!this._displayListBypassEnabled) {
			return feathers_core_FeathersControl.prototype.removeChildAt.call(this,index);
		}
		return this.removeChild(this.items[index]);
	}
	,getChildAt: function(index) {
		if(!this._displayListBypassEnabled) {
			return feathers_core_FeathersControl.prototype.removeChildAt.call(this,index);
		}
		return this.items[index];
	}
	,getChildIndex: function(child) {
		if(!this._displayListBypassEnabled) {
			return feathers_core_FeathersControl.prototype.getChildIndex.call(this,child);
		}
		return this.items.indexOf(child);
	}
	,setChildIndex: function(child,index) {
		if(!this._displayListBypassEnabled) {
			feathers_core_FeathersControl.prototype.setChildIndex.call(this,child,index);
			return;
		}
		HxOverrides.remove(this.items,child);
		this.items.splice(index,0,child);
	}
	,getChildByName: function(name) {
		if(!this._displayListBypassEnabled) {
			return feathers_core_FeathersControl.prototype.getChildByName.call(this,name);
		}
		var _g = 0;
		var _g1 = this.items;
		while(_g < _g1.length) {
			var child = _g1[_g];
			++_g;
			if(child.get_name() == name) {
				return child;
			}
		}
		return null;
	}
	,removeChildren: function(beginIndex,endIndex) {
		if(endIndex == null) {
			endIndex = 2147483647;
		}
		if(beginIndex == null) {
			beginIndex = 0;
		}
		if(!this._displayListBypassEnabled) {
			feathers_core_FeathersControl.prototype.removeChildren.call(this,beginIndex,endIndex);
			return;
		}
		if(endIndex == 2147483647) {
			endIndex = this.items.length - 1;
			if(endIndex < 0) {
				return;
			}
		}
		if(beginIndex > this.items.length - 1) {
			return;
		} else if(endIndex < beginIndex || beginIndex < 0 || endIndex > this.items.length) {
			throw new openfl_errors_RangeError("The supplied index is out of bounds.");
		}
		var numRemovals = endIndex - beginIndex;
		while(numRemovals >= 0) {
			this.removeChildAt(beginIndex);
			--numRemovals;
		}
	}
	,addRawChild: function(child) {
		var oldBypass = this._displayListBypassEnabled;
		this._displayListBypassEnabled = false;
		var result = this.addChild(child);
		this._displayListBypassEnabled = oldBypass;
		return result;
	}
	,addRawChildAt: function(child,index) {
		var oldBypass = this._displayListBypassEnabled;
		this._displayListBypassEnabled = false;
		var result = this.addChildAt(child,index);
		this._displayListBypassEnabled = oldBypass;
		return result;
	}
	,removeRawChild: function(child) {
		var oldBypass = this._displayListBypassEnabled;
		this._displayListBypassEnabled = false;
		var result = this.removeChild(child);
		this._displayListBypassEnabled = oldBypass;
		return result;
	}
	,removeRawChildAt: function(index) {
		var oldBypass = this._displayListBypassEnabled;
		this._displayListBypassEnabled = false;
		var result = this.removeChildAt(index);
		this._displayListBypassEnabled = oldBypass;
		return result;
	}
	,getRawChildByName: function(name) {
		var oldBypass = this._displayListBypassEnabled;
		this._displayListBypassEnabled = false;
		var result = this.getChildByName(name);
		this._displayListBypassEnabled = oldBypass;
		return result;
	}
	,getRawChildAt: function(index) {
		var oldBypass = this._displayListBypassEnabled;
		this._displayListBypassEnabled = false;
		var result = this.getChildAt(index);
		this._displayListBypassEnabled = oldBypass;
		return result;
	}
	,getRawChildIndex: function(child) {
		var oldBypass = this._displayListBypassEnabled;
		this._displayListBypassEnabled = false;
		var result = this.getChildIndex(child);
		this._displayListBypassEnabled = oldBypass;
		return result;
	}
	,setRawChildIndex: function(child,index) {
		var oldBypass = this._displayListBypassEnabled;
		this._displayListBypassEnabled = false;
		this.setChildIndex(child,index);
		this._displayListBypassEnabled = oldBypass;
	}
	,removeRawChildren: function(beginIndex,endIndex) {
		if(endIndex == null) {
			endIndex = 2147483647;
		}
		if(beginIndex == null) {
			beginIndex = 0;
		}
		var oldBypass = this._displayListBypassEnabled;
		this._displayListBypassEnabled = false;
		this.removeChildren(beginIndex,endIndex);
		this._displayListBypassEnabled = oldBypass;
	}
	,addItemAt: function(child,index) {
		this.items.splice(index,0,child);
		var layoutIndex = index * 2;
		var childIndex = layoutIndex + (this._currentBackgroundSkin != null ? 1 : 0);
		if(index != 0) {
			var divider = this.createDivider();
			feathers_core_FeathersControl.prototype.addChildAt.call(this,divider,childIndex - 1);
			this.dividers.splice(index - 1,0,divider);
			this._layoutItems.splice(layoutIndex - 1,0,divider);
		}
		this._layoutItems.splice(layoutIndex,0,child);
		return feathers_core_FeathersControl.prototype.addChildAt.call(this,child,childIndex);
	}
	,removeItem: function(child) {
		HxOverrides.remove(this.items,child);
		var index = this.getRawChildIndex(child);
		if(index != 0) {
			var divider = feathers_core_FeathersControl.prototype.getChildAt.call(this,index - 1);
			this.dividers.splice(index - 1,1);
			HxOverrides.remove(this._layoutItems,divider);
			this.destroyDivider(js_Boot.__cast(divider , openfl_display_InteractiveObject),this._dividerFactory);
		}
		HxOverrides.remove(this._layoutItems,child);
		return feathers_core_FeathersControl.prototype.removeChild.call(this,child);
	}
	,update: function() {
		var stateInvalid = this.isInvalid(feathers_core_InvalidationFlag.STATE);
		var stylesInvalid = this.isInvalid(feathers_core_InvalidationFlag.STYLES);
		if(stylesInvalid || stateInvalid) {
			this.refreshBackgroundSkin();
		}
		if(stylesInvalid || stateInvalid) {
			this.refreshResizeDraggingSkin();
		}
		this.refreshViewPortBounds();
		this.handleLayout();
		this.handleLayoutResult();
		this.refreshBackgroundLayout();
		this.validateChildren();
	}
	,refreshBackgroundSkin: function() {
		var oldSkin = this._currentBackgroundSkin;
		this._currentBackgroundSkin = this.getCurrentBackgroundSkin();
		if(this._currentBackgroundSkin == oldSkin) {
			return;
		}
		this.removeCurrentBackgroundSkin(oldSkin);
		this.addCurrentBackgroundSkin(this._currentBackgroundSkin);
	}
	,getCurrentBackgroundSkin: function() {
		if(!this._enabled && this.get_disabledBackgroundSkin() != null) {
			return this.get_disabledBackgroundSkin();
		}
		return this.get_backgroundSkin();
	}
	,addCurrentBackgroundSkin: function(skin) {
		if(skin == null) {
			this._backgroundSkinMeasurements = null;
			return;
		}
		if(js_Boot.__implements(skin,feathers_core_IUIControl)) {
			skin.initializeNow();
		}
		if(this._backgroundSkinMeasurements == null) {
			this._backgroundSkinMeasurements = new feathers_layout_Measurements(skin);
		} else {
			this._backgroundSkinMeasurements.save(skin);
		}
		if(js_Boot.__implements(skin,feathers_skins_IProgrammaticSkin)) {
			skin.set_uiContext(this);
		}
		this.addRawChildAt(skin,0);
	}
	,removeCurrentBackgroundSkin: function(skin) {
		if(skin == null) {
			return;
		}
		if(js_Boot.__implements(skin,feathers_skins_IProgrammaticSkin)) {
			skin.set_uiContext(null);
		}
		this._backgroundSkinMeasurements.restore(skin);
		if(skin.parent == this) {
			this.removeRawChild(skin);
		}
	}
	,refreshResizeDraggingSkin: function() {
		var oldSkin = this._currentResizeDraggingSkin;
		this._currentResizeDraggingSkin = this.getCurrentResizeDraggingSkin();
		if(this._currentResizeDraggingSkin == oldSkin) {
			return;
		}
		this.removeCurrentResizeDraggingSkin(oldSkin);
		if(this._currentResizeDraggingSkin == null) {
			return;
		}
		if(js_Boot.__implements(this._currentResizeDraggingSkin,feathers_core_IUIControl)) {
			this._currentResizeDraggingSkin.initializeNow();
		}
		if(js_Boot.__implements(this._currentResizeDraggingSkin,feathers_skins_IProgrammaticSkin)) {
			this._currentResizeDraggingSkin.set_uiContext(this);
		}
		this._currentResizeDraggingSkin.set_visible(false);
		if(((this._currentResizeDraggingSkin) instanceof openfl_display_InteractiveObject)) {
			this._currentResizeDraggingSkin.mouseEnabled = false;
		}
		if(((this._currentResizeDraggingSkin) instanceof openfl_display_DisplayObjectContainer)) {
			this._currentResizeDraggingSkin.mouseChildren = false;
		}
		this.addRawChild(this._currentResizeDraggingSkin);
	}
	,getCurrentResizeDraggingSkin: function() {
		return this.get_resizeDraggingSkin();
	}
	,removeCurrentResizeDraggingSkin: function(skin) {
		if(skin == null) {
			return;
		}
		if(js_Boot.__implements(skin,feathers_skins_IProgrammaticSkin)) {
			skin.set_uiContext(null);
		}
		if(skin.parent == this) {
			this.removeRawChild(skin);
		}
	}
	,createDivider: function() {
		var dividerFactory = this._dividerFactory != null ? this._dividerFactory : feathers_controls_supportClasses_BaseDividedBox.defaultDividerFactory;
		var divider = dividerFactory.create();
		divider.addEventListener("rollOver",$bind(this,this.baseDividedBox_divider_rollOverHandler));
		divider.addEventListener("rollOut",$bind(this,this.baseDividedBox_divider_rollOutHandler));
		divider.addEventListener("mouseDown",$bind(this,this.baseDividedBox_divider_mouseDownHandler));
		divider.addEventListener("touchBegin",$bind(this,this.baseDividedBox_divider_touchBeginHandler));
		return divider;
	}
	,destroyDivider: function(divider,factory) {
		divider.removeEventListener("rollOver",$bind(this,this.baseDividedBox_divider_rollOverHandler));
		divider.removeEventListener("rollOut",$bind(this,this.baseDividedBox_divider_rollOutHandler));
		divider.removeEventListener("mouseDown",$bind(this,this.baseDividedBox_divider_mouseDownHandler));
		divider.removeEventListener("touchBegin",$bind(this,this.baseDividedBox_divider_touchBeginHandler));
		if(factory != null && factory.destroy != null) {
			factory.destroy(divider);
		}
	}
	,refreshViewPortBounds: function() {
		var needsWidth = this.get_explicitWidth() == null;
		var needsHeight = this.get_explicitHeight() == null;
		var needsMinWidth = this.get_explicitMinWidth() == null;
		var needsMinHeight = this.get_explicitMinHeight() == null;
		var needsMaxWidth = this.get_explicitMaxWidth() == null;
		var needsMaxHeight = this.get_explicitMaxHeight() == null;
		if(this._currentBackgroundSkin != null) {
			feathers_utils_MeasurementsUtil.resetFluidlyWithParent(this._backgroundSkinMeasurements,this._currentBackgroundSkin,this);
			if(js_Boot.__implements(this._currentBackgroundSkin,feathers_core_IValidating)) {
				this._currentBackgroundSkin.validateNow();
			}
		}
		var needsToMeasureContent = this._autoSizeMode == feathers_layout_AutoSizeMode.CONTENT || this.stage == null;
		var stageWidth = 0.0;
		var stageHeight = 0.0;
		if(!needsToMeasureContent) {
			var topLeft = this.globalToLocal(new openfl_geom_Point());
			var bottomRight = this.globalToLocal(new openfl_geom_Point(this.stage.stageWidth,this.stage.stageHeight));
			stageWidth = bottomRight.x - topLeft.x;
			stageHeight = bottomRight.y - topLeft.y;
		}
		if(needsWidth && !needsToMeasureContent) {
			this._layoutMeasurements.width = stageWidth;
		} else {
			this._layoutMeasurements.width = this.get_explicitWidth();
		}
		if(needsHeight && !needsToMeasureContent) {
			this._layoutMeasurements.height = stageHeight;
		} else {
			this._layoutMeasurements.height = this.get_explicitHeight();
		}
		var viewPortMinWidth = this.get_explicitMinWidth();
		if(needsMinWidth) {
			viewPortMinWidth = 0.0;
		}
		var viewPortMinHeight = this.get_explicitMinHeight();
		if(needsMinHeight) {
			viewPortMinHeight = 0.0;
		}
		var viewPortMaxWidth = this.get_explicitMaxWidth();
		if(needsMaxWidth) {
			viewPortMaxWidth = 1.0 / 0.0;
		}
		var viewPortMaxHeight = this.get_explicitMaxHeight();
		if(needsMaxHeight) {
			viewPortMaxHeight = 1.0 / 0.0;
		}
		if(this._backgroundSkinMeasurements != null) {
			if(this._backgroundSkinMeasurements.width != null) {
				if(this._backgroundSkinMeasurements.width > viewPortMinWidth) {
					viewPortMinWidth = this._backgroundSkinMeasurements.width;
				}
			} else if(this._backgroundSkinMeasurements.minWidth != null) {
				if(this._backgroundSkinMeasurements.minWidth > viewPortMinWidth) {
					viewPortMinWidth = this._backgroundSkinMeasurements.minWidth;
				}
			}
			if(this._backgroundSkinMeasurements.height != null) {
				if(this._backgroundSkinMeasurements.height > viewPortMinHeight) {
					viewPortMinHeight = this._backgroundSkinMeasurements.height;
				}
			} else if(this._backgroundSkinMeasurements.minHeight != null) {
				if(this._backgroundSkinMeasurements.minHeight > viewPortMinHeight) {
					viewPortMinHeight = this._backgroundSkinMeasurements.minHeight;
				}
			}
		}
		this._layoutMeasurements.minWidth = viewPortMinWidth;
		this._layoutMeasurements.minHeight = viewPortMinHeight;
		this._layoutMeasurements.maxWidth = viewPortMaxWidth;
		this._layoutMeasurements.maxHeight = viewPortMaxHeight;
	}
	,handleLayout: function() {
		var oldIgnoreChildChanges = this._ignoreChildChanges;
		this._ignoreChildChanges = true;
		this._layoutResult.reset();
		var index0Included = true;
		var i = 0;
		while(i < this._layoutItems.length) {
			var item = this.items[i];
			var divider = null;
			if(i > 0) {
				divider = this.dividers[i - 1];
			}
			if(js_Boot.__implements(item,feathers_layout_ILayoutObject) && !item.get_includeInLayout()) {
				if(i == 0) {
					index0Included = false;
				}
				if(divider != null) {
					divider.set_visible(false);
				}
				i += 2;
				continue;
			}
			if(divider != null) {
				divider.set_visible(i > 2 || index0Included);
			}
			i += 2;
		}
		this.layout.layout(this._layoutItems,this._layoutMeasurements,this._layoutResult);
		this._ignoreChildChanges = oldIgnoreChildChanges;
	}
	,handleLayoutResult: function() {
		var viewPortWidth = this._layoutResult.viewPortWidth;
		var viewPortHeight = this._layoutResult.viewPortHeight;
		this.saveMeasurements(viewPortWidth,viewPortHeight,viewPortWidth,viewPortHeight);
	}
	,refreshBackgroundLayout: function() {
		if(this._currentBackgroundSkin == null) {
			return;
		}
		this._currentBackgroundSkin.set_x(0.0);
		this._currentBackgroundSkin.set_y(0.0);
		if(this._currentBackgroundSkin.get_width() != this.actualWidth) {
			this._currentBackgroundSkin.set_width(this.actualWidth);
		}
		if(this._currentBackgroundSkin.get_height() != this.actualHeight) {
			this._currentBackgroundSkin.set_height(this.actualHeight);
		}
		if(js_Boot.__implements(this._currentBackgroundSkin,feathers_core_IValidating)) {
			this._currentBackgroundSkin.validateNow();
		}
	}
	,validateChildren: function() {
		var _g = 0;
		var _g1 = this._layoutItems;
		while(_g < _g1.length) {
			var layoutItem = _g1[_g];
			++_g;
			if(js_Boot.__implements(layoutItem,feathers_core_IValidating)) {
				layoutItem.validateNow();
			}
		}
	}
	,prepareResize: function(dividerIndex,stageX,stageY) {
		var c = js_Boot.getClass(this);
		throw new openfl_errors_TypeError("Missing override for 'prepareResize' in type " + c.__name__);
	}
	,commitResize: function(dividerIndex,stageX,stageY,live) {
		var c = js_Boot.getClass(this);
		throw new openfl_errors_TypeError("Missing override for 'commitResize' in type " + c.__name__);
	}
	,resizeTouchBegin: function(touchPointID,isMouse,divider,stageX,stageY) {
		if(!this._enabled || this._resizingDividerIndex != -1 || this.stage == null) {
			return;
		}
		var exclusivePointer = feathers_utils_ExclusivePointer.forStage(this.stage);
		var result = false;
		if(isMouse) {
			result = exclusivePointer.claimMouse(divider);
		} else {
			result = exclusivePointer.claimTouch(touchPointID,divider);
		}
		if(!result) {
			return;
		}
		this._resizingTouchPointID = touchPointID;
		this._resizingTouchPointIsMouse = isMouse;
		this._resizingDividerIndex = this.dividers.indexOf(divider);
		this.prepareResize(this._resizingDividerIndex,stageX,stageY);
		if(!this.liveDragging && this._currentResizeDraggingSkin != null) {
			this._currentResizeDraggingSkin.set_visible(true);
		}
		if(isMouse) {
			this.stage.addEventListener("mouseMove",$bind(this,this.baseDividedBox_divider_stage_mouseMoveHandler),false,0,true);
			this.stage.addEventListener("mouseUp",$bind(this,this.baseDividedBox_divider_stage_mouseUpHandler),false,0,true);
		} else {
			this.stage.addEventListener("touchMove",$bind(this,this.baseDividedBox_divider_stage_touchMoveHandler),false,0,true);
			this.stage.addEventListener("touchEnd",$bind(this,this.baseDividedBox_divider_stage_touchEndHandler),false,0,true);
		}
	}
	,resizeTouchMove: function(touchPointID,isMouse,stageX,stageY) {
		if(this._resizingTouchPointID == null || this._resizingTouchPointID != touchPointID || this._resizingTouchPointIsMouse != isMouse) {
			return;
		}
		this.commitResize(this._resizingDividerIndex,stageX,stageY,true);
	}
	,resizeTouchEnd: function(touchPointID,isMouse,stageX,stageY) {
		if(this._resizingTouchPointID == null || this._resizingTouchPointID != touchPointID || this._resizingTouchPointIsMouse != isMouse) {
			return;
		}
		if(isMouse) {
			this.stage.removeEventListener("mouseMove",$bind(this,this.baseDividedBox_divider_stage_mouseMoveHandler));
			this.stage.removeEventListener("mouseUp",$bind(this,this.baseDividedBox_divider_stage_mouseUpHandler));
		} else {
			this.stage.removeEventListener("touchMove",$bind(this,this.baseDividedBox_divider_stage_touchMoveHandler));
			this.stage.removeEventListener("touchEnd",$bind(this,this.baseDividedBox_divider_stage_touchEndHandler));
		}
		if(!this.liveDragging) {
			this.commitResize(this._resizingDividerIndex,stageX,stageY,false);
		}
		if(this._currentResizeDraggingSkin != null) {
			this._currentResizeDraggingSkin.set_visible(false);
		}
		this._resizingTouchPointID = null;
		this._resizingTouchPointIsMouse = false;
		this._resizingDividerIndex = -1;
		if(this._oldDividerMouseCursor != null) {
			openfl_ui_Mouse.set_cursor(this._oldDividerMouseCursor);
			this._oldDividerMouseCursor = null;
		}
	}
	,baseDividedBox_child_resizeHandler: function(event) {
		if(this._ignoreChildChanges) {
			return;
		}
		this.setInvalid(feathers_core_InvalidationFlag.LAYOUT);
	}
	,baseDividedBox_child_layoutDataChangeHandler: function(event) {
		if(this._ignoreChildChanges) {
			return;
		}
		this.setInvalid(feathers_core_InvalidationFlag.LAYOUT);
	}
	,baseDividedBox_addedToStageHandler: function(event) {
		if(this._autoSizeMode == feathers_layout_AutoSizeMode.STAGE) {
			this.setInvalid(feathers_core_InvalidationFlag.SIZE);
			this.stage.addEventListener("resize",$bind(this,this.baseDividedBox_stage_resizeHandler));
			this.addEventListener("removedFromStage",$bind(this,this.baseDividedBox_removedFromStageHandler));
		}
	}
	,baseDividedBox_removedFromStageHandler: function(event) {
		this.removeEventListener("removedFromStage",$bind(this,this.baseDividedBox_removedFromStageHandler));
		this.stage.removeEventListener("resize",$bind(this,this.baseDividedBox_stage_resizeHandler));
	}
	,baseDividedBox_stage_resizeHandler: function(event) {
		this.setInvalid(feathers_core_InvalidationFlag.SIZE);
	}
	,baseDividedBox_divider_rollOverHandler: function(event) {
		if(!this._enabled || this._resizingDividerIndex != -1 || openfl_ui_Mouse.get_cursor() != "auto") {
			return;
		}
		this._oldDividerMouseCursor = openfl_ui_Mouse.get_cursor();
		openfl_ui_Mouse.set_cursor(this.resizeCursor);
	}
	,baseDividedBox_divider_rollOutHandler: function(event) {
		if(!this._enabled || this._resizingDividerIndex != -1 || this._oldDividerMouseCursor == null) {
			return;
		}
		openfl_ui_Mouse.set_cursor(this._oldDividerMouseCursor);
		this._oldDividerMouseCursor = null;
	}
	,baseDividedBox_divider_mouseDownHandler: function(event) {
		var divider = js_Boot.__cast(event.currentTarget , openfl_display_InteractiveObject);
		this.resizeTouchBegin(feathers_controls_supportClasses_BaseDividedBox.POINTER_ID_MOUSE,true,divider,this.stage.get_mouseX(),this.stage.get_mouseY());
	}
	,baseDividedBox_divider_stage_mouseMoveHandler: function(event) {
		var stage = js_Boot.__cast(event.currentTarget , openfl_display_Stage);
		this.resizeTouchMove(feathers_controls_supportClasses_BaseDividedBox.POINTER_ID_MOUSE,true,stage.get_mouseX(),stage.get_mouseY());
	}
	,baseDividedBox_divider_stage_mouseUpHandler: function(event) {
		var stage = js_Boot.__cast(event.currentTarget , openfl_display_Stage);
		this.resizeTouchEnd(feathers_controls_supportClasses_BaseDividedBox.POINTER_ID_MOUSE,true,stage.get_mouseX(),stage.get_mouseY());
	}
	,baseDividedBox_divider_touchBeginHandler: function(event) {
		if(event.isPrimaryTouchPoint) {
			return;
		}
		var divider = js_Boot.__cast(event.currentTarget , openfl_display_InteractiveObject);
		this.resizeTouchBegin(event.touchPointID,false,divider,event.stageX,event.stageY);
	}
	,baseDividedBox_divider_stage_touchMoveHandler: function(event) {
		this.resizeTouchMove(event.touchPointID,false,event.stageX,event.stageY);
	}
	,baseDividedBox_divider_stage_touchEndHandler: function(event) {
		this.resizeTouchEnd(event.touchPointID,false,event.stageX,event.stageY);
	}
	,__backgroundSkin: null
	,get_backgroundSkin: function() {
		return this.__backgroundSkin;
	}
	,set_backgroundSkin: function(value) {
		if(!this.setStyle("backgroundSkin")) {
			return this.__backgroundSkin;
		}
		if(this.__backgroundSkin == value) {
			return this.__backgroundSkin;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_backgroundSkin);
		this.__backgroundSkin = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__backgroundSkin;
	}
	,clearStyle_backgroundSkin: function() {
		this.set_backgroundSkin(null);
		return this.get_backgroundSkin();
	}
	,__disabledBackgroundSkin: null
	,get_disabledBackgroundSkin: function() {
		return this.__disabledBackgroundSkin;
	}
	,set_disabledBackgroundSkin: function(value) {
		if(!this.setStyle("disabledBackgroundSkin")) {
			return this.__disabledBackgroundSkin;
		}
		if(this.__disabledBackgroundSkin == value) {
			return this.__disabledBackgroundSkin;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_disabledBackgroundSkin);
		this.__disabledBackgroundSkin = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__disabledBackgroundSkin;
	}
	,clearStyle_disabledBackgroundSkin: function() {
		this.set_disabledBackgroundSkin(null);
		return this.get_disabledBackgroundSkin();
	}
	,__resizeDraggingSkin: null
	,get_resizeDraggingSkin: function() {
		return this.__resizeDraggingSkin;
	}
	,set_resizeDraggingSkin: function(value) {
		if(!this.setStyle("resizeDraggingSkin")) {
			return this.__resizeDraggingSkin;
		}
		if(this.__resizeDraggingSkin == value) {
			return this.__resizeDraggingSkin;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_resizeDraggingSkin);
		this.__resizeDraggingSkin = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__resizeDraggingSkin;
	}
	,clearStyle_resizeDraggingSkin: function() {
		this.set_resizeDraggingSkin(null);
		return this.get_resizeDraggingSkin();
	}
	,__class__: feathers_controls_supportClasses_BaseDividedBox
	,__properties__: $extend(feathers_core_FeathersControl.prototype.__properties__,{get_numRawChildren:"get_numRawChildren",set_xmlContent:"set_xmlContent",get_xmlContent:"get_xmlContent",set_dividerFactory:"set_dividerFactory",get_dividerFactory:"get_dividerFactory",set_resizeDraggingSkin:"set_resizeDraggingSkin",get_resizeDraggingSkin:"get_resizeDraggingSkin",set_disabledBackgroundSkin:"set_disabledBackgroundSkin",get_disabledBackgroundSkin:"get_disabledBackgroundSkin",set_backgroundSkin:"set_backgroundSkin",get_backgroundSkin:"get_backgroundSkin",set_autoSizeMode:"set_autoSizeMode",get_autoSizeMode:"get_autoSizeMode"})
});
var feathers_controls_VDividedBox = function() {
	this._fallbackFluidIndex = -1;
	this._customItemHeights = [];
	this.initializeVDividedBoxTheme();
	feathers_controls_supportClasses_BaseDividedBox.call(this);
	this.resizeCursor = openfl_ui_MouseCursor.fromLimeCursor(lime_ui_MouseCursor.RESIZE_NS);
};
$hxClasses["feathers.controls.VDividedBox"] = feathers_controls_VDividedBox;
feathers_controls_VDividedBox.__name__ = "feathers.controls.VDividedBox";
feathers_controls_VDividedBox.__super__ = feathers_controls_supportClasses_BaseDividedBox;
feathers_controls_VDividedBox.prototype = $extend(feathers_controls_supportClasses_BaseDividedBox.prototype,{
	_vDividedBoxLayout: null
	,_customItemHeights: null
	,_fallbackFluidIndex: null
	,_resizeStartStageY: null
	,_resizeStartHeight1: null
	,_resizeStartHeight2: null
	,addItemAt: function(child,index) {
		var result = feathers_controls_supportClasses_BaseDividedBox.prototype.addItemAt.call(this,child,index);
		var explicitHeight = null;
		if(js_Boot.__implements(child,feathers_core_IMeasureObject)) {
			var measureChild = child;
			explicitHeight = measureChild.get_explicitHeight();
		}
		this._customItemHeights.splice(index,0,explicitHeight);
		var layoutIndex = this._layoutItems.indexOf(child);
		if(explicitHeight == null) {
			if(this._fallbackFluidIndex == -1 || layoutIndex > this._fallbackFluidIndex) {
				this._fallbackFluidIndex = layoutIndex;
			}
		}
		return result;
	}
	,removeItem: function(child) {
		var index = this.items.indexOf(child);
		var layoutIndex = this._layoutItems.indexOf(child);
		if(this._fallbackFluidIndex == layoutIndex) {
			this._fallbackFluidIndex = -1;
		}
		var result = feathers_controls_supportClasses_BaseDividedBox.prototype.removeItem.call(this,child);
		if(index != -1) {
			this._customItemHeights.splice(index,1);
		}
		return result;
	}
	,initializeVDividedBoxTheme: function() {
		feathers_themes_steel_components_SteelVDividedBoxStyles.initialize();
	}
	,initialize: function() {
		feathers_controls_supportClasses_BaseDividedBox.prototype.initialize.call(this);
		if(this._vDividedBoxLayout == null) {
			this._vDividedBoxLayout = new feathers_layout_VDividedBoxLayout();
		}
		this._vDividedBoxLayout.set_customItemHeights(this._customItemHeights);
		this.layout = this._vDividedBoxLayout;
	}
	,handleLayout: function() {
		var oldIgnoreChildChanges = this._ignoreChildChanges;
		this._ignoreChildChanges = true;
		this._vDividedBoxLayout.set_fallbackFluidIndex(this._fallbackFluidIndex);
		this._ignoreChildChanges = oldIgnoreChildChanges;
		feathers_controls_supportClasses_BaseDividedBox.prototype.handleLayout.call(this);
	}
	,prepareResize: function(dividerIndex,stageX,stageY) {
		this._resizeStartStageY = stageY;
		var firstItem = this.items[dividerIndex];
		var secondItem = this.items[dividerIndex + 1];
		this._resizeStartHeight1 = firstItem.get_height();
		this._resizeStartHeight2 = secondItem.get_height();
		if(this._currentResizeDraggingSkin != null) {
			var divider = this.dividers[dividerIndex];
			this._currentResizeDraggingSkin.set_x(divider.get_x());
			this._currentResizeDraggingSkin.set_width(divider.get_width());
			if(js_Boot.__implements(this._currentResizeDraggingSkin,feathers_core_IValidating)) {
				this._currentResizeDraggingSkin.validateNow();
			}
			this._currentResizeDraggingSkin.set_y(divider.get_y() + (divider.get_height() - this._currentResizeDraggingSkin.get_height()) / 2.0);
		}
	}
	,commitResize: function(dividerIndex,stageX,stageY,live) {
		var offsetY = stageY - this._resizeStartStageY;
		offsetY *= feathers_utils_DisplayUtil.getConcatenatedScaleY(this);
		if(live && !this.liveDragging) {
			if(this._currentResizeDraggingSkin != null) {
				var divider = this.dividers[dividerIndex];
				this._currentResizeDraggingSkin.set_x(divider.get_x());
				this._currentResizeDraggingSkin.set_width(divider.get_width());
				if(js_Boot.__implements(this._currentResizeDraggingSkin,feathers_core_IValidating)) {
					this._currentResizeDraggingSkin.validateNow();
				}
				this._currentResizeDraggingSkin.set_y(divider.get_y() + offsetY + (divider.get_height() - this._currentResizeDraggingSkin.get_height()) / 2.0);
			}
			return;
		}
		var firstItem = this.items[dividerIndex];
		var secondItem = this.items[dividerIndex + 1];
		var totalHeight = this._resizeStartHeight1 + this._resizeStartHeight2;
		var secondItemHeight = this._resizeStartHeight2 - offsetY;
		if(js_Boot.__implements(secondItem,feathers_core_IMeasureObject)) {
			var secondMeasureItem = secondItem;
			if(secondMeasureItem.get_explicitMinHeight() != null && secondItemHeight < secondMeasureItem.get_explicitMinHeight()) {
				secondItemHeight = secondMeasureItem.get_explicitMinHeight();
			} else if(secondMeasureItem.get_explicitMaxHeight() != null && secondItemHeight > secondMeasureItem.get_explicitMaxHeight()) {
				secondItemHeight = secondMeasureItem.get_explicitMaxHeight();
			}
		}
		if(secondItemHeight < 0.0) {
			secondItemHeight = 0.0;
		} else if(secondItemHeight > totalHeight) {
			secondItemHeight = totalHeight;
		}
		var firstItemHeight = totalHeight - secondItemHeight;
		if(js_Boot.__implements(firstItem,feathers_core_IMeasureObject)) {
			var firstMeasureItem = firstItem;
			if(firstMeasureItem.get_explicitMinHeight() != null && firstItemHeight < firstMeasureItem.get_explicitMinHeight()) {
				firstItemHeight = firstMeasureItem.get_explicitMinHeight();
			} else if(firstMeasureItem.get_explicitMaxHeight() != null && firstItemHeight > firstMeasureItem.get_explicitMaxHeight()) {
				firstItemHeight = firstMeasureItem.get_explicitMaxHeight();
			}
		}
		if(firstItemHeight < 0.0) {
			firstItemHeight = 0.0;
		} else if(firstItemHeight > totalHeight) {
			firstItemHeight = totalHeight;
		}
		secondItemHeight = totalHeight - firstItemHeight;
		this._customItemHeights[dividerIndex] = firstItemHeight;
		this._customItemHeights[dividerIndex + 1] = secondItemHeight;
		this.setInvalid(feathers_core_InvalidationFlag.LAYOUT);
	}
	,baseDividedBox_child_layoutDataChangeHandler: function(event) {
		feathers_controls_supportClasses_BaseDividedBox.prototype.baseDividedBox_child_layoutDataChangeHandler.call(this,event);
		var layoutObject = js_Boot.__cast(event.currentTarget , feathers_layout_ILayoutObject);
		var layoutIndex = this._layoutItems.indexOf(layoutObject);
		if(!layoutObject.get_includeInLayout() && this._fallbackFluidIndex == layoutIndex) {
			this._fallbackFluidIndex = -1;
		}
	}
	,baseDividedBox_child_resizeHandler: function(event) {
		if(this._ignoreChildChanges) {
			return;
		}
		var child = event.currentTarget;
		var index = this.items.indexOf(child);
		if(index == -1) {
			return;
		}
		var explicitHeight = null;
		if(js_Boot.__implements(child,feathers_core_IMeasureObject)) {
			var measureChild = child;
			explicitHeight = measureChild.get_explicitHeight();
		}
		this._customItemHeights[index] = explicitHeight;
		var layoutIndex = this._layoutItems.indexOf(child);
		if(explicitHeight == null) {
			if(this._fallbackFluidIndex == -1 || layoutIndex > this._fallbackFluidIndex) {
				this._fallbackFluidIndex = layoutIndex;
			}
		}
		this.setInvalid(feathers_core_InvalidationFlag.LAYOUT);
	}
	,__class__: feathers_controls_VDividedBox
});
var com_tilbuci_ui_PlayerControls = function(pl,ac) {
	feathers_controls_VDividedBox.call(this);
	this._ac = ac;
	this._player = pl;
	this.ui = new com_tilbuci_ui_base_InterfaceFactory();
	this.set_layoutData(feathers_layout_AnchorLayoutData.fill());
	this._scroller = new feathers_controls_ScrollContainer();
	this._scroller.set_autoHideScrollBars(false);
	this._scroller.set_fixedScrollBars(true);
	this._scroller.set_showScrollBars(true);
	this._scroller.set_layout(new feathers_layout_VerticalLayout());
	var bgSkin = new feathers_skins_RectangleSkin();
	bgSkin.set_fill(feathers_graphics_FillStyle.SolidColor(10066329));
	this._scroller.set_backgroundSkin(bgSkin);
	this.addChild(this._scroller);
	this._scroller.addChild(this._player);
	this._controls = new feathers_controls_HDividedBox();
	this._controls.set_layoutData(feathers_layout_AnchorLayoutData.fill());
	var lay = new feathers_layout_HorizontalLayout();
	lay.set_gap(10);
	lay.setPadding(10);
	this._controls.layout = lay;
	this._controls.set_backgroundSkin(bgSkin);
	this._controls.set_height(this._controls.set_maxHeight(this._controls.set_minHeight(50)));
	this.addChild(this._controls);
	var zoomArea = this.ui.createHArea("left");
	this._controls.addChild(zoomArea);
	this.ui.createIconButton("screen",$bind(this,this.onScreen),new openfl_display_Bitmap(openfl_utils_Assets.getBitmapData("btScreen")),null,zoomArea);
	this.ui.createSpacer("screen",10,false,zoomArea);
	this.ui.createIconButton("zoom+",$bind(this,this.onZoomP),new openfl_display_Bitmap(openfl_utils_Assets.getBitmapData("btZoomP")),null,zoomArea);
	this.ui.createIconButton("zoom-",$bind(this,this.onZoomM),new openfl_display_Bitmap(openfl_utils_Assets.getBitmapData("btZoomM")),null,zoomArea);
	this.ui.createIconButton("zoomfit",$bind(this,this.centerPlayer),new openfl_display_Bitmap(openfl_utils_Assets.getBitmapData("btZoomFit")),null,zoomArea);
	this.ui.createIconButton("zoom100",$bind(this,this.onZoom100),new openfl_display_Bitmap(openfl_utils_Assets.getBitmapData("btZoom100")),null,zoomArea);
	this._movieInfo = new com_tilbuci_ui_component_MovieInfoDisplay($bind(this,this.updateInfo));
	this._controls.addChild(this._movieInfo);
	var kfArea = this.ui.createHArea("right");
	this._controls.addChild(kfArea);
	this.ui.createIconButton("left",$bind(this,this.onLeft),new openfl_display_Bitmap(openfl_utils_Assets.getBitmapData("btLeft")),null,kfArea);
	this.ui.createLabel("keyframes","","",kfArea);
	this.ui.createIconButton("right",$bind(this,this.onRight),new openfl_display_Bitmap(openfl_utils_Assets.getBitmapData("btRight")),null,kfArea);
	this.ui.createSpacer("keyframe",10,false,kfArea);
	this.ui.createIconButton("actions",$bind(this,this.onActions),new openfl_display_Bitmap(openfl_utils_Assets.getBitmapData("btSetup")),null,kfArea);
	this.ui.createLabel("actions","","",kfArea);
	this.ui.createIconButton("play",$bind(this,this.onPlay),new openfl_display_Bitmap(openfl_utils_Assets.getBitmapData("btPlay")),null,kfArea);
	this.ui.buttons.h["screen"].set_toolTip(com_tilbuci_data_Global.ln.get("tooltip-playercontrols-screen"));
	this.ui.buttons.h["zoom+"].set_toolTip(com_tilbuci_data_Global.ln.get("tooltip-playercontrols-zoomp"));
	this.ui.buttons.h["zoom-"].set_toolTip(com_tilbuci_data_Global.ln.get("tooltip-playercontrols-zoomm"));
	this.ui.buttons.h["zoomfit"].set_toolTip(com_tilbuci_data_Global.ln.get("tooltip-playercontrols-zoomfit"));
	this.ui.buttons.h["zoom100"].set_toolTip(com_tilbuci_data_Global.ln.get("tooltip-playercontrols-zoom100"));
	this.ui.buttons.h["left"].set_toolTip(com_tilbuci_data_Global.ln.get("tooltip-playercontrols-left"));
	this.ui.buttons.h["right"].set_toolTip(com_tilbuci_data_Global.ln.get("tooltip-playercontrols-right"));
	this.ui.buttons.h["actions"].set_toolTip(com_tilbuci_data_Global.ln.get("tooltip-playercontrols-actions"));
	this.ui.buttons.h["play"].set_toolTip(com_tilbuci_data_Global.ln.get("tooltip-playercontrols-play"));
};
$hxClasses["com.tilbuci.ui.PlayerControls"] = com_tilbuci_ui_PlayerControls;
com_tilbuci_ui_PlayerControls.__name__ = "com.tilbuci.ui.PlayerControls";
com_tilbuci_ui_PlayerControls.__super__ = feathers_controls_VDividedBox;
com_tilbuci_ui_PlayerControls.prototype = $extend(feathers_controls_VDividedBox.prototype,{
	_ac: null
	,_controls: null
	,_scroller: null
	,_player: null
	,_movieInfo: null
	,_centerTimer: null
	,ui: null
	,updateDisplay: function() {
		this._movieInfo.onUpdate();
		this.updateInfo();
	}
	,updateInfo: function() {
		if(com_tilbuci_data_GlobalPlayer.movie.get_scId() == "") {
			this.ui.labels.h["keyframes"].set_text("");
			this.ui.buttons.h["left"].set_enabled(false);
			this.ui.buttons.h["right"].set_enabled(false);
			this.ui.buttons.h["play"].set_enabled(false);
		} else {
			this.ui.labels.h["keyframes"].set_text(com_tilbuci_data_GlobalPlayer.area.get_currentKf() + 1 + " / " + com_tilbuci_data_GlobalPlayer.movie.scene.keyframes.length);
			this.ui.buttons.h["left"].set_enabled(com_tilbuci_data_GlobalPlayer.area.get_currentKf() != 0);
			this.ui.buttons.h["right"].set_enabled(com_tilbuci_data_GlobalPlayer.area.get_currentKf() < com_tilbuci_data_GlobalPlayer.movie.scene.keyframes.length - 1);
			this.ui.buttons.h["play"].set_enabled(true);
		}
		this.ui.buttons.h["screen"].set_enabled(com_tilbuci_data_GlobalPlayer.mdata.screen.type == "both");
	}
	,centerPlayer: function(evt) {
		if(com_tilbuci_data_Global.displayType == "portrait") {
			this._player.setWidth(this.get_height() - 150);
		} else {
			this._player.setWidth(this.get_width() - 100);
		}
		this._scroller.set_scrollX(this._player.player.get_x() - 50);
		this._scroller.set_scrollY(this._player.player.get_y() - 50);
		if(this._centerTimer == null) {
			this._centerTimer = new haxe_Timer(150);
			this._centerTimer.run = $bind(this,this.reCenter);
		} else {
			try {
				this._centerTimer.stop();
			} catch( _g ) {
			}
			this._centerTimer = null;
		}
	}
	,reCenter: function() {
		if(com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[com_tilbuci_data_GlobalPlayer.area.get_currentKf()] != null) {
			com_tilbuci_data_GlobalPlayer.area.loadKeyframe(com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[com_tilbuci_data_GlobalPlayer.area.get_currentKf()],com_tilbuci_data_GlobalPlayer.area.get_currentKf());
		}
		this.centerPlayer();
	}
	,onScreen: function(evt) {
		if(com_tilbuci_data_GlobalPlayer.movie.get_mvId() != "" && com_tilbuci_data_GlobalPlayer.movie.get_scId() != "" && com_tilbuci_data_GlobalPlayer.mdata.screen.type == "both") {
			com_tilbuci_data_GlobalPlayer.area.imgSelect();
			if(com_tilbuci_data_Global.displayType == "portrait") {
				com_tilbuci_data_Global.displayType = "landscape";
			} else {
				com_tilbuci_data_Global.displayType = "portrait";
			}
			this._player.removeChild(this._player.player);
			this.centerPlayer();
			com_tilbuci_data_GlobalPlayer.area.loadKeyframe(com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[com_tilbuci_data_GlobalPlayer.area.get_currentKf()],com_tilbuci_data_GlobalPlayer.area.get_currentKf());
			this._player.addChild(this._player.player);
			this.centerPlayer();
		}
	}
	,onLeft: function(evt) {
		if(com_tilbuci_data_GlobalPlayer.area.get_currentKf() > 0) {
			com_tilbuci_data_GlobalPlayer.area.loadKeyframe(com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[com_tilbuci_data_GlobalPlayer.area.get_currentKf() - 1],com_tilbuci_data_GlobalPlayer.area.get_currentKf() - 1);
			com_tilbuci_data_Global.history.clear();
			this.updateInfo();
		}
	}
	,onRight: function(evt) {
		if(com_tilbuci_data_GlobalPlayer.area.get_currentKf() < com_tilbuci_data_GlobalPlayer.movie.scene.keyframes.length - 1) {
			com_tilbuci_data_GlobalPlayer.area.loadKeyframe(com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[com_tilbuci_data_GlobalPlayer.area.get_currentKf() + 1],com_tilbuci_data_GlobalPlayer.area.get_currentKf() + 1);
			com_tilbuci_data_Global.history.clear();
			this.updateInfo();
		}
	}
	,onActions: function(evt) {
		this._ac("testactions");
	}
	,onPlay: function(evt) {
		this._ac("play");
	}
	,onZoomP: function(evt) {
		if(com_tilbuci_data_Global.displayType == "portrait") {
			this._player.setWidth(this._player.player.get_rHeight() * 1.1);
		} else {
			this._player.setWidth(this._player.player.get_rWidth() * 1.1);
		}
	}
	,onZoomM: function(evt) {
		if(com_tilbuci_data_Global.displayType == "portrait") {
			this._player.setWidth(this._player.player.get_rHeight() * 0.9);
		} else {
			this._player.setWidth(this._player.player.get_rWidth() * 0.9);
		}
	}
	,onZoom100: function(evt) {
		if(com_tilbuci_data_Global.displayType == "portrait") {
			this._player.setWidth(this._player.player.get_mHeight());
		} else {
			this._player.setWidth(this._player.player.get_mWidth());
		}
	}
	,__class__: com_tilbuci_ui_PlayerControls
});
var com_tilbuci_ui_PlayerHolder = function(path,callback) {
	feathers_core_FeathersControl.call(this);
	this._bg = new openfl_display_Shape();
	this._bg.get_graphics().beginFill(0,0);
	this._bg.get_graphics().drawRect(0,0,32,32);
	this._bg.get_graphics().endFill();
	this.addChild(this._bg);
	this.player = new com_tilbuci_Player("player.json","editor","landscape",true,callback);
	this.addChild(this.player);
};
$hxClasses["com.tilbuci.ui.PlayerHolder"] = com_tilbuci_ui_PlayerHolder;
com_tilbuci_ui_PlayerHolder.__name__ = "com.tilbuci.ui.PlayerHolder";
com_tilbuci_ui_PlayerHolder.__super__ = feathers_core_FeathersControl;
com_tilbuci_ui_PlayerHolder.prototype = $extend(feathers_core_FeathersControl.prototype,{
	_bg: null
	,player: null
	,rWidth: null
	,get_rWidth: function() {
		return this.player.get_rWidth();
	}
	,rHeight: null
	,get_rHeight: function() {
		return this.player.get_rHeight();
	}
	,setWidth: function(to) {
		this._bg.set_width(this._bg.set_height(to + 600));
		if(com_tilbuci_data_Global.displayType == "portrait") {
			this.player.setSize(com_tilbuci_data_GlobalPlayer.mdata.screen.small / com_tilbuci_data_GlobalPlayer.mdata.screen.big * to,to);
		} else {
			this.player.setSize(to,com_tilbuci_data_GlobalPlayer.mdata.screen.small / com_tilbuci_data_GlobalPlayer.mdata.screen.big * to);
		}
		this.player.set_x(this.player.set_y(300));
		this.set_width(this._bg.get_width());
		this.set_height(this._bg.get_height());
	}
	,createCollection: function(name,ac,id) {
		if(id == null) {
			id = "";
		}
		var tmp = com_tilbuci_data_Global.ws;
		var _g = new haxe_ds_StringMap();
		var value = com_tilbuci_data_GlobalPlayer.movie.get_mvId();
		_g.h["movie"] = value;
		_g.h["name"] = name;
		_g.h["id"] = id;
		tmp.send("Media/CreateCollection",_g,ac);
	}
	,setCollection: function(id,name,transition,time,assets) {
		var col = new com_tilbuci_def_CollectionData(id,null,false);
		col.name = name;
		col.transition = transition;
		col.time = time;
		col.ok = true;
		if(assets != null) {
			var h = assets.h;
			var k_h = h;
			var k_keys = Object.keys(h);
			var k_length = k_keys.length;
			var k_current = 0;
			while(k_current < k_length) {
				var k = k_keys[k_current++];
				var kast = HxOverrides.substr(k,0,32);
				var this1 = col.assets;
				var v = new com_tilbuci_def_AssetData(assets.h[k]);
				this1.h[kast] = v;
				col.assetOrder.push(kast);
			}
		}
		com_tilbuci_data_GlobalPlayer.movie.collections.h[id] = col;
	}
	,addInstance: function(id,data) {
		while(true) {
			var this1 = com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[com_tilbuci_data_GlobalPlayer.area.get_currentKf()];
			if(!Object.prototype.hasOwnProperty.call(this1.h,id)) {
				break;
			}
			id = com_tilbuci_statictools_StringStatic.md5(id);
		}
		var this1 = com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[com_tilbuci_data_GlobalPlayer.area.get_currentKf()];
		var v = new com_tilbuci_def_InstanceData(data);
		this1.h[id] = v;
		if(com_tilbuci_data_GlobalPlayer.movie.scene.collections.indexOf(Reflect.field(data,"collection")) == -1) {
			com_tilbuci_data_GlobalPlayer.movie.scene.collections.push(Reflect.field(data,"collection"));
		}
		com_tilbuci_data_GlobalPlayer.area.loadKeyframe(com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[com_tilbuci_data_GlobalPlayer.area.get_currentKf()],com_tilbuci_data_GlobalPlayer.area.get_currentKf());
	}
	,addKeyframe: function() {
		if(com_tilbuci_data_GlobalPlayer.movie.get_scId() != "") {
			var kfs = [];
			var kfa = [];
			var curkf = com_tilbuci_data_GlobalPlayer.area.get_currentKf();
			var _g = 0;
			var _g1 = com_tilbuci_data_GlobalPlayer.movie.scene.keyframes.length;
			while(_g < _g1) {
				var i = _g++;
				kfs.push(com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[i]);
				if(com_tilbuci_data_GlobalPlayer.movie.scene.ackeyframes.length > i) {
					kfa.push(com_tilbuci_data_GlobalPlayer.movie.scene.ackeyframes[i]);
				} else {
					kfa.push("");
				}
				if(i == curkf) {
					var newkf = new haxe_ds_StringMap();
					var h = com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[i].h;
					var k_h = h;
					var k_keys = Object.keys(h);
					var k_length = k_keys.length;
					var k_current = 0;
					while(k_current < k_length) {
						var k = k_keys[k_current++];
						var v = com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[i].h[k].clone();
						newkf.h[k] = v;
					}
					kfs.push(newkf);
					if(com_tilbuci_data_GlobalPlayer.movie.scene.ackeyframes.length > i) {
						kfa.push(com_tilbuci_data_GlobalPlayer.movie.scene.ackeyframes[i]);
					} else {
						kfa.push("");
					}
				}
			}
			com_tilbuci_data_GlobalPlayer.movie.scene.keyframes = kfs;
			com_tilbuci_data_GlobalPlayer.movie.scene.ackeyframes = kfa;
			++curkf;
			com_tilbuci_data_GlobalPlayer.area.loadKeyframe(com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[curkf],curkf);
			com_tilbuci_data_Global.showMsg(com_tilbuci_data_Global.ln.get("menu-keyframe-addok"));
		}
	}
	,removeKeyframe: function() {
		if(com_tilbuci_data_GlobalPlayer.movie.get_scId() != "") {
			var kfs = [];
			var kfa = [];
			var curkf = com_tilbuci_data_GlobalPlayer.area.get_currentKf();
			var _g = 0;
			var _g1 = com_tilbuci_data_GlobalPlayer.movie.scene.keyframes.length;
			while(_g < _g1) {
				var i = _g++;
				if(i != curkf) {
					kfs.push(com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[i]);
					if(com_tilbuci_data_GlobalPlayer.movie.scene.ackeyframes.length > i) {
						kfa.push(com_tilbuci_data_GlobalPlayer.movie.scene.ackeyframes[i]);
					} else {
						kfa.push("");
					}
				}
			}
			com_tilbuci_data_GlobalPlayer.movie.scene.keyframes = kfs;
			com_tilbuci_data_GlobalPlayer.movie.scene.ackeyframes = kfa;
			com_tilbuci_data_GlobalPlayer.area.loadKeyframe(com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[curkf],curkf);
		}
	}
	,__class__: com_tilbuci_ui_PlayerHolder
	,__properties__: $extend(feathers_core_FeathersControl.prototype.__properties__,{get_rHeight:"get_rHeight",get_rWidth:"get_rWidth"})
});
var com_tilbuci_ui_PlayerInput = function(bg) {
	this._buttons = [];
	this._statetexts = new haxe_ds_StringMap();
	this._logintexts = new haxe_ds_StringMap();
	this._gap = 10;
	feathers_controls_Panel.call(this);
	this._uiBg = bg;
	var pnLayout = new feathers_layout_VerticalLayout();
	pnLayout.set_gap(this._gap);
	pnLayout.setPadding(this._gap);
	this.set_layout(pnLayout);
	this.set_y(-500);
	this._pheader = new feathers_controls_Header();
	this._pheader.set_text("");
	this.set_header(this._pheader);
	this._pfooter = new feathers_controls_LayoutGroup();
	var ftLayout = new feathers_layout_HorizontalLayout();
	ftLayout.set_horizontalAlign(feathers_layout_HorizontalAlign.CENTER);
	ftLayout.set_gap(this._gap);
	ftLayout.setPadding(this._gap);
	this._pfooter.set_layout(ftLayout);
	this.set_footer(this._pfooter);
	this._inputBtCancel = new feathers_controls_Button();
	var cancelIcon = new openfl_display_Bitmap(openfl_utils_Assets.getBitmapData("btClose"));
	cancelIcon.smoothing = true;
	cancelIcon.set_width(cancelIcon.set_height(3 * this._gap));
	this._inputBtCancel.set_icon(cancelIcon);
	this._pfooter.addChild(this._inputBtCancel);
	this._inputBtOk = new feathers_controls_Button();
	var okIcon = new openfl_display_Bitmap(openfl_utils_Assets.getBitmapData("btOk"));
	okIcon.smoothing = true;
	okIcon.set_width(okIcon.set_height(3 * this._gap));
	this._inputBtOk.set_icon(okIcon);
	this._pfooter.addChild(this._inputBtOk);
	this._inputText = new feathers_controls_TextInput();
	this._inputText.setPadding(this._gap);
	this._inputList = new feathers_controls_ListView();
	this._inputList.itemToText = function(item) {
		return item.text;
	};
	this._inputNumeric = new feathers_controls_NumericStepper();
	this._inputLabel = new feathers_controls_Label();
	this._inputLabel.set_wordWrap(true);
	this._inputArea = new feathers_controls_TextArea();
	this._inputArea.set_selectable(false);
	this._inputArea.set_enabled(false);
	this._inputArea.set_wordWrap(true);
	this._inputCheck = new feathers_controls_Check();
	this.set_visible(false);
};
$hxClasses["com.tilbuci.ui.PlayerInput"] = com_tilbuci_ui_PlayerInput;
com_tilbuci_ui_PlayerInput.__name__ = "com.tilbuci.ui.PlayerInput";
com_tilbuci_ui_PlayerInput.__super__ = feathers_controls_Panel;
com_tilbuci_ui_PlayerInput.prototype = $extend(feathers_controls_Panel.prototype,{
	_uiBg: null
	,_inputBtOk: null
	,_inputBtCancel: null
	,_inputVar: null
	,_inputType: null
	,_inputOkAction: null
	,_inputCancelAction: null
	,_gap: null
	,_pheader: null
	,_pfooter: null
	,_inputText: null
	,_inputList: null
	,_inputNumeric: null
	,_inputLabel: null
	,_inputArea: null
	,_inputCheck: null
	,_logintexts: null
	,_statetexts: null
	,_buttons: null
	,kill: function() {
		this.removeChildren();
		this._pheader.removeChildren();
		this._pheader = null;
		this._pfooter.removeChildren();
		this._pfooter = null;
		this._inputBtCancel = null;
		this._inputBtOk = null;
		this._inputText = null;
		this._inputType = null;
		this._inputVar = null;
		this._inputCancelAction = null;
		this._inputOkAction = null;
		this._inputList = null;
		this._inputNumeric = null;
		var h = this._logintexts.h;
		var t_h = h;
		var t_keys = Object.keys(h);
		var t_length = t_keys.length;
		var t_current = 0;
		while(t_current < t_length) {
			var t = t_keys[t_current++];
			var _this = this._logintexts;
			if(Object.prototype.hasOwnProperty.call(_this.h,t)) {
				delete(_this.h[t]);
			}
		}
		this._logintexts = null;
	}
	,askSecret: function(title) {
		this._inputType = "secretkey";
		this.set_y(-500);
		this._inputOkAction = null;
		this._inputCancelAction = null;
		this._pheader.set_text(title);
		this.set_width(com_tilbuci_data_GlobalPlayer.area.get_width());
		this.set_x(0);
		this._inputBtOk.set_width(this.get_width() - 2 * this._gap);
		this.removeChildren();
		this._inputText.set_width(this._inputBtOk.get_width());
		this._inputText.set_text("");
		this.addChild(this._inputText);
		this._pfooter.removeChildren();
		this._pfooter.addChild(this._inputBtOk);
		this._inputBtOk.addEventListener("trigger",$bind(this,this.inputBtOk));
		this.set_visible(true);
		this._uiBg.set_visible(true);
		motion_Actuate.tween(this,0.3,{ y : 50});
		motion_Actuate.tween(this._uiBg,0.3,{ alpha : 1}).autoVisible(false);
	}
	,askStates: function(title,waistates,selectstate,nostates,dateformat,acOk,acCancel) {
		this._inputType = "states";
		this._statetexts.h["title"] = title;
		this._statetexts.h["waistates"] = waistates;
		this._statetexts.h["selectstate"] = selectstate;
		this._statetexts.h["nostates"] = nostates;
		this._statetexts.h["dateformat"] = dateformat;
		this.prepare("states",this._statetexts.h["title"],acOk,acCancel);
		this._inputLabel.set_text(this._statetexts.h["waistates"]);
		this._inputLabel.set_width(this.get_width() - 2 * this._gap);
		this.addChild(this._inputLabel);
		this._pfooter.removeChildren();
		com_tilbuci_data_GlobalPlayer.ws.stateList(dateformat,$bind(this,this.onStateList));
	}
	,askLogin: function(logintitle,logintext,termsagree,invalidemail,emailwait,noemailsent,checkforcode,codewait,invalidcode,emailsubject,emailbody,emailsender,acOk,acCancel) {
		this._logintexts.h["logintitle"] = logintitle;
		this._logintexts.h["logintext"] = logintext;
		this._logintexts.h["termsagree"] = termsagree;
		this._logintexts.h["invalidemail"] = invalidemail;
		this._logintexts.h["emailwait"] = emailwait;
		this._logintexts.h["noemailsent"] = noemailsent;
		this._logintexts.h["checkforcode"] = checkforcode;
		this._logintexts.h["codewait"] = codewait;
		this._logintexts.h["invalidcode"] = invalidcode;
		this._logintexts.h["emailsubject"] = emailsubject;
		this._logintexts.h["emailbody"] = emailbody;
		this._logintexts.h["emailsender"] = emailsender;
		this._inputType = "login";
		this.prepare("login",this._logintexts.h["logintitle"],acOk,acCancel);
		this._inputLabel.set_text(this._logintexts.h["logintext"]);
		this._inputLabel.set_width(this.get_width() - 2 * this._gap);
		this.addChild(this._inputLabel);
		this._inputText.set_width(this.get_width() - 2 * this._gap);
		this._inputText.set_text("");
		this.addChild(this._inputText);
		this._inputArea.set_width(this.get_width() - 2 * this._gap);
		new com_tilbuci_data_DataLoader(true,com_tilbuci_data_GlobalPlayer.base + "VisitorTerms.txt","GET",null,1,$bind(this,this.onTerms));
		this.addChild(this._inputArea);
		this._inputCheck.set_selected(false);
		this._inputCheck.set_text(this._logintexts.h["termsagree"]);
		this._inputCheck.set_maxWidth(this.get_width() - 2 * this._gap);
		this.addChild(this._inputCheck);
	}
	,askText: function(varname,title,acOk,acCancel) {
		this._inputType = "text";
		this.prepare(varname,title,acOk,acCancel);
		this._inputText.set_width(this.get_width() - 2 * this._gap);
		this._inputText.set_text(com_tilbuci_data_GlobalPlayer.parser.getString(varname));
		this.addChild(this._inputText);
	}
	,setWarn: function(title,text,acOk,acCancel) {
		this._inputType = "warn";
		this.prepare("warn",title,acOk,acCancel);
		this._inputLabel.set_width(this.get_width() - 2 * this._gap);
		this._inputLabel.set_text(text);
		this.addChild(this._inputLabel);
		if(acCancel == null) {
			this._pfooter.removeChildren();
			this._inputBtOk.set_width(this.get_width() - 3 * this._gap - 2);
			this._pfooter.addChild(this._inputBtOk);
		}
	}
	,askNumeric: function(type,varname,title,acOk,acCancel,step,min,max) {
		if(max == null) {
			max = 100;
		}
		if(min == null) {
			min = 0;
		}
		if(step == null) {
			step = 0;
		}
		this._inputType = type;
		this.prepare(varname,title,acOk,acCancel);
		if(type == "int") {
			if(step == 0) {
				this._inputNumeric.set_step(1);
			} else {
				this._inputNumeric.set_step(Math.round(step));
			}
			this._inputNumeric.set_minimum(Math.round(min));
			this._inputNumeric.set_maximum(Math.round(max));
			this._inputNumeric.set_value(com_tilbuci_data_GlobalPlayer.parser.getInt(varname));
		} else {
			if(step == 0) {
				this._inputNumeric.set_step(0.5);
			} else {
				this._inputNumeric.set_step(step);
			}
			this._inputNumeric.set_minimum(min);
			this._inputNumeric.set_maximum(max);
			this._inputNumeric.set_value(com_tilbuci_data_GlobalPlayer.parser.getFloat(varname));
		}
		this._inputNumeric.set_width(this.get_width() - 2 * this._gap);
		this.addChild(this._inputNumeric);
	}
	,askList: function(varname,title,options,acOk,acCancel) {
		this._inputType = "list";
		this.prepare(varname,title,acOk,acCancel);
		var items = [];
		var _g = 0;
		var _g1 = options.length;
		while(_g < _g1) {
			var i = _g++;
			items.push({ text : options[i]});
		}
		this._inputList.set_dataProvider(new feathers_data_ArrayCollection(items));
		this._inputList.set_width(this.get_width() - 2 * this._gap);
		this.addChild(this._inputList);
	}
	,askEmail: function(varname,title,domains,acOk,acCancel) {
		this._inputType = "email";
		this.prepare(varname,title,acOk,acCancel);
		this._inputText.set_width(this.get_width() - 2 * this._gap);
		this._inputText.set_text(com_tilbuci_data_GlobalPlayer.parser.getString(varname));
		this.addChild(this._inputText);
		this.clearButtons();
		var _g = 0;
		var _g1 = domains.length;
		while(_g < _g1) {
			var i = _g++;
			var idbt = new com_tilbuci_ui_component_IDButton(domains[i],$bind(this,this.onEmailDomain),domains[i]);
			idbt.set_width(this._inputText.get_width());
			this.addChild(idbt);
			this._buttons.push(idbt);
		}
		feathers_core_FocusManager.setFocus(this._inputText);
	}
	,onEmailDomain: function(evt) {
		var idbt = evt.target;
		if(idbt != null) {
			this._inputText.set_text(this._inputText.get_text() + idbt.btid);
		}
	}
	,clearButtons: function() {
		while(this._buttons.length > 0) this._buttons.shift().kill();
	}
	,prepare: function(varname,title,acOk,acCancel) {
		if(com_tilbuci_data_GlobalPlayer.theme != null) {
			if(com_tilbuci_data_GlobalPlayer.theme.get_headerBackground() != null) {
				this._pheader.set_backgroundSkin(new feathers_skins_RectangleSkin(feathers_graphics_FillStyle.SolidColor(com_tilbuci_data_GlobalPlayer.theme.get_headerBackground())));
			}
			if(com_tilbuci_data_GlobalPlayer.theme.get_windowBackground() != null) {
				this.set_backgroundSkin(new feathers_skins_RectangleSkin(feathers_graphics_FillStyle.SolidColor(com_tilbuci_data_GlobalPlayer.theme.get_windowBackground())));
			}
			if(com_tilbuci_data_GlobalPlayer.theme.footerFillColor != null) {
				this._pfooter.set_backgroundSkin(new feathers_skins_RectangleSkin(feathers_graphics_FillStyle.SolidColor(com_tilbuci_data_GlobalPlayer.theme.footerFillColor)));
			}
			this._pheader.set_textFormat(new feathers_text_TextFormat(com_tilbuci_data_GlobalPlayer.theme.get_headerFont(),com_tilbuci_data_GlobalPlayer.theme.get_headerSize(),com_tilbuci_data_GlobalPlayer.theme.get_headerFontColor()));
			this._pheader.set_embedFonts(com_tilbuci_data_GlobalPlayer.theme.get_headerFont() != "_sans");
			var tmp = com_tilbuci_data_GlobalPlayer.theme.listBackground != null;
			var tmp = com_tilbuci_data_GlobalPlayer.theme.listItemBackground != null || com_tilbuci_data_GlobalPlayer.theme.listItemFont != null || com_tilbuci_data_GlobalPlayer.theme.get_windowFontName() != "_sans" || com_tilbuci_data_GlobalPlayer.theme.get_windowFontSize() != 14;
		}
		this.set_y(-500);
		this._inputVar = varname;
		this._inputOkAction = acOk;
		this._inputCancelAction = acCancel;
		this._pheader.set_text(title);
		if(this._uiBg.get_width() < this._uiBg.get_height()) {
			this.set_width(3 * this._uiBg.get_width() / 4);
		} else {
			this.set_width(2 * this._uiBg.get_width() / 3);
		}
		this.set_x((this._uiBg.get_width() - this.get_width()) / 2);
		this.removeChildren();
		this._inputBtCancel.set_width(this._inputBtOk.set_width((this.get_width() - 3 * this._gap) / 2 - 1));
		this._pfooter.removeChildren();
		this._pfooter.addChild(this._inputBtCancel);
		this._pfooter.addChild(this._inputBtOk);
		this._inputBtCancel.addEventListener("trigger",$bind(this,this.inputBtCancel));
		this._inputBtOk.addEventListener("trigger",$bind(this,this.inputBtOk));
		this.set_visible(true);
		this._uiBg.set_visible(true);
		motion_Actuate.tween(this,0.3,{ y : 50});
		motion_Actuate.tween(this._uiBg,0.3,{ alpha : 1}).autoVisible(false);
	}
	,inputBtOk: function(evt) {
		if(this._inputType == "secretkey") {
			var secretkey = "";
			if(com_tilbuci_data_GlobalPlayer.mdata.key != "") {
				secretkey = com_tilbuci_statictools_StringStatic.decryptKey(com_tilbuci_data_GlobalPlayer.mdata.key,"skey",com_tilbuci_data_GlobalPlayer.secret);
			}
			if(this._inputText.get_text() == secretkey || com_tilbuci_data_GlobalPlayer.mdata.key == "") {
				com_tilbuci_data_GlobalPlayer.secretKey = com_tilbuci_data_GlobalPlayer.mdata.key;
				this._inputBtOk.removeEventListener("trigger",$bind(this,this.inputBtOk));
				motion_Actuate.tween(this,0.1,{ y : -500}).onComplete($bind(this,this.inputClose));
				motion_Actuate.tween(this._uiBg,0.1,{ alpha : 0}).autoVisible(false);
			}
		} else if(this._inputType == "login") {
			if(this._inputCheck.get_selected()) {
				var ereg = new EReg(".+@.+","i");
				if(!ereg.match(this._inputText.get_text())) {
					this._inputLabel.set_text(this._logintexts.h["invalidemail"]);
				} else {
					this._inputLabel.set_text(this._logintexts.h["emailwait"]);
					this.removeChildren();
					this.addChild(this._inputLabel);
					this._inputType = "waitemail";
					var this1 = this._logintexts;
					var v = this._inputText.get_text();
					this1.h["visitoremail"] = v;
					com_tilbuci_data_GlobalPlayer.ws.loginVisitor(this._inputText.get_text(),this._logintexts.h["emailsubject"],this._logintexts.h["emailbody"],this._logintexts.h["emailsender"],$bind(this,this.onLoginSent));
					this._inputText.set_text("");
					this._pfooter.removeChildren();
				}
			}
		} else if(this._inputType == "waitforcode") {
			com_tilbuci_data_GlobalPlayer.ws.checkVisitorCode(this._logintexts.h["visitoremail"],this._inputText.get_text(),$bind(this,this.onCodeCheck));
			this._pfooter.removeChildren();
			this.removeChildren();
			this._inputLabel.set_text(this._logintexts.h["codewait"]);
			this.addChild(this._inputLabel);
		} else if(this._inputType == "states") {
			if(this._inputList.get_selectedItem() != null) {
				com_tilbuci_data_GlobalPlayer.parser.run({ ac : "data.loadstate", param : [this._inputList.get_selectedItem().id], success : this._inputOkAction, error : this._inputCancelAction},true);
				this._inputBtCancel.removeEventListener("trigger",$bind(this,this.inputBtCancel));
				this._inputBtOk.removeEventListener("trigger",$bind(this,this.inputBtOk));
				motion_Actuate.tween(this,0.1,{ y : -500}).onComplete($bind(this,this.inputClose));
				motion_Actuate.tween(this._uiBg,0.1,{ alpha : 0}).autoVisible(false);
			}
		} else if(this._inputType == "email") {
			if(com_tilbuci_statictools_StringStatic.validateEmail(this._inputText.get_text())) {
				com_tilbuci_data_GlobalPlayer.parser.setString(this._inputVar,this._inputText.get_text());
				this._inputBtCancel.removeEventListener("trigger",$bind(this,this.inputBtCancel));
				this._inputBtOk.removeEventListener("trigger",$bind(this,this.inputBtOk));
				this.clearButtons();
				motion_Actuate.tween(this,0.1,{ y : -500}).onComplete($bind(this,this.inputClose));
				motion_Actuate.tween(this._uiBg,0.1,{ alpha : 0}).autoVisible(false);
				com_tilbuci_data_GlobalPlayer.parser.run(this._inputOkAction,true);
			}
		} else {
			switch(this._inputType) {
			case "float":
				com_tilbuci_data_GlobalPlayer.parser.setFloat(this._inputVar,this._inputNumeric.get_value());
				break;
			case "int":
				com_tilbuci_data_GlobalPlayer.parser.setInt(this._inputVar,Math.round(this._inputNumeric.get_value()));
				break;
			case "list":
				if(this._inputList.get_selectedItem() != null) {
					com_tilbuci_data_GlobalPlayer.parser.setString(this._inputVar,this._inputList.get_selectedItem().text);
				}
				break;
			case "text":
				com_tilbuci_data_GlobalPlayer.parser.setString(this._inputVar,this._inputText.get_text());
				break;
			case "warn":
				break;
			}
			this._inputBtCancel.removeEventListener("trigger",$bind(this,this.inputBtCancel));
			this._inputBtOk.removeEventListener("trigger",$bind(this,this.inputBtOk));
			motion_Actuate.tween(this,0.1,{ y : -500}).onComplete($bind(this,this.inputClose));
			motion_Actuate.tween(this._uiBg,0.1,{ alpha : 0}).autoVisible(false);
			com_tilbuci_data_GlobalPlayer.parser.run(this._inputOkAction,true);
		}
	}
	,onLoginSent: function(ok,ld) {
		if(ok) {
			if(ld.map.h["e"] == 0) {
				this._inputLabel.set_text(this._logintexts.h["checkforcode"]);
				this._inputText.set_text("");
				this.addChild(this._inputText);
				this._inputType = "waitforcode";
				this._inputBtCancel.set_width(this._inputBtOk.set_width((this.get_width() - 3 * this._gap) / 2 - 1));
				this._pfooter.removeChildren();
				this._pfooter.addChild(this._inputBtCancel);
				this._pfooter.addChild(this._inputBtOk);
			} else {
				this._inputLabel.set_text(this._logintexts.h["noemailsent"]);
				this._pfooter.removeChildren();
				this._pfooter.addChild(this._inputBtCancel);
				this._inputBtCancel.set_width(this.get_width() - 2 * this._gap - 2);
			}
		} else {
			this._inputLabel.set_text(this._logintexts.h["noemailsent"]);
			this._pfooter.removeChildren();
			this._pfooter.addChild(this._inputBtCancel);
			this._inputBtCancel.set_width(this.get_width() - 2 * this._gap - 2);
		}
	}
	,onCodeCheck: function(ok,ld) {
		if(ok) {
			if(ld.map.h["e"] == 0) {
				com_tilbuci_data_GlobalPlayer.ws.setUser(this._logintexts.h["visitoremail"],ld.map.h["key"],ld.map.h["groups"]);
				this._inputType = "codeok";
				this.inputBtOk(null);
			} else {
				this._inputType = "waitforcode";
				this._inputLabel.set_text(this._logintexts.h["invalidcode"]);
				this.addChild(this._inputText);
				this._pfooter.removeChildren();
				this._pfooter.addChild(this._inputBtCancel);
				this._pfooter.addChild(this._inputBtOk);
				this._inputBtOk.set_width(this._inputBtCancel.set_width((this.get_width() - 3 * this._gap) / 2 - 1));
			}
		} else {
			this._inputType = "waitforcode";
			this._inputLabel.set_text(this._logintexts.h["invalidcode"]);
			this.addChild(this._inputText);
			this._pfooter.removeChildren();
			this._pfooter.addChild(this._inputBtCancel);
			this._pfooter.addChild(this._inputBtOk);
			this._inputBtOk.set_width(this._inputBtCancel.set_width((this.get_width() - 3 * this._gap) / 2 - 1));
		}
	}
	,onTerms: function(ok,ld) {
		if(ok) {
			this._inputArea.set_text(StringTools.replace(ld.rawtext,"\r\n","\n"));
		} else {
			this._inputArea.set_text("ERROR LOADING THE TERMS");
		}
	}
	,onStateList: function(ok,ld) {
		if(ok) {
			if(ld.map.h["e"] == 0) {
				this._inputLabel.set_text(this._statetexts.h["selectstate"]);
				var items = [];
				var _g = 0;
				var _g1 = Reflect.fields(ld.map.h["states"]);
				while(_g < _g1.length) {
					var num = _g1[_g];
					++_g;
					var obj = Reflect.field(ld.map.h["states"],num);
					var text = Reflect.field(obj,"date");
					var about = Reflect.field(obj,"about");
					if(about != "") {
						text = text + " : " + about;
					}
					items.push({ text : text, id : Reflect.field(obj,"id")});
				}
				this._inputList.set_dataProvider(new feathers_data_ArrayCollection(items));
				this._inputList.set_width(this.get_width() - 2 * this._gap);
				this.addChild(this._inputList);
				this._inputBtCancel.set_width(this._inputBtOk.set_width((this.get_width() - 3 * this._gap) / 2 - 1));
				this._pfooter.addChild(this._inputBtCancel);
				this._pfooter.addChild(this._inputBtOk);
			} else {
				this._inputLabel.set_text(this._statetexts.h["nostates"]);
				this._inputBtCancel.set_width(this.get_width() - 2 * this._gap - 2);
				this._pfooter.addChild(this._inputBtCancel);
			}
		} else {
			this._inputLabel.set_text(this._statetexts.h["nostates"]);
			this._inputBtCancel.set_width(this.get_width() - 2 * this._gap - 2);
			this._pfooter.addChild(this._inputBtCancel);
		}
	}
	,inputBtCancel: function(evt) {
		this._inputBtCancel.removeEventListener("trigger",$bind(this,this.inputBtCancel));
		this._inputBtOk.removeEventListener("trigger",$bind(this,this.inputBtOk));
		this.clearButtons();
		motion_Actuate.tween(this,0.1,{ y : -500}).onComplete($bind(this,this.inputClose));
		motion_Actuate.tween(this._uiBg,0.1,{ alpha : 0}).autoVisible(false);
		com_tilbuci_data_GlobalPlayer.parser.run(this._inputCancelAction,true);
	}
	,inputClose: function() {
		this._uiBg.set_visible(false);
		this.set_visible(false);
	}
	,__class__: com_tilbuci_ui_PlayerInput
});
var feathers_style_ITheme = function() { };
$hxClasses["feathers.style.ITheme"] = feathers_style_ITheme;
feathers_style_ITheme.__name__ = "feathers.style.ITheme";
feathers_style_ITheme.__isInterface__ = true;
feathers_style_ITheme.prototype = {
	getStyleProvider: null
	,dispose: null
	,__class__: feathers_style_ITheme
};
var feathers_themes_ClassVariantTheme = function() {
	this.styleProvider = new feathers_style_ClassVariantStyleProvider();
};
$hxClasses["feathers.themes.ClassVariantTheme"] = feathers_themes_ClassVariantTheme;
feathers_themes_ClassVariantTheme.__name__ = "feathers.themes.ClassVariantTheme";
feathers_themes_ClassVariantTheme.__interfaces__ = [feathers_style_ITheme];
feathers_themes_ClassVariantTheme.prototype = {
	styleProvider: null
	,getStyleProvider: function(target) {
		var styleContext = null;
		var variant = null;
		if(js_Boot.__implements(target,feathers_style_IVariantStyleObject)) {
			var variantObject = target;
			styleContext = variantObject.get_styleContext();
			variant = variantObject.get_variant();
		}
		if(styleContext == null) {
			styleContext = js_Boot.getClass(target);
		}
		var styleFunction = this.styleProvider.getStyleFunction(styleContext,variant);
		if(styleFunction != null) {
			return this.styleProvider;
		}
		if(variant == null) {
			return null;
		}
		var fallbackTheme = feathers_style_Theme.get_fallbackTheme();
		if(fallbackTheme != null && fallbackTheme != this && ((fallbackTheme) instanceof feathers_themes_ClassVariantTheme)) {
			var value = fallbackTheme.getStyleProvider(target);
			var fallbackStyleProvider = ((value) instanceof feathers_style_ClassVariantStyleProvider) ? value : null;
			if(fallbackStyleProvider != null) {
				var styleFunction1 = fallbackStyleProvider.getStyleFunction(styleContext,variant);
				if(styleFunction1 != null) {
					return null;
				}
			}
		}
		styleFunction = this.styleProvider.getStyleFunction(styleContext,null);
		if(styleFunction != null) {
			return this.styleProvider;
		}
		return null;
	}
	,dispose: function() {
		feathers_events_FeathersEvent.dispatch(this.styleProvider,"clear");
	}
	,__class__: feathers_themes_ClassVariantTheme
};
var feathers_style_IDarkModeTheme = function() { };
$hxClasses["feathers.style.IDarkModeTheme"] = feathers_style_IDarkModeTheme;
feathers_style_IDarkModeTheme.__name__ = "feathers.style.IDarkModeTheme";
feathers_style_IDarkModeTheme.__isInterface__ = true;
feathers_style_IDarkModeTheme.__interfaces__ = [feathers_style_ITheme];
feathers_style_IDarkModeTheme.prototype = {
	get_darkMode: null
	,set_darkMode: null
	,__class__: feathers_style_IDarkModeTheme
	,__properties__: {set_darkMode:"set_darkMode",get_darkMode:"get_darkMode"}
};
var feathers_themes_steel_BaseSteelTheme = function(themeColor,darkThemeColor) {
	this._darkMode = false;
	feathers_themes_ClassVariantTheme.call(this);
	this.customThemeColor = themeColor;
	this.customDarkThemeColor = darkThemeColor;
	this.refreshColors();
	this.refreshFonts();
	this.refreshPaddings();
	this.styleProvider = new feathers_style_ClassVariantStyleProvider();
	var htmlWindow = js_Boot.__cast($global , Window);
	this.mediaQueryList = htmlWindow.matchMedia("(hover: hover) and (pointer: fine)");
	this.mediaQueryList.addListener($bind(this,this.mediaQueryList_changeHandler));
};
$hxClasses["feathers.themes.steel.BaseSteelTheme"] = feathers_themes_steel_BaseSteelTheme;
feathers_themes_steel_BaseSteelTheme.__name__ = "feathers.themes.steel.BaseSteelTheme";
feathers_themes_steel_BaseSteelTheme.__interfaces__ = [feathers_style_IDarkModeTheme];
feathers_themes_steel_BaseSteelTheme.__super__ = feathers_themes_ClassVariantTheme;
feathers_themes_steel_BaseSteelTheme.prototype = $extend(feathers_themes_ClassVariantTheme.prototype,{
	mediaQueryList: null
	,_darkMode: null
	,get_darkMode: function() {
		return this._darkMode;
	}
	,set_darkMode: function(value) {
		if(this._darkMode == value) {
			return this._darkMode;
		}
		this._darkMode = value;
		this.refreshColors();
		feathers_events_StyleProviderEvent.dispatch(this.styleProvider,"stylesChange");
		return this._darkMode;
	}
	,customThemeColor: null
	,customDarkThemeColor: null
	,themeColor: null
	,offsetThemeColor: null
	,rootFillColor: null
	,controlFillColor1: null
	,controlFillColor2: null
	,controlDisabledFillColor: null
	,scrollBarThumbFillColor: null
	,scrollBarThumbDisabledFillColor: null
	,insetFillColor: null
	,disabledInsetFillColor: null
	,insetBorderColor: null
	,disabledInsetBorderColor: null
	,selectedInsetBorderColor: null
	,activeFillBorderColor: null
	,selectedBorderColor: null
	,focusBorderColor: null
	,containerFillColor: null
	,headerFillColor: null
	,overlayFillColor: null
	,subHeadingFillColor: null
	,borderColor: null
	,dividerColor: null
	,subHeadingDividerColor: null
	,textColor: null
	,secondaryTextColor: null
	,disabledTextColor: null
	,dangerTextColor: null
	,dangerFillColor: null
	,offsetDangerFillColor: null
	,dangerBorderColor: null
	,fontName: null
	,fontSize: null
	,headerFontSize: null
	,detailFontSize: null
	,borderThickness: null
	,xsmallPadding: null
	,smallPadding: null
	,mediumPadding: null
	,largePadding: null
	,xlargePadding: null
	,dispose: function() {
		if(this.mediaQueryList != null) {
			this.mediaQueryList.removeListener($bind(this,this.mediaQueryList_changeHandler));
			this.mediaQueryList = null;
		}
		feathers_themes_ClassVariantTheme.prototype.dispose.call(this);
	}
	,refreshColors: function() {
		if(this._darkMode) {
			if(this.customDarkThemeColor != null) {
				this.themeColor = this.customDarkThemeColor;
			} else if(this.customThemeColor != null) {
				this.themeColor = this.customThemeColor;
			} else {
				this.themeColor = 5205919;
			}
			this.offsetThemeColor = this.darken(this.themeColor,986895);
			this.rootFillColor = 3684408;
			this.controlFillColor1 = 6250335;
			this.controlFillColor2 = 5000268;
			this.controlDisabledFillColor = 3158064;
			this.scrollBarThumbFillColor = 7303023;
			this.scrollBarThumbDisabledFillColor = 4144959;
			this.insetFillColor = 1579032;
			this.disabledInsetFillColor = 2631720;
			this.insetBorderColor = 4737096;
			this.disabledInsetBorderColor = 3684408;
			this.selectedInsetBorderColor = this.themeColor;
			this.activeFillBorderColor = this.darken(this.themeColor,3092271);
			this.selectedBorderColor = this.lighten(this.themeColor,986895);
			this.focusBorderColor = this.lighten(this.themeColor,986895);
			this.containerFillColor = 3684408;
			this.headerFillColor = 4144959;
			this.overlayFillColor = 7303023;
			this.subHeadingFillColor = 2894892;
			this.dangerFillColor = 10440527;
			this.offsetDangerFillColor = this.darken(this.dangerFillColor,986895);
			this.dangerBorderColor = this.darken(this.dangerFillColor,3092271);
			this.borderColor = 526344;
			this.dividerColor = 2631720;
			this.subHeadingDividerColor = 789516;
			this.textColor = 15856113;
			this.disabledTextColor = 9408399;
			this.secondaryTextColor = 11513775;
			this.dangerTextColor = 13385535;
		} else {
			if(this.customThemeColor != null) {
				this.themeColor = this.customThemeColor;
			} else {
				this.themeColor = 10535152;
			}
			this.offsetThemeColor = this.darken(this.themeColor,986895);
			this.rootFillColor = 16316664;
			this.controlFillColor1 = 16777215;
			this.controlFillColor2 = 15263976;
			this.controlDisabledFillColor = 15724527;
			this.scrollBarThumbFillColor = 9408399;
			this.scrollBarThumbDisabledFillColor = 13619151;
			this.insetFillColor = 16579836;
			this.disabledInsetFillColor = 15856113;
			this.insetBorderColor = 11316396;
			this.disabledInsetBorderColor = 13421772;
			this.selectedInsetBorderColor = this.darken(this.themeColor,3092271);
			this.activeFillBorderColor = this.darken(this.themeColor,3092271);
			this.selectedBorderColor = this.darken(this.themeColor,3092271);
			this.focusBorderColor = this.darken(this.themeColor,3092271);
			this.containerFillColor = 16316664;
			this.headerFillColor = 15527148;
			this.overlayFillColor = 9408399;
			this.subHeadingFillColor = 14671839;
			this.dangerFillColor = 15769760;
			this.offsetDangerFillColor = this.darken(this.dangerFillColor,986895);
			this.dangerBorderColor = this.darken(this.dangerFillColor,3092271);
			this.borderColor = 11316396;
			this.dividerColor = 14671839;
			this.subHeadingDividerColor = 13619151;
			this.textColor = 2039583;
			this.disabledTextColor = 10461087;
			this.secondaryTextColor = 7303023;
			this.dangerTextColor = 13385535;
		}
	}
	,refreshFonts: function() {
		this.fontName = "_sans";
		this.refreshFontSizes();
	}
	,refreshFontSizes: function() {
		if(feathers_utils_DeviceUtil.isDesktop()) {
			this.fontSize = 13;
			this.headerFontSize = 14;
			this.detailFontSize = 11;
		} else {
			this.fontSize = 14;
			this.headerFontSize = 18;
			this.detailFontSize = 12;
		}
	}
	,refreshPaddings: function() {
		if(feathers_utils_DeviceUtil.isDesktop()) {
			this.borderThickness = 1.0;
			this.xsmallPadding = 1.0;
			this.smallPadding = 2.0;
			this.mediumPadding = 4.0;
			this.largePadding = 8.0;
			this.xlargePadding = 10.0;
		} else {
			this.borderThickness = 1.0;
			this.xsmallPadding = 2.0;
			this.smallPadding = 4.0;
			this.mediumPadding = 6.0;
			this.largePadding = 10.0;
			this.xlargePadding = 14.0;
		}
	}
	,getThemeFill: function() {
		return feathers_graphics_FillStyle.SolidColor(this.themeColor);
	}
	,getControlFill: function() {
		return feathers_graphics_FillStyle.SolidColor(this.controlFillColor2);
	}
	,getControlDisabledFill: function() {
		return feathers_graphics_FillStyle.SolidColor(this.controlDisabledFillColor,0.7);
	}
	,getButtonFill: function() {
		return feathers_graphics_FillStyle.Gradient(0,[this.controlFillColor1,this.controlFillColor2],[1.0,1.0],[0,255],feathers_graphics_CreateGradientBoxMatrix.fromRadians(Math.PI / 2.0));
	}
	,getButtonDownFill: function() {
		return feathers_graphics_FillStyle.Gradient(0,[this.controlFillColor2,this.controlFillColor1],[1.0,1.0],[0,255],feathers_graphics_CreateGradientBoxMatrix.fromRadians(Math.PI / 2.0));
	}
	,getButtonDisabledFill: function() {
		return feathers_graphics_FillStyle.SolidColor(this.controlDisabledFillColor);
	}
	,getScrollBarThumbFill: function() {
		return feathers_graphics_FillStyle.SolidColor(this.scrollBarThumbFillColor);
	}
	,getScrollBarThumbDisabledFill: function() {
		return feathers_graphics_FillStyle.SolidColor(this.scrollBarThumbDisabledFillColor,0.7);
	}
	,getBorder: function(thickness) {
		if(thickness == null) {
			thickness = 1.0;
		}
		return feathers_graphics_LineStyle.SolidColor(thickness,this.borderColor);
	}
	,getButtonBorder: function(thickness) {
		if(thickness == null) {
			thickness = 1.0;
		}
		return feathers_graphics_LineStyle.SolidColor(thickness,this.borderColor);
	}
	,getButtonDisabledBorder: function(thickness) {
		if(thickness == null) {
			thickness = 1.0;
		}
		return feathers_graphics_LineStyle.SolidColor(thickness,this.disabledInsetBorderColor);
	}
	,getInsetBorder: function(thickness) {
		if(thickness == null) {
			thickness = 1.0;
		}
		return feathers_graphics_LineStyle.SolidColor(thickness,this.insetBorderColor);
	}
	,getDisabledInsetBorder: function(thickness) {
		if(thickness == null) {
			thickness = 1.0;
		}
		return feathers_graphics_LineStyle.SolidColor(thickness,this.disabledInsetBorderColor);
	}
	,getSelectedInsetBorder: function(thickness) {
		if(thickness == null) {
			thickness = 1.0;
		}
		return feathers_graphics_LineStyle.SolidColor(thickness,this.selectedInsetBorderColor);
	}
	,getThemeBorder: function(thickness) {
		if(thickness == null) {
			thickness = 1.0;
		}
		return feathers_graphics_LineStyle.SolidColor(thickness,this.themeColor);
	}
	,getSelectedBorder: function(thickness) {
		if(thickness == null) {
			thickness = 1.0;
		}
		return feathers_graphics_LineStyle.SolidColor(thickness,this.selectedBorderColor);
	}
	,getActiveFillBorder: function(thickness) {
		if(thickness == null) {
			thickness = 1.0;
		}
		return feathers_graphics_LineStyle.SolidColor(thickness,this.activeFillBorderColor);
	}
	,getContainerBorder: function(thickness) {
		if(thickness == null) {
			thickness = 1.0;
		}
		return feathers_graphics_LineStyle.SolidColor(thickness,this.borderColor);
	}
	,getDividerBorder: function(thickness) {
		if(thickness == null) {
			thickness = 1.0;
		}
		return feathers_graphics_LineStyle.SolidColor(thickness,this.dividerColor);
	}
	,getDividerFill: function() {
		return feathers_graphics_FillStyle.SolidColor(this.dividerColor);
	}
	,getSubHeadingDividerBorder: function(thickness) {
		if(thickness == null) {
			thickness = 1.0;
		}
		return feathers_graphics_LineStyle.SolidColor(thickness,this.subHeadingDividerColor);
	}
	,getSubHeadingDividerFill: function() {
		return feathers_graphics_FillStyle.SolidColor(this.subHeadingDividerColor);
	}
	,getFocusBorder: function(thickness) {
		if(thickness == null) {
			thickness = 1.0;
		}
		return feathers_graphics_LineStyle.SolidColor(thickness,this.focusBorderColor);
	}
	,getInsetFill: function() {
		return feathers_graphics_FillStyle.SolidColor(this.insetFillColor);
	}
	,getDisabledInsetFill: function() {
		return feathers_graphics_FillStyle.SolidColor(this.disabledInsetFillColor);
	}
	,getActiveThemeFill: function() {
		var colors = [this.themeColor,this.offsetThemeColor];
		return feathers_graphics_FillStyle.Gradient(0,colors,[1.0,1.0],[0,255],feathers_graphics_CreateGradientBoxMatrix.fromRadians(Math.PI / 2.0));
	}
	,getReversedActiveThemeFill: function() {
		var colors = [this.offsetThemeColor,this.themeColor];
		return feathers_graphics_FillStyle.Gradient(0,colors,[1.0,1.0],[0,255],feathers_graphics_CreateGradientBoxMatrix.fromRadians(Math.PI / 2.0));
	}
	,getDangerFill: function() {
		var colors = [this.dangerFillColor,this.offsetDangerFillColor];
		return feathers_graphics_FillStyle.Gradient(0,colors,[1.0,1.0],[0,255],feathers_graphics_CreateGradientBoxMatrix.fromRadians(Math.PI / 2.0));
	}
	,getReversedDangerFill: function() {
		var colors = [this.offsetDangerFillColor,this.dangerFillColor];
		return feathers_graphics_FillStyle.Gradient(0,colors,[1.0,1.0],[0,255],feathers_graphics_CreateGradientBoxMatrix.fromRadians(Math.PI / 2.0));
	}
	,getDangerBorder: function(thickness) {
		if(thickness == null) {
			thickness = 1.0;
		}
		return feathers_graphics_LineStyle.SolidColor(thickness,this.dangerBorderColor);
	}
	,getOverlayFill: function() {
		return feathers_graphics_FillStyle.SolidColor(this.overlayFillColor,0.8);
	}
	,getRootFill: function() {
		return feathers_graphics_FillStyle.SolidColor(this.rootFillColor);
	}
	,getContainerFill: function() {
		return feathers_graphics_FillStyle.SolidColor(this.containerFillColor);
	}
	,getSubHeadingFill: function() {
		return feathers_graphics_FillStyle.SolidColor(this.subHeadingFillColor);
	}
	,getTextFormat: function(align) {
		if(align == null) {
			align = 3;
		}
		return new feathers_text_TextFormat(this.fontName,this.fontSize,this.textColor,false,false,false,null,null,align);
	}
	,getDisabledTextFormat: function(align) {
		if(align == null) {
			align = 3;
		}
		return new feathers_text_TextFormat(this.fontName,this.fontSize,this.disabledTextColor,false,false,false,null,null,align);
	}
	,getSecondaryTextFormat: function(align) {
		if(align == null) {
			align = 3;
		}
		return new feathers_text_TextFormat(this.fontName,this.fontSize,this.secondaryTextColor,false,false,false,null,null,align);
	}
	,getDangerTextFormat: function(align) {
		if(align == null) {
			align = 3;
		}
		return new feathers_text_TextFormat(this.fontName,this.fontSize,this.dangerTextColor,false,false,false,null,null,align);
	}
	,getHeaderTextFormat: function(align) {
		if(align == null) {
			align = 3;
		}
		return new feathers_text_TextFormat(this.fontName,this.headerFontSize,this.textColor,false,false,false,null,null,align);
	}
	,getDisabledHeaderTextFormat: function(align) {
		if(align == null) {
			align = 3;
		}
		return new feathers_text_TextFormat(this.fontName,this.headerFontSize,this.disabledTextColor,false,false,false,null,null,align);
	}
	,getDetailTextFormat: function(align) {
		if(align == null) {
			align = 3;
		}
		return new feathers_text_TextFormat(this.fontName,this.detailFontSize,this.textColor,false,false,false,null,null,align);
	}
	,getDisabledDetailTextFormat: function(align) {
		if(align == null) {
			align = 3;
		}
		return new feathers_text_TextFormat(this.fontName,this.detailFontSize,this.disabledTextColor,false,false,false,null,null,align);
	}
	,getSecondaryDetailTextFormat: function(align) {
		if(align == null) {
			align = 3;
		}
		return new feathers_text_TextFormat(this.fontName,this.detailFontSize,this.secondaryTextColor,false,false,false,null,null,align);
	}
	,getHeaderFill: function() {
		return feathers_graphics_FillStyle.SolidColor(this.headerFillColor);
	}
	,lighten: function(color,offset) {
		var r1 = color >> 16 & 255;
		var g1 = color >> 8 & 255;
		var b1 = color & 255;
		var r2 = offset >> 16 & 255;
		var g2 = offset >> 8 & 255;
		var b2 = offset & 255;
		r1 += r2;
		if(r1 > 255) {
			r1 = 255;
		}
		g1 += g2;
		if(g1 > 255) {
			g1 = 255;
		}
		b1 += b2;
		if(b1 > 255) {
			b1 = 255;
		}
		return (r1 << 16) + (g1 << 8) + b1;
	}
	,darken: function(color,offset) {
		var r1 = color >> 16 & 255;
		var g1 = color >> 8 & 255;
		var b1 = color & 255;
		var r2 = offset >> 16 & 255;
		var g2 = offset >> 8 & 255;
		var b2 = offset & 255;
		r1 -= r2;
		if(r1 < 0) {
			r1 = 0;
		}
		g1 -= g2;
		if(g1 < 0) {
			g1 = 0;
		}
		b1 -= b2;
		if(b1 < 0) {
			b1 = 0;
		}
		return (r1 << 16) + (g1 << 8) + b1;
	}
	,mediaQueryList_changeHandler: function(event) {
		this.refreshFontSizes();
		this.refreshPaddings();
		feathers_events_StyleProviderEvent.dispatch(this.styleProvider,"stylesChange");
	}
	,__class__: feathers_themes_steel_BaseSteelTheme
	,__properties__: {set_darkMode:"set_darkMode",get_darkMode:"get_darkMode"}
});
var feathers_themes_steel_SteelTheme = function(themeColor,darkThemeColor) {
	feathers_themes_steel_BaseSteelTheme.call(this,themeColor,darkThemeColor);
	feathers_themes_steel_components_SteelActivityIndicatorStyles.initialize(this);
	feathers_themes_steel_components_SteelAlertStyles.initialize(this);
	feathers_themes_steel_components_SteelApplicationStyles.initialize(this);
	feathers_themes_steel_components_SteelButtonStyles.initialize(this);
	feathers_themes_steel_components_SteelButtonBarStyles.initialize(this);
	feathers_themes_steel_components_SteelCalloutStyles.initialize(this);
	feathers_themes_steel_components_SteelCheckStyles.initialize(this);
	feathers_themes_steel_components_SteelCollapsibleStyles.initialize(this);
	feathers_themes_steel_components_SteelComboBoxStyles.initialize(this);
	feathers_themes_steel_components_SteelDatePickerStyles.initialize(this);
	feathers_themes_steel_components_SteelDrawerStyles.initialize(this);
	feathers_themes_steel_components_SteelFormStyles.initialize(this);
	feathers_themes_steel_components_SteelFormItemStyles.initialize(this);
	feathers_themes_steel_components_SteelGridViewStyles.initialize(this);
	feathers_themes_steel_components_SteelGroupListViewStyles.initialize(this);
	feathers_themes_steel_components_SteelHDividedBoxStyles.initialize(this);
	feathers_themes_steel_components_SteelHeaderStyles.initialize(this);
	feathers_themes_steel_components_SteelHProgressBarStyles.initialize(this);
	feathers_themes_steel_components_SteelHScrollBarStyles.initialize(this);
	feathers_themes_steel_components_SteelHSliderStyles.initialize(this);
	feathers_themes_steel_components_SteelHierarchicalItemRendererStyles.initialize(this);
	feathers_themes_steel_components_SteelItemRendererStyles.initialize(this);
	feathers_themes_steel_components_SteelLabelStyles.initialize(this);
	feathers_themes_steel_components_SteelLayoutGroupStyles.initialize(this);
	feathers_themes_steel_components_SteelLayoutGroupItemRendererStyles.initialize(this);
	feathers_themes_steel_components_SteelListViewStyles.initialize(this);
	feathers_themes_steel_components_SteelNumericStepperStyles.initialize(this);
	feathers_themes_steel_components_SteelPageIndicatorStyles.initialize(this);
	feathers_themes_steel_components_SteelPageNavigatorStyles.initialize(this);
	feathers_themes_steel_components_SteelPanelStyles.initialize(this);
	feathers_themes_steel_components_SteelPopUpDatePickerStyles.initialize(this);
	feathers_themes_steel_components_SteelPopUpListViewStyles.initialize(this);
	feathers_themes_steel_components_SteelRadioStyles.initialize(this);
	feathers_themes_steel_components_SteelRouterNavigatorStyles.initialize(this);
	feathers_themes_steel_components_SteelScrollContainerStyles.initialize(this);
	feathers_themes_steel_components_SteelStackNavigatorStyles.initialize(this);
	feathers_themes_steel_components_SteelTabBarStyles.initialize(this);
	feathers_themes_steel_components_SteelTabNavigatorStyles.initialize(this);
	feathers_themes_steel_components_SteelTextAreaStyles.initialize(this);
	feathers_themes_steel_components_SteelTextCalloutStyles.initialize(this);
	feathers_themes_steel_components_SteelTextInputStyles.initialize(this);
	feathers_themes_steel_components_SteelToggleButtonStyles.initialize(this);
	feathers_themes_steel_components_SteelToggleSwitchStyles.initialize(this);
	feathers_themes_steel_components_SteelToolTipStyles.initialize(this);
	feathers_themes_steel_components_SteelTreeGridViewStyles.initialize(this);
	feathers_themes_steel_components_SteelTreeViewStyles.initialize(this);
	feathers_themes_steel_components_SteelVDividedBoxStyles.initialize(this);
	feathers_themes_steel_components_SteelVProgressBarStyles.initialize(this);
	feathers_themes_steel_components_SteelVScrollBarStyles.initialize(this);
	feathers_themes_steel_components_SteelVSliderStyles.initialize(this);
};
$hxClasses["feathers.themes.steel.SteelTheme"] = feathers_themes_steel_SteelTheme;
feathers_themes_steel_SteelTheme.__name__ = "feathers.themes.steel.SteelTheme";
feathers_themes_steel_SteelTheme.__super__ = feathers_themes_steel_BaseSteelTheme;
feathers_themes_steel_SteelTheme.prototype = $extend(feathers_themes_steel_BaseSteelTheme.prototype,{
	__class__: feathers_themes_steel_SteelTheme
});
var com_tilbuci_ui_PlayerTheme = function(sets) {
	feathers_themes_steel_SteelTheme.call(this);
	this.set_darkMode(true);
	var json = com_tilbuci_statictools_StringStatic.jsonParse(sets);
	if(json != false) {
		var _g = 0;
		var _g1 = Reflect.fields(json);
		while(_g < _g1.length) {
			var n = _g1[_g];
			++_g;
			switch(n) {
			case "activeFillBorderColor":
				this.setColor(n,json);
				break;
			case "borderColor":
				this.setColor(n,json);
				break;
			case "containerFillColor":
				this.setColor(n,json);
				break;
			case "controlDisabledFillColor":
				this.setColor(n,json);
				break;
			case "controlFillColor1":
				this.setColor(n,json);
				break;
			case "controlFillColor2":
				this.setColor(n,json);
				break;
			case "dangerBorderColor":
				this.setColor(n,json);
				break;
			case "dangerFillColor":
				this.setColor(n,json);
				break;
			case "dangerTextColor":
				this.setColor(n,json);
				break;
			case "disabledInsetBorderColor":
				this.setColor(n,json);
				break;
			case "disabledInsetFillColor":
				this.setColor(n,json);
				break;
			case "disabledTextColor":
				this.setColor(n,json);
				break;
			case "dividerColor":
				this.setColor(n,json);
				break;
			case "focusBorderColor":
				this.setColor(n,json);
				break;
			case "fontName":
				this.fontName = Reflect.field(json,n);
				break;
			case "fontSize":
				this.setColor(n,json);
				break;
			case "footerFillColor":
				this.setColor(n,json);
				break;
			case "headerFillColor":
				this.setColor(n,json);
				break;
			case "headerFontName":
				this.headerFontName = Std.string(Reflect.field(json,n));
				break;
			case "headerFontSize":
				this.setColor(n,json);
				break;
			case "headerTextColor":
				this.setColor(n,json);
				break;
			case "insetBorderColor":
				this.setColor(n,json);
				break;
			case "insetFillColor":
				this.setColor(n,json);
				break;
			case "offsetDangerFillColor":
				this.setColor(n,json);
				break;
			case "offsetThemeColor":
				this.setColor(n,json);
				break;
			case "overlayFillColor":
				this.setColor(n,json);
				break;
			case "rootFillColor":
				this.setColor(n,json);
				break;
			case "scrollBarThumbDisabledFillColor":
				this.setColor(n,json);
				break;
			case "scrollBarThumbFillColor":
				this.setColor(n,json);
				break;
			case "secondaryTextColor":
				this.setColor(n,json);
				break;
			case "selectedBorderColor":
				this.setColor(n,json);
				break;
			case "selectedInsetBorderColor":
				this.setColor(n,json);
				break;
			case "subHeadingDividerColor":
				this.setColor(n,json);
				break;
			case "subHeadingFillColor":
				this.setColor(n,json);
				break;
			case "textColor":
				this.setColor(n,json);
				break;
			case "themeColor":
				this.setColor(n,json);
				break;
			}
		}
	}
};
$hxClasses["com.tilbuci.ui.PlayerTheme"] = com_tilbuci_ui_PlayerTheme;
com_tilbuci_ui_PlayerTheme.__name__ = "com.tilbuci.ui.PlayerTheme";
com_tilbuci_ui_PlayerTheme.__super__ = feathers_themes_steel_SteelTheme;
com_tilbuci_ui_PlayerTheme.prototype = $extend(feathers_themes_steel_SteelTheme.prototype,{
	headerFontName: null
	,headerTextColor: null
	,footerFillColor: null
	,listBackground: null
	,listItemBackground: null
	,listItemFont: null
	,headerBackground: null
	,get_headerBackground: function() {
		return this.headerFillColor;
	}
	,headerSize: null
	,get_headerSize: function() {
		return this.headerFontSize;
	}
	,headerFont: null
	,get_headerFont: function() {
		if(this.headerFontName == null) {
			return "_sans";
		} else {
			return this.headerFontName;
		}
	}
	,headerFontColor: null
	,get_headerFontColor: function() {
		if(this.headerTextColor == null) {
			return 16777215;
		} else {
			return this.headerTextColor;
		}
	}
	,windowBackground: null
	,get_windowBackground: function() {
		return this.rootFillColor;
	}
	,windowFontName: null
	,get_windowFontName: function() {
		return this.fontName;
	}
	,windowFontSize: null
	,get_windowFontSize: function() {
		return this.fontSize;
	}
	,setColor: function(name,json) {
		var color = Std.parseInt(Reflect.field(json,name));
		if(color != null) {
			this[name] = color;
		}
	}
	,__class__: com_tilbuci_ui_PlayerTheme
	,__properties__: $extend(feathers_themes_steel_SteelTheme.prototype.__properties__,{get_windowFontSize:"get_windowFontSize",get_windowFontName:"get_windowFontName",get_windowBackground:"get_windowBackground",get_headerFontColor:"get_headerFontColor",get_headerFont:"get_headerFont",get_headerSize:"get_headerSize",get_headerBackground:"get_headerBackground"})
});
var feathers_core_IStateObserver = function() { };
$hxClasses["feathers.core.IStateObserver"] = feathers_core_IStateObserver;
feathers_core_IStateObserver.__name__ = "feathers.core.IStateObserver";
feathers_core_IStateObserver.__isInterface__ = true;
feathers_core_IStateObserver.prototype = {
	get_stateContext: null
	,set_stateContext: null
	,__class__: feathers_core_IStateObserver
	,__properties__: {set_stateContext:"set_stateContext",get_stateContext:"get_stateContext"}
};
var feathers_skins_IProgrammaticSkin = function() { };
$hxClasses["feathers.skins.IProgrammaticSkin"] = feathers_skins_IProgrammaticSkin;
feathers_skins_IProgrammaticSkin.__name__ = "feathers.skins.IProgrammaticSkin";
feathers_skins_IProgrammaticSkin.__isInterface__ = true;
feathers_skins_IProgrammaticSkin.__interfaces__ = [feathers_core_IMeasureObject];
feathers_skins_IProgrammaticSkin.prototype = {
	get_uiContext: null
	,set_uiContext: null
	,__class__: feathers_skins_IProgrammaticSkin
	,__properties__: {set_uiContext:"set_uiContext",get_uiContext:"get_uiContext"}
};
var feathers_skins_ProgrammaticSkin = function() {
	feathers_core_MeasureSprite.call(this);
	this.mouseChildren = false;
	this.set_tabEnabled(false);
	this.set_tabChildren(false);
};
$hxClasses["feathers.skins.ProgrammaticSkin"] = feathers_skins_ProgrammaticSkin;
feathers_skins_ProgrammaticSkin.__name__ = "feathers.skins.ProgrammaticSkin";
feathers_skins_ProgrammaticSkin.__interfaces__ = [feathers_core_IStateObserver,feathers_skins_IProgrammaticSkin];
feathers_skins_ProgrammaticSkin.__super__ = feathers_core_MeasureSprite;
feathers_skins_ProgrammaticSkin.prototype = $extend(feathers_core_MeasureSprite.prototype,{
	_uiContext: null
	,get_uiContext: function() {
		return this._uiContext;
	}
	,set_uiContext: function(value) {
		if(this._uiContext == value) {
			return this._uiContext;
		}
		if(this._uiContext != null) {
			this._uiContext.removeEventListener("stateChange",$bind(this,this.uiContext_stateChangeHandler));
			if(js_Boot.__implements(this._uiContext,feathers_controls_IToggle)) {
				this._uiContext.removeEventListener("change",$bind(this,this.uiContextToggle_changeHandler));
			}
			this.onRemoveUIContext();
		}
		this._uiContext = value;
		if(this._uiContext != null) {
			this._uiContext.addEventListener("stateChange",$bind(this,this.uiContext_stateChangeHandler),false,0,true);
			if(js_Boot.__implements(this._uiContext,feathers_controls_IToggle)) {
				this._uiContext.addEventListener("change",$bind(this,this.uiContextToggle_changeHandler));
			}
			this.onAddUIContext();
		}
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		return this._uiContext;
	}
	,_stateContext: null
	,get_stateContext: function() {
		return this._stateContext;
	}
	,set_stateContext: function(value) {
		if(this._stateContext == value) {
			return this._stateContext;
		}
		if(this._stateContext != null) {
			this._stateContext.removeEventListener("stateChange",$bind(this,this.stateContext_stateChangeHandler));
		}
		this._stateContext = value;
		if(this._stateContext != null) {
			this._stateContext.addEventListener("stateChange",$bind(this,this.stateContext_stateChangeHandler),false,0,true);
		}
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		return this._stateContext;
	}
	,onAddUIContext: function() {
	}
	,onRemoveUIContext: function() {
	}
	,update: function() {
	}
	,needsStateUpdate: function() {
		return true;
	}
	,checkForStateChange: function() {
		if(!this.needsStateUpdate()) {
			return;
		}
		this.setInvalid(feathers_core_InvalidationFlag.STATE);
	}
	,uiContext_stateChangeHandler: function(event) {
		this.checkForStateChange();
	}
	,uiContextToggle_changeHandler: function(event) {
		this.checkForStateChange();
	}
	,stateContext_stateChangeHandler: function(event) {
		this.checkForStateChange();
	}
	,stateContextToggle_changeHandler: function(event) {
		this.checkForStateChange();
	}
	,__class__: feathers_skins_ProgrammaticSkin
	,__properties__: $extend(feathers_core_MeasureSprite.prototype.__properties__,{set_stateContext:"set_stateContext",get_stateContext:"get_stateContext",set_uiContext:"set_uiContext",get_uiContext:"get_uiContext"})
});
var feathers_skins_BaseGraphicsPathSkin = function(fill,border) {
	this._previousFill = null;
	this._previousBorder = null;
	feathers_skins_ProgrammaticSkin.call(this);
	this.set_fill(fill);
	this.set_border(border);
};
$hxClasses["feathers.skins.BaseGraphicsPathSkin"] = feathers_skins_BaseGraphicsPathSkin;
feathers_skins_BaseGraphicsPathSkin.__name__ = "feathers.skins.BaseGraphicsPathSkin";
feathers_skins_BaseGraphicsPathSkin.__super__ = feathers_skins_ProgrammaticSkin;
feathers_skins_BaseGraphicsPathSkin.prototype = $extend(feathers_skins_ProgrammaticSkin.prototype,{
	_previousBorder: null
	,_previousFill: null
	,_stateToFill: null
	,_fill: null
	,get_fill: function() {
		return this._fill;
	}
	,set_fill: function(value) {
		if(this._fill == value) {
			return this._fill;
		}
		if(this._previousFill == this._fill) {
			this._previousFill = null;
		}
		this._fill = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this._fill;
	}
	,_disabledFill: null
	,get_disabledFill: function() {
		return this._disabledFill;
	}
	,set_disabledFill: function(value) {
		if(this._disabledFill == value) {
			return this._disabledFill;
		}
		if(this._previousFill == this._disabledFill) {
			this._previousFill = null;
		}
		this._disabledFill = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this._disabledFill;
	}
	,_selectedFill: null
	,get_selectedFill: function() {
		return this._selectedFill;
	}
	,set_selectedFill: function(value) {
		if(this._selectedFill == value) {
			return this._selectedFill;
		}
		if(this._previousFill == this._selectedFill) {
			this._previousFill = null;
		}
		this._selectedFill = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this._selectedFill;
	}
	,_stateToBorder: null
	,_border: null
	,get_border: function() {
		return this._border;
	}
	,set_border: function(value) {
		if(this._border == value) {
			return this._border;
		}
		if(this._previousBorder == this._border) {
			this._previousBorder = null;
		}
		this._border = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this._border;
	}
	,_disabledBorder: null
	,get_disabledBorder: function() {
		return this._disabledBorder;
	}
	,set_disabledBorder: function(value) {
		if(this._disabledBorder == value) {
			return this._disabledBorder;
		}
		if(this._previousBorder == this._disabledBorder) {
			this._previousBorder = null;
		}
		this._disabledBorder = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this._disabledBorder;
	}
	,_selectedBorder: null
	,get_selectedBorder: function() {
		return this._selectedBorder;
	}
	,set_selectedBorder: function(value) {
		if(this._selectedBorder == value) {
			return this._selectedBorder;
		}
		if(this._previousBorder == this._selectedBorder) {
			this._previousBorder = null;
		}
		this._selectedBorder = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this._selectedBorder;
	}
	,getFillForState: function(state) {
		if(this._stateToFill == null) {
			return null;
		}
		return this._stateToFill.get(state);
	}
	,setFillForState: function(state,fill) {
		if(this._stateToFill == null) {
			this._stateToFill = new haxe_ds_EnumValueMap();
		}
		var oldFill = this._stateToFill.get(state);
		if(oldFill == fill) {
			return;
		}
		if(this._previousFill == oldFill) {
			this._previousFill = null;
		}
		this._stateToFill.set(state,fill);
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
	}
	,getBorderForState: function(state) {
		if(this._stateToBorder == null) {
			return null;
		}
		return this._stateToBorder.get(state);
	}
	,setBorderForState: function(state,border) {
		if(this._stateToBorder == null) {
			this._stateToBorder = new haxe_ds_EnumValueMap();
		}
		var oldBorder = this._stateToBorder.get(state);
		if(oldBorder == border) {
			return;
		}
		if(this._previousBorder == oldBorder) {
			this._previousBorder = null;
		}
		this._stateToBorder.set(state,border);
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
	}
	,update: function() {
		this._previousBorder = this.getCurrentBorder();
		this._previousFill = this.getCurrentFill();
		this.get_graphics().clear();
		this.draw();
	}
	,draw: function() {
		this.applyLineStyle(this.getCurrentBorder());
		var currentFill = this.getCurrentFill();
		this.applyFillStyle(currentFill);
		this.drawPath();
		if(currentFill != null && currentFill != feathers_graphics_FillStyle.None) {
			this.get_graphics().endFill();
		}
	}
	,drawPath: function() {
	}
	,applyLineStyle: function(lineStyle) {
		if(lineStyle == null) {
			return;
		}
		switch(lineStyle._hx_index) {
		case 0:
			var thickness = lineStyle.thickness;
			var color = lineStyle.color;
			var alpha = lineStyle.alpha;
			var pixelHinting = lineStyle.pixelHinting;
			var scaleMode = lineStyle.scaleMode;
			var caps = lineStyle.caps;
			var joints = lineStyle.joints;
			var miterLimit = lineStyle.miterLimit;
			if(color == null) {
				color = 0;
			}
			if(alpha == null) {
				alpha = 1.0;
			}
			if(pixelHinting == null) {
				pixelHinting = false;
			}
			if(scaleMode == null) {
				scaleMode = 2;
			}
			if(miterLimit == null) {
				miterLimit = 3.0;
			}
			this.get_graphics().lineStyle(thickness,color,alpha,pixelHinting,scaleMode,caps,joints,miterLimit);
			break;
		case 1:
			var thickness = lineStyle.thickness;
			var bitmapData = lineStyle.bitmapData;
			var matrix = lineStyle.matrix;
			var repeat = lineStyle.repeat;
			var smooth = lineStyle.smooth;
			if(repeat == null) {
				repeat = true;
			}
			if(smooth == null) {
				smooth = false;
			}
			this.get_graphics().lineStyle(thickness);
			this.get_graphics().lineBitmapStyle(bitmapData,matrix,repeat,smooth);
			break;
		case 2:
			var thickness = lineStyle.thickness;
			var type = lineStyle.type;
			var colors = lineStyle.colors;
			var alphas = lineStyle.alphas;
			var ratios = lineStyle.ratios;
			var matrixCallback = lineStyle.matrix;
			var spreadMethod = lineStyle.spreadMethod;
			var interpolationMethod = lineStyle.interpolationMethod;
			var focalPointRatio = lineStyle.focalPointRatio;
			var callback = matrixCallback;
			if(callback == null) {
				callback = $bind(this,this.getDefaultGradientMatrix);
			}
			if(spreadMethod == null) {
				spreadMethod = 0;
			}
			if(interpolationMethod == null) {
				interpolationMethod = 1;
			}
			if(focalPointRatio == null) {
				focalPointRatio = 0.0;
			}
			var matrix = callback(this.getDefaultGradientMatrixWidth(),this.getDefaultGradientMatrixHeight(),this.getDefaultGradientMatrixRadians(),this.getDefaultGradientMatrixTx(),this.getDefaultGradientMatrixTy());
			this.get_graphics().lineStyle(thickness);
			this.get_graphics().lineGradientStyle(type,colors,alphas,ratios,matrix,spreadMethod,interpolationMethod,focalPointRatio);
			break;
		case 3:
			this.get_graphics().lineStyle(NaN,0,0.0);
			break;
		}
	}
	,applyFillStyle: function(fillStyle) {
		if(fillStyle == null) {
			return;
		}
		switch(fillStyle._hx_index) {
		case 0:
			var color = fillStyle.color;
			var alpha = fillStyle.alpha;
			if(alpha == null) {
				alpha = 1.0;
			}
			this.get_graphics().beginFill(color,alpha);
			break;
		case 1:
			var bitmapData = fillStyle.bitmapData;
			var matrix = fillStyle.matrix;
			var repeat = fillStyle.repeat;
			var smooth = fillStyle.smoothing;
			if(repeat == null) {
				repeat = true;
			}
			if(smooth == null) {
				smooth = false;
			}
			this.get_graphics().beginBitmapFill(bitmapData,matrix,repeat,smooth);
			break;
		case 2:
			var type = fillStyle.type;
			var colors = fillStyle.colors;
			var alphas = fillStyle.alphas;
			var ratios = fillStyle.ratios;
			var matrixCallback = fillStyle.matrix;
			var spreadMethod = fillStyle.spreadMethod;
			var interpolationMethod = fillStyle.interpolationMethod;
			var focalPointRatio = fillStyle.focalPointRatio;
			var callback = matrixCallback;
			if(callback == null) {
				callback = $bind(this,this.getDefaultGradientMatrix);
			}
			if(spreadMethod == null) {
				spreadMethod = 0;
			}
			if(interpolationMethod == null) {
				interpolationMethod = 1;
			}
			if(focalPointRatio == null) {
				focalPointRatio = 0.0;
			}
			var matrix = callback(this.getDefaultGradientMatrixWidth(),this.getDefaultGradientMatrixHeight(),this.getDefaultGradientMatrixRadians(),this.getDefaultGradientMatrixTx(),this.getDefaultGradientMatrixTy());
			this.get_graphics().beginGradientFill(type,colors,alphas,ratios,matrix,spreadMethod,interpolationMethod,focalPointRatio);
			break;
		case 3:
			return;
		}
	}
	,getLineThickness: function(lineStyle) {
		if(lineStyle == null) {
			return 0;
		}
		switch(lineStyle._hx_index) {
		case 0:
			var _g = lineStyle.color;
			var _g = lineStyle.alpha;
			var _g = lineStyle.pixelHinting;
			var _g = lineStyle.scaleMode;
			var _g = lineStyle.caps;
			var _g = lineStyle.joints;
			var _g = lineStyle.miterLimit;
			var thickness = lineStyle.thickness;
			return thickness;
		case 2:
			var _g = lineStyle.matrix;
			var _g = lineStyle.spreadMethod;
			var _g = lineStyle.interpolationMethod;
			var _g = lineStyle.focalPointRatio;
			var thickness = lineStyle.thickness;
			var colors = lineStyle.type;
			var alphas = lineStyle.colors;
			var ratios = lineStyle.alphas;
			var matrixCallback = lineStyle.ratios;
			return thickness;
		default:
			return 0;
		}
	}
	,getDefaultGradientMatrix: function(width,height,radians,tx,ty) {
		if(ty == null) {
			ty = 0.0;
		}
		if(tx == null) {
			tx = 0.0;
		}
		if(radians == null) {
			radians = 0.0;
		}
		var matrix = new openfl_geom_Matrix();
		matrix.createGradientBox(width,height,radians,tx,ty);
		return matrix;
	}
	,getDefaultGradientMatrixWidth: function() {
		return this.actualWidth;
	}
	,getDefaultGradientMatrixHeight: function() {
		return this.actualHeight;
	}
	,getDefaultGradientMatrixRadians: function() {
		return 0.0;
	}
	,getDefaultGradientMatrixTx: function() {
		return 0.0;
	}
	,getDefaultGradientMatrixTy: function() {
		return 0.0;
	}
	,getCurrentBorder: function() {
		if(this._previousBorder != null) {
			return this._previousBorder;
		}
		return this.getCurrentBorderWithoutCache();
	}
	,getCurrentBorderWithoutCache: function() {
		var stateContext = this._stateContext;
		if(stateContext == null && js_Boot.__implements(this._uiContext,feathers_core_IStateContext)) {
			stateContext = this._uiContext;
		}
		if(this._stateToBorder != null && stateContext != null) {
			var result = this._stateToBorder.get(stateContext.get_currentState());
			if(result != null) {
				return result;
			}
		}
		if(this._uiContext == null) {
			return this._border;
		}
		if(this._disabledBorder != null) {
			if(!this._uiContext.get_enabled()) {
				return this._disabledBorder;
			}
		}
		if(this._selectedBorder != null && js_Boot.__implements(this._uiContext,feathers_controls_IToggle)) {
			var toggle = this._uiContext;
			if(toggle.get_selected()) {
				return this._selectedBorder;
			}
		}
		return this._border;
	}
	,getCurrentFill: function() {
		if(this._previousFill != null) {
			return this._previousFill;
		}
		return this.getCurrentFillWithoutCache();
	}
	,getCurrentFillWithoutCache: function() {
		var stateContext = this._stateContext;
		if(stateContext == null && js_Boot.__implements(this._uiContext,feathers_core_IStateContext)) {
			stateContext = this._uiContext;
		}
		if(this._stateToFill != null && stateContext != null) {
			var result = this._stateToFill.get(stateContext.get_currentState());
			if(result != null) {
				return result;
			}
		}
		if(this._uiContext == null) {
			return this._fill;
		}
		if(this._disabledFill != null) {
			if(!this._uiContext.get_enabled()) {
				return this._disabledFill;
			}
		}
		if(this._selectedFill != null && js_Boot.__implements(this._uiContext,feathers_controls_IToggle)) {
			var toggle = this._uiContext;
			if(toggle.get_selected()) {
				return this._selectedFill;
			}
		}
		return this._fill;
	}
	,needsStateUpdate: function() {
		var updated = false;
		if(this._previousBorder != this.getCurrentBorderWithoutCache()) {
			this._previousBorder = null;
			updated = true;
		}
		if(this._previousFill != this.getCurrentFillWithoutCache()) {
			this._previousFill = null;
			updated = true;
		}
		return updated;
	}
	,__class__: feathers_skins_BaseGraphicsPathSkin
	,__properties__: $extend(feathers_skins_ProgrammaticSkin.prototype.__properties__,{set_selectedBorder:"set_selectedBorder",get_selectedBorder:"get_selectedBorder",set_disabledBorder:"set_disabledBorder",get_disabledBorder:"get_disabledBorder",set_border:"set_border",get_border:"get_border",set_selectedFill:"set_selectedFill",get_selectedFill:"get_selectedFill",set_disabledFill:"set_disabledFill",get_disabledFill:"get_disabledFill",set_fill:"set_fill",get_fill:"get_fill"})
});
var feathers_skins_RectangleSkin = function(fill,border) {
	this._cornerRadius = 0.0;
	feathers_skins_BaseGraphicsPathSkin.call(this,fill,border);
};
$hxClasses["feathers.skins.RectangleSkin"] = feathers_skins_RectangleSkin;
feathers_skins_RectangleSkin.__name__ = "feathers.skins.RectangleSkin";
feathers_skins_RectangleSkin.__super__ = feathers_skins_BaseGraphicsPathSkin;
feathers_skins_RectangleSkin.prototype = $extend(feathers_skins_BaseGraphicsPathSkin.prototype,{
	_cornerRadius: null
	,get_cornerRadius: function() {
		return this._cornerRadius;
	}
	,set_cornerRadius: function(value) {
		if(this._cornerRadius == value) {
			return this._cornerRadius;
		}
		this._cornerRadius = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this._cornerRadius;
	}
	,drawPath: function() {
		var currentBorder = this.getCurrentBorder();
		var thickness = this.getLineThickness(currentBorder);
		var thicknessOffset = thickness / 2.0;
		var drawWidth = Math.max(0.0,this.actualWidth - thickness);
		var drawHeight = Math.max(0.0,this.actualHeight - thickness);
		if(this._cornerRadius == 0.0) {
			this.get_graphics().drawRect(thicknessOffset,thicknessOffset,drawWidth,drawHeight);
		} else {
			var ellipseSize = this._cornerRadius * 2.0;
			ellipseSize = Math.min(ellipseSize,Math.min(this.actualWidth,this.actualHeight));
			this.get_graphics().drawRoundRect(thicknessOffset,thicknessOffset,drawWidth,drawHeight,ellipseSize);
		}
	}
	,__class__: feathers_skins_RectangleSkin
	,__properties__: $extend(feathers_skins_BaseGraphicsPathSkin.prototype.__properties__,{set_cornerRadius:"set_cornerRadius",get_cornerRadius:"get_cornerRadius"})
});
var com_tilbuci_ui_base_BackgroundSkin = function(color) {
	if(color == null) {
		color = 6710886;
	}
	feathers_skins_RectangleSkin.call(this);
	this.set_fill(feathers_graphics_FillStyle.SolidColor(color));
};
$hxClasses["com.tilbuci.ui.base.BackgroundSkin"] = com_tilbuci_ui_base_BackgroundSkin;
com_tilbuci_ui_base_BackgroundSkin.__name__ = "com.tilbuci.ui.base.BackgroundSkin";
com_tilbuci_ui_base_BackgroundSkin.__super__ = feathers_skins_RectangleSkin;
com_tilbuci_ui_base_BackgroundSkin.prototype = $extend(feathers_skins_RectangleSkin.prototype,{
	__class__: com_tilbuci_ui_base_BackgroundSkin
});
var com_tilbuci_ui_base_ConfirmWindow = function(tit,txt,wd,ht,oktxt,ac,mode,canceltxt) {
	if(canceltxt == null) {
		canceltxt = "";
	}
	if(mode == null) {
		mode = "warn";
	}
	feathers_controls_Panel.call(this);
	var lay = new feathers_layout_VerticalLayout();
	lay.setPadding(10);
	lay.set_gap(20);
	lay.set_verticalAlign(feathers_layout_VerticalAlign.TOP);
	lay.set_horizontalAlign(feathers_layout_HorizontalAlign.LEFT);
	this.set_backgroundSkin(new com_tilbuci_ui_base_BackgroundSkin(3684408));
	this.set_layout(lay);
	this.set_width(wd);
	this.set_height(ht);
	var hd = new feathers_controls_Header();
	hd.set_text(tit);
	this.set_header(hd);
	var lb = new feathers_controls_Label();
	lb.set_text(txt);
	lb.set_wordWrap(true);
	lb.set_width(wd - 30);
	this.addChild(lb);
	this._btOk = new feathers_controls_Button();
	this._btOk.set_text(oktxt);
	this._btOk.addEventListener("trigger",$bind(this,this.onBtOk));
	this._btOk.set_width(lb.get_width());
	this.addChild(this._btOk);
	this._ac = ac;
	this._btCancel = new feathers_controls_Button();
	this._btCancel.set_text(canceltxt);
	this._btCancel.addEventListener("trigger",$bind(this,this.onBtCancel));
	this._btCancel.set_width(lb.get_width());
	if(mode == "confirm") {
		this.addChild(this._btCancel);
	}
};
$hxClasses["com.tilbuci.ui.base.ConfirmWindow"] = com_tilbuci_ui_base_ConfirmWindow;
com_tilbuci_ui_base_ConfirmWindow.__name__ = "com.tilbuci.ui.base.ConfirmWindow";
com_tilbuci_ui_base_ConfirmWindow.__super__ = feathers_controls_Panel;
com_tilbuci_ui_base_ConfirmWindow.prototype = $extend(feathers_controls_Panel.prototype,{
	_btOk: null
	,_btCancel: null
	,_ac: null
	,onBtOk: function(evt) {
		this._btOk.removeEventListener("trigger",$bind(this,this.onBtOk));
		this._btCancel.removeEventListener("trigger",$bind(this,this.onBtCancel));
		this._btOk = null;
		this._btCancel = null;
		this.removeChildren();
		feathers_core_PopUpManager.removePopUp(this);
		if(this._ac != null) {
			this._ac(true);
		}
		this._ac = null;
	}
	,onBtCancel: function(evt) {
		this._btOk.removeEventListener("trigger",$bind(this,this.onBtOk));
		this._btCancel.removeEventListener("trigger",$bind(this,this.onBtCancel));
		this._btOk = null;
		this._btCancel = null;
		this.removeChildren();
		feathers_core_PopUpManager.removePopUp(this);
		if(this._ac != null) {
			this._ac(false);
		}
		this._ac = null;
	}
	,__class__: com_tilbuci_ui_base_ConfirmWindow
});
var feathers_controls_HDividedBox = function() {
	this._fallbackFluidIndex = -1;
	this._customItemWidths = [];
	this.initializeHDividedBoxTheme();
	feathers_controls_supportClasses_BaseDividedBox.call(this);
	this.resizeCursor = openfl_ui_MouseCursor.fromLimeCursor(lime_ui_MouseCursor.RESIZE_WE);
};
$hxClasses["feathers.controls.HDividedBox"] = feathers_controls_HDividedBox;
feathers_controls_HDividedBox.__name__ = "feathers.controls.HDividedBox";
feathers_controls_HDividedBox.__super__ = feathers_controls_supportClasses_BaseDividedBox;
feathers_controls_HDividedBox.prototype = $extend(feathers_controls_supportClasses_BaseDividedBox.prototype,{
	_hDividedBoxLayout: null
	,_customItemWidths: null
	,_fallbackFluidIndex: null
	,_resizeStartStageX: null
	,_resizeStartWidth1: null
	,_resizeStartWidth2: null
	,initializeHDividedBoxTheme: function() {
		feathers_themes_steel_components_SteelHDividedBoxStyles.initialize();
	}
	,addItemAt: function(child,index) {
		var result = feathers_controls_supportClasses_BaseDividedBox.prototype.addItemAt.call(this,child,index);
		var explicitWidth = null;
		if(js_Boot.__implements(child,feathers_core_IMeasureObject)) {
			var measureChild = child;
			explicitWidth = measureChild.get_explicitWidth();
		}
		this._customItemWidths.splice(index,0,explicitWidth);
		var layoutIndex = this._layoutItems.indexOf(child);
		if(explicitWidth == null) {
			if(this._fallbackFluidIndex == -1 || layoutIndex > this._fallbackFluidIndex) {
				this._fallbackFluidIndex = layoutIndex;
			}
		}
		return result;
	}
	,removeItem: function(child) {
		var index = this.items.indexOf(child);
		var layoutIndex = this._layoutItems.indexOf(child);
		if(this._fallbackFluidIndex == layoutIndex) {
			this._fallbackFluidIndex = -1;
		}
		var result = feathers_controls_supportClasses_BaseDividedBox.prototype.removeItem.call(this,child);
		if(index != -1) {
			this._customItemWidths.splice(index,1);
		}
		return result;
	}
	,initialize: function() {
		feathers_controls_supportClasses_BaseDividedBox.prototype.initialize.call(this);
		if(this._hDividedBoxLayout == null) {
			this._hDividedBoxLayout = new feathers_layout_HDividedBoxLayout();
		}
		this._hDividedBoxLayout.set_customItemWidths(this._customItemWidths);
		this.layout = this._hDividedBoxLayout;
	}
	,handleLayout: function() {
		var oldIgnoreChildChanges = this._ignoreChildChanges;
		this._ignoreChildChanges = true;
		this._hDividedBoxLayout.set_fallbackFluidIndex(this._fallbackFluidIndex);
		this._ignoreChildChanges = oldIgnoreChildChanges;
		feathers_controls_supportClasses_BaseDividedBox.prototype.handleLayout.call(this);
	}
	,prepareResize: function(dividerIndex,stageX,stageY) {
		this._resizeStartStageX = stageX;
		var firstItem = this.items[dividerIndex];
		var secondItem = this.items[dividerIndex + 1];
		this._resizeStartWidth1 = firstItem.get_width();
		this._resizeStartWidth2 = secondItem.get_width();
		if(this._currentResizeDraggingSkin != null) {
			var divider = this.dividers[dividerIndex];
			this._currentResizeDraggingSkin.set_y(divider.get_y());
			this._currentResizeDraggingSkin.set_height(divider.get_height());
			if(js_Boot.__implements(this._currentResizeDraggingSkin,feathers_core_IValidating)) {
				this._currentResizeDraggingSkin.validateNow();
			}
			this._currentResizeDraggingSkin.set_x(divider.get_x() + (divider.get_width() - this._currentResizeDraggingSkin.get_width()) / 2.0);
		}
	}
	,commitResize: function(dividerIndex,stageX,stageY,live) {
		var offsetX = stageX - this._resizeStartStageX;
		offsetX *= feathers_utils_DisplayUtil.getConcatenatedScaleX(this);
		if(live && !this.liveDragging) {
			if(this._currentResizeDraggingSkin != null) {
				var divider = this.dividers[dividerIndex];
				this._currentResizeDraggingSkin.set_y(divider.get_y());
				this._currentResizeDraggingSkin.set_height(divider.get_height());
				if(js_Boot.__implements(this._currentResizeDraggingSkin,feathers_core_IValidating)) {
					this._currentResizeDraggingSkin.validateNow();
				}
				this._currentResizeDraggingSkin.set_x(divider.get_x() + offsetX + (divider.get_width() - this._currentResizeDraggingSkin.get_width()) / 2.0);
			}
			return;
		}
		var firstItem = this.items[dividerIndex];
		var secondItem = this.items[dividerIndex + 1];
		var totalWidth = this._resizeStartWidth1 + this._resizeStartWidth2;
		var secondItemWidth = this._resizeStartWidth2 - offsetX;
		if(js_Boot.__implements(secondItem,feathers_core_IMeasureObject)) {
			var secondMeasureItem = secondItem;
			if(secondMeasureItem.get_explicitMinWidth() != null && secondItemWidth < secondMeasureItem.get_explicitMinWidth()) {
				secondItemWidth = secondMeasureItem.get_explicitMinWidth();
			} else if(secondMeasureItem.get_explicitMaxWidth() != null && secondItemWidth > secondMeasureItem.get_explicitMaxWidth()) {
				secondItemWidth = secondMeasureItem.get_explicitMaxWidth();
			}
		}
		if(secondItemWidth < 0.0) {
			secondItemWidth = 0.0;
		} else if(secondItemWidth > totalWidth) {
			secondItemWidth = totalWidth;
		}
		var firstItemWidth = totalWidth - secondItemWidth;
		if(js_Boot.__implements(firstItem,feathers_core_IMeasureObject)) {
			var firstMeasureItem = firstItem;
			if(firstMeasureItem.get_explicitMinWidth() != null && firstItemWidth < firstMeasureItem.get_explicitMinWidth()) {
				firstItemWidth = firstMeasureItem.get_explicitMinWidth();
			} else if(firstMeasureItem.get_explicitMaxWidth() != null && firstItemWidth > firstMeasureItem.get_explicitMaxWidth()) {
				firstItemWidth = firstMeasureItem.get_explicitMaxWidth();
			}
		}
		if(firstItemWidth < 0.0) {
			firstItemWidth = 0.0;
		} else if(firstItemWidth > totalWidth) {
			firstItemWidth = totalWidth;
		}
		secondItemWidth = totalWidth - firstItemWidth;
		this._customItemWidths[dividerIndex] = firstItemWidth;
		this._customItemWidths[dividerIndex + 1] = secondItemWidth;
		this.setInvalid(feathers_core_InvalidationFlag.LAYOUT);
	}
	,baseDividedBox_child_layoutDataChangeHandler: function(event) {
		feathers_controls_supportClasses_BaseDividedBox.prototype.baseDividedBox_child_layoutDataChangeHandler.call(this,event);
		var layoutObject = js_Boot.__cast(event.currentTarget , feathers_layout_ILayoutObject);
		var layoutIndex = this._layoutItems.indexOf(layoutObject);
		if(!layoutObject.get_includeInLayout() && this._fallbackFluidIndex == layoutIndex) {
			this._fallbackFluidIndex = -1;
		}
	}
	,baseDividedBox_child_resizeHandler: function(event) {
		if(this._ignoreChildChanges) {
			return;
		}
		var child = event.currentTarget;
		var index = this.items.indexOf(child);
		if(index == -1) {
			return;
		}
		var explicitWidth = null;
		if(js_Boot.__implements(child,feathers_core_IMeasureObject)) {
			var measureChild = child;
			explicitWidth = measureChild.get_explicitWidth();
		}
		this._customItemWidths[index] = explicitWidth;
		var layoutIndex = this._layoutItems.indexOf(child);
		if(explicitWidth == null) {
			if(this._fallbackFluidIndex == -1 || layoutIndex > this._fallbackFluidIndex) {
				this._fallbackFluidIndex = layoutIndex;
			}
		}
		this.setInvalid(feathers_core_InvalidationFlag.LAYOUT);
	}
	,__class__: feathers_controls_HDividedBox
});
var com_tilbuci_ui_base_HInterfaceContainer = function() {
	feathers_controls_HDividedBox.call(this);
};
$hxClasses["com.tilbuci.ui.base.HInterfaceContainer"] = com_tilbuci_ui_base_HInterfaceContainer;
com_tilbuci_ui_base_HInterfaceContainer.__name__ = "com.tilbuci.ui.base.HInterfaceContainer";
com_tilbuci_ui_base_HInterfaceContainer.__super__ = feathers_controls_HDividedBox;
com_tilbuci_ui_base_HInterfaceContainer.prototype = $extend(feathers_controls_HDividedBox.prototype,{
	replaceChildren: function(newOnes) {
		this.removeChildren();
		var _g = 0;
		var _g1 = newOnes.length;
		while(_g < _g1) {
			var n = _g++;
			this.addChild(newOnes[n]);
		}
	}
	,setWidth: function(wd,indv) {
		this.set_width(wd);
		if(this.get_numChildren() > 0) {
			if(indv != null && indv.length == this.get_numChildren()) {
				var _g = 0;
				var _g1 = indv.length;
				while(_g < _g1) {
					var i = _g++;
					this.getChildAt(i).set_width(indv[i]);
				}
			} else {
				var each = (wd - (this.get_numChildren() - 1) * 10) / this.get_numChildren();
				var _g = 0;
				var _g1 = this.get_numChildren();
				while(_g < _g1) {
					var i = _g++;
					this.getChildAt(i).set_width(each);
				}
			}
		}
	}
	,__class__: com_tilbuci_ui_base_HInterfaceContainer
});
var com_tilbuci_ui_base_HPanelContainer = function() {
	feathers_controls_LayoutGroup.call(this);
	var lay = new feathers_layout_HorizontalLayout();
	lay.set_gap(10);
	this.set_layout(lay);
};
$hxClasses["com.tilbuci.ui.base.HPanelContainer"] = com_tilbuci_ui_base_HPanelContainer;
com_tilbuci_ui_base_HPanelContainer.__name__ = "com.tilbuci.ui.base.HPanelContainer";
com_tilbuci_ui_base_HPanelContainer.__super__ = feathers_controls_LayoutGroup;
com_tilbuci_ui_base_HPanelContainer.prototype = $extend(feathers_controls_LayoutGroup.prototype,{
	replaceChildren: function(newOnes) {
		var wd = this.get_width();
		this.removeChildren();
		var _g = 0;
		var _g1 = newOnes.length;
		while(_g < _g1) {
			var n = _g++;
			this.addChild(newOnes[n]);
		}
		this.setWidth(Math.round(wd));
	}
	,setWidth: function(wd) {
		if(this.get_numChildren() > 0) {
			var each = (wd - (this.get_numChildren() - 1) * 10) / this.get_numChildren();
			haxe_Log.trace("wd",{ fileName : "Source/com/tilbuci/ui/base/HPanelContainer.hx", lineNumber : 48, className : "com.tilbuci.ui.base.HPanelContainer", methodName : "setWidth", customParams : [wd,"each",each]});
			var _g = 0;
			var _g1 = this.get_numChildren();
			while(_g < _g1) {
				var i = _g++;
				this.getChildAt(i).set_width(each);
				haxe_Log.trace("set",{ fileName : "Source/com/tilbuci/ui/base/HPanelContainer.hx", lineNumber : 52, className : "com.tilbuci.ui.base.HPanelContainer", methodName : "setWidth", customParams : [this.getChildAt(i),this.getChildAt(i).get_width()]});
			}
		}
	}
	,__class__: com_tilbuci_ui_base_HPanelContainer
});
var com_tilbuci_ui_base_InterfaceColumns = function(lf,rt,bt,ht) {
	if(ht == null) {
		ht = 0;
	}
	feathers_controls_VDividedBox.call(this);
	this.set_layoutData(feathers_layout_AnchorLayoutData.fill());
	var bgSkin = new feathers_skins_RectangleSkin();
	bgSkin.set_fill(feathers_graphics_FillStyle.SolidColor(6710886));
	this.set_backgroundSkin(bgSkin);
	var cols = new feathers_controls_HDividedBox();
	cols.set_layoutData(feathers_layout_AnchorLayoutData.fill());
	cols.set_backgroundSkin(bgSkin);
	this.left = lf;
	this.right = rt;
	cols.addChild(this.left);
	cols.addChild(this.right);
	this.addChild(cols);
	if(bt != null) {
		this.bottom = bt;
		this.bottom.set_backgroundSkin(bgSkin);
		this.addChild(this.bottom);
		if(ht > 0) {
			cols.set_minHeight(ht);
		}
	}
};
$hxClasses["com.tilbuci.ui.base.InterfaceColumns"] = com_tilbuci_ui_base_InterfaceColumns;
com_tilbuci_ui_base_InterfaceColumns.__name__ = "com.tilbuci.ui.base.InterfaceColumns";
com_tilbuci_ui_base_InterfaceColumns.__super__ = feathers_controls_VDividedBox;
com_tilbuci_ui_base_InterfaceColumns.prototype = $extend(feathers_controls_VDividedBox.prototype,{
	left: null
	,right: null
	,bottom: null
	,__class__: com_tilbuci_ui_base_InterfaceColumns
});
var com_tilbuci_ui_base_InterfaceContainer = function(lay,gap,bgcolor,border) {
	if(border == null) {
		border = -1;
	}
	if(bgcolor == null) {
		bgcolor = -1;
	}
	if(gap == null) {
		gap = -1;
	}
	if(lay == null) {
		lay = "";
	}
	feathers_controls_ScrollContainer.call(this);
	if(lay == "v") {
		var lay1 = new feathers_layout_VerticalLayout();
		if(gap > 0) {
			lay1.set_gap(gap);
			lay1.setPadding(gap);
		} else if(gap == 0) {
			lay1.set_gap(10);
			lay1.setPadding(0);
		}
		this.set_layout(lay1);
	} else if(lay == "h") {
		var lay = new feathers_layout_HorizontalLayout();
		if(gap > 0) {
			lay.set_gap(gap);
			lay.setPadding(gap);
		}
		this.set_layout(lay);
	}
	if(bgcolor >= 0) {
		var skin = new feathers_skins_RectangleSkin();
		skin.set_fill(feathers_graphics_FillStyle.SolidColor(bgcolor));
		if(border >= 0) {
			skin.set_border(feathers_graphics_LineStyle.SolidColor(1,border));
		}
		this.set_backgroundSkin(skin);
	}
};
$hxClasses["com.tilbuci.ui.base.InterfaceContainer"] = com_tilbuci_ui_base_InterfaceContainer;
com_tilbuci_ui_base_InterfaceContainer.__name__ = "com.tilbuci.ui.base.InterfaceContainer";
com_tilbuci_ui_base_InterfaceContainer.__super__ = feathers_controls_ScrollContainer;
com_tilbuci_ui_base_InterfaceContainer.prototype = $extend(feathers_controls_ScrollContainer.prototype,{
	replaceChildren: function(newOnes) {
		this.removeChildren();
		var _g = 0;
		var _g1 = newOnes.length;
		while(_g < _g1) {
			var n = _g++;
			this.addChild(newOnes[n]);
		}
	}
	,__class__: com_tilbuci_ui_base_InterfaceContainer
});
var com_tilbuci_ui_base_InterfaceFactory = function(padding) {
	if(padding == null) {
		padding = 10;
	}
	this.lists = new haxe_ds_StringMap();
	this.selects = new haxe_ds_StringMap();
	this._btActions = new haxe_ds_StringMap();
	this.toggles = new haxe_ds_StringMap();
	this.buttons = new haxe_ds_StringMap();
	this.spacers = new haxe_ds_StringMap();
	this.numerics = new haxe_ds_StringMap();
	this.tareas = new haxe_ds_StringMap();
	this.inputs = new haxe_ds_StringMap();
	this.labels = new haxe_ds_StringMap();
	this.hcontainers = new haxe_ds_StringMap();
	this.containers = new haxe_ds_StringMap();
	this.columns = new haxe_ds_StringMap();
	this._padding = 10;
	this._padding = padding;
	this._vLayout = new feathers_layout_VerticalLayout();
	this._vLayout.setPadding(this._padding);
	this._vLayout.set_gap(this._padding / 2);
	this._vLayout.set_verticalAlign(feathers_layout_VerticalAlign.TOP);
	this._vLayout.set_horizontalAlign(feathers_layout_HorizontalAlign.LEFT);
	this._hLayout = new feathers_layout_HorizontalLayout();
	this._hLayout.setPadding(this._padding);
	this._hLayout.set_gap(this._padding / 2);
	this._hLayout.set_verticalAlign(feathers_layout_VerticalAlign.TOP);
	this._hLayout.set_horizontalAlign(feathers_layout_HorizontalAlign.LEFT);
};
$hxClasses["com.tilbuci.ui.base.InterfaceFactory"] = com_tilbuci_ui_base_InterfaceFactory;
com_tilbuci_ui_base_InterfaceFactory.__name__ = "com.tilbuci.ui.base.InterfaceFactory";
com_tilbuci_ui_base_InterfaceFactory.pickValue = function(desktop,mobile) {
	if(feathers_utils_DeviceUtil.isMobile()) {
		return mobile;
	} else {
		return desktop;
	}
};
com_tilbuci_ui_base_InterfaceFactory.prototype = {
	_vLayout: null
	,_hLayout: null
	,_padding: null
	,columns: null
	,containers: null
	,hcontainers: null
	,lastCont: null
	,labels: null
	,inputs: null
	,lastInput: null
	,tareas: null
	,numerics: null
	,spacers: null
	,buttons: null
	,toggles: null
	,_btActions: null
	,selects: null
	,lists: null
	,createColumnHolder: function(id,left,right,bottom,ht) {
		if(ht == null) {
			ht = 0;
		}
		var cols = new com_tilbuci_ui_base_InterfaceColumns(left,right,bottom,ht);
		this.columns.h[id] = cols;
		return cols;
	}
	,createContainer: function(id,padding) {
		if(padding == null) {
			padding = -1;
		}
		var cont = new com_tilbuci_ui_base_InterfaceContainer();
		cont.set_backgroundSkin(new com_tilbuci_ui_base_BackgroundSkin());
		if(padding < 0) {
			cont.set_layout(this._vLayout);
		} else {
			var vLayout = new feathers_layout_VerticalLayout();
			vLayout.setPadding(padding);
			vLayout.set_gap(padding / 2);
			vLayout.set_verticalAlign(feathers_layout_VerticalAlign.TOP);
			vLayout.set_horizontalAlign(feathers_layout_HorizontalAlign.LEFT);
			cont.set_layout(vLayout);
		}
		this.containers.h[id] = cont;
		this.lastCont = cont;
		return cont;
	}
	,createHContainer: function(id,bgcolor) {
		if(bgcolor == null) {
			bgcolor = -1;
		}
		var cont = new com_tilbuci_ui_base_HInterfaceContainer();
		if(bgcolor >= 0) {
			var skin = new feathers_skins_RectangleSkin();
			skin.set_fill(feathers_graphics_FillStyle.SolidColor(bgcolor));
			cont.set_backgroundSkin(skin);
		} else {
			cont.set_backgroundSkin(new com_tilbuci_ui_base_BackgroundSkin());
		}
		this.hcontainers.h[id] = cont;
		return cont;
	}
	,createHArea: function(align,color,pading) {
		if(pading == null) {
			pading = 10;
		}
		if(color == null) {
			color = 10066329;
		}
		if(align == null) {
			align = "left";
		}
		var pn = new feathers_controls_Panel();
		var lay = new feathers_layout_HorizontalLayout();
		lay.set_gap(pading);
		lay.setPadding(pading);
		switch(align) {
		case "left":
			lay.set_horizontalAlign(feathers_layout_HorizontalAlign.LEFT);
			break;
		case "right":
			lay.set_horizontalAlign(feathers_layout_HorizontalAlign.RIGHT);
			break;
		default:
			lay.set_horizontalAlign(feathers_layout_HorizontalAlign.CENTER);
		}
		pn.set_layout(lay);
		var skin = new feathers_skins_RectangleSkin();
		skin.set_fill(feathers_graphics_FillStyle.SolidColor(color));
		pn.set_backgroundSkin(skin);
		return pn;
	}
	,createWarning: function(tit,txt,wd,ht,st,ac,bttxt) {
		if(bttxt == null) {
			bttxt = "Ok";
		}
		var cw = new com_tilbuci_ui_base_ConfirmWindow(tit,txt,wd,ht,bttxt,ac,"warn");
		if(st != null) {
			feathers_core_PopUpManager.addPopUp(cw,st);
		}
		return cw;
	}
	,createConfirm: function(tit,txt,wd,ht,ac,oktxt,canceltxt,st) {
		var cw = new com_tilbuci_ui_base_ConfirmWindow(tit,txt,wd,ht,oktxt,ac,"confirm",canceltxt);
		if(st != null) {
			feathers_core_PopUpManager.addPopUp(cw,st);
		}
		return cw;
	}
	,createLabel: function(id,txt,variant,holder,autoR) {
		if(autoR == null) {
			autoR = true;
		}
		if(variant == null) {
			variant = "";
		}
		var lb = new com_tilbuci_ui_component_IDLabel();
		if(variant != "") {
			lb.set_variant(variant);
		}
		lb.set_text(txt);
		lb.autoResize = autoR;
		if(holder != null) {
			holder.addChild(lb);
		}
		this.labels.h[id] = lb;
		return lb;
	}
	,createDescription: function(id,txt,variant,holder,autoR) {
		if(autoR == null) {
			autoR = true;
		}
		if(variant == null) {
			variant = "";
		}
		var lb = new com_tilbuci_ui_component_IDLabel();
		lb.set_wordWrap(true);
		lb.set_htmlText(txt);
		lb.autoResize = autoR;
		if(holder != null) {
			holder.addChild(lb);
		}
		this.labels.h[id] = lb;
		return lb;
	}
	,createTInput: function(id,txt,variant,holder,autoR,onchange) {
		if(autoR == null) {
			autoR = true;
		}
		if(variant == null) {
			variant = "";
		}
		if(txt == null) {
			txt = "";
		}
		var tx = new com_tilbuci_ui_component_IDTextInput();
		tx.set_text(txt);
		tx.autoResize = autoR;
		if(variant != "") {
			tx.set_variant(variant);
		}
		if(holder != null) {
			holder.addChild(tx);
		}
		this.inputs.h[id] = tx;
		this.lastInput = tx;
		if(onchange != null) {
			tx.addEventListener("change",onchange);
		}
		return tx;
	}
	,createNumeric: function(id,min,max,step,val,holder) {
		if(val == null) {
			val = 0;
		}
		if(step == null) {
			step = 1;
		}
		if(max == null) {
			max = 100;
		}
		if(min == null) {
			min = 0;
		}
		var st = new feathers_controls_NumericStepper();
		st.set_minimum(min);
		st.set_maximum(max);
		st.set_step(step);
		st.set_value(val);
		st.set_valueParseFunction($bind(this,this.numericParser));
		this.numerics.h[id] = st;
		if(holder != null) {
			holder.addChild(st);
		}
		return st;
	}
	,numericParser: function(txt) {
		var val = com_tilbuci_data_Global.evaluate(txt);
		if(val == null) {
			return NaN;
		} else {
			return parseFloat(val);
		}
	}
	,createToggle: function(id,val,holder,change) {
		if(val == null) {
			val = false;
		}
		var tg = new feathers_controls_ToggleSwitch();
		tg.set_selected(val);
		this.toggles.h[id] = tg;
		if(change != null) {
			tg.addEventListener("change",change);
		}
		if(holder != null) {
			holder.addChild(tg);
		}
		return tg;
	}
	,createTArea: function(id,txt,enabled,variant,holder) {
		if(variant == null) {
			variant = "";
		}
		if(enabled == null) {
			enabled = true;
		}
		if(txt == null) {
			txt = "";
		}
		var tx = new feathers_controls_TextArea();
		tx.set_text(txt);
		tx.set_enabled(enabled);
		if(variant != "") {
			tx.set_variant(variant);
		}
		if(holder != null) {
			holder.addChild(tx);
		}
		tx.set_height(75);
		this.tareas.h[id] = tx;
		return tx;
	}
	,createButton: function(id,txt,ac,holder,autoR) {
		if(autoR == null) {
			autoR = true;
		}
		var bt = new com_tilbuci_ui_component_IDButton(id,ac,txt,null,autoR);
		bt.set_horizontalAlign(feathers_layout_HorizontalAlign.CENTER);
		if(holder != null) {
			holder.addChild(bt);
		}
		this.buttons.h[id] = bt;
		var v = ac;
		this._btActions.h[id] = v;
		return bt;
	}
	,createIconButton: function(id,ac,icon,txt,holder,autoR) {
		if(autoR == null) {
			autoR = true;
		}
		var bt = new com_tilbuci_ui_component_IDButton(id,ac);
		icon.smoothing = true;
		icon.set_width(icon.set_height(20));
		bt.set_icon(icon);
		bt.autoResize = autoR;
		if(txt != null) {
			bt.set_text(txt);
		}
		bt.set_horizontalAlign(feathers_layout_HorizontalAlign.CENTER);
		if(holder != null) {
			holder.addChild(bt);
		}
		this.buttons.h[id] = bt;
		var v = ac;
		this._btActions.h[id] = v;
		return bt;
	}
	,disableButton: function(id,txt) {
		if(Object.prototype.hasOwnProperty.call(this.buttons.h,id)) {
			this.buttons.h[id].set_enabled(false);
			if(txt != null) {
				this.buttons.h[id].set_text(txt);
			}
			return true;
		} else {
			return false;
		}
	}
	,enableButton: function(id,txt) {
		if(Object.prototype.hasOwnProperty.call(this.buttons.h,id)) {
			this.buttons.h[id].set_enabled(true);
			if(txt != null) {
				this.buttons.h[id].set_text(txt);
			}
			return true;
		} else {
			return false;
		}
	}
	,createSpacer: function(id,ht,line,holder) {
		if(line == null) {
			line = false;
		}
		if(ht == null) {
			ht = 10;
		}
		var sp = new feathers_core_MeasureSprite();
		sp.set_width(10);
		sp.set_height(ht);
		if(line) {
			var posline = Math.ceil(ht / 2);
			sp.get_graphics().beginFill(10987431);
			sp.get_graphics().drawRect(0,posline,sp.get_width(),1);
			sp.get_graphics().endFill();
		}
		this.spacers.h[id] = sp;
		if(holder != null) {
			holder.addChild(sp);
		}
		return sp;
	}
	,createSelect: function(id,values,selected,holder,autoR) {
		if(autoR == null) {
			autoR = true;
		}
		var sl = new com_tilbuci_ui_component_IDPopUpListView();
		sl.set_dataProvider(new feathers_data_ArrayCollection(values));
		sl.itemToText = function(item) {
			return item.text;
		};
		sl.autoResize = autoR;
		this.selects.h[id] = sl;
		if(selected != null) {
			this.setSelectValue(id,selected);
		}
		if(holder != null) {
			holder.addChild(sl);
		}
		return sl;
	}
	,setSelectOptions: function(id,to,val) {
		if(Object.prototype.hasOwnProperty.call(this.selects.h,id)) {
			this.selects.h[id].set_dataProvider(new feathers_data_ArrayCollection(to));
			if(val != null) {
				return this.setSelectValue(id,val);
			} else {
				return true;
			}
		} else {
			return false;
		}
	}
	,setSelectValue: function(id,val) {
		if(Object.prototype.hasOwnProperty.call(this.selects.h,id)) {
			var found = false;
			var _g = 0;
			var _g1 = this.selects.h[id].get_dataProvider().get_length();
			while(_g < _g1) {
				var n = _g++;
				if(this.selects.h[id].get_dataProvider().get(n).value == val) {
					this.selects.h[id].set_selectedIndex(n);
					found = true;
				}
			}
			return found;
		} else {
			return false;
		}
	}
	,selectChange: function(id,ac,acOpen) {
		if(Object.prototype.hasOwnProperty.call(this.selects.h,id)) {
			this.selects.h[id].addEventListener("change",ac);
			if(acOpen != null) {
				this.selects.h[id].addEventListener("open",acOpen);
			}
			return true;
		} else {
			return false;
		}
	}
	,createList: function(id,values,ht,selected,holder) {
		if(ht == null) {
			ht = 100;
		}
		var sl = new feathers_controls_ListView();
		sl.set_dataProvider(new feathers_data_ArrayCollection(values));
		sl.itemToText = function(item) {
			return item.text;
		};
		sl.set_height(ht);
		sl.doubleClickEnabled = true;
		var recycler = feathers_utils_DisplayObjectRecycler.withFunction(function() {
			var itemRenderer = new feathers_controls_dataRenderers_ItemRenderer();
			itemRenderer.doubleClickEnabled = true;
			return itemRenderer;
		});
		sl.set_itemRendererRecycler(recycler);
		recycler.update = function(itemRenderer,state) {
			itemRenderer.set_text(state.text);
			var _g = 0;
			var _g1 = itemRenderer.get_numChildren();
			while(_g < _g1) {
				var ch = _g++;
				var o = itemRenderer.getChildAt(ch);
				if(Object.prototype.hasOwnProperty.call(o,"doubleClickEnabled")) {
					itemRenderer.getChildAt(ch)["doubleClickEnabled"] = true;
				}
			}
		};
		this.lists.h[id] = sl;
		if(selected != null) {
			this.setListSelectValue(id,selected);
		}
		if(holder != null) {
			holder.addChild(sl);
		}
		return sl;
	}
	,setListToIcon: function(id) {
		if(Object.prototype.hasOwnProperty.call(this.lists.h,id)) {
			var recycler = feathers_utils_DisplayObjectRecycler.withFunction(function() {
				var itemRenderer = new feathers_controls_dataRenderers_ItemRenderer();
				itemRenderer.set_icon(new feathers_controls_AssetLoader());
				itemRenderer.doubleClickEnabled = true;
				return itemRenderer;
			});
			this.lists.h[id].set_itemRendererRecycler(recycler);
			recycler.update = function(itemRenderer,state) {
				itemRenderer.set_text(state.text);
				itemRenderer.set_secondaryText(state.data.user);
				var loader = js_Boot.__cast(itemRenderer.get_icon() , feathers_controls_AssetLoader);
				loader.set_source(state.data.asset);
				var _g = 0;
				var _g1 = itemRenderer.get_numChildren();
				while(_g < _g1) {
					var ch = _g++;
					var o = itemRenderer.getChildAt(ch);
					if(Object.prototype.hasOwnProperty.call(o,"doubleClickEnabled")) {
						itemRenderer.getChildAt(ch)["doubleClickEnabled"] = true;
					}
				}
			};
			return true;
		} else {
			return false;
		}
	}
	,listDbClick: function(id,ac) {
		if(Object.prototype.hasOwnProperty.call(this.lists.h,id)) {
			this.lists.h[id].addEventListener("doubleClick",ac);
			return true;
		} else {
			return false;
		}
	}
	,listChange: function(id,ac) {
		if(Object.prototype.hasOwnProperty.call(this.lists.h,id)) {
			this.lists.h[id].addEventListener("change",ac);
			return true;
		} else {
			return false;
		}
	}
	,setListValues: function(id,values) {
		if(Object.prototype.hasOwnProperty.call(this.lists.h,id)) {
			this.lists.h[id].set_dataProvider(new feathers_data_ArrayCollection(values));
			return true;
		} else {
			return false;
		}
	}
	,setListSelectValue: function(id,val) {
		if(Object.prototype.hasOwnProperty.call(this.lists.h,id)) {
			if(val == null) {
				this.lists.h[id].set_selectedItem(null);
				return true;
			} else {
				var found = false;
				var _g = 0;
				var _g1 = this.lists.h[id].get_dataProvider().get_length();
				while(_g < _g1) {
					var n = _g++;
					if(this.lists.h[id].get_dataProvider().get(n).value == val) {
						this.lists.h[id].set_selectedIndex(n);
						found = true;
					}
				}
				return found;
			}
		} else {
			return false;
		}
	}
	,setListMultiValue: function(id,val) {
		if(Object.prototype.hasOwnProperty.call(this.lists.h,id)) {
			var indices = [];
			var _g = 0;
			while(_g < val.length) {
				var it = val[_g];
				++_g;
				var _g1 = 0;
				var _g2 = this.lists.h[id].get_dataProvider().get_length();
				while(_g1 < _g2) {
					var n = _g1++;
					if(this.lists.h[id].get_dataProvider().get(n).value == it) {
						indices.push(n);
					}
				}
			}
			this.lists.h[id].set_selectedIndices(indices);
		}
	}
	,forge: function(id,conf,bgcolor,wd,padding) {
		if(padding == null) {
			padding = -1;
		}
		if(wd == null) {
			wd = -1;
		}
		if(bgcolor == null) {
			bgcolor = -1;
		}
		var cont = this.createContainer(id,padding);
		if(bgcolor >= 0) {
			var skin = new feathers_skins_RectangleSkin();
			skin.set_fill(feathers_graphics_FillStyle.SolidColor(bgcolor));
			cont.set_backgroundSkin(skin);
		}
		var _g = 0;
		var _g1 = conf.length;
		while(_g < _g1) {
			var n = _g++;
			switch(conf[n].tp) {
			case "Button":
				var autoR = true;
				if(Object.prototype.hasOwnProperty.call(conf[n],"ar")) {
					autoR = conf[n].ar;
				}
				this.createButton(conf[n].id,conf[n].tx,conf[n].ac,this.lastCont,autoR);
				if(wd >= 0) {
					this.buttons.h[conf[n].id].set_width(wd);
				}
				if(Object.prototype.hasOwnProperty.call(conf[n],"cl")) {
					this.buttons.h[conf[n].id].addEventListener("trigger",conf[n].cl);
				}
				break;
			case "Custom":
				this.lastCont.addChild(conf[n].cont);
				if(Object.prototype.hasOwnProperty.call(conf[n],"wd")) {
					conf[n].cont.width = conf[n].wd;
				}
				break;
			case "Description":
				this.createDescription(conf[n].id,conf[n].tx,conf[n].vr,this.lastCont);
				if(wd >= 0) {
					this.labels.h[conf[n].id].set_width(wd);
				}
				break;
			case "Label":
				this.createLabel(conf[n].id,conf[n].tx,conf[n].vr,this.lastCont);
				if(Object.prototype.hasOwnProperty.call(conf[n],"wrap")) {
					this.labels.h[conf[n].id].set_wordWrap(conf[n].wrap);
				}
				if(wd >= 0) {
					this.labels.h[conf[n].id].set_width(wd);
				}
				break;
			case "List":
				this.createList(conf[n].id,conf[n].vl,conf[n].ht,conf[n].sl,this.lastCont);
				if(wd >= 0) {
					this.lists.h[conf[n].id].set_width(wd);
				}
				if(Object.prototype.hasOwnProperty.call(conf[n],"ch")) {
					this.lists.h[conf[n].id].addEventListener("change",conf[n].ch);
				}
				break;
			case "Numeric":
				this.createNumeric(conf[n].id,conf[n].mn,conf[n].mx,conf[n].st,conf[n].vl,this.lastCont);
				if(wd >= 0) {
					this.numerics.h[conf[n].id].set_width(wd);
				}
				if(Object.prototype.hasOwnProperty.call(conf[n],"ch")) {
					this.numerics.h[conf[n].id].addEventListener("change",conf[n].ch);
				}
				break;
			case "Select":
				this.createSelect(conf[n].id,conf[n].vl,conf[n].sl,this.lastCont);
				if(wd >= 0) {
					this.selects.h[conf[n].id].set_width(wd);
				}
				if(Object.prototype.hasOwnProperty.call(conf[n],"ch")) {
					this.selects.h[conf[n].id].addEventListener("change",conf[n].ch);
				}
				break;
			case "Spacer":
				this.createSpacer(conf[n].id,conf[n].ht,conf[n].ln,this.lastCont);
				if(wd >= 0) {
					this.spacers.h[conf[n].id].set_width(wd);
				}
				break;
			case "TArea":
				this.createTArea(conf[n].id,conf[n].tx,conf[n].en,conf[n].vr,this.lastCont);
				if(Object.prototype.hasOwnProperty.call(conf[n],"ht")) {
					this.tareas.h[conf[n].id].set_height(conf[n].ht);
				}
				if(wd >= 0) {
					this.tareas.h[conf[n].id].set_width(wd);
				}
				break;
			case "TInput":
				this.createTInput(conf[n].id,conf[n].tx,conf[n].vr,this.lastCont);
				if(wd >= 0) {
					this.inputs.h[conf[n].id].set_width(wd);
				}
				if(Object.prototype.hasOwnProperty.call(conf[n],"ch")) {
					this.inputs.h[conf[n].id].addEventListener("change",conf[n].ch);
				}
				break;
			case "Toggle":
				this.createToggle(conf[n].id,conf[n].vl,this.lastCont);
				if(Object.prototype.hasOwnProperty.call(conf[n],"ch")) {
					this.toggles.h[conf[n].id].addEventListener("change",conf[n].ch);
				}
				break;
			}
		}
		if(wd > 0) {
			cont.set_width(wd);
		}
		return cont;
	}
	,kill: function() {
		this._vLayout = null;
		var h = this.columns.h;
		var key_h = h;
		var key_keys = Object.keys(h);
		var key_length = key_keys.length;
		var key_current = 0;
		while(key_current < key_length) {
			var key = key_keys[key_current++];
			this.columns.h[key].removeChildren();
			var _this = this.columns;
			if(Object.prototype.hasOwnProperty.call(_this.h,key)) {
				delete(_this.h[key]);
			}
		}
		this.columns = null;
		var h = this.containers.h;
		var key_h = h;
		var key_keys = Object.keys(h);
		var key_length = key_keys.length;
		var key_current = 0;
		while(key_current < key_length) {
			var key = key_keys[key_current++];
			this.containers.h[key].removeChildren();
			var _this = this.containers;
			if(Object.prototype.hasOwnProperty.call(_this.h,key)) {
				delete(_this.h[key]);
			}
		}
		this.containers = null;
		this.lastCont = null;
		var h = this.inputs.h;
		var key_h = h;
		var key_keys = Object.keys(h);
		var key_length = key_keys.length;
		var key_current = 0;
		while(key_current < key_length) {
			var key = key_keys[key_current++];
			var _this = this.inputs;
			if(Object.prototype.hasOwnProperty.call(_this.h,key)) {
				delete(_this.h[key]);
			}
		}
		this.inputs = null;
		var h = this.numerics.h;
		var key_h = h;
		var key_keys = Object.keys(h);
		var key_length = key_keys.length;
		var key_current = 0;
		while(key_current < key_length) {
			var key = key_keys[key_current++];
			var _this = this.numerics;
			if(Object.prototype.hasOwnProperty.call(_this.h,key)) {
				delete(_this.h[key]);
			}
		}
		this.numerics = null;
		this.lastInput = null;
		var h = this.tareas.h;
		var key_h = h;
		var key_keys = Object.keys(h);
		var key_length = key_keys.length;
		var key_current = 0;
		while(key_current < key_length) {
			var key = key_keys[key_current++];
			var _this = this.tareas;
			if(Object.prototype.hasOwnProperty.call(_this.h,key)) {
				delete(_this.h[key]);
			}
		}
		this.tareas = null;
		var h = this.labels.h;
		var key_h = h;
		var key_keys = Object.keys(h);
		var key_length = key_keys.length;
		var key_current = 0;
		while(key_current < key_length) {
			var key = key_keys[key_current++];
			var _this = this.labels;
			if(Object.prototype.hasOwnProperty.call(_this.h,key)) {
				delete(_this.h[key]);
			}
		}
		this.labels = null;
		var h = this.spacers.h;
		var key_h = h;
		var key_keys = Object.keys(h);
		var key_length = key_keys.length;
		var key_current = 0;
		while(key_current < key_length) {
			var key = key_keys[key_current++];
			this.spacers.h[key].get_graphics().clear();
			var _this = this.spacers;
			if(Object.prototype.hasOwnProperty.call(_this.h,key)) {
				delete(_this.h[key]);
			}
		}
		this.spacers = null;
		var h = this.buttons.h;
		var key_h = h;
		var key_keys = Object.keys(h);
		var key_length = key_keys.length;
		var key_current = 0;
		while(key_current < key_length) {
			var key = key_keys[key_current++];
			this.buttons.h[key].removeEventListener("trigger",this._btActions.h[key]);
			var _this = this.buttons;
			if(Object.prototype.hasOwnProperty.call(_this.h,key)) {
				delete(_this.h[key]);
			}
			var _this1 = this._btActions;
			if(Object.prototype.hasOwnProperty.call(_this1.h,key)) {
				delete(_this1.h[key]);
			}
		}
		this.buttons = null;
		var h = this.selects.h;
		var key_h = h;
		var key_keys = Object.keys(h);
		var key_length = key_keys.length;
		var key_current = 0;
		while(key_current < key_length) {
			var key = key_keys[key_current++];
			var _this = this.selects;
			if(Object.prototype.hasOwnProperty.call(_this.h,key)) {
				delete(_this.h[key]);
			}
		}
		this.selects = null;
		var h = this.lists.h;
		var key_h = h;
		var key_keys = Object.keys(h);
		var key_length = key_keys.length;
		var key_current = 0;
		while(key_current < key_length) {
			var key = key_keys[key_current++];
			var _this = this.lists;
			if(Object.prototype.hasOwnProperty.call(_this.h,key)) {
				delete(_this.h[key]);
			}
		}
		this.lists = null;
		var h = this.toggles.h;
		var key_h = h;
		var key_keys = Object.keys(h);
		var key_length = key_keys.length;
		var key_current = 0;
		while(key_current < key_length) {
			var key = key_keys[key_current++];
			var _this = this.toggles;
			if(Object.prototype.hasOwnProperty.call(_this.h,key)) {
				delete(_this.h[key]);
			}
		}
		this.toggles = null;
		this._btActions = null;
	}
	,redraw: function() {
		var h = this.inputs.h;
		var item_h = h;
		var item_keys = Object.keys(h);
		var item_length = item_keys.length;
		var item_current = 0;
		while(item_current < item_length) {
			var item = item_h[item_keys[item_current++]];
			if(item.parent != null && item.parent.parent != null && item.autoResize) {
				item.set_width(item.parent.parent.get_width() - 4 * this._padding);
			}
		}
		var h = this.numerics.h;
		var item_h = h;
		var item_keys = Object.keys(h);
		var item_length = item_keys.length;
		var item_current = 0;
		while(item_current < item_length) {
			var item = item_h[item_keys[item_current++]];
			if(item.parent != null && item.parent.parent != null) {
				item.set_width(item.parent.parent.get_width() - 4 * this._padding);
			}
		}
		var h = this.tareas.h;
		var item_h = h;
		var item_keys = Object.keys(h);
		var item_length = item_keys.length;
		var item_current = 0;
		while(item_current < item_length) {
			var item = item_h[item_keys[item_current++]];
			if(item.parent != null && item.parent.parent != null) {
				item.set_width(item.parent.parent.get_width() - 4 * this._padding);
			}
		}
		var h = this.labels.h;
		var item_h = h;
		var item_keys = Object.keys(h);
		var item_length = item_keys.length;
		var item_current = 0;
		while(item_current < item_length) {
			var item = item_h[item_keys[item_current++]];
			if(item.parent != null && item.parent.parent != null && item.autoResize) {
				item.set_width(item.parent.parent.get_width() - 4 * this._padding);
			}
		}
		var h = this.selects.h;
		var item_h = h;
		var item_keys = Object.keys(h);
		var item_length = item_keys.length;
		var item_current = 0;
		while(item_current < item_length) {
			var item = item_h[item_keys[item_current++]];
			if(item.parent != null && item.parent.parent != null && item.autoResize) {
				item.set_width(item.parent.parent.get_width() - 4 * this._padding);
			}
		}
		var h = this.lists.h;
		var item_h = h;
		var item_keys = Object.keys(h);
		var item_length = item_keys.length;
		var item_current = 0;
		while(item_current < item_length) {
			var item = item_h[item_keys[item_current++]];
			if(item.parent != null && item.parent.parent != null) {
				item.set_width(item.parent.parent.get_width() - 4 * this._padding);
			}
		}
		var h = this.buttons.h;
		var item_h = h;
		var item_keys = Object.keys(h);
		var item_length = item_keys.length;
		var item_current = 0;
		while(item_current < item_length) {
			var item = item_h[item_keys[item_current++]];
			if(item.parent != null && item.parent.parent != null && item.autoResize) {
				item.set_width(item.parent.parent.get_width() - 4 * this._padding);
			}
		}
		var h = this.spacers.h;
		var item_h = h;
		var item_keys = Object.keys(h);
		var item_length = item_keys.length;
		var item_current = 0;
		while(item_current < item_length) {
			var item = item_h[item_keys[item_current++]];
			if(item.parent != null && item.parent.parent != null) {
				item.set_scaleX((item.parent.parent.get_width() - 4 * this._padding) / 10);
			}
		}
	}
	,__class__: com_tilbuci_ui_base_InterfaceFactory
};
var com_tilbuci_ui_component_ActionArea = function(wd,ht,blonly) {
	if(blonly == null) {
		blonly = false;
	}
	if(ht == null) {
		ht = 250;
	}
	if(wd == null) {
		wd = 760;
	}
	this._codemode = false;
	this._idbuttons = new haxe_ds_StringMap();
	feathers_controls_ScrollContainer.call(this);
	var lay = new feathers_layout_VerticalLayout();
	lay.set_gap(5);
	lay.setPadding(0);
	this.set_layout(lay);
	this.set_backgroundSkin(new com_tilbuci_ui_base_BackgroundSkin());
	this._code = new com_tilbuci_ui_component_CodeArea("js");
	this._code.set_width(wd);
	this._code.set_height(ht - 35);
	this._block = new com_tilbuci_ui_component_BlockArea(this._code);
	this._block.set_width(wd);
	this._block.set_height(ht - 35);
	this.addChild(this._block);
	this._buttons = new com_tilbuci_ui_base_HInterfaceContainer();
	this._buttons.set_width(wd);
	var this1 = this._idbuttons;
	var v = new com_tilbuci_ui_component_IDButton("switch",$bind(this,this.onSwitch),null,openfl_utils_Assets.getBitmapData("btBlocks"));
	this1.h["switch"] = v;
	var this1 = this._idbuttons;
	var v = new com_tilbuci_ui_component_IDButton("copy",$bind(this,this.onCopy),null,openfl_utils_Assets.getBitmapData("btCopy"));
	this1.h["copy"] = v;
	var this1 = this._idbuttons;
	var v = new com_tilbuci_ui_component_IDButton("scene",$bind(this,this.onScene),null,openfl_utils_Assets.getBitmapData("btMovieScene"));
	this1.h["scene"] = v;
	var this1 = this._idbuttons;
	var v = new com_tilbuci_ui_component_IDButton("instance",$bind(this,this.onInstance),null,openfl_utils_Assets.getBitmapData("btMedia"));
	this1.h["instance"] = v;
	var this1 = this._idbuttons;
	var v = new com_tilbuci_ui_component_IDButton("variables",$bind(this,this.onVariables),null,openfl_utils_Assets.getBitmapData("btVariables"));
	this1.h["variables"] = v;
	var this1 = this._idbuttons;
	var v = new com_tilbuci_ui_component_IDButton("data",$bind(this,this.onData),null,openfl_utils_Assets.getBitmapData("btData"));
	this1.h["data"] = v;
	var this1 = this._idbuttons;
	var v = new com_tilbuci_ui_component_IDButton("plus",$bind(this,this.onPlus),null,openfl_utils_Assets.getBitmapData("btPlus"));
	this1.h["plus"] = v;
	var this1 = this._idbuttons;
	var v = new com_tilbuci_ui_component_IDButton("plus",$bind(this,this.onRuntime),null,openfl_utils_Assets.getBitmapData("btSetup"));
	this1.h["runtime"] = v;
	var this1 = this._idbuttons;
	var v = new com_tilbuci_ui_component_IDButton("contraptions",$bind(this,this.onContraptions),null,openfl_utils_Assets.getBitmapData("btContraptions"));
	this1.h["contraptions"] = v;
	var this1 = this._idbuttons;
	var v = new com_tilbuci_ui_component_IDButton("narrative",$bind(this,this.onNarrative),null,openfl_utils_Assets.getBitmapData("btNarrative"));
	this1.h["narrative"] = v;
	var this1 = this._idbuttons;
	var v = new com_tilbuci_ui_component_IDButton("plugin",$bind(this,this.onPlugin),null,openfl_utils_Assets.getBitmapData("btPlugin"));
	this1.h["plugin"] = v;
	this._buttons.addChild(this._idbuttons.h["switch"]);
	this._buttons.addChild(this._idbuttons.h["copy"]);
	this._buttons.addChild(this._idbuttons.h["scene"]);
	this._buttons.addChild(this._idbuttons.h["instance"]);
	this._buttons.addChild(this._idbuttons.h["variables"]);
	this._buttons.addChild(this._idbuttons.h["data"]);
	this._buttons.addChild(this._idbuttons.h["plus"]);
	this._buttons.addChild(this._idbuttons.h["runtime"]);
	this._buttons.addChild(this._idbuttons.h["contraptions"]);
	this._buttons.addChild(this._idbuttons.h["narrative"]);
	this._buttons.addChild(this._idbuttons.h["plugin"]);
	this._idbuttons.h["switch"].set_toolTip(com_tilbuci_data_Global.ln.get("tooltip-action-switch"));
	this._idbuttons.h["copy"].set_toolTip(com_tilbuci_data_Global.ln.get("tooltip-action-copy"));
	this._idbuttons.h["scene"].set_toolTip(com_tilbuci_data_Global.ln.get("tooltip-action-scene"));
	this._idbuttons.h["instance"].set_toolTip(com_tilbuci_data_Global.ln.get("tooltip-action-instance"));
	this._idbuttons.h["variables"].set_toolTip(com_tilbuci_data_Global.ln.get("tooltip-action-variables"));
	this._idbuttons.h["data"].set_toolTip(com_tilbuci_data_Global.ln.get("tooltip-action-data"));
	this._idbuttons.h["plus"].set_toolTip(com_tilbuci_data_Global.ln.get("tooltip-action-plus"));
	this._idbuttons.h["contraptions"].set_toolTip(com_tilbuci_data_Global.ln.get("tooltip-action-contraptions"));
	this._idbuttons.h["narrative"].set_toolTip(com_tilbuci_data_Global.ln.get("tooltip-action-narrative"));
	this._idbuttons.h["plugin"].set_toolTip(com_tilbuci_data_Global.ln.get("tooltip-action-plugin"));
	this._blockbuttons = new com_tilbuci_ui_base_HInterfaceContainer();
	this._blockbuttons.set_width(wd);
	var this1 = this._idbuttons;
	var v = new com_tilbuci_ui_component_IDButton("blswitch",$bind(this,this.onSwitch),null,openfl_utils_Assets.getBitmapData("btCode"));
	this1.h["blswitch"] = v;
	var this1 = this._idbuttons;
	var v = new com_tilbuci_ui_component_IDButton("bldel",$bind(this,this.onDel),null,openfl_utils_Assets.getBitmapData("btDel"));
	this1.h["bldel"] = v;
	var this1 = this._idbuttons;
	var v = new com_tilbuci_ui_component_IDButton("bledit",$bind(this,this.onEdit),null,openfl_utils_Assets.getBitmapData("btEdit"));
	this1.h["bledit"] = v;
	var this1 = this._idbuttons;
	var v = new com_tilbuci_ui_component_IDButton("blopen",$bind(this,this.onOpen),null,openfl_utils_Assets.getBitmapData("btExpand"));
	this1.h["blopen"] = v;
	var this1 = this._idbuttons;
	var v = new com_tilbuci_ui_component_IDButton("blclose",$bind(this,this.onClose),null,openfl_utils_Assets.getBitmapData("btCompress"));
	this1.h["blclose"] = v;
	var this1 = this._idbuttons;
	var v = new com_tilbuci_ui_component_IDButton("blup",$bind(this,this.onUp),null,openfl_utils_Assets.getBitmapData("btUp"));
	this1.h["blup"] = v;
	var this1 = this._idbuttons;
	var v = new com_tilbuci_ui_component_IDButton("bldown",$bind(this,this.onDown),null,openfl_utils_Assets.getBitmapData("btDown"));
	this1.h["bldown"] = v;
	this._idbuttons.h["blswitch"].set_toolTip(com_tilbuci_data_Global.ln.get("tooltip-action-switch"));
	this._idbuttons.h["bldel"].set_toolTip(com_tilbuci_data_Global.ln.get("tooltip-action-bldel"));
	this._idbuttons.h["bledit"].set_toolTip(com_tilbuci_data_Global.ln.get("tooltip-action-bledit"));
	this._idbuttons.h["blopen"].set_toolTip(com_tilbuci_data_Global.ln.get("tooltip-action-blopen"));
	this._idbuttons.h["blclose"].set_toolTip(com_tilbuci_data_Global.ln.get("tooltip-action-blclose"));
	this._idbuttons.h["blup"].set_toolTip(com_tilbuci_data_Global.ln.get("tooltip-action-blup"));
	this._idbuttons.h["bldown"].set_toolTip(com_tilbuci_data_Global.ln.get("tooltip-action-bldown"));
	if(!blonly) {
		this._blockbuttons.addChild(this._idbuttons.h["blswitch"]);
	}
	this._blockbuttons.addChild(this._idbuttons.h["bldel"]);
	this._blockbuttons.addChild(this._idbuttons.h["bledit"]);
	this._blockbuttons.addChild(this._idbuttons.h["blopen"]);
	this._blockbuttons.addChild(this._idbuttons.h["blclose"]);
	this._blockbuttons.addChild(this._idbuttons.h["blup"]);
	this._blockbuttons.addChild(this._idbuttons.h["bldown"]);
	this.addChild(this._blockbuttons);
};
$hxClasses["com.tilbuci.ui.component.ActionArea"] = com_tilbuci_ui_component_ActionArea;
com_tilbuci_ui_component_ActionArea.__name__ = "com.tilbuci.ui.component.ActionArea";
com_tilbuci_ui_component_ActionArea.__super__ = feathers_controls_ScrollContainer;
com_tilbuci_ui_component_ActionArea.prototype = $extend(feathers_controls_ScrollContainer.prototype,{
	_code: null
	,_block: null
	,_buttons: null
	,_blockbuttons: null
	,_idbuttons: null
	,_codemode: null
	,setText: function(txt) {
		this._code.set_text(txt);
		this._block.refresh();
	}
	,getText: function() {
		if(this._codemode) {
			return this._code.get_text();
		} else {
			return this._block.toJson();
		}
	}
	,onSwitch: function(evt) {
		this._codemode = !this._codemode;
		this.removeChildren();
		if(!this._codemode) {
			if(!this._block.refresh()) {
				this._codemode = true;
				this._block.clear();
				this.addChild(this._code);
				this.addChild(this._buttons);
				com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("window-actions-title"),com_tilbuci_data_Global.ln.get("window-actions-error"),300,180,com_tilbuci_data_Global.ln.get("default-ok"));
			} else {
				this.addChild(this._block);
				this.addChild(this._blockbuttons);
			}
		} else {
			this._code.set_text(this._block.toJson());
			this._block.clear();
			this.addChild(this._code);
			this.addChild(this._buttons);
		}
	}
	,onCopy: function(evt) {
		if(!this._codemode) {
			com_tilbuci_data_Global.copyText(this._block.toJson());
		} else {
			com_tilbuci_data_Global.copyText(this._code.get_text());
		}
	}
	,onVariables: function(evt) {
		com_tilbuci_data_Global.showWindow("assistantvariables");
	}
	,onScene: function(evt) {
		com_tilbuci_data_Global.showWindow("assistantscene");
	}
	,onInstance: function(evt) {
		com_tilbuci_data_Global.showWindow("assistantinstance");
	}
	,onData: function(evt) {
		com_tilbuci_data_Global.showWindow("assistantdata");
	}
	,onPlus: function(evt) {
		com_tilbuci_data_Global.showWindow("assistantplus");
	}
	,onRuntime: function(evt) {
		com_tilbuci_data_Global.showWindow("assistantruntime");
	}
	,onPlugin: function(evt) {
		com_tilbuci_data_Global.showWindow("assistantplugin");
	}
	,onContraptions: function(evt) {
		com_tilbuci_data_Global.showWindow("assistantcontraptions");
	}
	,onNarrative: function(evt) {
		com_tilbuci_data_Global.showWindow("assistantnarrative");
	}
	,onOpen: function(evt) {
		this._block.openAll();
	}
	,onClose: function(evt) {
		this._block.closeAll();
	}
	,onUp: function(evt) {
		this._block.upAction();
	}
	,onDown: function(evt) {
		this._block.downAction();
	}
	,onEdit: function(evt) {
		this._block.editAction();
	}
	,onDel: function(evt) {
		this._block.removeAction();
	}
	,__class__: com_tilbuci_ui_component_ActionArea
});
var com_tilbuci_ui_component_ActionBlock = function(bl,wd,ord,clAc,dbClAc) {
	this._blocks2 = [];
	this._blocks1 = [];
	this.isOpen = false;
	this.order = 0;
	this.selected = false;
	this._paramValues = [];
	feathers_controls_Panel.call(this);
	this.doubleClickEnabled = true;
	this.blaction = bl;
	var vlay = new feathers_layout_VerticalLayout();
	vlay.set_gap(5);
	vlay.setPadding(8);
	this.set_layout(vlay);
	var skin = new feathers_skins_RectangleSkin(feathers_graphics_FillStyle.SolidColor(4473924),feathers_graphics_LineStyle.SolidColor(1,8947848));
	skin.set_cornerRadius(5);
	this.set_backgroundSkin(skin);
	this.set_width(wd - 24);
	this.order = ord;
	this.isOpen = false;
	this.mouseChildren = false;
	this._name = new feathers_controls_Label(this.order + 1 + ": " + com_tilbuci_data_Global.acInfo.getAcName(bl.ac) + com_tilbuci_data_Global.acInfo.getParamLine(bl.ac,bl.param));
	this._name.set_x(5);
	this._name.set_y(5);
	this._name.set_maxWidth(this.get_width() - 20);
	this.addChild(this._name);
	var inlay = new feathers_layout_VerticalLayout();
	inlay.set_gap(2);
	inlay.setPadding(5);
	if(com_tilbuci_data_Global.acInfo.getNumParams(bl.ac) > 0 || bl.param.length > 0) {
		this._paramArea = new feathers_controls_Panel();
		this._paramArea.set_backgroundSkin(new feathers_skins_RectangleSkin(feathers_graphics_FillStyle.SolidColor(0),feathers_graphics_LineStyle.SolidColor(1,8947848)));
		this._paramArea.set_width(this.get_width() - 20);
		this._paramArea.set_layout(inlay);
		var pat = 0;
		var _g = 0;
		var _g1 = bl.param.length;
		while(_g < _g1) {
			var i = _g++;
			var lb = new feathers_controls_Label(com_tilbuci_data_Global.acInfo.getAcParam(bl.ac,i,bl.param[i]));
			lb.set_variant(feathers_controls_Label.VARIANT_DETAIL);
			this._paramValues.push(lb);
			pat = i + 1;
		}
		if(pat < com_tilbuci_data_Global.acInfo.getNumParams(bl.ac)) {
			var _g = pat;
			var _g1 = com_tilbuci_data_Global.acInfo.getNumParams(bl.ac);
			while(_g < _g1) {
				var i = _g++;
				var lb = new feathers_controls_Label(com_tilbuci_data_Global.acInfo.getAcParam(bl.ac,i));
				lb.set_variant(feathers_controls_Label.VARIANT_DETAIL);
				this._paramValues.push(lb);
			}
		}
		var _g = 0;
		var _g1 = this._paramValues;
		while(_g < _g1.length) {
			var par = _g1[_g];
			++_g;
			this._paramArea.addChild(par);
		}
	}
	var exlay = new feathers_layout_VerticalLayout();
	exlay.set_gap(5);
	exlay.setPadding(8);
	if(com_tilbuci_data_Global.acInfo.getExtra1(bl.ac) != "") {
		this._extra1Area = new feathers_controls_Panel();
		this._extra1Area.set_backgroundSkin(new feathers_skins_RectangleSkin(feathers_graphics_FillStyle.SolidColor(0),feathers_graphics_LineStyle.SolidColor(1,8947848)));
		this._extra1Area.set_width(this.get_width() - 20);
		this._extra1Area.set_layout(exlay);
		var lb = new feathers_controls_Label(com_tilbuci_data_Global.ln.get("acblock-" + com_tilbuci_data_Global.acInfo.getExtra1(bl.ac)));
		this._extra1Area.addChild(lb);
		this._paramValues.push(lb);
		var this1 = bl.extras;
		var key = com_tilbuci_data_Global.acInfo.getExtra1(bl.ac);
		if(Object.prototype.hasOwnProperty.call(this1.h,key)) {
			var _g = 0;
			var this1 = bl.extras;
			var key = com_tilbuci_data_Global.acInfo.getExtra1(bl.ac);
			var _g1 = this1.h[key].length;
			while(_g < _g1) {
				var ex = _g++;
				var this1 = bl.extras;
				var key = com_tilbuci_data_Global.acInfo.getExtra1(bl.ac);
				var ab = new com_tilbuci_ui_component_ActionBlock(this1.h[key][ex],this.get_width() - 20,ex,$bind(this,this.clickAction1),dbClAc);
				this._extra1Area.addChild(ab);
				this._blocks1.push(ab);
			}
		}
		this._addbt1 = new com_tilbuci_ui_component_IDButton("addbt",$bind(this,this.addActionBlock1),null,openfl_utils_Assets.getBitmapData("btPlus"));
		this._addbt1.set_toolTip(com_tilbuci_data_Global.ln.get("acblock-addbt"));
		this._extra1Area.addChild(this._addbt1);
	}
	if(com_tilbuci_data_Global.acInfo.getExtra2(bl.ac) != "") {
		this._extra2Area = new feathers_controls_Panel();
		this._extra2Area.set_backgroundSkin(new feathers_skins_RectangleSkin(feathers_graphics_FillStyle.SolidColor(0),feathers_graphics_LineStyle.SolidColor(1,8947848)));
		this._extra2Area.set_width(this.get_width() - 20);
		this._extra2Area.set_layout(exlay);
		var lb = new feathers_controls_Label(com_tilbuci_data_Global.ln.get("acblock-" + com_tilbuci_data_Global.acInfo.getExtra2(bl.ac)));
		this._extra2Area.addChild(lb);
		this._paramValues.push(lb);
		var this1 = bl.extras;
		var key = com_tilbuci_data_Global.acInfo.getExtra2(bl.ac);
		if(Object.prototype.hasOwnProperty.call(this1.h,key)) {
			var _g = 0;
			var this1 = bl.extras;
			var key = com_tilbuci_data_Global.acInfo.getExtra2(bl.ac);
			var _g1 = this1.h[key].length;
			while(_g < _g1) {
				var ex = _g++;
				var this1 = bl.extras;
				var key = com_tilbuci_data_Global.acInfo.getExtra2(bl.ac);
				var ab = new com_tilbuci_ui_component_ActionBlock(this1.h[key][ex],this.get_width() - 20,ex,$bind(this,this.clickAction2),dbClAc);
				this._extra2Area.addChild(ab);
				this._blocks2.push(ab);
			}
		}
		this._addbt2 = new com_tilbuci_ui_component_IDButton("addbt",$bind(this,this.addActionBlock2),null,openfl_utils_Assets.getBitmapData("btPlus"));
		this._addbt2.set_toolTip(com_tilbuci_data_Global.ln.get("acblock-addbt"));
		this._extra2Area.addChild(this._addbt2);
	}
	if(clAc != null) {
		this.addEventListener("click",$bind(this,this.onClick));
		this.addEventListener("middleClick",$bind(this,this.onClickMiddle));
		this.addEventListener("doubleClick",$bind(this,this.onDbClick));
		this._clickAction = clAc;
		this._dbClickAction = dbClAc;
	}
	var _g = 0;
	var _g1 = this.get_numChildren();
	while(_g < _g1) {
		var ch = _g++;
		var o = this.getChildAt(ch);
		if(Object.prototype.hasOwnProperty.call(o,"doubleClickEnabled")) {
			this.getChildAt(ch)["doubleClickEnabled"] = true;
		}
	}
};
$hxClasses["com.tilbuci.ui.component.ActionBlock"] = com_tilbuci_ui_component_ActionBlock;
com_tilbuci_ui_component_ActionBlock.__name__ = "com.tilbuci.ui.component.ActionBlock";
com_tilbuci_ui_component_ActionBlock.__super__ = feathers_controls_Panel;
com_tilbuci_ui_component_ActionBlock.prototype = $extend(feathers_controls_Panel.prototype,{
	_name: null
	,_paramArea: null
	,_paramValues: null
	,_extra1Area: null
	,_extra2Area: null
	,blaction: null
	,_clickAction: null
	,_dbClickAction: null
	,selected: null
	,order: null
	,isOpen: null
	,_blocks1: null
	,_blocks2: null
	,_addbt1: null
	,_addbt2: null
	,setOrder: function(num) {
		this.order = num;
		if(this.isOpen) {
			this._name.set_text(this.order + 1 + ": " + com_tilbuci_data_Global.acInfo.getAcName(this.blaction.ac));
		} else {
			this._name.set_text(this.order + 1 + ": " + com_tilbuci_data_Global.acInfo.getAcName(this.blaction.ac) + com_tilbuci_data_Global.acInfo.getParamLine(this.blaction.ac,this.blaction.param));
		}
	}
	,select: function() {
		this.selected = true;
		var skin = new feathers_skins_RectangleSkin(feathers_graphics_FillStyle.SolidColor(136),feathers_graphics_LineStyle.SolidColor(1,8947848));
		skin.set_cornerRadius(5);
		this.set_backgroundSkin(skin);
	}
	,unselect: function() {
		this.selected = false;
		var skin = new feathers_skins_RectangleSkin(feathers_graphics_FillStyle.SolidColor(4473924),feathers_graphics_LineStyle.SolidColor(1,8947848));
		skin.set_cornerRadius(5);
		this.set_backgroundSkin(skin);
	}
	,openAll: function() {
		if(this._paramArea != null && this._paramArea.parent == null) {
			this.addChild(this._paramArea);
		}
		if(this._extra1Area != null && this._extra1Area.parent == null) {
			this.addChild(this._extra1Area);
			var _g = 0;
			var _g1 = this._extra1Area.get_numChildren();
			while(_g < _g1) {
				var i = _g++;
				if(((this._extra1Area.getChildAt(i)) instanceof com_tilbuci_ui_component_ActionBlock)) {
					var ac = this._extra1Area.getChildAt(i);
					ac.openAll();
				}
			}
		}
		if(this._extra2Area != null && this._extra2Area.parent == null) {
			this.addChild(this._extra2Area);
			var _g = 0;
			var _g1 = this._extra2Area.get_numChildren();
			while(_g < _g1) {
				var i = _g++;
				if(((this._extra2Area.getChildAt(i)) instanceof com_tilbuci_ui_component_ActionBlock)) {
					var ac = this._extra2Area.getChildAt(i);
					ac.openAll();
				}
			}
		}
		this._name.set_text(this.order + 1 + ": " + com_tilbuci_data_Global.acInfo.getAcName(this.blaction.ac));
		this.isOpen = true;
		this.mouseChildren = true;
	}
	,closeAll: function() {
		if(this._paramArea != null && this._paramArea.parent != null) {
			this.removeChild(this._paramArea);
		}
		if(this._extra1Area != null && this._extra1Area.parent != null) {
			this.removeChild(this._extra1Area);
			var _g = 0;
			var _g1 = this._extra1Area.get_numChildren();
			while(_g < _g1) {
				var i = _g++;
				if(((this._extra1Area.getChildAt(i)) instanceof com_tilbuci_ui_component_ActionBlock)) {
					var ac = this._extra1Area.getChildAt(i);
					ac.closeAll();
				}
			}
		}
		if(this._extra2Area != null && this._extra2Area.parent != null) {
			this.removeChild(this._extra2Area);
			var _g = 0;
			var _g1 = this._extra2Area.get_numChildren();
			while(_g < _g1) {
				var i = _g++;
				if(((this._extra2Area.getChildAt(i)) instanceof com_tilbuci_ui_component_ActionBlock)) {
					var ac = this._extra2Area.getChildAt(i);
					ac.closeAll();
				}
			}
		}
		this._name.set_text(this.order + 1 + ": " + com_tilbuci_data_Global.acInfo.getAcName(this.blaction.ac) + com_tilbuci_data_Global.acInfo.getParamLine(this.blaction.ac,this.blaction.param));
		this.isOpen = false;
		this.mouseChildren = false;
	}
	,refresh: function() {
		if(!this.isOpen) {
			this._name.set_text(this.order + 1 + ": " + com_tilbuci_data_Global.acInfo.getAcName(this.blaction.ac) + com_tilbuci_data_Global.acInfo.getParamLine(this.blaction.ac,this.blaction.param));
		}
		this._paramArea.removeChildren();
		while(this._paramValues.length > 0) this._paramValues.shift();
		var pat = 0;
		var _g = 0;
		var _g1 = this.blaction.param.length;
		while(_g < _g1) {
			var i = _g++;
			var lb = new feathers_controls_Label(com_tilbuci_data_Global.acInfo.getAcParam(this.blaction.ac,i,this.blaction.param[i]));
			lb.set_variant(feathers_controls_Label.VARIANT_DETAIL);
			this._paramValues.push(lb);
			pat = i + 1;
		}
		if(pat < com_tilbuci_data_Global.acInfo.getNumParams(this.blaction.ac)) {
			var _g = pat;
			var _g1 = com_tilbuci_data_Global.acInfo.getNumParams(this.blaction.ac);
			while(_g < _g1) {
				var i = _g++;
				var lb = new feathers_controls_Label(com_tilbuci_data_Global.acInfo.getAcParam(this.blaction.ac,i));
				lb.set_variant(feathers_controls_Label.VARIANT_DETAIL);
				this._paramValues.push(lb);
			}
		}
		var _g = 0;
		var _g1 = this._paramValues;
		while(_g < _g1.length) {
			var par = _g1[_g];
			++_g;
			this._paramArea.addChild(par);
		}
	}
	,toObject: function() {
		var obj = { ac : this.blaction.ac, param : this.blaction.param};
		if(com_tilbuci_data_Global.acInfo.getExtra1(this.blaction.ac) != "") {
			var ex1 = [];
			var _g = 0;
			var _g1 = this._blocks1;
			while(_g < _g1.length) {
				var bl = _g1[_g];
				++_g;
				ex1.push(bl.toObject());
			}
			obj[com_tilbuci_data_Global.acInfo.getExtra1(this.blaction.ac)] = ex1;
		}
		if(com_tilbuci_data_Global.acInfo.getExtra2(this.blaction.ac) != "") {
			var ex2 = [];
			var _g = 0;
			var _g1 = this._blocks2;
			while(_g < _g1.length) {
				var bl = _g1[_g];
				++_g;
				ex2.push(bl.toObject());
			}
			obj[com_tilbuci_data_Global.acInfo.getExtra2(this.blaction.ac)] = ex2;
		}
		return obj;
	}
	,kill: function() {
		this.removeChildren();
		this._name = null;
		if(this._paramArea != null) {
			this._paramArea.removeChildren();
			this._paramArea = null;
		}
		if(this._extra1Area != null) {
			this._extra1Area.removeChildren();
			this._extra1Area = null;
			this._addbt1.kill();
			this._addbt1 = null;
		}
		if(this._extra2Area != null) {
			this._extra2Area.removeChildren();
			this._extra2Area = null;
			this._addbt2.kill();
			this._addbt2 = null;
		}
		while(this._paramValues.length > 0) this._paramValues.shift();
		while(this._blocks1.length > 0) this._blocks1.shift().kill();
		while(this._blocks2.length > 0) this._blocks2.shift().kill();
		this._blocks1 = null;
		this._blocks2 = null;
		this._paramValues = null;
		this.blaction.kill();
		this.blaction = null;
		if(this._clickAction != null) {
			this.removeEventListener("click",$bind(this,this.onClick));
			this.removeEventListener("doubleClick",$bind(this,this.onDbClick));
			this.removeEventListener("middleClick",$bind(this,this.onClickMiddle));
		}
		this._clickAction = null;
		this._dbClickAction = null;
	}
	,unselectAll: function(bl) {
		if(this != bl) {
			this.unselect();
		}
		var _g = 0;
		var _g1 = this._blocks1;
		while(_g < _g1.length) {
			var bl1 = _g1[_g];
			++_g;
			bl1.unselectAll(bl);
		}
		var _g = 0;
		var _g1 = this._blocks2;
		while(_g < _g1.length) {
			var bl2 = _g1[_g];
			++_g;
			bl2.unselectAll(bl);
		}
	}
	,upAction: function(sl) {
		var isHere = 0;
		var _g = 0;
		var _g1 = this._blocks1;
		while(_g < _g1.length) {
			var bl = _g1[_g];
			++_g;
			if(bl == sl) {
				isHere = 1;
			}
		}
		if(isHere == 0) {
			var _g = 0;
			var _g1 = this._blocks2;
			while(_g < _g1.length) {
				var bl = _g1[_g];
				++_g;
				if(bl == sl) {
					isHere = 2;
				}
			}
		}
		if(isHere == 1) {
			if(sl.order > 0) {
				var newArr = [];
				if(sl.order - 1 > 0) {
					var _g = 0;
					var _g1 = sl.order - 1;
					while(_g < _g1) {
						var i = _g++;
						newArr.push(this._blocks1[i]);
					}
				}
				newArr.push(this._blocks1[sl.order]);
				newArr.push(this._blocks1[sl.order - 1]);
				if(this._blocks1.length > sl.order + 1) {
					var _g = sl.order + 1;
					var _g1 = this._blocks1.length;
					while(_g < _g1) {
						var i = _g++;
						newArr.push(this._blocks1[i]);
					}
				}
				while(this._blocks1.length > 0) this._blocks1.shift();
				while(newArr.length > 0) this._blocks1.push(newArr.shift());
				this._extra1Area.removeChildren();
				this._extra1Area.addChild(new feathers_controls_Label(com_tilbuci_data_Global.ln.get("acblock-" + com_tilbuci_data_Global.acInfo.getExtra1(this.blaction.ac))));
				var _g = 0;
				var _g1 = this._blocks1.length;
				while(_g < _g1) {
					var i = _g++;
					this._blocks1[i].setOrder(i);
					this._extra1Area.addChild(this._blocks1[i]);
				}
				this._extra1Area.addChild(this._addbt1);
			}
		} else if(isHere == 2) {
			if(sl.order > 0) {
				var newArr = [];
				if(sl.order - 1 > 0) {
					var _g = 0;
					var _g1 = sl.order - 1;
					while(_g < _g1) {
						var i = _g++;
						newArr.push(this._blocks2[i]);
					}
				}
				newArr.push(this._blocks2[sl.order]);
				newArr.push(this._blocks2[sl.order - 1]);
				if(this._blocks2.length > sl.order + 1) {
					var _g = sl.order + 1;
					var _g1 = this._blocks2.length;
					while(_g < _g1) {
						var i = _g++;
						newArr.push(this._blocks2[i]);
					}
				}
				while(this._blocks2.length > 0) this._blocks2.shift();
				while(newArr.length > 0) this._blocks2.push(newArr.shift());
				this._extra2Area.removeChildren();
				this._extra2Area.addChild(new feathers_controls_Label(com_tilbuci_data_Global.ln.get("acblock-" + com_tilbuci_data_Global.acInfo.getExtra2(this.blaction.ac))));
				var _g = 0;
				var _g1 = this._blocks2.length;
				while(_g < _g1) {
					var i = _g++;
					this._blocks2[i].setOrder(i);
					this._extra2Area.addChild(this._blocks2[i]);
				}
				this._extra2Area.addChild(this._addbt2);
			}
		} else {
			var _g = 0;
			var _g1 = this._blocks1;
			while(_g < _g1.length) {
				var bl = _g1[_g];
				++_g;
				bl.upAction(sl);
			}
			var _g = 0;
			var _g1 = this._blocks2;
			while(_g < _g1.length) {
				var bl = _g1[_g];
				++_g;
				bl.upAction(sl);
			}
		}
	}
	,downAction: function(sl) {
		var isHere = 0;
		var _g = 0;
		var _g1 = this._blocks1;
		while(_g < _g1.length) {
			var bl = _g1[_g];
			++_g;
			if(bl == sl) {
				isHere = 1;
			}
		}
		if(isHere == 0) {
			var _g = 0;
			var _g1 = this._blocks2;
			while(_g < _g1.length) {
				var bl = _g1[_g];
				++_g;
				if(bl == sl) {
					isHere = 2;
				}
			}
		}
		if(isHere == 1) {
			if(sl.order < this._blocks1.length - 1) {
				var newArr = [];
				if(sl.order > 0) {
					var _g = 0;
					var _g1 = sl.order;
					while(_g < _g1) {
						var i = _g++;
						newArr.push(this._blocks1[i]);
					}
				}
				newArr.push(this._blocks1[sl.order + 1]);
				newArr.push(this._blocks1[sl.order]);
				if(this._blocks1.length > sl.order + 2) {
					var _g = sl.order + 2;
					var _g1 = this._blocks1.length;
					while(_g < _g1) {
						var i = _g++;
						newArr.push(this._blocks1[i]);
					}
				}
				while(this._blocks1.length > 0) this._blocks1.shift();
				while(newArr.length > 0) this._blocks1.push(newArr.shift());
				this._extra1Area.removeChildren();
				this._extra1Area.addChild(new feathers_controls_Label(com_tilbuci_data_Global.ln.get("acblock-" + com_tilbuci_data_Global.acInfo.getExtra1(this.blaction.ac))));
				var _g = 0;
				var _g1 = this._blocks1.length;
				while(_g < _g1) {
					var i = _g++;
					this._blocks1[i].setOrder(i);
					this._extra1Area.addChild(this._blocks1[i]);
				}
				this._extra1Area.addChild(this._addbt1);
			}
		} else if(isHere == 2) {
			if(sl.order < this._blocks2.length - 1) {
				var newArr = [];
				if(sl.order > 0) {
					var _g = 0;
					var _g1 = sl.order;
					while(_g < _g1) {
						var i = _g++;
						newArr.push(this._blocks2[i]);
					}
				}
				newArr.push(this._blocks2[sl.order + 1]);
				newArr.push(this._blocks2[sl.order]);
				if(this._blocks2.length > sl.order + 2) {
					var _g = sl.order + 2;
					var _g1 = this._blocks2.length;
					while(_g < _g1) {
						var i = _g++;
						newArr.push(this._blocks2[i]);
					}
				}
				while(this._blocks2.length > 0) this._blocks2.shift();
				while(newArr.length > 0) this._blocks2.push(newArr.shift());
				this._extra2Area.removeChildren();
				this._extra2Area.addChild(new feathers_controls_Label(com_tilbuci_data_Global.ln.get("acblock-" + com_tilbuci_data_Global.acInfo.getExtra2(this.blaction.ac))));
				var _g = 0;
				var _g1 = this._blocks2.length;
				while(_g < _g1) {
					var i = _g++;
					this._blocks2[i].setOrder(i);
					this._extra2Area.addChild(this._blocks2[i]);
				}
				this._extra2Area.addChild(this._addbt2);
			}
		} else {
			var _g = 0;
			var _g1 = this._blocks1;
			while(_g < _g1.length) {
				var bl = _g1[_g];
				++_g;
				bl.downAction(sl);
			}
			var _g = 0;
			var _g1 = this._blocks2;
			while(_g < _g1.length) {
				var bl = _g1[_g];
				++_g;
				bl.downAction(sl);
			}
		}
	}
	,removeAction: function(sl) {
		var isHere = 0;
		var _g = 0;
		var _g1 = this._blocks1;
		while(_g < _g1.length) {
			var bl = _g1[_g];
			++_g;
			if(bl == sl) {
				isHere = 1;
			}
		}
		if(isHere == 0) {
			var _g = 0;
			var _g1 = this._blocks2;
			while(_g < _g1.length) {
				var bl = _g1[_g];
				++_g;
				if(bl == sl) {
					isHere = 2;
				}
			}
		}
		if(isHere == 1) {
			this._blocks1.splice(sl.order,1);
			this._extra1Area.removeChildren();
			this._extra1Area.addChild(new feathers_controls_Label(com_tilbuci_data_Global.ln.get("acblock-" + com_tilbuci_data_Global.acInfo.getExtra1(this.blaction.ac))));
			var _g = 0;
			var _g1 = this._blocks1.length;
			while(_g < _g1) {
				var i = _g++;
				this._blocks1[i].setOrder(i);
				this._extra1Area.addChild(this._blocks1[i]);
			}
			this._extra1Area.addChild(this._addbt1);
		} else if(isHere == 2) {
			this._blocks2.splice(sl.order,1);
			this._extra2Area.removeChildren();
			this._extra2Area.addChild(new feathers_controls_Label(com_tilbuci_data_Global.ln.get("acblock-" + com_tilbuci_data_Global.acInfo.getExtra2(this.blaction.ac))));
			var _g = 0;
			var _g1 = this._blocks2.length;
			while(_g < _g1) {
				var i = _g++;
				this._blocks2[i].setOrder(i);
				this._extra2Area.addChild(this._blocks2[i]);
			}
			this._extra2Area.addChild(this._addbt2);
		} else {
			var _g = 0;
			var _g1 = this._blocks1;
			while(_g < _g1.length) {
				var bl = _g1[_g];
				++_g;
				bl.removeAction(sl);
			}
			var _g = 0;
			var _g1 = this._blocks2;
			while(_g < _g1.length) {
				var bl = _g1[_g];
				++_g;
				bl.removeAction(sl);
			}
		}
	}
	,addActionBlock1: function(evt) {
		evt.stopImmediatePropagation();
		com_tilbuci_data_Global.showNewBlockWindow($bind(this,this.onNewBlock1));
	}
	,onNewBlock1: function(jsonac) {
		if(jsonac != false) {
			this._extra1Area.removeChild(this._addbt1);
			var bla = new com_tilbuci_ui_component_ActionBlock(new com_tilbuci_ui_component_BlockAction(jsonac),this.get_width() - 20,this._blocks1.length,this._clickAction,this._dbClickAction);
			this._blocks1.push(bla);
			this._extra1Area.addChild(bla);
			this._extra1Area.addChild(this._addbt1);
		}
	}
	,addActionBlock2: function(evt) {
		evt.stopImmediatePropagation();
		com_tilbuci_data_Global.showNewBlockWindow($bind(this,this.onNewBlock2));
	}
	,onNewBlock2: function(jsonac) {
		if(jsonac != false) {
			this._extra2Area.removeChild(this._addbt1);
			var bla = new com_tilbuci_ui_component_ActionBlock(new com_tilbuci_ui_component_BlockAction(jsonac),this.get_width() - 20,this._blocks2.length,this._clickAction,this._dbClickAction);
			this._blocks2.push(bla);
			this._extra2Area.addChild(bla);
			this._extra2Area.addChild(this._addbt2);
		}
	}
	,onClick: function(evt) {
		evt.stopImmediatePropagation();
		this._clickAction(this);
	}
	,onDbClick: function(evt) {
		evt.stopImmediatePropagation();
		this._dbClickAction(this);
	}
	,onClickMiddle: function(evt) {
		evt.stopImmediatePropagation();
		if(this.isOpen) {
			this.closeAll();
		} else {
			this.openAll();
		}
	}
	,clickAction1: function(bl,inner) {
		if(inner == null) {
			inner = false;
		}
		if(inner) {
			var _g = 0;
			var _g1 = this._blocks1;
			while(_g < _g1.length) {
				var b = _g1[_g];
				++_g;
				b.unselect();
			}
			var _g = 0;
			var _g1 = this._blocks2;
			while(_g < _g1.length) {
				var b = _g1[_g];
				++_g;
				b.unselect();
			}
		} else {
			if(bl.selected) {
				bl.unselect();
			} else {
				var _g = 0;
				var _g1 = this._blocks1;
				while(_g < _g1.length) {
					var b = _g1[_g];
					++_g;
					b.unselect();
				}
				bl.select();
			}
			var _g = 0;
			var _g1 = this._blocks2;
			while(_g < _g1.length) {
				var b = _g1[_g];
				++_g;
				b.unselect();
			}
		}
		this._clickAction(bl,true);
	}
	,clickAction2: function(bl,inner) {
		if(inner == null) {
			inner = false;
		}
		if(inner) {
			var _g = 0;
			var _g1 = this._blocks1;
			while(_g < _g1.length) {
				var b = _g1[_g];
				++_g;
				b.unselect();
			}
			var _g = 0;
			var _g1 = this._blocks2;
			while(_g < _g1.length) {
				var b = _g1[_g];
				++_g;
				b.unselect();
			}
		} else {
			if(bl.selected) {
				bl.unselect();
			} else {
				var _g = 0;
				var _g1 = this._blocks2;
				while(_g < _g1.length) {
					var b = _g1[_g];
					++_g;
					b.unselect();
				}
				bl.select();
			}
			var _g = 0;
			var _g1 = this._blocks1;
			while(_g < _g1.length) {
				var b = _g1[_g];
				++_g;
				b.unselect();
			}
		}
		this._clickAction(bl,true);
	}
	,__class__: com_tilbuci_ui_component_ActionBlock
});
var com_tilbuci_ui_component_DropDownPanel = function(tt,wd) {
	this._open = false;
	this.startWindow = null;
	this.callbacks = [];
	feathers_controls_Panel.call(this);
	this.ui = new com_tilbuci_ui_base_InterfaceFactory();
	this.set_layout(new feathers_layout_AnchorLayout());
	var skin = new feathers_skins_RectangleSkin();
	skin.set_fill(feathers_graphics_FillStyle.SolidColor(6710886));
	this.set_backgroundSkin(skin);
	var lb = new feathers_controls_Label();
	lb.set_text(tt);
	var hd = new feathers_controls_Header();
	hd.set_leftView(lb);
	hd.set_rightView(this.ui.createIconButton("toggle",$bind(this,this.toggle),new openfl_display_Bitmap(openfl_utils_Assets.getBitmapData("iconPlus"))));
	this.set_header(hd);
	this.set_width(wd);
};
$hxClasses["com.tilbuci.ui.component.DropDownPanel"] = com_tilbuci_ui_component_DropDownPanel;
com_tilbuci_ui_component_DropDownPanel.__name__ = "com.tilbuci.ui.component.DropDownPanel";
com_tilbuci_ui_component_DropDownPanel.__super__ = feathers_controls_Panel;
com_tilbuci_ui_component_DropDownPanel.prototype = $extend(feathers_controls_Panel.prototype,{
	ui: null
	,callbacks: null
	,startWindow: null
	,_open: null
	,_content: null
	,toggle: function(evt) {
		var bmp;
		if(this._open) {
			bmp = new openfl_display_Bitmap(openfl_utils_Assets.getBitmapData("iconPlus"));
			this.removeChildren();
		} else {
			bmp = new openfl_display_Bitmap(openfl_utils_Assets.getBitmapData("iconMinus"));
			if(this._content != null) {
				this.addChild(this._content);
			}
		}
		bmp.smoothing = true;
		bmp.set_width(bmp.set_height(20));
		this.ui.buttons.h["toggle"].set_icon(bmp);
		this._open = !this._open;
	}
	,reloadContent: function(data) {
	}
	,updateContent: function(data) {
	}
	,setWd: function(wd) {
		this.set_width(wd);
		if(this._content != null) {
			this._content.set_width(wd);
		}
	}
	,__class__: com_tilbuci_ui_component_DropDownPanel
});
var com_tilbuci_ui_component_ActionPanel = function(wd) {
	this._current = null;
	com_tilbuci_ui_component_DropDownPanel.call(this,com_tilbuci_data_Global.ln.get("rightbar-action"),wd);
	this._content = this.ui.forge("properties",[{ tp : "Button", id : "trigget", tx : com_tilbuci_data_Global.ln.get("rightbar-action-trigger"), ac : $bind(this,this.setTrigger)},{ tp : "Button", id : "over", tx : com_tilbuci_data_Global.ln.get("rightbar-action-over"), ac : $bind(this,this.setOver)},{ tp : "Button", id : "timed", tx : com_tilbuci_data_Global.ln.get("rightbar-action-timed"), ac : $bind(this,this.setTimed)}],3355443,wd - 5);
	this.ui.containers.h["properties"].set_enabled(false);
	com_tilbuci_data_Global.history.propDisplay.push($bind(this,this.updateValues));
};
$hxClasses["com.tilbuci.ui.component.ActionPanel"] = com_tilbuci_ui_component_ActionPanel;
com_tilbuci_ui_component_ActionPanel.__name__ = "com.tilbuci.ui.component.ActionPanel";
com_tilbuci_ui_component_ActionPanel.__super__ = com_tilbuci_ui_component_DropDownPanel;
com_tilbuci_ui_component_ActionPanel.prototype = $extend(com_tilbuci_ui_component_DropDownPanel.prototype,{
	_current: null
	,updateContent: function(data) {
		if(Object.prototype.hasOwnProperty.call(data.h,"nm")) {
			if(data.h["nm"] == "") {
				this.clearValues();
			} else {
				this._current = com_tilbuci_data_GlobalPlayer.area.instanceRef(data.h["nm"]);
				this.updateValues();
			}
		} else {
			this.clearValues();
		}
	}
	,reloadContent: function(data) {
		this.clearValues();
	}
	,updateValues: function() {
		if(this._current != null) {
			this.ui.containers.h["properties"].set_enabled(true);
		}
	}
	,clearValues: function() {
		this.ui.containers.h["properties"].set_enabled(false);
		this._current = null;
	}
	,setTrigger: function(evt) {
		var this1 = com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[com_tilbuci_data_GlobalPlayer.area.get_currentKf()];
		var key = this._current.getInstName();
		com_tilbuci_data_Global.showActionWindow(this1.h[key].action,$bind(this,this.onOk),$bind(this,this.onCancel));
	}
	,setOver: function(evt) {
		var this1 = com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[com_tilbuci_data_GlobalPlayer.area.get_currentKf()];
		var key = this._current.getInstName();
		com_tilbuci_data_Global.showActionWindow(this1.h[key].actionover,$bind(this,this.onOkOver),$bind(this,this.onCancelOver));
	}
	,setTimed: function(evt) {
		var tmp = this.startWindow;
		var _g = new haxe_ds_StringMap();
		var value = this._current.getCurrentStr("instance");
		_g.h["instance"] = value;
		var value = this._current.getCurrentStr("collection");
		_g.h["collection"] = value;
		var value = this._current.getCurrentStr("asset");
		_g.h["asset"] = value;
		tmp("timedaction",_g);
	}
	,onOk: function(newac) {
		if(com_tilbuci_data_Global.history.states.length == 0) {
			com_tilbuci_data_Global.history.addState(com_tilbuci_data_Global.ln.get("rightbar-history-original"));
		}
		var this1 = com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[com_tilbuci_data_GlobalPlayer.area.get_currentKf()];
		var key = this._current.getInstName();
		this1.h[key].action = newac;
		com_tilbuci_data_Global.history.addState(com_tilbuci_data_Global.ln.get("rightbar-history-actrigger"));
	}
	,onCancel: function() {
	}
	,onOkOver: function(newac) {
		if(com_tilbuci_data_Global.history.states.length == 0) {
			com_tilbuci_data_Global.history.addState(com_tilbuci_data_Global.ln.get("rightbar-history-original"));
		}
		var this1 = com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[com_tilbuci_data_GlobalPlayer.area.get_currentKf()];
		var key = this._current.getInstName();
		this1.h[key].actionover = newac;
		com_tilbuci_data_Global.history.addState(com_tilbuci_data_Global.ln.get("rightbar-history-acover"));
	}
	,onCancelOver: function() {
	}
	,__class__: com_tilbuci_ui_component_ActionPanel
});
var com_tilbuci_ui_component_BlockArea = function(code) {
	this._blocks = [];
	feathers_controls_ScrollContainer.call(this);
	this._code = code;
	var lay = new feathers_layout_VerticalLayout();
	lay.setPadding(5);
	lay.set_gap(5);
	this.set_layout(lay);
	this._selected = null;
	this._addbt = new com_tilbuci_ui_component_IDButton("addbt",$bind(this,this.addActionBlock),null,openfl_utils_Assets.getBitmapData("btPlus"));
	this._addbt.set_toolTip(com_tilbuci_data_Global.ln.get("acblock-addbt"));
};
$hxClasses["com.tilbuci.ui.component.BlockArea"] = com_tilbuci_ui_component_BlockArea;
com_tilbuci_ui_component_BlockArea.__name__ = "com.tilbuci.ui.component.BlockArea";
com_tilbuci_ui_component_BlockArea.__super__ = feathers_controls_ScrollContainer;
com_tilbuci_ui_component_BlockArea.prototype = $extend(feathers_controls_ScrollContainer.prototype,{
	_code: null
	,_json: null
	,_selected: null
	,_blocks: null
	,_addbt: null
	,refresh: function() {
		this.clear();
		if(this._code.get_text() == "" || this._code.get_text() == "[]") {
			this._json = com_tilbuci_statictools_StringStatic.jsonParse("[ ]");
			this.addChild(this._addbt);
			return true;
		} else {
			if(StringTools.trim(HxOverrides.substr(this._code.get_text(),0,1)) != "[") {
				this._code.set_text("[" + StringTools.trim(this._code.get_text()) + "]");
			}
			this._json = com_tilbuci_statictools_StringStatic.jsonParse(this._code.get_text());
			if(this._json == false) {
				return false;
			} else {
				var ord = 0;
				var _g = 0;
				var _g1 = Reflect.fields(this._json);
				while(_g < _g1.length) {
					var k = _g1[_g];
					++_g;
					this.addAction(new com_tilbuci_ui_component_BlockAction(Reflect.field(this._json,k)),ord);
					++ord;
				}
				this.addChild(this._addbt);
				return true;
			}
		}
	}
	,addAction: function(ac,ord) {
		var bla = new com_tilbuci_ui_component_ActionBlock(ac,this.get_width(),ord,$bind(this,this.clickAction),$bind(this,this.dbClickAction));
		this._blocks.push(bla);
		this.addChild(bla);
	}
	,clear: function() {
		this.removeChildren();
		this._selected = null;
		while(this._blocks.length > 0) this._blocks.shift().kill();
	}
	,toJson: function() {
		if(this._blocks.length == 0) {
			return "";
		} else {
			var json = [];
			var _g = 0;
			var _g1 = this._blocks;
			while(_g < _g1.length) {
				var bl = _g1[_g];
				++_g;
				json.push(bl.toObject());
			}
			return com_tilbuci_statictools_StringStatic.jsonStringify(json,"  ");
		}
	}
	,openAll: function() {
		if(this._selected == null) {
			var _g = 0;
			var _g1 = this._blocks;
			while(_g < _g1.length) {
				var b = _g1[_g];
				++_g;
				b.openAll();
			}
		} else {
			this._selected.openAll();
		}
	}
	,closeAll: function() {
		if(this._selected == null) {
			var _g = 0;
			var _g1 = this._blocks;
			while(_g < _g1.length) {
				var b = _g1[_g];
				++_g;
				b.closeAll();
			}
		} else {
			this._selected.closeAll();
		}
	}
	,upAction: function() {
		if(this._selected != null) {
			var isHere = false;
			var _g = 0;
			var _g1 = this._blocks;
			while(_g < _g1.length) {
				var bl = _g1[_g];
				++_g;
				if(bl == this._selected) {
					isHere = true;
				}
			}
			if(isHere) {
				if(this._selected.order > 0) {
					var newArr = [];
					if(this._selected.order - 1 > 0) {
						var _g = 0;
						var _g1 = this._selected.order - 1;
						while(_g < _g1) {
							var i = _g++;
							newArr.push(this._blocks[i]);
						}
					}
					newArr.push(this._blocks[this._selected.order]);
					newArr.push(this._blocks[this._selected.order - 1]);
					if(this._blocks.length > this._selected.order + 1) {
						var _g = this._selected.order + 1;
						var _g1 = this._blocks.length;
						while(_g < _g1) {
							var i = _g++;
							newArr.push(this._blocks[i]);
						}
					}
					while(this._blocks.length > 0) this._blocks.shift();
					while(newArr.length > 0) this._blocks.push(newArr.shift());
					this.removeChildren();
					var _g = 0;
					var _g1 = this._blocks.length;
					while(_g < _g1) {
						var i = _g++;
						this._blocks[i].setOrder(i);
						this.addChild(this._blocks[i]);
					}
					this.addChild(this._addbt);
				}
			} else {
				var _g = 0;
				var _g1 = this._blocks;
				while(_g < _g1.length) {
					var bl = _g1[_g];
					++_g;
					bl.upAction(this._selected);
				}
			}
		}
	}
	,downAction: function() {
		if(this._selected != null) {
			var isHere = false;
			var _g = 0;
			var _g1 = this._blocks;
			while(_g < _g1.length) {
				var bl = _g1[_g];
				++_g;
				if(bl == this._selected) {
					isHere = true;
				}
			}
			if(isHere) {
				if(this._selected.order < this._blocks.length - 1) {
					var newArr = [];
					if(this._selected.order > 0) {
						var _g = 0;
						var _g1 = this._selected.order;
						while(_g < _g1) {
							var i = _g++;
							newArr.push(this._blocks[i]);
						}
					}
					newArr.push(this._blocks[this._selected.order + 1]);
					newArr.push(this._blocks[this._selected.order]);
					if(this._blocks.length > this._selected.order + 2) {
						var _g = this._selected.order + 2;
						var _g1 = this._blocks.length;
						while(_g < _g1) {
							var i = _g++;
							newArr.push(this._blocks[i]);
						}
					}
					while(this._blocks.length > 0) this._blocks.shift();
					while(newArr.length > 0) this._blocks.push(newArr.shift());
					this.removeChildren();
					var _g = 0;
					var _g1 = this._blocks.length;
					while(_g < _g1) {
						var i = _g++;
						this._blocks[i].setOrder(i);
						this.addChild(this._blocks[i]);
					}
					this.addChild(this._addbt);
				}
			} else {
				var _g = 0;
				var _g1 = this._blocks;
				while(_g < _g1.length) {
					var bl = _g1[_g];
					++_g;
					bl.downAction(this._selected);
				}
			}
		}
	}
	,removeAction: function() {
		if(this._selected != null) {
			var isHere = false;
			var _g = 0;
			var _g1 = this._blocks;
			while(_g < _g1.length) {
				var bl = _g1[_g];
				++_g;
				if(bl == this._selected) {
					isHere = true;
				}
			}
			if(isHere) {
				this._blocks.splice(this._selected.order,1);
				this.removeChildren();
				var _g = 0;
				var _g1 = this._blocks.length;
				while(_g < _g1) {
					var i = _g++;
					this._blocks[i].setOrder(i);
					this.addChild(this._blocks[i]);
				}
				this.addChild(this._addbt);
			} else {
				var _g = 0;
				var _g1 = this._blocks;
				while(_g < _g1.length) {
					var bl = _g1[_g];
					++_g;
					bl.removeAction(this._selected);
				}
			}
			this._selected.kill();
			this._selected = null;
		}
	}
	,editAction: function() {
		if(this._selected != null) {
			com_tilbuci_data_Global.showEditBlockWindow(this._selected.blaction.ac,$bind(this,this.editReturn),this._selected.order,this._selected.blaction);
		}
	}
	,addActionBlock: function(evt) {
		evt.stopImmediatePropagation();
		com_tilbuci_data_Global.showNewBlockWindow($bind(this,this.onNewBlock));
	}
	,clickAction: function(bl,inner) {
		if(inner == null) {
			inner = false;
		}
		this._selected = null;
		if(inner) {
			var _g = 0;
			var _g1 = this._blocks;
			while(_g < _g1.length) {
				var b = _g1[_g];
				++_g;
				b.unselect();
			}
			if(bl.selected) {
				this._selected = bl;
			}
		} else {
			if(bl.selected) {
				bl.unselect();
			} else {
				var _g = 0;
				var _g1 = this._blocks;
				while(_g < _g1.length) {
					var b = _g1[_g];
					++_g;
					b.unselect();
				}
				bl.select();
			}
			var _g = 0;
			var _g1 = this._blocks;
			while(_g < _g1.length) {
				var b = _g1[_g];
				++_g;
				if(b.selected) {
					this._selected = b;
				}
			}
		}
		var _g = 0;
		var _g1 = this._blocks;
		while(_g < _g1.length) {
			var b = _g1[_g];
			++_g;
			b.unselectAll(this._selected);
		}
	}
	,dbClickAction: function(bl) {
		this._selected = null;
		var _g = 0;
		var _g1 = this._blocks;
		while(_g < _g1.length) {
			var b = _g1[_g];
			++_g;
			b.unselectAll(this._selected);
		}
		bl.select();
		this._selected = bl;
		this.editAction();
	}
	,onNewBlock: function(jsonac) {
		if(jsonac == false) {
			if(this._selected != null) {
				this._selected.refresh();
			}
		} else {
			this.removeChild(this._addbt);
			var bla = new com_tilbuci_ui_component_ActionBlock(new com_tilbuci_ui_component_BlockAction(jsonac),this.get_width(),this._blocks.length,$bind(this,this.clickAction),$bind(this,this.dbClickAction));
			this._blocks.push(bla);
			this.addChild(bla);
			this.addChild(this._addbt);
		}
	}
	,editReturn: function(jsonac) {
		if(jsonac == false) {
			if(this._selected != null) {
				this._selected.refresh();
			}
		} else {
			this.removeChild(this._addbt);
			var bla = new com_tilbuci_ui_component_ActionBlock(new com_tilbuci_ui_component_BlockAction(jsonac),this.get_width(),this._blocks.length,$bind(this,this.clickAction),$bind(this,this.dbClickAction));
			this._blocks.push(bla);
			this.addChild(bla);
			this.addChild(this._addbt);
		}
	}
	,__class__: com_tilbuci_ui_component_BlockArea
});
var com_tilbuci_ui_component_BlockAction = function(json) {
	this.param = [];
	this.color = 0;
	this.ac = "";
	if(Object.prototype.hasOwnProperty.call(json,"ac")) {
		this.ac = Reflect.field(json,"ac");
	}
	if(Object.prototype.hasOwnProperty.call(json,"param")) {
		this.param = Reflect.field(json,"param");
	}
	var _g = new haxe_ds_StringMap();
	_g.h["then"] = [];
	_g.h["else"] = [];
	_g.h["tick"] = [];
	_g.h["end"] = [];
	_g.h["ok"] = [];
	_g.h["cancel"] = [];
	_g.h["success"] = [];
	_g.h["error"] = [];
	_g.h["select"] = [];
	_g.h["complete"] = [];
	_g.h["win"] = [];
	_g.h["loose"] = [];
	this.extras = _g;
	var h = this.extras.h;
	var ex_h = h;
	var ex_keys = Object.keys(h);
	var ex_length = ex_keys.length;
	var ex_current = 0;
	while(ex_current < ex_length) {
		var ex = ex_keys[ex_current++];
		if(Object.prototype.hasOwnProperty.call(json,ex)) {
			var acs = Reflect.field(json,ex);
			var _g = 0;
			var _g1 = Reflect.fields(acs);
			while(_g < _g1.length) {
				var k = _g1[_g];
				++_g;
				var bla = new com_tilbuci_ui_component_BlockAction(Reflect.field(acs,k));
				if(bla.ac != "") {
					this.extras.h[ex].push(bla);
				} else {
					bla.kill();
				}
			}
		}
	}
};
$hxClasses["com.tilbuci.ui.component.BlockAction"] = com_tilbuci_ui_component_BlockAction;
com_tilbuci_ui_component_BlockAction.__name__ = "com.tilbuci.ui.component.BlockAction";
com_tilbuci_ui_component_BlockAction.prototype = {
	ac: null
	,color: null
	,param: null
	,extras: null
	,extraJson: function(name) {
		if(Object.prototype.hasOwnProperty.call(this.extras.h,name)) {
			if(this.extras.h[name].length > 0) {
				var exdata = [];
				var _g = 0;
				var _g1 = this.extras.h[name].length;
				while(_g < _g1) {
					var iex = _g++;
					exdata.push(this.extras.h[name][iex].toObject());
				}
				return com_tilbuci_statictools_StringStatic.jsonStringify(exdata);
			} else {
				return "[ ]";
			}
		} else {
			return "[ ]";
		}
	}
	,toObject: function() {
		var ret = { ac : this.ac, param : this.param};
		var h = this.extras.h;
		var ex_h = h;
		var ex_keys = Object.keys(h);
		var ex_length = ex_keys.length;
		var ex_current = 0;
		while(ex_current < ex_length) {
			var ex = ex_keys[ex_current++];
			if(this.extras.h[ex].length > 0) {
				var exdata = [];
				var _g = 0;
				var _g1 = this.extras.h[ex].length;
				while(_g < _g1) {
					var iex = _g++;
					exdata.push(this.extras.h[ex][iex].toObject());
				}
				ret[ex] = exdata;
			}
		}
		return ret;
	}
	,kill: function() {
		this.ac = null;
		if(this.param != null) {
			while(this.param.length > 0) this.param.shift();
		}
		this.param = null;
		if(this.extras != null) {
			var h = this.extras.h;
			var k_h = h;
			var k_keys = Object.keys(h);
			var k_length = k_keys.length;
			var k_current = 0;
			while(k_current < k_length) {
				var k = k_keys[k_current++];
				while(this.extras.h[k].length > 0) this.extras.h[k].shift().kill();
				var _this = this.extras;
				if(Object.prototype.hasOwnProperty.call(_this.h,k)) {
					delete(_this.h[k]);
				}
			}
		}
		this.extras = null;
	}
	,__class__: com_tilbuci_ui_component_BlockAction
};
var feathers_core_IStageFocusDelegate = function() { };
$hxClasses["feathers.core.IStageFocusDelegate"] = feathers_core_IStageFocusDelegate;
feathers_core_IStageFocusDelegate.__name__ = "feathers.core.IStageFocusDelegate";
feathers_core_IStageFocusDelegate.__isInterface__ = true;
feathers_core_IStageFocusDelegate.__interfaces__ = [feathers_core_IFocusObject];
feathers_core_IStageFocusDelegate.prototype = {
	get_stageFocusTarget: null
	,__class__: feathers_core_IStageFocusDelegate
	,__properties__: {get_stageFocusTarget:"get_stageFocusTarget"}
};
var moonshine_editor_text_TextEditor = function(text,readOnly) {
	if(readOnly == null) {
		readOnly = false;
	}
	this.__highlightAllFindResults = false;
	this.__customTextLineRendererVariant = null;
	this.__disabledBackgroundSkin = null;
	this.__backgroundSkin = null;
	this.__embedFonts = false;
	this.__minLineNumberCharacters = 3;
	this.__lineNumberWidth = null;
	this.blockComment = null;
	this.lineComment = null;
	this._wordWrap = false;
	this._textLineModelFactory = function(text,lineIndex) {
		return new moonshine_editor_text_lines_TextLineModel(text,lineIndex);
	};
	this._debuggerLineIndex = -1;
	this._breakpoints = [];
	this._allowToggleBreakpoints = false;
	this.insertSpacesForTabs = false;
	this._tabWidth = 4;
	this._expandedCaretCharIndex = 0;
	this._caretLineIndex = 0;
	this._selectionEndCharIndex = -1;
	this._selectionEndLineIndex = -1;
	this._selectionStartCharIndex = -1;
	this._selectionStartLineIndex = -1;
	this._lineHeight = 0.0;
	this._hasFocus = false;
	this._showLineNumbers = true;
	this._gutterWidth = 0.0;
	this._visibleLines = 0;
	this._maxLineScrollY = 0;
	this._lineScrollY = 0;
	this._scrollY = 0.0;
	this._scrollX = 0.0;
	this._viewPortVisibleBounds = new openfl_geom_Rectangle();
	this._measurementTextLineModel = new moonshine_editor_text_lines_TextLineModel("a",5);
	this._lineDelimiter = null;
	this.defaultLineDelimiter = "\n";
	moonshine_editor_text_theme_TextEditorStyles.initialize();
	feathers_core_FeathersControl.call(this);
	this._readOnly = readOnly;
	if(!this._readOnly) {
		this._editMananger = new moonshine_editor_text_managers_EditManager(this);
		this._undoManager = new moonshine_editor_text_managers_UndoManager(this);
	}
	this._clipboardMananger = new moonshine_editor_text_managers_ClipboardManager(this);
	this._selectionMananger = new moonshine_editor_text_managers_SelectionManager(this);
	this._colorManager = new moonshine_editor_text_managers_ColorManager(this);
	this._findReplaceManager = new moonshine_editor_text_managers_FindReplaceManager(this);
	this.createContextMenu();
	this.set_text(text);
	this.addEventListener(moonshine_editor_text_events_TextEditorChangeEvent.TEXT_CHANGE,$bind(this,this.textEditor_textChangeHandler));
	this.addEventListener("focusIn",$bind(this,this.textEditor_focusInHandler));
};
$hxClasses["moonshine.editor.text.TextEditor"] = moonshine_editor_text_TextEditor;
moonshine_editor_text_TextEditor.__name__ = "moonshine.editor.text.TextEditor";
moonshine_editor_text_TextEditor.__interfaces__ = [feathers_core_IStageFocusDelegate,feathers_core_IFocusObject];
moonshine_editor_text_TextEditor.__super__ = feathers_core_FeathersControl;
moonshine_editor_text_TextEditor.prototype = $extend(feathers_core_FeathersControl.prototype,{
	_readOnly: null
	,get_readOnly: function() {
		return this._readOnly;
	}
	,_editMananger: null
	,_undoManager: null
	,_selectionMananger: null
	,_clipboardMananger: null
	,_colorManager: null
	,_findReplaceManager: null
	,_listView: null
	,_layout: null
	,get_stageFocusTarget: function() {
		return this._listView;
	}
	,defaultLineDelimiter: null
	,_lineDelimiter: null
	,get_lineDelimiter: function() {
		if(this._lineDelimiter == null) {
			return this.defaultLineDelimiter;
		}
		return this._lineDelimiter;
	}
	,set_lineDelimiter: function(value) {
		if(this._lineDelimiter == value) {
			return this._lineDelimiter;
		}
		this._lineDelimiter = value;
		return this._lineDelimiter;
	}
	,_measurementTextLineRenderer: null
	,_measurementTextLineModel: null
	,_lines: null
	,get_lines: function() {
		return this._lines;
	}
	,get_text: function() {
		var _this = this._lines.get_array();
		var result = new Array(_this.length);
		var _g = 0;
		var _g1 = _this.length;
		while(_g < _g1) {
			var i = _g++;
			result[i] = _this[i].text;
		}
		return result.join(this.get_lineDelimiter());
	}
	,set_text: function(value) {
		if(value == null) {
			value = "";
		}
		if(value.indexOf("\r\n") != -1) {
			this._lineDelimiter = "\r\n";
		} else if(value.indexOf("\r") != -1) {
			this._lineDelimiter = "\r";
		} else if(value.indexOf("\n") != -1) {
			this._lineDelimiter = "\n";
		} else {
			this._lineDelimiter = this.defaultLineDelimiter;
		}
		var lines = new EReg("\r?\n|\r","g").split(value);
		var lineModels = [];
		lineModels.length = lines.length;
		var _g = 0;
		var _g1 = lines.length;
		while(_g < _g1) {
			var i = _g++;
			lineModels[i] = new moonshine_editor_text_lines_TextLineModel(lines[i],i);
		}
		if(this._lines != null) {
			this._lines.removeEventListener("addItem",$bind(this,this.textEditor_lines_addItemHandler));
			this._lines.removeEventListener("removeItem",$bind(this,this.textEditor_lines_removeItemHandler));
			this._lines.removeEventListener("updateItem",$bind(this,this.textEditor_lines_updateItemHandler));
			this._lines.removeEventListener("updateAll",$bind(this,this.textEditor_lines_updateAllHandler));
			this._lines.removeEventListener("change",$bind(this,this.textEditor_lines_changeHandler));
		}
		this._lines = new feathers_data_ArrayCollection(lineModels);
		this._lines.addEventListener("addItem",$bind(this,this.textEditor_lines_addItemHandler));
		this._lines.addEventListener("removeItem",$bind(this,this.textEditor_lines_removeItemHandler));
		this._lines.addEventListener("updateItem",$bind(this,this.textEditor_lines_updateItemHandler));
		this._lines.addEventListener("updateAll",$bind(this,this.textEditor_lines_updateAllHandler));
		this._lines.addEventListener("change",$bind(this,this.textEditor_lines_changeHandler));
		this._colorManager.reset();
		if(this._undoManager != null) {
			this._undoManager.clear();
		}
		this.setSelection(0,0,0,0);
		this._scrollX = 0.0;
		this._scrollY = 0.0;
		this._lineScrollY = 0;
		if(this._listView != null) {
			this._listView.set_scrollX(0.0);
			this._listView.set_scrollY(0.0);
		}
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		return value;
	}
	,_viewPortVisibleBounds: null
	,_scrollX: null
	,get_scrollX: function() {
		return this._scrollX;
	}
	,set_scrollX: function(value) {
		if(this._scrollX == value) {
			return this._scrollX;
		}
		this._scrollX = value;
		this.setInvalid(feathers_core_InvalidationFlag.SCROLL);
		return this._scrollX;
	}
	,get_minScrollX: function() {
		if(this._listView == null) {
			return 0.0;
		}
		return this._listView.get_minScrollX();
	}
	,get_maxScrollX: function() {
		if(this._listView == null) {
			return 0.0;
		}
		return this._listView.get_maxScrollX();
	}
	,_scrollY: null
	,get_scrollY: function() {
		return this._scrollY;
	}
	,set_scrollY: function(value) {
		if(this._scrollY == value) {
			return this._scrollY;
		}
		this._scrollY = value;
		var scrollY = this._scrollY;
		var tmp;
		if(this._lineHeight == 0.0) {
			tmp = 0;
		} else {
			var floatLineScrollY = this._scrollY / this._lineHeight;
			var roundedLineScrollY = Math.round(floatLineScrollY);
			tmp = feathers_utils_MathUtil.fuzzyEquals(floatLineScrollY,roundedLineScrollY) ? roundedLineScrollY : floatLineScrollY | 0;
		}
		this._lineScrollY = tmp;
		this.setInvalid(feathers_core_InvalidationFlag.SCROLL);
		return this._scrollY;
	}
	,get_minScrollY: function() {
		if(this._listView == null) {
			return 0.0;
		}
		return this._listView.get_minScrollY();
	}
	,get_maxScrollY: function() {
		if(this._listView == null) {
			return 0.0;
		}
		return this._listView.get_maxScrollY();
	}
	,_lineScrollY: null
	,get_lineScrollY: function() {
		return this._lineScrollY;
	}
	,set_lineScrollY: function(value) {
		if(this.get_lineScrollY() == value) {
			return this.get_lineScrollY();
		}
		this._lineScrollY = value;
		this._scrollY = this._lineScrollY * this._lineHeight;
		this.setInvalid(feathers_core_InvalidationFlag.SCROLL);
		return this._lineScrollY;
	}
	,_maxLineScrollY: null
	,get_maxLineScrollY: function() {
		return this._maxLineScrollY;
	}
	,_visibleLines: null
	,get_visibleLines: function() {
		return this._visibleLines;
	}
	,_gutterWidth: null
	,get_gutterWidth: function() {
		return this._gutterWidth;
	}
	,_showLineNumbers: null
	,get_showLineNumbers: function() {
		return this._showLineNumbers;
	}
	,set_showLineNumbers: function(value) {
		if(this._showLineNumbers == value) {
			return this._showLineNumbers;
		}
		this._showLineNumbers = value;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		this._lines.updateAll();
		return this._showLineNumbers;
	}
	,_searchResult: null
	,_hasFocus: null
	,_parser: null
	,_textStyles: null
	,getTextStyle: function(id) {
		return this._textStyles.h[id];
	}
	,getDefaultTextStyle: function() {
		if(this._parser == null) {
			return this._textStyles.h[0];
		}
		var this1 = this._textStyles;
		var key = this._parser.get_defaultContext();
		return this1.h[key];
	}
	,_lineHeight: null
	,get_lineHeight: function() {
		return this._lineHeight;
	}
	,get_edited: function() {
		if(this._undoManager == null) {
			return false;
		}
		return this._undoManager.get_edited();
	}
	,get_hasSelection: function() {
		return this._selectionStartLineIndex != -1;
	}
	,get_selectedText: function() {
		if(!this.get_hasSelection()) {
			return "";
		}
		if(this._selectionStartLineIndex != this._selectionEndLineIndex) {
			var startLine = this._selectionStartLineIndex;
			var endLine = this._selectionEndLineIndex;
			var startChar = this._selectionStartCharIndex;
			var endChar = this._selectionEndCharIndex;
			if(startLine > endLine) {
				startLine = endLine;
				endLine = this._selectionStartLineIndex;
				startChar = endChar;
				endChar = this._selectionStartCharIndex;
			}
			var selText = HxOverrides.substr(this._lines.get(startLine).text,startChar,null);
			var _g = startLine + 1;
			var _g1 = endLine;
			while(_g < _g1) {
				var i = _g++;
				selText += this._lineDelimiter + this._lines.get(i).text;
			}
			selText += this._lineDelimiter + HxOverrides.substr(this._lines.get(endLine).text,0,endChar);
			return selText;
		}
		var startChar = this._selectionStartCharIndex;
		var endChar = this._selectionEndCharIndex;
		if(startChar > endChar) {
			startChar = endChar;
			endChar = this._selectionStartCharIndex;
		}
		return this._lines.get(this._selectionStartLineIndex).text.substring(startChar,endChar);
	}
	,_selectionStartLineIndex: null
	,get_selectionStartLineIndex: function() {
		return this._selectionStartLineIndex;
	}
	,_selectionStartCharIndex: null
	,get_selectionStartCharIndex: function() {
		return this._selectionStartCharIndex;
	}
	,_selectionEndLineIndex: null
	,get_selectionEndLineIndex: function() {
		return this._selectionEndLineIndex;
	}
	,_selectionEndCharIndex: null
	,get_selectionEndCharIndex: function() {
		return this._selectionEndCharIndex;
	}
	,get_caretLine: function() {
		if(this._caretLineIndex == -1) {
			return null;
		}
		return this._lines.get(this._caretLineIndex);
	}
	,_caretLineIndex: null
	,get_caretLineIndex: function() {
		return this._caretLineIndex;
	}
	,_expandedCaretCharIndex: null
	,get_caretCharIndex: function() {
		var caretLine = null;
		if(this._caretLineIndex < this._lines.get_length()) {
			caretLine = this._lines.get(this._caretLineIndex);
		}
		if(caretLine == null) {
			return 0;
		}
		var indent = moonshine_editor_text_utils_TextUtil.indentAmount(caretLine.text);
		var index = this._expandedCaretCharIndex - indent * (this._tabWidth - 1);
		if(index <= indent) {
			index = Math.round(this._expandedCaretCharIndex / this._tabWidth);
		}
		return Math.min(index,caretLine.text.length) | 0;
	}
	,get_expandedCaretCharIndex: function() {
		return this._expandedCaretCharIndex;
	}
	,_tabWidth: null
	,get_tabWidth: function() {
		return this._tabWidth;
	}
	,set_tabWidth: function(value) {
		if(this._tabWidth == value) {
			return this._tabWidth;
		}
		this._tabWidth = value;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		this._lines.updateAll();
		return this._tabWidth;
	}
	,insertSpacesForTabs: null
	,_allowToggleBreakpoints: null
	,get_allowToggleBreakpoints: function() {
		return this._allowToggleBreakpoints;
	}
	,set_allowToggleBreakpoints: function(value) {
		if(this._allowToggleBreakpoints == value) {
			return this._allowToggleBreakpoints;
		}
		this._allowToggleBreakpoints = value;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		this._lines.updateAll();
		return this._allowToggleBreakpoints;
	}
	,_breakpoints: null
	,get_breakpoints: function() {
		return this._breakpoints;
	}
	,set_breakpoints: function(value) {
		if(value == null) {
			value = [];
		}
		if(this._breakpoints == value) {
			return this._breakpoints;
		}
		if(this._breakpoints != null) {
			var _g = 0;
			var _g1 = this._breakpoints;
			while(_g < _g1.length) {
				var breakpoint = _g1[_g];
				++_g;
				if(breakpoint < 0 || breakpoint >= this._lines.get_length()) {
					continue;
				}
				this.updateLineAtIndex(breakpoint);
			}
		}
		this._breakpoints = value;
		if(this._breakpoints != null) {
			var _g = 0;
			var _g1 = this._breakpoints;
			while(_g < _g1.length) {
				var breakpoint = _g1[_g];
				++_g;
				if(breakpoint < 0 || breakpoint >= this._lines.get_length()) {
					continue;
				}
				this.updateLineAtIndex(breakpoint);
			}
		}
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		return this._breakpoints;
	}
	,_debuggerLineIndex: null
	,get_debuggerLineIndex: function() {
		return this._debuggerLineIndex;
	}
	,set_debuggerLineIndex: function(value) {
		if(this._debuggerLineIndex == value) {
			return this._debuggerLineIndex;
		}
		if(this._debuggerLineIndex >= 0 && this._debuggerLineIndex < this._lines.get_length()) {
			this.updateLineAtIndex(this._debuggerLineIndex);
		}
		this._debuggerLineIndex = value;
		if(this._debuggerLineIndex >= 0 && this._debuggerLineIndex < this._lines.get_length()) {
			this.updateLineAtIndex(this._debuggerLineIndex);
		}
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		return this._debuggerLineIndex;
	}
	,_textLineModelFactory: null
	,get_textLineModelFactory: function() {
		return this._textLineModelFactory;
	}
	,set_textLineModelFactory: function(value) {
		if(value == this._textLineModelFactory) {
			return this._textLineModelFactory;
		}
		this._textLineModelFactory = value;
		var _g = 0;
		var _g1 = this._lines.get_length();
		while(_g < _g1) {
			var i = _g++;
			var oldLine = this._lines.get(i);
			this._lines.set(i,this._textLineModelFactory(oldLine.text,oldLine.lineIndex));
		}
		return this._textLineModelFactory;
	}
	,_wordWrap: null
	,get_wordWrap: function() {
		return this._wordWrap;
	}
	,set_wordWrap: function(value) {
		if(this._wordWrap == value) {
			return this._wordWrap;
		}
		this._wordWrap = value;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		this._lines.updateAll();
		return this._wordWrap;
	}
	,brackets: null
	,autoClosingPairs: null
	,lineComment: null
	,blockComment: null
	,get_macHomeAndEndEnabled: function() {
		return this._selectionMananger.macHomeAndEndEnabled;
	}
	,set_macHomeAndEndEnabled: function(value) {
		this._selectionMananger.macHomeAndEndEnabled = value;
		return this._selectionMananger.macHomeAndEndEnabled;
	}
	,_textLineRendererFactory: null
	,get_textLineRendererFactory: function() {
		return this._textLineRendererFactory;
	}
	,set_textLineRendererFactory: function(value) {
		if(this._textLineRendererFactory == value) {
			return this._textLineRendererFactory;
		}
		this._textLineRendererFactory = value;
		if(this._measurementTextLineRenderer != null) {
			this.destroyTextLineRenderer(this._measurementTextLineRenderer);
		}
		this._measurementTextLineRenderer = this.createTextLineRenderer();
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this._textLineRendererFactory;
	}
	,get_parser: function() {
		return this._parser;
	}
	,set_parser: function(value) {
		if(this._parser == value) {
			return this._parser;
		}
		this._parser = value;
		this._colorManager.set_parser(value);
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		this._lines.updateAll();
		return this._parser;
	}
	,get_textStyles: function() {
		return this._textStyles;
	}
	,set_textStyles: function(value) {
		if(this._textStyles == value) {
			return this._textStyles;
		}
		this._textStyles = value;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		this._lines.updateAll();
		return this._textStyles;
	}
	,setParserAndTextStyles: function(parser,textStyles) {
		this.set_parser(parser);
		this.set_textStyles(textStyles);
	}
	,getViewPortVisibleBounds: function(result) {
		return this._viewPortVisibleBounds;
	}
	,save: function() {
		if(this._undoManager != null) {
			this._undoManager.save();
		}
	}
	,toggleBreakpoint: function(lineIndex) {
		if(lineIndex == null) {
			lineIndex = this._caretLineIndex;
		}
		var newBreakpoints = this._breakpoints.slice();
		var foundIndex = newBreakpoints.indexOf(lineIndex);
		if(foundIndex == -1) {
			newBreakpoints.push(lineIndex);
		} else {
			newBreakpoints.splice(foundIndex,1);
		}
		var line = this._lines.get(lineIndex);
		var textLineRenderer = js_Boot.__cast(this._listView.itemToItemRenderer(line) , moonshine_editor_text_lines_TextLineRenderer);
		if(textLineRenderer != null) {
			textLineRenderer.set_breakpoint(foundIndex == -1);
		}
		this._breakpoints = newBreakpoints;
		this.dispatchEvent(new moonshine_editor_text_events_TextEditorLineEvent(moonshine_editor_text_events_TextEditorLineEvent.TOGGLE_BREAKPOINT,lineIndex));
	}
	,toggleLineComment: function() {
		if(this.get_readOnly()) {
			throw new openfl_errors_IllegalOperationError("Toggle line comment not allowed on read-only text editor");
		}
		this._editMananger.toggleLineComment();
	}
	,toggleBlockComment: function() {
		if(this.get_readOnly()) {
			throw new openfl_errors_IllegalOperationError("Toggle block comment not allowed on read-only text editor");
		}
		this._editMananger.toggleBlockComment();
	}
	,setSelectionAdvanced: function(startLine,startChar,endLine,endChar,expandCaret) {
		var oldSelectionStartLineIndex = this._selectionStartLineIndex;
		var oldSelectionStartCharIndex = this._selectionStartCharIndex;
		var oldSelectionEndLineIndex = this._selectionEndLineIndex;
		var oldSelectionEndCharIndex = this._selectionEndCharIndex;
		var oldCaretLineIndex = this._caretLineIndex;
		var oldCaretCharIndex = this._expandedCaretCharIndex;
		var selectionChanged = false;
		var maxLine = this._lines.get_length() - 1;
		if(startLine > maxLine) {
			startLine = maxLine;
		}
		if(startLine < 0) {
			startLine = 0;
		}
		if(startChar < 0) {
			startChar = 0;
		}
		if(endLine > maxLine) {
			endLine = maxLine;
		}
		if(endLine < 0) {
			endLine = 0;
		}
		if(endChar < 0) {
			endChar = 0;
		}
		if(startLine == endLine && startChar == endChar) {
			if(this._selectionStartCharIndex != -1) {
				this._selectionStartLineIndex = -1;
				this._selectionStartCharIndex = -1;
				this._selectionEndLineIndex = -1;
				this._selectionEndCharIndex = -1;
				selectionChanged = true;
			}
		} else {
			if(this._selectionStartLineIndex != startLine) {
				this._selectionStartLineIndex = startLine;
				selectionChanged = true;
			}
			if(this._selectionStartCharIndex != startChar) {
				this._selectionStartCharIndex = startChar;
				selectionChanged = true;
			}
			if(this._selectionEndLineIndex != endLine) {
				this._selectionEndLineIndex = endLine;
				selectionChanged = true;
			}
			if(this._selectionEndCharIndex != endChar) {
				this._selectionEndCharIndex = endChar;
				selectionChanged = true;
			}
		}
		if(this._caretLineIndex != endLine) {
			this._caretLineIndex = endLine;
			selectionChanged = true;
		}
		var newCaretCharIndex = expandCaret ? this.expandCaretCharIndex(endChar) : endChar;
		if(this._expandedCaretCharIndex != newCaretCharIndex) {
			this._expandedCaretCharIndex = newCaretCharIndex;
			selectionChanged = true;
		}
		if(!selectionChanged) {
			return;
		}
		var startLine1 = oldSelectionStartLineIndex != -1 ? oldSelectionStartLineIndex : oldCaretLineIndex;
		var startChar1 = oldSelectionStartCharIndex != -1 ? oldSelectionStartCharIndex : oldCaretCharIndex;
		var endLine1 = oldSelectionEndLineIndex != -1 ? oldSelectionEndLineIndex : oldCaretLineIndex;
		var endChar1 = oldSelectionEndCharIndex != -1 ? oldSelectionEndCharIndex : oldCaretCharIndex;
		var startLine2 = this._selectionStartLineIndex != -1 ? this._selectionStartLineIndex : this._caretLineIndex;
		var startChar2 = this._selectionStartCharIndex != -1 ? this._selectionStartCharIndex : this._expandedCaretCharIndex;
		var endLine2 = this._selectionEndLineIndex != -1 ? this._selectionEndLineIndex : this._caretLineIndex;
		var endChar2 = this._selectionEndCharIndex != -1 ? this._selectionEndCharIndex : this._expandedCaretCharIndex;
		this.forceUpdateRangeDiff(startLine1,startChar1,endLine1,endChar1,startLine2,startChar2,endLine2,endChar2,false);
		this.dispatchEvent(new moonshine_editor_text_events_TextEditorEvent(moonshine_editor_text_events_TextEditorEvent.SELECTION_CHANGE));
	}
	,setSelection: function(startLine,startChar,endLine,endChar) {
		this.setSelectionAdvanced(startLine,startChar,endLine,endChar,true);
	}
	,selectAll: function() {
		this.setSelection(0,0,this._lines.get_length() - 1,this._lines.get(this._lines.get_length() - 1).text.length);
	}
	,removeSelection: function() {
		if(this._selectionStartLineIndex == -1) {
			return;
		}
		this.setSelectionAdvanced(this._caretLineIndex,this._expandedCaretCharIndex,this._caretLineIndex,this._expandedCaretCharIndex,false);
	}
	,clearFind: function() {
		this._searchResult = null;
		this._lines.updateAll();
	}
	,find: function(search,backwards,allowWrap) {
		if(allowWrap == null) {
			allowWrap = true;
		}
		if(backwards == null) {
			backwards = false;
		}
		this._searchResult = this._findReplaceManager.find(search,backwards,allowWrap);
		this._lines.updateAll();
		return this._searchResult;
	}
	,findNext: function(backwards,allowWrap) {
		if(allowWrap == null) {
			allowWrap = true;
		}
		if(backwards == null) {
			backwards = false;
		}
		this._searchResult = this._findReplaceManager.findNext(backwards,allowWrap);
		this._lines.updateAll();
		return this._searchResult;
	}
	,replaceOne: function(newText,allowWrap) {
		if(allowWrap == null) {
			allowWrap = true;
		}
		if(this.get_readOnly()) {
			throw new openfl_errors_IllegalOperationError("Replace not allowed on read-only text editor");
		}
		this._searchResult = this._findReplaceManager.replace(newText,false,allowWrap);
		this._lines.updateAll();
		return this._searchResult;
	}
	,replaceAll: function(newText) {
		if(this.get_readOnly()) {
			throw new openfl_errors_IllegalOperationError("Replace all not allowed on read-only text editor");
		}
		this._searchResult = this._findReplaceManager.replace(newText,true);
		this._lines.updateAll();
		return this._searchResult;
	}
	,getTextEditorPositionBoundaries: function(pos) {
		var lineIndex = pos.line;
		var line = this._lines.get(lineIndex);
		var charX = 0.0;
		var charWidth = 0.0;
		var textLineRenderer = js_Boot.__cast(this._listView.itemToItemRenderer(line) , moonshine_editor_text_lines_TextLineRenderer);
		if(textLineRenderer != null) {
			var bounds = textLineRenderer.getCharBoundaries(pos.character);
			if(bounds == null) {
				return null;
			}
			charX = bounds.x;
			charWidth = bounds.width;
		} else {
			var state = new feathers_data_ListViewItemState(line,lineIndex,false,line.text);
			textLineRenderer = this.createTextLineRenderer();
			this.updateTextLineRenderer(textLineRenderer,state);
			openfl_Lib.get_current().stage.addChild(textLineRenderer);
			textLineRenderer.validateNow();
			var bounds = textLineRenderer.getCharBoundaries(pos.character);
			if(bounds != null) {
				charX = bounds.x;
				charWidth = bounds.width;
			}
			this.resetTextLineRenderer(textLineRenderer,state);
			openfl_Lib.get_current().stage.removeChild(textLineRenderer);
			this.destroyTextLineRenderer(textLineRenderer);
			if(bounds == null) {
				return null;
			}
		}
		var localX = this._viewPortVisibleBounds.x + charX - this._listView.get_scrollX();
		var localY = this._viewPortVisibleBounds.y + this.get_lineHeight() * lineIndex - this._listView.get_scrollY();
		return new openfl_geom_Rectangle(localX,localY,charWidth,this.get_lineHeight());
	}
	,textEditorPositionToLocal: function(pos) {
		var lineIndex = pos.line;
		if(lineIndex < 0 || lineIndex >= this._lines.get_length()) {
			return null;
		}
		var charX = 0.0;
		var line = this._lines.get(lineIndex);
		var textLineRenderer = js_Boot.__cast(this._listView.itemToItemRenderer(line) , moonshine_editor_text_lines_TextLineRenderer);
		if(textLineRenderer != null) {
			var bounds = textLineRenderer.getCharBoundaries(pos.character);
			if(bounds == null) {
				return null;
			}
			charX = bounds.x;
		} else {
			var state = new feathers_data_ListViewItemState(line,lineIndex,false,line.text);
			textLineRenderer = this.createTextLineRenderer();
			this.updateTextLineRenderer(textLineRenderer,state);
			openfl_Lib.get_current().stage.addChild(textLineRenderer);
			textLineRenderer.validateNow();
			var bounds = textLineRenderer.getCharBoundaries(pos.character);
			if(bounds != null) {
				charX = bounds.x;
			}
			this.resetTextLineRenderer(textLineRenderer,state);
			openfl_Lib.get_current().stage.removeChild(textLineRenderer);
			this.destroyTextLineRenderer(textLineRenderer);
			if(bounds == null) {
				return null;
			}
		}
		var localX = this._viewPortVisibleBounds.x + charX - this._listView.get_scrollX();
		var localY = this._viewPortVisibleBounds.y + this.get_lineHeight() * pos.line - this._listView.get_scrollY();
		return new openfl_geom_Point(localX,localY);
	}
	,localToTextEditorPosition: function(localXY,forSelection) {
		if(forSelection == null) {
			forSelection = false;
		}
		var lineIndex = this.localToTextLineIndex(localXY,forSelection);
		if(forSelection) {
			lineIndex = Math.max(0,Math.min(this._lines.get_length() - 1,lineIndex)) | 0;
		} else if(lineIndex < 0 || lineIndex >= this._lines.get_length()) {
			return null;
		}
		var charIndex = -1;
		var line = this._lines.get(lineIndex);
		var textLineRenderer = js_Boot.__cast(this._listView.itemToItemRenderer(line) , moonshine_editor_text_lines_TextLineRenderer);
		if(textLineRenderer != null) {
			var rendererXY = textLineRenderer.globalToLocal(this.localToGlobal(localXY));
			if(forSelection) {
				if(lineIndex == 0 && rendererXY.y < 0) {
					charIndex = 0;
				} else if(lineIndex == this._lines.get_length() - 1 && rendererXY.y > textLineRenderer.get_height()) {
					charIndex = line.text.length;
				} else {
					charIndex = textLineRenderer.getSelectionCharIndexAtPoint(rendererXY.x,rendererXY.y);
				}
			} else {
				charIndex = textLineRenderer.getCharIndexAtPoint(rendererXY.x,rendererXY.y);
			}
		} else {
			var state = new feathers_data_ListViewItemState(line,lineIndex,false,line.text);
			textLineRenderer = this.createTextLineRenderer();
			this.updateTextLineRenderer(textLineRenderer,state);
			textLineRenderer.validateNow();
			var rendererX = localXY.x - this._viewPortVisibleBounds.x;
			var rendererY = localXY.y - this._viewPortVisibleBounds.y - lineIndex * this._lineHeight;
			if(forSelection) {
				charIndex = textLineRenderer.getSelectionCharIndexAtPoint(rendererX,rendererY);
			} else {
				charIndex = textLineRenderer.getCharIndexAtPoint(rendererX,rendererY);
			}
			this.resetTextLineRenderer(textLineRenderer,state);
			this.destroyTextLineRenderer(textLineRenderer);
		}
		if(charIndex == -1) {
			return new moonshine_editor_text_TextEditorPosition(lineIndex,line.text.length);
		}
		return new moonshine_editor_text_TextEditorPosition(lineIndex,charIndex);
	}
	,scrollToCaret: function() {
		if(this._lines.get_length() == 0 || this._caretLineIndex == -1 || this._expandedCaretCharIndex == -1) {
			return;
		}
		if(this.isInvalid()) {
			this.validateNow();
		} else {
			this._listView.validateNow();
		}
		if(this._caretLineIndex < this.get_lineScrollY() || this.get_visibleLines() <= 2 && this._caretLineIndex > this.get_lineScrollY()) {
			this.set_lineScrollY(Math.min(this._caretLineIndex,this._maxLineScrollY) | 0);
		} else if(this.get_visibleLines() > 2 && this._caretLineIndex + 2 > this.get_lineScrollY() + this.get_visibleLines()) {
			var newLineScrollY = this._caretLineIndex - this.get_visibleLines() + 2;
			if(newLineScrollY < 0) {
				newLineScrollY = 0;
			}
			this.set_lineScrollY(Math.min(newLineScrollY,this._maxLineScrollY) | 0);
		}
		if(this.isInvalid()) {
			this.validateNow();
		} else {
			this._listView.validateNow();
		}
		var textLineRenderer = this.textEditorPositionToTextLineRenderer(new moonshine_editor_text_TextEditorPosition(this._caretLineIndex,this.get_caretCharIndex()));
		if(textLineRenderer != null) {
			var adjustedIndex = this.get_caretCharIndex();
			if(this._selectionStartCharIndex != -1 && adjustedIndex > this._selectionStartCharIndex) {
				adjustedIndex = this._selectionStartCharIndex;
			}
			if(this._selectionEndCharIndex != -1 && adjustedIndex > this._selectionEndCharIndex) {
				adjustedIndex = this._selectionEndCharIndex;
			}
			var end = false;
			var line = this.get_lines().get(this._caretLineIndex);
			if(adjustedIndex > 0) {
				if(adjustedIndex == line.text.length) {
					--adjustedIndex;
					end = true;
				}
			}
			var bounds = textLineRenderer.getCharBoundaries(adjustedIndex);
			if(bounds != null) {
				var charWidth = bounds.width;
				if(line.text.charAt(adjustedIndex) == "\t") {
					charWidth /= this._tabWidth;
				}
				var horizontalLookaround = charWidth * 8.0;
				var caretX = bounds.x;
				if(end) {
					caretX += bounds.width;
				}
				var newScrollX = this._scrollX;
				if(newScrollX < caretX + horizontalLookaround - this._viewPortVisibleBounds.width) {
					newScrollX = caretX + horizontalLookaround - this._viewPortVisibleBounds.width;
				}
				if(newScrollX > caretX - horizontalLookaround - textLineRenderer.get_gutterWidth()) {
					newScrollX = caretX - horizontalLookaround - textLineRenderer.get_gutterWidth();
				}
				if(newScrollX < this._listView.get_minScrollX()) {
					newScrollX = this._listView.get_minScrollX();
				} else if(newScrollX > this._listView.get_maxScrollX()) {
					newScrollX = this._listView.get_maxScrollX();
				}
				this._listView.set_scrollX(newScrollX);
			}
		}
	}
	,initialize: function() {
		if(this._layout == null) {
			this._layout = new feathers_layout_VerticalListLayout();
			this._layout.set_contentJustify(!this._wordWrap);
		}
		if(this._listView == null) {
			this._listView = new moonshine_editor_text__$TextEditor_TextEditorListView();
			this._listView.set_layout(this._layout);
			this._listView.set_scrollX(this._scrollX);
			this._listView.set_scrollY(this._lineScrollY * this._lineHeight);
			this._listView.addEventListener("scroll",$bind(this,this.textEditor_listView_scrollHandler));
			this._listView.addEventListener("focusIn",$bind(this,this.textEditor_listView_focusInHandler));
			this._listView.addEventListener("focusOut",$bind(this,this.textEditor_listView_focusOutHandler));
			this.addChild(this._listView);
			this._listView.set_itemRendererRecycler(feathers_utils_DisplayObjectRecycler.withFunction($bind(this,this.createTextLineRenderer),$bind(this,this.updateTextLineRenderer),$bind(this,this.resetTextLineRenderer),$bind(this,this.destroyTextLineRenderer)));
		}
		if(this._measurementTextLineRenderer == null) {
			this._measurementTextLineRenderer = this.createTextLineRenderer();
		}
	}
	,expandCaretCharIndex: function(value) {
		var caretLine = this._lines.get(this._caretLineIndex);
		var indent = caretLine != null ? moonshine_editor_text_utils_TextUtil.indentAmount(caretLine.text) : 0;
		return value + Math.min(indent,value) * (this._tabWidth - 1) | 0;
	}
	,textEditorPositionToTextLineRenderer: function(pos) {
		if(pos.line < 0 || pos.line >= this._lines.get_length()) {
			return null;
		}
		return this.getTextLineRendererAtIndex(pos.line);
	}
	,localToTextLineIndex: function(localXY,forSelection) {
		if(forSelection == null) {
			forSelection = false;
		}
		var lineIndex = -1;
		if(this._wordWrap) {
			var listViewPortY = localXY.y + this._listView.get_scrollY();
			var _g = 0;
			var _g1 = this._lines.get_length();
			while(_g < _g1) {
				var i = _g++;
				var textLineRenderer = this._listView.indexToItemRenderer(i);
				if(textLineRenderer == null) {
					continue;
				}
				var minPosY = textLineRenderer.get_y();
				if(listViewPortY < minPosY) {
					break;
				}
				var maxPosY = minPosY + textLineRenderer.get_height();
				if(listViewPortY > maxPosY) {
					if(forSelection && i == this._lines.get_length() - 1) {
						lineIndex = i;
					}
					continue;
				}
				lineIndex = i;
				break;
			}
			if(forSelection && lineIndex == -1) {
				lineIndex = 0;
			}
		} else {
			lineIndex = (localXY.y + this._listView.get_scrollY()) / this.get_lineHeight() | 0;
		}
		return lineIndex;
	}
	,localToTextLineRenderer: function(localXY,forSelection) {
		if(forSelection == null) {
			forSelection = false;
		}
		var lineIndex = this.localToTextLineIndex(localXY,forSelection);
		return this.getTextLineRendererAtIndex(lineIndex);
	}
	,getTextLineRendererAtIndex: function(lineIndex) {
		if(this.isInvalid()) {
			this.validateNow();
		}
		return js_Boot.__cast(this._listView.indexToItemRenderer(lineIndex) , moonshine_editor_text_lines_TextLineRenderer);
	}
	,createTextLineRenderer: function() {
		if(this._textLineRendererFactory != null) {
			return js_Boot.__cast(this._textLineRendererFactory.create() , moonshine_editor_text_lines_TextLineRenderer);
		}
		return new moonshine_editor_text_lines_TextLineRenderer();
	}
	,updateTextLineRendererFromModel: function(itemRenderer,lineModel) {
		itemRenderer.set_textEditorOwner(this);
		itemRenderer.set_lineIndex(lineModel.lineIndex);
		itemRenderer.set_text(lineModel.text);
		if(!this._readOnly && lineModel.lineIndex == this._caretLineIndex) {
			itemRenderer.set_caretIndex(Math.min(this.get_caretCharIndex(),lineModel.text.length) | 0);
		} else {
			itemRenderer.set_caretIndex(-1);
		}
		itemRenderer.set_textEditorHasFocus(this._hasFocus);
		itemRenderer.set_minLineNumberCharacters(this.get_minLineNumberCharacters());
		itemRenderer.set_numLines(this._lines.get_length());
		itemRenderer.set_tabWidth(this._tabWidth);
		itemRenderer.set_breakpoint(this._breakpoints != null && this._breakpoints.indexOf(lineModel.lineIndex) != -1);
		itemRenderer.set_allowToggleBreakpoints(this._allowToggleBreakpoints);
		itemRenderer.set_debuggerStopped(this._debuggerLineIndex == lineModel.lineIndex);
		itemRenderer.set_styleRanges(lineModel.styleRanges);
		itemRenderer.set_textStyles(this._textStyles);
		itemRenderer.set_defaultTextStyleContext(this._parser != null ? this._parser.get_defaultContext() : 0);
		itemRenderer.set_showLineNumbers(this._showLineNumbers);
		itemRenderer.set_lineNumberWidth(this.get_lineNumberWidth());
		itemRenderer.set_embedFonts(this.get_embedFonts());
		itemRenderer.set_wordWrap(this._wordWrap);
		itemRenderer.set_searchResult(this._searchResult);
		itemRenderer.set_highlightAllFindResults(this.get_highlightAllFindResults());
		if(this._selectionStartLineIndex != this._selectionEndLineIndex) {
			if(lineModel.lineIndex == this._selectionStartLineIndex) {
				if(this._selectionStartLineIndex > this._caretLineIndex) {
					itemRenderer.set_selectionStartIndex(0);
					itemRenderer.set_selectionEndIndex(this._selectionStartCharIndex);
				} else {
					itemRenderer.set_selectionStartIndex(this._selectionStartCharIndex);
					itemRenderer.set_selectionEndIndex(lineModel.text.length);
				}
			} else if(lineModel.lineIndex == this._caretLineIndex) {
				if(this._caretLineIndex > this._selectionStartLineIndex) {
					itemRenderer.set_selectionStartIndex(0);
					itemRenderer.set_selectionEndIndex(this.get_caretCharIndex());
				} else {
					itemRenderer.set_selectionStartIndex(this.get_caretCharIndex());
					itemRenderer.set_selectionEndIndex(lineModel.text.length);
				}
			} else if(this._selectionStartLineIndex < lineModel.lineIndex && this._caretLineIndex > lineModel.lineIndex) {
				itemRenderer.set_selectionStartIndex(0);
				itemRenderer.set_selectionEndIndex(lineModel.text.length);
			} else if(this._selectionStartLineIndex > lineModel.lineIndex && this._caretLineIndex < lineModel.lineIndex) {
				itemRenderer.set_selectionStartIndex(0);
				itemRenderer.set_selectionEndIndex(lineModel.text.length);
			} else {
				itemRenderer.set_selectionStartIndex(-1);
				itemRenderer.set_selectionEndIndex(-1);
			}
		} else if(lineModel.lineIndex == this._caretLineIndex) {
			itemRenderer.set_selectionStartIndex(this._selectionStartCharIndex);
			itemRenderer.set_selectionEndIndex(this._selectionEndCharIndex);
		} else {
			itemRenderer.set_selectionStartIndex(-1);
			itemRenderer.set_selectionEndIndex(-1);
		}
	}
	,updateTextLineRenderer: function(itemRenderer,state) {
		var lineModel = js_Boot.__cast(state.data , moonshine_editor_text_lines_TextLineModel);
		this.updateTextLineRendererFromModel(itemRenderer,lineModel);
		itemRenderer.addEventListener(moonshine_editor_text_events_TextEditorLineEvent.TOGGLE_BREAKPOINT,$bind(this,this.textEditor_textLineRenderer_toggleBreakpointHandler));
		itemRenderer.addEventListener(moonshine_editor_text_events_TextEditorLineEvent.SELECT_LINE,$bind(this,this.textEditor_textLineRenderer_selectLineHandler));
	}
	,resetTextLineRenderer: function(itemRenderer,state) {
		itemRenderer.set_textEditorOwner(null);
		itemRenderer.set_caretIndex(-1);
		itemRenderer.set_lineIndex(-1);
		itemRenderer.set_styleRanges(null);
		itemRenderer.set_textStyles(null);
		itemRenderer.set_text(null);
		itemRenderer.set_selectionStartIndex(-1);
		itemRenderer.set_selectionEndIndex(-1);
		itemRenderer.removeEventListener(moonshine_editor_text_events_TextEditorLineEvent.TOGGLE_BREAKPOINT,$bind(this,this.textEditor_textLineRenderer_toggleBreakpointHandler));
		itemRenderer.removeEventListener(moonshine_editor_text_events_TextEditorLineEvent.SELECT_LINE,$bind(this,this.textEditor_textLineRenderer_selectLineHandler));
	}
	,destroyTextLineRenderer: function(itemRenderer) {
		if(this._textLineRendererFactory != null && this._textLineRendererFactory.destroy != null) {
			this._textLineRendererFactory.destroy(itemRenderer);
		}
	}
	,invalidateVisibleLines: function() {
		if(this._listView == null || this._listView.get_dataProvider() == null) {
			return;
		}
		this._listView.setInvalid(feathers_core_InvalidationFlag.DATA);
		this._listView.setInvalid(feathers_core_InvalidationFlag.LAYOUT);
	}
	,forceUpdateRangeDiff: function(startLine1,startChar1,endLine1,endChar1,startLine2,startChar2,endLine2,endChar2,needsLayoutUpdate) {
		if(needsLayoutUpdate == null) {
			needsLayoutUpdate = false;
		}
		var maxMaxLine = this._lines.get_length() - 1;
		var minLine1 = startLine1;
		var minChar1 = startChar1;
		var maxLine1 = endLine1;
		var maxChar1 = endChar1;
		if(startLine1 > endLine1) {
			minLine1 = endLine1;
			minChar1 = endChar1;
			maxLine1 = startLine1;
			maxChar1 = startChar1;
		}
		var minLine2 = startLine2;
		var minChar2 = startChar2;
		var maxLine2 = endLine2;
		var maxChar2 = endChar2;
		if(startLine2 > endLine2) {
			minLine2 = endLine2;
			minChar2 = endChar2;
			maxLine2 = startLine2;
			maxChar2 = startChar2;
		}
		var minLine = minLine1;
		var minChar = minChar1;
		if(minLine1 > minLine2) {
			minLine = minLine2;
			minChar = minChar2;
		}
		var maxLine = maxLine1;
		var maxChar = maxChar1;
		if(maxLine1 < maxLine2) {
			maxLine = maxLine2;
			maxChar = maxChar2;
		}
		var _g = minLine;
		var _g1 = maxLine + 1;
		while(_g < _g1) {
			var i = _g++;
			if(i > maxMaxLine) {
				break;
			}
			if(i < minLine1 || i < minLine2 || i > maxLine1 || i > maxLine2) {
				if(needsLayoutUpdate) {
					this._lines.updateAt(i);
				} else {
					this.updateLineAtIndex(i);
				}
				continue;
			}
			if(i == minLine) {
				if(i == minLine1 && minChar != minChar1 || i == minLine2 && minChar != minChar2) {
					if(needsLayoutUpdate) {
						this._lines.updateAt(i);
					} else {
						this.updateLineAtIndex(i);
					}
					continue;
				}
			} else if(i == minLine1 || i == minLine2) {
				if(needsLayoutUpdate) {
					this._lines.updateAt(i);
				} else {
					this.updateLineAtIndex(i);
				}
				continue;
			}
			if(i == maxLine) {
				if(i == maxLine1 && maxChar != maxChar1 || i == maxLine2 && maxChar != maxChar2) {
					if(needsLayoutUpdate) {
						this._lines.updateAt(i);
					} else {
						this.updateLineAtIndex(i);
					}
					continue;
				}
			} else if(i == maxLine1 || i == maxLine2) {
				if(needsLayoutUpdate) {
					this._lines.updateAt(i);
				} else {
					this.updateLineAtIndex(i);
				}
				continue;
			}
		}
	}
	,updateLineAtIndex: function(index) {
		if(index < 0 || index >= this._lines.get_length()) {
			return;
		}
		var line = this._lines.get(index);
		if(line == null) {
			return;
		}
		var value = this._listView.indexToItemRenderer(index);
		var itemRenderer = ((value) instanceof moonshine_editor_text_lines_TextLineRenderer) ? value : null;
		if(itemRenderer == null) {
			return;
		}
		this.updateTextLineRendererFromModel(itemRenderer,line);
	}
	,forceUpdateSelectedLines: function(needsLayoutUpdate) {
		if(needsLayoutUpdate == null) {
			needsLayoutUpdate = false;
		}
		var maxLine = this._lines.get_length() - 1;
		if(this._selectionStartLineIndex != -1 && this._selectionEndLineIndex != -1) {
			var min = this._selectionStartLineIndex;
			var max = this._selectionEndLineIndex;
			if(this._selectionEndLineIndex < this._selectionStartLineIndex) {
				min = this._selectionEndLineIndex;
				max = this._selectionStartLineIndex;
			}
			if(max > maxLine) {
				max = maxLine;
			}
			++max;
			var _g = min;
			var _g1 = max;
			while(_g < _g1) {
				var i = _g++;
				if(needsLayoutUpdate) {
					this._lines.updateAt(i);
				} else {
					this.updateLineAtIndex(i);
				}
			}
		} else if(this._caretLineIndex != -1 && this._caretLineIndex <= maxLine) {
			if(needsLayoutUpdate) {
				this._lines.updateAt(this._caretLineIndex);
			} else {
				this.updateLineAtIndex(this._caretLineIndex);
			}
		}
	}
	,update: function() {
		var dataInvalid = this.isInvalid(feathers_core_InvalidationFlag.DATA);
		var scrollInvalid = this.isInvalid(feathers_core_InvalidationFlag.SCROLL);
		var stylesInvalid = this.isInvalid(feathers_core_InvalidationFlag.STYLES);
		if(this._parser == null) {
			this._parser = new moonshine_editor_text_syntax_parser_PlainTextLineParser();
		}
		if(this._textStyles == null) {
			this._textStyles = new moonshine_editor_text_syntax_format_PlainTextFormatBuilder().build();
			this._lines.updateAll();
		}
		if(dataInvalid) {
			this._listView.set_dataProvider(this._lines);
			this._layout.set_contentJustify(!this._wordWrap);
		}
		if(stylesInvalid) {
			this._listView.set_backgroundSkin(this.get_backgroundSkin());
			this._listView.set_disabledBackgroundSkin(this.get_disabledBackgroundSkin());
			this._listView.set_customItemRendererVariant(this.get_customTextLineRendererVariant());
		}
		if(stylesInvalid) {
			this._lines.updateAll();
			this.updateTextLineRendererFromModel(this._measurementTextLineRenderer,this._measurementTextLineModel);
		}
		this.layoutContent();
		if(dataInvalid || scrollInvalid) {
			this.commitScroll();
		}
		this.saveLayoutProperties();
	}
	,layoutContent: function() {
		this._listView.set_x(0.0);
		this._listView.set_y(0.0);
		this._listView.set_width(this.actualWidth);
		this._listView.set_height(this.actualHeight);
	}
	,commitScroll: function() {
		this._listView.set_scrollX(this._scrollX);
		this._listView.set_scrollY(this._scrollY);
	}
	,saveLayoutProperties: function() {
		this._listView.validateNow();
		this._listView.getViewPortVisibleBounds(this._viewPortVisibleBounds);
		this._viewPortVisibleBounds.x += this._listView.get_x();
		this._viewPortVisibleBounds.y += this._listView.get_y();
		this._measurementTextLineRenderer.validateNow();
		if(this._lines.get_length() == 0 || this._measurementTextLineRenderer == null || this._measurementTextLineRenderer.get_height() == 0.0) {
			this._lineHeight = 0.0;
			this._visibleLines = 1;
			this._maxLineScrollY = 0;
			this._gutterWidth = 0.0;
		} else {
			this._lineHeight = this._measurementTextLineRenderer.get_height();
			this._visibleLines = this._viewPortVisibleBounds.height / this._lineHeight | 0;
			this._maxLineScrollY = (Math.max(this._visibleLines,this._lines.get_length()) | 0) - this._visibleLines;
			this._gutterWidth = this._measurementTextLineRenderer.get_gutterWidth();
		}
	}
	,createContextMenu: function() {
	}
	,textEditor_focusInHandler: function(event) {
		if(this.stage != null && this.stage.get_focus() != this._listView && this._listView != null && !this._listView.contains(this.stage.get_focus())) {
			event.stopImmediatePropagation();
			this.stage.set_focus(this._listView);
		}
	}
	,textEditor_textChangeHandler: function(event) {
		if(this._readOnly) {
			throw new openfl_errors_IllegalOperationError("Read-only text editor must not dispatch text change event");
		}
	}
	,calculateLineScrollY: function(scrollY) {
		if(this._lineHeight == 0.0) {
			return 0;
		}
		var floatLineScrollY = this._scrollY / this._lineHeight;
		var roundedLineScrollY = Math.round(floatLineScrollY);
		if(feathers_utils_MathUtil.fuzzyEquals(floatLineScrollY,roundedLineScrollY)) {
			return roundedLineScrollY;
		}
		return floatLineScrollY | 0;
	}
	,textEditor_listView_scrollHandler: function(event) {
		this._scrollX = this._listView.get_scrollX();
		this._scrollY = this._listView.get_scrollY();
		var scrollY = this._scrollY;
		var tmp;
		if(this._lineHeight == 0.0) {
			tmp = 0;
		} else {
			var floatLineScrollY = this._scrollY / this._lineHeight;
			var roundedLineScrollY = Math.round(floatLineScrollY);
			tmp = feathers_utils_MathUtil.fuzzyEquals(floatLineScrollY,roundedLineScrollY) ? roundedLineScrollY : floatLineScrollY | 0;
		}
		this._lineScrollY = tmp;
		feathers_events_ScrollEvent.dispatch(this,"scroll");
	}
	,textEditor_listView_focusInHandler: function(event) {
		this._hasFocus = true;
		if(this.stage != null && this.stage.window != null) {
			this.stage.window.__backend.setTextInputEnabled(true);
		}
		this.forceUpdateSelectedLines();
	}
	,textEditor_listView_focusOutHandler: function(event) {
		this._hasFocus = false;
		if(this.stage != null && this.stage.window != null) {
			this.stage.window.__backend.setTextInputEnabled(false);
		}
		this.forceUpdateSelectedLines();
	}
	,textEditor_textLineRenderer_toggleBreakpointHandler: function(event) {
		if(!this._allowToggleBreakpoints) {
			return;
		}
		var lineIndex = event.lineIndex;
		this.toggleBreakpoint(lineIndex);
	}
	,textEditor_textLineRenderer_selectLineHandler: function(event) {
		var lineIndex = event.lineIndex;
		var line = this._lines.get(lineIndex);
		this.setSelection(lineIndex,0,lineIndex,line.text.length);
	}
	,textEditor_lines_changeHandler: function(event) {
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
	}
	,textEditor_lines_addItemHandler: function(event) {
		var newBreakpoints = [];
		var addedBreakpoints = [];
		var _g = 0;
		var _g1 = this._breakpoints;
		while(_g < _g1.length) {
			var breakpoint = _g1[_g];
			++_g;
			if(breakpoint < event.index) {
				newBreakpoints.push(breakpoint);
				continue;
			}
			this.dispatchEvent(new moonshine_editor_text_events_TextEditorLineEvent(moonshine_editor_text_events_TextEditorLineEvent.TOGGLE_BREAKPOINT,breakpoint));
			var updatedBreakpoint = breakpoint + 1;
			newBreakpoints.push(updatedBreakpoint);
			addedBreakpoints.push(updatedBreakpoint);
		}
		this._breakpoints = newBreakpoints;
		var _g = 0;
		while(_g < addedBreakpoints.length) {
			var breakpoint = addedBreakpoints[_g];
			++_g;
			this.dispatchEvent(new moonshine_editor_text_events_TextEditorLineEvent(moonshine_editor_text_events_TextEditorLineEvent.TOGGLE_BREAKPOINT,breakpoint));
		}
	}
	,textEditor_lines_removeItemHandler: function(event) {
		var newBreakpoints = [];
		var addedBreakpoints = [];
		var _g = 0;
		var _g1 = this._breakpoints;
		while(_g < _g1.length) {
			var breakpoint = _g1[_g];
			++_g;
			if(breakpoint < event.index) {
				newBreakpoints.push(breakpoint);
				continue;
			}
			this.dispatchEvent(new moonshine_editor_text_events_TextEditorLineEvent(moonshine_editor_text_events_TextEditorLineEvent.TOGGLE_BREAKPOINT,breakpoint));
			if(breakpoint == event.index) {
				continue;
			}
			var updatedBreakpoint = breakpoint - 1;
			if(updatedBreakpoint < 0) {
				continue;
			}
			newBreakpoints.push(updatedBreakpoint);
			addedBreakpoints.push(updatedBreakpoint);
		}
		this._breakpoints = newBreakpoints;
		var _g = 0;
		while(_g < addedBreakpoints.length) {
			var breakpoint = addedBreakpoints[_g];
			++_g;
			this.dispatchEvent(new moonshine_editor_text_events_TextEditorLineEvent(moonshine_editor_text_events_TextEditorLineEvent.TOGGLE_BREAKPOINT,breakpoint));
		}
	}
	,textEditor_lines_updateItemHandler: function(event) {
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
	}
	,textEditor_lines_updateAllHandler: function(event) {
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
	}
	,__lineNumberWidth: null
	,get_lineNumberWidth: function() {
		return this.__lineNumberWidth;
	}
	,set_lineNumberWidth: function(value) {
		if(!this.setStyle("lineNumberWidth")) {
			return this.__lineNumberWidth;
		}
		if(this.__lineNumberWidth == value) {
			return this.__lineNumberWidth;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_lineNumberWidth);
		this.__lineNumberWidth = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__lineNumberWidth;
	}
	,clearStyle_lineNumberWidth: function() {
		this.set_lineNumberWidth(null);
		return this.get_lineNumberWidth();
	}
	,__minLineNumberCharacters: null
	,get_minLineNumberCharacters: function() {
		return this.__minLineNumberCharacters;
	}
	,set_minLineNumberCharacters: function(value) {
		if(!this.setStyle("minLineNumberCharacters")) {
			return this.__minLineNumberCharacters;
		}
		if(this.__minLineNumberCharacters == value) {
			return this.__minLineNumberCharacters;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_minLineNumberCharacters);
		this.__minLineNumberCharacters = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__minLineNumberCharacters;
	}
	,clearStyle_minLineNumberCharacters: function() {
		this.set_minLineNumberCharacters(3);
		return this.get_minLineNumberCharacters();
	}
	,__embedFonts: null
	,get_embedFonts: function() {
		return this.__embedFonts;
	}
	,set_embedFonts: function(value) {
		if(!this.setStyle("embedFonts")) {
			return this.__embedFonts;
		}
		if(this.__embedFonts == value) {
			return this.__embedFonts;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_embedFonts);
		this.__embedFonts = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__embedFonts;
	}
	,clearStyle_embedFonts: function() {
		this.set_embedFonts(false);
		return this.get_embedFonts();
	}
	,__backgroundSkin: null
	,get_backgroundSkin: function() {
		return this.__backgroundSkin;
	}
	,set_backgroundSkin: function(value) {
		if(!this.setStyle("backgroundSkin")) {
			return this.__backgroundSkin;
		}
		if(this.__backgroundSkin == value) {
			return this.__backgroundSkin;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_backgroundSkin);
		this.__backgroundSkin = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__backgroundSkin;
	}
	,clearStyle_backgroundSkin: function() {
		this.set_backgroundSkin(null);
		return this.get_backgroundSkin();
	}
	,__disabledBackgroundSkin: null
	,get_disabledBackgroundSkin: function() {
		return this.__disabledBackgroundSkin;
	}
	,set_disabledBackgroundSkin: function(value) {
		if(!this.setStyle("disabledBackgroundSkin")) {
			return this.__disabledBackgroundSkin;
		}
		if(this.__disabledBackgroundSkin == value) {
			return this.__disabledBackgroundSkin;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_disabledBackgroundSkin);
		this.__disabledBackgroundSkin = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__disabledBackgroundSkin;
	}
	,clearStyle_disabledBackgroundSkin: function() {
		this.set_disabledBackgroundSkin(null);
		return this.get_disabledBackgroundSkin();
	}
	,__customTextLineRendererVariant: null
	,get_customTextLineRendererVariant: function() {
		return this.__customTextLineRendererVariant;
	}
	,set_customTextLineRendererVariant: function(value) {
		if(!this.setStyle("customTextLineRendererVariant")) {
			return this.__customTextLineRendererVariant;
		}
		if(this.__customTextLineRendererVariant == value) {
			return this.__customTextLineRendererVariant;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_customTextLineRendererVariant);
		this.__customTextLineRendererVariant = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__customTextLineRendererVariant;
	}
	,clearStyle_customTextLineRendererVariant: function() {
		this.set_customTextLineRendererVariant(null);
		return this.get_customTextLineRendererVariant();
	}
	,__highlightAllFindResults: null
	,get_highlightAllFindResults: function() {
		return this.__highlightAllFindResults;
	}
	,set_highlightAllFindResults: function(value) {
		if(!this.setStyle("highlightAllFindResults")) {
			return this.__highlightAllFindResults;
		}
		if(this.__highlightAllFindResults == value) {
			return this.__highlightAllFindResults;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_highlightAllFindResults);
		this.__highlightAllFindResults = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__highlightAllFindResults;
	}
	,clearStyle_highlightAllFindResults: function() {
		this.set_highlightAllFindResults(false);
		return this.get_highlightAllFindResults();
	}
	,get_styleContext: function() {
		return moonshine_editor_text_TextEditor;
	}
	,__class__: moonshine_editor_text_TextEditor
	,__properties__: $extend(feathers_core_FeathersControl.prototype.__properties__,{set_textStyles:"set_textStyles",get_textStyles:"get_textStyles",set_parser:"set_parser",get_parser:"get_parser",set_textLineRendererFactory:"set_textLineRendererFactory",get_textLineRendererFactory:"get_textLineRendererFactory",set_highlightAllFindResults:"set_highlightAllFindResults",get_highlightAllFindResults:"get_highlightAllFindResults",set_customTextLineRendererVariant:"set_customTextLineRendererVariant",get_customTextLineRendererVariant:"get_customTextLineRendererVariant",set_disabledBackgroundSkin:"set_disabledBackgroundSkin",get_disabledBackgroundSkin:"get_disabledBackgroundSkin",set_backgroundSkin:"set_backgroundSkin",get_backgroundSkin:"get_backgroundSkin",set_macHomeAndEndEnabled:"set_macHomeAndEndEnabled",get_macHomeAndEndEnabled:"get_macHomeAndEndEnabled",set_wordWrap:"set_wordWrap",get_wordWrap:"get_wordWrap",set_textLineModelFactory:"set_textLineModelFactory",get_textLineModelFactory:"get_textLineModelFactory",set_debuggerLineIndex:"set_debuggerLineIndex",get_debuggerLineIndex:"get_debuggerLineIndex",set_breakpoints:"set_breakpoints",get_breakpoints:"get_breakpoints",set_allowToggleBreakpoints:"set_allowToggleBreakpoints",get_allowToggleBreakpoints:"get_allowToggleBreakpoints",set_tabWidth:"set_tabWidth",get_tabWidth:"get_tabWidth",get_expandedCaretCharIndex:"get_expandedCaretCharIndex",get_caretCharIndex:"get_caretCharIndex",get_caretLineIndex:"get_caretLineIndex",get_caretLine:"get_caretLine",get_selectionEndCharIndex:"get_selectionEndCharIndex",get_selectionEndLineIndex:"get_selectionEndLineIndex",get_selectionStartCharIndex:"get_selectionStartCharIndex",get_selectionStartLineIndex:"get_selectionStartLineIndex",get_selectedText:"get_selectedText",get_hasSelection:"get_hasSelection",get_edited:"get_edited",get_lineHeight:"get_lineHeight",set_embedFonts:"set_embedFonts",get_embedFonts:"get_embedFonts",set_showLineNumbers:"set_showLineNumbers",get_showLineNumbers:"get_showLineNumbers",set_minLineNumberCharacters:"set_minLineNumberCharacters",get_minLineNumberCharacters:"get_minLineNumberCharacters",set_lineNumberWidth:"set_lineNumberWidth",get_lineNumberWidth:"get_lineNumberWidth",get_gutterWidth:"get_gutterWidth",get_visibleLines:"get_visibleLines",get_maxLineScrollY:"get_maxLineScrollY",set_lineScrollY:"set_lineScrollY",get_lineScrollY:"get_lineScrollY",get_maxScrollY:"get_maxScrollY",get_minScrollY:"get_minScrollY",set_scrollY:"set_scrollY",get_scrollY:"get_scrollY",get_maxScrollX:"get_maxScrollX",get_minScrollX:"get_minScrollX",set_scrollX:"set_scrollX",get_scrollX:"get_scrollX",set_text:"set_text",get_text:"get_text",get_lines:"get_lines",set_lineDelimiter:"set_lineDelimiter",get_lineDelimiter:"get_lineDelimiter",get_stageFocusTarget:"get_stageFocusTarget",get_readOnly:"get_readOnly"})
});
var com_tilbuci_ui_component_CodeArea = function(format) {
	var _gthis = this;
	moonshine_editor_text_TextEditor.call(this);
	this.set_layoutData(new feathers_layout_VerticalLayoutData());
	this._fontSettings = new moonshine_editor_text_syntax_format_SyntaxFontSettings();
	this._colorSettings = moonshine_editor_text_syntax_format_SyntaxColorSettings.monokai();
	var formats = new haxe_ds_IntMap();
	var brackets = null;
	var autoClosingPairs = null;
	var lineComment = null;
	var blockComment = null;
	switch(format) {
	case "css":
		this._tparser = new moonshine_editor_text_syntax_parser_CSSLineParser();
		var cssfbuilder = new moonshine_editor_text_syntax_format_CSSSyntaxFormatBuilder();
		cssfbuilder.setFontSettings(this._fontSettings);
		cssfbuilder.setColorSettings(this._colorSettings);
		formats = cssfbuilder.build();
		brackets = [["{","}"],["[","]"],["(",")"]];
		autoClosingPairs = [new moonshine_editor_text_utils_AutoClosingPair("{","}"),new moonshine_editor_text_utils_AutoClosingPair("[","]"),new moonshine_editor_text_utils_AutoClosingPair("(",")"),new moonshine_editor_text_utils_AutoClosingPair("'","'"),new moonshine_editor_text_utils_AutoClosingPair("\"","\"")];
		blockComment = ["/*","*/"];
		this.brackets = brackets;
		this.autoClosingPairs = autoClosingPairs;
		this.lineComment = lineComment;
		this.blockComment = blockComment;
		this.setParserAndTextStyles(this._tparser,formats);
		break;
	case "js":
		this._tparser = new moonshine_editor_text_syntax_parser_JSLineParser();
		var jsfbuilder = new moonshine_editor_text_syntax_format_JSSyntaxFormatBuilder();
		jsfbuilder.setFontSettings(this._fontSettings);
		jsfbuilder.setColorSettings(this._colorSettings);
		formats = jsfbuilder.build();
		brackets = [["{","}"],["[","]"],["(",")"]];
		autoClosingPairs = [new moonshine_editor_text_utils_AutoClosingPair("{","}"),new moonshine_editor_text_utils_AutoClosingPair("[","]"),new moonshine_editor_text_utils_AutoClosingPair("(",")"),new moonshine_editor_text_utils_AutoClosingPair("'","'"),new moonshine_editor_text_utils_AutoClosingPair("\"","\""),new moonshine_editor_text_utils_AutoClosingPair("`","`")];
		this.brackets = brackets;
		this.autoClosingPairs = autoClosingPairs;
		this.lineComment = lineComment;
		this.blockComment = blockComment;
		this.setParserAndTextStyles(this._tparser,formats);
		break;
	}
	this.set_backgroundSkin(new feathers_skins_RectangleSkin(feathers_graphics_FillStyle.SolidColor(this._colorSettings.backgroundColor)));
	this.set_textLineRendererFactory(feathers_utils_AbstractDisplayObjectFactory.fromFunction(function() {
		var textLineRenderer = new moonshine_editor_text_lines_TextLineRenderer();
		textLineRenderer.set_backgroundSkin(new feathers_skins_RectangleSkin(feathers_graphics_FillStyle.SolidColor(_gthis._colorSettings.backgroundColor)));
		textLineRenderer.set_gutterBackgroundSkin(new feathers_skins_RectangleSkin(feathers_graphics_FillStyle.SolidColor(_gthis._colorSettings.backgroundColor)));
		textLineRenderer.set_focusedBackgroundSkin(new feathers_skins_RectangleSkin(feathers_graphics_FillStyle.SolidColor(_gthis._colorSettings.focusedLineBackgroundColor)));
		textLineRenderer.set_debuggerStoppedBackgroundSkin(new feathers_skins_RectangleSkin(feathers_graphics_FillStyle.SolidColor(_gthis._colorSettings.backgroundColor)));
		textLineRenderer.set_searchResultBackgroundSkinFactory(function() {
			return new feathers_skins_RectangleSkin(feathers_graphics_FillStyle.SolidColor(_gthis._colorSettings.searchResultBackgroundColor));
		});
		return textLineRenderer;
	}));
};
$hxClasses["com.tilbuci.ui.component.CodeArea"] = com_tilbuci_ui_component_CodeArea;
com_tilbuci_ui_component_CodeArea.__name__ = "com.tilbuci.ui.component.CodeArea";
com_tilbuci_ui_component_CodeArea.__super__ = moonshine_editor_text_TextEditor;
com_tilbuci_ui_component_CodeArea.prototype = $extend(moonshine_editor_text_TextEditor.prototype,{
	_tparser: null
	,_fontSettings: null
	,_colorSettings: null
	,__class__: com_tilbuci_ui_component_CodeArea
});
var com_tilbuci_ui_component_ColorPanel = function(wd) {
	this._current = null;
	com_tilbuci_ui_component_DropDownPanel.call(this,com_tilbuci_data_Global.ln.get("rightbar-color"),wd);
	this._timer = null;
	var tmp = this.ui;
	var tmp1 = { tp : "Label", id : "alpha", tx : com_tilbuci_data_Global.ln.get("rightbar-color-alpha"), vr : ""};
	var tmp2 = { tp : "Label", id : "blend", tx : com_tilbuci_data_Global.ln.get("rightbar-color-blend"), vr : ""};
	var tmp3 = { tp : "Select", id : "blend", vl : [{ text : com_tilbuci_data_Global.ln.get("rightbar-color-blnormal"), value : "normal"},{ text : com_tilbuci_data_Global.ln.get("rightbar-color-bladd"), value : "add"},{ text : com_tilbuci_data_Global.ln.get("rightbar-color-bldifference"), value : "difference"},{ text : com_tilbuci_data_Global.ln.get("rightbar-color-blinvert"), value : "invert"},{ text : com_tilbuci_data_Global.ln.get("rightbar-color-blmultiply"), value : "multiply"},{ text : com_tilbuci_data_Global.ln.get("rightbar-color-blscreen"), value : "screen"},{ text : com_tilbuci_data_Global.ln.get("rightbar-color-blsubtract"), value : "subtract"}], sl : null, ch : $bind(this,this.changeProperties)};
	var tmp4 = { tp : "Label", id : "alphacolor", tx : com_tilbuci_data_Global.ln.get("rightbar-color-alphacolor"), vr : ""};
	var tmp5 = { tp : "Label", id : "red", tx : com_tilbuci_data_Global.ln.get("rightbar-color-red"), vr : ""};
	var tmp6 = { tp : "Label", id : "green", tx : com_tilbuci_data_Global.ln.get("rightbar-color-green"), vr : ""};
	var tmp7 = com_tilbuci_data_Global.ln.get("rightbar-color-blue");
	this._content = tmp.forge("properties",[tmp1,{ tp : "Numeric", id : "alpha", mn : 0, mx : 100, st : 1, vl : 0, ch : $bind(this,this.changeProperties)},tmp2,tmp3,tmp4,{ tp : "Numeric", id : "alphacolor", mn : 0, mx : 100, st : 1, vl : 0, ch : $bind(this,this.changeProperties)},tmp5,{ tp : "Numeric", id : "red", mn : 0, mx : 255, st : 1, vl : 0, ch : $bind(this,this.changeProperties)},tmp6,{ tp : "Numeric", id : "green", mn : 0, mx : 255, st : 1, vl : 0, ch : $bind(this,this.changeProperties)},{ tp : "Label", id : "blue", tx : tmp7, vr : ""},{ tp : "Numeric", id : "blue", mn : 0, mx : 255, st : 1, vl : 0, ch : $bind(this,this.changeProperties)}],3355443,wd - 5);
	this.ui.containers.h["properties"].set_enabled(false);
	com_tilbuci_data_Global.history.propDisplay.push($bind(this,this.updateValues));
};
$hxClasses["com.tilbuci.ui.component.ColorPanel"] = com_tilbuci_ui_component_ColorPanel;
com_tilbuci_ui_component_ColorPanel.__name__ = "com.tilbuci.ui.component.ColorPanel";
com_tilbuci_ui_component_ColorPanel.__super__ = com_tilbuci_ui_component_DropDownPanel;
com_tilbuci_ui_component_ColorPanel.prototype = $extend(com_tilbuci_ui_component_DropDownPanel.prototype,{
	_timer: null
	,_current: null
	,updateContent: function(data) {
		if(Object.prototype.hasOwnProperty.call(data.h,"nm")) {
			this._current = com_tilbuci_data_GlobalPlayer.area.instanceRef(data.h["nm"]);
			this.updateValues();
		} else {
			this.clearValues();
		}
	}
	,reloadContent: function(data) {
		this.clearValues();
	}
	,updateValues: function() {
		if(this._current != null) {
			this.ui.containers.h["properties"].set_enabled(false);
			this.ui.setSelectValue("blend",this._current.getCurrentStr("blend"));
			this.ui.numerics.h["alpha"].set_value(Math.round(this._current.getCurrentNum("alpha") * 100));
			this.ui.numerics.h["alphacolor"].set_value(Math.round(this._current.getCurrentNum("coloralpha") * 100));
			var color = this._current.getCurrentStr("color");
			this.ui.numerics.h["red"].set_value(Std.parseInt("0x" + HxOverrides.substr(color,-6,2)));
			this.ui.numerics.h["green"].set_value(Std.parseInt("0x" + HxOverrides.substr(color,-4,2)));
			this.ui.numerics.h["blue"].set_value(Std.parseInt("0x" + HxOverrides.substr(color,-2,2)));
			this.ui.containers.h["properties"].set_enabled(true);
		}
	}
	,clearValues: function() {
		this.ui.setSelectValue("blend","normal");
		this.ui.containers.h["properties"].set_enabled(false);
		this.ui.numerics.h["alpha"].set_value(0);
		this.ui.numerics.h["alphacolor"].set_value(0);
		this.ui.numerics.h["red"].set_value(0);
		this.ui.numerics.h["green"].set_value(0);
		this.ui.numerics.h["blue"].set_value(0);
		this._current = null;
	}
	,changeProperties: function(evt) {
		if(this._current != null && this.ui.containers.h["properties"].get_enabled()) {
			if(com_tilbuci_data_Global.history.states.length == 0) {
				com_tilbuci_data_Global.history.addState(com_tilbuci_data_Global.ln.get("rightbar-history-original"));
			}
			com_tilbuci_data_GlobalPlayer.area.setCurrentNum("alpha",this.ui.numerics.h["alpha"].get_value() / 100);
			com_tilbuci_data_GlobalPlayer.area.setCurrentStr("blend",this.ui.selects.h["blend"].get_selectedItem().value);
			com_tilbuci_data_GlobalPlayer.area.setCurrentNum("coloralpha",this.ui.numerics.h["alphacolor"].get_value() / 100);
			com_tilbuci_data_GlobalPlayer.area.setCurrentStr("color",com_tilbuci_statictools_StringStatic.rgbToHex(this.ui.numerics.h["red"].get_value(),this.ui.numerics.h["green"].get_value(),this.ui.numerics.h["blue"].get_value()));
			if(this._timer == null) {
				this._timer = new haxe_Timer(2000);
				this._timer.run = $bind(this,this.saveHistory);
			}
			this._current.set_alpha(this.ui.numerics.h["alpha"].get_value() / 100);
			switch(this.ui.selects.h["blend"].get_selectedItem().value) {
			case "add":
				this._current.set_blendMode(0);
				break;
			case "difference":
				this._current.set_blendMode(3);
				break;
			case "invert":
				this._current.set_blendMode(6);
				break;
			case "multiply":
				this._current.set_blendMode(9);
				break;
			case "screen":
				this._current.set_blendMode(12);
				break;
			case "subtract":
				this._current.set_blendMode(14);
				break;
			default:
				this._current.set_blendMode(10);
			}
		}
	}
	,saveHistory: function() {
		try {
			this._timer.stop();
		} catch( _g ) {
		}
		this._timer = null;
		com_tilbuci_data_Global.history.addState(com_tilbuci_data_Global.ln.get("rightbar-history-color"));
	}
	,__class__: com_tilbuci_ui_component_ColorPanel
});
var com_tilbuci_ui_component_EditorPlayback = function(acCenter) {
	feathers_controls_Panel.call(this);
	this._acCenter = acCenter;
	var wdLay = new feathers_layout_VerticalLayout();
	wdLay.set_gap(0);
	wdLay.setPadding(0);
	wdLay.set_verticalAlign(feathers_layout_VerticalAlign.TOP);
	wdLay.set_horizontalAlign(feathers_layout_HorizontalAlign.CENTER);
	this.set_layout(wdLay);
	this._div = new feathers_controls_VDividedBox();
	this._div.set_layoutData(feathers_layout_AnchorLayoutData.fill());
	this._div.liveDragging = false;
	this.addChild(this._div);
	var tpskin = new feathers_skins_RectangleSkin();
	tpskin.set_fill(feathers_graphics_FillStyle.SolidColor(13421772));
	var topLay = new feathers_layout_AnchorLayout();
	this._top = new feathers_controls_LayoutGroup();
	this._top.set_layout(topLay);
	this._top.set_layoutData(feathers_layout_AnchorLayoutData.fill());
	this._top.set_backgroundSkin(tpskin);
	this._div.addChild(this._top);
	var btskin = new feathers_skins_RectangleSkin();
	btskin.set_fill(feathers_graphics_FillStyle.SolidColor(10066329));
	var bottomLay = new feathers_layout_HorizontalLayout();
	bottomLay.set_gap(10);
	bottomLay.setPadding(10);
	bottomLay.set_verticalAlign(feathers_layout_VerticalAlign.MIDDLE);
	bottomLay.set_horizontalAlign(feathers_layout_HorizontalAlign.CENTER);
	this._bottom = new feathers_controls_LayoutGroup();
	this._bottom.set_layout(bottomLay);
	this._bottom.set_layoutData(feathers_layout_AnchorLayoutData.fill());
	this._bottom.set_backgroundSkin(btskin);
	this._bottom.set_minHeight(this._bottom.set_maxHeight(this._bottom.set_height(50)));
	this._div.addChild(this._bottom);
	this.ui = new com_tilbuci_ui_base_InterfaceFactory();
	this.ui.createIconButton("play",$bind(this,this.onPlay),new openfl_display_Bitmap(openfl_utils_Assets.getBitmapData("btPlay")),null,this._bottom);
	this.ui.createSpacer("play",10,false,this._bottom);
	this.ui.createIconButton("screen",$bind(this,this.onScreen),new openfl_display_Bitmap(openfl_utils_Assets.getBitmapData("btScreen")),null,this._bottom);
	this.ui.createSpacer("screen",10,false,this._bottom);
	this.ui.createIconButton("close",$bind(this,this.onClose),new openfl_display_Bitmap(openfl_utils_Assets.getBitmapData("btClose")),null,this._bottom);
	this.info = { x : 0, y : 0, width : 0, height : 0, orientation : com_tilbuci_data_Global.displayType, keyframe : 0, scene : "", sceneobj : null, movie : ""};
};
$hxClasses["com.tilbuci.ui.component.EditorPlayback"] = com_tilbuci_ui_component_EditorPlayback;
com_tilbuci_ui_component_EditorPlayback.__name__ = "com.tilbuci.ui.component.EditorPlayback";
com_tilbuci_ui_component_EditorPlayback.__super__ = feathers_controls_Panel;
com_tilbuci_ui_component_EditorPlayback.prototype = $extend(feathers_controls_Panel.prototype,{
	_div: null
	,_top: null
	,_bottom: null
	,_player: null
	,_acCenter: null
	,_recenter: null
	,info: null
	,_st: null
	,_hd: null
	,ui: null
	,show: function(st,hd) {
		this._st = st;
		this._hd = hd;
		com_tilbuci_data_GlobalPlayer.mode = "editorplayerwait";
		com_tilbuci_data_GlobalPlayer.parser.clearVars();
		if(com_tilbuci_data_Global.testActions != "") {
			com_tilbuci_data_GlobalPlayer.parser.run(com_tilbuci_data_Global.testActions);
			if(com_tilbuci_data_Global.testDelay > 0) {
				haxe_Timer.delay($bind(this,this.startTest),com_tilbuci_data_Global.testDelay);
			} else {
				this.startTest();
			}
		} else {
			this.startTest();
		}
	}
	,startTest: function() {
		var st = this._st;
		var hd = this._hd;
		com_tilbuci_data_GlobalPlayer.area.maskArea(true);
		com_tilbuci_data_GlobalPlayer.area.pause();
		com_tilbuci_data_GlobalPlayer.movie.data.applySets();
		com_tilbuci_data_GlobalPlayer.area.loadKeyframe(com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[com_tilbuci_data_GlobalPlayer.area.get_currentKf()],com_tilbuci_data_GlobalPlayer.area.get_currentKf());
		this.set_width(st.stageWidth);
		this.set_height(st.stageHeight);
		this._top.set_minHeight(this._top.set_maxHeight(this._top.set_height(this.get_height() - this._bottom.get_height() - 10)));
		this._top.set_width(this.get_width());
		this._bottom.set_width(this.get_width());
		this._player = hd;
		this.info = { x : this._player.player.get_x(), y : this._player.player.get_y(), width : this._player.player.get_width(), height : this._player.player.get_height(), orientation : com_tilbuci_data_Global.displayType, keyframe : com_tilbuci_data_GlobalPlayer.area.get_currentKf(), scene : com_tilbuci_data_GlobalPlayer.movie.get_scId(), sceneobj : com_tilbuci_data_GlobalPlayer.movie.scene.toObject(), movie : com_tilbuci_data_GlobalPlayer.movie.get_mvId()};
		this._player.removeChild(this._player.player);
		this._top.addChild(this._player.player);
		this.centerPlayer();
		this.ui.buttons.h["screen"].set_enabled(com_tilbuci_data_GlobalPlayer.mdata.screen.type == "both");
		feathers_core_PopUpManager.addPopUp(this,st);
		var curkf = com_tilbuci_data_GlobalPlayer.area.get_currentKf();
		if(com_tilbuci_data_GlobalPlayer.movie.data.acstart != "") {
			com_tilbuci_data_GlobalPlayer.parser.run(com_tilbuci_data_GlobalPlayer.movie.data.acstart);
		}
		if(com_tilbuci_data_GlobalPlayer.movie.scene.acstart != "") {
			com_tilbuci_data_GlobalPlayer.parser.run(com_tilbuci_data_GlobalPlayer.movie.scene.acstart);
		}
		com_tilbuci_data_GlobalPlayer.area.play();
		if(com_tilbuci_data_GlobalPlayer.movie.scene.staticsc) {
			com_tilbuci_data_GlobalPlayer.area.loadKeyframe(com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[curkf],curkf);
		}
		com_tilbuci_data_GlobalPlayer.area.updateTexts();
		this.ui.buttons.h["play"].set_icon(new openfl_display_Bitmap(openfl_utils_Assets.getBitmapData("btPause")));
		this.ui.buttons.h["play"].get_icon().set_width(this.ui.buttons.h["play"].get_icon().set_height(20));
		this._player.player.listenInput();
	}
	,centerPlayer: function() {
		var ht = this._top.get_minHeight() - 20;
		var wd = ht * (com_tilbuci_data_GlobalPlayer.mdata.screen.big / com_tilbuci_data_GlobalPlayer.mdata.screen.small);
		if(com_tilbuci_data_Global.displayType == "portrait") {
			wd = ht * (com_tilbuci_data_GlobalPlayer.mdata.screen.small / com_tilbuci_data_GlobalPlayer.mdata.screen.big);
		}
		this._player.player.setSize(wd,ht);
		this._player.set_x(0);
		this._player.set_y(0);
		this._player.player.set_x((this._top.get_width() - this._player.player.get_width()) / 2 + (this._player.player.get_width() - this._player.player.get_rWidth()));
		this._player.player.set_y((this._top.get_minHeight() - this._player.player.get_rHeight()) / 2 + (this._player.player.get_tHeight() - this._player.player.get_rHeight()) / 2);
		this._player.player.set_x((com_tilbuci_data_Global.stage.stageWidth - this._player.player.get_rWidth()) / 2);
		this._player.player.set_y(10);
		if(this._recenter == null) {
			this._recenter = new haxe_Timer(150);
			this._recenter.run = $bind(this,this.centerPlayer);
		} else {
			try {
				this._recenter.stop();
			} catch( _g ) {
			}
			this._recenter = null;
		}
	}
	,onPlay: function(evt) {
		if(com_tilbuci_data_GlobalPlayer.area.get_playing()) {
			com_tilbuci_data_GlobalPlayer.mode = "editor";
			com_tilbuci_data_GlobalPlayer.area.pause();
			this.ui.buttons.h["play"].set_icon(new openfl_display_Bitmap(openfl_utils_Assets.getBitmapData("btPlay")));
		} else {
			com_tilbuci_data_GlobalPlayer.mode = "editorplayerwait";
			com_tilbuci_data_GlobalPlayer.area.play();
			this.ui.buttons.h["play"].set_icon(new openfl_display_Bitmap(openfl_utils_Assets.getBitmapData("btPause")));
		}
		this.ui.buttons.h["play"].get_icon().set_width(this.ui.buttons.h["play"].get_icon().set_height(20));
	}
	,onScreen: function(evt) {
		if(com_tilbuci_data_GlobalPlayer.mdata.screen.type == "both") {
			var pause = !com_tilbuci_data_GlobalPlayer.area.get_playing();
			this._top.removeChild(this._player.player);
			if(com_tilbuci_data_Global.displayType == "portrait") {
				com_tilbuci_data_Global.displayType = "landscape";
			} else {
				com_tilbuci_data_Global.displayType = "portrait";
			}
			this.centerPlayer();
			this._top.addChild(this._player.player);
			if(pause) {
				com_tilbuci_data_GlobalPlayer.area.loadKeyframe(com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[com_tilbuci_data_GlobalPlayer.area.get_currentKf()],com_tilbuci_data_GlobalPlayer.area.get_currentKf());
				com_tilbuci_data_GlobalPlayer.area.pause();
			} else {
				com_tilbuci_data_GlobalPlayer.area.pause();
				com_tilbuci_data_GlobalPlayer.mode = "editor";
				com_tilbuci_data_GlobalPlayer.area.loadKeyframe(com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[com_tilbuci_data_GlobalPlayer.area.get_currentKf()],com_tilbuci_data_GlobalPlayer.area.get_currentKf());
				this.centerPlayer();
				com_tilbuci_data_GlobalPlayer.mode = "editorplayerwait";
				com_tilbuci_data_GlobalPlayer.area.play();
			}
			this.centerPlayer();
		}
	}
	,onClose: function(evt) {
		while(com_tilbuci_data_GlobalPlayer.history.length > 0) com_tilbuci_data_GlobalPlayer.history.shift();
		com_tilbuci_data_GlobalPlayer.contraptions.removeContraptions(true);
		com_tilbuci_data_GlobalPlayer.area.removeInputInterfaces();
		com_tilbuci_data_GlobalPlayer.mode = "editor";
		com_tilbuci_data_GlobalPlayer.area.maskArea(false);
		com_tilbuci_data_GlobalPlayer.area.pause();
		com_tilbuci_data_GlobalPlayer.area.releaseAllProperties();
		com_tilbuci_data_GlobalPlayer.area.hideTarget();
		com_tilbuci_data_GlobalPlayer.parser.clearVars();
		openfl_ui_Mouse.show();
		com_tilbuci_data_GlobalPlayer.cursorVisible = true;
		this._player.player.listenInputRemove();
		this._top.removeChild(this._player.player);
		this._player.addChild(this._player.player);
		com_tilbuci_data_Global.displayType = this.info.orientation;
		this._player.player.set_x(this.info.x);
		this._player.player.set_y(this.info.y);
		this._player.player.setSize(this.info.width,this.info.height);
		if(this.info.movie != com_tilbuci_data_GlobalPlayer.movie.get_mvId()) {
			com_tilbuci_data_Global.sceneObj = this.info.sceneobj;
			com_tilbuci_data_Global.sceneToLoad = this.info.scene;
			com_tilbuci_data_Global.kfToLoad = this.info.keyframe;
			this._player.player.load(this.info.movie);
		} else if(this.info.scene != com_tilbuci_data_GlobalPlayer.movie.get_scId()) {
			com_tilbuci_data_Global.sceneObj = this.info.sceneobj;
			com_tilbuci_data_Global.kfToLoad = this.info.keyframe;
			com_tilbuci_data_GlobalPlayer.movie.loadScene(this.info.scene);
		} else {
			com_tilbuci_data_GlobalPlayer.movie.scene.fromObject(this.info.sceneobj);
			com_tilbuci_data_GlobalPlayer.area.loadKeyframe(com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[this.info.keyframe],this.info.keyframe);
		}
		this._acCenter();
		feathers_core_PopUpManager.removePopUp(this);
	}
	,__class__: com_tilbuci_ui_component_EditorPlayback
});
var com_tilbuci_ui_component_FilterPanel = function(wd) {
	this._current = null;
	com_tilbuci_ui_component_DropDownPanel.call(this,com_tilbuci_data_Global.ln.get("rightbar-filter"),wd);
	this._timer = null;
	var glCont = this.ui.createHContainer("colorcont",3355443);
	this.ui.createTInput("glcolor","","",glCont);
	this.ui.createButton("glcolor",com_tilbuci_data_Global.ln.get("default-set"),$bind(this,this.changeProperties),glCont);
	glCont.set_width(wd - 5);
	var dsCont = this.ui.createHContainer("colorcont",3355443);
	this.ui.createTInput("dscolor","","",dsCont);
	this.ui.createButton("dscolor",com_tilbuci_data_Global.ln.get("default-set"),$bind(this,this.changeProperties),dsCont);
	dsCont.set_width(wd - 5);
	var tmp = this.ui;
	var tmp1 = { tp : "Label", id : "glow", tx : com_tilbuci_data_Global.ln.get("rightbar-filter-glow"), vr : ""};
	var tmp2 = { tp : "Label", id : "glblur", tx : com_tilbuci_data_Global.ln.get("rightbar-filter-glblur"), vr : "detail"};
	var tmp3 = { tp : "Label", id : "glcolor", tx : com_tilbuci_data_Global.ln.get("rightbar-filter-glcolor"), vr : "detail"};
	var tmp4 = { tp : "Label", id : "glstrength", tx : com_tilbuci_data_Global.ln.get("rightbar-filter-glstrength"), vr : "detail"};
	var tmp5 = { tp : "Label", id : "glalpha", tx : com_tilbuci_data_Global.ln.get("rightbar-filter-glalpha"), vr : "detail"};
	var tmp6 = { tp : "Label", id : "glinner", tx : com_tilbuci_data_Global.ln.get("rightbar-filter-glinner"), vr : "detail"};
	var tmp7 = { tp : "Label", id : "blur", tx : com_tilbuci_data_Global.ln.get("rightbar-filter-blur"), vr : ""};
	var tmp8 = { tp : "Label", id : "blurx", tx : com_tilbuci_data_Global.ln.get("rightbar-filter-blurx"), vr : "detail"};
	var tmp9 = { tp : "Label", id : "blury", tx : com_tilbuci_data_Global.ln.get("rightbar-filter-blury"), vr : "detail"};
	var tmp10 = { tp : "Label", id : "dropshadow", tx : com_tilbuci_data_Global.ln.get("rightbar-filter-dropshadow"), vr : ""};
	var tmp11 = { tp : "Label", id : "dsdistance", tx : com_tilbuci_data_Global.ln.get("rightbar-filter-dsdistance"), vr : "detail"};
	var tmp12 = { tp : "Label", id : "dsangle", tx : com_tilbuci_data_Global.ln.get("rightbar-filter-dsangle"), vr : "detail"};
	var tmp13 = { tp : "Label", id : "dscolor", tx : com_tilbuci_data_Global.ln.get("rightbar-filter-dscolor"), vr : "detail"};
	var tmp14 = { tp : "Label", id : "dsalpha", tx : com_tilbuci_data_Global.ln.get("rightbar-filter-dsalpha"), vr : "detail"};
	var tmp15 = { tp : "Label", id : "dsblurx", tx : com_tilbuci_data_Global.ln.get("rightbar-filter-dsblurx"), vr : "detail"};
	var tmp16 = { tp : "Label", id : "dsblury", tx : com_tilbuci_data_Global.ln.get("rightbar-filter-dsblury"), vr : "detail"};
	var tmp17 = { tp : "Label", id : "dsstrength", tx : com_tilbuci_data_Global.ln.get("rightbar-filter-dsstrength"), vr : "detail"};
	var tmp18 = com_tilbuci_data_Global.ln.get("rightbar-filter-dsinner");
	this._content = tmp.forge("properties",[tmp1,{ tp : "Toggle", id : "glow", vl : false, ch : $bind(this,this.changeProperties)},tmp2,{ tp : "Numeric", id : "glblur", mn : 0, mx : 100, st : 1, vl : 0, ch : $bind(this,this.changeProperties)},tmp3,{ tp : "Custom", cont : glCont},tmp4,{ tp : "Numeric", id : "glstrength", mn : 0, mx : 100, st : 1, vl : 0, ch : $bind(this,this.changeProperties)},tmp5,{ tp : "Numeric", id : "glalpha", mn : 0, mx : 100, st : 1, vl : 0, ch : $bind(this,this.changeProperties)},tmp6,{ tp : "Toggle", id : "glinner", vl : false, ch : $bind(this,this.changeProperties)},{ tp : "Spacer", id : "glow", ht : 8, ln : false},tmp7,{ tp : "Toggle", id : "blur", vl : false, ch : $bind(this,this.changeProperties)},tmp8,{ tp : "Numeric", id : "blurx", mn : 0, mx : 255, st : 1, vl : 0, ch : $bind(this,this.changeProperties)},tmp9,{ tp : "Numeric", id : "blury", mn : 0, mx : 255, st : 1, vl : 0, ch : $bind(this,this.changeProperties)},{ tp : "Spacer", id : "blur", ht : 8, ln : false},tmp10,{ tp : "Toggle", id : "dropshadow", vl : false, ch : $bind(this,this.changeProperties)},tmp11,{ tp : "Numeric", id : "dsdistance", mn : -100, mx : 100, st : 1, vl : 0, ch : $bind(this,this.changeProperties)},tmp12,{ tp : "Numeric", id : "dsangle", mn : 0, mx : 360, st : 1, vl : 0, ch : $bind(this,this.changeProperties)},tmp13,{ tp : "Custom", cont : dsCont},tmp14,{ tp : "Numeric", id : "dsalpha", mn : 0, mx : 100, st : 1, vl : 0, ch : $bind(this,this.changeProperties)},tmp15,{ tp : "Numeric", id : "dsblurx", mn : 0, mx : 100, st : 1, vl : 0, ch : $bind(this,this.changeProperties)},tmp16,{ tp : "Numeric", id : "dsblury", mn : 0, mx : 100, st : 1, vl : 0, ch : $bind(this,this.changeProperties)},tmp17,{ tp : "Numeric", id : "dsstrength", mn : 0, mx : 255, st : 1, vl : 0, ch : $bind(this,this.changeProperties)},{ tp : "Label", id : "dsinner", tx : tmp18, vr : "detail"},{ tp : "Toggle", id : "dsinner", vl : false, ch : $bind(this,this.changeProperties)}],3355443,wd - 5);
	this.ui.containers.h["properties"].set_enabled(false);
	com_tilbuci_data_Global.history.propDisplay.push($bind(this,this.updateValues));
};
$hxClasses["com.tilbuci.ui.component.FilterPanel"] = com_tilbuci_ui_component_FilterPanel;
com_tilbuci_ui_component_FilterPanel.__name__ = "com.tilbuci.ui.component.FilterPanel";
com_tilbuci_ui_component_FilterPanel.__super__ = com_tilbuci_ui_component_DropDownPanel;
com_tilbuci_ui_component_FilterPanel.prototype = $extend(com_tilbuci_ui_component_DropDownPanel.prototype,{
	_timer: null
	,_current: null
	,updateContent: function(data) {
		if(Object.prototype.hasOwnProperty.call(data.h,"nm")) {
			if(data.h["nm"] == "") {
				this.clearValues();
			} else {
				this._current = com_tilbuci_data_GlobalPlayer.area.instanceRef(data.h["nm"]);
				this.updateValues();
			}
		} else {
			this.clearValues();
		}
	}
	,reloadContent: function(data) {
		this.clearValues();
	}
	,updateValues: function() {
		if(this._current != null) {
			this.ui.containers.h["properties"].set_enabled(false);
			this.ui.toggles.h["blur"].set_selected(this._current.getCurrentBool("blur"));
			this.ui.toggles.h["dropshadow"].set_selected(this._current.getCurrentBool("dropshadow"));
			this.ui.toggles.h["glow"].set_selected(this._current.getCurrentBool("glow"));
			var data = this._current.getCurrentArr("blur");
			this.ui.numerics.h["blurx"].set_value(Std.parseInt(data[0]));
			this.ui.numerics.h["blury"].set_value(Std.parseInt(data[1]));
			data = this._current.getCurrentArr("dropshadow");
			this.ui.numerics.h["dsdistance"].set_value(Std.parseInt(data[0]));
			this.ui.numerics.h["dsangle"].set_value(Std.parseInt(data[1]));
			this.ui.inputs.h["dscolor"].set_text(StringTools.replace(data[2],"0x","#"));
			this.ui.numerics.h["dsalpha"].set_value(Math.round(parseFloat(data[3]) * 100));
			this.ui.numerics.h["dsblurx"].set_value(Std.parseInt(data[4]));
			this.ui.numerics.h["dsblury"].set_value(Std.parseInt(data[5]));
			this.ui.numerics.h["dsstrength"].set_value(Std.parseInt(data[6]));
			this.ui.toggles.h["dsinner"].set_selected(data[7] == "1");
			data = this._current.getCurrentArr("glow");
			this.ui.inputs.h["glcolor"].set_text(StringTools.replace(data[0],"0x","#"));
			this.ui.numerics.h["glblur"].set_value(Std.parseInt(data[2]) - 6);
			this.ui.numerics.h["glstrength"].set_value(Std.parseInt(data[3]));
			this.ui.toggles.h["glinner"].set_selected(data[4] == "1");
			this.ui.numerics.h["glalpha"].set_value(Math.round(parseFloat(data[1]) * 100));
			this.ui.containers.h["properties"].set_enabled(true);
		}
	}
	,clearValues: function() {
		this.ui.containers.h["properties"].set_enabled(false);
		this.ui.toggles.h["blur"].set_selected(false);
		this.ui.toggles.h["dropshadow"].set_selected(false);
		this.ui.numerics.h["blurx"].set_value(0);
		this.ui.numerics.h["blury"].set_value(0);
		this.ui.numerics.h["dsdistance"].set_value(0);
		this.ui.numerics.h["dsangle"].set_value(0);
		this.ui.inputs.h["dscolor"].set_text("#000000");
		this.ui.numerics.h["dsalpha"].set_value(100);
		this.ui.numerics.h["dsblurx"].set_value(0);
		this.ui.numerics.h["dsblury"].set_value(0);
		this.ui.numerics.h["dsstrength"].set_value(0);
		this.ui.toggles.h["dsinner"].set_selected(false);
		this.ui.toggles.h["glow"].set_selected(false);
		this.ui.inputs.h["glcolor"].set_text("#FFFFFF");
		this.ui.numerics.h["glblur"].set_value(0);
		this.ui.numerics.h["glstrength"].set_value(0);
		this.ui.toggles.h["glinner"].set_selected(false);
		this.ui.numerics.h["glalpha"].set_value(100);
		this._current = null;
	}
	,changeProperties: function(evt) {
		if(this._current != null && this.ui.containers.h["properties"].get_enabled()) {
			if(com_tilbuci_data_Global.history.states.length == 0) {
				com_tilbuci_data_Global.history.addState(com_tilbuci_data_Global.ln.get("rightbar-history-original"));
			}
			com_tilbuci_data_GlobalPlayer.area.setCurrentArray("blur",[Std.string(this.ui.numerics.h["blurx"].get_value()),Std.string(this.ui.numerics.h["blury"].get_value())]);
			var color = StringTools.replace(this.ui.inputs.h["dscolor"].get_text(),"#","0x");
			var colorint = Std.parseInt(color);
			if(colorint == null) {
				color = "0x000000";
			} else {
				color = "0x" + StringTools.hex(colorint);
			}
			this.ui.inputs.h["dscolor"].set_text(StringTools.replace(color,"0x","#"));
			var dsinner = "0";
			if(this.ui.toggles.h["dsinner"].get_selected()) {
				dsinner = "1";
			}
			com_tilbuci_data_GlobalPlayer.area.setCurrentArray("dropshadow",[Std.string(this.ui.numerics.h["dsdistance"].get_value()),Std.string(this.ui.numerics.h["dsangle"].get_value()),color,Std.string(this.ui.numerics.h["dsalpha"].get_value() / 100),Std.string(this.ui.numerics.h["dsblurx"].get_value()),Std.string(this.ui.numerics.h["dsblury"].get_value()),Std.string(this.ui.numerics.h["dsstrength"].get_value()),dsinner]);
			color = StringTools.replace(this.ui.inputs.h["glcolor"].get_text(),"#","0x");
			colorint = Std.parseInt(color);
			if(colorint == null) {
				color = "0xFFFFFF";
			} else {
				color = "0x" + StringTools.hex(colorint);
			}
			dsinner = "0";
			if(this.ui.toggles.h["glinner"].get_selected()) {
				dsinner = "1";
			}
			com_tilbuci_data_GlobalPlayer.area.setCurrentArray("glow",[color,Std.string(this.ui.numerics.h["glalpha"].get_value() / 100),Std.string(this.ui.numerics.h["glblur"].get_value() + 6),Std.string(this.ui.numerics.h["glstrength"].get_value()),dsinner]);
			com_tilbuci_data_GlobalPlayer.area.setCurrentBool("blur",this.ui.toggles.h["blur"].get_selected());
			com_tilbuci_data_GlobalPlayer.area.setCurrentBool("dropshadow",this.ui.toggles.h["dropshadow"].get_selected());
			com_tilbuci_data_GlobalPlayer.area.setCurrentBool("glow",this.ui.toggles.h["glow"].get_selected());
			if(this._timer == null) {
				this._timer = new haxe_Timer(2000);
				this._timer.run = $bind(this,this.saveHistory);
			}
		}
	}
	,saveHistory: function() {
		try {
			this._timer.stop();
		} catch( _g ) {
		}
		this._timer = null;
		com_tilbuci_data_Global.history.addState(com_tilbuci_data_Global.ln.get("rightbar-history-filters"));
	}
	,__class__: com_tilbuci_ui_component_FilterPanel
});
var com_tilbuci_ui_component_HistoryPanel = function(wd,centerMethod) {
	com_tilbuci_ui_component_DropDownPanel.call(this,com_tilbuci_data_Global.ln.get("rightbar-history"),wd);
	this._centerMethod = centerMethod;
	this.ui.createList("list",[],200);
	this.ui.setListToIcon("list");
	this.ui.lists.h["list"].addEventListener("change",$bind(this,this.onChange));
	this._content = this.ui.lists.h["list"];
	this._content.set_width(wd - 20);
	com_tilbuci_data_Global.history.historyDisplay = $bind(this,this.reloadContent);
};
$hxClasses["com.tilbuci.ui.component.HistoryPanel"] = com_tilbuci_ui_component_HistoryPanel;
com_tilbuci_ui_component_HistoryPanel.__name__ = "com.tilbuci.ui.component.HistoryPanel";
com_tilbuci_ui_component_HistoryPanel.__super__ = com_tilbuci_ui_component_DropDownPanel;
com_tilbuci_ui_component_HistoryPanel.prototype = $extend(com_tilbuci_ui_component_DropDownPanel.prototype,{
	_centerMethod: null
	,reloadContent: function(data) {
		var items = [];
		var stnum = 0;
		var _g = 0;
		var _g1 = com_tilbuci_data_Global.history.states;
		while(_g < _g1.length) {
			var st = _g1[_g];
			++_g;
			items.push({ text : st.title, value : stnum, asset : st.orientation, user : st.name});
			++stnum;
		}
		items.reverse();
		this.ui.setListValues("list",items);
	}
	,onChange: function(evt) {
		if(this.ui.lists.h["list"].get_selectedItem() != null) {
			com_tilbuci_data_Global.history.loadState(this.ui.lists.h["list"].get_selectedItem().value);
			this._centerMethod();
		}
	}
	,__class__: com_tilbuci_ui_component_HistoryPanel
});
var com_tilbuci_ui_component_IDButton = function(id,ac,label,icon,autoR) {
	if(autoR == null) {
		autoR = true;
	}
	if(id == null) {
		id = "";
	}
	this._ac = null;
	this.autoResize = true;
	feathers_controls_Button.call(this);
	this.btid = id;
	this.autoResize = autoR;
	if(label != null) {
		this.set_text(label);
	}
	if(icon != null) {
		var bmp = new openfl_display_Bitmap(icon);
		bmp.smoothing = true;
		bmp.set_width(bmp.set_height(20));
		this.set_icon(bmp);
	}
	if(ac != null) {
		this.addEventListener("click",ac);
		this._ac = ac;
	}
};
$hxClasses["com.tilbuci.ui.component.IDButton"] = com_tilbuci_ui_component_IDButton;
com_tilbuci_ui_component_IDButton.__name__ = "com.tilbuci.ui.component.IDButton";
com_tilbuci_ui_component_IDButton.__super__ = feathers_controls_Button;
com_tilbuci_ui_component_IDButton.prototype = $extend(feathers_controls_Button.prototype,{
	btid: null
	,autoResize: null
	,_ac: null
	,kill: function() {
		if(this.parent != null) {
			this.parent.removeChild(this);
		}
		if(this._ac != null) {
			this.removeEventListener("click",this._ac);
		}
		this._ac = null;
		this.btid = null;
	}
	,__class__: com_tilbuci_ui_component_IDButton
});
var feathers_controls_Label = function(text) {
	if(text == null) {
		text = "";
	}
	this.__disabledBackgroundSkin = null;
	this.__backgroundSkin = null;
	this.__wordWrap = false;
	this.__verticalAlign = feathers_layout_VerticalAlign.TOP;
	this.__paddingLeft = 0.0;
	this.__paddingBottom = 0.0;
	this.__paddingRight = 0.0;
	this.__paddingTop = 0.0;
	this.__disabledTextFormat = null;
	this.__embedFonts = false;
	this.__styleSheet = null;
	this.__textFormat = null;
	this._backgroundSkinMeasurements = null;
	this._currentBackgroundSkin = null;
	this._selectable = false;
	this._htmlText = null;
	this._wrappedOnMeasure = false;
	this._updatedTextStyles = false;
	this._previousSimpleTextFormat = null;
	this._previousTextFormat = null;
	this._previousHTMLText = null;
	this._previousText = null;
	this.initializeLabelTheme();
	feathers_core_FeathersControl.call(this);
	this.set_text(text);
	this.set_tabEnabled(false);
	this.set_tabChildren(false);
	this.addEventListener("focusIn",$bind(this,this.label_focusInHandler));
};
$hxClasses["feathers.controls.Label"] = feathers_controls_Label;
feathers_controls_Label.__name__ = "feathers.controls.Label";
feathers_controls_Label.__interfaces__ = [feathers_core_IStageFocusDelegate,feathers_core_IFocusObject,feathers_core_IHTMLTextControl,feathers_core_ITextControl];
feathers_controls_Label.__super__ = feathers_core_FeathersControl;
feathers_controls_Label.prototype = $extend(feathers_core_FeathersControl.prototype,{
	textField: null
	,_previousText: null
	,_previousHTMLText: null
	,_previousTextFormat: null
	,_previousSimpleTextFormat: null
	,_updatedTextStyles: null
	,_textMeasuredWidth: null
	,_textMeasuredHeight: null
	,_wrappedOnMeasure: null
	,_text: null
	,get_text: function() {
		return this._text;
	}
	,set_text: function(value) {
		if(value == null) {
			if(this._text.length == 0) {
				return this._text;
			}
			value = "";
		}
		if(this._text == value) {
			return this._text;
		}
		this._text = value;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		return this._text;
	}
	,get_baseline: function() {
		if(this.textField == null) {
			return 0.0;
		}
		var hasText = this._text != null && this._text.length > 0;
		var hasHTMLText = this._htmlText != null && this._htmlText.length > 0;
		if(!hasText && !hasHTMLText) {
			this.textField.set_text("​");
			var result = this.textField.get_y() + this.textField.getLineMetrics(0).ascent;
			this.textField.set_text("");
			return result;
		}
		return this.textField.get_y() + this.textField.getLineMetrics(0).ascent;
	}
	,_htmlText: null
	,get_htmlText: function() {
		return this._htmlText;
	}
	,set_htmlText: function(value) {
		if(this._htmlText == value) {
			return this._htmlText;
		}
		this._htmlText = value;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		return this._htmlText;
	}
	,_selectable: null
	,get_selectable: function() {
		return this._selectable;
	}
	,set_selectable: function(value) {
		if(this._selectable == value) {
			return this._selectable;
		}
		this._selectable = value;
		this.setInvalid(feathers_core_InvalidationFlag.SELECTION);
		return this._selectable;
	}
	,get_tabEnabled: function() {
		if(this._selectable && this._enabled) {
			return this.get_rawTabEnabled();
		} else {
			return false;
		}
	}
	,get_focusEnabled: function() {
		if(this._selectable) {
			return feathers_core_FeathersControl.prototype.get_focusEnabled.call(this);
		} else {
			return false;
		}
	}
	,get_stageFocusTarget: function() {
		return this.textField;
	}
	,get_selectionBeginIndex: function() {
		if(!this._selectable) {
			return -1;
		}
		if(this.textField == null) {
			return 0;
		}
		return this.textField.get_selectionBeginIndex();
	}
	,get_selectionEndIndex: function() {
		if(!this._selectable) {
			return -1;
		}
		if(this.textField == null) {
			return 0;
		}
		return this.textField.get_selectionEndIndex();
	}
	,_currentBackgroundSkin: null
	,_backgroundSkinMeasurements: null
	,setPadding: function(value) {
		this.set_paddingTop(value);
		this.set_paddingRight(value);
		this.set_paddingBottom(value);
		this.set_paddingLeft(value);
	}
	,initializeLabelTheme: function() {
		feathers_themes_steel_components_SteelLabelStyles.initialize();
	}
	,initialize: function() {
		feathers_core_FeathersControl.prototype.initialize.call(this);
		if(this.textField == null) {
			this.textField = new openfl_text_TextField();
			this.textField.set_multiline(true);
			this.addChild(this.textField);
		}
	}
	,update: function() {
		var dataInvalid = this.isInvalid(feathers_core_InvalidationFlag.DATA);
		var selectionInvalid = this.isInvalid(feathers_core_InvalidationFlag.SELECTION);
		var sizeInvalid = this.isInvalid(feathers_core_InvalidationFlag.SIZE);
		var stateInvalid = this.isInvalid(feathers_core_InvalidationFlag.STATE);
		var stylesInvalid = this.isInvalid(feathers_core_InvalidationFlag.STYLES);
		this._updatedTextStyles = false;
		if(stylesInvalid || stateInvalid) {
			this.refreshBackgroundSkin();
		}
		if(stylesInvalid || stateInvalid) {
			this.refreshTextStyles();
		}
		if(dataInvalid || stylesInvalid || stateInvalid || sizeInvalid) {
			this.refreshText(sizeInvalid);
		}
		if(dataInvalid || stylesInvalid || selectionInvalid) {
			this.refreshSelection();
		}
		if(this.measure()) {
			sizeInvalid = true;
		}
		if(stylesInvalid || stateInvalid || dataInvalid || sizeInvalid) {
			this.layoutContent();
		}
	}
	,measure: function() {
		var needsWidth = this.get_explicitWidth() == null;
		var needsHeight = this.get_explicitHeight() == null;
		var needsMinWidth = this.get_explicitMinWidth() == null;
		var needsMinHeight = this.get_explicitMinHeight() == null;
		var needsMaxWidth = this.get_explicitMaxWidth() == null;
		var needsMaxHeight = this.get_explicitMaxHeight() == null;
		if(!needsWidth && !needsHeight && !needsMinWidth && !needsMinHeight && !needsMaxWidth && !needsMaxHeight) {
			return false;
		}
		if(this._currentBackgroundSkin != null) {
			feathers_utils_MeasurementsUtil.resetFluidlyWithParent(this._backgroundSkinMeasurements,this._currentBackgroundSkin,this);
		}
		var measureSkin = null;
		if(js_Boot.__implements(this._currentBackgroundSkin,feathers_core_IMeasureObject)) {
			measureSkin = this._currentBackgroundSkin;
		}
		if(js_Boot.__implements(this._currentBackgroundSkin,feathers_core_IValidating)) {
			this._currentBackgroundSkin.validateNow();
		}
		var newWidth = this.get_explicitWidth();
		if(needsWidth) {
			newWidth = this._textMeasuredWidth + this.get_paddingLeft() + this.get_paddingRight();
			if(this._currentBackgroundSkin != null) {
				newWidth = Math.max(this._currentBackgroundSkin.get_width(),newWidth);
			}
		}
		var newHeight = this.get_explicitHeight();
		if(needsHeight) {
			newHeight = this._textMeasuredHeight + this.get_paddingTop() + this.get_paddingBottom();
			if(this._currentBackgroundSkin != null) {
				newHeight = Math.max(this._currentBackgroundSkin.get_height(),newHeight);
			}
		}
		var newMinWidth = this.get_explicitMinWidth();
		if(needsMinWidth) {
			newMinWidth = this._textMeasuredWidth + this.get_paddingLeft() + this.get_paddingRight();
			if(measureSkin != null) {
				newMinWidth = Math.max(measureSkin.get_minWidth(),newMinWidth);
			} else if(this._backgroundSkinMeasurements != null && this._backgroundSkinMeasurements.minWidth != null) {
				newMinWidth = Math.max(this._backgroundSkinMeasurements.minWidth,newMinWidth);
			}
		}
		var newMinHeight = this.get_explicitMinHeight();
		if(needsMinHeight) {
			newMinHeight = this._textMeasuredHeight + this.get_paddingTop() + this.get_paddingBottom();
			if(measureSkin != null) {
				newMinHeight = Math.max(measureSkin.get_minHeight(),newMinHeight);
			} else if(this._backgroundSkinMeasurements != null && this._backgroundSkinMeasurements.minHeight != null) {
				newMinHeight = Math.max(this._backgroundSkinMeasurements.minHeight,newMinHeight);
			}
		}
		var newMaxWidth = this.get_explicitMaxWidth();
		if(needsMaxWidth) {
			if(measureSkin != null) {
				newMaxWidth = measureSkin.get_maxWidth();
			} else if(this._backgroundSkinMeasurements != null && this._backgroundSkinMeasurements.maxWidth != null) {
				newMaxWidth = this._backgroundSkinMeasurements.maxWidth;
			} else {
				newMaxWidth = 1.0 / 0.0;
			}
		}
		var newMaxHeight = this.get_explicitMaxHeight();
		if(needsMaxHeight) {
			if(measureSkin != null) {
				newMaxHeight = measureSkin.get_maxHeight();
			} else if(this._backgroundSkinMeasurements != null && this._backgroundSkinMeasurements.maxHeight != null) {
				newMaxHeight = this._backgroundSkinMeasurements.maxHeight;
			} else {
				newMaxHeight = 1.0 / 0.0;
			}
		}
		return this.saveMeasurements(newWidth,newHeight,newMinWidth,newMinHeight,newMaxWidth,newMaxHeight);
	}
	,refreshTextStyles: function() {
		if(this.textField.get_wordWrap() != this.get_wordWrap()) {
			this.textField.set_wordWrap(this.get_wordWrap());
			this._updatedTextStyles = true;
		}
		if(this.textField.get_embedFonts() != this.get_embedFonts()) {
			this.textField.set_embedFonts(this.get_embedFonts());
			this._updatedTextStyles = true;
		}
		if(this.textField.get_styleSheet() != this.get_styleSheet()) {
			this.textField.set_styleSheet(this.get_styleSheet());
			this._updatedTextStyles = true;
		}
		var textFormat = this.getCurrentTextFormat();
		var simpleTextFormat = textFormat != null ? textFormat.toSimpleTextFormat() : null;
		if(simpleTextFormat == this._previousSimpleTextFormat) {
			return;
		}
		if(this._previousTextFormat != null) {
			this._previousTextFormat.removeEventListener("change",$bind(this,this.label_textFormat_changeHandler));
		}
		if(this.textField.get_caretIndex() != -1 && this.textField.get_selectionBeginIndex() != this.textField.get_selectionEndIndex()) {
			this.textField.setSelection(0,0);
		}
		if(textFormat != null) {
			textFormat.addEventListener("change",$bind(this,this.label_textFormat_changeHandler),false,0,true);
			this.textField.set_defaultTextFormat(simpleTextFormat);
			this._updatedTextStyles = true;
		}
		this._previousTextFormat = textFormat;
		this._previousSimpleTextFormat = simpleTextFormat;
	}
	,refreshText: function(forceMeasurement) {
		var hasText = this._text != null && this._text.length > 0;
		var hasHTMLText = this._htmlText != null && this._htmlText.length > 0;
		this.textField.set_visible(hasText || hasHTMLText);
		if(this._text == this._previousText && this._htmlText == this._previousHTMLText && !this._updatedTextStyles && !forceMeasurement) {
			return;
		}
		this.textField.set_autoSize(1);
		if(hasHTMLText) {
			this.textField.set_htmlText(this._htmlText);
		} else if(hasText) {
			this.textField.set_text(this._text);
		} else {
			this.textField.set_text("​");
		}
		if(this.get_wordWrap()) {
			this.textField.set_wordWrap(false);
		}
		this._textMeasuredWidth = this.textField.get_textWidth() + 4;
		this._wrappedOnMeasure = false;
		if(this.get_wordWrap()) {
			var textFieldExplicitWidth = this.calculateExplicitWidthForTextMeasurement();
			if(textFieldExplicitWidth != null && this._textMeasuredWidth > textFieldExplicitWidth) {
				this.textField.set_wordWrap(true);
				this.textField.set_width(textFieldExplicitWidth);
				this._textMeasuredWidth = this.textField.get_width();
				this._wrappedOnMeasure = true;
			}
		}
		this._textMeasuredHeight = this.textField.get_height();
		this.textField.set_autoSize(2);
		if(this.textField.get_wordWrap() != this.get_wordWrap()) {
			this.textField.set_wordWrap(this.get_wordWrap());
		}
		if(!hasText && !hasHTMLText) {
			this.textField.set_text("");
		}
		this._previousText = this._text;
		this._previousHTMLText = this._htmlText;
	}
	,calculateExplicitWidthForTextMeasurement: function() {
		var textFieldExplicitWidth = null;
		if(this.get_explicitWidth() != null) {
			textFieldExplicitWidth = this.get_explicitWidth();
		} else if(this.get_explicitMaxWidth() != null) {
			textFieldExplicitWidth = this.get_explicitMaxWidth();
		} else if(this._backgroundSkinMeasurements != null && this._backgroundSkinMeasurements.maxWidth != null) {
			textFieldExplicitWidth = this._backgroundSkinMeasurements.maxWidth;
		}
		if(textFieldExplicitWidth == null) {
			return textFieldExplicitWidth;
		}
		textFieldExplicitWidth -= this.get_paddingLeft() + this.get_paddingRight();
		if(textFieldExplicitWidth < 0.0) {
			textFieldExplicitWidth = 0.0;
		}
		return textFieldExplicitWidth;
	}
	,refreshSelection: function() {
		var selectable = this._selectable && this._enabled;
		if(this.textField.get_selectable() != selectable) {
			this.textField.set_selectable(selectable);
		}
	}
	,getCurrentTextFormat: function() {
		if(this.get_styleSheet() != null) {
			return null;
		}
		if(!this._enabled && this.get_disabledTextFormat() != null) {
			return this.get_disabledTextFormat();
		}
		return this.get_textFormat();
	}
	,refreshBackgroundSkin: function() {
		var oldSkin = this._currentBackgroundSkin;
		this._currentBackgroundSkin = this.getCurrentBackgroundSkin();
		if(this._currentBackgroundSkin == oldSkin) {
			return;
		}
		this.removeCurrentBackgroundSkin(oldSkin);
		this.addCurrentBackgroundSkin(this._currentBackgroundSkin);
	}
	,getCurrentBackgroundSkin: function() {
		if(!this._enabled && this.get_disabledBackgroundSkin() != null) {
			return this.get_disabledBackgroundSkin();
		}
		return this.get_backgroundSkin();
	}
	,addCurrentBackgroundSkin: function(skin) {
		if(skin == null) {
			this._backgroundSkinMeasurements = null;
			return;
		}
		if(js_Boot.__implements(skin,feathers_core_IUIControl)) {
			skin.initializeNow();
		}
		if(this._backgroundSkinMeasurements == null) {
			this._backgroundSkinMeasurements = new feathers_layout_Measurements(skin);
		} else {
			this._backgroundSkinMeasurements.save(skin);
		}
		if(js_Boot.__implements(skin,feathers_skins_IProgrammaticSkin)) {
			skin.set_uiContext(this);
		}
		this.addChildAt(skin,0);
	}
	,removeCurrentBackgroundSkin: function(skin) {
		if(skin == null) {
			return;
		}
		if(js_Boot.__implements(skin,feathers_skins_IProgrammaticSkin)) {
			skin.set_uiContext(null);
		}
		this._backgroundSkinMeasurements.restore(skin);
		if(skin.parent == this) {
			this.removeChild(skin);
		}
	}
	,layoutContent: function() {
		this.layoutBackgroundSkin();
		var textFieldLayoutWidth = this.actualWidth - this.get_paddingLeft() - this.get_paddingRight();
		if(textFieldLayoutWidth < 0.0) {
			textFieldLayoutWidth = 0.0;
		}
		this.textField.set_x(this.get_paddingLeft());
		this.textField.set_width(textFieldLayoutWidth);
		var wordWrap = this.get_wordWrap();
		if(wordWrap && !this._wrappedOnMeasure && textFieldLayoutWidth >= this._textMeasuredWidth) {
			wordWrap = false;
		}
		if(this.textField.get_wordWrap() != wordWrap) {
			this.textField.set_wordWrap(wordWrap);
		}
		var textFieldHeight = this._textMeasuredHeight;
		var maxHeight = this.actualHeight - this.get_paddingTop() - this.get_paddingBottom();
		if(textFieldHeight > maxHeight) {
			textFieldHeight = maxHeight;
		}
		if(textFieldHeight < 0.0) {
			textFieldHeight = 0.0;
		}
		this.textField.set_height(textFieldHeight);
		switch(this.get_verticalAlign()._hx_index) {
		case 0:
			this.textField.set_y(this.get_paddingTop());
			break;
		case 2:
			this.textField.set_y(this.actualHeight - this.get_paddingBottom() - textFieldHeight);
			break;
		default:
			this.textField.set_y(this.get_paddingTop() + (maxHeight - textFieldHeight) / 2.0);
		}
	}
	,layoutBackgroundSkin: function() {
		if(this._currentBackgroundSkin == null) {
			return;
		}
		this._currentBackgroundSkin.set_x(0.0);
		this._currentBackgroundSkin.set_y(0.0);
		if(this._currentBackgroundSkin.get_width() != this.actualWidth) {
			this._currentBackgroundSkin.set_width(this.actualWidth);
		}
		if(this._currentBackgroundSkin.get_height() != this.actualHeight) {
			this._currentBackgroundSkin.set_height(this.actualHeight);
		}
		if(js_Boot.__implements(this._currentBackgroundSkin,feathers_core_IValidating)) {
			this._currentBackgroundSkin.validateNow();
		}
	}
	,label_focusInHandler: function(event) {
		if(this.stage != null && this.stage.get_focus() != this.textField) {
			event.stopImmediatePropagation();
			this.stage.set_focus(this.textField);
		}
	}
	,label_textFormat_changeHandler: function(event) {
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
	}
	,__textFormat: null
	,get_textFormat: function() {
		return this.__textFormat;
	}
	,set_textFormat: function(value) {
		if(!this.setStyle("textFormat")) {
			return this.__textFormat;
		}
		if(this.__textFormat == value) {
			return this.__textFormat;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_textFormat);
		this.__textFormat = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__textFormat;
	}
	,clearStyle_textFormat: function() {
		this.set_textFormat(null);
		return this.get_textFormat();
	}
	,__styleSheet: null
	,get_styleSheet: function() {
		return this.__styleSheet;
	}
	,set_styleSheet: function(value) {
		if(!this.setStyle("styleSheet")) {
			return this.__styleSheet;
		}
		if(this.__styleSheet == value) {
			return this.__styleSheet;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_styleSheet);
		this.__styleSheet = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__styleSheet;
	}
	,clearStyle_styleSheet: function() {
		this.set_styleSheet(null);
		return this.get_styleSheet();
	}
	,__embedFonts: null
	,get_embedFonts: function() {
		return this.__embedFonts;
	}
	,set_embedFonts: function(value) {
		if(!this.setStyle("embedFonts")) {
			return this.__embedFonts;
		}
		if(this.__embedFonts == value) {
			return this.__embedFonts;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_embedFonts);
		this.__embedFonts = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__embedFonts;
	}
	,clearStyle_embedFonts: function() {
		this.set_embedFonts(false);
		return this.get_embedFonts();
	}
	,__disabledTextFormat: null
	,get_disabledTextFormat: function() {
		return this.__disabledTextFormat;
	}
	,set_disabledTextFormat: function(value) {
		if(!this.setStyle("disabledTextFormat")) {
			return this.__disabledTextFormat;
		}
		if(this.__disabledTextFormat == value) {
			return this.__disabledTextFormat;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_disabledTextFormat);
		this.__disabledTextFormat = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__disabledTextFormat;
	}
	,clearStyle_disabledTextFormat: function() {
		this.set_disabledTextFormat(null);
		return this.get_disabledTextFormat();
	}
	,__paddingTop: null
	,get_paddingTop: function() {
		return this.__paddingTop;
	}
	,set_paddingTop: function(value) {
		if(!this.setStyle("paddingTop")) {
			return this.__paddingTop;
		}
		if(this.__paddingTop == value) {
			return this.__paddingTop;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_paddingTop);
		this.__paddingTop = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__paddingTop;
	}
	,clearStyle_paddingTop: function() {
		this.set_paddingTop(0.0);
		return this.get_paddingTop();
	}
	,__paddingRight: null
	,get_paddingRight: function() {
		return this.__paddingRight;
	}
	,set_paddingRight: function(value) {
		if(!this.setStyle("paddingRight")) {
			return this.__paddingRight;
		}
		if(this.__paddingRight == value) {
			return this.__paddingRight;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_paddingRight);
		this.__paddingRight = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__paddingRight;
	}
	,clearStyle_paddingRight: function() {
		this.set_paddingRight(0.0);
		return this.get_paddingRight();
	}
	,__paddingBottom: null
	,get_paddingBottom: function() {
		return this.__paddingBottom;
	}
	,set_paddingBottom: function(value) {
		if(!this.setStyle("paddingBottom")) {
			return this.__paddingBottom;
		}
		if(this.__paddingBottom == value) {
			return this.__paddingBottom;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_paddingBottom);
		this.__paddingBottom = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__paddingBottom;
	}
	,clearStyle_paddingBottom: function() {
		this.set_paddingBottom(0.0);
		return this.get_paddingBottom();
	}
	,__paddingLeft: null
	,get_paddingLeft: function() {
		return this.__paddingLeft;
	}
	,set_paddingLeft: function(value) {
		if(!this.setStyle("paddingLeft")) {
			return this.__paddingLeft;
		}
		if(this.__paddingLeft == value) {
			return this.__paddingLeft;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_paddingLeft);
		this.__paddingLeft = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__paddingLeft;
	}
	,clearStyle_paddingLeft: function() {
		this.set_paddingLeft(0.0);
		return this.get_paddingLeft();
	}
	,__verticalAlign: null
	,get_verticalAlign: function() {
		return this.__verticalAlign;
	}
	,set_verticalAlign: function(value) {
		if(!this.setStyle("verticalAlign")) {
			return this.__verticalAlign;
		}
		if(this.__verticalAlign == value) {
			return this.__verticalAlign;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_verticalAlign);
		this.__verticalAlign = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__verticalAlign;
	}
	,clearStyle_verticalAlign: function() {
		this.set_verticalAlign(feathers_layout_VerticalAlign.TOP);
		return this.get_verticalAlign();
	}
	,__wordWrap: null
	,get_wordWrap: function() {
		return this.__wordWrap;
	}
	,set_wordWrap: function(value) {
		if(!this.setStyle("wordWrap")) {
			return this.__wordWrap;
		}
		if(this.__wordWrap == value) {
			return this.__wordWrap;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_wordWrap);
		this.__wordWrap = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__wordWrap;
	}
	,clearStyle_wordWrap: function() {
		this.set_wordWrap(false);
		return this.get_wordWrap();
	}
	,__backgroundSkin: null
	,get_backgroundSkin: function() {
		return this.__backgroundSkin;
	}
	,set_backgroundSkin: function(value) {
		if(!this.setStyle("backgroundSkin")) {
			return this.__backgroundSkin;
		}
		if(this.__backgroundSkin == value) {
			return this.__backgroundSkin;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_backgroundSkin);
		this.__backgroundSkin = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__backgroundSkin;
	}
	,clearStyle_backgroundSkin: function() {
		this.set_backgroundSkin(null);
		return this.get_backgroundSkin();
	}
	,__disabledBackgroundSkin: null
	,get_disabledBackgroundSkin: function() {
		return this.__disabledBackgroundSkin;
	}
	,set_disabledBackgroundSkin: function(value) {
		if(!this.setStyle("disabledBackgroundSkin")) {
			return this.__disabledBackgroundSkin;
		}
		if(this.__disabledBackgroundSkin == value) {
			return this.__disabledBackgroundSkin;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_disabledBackgroundSkin);
		this.__disabledBackgroundSkin = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__disabledBackgroundSkin;
	}
	,clearStyle_disabledBackgroundSkin: function() {
		this.set_disabledBackgroundSkin(null);
		return this.get_disabledBackgroundSkin();
	}
	,get_styleContext: function() {
		return feathers_controls_Label;
	}
	,__class__: feathers_controls_Label
	,__properties__: $extend(feathers_core_FeathersControl.prototype.__properties__,{set_disabledBackgroundSkin:"set_disabledBackgroundSkin",get_disabledBackgroundSkin:"get_disabledBackgroundSkin",set_backgroundSkin:"set_backgroundSkin",get_backgroundSkin:"get_backgroundSkin",set_wordWrap:"set_wordWrap",get_wordWrap:"get_wordWrap",set_verticalAlign:"set_verticalAlign",get_verticalAlign:"get_verticalAlign",set_paddingLeft:"set_paddingLeft",get_paddingLeft:"get_paddingLeft",set_paddingBottom:"set_paddingBottom",get_paddingBottom:"get_paddingBottom",set_paddingRight:"set_paddingRight",get_paddingRight:"get_paddingRight",set_paddingTop:"set_paddingTop",get_paddingTop:"get_paddingTop",set_disabledTextFormat:"set_disabledTextFormat",get_disabledTextFormat:"get_disabledTextFormat",get_selectionEndIndex:"get_selectionEndIndex",get_selectionBeginIndex:"get_selectionBeginIndex",get_stageFocusTarget:"get_stageFocusTarget",set_selectable:"set_selectable",get_selectable:"get_selectable",set_embedFonts:"set_embedFonts",get_embedFonts:"get_embedFonts",set_styleSheet:"set_styleSheet",get_styleSheet:"get_styleSheet",set_textFormat:"set_textFormat",get_textFormat:"get_textFormat",set_htmlText:"set_htmlText",get_htmlText:"get_htmlText",get_baseline:"get_baseline",set_text:"set_text",get_text:"get_text"})
});
var com_tilbuci_ui_component_IDLabel = function() {
	this.autoResize = true;
	feathers_controls_Label.call(this);
};
$hxClasses["com.tilbuci.ui.component.IDLabel"] = com_tilbuci_ui_component_IDLabel;
com_tilbuci_ui_component_IDLabel.__name__ = "com.tilbuci.ui.component.IDLabel";
com_tilbuci_ui_component_IDLabel.__super__ = feathers_controls_Label;
com_tilbuci_ui_component_IDLabel.prototype = $extend(feathers_controls_Label.prototype,{
	autoResize: null
	,__class__: com_tilbuci_ui_component_IDLabel
});
var feathers_core_IDataSelector = function() { };
$hxClasses["feathers.core.IDataSelector"] = feathers_core_IDataSelector;
feathers_core_IDataSelector.__name__ = "feathers.core.IDataSelector";
feathers_core_IDataSelector.__isInterface__ = true;
feathers_core_IDataSelector.prototype = {
	get_selectedItem: null
	,set_selectedItem: null
	,__class__: feathers_core_IDataSelector
	,__properties__: {set_selectedItem:"set_selectedItem",get_selectedItem:"get_selectedItem"}
};
var feathers_core_IIndexSelector = function() { };
$hxClasses["feathers.core.IIndexSelector"] = feathers_core_IIndexSelector;
feathers_core_IIndexSelector.__name__ = "feathers.core.IIndexSelector";
feathers_core_IIndexSelector.__isInterface__ = true;
feathers_core_IIndexSelector.prototype = {
	get_selectedIndex: null
	,set_selectedIndex: null
	,get_maxSelectedIndex: null
	,__class__: feathers_core_IIndexSelector
	,__properties__: {get_maxSelectedIndex:"get_maxSelectedIndex",set_selectedIndex:"set_selectedIndex",get_selectedIndex:"get_selectedIndex"}
};
var feathers_dragDrop_IDropTarget = function() { };
$hxClasses["feathers.dragDrop.IDropTarget"] = feathers_dragDrop_IDropTarget;
feathers_dragDrop_IDropTarget.__name__ = "feathers.dragDrop.IDropTarget";
feathers_dragDrop_IDropTarget.__isInterface__ = true;
feathers_dragDrop_IDropTarget.__interfaces__ = [openfl_events_IEventDispatcher];
var feathers_dragDrop_IDragSource = function() { };
$hxClasses["feathers.dragDrop.IDragSource"] = feathers_dragDrop_IDragSource;
feathers_dragDrop_IDragSource.__name__ = "feathers.dragDrop.IDragSource";
feathers_dragDrop_IDragSource.__isInterface__ = true;
feathers_dragDrop_IDragSource.__interfaces__ = [openfl_events_IEventDispatcher];
var feathers_data_ListViewItemState = function(data,index,selected,text) {
	if(selected == null) {
		selected = false;
	}
	if(index == null) {
		index = -1;
	}
	this.enabled = true;
	this.selected = false;
	this.index = -1;
	this.data = data;
	this.index = index;
	this.selected = false;
	this.text = text;
};
$hxClasses["feathers.data.ListViewItemState"] = feathers_data_ListViewItemState;
feathers_data_ListViewItemState.__name__ = "feathers.data.ListViewItemState";
feathers_data_ListViewItemState.prototype = {
	owner: null
	,data: null
	,index: null
	,selected: null
	,text: null
	,enabled: null
	,recyclerID: null
	,__class__: feathers_data_ListViewItemState
};
var feathers_controls_ListView = function(dataProvider,changeListener) {
	this.__dragDropIndicatorSkin = null;
	this.__customItemRendererVariant = null;
	this.__layout = null;
	this.edgeAutoScrollDistance = 8.0;
	this._dragDropLastUpdateTime = -1;
	this._droppedOnSelf = false;
	this._dragIndex = -1;
	this._dragItem = null;
	this._dragMinDistance = 0.0;
	this._dragDropLocalY = 0.0;
	this._dragDropLocalX = 0.0;
	this._removeOnDragDropComplete = false;
	this._dropEnabled = false;
	this._dragEnabled = false;
	this._dragFormat = feathers_controls_ListView.DEFAULT_DRAG_FORMAT_ITEMS;
	this._ignoreLayoutChanges = false;
	this._ignoreSelectionChange = false;
	this._pendingScrollDuration = null;
	this._pendingScrollIndex = -1;
	this.pointerSelectionEnabled = true;
	this._virtualLayout = true;
	this._selectable = true;
	this._layoutItems = [];
	this._tempVisibleIndices = new feathers_layout_VirtualLayoutRange(0,0);
	this._visibleIndices = new feathers_layout_VirtualLayoutRange(0,0);
	this._virtualCache = [];
	this._unrenderedData = [];
	this.itemStatePool = new lime_utils_ObjectPool(function() {
		return new feathers_data_ListViewItemState();
	});
	this.itemRendererToItemState = new haxe_ds_ObjectMap();
	this.stringDataToItemRenderer = new haxe_ds_StringMap();
	this.objectDataToItemRenderer = new haxe_ds_ObjectMap();
	this._additionalStorage = null;
	this._defaultStorage = new feathers_controls__$ListView_ItemRendererStorage(null,feathers_utils_DisplayObjectRecycler.withClass(feathers_controls_dataRenderers_ItemRenderer));
	this._recyclerMap = null;
	this._forceItemStateUpdate = false;
	this._previousCustomItemRendererVariant = null;
	this._selectedItems = [];
	this._selectedIndices = [];
	this._selectionAnchorIndex = -1;
	this._allowMultipleSelection = false;
	this._selectedItem = null;
	this._selectedIndex = -1;
	this._childFocusEnabled = true;
	this.initializeListViewTheme();
	feathers_controls_supportClasses_BaseScrollContainer.call(this);
	this.set_dataProvider(dataProvider);
	this.set_tabEnabled(true);
	this.focusRect = null;
	if(this.get_viewPort() == null) {
		this.listViewPort = new feathers_controls_supportClasses_AdvancedLayoutViewPort();
		this.addChild(this.listViewPort);
		this.set_viewPort(this.listViewPort);
	}
	this.addEventListener("keyDown",$bind(this,this.listView_keyDownHandler));
	if(changeListener != null) {
		this.addEventListener("change",changeListener);
	}
};
$hxClasses["feathers.controls.ListView"] = feathers_controls_ListView;
feathers_controls_ListView.__name__ = "feathers.controls.ListView";
feathers_controls_ListView.__interfaces__ = [feathers_dragDrop_IDropTarget,feathers_dragDrop_IDragSource,feathers_core_IFocusContainer,feathers_core_IDataSelector,feathers_core_IIndexSelector];
feathers_controls_ListView.defaultUpdateItemRenderer = function(itemRenderer,state) {
	if(js_Boot.__implements(itemRenderer,feathers_core_ITextControl)) {
		var textControl = itemRenderer;
		textControl.set_text(state.text);
	}
};
feathers_controls_ListView.defaultResetItemRenderer = function(itemRenderer,state) {
	if(js_Boot.__implements(itemRenderer,feathers_core_ITextControl)) {
		var textControl = itemRenderer;
		textControl.set_text(null);
	}
};
feathers_controls_ListView.__super__ = feathers_controls_supportClasses_BaseScrollContainer;
feathers_controls_ListView.prototype = $extend(feathers_controls_supportClasses_BaseScrollContainer.prototype,{
	listViewPort: null
	,get_tabEnabled: function() {
		if((this._selectable || this.get_maxScrollY() != this.get_minScrollY() || this.get_maxScrollX() != this.get_minScrollX()) && this._enabled) {
			return this.get_rawTabEnabled();
		} else {
			return false;
		}
	}
	,_childFocusEnabled: null
	,get_childFocusEnabled: function() {
		if(this._enabled) {
			return this._childFocusEnabled;
		} else {
			return false;
		}
	}
	,set_childFocusEnabled: function(value) {
		if(this._childFocusEnabled == value) {
			return this._childFocusEnabled;
		}
		this._childFocusEnabled = value;
		return this._childFocusEnabled;
	}
	,_dataProvider: null
	,get_dataProvider: function() {
		return this._dataProvider;
	}
	,set_dataProvider: function(value) {
		if(this._dataProvider == value) {
			return this._dataProvider;
		}
		this._virtualCache.length = 0;
		if(this._dataProvider != null) {
			this._dataProvider.removeEventListener("change",$bind(this,this.listView_dataProvider_changeHandler));
			this._dataProvider.removeEventListener("addItem",$bind(this,this.listView_dataProvider_addItemHandler));
			this._dataProvider.removeEventListener("removeItem",$bind(this,this.listView_dataProvider_removeItemHandler));
			this._dataProvider.removeEventListener("replaceItem",$bind(this,this.listView_dataProvider_replaceItemHandler));
			this._dataProvider.removeEventListener("removeAll",$bind(this,this.listView_dataProvider_removeAllHandler));
			this._dataProvider.removeEventListener("reset",$bind(this,this.listView_dataProvider_resetHandler));
			this._dataProvider.removeEventListener("sortChange",$bind(this,this.listView_dataProvider_sortChangeHandler));
			this._dataProvider.removeEventListener("filterChange",$bind(this,this.listView_dataProvider_filterChangeHandler));
			this._dataProvider.removeEventListener("updateItem",$bind(this,this.listView_dataProvider_updateItemHandler));
			this._dataProvider.removeEventListener("updateAll",$bind(this,this.listView_dataProvider_updateAllHandler));
		}
		this._dataProvider = value;
		if(this._dataProvider != null) {
			this._virtualCache.length = this._dataProvider.get_length();
			this._dataProvider.addEventListener("change",$bind(this,this.listView_dataProvider_changeHandler));
			this._dataProvider.addEventListener("addItem",$bind(this,this.listView_dataProvider_addItemHandler));
			this._dataProvider.addEventListener("removeItem",$bind(this,this.listView_dataProvider_removeItemHandler));
			this._dataProvider.addEventListener("replaceItem",$bind(this,this.listView_dataProvider_replaceItemHandler));
			this._dataProvider.addEventListener("removeAll",$bind(this,this.listView_dataProvider_removeAllHandler));
			this._dataProvider.addEventListener("reset",$bind(this,this.listView_dataProvider_resetHandler));
			this._dataProvider.addEventListener("sortChange",$bind(this,this.listView_dataProvider_sortChangeHandler));
			this._dataProvider.addEventListener("filterChange",$bind(this,this.listView_dataProvider_filterChangeHandler));
			this._dataProvider.addEventListener("updateItem",$bind(this,this.listView_dataProvider_updateItemHandler));
			this._dataProvider.addEventListener("updateAll",$bind(this,this.listView_dataProvider_updateAllHandler));
		}
		this.set_scrollX(0.0);
		this.set_scrollY(0.0);
		this.set_selectedIndex(-1);
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		feathers_events_FeathersEvent.dispatch(this,"dataChange");
		return this._dataProvider;
	}
	,_selectedIndex: null
	,get_selectedIndex: function() {
		return this._selectedIndex;
	}
	,set_selectedIndex: function(value) {
		if(!this._selectable || this._dataProvider == null) {
			value = -1;
		}
		if(this._selectedIndex == value && this._selectedIndices.length <= 1) {
			return this._selectedIndex;
		}
		if(value == -1) {
			this._selectionAnchorIndex = -1;
			this._selectedIndex = -1;
			this._selectedItem = null;
			this._selectedIndices.length = 0;
			this._selectedItems.length = 0;
			this.setInvalid(feathers_core_InvalidationFlag.SELECTION);
			feathers_events_FeathersEvent.dispatch(this,"change");
			return this._selectedIndex;
		}
		this._selectedIndex = value;
		this._selectedItem = this._dataProvider.get(this._selectedIndex);
		this._selectedIndices.length = 1;
		this._selectedIndices[0] = this._selectedIndex;
		this._selectedItems.length = 1;
		this._selectedItems[0] = this._selectedItem;
		this._selectionAnchorIndex = this._selectedIndex;
		this.setInvalid(feathers_core_InvalidationFlag.SELECTION);
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._selectedIndex;
	}
	,get_maxSelectedIndex: function() {
		if(this._dataProvider == null) {
			return -1;
		}
		return this._dataProvider.get_length() - 1;
	}
	,_selectedItem: null
	,get_selectedItem: function() {
		return this._selectedItem;
	}
	,set_selectedItem: function(value) {
		if(value == null || !this._selectable || this._dataProvider == null) {
			this.set_selectedIndex(-1);
			return this._selectedItem;
		}
		var index = this._dataProvider.indexOf(value);
		if(index == -1) {
			this.set_selectedIndex(-1);
			return this._selectedItem;
		}
		if(this._selectedItem == value && this._selectedIndex == index && this._selectedIndices.length == 1) {
			return this._selectedItem;
		}
		this._selectedIndex = index;
		this._selectedItem = value;
		this._selectedIndices.length = 1;
		this._selectedIndices[0] = this._selectedIndex;
		this._selectedItems.length = 1;
		this._selectedItems[0] = this._selectedItem;
		this._selectionAnchorIndex = this._selectedIndex;
		this.setInvalid(feathers_core_InvalidationFlag.SELECTION);
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._selectedItem;
	}
	,_allowMultipleSelection: null
	,get_allowMultipleSelection: function() {
		return this._allowMultipleSelection;
	}
	,set_allowMultipleSelection: function(value) {
		if(this._allowMultipleSelection == value) {
			return this._allowMultipleSelection;
		}
		this._allowMultipleSelection = value;
		this.setInvalid(feathers_core_InvalidationFlag.SELECTION);
		return this._allowMultipleSelection;
	}
	,_selectionAnchorIndex: null
	,_selectedIndices: null
	,get_selectedIndices: function() {
		return this._selectedIndices;
	}
	,set_selectedIndices: function(value) {
		if(value == null || value.length == 0 || !this._selectable || this._dataProvider == null) {
			this.set_selectedIndex(-1);
			return this._selectedIndices;
		}
		if(this._selectedIndices == value) {
			return this._selectedIndices;
		}
		if(!this._allowMultipleSelection && value.length > 1) {
			value.length = 1;
		}
		this._selectedIndices = value;
		this._selectedIndex = this._selectedIndices[0];
		this._selectedItems.length = this._selectedIndices.length;
		var _g = 0;
		var _g1 = this._selectedIndices.length;
		while(_g < _g1) {
			var i = _g++;
			var index = this._selectedIndices[i];
			this._selectedItems[i] = this._dataProvider.get(index);
		}
		this._selectedItem = this._selectedItems[0];
		this._selectionAnchorIndex = this._selectedIndex;
		this.setInvalid(feathers_core_InvalidationFlag.SELECTION);
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._selectedIndices;
	}
	,_selectedItems: null
	,get_selectedItems: function() {
		return this._selectedItems;
	}
	,set_selectedItems: function(value) {
		if(value == null || value.length == 0 || !this._selectable || this._dataProvider == null) {
			this.set_selectedIndex(-1);
			return this._selectedItems;
		}
		if(this._selectedItems == value) {
			return this._selectedItems;
		}
		if(!this._allowMultipleSelection && value.length > 1) {
			value.length = 1;
		}
		var indices = [];
		var i = 0;
		while(i < value.length) {
			var item = value[i];
			var index = this._dataProvider.indexOf(item);
			if(index == -1) {
				value.splice(i,1);
				continue;
			}
			indices.push(index);
			++i;
		}
		this._selectedIndices = indices;
		this._selectedItems = value;
		if(value.length == 0) {
			this._selectedIndex = -1;
			this._selectedItem = null;
		} else {
			this._selectedIndex = this._selectedIndices[0];
			this._selectedItem = this._selectedItems[0];
		}
		this._selectionAnchorIndex = this._selectedIndex;
		this.setInvalid(feathers_core_InvalidationFlag.SELECTION);
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._selectedIndices;
	}
	,_previousLayout: null
	,_previousCustomItemRendererVariant: null
	,get_itemRendererRecycler: function() {
		return this._defaultStorage.itemRendererRecycler;
	}
	,set_itemRendererRecycler: function(value) {
		if(this._defaultStorage.itemRendererRecycler == value) {
			return this._defaultStorage.itemRendererRecycler;
		}
		this._defaultStorage.oldItemRendererRecycler = this._defaultStorage.itemRendererRecycler;
		this._defaultStorage.itemRendererRecycler = value;
		this._defaultStorage.measurements = null;
		this.setInvalid(feathers_controls_ListView.INVALIDATION_FLAG_ITEM_RENDERER_FACTORY);
		return this._defaultStorage.itemRendererRecycler;
	}
	,_forceItemStateUpdate: null
	,get_forceItemStateUpdate: function() {
		return this._forceItemStateUpdate;
	}
	,set_forceItemStateUpdate: function(value) {
		if(this._forceItemStateUpdate == value) {
			return this._forceItemStateUpdate;
		}
		this._forceItemStateUpdate = value;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		return this._forceItemStateUpdate;
	}
	,_recyclerMap: null
	,_itemRendererRecyclerIDFunction: null
	,get_itemRendererRecyclerIDFunction: function() {
		return this._itemRendererRecyclerIDFunction;
	}
	,set_itemRendererRecyclerIDFunction: function(value) {
		if(this._itemRendererRecyclerIDFunction == value) {
			return this._itemRendererRecyclerIDFunction;
		}
		this._itemRendererRecyclerIDFunction = value;
		this.setInvalid(feathers_controls_ListView.INVALIDATION_FLAG_ITEM_RENDERER_FACTORY);
		return this._itemRendererRecyclerIDFunction;
	}
	,_defaultStorage: null
	,_additionalStorage: null
	,objectDataToItemRenderer: null
	,stringDataToItemRenderer: null
	,itemRendererToItemState: null
	,itemStatePool: null
	,_unrenderedData: null
	,_virtualCache: null
	,_visibleIndices: null
	,_tempVisibleIndices: null
	,_layoutItems: null
	,_selectable: null
	,get_selectable: function() {
		return this._selectable;
	}
	,set_selectable: function(value) {
		if(this._selectable == value) {
			return this._selectable;
		}
		this._selectable = value;
		if(!this._selectable) {
			this.set_selectedIndex(-1);
		}
		return this._selectable;
	}
	,_virtualLayout: null
	,get_virtualLayout: function() {
		return this._virtualLayout;
	}
	,set_virtualLayout: function(value) {
		if(this._virtualLayout = value) {
			return this._virtualLayout;
		}
		this._virtualLayout = value;
		this.setInvalid(feathers_core_InvalidationFlag.LAYOUT);
		return this._virtualLayout;
	}
	,pointerSelectionEnabled: null
	,_pendingScrollIndex: null
	,_pendingScrollDuration: null
	,_ignoreSelectionChange: null
	,_ignoreLayoutChanges: null
	,_dragDropIndicatorSkinMeasurements: null
	,_dragFormat: null
	,get_dragFormat: function() {
		return this._dragFormat;
	}
	,set_dragFormat: function(value) {
		if(value == null) {
			value = feathers_controls_ListView.DEFAULT_DRAG_FORMAT_ITEMS;
		}
		if(this._dragFormat == value) {
			return this._dragFormat;
		}
		this._dragFormat = value;
		return this._dragFormat;
	}
	,_dragEnabled: null
	,get_dragEnabled: function() {
		return this._dragEnabled;
	}
	,set_dragEnabled: function(value) {
		if(this._dragEnabled == value) {
			return this._dragEnabled;
		}
		if(this._dragEnabled) {
			this.removeEventListener("dragComplete",$bind(this,this.listView_dragCompleteHandler));
		}
		this._dragEnabled = value;
		if(this._dragEnabled) {
			this.addEventListener("dragComplete",$bind(this,this.listView_dragCompleteHandler));
		}
		return this._dragEnabled;
	}
	,_dropEnabled: null
	,get_dropEnabled: function() {
		return this._dropEnabled;
	}
	,set_dropEnabled: function(value) {
		if(this._dropEnabled == value) {
			return this._dropEnabled;
		}
		if(this._dropEnabled) {
			this.removeEventListener("dragEnter",$bind(this,this.listView_dragEnterHandler));
			this.removeEventListener("dragExit",$bind(this,this.listView_dragExitHandler));
			this.removeEventListener("dragMove",$bind(this,this.listView_dragMoveHandler));
			this.removeEventListener("dragDrop",$bind(this,this.listView_dragDropHandler));
		}
		this._dropEnabled = value;
		if(this._dropEnabled) {
			this.addEventListener("dragEnter",$bind(this,this.listView_dragEnterHandler));
			this.addEventListener("dragExit",$bind(this,this.listView_dragExitHandler));
			this.addEventListener("dragMove",$bind(this,this.listView_dragMoveHandler));
			this.addEventListener("dragDrop",$bind(this,this.listView_dragDropHandler));
		}
		return this._dropEnabled;
	}
	,_removeOnDragDropComplete: null
	,get_removeOnDragDropComplete: function() {
		return this._removeOnDragDropComplete;
	}
	,set_removeOnDragDropComplete: function(value) {
		this._removeOnDragDropComplete = value;
		return this._removeOnDragDropComplete;
	}
	,_dragDropLocalX: null
	,_dragDropLocalY: null
	,_dragMinDistance: null
	,_dragItem: null
	,_dragIndex: null
	,_dragItemRenderer: null
	,_droppedOnSelf: null
	,_dragDropLastUpdateTime: null
	,edgeAutoScrollDistance: null
	,itemToText: function(data) {
		return Std.string(data);
	}
	,itemToEnabled: function(data) {
		return true;
	}
	,scrollToIndex: function(index,animationDuration) {
		if(this._dataProvider == null || this._dataProvider.get_length() == 0) {
			return;
		}
		this._pendingScrollIndex = index;
		this._pendingScrollDuration = animationDuration;
		this.setInvalid(feathers_core_InvalidationFlag.SCROLL);
	}
	,itemToItemRenderer: function(item) {
		if(item == null) {
			return null;
		}
		if(typeof(item) == "string") {
			return this.stringDataToItemRenderer.h[item];
		}
		return this.objectDataToItemRenderer.h[item.__id__];
	}
	,itemRendererToItem: function(itemRenderer) {
		if(itemRenderer == null) {
			return null;
		}
		var state = this.itemRendererToItemState.h[itemRenderer.__id__];
		if(state == null) {
			return null;
		}
		return state.data;
	}
	,indexToItemRenderer: function(index) {
		if(this._dataProvider == null || index < 0 || index >= this._dataProvider.get_length()) {
			return null;
		}
		var item = this._dataProvider.get(index);
		if(typeof(item) == "string") {
			return this.stringDataToItemRenderer.h[item];
		}
		return this.objectDataToItemRenderer.h[item.__id__];
	}
	,getItemRendererRecycler: function(id) {
		if(this._recyclerMap == null) {
			return null;
		}
		return this._recyclerMap.h[id];
	}
	,setItemRendererRecycler: function(id,recycler) {
		if(this._recyclerMap == null) {
			this._recyclerMap = new haxe_ds_StringMap();
		}
		if(recycler == null) {
			var _this = this._recyclerMap;
			if(Object.prototype.hasOwnProperty.call(_this.h,id)) {
				delete(_this.h[id]);
			}
			return;
		}
		this._recyclerMap.h[id] = recycler;
		this.setInvalid(feathers_controls_ListView.INVALIDATION_FLAG_ITEM_RENDERER_FACTORY);
	}
	,itemToItemState: function(item) {
		if(item == null) {
			return null;
		}
		var itemState = null;
		var itemRenderer = null;
		if(typeof(item) == "string") {
			itemRenderer = this.stringDataToItemRenderer.h[item];
		} else {
			itemRenderer = this.objectDataToItemRenderer.h[item.__id__];
		}
		if(itemRenderer != null) {
			itemState = this.itemRendererToItemState.h[itemRenderer.__id__];
		} else {
			var index = this._dataProvider.indexOf(item);
			if(index == -1) {
				return null;
			}
			itemState = new feathers_data_ListViewItemState();
			this.populateCurrentItemState(item,index,itemState,false);
		}
		return itemState;
	}
	,dispose: function() {
		this.refreshInactiveItemRenderers(this._defaultStorage,true);
		if(this._additionalStorage != null) {
			var _g = 0;
			var _g1 = this._additionalStorage.length;
			while(_g < _g1) {
				var i = _g++;
				var storage = this._additionalStorage[i];
				this.refreshInactiveItemRenderers(storage,true);
			}
		}
		this._selectedItem = null;
		this._selectedIndex = -1;
		this.set_dataProvider(null);
		feathers_controls_supportClasses_BaseScrollContainer.prototype.dispose.call(this);
	}
	,initializeListViewTheme: function() {
		feathers_themes_steel_components_SteelListViewStyles.initialize();
	}
	,update: function() {
		var layoutInvalid = this.isInvalid(feathers_core_InvalidationFlag.LAYOUT);
		var stylesInvalid = this.isInvalid(feathers_core_InvalidationFlag.STYLES);
		if(this._previousCustomItemRendererVariant != this.get_customItemRendererVariant()) {
			this.setInvalidationFlag(feathers_controls_ListView.INVALIDATION_FLAG_ITEM_RENDERER_FACTORY);
		}
		if(layoutInvalid || stylesInvalid) {
			if(this._previousLayout != this.get_layout()) {
				this._virtualCache.length = 0;
				if(this._dataProvider != null) {
					this._virtualCache.length = this._dataProvider.get_length();
				}
			}
			this.listViewPort.set_layout(this.get_layout());
			this._previousLayout = this.get_layout();
		}
		this.listViewPort.refreshChildren = $bind(this,this.refreshItemRenderers);
		var flag = this._invalidationFlags.keys();
		while(flag.hasNext()) {
			var flag1 = flag.next();
			this.listViewPort.setInvalid(flag1);
		}
		if(this._allInvalid) {
			this.listViewPort.setInvalid();
		}
		feathers_controls_supportClasses_BaseScrollContainer.prototype.update.call(this);
		this._previousCustomItemRendererVariant = this.get_customItemRendererVariant();
		this.handlePendingScroll();
	}
	,createScroller: function() {
		feathers_controls_supportClasses_BaseScrollContainer.prototype.createScroller.call(this);
		this.listViewPort.set_scroller(this.scroller);
	}
	,refreshScrollerValues: function() {
		feathers_controls_supportClasses_BaseScrollContainer.prototype.refreshScrollerValues.call(this);
		if(js_Boot.__implements(this.get_layout(),feathers_layout_IScrollLayout)) {
			var scrollLayout = this.get_layout();
			this.scroller.forceElasticTop = scrollLayout.get_elasticTop();
			this.scroller.forceElasticRight = scrollLayout.get_elasticRight();
			this.scroller.forceElasticBottom = scrollLayout.get_elasticBottom();
			this.scroller.forceElasticLeft = scrollLayout.get_elasticLeft();
		} else {
			this.scroller.forceElasticTop = false;
			this.scroller.forceElasticRight = false;
			this.scroller.forceElasticBottom = false;
			this.scroller.forceElasticLeft = false;
		}
		this.scroller.snapPositionsX = this.listViewPort.get_snapPositionsX();
		this.scroller.snapPositionsY = this.listViewPort.get_snapPositionsY();
	}
	,needsScrollMeasurement: function() {
		var oldStart = this._visibleIndices.start;
		var oldEnd = this._visibleIndices.end;
		if(this._virtualLayout && js_Boot.__implements(this.get_layout(),feathers_layout_IVirtualLayout)) {
			var virtualLayout = this.get_layout();
			var oldIgnoreLayoutChanges = this._ignoreLayoutChanges;
			this._ignoreLayoutChanges = true;
			virtualLayout.set_scrollX(this.scroller.get_scrollX());
			virtualLayout.set_scrollY(this.scroller.get_scrollY());
			this._ignoreLayoutChanges = oldIgnoreLayoutChanges;
			virtualLayout.getVisibleIndices(this._layoutItems.length,this.listViewPort.get_visibleWidth(),this.listViewPort.get_visibleHeight(),this._tempVisibleIndices);
		} else {
			this._tempVisibleIndices.start = 0;
			this._tempVisibleIndices.end = this._layoutItems.length - 1;
		}
		if(oldStart == this._tempVisibleIndices.start) {
			return oldEnd != this._tempVisibleIndices.end;
		} else {
			return true;
		}
	}
	,refreshItemRenderers: function(items) {
		this._layoutItems = items;
		if(this._defaultStorage.itemRendererRecycler.update == null) {
			this._defaultStorage.itemRendererRecycler.update = feathers_controls_ListView.defaultUpdateItemRenderer;
			if(this._defaultStorage.itemRendererRecycler.reset == null) {
				this._defaultStorage.itemRendererRecycler.reset = feathers_controls_ListView.defaultResetItemRenderer;
			}
		}
		if(this._recyclerMap != null) {
			var h = this._recyclerMap.h;
			var recycler_h = h;
			var recycler_keys = Object.keys(h);
			var recycler_length = recycler_keys.length;
			var recycler_current = 0;
			while(recycler_current < recycler_length) {
				var recycler = recycler_h[recycler_keys[recycler_current++]];
				if(recycler.update == null) {
					if(recycler.update == null) {
						recycler.update = feathers_controls_ListView.defaultUpdateItemRenderer;
						if(recycler.reset == null) {
							recycler.reset = feathers_controls_ListView.defaultResetItemRenderer;
						}
					}
				}
			}
		}
		var itemRendererInvalid = this.listViewPort.isInvalid(feathers_controls_ListView.INVALIDATION_FLAG_ITEM_RENDERER_FACTORY);
		this.refreshInactiveItemRenderers(this._defaultStorage,itemRendererInvalid);
		if(this._additionalStorage != null) {
			var _g = 0;
			var _g1 = this._additionalStorage.length;
			while(_g < _g1) {
				var i = _g++;
				var storage = this._additionalStorage[i];
				this.refreshInactiveItemRenderers(storage,itemRendererInvalid);
			}
		}
		this.findUnrenderedData();
		this.recoverInactiveItemRenderers(this._defaultStorage);
		if(this._additionalStorage != null) {
			var _g = 0;
			var _g1 = this._additionalStorage.length;
			while(_g < _g1) {
				var i = _g++;
				var storage = this._additionalStorage[i];
				this.recoverInactiveItemRenderers(storage);
			}
		}
		this.renderUnrenderedData();
		this.freeInactiveItemRenderers(this._defaultStorage);
		if(this._defaultStorage.inactiveItemRenderers.length > 0) {
			var c = js_Boot.getClass(this);
			throw new openfl_errors_IllegalOperationError("" + c.__name__ + ": inactive item renderers should be empty after updating.");
		}
		if(this._additionalStorage != null) {
			var _g = 0;
			var _g1 = this._additionalStorage.length;
			while(_g < _g1) {
				var i = _g++;
				var storage = this._additionalStorage[i];
				this.freeInactiveItemRenderers(storage);
				if(storage.inactiveItemRenderers.length > 0) {
					var c = js_Boot.getClass(this);
					throw new openfl_errors_IllegalOperationError("" + c.__name__ + ": inactive item renderers " + storage.id + " should be empty after updating.");
				}
			}
		}
	}
	,refreshInactiveItemRenderers: function(storage,factoryInvalid) {
		var temp = storage.inactiveItemRenderers;
		storage.inactiveItemRenderers = storage.activeItemRenderers;
		storage.activeItemRenderers = temp;
		if(storage.activeItemRenderers.length > 0) {
			var c = js_Boot.getClass(this);
			throw new openfl_errors_IllegalOperationError("" + c.__name__ + ": active item renderers should be empty before updating.");
		}
		if(factoryInvalid) {
			this.recoverInactiveItemRenderers(storage);
			this.freeInactiveItemRenderers(storage);
			storage.oldItemRendererRecycler = null;
		}
	}
	,recoverInactiveItemRenderers: function(storage) {
		var _g = 0;
		var _g1 = storage.inactiveItemRenderers;
		while(_g < _g1.length) {
			var itemRenderer = _g1[_g];
			++_g;
			if(itemRenderer == null) {
				continue;
			}
			var state = this.itemRendererToItemState.h[itemRenderer.__id__];
			if(state == null) {
				continue;
			}
			var item = state.data;
			this.itemRendererToItemState.remove(itemRenderer);
			if(typeof(item) == "string") {
				var _this = this.stringDataToItemRenderer;
				var key = item;
				if(Object.prototype.hasOwnProperty.call(_this.h,key)) {
					delete(_this.h[key]);
				}
			} else {
				this.objectDataToItemRenderer.remove(item);
			}
			itemRenderer.removeEventListener("trigger",$bind(this,this.listView_itemRenderer_triggerHandler));
			itemRenderer.removeEventListener("click",$bind(this,this.listView_itemRenderer_clickHandler));
			itemRenderer.removeEventListener("touchTap",$bind(this,this.listView_itemRenderer_touchTapHandler));
			itemRenderer.removeEventListener("change",$bind(this,this.listView_itemRenderer_changeHandler));
			itemRenderer.removeEventListener("resize",$bind(this,this.listView_itemRenderer_resizeHandler));
			itemRenderer.removeEventListener("mouseDown",$bind(this,this.listView_itemRenderer_mouseDownHandler));
			this.resetItemRenderer(itemRenderer,state,storage);
			if(storage.measurements != null) {
				storage.measurements.restore(itemRenderer);
			}
			this.itemStatePool.release(state);
		}
	}
	,freeInactiveItemRenderers: function(storage) {
		var recycler = storage.oldItemRendererRecycler != null ? storage.oldItemRendererRecycler : storage.itemRendererRecycler;
		var _g = 0;
		var _g1 = storage.inactiveItemRenderers;
		while(_g < _g1.length) {
			var itemRenderer = _g1[_g];
			++_g;
			if(itemRenderer == null) {
				continue;
			}
			this.destroyItemRenderer(itemRenderer,recycler);
		}
		storage.inactiveItemRenderers.length = 0;
	}
	,findUnrenderedData: function() {
		this._layoutItems.length = 0;
		this._visibleIndices.start = 0;
		this._visibleIndices.end = 0;
		if(this._dataProvider == null || this._dataProvider.get_length() == 0) {
			return;
		}
		this._layoutItems.length = this._dataProvider.get_length();
		if(this._virtualLayout && js_Boot.__implements(this.get_layout(),feathers_layout_IVirtualLayout)) {
			var virtualLayout = this.get_layout();
			var oldIgnoreLayoutChanges = this._ignoreLayoutChanges;
			this._ignoreLayoutChanges = true;
			virtualLayout.set_scrollX(this.scroller.get_scrollX());
			virtualLayout.set_scrollY(this.scroller.get_scrollY());
			virtualLayout.set_virtualCache(this._virtualCache);
			this._ignoreLayoutChanges = oldIgnoreLayoutChanges;
			virtualLayout.getVisibleIndices(this._dataProvider.get_length(),this.listViewPort.get_visibleWidth(),this.listViewPort.get_visibleHeight(),this._visibleIndices);
		} else {
			this._visibleIndices.start = 0;
			var tmp = this._dataProvider.get_length();
			this._visibleIndices.end = tmp - 1;
		}
		var _g = this._visibleIndices.start;
		var _g1 = this._visibleIndices.end + 1;
		while(_g < _g1) {
			var i = _g++;
			var item = this._dataProvider.get(i);
			var itemRenderer = null;
			if(typeof(item) == "string") {
				itemRenderer = this.stringDataToItemRenderer.h[item];
			} else {
				itemRenderer = this.objectDataToItemRenderer.h[item.__id__];
			}
			if(itemRenderer != null) {
				var state = this.itemRendererToItemState.h[itemRenderer.__id__];
				var changed = this.populateCurrentItemState(item,i,state,this._forceItemStateUpdate);
				var oldRecyclerID = state.recyclerID;
				var storage = this.itemStateToStorage(state);
				if(storage.id != oldRecyclerID) {
					this._unrenderedData.push(item);
					continue;
				}
				if(changed) {
					this.updateItemRenderer(itemRenderer,state,storage);
				}
				itemRenderer.set_visible(true);
				this._layoutItems[i] = itemRenderer;
				var removed = HxOverrides.remove(storage.inactiveItemRenderers,itemRenderer);
				if(!removed) {
					var c = js_Boot.getClass(this);
					throw new openfl_errors_IllegalOperationError("" + c.__name__ + ": item renderer map contains bad data for item at index " + i + ". This may be caused by duplicate items in the data provider, which is not allowed.");
				}
				storage.activeItemRenderers.push(itemRenderer);
			} else {
				this._unrenderedData.push(item);
			}
		}
	}
	,populateCurrentItemState: function(item,index,state,force) {
		var changed = false;
		if(force || state.owner != this) {
			state.owner = this;
			changed = true;
		}
		if(force || state.data != item) {
			state.data = item;
			changed = true;
		}
		if(force || state.index != index) {
			state.index = index;
			changed = true;
		}
		var selected = this._selectedIndices.indexOf(index) != -1;
		if(force || state.selected != selected) {
			state.selected = selected;
			changed = true;
		}
		var enabled = this._enabled && this.itemToEnabled(item);
		if(force || state.enabled != enabled) {
			state.enabled = enabled;
			changed = true;
		}
		var text = this.itemToText(item);
		if(force || state.text != text) {
			state.text = text;
			changed = true;
		}
		return changed;
	}
	,resetItemRenderer: function(itemRenderer,state,storage) {
		var oldIgnoreSelectionChange = this._ignoreSelectionChange;
		this._ignoreSelectionChange = true;
		var recycler = storage.oldItemRendererRecycler != null ? storage.oldItemRendererRecycler : storage.itemRendererRecycler;
		if(recycler != null && recycler.reset != null) {
			recycler.reset(itemRenderer,state);
		}
		this._ignoreSelectionChange = oldIgnoreSelectionChange;
		this.refreshItemRendererProperties(itemRenderer,feathers_controls_ListView.RESET_ITEM_STATE);
	}
	,updateItemRenderer: function(itemRenderer,state,storage) {
		state.recyclerID = storage.id;
		var oldIgnoreSelectionChange = this._ignoreSelectionChange;
		this._ignoreSelectionChange = true;
		if(storage.itemRendererRecycler.update != null) {
			storage.itemRendererRecycler.update(itemRenderer,state);
		}
		this._ignoreSelectionChange = oldIgnoreSelectionChange;
		this.refreshItemRendererProperties(itemRenderer,state);
	}
	,refreshItemRendererProperties: function(itemRenderer,state) {
		var oldIgnoreSelectionChange = this._ignoreSelectionChange;
		this._ignoreSelectionChange = true;
		if(js_Boot.__implements(itemRenderer,feathers_core_IUIControl)) {
			var uiControl = itemRenderer;
			uiControl.set_enabled(state.enabled);
		}
		if(js_Boot.__implements(itemRenderer,feathers_controls_dataRenderers_IDataRenderer)) {
			var dataRenderer = itemRenderer;
			dataRenderer.set_data(state.data);
		}
		if(js_Boot.__implements(itemRenderer,feathers_controls_dataRenderers_IListViewItemRenderer)) {
			var listRenderer = itemRenderer;
			listRenderer.set_index(state.index);
			listRenderer.set_listViewOwner(state.owner);
		}
		if(js_Boot.__implements(itemRenderer,feathers_layout_ILayoutIndexObject)) {
			var layoutIndexObject = itemRenderer;
			layoutIndexObject.set_layoutIndex(state.index);
		}
		if(js_Boot.__implements(itemRenderer,feathers_controls_IToggle)) {
			var toggle = itemRenderer;
			toggle.set_selected(state.selected);
		}
		this._ignoreSelectionChange = oldIgnoreSelectionChange;
	}
	,renderUnrenderedData: function() {
		var _g = 0;
		var _g1 = this._unrenderedData;
		while(_g < _g1.length) {
			var item = _g1[_g];
			++_g;
			var index = this._dataProvider.indexOf(item);
			var state = this.itemStatePool.get();
			this.populateCurrentItemState(item,index,state,true);
			var itemRenderer = this.createItemRenderer(state);
			itemRenderer.set_visible(true);
			this.listViewPort.addChild(itemRenderer);
			this._layoutItems[index] = itemRenderer;
		}
		this._unrenderedData.length = 0;
	}
	,createItemRenderer: function(state) {
		var storage = this.itemStateToStorage(state);
		var itemRenderer = null;
		if(storage.inactiveItemRenderers.length == 0) {
			itemRenderer = storage.itemRendererRecycler.create();
			if(js_Boot.__implements(itemRenderer,feathers_style_IVariantStyleObject)) {
				var variantItemRenderer = itemRenderer;
				if(variantItemRenderer.get_variant() == null) {
					var variant = this.get_customItemRendererVariant() != null ? this.get_customItemRendererVariant() : feathers_controls_ListView.CHILD_VARIANT_ITEM_RENDERER;
					variantItemRenderer.set_variant(variant);
				}
			}
			if(js_Boot.__implements(itemRenderer,feathers_core_IUIControl)) {
				itemRenderer.initializeNow();
			}
			if(storage.measurements == null) {
				storage.measurements = new feathers_layout_Measurements(itemRenderer);
			}
		} else {
			itemRenderer = storage.inactiveItemRenderers.shift();
		}
		this.updateItemRenderer(itemRenderer,state,storage);
		if(js_Boot.__implements(itemRenderer,feathers_controls_ITriggerView)) {
			itemRenderer.addEventListener("trigger",$bind(this,this.listView_itemRenderer_triggerHandler));
		} else {
			itemRenderer.addEventListener("click",$bind(this,this.listView_itemRenderer_clickHandler));
			itemRenderer.addEventListener("touchTap",$bind(this,this.listView_itemRenderer_touchTapHandler));
		}
		if(js_Boot.__implements(itemRenderer,feathers_controls_IToggle)) {
			itemRenderer.addEventListener("change",$bind(this,this.listView_itemRenderer_changeHandler));
		}
		if(js_Boot.__implements(itemRenderer,feathers_core_IMeasureObject)) {
			itemRenderer.addEventListener("resize",$bind(this,this.listView_itemRenderer_resizeHandler));
		}
		itemRenderer.addEventListener("mouseDown",$bind(this,this.listView_itemRenderer_mouseDownHandler));
		this.itemRendererToItemState.set(itemRenderer,state);
		var item = state.data;
		if(typeof(item) == "string") {
			this.stringDataToItemRenderer.h[item] = itemRenderer;
		} else {
			this.objectDataToItemRenderer.set(state.data,itemRenderer);
		}
		storage.activeItemRenderers.push(itemRenderer);
		return itemRenderer;
	}
	,destroyItemRenderer: function(itemRenderer,recycler) {
		this.listViewPort.removeChild(itemRenderer);
		if(recycler != null && recycler.destroy != null) {
			recycler.destroy(itemRenderer);
		}
	}
	,itemStateToStorage: function(state) {
		var recyclerID = null;
		if(this._itemRendererRecyclerIDFunction != null) {
			recyclerID = this._itemRendererRecyclerIDFunction(state);
		}
		var recycler = null;
		if(recyclerID != null) {
			if(this._recyclerMap != null) {
				recycler = this._recyclerMap.h[recyclerID];
			}
			if(recycler == null) {
				throw new openfl_errors_IllegalOperationError("Item renderer recycler ID \"" + recyclerID + "\" is not registered.");
			}
		}
		if(recycler == null) {
			return this._defaultStorage;
		}
		if(this._additionalStorage == null) {
			this._additionalStorage = [];
		}
		var _g = 0;
		var _g1 = this._additionalStorage.length;
		while(_g < _g1) {
			var i = _g++;
			var storage = this._additionalStorage[i];
			if(storage.itemRendererRecycler == recycler) {
				return storage;
			}
		}
		var storage = new feathers_controls__$ListView_ItemRendererStorage(recyclerID,recycler);
		this._additionalStorage.push(storage);
		return storage;
	}
	,refreshSelectedIndicesAfterFilterOrSort: function() {
		if(this._selectedIndex == -1) {
			return;
		}
		this.set_selectedIndex(this._dataProvider.indexOf(this._selectedItem));
	}
	,handleSelectionChange: function(item,index,ctrlKey,shiftKey) {
		if(index == -1 || !this._selectable) {
			this.set_selectedItem(null);
			return;
		}
		var selectionIndex = this._selectedItems.indexOf(item);
		if(this._allowMultipleSelection && (ctrlKey || shiftKey)) {
			if(shiftKey) {
				var anchorIndex = this._selectionAnchorIndex;
				if(anchorIndex == -1) {
					anchorIndex = 0;
				}
				var selectedIndices = [];
				if(index == anchorIndex) {
					selectedIndices.unshift(anchorIndex);
				} else {
					var i = anchorIndex;
					do {
						selectedIndices.unshift(i);
						i += anchorIndex > index ? -1 : 1;
					} while(i != index);
					if(index != anchorIndex) {
						selectedIndices.unshift(index);
					}
				}
				this.set_selectedIndices(selectedIndices);
				this._selectionAnchorIndex = anchorIndex;
			} else {
				if(selectionIndex == -1) {
					var selectedItems = this._selectedItems.slice();
					selectedItems.unshift(item);
					this.set_selectedItems(selectedItems);
				} else {
					var selectedItems = this._selectedItems.slice();
					selectedItems.splice(selectionIndex,1);
					this.set_selectedItems(selectedItems);
				}
				this._selectionAnchorIndex = index;
			}
		} else {
			this.set_selectedItem(item);
		}
		if(index != -1) {
			this.scrollToIndex(index);
		}
	}
	,handlePendingScroll: function() {
		if(this._pendingScrollIndex == -1) {
			return;
		}
		var index = this._pendingScrollIndex;
		var duration = this._pendingScrollDuration != null ? this._pendingScrollDuration : 0.0;
		this._pendingScrollIndex = -1;
		this._pendingScrollDuration = null;
		if(this._dataProvider == null || this._dataProvider.get_length() == 0) {
			return;
		}
		var targetX = this.get_scrollX();
		var targetY = this.get_scrollY();
		if(js_Boot.__implements(this.get_layout(),feathers_layout_IScrollLayout)) {
			var scrollLayout = this.get_layout();
			var result = scrollLayout.getNearestScrollPositionForIndex(index,this._dataProvider.get_length(),this.get_viewPort().get_visibleWidth(),this.get_viewPort().get_visibleHeight());
			targetX = result.x;
			targetY = result.y;
		} else {
			var item = this._dataProvider.get(index);
			var itemRenderer = null;
			if(typeof(item) == "string") {
				itemRenderer = this.stringDataToItemRenderer.h[item];
			} else {
				itemRenderer = this.objectDataToItemRenderer.h[item.__id__];
			}
			if(itemRenderer == null) {
				return;
			}
			var maxX = itemRenderer.get_x();
			var minX = maxX + itemRenderer.get_width() - this.get_viewPort().get_visibleWidth();
			if(targetX < minX) {
				targetX = minX;
			} else if(targetX > maxX) {
				targetX = maxX;
			}
			var maxY = itemRenderer.get_y();
			var minY = maxY + itemRenderer.get_height() - this.get_viewPort().get_visibleHeight();
			if(targetY < minY) {
				targetY = minY;
			} else if(targetY > maxY) {
				targetY = maxY;
			}
		}
		if(duration == 0.0) {
			this.scroller.stop();
			this.scroller.set_scrollX(targetX);
			this.scroller.set_scrollY(targetY);
		} else {
			this.scroller.throwTo(targetX,targetY,duration);
		}
	}
	,refreshDragDropIndexIndicator: function() {
		if(this.get_dragDropIndicatorSkin() == null || !js_Boot.__implements(this.get_layout(),feathers_layout_IDragDropLayout)) {
			return;
		}
		if(js_Boot.__implements(this.get_dragDropIndicatorSkin(),feathers_core_IUIControl)) {
			this.get_dragDropIndicatorSkin().initializeNow();
		}
		if(this._dragDropIndicatorSkinMeasurements == null) {
			this._dragDropIndicatorSkinMeasurements = new feathers_layout_Measurements(this.get_dragDropIndicatorSkin());
		} else {
			this._dragDropIndicatorSkinMeasurements.save(this.get_dragDropIndicatorSkin());
		}
		var dropX = this.get_scrollX() + this._dragDropLocalX - this.leftViewPortOffset;
		var dropY = this.get_scrollY() + this._dragDropLocalY - this.topViewPortOffset;
		var dropDropLayout = this.get_layout();
		var dragDropIndex = dropDropLayout.getDragDropIndex(this._layoutItems,dropX,dropY,this._viewPort.get_visibleWidth(),this._viewPort.get_visibleHeight());
		var dragDropRegion = dropDropLayout.getDragDropRegion(this._layoutItems,dragDropIndex,dropX,dropY,this._viewPort.get_visibleWidth(),this._viewPort.get_visibleHeight());
		this.get_dragDropIndicatorSkin().set_x(dragDropRegion.x - this.get_scrollX() + this.leftViewPortOffset);
		this.get_dragDropIndicatorSkin().set_y(dragDropRegion.y - this.get_scrollY() + this.topViewPortOffset);
		if(dragDropRegion.width == 0.0) {
			this.get_dragDropIndicatorSkin().set_height(dragDropRegion.height);
		} else {
			this.get_dragDropIndicatorSkin().set_width(dragDropRegion.width);
		}
		this.addChild(this.get_dragDropIndicatorSkin());
	}
	,listView_itemRenderer_touchTapHandler: function(event) {
		if(!this._enabled) {
			return;
		}
		if(event.isPrimaryTouchPoint) {
			return;
		}
		var itemRenderer = js_Boot.__cast(event.currentTarget , openfl_display_DisplayObject);
		var state = this.itemRendererToItemState.h[itemRenderer.__id__];
		feathers_events_ListViewEvent.dispatch(this,"itemTrigger",state);
		if(!this._selectable || !this.pointerSelectionEnabled) {
			return;
		}
		this.handleSelectionChange(state.data,state.index,event.ctrlKey,event.shiftKey);
	}
	,listView_itemRenderer_clickHandler: function(event) {
		if(!this._enabled) {
			return;
		}
		var itemRenderer = js_Boot.__cast(event.currentTarget , openfl_display_DisplayObject);
		var state = this.itemRendererToItemState.h[itemRenderer.__id__];
		feathers_events_ListViewEvent.dispatch(this,"itemTrigger",state);
		if(!this._selectable || !this.pointerSelectionEnabled) {
			return;
		}
		this.handleSelectionChange(state.data,state.index,event.ctrlKey,event.shiftKey);
	}
	,listView_itemRenderer_triggerHandler: function(event) {
		if(!this._enabled) {
			return;
		}
		var itemRenderer = js_Boot.__cast(event.currentTarget , openfl_display_DisplayObject);
		var state = this.itemRendererToItemState.h[itemRenderer.__id__];
		feathers_events_ListViewEvent.dispatch(this,"itemTrigger",state);
		if(!this._selectable) {
			return;
		}
		this.handleSelectionChange(state.data,state.index,event.ctrlKey,event.shiftKey);
	}
	,listView_itemRenderer_resizeHandler: function(event) {
		if(this._validating) {
			return;
		}
		this.setInvalid(feathers_core_InvalidationFlag.LAYOUT);
	}
	,listView_itemRenderer_changeHandler: function(event) {
		if(this._ignoreSelectionChange) {
			return;
		}
		var itemRenderer = js_Boot.__cast(event.currentTarget , openfl_display_DisplayObject);
		var toggleItemRenderer = js_Boot.__cast(itemRenderer , feathers_controls_IToggle);
		var state = this.itemRendererToItemState.h[itemRenderer.__id__];
		if(toggleItemRenderer.get_selected() == state.selected) {
			return;
		}
		this.setInvalid(feathers_core_InvalidationFlag.SELECTION);
	}
	,listView_itemRenderer_mouseDownHandler: function(event) {
		if(!this._enabled || !this._dragEnabled || this.stage == null) {
			return;
		}
		var itemRenderer = js_Boot.__cast(event.currentTarget , openfl_display_DisplayObject);
		var state = this.itemRendererToItemState.h[itemRenderer.__id__];
		if(state == null) {
			return;
		}
		this._dragItemRenderer = itemRenderer;
		this._dragItem = state.data;
		this._dragIndex = state.index;
		this._dragDropLocalX = this.get_mouseX();
		this._dragDropLocalY = this.get_mouseY();
		this._dragMinDistance = 6.0;
		this.stage.addEventListener("mouseMove",$bind(this,this.listView_stage_pressAndMove_mouseMoveHandler),false,0,true);
		this.stage.addEventListener("mouseUp",$bind(this,this.listView_stage_pressAndMove_mouseUpHandler),false,0,true);
	}
	,listView_stage_pressAndMove_mouseMoveHandler: function(event) {
		var offsetX = this.get_mouseX() - this._dragDropLocalX;
		var offsetY = this.get_mouseY() - this._dragDropLocalY;
		if(offsetX > this._dragMinDistance || offsetY > this._dragMinDistance) {
			var stage = js_Boot.__cast(event.currentTarget , openfl_display_Stage);
			stage.removeEventListener("mouseMove",$bind(this,this.listView_stage_pressAndMove_mouseMoveHandler));
			stage.removeEventListener("mouseUp",$bind(this,this.listView_stage_pressAndMove_mouseUpHandler));
			var items = [];
			var draggedIndices = this._allowMultipleSelection ? this._selectedIndices.slice() : [];
			if(draggedIndices.indexOf(this._dragIndex) == -1) {
				draggedIndices.push(this._dragIndex);
			}
			draggedIndices.sort(function(a,b) {
				if(a < b) {
					return -1;
				}
				if(a > b) {
					return 1;
				}
				return 0;
			});
			var _g = 0;
			while(_g < draggedIndices.length) {
				var dragIndex = draggedIndices[_g];
				++_g;
				items.push(this._dataProvider.get(dragIndex));
			}
			var dragData = new feathers_dragDrop_DragData();
			dragData.set(this._dragFormat,items);
			var itemState = this.itemRendererToItemState.h[this._dragItemRenderer.__id__];
			var storage = this.itemStateToStorage(itemState);
			var itemRenderer = storage.itemRendererRecycler.create();
			this.updateItemRenderer(itemRenderer,itemState,storage);
			itemRenderer.set_width(this._dragItemRenderer.get_width());
			itemRenderer.set_height(this._dragItemRenderer.get_height());
			feathers_dragDrop_DragDropManager.startDrag(this,dragData,itemRenderer,-this._dragItemRenderer.get_mouseX(),-this._dragItemRenderer.get_mouseY());
		}
	}
	,listView_stage_pressAndMove_mouseUpHandler: function(event) {
		var stage = js_Boot.__cast(event.currentTarget , openfl_display_Stage);
		stage.removeEventListener("mouseMove",$bind(this,this.listView_stage_pressAndMove_mouseMoveHandler));
		stage.removeEventListener("mouseUp",$bind(this,this.listView_stage_pressAndMove_mouseUpHandler));
		this._dragItem = null;
		this._dragIndex = -1;
		this._dragItemRenderer = null;
	}
	,listView_dragCompleteHandler: function(event) {
		if(!event.dropped) {
			return;
		}
		if(this._droppedOnSelf) {
			this._droppedOnSelf = false;
			return;
		}
		if(!this._removeOnDragDropComplete) {
			return;
		}
		var droppedItems = js_Boot.__cast(event.dragData.get(this._dragFormat) , Array);
		var _g = 0;
		while(_g < droppedItems.length) {
			var droppedItem = droppedItems[_g];
			++_g;
			this._dataProvider.remove(droppedItem);
		}
	}
	,listView_dragEnterHandler: function(event) {
		if(!this._enabled || !this._dropEnabled || !event.dragData.exists(this._dragFormat)) {
			return;
		}
		event.acceptDrag(this);
		this.showFocus(true);
		this._dragDropLocalX = event.localX;
		this._dragDropLocalY = event.localY;
		this.refreshDragDropIndexIndicator();
		this._dragDropLastUpdateTime = openfl_Lib.getTimer();
		this.addEventListener("enterFrame",$bind(this,this.listView_dragScroll_enterFrameHandler));
	}
	,listView_dragExitHandler: function(event) {
		if(this.get_dragDropIndicatorSkin() != null) {
			this._dragDropIndicatorSkinMeasurements.restore(this.get_dragDropIndicatorSkin());
			if(this.get_dragDropIndicatorSkin().parent == this) {
				this.removeChild(this.get_dragDropIndicatorSkin());
			}
		}
		this.showFocus(false);
		this._dragDropLastUpdateTime = -1;
		this.removeEventListener("enterFrame",$bind(this,this.listView_dragScroll_enterFrameHandler));
	}
	,listView_dragScroll_enterFrameHandler: function(event) {
		var currentTime = openfl_Lib.getTimer();
		var passedTime = currentTime - this._dragDropLastUpdateTime;
		this._dragDropLastUpdateTime = currentTime;
		var dragX = this._dragDropLocalX - this.leftViewPortOffset;
		var dragY = this._dragDropLocalY - this.topViewPortOffset;
		var velocity = passedTime / 2.0;
		if(this.get_maxScrollY() > this.get_minScrollY()) {
			if(this.get_scrollY() < this.get_maxScrollY() && dragY > this._viewPort.get_visibleHeight() - this.edgeAutoScrollDistance) {
				velocity *= 1.0 - (this._viewPort.get_visibleHeight() - dragY) / this.edgeAutoScrollDistance;
			} else if(this.get_scrollY() > this.get_minScrollY() && dragY < this.edgeAutoScrollDistance) {
				velocity *= -(1.0 - dragY / this.edgeAutoScrollDistance);
			} else {
				velocity = 0.0;
			}
			if(velocity != 0.0) {
				var newScrollY = this.get_scrollY() + velocity;
				if(newScrollY > this.get_maxScrollY()) {
					newScrollY = this.get_maxScrollY();
				} else if(newScrollY < this.get_minScrollY()) {
					newScrollY = this.get_minScrollY();
				}
				this.set_scrollY(newScrollY);
			}
		}
		if(this.get_maxScrollX() > this.get_minScrollX()) {
			if(this.get_scrollX() < this.get_maxScrollX() && dragX > this._viewPort.get_visibleWidth() - this.edgeAutoScrollDistance) {
				velocity *= 1.0 - (this._viewPort.get_visibleWidth() - dragX) / this.edgeAutoScrollDistance;
			} else if(this.get_scrollX() > this.get_minScrollX() && dragX < this.edgeAutoScrollDistance) {
				velocity *= -(1.0 - dragX / this.edgeAutoScrollDistance);
			} else {
				velocity = 0.0;
			}
			if(velocity != 0.0) {
				var newScrollX = this.get_scrollX() + velocity;
				if(newScrollX > this.get_maxScrollX()) {
					newScrollX = this.get_maxScrollX();
				} else if(newScrollX < this.get_minScrollX()) {
					newScrollX = this.get_minScrollX();
				}
				this.set_scrollX(newScrollX);
			}
		}
		this.refreshDragDropIndexIndicator();
	}
	,listView_dragMoveHandler: function(event) {
		if(!this._enabled || !this._dropEnabled || !event.dragData.exists(this._dragFormat)) {
			return;
		}
		this._dragDropLocalX = event.localX;
		this._dragDropLocalY = event.localY;
		this.refreshDragDropIndexIndicator();
	}
	,listView_dragDropHandler: function(event) {
		if(this.get_dragDropIndicatorSkin() != null && this.get_dragDropIndicatorSkin().parent == this) {
			this._dragDropIndicatorSkinMeasurements.restore(this.get_dragDropIndicatorSkin());
			this.removeChild(this.get_dragDropIndicatorSkin());
		}
		this.showFocus(false);
		this._dragDropLastUpdateTime = -1;
		this.removeEventListener("enterFrame",$bind(this,this.listView_dragScroll_enterFrameHandler));
		this._droppedOnSelf = false;
		if(!this._enabled || !this._dropEnabled || !event.dragData.exists(this._dragFormat)) {
			return;
		}
		var droppedItems = js_Boot.__cast(event.dragData.get(this._dragFormat) , Array);
		var dragDropIndex = this._dataProvider.get_length();
		if(js_Boot.__implements(this.get_layout(),feathers_layout_IDragDropLayout)) {
			var dragDropLayout = this.get_layout();
			var dropX = this.get_scrollX() + event.localX - this.leftViewPortOffset;
			var dropY = this.get_scrollY() + event.localY - this.topViewPortOffset;
			dragDropIndex = dragDropLayout.getDragDropIndex(this._layoutItems,dropX,dropY,this._viewPort.get_visibleWidth(),this._viewPort.get_visibleHeight());
		}
		var dropOffset = 0;
		if(event.dragSource == this) {
			var _g = 0;
			while(_g < droppedItems.length) {
				var droppedItem = droppedItems[_g];
				++_g;
				var oldIndex = this._dataProvider.indexOf(droppedItem);
				if(oldIndex < dragDropIndex) {
					--dropOffset;
				}
				this._dataProvider.removeAt(oldIndex);
			}
			this._droppedOnSelf = true;
		}
		var _g = 0;
		var _g1 = droppedItems.length;
		while(_g < _g1) {
			var i = _g++;
			var droppedItem = droppedItems[i];
			this._dataProvider.addAt(droppedItem,dragDropIndex + dropOffset + i);
		}
	}
	,listView_dataProvider_changeHandler: function(event) {
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
	}
	,listView_dataProvider_addItemHandler: function(event) {
		if(this._virtualCache != null) {
			this._virtualCache.splice(event.index,0,null);
		}
		if(this._selectedIndex == -1) {
			return;
		}
		var changed = false;
		var _g = 0;
		var _g1 = this._selectedIndices.length;
		while(_g < _g1) {
			var i = _g++;
			var selectedIndex = this._selectedIndices[i];
			if(selectedIndex >= event.index) {
				this._selectedIndices[i] = selectedIndex + 1;
				changed = true;
			}
		}
		if(changed) {
			this._selectedIndex = this._selectedIndices[0];
			feathers_events_FeathersEvent.dispatch(this,"change");
		}
	}
	,listView_dataProvider_removeItemHandler: function(event) {
		if(this._virtualCache != null) {
			HxOverrides.remove(this._virtualCache,event.index);
		}
		if(this.get_selectedIndex() == -1) {
			return;
		}
		var changed = false;
		var i = this._selectedIndices.length - 1;
		while(i >= 0) {
			var selectedIndex = this._selectedIndices[i];
			if(selectedIndex == event.index) {
				this._selectedIndices.splice(i,1);
				this._selectedItems.splice(i,1);
				changed = true;
			} else if(selectedIndex > event.index) {
				this._selectedIndices[i] = selectedIndex - 1;
				changed = true;
			}
			--i;
		}
		if(changed) {
			if(this._selectedIndices.length > 0) {
				this._selectedIndex = this._selectedIndices[0];
				this._selectedItem = this._dataProvider.get(this._selectedIndex);
			} else {
				this._selectedIndex = -1;
				this._selectedItem = null;
			}
			feathers_events_FeathersEvent.dispatch(this,"change");
		}
	}
	,listView_dataProvider_replaceItemHandler: function(event) {
		if(this._virtualCache != null) {
			this._virtualCache[event.index] = null;
		}
		if(this._selectedIndex == -1) {
			return;
		}
		var _g = 0;
		var _g1 = this._selectedIndices.length;
		while(_g < _g1) {
			var i = _g++;
			var selectedIndex = this._selectedIndices[i];
			if(selectedIndex == event.index) {
				this._selectedItems[i] = this._dataProvider.get(selectedIndex);
				this._selectedItem = this._selectedItems[0];
				feathers_events_FeathersEvent.dispatch(this,"change");
				break;
			}
		}
	}
	,listView_dataProvider_removeAllHandler: function(event) {
		if(this._virtualCache != null) {
			this._virtualCache.length = 0;
		}
		this.set_selectedIndex(-1);
	}
	,listView_dataProvider_resetHandler: function(event) {
		if(this._virtualCache != null) {
			this._virtualCache.length = 0;
			this._virtualCache.length = this._dataProvider.get_length();
		}
		this.set_selectedIndex(-1);
	}
	,listView_dataProvider_sortChangeHandler: function(event) {
		if(this._virtualCache != null) {
			this._virtualCache.length = 0;
			this._virtualCache.length = this._dataProvider.get_length();
		}
		this.refreshSelectedIndicesAfterFilterOrSort();
	}
	,listView_dataProvider_filterChangeHandler: function(event) {
		if(this._virtualCache != null) {
			this._virtualCache.length = 0;
			this._virtualCache.length = this._dataProvider.get_length();
		}
		this.refreshSelectedIndicesAfterFilterOrSort();
	}
	,updateItemRendererForIndex: function(index) {
		if(this._virtualCache != null) {
			this._virtualCache[index] = null;
		}
		var item = this._dataProvider.get(index);
		var itemRenderer = null;
		if(typeof(item) == "string") {
			itemRenderer = this.stringDataToItemRenderer.h[item];
		} else {
			itemRenderer = this.objectDataToItemRenderer.h[item.__id__];
		}
		if(itemRenderer == null) {
			this.setInvalid(feathers_core_InvalidationFlag.DATA);
			return;
		}
		var state = this.itemRendererToItemState.h[itemRenderer.__id__];
		if(state.owner == null) {
			return;
		}
		var storage = this.itemStateToStorage(state);
		this.populateCurrentItemState(item,index,state,true);
		this.resetItemRenderer(itemRenderer,state,storage);
		if(storage.measurements != null) {
			storage.measurements.restore(itemRenderer);
		}
		state.owner = null;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
	}
	,listView_dataProvider_updateItemHandler: function(event) {
		this.updateItemRendererForIndex(event.index);
	}
	,listView_dataProvider_updateAllHandler: function(event) {
		var _g = 0;
		var _g1 = this._dataProvider.get_length();
		while(_g < _g1) {
			var i = _g++;
			this.updateItemRendererForIndex(i);
		}
	}
	,navigateWithKeyboard: function(event) {
		if(event.isDefaultPrevented()) {
			return;
		}
		if(this._dataProvider == null || this._dataProvider.get_length() == 0) {
			return;
		}
		var result = this._selectedIndex;
		if(js_Boot.__implements(this.get_layout(),feathers_layout_IKeyboardNavigationLayout)) {
			if(event.keyCode != 38 && event.keyCode != 40 && event.keyCode != 37 && event.keyCode != 39 && event.keyCode != 33 && event.keyCode != 34 && event.keyCode != 36 && event.keyCode != 35) {
				return;
			}
			result = (js_Boot.__cast(this.get_layout() , feathers_layout_IKeyboardNavigationLayout)).findNextKeyboardIndex(result,event,false,this._layoutItems,null,this.listViewPort.get_visibleWidth(),this.listViewPort.get_visibleHeight());
		} else {
			switch(event.keyCode) {
			case 33:
				--result;
				break;
			case 34:
				++result;
				break;
			case 35:
				result = this._dataProvider.get_length() - 1;
				break;
			case 36:
				result = 0;
				break;
			case 37:
				--result;
				break;
			case 38:
				--result;
				break;
			case 39:
				++result;
				break;
			case 40:
				++result;
				break;
			default:
				return;
			}
		}
		if(result < 0) {
			result = 0;
		} else if(result >= this._dataProvider.get_length()) {
			result = this._dataProvider.get_length() - 1;
		}
		var changed = this._selectedIndex != result;
		if(!changed && result != -1) {
			var itemRenderer = this.itemToItemRenderer(this._dataProvider.get(result));
			if(itemRenderer == null) {
				changed = true;
			} else if(js_Boot.__implements(this.get_layout(),feathers_layout_IScrollLayout)) {
				var scrollLayout = this.get_layout();
				var nearestScrollPosition = scrollLayout.getNearestScrollPositionForIndex(result,this._dataProvider.get_length(),this.get_viewPort().get_visibleWidth(),this.get_viewPort().get_visibleHeight());
				if(this.get_scrollX() != nearestScrollPosition.x || this.get_scrollY() != nearestScrollPosition.y) {
					changed = true;
				}
			}
		}
		if(!changed) {
			return;
		}
		event.preventDefault();
		this.set_selectedIndex(result);
		if(this._selectedIndex != -1) {
			this.scrollToIndex(this._selectedIndex);
		}
		if(this._focusManager != null) {
			this._focusManager.set_focus(this);
		} else if(this.stage != null) {
			this.stage.set_focus(this);
		}
	}
	,baseScrollContainer_keyDownHandler: function(event) {
		if(!this._selectable) {
			feathers_controls_supportClasses_BaseScrollContainer.prototype.baseScrollContainer_keyDownHandler.call(this,event);
			return;
		}
		if(!this._enabled || event.isDefaultPrevented()) {
			return;
		}
		if(this.stage != null && ((this.stage.get_focus()) instanceof openfl_text_TextField)) {
			var textField = this.stage.get_focus();
			if(textField.get_type() == 1) {
				return;
			}
		}
		this.navigateWithKeyboard(event);
	}
	,listView_keyDownHandler: function(event) {
		if(!this._enabled || event.isDefaultPrevented()) {
			return;
		}
		if(event.keyCode == 32 || event.keyCode == 13) {
			if(this._selectedItem != null) {
				var itemRenderer = null;
				if(typeof(this._selectedItem) == "string") {
					itemRenderer = this.stringDataToItemRenderer.h[this._selectedItem];
				} else {
					itemRenderer = this.objectDataToItemRenderer.h[this._selectedItem.__id__];
				}
				var state = null;
				if(itemRenderer != null) {
					state = this.itemRendererToItemState.h[itemRenderer.__id__];
				}
				var isTemporary = false;
				if(state == null) {
					isTemporary = true;
					state = this.itemStatePool.get();
				}
				this.populateCurrentItemState(this._selectedItem,this._selectedIndex,state,true);
				feathers_events_ListViewEvent.dispatch(this,"itemTrigger",state);
				if(isTemporary) {
					this.itemStatePool.release(state);
				}
			}
		}
	}
	,get_styleContext: function() {
		return feathers_controls_ListView;
	}
	,__layout: null
	,get_layout: function() {
		return this.__layout;
	}
	,set_layout: function(value) {
		if(!this.setStyle("layout")) {
			return this.__layout;
		}
		if(this.__layout == value) {
			return this.__layout;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_layout);
		this.__layout = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__layout;
	}
	,clearStyle_layout: function() {
		this.set_layout(null);
		return this.get_layout();
	}
	,__customItemRendererVariant: null
	,get_customItemRendererVariant: function() {
		return this.__customItemRendererVariant;
	}
	,set_customItemRendererVariant: function(value) {
		if(!this.setStyle("customItemRendererVariant")) {
			return this.__customItemRendererVariant;
		}
		if(this.__customItemRendererVariant == value) {
			return this.__customItemRendererVariant;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_customItemRendererVariant);
		this.__customItemRendererVariant = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__customItemRendererVariant;
	}
	,clearStyle_customItemRendererVariant: function() {
		this.set_customItemRendererVariant(null);
		return this.get_customItemRendererVariant();
	}
	,__dragDropIndicatorSkin: null
	,get_dragDropIndicatorSkin: function() {
		return this.__dragDropIndicatorSkin;
	}
	,set_dragDropIndicatorSkin: function(value) {
		if(!this.setStyle("dragDropIndicatorSkin")) {
			return this.__dragDropIndicatorSkin;
		}
		if(this.__dragDropIndicatorSkin == value) {
			return this.__dragDropIndicatorSkin;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_dragDropIndicatorSkin);
		this.__dragDropIndicatorSkin = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__dragDropIndicatorSkin;
	}
	,clearStyle_dragDropIndicatorSkin: function() {
		this.set_dragDropIndicatorSkin(null);
		return this.get_dragDropIndicatorSkin();
	}
	,__class__: feathers_controls_ListView
	,__properties__: $extend(feathers_controls_supportClasses_BaseScrollContainer.prototype.__properties__,{set_removeOnDragDropComplete:"set_removeOnDragDropComplete",get_removeOnDragDropComplete:"get_removeOnDragDropComplete",set_dropEnabled:"set_dropEnabled",get_dropEnabled:"get_dropEnabled",set_dragEnabled:"set_dragEnabled",get_dragEnabled:"get_dragEnabled",set_dragFormat:"set_dragFormat",get_dragFormat:"get_dragFormat",set_dragDropIndicatorSkin:"set_dragDropIndicatorSkin",get_dragDropIndicatorSkin:"get_dragDropIndicatorSkin",set_virtualLayout:"set_virtualLayout",get_virtualLayout:"get_virtualLayout",set_selectable:"set_selectable",get_selectable:"get_selectable",set_itemRendererRecyclerIDFunction:"set_itemRendererRecyclerIDFunction",get_itemRendererRecyclerIDFunction:"get_itemRendererRecyclerIDFunction",set_forceItemStateUpdate:"set_forceItemStateUpdate",get_forceItemStateUpdate:"get_forceItemStateUpdate",set_itemRendererRecycler:"set_itemRendererRecycler",get_itemRendererRecycler:"get_itemRendererRecycler",set_customItemRendererVariant:"set_customItemRendererVariant",get_customItemRendererVariant:"get_customItemRendererVariant",set_layout:"set_layout",get_layout:"get_layout",set_selectedItems:"set_selectedItems",get_selectedItems:"get_selectedItems",set_selectedIndices:"set_selectedIndices",get_selectedIndices:"get_selectedIndices",set_allowMultipleSelection:"set_allowMultipleSelection",get_allowMultipleSelection:"get_allowMultipleSelection",set_selectedItem:"set_selectedItem",get_selectedItem:"get_selectedItem",get_maxSelectedIndex:"get_maxSelectedIndex",set_selectedIndex:"set_selectedIndex",get_selectedIndex:"get_selectedIndex",set_dataProvider:"set_dataProvider",get_dataProvider:"get_dataProvider",set_childFocusEnabled:"set_childFocusEnabled",get_childFocusEnabled:"get_childFocusEnabled"})
});
var feathers_controls_PopUpListView = function(dataProvider,changeListener) {
	this.__customListViewVariant = null;
	this.__customButtonVariant = null;
	this.__popUpAdapter = null;
	this._previousCustomListViewVariant = null;
	this._previousCustomButtonVariant = null;
	this._itemRendererRecycler = feathers_utils_DisplayObjectRecycler.withClass(feathers_controls_dataRenderers_ItemRenderer);
	this._selectedItem = null;
	this._selectedIndex = -1;
	this._ignoreListViewChange = false;
	this.buttonMeasurements = new feathers_layout_Measurements();
	this.initializePopUpListViewTheme();
	feathers_core_FeathersControl.call(this);
	this.set_dataProvider(dataProvider);
	this.addEventListener("focusIn",$bind(this,this.popUpListView_focusInHandler));
	this.addEventListener("removedFromStage",$bind(this,this.popUpListView_removedFromStageHandler));
	if(changeListener != null) {
		this.addEventListener("change",changeListener);
	}
};
$hxClasses["feathers.controls.PopUpListView"] = feathers_controls_PopUpListView;
feathers_controls_PopUpListView.__name__ = "feathers.controls.PopUpListView";
feathers_controls_PopUpListView.__interfaces__ = [feathers_core_IStageFocusDelegate,feathers_core_IDataSelector,feathers_core_IIndexSelector];
feathers_controls_PopUpListView.__super__ = feathers_core_FeathersControl;
feathers_controls_PopUpListView.prototype = $extend(feathers_core_FeathersControl.prototype,{
	button: null
	,listView: null
	,buttonMeasurements: null
	,get_stageFocusTarget: function() {
		return this.button;
	}
	,_dataProvider: null
	,get_dataProvider: function() {
		return this._dataProvider;
	}
	,set_dataProvider: function(value) {
		if(this._dataProvider == value) {
			return this._dataProvider;
		}
		if(this._dataProvider != null) {
			this._dataProvider.removeEventListener("removeAll",$bind(this,this.popUpListView_dataProvider_removeAllHandler));
		}
		var oldSelectedIndex = this._selectedIndex;
		var oldSelectedItem = this._selectedItem;
		this._dataProvider = value;
		if(this._dataProvider != null) {
			this._dataProvider.addEventListener("removeAll",$bind(this,this.popUpListView_dataProvider_removeAllHandler));
		}
		if(this._dataProvider == null || this._dataProvider.get_length() == 0) {
			this._selectedIndex = -1;
			this._selectedItem = null;
		} else {
			this._selectedIndex = 0;
			this._selectedItem = this._dataProvider.get(0);
		}
		if(this._selectedIndex != oldSelectedIndex || this._selectedItem != oldSelectedItem) {
			this.setInvalid(feathers_core_InvalidationFlag.SELECTION);
			feathers_events_FeathersEvent.dispatch(this,"change");
		}
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		feathers_events_FeathersEvent.dispatch(this,"dataChange");
		return this._dataProvider;
	}
	,_ignoreListViewChange: null
	,_selectedIndex: null
	,get_selectedIndex: function() {
		return this._selectedIndex;
	}
	,set_selectedIndex: function(value) {
		if(this._dataProvider == null) {
			value = -1;
		}
		if(this._selectedIndex == value) {
			return this._selectedIndex;
		}
		this._selectedIndex = value;
		if(this._selectedIndex == -1) {
			this._selectedItem = null;
		} else {
			this._selectedItem = this._dataProvider.get(this._selectedIndex);
		}
		this.setInvalid(feathers_core_InvalidationFlag.SELECTION);
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._selectedIndex;
	}
	,get_maxSelectedIndex: function() {
		if(this._dataProvider == null) {
			return -1;
		}
		return this._dataProvider.get_length() - 1;
	}
	,_selectedItem: null
	,get_selectedItem: function() {
		return this._selectedItem;
	}
	,set_selectedItem: function(value) {
		if(value == null || this._dataProvider == null) {
			this.set_selectedIndex(-1);
			return this._selectedItem;
		}
		var index = this._dataProvider.indexOf(value);
		if(index == -1) {
			this.set_selectedIndex(-1);
			return this._selectedItem;
		}
		if(this._selectedItem == value && this._selectedIndex == index) {
			return this._selectedItem;
		}
		this._selectedIndex = index;
		this._selectedItem = value;
		this.setInvalid(feathers_core_InvalidationFlag.SELECTION);
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._selectedItem;
	}
	,_prompt: null
	,get_prompt: function() {
		return this._prompt;
	}
	,set_prompt: function(value) {
		if(this._prompt == value) {
			return this._prompt;
		}
		this._prompt = value;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		return this._prompt;
	}
	,_itemRendererRecycler: null
	,get_itemRendererRecycler: function() {
		return this._itemRendererRecycler;
	}
	,set_itemRendererRecycler: function(value) {
		if(this._itemRendererRecycler == value) {
			return this._itemRendererRecycler;
		}
		this._itemRendererRecycler = value;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		return this._itemRendererRecycler;
	}
	,itemToText: function(data) {
		return Std.string(data);
	}
	,itemToEnabled: function(data) {
		return true;
	}
	,_previousCustomButtonVariant: null
	,_previousCustomListViewVariant: null
	,_oldButtonFactory: null
	,_buttonFactory: null
	,get_buttonFactory: function() {
		return this._buttonFactory;
	}
	,set_buttonFactory: function(value) {
		if(this._buttonFactory == value) {
			return this._buttonFactory;
		}
		this._buttonFactory = value;
		this.setInvalid(feathers_controls_PopUpListView.INVALIDATION_FLAG_BUTTON_FACTORY);
		return this._buttonFactory;
	}
	,_oldListViewFactory: null
	,_listViewFactory: null
	,get_listViewFactory: function() {
		return this._listViewFactory;
	}
	,set_listViewFactory: function(value) {
		if(this._listViewFactory == value) {
			return this._listViewFactory;
		}
		this._listViewFactory = value;
		this.setInvalid(feathers_controls_PopUpListView.INVALIDATION_FLAG_LIST_VIEW_FACTORY);
		return this._listViewFactory;
	}
	,get_open: function() {
		if(this.listView != null) {
			return this.listView.parent != null;
		} else {
			return false;
		}
	}
	,showFocus: function(show) {
		feathers_core_FeathersControl.prototype.showFocus.call(this,show);
		if(this.button != null) {
			this.button.showFocus(show);
		}
	}
	,openListView: function() {
		if(this.get_open() || this.stage == null) {
			return;
		}
		this.validateNow();
		if(this.get_popUpAdapter() != null) {
			this.get_popUpAdapter().addEventListener("open",$bind(this,this.popUpListView_popUpAdapter_openHandler));
			this.get_popUpAdapter().addEventListener("close",$bind(this,this.popUpListView_popUpAdapter_closeHandler));
			this.get_popUpAdapter().open(this.listView,this.button);
		} else {
			feathers_core_PopUpManager.addPopUp(this.listView,this.button);
			feathers_events_FeathersEvent.dispatch(this,"open");
		}
		this.listView.validateNow();
		this.button.addEventListener("focusOut",$bind(this,this.popUpListView_button_focusOutHandler));
		this.listView.addEventListener("removedFromStage",$bind(this,this.popUpListView_listView_removedFromStageHandler));
		this.listView.addEventListener("focusOut",$bind(this,this.popUpListView_listView_focusOutHandler));
		this.listView.addEventListener("keyFocusChange",$bind(this,this.popUpListView_listView_keyFocusChangeHandler));
		this.listView.addEventListener("mouseFocusChange",$bind(this,this.popUpListView_listView_mouseFocusChangeHandler));
		this.stage.addEventListener("mouseDown",$bind(this,this.popUpListView_stage_mouseDownHandler),false,0,true);
		this.stage.addEventListener("touchBegin",$bind(this,this.popUpListView_stage_touchBeginHandler),false,0,true);
		this.listView.scrollToIndex(this._selectedIndex);
		if(this.listView.get_focusManager() != null) {
			this.listView.get_focusManager().set_focus(this.listView);
		} else {
			this.stage.set_focus(this.listView);
		}
	}
	,closeListView: function() {
		if(!this.get_open()) {
			return;
		}
		if(this._focusManager == null) {
			if(this.stage != null) {
				this.stage.set_focus(this);
			}
			if(!this.get_open()) {
				return;
			}
		}
		if(this.get_popUpAdapter() != null) {
			this.get_popUpAdapter().close();
		} else {
			this.listView.parent.removeChild(this.listView);
			feathers_events_FeathersEvent.dispatch(this,"close");
		}
	}
	,dispose: function() {
		this.destroyButton();
		this.destroyListView();
		this._selectedItem = null;
		this._selectedIndex = -1;
		this.set_dataProvider(null);
		feathers_core_FeathersControl.prototype.dispose.call(this);
	}
	,initializePopUpListViewTheme: function() {
		feathers_themes_steel_components_SteelPopUpListViewStyles.initialize();
	}
	,update: function() {
		var dataInvalid = this.isInvalid(feathers_core_InvalidationFlag.DATA);
		var selectionInvalid = this.isInvalid(feathers_core_InvalidationFlag.SELECTION);
		var stateInvalid = this.isInvalid(feathers_core_InvalidationFlag.STATE);
		if(this._previousCustomButtonVariant != this.get_customButtonVariant()) {
			this.setInvalidationFlag(feathers_controls_PopUpListView.INVALIDATION_FLAG_BUTTON_FACTORY);
		}
		if(this._previousCustomListViewVariant != this.get_customListViewVariant()) {
			this.setInvalidationFlag(feathers_controls_PopUpListView.INVALIDATION_FLAG_LIST_VIEW_FACTORY);
		}
		var buttonFactoryInvalid = this.isInvalid(feathers_controls_PopUpListView.INVALIDATION_FLAG_BUTTON_FACTORY);
		var listViewFactoryInvalid = this.isInvalid(feathers_controls_PopUpListView.INVALIDATION_FLAG_LIST_VIEW_FACTORY);
		if(buttonFactoryInvalid) {
			this.createButton();
		}
		if(listViewFactoryInvalid) {
			this.createListView();
		}
		if(dataInvalid || listViewFactoryInvalid) {
			this.refreshListViewData();
		}
		if(selectionInvalid || listViewFactoryInvalid || buttonFactoryInvalid) {
			this.refreshSelection();
		}
		if(stateInvalid || listViewFactoryInvalid || buttonFactoryInvalid) {
			this.refreshEnabled();
		}
		this.measure();
		this.layoutChildren();
		this._previousCustomButtonVariant = this.get_customButtonVariant();
		this._previousCustomListViewVariant = this.get_customListViewVariant();
	}
	,createButton: function() {
		this.destroyButton();
		var factory = this._buttonFactory != null ? this._buttonFactory : feathers_controls_PopUpListView.defaultButtonFactory;
		this._oldButtonFactory = factory;
		this.button = factory.create();
		if(this.button.get_variant() == null) {
			this.button.set_variant(this.get_customButtonVariant() != null ? this.get_customButtonVariant() : feathers_controls_PopUpListView.CHILD_VARIANT_BUTTON);
		}
		this.button.addEventListener("mouseDown",$bind(this,this.popUpListView_button_mouseDownHandler));
		this.button.addEventListener("touchBegin",$bind(this,this.popUpListView_button_touchBeginHandler));
		this.button.addEventListener("keyDown",$bind(this,this.popUpListView_button_keyDownHandler));
		this.button.initializeNow();
		this.buttonMeasurements.save(this.button);
		this.addChild(this.button);
	}
	,destroyButton: function() {
		if(this.button == null) {
			return;
		}
		this.button.removeEventListener("mouseDown",$bind(this,this.popUpListView_button_mouseDownHandler));
		this.button.removeEventListener("touchBegin",$bind(this,this.popUpListView_button_touchBeginHandler));
		this.button.removeEventListener("keyDown",$bind(this,this.popUpListView_button_keyDownHandler));
		this.removeChild(this.button);
		if(this._oldButtonFactory.destroy != null) {
			this._oldButtonFactory.destroy(this.button);
		}
		this._oldButtonFactory = null;
		this.button = null;
	}
	,createListView: function() {
		this.destroyListView();
		var factory = this._listViewFactory != null ? this._listViewFactory : feathers_controls_PopUpListView.defaultListViewFactory;
		this._oldListViewFactory = factory;
		this.listView = factory.create();
		if(this.listView.get_variant() == null) {
			this.listView.set_variant(this.get_customListViewVariant() != null ? this.get_customListViewVariant() : feathers_controls_PopUpListView.CHILD_VARIANT_LIST_VIEW);
		}
		this.listView.set_focusOwner(this);
		this.listView.addEventListener("change",$bind(this,this.popUpListView_listView_changeHandler));
		this.listView.addEventListener("itemTrigger",$bind(this,this.popUpListView_listView_itemTriggerHandler));
		this.listView.addEventListener("keyUp",$bind(this,this.popUpListView_listView_keyUpHandler));
	}
	,destroyListView: function() {
		if(this.listView == null) {
			return;
		}
		this.listView.removeEventListener("change",$bind(this,this.popUpListView_listView_changeHandler));
		this.listView.removeEventListener("itemTrigger",$bind(this,this.popUpListView_listView_itemTriggerHandler));
		this.listView.removeEventListener("keyUp",$bind(this,this.popUpListView_listView_keyUpHandler));
		if(this._oldListViewFactory.destroy != null) {
			this._oldListViewFactory.destroy(this.listView);
		}
		this._oldListViewFactory = null;
		this.listView = null;
	}
	,refreshListViewData: function() {
		var oldIgnoreListViewChange = this._ignoreListViewChange;
		this._ignoreListViewChange = true;
		this.listView.set_dataProvider(this._dataProvider);
		this._ignoreListViewChange = oldIgnoreListViewChange;
		this.listView.set_itemRendererRecycler(this._itemRendererRecycler);
		this.listView.itemToEnabled = $bind(this,this.itemToEnabled);
		this.listView.itemToText = $bind(this,this.itemToText);
	}
	,refreshSelection: function() {
		var oldIgnoreListViewChange = this._ignoreListViewChange;
		this._ignoreListViewChange = true;
		this.listView.set_selectedIndex(this._selectedIndex);
		this._ignoreListViewChange = oldIgnoreListViewChange;
		if(this._selectedItem != null) {
			this.button.set_text(this.itemToText(this._selectedItem));
		} else if(this._prompt != null) {
			this.button.set_text(this._prompt);
		} else {
			this.button.set_text("");
		}
	}
	,refreshEnabled: function() {
		this.button.set_enabled(this._enabled);
		this.listView.set_enabled(this._enabled);
	}
	,measure: function() {
		var needsWidth = this.get_explicitWidth() == null;
		var needsHeight = this.get_explicitHeight() == null;
		var needsMinWidth = this.get_explicitMinWidth() == null;
		var needsMinHeight = this.get_explicitMinHeight() == null;
		var needsMaxWidth = this.get_explicitMaxWidth() == null;
		var needsMaxHeight = this.get_explicitMaxHeight() == null;
		if(!needsWidth && !needsHeight && !needsMinWidth && !needsMinHeight && !needsMaxWidth && !needsMaxHeight) {
			return false;
		}
		feathers_utils_MeasurementsUtil.resetFluidlyWithParent(this.buttonMeasurements,this.button,this);
		this.button.validateNow();
		var newWidth = this.get_explicitWidth();
		if(needsWidth) {
			newWidth = this.button.get_width();
		}
		var newHeight = this.get_explicitHeight();
		if(needsHeight) {
			newHeight = this.button.get_height();
		}
		var newMinWidth = this.get_explicitMinWidth();
		if(needsMinWidth) {
			newMinWidth = this.button.get_minWidth();
		}
		var newMinHeight = this.get_explicitMinHeight();
		if(needsMinHeight) {
			newMinHeight = this.button.get_minHeight();
		}
		return this.saveMeasurements(newWidth,newHeight,newMinWidth,newMinHeight);
	}
	,layoutChildren: function() {
		this.button.validateNow();
		if(this.button.get_width() != this.actualWidth) {
			this.button.set_width(this.actualWidth);
		}
		if(this.button.get_height() != this.actualHeight) {
			this.button.set_height(this.actualHeight);
		}
		this.button.validateNow();
	}
	,navigateWithKeyboard: function(event) {
		if(event.isDefaultPrevented()) {
			return;
		}
		if(this._dataProvider == null || this._dataProvider.get_length() == 0) {
			return;
		}
		var result = this._selectedIndex;
		switch(event.keyCode) {
		case 33:
			--result;
			break;
		case 34:
			++result;
			break;
		case 35:
			result = this._dataProvider.get_length() - 1;
			break;
		case 36:
			result = 0;
			break;
		case 37:
			--result;
			break;
		case 38:
			--result;
			break;
		case 39:
			++result;
			break;
		case 40:
			++result;
			break;
		default:
			return;
		}
		if(result < 0) {
			result = 0;
		} else if(result >= this._dataProvider.get_length()) {
			result = this._dataProvider.get_length() - 1;
		}
		event.preventDefault();
		this.set_selectedIndex(result);
	}
	,popUpListView_button_keyDownHandler: function(event) {
		if(!this._enabled) {
			return;
		}
		if(!this.get_open() && event.keyLocation != 4) {
			this.navigateWithKeyboard(event);
		}
		if(event.keyCode != 32 && event.keyCode != 13) {
			return;
		}
		if(this.get_open()) {
			event.preventDefault();
			this.closeListView();
		} else {
			event.preventDefault();
			this.openListView();
		}
	}
	,popUpListView_button_mouseDownHandler: function(event) {
		if(!this._enabled) {
			return;
		}
		if(this.get_open()) {
			this.closeListView();
		} else {
			this.openListView();
		}
	}
	,popUpListView_button_touchBeginHandler: function(event) {
		if(!this._enabled) {
			return;
		}
		if(event.isPrimaryTouchPoint) {
			return;
		}
		if(this.get_open()) {
			this.closeListView();
		} else {
			this.openListView();
		}
	}
	,popUpListView_listView_itemTriggerHandler: function(event) {
		this.dispatchEvent(event);
		if(this.get_popUpAdapter() == null || !this.get_popUpAdapter().get_persistent()) {
			this.closeListView();
		}
	}
	,popUpListView_listView_changeHandler: function(event) {
		if(this._ignoreListViewChange) {
			return;
		}
		this._selectedIndex = this.listView.get_selectedIndex();
		this._selectedItem = this.listView.get_selectedItem();
		this.setInvalid(feathers_core_InvalidationFlag.SELECTION);
		feathers_events_FeathersEvent.dispatch(this,"change");
	}
	,popUpListView_listView_removedFromStageHandler: function(event) {
		this.button.removeEventListener("focusOut",$bind(this,this.popUpListView_button_focusOutHandler));
		this.listView.removeEventListener("removedFromStage",$bind(this,this.popUpListView_listView_removedFromStageHandler));
		this.listView.removeEventListener("focusOut",$bind(this,this.popUpListView_listView_focusOutHandler));
		this.listView.removeEventListener("keyFocusChange",$bind(this,this.popUpListView_listView_keyFocusChangeHandler));
		this.listView.removeEventListener("mouseFocusChange",$bind(this,this.popUpListView_listView_mouseFocusChangeHandler));
		this.stage.removeEventListener("mouseDown",$bind(this,this.popUpListView_stage_mouseDownHandler));
		this.stage.removeEventListener("touchBegin",$bind(this,this.popUpListView_stage_touchBeginHandler));
	}
	,popUpListView_listView_mouseFocusChangeHandler: function(event) {
		if(this.listView.get_focusManager() != null || event.isDefaultPrevented() || openfl_utils_Object.__neq(event.target,this.listView) || event.relatedObject != null && !this.listView.contains(event.relatedObject)) {
			return;
		}
		event.preventDefault();
	}
	,popUpListView_listView_keyFocusChangeHandler: function(event) {
		if(this.listView.get_focusManager() != null || event.isDefaultPrevented() || openfl_utils_Object.__neq(event.target,this.listView)) {
			return;
		}
		event.preventDefault();
		if(this.stage != null) {
			this.stage.set_focus(this.button);
		}
	}
	,popUpListView_listView_focusOutHandler: function(event) {
		if(event.relatedObject != null && (event.relatedObject == this.listView || this.listView.contains(event.relatedObject))) {
			return;
		}
		this.closeListView();
	}
	,popUpListView_focusInHandler: function(event) {
		if(this.stage != null && this.stage.get_focus() != this.button) {
			event.stopImmediatePropagation();
			this.stage.set_focus(this.button);
		}
	}
	,popUpListView_button_focusOutHandler: function(event) {
		if(event.relatedObject != null && (event.relatedObject == this.listView || this.listView.contains(event.relatedObject))) {
			return;
		}
		this.closeListView();
	}
	,popUpListView_removedFromStageHandler: function(event) {
		this.closeListView();
	}
	,popUpListView_listView_keyUpHandler: function(event) {
		if(!this._enabled) {
			return;
		}
		switch(event.keyCode) {
		case 27:
			if(event.isDefaultPrevented()) {
				return;
			}
			if(!this.get_open()) {
				return;
			}
			event.preventDefault();
			this.closeListView();
			break;
		case 1073742094:
			if(event.isDefaultPrevented()) {
				return;
			}
			if(!this.get_open()) {
				return;
			}
			event.preventDefault();
			this.closeListView();
			break;
		}
	}
	,popUpListView_stage_mouseDownHandler: function(event) {
		if(this.button.hitTestPoint(event.stageX,event.stageY) || this.listView.hitTestPoint(event.stageX,event.stageY)) {
			return;
		}
		this.closeListView();
	}
	,popUpListView_stage_touchBeginHandler: function(event) {
		if(event.isPrimaryTouchPoint) {
			return;
		}
		if(this.button.hitTestPoint(event.stageX,event.stageY) || this.listView.hitTestPoint(event.stageX,event.stageY)) {
			return;
		}
		this.closeListView();
	}
	,popUpListView_popUpAdapter_openHandler: function(event) {
		feathers_events_FeathersEvent.dispatch(this,"open");
	}
	,popUpListView_popUpAdapter_closeHandler: function(event) {
		feathers_events_FeathersEvent.dispatch(this,"close");
	}
	,popUpListView_dataProvider_removeAllHandler: function(event) {
		this.set_selectedIndex(-1);
	}
	,__popUpAdapter: null
	,get_popUpAdapter: function() {
		return this.__popUpAdapter;
	}
	,set_popUpAdapter: function(value) {
		if(!this.setStyle("popUpAdapter")) {
			return this.__popUpAdapter;
		}
		if(this.__popUpAdapter == value) {
			return this.__popUpAdapter;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_popUpAdapter);
		this.__popUpAdapter = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__popUpAdapter;
	}
	,clearStyle_popUpAdapter: function() {
		this.set_popUpAdapter(null);
		return this.get_popUpAdapter();
	}
	,__customButtonVariant: null
	,get_customButtonVariant: function() {
		return this.__customButtonVariant;
	}
	,set_customButtonVariant: function(value) {
		if(!this.setStyle("customButtonVariant")) {
			return this.__customButtonVariant;
		}
		if(this.__customButtonVariant == value) {
			return this.__customButtonVariant;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_customButtonVariant);
		this.__customButtonVariant = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__customButtonVariant;
	}
	,clearStyle_customButtonVariant: function() {
		this.set_customButtonVariant(null);
		return this.get_customButtonVariant();
	}
	,__customListViewVariant: null
	,get_customListViewVariant: function() {
		return this.__customListViewVariant;
	}
	,set_customListViewVariant: function(value) {
		if(!this.setStyle("customListViewVariant")) {
			return this.__customListViewVariant;
		}
		if(this.__customListViewVariant == value) {
			return this.__customListViewVariant;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_customListViewVariant);
		this.__customListViewVariant = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__customListViewVariant;
	}
	,clearStyle_customListViewVariant: function() {
		this.set_customListViewVariant(null);
		return this.get_customListViewVariant();
	}
	,get_styleContext: function() {
		return feathers_controls_PopUpListView;
	}
	,__class__: feathers_controls_PopUpListView
	,__properties__: $extend(feathers_core_FeathersControl.prototype.__properties__,{get_open:"get_open",set_listViewFactory:"set_listViewFactory",get_listViewFactory:"get_listViewFactory",set_buttonFactory:"set_buttonFactory",get_buttonFactory:"get_buttonFactory",set_customListViewVariant:"set_customListViewVariant",get_customListViewVariant:"get_customListViewVariant",set_customButtonVariant:"set_customButtonVariant",get_customButtonVariant:"get_customButtonVariant",set_popUpAdapter:"set_popUpAdapter",get_popUpAdapter:"get_popUpAdapter",set_itemRendererRecycler:"set_itemRendererRecycler",get_itemRendererRecycler:"get_itemRendererRecycler",set_prompt:"set_prompt",get_prompt:"get_prompt",set_selectedItem:"set_selectedItem",get_selectedItem:"get_selectedItem",get_maxSelectedIndex:"get_maxSelectedIndex",set_selectedIndex:"set_selectedIndex",get_selectedIndex:"get_selectedIndex",set_dataProvider:"set_dataProvider",get_dataProvider:"get_dataProvider",get_stageFocusTarget:"get_stageFocusTarget"})
});
var com_tilbuci_ui_component_IDPopUpListView = function() {
	this.autoResize = true;
	feathers_controls_PopUpListView.call(this);
};
$hxClasses["com.tilbuci.ui.component.IDPopUpListView"] = com_tilbuci_ui_component_IDPopUpListView;
com_tilbuci_ui_component_IDPopUpListView.__name__ = "com.tilbuci.ui.component.IDPopUpListView";
com_tilbuci_ui_component_IDPopUpListView.__super__ = feathers_controls_PopUpListView;
com_tilbuci_ui_component_IDPopUpListView.prototype = $extend(feathers_controls_PopUpListView.prototype,{
	autoResize: null
	,__class__: com_tilbuci_ui_component_IDPopUpListView
});
var feathers_controls_Callout = function(content) {
	this.__leftArrowGap = 0.0;
	this.__bottomArrowGap = 0.0;
	this.__rightArrowGap = 0.0;
	this.__topArrowGap = 0.0;
	this.__leftArrowSkin = null;
	this.__bottomArrowSkin = null;
	this.__rightArrowSkin = null;
	this.__topArrowSkin = null;
	this.__backgroundSkin = null;
	this.__arrowPosition = feathers_layout_RelativePosition.TOP;
	this.__verticalAlign = feathers_layout_VerticalAlign.MIDDLE;
	this.__horizontalAlign = feathers_layout_HorizontalAlign.CENTER;
	this.__paddingLeft = 0.0;
	this.__paddingBottom = 0.0;
	this.__paddingRight = 0.0;
	this.__paddingTop = 0.0;
	this.__marginLeft = 0.0;
	this.__marginBottom = 0.0;
	this.__marginRight = 0.0;
	this.__marginTop = 0.0;
	this.__gap = 0.0;
	this.closeOnPointerOutside = true;
	this._ignoreContentResize = false;
	this._arrowOffset = 0.0;
	this.initializeCalloutTheme();
	feathers_core_FeathersControl.call(this);
	this.set_content(content);
	this.addEventListener("addedToStage",$bind(this,this.callout_addedToStageHandler));
	this.addEventListener("removedFromStage",$bind(this,this.callout_removedFromStageHandler));
};
$hxClasses["feathers.controls.Callout"] = feathers_controls_Callout;
feathers_controls_Callout.__name__ = "feathers.controls.Callout";
feathers_controls_Callout.show = function(content,origin,supportedPositions,modal,customOverlayFactory) {
	if(modal == null) {
		modal = true;
	}
	var callout = new feathers_controls_Callout();
	callout.set_content(content);
	return feathers_controls_Callout.showCallout(callout,origin,supportedPositions,modal,customOverlayFactory);
};
feathers_controls_Callout.showCallout = function(callout,origin,supportedPositions,modal,customOverlayFactory) {
	if(modal == null) {
		modal = true;
	}
	callout.supportedPositions = supportedPositions;
	callout.set_origin(origin);
	var overlayFactory = customOverlayFactory;
	if(overlayFactory == null) {
		overlayFactory = function() {
			var overlay = new openfl_display_Sprite();
			overlay.get_graphics().beginFill(16711935,0.0);
			overlay.get_graphics().drawRect(0,0,1,1);
			overlay.get_graphics().endFill();
			return overlay;
		};
	}
	feathers_core_PopUpManager.addPopUp(callout,origin,modal,false,overlayFactory);
	return callout;
};
feathers_controls_Callout.positionBelowOrigin = function(callout,originBounds) {
	callout.measureWithArrowPosition(feathers_layout_RelativePosition.TOP);
	var popUpRoot = feathers_core_PopUpManager.forStage(callout.stage).get_root();
	var stageTopLeft = new openfl_geom_Point();
	stageTopLeft = popUpRoot.globalToLocal(stageTopLeft);
	var stageBottomRight = new openfl_geom_Point(callout.stage.stageWidth,callout.stage.stageHeight);
	stageBottomRight = popUpRoot.globalToLocal(stageBottomRight);
	var idealXPosition = originBounds.x;
	switch(callout.get_horizontalAlign()._hx_index) {
	case 1:
		idealXPosition += (originBounds.width - callout.get_width()) / 2.0;
		break;
	case 2:
		idealXPosition += originBounds.width - callout.get_width();
		break;
	default:
	}
	var minX = stageTopLeft.x + callout.get_marginLeft();
	var maxX = stageBottomRight.x - callout.get_width() - callout.get_marginRight();
	var xPosition = idealXPosition;
	if(xPosition < minX) {
		xPosition = minX;
	} else if(xPosition > maxX) {
		xPosition = maxX;
	}
	callout.set_x(xPosition);
	callout.set_y(originBounds.y + originBounds.height + callout.get_gap());
	callout._arrowOffset = idealXPosition - xPosition;
	callout.set_arrowPosition(feathers_layout_RelativePosition.TOP);
};
feathers_controls_Callout.positionAboveOrigin = function(callout,originBounds) {
	callout.measureWithArrowPosition(feathers_layout_RelativePosition.BOTTOM);
	var popUpRoot = feathers_core_PopUpManager.forStage(callout.stage).get_root();
	var stageTopLeft = new openfl_geom_Point();
	stageTopLeft = popUpRoot.globalToLocal(stageTopLeft);
	var stageBottomRight = new openfl_geom_Point(callout.stage.stageWidth,callout.stage.stageHeight);
	stageBottomRight = popUpRoot.globalToLocal(stageBottomRight);
	var idealXPosition = originBounds.x;
	switch(callout.get_horizontalAlign()._hx_index) {
	case 1:
		idealXPosition += (originBounds.width - callout.get_width()) / 2.0;
		break;
	case 2:
		idealXPosition += originBounds.width - callout.get_width();
		break;
	default:
	}
	var minX = stageTopLeft.x + callout.get_marginLeft();
	var maxX = stageBottomRight.x - callout.get_width() - callout.get_marginRight();
	var xPosition = idealXPosition;
	if(xPosition < minX) {
		xPosition = minX;
	} else if(xPosition > maxX) {
		xPosition = maxX;
	}
	callout.set_x(xPosition);
	callout.set_y(originBounds.y - callout.get_height() - callout.get_gap());
	callout._arrowOffset = idealXPosition - xPosition;
	callout.set_arrowPosition(feathers_layout_RelativePosition.BOTTOM);
};
feathers_controls_Callout.positionLeftOfOrigin = function(callout,originBounds) {
	callout.measureWithArrowPosition(feathers_layout_RelativePosition.RIGHT);
	var popUpRoot = feathers_core_PopUpManager.forStage(callout.stage).get_root();
	var stageTopLeft = new openfl_geom_Point();
	stageTopLeft = popUpRoot.globalToLocal(stageTopLeft);
	var stageBottomRight = new openfl_geom_Point(callout.stage.stageWidth,callout.stage.stageHeight);
	stageBottomRight = popUpRoot.globalToLocal(stageBottomRight);
	var idealYPosition = originBounds.y;
	switch(callout.get_verticalAlign()._hx_index) {
	case 1:
		idealYPosition += (originBounds.height - callout.get_height()) / 2.0;
		break;
	case 2:
		idealYPosition += originBounds.height - callout.get_height();
		break;
	default:
	}
	var minY = stageTopLeft.y + callout.get_marginTop();
	var maxY = stageBottomRight.y - callout.get_height() - callout.get_marginBottom();
	var yPosition = idealYPosition;
	if(yPosition < minY) {
		yPosition = minY;
	} else if(yPosition > maxY) {
		yPosition = maxY;
	}
	callout.set_x(originBounds.x - callout.get_width() - callout.get_gap());
	callout.set_y(yPosition);
	callout._arrowOffset = idealYPosition - yPosition;
	callout.set_arrowPosition(feathers_layout_RelativePosition.RIGHT);
};
feathers_controls_Callout.positionRightOfOrigin = function(callout,originBounds) {
	callout.measureWithArrowPosition(feathers_layout_RelativePosition.RIGHT);
	var popUpRoot = feathers_core_PopUpManager.forStage(callout.stage).get_root();
	var stageTopLeft = new openfl_geom_Point();
	stageTopLeft = popUpRoot.globalToLocal(stageTopLeft);
	var stageBottomRight = new openfl_geom_Point(callout.stage.stageWidth,callout.stage.stageHeight);
	stageBottomRight = popUpRoot.globalToLocal(stageBottomRight);
	var idealYPosition = originBounds.y;
	switch(callout.get_verticalAlign()._hx_index) {
	case 1:
		idealYPosition += (originBounds.height - callout.get_height()) / 2.0;
		break;
	case 2:
		idealYPosition += originBounds.height - callout.get_height();
		break;
	default:
	}
	var minY = stageTopLeft.y + callout.get_marginTop();
	var maxY = stageBottomRight.y - callout.get_height() - callout.get_marginBottom();
	var yPosition = idealYPosition;
	if(yPosition < minY) {
		yPosition = minY;
	} else if(yPosition > maxY) {
		yPosition = maxY;
	}
	callout.set_x(originBounds.x + originBounds.width + callout.get_gap());
	callout.set_y(yPosition);
	callout._arrowOffset = idealYPosition - yPosition;
	callout.set_arrowPosition(feathers_layout_RelativePosition.LEFT);
};
feathers_controls_Callout.__super__ = feathers_core_FeathersControl;
feathers_controls_Callout.prototype = $extend(feathers_core_FeathersControl.prototype,{
	_contentMeasurements: null
	,_content: null
	,get_content: function() {
		return this._content;
	}
	,set_content: function(value) {
		if(this._content == value) {
			return this._content;
		}
		if(this._content != null) {
			this._content.removeEventListener("resize",$bind(this,this.callout_content_resizeHandler));
			this._contentMeasurements.restore(this._content);
			if(this._content.parent == this) {
				this.removeChild(this._content);
			}
		}
		this._content = value;
		if(this._content != null) {
			this.addChild(this._content);
			if(js_Boot.__implements(this._content,feathers_core_IUIControl)) {
				this._content.initializeNow();
			}
			if(this._contentMeasurements == null) {
				this._contentMeasurements = new feathers_layout_Measurements(this._content);
			} else {
				this._contentMeasurements.save(this._content);
			}
			this._content.addEventListener("resize",$bind(this,this.callout_content_resizeHandler),false,0,true);
		}
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		this.setInvalid(feathers_core_InvalidationFlag.SIZE);
		return this._content;
	}
	,_origin: null
	,get_origin: function() {
		return this._origin;
	}
	,set_origin: function(value) {
		if(this._origin == value) {
			return this._origin;
		}
		if(value != null && value.stage == null) {
			throw new openfl_errors_ArgumentError("origin must be added to the stage.");
		}
		if(this._origin != null) {
			this._origin.removeEventListener("removedFromStage",$bind(this,this.callout_origin_removedFromStageHandler));
			this.removeEventListener("enterFrame",$bind(this,this.callout_enterFrameHandler));
		}
		this._origin = value;
		if(this._origin != null) {
			this._origin.addEventListener("removedFromStage",$bind(this,this.callout_origin_removedFromStageHandler));
			if(this.stage != null) {
				this.addEventListener("enterFrame",$bind(this,this.callout_enterFrameHandler));
			}
		}
		this._lastPopUpOriginBounds = null;
		this.setInvalid(feathers_controls_Callout.INVALIDATION_FLAG_ORIGIN);
		return this._origin;
	}
	,_currentBackgroundSkin: null
	,_backgroundSkinMeasurements: null
	,_currentArrowSkin: null
	,_arrowOffset: null
	,supportedPositions: null
	,_lastPopUpOriginBounds: null
	,_ignoreContentResize: null
	,closeOnPointerOutside: null
	,close: function() {
		if(this.parent != null) {
			this.parent.removeChild(this);
		}
	}
	,setPadding: function(value) {
		this.set_paddingTop(value);
		this.set_paddingRight(value);
		this.set_paddingBottom(value);
		this.set_paddingLeft(value);
	}
	,dispose: function() {
		if(this._content != null) {
			this.set_content(null);
		}
		if(this._origin != null) {
			this.set_origin(null);
		}
		feathers_core_FeathersControl.prototype.dispose.call(this);
	}
	,initializeCalloutTheme: function() {
		feathers_themes_steel_components_SteelCalloutStyles.initialize();
	}
	,update: function() {
		var dataInvalid = this.isInvalid(feathers_core_InvalidationFlag.DATA);
		var originInvalid = this.isInvalid(feathers_controls_Callout.INVALIDATION_FLAG_ORIGIN);
		var sizeInvalid = this.isInvalid(feathers_core_InvalidationFlag.SIZE);
		var stateInvalid = this.isInvalid(feathers_core_InvalidationFlag.STATE);
		var stylesInvalid = this.isInvalid(feathers_core_InvalidationFlag.STYLES);
		if(sizeInvalid) {
			this._lastPopUpOriginBounds = null;
			originInvalid = true;
		}
		if(stylesInvalid || stateInvalid) {
			this.refreshBackgroundSkin();
		}
		if(stylesInvalid || stateInvalid) {
			this.refreshArrowSkin();
		}
		if(originInvalid) {
			this.positionRelativeToOrigin();
		}
		if(stateInvalid || dataInvalid) {
			this.refreshEnabled();
		}
		if(this.measure()) {
			sizeInvalid = true;
		}
		this.layoutChildren();
	}
	,measure: function() {
		return this.measureWithArrowPosition(this.get_arrowPosition());
	}
	,measureWithArrowPosition: function(arrowPosition) {
		var needsWidth = this.get_explicitWidth() == null;
		var needsHeight = this.get_explicitHeight() == null;
		var needsMinWidth = this.get_explicitMinWidth() == null;
		var needsMinHeight = this.get_explicitMinHeight() == null;
		var needsMaxWidth = this.get_explicitMaxWidth() == null;
		var needsMaxHeight = this.get_explicitMaxHeight() == null;
		if(!needsWidth && !needsHeight && !needsMinWidth && !needsMinHeight && !needsMaxWidth && !needsMaxHeight) {
			return false;
		}
		var stageWidth = 0.0;
		var stageHeight = 0.0;
		if(this.stage != null) {
			var stageTopLeft = new openfl_geom_Point();
			stageTopLeft = this.globalToLocal(stageTopLeft);
			var stageBottomRight = new openfl_geom_Point(this.stage.stageWidth,this.stage.stageHeight);
			stageBottomRight = this.globalToLocal(stageBottomRight);
			stageWidth = stageBottomRight.x - stageTopLeft.x;
			stageHeight = stageBottomRight.y - stageTopLeft.y;
		}
		var maxWidthWithStage = this.get_explicitMaxWidth();
		if(this.stage != null) {
			var stageMaxWidth = stageWidth - this.get_marginLeft() - this.get_marginRight();
			if(maxWidthWithStage == null || maxWidthWithStage < stageMaxWidth) {
				maxWidthWithStage = stageMaxWidth;
			}
		} else {
			maxWidthWithStage = 1.0 / 0.0;
		}
		var maxHeightWithStage = this.get_explicitMaxHeight();
		if(this.stage != null) {
			var stageMaxHeight = stageHeight - this.get_marginTop() - this.get_marginBottom();
			if(maxHeightWithStage == null || maxHeightWithStage < stageMaxHeight) {
				maxHeightWithStage = stageMaxHeight;
			}
		} else {
			maxHeightWithStage = 1.0 / 0.0;
		}
		if(this._currentBackgroundSkin != null) {
			feathers_utils_MeasurementsUtil.resetFluidlyWithParentValues(this._backgroundSkinMeasurements,this._currentBackgroundSkin,this.get_explicitWidth(),this.get_explicitHeight(),this.get_explicitMinWidth(),this.get_explicitMinHeight(),maxWidthWithStage,maxHeightWithStage);
		}
		var measureSkin = null;
		if(js_Boot.__implements(this._currentBackgroundSkin,feathers_core_IMeasureObject)) {
			measureSkin = this._currentBackgroundSkin;
		}
		if(js_Boot.__implements(this._currentBackgroundSkin,feathers_core_IValidating)) {
			this._currentBackgroundSkin.validateNow();
		}
		if(js_Boot.__implements(this.get_topArrowSkin(),feathers_core_IValidating)) {
			this.get_topArrowSkin().validateNow();
		}
		if(js_Boot.__implements(this.get_rightArrowSkin(),feathers_core_IValidating)) {
			this.get_rightArrowSkin().validateNow();
		}
		if(js_Boot.__implements(this.get_bottomArrowSkin(),feathers_core_IValidating)) {
			this.get_bottomArrowSkin().validateNow();
		}
		if(js_Boot.__implements(this.get_leftArrowSkin(),feathers_core_IValidating)) {
			this.get_leftArrowSkin().validateNow();
		}
		var leftOrRightArrowWidth = 0.0;
		var leftOrRightArrowHeight = 0.0;
		var topOrBottomArrowWidth = 0.0;
		var topOrBottomArrowHeight = 0.0;
		if(this._currentArrowSkin != null) {
			switch(arrowPosition._hx_index) {
			case 1:
				leftOrRightArrowWidth = this.get_rightArrowSkin().get_width() + this.get_rightArrowGap();
				leftOrRightArrowHeight = this.get_rightArrowSkin().get_height();
				break;
			case 2:
				topOrBottomArrowWidth = this.get_bottomArrowSkin().get_width();
				topOrBottomArrowHeight = this.get_bottomArrowSkin().get_height() + this.get_bottomArrowGap();
				break;
			case 3:
				leftOrRightArrowWidth = this.get_leftArrowSkin().get_width() + this.get_leftArrowGap();
				leftOrRightArrowHeight = this.get_leftArrowSkin().get_height();
				break;
			default:
				topOrBottomArrowWidth = this.get_topArrowSkin().get_width();
				topOrBottomArrowHeight = this.get_topArrowSkin().get_height() + this.get_topArrowGap();
			}
		}
		var measureContent = null;
		if(js_Boot.__implements(this._content,feathers_core_IMeasureObject)) {
			measureContent = this._content;
		}
		if(this._content != null) {
			var oldIgnoreContentResize = this._ignoreContentResize;
			this._ignoreContentResize = true;
			feathers_utils_MeasurementsUtil.resetFluidlyWithParentValues(this._contentMeasurements,this._content,this.get_explicitWidth() != null ? this.get_explicitWidth() - leftOrRightArrowWidth - this.get_paddingLeft() - this.get_paddingRight() : null,this.get_explicitHeight() != null ? this.get_explicitHeight() - topOrBottomArrowHeight - this.get_paddingTop() - this.get_paddingBottom() : null,this.get_explicitMinWidth() != null ? this.get_explicitMinWidth() - leftOrRightArrowWidth - this.get_paddingLeft() - this.get_paddingRight() : null,this.get_explicitMinHeight() != null ? this.get_explicitMinHeight() - topOrBottomArrowHeight - this.get_paddingLeft() - this.get_paddingRight() : null,maxWidthWithStage != null ? maxWidthWithStage - leftOrRightArrowWidth - this.get_paddingLeft() - this.get_paddingRight() : null,maxHeightWithStage != null ? maxHeightWithStage - topOrBottomArrowHeight - this.get_paddingLeft() - this.get_paddingRight() : null);
			if(js_Boot.__implements(this._content,feathers_core_IValidating)) {
				this._content.validateNow();
			}
			this._ignoreContentResize = oldIgnoreContentResize;
		}
		var newWidth = this.get_explicitWidth();
		if(needsWidth) {
			var contentWidth = 0.0;
			if(this._content != null) {
				contentWidth = this._content.get_width();
			}
			if(contentWidth < topOrBottomArrowWidth) {
				contentWidth = topOrBottomArrowWidth;
			}
			newWidth = contentWidth + this.get_paddingLeft() + this.get_paddingRight();
			if(this._currentBackgroundSkin != null) {
				var backgroundWidth = this._currentBackgroundSkin.get_width();
				if(newWidth < backgroundWidth) {
					newWidth = backgroundWidth;
				}
			}
			newWidth += leftOrRightArrowWidth;
		}
		var newHeight = this.get_explicitHeight();
		if(needsHeight) {
			var contentHeight = 0.0;
			if(this._content != null) {
				contentHeight = this._content.get_height();
			}
			if(contentHeight < leftOrRightArrowHeight) {
				contentHeight = leftOrRightArrowHeight;
			}
			newHeight = contentHeight + this.get_paddingTop() + this.get_paddingBottom();
			if(this._currentBackgroundSkin != null) {
				var backgroundHeight = this._currentBackgroundSkin.get_height();
				if(newHeight < backgroundHeight) {
					newHeight = backgroundHeight;
				}
			}
			newHeight += topOrBottomArrowHeight;
		}
		var newMinWidth = this.get_explicitMinWidth();
		if(needsMinWidth) {
			var contentMinWidth = 0.0;
			if(measureContent != null) {
				contentMinWidth = measureContent.get_minWidth();
			} else if(this._contentMeasurements != null && this._contentMeasurements.minWidth != null) {
				contentMinWidth = this._contentMeasurements.minWidth;
			}
			if(contentMinWidth < topOrBottomArrowWidth) {
				contentMinWidth = topOrBottomArrowWidth;
			}
			newMinWidth = contentMinWidth + this.get_paddingLeft() + this.get_paddingRight();
			var backgroundMinWidth = 0.0;
			if(measureSkin != null) {
				backgroundMinWidth = measureSkin.get_minWidth();
			} else if(this._backgroundSkinMeasurements != null && this._backgroundSkinMeasurements.minWidth != null) {
				backgroundMinWidth = this._backgroundSkinMeasurements.minWidth;
			}
			if(newMinWidth < backgroundMinWidth) {
				newMinWidth = backgroundMinWidth;
			}
			newMinWidth += leftOrRightArrowWidth;
			if(newMinWidth > maxWidthWithStage) {
				newMinWidth = maxWidthWithStage;
			}
		}
		var newMinHeight = this.get_explicitMinHeight();
		if(needsMinHeight) {
			var contentMinHeight = 0.0;
			if(measureContent != null) {
				contentMinHeight = measureContent.get_minWidth();
			} else if(this._contentMeasurements != null && this._contentMeasurements.minHeight != null) {
				contentMinHeight = this._contentMeasurements.minHeight;
			}
			if(contentMinHeight < leftOrRightArrowHeight) {
				contentMinHeight = leftOrRightArrowHeight;
			}
			newMinHeight = contentMinHeight + this.get_paddingTop() + this.get_paddingBottom();
			var backgroundMinHeight = 0.0;
			if(measureSkin != null) {
				backgroundMinHeight = measureSkin.get_minHeight();
			} else if(this._backgroundSkinMeasurements != null && this._backgroundSkinMeasurements.minHeight != null) {
				backgroundMinHeight = this._backgroundSkinMeasurements.minHeight;
			}
			if(newMinHeight < backgroundMinHeight) {
				newMinHeight = backgroundMinHeight;
			}
			newMinHeight += topOrBottomArrowHeight;
			if(newMinHeight > maxHeightWithStage) {
				newMinHeight = maxHeightWithStage;
			}
		}
		var newMaxWidth = maxWidthWithStage;
		var newMaxHeight = maxHeightWithStage;
		return this.saveMeasurements(newWidth,newHeight,newMinWidth,newMinHeight,newMaxWidth,newMaxHeight);
	}
	,getCurrentBackgroundSkin: function() {
		return this.get_backgroundSkin();
	}
	,refreshBackgroundSkin: function() {
		var oldSkin = this._currentBackgroundSkin;
		this._currentBackgroundSkin = this.getCurrentBackgroundSkin();
		if(this._currentBackgroundSkin == oldSkin) {
			return;
		}
		this.removeCurrentBackgroundSkin(oldSkin);
		this.addCurrentBackgroundSkin(this._currentBackgroundSkin);
	}
	,addCurrentBackgroundSkin: function(skin) {
		if(skin == null) {
			this._backgroundSkinMeasurements = null;
			return;
		}
		if(js_Boot.__implements(skin,feathers_core_IUIControl)) {
			skin.initializeNow();
		}
		if(this._backgroundSkinMeasurements == null) {
			this._backgroundSkinMeasurements = new feathers_layout_Measurements(skin);
		} else {
			this._backgroundSkinMeasurements.save(skin);
		}
		if(js_Boot.__implements(skin,feathers_skins_IProgrammaticSkin)) {
			skin.set_uiContext(this);
		}
		this.addChildAt(skin,0);
	}
	,removeCurrentBackgroundSkin: function(skin) {
		if(skin == null) {
			return;
		}
		if(js_Boot.__implements(skin,feathers_skins_IProgrammaticSkin)) {
			skin.set_uiContext(this);
		}
		this._backgroundSkinMeasurements.restore(skin);
		if(skin.parent == this) {
			this.removeChild(skin);
		}
	}
	,refreshArrowSkin: function() {
		var oldArrowSkin = this._currentArrowSkin;
		this._currentArrowSkin = this.getCurrentArrowSkin();
		if(oldArrowSkin == this._currentArrowSkin) {
			return;
		}
		this.removeCurrentArrowSkin(oldArrowSkin);
		if(js_Boot.__implements(this._currentArrowSkin,feathers_skins_IProgrammaticSkin)) {
			this._currentArrowSkin.set_uiContext(this);
		}
		this.addChild(this._currentArrowSkin);
	}
	,getCurrentArrowSkin: function() {
		switch(this.get_arrowPosition()._hx_index) {
		case 1:
			return this.get_rightArrowSkin();
		case 2:
			return this.get_bottomArrowSkin();
		case 3:
			return this.get_leftArrowSkin();
		default:
			return this.get_topArrowSkin();
		}
	}
	,removeCurrentArrowSkin: function(skin) {
		if(skin == null) {
			return;
		}
		if(js_Boot.__implements(skin,feathers_skins_IProgrammaticSkin)) {
			skin.set_uiContext(null);
		}
		if(skin.parent == this) {
			this.removeChild(skin);
		}
	}
	,refreshEnabled: function() {
		if(js_Boot.__implements(this._content,feathers_core_IUIControl)) {
			this._content.set_enabled(this._enabled);
		}
	}
	,layoutChildren: function() {
		if(js_Boot.__implements(this._currentArrowSkin,feathers_core_IValidating)) {
			this._currentArrowSkin.validateNow();
		}
		var xPosition = 0.0;
		var yPosition = 0.0;
		var widthOffset = 0.0;
		var heightOffset = 0.0;
		if(this._currentArrowSkin != null) {
			switch(this.get_arrowPosition()._hx_index) {
			case 1:
				widthOffset = this._currentArrowSkin.get_width() + this.get_rightArrowGap();
				break;
			case 2:
				heightOffset = this._currentArrowSkin.get_height() + this.get_bottomArrowGap();
				break;
			case 3:
				xPosition = this._currentArrowSkin.get_width() + this.get_leftArrowGap();
				break;
			default:
				yPosition = this._currentArrowSkin.get_height() + this.get_topArrowGap();
			}
		}
		var backgroundWidth = this.actualWidth - xPosition - widthOffset;
		var backgroundHeight = this.actualHeight - yPosition - heightOffset;
		if(this._currentBackgroundSkin != null) {
			this._currentBackgroundSkin.set_x(xPosition);
			this._currentBackgroundSkin.set_y(yPosition);
			this._currentBackgroundSkin.set_width(backgroundWidth);
			this._currentBackgroundSkin.set_height(backgroundHeight);
		}
		if(this._currentArrowSkin != null) {
			var contentWidth = backgroundWidth - this.get_paddingLeft() - this.get_paddingRight();
			var contentHeight = backgroundHeight - this.get_paddingTop() - this.get_paddingBottom();
			switch(this.get_arrowPosition()._hx_index) {
			case 1:
				this.get_rightArrowSkin().set_x(xPosition + backgroundWidth + this.get_rightArrowGap());
				var rightArrowSkinY = this._arrowOffset + yPosition + this.get_paddingTop();
				if(this.get_verticalAlign() == feathers_layout_VerticalAlign.MIDDLE) {
					rightArrowSkinY += Math.round((contentHeight - this.get_rightArrowSkin().get_height()) / 2.0);
				} else if(this.get_verticalAlign() == feathers_layout_VerticalAlign.BOTTOM) {
					rightArrowSkinY += contentHeight - this.get_rightArrowSkin().get_height();
				}
				var minRightArrowSkinY = yPosition + this.get_paddingTop();
				if(minRightArrowSkinY > rightArrowSkinY) {
					rightArrowSkinY = minRightArrowSkinY;
				} else {
					var maxRightArrowSkinY = yPosition + this.get_paddingTop() + contentHeight - this.get_rightArrowSkin().get_height();
					if(maxRightArrowSkinY < rightArrowSkinY) {
						rightArrowSkinY = maxRightArrowSkinY;
					}
				}
				this.get_rightArrowSkin().set_y(rightArrowSkinY);
				break;
			case 2:
				var bottomArrowSkinX = this._arrowOffset + xPosition + this.get_paddingLeft();
				if(this.get_horizontalAlign() == feathers_layout_HorizontalAlign.CENTER) {
					bottomArrowSkinX += Math.round((contentWidth - this.get_bottomArrowSkin().get_width()) / 2.0);
				} else if(this.get_horizontalAlign() == feathers_layout_HorizontalAlign.RIGHT) {
					bottomArrowSkinX += contentWidth - this.get_bottomArrowSkin().get_width();
				}
				var minBottomArrowSkinX = xPosition + this.get_paddingLeft();
				if(minBottomArrowSkinX > bottomArrowSkinX) {
					bottomArrowSkinX = minBottomArrowSkinX;
				} else {
					var maxBottomArrowSkinX = xPosition + this.get_paddingLeft() + contentWidth - this.get_bottomArrowSkin().get_width();
					if(maxBottomArrowSkinX < bottomArrowSkinX) {
						bottomArrowSkinX = maxBottomArrowSkinX;
					}
				}
				this.get_bottomArrowSkin().set_x(bottomArrowSkinX);
				this.get_bottomArrowSkin().set_y(yPosition + backgroundHeight + this.get_bottomArrowGap());
				break;
			case 3:
				this.get_leftArrowSkin().set_x(xPosition - this.get_leftArrowSkin().get_width() - this.get_leftArrowGap());
				var leftArrowSkinY = this._arrowOffset + yPosition + this.get_paddingTop();
				if(this.get_verticalAlign() == feathers_layout_VerticalAlign.MIDDLE) {
					leftArrowSkinY += Math.round((contentHeight - this.get_leftArrowSkin().get_height()) / 2.0);
				} else if(this.get_verticalAlign() == feathers_layout_VerticalAlign.BOTTOM) {
					leftArrowSkinY += contentHeight - this.get_leftArrowSkin().get_height();
				}
				var minLeftArrowSkinY = yPosition + this.get_paddingTop();
				if(minLeftArrowSkinY > leftArrowSkinY) {
					leftArrowSkinY = minLeftArrowSkinY;
				} else {
					var maxLeftArrowSkinY = yPosition + this.get_paddingTop() + contentHeight - this.get_leftArrowSkin().get_height();
					if(maxLeftArrowSkinY < leftArrowSkinY) {
						leftArrowSkinY = maxLeftArrowSkinY;
					}
				}
				this.get_leftArrowSkin().set_y(leftArrowSkinY);
				break;
			default:
				var topArrowSkinX = this._arrowOffset + xPosition + this.get_paddingLeft();
				if(this.get_horizontalAlign() == feathers_layout_HorizontalAlign.CENTER) {
					topArrowSkinX += Math.round((contentWidth - this.get_topArrowSkin().get_width()) / 2.0);
				} else if(this.get_horizontalAlign() == feathers_layout_HorizontalAlign.RIGHT) {
					topArrowSkinX += contentWidth - this.get_topArrowSkin().get_width();
				}
				var minTopArrowSkinX = xPosition + this.get_paddingLeft();
				if(minTopArrowSkinX > topArrowSkinX) {
					topArrowSkinX = minTopArrowSkinX;
				} else {
					var maxTopArrowSkinX = xPosition + this.get_paddingLeft() + contentWidth - this.get_topArrowSkin().get_width();
					if(maxTopArrowSkinX < topArrowSkinX) {
						topArrowSkinX = maxTopArrowSkinX;
					}
				}
				this.get_topArrowSkin().set_x(topArrowSkinX);
				this.get_topArrowSkin().set_y(yPosition - this.get_topArrowSkin().get_height() - this.get_topArrowGap());
			}
		}
		if(this._content != null) {
			this._content.set_x(xPosition + this.get_paddingLeft());
			this._content.set_y(yPosition + this.get_paddingTop());
			var oldIgnoreContentResize = this._ignoreContentResize;
			this._ignoreContentResize = true;
			this._content.set_width(backgroundWidth - this.get_paddingLeft() - this.get_paddingRight());
			this._content.set_height(backgroundHeight - this.get_paddingTop() - this.get_paddingBottom());
			if(js_Boot.__implements(this._content,feathers_core_IValidating)) {
				this._content.validateNow();
			}
			this._ignoreContentResize = oldIgnoreContentResize;
		}
	}
	,checkForOriginMoved: function() {
		if(this._origin == null) {
			if(this._lastPopUpOriginBounds == null) {
				this._lastPopUpOriginBounds = new openfl_geom_Rectangle();
			} else {
				this._lastPopUpOriginBounds.setEmpty();
			}
			return false;
		}
		var popUpRoot = feathers_core_PopUpManager.forStage(this.stage).get_root();
		var originTopLeft = new openfl_geom_Point(this.get_origin().get_x(),this.get_origin().get_y());
		originTopLeft = this.get_origin().parent.localToGlobal(originTopLeft);
		originTopLeft = popUpRoot.globalToLocal(originTopLeft);
		var originBottomRight = new openfl_geom_Point(this.get_origin().get_x() + this.get_origin().get_width(),this.get_origin().get_y() + this.get_origin().get_height());
		originBottomRight = this.get_origin().parent.localToGlobal(originBottomRight);
		originBottomRight = popUpRoot.globalToLocal(originBottomRight);
		var bounds = new openfl_geom_Rectangle(originTopLeft.x,originTopLeft.y,originBottomRight.x - originTopLeft.x,originBottomRight.y - originTopLeft.y);
		var hasPopUpBounds = this._lastPopUpOriginBounds != null;
		if(hasPopUpBounds && this._lastPopUpOriginBounds.equals(bounds)) {
			return false;
		}
		this._lastPopUpOriginBounds = bounds;
		return true;
	}
	,positionRelativeToOrigin: function() {
		this.checkForOriginMoved();
		var popUpRoot = feathers_core_PopUpManager.forStage(this.stage).get_root();
		var stageBottomRight = new openfl_geom_Point(this.stage.stageWidth,this.stage.stageHeight);
		stageBottomRight = popUpRoot.globalToLocal(stageBottomRight);
		var upSpace = -Infinity;
		var downSpace = -Infinity;
		var rightSpace = -Infinity;
		var leftSpace = -Infinity;
		var positions = this.supportedPositions;
		if(positions == null) {
			positions = [feathers_layout_RelativePosition.BOTTOM,feathers_layout_RelativePosition.TOP,feathers_layout_RelativePosition.RIGHT,feathers_layout_RelativePosition.LEFT];
		}
		var _g = 0;
		while(_g < positions.length) {
			var position = positions[_g];
			++_g;
			switch(position._hx_index) {
			case 0:
				this.measureWithArrowPosition(feathers_layout_RelativePosition.BOTTOM);
				upSpace = this._lastPopUpOriginBounds.y - this.actualHeight;
				if(upSpace >= this.get_marginTop()) {
					feathers_controls_Callout.positionAboveOrigin(this,this._lastPopUpOriginBounds);
					return;
				}
				if(upSpace < 0.0) {
					upSpace = 0.0;
				}
				break;
			case 1:
				this.measureWithArrowPosition(feathers_layout_RelativePosition.LEFT);
				rightSpace = stageBottomRight.x - this.actualWidth - (this._lastPopUpOriginBounds.x + this._lastPopUpOriginBounds.width);
				if(rightSpace >= this.get_marginRight()) {
					feathers_controls_Callout.positionRightOfOrigin(this,this._lastPopUpOriginBounds);
					return;
				}
				if(rightSpace < 0.0) {
					rightSpace = 0.0;
				}
				break;
			case 3:
				this.measureWithArrowPosition(feathers_layout_RelativePosition.RIGHT);
				leftSpace = this._lastPopUpOriginBounds.x - this.actualWidth;
				if(leftSpace >= this.get_marginLeft()) {
					feathers_controls_Callout.positionLeftOfOrigin(this,this._lastPopUpOriginBounds);
					return;
				}
				if(leftSpace < 0.0) {
					leftSpace = 0.0;
				}
				break;
			default:
				this.measureWithArrowPosition(feathers_layout_RelativePosition.TOP);
				downSpace = stageBottomRight.y - this.actualHeight - (this._lastPopUpOriginBounds.y + this._lastPopUpOriginBounds.height);
				if(downSpace >= this.get_marginBottom()) {
					feathers_controls_Callout.positionBelowOrigin(this,this._lastPopUpOriginBounds);
					return;
				}
				if(downSpace < 0.0) {
					downSpace = 0.0;
				}
			}
		}
		if(downSpace != -Infinity && downSpace >= upSpace && downSpace >= rightSpace && downSpace >= leftSpace) {
			feathers_controls_Callout.positionBelowOrigin(this,this._lastPopUpOriginBounds);
		} else if(upSpace != -Infinity && upSpace >= rightSpace && upSpace >= leftSpace) {
			feathers_controls_Callout.positionAboveOrigin(this,this._lastPopUpOriginBounds);
		} else if(rightSpace != -Infinity && rightSpace >= leftSpace) {
			feathers_controls_Callout.positionRightOfOrigin(this,this._lastPopUpOriginBounds);
		} else if(leftSpace != -Infinity) {
			feathers_controls_Callout.positionLeftOfOrigin(this,this._lastPopUpOriginBounds);
		} else {
			feathers_controls_Callout.positionBelowOrigin(this,this._lastPopUpOriginBounds);
		}
	}
	,callout_addedToStageHandler: function(event) {
		this.stage.addEventListener("mouseDown",$bind(this,this.callout_stage_mouseDownHandler),false,0,true);
		this.stage.addEventListener("touchBegin",$bind(this,this.callout_stage_touchBeginHandler),false,0,true);
		if(this._origin != null) {
			this.addEventListener("enterFrame",$bind(this,this.callout_enterFrameHandler));
		}
	}
	,callout_removedFromStageHandler: function(event) {
		this.stage.removeEventListener("mouseDown",$bind(this,this.callout_stage_mouseDownHandler));
		this.stage.removeEventListener("touchBegin",$bind(this,this.callout_stage_touchBeginHandler));
		this.removeEventListener("enterFrame",$bind(this,this.callout_enterFrameHandler));
		feathers_events_FeathersEvent.dispatch(this,"close");
	}
	,callout_enterFrameHandler: function(event) {
		if(!this.checkForOriginMoved()) {
			return;
		}
		this.setInvalid(feathers_controls_Callout.INVALIDATION_FLAG_ORIGIN);
	}
	,callout_origin_removedFromStageHandler: function(event) {
		this.close();
	}
	,callout_content_resizeHandler: function(event) {
		if(this._ignoreContentResize) {
			return;
		}
		this._contentMeasurements.save(this.get_content());
		this.setInvalid(feathers_core_InvalidationFlag.SIZE);
	}
	,callout_stage_mouseDownHandler: function(event) {
		if(!this.closeOnPointerOutside) {
			return;
		}
		if(this.hitTestPoint(event.stageX,event.stageY)) {
			return;
		}
		this.close();
	}
	,callout_stage_touchBeginHandler: function(event) {
		if(event.isPrimaryTouchPoint) {
			return;
		}
		if(!this.closeOnPointerOutside) {
			return;
		}
		if(this.hitTestPoint(event.stageX,event.stageY)) {
			return;
		}
		this.close();
	}
	,__gap: null
	,get_gap: function() {
		return this.__gap;
	}
	,set_gap: function(value) {
		if(!this.setStyle("gap")) {
			return this.__gap;
		}
		if(this.__gap == value) {
			return this.__gap;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_gap);
		this.__gap = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__gap;
	}
	,clearStyle_gap: function() {
		this.set_gap(0.0);
		return this.get_gap();
	}
	,__marginTop: null
	,get_marginTop: function() {
		return this.__marginTop;
	}
	,set_marginTop: function(value) {
		if(!this.setStyle("marginTop")) {
			return this.__marginTop;
		}
		if(this.__marginTop == value) {
			return this.__marginTop;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_marginTop);
		this.__marginTop = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__marginTop;
	}
	,clearStyle_marginTop: function() {
		this.set_marginTop(0.0);
		return this.get_marginTop();
	}
	,__marginRight: null
	,get_marginRight: function() {
		return this.__marginRight;
	}
	,set_marginRight: function(value) {
		if(!this.setStyle("marginRight")) {
			return this.__marginRight;
		}
		if(this.__marginRight == value) {
			return this.__marginRight;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_marginRight);
		this.__marginRight = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__marginRight;
	}
	,clearStyle_marginRight: function() {
		this.set_marginRight(0.0);
		return this.get_marginRight();
	}
	,__marginBottom: null
	,get_marginBottom: function() {
		return this.__marginBottom;
	}
	,set_marginBottom: function(value) {
		if(!this.setStyle("marginBottom")) {
			return this.__marginBottom;
		}
		if(this.__marginBottom == value) {
			return this.__marginBottom;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_marginBottom);
		this.__marginBottom = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__marginBottom;
	}
	,clearStyle_marginBottom: function() {
		this.set_marginBottom(0.0);
		return this.get_marginBottom();
	}
	,__marginLeft: null
	,get_marginLeft: function() {
		return this.__marginLeft;
	}
	,set_marginLeft: function(value) {
		if(!this.setStyle("marginLeft")) {
			return this.__marginLeft;
		}
		if(this.__marginLeft == value) {
			return this.__marginLeft;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_marginLeft);
		this.__marginLeft = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__marginLeft;
	}
	,clearStyle_marginLeft: function() {
		this.set_marginLeft(0.0);
		return this.get_marginLeft();
	}
	,__paddingTop: null
	,get_paddingTop: function() {
		return this.__paddingTop;
	}
	,set_paddingTop: function(value) {
		if(!this.setStyle("paddingTop")) {
			return this.__paddingTop;
		}
		if(this.__paddingTop == value) {
			return this.__paddingTop;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_paddingTop);
		this.__paddingTop = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__paddingTop;
	}
	,clearStyle_paddingTop: function() {
		this.set_paddingTop(0.0);
		return this.get_paddingTop();
	}
	,__paddingRight: null
	,get_paddingRight: function() {
		return this.__paddingRight;
	}
	,set_paddingRight: function(value) {
		if(!this.setStyle("paddingRight")) {
			return this.__paddingRight;
		}
		if(this.__paddingRight == value) {
			return this.__paddingRight;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_paddingRight);
		this.__paddingRight = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__paddingRight;
	}
	,clearStyle_paddingRight: function() {
		this.set_paddingRight(0.0);
		return this.get_paddingRight();
	}
	,__paddingBottom: null
	,get_paddingBottom: function() {
		return this.__paddingBottom;
	}
	,set_paddingBottom: function(value) {
		if(!this.setStyle("paddingBottom")) {
			return this.__paddingBottom;
		}
		if(this.__paddingBottom == value) {
			return this.__paddingBottom;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_paddingBottom);
		this.__paddingBottom = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__paddingBottom;
	}
	,clearStyle_paddingBottom: function() {
		this.set_paddingBottom(0.0);
		return this.get_paddingBottom();
	}
	,__paddingLeft: null
	,get_paddingLeft: function() {
		return this.__paddingLeft;
	}
	,set_paddingLeft: function(value) {
		if(!this.setStyle("paddingLeft")) {
			return this.__paddingLeft;
		}
		if(this.__paddingLeft == value) {
			return this.__paddingLeft;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_paddingLeft);
		this.__paddingLeft = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__paddingLeft;
	}
	,clearStyle_paddingLeft: function() {
		this.set_paddingLeft(0.0);
		return this.get_paddingLeft();
	}
	,__horizontalAlign: null
	,get_horizontalAlign: function() {
		return this.__horizontalAlign;
	}
	,set_horizontalAlign: function(value) {
		if(!this.setStyle("horizontalAlign")) {
			return this.__horizontalAlign;
		}
		if(this.__horizontalAlign == value) {
			return this.__horizontalAlign;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_horizontalAlign);
		this.__horizontalAlign = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__horizontalAlign;
	}
	,clearStyle_horizontalAlign: function() {
		this.set_horizontalAlign(feathers_layout_HorizontalAlign.CENTER);
		return this.get_horizontalAlign();
	}
	,__verticalAlign: null
	,get_verticalAlign: function() {
		return this.__verticalAlign;
	}
	,set_verticalAlign: function(value) {
		if(!this.setStyle("verticalAlign")) {
			return this.__verticalAlign;
		}
		if(this.__verticalAlign == value) {
			return this.__verticalAlign;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_verticalAlign);
		this.__verticalAlign = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__verticalAlign;
	}
	,clearStyle_verticalAlign: function() {
		this.set_verticalAlign(feathers_layout_VerticalAlign.MIDDLE);
		return this.get_verticalAlign();
	}
	,__arrowPosition: null
	,get_arrowPosition: function() {
		return this.__arrowPosition;
	}
	,set_arrowPosition: function(value) {
		if(!this.setStyle("arrowPosition")) {
			return this.__arrowPosition;
		}
		if(this.__arrowPosition == value) {
			return this.__arrowPosition;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_arrowPosition);
		this.__arrowPosition = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__arrowPosition;
	}
	,clearStyle_arrowPosition: function() {
		this.set_arrowPosition(feathers_layout_RelativePosition.TOP);
		return this.get_arrowPosition();
	}
	,__backgroundSkin: null
	,get_backgroundSkin: function() {
		return this.__backgroundSkin;
	}
	,set_backgroundSkin: function(value) {
		if(!this.setStyle("backgroundSkin")) {
			return this.__backgroundSkin;
		}
		if(this.__backgroundSkin == value) {
			return this.__backgroundSkin;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_backgroundSkin);
		this.__backgroundSkin = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__backgroundSkin;
	}
	,clearStyle_backgroundSkin: function() {
		this.set_backgroundSkin(null);
		return this.get_backgroundSkin();
	}
	,__topArrowSkin: null
	,get_topArrowSkin: function() {
		return this.__topArrowSkin;
	}
	,set_topArrowSkin: function(value) {
		if(!this.setStyle("topArrowSkin")) {
			return this.__topArrowSkin;
		}
		if(this.__topArrowSkin == value) {
			return this.__topArrowSkin;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_topArrowSkin);
		this.__topArrowSkin = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__topArrowSkin;
	}
	,clearStyle_topArrowSkin: function() {
		this.set_topArrowSkin(null);
		return this.get_topArrowSkin();
	}
	,__rightArrowSkin: null
	,get_rightArrowSkin: function() {
		return this.__rightArrowSkin;
	}
	,set_rightArrowSkin: function(value) {
		if(!this.setStyle("rightArrowSkin")) {
			return this.__rightArrowSkin;
		}
		if(this.__rightArrowSkin == value) {
			return this.__rightArrowSkin;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_rightArrowSkin);
		this.__rightArrowSkin = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__rightArrowSkin;
	}
	,clearStyle_rightArrowSkin: function() {
		this.set_rightArrowSkin(null);
		return this.get_rightArrowSkin();
	}
	,__bottomArrowSkin: null
	,get_bottomArrowSkin: function() {
		return this.__bottomArrowSkin;
	}
	,set_bottomArrowSkin: function(value) {
		if(!this.setStyle("bottomArrowSkin")) {
			return this.__bottomArrowSkin;
		}
		if(this.__bottomArrowSkin == value) {
			return this.__bottomArrowSkin;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_bottomArrowSkin);
		this.__bottomArrowSkin = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__bottomArrowSkin;
	}
	,clearStyle_bottomArrowSkin: function() {
		this.set_bottomArrowSkin(null);
		return this.get_bottomArrowSkin();
	}
	,__leftArrowSkin: null
	,get_leftArrowSkin: function() {
		return this.__leftArrowSkin;
	}
	,set_leftArrowSkin: function(value) {
		if(!this.setStyle("leftArrowSkin")) {
			return this.__leftArrowSkin;
		}
		if(this.__leftArrowSkin == value) {
			return this.__leftArrowSkin;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_leftArrowSkin);
		this.__leftArrowSkin = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__leftArrowSkin;
	}
	,clearStyle_leftArrowSkin: function() {
		this.set_leftArrowSkin(null);
		return this.get_leftArrowSkin();
	}
	,__topArrowGap: null
	,get_topArrowGap: function() {
		return this.__topArrowGap;
	}
	,set_topArrowGap: function(value) {
		if(!this.setStyle("topArrowGap")) {
			return this.__topArrowGap;
		}
		if(this.__topArrowGap == value) {
			return this.__topArrowGap;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_topArrowGap);
		this.__topArrowGap = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__topArrowGap;
	}
	,clearStyle_topArrowGap: function() {
		this.set_topArrowGap(0.0);
		return this.get_topArrowGap();
	}
	,__rightArrowGap: null
	,get_rightArrowGap: function() {
		return this.__rightArrowGap;
	}
	,set_rightArrowGap: function(value) {
		if(!this.setStyle("rightArrowGap")) {
			return this.__rightArrowGap;
		}
		if(this.__rightArrowGap == value) {
			return this.__rightArrowGap;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_rightArrowGap);
		this.__rightArrowGap = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__rightArrowGap;
	}
	,clearStyle_rightArrowGap: function() {
		this.set_rightArrowGap(0.0);
		return this.get_rightArrowGap();
	}
	,__bottomArrowGap: null
	,get_bottomArrowGap: function() {
		return this.__bottomArrowGap;
	}
	,set_bottomArrowGap: function(value) {
		if(!this.setStyle("bottomArrowGap")) {
			return this.__bottomArrowGap;
		}
		if(this.__bottomArrowGap == value) {
			return this.__bottomArrowGap;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_bottomArrowGap);
		this.__bottomArrowGap = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__bottomArrowGap;
	}
	,clearStyle_bottomArrowGap: function() {
		this.set_bottomArrowGap(0.0);
		return this.get_bottomArrowGap();
	}
	,__leftArrowGap: null
	,get_leftArrowGap: function() {
		return this.__leftArrowGap;
	}
	,set_leftArrowGap: function(value) {
		if(!this.setStyle("leftArrowGap")) {
			return this.__leftArrowGap;
		}
		if(this.__leftArrowGap == value) {
			return this.__leftArrowGap;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_leftArrowGap);
		this.__leftArrowGap = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__leftArrowGap;
	}
	,clearStyle_leftArrowGap: function() {
		this.set_leftArrowGap(0.0);
		return this.get_leftArrowGap();
	}
	,get_styleContext: function() {
		return feathers_controls_Callout;
	}
	,__class__: feathers_controls_Callout
	,__properties__: $extend(feathers_core_FeathersControl.prototype.__properties__,{set_leftArrowGap:"set_leftArrowGap",get_leftArrowGap:"get_leftArrowGap",set_bottomArrowGap:"set_bottomArrowGap",get_bottomArrowGap:"get_bottomArrowGap",set_rightArrowGap:"set_rightArrowGap",get_rightArrowGap:"get_rightArrowGap",set_topArrowGap:"set_topArrowGap",get_topArrowGap:"get_topArrowGap",set_leftArrowSkin:"set_leftArrowSkin",get_leftArrowSkin:"get_leftArrowSkin",set_bottomArrowSkin:"set_bottomArrowSkin",get_bottomArrowSkin:"get_bottomArrowSkin",set_rightArrowSkin:"set_rightArrowSkin",get_rightArrowSkin:"get_rightArrowSkin",set_topArrowSkin:"set_topArrowSkin",get_topArrowSkin:"get_topArrowSkin",set_backgroundSkin:"set_backgroundSkin",get_backgroundSkin:"get_backgroundSkin",set_arrowPosition:"set_arrowPosition",get_arrowPosition:"get_arrowPosition",set_verticalAlign:"set_verticalAlign",get_verticalAlign:"get_verticalAlign",set_horizontalAlign:"set_horizontalAlign",get_horizontalAlign:"get_horizontalAlign",set_paddingLeft:"set_paddingLeft",get_paddingLeft:"get_paddingLeft",set_paddingBottom:"set_paddingBottom",get_paddingBottom:"get_paddingBottom",set_paddingRight:"set_paddingRight",get_paddingRight:"get_paddingRight",set_paddingTop:"set_paddingTop",get_paddingTop:"get_paddingTop",set_marginLeft:"set_marginLeft",get_marginLeft:"get_marginLeft",set_marginBottom:"set_marginBottom",get_marginBottom:"get_marginBottom",set_marginRight:"set_marginRight",get_marginRight:"get_marginRight",set_marginTop:"set_marginTop",get_marginTop:"get_marginTop",set_gap:"set_gap",get_gap:"get_gap",set_origin:"set_origin",get_origin:"get_origin",set_content:"set_content",get_content:"get_content"})
});
var feathers_controls_TextCallout = function(text) {
	if(text == null) {
		text = "";
	}
	this.__wordWrap = false;
	this.__disabledTextFormat = null;
	this.__embedFonts = false;
	this.__styleSheet = null;
	this.__textFormat = null;
	this._htmlText = null;
	this.initializeTextCalloutTheme();
	feathers_controls_Callout.call(this);
	this.set_text(text);
};
$hxClasses["feathers.controls.TextCallout"] = feathers_controls_TextCallout;
feathers_controls_TextCallout.__name__ = "feathers.controls.TextCallout";
feathers_controls_TextCallout.__interfaces__ = [feathers_core_IHTMLTextControl,feathers_core_ITextControl];
feathers_controls_TextCallout.show = function(text,origin,supportedPositions,modal) {
	if(modal == null) {
		modal = true;
	}
	var callout = new feathers_controls_TextCallout(text);
	return js_Boot.__cast(feathers_controls_Callout.showCallout(callout,origin,supportedPositions,modal) , feathers_controls_TextCallout);
};
feathers_controls_TextCallout.__super__ = feathers_controls_Callout;
feathers_controls_TextCallout.prototype = $extend(feathers_controls_Callout.prototype,{
	label: null
	,_text: null
	,get_text: function() {
		return this._text;
	}
	,set_text: function(value) {
		if(this._text == value) {
			return this._text;
		}
		this._text = value;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		return this._text;
	}
	,_htmlText: null
	,get_htmlText: function() {
		return this._htmlText;
	}
	,set_htmlText: function(value) {
		if(this._htmlText == value) {
			return this._htmlText;
		}
		this._htmlText = value;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		return this._htmlText;
	}
	,get_baseline: function() {
		if(this.label == null) {
			return 0.0;
		}
		return this.label.get_y() + this.label.get_baseline();
	}
	,initializeTextCalloutTheme: function() {
		feathers_themes_steel_components_SteelTextCalloutStyles.initialize();
	}
	,initialize: function() {
		feathers_controls_Callout.prototype.initialize.call(this);
		if(this.label == null) {
			this.label = new feathers_controls_Label();
			this.addChild(this.label);
			this.set_content(this.label);
		}
	}
	,update: function() {
		var dataInvalid = this.isInvalid(feathers_core_InvalidationFlag.DATA);
		var stateInvalid = this.isInvalid(feathers_core_InvalidationFlag.STATE);
		var stylesInvalid = this.isInvalid(feathers_core_InvalidationFlag.STYLES);
		if(stylesInvalid || stateInvalid) {
			this.refreshTextStyles();
		}
		if(dataInvalid || stylesInvalid || stateInvalid) {
			this.refreshText();
		}
		feathers_controls_Callout.prototype.update.call(this);
	}
	,refreshTextStyles: function() {
		this.label.set_wordWrap(this.get_wordWrap());
		this.label.set_textFormat(this.get_textFormat());
		this.label.set_disabledTextFormat(this.get_disabledTextFormat());
		this.label.set_embedFonts(this.get_embedFonts());
		this.label.set_styleSheet(this.get_styleSheet());
	}
	,refreshText: function() {
		this.label.set_text(this._text);
		this.label.set_htmlText(this._htmlText);
	}
	,get_styleContext: function() {
		return feathers_controls_TextCallout;
	}
	,__textFormat: null
	,get_textFormat: function() {
		return this.__textFormat;
	}
	,set_textFormat: function(value) {
		if(!this.setStyle("textFormat")) {
			return this.__textFormat;
		}
		if(this.__textFormat == value) {
			return this.__textFormat;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_textFormat);
		this.__textFormat = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__textFormat;
	}
	,clearStyle_textFormat: function() {
		this.set_textFormat(null);
		return this.get_textFormat();
	}
	,__styleSheet: null
	,get_styleSheet: function() {
		return this.__styleSheet;
	}
	,set_styleSheet: function(value) {
		if(!this.setStyle("styleSheet")) {
			return this.__styleSheet;
		}
		if(this.__styleSheet == value) {
			return this.__styleSheet;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_styleSheet);
		this.__styleSheet = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__styleSheet;
	}
	,clearStyle_styleSheet: function() {
		this.set_styleSheet(null);
		return this.get_styleSheet();
	}
	,__embedFonts: null
	,get_embedFonts: function() {
		return this.__embedFonts;
	}
	,set_embedFonts: function(value) {
		if(!this.setStyle("embedFonts")) {
			return this.__embedFonts;
		}
		if(this.__embedFonts == value) {
			return this.__embedFonts;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_embedFonts);
		this.__embedFonts = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__embedFonts;
	}
	,clearStyle_embedFonts: function() {
		this.set_embedFonts(false);
		return this.get_embedFonts();
	}
	,__disabledTextFormat: null
	,get_disabledTextFormat: function() {
		return this.__disabledTextFormat;
	}
	,set_disabledTextFormat: function(value) {
		if(!this.setStyle("disabledTextFormat")) {
			return this.__disabledTextFormat;
		}
		if(this.__disabledTextFormat == value) {
			return this.__disabledTextFormat;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_disabledTextFormat);
		this.__disabledTextFormat = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__disabledTextFormat;
	}
	,clearStyle_disabledTextFormat: function() {
		this.set_disabledTextFormat(null);
		return this.get_disabledTextFormat();
	}
	,__wordWrap: null
	,get_wordWrap: function() {
		return this.__wordWrap;
	}
	,set_wordWrap: function(value) {
		if(!this.setStyle("wordWrap")) {
			return this.__wordWrap;
		}
		if(this.__wordWrap == value) {
			return this.__wordWrap;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_wordWrap);
		this.__wordWrap = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__wordWrap;
	}
	,clearStyle_wordWrap: function() {
		this.set_wordWrap(false);
		return this.get_wordWrap();
	}
	,__class__: feathers_controls_TextCallout
	,__properties__: $extend(feathers_controls_Callout.prototype.__properties__,{set_wordWrap:"set_wordWrap",get_wordWrap:"get_wordWrap",set_disabledTextFormat:"set_disabledTextFormat",get_disabledTextFormat:"get_disabledTextFormat",set_embedFonts:"set_embedFonts",get_embedFonts:"get_embedFonts",set_styleSheet:"set_styleSheet",get_styleSheet:"get_styleSheet",set_textFormat:"set_textFormat",get_textFormat:"get_textFormat",get_baseline:"get_baseline",set_htmlText:"set_htmlText",get_htmlText:"get_htmlText",set_text:"set_text",get_text:"get_text"})
});
var feathers_controls_TextInput = function(text,prompt,changeListener) {
	if(text == null) {
		text = "";
	}
	this.__customErrorCalloutVariant = null;
	this.__errorFocusRectSkin = null;
	this.__autoSizeWidth = false;
	this.__verticalAlign = feathers_layout_VerticalAlign.MIDDLE;
	this.__paddingLeft = 0.0;
	this.__paddingBottom = 0.0;
	this.__paddingRight = 0.0;
	this.__paddingTop = 0.0;
	this.__embedFonts = false;
	this.__promptTextFormat = null;
	this.__disabledTextFormat = null;
	this.__textFormat = null;
	this.__rightViewGap = 0.0;
	this.__rightView = null;
	this.__leftViewGap = 0.0;
	this.__leftView = null;
	this.__showPromptWhenEmptyAndFocused = true;
	this.__backgroundSkin = null;
	this._previousCustomErrorCalloutVariant = null;
	this._focusedStatePriority = 0;
	this._errorStatePriority = 0;
	this._maxChars = 0;
	this._pendingSelectionActiveIndex = -1;
	this._pendingSelectionAnchorIndex = -1;
	this._scrollX = 0.0;
	this._stateToTextFormat = new haxe_ds_EnumValueMap();
	this._errorString = null;
	this._displayAsPassword = false;
	this._measureText = null;
	this._updatedPromptStyles = false;
	this._updatedTextStyles = false;
	this._previousPromptTextFormat = null;
	this._previousTextFormat = null;
	this._previousPrompt = null;
	this._previousMeasureText = null;
	this._previousText = null;
	this._stateToSkin = new haxe_ds_EnumValueMap();
	this._ignoreRightViewResize = false;
	this._ignoreLeftViewResize = false;
	this._currentBackgroundSkin = null;
	this._backgroundSkinMeasurements = null;
	this._currentState = feathers_controls_TextInputState.ENABLED;
	this._selectable = true;
	this._editable = true;
	this.initializeTextInputTheme();
	feathers_core_FeathersControl.call(this);
	this.set_text(text);
	this.set_prompt(prompt);
	this.set_tabEnabled(true);
	this.set_tabChildren(false);
	this.focusRect = null;
	this.addEventListener("focusIn",$bind(this,this.textInput_focusInHandler));
	this.addEventListener("focusOut",$bind(this,this.textInput_focusOutHandler));
	if(changeListener != null) {
		this.addEventListener("change",changeListener);
	}
};
$hxClasses["feathers.controls.TextInput"] = feathers_controls_TextInput;
feathers_controls_TextInput.__name__ = "feathers.controls.TextInput";
feathers_controls_TextInput.__interfaces__ = [feathers_core_IStageFocusDelegate,feathers_core_ITextControl,feathers_core_IStateContext];
feathers_controls_TextInput.__super__ = feathers_core_FeathersControl;
feathers_controls_TextInput.prototype = $extend(feathers_core_FeathersControl.prototype,{
	_editable: null
	,get_editable: function() {
		return this._editable;
	}
	,set_editable: function(value) {
		if(this._editable == value) {
			return this._editable;
		}
		this._editable = value;
		this.setInvalid(feathers_core_InvalidationFlag.STATE);
		return this._editable;
	}
	,_selectable: null
	,get_selectable: function() {
		return this._selectable;
	}
	,set_selectable: function(value) {
		if(this._selectable == value) {
			return this._selectable;
		}
		this._selectable = value;
		this.setInvalid(feathers_core_InvalidationFlag.STATE);
		return this._selectable;
	}
	,get_stageFocusTarget: function() {
		return this.textField;
	}
	,_currentState: null
	,get_currentState: function() {
		return this._currentState;
	}
	,set_enabled: function(value) {
		feathers_core_FeathersControl.prototype.set_enabled.call(this,value);
		this.refreshState();
		return this._enabled;
	}
	,_backgroundSkinMeasurements: null
	,_currentBackgroundSkin: null
	,_currentLeftView: null
	,_leftViewMeasurements: null
	,_ignoreLeftViewResize: null
	,_currentRightView: null
	,_rightViewMeasurements: null
	,_ignoreRightViewResize: null
	,_stateToSkin: null
	,textField: null
	,promptTextField: null
	,errorStringCallout: null
	,_previousText: null
	,_previousMeasureText: null
	,_previousPrompt: null
	,_previousTextFormat: null
	,_previousSimpleTextFormat: null
	,_previousPromptTextFormat: null
	,_previousPromptSimpleTextFormat: null
	,_updatedTextStyles: null
	,_updatedPromptStyles: null
	,_text: null
	,get_text: function() {
		return this._text;
	}
	,set_text: function(value) {
		if(value == null) {
			if(this._text.length == 0) {
				return this._text;
			}
			value = "";
		}
		if(this._text == value) {
			return this._text;
		}
		this._text = value;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._text;
	}
	,_measureText: null
	,get_measureText: function() {
		return this._measureText;
	}
	,set_measureText: function(value) {
		if(this._measureText == value) {
			return this._measureText;
		}
		this._measureText = value;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		return this._measureText;
	}
	,get_baseline: function() {
		if(this.textField == null) {
			return 0.0;
		}
		var hasText = this._text != null && this._text.length > 0;
		if(!hasText) {
			this.textField.set_text("​");
			var result = this.textField.get_y() + this.textField.getLineMetrics(0).ascent;
			this.textField.set_text("");
			return result;
		}
		return this.textField.get_y() + this.textField.getLineMetrics(0).ascent;
	}
	,_prompt: null
	,get_prompt: function() {
		return this._prompt;
	}
	,set_prompt: function(value) {
		if(this._prompt == value) {
			return this._prompt;
		}
		this._prompt = value;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		return this._prompt;
	}
	,___restrict: null
	,get_restrict: function() {
		return this.___restrict;
	}
	,set_restrict: function(value) {
		if(this.___restrict == value) {
			return this.___restrict;
		}
		this.___restrict = value;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		return this.___restrict;
	}
	,_displayAsPassword: null
	,get_displayAsPassword: function() {
		return this._displayAsPassword;
	}
	,set_displayAsPassword: function(value) {
		if(this._displayAsPassword == value) {
			return this._displayAsPassword;
		}
		this._displayAsPassword = value;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		return this._displayAsPassword;
	}
	,_errorString: null
	,get_errorString: function() {
		return this._errorString;
	}
	,set_errorString: function(value) {
		if(this._errorString == value) {
			return this._errorString;
		}
		this._errorString = value;
		this.refreshState();
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		return this._errorString;
	}
	,get_errorStringCalloutOpen: function() {
		if(this.errorStringCallout != null) {
			return this.errorStringCallout.parent != null;
		} else {
			return false;
		}
	}
	,_stateToTextFormat: null
	,_scrollX: null
	,get_scrollX: function() {
		return this._scrollX;
	}
	,set_scrollX: function(value) {
		if(this._scrollX == value) {
			return this._scrollX;
		}
		this._scrollX = value;
		this.setInvalid(feathers_core_InvalidationFlag.SCROLL);
		feathers_events_FeathersEvent.dispatch(this,"scroll");
		return this._scrollX;
	}
	,_pendingSelectionAnchorIndex: null
	,get_selectionAnchorIndex: function() {
		if(this.textField != null && this._pendingSelectionAnchorIndex == -1) {
			if(this.textField.get_caretIndex() == this.textField.get_selectionBeginIndex()) {
				return this.textField.get_selectionEndIndex();
			}
			return this.textField.get_selectionBeginIndex();
		}
		return this._pendingSelectionAnchorIndex;
	}
	,_pendingSelectionActiveIndex: null
	,get_selectionActiveIndex: function() {
		if(this.textField != null && this._pendingSelectionActiveIndex == -1) {
			return this.textField.get_caretIndex();
		}
		return this._pendingSelectionActiveIndex;
	}
	,_maxChars: null
	,get_maxChars: function() {
		return this._maxChars;
	}
	,set_maxChars: function(value) {
		if(this._maxChars == value) {
			return this._maxChars;
		}
		this._maxChars = value;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		return this._maxChars;
	}
	,_errorStatePriority: null
	,get_errorStatePriority: function() {
		return this._errorStatePriority;
	}
	,set_errorStatePriority: function(value) {
		if(this._errorStatePriority == value) {
			return this._errorStatePriority;
		}
		this._errorStatePriority = value;
		this.setInvalid(feathers_core_InvalidationFlag.STATE);
		return this._errorStatePriority;
	}
	,_focusedStatePriority: null
	,get_focusedStatePriority: function() {
		return this._errorStatePriority;
	}
	,set_focusedStatePriority: function(value) {
		if(this._focusedStatePriority == value) {
			return this._focusedStatePriority;
		}
		this._focusedStatePriority = value;
		this.setInvalid(feathers_core_InvalidationFlag.STATE);
		return this._focusedStatePriority;
	}
	,_oldErrorCalloutFactory: null
	,_errorCalloutFactory: null
	,get_errorCalloutFactory: function() {
		return this._errorCalloutFactory;
	}
	,set_errorCalloutFactory: function(value) {
		if(this._errorCalloutFactory == value) {
			return this._errorCalloutFactory;
		}
		this._errorCalloutFactory = value;
		this.setInvalid(feathers_controls_TextInput.INVALIDATION_FLAG_ERROR_CALLOUT_FACTORY);
		return this._errorCalloutFactory;
	}
	,_previousCustomErrorCalloutVariant: null
	,_textMeasuredWidth: null
	,_textMeasuredHeight: null
	,_promptTextMeasuredWidth: null
	,_promptTextMeasuredHeight: null
	,getSkinForState: function(state) {
		return this._stateToSkin.get(state);
	}
	,setSkinForState: function(state,skin) {
		if(!this.setStyle("setSkinForState",state)) {
			return;
		}
		var oldSkin = this._stateToSkin.get(state);
		if(oldSkin != null && oldSkin == this._currentBackgroundSkin) {
			this.removeCurrentBackgroundSkin(oldSkin);
			this._currentBackgroundSkin = null;
		}
		if(skin == null) {
			this._stateToSkin.remove(state);
		} else {
			this._stateToSkin.set(state,skin);
		}
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
	}
	,getTextFormatForState: function(state) {
		return this._stateToTextFormat.get(state);
	}
	,setTextFormatForState: function(state,textFormat) {
		if(!this.setStyle("setTextFormatForState",state)) {
			return;
		}
		if(textFormat == null) {
			this._stateToTextFormat.remove(state);
		} else {
			this._stateToTextFormat.set(state,textFormat);
		}
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
	}
	,selectRange: function(anchorIndex,activeIndex) {
		this._pendingSelectionAnchorIndex = anchorIndex;
		this._pendingSelectionActiveIndex = activeIndex;
		this.setInvalid(feathers_core_InvalidationFlag.SELECTION);
	}
	,selectAll: function() {
		this.selectRange(0,this._text.length);
	}
	,setPadding: function(value) {
		this.set_paddingTop(value);
		this.set_paddingRight(value);
		this.set_paddingBottom(value);
		this.set_paddingLeft(value);
	}
	,showFocus: function(show) {
		feathers_core_FeathersControl.prototype.showFocus.call(this,show);
		if(show) {
			this.selectRange(this._text.length,0);
		}
	}
	,dispose: function() {
		this.destroyErrorCallout();
		feathers_core_FeathersControl.prototype.dispose.call(this);
	}
	,initializeTextInputTheme: function() {
		feathers_themes_steel_components_SteelTextInputStyles.initialize();
	}
	,initialize: function() {
		feathers_core_FeathersControl.prototype.initialize.call(this);
		if(this.textField == null) {
			this.textField = new openfl_text_TextField();
			this.textField.set_tabEnabled(false);
			this.refreshTextFieldType();
			this.textField.addEventListener("change",$bind(this,this.textInput_textField_changeHandler));
			this.textField.addEventListener("scroll",$bind(this,this.textInput_textField_scrollHandler));
			this.addChild(this.textField);
		}
	}
	,update: function() {
		var dataInvalid = this.isInvalid(feathers_core_InvalidationFlag.DATA);
		var scrollInvalid = this.isInvalid(feathers_core_InvalidationFlag.SCROLL);
		var selectionInvalid = this.isInvalid(feathers_core_InvalidationFlag.SELECTION);
		var sizeInvalid = this.isInvalid(feathers_core_InvalidationFlag.SIZE);
		var stateInvalid = this.isInvalid(feathers_core_InvalidationFlag.STATE);
		var stylesInvalid = this.isInvalid(feathers_core_InvalidationFlag.STYLES);
		if(this._previousCustomErrorCalloutVariant != this.get_customErrorCalloutVariant()) {
			this.setInvalidationFlag(feathers_controls_TextInput.INVALIDATION_FLAG_ERROR_CALLOUT_FACTORY);
		}
		var errorCalloutFactoryInvalid = this.isInvalid(feathers_controls_TextInput.INVALIDATION_FLAG_ERROR_CALLOUT_FACTORY);
		this._updatedTextStyles = false;
		this._updatedPromptStyles = false;
		if(errorCalloutFactoryInvalid || dataInvalid) {
			this.createErrorCallout();
		}
		if(stylesInvalid || stateInvalid) {
			this.refreshBackgroundSkin();
			this.refreshLeftView();
			this.refreshRightView();
		}
		if(dataInvalid || stateInvalid) {
			this.refreshPrompt();
		}
		if(stylesInvalid || stateInvalid) {
			this.refreshTextStyles();
		}
		if(dataInvalid || stylesInvalid || stateInvalid) {
			this.refreshPromptStyles();
		}
		if(dataInvalid || stylesInvalid || stateInvalid || sizeInvalid) {
			this.refreshText(sizeInvalid);
		}
		if(dataInvalid || stylesInvalid || sizeInvalid) {
			this.refreshPromptText(sizeInvalid);
		}
		if(selectionInvalid) {
			this.refreshSelection();
		}
		if(scrollInvalid) {
			this.refreshScrollPosition();
		}
		this.measure();
		this.layoutContent();
		if(errorCalloutFactoryInvalid || stateInvalid || dataInvalid) {
			this.refreshErrorString();
		}
		this._previousCustomErrorCalloutVariant = this.get_customErrorCalloutVariant();
	}
	,refreshBackgroundSkin: function() {
		var oldSkin = this._currentBackgroundSkin;
		this._currentBackgroundSkin = this.getCurrentBackgroundSkin();
		if(this._currentBackgroundSkin == oldSkin) {
			return;
		}
		this.removeCurrentBackgroundSkin(oldSkin);
		this.addCurrentBackgroundSkin(this._currentBackgroundSkin);
	}
	,getCurrentBackgroundSkin: function() {
		var result = this._stateToSkin.get(this._currentState);
		if(result != null) {
			return result;
		}
		return this.get_backgroundSkin();
	}
	,addCurrentBackgroundSkin: function(skin) {
		if(skin == null) {
			this._backgroundSkinMeasurements = null;
			return;
		}
		if(js_Boot.__implements(skin,feathers_core_IUIControl)) {
			skin.initializeNow();
		}
		if(this._backgroundSkinMeasurements == null) {
			this._backgroundSkinMeasurements = new feathers_layout_Measurements(skin);
		} else {
			this._backgroundSkinMeasurements.save(skin);
		}
		if(js_Boot.__implements(skin,feathers_skins_IProgrammaticSkin)) {
			skin.set_uiContext(this);
		}
		if(js_Boot.__implements(skin,feathers_core_IStateObserver)) {
			skin.set_stateContext(this);
		}
		this.addChildAt(skin,0);
	}
	,removeCurrentBackgroundSkin: function(skin) {
		if(skin == null) {
			return;
		}
		if(js_Boot.__implements(skin,feathers_skins_IProgrammaticSkin)) {
			skin.set_uiContext(null);
		}
		if(js_Boot.__implements(skin,feathers_core_IStateObserver)) {
			skin.set_stateContext(null);
		}
		this._backgroundSkinMeasurements.restore(skin);
		if(skin.parent == this) {
			this.removeChild(skin);
		}
	}
	,refreshLeftView: function() {
		var oldView = this._currentLeftView;
		this._currentLeftView = this.getCurrentLeftView();
		if(this._currentLeftView == oldView) {
			return;
		}
		this.removeCurrentLeftView(oldView);
		if(this._currentLeftView == null) {
			this._leftViewMeasurements = null;
			return;
		}
		if(js_Boot.__implements(this._currentLeftView,feathers_core_IUIControl)) {
			this._currentLeftView.initializeNow();
		}
		if(this._leftViewMeasurements == null) {
			this._leftViewMeasurements = new feathers_layout_Measurements(this._currentLeftView);
		} else {
			this._leftViewMeasurements.save(this._currentLeftView);
		}
		if(js_Boot.__implements(this._currentLeftView,feathers_skins_IProgrammaticSkin)) {
			this._currentLeftView.set_uiContext(this);
		}
		if(js_Boot.__implements(this._currentLeftView,feathers_core_IStateObserver)) {
			this._currentLeftView.set_stateContext(this);
		}
		this._currentLeftView.addEventListener("resize",$bind(this,this.textInput_leftView_resizeHandler),false,0,true);
		this.addChild(this._currentLeftView);
	}
	,getCurrentLeftView: function() {
		return this.get_leftView();
	}
	,removeCurrentLeftView: function(view) {
		if(view == null) {
			return;
		}
		view.removeEventListener("resize",$bind(this,this.textInput_leftView_resizeHandler));
		if(js_Boot.__implements(view,feathers_skins_IProgrammaticSkin)) {
			view.set_uiContext(null);
		}
		if(js_Boot.__implements(view,feathers_core_IStateObserver)) {
			view.set_stateContext(null);
		}
		this._leftViewMeasurements.restore(view);
		if(view.parent == this) {
			this.removeChild(view);
		}
	}
	,refreshRightView: function() {
		var oldView = this._currentRightView;
		this._currentRightView = this.getCurrentRightView();
		if(this._currentRightView == oldView) {
			return;
		}
		this.removeCurrentRightView(oldView);
		if(this._currentRightView == null) {
			this._rightViewMeasurements = null;
			return;
		}
		if(js_Boot.__implements(this._currentRightView,feathers_core_IUIControl)) {
			this._currentRightView.initializeNow();
		}
		if(this._rightViewMeasurements == null) {
			this._rightViewMeasurements = new feathers_layout_Measurements(this._currentRightView);
		} else {
			this._rightViewMeasurements.save(this._currentRightView);
		}
		if(js_Boot.__implements(this._currentRightView,feathers_skins_IProgrammaticSkin)) {
			this._currentRightView.set_uiContext(this);
		}
		if(js_Boot.__implements(this._currentRightView,feathers_core_IStateObserver)) {
			this._currentRightView.set_stateContext(this);
		}
		this._currentRightView.addEventListener("resize",$bind(this,this.textInput_rightView_resizeHandler),false,0,true);
		this.addChild(this._currentRightView);
	}
	,getCurrentRightView: function() {
		return this.get_rightView();
	}
	,removeCurrentRightView: function(view) {
		if(view == null) {
			return;
		}
		view.removeEventListener("resize",$bind(this,this.textInput_rightView_resizeHandler));
		if(js_Boot.__implements(view,feathers_skins_IProgrammaticSkin)) {
			view.set_uiContext(null);
		}
		if(js_Boot.__implements(view,feathers_core_IStateObserver)) {
			view.set_stateContext(null);
		}
		this._rightViewMeasurements.restore(view);
		if(view.parent == this) {
			this.removeChild(view);
		}
	}
	,measure: function() {
		var needsWidth = this.get_explicitWidth() == null;
		var needsHeight = this.get_explicitHeight() == null;
		var needsMinWidth = this.get_explicitMinWidth() == null;
		var needsMinHeight = this.get_explicitMinHeight() == null;
		var needsMaxWidth = this.get_explicitMaxWidth() == null;
		var needsMaxHeight = this.get_explicitMaxHeight() == null;
		if(!needsWidth && !needsHeight && !needsMinWidth && !needsMinHeight && !needsMaxWidth && !needsMaxHeight) {
			return false;
		}
		if(this._backgroundSkinMeasurements != null) {
			feathers_utils_MeasurementsUtil.resetFluidlyWithParent(this._backgroundSkinMeasurements,this._currentBackgroundSkin,this);
		}
		var measureSkin = null;
		if(js_Boot.__implements(this._currentBackgroundSkin,feathers_core_IMeasureObject)) {
			measureSkin = this._currentBackgroundSkin;
		}
		if(js_Boot.__implements(this._currentBackgroundSkin,feathers_core_IValidating)) {
			this._currentBackgroundSkin.validateNow();
		}
		var oldIgnoreLeftViewResize = this._ignoreLeftViewResize;
		this._ignoreLeftViewResize = true;
		var oldIgnoreRightViewResize = this._ignoreRightViewResize;
		this._ignoreRightViewResize = true;
		var measureLeftView = null;
		if(js_Boot.__implements(this._currentLeftView,feathers_core_IMeasureObject)) {
			measureLeftView = this._currentLeftView;
		}
		if(js_Boot.__implements(this._currentLeftView,feathers_core_IValidating)) {
			this._currentLeftView.validateNow();
		}
		var measureRightView = null;
		if(js_Boot.__implements(this._currentRightView,feathers_core_IMeasureObject)) {
			measureRightView = this._currentRightView;
		}
		if(js_Boot.__implements(this._currentRightView,feathers_core_IValidating)) {
			this._currentRightView.validateNow();
		}
		this._ignoreLeftViewResize = oldIgnoreLeftViewResize;
		this._ignoreRightViewResize = oldIgnoreRightViewResize;
		var newWidth = this.get_explicitWidth();
		if(needsWidth) {
			if(this.get_autoSizeWidth() || this._measureText != null) {
				newWidth = this._textMeasuredWidth;
			} else {
				newWidth = 0.0;
			}
			if(this._prompt != null) {
				newWidth = Math.max(newWidth,this._promptTextMeasuredWidth);
			}
			if(measureLeftView != null) {
				newWidth += measureLeftView.get_width() + this.get_leftViewGap();
			} else if(this._leftViewMeasurements != null && this._leftViewMeasurements.width != null) {
				newWidth += this._leftViewMeasurements.width + this.get_leftViewGap();
			}
			if(measureRightView != null) {
				newWidth += measureRightView.get_width() + this.get_rightViewGap();
			} else if(this._rightViewMeasurements != null && this._rightViewMeasurements.width != null) {
				newWidth += this._rightViewMeasurements.width + this.get_rightViewGap();
			}
			newWidth += this.get_paddingLeft() + this.get_paddingRight();
			if(this._currentBackgroundSkin != null) {
				newWidth = Math.max(this._currentBackgroundSkin.get_width(),newWidth);
			}
		}
		var newHeight = this.get_explicitHeight();
		if(needsHeight) {
			newHeight = this._textMeasuredHeight;
			if(this._prompt != null) {
				newHeight = Math.max(newHeight,this._promptTextMeasuredHeight);
			}
			if(measureLeftView != null && newHeight < measureLeftView.get_height()) {
				newHeight = measureLeftView.get_height();
			} else if(this._leftViewMeasurements != null && newHeight < this._leftViewMeasurements.height) {
				newHeight = this._leftViewMeasurements.height;
			}
			if(measureRightView != null && newHeight < measureRightView.get_height()) {
				newHeight = measureRightView.get_height();
			} else if(this._rightViewMeasurements != null && newHeight < this._rightViewMeasurements.height) {
				newHeight = this._rightViewMeasurements.height;
			}
			newHeight += this.get_paddingTop() + this.get_paddingBottom();
			if(this._currentBackgroundSkin != null) {
				newHeight = Math.max(this._currentBackgroundSkin.get_height(),newHeight);
			}
		}
		var newMinWidth = this.get_explicitMinWidth();
		if(needsMinWidth) {
			if(this.get_autoSizeWidth() || this._measureText != null) {
				newMinWidth = this._textMeasuredWidth;
			} else {
				newMinWidth = 0.0;
			}
			if(this._prompt != null) {
				newMinWidth = Math.max(newMinWidth,this._promptTextMeasuredWidth);
			}
			if(measureLeftView != null) {
				newMinWidth += measureLeftView.get_minWidth() + this.get_leftViewGap();
			} else if(this._leftViewMeasurements != null && this._leftViewMeasurements.minWidth != null) {
				newMinWidth += this._leftViewMeasurements.minWidth + this.get_leftViewGap();
			}
			if(measureRightView != null) {
				newMinWidth += measureRightView.get_minWidth() + this.get_rightViewGap();
			} else if(this._rightViewMeasurements != null && this._rightViewMeasurements.minWidth != null) {
				newMinWidth += this._rightViewMeasurements.minWidth + this.get_rightViewGap();
			}
			newMinWidth += this.get_paddingLeft() + this.get_paddingRight();
			if(measureSkin != null) {
				newMinWidth = Math.max(measureSkin.get_minWidth(),newMinWidth);
			} else if(this._backgroundSkinMeasurements != null && this._backgroundSkinMeasurements.minWidth != null) {
				newMinWidth = Math.max(this._backgroundSkinMeasurements.minWidth,newMinWidth);
			}
		}
		var newMinHeight = this.get_explicitMinHeight();
		if(needsMinHeight) {
			newMinHeight = this._textMeasuredHeight;
			if(this._prompt != null) {
				newMinHeight = Math.max(newMinHeight,this._promptTextMeasuredHeight);
			}
			if(measureLeftView != null && newMinHeight < measureLeftView.get_minHeight()) {
				newMinHeight = measureLeftView.get_minHeight();
			} else if(this._leftViewMeasurements != null && newMinHeight < this._leftViewMeasurements.minHeight) {
				newMinHeight = this._leftViewMeasurements.minHeight;
			}
			if(measureRightView != null && newMinHeight < measureRightView.get_minHeight()) {
				newMinHeight = measureRightView.get_minHeight();
			} else if(this._rightViewMeasurements != null && newMinHeight < this._rightViewMeasurements.minHeight) {
				newMinHeight = this._rightViewMeasurements.minHeight;
			}
			newMinHeight += this.get_paddingTop() + this.get_paddingBottom();
			if(measureSkin != null) {
				newMinHeight = Math.max(measureSkin.get_minHeight(),newMinHeight);
			} else if(this._backgroundSkinMeasurements != null && this._backgroundSkinMeasurements.minHeight != null) {
				newMinHeight = Math.max(this._backgroundSkinMeasurements.minHeight,newMinHeight);
			}
		}
		var newMaxWidth = this.get_explicitMaxWidth();
		if(needsMaxWidth) {
			if(measureSkin != null) {
				newMaxWidth = measureSkin.get_maxWidth();
			} else if(this._backgroundSkinMeasurements != null && this._backgroundSkinMeasurements.maxWidth != null) {
				newMaxWidth = this._backgroundSkinMeasurements.maxWidth;
			} else {
				newMaxWidth = 1.0 / 0.0;
			}
		}
		var newMaxHeight = this.get_explicitMaxHeight();
		if(needsMaxHeight) {
			if(measureSkin != null) {
				newMaxHeight = measureSkin.get_maxHeight();
			} else if(this._backgroundSkinMeasurements != null && this._backgroundSkinMeasurements.maxHeight != null) {
				newMaxHeight = this._backgroundSkinMeasurements.maxHeight;
			} else {
				newMaxHeight = 1.0 / 0.0;
			}
		}
		return this.saveMeasurements(newWidth,newHeight,newMinWidth,newMinHeight,newMaxWidth,newMaxHeight);
	}
	,refreshTextFieldType: function() {
		if(this._enabled && this._editable && this.textField.get_type() != 1) {
			this.textField.set_type(1);
		} else if((!this._enabled || !this._editable) && this.textField.get_type() == 1) {
			this.textField.set_type(0);
		}
	}
	,refreshTextStyles: function() {
		this.refreshTextFieldType();
		if(this.textField.get_embedFonts() != this.get_embedFonts()) {
			this.textField.set_embedFonts(this.get_embedFonts());
			this._updatedTextStyles = true;
		}
		if(this.textField.get_displayAsPassword() != this._displayAsPassword) {
			this.textField.set_displayAsPassword(this._displayAsPassword);
			this._updatedTextStyles = true;
		}
		var textFormat = this.getCurrentTextFormat();
		var simpleTextFormat = textFormat != null ? textFormat.toSimpleTextFormat() : null;
		if(simpleTextFormat == this._previousSimpleTextFormat) {
			return;
		}
		if(this._previousTextFormat != null) {
			this._previousTextFormat.removeEventListener("change",$bind(this,this.textInput_textFormat_changeHandler));
		}
		if(textFormat != null) {
			textFormat.addEventListener("change",$bind(this,this.textInput_textFormat_changeHandler),false,0,true);
			this.textField.set_defaultTextFormat(simpleTextFormat);
			this._updatedTextStyles = true;
		}
		this._previousTextFormat = textFormat;
		this._previousSimpleTextFormat = simpleTextFormat;
	}
	,refreshPrompt: function() {
		if(this._prompt == null) {
			if(this.promptTextField != null) {
				this.removeChild(this.promptTextField);
				this.promptTextField = null;
			}
			return;
		}
		if(this.promptTextField == null) {
			this.promptTextField = new openfl_text_TextField();
			this.addChildAt(this.promptTextField,this.getChildIndex(this.textField));
		}
		this.promptTextField.set_selectable(false);
		this.promptTextField.set_mouseWheelEnabled(false);
		this.promptTextField.mouseEnabled = false;
		this.promptTextField.set_visible(this._text.length == 0 && (this.get_currentState() != feathers_controls_TextInputState.FOCUSED || this.get_showPromptWhenEmptyAndFocused()));
	}
	,refreshPromptText: function(forceMeasurement) {
		if(this._prompt == null || this._prompt == this._previousPrompt && !this._updatedPromptStyles && !forceMeasurement) {
			return;
		}
		this.promptTextField.set_autoSize(1);
		var hasPromptText = this._prompt.length > 0;
		if(hasPromptText) {
			this.promptTextField.set_text(this._prompt);
		} else {
			this.promptTextField.set_text("​");
		}
		this._promptTextMeasuredWidth = this.promptTextField.get_width();
		this._promptTextMeasuredHeight = this.promptTextField.get_height();
		this.promptTextField.set_autoSize(2);
		if(!hasPromptText) {
			this.promptTextField.set_text("");
		}
		this._previousPrompt = this._prompt;
	}
	,refreshPromptStyles: function() {
		if(this._prompt == null) {
			return;
		}
		if(this.promptTextField.get_embedFonts() != this.get_embedFonts()) {
			this.promptTextField.set_embedFonts(this.get_embedFonts());
			this._updatedPromptStyles = true;
		}
		var textFormat = this.getCurrentPromptTextFormat();
		var simpleTextFormat = textFormat != null ? textFormat.toSimpleTextFormat() : null;
		if(simpleTextFormat == this._previousPromptSimpleTextFormat) {
			return;
		}
		if(this._previousPromptTextFormat != null) {
			this._previousPromptTextFormat.removeEventListener("change",$bind(this,this.textInput_promptTextFormat_changeHandler));
		}
		if(textFormat != null) {
			textFormat.addEventListener("change",$bind(this,this.textInput_textFormat_changeHandler),false,0,true);
			this.promptTextField.set_defaultTextFormat(simpleTextFormat);
			this._updatedPromptStyles = true;
		}
		this._previousPromptTextFormat = textFormat;
		this._previousPromptSimpleTextFormat = simpleTextFormat;
	}
	,getCurrentPromptTextFormat: function() {
		var textFormat = this.get_promptTextFormat();
		if(!this._enabled && this.get_disabledTextFormat() != null) {
			textFormat = this.get_disabledTextFormat();
		}
		if(textFormat == null) {
			textFormat = this.get_textFormat();
		}
		return textFormat;
	}
	,refreshText: function(forceMeasurement) {
		this.textField.set_restrict(this.___restrict);
		this.textField.set_maxChars(this._maxChars);
		if(this._editable) {
			this.textField.set_selectable(this._enabled);
		} else {
			this.textField.set_selectable(this._enabled && this._selectable);
		}
		var hasMeasureText = this._measureText != null;
		var measureText = hasMeasureText ? this._measureText : this._text;
		if(measureText == null || measureText.length == 0) {
			hasMeasureText = true;
			measureText = "​";
		}
		if(this._text == this._previousText && measureText == this._previousMeasureText && !this._updatedTextStyles && !forceMeasurement) {
			return;
		}
		this.textField.set_autoSize(1);
		this.textField.set_text(measureText);
		this._textMeasuredWidth = this.textField.get_width();
		this._textMeasuredHeight = this.textField.get_height();
		this.textField.set_autoSize(2);
		var finalText = null;
		if(this._text == null || this._text.length == 0) {
			finalText = "";
		} else if(hasMeasureText) {
			finalText = this._text;
		}
		if(finalText != null) {
			this.textField.set_text(finalText);
		}
		this._previousText = this._text;
		this._previousMeasureText = measureText;
	}
	,refreshSelection: function() {
		if(this._pendingSelectionActiveIndex == -1 && this._pendingSelectionAnchorIndex == -1) {
			return;
		}
		var anchorIndex = this._pendingSelectionAnchorIndex;
		var activeIndex = this._pendingSelectionActiveIndex;
		this._pendingSelectionAnchorIndex = -1;
		this._pendingSelectionActiveIndex = -1;
		this.textField.setSelection(anchorIndex,activeIndex);
	}
	,refreshScrollPosition: function() {
		this.textField.set_scrollH(Math.round(this._scrollX));
	}
	,getCurrentTextFormat: function() {
		var result = this._stateToTextFormat.get(this._currentState);
		if(result != null) {
			return result;
		}
		if(!this._enabled && this.get_disabledTextFormat() != null) {
			return this.get_disabledTextFormat();
		}
		return this.get_textFormat();
	}
	,layoutContent: function() {
		var oldIgnoreLeftViewResize = this._ignoreLeftViewResize;
		this._ignoreLeftViewResize = true;
		var oldIgnoreRightViewResize = this._ignoreRightViewResize;
		this._ignoreRightViewResize = true;
		this.layoutBackgroundSkin();
		var textFieldHeight = this._textMeasuredHeight;
		var maxHeight = this.actualHeight - this.get_paddingTop() - this.get_paddingBottom();
		if(textFieldHeight > maxHeight || this.get_verticalAlign() == feathers_layout_VerticalAlign.JUSTIFY) {
			textFieldHeight = maxHeight;
		}
		if(textFieldHeight < 0.0) {
			textFieldHeight = 0.0;
		}
		this.textField.set_height(textFieldHeight);
		var leftViewOffset = 0.0;
		if(this._currentLeftView != null) {
			if(js_Boot.__implements(this._currentLeftView,feathers_core_IValidating)) {
				this._currentLeftView.validateNow();
			}
			this._currentLeftView.set_x(this.get_paddingLeft());
			this._currentLeftView.set_y(Math.max(this.get_paddingTop(),this.get_paddingTop() + (maxHeight - this._currentLeftView.get_height()) / 2.0));
			leftViewOffset = this._currentLeftView.get_width() + this.get_leftViewGap();
		}
		var rightViewOffset = 0.0;
		if(this._currentRightView != null) {
			if(js_Boot.__implements(this._currentRightView,feathers_core_IValidating)) {
				this._currentRightView.validateNow();
			}
			this._currentRightView.set_x(this.actualWidth - this.get_paddingRight() - this._currentRightView.get_width());
			this._currentRightView.set_y(Math.max(this.get_paddingTop(),this.get_paddingTop() + (maxHeight - this._currentRightView.get_height()) / 2.0));
			rightViewOffset = this._currentRightView.get_width() + this.get_rightViewGap();
		}
		var textFieldWidth = this.actualWidth - this.get_paddingLeft() - this.get_paddingRight() - leftViewOffset - rightViewOffset;
		if(textFieldWidth < 0.0) {
			textFieldWidth = 0.0;
		}
		this.textField.set_width(textFieldWidth);
		this.textField.set_x(this.get_paddingLeft() + leftViewOffset);
		var textField = this.textField;
		switch(this.get_verticalAlign()._hx_index) {
		case 0:
			textField.set_y(this.get_paddingTop());
			break;
		case 2:
			textField.set_y(this.actualHeight - this.get_paddingBottom() - textFieldHeight);
			break;
		case 3:
			textField.set_y(this.get_paddingTop());
			break;
		default:
			textField.set_y(this.get_paddingTop() + (maxHeight - textFieldHeight) / 2.0);
		}
		if(this.promptTextField != null) {
			this.promptTextField.set_width(textFieldWidth);
			var textFieldHeight = this._promptTextMeasuredHeight;
			if(textFieldHeight > maxHeight || this.get_verticalAlign() == feathers_layout_VerticalAlign.JUSTIFY) {
				textFieldHeight = maxHeight;
			}
			if(textFieldHeight < 0.0) {
				textFieldHeight = 0.0;
			}
			this.promptTextField.set_height(textFieldHeight);
			this.promptTextField.set_x(this.get_paddingLeft() + leftViewOffset);
			var textField = this.promptTextField;
			switch(this.get_verticalAlign()._hx_index) {
			case 0:
				textField.set_y(this.get_paddingTop());
				break;
			case 2:
				textField.set_y(this.actualHeight - this.get_paddingBottom() - textFieldHeight);
				break;
			case 3:
				textField.set_y(this.get_paddingTop());
				break;
			default:
				textField.set_y(this.get_paddingTop() + (maxHeight - textFieldHeight) / 2.0);
			}
		}
		this._ignoreLeftViewResize = oldIgnoreLeftViewResize;
		this._ignoreRightViewResize = oldIgnoreRightViewResize;
	}
	,alignTextField: function(textField,textFieldHeight,maxHeight) {
		switch(this.get_verticalAlign()._hx_index) {
		case 0:
			textField.set_y(this.get_paddingTop());
			break;
		case 2:
			textField.set_y(this.actualHeight - this.get_paddingBottom() - textFieldHeight);
			break;
		case 3:
			textField.set_y(this.get_paddingTop());
			break;
		default:
			textField.set_y(this.get_paddingTop() + (maxHeight - textFieldHeight) / 2.0);
		}
	}
	,layoutBackgroundSkin: function() {
		if(this._currentBackgroundSkin == null) {
			return;
		}
		this._currentBackgroundSkin.set_x(0.0);
		this._currentBackgroundSkin.set_y(0.0);
		if(this._currentBackgroundSkin.get_width() != this.actualWidth) {
			this._currentBackgroundSkin.set_width(this.actualWidth);
		}
		if(this._currentBackgroundSkin.get_height() != this.actualHeight) {
			this._currentBackgroundSkin.set_height(this.actualHeight);
		}
		if(js_Boot.__implements(this._currentBackgroundSkin,feathers_core_IValidating)) {
			this._currentBackgroundSkin.validateNow();
		}
	}
	,refreshErrorString: function() {
		if(this.errorStringCallout == null) {
			return;
		}
		this.errorStringCallout.set_text(this._errorString);
		if(this._currentState == feathers_controls_TextInputState.FOCUSED && this.errorStringCallout.parent == null) {
			feathers_core_PopUpManager.addPopUp(this.errorStringCallout,this,false,false);
		} else if(this._currentState != feathers_controls_TextInputState.FOCUSED && this.errorStringCallout.parent != null) {
			this.errorStringCallout.parent.removeChild(this.errorStringCallout);
		}
	}
	,createErrorCallout: function() {
		this.destroyErrorCallout();
		if(this._errorString == null || this._errorString.length == 0) {
			return;
		}
		var factory = this._errorCalloutFactory != null ? this._errorCalloutFactory : feathers_controls_TextInput.defaultErrorCalloutFactory;
		this._oldErrorCalloutFactory = factory;
		this.errorStringCallout = factory.create();
		if(this.errorStringCallout.get_variant() == null) {
			this.errorStringCallout.set_variant(this.get_customErrorCalloutVariant() != null ? this.get_customErrorCalloutVariant() : feathers_controls_TextInput.CHILD_VARIANT_ERROR_CALLOUT);
		}
		this.errorStringCallout.set_origin(this);
		this.errorStringCallout.closeOnPointerOutside = false;
	}
	,destroyErrorCallout: function() {
		if(this.errorStringCallout == null) {
			return;
		}
		if(this.errorStringCallout.parent != null) {
			this.errorStringCallout.parent.removeChild(this.errorStringCallout);
		}
		if(this._oldErrorCalloutFactory.destroy != null) {
			this._oldErrorCalloutFactory.destroy(this.errorStringCallout);
		}
		this._oldErrorCalloutFactory = null;
		this.errorStringCallout = null;
	}
	,changeState: function(state) {
		if(!this._enabled) {
			state = feathers_controls_TextInputState.DISABLED;
		}
		if(this._currentState == state) {
			return;
		}
		this._currentState = state;
		this.setInvalid(feathers_core_InvalidationFlag.STATE);
		feathers_events_FeathersEvent.dispatch(this,"stateChange");
	}
	,getCurrentFocusRectSkin: function() {
		if(this._errorString != null && this.get_errorFocusRectSkin() != null) {
			return this.get_errorFocusRectSkin();
		}
		return feathers_core_FeathersControl.prototype.getCurrentFocusRectSkin.call(this);
	}
	,refreshState: function() {
		if(this._enabled) {
			var focused = this.stage != null && this.stage.get_focus() == this.textField;
			var error = this._errorString != null;
			if(focused && (!error || this._focusedStatePriority >= this._errorStatePriority)) {
				this.changeState(feathers_controls_TextInputState.FOCUSED);
			} else if(error) {
				this.changeState(feathers_controls_TextInputState.ERROR);
			} else {
				this.changeState(feathers_controls_TextInputState.ENABLED);
			}
		} else {
			this.changeState(feathers_controls_TextInputState.DISABLED);
		}
	}
	,textInput_textField_changeHandler: function(event) {
		event.stopPropagation();
		var oldText = this._text;
		var newText = this.textField.get_text();
		this._text = newText;
		var hasMeasureText = this._measureText != null;
		var measureText = hasMeasureText ? this._measureText : this._text;
		if(measureText == null || measureText.length == 0) {
			hasMeasureText = true;
			measureText = "​";
		}
		var hasText = this._text != null && this._text.length > 0;
		var hasOldText = oldText != null && oldText.length > 0;
		var hasPrompt = this._prompt != null && this._prompt.length > 0;
		if(this.get_autoSizeWidth() || hasPrompt && (!hasText && hasOldText || hasText && !hasOldText)) {
			this.setInvalid(feathers_core_InvalidationFlag.DATA);
		} else {
			this._previousMeasureText = measureText;
			this._previousText = this._text;
		}
		feathers_events_FeathersEvent.dispatch(this,"change");
	}
	,textInput_textField_scrollHandler: function(event) {
		this._scrollX = this.textField.get_scrollH();
		feathers_events_FeathersEvent.dispatch(this,"scroll");
	}
	,textInput_focusInHandler: function(event) {
		if(this.stage != null && this.stage.get_focus() != this.textField) {
			event.stopImmediatePropagation();
			this.stage.set_focus(this.textField);
		}
		this.refreshState();
	}
	,textInput_focusOutHandler: function(event) {
		this.refreshState();
	}
	,textInput_textFormat_changeHandler: function(event) {
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
	}
	,textInput_promptTextFormat_changeHandler: function(event) {
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
	}
	,textInput_leftView_resizeHandler: function(event) {
		if(this._ignoreLeftViewResize) {
			return;
		}
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
	}
	,textInput_rightView_resizeHandler: function(event) {
		if(this._ignoreRightViewResize) {
			return;
		}
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
	}
	,__backgroundSkin: null
	,get_backgroundSkin: function() {
		return this.__backgroundSkin;
	}
	,set_backgroundSkin: function(value) {
		if(!this.setStyle("backgroundSkin")) {
			return this.__backgroundSkin;
		}
		if(this.__backgroundSkin == value) {
			return this.__backgroundSkin;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_backgroundSkin);
		this.__backgroundSkin = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__backgroundSkin;
	}
	,clearStyle_backgroundSkin: function() {
		this.set_backgroundSkin(null);
		return this.get_backgroundSkin();
	}
	,__showPromptWhenEmptyAndFocused: null
	,get_showPromptWhenEmptyAndFocused: function() {
		return this.__showPromptWhenEmptyAndFocused;
	}
	,set_showPromptWhenEmptyAndFocused: function(value) {
		if(!this.setStyle("showPromptWhenEmptyAndFocused")) {
			return this.__showPromptWhenEmptyAndFocused;
		}
		if(this.__showPromptWhenEmptyAndFocused == value) {
			return this.__showPromptWhenEmptyAndFocused;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_showPromptWhenEmptyAndFocused);
		this.__showPromptWhenEmptyAndFocused = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__showPromptWhenEmptyAndFocused;
	}
	,clearStyle_showPromptWhenEmptyAndFocused: function() {
		this.set_showPromptWhenEmptyAndFocused(true);
		return this.get_showPromptWhenEmptyAndFocused();
	}
	,__leftView: null
	,get_leftView: function() {
		return this.__leftView;
	}
	,set_leftView: function(value) {
		if(!this.setStyle("leftView")) {
			return this.__leftView;
		}
		if(this.__leftView == value) {
			return this.__leftView;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_leftView);
		this.__leftView = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__leftView;
	}
	,clearStyle_leftView: function() {
		this.set_leftView(null);
		return this.get_leftView();
	}
	,__leftViewGap: null
	,get_leftViewGap: function() {
		return this.__leftViewGap;
	}
	,set_leftViewGap: function(value) {
		if(!this.setStyle("leftViewGap")) {
			return this.__leftViewGap;
		}
		if(this.__leftViewGap == value) {
			return this.__leftViewGap;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_leftViewGap);
		this.__leftViewGap = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__leftViewGap;
	}
	,clearStyle_leftViewGap: function() {
		this.set_leftViewGap(0.0);
		return this.get_leftViewGap();
	}
	,__rightView: null
	,get_rightView: function() {
		return this.__rightView;
	}
	,set_rightView: function(value) {
		if(!this.setStyle("rightView")) {
			return this.__rightView;
		}
		if(this.__rightView == value) {
			return this.__rightView;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_rightView);
		this.__rightView = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__rightView;
	}
	,clearStyle_rightView: function() {
		this.set_rightView(null);
		return this.get_rightView();
	}
	,__rightViewGap: null
	,get_rightViewGap: function() {
		return this.__rightViewGap;
	}
	,set_rightViewGap: function(value) {
		if(!this.setStyle("rightViewGap")) {
			return this.__rightViewGap;
		}
		if(this.__rightViewGap == value) {
			return this.__rightViewGap;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_rightViewGap);
		this.__rightViewGap = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__rightViewGap;
	}
	,clearStyle_rightViewGap: function() {
		this.set_rightViewGap(0.0);
		return this.get_rightViewGap();
	}
	,__textFormat: null
	,get_textFormat: function() {
		return this.__textFormat;
	}
	,set_textFormat: function(value) {
		if(!this.setStyle("textFormat")) {
			return this.__textFormat;
		}
		if(this.__textFormat == value) {
			return this.__textFormat;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_textFormat);
		this.__textFormat = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__textFormat;
	}
	,clearStyle_textFormat: function() {
		this.set_textFormat(null);
		return this.get_textFormat();
	}
	,__disabledTextFormat: null
	,get_disabledTextFormat: function() {
		return this.__disabledTextFormat;
	}
	,set_disabledTextFormat: function(value) {
		if(!this.setStyle("disabledTextFormat")) {
			return this.__disabledTextFormat;
		}
		if(this.__disabledTextFormat == value) {
			return this.__disabledTextFormat;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_disabledTextFormat);
		this.__disabledTextFormat = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__disabledTextFormat;
	}
	,clearStyle_disabledTextFormat: function() {
		this.set_disabledTextFormat(null);
		return this.get_disabledTextFormat();
	}
	,__promptTextFormat: null
	,get_promptTextFormat: function() {
		return this.__promptTextFormat;
	}
	,set_promptTextFormat: function(value) {
		if(!this.setStyle("promptTextFormat")) {
			return this.__promptTextFormat;
		}
		if(this.__promptTextFormat == value) {
			return this.__promptTextFormat;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_promptTextFormat);
		this.__promptTextFormat = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__promptTextFormat;
	}
	,clearStyle_promptTextFormat: function() {
		this.set_promptTextFormat(null);
		return this.get_promptTextFormat();
	}
	,__embedFonts: null
	,get_embedFonts: function() {
		return this.__embedFonts;
	}
	,set_embedFonts: function(value) {
		if(!this.setStyle("embedFonts")) {
			return this.__embedFonts;
		}
		if(this.__embedFonts == value) {
			return this.__embedFonts;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_embedFonts);
		this.__embedFonts = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__embedFonts;
	}
	,clearStyle_embedFonts: function() {
		this.set_embedFonts(false);
		return this.get_embedFonts();
	}
	,__paddingTop: null
	,get_paddingTop: function() {
		return this.__paddingTop;
	}
	,set_paddingTop: function(value) {
		if(!this.setStyle("paddingTop")) {
			return this.__paddingTop;
		}
		if(this.__paddingTop == value) {
			return this.__paddingTop;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_paddingTop);
		this.__paddingTop = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__paddingTop;
	}
	,clearStyle_paddingTop: function() {
		this.set_paddingTop(0.0);
		return this.get_paddingTop();
	}
	,__paddingRight: null
	,get_paddingRight: function() {
		return this.__paddingRight;
	}
	,set_paddingRight: function(value) {
		if(!this.setStyle("paddingRight")) {
			return this.__paddingRight;
		}
		if(this.__paddingRight == value) {
			return this.__paddingRight;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_paddingRight);
		this.__paddingRight = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__paddingRight;
	}
	,clearStyle_paddingRight: function() {
		this.set_paddingRight(0.0);
		return this.get_paddingRight();
	}
	,__paddingBottom: null
	,get_paddingBottom: function() {
		return this.__paddingBottom;
	}
	,set_paddingBottom: function(value) {
		if(!this.setStyle("paddingBottom")) {
			return this.__paddingBottom;
		}
		if(this.__paddingBottom == value) {
			return this.__paddingBottom;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_paddingBottom);
		this.__paddingBottom = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__paddingBottom;
	}
	,clearStyle_paddingBottom: function() {
		this.set_paddingBottom(0.0);
		return this.get_paddingBottom();
	}
	,__paddingLeft: null
	,get_paddingLeft: function() {
		return this.__paddingLeft;
	}
	,set_paddingLeft: function(value) {
		if(!this.setStyle("paddingLeft")) {
			return this.__paddingLeft;
		}
		if(this.__paddingLeft == value) {
			return this.__paddingLeft;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_paddingLeft);
		this.__paddingLeft = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__paddingLeft;
	}
	,clearStyle_paddingLeft: function() {
		this.set_paddingLeft(0.0);
		return this.get_paddingLeft();
	}
	,__verticalAlign: null
	,get_verticalAlign: function() {
		return this.__verticalAlign;
	}
	,set_verticalAlign: function(value) {
		if(!this.setStyle("verticalAlign")) {
			return this.__verticalAlign;
		}
		if(this.__verticalAlign == value) {
			return this.__verticalAlign;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_verticalAlign);
		this.__verticalAlign = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__verticalAlign;
	}
	,clearStyle_verticalAlign: function() {
		this.set_verticalAlign(feathers_layout_VerticalAlign.MIDDLE);
		return this.get_verticalAlign();
	}
	,__autoSizeWidth: null
	,get_autoSizeWidth: function() {
		return this.__autoSizeWidth;
	}
	,set_autoSizeWidth: function(value) {
		if(!this.setStyle("autoSizeWidth")) {
			return this.__autoSizeWidth;
		}
		if(this.__autoSizeWidth == value) {
			return this.__autoSizeWidth;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_autoSizeWidth);
		this.__autoSizeWidth = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__autoSizeWidth;
	}
	,clearStyle_autoSizeWidth: function() {
		this.set_autoSizeWidth(false);
		return this.get_autoSizeWidth();
	}
	,__errorFocusRectSkin: null
	,get_errorFocusRectSkin: function() {
		return this.__errorFocusRectSkin;
	}
	,set_errorFocusRectSkin: function(value) {
		if(!this.setStyle("errorFocusRectSkin")) {
			return this.__errorFocusRectSkin;
		}
		if(this.__errorFocusRectSkin == value) {
			return this.__errorFocusRectSkin;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_errorFocusRectSkin);
		this.__errorFocusRectSkin = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__errorFocusRectSkin;
	}
	,clearStyle_errorFocusRectSkin: function() {
		this.set_errorFocusRectSkin(null);
		return this.get_errorFocusRectSkin();
	}
	,__customErrorCalloutVariant: null
	,get_customErrorCalloutVariant: function() {
		return this.__customErrorCalloutVariant;
	}
	,set_customErrorCalloutVariant: function(value) {
		if(!this.setStyle("customErrorCalloutVariant")) {
			return this.__customErrorCalloutVariant;
		}
		if(this.__customErrorCalloutVariant == value) {
			return this.__customErrorCalloutVariant;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_customErrorCalloutVariant);
		this.__customErrorCalloutVariant = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__customErrorCalloutVariant;
	}
	,clearStyle_customErrorCalloutVariant: function() {
		this.set_customErrorCalloutVariant(null);
		return this.get_customErrorCalloutVariant();
	}
	,get_styleContext: function() {
		return feathers_controls_TextInput;
	}
	,__class__: feathers_controls_TextInput
	,__properties__: $extend(feathers_core_FeathersControl.prototype.__properties__,{set_customErrorCalloutVariant:"set_customErrorCalloutVariant",get_customErrorCalloutVariant:"get_customErrorCalloutVariant",set_errorCalloutFactory:"set_errorCalloutFactory",get_errorCalloutFactory:"get_errorCalloutFactory",set_focusedStatePriority:"set_focusedStatePriority",get_focusedStatePriority:"get_focusedStatePriority",set_errorStatePriority:"set_errorStatePriority",get_errorStatePriority:"get_errorStatePriority",set_errorFocusRectSkin:"set_errorFocusRectSkin",get_errorFocusRectSkin:"get_errorFocusRectSkin",set_autoSizeWidth:"set_autoSizeWidth",get_autoSizeWidth:"get_autoSizeWidth",set_maxChars:"set_maxChars",get_maxChars:"get_maxChars",get_selectionActiveIndex:"get_selectionActiveIndex",get_selectionAnchorIndex:"get_selectionAnchorIndex",set_scrollX:"set_scrollX",get_scrollX:"get_scrollX",set_verticalAlign:"set_verticalAlign",get_verticalAlign:"get_verticalAlign",set_paddingLeft:"set_paddingLeft",get_paddingLeft:"get_paddingLeft",set_paddingBottom:"set_paddingBottom",get_paddingBottom:"get_paddingBottom",set_paddingRight:"set_paddingRight",get_paddingRight:"get_paddingRight",set_paddingTop:"set_paddingTop",get_paddingTop:"get_paddingTop",set_embedFonts:"set_embedFonts",get_embedFonts:"get_embedFonts",set_promptTextFormat:"set_promptTextFormat",get_promptTextFormat:"get_promptTextFormat",set_disabledTextFormat:"set_disabledTextFormat",get_disabledTextFormat:"get_disabledTextFormat",set_textFormat:"set_textFormat",get_textFormat:"get_textFormat",get_errorStringCalloutOpen:"get_errorStringCalloutOpen",set_errorString:"set_errorString",get_errorString:"get_errorString",set_displayAsPassword:"set_displayAsPassword",get_displayAsPassword:"get_displayAsPassword",set_restrict:"set_restrict",get_restrict:"get_restrict",set_prompt:"set_prompt",get_prompt:"get_prompt",get_baseline:"get_baseline",set_measureText:"set_measureText",get_measureText:"get_measureText",set_text:"set_text",get_text:"get_text",set_rightViewGap:"set_rightViewGap",get_rightViewGap:"get_rightViewGap",set_rightView:"set_rightView",get_rightView:"get_rightView",set_leftViewGap:"set_leftViewGap",get_leftViewGap:"get_leftViewGap",set_leftView:"set_leftView",get_leftView:"get_leftView",set_showPromptWhenEmptyAndFocused:"set_showPromptWhenEmptyAndFocused",get_showPromptWhenEmptyAndFocused:"get_showPromptWhenEmptyAndFocused",set_backgroundSkin:"set_backgroundSkin",get_backgroundSkin:"get_backgroundSkin",get_currentState:"get_currentState",get_stageFocusTarget:"get_stageFocusTarget",set_selectable:"set_selectable",get_selectable:"get_selectable",set_editable:"set_editable",get_editable:"get_editable"})
});
var com_tilbuci_ui_component_IDTextInput = function() {
	this.autoResize = true;
	feathers_controls_TextInput.call(this);
};
$hxClasses["com.tilbuci.ui.component.IDTextInput"] = com_tilbuci_ui_component_IDTextInput;
com_tilbuci_ui_component_IDTextInput.__name__ = "com.tilbuci.ui.component.IDTextInput";
com_tilbuci_ui_component_IDTextInput.__super__ = feathers_controls_TextInput;
com_tilbuci_ui_component_IDTextInput.prototype = $extend(feathers_controls_TextInput.prototype,{
	autoResize: null
	,__class__: com_tilbuci_ui_component_IDTextInput
});
var com_tilbuci_ui_component_InstancesPanel = function(wd) {
	this._calculating = false;
	this._curH = 0;
	this._curW = 0;
	this._curY = 0;
	this._curX = 0;
	com_tilbuci_ui_component_DropDownPanel.call(this,com_tilbuci_data_Global.ln.get("rightbar-instances"),wd);
	this.ui.createHContainer("copybuttons",3355443);
	var tmp = this.ui;
	var tmp1 = openfl_utils_Assets.getBitmapData("btNone");
	var tmp2 = this.ui.hcontainers.h["copybuttons"];
	tmp.createIconButton("none",$bind(this,this.onNone),new openfl_display_Bitmap(tmp1),null,tmp2);
	var tmp = this.ui;
	var tmp1 = openfl_utils_Assets.getBitmapData("btAll");
	var tmp2 = this.ui.hcontainers.h["copybuttons"];
	tmp.createIconButton("all",$bind(this,this.onAll),new openfl_display_Bitmap(tmp1),null,tmp2);
	var tmp = this.ui;
	var tmp1 = openfl_utils_Assets.getBitmapData("btCopy");
	var tmp2 = this.ui.hcontainers.h["copybuttons"];
	tmp.createIconButton("btcopy",$bind(this,this.onCopy),new openfl_display_Bitmap(tmp1),null,tmp2);
	var tmp = this.ui;
	var tmp1 = openfl_utils_Assets.getBitmapData("btPaste");
	var tmp2 = this.ui.hcontainers.h["copybuttons"];
	tmp.createIconButton("btpaste",$bind(this,this.onPaste),new openfl_display_Bitmap(tmp1),null,tmp2);
	this.ui.hcontainers.h["copybuttons"].set_width(wd - 5);
	this.ui.createHContainer("stage",3355443);
	var tmp = this.ui;
	var tmp1 = openfl_utils_Assets.getBitmapData("btStageLeft");
	var tmp2 = this.ui.hcontainers.h["stage"];
	tmp.createIconButton("stageleft",$bind(this,this.onStageLeft),new openfl_display_Bitmap(tmp1),null,tmp2);
	var tmp = this.ui;
	var tmp1 = openfl_utils_Assets.getBitmapData("btStageCenter");
	var tmp2 = this.ui.hcontainers.h["stage"];
	tmp.createIconButton("stagecenter",$bind(this,this.onStageCenter),new openfl_display_Bitmap(tmp1),null,tmp2);
	var tmp = this.ui;
	var tmp1 = openfl_utils_Assets.getBitmapData("btStageRight");
	var tmp2 = this.ui.hcontainers.h["stage"];
	tmp.createIconButton("stageright",$bind(this,this.onStageRight),new openfl_display_Bitmap(tmp1),null,tmp2);
	var tmp = this.ui;
	var tmp1 = openfl_utils_Assets.getBitmapData("btStageTop");
	var tmp2 = this.ui.hcontainers.h["stage"];
	tmp.createIconButton("stagetop",$bind(this,this.onStageTop),new openfl_display_Bitmap(tmp1),null,tmp2);
	var tmp = this.ui;
	var tmp1 = openfl_utils_Assets.getBitmapData("btStageMiddle");
	var tmp2 = this.ui.hcontainers.h["stage"];
	tmp.createIconButton("stagemiddle",$bind(this,this.onStageMiddle),new openfl_display_Bitmap(tmp1),null,tmp2);
	var tmp = this.ui;
	var tmp1 = openfl_utils_Assets.getBitmapData("btStageBottom");
	var tmp2 = this.ui.hcontainers.h["stage"];
	tmp.createIconButton("stagebottom",$bind(this,this.onStageBottom),new openfl_display_Bitmap(tmp1),null,tmp2);
	this.ui.hcontainers.h["stage"].set_width(wd - 5);
	this.ui.createHContainer("selection",3355443);
	var tmp = this.ui;
	var tmp1 = openfl_utils_Assets.getBitmapData("btSelectionLeft");
	var tmp2 = this.ui.hcontainers.h["selection"];
	tmp.createIconButton("selectionleft",$bind(this,this.onSelectionLeft),new openfl_display_Bitmap(tmp1),null,tmp2);
	var tmp = this.ui;
	var tmp1 = openfl_utils_Assets.getBitmapData("btSelectionCenter");
	var tmp2 = this.ui.hcontainers.h["selection"];
	tmp.createIconButton("selectioncenter",$bind(this,this.onSelectionCenter),new openfl_display_Bitmap(tmp1),null,tmp2);
	var tmp = this.ui;
	var tmp1 = openfl_utils_Assets.getBitmapData("btSelectionRight");
	var tmp2 = this.ui.hcontainers.h["selection"];
	tmp.createIconButton("selectionright",$bind(this,this.onSelectionRight),new openfl_display_Bitmap(tmp1),null,tmp2);
	var tmp = this.ui;
	var tmp1 = openfl_utils_Assets.getBitmapData("btSelectionTop");
	var tmp2 = this.ui.hcontainers.h["selection"];
	tmp.createIconButton("selectiontop",$bind(this,this.onSelectionTop),new openfl_display_Bitmap(tmp1),null,tmp2);
	var tmp = this.ui;
	var tmp1 = openfl_utils_Assets.getBitmapData("btSelectionMiddle");
	var tmp2 = this.ui.hcontainers.h["selection"];
	tmp.createIconButton("selectionmiddle",$bind(this,this.onSelectionMiddle),new openfl_display_Bitmap(tmp1),null,tmp2);
	var tmp = this.ui;
	var tmp1 = openfl_utils_Assets.getBitmapData("btSelectionBottom");
	var tmp2 = this.ui.hcontainers.h["selection"];
	tmp.createIconButton("selectionbottom",$bind(this,this.onSelectionBottom),new openfl_display_Bitmap(tmp1),null,tmp2);
	this.ui.hcontainers.h["selection"].set_width(wd - 5);
	this.ui.createHContainer("distribute",3355443);
	var tmp = this.ui;
	var tmp1 = openfl_utils_Assets.getBitmapData("btDistributeH");
	var tmp2 = this.ui.hcontainers.h["distribute"];
	tmp.createIconButton("distributeh",$bind(this,this.onDistributeH),new openfl_display_Bitmap(tmp1),null,tmp2);
	var tmp = this.ui;
	var tmp1 = openfl_utils_Assets.getBitmapData("btDistributeV");
	var tmp2 = this.ui.hcontainers.h["distribute"];
	tmp.createIconButton("distributev",$bind(this,this.onDistributeV),new openfl_display_Bitmap(tmp1),null,tmp2);
	this.ui.hcontainers.h["distribute"].set_width(wd - 5);
	this.ui.createHContainer("pos",3355443);
	this.ui.createLabel("xpos",com_tilbuci_data_Global.ln.get("rightbar-instances-xpos"),feathers_controls_Label.VARIANT_DETAIL,this.ui.hcontainers.h["pos"]);
	this.ui.createLabel("ypos",com_tilbuci_data_Global.ln.get("rightbar-instances-ypos"),feathers_controls_Label.VARIANT_DETAIL,this.ui.hcontainers.h["pos"]);
	this.ui.hcontainers.h["pos"].set_width(wd - 5);
	this.ui.createHContainer("posnum",3355443);
	this.ui.createNumeric("xpos",-100000,100000,1,0,this.ui.hcontainers.h["posnum"]);
	this.ui.createNumeric("ypos",-100000,100000,1,0,this.ui.hcontainers.h["posnum"]);
	this.ui.hcontainers.h["posnum"].set_width(wd - 5);
	this.ui.createHContainer("size",3355443);
	this.ui.createLabel("xsize",com_tilbuci_data_Global.ln.get("rightbar-instances-xsize"),feathers_controls_Label.VARIANT_DETAIL,this.ui.hcontainers.h["size"]);
	this.ui.createLabel("ysize",com_tilbuci_data_Global.ln.get("rightbar-instances-ysize"),feathers_controls_Label.VARIANT_DETAIL,this.ui.hcontainers.h["size"]);
	this.ui.hcontainers.h["size"].set_width(wd - 5);
	this.ui.createHContainer("sizenum",3355443);
	this.ui.createNumeric("xsize",-100000,100000,1,0,this.ui.hcontainers.h["sizenum"]);
	this.ui.createNumeric("ysize",-100000,100000,1,0,this.ui.hcontainers.h["sizenum"]);
	this.ui.hcontainers.h["sizenum"].set_width(wd - 5);
	var tmp = this.ui;
	var tmp1 = { tp : "Custom", cont : this.ui.hcontainers.h["copybuttons"]};
	var tmp2 = { tp : "Custom", cont : this.ui.hcontainers.h["pos"]};
	var tmp3 = { tp : "Custom", cont : this.ui.hcontainers.h["posnum"]};
	var tmp4 = { tp : "Custom", cont : this.ui.hcontainers.h["size"]};
	var tmp5 = { tp : "Custom", cont : this.ui.hcontainers.h["sizenum"]};
	var tmp6 = { tp : "Custom", cont : this.ui.hcontainers.h["stage"]};
	var tmp7 = { tp : "Custom", cont : this.ui.hcontainers.h["selection"]};
	var tmp8 = { tp : "Custom", cont : this.ui.hcontainers.h["distribute"]};
	var tmp9 = com_tilbuci_data_Global.ln.get("rightbar-instances-rand");
	this._content = tmp.forge("instancepan",[{ tp : "List", id : "ilist", ht : 200, vl : [], sl : null, ch : $bind(this,this.onChange)},tmp1,{ tp : "Spacer", id : "align", ht : 5, ln : false},tmp2,tmp3,tmp4,tmp5,tmp6,tmp7,tmp8,{ tp : "Spacer", id : "extra", ht : 5, ln : false},{ tp : "Button", id : "randbt", tx : tmp9, ac : $bind(this,this.onRand)}],3355443,wd - 5);
	this.ui.lists.h["ilist"].set_layoutData(feathers_layout_AnchorLayoutData.fill());
	this.ui.lists.h["ilist"].itemToText = function(item) {
		return item.text;
	};
	this.ui.lists.h["ilist"].set_allowMultipleSelection(true);
	this.ui.buttons.h["btcopy"].set_enabled(this.ui.buttons.h["btpaste"].set_enabled(false));
	this.ui.buttons.h["btcopy"].set_toolTip(com_tilbuci_data_Global.ln.get("rightbar-instances-noinstances"));
	this.ui.buttons.h["btpaste"].set_toolTip(com_tilbuci_data_Global.ln.get("rightbar-instances-nocopied"));
	this.ui.buttons.h["none"].set_toolTip(com_tilbuci_data_Global.ln.get("rightbar-instances-none"));
	this.ui.buttons.h["all"].set_toolTip(com_tilbuci_data_Global.ln.get("rightbar-instances-all"));
	this.ui.buttons.h["stageleft"].set_toolTip(com_tilbuci_data_Global.ln.get("rightbar-instances-stageleft"));
	this.ui.buttons.h["stagecenter"].set_toolTip(com_tilbuci_data_Global.ln.get("rightbar-instances-stagecenter"));
	this.ui.buttons.h["stageright"].set_toolTip(com_tilbuci_data_Global.ln.get("rightbar-instances-stageright"));
	this.ui.buttons.h["stagetop"].set_toolTip(com_tilbuci_data_Global.ln.get("rightbar-instances-stagetop"));
	this.ui.buttons.h["stagemiddle"].set_toolTip(com_tilbuci_data_Global.ln.get("rightbar-instances-stagemiddle"));
	this.ui.buttons.h["stagebottom"].set_toolTip(com_tilbuci_data_Global.ln.get("rightbar-instances-stagebottom"));
	this.ui.buttons.h["selectionleft"].set_toolTip(com_tilbuci_data_Global.ln.get("rightbar-instances-selectionleft"));
	this.ui.buttons.h["selectioncenter"].set_toolTip(com_tilbuci_data_Global.ln.get("rightbar-instances-selectioncenter"));
	this.ui.buttons.h["selectionright"].set_toolTip(com_tilbuci_data_Global.ln.get("rightbar-instances-selectionright"));
	this.ui.buttons.h["selectiontop"].set_toolTip(com_tilbuci_data_Global.ln.get("rightbar-instances-selectiontop"));
	this.ui.buttons.h["selectionmiddle"].set_toolTip(com_tilbuci_data_Global.ln.get("rightbar-instances-selectionmiddle"));
	this.ui.buttons.h["selectionbottom"].set_toolTip(com_tilbuci_data_Global.ln.get("rightbar-instances-selectionbottom"));
	this.ui.buttons.h["distributeh"].set_toolTip(com_tilbuci_data_Global.ln.get("rightbar-instances-disth"));
	this.ui.buttons.h["distributev"].set_toolTip(com_tilbuci_data_Global.ln.get("rightbar-instances-distv"));
	this.ui.numerics.h["xpos"].addEventListener("change",$bind(this,this.onChangePosX));
	this.ui.numerics.h["ypos"].addEventListener("change",$bind(this,this.onChangePosY));
	this.ui.numerics.h["xsize"].addEventListener("change",$bind(this,this.onChangeSizeX));
	this.ui.numerics.h["ysize"].addEventListener("change",$bind(this,this.onChangeSizeY));
	com_tilbuci_data_Global.copy.updateDisplay = $bind(this,this.updatePaste);
};
$hxClasses["com.tilbuci.ui.component.InstancesPanel"] = com_tilbuci_ui_component_InstancesPanel;
com_tilbuci_ui_component_InstancesPanel.__name__ = "com.tilbuci.ui.component.InstancesPanel";
com_tilbuci_ui_component_InstancesPanel.__super__ = com_tilbuci_ui_component_DropDownPanel;
com_tilbuci_ui_component_InstancesPanel.prototype = $extend(com_tilbuci_ui_component_DropDownPanel.prototype,{
	_curX: null
	,_curY: null
	,_curW: null
	,_curH: null
	,_calculating: null
	,onCopy: function(evt) {
		if(this.ui.lists.h["ilist"].get_selectedItems().length > 0) {
			com_tilbuci_data_Global.copy.clear();
			var _g = 0;
			var _g1 = this.ui.lists.h["ilist"].get_selectedItems();
			while(_g < _g1.length) {
				var inst = _g1[_g];
				++_g;
				var this1 = com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[com_tilbuci_data_GlobalPlayer.area.get_currentKf()];
				if(Object.prototype.hasOwnProperty.call(this1.h,inst.value)) {
					if(com_tilbuci_data_Global.copy.addCollection(com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[com_tilbuci_data_GlobalPlayer.area.get_currentKf()].h[inst.value].collection)) {
						com_tilbuci_data_Global.copy.addInstance(inst.value,com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[com_tilbuci_data_GlobalPlayer.area.get_currentKf()].h[inst.value]);
					}
				}
			}
		}
		com_tilbuci_data_Global.copy.broadcast();
		this.updatePaste();
	}
	,onPaste: function(evt) {
		if(com_tilbuci_data_Global.copy.hasCopy() && com_tilbuci_data_GlobalPlayer.movie.get_scId() != "") {
			com_tilbuci_data_Global.copy.pasteInstances();
		}
	}
	,onNone: function(evt) {
		com_tilbuci_data_GlobalPlayer.area.imgSelect();
		this.reloadContent();
		var _g = 0;
		var _g1 = this.callbacks;
		while(_g < _g1.length) {
			var cb = _g1[_g];
			++_g;
			var _g2 = new haxe_ds_StringMap();
			_g2.h["nm"] = "";
			cb(_g2);
		}
		this.updatePaste();
	}
	,onAll: function(evt) {
		com_tilbuci_data_GlobalPlayer.area.imgSelect();
		this.reloadContent();
		var indices = [];
		var _g = 0;
		var _g1 = this.ui.lists.h["ilist"].get_dataProvider().get_length();
		while(_g < _g1) {
			var n = _g++;
			indices.push(n);
		}
		this.ui.lists.h["ilist"].set_selectedIndices(indices);
		this.updatePaste();
	}
	,onRand: function(evt) {
		if(this.ui.lists.h["ilist"].get_dataProvider().get_length() > 0) {
			com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("rightbar-instances"),com_tilbuci_data_Global.ln.get("rightbar-instances-randcheck"),340,205,com_tilbuci_data_Global.ln.get("default-ok"),$bind(this,this.onRandConf),"confirm",com_tilbuci_data_Global.ln.get("default-cancel"));
		}
		this.updatePaste();
	}
	,onRandConf: function(ok) {
		if(ok) {
			var nms = [];
			var _g = 0;
			var _g1 = this.ui.lists.h["ilist"].get_dataProvider().get_length();
			while(_g < _g1) {
				var i = _g++;
				var ch = true;
				if(this.ui.lists.h["ilist"].get_selectedItem() != null) {
					if(i == this.ui.lists.h["ilist"].get_selectedIndex()) {
						ch = false;
					}
				}
				if(ch) {
					var name = this.ui.lists.h["ilist"].get_dataProvider().get(i).text;
					var newname = HxOverrides.substr(com_tilbuci_statictools_StringStatic.random(),0,10);
					while(nms.indexOf(newname) != -1) newname = HxOverrides.substr(com_tilbuci_statictools_StringStatic.random(),0,10);
					nms.push(newname);
					com_tilbuci_data_GlobalPlayer.area.imgSelect(name);
					com_tilbuci_data_GlobalPlayer.area.setCurrentStr("instance",newname);
				}
			}
			com_tilbuci_data_GlobalPlayer.area.imgSelect();
			this.reloadContent();
		}
		this.updatePaste();
	}
	,reloadContent: function(data) {
		var items = [];
		var h = com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[com_tilbuci_data_GlobalPlayer.area.get_currentKf()].h;
		var k_h = h;
		var k_keys = Object.keys(h);
		var k_length = k_keys.length;
		var k_current = 0;
		while(k_current < k_length) {
			var k = k_keys[k_current++];
			items.push({ text : k, value : k});
		}
		this.ui.lists.h["ilist"].set_dataProvider(new feathers_data_ArrayCollection(items));
		this.ui.buttons.h["btcopy"].set_enabled(false);
		this.ui.buttons.h["btcopy"].set_toolTip(com_tilbuci_data_Global.ln.get("rightbar-instances-noinstances"));
		this.updatePaste();
	}
	,updateContent: function(data) {
		if(this.ui.lists.h["ilist"].get_dataProvider() != null) {
			var _g = 0;
			var _g1 = this.ui.lists.h["ilist"].get_dataProvider().get_length();
			while(_g < _g1) {
				var n = _g++;
				if(this.ui.lists.h["ilist"].get_dataProvider().get(n) != null) {
					if(this.ui.lists.h["ilist"].get_dataProvider().get(n).value == data.h["nm"]) {
						this.ui.lists.h["ilist"].set_selectedIndex(n);
					}
				}
			}
		}
		this.updatePaste();
	}
	,instanceRename: function(oldn,newn) {
		if(this.ui.lists.h["ilist"].get_dataProvider() != null) {
			var _g = 0;
			var _g1 = this.ui.lists.h["ilist"].get_dataProvider().get_length();
			while(_g < _g1) {
				var n = _g++;
				if(this.ui.lists.h["ilist"].get_dataProvider().get(n) != null) {
					if(this.ui.lists.h["ilist"].get_dataProvider().get(n).value == oldn) {
						this.ui.lists.h["ilist"].get_dataProvider().get(n).text = newn;
						this.ui.lists.h["ilist"].get_dataProvider().get(n).value = newn;
						this.ui.lists.h["ilist"].set_selectedIndex(n);
						this.ui.lists.h["ilist"].get_dataProvider().updateAt(this.ui.lists.h["ilist"].get_selectedIndex());
					}
				}
			}
		}
		this.updatePaste();
	}
	,onChange: function(evt) {
		if(this.ui.lists.h["ilist"].get_selectedItems().length == 1) {
			com_tilbuci_data_GlobalPlayer.area.imgSelect(this.ui.lists.h["ilist"].get_selectedItems()[0].value);
			var _g = 0;
			var _g1 = this.callbacks;
			while(_g < _g1.length) {
				var cb = _g1[_g];
				++_g;
				var _g2 = new haxe_ds_StringMap();
				var value = this.ui.lists.h["ilist"].get_selectedItems()[0].value;
				_g2.h["nm"] = value;
				cb(_g2);
			}
			this.ui.buttons.h["btcopy"].set_enabled(true);
			this.ui.buttons.h["btcopy"].set_toolTip(com_tilbuci_data_Global.ln.get("rightbar-instances-copy"));
			this.getNums();
		} else if(this.ui.lists.h["ilist"].get_selectedItems().length > 1) {
			com_tilbuci_data_GlobalPlayer.area.imgSelect(null);
			this.ui.buttons.h["btcopy"].set_enabled(true);
			this.ui.buttons.h["btcopy"].set_toolTip(com_tilbuci_data_Global.ln.get("rightbar-instances-copy"));
			var insts = [];
			var _g = 0;
			var _g1 = this.ui.lists.h["ilist"].get_selectedItems();
			while(_g < _g1.length) {
				var it = _g1[_g];
				++_g;
				insts.push(it.value);
			}
			com_tilbuci_data_GlobalPlayer.area.imgSelectMultiple(insts);
			this.getNums();
		} else {
			this.ui.buttons.h["btcopy"].set_enabled(false);
			this.ui.buttons.h["btcopy"].set_toolTip(com_tilbuci_data_Global.ln.get("rightbar-instances-noinstances"));
		}
		this.updatePaste();
	}
	,getNums: function() {
		this._calculating = true;
		var nx = null;
		var ny = null;
		var nw = null;
		var nh = null;
		var endx = null;
		var endy = null;
		var _g = 0;
		var _g1 = this.ui.lists.h["ilist"].get_selectedItems();
		while(_g < _g1.length) {
			var inst = _g1[_g];
			++_g;
			var ref = com_tilbuci_data_GlobalPlayer.area.pickInstance(inst.value);
			if(ref != null) {
				if(nx == null || nx > ref.get_x()) {
					nx = ref.get_x();
				}
				if(ny == null || ny > ref.get_y()) {
					ny = ref.get_y();
				}
				if(endx == null || endx < ref.get_x() + ref.get_width()) {
					endx = ref.get_x() + ref.get_width();
				}
				if(endy == null || endy < ref.get_y() + ref.get_height()) {
					endy = ref.get_y() + ref.get_height();
				}
				nw = endx - nx;
				nh = endy - ny;
			}
		}
		if(nx != null) {
			this._curX = this.ui.numerics.h["xpos"].set_value(Math.round(nx));
			this._curY = this.ui.numerics.h["ypos"].set_value(Math.round(ny));
			this._curW = this.ui.numerics.h["xsize"].set_value(Math.round(nw));
			this._curH = this.ui.numerics.h["ysize"].set_value(Math.round(nh));
		}
		this._calculating = false;
	}
	,onChangePosX: function(evt) {
		if(!this._calculating && this.ui.lists.h["ilist"].get_selectedItems().length > 0) {
			var change = this._curX - this.ui.numerics.h["xpos"].get_value();
			var _g = 0;
			var _g1 = this.ui.lists.h["ilist"].get_selectedItems();
			while(_g < _g1.length) {
				var inst = _g1[_g];
				++_g;
				var ref = com_tilbuci_data_GlobalPlayer.area.pickInstance(inst.value);
				if(ref != null) {
					ref.set_x(ref.get_x() - change);
				}
			}
			this.onChange(null);
		}
	}
	,onChangePosY: function(evt) {
		if(!this._calculating && this.ui.lists.h["ilist"].get_selectedItems().length > 0) {
			var change = this._curY - this.ui.numerics.h["ypos"].get_value();
			var _g = 0;
			var _g1 = this.ui.lists.h["ilist"].get_selectedItems();
			while(_g < _g1.length) {
				var inst = _g1[_g];
				++_g;
				var ref = com_tilbuci_data_GlobalPlayer.area.pickInstance(inst.value);
				if(ref != null) {
					ref.set_y(ref.get_y() - change);
				}
			}
			this.onChange(null);
		}
	}
	,onChangeSizeX: function(evt) {
		if(!this._calculating && this.ui.lists.h["ilist"].get_selectedItems().length > 0) {
			var change = this.ui.numerics.h["xsize"].get_value() / this._curW;
			var _g = 0;
			var _g1 = this.ui.lists.h["ilist"].get_selectedItems();
			while(_g < _g1.length) {
				var inst = _g1[_g];
				++_g;
				var ref = com_tilbuci_data_GlobalPlayer.area.pickInstance(inst.value);
				if(ref != null) {
					ref.set_width(ref.get_width() * change);
					if(ref.get_x() != this._curX) {
						ref.set_x(this._curX + (ref.get_x() - this._curX) * change);
					}
				}
			}
			this.onChange(null);
		}
	}
	,onChangeSizeY: function(evt) {
		if(!this._calculating && this.ui.lists.h["ilist"].get_selectedItems().length > 0) {
			var change = this.ui.numerics.h["ysize"].get_value() / this._curH;
			var _g = 0;
			var _g1 = this.ui.lists.h["ilist"].get_selectedItems();
			while(_g < _g1.length) {
				var inst = _g1[_g];
				++_g;
				var ref = com_tilbuci_data_GlobalPlayer.area.pickInstance(inst.value);
				if(ref != null) {
					ref.set_height(ref.get_height() * change);
					if(ref.get_y() != this._curY) {
						ref.set_y(this._curY + (ref.get_y() - this._curY) * change);
					}
				}
			}
			this.onChange(null);
		}
	}
	,updatePaste: function() {
		if(com_tilbuci_data_Global.copy.hasCopy()) {
			this.ui.buttons.h["btpaste"].set_enabled(true);
			this.ui.buttons.h["btpaste"].set_toolTip(com_tilbuci_data_Global.ln.get("rightbar-instances-paste"));
		} else {
			this.ui.buttons.h["btpaste"].set_enabled(false);
			this.ui.buttons.h["btpaste"].set_toolTip(com_tilbuci_data_Global.ln.get("rightbar-instances-nocopied"));
		}
	}
	,onStageLeft: function() {
		if(this.ui.lists.h["ilist"].get_selectedItems().length > 0) {
			var _g = 0;
			var _g1 = this.ui.lists.h["ilist"].get_selectedItems();
			while(_g < _g1.length) {
				var inst = _g1[_g];
				++_g;
				var ref = com_tilbuci_data_GlobalPlayer.area.pickInstance(inst.value);
				if(ref != null) {
					com_tilbuci_data_GlobalPlayer.area.setPropertyNum(inst.value,"x",0);
				}
			}
			this.onChange(null);
		}
	}
	,onStageRight: function() {
		if(this.ui.lists.h["ilist"].get_selectedItems().length > 0) {
			var _g = 0;
			var _g1 = this.ui.lists.h["ilist"].get_selectedItems();
			while(_g < _g1.length) {
				var inst = _g1[_g];
				++_g;
				var ref = com_tilbuci_data_GlobalPlayer.area.pickInstance(inst.value);
				if(ref != null) {
					if(com_tilbuci_data_GlobalPlayer.orientation == "horizontal") {
						com_tilbuci_data_GlobalPlayer.area.setPropertyNum(inst.value,"x",com_tilbuci_data_GlobalPlayer.mdata.screen.big - ref.get_width());
					} else {
						com_tilbuci_data_GlobalPlayer.area.setPropertyNum(inst.value,"x",com_tilbuci_data_GlobalPlayer.mdata.screen.small - ref.get_width());
					}
				}
			}
			this.onChange(null);
		}
	}
	,onStageCenter: function() {
		if(this.ui.lists.h["ilist"].get_selectedItems().length > 0) {
			var _g = 0;
			var _g1 = this.ui.lists.h["ilist"].get_selectedItems();
			while(_g < _g1.length) {
				var inst = _g1[_g];
				++_g;
				var ref = com_tilbuci_data_GlobalPlayer.area.pickInstance(inst.value);
				if(ref != null) {
					if(com_tilbuci_data_GlobalPlayer.orientation == "horizontal") {
						com_tilbuci_data_GlobalPlayer.area.setPropertyNum(inst.value,"x",com_tilbuci_data_GlobalPlayer.mdata.screen.big / 2 - ref.get_width() / 2);
					} else {
						com_tilbuci_data_GlobalPlayer.area.setPropertyNum(inst.value,"x",com_tilbuci_data_GlobalPlayer.mdata.screen.small / 2 - ref.get_width() / 2);
					}
				}
			}
			this.onChange(null);
		}
	}
	,onStageTop: function() {
		if(this.ui.lists.h["ilist"].get_selectedItems().length > 0) {
			var _g = 0;
			var _g1 = this.ui.lists.h["ilist"].get_selectedItems();
			while(_g < _g1.length) {
				var inst = _g1[_g];
				++_g;
				var ref = com_tilbuci_data_GlobalPlayer.area.pickInstance(inst.value);
				if(ref != null) {
					com_tilbuci_data_GlobalPlayer.area.setPropertyNum(inst.value,"y",0);
				}
			}
			this.onChange(null);
		}
	}
	,onStageBottom: function() {
		if(this.ui.lists.h["ilist"].get_selectedItems().length > 0) {
			var _g = 0;
			var _g1 = this.ui.lists.h["ilist"].get_selectedItems();
			while(_g < _g1.length) {
				var inst = _g1[_g];
				++_g;
				var ref = com_tilbuci_data_GlobalPlayer.area.pickInstance(inst.value);
				if(ref != null) {
					if(com_tilbuci_data_GlobalPlayer.orientation == "horizontal") {
						com_tilbuci_data_GlobalPlayer.area.setPropertyNum(inst.value,"y",com_tilbuci_data_GlobalPlayer.mdata.screen.small - ref.get_height());
					} else {
						com_tilbuci_data_GlobalPlayer.area.setPropertyNum(inst.value,"y",com_tilbuci_data_GlobalPlayer.mdata.screen.big - ref.get_height());
					}
				}
			}
			this.onChange(null);
		}
	}
	,onStageMiddle: function() {
		if(this.ui.lists.h["ilist"].get_selectedItems().length > 0) {
			var _g = 0;
			var _g1 = this.ui.lists.h["ilist"].get_selectedItems();
			while(_g < _g1.length) {
				var inst = _g1[_g];
				++_g;
				var ref = com_tilbuci_data_GlobalPlayer.area.pickInstance(inst.value);
				if(ref != null) {
					if(com_tilbuci_data_GlobalPlayer.orientation == "horizontal") {
						com_tilbuci_data_GlobalPlayer.area.setPropertyNum(inst.value,"y",com_tilbuci_data_GlobalPlayer.mdata.screen.small / 2 - ref.get_height() / 2);
					} else {
						com_tilbuci_data_GlobalPlayer.area.setPropertyNum(inst.value,"y",com_tilbuci_data_GlobalPlayer.mdata.screen.big / 2 - ref.get_height() / 2);
					}
				}
			}
			this.onChange(null);
		}
	}
	,onSelectionLeft: function() {
		if(this.ui.lists.h["ilist"].get_selectedItems().length > 1) {
			var refnum = null;
			var _g = 0;
			var _g1 = this.ui.lists.h["ilist"].get_selectedItems();
			while(_g < _g1.length) {
				var inst = _g1[_g];
				++_g;
				var ref = com_tilbuci_data_GlobalPlayer.area.pickInstance(inst.value);
				if(ref != null) {
					if(refnum == null || refnum > ref.get_x()) {
						refnum = ref.get_x();
					}
				}
			}
			var _g = 0;
			var _g1 = this.ui.lists.h["ilist"].get_selectedItems();
			while(_g < _g1.length) {
				var inst = _g1[_g];
				++_g;
				var ref = com_tilbuci_data_GlobalPlayer.area.pickInstance(inst.value);
				if(ref != null) {
					com_tilbuci_data_GlobalPlayer.area.setPropertyNum(inst.value,"x",refnum);
				}
			}
			this.onChange(null);
		}
	}
	,onSelectionRight: function() {
		if(this.ui.lists.h["ilist"].get_selectedItems().length > 1) {
			var refnum = null;
			var _g = 0;
			var _g1 = this.ui.lists.h["ilist"].get_selectedItems();
			while(_g < _g1.length) {
				var inst = _g1[_g];
				++_g;
				var ref = com_tilbuci_data_GlobalPlayer.area.pickInstance(inst.value);
				if(ref != null) {
					if(refnum == null || refnum < ref.get_x() + ref.get_width()) {
						refnum = ref.get_x() + ref.get_width();
					}
				}
			}
			var _g = 0;
			var _g1 = this.ui.lists.h["ilist"].get_selectedItems();
			while(_g < _g1.length) {
				var inst = _g1[_g];
				++_g;
				var ref = com_tilbuci_data_GlobalPlayer.area.pickInstance(inst.value);
				if(ref != null) {
					com_tilbuci_data_GlobalPlayer.area.setPropertyNum(inst.value,"x",refnum - ref.get_width());
				}
			}
			this.onChange(null);
		}
	}
	,onSelectionCenter: function() {
		if(this.ui.lists.h["ilist"].get_selectedItems().length > 1) {
			var refx = null;
			var refwidth = null;
			var refcenter = null;
			var _g = 0;
			var _g1 = this.ui.lists.h["ilist"].get_selectedItems();
			while(_g < _g1.length) {
				var inst = _g1[_g];
				++_g;
				var ref = com_tilbuci_data_GlobalPlayer.area.pickInstance(inst.value);
				if(ref != null) {
					if(refx == null || refx > ref.get_x()) {
						refx = ref.get_x();
					}
					if(refwidth == null || refwidth < ref.get_x() + ref.get_width()) {
						refwidth = ref.get_x() + ref.get_width();
					}
					refcenter = refx + refwidth / 2;
				}
			}
			var _g = 0;
			var _g1 = this.ui.lists.h["ilist"].get_selectedItems();
			while(_g < _g1.length) {
				var inst = _g1[_g];
				++_g;
				var ref = com_tilbuci_data_GlobalPlayer.area.pickInstance(inst.value);
				if(ref != null) {
					com_tilbuci_data_GlobalPlayer.area.setPropertyNum(inst.value,"x",refcenter - ref.get_width() / 2);
				}
			}
			this.onChange(null);
		}
	}
	,onSelectionTop: function() {
		if(this.ui.lists.h["ilist"].get_selectedItems().length > 1) {
			var refnum = null;
			var _g = 0;
			var _g1 = this.ui.lists.h["ilist"].get_selectedItems();
			while(_g < _g1.length) {
				var inst = _g1[_g];
				++_g;
				var ref = com_tilbuci_data_GlobalPlayer.area.pickInstance(inst.value);
				if(ref != null) {
					if(refnum == null || refnum > ref.get_y()) {
						refnum = ref.get_y();
					}
				}
			}
			var _g = 0;
			var _g1 = this.ui.lists.h["ilist"].get_selectedItems();
			while(_g < _g1.length) {
				var inst = _g1[_g];
				++_g;
				var ref = com_tilbuci_data_GlobalPlayer.area.pickInstance(inst.value);
				if(ref != null) {
					com_tilbuci_data_GlobalPlayer.area.setPropertyNum(inst.value,"y",refnum);
				}
			}
			this.onChange(null);
		}
	}
	,onSelectionBottom: function() {
		if(this.ui.lists.h["ilist"].get_selectedItems().length > 1) {
			var refnum = null;
			var _g = 0;
			var _g1 = this.ui.lists.h["ilist"].get_selectedItems();
			while(_g < _g1.length) {
				var inst = _g1[_g];
				++_g;
				var ref = com_tilbuci_data_GlobalPlayer.area.pickInstance(inst.value);
				if(ref != null) {
					if(refnum == null || refnum < ref.get_y() + ref.get_height()) {
						refnum = ref.get_y() + ref.get_height();
					}
				}
			}
			var _g = 0;
			var _g1 = this.ui.lists.h["ilist"].get_selectedItems();
			while(_g < _g1.length) {
				var inst = _g1[_g];
				++_g;
				var ref = com_tilbuci_data_GlobalPlayer.area.pickInstance(inst.value);
				if(ref != null) {
					com_tilbuci_data_GlobalPlayer.area.setPropertyNum(inst.value,"y",refnum - ref.get_height());
				}
			}
			this.onChange(null);
		}
	}
	,onSelectionMiddle: function() {
		if(this.ui.lists.h["ilist"].get_selectedItems().length > 1) {
			var refy = null;
			var refheight = null;
			var refcenter = null;
			var _g = 0;
			var _g1 = this.ui.lists.h["ilist"].get_selectedItems();
			while(_g < _g1.length) {
				var inst = _g1[_g];
				++_g;
				var ref = com_tilbuci_data_GlobalPlayer.area.pickInstance(inst.value);
				if(ref != null) {
					if(refy == null || refy > ref.get_y()) {
						refy = ref.get_y();
					}
					if(refheight == null || refheight < ref.get_y() + ref.get_height()) {
						refheight = ref.get_y() + ref.get_height();
					}
					refcenter = refy + refheight / 2;
				}
			}
			var _g = 0;
			var _g1 = this.ui.lists.h["ilist"].get_selectedItems();
			while(_g < _g1.length) {
				var inst = _g1[_g];
				++_g;
				var ref = com_tilbuci_data_GlobalPlayer.area.pickInstance(inst.value);
				if(ref != null) {
					com_tilbuci_data_GlobalPlayer.area.setPropertyNum(inst.value,"y",refcenter - ref.get_height() / 2);
				}
			}
			this.onChange(null);
		}
	}
	,onDistributeH: function() {
		if(this.ui.lists.h["ilist"].get_selectedItems().length > 2) {
			var refstart = null;
			var refend = null;
			var refsize = null;
			var sizetot = 0;
			var insts = [];
			var _g = 0;
			var _g1 = this.ui.lists.h["ilist"].get_selectedItems();
			while(_g < _g1.length) {
				var inst = _g1[_g];
				++_g;
				var ref = com_tilbuci_data_GlobalPlayer.area.pickInstance(inst.value);
				if(ref != null) {
					if(refstart == null || refstart > ref.get_x()) {
						refstart = ref.get_x();
					}
					if(refend == null || refend < ref.get_x() + ref.get_width()) {
						refend = ref.get_x() + ref.get_width();
					}
					sizetot += ref.get_width();
					refsize = refend - refstart;
					insts.push(ref);
				}
			}
			if(insts.length > 2) {
				refsize = (refsize - sizetot) / (insts.length - 1);
				insts.sort(function(a,b) {
					if(a.get_x() < b.get_x()) {
						return -1;
					} else if(a.get_x() > b.get_x()) {
						return 1;
					} else {
						return 0;
					}
				});
				var _g = 1;
				var _g1 = insts.length;
				while(_g < _g1) {
					var i = _g++;
					var tmp = insts[i - 1].get_x() + insts[i - 1].get_width() + refsize;
					insts[i].set_x(tmp);
				}
				this.onChange(null);
			}
		}
	}
	,onDistributeV: function() {
		if(this.ui.lists.h["ilist"].get_selectedItems().length > 2) {
			var refstart = null;
			var refend = null;
			var refsize = null;
			var sizetot = 0;
			var insts = [];
			var _g = 0;
			var _g1 = this.ui.lists.h["ilist"].get_selectedItems();
			while(_g < _g1.length) {
				var inst = _g1[_g];
				++_g;
				var ref = com_tilbuci_data_GlobalPlayer.area.pickInstance(inst.value);
				if(ref != null) {
					if(refstart == null || refstart > ref.get_y()) {
						refstart = ref.get_y();
					}
					if(refend == null || refend < ref.get_y() + ref.get_height()) {
						refend = ref.get_y() + ref.get_height();
					}
					sizetot += ref.get_height();
					refsize = refend - refstart;
					insts.push(ref);
				}
			}
			if(insts.length > 2) {
				refsize = (refsize - sizetot) / (insts.length - 1);
				insts.sort(function(a,b) {
					if(a.get_y() < b.get_y()) {
						return -1;
					} else if(a.get_y() > b.get_y()) {
						return 1;
					} else {
						return 0;
					}
				});
				var _g = 1;
				var _g1 = insts.length;
				while(_g < _g1) {
					var i = _g++;
					var tmp = insts[i - 1].get_y() + insts[i - 1].get_height() + refsize;
					insts[i].set_y(tmp);
				}
				this.onChange(null);
			}
		}
	}
	,__class__: com_tilbuci_ui_component_InstancesPanel
});
var com_tilbuci_ui_component_Interacting = function() {
	this._current = 0;
	this._icons = [];
	feathers_controls_Panel.call(this);
	this.set_width(this.set_height(150));
	var skin = new feathers_skins_RectangleSkin();
	skin.set_fill(feathers_graphics_FillStyle.SolidColor(0,0));
	this.set_backgroundSkin(skin);
	var bmp = new openfl_display_Bitmap(openfl_utils_Assets.getBitmapData("tilBuci0" + 1));
	bmp.smoothing = true;
	bmp.set_alpha(0.8);
	bmp.set_x((150 - bmp.get_width()) / 2);
	bmp.set_y((150 - bmp.get_height()) / 2);
	this._icons.push(bmp);
	var bmp = new openfl_display_Bitmap(openfl_utils_Assets.getBitmapData("tilBuci0" + 2));
	bmp.smoothing = true;
	bmp.set_alpha(0.8);
	bmp.set_x((150 - bmp.get_width()) / 2);
	bmp.set_y((150 - bmp.get_height()) / 2);
	this._icons.push(bmp);
	var bmp = new openfl_display_Bitmap(openfl_utils_Assets.getBitmapData("tilBuci0" + 3));
	bmp.smoothing = true;
	bmp.set_alpha(0.8);
	bmp.set_x((150 - bmp.get_width()) / 2);
	bmp.set_y((150 - bmp.get_height()) / 2);
	this._icons.push(bmp);
	var bmp = new openfl_display_Bitmap(openfl_utils_Assets.getBitmapData("tilBuci0" + 4));
	bmp.smoothing = true;
	bmp.set_alpha(0.8);
	bmp.set_x((150 - bmp.get_width()) / 2);
	bmp.set_y((150 - bmp.get_height()) / 2);
	this._icons.push(bmp);
};
$hxClasses["com.tilbuci.ui.component.Interacting"] = com_tilbuci_ui_component_Interacting;
com_tilbuci_ui_component_Interacting.__name__ = "com.tilbuci.ui.component.Interacting";
com_tilbuci_ui_component_Interacting.__super__ = feathers_controls_Panel;
com_tilbuci_ui_component_Interacting.prototype = $extend(feathers_controls_Panel.prototype,{
	_icons: null
	,_current: null
	,_timer: null
	,start: function() {
		var _gthis = this;
		if(this._timer != null) {
			try {
				this._timer.stop();
			} catch( _g ) {
			}
			this._timer = null;
		}
		this._timer = new haxe_Timer(250);
		this._timer.run = function() {
			_gthis._current++;
			if(_gthis._current >= _gthis._icons.length) {
				_gthis._current = 0;
			}
			_gthis.removeChildren();
			_gthis.addChild(_gthis._icons[_gthis._current]);
		};
		if(com_tilbuci_data_Global.stage != null) {
			feathers_core_PopUpManager.addPopUp(this,com_tilbuci_data_Global.stage);
		}
	}
	,stop: function() {
		if(this._timer != null) {
			try {
				this._timer.stop();
			} catch( _g ) {
			}
			this._timer = null;
		}
		if(com_tilbuci_data_Global.stage != null) {
			feathers_core_PopUpManager.removePopUp(this);
		}
	}
	,__class__: com_tilbuci_ui_component_Interacting
});
var com_tilbuci_ui_component_MediaPanel = function(wd) {
	this._current = null;
	com_tilbuci_ui_component_DropDownPanel.call(this,com_tilbuci_data_Global.ln.get("rightbar-media"),wd);
	this.ui.createHContainer("playback",3355443);
	var tmp = this.ui;
	var tmp1 = openfl_utils_Assets.getBitmapData("btPlay");
	var tmp2 = this.ui.hcontainers.h["playback"];
	tmp.createIconButton("play",$bind(this,this.onPlay),new openfl_display_Bitmap(tmp1),null,tmp2);
	var tmp = this.ui;
	var tmp1 = openfl_utils_Assets.getBitmapData("btPause");
	var tmp2 = this.ui.hcontainers.h["playback"];
	tmp.createIconButton("pause",$bind(this,this.onPause),new openfl_display_Bitmap(tmp1),null,tmp2);
	var tmp = this.ui;
	var tmp1 = openfl_utils_Assets.getBitmapData("btStop");
	var tmp2 = this.ui.hcontainers.h["playback"];
	tmp.createIconButton("stop",$bind(this,this.onStop),new openfl_display_Bitmap(tmp1),null,tmp2);
	var tmp = this.ui;
	var tmp1 = { tp : "Label", id : "name", tx : com_tilbuci_data_Global.ln.get("rightbar-media-name"), vr : ""};
	var tmp2 = { tp : "Label", id : "collection", tx : com_tilbuci_data_Global.ln.get("rightbar-media-collection"), vr : ""};
	var tmp3 = { tp : "Button", id : "collection", tx : com_tilbuci_data_Global.ln.get("rightbar-media-collectioned"), ac : $bind(this,this.onCollection)};
	var tmp4 = { tp : "Label", id : "asset", tx : com_tilbuci_data_Global.ln.get("rightbar-media-asset"), vr : ""};
	var tmp5 = { tp : "Button", id : "asset", tx : com_tilbuci_data_Global.ln.get("rightbar-media-asseted"), ac : $bind(this,this.onAsset)};
	var tmp6 = { tp : "Label", id : "playonload", tx : com_tilbuci_data_Global.ln.get("rightbar-media-playonload"), vr : ""};
	var tmp7 = { tp : "Button", id : "update", tx : com_tilbuci_data_Global.ln.get("rightbar-media-update"), ac : $bind(this,this.onUpdate)};
	var tmp8 = { tp : "Button", id : "cache", tx : com_tilbuci_data_Global.ln.get("rightbar-media-cache"), ac : $bind(this,this.onCache)};
	var tmp9 = com_tilbuci_data_Global.ln.get("rightbar-media-remove");
	this._content = tmp.forge("properties",[tmp1,{ tp : "TInput", id : "name", tx : "", vr : ""},tmp2,{ tp : "Select", id : "collection", vl : [], sl : null, ch : $bind(this,this.changeCol)},tmp3,tmp4,{ tp : "Select", id : "asset", vl : [], sl : null},tmp5,tmp6,{ tp : "Toggle", id : "playonload", vl : true},{ tp : "Spacer", id : "update", ht : 5},tmp7,{ tp : "Spacer", id : "cache", ht : 10},tmp8,{ tp : "Button", id : "remove", tx : tmp9, ac : $bind(this,this.onRemove)},{ tp : "Spacer", id : "playback", ht : 10},{ tp : "Custom", cont : this.ui.hcontainers.h["playback"]}],3355443,wd - 5);
	this.ui.hcontainers.h["playback"].setWidth(Math.round(wd - 5));
	this.ui.containers.h["properties"].set_enabled(false);
	com_tilbuci_data_Global.history.propDisplay.push($bind(this,this.updateValues));
};
$hxClasses["com.tilbuci.ui.component.MediaPanel"] = com_tilbuci_ui_component_MediaPanel;
com_tilbuci_ui_component_MediaPanel.__name__ = "com.tilbuci.ui.component.MediaPanel";
com_tilbuci_ui_component_MediaPanel.__super__ = com_tilbuci_ui_component_DropDownPanel;
com_tilbuci_ui_component_MediaPanel.prototype = $extend(com_tilbuci_ui_component_DropDownPanel.prototype,{
	_current: null
	,instanceNamePanelUpdate: null
	,updateContent: function(data) {
		if(Object.prototype.hasOwnProperty.call(data.h,"nm")) {
			if(data.h["nm"] == "") {
				this.clearValues();
			} else {
				this._current = com_tilbuci_data_GlobalPlayer.area.instanceRef(data.h["nm"]);
				this.updateValues();
			}
		} else {
			this.clearValues();
		}
	}
	,reloadContent: function(data) {
		this.clearValues();
	}
	,updateValues: function() {
		if(this._current != null) {
			this.ui.containers.h["properties"].set_enabled(false);
			var cols = [];
			var h = com_tilbuci_data_GlobalPlayer.movie.collections.h;
			var col_h = h;
			var col_keys = Object.keys(h);
			var col_length = col_keys.length;
			var col_current = 0;
			while(col_current < col_length) {
				var col = col_keys[col_current++];
				cols.push({ text : com_tilbuci_data_GlobalPlayer.movie.collections.h[col].name, value : col});
			}
			this.ui.setSelectOptions("collection",cols);
			this.ui.setSelectValue("collection",this._current.getCurrentStr("collection"));
			var asts = [];
			var this1 = com_tilbuci_data_GlobalPlayer.movie.collections;
			var key = this._current.getCurrentStr("collection");
			if(Object.prototype.hasOwnProperty.call(this1.h,key)) {
				var this1 = com_tilbuci_data_GlobalPlayer.movie.collections;
				var key = this._current.getCurrentStr("collection");
				var h = this1.h[key].assets.h;
				var ast_h = h;
				var ast_keys = Object.keys(h);
				var ast_length = ast_keys.length;
				var ast_current = 0;
				while(ast_current < ast_length) {
					var ast = ast_keys[ast_current++];
					var this1 = com_tilbuci_data_GlobalPlayer.movie.collections;
					var key = this._current.getCurrentStr("collection");
					asts.push({ text : this1.h[key].assets.h[ast].name, value : ast});
				}
			}
			this.ui.setSelectOptions("asset",asts);
			this.ui.setSelectValue("asset",this._current.getCurrentStr("asset"));
			this.ui.inputs.h["name"].set_text(this._current.getCurrentStr("instance"));
			var tmp = this.ui.toggles.h["playonload"];
			var this1 = com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[com_tilbuci_data_GlobalPlayer.area.get_currentKf()];
			var key = this._current.getInstName();
			tmp.set_selected(this1.h[key].playOnLoad);
			this.ui.containers.h["properties"].set_enabled(true);
		}
	}
	,clearValues: function() {
		this.ui.containers.h["properties"].set_enabled(false);
		this.ui.setSelectOptions("collection",[]);
		this.ui.setSelectOptions("asset",[]);
		this.ui.inputs.h["name"].set_text("");
		this.ui.toggles.h["playonload"].set_selected(true);
		this._current = null;
	}
	,changeCol: function(evt) {
		if(this._current != null && this.ui.containers.h["properties"].get_enabled()) {
			var asts = [];
			var this1 = com_tilbuci_data_GlobalPlayer.movie.collections;
			var key = this.ui.selects.h["collection"].get_selectedItem().value;
			if(Object.prototype.hasOwnProperty.call(this1.h,key)) {
				var this1 = com_tilbuci_data_GlobalPlayer.movie.collections;
				var key = this.ui.selects.h["collection"].get_selectedItem().value;
				var h = this1.h[key].assets.h;
				var ast_h = h;
				var ast_keys = Object.keys(h);
				var ast_length = ast_keys.length;
				var ast_current = 0;
				while(ast_current < ast_length) {
					var ast = ast_keys[ast_current++];
					var this1 = com_tilbuci_data_GlobalPlayer.movie.collections;
					var key = this.ui.selects.h["collection"].get_selectedItem().value;
					asts.push({ text : this1.h[key].assets.h[ast].name, value : ast});
				}
			}
			this.ui.setSelectOptions("asset",asts);
			this.ui.setSelectValue("asset",this._current.getCurrentStr("asset"));
		}
	}
	,onCollection: function(evt) {
		if(this._current != null) {
			var tmp = this.startWindow;
			var _g = new haxe_ds_StringMap();
			var value = this._current.getCurrentStr("instance");
			_g.h["instance"] = value;
			var value = this._current.getCurrentStr("collection");
			_g.h["collection"] = value;
			var value = this._current.getCurrentStr("asset");
			_g.h["asset"] = value;
			tmp("collectionbase",_g);
		}
	}
	,onAsset: function(evt) {
		if(this._current != null) {
			var tmp = this.startWindow;
			var _g = new haxe_ds_StringMap();
			var value = this._current.getCurrentStr("instance");
			_g.h["instance"] = value;
			var value = this._current.getCurrentStr("collection");
			_g.h["collection"] = value;
			var value = this._current.getCurrentStr("asset");
			_g.h["asset"] = value;
			tmp("assetbase",_g);
		}
	}
	,onUpdate: function(evt) {
		if(this.ui.inputs.h["name"].get_text() == "" || this.ui.inputs.h["name"].get_text().length < 3) {
			com_tilbuci_data_Global.showMsg(com_tilbuci_data_Global.ln.get("rightbar-media-noid"));
		} else {
			if(com_tilbuci_data_Global.history.states.length == 0) {
				com_tilbuci_data_Global.history.addState(com_tilbuci_data_Global.ln.get("rightbar-history-original"));
			}
			var this1 = com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[com_tilbuci_data_GlobalPlayer.area.get_currentKf()];
			var key = this._current.getInstName();
			if(this1.h[key].playOnLoad != this.ui.toggles.h["playonload"].get_selected()) {
				var this1 = com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[com_tilbuci_data_GlobalPlayer.area.get_currentKf()];
				var key = this._current.getInstName();
				this1.h[key].playOnLoad = this.ui.toggles.h["playonload"].get_selected();
				var this1 = com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[com_tilbuci_data_GlobalPlayer.area.get_currentKf()];
				var key = this.ui.inputs.h["name"].get_text();
				if(Object.prototype.hasOwnProperty.call(this1.h,key)) {
					com_tilbuci_data_GlobalPlayer.area.setCurrentStr("instance",this.ui.inputs.h["name"].get_text());
				}
				var tmp;
				var this1 = com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[com_tilbuci_data_GlobalPlayer.area.get_currentKf()];
				var key = this._current.getInstName();
				if(this1.h[key].collection == this.ui.selects.h["collection"].get_selectedItem().value) {
					var this1 = com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[com_tilbuci_data_GlobalPlayer.area.get_currentKf()];
					var key = this._current.getInstName();
					tmp = this1.h[key].asset != this.ui.selects.h["asset"].get_selectedItem().value;
				} else {
					tmp = true;
				}
				if(tmp) {
					com_tilbuci_data_GlobalPlayer.area.setCurrentStr("asset",Std.string(this.ui.selects.h["collection"].get_selectedItem().value) + "|:|" + Std.string(this.ui.selects.h["asset"].get_selectedItem().value));
				}
				com_tilbuci_data_Global.history.addState(com_tilbuci_data_Global.ln.get("rightbar-history-instance"));
			} else {
				var tmp;
				var this1 = com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[com_tilbuci_data_GlobalPlayer.area.get_currentKf()];
				var key = this._current.getInstName();
				if(this1.h[key].collection == this.ui.selects.h["collection"].get_selectedItem().value) {
					var this1 = com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[com_tilbuci_data_GlobalPlayer.area.get_currentKf()];
					var key = this._current.getInstName();
					tmp = this1.h[key].asset != this.ui.selects.h["asset"].get_selectedItem().value;
				} else {
					tmp = true;
				}
				if(tmp) {
					com_tilbuci_data_GlobalPlayer.area.setCurrentStr("asset",Std.string(this.ui.selects.h["collection"].get_selectedItem().value) + "|:|" + Std.string(this.ui.selects.h["asset"].get_selectedItem().value));
					var this1 = com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[com_tilbuci_data_GlobalPlayer.area.get_currentKf()];
					var key = this.ui.inputs.h["name"].get_text();
					if(Object.prototype.hasOwnProperty.call(this1.h,key)) {
						com_tilbuci_data_GlobalPlayer.area.setCurrentStr("instance",this.ui.inputs.h["name"].get_text());
					}
					com_tilbuci_data_Global.history.addState(com_tilbuci_data_Global.ln.get("rightbar-history-instance"));
				} else {
					var this1 = com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[com_tilbuci_data_GlobalPlayer.area.get_currentKf()];
					var key = this.ui.inputs.h["name"].get_text();
					if(Object.prototype.hasOwnProperty.call(this1.h,key)) {
						com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("rightbar-media"),com_tilbuci_data_Global.ln.get("rightbar-media-idtaken"),300,180,com_tilbuci_data_Global.ln.get("default-ok"));
					} else {
						var oldn = this._current.getInstName();
						com_tilbuci_data_GlobalPlayer.area.setCurrentStr("instance",this.ui.inputs.h["name"].get_text());
						com_tilbuci_data_Global.history.addState(com_tilbuci_data_Global.ln.get("rightbar-history-instance"));
						if(this.instanceNamePanelUpdate != null) {
							this.instanceNamePanelUpdate(oldn,this.ui.inputs.h["name"].get_text());
						}
					}
				}
			}
		}
	}
	,onCache: function(evt) {
		if(this._current.getInstName() != "") {
			var nm = this._current.getInstName();
			com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("rightbar-media"),com_tilbuci_data_Global.ln.get("rightbar-media-precachecheck"),300,220,com_tilbuci_data_Global.ln.get("default-ok"),$bind(this,this.onCacheConfirm),"confirm",com_tilbuci_data_Global.ln.get("default-cancel"));
		}
	}
	,onCacheConfirm: function(ok) {
		if(ok) {
			if(com_tilbuci_data_Global.history.states.length == 0) {
				com_tilbuci_data_Global.history.addState(com_tilbuci_data_Global.ln.get("rightbar-history-original"));
			}
			com_tilbuci_data_GlobalPlayer.area.setCurrentPrecache();
			this.ui.toggles.h["playonload"].set_selected(false);
			com_tilbuci_data_Global.history.addState(com_tilbuci_data_Global.ln.get("rightbar-history-cache"));
		}
	}
	,onRemove: function(evt) {
		if(this._current.getInstName() != "") {
			var nm = this._current.getInstName();
			com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("rightbar-media"),com_tilbuci_data_Global.ln.get("rightbar-media-removecheck"),300,220,com_tilbuci_data_Global.ln.get("default-ok"),$bind(this,this.onRemoveConfirm),"confirm",com_tilbuci_data_Global.ln.get("default-cancel"));
		}
	}
	,onRemoveConfirm: function(ok) {
		if(ok) {
			if(this._current.getInstName() != "") {
				var nm = this._current.getInstName();
				com_tilbuci_data_GlobalPlayer.area.imgSelect();
				com_tilbuci_data_GlobalPlayer.area.removeInstance(nm);
				this.clearValues();
			}
		}
	}
	,onPlay: function(evt) {
		if(this._current != null) {
			if(this._current.get_currentType() == "video" || this._current.get_currentType() == "audio") {
				this._current.play();
			}
		}
	}
	,onPause: function(evt) {
		if(this._current != null) {
			if(this._current.get_currentType() == "video" || this._current.get_currentType() == "audio") {
				this._current.pause();
			}
		}
	}
	,onStop: function(evt) {
		if(this._current != null) {
			if(this._current.get_currentType() == "video" || this._current.get_currentType() == "audio") {
				this._current.stop();
				this._current.seek(0);
			}
		}
	}
	,__class__: com_tilbuci_ui_component_MediaPanel
});
var com_tilbuci_ui_component_MediaPreview = function(type,wd,ht) {
	if(ht == null) {
		ht = 500;
	}
	if(wd == null) {
		wd = 500;
	}
	feathers_core_FeathersControl.call(this);
	this._type = type;
	this._wd = wd;
	this._ht = ht;
	this.set_alpha(0);
	switch(type) {
	case "audio":
		this._audio = new com_tilbuci_display_AudioImage($bind(this,this.onAudio),null);
		this.addChild(this._audio);
		this.createPlayback();
		break;
	case "html":
		this._html = new com_tilbuci_display_HtmlImage($bind(this,this.onHtml));
		this.addChild(this._html);
		break;
	case "picture":
		this._loader = new openfl_display_Loader();
		this._loader.contentLoaderInfo.addEventListener("complete",$bind(this,this.onPicture));
		this.addChild(this._loader);
		break;
	case "spritemap":
		this._spritemap = new com_tilbuci_display_SpritemapImage($bind(this,this.onSpritemap));
		this.addChild(this._spritemap);
		break;
	case "video":
		this._video = new com_tilbuci_display_VideoImage($bind(this,this.onVideo),null);
		this.addChild(this._video);
		this.createPlayback();
		break;
	}
};
$hxClasses["com.tilbuci.ui.component.MediaPreview"] = com_tilbuci_ui_component_MediaPreview;
com_tilbuci_ui_component_MediaPreview.__name__ = "com.tilbuci.ui.component.MediaPreview";
com_tilbuci_ui_component_MediaPreview.__super__ = feathers_core_FeathersControl;
com_tilbuci_ui_component_MediaPreview.prototype = $extend(feathers_core_FeathersControl.prototype,{
	_type: null
	,_wd: null
	,_ht: null
	,_controls: null
	,_loader: null
	,_video: null
	,_audio: null
	,_html: null
	,_spritemap: null
	,setSpritemap: function(frames,frtime) {
		if(this._type == "spritemap") {
			this._spritemap.frames = frames;
			this._spritemap.frtime = frtime;
			if(this._spritemap.get_mediaLoaded()) {
				this._spritemap.load(this._spritemap.get_lastMedia());
			}
		}
	}
	,createPlayback: function() {
		this._controls = new feathers_core_FeathersControl();
		var icon = new openfl_display_Bitmap(openfl_utils_Assets.getBitmapData("btPlay"));
		icon.smoothing = true;
		icon.set_width(icon.set_height(20));
		var btPlay = new feathers_controls_Button();
		btPlay.set_icon(icon);
		btPlay.addEventListener("trigger",$bind(this,this.onPlay));
		this._controls.addChild(btPlay);
		icon = new openfl_display_Bitmap(openfl_utils_Assets.getBitmapData("btStop"));
		icon.smoothing = true;
		icon.set_width(icon.set_height(20));
		var btStop = new feathers_controls_Button();
		btStop.set_icon(icon);
		btStop.addEventListener("trigger",$bind(this,this.onStop));
		btStop.set_y(0);
		btStop.set_x(50);
		this._controls.addChild(btStop);
		this.addChild(this._controls);
		this._controls.set_x(0);
		this._controls.set_y(this._ht - 10 - this._controls.get_height());
	}
	,hide: function() {
		this.set_alpha(0);
		switch(this._type) {
		case "audio":
			this._audio.set_visible(false);
			break;
		case "html":
			this._html.set_visible(false);
			break;
		case "picture":
			this._loader.unload();
			break;
		case "spritemap":
			this._spritemap.set_visible(false);
			break;
		case "video":
			this._video.set_visible(false);
			break;
		}
	}
	,preview: function(url) {
		switch(this._type) {
		case "audio":
			this._audio.load(url);
			this._audio.set_visible(false);
			this.set_alpha(1);
			break;
		case "html":
			this._html.load(url);
			this._html.set_visible(false);
			this.set_alpha(1);
			break;
		case "picture":
			this._loader.load(new openfl_net_URLRequest(url + "?rand=" + Math.random() * 10000));
			this.set_alpha(1);
			break;
		case "spritemap":
			this._spritemap.load(url);
			this._spritemap.set_visible(false);
			this.set_alpha(1);
			break;
		case "video":
			this._video.load(url);
			this._video.set_visible(false);
			this.set_alpha(1);
			break;
		}
	}
	,onPlay: function(evt) {
		switch(this._type) {
		case "audio":
			this._audio.play();
			break;
		case "video":
			this._video.play();
			break;
		}
	}
	,onStop: function(evt) {
		switch(this._type) {
		case "audio":
			this._audio.stop();
			break;
		case "video":
			this._video.stop();
			break;
		}
	}
	,onPicture: function(evt) {
		if(this._loader.content.get_height() > this._loader.content.get_width()) {
			this._loader.set_height(this._ht);
			this._loader.set_width(this._loader.content.get_width() * (this._ht / this._loader.content.get_height()));
		} else {
			this._loader.set_width(this._wd);
			this._loader.set_height(this._loader.content.get_height() * (this._wd / this._loader.content.get_width()));
		}
		this._loader.set_x((this._wd - this._loader.get_width()) / 2);
		this._loader.set_y((this._ht - this._loader.get_height()) / 2);
	}
	,onVideo: function(ok) {
		if(ok) {
			if(this._video.oHeight + this._controls.get_height() + 20 > this._video.oWidth) {
				this._video.set_height(this._ht - this._controls.get_height() - 20);
				this._video.set_width(this._video.oWidth * (this._video.get_height() / this._video.oHeight));
			} else {
				this._video.set_width(this._wd);
				this._video.set_height(this._video.oHeight * (this._wd / this._video.oWidth));
			}
			this._video.set_x((this._wd - this._video.get_width()) / 2);
			this._video.set_y((this._ht - this._controls.get_height() - 20 - this._video.get_height()) / 2);
			this._video.stop();
			this._video.set_visible(true);
		} else {
			this._video.set_visible(false);
			com_tilbuci_data_Global.showMsg(com_tilbuci_data_Global.ln.get("window-mdvideo-loaderror"));
		}
	}
	,onHtml: function(ok) {
		if(ok) {
			this._html.set_width(this._wd);
			this._html.set_height(this._ht);
			this._html.set_visible(true);
		} else {
			this._html.set_visible(false);
			com_tilbuci_data_Global.showMsg(com_tilbuci_data_Global.ln.get("window-mdhtml-loaderror"));
		}
	}
	,onAudio: function(ok) {
		if(ok) {
			this._audio.stop();
			this._audio.set_visible(true);
		} else {
			com_tilbuci_data_Global.showMsg(com_tilbuci_data_Global.ln.get("window-mdaudio-loaderror"));
		}
	}
	,onSpritemap: function(ok) {
		if(ok) {
			if(this._spritemap.oHeight > this._spritemap.oWidth) {
				this._spritemap.set_height(this._ht);
				this._spritemap.set_width(this._spritemap.oWidth * (this._spritemap.get_height() / this._spritemap.oHeight));
			} else {
				this._spritemap.set_width(this._wd);
				this._spritemap.set_height(this._spritemap.oHeight * (this._wd / this._spritemap.oWidth));
			}
			this._spritemap.set_x((this._wd - this._spritemap.get_width()) / 2);
			this._spritemap.set_y(40 + (this._ht - this._spritemap.get_height()) / 2);
			this._spritemap.set_visible(true);
		} else {
			this._spritemap.set_visible(false);
			com_tilbuci_data_Global.showMsg(com_tilbuci_data_Global.ln.get("window-mdspritemap-loaderror"));
		}
	}
	,__class__: com_tilbuci_ui_component_MediaPreview
});
var com_tilbuci_ui_component_MovieInfoDisplay = function(upd) {
	this._acupd = null;
	feathers_controls_Panel.call(this);
	this._acupd = upd;
	var lay = new feathers_layout_HorizontalLayout();
	lay.set_gap(2);
	lay.setPadding(10);
	lay.set_horizontalAlign(feathers_layout_HorizontalAlign.CENTER);
	this.set_layout(lay);
	var skin = new feathers_skins_RectangleSkin();
	skin.set_fill(feathers_graphics_FillStyle.SolidColor(10066329));
	this.set_backgroundSkin(skin);
	this._mvIcon = new openfl_display_Bitmap(openfl_utils_Assets.getBitmapData("btMovie"));
	this._mvIcon.smoothing = true;
	this._mvIcon.set_width(this._mvIcon.set_height(22));
	this._movie = new feathers_controls_Label();
	this._movie.set_variant(feathers_controls_Label.VARIANT_DETAIL);
	this._movie.set_text("");
	this._scIcon = new openfl_display_Bitmap(openfl_utils_Assets.getBitmapData("btScene"));
	this._scIcon.smoothing = true;
	this._scIcon.set_width(this._scIcon.set_height(22));
	this._scene = new feathers_controls_Label();
	this._scene.set_variant(feathers_controls_Label.VARIANT_DETAIL);
	this._scene.set_text("");
	this._msg = new feathers_controls_Label();
	this._msg.set_text("");
	com_tilbuci_data_Global.showMsg = $bind(this,this.showMsg);
	this.addEventListener("click",$bind(this,this.onCallout));
};
$hxClasses["com.tilbuci.ui.component.MovieInfoDisplay"] = com_tilbuci_ui_component_MovieInfoDisplay;
com_tilbuci_ui_component_MovieInfoDisplay.__name__ = "com.tilbuci.ui.component.MovieInfoDisplay";
com_tilbuci_ui_component_MovieInfoDisplay.__super__ = feathers_controls_Panel;
com_tilbuci_ui_component_MovieInfoDisplay.prototype = $extend(feathers_controls_Panel.prototype,{
	_movie: null
	,_scene: null
	,_mvIcon: null
	,_scIcon: null
	,_msg: null
	,_timer: null
	,_acupd: null
	,onUpdate: function() {
		if(this._timer != null) {
			try {
				this._timer.stop();
			} catch( _g ) {
			}
			this._timer = null;
		}
		this.removeChildren();
		if(com_tilbuci_data_GlobalPlayer.movie.get_mvId() != "") {
			this._movie.set_text(com_tilbuci_data_GlobalPlayer.mdata.title);
			this.addChild(this._mvIcon);
			this.addChild(this._movie);
		}
		if(com_tilbuci_data_GlobalPlayer.movie.get_scId() != "") {
			this._scene.set_text(com_tilbuci_data_GlobalPlayer.movie.scene.title);
			this.addChild(this._scIcon);
			this.addChild(this._scene);
		}
		if(this._acupd != null) {
			this._acupd();
		}
	}
	,showMsg: function(txt) {
		this.removeChildren();
		this._msg.set_text(txt);
		this.addChild(this._msg);
		if(this._timer != null) {
			try {
				this._timer.stop();
			} catch( _g ) {
			}
			this._timer = null;
		}
		this._timer = new haxe_Timer(2000);
		this._timer.run = $bind(this,this.onUpdate);
	}
	,onCallout: function(evt) {
		var calltxt = "";
		if(com_tilbuci_data_GlobalPlayer.movie.get_mvId() != "") {
			calltxt += com_tilbuci_data_GlobalPlayer.mdata.title + "\n(ID " + com_tilbuci_data_GlobalPlayer.movie.get_mvId() + ")";
		}
		if(com_tilbuci_data_GlobalPlayer.movie.get_scId() != "") {
			calltxt += "\n" + com_tilbuci_data_GlobalPlayer.movie.scene.title + "\n(ID " + com_tilbuci_data_GlobalPlayer.movie.get_scId() + ")";
		}
		if(calltxt != "") {
			feathers_controls_TextCallout.show(calltxt,this,feathers_layout_RelativePositions.fromRelativePosition(feathers_layout_RelativePosition.TOP));
		}
	}
	,__class__: com_tilbuci_ui_component_MovieInfoDisplay
});
var com_tilbuci_ui_component_PropertiesPanel = function(wd) {
	this._current = null;
	com_tilbuci_ui_component_DropDownPanel.call(this,com_tilbuci_data_Global.ln.get("rightbar-properties"),wd);
	this._timer = null;
	var orderContainer = this.ui.createHContainer("orderbuttons",3355443);
	this.ui.createIconButton("orderdown",$bind(this,this.onOrderDown),new openfl_display_Bitmap(openfl_utils_Assets.getBitmapData("iconDown")),null,orderContainer);
	this.ui.createIconButton("orderup",$bind(this,this.onOrderUp),new openfl_display_Bitmap(openfl_utils_Assets.getBitmapData("iconUp")),null,orderContainer);
	orderContainer.set_width(wd - 5);
	var xContainer = this.ui.createHContainer("xbuttons",3355443);
	this.ui.createIconButton("xleft",$bind(this,this.onXLeft),new openfl_display_Bitmap(openfl_utils_Assets.getBitmapData("btToLeft")),null,xContainer);
	this.ui.createIconButton("xcenter",$bind(this,this.onXCenter),new openfl_display_Bitmap(openfl_utils_Assets.getBitmapData("btToCenter")),null,xContainer);
	this.ui.createIconButton("xright",$bind(this,this.onXRight),new openfl_display_Bitmap(openfl_utils_Assets.getBitmapData("btToRight")),null,xContainer);
	xContainer.set_width(wd - 5);
	var yContainer = this.ui.createHContainer("xbuttons",3355443);
	this.ui.createIconButton("ytop",$bind(this,this.onYTop),new openfl_display_Bitmap(openfl_utils_Assets.getBitmapData("btToTop")),null,yContainer);
	this.ui.createIconButton("ymiddle",$bind(this,this.onYMiddle),new openfl_display_Bitmap(openfl_utils_Assets.getBitmapData("btToMiddle")),null,yContainer);
	this.ui.createIconButton("ybottom",$bind(this,this.onYBottom),new openfl_display_Bitmap(openfl_utils_Assets.getBitmapData("btToDown")),null,yContainer);
	yContainer.set_width(wd - 5);
	var tmp = this.ui;
	var tmp1 = { tp : "Label", id : "px", tx : com_tilbuci_data_Global.ln.get("rightbar-properties-px"), vr : ""};
	var tmp2 = { tp : "Label", id : "py", tx : com_tilbuci_data_Global.ln.get("rightbar-properties-py"), vr : ""};
	var tmp3 = { tp : "Label", id : "width", tx : com_tilbuci_data_Global.ln.get("rightbar-properties-width"), vr : ""};
	var tmp4 = { tp : "Label", id : "height", tx : com_tilbuci_data_Global.ln.get("rightbar-properties-height"), vr : ""};
	var tmp5 = { tp : "Button", id : "awidth", tx : com_tilbuci_data_Global.ln.get("rightbar-properties-awidth"), cl : $bind(this,this.onAdjustWidth)};
	var tmp6 = { tp : "Button", id : "aheight", tx : com_tilbuci_data_Global.ln.get("rightbar-properties-aheight"), cl : $bind(this,this.onAdjustHeight)};
	var tmp7 = { tp : "Button", id : "soriginal", tx : com_tilbuci_data_Global.ln.get("rightbar-properties-soriginal"), cl : $bind(this,this.onAdjustOriginal)};
	var tmp8 = { tp : "Label", id : "order", tx : com_tilbuci_data_Global.ln.get("rightbar-properties-order"), vr : ""};
	var tmp9 = { tp : "Label", id : "visible", tx : com_tilbuci_data_Global.ln.get("rightbar-properties-visible"), vr : ""};
	var tmp10 = com_tilbuci_data_Global.ln.get("rightbar-properties-rotation");
	this._content = tmp.forge("properties",[tmp1,{ tp : "Numeric", id : "px", mn : -10000, mx : 100000, st : 1, vl : 0, ch : $bind(this,this.changeProperties)},{ tp : "Custom", cont : xContainer},tmp2,{ tp : "Numeric", id : "py", mn : -10000, mx : 100000, st : 1, vl : 0, ch : $bind(this,this.changeProperties)},{ tp : "Custom", cont : yContainer},tmp3,{ tp : "Numeric", id : "width", mn : -10000, mx : 100000, st : 1, vl : 0, ch : $bind(this,this.changeProperties)},tmp4,{ tp : "Numeric", id : "height", mn : -10000, mx : 100000, st : 1, vl : 0, ch : $bind(this,this.changeProperties)},tmp5,tmp6,tmp7,tmp8,{ tp : "Custom", cont : orderContainer},tmp9,{ tp : "Toggle", id : "visible", vl : false, ch : $bind(this,this.changeProperties)},{ tp : "Label", id : "rotation", tx : tmp10, vr : ""},{ tp : "Numeric", id : "rotation", mn : -10000, mx : 100000, st : 1, vl : 0, ch : $bind(this,this.changeProperties)}],3355443,wd - 5);
	this.ui.containers.h["properties"].set_enabled(false);
	com_tilbuci_data_Global.history.propDisplay.push($bind(this,this.updateValues));
};
$hxClasses["com.tilbuci.ui.component.PropertiesPanel"] = com_tilbuci_ui_component_PropertiesPanel;
com_tilbuci_ui_component_PropertiesPanel.__name__ = "com.tilbuci.ui.component.PropertiesPanel";
com_tilbuci_ui_component_PropertiesPanel.__super__ = com_tilbuci_ui_component_DropDownPanel;
com_tilbuci_ui_component_PropertiesPanel.prototype = $extend(com_tilbuci_ui_component_DropDownPanel.prototype,{
	_timer: null
	,_current: null
	,updateContent: function(data) {
		if(Object.prototype.hasOwnProperty.call(data.h,"nm")) {
			if(data.h["nm"] == "") {
				this.clearValues();
			} else {
				this._current = com_tilbuci_data_GlobalPlayer.area.instanceRef(data.h["nm"]);
				this.updateValues();
			}
		} else {
			this.clearValues();
		}
	}
	,reloadContent: function(data) {
		this.clearValues();
	}
	,updateValues: function() {
		if(this._current != null) {
			this.ui.containers.h["properties"].set_enabled(false);
			this.ui.numerics.h["px"].set_value(Math.round(this._current.getCurrentNum("x")));
			this.ui.numerics.h["py"].set_value(Math.round(this._current.getCurrentNum("y")));
			this.ui.numerics.h["width"].set_value(Math.round(this._current.getCurrentNum("width")));
			this.ui.numerics.h["height"].set_value(Math.round(this._current.getCurrentNum("height")));
			this.ui.numerics.h["rotation"].set_value(Math.round(this._current.getCurrentNum("rotation")));
			this.ui.toggles.h["visible"].set_selected(this._current.getCurrentBool("visible"));
			this.ui.containers.h["properties"].set_enabled(true);
		}
	}
	,clearValues: function() {
		this.ui.containers.h["properties"].set_enabled(false);
		this.ui.numerics.h["px"].set_value(0);
		this.ui.numerics.h["py"].set_value(0);
		this.ui.numerics.h["width"].set_value(0);
		this.ui.numerics.h["height"].set_value(0);
		this.ui.numerics.h["rotation"].set_value(0);
		this.ui.toggles.h["visible"].set_selected(true);
		this._current = null;
	}
	,changeProperties: function(evt) {
		if(this._current != null && this.ui.containers.h["properties"].get_enabled()) {
			if(com_tilbuci_data_Global.history.states.length == 0) {
				com_tilbuci_data_Global.history.addState(com_tilbuci_data_Global.ln.get("rightbar-history-original"));
			}
			com_tilbuci_data_GlobalPlayer.area.setCurrentNum("x",this.ui.numerics.h["px"].get_value());
			com_tilbuci_data_GlobalPlayer.area.setCurrentNum("y",this.ui.numerics.h["py"].get_value());
			com_tilbuci_data_GlobalPlayer.area.setCurrentNum("width",this.ui.numerics.h["width"].get_value());
			com_tilbuci_data_GlobalPlayer.area.setCurrentNum("height",this.ui.numerics.h["height"].get_value());
			com_tilbuci_data_GlobalPlayer.area.setCurrentNum("rotation",this.ui.numerics.h["rotation"].get_value());
			com_tilbuci_data_GlobalPlayer.area.setCurrentBool("visible",this.ui.toggles.h["visible"].get_selected());
			if(this._timer == null) {
				this._timer = new haxe_Timer(2000);
				this._timer.run = $bind(this,this.saveHistory);
			}
		}
	}
	,onAdjustWidth: function(evt) {
		this.ui.containers.h["properties"].set_enabled(false);
		if(this._current.oHeight() > 0) {
			var nw = this._current.oWidth() * this.ui.numerics.h["height"].get_value() / this._current.oHeight();
			if(com_tilbuci_data_Global.history.states.length == 0) {
				com_tilbuci_data_Global.history.addState(com_tilbuci_data_Global.ln.get("rightbar-history-original"));
			}
			com_tilbuci_data_GlobalPlayer.area.setCurrentNum("width",nw);
			this.ui.numerics.h["width"].set_value(Math.round(nw));
			if(this._timer == null) {
				this._timer = new haxe_Timer(2000);
				this._timer.run = $bind(this,this.saveHistory);
			}
		}
		this.ui.containers.h["properties"].set_enabled(true);
	}
	,onAdjustOriginal: function(evt) {
		this.ui.containers.h["properties"].set_enabled(false);
		if(this._current.oWidth() > 0 && this._current.oHeight() > 0) {
			if(com_tilbuci_data_Global.history.states.length == 0) {
				com_tilbuci_data_Global.history.addState(com_tilbuci_data_Global.ln.get("rightbar-history-original"));
			}
			com_tilbuci_data_GlobalPlayer.area.setCurrentNum("width",this._current.oWidth());
			com_tilbuci_data_GlobalPlayer.area.setCurrentNum("height",this._current.oHeight());
			this.ui.numerics.h["width"].set_value(Math.round(this._current.oWidth()));
			this.ui.numerics.h["height"].set_value(Math.round(this._current.oHeight()));
			if(this._timer == null) {
				this._timer = new haxe_Timer(2000);
				this._timer.run = $bind(this,this.saveHistory);
			}
		}
		this.ui.containers.h["properties"].set_enabled(true);
	}
	,onAdjustHeight: function(evt) {
		this.ui.containers.h["properties"].set_enabled(false);
		if(this._current.oWidth() > 0) {
			var nh = this._current.oHeight() * this.ui.numerics.h["width"].get_value() / this._current.oWidth();
			if(com_tilbuci_data_Global.history.states.length == 0) {
				com_tilbuci_data_Global.history.addState(com_tilbuci_data_Global.ln.get("rightbar-history-original"));
			}
			com_tilbuci_data_GlobalPlayer.area.setCurrentNum("height",nh);
			this.ui.numerics.h["height"].set_value(Math.round(nh));
			if(this._timer == null) {
				this._timer = new haxe_Timer(2000);
				this._timer.run = $bind(this,this.saveHistory);
			}
		}
		this.ui.containers.h["properties"].set_enabled(true);
	}
	,onOrderDown: function(evt) {
		if(com_tilbuci_data_Global.history.states.length == 0) {
			com_tilbuci_data_Global.history.addState(com_tilbuci_data_Global.ln.get("rightbar-history-original"));
		}
		com_tilbuci_data_GlobalPlayer.area.orderDown();
		if(this._timer == null) {
			this._timer = new haxe_Timer(2000);
			this._timer.run = $bind(this,this.saveHistory);
		}
	}
	,onOrderUp: function(evt) {
		if(com_tilbuci_data_Global.history.states.length == 0) {
			com_tilbuci_data_Global.history.addState(com_tilbuci_data_Global.ln.get("rightbar-history-original"));
		}
		com_tilbuci_data_GlobalPlayer.area.orderUp();
		if(this._timer == null) {
			this._timer = new haxe_Timer(2000);
			this._timer.run = $bind(this,this.saveHistory);
		}
	}
	,onXLeft: function(evt) {
		if(com_tilbuci_data_Global.history.states.length == 0) {
			com_tilbuci_data_Global.history.addState(com_tilbuci_data_Global.ln.get("rightbar-history-original"));
		}
		com_tilbuci_data_GlobalPlayer.area.setCurrentNum("x",0);
		this.ui.numerics.h["px"].set_value(Math.round(this._current.getCurrentNum("x")));
		if(this._timer == null) {
			this._timer = new haxe_Timer(2000);
			this._timer.run = $bind(this,this.saveHistory);
		}
	}
	,onXRight: function(evt) {
		if(com_tilbuci_data_Global.history.states.length == 0) {
			com_tilbuci_data_Global.history.addState(com_tilbuci_data_Global.ln.get("rightbar-history-original"));
		}
		if(com_tilbuci_data_GlobalPlayer.orientation == "horizontal") {
			com_tilbuci_data_GlobalPlayer.area.setCurrentNum("x",com_tilbuci_data_GlobalPlayer.mdata.screen.big - this._current.getCurrentNum("width"));
		} else {
			com_tilbuci_data_GlobalPlayer.area.setCurrentNum("x",com_tilbuci_data_GlobalPlayer.mdata.screen.small - this._current.getCurrentNum("width"));
		}
		this.ui.numerics.h["px"].set_value(Math.round(this._current.getCurrentNum("x")));
		if(this._timer == null) {
			this._timer = new haxe_Timer(2000);
			this._timer.run = $bind(this,this.saveHistory);
		}
	}
	,onXCenter: function(evt) {
		if(com_tilbuci_data_Global.history.states.length == 0) {
			com_tilbuci_data_Global.history.addState(com_tilbuci_data_Global.ln.get("rightbar-history-original"));
		}
		if(com_tilbuci_data_GlobalPlayer.orientation == "horizontal") {
			com_tilbuci_data_GlobalPlayer.area.setCurrentNum("x",(com_tilbuci_data_GlobalPlayer.mdata.screen.big - this._current.getCurrentNum("width")) / 2);
		} else {
			com_tilbuci_data_GlobalPlayer.area.setCurrentNum("x",(com_tilbuci_data_GlobalPlayer.mdata.screen.small - this._current.getCurrentNum("width")) / 2);
		}
		this.ui.numerics.h["px"].set_value(Math.round(this._current.getCurrentNum("x")));
		if(this._timer == null) {
			this._timer = new haxe_Timer(2000);
			this._timer.run = $bind(this,this.saveHistory);
		}
	}
	,onYTop: function(evt) {
		if(com_tilbuci_data_Global.history.states.length == 0) {
			com_tilbuci_data_Global.history.addState(com_tilbuci_data_Global.ln.get("rightbar-history-original"));
		}
		com_tilbuci_data_GlobalPlayer.area.setCurrentNum("y",0);
		this.ui.numerics.h["py"].set_value(Math.round(this._current.getCurrentNum("y")));
		if(this._timer == null) {
			this._timer = new haxe_Timer(2000);
			this._timer.run = $bind(this,this.saveHistory);
		}
	}
	,onYBottom: function(evt) {
		if(com_tilbuci_data_Global.history.states.length == 0) {
			com_tilbuci_data_Global.history.addState(com_tilbuci_data_Global.ln.get("rightbar-history-original"));
		}
		if(com_tilbuci_data_GlobalPlayer.orientation == "horizontal") {
			com_tilbuci_data_GlobalPlayer.area.setCurrentNum("y",com_tilbuci_data_GlobalPlayer.mdata.screen.small - this._current.getCurrentNum("height"));
		} else {
			com_tilbuci_data_GlobalPlayer.area.setCurrentNum("y",com_tilbuci_data_GlobalPlayer.mdata.screen.big - this._current.getCurrentNum("height"));
		}
		this.ui.numerics.h["py"].set_value(Math.round(this._current.getCurrentNum("y")));
		if(this._timer == null) {
			this._timer = new haxe_Timer(2000);
			this._timer.run = $bind(this,this.saveHistory);
		}
	}
	,onYMiddle: function(evt) {
		if(com_tilbuci_data_Global.history.states.length == 0) {
			com_tilbuci_data_Global.history.addState(com_tilbuci_data_Global.ln.get("rightbar-history-original"));
		}
		if(com_tilbuci_data_GlobalPlayer.orientation == "horizontal") {
			com_tilbuci_data_GlobalPlayer.area.setCurrentNum("y",(com_tilbuci_data_GlobalPlayer.mdata.screen.small - this._current.getCurrentNum("height")) / 2);
		} else {
			com_tilbuci_data_GlobalPlayer.area.setCurrentNum("y",(com_tilbuci_data_GlobalPlayer.mdata.screen.big - this._current.getCurrentNum("height")) / 2);
		}
		this.ui.numerics.h["py"].set_value(Math.round(this._current.getCurrentNum("y")));
		if(this._timer == null) {
			this._timer = new haxe_Timer(2000);
			this._timer.run = $bind(this,this.saveHistory);
		}
	}
	,saveHistory: function() {
		try {
			this._timer.stop();
		} catch( _g ) {
		}
		this._timer = null;
		com_tilbuci_data_Global.history.addState(com_tilbuci_data_Global.ln.get("rightbar-history-placement"));
	}
	,__class__: com_tilbuci_ui_component_PropertiesPanel
});
var com_tilbuci_ui_component_SoundPanel = function(wd) {
	this._current = null;
	com_tilbuci_ui_component_DropDownPanel.call(this,com_tilbuci_data_Global.ln.get("rightbar-sound"),wd);
	this._timer = null;
	this._content = this.ui.forge("properties",[{ tp : "Label", id : "volume", tx : com_tilbuci_data_Global.ln.get("rightbar-sound-volume"), vr : ""},{ tp : "Numeric", id : "volume", mn : 0, mx : 100, st : 1, vl : 0, ch : $bind(this,this.changeProperties)}],3355443,wd - 5);
	this.ui.containers.h["properties"].set_enabled(false);
	com_tilbuci_data_Global.history.propDisplay.push($bind(this,this.updateValues));
};
$hxClasses["com.tilbuci.ui.component.SoundPanel"] = com_tilbuci_ui_component_SoundPanel;
com_tilbuci_ui_component_SoundPanel.__name__ = "com.tilbuci.ui.component.SoundPanel";
com_tilbuci_ui_component_SoundPanel.__super__ = com_tilbuci_ui_component_DropDownPanel;
com_tilbuci_ui_component_SoundPanel.prototype = $extend(com_tilbuci_ui_component_DropDownPanel.prototype,{
	_timer: null
	,_current: null
	,updateContent: function(data) {
		if(Object.prototype.hasOwnProperty.call(data.h,"nm")) {
			if(data.h["nm"] == "") {
				this.clearValues();
			} else {
				this._current = com_tilbuci_data_GlobalPlayer.area.instanceRef(data.h["nm"]);
				this.updateValues();
			}
		} else {
			this.clearValues();
		}
	}
	,reloadContent: function(data) {
		this.clearValues();
	}
	,updateValues: function() {
		if(this._current != null) {
			this.ui.containers.h["properties"].set_enabled(false);
			this.ui.numerics.h["volume"].set_value(Math.round(this._current.getCurrentNum("volume") * 100));
			this.ui.containers.h["properties"].set_enabled(true);
		}
	}
	,clearValues: function() {
		this.ui.containers.h["properties"].set_enabled(false);
		this.ui.numerics.h["volume"].set_value(0);
		this._current = null;
	}
	,changeProperties: function(evt) {
		if(this._current != null && this.ui.containers.h["properties"].get_enabled()) {
			if(com_tilbuci_data_Global.history.states.length == 0) {
				com_tilbuci_data_Global.history.addState(com_tilbuci_data_Global.ln.get("rightbar-history-original"));
			}
			com_tilbuci_data_GlobalPlayer.area.setCurrentNum("volume",this.ui.numerics.h["volume"].get_value() / 100);
			if(this._timer == null) {
				this._timer = new haxe_Timer(2000);
				this._timer.run = $bind(this,this.saveHistory);
			}
		}
	}
	,saveHistory: function() {
		try {
			this._timer.stop();
		} catch( _g ) {
		}
		this._timer = null;
		com_tilbuci_data_Global.history.addState(com_tilbuci_data_Global.ln.get("rightbar-history-sound"));
	}
	,__class__: com_tilbuci_ui_component_SoundPanel
});
var com_tilbuci_ui_component_TextPanel = function(wd) {
	this._current = null;
	com_tilbuci_ui_component_DropDownPanel.call(this,com_tilbuci_data_Global.ln.get("rightbar-text"),wd);
	this._timer = null;
	var colorCont = this.ui.createHContainer("colorcont",3355443);
	this.ui.createTInput("color","","",colorCont);
	this.ui.createButton("color",com_tilbuci_data_Global.ln.get("default-set"),$bind(this,this.changeProperties),colorCont);
	colorCont.set_width(wd - 5);
	var bgcolorCont = this.ui.createHContainer("bgcolorcont",3355443);
	this.ui.createTInput("background","","",bgcolorCont);
	this.ui.createButton("background",com_tilbuci_data_Global.ln.get("default-set"),$bind(this,this.changeProperties),bgcolorCont);
	bgcolorCont.set_width(wd - 5);
	var tmp = this.ui;
	var tmp1 = { tp : "Label", id : "font", tx : com_tilbuci_data_Global.ln.get("rightbar-text-font"), vr : ""};
	var tmp2 = { tp : "Label", id : "size", tx : com_tilbuci_data_Global.ln.get("rightbar-text-size"), vr : ""};
	var tmp3 = { tp : "Label", id : "color", tx : com_tilbuci_data_Global.ln.get("rightbar-text-color"), vr : ""};
	var tmp4 = { tp : "Label", id : "bold", tx : com_tilbuci_data_Global.ln.get("rightbar-text-bold"), vr : ""};
	var tmp5 = { tp : "Label", id : "italic", tx : com_tilbuci_data_Global.ln.get("rightbar-text-italic"), vr : ""};
	var tmp6 = { tp : "Label", id : "leading", tx : com_tilbuci_data_Global.ln.get("rightbar-text-leading"), vr : ""};
	var tmp7 = { tp : "Label", id : "align", tx : com_tilbuci_data_Global.ln.get("rightbar-text-align"), vr : ""};
	var tmp8 = { tp : "Select", id : "align", vl : [{ text : com_tilbuci_data_Global.ln.get("rightbar-text-alleft"), value : "left"},{ text : com_tilbuci_data_Global.ln.get("rightbar-text-alright"), value : "right"},{ text : com_tilbuci_data_Global.ln.get("rightbar-text-alcenter"), value : "center"},{ text : com_tilbuci_data_Global.ln.get("rightbar-text-aljustify"), value : "justify"}], sl : "left", ch : $bind(this,this.changeProperties)};
	var tmp9 = com_tilbuci_data_Global.ln.get("rightbar-text-background");
	this._content = tmp.forge("properties",[tmp1,{ tp : "Select", id : "font", vl : [], sl : null, ch : $bind(this,this.changeProperties)},tmp2,{ tp : "Numeric", id : "size", mn : 4, mx : 1000, st : 1, vl : 12, ch : $bind(this,this.changeProperties)},tmp3,{ tp : "Custom", cont : colorCont},tmp4,{ tp : "Toggle", id : "bold", vl : false, ch : $bind(this,this.changeProperties)},tmp5,{ tp : "Toggle", id : "italic", vl : false, ch : $bind(this,this.changeProperties)},tmp6,{ tp : "Numeric", id : "leading", mn : -1000, mx : 1000, st : 1, vl : 0, ch : $bind(this,this.changeProperties)},tmp7,tmp8,{ tp : "Label", id : "background", tx : tmp9, vr : ""},{ tp : "Custom", cont : bgcolorCont}],3355443,wd - 5);
	this.ui.containers.h["properties"].set_enabled(false);
	com_tilbuci_data_Global.history.propDisplay.push($bind(this,this.updateValues));
	this.ui.createNumeric("spacing",-100,100,1,0);
};
$hxClasses["com.tilbuci.ui.component.TextPanel"] = com_tilbuci_ui_component_TextPanel;
com_tilbuci_ui_component_TextPanel.__name__ = "com.tilbuci.ui.component.TextPanel";
com_tilbuci_ui_component_TextPanel.__super__ = com_tilbuci_ui_component_DropDownPanel;
com_tilbuci_ui_component_TextPanel.prototype = $extend(com_tilbuci_ui_component_DropDownPanel.prototype,{
	_timer: null
	,_current: null
	,updateContent: function(data) {
		if(Object.prototype.hasOwnProperty.call(data.h,"nm")) {
			if(data.h["nm"] == "") {
				this.clearValues();
			} else {
				this._current = com_tilbuci_data_GlobalPlayer.area.instanceRef(data.h["nm"]);
				this.updateValues();
			}
		} else {
			this.clearValues();
		}
	}
	,reloadContent: function(data) {
		this.clearValues();
	}
	,updateValues: function() {
		if(this._current != null) {
			this.ui.containers.h["properties"].set_enabled(false);
			var fnts = [];
			var _g = 0;
			var _g1 = com_tilbuci_data_Global.fonts.length;
			while(_g < _g1) {
				var n = _g++;
				fnts.push({ text : com_tilbuci_data_Global.fonts[n], value : com_tilbuci_data_Global.fonts[n]});
			}
			var _g = 0;
			var _g1 = com_tilbuci_data_GlobalPlayer.mdata.fonts;
			while(_g < _g1.length) {
				var i = _g1[_g];
				++_g;
				fnts.push({ text : i.name, value : i.name});
			}
			this.ui.setSelectOptions("font",fnts);
			this.ui.setSelectValue("font",this._current.getCurrentStr("textfont"));
			this.ui.inputs.h["color"].set_text(StringTools.replace(this._current.getCurrentStr("textcolor"),"0x","#"));
			this.ui.toggles.h["bold"].set_selected(this._current.getCurrentBool("textbold"));
			this.ui.toggles.h["italic"].set_selected(this._current.getCurrentBool("textitalic"));
			this.ui.numerics.h["size"].set_value(Math.round(this._current.getCurrentNum("textsize")));
			this.ui.numerics.h["leading"].set_value(Math.round(this._current.getCurrentNum("textleading")));
			this.ui.numerics.h["spacing"].set_value(Math.round(this._current.getCurrentNum("textspacing") * 100));
			this.ui.setSelectValue("align",this._current.getCurrentStr("textalign"));
			this.ui.inputs.h["background"].set_text(StringTools.replace(this._current.getCurrentStr("textbackground"),"0x","#"));
			this.ui.containers.h["properties"].set_enabled(true);
		}
	}
	,clearValues: function() {
		this.ui.containers.h["properties"].set_enabled(false);
		this.ui.setSelectOptions("font",[]);
		this.ui.setSelectValue("font","");
		this.ui.inputs.h["color"].set_text("");
		this.ui.toggles.h["bold"].set_selected(false);
		this.ui.toggles.h["italic"].set_selected(false);
		this.ui.numerics.h["size"].set_value(12);
		this.ui.numerics.h["leading"].set_value(0);
		this.ui.numerics.h["spacing"].set_value(0);
		this.ui.setSelectValue("align","left");
		this.ui.inputs.h["background"].set_text("");
		this._current = null;
	}
	,changeProperties: function(evt) {
		if(this._current != null && this.ui.containers.h["properties"].get_enabled()) {
			if(com_tilbuci_data_Global.history.states.length == 0) {
				com_tilbuci_data_Global.history.addState(com_tilbuci_data_Global.ln.get("rightbar-history-original"));
			}
			com_tilbuci_data_GlobalPlayer.area.setCurrentStr("textfont",this.ui.selects.h["font"].get_selectedItem().value);
			var color = StringTools.replace(this.ui.inputs.h["color"].get_text(),"#","0x");
			var colorint = Std.parseInt(color);
			if(colorint == null) {
				color = "0xFFFFFF";
			} else {
				color = "0x" + StringTools.hex(colorint);
			}
			com_tilbuci_data_GlobalPlayer.area.setCurrentStr("textcolor",color);
			this.ui.inputs.h["color"].set_text(StringTools.replace(color,"0x","#"));
			com_tilbuci_data_GlobalPlayer.area.setCurrentBool("textbold",this.ui.toggles.h["bold"].get_selected());
			com_tilbuci_data_GlobalPlayer.area.setCurrentBool("textitalic",this.ui.toggles.h["italic"].get_selected());
			com_tilbuci_data_GlobalPlayer.area.setCurrentNum("textsize",this.ui.numerics.h["size"].get_value());
			com_tilbuci_data_GlobalPlayer.area.setCurrentNum("textleading",this.ui.numerics.h["leading"].get_value());
			com_tilbuci_data_GlobalPlayer.area.setCurrentNum("textspacing",this.ui.numerics.h["spacing"].get_value() / 100);
			com_tilbuci_data_GlobalPlayer.area.setCurrentStr("textalign",this.ui.selects.h["align"].get_selectedItem().value);
			color = StringTools.replace(this.ui.inputs.h["background"].get_text(),"#","0x");
			if(color != "") {
				colorint = Std.parseInt(color);
				if(colorint == null) {
					color = "";
				} else {
					color = "0x" + StringTools.hex(colorint);
				}
			}
			com_tilbuci_data_GlobalPlayer.area.setCurrentStr("textbackground",color);
			this.ui.inputs.h["background"].set_text(StringTools.replace(color,"0x","#"));
			com_tilbuci_data_GlobalPlayer.area.applyText();
			if(this._timer == null) {
				this._timer = new haxe_Timer(2000);
				this._timer.run = $bind(this,this.saveHistory);
			}
		}
	}
	,saveHistory: function() {
		try {
			this._timer.stop();
		} catch( _g ) {
		}
		this._timer = null;
		com_tilbuci_data_Global.history.addState(com_tilbuci_data_Global.ln.get("rightbar-history-text"));
	}
	,__class__: com_tilbuci_ui_component_TextPanel
});
var com_tilbuci_ui_component_WindowAction = function(ac) {
	com_tilbuci_ui_window_PopupWindow.call(this,ac,com_tilbuci_data_Global.ln.get("window-actions-title"),980,com_tilbuci_ui_base_InterfaceFactory.pickValue(540,560),false,true);
};
$hxClasses["com.tilbuci.ui.component.WindowAction"] = com_tilbuci_ui_component_WindowAction;
com_tilbuci_ui_component_WindowAction.__name__ = "com.tilbuci.ui.component.WindowAction";
com_tilbuci_ui_component_WindowAction.__super__ = com_tilbuci_ui_window_PopupWindow;
com_tilbuci_ui_component_WindowAction.prototype = $extend(com_tilbuci_ui_window_PopupWindow.prototype,{
	_acarea: null
	,_acok: null
	,_accancel: null
	,startInterface: function(evt) {
		this._acarea = new com_tilbuci_ui_component_ActionArea(956,446);
		var btContainer = this.ui.createHContainer("buttons");
		this.ui.createButton("btcancel",com_tilbuci_data_Global.ln.get("window-actions-cancel"),$bind(this,this.onCancel),btContainer,false);
		this.ui.createButton("btok",com_tilbuci_data_Global.ln.get("window-actions-ok"),$bind(this,this.onOk),btContainer,false);
		btContainer.setWidth(956);
		this.addForm(com_tilbuci_data_Global.ln.get("window-actions-title"),this.ui.forge("ac",[{ tp : "Custom", cont : this._acarea},{ tp : "Custom", cont : btContainer}],-1,450));
		com_tilbuci_ui_window_PopupWindow.prototype.startInterface.call(this);
	}
	,setContent: function(text,onOk,onCancel) {
		this._acarea.setText(text);
		this._acok = onOk;
		this._accancel = onCancel;
	}
	,kill: function() {
		com_tilbuci_ui_window_PopupWindow.prototype.kill.call(this);
	}
	,onCancel: function(evt) {
		if(this._accancel != null) {
			this._accancel();
		}
		this._acok = this._accancel = null;
		this.closeWindow(null);
	}
	,onOk: function(evt) {
		var json = com_tilbuci_statictools_StringStatic.jsonParse(this._acarea.getText());
		if(this._acarea.getText() != "" && json == false) {
			com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("window-actions-title"),com_tilbuci_data_Global.ln.get("window-actions-error"),300,180,com_tilbuci_data_Global.ln.get("default-ok"));
		} else {
			if(this._acok != null) {
				this._acok(this._acarea.getText());
			}
			this._acok = this._accancel = null;
			this.closeWindow(null);
		}
	}
	,__class__: com_tilbuci_ui_component_WindowAction
});
var com_tilbuci_ui_component_WindowActionBlock = function(ac) {
	com_tilbuci_ui_window_PopupWindow.call(this,ac,com_tilbuci_data_Global.ln.get("window-actions-block"),980,com_tilbuci_ui_base_InterfaceFactory.pickValue(540,550),false,true);
	var tmp = this.ui;
	var tmp1 = this.ui.forge("left",[{ tp : "Label", id : "groups", tx : com_tilbuci_data_Global.ln.get("window-actions-blockgroups"), vr : ""},{ tp : "List", id : "groups", vl : [], sl : "", ht : 440, ch : $bind(this,this.onGroupChange)}]);
	var tmp2 = this.ui;
	var tmp3 = { tp : "Label", id : "available", tx : com_tilbuci_data_Global.ln.get("window-actions-blockavailable"), vr : ""};
	var tmp4 = com_tilbuci_data_Global.ln.get("window-actions-blockcreate");
	this.addForm("blocks",tmp.createColumnHolder("available",tmp1,tmp2.forge("right",[tmp3,{ tp : "List", id : "available", vl : [], sl : "", ht : 410},{ tp : "Button", id : "add", tx : tmp4, ac : $bind(this,this.onCreate)}])));
	this.ui.listDbClick("available",$bind(this,this.onCreate));
};
$hxClasses["com.tilbuci.ui.component.WindowActionBlock"] = com_tilbuci_ui_component_WindowActionBlock;
com_tilbuci_ui_component_WindowActionBlock.__name__ = "com.tilbuci.ui.component.WindowActionBlock";
com_tilbuci_ui_component_WindowActionBlock.__super__ = com_tilbuci_ui_window_PopupWindow;
com_tilbuci_ui_component_WindowActionBlock.prototype = $extend(com_tilbuci_ui_window_PopupWindow.prototype,{
	_onOk: null
	,acStart: function() {
		var groups = [];
		var i = 0;
		var _g = 0;
		var _g1 = com_tilbuci_data_Global.acInfo.groups;
		while(_g < _g1.length) {
			var gr = _g1[_g];
			++_g;
			groups.push({ text : gr.name, value : i});
			++i;
		}
		this.ui.setListValues("groups",groups);
		this.ui.setListValues("available",[]);
		this.ui.setListSelectValue("groups",null);
		this.ui.setListSelectValue("available",null);
	}
	,setContent: function(onOk) {
		this._onOk = onOk;
		this.acStart();
	}
	,onCreate: function(evt) {
		if(this.ui.lists.h["available"].get_selectedItem() != null) {
			com_tilbuci_data_Global.showEditBlockWindow(this.ui.lists.h["available"].get_selectedItem().value,this._onOk);
			this._onOk = null;
			feathers_core_PopUpManager.removePopUp(this);
		}
	}
	,onGroupChange: function(evt) {
		this.ui.setListValues("available",[]);
		this.ui.setListSelectValue("available",null);
		if(this.ui.lists.h["groups"].get_selectedItem() != null) {
			if(com_tilbuci_data_Global.acInfo.groups.length > this.ui.lists.h["groups"].get_selectedItem().value) {
				var av = [];
				var h = com_tilbuci_data_Global.acInfo.groups[this.ui.lists.h["groups"].get_selectedItem().value].actions.h;
				var ac_h = h;
				var ac_keys = Object.keys(h);
				var ac_length = ac_keys.length;
				var ac_current = 0;
				while(ac_current < ac_length) {
					var ac = ac_h[ac_keys[ac_current++]];
					av.push({ text : ac.n, value : ac.a});
				}
				this.ui.setListValues("available",av);
			}
		}
	}
	,__class__: com_tilbuci_ui_component_WindowActionBlock
});
var com_tilbuci_ui_component_WindowBlockEdit = function(ac) {
	this._mnPlacement = [];
	this._scDirections = [];
	this._mvOrigins = [];
	this._blindex = -1;
	com_tilbuci_ui_window_PopupWindow.call(this,ac,"",1100,com_tilbuci_ui_base_InterfaceFactory.pickValue(570,580),false,true);
	this._mvOrigins = [{ text : com_tilbuci_data_Global.ln.get("window-movieprop-oralpha"), value : "alpha"},{ text : com_tilbuci_data_Global.ln.get("window-movieprop-orcenter"), value : "center"},{ text : com_tilbuci_data_Global.ln.get("window-movieprop-ortop"), value : "top"},{ text : com_tilbuci_data_Global.ln.get("window-movieprop-ortopkeep"), value : "topkeep"},{ text : com_tilbuci_data_Global.ln.get("window-movieprop-orbottom"), value : "bottom"},{ text : com_tilbuci_data_Global.ln.get("window-movieprop-orbottomkeep"), value : "bottomkeep"},{ text : com_tilbuci_data_Global.ln.get("window-movieprop-orleft"), value : "left"},{ text : com_tilbuci_data_Global.ln.get("window-movieprop-orleftkeep"), value : "leftkeep"},{ text : com_tilbuci_data_Global.ln.get("window-movieprop-orright"), value : "right"},{ text : com_tilbuci_data_Global.ln.get("window-movieprop-orrightkeep"), value : "rightkeep"}];
	this._scDirections = [{ text : com_tilbuci_data_Global.ln.get("window-movieprop-input-opup"), value : "up"},{ text : com_tilbuci_data_Global.ln.get("window-movieprop-input-opdown"), value : "down"},{ text : com_tilbuci_data_Global.ln.get("window-movieprop-input-opleft"), value : "left"},{ text : com_tilbuci_data_Global.ln.get("window-movieprop-input-opright"), value : "right"},{ text : com_tilbuci_data_Global.ln.get("window-movieprop-input-opnin"), value : "nin"},{ text : com_tilbuci_data_Global.ln.get("window-movieprop-input-opnout"), value : "nout"}];
	this._mnPlacement = [{ text : com_tilbuci_data_Global.ln.get("placement-center"), value : "center"},{ text : com_tilbuci_data_Global.ln.get("placement-centerleft"), value : "centerleft"},{ text : com_tilbuci_data_Global.ln.get("placement-centerright"), value : "centerright"},{ text : com_tilbuci_data_Global.ln.get("placement-top"), value : "top"},{ text : com_tilbuci_data_Global.ln.get("placement-topleft"), value : "topleft"},{ text : com_tilbuci_data_Global.ln.get("placement-topright"), value : "topright"},{ text : com_tilbuci_data_Global.ln.get("placement-bottom"), value : "bottom"},{ text : com_tilbuci_data_Global.ln.get("placement-bottomleft"), value : "bottomleft"},{ text : com_tilbuci_data_Global.ln.get("placement-bottomright"), value : "bottomright"},{ text : com_tilbuci_data_Global.ln.get("placement-absolute"), value : "absolute"}];
	this.ui.createHContainer("assets");
	this.ui.createSelect("assets",[],null,this.ui.hcontainers.h["assets"],false);
	this.ui.hcontainers.h["assets"].addChild(new com_tilbuci_ui_component_IDButton("cpasset",$bind(this,this.onAsset),com_tilbuci_data_Global.ln.get("window-acinstance-cpasset"),openfl_utils_Assets.getBitmapData("btCopy"),false));
	this.ui.createHContainer("ggeneral");
	this.ui.createSelect("ggeneral",[{ text : com_tilbuci_data_Global.ln.get("window-globals-playing"), value : "?_PLAYING", asset : "btBool"},{ text : com_tilbuci_data_Global.ln.get("window-globals-userlogged"), value : "?_USERLOGGED", asset : "btBool"},{ text : com_tilbuci_data_Global.ln.get("window-globals-hadinteraction"), value : "?_HADINTERACTION", asset : "btBool"},{ text : com_tilbuci_data_Global.ln.get("window-globals-server"), value : "?_SERVER", asset : "btBool"},{ text : com_tilbuci_data_Global.ln.get("window-globals-keyframe"), value : "#_KEYFRAME", asset : "btFloat"},{ text : com_tilbuci_data_Global.ln.get("window-globals-areabig"), value : "#_AREABIG", asset : "btFloat"},{ text : com_tilbuci_data_Global.ln.get("window-globals-areasmall"), value : "#_AREASMALL", asset : "btFloat"},{ text : com_tilbuci_data_Global.ln.get("window-globals-contentx"), value : "#_CONTENTX", asset : "btFloat"},{ text : com_tilbuci_data_Global.ln.get("window-globals-contenty"), value : "#_CONTENTY", asset : "btFloat"},{ text : com_tilbuci_data_Global.ln.get("window-globals-contentwidth"), value : "#_CONTENTWIDTH", asset : "btFloat"},{ text : com_tilbuci_data_Global.ln.get("window-globals-contentheight"), value : "#_CONTENTHEIGHT", asset : "btFloat"},{ text : com_tilbuci_data_Global.ln.get("window-globals-movietitle"), value : "$_MOVIETITLE", asset : "btString"},{ text : com_tilbuci_data_Global.ln.get("window-globals-movieid"), value : "$_MOVIEID", asset : "btString"},{ text : com_tilbuci_data_Global.ln.get("window-globals-scenetitle"), value : "$_SCENETITLE", asset : "btString"},{ text : com_tilbuci_data_Global.ln.get("window-globals-sceneid"), value : "$_SCENEID", asset : "btString"},{ text : com_tilbuci_data_Global.ln.get("window-globals-orientation"), value : "$_ORIENTATION", asset : "btString"},{ text : com_tilbuci_data_Global.ln.get("window-globals-urlmovie"), value : "$_URLMOVIE", asset : "btString"},{ text : com_tilbuci_data_Global.ln.get("window-globals-urlscene"), value : "$_URLSCENE", asset : "btString"},{ text : com_tilbuci_data_Global.ln.get("window-globals-username"), value : "$_USERNAME", asset : "btString"},{ text : com_tilbuci_data_Global.ln.get("window-globals-runtime"), value : "$_RUNTIME", asset : "btString"},{ text : com_tilbuci_data_Global.ln.get("window-globals-wsserver"), value : "$_WSSERVER", asset : "btString"},{ text : com_tilbuci_data_Global.ln.get("window-globals-version"), value : "$_VERSION", asset : "btString"},{ text : com_tilbuci_data_Global.ln.get("window-globals-session"), value : "$_SESSION", asset : "btString"},{ text : com_tilbuci_data_Global.ln.get("window-globals-date"), value : "$_DATE", asset : "btString"},{ text : com_tilbuci_data_Global.ln.get("window-globals-time"), value : "$_TIME", asset : "btString"},{ text : com_tilbuci_data_Global.ln.get("window-globals-year"), value : "$_YEAR", asset : "btString"},{ text : com_tilbuci_data_Global.ln.get("window-globals-month"), value : "$_MONTH", asset : "btString"},{ text : com_tilbuci_data_Global.ln.get("window-globals-day"), value : "$_DAY", asset : "btString"},{ text : com_tilbuci_data_Global.ln.get("window-globals-hour"), value : "$_HOUR", asset : "btString"},{ text : com_tilbuci_data_Global.ln.get("window-globals-minute"), value : "$_MINUTE", asset : "btString"},{ text : com_tilbuci_data_Global.ln.get("window-globals-second"), value : "$_SECOND", asset : "btString"}],null,this.ui.hcontainers.h["ggeneral"],false);
	this.ui.hcontainers.h["ggeneral"].addChild(new com_tilbuci_ui_component_IDButton("ggeneral",$bind(this,this.onGeneral),com_tilbuci_data_Global.ln.get("window-globals-get"),openfl_utils_Assets.getBitmapData("btCopy"),false));
	this.ui.createHContainer("ginstancep");
	this.ui.createSelect("ginstancep",[{ text : com_tilbuci_data_Global.ln.get("window-globals-instplaying"), value : "?_INSTANCEPLAYING:"},{ text : com_tilbuci_data_Global.ln.get("window-globals-instvisible"), value : "?_INSTANCEVISIBLE:"},{ text : com_tilbuci_data_Global.ln.get("window-globals-instfontbold"), value : "?_INSTANCEFONTBOLD:"},{ text : com_tilbuci_data_Global.ln.get("window-globals-instfontitalic"), value : "?_INSTANCEFONTITALIC:"},{ text : com_tilbuci_data_Global.ln.get("window-acinstance-px"), value : "#_INSTANCEX:"},{ text : com_tilbuci_data_Global.ln.get("window-acinstance-py"), value : "#_INSTANCEY:"},{ text : com_tilbuci_data_Global.ln.get("window-acinstance-pwidth"), value : "#_INSTANCEWIDTH:"},{ text : com_tilbuci_data_Global.ln.get("window-acinstance-pheight"), value : "#_INSTANCEHEIGHT:"},{ text : com_tilbuci_data_Global.ln.get("window-acinstance-palpha"), value : "#_INSTANCEALPHA:"},{ text : com_tilbuci_data_Global.ln.get("window-acinstance-pvolume"), value : "#_INSTANCEVOLUME:"},{ text : com_tilbuci_data_Global.ln.get("window-acinstance-porder"), value : "#_INSTANCEORDER:"},{ text : com_tilbuci_data_Global.ln.get("window-acinstance-pcoloralpha"), value : "#_INSTANCECOLORALPHA:"},{ text : com_tilbuci_data_Global.ln.get("window-acinstance-protation"), value : "#_INSTANCEROTATION:"},{ text : com_tilbuci_data_Global.ln.get("window-acinstance-pfontsize"), value : "#_INSTANCEFONTSIZE:"},{ text : com_tilbuci_data_Global.ln.get("window-acinstance-pfontleading"), value : "#_INSTANCEFONTLEADING:"},{ text : com_tilbuci_data_Global.ln.get("window-acinstance-pcolor"), value : "$_INSTANCECOLOR:"},{ text : com_tilbuci_data_Global.ln.get("window-globals-insttext"), value : "$_INSTANCETEXT:"},{ text : com_tilbuci_data_Global.ln.get("window-acinstance-pfont"), value : "$_INSTANCEFONT:"},{ text : com_tilbuci_data_Global.ln.get("window-acinstance-pfontcolor"), value : "$_INSTANCEFONTCOLOR:"}],null,this.ui.hcontainers.h["ginstancep"],false);
	this.ui.hcontainers.h["ginstancep"].addChild(new com_tilbuci_ui_component_IDButton("instance",$bind(this,this.onInstance),com_tilbuci_data_Global.ln.get("window-globals-get"),openfl_utils_Assets.getBitmapData("btCopy"),false));
	this.ui.createHContainer("gname");
	this.ui.createTInput("gname","","",this.ui.hcontainers.h["gname"],false);
	this.ui.hcontainers.h["gname"].addChild(new com_tilbuci_ui_component_IDButton("movie",$bind(this,this.onMovie),com_tilbuci_data_Global.ln.get("window-globals-get"),openfl_utils_Assets.getBitmapData("btCopy"),false));
	var tmp = com_tilbuci_data_Global.ln.get("acblock-parameters");
	var tmp1 = this.ui;
	var tmp2 = this.ui.forge("paramleft",[]);
	var tmp3 = this.ui;
	var tmp4 = { tp : "Label", id : "collections", tx : com_tilbuci_data_Global.ln.get("window-acinstance-collections"), vr : ""};
	var tmp5 = { tp : "Label", id : "assets", tx : com_tilbuci_data_Global.ln.get("window-acinstance-assets"), vr : feathers_controls_Label.VARIANT_DETAIL};
	var tmp6 = { tp : "Custom", cont : this.ui.hcontainers.h["assets"]};
	var tmp7 = { tp : "Label", id : "ggeneral", tx : com_tilbuci_data_Global.ln.get("window-globals-general"), vr : ""};
	var tmp8 = { tp : "Custom", cont : this.ui.hcontainers.h["ggeneral"]};
	var tmp9 = { tp : "Label", id : "ginstance", tx : com_tilbuci_data_Global.ln.get("window-globals-instance"), vr : ""};
	var tmp10 = { tp : "Custom", cont : this.ui.hcontainers.h["ginstancep"]};
	var tmp11 = { tp : "Label", id : "gmovie", tx : com_tilbuci_data_Global.ln.get("window-globals-movie"), vr : ""};
	var tmp12 = { tp : "Select", id : "gmovie", vl : [{ text : com_tilbuci_data_Global.ln.get("window-globals-text"), value : "$_TEXTS:"},{ text : com_tilbuci_data_Global.ln.get("window-globals-number"), value : "#_NUMBERS:"},{ text : com_tilbuci_data_Global.ln.get("window-globals-flag"), value : "?_FLAGS:"},{ text : com_tilbuci_data_Global.ln.get("window-acinput-text"), value : "$_INPUT:"},{ text : com_tilbuci_data_Global.ln.get("window-acform-text"), value : "$_FORM:"},{ text : com_tilbuci_data_Global.ln.get("window-acparam-text"), value : "$_PARAM:"},{ text : com_tilbuci_data_Global.ln.get("window-acnumeric-text"), value : "#_NUMERIC:"},{ text : com_tilbuci_data_Global.ln.get("window-actoggle-text"), value : "?_TOGGLE:"}], sl : [], ht : 95};
	var tmp13 = { tp : "Label", id : "gname", tx : com_tilbuci_data_Global.ln.get("window-globals-name"), vr : feathers_controls_Label.VARIANT_DETAIL};
	var tmp14 = { tp : "Custom", cont : this.ui.hcontainers.h["gname"]};
	var tmp15 = com_tilbuci_data_Global.ln.get("acblock-valcopy");
	this.addForm(tmp,tmp1.createColumnHolder("available",tmp2,tmp3.forge("paramright",[tmp4,{ tp : "Select", id : "collections", vl : [], sl : [], ch : $bind(this,this.onCollection)},tmp5,tmp6,{ tp : "Spacer", id : "assets", ht : 4, ln : false},tmp7,tmp8,{ tp : "Spacer", id : "ggeneral", ht : 4, ln : false},tmp9,{ tp : "Select", id : "ginstancen", vl : [], sl : []},tmp10,{ tp : "Spacer", id : "gmovie", ht : 4, ln : false},tmp11,tmp12,tmp13,tmp14,{ tp : "Spacer", id : "showAction", ht : 5, ln : false},{ tp : "Label", id : "showAction", tx : tmp15, vr : ""},{ tp : "TInput", id : "showAction", tx : ""}]),this.ui.forge("parambottom",[{ tp : "Button", id : "blbutton", tx : com_tilbuci_data_Global.ln.get("acblock-button"), ac : $bind(this,this.onClick)}]),460));
	this.ui.containers.h["parambottom"].set_width(1100);
	this.ui.hcontainers.h["assets"].setWidth(510);
	this.ui.hcontainers.h["ggeneral"].setWidth(510);
	this.ui.hcontainers.h["ginstancep"].setWidth(510);
	this.ui.hcontainers.h["gname"].setWidth(510);
	var _g = 0;
	while(_g < 8) {
		var i = _g++;
		this.ui.createLabel("param-" + i,"#" + (i + 1),feathers_controls_Label.VARIANT_DETAIL);
		this.ui.createTInput("param-" + i);
		this.ui.createHContainer("param-" + i);
		this.ui.createSelect("param-" + i,[],null,this.ui.hcontainers.h["param-" + i]);
		this.ui.createLabel("paramor-" + i,com_tilbuci_data_Global.ln.get("acblock-or"),feathers_controls_Label.VARIANT_DETAIL,this.ui.hcontainers.h["param-" + i]);
		this.ui.createTInput("paramor-" + i,"","",this.ui.hcontainers.h["param-" + i]);
		this.ui.hcontainers.h["param-" + i].setWidth(400,[175,30,175]);
		this.ui.labels.h["param-" + i].set_width(this.ui.inputs.h["param-" + i].set_width(this.ui.selects.h["param-" + i].set_width(510)));
	}
};
$hxClasses["com.tilbuci.ui.component.WindowBlockEdit"] = com_tilbuci_ui_component_WindowBlockEdit;
com_tilbuci_ui_component_WindowBlockEdit.__name__ = "com.tilbuci.ui.component.WindowBlockEdit";
com_tilbuci_ui_component_WindowBlockEdit.__super__ = com_tilbuci_ui_window_PopupWindow;
com_tilbuci_ui_component_WindowBlockEdit.prototype = $extend(com_tilbuci_ui_window_PopupWindow.prototype,{
	_blindex: null
	,_onOk: null
	,_acinfo: null
	,_blac: null
	,_mvOrigins: null
	,_scDirections: null
	,_mnPlacement: null
	,acStart: function() {
		this._head.set_text(this._acinfo.n);
		var collist = [];
		var h = com_tilbuci_data_GlobalPlayer.movie.collections.h;
		var k_h = h;
		var k_keys = Object.keys(h);
		var k_length = k_keys.length;
		var k_current = 0;
		while(k_current < k_length) {
			var k = k_keys[k_current++];
			collist.push({ text : com_tilbuci_data_GlobalPlayer.movie.collections.h[k].name, value : k});
		}
		this.ui.setSelectOptions("collections",collist);
		this.onCollection();
		var instlist = [];
		var _g = 0;
		var _g1 = com_tilbuci_data_GlobalPlayer.area.getInstances();
		while(_g < _g1.length) {
			var k = _g1[_g];
			++_g;
			instlist.push({ text : k, value : k});
		}
		this.ui.setListValues("list",instlist);
		this.ui.setSelectOptions("ginstancen",instlist);
		this.ui.containers.h["paramleft"].removeChildren();
		var _g = 0;
		while(_g < 8) {
			var i = _g++;
			if(this._acinfo.p.length > i) {
				this.ui.labels.h["param-" + i].set_text(this._acinfo.p[i].n);
				this.ui.containers.h["paramleft"].addChild(this.ui.labels.h["param-" + i]);
				this.ui.hcontainers.h["param-" + i].setWidth(510,[230,30,230]);
				this.ui.inputs.h["param-" + i].set_text("");
				this.ui.inputs.h["paramor-" + i].set_text("");
				switch(this._acinfo.p[i].v) {
				case "instances":
					this.ui.setSelectOptions("param-" + i,instlist);
					this.ui.containers.h["paramleft"].addChild(this.ui.hcontainers.h["param-" + i]);
					break;
				case "movies":
					this.ui.setSelectOptions("param-" + i,com_tilbuci_data_Global.acInfo.selMovies);
					this.ui.containers.h["paramleft"].addChild(this.ui.hcontainers.h["param-" + i]);
					break;
				case "navigation":
					this.ui.setSelectOptions("param-" + i,this._scDirections);
					this.ui.containers.h["paramleft"].addChild(this.ui.hcontainers.h["param-" + i]);
					break;
				case "origins":
					this.ui.setSelectOptions("param-" + i,this._mvOrigins);
					this.ui.containers.h["paramleft"].addChild(this.ui.hcontainers.h["param-" + i]);
					break;
				case "placement":
					this.ui.setSelectOptions("param-" + i,this._mnPlacement);
					this.ui.containers.h["paramleft"].addChild(this.ui.hcontainers.h["param-" + i]);
					break;
				case "scenes":
					this.ui.setSelectOptions("param-" + i,com_tilbuci_data_Global.acInfo.selScenes);
					this.ui.containers.h["paramleft"].addChild(this.ui.hcontainers.h["param-" + i]);
					break;
				default:
					this.ui.inputs.h["param-" + i].set_text("");
					this.ui.containers.h["paramleft"].addChild(this.ui.inputs.h["param-" + i]);
				}
				if(this._blac != null) {
					if(this._blac.param.length > i) {
						if(this._acinfo.p[i].v == "") {
							this.ui.inputs.h["param-" + i].set_text(this._blac.param[i]);
						} else if(!this.ui.setSelectValue("param-" + i,this._blac.param[i])) {
							this.ui.inputs.h["paramor-" + i].set_text(this._blac.param[i]);
						}
					}
				}
			} else {
				this.ui.labels.h["param-" + i].set_text("#" + (i + 1));
				this.ui.containers.h["paramleft"].addChild(this.ui.labels.h["param-" + i]);
				this.ui.inputs.h["param-" + i].set_text("");
				this.ui.containers.h["paramleft"].addChild(this.ui.inputs.h["param-" + i]);
				if(this._blac != null) {
					if(this._blac.param.length > i) {
						this.ui.inputs.h["param-" + i].set_text(this._blac.param[i]);
					}
				}
			}
		}
	}
	,setContent: function(ac,onOk,index,current) {
		this._onOk = onOk;
		this._blindex = index;
		this._blac = current;
		this._acinfo = new com_tilbuci_script_ActionInfoAc({ n : ac, a : ac, p : [], e : []});
		var _g = 0;
		var _g1 = com_tilbuci_data_Global.acInfo.groups;
		while(_g < _g1.length) {
			var gr = _g1[_g];
			++_g;
			if(Object.prototype.hasOwnProperty.call(gr.actions.h,ac)) {
				this._acinfo = gr.actions.h[ac];
			}
		}
		this.acStart();
	}
	,onClick: function(evt) {
		var ok = true;
		var param = [];
		var _g = 0;
		while(_g < 8) {
			var i = _g++;
			if(ok) {
				var vali = "";
				if(this._acinfo.p.length > i) {
					if(this._acinfo.p[i].v == "") {
						vali = this.ui.inputs.h["param-" + i].get_text();
					} else if(this.ui.inputs.h["paramor-" + i].get_text() != "") {
						vali = this.ui.inputs.h["paramor-" + i].get_text();
					} else {
						vali = this.ui.selects.h["param-" + i].get_selectedItem().value;
					}
					if(vali == "" && this._acinfo.p[i].t != "e") {
						ok = false;
						com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("acblock-errortitle"),com_tilbuci_data_Global.ln.get("acblock-noparam") + this._acinfo.p[i].n,480,180,com_tilbuci_data_Global.ln.get("default-ok"));
					} else {
						switch(this._acinfo.p[i].t) {
						case "b":
							if(HxOverrides.substr(vali,0,1) != "?") {
								vali = vali.toLowerCase();
								if(!(vali == "true" || vali == "false" || vali == "1" || vali == "0")) {
									ok = false;
									com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("acblock-errortitle"),com_tilbuci_data_Global.ln.get("acblock-paramtype") + this._acinfo.p[i].n + com_tilbuci_data_Global.ln.get("acblock-parambool"),480,180,com_tilbuci_data_Global.ln.get("default-ok"));
								}
							}
							break;
						case "f":
							if(HxOverrides.substr(vali,0,1) != "#") {
								if(parseFloat(vali) == null || parseFloat(vali) == NaN) {
									ok = false;
									com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("acblock-errortitle"),com_tilbuci_data_Global.ln.get("acblock-paramtype") + this._acinfo.p[i].n + com_tilbuci_data_Global.ln.get("acblock-paramfloat"),480,180,com_tilbuci_data_Global.ln.get("default-ok"));
								}
							}
							break;
						case "i":
							if(HxOverrides.substr(vali,0,1) != "#") {
								if(parseFloat(vali) == null || parseFloat(vali) == NaN) {
									ok = false;
									com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("acblock-errortitle"),com_tilbuci_data_Global.ln.get("acblock-paramtype") + this._acinfo.p[i].n + com_tilbuci_data_Global.ln.get("acblock-paramint"),480,180,com_tilbuci_data_Global.ln.get("default-ok"));
								}
							}
							break;
						case "s":
							if(HxOverrides.substr(vali,0,1) == "?" || HxOverrides.substr(vali,0,1) == "#") {
								ok = false;
								com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("acblock-errortitle"),com_tilbuci_data_Global.ln.get("acblock-paramtype") + this._acinfo.p[i].n + com_tilbuci_data_Global.ln.get("acblock-paramstring"),480,180,com_tilbuci_data_Global.ln.get("default-ok"));
							}
							break;
						case "v":
							if(!(HxOverrides.substr(vali,0,1) == "?" || HxOverrides.substr(vali,0,1) == "#" || HxOverrides.substr(vali,0,1) == "$")) {
								ok = false;
								com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("acblock-errortitle"),com_tilbuci_data_Global.ln.get("acblock-paramtype") + this._acinfo.p[i].n + com_tilbuci_data_Global.ln.get("acblock-paramvariable"),480,180,com_tilbuci_data_Global.ln.get("default-ok"));
							}
							break;
						}
						if(ok) {
							param.push(vali);
						}
					}
				} else if(this.ui.inputs.h["param-" + i].get_text() != "") {
					param.push(this.ui.inputs.h["param-" + i].get_text());
				}
			}
		}
		if(ok) {
			if(this._blac != null) {
				this._blac.param = param;
				this._onOk(false);
			} else {
				var ac = { ac : this._acinfo.a, param : param};
				if(this._acinfo.e.length > 0) {
					ac[this._acinfo.e[0]] = "[ ]";
				}
				if(this._acinfo.e.length > 1) {
					ac[this._acinfo.e[1]] = "[ ]";
				}
				this._onOk(ac);
			}
			this._blac = null;
			feathers_core_PopUpManager.removePopUp(this);
		}
	}
	,onCollection: function(evt) {
		if(this.ui.selects.h["collections"].get_selectedItem() != null) {
			var list = [];
			var this1 = com_tilbuci_data_GlobalPlayer.movie.collections;
			var key = this.ui.selects.h["collections"].get_selectedItem().value;
			var h = this1.h[key].assets.h;
			var k_h = h;
			var k_keys = Object.keys(h);
			var k_length = k_keys.length;
			var k_current = 0;
			while(k_current < k_length) {
				var k = k_keys[k_current++];
				var this1 = com_tilbuci_data_GlobalPlayer.movie.collections;
				var key = this.ui.selects.h["collections"].get_selectedItem().value;
				list.push({ text : this1.h[key].assets.h[k].name, value : k});
			}
			this.ui.setSelectOptions("assets",list);
			this.ui.setSelectValue("assets",null);
		}
	}
	,onAsset: function(evt) {
		if(this.ui.selects.h["assets"].get_selectedItem() != null) {
			this.ui.inputs.h["showAction"].set_text(this.ui.selects.h["assets"].get_selectedItem().value);
			com_tilbuci_data_Global.copyText(this.ui.selects.h["assets"].get_selectedItem().value);
		}
	}
	,onGeneral: function(evt) {
		if(this.ui.selects.h["ggeneral"].get_selectedItem() != null) {
			this.ui.inputs.h["showAction"].set_text(this.ui.selects.h["ggeneral"].get_selectedItem().value);
			com_tilbuci_data_Global.copyText(this.ui.selects.h["ggeneral"].get_selectedItem().value);
		}
	}
	,onInstance: function(evt) {
		if(this.ui.selects.h["ginstancep"].get_selectedItem() != null) {
			if(this.ui.selects.h["ginstancen"].get_selectedItem() != null) {
				this.ui.inputs.h["showAction"].set_text(this.ui.selects.h["ginstancep"].get_selectedItem().value + this.ui.selects.h["ginstancen"].get_selectedItem().value);
				com_tilbuci_data_Global.copyText(this.ui.selects.h["ginstancep"].get_selectedItem().value + this.ui.selects.h["ginstancen"].get_selectedItem().value);
			}
		}
	}
	,onMovie: function(evt) {
		if(this.ui.selects.h["gmovie"].get_selectedItem() != null) {
			if(this.ui.inputs.h["gname"].get_text() != "") {
				this.ui.inputs.h["showAction"].set_text(Std.string(this.ui.selects.h["gmovie"].get_selectedItem().value) + this.ui.inputs.h["gname"].get_text());
				com_tilbuci_data_Global.copyText(Std.string(this.ui.selects.h["gmovie"].get_selectedItem().value) + this.ui.inputs.h["gname"].get_text());
			}
		}
	}
	,__class__: com_tilbuci_ui_component_WindowBlockEdit
});
var com_tilbuci_ui_main_LeftInterface = function(ac) {
	this._addButtons = new haxe_ds_StringMap();
	feathers_controls_VDividedBox.call(this);
	this.set_layoutData(feathers_layout_AnchorLayoutData.fill());
	this.set_backgroundSkin(new com_tilbuci_ui_base_BackgroundSkin());
	this.set_width(this.set_minWidth(this.set_maxWidth(150)));
	this.ui = new com_tilbuci_ui_base_InterfaceFactory();
	this._action = ac;
	this._topArea = new feathers_controls_ScrollContainer();
	var laytop = new feathers_layout_VerticalLayout();
	laytop.set_gap(10);
	laytop.set_verticalAlign(feathers_layout_VerticalAlign.TOP);
	this._topArea.set_layout(laytop);
	this._topArea.set_backgroundSkin(new com_tilbuci_ui_base_BackgroundSkin());
	this._topArea.setPadding(10);
	this.addChild(this._topArea);
	this._bottomArea = new feathers_controls_ScrollContainer();
	var laybot = new feathers_layout_VerticalLayout();
	laybot.set_gap(10);
	laybot.set_verticalAlign(feathers_layout_VerticalAlign.BOTTOM);
	this._bottomArea.set_layout(laybot);
	this._bottomArea.set_backgroundSkin(new com_tilbuci_ui_base_BackgroundSkin());
	this._bottomArea.setPadding(10);
	this._bottomArea.set_height(this._bottomArea.set_maxHeight(this._bottomArea.set_minHeight(160)));
	this.addChild(this._bottomArea);
	this.createButton("btMovie",com_tilbuci_data_Global.ln.get("leftbar-movie"),"btMovie",$bind(this,this.btMovie),this._topArea);
	this.createButton("btScene",com_tilbuci_data_Global.ln.get("leftbar-scene"),"btScene",$bind(this,this.btScene),this._topArea);
	this.createButton("btKeyframe",com_tilbuci_data_Global.ln.get("leftbar-keyframe"),"btKeyframe",$bind(this,this.btKeyframe),this._topArea);
	this.createButton("btMedia",com_tilbuci_data_Global.ln.get("leftbar-media"),"btMedia",$bind(this,this.btMedia),this._topArea);
	this.createButton("btContraptions",com_tilbuci_data_Global.ln.get("leftbar-contraptions"),"btContraptions",$bind(this,this.btContraption),this._topArea);
	this.createButton("btNarrative",com_tilbuci_data_Global.ln.get("leftbar-narrative"),"btNarrative",$bind(this,this.btNarrative),this._topArea);
	this.createButton("btExchange",com_tilbuci_data_Global.ln.get("leftbar-exchange"),"btExchange",$bind(this,this.btExchange),this._topArea);
	this.createButton("btVisitors",com_tilbuci_data_Global.ln.get("leftbar-visitors"),"btVisitors",$bind(this,this.btVisitors),this._topArea);
	this.createButton("btSetup",com_tilbuci_data_Global.ln.get("leftbar-setup"),"btSetup",$bind(this,this.btSetup),this._topArea);
	this.createButton("btWorkspace",com_tilbuci_data_Global.ln.get("leftbar-workspace"),"btWorkspace",$bind(this,this.btWorkspace),this._bottomArea);
	this.createButton("btFullscreen",com_tilbuci_data_Global.ln.get("leftbar-fullscreen"),"btFullscreen",$bind(this,this.btFullscreen),this._bottomArea);
	this.createButton("btToggle",com_tilbuci_data_Global.ln.get("leftbar-toggle"),"btToggle",$bind(this,this.btToggle),this._bottomArea);
};
$hxClasses["com.tilbuci.ui.main.LeftInterface"] = com_tilbuci_ui_main_LeftInterface;
com_tilbuci_ui_main_LeftInterface.__name__ = "com.tilbuci.ui.main.LeftInterface";
com_tilbuci_ui_main_LeftInterface.__super__ = feathers_controls_VDividedBox;
com_tilbuci_ui_main_LeftInterface.prototype = $extend(feathers_controls_VDividedBox.prototype,{
	_topArea: null
	,_bottomArea: null
	,_action: null
	,_addButtons: null
	,ui: null
	,addButton: function(name,callback,top,asset) {
		if(asset == null) {
			asset = "btPlugin";
		}
		if(top == null) {
			top = true;
		}
		if(top) {
			var this1 = this._addButtons;
			var v = this.createButton(name,name,asset,callback,this._topArea);
			this1.h[name] = v;
		} else {
			var this1 = this._addButtons;
			var v = this.createButton(name,name,asset,callback,this._bottomArea);
			this1.h[name] = v;
		}
	}
	,kill: function() {
		this.removeChildren();
		this._topArea.removeChildren();
		this._bottomArea.removeChildren();
		this._topArea = null;
		this._bottomArea = null;
		this._action = null;
		this.ui.kill();
		this.ui = null;
	}
	,createButton: function(name,txt,ic,ac,holder) {
		var bt = this.ui.createIconButton(name,ac,new openfl_display_Bitmap(openfl_utils_Assets.getBitmapData(ic)),txt,holder);
		bt.set_horizontalAlign(feathers_layout_HorizontalAlign.LEFT);
		bt.set_height(30);
		bt.set_width(130);
		return bt;
	}
	,btMovie: function(evt) {
		this._action("movie");
	}
	,btScene: function(evt) {
		this._action("scene");
	}
	,btKeyframe: function(evt) {
		this._action("keyframe");
	}
	,btMedia: function(evt) {
		this._action("media");
	}
	,btContraption: function(evt) {
		this._action("contraptions");
	}
	,btNarrative: function(evt) {
		this._action("narrative");
	}
	,btExchange: function(evt) {
		this._action("exchange");
	}
	,btVisitors: function(evt) {
		this._action("visitors");
	}
	,btSetup: function(evt) {
		this._action("setup");
	}
	,btToggle: function(evt) {
		if(this.ui.buttons.h["btToggle"].get_width() > 100) {
			this.set_width(this.set_minWidth(this.set_maxWidth(60)));
			this.setSize(60,this.get_height());
			var h = this.ui.buttons.h;
			var b_h = h;
			var b_keys = Object.keys(h);
			var b_length = b_keys.length;
			var b_current = 0;
			while(b_current < b_length) {
				var b = b_keys[b_current++];
				this.ui.buttons.h[b].set_width(40);
				this.ui.buttons.h[b].set_text("");
			}
			this._action("close-interface");
		} else {
			this.set_width(this.set_minWidth(this.set_maxWidth(150)));
			this.setSize(150,this.get_height());
			var h = this.ui.buttons.h;
			var b_h = h;
			var b_keys = Object.keys(h);
			var b_length = b_keys.length;
			var b_current = 0;
			while(b_current < b_length) {
				var b = b_keys[b_current++];
				this.ui.buttons.h[b].set_width(130);
			}
			this.ui.buttons.h["btMovie"].set_text(com_tilbuci_data_Global.ln.get("leftbar-movie"));
			this.ui.buttons.h["btScene"].set_text(com_tilbuci_data_Global.ln.get("leftbar-scene"));
			this.ui.buttons.h["btKeyframe"].set_text(com_tilbuci_data_Global.ln.get("leftbar-keyframe"));
			this.ui.buttons.h["btMedia"].set_text(com_tilbuci_data_Global.ln.get("leftbar-media"));
			this.ui.buttons.h["btContraptions"].set_text(com_tilbuci_data_Global.ln.get("leftbar-contraptions"));
			this.ui.buttons.h["btNarrative"].set_text(com_tilbuci_data_Global.ln.get("leftbar-narrative"));
			this.ui.buttons.h["btSetup"].set_text(com_tilbuci_data_Global.ln.get("leftbar-setup"));
			this.ui.buttons.h["btFullscreen"].set_text(com_tilbuci_data_Global.ln.get("leftbar-fullscreen"));
			this.ui.buttons.h["btWorkspace"].set_text(com_tilbuci_data_Global.ln.get("leftbar-workspace"));
			this.ui.buttons.h["btToggle"].set_text(com_tilbuci_data_Global.ln.get("leftbar-toggle"));
			this.ui.buttons.h["btExchange"].set_text(com_tilbuci_data_Global.ln.get("leftbar-exchange"));
			this.ui.buttons.h["btVisitors"].set_text(com_tilbuci_data_Global.ln.get("leftbar-visitors"));
			var h = this._addButtons.h;
			var nm_h = h;
			var nm_keys = Object.keys(h);
			var nm_length = nm_keys.length;
			var nm_current = 0;
			while(nm_current < nm_length) {
				var nm = nm_keys[nm_current++];
				this._addButtons.h[nm].set_text(nm);
			}
			this._action("open-interface");
		}
	}
	,btFullscreen: function(evt) {
		if(this.stage.get_displayState() == 2) {
			this.stage.set_displayState(0);
		} else {
			this.stage.set_displayState(2);
		}
	}
	,btWorkspace: function(evt) {
		com_tilbuci_data_Global.ws.openWorkspace();
	}
	,__class__: com_tilbuci_ui_main_LeftInterface
});
var com_tilbuci_ui_main_RightInterface = function(centerMethod,startWindow) {
	this._panels = [];
	feathers_controls_ScrollContainer.call(this);
	var lay = new feathers_layout_VerticalLayout();
	lay.set_gap(2);
	lay.setPadding(0);
	this.set_layout(lay);
	var skin = new feathers_skins_RectangleSkin();
	skin.set_fill(feathers_graphics_FillStyle.SolidColor(6710886));
	this.set_backgroundSkin(skin);
	this.set_maxWidth(this.set_minWidth(this.set_width(220)));
	this._panels.push(new com_tilbuci_ui_component_InstancesPanel(200));
	this._panels.push(new com_tilbuci_ui_component_MediaPanel(200));
	this._panels.push(new com_tilbuci_ui_component_PropertiesPanel(200));
	this._panels.push(new com_tilbuci_ui_component_ColorPanel(200));
	this._panels.push(new com_tilbuci_ui_component_TextPanel(200));
	this._panels.push(new com_tilbuci_ui_component_ActionPanel(200));
	this._panels.push(new com_tilbuci_ui_component_SoundPanel(200));
	this._panels.push(new com_tilbuci_ui_component_FilterPanel(200));
	this._panels.push(new com_tilbuci_ui_component_HistoryPanel(200,centerMethod));
	this._panels[1].startWindow = startWindow;
	this._panels[5].startWindow = startWindow;
	var iPanel = this._panels[0];
	var mPanel = this._panels[1];
	mPanel.instanceNamePanelUpdate = $bind(iPanel,iPanel.instanceRename);
	this._panels[1] = mPanel;
	this._panels[0].callbacks.push(($_=this._panels[1],$bind($_,$_.updateContent)));
	this._panels[0].callbacks.push(($_=this._panels[2],$bind($_,$_.updateContent)));
	this._panels[0].callbacks.push(($_=this._panels[3],$bind($_,$_.updateContent)));
	this._panels[0].callbacks.push(($_=this._panels[4],$bind($_,$_.updateContent)));
	this._panels[0].callbacks.push(($_=this._panels[5],$bind($_,$_.updateContent)));
	this._panels[0].callbacks.push(($_=this._panels[6],$bind($_,$_.updateContent)));
	this._panels[0].callbacks.push(($_=this._panels[7],$bind($_,$_.updateContent)));
	this._panels[0].callbacks.push(($_=this._panels[8],$bind($_,$_.updateContent)));
	var _g = 0;
	var _g1 = this._panels;
	while(_g < _g1.length) {
		var p = _g1[_g];
		++_g;
		this.addChild(p);
	}
	this.set_scrollPolicyX(feathers_controls_ScrollPolicy.OFF);
	this.addEventListener("resize",$bind(this,this.onResize));
};
$hxClasses["com.tilbuci.ui.main.RightInterface"] = com_tilbuci_ui_main_RightInterface;
com_tilbuci_ui_main_RightInterface.__name__ = "com.tilbuci.ui.main.RightInterface";
com_tilbuci_ui_main_RightInterface.__super__ = feathers_controls_ScrollContainer;
com_tilbuci_ui_main_RightInterface.prototype = $extend(feathers_controls_ScrollContainer.prototype,{
	_panels: null
	,updateInstances: function() {
		this._panels[0].reloadContent();
		this._panels[1].reloadContent();
		this._panels[2].reloadContent();
		this._panels[3].reloadContent();
		this._panels[4].reloadContent();
		this._panels[5].reloadContent();
		this._panels[6].reloadContent();
		this._panels[7].reloadContent();
		this._panels[8].reloadContent();
	}
	,setInstance: function(data) {
		this._panels[0].updateContent(data);
		this._panels[1].updateContent(data);
		this._panels[2].updateContent(data);
		this._panels[3].updateContent(data);
		this._panels[4].updateContent(data);
		this._panels[5].updateContent(data);
		this._panels[6].updateContent(data);
		this._panels[7].updateContent(data);
	}
	,onResize: function(evt) {
		var _g = 0;
		var _g1 = this._panels;
		while(_g < _g1.length) {
			var p = _g1[_g];
			++_g;
			p.setWd(this.get_width());
		}
	}
	,__class__: com_tilbuci_ui_main_RightInterface
});
var com_tilbuci_ui_menu_DrawerMenu = function(ac,tit) {
	feathers_controls_Panel.call(this);
	this.set_backgroundSkin(new com_tilbuci_ui_base_BackgroundSkin(6710886));
	this._ac = ac;
	this.ui = new com_tilbuci_ui_base_InterfaceFactory();
	this._head = new feathers_controls_Header();
	this._head.set_text(tit);
	this.set_header(this._head);
	var btBack = this.ui.createIconButton("btBack",$bind(this,this.closeMenu),new openfl_display_Bitmap(openfl_utils_Assets.getBitmapData("btBack")));
	btBack.set_horizontalAlign(feathers_layout_HorizontalAlign.LEFT);
	btBack.set_width(40);
	btBack.set_height(30);
	this._head.set_leftView(btBack);
	this._holder = new feathers_controls_ScrollContainer();
	this._holder.set_layout(new feathers_layout_AnchorLayout());
	this._holder.set_backgroundSkin(new com_tilbuci_ui_base_BackgroundSkin(6710886));
	var lay = new feathers_layout_VerticalLayout();
	lay.setPadding(10);
	lay.set_gap(10);
	lay.set_verticalAlign(feathers_layout_VerticalAlign.TOP);
	this._holder.set_layout(lay);
	this.addChild(this._holder);
};
$hxClasses["com.tilbuci.ui.menu.DrawerMenu"] = com_tilbuci_ui_menu_DrawerMenu;
com_tilbuci_ui_menu_DrawerMenu.__name__ = "com.tilbuci.ui.menu.DrawerMenu";
com_tilbuci_ui_menu_DrawerMenu.__super__ = feathers_controls_Panel;
com_tilbuci_ui_menu_DrawerMenu.prototype = $extend(feathers_controls_Panel.prototype,{
	_head: null
	,_holder: null
	,_ac: null
	,ui: null
	,onShow: function() {
	}
	,kill: function() {
		this.removeChildren();
		this._head.set_leftView(null);
		this._head = null;
		this._holder.removeChildren();
		this._holder = null;
		this.ui.kill();
		this.ui = null;
	}
	,addButton: function(name,txt,ac,icon) {
		var bt;
		if(icon == null) {
			bt = this.ui.createButton(name,txt,ac,this._holder);
		} else {
			bt = this.ui.createIconButton(name,ac,icon,txt,this._holder);
		}
		bt.set_width(200);
		bt.set_horizontalAlign(feathers_layout_HorizontalAlign.LEFT);
		return bt;
	}
	,closeMenu: function(evt) {
		this._ac("menu-close");
	}
	,__class__: com_tilbuci_ui_menu_DrawerMenu
});
var com_tilbuci_ui_menu_MenuContraptions = function(ac) {
	com_tilbuci_ui_menu_DrawerMenu.call(this,ac,com_tilbuci_data_Global.ln.get("menu-contraptions-title"));
	this.addButton("btCover",com_tilbuci_data_Global.ln.get("menu-contraptions-cover"),$bind(this,this.onCover));
	this.addButton("btBackground",com_tilbuci_data_Global.ln.get("menu-contraptions-background"),$bind(this,this.onBackground));
	this.addButton("btMenus",com_tilbuci_data_Global.ln.get("menu-contraptions-menus"),$bind(this,this.onMenus));
	this.addButton("btMusic",com_tilbuci_data_Global.ln.get("menu-contraptions-music"),$bind(this,this.onMusic));
	this.addButton("btSound",com_tilbuci_data_Global.ln.get("menu-contraptions-sound"),$bind(this,this.onSound));
	this.addButton("btForms",com_tilbuci_data_Global.ln.get("menu-contraptions-forms"),$bind(this,this.onForms));
	this.addButton("btInterfaces",com_tilbuci_data_Global.ln.get("menu-contraptions-interfaces"),$bind(this,this.onInterfaces));
	this.addButton("btTargets",com_tilbuci_data_Global.ln.get("menu-contraptions-targets"),$bind(this,this.onTargets));
	this.addButton("btMessages",com_tilbuci_data_Global.ln.get("menu-contraptions-messages"),$bind(this,this.onMessages));
};
$hxClasses["com.tilbuci.ui.menu.MenuContraptions"] = com_tilbuci_ui_menu_MenuContraptions;
com_tilbuci_ui_menu_MenuContraptions.__name__ = "com.tilbuci.ui.menu.MenuContraptions";
com_tilbuci_ui_menu_MenuContraptions.__super__ = com_tilbuci_ui_menu_DrawerMenu;
com_tilbuci_ui_menu_MenuContraptions.prototype = $extend(com_tilbuci_ui_menu_DrawerMenu.prototype,{
	onShow: function() {
		com_tilbuci_ui_menu_DrawerMenu.prototype.onShow.call(this);
		if(com_tilbuci_data_GlobalPlayer.movie.get_mvId() == "" || com_tilbuci_data_Global.ws.get_level() > 50) {
			this.ui.buttons.h["btMenus"].set_enabled(false);
			this.ui.buttons.h["btCover"].set_enabled(false);
			this.ui.buttons.h["btMenus"].set_toolTip(com_tilbuci_data_Global.ln.get("tooltip-movie-nomovieaccess"));
			this.ui.buttons.h["btCover"].set_toolTip(com_tilbuci_data_Global.ln.get("tooltip-movie-nomovieaccess"));
			this.ui.buttons.h["btMusic"].set_enabled(false);
			this.ui.buttons.h["btMusic"].set_toolTip(com_tilbuci_data_Global.ln.get("tooltip-movie-nomovieaccess"));
			this.ui.buttons.h["btSound"].set_enabled(false);
			this.ui.buttons.h["btSound"].set_toolTip(com_tilbuci_data_Global.ln.get("tooltip-movie-nomovieaccess"));
			this.ui.buttons.h["btForms"].set_enabled(false);
			this.ui.buttons.h["btForms"].set_toolTip(com_tilbuci_data_Global.ln.get("tooltip-movie-nomovieaccess"));
			this.ui.buttons.h["btInterfaces"].set_enabled(false);
			this.ui.buttons.h["btInterfaces"].set_toolTip(com_tilbuci_data_Global.ln.get("tooltip-movie-nomovieaccess"));
			this.ui.buttons.h["btTargets"].set_enabled(false);
			this.ui.buttons.h["btTargets"].set_toolTip(com_tilbuci_data_Global.ln.get("tooltip-movie-nomovieaccess"));
			this.ui.buttons.h["btMessages"].set_enabled(false);
			this.ui.buttons.h["btMessages"].set_toolTip(com_tilbuci_data_Global.ln.get("tooltip-movie-nomovieaccess"));
			this.ui.buttons.h["btBackground"].set_enabled(false);
			this.ui.buttons.h["btBackground"].set_toolTip(com_tilbuci_data_Global.ln.get("tooltip-movie-nomovieaccess"));
		} else {
			this.ui.buttons.h["btMenus"].set_enabled(true);
			this.ui.buttons.h["btMenus"].set_toolTip(null);
			this.ui.buttons.h["btCover"].set_enabled(true);
			this.ui.buttons.h["btCover"].set_toolTip(null);
			this.ui.buttons.h["btMusic"].set_enabled(true);
			this.ui.buttons.h["btMusic"].set_toolTip(null);
			this.ui.buttons.h["btSound"].set_enabled(true);
			this.ui.buttons.h["btSound"].set_toolTip(null);
			this.ui.buttons.h["btForms"].set_enabled(true);
			this.ui.buttons.h["btForms"].set_toolTip(null);
			this.ui.buttons.h["btInterfaces"].set_enabled(true);
			this.ui.buttons.h["btInterfaces"].set_toolTip(null);
			this.ui.buttons.h["btTargets"].set_enabled(true);
			this.ui.buttons.h["btTargets"].set_toolTip(null);
			this.ui.buttons.h["btMessages"].set_enabled(true);
			this.ui.buttons.h["btMessages"].set_toolTip(null);
			this.ui.buttons.h["btBackground"].set_enabled(true);
			this.ui.buttons.h["btBackground"].set_toolTip(null);
		}
	}
	,kill: function() {
		com_tilbuci_ui_menu_DrawerMenu.prototype.kill.call(this);
	}
	,onMenus: function(evt) {
		this._ac("menus");
	}
	,onCover: function(evt) {
		this._ac("cover");
	}
	,onMusic: function(evt) {
		this._ac("music");
	}
	,onSound: function(evt) {
		this._ac("sound");
	}
	,onForms: function(evt) {
		this._ac("form");
	}
	,onInterfaces: function(evt) {
		this._ac("interfaces");
	}
	,onTargets: function(evt) {
		this._ac("targets");
	}
	,onMessages: function(evt) {
		this._ac("messages");
	}
	,onBackground: function(evt) {
		this._ac("background");
	}
	,__class__: com_tilbuci_ui_menu_MenuContraptions
});
var com_tilbuci_ui_menu_MenuExchange = function(ac) {
	com_tilbuci_ui_menu_DrawerMenu.call(this,ac,com_tilbuci_data_Global.ln.get("menu-exhange-title"));
	this.addButton("btExport",com_tilbuci_data_Global.ln.get("menu-exchange-export"),$bind(this,this.onExport));
	this.addButton("btWebsite",com_tilbuci_data_Global.ln.get("menu-exchange-site"),$bind(this,this.onWebsite));
	this.addButton("btIframe",com_tilbuci_data_Global.ln.get("menu-exchange-iframe"),$bind(this,this.onIframe));
	this.addButton("btPwa",com_tilbuci_data_Global.ln.get("menu-exchange-pwa"),$bind(this,this.onPwa));
	this.addButton("btPublish",com_tilbuci_data_Global.ln.get("menu-exchange-publish"),$bind(this,this.onPublish));
	this.addButton("btDesktop",com_tilbuci_data_Global.ln.get("menu-exchange-desktop"),$bind(this,this.onDesktop));
	this.addButton("btCordova",com_tilbuci_data_Global.ln.get("menu-exchange-cordova"),$bind(this,this.onCordova));
	this.addButton("btImport",com_tilbuci_data_Global.ln.get("menu-exchange-import"),$bind(this,this.onImport));
};
$hxClasses["com.tilbuci.ui.menu.MenuExchange"] = com_tilbuci_ui_menu_MenuExchange;
com_tilbuci_ui_menu_MenuExchange.__name__ = "com.tilbuci.ui.menu.MenuExchange";
com_tilbuci_ui_menu_MenuExchange.__super__ = com_tilbuci_ui_menu_DrawerMenu;
com_tilbuci_ui_menu_MenuExchange.prototype = $extend(com_tilbuci_ui_menu_DrawerMenu.prototype,{
	onShow: function() {
		com_tilbuci_ui_menu_DrawerMenu.prototype.onShow.call(this);
		if(com_tilbuci_data_Global.ws.get_level() <= 50) {
			this.ui.buttons.h["btImport"].set_enabled(true);
			this.ui.buttons.h["btImport"].set_toolTip(null);
		} else {
			this.ui.buttons.h["btImport"].set_enabled(false);
			this.ui.buttons.h["btImport"].set_toolTip(com_tilbuci_data_Global.ln.get("tooltip-movie-nolevel"));
		}
		if(com_tilbuci_data_GlobalPlayer.movie.get_mvId() != "" && com_tilbuci_data_Global.mvOwner) {
			this.ui.buttons.h["btExport"].set_enabled(true);
			this.ui.buttons.h["btIframe"].set_enabled(true);
			this.ui.buttons.h["btWebsite"].set_enabled(true);
			this.ui.buttons.h["btPwa"].set_enabled(true);
			this.ui.buttons.h["btPublish"].set_enabled(true);
			this.ui.buttons.h["btDesktop"].set_enabled(true);
			this.ui.buttons.h["btCordova"].set_enabled(true);
			this.ui.buttons.h["btExport"].set_toolTip(null);
			this.ui.buttons.h["btIframe"].set_toolTip(null);
			this.ui.buttons.h["btPwa"].set_toolTip(null);
			this.ui.buttons.h["btPublish"].set_toolTip(null);
			this.ui.buttons.h["btDesktop"].set_toolTip(null);
			this.ui.buttons.h["btCordova"].set_toolTip(null);
		} else {
			this.ui.buttons.h["btExport"].set_enabled(false);
			this.ui.buttons.h["btIframe"].set_enabled(false);
			this.ui.buttons.h["btWebsite"].set_enabled(false);
			this.ui.buttons.h["btPwa"].set_enabled(false);
			this.ui.buttons.h["btPublish"].set_enabled(false);
			this.ui.buttons.h["btDesktop"].set_enabled(false);
			this.ui.buttons.h["btCordova"].set_enabled(false);
			this.ui.buttons.h["btExport"].set_toolTip(com_tilbuci_data_Global.ln.get("tooltip-movie-nomovieowner"));
			this.ui.buttons.h["btIframe"].set_toolTip(com_tilbuci_data_Global.ln.get("tooltip-movie-nomovieowner"));
			this.ui.buttons.h["btPwa"].set_toolTip(com_tilbuci_data_Global.ln.get("tooltip-movie-nomovieowner"));
			this.ui.buttons.h["btPublish"].set_toolTip(com_tilbuci_data_Global.ln.get("tooltip-movie-nomovieowner"));
			this.ui.buttons.h["btDesktop"].set_toolTip(com_tilbuci_data_Global.ln.get("tooltip-movie-nomovieowner"));
			this.ui.buttons.h["btCordova"].set_toolTip(com_tilbuci_data_Global.ln.get("tooltip-movie-nomovieowner"));
		}
	}
	,kill: function() {
		com_tilbuci_ui_menu_DrawerMenu.prototype.kill.call(this);
	}
	,onExport: function(evt) {
		this._ac("export");
	}
	,onWebsite: function(evt) {
		this._ac("website");
	}
	,onIframe: function(evt) {
		this._ac("iframe");
	}
	,onPwa: function(evt) {
		this._ac("pwa");
	}
	,onPublish: function(evt) {
		this._ac("publish");
	}
	,onDesktop: function(evt) {
		this._ac("desktop");
	}
	,onCordova: function(evt) {
		this._ac("cordova");
	}
	,onImport: function(evt) {
		this._ac("import");
	}
	,__class__: com_tilbuci_ui_menu_MenuExchange
});
var com_tilbuci_ui_menu_MenuKeyframe = function(ac) {
	com_tilbuci_ui_menu_DrawerMenu.call(this,ac,com_tilbuci_data_Global.ln.get("menu-keyframe-title"));
	this.addButton("btAdd",com_tilbuci_data_Global.ln.get("menu-keyframe-add"),$bind(this,this.onAdd));
	this.addButton("btRemove",com_tilbuci_data_Global.ln.get("menu-keyframe-remove"),$bind(this,this.onRemove));
	this.addButton("btManage",com_tilbuci_data_Global.ln.get("menu-keyframe-manage"),$bind(this,this.onManage));
};
$hxClasses["com.tilbuci.ui.menu.MenuKeyframe"] = com_tilbuci_ui_menu_MenuKeyframe;
com_tilbuci_ui_menu_MenuKeyframe.__name__ = "com.tilbuci.ui.menu.MenuKeyframe";
com_tilbuci_ui_menu_MenuKeyframe.__super__ = com_tilbuci_ui_menu_DrawerMenu;
com_tilbuci_ui_menu_MenuKeyframe.prototype = $extend(com_tilbuci_ui_menu_DrawerMenu.prototype,{
	onShow: function() {
		com_tilbuci_ui_menu_DrawerMenu.prototype.onShow.call(this);
		if(com_tilbuci_data_GlobalPlayer.movie.get_mvId() == "" || com_tilbuci_data_GlobalPlayer.movie.get_scId() == "") {
			this.ui.buttons.h["btAdd"].set_enabled(false);
			this.ui.buttons.h["btRemove"].set_enabled(false);
			this.ui.buttons.h["btManage"].set_enabled(false);
			this.ui.buttons.h["btAdd"].set_toolTip(com_tilbuci_data_Global.ln.get("tooltip-movie-noscene"));
			this.ui.buttons.h["btRemove"].set_toolTip(com_tilbuci_data_Global.ln.get("tooltip-movie-noscene"));
			this.ui.buttons.h["btManage"].set_toolTip(com_tilbuci_data_Global.ln.get("tooltip-movie-noscene"));
		} else {
			this.ui.buttons.h["btAdd"].set_enabled(true);
			this.ui.buttons.h["btRemove"].set_enabled(true);
			this.ui.buttons.h["btManage"].set_enabled(true);
			this.ui.buttons.h["btAdd"].set_toolTip(null);
			this.ui.buttons.h["btRemove"].set_toolTip(null);
			this.ui.buttons.h["btManage"].set_toolTip(null);
		}
	}
	,kill: function() {
		com_tilbuci_ui_menu_DrawerMenu.prototype.kill.call(this);
	}
	,onAdd: function(evt) {
		this._ac("add");
	}
	,onRemove: function(evt) {
		this._ac("remove");
	}
	,onManage: function(evt) {
		this._ac("manage");
	}
	,__class__: com_tilbuci_ui_menu_MenuKeyframe
});
var com_tilbuci_ui_menu_MenuMedia = function(ac) {
	com_tilbuci_ui_menu_DrawerMenu.call(this,ac,com_tilbuci_data_Global.ln.get("menu-media-title"));
	this.addButton("btCollectionsAdd",com_tilbuci_data_Global.ln.get("menu-media-collectionsadd"),$bind(this,this.onCollectionsAdd));
	this.ui.createSpacer("addcol",5,false,this._holder);
	this.addButton("btAudio",com_tilbuci_data_Global.ln.get("menu-media-audio"),$bind(this,this.onAudio));
	this.addButton("btHtml",com_tilbuci_data_Global.ln.get("menu-media-html"),$bind(this,this.onHtml));
	this.addButton("btParagraph",com_tilbuci_data_Global.ln.get("menu-media-paragraph"),$bind(this,this.onParagraph));
	this.addButton("btPicture",com_tilbuci_data_Global.ln.get("menu-media-picture"),$bind(this,this.onPicture));
	this.addButton("btShape",com_tilbuci_data_Global.ln.get("menu-media-shape"),$bind(this,this.onShape));
	this.addButton("btSpritemap",com_tilbuci_data_Global.ln.get("menu-media-spritemap"),$bind(this,this.onSpritemap));
	this.addButton("btVideo",com_tilbuci_data_Global.ln.get("menu-media-video"),$bind(this,this.onVideo));
	this.ui.createSpacer("embed",5,false,this._holder);
	this.addButton("btEmbed",com_tilbuci_data_Global.ln.get("menu-media-embed"),$bind(this,this.onEmbed));
	this.addButton("btStrings",com_tilbuci_data_Global.ln.get("menu-media-strings"),$bind(this,this.onStrings));
	this.ui.createSpacer("managecol",5,false,this._holder);
	this.addButton("btCollections",com_tilbuci_data_Global.ln.get("menu-media-collections"),$bind(this,this.onCollections));
	this.addButton("btCollectionsRm",com_tilbuci_data_Global.ln.get("menu-media-collectionsrm"),$bind(this,this.onCollectionsRm));
};
$hxClasses["com.tilbuci.ui.menu.MenuMedia"] = com_tilbuci_ui_menu_MenuMedia;
com_tilbuci_ui_menu_MenuMedia.__name__ = "com.tilbuci.ui.menu.MenuMedia";
com_tilbuci_ui_menu_MenuMedia.__super__ = com_tilbuci_ui_menu_DrawerMenu;
com_tilbuci_ui_menu_MenuMedia.prototype = $extend(com_tilbuci_ui_menu_DrawerMenu.prototype,{
	onShow: function() {
		com_tilbuci_ui_menu_DrawerMenu.prototype.onShow.call(this);
		if(com_tilbuci_data_GlobalPlayer.movie.get_mvId() == "") {
			this.ui.buttons.h["btCollectionsRm"].set_enabled(false);
			this.ui.buttons.h["btCollectionsRm"].set_toolTip(com_tilbuci_data_Global.ln.get("tooltip-movie-nomovie"));
			this.ui.buttons.h["btEmbed"].set_enabled(false);
			this.ui.buttons.h["btEmbed"].set_toolTip(com_tilbuci_data_Global.ln.get("tooltip-movie-nomovie"));
			this.ui.buttons.h["btStrings"].set_enabled(false);
			this.ui.buttons.h["btStrings"].set_toolTip(com_tilbuci_data_Global.ln.get("tooltip-movie-nomovie"));
		} else {
			this.ui.buttons.h["btCollectionsRm"].set_enabled(true);
			this.ui.buttons.h["btCollectionsRm"].set_toolTip(null);
			this.ui.buttons.h["btEmbed"].set_enabled(true);
			this.ui.buttons.h["btEmbed"].set_toolTip(null);
			this.ui.buttons.h["btStrings"].set_enabled(true);
			this.ui.buttons.h["btStrings"].set_toolTip(null);
		}
		if(com_tilbuci_data_GlobalPlayer.movie.get_scId() == "") {
			this.ui.buttons.h["btCollections"].set_enabled(false);
			this.ui.buttons.h["btCollectionsAdd"].set_enabled(false);
			this.ui.buttons.h["btAudio"].set_enabled(false);
			this.ui.buttons.h["btHtml"].set_enabled(false);
			this.ui.buttons.h["btParagraph"].set_enabled(false);
			this.ui.buttons.h["btPicture"].set_enabled(false);
			this.ui.buttons.h["btShape"].set_enabled(false);
			this.ui.buttons.h["btSpritemap"].set_enabled(false);
			this.ui.buttons.h["btVideo"].set_enabled(false);
			this.ui.buttons.h["btCollections"].set_toolTip(com_tilbuci_data_Global.ln.get("tooltip-movie-noscene"));
			this.ui.buttons.h["btCollectionsAdd"].set_toolTip(com_tilbuci_data_Global.ln.get("tooltip-movie-noscene"));
			this.ui.buttons.h["btAudio"].set_toolTip(com_tilbuci_data_Global.ln.get("tooltip-movie-noscene"));
			this.ui.buttons.h["btHtml"].set_toolTip(com_tilbuci_data_Global.ln.get("tooltip-movie-noscene"));
			this.ui.buttons.h["btParagraph"].set_toolTip(com_tilbuci_data_Global.ln.get("tooltip-movie-noscene"));
			this.ui.buttons.h["btPicture"].set_toolTip(com_tilbuci_data_Global.ln.get("tooltip-movie-noscene"));
			this.ui.buttons.h["btShape"].set_toolTip(com_tilbuci_data_Global.ln.get("tooltip-movie-noscene"));
			this.ui.buttons.h["btSpritemap"].set_toolTip(com_tilbuci_data_Global.ln.get("tooltip-movie-noscene"));
			this.ui.buttons.h["btVideo"].set_toolTip(com_tilbuci_data_Global.ln.get("tooltip-movie-noscene"));
		} else {
			this.ui.buttons.h["btCollections"].set_enabled(true);
			this.ui.buttons.h["btCollectionsAdd"].set_enabled(true);
			this.ui.buttons.h["btAudio"].set_enabled(true);
			this.ui.buttons.h["btHtml"].set_enabled(true);
			this.ui.buttons.h["btParagraph"].set_enabled(true);
			this.ui.buttons.h["btPicture"].set_enabled(true);
			this.ui.buttons.h["btShape"].set_enabled(true);
			this.ui.buttons.h["btSpritemap"].set_enabled(true);
			this.ui.buttons.h["btVideo"].set_enabled(true);
			this.ui.buttons.h["btCollections"].set_toolTip(null);
			this.ui.buttons.h["btCollectionsAdd"].set_toolTip(null);
			this.ui.buttons.h["btAudio"].set_toolTip(null);
			this.ui.buttons.h["btHtml"].set_toolTip(null);
			this.ui.buttons.h["btParagraph"].set_toolTip(null);
			this.ui.buttons.h["btPicture"].set_toolTip(null);
			this.ui.buttons.h["btShape"].set_toolTip(null);
			this.ui.buttons.h["btSpritemap"].set_toolTip(null);
			this.ui.buttons.h["btVideo"].set_toolTip(null);
		}
	}
	,kill: function() {
		com_tilbuci_ui_menu_DrawerMenu.prototype.kill.call(this);
	}
	,onCollectionsAdd: function(evt) {
		this._ac("collectionadd");
	}
	,onCollectionsRm: function(evt) {
		this._ac("collectionrm");
	}
	,onCollections: function(evt) {
		this._ac("collection");
	}
	,onPicture: function(evt) {
		this._ac("picture");
	}
	,onShape: function(evt) {
		this._ac("shape");
	}
	,onVideo: function(evt) {
		this._ac("video");
	}
	,onEmbed: function(evt) {
		this._ac("embed");
	}
	,onStrings: function(evt) {
		this._ac("strings");
	}
	,onAudio: function(evt) {
		this._ac("audio");
	}
	,onHtml: function(evt) {
		this._ac("html");
	}
	,onParagraph: function(evt) {
		this._ac("paragraph");
	}
	,onText: function(evt) {
		this._ac("text");
	}
	,onSpritemap: function(evt) {
		this._ac("spritemap");
	}
	,__class__: com_tilbuci_ui_menu_MenuMedia
});
var com_tilbuci_ui_menu_MenuMovie = function(ac) {
	com_tilbuci_ui_menu_DrawerMenu.call(this,ac,com_tilbuci_data_Global.ln.get("menu-movie-title"));
	this.addButton("btNew",com_tilbuci_data_Global.ln.get("menu-movie-new"),$bind(this,this.onNew));
	this.addButton("btOpen",com_tilbuci_data_Global.ln.get("menu-movie-open"),$bind(this,this.onOpen));
	this.addButton("btProperties",com_tilbuci_data_Global.ln.get("menu-movie-properties"),$bind(this,this.onProp));
	this.addButton("btUsers",com_tilbuci_data_Global.ln.get("menu-movie-users"),$bind(this,this.onUsers));
	this.addButton("btRemove",com_tilbuci_data_Global.ln.get("menu-movie-remove"),$bind(this,this.onRemove));
	this.addButton("btNavigation",com_tilbuci_data_Global.ln.get("menu-movie-navigation"),$bind(this,this.onNavigation));
	this.addButton("btSnippets",com_tilbuci_data_Global.ln.get("menu-movie-snippets"),$bind(this,this.onSnippets));
	this.addButton("btRepublish",com_tilbuci_data_Global.ln.get("menu-movie-republish"),$bind(this,this.onRepublish));
	this.addButton("btNotes",com_tilbuci_data_Global.ln.get("menu-movie-notes"),$bind(this,this.onNotes));
	this.addButton("btPlayer",com_tilbuci_data_Global.ln.get("menu-movie-player"),$bind(this,this.onPlayer));
};
$hxClasses["com.tilbuci.ui.menu.MenuMovie"] = com_tilbuci_ui_menu_MenuMovie;
com_tilbuci_ui_menu_MenuMovie.__name__ = "com.tilbuci.ui.menu.MenuMovie";
com_tilbuci_ui_menu_MenuMovie.__super__ = com_tilbuci_ui_menu_DrawerMenu;
com_tilbuci_ui_menu_MenuMovie.prototype = $extend(com_tilbuci_ui_menu_DrawerMenu.prototype,{
	onShow: function() {
		com_tilbuci_ui_menu_DrawerMenu.prototype.onShow.call(this);
		if(com_tilbuci_data_Global.ws.get_level() <= 50) {
			this.ui.buttons.h["btNew"].set_enabled(true);
			this.ui.buttons.h["btNew"].set_toolTip(null);
		} else {
			this.ui.buttons.h["btNew"].set_enabled(false);
			this.ui.buttons.h["btNew"].set_toolTip(com_tilbuci_data_Global.ln.get("tooltip-movie-nolevel"));
		}
		if(com_tilbuci_data_GlobalPlayer.movie.get_mvId() != "") {
			this.ui.buttons.h["btRemove"].set_toolTip(com_tilbuci_data_Global.ln.get("tooltip-movie-remove"));
			this.ui.buttons.h["btRemove"].set_enabled(false);
			if(com_tilbuci_data_Global.mvOwner) {
				this.ui.buttons.h["btProperties"].set_enabled(true);
				this.ui.buttons.h["btUsers"].set_enabled(true);
				this.ui.buttons.h["btProperties"].set_toolTip(null);
				this.ui.buttons.h["btUsers"].set_toolTip(null);
			} else {
				this.ui.buttons.h["btProperties"].set_enabled(false);
				this.ui.buttons.h["btUsers"].set_enabled(false);
				this.ui.buttons.h["btProperties"].set_toolTip(com_tilbuci_data_Global.ln.get("tooltip-movie-noowner"));
				this.ui.buttons.h["btUsers"].set_toolTip(com_tilbuci_data_Global.ln.get("tooltip-movie-noowner"));
			}
			this.ui.buttons.h["btPlayer"].set_enabled(true);
			this.ui.buttons.h["btPlayer"].set_toolTip(null);
			this.ui.buttons.h["btNavigation"].set_enabled(true);
			this.ui.buttons.h["btNavigation"].set_toolTip(null);
			this.ui.buttons.h["btSnippets"].set_enabled(true);
			this.ui.buttons.h["btSnippets"].set_toolTip(null);
			this.ui.buttons.h["btNotes"].set_enabled(true);
			this.ui.buttons.h["btNotes"].set_toolTip(null);
			this.ui.buttons.h["btRepublish"].set_enabled(true);
			this.ui.buttons.h["btRepublish"].set_toolTip(null);
		} else {
			if(com_tilbuci_data_Global.ws.get_level() <= 50) {
				this.ui.buttons.h["btRemove"].set_enabled(true);
				this.ui.buttons.h["btRemove"].set_toolTip(null);
			} else {
				this.ui.buttons.h["btRemove"].set_enabled(false);
				this.ui.buttons.h["btRemove"].set_toolTip(com_tilbuci_data_Global.ln.get("tooltip-movie-nolevel"));
			}
			this.ui.buttons.h["btPlayer"].set_enabled(false);
			this.ui.buttons.h["btNavigation"].set_enabled(false);
			this.ui.buttons.h["btSnippets"].set_enabled(false);
			this.ui.buttons.h["btNotes"].set_enabled(false);
			this.ui.buttons.h["btProperties"].set_enabled(false);
			this.ui.buttons.h["btUsers"].set_enabled(false);
			this.ui.buttons.h["btRepublish"].set_enabled(false);
			this.ui.buttons.h["btProperties"].set_toolTip(com_tilbuci_data_Global.ln.get("tooltip-movie-nomovie"));
			this.ui.buttons.h["btUsers"].set_toolTip(com_tilbuci_data_Global.ln.get("tooltip-movie-nomovie"));
			this.ui.buttons.h["btPlayer"].set_toolTip(com_tilbuci_data_Global.ln.get("tooltip-movie-nomovie"));
			this.ui.buttons.h["btNavigation"].set_toolTip(com_tilbuci_data_Global.ln.get("tooltip-movie-nomovie"));
			this.ui.buttons.h["btSnippets"].set_toolTip(com_tilbuci_data_Global.ln.get("tooltip-movie-nomovie"));
			this.ui.buttons.h["btNotes"].set_toolTip(com_tilbuci_data_Global.ln.get("tooltip-movie-nomovie"));
			this.ui.buttons.h["btRepublish"].set_toolTip(com_tilbuci_data_Global.ln.get("tooltip-movie-nomovie"));
		}
	}
	,kill: function() {
		com_tilbuci_ui_menu_DrawerMenu.prototype.kill.call(this);
	}
	,onNew: function(evt) {
		this._ac("new");
	}
	,onOpen: function(evt) {
		this._ac("open");
	}
	,onProp: function(evt) {
		this._ac("prop");
	}
	,onUsers: function(evt) {
		this._ac("users");
	}
	,onRemove: function(evt) {
		this._ac("remove");
	}
	,onNavigation: function(evt) {
		this._ac("navigation");
	}
	,onSnippets: function(evt) {
		this._ac("snippets");
	}
	,onRepublish: function(evt) {
		this._ac("republish");
	}
	,onNotes: function(evt) {
		this._ac("notes");
	}
	,onPlayer: function(evt) {
		var request = new openfl_net_URLRequest(com_tilbuci_data_GlobalPlayer.base + "app/?mv=" + com_tilbuci_data_GlobalPlayer.movie.get_mvId());
		request.method = "GET";
		openfl_Lib.getURL(request);
	}
	,__class__: com_tilbuci_ui_menu_MenuMovie
});
var com_tilbuci_ui_menu_MenuNarrative = function(ac) {
	com_tilbuci_ui_menu_DrawerMenu.call(this,ac,com_tilbuci_data_Global.ln.get("menu-narrative-title"));
	this.addButton("btChar",com_tilbuci_data_Global.ln.get("menu-narrative-characters"),$bind(this,this.onChar));
	this.addButton("btDiag",com_tilbuci_data_Global.ln.get("menu-narrative-dialogues"),$bind(this,this.onDiag));
	this.addButton("btDflow",com_tilbuci_data_Global.ln.get("menu-narrative-dflow"),$bind(this,this.onDflow));
	this.addButton("btInventory",com_tilbuci_data_Global.ln.get("menu-narrative-inventory"),$bind(this,this.onInventory));
	this.addButton("btBattle",com_tilbuci_data_Global.ln.get("menu-narrative-battle"),$bind(this,this.onBattle));
};
$hxClasses["com.tilbuci.ui.menu.MenuNarrative"] = com_tilbuci_ui_menu_MenuNarrative;
com_tilbuci_ui_menu_MenuNarrative.__name__ = "com.tilbuci.ui.menu.MenuNarrative";
com_tilbuci_ui_menu_MenuNarrative.__super__ = com_tilbuci_ui_menu_DrawerMenu;
com_tilbuci_ui_menu_MenuNarrative.prototype = $extend(com_tilbuci_ui_menu_DrawerMenu.prototype,{
	onShow: function() {
		com_tilbuci_ui_menu_DrawerMenu.prototype.onShow.call(this);
		if(com_tilbuci_data_GlobalPlayer.movie.get_mvId() == "" || com_tilbuci_data_Global.ws.get_level() > 50) {
			this.ui.buttons.h["btChar"].set_enabled(false);
			this.ui.buttons.h["btChar"].set_toolTip(com_tilbuci_data_Global.ln.get("tooltip-movie-nomovieaccess"));
			this.ui.buttons.h["btDiag"].set_enabled(false);
			this.ui.buttons.h["btDiag"].set_toolTip(com_tilbuci_data_Global.ln.get("tooltip-movie-nomovieaccess"));
			this.ui.buttons.h["btDflow"].set_enabled(false);
			this.ui.buttons.h["btDflow"].set_toolTip(com_tilbuci_data_Global.ln.get("tooltip-movie-nomovieaccess"));
			this.ui.buttons.h["btInventory"].set_enabled(false);
			this.ui.buttons.h["btInventory"].set_toolTip(com_tilbuci_data_Global.ln.get("tooltip-movie-nomovieaccess"));
			this.ui.buttons.h["btBattle"].set_enabled(false);
			this.ui.buttons.h["btBattle"].set_toolTip(com_tilbuci_data_Global.ln.get("tooltip-movie-nomovieaccess"));
		} else {
			this.ui.buttons.h["btChar"].set_enabled(true);
			this.ui.buttons.h["btChar"].set_toolTip(null);
			this.ui.buttons.h["btDiag"].set_enabled(true);
			this.ui.buttons.h["btDiag"].set_toolTip(null);
			this.ui.buttons.h["btDflow"].set_enabled(true);
			this.ui.buttons.h["btDflow"].set_toolTip(null);
			this.ui.buttons.h["btInventory"].set_enabled(true);
			this.ui.buttons.h["btInventory"].set_toolTip(null);
			this.ui.buttons.h["btBattle"].set_enabled(true);
			this.ui.buttons.h["btBattle"].set_toolTip(null);
		}
	}
	,kill: function() {
		com_tilbuci_ui_menu_DrawerMenu.prototype.kill.call(this);
	}
	,onChar: function(evt) {
		this._ac("char");
	}
	,onDiag: function(evt) {
		this._ac("diag");
	}
	,onDflow: function(evt) {
		this._ac("dflow");
	}
	,onInventory: function(evt) {
		this._ac("inventory");
	}
	,onBattle: function(evt) {
		this._ac("battle");
	}
	,__class__: com_tilbuci_ui_menu_MenuNarrative
});
var com_tilbuci_ui_menu_MenuScene = function(ac) {
	com_tilbuci_ui_menu_DrawerMenu.call(this,ac,com_tilbuci_data_Global.ln.get("menu-scene-title"));
	this.addButton("btNew",com_tilbuci_data_Global.ln.get("menu-scene-new"),$bind(this,this.onNew));
	this.addButton("btOpen",com_tilbuci_data_Global.ln.get("menu-scene-open"),$bind(this,this.onOpen));
	this.addButton("btProperties",com_tilbuci_data_Global.ln.get("menu-scene-properties"),$bind(this,this.onProp));
	this.addButton("btDflow",com_tilbuci_data_Global.ln.get("menu-scene-dflow"),$bind(this,this.onDflow));
	this.addButton("btSave",com_tilbuci_data_Global.ln.get("menu-scene-save"),$bind(this,this.onSave));
	this.addButton("btSaveAs",com_tilbuci_data_Global.ln.get("menu-scene-saveas"),$bind(this,this.onSaveAs));
	this.addButton("btPublish",com_tilbuci_data_Global.ln.get("menu-scene-publish"),$bind(this,this.onPublish));
	this.addButton("btVersions",com_tilbuci_data_Global.ln.get("menu-scene-versions"),$bind(this,this.onVersions));
	this.addButton("btPlayer",com_tilbuci_data_Global.ln.get("menu-scene-player"),$bind(this,this.onPlayer));
};
$hxClasses["com.tilbuci.ui.menu.MenuScene"] = com_tilbuci_ui_menu_MenuScene;
com_tilbuci_ui_menu_MenuScene.__name__ = "com.tilbuci.ui.menu.MenuScene";
com_tilbuci_ui_menu_MenuScene.__super__ = com_tilbuci_ui_menu_DrawerMenu;
com_tilbuci_ui_menu_MenuScene.prototype = $extend(com_tilbuci_ui_menu_DrawerMenu.prototype,{
	onShow: function() {
		com_tilbuci_ui_menu_DrawerMenu.prototype.onShow.call(this);
		if(com_tilbuci_data_GlobalPlayer.movie.get_mvId() == "") {
			this.ui.buttons.h["btNew"].set_enabled(false);
			this.ui.buttons.h["btOpen"].set_enabled(false);
			this.ui.buttons.h["btProperties"].set_enabled(false);
			this.ui.buttons.h["btDflow"].set_enabled(false);
			this.ui.buttons.h["btSave"].set_enabled(false);
			this.ui.buttons.h["btSaveAs"].set_enabled(false);
			this.ui.buttons.h["btPublish"].set_enabled(false);
			this.ui.buttons.h["btVersions"].set_enabled(false);
			this.ui.buttons.h["btPlayer"].set_enabled(false);
			var h = this.ui.buttons.h;
			var b_h = h;
			var b_keys = Object.keys(h);
			var b_length = b_keys.length;
			var b_current = 0;
			while(b_current < b_length) {
				var b = b_h[b_keys[b_current++]];
				b.set_toolTip(com_tilbuci_data_Global.ln.get("tooltip-movie-nomovie"));
			}
		} else {
			this.ui.buttons.h["btNew"].set_enabled(true);
			this.ui.buttons.h["btOpen"].set_enabled(true);
			this.ui.buttons.h["btNew"].set_toolTip(null);
			this.ui.buttons.h["btOpen"].set_toolTip(null);
			if(com_tilbuci_data_GlobalPlayer.movie.get_scId() == "") {
				this.ui.buttons.h["btProperties"].set_enabled(false);
				this.ui.buttons.h["btDflow"].set_enabled(false);
				this.ui.buttons.h["btSave"].set_enabled(false);
				this.ui.buttons.h["btSaveAs"].set_enabled(false);
				this.ui.buttons.h["btPublish"].set_enabled(false);
				this.ui.buttons.h["btVersions"].set_enabled(false);
				this.ui.buttons.h["btPlayer"].set_enabled(false);
				this.ui.buttons.h["btProperties"].set_toolTip(com_tilbuci_data_Global.ln.get("tooltip-movie-noscene"));
				this.ui.buttons.h["btDflow"].set_toolTip(com_tilbuci_data_Global.ln.get("tooltip-movie-noscene"));
				this.ui.buttons.h["btSave"].set_toolTip(com_tilbuci_data_Global.ln.get("tooltip-movie-noscene"));
				this.ui.buttons.h["btSaveAs"].set_toolTip(com_tilbuci_data_Global.ln.get("tooltip-movie-noscene"));
				this.ui.buttons.h["btPublish"].set_toolTip(com_tilbuci_data_Global.ln.get("tooltip-movie-noscene"));
				this.ui.buttons.h["btVersions"].set_toolTip(com_tilbuci_data_Global.ln.get("tooltip-movie-noscene"));
				this.ui.buttons.h["btPlayer"].set_toolTip(com_tilbuci_data_Global.ln.get("tooltip-movie-noscene"));
			} else {
				this.ui.buttons.h["btProperties"].set_enabled(true);
				this.ui.buttons.h["btDflow"].set_enabled(true);
				this.ui.buttons.h["btSave"].set_enabled(true);
				this.ui.buttons.h["btSaveAs"].set_enabled(true);
				this.ui.buttons.h["btPublish"].set_enabled(true);
				this.ui.buttons.h["btVersions"].set_enabled(true);
				this.ui.buttons.h["btPlayer"].set_enabled(true);
				this.ui.buttons.h["btProperties"].set_toolTip(null);
				this.ui.buttons.h["btDflow"].set_toolTip(null);
				this.ui.buttons.h["btSave"].set_toolTip(null);
				this.ui.buttons.h["btSaveAs"].set_toolTip(null);
				this.ui.buttons.h["btPublish"].set_toolTip(null);
				this.ui.buttons.h["btVersions"].set_toolTip(null);
				this.ui.buttons.h["btPlayer"].set_toolTip(null);
			}
		}
	}
	,kill: function() {
		com_tilbuci_ui_menu_DrawerMenu.prototype.kill.call(this);
	}
	,onNew: function(evt) {
		this._ac("new");
	}
	,onOpen: function(evt) {
		this._ac("open");
	}
	,onSave: function(evt) {
		this._ac("save");
	}
	,onSaveAs: function(evt) {
		this._ac("saveas");
	}
	,onPublish: function(evt) {
		this._ac("publish");
	}
	,onVersions: function(evt) {
		this._ac("version");
	}
	,onProp: function(evt) {
		this._ac("prop");
	}
	,onDflow: function(evt) {
		this._ac("dflow");
	}
	,onUsers: function(evt) {
		this._ac("users");
	}
	,onPlayer: function(evt) {
		var request = new openfl_net_URLRequest(com_tilbuci_data_GlobalPlayer.base + "app/?mv=" + com_tilbuci_data_GlobalPlayer.movie.get_mvId() + "&sc=" + com_tilbuci_data_GlobalPlayer.movie.get_scId());
		request.method = "GET";
		openfl_Lib.getURL(request);
	}
	,__class__: com_tilbuci_ui_menu_MenuScene
});
var com_tilbuci_ui_window_WindowLogin = function(ac) {
	com_tilbuci_ui_window_PopupWindow.call(this,ac,com_tilbuci_data_Global.ln.get("window-login-title"),500,330,false,false);
	this.ui.createContainer("form");
	this.ui.createLabel("username",com_tilbuci_data_Global.ln.get("window-login-username"),feathers_controls_Label.VARIANT_DETAIL,this.ui.lastCont);
	this.ui.createTInput("username","","",this.ui.lastCont);
	this.ui.createLabel("password",com_tilbuci_data_Global.ln.get("window-login-password"),feathers_controls_Label.VARIANT_DETAIL,this.ui.lastCont);
	this.ui.createTInput("userpass","","",this.ui.lastCont);
	this.ui.inputs.h["userpass"].set_displayAsPassword(true);
	this.ui.createSpacer("line-nomail",10,false,this.ui.lastCont);
	this.ui.createButton("btlogin",com_tilbuci_data_Global.ln.get("window-login-button"),$bind(this,this.onEnter),this.ui.lastCont);
	if(!com_tilbuci_data_Global.validEmail) {
		this.ui.createSpacer("before-nomail",30,true,this.ui.lastCont);
		this.ui.createDescription("about-nomail",com_tilbuci_data_Global.ln.get("window-login-noemail"),"",this.ui.lastCont);
	} else {
		this.ui.createSpacer("before-nomail",50,true,this.ui.lastCont);
		this.ui.createButton("btrecover",com_tilbuci_data_Global.ln.get("window-login-recover"),$bind(this,this.onRecover),this.ui.lastCont);
	}
	this.addForm(com_tilbuci_data_Global.ln.get("window-login-title"),this.ui.lastCont);
};
$hxClasses["com.tilbuci.ui.window.WindowLogin"] = com_tilbuci_ui_window_WindowLogin;
com_tilbuci_ui_window_WindowLogin.__name__ = "com.tilbuci.ui.window.WindowLogin";
com_tilbuci_ui_window_WindowLogin.__super__ = com_tilbuci_ui_window_PopupWindow;
com_tilbuci_ui_window_WindowLogin.prototype = $extend(com_tilbuci_ui_window_PopupWindow.prototype,{
	_btEnter: null
	,kill: function() {
		com_tilbuci_ui_window_PopupWindow.prototype.kill.call(this);
	}
	,action: function(ac,data) {
		switch(ac) {
		case "login-error":
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-login-title"),com_tilbuci_data_Global.ln.get("window-login-loginerror"),250,170,this.stage);
			break;
		case "login-nokey":
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-login-title"),com_tilbuci_data_Global.ln.get("window-login-nokey"),250,170,this.stage);
			break;
		case "login-notfound":
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-login-title"),com_tilbuci_data_Global.ln.get("window-login-notfound"),250,170,this.stage);
			break;
		case "login-ok":
			this.ui.inputs.h["username"].set_text("");
			this.ui.inputs.h["userpass"].set_text("");
			break;
		case "login-password":
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-login-title"),com_tilbuci_data_Global.ln.get("window-login-passwordno"),250,170,this.stage);
			break;
		}
	}
	,onEnter: function(evt) {
		if(this.ui.inputs.h["username"].get_text() != "" && this.ui.inputs.h["userpass"].get_text() != "") {
			if(com_tilbuci_statictools_StringStatic.validateEmail(this.ui.inputs.h["username"].get_text())) {
				var tmp = this._ac;
				var _g = new haxe_ds_StringMap();
				var value = this.ui.inputs.h["username"].get_text();
				_g.h["user"] = value;
				var value = this.ui.inputs.h["userpass"].get_text();
				_g.h["pass"] = value;
				tmp("check-login",_g);
			} else {
				this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-login-title"),com_tilbuci_data_Global.ln.get("window-login-emailer"),250,170,this.stage);
			}
		} else {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-login-title"),com_tilbuci_data_Global.ln.get("window-login-noinput"),250,170,this.stage);
		}
	}
	,onRecover: function(evt) {
		if(this.ui.inputs.h["username"].get_text() == "") {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-login-title"),com_tilbuci_data_Global.ln.get("window-login-nouserrecover"),250,170,this.stage);
		} else {
			var tmp = com_tilbuci_data_Global.ws;
			var _g = new haxe_ds_StringMap();
			var value = this.ui.inputs.h["username"].get_text();
			_g.h["user"] = value;
			tmp.send("System/LoginRecover",_g,$bind(this,this.onLoginRecover));
		}
	}
	,onLoginRecover: function(ok,ld) {
		if(!ok) {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-login-title"),com_tilbuci_data_Global.ln.get("window-login-recovererror"),250,170,this.stage);
		} else if(ld.map.h["e"] != 0) {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-login-title"),com_tilbuci_data_Global.ln.get("window-login-recovererror"),250,170,this.stage);
		} else {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-login-title"),com_tilbuci_data_Global.ln.get("window-login-recoversent"),250,170,this.stage);
		}
	}
	,__class__: com_tilbuci_ui_window_WindowLogin
});
var com_tilbuci_ui_window_WindowNotes = function(ac) {
	this._own = [];
	this._scene = [];
	this._movie = [];
	this._guideline = [];
	com_tilbuci_ui_window_PopupWindow.call(this,ac,com_tilbuci_data_Global.ln.get("window-notes-title"),1000,com_tilbuci_ui_base_InterfaceFactory.pickValue(570,600),true,true);
	var tmp = com_tilbuci_data_Global.ln.get("window-notes-movie");
	var tmp1 = this.ui;
	var tmp2 = com_tilbuci_data_Global.ln.get("window-notes-btguidelines");
	this.addForm(tmp,tmp1.forge("guidelines",[{ tp : "TArea", id : "guidelines", ht : 400, tx : "", vr : ""},{ tp : "Select", id : "guidelines", vl : [], sl : [], ch : $bind(this,this.onGuideChange)},{ tp : "Spacer", id : "guidelines", ht : 10, ln : false},{ tp : "Button", id : "guidelines", tx : tmp2, vr : "", ac : $bind(this,this.onGuidelines)}]));
	var tmp = com_tilbuci_data_Global.ln.get("window-notes-movienotes");
	var tmp1 = this.ui;
	var tmp2 = com_tilbuci_data_Global.ln.get("window-notes-btmovie");
	this.addForm(tmp,tmp1.forge("movienotes",[{ tp : "TArea", id : "movie", ht : 400, tx : "", vr : ""},{ tp : "Select", id : "movie", vl : [], sl : [], ch : $bind(this,this.onMovieChange)},{ tp : "Spacer", id : "movie", ht : 10, ln : false},{ tp : "Button", id : "movie", tx : tmp2, vr : "", ac : $bind(this,this.onMovie)}]));
	var tmp = com_tilbuci_data_Global.ln.get("window-notes-scenenotes");
	var tmp1 = this.ui;
	var tmp2 = com_tilbuci_data_Global.ln.get("window-notes-btscene");
	this.addForm(tmp,tmp1.forge("scenenotes",[{ tp : "TArea", id : "scene", ht : 400, tx : "", vr : ""},{ tp : "Select", id : "scene", vl : [], sl : [], ch : $bind(this,this.onSceneChange)},{ tp : "Spacer", id : "scene", ht : 10, ln : false},{ tp : "Button", id : "scene", tx : tmp2, vr : "", ac : $bind(this,this.onScene)}]));
	var tmp = com_tilbuci_data_Global.ln.get("window-notes-ownnotes");
	var tmp1 = this.ui;
	var tmp2 = com_tilbuci_data_Global.ln.get("window-notes-btown");
	this.addForm(tmp,tmp1.forge("ownnotes",[{ tp : "TArea", id : "own", ht : 400, tx : "", vr : ""},{ tp : "Select", id : "own", vl : [], sl : [], ch : $bind(this,this.onOwnChange)},{ tp : "Spacer", id : "own", ht : 10, ln : false},{ tp : "Button", id : "own", tx : tmp2, vr : "", ac : $bind(this,this.onOwn)}]));
	this.redraw();
};
$hxClasses["com.tilbuci.ui.window.WindowNotes"] = com_tilbuci_ui_window_WindowNotes;
com_tilbuci_ui_window_WindowNotes.__name__ = "com.tilbuci.ui.window.WindowNotes";
com_tilbuci_ui_window_WindowNotes.__super__ = com_tilbuci_ui_window_PopupWindow;
com_tilbuci_ui_window_WindowNotes.prototype = $extend(com_tilbuci_ui_window_PopupWindow.prototype,{
	_guideline: null
	,_movie: null
	,_scene: null
	,_own: null
	,acStart: function() {
		var tmp = com_tilbuci_data_Global.ws;
		var _g = new haxe_ds_StringMap();
		var value = com_tilbuci_data_GlobalPlayer.movie.get_mvId();
		_g.h["movie"] = value;
		var value = com_tilbuci_data_GlobalPlayer.movie.get_scId();
		_g.h["scene"] = value;
		tmp.send("Movie/Notes",_g,$bind(this,this.onReceived));
	}
	,kill: function() {
		com_tilbuci_ui_window_PopupWindow.prototype.kill.call(this);
	}
	,onReceived: function(ok,ld) {
		if(ok) {
			if(ld.map.h["e"] == 0) {
				this.setContent(ld);
			} else {
				this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-notes-title"),com_tilbuci_data_Global.ln.get("window-notes-nonotes"),300,150,this.stage);
				feathers_core_PopUpManager.removePopUp(this);
			}
		} else {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-notes-title"),com_tilbuci_data_Global.ln.get("window-notes-nonotes"),300,150,this.stage);
			feathers_core_PopUpManager.removePopUp(this);
		}
	}
	,onGuideChange: function(evt) {
		if(this._guideline.length > 0) {
			this.ui.tareas.h["guidelines"].set_text(this._guideline[this.ui.selects.h["guidelines"].get_selectedIndex()].text);
		} else {
			this.ui.tareas.h["guidelines"].set_text("");
		}
	}
	,onMovieChange: function(evt) {
		if(this._movie.length > 0) {
			this.ui.tareas.h["movie"].set_text(this._movie[this.ui.selects.h["movie"].get_selectedIndex()].text);
		} else {
			this.ui.tareas.h["movie"].set_text("");
		}
	}
	,onSceneChange: function(evt) {
		if(this._scene.length > 0) {
			this.ui.tareas.h["scene"].set_text(this._scene[this.ui.selects.h["scene"].get_selectedIndex()].text);
		} else {
			this.ui.tareas.h["scene"].set_text("");
		}
	}
	,onOwnChange: function(evt) {
		if(this._own.length > 0) {
			this.ui.tareas.h["own"].set_text(this._own[this.ui.selects.h["own"].get_selectedIndex()].text);
		} else {
			this.ui.tareas.h["own"].set_text("");
		}
	}
	,onGuidelines: function(evt) {
		if(com_tilbuci_data_Global.mvOwner) {
			var tmp = com_tilbuci_data_Global.ws;
			var _g = new haxe_ds_StringMap();
			var value = com_tilbuci_data_GlobalPlayer.movie.get_mvId();
			_g.h["movie"] = value;
			var value = com_tilbuci_data_GlobalPlayer.movie.get_scId();
			_g.h["scene"] = value;
			_g.h["type"] = "guide";
			var value = this.ui.tareas.h["guidelines"].get_text();
			_g.h["text"] = value;
			tmp.send("Movie/SaveNote",_g,$bind(this,this.onSaved));
		}
	}
	,onMovie: function(evt) {
		if(com_tilbuci_data_GlobalPlayer.movie.get_mvId() != "") {
			var tmp = com_tilbuci_data_Global.ws;
			var _g = new haxe_ds_StringMap();
			var value = com_tilbuci_data_GlobalPlayer.movie.get_mvId();
			_g.h["movie"] = value;
			var value = com_tilbuci_data_GlobalPlayer.movie.get_scId();
			_g.h["scene"] = value;
			_g.h["type"] = "movie";
			var value = this.ui.tareas.h["movie"].get_text();
			_g.h["text"] = value;
			tmp.send("Movie/SaveNote",_g,$bind(this,this.onSaved));
		}
	}
	,onScene: function(evt) {
		if(com_tilbuci_data_GlobalPlayer.movie.get_scId() != "") {
			var tmp = com_tilbuci_data_Global.ws;
			var _g = new haxe_ds_StringMap();
			var value = com_tilbuci_data_GlobalPlayer.movie.get_mvId();
			_g.h["movie"] = value;
			var value = com_tilbuci_data_GlobalPlayer.movie.get_scId();
			_g.h["scene"] = value;
			_g.h["type"] = "scene";
			var value = this.ui.tareas.h["scene"].get_text();
			_g.h["text"] = value;
			tmp.send("Movie/SaveNote",_g,$bind(this,this.onSaved));
		}
	}
	,onOwn: function(evt) {
		var tmp = com_tilbuci_data_Global.ws;
		var _g = new haxe_ds_StringMap();
		var value = com_tilbuci_data_GlobalPlayer.movie.get_mvId();
		_g.h["movie"] = value;
		var value = com_tilbuci_data_GlobalPlayer.movie.get_scId();
		_g.h["scene"] = value;
		_g.h["type"] = "own";
		var value = this.ui.tareas.h["own"].get_text();
		_g.h["text"] = value;
		tmp.send("Movie/SaveNote",_g,$bind(this,this.onSaved));
	}
	,onSaved: function(ok,ld) {
		if(ok) {
			if(ld.map.h["e"] == 0) {
				com_tilbuci_data_Global.showMsg(com_tilbuci_data_Global.ln.get("window-notes-oksave"));
				this.setContent(ld);
			} else {
				this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-notes-title"),com_tilbuci_data_Global.ln.get("window-notes-nosave"),300,150,this.stage);
			}
		} else {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-notes-title"),com_tilbuci_data_Global.ln.get("window-notes-nosave"),300,150,this.stage);
		}
	}
	,setContent: function(ld) {
		while(this._guideline.length > 0) this._guideline.shift();
		while(this._movie.length > 0) this._movie.shift();
		while(this._scene.length > 0) this._scene.shift();
		while(this._own.length > 0) this._own.shift();
		this._guideline = Reflect.field(ld.map.h["notes"],"guidelines");
		this._movie = Reflect.field(ld.map.h["notes"],"movie");
		this._scene = Reflect.field(ld.map.h["notes"],"scene");
		this._own = Reflect.field(ld.map.h["notes"],"own");
		if(this._guideline.length > 0) {
			var list = [];
			var _g = 0;
			var _g1 = this._guideline;
			while(_g < _g1.length) {
				var n = _g1[_g];
				++_g;
				var bytxt = com_tilbuci_data_Global.ln.get("window-notes-bywhen");
				bytxt = StringTools.replace(bytxt,"[AUTHOR]",n.author);
				bytxt = StringTools.replace(bytxt,"[TIME]",n.time);
				list.push({ text : bytxt, value : n.id});
			}
			this.ui.setSelectOptions("guidelines",list);
			this.ui.selects.h["guidelines"].set_selectedIndex(0);
			this.ui.tareas.h["guidelines"].set_text(this._guideline[0].text);
		} else {
			this.ui.tareas.h["guidelines"].set_text("");
			this.ui.setSelectOptions("guidelines",[]);
			this.ui.setSelectValue("guidelines",null);
		}
		this.ui.buttons.h["guidelines"].set_enabled(com_tilbuci_data_Global.mvOwner);
		if(this._movie.length > 0) {
			var listm = [];
			var _g = 0;
			var _g1 = this._movie;
			while(_g < _g1.length) {
				var n = _g1[_g];
				++_g;
				var bytxt = com_tilbuci_data_Global.ln.get("window-notes-bywhen");
				bytxt = StringTools.replace(bytxt,"[AUTHOR]",n.author);
				bytxt = StringTools.replace(bytxt,"[TIME]",n.time);
				listm.push({ text : bytxt, value : n.id});
			}
			this.ui.setSelectOptions("movie",listm);
			this.ui.selects.h["movie"].set_selectedIndex(0);
			this.ui.tareas.h["movie"].set_text(this._movie[0].text);
		} else {
			this.ui.tareas.h["movie"].set_text("");
			this.ui.setSelectOptions("movie",[]);
			this.ui.setSelectValue("movie",null);
		}
		this.ui.buttons.h["movie"].set_enabled(com_tilbuci_data_Global.mvOwner || com_tilbuci_data_Global.ws.get_level() < 50);
		if(this._scene.length > 0) {
			var lists = [];
			var _g = 0;
			var _g1 = this._scene;
			while(_g < _g1.length) {
				var n = _g1[_g];
				++_g;
				var bytxt = com_tilbuci_data_Global.ln.get("window-notes-bywhen");
				bytxt = StringTools.replace(bytxt,"[AUTHOR]",n.author);
				bytxt = StringTools.replace(bytxt,"[TIME]",n.time);
				lists.push({ text : bytxt, value : n.id});
			}
			this.ui.setSelectOptions("scene",lists);
			this.ui.selects.h["scene"].set_selectedIndex(0);
			this.ui.tareas.h["scene"].set_text(this._scene[0].text);
		} else {
			this.ui.tareas.h["scene"].set_text("");
			this.ui.setSelectOptions("scene",[]);
			this.ui.setSelectValue("scene",null);
		}
		this.ui.buttons.h["scene"].set_enabled(com_tilbuci_data_GlobalPlayer.movie.get_scId() != "");
		if(this._own.length > 0) {
			var listo = [];
			var _g = 0;
			var _g1 = this._own;
			while(_g < _g1.length) {
				var n = _g1[_g];
				++_g;
				listo.push({ text : n.time, value : n.id});
			}
			this.ui.setSelectOptions("own",listo);
			this.ui.selects.h["own"].set_selectedIndex(0);
			this.ui.tareas.h["own"].set_text(this._own[0].text);
		} else {
			this.ui.tareas.h["own"].set_text("");
			this.ui.setSelectOptions("own",[]);
			this.ui.setSelectValue("own",null);
		}
		this.ui.buttons.h["own"].set_enabled(true);
	}
	,__class__: com_tilbuci_ui_window_WindowNotes
});
var com_tilbuci_ui_window_WindowSetup = function(ac,build) {
	com_tilbuci_ui_window_PopupWindow.call(this,ac,com_tilbuci_data_Global.ln.get("window-setup-title"),900,com_tilbuci_ui_base_InterfaceFactory.pickValue(560,640),true,true,true);
	if(!com_tilbuci_data_Global.singleUser) {
		if(com_tilbuci_data_Global.host == "") {
			var tmp = com_tilbuci_data_Global.ln.get("window-setup-user-title");
			var tmp1 = this.ui;
			var tmp2 = { tp : "Label", id : "user-pass", tx : com_tilbuci_data_Global.ln.get("window-setup-user-pass"), vr : ""};
			var tmp3 = { tp : "Button", id : "user-pass", tx : com_tilbuci_data_Global.ln.get("window-setup-user-passchange"), ac : $bind(this,this.onPassChange)};
			var tmp4 = com_tilbuci_data_Global.ln.get("window-setup-user-logout");
			this.addForm(tmp,tmp1.forge("form-user",[tmp2,{ tp : "TInput", id : "user-pass", tx : "", vr : ""},tmp3,{ tp : "Spacer", id : "user-pass", ht : 30, ln : true},{ tp : "Button", id : "user-logout", tx : tmp4, ac : $bind(this,this.onLogout)}]));
			if(com_tilbuci_data_Global.ws.get_level() <= 20) {
				var levelval = [{ text : com_tilbuci_data_Global.ln.get("window-setup-users-listauthor"), value : 75},{ text : com_tilbuci_data_Global.ln.get("window-setup-users-listaeditor"), value : 25}];
				if(com_tilbuci_data_Global.ws.get_level() == 0) {
					levelval.push({ text : com_tilbuci_data_Global.ln.get("window-setup-users-listadmin"), value : 0});
				}
				this.ui.createHContainer("users-setpass");
				this.ui.createTInput("users-setpass","","",this.ui.hcontainers.h["users-setpass"],false);
				this.ui.createButton("users-setpass",com_tilbuci_data_Global.ln.get("window-setup-users-setpass"),$bind(this,this.onSetUserPass),this.ui.hcontainers.h["users-setpass"],false);
				this.ui.hcontainers.h["users-setpass"].setWidth(860);
				var tmp = com_tilbuci_data_Global.ln.get("window-setup-users-title");
				var tmp1 = this.ui;
				var tmp2 = { tp : "Label", id : "users-list", tx : com_tilbuci_data_Global.ln.get("window-setup-users-list"), vr : ""};
				var tmp3 = { tp : "Button", id : "users-remove", tx : com_tilbuci_data_Global.ln.get("window-setup-users-btremove"), ac : $bind(this,this.onRemoveUser)};
				var tmp4 = { tp : "Custom", cont : this.ui.hcontainers.h["users-setpass"]};
				var tmp5 = { tp : "Label", id : "users-new", tx : com_tilbuci_data_Global.ln.get("window-setup-users-new"), vr : ""};
				var tmp6 = { tp : "Label", id : "users-newemail", tx : com_tilbuci_data_Global.ln.get("window-setup-users-newemail"), vr : feathers_controls_Label.VARIANT_DETAIL};
				var tmp7 = { tp : "Label", id : "users-newpass", tx : com_tilbuci_data_Global.ln.get("window-setup-users-newpass"), vr : feathers_controls_Label.VARIANT_DETAIL};
				var tmp8 = { tp : "Label", id : "users-newlevel", tx : com_tilbuci_data_Global.ln.get("window-setup-users-newlevel"), vr : feathers_controls_Label.VARIANT_DETAIL};
				var tmp9 = com_tilbuci_data_Global.ln.get("window-setup-users-newbt");
				this.addForm(tmp,tmp1.forge("form-users",[tmp2,{ tp : "List", id : "users-list", vl : [], ht : 190, sl : ""},tmp3,tmp4,{ tp : "Spacer", id : "users-new", ht : 30, ln : true},tmp5,tmp6,{ tp : "TInput", id : "users-newemail", tx : "", vr : ""},tmp7,{ tp : "TInput", id : "users-newpass", tx : "", vr : ""},tmp8,{ tp : "Select", id : "users-newlevel", vl : levelval, sl : 75},{ tp : "Button", id : "users-create", tx : tmp9, ac : $bind(this,this.onCreateUser)},{ tp : "Spacer", id : "users-end", ht : 10, ln : false}]));
				this.ui.setListToIcon("users-list");
			}
		}
	}
	if(com_tilbuci_data_Global.userLevel == 0) {
		var tmp = com_tilbuci_data_Global.ln.get("window-setup-config-title");
		var tmp1 = this.ui;
		var tmp2 = { tp : "Label", id : "movie-index", tx : com_tilbuci_data_Global.ln.get("window-setup-config-index"), vr : ""};
		var tmp3 = { tp : "Button", id : "movie-index", tx : com_tilbuci_data_Global.ln.get("window-setup-config-indexset"), ac : $bind(this,this.onMovieIndex)};
		var tmp4 = { tp : "Label", id : "share", tx : com_tilbuci_data_Global.ln.get("window-setup-config-share"), vr : ""};
		var tmp5 = { tp : "Select", id : "share", vl : [{ text : com_tilbuci_data_Global.ln.get("window-setup-config-shscene"), value : "scene"},{ text : com_tilbuci_data_Global.ln.get("window-setup-config-shmovie"), value : "movie"},{ text : com_tilbuci_data_Global.ln.get("window-setup-config-shnever"), value : "never"}], sl : com_tilbuci_data_GlobalPlayer.share};
		var tmp6 = { tp : "Button", id : "share", tx : com_tilbuci_data_Global.ln.get("window-setup-config-rdset"), ac : $bind(this,this.onShareSet)};
		var tmp7 = { tp : "Label", id : "fps", tx : com_tilbuci_data_Global.ln.get("window-setup-config-fps"), vr : ""};
		var tmp8 = { tp : "Select", id : "fps", vl : [{ text : com_tilbuci_data_Global.ln.get("window-setup-config-fps60"), value : "60"},{ text : com_tilbuci_data_Global.ln.get("window-setup-config-fps50"), value : "50"},{ text : com_tilbuci_data_Global.ln.get("window-setup-config-fps40"), value : "40"},{ text : com_tilbuci_data_Global.ln.get("window-setup-config-fps30"), value : "30"},{ text : com_tilbuci_data_Global.ln.get("window-setup-config-fps20"), value : "20"},{ text : com_tilbuci_data_Global.ln.get("window-setup-config-fpsfree"), value : "free"},{ text : com_tilbuci_data_Global.ln.get("window-setup-config-fpscalc"), value : "calc"}], sl : com_tilbuci_data_GlobalPlayer.fps};
		var tmp9 = com_tilbuci_data_Global.ln.get("window-setup-config-fpssave");
		this.addForm(tmp,tmp1.forge("form-movie",[tmp2,{ tp : "Select", id : "movie-index", vl : [], sl : ""},tmp3,{ tp : "Spacer", id : "share", ht : 5, ln : false},tmp4,tmp5,tmp6,{ tp : "Spacer", id : "fps", ht : 5, ln : false},tmp7,tmp8,{ tp : "Button", id : "fps", tx : tmp9, ac : $bind(this,this.onFpsSet)}]));
		if(com_tilbuci_data_Global.host == "") {
			var tmp = com_tilbuci_data_Global.ln.get("window-setup-email-title");
			var tmp1 = this.ui;
			var tmp2 = { tp : "Label", id : "email-sender", tx : com_tilbuci_data_Global.ln.get("window-setup-email-sender"), vr : feathers_controls_Label.VARIANT_DETAIL};
			var tmp3 = { tp : "Label", id : "email-email", tx : com_tilbuci_data_Global.ln.get("window-setup-email-email"), vr : feathers_controls_Label.VARIANT_DETAIL};
			var tmp4 = { tp : "Label", id : "email-server", tx : com_tilbuci_data_Global.ln.get("window-setup-email-server"), vr : feathers_controls_Label.VARIANT_DETAIL};
			var tmp5 = { tp : "Label", id : "email-user", tx : com_tilbuci_data_Global.ln.get("window-setup-email-user"), vr : feathers_controls_Label.VARIANT_DETAIL};
			var tmp6 = { tp : "Label", id : "email-password", tx : com_tilbuci_data_Global.ln.get("window-setup-email-password"), vr : feathers_controls_Label.VARIANT_DETAIL};
			var tmp7 = { tp : "Label", id : "email-port", tx : com_tilbuci_data_Global.ln.get("window-setup-email-port"), vr : feathers_controls_Label.VARIANT_DETAIL};
			var tmp8 = { tp : "Label", id : "email-security", tx : com_tilbuci_data_Global.ln.get("window-setup-email-security"), vr : feathers_controls_Label.VARIANT_DETAIL};
			var tmp9 = com_tilbuci_data_Global.ln.get("window-setup-email-save");
			this.addForm(tmp,tmp1.forge("form-email",[tmp2,{ tp : "TInput", id : "email-sender", tx : "", vr : ""},tmp3,{ tp : "TInput", id : "email-email", tx : "", vr : ""},tmp4,{ tp : "TInput", id : "email-server", tx : "", vr : ""},tmp5,{ tp : "TInput", id : "email-user", tx : "", vr : ""},tmp6,{ tp : "TInput", id : "email-password", tx : "", vr : ""},tmp7,{ tp : "TInput", id : "email-port", tx : "", vr : ""},tmp8,{ tp : "Select", id : "email-security", vl : [{ text : "SSL", value : "ssl"},{ text : "TLS", value : "tcp"},{ text : "None", value : ""}], sl : "ssl"},{ tp : "Spacer", id : "email-button", ht : 10, ln : false},{ tp : "Button", id : "email-save", tx : tmp9, ac : $bind(this,this.onEmailSave)},{ tp : "Spacer", id : "email-end", ht : 10, ln : false}]));
			this.ui.inputs.h["email-password"].set_displayAsPassword(true);
			this.ui.createDescription("email-codeabout",com_tilbuci_data_Global.ln.get("window-setup-email-codeabout"));
			this.ui.createTInput("email-code");
			this.ui.createButton("email-codebutton",com_tilbuci_data_Global.ln.get("window-setup-email-codecheck"),$bind(this,this.checkEmailCode));
			this.ui.createSpacer("email-codespace",20,true);
			this.ui.createDescription("email-codevalid",com_tilbuci_data_Global.ln.get("window-setup-email-codevalid"));
		}
		var fnts = [];
		var _g = 0;
		var _g1 = com_tilbuci_data_Global.fonts.length;
		while(_g < _g1) {
			var n = _g++;
			fnts.push({ text : com_tilbuci_data_Global.fonts[n], value : com_tilbuci_data_Global.fonts[n]});
		}
		var tmp = com_tilbuci_data_Global.ln.get("window-setup-font-title");
		var tmp1 = this.ui;
		var tmp2 = { tp : "Button", id : "font-delete", tx : com_tilbuci_data_Global.ln.get("window-setup-font-delete"), ac : $bind(this,this.onFontDelete)};
		var tmp3 = { tp : "Button", id : "font-add", tx : com_tilbuci_data_Global.ln.get("window-setup-font-add"), ac : $bind(this,this.onFontAdd)};
		var tmp4 = { tp : "Label", id : "font-file", tx : com_tilbuci_data_Global.ln.get("window-setup-font-file"), vr : feathers_controls_Label.VARIANT_DETAIL};
		var tmp5 = { tp : "Label", id : "font-name", tx : com_tilbuci_data_Global.ln.get("window-setup-font-name"), vr : feathers_controls_Label.VARIANT_DETAIL};
		var tmp6 = com_tilbuci_data_Global.ln.get("window-setup-font-upload");
		this.addForm(tmp,tmp1.forge("form-fonts",[{ tp : "List", id : "font-list", vl : fnts, ht : 240, sl : ""},tmp2,{ tp : "Spacer", id : "font-spacer", ht : 20, ln : true},tmp3,tmp4,{ tp : "TInput", id : "font-file", tx : "", vr : ""},tmp5,{ tp : "TInput", id : "font-name", tx : "", vr : ""},{ tp : "Button", id : "font-upload", tx : tmp6, ac : $bind(this,this.onFontUpload)}]));
		this.ui.inputs.h["font-file"].set_enabled(false);
		if(com_tilbuci_data_Global.host == "") {
			var tmp = com_tilbuci_data_Global.ln.get("window-setup-update-title");
			var tmp1 = this.ui;
			var tmp2 = { tp : "Label", id : "update-about", tx : com_tilbuci_data_Global.ln.get("window-setup-update-about"), vr : ""};
			var tmp3 = { tp : "Button", id : "update-check", tx : com_tilbuci_data_Global.ln.get("window-setup-update-check"), ac : $bind(this,this.onRelase)};
			var tmp4 = com_tilbuci_data_Global.ln.get("window-setup-update-upload");
			this.addForm(tmp,tmp1.forge("form-update",[tmp2,{ tp : "Spacer", id : "update-about", ht : 20, ln : false},tmp3,{ tp : "Spacer", id : "update-check", ht : 20, ln : false},{ tp : "Button", id : "update-upload", tx : tmp4, ac : $bind(this,this.onSelectUpdate)}]));
			this.ui.labels.h["update-about"].set_wordWrap(true);
		}
	}
	var langs = [];
	var h = build.get_languages().h;
	var n_h = h;
	var n_keys = Object.keys(h);
	var n_length = n_keys.length;
	var n_current = 0;
	while(n_current < n_length) {
		var n = n_h[n_keys[n_current++]];
		langs.push(n);
	}
	var buci = new openfl_display_Bitmap(openfl_utils_Assets.getBitmapData("buci"));
	buci.smoothing = true;
	buci.set_width(800);
	buci.set_scaleY(buci.get_scaleX());
	var tmp = com_tilbuci_data_Global.ln.get("window-setup-about");
	var tmp1 = this.ui;
	var tmp2 = { tp : "Label", id : "about-title", tx : com_tilbuci_data_Global.ln.get("window-setup-about-title"), vr : feathers_controls_Label.VARIANT_HEADING};
	var tmp3 = { tp : "Label", id : "about-lucas", tx : StringTools.replace(com_tilbuci_data_Global.ln.get("window-setup-created"),"[NAME]","Lucas Junqueira <lucas@var.art.br>"), vr : ""};
	var tmp4 = { tp : "Label", id : "about-version", tx : com_tilbuci_data_Global.ln.get("window-setup-about-version"), vr : feathers_controls_Label.VARIANT_DETAIL};
	var tmp5 = { tp : "Label", id : "about-versionnum", tx : build.get_version(), vr : ""};
	var tmp6 = { tp : "Label", id : "about-build", tx : com_tilbuci_data_Global.ln.get("window-setup-about-build"), vr : feathers_controls_Label.VARIANT_DETAIL};
	var tmp7 = { tp : "Label", id : "about-buildnum", tx : build.get_build(), vr : ""};
	var tmp8 = { tp : "Label", id : "about-languages", tx : com_tilbuci_data_Global.ln.get("window-setup-about-languages"), vr : feathers_controls_Label.VARIANT_DETAIL};
	var tmp9 = { tp : "Label", id : "about-langlist", tx : langs.join(", "), vr : ""};
	var tmp10 = { tp : "Label", id : "about-thanks", tx : com_tilbuci_data_Global.ln.get("window-setup-about-thanks"), vr : feathers_controls_Label.VARIANT_DETAIL};
	var tmp11 = { tp : "Label", id : "about-thankslist", tx : build.get_thanks().join(", "), vr : ""};
	var tmp12 = com_tilbuci_data_Global.ln.get("window-setup-tilbuci");
	this.addForm(tmp,tmp1.forge("form-about",[tmp2,tmp3,tmp4,tmp5,tmp6,tmp7,tmp8,tmp9,tmp10,tmp11,{ tp : "Spacer", id : "about-tilbuci", ht : 30, ln : true},{ tp : "Label", id : "about-tilbuci", tx : tmp12, vr : ""},{ tp : "Custom", cont : buci}]));
	this.ui.labels.h["about-lucas"].set_wordWrap(true);
	var license = new openfl_text_TextField();
	license.set_wordWrap(true);
	license.condenseWhite = true;
	license.set_width(860);
	license.set_autoSize(1);
	license.set_htmlText(openfl_utils_Assets.getText("license"));
	this.addForm(com_tilbuci_data_Global.ln.get("window-setup-license"),this.ui.forge("license",[{ tp : "Custom", cont : license},{ tp : "Spacer", id : "license", ht : 10, ln : false}]));
	this.redraw();
};
$hxClasses["com.tilbuci.ui.window.WindowSetup"] = com_tilbuci_ui_window_WindowSetup;
com_tilbuci_ui_window_WindowSetup.__name__ = "com.tilbuci.ui.window.WindowSetup";
com_tilbuci_ui_window_WindowSetup.__super__ = com_tilbuci_ui_window_PopupWindow;
com_tilbuci_ui_window_WindowSetup.prototype = $extend(com_tilbuci_ui_window_PopupWindow.prototype,{
	acStart: function() {
		if(com_tilbuci_data_Global.userLevel == 0) {
			if(com_tilbuci_data_Global.host == "") {
				com_tilbuci_data_Global.ws.send("Email/GetConfig",new haxe_ds_StringMap(),$bind(this,this.onEmailSettings));
			}
			com_tilbuci_data_Global.ws.send("Movie/SetList",new haxe_ds_StringMap(),$bind(this,this.onMovieList));
		}
		if(!com_tilbuci_data_Global.singleUser && com_tilbuci_data_Global.ws.get_level() <= 50) {
			if(com_tilbuci_data_Global.host == "") {
				com_tilbuci_data_Global.ws.send("User/List",new haxe_ds_StringMap(),$bind(this,this.onUserList));
			}
		}
	}
	,kill: function() {
		com_tilbuci_ui_window_PopupWindow.prototype.kill.call(this);
	}
	,onFontDelete: function(evt) {
		if(this.ui.lists.h["font-list"].get_selectedIndex() < 0) {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-setup-font-title"),com_tilbuci_data_Global.ln.get("window-setup-font-noneslected"),300,180,this.stage);
		} else {
			this.ui.createConfirm(com_tilbuci_data_Global.ln.get("window-setup-font-title"),com_tilbuci_data_Global.ln.get("window-setup-font-removecheck"),400,210,$bind(this,this.removeFont),com_tilbuci_data_Global.ln.get("default-ok"),com_tilbuci_data_Global.ln.get("default-cancel"),this.stage);
		}
	}
	,removeFont: function(ok) {
		if(ok) {
			var tmp = com_tilbuci_data_Global.ws;
			var _g = new haxe_ds_StringMap();
			var value = this.ui.lists.h["font-list"].get_selectedItem().value;
			_g.h["name"] = value;
			tmp.send("File/RemoveFont",_g,$bind(this,this.onFontRemoved));
		}
	}
	,onFontRemoved: function(ok,ld) {
		if(ok) {
			HxOverrides.remove(com_tilbuci_data_Global.fonts,ld.map.h["name"]);
			var fnts = [];
			var _g = 0;
			var _g1 = com_tilbuci_data_Global.fonts.length;
			while(_g < _g1) {
				var n = _g++;
				fnts.push({ text : com_tilbuci_data_Global.fonts[n], value : com_tilbuci_data_Global.fonts[n]});
			}
			this.ui.setListValues("font-list",fnts);
		}
	}
	,onSelectUpdate: function(evt) {
		com_tilbuci_data_Global.up.browseForMedia($bind(this,this.onUpdateFile),"update");
	}
	,onFontAdd: function(evt) {
		com_tilbuci_data_Global.up.browseForFont($bind(this,this.onFontSelected));
	}
	,onFontSelected: function(ok) {
		if(ok) {
			this.ui.inputs.h["font-file"].set_text(com_tilbuci_data_Global.up.get_selectedName());
			if(this.ui.inputs.h["font-name"].get_text() == "") {
				var fname = StringTools.replace(com_tilbuci_data_Global.up.get_selectedName(),".woff2","");
				fname = StringTools.replace(fname,".woff","");
				fname = StringTools.replace(fname,"-"," ");
				fname = StringTools.replace(fname,"_"," ");
				this.ui.inputs.h["font-name"].set_text(fname);
			}
		} else {
			this.ui.inputs.h["font-file"].set_text(this.ui.inputs.h["font-name"].set_text(""));
		}
	}
	,onUpdateFile: function(ok) {
		if(ok) {
			if(HxOverrides.substr(com_tilbuci_data_Global.up.get_selectedName(),0,7) != "TilBuci" || HxOverrides.substr(com_tilbuci_data_Global.up.get_selectedName(),-3,null) != "zip") {
				this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-setup-update-title"),com_tilbuci_data_Global.ln.get("window-setup-update-invalid"),300,150,this.stage);
			} else {
				var tmp = com_tilbuci_data_Global.up;
				var _g = new haxe_ds_StringMap();
				_g.h["type"] = "update";
				_g.h["path"] = "";
				_g.h["movie"] = "";
				tmp.uploadMedia($bind(this,this.onUpdateReturn),_g);
			}
		}
	}
	,onUpdateReturn: function(ok,data) {
		if(ok) {
			com_tilbuci_data_Global.ws.send("System/Update",new haxe_ds_StringMap(),$bind(this,this.onZipReturn));
		} else {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-setup-update-title"),com_tilbuci_data_Global.ln.get("window-setup-update-uploader"),300,180,this.stage);
		}
	}
	,onZipReturn: function(ok,ld) {
		if(!ok) {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-setup-update-title"),com_tilbuci_data_Global.ln.get("window-setup-update-uploader"),300,180,this.stage);
		} else if(ld.map.h["e"] == 0) {
			var req = new openfl_net_URLRequest(com_tilbuci_data_Global.econfig.get_player() + "setup.php");
			req.method = "GET";
			openfl_Lib.getURL(req);
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-setup-update-title"),com_tilbuci_data_Global.ln.get("window-setup-update-uploadok"),300,180,this.stage);
		} else {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-setup-update-title"),com_tilbuci_data_Global.ln.get("window-setup-update-uploader"),300,180,this.stage);
		}
	}
	,onFontUpload: function(evt) {
		if(this.ui.inputs.h["font-file"].get_text() == "" || this.ui.inputs.h["font-name"].get_text() == "") {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-setup-font-title"),com_tilbuci_data_Global.ln.get("window-setup-font-nofilename"),300,180,this.stage);
		} else {
			var tmp = com_tilbuci_data_Global.up;
			var _g = new haxe_ds_StringMap();
			var value = this.ui.inputs.h["font-name"].get_text();
			_g.h["name"] = value;
			if(!tmp.uploadFont($bind(this,this.fontReturn),_g)) {
				this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-setup-font-title"),com_tilbuci_data_Global.ln.get("window-setup-font-nofont"),300,180,this.stage);
			}
		}
	}
	,fontReturn: function(ok,data) {
		if(!ok) {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-setup-font-title"),com_tilbuci_data_Global.ln.get("window-setup-font-uploader"),300,180,this.stage);
		} else if(data.h["e"] != 0) {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-setup-font-title"),com_tilbuci_data_Global.ln.get("window-setup-font-uploader"),300,180,this.stage);
		} else {
			new com_tilbuci_font_EmbedFont(com_tilbuci_data_Global.econfig.get_font() + Std.string(data.h["fname"]),data.h["name"],$bind(this,this.fontLoaded));
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-setup-font-title"),com_tilbuci_data_Global.ln.get("window-setup-font-uploadok"),300,200,this.stage);
		}
	}
	,fontLoaded: function(ok,ft) {
		if(ok) {
			var fnts = [];
			var _g = 0;
			var _g1 = com_tilbuci_data_Global.fonts.length;
			while(_g < _g1) {
				var n = _g++;
				fnts.push({ text : com_tilbuci_data_Global.fonts[n], value : com_tilbuci_data_Global.fonts[n]});
			}
			this.ui.setListValues("font-list",fnts);
		}
	}
	,onEmailSettings: function(ok,ld) {
		if(ok) {
			if(ld.map.h["e"] == 0) {
				this.ui.inputs.h["email-server"].set_text(ld.map.h["server"]);
				this.ui.inputs.h["email-sender"].set_text(ld.map.h["sender"]);
				this.ui.inputs.h["email-email"].set_text(ld.map.h["email"]);
				this.ui.inputs.h["email-user"].set_text(ld.map.h["user"]);
				this.ui.inputs.h["email-password"].set_text(ld.map.h["password"]);
				this.ui.inputs.h["email-port"].set_text(ld.map.h["port"]);
				this.ui.setSelectValue("email-security",ld.map.h["security"]);
				if(ld.map.h["attempt"]) {
					this.addEmailCodeConfirm();
				} else if(ld.map.h["valid"]) {
					com_tilbuci_data_Global.validEmail = true;
					this.addEmailCodeValid();
				}
			}
		}
	}
	,onPassChange: function(evt) {
		if(this.ui.inputs.h["user-pass"].get_text().length < 8) {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-setup-user-title"),com_tilbuci_data_Global.ln.get("window-setup-user-passminimum"),300,180,this.stage);
		} else {
			var tmp = com_tilbuci_data_Global.ws;
			var _g = new haxe_ds_StringMap();
			var value = com_tilbuci_data_Global.ws.get_user();
			_g.h["user"] = value;
			var value = this.ui.inputs.h["user-pass"].get_text();
			_g.h["pass"] = value;
			tmp.send("User/SetPassword",_g,$bind(this,this.onPasswordSet));
		}
	}
	,onPasswordSet: function(ok,ld) {
		if(!ok) {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-setup-user-title"),com_tilbuci_data_Global.ln.get("window-setup-user-passerror"),300,180,this.stage);
		} else if(ld.map.h["e"] != 0) {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-setup-user-title"),com_tilbuci_data_Global.ln.get("window-setup-user-passerror"),300,180,this.stage);
		} else {
			this.ui.inputs.h["user-pass"].set_text("");
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-setup-user-title"),com_tilbuci_data_Global.ln.get("window-setup-user-passok"),300,180,this.stage);
		}
	}
	,onLogout: function(evt) {
		com_tilbuci_data_Global.ws.logout();
		feathers_core_PopUpManager.removePopUp(this);
		com_tilbuci_data_Global.showWindow("login");
	}
	,onEmailSave: function(evt) {
		if(this.ui.inputs.h["email-sender"].get_text() == "" || this.ui.inputs.h["email-email"].get_text() == "" || this.ui.inputs.h["email-server"].get_text() == "" || this.ui.inputs.h["email-user"].get_text() == "" || this.ui.inputs.h["email-password"].get_text() == "" || this.ui.inputs.h["email-port"].get_text() == "") {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-setup-email-title"),com_tilbuci_data_Global.ln.get("window-setup-email-savenofields"),300,180,this.stage);
		} else if(!com_tilbuci_statictools_StringStatic.validateEmail(this.ui.inputs.h["email-email"].get_text())) {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-setup-email-title"),com_tilbuci_data_Global.ln.get("window-setup-email-savenoemail"),300,180,this.stage);
		} else {
			this.ui.createConfirm(com_tilbuci_data_Global.ln.get("window-setup-email-title"),com_tilbuci_data_Global.ln.get("window-setup-email-saveabout"),420,280,$bind(this,this.onEmailSaveConfirm),com_tilbuci_data_Global.ln.get("default-ok"),com_tilbuci_data_Global.ln.get("default-cancel"),this.stage);
		}
	}
	,onEmailSaveConfirm: function(ok) {
		if(ok) {
			this.ui.disableButton("email-save",com_tilbuci_data_Global.ln.get("default-wait"));
			var tmp = com_tilbuci_data_Global.ws;
			var _g = new haxe_ds_StringMap();
			var value = this.ui.inputs.h["email-sender"].get_text();
			_g.h["sender"] = value;
			var value = this.ui.inputs.h["email-email"].get_text();
			_g.h["email"] = value;
			var value = this.ui.inputs.h["email-server"].get_text();
			_g.h["server"] = value;
			var value = this.ui.inputs.h["email-user"].get_text();
			_g.h["user"] = value;
			var value = this.ui.inputs.h["email-password"].get_text();
			_g.h["password"] = value;
			var value = this.ui.inputs.h["email-port"].get_text();
			_g.h["port"] = value;
			var value = this.ui.selects.h["email-security"].get_selectedItem().value;
			_g.h["security"] = value;
			var value = com_tilbuci_data_Global.ln.get_current();
			_g.h["lang"] = value;
			tmp.send("Email/Save",_g,$bind(this,this.onEmailSaveReturn));
		}
	}
	,onEmailSaveReturn: function(ok,ld) {
		if(ok) {
			if(ld.map.h["e"] == 0) {
				this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-setup-email-title"),com_tilbuci_data_Global.ln.get("window-setup-email-saveok"),400,190,this.stage);
				this.addEmailCodeConfirm();
			} else {
				this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-setup-email-title"),com_tilbuci_data_Global.ln.get("window-setup-email-saveerror"),400,190,this.stage);
			}
		} else {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-setup-email-title"),com_tilbuci_data_Global.ln.get("window-setup-email-saveerror"),400,190,this.stage);
		}
		this.ui.enableButton("email-save",com_tilbuci_data_Global.ln.get("window-setup-email-save"));
	}
	,addEmailCodeConfirm: function() {
		this.ui.containers.h["form-email"].replaceChildren([this.ui.labels.h["email-codeabout"],this.ui.inputs.h["email-code"],this.ui.buttons.h["email-codebutton"],this.ui.spacers.h["email-codespace"],this.ui.labels.h["email-sender"],this.ui.inputs.h["email-sender"],this.ui.labels.h["email-email"],this.ui.inputs.h["email-email"],this.ui.labels.h["email-server"],this.ui.inputs.h["email-server"],this.ui.labels.h["email-user"],this.ui.inputs.h["email-user"],this.ui.labels.h["email-password"],this.ui.inputs.h["email-password"],this.ui.labels.h["email-port"],this.ui.inputs.h["email-port"],this.ui.labels.h["email-security"],this.ui.selects.h["email-security"],this.ui.spacers.h["email-button"],this.ui.buttons.h["email-save"]]);
		this.redraw();
	}
	,addEmailCodeValid: function() {
		this.ui.containers.h["form-email"].replaceChildren([this.ui.labels.h["email-codevalid"],this.ui.spacers.h["email-codespace"],this.ui.labels.h["email-sender"],this.ui.inputs.h["email-sender"],this.ui.labels.h["email-email"],this.ui.inputs.h["email-email"],this.ui.labels.h["email-server"],this.ui.inputs.h["email-server"],this.ui.labels.h["email-user"],this.ui.inputs.h["email-user"],this.ui.labels.h["email-password"],this.ui.inputs.h["email-password"],this.ui.labels.h["email-port"],this.ui.inputs.h["email-port"],this.ui.labels.h["email-security"],this.ui.selects.h["email-security"],this.ui.spacers.h["email-button"],this.ui.buttons.h["email-save"]]);
		this.redraw();
	}
	,checkEmailCode: function(evt) {
		if(this.ui.inputs.h["email-code"].get_text().length != 6) {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-setup-email-title"),com_tilbuci_data_Global.ln.get("window-setup-email-codeno6"),400,150,this.stage);
		} else {
			this.ui.buttons.h["email-codebutton"].set_text(com_tilbuci_data_Global.ln.get("default-wait"));
			var tmp = com_tilbuci_data_Global.ws;
			var _g = new haxe_ds_StringMap();
			var value = this.ui.inputs.h["email-code"].get_text();
			_g.h["code"] = value;
			tmp.send("Email/CheckCode",_g,$bind(this,this.onEmailCodeCheck));
		}
	}
	,onEmailCodeCheck: function(ok,ld) {
		if(!ok) {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-setup-email-title"),com_tilbuci_data_Global.ln.get("default-serverconerror"),400,180,this.stage);
		} else if(ld.map.h["e"] == 1) {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-setup-email-title"),com_tilbuci_data_Global.ln.get("window-setup-email-codenoset"),400,150,this.stage);
		} else if(ld.map.h["e"] == 2) {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-setup-email-title"),com_tilbuci_data_Global.ln.get("window-setup-email-codecorrupt"),400,190,this.stage);
		} else if(ld.map.h["e"] == 3) {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-setup-email-title"),com_tilbuci_data_Global.ln.get("window-setup-email-codewrong"),400,190,this.stage);
		} else {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-setup-email-title"),com_tilbuci_data_Global.ln.get("window-setup-email-codeok"),400,150,this.stage);
			this.ui.containers.h["form-email"].replaceChildren([this.ui.labels.h["email-codevalid"],this.ui.spacers.h["email-codespace"],this.ui.labels.h["email-sender"],this.ui.inputs.h["email-sender"],this.ui.labels.h["email-email"],this.ui.inputs.h["email-email"],this.ui.labels.h["email-server"],this.ui.inputs.h["email-server"],this.ui.labels.h["email-user"],this.ui.inputs.h["email-user"],this.ui.labels.h["email-password"],this.ui.inputs.h["email-password"],this.ui.labels.h["email-port"],this.ui.inputs.h["email-port"],this.ui.labels.h["email-security"],this.ui.selects.h["email-security"],this.ui.spacers.h["email-button"],this.ui.buttons.h["email-save"]]);
			this.redraw();
			com_tilbuci_data_Global.validEmail = true;
		}
		this.ui.buttons.h["email-codebutton"].set_text(com_tilbuci_data_Global.ln.get("window-setup-email-codecheck"));
	}
	,onUserList: function(ok,ld) {
		var list = [];
		if(ok) {
			if(ld.map.h["e"] == 0) {
				var userlist = ld.map.h["list"];
				var _g = 0;
				var _g1 = userlist.length;
				while(_g < _g1) {
					var i = _g++;
					var lvl = "";
					if(userlist[i].level == 0) {
						lvl = com_tilbuci_data_Global.ln.get("window-setup-users-listadmin");
					} else if(userlist[i].level <= 50) {
						lvl = com_tilbuci_data_Global.ln.get("window-setup-users-listaeditor");
					} else {
						lvl = com_tilbuci_data_Global.ln.get("window-setup-users-listauthor");
					}
					list.push({ text : userlist[i].user, value : userlist[i].user, user : lvl});
				}
			}
		}
		this.ui.setListValues("users-list",list);
	}
	,onCreateUser: function(evt) {
		if(this.ui.inputs.h["users-newemail"].get_text() == "" || this.ui.inputs.h["users-newpass"].get_text().length < 8) {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-setup-users-new"),com_tilbuci_data_Global.ln.get("window-setup-users-newno"),400,250,this.stage);
		} else if(!com_tilbuci_statictools_StringStatic.validateEmail(this.ui.inputs.h["users-newemail"].get_text())) {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-setup-users-new"),com_tilbuci_data_Global.ln.get("window-setup-users-newno"),400,250,this.stage);
		} else {
			var tmp = com_tilbuci_data_Global.ws;
			var _g = new haxe_ds_StringMap();
			var value = this.ui.inputs.h["users-newemail"].get_text();
			_g.h["email"] = value;
			var value = this.ui.inputs.h["users-newpass"].get_text();
			_g.h["pass"] = value;
			var value = this.ui.selects.h["users-newlevel"].get_selectedItem().value;
			_g.h["level"] = value;
			tmp.send("User/Create",_g,$bind(this,this.onCreateReturn));
		}
	}
	,onCreateReturn: function(ok,ld) {
		if(!ok) {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-setup-users-new"),com_tilbuci_data_Global.ln.get("window-setup-users-newerror"),400,150,this.stage);
		} else if(ld.map.h["e"] == 1) {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-setup-users-new"),com_tilbuci_data_Global.ln.get("window-setup-users-newalready"),400,200,this.stage);
		} else if(ld.map.h["e"] == 0) {
			this.ui.setListValues("users-list",[]);
			this.ui.inputs.h["users-newemail"].set_text("");
			this.ui.inputs.h["users-newpass"].set_text("");
			com_tilbuci_data_Global.ws.send("User/List",new haxe_ds_StringMap(),$bind(this,this.onUserList));
			com_tilbuci_data_Global.showMsg(com_tilbuci_data_Global.ln.get("window-setup-users-newok"));
		} else {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-setup-users-new"),com_tilbuci_data_Global.ln.get("window-setup-users-newerror"),400,150,this.stage);
		}
	}
	,onRemoveUser: function(evt) {
		if(this.ui.lists.h["users-list"].get_selectedItem() != null) {
			this.ui.createConfirm(com_tilbuci_data_Global.ln.get("window-setup-users-title"),com_tilbuci_data_Global.ln.get("window-setup-users-btremsure"),400,230,$bind(this,this.onRemoveConfirm),com_tilbuci_data_Global.ln.get("default-ok"),com_tilbuci_data_Global.ln.get("default-cancel"),this.stage);
		}
	}
	,onRemoveConfirm: function(ok) {
		if(ok && this.ui.lists.h["users-list"].get_selectedItem() != null) {
			var tmp = com_tilbuci_data_Global.ws;
			var _g = new haxe_ds_StringMap();
			var value = this.ui.lists.h["users-list"].get_selectedItem().value;
			_g.h["email"] = value;
			tmp.send("User/Remove",_g,$bind(this,this.onUserRemoved));
		}
	}
	,onUserRemoved: function(ok,ld) {
		if(!ok) {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-setup-users-title"),com_tilbuci_data_Global.ln.get("window-setup-users-btremer"),400,150,this.stage);
		} else if(ld.map.h["e"] != 0) {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-setup-users-title"),com_tilbuci_data_Global.ln.get("window-setup-users-btremer"),400,150,this.stage);
		} else {
			com_tilbuci_data_Global.ws.send("User/List",new haxe_ds_StringMap(),$bind(this,this.onUserList));
			com_tilbuci_data_Global.showMsg(com_tilbuci_data_Global.ln.get("window-setup-users-btremok"));
		}
	}
	,onSetUserPass: function(evt) {
		if(this.ui.lists.h["users-list"].get_selectedItem() != null) {
			if(this.ui.inputs.h["users-setpass"].get_text().length < 8) {
				this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-setup-users-title"),com_tilbuci_data_Global.ln.get("window-setup-users-setpassno"),400,150,this.stage);
			} else {
				var tmp = com_tilbuci_data_Global.ws;
				var _g = new haxe_ds_StringMap();
				var value = this.ui.lists.h["users-list"].get_selectedItem().value;
				_g.h["email"] = value;
				var value = this.ui.inputs.h["users-setpass"].get_text();
				_g.h["pass"] = value;
				tmp.send("User/SetUserPassword",_g,$bind(this,this.onSetUserPassReturn));
			}
		}
	}
	,onSetUserPassReturn: function(ok,ld) {
		if(!ok) {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-setup-users-title"),com_tilbuci_data_Global.ln.get("window-setup-users-setpasser"),400,150,this.stage);
		} else if(ld.map.h["e"] != 0) {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-setup-users-title"),com_tilbuci_data_Global.ln.get("window-setup-users-setpasser"),400,150,this.stage);
		} else {
			this.ui.inputs.h["users-setpass"].set_text("");
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-setup-users-title"),com_tilbuci_data_Global.ln.get("window-setup-users-setpassok"),400,150,this.stage);
		}
	}
	,onMovieIndex: function(evt) {
		if(this.ui.selects.h["movie-index"].get_selectedItem() != null) {
			var tmp = com_tilbuci_data_Global.ws;
			var _g = new haxe_ds_StringMap();
			var value = this.ui.selects.h["movie-index"].get_selectedItem().value;
			_g.h["movie"] = value;
			tmp.send("Movie/SetIndex",_g,$bind(this,this.onMovieIndexReturn));
		}
	}
	,onShareSet: function(evt) {
		if(this.ui.selects.h["share"].get_selectedItem() != null) {
			var tmp = com_tilbuci_data_Global.ws;
			var _g = new haxe_ds_StringMap();
			var value = this.ui.selects.h["share"].get_selectedItem().value;
			_g.h["sh"] = value;
			tmp.send("Movie/SetShare",_g,$bind(this,this.onShareReturn));
		}
	}
	,onFpsSet: function(evt) {
		if(this.ui.selects.h["fps"].get_selectedItem() != null) {
			var tmp = com_tilbuci_data_Global.ws;
			var _g = new haxe_ds_StringMap();
			var value = this.ui.selects.h["fps"].get_selectedItem().value;
			_g.h["fps"] = value;
			tmp.send("Movie/SetFPS",_g,$bind(this,this.onFpsReturn));
		}
	}
	,onMovieIndexReturn: function(ok,ld) {
		if(!ok) {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-setup-config-index"),com_tilbuci_data_Global.ln.get("window-setup-config-indexer"),400,180,this.stage);
		} else if(ld.map.h["e"] != 0) {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-setup-config-index"),com_tilbuci_data_Global.ln.get("window-setup-config-indexer"),400,180,this.stage);
		} else {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-setup-config-index"),com_tilbuci_data_Global.ln.get("window-setup-config-indexok"),400,180,this.stage);
		}
	}
	,onRenderReturn: function(ok,ld) {
		if(!ok) {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-setup-config-index"),com_tilbuci_data_Global.ln.get("window-setup-config-rder"),400,180,this.stage);
		} else if(ld.map.h["e"] != 0) {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-setup-config-index"),com_tilbuci_data_Global.ln.get("window-setup-config-rder"),400,180,this.stage);
		} else {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-setup-config-index"),com_tilbuci_data_Global.ln.get("window-setup-config-rdok"),400,180,this.stage);
			com_tilbuci_data_GlobalPlayer.render = this.ui.selects.h["render"].get_selectedItem().value;
		}
	}
	,onShareReturn: function(ok,ld) {
		if(!ok) {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-setup-config-index"),com_tilbuci_data_Global.ln.get("window-setup-config-sher"),400,180,this.stage);
		} else if(ld.map.h["e"] != 0) {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-setup-config-index"),com_tilbuci_data_Global.ln.get("window-setup-config-sher"),400,180,this.stage);
		} else {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-setup-config-index"),com_tilbuci_data_Global.ln.get("window-setup-config-shok"),400,180,this.stage);
			com_tilbuci_data_GlobalPlayer.share = this.ui.selects.h["share"].get_selectedItem().value;
		}
	}
	,onFpsReturn: function(ok,ld) {
		if(!ok) {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-setup-config-index"),com_tilbuci_data_Global.ln.get("window-setup-config-fpser"),400,180,this.stage);
		} else if(ld.map.h["e"] != 0) {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-setup-config-index"),com_tilbuci_data_Global.ln.get("window-setup-config-fpser"),400,180,this.stage);
		} else {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-setup-config-index"),com_tilbuci_data_Global.ln.get("window-setup-config-fpsok"),400,180,this.stage);
			com_tilbuci_data_GlobalPlayer.fps = this.ui.selects.h["fps"].get_selectedItem().value;
		}
	}
	,onMovieList: function(ok,ld) {
		var list = [];
		var current = "";
		if(ok) {
			if(ld.map.h["e"] == 0) {
				var movielist = ld.map.h["list"];
				var _g = 0;
				var _g1 = movielist.length;
				while(_g < _g1) {
					var i = _g++;
					list.push({ text : movielist[i].name, value : movielist[i].id});
				}
				current = ld.map.h["current"];
			}
		}
		this.ui.setSelectOptions("movie-index",list);
		this.ui.setSelectValue("movie-index",current);
	}
	,onRelase: function(evt) {
		var req = new openfl_net_URLRequest("https://tilbuci.com.br/site/latest-version/");
		req.method = "GET";
		openfl_Lib.getURL(req);
	}
	,__class__: com_tilbuci_ui_window_WindowSetup
});
var com_tilbuci_ui_window_WindowTestingActions = function(ac) {
	com_tilbuci_ui_window_PopupWindow.call(this,ac,com_tilbuci_data_Global.ln.get("window-tactions-title"),800,com_tilbuci_ui_base_InterfaceFactory.pickValue(520,530),false,true,true);
};
$hxClasses["com.tilbuci.ui.window.WindowTestingActions"] = com_tilbuci_ui_window_WindowTestingActions;
com_tilbuci_ui_window_WindowTestingActions.__name__ = "com.tilbuci.ui.window.WindowTestingActions";
com_tilbuci_ui_window_WindowTestingActions.__super__ = com_tilbuci_ui_window_PopupWindow;
com_tilbuci_ui_window_WindowTestingActions.prototype = $extend(com_tilbuci_ui_window_PopupWindow.prototype,{
	_actions: null
	,startInterface: function(evt) {
		this._actions = new com_tilbuci_ui_component_ActionArea(760,300);
		var tmp = com_tilbuci_data_Global.ln.get("window-tactions-title");
		var tmp1 = this.ui;
		var tmp2 = { tp : "Label", id : "about", tx : com_tilbuci_data_Global.ln.get("window-tactions-about")};
		var tmp3 = { tp : "Custom", cont : this._actions};
		var tmp4 = { tp : "Label", id : "delay", tx : com_tilbuci_data_Global.ln.get("window-tactions-delay"), "vr" : feathers_controls_Label.VARIANT_DETAIL};
		var tmp5 = com_tilbuci_data_Global.ln.get("window-tactions-button");
		this.addForm(tmp,tmp1.forge("window",[tmp2,tmp3,{ tp : "Spacer", id : "action", ht : 10, ln : false},tmp4,{ tp : "Numeric", id : "delay", vl : 0, mn : 0, mx : 10000, st : 250},{ tp : "Spacer", id : "delay", ht : 10, ln : false},{ tp : "Button", id : "okbutton", tx : tmp5, ac : $bind(this,this.onSet)}]));
		this.ui.labels.h["about"].set_wordWrap(true);
		com_tilbuci_ui_window_PopupWindow.prototype.startInterface.call(this);
	}
	,acStart: function() {
		this._actions.setText(com_tilbuci_data_Global.testActions);
		this.ui.numerics.h["delay"].set_value(com_tilbuci_data_Global.testDelay);
	}
	,onSet: function(evt) {
		com_tilbuci_data_Global.testActions = this._actions.getText();
		com_tilbuci_data_Global.testDelay = Math.round(this.ui.numerics.h["delay"].get_value());
		feathers_core_PopUpManager.removePopUp(this);
	}
	,__class__: com_tilbuci_ui_window_WindowTestingActions
});
var com_tilbuci_ui_window_WindowVisitors = function(ac,build) {
	com_tilbuci_ui_window_PopupWindow.call(this,ac,com_tilbuci_data_Global.ln.get("window-visitors-title"),1000,com_tilbuci_ui_base_InterfaceFactory.pickValue(580,660),true,true,true);
	this.ui.createHContainer("listfilter");
	this.ui.createTInput("listfilter","","",this.ui.hcontainers.h["listfilter"],false);
	this.ui.createButton("listfilter",com_tilbuci_data_Global.ln.get("window-visitors-list-btfilter"),$bind(this,this.onListVisitor),this.ui.hcontainers.h["listfilter"],false);
	var tmp = com_tilbuci_data_Global.ln.get("window-visitors-list-title");
	var tmp1 = this.ui;
	var tmp2 = this.ui;
	var tmp3 = { tp : "Label", id : "list", tx : com_tilbuci_data_Global.ln.get("window-visitors-list"), vr : ""};
	var tmp4 = com_tilbuci_data_Global.ln.get("window-visitors-list-button");
	var tmp5 = tmp2.forge("visitors-left",[tmp3,{ tp : "List", id : "list", vl : [], sl : "", ht : 353},{ tp : "Button", id : "list", tx : tmp4, ac : $bind(this,this.onSelectVisitor)},{ tp : "Spacer", id : "list", ht : 20, ln : true},{ tp : "Custom", cont : this.ui.hcontainers.h["listfilter"]}]);
	var tmp2 = this.ui;
	var tmp3 = { tp : "Label", id : "visitoremail", tx : com_tilbuci_data_Global.ln.get("window-visitors-list-email"), vr : ""};
	var tmp4 = { tp : "Label", id : "visitorcreated", tx : com_tilbuci_data_Global.ln.get("window-visitors-list-created"), vr : ""};
	var tmp6 = { tp : "Label", id : "visitorlast", tx : com_tilbuci_data_Global.ln.get("window-visitors-list-last"), vr : ""};
	var tmp7 = { tp : "Label", id : "visitormovies", tx : com_tilbuci_data_Global.ln.get("window-visitors-list-movies"), vr : ""};
	var tmp8 = { tp : "Label", id : "visitorstates", tx : com_tilbuci_data_Global.ln.get("window-visitors-list-states"), vr : ""};
	var tmp9 = { tp : "Label", id : "visitordata", tx : com_tilbuci_data_Global.ln.get("window-visitors-list-data"), vr : ""};
	var tmp10 = { tp : "Label", id : "visitorgroups", tx : com_tilbuci_data_Global.ln.get("window-visitors-list-groups"), vr : ""};
	var tmp11 = { tp : "Button", id : "rmvisitor", tx : com_tilbuci_data_Global.ln.get("window-visitors-list-rmvisitor"), ac : $bind(this,this.onRemoveVisitor)};
	var tmp12 = com_tilbuci_data_Global.ln.get("window-visitors-list-blvisitor");
	this.addForm(tmp,tmp1.createColumnHolder("visitors",tmp5,tmp2.forge("visitors-right",[tmp3,{ tp : "TInput", id : "visitoremail", tx : "", vr : ""},tmp4,{ tp : "TInput", id : "visitorcreated", tx : "", vr : ""},tmp6,{ tp : "TInput", id : "visitorlast", tx : "", vr : ""},tmp7,{ tp : "TInput", id : "visitormovies", tx : "", vr : ""},tmp8,{ tp : "TInput", id : "visitorstates", tx : "", vr : ""},tmp9,{ tp : "TInput", id : "visitordata", tx : "", vr : ""},tmp10,{ tp : "TInput", id : "visitorgroups", tx : "", vr : ""},{ tp : "Spacer", id : "visitor", ht : 26, ln : true},tmp11,{ tp : "Button", id : "blvisitor", tx : tmp12, ac : $bind(this,this.onBlockVisitor)}])));
	this.ui.hcontainers.h["listfilter"].setWidth(460);
	this.ui.setListToIcon("list");
	this.ui.inputs.h["visitorcreated"].set_enabled(false);
	this.ui.inputs.h["visitorlast"].set_enabled(false);
	this.ui.inputs.h["visitormovies"].set_enabled(false);
	this.ui.inputs.h["visitorstates"].set_enabled(false);
	this.ui.inputs.h["visitordata"].set_enabled(false);
	this.ui.inputs.h["visitordata"].set_enabled(false);
	this.ui.inputs.h["visitorgroups"].set_enabled(false);
	this.ui.createHContainer("creategr");
	this.ui.createTInput("creategr","","",this.ui.hcontainers.h["creategr"],false);
	this.ui.createButton("creategr",com_tilbuci_data_Global.ln.get("window-visitors-creategrbt"),$bind(this,this.onCreateGroup),this.ui.hcontainers.h["creategr"],false);
	this.ui.createHContainer("grvsadd");
	this.ui.createTInput("grvsadd","","",this.ui.hcontainers.h["grvsadd"],false);
	this.ui.createButton("grvsadd",com_tilbuci_data_Global.ln.get("window-visitors-grvsadd"),$bind(this,this.onAddVisitor),this.ui.hcontainers.h["grvsadd"],false);
	var tmp = com_tilbuci_data_Global.ln.get("window-visitors-groups-title");
	var tmp1 = this.ui;
	var tmp2 = this.ui;
	var tmp3 = { tp : "Label", id : "grlist", tx : com_tilbuci_data_Global.ln.get("window-visitors-grlist"), vr : ""};
	var tmp4 = { tp : "Button", id : "showgroup", tx : com_tilbuci_data_Global.ln.get("window-visitors-showgroup"), ac : $bind(this,this.onShowGroup)};
	var tmp5 = com_tilbuci_data_Global.ln.get("window-visitors-removegrbt");
	var tmp6 = tmp2.forge("groups-left",[tmp3,{ tp : "List", id : "grlist", vl : [], sl : "", ht : 323},tmp4,{ tp : "Button", id : "rmgroup", tx : tmp5, ac : $bind(this,this.onRemoveGroup)},{ tp : "Spacer", id : "grlist", ht : 20, ln : true},{ tp : "Custom", cont : this.ui.hcontainers.h["creategr"]}]);
	var tmp2 = this.ui;
	var tmp3 = { tp : "Label", id : "grname", tx : com_tilbuci_data_Global.ln.get("window-visitors-grname"), vr : ""};
	var tmp4 = { tp : "Button", id : "grnamechange", tx : com_tilbuci_data_Global.ln.get("window-visitors-grnamechange"), ac : $bind(this,this.onGroupNameChange)};
	var tmp5 = { tp : "Label", id : "grvisitors", tx : com_tilbuci_data_Global.ln.get("window-visitors-grvisitors"), vr : ""};
	var tmp7 = com_tilbuci_data_Global.ln.get("window-visitors-grvsremove");
	this.addForm(tmp,tmp1.createColumnHolder("groups",tmp6,tmp2.forge("groups-right",[tmp3,{ tp : "TInput", id : "grname", tx : "", vr : ""},tmp4,{ tp : "Spacer", id : "grvisitors", ht : 10, ln : false},tmp5,{ tp : "List", id : "grvisitors", vl : [], sl : "", ht : 280},{ tp : "Button", id : "grvisitors", tx : tmp7, ac : $bind(this,this.onRemoveVisitorGroup)},{ tp : "Custom", cont : this.ui.hcontainers.h["grvsadd"]}])));
	this.ui.hcontainers.h["creategr"].setWidth(460);
	this.ui.hcontainers.h["grvsadd"].setWidth(460);
	this.ui.setListToIcon("grlist");
	var tmp = com_tilbuci_data_Global.ln.get("window-visitors-event-title");
	var tmp1 = this.ui;
	var tmp2 = { tp : "Label", id : "evabout", tx : com_tilbuci_data_Global.ln.get("window-visitors-event-about"), vr : ""};
	var tmp3 = { tp : "Label", id : "evmovie", tx : com_tilbuci_data_Global.ln.get("window-visitors-event-movie"), vr : feathers_controls_Label.VARIANT_DETAIL};
	var tmp4 = { tp : "Label", id : "evname", tx : com_tilbuci_data_Global.ln.get("window-visitors-event-name"), vr : feathers_controls_Label.VARIANT_DETAIL};
	var tmp5 = { tp : "Button", id : "evexport", tx : com_tilbuci_data_Global.ln.get("window-visitors-event-export"), ac : $bind(this,this.onExportEvents)};
	var tmp6 = { tp : "Label", id : "evclear", tx : com_tilbuci_data_Global.ln.get("window-visitors-event-clear"), vr : ""};
	var tmp7 = { tp : "Label", id : "clearmovie", tx : com_tilbuci_data_Global.ln.get("window-visitors-event-movie"), vr : feathers_controls_Label.VARIANT_DETAIL};
	var tmp8 = { tp : "Label", id : "clearname", tx : com_tilbuci_data_Global.ln.get("window-visitors-event-clearname"), vr : feathers_controls_Label.VARIANT_DETAIL};
	var tmp9 = { tp : "Label", id : "clearwhen", tx : com_tilbuci_data_Global.ln.get("window-visitors-event-clearwhen"), vr : feathers_controls_Label.VARIANT_DETAIL};
	var tmp10 = { tp : "Select", id : "clearwhen", vl : [{ text : com_tilbuci_data_Global.ln.get("window-visitors-event-clearyear"), value : "-1year"},{ text : com_tilbuci_data_Global.ln.get("window-visitors-event-clear6month"), value : "-6months"},{ text : com_tilbuci_data_Global.ln.get("window-visitors-event-clear3month"), value : "-3months"},{ text : com_tilbuci_data_Global.ln.get("window-visitors-event-clear1month"), value : "-1month"},{ text : com_tilbuci_data_Global.ln.get("window-visitors-event-clearall"), value : "now"}], sl : "-1year"};
	var tmp11 = com_tilbuci_data_Global.ln.get("window-visitors-event-clearbutton");
	this.addForm(tmp,tmp1.forge("event",[tmp2,tmp3,{ tp : "Select", id : "evmovie", vl : [], sl : null},tmp4,{ tp : "TInput", id : "evname", tx : "", vr : ""},tmp5,{ tp : "Spacer", id : "evexport", ht : 90, ln : true},tmp6,tmp7,{ tp : "Select", id : "clearmovie", vl : [], sl : null},tmp8,{ tp : "TInput", id : "clearname", tx : "", vr : ""},tmp9,tmp10,{ tp : "Button", id : "evclear", tx : tmp11, ac : $bind(this,this.onRemoveEvents)}]));
	this.ui.labels.h["evclear"].set_wordWrap(true);
	var tmp = com_tilbuci_data_Global.ln.get("window-visitors-cors-title");
	var tmp1 = this.ui;
	var tmp2 = { tp : "Label", id : "corsabout", tx : com_tilbuci_data_Global.ln.get("window-visitors-cors-about"), vr : ""};
	var tmp3 = { tp : "Label", id : "corsallowed", tx : com_tilbuci_data_Global.ln.get("window-visitors-cors-allowed"), vr : feathers_controls_Label.VARIANT_DETAIL};
	var tmp4 = { tp : "Button", id : "corsrm", tx : com_tilbuci_data_Global.ln.get("window-visitors-cors-btremove"), ac : $bind(this,this.onRemoveCors)};
	var tmp5 = { tp : "Label", id : "corsadd", tx : com_tilbuci_data_Global.ln.get("window-visitors-cors-add"), vr : feathers_controls_Label.VARIANT_DETAIL};
	var tmp6 = com_tilbuci_data_Global.ln.get("window-visitors-cors-btadd");
	this.addForm(tmp,tmp1.forge("cors",[tmp2,tmp3,{ tp : "List", id : "corsallowed", vl : [], sl : "", ht : 240},tmp4,{ tp : "Spacer", id : "corsrm", ht : 15, ln : false},tmp5,{ tp : "TInput", id : "corsadd", tx : "", vr : ""},{ tp : "Button", id : "corsadd", tx : tmp6, ac : $bind(this,this.onAddCors)}]));
	this.ui.labels.h["corsabout"].set_wordWrap(true);
	this.redraw();
};
$hxClasses["com.tilbuci.ui.window.WindowVisitors"] = com_tilbuci_ui_window_WindowVisitors;
com_tilbuci_ui_window_WindowVisitors.__name__ = "com.tilbuci.ui.window.WindowVisitors";
com_tilbuci_ui_window_WindowVisitors.__super__ = com_tilbuci_ui_window_PopupWindow;
com_tilbuci_ui_window_WindowVisitors.prototype = $extend(com_tilbuci_ui_window_PopupWindow.prototype,{
	_selected: null
	,_group: null
	,acStart: function() {
		if(com_tilbuci_data_Global.userLevel == 0) {
			this.onListVisitor(null);
		} else {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-visitors-title"),com_tilbuci_data_Global.ln.get("window-visitors-noaccess"),300,180,this.stage);
			feathers_core_PopUpManager.removePopUp(this);
		}
	}
	,kill: function() {
		com_tilbuci_ui_window_PopupWindow.prototype.kill.call(this);
	}
	,onListVisitor: function(evt) {
		this._selected = null;
		this._group = null;
		this.ui.inputs.h["listfilter"].set_text("");
		this.ui.inputs.h["visitoremail"].set_text("");
		this.ui.inputs.h["visitorcreated"].set_text("");
		this.ui.inputs.h["visitorlast"].set_text("");
		this.ui.inputs.h["visitormovies"].set_text("");
		this.ui.inputs.h["visitorstates"].set_text("");
		this.ui.inputs.h["visitordata"].set_text("");
		this.ui.inputs.h["visitorgroups"].set_text("");
		this.ui.inputs.h["grname"].set_text("");
		this.ui.inputs.h["creategr"].set_text("");
		this.ui.inputs.h["grvsadd"].set_text("");
		this.ui.inputs.h["evname"].set_text("");
		this.ui.inputs.h["clearname"].set_text("");
		this.ui.setListSelectValue("list",null);
		this.ui.setListValues("list",[]);
		this.ui.setListSelectValue("grlist",null);
		this.ui.setListValues("grlist",[]);
		this.ui.setListSelectValue("grvisitors",null);
		this.ui.setListValues("grvisitors",[]);
		this.ui.setSelectValue("evmovie",null);
		this.ui.setSelectOptions("evmovie",[]);
		this.ui.setSelectValue("clearmovie",null);
		this.ui.setSelectOptions("clearmovie",[]);
		this.ui.setSelectValue("clearwhen","-1year");
		this.ui.setListSelectValue("corsallowed",null);
		this.ui.setListValues("corsallowed",[]);
		haxe_Log.trace("call listvisitor",{ fileName : "Source/com/tilbuci/ui/window/WindowVisitors.hx", lineNumber : 223, className : "com.tilbuci.ui.window.WindowVisitors", methodName : "onListVisitor"});
		var tmp = com_tilbuci_data_Global.ws;
		var _g = new haxe_ds_StringMap();
		var value = this.ui.inputs.h["listfilter"].get_text();
		_g.h["filter"] = value;
		tmp.send("Visitor/List",_g,$bind(this,this.onListVisitorReturn));
	}
	,onListVisitorReturn: function(ok,ld) {
		if(ok) {
			if(ld.map.h["e"] == 0) {
				var list;
				var vislist = ld.map.h["list"];
				if(vislist.length == 0) {
					com_tilbuci_data_Global.showMsg(com_tilbuci_data_Global.ln.get("window-visitors-listempty"));
				} else {
					list = [];
					var _g = 0;
					while(_g < vislist.length) {
						var vs = vislist[_g];
						++_g;
						if(vs.blocked) {
							list.push({ text : vs.email, value : vs.email, user : com_tilbuci_data_Global.ln.get("window-visitors-lastaccess") + " " + vs.last, asset : "iconLock"});
						} else {
							list.push({ text : vs.email, value : vs.email, user : com_tilbuci_data_Global.ln.get("window-visitors-lastaccess") + " " + vs.last});
						}
					}
					this.ui.setListValues("list",list);
				}
				var groups = ld.map.h["groups"];
				list = [];
				if(groups != null) {
					var _g = 0;
					while(_g < groups.length) {
						var gr = groups[_g];
						++_g;
						list.push({ text : gr.name, value : gr.id, user : gr.visitors + " " + com_tilbuci_data_Global.ln.get("window-visitors-grvisitors")});
					}
				}
				this.ui.setListValues("grlist",list);
				list = [{ text : com_tilbuci_data_Global.ln.get("window-visitors-event-movieall"), value : ""}];
				var _g = 0;
				var _g1 = Reflect.fields(ld.map.h["movies"]);
				while(_g < _g1.length) {
					var mn = _g1[_g];
					++_g;
					var mv = Reflect.field(ld.map.h["movies"],mn);
					list.push({ text : Reflect.field(mv,"title"), value : Reflect.field(mv,"id")});
				}
				this.ui.setSelectOptions("evmovie",list);
				this.ui.setSelectValue("evmovie","");
				this.ui.setSelectOptions("clearmovie",list);
				this.ui.setSelectValue("clearmovie","");
				var cors = ld.map.h["cors"];
				list = [];
				if(cors != null) {
					var _g = 0;
					while(_g < cors.length) {
						var cr = cors[_g];
						++_g;
						list.push({ text : cr, value : cr});
					}
				}
				this.ui.setListValues("corsallowed",list);
			} else {
				this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-visitors-title"),com_tilbuci_data_Global.ln.get("window-visitors-listerror"),300,180,this.stage);
			}
		} else {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-visitors-title"),com_tilbuci_data_Global.ln.get("window-visitors-listerror"),300,180,this.stage);
		}
	}
	,onSelectVisitor: function(evt) {
		if(this.ui.lists.h["list"].get_selectedItem() != null) {
			var tmp = com_tilbuci_data_Global.ws;
			var _g = new haxe_ds_StringMap();
			var value = this.ui.lists.h["list"].get_selectedItem().value;
			_g.h["email"] = value;
			tmp.send("Visitor/Select",_g,$bind(this,this.onVisitorSelected));
		}
	}
	,onVisitorSelected: function(ok,ld) {
		this._selected = null;
		this.ui.inputs.h["visitoremail"].set_text("");
		this.ui.inputs.h["visitorcreated"].set_text("");
		this.ui.inputs.h["visitorlast"].set_text("");
		this.ui.inputs.h["visitormovies"].set_text("");
		this.ui.inputs.h["visitorstates"].set_text("");
		this.ui.inputs.h["visitordata"].set_text("");
		this.ui.inputs.h["visitorgroups"].set_text("");
		if(ok) {
			if(ld.map.h["e"] != 0) {
				this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-visitors-title"),com_tilbuci_data_Global.ln.get("window-visitors-erselect"),300,180,this.stage);
			} else {
				this._selected = ld.map.h["data"];
				if(this._selected == null) {
					this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-visitors-title"),com_tilbuci_data_Global.ln.get("window-visitors-erselect"),300,180,this.stage);
				} else {
					this.ui.inputs.h["visitoremail"].set_text(this._selected.email);
					this.ui.inputs.h["visitorcreated"].set_text(this._selected.created);
					this.ui.inputs.h["visitorlast"].set_text(this._selected.last);
					this.ui.inputs.h["visitormovies"].set_text(Std.string(this._selected.movies));
					this.ui.inputs.h["visitorstates"].set_text(Std.string(this._selected.states));
					this.ui.inputs.h["visitordata"].set_text(Std.string(this._selected.data));
					this.ui.inputs.h["visitorgroups"].set_text(Std.string(this._selected.groups.length));
					if(this._selected.blocked) {
						this.ui.buttons.h["blvisitor"].set_text(com_tilbuci_data_Global.ln.get("window-visitors-list-unblvisitor"));
					} else {
						this.ui.buttons.h["blvisitor"].set_text(com_tilbuci_data_Global.ln.get("window-visitors-list-blvisitor"));
					}
				}
			}
		} else {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-visitors-title"),com_tilbuci_data_Global.ln.get("window-visitors-erselect"),300,180,this.stage);
		}
	}
	,onRemoveVisitor: function(evt) {
		if(this._selected != null) {
			this.ui.createConfirm(com_tilbuci_data_Global.ln.get("window-visitors-title"),com_tilbuci_data_Global.ln.get("window-visitors-list-rmvisitorconf"),320,230,$bind(this,this.onRemoveConfirm),com_tilbuci_data_Global.ln.get("default-ok"),com_tilbuci_data_Global.ln.get("default-cancel"),this.stage);
		}
	}
	,onRemoveConfirm: function(ok) {
		if(this._selected != null && ok) {
			var tmp = com_tilbuci_data_Global.ws;
			var _g = new haxe_ds_StringMap();
			_g.h["email"] = this._selected.email;
			tmp.send("Visitor/Remove",_g,$bind(this,this.onRemoveReturn));
		}
	}
	,onRemoveReturn: function(ok,ld) {
		if(ok) {
			if(ld.map.h["e"] != 0) {
				this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-visitors-title"),com_tilbuci_data_Global.ln.get("window-visitors-erset"),300,180,this.stage);
			} else {
				com_tilbuci_data_Global.showMsg(com_tilbuci_data_Global.ln.get("window-visitors-inforemoved"));
				this._selected = null;
				this.ui.inputs.h["visitoremail"].set_text("");
				this.ui.inputs.h["visitorcreated"].set_text("");
				this.ui.inputs.h["visitorlast"].set_text("");
				this.ui.inputs.h["visitormovies"].set_text("");
				this.ui.inputs.h["visitorstates"].set_text("");
				this.ui.inputs.h["visitordata"].set_text("");
				this.ui.inputs.h["visitorgroups"].set_text("");
				this.ui.inputs.h["creategr"].set_text("");
				this.onListVisitor(null);
			}
		} else {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-visitors-title"),com_tilbuci_data_Global.ln.get("window-visitors-erset"),300,180,this.stage);
		}
	}
	,onBlockVisitor: function(evt) {
		if(this._selected != null) {
			if(this._selected.blocked) {
				this.ui.createConfirm(com_tilbuci_data_Global.ln.get("window-visitors-title"),com_tilbuci_data_Global.ln.get("window-visitors-list-unblvisitorconf"),300,230,$bind(this,this.onBlockConfirm),com_tilbuci_data_Global.ln.get("default-ok"),com_tilbuci_data_Global.ln.get("default-cancel"),this.stage);
			} else {
				this.ui.createConfirm(com_tilbuci_data_Global.ln.get("window-visitors-title"),com_tilbuci_data_Global.ln.get("window-visitors-list-blvisitorconf"),300,230,$bind(this,this.onBlockConfirm),com_tilbuci_data_Global.ln.get("default-ok"),com_tilbuci_data_Global.ln.get("default-cancel"),this.stage);
			}
		}
	}
	,onBlockConfirm: function(ok) {
		if(this._selected != null && ok) {
			var tmp = com_tilbuci_data_Global.ws;
			var _g = new haxe_ds_StringMap();
			_g.h["email"] = this._selected.email;
			tmp.send("Visitor/Block",_g,$bind(this,this.onBlockReturn));
		}
	}
	,onBlockReturn: function(ok,ld) {
		if(ok) {
			if(ld.map.h["e"] != 0) {
				this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-visitors-title"),com_tilbuci_data_Global.ln.get("window-visitors-erset"),300,180,this.stage);
			} else {
				com_tilbuci_data_Global.showMsg(com_tilbuci_data_Global.ln.get("window-visitors-infoset"));
				this._selected = null;
				this.ui.inputs.h["visitoremail"].set_text("");
				this.ui.inputs.h["visitorcreated"].set_text("");
				this.ui.inputs.h["visitorlast"].set_text("");
				this.ui.inputs.h["visitormovies"].set_text("");
				this.ui.inputs.h["visitorstates"].set_text("");
				this.ui.inputs.h["visitordata"].set_text("");
				this.ui.inputs.h["visitorgroups"].set_text("");
				this.onListVisitor(null);
			}
		} else {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-visitors-title"),com_tilbuci_data_Global.ln.get("window-visitors-erset"),300,180,this.stage);
		}
	}
	,onCreateGroup: function(evt) {
		if(this.ui.inputs.h["creategr"].get_text().length >= 5) {
			var tmp = com_tilbuci_data_Global.ws;
			var _g = new haxe_ds_StringMap();
			var value = this.ui.inputs.h["creategr"].get_text();
			_g.h["name"] = value;
			tmp.send("Visitor/CreateGroup",_g,$bind(this,this.onCreateGroupReturn));
		}
	}
	,onRemoveGroup: function(evt) {
		if(this.ui.lists.h["grlist"].get_selectedItem() != null) {
			this.ui.createConfirm(com_tilbuci_data_Global.ln.get("window-visitors-title"),com_tilbuci_data_Global.ln.get("window-visitors-grouprmconfirm"),300,230,$bind(this,this.onRemoveGroupConfirm),com_tilbuci_data_Global.ln.get("default-ok"),com_tilbuci_data_Global.ln.get("default-cancel"),this.stage);
		}
	}
	,onRemoveGroupConfirm: function(ok) {
		if(ok && this.ui.lists.h["grlist"].get_selectedItem() != null) {
			var tmp = com_tilbuci_data_Global.ws;
			var _g = new haxe_ds_StringMap();
			var value = this.ui.lists.h["grlist"].get_selectedItem().text;
			_g.h["name"] = value;
			var value = this.ui.lists.h["grlist"].get_selectedItem().value;
			_g.h["id"] = value;
			tmp.send("Visitor/RemoveGroup",_g,$bind(this,this.onRemoveGroupReturn));
		}
	}
	,onCreateGroupReturn: function(ok,ld) {
		if(ok) {
			if(ld.map.h["e"] != 0) {
				this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-visitors-title"),com_tilbuci_data_Global.ln.get("window-visitors-creatgrer"),360,180,this.stage);
			} else {
				com_tilbuci_data_Global.showMsg(com_tilbuci_data_Global.ln.get("window-visitors-groupcreated"));
				this._selected = null;
				this.ui.inputs.h["visitoremail"].set_text("");
				this.ui.inputs.h["visitorcreated"].set_text("");
				this.ui.inputs.h["visitorlast"].set_text("");
				this.ui.inputs.h["visitormovies"].set_text("");
				this.ui.inputs.h["visitorstates"].set_text("");
				this.ui.inputs.h["visitordata"].set_text("");
				this.ui.inputs.h["visitorgroups"].set_text("");
				this.ui.inputs.h["creategr"].set_text("");
				this.onListVisitor(null);
			}
		} else {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-visitors-title"),com_tilbuci_data_Global.ln.get("window-visitors-creatgrer"),360,180,this.stage);
		}
	}
	,onRemoveGroupReturn: function(ok,ld) {
		if(ok) {
			if(ld.map.h["e"] != 0) {
				this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-visitors-title"),com_tilbuci_data_Global.ln.get("window-visitors-removegrer"),360,180,this.stage);
			} else {
				com_tilbuci_data_Global.showMsg(com_tilbuci_data_Global.ln.get("window-visitors-groupremoved"));
				this._selected = null;
				this.ui.inputs.h["visitoremail"].set_text("");
				this.ui.inputs.h["visitorcreated"].set_text("");
				this.ui.inputs.h["visitorlast"].set_text("");
				this.ui.inputs.h["visitormovies"].set_text("");
				this.ui.inputs.h["visitorstates"].set_text("");
				this.ui.inputs.h["visitordata"].set_text("");
				this.ui.inputs.h["visitorgroups"].set_text("");
				this.ui.inputs.h["creategr"].set_text("");
				this.onListVisitor(null);
			}
		} else {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-visitors-title"),com_tilbuci_data_Global.ln.get("window-visitors-removegrer"),360,180,this.stage);
		}
	}
	,onShowGroup: function(evt) {
		if(this.ui.lists.h["grlist"].get_selectedItem() != null) {
			var tmp = com_tilbuci_data_Global.ws;
			var _g = new haxe_ds_StringMap();
			var value = this.ui.lists.h["grlist"].get_selectedItem().text;
			_g.h["name"] = value;
			var value = this.ui.lists.h["grlist"].get_selectedItem().value;
			_g.h["id"] = value;
			tmp.send("Visitor/ShowGroup",_g,$bind(this,this.onShowGroupReturn));
		}
	}
	,onShowGroupReturn: function(ok,ld) {
		this._group = null;
		this.ui.inputs.h["grname"].set_text("");
		this.ui.inputs.h["creategr"].set_text("");
		this.ui.inputs.h["grvsadd"].set_text("");
		if(ok) {
			if(ld.map.h["e"] != 0) {
				this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-visitors-title"),com_tilbuci_data_Global.ln.get("window-visitors-showgrouper"),360,180,this.stage);
			} else {
				this._group = ld.map.h["group"];
				if(this._group == null) {
					this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-visitors-title"),com_tilbuci_data_Global.ln.get("window-visitors-showgrouper"),360,180,this.stage);
				} else {
					this.ui.inputs.h["grname"].set_text(this._group.name);
					var list = [];
					var _g = 0;
					var _g1 = this._group.visitors;
					while(_g < _g1.length) {
						var vs = _g1[_g];
						++_g;
						list.push({ text : vs, value : vs});
					}
					this.ui.setListValues("grvisitors",list);
				}
			}
		} else {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-visitors-title"),com_tilbuci_data_Global.ln.get("window-visitors-showgrouper"),360,180,this.stage);
		}
	}
	,onGroupNameChange: function(evt) {
		if(this.ui.lists.h["grlist"].get_selectedItem() != null && this.ui.inputs.h["grname"].get_text().length >= 5) {
			var tmp = com_tilbuci_data_Global.ws;
			var _g = new haxe_ds_StringMap();
			var value = this.ui.lists.h["grlist"].get_selectedItem().text;
			_g.h["name"] = value;
			var value = this.ui.lists.h["grlist"].get_selectedItem().value;
			_g.h["id"] = value;
			var value = this.ui.inputs.h["grname"].get_text();
			_g.h["new"] = value;
			tmp.send("Visitor/ChangeGroupName",_g,$bind(this,this.onGroupNameChangeReturn));
		}
	}
	,onGroupNameChangeReturn: function(ok,ld) {
		this._group = null;
		this.ui.inputs.h["grname"].set_text("");
		this.ui.inputs.h["creategr"].set_text("");
		this.ui.inputs.h["grvsadd"].set_text("");
		if(ok) {
			if(ld.map.h["e"] != 0) {
				this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-visitors-title"),com_tilbuci_data_Global.ln.get("window-visitors-namegrouper"),360,180,this.stage);
			} else {
				this.onListVisitor(null);
			}
		} else {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-visitors-title"),com_tilbuci_data_Global.ln.get("window-visitors-namegrouper"),360,180,this.stage);
		}
	}
	,onAddVisitor: function(evt) {
		if(this.ui.lists.h["grlist"].get_selectedItem() != null && com_tilbuci_statictools_StringStatic.validateEmail(this.ui.inputs.h["grvsadd"].get_text())) {
			var tmp = com_tilbuci_data_Global.ws;
			var _g = new haxe_ds_StringMap();
			var value = this.ui.lists.h["grlist"].get_selectedItem().text;
			_g.h["name"] = value;
			var value = this.ui.lists.h["grlist"].get_selectedItem().value;
			_g.h["id"] = value;
			var value = this.ui.inputs.h["grvsadd"].get_text();
			_g.h["visitor"] = value;
			tmp.send("Visitor/AddGroupVisitor",_g,$bind(this,this.onAddVisitorReturn));
		}
	}
	,onAddVisitorReturn: function(ok,ld) {
		this._group = null;
		this.ui.inputs.h["grvsadd"].set_text("");
		if(ok) {
			if(ld.map.h["e"] != 0) {
				this.ui.inputs.h["grname"].set_text("");
				this.ui.inputs.h["creategr"].set_text("");
				this.onListVisitor(null);
				this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-visitors-title"),com_tilbuci_data_Global.ln.get("window-visitors-addvsgrer"),360,180,this.stage);
			} else {
				this._group = ld.map.h["group"];
				if(this._group == null) {
					this.ui.inputs.h["grname"].set_text("");
					this.ui.inputs.h["creategr"].set_text("");
					this.onListVisitor(null);
					this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-visitors-title"),com_tilbuci_data_Global.ln.get("window-visitors-addvsgrer"),360,180,this.stage);
				} else {
					this.ui.inputs.h["grname"].set_text(this._group.name);
					var list = [];
					var _g = 0;
					var _g1 = this._group.visitors;
					while(_g < _g1.length) {
						var vs = _g1[_g];
						++_g;
						list.push({ text : vs, value : vs});
					}
					this.ui.setListValues("grvisitors",list);
				}
			}
		} else {
			this.ui.inputs.h["grname"].set_text("");
			this.ui.inputs.h["creategr"].set_text("");
			this.onListVisitor(null);
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-visitors-title"),com_tilbuci_data_Global.ln.get("window-visitors-addvsgrer"),360,180,this.stage);
		}
	}
	,onRemoveVisitorGroup: function(evt) {
		if(this.ui.lists.h["grlist"].get_selectedItem() != null && this.ui.lists.h["grvisitors"].get_selectedItem() != null) {
			var tmp = com_tilbuci_data_Global.ws;
			var _g = new haxe_ds_StringMap();
			var value = this.ui.lists.h["grlist"].get_selectedItem().text;
			_g.h["name"] = value;
			var value = this.ui.lists.h["grlist"].get_selectedItem().value;
			_g.h["id"] = value;
			var value = this.ui.lists.h["grvisitors"].get_selectedItem().value;
			_g.h["visitor"] = value;
			tmp.send("Visitor/RemoveGroupVisitor",_g,$bind(this,this.onRemoveVisitorGroupReturn));
		}
	}
	,onRemoveVisitorGroupReturn: function(ok,ld) {
		this._group = null;
		if(ok) {
			if(ld.map.h["e"] != 0) {
				this.ui.inputs.h["grname"].set_text("");
				this.ui.inputs.h["creategr"].set_text("");
				this.ui.inputs.h["grvsadd"].set_text("");
				this.onListVisitor(null);
				this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-visitors-title"),com_tilbuci_data_Global.ln.get("window-visitors-rmvsgrer"),360,180,this.stage);
			} else {
				this._group = ld.map.h["group"];
				if(this._group == null) {
					this.ui.inputs.h["grname"].set_text("");
					this.ui.inputs.h["creategr"].set_text("");
					this.ui.inputs.h["grvsadd"].set_text("");
					this.onListVisitor(null);
					this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-visitors-title"),com_tilbuci_data_Global.ln.get("window-visitors-rmvsgrer"),360,180,this.stage);
				} else {
					this.ui.inputs.h["grname"].set_text(this._group.name);
					var list = [];
					var _g = 0;
					var _g1 = this._group.visitors;
					while(_g < _g1.length) {
						var vs = _g1[_g];
						++_g;
						list.push({ text : vs, value : vs});
					}
					this.ui.setListValues("grvisitors",list);
				}
			}
		} else {
			this.ui.inputs.h["grname"].set_text("");
			this.ui.inputs.h["creategr"].set_text("");
			this.ui.inputs.h["grvsadd"].set_text("");
			this.onListVisitor(null);
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-visitors-title"),com_tilbuci_data_Global.ln.get("window-visitors-rmvsgrer"),360,180,this.stage);
		}
	}
	,onExportEvents: function(evt) {
		var tmp = com_tilbuci_data_Global.ws;
		var _g = new haxe_ds_StringMap();
		var value = this.ui.selects.h["evmovie"].get_selectedItem().value;
		_g.h["movie"] = value;
		var value = this.ui.inputs.h["evname"].get_text();
		_g.h["name"] = value;
		tmp.send("Visitor/ExportEvents",_g,$bind(this,this.onExportEventsReturn));
	}
	,onExportEventsReturn: function(ok,ld) {
		if(ok) {
			if(ld.map.h["e"] == 0) {
				var tmp = com_tilbuci_data_Global.ws;
				var _g = new haxe_ds_StringMap();
				_g.h["file"] = "events";
				_g.h["name"] = ld.map.h["file"];
				tmp.download(_g);
			} else {
				this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-visitors-event-title"),com_tilbuci_data_Global.ln.get("window-visitors-event-erexport"),360,180,this.stage);
			}
		} else {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-visitors-event-title"),com_tilbuci_data_Global.ln.get("window-visitors-event-erexport"),360,180,this.stage);
		}
	}
	,onRemoveEvents: function(evt) {
		this.ui.createConfirm(com_tilbuci_data_Global.ln.get("window-visitors-event-title"),com_tilbuci_data_Global.ln.get("window-visitors-event-clearconfirm"),300,230,$bind(this,this.onRemoveEventsConfirm),com_tilbuci_data_Global.ln.get("default-ok"),com_tilbuci_data_Global.ln.get("default-cancel"),this.stage);
	}
	,onRemoveEventsConfirm: function(ok) {
		if(ok) {
			var tmp = com_tilbuci_data_Global.ws;
			var _g = new haxe_ds_StringMap();
			var value = this.ui.selects.h["clearmovie"].get_selectedItem().value;
			_g.h["movie"] = value;
			var value = this.ui.inputs.h["clearname"].get_text();
			_g.h["name"] = value;
			var value = this.ui.selects.h["clearwhen"].get_selectedItem().value;
			_g.h["date"] = value;
			tmp.send("Visitor/RemoveEvents",_g,$bind(this,this.onRemoveEventsReturn));
		}
	}
	,onRemoveEventsReturn: function(ok,ld) {
		if(ok) {
			if(ld.map.h["e"] == 0) {
				this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-visitors-event-title"),com_tilbuci_data_Global.ln.get("window-visitors-event-okremove"),360,180,this.stage);
			} else {
				this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-visitors-event-title"),com_tilbuci_data_Global.ln.get("window-visitors-event-erremove"),360,180,this.stage);
			}
		} else {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-visitors-event-title"),com_tilbuci_data_Global.ln.get("window-visitors-event-erremove"),360,180,this.stage);
		}
	}
	,onRemoveCors: function(evt) {
		if(this.ui.lists.h["corsallowed"].get_selectedItem() != null) {
			var tmp = com_tilbuci_data_Global.ws;
			var _g = new haxe_ds_StringMap();
			var value = this.ui.lists.h["corsallowed"].get_selectedItem().value;
			_g.h["domain"] = value;
			tmp.send("Visitor/RemoveCORS",_g,$bind(this,this.onRemoveCorsReturn));
		}
	}
	,onRemoveCorsReturn: function(ok,ld) {
		if(ok) {
			if(ld.map.h["e"] == 0) {
				this.onListVisitor(null);
			} else {
				this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-visitors-cors-title"),com_tilbuci_data_Global.ln.get("window-visitors-cors-errorrm"),360,180,this.stage);
			}
		} else {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-visitors-cors-title"),com_tilbuci_data_Global.ln.get("window-visitors-cors-errorrm"),360,180,this.stage);
		}
	}
	,onAddCors: function(evt) {
		if(HxOverrides.substr(this.ui.inputs.h["corsadd"].get_text().toLowerCase(),0,4) == "http") {
			var tmp = com_tilbuci_data_Global.ws;
			var _g = new haxe_ds_StringMap();
			var value = this.ui.inputs.h["corsadd"].get_text().toLowerCase();
			_g.h["domain"] = value;
			tmp.send("Visitor/AddCORS",_g,$bind(this,this.onAddCorsReturn));
		}
	}
	,onAddCorsReturn: function(ok,ld) {
		if(ok) {
			if(ld.map.h["e"] == 0) {
				this.ui.inputs.h["corsadd"].set_text("");
				this.onListVisitor(null);
			} else {
				this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-visitors-cors-title"),com_tilbuci_data_Global.ln.get("window-visitors-cors-erroradd"),360,180,this.stage);
			}
		} else {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-visitors-cors-title"),com_tilbuci_data_Global.ln.get("window-visitors-cors-erroradd"),360,180,this.stage);
		}
	}
	,__class__: com_tilbuci_ui_window_WindowVisitors
});
var com_tilbuci_ui_window_contraptions_WindowContrBackground = function(ac) {
	this._list = new haxe_ds_StringMap();
	com_tilbuci_ui_window_PopupWindow.call(this,ac,com_tilbuci_data_Global.ln.get("window-contrbg-title"),1000,com_tilbuci_ui_base_InterfaceFactory.pickValue(525,540),false,true,true);
};
$hxClasses["com.tilbuci.ui.window.contraptions.WindowContrBackground"] = com_tilbuci_ui_window_contraptions_WindowContrBackground;
com_tilbuci_ui_window_contraptions_WindowContrBackground.__name__ = "com.tilbuci.ui.window.contraptions.WindowContrBackground";
com_tilbuci_ui_window_contraptions_WindowContrBackground.__super__ = com_tilbuci_ui_window_PopupWindow;
com_tilbuci_ui_window_contraptions_WindowContrBackground.prototype = $extend(com_tilbuci_ui_window_PopupWindow.prototype,{
	_list: null
	,startInterface: function(evt) {
		this.ui.createHContainer("landscape");
		this.ui.createTInput("landscape","","",this.ui.hcontainers.h["landscape"],false);
		var tmp = this.ui;
		var tmp1 = openfl_utils_Assets.getBitmapData("btOpenfile");
		var tmp2 = this.ui.hcontainers.h["landscape"];
		tmp.createIconButton("landscape",$bind(this,this.acImgL),new openfl_display_Bitmap(tmp1),null,tmp2,false);
		var tmp = this.ui;
		var tmp1 = openfl_utils_Assets.getBitmapData("btDel");
		var tmp2 = this.ui.hcontainers.h["landscape"];
		tmp.createIconButton("landscapedel",$bind(this,this.acImgLdel),new openfl_display_Bitmap(tmp1),null,tmp2,false);
		this.ui.inputs.h["landscape"].set_enabled(false);
		this.ui.hcontainers.h["landscape"].setWidth(460,[350,50,50]);
		this.ui.createHContainer("portrait");
		this.ui.createTInput("portrait","","",this.ui.hcontainers.h["portrait"],false);
		var tmp = this.ui;
		var tmp1 = openfl_utils_Assets.getBitmapData("btOpenfile");
		var tmp2 = this.ui.hcontainers.h["portrait"];
		tmp.createIconButton("portrait",$bind(this,this.acImgP),new openfl_display_Bitmap(tmp1),null,tmp2,false);
		var tmp = this.ui;
		var tmp1 = openfl_utils_Assets.getBitmapData("btDel");
		var tmp2 = this.ui.hcontainers.h["portrait"];
		tmp.createIconButton("portraitdel",$bind(this,this.acImgPdel),new openfl_display_Bitmap(tmp1),null,tmp2,false);
		this.ui.inputs.h["portrait"].set_enabled(false);
		this.ui.hcontainers.h["portrait"].setWidth(460,[350,50,50]);
		var tmp = com_tilbuci_data_Global.ln.get("window-kfmanage-title");
		var tmp1 = this.ui;
		var tmp2 = this.ui;
		var tmp3 = { tp : "Label", id : "registered", tx : com_tilbuci_data_Global.ln.get("window-contrbg-registered"), vr : ""};
		var tmp4 = { tp : "Button", id : "load", tx : com_tilbuci_data_Global.ln.get("window-contrbg-load"), ac : $bind(this,this.loadContr)};
		var tmp5 = { tp : "Button", id : "remove", tx : com_tilbuci_data_Global.ln.get("window-contrbg-remove"), ac : $bind(this,this.removeContr)};
		var tmp6 = { tp : "Label", id : "name", tx : com_tilbuci_data_Global.ln.get("window-contrbg-name"), vr : "detail"};
		var tmp7 = com_tilbuci_data_Global.ln.get("window-contrbg-add");
		this.addForm(tmp,tmp1.createColumnHolder("columns",tmp2.forge("leftcol",[tmp3,{ tp : "List", id : "registered", vl : [], sl : null, ht : 200},tmp4,tmp5,{ tp : "Spacer", id : "add", ht : 15, ln : true},tmp6,{ tp : "TInput", id : "name", tx : "", vr : ""},{ tp : "Button", id : "add", tx : tmp7, ac : $bind(this,this.addContr)}]),this.ui.forge("rightcol",[{ tp : "Label", id : "properties", tx : com_tilbuci_data_Global.ln.get("window-contrbg-properties"), vr : ""},{ tp : "Label", id : "landscape", tx : com_tilbuci_data_Global.ln.get("window-contrbg-landscape"), vr : "detail"},{ tp : "Custom", cont : this.ui.hcontainers.h["landscape"]},{ tp : "Label", id : "portrait", tx : com_tilbuci_data_Global.ln.get("window-contrbg-portrait"), vr : "detail"},{ tp : "Custom", cont : this.ui.hcontainers.h["portrait"]}]),this.ui.forge("bottom",[{ tp : "Button", id : "save", tx : com_tilbuci_data_Global.ln.get("window-contrbg-save"), ac : $bind(this,this.saveContr)}]),420));
		this.ui.listDbClick("registered",$bind(this,this.loadContr));
		com_tilbuci_ui_window_PopupWindow.prototype.startInterface.call(this);
	}
	,acStart: function() {
		var h = this._list.h;
		var cont_h = h;
		var cont_keys = Object.keys(h);
		var cont_length = cont_keys.length;
		var cont_current = 0;
		while(cont_current < cont_length) {
			var cont = cont_keys[cont_current++];
			this._list.h[cont].kill();
			var _this = this._list;
			if(Object.prototype.hasOwnProperty.call(_this.h,cont)) {
				delete(_this.h[cont]);
			}
		}
		var h = com_tilbuci_data_GlobalPlayer.contraptions.backgrounds.h;
		var contk_h = h;
		var contk_keys = Object.keys(h);
		var contk_length = contk_keys.length;
		var contk_current = 0;
		while(contk_current < contk_length) {
			var contk = contk_h[contk_keys[contk_current++]];
			var this1 = this._list;
			var k = contk.id;
			var v = contk.clone();
			this1.h[k] = v;
		}
		this.clear();
	}
	,clear: function() {
		var list = [];
		var h = this._list.h;
		var cont_h = h;
		var cont_keys = Object.keys(h);
		var cont_length = cont_keys.length;
		var cont_current = 0;
		while(cont_current < cont_length) {
			var cont = cont_h[cont_keys[cont_current++]];
			list.push({ text : cont.id, value : cont.id});
		}
		this.ui.setListValues("registered",list);
		this.ui.setListSelectValue("registered",null);
		this.ui.inputs.h["name"].set_text("");
		this.ui.inputs.h["portrait"].set_text("");
		this.ui.inputs.h["landscape"].set_text("");
	}
	,loadContr: function(evt) {
		if(this.ui.lists.h["registered"].get_selectedItem() != null) {
			var this1 = this._list;
			var key = this.ui.lists.h["registered"].get_selectedItem().value;
			if(Object.prototype.hasOwnProperty.call(this1.h,key)) {
				var tmp = this.ui.inputs.h["name"];
				var this1 = this._list;
				var key = this.ui.lists.h["registered"].get_selectedItem().value;
				tmp.set_text(this1.h[key].id);
				var tmp = this.ui.inputs.h["portrait"];
				var this1 = this._list;
				var key = this.ui.lists.h["registered"].get_selectedItem().value;
				tmp.set_text(this1.h[key].portrait);
				var tmp = this.ui.inputs.h["landscape"];
				var this1 = this._list;
				var key = this.ui.lists.h["registered"].get_selectedItem().value;
				tmp.set_text(this1.h[key].landscape);
			}
		}
	}
	,action: function(ac,data) {
		switch(ac) {
		case "landscape":
			this.ui.inputs.h["landscape"].set_text(data.h["file"]);
			break;
		case "portrait":
			this.ui.inputs.h["portrait"].set_text(data.h["file"]);
			break;
		}
	}
	,removeContr: function(evt) {
		if(this.ui.lists.h["registered"].get_selectedItem() != null) {
			var this1 = this._list;
			var key = this.ui.lists.h["registered"].get_selectedItem().value;
			if(Object.prototype.hasOwnProperty.call(this1.h,key)) {
				var this1 = this._list;
				var key = this.ui.lists.h["registered"].get_selectedItem().value;
				this1.h[key].kill();
				var this1 = this._list;
				var key = this.ui.lists.h["registered"].get_selectedItem().value;
				var _this = this1;
				if(Object.prototype.hasOwnProperty.call(_this.h,key)) {
					delete(_this.h[key]);
				}
				this.clear();
			}
		}
	}
	,saveContr: function(evt) {
		var h = com_tilbuci_data_GlobalPlayer.contraptions.backgrounds.h;
		var cont_h = h;
		var cont_keys = Object.keys(h);
		var cont_length = cont_keys.length;
		var cont_current = 0;
		while(cont_current < cont_length) {
			var cont = cont_keys[cont_current++];
			com_tilbuci_data_GlobalPlayer.contraptions.backgrounds.h[cont].kill();
			var _this = com_tilbuci_data_GlobalPlayer.contraptions.backgrounds;
			if(Object.prototype.hasOwnProperty.call(_this.h,cont)) {
				delete(_this.h[cont]);
			}
		}
		var h = this._list.h;
		var cont_h = h;
		var cont_keys = Object.keys(h);
		var cont_length = cont_keys.length;
		var cont_current = 0;
		while(cont_current < cont_length) {
			var cont = cont_keys[cont_current++];
			var this1 = com_tilbuci_data_GlobalPlayer.contraptions.backgrounds;
			var v = this._list.h[cont].clone();
			this1.h[cont] = v;
		}
		this.clear();
		var tmp = com_tilbuci_data_Global.ws;
		var _g = new haxe_ds_StringMap();
		var value = com_tilbuci_data_GlobalPlayer.movie.get_mvId();
		_g.h["movie"] = value;
		var value = com_tilbuci_data_GlobalPlayer.contraptions.getData();
		_g.h["data"] = value;
		tmp.send("Movie/SaveContraptions",_g,$bind(this,this.onSaveReturn));
	}
	,addContr: function(evt) {
		if(this.ui.inputs.h["name"].get_text().length > 3) {
			if(this.ui.inputs.h["landscape"].get_text() != "" || this.ui.inputs.h["portrait"].get_text() != "") {
				var contr;
				var this1 = this._list;
				var key = this.ui.inputs.h["name"].get_text();
				if(Object.prototype.hasOwnProperty.call(this1.h,key)) {
					var this1 = this._list;
					var key = this.ui.inputs.h["name"].get_text();
					contr = this1.h[key];
					contr.load({ id : this.ui.inputs.h["name"].get_text(), landscape : this.ui.inputs.h["landscape"].get_text(), portrait : this.ui.inputs.h["portrait"].get_text()});
					this.clear();
				} else {
					contr = new com_tilbuci_contraptions_BackgroundContraption();
					contr.load({ id : this.ui.inputs.h["name"].get_text(), landscape : this.ui.inputs.h["landscape"].get_text(), portrait : this.ui.inputs.h["portrait"].get_text()});
					var this1 = this._list;
					var k = this.ui.inputs.h["name"].get_text();
					this1.h[k] = contr;
					this.clear();
				}
			} else {
				com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("window-contrbg-title"),com_tilbuci_data_Global.ln.get("window-contrbg-nographics"),320,150,com_tilbuci_data_Global.ln.get("default-ok"));
			}
		} else {
			com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("window-contrbg-title"),com_tilbuci_data_Global.ln.get("window-contrbg-noname"),320,150,com_tilbuci_data_Global.ln.get("default-ok"));
		}
	}
	,acImgP: function(evt) {
		this._ac("portrait");
	}
	,acImgPdel: function(evt) {
		this.ui.inputs.h["portrait"].set_text("");
	}
	,acImgL: function(evt) {
		this._ac("landscape");
	}
	,acImgLdel: function(evt) {
		this.ui.inputs.h["landscape"].set_text("");
	}
	,onSaveReturn: function(ok,ld) {
		if(ok) {
			if(ld.map.h["e"] == 1) {
				com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("window-contrbg-title"),com_tilbuci_data_Global.ln.get("window-contrbg-ersave1"),320,150,com_tilbuci_data_Global.ln.get("default-ok"));
			} else if(ld.map.h["e"] == 2) {
				com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("window-contrbg-title"),com_tilbuci_data_Global.ln.get("window-contrbg-ersave"),320,150,com_tilbuci_data_Global.ln.get("default-ok"));
			} else {
				com_tilbuci_data_Global.showMsg(com_tilbuci_data_Global.ln.get("window-contrbg-oksave"));
				feathers_core_PopUpManager.removePopUp(this);
			}
		} else {
			com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("window-contrbg-title"),com_tilbuci_data_Global.ln.get("window-contrbg-ersave"),320,150,com_tilbuci_data_Global.ln.get("default-ok"));
		}
	}
	,__class__: com_tilbuci_ui_window_contraptions_WindowContrBackground
});
var com_tilbuci_ui_window_contraptions_WindowContrCover = function(ac) {
	this._list = new haxe_ds_StringMap();
	com_tilbuci_ui_window_PopupWindow.call(this,ac,com_tilbuci_data_Global.ln.get("window-contrcover-title"),1000,com_tilbuci_ui_base_InterfaceFactory.pickValue(525,540),false,true,true);
};
$hxClasses["com.tilbuci.ui.window.contraptions.WindowContrCover"] = com_tilbuci_ui_window_contraptions_WindowContrCover;
com_tilbuci_ui_window_contraptions_WindowContrCover.__name__ = "com.tilbuci.ui.window.contraptions.WindowContrCover";
com_tilbuci_ui_window_contraptions_WindowContrCover.__super__ = com_tilbuci_ui_window_PopupWindow;
com_tilbuci_ui_window_contraptions_WindowContrCover.prototype = $extend(com_tilbuci_ui_window_PopupWindow.prototype,{
	_list: null
	,startInterface: function(evt) {
		this.ui.createHContainer("landscape");
		this.ui.createTInput("landscape","","",this.ui.hcontainers.h["landscape"],false);
		var tmp = this.ui;
		var tmp1 = openfl_utils_Assets.getBitmapData("btOpenfile");
		var tmp2 = this.ui.hcontainers.h["landscape"];
		tmp.createIconButton("landscape",$bind(this,this.acImgL),new openfl_display_Bitmap(tmp1),null,tmp2,false);
		var tmp = this.ui;
		var tmp1 = openfl_utils_Assets.getBitmapData("btDel");
		var tmp2 = this.ui.hcontainers.h["landscape"];
		tmp.createIconButton("landscapedel",$bind(this,this.acImgLdel),new openfl_display_Bitmap(tmp1),null,tmp2,false);
		this.ui.inputs.h["landscape"].set_enabled(false);
		this.ui.hcontainers.h["landscape"].setWidth(460,[350,50,50]);
		this.ui.createHContainer("portrait");
		this.ui.createTInput("portrait","","",this.ui.hcontainers.h["portrait"],false);
		var tmp = this.ui;
		var tmp1 = openfl_utils_Assets.getBitmapData("btOpenfile");
		var tmp2 = this.ui.hcontainers.h["portrait"];
		tmp.createIconButton("portrait",$bind(this,this.acImgP),new openfl_display_Bitmap(tmp1),null,tmp2,false);
		var tmp = this.ui;
		var tmp1 = openfl_utils_Assets.getBitmapData("btDel");
		var tmp2 = this.ui.hcontainers.h["portrait"];
		tmp.createIconButton("portraitdel",$bind(this,this.acImgPdel),new openfl_display_Bitmap(tmp1),null,tmp2,false);
		this.ui.inputs.h["portrait"].set_enabled(false);
		this.ui.hcontainers.h["portrait"].setWidth(460,[350,50,50]);
		var tmp = com_tilbuci_data_Global.ln.get("window-kfmanage-title");
		var tmp1 = this.ui;
		var tmp2 = this.ui;
		var tmp3 = { tp : "Label", id : "registered", tx : com_tilbuci_data_Global.ln.get("window-contrcover-registered"), vr : ""};
		var tmp4 = { tp : "Button", id : "load", tx : com_tilbuci_data_Global.ln.get("window-contrcover-load"), ac : $bind(this,this.loadContr)};
		var tmp5 = { tp : "Button", id : "remove", tx : com_tilbuci_data_Global.ln.get("window-contrcover-remove"), ac : $bind(this,this.removeContr)};
		var tmp6 = { tp : "Label", id : "name", tx : com_tilbuci_data_Global.ln.get("window-contrcover-name"), vr : "detail"};
		var tmp7 = com_tilbuci_data_Global.ln.get("window-contrcover-add");
		this.addForm(tmp,tmp1.createColumnHolder("columns",tmp2.forge("leftcol",[tmp3,{ tp : "List", id : "registered", vl : [], sl : null, ht : 200},tmp4,tmp5,{ tp : "Spacer", id : "add", ht : 15, ln : true},tmp6,{ tp : "TInput", id : "name", tx : "", vr : ""},{ tp : "Button", id : "add", tx : tmp7, ac : $bind(this,this.addContr)}]),this.ui.forge("rightcol",[{ tp : "Label", id : "properties", tx : com_tilbuci_data_Global.ln.get("window-contrcover-properties"), vr : ""},{ tp : "Label", id : "landscape", tx : com_tilbuci_data_Global.ln.get("window-contrcover-landscape"), vr : "detail"},{ tp : "Custom", cont : this.ui.hcontainers.h["landscape"]},{ tp : "Label", id : "portrait", tx : com_tilbuci_data_Global.ln.get("window-contrcover-portrait"), vr : "detail"},{ tp : "Custom", cont : this.ui.hcontainers.h["portrait"]},{ tp : "Label", id : "block", tx : com_tilbuci_data_Global.ln.get("window-contrcover-block"), vr : "detail"},{ tp : "Toggle", id : "block", vl : false}]),this.ui.forge("bottom",[{ tp : "Button", id : "save", tx : com_tilbuci_data_Global.ln.get("window-contrcover-save"), ac : $bind(this,this.saveContr)}]),420));
		this.ui.listDbClick("registered",$bind(this,this.loadContr));
		com_tilbuci_ui_window_PopupWindow.prototype.startInterface.call(this);
	}
	,acStart: function() {
		var h = this._list.h;
		var cont_h = h;
		var cont_keys = Object.keys(h);
		var cont_length = cont_keys.length;
		var cont_current = 0;
		while(cont_current < cont_length) {
			var cont = cont_keys[cont_current++];
			this._list.h[cont].kill();
			var _this = this._list;
			if(Object.prototype.hasOwnProperty.call(_this.h,cont)) {
				delete(_this.h[cont]);
			}
		}
		var h = com_tilbuci_data_GlobalPlayer.contraptions.covers.h;
		var contk_h = h;
		var contk_keys = Object.keys(h);
		var contk_length = contk_keys.length;
		var contk_current = 0;
		while(contk_current < contk_length) {
			var contk = contk_h[contk_keys[contk_current++]];
			var this1 = this._list;
			var k = contk.id;
			var v = contk.clone();
			this1.h[k] = v;
		}
		this.clear();
	}
	,clear: function() {
		var list = [];
		var h = this._list.h;
		var cont_h = h;
		var cont_keys = Object.keys(h);
		var cont_length = cont_keys.length;
		var cont_current = 0;
		while(cont_current < cont_length) {
			var cont = cont_h[cont_keys[cont_current++]];
			list.push({ text : cont.id, value : cont.id});
		}
		this.ui.setListValues("registered",list);
		this.ui.setListSelectValue("registered",null);
		this.ui.inputs.h["name"].set_text("");
		this.ui.inputs.h["portrait"].set_text("");
		this.ui.inputs.h["landscape"].set_text("");
		this.ui.toggles.h["block"].set_selected(false);
	}
	,loadContr: function(evt) {
		if(this.ui.lists.h["registered"].get_selectedItem() != null) {
			var this1 = this._list;
			var key = this.ui.lists.h["registered"].get_selectedItem().value;
			if(Object.prototype.hasOwnProperty.call(this1.h,key)) {
				var tmp = this.ui.inputs.h["name"];
				var this1 = this._list;
				var key = this.ui.lists.h["registered"].get_selectedItem().value;
				tmp.set_text(this1.h[key].id);
				var tmp = this.ui.inputs.h["portrait"];
				var this1 = this._list;
				var key = this.ui.lists.h["registered"].get_selectedItem().value;
				tmp.set_text(this1.h[key].portrait);
				var tmp = this.ui.inputs.h["landscape"];
				var this1 = this._list;
				var key = this.ui.lists.h["registered"].get_selectedItem().value;
				tmp.set_text(this1.h[key].landscape);
				var tmp = this.ui.toggles.h["block"];
				var this1 = this._list;
				var key = this.ui.lists.h["registered"].get_selectedItem().value;
				tmp.set_selected(this1.h[key].holdClick);
			}
		}
	}
	,action: function(ac,data) {
		switch(ac) {
		case "landscape":
			this.ui.inputs.h["landscape"].set_text(data.h["file"]);
			break;
		case "portrait":
			this.ui.inputs.h["portrait"].set_text(data.h["file"]);
			break;
		}
	}
	,removeContr: function(evt) {
		if(this.ui.lists.h["registered"].get_selectedItem() != null) {
			var this1 = this._list;
			var key = this.ui.lists.h["registered"].get_selectedItem().value;
			if(Object.prototype.hasOwnProperty.call(this1.h,key)) {
				var this1 = this._list;
				var key = this.ui.lists.h["registered"].get_selectedItem().value;
				this1.h[key].kill();
				var this1 = this._list;
				var key = this.ui.lists.h["registered"].get_selectedItem().value;
				var _this = this1;
				if(Object.prototype.hasOwnProperty.call(_this.h,key)) {
					delete(_this.h[key]);
				}
				this.clear();
			}
		}
	}
	,saveContr: function(evt) {
		var h = com_tilbuci_data_GlobalPlayer.contraptions.covers.h;
		var cont_h = h;
		var cont_keys = Object.keys(h);
		var cont_length = cont_keys.length;
		var cont_current = 0;
		while(cont_current < cont_length) {
			var cont = cont_keys[cont_current++];
			com_tilbuci_data_GlobalPlayer.contraptions.covers.h[cont].kill();
			var _this = com_tilbuci_data_GlobalPlayer.contraptions.covers;
			if(Object.prototype.hasOwnProperty.call(_this.h,cont)) {
				delete(_this.h[cont]);
			}
		}
		var h = this._list.h;
		var cont_h = h;
		var cont_keys = Object.keys(h);
		var cont_length = cont_keys.length;
		var cont_current = 0;
		while(cont_current < cont_length) {
			var cont = cont_keys[cont_current++];
			var this1 = com_tilbuci_data_GlobalPlayer.contraptions.covers;
			var v = this._list.h[cont].clone();
			this1.h[cont] = v;
		}
		this.clear();
		var tmp = com_tilbuci_data_Global.ws;
		var _g = new haxe_ds_StringMap();
		var value = com_tilbuci_data_GlobalPlayer.movie.get_mvId();
		_g.h["movie"] = value;
		var value = com_tilbuci_data_GlobalPlayer.contraptions.getData();
		_g.h["data"] = value;
		tmp.send("Movie/SaveContraptions",_g,$bind(this,this.onSaveReturn));
	}
	,addContr: function(evt) {
		if(this.ui.inputs.h["name"].get_text().length > 3) {
			if(this.ui.inputs.h["landscape"].get_text() != "" || this.ui.inputs.h["portrait"].get_text() != "") {
				var contr;
				var this1 = this._list;
				var key = this.ui.inputs.h["name"].get_text();
				if(Object.prototype.hasOwnProperty.call(this1.h,key)) {
					var this1 = this._list;
					var key = this.ui.inputs.h["name"].get_text();
					contr = this1.h[key];
					contr.load({ id : this.ui.inputs.h["name"].get_text(), landscape : this.ui.inputs.h["landscape"].get_text(), portrait : this.ui.inputs.h["portrait"].get_text(), click : this.ui.toggles.h["block"].get_selected()});
					this.clear();
				} else {
					contr = new com_tilbuci_contraptions_CoverContraption();
					contr.load({ id : this.ui.inputs.h["name"].get_text(), landscape : this.ui.inputs.h["landscape"].get_text(), portrait : this.ui.inputs.h["portrait"].get_text(), click : this.ui.toggles.h["block"].get_selected()});
					var this1 = this._list;
					var k = this.ui.inputs.h["name"].get_text();
					this1.h[k] = contr;
					this.clear();
				}
			} else {
				com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("window-contrcover-title"),com_tilbuci_data_Global.ln.get("window-contrcover-nographics"),320,150,com_tilbuci_data_Global.ln.get("default-ok"));
			}
		} else {
			com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("window-contrcover-title"),com_tilbuci_data_Global.ln.get("window-contrcover-noname"),320,150,com_tilbuci_data_Global.ln.get("default-ok"));
		}
	}
	,acImgP: function(evt) {
		this._ac("portrait");
	}
	,acImgPdel: function(evt) {
		this.ui.inputs.h["portrait"].set_text("");
	}
	,acImgL: function(evt) {
		this._ac("landscape");
	}
	,acImgLdel: function(evt) {
		this.ui.inputs.h["landscape"].set_text("");
	}
	,onSaveReturn: function(ok,ld) {
		if(ok) {
			if(ld.map.h["e"] == 1) {
				com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("window-contrcover-title"),com_tilbuci_data_Global.ln.get("window-contrcover-ersave1"),320,150,com_tilbuci_data_Global.ln.get("default-ok"));
			} else if(ld.map.h["e"] == 2) {
				com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("window-contrcover-title"),com_tilbuci_data_Global.ln.get("window-contrcover-ersave"),320,150,com_tilbuci_data_Global.ln.get("default-ok"));
			} else {
				com_tilbuci_data_Global.showMsg(com_tilbuci_data_Global.ln.get("window-contrcover-oksave"));
				feathers_core_PopUpManager.removePopUp(this);
			}
		} else {
			com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("window-contrcover-title"),com_tilbuci_data_Global.ln.get("window-contrcover-ersave"),320,150,com_tilbuci_data_Global.ln.get("default-ok"));
		}
	}
	,__class__: com_tilbuci_ui_window_contraptions_WindowContrCover
});
var com_tilbuci_ui_window_contraptions_WindowContrForm = function(ac) {
	this._list = new haxe_ds_StringMap();
	com_tilbuci_ui_window_PopupWindow.call(this,ac,com_tilbuci_data_Global.ln.get("window-contrform-title"),1000,com_tilbuci_ui_base_InterfaceFactory.pickValue(715,740),false,true,true);
};
$hxClasses["com.tilbuci.ui.window.contraptions.WindowContrForm"] = com_tilbuci_ui_window_contraptions_WindowContrForm;
com_tilbuci_ui_window_contraptions_WindowContrForm.__name__ = "com.tilbuci.ui.window.contraptions.WindowContrForm";
com_tilbuci_ui_window_contraptions_WindowContrForm.__super__ = com_tilbuci_ui_window_PopupWindow;
com_tilbuci_ui_window_contraptions_WindowContrForm.prototype = $extend(com_tilbuci_ui_window_PopupWindow.prototype,{
	_list: null
	,startInterface: function(evt) {
		this.ui.createHContainer("background");
		this.ui.createTInput("background","","",this.ui.hcontainers.h["background"],false);
		var tmp = this.ui;
		var tmp1 = openfl_utils_Assets.getBitmapData("btOpenfile");
		var tmp2 = this.ui.hcontainers.h["background"];
		tmp.createIconButton("background",$bind(this,this.acBackground),new openfl_display_Bitmap(tmp1),null,tmp2,false);
		var tmp = this.ui;
		var tmp1 = openfl_utils_Assets.getBitmapData("btDel");
		var tmp2 = this.ui.hcontainers.h["background"];
		tmp.createIconButton("backgrounddel",$bind(this,this.acBackgrounddel),new openfl_display_Bitmap(tmp1),null,tmp2,false);
		this.ui.inputs.h["background"].set_enabled(false);
		this.ui.hcontainers.h["background"].setWidth(450,[340,50,50]);
		var tmp = this.ui;
		var tmp1 = { tp : "Label", id : "backgroundset", tx : com_tilbuci_data_Global.ln.get("window-contrform-background"), vr : ""};
		var tmp2 = { tp : "Custom", cont : this.ui.hcontainers.h["background"]};
		var tmp3 = com_tilbuci_data_Global.ln.get("window-contrform-setbutton");
		tmp.forge("background",[tmp1,tmp2,{ tp : "Spacer", id : "backgroundset", ht : 10, ln : false},{ tp : "Button", id : "backgroundset", tx : tmp3, ac : $bind(this,this.setElement)}]);
		this.ui.createHContainer("btok");
		this.ui.createTInput("btok","","",this.ui.hcontainers.h["btok"],false);
		var tmp = this.ui;
		var tmp1 = openfl_utils_Assets.getBitmapData("btOpenfile");
		var tmp2 = this.ui.hcontainers.h["btok"];
		tmp.createIconButton("btok",$bind(this,this.acBtok),new openfl_display_Bitmap(tmp1),null,tmp2,false);
		var tmp = this.ui;
		var tmp1 = openfl_utils_Assets.getBitmapData("btDel");
		var tmp2 = this.ui.hcontainers.h["btok"];
		tmp.createIconButton("btokdel",$bind(this,this.acBtokdel),new openfl_display_Bitmap(tmp1),null,tmp2,false);
		this.ui.inputs.h["btok"].set_enabled(false);
		this.ui.hcontainers.h["btok"].setWidth(450,[340,50,50]);
		this.ui.createHContainer("formelokpos");
		this.ui.createLabel("formelokposx","X","detail",this.ui.hcontainers.h["formelokpos"]);
		this.ui.createNumeric("formelokposx",-3840,3840,10,0,this.ui.hcontainers.h["formelokpos"]);
		this.ui.createLabel("formelokposy","Y","detail",this.ui.hcontainers.h["formelokpos"]);
		this.ui.createNumeric("formelokposy",-3840,3840,10,0,this.ui.hcontainers.h["formelokpos"]);
		var tmp = this.ui;
		var tmp1 = { tp : "Label", id : "btokset", tx : com_tilbuci_data_Global.ln.get("window-contrform-btok"), vr : ""};
		var tmp2 = { tp : "Custom", cont : this.ui.hcontainers.h["btok"]};
		var tmp3 = { tp : "Label", id : "formelokpos", tx : com_tilbuci_data_Global.ln.get("window-contrform-formelposition"), vr : ""};
		var tmp4 = { tp : "Custom", cont : this.ui.hcontainers.h["formelokpos"]};
		var tmp5 = com_tilbuci_data_Global.ln.get("window-contrform-setbutton");
		tmp.forge("btok",[tmp1,tmp2,{ tp : "Spacer", id : "okpos", ht : 10, ln : false},tmp3,tmp4,{ tp : "Spacer", id : "btokset", ht : 10, ln : false},{ tp : "Button", id : "btokset", tx : tmp5, ac : $bind(this,this.setElement)}]);
		this.ui.createHContainer("btcancel");
		this.ui.createTInput("btcancel","","",this.ui.hcontainers.h["btcancel"],false);
		var tmp = this.ui;
		var tmp1 = openfl_utils_Assets.getBitmapData("btOpenfile");
		var tmp2 = this.ui.hcontainers.h["btcancel"];
		tmp.createIconButton("btcancel",$bind(this,this.acBtcancel),new openfl_display_Bitmap(tmp1),null,tmp2,false);
		var tmp = this.ui;
		var tmp1 = openfl_utils_Assets.getBitmapData("btDel");
		var tmp2 = this.ui.hcontainers.h["btcancel"];
		tmp.createIconButton("btcanceldel",$bind(this,this.acBtcanceldel),new openfl_display_Bitmap(tmp1),null,tmp2,false);
		this.ui.inputs.h["btcancel"].set_enabled(false);
		this.ui.hcontainers.h["btcancel"].setWidth(450,[340,50,50]);
		this.ui.createHContainer("formelcancpos");
		this.ui.createLabel("formelcancposx","X","detail",this.ui.hcontainers.h["formelcancpos"]);
		this.ui.createNumeric("formelcancposx",-3840,3840,10,0,this.ui.hcontainers.h["formelcancpos"]);
		this.ui.createLabel("formelcancposy","Y","detail",this.ui.hcontainers.h["formelcancpos"]);
		this.ui.createNumeric("formelcancposy",-3840,3840,10,0,this.ui.hcontainers.h["formelcancpos"]);
		var tmp = this.ui;
		var tmp1 = { tp : "Label", id : "btcancelset", tx : com_tilbuci_data_Global.ln.get("window-contrform-btcancel"), vr : ""};
		var tmp2 = { tp : "Custom", cont : this.ui.hcontainers.h["btcancel"]};
		var tmp3 = { tp : "Label", id : "formelcancpos", tx : com_tilbuci_data_Global.ln.get("window-contrform-formelposition"), vr : ""};
		var tmp4 = { tp : "Custom", cont : this.ui.hcontainers.h["formelcancpos"]};
		var tmp5 = com_tilbuci_data_Global.ln.get("window-contrform-setbutton");
		tmp.forge("btcancel",[tmp1,tmp2,{ tp : "Spacer", id : "cancpos", ht : 10, ln : false},tmp3,tmp4,{ tp : "Spacer", id : "btcancelset", ht : 10, ln : false},{ tp : "Button", id : "btcancelset", tx : tmp5, ac : $bind(this,this.setElement)}]);
		this.ui.createHContainer("formelpos");
		this.ui.createLabel("formelposx","X","detail",this.ui.hcontainers.h["formelpos"]);
		this.ui.createNumeric("formelposx",-3840,3840,10,0,this.ui.hcontainers.h["formelpos"]);
		this.ui.createLabel("formelposy","Y","detail",this.ui.hcontainers.h["formelpos"]);
		this.ui.createNumeric("formelposy",-3840,3840,10,0,this.ui.hcontainers.h["formelpos"]);
		var tmp = this.ui;
		var tmp1 = { tp : "Label", id : "formelname", tx : com_tilbuci_data_Global.ln.get("window-contrform-elname"), vr : ""};
		var tmp2 = { tp : "Label", id : "formeltytpe", tx : com_tilbuci_data_Global.ln.get("window-contrform-eltype"), vr : ""};
		var tmp3 = { tp : "Select", id : "formeltytpe", sl : "", vl : [{ text : com_tilbuci_data_Global.ln.get("window-contrform-eltype-input"), value : "input"},{ text : com_tilbuci_data_Global.ln.get("window-contrform-eltype-select"), value : "select"},{ text : com_tilbuci_data_Global.ln.get("window-contrform-eltype-toggle"), value : "toggle"},{ text : com_tilbuci_data_Global.ln.get("window-contrform-eltype-numeric"), value : "numeric"},{ text : com_tilbuci_data_Global.ln.get("window-contrform-eltype-password"), value : "password"},{ text : com_tilbuci_data_Global.ln.get("window-contrform-eltype-textarea"), value : "textarea"}]};
		var tmp4 = { tp : "Label", id : "formelselect", tx : com_tilbuci_data_Global.ln.get("window-contrform-formelselect"), vr : ""};
		var tmp5 = { tp : "Label", id : "formelwidth", tx : com_tilbuci_data_Global.ln.get("window-contrform-formelwidth"), vr : ""};
		var tmp6 = { tp : "Label", id : "formelposition", tx : com_tilbuci_data_Global.ln.get("window-contrform-formelposition"), vr : ""};
		var tmp7 = { tp : "Custom", cont : this.ui.hcontainers.h["formelpos"]};
		var tmp8 = com_tilbuci_data_Global.ln.get("window-contrform-setbutton");
		tmp.forge("formel",[tmp1,{ tp : "TInput", id : "formelname", tx : "", vr : ""},tmp2,tmp3,tmp4,{ tp : "TInput", id : "formelselect", tx : "", vr : ""},{ tp : "Spacer", id : "forplace", ht : 10, ln : false},tmp5,{ tp : "Numeric", id : "formelwidth", mn : 10, mx : 3840, st : 10, vl : 100},tmp6,tmp7,{ tp : "Spacer", id : "formel", ht : 10, ln : false},{ tp : "Button", id : "formel", tx : tmp8, ac : $bind(this,this.setElement)}]);
		this.ui.createHContainer("elements");
		this.ui.createButton("elementadd",com_tilbuci_data_Global.ln.get("window-contrform-eladd"),$bind(this,this.onElAdd),this.ui.hcontainers.h["elements"]);
		this.ui.createButton("elementrem",com_tilbuci_data_Global.ln.get("window-contrform-elrem"),$bind(this,this.onElRem),this.ui.hcontainers.h["elements"]);
		var tmp = com_tilbuci_data_Global.ln.get("window-kfmanage-title");
		var tmp1 = this.ui;
		var tmp2 = this.ui;
		var tmp3 = { tp : "Label", id : "registered", tx : com_tilbuci_data_Global.ln.get("window-contrform-registered"), vr : ""};
		var tmp4 = { tp : "Button", id : "load", tx : com_tilbuci_data_Global.ln.get("window-contrform-load"), ac : $bind(this,this.loadContr)};
		var tmp5 = { tp : "Button", id : "remove", tx : com_tilbuci_data_Global.ln.get("window-contrform-remove"), ac : $bind(this,this.removeContr)};
		var tmp6 = { tp : "Label", id : "name", tx : com_tilbuci_data_Global.ln.get("window-contrform-name"), vr : "detail"};
		var tmp7 = { tp : "Label", id : "elements", tx : com_tilbuci_data_Global.ln.get("window-contrform-elements"), vr : "detail"};
		var tmp8 = { tp : "Custom", cont : this.ui.hcontainers.h["elements"]};
		var tmp9 = com_tilbuci_data_Global.ln.get("window-contrform-add");
		this.addForm(tmp,tmp1.createColumnHolder("columns",tmp2.forge("leftcol",[tmp3,{ tp : "List", id : "registered", vl : [], sl : null, ht : 150},tmp4,tmp5,{ tp : "Spacer", id : "add", ht : 15, ln : true},tmp6,{ tp : "TInput", id : "name", tx : "", vr : ""},tmp7,{ tp : "List", id : "elements", vl : [], sl : null, ht : 190, ch : $bind(this,this.onElLoad)},tmp8,{ tp : "Button", id : "add", tx : tmp9, ac : $bind(this,this.addContr)}]),this.ui.forge("rightcol",[]),this.ui.forge("bottom",[{ tp : "Button", id : "save", tx : com_tilbuci_data_Global.ln.get("window-contrform-save"), ac : $bind(this,this.saveContr)}]),620));
		this.ui.listDbClick("registered",$bind(this,this.loadContr));
		com_tilbuci_ui_window_PopupWindow.prototype.startInterface.call(this);
	}
	,acStart: function() {
		var h = this._list.h;
		var cont_h = h;
		var cont_keys = Object.keys(h);
		var cont_length = cont_keys.length;
		var cont_current = 0;
		while(cont_current < cont_length) {
			var cont = cont_keys[cont_current++];
			this._list.h[cont].kill();
			var _this = this._list;
			if(Object.prototype.hasOwnProperty.call(_this.h,cont)) {
				delete(_this.h[cont]);
			}
		}
		var h = com_tilbuci_data_GlobalPlayer.contraptions.forms.h;
		var contk_h = h;
		var contk_keys = Object.keys(h);
		var contk_length = contk_keys.length;
		var contk_current = 0;
		while(contk_current < contk_length) {
			var contk = contk_h[contk_keys[contk_current++]];
			var this1 = this._list;
			var k = contk.id;
			var v = contk.clone();
			this1.h[k] = v;
		}
		this.clear();
		this.ui.hcontainers.h["elements"].setWidth(460);
		this.clearElements();
	}
	,clearElements: function() {
		var list = [];
		list.push({ text : com_tilbuci_data_Global.ln.get("window-contrform-nameok"), value : { name : com_tilbuci_data_Global.ln.get("window-contrform-nameok"), type : "btok", file : "", options : "", width : 100, x : 0, y : 0}});
		list.push({ text : com_tilbuci_data_Global.ln.get("window-contrform-namebg"), value : { name : com_tilbuci_data_Global.ln.get("window-contrform-namebg"), type : "background", file : "", options : "", width : 100, x : 0, y : 0}});
		list.push({ text : com_tilbuci_data_Global.ln.get("window-contrform-namecancel"), value : { name : com_tilbuci_data_Global.ln.get("window-contrform-namecancel"), type : "btcancel", file : "", options : "", width : 100, x : 0, y : 0}});
		this.ui.setListValues("elements",list);
		this.ui.setListSelectValue("elements",null);
	}
	,redrawElementsList: function() {
		var list = [];
		var el = this.ui.lists.h["elements"].get_dataProvider().iterator();
		while(el.hasNext()) {
			var el1 = el.next();
			list.push({ text : el1.text, value : el1.value});
		}
		this.ui.setListValues("elements",list);
		this.ui.setListSelectValue("elements",null);
		this.ui.containers.h["rightcol"].removeChildren();
	}
	,clear: function() {
		var list = [];
		var h = this._list.h;
		var cont_h = h;
		var cont_keys = Object.keys(h);
		var cont_length = cont_keys.length;
		var cont_current = 0;
		while(cont_current < cont_length) {
			var cont = cont_h[cont_keys[cont_current++]];
			list.push({ text : cont.id, value : cont});
		}
		this.ui.setListValues("registered",list);
		this.ui.setListSelectValue("registered",null);
		this.ui.inputs.h["name"].set_text("");
		this.clearElements();
	}
	,loadContr: function(evt) {
		if(this.ui.lists.h["registered"].get_selectedItem() != null) {
			var this1 = this._list;
			var key = this.ui.lists.h["registered"].get_selectedItem().text;
			if(Object.prototype.hasOwnProperty.call(this1.h,key)) {
				this.ui.inputs.h["name"].set_text(this.ui.lists.h["registered"].get_selectedItem().text);
				var list = [];
				var cont = this.ui.lists.h["registered"].get_selectedItem().value;
				var _g = 0;
				var _g1 = cont.elem;
				while(_g < _g1.length) {
					var el = _g1[_g];
					++_g;
					var elname = "";
					switch(el.type) {
					case "background":
						elname = com_tilbuci_data_Global.ln.get("window-contrform-background");
						break;
					case "btcancel":
						elname = com_tilbuci_data_Global.ln.get("window-contrform-btcancel");
						break;
					case "btok":
						elname = com_tilbuci_data_Global.ln.get("window-contrform-btok");
						break;
					default:
						elname = el.name + " (" + com_tilbuci_data_Global.ln.get("window-contrform-eltype-" + el.type) + ")";
					}
					list.push({ text : elname, value : el});
				}
				this.ui.setListValues("elements",list);
				this.ui.setListSelectValue("elements",null);
				this.ui.containers.h["rightcol"].removeChildren();
			}
		}
	}
	,action: function(ac,data) {
		switch(ac) {
		case "formbackground":
			this.ui.inputs.h["background"].set_text(data.h["file"]);
			break;
		case "formbtcancel":
			this.ui.inputs.h["btcancel"].set_text(data.h["file"]);
			break;
		case "formbtok":
			this.ui.inputs.h["btok"].set_text(data.h["file"]);
			break;
		}
	}
	,removeContr: function(evt) {
		if(this.ui.lists.h["registered"].get_selectedItem() != null) {
			var this1 = this._list;
			var key = this.ui.lists.h["registered"].get_selectedItem().text;
			if(Object.prototype.hasOwnProperty.call(this1.h,key)) {
				var this1 = this._list;
				var key = this.ui.lists.h["registered"].get_selectedItem().text;
				this1.h[key].kill();
				var this1 = this._list;
				var key = this.ui.lists.h["registered"].get_selectedItem().text;
				var _this = this1;
				if(Object.prototype.hasOwnProperty.call(_this.h,key)) {
					delete(_this.h[key]);
				}
				this.clear();
			}
		}
	}
	,saveContr: function(evt) {
		var h = com_tilbuci_data_GlobalPlayer.contraptions.forms.h;
		var cont_h = h;
		var cont_keys = Object.keys(h);
		var cont_length = cont_keys.length;
		var cont_current = 0;
		while(cont_current < cont_length) {
			var cont = cont_keys[cont_current++];
			com_tilbuci_data_GlobalPlayer.contraptions.forms.h[cont].kill();
			var _this = com_tilbuci_data_GlobalPlayer.contraptions.forms;
			if(Object.prototype.hasOwnProperty.call(_this.h,cont)) {
				delete(_this.h[cont]);
			}
		}
		var h = this._list.h;
		var cont_h = h;
		var cont_keys = Object.keys(h);
		var cont_length = cont_keys.length;
		var cont_current = 0;
		while(cont_current < cont_length) {
			var cont = cont_keys[cont_current++];
			var this1 = com_tilbuci_data_GlobalPlayer.contraptions.forms;
			var v = this._list.h[cont].clone();
			this1.h[cont] = v;
		}
		this.clear();
		var tmp = com_tilbuci_data_Global.ws;
		var _g = new haxe_ds_StringMap();
		var value = com_tilbuci_data_GlobalPlayer.movie.get_mvId();
		_g.h["movie"] = value;
		var value = com_tilbuci_data_GlobalPlayer.contraptions.getData();
		_g.h["data"] = value;
		tmp.send("Movie/SaveContraptions",_g,$bind(this,this.onSaveReturn));
	}
	,addContr: function(evt) {
		if(this.ui.inputs.h["name"].get_text().length > 3) {
			var okbt = true;
			var list = [];
			var el = this.ui.lists.h["elements"].get_dataProvider().iterator();
			while(el.hasNext()) {
				var el1 = el.next();
				switch(el1.value.type) {
				case "background":
					list.push(el1.value);
					break;
				case "btcancel":
					list.push(el1.value);
					break;
				case "btok":
					list.push(el1.value);
					if(el1.value.file == "") {
						okbt = false;
					}
					break;
				default:
					if(el1.value.name != "") {
						list.push(el1.value);
					}
				}
			}
			if(okbt) {
				if(list.length <= 3) {
					com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("window-contrform-title"),com_tilbuci_data_Global.ln.get("window-contrform-noelem"),320,150,com_tilbuci_data_Global.ln.get("default-ok"));
				} else {
					var contr;
					var this1 = this._list;
					var key = this.ui.inputs.h["name"].get_text();
					if(Object.prototype.hasOwnProperty.call(this1.h,key)) {
						var this1 = this._list;
						var key = this.ui.inputs.h["name"].get_text();
						contr = this1.h[key];
					} else {
						contr = new com_tilbuci_contraptions_FormContraption();
					}
					if(contr.load({ id : this.ui.inputs.h["name"].get_text(), elem : list})) {
						var this1 = this._list;
						var k = this.ui.inputs.h["name"].get_text();
						this1.h[k] = contr;
						this.ui.inputs.h["name"].set_text("");
						this.clear();
					}
				}
			} else {
				com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("window-contrform-title"),com_tilbuci_data_Global.ln.get("window-contrform-nook"),320,150,com_tilbuci_data_Global.ln.get("default-ok"));
			}
		} else {
			com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("window-contrform-title"),com_tilbuci_data_Global.ln.get("window-contrform-noname"),320,150,com_tilbuci_data_Global.ln.get("default-ok"));
		}
	}
	,acBackground: function(evt) {
		this._ac("formbackground");
	}
	,acBackgrounddel: function(evt) {
		this.ui.inputs.h["background"].set_text("");
	}
	,acBtok: function(evt) {
		this._ac("formbtok");
	}
	,acBtokdel: function(evt) {
		this.ui.inputs.h["btok"].set_text("");
	}
	,acBtcancel: function(evt) {
		this._ac("formbtcancel");
	}
	,acBtcanceldel: function(evt) {
		this.ui.inputs.h["btcancel"].set_text("");
	}
	,onElAdd: function(evt) {
		var list = [];
		var el = this.ui.lists.h["elements"].get_dataProvider().iterator();
		while(el.hasNext()) {
			var el1 = el.next();
			list.push({ text : el1.text, value : el1.value});
		}
		list.push({ text : com_tilbuci_data_Global.ln.get("window-contrform-new"), value : { name : "", type : "", file : "", options : "", width : 100, x : 0, y : 0}});
		this.ui.setListValues("elements",list);
		this.ui.setListSelectValue("elements",null);
		this.ui.containers.h["rightcol"].removeChildren();
	}
	,onElLoad: function(evt) {
		if(this.ui.lists.h["elements"].get_selectedItem() != null) {
			this.ui.containers.h["rightcol"].removeChildren();
			switch(this.ui.lists.h["elements"].get_selectedItem().value.type) {
			case "background":
				this.ui.containers.h["rightcol"].addChild(this.ui.containers.h["background"]);
				this.ui.labels.h["backgroundset"].set_width(this.ui.buttons.h["backgroundset"].set_width(450));
				this.ui.inputs.h["background"].set_text(this.ui.lists.h["elements"].get_selectedItem().value.file);
				break;
			case "btcancel":
				this.ui.containers.h["rightcol"].addChild(this.ui.containers.h["btcancel"]);
				this.ui.labels.h["formelcancpos"].set_width(this.ui.labels.h["btcancelset"].set_width(this.ui.buttons.h["btcancelset"].set_width(450)));
				this.ui.hcontainers.h["formelcancpos"].setWidth(450,[60,145,60,145]);
				this.ui.inputs.h["btcancel"].set_text(this.ui.lists.h["elements"].get_selectedItem().value.file);
				this.ui.numerics.h["formelcancposx"].set_value(this.ui.lists.h["elements"].get_selectedItem().value.x);
				this.ui.numerics.h["formelcancposy"].set_value(this.ui.lists.h["elements"].get_selectedItem().value.y);
				break;
			case "btok":
				this.ui.containers.h["rightcol"].addChild(this.ui.containers.h["btok"]);
				this.ui.labels.h["formelokpos"].set_width(this.ui.labels.h["btokset"].set_width(this.ui.buttons.h["btokset"].set_width(450)));
				this.ui.hcontainers.h["formelokpos"].setWidth(450,[60,145,60,145]);
				this.ui.inputs.h["btok"].set_text(this.ui.lists.h["elements"].get_selectedItem().value.file);
				this.ui.numerics.h["formelokposx"].set_value(this.ui.lists.h["elements"].get_selectedItem().value.x);
				this.ui.numerics.h["formelokposy"].set_value(this.ui.lists.h["elements"].get_selectedItem().value.y);
				break;
			default:
				this.ui.containers.h["rightcol"].addChild(this.ui.containers.h["formel"]);
				this.ui.inputs.h["formelname"].set_width(this.ui.labels.h["formelname"].set_width(450));
				this.ui.selects.h["formeltytpe"].set_width(this.ui.labels.h["formeltytpe"].set_width(450));
				this.ui.inputs.h["formelselect"].set_width(this.ui.labels.h["formelselect"].set_width(450));
				this.ui.numerics.h["formelwidth"].set_width(this.ui.labels.h["formelwidth"].set_width(450));
				this.ui.labels.h["formelposition"].set_width(this.ui.buttons.h["formel"].set_width(450));
				this.ui.hcontainers.h["formelpos"].setWidth(450,[60,145,60,145]);
				this.ui.inputs.h["formelname"].set_text(this.ui.lists.h["elements"].get_selectedItem().value.name);
				this.ui.setSelectValue("formeltytpe",this.ui.lists.h["elements"].get_selectedItem().value.type);
				this.ui.inputs.h["formelselect"].set_text(this.ui.lists.h["elements"].get_selectedItem().value.options);
				this.ui.numerics.h["formelposx"].set_value(this.ui.lists.h["elements"].get_selectedItem().value.x);
				this.ui.numerics.h["formelposy"].set_value(this.ui.lists.h["elements"].get_selectedItem().value.y);
				this.ui.numerics.h["formelwidth"].set_value(this.ui.lists.h["elements"].get_selectedItem().value.width);
			}
		}
	}
	,onElRem: function(evt) {
		if(this.ui.lists.h["elements"].get_selectedItem() != null) {
			switch(this.ui.lists.h["elements"].get_selectedItem().value.type) {
			case "background":
				break;
			case "btcancel":
				break;
			case "btok":
				break;
			default:
				var list = [];
				var el = this.ui.lists.h["elements"].get_dataProvider().iterator();
				while(el.hasNext()) {
					var el1 = el.next();
					if(el1.value.name != this.ui.lists.h["elements"].get_selectedItem().value.name) {
						list.push({ text : el1.text, value : el1.value});
					}
				}
				this.ui.setListValues("elements",list);
				this.ui.setListSelectValue("elements",null);
				this.ui.containers.h["rightcol"].removeChildren();
			}
		}
	}
	,setElement: function(evt) {
		if(this.ui.lists.h["elements"].get_selectedItem() != null) {
			switch(this.ui.lists.h["elements"].get_selectedItem().value.type) {
			case "background":
				var tmp = this.ui.inputs.h["background"];
				this.ui.lists.h["elements"].get_selectedItem().value.file = tmp.get_text();
				this.redrawElementsList();
				break;
			case "btcancel":
				var tmp = this.ui.inputs.h["btcancel"];
				this.ui.lists.h["elements"].get_selectedItem().value.file = tmp.get_text();
				var tmp = this.ui.lists.h["elements"];
				var tmp1 = this.ui.numerics.h["formelcancposx"].get_value();
				tmp.get_selectedItem().value.x = Math.round(tmp1);
				var tmp = this.ui.lists.h["elements"];
				var tmp1 = this.ui.numerics.h["formelcancposy"].get_value();
				tmp.get_selectedItem().value.y = Math.round(tmp1);
				this.redrawElementsList();
				break;
			case "btok":
				var tmp = this.ui.inputs.h["btok"];
				this.ui.lists.h["elements"].get_selectedItem().value.file = tmp.get_text();
				var tmp = this.ui.lists.h["elements"];
				var tmp1 = this.ui.numerics.h["formelokposx"].get_value();
				tmp.get_selectedItem().value.x = Math.round(tmp1);
				var tmp = this.ui.lists.h["elements"];
				var tmp1 = this.ui.numerics.h["formelokposy"].get_value();
				tmp.get_selectedItem().value.y = Math.round(tmp1);
				this.redrawElementsList();
				break;
			default:
				var newname = this.ui.inputs.h["formelname"].get_text();
				if(newname.length < 3) {
					com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("window-contrform-title"),com_tilbuci_data_Global.ln.get("window-contrform-showtname"),320,150,com_tilbuci_data_Global.ln.get("default-ok"));
				} else {
					var ok = true;
					if(newname != this.ui.lists.h["elements"].get_selectedItem().value.name) {
						var el = this.ui.lists.h["elements"].get_dataProvider().iterator();
						while(el.hasNext()) {
							var el1 = el.next();
							if(newname == el1.value.name) {
								ok = false;
							}
						}
					}
					if(!ok) {
						com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("window-contrform-title"),com_tilbuci_data_Global.ln.get("window-contrform-usedname"),320,150,com_tilbuci_data_Global.ln.get("default-ok"));
					} else {
						var tmp = this.ui.inputs.h["formelname"];
						this.ui.lists.h["elements"].get_selectedItem().value.name = tmp.get_text();
						var tmp = this.ui.selects.h["formeltytpe"];
						this.ui.lists.h["elements"].get_selectedItem().value.type = tmp.get_selectedItem().value;
						var tmp = this.ui.inputs.h["formelselect"];
						this.ui.lists.h["elements"].get_selectedItem().value.options = tmp.get_text();
						var tmp = this.ui.lists.h["elements"];
						var tmp1 = this.ui.numerics.h["formelposx"].get_value();
						tmp.get_selectedItem().value.x = Math.round(tmp1);
						var tmp = this.ui.lists.h["elements"];
						var tmp1 = this.ui.numerics.h["formelposy"].get_value();
						tmp.get_selectedItem().value.y = Math.round(tmp1);
						var tmp = this.ui.lists.h["elements"];
						var tmp1 = this.ui.numerics.h["formelwidth"].get_value();
						tmp.get_selectedItem().value.width = Math.round(tmp1);
						var tmp = this.ui.lists.h["elements"];
						var tmp1 = this.ui.inputs.h["formelname"].get_text() + " (" + com_tilbuci_data_Global.ln.get("window-contrform-eltype-" + Std.string(this.ui.selects.h["formeltytpe"].get_selectedItem().value));
						tmp.get_selectedItem().text = tmp1 + ")";
						this.redrawElementsList();
					}
				}
			}
		}
	}
	,onSaveReturn: function(ok,ld) {
		if(ok) {
			if(ld.map.h["e"] == 1) {
				com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("window-contrform-title"),com_tilbuci_data_Global.ln.get("window-contrform-ersave1"),320,150,com_tilbuci_data_Global.ln.get("default-ok"));
			} else if(ld.map.h["e"] == 2) {
				com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("window-contrform-title"),com_tilbuci_data_Global.ln.get("window-contrform-ersave"),320,150,com_tilbuci_data_Global.ln.get("default-ok"));
			} else {
				com_tilbuci_data_Global.showMsg(com_tilbuci_data_Global.ln.get("window-contrform-oksave"));
				feathers_core_PopUpManager.removePopUp(this);
			}
		} else {
			com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("window-contrform-title"),com_tilbuci_data_Global.ln.get("window-contrform-ersave"),320,150,com_tilbuci_data_Global.ln.get("default-ok"));
		}
	}
	,__class__: com_tilbuci_ui_window_contraptions_WindowContrForm
});
var com_tilbuci_ui_window_contraptions_WindowContrInterf = function(ac) {
	this._lastfrtime = 250;
	this._lastframes = 1;
	this._list = new haxe_ds_StringMap();
	com_tilbuci_ui_window_PopupWindow.call(this,ac,com_tilbuci_data_Global.ln.get("window-contrinterf-title"),1000,com_tilbuci_ui_base_InterfaceFactory.pickValue(715,740),false,true,true);
};
$hxClasses["com.tilbuci.ui.window.contraptions.WindowContrInterf"] = com_tilbuci_ui_window_contraptions_WindowContrInterf;
com_tilbuci_ui_window_contraptions_WindowContrInterf.__name__ = "com.tilbuci.ui.window.contraptions.WindowContrInterf";
com_tilbuci_ui_window_contraptions_WindowContrInterf.__super__ = com_tilbuci_ui_window_PopupWindow;
com_tilbuci_ui_window_contraptions_WindowContrInterf.prototype = $extend(com_tilbuci_ui_window_PopupWindow.prototype,{
	_list: null
	,_lastframes: null
	,_lastfrtime: null
	,startInterface: function(evt) {
		this.ui.createHContainer("background");
		this.ui.createTInput("background","","",this.ui.hcontainers.h["background"],false);
		var tmp = this.ui;
		var tmp1 = openfl_utils_Assets.getBitmapData("btOpenfile");
		var tmp2 = this.ui.hcontainers.h["background"];
		tmp.createIconButton("background",$bind(this,this.acBackground),new openfl_display_Bitmap(tmp1),null,tmp2,false);
		var tmp = this.ui;
		var tmp1 = openfl_utils_Assets.getBitmapData("btDel");
		var tmp2 = this.ui.hcontainers.h["background"];
		tmp.createIconButton("backgrounddel",$bind(this,this.acBackgrounddel),new openfl_display_Bitmap(tmp1),null,tmp2,false);
		this.ui.inputs.h["background"].set_enabled(false);
		this.ui.hcontainers.h["background"].setWidth(450,[340,50,50]);
		var tmp = this.ui;
		var tmp1 = { tp : "Label", id : "backgroundset", tx : com_tilbuci_data_Global.ln.get("window-contrinterf-background"), vr : ""};
		var tmp2 = { tp : "Custom", cont : this.ui.hcontainers.h["background"]};
		var tmp3 = com_tilbuci_data_Global.ln.get("window-contrinterf-setbutton");
		tmp.forge("background",[tmp1,tmp2,{ tp : "Spacer", id : "backgroundset", ht : 10, ln : false},{ tp : "Button", id : "backgroundset", tx : tmp3, ac : $bind(this,this.setElement)}]);
		this.ui.createHContainer("spritemap");
		this.ui.createTInput("spritemap","","",this.ui.hcontainers.h["spritemap"],false);
		var tmp = this.ui;
		var tmp1 = openfl_utils_Assets.getBitmapData("btOpenfile");
		var tmp2 = this.ui.hcontainers.h["spritemap"];
		tmp.createIconButton("spritemap",$bind(this,this.acBtsm),new openfl_display_Bitmap(tmp1),null,tmp2,false);
		var tmp = this.ui;
		var tmp1 = openfl_utils_Assets.getBitmapData("btDel");
		var tmp2 = this.ui.hcontainers.h["spritemap"];
		tmp.createIconButton("spritemap",$bind(this,this.acBtsmdel),new openfl_display_Bitmap(tmp1),null,tmp2,false);
		this.ui.inputs.h["spritemap"].set_enabled(false);
		this.ui.hcontainers.h["spritemap"].setWidth(450,[340,50,50]);
		this.ui.createHContainer("formelsmpos");
		this.ui.createLabel("formelsmposx","X","detail",this.ui.hcontainers.h["formelsmpos"]);
		this.ui.createNumeric("formelsmposx",-3840,3840,10,0,this.ui.hcontainers.h["formelsmpos"]);
		this.ui.createLabel("formelsmposy","Y","detail",this.ui.hcontainers.h["formelsmpos"]);
		this.ui.createNumeric("formelsmposy",-3840,3840,10,0,this.ui.hcontainers.h["formelsmpos"]);
		var tmp = this.ui;
		var tmp1 = { tp : "Label", id : "spritemap", tx : com_tilbuci_data_Global.ln.get("window-contrinterf-smap"), vr : ""};
		var tmp2 = { tp : "Custom", cont : this.ui.hcontainers.h["spritemap"]};
		var tmp3 = { tp : "Label", id : "smaction", tx : com_tilbuci_data_Global.ln.get("window-contrinterf-smapac"), vr : ""};
		var tmp4 = { tp : "Label", id : "formelsmpos", tx : com_tilbuci_data_Global.ln.get("window-contrinterf-formelposition"), vr : ""};
		var tmp5 = { tp : "Custom", cont : this.ui.hcontainers.h["formelsmpos"]};
		var tmp6 = com_tilbuci_data_Global.ln.get("window-contrinterf-setbutton");
		tmp.forge("spritemap",[tmp1,tmp2,tmp3,{ tp : "TInput", id : "smaction", vl : "", vr : ""},{ tp : "Spacer", id : "spritemap", ht : 10, ln : false},tmp4,tmp5,{ tp : "Spacer", id : "formelsmpos", ht : 10, ln : false},{ tp : "Button", id : "btsmset", tx : tmp6, ac : $bind(this,this.setElement)}]);
		this.ui.createHContainer("formeltxpos");
		this.ui.createLabel("formeltxposx","X","detail",this.ui.hcontainers.h["formeltxpos"]);
		this.ui.createNumeric("formeltxposx",-3840,3840,10,0,this.ui.hcontainers.h["formeltxpos"]);
		this.ui.createLabel("formeltxposy","Y","detail",this.ui.hcontainers.h["formeltxpos"]);
		this.ui.createNumeric("formeltxposy",-3840,3840,10,0,this.ui.hcontainers.h["formeltxpos"]);
		var tmp = this.ui;
		var tmp1 = { tp : "Label", id : "txset", tx : com_tilbuci_data_Global.ln.get("window-contrinterf-text"), vr : ""};
		var tmp2 = { tp : "Label", id : "txuse", tx : com_tilbuci_data_Global.ln.get("window-contrinterf-use"), vr : "detail"};
		var tmp3 = { tp : "Label", id : "txfont", tx : com_tilbuci_data_Global.ln.get("window-contrinterf-font"), vr : "detail"};
		var tmp4 = { tp : "Label", id : "txsize", tx : com_tilbuci_data_Global.ln.get("window-contrinterf-fontsize"), vr : "detail"};
		var tmp5 = { tp : "Label", id : "txcolor", tx : com_tilbuci_data_Global.ln.get("window-contrinterf-fontcolor"), vr : "detail"};
		var tmp6 = { tp : "Label", id : "txdeco", tx : com_tilbuci_data_Global.ln.get("window-contrinterf-fontdeco"), vr : "detail"};
		var tmp7 = { tp : "Select", id : "txdeco", vl : [{ text : com_tilbuci_data_Global.ln.get("window-contrinterf-fontdeco-normal"), value : "normal"},{ text : com_tilbuci_data_Global.ln.get("window-contrinterf-fontdeco-bold"), value : "bold"},{ text : com_tilbuci_data_Global.ln.get("window-contrinterf-fontdeco-italic"), value : "italic"},{ text : com_tilbuci_data_Global.ln.get("window-contrinterf-fontdeco-bolditalic"), value : "bolditalic"}], sl : null};
		var tmp8 = { tp : "Label", id : "txalign", tx : com_tilbuci_data_Global.ln.get("window-contrinterf-fontalign"), vr : "detail"};
		var tmp9 = { tp : "Select", id : "txalign", vl : [{ text : com_tilbuci_data_Global.ln.get("window-contrinterf-fontalign-left"), value : "left"},{ text : com_tilbuci_data_Global.ln.get("window-contrinterf-fontalign-right"), value : "right"},{ text : com_tilbuci_data_Global.ln.get("window-contrinterf-fontalign-center"), value : "center"}], sl : null};
		var tmp10 = { tp : "Label", id : "txwidth", tx : com_tilbuci_data_Global.ln.get("window-contrinterf-width"), vr : ""};
		var tmp11 = { tp : "Label", id : "formeltxpos", tx : com_tilbuci_data_Global.ln.get("window-contrinterf-formelposition"), vr : ""};
		var tmp12 = { tp : "Custom", cont : this.ui.hcontainers.h["formeltxpos"]};
		var tmp13 = com_tilbuci_data_Global.ln.get("window-contrinterf-setbutton");
		tmp.forge("txset",[tmp1,tmp2,{ tp : "Toggle", id : "txuse", vl : false},tmp3,{ tp : "Select", id : "txfont", vl : [], sl : null},tmp4,{ tp : "Numeric", id : "txsize", mn : 1, mx : 1000, st : 1, vl : 12},tmp5,{ tp : "TInput", id : "txcolor", vl : "#FFFFFF", vr : ""},tmp6,tmp7,tmp8,tmp9,{ tp : "Spacer", id : "txwidth", ht : 10, ln : false},tmp10,{ tp : "Numeric", id : "txwidth", mn : 1, mx : 10000, st : 10, vl : 100},tmp11,tmp12,{ tp : "Spacer", id : "txset", ht : 10, ln : false},{ tp : "Button", id : "txset", tx : tmp13, ac : $bind(this,this.setElement)}]);
		this.ui.createHContainer("formel");
		this.ui.createTInput("formel","","",this.ui.hcontainers.h["formel"],false);
		var tmp = this.ui;
		var tmp1 = openfl_utils_Assets.getBitmapData("btOpenfile");
		var tmp2 = this.ui.hcontainers.h["formel"];
		tmp.createIconButton("formel",$bind(this,this.acElem),new openfl_display_Bitmap(tmp1),null,tmp2,false);
		var tmp = this.ui;
		var tmp1 = openfl_utils_Assets.getBitmapData("btDel");
		var tmp2 = this.ui.hcontainers.h["formel"];
		tmp.createIconButton("formeldel",$bind(this,this.acElemdel),new openfl_display_Bitmap(tmp1),null,tmp2,false);
		this.ui.inputs.h["formel"].set_enabled(false);
		this.ui.hcontainers.h["formel"].setWidth(450,[340,50,50]);
		this.ui.createHContainer("formelpos");
		this.ui.createLabel("formelposx","X","detail",this.ui.hcontainers.h["formelpos"]);
		this.ui.createNumeric("formelposx",-3840,3840,10,0,this.ui.hcontainers.h["formelpos"]);
		this.ui.createLabel("formelposy","Y","detail",this.ui.hcontainers.h["formelpos"]);
		this.ui.createNumeric("formelposy",-3840,3840,10,0,this.ui.hcontainers.h["formelpos"]);
		var tmp = this.ui;
		var tmp1 = { tp : "Label", id : "btset", tx : com_tilbuci_data_Global.ln.get("window-contrinterf-btgraph"), vr : ""};
		var tmp2 = { tp : "Custom", cont : this.ui.hcontainers.h["formel"]};
		var tmp3 = { tp : "Label", id : "formelac", tx : com_tilbuci_data_Global.ln.get("window-contrinterf-elac"), vr : ""};
		var tmp4 = { tp : "Label", id : "formelposition", tx : com_tilbuci_data_Global.ln.get("window-contrinterf-formelposition"), vr : ""};
		var tmp5 = { tp : "Custom", cont : this.ui.hcontainers.h["formelpos"]};
		var tmp6 = { tp : "Label", id : "formelrotation", tx : com_tilbuci_data_Global.ln.get("window-contrinterf-formelrotation"), vr : ""};
		var tmp7 = { tp : "Label", id : "formelalpha", tx : com_tilbuci_data_Global.ln.get("window-contrinterf-formelalpha"), vr : ""};
		var tmp8 = com_tilbuci_data_Global.ln.get("window-contrinterf-setbutton");
		tmp.forge("formel",[tmp1,tmp2,tmp3,{ tp : "TInput", id : "formelac", tx : "", vr : ""},tmp4,tmp5,tmp6,{ tp : "Numeric", id : "formelrotation", mn : 0, mx : 359, vl : 0, st : 1},tmp7,{ tp : "Numeric", id : "formelalpha", mn : 0, mx : 100, vl : 100, st : 1},{ tp : "Spacer", id : "formel", ht : 10, ln : false},{ tp : "Button", id : "formelbt", tx : tmp8, ac : $bind(this,this.setElement)}]);
		this.ui.createHContainer("elements");
		this.ui.createButton("elementadd",com_tilbuci_data_Global.ln.get("window-contrinterf-eladd"),$bind(this,this.onElAdd),this.ui.hcontainers.h["elements"]);
		this.ui.createButton("elementrem",com_tilbuci_data_Global.ln.get("window-contrinterf-elrem"),$bind(this,this.onElRem),this.ui.hcontainers.h["elements"]);
		var tmp = com_tilbuci_data_Global.ln.get("window-kfmanage-title");
		var tmp1 = this.ui;
		var tmp2 = this.ui;
		var tmp3 = { tp : "Label", id : "registered", tx : com_tilbuci_data_Global.ln.get("window-contrinterf-registered"), vr : ""};
		var tmp4 = { tp : "Button", id : "load", tx : com_tilbuci_data_Global.ln.get("window-contrinterf-load"), ac : $bind(this,this.loadContr)};
		var tmp5 = { tp : "Button", id : "remove", tx : com_tilbuci_data_Global.ln.get("window-contrinterf-remove"), ac : $bind(this,this.removeContr)};
		var tmp6 = { tp : "Label", id : "name", tx : com_tilbuci_data_Global.ln.get("window-contrinterf-name"), vr : "detail"};
		var tmp7 = { tp : "Label", id : "elements", tx : com_tilbuci_data_Global.ln.get("window-contrinterf-elements"), vr : "detail"};
		var tmp8 = { tp : "Custom", cont : this.ui.hcontainers.h["elements"]};
		var tmp9 = com_tilbuci_data_Global.ln.get("window-contrinterf-add");
		this.addForm(tmp,tmp1.createColumnHolder("columns",tmp2.forge("leftcol",[tmp3,{ tp : "List", id : "registered", vl : [], sl : null, ht : 150},tmp4,tmp5,{ tp : "Spacer", id : "add", ht : 15, ln : true},tmp6,{ tp : "TInput", id : "name", tx : "", vr : ""},tmp7,{ tp : "List", id : "elements", vl : [], sl : null, ht : 190, ch : $bind(this,this.onElLoad)},tmp8,{ tp : "Button", id : "add", tx : tmp9, ac : $bind(this,this.addContr)}]),this.ui.forge("rightcol",[]),this.ui.forge("bottom",[{ tp : "Button", id : "save", tx : com_tilbuci_data_Global.ln.get("window-contrinterf-save"), ac : $bind(this,this.saveContr)}]),620));
		this.ui.listDbClick("registered",$bind(this,this.loadContr));
		com_tilbuci_ui_window_PopupWindow.prototype.startInterface.call(this);
	}
	,acStart: function() {
		var h = this._list.h;
		var cont_h = h;
		var cont_keys = Object.keys(h);
		var cont_length = cont_keys.length;
		var cont_current = 0;
		while(cont_current < cont_length) {
			var cont = cont_keys[cont_current++];
			this._list.h[cont].kill();
			var _this = this._list;
			if(Object.prototype.hasOwnProperty.call(_this.h,cont)) {
				delete(_this.h[cont]);
			}
		}
		var h = com_tilbuci_data_GlobalPlayer.contraptions.interf.h;
		var contk_h = h;
		var contk_keys = Object.keys(h);
		var contk_length = contk_keys.length;
		var contk_current = 0;
		while(contk_current < contk_length) {
			var contk = contk_h[contk_keys[contk_current++]];
			var this1 = this._list;
			var k = contk.id;
			var v = contk.clone();
			this1.h[k] = v;
		}
		this.clear();
		this.ui.hcontainers.h["elements"].setWidth(460);
		this.clearElements();
		var fnts = [];
		var _g = 0;
		var _g1 = com_tilbuci_data_Global.fonts.length;
		while(_g < _g1) {
			var n = _g++;
			fnts.push({ text : com_tilbuci_data_Global.fonts[n], value : com_tilbuci_data_Global.fonts[n]});
		}
		var _g = 0;
		var _g1 = com_tilbuci_data_GlobalPlayer.mdata.fonts;
		while(_g < _g1.length) {
			var i = _g1[_g];
			++_g;
			fnts.push({ text : i.name, value : i.name});
		}
		this.ui.setSelectOptions("txfont",fnts);
	}
	,clearElements: function() {
		var list = [];
		list.push({ text : com_tilbuci_data_Global.ln.get("window-contrinterf-namebg"), value : { type : "background", file : "", action : "", x : 0, y : 0, options : "", rot : 0, alpha : 100}});
		list.push({ text : com_tilbuci_data_Global.ln.get("window-contrinterf-nameanim"), value : { type : "spritemap", file : "", action : "", x : 0, y : 0, options : "", rot : 0, alpha : 100}});
		list.push({ text : com_tilbuci_data_Global.ln.get("window-contrinterf-nametx"), value : { type : "text", file : "", action : "", x : 0, y : 0, options : "", rot : 0, alpha : 100}});
		this.ui.setListValues("elements",list);
		this.ui.setListSelectValue("elements",null);
	}
	,redrawElementsList: function() {
		var list = [];
		var el = this.ui.lists.h["elements"].get_dataProvider().iterator();
		while(el.hasNext()) {
			var el1 = el.next();
			list.push({ text : el1.text, value : el1.value});
		}
		this.ui.setListValues("elements",list);
		this.ui.setListSelectValue("elements",null);
		this.ui.containers.h["rightcol"].removeChildren();
	}
	,clear: function() {
		var list = [];
		var h = this._list.h;
		var cont_h = h;
		var cont_keys = Object.keys(h);
		var cont_length = cont_keys.length;
		var cont_current = 0;
		while(cont_current < cont_length) {
			var cont = cont_h[cont_keys[cont_current++]];
			list.push({ text : cont.id, value : cont});
		}
		this.ui.setListValues("registered",list);
		this.ui.setListSelectValue("registered",null);
		this.ui.inputs.h["name"].set_text("");
		this.clearElements();
	}
	,loadContr: function(evt) {
		if(this.ui.lists.h["registered"].get_selectedItem() != null) {
			var this1 = this._list;
			var key = this.ui.lists.h["registered"].get_selectedItem().text;
			if(Object.prototype.hasOwnProperty.call(this1.h,key)) {
				this.ui.inputs.h["name"].set_text(this.ui.lists.h["registered"].get_selectedItem().text);
				var list = [];
				var cont = this.ui.lists.h["registered"].get_selectedItem().value;
				var _g = 0;
				var _g1 = cont.elem;
				while(_g < _g1.length) {
					var el = _g1[_g];
					++_g;
					var elname = "";
					switch(el.type) {
					case "background":
						elname = com_tilbuci_data_Global.ln.get("window-contrinterf-namebg");
						break;
					case "spritemap":
						elname = com_tilbuci_data_Global.ln.get("window-contrinterf-nameanim");
						break;
					case "text":
						elname = com_tilbuci_data_Global.ln.get("window-contrinterf-nametx");
						break;
					default:
						elname = com_tilbuci_data_Global.ln.get("window-contrinterf-namebutton");
					}
					list.push({ text : elname, value : el});
				}
				this.ui.setListValues("elements",list);
				this.ui.setListSelectValue("elements",null);
				this.ui.containers.h["rightcol"].removeChildren();
			}
		}
	}
	,action: function(ac,data) {
		switch(ac) {
		case "intanim":
			this.ui.inputs.h["spritemap"].set_text(data.h["file"]);
			this._lastframes = Std.parseInt(data.h["frames"]);
			this._lastfrtime = Std.parseInt(data.h["frtime"]);
			break;
		case "intbackground":
			this.ui.inputs.h["background"].set_text(data.h["file"]);
			break;
		case "intimage":
			this.ui.inputs.h["formel"].set_text(data.h["file"]);
			break;
		}
	}
	,removeContr: function(evt) {
		if(this.ui.lists.h["registered"].get_selectedItem() != null) {
			var this1 = this._list;
			var key = this.ui.lists.h["registered"].get_selectedItem().text;
			if(Object.prototype.hasOwnProperty.call(this1.h,key)) {
				var this1 = this._list;
				var key = this.ui.lists.h["registered"].get_selectedItem().text;
				this1.h[key].kill();
				var this1 = this._list;
				var key = this.ui.lists.h["registered"].get_selectedItem().text;
				var _this = this1;
				if(Object.prototype.hasOwnProperty.call(_this.h,key)) {
					delete(_this.h[key]);
				}
				this.clear();
			}
		}
	}
	,saveContr: function(evt) {
		var h = com_tilbuci_data_GlobalPlayer.contraptions.forms.h;
		var cont_h = h;
		var cont_keys = Object.keys(h);
		var cont_length = cont_keys.length;
		var cont_current = 0;
		while(cont_current < cont_length) {
			var cont = cont_keys[cont_current++];
			com_tilbuci_data_GlobalPlayer.contraptions.forms.h[cont].kill();
			var _this = com_tilbuci_data_GlobalPlayer.contraptions.forms;
			if(Object.prototype.hasOwnProperty.call(_this.h,cont)) {
				delete(_this.h[cont]);
			}
		}
		var h = this._list.h;
		var cont_h = h;
		var cont_keys = Object.keys(h);
		var cont_length = cont_keys.length;
		var cont_current = 0;
		while(cont_current < cont_length) {
			var cont = cont_keys[cont_current++];
			var this1 = com_tilbuci_data_GlobalPlayer.contraptions.interf;
			var v = this._list.h[cont].clone();
			this1.h[cont] = v;
		}
		this.clear();
		var tmp = com_tilbuci_data_Global.ws;
		var _g = new haxe_ds_StringMap();
		var value = com_tilbuci_data_GlobalPlayer.movie.get_mvId();
		_g.h["movie"] = value;
		var value = com_tilbuci_data_GlobalPlayer.contraptions.getData();
		_g.h["data"] = value;
		tmp.send("Movie/SaveContraptions",_g,$bind(this,this.onSaveReturn));
	}
	,addContr: function(evt) {
		if(this.ui.inputs.h["name"].get_text().length > 3) {
			var okbt = true;
			var list = [];
			var el = this.ui.lists.h["elements"].get_dataProvider().iterator();
			while(el.hasNext()) {
				var el1 = el.next();
				list.push(el1.value);
			}
			var contr;
			var this1 = this._list;
			var key = this.ui.inputs.h["name"].get_text();
			if(Object.prototype.hasOwnProperty.call(this1.h,key)) {
				var this1 = this._list;
				var key = this.ui.inputs.h["name"].get_text();
				contr = this1.h[key];
			} else {
				contr = new com_tilbuci_contraptions_InterfaceContraption();
			}
			if(contr.load({ id : this.ui.inputs.h["name"].get_text(), elem : list})) {
				var this1 = this._list;
				var k = this.ui.inputs.h["name"].get_text();
				this1.h[k] = contr;
				this.ui.inputs.h["name"].set_text("");
				this.clear();
			}
		} else {
			com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("window-contrinterf-title"),com_tilbuci_data_Global.ln.get("window-contrinterf-noname"),320,150,com_tilbuci_data_Global.ln.get("default-ok"));
		}
	}
	,acBackground: function(evt) {
		this._ac("intbackground");
	}
	,acBackgrounddel: function(evt) {
		this.ui.inputs.h["background"].set_text("");
	}
	,acBtsm: function(evt) {
		this._ac("intanim");
	}
	,acBtsmdel: function(evt) {
		this.ui.inputs.h["spritemap"].set_text("");
	}
	,acElem: function(evt) {
		this._ac("intimage");
	}
	,acElemdel: function(evt) {
		this.ui.inputs.h["formel"].set_text("");
	}
	,onElAdd: function(evt) {
		var list = [];
		var el = this.ui.lists.h["elements"].get_dataProvider().iterator();
		while(el.hasNext()) {
			var el1 = el.next();
			list.push({ text : el1.text, value : el1.value});
		}
		list.push({ text : com_tilbuci_data_Global.ln.get("window-contrinterf-namebutton"), value : { type : "", file : "", action : "", x : 0, y : 0, rot : 0, alpha : 100, options : ""}});
		this.ui.setListValues("elements",list);
		this.ui.setListSelectValue("elements",null);
		this.ui.containers.h["rightcol"].removeChildren();
	}
	,onElLoad: function(evt) {
		if(this.ui.lists.h["elements"].get_selectedItem() != null) {
			this.ui.containers.h["rightcol"].removeChildren();
			switch(this.ui.lists.h["elements"].get_selectedItem().value.type) {
			case "background":
				this.ui.containers.h["rightcol"].addChild(this.ui.containers.h["background"]);
				this.ui.labels.h["backgroundset"].set_width(this.ui.buttons.h["backgroundset"].set_width(450));
				this.ui.inputs.h["background"].set_text(this.ui.lists.h["elements"].get_selectedItem().value.file);
				break;
			case "spritemap":
				this.ui.containers.h["rightcol"].addChild(this.ui.containers.h["spritemap"]);
				this.ui.labels.h["formelsmpos"].set_width(this.ui.labels.h["spritemap"].set_width(this.ui.labels.h["smaction"].set_width(this.ui.inputs.h["smaction"].set_width(this.ui.buttons.h["btsmset"].set_width(450)))));
				this.ui.hcontainers.h["formelsmpos"].setWidth(450,[60,145,60,145]);
				this.ui.inputs.h["spritemap"].set_text(this.ui.lists.h["elements"].get_selectedItem().value.file);
				this.ui.inputs.h["smaction"].set_text(this.ui.lists.h["elements"].get_selectedItem().value.action);
				this.ui.numerics.h["formelsmposx"].set_value(this.ui.lists.h["elements"].get_selectedItem().value.x);
				this.ui.numerics.h["formelsmposy"].set_value(this.ui.lists.h["elements"].get_selectedItem().value.y);
				if(this.ui.lists.h["elements"].get_selectedItem().value.options != "") {
					var opt = this.ui.lists.h["elements"].get_selectedItem().value.options.split(";");
					if(opt.length == 2) {
						this._lastframes = Std.parseInt(opt[0]);
						this._lastfrtime = Std.parseInt(opt[1]);
					}
				}
				break;
			case "text":
				this.ui.containers.h["rightcol"].addChild(this.ui.containers.h["txset"]);
				this.ui.labels.h["formeltxpos"].set_width(this.ui.labels.h["txset"].set_width(this.ui.buttons.h["txset"].set_width(450)));
				this.ui.hcontainers.h["formeltxpos"].setWidth(450,[60,145,60,145]);
				this.ui.numerics.h["formeltxposx"].set_value(this.ui.lists.h["elements"].get_selectedItem().value.x);
				this.ui.numerics.h["formeltxposy"].set_value(this.ui.lists.h["elements"].get_selectedItem().value.y);
				this.ui.labels.h["txuse"].set_width(this.ui.labels.h["txfont"].set_width(this.ui.selects.h["txfont"].set_width(450)));
				this.ui.labels.h["txsize"].set_width(this.ui.numerics.h["txsize"].set_width(450));
				this.ui.labels.h["txcolor"].set_width(this.ui.inputs.h["txcolor"].set_width(450));
				this.ui.labels.h["txalign"].set_width(this.ui.selects.h["txalign"].set_width(450));
				this.ui.labels.h["txdeco"].set_width(this.ui.selects.h["txdeco"].set_width(450));
				this.ui.labels.h["txwidth"].set_width(this.ui.numerics.h["txwidth"].set_width(450));
				this.ui.toggles.h["txuse"].set_selected(false);
				if(this.ui.lists.h["elements"].get_selectedItem().value.options != "") {
					var opt = this.ui.lists.h["elements"].get_selectedItem().value.options.split(";");
					if(opt.length == 7) {
						this.ui.toggles.h["txuse"].set_selected(true);
						this.ui.numerics.h["txwidth"].set_value(Std.parseInt(opt[0]));
						this.ui.setSelectValue("txfont",opt[1]);
						this.ui.numerics.h["txsize"].set_value(Std.parseInt(opt[2]));
						this.ui.inputs.h["txcolor"].set_text(opt[3]);
						if(opt[4] == "true" && opt[5] == "true") {
							this.ui.setSelectValue("txdeco","bolditalic");
						} else if(opt[4] == "true") {
							this.ui.setSelectValue("txdeco","bold");
						} else if(opt[5] == "true") {
							this.ui.setSelectValue("txdeco","italic");
						} else {
							this.ui.setSelectValue("txdeco","normal");
						}
						this.ui.setSelectValue("txalign",opt[6]);
					}
				}
				break;
			default:
				this.ui.containers.h["rightcol"].addChild(this.ui.containers.h["formel"]);
				this.ui.hcontainers.h["formelpos"].setWidth(450,[60,145,60,145]);
				this.ui.numerics.h["formelposx"].set_value(this.ui.lists.h["elements"].get_selectedItem().value.x);
				this.ui.numerics.h["formelposy"].set_value(this.ui.lists.h["elements"].get_selectedItem().value.y);
				this.ui.labels.h["btset"].set_width(this.ui.labels.h["formelac"].set_width(this.ui.inputs.h["formelac"].set_width(450)));
				this.ui.labels.h["formelposition"].set_width(this.ui.buttons.h["formelbt"].set_width(450));
				this.ui.labels.h["formelrotation"].set_width(this.ui.labels.h["formelalpha"].set_width(this.ui.numerics.h["formelrotation"].set_width(this.ui.numerics.h["formelalpha"].set_width(450))));
				this.ui.inputs.h["formel"].set_text(this.ui.lists.h["elements"].get_selectedItem().value.file);
				this.ui.inputs.h["formelac"].set_text(this.ui.lists.h["elements"].get_selectedItem().value.action);
				this.ui.numerics.h["formelposx"].set_value(this.ui.lists.h["elements"].get_selectedItem().value.x);
				this.ui.numerics.h["formelposy"].set_value(this.ui.lists.h["elements"].get_selectedItem().value.y);
				if(this.ui.lists.h["elements"].get_selectedItem().value.rot == null) {
					this.ui.numerics.h["formelrotation"].set_value(0);
				} else {
					this.ui.numerics.h["formelrotation"].set_value(this.ui.lists.h["elements"].get_selectedItem().value.rot);
				}
				if(this.ui.lists.h["elements"].get_selectedItem().value.alpha == null) {
					this.ui.numerics.h["formelalpha"].set_value(100);
				} else {
					this.ui.numerics.h["formelalpha"].set_value(this.ui.lists.h["elements"].get_selectedItem().value.alpha);
				}
			}
		}
	}
	,onElRem: function(evt) {
		if(this.ui.lists.h["elements"].get_selectedItem() != null) {
			switch(this.ui.lists.h["elements"].get_selectedItem().value.type) {
			case "background":
				break;
			case "spritemap":
				break;
			case "text":
				break;
			default:
				var list = [];
				var _g = 0;
				var _g1 = this.ui.lists.h["elements"].get_dataProvider().get_length();
				while(_g < _g1) {
					var i = _g++;
					if(i != this.ui.lists.h["elements"].get_selectedIndex()) {
						var el = this.ui.lists.h["elements"].get_dataProvider().get(i);
						list.push({ text : el.text, value : el.value});
					}
				}
				this.ui.setListValues("elements",list);
				this.ui.setListSelectValue("elements",null);
				this.ui.containers.h["rightcol"].removeChildren();
			}
		}
	}
	,setElement: function(evt) {
		if(this.ui.lists.h["elements"].get_selectedItem() != null) {
			switch(this.ui.lists.h["elements"].get_selectedItem().value.type) {
			case "background":
				var tmp = this.ui.inputs.h["background"];
				this.ui.lists.h["elements"].get_selectedItem().value.file = tmp.get_text();
				this.redrawElementsList();
				break;
			case "spritemap":
				var tmp = this.ui.inputs.h["spritemap"];
				this.ui.lists.h["elements"].get_selectedItem().value.file = tmp.get_text();
				var tmp = this._lastframes + ";";
				this.ui.lists.h["elements"].get_selectedItem().value.options = tmp + this._lastfrtime;
				var tmp = this.ui.inputs.h["smaction"];
				this.ui.lists.h["elements"].get_selectedItem().value.action = tmp.get_text();
				var tmp = this.ui.lists.h["elements"];
				var tmp1 = this.ui.numerics.h["formelsmposx"].get_value();
				tmp.get_selectedItem().value.x = Math.round(tmp1);
				var tmp = this.ui.lists.h["elements"];
				var tmp1 = this.ui.numerics.h["formelsmposy"].get_value();
				tmp.get_selectedItem().value.y = Math.round(tmp1);
				this.redrawElementsList();
				break;
			case "text":
				if(this.ui.toggles.h["txuse"].get_selected()) {
					var opt = [];
					opt.push(Std.string(this.ui.numerics.h["txwidth"].get_value()));
					opt.push(this.ui.selects.h["txfont"].get_selectedItem().value);
					opt.push(Std.string(this.ui.numerics.h["txsize"].get_value()));
					opt.push(com_tilbuci_statictools_StringStatic.colorHex(this.ui.inputs.h["txcolor"].get_text()));
					switch(this.ui.selects.h["txdeco"].get_selectedItem().value) {
					case "bold":
						opt.push("true");
						opt.push("false");
						break;
					case "bolditalic":
						opt.push("true");
						opt.push("true");
						break;
					case "italic":
						opt.push("false");
						opt.push("true");
						break;
					default:
						opt.push("false");
						opt.push("false");
					}
					opt.push(this.ui.selects.h["txalign"].get_selectedItem().value);
					this.ui.lists.h["elements"].get_selectedItem().value.options = opt.join(";");
				} else {
					this.ui.lists.h["elements"].get_selectedItem().value.options = "";
				}
				var tmp = this.ui.lists.h["elements"];
				var tmp1 = this.ui.numerics.h["formeltxposx"].get_value();
				tmp.get_selectedItem().value.x = Math.round(tmp1);
				var tmp = this.ui.lists.h["elements"];
				var tmp1 = this.ui.numerics.h["formeltxposy"].get_value();
				tmp.get_selectedItem().value.y = Math.round(tmp1);
				this.redrawElementsList();
				break;
			default:
				var tmp = this.ui.inputs.h["formel"];
				this.ui.lists.h["elements"].get_selectedItem().value.file = tmp.get_text();
				var tmp = this.ui.inputs.h["formelac"];
				this.ui.lists.h["elements"].get_selectedItem().value.action = tmp.get_text();
				var tmp = this.ui.lists.h["elements"];
				var tmp1 = this.ui.numerics.h["formelposx"].get_value();
				tmp.get_selectedItem().value.x = Math.round(tmp1);
				var tmp = this.ui.lists.h["elements"];
				var tmp1 = this.ui.numerics.h["formelposy"].get_value();
				tmp.get_selectedItem().value.y = Math.round(tmp1);
				var tmp = this.ui.lists.h["elements"];
				var tmp1 = this.ui.numerics.h["formelrotation"].get_value();
				tmp.get_selectedItem().value.rot = Math.round(tmp1);
				var tmp = this.ui.lists.h["elements"];
				var tmp1 = this.ui.numerics.h["formelalpha"].get_value();
				tmp.get_selectedItem().value.alpha = Math.round(tmp1);
				this.redrawElementsList();
			}
		}
	}
	,onSaveReturn: function(ok,ld) {
		if(ok) {
			if(ld.map.h["e"] == 1) {
				com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("window-contrinterf-title"),com_tilbuci_data_Global.ln.get("window-contrinterf-ersave1"),320,150,com_tilbuci_data_Global.ln.get("default-ok"));
			} else if(ld.map.h["e"] == 2) {
				com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("window-contrinterf-title"),com_tilbuci_data_Global.ln.get("window-contrinterf-ersave"),320,150,com_tilbuci_data_Global.ln.get("default-ok"));
			} else {
				com_tilbuci_data_Global.showMsg(com_tilbuci_data_Global.ln.get("window-contrinterf-oksave"));
				feathers_core_PopUpManager.removePopUp(this);
			}
		} else {
			com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("window-contrinterf-title"),com_tilbuci_data_Global.ln.get("window-contrinterf-ersave"),320,150,com_tilbuci_data_Global.ln.get("default-ok"));
		}
	}
	,__class__: com_tilbuci_ui_window_contraptions_WindowContrInterf
});
var com_tilbuci_ui_window_contraptions_WindowContrMenu = function(ac) {
	this._list = new haxe_ds_StringMap();
	com_tilbuci_ui_window_PopupWindow.call(this,ac,com_tilbuci_data_Global.ln.get("window-contrmenu-title"),1000,com_tilbuci_ui_base_InterfaceFactory.pickValue(560,580),false,true,true);
};
$hxClasses["com.tilbuci.ui.window.contraptions.WindowContrMenu"] = com_tilbuci_ui_window_contraptions_WindowContrMenu;
com_tilbuci_ui_window_contraptions_WindowContrMenu.__name__ = "com.tilbuci.ui.window.contraptions.WindowContrMenu";
com_tilbuci_ui_window_contraptions_WindowContrMenu.__super__ = com_tilbuci_ui_window_PopupWindow;
com_tilbuci_ui_window_contraptions_WindowContrMenu.prototype = $extend(com_tilbuci_ui_window_PopupWindow.prototype,{
	_list: null
	,startInterface: function(evt) {
		this.ui.createHContainer("imgbg");
		this.ui.createTInput("imgbg","","",this.ui.hcontainers.h["imgbg"],false);
		var tmp = this.ui;
		var tmp1 = openfl_utils_Assets.getBitmapData("btOpenfile");
		var tmp2 = this.ui.hcontainers.h["imgbg"];
		tmp.createIconButton("imgbg",$bind(this,this.acImgbg),new openfl_display_Bitmap(tmp1),null,tmp2,false);
		var tmp = this.ui;
		var tmp1 = openfl_utils_Assets.getBitmapData("btDel");
		var tmp2 = this.ui.hcontainers.h["imgbg"];
		tmp.createIconButton("imgbgdel",$bind(this,this.acImgbgdel),new openfl_display_Bitmap(tmp1),null,tmp2,false);
		this.ui.inputs.h["imgbg"].set_enabled(false);
		this.ui.hcontainers.h["imgbg"].setWidth(460,[350,50,50]);
		this.ui.createHContainer("imgbt");
		this.ui.createTInput("imgbt","","",this.ui.hcontainers.h["imgbt"],false);
		var tmp = this.ui;
		var tmp1 = openfl_utils_Assets.getBitmapData("btOpenfile");
		var tmp2 = this.ui.hcontainers.h["imgbt"];
		tmp.createIconButton("imgbt",$bind(this,this.acImgbt),new openfl_display_Bitmap(tmp1),null,tmp2,false);
		var tmp = this.ui;
		var tmp1 = openfl_utils_Assets.getBitmapData("btDel");
		var tmp2 = this.ui.hcontainers.h["imgbt"];
		tmp.createIconButton("imgimgbtdel",$bind(this,this.acImgbtdel),new openfl_display_Bitmap(tmp1),null,tmp2,false);
		this.ui.inputs.h["imgbt"].set_enabled(false);
		this.ui.hcontainers.h["imgbt"].setWidth(460,[350,50,50]);
		var tmp = com_tilbuci_data_Global.ln.get("window-kfmanage-title");
		var tmp1 = this.ui;
		var tmp2 = this.ui;
		var tmp3 = { tp : "Label", id : "registered", tx : com_tilbuci_data_Global.ln.get("window-contrmenu-registered"), vr : ""};
		var tmp4 = { tp : "Button", id : "load", tx : com_tilbuci_data_Global.ln.get("window-contrmenu-load"), ac : $bind(this,this.loadMenu)};
		var tmp5 = { tp : "Button", id : "remove", tx : com_tilbuci_data_Global.ln.get("window-contrmenu-remove"), ac : $bind(this,this.removeMenu)};
		var tmp6 = { tp : "Label", id : "name", tx : com_tilbuci_data_Global.ln.get("window-contrmenu-name"), vr : "detail"};
		var tmp7 = com_tilbuci_data_Global.ln.get("window-contrmenu-add");
		var tmp8 = tmp2.forge("leftcol",[tmp3,{ tp : "List", id : "registered", vl : [], sl : null, ht : 200},tmp4,tmp5,{ tp : "Spacer", id : "add", ht : 15, ln : true},tmp6,{ tp : "TInput", id : "name", tx : "", vr : ""},{ tp : "Button", id : "add", tx : tmp7, ac : $bind(this,this.addMenu)}]);
		var tmp2 = this.ui;
		var tmp3 = { tp : "Label", id : "properties", tx : com_tilbuci_data_Global.ln.get("window-contrmenu-properties"), vr : ""};
		var tmp4 = { tp : "Label", id : "font", tx : com_tilbuci_data_Global.ln.get("window-contrmenu-font"), vr : "detail"};
		var tmp5 = { tp : "Label", id : "fontsize", tx : com_tilbuci_data_Global.ln.get("window-contrmenu-fontsize"), vr : "detail"};
		var tmp6 = { tp : "Label", id : "fontc", tx : com_tilbuci_data_Global.ln.get("window-contrmenu-fontc"), vr : "detail"};
		var tmp7 = { tp : "Label", id : "cover", tx : com_tilbuci_data_Global.ln.get("window-contrmenu-cover"), vr : "detail"};
		var tmp9 = { tp : "Label", id : "coveralpha", tx : com_tilbuci_data_Global.ln.get("window-contrmenu-coveralpha"), vr : "detail"};
		var tmp10 = { tp : "Label", id : "imgbg", tx : com_tilbuci_data_Global.ln.get("window-contrmenu-imgbg"), vr : "detail"};
		var tmp11 = { tp : "Custom", cont : this.ui.hcontainers.h["imgbg"]};
		var tmp12 = com_tilbuci_data_Global.ln.get("window-contrmenu-imgbt");
		this.addForm(tmp,tmp1.createColumnHolder("columns",tmp8,tmp2.forge("rightcol",[tmp3,tmp4,{ tp : "Select", id : "font", vl : [], sl : null},tmp5,{ tp : "Numeric", id : "fontsize", mn : 8, mx : 200, st : 1, vl : 0},tmp6,{ tp : "TInput", id : "fontc", tx : "", vr : ""},tmp7,{ tp : "TInput", id : "cover", tx : "", vr : ""},tmp9,{ tp : "Numeric", id : "coveralpha", mn : 0, mx : 100, st : 1, vl : 0},tmp10,tmp11,{ tp : "Label", id : "imgbt", tx : tmp12, vr : "detail"},{ tp : "Custom", cont : this.ui.hcontainers.h["imgbt"]}]),this.ui.forge("bottom",[{ tp : "Button", id : "save", tx : com_tilbuci_data_Global.ln.get("window-contrmenu-save"), ac : $bind(this,this.saveMenu)}]),450));
		this.ui.listDbClick("registered",$bind(this,this.loadMenu));
		com_tilbuci_ui_window_PopupWindow.prototype.startInterface.call(this);
	}
	,acStart: function() {
		var h = this._list.h;
		var mnk_h = h;
		var mnk_keys = Object.keys(h);
		var mnk_length = mnk_keys.length;
		var mnk_current = 0;
		while(mnk_current < mnk_length) {
			var mnk = mnk_keys[mnk_current++];
			this._list.h[mnk].kill();
			var _this = this._list;
			if(Object.prototype.hasOwnProperty.call(_this.h,mnk)) {
				delete(_this.h[mnk]);
			}
		}
		var h = com_tilbuci_data_GlobalPlayer.contraptions.menus.h;
		var mn_h = h;
		var mn_keys = Object.keys(h);
		var mn_length = mn_keys.length;
		var mn_current = 0;
		while(mn_current < mn_length) {
			var mn = mn_h[mn_keys[mn_current++]];
			var this1 = this._list;
			var k = mn.id;
			var v = mn.clone();
			this1.h[k] = v;
		}
		this.clear();
	}
	,clear: function() {
		this.ui.inputs.h["fontc"].set_text("#FFFFFF");
		this.ui.inputs.h["cover"].set_text("#000000");
		var list = [];
		var h = this._list.h;
		var mn_h = h;
		var mn_keys = Object.keys(h);
		var mn_length = mn_keys.length;
		var mn_current = 0;
		while(mn_current < mn_length) {
			var mn = mn_h[mn_keys[mn_current++]];
			list.push({ text : mn.id, value : mn.id});
		}
		this.ui.setListValues("registered",list);
		this.ui.setListSelectValue("registered",null);
		this.ui.inputs.h["name"].set_text("");
		var fnts = [];
		var _g = 0;
		var _g1 = com_tilbuci_data_Global.fonts.length;
		while(_g < _g1) {
			var n = _g++;
			fnts.push({ text : com_tilbuci_data_Global.fonts[n], value : com_tilbuci_data_Global.fonts[n]});
		}
		var _g = 0;
		var _g1 = com_tilbuci_data_GlobalPlayer.mdata.fonts;
		while(_g < _g1.length) {
			var i = _g1[_g];
			++_g;
			fnts.push({ text : i.name, value : i.name});
		}
		this.ui.setSelectOptions("font",fnts);
		this.ui.setSelectValue("font",null);
		this.ui.numerics.h["coveralpha"].set_value(0);
		this.ui.numerics.h["fontsize"].set_value(20);
		this.ui.inputs.h["imgbg"].set_text("");
		this.ui.inputs.h["imgbt"].set_text("");
	}
	,loadMenu: function(evt) {
		if(this.ui.lists.h["registered"].get_selectedItem() != null) {
			var this1 = this._list;
			var key = this.ui.lists.h["registered"].get_selectedItem().value;
			if(Object.prototype.hasOwnProperty.call(this1.h,key)) {
				var tmp = this.ui.inputs.h["name"];
				var this1 = this._list;
				var key = this.ui.lists.h["registered"].get_selectedItem().value;
				tmp.set_text(this1.h[key].id);
				var tmp = this.ui.inputs.h["fontc"];
				var this1 = this._list;
				var key = this.ui.lists.h["registered"].get_selectedItem().value;
				tmp.set_text(this1.h[key].fontcolor);
				var tmp = this.ui.inputs.h["cover"];
				var this1 = this._list;
				var key = this.ui.lists.h["registered"].get_selectedItem().value;
				tmp.set_text(this1.h[key].bgcolor);
				var tmp = this.ui;
				var this1 = this._list;
				var key = this.ui.lists.h["registered"].get_selectedItem().value;
				tmp.setSelectValue("font",this1.h[key].font);
				var tmp = this.ui.numerics.h["coveralpha"];
				var this1 = this._list;
				var key = this.ui.lists.h["registered"].get_selectedItem().value;
				tmp.set_value(Math.round(this1.h[key].bgalpha * 100));
				var tmp = this.ui.numerics.h["fontsize"];
				var this1 = this._list;
				var key = this.ui.lists.h["registered"].get_selectedItem().value;
				tmp.set_value(Math.round(this1.h[key].fontsize));
				var tmp = this.ui.inputs.h["imgbg"];
				var this1 = this._list;
				var key = this.ui.lists.h["registered"].get_selectedItem().value;
				tmp.set_text(this1.h[key].background);
				var tmp = this.ui.inputs.h["imgbt"];
				var this1 = this._list;
				var key = this.ui.lists.h["registered"].get_selectedItem().value;
				tmp.set_text(this1.h[key].buton);
			}
		}
	}
	,action: function(ac,data) {
		switch(ac) {
		case "menubrowseimgbg":
			this.ui.inputs.h["imgbg"].set_text(data.h["file"]);
			break;
		case "menubrowseimgbt":
			this.ui.inputs.h["imgbt"].set_text(data.h["file"]);
			break;
		}
	}
	,removeMenu: function(evt) {
		if(this.ui.lists.h["registered"].get_selectedItem() != null) {
			var this1 = this._list;
			var key = this.ui.lists.h["registered"].get_selectedItem().value;
			if(Object.prototype.hasOwnProperty.call(this1.h,key)) {
				var this1 = this._list;
				var key = this.ui.lists.h["registered"].get_selectedItem().value;
				this1.h[key].kill();
				var this1 = this._list;
				var key = this.ui.lists.h["registered"].get_selectedItem().value;
				var _this = this1;
				if(Object.prototype.hasOwnProperty.call(_this.h,key)) {
					delete(_this.h[key]);
				}
				this.clear();
			}
		}
	}
	,saveMenu: function(evt) {
		var h = com_tilbuci_data_GlobalPlayer.contraptions.menus.h;
		var mn_h = h;
		var mn_keys = Object.keys(h);
		var mn_length = mn_keys.length;
		var mn_current = 0;
		while(mn_current < mn_length) {
			var mn = mn_keys[mn_current++];
			com_tilbuci_data_GlobalPlayer.contraptions.menus.h[mn].kill();
			var _this = com_tilbuci_data_GlobalPlayer.contraptions.menus;
			if(Object.prototype.hasOwnProperty.call(_this.h,mn)) {
				delete(_this.h[mn]);
			}
		}
		var h = this._list.h;
		var mn_h = h;
		var mn_keys = Object.keys(h);
		var mn_length = mn_keys.length;
		var mn_current = 0;
		while(mn_current < mn_length) {
			var mn = mn_keys[mn_current++];
			var this1 = com_tilbuci_data_GlobalPlayer.contraptions.menus;
			var v = this._list.h[mn].clone();
			this1.h[mn] = v;
		}
		this.clear();
		var tmp = com_tilbuci_data_Global.ws;
		var _g = new haxe_ds_StringMap();
		var value = com_tilbuci_data_GlobalPlayer.movie.get_mvId();
		_g.h["movie"] = value;
		var value = com_tilbuci_data_GlobalPlayer.contraptions.getData();
		_g.h["data"] = value;
		tmp.send("Movie/SaveContraptions",_g,$bind(this,this.onSaveReturn));
	}
	,addMenu: function(evt) {
		if(this.ui.inputs.h["name"].get_text().length > 3) {
			if(this.ui.inputs.h["imgbg"].get_text() == "" || this.ui.inputs.h["imgbt"].get_text() == "") {
				com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("window-contrmenu-title"),com_tilbuci_data_Global.ln.get("window-contrmenu-nographics"),320,150,com_tilbuci_data_Global.ln.get("default-ok"));
			} else {
				var mn;
				var this1 = this._list;
				var key = this.ui.inputs.h["name"].get_text();
				if(Object.prototype.hasOwnProperty.call(this1.h,key)) {
					var this1 = this._list;
					var key = this.ui.inputs.h["name"].get_text();
					mn = this1.h[key];
				} else {
					mn = new com_tilbuci_contraptions_MenuContraption();
				}
				mn.load({ id : this.ui.inputs.h["name"].get_text(), mode : "v", font : this.ui.selects.h["font"].get_selectedItem().value, fontcolor : com_tilbuci_statictools_StringStatic.colorHex(this.ui.inputs.h["fontc"].get_text(),"#FFFFFF"), fontsize : this.ui.numerics.h["fontsize"].get_value(), background : this.ui.inputs.h["imgbg"].get_text(), buton : this.ui.inputs.h["imgbt"].get_text(), bgcolor : com_tilbuci_statictools_StringStatic.colorHex(this.ui.inputs.h["cover"].get_text(),"#000000"), bgalpha : this.ui.numerics.h["coveralpha"].get_value() / 100});
				if(mn.bgalpha < 0) {
					mn.bgalpha = 0;
				}
				if(mn.bgalpha > 1) {
					mn.bgalpha = 1;
				}
				var this1 = this._list;
				var k = this.ui.inputs.h["name"].get_text();
				this1.h[k] = mn;
				this.clear();
			}
		} else {
			com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("window-contrmenu-title"),com_tilbuci_data_Global.ln.get("window-contrmenu-noname"),320,150,com_tilbuci_data_Global.ln.get("default-ok"));
		}
	}
	,acImgbg: function(evt) {
		this._ac("menubrowseimgbg");
	}
	,acImgbgdel: function(evt) {
		this.ui.inputs.h["imgbg"].set_text("");
	}
	,acImgbt: function(evt) {
		this._ac("menubrowseimgbt");
	}
	,acImgbtdel: function(evt) {
		this.ui.inputs.h["imgbt"].set_text("");
	}
	,onSaveReturn: function(ok,ld) {
		if(ok) {
			if(ld.map.h["e"] == 1) {
				com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("window-contrmenu-title"),com_tilbuci_data_Global.ln.get("window-contrmenu-ersave1"),320,150,com_tilbuci_data_Global.ln.get("default-ok"));
			} else if(ld.map.h["e"] == 2) {
				com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("window-contrmenu-title"),com_tilbuci_data_Global.ln.get("window-contrmenu-ersave"),320,150,com_tilbuci_data_Global.ln.get("default-ok"));
			} else {
				com_tilbuci_data_Global.showMsg(com_tilbuci_data_Global.ln.get("window-contrmenu-oksave"));
				feathers_core_PopUpManager.removePopUp(this);
			}
		} else {
			com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("window-contrmenu-title"),com_tilbuci_data_Global.ln.get("window-contrmenu-ersave"),320,150,com_tilbuci_data_Global.ln.get("default-ok"));
		}
	}
	,__class__: com_tilbuci_ui_window_contraptions_WindowContrMenu
});
var com_tilbuci_ui_window_contraptions_WindowContrMessages = function(ac) {
	this._list = new haxe_ds_StringMap();
	com_tilbuci_ui_window_PopupWindow.call(this,ac,com_tilbuci_data_Global.ln.get("window-contrmess-title"),1000,com_tilbuci_ui_base_InterfaceFactory.pickValue(570,590),false,true,true);
};
$hxClasses["com.tilbuci.ui.window.contraptions.WindowContrMessages"] = com_tilbuci_ui_window_contraptions_WindowContrMessages;
com_tilbuci_ui_window_contraptions_WindowContrMessages.__name__ = "com.tilbuci.ui.window.contraptions.WindowContrMessages";
com_tilbuci_ui_window_contraptions_WindowContrMessages.__super__ = com_tilbuci_ui_window_PopupWindow;
com_tilbuci_ui_window_contraptions_WindowContrMessages.prototype = $extend(com_tilbuci_ui_window_PopupWindow.prototype,{
	_list: null
	,startInterface: function(evt) {
		this.ui.createHContainer("imgbg");
		this.ui.createTInput("imgbg","","",this.ui.hcontainers.h["imgbg"],false);
		var tmp = this.ui;
		var tmp1 = openfl_utils_Assets.getBitmapData("btOpenfile");
		var tmp2 = this.ui.hcontainers.h["imgbg"];
		tmp.createIconButton("imgbg",$bind(this,this.acImgbg),new openfl_display_Bitmap(tmp1),null,tmp2,false);
		var tmp = this.ui;
		var tmp1 = openfl_utils_Assets.getBitmapData("btDel");
		var tmp2 = this.ui.hcontainers.h["imgbg"];
		tmp.createIconButton("imgbgdel",$bind(this,this.acImgbgdel),new openfl_display_Bitmap(tmp1),null,tmp2,false);
		this.ui.inputs.h["imgbg"].set_enabled(false);
		this.ui.hcontainers.h["imgbg"].setWidth(460,[350,50,50]);
		this.ui.createHContainer("imgbt0");
		this.ui.createTInput("imgbt0","","",this.ui.hcontainers.h["imgbt0"],false);
		var tmp = this.ui;
		var tmp1 = openfl_utils_Assets.getBitmapData("btOpenfile");
		var tmp2 = this.ui.hcontainers.h["imgbt0"];
		tmp.createIconButton("imgbt0",$bind(this,this.acImgbt0),new openfl_display_Bitmap(tmp1),null,tmp2,false);
		var tmp = this.ui;
		var tmp1 = openfl_utils_Assets.getBitmapData("btDel");
		var tmp2 = this.ui.hcontainers.h["imgbt0"];
		tmp.createIconButton("imgimgbt0del",$bind(this,this.acImgbt0del),new openfl_display_Bitmap(tmp1),null,tmp2,false);
		this.ui.inputs.h["imgbt0"].set_enabled(false);
		this.ui.hcontainers.h["imgbt0"].setWidth(460,[350,50,50]);
		this.ui.createHContainer("imgbt1");
		this.ui.createTInput("imgbt1","","",this.ui.hcontainers.h["imgbt1"],false);
		var tmp = this.ui;
		var tmp1 = openfl_utils_Assets.getBitmapData("btOpenfile");
		var tmp2 = this.ui.hcontainers.h["imgbt1"];
		tmp.createIconButton("imgbt1",$bind(this,this.acImgbt1),new openfl_display_Bitmap(tmp1),null,tmp2,false);
		var tmp = this.ui;
		var tmp1 = openfl_utils_Assets.getBitmapData("btDel");
		var tmp2 = this.ui.hcontainers.h["imgbt1"];
		tmp.createIconButton("imgimgbt1del",$bind(this,this.acImgbt1del),new openfl_display_Bitmap(tmp1),null,tmp2,false);
		this.ui.inputs.h["imgbt1"].set_enabled(false);
		this.ui.hcontainers.h["imgbt1"].setWidth(460,[350,50,50]);
		this.ui.createHContainer("imgbt2");
		this.ui.createTInput("imgbt2","","",this.ui.hcontainers.h["imgbt2"],false);
		var tmp = this.ui;
		var tmp1 = openfl_utils_Assets.getBitmapData("btOpenfile");
		var tmp2 = this.ui.hcontainers.h["imgbt2"];
		tmp.createIconButton("imgbt2",$bind(this,this.acImgbt2),new openfl_display_Bitmap(tmp1),null,tmp2,false);
		var tmp = this.ui;
		var tmp1 = openfl_utils_Assets.getBitmapData("btDel");
		var tmp2 = this.ui.hcontainers.h["imgbt2"];
		tmp.createIconButton("imgimgbtdel",$bind(this,this.acImgbt2del),new openfl_display_Bitmap(tmp1),null,tmp2,false);
		this.ui.inputs.h["imgbt2"].set_enabled(false);
		this.ui.hcontainers.h["imgbt2"].setWidth(460,[350,50,50]);
		var tmp = com_tilbuci_data_Global.ln.get("window-contrmess-title");
		var tmp1 = this.ui;
		var tmp2 = this.ui;
		var tmp3 = { tp : "Label", id : "registered", tx : com_tilbuci_data_Global.ln.get("window-contrmess-registered"), vr : ""};
		var tmp4 = { tp : "Button", id : "load", tx : com_tilbuci_data_Global.ln.get("window-contrmess-load"), ac : $bind(this,this.loadMenu)};
		var tmp5 = { tp : "Button", id : "remove", tx : com_tilbuci_data_Global.ln.get("window-contrmess-remove"), ac : $bind(this,this.removeMenu)};
		var tmp6 = { tp : "Label", id : "name", tx : com_tilbuci_data_Global.ln.get("window-contrmess-name"), vr : "detail"};
		var tmp7 = com_tilbuci_data_Global.ln.get("window-contrmess-add");
		var tmp8 = tmp2.forge("leftcol",[tmp3,{ tp : "List", id : "registered", vl : [], sl : null, ht : 245},tmp4,tmp5,{ tp : "Spacer", id : "add", ht : 15, ln : true},tmp6,{ tp : "TInput", id : "name", tx : "", vr : ""},{ tp : "Button", id : "add", tx : tmp7, ac : $bind(this,this.addMenu)}]);
		var tmp2 = this.ui;
		var tmp3 = { tp : "Label", id : "properties", tx : com_tilbuci_data_Global.ln.get("window-contrmess-properties"), vr : ""};
		var tmp4 = { tp : "Label", id : "font", tx : com_tilbuci_data_Global.ln.get("window-contrmess-font"), vr : "detail"};
		var tmp5 = { tp : "Label", id : "fontsize", tx : com_tilbuci_data_Global.ln.get("window-contrmess-fontsize"), vr : "detail"};
		var tmp6 = { tp : "Label", id : "fontc", tx : com_tilbuci_data_Global.ln.get("window-contrmess-fontc"), vr : "detail"};
		var tmp7 = { tp : "Label", id : "gap", tx : com_tilbuci_data_Global.ln.get("window-contrmess-gap"), vr : "detail"};
		var tmp9 = { tp : "Label", id : "imgbg", tx : com_tilbuci_data_Global.ln.get("window-contrmess-imgbg"), vr : "detail"};
		var tmp10 = { tp : "Custom", cont : this.ui.hcontainers.h["imgbg"]};
		var tmp11 = { tp : "Label", id : "imgbt0", tx : com_tilbuci_data_Global.ln.get("window-contrmess-imgbt0"), vr : "detail"};
		var tmp12 = { tp : "Custom", cont : this.ui.hcontainers.h["imgbt0"]};
		var tmp13 = { tp : "Label", id : "imgbt1", tx : com_tilbuci_data_Global.ln.get("window-contrmess-imgbt1"), vr : "detail"};
		var tmp14 = { tp : "Custom", cont : this.ui.hcontainers.h["imgbt1"]};
		var tmp15 = com_tilbuci_data_Global.ln.get("window-contrmess-imgbt2");
		this.addForm(tmp,tmp1.createColumnHolder("columns",tmp8,tmp2.forge("rightcol",[tmp3,tmp4,{ tp : "Select", id : "font", vl : [], sl : null},tmp5,{ tp : "Numeric", id : "fontsize", mn : 8, mx : 200, st : 1, vl : 0},tmp6,{ tp : "TInput", id : "fontc", tx : "", vr : ""},tmp7,{ tp : "Numeric", id : "gap", mn : 0, mx : 500, st : 1, vl : 10},tmp9,tmp10,tmp11,tmp12,tmp13,tmp14,{ tp : "Label", id : "imgbt2", tx : tmp15, vr : "detail"},{ tp : "Custom", cont : this.ui.hcontainers.h["imgbt2"]}]),this.ui.forge("bottom",[{ tp : "Button", id : "save", tx : com_tilbuci_data_Global.ln.get("window-contrmess-save"), ac : $bind(this,this.saveMenu)}]),460));
		this.ui.listDbClick("registered",$bind(this,this.loadMenu));
		com_tilbuci_ui_window_PopupWindow.prototype.startInterface.call(this);
	}
	,acStart: function() {
		var h = this._list.h;
		var mnk_h = h;
		var mnk_keys = Object.keys(h);
		var mnk_length = mnk_keys.length;
		var mnk_current = 0;
		while(mnk_current < mnk_length) {
			var mnk = mnk_keys[mnk_current++];
			this._list.h[mnk].kill();
			var _this = this._list;
			if(Object.prototype.hasOwnProperty.call(_this.h,mnk)) {
				delete(_this.h[mnk]);
			}
		}
		var h = com_tilbuci_data_GlobalPlayer.contraptions.messages.h;
		var mn_h = h;
		var mn_keys = Object.keys(h);
		var mn_length = mn_keys.length;
		var mn_current = 0;
		while(mn_current < mn_length) {
			var mn = mn_h[mn_keys[mn_current++]];
			var this1 = this._list;
			var k = mn.id;
			var v = mn.clone();
			this1.h[k] = v;
		}
		this.clear();
	}
	,clear: function() {
		this.ui.inputs.h["fontc"].set_text("#FFFFFF");
		var list = [];
		var h = this._list.h;
		var mn_h = h;
		var mn_keys = Object.keys(h);
		var mn_length = mn_keys.length;
		var mn_current = 0;
		while(mn_current < mn_length) {
			var mn = mn_h[mn_keys[mn_current++]];
			list.push({ text : mn.id, value : mn.id});
		}
		this.ui.setListValues("registered",list);
		this.ui.setListSelectValue("registered",null);
		this.ui.inputs.h["name"].set_text("");
		var fnts = [];
		var _g = 0;
		var _g1 = com_tilbuci_data_Global.fonts.length;
		while(_g < _g1) {
			var n = _g++;
			fnts.push({ text : com_tilbuci_data_Global.fonts[n], value : com_tilbuci_data_Global.fonts[n]});
		}
		var _g = 0;
		var _g1 = com_tilbuci_data_GlobalPlayer.mdata.fonts;
		while(_g < _g1.length) {
			var i = _g1[_g];
			++_g;
			fnts.push({ text : i.name, value : i.name});
		}
		this.ui.setSelectOptions("font",fnts);
		this.ui.setSelectValue("font",null);
		this.ui.numerics.h["fontsize"].set_value(20);
		this.ui.numerics.h["gap"].set_value(10);
		this.ui.inputs.h["imgbg"].set_text("");
		this.ui.inputs.h["imgbt0"].set_text("");
		this.ui.inputs.h["imgbt1"].set_text("");
		this.ui.inputs.h["imgbt2"].set_text("");
	}
	,loadMenu: function(evt) {
		if(this.ui.lists.h["registered"].get_selectedItem() != null) {
			var this1 = this._list;
			var key = this.ui.lists.h["registered"].get_selectedItem().value;
			if(Object.prototype.hasOwnProperty.call(this1.h,key)) {
				var tmp = this.ui.inputs.h["name"];
				var this1 = this._list;
				var key = this.ui.lists.h["registered"].get_selectedItem().value;
				tmp.set_text(this1.h[key].id);
				var tmp = this.ui.inputs.h["fontc"];
				var this1 = this._list;
				var key = this.ui.lists.h["registered"].get_selectedItem().value;
				tmp.set_text(this1.h[key].fontcolor);
				var tmp = this.ui;
				var this1 = this._list;
				var key = this.ui.lists.h["registered"].get_selectedItem().value;
				tmp.setSelectValue("font",this1.h[key].font);
				var tmp = this.ui.numerics.h["fontsize"];
				var this1 = this._list;
				var key = this.ui.lists.h["registered"].get_selectedItem().value;
				tmp.set_value(Math.round(this1.h[key].fontsize));
				var tmp = this.ui.numerics.h["gap"];
				var this1 = this._list;
				var key = this.ui.lists.h["registered"].get_selectedItem().value;
				tmp.set_value(Math.round(this1.h[key].gap));
				var tmp = this.ui.inputs.h["imgbg"];
				var this1 = this._list;
				var key = this.ui.lists.h["registered"].get_selectedItem().value;
				tmp.set_text(this1.h[key].background);
				var tmp = this.ui.inputs.h["imgbt0"];
				var this1 = this._list;
				var key = this.ui.lists.h["registered"].get_selectedItem().value;
				tmp.set_text(this1.h[key].buton[0]);
				var tmp = this.ui.inputs.h["imgbt1"];
				var this1 = this._list;
				var key = this.ui.lists.h["registered"].get_selectedItem().value;
				tmp.set_text(this1.h[key].buton[1]);
				var tmp = this.ui.inputs.h["imgbt2"];
				var this1 = this._list;
				var key = this.ui.lists.h["registered"].get_selectedItem().value;
				tmp.set_text(this1.h[key].buton[2]);
			}
		}
	}
	,action: function(ac,data) {
		switch(ac) {
		case "messagesbrowseimgbg":
			this.ui.inputs.h["imgbg"].set_text(data.h["file"]);
			break;
		case "messagesbrowseimgbt0":
			this.ui.inputs.h["imgbt0"].set_text(data.h["file"]);
			break;
		case "messagesbrowseimgbt1":
			this.ui.inputs.h["imgbt1"].set_text(data.h["file"]);
			break;
		case "messagesbrowseimgbt2":
			this.ui.inputs.h["imgbt2"].set_text(data.h["file"]);
			break;
		}
	}
	,removeMenu: function(evt) {
		if(this.ui.lists.h["registered"].get_selectedItem() != null) {
			var this1 = this._list;
			var key = this.ui.lists.h["registered"].get_selectedItem().value;
			if(Object.prototype.hasOwnProperty.call(this1.h,key)) {
				var this1 = this._list;
				var key = this.ui.lists.h["registered"].get_selectedItem().value;
				this1.h[key].kill();
				var this1 = this._list;
				var key = this.ui.lists.h["registered"].get_selectedItem().value;
				var _this = this1;
				if(Object.prototype.hasOwnProperty.call(_this.h,key)) {
					delete(_this.h[key]);
				}
				this.clear();
			}
		}
	}
	,saveMenu: function(evt) {
		var h = com_tilbuci_data_GlobalPlayer.contraptions.messages.h;
		var mn_h = h;
		var mn_keys = Object.keys(h);
		var mn_length = mn_keys.length;
		var mn_current = 0;
		while(mn_current < mn_length) {
			var mn = mn_keys[mn_current++];
			com_tilbuci_data_GlobalPlayer.contraptions.messages.h[mn].kill();
			var _this = com_tilbuci_data_GlobalPlayer.contraptions.messages;
			if(Object.prototype.hasOwnProperty.call(_this.h,mn)) {
				delete(_this.h[mn]);
			}
		}
		var h = this._list.h;
		var mn_h = h;
		var mn_keys = Object.keys(h);
		var mn_length = mn_keys.length;
		var mn_current = 0;
		while(mn_current < mn_length) {
			var mn = mn_keys[mn_current++];
			var this1 = com_tilbuci_data_GlobalPlayer.contraptions.messages;
			var v = this._list.h[mn].clone();
			this1.h[mn] = v;
		}
		this.clear();
		var tmp = com_tilbuci_data_Global.ws;
		var _g = new haxe_ds_StringMap();
		var value = com_tilbuci_data_GlobalPlayer.movie.get_mvId();
		_g.h["movie"] = value;
		var value = com_tilbuci_data_GlobalPlayer.contraptions.getData();
		_g.h["data"] = value;
		tmp.send("Movie/SaveContraptions",_g,$bind(this,this.onSaveReturn));
	}
	,addMenu: function(evt) {
		if(this.ui.inputs.h["name"].get_text().length >= 3) {
			if(this.ui.inputs.h["imgbg"].get_text() == "" || this.ui.inputs.h["imgbt0"].get_text() == "") {
				com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("window-contrmess-title"),com_tilbuci_data_Global.ln.get("window-contrmess-nographics"),320,150,com_tilbuci_data_Global.ln.get("default-ok"));
			} else {
				var mn;
				var this1 = this._list;
				var key = this.ui.inputs.h["name"].get_text();
				if(Object.prototype.hasOwnProperty.call(this1.h,key)) {
					var this1 = this._list;
					var key = this.ui.inputs.h["name"].get_text();
					mn = this1.h[key];
				} else {
					mn = new com_tilbuci_contraptions_MessagesContraption();
				}
				mn.load({ id : this.ui.inputs.h["name"].get_text(), font : this.ui.selects.h["font"].get_selectedItem().value, fontcolor : com_tilbuci_statictools_StringStatic.colorHex(this.ui.inputs.h["fontc"].get_text(),"#FFFFFF"), fontsize : this.ui.numerics.h["fontsize"].get_value(), gap : this.ui.numerics.h["gap"].get_value(), background : this.ui.inputs.h["imgbg"].get_text(), buton0 : this.ui.inputs.h["imgbt0"].get_text(), buton1 : this.ui.inputs.h["imgbt1"].get_text(), buton2 : this.ui.inputs.h["imgbt2"].get_text()});
				var this1 = this._list;
				var k = this.ui.inputs.h["name"].get_text();
				this1.h[k] = mn;
				this.clear();
			}
		} else {
			com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("window-contrmess-title"),com_tilbuci_data_Global.ln.get("window-contrmess-noname"),320,150,com_tilbuci_data_Global.ln.get("default-ok"));
		}
	}
	,acImgbg: function(evt) {
		this._ac("messagesbrowseimgbg");
	}
	,acImgbgdel: function(evt) {
		this.ui.inputs.h["imgbg"].set_text("");
	}
	,acImgbt0: function(evt) {
		this._ac("messagesbrowseimgbt0");
	}
	,acImgbt0del: function(evt) {
		this.ui.inputs.h["imgbt0"].set_text("");
	}
	,acImgbt1: function(evt) {
		this._ac("messagesbrowseimgbt1");
	}
	,acImgbt1del: function(evt) {
		this.ui.inputs.h["imgbt1"].set_text("");
	}
	,acImgbt2: function(evt) {
		this._ac("messagesbrowseimgbt2");
	}
	,acImgbt2del: function(evt) {
		this.ui.inputs.h["imgbt2"].set_text("");
	}
	,onSaveReturn: function(ok,ld) {
		if(ok) {
			if(ld.map.h["e"] == 1) {
				com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("window-contrmess-title"),com_tilbuci_data_Global.ln.get("window-contrmess-ersave1"),320,150,com_tilbuci_data_Global.ln.get("default-ok"));
			} else if(ld.map.h["e"] == 2) {
				com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("window-contrmess-title"),com_tilbuci_data_Global.ln.get("window-contrmess-ersave"),320,150,com_tilbuci_data_Global.ln.get("default-ok"));
			} else {
				com_tilbuci_data_Global.showMsg(com_tilbuci_data_Global.ln.get("window-contrmess-oksave"));
				feathers_core_PopUpManager.removePopUp(this);
			}
		} else {
			com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("window-contrmess-title"),com_tilbuci_data_Global.ln.get("window-contrmess-ersave"),320,150,com_tilbuci_data_Global.ln.get("default-ok"));
		}
	}
	,__class__: com_tilbuci_ui_window_contraptions_WindowContrMessages
});
var com_tilbuci_ui_window_contraptions_WindowContrMusic = function(ac) {
	this._list = new haxe_ds_StringMap();
	com_tilbuci_ui_window_PopupWindow.call(this,ac,com_tilbuci_data_Global.ln.get("window-contrmusic-title"),1000,com_tilbuci_ui_base_InterfaceFactory.pickValue(525,540),false,true,true);
};
$hxClasses["com.tilbuci.ui.window.contraptions.WindowContrMusic"] = com_tilbuci_ui_window_contraptions_WindowContrMusic;
com_tilbuci_ui_window_contraptions_WindowContrMusic.__name__ = "com.tilbuci.ui.window.contraptions.WindowContrMusic";
com_tilbuci_ui_window_contraptions_WindowContrMusic.__super__ = com_tilbuci_ui_window_PopupWindow;
com_tilbuci_ui_window_contraptions_WindowContrMusic.prototype = $extend(com_tilbuci_ui_window_PopupWindow.prototype,{
	_list: null
	,startInterface: function(evt) {
		this.ui.createHContainer("audio");
		this.ui.createTInput("audio","","",this.ui.hcontainers.h["audio"],false);
		var tmp = this.ui;
		var tmp1 = openfl_utils_Assets.getBitmapData("btOpenfile");
		var tmp2 = this.ui.hcontainers.h["audio"];
		tmp.createIconButton("audio",$bind(this,this.acAudio),new openfl_display_Bitmap(tmp1),null,tmp2,false);
		var tmp = this.ui;
		var tmp1 = openfl_utils_Assets.getBitmapData("btDel");
		var tmp2 = this.ui.hcontainers.h["audio"];
		tmp.createIconButton("audiodel",$bind(this,this.acAudiodel),new openfl_display_Bitmap(tmp1),null,tmp2,false);
		this.ui.inputs.h["audio"].set_enabled(false);
		this.ui.hcontainers.h["audio"].setWidth(460,[350,50,50]);
		var tmp = com_tilbuci_data_Global.ln.get("window-kfmanage-title");
		var tmp1 = this.ui;
		var tmp2 = this.ui;
		var tmp3 = { tp : "Label", id : "registered", tx : com_tilbuci_data_Global.ln.get("window-contrmusic-registered"), vr : ""};
		var tmp4 = { tp : "Button", id : "load", tx : com_tilbuci_data_Global.ln.get("window-contrmusic-load"), ac : $bind(this,this.loadContr)};
		var tmp5 = { tp : "Button", id : "remove", tx : com_tilbuci_data_Global.ln.get("window-contrmusic-remove"), ac : $bind(this,this.removeContr)};
		var tmp6 = { tp : "Label", id : "name", tx : com_tilbuci_data_Global.ln.get("window-contrmusic-name"), vr : "detail"};
		var tmp7 = com_tilbuci_data_Global.ln.get("window-contrmusic-add");
		this.addForm(tmp,tmp1.createColumnHolder("columns",tmp2.forge("leftcol",[tmp3,{ tp : "List", id : "registered", vl : [], sl : null, ht : 200},tmp4,tmp5,{ tp : "Spacer", id : "add", ht : 15, ln : true},tmp6,{ tp : "TInput", id : "name", tx : "", vr : ""},{ tp : "Button", id : "add", tx : tmp7, ac : $bind(this,this.addContr)}]),this.ui.forge("rightcol",[{ tp : "Label", id : "properties", tx : com_tilbuci_data_Global.ln.get("window-contrmusic-properties"), vr : ""},{ tp : "Label", id : "audio", tx : com_tilbuci_data_Global.ln.get("window-contrmusic-file"), vr : "detail"},{ tp : "Custom", cont : this.ui.hcontainers.h["audio"]}]),this.ui.forge("bottom",[{ tp : "Button", id : "save", tx : com_tilbuci_data_Global.ln.get("window-contrmusic-save"), ac : $bind(this,this.saveContr)}]),420));
		this.ui.listDbClick("registered",$bind(this,this.loadContr));
		com_tilbuci_ui_window_PopupWindow.prototype.startInterface.call(this);
	}
	,acStart: function() {
		var h = this._list.h;
		var cont_h = h;
		var cont_keys = Object.keys(h);
		var cont_length = cont_keys.length;
		var cont_current = 0;
		while(cont_current < cont_length) {
			var cont = cont_keys[cont_current++];
			this._list.h[cont].kill();
			var _this = this._list;
			if(Object.prototype.hasOwnProperty.call(_this.h,cont)) {
				delete(_this.h[cont]);
			}
		}
		var h = com_tilbuci_data_GlobalPlayer.contraptions.musics.h;
		var contk_h = h;
		var contk_keys = Object.keys(h);
		var contk_length = contk_keys.length;
		var contk_current = 0;
		while(contk_current < contk_length) {
			var contk = contk_h[contk_keys[contk_current++]];
			var this1 = this._list;
			var k = contk.id;
			var v = contk.clone();
			this1.h[k] = v;
		}
		this.clear();
	}
	,clear: function() {
		var list = [];
		var h = this._list.h;
		var cont_h = h;
		var cont_keys = Object.keys(h);
		var cont_length = cont_keys.length;
		var cont_current = 0;
		while(cont_current < cont_length) {
			var cont = cont_h[cont_keys[cont_current++]];
			list.push({ text : cont.id, value : cont.id});
		}
		this.ui.setListValues("registered",list);
		this.ui.setListSelectValue("registered",null);
		this.ui.inputs.h["name"].set_text("");
		this.ui.inputs.h["audio"].set_text("");
	}
	,loadContr: function(evt) {
		if(this.ui.lists.h["registered"].get_selectedItem() != null) {
			var this1 = this._list;
			var key = this.ui.lists.h["registered"].get_selectedItem().value;
			if(Object.prototype.hasOwnProperty.call(this1.h,key)) {
				var tmp = this.ui.inputs.h["name"];
				var this1 = this._list;
				var key = this.ui.lists.h["registered"].get_selectedItem().value;
				tmp.set_text(this1.h[key].id);
				var tmp = this.ui.inputs.h["audio"];
				var this1 = this._list;
				var key = this.ui.lists.h["registered"].get_selectedItem().value;
				tmp.set_text(this1.h[key].media);
			}
		}
	}
	,action: function(ac,data) {
		if(ac == "music") {
			this.ui.inputs.h["audio"].set_text(data.h["file"]);
		}
	}
	,removeContr: function(evt) {
		if(this.ui.lists.h["registered"].get_selectedItem() != null) {
			var this1 = this._list;
			var key = this.ui.lists.h["registered"].get_selectedItem().value;
			if(Object.prototype.hasOwnProperty.call(this1.h,key)) {
				var this1 = this._list;
				var key = this.ui.lists.h["registered"].get_selectedItem().value;
				this1.h[key].kill();
				var this1 = this._list;
				var key = this.ui.lists.h["registered"].get_selectedItem().value;
				var _this = this1;
				if(Object.prototype.hasOwnProperty.call(_this.h,key)) {
					delete(_this.h[key]);
				}
				this.clear();
			}
		}
	}
	,saveContr: function(evt) {
		var h = com_tilbuci_data_GlobalPlayer.contraptions.musics.h;
		var cont_h = h;
		var cont_keys = Object.keys(h);
		var cont_length = cont_keys.length;
		var cont_current = 0;
		while(cont_current < cont_length) {
			var cont = cont_keys[cont_current++];
			com_tilbuci_data_GlobalPlayer.contraptions.musics.h[cont].kill();
			var _this = com_tilbuci_data_GlobalPlayer.contraptions.musics;
			if(Object.prototype.hasOwnProperty.call(_this.h,cont)) {
				delete(_this.h[cont]);
			}
		}
		var h = this._list.h;
		var cont_h = h;
		var cont_keys = Object.keys(h);
		var cont_length = cont_keys.length;
		var cont_current = 0;
		while(cont_current < cont_length) {
			var cont = cont_keys[cont_current++];
			var this1 = com_tilbuci_data_GlobalPlayer.contraptions.musics;
			var v = this._list.h[cont].clone();
			this1.h[cont] = v;
		}
		this.clear();
		var tmp = com_tilbuci_data_Global.ws;
		var _g = new haxe_ds_StringMap();
		var value = com_tilbuci_data_GlobalPlayer.movie.get_mvId();
		_g.h["movie"] = value;
		var value = com_tilbuci_data_GlobalPlayer.contraptions.getData();
		_g.h["data"] = value;
		tmp.send("Movie/SaveContraptions",_g,$bind(this,this.onSaveReturn));
	}
	,addContr: function(evt) {
		if(this.ui.inputs.h["name"].get_text().length > 3) {
			if(this.ui.inputs.h["audio"].get_text() != "") {
				var contr;
				var this1 = this._list;
				var key = this.ui.inputs.h["name"].get_text();
				if(Object.prototype.hasOwnProperty.call(this1.h,key)) {
					var this1 = this._list;
					var key = this.ui.inputs.h["name"].get_text();
					contr = this1.h[key];
					contr.load({ id : this.ui.inputs.h["name"].get_text(), media : this.ui.inputs.h["audio"].get_text()});
					this.clear();
				} else {
					contr = new com_tilbuci_contraptions_MusicContraption();
					contr.load({ id : this.ui.inputs.h["name"].get_text(), media : this.ui.inputs.h["audio"].get_text()});
					var this1 = this._list;
					var k = this.ui.inputs.h["name"].get_text();
					this1.h[k] = contr;
					this.clear();
				}
			} else {
				com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("window-contrmusic-title"),com_tilbuci_data_Global.ln.get("window-contrmusic-noaudio"),320,150,com_tilbuci_data_Global.ln.get("default-ok"));
			}
		} else {
			com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("window-contrmusic-title"),com_tilbuci_data_Global.ln.get("window-contrmusic-noname"),320,150,com_tilbuci_data_Global.ln.get("default-ok"));
		}
	}
	,acAudio: function(evt) {
		this._ac("music");
	}
	,acAudiodel: function(evt) {
		this.ui.inputs.h["audio"].set_text("");
	}
	,onSaveReturn: function(ok,ld) {
		if(ok) {
			if(ld.map.h["e"] == 1) {
				com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("window-contrmusic-title"),com_tilbuci_data_Global.ln.get("window-contrmusic-ersave1"),320,150,com_tilbuci_data_Global.ln.get("default-ok"));
			} else if(ld.map.h["e"] == 2) {
				com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("window-contrmusic-title"),com_tilbuci_data_Global.ln.get("window-contrmusic-ersave"),320,150,com_tilbuci_data_Global.ln.get("default-ok"));
			} else {
				com_tilbuci_data_Global.showMsg(com_tilbuci_data_Global.ln.get("window-contrmusic-oksave"));
				feathers_core_PopUpManager.removePopUp(this);
			}
		} else {
			com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("window-contrmusic-title"),com_tilbuci_data_Global.ln.get("window-contrmusic-ersave"),320,150,com_tilbuci_data_Global.ln.get("default-ok"));
		}
	}
	,__class__: com_tilbuci_ui_window_contraptions_WindowContrMusic
});
var com_tilbuci_ui_window_contraptions_WindowContrSound = function(ac) {
	this._list = new haxe_ds_StringMap();
	com_tilbuci_ui_window_PopupWindow.call(this,ac,com_tilbuci_data_Global.ln.get("window-contrsound-title"),1000,com_tilbuci_ui_base_InterfaceFactory.pickValue(525,540),false,true,true);
};
$hxClasses["com.tilbuci.ui.window.contraptions.WindowContrSound"] = com_tilbuci_ui_window_contraptions_WindowContrSound;
com_tilbuci_ui_window_contraptions_WindowContrSound.__name__ = "com.tilbuci.ui.window.contraptions.WindowContrSound";
com_tilbuci_ui_window_contraptions_WindowContrSound.__super__ = com_tilbuci_ui_window_PopupWindow;
com_tilbuci_ui_window_contraptions_WindowContrSound.prototype = $extend(com_tilbuci_ui_window_PopupWindow.prototype,{
	_list: null
	,startInterface: function(evt) {
		this.ui.createHContainer("audio");
		this.ui.createTInput("audio","","",this.ui.hcontainers.h["audio"],false);
		var tmp = this.ui;
		var tmp1 = openfl_utils_Assets.getBitmapData("btOpenfile");
		var tmp2 = this.ui.hcontainers.h["audio"];
		tmp.createIconButton("audio",$bind(this,this.acAudio),new openfl_display_Bitmap(tmp1),null,tmp2,false);
		var tmp = this.ui;
		var tmp1 = openfl_utils_Assets.getBitmapData("btDel");
		var tmp2 = this.ui.hcontainers.h["audio"];
		tmp.createIconButton("audiodel",$bind(this,this.acAudiodel),new openfl_display_Bitmap(tmp1),null,tmp2,false);
		this.ui.inputs.h["audio"].set_enabled(false);
		this.ui.hcontainers.h["audio"].setWidth(460,[350,50,50]);
		var tmp = com_tilbuci_data_Global.ln.get("window-kfmanage-title");
		var tmp1 = this.ui;
		var tmp2 = this.ui;
		var tmp3 = { tp : "Label", id : "registered", tx : com_tilbuci_data_Global.ln.get("window-contrsound-registered"), vr : ""};
		var tmp4 = { tp : "Button", id : "load", tx : com_tilbuci_data_Global.ln.get("window-contrsound-load"), ac : $bind(this,this.loadContr)};
		var tmp5 = { tp : "Button", id : "remove", tx : com_tilbuci_data_Global.ln.get("window-contrsound-remove"), ac : $bind(this,this.removeContr)};
		var tmp6 = { tp : "Label", id : "name", tx : com_tilbuci_data_Global.ln.get("window-contrsound-name"), vr : "detail"};
		var tmp7 = com_tilbuci_data_Global.ln.get("window-contrsound-add");
		this.addForm(tmp,tmp1.createColumnHolder("columns",tmp2.forge("leftcol",[tmp3,{ tp : "List", id : "registered", vl : [], sl : null, ht : 200},tmp4,tmp5,{ tp : "Spacer", id : "add", ht : 15, ln : true},tmp6,{ tp : "TInput", id : "name", tx : "", vr : ""},{ tp : "Button", id : "add", tx : tmp7, ac : $bind(this,this.addContr)}]),this.ui.forge("rightcol",[{ tp : "Label", id : "properties", tx : com_tilbuci_data_Global.ln.get("window-contrsound-properties"), vr : ""},{ tp : "Label", id : "audio", tx : com_tilbuci_data_Global.ln.get("window-contrsound-file"), vr : "detail"},{ tp : "Custom", cont : this.ui.hcontainers.h["audio"]}]),this.ui.forge("bottom",[{ tp : "Button", id : "save", tx : com_tilbuci_data_Global.ln.get("window-contrsound-save"), ac : $bind(this,this.saveContr)}]),420));
		this.ui.listDbClick("registered",$bind(this,this.loadContr));
		com_tilbuci_ui_window_PopupWindow.prototype.startInterface.call(this);
	}
	,acStart: function() {
		var h = this._list.h;
		var cont_h = h;
		var cont_keys = Object.keys(h);
		var cont_length = cont_keys.length;
		var cont_current = 0;
		while(cont_current < cont_length) {
			var cont = cont_keys[cont_current++];
			this._list.h[cont].kill();
			var _this = this._list;
			if(Object.prototype.hasOwnProperty.call(_this.h,cont)) {
				delete(_this.h[cont]);
			}
		}
		var h = com_tilbuci_data_GlobalPlayer.contraptions.sounds.h;
		var contk_h = h;
		var contk_keys = Object.keys(h);
		var contk_length = contk_keys.length;
		var contk_current = 0;
		while(contk_current < contk_length) {
			var contk = contk_h[contk_keys[contk_current++]];
			var this1 = this._list;
			var k = contk.id;
			var v = contk.clone();
			this1.h[k] = v;
		}
		this.clear();
	}
	,clear: function() {
		var list = [];
		var h = this._list.h;
		var cont_h = h;
		var cont_keys = Object.keys(h);
		var cont_length = cont_keys.length;
		var cont_current = 0;
		while(cont_current < cont_length) {
			var cont = cont_h[cont_keys[cont_current++]];
			list.push({ text : cont.id, value : cont.id});
		}
		this.ui.setListValues("registered",list);
		this.ui.setListSelectValue("registered",null);
		this.ui.inputs.h["name"].set_text("");
		this.ui.inputs.h["audio"].set_text("");
	}
	,loadContr: function(evt) {
		if(this.ui.lists.h["registered"].get_selectedItem() != null) {
			var this1 = this._list;
			var key = this.ui.lists.h["registered"].get_selectedItem().value;
			if(Object.prototype.hasOwnProperty.call(this1.h,key)) {
				var tmp = this.ui.inputs.h["name"];
				var this1 = this._list;
				var key = this.ui.lists.h["registered"].get_selectedItem().value;
				tmp.set_text(this1.h[key].id);
				var tmp = this.ui.inputs.h["audio"];
				var this1 = this._list;
				var key = this.ui.lists.h["registered"].get_selectedItem().value;
				tmp.set_text(this1.h[key].media);
			}
		}
	}
	,action: function(ac,data) {
		if(ac == "sound") {
			this.ui.inputs.h["audio"].set_text(data.h["file"]);
		}
	}
	,removeContr: function(evt) {
		if(this.ui.lists.h["registered"].get_selectedItem() != null) {
			var this1 = this._list;
			var key = this.ui.lists.h["registered"].get_selectedItem().value;
			if(Object.prototype.hasOwnProperty.call(this1.h,key)) {
				var this1 = this._list;
				var key = this.ui.lists.h["registered"].get_selectedItem().value;
				this1.h[key].kill();
				var this1 = this._list;
				var key = this.ui.lists.h["registered"].get_selectedItem().value;
				var _this = this1;
				if(Object.prototype.hasOwnProperty.call(_this.h,key)) {
					delete(_this.h[key]);
				}
				this.clear();
			}
		}
	}
	,saveContr: function(evt) {
		var h = com_tilbuci_data_GlobalPlayer.contraptions.sounds.h;
		var cont_h = h;
		var cont_keys = Object.keys(h);
		var cont_length = cont_keys.length;
		var cont_current = 0;
		while(cont_current < cont_length) {
			var cont = cont_keys[cont_current++];
			com_tilbuci_data_GlobalPlayer.contraptions.sounds.h[cont].kill();
			var _this = com_tilbuci_data_GlobalPlayer.contraptions.sounds;
			if(Object.prototype.hasOwnProperty.call(_this.h,cont)) {
				delete(_this.h[cont]);
			}
		}
		var h = this._list.h;
		var cont_h = h;
		var cont_keys = Object.keys(h);
		var cont_length = cont_keys.length;
		var cont_current = 0;
		while(cont_current < cont_length) {
			var cont = cont_keys[cont_current++];
			var this1 = com_tilbuci_data_GlobalPlayer.contraptions.sounds;
			var v = this._list.h[cont].clone();
			this1.h[cont] = v;
		}
		this.clear();
		var tmp = com_tilbuci_data_Global.ws;
		var _g = new haxe_ds_StringMap();
		var value = com_tilbuci_data_GlobalPlayer.movie.get_mvId();
		_g.h["movie"] = value;
		var value = com_tilbuci_data_GlobalPlayer.contraptions.getData();
		_g.h["data"] = value;
		tmp.send("Movie/SaveContraptions",_g,$bind(this,this.onSaveReturn));
	}
	,addContr: function(evt) {
		if(this.ui.inputs.h["name"].get_text().length > 3) {
			if(this.ui.inputs.h["audio"].get_text() != "") {
				var contr;
				var this1 = this._list;
				var key = this.ui.inputs.h["name"].get_text();
				if(Object.prototype.hasOwnProperty.call(this1.h,key)) {
					var this1 = this._list;
					var key = this.ui.inputs.h["name"].get_text();
					contr = this1.h[key];
					contr.load({ id : this.ui.inputs.h["name"].get_text(), media : this.ui.inputs.h["audio"].get_text()});
					this.clear();
				} else {
					contr = new com_tilbuci_contraptions_SoundContraption();
					contr.load({ id : this.ui.inputs.h["name"].get_text(), media : this.ui.inputs.h["audio"].get_text()});
					var this1 = this._list;
					var k = this.ui.inputs.h["name"].get_text();
					this1.h[k] = contr;
					this.clear();
				}
			} else {
				com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("window-contrsound-title"),com_tilbuci_data_Global.ln.get("window-contrsound-noaudio"),320,150,com_tilbuci_data_Global.ln.get("default-ok"));
			}
		} else {
			com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("window-contrsound-title"),com_tilbuci_data_Global.ln.get("window-contrsound-noname"),320,150,com_tilbuci_data_Global.ln.get("default-ok"));
		}
	}
	,acAudio: function(evt) {
		this._ac("sound");
	}
	,acAudiodel: function(evt) {
		this.ui.inputs.h["audio"].set_text("");
	}
	,onSaveReturn: function(ok,ld) {
		if(ok) {
			if(ld.map.h["e"] == 1) {
				com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("window-contrsound-title"),com_tilbuci_data_Global.ln.get("window-contrsound-ersave1"),320,150,com_tilbuci_data_Global.ln.get("default-ok"));
			} else if(ld.map.h["e"] == 2) {
				com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("window-contrsound-title"),com_tilbuci_data_Global.ln.get("window-contrsound-ersave"),320,150,com_tilbuci_data_Global.ln.get("default-ok"));
			} else {
				com_tilbuci_data_Global.showMsg(com_tilbuci_data_Global.ln.get("window-contrsound-oksave"));
				feathers_core_PopUpManager.removePopUp(this);
			}
		} else {
			com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("window-contrsound-title"),com_tilbuci_data_Global.ln.get("window-contrsound-ersave"),320,150,com_tilbuci_data_Global.ln.get("default-ok"));
		}
	}
	,__class__: com_tilbuci_ui_window_contraptions_WindowContrSound
});
var com_tilbuci_ui_window_contraptions_WindowContrTarget = function(ac) {
	this._list = new haxe_ds_StringMap();
	com_tilbuci_ui_window_PopupWindow.call(this,ac,com_tilbuci_data_Global.ln.get("window-contrtr-title"),1000,com_tilbuci_ui_base_InterfaceFactory.pickValue(575,590),false,true,true);
};
$hxClasses["com.tilbuci.ui.window.contraptions.WindowContrTarget"] = com_tilbuci_ui_window_contraptions_WindowContrTarget;
com_tilbuci_ui_window_contraptions_WindowContrTarget.__name__ = "com.tilbuci.ui.window.contraptions.WindowContrTarget";
com_tilbuci_ui_window_contraptions_WindowContrTarget.__super__ = com_tilbuci_ui_window_PopupWindow;
com_tilbuci_ui_window_contraptions_WindowContrTarget.prototype = $extend(com_tilbuci_ui_window_PopupWindow.prototype,{
	_list: null
	,startInterface: function(evt) {
		this.ui.createHContainer("default");
		this.ui.createTInput("default","","",this.ui.hcontainers.h["default"],false);
		var tmp = this.ui;
		var tmp1 = openfl_utils_Assets.getBitmapData("btOpenfile");
		var tmp2 = this.ui.hcontainers.h["default"];
		tmp.createIconButton("default",$bind(this,this.acImgD),new openfl_display_Bitmap(tmp1),null,tmp2,false);
		var tmp = this.ui;
		var tmp1 = openfl_utils_Assets.getBitmapData("btDel");
		var tmp2 = this.ui.hcontainers.h["default"];
		tmp.createIconButton("defaultdel",$bind(this,this.acImgDdel),new openfl_display_Bitmap(tmp1),null,tmp2,false);
		this.ui.inputs.h["default"].set_enabled(false);
		this.ui.hcontainers.h["default"].setWidth(460,[350,50,50]);
		this.ui.createHContainer("menus");
		this.ui.createTInput("menus","","",this.ui.hcontainers.h["menus"],false);
		var tmp = this.ui;
		var tmp1 = openfl_utils_Assets.getBitmapData("btOpenfile");
		var tmp2 = this.ui.hcontainers.h["menus"];
		tmp.createIconButton("menus",$bind(this,this.acImgM),new openfl_display_Bitmap(tmp1),null,tmp2,false);
		var tmp = this.ui;
		var tmp1 = openfl_utils_Assets.getBitmapData("btDel");
		var tmp2 = this.ui.hcontainers.h["menus"];
		tmp.createIconButton("menusdel",$bind(this,this.acImgMdel),new openfl_display_Bitmap(tmp1),null,tmp2,false);
		this.ui.inputs.h["menus"].set_enabled(false);
		this.ui.hcontainers.h["menus"].setWidth(460,[350,50,50]);
		this.ui.createHContainer("interf");
		this.ui.createTInput("interf","","",this.ui.hcontainers.h["interf"],false);
		var tmp = this.ui;
		var tmp1 = openfl_utils_Assets.getBitmapData("btOpenfile");
		var tmp2 = this.ui.hcontainers.h["interf"];
		tmp.createIconButton("interf",$bind(this,this.acImgI),new openfl_display_Bitmap(tmp1),null,tmp2,false);
		var tmp = this.ui;
		var tmp1 = openfl_utils_Assets.getBitmapData("btDel");
		var tmp2 = this.ui.hcontainers.h["interf"];
		tmp.createIconButton("interfdel",$bind(this,this.acImgIdel),new openfl_display_Bitmap(tmp1),null,tmp2,false);
		this.ui.inputs.h["interf"].set_enabled(false);
		this.ui.hcontainers.h["interf"].setWidth(460,[350,50,50]);
		this.ui.createHContainer("inst1");
		this.ui.createTInput("inst1","","",this.ui.hcontainers.h["inst1"],false);
		var tmp = this.ui;
		var tmp1 = openfl_utils_Assets.getBitmapData("btOpenfile");
		var tmp2 = this.ui.hcontainers.h["inst1"];
		tmp.createIconButton("inst1",$bind(this,this.acImgI1),new openfl_display_Bitmap(tmp1),null,tmp2,false);
		var tmp = this.ui;
		var tmp1 = openfl_utils_Assets.getBitmapData("btDel");
		var tmp2 = this.ui.hcontainers.h["inst1"];
		tmp.createIconButton("inst1del",$bind(this,this.acImgI1del),new openfl_display_Bitmap(tmp1),null,tmp2,false);
		this.ui.inputs.h["inst1"].set_enabled(false);
		this.ui.hcontainers.h["inst1"].setWidth(460,[350,50,50]);
		this.ui.createHContainer("inst2");
		this.ui.createTInput("inst2","","",this.ui.hcontainers.h["inst2"],false);
		var tmp = this.ui;
		var tmp1 = openfl_utils_Assets.getBitmapData("btOpenfile");
		var tmp2 = this.ui.hcontainers.h["inst2"];
		tmp.createIconButton("inst2",$bind(this,this.acImgI2),new openfl_display_Bitmap(tmp1),null,tmp2,false);
		var tmp = this.ui;
		var tmp1 = openfl_utils_Assets.getBitmapData("btDel");
		var tmp2 = this.ui.hcontainers.h["inst2"];
		tmp.createIconButton("inst2del",$bind(this,this.acImgI2del),new openfl_display_Bitmap(tmp1),null,tmp2,false);
		this.ui.inputs.h["inst2"].set_enabled(false);
		this.ui.hcontainers.h["inst2"].setWidth(460,[350,50,50]);
		this.ui.createHContainer("inst3");
		this.ui.createTInput("inst3","","",this.ui.hcontainers.h["inst3"],false);
		var tmp = this.ui;
		var tmp1 = openfl_utils_Assets.getBitmapData("btOpenfile");
		var tmp2 = this.ui.hcontainers.h["inst3"];
		tmp.createIconButton("inst3",$bind(this,this.acImgI3),new openfl_display_Bitmap(tmp1),null,tmp2,false);
		var tmp = this.ui;
		var tmp1 = openfl_utils_Assets.getBitmapData("btDel");
		var tmp2 = this.ui.hcontainers.h["inst3"];
		tmp.createIconButton("inst3del",$bind(this,this.acImgI3del),new openfl_display_Bitmap(tmp1),null,tmp2,false);
		this.ui.inputs.h["inst3"].set_enabled(false);
		this.ui.hcontainers.h["inst3"].setWidth(460,[350,50,50]);
		var tmp = com_tilbuci_data_Global.ln.get("window-contrtr-title");
		var tmp1 = this.ui;
		var tmp2 = this.ui;
		var tmp3 = { tp : "Label", id : "registered", tx : com_tilbuci_data_Global.ln.get("window-contrtr-registered"), vr : ""};
		var tmp4 = { tp : "Button", id : "load", tx : com_tilbuci_data_Global.ln.get("window-contrtr-load"), ac : $bind(this,this.loadContr)};
		var tmp5 = { tp : "Button", id : "remove", tx : com_tilbuci_data_Global.ln.get("window-contrtr-remove"), ac : $bind(this,this.removeContr)};
		var tmp6 = { tp : "Label", id : "name", tx : com_tilbuci_data_Global.ln.get("window-contrtr-name"), vr : "detail"};
		var tmp7 = com_tilbuci_data_Global.ln.get("window-contrtr-add");
		var tmp8 = tmp2.forge("leftcol",[tmp3,{ tp : "List", id : "registered", vl : [], sl : null, ht : 260},tmp4,tmp5,{ tp : "Spacer", id : "add", ht : 15, ln : true},tmp6,{ tp : "TInput", id : "name", tx : "", vr : ""},{ tp : "Button", id : "add", tx : tmp7, ac : $bind(this,this.addContr)}]);
		var tmp2 = this.ui;
		var tmp3 = { tp : "Label", id : "landscape", tx : com_tilbuci_data_Global.ln.get("window-contrtr-default"), vr : "detail"};
		var tmp4 = { tp : "Custom", cont : this.ui.hcontainers.h["default"]};
		var tmp5 = { tp : "Label", id : "menus", tx : com_tilbuci_data_Global.ln.get("window-contrtr-menus"), vr : "detail"};
		var tmp6 = { tp : "Custom", cont : this.ui.hcontainers.h["menus"]};
		var tmp7 = { tp : "Label", id : "interf", tx : com_tilbuci_data_Global.ln.get("window-contrtr-interf"), vr : "detail"};
		var tmp9 = { tp : "Custom", cont : this.ui.hcontainers.h["interf"]};
		var tmp10 = { tp : "Label", id : "inst1", tx : com_tilbuci_data_Global.ln.get("window-contrtr-inst"), vr : "detail"};
		var tmp11 = { tp : "Custom", cont : this.ui.hcontainers.h["inst1"]};
		var tmp12 = { tp : "Label", id : "inst2", tx : com_tilbuci_data_Global.ln.get("window-contrtr-inst"), vr : "detail"};
		var tmp13 = { tp : "Custom", cont : this.ui.hcontainers.h["inst2"]};
		var tmp14 = com_tilbuci_data_Global.ln.get("window-contrtr-inst");
		this.addForm(tmp,tmp1.createColumnHolder("columns",tmp8,tmp2.forge("rightcol",[tmp3,tmp4,tmp5,tmp6,tmp7,tmp9,{ tp : "Spacer", id : "spacer", ht : 20, ln : true},tmp10,{ tp : "TInput", id : "inst1name", tx : "", vr : ""},tmp11,{ tp : "Spacer", id : "spacer1", ht : 10, ln : false},tmp12,{ tp : "TInput", id : "inst2name", tx : "", vr : ""},tmp13,{ tp : "Spacer", id : "spacer2", ht : 10, ln : false},{ tp : "Label", id : "inst3", tx : tmp14, vr : "detail"},{ tp : "TInput", id : "inst3name", tx : "", vr : ""},{ tp : "Custom", cont : this.ui.hcontainers.h["inst3"]}]),this.ui.forge("bottom",[{ tp : "Button", id : "save", tx : com_tilbuci_data_Global.ln.get("window-contrtr-save"), ac : $bind(this,this.saveContr)}]),480));
		this.ui.listDbClick("registered",$bind(this,this.loadContr));
		com_tilbuci_ui_window_PopupWindow.prototype.startInterface.call(this);
	}
	,acStart: function() {
		var h = this._list.h;
		var cont_h = h;
		var cont_keys = Object.keys(h);
		var cont_length = cont_keys.length;
		var cont_current = 0;
		while(cont_current < cont_length) {
			var cont = cont_keys[cont_current++];
			this._list.h[cont].kill();
			var _this = this._list;
			if(Object.prototype.hasOwnProperty.call(_this.h,cont)) {
				delete(_this.h[cont]);
			}
		}
		var h = com_tilbuci_data_GlobalPlayer.contraptions.targets.h;
		var contk_h = h;
		var contk_keys = Object.keys(h);
		var contk_length = contk_keys.length;
		var contk_current = 0;
		while(contk_current < contk_length) {
			var contk = contk_h[contk_keys[contk_current++]];
			var this1 = this._list;
			var k = contk.id;
			var v = contk.clone();
			this1.h[k] = v;
		}
		this.clear();
	}
	,clear: function() {
		var list = [];
		var h = this._list.h;
		var cont_h = h;
		var cont_keys = Object.keys(h);
		var cont_length = cont_keys.length;
		var cont_current = 0;
		while(cont_current < cont_length) {
			var cont = cont_h[cont_keys[cont_current++]];
			list.push({ text : cont.id, value : cont.id});
		}
		this.ui.setListValues("registered",list);
		this.ui.setListSelectValue("registered",null);
		this.ui.inputs.h["name"].set_text("");
		this.ui.inputs.h["default"].set_text("");
		this.ui.inputs.h["menus"].set_text("");
		this.ui.inputs.h["interf"].set_text("");
		this.ui.inputs.h["inst1"].set_text("");
		this.ui.inputs.h["inst1name"].set_text("");
		this.ui.inputs.h["inst2"].set_text("");
		this.ui.inputs.h["inst2name"].set_text("");
		this.ui.inputs.h["inst3"].set_text("");
		this.ui.inputs.h["inst3name"].set_text("");
	}
	,loadContr: function(evt) {
		if(this.ui.lists.h["registered"].get_selectedItem() != null) {
			var this1 = this._list;
			var key = this.ui.lists.h["registered"].get_selectedItem().value;
			if(Object.prototype.hasOwnProperty.call(this1.h,key)) {
				var tmp = this.ui.inputs.h["name"];
				var this1 = this._list;
				var key = this.ui.lists.h["registered"].get_selectedItem().value;
				tmp.set_text(this1.h[key].id);
				var tmp = this.ui.inputs.h["default"];
				var this1 = this._list;
				var key = this.ui.lists.h["registered"].get_selectedItem().value;
				tmp.set_text(this1.h[key].defaultp);
				var tmp = this.ui.inputs.h["menus"];
				var this1 = this._list;
				var key = this.ui.lists.h["registered"].get_selectedItem().value;
				tmp.set_text(this1.h[key].menus);
				var tmp = this.ui.inputs.h["interf"];
				var this1 = this._list;
				var key = this.ui.lists.h["registered"].get_selectedItem().value;
				tmp.set_text(this1.h[key].interf);
				var tmp = this.ui.inputs.h["inst1"];
				var this1 = this._list;
				var key = this.ui.lists.h["registered"].get_selectedItem().value;
				tmp.set_text(this1.h[key].inst1);
				var tmp = this.ui.inputs.h["inst1name"];
				var this1 = this._list;
				var key = this.ui.lists.h["registered"].get_selectedItem().value;
				tmp.set_text(this1.h[key].inst1name);
				var tmp = this.ui.inputs.h["inst2"];
				var this1 = this._list;
				var key = this.ui.lists.h["registered"].get_selectedItem().value;
				tmp.set_text(this1.h[key].inst2);
				var tmp = this.ui.inputs.h["inst2name"];
				var this1 = this._list;
				var key = this.ui.lists.h["registered"].get_selectedItem().value;
				tmp.set_text(this1.h[key].inst2name);
				var tmp = this.ui.inputs.h["inst3"];
				var this1 = this._list;
				var key = this.ui.lists.h["registered"].get_selectedItem().value;
				tmp.set_text(this1.h[key].inst3);
				var tmp = this.ui.inputs.h["inst3name"];
				var this1 = this._list;
				var key = this.ui.lists.h["registered"].get_selectedItem().value;
				tmp.set_text(this1.h[key].inst3name);
			}
		}
	}
	,action: function(ac,data) {
		switch(ac) {
		case "default":
			this.ui.inputs.h["default"].set_text(data.h["file"]);
			break;
		case "inst1":
			this.ui.inputs.h["inst1"].set_text(data.h["file"]);
			break;
		case "inst2":
			this.ui.inputs.h["inst2"].set_text(data.h["file"]);
			break;
		case "inst3":
			this.ui.inputs.h["inst3"].set_text(data.h["file"]);
			break;
		case "interf":
			this.ui.inputs.h["interf"].set_text(data.h["file"]);
			break;
		case "menus":
			this.ui.inputs.h["menus"].set_text(data.h["file"]);
			break;
		}
	}
	,removeContr: function(evt) {
		if(this.ui.lists.h["registered"].get_selectedItem() != null) {
			var this1 = this._list;
			var key = this.ui.lists.h["registered"].get_selectedItem().value;
			if(Object.prototype.hasOwnProperty.call(this1.h,key)) {
				var this1 = this._list;
				var key = this.ui.lists.h["registered"].get_selectedItem().value;
				this1.h[key].kill();
				var this1 = this._list;
				var key = this.ui.lists.h["registered"].get_selectedItem().value;
				var _this = this1;
				if(Object.prototype.hasOwnProperty.call(_this.h,key)) {
					delete(_this.h[key]);
				}
				this.clear();
			}
		}
	}
	,saveContr: function(evt) {
		var h = com_tilbuci_data_GlobalPlayer.contraptions.targets.h;
		var cont_h = h;
		var cont_keys = Object.keys(h);
		var cont_length = cont_keys.length;
		var cont_current = 0;
		while(cont_current < cont_length) {
			var cont = cont_keys[cont_current++];
			com_tilbuci_data_GlobalPlayer.contraptions.targets.h[cont].kill();
			var _this = com_tilbuci_data_GlobalPlayer.contraptions.targets;
			if(Object.prototype.hasOwnProperty.call(_this.h,cont)) {
				delete(_this.h[cont]);
			}
		}
		var h = this._list.h;
		var cont_h = h;
		var cont_keys = Object.keys(h);
		var cont_length = cont_keys.length;
		var cont_current = 0;
		while(cont_current < cont_length) {
			var cont = cont_keys[cont_current++];
			var this1 = com_tilbuci_data_GlobalPlayer.contraptions.targets;
			var v = this._list.h[cont].clone();
			this1.h[cont] = v;
		}
		this.clear();
		var tmp = com_tilbuci_data_Global.ws;
		var _g = new haxe_ds_StringMap();
		var value = com_tilbuci_data_GlobalPlayer.movie.get_mvId();
		_g.h["movie"] = value;
		var value = com_tilbuci_data_GlobalPlayer.contraptions.getData();
		_g.h["data"] = value;
		tmp.send("Movie/SaveContraptions",_g,$bind(this,this.onSaveReturn));
	}
	,addContr: function(evt) {
		if(this.ui.inputs.h["name"].get_text().length > 3) {
			if(this.ui.inputs.h["default"].get_text() != "") {
				var contr;
				var this1 = this._list;
				var key = this.ui.inputs.h["name"].get_text();
				if(Object.prototype.hasOwnProperty.call(this1.h,key)) {
					var this1 = this._list;
					var key = this.ui.inputs.h["name"].get_text();
					contr = this1.h[key];
					contr.load({ id : this.ui.inputs.h["name"].get_text(), defaultp : this.ui.inputs.h["default"].get_text(), menus : this.ui.inputs.h["menus"].get_text(), interf : this.ui.inputs.h["interf"].get_text(), inst1 : this.ui.inputs.h["inst1"].get_text(), inst1name : this.ui.inputs.h["inst1name"].get_text(), inst2 : this.ui.inputs.h["inst2"].get_text(), inst2name : this.ui.inputs.h["inst2name"].get_text(), inst3 : this.ui.inputs.h["inst3"].get_text(), inst3name : this.ui.inputs.h["inst3name"].get_text()});
					this.clear();
				} else {
					contr = new com_tilbuci_contraptions_TargetContraption();
					contr.load({ id : this.ui.inputs.h["name"].get_text(), defaultp : this.ui.inputs.h["default"].get_text(), menus : this.ui.inputs.h["menus"].get_text(), interf : this.ui.inputs.h["interf"].get_text(), inst1 : this.ui.inputs.h["inst1"].get_text(), inst1name : this.ui.inputs.h["inst1name"].get_text(), inst2 : this.ui.inputs.h["inst2"].get_text(), inst2name : this.ui.inputs.h["inst2name"].get_text(), inst3 : this.ui.inputs.h["inst3"].get_text(), inst3name : this.ui.inputs.h["inst3name"].get_text()});
					var this1 = this._list;
					var k = this.ui.inputs.h["name"].get_text();
					this1.h[k] = contr;
					this.clear();
				}
			} else {
				com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("window-contrtr-title"),com_tilbuci_data_Global.ln.get("window-contrtr-nographics"),320,150,com_tilbuci_data_Global.ln.get("default-ok"));
			}
		} else {
			com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("window-contrtr-title"),com_tilbuci_data_Global.ln.get("window-contrtr-noname"),320,150,com_tilbuci_data_Global.ln.get("default-ok"));
		}
	}
	,acImgD: function(evt) {
		this._ac("default");
	}
	,acImgDdel: function(evt) {
		this.ui.inputs.h["default"].set_text("");
	}
	,acImgM: function(evt) {
		this._ac("menus");
	}
	,acImgMdel: function(evt) {
		this.ui.inputs.h["menus"].set_text("");
	}
	,acImgI: function(evt) {
		this._ac("interf");
	}
	,acImgIdel: function(evt) {
		this.ui.inputs.h["interf"].set_text("");
	}
	,acImgI1: function(evt) {
		this._ac("inst1");
	}
	,acImgI1del: function(evt) {
		this.ui.inputs.h["inst1"].set_text("");
	}
	,acImgI2: function(evt) {
		this._ac("inst2");
	}
	,acImgI2del: function(evt) {
		this.ui.inputs.h["inst2"].set_text("");
	}
	,acImgI3: function(evt) {
		this._ac("inst3");
	}
	,acImgI3del: function(evt) {
		this.ui.inputs.h["inst3"].set_text("");
	}
	,onSaveReturn: function(ok,ld) {
		if(ok) {
			if(ld.map.h["e"] == 1) {
				com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("window-contrtr-title"),com_tilbuci_data_Global.ln.get("window-contrtr-ersave1"),320,150,com_tilbuci_data_Global.ln.get("default-ok"));
			} else if(ld.map.h["e"] == 2) {
				com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("window-contrtr-title"),com_tilbuci_data_Global.ln.get("window-contrtr-ersave"),320,150,com_tilbuci_data_Global.ln.get("default-ok"));
			} else {
				com_tilbuci_data_Global.showMsg(com_tilbuci_data_Global.ln.get("window-contrtr-oksave"));
				feathers_core_PopUpManager.removePopUp(this);
			}
		} else {
			com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("window-contrtr-title"),com_tilbuci_data_Global.ln.get("window-contrtr-ersave"),320,150,com_tilbuci_data_Global.ln.get("default-ok"));
		}
	}
	,__class__: com_tilbuci_ui_window_contraptions_WindowContrTarget
});
var com_tilbuci_ui_window_exchange_WindowExchangeCordova = function(ac) {
	com_tilbuci_ui_window_PopupWindow.call(this,ac,com_tilbuci_data_Global.ln.get("window-exchcord-title"),1100,com_tilbuci_ui_base_InterfaceFactory.pickValue(410,500),false,true,true);
};
$hxClasses["com.tilbuci.ui.window.exchange.WindowExchangeCordova"] = com_tilbuci_ui_window_exchange_WindowExchangeCordova;
com_tilbuci_ui_window_exchange_WindowExchangeCordova.__name__ = "com.tilbuci.ui.window.exchange.WindowExchangeCordova";
com_tilbuci_ui_window_exchange_WindowExchangeCordova.__super__ = com_tilbuci_ui_window_PopupWindow;
com_tilbuci_ui_window_exchange_WindowExchangeCordova.prototype = $extend(com_tilbuci_ui_window_PopupWindow.prototype,{
	startInterface: function(evt) {
		this.ui.createHContainer("icon");
		this.ui.createTInput("icon","","",this.ui.hcontainers.h["icon"]);
		var tmp = this.ui;
		var tmp1 = openfl_utils_Assets.getBitmapData("btOpenfile");
		var tmp2 = this.ui.hcontainers.h["icon"];
		tmp.createIconButton("icon",$bind(this,this.onIcon),new openfl_display_Bitmap(tmp1),null,tmp2);
		this.ui.inputs.h["icon"].set_enabled(false);
		var tmp = com_tilbuci_data_Global.ln.get("window-exchcord-title");
		var tmp1 = this.ui;
		var tmp2 = { tp : "Label", id : "about", tx : com_tilbuci_data_Global.ln.get("window-exchcord-about"), vr : ""};
		var tmp3 = { tp : "Label", id : "appid", tx : com_tilbuci_data_Global.ln.get("window-exchcord-appid"), vr : feathers_controls_Label.VARIANT_DETAIL};
		var tmp4 = { tp : "Label", id : "icon", tx : com_tilbuci_data_Global.ln.get("window-exchcord-icon"), vr : ""};
		var tmp5 = { tp : "Custom", cont : this.ui.hcontainers.h["icon"]};
		var tmp6 = { tp : "Label", id : "fullscr", tx : com_tilbuci_data_Global.ln.get("window-exchcord-fullscr"), vr : ""};
		var tmp7 = { tp : "Select", id : "fullscr", vl : [{ text : com_tilbuci_data_Global.ln.get("window-exchcord-fullscr-normal"), value : "normal"},{ text : com_tilbuci_data_Global.ln.get("window-exchcord-fullscr-full"), value : "full"},{ text : com_tilbuci_data_Global.ln.get("window-exchcord-fullscr-kiosk"), value : "kiosk"}], sl : "complete"};
		var tmp8 = { tp : "Button", id : "export", tx : com_tilbuci_data_Global.ln.get("window-exchcord-button"), ac : $bind(this,this.onExport)};
		var tmp9 = { tp : "Label", id : "cord", tx : com_tilbuci_data_Global.ln.get("window-exchcord-aboutcord"), vr : ""};
		var tmp10 = com_tilbuci_data_Global.ln.get("window-exchcord-buttoncord");
		this.addForm(tmp,tmp1.forge("desk",[tmp2,{ tp : "Spacer", id : "about", ht : 5, ln : false},tmp3,{ tp : "TInput", id : "appid", tx : "", vr : ""},tmp4,tmp5,tmp6,tmp7,{ tp : "Spacer", id : "export", ht : 10, ln : false},tmp8,{ tp : "Spacer", id : "nw", ht : 25, ln : true},tmp9,{ tp : "Button", id : "cord", tx : tmp10, ac : $bind(this,this.onCord)}]));
		this.ui.labels.h["about"].set_wordWrap(true);
		this.ui.labels.h["cord"].set_wordWrap(true);
		com_tilbuci_ui_window_PopupWindow.prototype.startInterface.call(this);
	}
	,acStart: function() {
		if(com_tilbuci_data_Global.econfig.get_base().indexOf("localhost") != -1 || com_tilbuci_data_Global.econfig.get_base().indexOf("127.0.0.1") != -1) {
			this.ui.inputs.h["appid"].set_text(com_tilbuci_data_GlobalPlayer.movie.get_mvId().toLowerCase());
		} else {
			var parts = com_tilbuci_data_Global.econfig.get_base().toLowerCase().split("/");
			var reverse = "";
			var domain = "";
			var _g = 0;
			var _g1 = parts.length;
			while(_g < _g1) {
				var i = _g++;
				if(reverse == "" && parts[i] != "" && parts[i] != "http" && parts[i] != "http:" && parts[i] != "https" && parts[i] != "https:") {
					var dots = parts[i].split(".");
					domain = parts[0] + "//" + dots.join(".") + "/";
					dots.reverse();
					reverse = dots.join(".");
				}
			}
			this.ui.inputs.h["appid"].set_text(reverse + "." + com_tilbuci_data_GlobalPlayer.movie.get_mvId().toLowerCase());
		}
		this.ui.inputs.h["icon"].set_text(com_tilbuci_data_GlobalPlayer.mdata.favicon);
		this.ui.hcontainers.h["icon"].setWidth(1060,[1000,50]);
	}
	,onCord: function(evt) {
		var req = new openfl_net_URLRequest("https://capacitorjs.com/");
		req.method = "GET";
		openfl_Lib.getURL(req);
	}
	,onExport: function(evt) {
		if(this.ui.inputs.h["appid"].get_text() == "") {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-exchcord-title"),com_tilbuci_data_Global.ln.get("window-exchcord-noappid"),300,180,this.stage);
		} else if(this.ui.inputs.h["icon"].get_text() == "") {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-exchcord-title"),com_tilbuci_data_Global.ln.get("window-exchcord-noappicon"),300,180,this.stage);
		} else {
			var tmp = com_tilbuci_data_Global.ws;
			var _g = new haxe_ds_StringMap();
			var value = com_tilbuci_data_GlobalPlayer.movie.get_mvId();
			_g.h["movie"] = value;
			_g.h["mode"] = "complete";
			var value = this.ui.inputs.h["appid"].get_text();
			_g.h["appid"] = value;
			var value = this.ui.selects.h["fullscr"].get_selectedItem().value;
			_g.h["fullscr"] = value;
			var value = this.ui.inputs.h["icon"].get_text();
			_g.h["icon"] = value;
			tmp.send("Movie/ExportCordova",_g,$bind(this,this.onExportReturn));
		}
	}
	,onExportReturn: function(ok,ld) {
		if(!ok) {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-exchcord-title"),com_tilbuci_data_Global.ln.get("window-exchcord-error"),300,180,this.stage);
		} else if(ld.map.h["e"] != 0) {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-exchcord-title"),com_tilbuci_data_Global.ln.get("window-exchcord-error"),300,180,this.stage);
		} else {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-exchcord-title"),com_tilbuci_data_Global.ln.get("window-exchcord-ok"),320,200,this.stage);
			var tmp = com_tilbuci_data_Global.ws;
			var _g = new haxe_ds_StringMap();
			_g.h["file"] = "desk";
			_g.h["exp"] = ld.map.h["exp"];
			var value = com_tilbuci_data_GlobalPlayer.movie.get_mvId();
			_g.h["movie"] = value;
			tmp.download(_g);
		}
	}
	,action: function(ac,data) {
		if(ac == "browsecordovaicon") {
			this.ui.inputs.h["icon"].set_text(data.h["file"]);
		}
	}
	,onIcon: function(evt) {
		this._ac("browsecordovaicon");
	}
	,__class__: com_tilbuci_ui_window_exchange_WindowExchangeCordova
});
var com_tilbuci_ui_window_exchange_WindowExchangeDesktop = function(ac) {
	com_tilbuci_ui_window_PopupWindow.call(this,ac,com_tilbuci_data_Global.ln.get("window-exchdesk-title"),1000,com_tilbuci_ui_base_InterfaceFactory.pickValue(600,680),false,true,true);
};
$hxClasses["com.tilbuci.ui.window.exchange.WindowExchangeDesktop"] = com_tilbuci_ui_window_exchange_WindowExchangeDesktop;
com_tilbuci_ui_window_exchange_WindowExchangeDesktop.__name__ = "com.tilbuci.ui.window.exchange.WindowExchangeDesktop";
com_tilbuci_ui_window_exchange_WindowExchangeDesktop.__super__ = com_tilbuci_ui_window_PopupWindow;
com_tilbuci_ui_window_exchange_WindowExchangeDesktop.prototype = $extend(com_tilbuci_ui_window_PopupWindow.prototype,{
	startInterface: function(evt) {
		var tmp = com_tilbuci_data_Global.ln.get("window-exchdesk-title");
		var tmp1 = this.ui;
		var tmp2 = { tp : "Label", id : "about", tx : com_tilbuci_data_Global.ln.get("window-exchdesk-about"), vr : ""};
		var tmp3 = { tp : "Label", id : "window", tx : com_tilbuci_data_Global.ln.get("window-exchdesk-window"), vr : feathers_controls_Label.VARIANT_DETAIL};
		var tmp4 = { tp : "Select", id : "window", vl : [{ text : com_tilbuci_data_Global.ln.get("window-exchdesk-windownormal"), value : "normal"},{ text : com_tilbuci_data_Global.ln.get("window-exchdesk-windowresize"), value : "resize"},{ text : com_tilbuci_data_Global.ln.get("window-exchdesk-windowfull"), value : "full"},{ text : com_tilbuci_data_Global.ln.get("window-exchdesk-windowkiosk"), value : "kiosk"}], sl : "normal"};
		var tmp5 = { tp : "Label", id : "width", tx : com_tilbuci_data_Global.ln.get("window-exchdesk-width"), vr : feathers_controls_Label.VARIANT_DETAIL};
		var tmp6 = { tp : "Label", id : "height", tx : com_tilbuci_data_Global.ln.get("window-exchdesk-height"), vr : feathers_controls_Label.VARIANT_DETAIL};
		var tmp7 = { tp : "Label", id : "icon", tx : com_tilbuci_data_Global.ln.get("window-exchdesk-icon"), vr : feathers_controls_Label.VARIANT_DETAIL};
		var tmp8 = { tp : "Label", id : "author", tx : com_tilbuci_data_Global.ln.get("window-exchdesk-author"), vr : feathers_controls_Label.VARIANT_DETAIL};
		var tmp9 = { tp : "Label", id : "description", tx : com_tilbuci_data_Global.ln.get("window-exchdesk-description"), vr : feathers_controls_Label.VARIANT_DETAIL};
		var tmp10 = { tp : "Button", id : "export", tx : com_tilbuci_data_Global.ln.get("window-exchdesk-button"), ac : $bind(this,this.onExport)};
		var tmp11 = { tp : "Label", id : "nw", tx : com_tilbuci_data_Global.ln.get("window-exchdesk-aboutnw"), vr : ""};
		var tmp12 = com_tilbuci_data_Global.ln.get("window-exchdesk-buttonnw");
		this.addForm(tmp,tmp1.forge("desk",[tmp2,{ tp : "Spacer", id : "about", ht : 10, ln : false},tmp3,tmp4,tmp5,{ tp : "Numeric", id : "width", mn : 240, mx : 1920, vl : 1280, st : 50},tmp6,{ tp : "Numeric", id : "height", mn : 240, mx : 1920, vl : 720, st : 50},tmp7,{ tp : "TInput", id : "icon", tx : "", vr : ""},tmp8,{ tp : "TInput", id : "author", tx : "", vr : ""},tmp9,{ tp : "TInput", id : "description", tx : "", vr : ""},{ tp : "Spacer", id : "export", ht : 10, ln : false},tmp10,{ tp : "Spacer", id : "nw", ht : 20, ln : true},tmp11,{ tp : "Button", id : "nw", tx : tmp12, ac : $bind(this,this.onNw)}]));
		this.ui.labels.h["about"].set_wordWrap(true);
		this.ui.labels.h["nw"].set_wordWrap(true);
		com_tilbuci_ui_window_PopupWindow.prototype.startInterface.call(this);
	}
	,acStart: function() {
		if(com_tilbuci_data_GlobalPlayer.mdata.screen.type == "portrait") {
			this.ui.numerics.h["height"].set_value(600);
			this.ui.numerics.h["width"].set_value(Math.round(com_tilbuci_data_GlobalPlayer.mdata.screen.big * 600 / com_tilbuci_data_GlobalPlayer.mdata.screen.small));
		} else {
			this.ui.numerics.h["width"].set_value(1280);
			this.ui.numerics.h["height"].set_value(Math.round(com_tilbuci_data_GlobalPlayer.mdata.screen.small * 1280 / com_tilbuci_data_GlobalPlayer.mdata.screen.big));
		}
		this.ui.inputs.h["icon"].set_enabled(false);
		this.ui.inputs.h["icon"].set_text(com_tilbuci_data_GlobalPlayer.mdata.favicon);
		this.ui.inputs.h["author"].set_enabled(false);
		this.ui.inputs.h["author"].set_text(com_tilbuci_data_GlobalPlayer.mdata.author);
		this.ui.inputs.h["description"].set_enabled(false);
		this.ui.inputs.h["description"].set_text(com_tilbuci_data_GlobalPlayer.mdata.description);
	}
	,onNw: function(evt) {
		var req = new openfl_net_URLRequest("https://www.electronjs.org/");
		req.method = "GET";
		openfl_Lib.getURL(req);
	}
	,onExport: function(evt) {
		if(com_tilbuci_data_GlobalPlayer.mdata.favicon == "" || com_tilbuci_data_GlobalPlayer.mdata.author == "" || com_tilbuci_data_GlobalPlayer.mdata.description == "") {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-exchdesk-title"),com_tilbuci_data_Global.ln.get("window-exchdesk-errormiss"),300,180,this.stage);
		} else {
			var tmp = com_tilbuci_data_Global.ws;
			var _g = new haxe_ds_StringMap();
			var value = com_tilbuci_data_GlobalPlayer.movie.get_mvId();
			_g.h["movie"] = value;
			_g.h["mode"] = "full";
			var value = this.ui.selects.h["window"].get_selectedItem().value;
			_g.h["window"] = value;
			var value = Math.round(this.ui.numerics.h["width"].get_value());
			_g.h["width"] = value;
			var value = Math.round(this.ui.numerics.h["height"].get_value());
			_g.h["height"] = value;
			_g.h["favicon"] = com_tilbuci_data_GlobalPlayer.mdata.favicon;
			_g.h["author"] = com_tilbuci_data_GlobalPlayer.mdata.author;
			_g.h["description"] = com_tilbuci_data_GlobalPlayer.mdata.description;
			_g.h["title"] = com_tilbuci_data_GlobalPlayer.mdata.title;
			tmp.send("Movie/ExportDesk",_g,$bind(this,this.onExportReturn),12000000);
		}
	}
	,onExportReturn: function(ok,ld) {
		if(!ok) {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-exchdesk-title"),com_tilbuci_data_Global.ln.get("window-exchdesk-error"),300,180,this.stage);
		} else if(ld.map.h["e"] != 0) {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-exchdesk-title"),com_tilbuci_data_Global.ln.get("window-exchdesk-error"),300,180,this.stage);
		} else {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-exchdesk-title"),com_tilbuci_data_Global.ln.get("window-exchdesk-ok"),320,200,this.stage);
			var tmp = com_tilbuci_data_Global.ws;
			var _g = new haxe_ds_StringMap();
			_g.h["file"] = "desk";
			_g.h["exp"] = ld.map.h["exp"];
			var value = com_tilbuci_data_GlobalPlayer.movie.get_mvId();
			_g.h["movie"] = value;
			tmp.download(_g);
		}
	}
	,__class__: com_tilbuci_ui_window_exchange_WindowExchangeDesktop
});
var com_tilbuci_ui_window_exchange_WindowExchangeExport = function(ac) {
	com_tilbuci_ui_window_PopupWindow.call(this,ac,com_tilbuci_data_Global.ln.get("window-exchexport-title"),800,com_tilbuci_ui_base_InterfaceFactory.pickValue(180,200),false,true,true);
};
$hxClasses["com.tilbuci.ui.window.exchange.WindowExchangeExport"] = com_tilbuci_ui_window_exchange_WindowExchangeExport;
com_tilbuci_ui_window_exchange_WindowExchangeExport.__name__ = "com.tilbuci.ui.window.exchange.WindowExchangeExport";
com_tilbuci_ui_window_exchange_WindowExchangeExport.__super__ = com_tilbuci_ui_window_PopupWindow;
com_tilbuci_ui_window_exchange_WindowExchangeExport.prototype = $extend(com_tilbuci_ui_window_PopupWindow.prototype,{
	startInterface: function(evt) {
		var tmp = com_tilbuci_data_Global.ln.get("window-exchexport-title");
		var tmp1 = this.ui;
		var tmp2 = { tp : "Label", id : "about", tx : com_tilbuci_data_Global.ln.get("window-exchexport-about"), vr : ""};
		var tmp3 = com_tilbuci_data_Global.ln.get("window-exchexport-button");
		this.addForm(tmp,tmp1.forge("leftcol",[tmp2,{ tp : "Spacer", id : "export", ht : 20},{ tp : "Button", id : "export", tx : tmp3, ac : $bind(this,this.onExport)}]));
		this.ui.labels.h["about"].set_wordWrap(true);
		com_tilbuci_ui_window_PopupWindow.prototype.startInterface.call(this);
	}
	,kill: function() {
		com_tilbuci_ui_window_PopupWindow.prototype.kill.call(this);
	}
	,onExport: function(evt) {
		var tmp = com_tilbuci_data_Global.ws;
		var _g = new haxe_ds_StringMap();
		var value = com_tilbuci_data_GlobalPlayer.movie.get_mvId();
		_g.h["movie"] = value;
		tmp.send("Movie/Export",_g,$bind(this,this.onExportReturn));
	}
	,onExportReturn: function(ok,ld) {
		if(!ok) {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-exchexport-title"),com_tilbuci_data_Global.ln.get("window-exchexport-error"),300,180,this.stage);
		} else if(ld.map.h["e"] != 0) {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-exchexport-title"),com_tilbuci_data_Global.ln.get("window-exchexport-error"),300,180,this.stage);
		} else {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-exchexport-title"),com_tilbuci_data_Global.ln.get("window-exchexport-ok"),320,200,this.stage);
			var tmp = com_tilbuci_data_Global.ws;
			var _g = new haxe_ds_StringMap();
			_g.h["file"] = "export";
			var value = com_tilbuci_data_GlobalPlayer.movie.get_mvId();
			_g.h["movie"] = value;
			tmp.download(_g);
		}
	}
	,__class__: com_tilbuci_ui_window_exchange_WindowExchangeExport
});
var com_tilbuci_ui_window_exchange_WindowExchangeIframe = function(ac) {
	com_tilbuci_ui_window_PopupWindow.call(this,ac,com_tilbuci_data_Global.ln.get("window-exchiframe-title"),800,com_tilbuci_ui_base_InterfaceFactory.pickValue(280,300),false,true,true);
};
$hxClasses["com.tilbuci.ui.window.exchange.WindowExchangeIframe"] = com_tilbuci_ui_window_exchange_WindowExchangeIframe;
com_tilbuci_ui_window_exchange_WindowExchangeIframe.__name__ = "com.tilbuci.ui.window.exchange.WindowExchangeIframe";
com_tilbuci_ui_window_exchange_WindowExchangeIframe.__super__ = com_tilbuci_ui_window_PopupWindow;
com_tilbuci_ui_window_exchange_WindowExchangeIframe.prototype = $extend(com_tilbuci_ui_window_PopupWindow.prototype,{
	startInterface: function(evt) {
		var tmp = com_tilbuci_data_Global.ln.get("window-exchiframe-title");
		var tmp1 = this.ui;
		var tmp2 = { tp : "Label", id : "about", tx : com_tilbuci_data_Global.ln.get("window-exchiframe-about"), vr : ""};
		var tmp3 = { tp : "Label", id : "location", tx : com_tilbuci_data_Global.ln.get("window-exchiframe-location"), vr : ""};
		var tmp4 = { tp : "Select", id : "location", vl : [{ text : com_tilbuci_data_Global.ln.get("window-exchiframe-locsite"), value : "sites"},{ text : com_tilbuci_data_Global.ln.get("window-exchiframe-loczip"), value : "zip"}], sl : "sites"};
		var tmp5 = com_tilbuci_data_Global.ln.get("window-exchiframe-button");
		this.addForm(tmp,tmp1.forge("leftcol",[tmp2,{ tp : "Spacer", id : "mode", ht : 10},tmp3,tmp4,{ tp : "Spacer", id : "export", ht : 10},{ tp : "Button", id : "export", tx : tmp5, ac : $bind(this,this.onExport)}]));
		this.ui.labels.h["about"].set_wordWrap(true);
		com_tilbuci_ui_window_PopupWindow.prototype.startInterface.call(this);
	}
	,kill: function() {
		com_tilbuci_ui_window_PopupWindow.prototype.kill.call(this);
	}
	,acStart: function() {
		this.ui.setSelectValue("location","sites");
	}
	,onExport: function(evt) {
		var tmp = com_tilbuci_data_Global.ws;
		var _g = new haxe_ds_StringMap();
		var value = com_tilbuci_data_GlobalPlayer.movie.get_mvId();
		_g.h["movie"] = value;
		var value = this.ui.selects.h["location"].get_selectedItem().value;
		_g.h["location"] = value;
		tmp.send("Movie/ExportIframe",_g,$bind(this,this.onExportReturn));
	}
	,onExportReturn: function(ok,ld) {
		if(!ok) {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-exchiframe-title"),com_tilbuci_data_Global.ln.get("window-exchiframe-error"),300,150,this.stage);
		} else if(ld.map.h["e"] != 0) {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-exchiframe-title"),com_tilbuci_data_Global.ln.get("window-exchiframe-error"),300,150,this.stage);
		} else if(ld.map.h["exp"].indexOf(".zip") != -1) {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-exchiframe-title"),com_tilbuci_data_Global.ln.get("window-exchiframe-ok"),320,180,this.stage);
			var tmp = com_tilbuci_data_Global.ws;
			var _g = new haxe_ds_StringMap();
			_g.h["file"] = "website";
			var value = com_tilbuci_data_GlobalPlayer.movie.get_mvId();
			_g.h["movie"] = value;
			tmp.download(_g);
		} else {
			var txt = StringTools.replace(com_tilbuci_data_Global.ln.get("window-exchiframe-siteok"),"[URL]",ld.map.h["exp"]);
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-exchiframe-title"),txt,320,150,this.stage);
			com_tilbuci_data_Global.ws.openurl(ld.map.h["exp"]);
		}
	}
	,__class__: com_tilbuci_ui_window_exchange_WindowExchangeIframe
});
var com_tilbuci_ui_window_exchange_WindowExchangeImport = function(ac) {
	this._movieid = "";
	com_tilbuci_ui_window_PopupWindow.call(this,ac,com_tilbuci_data_Global.ln.get("window-exchimport-title"),800,com_tilbuci_ui_base_InterfaceFactory.pickValue(205,220),false);
};
$hxClasses["com.tilbuci.ui.window.exchange.WindowExchangeImport"] = com_tilbuci_ui_window_exchange_WindowExchangeImport;
com_tilbuci_ui_window_exchange_WindowExchangeImport.__name__ = "com.tilbuci.ui.window.exchange.WindowExchangeImport";
com_tilbuci_ui_window_exchange_WindowExchangeImport.__super__ = com_tilbuci_ui_window_PopupWindow;
com_tilbuci_ui_window_exchange_WindowExchangeImport.prototype = $extend(com_tilbuci_ui_window_PopupWindow.prototype,{
	_idform: null
	,_uploadform: null
	,_movieid: null
	,startInterface: function(evt) {
		var tmp = this.ui;
		var tmp1 = { tp : "Label", id : "aboutupload", tx : com_tilbuci_data_Global.ln.get("window-exchimport-aboutupload"), vr : ""};
		var tmp2 = { tp : "Button", id : "importsend", tx : com_tilbuci_data_Global.ln.get("window-exchimport-buttonselectzip"), ac : $bind(this,this.onSelectZip)};
		var tmp3 = com_tilbuci_data_Global.ln.get("window-exchimport-buttonalready");
		this._uploadform = tmp.forge("upload",[tmp1,{ tp : "Spacer", id : "import", ht : 30},tmp2,{ tp : "Button", id : "importalready", tx : tmp3, ac : $bind(this,this.onAlreadyZip)}]);
		this.addForm("uploadform",this._uploadform);
		this.ui.labels.h["aboutupload"].set_wordWrap(true);
		var tmp = this.ui;
		var tmp1 = { tp : "Label", id : "about", tx : com_tilbuci_data_Global.ln.get("window-exchimport-aboutid"), vr : ""};
		var tmp2 = com_tilbuci_data_Global.ln.get("window-exchimport-buttonid");
		this._idform = tmp.forge("id",[tmp1,{ tp : "TInput", id : "movieid", tx : "", vr : ""},{ tp : "Spacer", id : "import", ht : 30},{ tp : "Button", id : "import", tx : tmp2, ac : $bind(this,this.onCheckId)}]);
		this.addForm("idform",this._idform);
		this.ui.labels.h["about"].set_wordWrap(true);
		com_tilbuci_ui_window_PopupWindow.prototype.startInterface.call(this);
		this._forms.removeChild(this._uploadform);
	}
	,acStart: function() {
		this._forms.removeChildren();
		this._forms.addChild(this._idform);
		this._movieid = "";
		this.ui.inputs.h["movieid"].set_text("");
	}
	,kill: function() {
		com_tilbuci_ui_window_PopupWindow.prototype.kill.call(this);
	}
	,onCheckId: function(evt) {
		this._movieid = "";
		if(this.ui.inputs.h["movieid"].get_text().length >= 3) {
			var tmp = com_tilbuci_data_Global.ws;
			var _g = new haxe_ds_StringMap();
			var value = this.ui.inputs.h["movieid"].get_text();
			_g.h["movie"] = value;
			tmp.send("Movie/ImportID",_g,$bind(this,this.onCheckIdReturn));
		}
	}
	,onCheckIdReturn: function(ok,ld) {
		if(!ok) {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-exchimport-title"),com_tilbuci_data_Global.ln.get("window-exchimport-error"),300,180,this.stage);
		} else if(ld.map.h["e"] != 0) {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-exchimport-title"),com_tilbuci_data_Global.ln.get("window-exchimport-errorid"),300,180,this.stage);
		} else {
			this.ui.labels.h["aboutupload"].set_text(StringTools.replace(com_tilbuci_data_Global.ln.get("window-exchimport-aboutupload"),"[NAME]",ld.map.h["imp"]));
			this.ui.buttons.h["importalready"].set_text(StringTools.replace(com_tilbuci_data_Global.ln.get("window-exchimport-buttonalready"),"[NAME]",ld.map.h["imp"]));
			this._movieid = ld.map.h["imp"];
			this._forms.removeChild(this._idform);
			this._forms.addChild(this._uploadform);
		}
	}
	,onSelectZip: function(evt) {
		com_tilbuci_data_Global.up.browseForMedia($bind(this,this.onFileSelcted),"movie");
	}
	,onFileSelcted: function(ok) {
		if(ok) {
			var tmp = com_tilbuci_data_Global.up;
			var _g = new haxe_ds_StringMap();
			_g.h["movie"] = this._movieid;
			_g.h["type"] = "movie";
			_g.h["path"] = "";
			tmp.uploadMedia($bind(this,this.onUploadReturn),_g);
		}
	}
	,onUploadReturn: function(ok,data) {
		if(ok) {
			var tmp = com_tilbuci_data_Global.ws;
			var _g = new haxe_ds_StringMap();
			_g.h["movie"] = this._movieid;
			tmp.send("Movie/ImportZip",_g,$bind(this,this.onZipReturn));
		} else {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-exchimport-title"),com_tilbuci_data_Global.ln.get("window-exchimport-errorsend"),300,180,this.stage);
		}
	}
	,onAlreadyZip: function(evt) {
		var tmp = com_tilbuci_data_Global.ws;
		var _g = new haxe_ds_StringMap();
		_g.h["movie"] = this._movieid;
		tmp.send("Movie/ImportZip",_g,$bind(this,this.onZipReturn));
	}
	,onZipReturn: function(ok,ld) {
		if(!ok) {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-exchimport-title"),com_tilbuci_data_Global.ln.get("window-exchimport-errorimport"),300,180,this.stage);
		} else if(ld.map.h["e"] == 0) {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-exchimport-title"),com_tilbuci_data_Global.ln.get("window-exchimport-impok"),300,180,this.stage);
			feathers_core_PopUpManager.removePopUp(this);
		} else if(ld.map.h["e"] == 1) {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-exchimport-title"),com_tilbuci_data_Global.ln.get("window-exchimport-errorimp1"),300,180,this.stage);
			this.acStart();
		} else if(ld.map.h["e"] == 2) {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-exchimport-title"),com_tilbuci_data_Global.ln.get("window-exchimport-errorimp2"),300,180,this.stage);
			this.acStart();
		} else if(ld.map.h["e"] == 3) {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-exchimport-title"),com_tilbuci_data_Global.ln.get("window-exchimport-errorimp3"),300,180,this.stage);
			this.acStart();
		} else if(ld.map.h["e"] == 4) {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-exchimport-title"),com_tilbuci_data_Global.ln.get("window-exchimport-errorimp4"),300,180,this.stage);
			this.acStart();
		} else if(ld.map.h["e"] == 5) {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-exchimport-title"),com_tilbuci_data_Global.ln.get("window-exchimport-errorimp5"),300,180,this.stage);
			this.acStart();
		} else if(ld.map.h["e"] == 6) {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-exchimport-title"),com_tilbuci_data_Global.ln.get("window-exchimport-errorimp6"),300,180,this.stage);
			this.acStart();
		} else {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-exchimport-title"),com_tilbuci_data_Global.ln.get("window-exchimport-errorimport"),300,180,this.stage);
			this.acStart();
		}
	}
	,__class__: com_tilbuci_ui_window_exchange_WindowExchangeImport
});
var com_tilbuci_ui_window_exchange_WindowExchangePublish = function(ac) {
	com_tilbuci_ui_window_PopupWindow.call(this,ac,com_tilbuci_data_Global.ln.get("window-exchpub-title"),600,com_tilbuci_ui_base_InterfaceFactory.pickValue(215,230),false,true,true);
};
$hxClasses["com.tilbuci.ui.window.exchange.WindowExchangePublish"] = com_tilbuci_ui_window_exchange_WindowExchangePublish;
com_tilbuci_ui_window_exchange_WindowExchangePublish.__name__ = "com.tilbuci.ui.window.exchange.WindowExchangePublish";
com_tilbuci_ui_window_exchange_WindowExchangePublish.__super__ = com_tilbuci_ui_window_PopupWindow;
com_tilbuci_ui_window_exchange_WindowExchangePublish.prototype = $extend(com_tilbuci_ui_window_PopupWindow.prototype,{
	startInterface: function(evt) {
		var tmp = com_tilbuci_data_Global.ln.get("window-exchpub-title");
		var tmp1 = this.ui;
		var tmp2 = { tp : "Label", id : "about", tx : com_tilbuci_data_Global.ln.get("window-exchpub-about"), vr : ""};
		var tmp3 = com_tilbuci_data_Global.ln.get("window-exchpub-button");
		this.addForm(tmp,tmp1.forge("pub",[tmp2,{ tp : "Spacer", id : "about", ht : 20, ln : false},{ tp : "Button", id : "export", tx : tmp3, ac : $bind(this,this.onExport)}]));
		this.ui.labels.h["about"].set_wordWrap(true);
		com_tilbuci_ui_window_PopupWindow.prototype.startInterface.call(this);
	}
	,acStart: function() {
		com_tilbuci_ui_window_PopupWindow.prototype.acStart.call(this);
	}
	,onExport: function(evt) {
		var tmp = com_tilbuci_data_Global.ws;
		var _g = new haxe_ds_StringMap();
		var value = com_tilbuci_data_GlobalPlayer.movie.get_mvId();
		_g.h["movie"] = value;
		tmp.send("Movie/ExportPub",_g,$bind(this,this.onExportReturn));
	}
	,onExportReturn: function(ok,ld) {
		if(!ok) {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-exchpub-title"),com_tilbuci_data_Global.ln.get("window-exchpub-error"),300,180,this.stage);
		} else if(ld.map.h["e"] != 0) {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-exchpub-title"),com_tilbuci_data_Global.ln.get("window-exchpub-error"),300,180,this.stage);
		} else {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-exchpub-title"),com_tilbuci_data_Global.ln.get("window-exchpub-ok"),320,200,this.stage);
			var tmp = com_tilbuci_data_Global.ws;
			var _g = new haxe_ds_StringMap();
			_g.h["file"] = "pub";
			var value = com_tilbuci_data_GlobalPlayer.movie.get_mvId();
			_g.h["movie"] = value;
			tmp.download(_g);
		}
	}
	,__class__: com_tilbuci_ui_window_exchange_WindowExchangePublish
});
var com_tilbuci_ui_window_exchange_WindowExchangePwa = function(ac) {
	com_tilbuci_ui_window_PopupWindow.call(this,ac,com_tilbuci_data_Global.ln.get("window-exchpwa-title"),1000,com_tilbuci_ui_base_InterfaceFactory.pickValue(525,600),false,true,true);
};
$hxClasses["com.tilbuci.ui.window.exchange.WindowExchangePwa"] = com_tilbuci_ui_window_exchange_WindowExchangePwa;
com_tilbuci_ui_window_exchange_WindowExchangePwa.__name__ = "com.tilbuci.ui.window.exchange.WindowExchangePwa";
com_tilbuci_ui_window_exchange_WindowExchangePwa.__super__ = com_tilbuci_ui_window_PopupWindow;
com_tilbuci_ui_window_exchange_WindowExchangePwa.prototype = $extend(com_tilbuci_ui_window_PopupWindow.prototype,{
	startInterface: function(evt) {
		var tmp = com_tilbuci_data_Global.ln.get("window-exchpwa-title");
		var tmp1 = this.ui;
		var tmp2 = { tp : "Label", id : "about", tx : com_tilbuci_data_Global.ln.get("window-exchpwa-about"), vr : ""};
		var tmp3 = { tp : "Label", id : "name", tx : com_tilbuci_data_Global.ln.get("window-exchpwa-name"), vr : feathers_controls_Label.VARIANT_DETAIL};
		var tmp4 = { tp : "Label", id : "shortname", tx : com_tilbuci_data_Global.ln.get("window-exchpwa-shortname"), vr : feathers_controls_Label.VARIANT_DETAIL};
		var tmp5 = { tp : "Label", id : "lang", tx : com_tilbuci_data_Global.ln.get("window-exchpwa-language"), vr : feathers_controls_Label.VARIANT_DETAIL};
		var tmp6 = { tp : "Label", id : "icon", tx : com_tilbuci_data_Global.ln.get("window-exchpwa-icon"), vr : feathers_controls_Label.VARIANT_DETAIL};
		var tmp7 = { tp : "Label", id : "location", tx : com_tilbuci_data_Global.ln.get("window-exchpwa-location"), vr : ""};
		var tmp8 = { tp : "Select", id : "location", vl : [{ text : com_tilbuci_data_Global.ln.get("window-exchpwa-locsite"), value : "pwa"},{ text : com_tilbuci_data_Global.ln.get("window-exchpwa-loczip"), value : "zip"}], sl : "sites", ch : $bind(this,this.onChangeLocation)};
		var tmp9 = { tp : "Label", id : "url", tx : com_tilbuci_data_Global.ln.get("window-exchpwa-url"), vr : feathers_controls_Label.VARIANT_DETAIL};
		var tmp10 = com_tilbuci_data_Global.ln.get("window-exchpwa-button");
		this.addForm(tmp,tmp1.forge("pwa",[tmp2,tmp3,{ tp : "TInput", id : "name", vl : "", vr : ""},tmp4,{ tp : "TInput", id : "shortname", vl : "", vr : ""},tmp5,{ tp : "TInput", id : "lang", vl : "", vr : ""},tmp6,{ tp : "TInput", id : "icon", vl : "", vr : ""},tmp7,tmp8,tmp9,{ tp : "TInput", id : "url", vl : "", vr : ""},{ tp : "Spacer", id : "export", ht : 20},{ tp : "Button", id : "export", tx : tmp10, ac : $bind(this,this.onExport)}]));
		this.ui.labels.h["about"].set_wordWrap(true);
		this.ui.inputs.h["shortname"].set_maxChars(12);
		com_tilbuci_ui_window_PopupWindow.prototype.startInterface.call(this);
	}
	,acStart: function() {
		this.ui.inputs.h["name"].set_text(com_tilbuci_data_GlobalPlayer.mdata.title);
		if(com_tilbuci_data_GlobalPlayer.mdata.title.length <= 12) {
			this.ui.inputs.h["shortname"].set_text(com_tilbuci_data_GlobalPlayer.mdata.title);
		} else {
			this.ui.inputs.h["shortname"].set_text("");
		}
		this.ui.inputs.h["lang"].set_text("en-US");
		this.ui.inputs.h["icon"].set_text(com_tilbuci_data_GlobalPlayer.mdata.favicon);
		this.ui.inputs.h["icon"].set_enabled(false);
		this.ui.setSelectValue("location","pwa");
		this.ui.inputs.h["url"].set_text(StringTools.replace(com_tilbuci_data_Global.econfig.get_base() + "pwa/" + com_tilbuci_data_GlobalPlayer.movie.get_mvId() + "/","/editor/","/"));
	}
	,onChangeLocation: function(evt) {
		if(this.ui.selects.h["location"].get_selectedItem().value == "zip") {
			this.ui.inputs.h["url"].set_text("");
		} else {
			this.ui.inputs.h["url"].set_text(StringTools.replace(com_tilbuci_data_Global.econfig.get_base() + "pwa/" + com_tilbuci_data_GlobalPlayer.movie.get_mvId() + "/","/editor/","/"));
		}
	}
	,onExport: function(evt) {
		if(this.ui.inputs.h["name"].get_text().length < 3 || this.ui.inputs.h["shortname"].get_text().length < 3) {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-exchpwa-title"),com_tilbuci_data_Global.ln.get("window-exchpwa-noname"),300,180,this.stage);
		} else if(this.ui.inputs.h["icon"].get_text() == "" || HxOverrides.substr(this.ui.inputs.h["icon"].get_text().toLowerCase(),-3,null) != "png") {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-exchpwa-title"),com_tilbuci_data_Global.ln.get("window-exchpwa-nopng"),300,180,this.stage);
		} else if(this.ui.inputs.h["lang"].get_text().length < 5) {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-exchpwa-title"),com_tilbuci_data_Global.ln.get("window-exchpwa-nolang"),300,180,this.stage);
		} else {
			var url = this.ui.inputs.h["url"].get_text().toLowerCase();
			if(HxOverrides.substr(url,0,8) != "https://") {
				this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-exchpwa-title"),com_tilbuci_data_Global.ln.get("window-exchpwa-nourl"),300,180,this.stage);
			} else {
				var tmp = com_tilbuci_data_Global.ws;
				var _g = new haxe_ds_StringMap();
				var value = com_tilbuci_data_GlobalPlayer.movie.get_mvId();
				_g.h["movie"] = value;
				var value = this.ui.inputs.h["name"].get_text();
				_g.h["name"] = value;
				var value = this.ui.inputs.h["shortname"].get_text();
				_g.h["shortname"] = value;
				var value = this.ui.inputs.h["lang"].get_text();
				_g.h["lang"] = value;
				_g.h["url"] = url;
				var value = this.ui.selects.h["location"].get_selectedItem().value;
				_g.h["location"] = value;
				tmp.send("Movie/ExportPwa",_g,$bind(this,this.onExportReturn));
			}
		}
	}
	,onExportReturn: function(ok,ld) {
		if(!ok) {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-exchpwa-title"),com_tilbuci_data_Global.ln.get("window-exchpwa-error"),300,180,this.stage);
		} else if(ld.map.h["e"] != 0) {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-exchpwa-title"),com_tilbuci_data_Global.ln.get("window-exchpwa-error"),300,180,this.stage);
		} else if(ld.map.h["exp"].indexOf(".zip") != -1) {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-exchpwa-title"),com_tilbuci_data_Global.ln.get("window-exchpwa-ok"),320,200,this.stage);
			var tmp = com_tilbuci_data_Global.ws;
			var _g = new haxe_ds_StringMap();
			_g.h["file"] = "pwa";
			var value = com_tilbuci_data_GlobalPlayer.movie.get_mvId();
			_g.h["movie"] = value;
			tmp.download(_g);
		} else {
			var txt = StringTools.replace(com_tilbuci_data_Global.ln.get("window-exchpwa-siteok"),"[URL]",ld.map.h["exp"]);
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-exchpwa-title"),txt,320,150,this.stage);
			com_tilbuci_data_Global.ws.openurl(ld.map.h["exp"]);
		}
	}
	,__class__: com_tilbuci_ui_window_exchange_WindowExchangePwa
});
var com_tilbuci_ui_window_exchange_WindowExchangeWebsite = function(ac) {
	com_tilbuci_ui_window_PopupWindow.call(this,ac,com_tilbuci_data_Global.ln.get("window-exchsite-title"),800,com_tilbuci_ui_base_InterfaceFactory.pickValue(370,400),false,true,true);
};
$hxClasses["com.tilbuci.ui.window.exchange.WindowExchangeWebsite"] = com_tilbuci_ui_window_exchange_WindowExchangeWebsite;
com_tilbuci_ui_window_exchange_WindowExchangeWebsite.__name__ = "com.tilbuci.ui.window.exchange.WindowExchangeWebsite";
com_tilbuci_ui_window_exchange_WindowExchangeWebsite.__super__ = com_tilbuci_ui_window_PopupWindow;
com_tilbuci_ui_window_exchange_WindowExchangeWebsite.prototype = $extend(com_tilbuci_ui_window_PopupWindow.prototype,{
	startInterface: function(evt) {
		var tmp = com_tilbuci_data_Global.ln.get("window-exchsite-title");
		var tmp1 = this.ui;
		var tmp2 = { tp : "Label", id : "about", tx : com_tilbuci_data_Global.ln.get("window-exchsite-about"), vr : ""};
		var tmp3 = { tp : "Label", id : "location", tx : com_tilbuci_data_Global.ln.get("window-exchsite-location"), vr : ""};
		var tmp4 = { tp : "Select", id : "location", vl : [{ text : com_tilbuci_data_Global.ln.get("window-exchsite-locsite"), value : "sites"},{ text : com_tilbuci_data_Global.ln.get("window-exchsite-loczip"), value : "zip"}], sl : "sites", ch : $bind(this,this.onChangeLocation)};
		var tmp5 = { tp : "Label", id : "sitemap", tx : com_tilbuci_data_Global.ln.get("window-exchsite-sitemap"), vr : "", wrap : true};
		var tmp6 = com_tilbuci_data_Global.ln.get("window-exchexport-button");
		this.addForm(tmp,tmp1.forge("leftcol",[tmp2,{ tp : "Spacer", id : "location", ht : 10},tmp3,tmp4,{ tp : "Spacer", id : "sitemap", ht : 10},tmp5,{ tp : "TInput", id : "sitemap", tx : "", vr : ""},{ tp : "Spacer", id : "export", ht : 10},{ tp : "Button", id : "export", tx : tmp6, ac : $bind(this,this.onExport)}]));
		this.ui.labels.h["about"].set_wordWrap(true);
		this.ui.labels.h["sitemap"].set_wordWrap(true);
		com_tilbuci_ui_window_PopupWindow.prototype.startInterface.call(this);
	}
	,kill: function() {
		com_tilbuci_ui_window_PopupWindow.prototype.kill.call(this);
	}
	,acStart: function() {
		this.ui.setSelectValue("location","sites");
		this.ui.inputs.h["sitemap"].set_text(StringTools.replace(com_tilbuci_data_Global.econfig.get_base() + "sites/" + com_tilbuci_data_GlobalPlayer.movie.get_mvId() + "/","/editor/","/"));
	}
	,onChangeLocation: function(evt) {
		if(this.ui.selects.h["location"].get_selectedItem().value == "zip") {
			this.ui.inputs.h["sitemap"].set_text("");
		} else {
			this.ui.inputs.h["sitemap"].set_text(StringTools.replace(com_tilbuci_data_Global.econfig.get_base() + "sites/" + com_tilbuci_data_GlobalPlayer.movie.get_mvId() + "/","/editor/","/"));
		}
	}
	,onExport: function(evt) {
		var tmp = com_tilbuci_data_Global.ws;
		var _g = new haxe_ds_StringMap();
		var value = com_tilbuci_data_GlobalPlayer.movie.get_mvId();
		_g.h["movie"] = value;
		_g.h["mode"] = "webgl";
		var value = this.ui.selects.h["location"].get_selectedItem().value;
		_g.h["location"] = value;
		var value = this.ui.inputs.h["sitemap"].get_text();
		_g.h["sitemap"] = value;
		tmp.send("Movie/ExportSite",_g,$bind(this,this.onExportReturn));
	}
	,onExportReturn: function(ok,ld) {
		if(!ok) {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-exchsite-title"),com_tilbuci_data_Global.ln.get("window-exchsite-error"),300,150,this.stage);
		} else if(ld.map.h["e"] != 0) {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-exchsite-title"),com_tilbuci_data_Global.ln.get("window-exchsite-error"),300,150,this.stage);
		} else if(ld.map.h["exp"].indexOf(".zip") != -1) {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-exchsite-title"),com_tilbuci_data_Global.ln.get("window-exchsite-ok"),320,180,this.stage);
			var tmp = com_tilbuci_data_Global.ws;
			var _g = new haxe_ds_StringMap();
			_g.h["file"] = "website";
			var value = com_tilbuci_data_GlobalPlayer.movie.get_mvId();
			_g.h["movie"] = value;
			tmp.download(_g);
		} else {
			var txt = StringTools.replace(com_tilbuci_data_Global.ln.get("window-exchsite-siteok"),"[URL]",ld.map.h["exp"]);
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-exchsite-title"),txt,320,150,this.stage);
			com_tilbuci_data_Global.ws.openurl(ld.map.h["exp"]);
		}
	}
	,__class__: com_tilbuci_ui_window_exchange_WindowExchangeWebsite
});
var com_tilbuci_ui_window_keyframe_WindowKeyframeManage = function(ac) {
	com_tilbuci_ui_window_PopupWindow.call(this,ac,com_tilbuci_data_Global.ln.get("window-kfmanage-title"),1000,com_tilbuci_ui_base_InterfaceFactory.pickValue(520,540),false,true,true);
};
$hxClasses["com.tilbuci.ui.window.keyframe.WindowKeyframeManage"] = com_tilbuci_ui_window_keyframe_WindowKeyframeManage;
com_tilbuci_ui_window_keyframe_WindowKeyframeManage.__name__ = "com.tilbuci.ui.window.keyframe.WindowKeyframeManage";
com_tilbuci_ui_window_keyframe_WindowKeyframeManage.__super__ = com_tilbuci_ui_window_PopupWindow;
com_tilbuci_ui_window_keyframe_WindowKeyframeManage.prototype = $extend(com_tilbuci_ui_window_PopupWindow.prototype,{
	startInterface: function(evt) {
		var tmp = com_tilbuci_data_Global.ln.get("window-kfmanage-title");
		var tmp1 = this.ui;
		var tmp2 = this.ui;
		var tmp3 = { tp : "Label", id : "keyframes", tx : com_tilbuci_data_Global.ln.get("window-kfmanage-keyframes"), vr : "detail"};
		var tmp4 = { tp : "Button", id : "actions", tx : com_tilbuci_data_Global.ln.get("window-kfmanage-actions"), ac : $bind(this,this.setActions)};
		var tmp5 = { tp : "Button", id : "add", tx : com_tilbuci_data_Global.ln.get("window-kfmanage-add"), ac : $bind(this,this.addKeyframe)};
		var tmp6 = com_tilbuci_data_Global.ln.get("window-kfmanage-remove");
		var tmp7 = tmp2.forge("leftcol",[tmp3,{ tp : "List", id : "keyframes", vl : [], sl : null, ht : 332},tmp4,tmp5,{ tp : "Button", id : "remove", tx : tmp6, ac : $bind(this,this.remove)}]);
		var tmp2 = this.ui;
		var tmp3 = { tp : "Label", id : "instances", tx : com_tilbuci_data_Global.ln.get("window-kfmanage-instances"), vr : "detail"};
		var tmp4 = com_tilbuci_data_Global.ln.get("window-kfmanage-instremove");
		this.addForm(tmp,tmp1.createColumnHolder("columns",tmp7,tmp2.forge("rightcol",[tmp3,{ tp : "List", id : "instances", vl : [], sl : null, ht : 390},{ tp : "Button", id : "removeinst", tx : tmp4, ac : $bind(this,this.removeInst)}])));
		com_tilbuci_ui_window_PopupWindow.prototype.startInterface.call(this);
		this.ui.listChange("keyframes",$bind(this,this.onKfChange));
		this.loadKfs();
	}
	,acStart: function() {
		this.loadKfs();
	}
	,loadKfs: function() {
		var kfs = [];
		var _g = 0;
		var _g1 = com_tilbuci_data_GlobalPlayer.movie.scene.keyframes.length;
		while(_g < _g1) {
			var kf = _g++;
			kfs.push({ text : Std.string(kf + 1), value : kf});
		}
		this.ui.setListValues("keyframes",kfs);
		this.ui.setListValues("instances",[]);
	}
	,onKfChange: function(evt) {
		var insts = [];
		if(this.ui.lists.h["keyframes"].get_selectedItem() != null) {
			var h = com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[this.ui.lists.h["keyframes"].get_selectedItem().value].h;
			var k_h = h;
			var k_keys = Object.keys(h);
			var k_length = k_keys.length;
			var k_current = 0;
			while(k_current < k_length) {
				var k = k_keys[k_current++];
				insts.push({ text : k, value : k});
			}
		}
		this.ui.setListValues("instances",insts);
	}
	,kill: function() {
		com_tilbuci_ui_window_PopupWindow.prototype.kill.call(this);
	}
	,remove: function(evt) {
		if(this.ui.lists.h["keyframes"].get_selectedItem() != null) {
			if(com_tilbuci_data_GlobalPlayer.movie.scene.keyframes.length > 1) {
				com_tilbuci_data_GlobalPlayer.area.loadKeyframe(com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[this.ui.lists.h["keyframes"].get_selectedItem().value],this.ui.lists.h["keyframes"].get_selectedItem().value);
				this._ac("remove");
				this.loadKfs();
			} else {
				com_tilbuci_data_Global.showMsg(com_tilbuci_data_Global.ln.get("window-kfmanage-onlyone"));
			}
		}
	}
	,setActions: function(evt) {
		if(this.ui.lists.h["keyframes"].get_selectedItem() != null) {
			com_tilbuci_data_Global.showActionWindow(com_tilbuci_data_GlobalPlayer.movie.scene.ackeyframes[this.ui.lists.h["keyframes"].get_selectedItem().value],$bind(this,this.onNewAction));
		}
	}
	,onNewAction: function(newac) {
		com_tilbuci_data_GlobalPlayer.movie.scene.ackeyframes[this.ui.lists.h["keyframes"].get_selectedItem().value] = newac;
	}
	,addKeyframe: function(evt) {
		if(this.ui.lists.h["keyframes"].get_selectedItem() != null) {
			com_tilbuci_data_GlobalPlayer.area.loadKeyframe(com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[this.ui.lists.h["keyframes"].get_selectedItem().value],this.ui.lists.h["keyframes"].get_selectedItem().value);
			this._ac("add");
			this.loadKfs();
		}
	}
	,removeInst: function(evt) {
		if(this.ui.lists.h["keyframes"].get_selectedItem() != null && this.ui.lists.h["instances"].get_selectedItem() != null) {
			com_tilbuci_data_GlobalPlayer.area.loadKeyframe(com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[this.ui.lists.h["keyframes"].get_selectedItem().value],this.ui.lists.h["keyframes"].get_selectedItem().value);
			com_tilbuci_data_GlobalPlayer.area.removeInstance(this.ui.lists.h["instances"].get_selectedItem().value);
			this.onKfChange();
			this._ac("reload");
		}
	}
	,__class__: com_tilbuci_ui_window_keyframe_WindowKeyframeManage
});
var com_tilbuci_ui_window_media_WindowAssetBase = function(ac) {
	this._frtime = 100;
	this._frames = 1;
	this._endAction = "";
	com_tilbuci_ui_window_PopupWindow.call(this,ac,com_tilbuci_data_Global.ln.get("window-asset-title"),1000,380,false,true,true);
};
$hxClasses["com.tilbuci.ui.window.media.WindowAssetBase"] = com_tilbuci_ui_window_media_WindowAssetBase;
com_tilbuci_ui_window_media_WindowAssetBase.__name__ = "com.tilbuci.ui.window.media.WindowAssetBase";
com_tilbuci_ui_window_media_WindowAssetBase.__super__ = com_tilbuci_ui_window_PopupWindow;
com_tilbuci_ui_window_media_WindowAssetBase.prototype = $extend(com_tilbuci_ui_window_PopupWindow.prototype,{
	_interface: null
	,_instance: null
	,_asset: null
	,_endAction: null
	,_frames: null
	,_frtime: null
	,startInterface: function(evt) {
		this.ui.createHContainer("atfile");
		this.ui.createTInput("atfile","","",null,false);
		this.ui.inputs.h["atfile"].set_width(875);
		this.ui.inputs.h["atfile"].set_enabled(false);
		this.ui.hcontainers.h["atfile"].addChild(this.ui.inputs.h["atfile"]);
		this.ui.createIconButton("atfile",$bind(this,this.onFile),new openfl_display_Bitmap(openfl_utils_Assets.getBitmapData("btOpenfile")),null,null,false);
		this.ui.buttons.h["atfile"].set_width(50);
		this.ui.hcontainers.h["atfile"].addChild(this.ui.buttons.h["atfile"]);
		this.ui.hcontainers.h["atfile"].setWidth(960,[870,70]);
		var tmp = this.ui;
		var tmp1 = { tp : "Label", id : "name", tx : com_tilbuci_data_Global.ln.get("window-asset-name"), vr : ""};
		var tmp2 = { tp : "Label", id : "atfile", tx : com_tilbuci_data_Global.ln.get("window-asset-file"), vr : ""};
		var tmp3 = { tp : "Custom", cont : this.ui.hcontainers.h["atfile"]};
		var tmp4 = { tp : "Button", id : "shape", tx : com_tilbuci_data_Global.ln.get("window-asset-shape"), ac : $bind(this,this.onFile)};
		var tmp5 = { tp : "Button", id : "spritemap", tx : com_tilbuci_data_Global.ln.get("window-asset-spritemap"), ac : $bind(this,this.onFile)};
		var tmp6 = { tp : "Button", id : "text", tx : com_tilbuci_data_Global.ln.get("window-asset-text"), ac : $bind(this,this.onFile)};
		var tmp7 = { tp : "Label", id : "asttime", tx : com_tilbuci_data_Global.ln.get("window-collection-asttime"), vr : ""};
		var tmp8 = { tp : "Label", id : "assetac", tx : com_tilbuci_data_Global.ln.get("window-collection-astac"), vr : ""};
		var tmp9 = { tp : "Select", id : "assetac", vl : [{ text : com_tilbuci_data_Global.ln.get("window-collection-astacloop"), value : "loop"},{ text : com_tilbuci_data_Global.ln.get("window-collection-astacnext"), value : "next"},{ text : com_tilbuci_data_Global.ln.get("window-collection-astacprevious"), value : "previous"},{ text : com_tilbuci_data_Global.ln.get("window-collection-astacstop"), value : "stop"},{ text : com_tilbuci_data_Global.ln.get("window-collection-astacaction"), value : "action"}], sl : null};
		var tmp10 = { tp : "Button", id : "assetac", tx : com_tilbuci_data_Global.ln.get("window-collection-astacset"), ac : $bind(this,this.onEndActions)};
		var tmp11 = { tp : "Button", id : "btok", tx : com_tilbuci_data_Global.ln.get("window-asset-btok"), ac : $bind(this,this.onSave)};
		var tmp12 = com_tilbuci_data_Global.ln.get("window-asset-btcancel");
		this._interface = tmp.forge("properties",[tmp1,{ tp : "TInput", id : "name", tx : "", vr : ""},tmp2,tmp3,tmp4,tmp5,tmp6,tmp7,{ tp : "Numeric", id : "asttime", mn : 1, mx : 1000, st : 1, vl : 1},tmp8,tmp9,tmp10,{ tp : "Spacer", id : "buttons", ht : 10, ln : false},tmp11,{ tp : "Button", id : "btcancel", tx : tmp12, ac : $bind(this,this.onClose)}]);
		this.addForm("properties",this._interface);
		com_tilbuci_ui_window_PopupWindow.prototype.startInterface.call(this);
	}
	,acStart: function() {
		this._instance = null;
		this._asset = null;
	}
	,action: function(ac,data) {
		if(ac == "setfile") {
			this.ui.inputs.h["atfile"].set_text(data.h["file"]);
			this._frames = Std.parseInt(data.h["frames"]);
			this._frtime = Std.parseInt(data.h["frtime"]);
		} else {
			this._instance = com_tilbuci_data_GlobalPlayer.area.pickInstance(data.h["instance"]);
			if(this._instance != null) {
				var this1 = com_tilbuci_data_GlobalPlayer.movie.collections;
				var key = this._instance.getCurrentStr("collection");
				if(Object.prototype.hasOwnProperty.call(this1.h,key)) {
					var this1 = com_tilbuci_data_GlobalPlayer.movie.collections;
					var key = this._instance.getCurrentStr("collection");
					var this2 = this1.h[key].assets;
					var key = this._instance.getCurrentStr("asset");
					if(Object.prototype.hasOwnProperty.call(this2.h,key)) {
						var this1 = com_tilbuci_data_GlobalPlayer.movie.collections;
						var key = this._instance.getCurrentStr("collection");
						var this2 = this1.h[key].assets;
						var key = this._instance.getCurrentStr("asset");
						this._asset = this2.h[key];
						if(this._asset.ok) {
							this._endAction = this._asset.action;
							this._frames = this._asset.frames;
							this._frtime = this._asset.frtime;
							this.show();
						} else {
							com_tilbuci_data_Global.showMsg(com_tilbuci_data_Global.ln.get("window-asset-noasset"));
							feathers_core_PopUpManager.removePopUp(this);
						}
					} else {
						com_tilbuci_data_Global.showMsg(com_tilbuci_data_Global.ln.get("window-asset-noasset"));
						feathers_core_PopUpManager.removePopUp(this);
					}
				} else {
					com_tilbuci_data_Global.showMsg(com_tilbuci_data_Global.ln.get("window-asset-nocollection"));
					feathers_core_PopUpManager.removePopUp(this);
				}
			} else {
				com_tilbuci_data_Global.showMsg(com_tilbuci_data_Global.ln.get("window-asset-noinstance"));
				feathers_core_PopUpManager.removePopUp(this);
			}
		}
	}
	,show: function() {
		this._interface.removeChildren();
		this._interface.addChild(this.ui.labels.h["name"]);
		this._interface.addChild(this.ui.inputs.h["name"]);
		this.ui.inputs.h["name"].set_text(this._asset.name);
		this.ui.inputs.h["atfile"].set_text(this._asset.file.h["@1"]);
		switch(this._asset.type) {
		case "audio":
			this._interface.addChild(this.ui.labels.h["atfile"]);
			this._interface.addChild(this.ui.hcontainers.h["atfile"]);
			break;
		case "html":
			this._interface.addChild(this.ui.labels.h["atfile"]);
			this._interface.addChild(this.ui.hcontainers.h["atfile"]);
			this._interface.addChild(this.ui.labels.h["asttime"]);
			this._interface.addChild(this.ui.numerics.h["asttime"]);
			this.ui.numerics.h["asttime"].set_value(this._asset.time);
			break;
		case "paragraph":
			this._interface.addChild(this.ui.buttons.h["text"]);
			this._interface.addChild(this.ui.labels.h["asttime"]);
			this._interface.addChild(this.ui.numerics.h["asttime"]);
			this.ui.numerics.h["asttime"].set_value(this._asset.time);
			break;
		case "picture":
			this._interface.addChild(this.ui.labels.h["atfile"]);
			this._interface.addChild(this.ui.hcontainers.h["atfile"]);
			this._interface.addChild(this.ui.labels.h["asttime"]);
			this._interface.addChild(this.ui.numerics.h["asttime"]);
			this.ui.numerics.h["asttime"].set_value(this._asset.time);
			break;
		case "shape":
			this._interface.addChild(this.ui.buttons.h["shape"]);
			this._interface.addChild(this.ui.labels.h["asttime"]);
			this._interface.addChild(this.ui.numerics.h["asttime"]);
			this.ui.numerics.h["asttime"].set_value(this._asset.time);
			break;
		case "spritemap":
			this._interface.addChild(this.ui.buttons.h["spritemap"]);
			this._interface.addChild(this.ui.labels.h["asttime"]);
			this._interface.addChild(this.ui.numerics.h["asttime"]);
			this.ui.numerics.h["asttime"].set_value(this._asset.time);
			break;
		case "video":
			this._interface.addChild(this.ui.labels.h["atfile"]);
			this._interface.addChild(this.ui.hcontainers.h["atfile"]);
			break;
		}
		switch(this._endAction) {
		case "":
			this.ui.setSelectValue("assetac","loop");
			break;
		case "loop":
			this.ui.setSelectValue("assetac",this._endAction);
			break;
		case "next":
			this.ui.setSelectValue("assetac",this._endAction);
			break;
		case "previous":
			this.ui.setSelectValue("assetac",this._endAction);
			break;
		case "stop":
			this.ui.setSelectValue("assetac",this._endAction);
			break;
		default:
			this.ui.setSelectValue("assetac","action");
		}
		this._interface.addChild(this.ui.labels.h["assetac"]);
		this._interface.addChild(this.ui.selects.h["assetac"]);
		this._interface.addChild(this.ui.buttons.h["assetac"]);
		this._interface.addChild(this.ui.spacers.h["buttons"]);
		this._interface.addChild(this.ui.buttons.h["btok"]);
		this._interface.addChild(this.ui.buttons.h["btcancel"]);
	}
	,onSave: function(evt) {
		if(this.ui.inputs.h["name"].get_text().length < 5) {
			com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("window-asset-title"),com_tilbuci_data_Global.ln.get("window-collection-astnameer"),320,180,com_tilbuci_data_Global.ln.get("default-ok"));
		} else {
			this._asset.name = this.ui.inputs.h["name"].get_text();
			if(this.ui.selects.h["assetac"].get_selectedItem().value == "action") {
				this._asset.action = this._endAction;
			} else {
				this._asset.action = this.ui.selects.h["assetac"].get_selectedItem().value;
			}
			var tmp = this.ui.numerics.h["asttime"].get_value();
			this._asset.time = Math.round(tmp);
			this._asset.frames = this._frames;
			this._asset.frtime = this._frtime;
			var curfile = this._asset.file.h["@1"];
			var this1 = this._asset.file;
			var v = this.ui.inputs.h["atfile"].get_text();
			this1.h["@1"] = v;
			if(this._asset.file.h["@2"] == curfile) {
				var this1 = this._asset.file;
				var v = this.ui.inputs.h["atfile"].get_text();
				this1.h["@2"] = v;
			}
			if(this._asset.file.h["@3"] == curfile) {
				var this1 = this._asset.file;
				var v = this.ui.inputs.h["atfile"].get_text();
				this1.h["@3"] = v;
			}
			if(this._asset.file.h["@4"] == curfile) {
				var this1 = this._asset.file;
				var v = this.ui.inputs.h["atfile"].get_text();
				this1.h["@4"] = v;
			}
			if(this._asset.file.h["@5"] == curfile) {
				var this1 = this._asset.file;
				var v = this.ui.inputs.h["atfile"].get_text();
				this1.h["@5"] = v;
			}
			this._asset = null;
			this._instance = null;
			com_tilbuci_data_GlobalPlayer.area.loadKeyframe(com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[com_tilbuci_data_GlobalPlayer.area.get_currentKf()],com_tilbuci_data_GlobalPlayer.area.get_currentKf());
			feathers_core_PopUpManager.removePopUp(this);
		}
	}
	,onClose: function(evt) {
		this._asset = null;
		this._instance = null;
		feathers_core_PopUpManager.removePopUp(this);
	}
	,onFile: function(evt) {
		var tmp = this._ac;
		var _g = new haxe_ds_StringMap();
		_g.h["type"] = this._asset.type;
		_g.h["current"] = this._asset.file.h["@1"];
		_g.h["num"] = "1";
		tmp("file",_g);
	}
	,onEndActions: function(evt) {
		var current = "";
		switch(this._endAction) {
		case "loop":
			current = "";
			break;
		case "next":
			current = "";
			break;
		case "previous":
			current = "";
			break;
		case "stop":
			current = "";
			break;
		default:
			current = this._endAction;
		}
		com_tilbuci_data_Global.showActionWindow(current,$bind(this,this.onAcOk));
	}
	,onAcOk: function(txt) {
		if(txt != "") {
			this._endAction = txt;
			this.ui.setSelectValue("assetac","action");
		}
	}
	,__class__: com_tilbuci_ui_window_media_WindowAssetBase
});
var com_tilbuci_ui_window_media_WindowCollectionBase = function(ac) {
	this._assets = [];
	com_tilbuci_ui_window_PopupWindow.call(this,ac,com_tilbuci_data_Global.ln.get("window-collectionbasic-title"),1000,640,false,true,true);
};
$hxClasses["com.tilbuci.ui.window.media.WindowCollectionBase"] = com_tilbuci_ui_window_media_WindowCollectionBase;
com_tilbuci_ui_window_media_WindowCollectionBase.__name__ = "com.tilbuci.ui.window.media.WindowCollectionBase";
com_tilbuci_ui_window_media_WindowCollectionBase.__super__ = com_tilbuci_ui_window_PopupWindow;
com_tilbuci_ui_window_media_WindowCollectionBase.prototype = $extend(com_tilbuci_ui_window_PopupWindow.prototype,{
	_instance: null
	,_collection: null
	,_assets: null
	,startInterface: function(evt) {
		this.ui.createHContainer("assetorder");
		var tmp = this.ui;
		var tmp1 = openfl_utils_Assets.getBitmapData("btUp");
		var tmp2 = this.ui.hcontainers.h["assetorder"];
		tmp.createIconButton("orderup",$bind(this,this.onAssetUp),new openfl_display_Bitmap(tmp1),null,tmp2,false);
		var tmp = this.ui;
		var tmp1 = openfl_utils_Assets.getBitmapData("btDown");
		var tmp2 = this.ui.hcontainers.h["assetorder"];
		tmp.createIconButton("orderdown",$bind(this,this.onAssetDown),new openfl_display_Bitmap(tmp1),null,tmp2,false);
		this.ui.hcontainers.h["assetorder"].setWidth(460);
		var tmp = this.ui;
		var tmp1 = this.ui;
		var tmp2 = { tp : "Label", id : "name", tx : com_tilbuci_data_Global.ln.get("window-collectionbasic-name"), vr : ""};
		var tmp3 = { tp : "Label", id : "coltrans", tx : com_tilbuci_data_Global.ln.get("window-collection-coltrans"), vr : ""};
		var tmp4 = { tp : "Select", id : "coltrans", vl : [{ text : com_tilbuci_data_Global.ln.get("window-collection-ctralpha"), value : "alpha"},{ text : com_tilbuci_data_Global.ln.get("window-collection-ctrright"), value : "right"},{ text : com_tilbuci_data_Global.ln.get("window-collection-ctrleft"), value : "left"},{ text : com_tilbuci_data_Global.ln.get("window-collection-ctrtop"), value : "top"},{ text : com_tilbuci_data_Global.ln.get("window-collection-ctrbottom"), value : "bottom"},{ text : com_tilbuci_data_Global.ln.get("window-collection-ctrno"), value : "no"}], sl : null};
		var tmp5 = { tp : "Label", id : "coltime", tx : com_tilbuci_data_Global.ln.get("window-collection-coltime"), vr : ""};
		var tmp6 = { tp : "Button", id : "onok", tx : com_tilbuci_data_Global.ln.get("window-collectionbasic-save"), ac : $bind(this,this.onSave)};
		var tmp7 = com_tilbuci_data_Global.ln.get("window-collectionbasic-cancel");
		var tmp8 = tmp1.forge("left",[tmp2,{ tp : "TInput", id : "name", tx : "", vr : ""},tmp3,tmp4,tmp5,{ tp : "Select", id : "coltime", vl : [{ text : "0.25s", value : 0.25},{ text : "0.5s", value : 0.5},{ text : "0.75s", value : 0.75},{ text : "1s", value : 1},{ text : "1.5s", value : 1.5},{ text : "2s", value : 2},{ text : "5s", value : 5}], sl : null},{ tp : "Spacer", id : "buttons", ht : 354, ln : false},tmp6,{ tp : "Button", id : "oncancel", tx : tmp7, ac : $bind(this,this.onClose)}]);
		var tmp1 = this.ui;
		var tmp2 = { tp : "Label", id : "assets", tx : com_tilbuci_data_Global.ln.get("window-collection-assets"), vr : ""};
		var tmp3 = { tp : "Custom", cont : this.ui.hcontainers.h["assetorder"]};
		var tmp4 = { tp : "Label", id : "assettime", tx : com_tilbuci_data_Global.ln.get("window-collectionbasic-assettime"), vr : ""};
		var tmp5 = { tp : "Button", id : "assettime", tx : com_tilbuci_data_Global.ln.get("window-collectionbasic-assettimeset"), ac : $bind(this,this.onTime)};
		var tmp6 = { tp : "Label", id : "assetac", tx : com_tilbuci_data_Global.ln.get("window-collectionbasic-astac"), vr : ""};
		var tmp7 = { tp : "Select", id : "assetac", vl : [{ text : com_tilbuci_data_Global.ln.get("window-collection-astacloop"), value : "loop"},{ text : com_tilbuci_data_Global.ln.get("window-collection-astacnext"), value : "next"},{ text : com_tilbuci_data_Global.ln.get("window-collection-astacprevious"), value : "previous"},{ text : com_tilbuci_data_Global.ln.get("window-collection-astacstop"), value : "stop"}], sl : null};
		var tmp9 = com_tilbuci_data_Global.ln.get("window-collectionbasic-astacset");
		this.addForm("columns",tmp.createColumnHolder("columns",tmp8,tmp1.forge("right",[tmp2,{ tp : "List", id : "assets", vl : [], ht : 325, sl : null},tmp3,{ tp : "Spacer", id : "assettime", ht : 10, ln : false},tmp4,{ tp : "Numeric", id : "assettime", mn : 1, mx : 1000, st : 1, vl : 1},tmp5,{ tp : "Spacer", id : "assetac", ht : 10, ln : false},tmp6,tmp7,{ tp : "Button", id : "assetac", tx : tmp9, ac : $bind(this,this.onEnd)}])));
		this.ui.setListToIcon("assets");
		com_tilbuci_ui_window_PopupWindow.prototype.startInterface.call(this);
	}
	,acStart: function() {
		this._instance = null;
		this._collection = null;
	}
	,action: function(ac,data) {
		if(ac != "setfile") {
			this._instance = com_tilbuci_data_GlobalPlayer.area.pickInstance(data.h["instance"]);
			if(this._instance != null) {
				var this1 = com_tilbuci_data_GlobalPlayer.movie.collections;
				var key = this._instance.getCurrentStr("collection");
				if(Object.prototype.hasOwnProperty.call(this1.h,key)) {
					var this1 = com_tilbuci_data_GlobalPlayer.movie.collections;
					var key = this._instance.getCurrentStr("collection");
					if(this1.h[key].ok) {
						var this1 = com_tilbuci_data_GlobalPlayer.movie.collections;
						var key = this._instance.getCurrentStr("collection");
						this._collection = this1.h[key];
						this.show();
					} else {
						com_tilbuci_data_Global.showMsg(com_tilbuci_data_Global.ln.get("window-asset-nocollection"));
						feathers_core_PopUpManager.removePopUp(this);
					}
				} else {
					com_tilbuci_data_Global.showMsg(com_tilbuci_data_Global.ln.get("window-asset-nocollection"));
					feathers_core_PopUpManager.removePopUp(this);
				}
			} else {
				com_tilbuci_data_Global.showMsg(com_tilbuci_data_Global.ln.get("window-asset-noinstance"));
				feathers_core_PopUpManager.removePopUp(this);
			}
		}
	}
	,show: function() {
		this.ui.inputs.h["name"].set_text(this._collection.name);
		this.ui.setSelectValue("coltrans",this._collection.transition);
		this.ui.setSelectValue("coltime",this._collection.time);
		this.ui.lists.h["assets"].set_selectedItem(null);
		this.ui.setListValues("assets",[]);
		this._assets = [];
		var _g = 0;
		var _g1 = this._collection.assetOrder;
		while(_g < _g1.length) {
			var asnm = _g1[_g];
			++_g;
			this._assets.push({ text : this._collection.assets.h[asnm].name, user : com_tilbuci_data_Global.ln.get("menu-media-" + this._collection.assets.h[asnm].type), value : { time : this._collection.assets.h[asnm].time, action : this._collection.assets.h[asnm].action, order : this._collection.assets.h[asnm].order, id : asnm}});
		}
		this.ui.setListValues("assets",this._assets);
	}
	,onSave: function(evt) {
		if(this.ui.inputs.h["name"].get_text().length < 5) {
			com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("window-collectionbasic-title"),com_tilbuci_data_Global.ln.get("window-collection-colnameer"),320,180,com_tilbuci_data_Global.ln.get("default-ok"));
		} else {
			com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("window-collectionbasic-title"),com_tilbuci_data_Global.ln.get("window-collectionbasic-colapply"),320,180,com_tilbuci_data_Global.ln.get("default-ok"),$bind(this,this.onColSure),"confirm",com_tilbuci_data_Global.ln.get("default-cancel"));
		}
	}
	,onColSure: function(ok) {
		if(ok) {
			this._collection.name = this.ui.inputs.h["name"].get_text();
			this._collection.transition = this.ui.selects.h["coltrans"].get_selectedItem().value;
			this._collection.time = this.ui.selects.h["coltime"].get_selectedItem().value;
			this._collection.assetOrder = [];
			var _g = 0;
			var _g1 = this._assets.length;
			while(_g < _g1) {
				var i = _g++;
				this._collection.assetOrder.push(this._assets[i].value.id);
				this._collection.assets.h[this._assets[i].value.id].order = i;
				this._collection.assets.h[this._assets[i].value.id].time = this._assets[i].value.time;
				this._collection.assets.h[this._assets[i].value.id].action = this._assets[i].value.action;
			}
			this._collection = null;
			this._instance = null;
			this._assets = null;
			com_tilbuci_data_GlobalPlayer.area.loadKeyframe(com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[com_tilbuci_data_GlobalPlayer.area.get_currentKf()],com_tilbuci_data_GlobalPlayer.area.get_currentKf());
			feathers_core_PopUpManager.removePopUp(this);
		}
	}
	,onClose: function(evt) {
		this._collection = null;
		this._instance = null;
		this._assets = null;
		feathers_core_PopUpManager.removePopUp(this);
	}
	,onTime: function(evt) {
		com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("window-collectionbasic-title"),com_tilbuci_data_Global.ln.get("window-collectionbasic-timeapply"),320,190,com_tilbuci_data_Global.ln.get("default-ok"),$bind(this,this.onTimeSure),"confirm",com_tilbuci_data_Global.ln.get("default-cancel"));
	}
	,onTimeSure: function(ok) {
		if(ok) {
			var _g = 0;
			var _g1 = this._assets.length;
			while(_g < _g1) {
				var i = _g++;
				this._assets[i].value.time = this.ui.numerics.h["assettime"].get_value();
			}
		}
	}
	,onEnd: function(evt) {
		com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("window-collectionbasic-title"),com_tilbuci_data_Global.ln.get("window-collectionbasic-actionapply"),320,190,com_tilbuci_data_Global.ln.get("default-ok"),$bind(this,this.onEndSure),"confirm",com_tilbuci_data_Global.ln.get("default-cancel"));
	}
	,onEndSure: function(ok) {
		if(ok) {
			var _g = 0;
			var _g1 = this._assets.length;
			while(_g < _g1) {
				var i = _g++;
				this._assets[i].value.action = this.ui.selects.h["assetac"].get_selectedItem().value;
			}
		}
	}
	,onAssetUp: function(evt) {
		if(this.ui.lists.h["assets"].get_selectedItem() != null) {
			var index = this.ui.lists.h["assets"].get_selectedIndex();
			if(index > 0) {
				var it1 = this._assets[index];
				var it2 = this._assets[index - 1];
				this._assets[index] = it2;
				this._assets[index - 1] = it1;
				var _g = 0;
				var _g1 = this._assets.length;
				while(_g < _g1) {
					var i = _g++;
					this._assets[i].value.order = i;
				}
				this.ui.lists.h["assets"].set_selectedItem(null);
				this.ui.setListValues("assets",[]);
				this.ui.setListValues("assets",this._assets);
				this.ui.lists.h["assets"].set_selectedIndex(index - 1);
				this.ui.lists.h["assets"].get_dataProvider().updateAt(this.ui.lists.h["assets"].get_selectedIndex());
			}
		}
	}
	,onAssetDown: function(evt) {
		if(this.ui.lists.h["assets"].get_selectedItem() != null) {
			var index = this.ui.lists.h["assets"].get_selectedIndex();
			if(index < this._assets.length - 1) {
				var it1 = this._assets[index];
				var it2 = this._assets[index + 1];
				this._assets[index] = it2;
				this._assets[index + 1] = it1;
				var _g = 0;
				var _g1 = this._assets.length;
				while(_g < _g1) {
					var i = _g++;
					this._assets[i].value.order = i;
				}
				this.ui.lists.h["assets"].set_selectedItem(null);
				this.ui.setListValues("assets",[]);
				this.ui.setListValues("assets",this._assets);
				this.ui.lists.h["assets"].set_selectedIndex(index + 1);
				this.ui.lists.h["assets"].get_dataProvider().updateAt(this.ui.lists.h["assets"].get_selectedIndex());
			}
		}
	}
	,__class__: com_tilbuci_ui_window_media_WindowCollectionBase
});
var com_tilbuci_ui_window_media_WindowCollections = function(ac) {
	this._changed = false;
	com_tilbuci_ui_window_PopupWindow.call(this,ac,com_tilbuci_data_Global.ln.get("window-collection-title"),1000,com_tilbuci_ui_base_InterfaceFactory.pickValue(660,700),false,true,true);
};
$hxClasses["com.tilbuci.ui.window.media.WindowCollections"] = com_tilbuci_ui_window_media_WindowCollections;
com_tilbuci_ui_window_media_WindowCollections.__name__ = "com.tilbuci.ui.window.media.WindowCollections";
com_tilbuci_ui_window_media_WindowCollections.__super__ = com_tilbuci_ui_window_PopupWindow;
com_tilbuci_ui_window_media_WindowCollections.prototype = $extend(com_tilbuci_ui_window_PopupWindow.prototype,{
	_colint: null
	,_astint: null
	,_curast: null
	,_collections: null
	,_changed: null
	,_shape: null
	,startInterface: function(evt) {
		this.ui.createHContainer("assetback");
		this.ui.createButton("astbackok",com_tilbuci_data_Global.ln.get("window-collection-astbackok"),$bind(this,this.onAssetOk),this.ui.hcontainers.h["assetback"],false);
		this.ui.createButton("astbackcancel",com_tilbuci_data_Global.ln.get("window-collection-astbackcancel"),$bind(this,this.onAssetCancel),this.ui.hcontainers.h["assetback"],false);
		this.ui.hcontainers.h["assetback"].setWidth(960);
		this.ui.createContainer("media",0);
		this.ui.createContainer("file",0);
		this.ui.createLabel("assets",com_tilbuci_data_Global.ln.get("window-collection-astfiles"),"",this.ui.containers.h["file"]);
		this.ui.createSpacer("assets",5,false,this.ui.containers.h["file"]);
		this.ui.containers.h["file"].addChild(this.createFileInput(1,$bind(this,this.onFile1)));
		this.ui.createSpacer("file1",5,false,this.ui.containers.h["file"]);
		this.ui.containers.h["file"].addChild(this.createFileInput(2,$bind(this,this.onFile2)));
		this.ui.createSpacer("file2",5,false,this.ui.containers.h["file"]);
		this.ui.containers.h["file"].addChild(this.createFileInput(3,$bind(this,this.onFile3)));
		this.ui.createSpacer("file3",5,false,this.ui.containers.h["file"]);
		this.ui.containers.h["file"].addChild(this.createFileInput(4,$bind(this,this.onFile4)));
		this.ui.createSpacer("file4",5,false,this.ui.containers.h["file"]);
		this.ui.containers.h["file"].addChild(this.createFileInput(5,$bind(this,this.onFile5)));
		this.ui.containers.h["media"].addChild(this.ui.containers.h["file"]);
		this.ui.createContainer("shape",0);
		this.ui.containers.h["shape"].set_layout(new feathers_layout_AnchorLayout());
		this._shape = new com_tilbuci_display_ShapeImage($bind(this,this.onShapeShow));
		this.ui.createButton("shape",com_tilbuci_data_Global.ln.get("window-collection-astshape"),$bind(this,this.onFile1));
		this.ui.containers.h["shape"].set_width(this.ui.buttons.h["shape"].set_width(960));
		this.ui.createContainer("assettext",0);
		this.ui.createTArea("assettext","",false,"",this.ui.containers.h["assettext"]);
		this.ui.createButton("assettext",com_tilbuci_data_Global.ln.get("window-collection-asttext"),$bind(this,this.onFile1),this.ui.containers.h["assettext"]);
		this.ui.containers.h["assettext"].set_width(this.ui.buttons.h["assettext"].set_width(this.ui.tareas.h["assettext"].set_width(1000)));
		this.ui.tareas.h["assettext"].set_height(140);
		this.ui.createHContainer("spritemap");
		this.ui.hcontainers.h["spritemap"].addChild(this.ui.forge("smapleft",[{ tp : "Label", id : "astsmapnum", tx : com_tilbuci_data_Global.ln.get("window-collection-astsmapnum"), vr : ""},{ tp : "Numeric", id : "astsmapnum", mn : 1, mx : 1000, st : 1, vl : 1}],-1,490,0));
		this.ui.hcontainers.h["spritemap"].addChild(this.ui.forge("smapright",[{ tp : "Label", id : "astsmaptime", tx : com_tilbuci_data_Global.ln.get("window-collection-astsmaptime"), vr : ""},{ tp : "Numeric", id : "astsmaptime", mn : 50, mx : 5000, st : 50, vl : 100}],-1,500,0));
		var tmp = this.ui;
		var tmp1 = { tp : "Label", id : "assetname", tx : com_tilbuci_data_Global.ln.get("window-collection-astname"), vr : ""};
		var tmp2 = { tp : "Label", id : "assetac", tx : com_tilbuci_data_Global.ln.get("window-collection-astac"), vr : ""};
		var tmp3 = { tp : "Select", id : "assetac", vl : [{ text : com_tilbuci_data_Global.ln.get("window-collection-astacloop"), value : "loop"},{ text : com_tilbuci_data_Global.ln.get("window-collection-astacnext"), value : "next"},{ text : com_tilbuci_data_Global.ln.get("window-collection-astacprevious"), value : "previous"},{ text : com_tilbuci_data_Global.ln.get("window-collection-astacstop"), value : "stop"},{ text : com_tilbuci_data_Global.ln.get("window-collection-astacaction"), value : "action"}], sl : null};
		var tmp4 = { tp : "Button", id : "endactions", tx : com_tilbuci_data_Global.ln.get("window-collection-astacset"), ac : $bind(this,this.onEndActions)};
		var tmp5 = { tp : "Custom", cont : this.ui.containers.h["media"]};
		var tmp6 = com_tilbuci_data_Global.ln.get("window-collection-asttime");
		this._astint = tmp.forge("assetinterf",[tmp1,{ tp : "TInput", id : "assetname", tx : ""},{ tp : "Spacer", id : "assetname", ht : 10, ln : false},tmp2,tmp3,tmp4,{ tp : "Spacer", id : "endactions", ht : 10, ln : false},tmp5,{ tp : "Spacer", id : "assets", ht : 10, ln : false},{ tp : "Label", id : "asttime", tx : tmp6, vr : ""},{ tp : "Numeric", id : "asttime", mn : 1, mx : 1000, st : 1, vl : 1},{ tp : "Spacer", id : "asttime", ht : 10, ln : false},{ tp : "Custom", cont : this.ui.hcontainers.h["spritemap"]},{ tp : "Spacer", id : "astback", ht : 90, ln : false},{ tp : "Custom", cont : this.ui.hcontainers.h["assetback"]}]);
		this.addForm(com_tilbuci_data_Global.ln.get("window-collection-asset"),this._astint);
		this.ui.createHContainer("newasset");
		this.ui.hcontainers.h["newasset"].addChild(this.ui.forge("newassetleft",[{ tp : "Select", id : "assetadd", vl : [{ text : com_tilbuci_data_Global.ln.get("menu-media-audio"), value : "audio"},{ text : com_tilbuci_data_Global.ln.get("menu-media-html"), value : "html"},{ text : com_tilbuci_data_Global.ln.get("menu-media-paragraph"), value : "paragraph"},{ text : com_tilbuci_data_Global.ln.get("menu-media-picture"), value : "picture"},{ text : com_tilbuci_data_Global.ln.get("menu-media-shape"), value : "shape"},{ text : com_tilbuci_data_Global.ln.get("menu-media-spritemap"), value : "spritemap"},{ text : com_tilbuci_data_Global.ln.get("menu-media-video"), value : "video"}], sl : "picture"}],-1,180,0));
		this.ui.hcontainers.h["newasset"].addChild(this.ui.forge("newassetright",[{ tp : "Button", id : "assetadd", tx : com_tilbuci_data_Global.ln.get("window-collection-assetadd2"), ac : $bind(this,this.onNewAsset)}],-1,311,0));
		this.ui.createHContainer("assetorder");
		var tmp = this.ui;
		var tmp1 = openfl_utils_Assets.getBitmapData("btUp");
		var tmp2 = this.ui.hcontainers.h["assetorder"];
		tmp.createIconButton("orderup",$bind(this,this.onAssetUp),new openfl_display_Bitmap(tmp1),null,tmp2,false);
		var tmp = this.ui;
		var tmp1 = openfl_utils_Assets.getBitmapData("btDown");
		var tmp2 = this.ui.hcontainers.h["assetorder"];
		tmp.createIconButton("orderdown",$bind(this,this.onAssetDown),new openfl_display_Bitmap(tmp1),null,tmp2,false);
		this.ui.hcontainers.h["assetorder"].setWidth(460);
		var tmp = this.ui;
		var tmp1 = this.ui;
		var tmp2 = { tp : "Label", id : "collections", tx : com_tilbuci_data_Global.ln.get("window-collection-cols"), vr : feathers_controls_Label.VARIANT_DETAIL};
		var tmp3 = { tp : "Label", id : "coltitle", tx : com_tilbuci_data_Global.ln.get("window-collection-coltitle"), vr : feathers_controls_Label.VARIANT_DETAIL};
		var tmp4 = { tp : "Label", id : "coltrans", tx : com_tilbuci_data_Global.ln.get("window-collection-coltrans"), vr : feathers_controls_Label.VARIANT_DETAIL};
		var tmp5 = { tp : "Select", id : "coltrans", vl : [{ text : com_tilbuci_data_Global.ln.get("window-collection-ctralpha"), value : "alpha"},{ text : com_tilbuci_data_Global.ln.get("window-collection-ctrright"), value : "right"},{ text : com_tilbuci_data_Global.ln.get("window-collection-ctrleft"), value : "left"},{ text : com_tilbuci_data_Global.ln.get("window-collection-ctrtop"), value : "top"},{ text : com_tilbuci_data_Global.ln.get("window-collection-ctrbottom"), value : "bottom"},{ text : com_tilbuci_data_Global.ln.get("window-collection-ctrno"), value : "no"}], sl : null};
		var tmp6 = { tp : "Label", id : "coltime", tx : com_tilbuci_data_Global.ln.get("window-collection-coltime"), vr : feathers_controls_Label.VARIANT_DETAIL};
		var tmp7 = { tp : "Button", id : "colupdate", tx : com_tilbuci_data_Global.ln.get("window-collection-colupdate"), ac : $bind(this,this.onUpdateCol)};
		var tmp8 = com_tilbuci_data_Global.ln.get("window-collection-exitapply");
		var tmp9 = tmp1.forge("leftcol",[tmp2,{ tp : "List", id : "collections", vl : [], ht : 323, sl : null, ch : $bind(this,this.onColChange)},tmp3,{ tp : "TInput", id : "coltitle", tx : ""},tmp4,tmp5,tmp6,{ tp : "Select", id : "coltime", vl : [{ text : "0.25s", value : 0.25},{ text : "0.5s", value : 0.5},{ text : "0.75s", value : 0.75},{ text : "1s", value : 1},{ text : "1.5s", value : 1.5},{ text : "2s", value : 2},{ text : "5s", value : 5}], sl : null},tmp7,{ tp : "Spacer", id : "exitapply", ht : 18, ln : false},{ tp : "Button", id : "exitapply", tx : tmp8, ac : $bind(this,this.onApply)}]);
		var tmp1 = this.ui;
		var tmp2 = { tp : "Label", id : "assets", tx : com_tilbuci_data_Global.ln.get("window-collection-assets"), vr : feathers_controls_Label.VARIANT_DETAIL};
		var tmp3 = { tp : "Custom", cont : this.ui.hcontainers.h["assetorder"]};
		var tmp4 = { tp : "Button", id : "removeasset", tx : com_tilbuci_data_Global.ln.get("window-collection-removea"), ac : $bind(this,this.onRemoveAsset)};
		var tmp5 = { tp : "Button", id : "assetprop", tx : com_tilbuci_data_Global.ln.get("window-collection-assetprop"), ac : $bind(this,this.onAssetProp)};
		var tmp6 = { tp : "Button", id : "assetstage", tx : com_tilbuci_data_Global.ln.get("window-collection-assetstage"), ac : $bind(this,this.onAddToStage)};
		var tmp7 = { tp : "Label", id : "assetadd", tx : com_tilbuci_data_Global.ln.get("window-collection-assetadd"), vr : feathers_controls_Label.VARIANT_DETAIL};
		var tmp8 = { tp : "Custom", cont : this.ui.hcontainers.h["newasset"]};
		var tmp10 = com_tilbuci_data_Global.ln.get("window-collection-exitno");
		this._colint = tmp.createColumnHolder("columns",tmp9,tmp1.forge("rightcol",[tmp2,{ tp : "List", id : "assets", vl : [], ht : 325, sl : null},tmp3,tmp4,tmp5,tmp6,{ tp : "Spacer", id : "assetprop", ht : 10, ln : false},tmp7,tmp8,{ tp : "Spacer", id : "exitno", ht : 20, ln : false},{ tp : "Button", id : "exitno", tx : tmp10, ac : $bind(this,this.onNoApply)}]));
		this.addForm(com_tilbuci_data_Global.ln.get("window-media-file"),this._colint);
		this.ui.setListToIcon("collections");
		this.ui.setListToIcon("assets");
		this.ui.listDbClick("assets",$bind(this,this.onAssetProp));
		com_tilbuci_ui_window_PopupWindow.prototype.startInterface.call(this);
		this._forms.removeChild(this._astint);
	}
	,kill: function() {
		com_tilbuci_ui_window_PopupWindow.prototype.kill.call(this);
	}
	,acStart: function() {
		this._changed = false;
		this.loadCollections();
		this._forms.removeChildren();
		this._forms.addChild(this._colint);
		this._head.set_text(com_tilbuci_data_Global.ln.get("window-collection-title"));
	}
	,action: function(ac,data) {
		switch(ac) {
		case "addasset":
			if(this.ui.lists.h["collections"].get_selectedItem() != null) {
				var id = HxOverrides.substr(com_tilbuci_statictools_StringStatic.md5(data.h["name"]),0,10);
				while(true) {
					var this1 = this._collections;
					var key = this.ui.lists.h["collections"].get_selectedItem().value.id;
					if(!Object.prototype.hasOwnProperty.call(this1.h[key].assets.h,id)) {
						break;
					}
					id = HxOverrides.substr(com_tilbuci_statictools_StringStatic.md5(id),0,10);
				}
				var nm = data.h["name"];
				if(data.h["type"] == "shape") {
					nm = com_tilbuci_data_Global.ln.get("menu-media-shape");
				} else if(data.h["type"] == "paragraph") {
					nm = com_tilbuci_data_Global.ln.get("menu-media-paragraph");
				} else if(data.h["type"] == "text") {
					nm = com_tilbuci_data_Global.ln.get("menu-media-text");
				}
				var this1 = this._collections;
				var key = this.ui.lists.h["collections"].get_selectedItem().value.id;
				var v = { uid : "-1", id : id, order : 0, name : nm, type : data.h["type"], time : 5, frames : Std.parseInt(data.h["frames"]), frtime : Std.parseInt(data.h["frtime"]), file1 : data.h["file"], file2 : data.h["file"], file3 : data.h["file"], file4 : data.h["file"], file5 : data.h["file"], action : "loop"};
				this1.h[key].assets.h[id] = v;
				var ord = 0;
				var this1 = this._collections;
				var key = this.ui.lists.h["collections"].get_selectedItem().value.id;
				var h = this1.h[key].assets.h;
				var k_h = h;
				var k_keys = Object.keys(h);
				var k_length = k_keys.length;
				var k_current = 0;
				while(k_current < k_length) {
					var k = k_keys[k_current++];
					var this1 = this._collections;
					var key = this.ui.lists.h["collections"].get_selectedItem().value.id;
					this1.h[key].assets.h[k].order = ord;
					++ord;
				}
				var tmp = this.ui.lists.h["collections"];
				var tmp1 = com_tilbuci_data_Global.ln.get("window-collection-numassets");
				tmp.get_selectedItem().user = ord + " " + tmp1;
				this.ui.lists.h["collections"].get_dataProvider().updateAt(this.ui.lists.h["collections"].get_selectedIndex());
				this.onColChange();
				this._changed = true;
			}
			break;
		case "setfile":
			this.ui.numerics.h["astsmapnum"].set_value(Std.parseInt(data.h["frames"]));
			this.ui.numerics.h["astsmaptime"].set_value(Std.parseInt(data.h["frtime"]));
			if(this.ui.lists.h["assets"].get_selectedItem().value.type == "shape") {
				this.ui.inputs.h["file@1"].set_text(this.ui.inputs.h["file@2"].set_text(this.ui.inputs.h["file@3"].set_text(this.ui.inputs.h["file@4"].set_text(this.ui.inputs.h["file@5"].set_text(data.h["file"])))));
				this.ui.containers.h["shape"].removeChildren();
				this._shape.set_visible(false);
				this._shape.load(data.h["file"]);
			} else if(this.ui.lists.h["assets"].get_selectedItem().value.type == "paragraph" || this.ui.lists.h["assets"].get_selectedItem().value.type == "text") {
				this.ui.inputs.h["file@1"].set_text(this.ui.inputs.h["file@2"].set_text(this.ui.inputs.h["file@3"].set_text(this.ui.inputs.h["file@4"].set_text(this.ui.inputs.h["file@5"].set_text(data.h["file"])))));
				this.ui.tareas.h["assettext"].set_text(data.h["file"]);
			} else {
				this.ui.inputs.h["file@" + Std.string(data.h["num"])].set_text(data.h["file"]);
			}
			break;
		}
	}
	,loadCollections: function() {
		this.ui.lists.h["collections"].set_selectedItem(null);
		this.ui.lists.h["assets"].set_selectedItem(null);
		this.ui.setListValues("collections",[]);
		this.ui.setListValues("assets",[]);
		var list = [];
		this._collections = new haxe_ds_StringMap();
		var _g = 0;
		var _g1 = com_tilbuci_data_GlobalPlayer.movie.scene.collections;
		while(_g < _g1.length) {
			var k = _g1[_g];
			++_g;
			if(Object.prototype.hasOwnProperty.call(com_tilbuci_data_GlobalPlayer.movie.collections.h,k)) {
				var col = com_tilbuci_data_GlobalPlayer.movie.collections.h[k];
				var info = { uid : com_tilbuci_data_GlobalPlayer.movie.get_mvId() + k, id : k, title : col.name, transition : col.transition, time : col.time, num : col.assetOrder.length};
				list.push({ text : col.name, value : info, user : col.assetOrder.length + " " + com_tilbuci_data_Global.ln.get("window-collection-numassets")});
				var asts = new haxe_ds_StringMap();
				var _g2 = 0;
				var _g3 = com_tilbuci_data_GlobalPlayer.movie.collections.h[k].assetOrder.length;
				while(_g2 < _g3) {
					var i = _g2++;
					var asid = com_tilbuci_data_GlobalPlayer.movie.collections.h[k].assetOrder[i];
					if(Object.prototype.hasOwnProperty.call(com_tilbuci_data_GlobalPlayer.movie.collections.h[k].assets.h,asid)) {
						var adata = com_tilbuci_data_GlobalPlayer.movie.collections.h[k].assets.h[asid];
						var ainfo = { uid : "-" + (i == null ? "null" : "" + i), id : asid, order : i, name : adata.name, type : adata.type, time : adata.time, frames : adata.frames, frtime : adata.frtime, file1 : adata.file.h["@1"], file2 : adata.file.h["@2"], file3 : adata.file.h["@3"], file4 : adata.file.h["@4"], file5 : adata.file.h["@5"], action : adata.action};
						asts.h[asid] = ainfo;
					}
				}
				var v = { collection : info, assets : asts};
				this._collections.h[k] = v;
			}
			this.ui.setListValues("collections",list);
		}
	}
	,onColChange: function(evt) {
		this.ui.lists.h["assets"].set_selectedItem(null);
		this.ui.setListValues("assets",[]);
		if(this.ui.lists.h["collections"].get_selectedItem() != null) {
			var list = [];
			var this1 = this._collections;
			var key = this.ui.lists.h["collections"].get_selectedItem().value.id;
			var h = this1.h[key].assets.h;
			var k_h = h;
			var k_keys = Object.keys(h);
			var k_length = k_keys.length;
			var k_current = 0;
			while(k_current < k_length) {
				var k = k_keys[k_current++];
				var this1 = this._collections;
				var key = this.ui.lists.h["collections"].get_selectedItem().value.id;
				var tmp = this1.h[key].assets.h[k].name;
				var tmp1 = com_tilbuci_data_Global.ln;
				var this2 = this._collections;
				var key1 = this.ui.lists.h["collections"].get_selectedItem().value.id;
				var tmp2 = tmp1.get("menu-media-" + this2.h[key1].assets.h[k].type);
				var this3 = this._collections;
				var key2 = this.ui.lists.h["collections"].get_selectedItem().value.id;
				list.push({ text : tmp, user : tmp2, value : this3.h[key2].assets.h[k]});
			}
			this.ui.setListValues("assets",list);
			this.ui.inputs.h["coltitle"].set_text(this.ui.lists.h["collections"].get_selectedItem().value.title);
			this.ui.setSelectValue("coltrans",this.ui.lists.h["collections"].get_selectedItem().value.transition);
			this.ui.setSelectValue("coltime",this.ui.lists.h["collections"].get_selectedItem().value.time);
		}
	}
	,onUpdateCol: function(evt) {
		if(this.ui.lists.h["collections"].get_selectedItem() != null) {
			if(this.ui.inputs.h["coltitle"].get_text().length < 3) {
				com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("window-collection-title"),com_tilbuci_data_Global.ln.get("window-collection-colnameer"),320,180,com_tilbuci_data_Global.ln.get("default-ok"));
				return false;
			} else {
				var this1 = this._collections;
				var key = this.ui.lists.h["collections"].get_selectedItem().value.id;
				this1.h[key].collection.title = this.ui.inputs.h["coltitle"].get_text();
				var this1 = this._collections;
				var key = this.ui.lists.h["collections"].get_selectedItem().value.id;
				this1.h[key].collection.transition = this.ui.selects.h["coltrans"].get_selectedItem().value;
				var this1 = this._collections;
				var key = this.ui.lists.h["collections"].get_selectedItem().value.id;
				this1.h[key].collection.time = this.ui.selects.h["coltime"].get_selectedItem().value;
				var tmp = this.ui.inputs.h["coltitle"];
				this.ui.lists.h["collections"].get_selectedItem().text = tmp.get_text();
				this.ui.lists.h["collections"].get_dataProvider().updateAt(this.ui.lists.h["collections"].get_selectedIndex());
				this._changed = true;
				return true;
			}
		} else {
			return true;
		}
	}
	,onRemoveAsset: function(evt) {
		if(this.ui.lists.h["collections"].get_selectedItem() != null && this.ui.lists.h["assets"].get_selectedItem() != null) {
			if(this.ui.lists.h["assets"].get_dataProvider().get_length() < 2) {
				com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("window-collection-title"),com_tilbuci_data_Global.ln.get("window-collection-astonlyone"),320,180,com_tilbuci_data_Global.ln.get("default-ok"));
			} else {
				var colid = this.ui.lists.h["collections"].get_selectedItem().value.id;
				var asid = this.ui.lists.h["assets"].get_selectedItem().value.id;
				var newasts = new haxe_ds_StringMap();
				var ord = 0;
				var h = this._collections.h[colid].assets.h;
				var a_h = h;
				var a_keys = Object.keys(h);
				var a_length = a_keys.length;
				var a_current = 0;
				while(a_current < a_length) {
					var a = a_keys[a_current++];
					if(a != asid) {
						this._collections.h[colid].assets.h[a].order = ord;
						++ord;
						var v = this._collections.h[colid].assets.h[a];
						newasts.h[a] = v;
					}
				}
				this._collections.h[colid].assets = newasts;
				var tmp = this.ui.lists.h["collections"];
				var tmp1 = com_tilbuci_data_Global.ln.get("window-collection-numassets");
				tmp.get_selectedItem().user = ord + " " + tmp1;
				this.ui.lists.h["collections"].get_dataProvider().updateAt(this.ui.lists.h["collections"].get_selectedIndex());
				this.onColChange();
				this._changed = true;
			}
		}
	}
	,onAddToStage: function(evt) {
		if(this.ui.lists.h["collections"].get_selectedItem() != null && this.ui.lists.h["assets"].get_selectedItem() != null) {
			if(this._changed) {
				com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("window-collection-title"),com_tilbuci_data_Global.ln.get("window-collection-astaddchange"),320,220,com_tilbuci_data_Global.ln.get("default-ok"),$bind(this,this.onApplyThenAdd),"confirm",com_tilbuci_data_Global.ln.get("default-cancel"));
			} else {
				this.addAssetStage();
			}
		}
	}
	,onApplyThenAdd: function(ok) {
		if(ok) {
			this.updateScene();
			this.addAssetStage();
		}
	}
	,addAssetStage: function() {
		var tmp = this._ac;
		var _g = new haxe_ds_StringMap();
		var value = this.ui.lists.h["collections"].get_selectedItem().value.id;
		_g.h["collection"] = value;
		var value = this.ui.lists.h["assets"].get_selectedItem().value.id;
		_g.h["asset"] = value;
		tmp("addinstance",_g);
		feathers_core_PopUpManager.removePopUp(this);
	}
	,onAssetUp: function(evt) {
		if(this.ui.lists.h["collections"].get_selectedItem() != null && this.ui.lists.h["assets"].get_selectedItem() != null) {
			var index = this.ui.lists.h["assets"].get_selectedIndex();
			if(index > 0) {
				var ord = 0;
				var this1 = this._collections;
				var key = this.ui.lists.h["collections"].get_selectedItem().value.id;
				var h = this1.h[key].assets.h;
				var k_h = h;
				var k_keys = Object.keys(h);
				var k_length = k_keys.length;
				var k_current = 0;
				while(k_current < k_length) {
					var k = k_keys[k_current++];
					var this1 = this._collections;
					var key = this.ui.lists.h["collections"].get_selectedItem().value.id;
					this1.h[key].assets.h[k].order = ord;
					++ord;
				}
				var astid = this.ui.lists.h["assets"].get_selectedItem().value.id;
				var newast = new haxe_ds_StringMap();
				ord = 0;
				var this1 = this._collections;
				var key = this.ui.lists.h["collections"].get_selectedItem().value.id;
				var h = this1.h[key].assets.h;
				var k_h = h;
				var k_keys = Object.keys(h);
				var k_length = k_keys.length;
				var k_current = 0;
				while(k_current < k_length) {
					var k = k_keys[k_current++];
					if(ord == index - 1) {
						var this1 = this._collections;
						var key = this.ui.lists.h["collections"].get_selectedItem().value.id;
						var v = this1.h[key].assets.h[astid];
						newast.h[astid] = v;
					}
					if(k != astid) {
						var this2 = this._collections;
						var key1 = this.ui.lists.h["collections"].get_selectedItem().value.id;
						var v1 = this2.h[key1].assets.h[k];
						newast.h[k] = v1;
					}
					++ord;
				}
				ord = 0;
				var h = newast.h;
				var k_h = h;
				var k_keys = Object.keys(h);
				var k_length = k_keys.length;
				var k_current = 0;
				while(k_current < k_length) {
					var k = k_keys[k_current++];
					newast.h[k].order = ord;
					++ord;
				}
				var this1 = this._collections;
				var key = this.ui.lists.h["collections"].get_selectedItem().value.id;
				this1.h[key].assets = newast;
				this.onColChange();
				this.ui.lists.h["assets"].set_selectedIndex(index - 1);
				this.ui.lists.h["assets"].get_dataProvider().updateAt(this.ui.lists.h["assets"].get_selectedIndex());
				this._changed = true;
			}
		}
	}
	,onAssetDown: function(evt) {
		if(this.ui.lists.h["collections"].get_selectedItem() != null && this.ui.lists.h["assets"].get_selectedItem() != null) {
			var index = this.ui.lists.h["assets"].get_selectedIndex();
			if(index < this.ui.lists.h["assets"].get_dataProvider().get_length() - 1) {
				var ord = 0;
				var this1 = this._collections;
				var key = this.ui.lists.h["collections"].get_selectedItem().value.id;
				var h = this1.h[key].assets.h;
				var k_h = h;
				var k_keys = Object.keys(h);
				var k_length = k_keys.length;
				var k_current = 0;
				while(k_current < k_length) {
					var k = k_keys[k_current++];
					var this1 = this._collections;
					var key = this.ui.lists.h["collections"].get_selectedItem().value.id;
					this1.h[key].assets.h[k].order = ord;
					++ord;
				}
				var astid = this.ui.lists.h["assets"].get_selectedItem().value.id;
				var newast = new haxe_ds_StringMap();
				ord = 0;
				var this1 = this._collections;
				var key = this.ui.lists.h["collections"].get_selectedItem().value.id;
				var h = this1.h[key].assets.h;
				var k_h = h;
				var k_keys = Object.keys(h);
				var k_length = k_keys.length;
				var k_current = 0;
				while(k_current < k_length) {
					var k = k_keys[k_current++];
					if(k != astid) {
						var this1 = this._collections;
						var key = this.ui.lists.h["collections"].get_selectedItem().value.id;
						var v = this1.h[key].assets.h[k];
						newast.h[k] = v;
					}
					if(ord == index + 1) {
						var this2 = this._collections;
						var key1 = this.ui.lists.h["collections"].get_selectedItem().value.id;
						var v1 = this2.h[key1].assets.h[astid];
						newast.h[astid] = v1;
					}
					++ord;
				}
				ord = 0;
				var h = newast.h;
				var k_h = h;
				var k_keys = Object.keys(h);
				var k_length = k_keys.length;
				var k_current = 0;
				while(k_current < k_length) {
					var k = k_keys[k_current++];
					newast.h[k].order = ord;
					++ord;
				}
				var this1 = this._collections;
				var key = this.ui.lists.h["collections"].get_selectedItem().value.id;
				this1.h[key].assets = newast;
				this.onColChange();
				this.ui.lists.h["assets"].set_selectedIndex(index + 1);
				this.ui.lists.h["assets"].get_dataProvider().updateAt(this.ui.lists.h["assets"].get_selectedIndex());
				this._changed = true;
			}
		}
	}
	,onNewAsset: function(evt) {
		if(this.ui.lists.h["collections"].get_selectedItem() != null) {
			var tmp = this._ac;
			var _g = new haxe_ds_StringMap();
			var value = this.ui.selects.h["assetadd"].get_selectedItem().value;
			_g.h["type"] = value;
			tmp("newasset",_g);
		}
	}
	,onAssetProp: function(evt) {
		if(this.ui.lists.h["assets"].get_selectedItem() != null) {
			this._curast = { uid : this.ui.lists.h["assets"].get_selectedItem().value.uid, id : this.ui.lists.h["assets"].get_selectedItem().value.id, order : this.ui.lists.h["assets"].get_selectedItem().value.order, time : this.ui.lists.h["assets"].get_selectedItem().value.time, name : this.ui.lists.h["assets"].get_selectedItem().value.name, type : this.ui.lists.h["assets"].get_selectedItem().value.type, frames : this.ui.lists.h["assets"].get_selectedItem().value.frames, frtime : this.ui.lists.h["assets"].get_selectedItem().value.frtime, file1 : this.ui.lists.h["assets"].get_selectedItem().value.file1, file2 : this.ui.lists.h["assets"].get_selectedItem().value.file2, file3 : this.ui.lists.h["assets"].get_selectedItem().value.file3, file4 : this.ui.lists.h["assets"].get_selectedItem().value.file4, file5 : this.ui.lists.h["assets"].get_selectedItem().value.file5, action : this.ui.lists.h["assets"].get_selectedItem().value.action};
			this._head.set_text(com_tilbuci_data_Global.ln.get("menu-media-" + Std.string(this.ui.lists.h["assets"].get_selectedItem().value.type)));
			this.ui.inputs.h["assetname"].set_text(this.ui.lists.h["assets"].get_selectedItem().value.name);
			this.ui.inputs.h["file@1"].set_text(this.ui.lists.h["assets"].get_selectedItem().value.file1);
			this.ui.inputs.h["file@2"].set_text(this.ui.lists.h["assets"].get_selectedItem().value.file2);
			this.ui.inputs.h["file@3"].set_text(this.ui.lists.h["assets"].get_selectedItem().value.file3);
			this.ui.inputs.h["file@4"].set_text(this.ui.lists.h["assets"].get_selectedItem().value.file4);
			this.ui.inputs.h["file@5"].set_text(this.ui.lists.h["assets"].get_selectedItem().value.file5);
			this.ui.numerics.h["asttime"].set_value(this.ui.lists.h["assets"].get_selectedItem().value.time);
			this.ui.numerics.h["astsmapnum"].set_value(this.ui.lists.h["assets"].get_selectedItem().value.frames);
			this.ui.numerics.h["astsmaptime"].set_value(this.ui.lists.h["assets"].get_selectedItem().value.frtime);
			switch(this.ui.lists.h["assets"].get_selectedItem().value.action) {
			case "":
				this.ui.setSelectValue("assetac","loop");
				break;
			case "loop":
				this.ui.setSelectValue("assetac","loop");
				break;
			case "next":
				this.ui.setSelectValue("assetac","next");
				break;
			case "previous":
				this.ui.setSelectValue("assetac","previous");
				break;
			case "stop":
				this.ui.setSelectValue("assetac","stop");
				break;
			default:
				this.ui.setSelectValue("assetac","action");
			}
			this.ui.containers.h["media"].removeChildren();
			if(this.ui.lists.h["assets"].get_selectedItem().value.type == "shape") {
				this.ui.containers.h["media"].addChild(this.ui.containers.h["shape"]);
				this.ui.containers.h["shape"].removeChildren();
				this._shape.set_visible(false);
				this._shape.load(this.ui.lists.h["assets"].get_selectedItem().value.file1);
			} else if(this.ui.lists.h["assets"].get_selectedItem().value.type == "paragraph" || this.ui.lists.h["assets"].get_selectedItem().value.type == "text") {
				this.ui.containers.h["media"].addChild(this.ui.containers.h["assettext"]);
				this.ui.tareas.h["assettext"].set_text(this.ui.lists.h["assets"].get_selectedItem().value.file1);
			} else {
				this.ui.containers.h["media"].addChild(this.ui.containers.h["file"]);
			}
			this._forms.removeChild(this._colint);
			this._forms.addChild(this._astint);
		}
	}
	,onShapeShow: function(ok) {
		if(ok) {
			this._shape.set_height(100);
			this._shape.set_width(this._shape.oWidth * (this._shape.get_height() / this._shape.oHeight));
			this._shape.set_y(0);
			this.ui.containers.h["shape"].addChild(this._shape);
			this.ui.containers.h["shape"].addChild(this.ui.buttons.h["shape"]);
			this._shape.set_visible(true);
			this._shape.set_x((960 - this._shape.get_width()) / 2);
			this.ui.buttons.h["shape"].set_y(this._shape.get_height() + 30);
		} else {
			this._shape.set_visible(false);
		}
	}
	,onFile1: function(evt) {
		var tmp = this._ac;
		var _g = new haxe_ds_StringMap();
		_g.h["type"] = this._curast.type;
		var value = this.ui.lists.h["assets"].get_selectedItem().value.file1;
		_g.h["current"] = value;
		_g.h["num"] = "1";
		tmp("file",_g);
	}
	,onFile2: function(evt) {
		var tmp = this._ac;
		var _g = new haxe_ds_StringMap();
		_g.h["type"] = this._curast.type;
		var value = this.ui.lists.h["assets"].get_selectedItem().value.file2;
		_g.h["current"] = value;
		_g.h["num"] = "2";
		tmp("file",_g);
	}
	,onFile3: function(evt) {
		var tmp = this._ac;
		var _g = new haxe_ds_StringMap();
		_g.h["type"] = this._curast.type;
		var value = this.ui.lists.h["assets"].get_selectedItem().value.file3;
		_g.h["current"] = value;
		_g.h["num"] = "3";
		tmp("file",_g);
	}
	,onFile4: function(evt) {
		var tmp = this._ac;
		var _g = new haxe_ds_StringMap();
		_g.h["type"] = this._curast.type;
		var value = this.ui.lists.h["assets"].get_selectedItem().value.file4;
		_g.h["current"] = value;
		_g.h["num"] = "4";
		tmp("file",_g);
	}
	,onFile5: function(evt) {
		var tmp = this._ac;
		var _g = new haxe_ds_StringMap();
		_g.h["type"] = this._curast.type;
		var value = this.ui.lists.h["assets"].get_selectedItem().value.file5;
		_g.h["current"] = value;
		_g.h["num"] = "5";
		tmp("file",_g);
	}
	,onEndActions: function(evt) {
		var current;
		switch(this._curast.action) {
		case "":
			current = "";
			break;
		case "loop":
			current = "";
			break;
		case "next":
			current = "";
			break;
		case "previous":
			current = "";
			break;
		case "stop":
			current = "";
			break;
		default:
			current = this._curast.action;
		}
		com_tilbuci_data_Global.showActionWindow(current,$bind(this,this.onAcOk));
	}
	,onAcOk: function(txt) {
		if(txt == "") {
			this._curast.action = "loop";
			this.ui.setSelectValue("assetac","loop");
		} else {
			this._curast.action = txt;
			this.ui.setSelectValue("assetac","action");
		}
	}
	,onAssetCancel: function(evt) {
		this._curast = null;
		this._forms.removeChild(this._astint);
		this._forms.addChild(this._colint);
	}
	,onAssetOk: function(evt) {
		if(this.ui.inputs.h["assetname"].get_text().length < 3) {
			com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("window-collection-title"),com_tilbuci_data_Global.ln.get("window-collection-astnameer"),320,180,com_tilbuci_data_Global.ln.get("default-ok"));
		} else if(this.ui.numerics.h["asttime"].get_value() < 1) {
			com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("window-collection-title"),com_tilbuci_data_Global.ln.get("window-collection-asttimeer"),320,180,com_tilbuci_data_Global.ln.get("default-ok"));
		} else if(this.ui.numerics.h["astsmapnum"].get_value() < 1) {
			com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("window-collection-title"),com_tilbuci_data_Global.ln.get("window-collection-astframeser"),320,180,com_tilbuci_data_Global.ln.get("default-ok"));
		} else if(this.ui.numerics.h["astsmaptime"].get_value() < 50) {
			com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("window-collection-title"),com_tilbuci_data_Global.ln.get("window-collection-astfrtimeser"),320,180,com_tilbuci_data_Global.ln.get("default-ok"));
		} else if(this.ui.inputs.h["file@1"].get_text() == "" || this.ui.inputs.h["file@2"].get_text() == "" || this.ui.inputs.h["file@3"].get_text() == "" || this.ui.inputs.h["file@4"].get_text() == "" || this.ui.inputs.h["file@5"].get_text() == "") {
			com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("window-collection-title"),com_tilbuci_data_Global.ln.get("window-collection-astfileser"),320,180,com_tilbuci_data_Global.ln.get("default-ok"));
		} else {
			var newast = { uid : this._curast.uid, id : this._curast.id, order : this._curast.order, name : this.ui.inputs.h["assetname"].get_text(), type : this._curast.type, time : Math.round(this.ui.numerics.h["asttime"].get_value()), frames : Math.round(this.ui.numerics.h["astsmapnum"].get_value()), frtime : Math.round(this.ui.numerics.h["astsmaptime"].get_value()), file1 : this.ui.inputs.h["file@1"].get_text(), file2 : this.ui.inputs.h["file@2"].get_text(), file3 : this.ui.inputs.h["file@3"].get_text(), file4 : this.ui.inputs.h["file@4"].get_text(), file5 : this.ui.inputs.h["file@5"].get_text(), action : ""};
			switch(this.ui.selects.h["assetac"].get_selectedItem().value) {
			case "action":
				newast.action = this._curast.action;
				break;
			case "loop":
				newast.action = "loop";
				break;
			case "next":
				newast.action = "next";
				break;
			case "previous":
				newast.action = "previous";
				break;
			case "stop":
				newast.action = "stop";
				break;
			}
			this.ui.lists.h["assets"].get_selectedItem().value = newast;
			this.ui.lists.h["assets"].get_selectedItem().text = newast.name;
			var this1 = this._collections;
			var key = this.ui.lists.h["collections"].get_selectedItem().value.id;
			this1.h[key].assets.h[newast.id] = newast;
			this._curast = null;
			this._forms.removeChild(this._astint);
			this._forms.addChild(this._colint);
			this._changed = true;
		}
	}
	,createFileInput: function(num,ac) {
		this.ui.createHContainer("at" + num);
		this.ui.createLabel("file@" + num,com_tilbuci_data_Global.ln.get("window-collection-astfiles" + num),"",null,false);
		this.ui.labels.h["file@" + num].set_width(25);
		this.ui.hcontainers.h["at" + num].addChild(this.ui.labels.h["file@" + num]);
		this.ui.createTInput("file@" + num,"","",null,false);
		this.ui.inputs.h["file@" + num].set_width(875);
		this.ui.inputs.h["file@" + num].set_enabled(false);
		this.ui.hcontainers.h["at" + num].addChild(this.ui.inputs.h["file@" + num]);
		this.ui.createIconButton("file@" + num,ac,new openfl_display_Bitmap(openfl_utils_Assets.getBitmapData("btOpenfile")),null,null,false);
		this.ui.buttons.h["file@" + num].set_width(50);
		this.ui.hcontainers.h["at" + num].addChild(this.ui.buttons.h["file@" + num]);
		this.ui.hcontainers.h["at" + num].setWidth(960,[50,820,70]);
		return this.ui.hcontainers.h["at" + num];
	}
	,onApply: function(evt) {
		if(this.onUpdateCol(null)) {
			if(this._changed) {
				com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("window-collection-title"),com_tilbuci_data_Global.ln.get("window-collection-colapplyok"),320,220,com_tilbuci_data_Global.ln.get("default-ok"),$bind(this,this.onApplySure),"confirm",com_tilbuci_data_Global.ln.get("default-cancel"));
			} else {
				feathers_core_PopUpManager.removePopUp(this);
			}
		}
	}
	,onNoApply: function(evt) {
		if(this._changed) {
			com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("window-collection-title"),com_tilbuci_data_Global.ln.get("window-collection-colapplyno"),320,220,com_tilbuci_data_Global.ln.get("default-ok"),$bind(this,this.onApplyNo),"confirm",com_tilbuci_data_Global.ln.get("default-cancel"));
		} else {
			feathers_core_PopUpManager.removePopUp(this);
		}
	}
	,onApplySure: function(ok) {
		if(ok) {
			this.updateScene();
			feathers_core_PopUpManager.removePopUp(this);
		}
	}
	,onApplyNo: function(ok) {
		if(ok) {
			feathers_core_PopUpManager.removePopUp(this);
		}
	}
	,updateScene: function() {
		var h = this._collections.h;
		var k_h = h;
		var k_keys = Object.keys(h);
		var k_length = k_keys.length;
		var k_current = 0;
		while(k_current < k_length) {
			var k = k_keys[k_current++];
			if(Object.prototype.hasOwnProperty.call(com_tilbuci_data_GlobalPlayer.movie.collections.h,k)) {
				com_tilbuci_data_GlobalPlayer.movie.collections.h[k].name = this._collections.h[k].collection.title;
				com_tilbuci_data_GlobalPlayer.movie.collections.h[k].transition = this._collections.h[k].collection.transition;
				com_tilbuci_data_GlobalPlayer.movie.collections.h[k].time = this._collections.h[k].collection.time;
				com_tilbuci_data_GlobalPlayer.movie.collections.h[k].assets = new haxe_ds_StringMap();
				var astorder = [];
				var ord = 0;
				var h = this._collections.h[k].assets.h;
				var a_h = h;
				var a_keys = Object.keys(h);
				var a_length = a_keys.length;
				var a_current = 0;
				while(a_current < a_length) {
					var a = a_keys[a_current++];
					this._collections.h[k].assets.h[a].order = ord;
					astorder.push(a);
					var this1 = com_tilbuci_data_GlobalPlayer.movie.collections.h[k].assets;
					var v = new com_tilbuci_def_AssetData({ order : this._collections.h[k].assets.h[a].order, name : this._collections.h[k].assets.h[a].name, type : this._collections.h[k].assets.h[a].type, time : this._collections.h[k].assets.h[a].time, action : this._collections.h[k].assets.h[a].action, frames : this._collections.h[k].assets.h[a].frames, frtime : this._collections.h[k].assets.h[a].frtime, file : { "@1" : this._collections.h[k].assets.h[a].file1, "@2" : this._collections.h[k].assets.h[a].file2, "@3" : this._collections.h[k].assets.h[a].file3, "@4" : this._collections.h[k].assets.h[a].file4, "@5" : this._collections.h[k].assets.h[a].file5}});
					this1.h[a] = v;
					++ord;
				}
				com_tilbuci_data_GlobalPlayer.movie.collections.h[k].assetOrder = astorder;
				com_tilbuci_data_GlobalPlayer.area.loadKeyframe(com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[com_tilbuci_data_GlobalPlayer.area.get_currentKf()],com_tilbuci_data_GlobalPlayer.area.get_currentKf());
			}
		}
	}
	,__class__: com_tilbuci_ui_window_media_WindowCollections
});
var com_tilbuci_ui_window_media_WindowCollectionsAdd = function(ac) {
	com_tilbuci_ui_window_PopupWindow.call(this,ac,com_tilbuci_data_Global.ln.get("window-collectionadd-title"),1000,com_tilbuci_ui_base_InterfaceFactory.pickValue(600,620),false,true,true);
};
$hxClasses["com.tilbuci.ui.window.media.WindowCollectionsAdd"] = com_tilbuci_ui_window_media_WindowCollectionsAdd;
com_tilbuci_ui_window_media_WindowCollectionsAdd.__name__ = "com.tilbuci.ui.window.media.WindowCollectionsAdd";
com_tilbuci_ui_window_media_WindowCollectionsAdd.__super__ = com_tilbuci_ui_window_PopupWindow;
com_tilbuci_ui_window_media_WindowCollectionsAdd.prototype = $extend(com_tilbuci_ui_window_PopupWindow.prototype,{
	_colint: null
	,startInterface: function(evt) {
		var tmp = this.ui;
		var tmp1 = this.ui;
		var tmp2 = { tp : "Label", id : "scene", tx : com_tilbuci_data_Global.ln.get("window-collectionadd-colscene"), vr : feathers_controls_Label.VARIANT_DETAIL};
		var tmp3 = com_tilbuci_data_Global.ln.get("window-collectionadd-cols");
		var tmp4 = tmp1.forge("leftcol",[tmp2,{ tp : "List", id : "scene", vl : [], ht : 235, sl : null, ch : $bind(this,this.onSceneChange)},{ tp : "Label", id : "collections", tx : tmp3, vr : feathers_controls_Label.VARIANT_DETAIL},{ tp : "List", id : "collections", vl : [], ht : 235, sl : null, ch : $bind(this,this.onColChange)}]);
		var tmp1 = this.ui;
		var tmp2 = { tp : "Label", id : "assets", tx : com_tilbuci_data_Global.ln.get("window-collection-assets"), vr : feathers_controls_Label.VARIANT_DETAIL};
		var tmp3 = com_tilbuci_data_Global.ln.get("window-collection-assetstagenew");
		this._colint = tmp.createColumnHolder("columns",tmp4,tmp1.forge("rightcol",[tmp2,{ tp : "List", id : "assets", vl : [], ht : 470, sl : null},{ tp : "Button", id : "assetstage", tx : tmp3, ac : $bind(this,this.onAssetAdd)}]));
		this.addForm(com_tilbuci_data_Global.ln.get("window-media-file"),this._colint);
		this.ui.setListToIcon("scene");
		this.ui.setListToIcon("collections");
		this.ui.setListToIcon("assets");
		this.ui.listDbClick("assets",$bind(this,this.onAssetAdd));
		com_tilbuci_ui_window_PopupWindow.prototype.startInterface.call(this);
	}
	,acStart: function() {
		this.loadCollections();
	}
	,loadCollections: function() {
		this.ui.lists.h["scene"].set_alpha(1);
		this.ui.lists.h["collections"].set_alpha(1);
		this.ui.lists.h["assets"].set_selectedItem(null);
		this.ui.setListValues("assets",[]);
		this.ui.lists.h["scene"].set_selectedItem(null);
		var list = [];
		var h = com_tilbuci_data_GlobalPlayer.movie.collections.h;
		var k_h = h;
		var k_keys = Object.keys(h);
		var k_length = k_keys.length;
		var k_current = 0;
		while(k_current < k_length) {
			var k = k_keys[k_current++];
			list.push({ text : com_tilbuci_data_GlobalPlayer.movie.collections.h[k].name, value : k, user : com_tilbuci_data_GlobalPlayer.movie.collections.h[k].assetOrder.length + " " + com_tilbuci_data_Global.ln.get("window-collection-numassets")});
		}
		this.ui.setListValues("scene",list);
		this.ui.lists.h["collections"].set_selectedItem(null);
		this.ui.setListValues("collections",[]);
		var tmp = com_tilbuci_data_Global.ws;
		var _g = new haxe_ds_StringMap();
		var value = com_tilbuci_data_GlobalPlayer.movie.get_mvId();
		_g.h["movie"] = value;
		tmp.send("Media/ListCollections",_g,$bind(this,this.onList));
	}
	,onList: function(ok,ld) {
		if(!ok) {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-collection-title"),com_tilbuci_data_Global.ln.get("window-collection-nolist"),300,180,this.stage);
			feathers_core_PopUpManager.removePopUp(this);
		} else if(ld.map.h["e"] == 0) {
			var clist = ld.map.h["list"];
			var list = [];
			var _g = 0;
			while(_g < clist.length) {
				var i = clist[_g];
				++_g;
				if(com_tilbuci_data_GlobalPlayer.movie.scene.collections.indexOf(i.id) == -1) {
					list.push({ text : i.title, value : i, user : i.num + " " + com_tilbuci_data_Global.ln.get("window-collection-numassets")});
				}
			}
			this.ui.setListValues("collections",list);
		} else {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-collection-title"),com_tilbuci_data_Global.ln.get("window-collection-nolist"),300,180,this.stage);
			feathers_core_PopUpManager.removePopUp(this);
		}
	}
	,onColChange: function(evt) {
		this.ui.lists.h["scene"].set_alpha(0.75);
		this.ui.lists.h["collections"].set_alpha(1);
		this.ui.lists.h["assets"].set_selectedItem(null);
		this.ui.setListValues("assets",[]);
		if(this.ui.lists.h["collections"].get_selectedItem() != null) {
			var tmp = com_tilbuci_data_Global.ws;
			var _g = new haxe_ds_StringMap();
			var value = this.ui.lists.h["collections"].get_selectedItem().value.uid;
			_g.h["uid"] = value;
			tmp.send("Media/ListColAssets",_g,$bind(this,this.onAssetList));
		}
	}
	,onSceneChange: function(evt) {
		this.ui.lists.h["scene"].set_alpha(1);
		this.ui.lists.h["collections"].set_alpha(0.75);
		this.ui.lists.h["assets"].set_selectedItem(null);
		this.ui.setListValues("assets",[]);
		if(this.ui.lists.h["scene"].get_selectedItem() != null) {
			var list = [];
			var _g = 0;
			var this1 = com_tilbuci_data_GlobalPlayer.movie.collections;
			var key = this.ui.lists.h["scene"].get_selectedItem().value;
			var _g1 = this1.h[key].assetOrder;
			while(_g < _g1.length) {
				var n = _g1[_g];
				++_g;
				var this1 = com_tilbuci_data_GlobalPlayer.movie.collections;
				var key = this.ui.lists.h["scene"].get_selectedItem().value;
				var tmp = this1.h[key].assets.h[n].name;
				var tmp1 = com_tilbuci_data_Global.ln;
				var this2 = com_tilbuci_data_GlobalPlayer.movie.collections;
				var key1 = this.ui.lists.h["scene"].get_selectedItem().value;
				list.push({ text : tmp, user : tmp1.get("menu-media-" + this2.h[key1].assets.h[n].type), value : { c : "s", v : n}});
			}
			this.ui.setListValues("assets",list);
		}
	}
	,onAssetList: function(ok,ld) {
		if(!ok) {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-collection-title"),com_tilbuci_data_Global.ln.get("window-collection-nolist"),300,180,this.stage);
			feathers_core_PopUpManager.removePopUp(this);
		} else if(ld.map.h["e"] == 0) {
			var alist = ld.map.h["list"];
			var list = [];
			var _g = 0;
			while(_g < alist.length) {
				var i = alist[_g];
				++_g;
				list.push({ text : i.name, user : com_tilbuci_data_Global.ln.get("menu-media-" + i.type), value : { c : "m", v : i}});
			}
			this.ui.setListValues("assets",list);
		} else {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-collection-title"),com_tilbuci_data_Global.ln.get("window-collection-nolist"),300,180,this.stage);
			feathers_core_PopUpManager.removePopUp(this);
		}
	}
	,onAssetAdd: function(evt) {
		if(this.ui.lists.h["assets"].get_selectedItem() != null) {
			if(this.ui.lists.h["assets"].get_selectedItem().value.c == "s") {
				var tmp = this._ac;
				var _g = new haxe_ds_StringMap();
				var value = this.ui.lists.h["scene"].get_selectedItem().value;
				_g.h["collection"] = value;
				var value = this.ui.lists.h["assets"].get_selectedItem().value.v;
				_g.h["asset"] = value;
				tmp("addinstance",_g);
			} else {
				var col = this.ui.lists.h["collections"].get_selectedItem().value;
				var cdata = new com_tilbuci_def_CollectionData(col.id,null,false);
				cdata.name = col.title;
				cdata.transition = col.transition;
				cdata.time = col.time;
				var _g = 0;
				var _g1 = this.ui.lists.h["assets"].get_dataProvider().get_length();
				while(_g < _g1) {
					var i = _g++;
					var ast = this.ui.lists.h["assets"].get_dataProvider().get(i).value.v;
					var this1 = cdata.assets;
					var k = ast.id;
					var v = new com_tilbuci_def_AssetData({ order : ast.order, name : ast.name, type : ast.type, time : ast.time, action : ast.action, frames : ast.frames, frtime : ast.frtime, file : { "@1" : ast.file1, "@2" : ast.file2, "@3" : ast.file3, "@4" : ast.file4, "@5" : ast.file5}});
					this1.h[k] = v;
					var adata = v;
					cdata.assetOrder.push(ast.id);
				}
				cdata.ok = true;
				com_tilbuci_data_GlobalPlayer.movie.collections.h[col.id] = cdata;
				com_tilbuci_data_GlobalPlayer.movie.scene.collections.push(col.id);
				var tmp = this._ac;
				var _g = new haxe_ds_StringMap();
				_g.h["collection"] = col.id;
				var value = this.ui.lists.h["assets"].get_selectedItem().value.v.id;
				_g.h["asset"] = value;
				tmp("addinstance",_g);
			}
			feathers_core_PopUpManager.removePopUp(this);
		}
	}
	,__class__: com_tilbuci_ui_window_media_WindowCollectionsAdd
});
var com_tilbuci_ui_window_media_WindowCollectionsRm = function(ac) {
	com_tilbuci_ui_window_PopupWindow.call(this,ac,com_tilbuci_data_Global.ln.get("window-collectionrm-title"),1000,com_tilbuci_ui_base_InterfaceFactory.pickValue(590,610),false,true,true);
};
$hxClasses["com.tilbuci.ui.window.media.WindowCollectionsRm"] = com_tilbuci_ui_window_media_WindowCollectionsRm;
com_tilbuci_ui_window_media_WindowCollectionsRm.__name__ = "com.tilbuci.ui.window.media.WindowCollectionsRm";
com_tilbuci_ui_window_media_WindowCollectionsRm.__super__ = com_tilbuci_ui_window_PopupWindow;
com_tilbuci_ui_window_media_WindowCollectionsRm.prototype = $extend(com_tilbuci_ui_window_PopupWindow.prototype,{
	_colint: null
	,startInterface: function(evt) {
		var tmp = this.ui;
		var tmp1 = this.ui;
		var tmp2 = { tp : "Label", id : "collections", tx : com_tilbuci_data_Global.ln.get("window-collectionrm-cols"), vr : feathers_controls_Label.VARIANT_DETAIL};
		var tmp3 = com_tilbuci_data_Global.ln.get("window-collectionrm-colsabout");
		var tmp4 = tmp1.forge("leftcol",[tmp2,{ tp : "List", id : "collections", vl : [], ht : 470, sl : null, ch : $bind(this,this.onColChange)},{ tp : "Label", id : "assets", tx : tmp3, vr : feathers_controls_Label.VARIANT_DETAIL}]);
		var tmp1 = this.ui;
		var tmp2 = { tp : "Label", id : "assets", tx : com_tilbuci_data_Global.ln.get("window-collection-assets"), vr : feathers_controls_Label.VARIANT_DETAIL};
		var tmp3 = com_tilbuci_data_Global.ln.get("window-collection-remove");
		this._colint = tmp.createColumnHolder("columns",tmp4,tmp1.forge("rightcol",[tmp2,{ tp : "List", id : "assets", vl : [], ht : 470, sl : null},{ tp : "Button", id : "assetstage", tx : tmp3, ac : $bind(this,this.onColRemove)}]));
		this.addForm(com_tilbuci_data_Global.ln.get("window-media-file"),this._colint);
		this.ui.setListToIcon("collections");
		this.ui.setListToIcon("assets");
		com_tilbuci_ui_window_PopupWindow.prototype.startInterface.call(this);
	}
	,acStart: function() {
		this.loadCollections();
	}
	,loadCollections: function() {
		this.ui.lists.h["collections"].set_selectedItem(null);
		this.ui.lists.h["assets"].set_selectedItem(null);
		this.ui.setListValues("collections",[]);
		this.ui.setListValues("assets",[]);
		var tmp = com_tilbuci_data_Global.ws;
		var _g = new haxe_ds_StringMap();
		var value = com_tilbuci_data_GlobalPlayer.movie.get_mvId();
		_g.h["movie"] = value;
		tmp.send("Media/ListRmCollections",_g,$bind(this,this.onList));
	}
	,onList: function(ok,ld) {
		if(!ok) {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-collection-title"),com_tilbuci_data_Global.ln.get("window-collection-nolist"),300,180,this.stage);
			feathers_core_PopUpManager.removePopUp(this);
		} else if(ld.map.h["e"] == 0) {
			var clist = ld.map.h["list"];
			var list = [];
			var _g = 0;
			while(_g < clist.length) {
				var i = clist[_g];
				++_g;
				if(com_tilbuci_data_GlobalPlayer.movie.scene.collections.indexOf(i.id) == -1) {
					list.push({ text : i.title, value : i, user : i.num + " " + com_tilbuci_data_Global.ln.get("window-collection-numassets")});
				}
			}
			this.ui.setListValues("collections",list);
		} else {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-collection-title"),com_tilbuci_data_Global.ln.get("window-collection-nolist"),300,180,this.stage);
			feathers_core_PopUpManager.removePopUp(this);
		}
	}
	,onColChange: function(evt) {
		this.ui.lists.h["assets"].set_selectedItem(null);
		this.ui.setListValues("assets",[]);
		if(this.ui.lists.h["collections"].get_selectedItem() != null) {
			var tmp = com_tilbuci_data_Global.ws;
			var _g = new haxe_ds_StringMap();
			var value = this.ui.lists.h["collections"].get_selectedItem().value.uid;
			_g.h["uid"] = value;
			tmp.send("Media/ListColAssets",_g,$bind(this,this.onAssetList));
		}
	}
	,onAssetList: function(ok,ld) {
		if(!ok) {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-collection-title"),com_tilbuci_data_Global.ln.get("window-collection-nolist"),300,180,this.stage);
			feathers_core_PopUpManager.removePopUp(this);
		} else if(ld.map.h["e"] == 0) {
			var alist = ld.map.h["list"];
			var list = [];
			var _g = 0;
			while(_g < alist.length) {
				var i = alist[_g];
				++_g;
				list.push({ text : i.name, user : com_tilbuci_data_Global.ln.get("menu-media-" + i.type), value : i});
			}
			this.ui.setListValues("assets",list);
		} else {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-collection-title"),com_tilbuci_data_Global.ln.get("window-collection-nolist"),300,180,this.stage);
			feathers_core_PopUpManager.removePopUp(this);
		}
	}
	,onColRemove: function(evt) {
		if(this.ui.lists.h["collections"].get_selectedItem() != null) {
			com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("window-collectionrm-title"),com_tilbuci_data_Global.ln.get("window-collectionrm-confirm"),320,220,com_tilbuci_data_Global.ln.get("default-ok"),$bind(this,this.onColRemoveConfirm),"confirm",com_tilbuci_data_Global.ln.get("default-cancel"));
		}
	}
	,onColRemoveConfirm: function(ok) {
		if(ok && this.ui.lists.h["collections"].get_selectedItem() != null) {
			var tmp = com_tilbuci_data_Global.ws;
			var _g = new haxe_ds_StringMap();
			var value = com_tilbuci_data_GlobalPlayer.movie.get_mvId();
			_g.h["movie"] = value;
			var value = this.ui.lists.h["collections"].get_selectedItem().value.id;
			_g.h["col"] = value;
			tmp.send("Media/RemoveCollection",_g,$bind(this,this.onRemoveReturn));
		}
	}
	,onRemoveReturn: function(ok,ld) {
		this.loadCollections();
	}
	,__class__: com_tilbuci_ui_window_media_WindowCollectionsRm
});
var com_tilbuci_ui_window_media_WindowMediaBase = function(ac,title,type,mode) {
	this._frtime = 100;
	this._frames = 1;
	this._filenum = "1";
	com_tilbuci_ui_window_PopupWindow.call(this,ac,title,1000,com_tilbuci_ui_base_InterfaceFactory.pickValue(685,695),false,true,true);
	this._type = type;
	this._mode = mode;
	this._preview = new com_tilbuci_ui_component_MediaPreview(type,460,460);
};
$hxClasses["com.tilbuci.ui.window.media.WindowMediaBase"] = com_tilbuci_ui_window_media_WindowMediaBase;
com_tilbuci_ui_window_media_WindowMediaBase.__name__ = "com.tilbuci.ui.window.media.WindowMediaBase";
com_tilbuci_ui_window_media_WindowMediaBase.__super__ = com_tilbuci_ui_window_PopupWindow;
com_tilbuci_ui_window_media_WindowMediaBase.prototype = $extend(com_tilbuci_ui_window_PopupWindow.prototype,{
	_type: null
	,_path: null
	,_preview: null
	,_mode: null
	,_filenum: null
	,_frames: null
	,_frtime: null
	,startInterface: function(evt) {
		if(!(this._type == "shape" || this._type == "paragraph" || this._type == "text")) {
			var nf = this.ui.createHContainer("newfolder");
			nf.addChild(this.ui.createTInput("newfolder","","",null,false));
			nf.addChild(this.ui.createButton("newfolder",com_tilbuci_data_Global.ln.get("window-media-newfolder"),$bind(this,this.onNewFolder),null,false));
			nf.setWidth(960);
			this.ui.createHContainer("colselect");
			this.ui.createLabel("colname",com_tilbuci_data_Global.ln.get("window-media-colname"),"",this.ui.hcontainers.h["colselect"]);
			this.ui.createSelect("addtocol",[],null,this.ui.hcontainers.h["colselect"]);
			this.ui.createToggle("close",true,this.ui.hcontainers.h["colselect"]);
			this.ui.createLabel("close",com_tilbuci_data_Global.ln.get("window-media-closeafter"),"",this.ui.hcontainers.h["colselect"]);
			this.ui.createHContainer("addtocol");
			this.ui.createButton("addcolast",com_tilbuci_data_Global.ln.get("window-media-addcolast"),$bind(this,this.onAddAsset),this.ui.hcontainers.h["addtocol"]);
			this.ui.createButton("addtocol",com_tilbuci_data_Global.ln.get("window-media-addtocol"),$bind(this,this.onAddToCol),this.ui.hcontainers.h["addtocol"]);
			this.ui.createToggle("multiple",true,this.ui.hcontainers.h["addtocol"],$bind(this,this.onMultiple));
			this.ui.createLabel("multiple",com_tilbuci_data_Global.ln.get("window-media-multiple"),"",this.ui.hcontainers.h["addtocol"]);
			this.ui.hcontainers.h["addtocol"].setWidth(460);
			var tmp = com_tilbuci_data_Global.ln.get("window-media-file");
			var tmp1 = this.ui;
			var tmp2 = this.ui.forge("leftcol",[{ tp : "Label", id : "filestitle", tx : com_tilbuci_data_Global.ln.get("window-media-file"), vr : feathers_controls_Label.VARIANT_DETAIL},{ tp : "List", id : "fileslist", vl : [], ht : 350, sl : null},{ tp : "Button", id : "btadd", tx : "", ac : $bind(this,this.onOpen)},{ tp : "Spacer", id : "colselect", ht : 5, ln : true},{ tp : "Custom", cont : this.ui.hcontainers.h["colselect"]},{ tp : "Custom", cont : this.ui.hcontainers.h["addtocol"]}]);
			var tmp3 = this.ui.forge("rightcol",[{ tp : "Custom", cont : this._preview}]);
			var tmp4 = this.ui;
			var tmp5 = { tp : "Button", id : "btupload", tx : com_tilbuci_data_Global.ln.get("window-media-upload"), ac : $bind(this,this.onUpload)};
			var tmp6 = com_tilbuci_data_Global.ln.get("window-media-uploadzip");
			this.addForm(tmp,tmp1.createColumnHolder("columns",tmp2,tmp3,tmp4.forge("bottom",[{ tp : "Custom", cont : nf},{ tp : "Button", id : "btremove", tx : "", ac : $bind(this,this.onRemove)},tmp5,{ tp : "Button", id : "btuploadzip", tx : tmp6, ac : $bind(this,this.onUploadZip)}]),505));
			this.ui.setListToIcon("fileslist");
			this.ui.listChange("fileslist",$bind(this,this.onChange));
			this.ui.listDbClick("fileslist",$bind(this,this.onDoubleClick));
		}
		com_tilbuci_ui_window_PopupWindow.prototype.startInterface.call(this);
	}
	,kill: function() {
		com_tilbuci_ui_window_PopupWindow.prototype.kill.call(this);
	}
	,action: function(ac,data) {
		if(ac == "setmode") {
			if(data.h["mode"] == "asset") {
				this._mode = "asset";
				this._filenum = data.h["num"];
			} else if(data.h["mode"] == "assetsingle") {
				this._mode = "assetsingle";
				this._filenum = data.h["num"];
			} else if(data.h["mode"] == "newasset") {
				this._mode = "newasset";
			} else if(data.h["mode"] == "single") {
				this._mode = "single";
			} else {
				this._mode = "simple";
			}
		}
	}
	,acStart: function() {
		this._path = "";
		this._mode = "simple";
		this.loadPath();
		this.ui.spacers.h["colselect"].set_alpha(0);
		this.ui.hcontainers.h["addtocol"].set_visible(false);
		this.ui.hcontainers.h["addtocol"].setWidth(460,[125,165,40,100]);
		this.ui.hcontainers.h["colselect"].set_visible(false);
		this.ui.hcontainers.h["colselect"].setWidth(460,[80,210,40,100]);
		this.ui.toggles.h["multiple"].set_selected(false);
		this.ui.lists.h["fileslist"].set_allowMultipleSelection(false);
		var list = [];
		var h = com_tilbuci_data_GlobalPlayer.movie.collections.h;
		var k_h = h;
		var k_keys = Object.keys(h);
		var k_length = k_keys.length;
		var k_current = 0;
		while(k_current < k_length) {
			var k = k_keys[k_current++];
			list.push({ text : com_tilbuci_data_GlobalPlayer.movie.collections.h[k].name, value : k});
		}
		this.ui.setSelectOptions("addtocol",list);
	}
	,onMultiple: function(evt) {
		this.ui.lists.h["fileslist"].set_allowMultipleSelection(this.ui.toggles.h["multiple"].get_selected());
		this.ui.setListSelectValue("fileslist",null);
	}
	,loadPath: function() {
		this.ui.setListValues("fileslist",[]);
		this.ui.labels.h["filestitle"].set_text(com_tilbuci_data_Global.ln.get("window-media-wait"));
		this.ui.buttons.h["btadd"].set_text("");
		this.ui.buttons.h["btadd"].set_enabled(false);
		this.ui.buttons.h["btadd"].set_visible(false);
		this.ui.buttons.h["btremove"].set_enabled(false);
		this.ui.buttons.h["btremove"].set_visible(false);
		this._preview.hide();
		var tmp = com_tilbuci_data_Global.ws;
		var _g = new haxe_ds_StringMap();
		var value = com_tilbuci_data_GlobalPlayer.movie.get_mvId();
		_g.h["movie"] = value;
		_g.h["type"] = this._type;
		_g.h["path"] = this._path;
		tmp.send("Media/List",_g,$bind(this,this.onList));
	}
	,onList: function(ok,ld) {
		if(!ok) {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-media-title"),com_tilbuci_data_Global.ln.get("window-media-nolist"),300,180,this.stage);
			feathers_core_PopUpManager.removePopUp(this);
		} else if(ld.map.h["e"] == 0) {
			var its = [];
			if(this._path != "") {
				its.push({ text : com_tilbuci_data_Global.ln.get("window-media-uplevel"), value : com_tilbuci_data_Global.ln.get("window-media-uplevel"), type : "up", asset : "iconUpLevel"});
			}
			var _g = 0;
			var _g1 = Reflect.fields(ld.map.h["list"]);
			while(_g < _g1.length) {
				var it = _g1[_g];
				++_g;
				if(Reflect.field(Reflect.field(ld.map.h["list"],it),"t") == "d") {
					its.push({ text : Reflect.field(Reflect.field(ld.map.h["list"],it),"n"), value : Reflect.field(Reflect.field(ld.map.h["list"],it),"n"), type : "d", asset : "iconFolder"});
				} else {
					its.push({ text : Reflect.field(Reflect.field(ld.map.h["list"],it),"n"), value : Reflect.field(Reflect.field(ld.map.h["list"],it),"n"), type : "f", asset : ""});
				}
			}
			this.ui.setListValues("fileslist",its);
			this.ui.labels.h["filestitle"].set_text("/" + this._path);
		} else {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-media-title"),com_tilbuci_data_Global.ln.get("window-media-nolist"),300,180,this.stage);
			feathers_core_PopUpManager.removePopUp(this);
		}
	}
	,onAddToCol: function(evt) {
		if(this.ui.toggles.h["multiple"].get_selected() && this.ui.selects.h["addtocol"].get_selectedItem() != null && this.ui.lists.h["fileslist"].get_selectedItems().length > 0) {
			var addlist = [];
			var _g = 0;
			var _g1 = this.ui.lists.h["fileslist"].get_selectedItems();
			while(_g < _g1.length) {
				var item = _g1[_g];
				++_g;
				if(item.type == "f") {
					addlist.unshift(item);
				}
			}
			if(addlist.length > 0) {
				var _g = 0;
				while(_g < addlist.length) {
					var item = addlist[_g];
					++_g;
					var tmp = this._ac;
					var _g1 = new haxe_ds_StringMap();
					_g1.h["stage"] = "true";
					var value = this.ui.selects.h["addtocol"].get_selectedItem().value;
					_g1.h["col"] = value;
					_g1.h["path"] = this._path;
					_g1.h["type"] = this._type;
					_g1.h["file"] = item.text;
					_g1.h["frames"] = Std.string(this._frames);
					_g1.h["frtime"] = Std.string(this._frtime);
					tmp("addtocol",_g1);
				}
				if(this.ui.toggles.h["close"].get_selected()) {
					feathers_core_PopUpManager.removePopUp(this);
				} else {
					this.ui.setListSelectValue("fileslist",null);
				}
			}
			while(addlist.length > 0) addlist.shift();
			addlist = null;
		} else if(this.ui.lists.h["fileslist"].get_selectedItem() != null && this.ui.selects.h["addtocol"].get_selectedItem() != null) {
			if(this.ui.lists.h["fileslist"].get_selectedItem().type == "f") {
				var tmp = this._ac;
				var _g = new haxe_ds_StringMap();
				_g.h["stage"] = "true";
				var value = this.ui.selects.h["addtocol"].get_selectedItem().value;
				_g.h["col"] = value;
				_g.h["path"] = this._path;
				_g.h["type"] = this._type;
				var value = this.ui.lists.h["fileslist"].get_selectedItem().text;
				_g.h["file"] = value;
				_g.h["frames"] = Std.string(this._frames);
				_g.h["frtime"] = Std.string(this._frtime);
				tmp("addtocol",_g);
				if(this.ui.toggles.h["close"].get_selected()) {
					feathers_core_PopUpManager.removePopUp(this);
				} else {
					this.ui.lists.h["fileslist"].set_selectedIndex(-1);
					this.ui.buttons.h["btadd"].set_enabled(false);
					this.ui.buttons.h["btadd"].set_visible(false);
					this.ui.buttons.h["btremove"].set_enabled(false);
					this.ui.buttons.h["btremove"].set_visible(false);
					this._preview.hide();
					this.ui.hcontainers.h["addtocol"].set_visible(false);
					this.ui.hcontainers.h["colselect"].set_visible(false);
					this.ui.spacers.h["colselect"].set_alpha(0);
					com_tilbuci_data_Global.showMsg(com_tilbuci_data_Global.ln.get("window-media-addedstage"));
				}
			}
		}
	}
	,onAddAsset: function(evt) {
		if(this.ui.toggles.h["multiple"].get_selected() && this.ui.selects.h["addtocol"].get_selectedItem() != null && this.ui.lists.h["fileslist"].get_selectedItems().length > 0) {
			var addlist = [];
			var _g = 0;
			var _g1 = this.ui.lists.h["fileslist"].get_selectedItems();
			while(_g < _g1.length) {
				var item = _g1[_g];
				++_g;
				if(item.type == "f") {
					addlist.unshift(item);
				}
			}
			if(addlist.length > 0) {
				var _g = 0;
				while(_g < addlist.length) {
					var item = addlist[_g];
					++_g;
					var tmp = this._ac;
					var _g1 = new haxe_ds_StringMap();
					_g1.h["stage"] = "false";
					var value = this.ui.selects.h["addtocol"].get_selectedItem().value;
					_g1.h["col"] = value;
					_g1.h["path"] = this._path;
					_g1.h["type"] = this._type;
					_g1.h["file"] = item.text;
					_g1.h["frames"] = Std.string(this._frames);
					_g1.h["frtime"] = Std.string(this._frtime);
					tmp("addtocol",_g1);
				}
				if(this.ui.toggles.h["close"].get_selected()) {
					feathers_core_PopUpManager.removePopUp(this);
				} else {
					this.ui.setListSelectValue("fileslist",null);
				}
			}
			while(addlist.length > 0) addlist.shift();
			addlist = null;
		} else if(this.ui.lists.h["fileslist"].get_selectedItem() != null && this.ui.selects.h["addtocol"].get_selectedItem() != null) {
			if(this.ui.lists.h["fileslist"].get_selectedItem().type == "f") {
				var tmp = this._ac;
				var _g = new haxe_ds_StringMap();
				_g.h["stage"] = "false";
				var value = this.ui.selects.h["addtocol"].get_selectedItem().value;
				_g.h["col"] = value;
				_g.h["path"] = this._path;
				_g.h["type"] = this._type;
				var value = this.ui.lists.h["fileslist"].get_selectedItem().text;
				_g.h["file"] = value;
				_g.h["frames"] = Std.string(this._frames);
				_g.h["frtime"] = Std.string(this._frtime);
				tmp("addtocol",_g);
				if(this.ui.toggles.h["close"].get_selected()) {
					feathers_core_PopUpManager.removePopUp(this);
				} else {
					this.ui.lists.h["fileslist"].set_selectedIndex(-1);
					this.ui.buttons.h["btadd"].set_enabled(false);
					this.ui.buttons.h["btadd"].set_visible(false);
					this.ui.buttons.h["btremove"].set_enabled(false);
					this.ui.buttons.h["btremove"].set_visible(false);
					this._preview.hide();
					this.ui.hcontainers.h["addtocol"].set_visible(false);
					this.ui.hcontainers.h["colselect"].set_visible(false);
					this.ui.spacers.h["colselect"].set_alpha(0);
					com_tilbuci_data_Global.showMsg(com_tilbuci_data_Global.ln.get("window-media-addedcol"));
				}
			}
		}
	}
	,onOpen: function(evt) {
		if(this.ui.toggles.h["multiple"].get_selected()) {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-media-title"),com_tilbuci_data_Global.ln.get("window-media-nomultiple"),300,180,this.stage);
		} else {
			this._preview.onStop(null);
			if(this.ui.lists.h["fileslist"].get_selectedItem().type == "d") {
				this._path += Std.string(this.ui.lists.h["fileslist"].get_selectedItem().text) + "/";
				this.loadPath();
			} else if(this.ui.lists.h["fileslist"].get_selectedItem().type == "up") {
				var par = this._path.split("/");
				this._path = "";
				if(par.length > 1) {
					var _g = 0;
					var _g1 = par.length - 2;
					while(_g < _g1) {
						var i = _g++;
						if(par[i] != "") {
							this._path += par[i] + "/";
						}
					}
				}
				this.loadPath();
			} else if(this.ui.lists.h["fileslist"].get_selectedItem().type == "f") {
				if(this._mode == "asset") {
					this._mode = "simple";
					var tmp = this._ac;
					var _g = new haxe_ds_StringMap();
					_g.h["path"] = this._path;
					_g.h["type"] = this._type;
					var value = this.ui.lists.h["fileslist"].get_selectedItem().text;
					_g.h["file"] = value;
					_g.h["frames"] = Std.string(this._frames);
					_g.h["frtime"] = Std.string(this._frtime);
					_g.h["num"] = this._filenum;
					tmp("addasset",_g);
					feathers_core_PopUpManager.removePopUp(this);
				} else if(this._mode == "assetsingle") {
					this._mode = "simple";
					var tmp = this._ac;
					var _g = new haxe_ds_StringMap();
					_g.h["path"] = this._path;
					_g.h["type"] = this._type;
					var value = this.ui.lists.h["fileslist"].get_selectedItem().text;
					_g.h["file"] = value;
					_g.h["frames"] = Std.string(this._frames);
					_g.h["frtime"] = Std.string(this._frtime);
					_g.h["num"] = this._filenum;
					tmp("assetsingle",_g);
					feathers_core_PopUpManager.removePopUp(this);
				} else if(this._mode == "newasset") {
					this._mode = "simple";
					var tmp = this._ac;
					var _g = new haxe_ds_StringMap();
					_g.h["path"] = this._path;
					_g.h["type"] = this._type;
					var value = this.ui.lists.h["fileslist"].get_selectedItem().text;
					_g.h["file"] = value;
					_g.h["frames"] = Std.string(this._frames);
					_g.h["frtime"] = Std.string(this._frtime);
					tmp("addnewasset",_g);
					feathers_core_PopUpManager.removePopUp(this);
				} else if(this._mode == "single") {
					this._mode = "single";
					var tmp = this._ac;
					var _g = new haxe_ds_StringMap();
					_g.h["path"] = this._path;
					_g.h["type"] = this._type;
					var value = this.ui.lists.h["fileslist"].get_selectedItem().text;
					_g.h["file"] = value;
					_g.h["frames"] = Std.string(this._frames);
					_g.h["frtime"] = Std.string(this._frtime);
					tmp("single",_g);
					feathers_core_PopUpManager.removePopUp(this);
				} else {
					var tmp = this._ac;
					var _g = new haxe_ds_StringMap();
					_g.h["path"] = this._path;
					_g.h["type"] = this._type;
					var value = this.ui.lists.h["fileslist"].get_selectedItem().text;
					_g.h["file"] = value;
					_g.h["frames"] = Std.string(this._frames);
					_g.h["frtime"] = Std.string(this._frtime);
					tmp("addstage",_g);
					feathers_core_PopUpManager.removePopUp(this);
				}
			}
		}
	}
	,onDoubleClick: function(evt) {
		this.onOpen(null);
	}
	,onChange: function(evt) {
		if(this.ui.lists.h["fileslist"].get_selectedItem() != null) {
			if(this.ui.lists.h["fileslist"].get_selectedItem().type == "d") {
				this.ui.buttons.h["btadd"].set_text(com_tilbuci_data_Global.ln.get("window-media-openfolder"));
				this.ui.buttons.h["btremove"].set_enabled(true);
				this.ui.buttons.h["btremove"].set_visible(true);
				this.ui.buttons.h["btremove"].set_text(com_tilbuci_data_Global.ln.get("window-media-removedir"));
				this._preview.hide();
				this.ui.hcontainers.h["addtocol"].set_visible(false);
				this.ui.hcontainers.h["colselect"].set_visible(false);
				this.ui.spacers.h["colselect"].set_alpha(0);
			} else if(this.ui.lists.h["fileslist"].get_selectedItem().type == "up") {
				this.ui.buttons.h["btadd"].set_text(com_tilbuci_data_Global.ln.get("window-media-uplevel"));
				this.ui.buttons.h["btremove"].set_enabled(false);
				this.ui.buttons.h["btremove"].set_visible(false);
				this._preview.hide();
				this.ui.hcontainers.h["addtocol"].set_visible(false);
				this.ui.hcontainers.h["colselect"].set_visible(false);
				this.ui.spacers.h["colselect"].set_alpha(0);
			} else {
				if(this._mode == "asset") {
					this.ui.buttons.h["btadd"].set_text(com_tilbuci_data_Global.ln.get("window-media-addcol") + " @" + this._filenum);
					this.ui.hcontainers.h["addtocol"].set_visible(false);
					this.ui.hcontainers.h["colselect"].set_visible(false);
					this.ui.spacers.h["colselect"].set_alpha(0);
				} else if(this._mode == "newasset") {
					this.ui.buttons.h["btadd"].set_text(com_tilbuci_data_Global.ln.get("window-media-addast"));
					this.ui.hcontainers.h["addtocol"].set_visible(false);
					this.ui.hcontainers.h["colselect"].set_visible(false);
					this.ui.spacers.h["colselect"].set_alpha(0);
				} else if(this._mode == "single") {
					this.ui.buttons.h["btadd"].set_text(com_tilbuci_data_Global.ln.get("window-media-addsingle"));
					this.ui.hcontainers.h["addtocol"].set_visible(false);
					this.ui.hcontainers.h["colselect"].set_visible(false);
					this.ui.spacers.h["colselect"].set_alpha(0);
				} else if(this._mode == "assetsingle") {
					this.ui.buttons.h["btadd"].set_text(com_tilbuci_data_Global.ln.get("window-media-addsingle"));
					this.ui.hcontainers.h["addtocol"].set_visible(false);
					this.ui.hcontainers.h["colselect"].set_visible(false);
					this.ui.spacers.h["colselect"].set_alpha(0);
				} else {
					this.ui.buttons.h["btadd"].set_text(com_tilbuci_data_Global.ln.get("window-media-addstage"));
					if(this.ui.selects.h["addtocol"].get_dataProvider().get_length() > 0) {
						this.ui.hcontainers.h["colselect"].set_visible(this.ui.hcontainers.h["addtocol"].set_visible(true));
						this.ui.spacers.h["colselect"].set_alpha(100);
					}
				}
				this.ui.buttons.h["btremove"].set_enabled(true);
				this.ui.buttons.h["btremove"].set_visible(true);
				this.ui.buttons.h["btremove"].set_text(com_tilbuci_data_Global.ln.get("window-media-removefile"));
				this._preview.preview(com_tilbuci_data_Global.econfig.get_player() + "movie/" + com_tilbuci_data_GlobalPlayer.movie.get_mvId() + ".movie/media/" + this._type + "/" + this._path + Std.string(this.ui.lists.h["fileslist"].get_selectedItem().text));
			}
			this.ui.buttons.h["btadd"].set_enabled(true);
			this.ui.buttons.h["btadd"].set_visible(true);
		}
	}
	,onNewFolder: function(evt) {
		this._preview.onStop(null);
		if(this.ui.inputs.h["newfolder"].get_text() == "") {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-media-title"),com_tilbuci_data_Global.ln.get("window-media-newfoldernoname"),300,180,this.stage);
		} else {
			this.ui.setListValues("fileslist",[]);
			this.ui.labels.h["filestitle"].set_text(com_tilbuci_data_Global.ln.get("window-media-wait"));
			this.ui.buttons.h["btadd"].set_text("");
			this.ui.buttons.h["btadd"].set_enabled(false);
			this.ui.buttons.h["btadd"].set_visible(false);
			this.ui.buttons.h["btremove"].set_enabled(false);
			this.ui.buttons.h["btremove"].set_visible(false);
			this._preview.hide();
			var tmp = com_tilbuci_data_Global.ws;
			var _g = new haxe_ds_StringMap();
			var value = com_tilbuci_data_GlobalPlayer.movie.get_mvId();
			_g.h["movie"] = value;
			_g.h["type"] = this._type;
			_g.h["path"] = this._path;
			var value = this.ui.inputs.h["newfolder"].get_text();
			_g.h["name"] = value;
			tmp.send("Media/NewFolder",_g,$bind(this,this.onNewFolderReturn));
			this.ui.inputs.h["newfolder"].set_text("");
		}
		this.ui.hcontainers.h["addtocol"].set_visible(false);
		this.ui.hcontainers.h["colselect"].set_visible(false);
		this.ui.spacers.h["colselect"].set_alpha(0);
	}
	,onNewFolderReturn: function(ok,ld) {
		if(!ok) {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-media-title"),com_tilbuci_data_Global.ln.get("window-media-newfolderer"),300,180,this.stage);
		} else if(ld.map.h["e"] == 0) {
			this.onList(ok,ld);
		} else {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-media-title"),com_tilbuci_data_Global.ln.get("window-media-newfolderer"),300,180,this.stage);
		}
	}
	,onRemove: function(evt) {
		this._preview.onStop(null);
		this.ui.createConfirm(com_tilbuci_data_Global.ln.get("window-media-title"),com_tilbuci_data_Global.ln.get("window-media-removewarn"),400,220,$bind(this,this.onRealRemove),com_tilbuci_data_Global.ln.get("default-ok"),com_tilbuci_data_Global.ln.get("default-cancel"),this.stage);
	}
	,onRealRemove: function(ok) {
		if(ok) {
			if(this.ui.lists.h["fileslist"].get_selectedItem().type == "d") {
				var tmp = com_tilbuci_data_Global.ws;
				var _g = new haxe_ds_StringMap();
				var value = com_tilbuci_data_GlobalPlayer.movie.get_mvId();
				_g.h["movie"] = value;
				_g.h["type"] = this._type;
				_g.h["path"] = this._path;
				var value = this.ui.lists.h["fileslist"].get_selectedItem().text;
				_g.h["name"] = value;
				tmp.send("Media/DeleteFolder",_g,$bind(this,this.onRemoveFolder));
			} else if(this.ui.lists.h["fileslist"].get_selectedItem().type == "f") {
				var tmp = com_tilbuci_data_Global.ws;
				var _g = new haxe_ds_StringMap();
				var value = com_tilbuci_data_GlobalPlayer.movie.get_mvId();
				_g.h["movie"] = value;
				_g.h["type"] = this._type;
				_g.h["path"] = this._path;
				var value = this.ui.lists.h["fileslist"].get_selectedItem().text;
				_g.h["name"] = value;
				tmp.send("Media/DeleteFile",_g,$bind(this,this.onRemoveFile));
			}
			this.ui.hcontainers.h["addtocol"].set_visible(false);
			this.ui.hcontainers.h["colselect"].set_visible(false);
			this.ui.spacers.h["colselect"].set_alpha(0);
		}
	}
	,onRemoveFolder: function(ok,ld) {
		this._preview.onStop(null);
		if(!ok) {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-media-title"),com_tilbuci_data_Global.ln.get("window-media-removedirer"),300,180,this.stage);
		} else if(ld.map.h["e"] == 0) {
			this.loadPath();
		} else {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-media-title"),com_tilbuci_data_Global.ln.get("window-media-removedirer"),300,180,this.stage);
		}
		this.ui.hcontainers.h["addtocol"].set_visible(false);
		this.ui.hcontainers.h["colselect"].set_visible(false);
		this.ui.spacers.h["colselect"].set_alpha(0);
	}
	,onRemoveFile: function(ok,ld) {
		this._preview.onStop(null);
		if(!ok) {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-media-title"),com_tilbuci_data_Global.ln.get("window-media-removefileer"),300,180,this.stage);
		} else if(ld.map.h["e"] == 0) {
			this.loadPath();
		} else {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-media-title"),com_tilbuci_data_Global.ln.get("window-media-removefileer"),300,180,this.stage);
		}
	}
	,onUpload: function(evt) {
		this._preview.onStop(null);
		com_tilbuci_data_Global.up.browseForMedia($bind(this,this.onFileSelcted),this._type);
		this.ui.hcontainers.h["addtocol"].set_visible(false);
		this.ui.hcontainers.h["colselect"].set_visible(false);
		this.ui.spacers.h["colselect"].set_alpha(0);
	}
	,onUploadZip: function(evt) {
		this._preview.onStop(null);
		com_tilbuci_data_Global.up.browseForMedia($bind(this,this.onZipFileSelcted),"zip");
		this.ui.hcontainers.h["addtocol"].set_visible(false);
		this.ui.hcontainers.h["colselect"].set_visible(false);
		this.ui.spacers.h["colselect"].set_alpha(0);
	}
	,onFileSelcted: function(ok) {
		this._preview.onStop(null);
		if(ok) {
			var tmp = com_tilbuci_data_Global.up;
			var _g = new haxe_ds_StringMap();
			var value = com_tilbuci_data_GlobalPlayer.movie.get_mvId();
			_g.h["movie"] = value;
			_g.h["type"] = this._type;
			_g.h["path"] = this._path;
			tmp.uploadMedia($bind(this,this.onUploadReturn),_g);
		}
	}
	,onZipFileSelcted: function(ok) {
		this._preview.onStop(null);
		if(ok) {
			var tmp = com_tilbuci_data_Global.up;
			var _g = new haxe_ds_StringMap();
			var value = com_tilbuci_data_GlobalPlayer.movie.get_mvId();
			_g.h["movie"] = value;
			_g.h["type"] = "zip_" + this._type;
			_g.h["path"] = this._path;
			tmp.uploadMedia($bind(this,this.onUploadReturn),_g);
		}
	}
	,onUploadReturn: function(ok,data) {
		if(ok) {
			this.loadPath();
		} else {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-media-title"),com_tilbuci_data_Global.ln.get("window-media-uploader"),300,180,this.stage);
		}
	}
	,__class__: com_tilbuci_ui_window_media_WindowMediaBase
});
var com_tilbuci_ui_window_media_WindowMediaAudio = function(ac,mode) {
	com_tilbuci_ui_window_media_WindowMediaBase.call(this,ac,com_tilbuci_data_Global.ln.get("window-mdaudio-title"),"audio",mode);
};
$hxClasses["com.tilbuci.ui.window.media.WindowMediaAudio"] = com_tilbuci_ui_window_media_WindowMediaAudio;
com_tilbuci_ui_window_media_WindowMediaAudio.__name__ = "com.tilbuci.ui.window.media.WindowMediaAudio";
com_tilbuci_ui_window_media_WindowMediaAudio.__super__ = com_tilbuci_ui_window_media_WindowMediaBase;
com_tilbuci_ui_window_media_WindowMediaAudio.prototype = $extend(com_tilbuci_ui_window_media_WindowMediaBase.prototype,{
	startInterface: function(evt) {
		com_tilbuci_ui_window_media_WindowMediaBase.prototype.startInterface.call(this);
	}
	,kill: function() {
		com_tilbuci_ui_window_media_WindowMediaBase.prototype.kill.call(this);
	}
	,__class__: com_tilbuci_ui_window_media_WindowMediaAudio
});
var com_tilbuci_ui_window_media_WindowMediaEmbed = function(ac) {
	com_tilbuci_ui_window_PopupWindow.call(this,ac,com_tilbuci_data_Global.ln.get("window-mdembed-title"),1000,com_tilbuci_ui_base_InterfaceFactory.pickValue(415,440),false,true,true);
};
$hxClasses["com.tilbuci.ui.window.media.WindowMediaEmbed"] = com_tilbuci_ui_window_media_WindowMediaEmbed;
com_tilbuci_ui_window_media_WindowMediaEmbed.__name__ = "com.tilbuci.ui.window.media.WindowMediaEmbed";
com_tilbuci_ui_window_media_WindowMediaEmbed.__super__ = com_tilbuci_ui_window_PopupWindow;
com_tilbuci_ui_window_media_WindowMediaEmbed.prototype = $extend(com_tilbuci_ui_window_PopupWindow.prototype,{
	startInterface: function(evt) {
		var tmp = this.ui;
		var tmp1 = this.ui;
		var tmp2 = { tp : "Label", id : "available", tx : com_tilbuci_data_Global.ln.get("window-mdembed-available"), vr : ""};
		var tmp3 = { tp : "Button", id : "show", tx : com_tilbuci_data_Global.ln.get("window-mdembed-show"), ac : $bind(this,this.onShow)};
		var tmp4 = com_tilbuci_data_Global.ln.get("window-mdembed-remove");
		var tmp5 = tmp1.forge("left",[tmp2,{ tp : "List", id : "available", vl : [], sl : null, ht : 260},tmp3,{ tp : "Button", id : "remove", tx : tmp4, ac : $bind(this,this.onRemove)}]);
		var tmp1 = this.ui;
		var tmp2 = { tp : "Label", id : "add", tx : com_tilbuci_data_Global.ln.get("window-mdembed-add"), vr : ""};
		var tmp3 = { tp : "Label", id : "addabout", tx : com_tilbuci_data_Global.ln.get("window-mdembed-addabout"), vr : feathers_controls_Label.VARIANT_DETAIL};
		var tmp4 = { tp : "Label", id : "addname", tx : com_tilbuci_data_Global.ln.get("window-mdembed-addname"), vr : feathers_controls_Label.VARIANT_DETAIL};
		var tmp6 = com_tilbuci_data_Global.ln.get("window-mdembed-addselect");
		this.addForm("embed",tmp.createColumnHolder("embedcol",tmp5,tmp1.forge("right",[tmp2,tmp3,{ tp : "Spacer", id : "addabout", ht : 152, ln : false},tmp4,{ tp : "TInput", id : "addname", vl : "", vr : ""},{ tp : "Button", id : "addselect", tx : tmp6, ac : $bind(this,this.onSelectZip)}])));
		this.ui.labels.h["addabout"].set_wordWrap(true);
	}
	,acStart: function() {
		this.loadList();
	}
	,loadList: function() {
		this.ui.setListValues("available",[]);
		this.ui.inputs.h["addname"].set_text("");
		var tmp = com_tilbuci_data_Global.ws;
		var _g = new haxe_ds_StringMap();
		var value = com_tilbuci_data_GlobalPlayer.movie.get_mvId();
		_g.h["movie"] = value;
		tmp.send("Media/Embed",_g,$bind(this,this.onList));
	}
	,onList: function(ok,ld) {
		if(ok) {
			if(ld.map.h["e"] == 0) {
				var list = ld.map.h["list"];
				if(list == null) {
					com_tilbuci_data_Global.showMsg(com_tilbuci_data_Global.ln.get("window-mdembed-listerror"));
				} else if(list.length == 0) {
					com_tilbuci_data_Global.showMsg(com_tilbuci_data_Global.ln.get("window-mdembed-listempty"));
				} else {
					var av = [];
					var _g = 0;
					while(_g < list.length) {
						var l = list[_g];
						++_g;
						av.push({ text : l, value : l});
					}
					this.ui.setListValues("available",av);
				}
			} else {
				com_tilbuci_data_Global.showMsg(com_tilbuci_data_Global.ln.get("window-mdembed-listerror"));
			}
		} else {
			com_tilbuci_data_Global.showMsg(com_tilbuci_data_Global.ln.get("window-mdembed-listerror"));
		}
	}
	,onSelectZip: function(evt) {
		this.ui.inputs.h["addname"].set_text(StringTools.replace(this.ui.inputs.h["addname"].get_text()," ",""));
		this.ui.inputs.h["addname"].set_text(StringTools.trim(this.ui.inputs.h["addname"].get_text()));
		if(this.ui.inputs.h["addname"].get_text().length < 5) {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-mdembed-title"),com_tilbuci_data_Global.ln.get("window-mdembed-smallname"),300,180,this.stage);
		} else {
			com_tilbuci_data_Global.up.browseForMedia($bind(this,this.onFileSelected),"embed");
		}
	}
	,onFileSelected: function(ok) {
		if(ok) {
			var tmp = com_tilbuci_data_Global.up;
			var _g = new haxe_ds_StringMap();
			var value = com_tilbuci_data_GlobalPlayer.movie.get_mvId();
			_g.h["movie"] = value;
			_g.h["type"] = "embed";
			var value = this.ui.inputs.h["addname"].get_text();
			_g.h["path"] = value;
			tmp.uploadMedia($bind(this,this.onUploadReturn),_g);
		}
	}
	,onUploadReturn: function(ok,data) {
		if(ok) {
			var tmp = com_tilbuci_data_Global.ws;
			var _g = new haxe_ds_StringMap();
			var value = com_tilbuci_data_GlobalPlayer.movie.get_mvId();
			_g.h["movie"] = value;
			var value = this.ui.inputs.h["addname"].get_text();
			_g.h["name"] = value;
			tmp.send("Media/EmbedImport",_g,$bind(this,this.onZipReturn));
		} else {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-mdembed-title"),com_tilbuci_data_Global.ln.get("window-mdembed-uperror"),320,180,this.stage);
		}
	}
	,onZipReturn: function(ok,ld) {
		if(ok) {
			if(ld.map.h["e"] == 0) {
				this.loadList();
			} else {
				this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-mdembed-title"),com_tilbuci_data_Global.ln.get("window-mdembed-uperror"),320,180,this.stage);
			}
		} else {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-mdembed-title"),com_tilbuci_data_Global.ln.get("window-mdembed-uperror"),320,180,this.stage);
		}
	}
	,onShow: function(evt) {
		if(this.ui.lists.h["available"].get_selectedItem() != null) {
			var url = StringTools.replace(com_tilbuci_data_Global.ws.get_url(),"/ws","/movie") + "/" + com_tilbuci_data_GlobalPlayer.movie.get_mvId() + ".movie/media/embed/" + Std.string(this.ui.lists.h["available"].get_selectedItem().value) + "/index.html";
			var req = new openfl_net_URLRequest(url);
			req.method = "GET";
			openfl_Lib.getURL(req);
		}
	}
	,onRemove: function(evt) {
		if(this.ui.lists.h["available"].get_selectedItem() != null) {
			this.ui.createConfirm(com_tilbuci_data_Global.ln.get("window-mdembed-title"),com_tilbuci_data_Global.ln.get("window-mdembed-removeconfirm"),320,230,$bind(this,this.onRemoveConfirm),com_tilbuci_data_Global.ln.get("default-ok"),com_tilbuci_data_Global.ln.get("default-cancel"),this.stage);
		}
	}
	,onRemoveConfirm: function(ok) {
		if(ok) {
			var tmp = com_tilbuci_data_Global.ws;
			var _g = new haxe_ds_StringMap();
			var value = com_tilbuci_data_GlobalPlayer.movie.get_mvId();
			_g.h["movie"] = value;
			var value = this.ui.lists.h["available"].get_selectedItem().value;
			_g.h["name"] = value;
			tmp.send("Media/EmbedRemove",_g,$bind(this,this.onRemoveReturn));
		}
	}
	,onRemoveReturn: function(ok,ld) {
		this.loadList();
	}
	,__class__: com_tilbuci_ui_window_media_WindowMediaEmbed
});
var com_tilbuci_ui_window_media_WindowMediaHtml = function(ac,mode) {
	com_tilbuci_ui_window_media_WindowMediaBase.call(this,ac,com_tilbuci_data_Global.ln.get("window-mdhtml-title"),"html",mode);
};
$hxClasses["com.tilbuci.ui.window.media.WindowMediaHtml"] = com_tilbuci_ui_window_media_WindowMediaHtml;
com_tilbuci_ui_window_media_WindowMediaHtml.__name__ = "com.tilbuci.ui.window.media.WindowMediaHtml";
com_tilbuci_ui_window_media_WindowMediaHtml.__super__ = com_tilbuci_ui_window_media_WindowMediaBase;
com_tilbuci_ui_window_media_WindowMediaHtml.prototype = $extend(com_tilbuci_ui_window_media_WindowMediaBase.prototype,{
	startInterface: function(evt) {
		com_tilbuci_ui_window_media_WindowMediaBase.prototype.startInterface.call(this);
	}
	,kill: function() {
		com_tilbuci_ui_window_media_WindowMediaBase.prototype.kill.call(this);
	}
	,__class__: com_tilbuci_ui_window_media_WindowMediaHtml
});
var com_tilbuci_ui_window_media_WindowMediaParagraph = function(ac,mode) {
	com_tilbuci_ui_window_media_WindowMediaBase.call(this,ac,com_tilbuci_data_Global.ln.get("window-mdparagraph-title"),"paragraph",mode);
};
$hxClasses["com.tilbuci.ui.window.media.WindowMediaParagraph"] = com_tilbuci_ui_window_media_WindowMediaParagraph;
com_tilbuci_ui_window_media_WindowMediaParagraph.__name__ = "com.tilbuci.ui.window.media.WindowMediaParagraph";
com_tilbuci_ui_window_media_WindowMediaParagraph.__super__ = com_tilbuci_ui_window_media_WindowMediaBase;
com_tilbuci_ui_window_media_WindowMediaParagraph.prototype = $extend(com_tilbuci_ui_window_media_WindowMediaBase.prototype,{
	startInterface: function(evt) {
		com_tilbuci_ui_window_media_WindowMediaBase.prototype.startInterface.call(this);
		this.ui.createHContainer("addtocol");
		this.ui.createButton("addcolast",com_tilbuci_data_Global.ln.get("window-media-addcolast"),$bind(this,this.onAddAsset),this.ui.hcontainers.h["addtocol"]);
		this.ui.createButton("addtocol",com_tilbuci_data_Global.ln.get("window-media-addtocol"),$bind(this,this.onAddToCol),this.ui.hcontainers.h["addtocol"]);
		this.ui.createSelect("addtocol",[],null,this.ui.hcontainers.h["addtocol"]);
		this.ui.createToggle("close",true,this.ui.hcontainers.h["addtocol"]);
		this.ui.createLabel("close",com_tilbuci_data_Global.ln.get("window-media-closeafter"),"",this.ui.hcontainers.h["addtocol"]);
		var tmp = com_tilbuci_data_Global.ln.get("window-mdparagraph-title");
		var tmp1 = this.ui;
		var tmp2 = { tp : "Label", id : "about", tx : com_tilbuci_data_Global.ln.get("window-mdparagraph-about"), vr : ""};
		var tmp3 = com_tilbuci_data_Global.ln.get("window-mdparagraph-set");
		this.addForm(tmp,tmp1.forge("leftcol",[tmp2,{ tp : "TArea", id : "text", tx : "", vr : "", en : true},{ tp : "Button", id : "btadd", tx : tmp3, ac : $bind(this,this.onOpen)},{ tp : "Custom", cont : this.ui.hcontainers.h["addtocol"]}]));
		this.ui.tareas.h["text"].set_height(530);
	}
	,acStart: function() {
		this._path = "";
		this.ui.tareas.h["text"].set_text("");
		this.ui.hcontainers.h["addtocol"].setWidth(960,[260,260,260,40,100]);
		var list = [];
		var h = com_tilbuci_data_GlobalPlayer.movie.collections.h;
		var k_h = h;
		var k_keys = Object.keys(h);
		var k_length = k_keys.length;
		var k_current = 0;
		while(k_current < k_length) {
			var k = k_keys[k_current++];
			list.push({ text : com_tilbuci_data_GlobalPlayer.movie.collections.h[k].name, value : k});
		}
		this.ui.setSelectOptions("addtocol",list);
		if(list.length > 0) {
			this.ui.hcontainers.h["addtocol"].set_visible(true);
			this.ui.tareas.h["text"].set_height(500);
		} else {
			this.ui.hcontainers.h["addtocol"].set_visible(false);
			this.ui.tareas.h["text"].set_height(530);
		}
	}
	,kill: function() {
		com_tilbuci_ui_window_media_WindowMediaBase.prototype.kill.call(this);
	}
	,onOpen: function(evt) {
		if(this.ui.tareas.h["text"].get_text() != "") {
			if(this._mode == "asset") {
				this._mode = "simple";
				var tmp = this._ac;
				var _g = new haxe_ds_StringMap();
				_g.h["path"] = "";
				_g.h["type"] = this._type;
				var value = this.ui.tareas.h["text"].get_text();
				_g.h["file"] = value;
				_g.h["frames"] = Std.string(this._frames);
				_g.h["frtime"] = Std.string(this._frtime);
				_g.h["num"] = this._filenum;
				tmp("addasset",_g);
				feathers_core_PopUpManager.removePopUp(this);
			} else if(this._mode == "assetsingle") {
				this._mode = "simple";
				var tmp = this._ac;
				var _g = new haxe_ds_StringMap();
				_g.h["path"] = "";
				_g.h["type"] = this._type;
				var value = this.ui.tareas.h["text"].get_text();
				_g.h["file"] = value;
				_g.h["frames"] = Std.string(this._frames);
				_g.h["frtime"] = Std.string(this._frtime);
				_g.h["num"] = this._filenum;
				tmp("assetsingle",_g);
				feathers_core_PopUpManager.removePopUp(this);
			} else if(this._mode == "newasset") {
				this._mode = "simple";
				var tmp = this._ac;
				var _g = new haxe_ds_StringMap();
				_g.h["path"] = "";
				_g.h["type"] = this._type;
				var value = this.ui.tareas.h["text"].get_text();
				_g.h["file"] = value;
				_g.h["frames"] = Std.string(this._frames);
				_g.h["frtime"] = Std.string(this._frtime);
				tmp("addnewasset",_g);
				feathers_core_PopUpManager.removePopUp(this);
			} else {
				var tmp = this._ac;
				var _g = new haxe_ds_StringMap();
				_g.h["path"] = "";
				_g.h["type"] = this._type;
				var value = this.ui.tareas.h["text"].get_text();
				_g.h["file"] = value;
				_g.h["frames"] = Std.string(this._frames);
				_g.h["frtime"] = Std.string(this._frtime);
				tmp("addstage",_g);
				feathers_core_PopUpManager.removePopUp(this);
			}
		}
	}
	,onAddToCol: function(evt) {
		if(this.ui.tareas.h["text"].get_text() != "" && this.ui.selects.h["addtocol"].get_selectedItem() != null) {
			var tmp = this._ac;
			var _g = new haxe_ds_StringMap();
			_g.h["stage"] = "true";
			var value = this.ui.selects.h["addtocol"].get_selectedItem().value;
			_g.h["col"] = value;
			_g.h["path"] = "";
			_g.h["type"] = this._type;
			var value = this.ui.tareas.h["text"].get_text();
			_g.h["file"] = value;
			_g.h["frames"] = Std.string(this._frames);
			_g.h["frtime"] = Std.string(this._frtime);
			tmp("addtocol",_g);
			if(this.ui.toggles.h["close"].get_selected()) {
				feathers_core_PopUpManager.removePopUp(this);
			} else {
				this.ui.tareas.h["text"].set_text("");
				com_tilbuci_data_Global.showMsg(com_tilbuci_data_Global.ln.get("window-media-addedstage"));
			}
		}
	}
	,onAddAsset: function(evt) {
		if(this.ui.tareas.h["text"].get_text() != "" && this.ui.selects.h["addtocol"].get_selectedItem() != null) {
			var tmp = this._ac;
			var _g = new haxe_ds_StringMap();
			_g.h["stage"] = "false";
			var value = this.ui.selects.h["addtocol"].get_selectedItem().value;
			_g.h["col"] = value;
			_g.h["path"] = "";
			_g.h["type"] = this._type;
			var value = this.ui.tareas.h["text"].get_text();
			_g.h["file"] = value;
			_g.h["frames"] = Std.string(this._frames);
			_g.h["frtime"] = Std.string(this._frtime);
			tmp("addtocol",_g);
			if(this.ui.toggles.h["close"].get_selected()) {
				feathers_core_PopUpManager.removePopUp(this);
			} else {
				this.ui.tareas.h["text"].set_text("");
				com_tilbuci_data_Global.showMsg(com_tilbuci_data_Global.ln.get("window-media-addedcol"));
			}
		}
	}
	,action: function(ac,data) {
		com_tilbuci_ui_window_media_WindowMediaBase.prototype.action.call(this,ac,data);
		this.ui.tareas.h["text"].set_text(data.h["current"]);
		if(data.h["mode"] == "asset" || data.h["mode"] == "assetsingle" || data.h["mode"] == "newasset" || data.h["mode"] == "single") {
			this.ui.tareas.h["text"].set_height(530);
			this.ui.hcontainers.h["addtocol"].set_visible(false);
		} else if(this.ui.selects.h["addtocol"].get_dataProvider().get_length() > 0) {
			this.ui.hcontainers.h["addtocol"].set_visible(true);
			this.ui.tareas.h["text"].set_height(500);
		} else {
			this.ui.hcontainers.h["addtocol"].set_visible(false);
			this.ui.tareas.h["text"].set_height(530);
		}
	}
	,__class__: com_tilbuci_ui_window_media_WindowMediaParagraph
});
var com_tilbuci_ui_window_media_WindowMediaPicture = function(ac,mode) {
	com_tilbuci_ui_window_media_WindowMediaBase.call(this,ac,com_tilbuci_data_Global.ln.get("window-mdpicture-title"),"picture",mode);
};
$hxClasses["com.tilbuci.ui.window.media.WindowMediaPicture"] = com_tilbuci_ui_window_media_WindowMediaPicture;
com_tilbuci_ui_window_media_WindowMediaPicture.__name__ = "com.tilbuci.ui.window.media.WindowMediaPicture";
com_tilbuci_ui_window_media_WindowMediaPicture.__super__ = com_tilbuci_ui_window_media_WindowMediaBase;
com_tilbuci_ui_window_media_WindowMediaPicture.prototype = $extend(com_tilbuci_ui_window_media_WindowMediaBase.prototype,{
	startInterface: function(evt) {
		com_tilbuci_ui_window_media_WindowMediaBase.prototype.startInterface.call(this);
	}
	,kill: function() {
		com_tilbuci_ui_window_media_WindowMediaBase.prototype.kill.call(this);
	}
	,__class__: com_tilbuci_ui_window_media_WindowMediaPicture
});
var com_tilbuci_ui_window_media_WindowMediaShape = function(ac,mode) {
	com_tilbuci_ui_window_media_WindowMediaBase.call(this,ac,com_tilbuci_data_Global.ln.get("window-mdshape-title"),"shape",mode);
};
$hxClasses["com.tilbuci.ui.window.media.WindowMediaShape"] = com_tilbuci_ui_window_media_WindowMediaShape;
com_tilbuci_ui_window_media_WindowMediaShape.__name__ = "com.tilbuci.ui.window.media.WindowMediaShape";
com_tilbuci_ui_window_media_WindowMediaShape.__super__ = com_tilbuci_ui_window_media_WindowMediaBase;
com_tilbuci_ui_window_media_WindowMediaShape.prototype = $extend(com_tilbuci_ui_window_media_WindowMediaBase.prototype,{
	_shape: null
	,_desc: null
	,startInterface: function(evt) {
		com_tilbuci_ui_window_media_WindowMediaBase.prototype.startInterface.call(this);
		this.ui.createHContainer("addtocol");
		this.ui.createButton("addcolast",com_tilbuci_data_Global.ln.get("window-media-addcolast"),$bind(this,this.onAddAsset),this.ui.hcontainers.h["addtocol"]);
		this.ui.createButton("addtocol",com_tilbuci_data_Global.ln.get("window-media-addtocol"),$bind(this,this.onAddToCol),this.ui.hcontainers.h["addtocol"]);
		this.ui.createSelect("addtocol",[],null,this.ui.hcontainers.h["addtocol"]);
		this.ui.createToggle("close",true,this.ui.hcontainers.h["addtocol"]);
		this.ui.createLabel("close",com_tilbuci_data_Global.ln.get("window-media-closeafter"),"",this.ui.hcontainers.h["addtocol"]);
		this._shape = new com_tilbuci_display_ShapeImage($bind(this,this.onShape));
		var tmp = com_tilbuci_data_Global.ln.get("window-mdshape-title");
		var tmp1 = this.ui;
		var tmp2 = this.ui;
		var tmp3 = { tp : "Label", id : "shape", tx : com_tilbuci_data_Global.ln.get("window-mdshape-shape"), vr : ""};
		var tmp4 = { tp : "Select", id : "shape", vl : [{ text : com_tilbuci_data_Global.ln.get("window-mdshape-circle"), value : "circle"},{ text : com_tilbuci_data_Global.ln.get("window-mdshape-triangle"), value : "triangle"},{ text : com_tilbuci_data_Global.ln.get("window-mdshape-isoscelestriangle"), value : "isoscelestriangle"},{ text : com_tilbuci_data_Global.ln.get("window-mdshape-righttriangle"), value : "righttriangle"},{ text : com_tilbuci_data_Global.ln.get("window-mdshape-square"), value : "square"},{ text : com_tilbuci_data_Global.ln.get("window-mdshape-pentagon"), value : "pentagon"},{ text : com_tilbuci_data_Global.ln.get("window-mdshape-hexagon"), value : "hexagon"},{ text : com_tilbuci_data_Global.ln.get("window-mdshape-heptagon"), value : "heptagon"},{ text : com_tilbuci_data_Global.ln.get("window-mdshape-octagon"), value : "octagon"},{ text : com_tilbuci_data_Global.ln.get("window-mdshape-eneagon"), value : "eneagon"},{ text : com_tilbuci_data_Global.ln.get("window-mdshape-decagon"), value : "decagon"}], sl : "circle"};
		var tmp5 = { tp : "Label", id : "color", tx : com_tilbuci_data_Global.ln.get("window-mdshape-color"), vr : ""};
		var tmp6 = { tp : "Label", id : "alpha", tx : com_tilbuci_data_Global.ln.get("window-mdshape-alpha"), vr : ""};
		var tmp7 = { tp : "Label", id : "border", tx : com_tilbuci_data_Global.ln.get("window-mdshape-border"), vr : ""};
		var tmp8 = { tp : "Label", id : "bdcolor", tx : com_tilbuci_data_Global.ln.get("window-mdshape-bdcolor"), vr : ""};
		var tmp9 = { tp : "Label", id : "bdalpha", tx : com_tilbuci_data_Global.ln.get("window-mdshape-bdalpha"), vr : ""};
		var tmp10 = { tp : "Label", id : "rotation", tx : com_tilbuci_data_Global.ln.get("window-mdshape-rotation"), vr : ""};
		var tmp11 = com_tilbuci_data_Global.ln.get("window-mdshape-show");
		var tmp12 = tmp2.forge("leftcol",[tmp3,tmp4,tmp5,{ tp : "TInput", id : "color", tx : "#000000", vr : ""},tmp6,{ tp : "Numeric", id : "alpha", mn : 0, mx : 100, vl : 100, st : 1},tmp7,{ tp : "Numeric", id : "border", mn : 0, mx : 10, vl : 0, st : 1},tmp8,{ tp : "TInput", id : "bdcolor", tx : "#FFFFFF", vr : ""},tmp9,{ tp : "Numeric", id : "bdalpha", mn : 0, mx : 100, vl : 100, st : 1},tmp10,{ tp : "Numeric", id : "rotation", mn : 0, mx : 359, vl : 0, st : 1},{ tp : "Button", id : "show", tx : tmp11, ac : $bind(this,this.onShow)}]);
		var tmp2 = this.ui.forge("rightcol",[{ tp : "Custom", cont : this._shape}]);
		var tmp3 = this.ui;
		var tmp4 = com_tilbuci_data_Global.ln.get("window-mdshape-show");
		this.addForm(tmp,tmp1.createColumnHolder("columns",tmp12,tmp2,tmp3.forge("bottom",[{ tp : "Spacer", id : "btadd", ht : 10},{ tp : "Button", id : "btadd", tx : tmp4, ac : $bind(this,this.onOpen)},{ tp : "Custom", cont : this.ui.hcontainers.h["addtocol"]}]),510));
		this.ui.buttons.h["btadd"].set_visible(false);
	}
	,acStart: function() {
		this._path = "";
		this._mode = "simple";
		this._shape.set_visible(false);
		this._desc = null;
		this.ui.hcontainers.h["addtocol"].setWidth(960,[260,260,260,40,100]);
		var list = [];
		var h = com_tilbuci_data_GlobalPlayer.movie.collections.h;
		var k_h = h;
		var k_keys = Object.keys(h);
		var k_length = k_keys.length;
		var k_current = 0;
		while(k_current < k_length) {
			var k = k_keys[k_current++];
			list.push({ text : com_tilbuci_data_GlobalPlayer.movie.collections.h[k].name, value : k});
		}
		this.ui.setSelectOptions("addtocol",list);
		this.ui.hcontainers.h["addtocol"].set_visible(false);
		this.ui.buttons.h["btadd"].set_visible(false);
	}
	,kill: function() {
		com_tilbuci_ui_window_media_WindowMediaBase.prototype.kill.call(this);
	}
	,onShow: function(evt) {
		var shcolor = this.ui.inputs.h["color"].get_text();
		shcolor = StringTools.replace(shcolor,"#","0x");
		var shcolorint = Std.parseInt(shcolor);
		if(shcolorint == null) {
			shcolor = "0x000000";
		}
		var bdcolor = this.ui.inputs.h["bdcolor"].get_text();
		bdcolor = StringTools.replace(bdcolor,"#","0x");
		var bdcolorint = Std.parseInt(bdcolor);
		if(bdcolorint == null) {
			bdcolor = "0xFFFFFF";
		}
		this.ui.inputs.h["color"].set_text(StringTools.replace(shcolor,"0x","#"));
		this.ui.inputs.h["bdcolor"].set_text(StringTools.replace(bdcolor,"0x","#"));
		this._desc = { type : this.ui.selects.h["shape"].get_selectedItem().value, color : shcolor, alpha : this.ui.numerics.h["alpha"].get_value() / 100, border : Math.round(this.ui.numerics.h["border"].get_value()), bdcolor : bdcolor, bdalpha : this.ui.numerics.h["bdalpha"].get_value() / 100, rotation : Math.round(this.ui.numerics.h["rotation"].get_value())};
		this._shape.set_visible(false);
		this._shape.load(com_tilbuci_statictools_StringStatic.jsonStringify(this._desc));
	}
	,onShape: function(ok) {
		if(ok) {
			this._shape.set_width(this._shape.oWidth - 50);
			this._shape.set_height(this._shape.oHeight - 50);
			this._shape.set_x((500 - this._shape.get_width()) / 2);
			this._shape.set_y((500 - this._shape.get_height()) / 2);
			this._shape.set_visible(true);
			this.ui.hcontainers.h["addtocol"].set_visible(false);
			if(this._mode == "asset") {
				this.ui.buttons.h["btadd"].set_text(com_tilbuci_data_Global.ln.get("window-media-addshape"));
			} else if(this._mode == "assetsingle") {
				this.ui.buttons.h["btadd"].set_text(com_tilbuci_data_Global.ln.get("window-media-addshape"));
			} else if(this._mode == "newasset") {
				this.ui.buttons.h["btadd"].set_text(com_tilbuci_data_Global.ln.get("window-media-addast"));
			} else {
				this.ui.buttons.h["btadd"].set_text(com_tilbuci_data_Global.ln.get("window-media-addstage"));
				if(this.ui.selects.h["addtocol"].get_dataProvider().get_length() > 0) {
					this.ui.hcontainers.h["addtocol"].set_visible(true);
				}
			}
			this.ui.buttons.h["btadd"].set_visible(true);
		} else {
			this._desc = null;
			this.ui.buttons.h["btadd"].set_visible(false);
			this.ui.hcontainers.h["addtocol"].set_visible(false);
		}
	}
	,onOpen: function(evt) {
		if(this._desc != null) {
			var strdesc = com_tilbuci_statictools_StringStatic.jsonStringify(this._desc);
			if(this._mode == "asset") {
				this._mode = "simple";
				var tmp = this._ac;
				var _g = new haxe_ds_StringMap();
				_g.h["path"] = "";
				_g.h["type"] = this._type;
				_g.h["file"] = strdesc;
				_g.h["frames"] = Std.string(this._frames);
				_g.h["frtime"] = Std.string(this._frtime);
				_g.h["num"] = this._filenum;
				tmp("addasset",_g);
				feathers_core_PopUpManager.removePopUp(this);
			} else if(this._mode == "assetsingle") {
				this._mode = "simple";
				var tmp = this._ac;
				var _g = new haxe_ds_StringMap();
				_g.h["path"] = "";
				_g.h["type"] = this._type;
				_g.h["file"] = strdesc;
				_g.h["frames"] = Std.string(this._frames);
				_g.h["frtime"] = Std.string(this._frtime);
				_g.h["num"] = this._filenum;
				tmp("assetsingle",_g);
				feathers_core_PopUpManager.removePopUp(this);
			} else if(this._mode == "newasset") {
				this._mode = "simple";
				var tmp = this._ac;
				var _g = new haxe_ds_StringMap();
				_g.h["path"] = "";
				_g.h["type"] = this._type;
				_g.h["file"] = strdesc;
				_g.h["frames"] = Std.string(this._frames);
				_g.h["frtime"] = Std.string(this._frtime);
				tmp("addnewasset",_g);
				feathers_core_PopUpManager.removePopUp(this);
			} else {
				var tmp = this._ac;
				var _g = new haxe_ds_StringMap();
				_g.h["path"] = "";
				_g.h["type"] = this._type;
				_g.h["file"] = strdesc;
				_g.h["frames"] = Std.string(this._frames);
				_g.h["frtime"] = Std.string(this._frtime);
				tmp("addstage",_g);
				feathers_core_PopUpManager.removePopUp(this);
			}
		}
	}
	,onAddToCol: function(evt) {
		if(this._desc != null && this.ui.selects.h["addtocol"].get_selectedItem() != null) {
			var strdesc = com_tilbuci_statictools_StringStatic.jsonStringify(this._desc);
			var tmp = this._ac;
			var _g = new haxe_ds_StringMap();
			_g.h["stage"] = "true";
			var value = this.ui.selects.h["addtocol"].get_selectedItem().value;
			_g.h["col"] = value;
			_g.h["path"] = "";
			_g.h["type"] = this._type;
			_g.h["file"] = strdesc;
			_g.h["frames"] = Std.string(this._frames);
			_g.h["frtime"] = Std.string(this._frtime);
			tmp("addtocol",_g);
			if(this.ui.toggles.h["close"].get_selected()) {
				feathers_core_PopUpManager.removePopUp(this);
			} else {
				this._shape.set_visible(false);
				this._desc = null;
				this.ui.buttons.h["btadd"].set_visible(false);
				this.ui.hcontainers.h["addtocol"].set_visible(false);
				com_tilbuci_data_Global.showMsg(com_tilbuci_data_Global.ln.get("window-media-addedstage"));
			}
		}
	}
	,onAddAsset: function(evt) {
		if(this._desc != null && this.ui.selects.h["addtocol"].get_selectedItem() != null) {
			var strdesc = com_tilbuci_statictools_StringStatic.jsonStringify(this._desc);
			var tmp = this._ac;
			var _g = new haxe_ds_StringMap();
			_g.h["stage"] = "false";
			var value = this.ui.selects.h["addtocol"].get_selectedItem().value;
			_g.h["col"] = value;
			_g.h["path"] = "";
			_g.h["type"] = this._type;
			_g.h["file"] = strdesc;
			_g.h["frames"] = Std.string(this._frames);
			_g.h["frtime"] = Std.string(this._frtime);
			tmp("addtocol",_g);
			if(this.ui.toggles.h["close"].get_selected()) {
				feathers_core_PopUpManager.removePopUp(this);
			} else {
				this._shape.set_visible(false);
				this._desc = null;
				this.ui.buttons.h["btadd"].set_visible(false);
				this.ui.hcontainers.h["addtocol"].set_visible(false);
				com_tilbuci_data_Global.showMsg(com_tilbuci_data_Global.ln.get("window-media-addedcol"));
			}
		}
	}
	,action: function(ac,data) {
		com_tilbuci_ui_window_media_WindowMediaBase.prototype.action.call(this,ac,data);
		this._shape.set_visible(false);
		this._desc = com_tilbuci_statictools_StringStatic.jsonParse(data.h["current"]);
		if(!(this._desc == null || this._desc.color == null)) {
			this.ui.inputs.h["color"].set_text(StringTools.replace(this._desc.color,"0x","#"));
			this.ui.numerics.h["alpha"].set_value(Math.round(100 * this._desc.alpha));
			this.ui.numerics.h["border"].set_value(this._desc.border);
			this.ui.inputs.h["bdcolor"].set_text(StringTools.replace(this._desc.bdcolor,"0x","#"));
			this.ui.numerics.h["bdalpha"].set_value(Math.round(100 * this._desc.bdalpha));
			this.ui.numerics.h["rotation"].set_value(this._desc.rotation);
			this._shape.load(data.h["current"]);
			this.ui.setSelectValue("shape",this._desc.type);
		}
	}
	,__class__: com_tilbuci_ui_window_media_WindowMediaShape
});
var com_tilbuci_ui_window_media_WindowMediaSpritemap = function(ac,mode) {
	com_tilbuci_ui_window_media_WindowMediaBase.call(this,ac,com_tilbuci_data_Global.ln.get("window-mdspritemap-title"),"spritemap",mode);
};
$hxClasses["com.tilbuci.ui.window.media.WindowMediaSpritemap"] = com_tilbuci_ui_window_media_WindowMediaSpritemap;
com_tilbuci_ui_window_media_WindowMediaSpritemap.__name__ = "com.tilbuci.ui.window.media.WindowMediaSpritemap";
com_tilbuci_ui_window_media_WindowMediaSpritemap.__super__ = com_tilbuci_ui_window_media_WindowMediaBase;
com_tilbuci_ui_window_media_WindowMediaSpritemap.prototype = $extend(com_tilbuci_ui_window_media_WindowMediaBase.prototype,{
	_smapset: null
	,startInterface: function(evt) {
		com_tilbuci_ui_window_media_WindowMediaBase.prototype.startInterface.call(this);
		this._smapset = this.ui.createHContainer("spritemapset");
		this._smapset.addChild(this.ui.forge("smapleft",[{ tp : "Label", id : "frames", tx : com_tilbuci_data_Global.ln.get("window-mdspritemap-frames"), vr : feathers_controls_Label.VARIANT_DETAIL},{ tp : "Numeric", id : "frames", vl : this._frames, mn : 1, mx : 100, st : 1, ch : $bind(this,this.onSmapChange)}],-1,200,0));
		this._smapset.addChild(this.ui.forge("smapright",[{ tp : "Label", id : "frtime", tx : com_tilbuci_data_Global.ln.get("window-mdspritemap-frtime"), vr : feathers_controls_Label.VARIANT_DETAIL},{ tp : "Numeric", id : "frtime2", vl : this._frtime, mn : 50, mx : 5000, st : 50, ch : $bind(this,this.onSmapChange)}],-1,260,0));
		this.ui.containers.h["rightcol"].addChild(this._smapset);
	}
	,kill: function() {
		com_tilbuci_ui_window_media_WindowMediaBase.prototype.kill.call(this);
	}
	,onSmapChange: function(evt) {
		if(this.ui.numerics.h["frames"].get_value() > 0 && this.ui.numerics.h["frames"].get_value() <= 100) {
			this._frames = Math.round(this.ui.numerics.h["frames"].get_value());
		}
		if(this.ui.numerics.h["frtime2"].get_value() >= 50 && this.ui.numerics.h["frtime2"].get_value() <= 5000) {
			this._frtime = Math.round(this.ui.numerics.h["frtime2"].get_value());
		}
		this._preview.setSpritemap(this._frames,this._frtime);
	}
	,__class__: com_tilbuci_ui_window_media_WindowMediaSpritemap
});
var com_tilbuci_ui_window_media_WindowMediaStrings = function(ac) {
	com_tilbuci_ui_window_PopupWindow.call(this,ac,com_tilbuci_data_Global.ln.get("window-mdstrings-title"),1000,com_tilbuci_ui_base_InterfaceFactory.pickValue(535,565),false,true,true);
	this._type = "strings";
};
$hxClasses["com.tilbuci.ui.window.media.WindowMediaStrings"] = com_tilbuci_ui_window_media_WindowMediaStrings;
com_tilbuci_ui_window_media_WindowMediaStrings.__name__ = "com.tilbuci.ui.window.media.WindowMediaStrings";
com_tilbuci_ui_window_media_WindowMediaStrings.__super__ = com_tilbuci_ui_window_PopupWindow;
com_tilbuci_ui_window_media_WindowMediaStrings.prototype = $extend(com_tilbuci_ui_window_PopupWindow.prototype,{
	_type: null
	,_path: null
	,startInterface: function(evt) {
		var tmp = this.ui;
		var tmp1 = { tp : "Button", id : "btremove", tx : com_tilbuci_data_Global.ln.get("window-media-removefile"), ac : $bind(this,this.onRemove)};
		var tmp2 = { tp : "Button", id : "btdownload", tx : com_tilbuci_data_Global.ln.get("window-media-download"), ac : $bind(this,this.onDownload)};
		var tmp3 = com_tilbuci_data_Global.ln.get("window-media-upload");
		this.addForm("files",tmp.forge("strings",[{ tp : "List", id : "fileslist", vl : [], ht : 380, sl : null},tmp1,tmp2,{ tp : "Button", id : "btupload", tx : tmp3, ac : $bind(this,this.onUpload)}]));
		this.ui.listChange("fileslist",$bind(this,this.onChange));
		com_tilbuci_ui_window_PopupWindow.prototype.startInterface.call(this);
	}
	,acStart: function() {
		this._path = "";
		this.loadPath();
	}
	,loadPath: function() {
		this.ui.setListValues("fileslist",[]);
		this.ui.buttons.h["btremove"].set_enabled(false);
		this.ui.buttons.h["btremove"].set_visible(false);
		this.ui.buttons.h["btdownload"].set_enabled(false);
		this.ui.buttons.h["btdownload"].set_visible(false);
		var tmp = com_tilbuci_data_Global.ws;
		var _g = new haxe_ds_StringMap();
		var value = com_tilbuci_data_GlobalPlayer.movie.get_mvId();
		_g.h["movie"] = value;
		_g.h["type"] = this._type;
		_g.h["path"] = this._path;
		tmp.send("Media/List",_g,$bind(this,this.onList));
	}
	,onList: function(ok,ld) {
		if(!ok) {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-media-title"),com_tilbuci_data_Global.ln.get("window-media-nolist"),300,180,this.stage);
			feathers_core_PopUpManager.removePopUp(this);
		} else if(ld.map.h["e"] == 0) {
			var its = [];
			var _g = 0;
			var _g1 = Reflect.fields(ld.map.h["list"]);
			while(_g < _g1.length) {
				var it = _g1[_g];
				++_g;
				its.push({ text : Reflect.field(Reflect.field(ld.map.h["list"],it),"n"), value : Reflect.field(Reflect.field(ld.map.h["list"],it),"n"), type : "f", asset : ""});
			}
			this.ui.setListValues("fileslist",its);
		} else {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-media-title"),com_tilbuci_data_Global.ln.get("window-media-nolist"),300,180,this.stage);
			feathers_core_PopUpManager.removePopUp(this);
		}
	}
	,onChange: function(evt) {
		if(this.ui.lists.h["fileslist"].get_selectedItem() != null) {
			this.ui.buttons.h["btremove"].set_enabled(true);
			this.ui.buttons.h["btremove"].set_visible(true);
			this.ui.buttons.h["btdownload"].set_enabled(true);
			this.ui.buttons.h["btdownload"].set_visible(true);
		}
	}
	,onDownload: function(evt) {
		if(this.ui.lists.h["fileslist"].get_selectedItem() != null) {
			var tmp = com_tilbuci_data_Global.ws;
			var _g = new haxe_ds_StringMap();
			_g.h["file"] = "strings";
			var value = this.ui.lists.h["fileslist"].get_selectedItem().text;
			_g.h["media"] = value;
			var value = com_tilbuci_data_GlobalPlayer.movie.get_mvId();
			_g.h["movie"] = value;
			tmp.download(_g);
		}
	}
	,onRemove: function(evt) {
		this.ui.createConfirm(com_tilbuci_data_Global.ln.get("window-media-title"),com_tilbuci_data_Global.ln.get("window-media-removewarn"),400,220,$bind(this,this.onRealRemove),com_tilbuci_data_Global.ln.get("default-ok"),com_tilbuci_data_Global.ln.get("default-cancel"),this.stage);
	}
	,onRealRemove: function(ok) {
		if(ok) {
			var tmp = com_tilbuci_data_Global.ws;
			var _g = new haxe_ds_StringMap();
			var value = com_tilbuci_data_GlobalPlayer.movie.get_mvId();
			_g.h["movie"] = value;
			_g.h["type"] = this._type;
			_g.h["path"] = this._path;
			var value = this.ui.lists.h["fileslist"].get_selectedItem().text;
			_g.h["name"] = value;
			tmp.send("Media/DeleteFile",_g,$bind(this,this.onRemoveFile));
		}
	}
	,onRemoveFile: function(ok,ld) {
		if(!ok) {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-media-title"),com_tilbuci_data_Global.ln.get("window-media-removefileer"),300,180,this.stage);
		} else if(ld.map.h["e"] == 0) {
			this.loadPath();
		} else {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-media-title"),com_tilbuci_data_Global.ln.get("window-media-removefileer"),300,180,this.stage);
		}
	}
	,onUpload: function(evt) {
		com_tilbuci_data_Global.up.browseForMedia($bind(this,this.onFileSelcted),this._type);
	}
	,onFileSelcted: function(ok) {
		if(ok) {
			var tmp = com_tilbuci_data_Global.up;
			var _g = new haxe_ds_StringMap();
			var value = com_tilbuci_data_GlobalPlayer.movie.get_mvId();
			_g.h["movie"] = value;
			_g.h["type"] = this._type;
			_g.h["path"] = this._path;
			tmp.uploadMedia($bind(this,this.onUploadReturn),_g);
		}
	}
	,onUploadReturn: function(ok,data) {
		if(ok) {
			this.loadPath();
		} else {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-media-title"),com_tilbuci_data_Global.ln.get("window-media-uploader"),300,180,this.stage);
		}
	}
	,__class__: com_tilbuci_ui_window_media_WindowMediaStrings
});
var com_tilbuci_ui_window_media_WindowMediaText = function(ac,mode) {
	com_tilbuci_ui_window_media_WindowMediaBase.call(this,ac,com_tilbuci_data_Global.ln.get("window-mdtext-title"),"text",mode);
};
$hxClasses["com.tilbuci.ui.window.media.WindowMediaText"] = com_tilbuci_ui_window_media_WindowMediaText;
com_tilbuci_ui_window_media_WindowMediaText.__name__ = "com.tilbuci.ui.window.media.WindowMediaText";
com_tilbuci_ui_window_media_WindowMediaText.__super__ = com_tilbuci_ui_window_media_WindowMediaBase;
com_tilbuci_ui_window_media_WindowMediaText.prototype = $extend(com_tilbuci_ui_window_media_WindowMediaBase.prototype,{
	startInterface: function(evt) {
		com_tilbuci_ui_window_media_WindowMediaBase.prototype.startInterface.call(this);
		var tmp = com_tilbuci_data_Global.ln.get("window-mdtext-title");
		var tmp1 = this.ui;
		var tmp2 = { tp : "Label", id : "about", tx : com_tilbuci_data_Global.ln.get("window-mdtext-about"), vr : ""};
		var tmp3 = com_tilbuci_data_Global.ln.get("window-mdtext-set");
		this.addForm(tmp,tmp1.forge("leftcol",[tmp2,{ tp : "TArea", id : "text", tx : "", vr : "", en : true},{ tp : "Button", id : "btadd", tx : tmp3, ac : $bind(this,this.onOpen)}]));
		this.ui.tareas.h["text"].set_height(550);
	}
	,acStart: function() {
		this._path = "";
		this.ui.tareas.h["text"].set_text("");
		this.ui.tareas.h["text"].set_height(550);
	}
	,kill: function() {
		com_tilbuci_ui_window_media_WindowMediaBase.prototype.kill.call(this);
	}
	,onOpen: function(evt) {
		if(this.ui.tareas.h["text"].get_text() != "") {
			if(this._mode == "asset") {
				this._mode = "simple";
				var tmp = this._ac;
				var _g = new haxe_ds_StringMap();
				_g.h["path"] = "";
				_g.h["type"] = this._type;
				var value = this.ui.tareas.h["text"].get_text();
				_g.h["file"] = value;
				_g.h["frames"] = Std.string(this._frames);
				_g.h["frtime"] = Std.string(this._frtime);
				_g.h["num"] = this._filenum;
				tmp("addasset",_g);
				feathers_core_PopUpManager.removePopUp(this);
			} else if(this._mode == "newasset") {
				this._mode = "simple";
				var tmp = this._ac;
				var _g = new haxe_ds_StringMap();
				_g.h["path"] = "";
				_g.h["type"] = this._type;
				var value = this.ui.tareas.h["text"].get_text();
				_g.h["file"] = value;
				_g.h["frames"] = Std.string(this._frames);
				_g.h["frtime"] = Std.string(this._frtime);
				tmp("addnewasset",_g);
				feathers_core_PopUpManager.removePopUp(this);
			} else {
				var tmp = this._ac;
				var _g = new haxe_ds_StringMap();
				_g.h["path"] = "";
				_g.h["type"] = this._type;
				var value = this.ui.tareas.h["text"].get_text();
				_g.h["file"] = value;
				_g.h["frames"] = Std.string(this._frames);
				_g.h["frtime"] = Std.string(this._frtime);
				tmp("addstage",_g);
				feathers_core_PopUpManager.removePopUp(this);
			}
		}
	}
	,action: function(ac,data) {
		com_tilbuci_ui_window_media_WindowMediaBase.prototype.action.call(this,ac,data);
		this.ui.tareas.h["text"].set_text(data.h["current"]);
	}
	,__class__: com_tilbuci_ui_window_media_WindowMediaText
});
var com_tilbuci_ui_window_media_WindowMediaVideo = function(ac,mode) {
	com_tilbuci_ui_window_media_WindowMediaBase.call(this,ac,com_tilbuci_data_Global.ln.get("window-mdvideo-title"),"video",mode);
};
$hxClasses["com.tilbuci.ui.window.media.WindowMediaVideo"] = com_tilbuci_ui_window_media_WindowMediaVideo;
com_tilbuci_ui_window_media_WindowMediaVideo.__name__ = "com.tilbuci.ui.window.media.WindowMediaVideo";
com_tilbuci_ui_window_media_WindowMediaVideo.__super__ = com_tilbuci_ui_window_media_WindowMediaBase;
com_tilbuci_ui_window_media_WindowMediaVideo.prototype = $extend(com_tilbuci_ui_window_media_WindowMediaBase.prototype,{
	startInterface: function(evt) {
		com_tilbuci_ui_window_media_WindowMediaBase.prototype.startInterface.call(this);
	}
	,kill: function() {
		com_tilbuci_ui_window_media_WindowMediaBase.prototype.kill.call(this);
	}
	,__class__: com_tilbuci_ui_window_media_WindowMediaVideo
});
var com_tilbuci_ui_window_media_WindowTimedAction = function(ac) {
	this._list = [];
	com_tilbuci_ui_window_PopupWindow.call(this,ac,com_tilbuci_data_Global.ln.get("window-timedac-title"),1300,com_tilbuci_ui_base_InterfaceFactory.pickValue(660,700),false,true,true);
};
$hxClasses["com.tilbuci.ui.window.media.WindowTimedAction"] = com_tilbuci_ui_window_media_WindowTimedAction;
com_tilbuci_ui_window_media_WindowTimedAction.__name__ = "com.tilbuci.ui.window.media.WindowTimedAction";
com_tilbuci_ui_window_media_WindowTimedAction.__super__ = com_tilbuci_ui_window_PopupWindow;
com_tilbuci_ui_window_media_WindowTimedAction.prototype = $extend(com_tilbuci_ui_window_PopupWindow.prototype,{
	_instance: null
	,_acarea: null
	,_list: null
	,startInterface: function(evt) {
		this._acarea = new com_tilbuci_ui_component_ActionArea(610,520);
		var tmp = this.ui;
		var tmp1 = this.ui;
		var tmp2 = { tp : "Label", id : "registered", tx : com_tilbuci_data_Global.ln.get("window-timedac-registered"), vr : ""};
		var tmp3 = { tp : "Button", id : "loadac", tx : com_tilbuci_data_Global.ln.get("window-timedac-loadac"), ac : $bind(this,this.onLoad)};
		var tmp4 = { tp : "Button", id : "clearac", tx : com_tilbuci_data_Global.ln.get("window-timedac-clearac"), ac : $bind(this,this.onClear)};
		var tmp5 = { tp : "Label", id : "newtime", tx : com_tilbuci_data_Global.ln.get("window-timedac-newtime"), vr : ""};
		var tmp6 = { tp : "Button", id : "newtime", tx : com_tilbuci_data_Global.ln.get("window-timedac-newtimebt"), ac : $bind(this,this.onNew)};
		var tmp7 = { tp : "Button", id : "onclose", tx : com_tilbuci_data_Global.ln.get("window-timedac-close"), ac : $bind(this,this.onClose)};
		var tmp8 = com_tilbuci_data_Global.ln.get("window-timedac-set");
		var tmp9 = tmp1.forge("left",[tmp2,{ tp : "List", id : "registered", vl : [], ht : 325, sl : null},tmp3,tmp4,{ tp : "Spacer", id : "newtime", ht : 10, ln : false},tmp5,{ tp : "Numeric", id : "newtime", mn : 1, mx : 10000, st : 1, vl : 1},tmp6,{ tp : "Spacer", id : "buttons", ht : 10, ln : false},tmp7,{ tp : "Button", id : "onsave", tx : tmp8, ac : $bind(this,this.onSave)}]);
		var tmp1 = this.ui;
		var tmp2 = { tp : "Label", id : "actions", tx : com_tilbuci_data_Global.ln.get("window-timedac-actions"), vr : ""};
		var tmp3 = { tp : "Custom", cont : this._acarea};
		var tmp4 = com_tilbuci_data_Global.ln.get("window-timedac-update");
		this.addForm("columns",tmp.createColumnHolder("columns",tmp9,tmp1.forge("right",[tmp2,tmp3,{ tp : "Spacer", id : "actions", ht : 6, ln : false},{ tp : "Button", id : "onupdate", tx : tmp4, ac : $bind(this,this.onUpdate)}])));
		this.ui.listDbClick("registered",$bind(this,this.onLoad));
		com_tilbuci_ui_window_PopupWindow.prototype.startInterface.call(this);
	}
	,acStart: function() {
		this._instance = null;
	}
	,action: function(ac,data) {
		this._instance = com_tilbuci_data_GlobalPlayer.area.pickInstance(data.h["instance"]);
		if(this._instance != null) {
			this._list = [];
			var this1 = com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[com_tilbuci_data_GlobalPlayer.area.get_currentKf()];
			var key = this._instance.getInstName();
			var timedAc = this1.h[key].timedAc;
			var h = timedAc.h;
			var k_h = h;
			var k_keys = Object.keys(h);
			var k_length = k_keys.length;
			var k_current = 0;
			while(k_current < k_length) {
				var k = k_keys[k_current++];
				if(timedAc.h[k] != "") {
					this._list.push({ text : k, value : { time : Std.parseInt(StringTools.replace(k,"s","")), action : timedAc.h[k]}});
				}
			}
			this.orderActions();
		} else {
			com_tilbuci_data_Global.showMsg(com_tilbuci_data_Global.ln.get("window-asset-noinstance"));
			feathers_core_PopUpManager.removePopUp(this);
		}
	}
	,onSave: function(evt) {
		var this1 = com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[com_tilbuci_data_GlobalPlayer.area.get_currentKf()];
		var key = this._instance.getInstName();
		var timedAc = this1.h[key].timedAc;
		var h = timedAc.h;
		var k_h = h;
		var k_keys = Object.keys(h);
		var k_length = k_keys.length;
		var k_current = 0;
		while(k_current < k_length) {
			var k = k_keys[k_current++];
			if(Object.prototype.hasOwnProperty.call(timedAc.h,k)) {
				delete(timedAc.h[k]);
			}
		}
		var _g = 0;
		var _g1 = this._list.length;
		while(_g < _g1) {
			var i = _g++;
			if(this._list[i].value.action != "") {
				var v = this._list[i].value.action;
				timedAc.h[Std.string(this._list[i].value.time) + "s"] = v;
			}
		}
		var this1 = com_tilbuci_data_GlobalPlayer.movie.scene.keyframes[com_tilbuci_data_GlobalPlayer.area.get_currentKf()];
		var key = this._instance.getInstName();
		this1.h[key].timedAc = timedAc;
		this._instance = null;
		feathers_core_PopUpManager.removePopUp(this);
	}
	,onClose: function(evt) {
		this._instance = null;
		feathers_core_PopUpManager.removePopUp(this);
	}
	,onNew: function(evt) {
		if(this.ui.numerics.h["newtime"].get_value() > 0) {
			var time = Math.round(this.ui.numerics.h["newtime"].get_value());
			var found = -1;
			var _g = 0;
			var _g1 = this._list.length;
			while(_g < _g1) {
				var i = _g++;
				if(this._list[i].value.time == time) {
					found = i;
				}
			}
			if(found >= 0) {
				this.ui.lists.h["registered"].set_selectedIndex(found);
				this.ui.lists.h["registered"].get_dataProvider().updateAt(this.ui.lists.h["registered"].get_selectedIndex());
				this.onLoad();
			} else {
				this._list.push({ text : time + "s", value : { time : time, action : ""}});
				this.orderActions(time);
			}
		}
	}
	,orderActions: function(current) {
		if(current == null) {
			current = 0;
		}
		this._acarea.setText("");
		this.ui.setListSelectValue("registered",null);
		this.ui.setListValues("registered",[]);
		haxe_ds_ArraySort.sort(this._list,function(a,b) {
			if(a.value.time < b.value.time) {
				return -1;
			} else if(a.value.time > b.value.time) {
				return 1;
			} else {
				return 0;
			}
		});
		this.ui.setListValues("registered",this._list);
		if(current > 0) {
			var found = -1;
			var _g = 0;
			var _g1 = this._list.length;
			while(_g < _g1) {
				var i = _g++;
				if(this._list[i].value.time == current) {
					found = i;
				}
			}
			if(found >= 0) {
				this.ui.lists.h["registered"].set_selectedIndex(found);
				this.ui.lists.h["registered"].get_dataProvider().updateAt(this.ui.lists.h["registered"].get_selectedIndex());
				this.onLoad();
			}
		}
	}
	,onLoad: function(evt) {
		if(this.ui.lists.h["registered"].get_selectedItem() != null) {
			this._acarea.setText(this.ui.lists.h["registered"].get_selectedItem().value.action);
		}
	}
	,onClear: function(evt) {
		if(this.ui.lists.h["registered"].get_selectedItem() != null) {
			var time = this.ui.lists.h["registered"].get_selectedItem().value.time;
			var newlist = [];
			var _g = 0;
			var _g1 = this._list.length;
			while(_g < _g1) {
				var i = _g++;
				if(this._list[i].value.time != time) {
					newlist.push(this._list[i]);
				}
			}
			this._list = newlist;
			this.orderActions();
		}
	}
	,onUpdate: function(evt) {
		if(this.ui.lists.h["registered"].get_selectedItem() != null) {
			var time = this.ui.lists.h["registered"].get_selectedItem().value.time;
			var _g = 0;
			var _g1 = this._list.length;
			while(_g < _g1) {
				var i = _g++;
				if(this._list[i].value.time == time) {
					this._list[i].value.action = this._acarea.getText();
				}
			}
			this.orderActions();
		}
	}
	,__class__: com_tilbuci_ui_window_media_WindowTimedAction
});
var com_tilbuci_ui_window_movie_WindowMovieNew = function(ac) {
	com_tilbuci_ui_window_PopupWindow.call(this,ac,com_tilbuci_data_Global.ln.get("window-movienew-title"),800,com_tilbuci_ui_base_InterfaceFactory.pickValue(430,475),false);
};
$hxClasses["com.tilbuci.ui.window.movie.WindowMovieNew"] = com_tilbuci_ui_window_movie_WindowMovieNew;
com_tilbuci_ui_window_movie_WindowMovieNew.__name__ = "com.tilbuci.ui.window.movie.WindowMovieNew";
com_tilbuci_ui_window_movie_WindowMovieNew.__super__ = com_tilbuci_ui_window_PopupWindow;
com_tilbuci_ui_window_movie_WindowMovieNew.prototype = $extend(com_tilbuci_ui_window_PopupWindow.prototype,{
	startInterface: function(evt) {
		var tmp = com_tilbuci_data_Global.ln.get("window-movienew-title");
		var tmp1 = this.ui;
		var tmp2 = this.ui;
		var tmp3 = { tp : "Label", id : "moviename", tx : com_tilbuci_data_Global.ln.get("window-movienew-name"), vr : feathers_controls_Label.VARIANT_DETAIL};
		var tmp4 = { tp : "Label", id : "movieid", tx : com_tilbuci_data_Global.ln.get("window-movienew-id"), vr : feathers_controls_Label.VARIANT_DETAIL};
		var tmp5 = { tp : "Label", id : "movieauthor", tx : com_tilbuci_data_Global.ln.get("window-movienew-author"), vr : feathers_controls_Label.VARIANT_DETAIL};
		var tmp6 = { tp : "Label", id : "moviecopyright", tx : com_tilbuci_data_Global.ln.get("window-movienew-copyright"), vr : feathers_controls_Label.VARIANT_DETAIL};
		var tmp7 = { tp : "Label", id : "moviecopyleft", tx : com_tilbuci_data_Global.ln.get("window-movienew-copyleft"), vr : feathers_controls_Label.VARIANT_DETAIL};
		var tmp8 = com_tilbuci_data_Global.ln.get("window-movienew-about");
		var tmp9 = tmp2.forge("leftcol",[tmp3,{ tp : "TInput", id : "moviename", tx : "", vr : ""},tmp4,{ tp : "TInput", id : "movieid", tx : "", vr : ""},tmp5,{ tp : "TInput", id : "movieauthor", tx : "", vr : ""},tmp6,{ tp : "TInput", id : "moviecopyright", tx : "", vr : ""},tmp7,{ tp : "TInput", id : "moviecopyleft", tx : "", vr : ""},{ tp : "Label", id : "movieabout", tx : tmp8, vr : feathers_controls_Label.VARIANT_DETAIL},{ tp : "TArea", id : "movieabout", tx : "", vr : "", en : true}]);
		var tmp2 = this.ui;
		var tmp3 = { tp : "Label", id : "moviesizebig", tx : com_tilbuci_data_Global.ln.get("window-movienew-sizebig"), vr : feathers_controls_Label.VARIANT_DETAIL};
		var tmp4 = { tp : "Label", id : "moviesizesmall", tx : com_tilbuci_data_Global.ln.get("window-movienew-sizesmall"), vr : feathers_controls_Label.VARIANT_DETAIL};
		var tmp5 = { tp : "Label", id : "moviesizetype", tx : com_tilbuci_data_Global.ln.get("window-movienew-sizetype"), vr : feathers_controls_Label.VARIANT_DETAIL};
		var tmp6 = { tp : "Select", id : "moviesizetype", vl : [{ text : com_tilbuci_data_Global.ln.get("window-movienew-sizeboth"), value : "both"},{ text : com_tilbuci_data_Global.ln.get("window-movienew-sizeportrait"), value : "portrait"},{ text : com_tilbuci_data_Global.ln.get("window-movienew-sizelandscape"), value : "landscape"},{ text : com_tilbuci_data_Global.ln.get("window-movienew-sizesquare"), value : "square"}], sl : "both"};
		var tmp7 = { tp : "Label", id : "movietime", tx : com_tilbuci_data_Global.ln.get("window-movienew-timeframe"), vr : feathers_controls_Label.VARIANT_DETAIL};
		var tmp8 = { tp : "Select", id : "movietime", vl : [{ text : com_tilbuci_data_Global.ln.get("window-movienew-time025"), value : "0.25"},{ text : com_tilbuci_data_Global.ln.get("window-movienew-time050"), value : "0.50"},{ text : com_tilbuci_data_Global.ln.get("window-movienew-time100"), value : "1.00"},{ text : com_tilbuci_data_Global.ln.get("window-movienew-time150"), value : "1.50"},{ text : com_tilbuci_data_Global.ln.get("window-movienew-time200"), value : "2.00"},{ text : com_tilbuci_data_Global.ln.get("window-movienew-time250"), value : "2.50"},{ text : com_tilbuci_data_Global.ln.get("window-movienew-time300"), value : "3.00"},{ text : com_tilbuci_data_Global.ln.get("window-movienew-time350"), value : "3.50"},{ text : com_tilbuci_data_Global.ln.get("window-movienew-time400"), value : "4.00"},{ text : com_tilbuci_data_Global.ln.get("window-movienew-time450"), value : "4.50"},{ text : com_tilbuci_data_Global.ln.get("window-movienew-time500"), value : "5.00"}], sl : "1.00"};
		var tmp10 = com_tilbuci_data_Global.ln.get("window-movienew-create");
		this.addForm(tmp,tmp1.createColumnHolder("columns",tmp9,tmp2.forge("rightcol",[tmp3,{ tp : "Numeric", id : "moviesizebig", mn : 100, mx : 3840, st : 50, vl : 1920},tmp4,{ tp : "Numeric", id : "moviesizesmall", mn : 100, mx : 3840, st : 50, vl : 1080},tmp5,tmp6,tmp7,tmp8,{ tp : "Spacer", id : "font-spacer", ht : 120, ln : false},{ tp : "Button", id : "moviecreate", tx : tmp10, ac : $bind(this,this.onCreateMovie)}])));
		com_tilbuci_ui_window_PopupWindow.prototype.startInterface.call(this);
	}
	,kill: function() {
		com_tilbuci_ui_window_PopupWindow.prototype.kill.call(this);
	}
	,onCreateMovie: function(evt) {
		if(this.ui.inputs.h["moviename"].get_text() == "" || this.ui.inputs.h["movieauthor"].get_text() == "") {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-movienew-title"),com_tilbuci_data_Global.ln.get("window-movienew-norequired"),300,180,this.stage);
		} else {
			if(this.ui.numerics.h["moviesizebig"].get_value() < 100) {
				this.ui.numerics.h["moviesizebig"].set_value(100);
			}
			if(this.ui.numerics.h["moviesizesmall"].get_value() < 100) {
				this.ui.numerics.h["moviesizesmall"].set_value(100);
			}
			if(this.ui.numerics.h["moviesizebig"].get_value() > 3840) {
				this.ui.numerics.h["moviesizebig"].set_value(3840);
			}
			if(this.ui.numerics.h["moviesizesmall"].get_value() > 3840) {
				this.ui.numerics.h["moviesizesmall"].set_value(3840);
			}
			var tmp = com_tilbuci_data_Global.ws;
			var _g = new haxe_ds_StringMap();
			var value = this.ui.inputs.h["moviename"].get_text();
			_g.h["title"] = value;
			var value = this.ui.inputs.h["movieid"].get_text();
			_g.h["id"] = value;
			var value = this.ui.inputs.h["movieauthor"].get_text();
			_g.h["author"] = value;
			var value = this.ui.inputs.h["moviecopyright"].get_text();
			_g.h["copyright"] = value;
			var value = this.ui.inputs.h["moviecopyleft"].get_text();
			_g.h["copyleft"] = value;
			var value = this.ui.tareas.h["movieabout"].get_text();
			_g.h["about"] = value;
			var value = this.ui.numerics.h["moviesizebig"].get_value();
			_g.h["sizebig"] = value;
			var value = this.ui.numerics.h["moviesizesmall"].get_value();
			_g.h["sizesmall"] = value;
			var value = this.ui.selects.h["moviesizetype"].get_selectedItem().value;
			_g.h["moviesizetype"] = value;
			var value = this.ui.selects.h["movietime"].get_selectedItem().value;
			_g.h["interval"] = value;
			tmp.send("Movie/New",_g,$bind(this,this.onCreateMovieReturn));
		}
	}
	,onCreateMovieReturn: function(ok,ld) {
		if(!ok) {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-movienew-title"),com_tilbuci_data_Global.ln.get("window-movienew-createer"),300,180,this.stage);
		} else if(ld.map.h["e"] != 0) {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-movienew-title"),com_tilbuci_data_Global.ln.get("window-movienew-createer"),300,180,this.stage);
		} else {
			com_tilbuci_data_GlobalPlayer.area.imgSelect();
			feathers_core_PopUpManager.removePopUp(this);
			var tmp = this._ac;
			var _g = new haxe_ds_StringMap();
			_g.h["id"] = ld.map.h["id"];
			tmp("movieload",_g);
		}
	}
	,__class__: com_tilbuci_ui_window_movie_WindowMovieNew
});
var com_tilbuci_ui_window_movie_WindowMovieOpen = function(ac) {
	com_tilbuci_ui_window_PopupWindow.call(this,ac,com_tilbuci_data_Global.ln.get("window-movieopen-title"),800,com_tilbuci_ui_base_InterfaceFactory.pickValue(415,435),false);
};
$hxClasses["com.tilbuci.ui.window.movie.WindowMovieOpen"] = com_tilbuci_ui_window_movie_WindowMovieOpen;
com_tilbuci_ui_window_movie_WindowMovieOpen.__name__ = "com.tilbuci.ui.window.movie.WindowMovieOpen";
com_tilbuci_ui_window_movie_WindowMovieOpen.__super__ = com_tilbuci_ui_window_PopupWindow;
com_tilbuci_ui_window_movie_WindowMovieOpen.prototype = $extend(com_tilbuci_ui_window_PopupWindow.prototype,{
	startInterface: function(evt) {
		var tmp = com_tilbuci_data_Global.ln.get("window-movieopen-title");
		var tmp1 = this.ui;
		var tmp2 = { tp : "Label", id : "openabout", tx : com_tilbuci_data_Global.ln.get("window-movieopen-wait")};
		var tmp3 = { tp : "Label", id : "openowner", tx : com_tilbuci_data_Global.ln.get("window-movieopen-owner"), vr : feathers_controls_Label.VARIANT_DETAIL};
		var tmp4 = com_tilbuci_data_Global.ln.get("window-movieopen-button");
		this.addForm(tmp,tmp1.forge("window",[tmp2,{ tp : "List", id : "openlist", vl : [], ht : 275, sl : null},tmp3,{ tp : "Button", id : "okbutton", tx : tmp4, ac : $bind(this,this.onOpen)}]));
		com_tilbuci_ui_window_PopupWindow.prototype.startInterface.call(this);
		this.ui.listDbClick("openlist",$bind(this,this.onOpen));
	}
	,kill: function() {
		com_tilbuci_ui_window_PopupWindow.prototype.kill.call(this);
	}
	,acStart: function() {
		this.loadMovies();
	}
	,loadMovies: function() {
		this.ui.labels.h["openabout"].set_text(com_tilbuci_data_Global.ln.get("window-movieopen-wait"));
		this.ui.setListValues("openlist",[]);
		com_tilbuci_data_Global.ws.send("Movie/List",new haxe_ds_StringMap(),$bind(this,this.onList));
	}
	,onList: function(ok,ld) {
		if(!ok) {
			this.ui.labels.h["openabout"].set_text(com_tilbuci_data_Global.ln.get("window-movieopen-error"));
		} else if(ld.map.h["e"] == 0) {
			var ar = ld.map.h["list"];
			if(ar.length == 0) {
				this.ui.labels.h["openabout"].set_text(com_tilbuci_data_Global.ln.get("window-movieopen-nomovies"));
			} else {
				var items = [];
				var _g = 0;
				while(_g < ar.length) {
					var i = ar[_g];
					++_g;
					items.push({ text : Reflect.field(i,"title"), value : Reflect.field(i,"id")});
				}
				this.ui.setListValues("openlist",items);
				this.ui.labels.h["openabout"].set_text(com_tilbuci_data_Global.ln.get("window-movieopen-about"));
			}
		} else {
			this.ui.labels.h["openabout"].set_text(com_tilbuci_data_Global.ln.get("window-movieopen-error"));
		}
	}
	,onOpen: function(evt) {
		if(this.ui.lists.h["openlist"].get_selectedItem() != null) {
			var tmp = this._ac;
			var _g = new haxe_ds_StringMap();
			var value = this.ui.lists.h["openlist"].get_selectedItem().value;
			_g.h["id"] = value;
			tmp("movieload",_g);
			com_tilbuci_data_GlobalPlayer.area.imgSelect();
			feathers_core_PopUpManager.removePopUp(this);
		}
	}
	,__class__: com_tilbuci_ui_window_movie_WindowMovieOpen
});
var com_tilbuci_ui_window_movie_WindowMoviePlugins = function(ac) {
	com_tilbuci_ui_window_PopupWindow.call(this,ac,com_tilbuci_data_Global.ln.get("window-movieplugin-title"),1000,720,true,true,true);
};
$hxClasses["com.tilbuci.ui.window.movie.WindowMoviePlugins"] = com_tilbuci_ui_window_movie_WindowMoviePlugins;
com_tilbuci_ui_window_movie_WindowMoviePlugins.__name__ = "com.tilbuci.ui.window.movie.WindowMoviePlugins";
com_tilbuci_ui_window_movie_WindowMoviePlugins.__super__ = com_tilbuci_ui_window_PopupWindow;
com_tilbuci_ui_window_movie_WindowMoviePlugins.prototype = $extend(com_tilbuci_ui_window_PopupWindow.prototype,{
	startInterface: function(evt) {
		var h = com_tilbuci_data_Global.plugins.h;
		var pl_h = h;
		var pl_keys = Object.keys(h);
		var pl_length = pl_keys.length;
		var pl_current = 0;
		while(pl_current < pl_length) {
			var pl = pl_h[pl_keys[pl_current++]];
		}
		com_tilbuci_ui_window_PopupWindow.prototype.startInterface.call(this);
	}
	,kill: function() {
		com_tilbuci_ui_window_PopupWindow.prototype.kill.call(this);
	}
	,acStart: function() {
	}
	,onSave: function(evt) {
		var conf = "{}";
		var this1 = com_tilbuci_data_Global.plugins;
		var this2 = openfl_utils_Object.__get(evt.target,"btid");
		if(Object.prototype.hasOwnProperty.call(this1.h,this2 == null ? null : Std.string(this2))) {
			var this1 = com_tilbuci_data_Global.plugins;
			var this2 = openfl_utils_Object.__get(evt.target,"btid");
			conf = com_tilbuci_statictools_StringStatic.jsonStringify(this1.h[this2 == null ? null : Std.string(this2)].getConfig());
		}
		var tmp = com_tilbuci_data_Global.ws;
		var _g = new haxe_ds_StringMap();
		var value = com_tilbuci_data_GlobalPlayer.movie.get_mvId();
		_g.h["id"] = value;
		var value = openfl_utils_Object.__get(evt.target,"btid");
		_g.h["plugin"] = value;
		var this1 = this.ui.toggles;
		var a = openfl_utils_Object.__get(evt.target,"btid");
		var key;
		if(typeof(a) == "string" || typeof("enabled") == "string") {
			var key1;
			if(a == null) {
				key1 = "null";
			} else {
				var this2 = a;
				key1 = this2 == null ? null : Std.string(this2);
			}
			key = key1 + "enabled";
		} else {
			var floatA = a;
			var floatB = "enabled";
			key = floatA + floatB;
		}
		var value = this1.h[key].get_selected();
		_g.h["active"] = value;
		_g.h["conf"] = conf;
		tmp.send("Movie/Plugin",_g,$bind(this,this.onSaveReturn));
	}
	,onSaveReturn: function(ok,ld) {
		if(!ok) {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-movieplugin-title"),com_tilbuci_data_Global.ln.get("window-movieplugin-saveerror"),300,180,this.stage);
		} else if(ld.map.h["e"] != 0) {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-movieplugin-title"),com_tilbuci_data_Global.ln.get("window-movieplugin-saveerror"),300,180,this.stage);
		} else {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-movieplugin-title"),com_tilbuci_data_Global.ln.get("window-movieplugin-saveok"),300,180,this.stage);
		}
	}
	,__class__: com_tilbuci_ui_window_movie_WindowMoviePlugins
});
var com_tilbuci_ui_window_movie_WindowMovieProperties = function(ac) {
	this._thColors = ["themeColor","offsetThemeColor","headerFillColor","headerFontSize","headerFontName","headerTextColor","rootFillColor","fontSize","fontName","textColor","insetFillColor","disabledTextColor","footerFillColor","controlFillColor1","controlFillColor2","scrollBarThumbFillColor"];
	com_tilbuci_ui_window_PopupWindow.call(this,ac,com_tilbuci_data_Global.ln.get("window-movieprop-title"),1200,com_tilbuci_ui_base_InterfaceFactory.pickValue(570,620),true,true,true);
};
$hxClasses["com.tilbuci.ui.window.movie.WindowMovieProperties"] = com_tilbuci_ui_window_movie_WindowMovieProperties;
com_tilbuci_ui_window_movie_WindowMovieProperties.__name__ = "com.tilbuci.ui.window.movie.WindowMovieProperties";
com_tilbuci_ui_window_movie_WindowMovieProperties.__super__ = com_tilbuci_ui_window_PopupWindow;
com_tilbuci_ui_window_movie_WindowMovieProperties.prototype = $extend(com_tilbuci_ui_window_PopupWindow.prototype,{
	_cssArea: null
	,_acstart: null
	,_acsnippet: null
	,_thColors: null
	,_favicon: null
	,_image: null
	,_loadingic: null
	,startInterface: function(evt) {
		this.ui.createHContainer("images");
		var favicon = new com_tilbuci_ui_base_InterfaceContainer("v",10,6710886);
		favicon.set_width(245);
		favicon.set_height(210);
		this.ui.createLabel("favicon",com_tilbuci_data_Global.ln.get("window-movieprop-favicon"),feathers_controls_Label.VARIANT_DETAIL,favicon);
		this.ui.createButton("favicon",com_tilbuci_data_Global.ln.get("window-movieprop-faviconset"),$bind(this,this.onFavicon),favicon);
		this.ui.createButton("faviconc",com_tilbuci_data_Global.ln.get("window-movieprop-faviconclear"),$bind(this,this.onFaviconClear),favicon);
		this._favicon = new com_tilbuci_display_PictureImage($bind(this,this.onFaviconLoaded));
		this._favicon.set_width(this._favicon.set_height(32));
		favicon.addChild(this._favicon);
		var image = new com_tilbuci_ui_base_InterfaceContainer("v",10,6710886);
		image.set_width(245);
		image.set_height(210);
		this.ui.createLabel("image",com_tilbuci_data_Global.ln.get("window-movieprop-image"),feathers_controls_Label.VARIANT_DETAIL,image);
		this.ui.createButton("image",com_tilbuci_data_Global.ln.get("window-movieprop-imageset"),$bind(this,this.onImage),image);
		this.ui.createButton("imagec",com_tilbuci_data_Global.ln.get("window-movieprop-imageclear"),$bind(this,this.onImageClear),image);
		this._image = new com_tilbuci_display_PictureImage($bind(this,this.onImageLoaded));
		this._image.set_width(this._image.set_height(32));
		image.addChild(this._image);
		this.ui.hcontainers.h["images"].addChild(favicon);
		this.ui.hcontainers.h["images"].addChild(image);
		this.ui.hcontainers.h["images"].set_width(500);
		var tmp = com_tilbuci_data_Global.ln.get("window-movieprop-about");
		var tmp1 = this.ui;
		var tmp2 = this.ui;
		var tmp3 = { tp : "Label", id : "moviename", tx : com_tilbuci_data_Global.ln.get("window-movienew-name"), vr : feathers_controls_Label.VARIANT_DETAIL};
		var tmp4 = { tp : "Label", id : "movieauthor", tx : com_tilbuci_data_Global.ln.get("window-movienew-author"), vr : feathers_controls_Label.VARIANT_DETAIL};
		var tmp5 = { tp : "Label", id : "moviecopyright", tx : com_tilbuci_data_Global.ln.get("window-movienew-copyright"), vr : feathers_controls_Label.VARIANT_DETAIL};
		var tmp6 = { tp : "Label", id : "moviecopyleft", tx : com_tilbuci_data_Global.ln.get("window-movienew-copyleft"), vr : feathers_controls_Label.VARIANT_DETAIL};
		var tmp7 = com_tilbuci_data_Global.ln.get("window-movieprop-tags");
		var tmp8 = tmp2.forge("leftabout",[tmp3,{ tp : "TInput", id : "moviename", tx : "", vr : ""},tmp4,{ tp : "TInput", id : "movieauthor", tx : "", vr : ""},tmp5,{ tp : "TInput", id : "moviecopyright", tx : "", vr : ""},tmp6,{ tp : "TInput", id : "moviecopyleft", tx : "", vr : ""},{ tp : "Label", id : "movietags", tx : tmp7, vr : feathers_controls_Label.VARIANT_DETAIL},{ tp : "TInput", id : "movietags", tx : "", vr : ""}]);
		var tmp2 = this.ui;
		var tmp3 = { tp : "Label", id : "movieindex", tx : com_tilbuci_data_Global.ln.get("window-movieprop-index"), vr : feathers_controls_Label.VARIANT_DETAIL};
		var tmp4 = com_tilbuci_data_Global.ln.get("window-movienew-about");
		this.addForm(tmp,tmp1.createColumnHolder("about",tmp8,tmp2.forge("rightabout",[tmp3,{ tp : "Select", id : "movieindex", vl : [], sl : ""},{ tp : "Label", id : "movieabout", tx : tmp4, vr : feathers_controls_Label.VARIANT_DETAIL},{ tp : "TArea", id : "movieabout", tx : "", vr : "", en : true, ht : 130},{ tp : "Custom", cont : this.ui.hcontainers.h["images"]}]),this.ui.forge("bottomabout",[{ tp : "Button", id : "saveabout", tx : com_tilbuci_data_Global.ln.get("window-movieprop-saveabout"), ac : $bind(this,this.onSaveAbout)}]),440));
		this.ui.createHContainer("imagesinteraction");
		var loadingic = new com_tilbuci_ui_base_InterfaceContainer("v",0,6710886);
		loadingic.set_width(395);
		loadingic.set_height(210);
		this.ui.createLabel("loadingic",com_tilbuci_data_Global.ln.get("window-movieprop-loading"),feathers_controls_Label.VARIANT_DETAIL,loadingic);
		this.ui.createButton("loadingic",com_tilbuci_data_Global.ln.get("window-movieprop-loadingset"),$bind(this,this.onLoadingIc),loadingic);
		this.ui.createButton("loadingicclear",com_tilbuci_data_Global.ln.get("window-movieprop-loadingclear"),$bind(this,this.onLoadingIcClear),loadingic);
		this._loadingic = new com_tilbuci_display_SpritemapImage($bind(this,this.onLoadingLoaded));
		this._loadingic.set_width(this._loadingic.set_height(32));
		loadingic.addChild(this._loadingic);
		this.ui.hcontainers.h["imagesinteraction"].addChild(loadingic);
		this.ui.hcontainers.h["imagesinteraction"].set_width(405);
		var tmp = com_tilbuci_data_Global.ln.get("window-movieprop-animation");
		var tmp1 = this.ui;
		var tmp2 = { tp : "Label", id : "movietime", tx : com_tilbuci_data_Global.ln.get("window-movienew-timeframe"), vr : feathers_controls_Label.VARIANT_DETAIL};
		var tmp3 = { tp : "Select", id : "movietime", vl : [{ text : com_tilbuci_data_Global.ln.get("window-movienew-time025"), value : "0.25"},{ text : com_tilbuci_data_Global.ln.get("window-movienew-time050"), value : "0.50"},{ text : com_tilbuci_data_Global.ln.get("window-movienew-time100"), value : "1.00"},{ text : com_tilbuci_data_Global.ln.get("window-movienew-time150"), value : "1.50"},{ text : com_tilbuci_data_Global.ln.get("window-movienew-time200"), value : "2.00"},{ text : com_tilbuci_data_Global.ln.get("window-movienew-time250"), value : "2.50"},{ text : com_tilbuci_data_Global.ln.get("window-movienew-time300"), value : "3.00"},{ text : com_tilbuci_data_Global.ln.get("window-movienew-time350"), value : "3.50"},{ text : com_tilbuci_data_Global.ln.get("window-movienew-time400"), value : "4.00"},{ text : com_tilbuci_data_Global.ln.get("window-movienew-time450"), value : "4.50"},{ text : com_tilbuci_data_Global.ln.get("window-movienew-time500"), value : "5.00"}], sl : "1.00"};
		var tmp4 = { tp : "Label", id : "movieorigin", tx : com_tilbuci_data_Global.ln.get("window-movieprop-origin"), vr : feathers_controls_Label.VARIANT_DETAIL};
		var tmp5 = { tp : "Select", id : "movieorigin", vl : [{ text : com_tilbuci_data_Global.ln.get("window-movieprop-ornone"), value : "none"},{ text : com_tilbuci_data_Global.ln.get("window-movieprop-oralpha"), value : "alpha"},{ text : com_tilbuci_data_Global.ln.get("window-movieprop-orcenter"), value : "center"},{ text : com_tilbuci_data_Global.ln.get("window-movieprop-ortop"), value : "top"},{ text : com_tilbuci_data_Global.ln.get("window-movieprop-ortopkeep"), value : "topkeep"},{ text : com_tilbuci_data_Global.ln.get("window-movieprop-orbottom"), value : "bottom"},{ text : com_tilbuci_data_Global.ln.get("window-movieprop-orbottomkeep"), value : "bottomkeep"},{ text : com_tilbuci_data_Global.ln.get("window-movieprop-orleft"), value : "left"},{ text : com_tilbuci_data_Global.ln.get("window-movieprop-orleftkeep"), value : "leftkeep"},{ text : com_tilbuci_data_Global.ln.get("window-movieprop-orright"), value : "right"},{ text : com_tilbuci_data_Global.ln.get("window-movieprop-orrightkeep"), value : "rightkeep"}], sl : "alpha"};
		var tmp6 = { tp : "Label", id : "movieanimation", tx : com_tilbuci_data_Global.ln.get("window-movieprop-interpolation"), vr : feathers_controls_Label.VARIANT_DETAIL};
		var tmp7 = { tp : "Label", id : "moviehighlight", tx : com_tilbuci_data_Global.ln.get("window-movieprop-highlight"), vr : feathers_controls_Label.VARIANT_DETAIL};
		var tmp8 = { tp : "Custom", id : "moveilodingbt", cont : this.ui.hcontainers.h["imagesinteraction"]};
		var tmp9 = com_tilbuci_data_Global.ln.get("window-movieprop-saveanim");
		this.addForm(tmp,tmp1.forge("anim",[tmp2,tmp3,tmp4,tmp5,tmp6,{ tp : "Select", id : "movieanimation", vl : [{ text : "Linear", value : "linear"},{ text : "Bounce.easeIn", value : "bounce.in"},{ text : "Bounce.easeOut", value : "bounce.out"},{ text : "Bounce.easeInOut", value : "bounce.inout"},{ text : "Cubic.easeIn", value : "cubic.in"},{ text : "Cubic.easeOut", value : "cubic.out"},{ text : "Cubic.easeInOut", value : "cubic.inout"},{ text : "Elastic.easeIn", value : "elastic.in"},{ text : "Elastic.easeOut", value : "elastic.out"},{ text : "Elastic.easeInOut", value : "elastic.inout"},{ text : "Expo.easeIn", value : "expo.in"},{ text : "Expo.easeOut", value : "expo.out"},{ text : "Expo.easeInOut", value : "expo.inout"},{ text : "Quad.easeIn", value : "quad.in"},{ text : "Quad.easeOut", value : "quad.out"},{ text : "Quad.easeInOut", value : "quad.inout"},{ text : "Quart.easeIn", value : "quart.in"},{ text : "Quart.easeOut", value : "quart.out"},{ text : "Quart.easeInOut", value : "quart.inout"},{ text : "Quint.easeIn", value : "quint.in"},{ text : "Quint.easeOut", value : "quint.out"},{ text : "Quint.easeInOut", value : "quint.inout"},{ text : "Sine.easeIn", value : "sine.in"},{ text : "Sine.easeOut", value : "sine.out"},{ text : "Sine.easeInOut", value : "sine.inout"}], sl : "linear"},tmp7,{ tp : "TInput", id : "moviehighlight", tx : "", vr : ""},tmp8,{ tp : "Spacer", id : "animspacer", ht : 20},{ tp : "Button", id : "saveanim", tx : tmp9, ac : $bind(this,this.onSaveAnim)}]));
		var tmp = com_tilbuci_data_Global.ln.get("window-movieprop-display");
		var tmp1 = this.ui;
		var tmp2 = { tp : "Label", id : "moviesizebig", tx : com_tilbuci_data_Global.ln.get("window-movienew-sizebig"), vr : feathers_controls_Label.VARIANT_DETAIL};
		var tmp3 = { tp : "Label", id : "moviesizesmall", tx : com_tilbuci_data_Global.ln.get("window-movienew-sizesmall"), vr : feathers_controls_Label.VARIANT_DETAIL};
		var tmp4 = { tp : "Label", id : "moviesizetype", tx : com_tilbuci_data_Global.ln.get("window-movienew-sizetype"), vr : feathers_controls_Label.VARIANT_DETAIL};
		var tmp5 = { tp : "Select", id : "moviesizetype", vl : [{ text : com_tilbuci_data_Global.ln.get("window-movienew-sizeboth"), value : "both"},{ text : com_tilbuci_data_Global.ln.get("window-movienew-sizeportrait"), value : "portrait"},{ text : com_tilbuci_data_Global.ln.get("window-movienew-sizelandscape"), value : "landscape"}], sl : "both"};
		var tmp6 = { tp : "Label", id : "moviecolor", tx : com_tilbuci_data_Global.ln.get("window-movieprop-bgcolor"), vr : feathers_controls_Label.VARIANT_DETAIL};
		var tmp7 = { tp : "Button", id : "savedisplay", tx : com_tilbuci_data_Global.ln.get("window-movieprop-savedisplay"), ac : $bind(this,this.onSaveDisplay)};
		var tmp8 = com_tilbuci_data_Global.ln.get("window-movieprop-savedisplayabout");
		this.addForm(tmp,tmp1.forge("display",[tmp2,{ tp : "Numeric", id : "moviesizebig", mn : 100, mx : 3840, st : 50, vl : 1920},tmp3,{ tp : "Numeric", id : "moviesizesmall", mn : 100, mx : 3840, st : 50, vl : 1080},tmp4,tmp5,tmp6,{ tp : "TInput", id : "moviecolor", tx : "", vr : ""},{ tp : "Spacer", id : "displayspacer", ht : 210},tmp7,{ tp : "Label", id : "savedisplay", tx : tmp8, vr : feathers_controls_Label.VARIANT_DETAIL}]));
		this.ui.labels.h["savedisplay"].set_wordWrap(true);
		var cssform = this.ui.createContainer("css");
		cssform.addChild(this.ui.createLabel("csslabel",com_tilbuci_data_Global.ln.get("window-movieprop-cssabout"),feathers_controls_Label.VARIANT_DETAIL));
		this._cssArea = new com_tilbuci_ui_component_CodeArea("css");
		cssform.addChild(this._cssArea);
		this._cssArea.set_width(1156);
		this._cssArea.set_height(400);
		cssform.addChild(this.ui.createSpacer("cssspacer",15));
		cssform.addChild(this.ui.createButton("savecss",com_tilbuci_data_Global.ln.get("window-movieprop-savecss"),$bind(this,this.onSaveCss)));
		this.addForm(com_tilbuci_data_Global.ln.get("window-movieprop-css"),cssform);
		var cont = new com_tilbuci_ui_base_HInterfaceContainer();
		cont.addChild(this.ui.createButton("fontmoviecopy",com_tilbuci_data_Global.ln.get("window-movieprop-fontcopymv"),$bind(this,this.onFontMovie),null,false));
		cont.addChild(this.ui.createButton("fontmovieremove",com_tilbuci_data_Global.ln.get("window-movieprop-fontdeletemv"),$bind(this,this.onFontMovie),null,false));
		cont.setWidth(560);
		var upfont = new com_tilbuci_ui_base_HInterfaceContainer();
		upfont.addChild(this.ui.createButton("fontadd",com_tilbuci_data_Global.ln.get("window-movieprop-fontselect"),$bind(this,this.onFontAdd),null,false));
		upfont.addChild(this.ui.createButton("fontupload",com_tilbuci_data_Global.ln.get("window-movieprop-fontupload"),$bind(this,this.onFontUpload),null,false));
		upfont.setWidth(560);
		var fnts = [];
		var _g = 0;
		var _g1 = com_tilbuci_data_Global.fonts.length;
		while(_g < _g1) {
			var n = _g++;
			fnts.push({ text : com_tilbuci_data_Global.fonts[n], value : com_tilbuci_data_Global.fonts[n]});
		}
		var arf = [];
		var _g = 0;
		var _g1 = com_tilbuci_data_GlobalPlayer.mdata.fonts;
		while(_g < _g1.length) {
			var i = _g1[_g];
			++_g;
			arf.push({ text : i.name, value : i.name});
		}
		var tmp = com_tilbuci_data_Global.ln.get("window-movieprop-fonts");
		var tmp1 = this.ui;
		var tmp2 = this.ui;
		var tmp3 = { tp : "Label", id : "fontssystem", tx : com_tilbuci_data_Global.ln.get("window-movieprop-systemfonts"), vr : feathers_controls_Label.VARIANT_DETAIL};
		var tmp4 = com_tilbuci_data_Global.ln.get("window-movieprop-fontcopy");
		var tmp5 = tmp2.forge("systemfonts",[tmp3,{ tp : "List", id : "fontssystemlist", vl : fnts, ht : 415, sl : ""},{ tp : "Button", id : "fontssystembt", tx : tmp4, ac : $bind(this,this.onFontSystem)}]);
		var tmp2 = this.ui;
		var tmp3 = { tp : "Label", id : "fontsmovie", tx : com_tilbuci_data_Global.ln.get("window-movieprop-moviefonts"), vr : feathers_controls_Label.VARIANT_DETAIL};
		var tmp4 = { tp : "Label", id : "fontfile", tx : com_tilbuci_data_Global.ln.get("window-setup-font-file"), vr : feathers_controls_Label.VARIANT_DETAIL};
		var tmp6 = com_tilbuci_data_Global.ln.get("window-setup-font-name");
		this.addForm(tmp,tmp1.createColumnHolder("fonts",tmp5,tmp2.forge("moviefonts",[tmp3,{ tp : "List", id : "fontsmovielist", vl : arf, ht : 252, sl : ""},{ tp : "Custom", cont : cont},{ tp : "Spacer", id : "fontspacer", ht : 20, ln : false},tmp4,{ tp : "TInput", id : "fontfile", tx : "", vr : ""},{ tp : "Label", id : "fontname", tx : tmp6, vr : feathers_controls_Label.VARIANT_DETAIL},{ tp : "TInput", id : "fontname", tx : "", vr : ""},{ tp : "Custom", cont : upfont}])));
		var snlist = new com_tilbuci_ui_base_HInterfaceContainer();
		snlist.addChild(this.ui.createButton("snippetsload",com_tilbuci_data_Global.ln.get("window-movieprop-snippetsload"),$bind(this,this.onSnLoad),null,false));
		snlist.addChild(this.ui.createButton("snippetsdel",com_tilbuci_data_Global.ln.get("window-movieprop-snippetsdel"),$bind(this,this.onSnDel),null,false));
		snlist.setWidth(560);
		this._acsnippet = new com_tilbuci_ui_component_ActionArea(560,314);
		var tmp = com_tilbuci_data_Global.ln.get("window-movieprop-snippets");
		var tmp1 = this.ui;
		var tmp2 = this.ui.forge("leftsnippets",[{ tp : "Label", id : "snippetslist", tx : com_tilbuci_data_Global.ln.get("window-movieprop-snippetslist"), vr : feathers_controls_Label.VARIANT_DETAIL},{ tp : "List", id : "snippetslist", vl : [], ht : 360, sl : ""},{ tp : "Custom", cont : snlist}]);
		var tmp3 = this.ui;
		var tmp4 = { tp : "Label", id : "snippetsname", tx : com_tilbuci_data_Global.ln.get("window-movieprop-snippetsname"), vr : feathers_controls_Label.VARIANT_DETAIL};
		var tmp5 = { tp : "Label", id : "snippetscode", tx : com_tilbuci_data_Global.ln.get("window-movieprop-snippetscode"), vr : feathers_controls_Label.VARIANT_DETAIL};
		var tmp6 = { tp : "Custom", cont : this._acsnippet};
		var tmp7 = com_tilbuci_data_Global.ln.get("window-movieprop-snippetsadd");
		this.addForm(tmp,tmp1.createColumnHolder("snippets",tmp2,tmp3.forge("rightsnippets",[tmp4,{ tp : "TInput", id : "snippetsname", tx : "", vr : ""},tmp5,tmp6,{ tp : "Button", id : "snippetsadd", tx : tmp7, ac : $bind(this,this.onSnAdd)}]),this.ui.forge("bottomsnippets",[{ tp : "Button", id : "snippetssave", tx : com_tilbuci_data_Global.ln.get("window-movieprop-snippetssave"), ac : $bind(this,this.onSaveSnippets)}]),440));
		this.ui.containers.h["bottomsnippets"].set_width(1200);
		this.snippetsList();
		var acstart = this.ui.createContainer("acstart");
		acstart.addChild(this.ui.createLabel("acstartlabel",com_tilbuci_data_Global.ln.get("window-movieprop-acstartabout"),feathers_controls_Label.VARIANT_DETAIL));
		this._acstart = new com_tilbuci_ui_component_ActionArea(1156,405);
		this._acstart.setText(com_tilbuci_data_GlobalPlayer.mdata.acstart);
		acstart.addChild(this._acstart);
		acstart.addChild(this.ui.createSpacer("acstartspacer",15));
		acstart.addChild(this.ui.createButton("saveacstart",com_tilbuci_data_Global.ln.get("window-movieprop-acstartbt"),$bind(this,this.onSaveAcstart)));
		this.addForm(com_tilbuci_data_Global.ln.get("window-movieprop-acstart"),acstart);
		var txlist = new com_tilbuci_ui_base_HInterfaceContainer();
		txlist.addChild(this.ui.createButton("textsload",com_tilbuci_data_Global.ln.get("window-movieprop-textsload"),$bind(this,this.onTxtLoad),null,false));
		txlist.addChild(this.ui.createButton("textsdel",com_tilbuci_data_Global.ln.get("window-movieprop-textsdel"),$bind(this,this.onTxtDel),null,false));
		txlist.setWidth(560);
		var tmp = com_tilbuci_data_Global.ln.get("window-movieprop-texts");
		var tmp1 = this.ui;
		var tmp2 = this.ui.forge("lefttexts",[{ tp : "Label", id : "textslist", tx : com_tilbuci_data_Global.ln.get("window-movieprop-textslist"), vr : feathers_controls_Label.VARIANT_DETAIL},{ tp : "List", id : "textslist", vl : [], ht : 360, sl : ""},{ tp : "Custom", cont : txlist}]);
		var tmp3 = this.ui;
		var tmp4 = { tp : "Label", id : "textsname", tx : com_tilbuci_data_Global.ln.get("window-movieprop-textsname"), vr : feathers_controls_Label.VARIANT_DETAIL};
		var tmp5 = { tp : "Label", id : "textsvalue", tx : com_tilbuci_data_Global.ln.get("window-movieprop-textsvalue"), vr : feathers_controls_Label.VARIANT_DETAIL};
		var tmp6 = { tp : "Button", id : "textsadd", tx : com_tilbuci_data_Global.ln.get("window-movieprop-textsadd"), ac : $bind(this,this.onTxtAdd)};
		var tmp7 = { tp : "Button", id : "stringssend", tx : com_tilbuci_data_Global.ln.get("window-movieprop-stringssend"), ac : $bind(this,this.onStrSend)};
		var tmp8 = com_tilbuci_data_Global.ln.get("window-movieprop-stringsget");
		this.addForm(tmp,tmp1.createColumnHolder("texts",tmp2,tmp3.forge("righttexts",[tmp4,{ tp : "TInput", id : "textsname", tx : "", vr : ""},tmp5,{ tp : "TArea", id : "textsvalue", tx : "", vr : "", en : true, ht : 250},tmp6,tmp7,{ tp : "Button", id : "stringsget", tx : tmp8, ac : $bind(this,this.onStrGet)}]),this.ui.forge("bottomtexts",[{ tp : "Button", id : "textsssave", tx : com_tilbuci_data_Global.ln.get("window-movieprop-textssave"), ac : $bind(this,this.onSaveTexts)}]),440));
		this.ui.containers.h["bottomtexts"].set_width(1200);
		this.textsList();
		var numlist = new com_tilbuci_ui_base_HInterfaceContainer();
		numlist.addChild(this.ui.createButton("numbersload",com_tilbuci_data_Global.ln.get("window-movieprop-numbersload"),$bind(this,this.onNumLoad),null,false));
		numlist.addChild(this.ui.createButton("numbersdel",com_tilbuci_data_Global.ln.get("window-movieprop-numbersdel"),$bind(this,this.onNumDel),null,false));
		numlist.setWidth(560);
		var tmp = com_tilbuci_data_Global.ln.get("window-movieprop-numbers");
		var tmp1 = this.ui;
		var tmp2 = this.ui.forge("leftnumbers",[{ tp : "Label", id : "numberslist", tx : com_tilbuci_data_Global.ln.get("window-movieprop-numberslist"), vr : feathers_controls_Label.VARIANT_DETAIL},{ tp : "List", id : "numberslist", vl : [], ht : 360, sl : ""},{ tp : "Custom", cont : numlist}]);
		var tmp3 = this.ui;
		var tmp4 = { tp : "Label", id : "numbersname", tx : com_tilbuci_data_Global.ln.get("window-movieprop-numbersname"), vr : feathers_controls_Label.VARIANT_DETAIL};
		var tmp5 = { tp : "Label", id : "numbersvalue", tx : com_tilbuci_data_Global.ln.get("window-movieprop-numbersvalue"), vr : feathers_controls_Label.VARIANT_DETAIL};
		var tmp6 = com_tilbuci_data_Global.ln.get("window-movieprop-numbersadd");
		this.addForm(tmp,tmp1.createColumnHolder("numbers",tmp2,tmp3.forge("rightnumbers",[tmp4,{ tp : "TInput", id : "numbersname", tx : "", vr : ""},tmp5,{ tp : "Numeric", id : "numbersvalue", mn : -1000000000, mx : 1000000000, st : 0.5, vl : 0},{ tp : "Spacer", id : "fontspacer", ht : 20, ln : false},{ tp : "Button", id : "numbersadd", tx : tmp6, ac : $bind(this,this.onNumAdd)}]),this.ui.forge("bottomnumbers",[{ tp : "Button", id : "numbersssave", tx : com_tilbuci_data_Global.ln.get("window-movieprop-numberssave"), ac : $bind(this,this.onSaveNumbers)}]),440));
		this.ui.containers.h["bottomnumbers"].set_width(1200);
		this.numbersList();
		var flaglist = new com_tilbuci_ui_base_HInterfaceContainer();
		flaglist.addChild(this.ui.createButton("flagsload",com_tilbuci_data_Global.ln.get("window-movieprop-flagsload"),$bind(this,this.onFlagLoad),null,false));
		flaglist.addChild(this.ui.createButton("flagsdel",com_tilbuci_data_Global.ln.get("window-movieprop-flagsdel"),$bind(this,this.onFlagDel),null,false));
		flaglist.setWidth(560);
		var tmp = com_tilbuci_data_Global.ln.get("window-movieprop-flags");
		var tmp1 = this.ui;
		var tmp2 = this.ui.forge("leftflags",[{ tp : "Label", id : "flagslist", tx : com_tilbuci_data_Global.ln.get("window-movieprop-flagslist"), vr : feathers_controls_Label.VARIANT_DETAIL},{ tp : "List", id : "flagslist", vl : [], ht : 360, sl : ""},{ tp : "Custom", cont : flaglist}]);
		var tmp3 = this.ui;
		var tmp4 = { tp : "Label", id : "flagsname", tx : com_tilbuci_data_Global.ln.get("window-movieprop-flagsname"), vr : feathers_controls_Label.VARIANT_DETAIL};
		var tmp5 = { tp : "Label", id : "flagsvalue", tx : com_tilbuci_data_Global.ln.get("window-movieprop-flagsvalue"), vr : feathers_controls_Label.VARIANT_DETAIL};
		var tmp6 = com_tilbuci_data_Global.ln.get("window-movieprop-flagsadd");
		this.addForm(tmp,tmp1.createColumnHolder("flags",tmp2,tmp3.forge("rightflags",[tmp4,{ tp : "TInput", id : "flagsname", tx : "", vr : ""},tmp5,{ tp : "Toggle", id : "flagsvalue", vl : false},{ tp : "Spacer", id : "flagspacer", ht : 20, ln : false},{ tp : "Button", id : "flagsadd", tx : tmp6, ac : $bind(this,this.onFlagAdd)}]),this.ui.forge("bottomflags",[{ tp : "Button", id : "flagsssave", tx : com_tilbuci_data_Global.ln.get("window-movieprop-flagssave"), ac : $bind(this,this.onSaveFlags)}]),440));
		this.ui.containers.h["bottomflags"].set_width(1200);
		this.flagsList();
		var thArea = new com_tilbuci_ui_base_InterfaceContainer("v",10,6710886);
		var _g = 0;
		var _g1 = this._thColors;
		while(_g < _g1.length) {
			var fn = _g1[_g];
			++_g;
			this.ui.createLabel(fn,com_tilbuci_data_Global.ln.get("window-movieprop-theme-" + fn),feathers_controls_Label.VARIANT_DETAIL,thArea);
			this.ui.createTInput(fn,"","",thArea);
		}
		thArea.set_width(1160);
		thArea.set_height(400);
		var tmp = com_tilbuci_data_Global.ln.get("window-movieprop-theme");
		var tmp1 = this.ui;
		var tmp2 = { tp : "Label", id : "themeabout", tx : com_tilbuci_data_Global.ln.get("window-movieprop-themeabout"), vr : ""};
		var tmp3 = com_tilbuci_data_Global.ln.get("window-movieprop-themesave");
		this.addForm(tmp,tmp1.forge("theme",[tmp2,{ tp : "Custom", cont : thArea},{ tp : "Spacer", id : "themespacer", ht : 10, ln : false},{ tp : "Button", id : "themesave", tx : tmp3, ac : $bind(this,this.onThemeSave)}]));
		this.ui.labels.h["themeabout"].set_wordWrap(true);
		var inOptions = [{ text : com_tilbuci_data_Global.ln.get("window-movieprop-input-opnothing"), value : "nothing"},{ text : com_tilbuci_data_Global.ln.get("window-movieprop-input-opup"), value : "up"},{ text : com_tilbuci_data_Global.ln.get("window-movieprop-input-opdown"), value : "down"},{ text : com_tilbuci_data_Global.ln.get("window-movieprop-input-opleft"), value : "left"},{ text : com_tilbuci_data_Global.ln.get("window-movieprop-input-opright"), value : "right"},{ text : com_tilbuci_data_Global.ln.get("window-movieprop-input-opnin"), value : "nin"},{ text : com_tilbuci_data_Global.ln.get("window-movieprop-input-opnout"), value : "nout"},{ text : com_tilbuci_data_Global.ln.get("window-movieprop-input-opsnippet"), value : ""},{ text : com_tilbuci_data_Global.ln.get("window-movieprop-input-opnextkf"), value : "nextkf"},{ text : com_tilbuci_data_Global.ln.get("window-movieprop-input-opprevkf"), value : "prevkf"},{ text : com_tilbuci_data_Global.ln.get("window-movieprop-input-opfirstkf"), value : "firstkf"},{ text : com_tilbuci_data_Global.ln.get("window-movieprop-input-oplastkf"), value : "lastkf"},{ text : com_tilbuci_data_Global.ln.get("window-movieprop-input-optarget"), value : "target"}];
		var inArea = new com_tilbuci_ui_base_InterfaceContainer("v",0,6710886);
		var h = com_tilbuci_data_GlobalPlayer.mdata.inputs.h;
		var k_h = h;
		var k_keys = Object.keys(h);
		var k_length = k_keys.length;
		var k_current = 0;
		while(k_current < k_length) {
			var k = k_keys[k_current++];
			this.ui.createLabel("input-" + k,com_tilbuci_data_Global.ln.get("window-movieprop-input-" + k),feathers_controls_Label.VARIANT_DETAIL,inArea);
			var inLine = new com_tilbuci_ui_base_HInterfaceContainer();
			this.ui.createSelect("input-" + k,inOptions,null,inLine,false);
			this.ui.createTInput("input-" + k,"","",inLine,false);
			inLine.setWidth(1140);
			inArea.addChild(inLine);
			this.ui.createSpacer("input-" + k,5,false,inArea);
		}
		inArea.set_width(1160);
		inArea.set_height(400);
		var tmp = com_tilbuci_data_Global.ln.get("window-movieprop-input");
		var tmp1 = this.ui;
		var tmp2 = { tp : "Label", id : "inputabout", tx : com_tilbuci_data_Global.ln.get("window-movieprop-inputabout"), vr : ""};
		var tmp3 = com_tilbuci_data_Global.ln.get("window-movieprop-inputsave");
		this.addForm(tmp,tmp1.forge("input",[tmp2,{ tp : "Custom", cont : inArea},{ tp : "Spacer", id : "inputspacer", ht : 10, ln : false},{ tp : "Button", id : "inputsave", tx : tmp3, ac : $bind(this,this.onInputSave)}]));
		this.ui.labels.h["inputabout"].set_wordWrap(true);
		var plArea = new com_tilbuci_ui_base_InterfaceContainer("v",10,6710886);
		var h = com_tilbuci_data_Global.plugins.h;
		var pl_h = h;
		var pl_keys = Object.keys(h);
		var pl_length = pl_keys.length;
		var pl_current = 0;
		while(pl_current < pl_length) {
			var pl = pl_h[pl_keys[pl_current++]];
			var active = false;
			var this1 = com_tilbuci_data_GlobalPlayer.mdata.plugins;
			var key = pl.get_plname();
			if(Object.prototype.hasOwnProperty.call(this1.h,key)) {
				var this2 = com_tilbuci_data_GlobalPlayer.mdata.plugins;
				var key1 = pl.get_plname();
				active = this2.h[key1].active;
			}
			this.ui.createLabel("pl-" + pl.get_plname(),pl.get_pltitle(),feathers_controls_Label.VARIANT_DETAIL,plArea);
			this.ui.createToggle("pl-" + pl.get_plname(),active,plArea);
		}
		plArea.set_width(1060);
		plArea.set_height(400);
		var tmp = com_tilbuci_data_Global.ln.get("window-movieprop-plugins");
		var tmp1 = this.ui;
		var tmp2 = { tp : "Label", id : "plugins", tx : com_tilbuci_data_Global.ln.get("window-movieprop-plavailable"), vr : ""};
		var tmp3 = com_tilbuci_data_Global.ln.get("window-movieprop-plbt");
		this.addForm(tmp,tmp1.forge("plugins",[tmp2,{ tp : "Custom", cont : plArea},{ tp : "Spacer", id : "plugins", ht : 10, ln : false},{ tp : "Button", id : "plugins", tx : tmp3, ac : $bind(this,this.onPluginSave)}]));
		var tmp = com_tilbuci_data_Global.ln.get("window-movieprop-access");
		var tmp1 = this.ui;
		var tmp2 = { tp : "Label", id : "moviekey", tx : com_tilbuci_data_Global.ln.get("window-movieprop-key"), vr : feathers_controls_Label.VARIANT_DETAIL};
		var tmp3 = { tp : "Label", id : "login", tx : com_tilbuci_data_Global.ln.get("window-movieprop-accesslogin"), vr : feathers_controls_Label.VARIANT_DETAIL};
		var tmp4 = { tp : "Select", id : "login", vl : [{ text : com_tilbuci_data_Global.ln.get("window-movieprop-accessno"), value : false},{ text : com_tilbuci_data_Global.ln.get("window-movieprop-accessyes"), value : true}], sl : null};
		var tmp5 = { tp : "Label", id : "encrypt", tx : com_tilbuci_data_Global.ln.get("window-movieprop-encrypted"), vr : feathers_controls_Label.VARIANT_DETAIL};
		var tmp6 = { tp : "Select", id : "encrypt", vl : [{ text : com_tilbuci_data_Global.ln.get("window-movieprop-accessno"), value : false},{ text : com_tilbuci_data_Global.ln.get("window-movieprop-accessyes"), value : true}], sl : null};
		var tmp7 = { tp : "Label", id : "group", tx : com_tilbuci_data_Global.ln.get("window-movieprop-accessgroup"), vr : feathers_controls_Label.VARIANT_DETAIL};
		var tmp8 = { tp : "Label", id : "fallback", tx : com_tilbuci_data_Global.ln.get("window-movieprop-accessfallback"), vr : feathers_controls_Label.VARIANT_DETAIL};
		var tmp9 = com_tilbuci_data_Global.ln.get("window-movieprop-accessbt");
		this.addForm(tmp,tmp1.forge("access",[tmp2,{ tp : "TInput", id : "moviekey", tx : "", vr : ""},tmp3,tmp4,tmp5,tmp6,tmp7,{ tp : "List", id : "group", vl : [], sl : [], ht : 190},tmp8,{ tp : "Select", id : "fallback", vl : [], sl : []},{ tp : "Spacer", id : "access", ht : 12, ln : false},{ tp : "Button", id : "access", tx : tmp9, ac : $bind(this,this.onAccess)}]));
		this.ui.lists.h["group"].set_allowMultipleSelection(true);
		com_tilbuci_ui_window_PopupWindow.prototype.startInterface.call(this);
	}
	,kill: function() {
		com_tilbuci_ui_window_PopupWindow.prototype.kill.call(this);
	}
	,action: function(ac,data) {
		switch(ac) {
		case "browsefavicon":
			this._favicon.load(data.h["file"]);
			break;
		case "browseimage":
			this._image.load(data.h["file"]);
			break;
		case "browseloadingic":
			this._loadingic.frames = data.h["frames"];
			this._loadingic.frtime = data.h["frtime"];
			this._loadingic.load(data.h["file"]);
			break;
		}
	}
	,acStart: function() {
		this.ui.inputs.h["moviename"].set_text(com_tilbuci_data_GlobalPlayer.mdata.title);
		this.ui.inputs.h["movieauthor"].set_text(com_tilbuci_data_GlobalPlayer.mdata.author);
		this.ui.inputs.h["moviecopyright"].set_text(com_tilbuci_data_GlobalPlayer.mdata.copyright);
		this.ui.inputs.h["moviecopyleft"].set_text(com_tilbuci_data_GlobalPlayer.mdata.copyleft);
		this.ui.inputs.h["movietags"].set_text(com_tilbuci_data_GlobalPlayer.mdata.tags.join(", "));
		this.ui.tareas.h["movieabout"].set_text(com_tilbuci_data_GlobalPlayer.mdata.description);
		var secretkey = "";
		if(com_tilbuci_data_GlobalPlayer.mdata.key != "") {
			secretkey = com_tilbuci_statictools_StringStatic.decryptKey(com_tilbuci_data_GlobalPlayer.mdata.key,"skey",com_tilbuci_data_GlobalPlayer.secret);
		}
		this.ui.inputs.h["moviekey"].set_text(secretkey);
		if(com_tilbuci_data_GlobalPlayer.mdata.favicon == "") {
			this._favicon.unload();
		} else {
			this._favicon.load(com_tilbuci_data_GlobalPlayer.mdata.favicon);
		}
		if(com_tilbuci_data_GlobalPlayer.mdata.image == "") {
			this._image.unload();
		} else {
			this._image.load(com_tilbuci_data_GlobalPlayer.mdata.image);
		}
		if(com_tilbuci_data_GlobalPlayer.mdata.loadingic[0] == "") {
			this._loadingic.unload();
			this._loadingic.set_visible(false);
		} else {
			this._loadingic.frames = Std.parseInt(com_tilbuci_data_GlobalPlayer.mdata.loadingic[1]);
			this._loadingic.frtime = Std.parseInt(com_tilbuci_data_GlobalPlayer.mdata.loadingic[2]);
			this._loadingic.load(com_tilbuci_data_GlobalPlayer.mdata.loadingic[0]);
		}
		this.ui.setSelectOptions("movieindex",[]);
		var tmp = com_tilbuci_data_Global.ws;
		var _g = new haxe_ds_StringMap();
		var value = com_tilbuci_data_GlobalPlayer.movie.get_mvId();
		_g.h["movie"] = value;
		tmp.send("Scene/List",_g,$bind(this,this.onSceneList));
		this.ui.setSelectValue("movietime",com_tilbuci_data_GlobalPlayer.mdata.time);
		this.ui.setSelectValue("movieorigin",com_tilbuci_data_GlobalPlayer.mdata.origin);
		this.ui.setSelectValue("movieanimation",com_tilbuci_data_GlobalPlayer.mdata.animation);
		if(com_tilbuci_data_GlobalPlayer.mdata.highlightInt == null) {
			this.ui.inputs.h["moviehighlight"].set_text("");
		} else {
			this.ui.inputs.h["moviehighlight"].set_text("0x" + StringTools.hex(com_tilbuci_data_GlobalPlayer.mdata.highlightInt));
		}
		this.ui.numerics.h["moviesizebig"].set_value(com_tilbuci_data_GlobalPlayer.mdata.screen.big);
		this.ui.numerics.h["moviesizesmall"].set_value(com_tilbuci_data_GlobalPlayer.mdata.screen.small);
		this.ui.setSelectValue("moviesizetype",com_tilbuci_data_GlobalPlayer.mdata.screen.type);
		this.ui.inputs.h["moviecolor"].set_text("0x" + StringTools.hex(com_tilbuci_data_GlobalPlayer.mdata.screen.bgcolor));
		this._cssArea.set_text(com_tilbuci_data_GlobalPlayer.mdata.style);
		this._acstart.setText(com_tilbuci_data_GlobalPlayer.mdata.acstart);
		this.snippetsList();
		var json = com_tilbuci_statictools_StringStatic.jsonParse(com_tilbuci_data_GlobalPlayer.mdata.theme);
		if(json != false) {
			var _g = 0;
			var _g1 = Reflect.fields(json);
			while(_g < _g1.length) {
				var n = _g1[_g];
				++_g;
				if(Object.prototype.hasOwnProperty.call(this.ui.inputs.h,n)) {
					this.ui.inputs.h[n].set_text(Reflect.field(json,n));
				}
			}
		}
		var h = com_tilbuci_data_GlobalPlayer.mdata.inputs.h;
		var k_h = h;
		var k_keys = Object.keys(h);
		var k_length = k_keys.length;
		var k_current = 0;
		while(k_current < k_length) {
			var k = k_keys[k_current++];
			var _g = com_tilbuci_data_GlobalPlayer.mdata.inputs.h[k];
			if(_g == null) {
				this.ui.setSelectValue("input-" + k,"");
				this.ui.inputs.h["input-" + k].set_text(com_tilbuci_data_GlobalPlayer.mdata.inputs.h[k]);
			} else {
				switch(_g) {
				case "down":
					this.ui.setSelectValue("input-" + k,"down");
					this.ui.inputs.h["input-" + k].set_text("");
					break;
				case "firstkf":
					this.ui.setSelectValue("input-" + k,"firstkf");
					this.ui.inputs.h["input-" + k].set_text("");
					break;
				case "lastkf":
					this.ui.setSelectValue("input-" + k,"lastkf");
					this.ui.inputs.h["input-" + k].set_text("");
					break;
				case "left":
					this.ui.setSelectValue("input-" + k,"left");
					this.ui.inputs.h["input-" + k].set_text("");
					break;
				case "nextkf":
					this.ui.setSelectValue("input-" + k,"nextkf");
					this.ui.inputs.h["input-" + k].set_text("");
					break;
				case "nin":
					this.ui.setSelectValue("input-" + k,"nin");
					this.ui.inputs.h["input-" + k].set_text("");
					break;
				case "nothing":
					this.ui.setSelectValue("input-" + k,"nothing");
					this.ui.inputs.h["input-" + k].set_text("");
					break;
				case "nout":
					this.ui.setSelectValue("input-" + k,"nout");
					this.ui.inputs.h["input-" + k].set_text("");
					break;
				case "prevkf":
					this.ui.setSelectValue("input-" + k,"prevkf");
					this.ui.inputs.h["input-" + k].set_text("");
					break;
				case "right":
					this.ui.setSelectValue("input-" + k,"right");
					this.ui.inputs.h["input-" + k].set_text("");
					break;
				case "target":
					this.ui.setSelectValue("input-" + k,"target");
					this.ui.inputs.h["input-" + k].set_text("");
					break;
				case "up":
					this.ui.setSelectValue("input-" + k,"up");
					this.ui.inputs.h["input-" + k].set_text("");
					break;
				default:
					this.ui.setSelectValue("input-" + k,"");
					this.ui.inputs.h["input-" + k].set_text(com_tilbuci_data_GlobalPlayer.mdata.inputs.h[k]);
				}
			}
		}
		var h = com_tilbuci_data_Global.plugins.h;
		var pl_h = h;
		var pl_keys = Object.keys(h);
		var pl_length = pl_keys.length;
		var pl_current = 0;
		while(pl_current < pl_length) {
			var pl = pl_h[pl_keys[pl_current++]];
			var active = false;
			var this1 = com_tilbuci_data_GlobalPlayer.mdata.plugins;
			var key = pl.get_plname();
			if(Object.prototype.hasOwnProperty.call(this1.h,key)) {
				var this2 = com_tilbuci_data_GlobalPlayer.mdata.plugins;
				var key1 = pl.get_plname();
				active = this2.h[key1].active;
			}
			var this3 = this.ui.toggles;
			var key2 = "pl-" + pl.get_plname();
			this3.h[key2].set_selected(active);
		}
	}
	,onSaveAbout: function(evt) {
		var index = "";
		if(this.ui.selects.h["movieindex"].get_selectedItem() != null) {
			index = this.ui.selects.h["movieindex"].get_selectedItem().value;
		}
		var data = com_tilbuci_statictools_StringStatic.jsonStringify({ author : this.ui.inputs.h["movieauthor"].get_text(), title : this.ui.inputs.h["moviename"].get_text(), copyright : this.ui.inputs.h["moviecopyright"].get_text(), copyleft : this.ui.inputs.h["moviecopyleft"].get_text(), tags : this.ui.inputs.h["movietags"].get_text(), about : this.ui.tareas.h["movieabout"].get_text(), start : index, favicon : this._favicon.get_lastMedia(), image : this._image.get_lastMedia()});
		var tmp = com_tilbuci_data_Global.ws;
		var _g = new haxe_ds_StringMap();
		var value = com_tilbuci_data_GlobalPlayer.movie.get_mvId();
		_g.h["id"] = value;
		_g.h["data"] = data;
		tmp.send("Movie/Update",_g,$bind(this,this.onSaveReturn));
	}
	,onSaveDisplay: function(evt) {
		var color = StringTools.replace(this.ui.inputs.h["moviecolor"].get_text(),"#","0x");
		if(HxOverrides.substr(color,0,2) != "0x") {
			color = "0x" + color;
		}
		if(Std.parseInt(color) == null) {
			this.ui.inputs.h["moviecolor"].set_text("0x" + StringTools.hex(com_tilbuci_data_GlobalPlayer.mdata.screen.bgcolor));
		} else {
			this.ui.inputs.h["moviecolor"].set_text(color);
		}
		var data = com_tilbuci_statictools_StringStatic.jsonStringify({ bigsize : Math.round(this.ui.numerics.h["moviesizebig"].get_value()), smallsize : Math.round(this.ui.numerics.h["moviesizesmall"].get_value()), typesize : this.ui.selects.h["moviesizetype"].get_selectedItem().value, bgcolor : this.ui.inputs.h["moviecolor"].get_text()});
		var tmp = com_tilbuci_data_Global.ws;
		var _g = new haxe_ds_StringMap();
		var value = com_tilbuci_data_GlobalPlayer.movie.get_mvId();
		_g.h["id"] = value;
		_g.h["data"] = data;
		tmp.send("Movie/Update",_g,$bind(this,this.onSaveReturn));
	}
	,onSaveAnim: function(evt) {
		var color = StringTools.replace(this.ui.inputs.h["moviehighlight"].get_text(),"#","0x");
		if(HxOverrides.substr(color,0,2) != "0x") {
			color = "0x" + color;
		}
		if(Std.parseInt(color) == null) {
			this.ui.inputs.h["moviehighlight"].set_text("");
		} else {
			this.ui.inputs.h["moviehighlight"].set_text(color);
		}
		var loadingData = ["","",""];
		if(this._loadingic.get_mediaLoaded()) {
			loadingData = [this._loadingic.get_lastMedia(),Std.string(this._loadingic.frames),Std.string(this._loadingic.frtime)];
		}
		var data = com_tilbuci_statictools_StringStatic.jsonStringify({ time : this.ui.selects.h["movietime"].get_selectedItem().value, origin : this.ui.selects.h["movieorigin"].get_selectedItem().value, animation : this.ui.selects.h["movieanimation"].get_selectedItem().value, highlight : this.ui.inputs.h["moviehighlight"].get_text(), loadingic : com_tilbuci_statictools_StringStatic.jsonStringify(loadingData)});
		var tmp = com_tilbuci_data_Global.ws;
		var _g = new haxe_ds_StringMap();
		var value = com_tilbuci_data_GlobalPlayer.movie.get_mvId();
		_g.h["id"] = value;
		_g.h["data"] = data;
		tmp.send("Movie/Update",_g,$bind(this,this.onSaveReturn));
	}
	,onSaveCss: function(evt) {
		var data = com_tilbuci_statictools_StringStatic.jsonStringify({ css : this._cssArea.get_text()});
		var tmp = com_tilbuci_data_Global.ws;
		var _g = new haxe_ds_StringMap();
		var value = com_tilbuci_data_GlobalPlayer.movie.get_mvId();
		_g.h["id"] = value;
		_g.h["data"] = data;
		tmp.send("Movie/Update",_g,$bind(this,this.onSaveReturn));
	}
	,onSaveAcstart: function(evt) {
		var json = com_tilbuci_statictools_StringStatic.jsonParse(this._acstart.getText());
		if(this._acstart.getText() != "" && json == false) {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-movieprop-acstart"),com_tilbuci_data_Global.ln.get("window-movieprop-acstarterror"),300,180,this.stage);
		} else {
			var data = com_tilbuci_statictools_StringStatic.jsonStringify({ acstart : this._acstart.getText()});
			var tmp = com_tilbuci_data_Global.ws;
			var _g = new haxe_ds_StringMap();
			var value = com_tilbuci_data_GlobalPlayer.movie.get_mvId();
			_g.h["id"] = value;
			_g.h["data"] = data;
			tmp.send("Movie/Update",_g,$bind(this,this.onSaveReturn));
		}
	}
	,onSaveReturn: function(ok,ld) {
		if(!ok) {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-movieprop-popup"),com_tilbuci_data_Global.ln.get("window-movieprop-popuperror"),420,150,this.stage);
		} else if(ld.map.h["e"] == 0) {
			var ar = ld.map.h["list"];
			var _g = 0;
			var _g1 = Reflect.fields(ar);
			while(_g < _g1.length) {
				var k = _g1[_g];
				++_g;
				switch(k) {
				case "about":
					com_tilbuci_data_GlobalPlayer.mdata.description = Reflect.field(ar,k);
					break;
				case "acstart":
					com_tilbuci_data_GlobalPlayer.mdata.acstart = Reflect.field(ar,k);
					break;
				case "actions":
					var json = com_tilbuci_statictools_StringStatic.jsonParse(Reflect.field(ar,k));
					if(json != false) {
						com_tilbuci_data_GlobalPlayer.mdata.actions = json;
					}
					break;
				case "animation":
					com_tilbuci_data_GlobalPlayer.mdata.animation = Reflect.field(ar,k);
					com_tilbuci_data_GlobalPlayer.area.setAnimation(com_tilbuci_data_GlobalPlayer.mdata.animation);
					break;
				case "author":
					com_tilbuci_data_GlobalPlayer.mdata.author = Reflect.field(ar,k);
					break;
				case "copyleft":
					com_tilbuci_data_GlobalPlayer.mdata.copyleft = Reflect.field(ar,k);
					break;
				case "copyright":
					com_tilbuci_data_GlobalPlayer.mdata.copyright = Reflect.field(ar,k);
					break;
				case "css":
					com_tilbuci_data_GlobalPlayer.mdata.style = Reflect.field(ar,k);
					com_tilbuci_data_GlobalPlayer.style.clear();
					com_tilbuci_data_GlobalPlayer.style.parseCSS(com_tilbuci_data_GlobalPlayer.mdata.style);
					break;
				case "fallback":
					com_tilbuci_data_GlobalPlayer.mdata.fallback = Reflect.field(ar,k);
					break;
				case "favicon":
					com_tilbuci_data_GlobalPlayer.mdata.favicon = Reflect.field(ar,k);
					break;
				case "flags":
					var json1 = com_tilbuci_statictools_StringStatic.jsonParse(Reflect.field(ar,k));
					if(json1 != false) {
						com_tilbuci_data_GlobalPlayer.mdata.flags = new haxe_ds_StringMap();
						var _g2 = 0;
						var _g3 = Reflect.fields(json1);
						while(_g2 < _g3.length) {
							var n = _g3[_g2];
							++_g2;
							var v = js_Boot.__cast(Reflect.field(json1,n) , Bool);
							com_tilbuci_data_GlobalPlayer.mdata.flags.h[n] = v;
						}
					}
					break;
				case "highlight":
					com_tilbuci_data_GlobalPlayer.mdata.highlight = Reflect.field(ar,k);
					com_tilbuci_data_GlobalPlayer.mdata.highlightInt = Std.parseInt(com_tilbuci_data_GlobalPlayer.mdata.highlight);
					break;
				case "identify":
					com_tilbuci_data_GlobalPlayer.mdata.identify = Reflect.field(ar,k) == "1";
					break;
				case "image":
					com_tilbuci_data_GlobalPlayer.mdata.image = Reflect.field(ar,k);
					break;
				case "inputs":
					var json2 = com_tilbuci_statictools_StringStatic.jsonParse(Reflect.field(ar,k));
					if(json2 != false) {
						var _g4 = 0;
						var _g5 = Reflect.fields(json2);
						while(_g4 < _g5.length) {
							var n1 = _g5[_g4];
							++_g4;
							var v1 = js_Boot.__cast(Reflect.field(json2,n1) , String);
							com_tilbuci_data_GlobalPlayer.mdata.inputs.h[n1] = v1;
						}
					}
					break;
				case "key":
					com_tilbuci_data_GlobalPlayer.mdata.key = Reflect.field(ar,k);
					break;
				case "loadingic":
					com_tilbuci_data_GlobalPlayer.mdata.loadingic = com_tilbuci_statictools_StringStatic.jsonParse(Reflect.field(ar,k));
					break;
				case "numbers":
					var json3 = com_tilbuci_statictools_StringStatic.jsonParse(Reflect.field(ar,k));
					if(json3 != false) {
						com_tilbuci_data_GlobalPlayer.mdata.numbers = new haxe_ds_StringMap();
						var _g6 = 0;
						var _g7 = Reflect.fields(json3);
						while(_g6 < _g7.length) {
							var n2 = _g7[_g6];
							++_g6;
							var v2 = js_Boot.__cast(Reflect.field(json3,n2) , Float);
							com_tilbuci_data_GlobalPlayer.mdata.numbers.h[n2] = v2;
						}
					}
					break;
				case "origin":
					com_tilbuci_data_GlobalPlayer.mdata.origin = Reflect.field(ar,k);
					break;
				case "plugins":
					var h = com_tilbuci_data_GlobalPlayer.mdata.plugins.h;
					var n_h = h;
					var n_keys = Object.keys(h);
					var n_length = n_keys.length;
					var n_current = 0;
					while(n_current < n_length) {
						var n3 = n_keys[n_current++];
						com_tilbuci_data_GlobalPlayer.mdata.plugins.h[n3].active = false;
					}
					var pls = Reflect.field(ar,k);
					if(pls != "") {
						var plsar = pls.split(",");
						var _g8 = 0;
						var _g9 = plsar.length;
						while(_g8 < _g9) {
							var i = _g8++;
							if(Object.prototype.hasOwnProperty.call(com_tilbuci_data_GlobalPlayer.mdata.plugins.h,plsar[i])) {
								com_tilbuci_data_GlobalPlayer.mdata.plugins.h[plsar[i]].active = true;
							}
						}
					}
					break;
				case "start":
					com_tilbuci_data_GlobalPlayer.mdata.start = Reflect.field(ar,k);
					break;
				case "tags":
					com_tilbuci_data_GlobalPlayer.mdata.tags = Reflect.field(ar,k).split(",");
					break;
				case "texts":
					var json4 = com_tilbuci_statictools_StringStatic.jsonParse(Reflect.field(ar,k));
					if(json4 != false) {
						com_tilbuci_data_GlobalPlayer.mdata.texts = new haxe_ds_StringMap();
						var _g10 = 0;
						var _g11 = Reflect.fields(json4);
						while(_g10 < _g11.length) {
							var n4 = _g11[_g10];
							++_g10;
							var v3 = js_Boot.__cast(Reflect.field(json4,n4) , String);
							com_tilbuci_data_GlobalPlayer.mdata.texts.h[n4] = v3;
						}
					}
					break;
				case "theme":
					com_tilbuci_data_GlobalPlayer.mdata.theme = Reflect.field(ar,k);
					break;
				case "time":
					var tmp = parseFloat(Reflect.field(ar,k));
					com_tilbuci_data_GlobalPlayer.mdata.time = tmp;
					break;
				case "title":
					com_tilbuci_data_GlobalPlayer.mdata.title = Reflect.field(ar,k);
					break;
				case "vsgroups":
					com_tilbuci_data_GlobalPlayer.mdata.vsgroups = Reflect.field(ar,k).split(",");
					break;
				}
			}
			if(ld.map.h["reload"]) {
				var tmp = this._ac;
				var _g = new haxe_ds_StringMap();
				var value = com_tilbuci_data_GlobalPlayer.movie.get_mvId();
				_g.h["id"] = value;
				tmp("movieload",_g);
				feathers_core_PopUpManager.removePopUp(this);
			} else {
				this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-movieprop-popup"),com_tilbuci_data_Global.ln.get("window-movieprop-popupok"),420,150,this.stage);
			}
		} else {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-movieprop-popup"),com_tilbuci_data_Global.ln.get("window-movieprop-popuperror"),420,150,this.stage);
		}
	}
	,onFontSystem: function(evt) {
		if(this.ui.lists.h["fontssystemlist"].get_selectedItem() != null) {
			com_tilbuci_data_Global.copyText(this.ui.lists.h["fontssystemlist"].get_selectedItem().value);
		}
	}
	,onFontMovie: function(evt) {
		if(this.ui.lists.h["fontsmovielist"].get_selectedItem() != null) {
			com_tilbuci_data_Global.copyText(this.ui.lists.h["fontsmovielist"].get_selectedItem().value);
		}
	}
	,onFontAdd: function(evt) {
		com_tilbuci_data_Global.up.browseForFont($bind(this,this.onFontSelected));
	}
	,onFontSelected: function(ok) {
		if(ok) {
			this.ui.inputs.h["fontfile"].set_text(com_tilbuci_data_Global.up.get_selectedName());
			if(this.ui.inputs.h["fontname"].get_text() == "") {
				var fname = StringTools.replace(com_tilbuci_data_Global.up.get_selectedName(),".woff2","");
				fname = StringTools.replace(fname,".woff","");
				fname = StringTools.replace(fname,"-"," ");
				fname = StringTools.replace(fname,"_"," ");
				this.ui.inputs.h["fontname"].set_text(fname);
			}
		} else {
			this.ui.inputs.h["fontfile"].set_text(this.ui.inputs.h["fontname"].set_text(""));
		}
	}
	,onFontUpload: function(evt) {
		if(this.ui.inputs.h["fontfile"].get_text() == "" || this.ui.inputs.h["fontname"].get_text() == "") {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-setup-font-title"),com_tilbuci_data_Global.ln.get("window-setup-font-nofilename"),300,180,this.stage);
		} else {
			var tmp = com_tilbuci_data_Global.up;
			var _g = new haxe_ds_StringMap();
			var value = this.ui.inputs.h["fontname"].get_text();
			_g.h["name"] = value;
			var value = com_tilbuci_data_GlobalPlayer.movie.get_mvId();
			_g.h["movie"] = value;
			if(!tmp.uploadFont($bind(this,this.fontReturn),_g)) {
				this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-setup-font-title"),com_tilbuci_data_Global.ln.get("window-setup-font-nofont"),300,180,this.stage);
			}
		}
	}
	,fontReturn: function(ok,data) {
		if(!ok) {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-setup-font-title"),com_tilbuci_data_Global.ln.get("window-setup-font-uploader"),300,180,this.stage);
		} else if(data.h["e"] != 0) {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-setup-font-title"),com_tilbuci_data_Global.ln.get("window-setup-font-uploader"),300,180,this.stage);
		} else {
			new com_tilbuci_font_EmbedFont(com_tilbuci_data_Global.econfig.get_player() + "movie/" + com_tilbuci_data_GlobalPlayer.movie.get_mvId() + ".movie/media/font/" + Std.string(data.h["fname"]),data.h["name"],$bind(this,this.fontLoaded),false);
			var fts = null;
			try {
				fts = data.h["mfonts"];
			} catch( _g ) {
				fts = null;
			}
			if(fts != null) {
				com_tilbuci_data_GlobalPlayer.mdata.fonts = fts;
				var arf = [];
				var _g = 0;
				while(_g < fts.length) {
					var i = fts[_g];
					++_g;
					arf.push({ text : i.name, value : i.name});
				}
				this.ui.setListValues("fontsmovielist",arf);
				this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-setup-font-title"),com_tilbuci_data_Global.ln.get("window-setup-font-uploadok"),300,200,this.stage);
			} else {
				this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-setup-font-title"),com_tilbuci_data_Global.ln.get("window-setup-font-uploader"),300,180,this.stage);
			}
		}
	}
	,fontLoaded: function(ok,ft) {
		var ok1 = ok;
	}
	,onSnLoad: function(evt) {
		if(this.ui.lists.h["snippetslist"].get_selectedItem() != null) {
			this._acsnippet.setText(this.ui.lists.h["snippetslist"].get_selectedItem().value);
			this.ui.inputs.h["snippetsname"].set_text(this.ui.lists.h["snippetslist"].get_selectedItem().text);
		}
	}
	,onSnDel: function(evt) {
		if(this.ui.lists.h["snippetslist"].get_selectedItem() != null) {
			var snar = [];
			var _g = 0;
			var _g1 = this.ui.lists.h["snippetslist"].get_dataProvider().get_length();
			while(_g < _g1) {
				var i = _g++;
				if(this.ui.lists.h["snippetslist"].get_selectedItem().text != this.ui.lists.h["snippetslist"].get_dataProvider().get(i).text) {
					snar.push(this.ui.lists.h["snippetslist"].get_dataProvider().get(i));
				}
			}
			this.ui.setListValues("snippetslist",snar);
		}
	}
	,onSnAdd: function(evt) {
		var scrtext = this._acsnippet.getText();
		if(scrtext != "" && this.ui.inputs.h["snippetsname"].get_text() != "") {
			var json = com_tilbuci_statictools_StringStatic.jsonParse(scrtext);
			if(json == false) {
				this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-movieprop-snippets"),com_tilbuci_data_Global.ln.get("window-movieprop-snippetserror"),300,180,this.stage);
			} else {
				var snar = [];
				var _g = 0;
				var _g1 = this.ui.lists.h["snippetslist"].get_dataProvider().get_length();
				while(_g < _g1) {
					var i = _g++;
					if(this.ui.lists.h["snippetslist"].get_dataProvider().get(i).text != this.ui.inputs.h["snippetsname"].get_text()) {
						snar.push({ text : this.ui.lists.h["snippetslist"].get_dataProvider().get(i).text, value : this.ui.lists.h["snippetslist"].get_dataProvider().get(i).value});
					}
				}
				snar.push({ text : this.ui.inputs.h["snippetsname"].get_text(), value : scrtext});
				this.ui.setListValues("snippetslist",snar);
				this.ui.inputs.h["snippetsname"].set_text("");
				this._acsnippet.setText("");
			}
		}
	}
	,onSaveSnippets: function(evt) {
		var arac = [];
		var _g = 0;
		var _g1 = this.ui.lists.h["snippetslist"].get_dataProvider().get_length();
		while(_g < _g1) {
			var i = _g++;
			arac.push({ name : this.ui.lists.h["snippetslist"].get_dataProvider().get(i).text, ac : this.ui.lists.h["snippetslist"].get_dataProvider().get(i).value});
		}
		var json = com_tilbuci_statictools_StringStatic.jsonStringify(arac);
		var data = com_tilbuci_statictools_StringStatic.jsonStringify({ actions : json});
		var tmp = com_tilbuci_data_Global.ws;
		var _g = new haxe_ds_StringMap();
		var value = com_tilbuci_data_GlobalPlayer.movie.get_mvId();
		_g.h["id"] = value;
		_g.h["data"] = data;
		tmp.send("Movie/Update",_g,$bind(this,this.onSaveReturn));
	}
	,snippetsList: function() {
		var lst = [];
		var _g = 0;
		var _g1 = com_tilbuci_data_GlobalPlayer.mdata.actions.length;
		while(_g < _g1) {
			var i = _g++;
			lst.push({ text : com_tilbuci_data_GlobalPlayer.mdata.actions[i].name, value : com_tilbuci_data_GlobalPlayer.mdata.actions[i].ac});
		}
		this.ui.setListValues("snippetslist",lst);
		this._acsnippet.setText("");
		this.ui.inputs.h["snippetsname"].set_text("");
	}
	,onTxtLoad: function(evt) {
		if(this.ui.lists.h["textslist"].get_selectedItem() != null) {
			this.ui.inputs.h["textsname"].set_text(this.ui.lists.h["textslist"].get_selectedItem().text);
			this.ui.tareas.h["textsvalue"].set_text(this.ui.lists.h["textslist"].get_selectedItem().value);
		}
	}
	,onTxtDel: function(evt) {
		if(this.ui.lists.h["textslist"].get_selectedItem() != null) {
			var snar = [];
			var _g = 0;
			var _g1 = this.ui.lists.h["textslist"].get_dataProvider().get_length();
			while(_g < _g1) {
				var i = _g++;
				if(this.ui.lists.h["textslist"].get_selectedItem().text != this.ui.lists.h["textslist"].get_dataProvider().get(i).text) {
					snar.push(this.ui.lists.h["textslist"].get_dataProvider().get(i));
				}
			}
			this.ui.setListValues("textslist",snar);
		}
	}
	,onTxtAdd: function(evt) {
		var snar = [];
		var _g = 0;
		var _g1 = this.ui.lists.h["textslist"].get_dataProvider().get_length();
		while(_g < _g1) {
			var i = _g++;
			if(this.ui.lists.h["textslist"].get_dataProvider().get(i).text != this.ui.inputs.h["textsname"].get_text()) {
				snar.push({ text : this.ui.lists.h["textslist"].get_dataProvider().get(i).text, value : this.ui.lists.h["textslist"].get_dataProvider().get(i).value});
			}
		}
		snar.push({ text : this.ui.inputs.h["textsname"].get_text(), value : this.ui.tareas.h["textsvalue"].get_text()});
		this.ui.inputs.h["textsname"].set_text("");
		this.ui.tareas.h["textsvalue"].set_text("");
		this.ui.setListValues("textslist",snar);
	}
	,onStrGet: function(evt) {
		var tmp = com_tilbuci_data_Global.ws;
		var _g = new haxe_ds_StringMap();
		_g.h["file"] = "strings.json";
		var value = com_tilbuci_data_GlobalPlayer.movie.get_mvId();
		_g.h["movie"] = value;
		tmp.download(_g);
	}
	,onStrSend: function(evt) {
		com_tilbuci_data_Global.up.selectFile($bind(this,this.onStrSelected),"strings.json file","*.json");
	}
	,onStrSelected: function(ok,data) {
		if(ok) {
			var str = data.toString();
			var json = com_tilbuci_statictools_StringStatic.jsonParse(str);
			if(json == false) {
				com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("window-movieprop-stringssend"),com_tilbuci_data_Global.ln.get("window-movieprop-stringssendno"),320,150,com_tilbuci_data_Global.ln.get("default-ok"));
			} else {
				var tmp = com_tilbuci_data_Global.ws;
				var _g = new haxe_ds_StringMap();
				var value = com_tilbuci_data_GlobalPlayer.movie.get_mvId();
				_g.h["movie"] = value;
				_g.h["strings"] = str;
				tmp.send("Media/StringsJSON",_g,$bind(this,this.onStrSent));
			}
		} else {
			com_tilbuci_data_Global.showMsg(com_tilbuci_data_Global.ln.get("window-movieprop-stringssender"));
		}
	}
	,onStrSent: function(ok,ld) {
		if(!ok) {
			com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("window-movieprop-stringssend"),com_tilbuci_data_Global.ln.get("window-movieprop-stringssendnosend"),320,150,com_tilbuci_data_Global.ln.get("default-ok"));
		} else if(ld.map.h["e"] != "0") {
			com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("window-movieprop-stringssend"),com_tilbuci_data_Global.ln.get("window-movieprop-stringssendnosend"),320,150,com_tilbuci_data_Global.ln.get("default-ok"));
		} else {
			com_tilbuci_data_Global.showMsg(com_tilbuci_data_Global.ln.get("window-movieprop-stringssendok"));
		}
	}
	,onSaveTexts: function(evt) {
		var txts = new haxe_ds_StringMap();
		var _g = 0;
		var _g1 = this.ui.lists.h["textslist"].get_dataProvider().get_length();
		while(_g < _g1) {
			var i = _g++;
			var k = this.ui.lists.h["textslist"].get_dataProvider().get(i).text;
			var v = this.ui.lists.h["textslist"].get_dataProvider().get(i).value;
			txts.h[k] = v;
		}
		var data = com_tilbuci_statictools_StringStatic.jsonStringify({ texts : com_tilbuci_statictools_StringStatic.jsonStringify(txts)});
		var tmp = com_tilbuci_data_Global.ws;
		var _g = new haxe_ds_StringMap();
		var value = com_tilbuci_data_GlobalPlayer.movie.get_mvId();
		_g.h["id"] = value;
		_g.h["data"] = data;
		tmp.send("Movie/Update",_g,$bind(this,this.onSaveReturn));
	}
	,textsList: function() {
		var lst = [];
		var h = com_tilbuci_data_GlobalPlayer.mdata.texts.h;
		var n_h = h;
		var n_keys = Object.keys(h);
		var n_length = n_keys.length;
		var n_current = 0;
		while(n_current < n_length) {
			var n = n_keys[n_current++];
			lst.push({ text : n, value : com_tilbuci_data_GlobalPlayer.mdata.texts.h[n]});
		}
		this.ui.setListValues("textslist",lst);
	}
	,onNumLoad: function(evt) {
		if(this.ui.lists.h["numberslist"].get_selectedItem() != null) {
			this.ui.inputs.h["numbersname"].set_text(this.ui.lists.h["numberslist"].get_selectedItem().text);
			this.ui.numerics.h["numbersvalue"].set_value(this.ui.lists.h["numberslist"].get_selectedItem().value);
		}
	}
	,onNumDel: function(evt) {
		if(this.ui.lists.h["numberslist"].get_selectedItem() != null) {
			var snar = [];
			var _g = 0;
			var _g1 = this.ui.lists.h["numberslist"].get_dataProvider().get_length();
			while(_g < _g1) {
				var i = _g++;
				if(this.ui.lists.h["numberslist"].get_selectedItem().text != this.ui.lists.h["numberslist"].get_dataProvider().get(i).text) {
					snar.push(this.ui.lists.h["numberslist"].get_dataProvider().get(i));
				}
			}
			this.ui.setListValues("numberslist",snar);
		}
	}
	,onNumAdd: function(evt) {
		var snar = [];
		var _g = 0;
		var _g1 = this.ui.lists.h["numberslist"].get_dataProvider().get_length();
		while(_g < _g1) {
			var i = _g++;
			if(this.ui.lists.h["numberslist"].get_dataProvider().get(i).text != this.ui.inputs.h["numbersname"].get_text()) {
				snar.push({ text : this.ui.lists.h["numberslist"].get_dataProvider().get(i).text, value : this.ui.lists.h["numberslist"].get_dataProvider().get(i).value});
			}
		}
		snar.push({ text : this.ui.inputs.h["numbersname"].get_text(), value : this.ui.numerics.h["numbersvalue"].get_value()});
		this.ui.inputs.h["numbersname"].set_text("");
		this.ui.numerics.h["numbersvalue"].set_value(0);
		this.ui.setListValues("numberslist",snar);
	}
	,onSaveNumbers: function(evt) {
		var nums = new haxe_ds_StringMap();
		var _g = 0;
		var _g1 = this.ui.lists.h["numberslist"].get_dataProvider().get_length();
		while(_g < _g1) {
			var i = _g++;
			var k = this.ui.lists.h["numberslist"].get_dataProvider().get(i).text;
			var v = this.ui.lists.h["numberslist"].get_dataProvider().get(i).value;
			nums.h[k] = v;
		}
		var data = com_tilbuci_statictools_StringStatic.jsonStringify({ numbers : com_tilbuci_statictools_StringStatic.jsonStringify(nums)});
		var tmp = com_tilbuci_data_Global.ws;
		var _g = new haxe_ds_StringMap();
		var value = com_tilbuci_data_GlobalPlayer.movie.get_mvId();
		_g.h["id"] = value;
		_g.h["data"] = data;
		tmp.send("Movie/Update",_g,$bind(this,this.onSaveReturn));
	}
	,numbersList: function() {
		var lst = [];
		var h = com_tilbuci_data_GlobalPlayer.mdata.numbers.h;
		var n_h = h;
		var n_keys = Object.keys(h);
		var n_length = n_keys.length;
		var n_current = 0;
		while(n_current < n_length) {
			var n = n_keys[n_current++];
			lst.push({ text : n, value : com_tilbuci_data_GlobalPlayer.mdata.numbers.h[n]});
		}
		this.ui.setListValues("numberslist",lst);
	}
	,onFlagLoad: function(evt) {
		if(this.ui.lists.h["flagslist"].get_selectedItem() != null) {
			this.ui.inputs.h["flagsname"].set_text(this.ui.lists.h["flagslist"].get_selectedItem().text);
			this.ui.toggles.h["flagsvalue"].set_selected(this.ui.lists.h["flagslist"].get_selectedItem().value);
		}
	}
	,onFlagDel: function(evt) {
		if(this.ui.lists.h["flagslist"].get_selectedItem() != null) {
			var snar = [];
			var _g = 0;
			var _g1 = this.ui.lists.h["flagslist"].get_dataProvider().get_length();
			while(_g < _g1) {
				var i = _g++;
				if(this.ui.lists.h["flagslist"].get_selectedItem().text != this.ui.lists.h["flagslist"].get_dataProvider().get(i).text) {
					snar.push(this.ui.lists.h["flagslist"].get_dataProvider().get(i));
				}
			}
			this.ui.setListValues("flagslist",snar);
		}
	}
	,onFlagAdd: function(evt) {
		var snar = [];
		var _g = 0;
		var _g1 = this.ui.lists.h["flagslist"].get_dataProvider().get_length();
		while(_g < _g1) {
			var i = _g++;
			if(this.ui.lists.h["flagslist"].get_dataProvider().get(i).text != this.ui.inputs.h["flagsname"].get_text()) {
				snar.push({ text : this.ui.lists.h["flagslist"].get_dataProvider().get(i).text, value : this.ui.lists.h["flagslist"].get_dataProvider().get(i).value});
			}
		}
		snar.push({ text : this.ui.inputs.h["flagsname"].get_text(), value : this.ui.toggles.h["flagsvalue"].get_selected()});
		this.ui.inputs.h["flagsname"].set_text("");
		this.ui.toggles.h["flagsvalue"].set_selected(false);
		this.ui.setListValues("flagslist",snar);
	}
	,onSaveFlags: function(evt) {
		var flags = new haxe_ds_StringMap();
		var _g = 0;
		var _g1 = this.ui.lists.h["flagslist"].get_dataProvider().get_length();
		while(_g < _g1) {
			var i = _g++;
			var k = this.ui.lists.h["flagslist"].get_dataProvider().get(i).text;
			var v = this.ui.lists.h["flagslist"].get_dataProvider().get(i).value;
			flags.h[k] = v;
		}
		var data = com_tilbuci_statictools_StringStatic.jsonStringify({ flags : com_tilbuci_statictools_StringStatic.jsonStringify(flags)});
		var tmp = com_tilbuci_data_Global.ws;
		var _g = new haxe_ds_StringMap();
		var value = com_tilbuci_data_GlobalPlayer.movie.get_mvId();
		_g.h["id"] = value;
		_g.h["data"] = data;
		tmp.send("Movie/Update",_g,$bind(this,this.onSaveReturn));
	}
	,flagsList: function() {
		var lst = [];
		var h = com_tilbuci_data_GlobalPlayer.mdata.flags.h;
		var n_h = h;
		var n_keys = Object.keys(h);
		var n_length = n_keys.length;
		var n_current = 0;
		while(n_current < n_length) {
			var n = n_keys[n_current++];
			lst.push({ text : n, value : com_tilbuci_data_GlobalPlayer.mdata.flags.h[n]});
		}
		this.ui.setListValues("flagslist",lst);
	}
	,onThemeSave: function(evt) {
		var colors = new haxe_ds_StringMap();
		var _g = 0;
		var _g1 = this._thColors;
		while(_g < _g1.length) {
			var n = _g1[_g];
			++_g;
			if(this.ui.inputs.h[n].get_text() != "") {
				var str = StringTools.replace(this.ui.inputs.h[n].get_text(),"#","0x");
				colors.h[n] = str;
			}
		}
		var data = com_tilbuci_statictools_StringStatic.jsonStringify({ theme : com_tilbuci_statictools_StringStatic.jsonStringify(colors)});
		var tmp = com_tilbuci_data_Global.ws;
		var _g = new haxe_ds_StringMap();
		var value = com_tilbuci_data_GlobalPlayer.movie.get_mvId();
		_g.h["id"] = value;
		_g.h["data"] = data;
		tmp.send("Movie/Update",_g,$bind(this,this.onSaveReturn));
	}
	,onInputSave: function(evt) {
		var inputs = new haxe_ds_StringMap();
		var h = com_tilbuci_data_GlobalPlayer.mdata.inputs.h;
		var k_h = h;
		var k_keys = Object.keys(h);
		var k_length = k_keys.length;
		var k_current = 0;
		while(k_current < k_length) {
			var k = k_keys[k_current++];
			switch(this.ui.selects.h["input-" + k].get_selectedItem().value) {
			case "down":
				inputs.h[k] = "down";
				break;
			case "firstkf":
				inputs.h[k] = "firstkf";
				break;
			case "lastkf":
				inputs.h[k] = "lastkf";
				break;
			case "left":
				inputs.h[k] = "left";
				break;
			case "nextkf":
				inputs.h[k] = "nextkf";
				break;
			case "nin":
				inputs.h[k] = "nin";
				break;
			case "nothing":
				inputs.h[k] = "nothing";
				break;
			case "nout":
				inputs.h[k] = "nout";
				break;
			case "prevkf":
				inputs.h[k] = "prevkf";
				break;
			case "right":
				inputs.h[k] = "right";
				break;
			case "target":
				inputs.h[k] = "target";
				break;
			case "up":
				inputs.h[k] = "up";
				break;
			default:
				var v = this.ui.inputs.h["input-" + k].get_text();
				inputs.h[k] = v;
			}
		}
		var data = com_tilbuci_statictools_StringStatic.jsonStringify({ inputs : com_tilbuci_statictools_StringStatic.jsonStringify(inputs)});
		var tmp = com_tilbuci_data_Global.ws;
		var _g = new haxe_ds_StringMap();
		var value = com_tilbuci_data_GlobalPlayer.movie.get_mvId();
		_g.h["id"] = value;
		_g.h["data"] = data;
		tmp.send("Movie/Update",_g,$bind(this,this.onSaveReturn));
	}
	,onPluginSave: function(evt) {
		var pl = [];
		var h = com_tilbuci_data_Global.plugins.h;
		var n_h = h;
		var n_keys = Object.keys(h);
		var n_length = n_keys.length;
		var n_current = 0;
		while(n_current < n_length) {
			var n = n_keys[n_current++];
			if(this.ui.toggles.h["pl-" + n].get_selected()) {
				pl.push(n);
			}
		}
		var data = com_tilbuci_statictools_StringStatic.jsonStringify({ plugins : pl.join(",")});
		var tmp = com_tilbuci_data_Global.ws;
		var _g = new haxe_ds_StringMap();
		var value = com_tilbuci_data_GlobalPlayer.movie.get_mvId();
		_g.h["id"] = value;
		_g.h["data"] = data;
		tmp.send("Movie/Update",_g,$bind(this,this.onSaveReturn));
	}
	,onAccess: function(evt) {
		var secretkey = "";
		if(this.ui.inputs.h["moviekey"].get_text() != "") {
			secretkey = com_tilbuci_statictools_StringStatic.encryptKey(this.ui.inputs.h["moviekey"].get_text(),"skey",com_tilbuci_data_GlobalPlayer.secret);
		}
		var identify = "0";
		if(this.ui.selects.h["login"].get_selectedItem().value == true) {
			identify = "1";
		}
		var encrypt = "0";
		if(this.ui.selects.h["encrypt"].get_selectedItem().value == true) {
			encrypt = "1";
		}
		var vsgroups = [];
		var _g = 0;
		var _g1 = this.ui.lists.h["group"].get_selectedItems();
		while(_g < _g1.length) {
			var n = _g1[_g];
			++_g;
			vsgroups.push(n.value);
		}
		var data = com_tilbuci_statictools_StringStatic.jsonStringify({ key : secretkey, identify : identify, fallback : this.ui.selects.h["fallback"].get_selectedItem().value, vsgroups : vsgroups.join(","), encrypt : encrypt});
		var tmp = com_tilbuci_data_Global.ws;
		var _g = new haxe_ds_StringMap();
		var value = com_tilbuci_data_GlobalPlayer.movie.get_mvId();
		_g.h["id"] = value;
		_g.h["data"] = data;
		tmp.send("Movie/Update",_g,$bind(this,this.onSaveReturn));
	}
	,onFavicon: function(evt) {
		this._ac("browsefavicon");
	}
	,onFaviconClear: function(evt) {
		this._favicon.unload();
	}
	,onFaviconLoaded: function(ok) {
		this._favicon.set_width(this._favicon.set_height(80));
		this._favicon.set_visible(true);
	}
	,onImage: function(evt) {
		this._ac("browseimage");
	}
	,onImageClear: function(evt) {
		this._image.unload();
	}
	,onImageLoaded: function(ok) {
		this._image.set_height(80);
		this._image.set_width(this._image.oWidth * this._image.get_height() / this._image.oHeight);
		if(this._image.get_width() > 210) {
			this._image.set_width(210);
			this._image.set_height(this._image.oHeight * this._image.get_width() / this._image.oWidth);
		}
		this._image.set_visible(true);
	}
	,onLoadingIc: function(evt) {
		this._ac("browseloadingic");
	}
	,onLoadingIcClear: function(evt) {
		this._loadingic.set_visible(false);
		this._loadingic.unload();
	}
	,onLoadingLoaded: function(ok) {
		this._loadingic.set_height(80);
		this._loadingic.set_width(this._loadingic.oWidth * this._loadingic.get_height() / this._loadingic.oHeight);
		this._loadingic.set_visible(true);
	}
	,onSceneList: function(ok,ld) {
		var list = [];
		if(ok) {
			if(ld.map.h["e"] == 0) {
				var _g = 0;
				var _g1 = Reflect.fields(ld.map.h["list"]);
				while(_g < _g1.length) {
					var n = _g1[_g];
					++_g;
					var it = Reflect.field(ld.map.h["list"],n);
					if(Object.prototype.hasOwnProperty.call(it,"id")) {
						list.push({ text : Reflect.field(it,"title"), value : Reflect.field(it,"id")});
					}
				}
			}
		}
		this.ui.setSelectOptions("movieindex",list);
		this.ui.setSelectValue("movieindex",com_tilbuci_data_GlobalPlayer.mdata.start);
		var tmp = com_tilbuci_data_Global.ws;
		var _g = new haxe_ds_StringMap();
		var value = com_tilbuci_data_GlobalPlayer.movie.get_mvId();
		_g.h["movie"] = value;
		tmp.send("Visitor/Access",_g,$bind(this,this.onAccessList));
	}
	,onAccessList: function(ok,ld) {
		this.ui.setSelectValue("fallback","");
		this.ui.setSelectValue("login",false);
		this.ui.setSelectValue("encrypt",false);
		this.ui.setListValues("group",[]);
		this.ui.setSelectOptions("fallback",[{ text : com_tilbuci_data_Global.ln.get("window-movieprop-accessnone"), value : ""}]);
		if(ok) {
			if(ld.map.h["e"] == 0) {
				var list = [{ text : com_tilbuci_data_Global.ln.get("window-movieprop-accessnone"), value : ""}];
				var _g = 0;
				var _g1 = Reflect.fields(ld.map.h["list"]);
				while(_g < _g1.length) {
					var n = _g1[_g];
					++_g;
					var it = Reflect.field(ld.map.h["list"],n);
					list.push({ text : Reflect.field(it,"title"), value : Reflect.field(it,"id")});
					this.ui.setSelectOptions("fallback",list);
				}
				this.ui.setSelectValue("fallback",com_tilbuci_data_GlobalPlayer.mdata.fallback);
				list = [];
				var _g = 0;
				var _g1 = Reflect.fields(ld.map.h["group"]);
				while(_g < _g1.length) {
					var n = _g1[_g];
					++_g;
					var it = Reflect.field(ld.map.h["group"],n);
					list.push({ text : Reflect.field(it,"name"), value : Reflect.field(it,"id")});
					this.ui.setListValues("group",list);
				}
				this.ui.setListMultiValue("group",com_tilbuci_data_GlobalPlayer.mdata.vsgroups);
				this.ui.setSelectValue("login",com_tilbuci_data_GlobalPlayer.mdata.identify);
				this.ui.setSelectValue("encrypt",com_tilbuci_data_GlobalPlayer.mdata.encrypted);
			}
		}
	}
	,__class__: com_tilbuci_ui_window_movie_WindowMovieProperties
});
var com_tilbuci_ui_window_movie_WindowMovieRemove = function(ac) {
	com_tilbuci_ui_window_PopupWindow.call(this,ac,com_tilbuci_data_Global.ln.get("window-movieremove-title"),700,com_tilbuci_ui_base_InterfaceFactory.pickValue(380,400),false,true,true);
};
$hxClasses["com.tilbuci.ui.window.movie.WindowMovieRemove"] = com_tilbuci_ui_window_movie_WindowMovieRemove;
com_tilbuci_ui_window_movie_WindowMovieRemove.__name__ = "com.tilbuci.ui.window.movie.WindowMovieRemove";
com_tilbuci_ui_window_movie_WindowMovieRemove.__super__ = com_tilbuci_ui_window_PopupWindow;
com_tilbuci_ui_window_movie_WindowMovieRemove.prototype = $extend(com_tilbuci_ui_window_PopupWindow.prototype,{
	startInterface: function(evt) {
		var tmp = this.ui;
		var tmp1 = { tp : "Label", id : "about", tx : com_tilbuci_data_Global.ln.get("window-movieremove-about"), vr : feathers_controls_Label.VARIANT_DETAIL};
		var tmp2 = com_tilbuci_data_Global.ln.get("window-movieremove-button");
		this.addForm("list",tmp.forge("list",[tmp1,{ tp : "List", id : "list", vl : [], ht : 250, sl : ""},{ tp : "Button", id : "remove", tx : tmp2, ac : $bind(this,this.onRemove)}]));
		com_tilbuci_ui_window_PopupWindow.prototype.startInterface.call(this);
		this.ui.labels.h["about"].set_wordWrap(true);
	}
	,kill: function() {
		com_tilbuci_ui_window_PopupWindow.prototype.kill.call(this);
	}
	,acStart: function() {
		var tmp = com_tilbuci_data_Global.ws;
		var _g = new haxe_ds_StringMap();
		_g.h["owner"] = "true";
		tmp.send("Movie/List",_g,$bind(this,this.onList));
	}
	,onList: function(ok,ld) {
		this.ui.setListSelectValue("list",null);
		this.ui.setListValues("list",[]);
		if(ok) {
			if(ld.map.h["e"] == 0) {
				var ar = [];
				var _g = 0;
				var _g1 = Reflect.fields(ld.map.h["list"]);
				while(_g < _g1.length) {
					var mvit = _g1[_g];
					++_g;
					var mv = Reflect.field(ld.map.h["list"],mvit);
					ar.push({ text : Reflect.field(mv,"title"), value : Reflect.field(mv,"id")});
				}
				this.ui.setListValues("list",ar);
			}
		}
	}
	,onRemove: function(evt) {
		if(this.ui.lists.h["list"].get_selectedItem() != null) {
			this.ui.createConfirm(com_tilbuci_data_Global.ln.get("window-movieremove-title"),com_tilbuci_data_Global.ln.get("window-movieremove-confirm"),480,240,$bind(this,this.onConfirm),com_tilbuci_data_Global.ln.get("default-ok"),com_tilbuci_data_Global.ln.get("default-cancel"),this.stage);
		}
	}
	,onConfirm: function(ok) {
		if(ok) {
			if(this.ui.lists.h["list"].get_selectedItem() != null) {
				var tmp = com_tilbuci_data_Global.ws;
				var _g = new haxe_ds_StringMap();
				var value = this.ui.lists.h["list"].get_selectedItem().value;
				_g.h["id"] = value;
				tmp.send("Movie/Remove",_g,$bind(this,this.onList));
			}
		}
	}
	,__class__: com_tilbuci_ui_window_movie_WindowMovieRemove
});
var com_tilbuci_ui_window_movie_WindowMovieRepublish = function(ac) {
	this._sequence = [];
	com_tilbuci_ui_window_PopupWindow.call(this,ac,com_tilbuci_data_Global.ln.get("window-republish-title"),800,com_tilbuci_ui_base_InterfaceFactory.pickValue(180,200),false,true,true);
};
$hxClasses["com.tilbuci.ui.window.movie.WindowMovieRepublish"] = com_tilbuci_ui_window_movie_WindowMovieRepublish;
com_tilbuci_ui_window_movie_WindowMovieRepublish.__name__ = "com.tilbuci.ui.window.movie.WindowMovieRepublish";
com_tilbuci_ui_window_movie_WindowMovieRepublish.__super__ = com_tilbuci_ui_window_PopupWindow;
com_tilbuci_ui_window_movie_WindowMovieRepublish.prototype = $extend(com_tilbuci_ui_window_PopupWindow.prototype,{
	_sequence: null
	,startInterface: function(evt) {
		var tmp = this.ui;
		var tmp1 = { tp : "Label", id : "about", tx : com_tilbuci_data_Global.ln.get("window-republish-about"), vr : ""};
		var tmp2 = { tp : "Select", id : "version", vl : [{ text : com_tilbuci_data_Global.ln.get("window-republish-current"), value : "current"},{ text : com_tilbuci_data_Global.ln.get("window-republish-newest"), value : "newest"}], sl : "current"};
		var tmp3 = com_tilbuci_data_Global.ln.get("window-republish-button");
		this.addForm("intr",tmp.forge("interface",[tmp1,tmp2,{ tp : "Spacer", id : "rep", ht : 20, ln : false},{ tp : "Button", id : "rep", tx : tmp3, ac : $bind(this,this.onRepublish)}]));
		this.ui.labels.h["about"].set_wordWrap(true);
		com_tilbuci_ui_window_PopupWindow.prototype.startInterface.call(this);
	}
	,kill: function() {
		com_tilbuci_ui_window_PopupWindow.prototype.kill.call(this);
	}
	,acStart: function() {
		this.ui.setSelectValue("version","current");
	}
	,onRepublish: function(evt) {
		var newest = "false";
		if(this.ui.selects.h["version"].get_selectedItem().value == "newest") {
			newest = "true";
		}
		var tmp = com_tilbuci_data_Global.ws;
		var _g = new haxe_ds_StringMap();
		var value = com_tilbuci_data_GlobalPlayer.movie.get_mvId();
		_g.h["movie"] = value;
		_g.h["newest"] = newest;
		tmp.send("Movie/Republish",_g,$bind(this,this.onReturn));
	}
	,onReturn: function(ok,ld) {
		if(!ok) {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-republish-title"),com_tilbuci_data_Global.ln.get("window-republish-error"),420,150,this.stage);
		} else if(ld.map.h["e"] == 0) {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-republish-title"),com_tilbuci_data_Global.ln.get("window-republish-ok"),420,150,this.stage);
		} else {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-republish-title"),com_tilbuci_data_Global.ln.get("window-republish-error"),420,150,this.stage);
		}
	}
	,__class__: com_tilbuci_ui_window_movie_WindowMovieRepublish
});
var com_tilbuci_ui_window_movie_WindowMovieSequences = function(ac) {
	this._sequence = [];
	com_tilbuci_ui_window_PopupWindow.call(this,ac,com_tilbuci_data_Global.ln.get("window-movieseq-title"),800,com_tilbuci_ui_base_InterfaceFactory.pickValue(630,660),false,true,true);
};
$hxClasses["com.tilbuci.ui.window.movie.WindowMovieSequences"] = com_tilbuci_ui_window_movie_WindowMovieSequences;
com_tilbuci_ui_window_movie_WindowMovieSequences.__name__ = "com.tilbuci.ui.window.movie.WindowMovieSequences";
com_tilbuci_ui_window_movie_WindowMovieSequences.__super__ = com_tilbuci_ui_window_PopupWindow;
com_tilbuci_ui_window_movie_WindowMovieSequences.prototype = $extend(com_tilbuci_ui_window_PopupWindow.prototype,{
	_sequence: null
	,startInterface: function(evt) {
		var order = this.ui.createHContainer("order");
		order.addChild(new com_tilbuci_ui_component_IDButton("orderup",$bind(this,this.onUp),null,openfl_utils_Assets.getBitmapData("btUp"),false));
		order.addChild(new com_tilbuci_ui_component_IDButton("orderdown",$bind(this,this.onDown),null,openfl_utils_Assets.getBitmapData("btDown"),false));
		order.setWidth(360);
		var tmp = com_tilbuci_data_Global.ln.get("window-movieseq-title");
		var tmp1 = this.ui;
		var tmp2 = this.ui;
		var tmp3 = { tp : "Label", id : "scenes", tx : com_tilbuci_data_Global.ln.get("window-movieseq-scenes"), vr : feathers_controls_Label.VARIANT_DETAIL};
		var tmp4 = com_tilbuci_data_Global.ln.get("window-movieseq-add");
		var tmp5 = tmp2.forge("leftcol",[tmp3,{ tp : "List", id : "scenes", vl : [], sl : null, ht : 337},{ tp : "Button", id : "scenes", tx : tmp4, ac : $bind(this,this.onAdd)}]);
		var tmp2 = this.ui;
		var tmp3 = { tp : "Label", id : "sequence", tx : com_tilbuci_data_Global.ln.get("window-movieseq-sequence"), vr : feathers_controls_Label.VARIANT_DETAIL};
		var tmp4 = { tp : "Button", id : "sequenceremove", tx : com_tilbuci_data_Global.ln.get("window-movieseq-remove"), ac : $bind(this,this.onRemove)};
		var tmp6 = com_tilbuci_data_Global.ln.get("window-movieseq-clear");
		var tmp7 = tmp2.forge("rightcol",[tmp3,{ tp : "List", id : "sequence", vl : [], sl : null, ht : 280},{ tp : "Custom", cont : order},tmp4,{ tp : "Button", id : "sequenceclear", tx : tmp6, ac : $bind(this,this.onClear)}]);
		var tmp2 = this.ui;
		var tmp3 = { tp : "Label", id : "direction", tx : com_tilbuci_data_Global.ln.get("window-movieseq-direction"), vr : feathers_controls_Label.VARIANT_DETAIL};
		var tmp4 = { tp : "Select", id : "direction", vl : [{ text : com_tilbuci_data_Global.ln.get("window-movieseq-dirx"), value : "x"},{ text : com_tilbuci_data_Global.ln.get("window-movieseq-diry"), value : "y"},{ text : com_tilbuci_data_Global.ln.get("window-movieseq-dirz"), value : "z"}], sl : "x"};
		var tmp6 = { tp : "Label", id : "connect", tx : com_tilbuci_data_Global.ln.get("window-movieseq-connect"), vr : feathers_controls_Label.VARIANT_DETAIL};
		var tmp8 = com_tilbuci_data_Global.ln.get("window-movieseq-create");
		this.addForm(tmp,tmp1.createColumnHolder("columns",tmp5,tmp7,tmp2.forge("bottom",[tmp3,tmp4,tmp6,{ tp : "Toggle", id : "connect", vl : true},{ tp : "Spacer", id : "connect", ht : 10, ln : false},{ tp : "Button", id : "create", tx : tmp8, ac : $bind(this,this.onCreate)}]),410));
		this.ui.listDbClick("scenes",$bind(this,this.onAdd));
		this.ui.listDbClick("sequence",$bind(this,this.onRemove));
		com_tilbuci_ui_window_PopupWindow.prototype.startInterface.call(this);
	}
	,kill: function() {
		com_tilbuci_ui_window_PopupWindow.prototype.kill.call(this);
	}
	,acStart: function() {
		this.ui.setListValues("scenes",[]);
		this.ui.setListValues("sequence",[]);
		while(this._sequence.length > 0) this._sequence.shift();
		var tmp = com_tilbuci_data_Global.ws;
		var _g = new haxe_ds_StringMap();
		var value = com_tilbuci_data_GlobalPlayer.movie.get_mvId();
		_g.h["movie"] = value;
		tmp.send("Scene/List",_g,$bind(this,this.onList));
	}
	,onAdd: function(evt) {
		if(this.ui.lists.h["scenes"].get_selectedItem() != null) {
			this._sequence.push({ text : this.ui.lists.h["scenes"].get_selectedItem().text, value : this.ui.lists.h["scenes"].get_selectedItem().value});
			this.ui.setListSelectValue("sequence",null);
			this.ui.setListValues("sequence",this._sequence);
			var available = [];
			var _g = 0;
			var _g1 = this.ui.lists.h["scenes"].get_dataProvider().get_length();
			while(_g < _g1) {
				var n = _g++;
				if(this.ui.lists.h["scenes"].get_selectedItem().value != this.ui.lists.h["scenes"].get_dataProvider().get(n).value) {
					available.push({ text : this.ui.lists.h["scenes"].get_dataProvider().get(n).text, value : this.ui.lists.h["scenes"].get_dataProvider().get(n).value});
				}
			}
			this.ui.setListSelectValue("scenes",null);
			this.ui.setListValues("scenes",available);
		}
	}
	,onUp: function(evt) {
		if(this.ui.lists.h["sequence"].get_selectedItem() != null) {
			var index = this.ui.lists.h["sequence"].get_selectedIndex();
			if(index > 0) {
				var val = this.ui.lists.h["sequence"].get_dataProvider().get(index).value;
				var list = [];
				var _g = 0;
				var _g1 = this.ui.lists.h["sequence"].get_dataProvider().get_length();
				while(_g < _g1) {
					var n = _g++;
					if(n == index - 1) {
						list.push({ text : this.ui.lists.h["sequence"].get_dataProvider().get(index).text, value : this.ui.lists.h["sequence"].get_dataProvider().get(index).value});
						list.push({ text : this.ui.lists.h["sequence"].get_dataProvider().get(n).text, value : this.ui.lists.h["sequence"].get_dataProvider().get(n).value});
					} else if(n != index) {
						list.push({ text : this.ui.lists.h["sequence"].get_dataProvider().get(n).text, value : this.ui.lists.h["sequence"].get_dataProvider().get(n).value});
					}
				}
				while(this._sequence.length > 0) this._sequence.shift();
				this._sequence = list;
				this.ui.setListValues("sequence",this._sequence);
				this.ui.setListSelectValue("sequence",val);
			}
		}
	}
	,onDown: function(evt) {
		if(this.ui.lists.h["sequence"].get_selectedItem() != null) {
			var index = this.ui.lists.h["sequence"].get_selectedIndex();
			if(index < this.ui.lists.h["sequence"].get_dataProvider().get_length() - 1) {
				var val = this.ui.lists.h["sequence"].get_dataProvider().get(index).value;
				var list = [];
				var _g = 0;
				var _g1 = this.ui.lists.h["sequence"].get_dataProvider().get_length();
				while(_g < _g1) {
					var n = _g++;
					if(n == index + 1) {
						list.push({ text : this.ui.lists.h["sequence"].get_dataProvider().get(n).text, value : this.ui.lists.h["sequence"].get_dataProvider().get(n).value});
						list.push({ text : this.ui.lists.h["sequence"].get_dataProvider().get(index).text, value : this.ui.lists.h["sequence"].get_dataProvider().get(index).value});
					} else if(n != index) {
						list.push({ text : this.ui.lists.h["sequence"].get_dataProvider().get(n).text, value : this.ui.lists.h["sequence"].get_dataProvider().get(n).value});
					}
				}
				while(this._sequence.length > 0) this._sequence.shift();
				this._sequence = list;
				this.ui.setListValues("sequence",this._sequence);
				this.ui.setListSelectValue("sequence",val);
			}
		}
	}
	,onRemove: function(evt) {
		if(this.ui.lists.h["sequence"].get_selectedItem() != null) {
			var list = [];
			list.push({ text : this.ui.lists.h["sequence"].get_selectedItem().text, value : this.ui.lists.h["sequence"].get_selectedItem().value});
			var _g = 0;
			var _g1 = this.ui.lists.h["scenes"].get_dataProvider().get_length();
			while(_g < _g1) {
				var n = _g++;
				list.push({ text : this.ui.lists.h["scenes"].get_dataProvider().get(n).text, value : this.ui.lists.h["scenes"].get_dataProvider().get(n).value});
			}
			this.ui.setListSelectValue("scenes",null);
			this.ui.setListValues("scenes",list);
			list = [];
			var _g = 0;
			var _g1 = this.ui.lists.h["sequence"].get_dataProvider().get_length();
			while(_g < _g1) {
				var n = _g++;
				if(this.ui.lists.h["sequence"].get_selectedItem().value != this.ui.lists.h["sequence"].get_dataProvider().get(n).value) {
					list.push({ text : this.ui.lists.h["sequence"].get_dataProvider().get(n).text, value : this.ui.lists.h["sequence"].get_dataProvider().get(n).value});
				}
			}
			while(this._sequence.length > 0) this._sequence.shift();
			this._sequence = list;
			this.ui.setListSelectValue("sequence",null);
			this.ui.setListValues("sequence",this._sequence);
		}
	}
	,onClear: function(evt) {
		this.ui.setListValues("scenes",[]);
		this.ui.setListValues("sequence",[]);
		while(this._sequence.length > 0) this._sequence.shift();
		var tmp = com_tilbuci_data_Global.ws;
		var _g = new haxe_ds_StringMap();
		var value = com_tilbuci_data_GlobalPlayer.movie.get_mvId();
		_g.h["movie"] = value;
		tmp.send("Scene/List",_g,$bind(this,this.onList));
	}
	,onCreate: function(evt) {
		if(this._sequence.length > 1) {
			var list = [];
			var _g = 0;
			var _g1 = this._sequence;
			while(_g < _g1.length) {
				var seq = _g1[_g];
				++_g;
				list.push(seq.value);
			}
			var connect = "false";
			if(this.ui.toggles.h["connect"].get_selected()) {
				connect = "true";
			}
			var tmp = com_tilbuci_data_Global.ws;
			var _g = new haxe_ds_StringMap();
			var value = com_tilbuci_data_GlobalPlayer.movie.get_mvId();
			_g.h["movie"] = value;
			var value = list.join(";");
			_g.h["seq"] = value;
			_g.h["con"] = connect;
			var value = this.ui.selects.h["direction"].get_selectedItem().value;
			_g.h["axis"] = value;
			tmp.send("Movie/Navigation",_g,$bind(this,this.onCreated));
		}
	}
	,onCreated: function(ok,ld) {
		if(!ok) {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-movieseq-title"),com_tilbuci_data_Global.ln.get("window-movieseq-error"),420,150,this.stage);
		} else if(ld.map.h["e"] == 0) {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-movieseq-title"),com_tilbuci_data_Global.ln.get("window-movieseq-created"),420,150,this.stage);
		} else {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-movieseq-title"),com_tilbuci_data_Global.ln.get("window-movieseq-error"),420,150,this.stage);
		}
	}
	,onList: function(ok,ld) {
		if(!ok) {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-movieseq-title"),com_tilbuci_data_Global.ln.get("window-movieseq-nolist"),420,150,this.stage);
			feathers_core_PopUpManager.removePopUp(this);
		} else if(ld.map.h["e"] == 0) {
			var ar = ld.map.h["list"];
			if(ar.length > 0) {
				var items = [];
				var _g = 0;
				while(_g < ar.length) {
					var i = ar[_g];
					++_g;
					items.push({ text : Reflect.field(i,"title"), value : Reflect.field(i,"id")});
				}
				this.ui.setListValues("scenes",items);
				this.ui.setListValues("sequences",[]);
				while(this._sequence.length > 0) this._sequence.shift();
			}
		} else {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-movieseq-title"),com_tilbuci_data_Global.ln.get("window-movieseq-nolist"),420,150,this.stage);
			feathers_core_PopUpManager.removePopUp(this);
		}
	}
	,__class__: com_tilbuci_ui_window_movie_WindowMovieSequences
});
var com_tilbuci_ui_window_movie_WindowMovieSnippets = function(ac) {
	this._warn = false;
	com_tilbuci_ui_window_PopupWindow.call(this,ac,com_tilbuci_data_Global.ln.get("window-moviesnip-title"),1100,com_tilbuci_ui_base_InterfaceFactory.pickValue(630,660),false,true,true);
};
$hxClasses["com.tilbuci.ui.window.movie.WindowMovieSnippets"] = com_tilbuci_ui_window_movie_WindowMovieSnippets;
com_tilbuci_ui_window_movie_WindowMovieSnippets.__name__ = "com.tilbuci.ui.window.movie.WindowMovieSnippets";
com_tilbuci_ui_window_movie_WindowMovieSnippets.__super__ = com_tilbuci_ui_window_PopupWindow;
com_tilbuci_ui_window_movie_WindowMovieSnippets.prototype = $extend(com_tilbuci_ui_window_PopupWindow.prototype,{
	_acarea: null
	,_snippets: null
	,_warn: null
	,startInterface: function(evt) {
		var grname = this.ui.createHContainer("grname");
		this.ui.createTInput("grname","","",grname);
		this.ui.createButton("grname",com_tilbuci_data_Global.ln.get("window-moviesnip-savegr"),$bind(this,this.onSaveGr),grname);
		grname.setWidth(510);
		var grhandle = this.ui.createHContainer("grhandle");
		this.ui.createButton("groupdel",com_tilbuci_data_Global.ln.get("window-moviesnip-del"),$bind(this,this.onDel),grhandle);
		this.ui.createButton("groupup",com_tilbuci_data_Global.ln.get("window-moviesnip-upload"),$bind(this,this.onUpload),grhandle);
		this.ui.createButton("groupdown",com_tilbuci_data_Global.ln.get("window-moviesnip-download"),$bind(this,this.onDownload),grhandle);
		grhandle.setWidth(510);
		var snname = this.ui.createHContainer("snname");
		this.ui.createTInput("name","","",snname);
		this.ui.createButton("name",com_tilbuci_data_Global.ln.get("window-moviesnip-setcode"),$bind(this,this.onSetCode),snname);
		snname.setWidth(510);
		this._acarea = new com_tilbuci_ui_component_ActionArea(510,442);
		var tmp = com_tilbuci_data_Global.ln.get("window-moviesnip-title");
		var tmp1 = this.ui;
		var tmp2 = this.ui;
		var tmp3 = { tp : "Label", id : "groups", tx : com_tilbuci_data_Global.ln.get("window-moviesnip-available"), vr : feathers_controls_Label.VARIANT_DETAIL};
		var tmp4 = { tp : "Label", id : "snippets", tx : com_tilbuci_data_Global.ln.get("window-moviesnip-snippets"), vr : feathers_controls_Label.VARIANT_DETAIL};
		var tmp5 = com_tilbuci_data_Global.ln.get("window-moviesnip-delsnip");
		var tmp6 = tmp2.forge("leftcol",[tmp3,{ tp : "List", id : "groups", vl : [], sl : null, ht : 150, ch : $bind(this,this.onLoad)},{ tp : "Custom", cont : grname},{ tp : "Custom", cont : grhandle},{ tp : "Spacer", id : "groups", ht : 15, ln : true},tmp4,{ tp : "List", id : "snippets", vl : [], sl : null, ht : 247, ch : $bind(this,this.onLoadSnip)},{ tp : "Button", id : "snippetsdel", tx : tmp5, ac : $bind(this,this.onDelSnip)}]);
		var tmp2 = this.ui;
		var tmp3 = { tp : "Label", id : "code", tx : com_tilbuci_data_Global.ln.get("window-moviesnip-code"), vr : feathers_controls_Label.VARIANT_DETAIL};
		var tmp4 = { tp : "Custom", cont : this._acarea};
		var tmp5 = { tp : "Label", id : "name", tx : com_tilbuci_data_Global.ln.get("window-moviesnip-name"), vr : feathers_controls_Label.VARIANT_DETAIL};
		var tmp7 = com_tilbuci_data_Global.ln.get("window-moviesnip-clear");
		this.addForm(tmp,tmp1.createColumnHolder("columns",tmp6,tmp2.forge("rightcol",[tmp3,tmp4,{ tp : "Spacer", id : "code", ht : 10, ln : false},tmp5,{ tp : "Custom", cont : snname},{ tp : "Button", id : "set", tx : tmp7, ac : $bind(this,this.onClear)}])));
		this.ui.listDbClick("snippets",$bind(this,this.onLoadSnip));
		com_tilbuci_ui_window_PopupWindow.prototype.startInterface.call(this);
	}
	,kill: function() {
		com_tilbuci_ui_window_PopupWindow.prototype.kill.call(this);
	}
	,acStart: function() {
		this.ui.hcontainers.h["grname"].setWidth(510);
		this.ui.hcontainers.h["grhandle"].setWidth(510);
		this.ui.hcontainers.h["snname"].setWidth(510);
		this._acarea.setText("");
		this.ui.setListValues("groups",[]);
		this.ui.setListSelectValue("groups",null);
		this.ui.setListValues("snippets",[]);
		this.ui.setListSelectValue("snippets",null);
		this.ui.inputs.h["name"].set_text("");
		this.ui.inputs.h["grname"].set_text("");
		this._snippets = new haxe_ds_StringMap();
		var tmp = com_tilbuci_data_Global.ws;
		var _g = new haxe_ds_StringMap();
		var value = com_tilbuci_data_GlobalPlayer.movie.get_mvId();
		_g.h["movie"] = value;
		tmp.send("Movie/ListSnippets",_g,$bind(this,this.onList));
	}
	,onList: function(ok,ld) {
		if(!ok) {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-moviesnip-title"),com_tilbuci_data_Global.ln.get("window-moviesnip-nosnippets"),420,150,this.stage);
		} else if(ld.map.h["e"] == 0) {
			var ar = ld.map.h["list"];
			if(ar != null) {
				var list = [];
				var _g = 0;
				while(_g < ar.length) {
					var l = ar[_g];
					++_g;
					list.push({ text : l, value : l});
				}
				this.ui.setListValues("groups",list);
			}
		} else {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-moviesnip-title"),com_tilbuci_data_Global.ln.get("window-moviesnip-nosnippets"),420,150,this.stage);
		}
	}
	,onLoad: function(evt) {
		if(this.ui.lists.h["groups"].get_selectedItem() != null) {
			var tmp = com_tilbuci_data_Global.ws;
			var _g = new haxe_ds_StringMap();
			var value = com_tilbuci_data_GlobalPlayer.movie.get_mvId();
			_g.h["movie"] = value;
			var value = this.ui.lists.h["groups"].get_selectedItem().value;
			_g.h["name"] = value;
			tmp.send("Movie/LoadSnippets",_g,$bind(this,this.onLoaded));
		}
	}
	,onLoaded: function(ok,ld) {
		if(!ok) {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-moviesnip-title"),com_tilbuci_data_Global.ln.get("window-moviesnip-notfound"),420,150,this.stage);
		} else if(ld.map.h["e"] == 0) {
			var code = ld.map.h["code"];
			if(code == null) {
				this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-moviesnip-title"),com_tilbuci_data_Global.ln.get("window-moviesnip-noload"),420,150,this.stage);
			} else {
				var map = com_tilbuci_statictools_StringStatic.jsonAsMap(code);
				if(Lambda.count(map) == 0) {
					this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-moviesnip-title"),com_tilbuci_data_Global.ln.get("window-moviesnip-noload"),420,150,this.stage);
				} else {
					var list = [];
					this._snippets = new haxe_ds_StringMap();
					var h = map.h;
					var k_h = h;
					var k_keys = Object.keys(h);
					var k_length = k_keys.length;
					var k_current = 0;
					while(k_current < k_length) {
						var k = k_keys[k_current++];
						list.push({ text : k, value : k});
						var v = map.h[k];
						this._snippets.h[k] = v;
					}
					this.ui.setListValues("snippets",list);
					this.ui.setListSelectValue("snippets",null);
					this.ui.inputs.h["name"].set_text("");
					this._acarea.setText("");
					this.ui.inputs.h["grname"].set_text(this.ui.lists.h["groups"].get_selectedItem().value);
				}
			}
		} else {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-moviesnip-title"),com_tilbuci_data_Global.ln.get("window-moviesnip-noload"),420,150,this.stage);
		}
	}
	,onDel: function(evt) {
		if(this.ui.lists.h["groups"].get_selectedItem() != null) {
			this.ui.createConfirm(com_tilbuci_data_Global.ln.get("window-moviesnip-title"),com_tilbuci_data_Global.ln.get("window-moviesnip-delconfirm"),320,240,$bind(this,this.onRemoveConfirm),com_tilbuci_data_Global.ln.get("default-ok"),com_tilbuci_data_Global.ln.get("default-cancel"),this.stage);
		}
	}
	,onRemoveConfirm: function(ok) {
		if(ok) {
			var tmp = com_tilbuci_data_Global.ws;
			var _g = new haxe_ds_StringMap();
			var value = com_tilbuci_data_GlobalPlayer.movie.get_mvId();
			_g.h["movie"] = value;
			var value = this.ui.lists.h["groups"].get_selectedItem().value;
			_g.h["name"] = value;
			tmp.send("Movie/RemoveSnippets",_g,$bind(this,this.onRemoved));
		}
	}
	,onRemoved: function(ok,ld) {
		if(!ok) {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-moviesnip-title"),com_tilbuci_data_Global.ln.get("window-moviesnip-nosnippets"),420,150,this.stage);
		} else if(ld.map.h["e"] == 0) {
			var ar = ld.map.h["list"];
			if(ar != null) {
				var list = [];
				var _g = 0;
				while(_g < ar.length) {
					var l = ar[_g];
					++_g;
					list.push({ text : l, value : l});
				}
				this.ui.setListValues("groups",list);
				this.ui.setListSelectValue("groups",null);
				this.ui.setListValues("snippets",[]);
				this.ui.setListSelectValue("snippets",null);
				this.ui.inputs.h["name"].set_text("");
				this.ui.inputs.h["grname"].set_text("");
				this._acarea.setText("");
				this._snippets = new haxe_ds_StringMap();
			}
		} else {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-moviesnip-title"),com_tilbuci_data_Global.ln.get("window-moviesnip-nosnippets"),420,150,this.stage);
		}
	}
	,onUpload: function(evt) {
		if(!this._warn) {
			this._warn = true;
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-moviesnip-title"),com_tilbuci_data_Global.ln.get("window-moviesnip-files"),420,180,this.stage);
		} else {
			com_tilbuci_data_Global.up.browseForMedia($bind(this,this.onFileSelected),"snippets");
		}
	}
	,onFileSelected: function(ok) {
		if(ok) {
			var tmp = com_tilbuci_data_Global.up;
			var _g = new haxe_ds_StringMap();
			var value = com_tilbuci_data_GlobalPlayer.movie.get_mvId();
			_g.h["movie"] = value;
			_g.h["type"] = "snippets";
			_g.h["path"] = "";
			tmp.uploadMedia($bind(this,this.onUploadReturn),_g);
		}
	}
	,onUploadReturn: function(ok,data) {
		if(ok) {
			this.ui.hcontainers.h["grname"].setWidth(510);
			this.ui.hcontainers.h["grhandle"].setWidth(510);
			this.ui.hcontainers.h["snname"].setWidth(510);
			this._acarea.setText("");
			this.ui.setListValues("groups",[]);
			this.ui.setListSelectValue("groups",null);
			this.ui.setListValues("snippets",[]);
			this.ui.setListSelectValue("snippets",null);
			this.ui.inputs.h["name"].set_text("");
			this.ui.inputs.h["grname"].set_text("");
			this._snippets = new haxe_ds_StringMap();
			var tmp = com_tilbuci_data_Global.ws;
			var _g = new haxe_ds_StringMap();
			var value = com_tilbuci_data_GlobalPlayer.movie.get_mvId();
			_g.h["movie"] = value;
			tmp.send("Movie/ListSnippets",_g,$bind(this,this.onList));
		} else {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-moviesnip-title"),com_tilbuci_data_Global.ln.get("window-moviesnip-erupload"),420,150,this.stage);
		}
	}
	,onDownload: function(evt) {
		if(!this._warn) {
			this._warn = true;
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-moviesnip-title"),com_tilbuci_data_Global.ln.get("window-moviesnip-files"),420,180,this.stage);
		} else if(this.ui.lists.h["groups"].get_selectedItem() != null) {
			var tmp = com_tilbuci_data_Global.ws;
			var _g = new haxe_ds_StringMap();
			_g.h["file"] = "snippets";
			var value = this.ui.lists.h["groups"].get_selectedItem().value;
			_g.h["media"] = value;
			var value = com_tilbuci_data_GlobalPlayer.movie.get_mvId();
			_g.h["movie"] = value;
			tmp.download(_g);
		}
	}
	,onLoadSnip: function(evt) {
		if(this.ui.lists.h["snippets"].get_selectedItem() != null) {
			var this1 = this._snippets;
			var key = this.ui.lists.h["snippets"].get_selectedItem().value;
			if(Object.prototype.hasOwnProperty.call(this1.h,key)) {
				this.ui.inputs.h["name"].set_text(this.ui.lists.h["snippets"].get_selectedItem().value);
				var tmp = this._acarea;
				var this1 = this._snippets;
				var key = this.ui.lists.h["snippets"].get_selectedItem().value;
				tmp.setText(this1.h[key]);
			}
		}
	}
	,onDelSnip: function(evt) {
		if(this.ui.lists.h["snippets"].get_selectedItem() != null) {
			this.ui.createConfirm(com_tilbuci_data_Global.ln.get("window-moviesnip-title"),com_tilbuci_data_Global.ln.get("window-moviesnip-delsnconfirm"),320,240,$bind(this,this.onRemoveSnConfirm),com_tilbuci_data_Global.ln.get("default-ok"),com_tilbuci_data_Global.ln.get("default-cancel"),this.stage);
		}
	}
	,onRemoveSnConfirm: function(ok) {
		if(ok) {
			var this1 = this._snippets;
			var key = this.ui.lists.h["snippets"].get_selectedItem().value;
			if(Object.prototype.hasOwnProperty.call(this1.h,key)) {
				var this1 = this._snippets;
				var key = this.ui.lists.h["snippets"].get_selectedItem().value;
				var _this = this1;
				if(Object.prototype.hasOwnProperty.call(_this.h,key)) {
					delete(_this.h[key]);
				}
				this.updateSnippetsList();
			}
		}
	}
	,onSetCode: function(evt) {
		if(StringTools.replace(this.ui.inputs.h["name"].get_text()," ","").length < 3) {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-moviesnip-title"),com_tilbuci_data_Global.ln.get("window-moviesnip-shortsnname"),420,150,this.stage);
		} else {
			var actext = this._acarea.getText();
			if(actext != "") {
				var this1 = this._snippets;
				var k = StringTools.replace(this.ui.inputs.h["name"].get_text()," ","");
				this1.h[k] = actext;
				this._acarea.setText("");
				this.ui.inputs.h["name"].set_text("");
				this.updateSnippetsList();
			}
		}
	}
	,onClear: function(evt) {
		this._acarea.setText("");
		this.ui.inputs.h["name"].set_text("");
		this.updateSnippetsList();
	}
	,updateSnippetsList: function() {
		var list = [];
		var h = this._snippets.h;
		var k_h = h;
		var k_keys = Object.keys(h);
		var k_length = k_keys.length;
		var k_current = 0;
		while(k_current < k_length) {
			var k = k_keys[k_current++];
			list.push({ text : k, value : k});
		}
		this.ui.setListValues("snippets",list);
		this.ui.setListSelectValue("snippets",null);
	}
	,onSaveGr: function(evt) {
		if(StringTools.replace(this.ui.inputs.h["grname"].get_text()," ","").length < 3) {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-moviesnip-title"),com_tilbuci_data_Global.ln.get("window-moviesnip-shortgrname"),420,150,this.stage);
		} else if(Lambda.count(this._snippets) < 1) {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-moviesnip-title"),com_tilbuci_data_Global.ln.get("window-moviesnip-nogrsnip"),420,150,this.stage);
		} else {
			var tmp = com_tilbuci_data_Global.ws;
			var _g = new haxe_ds_StringMap();
			var value = com_tilbuci_data_GlobalPlayer.movie.get_mvId();
			_g.h["movie"] = value;
			var value = StringTools.replace(this.ui.inputs.h["grname"].get_text()," ","");
			_g.h["name"] = value;
			var value = com_tilbuci_statictools_StringStatic.jsonStringify(this._snippets);
			_g.h["code"] = value;
			tmp.send("Movie/SaveSnippets",_g,$bind(this,this.onGrSaved));
		}
	}
	,onGrSaved: function(ok,ld) {
		if(!ok) {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-moviesnip-title"),com_tilbuci_data_Global.ln.get("window-moviesnip-nosnippets"),420,150,this.stage);
		} else if(ld.map.h["e"] == 0) {
			this.ui.setListValues("groups",[]);
			this.ui.setListSelectValue("groups",null);
			this.ui.setListValues("snippets",[]);
			this.ui.setListSelectValue("snippets",null);
			this.ui.inputs.h["name"].set_text("");
			this._acarea.setText("");
			this.ui.inputs.h["grname"].set_text("");
			var ar = ld.map.h["list"];
			if(ar != null) {
				var list = [];
				var _g = 0;
				while(_g < ar.length) {
					var l = ar[_g];
					++_g;
					list.push({ text : l, value : l});
				}
				this.ui.setListValues("groups",list);
			}
		} else {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-moviesnip-title"),com_tilbuci_data_Global.ln.get("window-moviesnip-nosnippets"),420,150,this.stage);
		}
	}
	,__class__: com_tilbuci_ui_window_movie_WindowMovieSnippets
});
var com_tilbuci_ui_window_movie_WindowMovieUsers = function(ac) {
	com_tilbuci_ui_window_PopupWindow.call(this,ac,com_tilbuci_data_Global.ln.get("window-movieusers-title"),700,com_tilbuci_ui_base_InterfaceFactory.pickValue(580,420),true,true,true);
};
$hxClasses["com.tilbuci.ui.window.movie.WindowMovieUsers"] = com_tilbuci_ui_window_movie_WindowMovieUsers;
com_tilbuci_ui_window_movie_WindowMovieUsers.__name__ = "com.tilbuci.ui.window.movie.WindowMovieUsers";
com_tilbuci_ui_window_movie_WindowMovieUsers.__super__ = com_tilbuci_ui_window_PopupWindow;
com_tilbuci_ui_window_movie_WindowMovieUsers.prototype = $extend(com_tilbuci_ui_window_PopupWindow.prototype,{
	startInterface: function(evt) {
		var tmp = com_tilbuci_data_Global.ln.get("window-movieusers-collaborators");
		var tmp1 = this.ui;
		var tmp2 = { tp : "Label", id : "colabout", tx : com_tilbuci_data_Global.ln.get("window-movieusers-colabout"), vr : feathers_controls_Label.VARIANT_DETAIL};
		var tmp3 = { tp : "Button", id : "colrem", tx : com_tilbuci_data_Global.ln.get("window-movieusers-colrem"), ac : $bind(this,this.onColRem)};
		var tmp4 = { tp : "Label", id : "colnew", tx : com_tilbuci_data_Global.ln.get("window-movieusers-colnew"), vr : feathers_controls_Label.VARIANT_DETAIL};
		var tmp5 = com_tilbuci_data_Global.ln.get("window-movieusers-coladd");
		this.addForm(tmp,tmp1.forge("colab",[tmp2,{ tp : "List", id : "collist", vl : [], ht : 120, sl : ""},tmp3,{ tp : "Spacer", id : "themespacer", ht : 20, ln : false},tmp4,{ tp : "TInput", id : "colnew", tx : "", vr : ""},{ tp : "Button", id : "coladd", tx : tmp5, ac : $bind(this,this.onColAdd)}]));
		var tmp = com_tilbuci_data_Global.ln.get("window-movieusers-owner");
		var tmp1 = this.ui;
		var tmp2 = { tp : "Label", id : "colabout", tx : com_tilbuci_data_Global.ln.get("window-movieusers-ownerabout"), vr : feathers_controls_Label.VARIANT_DETAIL, wrap : true};
		var tmp3 = { tp : "Label", id : "ownernew", tx : com_tilbuci_data_Global.ln.get("window-movieusers-ownernew"), vr : feathers_controls_Label.VARIANT_DETAIL};
		var tmp4 = { tp : "Label", id : "ownernew", tx : com_tilbuci_data_Global.ln.get("window-movieusers-ownernew2"), vr : feathers_controls_Label.VARIANT_DETAIL};
		var tmp5 = com_tilbuci_data_Global.ln.get("window-movieusers-ownerchange");
		this.addForm(tmp,tmp1.forge("owner",[tmp2,{ tp : "Spacer", id : "themespacer", ht : 20, ln : false},tmp3,{ tp : "TInput", id : "ownernew", tx : "", vr : ""},tmp4,{ tp : "TInput", id : "ownernew2", tx : "", vr : ""},{ tp : "Spacer", id : "themespacer2", ht : 80, ln : false},{ tp : "Button", id : "ownerchange", tx : tmp5, ac : $bind(this,this.onChangeOwner)}]));
		var tmp = com_tilbuci_data_Global.ln.get("window-movieusers-lock");
		var tmp1 = this.ui;
		var tmp2 = { tp : "Label", id : "unlock", tx : com_tilbuci_data_Global.ln.get("window-movieusers-unlockabout"), vr : "", wrap : true};
		var tmp3 = com_tilbuci_data_Global.ln.get("window-movieusers-unlock");
		this.addForm(tmp,tmp1.forge("lock",[tmp2,{ tp : "Spacer", id : "unlock", ht : 20, ln : false},{ tp : "Button", id : "unlock", tx : tmp3, ac : $bind(this,this.onUnlock)}]));
		com_tilbuci_ui_window_PopupWindow.prototype.startInterface.call(this);
	}
	,kill: function() {
		com_tilbuci_ui_window_PopupWindow.prototype.kill.call(this);
	}
	,acStart: function() {
		var tmp = com_tilbuci_data_Global.ws;
		var _g = new haxe_ds_StringMap();
		var value = com_tilbuci_data_GlobalPlayer.movie.get_mvId();
		_g.h["id"] = value;
		tmp.send("Movie/Collaborators",_g,$bind(this,this.onList));
	}
	,onList: function(ok,ld) {
		if(!ok) {
			this.ui.setListValues("collist",[]);
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-movieusers-title"),com_tilbuci_data_Global.ln.get("window-movieusers-errorlist"),300,150,this.stage);
		} else if(ld.map.h["e"] == 0) {
			var ar = [];
			var _g = 0;
			var _g1 = Reflect.fields(ld.map.h["list"]);
			while(_g < _g1.length) {
				var us = _g1[_g];
				++_g;
				ar.push({ text : Reflect.field(ld.map.h["list"],us), value : Reflect.field(ld.map.h["list"],us)});
			}
			this.ui.setListValues("collist",ar);
		} else {
			this.ui.setListValues("collist",[]);
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-movieusers-title"),com_tilbuci_data_Global.ln.get("window-movieusers-errorlist"),300,150,this.stage);
		}
		this.ui.inputs.h["colnew"].set_text("");
	}
	,onColAdd: function(evt) {
		if(this.ui.inputs.h["colnew"].get_text() != "") {
			var tmp = com_tilbuci_data_Global.ws;
			var _g = new haxe_ds_StringMap();
			var value = com_tilbuci_data_GlobalPlayer.movie.get_mvId();
			_g.h["id"] = value;
			var value = this.ui.inputs.h["colnew"].get_text();
			_g.h["email"] = value;
			tmp.send("Movie/CollaboratorAdd",_g,$bind(this,this.onList));
		}
	}
	,onColRem: function(evt) {
		if(this.ui.lists.h["collist"].get_selectedItem() != null) {
			var tmp = com_tilbuci_data_Global.ws;
			var _g = new haxe_ds_StringMap();
			var value = com_tilbuci_data_GlobalPlayer.movie.get_mvId();
			_g.h["id"] = value;
			var value = this.ui.lists.h["collist"].get_selectedItem().text;
			_g.h["email"] = value;
			tmp.send("Movie/CollaboratorRemove",_g,$bind(this,this.onList));
		}
	}
	,onChangeOwner: function(evt) {
		if(this.ui.inputs.h["ownernew"].get_text() != "") {
			if(this.ui.inputs.h["ownernew"].get_text() != this.ui.inputs.h["ownernew2"].get_text()) {
				this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-movieusers-title"),com_tilbuci_data_Global.ln.get("window-movieusers-ownermatch"),300,180,this.stage);
			} else {
				var tmp = com_tilbuci_data_Global.ws;
				var _g = new haxe_ds_StringMap();
				var value = com_tilbuci_data_GlobalPlayer.movie.get_mvId();
				_g.h["id"] = value;
				var value = this.ui.inputs.h["ownernew"].get_text();
				_g.h["email"] = value;
				tmp.send("Movie/OwnerChange",_g,$bind(this,this.onOwner));
			}
		}
	}
	,onUnlock: function(evt) {
		var tmp = com_tilbuci_data_Global.ws;
		var _g = new haxe_ds_StringMap();
		var value = com_tilbuci_data_GlobalPlayer.movie.get_mvId();
		_g.h["id"] = value;
		tmp.send("Movie/UnlockScenes",_g,$bind(this,this.onUnlockReturn));
	}
	,onOwner: function(ok,ld) {
		if(!ok) {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-movieusers-title"),com_tilbuci_data_Global.ln.get("window-movieusers-ownererror"),300,180,this.stage);
		} else if(ld.map.h["e"] == 0) {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-movieusers-title"),com_tilbuci_data_Global.ln.get("window-movieusers-ownerok"),300,180,this.stage);
		} else if(ld.map.h["e"] == 2) {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-movieusers-title"),com_tilbuci_data_Global.ln.get("window-movieusers-ownernomail"),300,180,this.stage);
		} else {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-movieusers-title"),com_tilbuci_data_Global.ln.get("window-movieusers-ownererror"),300,180,this.stage);
		}
	}
	,onUnlockReturn: function(ok,ld) {
		if(!ok) {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-movieusers-title"),com_tilbuci_data_Global.ln.get("window-movieusers-erlock"),300,180,this.stage);
		} else if(ld.map.h["e"] == 0) {
			com_tilbuci_data_Global.showMsg(com_tilbuci_data_Global.ln.get("window-movieusers-oklock"));
		} else {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-movieusers-title"),com_tilbuci_data_Global.ln.get("window-movieusers-erlock"),300,180,this.stage);
		}
	}
	,__class__: com_tilbuci_ui_window_movie_WindowMovieUsers
});
var com_tilbuci_ui_window_narrative_WindowDiagChar = function(ac) {
	this._diagchange = null;
	this._folderchange = null;
	this._haschange = false;
	this._lines = [];
	this._collections = new haxe_ds_StringMap();
	this._list = new haxe_ds_StringMap();
	com_tilbuci_ui_window_PopupWindow.call(this,ac,com_tilbuci_data_Global.ln.get("window-narrdiag-title"),1200,com_tilbuci_ui_base_InterfaceFactory.pickValue(670,710),false,true,true);
};
$hxClasses["com.tilbuci.ui.window.narrative.WindowDiagChar"] = com_tilbuci_ui_window_narrative_WindowDiagChar;
com_tilbuci_ui_window_narrative_WindowDiagChar.__name__ = "com.tilbuci.ui.window.narrative.WindowDiagChar";
com_tilbuci_ui_window_narrative_WindowDiagChar.__super__ = com_tilbuci_ui_window_PopupWindow;
com_tilbuci_ui_window_narrative_WindowDiagChar.prototype = $extend(com_tilbuci_ui_window_PopupWindow.prototype,{
	_list: null
	,_collections: null
	,_lines: null
	,_haschange: null
	,_folderchange: null
	,_diagchange: null
	,startInterface: function(evt) {
		this.ui.createHContainer("folderbt");
		this.ui.createTInput("folderbtname","","",this.ui.hcontainers.h["folderbt"],false);
		this.ui.createButton("folderbtadd",com_tilbuci_data_Global.ln.get("window-narrdiag-add"),$bind(this,this.addFolder),this.ui.hcontainers.h["folderbt"]);
		this.ui.createButton("folderbtrename",com_tilbuci_data_Global.ln.get("window-narrdiag-rename"),$bind(this,this.renameFolder),this.ui.hcontainers.h["folderbt"]);
		this.ui.createButton("folderbtremove",com_tilbuci_data_Global.ln.get("window-narrdiag-remove"),$bind(this,this.removeFolder),this.ui.hcontainers.h["folderbt"]);
		this.ui.hcontainers.h["folderbt"].setWidth(560,[260,90,90,90]);
		this.ui.createHContainer("fdialogs");
		this.ui.createTInput("fdialogsname","","",this.ui.hcontainers.h["fdialogs"],false);
		this.ui.createButton("fdialogsadd",com_tilbuci_data_Global.ln.get("window-narrdiag-add"),$bind(this,this.addDialogue),this.ui.hcontainers.h["fdialogs"]);
		this.ui.createButton("fdialogsrename",com_tilbuci_data_Global.ln.get("window-narrdiag-rename"),$bind(this,this.renameDialogue),this.ui.hcontainers.h["fdialogs"]);
		this.ui.createButton("fdialogsremove",com_tilbuci_data_Global.ln.get("window-narrdiag-remove"),$bind(this,this.removeDialogue),this.ui.hcontainers.h["fdialogs"]);
		this.ui.hcontainers.h["fdialogs"].setWidth(560,[260,90,90,90]);
		this.ui.createHContainer("insttext");
		this.ui.createLabel("insttext",com_tilbuci_data_Global.ln.get("window-narrdiag-insttext"),"detail",this.ui.hcontainers.h["insttext"]);
		this.ui.createTInput("insttext","","",this.ui.hcontainers.h["insttext"],false,$bind(this,this.setChange));
		this.ui.createHContainer("instname");
		this.ui.createLabel("instname",com_tilbuci_data_Global.ln.get("window-narrdiag-instname"),"detail",this.ui.hcontainers.h["instname"]);
		this.ui.createTInput("instname","","",this.ui.hcontainers.h["instname"],false,$bind(this,this.setChange));
		this.ui.createHContainer("instexpr");
		this.ui.createLabel("instexpr",com_tilbuci_data_Global.ln.get("window-narrdiag-instexpr"),"detail",this.ui.hcontainers.h["instexpr"]);
		this.ui.createTInput("instexpr","","",this.ui.hcontainers.h["instexpr"],false,$bind(this,this.setChange));
		this.ui.createContainer("output");
		this.ui.createLabel("output",com_tilbuci_data_Global.ln.get("window-narrdiag-outinstances"),"detail",this.ui.containers.h["output"]);
		this.ui.containers.h["output"].addChild(this.ui.hcontainers.h["insttext"]);
		this.ui.containers.h["output"].addChild(this.ui.hcontainers.h["instname"]);
		this.ui.containers.h["output"].addChild(this.ui.hcontainers.h["instexpr"]);
		this.ui.createHContainer("navprev");
		this.ui.createLabel("navprev",com_tilbuci_data_Global.ln.get("window-narrdiag-navprev"),"detail",this.ui.hcontainers.h["navprev"]);
		this.ui.createTInput("navprev","","",this.ui.hcontainers.h["navprev"],false,$bind(this,this.setChange));
		this.ui.createHContainer("navnext");
		this.ui.createLabel("navnext",com_tilbuci_data_Global.ln.get("window-narrdiag-navnext"),"detail",this.ui.hcontainers.h["navnext"]);
		this.ui.createTInput("navnext","","",this.ui.hcontainers.h["navnext"],false,$bind(this,this.setChange));
		this.ui.createHContainer("navend");
		this.ui.createLabel("navend",com_tilbuci_data_Global.ln.get("window-narrdiag-navend"),"detail",this.ui.hcontainers.h["navend"]);
		this.ui.createTInput("navend","","",this.ui.hcontainers.h["navend"],false,$bind(this,this.setChange));
		this.ui.createContainer("navigation");
		this.ui.createLabel("navigation",com_tilbuci_data_Global.ln.get("window-narrdiag-navinstances"),"detail",this.ui.containers.h["navigation"]);
		this.ui.containers.h["navigation"].addChild(this.ui.hcontainers.h["navprev"]);
		this.ui.containers.h["navigation"].addChild(this.ui.hcontainers.h["navnext"]);
		this.ui.containers.h["navigation"].addChild(this.ui.hcontainers.h["navend"]);
		this.ui.createHContainer("instances");
		this.ui.hcontainers.h["instances"].addChild(this.ui.containers.h["output"]);
		this.ui.hcontainers.h["instances"].addChild(this.ui.containers.h["navigation"]);
		this.ui.createHContainer("lineorder");
		var tmp = this.ui;
		var tmp1 = openfl_utils_Assets.getBitmapData("btUp");
		var tmp2 = this.ui.hcontainers.h["lineorder"];
		tmp.createIconButton("orderup",$bind(this,this.onUp),new openfl_display_Bitmap(tmp1),null,tmp2,false);
		var tmp = this.ui;
		var tmp1 = openfl_utils_Assets.getBitmapData("btDown");
		var tmp2 = this.ui.hcontainers.h["lineorder"];
		tmp.createIconButton("orderdown",$bind(this,this.onDown),new openfl_display_Bitmap(tmp1),null,tmp2,false);
		var tmp = this.ui;
		var tmp1 = openfl_utils_Assets.getBitmapData("btDel");
		var tmp2 = this.ui.hcontainers.h["lineorder"];
		tmp.createIconButton("linerem",$bind(this,this.onRemLine),new openfl_display_Bitmap(tmp1),null,tmp2,false);
		this.ui.createHContainer("text");
		this.ui.createLabel("text",com_tilbuci_data_Global.ln.get("window-narrdiag-text"),"detail",this.ui.hcontainers.h["text"]);
		this.ui.createTInput("text","","",this.ui.hcontainers.h["text"],false);
		this.ui.createHContainer("character");
		this.ui.createLabel("character",com_tilbuci_data_Global.ln.get("window-narrdiag-character"),"detail",this.ui.hcontainers.h["character"]);
		this.ui.createSelect("character",[],null,this.ui.hcontainers.h["character"]);
		this.ui.selects.h["character"].addEventListener("change",$bind(this,this.onCharacterChange));
		this.ui.createHContainer("asset");
		this.ui.createLabel("asset",com_tilbuci_data_Global.ln.get("window-narrdiag-asset"),"detail",this.ui.hcontainers.h["asset"]);
		this.ui.createSelect("asset",[],null,this.ui.hcontainers.h["asset"]);
		this.ui.createHContainer("audio");
		this.ui.createLabel("audio",com_tilbuci_data_Global.ln.get("window-narrdiag-audio"),"detail",this.ui.hcontainers.h["audio"]);
		this.ui.createTInput("audio","","",this.ui.hcontainers.h["audio"],false);
		var tmp = this.ui;
		var tmp1 = openfl_utils_Assets.getBitmapData("btOpenfile");
		var tmp2 = this.ui.hcontainers.h["audio"];
		tmp.createIconButton("audio",$bind(this,this.acAudio),new openfl_display_Bitmap(tmp1),null,tmp2,false);
		var tmp = this.ui;
		var tmp1 = openfl_utils_Assets.getBitmapData("btDel");
		var tmp2 = this.ui.hcontainers.h["audio"];
		tmp.createIconButton("audiodel",$bind(this,this.acAudiodel),new openfl_display_Bitmap(tmp1),null,tmp2,false);
		this.ui.inputs.h["audio"].set_enabled(false);
		this.ui.createHContainer("lbuttons");
		this.ui.createButton("lineadd",com_tilbuci_data_Global.ln.get("window-narrdiag-lineadd"),$bind(this,this.onAddLine),this.ui.hcontainers.h["lbuttons"]);
		this.ui.createButton("lineedit",com_tilbuci_data_Global.ln.get("window-narrdiag-lineedit"),$bind(this,this.onEditLine),this.ui.hcontainers.h["lbuttons"]);
		var tmp = com_tilbuci_data_Global.ln.get("window-narrdiag-title");
		var tmp1 = this.ui;
		var tmp2 = this.ui;
		var tmp3 = { tp : "Label", id : "folders", tx : com_tilbuci_data_Global.ln.get("window-narrdiag-folders"), vr : "detail"};
		var tmp4 = { tp : "Label", id : "foldername", tx : com_tilbuci_data_Global.ln.get("window-narrdiag-foldername"), vr : "detail"};
		var tmp5 = { tp : "Custom", cont : this.ui.hcontainers.h["folderbt"]};
		var tmp6 = { tp : "Label", id : "fdialogs", tx : com_tilbuci_data_Global.ln.get("window-narrdiag-fdialogs"), vr : "detail"};
		var tmp7 = { tp : "List", id : "fdialogs", vl : [], sl : null, ht : com_tilbuci_ui_base_InterfaceFactory.pickValue(227,241), ch : $bind(this,this.onDiagChange)};
		var tmp8 = com_tilbuci_data_Global.ln.get("window-narrdiag-dialoguesname");
		var tmp9 = tmp2.forge("leftcol",[tmp3,{ tp : "List", id : "folders", vl : [], sl : null, ht : 150, ch : $bind(this,this.onFolderChange)},tmp4,tmp5,{ tp : "Spacer", id : "add", ht : 15, ln : true},tmp6,tmp7,{ tp : "Label", id : "dialogname", tx : tmp8, vr : "detail"},{ tp : "Custom", cont : this.ui.hcontainers.h["fdialogs"]}]);
		var tmp2 = this.ui;
		var tmp3 = { tp : "Custom", cont : this.ui.hcontainers.h["instances"]};
		var tmp4 = { tp : "Label", id : "lines", tx : com_tilbuci_data_Global.ln.get("window-narrdiag-lines"), vr : "detail"};
		var tmp5 = { tp : "List", id : "lines", vl : [], sl : null, ht : com_tilbuci_ui_base_InterfaceFactory.pickValue(150,130), ch : $bind(this,this.onChangeLine)};
		var tmp6 = { tp : "Custom", cont : this.ui.hcontainers.h["lineorder"]};
		var tmp7 = { tp : "Custom", cont : this.ui.hcontainers.h["text"]};
		var tmp8 = { tp : "Custom", cont : this.ui.hcontainers.h["character"]};
		var tmp10 = { tp : "Custom", cont : this.ui.hcontainers.h["asset"]};
		var tmp11 = { tp : "Custom", cont : this.ui.hcontainers.h["audio"]};
		var tmp12 = { tp : "Custom", cont : this.ui.hcontainers.h["lbuttons"]};
		var tmp13 = com_tilbuci_data_Global.ln.get("window-narrdiag-savediag");
		this.addForm(tmp,tmp1.createColumnHolder("columns",tmp9,tmp2.forge("rightcol",[tmp3,tmp4,tmp5,tmp6,{ tp : "Spacer", id : "lines", ht : 10, ln : false},tmp7,tmp8,tmp10,tmp11,tmp12,{ tp : "Spacer", id : "lines", ht : 15, ln : true},{ tp : "Button", id : "rightcol", tx : tmp13, ac : $bind(this,this.saveDiag)}]),this.ui.forge("bottom",[{ tp : "Button", id : "save", tx : com_tilbuci_data_Global.ln.get("window-narrdiag-save"), ac : $bind(this,this.saveNarr)}]),com_tilbuci_ui_base_InterfaceFactory.pickValue(580,600)));
		com_tilbuci_ui_window_PopupWindow.prototype.startInterface.call(this);
	}
	,acStart: function() {
		var h = this._list.h;
		var k_h = h;
		var k_keys = Object.keys(h);
		var k_length = k_keys.length;
		var k_current = 0;
		while(k_current < k_length) {
			var k = k_keys[k_current++];
			this._list.h[k].kill();
			var _this = this._list;
			if(Object.prototype.hasOwnProperty.call(_this.h,k)) {
				delete(_this.h[k]);
			}
		}
		var h = com_tilbuci_data_GlobalPlayer.narrative.dialogues.h;
		var k_h = h;
		var k_keys = Object.keys(h);
		var k_length = k_keys.length;
		var k_current = 0;
		while(k_current < k_length) {
			var k = k_h[k_keys[k_current++]];
			var this1 = this._list;
			var k1 = k.id;
			var v = k.clone();
			this1.h[k1] = v;
		}
		this.ui.hcontainers.h["folderbt"].setWidth(560,[260,90,90,90]);
		this.ui.hcontainers.h["fdialogs"].setWidth(560,[260,90,90,90]);
		this.ui.labels.h["output"].set_width(250);
		this.ui.labels.h["navigation"].set_width(250);
		this.ui.hcontainers.h["insttext"].setWidth(250,[100,130]);
		this.ui.hcontainers.h["instname"].setWidth(250,[100,130]);
		this.ui.hcontainers.h["instexpr"].setWidth(250,[100,130]);
		this.ui.hcontainers.h["navprev"].setWidth(250,[100,130]);
		this.ui.hcontainers.h["navnext"].setWidth(250,[100,130]);
		this.ui.hcontainers.h["navend"].setWidth(250,[100,130]);
		this.ui.hcontainers.h["instances"].setWidth(560);
		this.ui.hcontainers.h["lineorder"].setWidth(560,[250,250,50]);
		this.ui.hcontainers.h["text"].setWidth(560,[100,450]);
		this.ui.hcontainers.h["character"].setWidth(560,[100,450]);
		this.ui.hcontainers.h["asset"].setWidth(560,[100,450]);
		this.ui.hcontainers.h["audio"].setWidth(560,[100,340,50,50]);
		this.ui.hcontainers.h["lbuttons"].setWidth(560);
		this.clear();
		var tmp = com_tilbuci_data_Global.ws;
		var _g = new haxe_ds_StringMap();
		var value = com_tilbuci_data_GlobalPlayer.movie.get_mvId();
		_g.h["movie"] = value;
		tmp.send("Media/ListCollectionsFull",_g,$bind(this,this.onList));
	}
	,onList: function(ok,ld) {
		if(!ok) {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-narrdiag-title"),com_tilbuci_data_Global.ln.get("window-narrdiag-nolist"),300,180,this.stage);
			feathers_core_PopUpManager.removePopUp(this);
		} else {
			var h = this._collections.h;
			var k_h = h;
			var k_keys = Object.keys(h);
			var k_length = k_keys.length;
			var k_current = 0;
			while(k_current < k_length) {
				var k = k_keys[k_current++];
				var _this = this._collections;
				if(Object.prototype.hasOwnProperty.call(_this.h,k)) {
					delete(_this.h[k]);
				}
			}
			var this1 = this._collections;
			var v = { chname : com_tilbuci_data_Global.ln.get("window-narrdiag-none"), chcollection : "", chassets : [{ asname : com_tilbuci_data_Global.ln.get("window-narrdiag-none"), asid : ""}]};
			this1.h[""] = v;
			var h = com_tilbuci_data_GlobalPlayer.narrative.chars.h;
			var k_h = h;
			var k_keys = Object.keys(h);
			var k_length = k_keys.length;
			var k_current = 0;
			while(k_current < k_length) {
				var k = k_keys[k_current++];
				var this1 = this._collections;
				var v = { chname : com_tilbuci_data_GlobalPlayer.narrative.chars.h[k].chname, chcollection : com_tilbuci_data_GlobalPlayer.narrative.chars.h[k].collection, chassets : [{ asname : com_tilbuci_data_Global.ln.get("window-narrdiag-none"), asid : ""}]};
				this1.h[k] = v;
			}
			if(ld.map.h["e"] == 0) {
				var _g = 0;
				var _g1 = Reflect.fields(ld.map.h["list"]);
				while(_g < _g1.length) {
					var cuid = _g1[_g];
					++_g;
					var clinfo = Reflect.field(ld.map.h["list"],cuid);
					if(Object.prototype.hasOwnProperty.call(clinfo,"id") && Object.prototype.hasOwnProperty.call(clinfo,"assets")) {
						var h = this._collections.h;
						var k_h = h;
						var k_keys = Object.keys(h);
						var k_length = k_keys.length;
						var k_current = 0;
						while(k_current < k_length) {
							var k = k_keys[k_current++];
							if(this._collections.h[k].chcollection == Reflect.field(clinfo,"id")) {
								var asinfo = Reflect.field(clinfo,"assets");
								var _g2 = 0;
								var _g3 = Reflect.fields(asinfo);
								while(_g2 < _g3.length) {
									var ask = _g3[_g2];
									++_g2;
									var asdata = Reflect.field(asinfo,ask);
									if(Object.prototype.hasOwnProperty.call(asdata,"id") && Object.prototype.hasOwnProperty.call(asdata,"name")) {
										this._collections.h[k].chassets.push({ asname : Reflect.field(asdata,"name"), asid : Reflect.field(asdata,"id")});
									}
								}
							}
						}
					}
				}
				var list = [];
				var h = this._collections.h;
				var k_h = h;
				var k_keys = Object.keys(h);
				var k_length = k_keys.length;
				var k_current = 0;
				while(k_current < k_length) {
					var k = k_keys[k_current++];
					list.push({ text : this._collections.h[k].chname, value : k});
				}
				this.ui.setSelectOptions("character",list);
				this.ui.setSelectValue("character","");
				this.ui.setSelectOptions("asset",[{ text : com_tilbuci_data_Global.ln.get("window-narrdiag-none"), value : ""}]);
				this.ui.setSelectValue("asset","");
			} else {
				this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-narrdiag-title"),com_tilbuci_data_Global.ln.get("window-narrdiag-nolist"),300,180,this.stage);
				feathers_core_PopUpManager.removePopUp(this);
			}
		}
	}
	,clear: function(folder) {
		var list = [];
		var h = this._list.h;
		var k_h = h;
		var k_keys = Object.keys(h);
		var k_length = k_keys.length;
		var k_current = 0;
		while(k_current < k_length) {
			var k = k_keys[k_current++];
			list.push({ text : k, value : k});
		}
		this.ui.setListValues("folders",list);
		this.ui.setListSelectValue("folders",folder);
		var list2 = [];
		if(folder != null) {
			var h = this._list.h[folder].diags.h;
			var k_h = h;
			var k_keys = Object.keys(h);
			var k_length = k_keys.length;
			var k_current = 0;
			while(k_current < k_length) {
				var k = k_keys[k_current++];
				list2.push({ text : k, value : k});
			}
		}
		this.ui.setListValues("fdialogs",list2);
		this.ui.inputs.h["folderbtname"].set_text("");
		this.ui.inputs.h["fdialogsname"].set_text("");
		this.ui.containers.h["rightcol"].set_visible(false);
	}
	,confirmFolderChange: function(save) {
		this._haschange = false;
		if(save) {
			this.saveDiag(null);
		}
		this.onFolderChangeOk();
	}
	,onFolderChange: function(evt) {
		if(this.ui.lists.h["folders"].get_selectedItem() != null) {
			if(this._haschange) {
				com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("window-narrdiag-title"),com_tilbuci_data_Global.ln.get("window-narrdiag-haschange"),320,210,com_tilbuci_data_Global.ln.get("window-narrdiag-haschangekeep"),$bind(this,this.confirmFolderChange),"confirm",com_tilbuci_data_Global.ln.get("window-narrdiag-haschangediscard"));
			} else {
				this.onFolderChangeOk(evt);
			}
		}
	}
	,onFolderChangeOk: function(evt) {
		var this1 = this._list;
		var key = this.ui.lists.h["folders"].get_selectedItem().value;
		if(!this1.h[key].loaded) {
			var this1 = this._list;
			var key = this.ui.lists.h["folders"].get_selectedItem().value;
			this1.h[key].loadContents($bind(this,this.onDiagContent));
		} else {
			this.onDiagContent(true);
		}
	}
	,onDiagContent: function(ok) {
		if(ok) {
			var this1 = this._list;
			var key = this.ui.lists.h["folders"].get_selectedItem().value;
			this1.h[key].loaded = true;
			var list = [];
			var this1 = this._list;
			var key = this.ui.lists.h["folders"].get_selectedItem().value;
			var h = this1.h[key].diags.h;
			var k_h = h;
			var k_keys = Object.keys(h);
			var k_length = k_keys.length;
			var k_current = 0;
			while(k_current < k_length) {
				var k = k_keys[k_current++];
				list.push({ text : k, value : k});
			}
			this.ui.setListValues("fdialogs",list);
		} else {
			com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("window-narrdiag-title"),com_tilbuci_data_Global.ln.get("window-narrdiag-erloadfolder"),320,150,com_tilbuci_data_Global.ln.get("default-ok"));
		}
	}
	,confirmDiagChange: function(save) {
		this._haschange = false;
		if(save) {
			this.saveDiag(null);
		}
		this.onDiagChangeOk();
	}
	,onDiagChange: function(evt) {
		if(this._haschange) {
			com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("window-narrdiag-title"),com_tilbuci_data_Global.ln.get("window-narrdiag-haschange"),320,210,com_tilbuci_data_Global.ln.get("window-narrdiag-haschangekeep"),$bind(this,this.confirmDiagChange),"confirm",com_tilbuci_data_Global.ln.get("window-narrdiag-haschangediscard"));
		} else {
			this.onDiagChangeOk(evt);
		}
	}
	,onDiagChangeOk: function(evt) {
		if(this.ui.lists.h["fdialogs"].get_selectedItem() != null) {
			var this1 = this._list;
			var key = this.ui.lists.h["folders"].get_selectedItem().value;
			var this2 = this1.h[key].diags;
			var key = this.ui.lists.h["fdialogs"].get_selectedItem().value;
			var diag = this2.h[key];
			this.ui.inputs.h["insttext"].set_text(diag.insttext);
			this.ui.inputs.h["instname"].set_text(diag.instname);
			this.ui.inputs.h["instexpr"].set_text(diag.instexpr);
			this.ui.inputs.h["navprev"].set_text(diag.navprev);
			this.ui.inputs.h["navnext"].set_text(diag.navnext);
			this.ui.inputs.h["navend"].set_text(diag.navend);
			while(this._lines.length > 0) this._lines.shift();
			var _g = 0;
			var _g1 = diag.lines.length;
			while(_g < _g1) {
				var k = _g++;
				this._lines.push({ text : HxOverrides.substr(diag.lines[k].text,0,50), value : diag.lines[k]});
			}
			this.ui.setListValues("lines",this._lines);
			this.ui.inputs.h["text"].set_text("");
			this.ui.inputs.h["audio"].set_text("");
			this.ui.setSelectValue("collection","");
			this.ui.setSelectValue("asset","");
			this.ui.containers.h["rightcol"].set_visible(true);
			this._haschange = false;
			this._folderchange = this.ui.lists.h["folders"].get_selectedItem().value;
			this._diagchange = this.ui.lists.h["fdialogs"].get_selectedItem().value;
		}
	}
	,action: function(ac,data) {
		if(ac == "audio") {
			this.ui.inputs.h["audio"].set_text(data.h["file"]);
		}
	}
	,addFolder: function(evt) {
		if(StringTools.trim(this.ui.inputs.h["folderbtname"].get_text()).length < 3) {
			com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("window-narrdiag-title"),com_tilbuci_data_Global.ln.get("window-narrdiag-fdnamesmall"),320,150,com_tilbuci_data_Global.ln.get("default-ok"));
		} else {
			var this1 = this._list;
			var key = StringTools.trim(this.ui.inputs.h["folderbtname"].get_text());
			if(Object.prototype.hasOwnProperty.call(this1.h,key)) {
				com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("window-narrdiag-title"),com_tilbuci_data_Global.ln.get("window-narrdiag-fdnamealready"),320,150,com_tilbuci_data_Global.ln.get("default-ok"));
			} else {
				var this1 = this._list;
				var k = StringTools.trim(this.ui.inputs.h["folderbtname"].get_text());
				var v = new com_tilbuci_narrative_DialogueFolderNarrative({ id : StringTools.trim(this.ui.inputs.h["folderbtname"].get_text())});
				this1.h[k] = v;
				var this1 = this._list;
				var key = StringTools.trim(this.ui.inputs.h["folderbtname"].get_text());
				this1.h[key].loaded = true;
				this.clear();
			}
		}
	}
	,renameFolder: function(evt) {
		if(this.ui.lists.h["folders"].get_selectedItem() == null) {
			com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("window-narrdiag-title"),com_tilbuci_data_Global.ln.get("window-narrdiag-fdnoselect"),320,150,com_tilbuci_data_Global.ln.get("default-ok"));
		} else if(StringTools.trim(this.ui.inputs.h["folderbtname"].get_text()).length < 3) {
			com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("window-narrdiag-title"),com_tilbuci_data_Global.ln.get("window-narrdiag-fdnamesmall"),320,150,com_tilbuci_data_Global.ln.get("default-ok"));
		} else {
			var this1 = this._list;
			var key = StringTools.trim(this.ui.inputs.h["folderbtname"].get_text());
			if(Object.prototype.hasOwnProperty.call(this1.h,key)) {
				com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("window-narrdiag-title"),com_tilbuci_data_Global.ln.get("window-narrdiag-fdnamealready"),320,150,com_tilbuci_data_Global.ln.get("default-ok"));
			} else {
				var list = new haxe_ds_StringMap();
				var h = this._list.h;
				var k_h = h;
				var k_keys = Object.keys(h);
				var k_length = k_keys.length;
				var k_current = 0;
				while(k_current < k_length) {
					var k = k_keys[k_current++];
					if(k == this.ui.lists.h["folders"].get_selectedItem().value) {
						this._list.h[k].id = StringTools.trim(this.ui.inputs.h["folderbtname"].get_text());
						var k1 = StringTools.trim(this.ui.inputs.h["folderbtname"].get_text());
						var v = this._list.h[k];
						list.h[k1] = v;
					} else {
						var v1 = this._list.h[k];
						list.h[k] = v1;
					}
				}
				this._list = list;
				this.clear();
			}
		}
	}
	,removeFolder: function(evt) {
		if(this.ui.lists.h["folders"].get_selectedItem() == null) {
			com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("window-narrdiag-title"),com_tilbuci_data_Global.ln.get("window-narrdiag-fdnoselect"),320,150,com_tilbuci_data_Global.ln.get("default-ok"));
		} else {
			var this1 = this._list;
			var key = this.ui.lists.h["folders"].get_selectedItem().value;
			if(this1.h[key].numDiags() > 0) {
				com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("window-narrdiag-title"),com_tilbuci_data_Global.ln.get("window-narrdiag-fdhavediags"),320,150,com_tilbuci_data_Global.ln.get("default-ok"));
			} else {
				var h = this._list.h;
				var k_h = h;
				var k_keys = Object.keys(h);
				var k_length = k_keys.length;
				var k_current = 0;
				while(k_current < k_length) {
					var k = k_keys[k_current++];
					if(k == this.ui.lists.h["folders"].get_selectedItem().value) {
						this._list.h[k].kill();
						var _this = this._list;
						if(Object.prototype.hasOwnProperty.call(_this.h,k)) {
							delete(_this.h[k]);
						}
					}
				}
				this.clear();
			}
		}
	}
	,addDialogue: function(evt) {
		if(this.ui.lists.h["folders"].get_selectedItem() == null) {
			com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("window-narrdiag-title"),com_tilbuci_data_Global.ln.get("window-narrdiag-fdnoselect"),320,150,com_tilbuci_data_Global.ln.get("default-ok"));
		} else if(StringTools.trim(this.ui.inputs.h["fdialogsname"].get_text()).length < 3) {
			com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("window-narrdiag-title"),com_tilbuci_data_Global.ln.get("window-narrdiag-dgnamesmall"),320,150,com_tilbuci_data_Global.ln.get("default-ok"));
		} else {
			var this1 = this._list;
			var key = this.ui.lists.h["folders"].get_selectedItem().value;
			var this2 = this1.h[key].diags;
			var key = StringTools.trim(this.ui.inputs.h["fdialogsname"].get_text());
			if(Object.prototype.hasOwnProperty.call(this2.h,key)) {
				com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("window-narrdiag-title"),com_tilbuci_data_Global.ln.get("window-narrdiag-dgnamealready"),320,150,com_tilbuci_data_Global.ln.get("default-ok"));
			} else {
				var this1 = this._list;
				var key = this.ui.lists.h["folders"].get_selectedItem().value;
				var this2 = this1.h[key].diags;
				var k = StringTools.trim(this.ui.inputs.h["fdialogsname"].get_text());
				var v = new com_tilbuci_narrative_DialogueNarrative({ id : StringTools.trim(this.ui.inputs.h["fdialogsname"].get_text())});
				this2.h[k] = v;
				this.clear(this.ui.lists.h["folders"].get_selectedItem().value);
				this._haschange = false;
			}
		}
	}
	,renameDialogue: function(evt) {
		if(this.ui.lists.h["folders"].get_selectedItem() == null) {
			com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("window-narrdiag-title"),com_tilbuci_data_Global.ln.get("window-narrdiag-fdnoselect"),320,150,com_tilbuci_data_Global.ln.get("default-ok"));
		} else if(this.ui.lists.h["fdialogs"].get_selectedItem() == null) {
			com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("window-narrdiag-title"),com_tilbuci_data_Global.ln.get("window-narrdiag-dgnoselect"),320,150,com_tilbuci_data_Global.ln.get("default-ok"));
		} else if(StringTools.trim(this.ui.inputs.h["fdialogsname"].get_text()).length < 3) {
			com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("window-narrdiag-title"),com_tilbuci_data_Global.ln.get("window-narrdiag-dgnamesmall"),320,150,com_tilbuci_data_Global.ln.get("default-ok"));
		} else {
			var this1 = this._list;
			var key = this.ui.lists.h["folders"].get_selectedItem().value;
			var this2 = this1.h[key].diags;
			var key = StringTools.trim(this.ui.inputs.h["fdialogsname"].get_text());
			if(Object.prototype.hasOwnProperty.call(this2.h,key)) {
				com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("window-narrdiag-title"),com_tilbuci_data_Global.ln.get("window-narrdiag-dgnamealready"),320,150,com_tilbuci_data_Global.ln.get("default-ok"));
			} else {
				var list = new haxe_ds_StringMap();
				var this1 = this._list;
				var key = this.ui.lists.h["folders"].get_selectedItem().value;
				var h = this1.h[key].diags.h;
				var k_h = h;
				var k_keys = Object.keys(h);
				var k_length = k_keys.length;
				var k_current = 0;
				while(k_current < k_length) {
					var k = k_keys[k_current++];
					if(k == this.ui.lists.h["fdialogs"].get_selectedItem().value) {
						var this1 = this._list;
						var key = this.ui.lists.h["folders"].get_selectedItem().value;
						this1.h[key].diags.h[k].id = StringTools.trim(this.ui.inputs.h["fdialogsname"].get_text());
						var k1 = StringTools.trim(this.ui.inputs.h["fdialogsname"].get_text());
						var this2 = this._list;
						var key1 = this.ui.lists.h["folders"].get_selectedItem().value;
						var v = this2.h[key1].diags.h[k];
						list.h[k1] = v;
					} else {
						var this3 = this._list;
						var key2 = this.ui.lists.h["folders"].get_selectedItem().value;
						var v1 = this3.h[key2].diags.h[k];
						list.h[k] = v1;
					}
				}
				var this1 = this._list;
				var key = this.ui.lists.h["folders"].get_selectedItem().value;
				this1.h[key].diags = list;
				this.clear(this.ui.lists.h["folders"].get_selectedItem().value);
				this._haschange = false;
			}
		}
	}
	,removeDialogue: function(evt) {
		if(this.ui.lists.h["folders"].get_selectedItem() == null) {
			com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("window-narrdiag-title"),com_tilbuci_data_Global.ln.get("window-narrdiag-fdnoselect"),320,150,com_tilbuci_data_Global.ln.get("default-ok"));
		} else if(this.ui.lists.h["fdialogs"].get_selectedItem() == null) {
			com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("window-narrdiag-title"),com_tilbuci_data_Global.ln.get("window-narrdiag-dgnoselect"),320,150,com_tilbuci_data_Global.ln.get("default-ok"));
		} else {
			var this1 = this._list;
			var key = this.ui.lists.h["folders"].get_selectedItem().value;
			var this2 = this1.h[key].diags;
			var key = this.ui.lists.h["fdialogs"].get_selectedItem().value;
			if(this2.h[key].numLines() > 0) {
				com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("window-narrdiag-title"),com_tilbuci_data_Global.ln.get("window-narrdiag-dghavelines"),320,150,com_tilbuci_data_Global.ln.get("default-ok"));
			} else {
				var this1 = this._list;
				var key = this.ui.lists.h["folders"].get_selectedItem().value;
				var this2 = this1.h[key].diags;
				var key = this.ui.lists.h["fdialogs"].get_selectedItem().value;
				this2.h[key].kill();
				var this1 = this._list;
				var key = this.ui.lists.h["folders"].get_selectedItem().value;
				var this2 = this1.h[key].diags;
				var key = this.ui.lists.h["fdialogs"].get_selectedItem().value;
				var _this = this2;
				if(Object.prototype.hasOwnProperty.call(_this.h,key)) {
					delete(_this.h[key]);
				}
				this.clear(this.ui.lists.h["folders"].get_selectedItem().value);
				this._haschange = false;
			}
		}
	}
	,saveDiag: function(evt) {
		this._haschange = false;
		if(this._folderchange != null) {
			if(this._diagchange != null) {
				var diag = this._list.h[this._folderchange].diags.h[this._diagchange];
				diag.navprev = this.ui.inputs.h["navprev"].get_text();
				diag.navnext = this.ui.inputs.h["navnext"].get_text();
				diag.navend = this.ui.inputs.h["navend"].get_text();
				diag.insttext = this.ui.inputs.h["insttext"].get_text();
				diag.instname = this.ui.inputs.h["instname"].get_text();
				diag.instexpr = this.ui.inputs.h["instexpr"].get_text();
				diag.lines = [];
				while(this._lines.length > 0) diag.lines.push(this._lines.shift().value);
				this.ui.setListSelectValue("fdialogs",null);
				this.ui.containers.h["rightcol"].set_visible(false);
			}
		}
	}
	,confirmNarrChange: function(save) {
		this._haschange = false;
		if(save) {
			this.saveDiag(null);
		}
		this.saveNarrOk();
	}
	,saveNarr: function(evt) {
		if(this._haschange) {
			com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("window-narrdiag-title"),com_tilbuci_data_Global.ln.get("window-narrdiag-haschange"),320,210,com_tilbuci_data_Global.ln.get("window-narrdiag-haschangekeep"),$bind(this,this.confirmNarrChange),"confirm",com_tilbuci_data_Global.ln.get("window-narrdiag-haschangediscard"));
		} else {
			this.saveNarrOk(evt);
		}
	}
	,saveNarrOk: function(evt) {
		var h = com_tilbuci_data_GlobalPlayer.narrative.dialogues.h;
		var nar_h = h;
		var nar_keys = Object.keys(h);
		var nar_length = nar_keys.length;
		var nar_current = 0;
		while(nar_current < nar_length) {
			var nar = nar_keys[nar_current++];
			com_tilbuci_data_GlobalPlayer.narrative.dialogues.h[nar].kill();
			var _this = com_tilbuci_data_GlobalPlayer.narrative.dialogues;
			if(Object.prototype.hasOwnProperty.call(_this.h,nar)) {
				delete(_this.h[nar]);
			}
		}
		var h = this._list.h;
		var nar_h = h;
		var nar_keys = Object.keys(h);
		var nar_length = nar_keys.length;
		var nar_current = 0;
		while(nar_current < nar_length) {
			var nar = nar_keys[nar_current++];
			var this1 = com_tilbuci_data_GlobalPlayer.narrative.dialogues;
			var v = this._list.h[nar].clone();
			this1.h[nar] = v;
		}
		this.clear();
		var tmp = com_tilbuci_data_Global.ws;
		var _g = new haxe_ds_StringMap();
		var value = com_tilbuci_data_GlobalPlayer.movie.get_mvId();
		_g.h["movie"] = value;
		var value = com_tilbuci_data_GlobalPlayer.narrative.getData();
		_g.h["data"] = value;
		tmp.send("Movie/SaveNarrative",_g,$bind(this,this.onSaveReturn));
	}
	,onSaveReturn: function(ok,ld) {
		if(ok) {
			if(ld.map.h["e"] == 1) {
				com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("window-narrdiag-title"),com_tilbuci_data_Global.ln.get("window-narrdiag-ersave1"),320,150,com_tilbuci_data_Global.ln.get("default-ok"));
			} else if(ld.map.h["e"] == 2) {
				com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("window-narrdiag-title"),com_tilbuci_data_Global.ln.get("window-narrdiag-ersave"),320,150,com_tilbuci_data_Global.ln.get("default-ok"));
			} else {
				if(Object.prototype.hasOwnProperty.call(ld.map.h,"ids")) {
					var ids_h = Object.create(null);
					var _g = 0;
					var _g1 = Reflect.fields(ld.map.h["ids"]);
					while(_g < _g1.length) {
						var k = _g1[_g];
						++_g;
						var v = Reflect.field(ld.map.h["ids"],k);
						ids_h[k] = v;
					}
					var h = com_tilbuci_data_GlobalPlayer.narrative.dialogues.h;
					var k_h = h;
					var k_keys = Object.keys(h);
					var k_length = k_keys.length;
					var k_current = 0;
					while(k_current < k_length) {
						var k = k_keys[k_current++];
						if(Object.prototype.hasOwnProperty.call(ids_h,com_tilbuci_data_GlobalPlayer.narrative.dialogues.h[k].id)) {
							com_tilbuci_data_GlobalPlayer.narrative.dialogues.h[k].code = ids_h[com_tilbuci_data_GlobalPlayer.narrative.dialogues.h[k].id];
						}
					}
				}
				com_tilbuci_data_Global.showMsg(com_tilbuci_data_Global.ln.get("window-narrdiag-oksave"));
				var h = com_tilbuci_data_GlobalPlayer.narrative.dialogues.h;
				var k_h = h;
				var k_keys = Object.keys(h);
				var k_length = k_keys.length;
				var k_current = 0;
				while(k_current < k_length) {
					var k = k_keys[k_current++];
					com_tilbuci_data_GlobalPlayer.narrative.dialogues.h[k].loaded = false;
				}
				feathers_core_PopUpManager.removePopUp(this);
			}
		} else {
			com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("window-narrdiag-title"),com_tilbuci_data_Global.ln.get("window-narrdiag-ersave"),320,150,com_tilbuci_data_Global.ln.get("default-ok"));
		}
	}
	,onUp: function(evt) {
		if(this.ui.lists.h["lines"].get_selectedItem() != null) {
			if(this.ui.lists.h["lines"].get_selectedIndex() > 0) {
				var newindex = this.ui.lists.h["lines"].get_selectedIndex() - 1;
				var temp = this._lines[newindex];
				this._lines[newindex] = this._lines[this.ui.lists.h["lines"].get_selectedIndex()];
				this._lines[this.ui.lists.h["lines"].get_selectedIndex()] = temp;
				this.ui.setListValues("lines",this._lines);
				this.ui.lists.h["lines"].set_selectedIndex(newindex);
				this.setChange();
			}
		}
	}
	,onDown: function(evt) {
		if(this.ui.lists.h["lines"].get_selectedItem() != null) {
			if(this.ui.lists.h["lines"].get_selectedIndex() < this._lines.length - 1) {
				var newindex = this.ui.lists.h["lines"].get_selectedIndex() + 1;
				var temp = this._lines[newindex];
				this._lines[newindex] = this._lines[this.ui.lists.h["lines"].get_selectedIndex()];
				this._lines[this.ui.lists.h["lines"].get_selectedIndex()] = temp;
				this.ui.setListValues("lines",this._lines);
				this.ui.lists.h["lines"].set_selectedIndex(newindex);
				this.setChange();
			}
		}
	}
	,acAudio: function(evt) {
		this._ac("audio");
	}
	,acAudiodel: function(evt) {
		this.ui.inputs.h["audio"].set_text("");
	}
	,onAddLine: function(evt) {
		if(StringTools.trim(this.ui.inputs.h["text"].get_text()) != "") {
			this._lines.push({ text : HxOverrides.substr(StringTools.trim(this.ui.inputs.h["text"].get_text()),0,50), value : new com_tilbuci_narrative_DialogueLineNarrative({ text : StringTools.trim(this.ui.inputs.h["text"].get_text()), audio : StringTools.trim(this.ui.inputs.h["audio"].get_text()), character : this.ui.selects.h["character"].get_selectedItem().value, asset : this.ui.selects.h["asset"].get_selectedItem().value})});
			this.ui.setListValues("lines",this._lines);
			this.ui.setListSelectValue("lines",null);
			this.ui.inputs.h["text"].set_text("");
			this.ui.inputs.h["audio"].set_text("");
			this.setChange();
		}
	}
	,onEditLine: function(evt) {
		if(this.ui.lists.h["lines"].get_selectedItem() != null && StringTools.trim(this.ui.inputs.h["text"].get_text()) != "") {
			this._lines[this.ui.lists.h["lines"].get_selectedIndex()] = { text : HxOverrides.substr(StringTools.trim(this.ui.inputs.h["text"].get_text()),0,50), value : new com_tilbuci_narrative_DialogueLineNarrative({ text : StringTools.trim(this.ui.inputs.h["text"].get_text()), audio : StringTools.trim(this.ui.inputs.h["audio"].get_text()), character : this.ui.selects.h["character"].get_selectedItem().value, asset : this.ui.selects.h["asset"].get_selectedItem().value})};
			this.ui.setListValues("lines",this._lines);
			this.ui.setListSelectValue("lines",null);
			this.ui.inputs.h["text"].set_text("");
			this.ui.inputs.h["audio"].set_text("");
			this.setChange();
		}
	}
	,onRemLine: function(evt) {
		if(this.ui.lists.h["lines"].get_selectedItem() != null) {
			var list = [];
			var _g = 0;
			var _g1 = this._lines.length;
			while(_g < _g1) {
				var k = _g++;
				if(k != this.ui.lists.h["lines"].get_selectedIndex()) {
					list.push(this._lines[k]);
				}
			}
			this._lines = list;
			this.ui.setListValues("lines",this._lines);
			this.ui.setListSelectValue("lines",null);
			this.ui.inputs.h["text"].set_text("");
			this.ui.inputs.h["audio"].set_text("");
			this.setChange();
		}
	}
	,onCharacterChange: function(evt) {
		var list = [];
		var _g = 0;
		var this1 = this._collections;
		var key = this.ui.selects.h["character"].get_selectedItem().value;
		var _g1 = this1.h[key].chassets;
		while(_g < _g1.length) {
			var k = _g1[_g];
			++_g;
			list.push({ text : k.asname, value : k.asid});
		}
		this.ui.setSelectOptions("asset",list);
	}
	,onChangeLine: function(evt) {
		if(this.ui.lists.h["lines"].get_selectedItem() != null) {
			this.ui.inputs.h["text"].set_text(this.ui.lists.h["lines"].get_selectedItem().value.text);
			this.ui.inputs.h["audio"].set_text(this.ui.lists.h["lines"].get_selectedItem().value.audio);
			this.ui.setSelectValue("character",this.ui.lists.h["lines"].get_selectedItem().value.character);
			this.ui.setSelectValue("asset",this.ui.lists.h["lines"].get_selectedItem().value.asset);
		}
	}
	,setChange: function(evt) {
		this._haschange = true;
		this._folderchange = this.ui.lists.h["folders"].get_selectedItem().value;
		this._diagchange = this.ui.lists.h["fdialogs"].get_selectedItem().value;
	}
	,__class__: com_tilbuci_ui_window_narrative_WindowDiagChar
});
var com_tilbuci_ui_window_narrative_WindowNarrBattle = function(ac) {
	this._list = new haxe_ds_StringMap();
	com_tilbuci_ui_window_PopupWindow.call(this,ac,com_tilbuci_data_Global.ln.get("window-narrbattle-title"),1000,580,true,true,true);
};
$hxClasses["com.tilbuci.ui.window.narrative.WindowNarrBattle"] = com_tilbuci_ui_window_narrative_WindowNarrBattle;
com_tilbuci_ui_window_narrative_WindowNarrBattle.__name__ = "com.tilbuci.ui.window.narrative.WindowNarrBattle";
com_tilbuci_ui_window_narrative_WindowNarrBattle.__super__ = com_tilbuci_ui_window_PopupWindow;
com_tilbuci_ui_window_narrative_WindowNarrBattle.prototype = $extend(com_tilbuci_ui_window_PopupWindow.prototype,{
	_list: null
	,startInterface: function(evt) {
		this.ui.createHContainer("imgbgh");
		this.ui.createTInput("imgbgh","","",this.ui.hcontainers.h["imgbgh"],false);
		var tmp = this.ui;
		var tmp1 = openfl_utils_Assets.getBitmapData("btOpenfile");
		var tmp2 = this.ui.hcontainers.h["imgbgh"];
		tmp.createIconButton("imgbgh",$bind(this,this.acImgbgh),new openfl_display_Bitmap(tmp1),null,tmp2,false);
		var tmp = this.ui;
		var tmp1 = openfl_utils_Assets.getBitmapData("btDel");
		var tmp2 = this.ui.hcontainers.h["imgbgh"];
		tmp.createIconButton("imimgbghdel",$bind(this,this.acImgbghdel),new openfl_display_Bitmap(tmp1),null,tmp2,false);
		this.ui.inputs.h["imgbgh"].set_enabled(false);
		this.ui.createHContainer("imgbgv");
		this.ui.createTInput("imgbgv","","",this.ui.hcontainers.h["imgbgv"],false);
		var tmp = this.ui;
		var tmp1 = openfl_utils_Assets.getBitmapData("btOpenfile");
		var tmp2 = this.ui.hcontainers.h["imgbgv"];
		tmp.createIconButton("imgbgv",$bind(this,this.acImgbgv),new openfl_display_Bitmap(tmp1),null,tmp2,false);
		var tmp = this.ui;
		var tmp1 = openfl_utils_Assets.getBitmapData("btDel");
		var tmp2 = this.ui.hcontainers.h["imgbgv"];
		tmp.createIconButton("imimgbgvdel",$bind(this,this.acImgbgvdel),new openfl_display_Bitmap(tmp1),null,tmp2,false);
		this.ui.inputs.h["imgbgv"].set_enabled(false);
		this.ui.createHContainer("imgbt");
		this.ui.createTInput("imgbt","","",this.ui.hcontainers.h["imgbt"],false);
		var tmp = this.ui;
		var tmp1 = openfl_utils_Assets.getBitmapData("btOpenfile");
		var tmp2 = this.ui.hcontainers.h["imgbt"];
		tmp.createIconButton("imgbt",$bind(this,this.acImgbt),new openfl_display_Bitmap(tmp1),null,tmp2,false);
		var tmp = this.ui;
		var tmp1 = openfl_utils_Assets.getBitmapData("btDel");
		var tmp2 = this.ui.hcontainers.h["imgbt"];
		tmp.createIconButton("imgimgbtdel",$bind(this,this.acImgbtdel),new openfl_display_Bitmap(tmp1),null,tmp2,false);
		this.ui.inputs.h["imgbt"].set_enabled(false);
		this.ui.createHContainer("imgattr");
		this.ui.createTInput("imgattr","","",this.ui.hcontainers.h["imgattr"],false);
		var tmp = this.ui;
		var tmp1 = openfl_utils_Assets.getBitmapData("btOpenfile");
		var tmp2 = this.ui.hcontainers.h["imgattr"];
		tmp.createIconButton("imgattr",$bind(this,this.acImgattr),new openfl_display_Bitmap(tmp1),null,tmp2,false);
		var tmp = this.ui;
		var tmp1 = openfl_utils_Assets.getBitmapData("btDel");
		var tmp2 = this.ui.hcontainers.h["imgattr"];
		tmp.createIconButton("imgattrdel",$bind(this,this.acImgattrdel),new openfl_display_Bitmap(tmp1),null,tmp2,false);
		this.ui.inputs.h["imgattr"].set_enabled(false);
		this.ui.createHContainer("imgcard");
		this.ui.createTInput("imgcard","","",this.ui.hcontainers.h["imgcard"],false);
		var tmp = this.ui;
		var tmp1 = openfl_utils_Assets.getBitmapData("btOpenfile");
		var tmp2 = this.ui.hcontainers.h["imgcard"];
		tmp.createIconButton("imgcard",$bind(this,this.acImgcard),new openfl_display_Bitmap(tmp1),null,tmp2,false);
		var tmp = this.ui;
		var tmp1 = openfl_utils_Assets.getBitmapData("btDel");
		var tmp2 = this.ui.hcontainers.h["imgcard"];
		tmp.createIconButton("imgcarddel",$bind(this,this.acImgcarddel),new openfl_display_Bitmap(tmp1),null,tmp2,false);
		this.ui.inputs.h["imgcard"].set_enabled(false);
		this.ui.createHContainer("itgraphic");
		this.ui.createTInput("itgraphic","","",this.ui.hcontainers.h["itgraphic"],false);
		var tmp = this.ui;
		var tmp1 = openfl_utils_Assets.getBitmapData("btOpenfile");
		var tmp2 = this.ui.hcontainers.h["itgraphic"];
		tmp.createIconButton("itgraphic",$bind(this,this.acItgraphic),new openfl_display_Bitmap(tmp1),null,tmp2,false);
		var tmp = this.ui;
		var tmp1 = openfl_utils_Assets.getBitmapData("btDel");
		var tmp2 = this.ui.hcontainers.h["itgraphic"];
		tmp.createIconButton("itgraphicdel",$bind(this,this.acItgraphicdel),new openfl_display_Bitmap(tmp1),null,tmp2,false);
		this.ui.inputs.h["itgraphic"].set_enabled(false);
		var tmp = com_tilbuci_data_Global.ln.get("window-narrbattle-cards");
		var tmp1 = this.ui;
		var tmp2 = this.ui;
		var tmp3 = { tp : "Label", id : "items", tx : com_tilbuci_data_Global.ln.get("window-narrbattle-available"), vr : ""};
		var tmp4 = { tp : "Button", id : "loadit", tx : com_tilbuci_data_Global.ln.get("window-narrbattle-loadcards"), ac : $bind(this,this.onLoadIt)};
		var tmp5 = com_tilbuci_data_Global.ln.get("window-narrbattle-removecard");
		var tmp6 = tmp2.forge("leftcol",[tmp3,{ tp : "List", id : "items", vl : [], sl : null, ht : 350},tmp4,{ tp : "Button", id : "removeit", tx : tmp5, ac : $bind(this,this.onRemoveIt)}]);
		var tmp2 = this.ui;
		var tmp3 = { tp : "Label", id : "itname", tx : com_tilbuci_data_Global.ln.get("window-narrbattle-cardname"), vr : "detail"};
		var tmp4 = { tp : "Label", id : "set", tx : com_tilbuci_data_Global.ln.get("window-narrbattle-cardgraphic"), vr : feathers_controls_Label.VARIANT_DETAIL};
		var tmp5 = { tp : "Custom", cont : this.ui.hcontainers.h["itgraphic"]};
		var tmp7 = { tp : "Label", id : "set", tx : com_tilbuci_data_Global.ln.get("window-narrbattle-cardat1"), vr : feathers_controls_Label.VARIANT_DETAIL};
		var tmp8 = { tp : "Label", id : "set", tx : com_tilbuci_data_Global.ln.get("window-narrbattle-cardat2"), vr : feathers_controls_Label.VARIANT_DETAIL};
		var tmp9 = { tp : "Label", id : "set", tx : com_tilbuci_data_Global.ln.get("window-narrbattle-cardat3"), vr : feathers_controls_Label.VARIANT_DETAIL};
		var tmp10 = { tp : "Label", id : "set", tx : com_tilbuci_data_Global.ln.get("window-narrbattle-cardat4"), vr : feathers_controls_Label.VARIANT_DETAIL};
		var tmp11 = { tp : "Label", id : "set", tx : com_tilbuci_data_Global.ln.get("window-narrbattle-cardat5"), vr : feathers_controls_Label.VARIANT_DETAIL};
		var tmp12 = com_tilbuci_data_Global.ln.get("window-narrbattle-setcard");
		this.addForm(tmp,tmp1.createColumnHolder("columns",tmp6,tmp2.forge("rightcol",[tmp3,{ tp : "TInput", id : "itname", tx : "", vr : ""},tmp4,tmp5,tmp7,{ tp : "Numeric", id : "cardat1", mn : -10000, mx : 10000, st : 1, vl : 0},tmp8,{ tp : "Numeric", id : "cardat2", mn : -10000, mx : 10000, st : 1, vl : 0},tmp9,{ tp : "Numeric", id : "cardat3", mn : -10000, mx : 10000, st : 1, vl : 0},tmp10,{ tp : "Numeric", id : "cardat4", mn : -10000, mx : 10000, st : 1, vl : 0},tmp11,{ tp : "Numeric", id : "cardat5", mn : -10000, mx : 10000, st : 1, vl : 0},{ tp : "Spacer", id : "saveitem", ht : 40, ln : false},{ tp : "Button", id : "saveitem", tx : tmp12, ac : $bind(this,this.onSetItem)}]),this.ui.forge("bottom",[{ tp : "Button", id : "iconsave", tx : com_tilbuci_data_Global.ln.get("window-narrbattle-savecards"), ac : $bind(this,this.onSaveItems)}]),460));
		this.ui.listDbClick("items",$bind(this,this.onLoadIt));
		var tmp = com_tilbuci_data_Global.ln.get("window-narrbattle-attributes");
		var tmp1 = this.ui;
		var tmp2 = { tp : "Label", id : "set", tx : com_tilbuci_data_Global.ln.get("window-narrbattle-attrabout"), vr : ""};
		var tmp3 = { tp : "Label", id : "attr1", tx : com_tilbuci_data_Global.ln.get("window-narrbattle-attr1"), vr : feathers_controls_Label.VARIANT_DETAIL};
		var tmp4 = { tp : "Label", id : "attr2", tx : com_tilbuci_data_Global.ln.get("window-narrbattle-attr2"), vr : feathers_controls_Label.VARIANT_DETAIL};
		var tmp5 = { tp : "Label", id : "attr3", tx : com_tilbuci_data_Global.ln.get("window-narrbattle-attr3"), vr : feathers_controls_Label.VARIANT_DETAIL};
		var tmp6 = { tp : "Label", id : "attr4", tx : com_tilbuci_data_Global.ln.get("window-narrbattle-attr4"), vr : feathers_controls_Label.VARIANT_DETAIL};
		var tmp7 = { tp : "Label", id : "attr5", tx : com_tilbuci_data_Global.ln.get("window-narrbattle-attr5"), vr : feathers_controls_Label.VARIANT_DETAIL};
		var tmp8 = com_tilbuci_data_Global.ln.get("window-narrbattle-btattr");
		this.addForm(tmp,tmp1.forge("attributes",[tmp2,{ tp : "Spacer", id : "set", ht : 10, ln : false},tmp3,{ tp : "TInput", id : "attr1", tx : "", vr : ""},tmp4,{ tp : "TInput", id : "attr2", tx : "", vr : ""},tmp5,{ tp : "TInput", id : "attr3", tx : "", vr : ""},tmp6,{ tp : "TInput", id : "attr4", tx : "", vr : ""},tmp7,{ tp : "TInput", id : "attr5", tx : "", vr : ""},{ tp : "Spacer", id : "gapattr", ht : 160, ln : false},{ tp : "Button", id : "setattr", tx : tmp8, ac : $bind(this,this.onSaveAttr)}]));
		var tmp = com_tilbuci_data_Global.ln.get("window-narrbattle-display");
		var tmp1 = this.ui;
		var tmp2 = { tp : "Label", id : "set", tx : com_tilbuci_data_Global.ln.get("window-narrbattle-setabout"), vr : ""};
		var tmp3 = { tp : "Label", id : "imgbgh", tx : com_tilbuci_data_Global.ln.get("window-narrbattle-imgbgh"), vr : feathers_controls_Label.VARIANT_DETAIL};
		var tmp4 = { tp : "Custom", cont : this.ui.hcontainers.h["imgbgh"]};
		var tmp5 = { tp : "Label", id : "imgbgv", tx : com_tilbuci_data_Global.ln.get("window-narrbattle-imgbgv"), vr : feathers_controls_Label.VARIANT_DETAIL};
		var tmp6 = { tp : "Custom", cont : this.ui.hcontainers.h["imgbgv"]};
		var tmp7 = { tp : "Label", id : "set", tx : com_tilbuci_data_Global.ln.get("window-narrbattle-button"), vr : feathers_controls_Label.VARIANT_DETAIL};
		var tmp8 = { tp : "Custom", cont : this.ui.hcontainers.h["imgbt"]};
		var tmp9 = { tp : "Label", id : "imgcard", tx : com_tilbuci_data_Global.ln.get("window-narrbattle-card"), vr : feathers_controls_Label.VARIANT_DETAIL};
		var tmp10 = { tp : "Custom", cont : this.ui.hcontainers.h["imgcard"]};
		var tmp11 = { tp : "Label", id : "imgattr", tx : com_tilbuci_data_Global.ln.get("window-narrbattle-imgattr"), vr : feathers_controls_Label.VARIANT_DETAIL};
		var tmp12 = { tp : "Custom", cont : this.ui.hcontainers.h["imgattr"]};
		var tmp13 = { tp : "Label", id : "font", tx : com_tilbuci_data_Global.ln.get("window-narrbattle-font"), vr : "detail"};
		var tmp14 = { tp : "Label", id : "fontsize", tx : com_tilbuci_data_Global.ln.get("window-narrbattle-fontsize"), vr : "detail"};
		var tmp15 = { tp : "Label", id : "fontc", tx : com_tilbuci_data_Global.ln.get("window-narrbattle-fontc"), vr : "detail"};
		var tmp16 = com_tilbuci_data_Global.ln.get("window-narrbattle-btset");
		this.addForm(tmp,tmp1.forge("settings",[tmp2,{ tp : "Spacer", id : "set", ht : 5, ln : false},tmp3,tmp4,tmp5,tmp6,tmp7,tmp8,tmp9,tmp10,tmp11,tmp12,tmp13,{ tp : "Select", id : "font", vl : [], sl : null},tmp14,{ tp : "Numeric", id : "fontsize", mn : 8, mx : 200, st : 1, vl : 20},tmp15,{ tp : "TInput", id : "fontc", tx : "#FFFFFF", vr : ""},{ tp : "Spacer", id : "gap", ht : 10, ln : false},{ tp : "Button", id : "set", tx : tmp16, ac : $bind(this,this.onSaveSet)}]));
		var tmp = com_tilbuci_data_Global.ln.get("window-narrbattle-sounds");
		var tmp1 = this.ui;
		var tmp2 = { tp : "Label", id : "soundsabout", tx : com_tilbuci_data_Global.ln.get("window-narrbattle-soundsabout"), vr : ""};
		var tmp3 = { tp : "Label", id : "soundpick", tx : com_tilbuci_data_Global.ln.get("window-narrbattle-soundpick"), vr : feathers_controls_Label.VARIANT_DETAIL};
		var tmp4 = { tp : "Label", id : "soundwin", tx : com_tilbuci_data_Global.ln.get("window-narrbattle-soundwin"), vr : feathers_controls_Label.VARIANT_DETAIL};
		var tmp5 = { tp : "Label", id : "soundloose", tx : com_tilbuci_data_Global.ln.get("window-narrbattle-soundloose"), vr : feathers_controls_Label.VARIANT_DETAIL};
		var tmp6 = { tp : "Label", id : "soundtie", tx : com_tilbuci_data_Global.ln.get("window-narrbattle-soundtie"), vr : feathers_controls_Label.VARIANT_DETAIL};
		var tmp7 = com_tilbuci_data_Global.ln.get("window-narrbattle-soundsave");
		this.addForm(tmp,tmp1.forge("sounds",[tmp2,{ tp : "Spacer", id : "soundsabout", ht : 10, ln : false},tmp3,{ tp : "TInput", id : "soundpick", tx : "", vr : ""},tmp4,{ tp : "TInput", id : "soundwin", tx : "", vr : ""},tmp5,{ tp : "TInput", id : "soundloose", tx : "", vr : ""},tmp6,{ tp : "TInput", id : "soundtie", tx : "", vr : ""},{ tp : "Spacer", id : "gapattr", ht : 210, ln : false},{ tp : "Button", id : "setattr", tx : tmp7, ac : $bind(this,this.onSaveSound)}]));
		com_tilbuci_ui_window_PopupWindow.prototype.startInterface.call(this);
	}
	,acStart: function() {
		this.ui.hcontainers.h["imgbt"].setWidth(960,[810,70,70]);
		this.ui.hcontainers.h["imgbgh"].setWidth(960,[810,70,70]);
		this.ui.hcontainers.h["imgbgv"].setWidth(960,[810,70,70]);
		this.ui.hcontainers.h["imgattr"].setWidth(960,[810,70,70]);
		this.ui.hcontainers.h["imgcard"].setWidth(960,[810,70,70]);
		this.ui.hcontainers.h["itgraphic"].setWidth(460,[300,70,70]);
		this.ui.inputs.h["itname"].set_text("");
		this.ui.inputs.h["itgraphic"].set_text("");
		this.ui.setSelectValue("mode","a");
		this.ui.inputs.h["attr1"].set_text(this.ui.inputs.h["attr2"].set_text(this.ui.inputs.h["attr3"].set_text(this.ui.inputs.h["attr4"].set_text(this.ui.inputs.h["attr4"].set_text("")))));
		this.ui.inputs.h["imgbt"].set_text("");
		this.ui.inputs.h["imgbgh"].set_text("");
		this.ui.inputs.h["imgbgv"].set_text("");
		this.ui.inputs.h["imgattr"].set_text("");
		this.ui.inputs.h["imgcard"].set_text("");
		this.ui.setSelectValue("font",null);
		this.ui.inputs.h["fontc"].set_text("#FFFFFF");
		this.ui.numerics.h["fontsize"].set_value(20);
		this.ui.numerics.h["cardat1"].set_value(0);
		this.ui.numerics.h["cardat2"].set_value(0);
		this.ui.numerics.h["cardat3"].set_value(0);
		this.ui.numerics.h["cardat4"].set_value(0);
		this.ui.numerics.h["cardat5"].set_value(0);
		this.ui.inputs.h["soundpick"].set_text("");
		this.ui.inputs.h["soundwin"].set_text("");
		this.ui.inputs.h["soundloose"].set_text("");
		this.ui.inputs.h["soundtie"].set_text("");
		this.ui.buttons.h["setattr"].set_width(960);
		var fnts = [];
		var _g = 0;
		var _g1 = com_tilbuci_data_Global.fonts.length;
		while(_g < _g1) {
			var n = _g++;
			fnts.push({ text : com_tilbuci_data_Global.fonts[n], value : com_tilbuci_data_Global.fonts[n]});
		}
		var _g = 0;
		var _g1 = com_tilbuci_data_GlobalPlayer.mdata.fonts;
		while(_g < _g1.length) {
			var i = _g1[_g];
			++_g;
			fnts.push({ text : i.name, value : i.name});
		}
		this.ui.setSelectOptions("font",fnts);
		if(Object.prototype.hasOwnProperty.call(com_tilbuci_data_GlobalPlayer.contraptions.bs.h,"bs")) {
			this.ui.inputs.h["imgbt"].set_text(com_tilbuci_data_GlobalPlayer.contraptions.bs.h["bs"].close);
			this.ui.inputs.h["imgbgh"].set_text(com_tilbuci_data_GlobalPlayer.contraptions.bs.h["bs"].horizontal);
			this.ui.inputs.h["imgbgv"].set_text(com_tilbuci_data_GlobalPlayer.contraptions.bs.h["bs"].vertical);
			this.ui.inputs.h["imgattr"].set_text(com_tilbuci_data_GlobalPlayer.contraptions.bs.h["bs"].attrbg);
			this.ui.inputs.h["imgcard"].set_text(com_tilbuci_data_GlobalPlayer.contraptions.bs.h["bs"].card);
			this.ui.setSelectValue("font",com_tilbuci_data_GlobalPlayer.contraptions.bs.h["bs"].font);
			this.ui.inputs.h["fontc"].set_text(com_tilbuci_data_GlobalPlayer.contraptions.bs.h["bs"].fontcolor);
			this.ui.numerics.h["fontsize"].set_value(com_tilbuci_data_GlobalPlayer.contraptions.bs.h["bs"].fontsize);
			var _g = 0;
			var _g1 = com_tilbuci_data_GlobalPlayer.contraptions.bs.h["bs"].attributes.length;
			while(_g < _g1) {
				var i = _g++;
				this.ui.inputs.h["attr" + (i + 1)].set_text(com_tilbuci_data_GlobalPlayer.contraptions.bs.h["bs"].attributes[i]);
			}
			this.ui.inputs.h["soundpick"].set_text(com_tilbuci_data_GlobalPlayer.contraptions.bs.h["bs"].soundpick);
			this.ui.inputs.h["soundwin"].set_text(com_tilbuci_data_GlobalPlayer.contraptions.bs.h["bs"].soundwin);
			this.ui.inputs.h["soundloose"].set_text(com_tilbuci_data_GlobalPlayer.contraptions.bs.h["bs"].soundloose);
			this.ui.inputs.h["soundtie"].set_text(com_tilbuci_data_GlobalPlayer.contraptions.bs.h["bs"].soundtie);
		}
		var h = this._list.h;
		var k_h = h;
		var k_keys = Object.keys(h);
		var k_length = k_keys.length;
		var k_current = 0;
		while(k_current < k_length) {
			var k = k_keys[k_current++];
			var _this = this._list;
			if(Object.prototype.hasOwnProperty.call(_this.h,k)) {
				delete(_this.h[k]);
			}
		}
		var h = com_tilbuci_data_GlobalPlayer.narrative.cards.h;
		var k_h = h;
		var k_keys = Object.keys(h);
		var k_length = k_keys.length;
		var k_current = 0;
		while(k_current < k_length) {
			var k = k_h[k_keys[k_current++]];
			var this1 = this._list;
			var k1 = k.cardname;
			var v = k.clone();
			this1.h[k1] = v;
		}
		this.showItems();
	}
	,action: function(ac,data) {
		switch(ac) {
		case "battleattr":
			this.ui.inputs.h["imgattr"].set_text(data.h["file"]);
			break;
		case "battleclose":
			this.ui.inputs.h["imgbt"].set_text(data.h["file"]);
			break;
		case "battleh":
			this.ui.inputs.h["imgbgh"].set_text(data.h["file"]);
			break;
		case "battlev":
			this.ui.inputs.h["imgbgv"].set_text(data.h["file"]);
			break;
		case "imgcard":
			this.ui.inputs.h["imgcard"].set_text(data.h["file"]);
			break;
		case "itgraphic":
			this.ui.inputs.h["itgraphic"].set_text(data.h["file"]);
			break;
		}
	}
	,showItems: function() {
		var list = [];
		var h = this._list.h;
		var k_h = h;
		var k_keys = Object.keys(h);
		var k_length = k_keys.length;
		var k_current = 0;
		while(k_current < k_length) {
			var k = k_keys[k_current++];
			list.push({ value : k, text : k});
		}
		this.ui.setListValues("items",list);
		this.ui.setListSelectValue("items",null);
	}
	,acImgbt: function(evt) {
		this._ac("battleclose");
	}
	,acImgbtdel: function(evt) {
		this.ui.inputs.h["imgbt"].set_text("");
	}
	,acImgattr: function(evt) {
		this._ac("battleattr");
	}
	,acImgattrdel: function(evt) {
		this.ui.inputs.h["imgattr"].set_text("");
	}
	,acImgbgh: function(evt) {
		this._ac("battleh");
	}
	,acImgbghdel: function(evt) {
		this.ui.inputs.h["imgbgh"].set_text("");
	}
	,acImgbgv: function(evt) {
		this._ac("battlev");
	}
	,acImgbgvdel: function(evt) {
		this.ui.inputs.h["imgbgv"].set_text("");
	}
	,acItgraphic: function(evt) {
		this._ac("itgraphic");
	}
	,acItgraphicdel: function(evt) {
		this.ui.inputs.h["itgraphic"].set_text("");
	}
	,acImgcard: function(evt) {
		this._ac("imgcard");
	}
	,acImgcarddel: function(evt) {
		this.ui.inputs.h["imgcard"].set_text("");
	}
	,onLoadIt: function(evt) {
		if(this.ui.lists.h["items"].get_selectedItem() != null) {
			var this1 = this._list;
			var key = this.ui.lists.h["items"].get_selectedItem().value;
			if(Object.prototype.hasOwnProperty.call(this1.h,key)) {
				var tmp = this.ui.inputs.h["itname"];
				var this1 = this._list;
				var key = this.ui.lists.h["items"].get_selectedItem().value;
				tmp.set_text(this1.h[key].cardname);
				var tmp = this.ui.inputs.h["itgraphic"];
				var this1 = this._list;
				var key = this.ui.lists.h["items"].get_selectedItem().value;
				tmp.set_text(this1.h[key].cardgraphic);
				var tmp = this.ui.numerics.h["cardat1"];
				var this1 = this._list;
				var key = this.ui.lists.h["items"].get_selectedItem().value;
				tmp.set_value(this1.h[key].cardattributes[0]);
				var tmp = this.ui.numerics.h["cardat2"];
				var this1 = this._list;
				var key = this.ui.lists.h["items"].get_selectedItem().value;
				tmp.set_value(this1.h[key].cardattributes[1]);
				var tmp = this.ui.numerics.h["cardat3"];
				var this1 = this._list;
				var key = this.ui.lists.h["items"].get_selectedItem().value;
				tmp.set_value(this1.h[key].cardattributes[2]);
				var tmp = this.ui.numerics.h["cardat4"];
				var this1 = this._list;
				var key = this.ui.lists.h["items"].get_selectedItem().value;
				tmp.set_value(this1.h[key].cardattributes[3]);
				var tmp = this.ui.numerics.h["cardat5"];
				var this1 = this._list;
				var key = this.ui.lists.h["items"].get_selectedItem().value;
				tmp.set_value(this1.h[key].cardattributes[4]);
			}
		}
	}
	,onRemoveIt: function(evt) {
		if(this.ui.lists.h["items"].get_selectedItem() != null) {
			var this1 = this._list;
			var key = this.ui.lists.h["items"].get_selectedItem().value;
			if(Object.prototype.hasOwnProperty.call(this1.h,key)) {
				var this1 = this._list;
				var key = this.ui.lists.h["items"].get_selectedItem().value;
				var _this = this1;
				if(Object.prototype.hasOwnProperty.call(_this.h,key)) {
					delete(_this.h[key]);
				}
				this.showItems();
			}
		}
	}
	,onSetItem: function(evt) {
		if(this.ui.inputs.h["itname"].get_text() == "" || this.ui.inputs.h["itgraphic"].get_text() == "") {
			com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("window-narrbattle-cards"),com_tilbuci_data_Global.ln.get("window-narrbattle-cardno"),320,150,com_tilbuci_data_Global.ln.get("default-ok"));
		} else {
			var this1 = this._list;
			var k = this.ui.inputs.h["itname"].get_text();
			var v = new com_tilbuci_narrative_BattleCardNarrative({ cardname : this.ui.inputs.h["itname"].get_text(), cardgraphic : this.ui.inputs.h["itgraphic"].get_text(), cardattributes : [Math.round(this.ui.numerics.h["cardat1"].get_value()),Math.round(this.ui.numerics.h["cardat2"].get_value()),Math.round(this.ui.numerics.h["cardat3"].get_value()),Math.round(this.ui.numerics.h["cardat4"].get_value()),Math.round(this.ui.numerics.h["cardat5"].get_value())]});
			this1.h[k] = v;
			this.ui.inputs.h["itname"].set_text("");
			this.ui.inputs.h["itgraphic"].set_text("");
			this.ui.numerics.h["cardat1"].set_value(this.ui.numerics.h["cardat2"].set_value(this.ui.numerics.h["cardat3"].set_value(this.ui.numerics.h["cardat4"].set_value(this.ui.numerics.h["cardat5"].set_value(0)))));
			this.showItems();
		}
	}
	,onSaveItems: function(evt) {
		var h = com_tilbuci_data_GlobalPlayer.narrative.cards.h;
		var k_h = h;
		var k_keys = Object.keys(h);
		var k_length = k_keys.length;
		var k_current = 0;
		while(k_current < k_length) {
			var k = k_keys[k_current++];
			var _this = com_tilbuci_data_GlobalPlayer.narrative.cards;
			if(Object.prototype.hasOwnProperty.call(_this.h,k)) {
				delete(_this.h[k]);
			}
		}
		var h = this._list.h;
		var k_h = h;
		var k_keys = Object.keys(h);
		var k_length = k_keys.length;
		var k_current = 0;
		while(k_current < k_length) {
			var k = k_keys[k_current++];
			var v = this._list.h[k];
			com_tilbuci_data_GlobalPlayer.narrative.cards.h[k] = v;
		}
		var tmp = com_tilbuci_data_Global.ws;
		var _g = new haxe_ds_StringMap();
		var value = com_tilbuci_data_GlobalPlayer.movie.get_mvId();
		_g.h["movie"] = value;
		var value = com_tilbuci_data_GlobalPlayer.narrative.getData();
		_g.h["data"] = value;
		tmp.send("Movie/SaveNarrative",_g,$bind(this,this.onSaveReturn));
	}
	,onSaveReturn: function(ok,ld) {
		if(ok) {
			if(ld.map.h["e"] == 1) {
				com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("window-narrbattle-cards"),com_tilbuci_data_Global.ln.get("window-narrbattle-ersave1"),320,150,com_tilbuci_data_Global.ln.get("default-ok"));
			} else if(ld.map.h["e"] == 2) {
				com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("window-narrbattle-cards"),com_tilbuci_data_Global.ln.get("window-narrbattle-ersave"),320,150,com_tilbuci_data_Global.ln.get("default-ok"));
			} else {
				com_tilbuci_data_Global.showMsg(com_tilbuci_data_Global.ln.get("window-narrbattle-oksave"));
				feathers_core_PopUpManager.removePopUp(this);
			}
		} else {
			com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("window-narrbattle-cards"),com_tilbuci_data_Global.ln.get("window-narrinv-ersave"),320,150,com_tilbuci_data_Global.ln.get("default-ok"));
		}
	}
	,onSaveSet: function(evt) {
		if(this.ui.inputs.h["imgbt"].get_text() == "" || this.ui.inputs.h["imgattr"].get_text() == "" || this.ui.inputs.h["imgcard"].get_text() == "") {
			com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("window-narrbattle-display"),com_tilbuci_data_Global.ln.get("window-narrbattle-noclose"),320,150,com_tilbuci_data_Global.ln.get("default-ok"));
		} else if(this.ui.inputs.h["imgbgh"].get_text() == "" && this.ui.inputs.h["imgbgv"].get_text() == "") {
			com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("window-narrbattle-display"),com_tilbuci_data_Global.ln.get("window-narrbattle-nobg"),320,150,com_tilbuci_data_Global.ln.get("default-ok"));
		} else if(Object.prototype.hasOwnProperty.call(com_tilbuci_data_GlobalPlayer.contraptions.bs.h,"bs")) {
			com_tilbuci_data_GlobalPlayer.contraptions.bs.h["bs"].font = this.ui.selects.h["font"].get_selectedItem().value;
			com_tilbuci_data_GlobalPlayer.contraptions.bs.h["bs"].fontcolor = com_tilbuci_statictools_StringStatic.colorHex(this.ui.inputs.h["fontc"].get_text(),"#FFFFFF");
			com_tilbuci_data_GlobalPlayer.contraptions.bs.h["bs"].fontsize = Math.round(this.ui.numerics.h["fontsize"].get_value());
			com_tilbuci_data_GlobalPlayer.contraptions.bs.h["bs"].close = this.ui.inputs.h["imgbt"].get_text();
			com_tilbuci_data_GlobalPlayer.contraptions.bs.h["bs"].card = this.ui.inputs.h["imgcard"].get_text();
			com_tilbuci_data_GlobalPlayer.contraptions.bs.h["bs"].horizontal = this.ui.inputs.h["imgbgh"].get_text();
			com_tilbuci_data_GlobalPlayer.contraptions.bs.h["bs"].vertical = this.ui.inputs.h["imgbgv"].get_text();
			com_tilbuci_data_GlobalPlayer.contraptions.bs.h["bs"].attrbg = this.ui.inputs.h["imgattr"].get_text();
			com_tilbuci_data_GlobalPlayer.contraptions.bs.h["bs"].loadGraphics();
			var tmp = com_tilbuci_data_Global.ws;
			var _g = new haxe_ds_StringMap();
			var value = com_tilbuci_data_GlobalPlayer.movie.get_mvId();
			_g.h["movie"] = value;
			var value = com_tilbuci_data_GlobalPlayer.contraptions.getData();
			_g.h["data"] = value;
			tmp.send("Movie/SaveContraptions",_g,$bind(this,this.onSaveSetReturn));
		} else {
			var contr = new com_tilbuci_contraptions_BattleContraption();
			if(contr.load({ id : "bs", font : this.ui.selects.h["font"].get_selectedItem().value, fontcolor : com_tilbuci_statictools_StringStatic.colorHex(this.ui.inputs.h["fontc"].get_text(),"#FFFFFF"), fontsize : Math.round(this.ui.numerics.h["fontsize"].get_value()), close : this.ui.inputs.h["imgbt"].get_text(), horizontal : this.ui.inputs.h["imgbgh"].get_text(), vertical : this.ui.inputs.h["imgbgv"].get_text(), attrbg : this.ui.inputs.h["imgattr"].get_text(), card : this.ui.inputs.h["imgcard"].get_text()})) {
				var h = com_tilbuci_data_GlobalPlayer.contraptions.bs.h;
				var k_h = h;
				var k_keys = Object.keys(h);
				var k_length = k_keys.length;
				var k_current = 0;
				while(k_current < k_length) {
					var k = k_keys[k_current++];
					com_tilbuci_data_GlobalPlayer.contraptions.bs.h[k].kill();
					var _this = com_tilbuci_data_GlobalPlayer.contraptions.bs;
					if(Object.prototype.hasOwnProperty.call(_this.h,k)) {
						delete(_this.h[k]);
					}
				}
				com_tilbuci_data_GlobalPlayer.contraptions.bs.h["bs"] = contr;
				var tmp = com_tilbuci_data_Global.ws;
				var _g = new haxe_ds_StringMap();
				var value = com_tilbuci_data_GlobalPlayer.movie.get_mvId();
				_g.h["movie"] = value;
				var value = com_tilbuci_data_GlobalPlayer.contraptions.getData();
				_g.h["data"] = value;
				tmp.send("Movie/SaveContraptions",_g,$bind(this,this.onSaveSetReturn));
			} else {
				com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("window-narrbattle-display"),com_tilbuci_data_Global.ln.get("window-narrbattle-errorset"),320,150,com_tilbuci_data_Global.ln.get("default-ok"));
			}
		}
	}
	,onSaveSetReturn: function(ok,ld) {
		if(ok) {
			if(ld.map.h["e"] == 1) {
				com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("window-narrbattle-display"),com_tilbuci_data_Global.ln.get("window-narrbattle-ersave1set"),320,150,com_tilbuci_data_Global.ln.get("default-ok"));
			} else if(ld.map.h["e"] == 2) {
				com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("window-narrbattle-display"),com_tilbuci_data_Global.ln.get("window-narrbattle-ersaveset"),320,150,com_tilbuci_data_Global.ln.get("default-ok"));
			} else {
				com_tilbuci_data_Global.showMsg(com_tilbuci_data_Global.ln.get("window-narrbattle-oksaveset"));
				feathers_core_PopUpManager.removePopUp(this);
			}
		} else {
			com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("window-narrbattle-display"),com_tilbuci_data_Global.ln.get("window-narrbattle-ersaveset"),320,150,com_tilbuci_data_Global.ln.get("default-ok"));
		}
	}
	,onSaveAttr: function(evt) {
		var nm1 = this.ui.inputs.h["attr1"].get_text();
		var nm2 = this.ui.inputs.h["attr2"].get_text();
		var nm3 = this.ui.inputs.h["attr3"].get_text();
		var nm4 = this.ui.inputs.h["attr4"].get_text();
		var nm5 = this.ui.inputs.h["attr5"].get_text();
		if(nm1 == "" && nm2 == "" && nm3 == "" && nm4 == "" && nm5 == "") {
			com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("window-narrbattle-attributes"),com_tilbuci_data_Global.ln.get("window-narrbattle-noattributes"),320,150,com_tilbuci_data_Global.ln.get("default-ok"));
		} else {
			if(!Object.prototype.hasOwnProperty.call(com_tilbuci_data_GlobalPlayer.contraptions.bs.h,"bs")) {
				var this1 = com_tilbuci_data_GlobalPlayer.contraptions.bs;
				var v = new com_tilbuci_contraptions_BattleContraption();
				this1.h["bs"] = v;
			}
			while(com_tilbuci_data_GlobalPlayer.contraptions.bs.h["bs"].attributes.length > 0) com_tilbuci_data_GlobalPlayer.contraptions.bs.h["bs"].attributes.shift();
			if(nm1 != "") {
				com_tilbuci_data_GlobalPlayer.contraptions.bs.h["bs"].attributes.push(nm1);
			}
			if(nm2 != "") {
				com_tilbuci_data_GlobalPlayer.contraptions.bs.h["bs"].attributes.push(nm2);
			}
			if(nm3 != "") {
				com_tilbuci_data_GlobalPlayer.contraptions.bs.h["bs"].attributes.push(nm3);
			}
			if(nm4 != "") {
				com_tilbuci_data_GlobalPlayer.contraptions.bs.h["bs"].attributes.push(nm4);
			}
			if(nm5 != "") {
				com_tilbuci_data_GlobalPlayer.contraptions.bs.h["bs"].attributes.push(nm5);
			}
			var tmp = com_tilbuci_data_Global.ws;
			var _g = new haxe_ds_StringMap();
			var value = com_tilbuci_data_GlobalPlayer.movie.get_mvId();
			_g.h["movie"] = value;
			var value = com_tilbuci_data_GlobalPlayer.contraptions.getData();
			_g.h["data"] = value;
			tmp.send("Movie/SaveContraptions",_g,$bind(this,this.onSaveAttrReturn));
		}
	}
	,onSaveAttrReturn: function(ok,ld) {
		if(ok) {
			if(ld.map.h["e"] == 1) {
				com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("window-narrbattle-attributes"),com_tilbuci_data_Global.ln.get("window-narrbattle-ersave1set"),320,150,com_tilbuci_data_Global.ln.get("default-ok"));
			} else if(ld.map.h["e"] == 2) {
				com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("window-narrbattle-attributes"),com_tilbuci_data_Global.ln.get("window-narrbattle-ersaveset"),320,150,com_tilbuci_data_Global.ln.get("default-ok"));
			} else {
				this.ui.inputs.h["attr1"].set_text(this.ui.inputs.h["attr2"].set_text(this.ui.inputs.h["attr3"].set_text(this.ui.inputs.h["attr4"].set_text(this.ui.inputs.h["attr4"].set_text("")))));
				var _g = 0;
				var _g1 = com_tilbuci_data_GlobalPlayer.contraptions.bs.h["bs"].attributes.length;
				while(_g < _g1) {
					var i = _g++;
					this.ui.inputs.h["attr" + (i + 1)].set_text(com_tilbuci_data_GlobalPlayer.contraptions.bs.h["bs"].attributes[i]);
				}
				com_tilbuci_data_Global.showMsg(com_tilbuci_data_Global.ln.get("window-narrbattle-oksaveset"));
				feathers_core_PopUpManager.removePopUp(this);
			}
		} else {
			com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("window-narrbattle-attributes"),com_tilbuci_data_Global.ln.get("window-narrbattle-ersaveset"),320,150,com_tilbuci_data_Global.ln.get("default-ok"));
		}
	}
	,onSaveSound: function(evt) {
		if(!Object.prototype.hasOwnProperty.call(com_tilbuci_data_GlobalPlayer.contraptions.bs.h,"bs")) {
			var this1 = com_tilbuci_data_GlobalPlayer.contraptions.bs;
			var v = new com_tilbuci_contraptions_BattleContraption();
			this1.h["bs"] = v;
		}
		com_tilbuci_data_GlobalPlayer.contraptions.bs.h["bs"].soundpick = this.ui.inputs.h["soundpick"].get_text();
		com_tilbuci_data_GlobalPlayer.contraptions.bs.h["bs"].soundwin = this.ui.inputs.h["soundwin"].get_text();
		com_tilbuci_data_GlobalPlayer.contraptions.bs.h["bs"].soundloose = this.ui.inputs.h["soundloose"].get_text();
		com_tilbuci_data_GlobalPlayer.contraptions.bs.h["bs"].soundtie = this.ui.inputs.h["soundtie"].get_text();
		var tmp = com_tilbuci_data_Global.ws;
		var _g = new haxe_ds_StringMap();
		var value = com_tilbuci_data_GlobalPlayer.movie.get_mvId();
		_g.h["movie"] = value;
		var value = com_tilbuci_data_GlobalPlayer.contraptions.getData();
		_g.h["data"] = value;
		tmp.send("Movie/SaveContraptions",_g,$bind(this,this.onSaveSoundReturn));
	}
	,onSaveSoundReturn: function(ok,ld) {
		if(ok) {
			if(ld.map.h["e"] == 1) {
				com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("window-narrbattle-sounds"),com_tilbuci_data_Global.ln.get("window-narrbattle-ersave1set"),320,150,com_tilbuci_data_Global.ln.get("default-ok"));
			} else if(ld.map.h["e"] == 2) {
				com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("window-narrbattle-sounds"),com_tilbuci_data_Global.ln.get("window-narrbattle-ersaveset"),320,150,com_tilbuci_data_Global.ln.get("default-ok"));
			} else {
				com_tilbuci_data_Global.showMsg(com_tilbuci_data_Global.ln.get("window-narrbattle-oksaveset"));
				feathers_core_PopUpManager.removePopUp(this);
			}
		} else {
			com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("window-narrbattle-sounds"),com_tilbuci_data_Global.ln.get("window-narrbattle-ersaveset"),320,150,com_tilbuci_data_Global.ln.get("default-ok"));
		}
	}
	,__class__: com_tilbuci_ui_window_narrative_WindowNarrBattle
});
var com_tilbuci_ui_window_narrative_WindowNarrChar = function(ac) {
	this._list = new haxe_ds_StringMap();
	com_tilbuci_ui_window_PopupWindow.call(this,ac,com_tilbuci_data_Global.ln.get("window-narrchar-title"),1000,530,false,true,true);
};
$hxClasses["com.tilbuci.ui.window.narrative.WindowNarrChar"] = com_tilbuci_ui_window_narrative_WindowNarrChar;
com_tilbuci_ui_window_narrative_WindowNarrChar.__name__ = "com.tilbuci.ui.window.narrative.WindowNarrChar";
com_tilbuci_ui_window_narrative_WindowNarrChar.__super__ = com_tilbuci_ui_window_PopupWindow;
com_tilbuci_ui_window_narrative_WindowNarrChar.prototype = $extend(com_tilbuci_ui_window_PopupWindow.prototype,{
	_list: null
	,startInterface: function(evt) {
		var tmp = com_tilbuci_data_Global.ln.get("window-narrchar-title");
		var tmp1 = this.ui;
		var tmp2 = this.ui;
		var tmp3 = { tp : "Label", id : "registered", tx : com_tilbuci_data_Global.ln.get("window-narrchar-registered"), vr : ""};
		var tmp4 = { tp : "Button", id : "load", tx : com_tilbuci_data_Global.ln.get("window-narrchar-load"), ac : $bind(this,this.loadNarr)};
		var tmp5 = { tp : "Button", id : "remove", tx : com_tilbuci_data_Global.ln.get("window-narrchar-remove"), ac : $bind(this,this.removeNarr)};
		var tmp6 = { tp : "Label", id : "id", tx : com_tilbuci_data_Global.ln.get("window-narrchar-id"), vr : "detail"};
		var tmp7 = com_tilbuci_data_Global.ln.get("window-narrchar-add");
		var tmp8 = tmp2.forge("leftcol",[tmp3,{ tp : "List", id : "registered", vl : [], sl : null, ht : 200},tmp4,tmp5,{ tp : "Spacer", id : "add", ht : 15, ln : true},tmp6,{ tp : "TInput", id : "id", tx : "", vr : ""},{ tp : "Button", id : "add", tx : tmp7, ac : $bind(this,this.addNarr)}]);
		var tmp2 = this.ui;
		var tmp3 = { tp : "Label", id : "properties", tx : com_tilbuci_data_Global.ln.get("window-narrchar-properties"), vr : ""};
		var tmp4 = { tp : "Label", id : "name", tx : com_tilbuci_data_Global.ln.get("window-narrchar-name"), vr : "detail"};
		var tmp5 = { tp : "Label", id : "about", tx : com_tilbuci_data_Global.ln.get("window-narrchar-about"), vr : "detail"};
		var tmp6 = com_tilbuci_data_Global.ln.get("window-narrchar-collection");
		this.addForm(tmp,tmp1.createColumnHolder("columns",tmp8,tmp2.forge("rightcol",[tmp3,tmp4,{ tp : "TInput", id : "name", tx : "", vr : ""},tmp5,{ tp : "TArea", id : "about", tx : "", vr : ""},{ tp : "Label", id : "collection", tx : tmp6, vr : "detail"},{ tp : "Select", id : "collection", vl : [], sl : null}]),this.ui.forge("bottom",[{ tp : "Button", id : "save", tx : com_tilbuci_data_Global.ln.get("window-narrchar-save"), ac : $bind(this,this.saveNarr)}]),420));
		this.ui.listDbClick("registered",$bind(this,this.loadNarr));
		com_tilbuci_ui_window_PopupWindow.prototype.startInterface.call(this);
	}
	,acStart: function() {
		var h = this._list.h;
		var k_h = h;
		var k_keys = Object.keys(h);
		var k_length = k_keys.length;
		var k_current = 0;
		while(k_current < k_length) {
			var k = k_keys[k_current++];
			this._list.h[k].kill();
			var _this = this._list;
			if(Object.prototype.hasOwnProperty.call(_this.h,k)) {
				delete(_this.h[k]);
			}
		}
		var h = com_tilbuci_data_GlobalPlayer.narrative.chars.h;
		var k_h = h;
		var k_keys = Object.keys(h);
		var k_length = k_keys.length;
		var k_current = 0;
		while(k_current < k_length) {
			var k = k_h[k_keys[k_current++]];
			var this1 = this._list;
			var k1 = k.id;
			var v = k.clone();
			this1.h[k1] = v;
		}
		this.clear();
		var tmp = com_tilbuci_data_Global.ws;
		var _g = new haxe_ds_StringMap();
		var value = com_tilbuci_data_GlobalPlayer.movie.get_mvId();
		_g.h["movie"] = value;
		tmp.send("Media/ListCollections",_g,$bind(this,this.onList));
	}
	,onList: function(ok,ld) {
		if(!ok) {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-narrchar-title"),com_tilbuci_data_Global.ln.get("window-narrchar-nolist"),300,180,this.stage);
			feathers_core_PopUpManager.removePopUp(this);
		} else if(ld.map.h["e"] == 0) {
			var clist = ld.map.h["list"];
			var list = [];
			var _g = 0;
			while(_g < clist.length) {
				var i = clist[_g];
				++_g;
				list.push({ text : i.title, value : i.id});
			}
			this.ui.setSelectOptions("collection",list);
		} else {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-narrchar-title"),com_tilbuci_data_Global.ln.get("window-narrchar-nolist"),300,180,this.stage);
			feathers_core_PopUpManager.removePopUp(this);
		}
	}
	,clear: function() {
		var list = [];
		var h = this._list.h;
		var k_h = h;
		var k_keys = Object.keys(h);
		var k_length = k_keys.length;
		var k_current = 0;
		while(k_current < k_length) {
			var k = k_h[k_keys[k_current++]];
			list.push({ text : k.id, value : k.id});
		}
		this.ui.setListValues("registered",list);
		this.ui.setListSelectValue("registered",null);
		this.ui.inputs.h["id"].set_text("");
		this.ui.inputs.h["name"].set_text("");
		this.ui.tareas.h["about"].set_text("");
	}
	,loadNarr: function(evt) {
		if(this.ui.lists.h["registered"].get_selectedItem() != null) {
			var this1 = this._list;
			var key = this.ui.lists.h["registered"].get_selectedItem().value;
			if(Object.prototype.hasOwnProperty.call(this1.h,key)) {
				var tmp = this.ui.inputs.h["id"];
				var this1 = this._list;
				var key = this.ui.lists.h["registered"].get_selectedItem().value;
				tmp.set_text(this1.h[key].id);
				var tmp = this.ui.inputs.h["name"];
				var this1 = this._list;
				var key = this.ui.lists.h["registered"].get_selectedItem().value;
				tmp.set_text(this1.h[key].chname);
				var tmp = this.ui.tareas.h["about"];
				var this1 = this._list;
				var key = this.ui.lists.h["registered"].get_selectedItem().value;
				tmp.set_text(this1.h[key].about);
				var tmp = this.ui;
				var this1 = this._list;
				var key = this.ui.lists.h["registered"].get_selectedItem().value;
				tmp.setSelectValue("collection",this1.h[key].collection);
			}
		}
	}
	,action: function(ac,data) {
	}
	,removeNarr: function(evt) {
		if(this.ui.lists.h["registered"].get_selectedItem() != null) {
			var this1 = this._list;
			var key = this.ui.lists.h["registered"].get_selectedItem().value;
			if(Object.prototype.hasOwnProperty.call(this1.h,key)) {
				var this1 = this._list;
				var key = this.ui.lists.h["registered"].get_selectedItem().value;
				this1.h[key].kill();
				var this1 = this._list;
				var key = this.ui.lists.h["registered"].get_selectedItem().value;
				var _this = this1;
				if(Object.prototype.hasOwnProperty.call(_this.h,key)) {
					delete(_this.h[key]);
				}
				this.clear();
			}
		}
	}
	,saveNarr: function(evt) {
		var h = com_tilbuci_data_GlobalPlayer.narrative.chars.h;
		var nar_h = h;
		var nar_keys = Object.keys(h);
		var nar_length = nar_keys.length;
		var nar_current = 0;
		while(nar_current < nar_length) {
			var nar = nar_keys[nar_current++];
			com_tilbuci_data_GlobalPlayer.narrative.chars.h[nar].kill();
			var _this = com_tilbuci_data_GlobalPlayer.narrative.chars;
			if(Object.prototype.hasOwnProperty.call(_this.h,nar)) {
				delete(_this.h[nar]);
			}
		}
		var h = this._list.h;
		var nar_h = h;
		var nar_keys = Object.keys(h);
		var nar_length = nar_keys.length;
		var nar_current = 0;
		while(nar_current < nar_length) {
			var nar = nar_keys[nar_current++];
			var this1 = com_tilbuci_data_GlobalPlayer.narrative.chars;
			var v = this._list.h[nar].clone();
			this1.h[nar] = v;
		}
		this.clear();
		var tmp = com_tilbuci_data_Global.ws;
		var _g = new haxe_ds_StringMap();
		var value = com_tilbuci_data_GlobalPlayer.movie.get_mvId();
		_g.h["movie"] = value;
		var value = com_tilbuci_data_GlobalPlayer.narrative.getData();
		_g.h["data"] = value;
		tmp.send("Movie/SaveNarrative",_g,$bind(this,this.onSaveReturn));
	}
	,addNarr: function(evt) {
		if(this.ui.inputs.h["id"].get_text().length >= 3) {
			if(this.ui.inputs.h["name"].get_text() != "") {
				var char;
				var collection = "";
				if(this.ui.selects.h["collection"].get_selectedItem() != null) {
					collection = this.ui.selects.h["collection"].get_selectedItem().value;
				}
				var this1 = this._list;
				var key = this.ui.inputs.h["id"].get_text();
				if(Object.prototype.hasOwnProperty.call(this1.h,key)) {
					var this1 = this._list;
					var key = this.ui.inputs.h["id"].get_text();
					char = this1.h[key];
					char.load({ id : this.ui.inputs.h["id"].get_text(), chname : this.ui.inputs.h["name"].get_text(), about : this.ui.tareas.h["about"].get_text(), collection : collection});
					var this1 = this._list;
					var k = this.ui.inputs.h["id"].get_text();
					this1.h[k] = char;
					this.clear();
				} else {
					char = new com_tilbuci_narrative_CharacterNarrative();
					char.load({ id : this.ui.inputs.h["id"].get_text(), chname : this.ui.inputs.h["name"].get_text(), about : this.ui.tareas.h["about"].get_text(), collection : collection});
					var this1 = this._list;
					var k = this.ui.inputs.h["id"].get_text();
					this1.h[k] = char;
					this.clear();
				}
			} else {
				com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("window-narrchar-title"),com_tilbuci_data_Global.ln.get("window-narrchar-noname"),320,150,com_tilbuci_data_Global.ln.get("default-ok"));
			}
		} else {
			com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("window-narrchar-title"),com_tilbuci_data_Global.ln.get("window-narrchar-noid"),320,150,com_tilbuci_data_Global.ln.get("default-ok"));
		}
	}
	,onSaveReturn: function(ok,ld) {
		if(ok) {
			if(ld.map.h["e"] == 1) {
				com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("window-narrchar-title"),com_tilbuci_data_Global.ln.get("window-narrchar-ersave1"),320,150,com_tilbuci_data_Global.ln.get("default-ok"));
			} else if(ld.map.h["e"] == 2) {
				com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("window-narrchar-title"),com_tilbuci_data_Global.ln.get("window-narrchar-ersave"),320,150,com_tilbuci_data_Global.ln.get("default-ok"));
			} else {
				com_tilbuci_data_Global.showMsg(com_tilbuci_data_Global.ln.get("window-narrchar-oksave"));
				feathers_core_PopUpManager.removePopUp(this);
			}
		} else {
			com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("window-narrchar-title"),com_tilbuci_data_Global.ln.get("window-narrchar-ersave"),320,150,com_tilbuci_data_Global.ln.get("default-ok"));
		}
	}
	,__class__: com_tilbuci_ui_window_narrative_WindowNarrChar
});
var com_tilbuci_ui_window_narrative_WindowNarrDflow = function(ac) {
	com_tilbuci_ui_window_PopupWindow.call(this,ac,com_tilbuci_data_Global.ln.get("window-narrdflow-title"),1000,580,true,true,true);
};
$hxClasses["com.tilbuci.ui.window.narrative.WindowNarrDflow"] = com_tilbuci_ui_window_narrative_WindowNarrDflow;
com_tilbuci_ui_window_narrative_WindowNarrDflow.__name__ = "com.tilbuci.ui.window.narrative.WindowNarrDflow";
com_tilbuci_ui_window_narrative_WindowNarrDflow.__super__ = com_tilbuci_ui_window_PopupWindow;
com_tilbuci_ui_window_narrative_WindowNarrDflow.prototype = $extend(com_tilbuci_ui_window_PopupWindow.prototype,{
	startInterface: function(evt) {
		this.ui.createHContainer("imgbt");
		this.ui.createTInput("imgbt","","",this.ui.hcontainers.h["imgbt"],false);
		var tmp = this.ui;
		var tmp1 = openfl_utils_Assets.getBitmapData("btOpenfile");
		var tmp2 = this.ui.hcontainers.h["imgbt"];
		tmp.createIconButton("imgbt",$bind(this,this.acImgbt),new openfl_display_Bitmap(tmp1),null,tmp2,false);
		var tmp = this.ui;
		var tmp1 = openfl_utils_Assets.getBitmapData("btDel");
		var tmp2 = this.ui.hcontainers.h["imgbt"];
		tmp.createIconButton("imgimgbtdel",$bind(this,this.acImgbtdel),new openfl_display_Bitmap(tmp1),null,tmp2,false);
		this.ui.inputs.h["imgbt"].set_enabled(false);
		var tmp = com_tilbuci_data_Global.ln.get("window-narrdflow-settings");
		var tmp1 = this.ui;
		var tmp2 = { tp : "Label", id : "set", tx : com_tilbuci_data_Global.ln.get("window-narrdflow-setabout"), vr : ""};
		var tmp3 = { tp : "Label", id : "set", tx : com_tilbuci_data_Global.ln.get("window-narrdflow-button"), vr : feathers_controls_Label.VARIANT_DETAIL};
		var tmp4 = { tp : "Custom", cont : this.ui.hcontainers.h["imgbt"]};
		var tmp5 = { tp : "Label", id : "position", tx : com_tilbuci_data_Global.ln.get("window-narrdflow-position"), vr : feathers_controls_Label.VARIANT_DETAIL};
		var tmp6 = { tp : "Select", id : "position", vl : [{ value : "top", text : com_tilbuci_data_Global.ln.get("window-narrdflow-top")},{ value : "topleft", text : com_tilbuci_data_Global.ln.get("window-narrdflow-topleft")},{ value : "topright", text : com_tilbuci_data_Global.ln.get("window-narrdflow-topright")},{ value : "center", text : com_tilbuci_data_Global.ln.get("window-narrdflow-center")},{ value : "centerleft", text : com_tilbuci_data_Global.ln.get("window-narrdflow-centerleft")},{ value : "centerright", text : com_tilbuci_data_Global.ln.get("window-narrdflow-centerright")},{ value : "bottom", text : com_tilbuci_data_Global.ln.get("window-narrdflow-bottom")},{ value : "bottomleft", text : com_tilbuci_data_Global.ln.get("window-narrdflow-bottomleft")},{ value : "bottomright", text : com_tilbuci_data_Global.ln.get("window-narrdflow-bottomright")}], sl : "center"};
		var tmp7 = { tp : "Label", id : "gap", tx : com_tilbuci_data_Global.ln.get("window-narrdflow-gap"), vr : feathers_controls_Label.VARIANT_DETAIL};
		var tmp8 = { tp : "Label", id : "font", tx : com_tilbuci_data_Global.ln.get("window-narrdflow-font"), vr : "detail"};
		var tmp9 = { tp : "Label", id : "fontsize", tx : com_tilbuci_data_Global.ln.get("window-narrdflow-fontsize"), vr : "detail"};
		var tmp10 = { tp : "Label", id : "fontc", tx : com_tilbuci_data_Global.ln.get("window-narrdflow-fontc"), vr : "detail"};
		var tmp11 = com_tilbuci_data_Global.ln.get("window-narrdflow-btset");
		this.addForm(tmp,tmp1.forge("settings",[tmp2,{ tp : "Spacer", id : "set", ht : 10, ln : false},tmp3,tmp4,tmp5,tmp6,tmp7,{ tp : "Numeric", id : "gap", mn : 0, mx : 1000, st : 1, vl : 10},tmp8,{ tp : "Select", id : "font", vl : [], sl : null},tmp9,{ tp : "Numeric", id : "fontsize", mn : 8, mx : 200, st : 1, vl : 20},tmp10,{ tp : "TInput", id : "fontc", tx : "#FFFFFF", vr : ""},{ tp : "Spacer", id : "gap", ht : 110, ln : false},{ tp : "Button", id : "set", tx : tmp11, ac : $bind(this,this.onSaveSet)}]));
		var tmp = com_tilbuci_data_Global.ln.get("window-narrdflow-flow");
		var tmp1 = this.ui;
		var tmp2 = this.ui;
		var tmp3 = { tp : "Label", id : "scenes", tx : com_tilbuci_data_Global.ln.get("window-narrdflow-scenes"), vr : ""};
		var tmp4 = com_tilbuci_data_Global.ln.get("window-narrdflow-loadscene");
		var tmp5 = tmp2.forge("leftcol",[tmp3,{ tp : "List", id : "scenes", vl : [], sl : null, ht : 435, ch : $bind(this,this.sceneSelected)},{ tp : "Button", id : "scenes", tx : tmp4, ac : $bind(this,this.onScene)}]);
		var tmp2 = this.ui;
		var tmp3 = { tp : "Label", id : "options", tx : com_tilbuci_data_Global.ln.get("window-narrdflow-options"), vr : ""};
		var tmp4 = com_tilbuci_data_Global.ln.get("window-narrdflow-loadoption");
		this.addForm(tmp,tmp1.createColumnHolder("columns",tmp5,tmp2.forge("rightcol",[tmp3,{ tp : "List", id : "options", vl : [], sl : null, ht : 435},{ tp : "Button", id : "options", tx : tmp4, ac : $bind(this,this.onOption)}])));
		com_tilbuci_ui_window_PopupWindow.prototype.startInterface.call(this);
	}
	,acStart: function() {
		this.ui.hcontainers.h["imgbt"].setWidth(960,[810,70,70]);
		var fnts = [];
		var _g = 0;
		var _g1 = com_tilbuci_data_Global.fonts.length;
		while(_g < _g1) {
			var n = _g++;
			fnts.push({ text : com_tilbuci_data_Global.fonts[n], value : com_tilbuci_data_Global.fonts[n]});
		}
		var _g = 0;
		var _g1 = com_tilbuci_data_GlobalPlayer.mdata.fonts;
		while(_g < _g1.length) {
			var i = _g1[_g];
			++_g;
			fnts.push({ text : i.name, value : i.name});
		}
		this.ui.setSelectOptions("font",fnts);
		if(Object.prototype.hasOwnProperty.call(com_tilbuci_data_GlobalPlayer.contraptions.dflow.h,"dflow")) {
			this.ui.inputs.h["imgbt"].set_text(com_tilbuci_data_GlobalPlayer.contraptions.dflow.h["dflow"].buton);
			this.ui.setSelectValue("position",com_tilbuci_data_GlobalPlayer.contraptions.dflow.h["dflow"].position);
			this.ui.numerics.h["gap"].set_value(com_tilbuci_data_GlobalPlayer.contraptions.dflow.h["dflow"].gap);
			this.ui.setSelectValue("font",com_tilbuci_data_GlobalPlayer.contraptions.dflow.h["dflow"].font);
			this.ui.numerics.h["fontsize"].set_value(com_tilbuci_data_GlobalPlayer.contraptions.dflow.h["dflow"].fontsize);
			this.ui.inputs.h["fontc"].set_text(com_tilbuci_statictools_StringStatic.colorHex(com_tilbuci_data_GlobalPlayer.contraptions.dflow.h["dflow"].fontcolor,"#FFFFFF"));
		}
		this.ui.setListValues("scenes",[]);
		this.ui.setListValues("options",[]);
		var tmp = com_tilbuci_data_Global.ws;
		var _g = new haxe_ds_StringMap();
		var value = com_tilbuci_data_GlobalPlayer.movie.get_mvId();
		_g.h["movie"] = value;
		tmp.send("Scene/ListDflow",_g,$bind(this,this.onList));
	}
	,onList: function(ok,ld) {
		if(!ok) {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-narrdflow-title"),com_tilbuci_data_Global.ln.get("window-narrdflow-nolist"),300,180,this.stage);
			feathers_core_PopUpManager.removePopUp(this);
		} else if(ld.map.h["e"] == 0) {
			var ar = ld.map.h["list"];
			if(ar.length == 0) {
				com_tilbuci_data_Global.showMsg(com_tilbuci_data_Global.ln.get("window-narrdflow-nooption"));
			} else {
				var list = [];
				var _g = 0;
				while(_g < ar.length) {
					var i = ar[_g];
					++_g;
					var sdo = i;
					if(sdo != null) {
						list.push({ text : sdo.title, value : sdo});
					}
				}
				this.ui.setListValues("scenes",list);
			}
		} else {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-narrdflow-title"),com_tilbuci_data_Global.ln.get("window-narrdflow-nolist"),300,180,this.stage);
			feathers_core_PopUpManager.removePopUp(this);
		}
	}
	,action: function(ac,data) {
		if(ac == "dflowbrowseimgbt") {
			this.ui.inputs.h["imgbt"].set_text(data.h["file"]);
		}
	}
	,acImgbt: function(evt) {
		this._ac("dflowbrowseimgbt");
	}
	,acImgbtdel: function(evt) {
		this.ui.inputs.h["imgbt"].set_text("");
	}
	,onSaveSet: function(evt) {
		if(this.ui.inputs.h["imgbt"].get_text() == "") {
			com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("window-narrdflow-title"),com_tilbuci_data_Global.ln.get("window-narrdflow-nobutton"),320,150,com_tilbuci_data_Global.ln.get("default-ok"));
		} else {
			var contr = new com_tilbuci_contraptions_DflowContraption();
			if(contr.load({ id : "dflow", font : this.ui.selects.h["font"].get_selectedItem().value, fontcolor : com_tilbuci_statictools_StringStatic.colorHex(this.ui.inputs.h["fontc"].get_text(),"#FFFFFF"), fontsize : Math.round(this.ui.numerics.h["fontsize"].get_value()), buton : this.ui.inputs.h["imgbt"].get_text(), position : this.ui.selects.h["position"].get_selectedItem().value, gap : Math.round(this.ui.numerics.h["gap"].get_value())})) {
				var h = com_tilbuci_data_GlobalPlayer.contraptions.dflow.h;
				var k_h = h;
				var k_keys = Object.keys(h);
				var k_length = k_keys.length;
				var k_current = 0;
				while(k_current < k_length) {
					var k = k_keys[k_current++];
					com_tilbuci_data_GlobalPlayer.contraptions.dflow.h[k].kill();
					var _this = com_tilbuci_data_GlobalPlayer.contraptions.dflow;
					if(Object.prototype.hasOwnProperty.call(_this.h,k)) {
						delete(_this.h[k]);
					}
				}
				com_tilbuci_data_GlobalPlayer.contraptions.dflow.h["dflow"] = contr;
				var tmp = com_tilbuci_data_Global.ws;
				var _g = new haxe_ds_StringMap();
				var value = com_tilbuci_data_GlobalPlayer.movie.get_mvId();
				_g.h["movie"] = value;
				var value = com_tilbuci_data_GlobalPlayer.contraptions.getData();
				_g.h["data"] = value;
				tmp.send("Movie/SaveContraptions",_g,$bind(this,this.onSaveReturn));
			} else {
				com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("window-narrdflow-title"),com_tilbuci_data_Global.ln.get("window-narrdflow-errorset"),320,150,com_tilbuci_data_Global.ln.get("default-ok"));
			}
		}
	}
	,onSaveReturn: function(ok,ld) {
		if(ok) {
			if(ld.map.h["e"] == 1) {
				com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("window-narrdflow-title"),com_tilbuci_data_Global.ln.get("window-narrdflow-ersave1"),320,150,com_tilbuci_data_Global.ln.get("default-ok"));
			} else if(ld.map.h["e"] == 2) {
				com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("window-narrdflow-title"),com_tilbuci_data_Global.ln.get("window-narrdflow-ersave"),320,150,com_tilbuci_data_Global.ln.get("default-ok"));
			} else {
				com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("window-narrdflow-title"),com_tilbuci_data_Global.ln.get("window-narrdflow-oksave"),320,150,com_tilbuci_data_Global.ln.get("default-ok"));
			}
		} else {
			com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("window-narrdflow-title"),com_tilbuci_data_Global.ln.get("window-narrdflow-ersave"),320,150,com_tilbuci_data_Global.ln.get("default-ok"));
		}
	}
	,sceneSelected: function(evt) {
		if(this.ui.lists.h["scenes"].get_selectedItem() != null) {
			var list = [];
			var sco = this.ui.lists.h["scenes"].get_selectedItem().value;
			if(sco != null) {
				if(sco.df1[0] != "" && sco.df1[1] != "") {
					list.push({ text : sco.df1[0], value : sco.df1[1]});
				}
				if(sco.df2[0] != "" && sco.df2[1] != "") {
					list.push({ text : sco.df2[0], value : sco.df2[1]});
				}
				if(sco.df3[0] != "" && sco.df3[1] != "") {
					list.push({ text : sco.df3[0], value : sco.df3[1]});
				}
				if(sco.df4[0] != "" && sco.df4[1] != "") {
					list.push({ text : sco.df4[0], value : sco.df4[1]});
				}
			}
			this.ui.setListValues("options",list);
		}
	}
	,onScene: function(evt) {
		if(this.ui.lists.h["scenes"].get_selectedItem() != null) {
			var sco = this.ui.lists.h["scenes"].get_selectedItem().value;
			if(sco != null) {
				com_tilbuci_data_GlobalPlayer.area.imgSelect();
				com_tilbuci_data_GlobalPlayer.movie.loadScene(sco.id);
			}
		}
	}
	,onOption: function(evt) {
		if(this.ui.lists.h["options"].get_selectedItem() != null) {
			com_tilbuci_data_GlobalPlayer.area.imgSelect();
			com_tilbuci_data_GlobalPlayer.movie.loadScene(this.ui.lists.h["options"].get_selectedItem().value);
		}
	}
	,__class__: com_tilbuci_ui_window_narrative_WindowNarrDflow
});
var com_tilbuci_ui_window_narrative_WindowNarrInv = function(ac) {
	this._list = new haxe_ds_StringMap();
	com_tilbuci_ui_window_PopupWindow.call(this,ac,com_tilbuci_data_Global.ln.get("window-narrinv-title"),1000,580,true,true,true);
};
$hxClasses["com.tilbuci.ui.window.narrative.WindowNarrInv"] = com_tilbuci_ui_window_narrative_WindowNarrInv;
com_tilbuci_ui_window_narrative_WindowNarrInv.__name__ = "com.tilbuci.ui.window.narrative.WindowNarrInv";
com_tilbuci_ui_window_narrative_WindowNarrInv.__super__ = com_tilbuci_ui_window_PopupWindow;
com_tilbuci_ui_window_narrative_WindowNarrInv.prototype = $extend(com_tilbuci_ui_window_PopupWindow.prototype,{
	_list: null
	,_acsnippet: null
	,startInterface: function(evt) {
		this.ui.createHContainer("imgbgh");
		this.ui.createTInput("imgbgh","","",this.ui.hcontainers.h["imgbgh"],false);
		var tmp = this.ui;
		var tmp1 = openfl_utils_Assets.getBitmapData("btOpenfile");
		var tmp2 = this.ui.hcontainers.h["imgbgh"];
		tmp.createIconButton("imgbgh",$bind(this,this.acImgbgh),new openfl_display_Bitmap(tmp1),null,tmp2,false);
		var tmp = this.ui;
		var tmp1 = openfl_utils_Assets.getBitmapData("btDel");
		var tmp2 = this.ui.hcontainers.h["imgbgh"];
		tmp.createIconButton("imimgbghdel",$bind(this,this.acImgbghdel),new openfl_display_Bitmap(tmp1),null,tmp2,false);
		this.ui.inputs.h["imgbgh"].set_enabled(false);
		this.ui.createHContainer("imgbgv");
		this.ui.createTInput("imgbgv","","",this.ui.hcontainers.h["imgbgv"],false);
		var tmp = this.ui;
		var tmp1 = openfl_utils_Assets.getBitmapData("btOpenfile");
		var tmp2 = this.ui.hcontainers.h["imgbgv"];
		tmp.createIconButton("imgbgv",$bind(this,this.acImgbgv),new openfl_display_Bitmap(tmp1),null,tmp2,false);
		var tmp = this.ui;
		var tmp1 = openfl_utils_Assets.getBitmapData("btDel");
		var tmp2 = this.ui.hcontainers.h["imgbgv"];
		tmp.createIconButton("imimgbgvdel",$bind(this,this.acImgbgvdel),new openfl_display_Bitmap(tmp1),null,tmp2,false);
		this.ui.inputs.h["imgbgv"].set_enabled(false);
		this.ui.createHContainer("imgbt");
		this.ui.createTInput("imgbt","","",this.ui.hcontainers.h["imgbt"],false);
		var tmp = this.ui;
		var tmp1 = openfl_utils_Assets.getBitmapData("btOpenfile");
		var tmp2 = this.ui.hcontainers.h["imgbt"];
		tmp.createIconButton("imgbt",$bind(this,this.acImgbt),new openfl_display_Bitmap(tmp1),null,tmp2,false);
		var tmp = this.ui;
		var tmp1 = openfl_utils_Assets.getBitmapData("btDel");
		var tmp2 = this.ui.hcontainers.h["imgbt"];
		tmp.createIconButton("imgimgbtdel",$bind(this,this.acImgbtdel),new openfl_display_Bitmap(tmp1),null,tmp2,false);
		this.ui.inputs.h["imgbt"].set_enabled(false);
		this.ui.createHContainer("itgraphic");
		this.ui.createTInput("itgraphic","","",this.ui.hcontainers.h["itgraphic"],false);
		var tmp = this.ui;
		var tmp1 = openfl_utils_Assets.getBitmapData("btOpenfile");
		var tmp2 = this.ui.hcontainers.h["itgraphic"];
		tmp.createIconButton("itgraphic",$bind(this,this.acItgraphic),new openfl_display_Bitmap(tmp1),null,tmp2,false);
		var tmp = this.ui;
		var tmp1 = openfl_utils_Assets.getBitmapData("btDel");
		var tmp2 = this.ui.hcontainers.h["itgraphic"];
		tmp.createIconButton("itgraphicdel",$bind(this,this.acItgraphicdel),new openfl_display_Bitmap(tmp1),null,tmp2,false);
		this.ui.inputs.h["itgraphic"].set_enabled(false);
		this._acsnippet = new com_tilbuci_ui_component_ActionArea(460,267);
		var tmp = com_tilbuci_data_Global.ln.get("window-narrinv-items");
		var tmp1 = this.ui;
		var tmp2 = this.ui;
		var tmp3 = { tp : "Label", id : "items", tx : com_tilbuci_data_Global.ln.get("window-narrinv-items"), vr : ""};
		var tmp4 = { tp : "Button", id : "loadit", tx : com_tilbuci_data_Global.ln.get("window-narrinv-loaditem"), ac : $bind(this,this.onLoadIt)};
		var tmp5 = com_tilbuci_data_Global.ln.get("window-narrinv-removeitem");
		var tmp6 = tmp2.forge("leftcol",[tmp3,{ tp : "List", id : "items", vl : [], sl : null, ht : 350},tmp4,{ tp : "Button", id : "removeit", tx : tmp5, ac : $bind(this,this.onRemoveIt)}]);
		var tmp2 = this.ui;
		var tmp3 = { tp : "Label", id : "itname", tx : com_tilbuci_data_Global.ln.get("window-narrinv-itname"), vr : "detail"};
		var tmp4 = { tp : "Label", id : "set", tx : com_tilbuci_data_Global.ln.get("window-narrinv-itgraphic"), vr : feathers_controls_Label.VARIANT_DETAIL};
		var tmp5 = { tp : "Custom", cont : this.ui.hcontainers.h["itgraphic"]};
		var tmp7 = { tp : "Label", id : "set", tx : com_tilbuci_data_Global.ln.get("window-narrinv-itaction"), vr : feathers_controls_Label.VARIANT_DETAIL};
		var tmp8 = { tp : "Custom", cont : this._acsnippet};
		var tmp9 = com_tilbuci_data_Global.ln.get("window-narrinv-saveitem");
		this.addForm(tmp,tmp1.createColumnHolder("columns",tmp6,tmp2.forge("rightcol",[tmp3,{ tp : "TInput", id : "itname", tx : "", vr : ""},tmp4,tmp5,tmp7,tmp8,{ tp : "Spacer", id : "saveitem", ht : 10, ln : false},{ tp : "Button", id : "saveitem", tx : tmp9, ac : $bind(this,this.onSetItem)}]),this.ui.forge("bottom",[{ tp : "Button", id : "iconsave", tx : com_tilbuci_data_Global.ln.get("window-narrinv-saveinventory"), ac : $bind(this,this.onSaveItems)}]),460));
		this.ui.listDbClick("items",$bind(this,this.onLoadIt));
		var tmp = com_tilbuci_data_Global.ln.get("window-narrinv-settings");
		var tmp1 = this.ui;
		var tmp2 = { tp : "Label", id : "set", tx : com_tilbuci_data_Global.ln.get("window-narrinv-setabout"), vr : ""};
		var tmp3 = { tp : "Label", id : "mode", tx : com_tilbuci_data_Global.ln.get("window-narrinv-mode"), vr : "detail"};
		var tmp4 = { tp : "Select", id : "mode", vl : [{ text : com_tilbuci_data_Global.ln.get("window-narrinv-modeall"), value : "a"},{ text : com_tilbuci_data_Global.ln.get("window-narrinv-modeconsumable"), value : "c"},{ text : com_tilbuci_data_Global.ln.get("window-narrinv-modek"), value : "k"}], sl : null};
		var tmp5 = { tp : "Label", id : "imgbgh", tx : com_tilbuci_data_Global.ln.get("window-narrinv-imgbgh"), vr : feathers_controls_Label.VARIANT_DETAIL};
		var tmp6 = { tp : "Custom", cont : this.ui.hcontainers.h["imgbgh"]};
		var tmp7 = { tp : "Label", id : "imgbgv", tx : com_tilbuci_data_Global.ln.get("window-narrinv-imgbgv"), vr : feathers_controls_Label.VARIANT_DETAIL};
		var tmp8 = { tp : "Custom", cont : this.ui.hcontainers.h["imgbgv"]};
		var tmp9 = { tp : "Label", id : "set", tx : com_tilbuci_data_Global.ln.get("window-narrinv-button"), vr : feathers_controls_Label.VARIANT_DETAIL};
		var tmp10 = { tp : "Custom", cont : this.ui.hcontainers.h["imgbt"]};
		var tmp11 = { tp : "Label", id : "sound", tx : com_tilbuci_data_Global.ln.get("window-narrinv-sound"), vr : "detail"};
		var tmp12 = { tp : "Label", id : "font", tx : com_tilbuci_data_Global.ln.get("window-narrinv-font"), vr : "detail"};
		var tmp13 = { tp : "Label", id : "fontsize", tx : com_tilbuci_data_Global.ln.get("window-narrinv-fontsize"), vr : "detail"};
		var tmp14 = { tp : "Label", id : "fontc", tx : com_tilbuci_data_Global.ln.get("window-narrinv-fontc"), vr : "detail"};
		var tmp15 = com_tilbuci_data_Global.ln.get("window-narrinv-btset");
		this.addForm(tmp,tmp1.forge("settings",[tmp2,{ tp : "Spacer", id : "set", ht : 5, ln : false},tmp3,tmp4,tmp5,tmp6,tmp7,tmp8,tmp9,tmp10,tmp11,{ tp : "TInput", id : "sound", tx : "", vr : ""},tmp12,{ tp : "Select", id : "font", vl : [], sl : null},tmp13,{ tp : "Numeric", id : "fontsize", mn : 8, mx : 200, st : 1, vl : 20},tmp14,{ tp : "TInput", id : "fontc", tx : "#FFFFFF", vr : ""},{ tp : "Spacer", id : "gap", ht : 10, ln : false},{ tp : "Button", id : "set", tx : tmp15, ac : $bind(this,this.onSaveSet)}]));
		com_tilbuci_ui_window_PopupWindow.prototype.startInterface.call(this);
	}
	,acStart: function() {
		this.ui.hcontainers.h["imgbt"].setWidth(960,[810,70,70]);
		this.ui.hcontainers.h["imgbgh"].setWidth(960,[810,70,70]);
		this.ui.hcontainers.h["imgbgv"].setWidth(960,[810,70,70]);
		this.ui.hcontainers.h["itgraphic"].setWidth(460,[300,70,70]);
		this.ui.inputs.h["itname"].set_text("");
		this.ui.inputs.h["itgraphic"].set_text("");
		this.ui.setSelectValue("mode","a");
		this._acsnippet.setText("");
		var fnts = [];
		var _g = 0;
		var _g1 = com_tilbuci_data_Global.fonts.length;
		while(_g < _g1) {
			var n = _g++;
			fnts.push({ text : com_tilbuci_data_Global.fonts[n], value : com_tilbuci_data_Global.fonts[n]});
		}
		var _g = 0;
		var _g1 = com_tilbuci_data_GlobalPlayer.mdata.fonts;
		while(_g < _g1.length) {
			var i = _g1[_g];
			++_g;
			fnts.push({ text : i.name, value : i.name});
		}
		this.ui.setSelectOptions("font",fnts);
		if(Object.prototype.hasOwnProperty.call(com_tilbuci_data_GlobalPlayer.contraptions.inv.h,"inv")) {
			this.ui.inputs.h["imgbt"].set_text(com_tilbuci_data_GlobalPlayer.contraptions.inv.h["inv"].close);
			this.ui.inputs.h["imgbgh"].set_text(com_tilbuci_data_GlobalPlayer.contraptions.inv.h["inv"].horizontal);
			this.ui.inputs.h["imgbgv"].set_text(com_tilbuci_data_GlobalPlayer.contraptions.inv.h["inv"].vertical);
			this.ui.setSelectValue("font",com_tilbuci_data_GlobalPlayer.contraptions.inv.h["inv"].font);
			this.ui.inputs.h["fontc"].set_text(com_tilbuci_data_GlobalPlayer.contraptions.inv.h["inv"].fontcolor);
			this.ui.numerics.h["fontsize"].set_value(com_tilbuci_data_GlobalPlayer.contraptions.inv.h["inv"].fontsize);
			this.ui.setSelectValue("mode",com_tilbuci_data_GlobalPlayer.contraptions.inv.h["inv"].mode);
			this.ui.inputs.h["sound"].set_text(com_tilbuci_data_GlobalPlayer.contraptions.inv.h["inv"].sound);
		}
		var h = this._list.h;
		var k_h = h;
		var k_keys = Object.keys(h);
		var k_length = k_keys.length;
		var k_current = 0;
		while(k_current < k_length) {
			var k = k_keys[k_current++];
			this._list.h[k].kill();
			var _this = this._list;
			if(Object.prototype.hasOwnProperty.call(_this.h,k)) {
				delete(_this.h[k]);
			}
		}
		var h = com_tilbuci_data_GlobalPlayer.narrative.items.h;
		var k_h = h;
		var k_keys = Object.keys(h);
		var k_length = k_keys.length;
		var k_current = 0;
		while(k_current < k_length) {
			var k = k_h[k_keys[k_current++]];
			var this1 = this._list;
			var k1 = k.itname;
			var v = k.clone();
			this1.h[k1] = v;
		}
		this.showItems();
	}
	,action: function(ac,data) {
		switch(ac) {
		case "inventclose":
			this.ui.inputs.h["imgbt"].set_text(data.h["file"]);
			break;
		case "inventh":
			this.ui.inputs.h["imgbgh"].set_text(data.h["file"]);
			break;
		case "inventitem":
			this.ui.inputs.h["itgraphic"].set_text(data.h["file"]);
			break;
		case "inventv":
			this.ui.inputs.h["imgbgv"].set_text(data.h["file"]);
			break;
		}
	}
	,showItems: function() {
		var list = [];
		var h = this._list.h;
		var k_h = h;
		var k_keys = Object.keys(h);
		var k_length = k_keys.length;
		var k_current = 0;
		while(k_current < k_length) {
			var k = k_keys[k_current++];
			list.push({ value : k, text : k});
		}
		this.ui.setListValues("items",list);
		this.ui.setListSelectValue("items",null);
	}
	,acImgbt: function(evt) {
		this._ac("inventclose");
	}
	,acImgbtdel: function(evt) {
		this.ui.inputs.h["imgbt"].set_text("");
	}
	,acImgbgh: function(evt) {
		this._ac("inventh");
	}
	,acImgbghdel: function(evt) {
		this.ui.inputs.h["imgbgh"].set_text("");
	}
	,acImgbgv: function(evt) {
		this._ac("inventv");
	}
	,acImgbgvdel: function(evt) {
		this.ui.inputs.h["imgbgv"].set_text("");
	}
	,acItgraphic: function(evt) {
		this._ac("inventitem");
	}
	,acItgraphicdel: function(evt) {
		this.ui.inputs.h["itgraphic"].set_text("");
	}
	,onLoadIt: function(evt) {
		if(this.ui.lists.h["items"].get_selectedItem() != null) {
			var this1 = this._list;
			var key = this.ui.lists.h["items"].get_selectedItem().value;
			if(Object.prototype.hasOwnProperty.call(this1.h,key)) {
				var tmp = this.ui.inputs.h["itname"];
				var this1 = this._list;
				var key = this.ui.lists.h["items"].get_selectedItem().value;
				tmp.set_text(this1.h[key].itname);
				var tmp = this.ui.inputs.h["itgraphic"];
				var this1 = this._list;
				var key = this.ui.lists.h["items"].get_selectedItem().value;
				tmp.set_text(this1.h[key].itgraphic);
				var tmp = this._acsnippet;
				var this1 = this._list;
				var key = this.ui.lists.h["items"].get_selectedItem().value;
				tmp.setText(this1.h[key].itaction);
			}
		}
	}
	,onRemoveIt: function(evt) {
		if(this.ui.lists.h["items"].get_selectedItem() != null) {
			var this1 = this._list;
			var key = this.ui.lists.h["items"].get_selectedItem().value;
			if(Object.prototype.hasOwnProperty.call(this1.h,key)) {
				var this1 = this._list;
				var key = this.ui.lists.h["items"].get_selectedItem().value;
				var _this = this1;
				if(Object.prototype.hasOwnProperty.call(_this.h,key)) {
					delete(_this.h[key]);
				}
				this.showItems();
			}
		}
	}
	,onSetItem: function(evt) {
		if(this.ui.inputs.h["itname"].get_text() == "" || this.ui.inputs.h["itgraphic"].get_text() == "") {
			com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("window-narrinv-titleitem"),com_tilbuci_data_Global.ln.get("window-narrinv-itemno"),320,150,com_tilbuci_data_Global.ln.get("default-ok"));
		} else {
			var this1 = this._list;
			var k = this.ui.inputs.h["itname"].get_text();
			var v = new com_tilbuci_narrative_InvItemNarrative({ itname : this.ui.inputs.h["itname"].get_text(), ittype : "c", itgraphic : this.ui.inputs.h["itgraphic"].get_text(), itaction : this._acsnippet.getText()});
			this1.h[k] = v;
			this.ui.inputs.h["itname"].set_text("");
			this.ui.inputs.h["itgraphic"].set_text("");
			this._acsnippet.setText("");
			this.showItems();
		}
	}
	,onSaveItems: function(evt) {
		var h = com_tilbuci_data_GlobalPlayer.narrative.items.h;
		var k_h = h;
		var k_keys = Object.keys(h);
		var k_length = k_keys.length;
		var k_current = 0;
		while(k_current < k_length) {
			var k = k_keys[k_current++];
			com_tilbuci_data_GlobalPlayer.narrative.items.h[k].kill();
			var _this = com_tilbuci_data_GlobalPlayer.narrative.items;
			if(Object.prototype.hasOwnProperty.call(_this.h,k)) {
				delete(_this.h[k]);
			}
		}
		var h = this._list.h;
		var k_h = h;
		var k_keys = Object.keys(h);
		var k_length = k_keys.length;
		var k_current = 0;
		while(k_current < k_length) {
			var k = k_keys[k_current++];
			var v = this._list.h[k];
			com_tilbuci_data_GlobalPlayer.narrative.items.h[k] = v;
			var _this = this._list;
			if(Object.prototype.hasOwnProperty.call(_this.h,k)) {
				delete(_this.h[k]);
			}
		}
		var tmp = com_tilbuci_data_Global.ws;
		var _g = new haxe_ds_StringMap();
		var value = com_tilbuci_data_GlobalPlayer.movie.get_mvId();
		_g.h["movie"] = value;
		var value = com_tilbuci_data_GlobalPlayer.narrative.getData();
		_g.h["data"] = value;
		tmp.send("Movie/SaveNarrative",_g,$bind(this,this.onSaveReturn));
	}
	,onSaveReturn: function(ok,ld) {
		if(ok) {
			if(ld.map.h["e"] == 1) {
				com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("window-narrinv-titleitem"),com_tilbuci_data_Global.ln.get("window-narrinv-ersave1"),320,150,com_tilbuci_data_Global.ln.get("default-ok"));
			} else if(ld.map.h["e"] == 2) {
				com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("window-narrinv-titleitem"),com_tilbuci_data_Global.ln.get("window-narrinv-ersave"),320,150,com_tilbuci_data_Global.ln.get("default-ok"));
			} else {
				com_tilbuci_data_Global.showMsg(com_tilbuci_data_Global.ln.get("window-narrinv-oksave"));
				feathers_core_PopUpManager.removePopUp(this);
			}
		} else {
			com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("window-narrinv-titleitem"),com_tilbuci_data_Global.ln.get("window-narrinv-ersave"),320,150,com_tilbuci_data_Global.ln.get("default-ok"));
		}
	}
	,onSaveSet: function(evt) {
		if(this.ui.inputs.h["imgbt"].get_text() == "") {
			com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("window-narrinv-title"),com_tilbuci_data_Global.ln.get("window-narrinv-noclose"),320,150,com_tilbuci_data_Global.ln.get("default-ok"));
		} else if(this.ui.inputs.h["imgbgh"].get_text() == "" && this.ui.inputs.h["imgbgv"].get_text() == "") {
			com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("window-narrinv-title"),com_tilbuci_data_Global.ln.get("window-narrinv-nobg"),320,150,com_tilbuci_data_Global.ln.get("default-ok"));
		} else {
			var contr = new com_tilbuci_contraptions_InventoryContraption();
			if(contr.load({ id : "inv", font : this.ui.selects.h["font"].get_selectedItem().value, fontcolor : com_tilbuci_statictools_StringStatic.colorHex(this.ui.inputs.h["fontc"].get_text(),"#FFFFFF"), fontsize : Math.round(this.ui.numerics.h["fontsize"].get_value()), close : this.ui.inputs.h["imgbt"].get_text(), horizontal : this.ui.inputs.h["imgbgh"].get_text(), vertical : this.ui.inputs.h["imgbgv"].get_text(), mode : this.ui.selects.h["mode"].get_selectedItem().value, sound : this.ui.inputs.h["sound"].get_text()})) {
				var h = com_tilbuci_data_GlobalPlayer.contraptions.inv.h;
				var k_h = h;
				var k_keys = Object.keys(h);
				var k_length = k_keys.length;
				var k_current = 0;
				while(k_current < k_length) {
					var k = k_keys[k_current++];
					com_tilbuci_data_GlobalPlayer.contraptions.inv.h[k].kill();
					var _this = com_tilbuci_data_GlobalPlayer.contraptions.inv;
					if(Object.prototype.hasOwnProperty.call(_this.h,k)) {
						delete(_this.h[k]);
					}
				}
				com_tilbuci_data_GlobalPlayer.contraptions.inv.h["inv"] = contr;
				var tmp = com_tilbuci_data_Global.ws;
				var _g = new haxe_ds_StringMap();
				var value = com_tilbuci_data_GlobalPlayer.movie.get_mvId();
				_g.h["movie"] = value;
				var value = com_tilbuci_data_GlobalPlayer.contraptions.getData();
				_g.h["data"] = value;
				tmp.send("Movie/SaveContraptions",_g,$bind(this,this.onSaveSetReturn));
			} else {
				com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("window-narrinv-title"),com_tilbuci_data_Global.ln.get("window-narrinv-errorset"),320,150,com_tilbuci_data_Global.ln.get("default-ok"));
			}
		}
	}
	,onSaveSetReturn: function(ok,ld) {
		if(ok) {
			if(ld.map.h["e"] == 1) {
				com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("window-narrinv-title"),com_tilbuci_data_Global.ln.get("window-narrinv-ersave1set"),320,150,com_tilbuci_data_Global.ln.get("default-ok"));
			} else if(ld.map.h["e"] == 2) {
				com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("window-narrinv-title"),com_tilbuci_data_Global.ln.get("window-narrinv-ersaveset"),320,150,com_tilbuci_data_Global.ln.get("default-ok"));
			} else {
				com_tilbuci_data_Global.showMsg(com_tilbuci_data_Global.ln.get("window-narrinv-oksaveset"));
				feathers_core_PopUpManager.removePopUp(this);
			}
		} else {
			com_tilbuci_data_Global.showPopup(com_tilbuci_data_Global.ln.get("window-narrinv-title"),com_tilbuci_data_Global.ln.get("window-narrinv-ersaveset"),320,150,com_tilbuci_data_Global.ln.get("default-ok"));
		}
	}
	,__class__: com_tilbuci_ui_window_narrative_WindowNarrInv
});
var com_tilbuci_ui_window_scene_WindowSceneDflow = function(ac) {
	com_tilbuci_ui_window_PopupWindow.call(this,ac,com_tilbuci_data_Global.ln.get("window-scenedflow-title"),600,com_tilbuci_ui_base_InterfaceFactory.pickValue(475,485),false,true,true);
};
$hxClasses["com.tilbuci.ui.window.scene.WindowSceneDflow"] = com_tilbuci_ui_window_scene_WindowSceneDflow;
com_tilbuci_ui_window_scene_WindowSceneDflow.__name__ = "com.tilbuci.ui.window.scene.WindowSceneDflow";
com_tilbuci_ui_window_scene_WindowSceneDflow.__super__ = com_tilbuci_ui_window_PopupWindow;
com_tilbuci_ui_window_scene_WindowSceneDflow.prototype = $extend(com_tilbuci_ui_window_PopupWindow.prototype,{
	startInterface: function(evt) {
		var _g = 1;
		while(_g < 5) {
			var i = _g++;
			this.ui.createHContainer("dflowt" + i);
			this.ui.createLabel("dflowt" + i,com_tilbuci_data_Global.ln.get("window-scenedflow-choicetext"),feathers_controls_Label.VARIANT_DETAIL,this.ui.hcontainers.h["dflowt" + i]);
			this.ui.createTInput("dflowt" + i,"","",this.ui.hcontainers.h["dflowt" + i]);
			this.ui.createHContainer("dflows" + i);
			this.ui.createLabel("dflows" + i,com_tilbuci_data_Global.ln.get("window-scenedflow-choicescene"),feathers_controls_Label.VARIANT_DETAIL,this.ui.hcontainers.h["dflows" + i]);
			this.ui.createSelect("dflows" + i,[],null,this.ui.hcontainers.h["dflows" + i]);
		}
		var tmp = com_tilbuci_data_Global.ln.get("window-scenedflow-title");
		var tmp1 = this.ui;
		var tmp2 = { tp : "Label", id : "choice1", tx : com_tilbuci_data_Global.ln.get("window-scenedflow-choice1")};
		var tmp3 = { tp : "Custom", cont : this.ui.hcontainers.h["dflowt1"]};
		var tmp4 = { tp : "Custom", cont : this.ui.hcontainers.h["dflows1"]};
		var tmp5 = { tp : "Label", id : "choice2", tx : com_tilbuci_data_Global.ln.get("window-scenedflow-choice2")};
		var tmp6 = { tp : "Custom", cont : this.ui.hcontainers.h["dflowt2"]};
		var tmp7 = { tp : "Custom", cont : this.ui.hcontainers.h["dflows2"]};
		var tmp8 = { tp : "Label", id : "choice3", tx : com_tilbuci_data_Global.ln.get("window-scenedflow-choice3")};
		var tmp9 = { tp : "Custom", cont : this.ui.hcontainers.h["dflowt3"]};
		var tmp10 = { tp : "Custom", cont : this.ui.hcontainers.h["dflows3"]};
		var tmp11 = { tp : "Label", id : "choice4", tx : com_tilbuci_data_Global.ln.get("window-scenedflow-choice4")};
		var tmp12 = { tp : "Custom", cont : this.ui.hcontainers.h["dflowt4"]};
		var tmp13 = { tp : "Custom", cont : this.ui.hcontainers.h["dflows4"]};
		var tmp14 = com_tilbuci_data_Global.ln.get("window-scenedflow-set");
		this.addForm(tmp,tmp1.forge("window",[tmp2,tmp3,tmp4,{ tp : "Spacer", id : "choice1", ht : 10, ln : true},tmp5,tmp6,tmp7,{ tp : "Spacer", id : "choice2", ht : 10, ln : true},tmp8,tmp9,tmp10,{ tp : "Spacer", id : "choice3", ht : 10, ln : true},tmp11,tmp12,tmp13,{ tp : "Spacer", id : "choice4", ht : 10, ln : false},{ tp : "Button", id : "okbutton", tx : tmp14, ac : $bind(this,this.onSave)}]));
		com_tilbuci_ui_window_PopupWindow.prototype.startInterface.call(this);
	}
	,kill: function() {
		com_tilbuci_ui_window_PopupWindow.prototype.kill.call(this);
	}
	,acStart: function() {
		this.ui.hcontainers.h["dflowt" + 1].setWidth(560,[180,370]);
		this.ui.hcontainers.h["dflows" + 1].setWidth(560,[180,370]);
		this.ui.hcontainers.h["dflowt" + 2].setWidth(560,[180,370]);
		this.ui.hcontainers.h["dflows" + 2].setWidth(560,[180,370]);
		this.ui.hcontainers.h["dflowt" + 3].setWidth(560,[180,370]);
		this.ui.hcontainers.h["dflows" + 3].setWidth(560,[180,370]);
		this.ui.hcontainers.h["dflowt" + 4].setWidth(560,[180,370]);
		this.ui.hcontainers.h["dflows" + 4].setWidth(560,[180,370]);
		var tmp = com_tilbuci_data_Global.ws;
		var _g = new haxe_ds_StringMap();
		var value = com_tilbuci_data_GlobalPlayer.movie.get_mvId();
		_g.h["movie"] = value;
		tmp.send("Scene/List",_g,$bind(this,this.onList));
	}
	,onList: function(ok,ld) {
		if(!ok) {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-scenedflow-title"),com_tilbuci_data_Global.ln.get("window-scenedflow-nolist"),300,180,this.stage);
			feathers_core_PopUpManager.removePopUp(this);
		} else if(ld.map.h["e"] == 0) {
			var sclist = [{ text : com_tilbuci_data_Global.ln.get("window-scenedflow-none"), value : ""}];
			var ar = ld.map.h["list"];
			if(ar.length > 0) {
				var _g = 0;
				while(_g < ar.length) {
					var i = ar[_g];
					++_g;
					sclist.push({ text : Reflect.field(i,"title"), value : Reflect.field(i,"id")});
				}
			}
			this.ui.inputs.h["dflowt" + 1].set_text(com_tilbuci_data_GlobalPlayer.movie.scene.dflow[0][0]);
			this.ui.setSelectOptions("dflows" + 1,sclist,com_tilbuci_data_GlobalPlayer.movie.scene.dflow[0][1]);
			this.ui.inputs.h["dflowt" + 2].set_text(com_tilbuci_data_GlobalPlayer.movie.scene.dflow[1][0]);
			this.ui.setSelectOptions("dflows" + 2,sclist,com_tilbuci_data_GlobalPlayer.movie.scene.dflow[1][1]);
			this.ui.inputs.h["dflowt" + 3].set_text(com_tilbuci_data_GlobalPlayer.movie.scene.dflow[2][0]);
			this.ui.setSelectOptions("dflows" + 3,sclist,com_tilbuci_data_GlobalPlayer.movie.scene.dflow[2][1]);
			this.ui.inputs.h["dflowt" + 4].set_text(com_tilbuci_data_GlobalPlayer.movie.scene.dflow[3][0]);
			this.ui.setSelectOptions("dflows" + 4,sclist,com_tilbuci_data_GlobalPlayer.movie.scene.dflow[3][1]);
		} else {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-scenedflow-title"),com_tilbuci_data_Global.ln.get("window-scenedflow-nolist"),300,180,this.stage);
			feathers_core_PopUpManager.removePopUp(this);
		}
	}
	,onSave: function(evt) {
		var dflow = [["",""],["",""],["",""],["",""]];
		var _g = 1;
		while(_g < 5) {
			var i = _g++;
			if(this.ui.selects.h["dflows" + i].get_selectedItem().value != "") {
				if(this.ui.inputs.h["dflowt" + i].get_text() == "") {
					this.ui.inputs.h["dflowt" + i].set_text(this.ui.selects.h["dflows" + i].get_selectedItem().text);
				}
				dflow[i - 1] = [this.ui.inputs.h["dflowt" + i].get_text(),this.ui.selects.h["dflows" + i].get_selectedItem().value];
			}
		}
		while(com_tilbuci_data_GlobalPlayer.movie.scene.dflow.length > 0) com_tilbuci_data_GlobalPlayer.movie.scene.dflow.shift();
		com_tilbuci_data_GlobalPlayer.movie.scene.dflow = dflow;
		com_tilbuci_data_Global.showMsg(com_tilbuci_data_Global.ln.get("window-scenedflow-sceneset"));
		feathers_core_PopUpManager.removePopUp(this);
	}
	,__class__: com_tilbuci_ui_window_scene_WindowSceneDflow
});
var com_tilbuci_ui_window_scene_WindowSceneNew = function(ac) {
	com_tilbuci_ui_window_PopupWindow.call(this,ac,com_tilbuci_data_Global.ln.get("window-scenenew-title"),800,com_tilbuci_ui_base_InterfaceFactory.pickValue(170,190),false,true,true);
};
$hxClasses["com.tilbuci.ui.window.scene.WindowSceneNew"] = com_tilbuci_ui_window_scene_WindowSceneNew;
com_tilbuci_ui_window_scene_WindowSceneNew.__name__ = "com.tilbuci.ui.window.scene.WindowSceneNew";
com_tilbuci_ui_window_scene_WindowSceneNew.__super__ = com_tilbuci_ui_window_PopupWindow;
com_tilbuci_ui_window_scene_WindowSceneNew.prototype = $extend(com_tilbuci_ui_window_PopupWindow.prototype,{
	startInterface: function(evt) {
		var tmp = com_tilbuci_data_Global.ln.get("window-scenenew-title");
		var tmp1 = this.ui;
		var tmp2 = { tp : "Label", id : "scenename", tx : com_tilbuci_data_Global.ln.get("window-scenenew-name"), vr : feathers_controls_Label.VARIANT_DETAIL};
		var tmp3 = com_tilbuci_data_Global.ln.get("window-scenenew-create");
		this.addForm(tmp,tmp1.forge("leftcol",[tmp2,{ tp : "TInput", id : "scenename", tx : "", vr : ""},{ tp : "Spacer", id : "scenenew", ht : 20},{ tp : "Button", id : "scenecreate", tx : tmp3, ac : $bind(this,this.onCreateScene)}]));
		com_tilbuci_ui_window_PopupWindow.prototype.startInterface.call(this);
	}
	,kill: function() {
		com_tilbuci_ui_window_PopupWindow.prototype.kill.call(this);
	}
	,onCreateScene: function(evt) {
		if(this.ui.inputs.h["scenename"].get_text() == "") {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-scenenew-title"),com_tilbuci_data_Global.ln.get("window-scenenew-norequired"),300,180,this.stage);
		} else {
			var tmp = com_tilbuci_data_Global.ws;
			var _g = new haxe_ds_StringMap();
			var value = this.ui.inputs.h["scenename"].get_text();
			_g.h["title"] = value;
			_g.h["id"] = "";
			var value = com_tilbuci_data_GlobalPlayer.movie.get_mvId();
			_g.h["movie"] = value;
			tmp.send("Scene/New",_g,$bind(this,this.onCreateSceneReturn));
		}
	}
	,onCreateSceneReturn: function(ok,ld) {
		if(!ok) {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-scenenew-title"),com_tilbuci_data_Global.ln.get("window-scenenew-createer"),300,180,this.stage);
		} else if(ld.map.h["e"] != 0) {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-scenenew-title"),com_tilbuci_data_Global.ln.get("window-scenenew-createer"),300,180,this.stage);
		} else {
			com_tilbuci_data_GlobalPlayer.area.imgSelect();
			this.ui.inputs.h["scenename"].set_text("");
			feathers_core_PopUpManager.removePopUp(this);
			var tmp = this._ac;
			var _g = new haxe_ds_StringMap();
			_g.h["id"] = ld.map.h["id"];
			tmp("sceneload",_g);
			com_tilbuci_data_Global.acInfo.loadInfo(true);
		}
	}
	,__class__: com_tilbuci_ui_window_scene_WindowSceneNew
});
var com_tilbuci_ui_window_scene_WindowSceneOpen = function(ac) {
	com_tilbuci_ui_window_PopupWindow.call(this,ac,com_tilbuci_data_Global.ln.get("window-sceneopen-title"),800,com_tilbuci_ui_base_InterfaceFactory.pickValue(415,430),false,true,true);
};
$hxClasses["com.tilbuci.ui.window.scene.WindowSceneOpen"] = com_tilbuci_ui_window_scene_WindowSceneOpen;
com_tilbuci_ui_window_scene_WindowSceneOpen.__name__ = "com.tilbuci.ui.window.scene.WindowSceneOpen";
com_tilbuci_ui_window_scene_WindowSceneOpen.__super__ = com_tilbuci_ui_window_PopupWindow;
com_tilbuci_ui_window_scene_WindowSceneOpen.prototype = $extend(com_tilbuci_ui_window_PopupWindow.prototype,{
	startInterface: function(evt) {
		var tmp = com_tilbuci_data_Global.ln.get("window-sceneopen-title");
		var tmp1 = this.ui;
		var tmp2 = { tp : "Label", id : "openabout", tx : com_tilbuci_data_Global.ln.get("window-sceneopen-wait")};
		var tmp3 = com_tilbuci_data_Global.ln.get("window-sceneopen-button");
		this.addForm(tmp,tmp1.forge("window",[tmp2,{ tp : "List", id : "openlist", vl : [], ht : 295, sl : null},{ tp : "Button", id : "okbutton", tx : tmp3, ac : $bind(this,this.onOpen)}]));
		com_tilbuci_ui_window_PopupWindow.prototype.startInterface.call(this);
		this.ui.listDbClick("openlist",$bind(this,this.onOpen));
		this.ui.setListToIcon("openlist");
	}
	,kill: function() {
		com_tilbuci_ui_window_PopupWindow.prototype.kill.call(this);
	}
	,acStart: function() {
		this.loadScenes();
	}
	,loadScenes: function() {
		this.ui.labels.h["openabout"].set_text(com_tilbuci_data_Global.ln.get("window-sceneopen-wait"));
		this.ui.setListValues("openlist",[]);
		var tmp = com_tilbuci_data_Global.ws;
		var _g = new haxe_ds_StringMap();
		var value = com_tilbuci_data_GlobalPlayer.movie.get_mvId();
		_g.h["movie"] = value;
		tmp.send("Scene/List",_g,$bind(this,this.onList));
	}
	,onList: function(ok,ld) {
		if(!ok) {
			this.ui.labels.h["openabout"].set_text(com_tilbuci_data_Global.ln.get("window-sceneopen-error"));
		} else if(ld.map.h["e"] == 0) {
			var ar = ld.map.h["list"];
			if(ar.length == 0) {
				this.ui.labels.h["openabout"].set_text(com_tilbuci_data_Global.ln.get("window-sceneopen-noscenes"));
			} else {
				var items = [];
				var _g = 0;
				while(_g < ar.length) {
					var i = ar[_g];
					++_g;
					if(Reflect.field(i,"lock") == "") {
						items.push({ text : Reflect.field(i,"title"), value : Reflect.field(i,"id"), asset : "", user : null});
					} else {
						items.push({ text : Reflect.field(i,"title"), value : Reflect.field(i,"id"), asset : "btLock", user : Reflect.field(i,"lock")});
					}
				}
				this.ui.setListValues("openlist",items);
				this.ui.labels.h["openabout"].set_text(com_tilbuci_data_Global.ln.get("window-sceneopen-about"));
			}
		} else {
			this.ui.labels.h["openabout"].set_text(com_tilbuci_data_Global.ln.get("window-sceneopen-error"));
		}
	}
	,onOpen: function(evt) {
		if(this.ui.lists.h["openlist"].get_selectedItem() != null) {
			if(this.ui.lists.h["openlist"].get_selectedItem().user == null || this.ui.lists.h["openlist"].get_selectedItem().user == "") {
				com_tilbuci_data_GlobalPlayer.area.imgSelect();
				var tmp = this._ac;
				var _g = new haxe_ds_StringMap();
				var value = this.ui.lists.h["openlist"].get_selectedItem().value;
				_g.h["id"] = value;
				var value = com_tilbuci_data_GlobalPlayer.movie.get_mvId();
				_g.h["movie"] = value;
				tmp("sceneload",_g);
				feathers_core_PopUpManager.removePopUp(this);
			} else {
				com_tilbuci_data_Global.showMsg(com_tilbuci_data_Global.ln.get("window-sceneopen-locked"));
			}
		}
	}
	,__class__: com_tilbuci_ui_window_scene_WindowSceneOpen
});
var com_tilbuci_ui_window_scene_WindowSceneProperties = function(ac) {
	this._collections = new haxe_ds_StringMap();
	this._kfactext = [];
	com_tilbuci_ui_window_PopupWindow.call(this,ac,com_tilbuci_data_Global.ln.get("window-sceneprop-windowtitle"),1000,com_tilbuci_ui_base_InterfaceFactory.pickValue(590,660),true,true,true);
};
$hxClasses["com.tilbuci.ui.window.scene.WindowSceneProperties"] = com_tilbuci_ui_window_scene_WindowSceneProperties;
com_tilbuci_ui_window_scene_WindowSceneProperties.__name__ = "com.tilbuci.ui.window.scene.WindowSceneProperties";
com_tilbuci_ui_window_scene_WindowSceneProperties.__super__ = com_tilbuci_ui_window_PopupWindow;
com_tilbuci_ui_window_scene_WindowSceneProperties.prototype = $extend(com_tilbuci_ui_window_PopupWindow.prototype,{
	_acstart: null
	,_kfactions: null
	,_kfactext: null
	,_image: null
	,_collections: null
	,startInterface: function(evt) {
		this._image = new com_tilbuci_display_PictureImage($bind(this,this.onImageLoaded));
		this._image.set_height(130);
		this._image.set_visible(true);
		var image = new com_tilbuci_ui_base_InterfaceContainer("v",10,6710886);
		image.set_width(900);
		image.set_height(140);
		image.addChild(this._image);
		var tmp = com_tilbuci_data_Global.ln.get("window-sceneprop-about");
		var tmp1 = this.ui;
		var tmp2 = { tp : "Label", id : "title", tx : com_tilbuci_data_Global.ln.get("window-sceneprop-title"), vr : ""};
		var tmp3 = { tp : "TInput", id : "title", tx : com_tilbuci_data_GlobalPlayer.movie.scene.title, vr : ""};
		var tmp4 = { tp : "Label", id : "about", tx : com_tilbuci_data_Global.ln.get("window-sceneprop-aboutscene"), vr : ""};
		var tmp5 = { tp : "TArea", id : "about", tx : com_tilbuci_data_GlobalPlayer.movie.scene.about, vr : "", en : true, ht : 100};
		var tmp6 = { tp : "Label", id : "static", tx : com_tilbuci_data_Global.ln.get("window-sceneprop-static"), vr : ""};
		var tmp7 = { tp : "Label", id : "image", tx : com_tilbuci_data_Global.ln.get("window-sceneprop-image"), vr : ""};
		var tmp8 = { tp : "Button", id : "image", tx : com_tilbuci_data_Global.ln.get("window-sceneprop-imagebt"), ac : $bind(this,this.onImage)};
		var tmp9 = { tp : "Button", id : "imagerm", tx : com_tilbuci_data_Global.ln.get("window-sceneprop-imagerm"), ac : $bind(this,this.onImageRemove)};
		var tmp10 = com_tilbuci_data_Global.ln.get("window-sceneprop-setbt");
		this.addForm(tmp,tmp1.forge("about",[tmp2,tmp3,tmp4,tmp5,tmp6,{ tp : "Toggle", id : "static", vl : false},tmp7,tmp8,tmp9,{ tp : "Custom", cont : image},{ tp : "Button", id : "about", tx : tmp10, ac : $bind(this,this.onSave)}]));
		var tmp = com_tilbuci_data_Global.ln.get("window-sceneprop-navigation");
		var tmp1 = this.ui;
		var tmp2 = { tp : "Label", id : "nvup", tx : com_tilbuci_data_Global.ln.get("window-sceneprop-nvup"), vr : ""};
		var tmp3 = { tp : "Label", id : "nvdown", tx : com_tilbuci_data_Global.ln.get("window-sceneprop-nvdown"), vr : ""};
		var tmp4 = { tp : "Label", id : "nvleft", tx : com_tilbuci_data_Global.ln.get("window-sceneprop-nvleft"), vr : ""};
		var tmp5 = { tp : "Label", id : "nvright", tx : com_tilbuci_data_Global.ln.get("window-sceneprop-nvright"), vr : ""};
		var tmp6 = { tp : "Label", id : "nvin", tx : com_tilbuci_data_Global.ln.get("window-sceneprop-nvin"), vr : ""};
		var tmp7 = { tp : "Label", id : "nvout", tx : com_tilbuci_data_Global.ln.get("window-sceneprop-nvout"), vr : ""};
		var tmp8 = com_tilbuci_data_Global.ln.get("window-sceneprop-setbt");
		this.addForm(tmp,tmp1.forge("navigation",[tmp2,{ tp : "Select", id : "nvup", vl : [], sl : ""},tmp3,{ tp : "Select", id : "nvdown", vl : [], sl : ""},tmp4,{ tp : "Select", id : "nvleft", vl : [], sl : ""},tmp5,{ tp : "Select", id : "nvright", vl : [], sl : ""},tmp6,{ tp : "Select", id : "nvin", vl : [], sl : ""},tmp7,{ tp : "Select", id : "nvout", vl : [], sl : ""},{ tp : "Spacer", id : "navigation", ht : 148, ln : false},{ tp : "Button", id : "navigation", tx : tmp8, ac : $bind(this,this.onSave)}]));
		var acstart = this.ui.createContainer("acstart");
		acstart.addChild(this.ui.createLabel("acstartlabel",com_tilbuci_data_Global.ln.get("window-sceneprop-acstartabout"),feathers_controls_Label.VARIANT_DETAIL));
		this._acstart = new com_tilbuci_ui_component_ActionArea(956,435);
		this._acstart.setText(com_tilbuci_data_GlobalPlayer.movie.scene.acstart);
		acstart.addChild(this._acstart);
		acstart.addChild(this.ui.createSpacer("acstartspacer",15));
		acstart.addChild(this.ui.createButton("saveacstart",com_tilbuci_data_Global.ln.get("window-sceneprop-setbt"),$bind(this,this.onSave)));
		this.addForm(com_tilbuci_data_Global.ln.get("window-sceneprop-acstart"),acstart);
		this._kfactions = new com_tilbuci_ui_component_ActionArea(956,320);
		var tmp = com_tilbuci_data_Global.ln.get("window-sceneprop-keyframes");
		var tmp1 = this.ui;
		var tmp2 = { tp : "Label", id : "loop", tx : com_tilbuci_data_Global.ln.get("window-sceneprop-loop"), vr : feathers_controls_Label.VARIANT_DETAIL};
		var tmp3 = { tp : "Label", id : "kfactions", tx : com_tilbuci_data_Global.ln.get("window-sceneprop-kfactions"), vr : feathers_controls_Label.VARIANT_DETAIL};
		var tmp4 = { tp : "Custom", cont : this._kfactions};
		var tmp5 = com_tilbuci_data_Global.ln.get("window-sceneprop-setbt");
		this.addForm(tmp,tmp1.forge("keyframes",[tmp2,{ tp : "Select", id : "loop", vl : [], sl : ""},{ tp : "Spacer", id : "kfactions", ht : 20, ln : true},tmp3,{ tp : "Select", id : "kfactions", vl : [], sl : ""},{ tp : "Spacer", id : "keyframes", ht : 5, ln : false},tmp4,{ tp : "Spacer", id : "keyframes", ht : 15, ln : false},{ tp : "Button", id : "keyframes", tx : tmp5, ac : $bind(this,this.onSave)}]));
		this.ui.selectChange("kfactions",$bind(this,this.onkfChange),$bind(this,this.onkfOpen));
		var tmp = com_tilbuci_data_Global.ln.get("window-sceneprop-scenedel");
		var tmp1 = this.ui;
		var tmp2 = { tp : "Label", id : "remove", tx : com_tilbuci_data_Global.ln.get("window-sceneprop-scenedelabout"), vr : ""};
		var tmp3 = com_tilbuci_data_Global.ln.get("window-sceneprop-scenedelbt");
		this.addForm(tmp,tmp1.forge("remove",[tmp2,{ tp : "TInput", id : "remove", tx : "", vr : ""},{ tp : "Spacer", id : "remove", ht : 20, ln : false},{ tp : "Button", id : "remove", tx : tmp3, ac : $bind(this,this.onRemove)}]));
		this.ui.labels.h["remove"].set_wordWrap(true);
		com_tilbuci_ui_window_PopupWindow.prototype.startInterface.call(this);
	}
	,acStart: function() {
		this._kfactext = [];
		this._collections = new haxe_ds_StringMap();
		var _g = 0;
		var _g1 = com_tilbuci_data_GlobalPlayer.movie.scene.keyframes.length;
		while(_g < _g1) {
			var i = _g++;
			if(com_tilbuci_data_GlobalPlayer.movie.scene.ackeyframes.length > i) {
				this._kfactext.push(com_tilbuci_data_GlobalPlayer.movie.scene.ackeyframes[i]);
			} else {
				this._kfactext.push("");
			}
		}
		var tmp = com_tilbuci_data_Global.ws;
		var _g = new haxe_ds_StringMap();
		var value = com_tilbuci_data_GlobalPlayer.movie.get_mvId();
		_g.h["movie"] = value;
		tmp.send("Scene/List",_g,$bind(this,this.onList));
		if(com_tilbuci_data_GlobalPlayer.movie.scene.image == "") {
			this._image.unload();
		} else {
			this._image.load(com_tilbuci_data_GlobalPlayer.movie.scene.image);
		}
		this.ui.inputs.h["title"].set_text(com_tilbuci_data_GlobalPlayer.movie.scene.title);
		this.ui.tareas.h["about"].set_text(com_tilbuci_data_GlobalPlayer.movie.scene.about);
		this.ui.toggles.h["static"].set_selected(com_tilbuci_data_GlobalPlayer.movie.scene.staticsc);
		this._acstart.setText(com_tilbuci_data_GlobalPlayer.movie.scene.acstart);
	}
	,action: function(ac,data) {
		if(ac == "browsesceneimage") {
			this._image.load(data.h["file"]);
		}
	}
	,onList: function(ok,ld) {
		if(!ok) {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-sceneprop-windowtitle"),com_tilbuci_data_Global.ln.get("window-sceneprop-nolist"),300,180,this.stage);
			feathers_core_PopUpManager.removePopUp(this);
		} else if(ld.map.h["e"] == 0) {
			var sclist = [{ text : com_tilbuci_data_Global.ln.get("window-sceneprop-nvnone"), value : ""}];
			var ar = ld.map.h["list"];
			if(ar.length > 0) {
				var _g = 0;
				while(_g < ar.length) {
					var i = ar[_g];
					++_g;
					sclist.push({ text : Reflect.field(i,"title"), value : Reflect.field(i,"id")});
				}
			}
			this.ui.setSelectOptions("nvup",sclist,com_tilbuci_data_GlobalPlayer.movie.scene.navigation.h["up"]);
			this.ui.setSelectOptions("nvdown",sclist,com_tilbuci_data_GlobalPlayer.movie.scene.navigation.h["down"]);
			this.ui.setSelectOptions("nvleft",sclist,com_tilbuci_data_GlobalPlayer.movie.scene.navigation.h["left"]);
			this.ui.setSelectOptions("nvright",sclist,com_tilbuci_data_GlobalPlayer.movie.scene.navigation.h["right"]);
			this.ui.setSelectOptions("nvin",sclist,com_tilbuci_data_GlobalPlayer.movie.scene.navigation.h["nin"]);
			this.ui.setSelectOptions("nvout",sclist,com_tilbuci_data_GlobalPlayer.movie.scene.navigation.h["nout"]);
			var kflist = [];
			var _g = 0;
			var _g1 = com_tilbuci_data_GlobalPlayer.movie.scene.keyframes.length;
			while(_g < _g1) {
				var i = _g++;
				kflist.push({ text : Std.string(i + 1), value : i});
			}
			this.ui.setSelectOptions("loop",kflist,com_tilbuci_data_GlobalPlayer.movie.scene.loop);
			this._kfactions.setText(this._kfactext[0]);
			this.ui.setSelectOptions("kfactions",kflist,0);
		} else {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-sceneprop-windowtitle"),com_tilbuci_data_Global.ln.get("window-sceneprop-nolist"),300,180,this.stage);
			feathers_core_PopUpManager.removePopUp(this);
		}
	}
	,kill: function() {
		com_tilbuci_ui_window_PopupWindow.prototype.kill.call(this);
	}
	,onkfChange: function(evt) {
		this._kfactions.setText(this._kfactext[this.ui.selects.h["kfactions"].get_selectedItem().value]);
	}
	,onkfOpen: function(evt) {
		this._kfactext[this.ui.selects.h["kfactions"].get_selectedItem().value] = this._kfactions.getText();
	}
	,onSave: function(evt) {
		this._kfactext[this.ui.selects.h["kfactions"].get_selectedItem().value] = this._kfactions.getText();
		var ok = -1;
		var _g = 0;
		var _g1 = this._kfactext.length;
		while(_g < _g1) {
			var i = _g++;
			if(this._kfactext[i] != "") {
				var json = com_tilbuci_statictools_StringStatic.jsonParse(this._kfactext[i]);
				if(json == false) {
					ok = i;
				}
			}
		}
		if(ok >= 0) {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-sceneprop-windowtitle"),StringTools.replace(com_tilbuci_data_Global.ln.get("window-sceneprop-kfacerror"),"[NUMBER]",Std.string(ok + 1)),300,180,this.stage);
		} else {
			var json2 = com_tilbuci_statictools_StringStatic.jsonParse(this._acstart.getText());
			if(json2 == false && this._acstart.getText() != "") {
				this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-sceneprop-windowtitle"),com_tilbuci_data_Global.ln.get("window-sceneprop-acerror"),300,180,this.stage);
			} else if(this.ui.inputs.h["title"].get_text() == "") {
				this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-sceneprop-windowtitle"),com_tilbuci_data_Global.ln.get("window-sceneprop-notitle"),300,180,this.stage);
			} else {
				com_tilbuci_data_GlobalPlayer.movie.scene.title = this.ui.inputs.h["title"].get_text();
				com_tilbuci_data_GlobalPlayer.movie.scene.about = this.ui.tareas.h["about"].get_text();
				com_tilbuci_data_GlobalPlayer.movie.scene.image = this._image.get_lastMedia();
				com_tilbuci_data_GlobalPlayer.movie.scene.staticsc = this.ui.toggles.h["static"].get_selected();
				var this1 = com_tilbuci_data_GlobalPlayer.movie.scene.navigation;
				var v = this.ui.selects.h["nvup"].get_selectedItem().value;
				this1.h["up"] = v;
				var this1 = com_tilbuci_data_GlobalPlayer.movie.scene.navigation;
				var v = this.ui.selects.h["nvdown"].get_selectedItem().value;
				this1.h["down"] = v;
				var this1 = com_tilbuci_data_GlobalPlayer.movie.scene.navigation;
				var v = this.ui.selects.h["nvleft"].get_selectedItem().value;
				this1.h["left"] = v;
				var this1 = com_tilbuci_data_GlobalPlayer.movie.scene.navigation;
				var v = this.ui.selects.h["nvright"].get_selectedItem().value;
				this1.h["right"] = v;
				var this1 = com_tilbuci_data_GlobalPlayer.movie.scene.navigation;
				var v = this.ui.selects.h["nvin"].get_selectedItem().value;
				this1.h["nin"] = v;
				var this1 = com_tilbuci_data_GlobalPlayer.movie.scene.navigation;
				var v = this.ui.selects.h["nvout"].get_selectedItem().value;
				this1.h["nout"] = v;
				com_tilbuci_data_GlobalPlayer.movie.scene.acstart = this._acstart.getText();
				com_tilbuci_data_GlobalPlayer.movie.scene.ackeyframes = [];
				var _g = 0;
				var _g1 = this._kfactext;
				while(_g < _g1.length) {
					var txt = _g1[_g];
					++_g;
					com_tilbuci_data_GlobalPlayer.movie.scene.ackeyframes.push(txt);
				}
				com_tilbuci_data_GlobalPlayer.movie.scene.loop = this.ui.selects.h["loop"].get_selectedItem().value;
				com_tilbuci_data_Global.showMsg(com_tilbuci_data_Global.ln.get("window-sceneprop-sceneset"));
				feathers_core_PopUpManager.removePopUp(this);
			}
		}
	}
	,onRemove: function(evt) {
		if(this.ui.inputs.h["remove"].get_text() == com_tilbuci_data_Global.ln.get("window-sceneprop-scenedeltype")) {
			this.ui.inputs.h["remove"].set_text("");
			this.ui.createConfirm(com_tilbuci_data_Global.ln.get("window-sceneprop-scenedel"),com_tilbuci_data_Global.ln.get("window-sceneprop-scenedelconfirm"),320,240,$bind(this,this.onRemoveConfirm),com_tilbuci_data_Global.ln.get("default-ok"),com_tilbuci_data_Global.ln.get("default-cancel"),this.stage);
		}
	}
	,onRemoveConfirm: function(ok) {
		if(ok) {
			var tmp = com_tilbuci_data_Global.ws;
			var _g = new haxe_ds_StringMap();
			var value = com_tilbuci_data_GlobalPlayer.movie.get_mvId();
			_g.h["movie"] = value;
			var value = com_tilbuci_data_GlobalPlayer.movie.get_scId();
			_g.h["id"] = value;
			tmp.send("Scene/Remove",_g,$bind(this,this.onRemoveOk));
		}
	}
	,onRemoveOk: function(ok,ld) {
		if(!ok) {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-sceneprop-scenedel"),com_tilbuci_data_Global.ln.get("window-sceneprop-scenedeler"),300,180,this.stage);
		} else if(ld.map.h["e"] == 0) {
			com_tilbuci_data_GlobalPlayer.movie.scene.clear();
			com_tilbuci_data_GlobalPlayer.movie.noScene();
			com_tilbuci_data_GlobalPlayer.area.clear();
			feathers_core_PopUpManager.removePopUp(this);
			com_tilbuci_data_Global.showMsg(com_tilbuci_data_Global.ln.get("window-sceneprop-scenedelok"));
		} else {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-sceneprop-scenedel"),com_tilbuci_data_Global.ln.get("window-sceneprop-scenedeler"),300,180,this.stage);
		}
	}
	,onImage: function(evt) {
		this._ac("browsesceneimage");
	}
	,onImageRemove: function(evt) {
		this._image.unload();
	}
	,onImageLoaded: function(ok) {
		this._image.set_height(190);
		this._image.set_width(this._image.oWidth * this._image.get_height() / this._image.oHeight);
		this._image.set_visible(true);
	}
	,__class__: com_tilbuci_ui_window_scene_WindowSceneProperties
});
var com_tilbuci_ui_window_scene_WindowSceneSaveas = function(ac) {
	com_tilbuci_ui_window_PopupWindow.call(this,ac,com_tilbuci_data_Global.ln.get("window-scenesaveas-title"),800,com_tilbuci_ui_base_InterfaceFactory.pickValue(180,200),false,true,true);
};
$hxClasses["com.tilbuci.ui.window.scene.WindowSceneSaveas"] = com_tilbuci_ui_window_scene_WindowSceneSaveas;
com_tilbuci_ui_window_scene_WindowSceneSaveas.__name__ = "com.tilbuci.ui.window.scene.WindowSceneSaveas";
com_tilbuci_ui_window_scene_WindowSceneSaveas.__super__ = com_tilbuci_ui_window_PopupWindow;
com_tilbuci_ui_window_scene_WindowSceneSaveas.prototype = $extend(com_tilbuci_ui_window_PopupWindow.prototype,{
	startInterface: function(evt) {
		var tmp = com_tilbuci_data_Global.ln.get("window-scenesaveas-title");
		var tmp1 = this.ui;
		var tmp2 = { tp : "Label", id : "scenename", tx : com_tilbuci_data_Global.ln.get("window-scenesaveas-name"), vr : feathers_controls_Label.VARIANT_DETAIL};
		var tmp3 = com_tilbuci_data_Global.ln.get("window-scenesaveas-create");
		this.addForm(tmp,tmp1.forge("leftcol",[tmp2,{ tp : "TInput", id : "scenename", tx : "", vr : ""},{ tp : "Spacer", id : "scenenew", ht : 20},{ tp : "Button", id : "scenecreate", tx : tmp3, ac : $bind(this,this.onSaveScene)}]));
		com_tilbuci_ui_window_PopupWindow.prototype.startInterface.call(this);
	}
	,acStart: function() {
		this.ui.inputs.h["scenename"].set_text(com_tilbuci_data_GlobalPlayer.movie.scene.title);
	}
	,kill: function() {
		com_tilbuci_ui_window_PopupWindow.prototype.kill.call(this);
	}
	,onSaveScene: function(evt) {
		if(this.ui.inputs.h["scenename"].get_text() == "") {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-scenesaveas-title"),com_tilbuci_data_Global.ln.get("window-scenesaveas-norequired"),300,180,this.stage);
		} else {
			var cols = { };
			var h = com_tilbuci_data_GlobalPlayer.movie.collections.h;
			var k_h = h;
			var k_keys = Object.keys(h);
			var k_length = k_keys.length;
			var k_current = 0;
			while(k_current < k_length) {
				var k = k_keys[k_current++];
				cols[k] = com_tilbuci_data_GlobalPlayer.movie.collections.h[k].toJson();
			}
			var tmp = com_tilbuci_data_Global.ws;
			var _g = new haxe_ds_StringMap();
			var value = com_tilbuci_data_GlobalPlayer.movie.get_mvId();
			_g.h["movie"] = value;
			_g.h["id"] = "";
			var value = com_tilbuci_data_GlobalPlayer.movie.scene.toJson();
			_g.h["scene"] = value;
			_g.h["collections"] = cols;
			var value = this.ui.inputs.h["scenename"].get_text();
			_g.h["title"] = value;
			tmp.send("Scene/SaveAs",_g,$bind(this,this.onSaveReturn));
		}
	}
	,onSaveReturn: function(ok,ld) {
		if(!ok) {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-scenesaveas-title"),com_tilbuci_data_Global.ln.get("window-scenesaveas-createer"),300,180,this.stage);
		} else if(ld.map.h["e"] != 0) {
			this.ui.createWarning(com_tilbuci_data_Global.ln.get("window-scenesaveas-title"),com_tilbuci_data_Global.ln.get("window-scenesaveas-createer"),300,180,this.stage);
		} else {
			com_tilbuci_data_Global.showMsg(com_tilbuci_data_Global.ln.get("window-scenesaveas-createok"));
			feathers_core_PopUpManager.removePopUp(this);
			var tmp = this._ac;
			var _g = new haxe_ds_StringMap();
			_g.h["id"] = ld.map.h["id"];
			tmp("sceneload",_g);
		}
	}
	,__class__: com_tilbuci_ui_window_scene_WindowSceneSaveas
});
var com_tilbuci_ui_window_scene_WindowSceneVersions = function(ac) {
	com_tilbuci_ui_window_PopupWindow.call(this,ac,com_tilbuci_data_Global.ln.get("window-sceneversion-title"),600,com_tilbuci_ui_base_InterfaceFactory.pickValue(420,430),false,true,true);
};
$hxClasses["com.tilbuci.ui.window.scene.WindowSceneVersions"] = com_tilbuci_ui_window_scene_WindowSceneVersions;
com_tilbuci_ui_window_scene_WindowSceneVersions.__name__ = "com.tilbuci.ui.window.scene.WindowSceneVersions";
com_tilbuci_ui_window_scene_WindowSceneVersions.__super__ = com_tilbuci_ui_window_PopupWindow;
com_tilbuci_ui_window_scene_WindowSceneVersions.prototype = $extend(com_tilbuci_ui_window_PopupWindow.prototype,{
	startInterface: function(evt) {
		var tmp = com_tilbuci_data_Global.ln.get("window-sceneversion-title");
		var tmp1 = this.ui;
		var tmp2 = { tp : "Label", id : "openabout", tx : com_tilbuci_data_Global.ln.get("window-sceneversion-wait")};
		var tmp3 = com_tilbuci_data_Global.ln.get("window-sceneversion-button");
		this.addForm(tmp,tmp1.forge("window",[tmp2,{ tp : "List", id : "openlist", vl : [], ht : 295, sl : null},{ tp : "Button", id : "okbutton", tx : tmp3, ac : $bind(this,this.onOpen)}]));
		this.ui.setListToIcon("openlist");
		com_tilbuci_ui_window_PopupWindow.prototype.startInterface.call(this);
	}
	,kill: function() {
		com_tilbuci_ui_window_PopupWindow.prototype.kill.call(this);
	}
	,acStart: function() {
		this.loadScenes();
	}
	,loadScenes: function() {
		this.ui.labels.h["openabout"].set_text(com_tilbuci_data_Global.ln.get("window-sceneversion-wait"));
		this.ui.setListValues("openlist",[]);
		var tmp = com_tilbuci_data_Global.ws;
		var _g = new haxe_ds_StringMap();
		var value = com_tilbuci_data_GlobalPlayer.movie.get_mvId();
		_g.h["movie"] = value;
		var value = com_tilbuci_data_GlobalPlayer.movie.get_scId();
		_g.h["id"] = value;
		var value = com_tilbuci_data_Global.ln.get("default-dateformat");
		_g.h["format"] = value;
		tmp.send("Scene/ListVersions",_g,$bind(this,this.onList));
	}
	,onList: function(ok,ld) {
		if(!ok) {
			this.ui.labels.h["openabout"].set_text(com_tilbuci_data_Global.ln.get("window-sceneversion-error"));
		} else if(ld.map.h["e"] == 0) {
			var ar = ld.map.h["list"];
			if(ar.length == 0) {
				this.ui.labels.h["openabout"].set_text(com_tilbuci_data_Global.ln.get("window-sceneversion-noscenes"));
			} else {
				var items = [];
				var _g = 0;
				var _g1 = Reflect.fields(ld.map.h["list"]);
				while(_g < _g1.length) {
					var it = _g1[_g];
					++_g;
					if(Reflect.field(Reflect.field(ld.map.h["list"],it),"pub") == "1") {
						items.push({ text : Reflect.field(Reflect.field(ld.map.h["list"],it),"date"), value : Reflect.field(Reflect.field(ld.map.h["list"],it),"uid"), user : Reflect.field(Reflect.field(ld.map.h["list"],it),"user"), asset : "iconPublished"});
					} else {
						items.push({ text : Reflect.field(Reflect.field(ld.map.h["list"],it),"date"), value : Reflect.field(Reflect.field(ld.map.h["list"],it),"uid"), user : Reflect.field(Reflect.field(ld.map.h["list"],it),"user"), asset : ""});
					}
				}
				this.ui.setListValues("openlist",items);
				this.ui.labels.h["openabout"].set_text(com_tilbuci_data_Global.ln.get("window-sceneversion-about"));
			}
		} else {
			this.ui.labels.h["openabout"].set_text(com_tilbuci_data_Global.ln.get("window-sceneversion-error"));
		}
	}
	,onOpen: function(evt) {
		if(this.ui.lists.h["openlist"].get_selectedItem() != null) {
			var tmp = this._ac;
			var _g = new haxe_ds_StringMap();
			var value = this.ui.lists.h["openlist"].get_selectedItem().value;
			_g.h["id"] = value;
			var value = com_tilbuci_data_GlobalPlayer.movie.get_mvId();
			_g.h["movie"] = value;
			tmp("sceneversionload",_g);
			feathers_core_PopUpManager.removePopUp(this);
		}
	}
	,__class__: com_tilbuci_ui_window_scene_WindowSceneVersions
});
var com_tilbuci_ws_Webservice = function(ws) {
	this._level = -1;
	this._key = "";
	this._user = "system";
	openfl_events_EventDispatcher.call(this);
	this._url = ws;
	this._interact = new com_tilbuci_ui_component_Interacting();
};
$hxClasses["com.tilbuci.ws.Webservice"] = com_tilbuci_ws_Webservice;
com_tilbuci_ws_Webservice.__name__ = "com.tilbuci.ws.Webservice";
com_tilbuci_ws_Webservice.__super__ = openfl_events_EventDispatcher;
com_tilbuci_ws_Webservice.prototype = $extend(openfl_events_EventDispatcher.prototype,{
	url: null
	,_url: null
	,get_url: function() {
		return this._url;
	}
	,user: null
	,_user: null
	,get_user: function() {
		return this._user;
	}
	,key: null
	,_key: null
	,get_key: function() {
		return this._key;
	}
	,level: null
	,_level: null
	,get_level: function() {
		return this._level;
	}
	,_interact: null
	,setUser: function(us,key,lv) {
		this._user = us;
		this._key = key;
		this._level = lv;
		com_tilbuci_data_Global.userLevel = lv;
	}
	,logout: function() {
		this._user = "system";
		this._key = "";
		this._level = -1;
		com_tilbuci_data_Global.userLevel = -1;
	}
	,send: function(ac,req,callback,timeout,showInteract) {
		if(showInteract == null) {
			showInteract = true;
		}
		if(timeout == null) {
			timeout = 0;
		}
		var txt = com_tilbuci_statictools_StringStatic.jsonStringify(req);
		var tmp = this._url;
		var _g = new haxe_ds_StringMap();
		_g.h["r"] = txt;
		var value = com_tilbuci_statictools_StringStatic.md5(this._key + txt);
		_g.h["s"] = value;
		_g.h["u"] = this._user;
		_g.h["a"] = ac;
		new com_tilbuci_data_DataLoader(true,tmp,"POST",_g,4,callback,null,null,null,$bind(this,this.onEnd),null,timeout);
		if(showInteract) {
			this._interact.start();
		}
	}
	,download: function(req) {
		var urldw = StringTools.replace(this._url,"/ws","/download");
		var variables = openfl_net_URLVariables._new();
		var h = req.h;
		var k_h = h;
		var k_keys = Object.keys(h);
		var k_length = k_keys.length;
		var k_current = 0;
		while(k_current < k_length) {
			var k = k_keys[k_current++];
			variables[k] = req.h[k];
		}
		variables["a"] = "download";
		var request = new openfl_net_URLRequest(urldw);
		request.data = variables;
		request.method = "GET";
		openfl_Lib.getURL(request);
	}
	,openurl: function(addr) {
		var request = new openfl_net_URLRequest(addr);
		request.method = "GET";
		openfl_Lib.getURL(request);
	}
	,openWorkspace: function() {
		var urlwork = StringTools.replace(this._url,"/ws","/editor");
		var variables = openfl_net_URLVariables._new();
		variables["us"] = this._user;
		variables["uk"] = com_tilbuci_statictools_StringStatic.md5(this._user + this._key);
		var request = new openfl_net_URLRequest(urlwork);
		request.data = variables;
		request.method = "GET";
		openfl_Lib.getURL(request);
	}
	,kill: function() {
		this._url = null;
		this._user = null;
		this._key = null;
	}
	,onEnd: function() {
		this._interact.stop();
	}
	,__class__: com_tilbuci_ws_Webservice
	,__properties__: {get_level:"get_level",get_key:"get_key",get_user:"get_user",get_url:"get_url"}
});
var com_tilbuci_ws_WebserviceP = function(ws,key) {
	this._groups = [];
	this._level = -1;
	this._key = "";
	this._user = "system";
	openfl_events_EventDispatcher.call(this);
	this._url = ws;
	this._user = "system";
	this._key = key;
	this._groups = [];
};
$hxClasses["com.tilbuci.ws.WebserviceP"] = com_tilbuci_ws_WebserviceP;
com_tilbuci_ws_WebserviceP.__name__ = "com.tilbuci.ws.WebserviceP";
com_tilbuci_ws_WebserviceP.__super__ = openfl_events_EventDispatcher;
com_tilbuci_ws_WebserviceP.prototype = $extend(openfl_events_EventDispatcher.prototype,{
	url: null
	,_url: null
	,get_url: function() {
		return this._url;
	}
	,user: null
	,_user: null
	,get_user: function() {
		return this._user;
	}
	,key: null
	,_key: null
	,get_key: function() {
		return this._key;
	}
	,level: null
	,_level: null
	,get_level: function() {
		return this._level;
	}
	,groups: null
	,_groups: null
	,get_groups: function() {
		return this._groups;
	}
	,send: function(ac,req,callback,extra) {
		if(com_tilbuci_data_GlobalPlayer.server) {
			var txt = com_tilbuci_statictools_StringStatic.jsonStringify(req);
			var tmp = this._url;
			var _g = new haxe_ds_StringMap();
			_g.h["r"] = txt;
			var value = com_tilbuci_statictools_StringStatic.md5(this._key + txt);
			_g.h["s"] = value;
			_g.h["u"] = this._user;
			_g.h["a"] = ac;
			new com_tilbuci_data_DataLoader(true,tmp,"POST",_g,4,callback,null,null,null,null,extra);
			return true;
		} else {
			return false;
		}
	}
	,loginVisitor: function(email,title,text,sender,callback) {
		var _g = new haxe_ds_StringMap();
		_g.h["email"] = email;
		_g.h["title"] = title;
		_g.h["text"] = text;
		_g.h["sender"] = sender;
		return this.send("System/Visitor",_g,callback);
	}
	,checkVisitorCode: function(email,code,callback) {
		var _g = new haxe_ds_StringMap();
		_g.h["email"] = email;
		_g.h["code"] = code;
		return this.send("System/VisitorCode",_g,callback);
	}
	,checkVisitorKey: function(email,key,callback) {
		var _g = new haxe_ds_StringMap();
		_g.h["email"] = email;
		_g.h["key"] = key;
		return this.send("System/VisitorKey",_g,callback);
	}
	,dataSave: function(name,values,callback) {
		var _g = new haxe_ds_StringMap();
		_g.h["name"] = name;
		var value = com_tilbuci_statictools_StringStatic.jsonStringify(values);
		_g.h["values"] = value;
		var value = com_tilbuci_data_GlobalPlayer.movie.get_mvId();
		_g.h["movie"] = value;
		return this.send("Visitor/DataSave",_g,callback);
	}
	,dataLoad: function(name,callback) {
		var _g = new haxe_ds_StringMap();
		_g.h["name"] = name;
		var value = com_tilbuci_data_GlobalPlayer.movie.get_mvId();
		_g.h["movie"] = value;
		return this.send("Visitor/DataLoad",_g,callback);
	}
	,stateSave: function(values,quick,about,callback) {
		var _g = new haxe_ds_StringMap();
		var value = com_tilbuci_statictools_StringStatic.jsonStringify(values);
		_g.h["values"] = value;
		var value = com_tilbuci_data_GlobalPlayer.movie.get_mvId();
		_g.h["movie"] = value;
		_g.h["quick"] = quick;
		var value = com_tilbuci_data_GlobalPlayer.movie.get_scId();
		_g.h["scene"] = value;
		_g.h["about"] = about;
		return this.send("Visitor/StateSave",_g,callback);
	}
	,stateLoad: function(id,quick,callback) {
		var _g = new haxe_ds_StringMap();
		_g.h["id"] = id;
		_g.h["quick"] = quick;
		var value = com_tilbuci_data_GlobalPlayer.movie.get_mvId();
		_g.h["movie"] = value;
		return this.send("Visitor/StateLoad",_g,callback);
	}
	,stateList: function(dateformat,callback) {
		var _g = new haxe_ds_StringMap();
		_g.h["format"] = dateformat;
		var value = com_tilbuci_data_GlobalPlayer.movie.get_mvId();
		_g.h["movie"] = value;
		return this.send("Visitor/StateList",_g,callback);
	}
	,loadScene: function(id,callback) {
		var _g = new haxe_ds_StringMap();
		_g.h["id"] = id;
		var value = com_tilbuci_data_GlobalPlayer.movie.get_mvId();
		_g.h["movie"] = value;
		_g.h["visitor"] = this._user;
		return this.send("Visitor/LoadScene",_g,callback);
	}
	,setUser: function(us,key,groups) {
		this._user = us;
		this._key = key;
		this._groups = groups;
	}
	,clearUser: function() {
		this._user = "system";
		this._key = "";
		this._groups = [];
	}
	,userLogged: function() {
		if(this._user != "system") {
			return this._user != "";
		} else {
			return false;
		}
	}
	,getUser: function() {
		if(this.userLogged()) {
			return this._user;
		} else {
			return "";
		}
	}
	,kill: function() {
		this._url = null;
		this._user = null;
		this._key = null;
		while(this._groups.length > 0) this._groups.shift();
		this._groups = null;
	}
	,__class__: com_tilbuci_ws_WebserviceP
	,__properties__: {get_groups:"get_groups",get_level:"get_level",get_key:"get_key",get_user:"get_user",get_url:"get_url"}
});
var feathers_controls_ActivityIndicator = function() {
	this.__indeterminateDuration = 0.75;
	this.__activitySkin = null;
	this._lastUpdateTime = 0;
	this._reversed = false;
	this._savedSkinAlpha = 1.0;
	this._activitySkinMeasurements = null;
	this.initializeActivityIndicatorTheme();
	feathers_core_FeathersControl.call(this);
	this.addEventListener("addedToStage",$bind(this,this.activityIndicator_addedToStageHandler));
	this.addEventListener("removedFromStage",$bind(this,this.activityIndicator_removedFromStageHandler));
};
$hxClasses["feathers.controls.ActivityIndicator"] = feathers_controls_ActivityIndicator;
feathers_controls_ActivityIndicator.__name__ = "feathers.controls.ActivityIndicator";
feathers_controls_ActivityIndicator.__super__ = feathers_core_FeathersControl;
feathers_controls_ActivityIndicator.prototype = $extend(feathers_core_FeathersControl.prototype,{
	_currentActivitySkin: null
	,_activitySkinMeasurements: null
	,_savedSkinAlpha: null
	,_reversed: null
	,_lastUpdateTime: null
	,initializeActivityIndicatorTheme: function() {
		feathers_themes_steel_components_SteelActivityIndicatorStyles.initialize();
	}
	,update: function() {
		var sizeInvalid = this.isInvalid(feathers_core_InvalidationFlag.SIZE);
		var stylesInvalid = this.isInvalid(feathers_core_InvalidationFlag.STYLES);
		if(stylesInvalid) {
			this.refreshBackgroundSkin();
		}
		if(this.measure()) {
			sizeInvalid = true;
		}
		if(sizeInvalid || stylesInvalid) {
			this.layoutBackgroundSkin();
		}
	}
	,measure: function() {
		var needsWidth = this.get_explicitWidth() == null;
		var needsHeight = this.get_explicitHeight() == null;
		var needsMinWidth = this.get_explicitMinWidth() == null;
		var needsMinHeight = this.get_explicitMinHeight() == null;
		var needsMaxWidth = this.get_explicitMaxWidth() == null;
		var needsMaxHeight = this.get_explicitMaxHeight() == null;
		if(!needsWidth && !needsHeight && !needsMinWidth && !needsMinHeight && !needsMaxWidth && !needsMaxHeight) {
			return false;
		}
		if(this._currentActivitySkin != null) {
			feathers_utils_MeasurementsUtil.resetFluidlyWithParent(this._activitySkinMeasurements,this._currentActivitySkin,this);
		}
		var measureSkin = null;
		if(js_Boot.__implements(this._currentActivitySkin,feathers_core_IMeasureObject)) {
			measureSkin = this._currentActivitySkin;
		}
		if(js_Boot.__implements(this._currentActivitySkin,feathers_core_IValidating)) {
			this._currentActivitySkin.validateNow();
		}
		var newWidth = this.get_explicitWidth();
		if(needsWidth) {
			newWidth = 0.0;
			if(this._currentActivitySkin != null) {
				newWidth = Math.max(this._currentActivitySkin.get_width(),newWidth);
			}
		}
		var newHeight = this.get_explicitHeight();
		if(needsHeight) {
			newHeight = 0.0;
			if(this._currentActivitySkin != null) {
				newHeight = Math.max(this._currentActivitySkin.get_height(),newHeight);
			}
		}
		var newMinWidth = this.get_explicitMinWidth();
		if(needsMinWidth) {
			newMinWidth = 0.0;
			if(measureSkin != null) {
				newMinWidth = Math.max(measureSkin.get_minWidth(),newMinWidth);
			} else if(this._activitySkinMeasurements != null && this._activitySkinMeasurements.minWidth != null) {
				newMinWidth = Math.max(this._activitySkinMeasurements.minWidth,newMinWidth);
			}
		}
		var newMinHeight = this.get_explicitMinHeight();
		if(needsMinHeight) {
			newMinHeight = 0.0;
			if(measureSkin != null) {
				newMinHeight = Math.max(measureSkin.get_minHeight(),newMinHeight);
			} else if(this._activitySkinMeasurements != null && this._activitySkinMeasurements.minHeight != null) {
				newMinHeight = Math.max(this._activitySkinMeasurements.minHeight,newMinHeight);
			}
		}
		var newMaxWidth = this.get_explicitMaxWidth();
		if(needsMaxWidth) {
			if(measureSkin != null) {
				newMaxWidth = measureSkin.get_maxWidth();
			} else if(this._activitySkinMeasurements != null && this._activitySkinMeasurements.maxWidth != null) {
				newMaxWidth = this._activitySkinMeasurements.maxWidth;
			} else {
				newMaxWidth = 1.0 / 0.0;
			}
		}
		var newMaxHeight = this.get_explicitMaxHeight();
		if(needsMaxHeight) {
			if(measureSkin != null) {
				newMaxHeight = measureSkin.get_maxHeight();
			} else if(this._activitySkinMeasurements != null && this._activitySkinMeasurements.maxHeight != null) {
				newMaxHeight = this._activitySkinMeasurements.maxHeight;
			} else {
				newMaxHeight = 1.0 / 0.0;
			}
		}
		return this.saveMeasurements(newWidth,newHeight,newMinWidth,newMinHeight,newMaxWidth,newMaxHeight);
	}
	,layoutBackgroundSkin: function() {
		if(this._currentActivitySkin == null) {
			return;
		}
		var diameter = Math.min(this.actualWidth,this.actualHeight);
		this._currentActivitySkin.set_width(diameter);
		this._currentActivitySkin.set_height(diameter);
		this._currentActivitySkin.set_x((this.actualWidth - diameter) / 2.0);
		this._currentActivitySkin.set_y((this.actualHeight - diameter) / 2.0);
		if(js_Boot.__implements(this._currentActivitySkin,feathers_core_IValidating)) {
			this._currentActivitySkin.validateNow();
		}
	}
	,refreshBackgroundSkin: function() {
		var oldSkin = this._currentActivitySkin;
		this._currentActivitySkin = this.getCurrentBackgroundSkin();
		if(this._currentActivitySkin == oldSkin) {
			return;
		}
		this.removeCurrentBackgroundSkin(oldSkin);
		this.addCurrentBackgroundSkin(this._currentActivitySkin);
	}
	,getCurrentBackgroundSkin: function() {
		return this.get_activitySkin();
	}
	,addCurrentBackgroundSkin: function(skin) {
		if(skin == null) {
			this._activitySkinMeasurements = null;
			return;
		}
		if(js_Boot.__implements(skin,feathers_core_IUIControl)) {
			skin.initializeNow();
		}
		if(this._activitySkinMeasurements == null) {
			this._activitySkinMeasurements = new feathers_layout_Measurements(skin);
		} else {
			this._activitySkinMeasurements.save(skin);
		}
		this._savedSkinAlpha = skin.get_alpha();
		if(js_Boot.__implements(skin,feathers_skins_IProgrammaticSkin)) {
			skin.set_uiContext(this);
		}
		this.addChildAt(skin,0);
	}
	,removeCurrentBackgroundSkin: function(skin) {
		if(skin == null) {
			return;
		}
		if(js_Boot.__implements(skin,feathers_skins_IProgrammaticSkin)) {
			skin.set_uiContext(null);
		}
		this._activitySkinMeasurements.restore(skin);
		skin.set_alpha(this._savedSkinAlpha);
		if(skin.parent == this) {
			this.removeChild(skin);
		}
	}
	,activityIndicator_addedToStageHandler: function(event) {
		this._lastUpdateTime = openfl_Lib.getTimer();
		this.addEventListener("enterFrame",$bind(this,this.activityIndicator_enterFrameHandler));
	}
	,activityIndicator_removedFromStageHandler: function(event) {
		this.removeEventListener("enterFrame",$bind(this,this.activityIndicator_enterFrameHandler));
	}
	,activityIndicator_enterFrameHandler: function(event) {
		if(!this._enabled || !this.get_visible() || this._currentActivitySkin == null) {
			return;
		}
		var currentTime = openfl_Lib.getTimer();
		var ratio = (currentTime - this._lastUpdateTime) / (this.get_indeterminateDuration() * 1000.0);
		if(ratio >= 1.0) {
			ratio -= Math.floor(ratio);
			this._lastUpdateTime = currentTime;
			this._reversed = !this._reversed;
		}
		if(js_Boot.__implements(this._currentActivitySkin,feathers_skins_IIndeterminateSkin)) {
			var activitySkin = this._currentActivitySkin;
			activitySkin.set_indeterminatePosition(ratio);
		} else {
			this._currentActivitySkin.set_alpha(this._savedSkinAlpha * (this._reversed ? 1.0 - ratio : ratio));
		}
	}
	,__activitySkin: null
	,get_activitySkin: function() {
		return this.__activitySkin;
	}
	,set_activitySkin: function(value) {
		if(!this.setStyle("activitySkin")) {
			return this.__activitySkin;
		}
		if(this.__activitySkin == value) {
			return this.__activitySkin;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_activitySkin);
		this.__activitySkin = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__activitySkin;
	}
	,clearStyle_activitySkin: function() {
		this.set_activitySkin(null);
		return this.get_activitySkin();
	}
	,__indeterminateDuration: null
	,get_indeterminateDuration: function() {
		return this.__indeterminateDuration;
	}
	,set_indeterminateDuration: function(value) {
		if(!this.setStyle("indeterminateDuration")) {
			return this.__indeterminateDuration;
		}
		if(this.__indeterminateDuration == value) {
			return this.__indeterminateDuration;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_indeterminateDuration);
		this.__indeterminateDuration = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__indeterminateDuration;
	}
	,clearStyle_indeterminateDuration: function() {
		this.set_indeterminateDuration(0.75);
		return this.get_indeterminateDuration();
	}
	,__class__: feathers_controls_ActivityIndicator
	,__properties__: $extend(feathers_core_FeathersControl.prototype.__properties__,{set_indeterminateDuration:"set_indeterminateDuration",get_indeterminateDuration:"get_indeterminateDuration",set_activitySkin:"set_activitySkin",get_activitySkin:"get_activitySkin"})
});
var feathers_data_ButtonBarItemState = function(data,index,text) {
	if(index == null) {
		index = -1;
	}
	this.enabled = true;
	this.index = -1;
	this.data = data;
	this.index = index;
	this.text = text;
};
$hxClasses["feathers.data.ButtonBarItemState"] = feathers_data_ButtonBarItemState;
feathers_data_ButtonBarItemState.__name__ = "feathers.data.ButtonBarItemState";
feathers_data_ButtonBarItemState.prototype = {
	owner: null
	,data: null
	,index: null
	,text: null
	,enabled: null
	,recyclerID: null
	,__class__: feathers_data_ButtonBarItemState
};
var feathers_controls_ButtonBar = function(dataProvider,itemTriggerListener) {
	this.__disabledBackgroundSkin = null;
	this.__backgroundSkin = null;
	this.__layout = null;
	this.__customButtonVariant = null;
	this._ignoreChildChanges = false;
	this._layoutResult = new feathers_layout_LayoutBoundsResult();
	this._layoutMeasurements = new feathers_layout_Measurements();
	this._backgroundSkinMeasurements = null;
	this._currentBackgroundSkin = null;
	this._ignoreSelectionChange = false;
	this._layoutItems = [];
	this._unrenderedData = [];
	this.itemStatePool = new lime_utils_ObjectPool(function() {
		return new feathers_data_ButtonBarItemState();
	});
	this.buttonToItemState = new haxe_ds_ObjectMap();
	this.stringDataToButton = new haxe_ds_StringMap();
	this.objectDataToButton = new haxe_ds_ObjectMap();
	this._additionalStorage = null;
	this._defaultStorage = new feathers_controls__$ButtonBar_ButtonStorage(null,feathers_utils_DisplayObjectRecycler.withClass(feathers_controls_Button));
	this._recyclerMap = null;
	this._forceItemStateUpdate = false;
	this._previousCustomButtonVariant = null;
	this.initializeButtonBarTheme();
	feathers_core_FeathersControl.call(this);
	this.set_dataProvider(dataProvider);
	if(itemTriggerListener != null) {
		this.addEventListener("itemTrigger",itemTriggerListener);
	}
};
$hxClasses["feathers.controls.ButtonBar"] = feathers_controls_ButtonBar;
feathers_controls_ButtonBar.__name__ = "feathers.controls.ButtonBar";
feathers_controls_ButtonBar.defaultUpdateButton = function(button,state) {
	button.set_text(state.text);
};
feathers_controls_ButtonBar.defaultResetButton = function(button,state) {
	button.set_text(null);
};
feathers_controls_ButtonBar.__super__ = feathers_core_FeathersControl;
feathers_controls_ButtonBar.prototype = $extend(feathers_core_FeathersControl.prototype,{
	_dataProvider: null
	,get_dataProvider: function() {
		return this._dataProvider;
	}
	,set_dataProvider: function(value) {
		if(this._dataProvider == value) {
			return this._dataProvider;
		}
		if(this._dataProvider != null) {
			this._dataProvider.removeEventListener("change",$bind(this,this.buttonBar_dataProvider_changeHandler));
			this._dataProvider.removeEventListener("updateItem",$bind(this,this.buttonBar_dataProvider_updateItemHandler));
			this._dataProvider.removeEventListener("updateAll",$bind(this,this.buttonBar_dataProvider_updateAllHandler));
		}
		this._dataProvider = value;
		if(this._dataProvider != null) {
			this._dataProvider.addEventListener("change",$bind(this,this.buttonBar_dataProvider_changeHandler));
			this._dataProvider.addEventListener("updateItem",$bind(this,this.buttonBar_dataProvider_updateItemHandler));
			this._dataProvider.addEventListener("updateAll",$bind(this,this.buttonBar_dataProvider_updateAllHandler));
		}
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		feathers_events_FeathersEvent.dispatch(this,"dataChange");
		return this._dataProvider;
	}
	,_previousCustomButtonVariant: null
	,get_buttonRecycler: function() {
		return this._defaultStorage.buttonRecycler;
	}
	,set_buttonRecycler: function(value) {
		if(this._defaultStorage.buttonRecycler == value) {
			return this._defaultStorage.buttonRecycler;
		}
		this._defaultStorage.oldButtonRecycler = this._defaultStorage.buttonRecycler;
		this._defaultStorage.buttonRecycler = value;
		this.setInvalid(feathers_controls_ButtonBar.INVALIDATION_FLAG_BUTTON_FACTORY);
		return this._defaultStorage.buttonRecycler;
	}
	,_forceItemStateUpdate: null
	,get_forceItemStateUpdate: function() {
		return this._forceItemStateUpdate;
	}
	,set_forceItemStateUpdate: function(value) {
		if(this._forceItemStateUpdate == value) {
			return this._forceItemStateUpdate;
		}
		this._forceItemStateUpdate = value;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		return this._forceItemStateUpdate;
	}
	,_recyclerMap: null
	,_buttonRecyclerIDFunction: null
	,get_buttonRecyclerIDFunction: function() {
		return this._buttonRecyclerIDFunction;
	}
	,set_buttonRecyclerIDFunction: function(value) {
		if(this._buttonRecyclerIDFunction == value) {
			return this._buttonRecyclerIDFunction;
		}
		this._buttonRecyclerIDFunction = value;
		this.setInvalid(feathers_controls_ButtonBar.INVALIDATION_FLAG_BUTTON_FACTORY);
		return this._buttonRecyclerIDFunction;
	}
	,_defaultStorage: null
	,_additionalStorage: null
	,objectDataToButton: null
	,stringDataToButton: null
	,buttonToItemState: null
	,itemStatePool: null
	,_unrenderedData: null
	,_layoutItems: null
	,_ignoreSelectionChange: null
	,itemToText: function(data) {
		return Std.string(data);
	}
	,itemToEnabled: function(data) {
		return true;
	}
	,_currentBackgroundSkin: null
	,_backgroundSkinMeasurements: null
	,_layoutMeasurements: null
	,_layoutResult: null
	,_ignoreChildChanges: null
	,itemToButton: function(item) {
		if(item == null) {
			return null;
		}
		if(typeof(item) == "string") {
			return this.stringDataToButton.h[item];
		}
		return this.objectDataToButton.h[item.__id__];
	}
	,indexToButton: function(index) {
		if(this._dataProvider == null || index < 0 || index >= this._dataProvider.get_length()) {
			return null;
		}
		var item = this._dataProvider.get(index);
		if(typeof(item) == "string") {
			return this.stringDataToButton.h[item];
		}
		return this.objectDataToButton.h[item.__id__];
	}
	,itemToItemState: function(item) {
		if(item == null) {
			return null;
		}
		var itemState = null;
		var button = null;
		if(typeof(item) == "string") {
			button = this.stringDataToButton.h[item];
		} else {
			button = this.objectDataToButton.h[item.__id__];
		}
		if(button != null) {
			itemState = this.buttonToItemState.h[button.__id__];
		} else {
			var index = this._dataProvider.indexOf(item);
			if(index == -1) {
				return null;
			}
			itemState = new feathers_data_ButtonBarItemState();
			this.populateCurrentItemState(item,index,itemState,false);
		}
		return itemState;
	}
	,getButtonRecycler: function(id) {
		if(this._recyclerMap == null) {
			return null;
		}
		return this._recyclerMap.h[id];
	}
	,setButtonRecycler: function(id,recycler) {
		if(this._recyclerMap == null) {
			this._recyclerMap = new haxe_ds_StringMap();
		}
		if(recycler == null) {
			var _this = this._recyclerMap;
			if(Object.prototype.hasOwnProperty.call(_this.h,id)) {
				delete(_this.h[id]);
			}
			return;
		}
		this._recyclerMap.h[id] = recycler;
		this.setInvalid(feathers_controls_ButtonBar.INVALIDATION_FLAG_BUTTON_FACTORY);
	}
	,dispose: function() {
		this.refreshInactiveButtons(this._defaultStorage,true);
		if(this._additionalStorage != null) {
			var _g = 0;
			var _g1 = this._additionalStorage.length;
			while(_g < _g1) {
				var i = _g++;
				var storage = this._additionalStorage[i];
				this.refreshInactiveButtons(storage,true);
			}
		}
		this.set_dataProvider(null);
		feathers_core_FeathersControl.prototype.dispose.call(this);
	}
	,initializeButtonBarTheme: function() {
		feathers_themes_steel_components_SteelButtonBarStyles.initialize();
	}
	,update: function() {
		var dataInvalid = this.isInvalid(feathers_core_InvalidationFlag.DATA);
		var layoutInvalid = this.isInvalid(feathers_core_InvalidationFlag.LAYOUT);
		var selectionInvalid = this.isInvalid(feathers_core_InvalidationFlag.SELECTION);
		var stateInvalid = this.isInvalid(feathers_core_InvalidationFlag.STATE);
		var stylesInvalid = this.isInvalid(feathers_core_InvalidationFlag.STYLES);
		if(this._previousCustomButtonVariant != this.get_customButtonVariant()) {
			this.setInvalidationFlag(feathers_controls_ButtonBar.INVALIDATION_FLAG_BUTTON_FACTORY);
		}
		var buttonsInvalid = this.isInvalid(feathers_controls_ButtonBar.INVALIDATION_FLAG_BUTTON_FACTORY);
		if(stylesInvalid || stateInvalid) {
			this.refreshBackgroundSkin();
		}
		if(buttonsInvalid || selectionInvalid || stateInvalid || dataInvalid) {
			this.refreshButtons();
		}
		this.refreshViewPortBounds();
		this.handleLayout();
		this.handleLayoutResult();
		this.layoutBackgroundSkin();
		this.validateChildren();
		this._previousCustomButtonVariant = this.get_customButtonVariant();
	}
	,refreshViewPortBounds: function() {
		this._layoutMeasurements.save(this);
	}
	,handleLayout: function() {
		var oldIgnoreChildChanges = this._ignoreChildChanges;
		this._ignoreChildChanges = true;
		this._layoutResult.reset();
		if(this.get_layout() != null) {
			this.get_layout().layout(this._layoutItems,this._layoutMeasurements,this._layoutResult);
		}
		this._ignoreChildChanges = oldIgnoreChildChanges;
	}
	,handleLayoutResult: function() {
		var viewPortWidth = this._layoutResult.viewPortWidth;
		var viewPortHeight = this._layoutResult.viewPortHeight;
		this.saveMeasurements(viewPortWidth,viewPortHeight,viewPortWidth,viewPortHeight);
	}
	,validateChildren: function() {
		var _g = 0;
		var _g1 = this._layoutItems;
		while(_g < _g1.length) {
			var button = _g1[_g];
			++_g;
			if(!js_Boot.__implements(button,feathers_core_IValidating)) {
				return;
			}
			button.validateNow();
		}
	}
	,refreshButtons: function() {
		if(this.get_buttonRecycler().update == null) {
			this.get_buttonRecycler().update = feathers_controls_ButtonBar.defaultUpdateButton;
			if(this.get_buttonRecycler().reset == null) {
				this.get_buttonRecycler().reset = feathers_controls_ButtonBar.defaultResetButton;
			}
		}
		if(this._recyclerMap != null) {
			var h = this._recyclerMap.h;
			var recycler_h = h;
			var recycler_keys = Object.keys(h);
			var recycler_length = recycler_keys.length;
			var recycler_current = 0;
			while(recycler_current < recycler_length) {
				var recycler = recycler_h[recycler_keys[recycler_current++]];
				if(recycler.update == null) {
					if(recycler.update == null) {
						recycler.update = feathers_controls_ButtonBar.defaultUpdateButton;
						if(recycler.reset == null) {
							recycler.reset = feathers_controls_ButtonBar.defaultResetButton;
						}
					}
				}
			}
		}
		var buttonsInvalid = this.isInvalid(feathers_controls_ButtonBar.INVALIDATION_FLAG_BUTTON_FACTORY);
		this.refreshInactiveButtons(this._defaultStorage,buttonsInvalid);
		if(this._additionalStorage != null) {
			var _g = 0;
			var _g1 = this._additionalStorage.length;
			while(_g < _g1) {
				var i = _g++;
				var storage = this._additionalStorage[i];
				this.refreshInactiveButtons(storage,buttonsInvalid);
			}
		}
		this.findUnrenderedData();
		this.recoverInactiveButtons(this._defaultStorage);
		if(this._additionalStorage != null) {
			var _g = 0;
			var _g1 = this._additionalStorage.length;
			while(_g < _g1) {
				var i = _g++;
				var storage = this._additionalStorage[i];
				this.recoverInactiveButtons(storage);
			}
		}
		this.renderUnrenderedData();
		this.freeInactiveButtons(this._defaultStorage);
		if(this._defaultStorage.inactiveButtons.length > 0) {
			var c = js_Boot.getClass(this);
			throw new openfl_errors_IllegalOperationError("" + c.__name__ + ": inactive buttons should be empty after updating.");
		}
		if(this._additionalStorage != null) {
			var _g = 0;
			var _g1 = this._additionalStorage.length;
			while(_g < _g1) {
				var i = _g++;
				var storage = this._additionalStorage[i];
				this.freeInactiveButtons(storage);
				if(storage.inactiveButtons.length > 0) {
					var c = js_Boot.getClass(this);
					throw new openfl_errors_IllegalOperationError("" + c.__name__ + ": inactive buttons " + storage.id + " should be empty after updating.");
				}
			}
		}
	}
	,refreshInactiveButtons: function(storage,factoryInvalid) {
		var temp = storage.inactiveButtons;
		storage.inactiveButtons = storage.activeButtons;
		storage.activeButtons = temp;
		if(storage.activeButtons.length > 0) {
			var c = js_Boot.getClass(this);
			throw new openfl_errors_IllegalOperationError("" + c.__name__ + ": active buttons should be empty before updating.");
		}
		if(factoryInvalid) {
			this.recoverInactiveButtons(storage);
			this.freeInactiveButtons(storage);
		}
	}
	,recoverInactiveButtons: function(storage) {
		var _g = 0;
		var _g1 = storage.inactiveButtons;
		while(_g < _g1.length) {
			var button = _g1[_g];
			++_g;
			if(button == null) {
				continue;
			}
			var state = this.buttonToItemState.h[button.__id__];
			if(state == null) {
				continue;
			}
			var item = state.data;
			this.buttonToItemState.remove(button);
			if(typeof(item) == "string") {
				var _this = this.stringDataToButton;
				var key = item;
				if(Object.prototype.hasOwnProperty.call(_this.h,key)) {
					delete(_this.h[key]);
				}
			} else {
				this.objectDataToButton.remove(item);
			}
			button.removeEventListener("trigger",$bind(this,this.buttonBar_button_triggerHandler));
			this.resetButton(button,state);
			this.itemStatePool.release(state);
		}
	}
	,freeInactiveButtons: function(storage) {
		var _g = 0;
		var _g1 = storage.inactiveButtons;
		while(_g < _g1.length) {
			var button = _g1[_g];
			++_g;
			if(button == null) {
				continue;
			}
			this.destroyButton(button);
		}
		storage.inactiveButtons.length = 0;
	}
	,refreshBackgroundSkin: function() {
		var oldSkin = this._currentBackgroundSkin;
		this._currentBackgroundSkin = this.getCurrentBackgroundSkin();
		if(this._currentBackgroundSkin == oldSkin) {
			return;
		}
		this.removeCurrentBackgroundSkin(oldSkin);
		this.addCurrentBackgroundSkin(this._currentBackgroundSkin);
	}
	,getCurrentBackgroundSkin: function() {
		if(!this._enabled && this.get_disabledBackgroundSkin() != null) {
			return this.get_disabledBackgroundSkin();
		}
		return this.get_backgroundSkin();
	}
	,addCurrentBackgroundSkin: function(skin) {
		if(skin == null) {
			this._backgroundSkinMeasurements = null;
			return;
		}
		if(js_Boot.__implements(skin,feathers_core_IUIControl)) {
			skin.initializeNow();
		}
		if(this._backgroundSkinMeasurements == null) {
			this._backgroundSkinMeasurements = new feathers_layout_Measurements(skin);
		} else {
			this._backgroundSkinMeasurements.save(skin);
		}
		if(js_Boot.__implements(skin,feathers_skins_IProgrammaticSkin)) {
			skin.set_uiContext(this);
		}
		this.addChildAt(skin,0);
	}
	,removeCurrentBackgroundSkin: function(skin) {
		if(skin == null) {
			return;
		}
		if(js_Boot.__implements(skin,feathers_skins_IProgrammaticSkin)) {
			skin.set_uiContext(null);
		}
		this._backgroundSkinMeasurements.restore(skin);
		if(skin.parent == this) {
			this.removeChild(skin);
		}
	}
	,layoutBackgroundSkin: function() {
		if(this._currentBackgroundSkin == null) {
			return;
		}
		this._currentBackgroundSkin.set_x(0.0);
		this._currentBackgroundSkin.set_y(0.0);
		if(this._currentBackgroundSkin.get_width() != this.actualWidth) {
			this._currentBackgroundSkin.set_width(this.actualWidth);
		}
		if(this._currentBackgroundSkin.get_height() != this.actualHeight) {
			this._currentBackgroundSkin.set_height(this.actualHeight);
		}
		if(js_Boot.__implements(this._currentBackgroundSkin,feathers_core_IValidating)) {
			this._currentBackgroundSkin.validateNow();
		}
	}
	,findUnrenderedData: function() {
		this._layoutItems.length = 0;
		if(this._dataProvider == null || this._dataProvider.get_length() == 0) {
			return;
		}
		this._layoutItems.length = this._dataProvider.get_length();
		var depthOffset = this._currentBackgroundSkin != null ? 1 : 0;
		var _g = 0;
		var _g1 = this._dataProvider.get_length();
		while(_g < _g1) {
			var i = _g++;
			var item = this._dataProvider.get(i);
			var button = null;
			if(typeof(item) == "string") {
				button = this.stringDataToButton.h[item];
			} else {
				button = this.objectDataToButton.h[item.__id__];
			}
			if(button != null) {
				var state = this.buttonToItemState.h[button.__id__];
				var changed = this.populateCurrentItemState(item,i,state,this._forceItemStateUpdate);
				var oldRecyclerID = state.recyclerID;
				var storage = this.itemStateToStorage(state);
				if(storage.id != oldRecyclerID) {
					this._unrenderedData.push(item);
					continue;
				}
				if(changed) {
					this.updateButton(button,state,storage);
				}
				this._layoutItems[i] = button;
				this.setChildIndex(button,i + depthOffset);
				var removed = HxOverrides.remove(storage.inactiveButtons,button);
				if(!removed) {
					var c = js_Boot.getClass(this);
					throw new openfl_errors_IllegalOperationError("" + c.__name__ + ": button renderer map contains bad data for item at index " + i + ". This may be caused by duplicate items in the data provider, which is not allowed.");
				}
				storage.activeButtons.push(button);
			} else {
				this._unrenderedData.push(item);
			}
		}
	}
	,renderUnrenderedData: function() {
		var depthOffset = this._currentBackgroundSkin != null ? 1 : 0;
		var _g = 0;
		var _g1 = this._unrenderedData;
		while(_g < _g1.length) {
			var item = _g1[_g];
			++_g;
			var index = this._dataProvider.indexOf(item);
			var state = this.itemStatePool.get();
			this.populateCurrentItemState(item,index,state,true);
			var button = this.createButton(state);
			this.addChildAt(button,index + depthOffset);
			this._layoutItems[index] = button;
		}
		this._unrenderedData.length = 0;
	}
	,createButton: function(state) {
		var storage = this.itemStateToStorage(state);
		var button = null;
		if(storage.inactiveButtons.length == 0) {
			button = this.get_buttonRecycler().create();
			if(button.get_variant() == null) {
				var variant = this.get_customButtonVariant() != null ? this.get_customButtonVariant() : feathers_controls_ButtonBar.CHILD_VARIANT_BUTTON;
				button.set_variant(variant);
			}
			button.initializeNow();
		} else {
			button = storage.inactiveButtons.shift();
		}
		this.updateButton(button,state,storage);
		button.addEventListener("trigger",$bind(this,this.buttonBar_button_triggerHandler));
		this.buttonToItemState.set(button,state);
		var item = state.data;
		if(typeof(item) == "string") {
			this.stringDataToButton.h[item] = button;
		} else {
			this.objectDataToButton.set(item,button);
		}
		storage.activeButtons.push(button);
		return button;
	}
	,destroyButton: function(button) {
		this.removeChild(button);
		if(this.get_buttonRecycler().destroy != null) {
			this.get_buttonRecycler().destroy(button);
		}
	}
	,itemStateToStorage: function(state) {
		var recyclerID = null;
		if(this._buttonRecyclerIDFunction != null) {
			recyclerID = this._buttonRecyclerIDFunction(state);
		}
		var recycler = null;
		if(recyclerID != null) {
			if(this._recyclerMap != null) {
				recycler = this._recyclerMap.h[recyclerID];
			}
			if(recycler == null) {
				throw new openfl_errors_IllegalOperationError("Item renderer recycler ID \"" + recyclerID + "\" is not registered.");
			}
		}
		if(recycler == null) {
			return this._defaultStorage;
		}
		if(this._additionalStorage == null) {
			this._additionalStorage = [];
		}
		var _g = 0;
		var _g1 = this._additionalStorage.length;
		while(_g < _g1) {
			var i = _g++;
			var storage = this._additionalStorage[i];
			if(storage.buttonRecycler == recycler) {
				return storage;
			}
		}
		var storage = new feathers_controls__$ButtonBar_ButtonStorage(recyclerID,recycler);
		this._additionalStorage.push(storage);
		return storage;
	}
	,populateCurrentItemState: function(item,index,state,force) {
		var changed = false;
		if(force || state.owner != this) {
			state.owner = this;
			changed = true;
		}
		if(force || state.data != item) {
			state.data = item;
			changed = true;
		}
		if(force || state.index != index) {
			state.index = index;
			changed = true;
		}
		var enabled = this._enabled && this.itemToEnabled(item);
		if(force || state.enabled != enabled) {
			state.enabled = enabled;
			changed = true;
		}
		var text = this.itemToText(item);
		if(force || state.text != text) {
			state.text = text;
			changed = true;
		}
		return changed;
	}
	,updateButton: function(button,state,storage) {
		state.recyclerID = storage.id;
		var oldIgnoreSelectionChange = this._ignoreSelectionChange;
		this._ignoreSelectionChange = true;
		if(this.get_buttonRecycler().update != null) {
			this.get_buttonRecycler().update(button,state);
		}
		this._ignoreSelectionChange = oldIgnoreSelectionChange;
		this.refreshButtonProperties(button,state);
	}
	,resetButton: function(button,state) {
		var oldIgnoreSelectionChange = this._ignoreSelectionChange;
		this._ignoreSelectionChange = true;
		if(this.get_buttonRecycler() != null && this.get_buttonRecycler().reset != null) {
			this.get_buttonRecycler().reset(button,state);
		}
		this._ignoreSelectionChange = oldIgnoreSelectionChange;
		this.refreshButtonProperties(button,feathers_controls_ButtonBar.RESET_BUTTON_STATE);
	}
	,refreshButtonProperties: function(button,state) {
		var oldIgnoreSelectionChange = this._ignoreSelectionChange;
		this._ignoreSelectionChange = true;
		if(js_Boot.__implements(button,feathers_core_IUIControl)) {
			var uiControl = button;
			uiControl.set_enabled(state.enabled);
		}
		if(js_Boot.__implements(button,feathers_controls_dataRenderers_IDataRenderer)) {
			var dataRenderer = button;
			dataRenderer.set_data(state.data);
		}
		if(js_Boot.__implements(button,feathers_layout_ILayoutIndexObject)) {
			var layoutObject = button;
			layoutObject.set_layoutIndex(state.index);
		}
		button.set_enabled(state.enabled);
		this._ignoreSelectionChange = oldIgnoreSelectionChange;
	}
	,buttonBar_button_triggerHandler: function(event) {
		var button = js_Boot.__cast(event.currentTarget , feathers_controls_Button);
		var state = this.buttonToItemState.h[button.__id__];
		feathers_events_ButtonBarEvent.dispatch(this,"itemTrigger",state);
	}
	,buttonBar_dataProvider_changeHandler: function(event) {
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
	}
	,updateButtonForIndex: function(index) {
		var item = this._dataProvider.get(index);
		var button = null;
		if(typeof(item) == "string") {
			button = this.stringDataToButton.h[item];
		} else {
			button = this.objectDataToButton.h[item.__id__];
		}
		if(button == null) {
			this.setInvalid(feathers_core_InvalidationFlag.DATA);
			return;
		}
		var state = this.buttonToItemState.h[button.__id__];
		if(state.owner == null) {
			return;
		}
		var storage = this.itemStateToStorage(state);
		this.populateCurrentItemState(item,index,state,true);
		this.resetButton(button,state);
		state.owner = null;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
	}
	,buttonBar_dataProvider_updateItemHandler: function(event) {
		this.updateButtonForIndex(event.index);
	}
	,buttonBar_dataProvider_updateAllHandler: function(event) {
		var _g = 0;
		var _g1 = this._dataProvider.get_length();
		while(_g < _g1) {
			var i = _g++;
			this.updateButtonForIndex(i);
		}
	}
	,__customButtonVariant: null
	,get_customButtonVariant: function() {
		return this.__customButtonVariant;
	}
	,set_customButtonVariant: function(value) {
		if(!this.setStyle("customButtonVariant")) {
			return this.__customButtonVariant;
		}
		if(this.__customButtonVariant == value) {
			return this.__customButtonVariant;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_customButtonVariant);
		this.__customButtonVariant = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__customButtonVariant;
	}
	,clearStyle_customButtonVariant: function() {
		this.set_customButtonVariant(null);
		return this.get_customButtonVariant();
	}
	,__layout: null
	,get_layout: function() {
		return this.__layout;
	}
	,set_layout: function(value) {
		if(!this.setStyle("layout")) {
			return this.__layout;
		}
		if(this.__layout == value) {
			return this.__layout;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_layout);
		this.__layout = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__layout;
	}
	,clearStyle_layout: function() {
		this.set_layout(null);
		return this.get_layout();
	}
	,__backgroundSkin: null
	,get_backgroundSkin: function() {
		return this.__backgroundSkin;
	}
	,set_backgroundSkin: function(value) {
		if(!this.setStyle("backgroundSkin")) {
			return this.__backgroundSkin;
		}
		if(this.__backgroundSkin == value) {
			return this.__backgroundSkin;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_backgroundSkin);
		this.__backgroundSkin = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__backgroundSkin;
	}
	,clearStyle_backgroundSkin: function() {
		this.set_backgroundSkin(null);
		return this.get_backgroundSkin();
	}
	,__disabledBackgroundSkin: null
	,get_disabledBackgroundSkin: function() {
		return this.__disabledBackgroundSkin;
	}
	,set_disabledBackgroundSkin: function(value) {
		if(!this.setStyle("disabledBackgroundSkin")) {
			return this.__disabledBackgroundSkin;
		}
		if(this.__disabledBackgroundSkin == value) {
			return this.__disabledBackgroundSkin;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_disabledBackgroundSkin);
		this.__disabledBackgroundSkin = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__disabledBackgroundSkin;
	}
	,clearStyle_disabledBackgroundSkin: function() {
		this.set_disabledBackgroundSkin(null);
		return this.get_disabledBackgroundSkin();
	}
	,get_styleContext: function() {
		return feathers_controls_ButtonBar;
	}
	,__class__: feathers_controls_ButtonBar
	,__properties__: $extend(feathers_core_FeathersControl.prototype.__properties__,{set_disabledBackgroundSkin:"set_disabledBackgroundSkin",get_disabledBackgroundSkin:"get_disabledBackgroundSkin",set_backgroundSkin:"set_backgroundSkin",get_backgroundSkin:"get_backgroundSkin",set_layout:"set_layout",get_layout:"get_layout",set_buttonRecyclerIDFunction:"set_buttonRecyclerIDFunction",get_buttonRecyclerIDFunction:"get_buttonRecyclerIDFunction",set_forceItemStateUpdate:"set_forceItemStateUpdate",get_forceItemStateUpdate:"get_forceItemStateUpdate",set_buttonRecycler:"set_buttonRecycler",get_buttonRecycler:"get_buttonRecycler",set_customButtonVariant:"set_customButtonVariant",get_customButtonVariant:"get_customButtonVariant",set_dataProvider:"set_dataProvider",get_dataProvider:"get_dataProvider"})
});
var feathers_controls_Header = function(text) {
	if(text == null) {
		text = "";
	}
	this.__verticalAlign = feathers_layout_VerticalAlign.MIDDLE;
	this.__minGap = 0.0;
	this.__paddingLeft = 0.0;
	this.__paddingBottom = 0.0;
	this.__paddingRight = 0.0;
	this.__paddingTop = 0.0;
	this.__disabledBackgroundSkin = null;
	this.__backgroundSkin = null;
	this.__disabledTextFormat = null;
	this.__embedFonts = false;
	this.__styleSheet = null;
	this.__textFormat = null;
	this._rightView = null;
	this._ignoreRightViewResize = false;
	this._leftView = null;
	this._ignoreLeftViewResize = false;
	this._backgroundSkinMeasurements = null;
	this._currentBackgroundSkin = null;
	this._htmlText = null;
	this._updatedTextStyles = false;
	this._previousSimpleTextFormat = null;
	this._previousTextFormat = null;
	this._previousHTMLText = null;
	this._previousText = null;
	this.initializeHeaderTheme();
	feathers_core_FeathersControl.call(this);
	this.set_text(text);
};
$hxClasses["feathers.controls.Header"] = feathers_controls_Header;
feathers_controls_Header.__name__ = "feathers.controls.Header";
feathers_controls_Header.__interfaces__ = [feathers_core_ITextControl];
feathers_controls_Header.__super__ = feathers_core_FeathersControl;
feathers_controls_Header.prototype = $extend(feathers_core_FeathersControl.prototype,{
	textField: null
	,_previousText: null
	,_previousHTMLText: null
	,_previousTextFormat: null
	,_previousSimpleTextFormat: null
	,_updatedTextStyles: null
	,_textMeasuredWidth: null
	,_textMeasuredHeight: null
	,_text: null
	,get_text: function() {
		return this._text;
	}
	,set_text: function(value) {
		if(value == null) {
			if(this._text.length == 0) {
				return this._text;
			}
			value = "";
		}
		if(this._text == value) {
			return this._text;
		}
		this._text = value;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		return this._text;
	}
	,get_baseline: function() {
		if(this.textField == null) {
			return 0.0;
		}
		var hasText = this._text != null && this._text.length > 0;
		var hasHTMLText = this._htmlText != null && this._htmlText.length > 0;
		if(!hasText && !hasHTMLText) {
			this.textField.set_text("​");
			var result = this.textField.get_y() + this.textField.getLineMetrics(0).ascent;
			this.textField.set_text("");
			return result;
		}
		return this.textField.get_y() + this.textField.getLineMetrics(0).ascent;
	}
	,_htmlText: null
	,get_htmlText: function() {
		return this._htmlText;
	}
	,set_htmlText: function(value) {
		if(this._htmlText == value) {
			return this._htmlText;
		}
		this._htmlText = value;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		return this._htmlText;
	}
	,_currentBackgroundSkin: null
	,_backgroundSkinMeasurements: null
	,_ignoreLeftViewResize: null
	,_leftView: null
	,get_leftView: function() {
		return this._leftView;
	}
	,set_leftView: function(value) {
		if(this._leftView == value) {
			return this._leftView;
		}
		if(this._leftView != null) {
			this._leftView.removeEventListener("resize",$bind(this,this.header_leftView_resizeHandler));
			if(this._leftView.parent == this) {
				this.removeChild(this._leftView);
			}
		}
		this._leftView = value;
		if(this._leftView != null) {
			this.addChild(this._leftView);
			this._leftView.addEventListener("resize",$bind(this,this.header_leftView_resizeHandler),false,0,true);
		}
		this.setInvalid(feathers_core_InvalidationFlag.LAYOUT);
		return this._leftView;
	}
	,_ignoreRightViewResize: null
	,_rightView: null
	,get_rightView: function() {
		return this._rightView;
	}
	,set_rightView: function(value) {
		if(this._rightView == value) {
			return this._rightView;
		}
		if(this._rightView != null) {
			this._rightView.removeEventListener("resize",$bind(this,this.header_rightView_resizeHandler));
			if(this._rightView.parent == this) {
				this.removeChild(this._rightView);
			}
		}
		this._rightView = value;
		if(this._rightView != null) {
			this.addChild(this._rightView);
			this._rightView.addEventListener("resize",$bind(this,this.header_rightView_resizeHandler),false,0,true);
		}
		this.setInvalid(feathers_core_InvalidationFlag.LAYOUT);
		return this._rightView;
	}
	,setPadding: function(value) {
		this.set_paddingTop(value);
		this.set_paddingRight(value);
		this.set_paddingBottom(value);
		this.set_paddingLeft(value);
	}
	,dispose: function() {
		this.set_leftView(null);
		this.set_rightView(null);
		feathers_core_FeathersControl.prototype.dispose.call(this);
	}
	,initializeHeaderTheme: function() {
		feathers_themes_steel_components_SteelHeaderStyles.initialize();
	}
	,initialize: function() {
		feathers_core_FeathersControl.prototype.initialize.call(this);
		if(this.textField == null) {
			this.textField = new openfl_text_TextField();
			this.textField.set_multiline(true);
			this.textField.set_selectable(false);
			this.addChild(this.textField);
		}
	}
	,update: function() {
		var dataInvalid = this.isInvalid(feathers_core_InvalidationFlag.DATA);
		var layoutInvalid = this.isInvalid(feathers_core_InvalidationFlag.LAYOUT);
		var sizeInvalid = this.isInvalid(feathers_core_InvalidationFlag.SIZE);
		var stateInvalid = this.isInvalid(feathers_core_InvalidationFlag.STATE);
		var stylesInvalid = this.isInvalid(feathers_core_InvalidationFlag.STYLES);
		this._updatedTextStyles = false;
		if(stylesInvalid || stateInvalid) {
			this.refreshBackgroundSkin();
		}
		if(stylesInvalid || stateInvalid) {
			this.refreshTextStyles();
		}
		if(dataInvalid || stylesInvalid || stateInvalid || sizeInvalid) {
			this.refreshText(sizeInvalid);
		}
		if(this.measure()) {
			sizeInvalid = true;
		}
		if(layoutInvalid || stylesInvalid || stateInvalid || dataInvalid || sizeInvalid) {
			this.layoutContent();
		}
	}
	,measure: function() {
		var needsWidth = this.get_explicitWidth() == null;
		var needsHeight = this.get_explicitHeight() == null;
		var needsMinWidth = this.get_explicitMinWidth() == null;
		var needsMinHeight = this.get_explicitMinHeight() == null;
		var needsMaxWidth = this.get_explicitMaxWidth() == null;
		var needsMaxHeight = this.get_explicitMaxHeight() == null;
		if(!needsWidth && !needsHeight && !needsMinWidth && !needsMinHeight && !needsMaxWidth && !needsMaxHeight) {
			return false;
		}
		var oldIgnoreLeftViewResize = this._ignoreLeftViewResize;
		this._ignoreLeftViewResize = true;
		var oldIgnoreRightViewResize = this._ignoreRightViewResize;
		this._ignoreRightViewResize = true;
		if(this._currentBackgroundSkin != null) {
			feathers_utils_MeasurementsUtil.resetFluidlyWithParent(this._backgroundSkinMeasurements,this._currentBackgroundSkin,this);
		}
		var measureSkin = null;
		if(js_Boot.__implements(this._currentBackgroundSkin,feathers_core_IMeasureObject)) {
			measureSkin = this._currentBackgroundSkin;
		}
		if(js_Boot.__implements(this._currentBackgroundSkin,feathers_core_IValidating)) {
			this._currentBackgroundSkin.validateNow();
		}
		if(js_Boot.__implements(this._leftView,feathers_core_IValidating)) {
			this._leftView.validateNow();
		}
		if(js_Boot.__implements(this._rightView,feathers_core_IValidating)) {
			this._rightView.validateNow();
		}
		var newWidth = this.get_explicitWidth();
		if(needsWidth) {
			newWidth = this._textMeasuredWidth + this.get_paddingLeft() + this.get_paddingRight();
			if(this._leftView != null) {
				newWidth += this._leftView.get_width() + this.get_minGap();
			}
			if(this._rightView != null) {
				newWidth += this._rightView.get_width() + this.get_minGap();
			}
			if(this._currentBackgroundSkin != null) {
				newWidth = Math.max(this._currentBackgroundSkin.get_width(),newWidth);
			}
		}
		var newHeight = this.get_explicitHeight();
		if(needsHeight) {
			newHeight = this._textMeasuredHeight;
			if(this._leftView != null) {
				newHeight = Math.max(newHeight,this._leftView.get_height());
			}
			if(this._rightView != null) {
				newHeight = Math.max(newHeight,this._rightView.get_height());
			}
			newHeight += this.get_paddingTop() + this.get_paddingBottom();
			if(this._currentBackgroundSkin != null) {
				newHeight = Math.max(this._currentBackgroundSkin.get_height(),newHeight);
			}
		}
		var newMinWidth = this.get_explicitMinWidth();
		if(needsMinWidth) {
			newMinWidth = this._textMeasuredWidth + this.get_paddingLeft() + this.get_paddingRight();
			if(this._leftView != null) {
				newMinWidth += this._leftView.get_width() + this.get_minGap();
			}
			if(this._rightView != null) {
				newMinWidth += this._rightView.get_width() + this.get_minGap();
			}
			if(measureSkin != null) {
				newMinWidth = Math.max(measureSkin.get_minWidth(),newMinWidth);
			} else if(this._backgroundSkinMeasurements != null && this._backgroundSkinMeasurements.minWidth != null) {
				newMinWidth = Math.max(this._backgroundSkinMeasurements.minWidth,newMinWidth);
			}
		}
		var newMinHeight = this.get_explicitMinHeight();
		if(needsMinHeight) {
			newMinHeight = this._textMeasuredHeight;
			if(this._leftView != null) {
				newMinHeight = Math.max(newMinHeight,this._leftView.get_height());
			}
			if(this._rightView != null) {
				newMinHeight = Math.max(newMinHeight,this._rightView.get_height());
			}
			newMinHeight += this.get_paddingTop() + this.get_paddingBottom();
			if(measureSkin != null) {
				newMinHeight = Math.max(measureSkin.get_minHeight(),newMinHeight);
			} else if(this._backgroundSkinMeasurements != null && this._backgroundSkinMeasurements.minHeight != null) {
				newMinHeight = Math.max(this._backgroundSkinMeasurements.minHeight,newMinHeight);
			}
		}
		var newMaxWidth = this.get_explicitMaxWidth();
		if(needsMaxWidth) {
			if(measureSkin != null) {
				newMaxWidth = measureSkin.get_maxWidth();
			} else if(this._backgroundSkinMeasurements != null && this._backgroundSkinMeasurements.maxWidth != null) {
				newMaxWidth = this._backgroundSkinMeasurements.maxWidth;
			} else {
				newMaxWidth = 1.0 / 0.0;
			}
		}
		var newMaxHeight = this.get_explicitMaxHeight();
		if(needsMaxHeight) {
			if(measureSkin != null) {
				newMaxHeight = measureSkin.get_maxHeight();
			} else if(this._backgroundSkinMeasurements != null && this._backgroundSkinMeasurements.maxHeight != null) {
				newMaxHeight = this._backgroundSkinMeasurements.maxHeight;
			} else {
				newMaxHeight = 1.0 / 0.0;
			}
		}
		this._ignoreLeftViewResize = oldIgnoreLeftViewResize;
		this._ignoreRightViewResize = oldIgnoreRightViewResize;
		return this.saveMeasurements(newWidth,newHeight,newMinWidth,newMinHeight,newMaxWidth,newMaxHeight);
	}
	,refreshTextStyles: function() {
		if(this.textField.get_embedFonts() != this.get_embedFonts()) {
			this.textField.set_embedFonts(this.get_embedFonts());
			this._updatedTextStyles = true;
		}
		if(this.textField.get_styleSheet() != this.get_styleSheet()) {
			this.textField.set_styleSheet(this.get_styleSheet());
			this._updatedTextStyles = true;
		}
		var textFormat = this.getCurrentTextFormat();
		var simpleTextFormat = textFormat != null ? textFormat.toSimpleTextFormat() : null;
		if(simpleTextFormat == this._previousSimpleTextFormat) {
			return;
		}
		if(this._previousTextFormat != null) {
			this._previousTextFormat.removeEventListener("change",$bind(this,this.header_textFormat_changeHandler));
		}
		if(textFormat != null) {
			textFormat.addEventListener("change",$bind(this,this.header_textFormat_changeHandler),false,0,true);
			this.textField.set_defaultTextFormat(simpleTextFormat);
			this._updatedTextStyles = true;
		}
		this._previousTextFormat = textFormat;
		this._previousSimpleTextFormat = simpleTextFormat;
	}
	,refreshText: function(forceMeasurement) {
		var hasText = this._text != null && this._text.length > 0;
		var hasHTMLText = this._htmlText != null && this._htmlText.length > 0;
		this.textField.set_visible(hasText || hasHTMLText);
		if(this._text == this._previousText && this._htmlText == this._previousHTMLText && !this._updatedTextStyles && !forceMeasurement) {
			return;
		}
		this.textField.set_autoSize(1);
		if(hasHTMLText) {
			this.textField.set_htmlText(this._htmlText);
		} else if(hasText) {
			this.textField.set_text(this._text);
		} else {
			this.textField.set_text("​");
		}
		var textFieldWidth = null;
		if(this.get_explicitWidth() != null) {
			textFieldWidth = this.get_explicitWidth();
		} else if(this.get_explicitMaxWidth() != null) {
			textFieldWidth = this.get_explicitMaxWidth();
		}
		if(textFieldWidth != null) {
			if(textFieldWidth < 0.0) {
				textFieldWidth = 0.0;
			}
			this.textField.set_width(textFieldWidth);
		}
		this._textMeasuredWidth = this.textField.get_width();
		this._textMeasuredHeight = this.textField.get_height();
		this.textField.set_autoSize(2);
		if(!hasText && !hasHTMLText) {
			this.textField.set_text("");
		}
		this._previousText = this._text;
		this._previousHTMLText = this._htmlText;
	}
	,getCurrentTextFormat: function() {
		if(this.get_styleSheet() != null) {
			return null;
		}
		if(!this._enabled && this.get_disabledTextFormat() != null) {
			return this.get_disabledTextFormat();
		}
		return this.get_textFormat();
	}
	,refreshBackgroundSkin: function() {
		var oldSkin = this._currentBackgroundSkin;
		this._currentBackgroundSkin = this.getCurrentBackgroundSkin();
		if(this._currentBackgroundSkin == oldSkin) {
			return;
		}
		this.removeCurrentBackgroundSkin(oldSkin);
		this.addCurrentBackgroundSkin(this._currentBackgroundSkin);
	}
	,getCurrentBackgroundSkin: function() {
		if(!this._enabled && this.get_disabledBackgroundSkin() != null) {
			return this.get_disabledBackgroundSkin();
		}
		return this.get_backgroundSkin();
	}
	,addCurrentBackgroundSkin: function(skin) {
		if(skin == null) {
			this._backgroundSkinMeasurements = null;
			return;
		}
		if(js_Boot.__implements(skin,feathers_core_IUIControl)) {
			skin.initializeNow();
		}
		if(this._backgroundSkinMeasurements == null) {
			this._backgroundSkinMeasurements = new feathers_layout_Measurements(skin);
		} else {
			this._backgroundSkinMeasurements.save(skin);
		}
		if(js_Boot.__implements(skin,feathers_skins_IProgrammaticSkin)) {
			skin.set_uiContext(this);
		}
		this.addChildAt(skin,0);
	}
	,removeCurrentBackgroundSkin: function(skin) {
		if(skin == null) {
			return;
		}
		if(js_Boot.__implements(skin,feathers_skins_IProgrammaticSkin)) {
			skin.set_uiContext(null);
		}
		this._backgroundSkinMeasurements.restore(skin);
		if(skin.parent == this) {
			this.removeChild(skin);
		}
	}
	,layoutContent: function() {
		this.layoutBackgroundSkin();
		var textFieldMinX = this.get_paddingLeft();
		var textFieldMaxX = this.actualWidth - this.get_paddingRight();
		var maxContentWidth = this.actualWidth - this.get_paddingLeft() - this.get_paddingRight();
		var maxContentHeight = this.actualHeight - this.get_paddingTop() - this.get_paddingBottom();
		var textFieldMaxWidth = maxContentWidth;
		if(this._leftView != null) {
			if(js_Boot.__implements(this._leftView,feathers_core_IValidating)) {
				this._leftView.validateNow();
			}
			this._leftView.set_x(this.get_paddingLeft());
			switch(this.get_verticalAlign()._hx_index) {
			case 0:
				this._leftView.set_y(this.get_paddingTop());
				break;
			case 2:
				this._leftView.set_y(this.actualHeight - this.get_paddingBottom() - this._leftView.get_height());
				break;
			default:
				this._leftView.set_y(this.get_paddingTop() + (maxContentHeight - this._leftView.get_height()) / 2.0);
			}
			textFieldMaxWidth -= this._leftView.get_width() + this.get_minGap();
			textFieldMinX = this._leftView.get_x() + this._leftView.get_width() + this.get_minGap();
		}
		if(this._rightView != null) {
			if(js_Boot.__implements(this._rightView,feathers_core_IValidating)) {
				this._rightView.validateNow();
			}
			this._rightView.set_x(this.actualWidth - this.get_paddingRight() - this._rightView.get_width());
			switch(this.get_verticalAlign()._hx_index) {
			case 0:
				this._rightView.set_y(this.get_paddingTop());
				break;
			case 2:
				this._rightView.set_y(this.actualHeight - this.get_paddingBottom() - this._rightView.get_height());
				break;
			default:
				this._rightView.set_y(this.get_paddingTop() + (maxContentHeight - this._rightView.get_height()) / 2.0);
			}
			textFieldMaxWidth -= this._rightView.get_width() + this.get_minGap();
			textFieldMaxX = this._rightView.get_x() - this.get_minGap();
		}
		var textFieldWidth = this._textMeasuredWidth;
		if(textFieldWidth > textFieldMaxWidth) {
			textFieldWidth = textFieldMaxWidth;
		}
		if(textFieldWidth < 0.0) {
			textFieldWidth = 0.0;
		}
		this.textField.set_width(textFieldWidth);
		textFieldMaxX -= textFieldWidth;
		var textFieldHeight = this._textMeasuredHeight;
		if(textFieldHeight > maxContentHeight) {
			textFieldHeight = maxContentHeight;
		}
		if(textFieldHeight < 0.0) {
			textFieldHeight = 0.0;
		}
		this.textField.set_height(textFieldHeight);
		var textFieldX = this.get_paddingLeft() + (maxContentWidth - textFieldWidth) / 2.0;
		if(textFieldX < textFieldMinX) {
			textFieldX = textFieldMinX;
		} else if(textFieldX > textFieldMaxX) {
			textFieldX = textFieldMaxX;
		}
		this.textField.set_x(textFieldX);
		switch(this.get_verticalAlign()._hx_index) {
		case 0:
			this.textField.set_y(this.get_paddingTop());
			break;
		case 2:
			this.textField.set_y(this.actualHeight - this.get_paddingBottom() - textFieldHeight);
			break;
		default:
			this.textField.set_y(this.get_paddingTop() + (maxContentHeight - textFieldHeight) / 2.0);
		}
	}
	,layoutBackgroundSkin: function() {
		if(this._currentBackgroundSkin == null) {
			return;
		}
		this._currentBackgroundSkin.set_x(0.0);
		this._currentBackgroundSkin.set_y(0.0);
		if(this._currentBackgroundSkin.get_width() != this.actualWidth) {
			this._currentBackgroundSkin.set_width(this.actualWidth);
		}
		if(this._currentBackgroundSkin.get_height() != this.actualHeight) {
			this._currentBackgroundSkin.set_height(this.actualHeight);
		}
		if(js_Boot.__implements(this._currentBackgroundSkin,feathers_core_IValidating)) {
			this._currentBackgroundSkin.validateNow();
		}
	}
	,header_textFormat_changeHandler: function(event) {
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
	}
	,header_leftView_resizeHandler: function(event) {
		if(this._ignoreLeftViewResize) {
			return;
		}
		this.setInvalid(feathers_core_InvalidationFlag.LAYOUT);
	}
	,header_rightView_resizeHandler: function(event) {
		if(this._ignoreRightViewResize) {
			return;
		}
		this.setInvalid(feathers_core_InvalidationFlag.LAYOUT);
	}
	,__textFormat: null
	,get_textFormat: function() {
		return this.__textFormat;
	}
	,set_textFormat: function(value) {
		if(!this.setStyle("textFormat")) {
			return this.__textFormat;
		}
		if(this.__textFormat == value) {
			return this.__textFormat;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_textFormat);
		this.__textFormat = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__textFormat;
	}
	,clearStyle_textFormat: function() {
		this.set_textFormat(null);
		return this.get_textFormat();
	}
	,__styleSheet: null
	,get_styleSheet: function() {
		return this.__styleSheet;
	}
	,set_styleSheet: function(value) {
		if(!this.setStyle("styleSheet")) {
			return this.__styleSheet;
		}
		if(this.__styleSheet == value) {
			return this.__styleSheet;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_styleSheet);
		this.__styleSheet = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__styleSheet;
	}
	,clearStyle_styleSheet: function() {
		this.set_styleSheet(null);
		return this.get_styleSheet();
	}
	,__embedFonts: null
	,get_embedFonts: function() {
		return this.__embedFonts;
	}
	,set_embedFonts: function(value) {
		if(!this.setStyle("embedFonts")) {
			return this.__embedFonts;
		}
		if(this.__embedFonts == value) {
			return this.__embedFonts;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_embedFonts);
		this.__embedFonts = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__embedFonts;
	}
	,clearStyle_embedFonts: function() {
		this.set_embedFonts(false);
		return this.get_embedFonts();
	}
	,__disabledTextFormat: null
	,get_disabledTextFormat: function() {
		return this.__disabledTextFormat;
	}
	,set_disabledTextFormat: function(value) {
		if(!this.setStyle("disabledTextFormat")) {
			return this.__disabledTextFormat;
		}
		if(this.__disabledTextFormat == value) {
			return this.__disabledTextFormat;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_disabledTextFormat);
		this.__disabledTextFormat = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__disabledTextFormat;
	}
	,clearStyle_disabledTextFormat: function() {
		this.set_disabledTextFormat(null);
		return this.get_disabledTextFormat();
	}
	,__backgroundSkin: null
	,get_backgroundSkin: function() {
		return this.__backgroundSkin;
	}
	,set_backgroundSkin: function(value) {
		if(!this.setStyle("backgroundSkin")) {
			return this.__backgroundSkin;
		}
		if(this.__backgroundSkin == value) {
			return this.__backgroundSkin;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_backgroundSkin);
		this.__backgroundSkin = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__backgroundSkin;
	}
	,clearStyle_backgroundSkin: function() {
		this.set_backgroundSkin(null);
		return this.get_backgroundSkin();
	}
	,__disabledBackgroundSkin: null
	,get_disabledBackgroundSkin: function() {
		return this.__disabledBackgroundSkin;
	}
	,set_disabledBackgroundSkin: function(value) {
		if(!this.setStyle("disabledBackgroundSkin")) {
			return this.__disabledBackgroundSkin;
		}
		if(this.__disabledBackgroundSkin == value) {
			return this.__disabledBackgroundSkin;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_disabledBackgroundSkin);
		this.__disabledBackgroundSkin = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__disabledBackgroundSkin;
	}
	,clearStyle_disabledBackgroundSkin: function() {
		this.set_disabledBackgroundSkin(null);
		return this.get_disabledBackgroundSkin();
	}
	,__paddingTop: null
	,get_paddingTop: function() {
		return this.__paddingTop;
	}
	,set_paddingTop: function(value) {
		if(!this.setStyle("paddingTop")) {
			return this.__paddingTop;
		}
		if(this.__paddingTop == value) {
			return this.__paddingTop;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_paddingTop);
		this.__paddingTop = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__paddingTop;
	}
	,clearStyle_paddingTop: function() {
		this.set_paddingTop(0.0);
		return this.get_paddingTop();
	}
	,__paddingRight: null
	,get_paddingRight: function() {
		return this.__paddingRight;
	}
	,set_paddingRight: function(value) {
		if(!this.setStyle("paddingRight")) {
			return this.__paddingRight;
		}
		if(this.__paddingRight == value) {
			return this.__paddingRight;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_paddingRight);
		this.__paddingRight = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__paddingRight;
	}
	,clearStyle_paddingRight: function() {
		this.set_paddingRight(0.0);
		return this.get_paddingRight();
	}
	,__paddingBottom: null
	,get_paddingBottom: function() {
		return this.__paddingBottom;
	}
	,set_paddingBottom: function(value) {
		if(!this.setStyle("paddingBottom")) {
			return this.__paddingBottom;
		}
		if(this.__paddingBottom == value) {
			return this.__paddingBottom;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_paddingBottom);
		this.__paddingBottom = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__paddingBottom;
	}
	,clearStyle_paddingBottom: function() {
		this.set_paddingBottom(0.0);
		return this.get_paddingBottom();
	}
	,__paddingLeft: null
	,get_paddingLeft: function() {
		return this.__paddingLeft;
	}
	,set_paddingLeft: function(value) {
		if(!this.setStyle("paddingLeft")) {
			return this.__paddingLeft;
		}
		if(this.__paddingLeft == value) {
			return this.__paddingLeft;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_paddingLeft);
		this.__paddingLeft = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__paddingLeft;
	}
	,clearStyle_paddingLeft: function() {
		this.set_paddingLeft(0.0);
		return this.get_paddingLeft();
	}
	,__minGap: null
	,get_minGap: function() {
		return this.__minGap;
	}
	,set_minGap: function(value) {
		if(!this.setStyle("minGap")) {
			return this.__minGap;
		}
		if(this.__minGap == value) {
			return this.__minGap;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_minGap);
		this.__minGap = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__minGap;
	}
	,clearStyle_minGap: function() {
		this.set_minGap(0.0);
		return this.get_minGap();
	}
	,__verticalAlign: null
	,get_verticalAlign: function() {
		return this.__verticalAlign;
	}
	,set_verticalAlign: function(value) {
		if(!this.setStyle("verticalAlign")) {
			return this.__verticalAlign;
		}
		if(this.__verticalAlign == value) {
			return this.__verticalAlign;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_verticalAlign);
		this.__verticalAlign = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__verticalAlign;
	}
	,clearStyle_verticalAlign: function() {
		this.set_verticalAlign(feathers_layout_VerticalAlign.MIDDLE);
		return this.get_verticalAlign();
	}
	,__class__: feathers_controls_Header
	,__properties__: $extend(feathers_core_FeathersControl.prototype.__properties__,{set_rightView:"set_rightView",get_rightView:"get_rightView",set_leftView:"set_leftView",get_leftView:"get_leftView",set_verticalAlign:"set_verticalAlign",get_verticalAlign:"get_verticalAlign",set_minGap:"set_minGap",get_minGap:"get_minGap",set_paddingLeft:"set_paddingLeft",get_paddingLeft:"get_paddingLeft",set_paddingBottom:"set_paddingBottom",get_paddingBottom:"get_paddingBottom",set_paddingRight:"set_paddingRight",get_paddingRight:"get_paddingRight",set_paddingTop:"set_paddingTop",get_paddingTop:"get_paddingTop",set_disabledBackgroundSkin:"set_disabledBackgroundSkin",get_disabledBackgroundSkin:"get_disabledBackgroundSkin",set_backgroundSkin:"set_backgroundSkin",get_backgroundSkin:"get_backgroundSkin",set_disabledTextFormat:"set_disabledTextFormat",get_disabledTextFormat:"get_disabledTextFormat",set_embedFonts:"set_embedFonts",get_embedFonts:"get_embedFonts",set_styleSheet:"set_styleSheet",get_styleSheet:"get_styleSheet",set_textFormat:"set_textFormat",get_textFormat:"get_textFormat",set_htmlText:"set_htmlText",get_htmlText:"get_htmlText",get_baseline:"get_baseline",set_text:"set_text",get_text:"get_text"})
});
var feathers_controls_Alert = function(text) {
	if(text == null) {
		text = "";
	}
	this.__customMessageLabelVariant = null;
	this.__customHeaderVariant = null;
	this.__customButtonBarVariant = null;
	this.__icon = null;
	this._previousCustomMessageLabelVariant = null;
	this._previousCustomHeaderVariant = null;
	this._previousCustomButtonBarVariant = null;
	this._ignoreIconResizes = false;
	this._currentIcon = null;
	this._iconMeasurements = null;
	this._buttonsDataProvider = null;
	this._titleText = "";
	this._htmlText = null;
	this.initializeAlertTheme();
	feathers_controls_Panel.call(this);
	this.set_text(text);
};
$hxClasses["feathers.controls.Alert"] = feathers_controls_Alert;
feathers_controls_Alert.__name__ = "feathers.controls.Alert";
feathers_controls_Alert.show = function(text,titleText,buttonsText,callback,alertFactory,popUpAdapter) {
	var alert = alertFactory != null ? alertFactory() : new feathers_controls_Alert();
	alert.set_text(text);
	alert.set_titleText(titleText);
	var buttonsData;
	if(buttonsText != null) {
		var result = new Array(buttonsText.length);
		var _g = 0;
		var _g1 = buttonsText.length;
		while(_g < _g1) {
			var i = _g++;
			result[i] = new feathers_controls__$Alert_StringWrapper(buttonsText[i]);
		}
		buttonsData = result;
	} else {
		buttonsData = [];
	}
	alert.set_buttonsDataProvider(new feathers_data_ArrayCollection(buttonsData));
	if(callback != null) {
		alert.addEventListener("itemTrigger",function(event) {
			callback(event.state);
		});
	}
	return feathers_controls_Alert.showAlert(alert,popUpAdapter);
};
feathers_controls_Alert.showAlert = function(alert,popUpAdapter) {
	if(popUpAdapter != null) {
		popUpAdapter.open(alert,openfl_Lib.get_current());
	} else {
		feathers_core_PopUpManager.addPopUp(alert,openfl_Lib.get_current(),true,true);
	}
	return alert;
};
feathers_controls_Alert.__super__ = feathers_controls_Panel;
feathers_controls_Alert.prototype = $extend(feathers_controls_Panel.prototype,{
	messageLabel: null
	,_text: null
	,get_text: function() {
		return this._text;
	}
	,set_text: function(value) {
		if(value == null) {
			if(this._text.length == 0) {
				return this._text;
			}
			value = "";
		}
		if(this._text == value) {
			return this._text;
		}
		this._text = value;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		return this._text;
	}
	,_htmlText: null
	,get_htmlText: function() {
		return this._htmlText;
	}
	,set_htmlText: function(value) {
		if(this._htmlText == value) {
			return this._htmlText;
		}
		this._htmlText = value;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		return this._htmlText;
	}
	,alertHeader: null
	,_titleText: null
	,get_titleText: function() {
		return this._titleText;
	}
	,set_titleText: function(value) {
		if(value == null) {
			if(this._titleText.length == 0) {
				return this._titleText;
			}
			value = "";
		}
		if(this._titleText == value) {
			return this._titleText;
		}
		this._titleText = value;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		return this._titleText;
	}
	,_oldMessageLabelFactory: null
	,_messageLabelFactory: null
	,get_messageLabelFactory: function() {
		return this._messageLabelFactory;
	}
	,set_messageLabelFactory: function(value) {
		if(this._messageLabelFactory == value) {
			return this._messageLabelFactory;
		}
		this._messageLabelFactory = value;
		this.setInvalid(feathers_controls_Alert.INVALIDATION_FLAG_MESSAGE_LABEL_FACTORY);
		return this._messageLabelFactory;
	}
	,_oldHeaderFactory: null
	,_headerFactory: null
	,get_headerFactory: function() {
		return this._headerFactory;
	}
	,set_headerFactory: function(value) {
		if(this._headerFactory == value) {
			return this._headerFactory;
		}
		this._headerFactory = value;
		this.setInvalid(feathers_controls_Alert.INVALIDATION_FLAG_HEADER_FACTORY);
		return this._headerFactory;
	}
	,_oldButtonBarFactory: null
	,_buttonBarFactory: null
	,get_buttonBarFactory: function() {
		return this._buttonBarFactory;
	}
	,set_buttonBarFactory: function(value) {
		if(this._buttonBarFactory == value) {
			return this._buttonBarFactory;
		}
		this._buttonBarFactory = value;
		this.setInvalid(feathers_controls_Alert.INVALIDATION_FLAG_BUTTON_BAR_FACTORY);
		return this._buttonBarFactory;
	}
	,buttonBar: null
	,_buttonsDataProvider: null
	,get_buttonsDataProvider: function() {
		return this._buttonsDataProvider;
	}
	,set_buttonsDataProvider: function(value) {
		if(this._buttonsDataProvider == value) {
			return this._buttonsDataProvider;
		}
		this._buttonsDataProvider = value;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		return this._buttonsDataProvider;
	}
	,_iconMeasurements: null
	,_currentIcon: null
	,_ignoreIconResizes: null
	,_previousCustomButtonBarVariant: null
	,_previousCustomHeaderVariant: null
	,_previousCustomMessageLabelVariant: null
	,set_header: function(value) {
		throw new openfl_errors_IllegalOperationError("Alert header must be created with headerFactory");
	}
	,_set_header: function(value) {
		return feathers_controls_Panel.prototype.set_header.call(this,value);
	}
	,set_footer: function(value) {
		throw new openfl_errors_IllegalOperationError("Alert footer must be created with buttonBarFactory");
	}
	,_set_footer: function(value) {
		return feathers_controls_Panel.prototype.set_footer.call(this,value);
	}
	,dispose: function() {
		this.destroyButtonBar();
		this.destroyHeader();
		this.destroyMessageLabel();
		feathers_controls_Panel.prototype.dispose.call(this);
	}
	,initializeAlertTheme: function() {
		feathers_themes_steel_components_SteelAlertStyles.initialize();
	}
	,update: function() {
		var dataInvalid = this.isInvalid(feathers_core_InvalidationFlag.DATA);
		var stateInvalid = this.isInvalid(feathers_core_InvalidationFlag.STATE);
		var stylesInvalid = this.isInvalid(feathers_core_InvalidationFlag.STYLES);
		if(this._previousCustomButtonBarVariant != this.get_customButtonBarVariant()) {
			this.setInvalidationFlag(feathers_controls_Alert.INVALIDATION_FLAG_BUTTON_BAR_FACTORY);
		}
		var buttonBarInvalid = this.isInvalid(feathers_controls_Alert.INVALIDATION_FLAG_BUTTON_BAR_FACTORY);
		if(this._previousCustomHeaderVariant != this.get_customHeaderVariant()) {
			this.setInvalidationFlag(feathers_controls_Alert.INVALIDATION_FLAG_HEADER_FACTORY);
		}
		var headerInvalid = this.isInvalid(feathers_controls_Alert.INVALIDATION_FLAG_HEADER_FACTORY);
		if(this._previousCustomMessageLabelVariant != this.get_customMessageLabelVariant()) {
			this.setInvalidationFlag(feathers_controls_Alert.INVALIDATION_FLAG_MESSAGE_LABEL_FACTORY);
		}
		var messageLabelInvalid = this.isInvalid(feathers_controls_Alert.INVALIDATION_FLAG_MESSAGE_LABEL_FACTORY);
		if(headerInvalid) {
			this.createHeader();
		}
		if(buttonBarInvalid) {
			this.createButtonBar();
		}
		if(messageLabelInvalid) {
			this.createMessageLabel();
		}
		if(stylesInvalid || stateInvalid) {
			this.refreshIcon();
		}
		if(dataInvalid || stylesInvalid || stateInvalid || messageLabelInvalid) {
			this.refreshText();
		}
		if(dataInvalid || stylesInvalid || stateInvalid || headerInvalid) {
			this.refreshTitleText();
		}
		if(dataInvalid || buttonBarInvalid) {
			this.refreshButtons();
		}
		feathers_controls_Panel.prototype.update.call(this);
		this._previousCustomButtonBarVariant = this.get_customButtonBarVariant();
		this._previousCustomHeaderVariant = this.get_customHeaderVariant();
		this._previousCustomMessageLabelVariant = this.get_customMessageLabelVariant();
	}
	,createButtonBar: function() {
		var _gthis = this;
		this.destroyButtonBar();
		var factory = this._buttonBarFactory != null ? this._buttonBarFactory : feathers_controls_Alert.defaultButtonBarFactory;
		this._oldButtonBarFactory = factory;
		this.buttonBar = factory.create();
		if(this.buttonBar.get_variant() == null) {
			this.buttonBar.set_variant(this.get_customButtonBarVariant() != null ? this.get_customButtonBarVariant() : feathers_controls_Alert.CHILD_VARIANT_BUTTON_BAR);
		}
		this.buttonBar.addEventListener("itemTrigger",$bind(this,this.alert_buttonBar_itemTriggerHandler));
		this.runWithInvalidationFlagsOnly(function() {
			_gthis._set_footer(_gthis.buttonBar);
		});
	}
	,destroyButtonBar: function() {
		var _gthis = this;
		if(this.buttonBar == null) {
			return;
		}
		this.buttonBar.removeEventListener("itemTrigger",$bind(this,this.alert_buttonBar_itemTriggerHandler));
		if(this._oldButtonBarFactory.destroy != null) {
			this._oldButtonBarFactory.destroy(this.buttonBar);
		}
		this._oldButtonBarFactory = null;
		this.buttonBar = null;
		this.runWithInvalidationFlagsOnly(function() {
			_gthis._set_footer(null);
		});
	}
	,createHeader: function() {
		var _gthis = this;
		this.destroyHeader();
		var factory = this._headerFactory != null ? this._headerFactory : feathers_controls_Alert.defaultHeaderFactory;
		this._oldHeaderFactory = factory;
		this.alertHeader = factory.create();
		if(this.alertHeader.get_variant() == null) {
			this.alertHeader.set_variant(this.get_customHeaderVariant() != null ? this.get_customHeaderVariant() : feathers_controls_Alert.CHILD_VARIANT_HEADER);
		}
		this.runWithInvalidationFlagsOnly(function() {
			_gthis._set_header(_gthis.alertHeader);
		});
	}
	,destroyHeader: function() {
		var _gthis = this;
		if(this.alertHeader == null) {
			return;
		}
		if(this._oldHeaderFactory.destroy != null) {
			this._oldHeaderFactory.destroy(this.alertHeader);
		}
		this._oldHeaderFactory = null;
		this.alertHeader = null;
		this.runWithInvalidationFlagsOnly(function() {
			_gthis._set_header(null);
		});
	}
	,createMessageLabel: function() {
		this.destroyMessageLabel();
		var factory = this._messageLabelFactory != null ? this._messageLabelFactory : feathers_controls_Alert.defaultMessageLabelFactory;
		this._oldMessageLabelFactory = factory;
		this.messageLabel = factory.create();
		if(this.messageLabel.get_variant() == null) {
			this.messageLabel.set_variant(this.get_customMessageLabelVariant() != null ? this.get_customMessageLabelVariant() : feathers_controls_Alert.CHILD_VARIANT_MESSAGE_LABEL);
		}
		this.addChild(this.messageLabel);
	}
	,destroyMessageLabel: function() {
		if(this.messageLabel == null) {
			return;
		}
		this.removeChild(this.messageLabel);
		if(this._oldMessageLabelFactory.destroy != null) {
			this._oldMessageLabelFactory.destroy(this.messageLabel);
		}
		this._oldMessageLabelFactory = null;
		this.messageLabel = null;
	}
	,refreshButtons: function() {
		this.buttonBar.set_dataProvider(this._buttonsDataProvider);
	}
	,refreshText: function() {
		this.messageLabel.set_text(this._text);
		this.messageLabel.set_htmlText(this._htmlText);
	}
	,refreshTitleText: function() {
		this.alertHeader.set_text(this._titleText);
	}
	,refreshIcon: function() {
		var oldIcon = this._currentIcon;
		this._currentIcon = this.getCurrentIcon();
		if(this._currentIcon == oldIcon) {
			return;
		}
		this.removeCurrentIcon(oldIcon);
		if(this._currentIcon == null) {
			this._iconMeasurements = null;
			return;
		}
		if(js_Boot.__implements(this._currentIcon,feathers_core_IUIControl)) {
			this._currentIcon.initializeNow();
		}
		if(this._iconMeasurements == null) {
			this._iconMeasurements = new feathers_layout_Measurements(this._currentIcon);
		} else {
			this._iconMeasurements.save(this._currentIcon);
		}
		if(js_Boot.__implements(this._currentIcon,feathers_skins_IProgrammaticSkin)) {
			this._currentIcon.set_uiContext(this);
		}
		var index = this.getChildIndex(this.messageLabel);
		this.addChildAt(this._currentIcon,index);
	}
	,getCurrentIcon: function() {
		return this.get_icon();
	}
	,removeCurrentIcon: function(icon) {
		if(icon == null) {
			return;
		}
		if(js_Boot.__implements(icon,feathers_skins_IProgrammaticSkin)) {
			icon.set_uiContext(null);
		}
		this._iconMeasurements.restore(icon);
		if(icon.parent == this) {
			this.removeChild(icon);
		}
	}
	,alert_buttonBar_itemTriggerHandler: function(event) {
		this.parent.removeChild(this);
		this.dispatchEvent(event);
	}
	,get_styleContext: function() {
		return feathers_controls_Alert;
	}
	,__icon: null
	,get_icon: function() {
		return this.__icon;
	}
	,set_icon: function(value) {
		if(!this.setStyle("icon")) {
			return this.__icon;
		}
		if(this.__icon == value) {
			return this.__icon;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_icon);
		this.__icon = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__icon;
	}
	,clearStyle_icon: function() {
		this.set_icon(null);
		return this.get_icon();
	}
	,__customButtonBarVariant: null
	,get_customButtonBarVariant: function() {
		return this.__customButtonBarVariant;
	}
	,set_customButtonBarVariant: function(value) {
		if(!this.setStyle("customButtonBarVariant")) {
			return this.__customButtonBarVariant;
		}
		if(this.__customButtonBarVariant == value) {
			return this.__customButtonBarVariant;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_customButtonBarVariant);
		this.__customButtonBarVariant = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__customButtonBarVariant;
	}
	,clearStyle_customButtonBarVariant: function() {
		this.set_customButtonBarVariant(null);
		return this.get_customButtonBarVariant();
	}
	,__customHeaderVariant: null
	,get_customHeaderVariant: function() {
		return this.__customHeaderVariant;
	}
	,set_customHeaderVariant: function(value) {
		if(!this.setStyle("customHeaderVariant")) {
			return this.__customHeaderVariant;
		}
		if(this.__customHeaderVariant == value) {
			return this.__customHeaderVariant;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_customHeaderVariant);
		this.__customHeaderVariant = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__customHeaderVariant;
	}
	,clearStyle_customHeaderVariant: function() {
		this.set_customHeaderVariant(null);
		return this.get_customHeaderVariant();
	}
	,__customMessageLabelVariant: null
	,get_customMessageLabelVariant: function() {
		return this.__customMessageLabelVariant;
	}
	,set_customMessageLabelVariant: function(value) {
		if(!this.setStyle("customMessageLabelVariant")) {
			return this.__customMessageLabelVariant;
		}
		if(this.__customMessageLabelVariant == value) {
			return this.__customMessageLabelVariant;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_customMessageLabelVariant);
		this.__customMessageLabelVariant = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__customMessageLabelVariant;
	}
	,clearStyle_customMessageLabelVariant: function() {
		this.set_customMessageLabelVariant(null);
		return this.get_customMessageLabelVariant();
	}
	,__class__: feathers_controls_Alert
	,__properties__: $extend(feathers_controls_Panel.prototype.__properties__,{set_customMessageLabelVariant:"set_customMessageLabelVariant",get_customMessageLabelVariant:"get_customMessageLabelVariant",set_customHeaderVariant:"set_customHeaderVariant",get_customHeaderVariant:"get_customHeaderVariant",set_customButtonBarVariant:"set_customButtonBarVariant",get_customButtonBarVariant:"get_customButtonBarVariant",set_icon:"set_icon",get_icon:"get_icon",set_buttonsDataProvider:"set_buttonsDataProvider",get_buttonsDataProvider:"get_buttonsDataProvider",set_buttonBarFactory:"set_buttonBarFactory",get_buttonBarFactory:"get_buttonBarFactory",set_headerFactory:"set_headerFactory",get_headerFactory:"get_headerFactory",set_messageLabelFactory:"set_messageLabelFactory",get_messageLabelFactory:"get_messageLabelFactory",set_titleText:"set_titleText",get_titleText:"get_titleText",set_htmlText:"set_htmlText",get_htmlText:"get_htmlText",set_text:"set_text",get_text:"get_text"})
});
var feathers_controls__$Alert_StringWrapper = function(text) {
	this._text = text;
};
$hxClasses["feathers.controls._Alert.StringWrapper"] = feathers_controls__$Alert_StringWrapper;
feathers_controls__$Alert_StringWrapper.__name__ = "feathers.controls._Alert.StringWrapper";
feathers_controls__$Alert_StringWrapper.prototype = {
	_text: null
	,toString: function() {
		return this._text;
	}
	,__class__: feathers_controls__$Alert_StringWrapper
};
var feathers_controls_AssetLoader = function(source,completeListener) {
	this._scaleMode = 3;
	this._scaleModeMask = null;
	this._sourceScale = 1.0;
	this._contentMeasurements = new feathers_layout_Measurements();
	feathers_core_FeathersControl.call(this);
	this.set_source(source);
	if(completeListener != null) {
		this.addEventListener("complete",completeListener);
	}
};
$hxClasses["feathers.controls.AssetLoader"] = feathers_controls_AssetLoader;
feathers_controls_AssetLoader.__name__ = "feathers.controls.AssetLoader";
feathers_controls_AssetLoader.__super__ = feathers_core_FeathersControl;
feathers_controls_AssetLoader.prototype = $extend(feathers_core_FeathersControl.prototype,{
	content: null
	,loader: null
	,_contentMeasurements: null
	,_pendingFuture: null
	,_sourceScale: null
	,get_sourceScale: function() {
		return this._sourceScale;
	}
	,set_sourceScale: function(value) {
		if(this._sourceScale == value) {
			return this._sourceScale;
		}
		this._sourceScale = value;
		this.setInvalid(feathers_core_InvalidationFlag.SIZE);
		return this._sourceScale;
	}
	,_source: null
	,get_source: function() {
		return this._source;
	}
	,set_source: function(value) {
		var _gthis = this;
		if(this._source == value) {
			return this._source;
		}
		if(this.loader != null) {
			this.loader.unloadAndStop();
		}
		if(this.content != null) {
			this.removeChild(this.content);
			this.content = null;
		}
		this._source = value;
		if(this._source == null) {
			this._pendingFuture = null;
			this.cleanupLoader();
		} else if(openfl_utils_Assets.exists(this._source,"IMAGE")) {
			this.cleanupLoader();
			if(openfl_utils_Assets.isLocal(this._source,"IMAGE")) {
				this._pendingFuture = null;
				var bitmapData = openfl_utils_Assets.getBitmapData(this._source);
				var bitmap = this.createBitmap(bitmapData);
				this._contentMeasurements.save(bitmap);
				this.addChild(bitmap);
				this.content = bitmap;
			} else {
				var future = openfl_utils_Assets.loadBitmapData(this._source);
				future.onProgress(function(progress,total) {
					_gthis.dispatchEvent(new openfl_events_ProgressEvent("progress",false,false,progress,total));
				}).onComplete(function(bitmapData) {
					if(future != _gthis._pendingFuture) {
						return;
					}
					var bitmap = _gthis.createBitmap(bitmapData);
					_gthis._contentMeasurements.save(bitmap);
					_gthis.addChild(bitmap);
					_gthis.content = bitmap;
					_gthis.setInvalid(feathers_core_InvalidationFlag.DATA);
					_gthis.dispatchEvent(new openfl_events_Event("complete"));
				}).onError(function(event) {
					_gthis.dispatchEvent(new openfl_events_IOErrorEvent("ioError"));
				});
				this._pendingFuture = future;
			}
		} else if(openfl_utils_Assets.exists(this._source,"MOVIE_CLIP")) {
			this.cleanupLoader();
			if(openfl_utils_Assets.isLocal(this._source,"MOVIE_CLIP")) {
				this._pendingFuture = null;
				var movieClip = openfl_utils_Assets.getMovieClip(this._source);
				this._contentMeasurements.save(movieClip);
				this.addChild(movieClip);
				this.content = movieClip;
			} else {
				var future1 = openfl_utils_Assets.loadMovieClip(this._source);
				future1.onProgress(function(progress,total) {
					_gthis.dispatchEvent(new openfl_events_ProgressEvent("progress",false,false,progress,total));
				}).onComplete(function(movieClip) {
					if(future1 != _gthis._pendingFuture) {
						return;
					}
					_gthis._contentMeasurements.save(movieClip);
					_gthis.addChild(movieClip);
					_gthis.content = movieClip;
					_gthis.setInvalid(feathers_core_InvalidationFlag.DATA);
					_gthis.dispatchEvent(new openfl_events_Event("complete"));
				}).onError(function(event) {
					_gthis.dispatchEvent(new openfl_events_IOErrorEvent("ioError"));
				});
				this._pendingFuture = future1;
			}
		} else {
			this._pendingFuture = null;
			if(this.loader == null) {
				this.loader = new openfl_display_Loader();
				this.loader.contentLoaderInfo.addEventListener("complete",$bind(this,this.loader_contentLoaderInfo_completeHandler));
				this.loader.contentLoaderInfo.addEventListener("progress",$bind(this,this.loader_contentLoaderInfo_progressHandler));
				this.loader.contentLoaderInfo.addEventListener("ioError",$bind(this,this.loader_contentLoaderInfo_ioErrorHandler));
				this.loader.contentLoaderInfo.addEventListener("securityError",$bind(this,this.loader_contentLoaderInfo_securityErrorHandler));
			}
			try {
				this.loader.load(new openfl_net_URLRequest(this._source));
			} catch( _g ) {
				haxe_NativeStackTrace.lastError = _g;
				var e = haxe_Exception.caught(_g).unwrap();
				if(((e) instanceof openfl_errors_SecurityError)) {
					var securityError = e;
					this.dispatchEvent(new openfl_events_SecurityErrorEvent("securityError",false,false,securityError.get_message(),securityError.errorID));
				}
			}
		}
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		return this._source;
	}
	,get_originalSourceWidth: function() {
		if(this._contentMeasurements == null) {
			return null;
		}
		return this._contentMeasurements.width;
	}
	,get_originalSourceHeight: function() {
		if(this._contentMeasurements == null) {
			return null;
		}
		return this._contentMeasurements.height;
	}
	,_scaleModeMask: null
	,_scaleMode: null
	,get_scaleMode: function() {
		return this._scaleMode;
	}
	,set_scaleMode: function(value) {
		if(this._scaleMode == value) {
			return this._scaleMode;
		}
		this._scaleMode = value;
		this.setInvalid(feathers_core_InvalidationFlag.LAYOUT);
		return this._scaleMode;
	}
	,dispose: function() {
		this.set_source(null);
		feathers_core_FeathersControl.prototype.dispose.call(this);
	}
	,update: function() {
		var dataInvalid = this.isInvalid(feathers_core_InvalidationFlag.DATA);
		var layoutInvalid = this.isInvalid(feathers_core_InvalidationFlag.LAYOUT);
		this.measure();
		this.layoutChildren();
	}
	,measure: function() {
		var needsWidth = this.get_explicitWidth() == null;
		var needsHeight = this.get_explicitHeight() == null;
		var needsMinWidth = this.get_explicitMinWidth() == null;
		var needsMinHeight = this.get_explicitMinHeight() == null;
		var needsMaxWidth = this.get_explicitMaxWidth() == null;
		var needsMaxHeight = this.get_explicitMaxHeight() == null;
		if(!needsWidth && !needsHeight && !needsMinWidth && !needsMinHeight && !needsMaxWidth && !needsMaxHeight) {
			return false;
		}
		var contentWidth = this._contentMeasurements.width;
		var contentHeight = this._contentMeasurements.height;
		if(contentWidth != null && this._sourceScale != 1.0) {
			contentWidth *= this._sourceScale;
		}
		if(contentHeight != null && this._sourceScale != 1.0) {
			contentHeight *= this._sourceScale;
		}
		var widthScale = 1.0;
		var heightScale = 1.0;
		if(this.content != null && this._scaleMode != 2) {
			if(!needsWidth) {
				widthScale = this.get_explicitWidth() / contentWidth;
			} else if(this.get_explicitMaxWidth() != null && this.get_explicitMaxWidth() < contentWidth) {
				widthScale = this.get_explicitMaxWidth() / contentWidth;
			} else if(this.get_explicitMinWidth() != null && this.get_explicitMinWidth() > contentWidth) {
				widthScale = this.get_explicitMinWidth() / contentWidth;
			}
			if(!needsHeight) {
				heightScale = this.get_explicitHeight() / contentHeight;
			} else if(this.get_explicitMaxHeight() != null && this.get_explicitMaxHeight() < contentHeight) {
				heightScale = this.get_explicitMaxHeight() / contentHeight;
			} else if(this.get_explicitMinHeight() != null && this.get_explicitMinHeight() > contentHeight) {
				heightScale = this.get_explicitMinHeight() / contentHeight;
			}
		}
		var newWidth = this.get_explicitWidth();
		if(needsWidth) {
			if(this.content != null) {
				newWidth = contentWidth * heightScale;
			} else {
				newWidth = 0.0;
			}
		}
		var newHeight = this.get_explicitHeight();
		if(needsHeight) {
			if(this.content != null) {
				newHeight = contentHeight * widthScale;
			} else {
				newHeight = 0.0;
			}
		}
		var newMinWidth = this.get_explicitMinWidth();
		if(needsMinWidth) {
			if(this.content != null) {
				newMinWidth = contentWidth * heightScale;
			} else {
				newMinWidth = 0.0;
			}
		}
		var newMinHeight = this.get_explicitMinHeight();
		if(needsMinHeight) {
			if(this.content != null) {
				newMinHeight = contentHeight * widthScale;
			} else {
				newMinHeight = 0.0;
			}
		}
		var newMaxWidth = this.get_explicitMaxWidth();
		if(needsMaxWidth) {
			if(this.content != null) {
				newMaxWidth = contentWidth * heightScale;
			} else {
				newMaxWidth = 1.0 / 0.0;
			}
		}
		var newMaxHeight = this.get_explicitMaxHeight();
		if(needsMaxHeight) {
			if(this.content != null) {
				newMaxHeight = contentHeight * widthScale;
			} else {
				newMaxHeight = 1.0 / 0.0;
			}
		}
		return this.saveMeasurements(newWidth,newHeight,newMinWidth,newMinHeight,newMaxWidth,newMaxHeight);
	}
	,layoutChildren: function() {
		if(this.content == null) {
			return;
		}
		var needsMask = false;
		switch(this._scaleMode) {
		case 0:
			this.content.set_x(0.0);
			this.content.set_y(0.0);
			this.content.set_width(this.actualWidth);
			this.content.set_height(this.actualHeight);
			break;
		case 1:
			var original = new openfl_geom_Rectangle(0.0,0.0,this._contentMeasurements.width,this._contentMeasurements.height);
			var into = new openfl_geom_Rectangle(0.0,0.0,this.actualWidth,this.actualHeight);
			var scaled = feathers_utils_ScaleUtil.fillRectangle(original,into,into);
			this.content.set_x(scaled.x);
			this.content.set_y(scaled.y);
			this.content.set_width(scaled.width);
			this.content.set_height(scaled.height);
			needsMask = this.content.get_width() > this.actualWidth || this.content.get_height() > this.actualHeight;
			break;
		case 2:
			this.content.set_x(0.0);
			this.content.set_y(0.0);
			this._contentMeasurements.restore(this.content);
			if(js_Boot.__implements(this.content,feathers_core_IValidating)) {
				this.content.validateNow();
			}
			needsMask = this.content.get_width() > this.actualWidth || this.content.get_height() > this.actualHeight;
			break;
		default:
			var original = new openfl_geom_Rectangle(0.0,0.0,this._contentMeasurements.width,this._contentMeasurements.height);
			var into = new openfl_geom_Rectangle(0.0,0.0,this.actualWidth,this.actualHeight);
			feathers_utils_ScaleUtil.fitRectangle(original,into,into);
			this.content.set_x(into.x);
			this.content.set_y(into.y);
			this.content.set_width(into.width);
			this.content.set_height(into.height);
		}
		if(needsMask) {
			if(this._scaleModeMask == null) {
				this._scaleModeMask = new feathers_skins_RectangleSkin(feathers_graphics_FillStyle.SolidColor(16711935));
				this.addChild(this._scaleModeMask);
			}
			this._scaleModeMask.set_width(this.actualWidth);
			this._scaleModeMask.set_height(this.actualHeight);
			this.content.set_mask(this._scaleModeMask);
		} else {
			if(this._scaleModeMask != null) {
				this.removeChild(this._scaleModeMask);
				this._scaleModeMask = null;
			}
			this.content.set_mask(null);
		}
	}
	,createBitmap: function(bitmapData) {
		return new openfl_display_Bitmap(bitmapData);
	}
	,cleanupLoader: function() {
		if(this.loader == null) {
			return;
		}
		this.loader.contentLoaderInfo.removeEventListener("complete",$bind(this,this.loader_contentLoaderInfo_completeHandler));
		this.loader.contentLoaderInfo.removeEventListener("progress",$bind(this,this.loader_contentLoaderInfo_progressHandler));
		this.loader.contentLoaderInfo.removeEventListener("ioError",$bind(this,this.loader_contentLoaderInfo_ioErrorHandler));
		this.loader.contentLoaderInfo.removeEventListener("securityError",$bind(this,this.loader_contentLoaderInfo_securityErrorHandler));
		this.loader = null;
	}
	,loader_contentLoaderInfo_progressHandler: function(event) {
		this.dispatchEvent(event);
	}
	,loader_contentLoaderInfo_ioErrorHandler: function(event) {
		this.dispatchEvent(event);
	}
	,loader_contentLoaderInfo_securityErrorHandler: function(event) {
		this.dispatchEvent(event);
	}
	,loader_contentLoaderInfo_completeHandler: function(event) {
		this.addChild(this.loader);
		this.content = this.loader;
		this._contentMeasurements.save(this.content);
		this.setInvalid(feathers_core_InvalidationFlag.LAYOUT);
		this.dispatchEvent(event);
	}
	,get_styleContext: function() {
		return feathers_controls_AssetLoader;
	}
	,__class__: feathers_controls_AssetLoader
	,__properties__: $extend(feathers_core_FeathersControl.prototype.__properties__,{set_scaleMode:"set_scaleMode",get_scaleMode:"get_scaleMode",get_originalSourceHeight:"get_originalSourceHeight",get_originalSourceWidth:"get_originalSourceWidth",set_source:"set_source",get_source:"get_source",set_sourceScale:"set_sourceScale",get_sourceScale:"get_sourceScale"})
});
var feathers_controls_IToggle = function() { };
$hxClasses["feathers.controls.IToggle"] = feathers_controls_IToggle;
feathers_controls_IToggle.__name__ = "feathers.controls.IToggle";
feathers_controls_IToggle.__isInterface__ = true;
feathers_controls_IToggle.__interfaces__ = [feathers_core_IUIControl];
feathers_controls_IToggle.prototype = {
	get_selected: null
	,set_selected: null
	,__class__: feathers_controls_IToggle
	,__properties__: {set_selected:"set_selected",get_selected:"get_selected"}
};
var feathers_controls_BasicToggleButton = function(changeListener) {
	this.__selectedBackgroundSkin = null;
	this.__backgroundSkin = null;
	this.__keepDownStateOnRollOut = false;
	this._stateToSkin = new haxe_ds_EnumValueMap();
	this._currentBackgroundSkin = null;
	this._backgroundSkinMeasurements = null;
	this._pointerTrigger = null;
	this._keyToState = null;
	this._pointerToState = null;
	this._toggleable = true;
	this._selected = false;
	this._currentState = feathers_controls_ToggleButtonState.UP(false);
	feathers_core_FeathersControl.call(this);
	this.mouseChildren = false;
	this.set_buttonMode(true);
	this.useHandCursor = false;
	this.addEventListener("click",$bind(this,this.basicToggleButton_clickHandler));
	this.addEventListener("touchTap",$bind(this,this.basicToggleButton_touchTapHandler));
	this.addEventListener("trigger",$bind(this,this.basicToggleButton_triggerHandler));
	if(changeListener != null) {
		this.addEventListener("change",changeListener);
	}
};
$hxClasses["feathers.controls.BasicToggleButton"] = feathers_controls_BasicToggleButton;
feathers_controls_BasicToggleButton.__name__ = "feathers.controls.BasicToggleButton";
feathers_controls_BasicToggleButton.__interfaces__ = [feathers_core_IStateContext,feathers_controls_IToggle,feathers_controls_ITriggerView];
feathers_controls_BasicToggleButton.__super__ = feathers_core_FeathersControl;
feathers_controls_BasicToggleButton.prototype = $extend(feathers_core_FeathersControl.prototype,{
	_currentState: null
	,get_currentState: function() {
		return this._currentState;
	}
	,set_enabled: function(value) {
		feathers_core_FeathersControl.prototype.set_enabled.call(this,value);
		if(this._enabled) {
			var _g = this._currentState;
			if(_g._hx_index == 3) {
				var selected = _g.selected;
				this.changeState(feathers_controls_ToggleButtonState.UP(selected));
			}
		} else {
			this.changeState(feathers_controls_ToggleButtonState.DISABLED(this._selected));
		}
		return this._enabled;
	}
	,_selected: null
	,get_selected: function() {
		return this._selected;
	}
	,set_selected: function(value) {
		if(this._selected == value) {
			return this._selected;
		}
		this._selected = value;
		this.setInvalid(feathers_core_InvalidationFlag.SELECTION);
		this.setInvalid(feathers_core_InvalidationFlag.STATE);
		feathers_events_FeathersEvent.dispatch(this,"change");
		this.changeState(this.get_currentState());
		return this._selected;
	}
	,_toggleable: null
	,get_toggleable: function() {
		return this._toggleable;
	}
	,set_toggleable: function(value) {
		if(this._toggleable == value) {
			return this._toggleable;
		}
		this._toggleable = value;
		return this._toggleable;
	}
	,_pointerToState: null
	,_keyToState: null
	,_pointerTrigger: null
	,_backgroundSkinMeasurements: null
	,_currentBackgroundSkin: null
	,_stateToSkin: null
	,getSkinForState: function(state) {
		return this._stateToSkin.get(state);
	}
	,setSkinForState: function(state,skin) {
		if(!this.setStyle("setSkinForState",state)) {
			return;
		}
		var oldSkin = this._stateToSkin.get(state);
		if(oldSkin != null && oldSkin == this._currentBackgroundSkin) {
			this.removeCurrentBackgroundSkin(oldSkin);
			this._currentBackgroundSkin = null;
		}
		if(skin == null) {
			this._stateToSkin.remove(state);
		} else {
			this._stateToSkin.set(state,skin);
		}
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
	}
	,initialize: function() {
		feathers_core_FeathersControl.prototype.initialize.call(this);
		if(this._pointerToState == null) {
			this._pointerToState = new feathers_utils_PointerToState(this,$bind(this,this.changeState),feathers_controls_ToggleButtonState.UP(false),feathers_controls_ToggleButtonState.DOWN(false),feathers_controls_ToggleButtonState.HOVER(false));
		}
		if(this._keyToState == null) {
			this._keyToState = new feathers_utils_KeyToState(this,$bind(this,this.changeState),feathers_controls_ToggleButtonState.UP(false),feathers_controls_ToggleButtonState.DOWN(false));
		}
		if(this._pointerTrigger == null) {
			this._pointerTrigger = new feathers_utils_PointerTrigger(this);
		}
	}
	,update: function() {
		this.commitChanges();
		this.measure();
		this.layoutContent();
	}
	,commitChanges: function() {
		var selectionInvalid = this.isInvalid(feathers_core_InvalidationFlag.SELECTION);
		var stylesInvalid = this.isInvalid(feathers_core_InvalidationFlag.STYLES);
		var stateInvalid = this.isInvalid(feathers_core_InvalidationFlag.STATE);
		if(selectionInvalid || stateInvalid || stylesInvalid) {
			this.refreshBackgroundSkin();
		}
		if(stylesInvalid) {
			this.refreshInteractivity();
		}
	}
	,refreshInteractivity: function() {
		this._pointerToState.set_keepDownStateOnRollOut(this.get_keepDownStateOnRollOut());
	}
	,refreshBackgroundSkin: function() {
		var oldSkin = this._currentBackgroundSkin;
		this._currentBackgroundSkin = this.getCurrentBackgroundSkin();
		if(this._currentBackgroundSkin == oldSkin) {
			return;
		}
		this.removeCurrentBackgroundSkin(oldSkin);
		this.addCurrentBackgroundSkin(this._currentBackgroundSkin);
	}
	,getCurrentBackgroundSkin: function() {
		var result = this._stateToSkin.get(this._currentState);
		if(result != null) {
			return result;
		}
		if(this._selected && this.get_selectedBackgroundSkin() != null) {
			return this.get_selectedBackgroundSkin();
		}
		return this.get_backgroundSkin();
	}
	,addCurrentBackgroundSkin: function(skin) {
		if(skin == null) {
			this._backgroundSkinMeasurements = null;
			return;
		}
		if(js_Boot.__implements(skin,feathers_core_IUIControl)) {
			skin.initializeNow();
		}
		if(this._backgroundSkinMeasurements == null) {
			this._backgroundSkinMeasurements = new feathers_layout_Measurements(skin);
		} else {
			this._backgroundSkinMeasurements.save(skin);
		}
		if(js_Boot.__implements(skin,feathers_skins_IProgrammaticSkin)) {
			skin.set_uiContext(this);
		}
		if(js_Boot.__implements(skin,feathers_core_IStateObserver)) {
			skin.set_stateContext(this);
		}
		this.addChildAt(skin,0);
	}
	,removeCurrentBackgroundSkin: function(skin) {
		if(skin == null) {
			return;
		}
		if(js_Boot.__implements(skin,feathers_skins_IProgrammaticSkin)) {
			skin.set_uiContext(null);
		}
		if(js_Boot.__implements(skin,feathers_core_IStateObserver)) {
			skin.set_stateContext(null);
		}
		this._backgroundSkinMeasurements.restore(skin);
		if(skin.parent == this) {
			this.removeChild(skin);
		}
	}
	,measure: function() {
		var needsWidth = this.get_explicitWidth() == null;
		var needsHeight = this.get_explicitHeight() == null;
		var needsMinWidth = this.get_explicitMinWidth() == null;
		var needsMinHeight = this.get_explicitMinHeight() == null;
		var needsMaxWidth = this.get_explicitMaxWidth() == null;
		var needsMaxHeight = this.get_explicitMaxHeight() == null;
		if(!needsWidth && !needsHeight && !needsMinWidth && !needsMinHeight && !needsMaxWidth && !needsMaxHeight) {
			return false;
		}
		if(this._currentBackgroundSkin != null) {
			feathers_utils_MeasurementsUtil.resetFluidlyWithParent(this._backgroundSkinMeasurements,this._currentBackgroundSkin,this);
		}
		var measureSkin = null;
		if(js_Boot.__implements(this._currentBackgroundSkin,feathers_core_IMeasureObject)) {
			measureSkin = this._currentBackgroundSkin;
		}
		if(js_Boot.__implements(this._currentBackgroundSkin,feathers_core_IValidating)) {
			this._currentBackgroundSkin.validateNow();
		}
		var newWidth = this.get_explicitWidth();
		if(needsWidth) {
			if(this._currentBackgroundSkin != null) {
				newWidth = this._currentBackgroundSkin.get_width();
			} else {
				newWidth = 0.0;
			}
		}
		var newHeight = this.get_explicitHeight();
		if(needsHeight) {
			if(this._currentBackgroundSkin != null) {
				newHeight = this._currentBackgroundSkin.get_height();
			} else {
				newHeight = 0.0;
			}
		}
		var newMinWidth = this.get_explicitMinWidth();
		if(needsMinWidth) {
			if(measureSkin != null) {
				newMinWidth = measureSkin.get_minWidth();
			} else if(this._backgroundSkinMeasurements != null && this._backgroundSkinMeasurements.minWidth != null) {
				newMinWidth = this._backgroundSkinMeasurements.minWidth;
			} else {
				newMinWidth = 0.0;
			}
		}
		var newMinHeight = this.get_explicitMinHeight();
		if(needsMinHeight) {
			if(measureSkin != null) {
				newMinHeight = measureSkin.get_minHeight();
			} else if(this._backgroundSkinMeasurements != null && this._backgroundSkinMeasurements.minHeight != null) {
				newMinHeight = this._backgroundSkinMeasurements.minHeight;
			} else {
				newMinHeight = 0.0;
			}
		}
		var newMaxWidth = this.get_explicitMaxWidth();
		if(needsMaxWidth) {
			if(measureSkin != null) {
				newMaxWidth = measureSkin.get_maxWidth();
			} else if(this._backgroundSkinMeasurements != null && this._backgroundSkinMeasurements.maxWidth != null) {
				newMaxWidth = this._backgroundSkinMeasurements.maxWidth;
			} else {
				newMaxWidth = 1.0 / 0.0;
			}
		}
		var newMaxHeight = this.get_explicitMaxHeight();
		if(needsMaxHeight) {
			if(measureSkin != null) {
				newMaxHeight = measureSkin.get_maxHeight();
			} else if(this._backgroundSkinMeasurements != null && this._backgroundSkinMeasurements.maxHeight != null) {
				newMaxHeight = this._backgroundSkinMeasurements.maxHeight;
			} else {
				newMaxHeight = 1.0 / 0.0;
			}
		}
		return this.saveMeasurements(newWidth,newHeight,newMinWidth,newMinHeight,newMaxWidth,newMaxHeight);
	}
	,layoutContent: function() {
		this.layoutBackgroundSkin();
	}
	,layoutBackgroundSkin: function() {
		if(this._currentBackgroundSkin == null) {
			return;
		}
		this._currentBackgroundSkin.set_x(0.0);
		this._currentBackgroundSkin.set_y(0.0);
		if(this._currentBackgroundSkin.get_width() != this.actualWidth) {
			this._currentBackgroundSkin.set_width(this.actualWidth);
		}
		if(this._currentBackgroundSkin.get_height() != this.actualHeight) {
			this._currentBackgroundSkin.set_height(this.actualHeight);
		}
		if(js_Boot.__implements(this._currentBackgroundSkin,feathers_core_IValidating)) {
			this._currentBackgroundSkin.validateNow();
		}
	}
	,changeState: function(state) {
		var toggleState = state;
		if(!this._enabled) {
			toggleState = feathers_controls_ToggleButtonState.DISABLED(this._selected);
		}
		switch(toggleState._hx_index) {
		case 0:
			var selected = toggleState.selected;
			if(this._selected != selected) {
				toggleState = feathers_controls_ToggleButtonState.UP(this._selected);
			}
			break;
		case 1:
			var selected = toggleState.selected;
			if(this._selected != selected) {
				toggleState = feathers_controls_ToggleButtonState.HOVER(this._selected);
			}
			break;
		case 2:
			var selected = toggleState.selected;
			if(this._selected != selected) {
				toggleState = feathers_controls_ToggleButtonState.DOWN(this._selected);
			}
			break;
		case 3:
			var selected = toggleState.selected;
			if(this._selected != selected) {
				toggleState = feathers_controls_ToggleButtonState.DISABLED(this._selected);
			}
			break;
		}
		if(this._currentState == toggleState) {
			return;
		}
		this._currentState = toggleState;
		this.setInvalid(feathers_core_InvalidationFlag.STATE);
		feathers_events_FeathersEvent.dispatch(this,"stateChange");
	}
	,basicToggleButton_clickHandler: function(event) {
		if(!this._enabled) {
			event.stopImmediatePropagation();
			return;
		}
	}
	,basicToggleButton_touchTapHandler: function(event) {
		if(!this._enabled) {
			event.stopImmediatePropagation();
			return;
		}
	}
	,basicToggleButton_triggerHandler: function(event) {
		if(!this._enabled || !this._toggleable) {
			return;
		}
		this.set_selected(!this._selected);
	}
	,__keepDownStateOnRollOut: null
	,get_keepDownStateOnRollOut: function() {
		return this.__keepDownStateOnRollOut;
	}
	,set_keepDownStateOnRollOut: function(value) {
		if(!this.setStyle("keepDownStateOnRollOut")) {
			return this.__keepDownStateOnRollOut;
		}
		if(this.__keepDownStateOnRollOut == value) {
			return this.__keepDownStateOnRollOut;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_keepDownStateOnRollOut);
		this.__keepDownStateOnRollOut = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__keepDownStateOnRollOut;
	}
	,clearStyle_keepDownStateOnRollOut: function() {
		this.set_keepDownStateOnRollOut(false);
		return this.get_keepDownStateOnRollOut();
	}
	,__backgroundSkin: null
	,get_backgroundSkin: function() {
		return this.__backgroundSkin;
	}
	,set_backgroundSkin: function(value) {
		if(!this.setStyle("backgroundSkin")) {
			return this.__backgroundSkin;
		}
		if(this.__backgroundSkin == value) {
			return this.__backgroundSkin;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_backgroundSkin);
		this.__backgroundSkin = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__backgroundSkin;
	}
	,clearStyle_backgroundSkin: function() {
		this.set_backgroundSkin(null);
		return this.get_backgroundSkin();
	}
	,__selectedBackgroundSkin: null
	,get_selectedBackgroundSkin: function() {
		return this.__selectedBackgroundSkin;
	}
	,set_selectedBackgroundSkin: function(value) {
		if(!this.setStyle("selectedBackgroundSkin")) {
			return this.__selectedBackgroundSkin;
		}
		if(this.__selectedBackgroundSkin == value) {
			return this.__selectedBackgroundSkin;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_selectedBackgroundSkin);
		this.__selectedBackgroundSkin = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__selectedBackgroundSkin;
	}
	,clearStyle_selectedBackgroundSkin: function() {
		this.set_selectedBackgroundSkin(null);
		return this.get_selectedBackgroundSkin();
	}
	,__class__: feathers_controls_BasicToggleButton
	,__properties__: $extend(feathers_core_FeathersControl.prototype.__properties__,{set_selectedBackgroundSkin:"set_selectedBackgroundSkin",get_selectedBackgroundSkin:"get_selectedBackgroundSkin",set_backgroundSkin:"set_backgroundSkin",get_backgroundSkin:"get_backgroundSkin",set_keepDownStateOnRollOut:"set_keepDownStateOnRollOut",get_keepDownStateOnRollOut:"get_keepDownStateOnRollOut",set_toggleable:"set_toggleable",get_toggleable:"get_toggleable",set_selected:"set_selected",get_selected:"get_selected",get_currentState:"get_currentState"})
});
var feathers_controls__$ButtonBar_ButtonStorage = function(id,recycler) {
	this.inactiveButtons = [];
	this.activeButtons = [];
	this.id = id;
	this.buttonRecycler = recycler;
};
$hxClasses["feathers.controls._ButtonBar.ButtonStorage"] = feathers_controls__$ButtonBar_ButtonStorage;
feathers_controls__$ButtonBar_ButtonStorage.__name__ = "feathers.controls._ButtonBar.ButtonStorage";
feathers_controls__$ButtonBar_ButtonStorage.prototype = {
	id: null
	,oldButtonRecycler: null
	,buttonRecycler: null
	,activeButtons: null
	,inactiveButtons: null
	,__class__: feathers_controls__$ButtonBar_ButtonStorage
};
var feathers_controls_ButtonState = $hxEnums["feathers.controls.ButtonState"] = { __ename__:"feathers.controls.ButtonState",__constructs__:null
	,UP: {_hx_name:"UP",_hx_index:0,__enum__:"feathers.controls.ButtonState",toString:$estr}
	,HOVER: {_hx_name:"HOVER",_hx_index:1,__enum__:"feathers.controls.ButtonState",toString:$estr}
	,DOWN: {_hx_name:"DOWN",_hx_index:2,__enum__:"feathers.controls.ButtonState",toString:$estr}
	,DISABLED: {_hx_name:"DISABLED",_hx_index:3,__enum__:"feathers.controls.ButtonState",toString:$estr}
};
feathers_controls_ButtonState.__constructs__ = [feathers_controls_ButtonState.UP,feathers_controls_ButtonState.HOVER,feathers_controls_ButtonState.DOWN,feathers_controls_ButtonState.DISABLED];
var feathers_controls_ToggleButton = function(text,selected,changeListener) {
	if(selected == null) {
		selected = false;
	}
	this.__showText = true;
	this.__textOffsetY = 0.0;
	this.__textOffsetX = 0.0;
	this.__iconOffsetY = 0.0;
	this.__iconOffsetX = 0.0;
	this.__verticalAlign = feathers_layout_VerticalAlign.MIDDLE;
	this.__horizontalAlign = feathers_layout_HorizontalAlign.CENTER;
	this.__paddingLeft = 0.0;
	this.__paddingBottom = 0.0;
	this.__paddingRight = 0.0;
	this.__paddingTop = 0.0;
	this.__minGap = 0.0;
	this.__gap = 0.0;
	this.__iconPosition = feathers_layout_RelativePosition.LEFT;
	this.__selectedTextFormat = null;
	this.__disabledTextFormat = null;
	this.__wordWrap = false;
	this.__embedFonts = false;
	this.__styleSheet = null;
	this.__textFormat = null;
	this.__selectedIcon = null;
	this.__disabledIcon = null;
	this.__icon = null;
	this._stateToTextFormat = new haxe_ds_EnumValueMap();
	this._ignoreIconResizes = false;
	this._currentIcon = null;
	this._iconMeasurements = null;
	this._stateToIcon = new haxe_ds_EnumValueMap();
	this._htmlText = null;
	this._updatedTextStyles = false;
	this._previousSimpleTextFormat = null;
	this._previousTextFormat = null;
	this._previousHTMLText = null;
	this._previousText = null;
	this.initializeToggleButtonTheme();
	feathers_controls_BasicToggleButton.call(this,changeListener);
	this.set_text(text);
	this.set_selected(selected);
	this.set_tabEnabled(true);
	this.set_tabChildren(false);
	this.addEventListener("keyDown",$bind(this,this.toggleButton_keyDownHandler));
	this.addEventListener("focusIn",$bind(this,this.toggleButton_focusInHandler));
	this.addEventListener("focusOut",$bind(this,this.toggleButton_focusOutHandler));
};
$hxClasses["feathers.controls.ToggleButton"] = feathers_controls_ToggleButton;
feathers_controls_ToggleButton.__name__ = "feathers.controls.ToggleButton";
feathers_controls_ToggleButton.__interfaces__ = [feathers_core_IFocusObject,feathers_core_IHTMLTextControl,feathers_core_ITextControl];
feathers_controls_ToggleButton.__super__ = feathers_controls_BasicToggleButton;
feathers_controls_ToggleButton.prototype = $extend(feathers_controls_BasicToggleButton.prototype,{
	textField: null
	,_previousText: null
	,_previousHTMLText: null
	,_previousTextFormat: null
	,_previousSimpleTextFormat: null
	,_updatedTextStyles: null
	,_text: null
	,get_text: function() {
		return this._text;
	}
	,set_text: function(value) {
		if(this._text == value) {
			return this._text;
		}
		this._text = value;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		return this._text;
	}
	,_htmlText: null
	,get_htmlText: function() {
		return this._htmlText;
	}
	,set_htmlText: function(value) {
		if(this._htmlText == value) {
			return this._htmlText;
		}
		this._htmlText = value;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		return this._htmlText;
	}
	,get_baseline: function() {
		if(this.textField == null) {
			return 0.0;
		}
		var hasText = this._text != null && this._text.length > 0;
		var hasHTMLText = this._htmlText != null && this._htmlText.length > 0;
		if(!this.get_showText() || !hasText && !hasHTMLText) {
			var textFieldY = this.textField.get_y();
			if(!this.get_showText() || this._text == null && this._htmlText == null) {
				if(this._currentIcon != null) {
					textFieldY = this._currentIcon.get_y() + (this._currentIcon.get_height() - this._textMeasuredHeight) / 2.0;
				} else if(this._currentBackgroundSkin != null) {
					textFieldY = (this._currentBackgroundSkin.get_height() - this._textMeasuredHeight) / 2.0;
				} else {
					return 0.0;
				}
			}
			this.textField.set_text("​");
			var textFieldBaseline = textFieldY + this.textField.getLineMetrics(0).ascent;
			this.textField.set_text("");
			return textFieldBaseline;
		}
		return this.textField.get_y() + this.textField.getLineMetrics(0).ascent;
	}
	,_stateToIcon: null
	,_iconMeasurements: null
	,_currentIcon: null
	,_ignoreIconResizes: null
	,_textMeasuredWidth: null
	,_textMeasuredHeight: null
	,_wrappedOnMeasure: null
	,_stateToTextFormat: null
	,getTextFormatForState: function(state) {
		return this._stateToTextFormat.get(state);
	}
	,setTextFormatForState: function(state,textFormat) {
		if(!this.setStyle("setTextFormatForState",state)) {
			return;
		}
		if(textFormat == null) {
			this._stateToTextFormat.remove(state);
		} else {
			this._stateToTextFormat.set(state,textFormat);
		}
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
	}
	,getIconForState: function(state) {
		return this._stateToIcon.get(state);
	}
	,setIconForState: function(state,icon) {
		if(!this.setStyle("setIconForState",state)) {
			return;
		}
		var oldIcon = this._stateToIcon.get(state);
		if(oldIcon != null && oldIcon == this._currentIcon) {
			this.removeCurrentIcon(oldIcon);
			this._currentIcon = null;
		}
		if(icon == null) {
			this._stateToIcon.remove(state);
		} else {
			this._stateToIcon.set(state,icon);
		}
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
	}
	,setPadding: function(value) {
		this.set_paddingTop(value);
		this.set_paddingRight(value);
		this.set_paddingBottom(value);
		this.set_paddingLeft(value);
	}
	,initializeToggleButtonTheme: function() {
		feathers_themes_steel_components_SteelToggleButtonStyles.initialize();
	}
	,initialize: function() {
		feathers_controls_BasicToggleButton.prototype.initialize.call(this);
		if(this.textField == null) {
			this.textField = new openfl_text_TextField();
			this.textField.set_selectable(false);
			this.textField.set_multiline(true);
			this.addChild(this.textField);
		}
	}
	,commitChanges: function() {
		feathers_controls_BasicToggleButton.prototype.commitChanges.call(this);
		var dataInvalid = this.isInvalid(feathers_core_InvalidationFlag.DATA);
		var sizeInvalid = this.isInvalid(feathers_core_InvalidationFlag.SIZE);
		var stateInvalid = this.isInvalid(feathers_core_InvalidationFlag.STATE);
		var stylesInvalid = this.isInvalid(feathers_core_InvalidationFlag.STYLES);
		this._updatedTextStyles = false;
		if(stylesInvalid || stateInvalid) {
			this.refreshIcon();
		}
		if(stylesInvalid || stateInvalid) {
			this.refreshTextStyles();
		}
		if(dataInvalid || stylesInvalid || stateInvalid || sizeInvalid) {
			this.refreshText(sizeInvalid);
		}
	}
	,measure: function() {
		var needsWidth = this.get_explicitWidth() == null;
		var needsHeight = this.get_explicitHeight() == null;
		var needsMinWidth = this.get_explicitMinWidth() == null;
		var needsMinHeight = this.get_explicitMinHeight() == null;
		var needsMaxWidth = this.get_explicitMaxWidth() == null;
		var needsMaxHeight = this.get_explicitMaxHeight() == null;
		if(!needsWidth && !needsHeight && !needsMinWidth && !needsMinHeight && !needsMaxWidth && !needsMaxHeight) {
			return false;
		}
		var hasText = this.get_showText() && this._text != null;
		var hasHTMLText = this.get_showText() && this._htmlText != null && this._htmlText.length > 0;
		if(hasText || hasHTMLText) {
			this.refreshTextFieldDimensions(true);
		}
		if(this._currentBackgroundSkin != null) {
			feathers_utils_MeasurementsUtil.resetFluidlyWithParent(this._backgroundSkinMeasurements,this._currentBackgroundSkin,this);
		}
		var measureSkin = null;
		if(js_Boot.__implements(this._currentBackgroundSkin,feathers_core_IMeasureObject)) {
			measureSkin = this._currentBackgroundSkin;
		}
		if(js_Boot.__implements(this._currentBackgroundSkin,feathers_core_IValidating)) {
			this._currentBackgroundSkin.validateNow();
		}
		if(js_Boot.__implements(this._currentIcon,feathers_core_IValidating)) {
			var oldIgnoreIconResizes = this._ignoreIconResizes;
			this._ignoreIconResizes = true;
			this._currentIcon.validateNow();
			this._ignoreIconResizes = oldIgnoreIconResizes;
		}
		var newWidth = this.get_explicitWidth();
		if(needsWidth) {
			newWidth = this.measureContentWidth();
			newWidth += this.get_paddingLeft() + this.get_paddingRight();
			if(this._currentBackgroundSkin != null) {
				newWidth = Math.max(this._currentBackgroundSkin.get_width(),newWidth);
			}
		}
		var newHeight = this.get_explicitHeight();
		if(needsHeight) {
			newHeight = this.measureContentHeight();
			newHeight += this.get_paddingTop() + this.get_paddingBottom();
			if(this._currentBackgroundSkin != null) {
				newHeight = Math.max(this._currentBackgroundSkin.get_height(),newHeight);
			}
		}
		var newMinWidth = this.get_explicitMinWidth();
		if(needsMinWidth) {
			newMinWidth = this.measureContentMinWidth();
			newMinWidth += this.get_paddingLeft() + this.get_paddingRight();
			if(measureSkin != null) {
				newMinWidth = Math.max(measureSkin.get_minWidth(),newMinWidth);
			} else if(this._backgroundSkinMeasurements != null && this._backgroundSkinMeasurements.minWidth != null) {
				newMinWidth = Math.max(this._backgroundSkinMeasurements.minWidth,newMinWidth);
			}
		}
		var newMinHeight = this.get_explicitMinHeight();
		if(needsMinHeight) {
			newMinHeight = this.measureContentMinHeight();
			newMinHeight += this.get_paddingTop() + this.get_paddingBottom();
			if(measureSkin != null) {
				newMinHeight = Math.max(measureSkin.get_minHeight(),newMinHeight);
			} else if(this._backgroundSkinMeasurements != null && this._backgroundSkinMeasurements.minHeight != null) {
				newMinHeight = Math.max(this._backgroundSkinMeasurements.minHeight,newMinHeight);
			}
		}
		var newMaxWidth = this.get_explicitMaxWidth();
		if(needsMaxWidth) {
			if(measureSkin != null) {
				newMaxWidth = measureSkin.get_maxWidth();
			} else if(this._backgroundSkinMeasurements != null && this._backgroundSkinMeasurements.maxWidth != null) {
				newMaxWidth = this._backgroundSkinMeasurements.maxWidth;
			} else {
				newMaxWidth = 1.0 / 0.0;
			}
		}
		var newMaxHeight = this.get_explicitMaxHeight();
		if(needsMaxHeight) {
			if(measureSkin != null) {
				newMaxHeight = measureSkin.get_maxHeight();
			} else if(this._backgroundSkinMeasurements != null && this._backgroundSkinMeasurements.maxHeight != null) {
				newMaxHeight = this._backgroundSkinMeasurements.maxHeight;
			} else {
				newMaxHeight = 1.0 / 0.0;
			}
		}
		return this.saveMeasurements(newWidth,newHeight,newMinWidth,newMinHeight,newMaxWidth,newMaxHeight);
	}
	,calculateExplicitWidthForTextMeasurement: function() {
		var textFieldExplicitWidth = null;
		if(this.get_explicitWidth() != null) {
			textFieldExplicitWidth = this.get_explicitWidth();
		} else if(this.get_explicitMaxWidth() != null) {
			textFieldExplicitWidth = this.get_explicitMaxWidth();
		} else if(this._backgroundSkinMeasurements != null && this._backgroundSkinMeasurements.maxWidth != null) {
			textFieldExplicitWidth = this._backgroundSkinMeasurements.maxWidth;
		}
		if(textFieldExplicitWidth == null) {
			return textFieldExplicitWidth;
		}
		textFieldExplicitWidth -= this.get_paddingLeft() + this.get_paddingRight();
		var adjustedGap = this.get_gap();
		if(adjustedGap == 1.0 / 0.0) {
			adjustedGap = this.get_minGap();
		}
		if(this._currentIcon != null) {
			if(this.get_iconPosition() == feathers_layout_RelativePosition.LEFT || this.get_iconPosition() == feathers_layout_RelativePosition.RIGHT) {
				if(js_Boot.__implements(this._currentIcon,feathers_core_IValidating)) {
					this._currentIcon.validateNow();
				}
				textFieldExplicitWidth -= this._currentIcon.get_width() + adjustedGap;
			}
		}
		if(textFieldExplicitWidth < 0.0) {
			textFieldExplicitWidth = 0.0;
		}
		return textFieldExplicitWidth;
	}
	,measureContentWidth: function() {
		var adjustedGap = this.get_gap();
		if(adjustedGap == 1.0 / 0.0) {
			adjustedGap = this.get_minGap();
		}
		var hasText = this.get_showText() && this._text != null;
		var hasHTMLText = this.get_showText() && this._htmlText != null && this._htmlText.length > 0;
		var contentWidth = hasText || hasHTMLText ? this._textMeasuredWidth : 0.0;
		if(this._currentIcon != null) {
			if(this.get_iconPosition() == feathers_layout_RelativePosition.LEFT || this.get_iconPosition() == feathers_layout_RelativePosition.RIGHT) {
				if(hasText || hasHTMLText) {
					contentWidth += adjustedGap;
				}
				contentWidth += this._currentIcon.get_width();
			} else if(this.get_iconPosition() == feathers_layout_RelativePosition.TOP || this.get_iconPosition() == feathers_layout_RelativePosition.BOTTOM) {
				contentWidth = Math.max(contentWidth,this._currentIcon.get_width());
			}
		}
		return contentWidth;
	}
	,measureContentHeight: function() {
		var adjustedGap = this.get_gap();
		if(adjustedGap == 1.0 / 0.0) {
			adjustedGap = this.get_minGap();
		}
		var hasText = this.get_showText() && this._text != null;
		var hasHTMLText = this.get_showText() && this._htmlText != null && this._htmlText.length > 0;
		var contentHeight = hasText || hasHTMLText ? this._textMeasuredHeight : 0.0;
		if(this._currentIcon != null) {
			if(this.get_iconPosition() == feathers_layout_RelativePosition.TOP || this.get_iconPosition() == feathers_layout_RelativePosition.BOTTOM) {
				if(hasText || hasHTMLText) {
					contentHeight += adjustedGap;
				}
				contentHeight += this._currentIcon.get_height();
			} else if(this.get_iconPosition() == feathers_layout_RelativePosition.LEFT || this.get_iconPosition() == feathers_layout_RelativePosition.RIGHT) {
				contentHeight = Math.max(contentHeight,this._currentIcon.get_height());
			}
		}
		return contentHeight;
	}
	,measureContentMinWidth: function() {
		var adjustedGap = this.get_gap();
		if(adjustedGap == 1.0 / 0.0) {
			adjustedGap = this.get_minGap();
		}
		var hasText = this.get_showText() && this._text != null;
		var hasHTMLText = this.get_showText() && this._htmlText != null && this._htmlText.length > 0;
		var contentMinWidth = hasText || hasHTMLText ? this._textMeasuredWidth : 0.0;
		if(this._currentIcon != null) {
			if(this.get_iconPosition() == feathers_layout_RelativePosition.LEFT || this.get_iconPosition() == feathers_layout_RelativePosition.RIGHT) {
				if(hasText || hasHTMLText) {
					contentMinWidth += adjustedGap;
				}
				contentMinWidth += this._currentIcon.get_width();
			} else if(this.get_iconPosition() == feathers_layout_RelativePosition.TOP || this.get_iconPosition() == feathers_layout_RelativePosition.BOTTOM) {
				contentMinWidth = Math.max(contentMinWidth,this._currentIcon.get_width());
			}
		}
		return contentMinWidth;
	}
	,measureContentMinHeight: function() {
		var adjustedGap = this.get_gap();
		if(adjustedGap == 1.0 / 0.0) {
			adjustedGap = this.get_minGap();
		}
		var hasText = this.get_showText() && this._text != null;
		var hasHTMLText = this.get_showText() && this._htmlText != null && this._htmlText.length > 0;
		var contentMinHeight = hasText || hasHTMLText ? this._textMeasuredHeight : 0.0;
		if(this._currentIcon != null) {
			if(this.get_iconPosition() == feathers_layout_RelativePosition.TOP || this.get_iconPosition() == feathers_layout_RelativePosition.BOTTOM) {
				if(hasText || hasHTMLText) {
					contentMinHeight += adjustedGap;
				}
				contentMinHeight += this._currentIcon.get_height();
			} else if(this.get_iconPosition() == feathers_layout_RelativePosition.LEFT || this.get_iconPosition() == feathers_layout_RelativePosition.RIGHT) {
				contentMinHeight = Math.max(contentMinHeight,this._currentIcon.get_height());
			}
		}
		return contentMinHeight;
	}
	,refreshTextStyles: function() {
		if(this.textField.get_wordWrap() != this.get_wordWrap()) {
			this.textField.set_wordWrap(this.get_wordWrap());
			this._updatedTextStyles = true;
		}
		if(this.textField.get_embedFonts() != this.get_embedFonts()) {
			this.textField.set_embedFonts(this.get_embedFonts());
			this._updatedTextStyles = true;
		}
		if(this.textField.get_styleSheet() != this.get_styleSheet()) {
			this.textField.set_styleSheet(this.get_styleSheet());
			this._updatedTextStyles = true;
		}
		var textFormat = this.getCurrentTextFormat();
		var simpleTextFormat = textFormat != null ? textFormat.toSimpleTextFormat() : null;
		if(simpleTextFormat == this._previousSimpleTextFormat) {
			return;
		}
		if(this._previousTextFormat != null) {
			this._previousTextFormat.removeEventListener("change",$bind(this,this.toggleButton_textFormat_changeHandler));
		}
		if(textFormat != null) {
			textFormat.addEventListener("change",$bind(this,this.toggleButton_textFormat_changeHandler),false,0,true);
			this.textField.set_defaultTextFormat(simpleTextFormat);
			this._updatedTextStyles = true;
		}
		this._previousTextFormat = textFormat;
		this._previousSimpleTextFormat = simpleTextFormat;
	}
	,refreshText: function(forceMeasurement) {
		var hasText = this.get_showText() && this._text != null && this._text.length > 0;
		var hasHTMLText = this.get_showText() && this._htmlText != null && this._htmlText.length > 0;
		this.textField.set_visible(hasText || hasHTMLText);
		if(this._text == this._previousText && this._htmlText == this._previousHTMLText && !this._updatedTextStyles && !forceMeasurement) {
			return;
		}
		this.textField.set_autoSize(1);
		if(hasHTMLText) {
			this.textField.set_htmlText(this._htmlText);
		} else if(hasText) {
			this.textField.set_text(this._text);
		} else {
			this.textField.set_text("​");
		}
		if(this.get_wordWrap()) {
			this.textField.set_wordWrap(false);
		}
		this._textMeasuredWidth = this.textField.get_textWidth() + 4;
		this._wrappedOnMeasure = false;
		if(this.get_wordWrap()) {
			var textFieldExplicitWidth = this.calculateExplicitWidthForTextMeasurement();
			if(textFieldExplicitWidth != null && this._textMeasuredWidth > textFieldExplicitWidth) {
				this.textField.set_wordWrap(true);
				this.textField.set_width(textFieldExplicitWidth);
				this._textMeasuredWidth = this.textField.get_width();
				this._wrappedOnMeasure = true;
			}
		}
		this._textMeasuredHeight = this.textField.get_height();
		this.textField.set_autoSize(2);
		if(this.textField.get_wordWrap() != this.get_wordWrap()) {
			this.textField.set_wordWrap(this.get_wordWrap());
		}
		if(!hasText && !hasHTMLText) {
			this.textField.set_text("");
		}
		this._previousText = this._text;
		this._previousHTMLText = this._htmlText;
	}
	,getCurrentTextFormat: function() {
		if(this.get_styleSheet() != null) {
			return null;
		}
		var result = this._stateToTextFormat.get(this._currentState);
		if(result != null) {
			return result;
		}
		if(!this._enabled && this.get_disabledTextFormat() != null) {
			return this.get_disabledTextFormat();
		}
		if(this._selected && this.get_selectedTextFormat() != null) {
			return this.get_selectedTextFormat();
		}
		return this.get_textFormat();
	}
	,layoutContent: function() {
		feathers_controls_BasicToggleButton.prototype.layoutContent.call(this);
		this.layoutChildren();
	}
	,layoutChildren: function() {
		this.refreshTextFieldDimensions(false);
		var hasText = this.get_showText() && this._text != null;
		var hasHTMLText = this.get_showText() && this._htmlText != null && this._htmlText.length > 0;
		var iconIsInLayout = this._currentIcon != null && this.get_iconPosition() != feathers_layout_RelativePosition.MANUAL;
		if((hasText || hasHTMLText) && iconIsInLayout) {
			this.positionSingleChild(this.textField);
			this.positionTextAndIcon();
		} else if(hasText || hasHTMLText) {
			this.positionSingleChild(this.textField);
		} else if(iconIsInLayout) {
			this.positionSingleChild(this._currentIcon);
		}
		if(this._currentIcon != null) {
			if(this.get_iconPosition() == feathers_layout_RelativePosition.MANUAL) {
				this._currentIcon.set_x(this.get_paddingLeft());
				this._currentIcon.set_y(this.get_paddingTop());
			}
			var fh = this._currentIcon;
			fh.set_x(fh.get_x() + this.get_iconOffsetX());
			var fh = this._currentIcon;
			fh.set_y(fh.get_y() + this.get_iconOffsetY());
		}
		if(hasText) {
			var fh = this.textField;
			fh.set_x(fh.get_x() + this.get_textOffsetX());
			var fh = this.textField;
			fh.set_y(fh.get_y() + this.get_textOffsetY());
		}
	}
	,refreshTextFieldDimensions: function(forMeasurement) {
		var oldIgnoreIconResizes = this._ignoreIconResizes;
		this._ignoreIconResizes = true;
		if(js_Boot.__implements(this._currentIcon,feathers_core_IValidating)) {
			this._currentIcon.validateNow();
		}
		this._ignoreIconResizes = oldIgnoreIconResizes;
		var hasText = this.get_showText() && this._text != null;
		var hasHTMLText = this.get_showText() && this._htmlText != null && this._htmlText.length > 0;
		if(!hasText && !hasHTMLText) {
			return;
		}
		var calculatedWidth = this.actualWidth;
		var calculatedHeight = this.actualHeight;
		if(forMeasurement) {
			calculatedWidth = 0.0;
			var explicitCalculatedWidth = this.get_explicitWidth();
			if(explicitCalculatedWidth == null) {
				explicitCalculatedWidth = this.get_explicitMaxWidth();
			}
			if(explicitCalculatedWidth != null) {
				calculatedWidth = explicitCalculatedWidth;
			}
			calculatedHeight = 0.0;
			var explicitCalculatedHeight = this.get_explicitHeight();
			if(explicitCalculatedHeight == null) {
				explicitCalculatedHeight = this.get_explicitMaxHeight();
			}
			if(explicitCalculatedHeight != null) {
				calculatedHeight = explicitCalculatedHeight;
			}
		}
		calculatedWidth -= this.get_paddingLeft() + this.get_paddingRight();
		calculatedHeight -= this.get_paddingTop() + this.get_paddingBottom();
		if(this._currentIcon != null) {
			var adjustedGap = this.get_gap();
			if(adjustedGap == 1.0 / 0.0) {
				adjustedGap = this.get_minGap();
			}
			if(this.get_iconPosition() == feathers_layout_RelativePosition.LEFT || this.get_iconPosition() == feathers_layout_RelativePosition.RIGHT) {
				calculatedWidth -= this._currentIcon.get_width() + adjustedGap;
			}
			if(this.get_iconPosition() == feathers_layout_RelativePosition.TOP || this.get_iconPosition() == feathers_layout_RelativePosition.BOTTOM) {
				calculatedHeight -= this._currentIcon.get_height() + adjustedGap;
			}
		}
		if(calculatedWidth > this._textMeasuredWidth) {
			calculatedWidth = this._textMeasuredWidth;
		}
		if(calculatedHeight > this._textMeasuredHeight) {
			calculatedHeight = this._textMeasuredHeight;
		}
		if(calculatedWidth < 0.0) {
			calculatedWidth = 0.0;
		}
		if(calculatedHeight < 0.0) {
			calculatedHeight = 0.0;
		}
		this.textField.set_width(calculatedWidth);
		var wordWrap = this.get_wordWrap();
		if(wordWrap && !this._wrappedOnMeasure && calculatedWidth >= this._textMeasuredWidth) {
			wordWrap = false;
		}
		if(this.textField.get_wordWrap() != wordWrap) {
			this.textField.set_wordWrap(wordWrap);
		}
		this.textField.set_height(calculatedHeight);
	}
	,positionSingleChild: function(displayObject) {
		if(this.get_horizontalAlign() == feathers_layout_HorizontalAlign.LEFT) {
			displayObject.set_x(this.get_paddingLeft());
		} else if(this.get_horizontalAlign() == feathers_layout_HorizontalAlign.RIGHT) {
			displayObject.set_x(this.actualWidth - this.get_paddingRight() - displayObject.get_width());
		} else {
			displayObject.set_x(this.get_paddingLeft() + (this.actualWidth - this.get_paddingLeft() - this.get_paddingRight() - displayObject.get_width()) / 2.0);
		}
		if(this.get_verticalAlign() == feathers_layout_VerticalAlign.TOP) {
			displayObject.set_y(this.get_paddingTop());
		} else if(this.get_verticalAlign() == feathers_layout_VerticalAlign.BOTTOM) {
			displayObject.set_y(this.actualHeight - this.get_paddingBottom() - displayObject.get_height());
		} else {
			displayObject.set_y(this.get_paddingTop() + (this.actualHeight - this.get_paddingTop() - this.get_paddingBottom() - displayObject.get_height()) / 2.0);
		}
	}
	,positionTextAndIcon: function() {
		if(this.get_iconPosition() == feathers_layout_RelativePosition.TOP) {
			if(this.get_gap() == 1.0 / 0.0) {
				this._currentIcon.set_y(this.get_paddingTop());
				this.textField.set_y(this.actualHeight - this.get_paddingBottom() - this.textField.get_height());
			} else {
				if(this.get_verticalAlign() == feathers_layout_VerticalAlign.TOP) {
					var fh = this.textField;
					fh.set_y(fh.get_y() + (this._currentIcon.get_height() + this.get_gap()));
				} else if(this.get_verticalAlign() == feathers_layout_VerticalAlign.MIDDLE) {
					var fh = this.textField;
					fh.set_y(fh.get_y() + (this._currentIcon.get_height() + this.get_gap()) / 2.0);
				}
				this._currentIcon.set_y(this.textField.get_y() - this._currentIcon.get_height() - this.get_gap());
			}
		} else if(this.get_iconPosition() == feathers_layout_RelativePosition.RIGHT) {
			if(this.get_gap() == 1.0 / 0.0) {
				this.textField.set_x(this.get_paddingLeft());
				this._currentIcon.set_x(this.actualWidth - this.get_paddingRight() - this._currentIcon.get_width());
			} else {
				if(this.get_horizontalAlign() == feathers_layout_HorizontalAlign.RIGHT) {
					var fh = this.textField;
					fh.set_x(fh.get_x() - (this._currentIcon.get_width() + this.get_gap()));
				} else if(this.get_horizontalAlign() == feathers_layout_HorizontalAlign.CENTER) {
					var fh = this.textField;
					fh.set_x(fh.get_x() - (this._currentIcon.get_width() + this.get_gap()) / 2.0);
				}
				this._currentIcon.set_x(this.textField.get_x() + this.textField.get_width() + this.get_gap());
			}
		} else if(this.get_iconPosition() == feathers_layout_RelativePosition.BOTTOM) {
			if(this.get_gap() == 1.0 / 0.0) {
				this.textField.set_y(this.get_paddingTop());
				this._currentIcon.set_y(this.actualHeight - this.get_paddingBottom() - this._currentIcon.get_height());
			} else {
				if(this.get_verticalAlign() == feathers_layout_VerticalAlign.BOTTOM) {
					var fh = this.textField;
					fh.set_y(fh.get_y() - (this._currentIcon.get_height() + this.get_gap()));
				} else if(this.get_verticalAlign() == feathers_layout_VerticalAlign.MIDDLE) {
					var fh = this.textField;
					fh.set_y(fh.get_y() - (this._currentIcon.get_height() + this.get_gap()) / 2.0);
				}
				this._currentIcon.set_y(this.textField.get_y() + this.textField.get_height() + this.get_gap());
			}
		} else if(this.get_iconPosition() == feathers_layout_RelativePosition.LEFT) {
			if(this.get_gap() == 1.0 / 0.0) {
				this._currentIcon.set_x(this.get_paddingLeft());
				this.textField.set_x(this.actualWidth - this.get_paddingRight() - this.textField.get_width());
			} else {
				if(this.get_horizontalAlign() == feathers_layout_HorizontalAlign.LEFT) {
					var fh = this.textField;
					fh.set_x(fh.get_x() + (this.get_gap() + this._currentIcon.get_width()));
				} else if(this.get_horizontalAlign() == feathers_layout_HorizontalAlign.CENTER) {
					var fh = this.textField;
					fh.set_x(fh.get_x() + (this.get_gap() + this._currentIcon.get_width()) / 2.0);
				}
				this._currentIcon.set_x(this.textField.get_x() - this.get_gap() - this._currentIcon.get_width());
			}
		}
		if(this.get_iconPosition() == feathers_layout_RelativePosition.LEFT || this.get_iconPosition() == feathers_layout_RelativePosition.RIGHT) {
			if(this.get_verticalAlign() == feathers_layout_VerticalAlign.TOP) {
				this._currentIcon.set_y(this.get_paddingTop());
			} else if(this.get_verticalAlign() == feathers_layout_VerticalAlign.BOTTOM) {
				this._currentIcon.set_y(this.actualHeight - this.get_paddingBottom() - this._currentIcon.get_height());
			} else {
				this._currentIcon.set_y(this.get_paddingTop() + (this.actualHeight - this.get_paddingTop() - this.get_paddingBottom() - this._currentIcon.get_height()) / 2.0);
			}
		} else if(this.get_horizontalAlign() == feathers_layout_HorizontalAlign.LEFT) {
			this._currentIcon.set_x(this.get_paddingLeft());
		} else if(this.get_horizontalAlign() == feathers_layout_HorizontalAlign.RIGHT) {
			this._currentIcon.set_x(this.actualWidth - this.get_paddingRight() - this._currentIcon.get_width());
		} else {
			this._currentIcon.set_x(this.get_paddingLeft() + (this.actualWidth - this.get_paddingLeft() - this.get_paddingRight() - this._currentIcon.get_width()) / 2.0);
		}
	}
	,refreshIcon: function() {
		var oldIcon = this._currentIcon;
		this._currentIcon = this.getCurrentIcon();
		if(this._currentIcon == oldIcon) {
			return;
		}
		this.removeCurrentIcon(oldIcon);
		this.addCurrentIcon(this._currentIcon);
	}
	,getCurrentIcon: function() {
		var result = this._stateToIcon.get(this._currentState);
		if(result != null) {
			return result;
		}
		if(!this._enabled && this.get_disabledIcon() != null) {
			return this.get_disabledIcon();
		}
		if(this._selected && this.get_selectedIcon() != null) {
			return this.get_selectedIcon();
		}
		return this.get_icon();
	}
	,addCurrentIcon: function(icon) {
		if(icon == null) {
			this._iconMeasurements = null;
			return;
		}
		if(js_Boot.__implements(icon,feathers_core_IUIControl)) {
			icon.initializeNow();
		}
		if(this._iconMeasurements == null) {
			this._iconMeasurements = new feathers_layout_Measurements(icon);
		} else {
			this._iconMeasurements.save(icon);
		}
		if(js_Boot.__implements(icon,feathers_skins_IProgrammaticSkin)) {
			icon.set_uiContext(this);
		}
		if(js_Boot.__implements(icon,feathers_core_IStateObserver)) {
			icon.set_stateContext(this);
		}
		icon.addEventListener("resize",$bind(this,this.toggleButton_icon_resizeHandler),false,0,true);
		var index = this.getChildIndex(this.textField);
		this.addChildAt(icon,index);
	}
	,removeCurrentIcon: function(icon) {
		if(icon == null) {
			return;
		}
		icon.removeEventListener("resize",$bind(this,this.toggleButton_icon_resizeHandler));
		if(js_Boot.__implements(icon,feathers_skins_IProgrammaticSkin)) {
			icon.set_uiContext(null);
		}
		if(js_Boot.__implements(icon,feathers_core_IStateObserver)) {
			icon.set_stateContext(null);
		}
		this._iconMeasurements.restore(icon);
		if(icon.parent == this) {
			this.removeChild(icon);
		}
	}
	,toggleButton_keyDownHandler: function(event) {
		if(!this._enabled || this.get_buttonMode() && this.focusRect == true) {
			return;
		}
		if(this._focusManager != null && this._focusManager.get_focus() != this) {
			return;
		}
		if(event.keyCode != 32 && event.keyCode != 13) {
			return;
		}
		event.preventDefault();
		this.dispatchEvent(new openfl_events_MouseEvent("click"));
	}
	,toggleButton_focusInHandler: function(event) {
		this._keyToState.set_enabled(this._enabled);
	}
	,toggleButton_focusOutHandler: function(event) {
		this._keyToState.set_enabled(false);
	}
	,toggleButton_textFormat_changeHandler: function(event) {
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
	}
	,toggleButton_icon_resizeHandler: function(event) {
		if(this._ignoreIconResizes) {
			return;
		}
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
	}
	,get_styleContext: function() {
		return feathers_controls_ToggleButton;
	}
	,__icon: null
	,get_icon: function() {
		return this.__icon;
	}
	,set_icon: function(value) {
		if(!this.setStyle("icon")) {
			return this.__icon;
		}
		if(this.__icon == value) {
			return this.__icon;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_icon);
		this.__icon = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__icon;
	}
	,clearStyle_icon: function() {
		this.set_icon(null);
		return this.get_icon();
	}
	,__disabledIcon: null
	,get_disabledIcon: function() {
		return this.__disabledIcon;
	}
	,set_disabledIcon: function(value) {
		if(!this.setStyle("disabledIcon")) {
			return this.__disabledIcon;
		}
		if(this.__disabledIcon == value) {
			return this.__disabledIcon;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_disabledIcon);
		this.__disabledIcon = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__disabledIcon;
	}
	,clearStyle_disabledIcon: function() {
		this.set_disabledIcon(null);
		return this.get_disabledIcon();
	}
	,__selectedIcon: null
	,get_selectedIcon: function() {
		return this.__selectedIcon;
	}
	,set_selectedIcon: function(value) {
		if(!this.setStyle("selectedIcon")) {
			return this.__selectedIcon;
		}
		if(this.__selectedIcon == value) {
			return this.__selectedIcon;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_selectedIcon);
		this.__selectedIcon = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__selectedIcon;
	}
	,clearStyle_selectedIcon: function() {
		this.set_selectedIcon(null);
		return this.get_selectedIcon();
	}
	,__textFormat: null
	,get_textFormat: function() {
		return this.__textFormat;
	}
	,set_textFormat: function(value) {
		if(!this.setStyle("textFormat")) {
			return this.__textFormat;
		}
		if(this.__textFormat == value) {
			return this.__textFormat;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_textFormat);
		this.__textFormat = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__textFormat;
	}
	,clearStyle_textFormat: function() {
		this.set_textFormat(null);
		return this.get_textFormat();
	}
	,__styleSheet: null
	,get_styleSheet: function() {
		return this.__styleSheet;
	}
	,set_styleSheet: function(value) {
		if(!this.setStyle("styleSheet")) {
			return this.__styleSheet;
		}
		if(this.__styleSheet == value) {
			return this.__styleSheet;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_styleSheet);
		this.__styleSheet = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__styleSheet;
	}
	,clearStyle_styleSheet: function() {
		this.set_styleSheet(null);
		return this.get_styleSheet();
	}
	,__embedFonts: null
	,get_embedFonts: function() {
		return this.__embedFonts;
	}
	,set_embedFonts: function(value) {
		if(!this.setStyle("embedFonts")) {
			return this.__embedFonts;
		}
		if(this.__embedFonts == value) {
			return this.__embedFonts;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_embedFonts);
		this.__embedFonts = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__embedFonts;
	}
	,clearStyle_embedFonts: function() {
		this.set_embedFonts(false);
		return this.get_embedFonts();
	}
	,__wordWrap: null
	,get_wordWrap: function() {
		return this.__wordWrap;
	}
	,set_wordWrap: function(value) {
		if(!this.setStyle("wordWrap")) {
			return this.__wordWrap;
		}
		if(this.__wordWrap == value) {
			return this.__wordWrap;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_wordWrap);
		this.__wordWrap = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__wordWrap;
	}
	,clearStyle_wordWrap: function() {
		this.set_wordWrap(false);
		return this.get_wordWrap();
	}
	,__disabledTextFormat: null
	,get_disabledTextFormat: function() {
		return this.__disabledTextFormat;
	}
	,set_disabledTextFormat: function(value) {
		if(!this.setStyle("disabledTextFormat")) {
			return this.__disabledTextFormat;
		}
		if(this.__disabledTextFormat == value) {
			return this.__disabledTextFormat;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_disabledTextFormat);
		this.__disabledTextFormat = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__disabledTextFormat;
	}
	,clearStyle_disabledTextFormat: function() {
		this.set_disabledTextFormat(null);
		return this.get_disabledTextFormat();
	}
	,__selectedTextFormat: null
	,get_selectedTextFormat: function() {
		return this.__selectedTextFormat;
	}
	,set_selectedTextFormat: function(value) {
		if(!this.setStyle("selectedTextFormat")) {
			return this.__selectedTextFormat;
		}
		if(this.__selectedTextFormat == value) {
			return this.__selectedTextFormat;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_selectedTextFormat);
		this.__selectedTextFormat = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__selectedTextFormat;
	}
	,clearStyle_selectedTextFormat: function() {
		this.set_selectedTextFormat(null);
		return this.get_selectedTextFormat();
	}
	,__iconPosition: null
	,get_iconPosition: function() {
		return this.__iconPosition;
	}
	,set_iconPosition: function(value) {
		if(!this.setStyle("iconPosition")) {
			return this.__iconPosition;
		}
		if(this.__iconPosition == value) {
			return this.__iconPosition;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_iconPosition);
		this.__iconPosition = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__iconPosition;
	}
	,clearStyle_iconPosition: function() {
		this.set_iconPosition(feathers_layout_RelativePosition.LEFT);
		return this.get_iconPosition();
	}
	,__gap: null
	,get_gap: function() {
		return this.__gap;
	}
	,set_gap: function(value) {
		if(!this.setStyle("gap")) {
			return this.__gap;
		}
		if(this.__gap == value) {
			return this.__gap;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_gap);
		this.__gap = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__gap;
	}
	,clearStyle_gap: function() {
		this.set_gap(0.0);
		return this.get_gap();
	}
	,__minGap: null
	,get_minGap: function() {
		return this.__minGap;
	}
	,set_minGap: function(value) {
		if(!this.setStyle("minGap")) {
			return this.__minGap;
		}
		if(this.__minGap == value) {
			return this.__minGap;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_minGap);
		this.__minGap = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__minGap;
	}
	,clearStyle_minGap: function() {
		this.set_minGap(0.0);
		return this.get_minGap();
	}
	,__paddingTop: null
	,get_paddingTop: function() {
		return this.__paddingTop;
	}
	,set_paddingTop: function(value) {
		if(!this.setStyle("paddingTop")) {
			return this.__paddingTop;
		}
		if(this.__paddingTop == value) {
			return this.__paddingTop;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_paddingTop);
		this.__paddingTop = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__paddingTop;
	}
	,clearStyle_paddingTop: function() {
		this.set_paddingTop(0.0);
		return this.get_paddingTop();
	}
	,__paddingRight: null
	,get_paddingRight: function() {
		return this.__paddingRight;
	}
	,set_paddingRight: function(value) {
		if(!this.setStyle("paddingRight")) {
			return this.__paddingRight;
		}
		if(this.__paddingRight == value) {
			return this.__paddingRight;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_paddingRight);
		this.__paddingRight = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__paddingRight;
	}
	,clearStyle_paddingRight: function() {
		this.set_paddingRight(0.0);
		return this.get_paddingRight();
	}
	,__paddingBottom: null
	,get_paddingBottom: function() {
		return this.__paddingBottom;
	}
	,set_paddingBottom: function(value) {
		if(!this.setStyle("paddingBottom")) {
			return this.__paddingBottom;
		}
		if(this.__paddingBottom == value) {
			return this.__paddingBottom;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_paddingBottom);
		this.__paddingBottom = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__paddingBottom;
	}
	,clearStyle_paddingBottom: function() {
		this.set_paddingBottom(0.0);
		return this.get_paddingBottom();
	}
	,__paddingLeft: null
	,get_paddingLeft: function() {
		return this.__paddingLeft;
	}
	,set_paddingLeft: function(value) {
		if(!this.setStyle("paddingLeft")) {
			return this.__paddingLeft;
		}
		if(this.__paddingLeft == value) {
			return this.__paddingLeft;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_paddingLeft);
		this.__paddingLeft = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__paddingLeft;
	}
	,clearStyle_paddingLeft: function() {
		this.set_paddingLeft(0.0);
		return this.get_paddingLeft();
	}
	,__horizontalAlign: null
	,get_horizontalAlign: function() {
		return this.__horizontalAlign;
	}
	,set_horizontalAlign: function(value) {
		if(!this.setStyle("horizontalAlign")) {
			return this.__horizontalAlign;
		}
		if(this.__horizontalAlign == value) {
			return this.__horizontalAlign;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_horizontalAlign);
		this.__horizontalAlign = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__horizontalAlign;
	}
	,clearStyle_horizontalAlign: function() {
		this.set_horizontalAlign(feathers_layout_HorizontalAlign.CENTER);
		return this.get_horizontalAlign();
	}
	,__verticalAlign: null
	,get_verticalAlign: function() {
		return this.__verticalAlign;
	}
	,set_verticalAlign: function(value) {
		if(!this.setStyle("verticalAlign")) {
			return this.__verticalAlign;
		}
		if(this.__verticalAlign == value) {
			return this.__verticalAlign;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_verticalAlign);
		this.__verticalAlign = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__verticalAlign;
	}
	,clearStyle_verticalAlign: function() {
		this.set_verticalAlign(feathers_layout_VerticalAlign.MIDDLE);
		return this.get_verticalAlign();
	}
	,__iconOffsetX: null
	,get_iconOffsetX: function() {
		return this.__iconOffsetX;
	}
	,set_iconOffsetX: function(value) {
		if(!this.setStyle("iconOffsetX")) {
			return this.__iconOffsetX;
		}
		if(this.__iconOffsetX == value) {
			return this.__iconOffsetX;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_iconOffsetX);
		this.__iconOffsetX = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__iconOffsetX;
	}
	,clearStyle_iconOffsetX: function() {
		this.set_iconOffsetX(0.0);
		return this.get_iconOffsetX();
	}
	,__iconOffsetY: null
	,get_iconOffsetY: function() {
		return this.__iconOffsetY;
	}
	,set_iconOffsetY: function(value) {
		if(!this.setStyle("iconOffsetY")) {
			return this.__iconOffsetY;
		}
		if(this.__iconOffsetY == value) {
			return this.__iconOffsetY;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_iconOffsetY);
		this.__iconOffsetY = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__iconOffsetY;
	}
	,clearStyle_iconOffsetY: function() {
		this.set_iconOffsetY(0.0);
		return this.get_iconOffsetY();
	}
	,__textOffsetX: null
	,get_textOffsetX: function() {
		return this.__textOffsetX;
	}
	,set_textOffsetX: function(value) {
		if(!this.setStyle("textOffsetX")) {
			return this.__textOffsetX;
		}
		if(this.__textOffsetX == value) {
			return this.__textOffsetX;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_textOffsetX);
		this.__textOffsetX = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__textOffsetX;
	}
	,clearStyle_textOffsetX: function() {
		this.set_textOffsetX(0.0);
		return this.get_textOffsetX();
	}
	,__textOffsetY: null
	,get_textOffsetY: function() {
		return this.__textOffsetY;
	}
	,set_textOffsetY: function(value) {
		if(!this.setStyle("textOffsetY")) {
			return this.__textOffsetY;
		}
		if(this.__textOffsetY == value) {
			return this.__textOffsetY;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_textOffsetY);
		this.__textOffsetY = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__textOffsetY;
	}
	,clearStyle_textOffsetY: function() {
		this.set_textOffsetY(0.0);
		return this.get_textOffsetY();
	}
	,__showText: null
	,get_showText: function() {
		return this.__showText;
	}
	,set_showText: function(value) {
		if(!this.setStyle("showText")) {
			return this.__showText;
		}
		if(this.__showText == value) {
			return this.__showText;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_showText);
		this.__showText = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__showText;
	}
	,clearStyle_showText: function() {
		this.set_showText(true);
		return this.get_showText();
	}
	,__class__: feathers_controls_ToggleButton
	,__properties__: $extend(feathers_controls_BasicToggleButton.prototype.__properties__,{set_showText:"set_showText",get_showText:"get_showText",set_textOffsetY:"set_textOffsetY",get_textOffsetY:"get_textOffsetY",set_textOffsetX:"set_textOffsetX",get_textOffsetX:"get_textOffsetX",set_iconOffsetY:"set_iconOffsetY",get_iconOffsetY:"get_iconOffsetY",set_iconOffsetX:"set_iconOffsetX",get_iconOffsetX:"get_iconOffsetX",set_verticalAlign:"set_verticalAlign",get_verticalAlign:"get_verticalAlign",set_horizontalAlign:"set_horizontalAlign",get_horizontalAlign:"get_horizontalAlign",set_paddingLeft:"set_paddingLeft",get_paddingLeft:"get_paddingLeft",set_paddingBottom:"set_paddingBottom",get_paddingBottom:"get_paddingBottom",set_paddingRight:"set_paddingRight",get_paddingRight:"get_paddingRight",set_paddingTop:"set_paddingTop",get_paddingTop:"get_paddingTop",set_minGap:"set_minGap",get_minGap:"get_minGap",set_gap:"set_gap",get_gap:"get_gap",set_iconPosition:"set_iconPosition",get_iconPosition:"get_iconPosition",set_selectedTextFormat:"set_selectedTextFormat",get_selectedTextFormat:"get_selectedTextFormat",set_disabledTextFormat:"set_disabledTextFormat",get_disabledTextFormat:"get_disabledTextFormat",set_wordWrap:"set_wordWrap",get_wordWrap:"get_wordWrap",set_embedFonts:"set_embedFonts",get_embedFonts:"get_embedFonts",set_styleSheet:"set_styleSheet",get_styleSheet:"get_styleSheet",set_textFormat:"set_textFormat",get_textFormat:"get_textFormat",set_selectedIcon:"set_selectedIcon",get_selectedIcon:"get_selectedIcon",set_disabledIcon:"set_disabledIcon",get_disabledIcon:"get_disabledIcon",set_icon:"set_icon",get_icon:"get_icon",get_baseline:"get_baseline",set_htmlText:"set_htmlText",get_htmlText:"get_htmlText",set_text:"set_text",get_text:"get_text"})
});
var feathers_controls_Check = function(text,selected,changeListener) {
	if(selected == null) {
		selected = false;
	}
	this.initializeCheckTheme();
	feathers_controls_ToggleButton.call(this,text,selected,changeListener);
};
$hxClasses["feathers.controls.Check"] = feathers_controls_Check;
feathers_controls_Check.__name__ = "feathers.controls.Check";
feathers_controls_Check.__super__ = feathers_controls_ToggleButton;
feathers_controls_Check.prototype = $extend(feathers_controls_ToggleButton.prototype,{
	initializeCheckTheme: function() {
		feathers_themes_steel_components_SteelCheckStyles.initialize();
	}
	,get_styleContext: function() {
		return feathers_controls_Check;
	}
	,__class__: feathers_controls_Check
});
var feathers_controls_Collapsible = function(text,content) {
	this.__animateContentAlpha = false;
	this.__openCloseDuration = 0.2;
	this.__customHeaderVariant = null;
	this.openCloseEase = motion_easing_Quart.easeOut;
	this._previousCustomHeaderVariant = null;
	this._animateOpenedProperty = true;
	this._opened = true;
	this._pendingAnimation = false;
	this._pendingOpened = null;
	this._ignoreContentResize = false;
	this._contentOriginalAlpha = 1.0;
	this._contentMeasurements = new feathers_layout_Measurements();
	this._scrollRect2 = new openfl_geom_Rectangle();
	this._scrollRect1 = new openfl_geom_Rectangle();
	this._ignoreHeaderEvents = false;
	this.headerMeasurements = new feathers_layout_Measurements();
	this._measuredOpenHeight = 0.0;
	this._pendingHeight = null;
	this._collapseActuator = null;
	this.initializeCollapsibleTheme();
	feathers_core_FeathersControl.call(this);
	this.set_text(text);
	this.set_content(content);
};
$hxClasses["feathers.controls.Collapsible"] = feathers_controls_Collapsible;
feathers_controls_Collapsible.__name__ = "feathers.controls.Collapsible";
feathers_controls_Collapsible.__interfaces__ = [feathers_core_IOpenCloseToggle];
feathers_controls_Collapsible.__super__ = feathers_core_FeathersControl;
feathers_controls_Collapsible.prototype = $extend(feathers_core_FeathersControl.prototype,{
	_collapseActuator: null
	,_pendingHeight: null
	,_measuredOpenHeight: null
	,header: null
	,headerMeasurements: null
	,_ignoreHeaderEvents: null
	,_currentScrollRect: null
	,_scrollRect1: null
	,_scrollRect2: null
	,_contentMeasurements: null
	,_contentOriginalAlpha: null
	,_ignoreContentResize: null
	,_content: null
	,get_content: function() {
		return this._content;
	}
	,set_content: function(value) {
		if(this._content == value) {
			return this._content;
		}
		if(this._content != null) {
			this._content.removeEventListener("resize",$bind(this,this.collapsible_content_resizeHandler));
			this._content.set_alpha(this._contentOriginalAlpha);
			this._contentMeasurements.restore(this._content);
			this.removeChild(this._content);
		}
		this._content = value;
		if(this._content != null) {
			this.addChild(this._content);
			this._contentMeasurements.save(this._content);
			this._contentOriginalAlpha = this._content.get_alpha();
			this._content.addEventListener("resize",$bind(this,this.collapsible_content_resizeHandler));
		}
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		return this._content;
	}
	,_text: null
	,get_text: function() {
		return this._text;
	}
	,set_text: function(value) {
		if(this._text == value) {
			return this._text;
		}
		this._text = value;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		return this._text;
	}
	,_pendingOpened: null
	,_pendingAnimation: null
	,_opened: null
	,get_opened: function() {
		if(this._pendingOpened != null) {
			return this._pendingOpened;
		}
		return this._opened;
	}
	,set_opened: function(value) {
		if(value) {
			this.openContent(this._animateOpenedProperty);
		} else {
			this.closeContent(this._animateOpenedProperty);
		}
		if(this._pendingOpened != null) {
			return this._pendingOpened;
		}
		return this._opened;
	}
	,_animateOpenedProperty: null
	,get_animateOpenedProperty: function() {
		return this._animateOpenedProperty;
	}
	,set_animateOpenedProperty: function(value) {
		this._animateOpenedProperty = value;
		return this._animateOpenedProperty;
	}
	,_oldHeaderFactory: null
	,_headerFactory: null
	,get_headerFactory: function() {
		return this._headerFactory;
	}
	,set_headerFactory: function(value) {
		if(this._headerFactory == value) {
			return this._headerFactory;
		}
		this._headerFactory = value;
		this.setInvalid(feathers_controls_Collapsible.INVALIDATION_FLAG_HEADER_FACTORY);
		return this._headerFactory;
	}
	,_previousCustomHeaderVariant: null
	,openCloseEase: null
	,dispose: function() {
		if(this._collapseActuator != null) {
			motion_Actuate.stop(this._collapseActuator);
			this._collapseActuator = null;
		}
		this.set_content(null);
		this.destroyHeader();
		feathers_core_FeathersControl.prototype.dispose.call(this);
	}
	,openContent: function(animate) {
		if(animate == null) {
			animate = true;
		}
		this._pendingAnimation = animate;
		if(this._pendingOpened != null && this._pendingOpened) {
			return;
		}
		var result = feathers_events_FeathersEvent.dispatch(this,"opening",false,true);
		if(!result) {
			return;
		}
		this._pendingOpened = true;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
	}
	,closeContent: function(animate) {
		if(animate == null) {
			animate = true;
		}
		this._pendingAnimation = animate;
		if(this._pendingOpened != null && !this._pendingOpened) {
			return;
		}
		var result = feathers_events_FeathersEvent.dispatch(this,"closing",false,true);
		if(!result) {
			return;
		}
		this._pendingOpened = false;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
	}
	,initializeCollapsibleTheme: function() {
		feathers_themes_steel_components_SteelCollapsibleStyles.initialize();
	}
	,update: function() {
		if(this._previousCustomHeaderVariant != this.get_customHeaderVariant()) {
			this.setInvalidationFlag(feathers_controls_Collapsible.INVALIDATION_FLAG_HEADER_FACTORY);
		}
		var dataInvalid = this.isInvalid(feathers_core_InvalidationFlag.DATA);
		var headerFactoryInvalid = this.isInvalid(feathers_controls_Collapsible.INVALIDATION_FLAG_HEADER_FACTORY);
		if(headerFactoryInvalid) {
			this.createHeader();
		}
		if(dataInvalid) {
			this.updateText();
			this.updateOpened();
		}
		this.measure();
		this.layoutChildren();
		this._previousCustomHeaderVariant = this.get_customHeaderVariant();
	}
	,measure: function() {
		var measureHeader = null;
		if(js_Boot.__implements(this.header,feathers_core_IMeasureObject)) {
			measureHeader = this.header;
		}
		feathers_utils_MeasurementsUtil.resetFluidlyWithParentValues(this.headerMeasurements,this.header,this.get_explicitWidth(),null,this.get_explicitMinWidth(),null,this.get_explicitMaxWidth(),null);
		if(js_Boot.__implements(this.header,feathers_core_IValidating)) {
			this.header.validateNow();
		}
		var measureContent = null;
		if(this._content != null) {
			if(js_Boot.__implements(this._content,feathers_core_IMeasureObject)) {
				measureContent = this._content;
			}
			feathers_utils_MeasurementsUtil.resetFluidlyWithParentValues(this._contentMeasurements,this._content,this.get_explicitWidth(),null,this.get_explicitMinWidth(),null,this.get_explicitMaxWidth(),null);
			if(js_Boot.__implements(this._content,feathers_core_IValidating)) {
				this._content.validateNow();
			}
		}
		this._measuredOpenHeight = this.header.get_height();
		if(this._content != null) {
			this._measuredOpenHeight += this._content.get_height();
		}
		var needsWidth = this.get_explicitWidth() == null;
		var needsHeight = this.get_explicitHeight() == null;
		var needsMinWidth = this.get_explicitMinWidth() == null;
		var needsMinHeight = this.get_explicitMinHeight() == null;
		var needsMaxWidth = this.get_explicitMaxWidth() == null;
		var needsMaxHeight = this.get_explicitMaxHeight() == null;
		if(!needsWidth && !needsHeight && !needsMinWidth && !needsMinHeight && !needsMaxWidth && !needsMaxHeight) {
			return false;
		}
		var newWidth = this.get_explicitWidth();
		if(needsWidth) {
			newWidth = this.header.get_width();
			if(this._content != null) {
				newWidth = Math.max(newWidth,this._content.get_width());
			}
		}
		var newHeight = this.get_explicitHeight();
		if(needsHeight) {
			if(this._pendingHeight != null) {
				newHeight = this._pendingHeight;
			} else if(this._content != null && this._content.get_visible()) {
				newHeight = this._measuredOpenHeight;
			} else {
				newHeight = this.header.get_height();
			}
		}
		var newMinWidth = this.get_explicitMinWidth();
		if(needsMinWidth) {
			if(measureHeader != null) {
				newMinWidth = measureHeader.get_minWidth();
			} else {
				newMinWidth = this.header.get_width();
			}
			if(this._content != null) {
				if(measureContent != null) {
					newMinWidth = Math.max(newMinWidth,measureContent.get_minWidth());
				} else {
					newMinWidth = Math.max(newMinWidth,this._content.get_width());
				}
			}
		}
		var newMinHeight = this.get_explicitMinHeight();
		if(needsMinHeight) {
			newMinHeight = this.header.get_height();
		}
		return this.saveMeasurements(newWidth,newHeight,newMinWidth,newMinHeight);
	}
	,updateText: function() {
		if(js_Boot.__implements(this.header,feathers_core_ITextControl)) {
			this.header.set_text(this._text);
		}
	}
	,updateOpened: function() {
		var _gthis = this;
		if(this._pendingOpened != null) {
			if(this._collapseActuator != null) {
				motion_Actuate.stop(this._collapseActuator);
				this._collapseActuator = null;
				feathers_events_FeathersEvent.dispatch(this,"cancel");
			}
			var oldIgnoreHeaderEvents = this._ignoreHeaderEvents;
			this._ignoreHeaderEvents = true;
			if(js_Boot.__implements(this.header,feathers_core_IOpenCloseToggle)) {
				this.header.set_opened(this._pendingOpened);
			} else if(js_Boot.__implements(this.header,feathers_controls_IToggle)) {
				this.header.set_selected(this._pendingOpened);
			}
			this._ignoreHeaderEvents = oldIgnoreHeaderEvents;
			if(this._pendingAnimation) {
				this._pendingHeight = this.actualHeight;
				if(this._pendingOpened) {
					if(this._content != null) {
						this._content.set_visible(true);
					}
					var targetHeight = this.header.get_height();
					if(this._content != null) {
						targetHeight += this._content.get_height();
					}
					var tween = motion_Actuate.update(function(height,alpha) {
						if(_gthis.get_animateContentAlpha() && _gthis._content != null) {
							_gthis._content.set_alpha(alpha);
						}
						_gthis._pendingHeight = height;
						_gthis.setInvalid(feathers_core_InvalidationFlag.SIZE);
					},this.get_openCloseDuration(),[this.actualHeight,this._content != null ? this._content.get_alpha() : 0.0],[targetHeight,this._contentOriginalAlpha]).ease(this.openCloseEase).onComplete(function() {
						_gthis._pendingHeight = null;
						_gthis.setInvalid(feathers_core_InvalidationFlag.SIZE);
						return feathers_events_FeathersEvent.dispatch(_gthis,"open");
					});
					this._collapseActuator = tween;
				} else {
					if(this._content != null) {
						this._content.set_visible(true);
					}
					var tween = motion_Actuate.update(function(height,alpha) {
						if(_gthis.get_animateContentAlpha() && _gthis._content != null) {
							_gthis._content.set_alpha(alpha);
						}
						_gthis._pendingHeight = height;
						_gthis.setInvalid(feathers_core_InvalidationFlag.SIZE);
					},this.get_openCloseDuration(),[this.actualHeight,this._content != null ? this._content.get_alpha() : 1.0],[this.header.get_height(),0.0]).ease(this.openCloseEase).onComplete(function() {
						_gthis._pendingHeight = null;
						if(_gthis._content != null) {
							_gthis._content.set_visible(false);
						}
						_gthis.setInvalid(feathers_core_InvalidationFlag.SIZE);
						return feathers_events_FeathersEvent.dispatch(_gthis,"close");
					});
					this._collapseActuator = tween;
				}
			} else if(this._content != null) {
				this._content.set_visible(this._pendingOpened);
			}
			this._opened = this._pendingOpened;
			this._pendingOpened = null;
		} else {
			var oldIgnoreHeaderEvents = this._ignoreHeaderEvents;
			this._ignoreHeaderEvents = true;
			if(js_Boot.__implements(this.header,feathers_core_IOpenCloseToggle)) {
				this.header.set_opened(this._opened);
			} else if(js_Boot.__implements(this.header,feathers_controls_IToggle)) {
				this.header.set_selected(this._opened);
			}
			this._ignoreHeaderEvents = oldIgnoreHeaderEvents;
			if(this._content != null) {
				this._content.set_visible(this._opened);
			}
		}
	}
	,createHeader: function() {
		this.destroyHeader();
		var factory = this._headerFactory != null ? this._headerFactory : feathers_controls_Collapsible.defaultHeaderFactory;
		this._oldHeaderFactory = factory;
		this.header = factory.create();
		if(js_Boot.__implements(this.header,feathers_style_IVariantStyleObject)) {
			var styleHeader = this.header;
			if(styleHeader.get_variant() == null) {
				styleHeader.set_variant(this.get_customHeaderVariant() != null ? this.get_customHeaderVariant() : feathers_controls_Collapsible.CHILD_VARIANT_HEADER);
			}
		}
		if(js_Boot.__implements(this.header,feathers_core_IOpenCloseToggle)) {
			this.header.addEventListener("open",$bind(this,this.collapsible_header_openHandler));
			this.header.addEventListener("close",$bind(this,this.collapsible_header_closeHandler));
		} else if(js_Boot.__implements(this.header,feathers_controls_IToggle)) {
			this.header.addEventListener("change",$bind(this,this.collapsible_header_changeHandler));
		} else if(js_Boot.__implements(this.header,feathers_controls_ITriggerView)) {
			this.header.addEventListener("trigger",$bind(this,this.collapsible_header_triggerHandler));
		} else {
			this.header.addEventListener("click",$bind(this,this.collapsible_header_clickHandler));
		}
		if(js_Boot.__implements(this.header,feathers_core_IUIControl)) {
			this.header.initializeNow();
		}
		this.headerMeasurements.save(this.header);
		this.addChild(this.header);
	}
	,destroyHeader: function() {
		if(this.header == null) {
			return;
		}
		this.header.removeEventListener("open",$bind(this,this.collapsible_header_openHandler));
		this.header.removeEventListener("close",$bind(this,this.collapsible_header_closeHandler));
		this.header.removeEventListener("change",$bind(this,this.collapsible_header_changeHandler));
		this.header.removeEventListener("trigger",$bind(this,this.collapsible_header_triggerHandler));
		this.header.removeEventListener("click",$bind(this,this.collapsible_header_clickHandler));
		this.removeChild(this.header);
		if(this._oldHeaderFactory.destroy != null) {
			this._oldHeaderFactory.destroy(this.header);
		}
		this._oldHeaderFactory = null;
		this.header = null;
	}
	,layoutChildren: function() {
		this.header.set_x(0.0);
		this.header.set_y(0.0);
		this.header.set_width(this.actualWidth);
		if(js_Boot.__implements(this.header,feathers_core_IValidating)) {
			this.header.validateNow();
		}
		if(this._content != null) {
			var oldIgnoreContentResize = this._ignoreContentResize;
			this._ignoreContentResize = true;
			this._content.set_x(0.0);
			this._content.set_y(this.header.get_height());
			if(this._content.get_width() != this.actualWidth) {
				this._content.set_width(this.actualWidth);
			}
			var contentHeight = (this._explicitHeight != null ? this._explicitHeight : this._measuredOpenHeight) - this.header.get_height();
			if(contentHeight < 0.0) {
				contentHeight = 0.0;
			}
			if(this._content.get_height() != contentHeight) {
				this._content.set_height(contentHeight);
			}
			if(js_Boot.__implements(this._content,feathers_core_IValidating)) {
				this._content.validateNow();
			}
			if(this._pendingHeight != null) {
				var scrollRect = this._currentScrollRect == this._scrollRect1 ? this._scrollRect2 : this._scrollRect1;
				scrollRect.setTo(0.0,0.0,this.actualWidth,this._pendingHeight - this.header.get_height());
				this._currentScrollRect = scrollRect;
				this._content.set_scrollRect(scrollRect);
			} else if(this._currentScrollRect != null) {
				this._currentScrollRect = null;
				this._content.set_scrollRect(null);
			}
			this._ignoreContentResize = oldIgnoreContentResize;
		}
	}
	,collapsible_header_openHandler: function(event) {
		if(this._ignoreHeaderEvents) {
			return;
		}
		this.openContent(true);
	}
	,collapsible_header_closeHandler: function(event) {
		if(this._ignoreHeaderEvents) {
			return;
		}
		this.closeContent(true);
	}
	,collapsible_header_changeHandler: function(event) {
		if(this._ignoreHeaderEvents) {
			return;
		}
		var toggleHeader = this.header;
		if(toggleHeader.get_selected()) {
			this.openContent(true);
		} else {
			this.closeContent(true);
		}
	}
	,collapsible_header_triggerHandler: function(event) {
		if(this._ignoreHeaderEvents) {
			return;
		}
		if(this._opened) {
			this.closeContent(true);
		} else {
			this.openContent(true);
		}
	}
	,collapsible_header_clickHandler: function(event) {
		if(this._ignoreHeaderEvents) {
			return;
		}
		if(this._opened) {
			this.closeContent(true);
		} else {
			this.openContent(true);
		}
	}
	,collapsible_content_resizeHandler: function(event) {
		this.setInvalid(feathers_core_InvalidationFlag.LAYOUT);
	}
	,__customHeaderVariant: null
	,get_customHeaderVariant: function() {
		return this.__customHeaderVariant;
	}
	,set_customHeaderVariant: function(value) {
		if(!this.setStyle("customHeaderVariant")) {
			return this.__customHeaderVariant;
		}
		if(this.__customHeaderVariant == value) {
			return this.__customHeaderVariant;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_customHeaderVariant);
		this.__customHeaderVariant = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__customHeaderVariant;
	}
	,clearStyle_customHeaderVariant: function() {
		this.set_customHeaderVariant(null);
		return this.get_customHeaderVariant();
	}
	,__openCloseDuration: null
	,get_openCloseDuration: function() {
		return this.__openCloseDuration;
	}
	,set_openCloseDuration: function(value) {
		if(!this.setStyle("openCloseDuration")) {
			return this.__openCloseDuration;
		}
		if(this.__openCloseDuration == value) {
			return this.__openCloseDuration;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_openCloseDuration);
		this.__openCloseDuration = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__openCloseDuration;
	}
	,clearStyle_openCloseDuration: function() {
		this.set_openCloseDuration(0.2);
		return this.get_openCloseDuration();
	}
	,__animateContentAlpha: null
	,get_animateContentAlpha: function() {
		return this.__animateContentAlpha;
	}
	,set_animateContentAlpha: function(value) {
		if(!this.setStyle("animateContentAlpha")) {
			return this.__animateContentAlpha;
		}
		if(this.__animateContentAlpha == value) {
			return this.__animateContentAlpha;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_animateContentAlpha);
		this.__animateContentAlpha = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__animateContentAlpha;
	}
	,clearStyle_animateContentAlpha: function() {
		this.set_animateContentAlpha(false);
		return this.get_animateContentAlpha();
	}
	,get_styleContext: function() {
		return feathers_controls_Collapsible;
	}
	,__class__: feathers_controls_Collapsible
	,__properties__: $extend(feathers_core_FeathersControl.prototype.__properties__,{set_animateContentAlpha:"set_animateContentAlpha",get_animateContentAlpha:"get_animateContentAlpha",set_openCloseDuration:"set_openCloseDuration",get_openCloseDuration:"get_openCloseDuration",set_customHeaderVariant:"set_customHeaderVariant",get_customHeaderVariant:"get_customHeaderVariant",set_headerFactory:"set_headerFactory",get_headerFactory:"get_headerFactory",set_animateOpenedProperty:"set_animateOpenedProperty",get_animateOpenedProperty:"get_animateOpenedProperty",set_opened:"set_opened",get_opened:"get_opened",set_text:"set_text",get_text:"get_text",set_content:"set_content",get_content:"get_content"})
});
var feathers_controls_ComboBox = function(dataProvider,changeListener) {
	this.__customListViewVariant = null;
	this.__customButtonVariant = null;
	this.__customTextInputVariant = null;
	this.__popUpAdapter = new feathers_controls_popups_DropDownPopUpAdapter();
	this.openListViewOnFocus = false;
	this._filterText = null;
	this._previousCustomListViewVariant = null;
	this._previousCustomButtonVariant = null;
	this._previousCustomTextInputVariant = null;
	this._ignoreButtonToggleListView = false;
	this._ignoreListViewChange = false;
	this._ignoreTextInputChange = false;
	this._itemRendererRecycler = feathers_utils_DisplayObjectRecycler.withClass(feathers_controls_dataRenderers_ItemRenderer);
	this._selectedItem = null;
	this._customSelectedItem = null;
	this._selectedIndex = -1;
	this.pendingSelectedIndex = -1;
	this._allowCustomUserValue = true;
	this.textInputMeasurements = new feathers_layout_Measurements();
	this.buttonMeasurements = new feathers_layout_Measurements();
	this.initializeComboBoxTheme();
	feathers_core_FeathersControl.call(this);
	this.set_dataProvider(dataProvider);
	this.addEventListener("focusIn",$bind(this,this.comboBox_focusInHandler));
	this.addEventListener("removedFromStage",$bind(this,this.comboBox_removedFromStageHandler));
	this.addEventListener("keyUp",$bind(this,this.comboBox_keyUpHandler));
	if(changeListener != null) {
		this.addEventListener("change",changeListener);
	}
};
$hxClasses["feathers.controls.ComboBox"] = feathers_controls_ComboBox;
feathers_controls_ComboBox.__name__ = "feathers.controls.ComboBox";
feathers_controls_ComboBox.__interfaces__ = [feathers_core_IStageFocusDelegate,feathers_core_IDataSelector,feathers_core_IIndexSelector];
feathers_controls_ComboBox.__super__ = feathers_core_FeathersControl;
feathers_controls_ComboBox.prototype = $extend(feathers_core_FeathersControl.prototype,{
	button: null
	,textInput: null
	,listView: null
	,buttonMeasurements: null
	,textInputMeasurements: null
	,get_stageFocusTarget: function() {
		return this.textInput;
	}
	,get_text: function() {
		var item = this._customSelectedItem != null ? this._customSelectedItem : this._selectedItem;
		if(item != null) {
			if(typeof(item) == "string") {
				return item;
			} else {
				return this.itemToText(item);
			}
		}
		return "";
	}
	,_dataProvider: null
	,get_dataProvider: function() {
		return this._dataProvider;
	}
	,set_dataProvider: function(value) {
		if(this._dataProvider == value) {
			return this._dataProvider;
		}
		if(this._dataProvider != null) {
			this._dataProvider.removeEventListener("removeAll",$bind(this,this.comboBox_dataProvider_removeAllHandler));
		}
		var oldSelectedIndex = this._selectedIndex;
		var oldSelectedItem = this._selectedItem;
		this._dataProvider = value;
		if(this._dataProvider != null) {
			this._dataProvider.addEventListener("removeAll",$bind(this,this.comboBox_dataProvider_removeAllHandler));
		}
		if(this._dataProvider == null || this._dataProvider.get_length() == 0) {
			this._selectedIndex = -1;
			this._selectedItem = null;
		} else {
			this._selectedIndex = 0;
			this._selectedItem = this._dataProvider.get(0);
		}
		if(this._selectedIndex != oldSelectedIndex || this._selectedItem != oldSelectedItem) {
			this.setInvalid(feathers_core_InvalidationFlag.SELECTION);
			feathers_events_FeathersEvent.dispatch(this,"change");
		}
		if(this._dataProvider != null) {
			this._dataProvider.set_filterFunction($bind(this,this.comboBoxFilterFunction));
		}
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		feathers_events_FeathersEvent.dispatch(this,"dataChange");
		return this._dataProvider;
	}
	,_allowCustomUserValue: null
	,get_allowCustomUserValue: function() {
		return this._allowCustomUserValue;
	}
	,set_allowCustomUserValue: function(value) {
		if(this._allowCustomUserValue == value) {
			return this._allowCustomUserValue;
		}
		this._allowCustomUserValue = value;
		return this._allowCustomUserValue;
	}
	,pendingSelectedIndex: null
	,_selectedIndex: null
	,get_selectedIndex: function() {
		return this._selectedIndex;
	}
	,set_selectedIndex: function(value) {
		if(this._dataProvider == null) {
			value = -1;
		}
		if(this._selectedIndex == value && (!this.get_open() || this.pendingSelectedIndex == value)) {
			return this._selectedIndex;
		}
		this._selectedIndex = value;
		if(this.get_open()) {
			this.pendingSelectedIndex = value;
		}
		if(this._selectedIndex == -1) {
			this._selectedItem = null;
		} else {
			this._selectedItem = this._dataProvider.get(this._selectedIndex);
		}
		this._customSelectedItem = null;
		this.setInvalid(feathers_core_InvalidationFlag.SELECTION);
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._selectedIndex;
	}
	,get_maxSelectedIndex: function() {
		if(this._dataProvider == null) {
			return -1;
		}
		return this._dataProvider.get_length() - 1;
	}
	,_customSelectedItem: null
	,_selectedItem: null
	,get_selectedItem: function() {
		if(this._customSelectedItem != null) {
			return this._customSelectedItem;
		}
		return this._selectedItem;
	}
	,set_selectedItem: function(value) {
		if(value == null || this._dataProvider == null) {
			this.set_selectedIndex(-1);
			return this._selectedItem;
		}
		var index = this._dataProvider.indexOf(value);
		if(index == -1) {
			if(this._allowCustomUserValue) {
				this._selectedIndex = -1;
				this._selectedItem = null;
				this._customSelectedItem = value;
				this.setInvalid(feathers_core_InvalidationFlag.SELECTION);
				feathers_events_FeathersEvent.dispatch(this,"change");
				return this._customSelectedItem;
			}
			this.set_selectedIndex(-1);
			return this._selectedItem;
		}
		if(this._selectedItem == value && this._selectedIndex == index) {
			return this._selectedItem;
		}
		if(this.get_open()) {
			this.pendingSelectedIndex = index;
		}
		this._selectedIndex = index;
		this._selectedItem = value;
		this._customSelectedItem = null;
		this.setInvalid(feathers_core_InvalidationFlag.SELECTION);
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._selectedItem;
	}
	,_prompt: null
	,get_prompt: function() {
		return this._prompt;
	}
	,set_prompt: function(value) {
		if(this._prompt == value) {
			return this._prompt;
		}
		this._prompt = value;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		return this._prompt;
	}
	,_itemRendererRecycler: null
	,get_itemRendererRecycler: function() {
		return this._itemRendererRecycler;
	}
	,set_itemRendererRecycler: function(value) {
		if(this._itemRendererRecycler == value) {
			return this._itemRendererRecycler;
		}
		this._itemRendererRecycler = value;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		return this._itemRendererRecycler;
	}
	,itemToText: function(data) {
		return Std.string(data);
	}
	,itemToEnabled: function(data) {
		return true;
	}
	,textToItem: function(text) {
		return text;
	}
	,_ignoreTextInputChange: null
	,_ignoreListViewChange: null
	,_ignoreButtonToggleListView: null
	,_previousCustomTextInputVariant: null
	,_previousCustomButtonVariant: null
	,_previousCustomListViewVariant: null
	,_oldButtonFactory: null
	,_buttonFactory: null
	,get_buttonFactory: function() {
		return this._buttonFactory;
	}
	,set_buttonFactory: function(value) {
		if(this._buttonFactory == value) {
			return this._buttonFactory;
		}
		this._buttonFactory = value;
		this.setInvalid(feathers_controls_ComboBox.INVALIDATION_FLAG_BUTTON_FACTORY);
		return this._buttonFactory;
	}
	,_oldTextInputFactory: null
	,_textInputFactory: null
	,get_textInputFactory: function() {
		return this._textInputFactory;
	}
	,set_textInputFactory: function(value) {
		if(this._textInputFactory == value) {
			return this._textInputFactory;
		}
		this._textInputFactory = value;
		this.setInvalid(feathers_controls_ComboBox.INVALIDATION_FLAG_TEXT_INPUT_FACTORY);
		return this._textInputFactory;
	}
	,_oldListViewFactory: null
	,_listViewFactory: null
	,get_listViewFactory: function() {
		return this._listViewFactory;
	}
	,set_listViewFactory: function(value) {
		if(this._listViewFactory == value) {
			return this._listViewFactory;
		}
		this._listViewFactory = value;
		this.setInvalid(feathers_controls_ComboBox.INVALIDATION_FLAG_LIST_VIEW_FACTORY);
		return this._listViewFactory;
	}
	,get_open: function() {
		if(this.listView != null) {
			return this.listView.parent != null;
		} else {
			return false;
		}
	}
	,_filterText: null
	,showFocus: function(show) {
		feathers_core_FeathersControl.prototype.showFocus.call(this,show);
		if(this.textInput != null) {
			this.textInput.showFocus(show);
		}
	}
	,openListViewOnFocus: null
	,openListView: function() {
		if(this.get_open() || this.stage == null) {
			return;
		}
		this.validateNow();
		this._filterText = null;
		if(this._dataProvider != null) {
			this._dataProvider.refresh();
		}
		this.pendingSelectedIndex = this._selectedIndex;
		this.get_popUpAdapter().addEventListener("open",$bind(this,this.comboBox_popUpAdapter_openHandler));
		this.get_popUpAdapter().addEventListener("close",$bind(this,this.comboBox_popUpAdapter_closeHandler));
		this.get_popUpAdapter().open(this.listView,this);
		this.listView.set_visible(this._dataProvider != null && this._dataProvider.get_length() > 0);
		this.listView.validateNow();
		this.listView.addEventListener("removedFromStage",$bind(this,this.comboBox_listView_removedFromStageHandler));
		this.textInput.addEventListener("focusOut",$bind(this,this.comboBox_textInput_focusOutHandler));
		this.stage.addEventListener("mouseDown",$bind(this,this.comboBox_stage_mouseDownHandler),false,0,true);
		this.stage.addEventListener("touchBegin",$bind(this,this.comboBox_stage_touchBeginHandler),false,0,true);
		this.listView.scrollToIndex(this._selectedIndex);
	}
	,closeListView: function() {
		if(!this.get_open()) {
			return;
		}
		this.get_popUpAdapter().close();
	}
	,dispose: function() {
		this.destroyButton();
		this.destroyTextInput();
		this.destroyListView();
		this._selectedItem = null;
		this._selectedIndex = -1;
		this.set_dataProvider(null);
		feathers_core_FeathersControl.prototype.dispose.call(this);
	}
	,initializeComboBoxTheme: function() {
		feathers_themes_steel_components_SteelComboBoxStyles.initialize();
	}
	,update: function() {
		var dataInvalid = this.isInvalid(feathers_core_InvalidationFlag.DATA);
		var selectionInvalid = this.isInvalid(feathers_core_InvalidationFlag.SELECTION);
		var stateInvalid = this.isInvalid(feathers_core_InvalidationFlag.STATE);
		if(this._previousCustomTextInputVariant != this.get_customTextInputVariant()) {
			this.setInvalidationFlag(feathers_controls_ComboBox.INVALIDATION_FLAG_TEXT_INPUT_FACTORY);
		}
		if(this._previousCustomButtonVariant != this.get_customButtonVariant()) {
			this.setInvalidationFlag(feathers_controls_ComboBox.INVALIDATION_FLAG_BUTTON_FACTORY);
		}
		if(this._previousCustomListViewVariant != this.get_customListViewVariant()) {
			this.setInvalidationFlag(feathers_controls_ComboBox.INVALIDATION_FLAG_LIST_VIEW_FACTORY);
		}
		var buttonFactoryInvalid = this.isInvalid(feathers_controls_ComboBox.INVALIDATION_FLAG_BUTTON_FACTORY);
		var textInputFactoryInvalid = this.isInvalid(feathers_controls_ComboBox.INVALIDATION_FLAG_TEXT_INPUT_FACTORY);
		var listViewFactoryInvalid = this.isInvalid(feathers_controls_ComboBox.INVALIDATION_FLAG_LIST_VIEW_FACTORY);
		if(buttonFactoryInvalid) {
			this.createButton();
		}
		if(textInputFactoryInvalid) {
			this.createTextInput();
		}
		if(listViewFactoryInvalid) {
			this.createListView();
		}
		if(dataInvalid || listViewFactoryInvalid) {
			this.refreshListViewData();
		}
		if(dataInvalid || textInputFactoryInvalid) {
			this.refreshTextInputData();
		}
		if(selectionInvalid || listViewFactoryInvalid || buttonFactoryInvalid || textInputFactoryInvalid) {
			this.refreshSelection();
		}
		if(stateInvalid || listViewFactoryInvalid || buttonFactoryInvalid || textInputFactoryInvalid) {
			this.refreshEnabled();
		}
		this.measure();
		this.layoutChildren();
		this._previousCustomTextInputVariant = this.get_customTextInputVariant();
		this._previousCustomButtonVariant = this.get_customButtonVariant();
		this._previousCustomListViewVariant = this.get_customListViewVariant();
	}
	,createButton: function() {
		this.destroyButton();
		var factory = this._buttonFactory != null ? this._buttonFactory : feathers_controls_ComboBox.defaultButtonFactory;
		this._oldButtonFactory = factory;
		this.button = factory.create();
		if(this.button.get_variant() == null) {
			this.button.set_variant(this.get_customButtonVariant() != null ? this.get_customButtonVariant() : feathers_controls_ComboBox.CHILD_VARIANT_BUTTON);
		}
		this.button.set_focusEnabled(false);
		this.button.addEventListener("mouseDown",$bind(this,this.comboBox_button_mouseDownHandler));
		this.button.addEventListener("touchBegin",$bind(this,this.comboBox_button_touchBeginHandler));
		this.button.initializeNow();
		this.buttonMeasurements.save(this.button);
		this.addChild(this.button);
	}
	,destroyButton: function() {
		if(this.button == null) {
			return;
		}
		this.button.removeEventListener("mouseDown",$bind(this,this.comboBox_button_mouseDownHandler));
		this.button.removeEventListener("touchBegin",$bind(this,this.comboBox_button_touchBeginHandler));
		this.removeChild(this.button);
		if(this._oldButtonFactory.destroy != null) {
			this._oldButtonFactory.destroy(this.button);
		}
		this._oldButtonFactory = null;
		this.button = null;
	}
	,createTextInput: function() {
		this.destroyTextInput();
		var factory = this._textInputFactory != null ? this._textInputFactory : feathers_controls_ComboBox.defaultTextInputFactory;
		this._oldTextInputFactory = factory;
		this.textInput = factory.create();
		if(this.textInput.get_variant() == null) {
			this.textInput.set_variant(this.get_customTextInputVariant() != null ? this.get_customTextInputVariant() : feathers_controls_ComboBox.CHILD_VARIANT_TEXT_INPUT);
		}
		this.textInput.addEventListener("change",$bind(this,this.comboBox_textInput_changeHandler));
		this.textInput.addEventListener("keyDown",$bind(this,this.comboBox_textInput_keyDownHandler));
		this.textInput.addEventListener("focusIn",$bind(this,this.comboBox_textInput_focusInHandler));
		this.textInput.addEventListener("mouseDown",$bind(this,this.comboBox_textInput_mouseDownHandler));
		this.textInput.addEventListener("mouseFocusChange",$bind(this,this.comboBox_textInput_mouseFocusChangeHandler));
		this.textInput.initializeNow();
		this.textInputMeasurements.save(this.textInput);
		this.addChild(this.textInput);
	}
	,destroyTextInput: function() {
		if(this.textInput == null) {
			return;
		}
		this.textInput.removeEventListener("change",$bind(this,this.comboBox_textInput_changeHandler));
		this.textInput.removeEventListener("keyDown",$bind(this,this.comboBox_textInput_keyDownHandler));
		this.textInput.removeEventListener("focusIn",$bind(this,this.comboBox_textInput_focusInHandler));
		this.textInput.removeEventListener("mouseDown",$bind(this,this.comboBox_textInput_mouseDownHandler));
		this.textInput.removeEventListener("mouseFocusChange",$bind(this,this.comboBox_textInput_mouseFocusChangeHandler));
		this.removeChild(this.textInput);
		if(this._oldTextInputFactory.destroy != null) {
			this._oldTextInputFactory.destroy(this.textInput);
		}
		this._oldTextInputFactory = null;
		this.textInput = null;
	}
	,createListView: function() {
		this.destroyListView();
		var factory = this._listViewFactory != null ? this._listViewFactory : feathers_controls_ComboBox.defaultListViewFactory;
		this._oldListViewFactory = factory;
		this.listView = factory.create();
		this.listView.set_focusOwner(this);
		this.listView.set_focusEnabled(false);
		if(this.listView.get_variant() == null) {
			this.listView.set_variant(this.get_customListViewVariant() != null ? this.get_customListViewVariant() : feathers_controls_ComboBox.CHILD_VARIANT_LIST_VIEW);
		}
		this.listView.addEventListener("change",$bind(this,this.comboBox_listView_changeHandler));
		this.listView.addEventListener("itemTrigger",$bind(this,this.comboBox_listView_itemTriggerHandler));
	}
	,destroyListView: function() {
		if(this.listView == null) {
			return;
		}
		this.listView.removeEventListener("change",$bind(this,this.comboBox_listView_changeHandler));
		this.listView.removeEventListener("itemTrigger",$bind(this,this.comboBox_listView_itemTriggerHandler));
		this.listView.set_focusOwner(null);
		if(this._oldListViewFactory.destroy != null) {
			this._oldListViewFactory.destroy(this.listView);
		}
		this._oldListViewFactory = null;
		this.listView = null;
	}
	,refreshListViewData: function() {
		var oldIgnoreListViewChange = this._ignoreListViewChange;
		this._ignoreListViewChange = true;
		this.listView.set_dataProvider(this._dataProvider);
		this._ignoreListViewChange = oldIgnoreListViewChange;
		this.listView.set_itemRendererRecycler(this._itemRendererRecycler);
		this.listView.itemToEnabled = $bind(this,this.itemToEnabled);
		this.listView.itemToText = $bind(this,this.itemToText);
	}
	,refreshTextInputData: function() {
		this.textInput.set_prompt(this._prompt);
	}
	,refreshSelection: function() {
		var oldIgnoreListViewChange = this._ignoreListViewChange;
		this._ignoreListViewChange = true;
		this.listView.set_selectedIndex(this._selectedIndex);
		this._ignoreListViewChange = oldIgnoreListViewChange;
		var oldIgnoreTextInputChange = this._ignoreTextInputChange;
		this._ignoreTextInputChange = true;
		var item = this._customSelectedItem != null ? this._customSelectedItem : this._selectedItem;
		if(item != null) {
			this.textInput.set_text(typeof(item) == "string" ? item : this.itemToText(item));
		} else {
			this.textInput.set_text("");
		}
		this._ignoreTextInputChange = oldIgnoreTextInputChange;
	}
	,refreshEnabled: function() {
		this.button.set_enabled(this._enabled);
		this.textInput.set_enabled(this._enabled);
		this.listView.set_enabled(this._enabled);
	}
	,comboBoxFilterFunction: function(item) {
		if(this._filterText == null || this._filterText.length == 0) {
			return true;
		}
		var itemText = typeof(item) == "string" ? item : this.itemToText(item);
		itemText = itemText.toLowerCase();
		return itemText.indexOf(this._filterText.toLowerCase()) != -1;
	}
	,measure: function() {
		var needsWidth = this.get_explicitWidth() == null;
		var needsHeight = this.get_explicitHeight() == null;
		var needsMinWidth = this.get_explicitMinWidth() == null;
		var needsMinHeight = this.get_explicitMinHeight() == null;
		var needsMaxWidth = this.get_explicitMaxWidth() == null;
		var needsMaxHeight = this.get_explicitMaxHeight() == null;
		if(!needsWidth && !needsHeight && !needsMinWidth && !needsMinHeight && !needsMaxWidth && !needsMaxHeight) {
			return false;
		}
		this.buttonMeasurements.restore(this.button);
		this.button.validateNow();
		this.textInputMeasurements.restore(this.textInput);
		this.textInput.validateNow();
		var newWidth = this.get_explicitWidth();
		if(needsWidth) {
			newWidth = this.button.get_width() + this.textInput.get_width();
		}
		var newHeight = this.get_explicitHeight();
		if(needsHeight) {
			newHeight = Math.max(this.button.get_height(),this.textInput.get_height());
		}
		var newMinWidth = this.get_explicitMinWidth();
		if(needsMinWidth) {
			newMinWidth = this.button.get_minWidth() + this.textInput.get_minWidth();
		}
		var newMinHeight = this.get_explicitMinHeight();
		if(needsMinHeight) {
			newMinHeight = Math.max(this.button.get_minHeight(),this.textInput.get_minHeight());
		}
		return this.saveMeasurements(newWidth,newHeight,newMinWidth,newMinHeight);
	}
	,layoutChildren: function() {
		this.button.validateNow();
		this.button.set_x(this.actualWidth - this.button.get_width());
		this.button.set_y(0.0);
		if(this.button.get_height() != this.actualHeight) {
			this.button.set_height(this.actualHeight);
		}
		this.textInput.set_x(0.0);
		this.textInput.set_y(0.0);
		var textInputWidth = this.actualWidth - this.button.get_width();
		if(this.textInput.get_width() != textInputWidth) {
			this.textInput.set_width(textInputWidth);
		}
		if(this.textInput.get_height() != this.actualHeight) {
			this.textInput.set_height(this.actualHeight);
		}
		this.button.validateNow();
		this.textInput.validateNow();
	}
	,navigateWithKeyboard: function(event) {
		if(event.isDefaultPrevented()) {
			return;
		}
		if(this._dataProvider == null || this._dataProvider.get_length() == 0) {
			return;
		}
		var result = this.get_open() ? this.pendingSelectedIndex : this._selectedIndex;
		switch(event.keyCode) {
		case 33:
			--result;
			break;
		case 34:
			++result;
			break;
		case 35:
			result = this._dataProvider.get_length() - 1;
			break;
		case 36:
			result = 0;
			break;
		case 38:
			--result;
			break;
		case 40:
			++result;
			break;
		default:
			return;
		}
		if(result < 0) {
			result = 0;
		} else if(result >= this._dataProvider.get_length()) {
			result = this._dataProvider.get_length() - 1;
		}
		event.preventDefault();
		this.set_selectedIndex(result);
		if(this.textInput.get_selectionActiveIndex() != this.textInput.get_selectionAnchorIndex()) {
			this.textInput.selectRange(this.textInput.get_selectionAnchorIndex(),this.textInput.get_selectionAnchorIndex());
		}
		if(this.get_open()) {
			this.listView.set_selectedIndex(result);
			this.listView.scrollToIndex(result);
		}
	}
	,comboBox_textInput_keyDownHandler: function(event) {
		if(!this._enabled) {
			return;
		}
		this.navigateWithKeyboard(event);
		if(event.keyCode == 13) {
			event.preventDefault();
			var itemState = this.listView.itemToItemState(this.listView.get_selectedItem());
			if(itemState != null) {
				feathers_events_ListViewEvent.dispatch(this,"itemTrigger",itemState);
			}
			this.closeListView();
		}
	}
	,comboBox_textInput_changeHandler: function(event) {
		if(this._ignoreTextInputChange) {
			return;
		}
		if(!this.get_open()) {
			this.openListView();
		}
		if(this._dataProvider != null) {
			this.pendingSelectedIndex = -1;
			this._filterText = this.textInput.get_text();
			this._dataProvider.refresh();
		}
		this.listView.set_visible(this.get_open() && this._dataProvider != null && this._dataProvider.get_length() > 0);
	}
	,comboBox_textInput_mouseFocusChangeHandler: function(event) {
		if(this.get_focusManager() != null || event.isDefaultPrevented() || event.target != null && !this.textInput.contains(event.target) || event.relatedObject != null && !this.listView.contains(event.relatedObject)) {
			return;
		}
		event.preventDefault();
	}
	,comboBox_textInput_focusInHandler: function(event) {
		if(!this._enabled) {
			return;
		}
		if(this.openListViewOnFocus && !this.get_open()) {
			this.openListView();
			this._ignoreButtonToggleListView = true;
			this.addEventListener("enterFrame",$bind(this,this.comboBox_focus_enterFrameHandler));
		}
	}
	,comboBox_focus_enterFrameHandler: function(event) {
		this.removeEventListener("enterFrame",$bind(this,this.comboBox_focus_enterFrameHandler));
		this._ignoreButtonToggleListView = false;
	}
	,comboBox_textInput_focusOutHandler: function(event) {
		if(event.relatedObject != null && (event.relatedObject == this.listView || this.listView.contains(event.relatedObject))) {
			return;
		}
		this.closeListView();
	}
	,comboBox_button_mouseDownHandler: function(event) {
		if(this.openListViewOnFocus && this.get_open() && this._ignoreButtonToggleListView) {
			return;
		}
		if(!this._enabled) {
			return;
		}
		if(this.get_open()) {
			this.closeListView();
		} else {
			this.openListView();
		}
	}
	,comboBox_button_touchBeginHandler: function(event) {
		if(this.openListViewOnFocus && this.get_open() && this._ignoreButtonToggleListView) {
			return;
		}
		if(!this._enabled) {
			return;
		}
		if(event.isPrimaryTouchPoint) {
			return;
		}
		if(this.get_open()) {
			this.closeListView();
		} else {
			this.openListView();
		}
	}
	,comboBox_listView_itemTriggerHandler: function(event) {
		this._filterText = null;
		this.pendingSelectedIndex = event.state.index;
		this.dispatchEvent(event);
		if(!this.get_popUpAdapter().get_persistent()) {
			this.closeListView();
		}
	}
	,comboBox_listView_changeHandler: function(event) {
		if(this._ignoreListViewChange) {
			return;
		}
		if(this.get_open()) {
			this.pendingSelectedIndex = this.listView.get_selectedIndex();
		} else {
			this.pendingSelectedIndex = -1;
			this._filterText = null;
			if(this._selectedIndex != this.listView.get_selectedIndex() || this._selectedItem != this.listView.get_selectedItem()) {
				this._selectedIndex = this.listView.get_selectedIndex();
				this._selectedItem = this.listView.get_selectedItem();
				feathers_events_FeathersEvent.dispatch(this,"change");
			}
			this.setInvalid(feathers_core_InvalidationFlag.SELECTION);
		}
	}
	,comboBox_listView_removedFromStageHandler: function(event) {
		this.listView.removeEventListener("removedFromStage",$bind(this,this.comboBox_listView_removedFromStageHandler));
		this.textInput.removeEventListener("focusOut",$bind(this,this.comboBox_textInput_focusOutHandler));
		this.stage.removeEventListener("mouseDown",$bind(this,this.comboBox_stage_mouseDownHandler));
		this.stage.removeEventListener("touchBegin",$bind(this,this.comboBox_stage_touchBeginHandler));
	}
	,comboBox_focusInHandler: function(event) {
		if(this.stage != null && this.stage.get_focus() != null && this.textInput != null && !this.textInput.contains(this.stage.get_focus())) {
			event.stopImmediatePropagation();
			this.stage.set_focus(this.textInput);
		}
	}
	,comboBox_removedFromStageHandler: function(event) {
		this.closeListView();
	}
	,comboBox_keyUpHandler: function(event) {
		if(!this._enabled) {
			return;
		}
		switch(event.keyCode) {
		case 27:
			if(event.isDefaultPrevented()) {
				return;
			}
			if(!this.get_open()) {
				return;
			}
			event.preventDefault();
			this.closeListView();
			break;
		case 1073742094:
			if(event.isDefaultPrevented()) {
				return;
			}
			if(!this.get_open()) {
				return;
			}
			event.preventDefault();
			this.closeListView();
			break;
		}
	}
	,comboBox_stage_mouseDownHandler: function(event) {
		if(this.hitTestPoint(event.stageX,event.stageY) || this.listView.hitTestPoint(event.stageX,event.stageY)) {
			return;
		}
		this.closeListView();
	}
	,comboBox_stage_touchBeginHandler: function(event) {
		if(event.isPrimaryTouchPoint) {
			return;
		}
		if(this.hitTestPoint(event.stageX,event.stageY) || this.listView.hitTestPoint(event.stageX,event.stageY)) {
			return;
		}
		this.closeListView();
	}
	,comboBox_popUpAdapter_openHandler: function(event) {
		feathers_events_FeathersEvent.dispatch(this,"open");
	}
	,comboBox_popUpAdapter_closeHandler: function(event) {
		this.get_popUpAdapter().removeEventListener("open",$bind(this,this.comboBox_popUpAdapter_openHandler));
		this.get_popUpAdapter().removeEventListener("close",$bind(this,this.comboBox_popUpAdapter_closeHandler));
		var pendingSelectedIndex = this.pendingSelectedIndex;
		var filterText = this._filterText;
		this.pendingSelectedIndex = -1;
		this._filterText = null;
		var oldSelectedIndex = this._selectedIndex;
		feathers_events_FeathersEvent.dispatch(this,"close");
		if(this._selectedIndex != oldSelectedIndex) {
			pendingSelectedIndex = this._selectedIndex;
		}
		var newSelectedItem = null;
		if(pendingSelectedIndex != -1) {
			newSelectedItem = this._dataProvider.get(pendingSelectedIndex);
		} else if(filterText != null) {
			var filterText1 = filterText.toLowerCase();
			if(this._dataProvider != null && this._dataProvider.get_length() > 0) {
				var item = this._dataProvider.iterator();
				while(item.hasNext()) {
					var item1 = item.next();
					var itemText = typeof(item1) == "string" ? item1 : this.itemToText(item1);
					itemText = itemText.toLowerCase();
					if(itemText == filterText1) {
						newSelectedItem = item1;
						break;
					}
				}
			}
		} else {
			return;
		}
		var customSelectedItem = null;
		if(this._allowCustomUserValue && newSelectedItem == null && filterText != null && filterText.length > 0) {
			customSelectedItem = this.textToItem(filterText);
		}
		if(this._dataProvider != null) {
			this._dataProvider.refresh();
		}
		if(customSelectedItem != null) {
			this._customSelectedItem = customSelectedItem;
			this._selectedItem = null;
			this._selectedIndex = -1;
			feathers_events_FeathersEvent.dispatch(this,"change");
		} else if(newSelectedItem != null) {
			this.set_selectedItem(newSelectedItem);
		} else if(this._allowCustomUserValue) {
			this._customSelectedItem = null;
			this._selectedItem = null;
			this._selectedIndex = -1;
			feathers_events_FeathersEvent.dispatch(this,"change");
		}
		this.setInvalid(feathers_core_InvalidationFlag.SELECTION);
	}
	,comboBox_dataProvider_removeAllHandler: function(event) {
		this.set_selectedIndex(-1);
	}
	,comboBox_textInput_mouseDownHandler: function(event) {
		if(this.textInput.get_editable() || this.textInput.get_selectable()) {
			return;
		}
		this.openListView();
	}
	,__popUpAdapter: null
	,get_popUpAdapter: function() {
		return this.__popUpAdapter;
	}
	,set_popUpAdapter: function(value) {
		if(!this.setStyle("popUpAdapter")) {
			return this.__popUpAdapter;
		}
		if(this.__popUpAdapter == value) {
			return this.__popUpAdapter;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_popUpAdapter);
		this.__popUpAdapter = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__popUpAdapter;
	}
	,clearStyle_popUpAdapter: function() {
		this.set_popUpAdapter(new feathers_controls_popups_DropDownPopUpAdapter());
		return this.get_popUpAdapter();
	}
	,__customTextInputVariant: null
	,get_customTextInputVariant: function() {
		return this.__customTextInputVariant;
	}
	,set_customTextInputVariant: function(value) {
		if(!this.setStyle("customTextInputVariant")) {
			return this.__customTextInputVariant;
		}
		if(this.__customTextInputVariant == value) {
			return this.__customTextInputVariant;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_customTextInputVariant);
		this.__customTextInputVariant = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__customTextInputVariant;
	}
	,clearStyle_customTextInputVariant: function() {
		this.set_customTextInputVariant(null);
		return this.get_customTextInputVariant();
	}
	,__customButtonVariant: null
	,get_customButtonVariant: function() {
		return this.__customButtonVariant;
	}
	,set_customButtonVariant: function(value) {
		if(!this.setStyle("customButtonVariant")) {
			return this.__customButtonVariant;
		}
		if(this.__customButtonVariant == value) {
			return this.__customButtonVariant;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_customButtonVariant);
		this.__customButtonVariant = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__customButtonVariant;
	}
	,clearStyle_customButtonVariant: function() {
		this.set_customButtonVariant(null);
		return this.get_customButtonVariant();
	}
	,__customListViewVariant: null
	,get_customListViewVariant: function() {
		return this.__customListViewVariant;
	}
	,set_customListViewVariant: function(value) {
		if(!this.setStyle("customListViewVariant")) {
			return this.__customListViewVariant;
		}
		if(this.__customListViewVariant == value) {
			return this.__customListViewVariant;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_customListViewVariant);
		this.__customListViewVariant = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__customListViewVariant;
	}
	,clearStyle_customListViewVariant: function() {
		this.set_customListViewVariant(null);
		return this.get_customListViewVariant();
	}
	,get_styleContext: function() {
		return feathers_controls_ComboBox;
	}
	,__class__: feathers_controls_ComboBox
	,__properties__: $extend(feathers_core_FeathersControl.prototype.__properties__,{get_open:"get_open",set_listViewFactory:"set_listViewFactory",get_listViewFactory:"get_listViewFactory",set_textInputFactory:"set_textInputFactory",get_textInputFactory:"get_textInputFactory",set_buttonFactory:"set_buttonFactory",get_buttonFactory:"get_buttonFactory",set_customListViewVariant:"set_customListViewVariant",get_customListViewVariant:"get_customListViewVariant",set_customButtonVariant:"set_customButtonVariant",get_customButtonVariant:"get_customButtonVariant",set_customTextInputVariant:"set_customTextInputVariant",get_customTextInputVariant:"get_customTextInputVariant",set_popUpAdapter:"set_popUpAdapter",get_popUpAdapter:"get_popUpAdapter",set_itemRendererRecycler:"set_itemRendererRecycler",get_itemRendererRecycler:"get_itemRendererRecycler",set_prompt:"set_prompt",get_prompt:"get_prompt",set_selectedItem:"set_selectedItem",get_selectedItem:"get_selectedItem",get_maxSelectedIndex:"get_maxSelectedIndex",set_selectedIndex:"set_selectedIndex",get_selectedIndex:"get_selectedIndex",set_allowCustomUserValue:"set_allowCustomUserValue",get_allowCustomUserValue:"get_allowCustomUserValue",set_dataProvider:"set_dataProvider",get_dataProvider:"get_dataProvider",get_text:"get_text",get_stageFocusTarget:"get_stageFocusTarget"})
});
var feathers_core_IDateSelector = function() { };
$hxClasses["feathers.core.IDateSelector"] = feathers_core_IDateSelector;
feathers_core_IDateSelector.__name__ = "feathers.core.IDateSelector";
feathers_core_IDateSelector.__isInterface__ = true;
feathers_core_IDateSelector.prototype = {
	get_selectedDate: null
	,set_selectedDate: null
	,__class__: feathers_core_IDateSelector
	,__properties__: {set_selectedDate:"set_selectedDate",get_selectedDate:"get_selectedDate"}
};
var feathers_data_DatePickerItemState = function(date,selected) {
	if(selected == null) {
		selected = false;
	}
	this.enabled = true;
	this.selected = false;
	this.date = date;
	this.selected = false;
};
$hxClasses["feathers.data.DatePickerItemState"] = feathers_data_DatePickerItemState;
feathers_data_DatePickerItemState.__name__ = "feathers.data.DatePickerItemState";
feathers_data_DatePickerItemState.prototype = {
	owner: null
	,date: null
	,selected: null
	,enabled: null
	,__class__: feathers_data_DatePickerItemState
};
var feathers_controls_DatePicker = function() {
	this.__showDatesFromAdjacentMonths = true;
	this.__customMutedDateRendererVariant = null;
	this.__customDateRendererVariant = null;
	this.__customWeekdayLabelVariant = null;
	this.__showWeekdayLabels = true;
	this.__showYearButtons = true;
	this.__showMonthButtons = true;
	this.__showMonthTitleView = true;
	this.__monthTitleViewPosition = feathers_layout_HorizontalAlign.CENTER;
	this.__paddingLeft = 0.0;
	this.__paddingBottom = 0.0;
	this.__paddingRight = 0.0;
	this.__paddingTop = 0.0;
	this.__headerGap = 0.0;
	this.__customMonthTitleViewVariant = null;
	this.__customIncrementYearButtonVariant = null;
	this.__customDecrementYearButtonVariant = null;
	this.__customIncrementMonthButtonVariant = null;
	this.__customDecrementMonthButtonVariant = null;
	this.__disabledBackgroundSkin = null;
	this.__backgroundSkin = null;
	this.pointerSelectionEnabled = true;
	this._previousCustomMutedDateRendererVariant = null;
	this._previousCustomDateRendererVariant = null;
	this._previousCustomWeekdayLabelVariant = null;
	this._customStartOfWeek = null;
	this._currentStartOfWeek = 0;
	this._customWeekdayNames = null;
	this._customMonthNames = null;
	this._actualLocaleIDName = null;
	this._requestedLocaleIDName = null;
	this._previousCustomMonthTitleViewVariant = null;
	this._previousCustomIncrementYearButtonVariant = null;
	this._previousCustomDecrementYearButtonVariant = null;
	this._previousCustomIncrementMonthButtonVariant = null;
	this._previousCustomDecrementMonthButtonVariant = null;
	this._backgroundSkinMeasurements = null;
	this._currentBackgroundSkin = null;
	this._selectedDate = null;
	this._ignoreSelectionChange = false;
	this._selectable = true;
	this._displayedMonth = new Date().getMonth();
	this._displayedFullYear = new Date().getFullYear();
	this.itemStatePool = new lime_utils_ObjectPool(function() {
		return new feathers_data_DatePickerItemState();
	});
	this.monthTitleViewMeasurements = new feathers_layout_Measurements();
	this.incrementYearButtonMeasurements = new feathers_layout_Measurements();
	this.decrementYearButtonMeasurements = new feathers_layout_Measurements();
	this.incrementMonthButtonMeasurements = new feathers_layout_Measurements();
	this.decrementMonthButtonMeasurements = new feathers_layout_Measurements();
	this._mutedStorage = new feathers_controls__$DatePicker_DateRendererStorage(null,feathers_utils_DisplayObjectRecycler.withClass(feathers_controls_dataRenderers_ItemRenderer));
	this._defaultStorage = new feathers_controls__$DatePicker_DateRendererStorage(null,feathers_utils_DisplayObjectRecycler.withClass(feathers_controls_dataRenderers_ItemRenderer));
	this.dateRendererToItemState = new haxe_ds_ObjectMap();
	this._dayNameLabels = [];
	this.initializeDatePickerTheme();
	feathers_core_FeathersControl.call(this);
	this.addEventListener("keyDown",$bind(this,this.datePicker_keyDownHandler));
};
$hxClasses["feathers.controls.DatePicker"] = feathers_controls_DatePicker;
feathers_controls_DatePicker.__name__ = "feathers.controls.DatePicker";
feathers_controls_DatePicker.__interfaces__ = [feathers_core_IFocusObject,feathers_core_IDateSelector];
feathers_controls_DatePicker.defaultUpdateDateRenderer = function(dateRenderer,state) {
	if(js_Boot.__implements(dateRenderer,feathers_core_ITextControl)) {
		var textControl = dateRenderer;
		textControl.set_text(Std.string(state.date.getDate()));
	}
};
feathers_controls_DatePicker.defaultResetDateRenderer = function(dateRenderer,state) {
	if(js_Boot.__implements(dateRenderer,feathers_core_ITextControl)) {
		var textControl = dateRenderer;
		textControl.set_text(null);
	}
};
feathers_controls_DatePicker.__super__ = feathers_core_FeathersControl;
feathers_controls_DatePicker.prototype = $extend(feathers_core_FeathersControl.prototype,{
	dateContainer: null
	,monthView: null
	,decrementMonthButton: null
	,incrementMonthButton: null
	,decrementYearButton: null
	,incrementYearButton: null
	,monthTitleView: null
	,_dayNameLabels: null
	,dateRendererToItemState: null
	,_defaultStorage: null
	,_mutedStorage: null
	,decrementMonthButtonMeasurements: null
	,incrementMonthButtonMeasurements: null
	,decrementYearButtonMeasurements: null
	,incrementYearButtonMeasurements: null
	,monthTitleViewMeasurements: null
	,itemStatePool: null
	,_displayedFullYear: null
	,get_displayedFullYear: function() {
		return this._displayedFullYear;
	}
	,set_displayedFullYear: function(value) {
		if(this._displayedFullYear == value) {
			return this._displayedFullYear;
		}
		this._displayedFullYear = value;
		this.setInvalid(feathers_core_InvalidationFlag.SELECTION);
		feathers_events_FeathersEvent.dispatch(this,"scroll");
		return this._displayedFullYear;
	}
	,_displayedMonth: null
	,get_displayedMonth: function() {
		return this._displayedMonth;
	}
	,set_displayedMonth: function(value) {
		if(value < 0 || value > 11) {
			throw new openfl_errors_RangeError("displayedMonth must be in the range 0-11");
		}
		if(this._displayedMonth == value) {
			return this._displayedMonth;
		}
		this._displayedMonth = value;
		this.setInvalid(feathers_core_InvalidationFlag.SELECTION);
		feathers_events_FeathersEvent.dispatch(this,"scroll");
		return this._displayedMonth;
	}
	,_selectable: null
	,get_selectable: function() {
		return this._selectable;
	}
	,set_selectable: function(value) {
		if(this._selectable == value) {
			return this._selectable;
		}
		this._selectable = value;
		if(!this._selectable && this._selectedDate != null) {
			this.set_selectedDate(null);
		}
		this.setInvalid(feathers_core_InvalidationFlag.SELECTION);
		return this._selectable;
	}
	,_ignoreSelectionChange: null
	,_selectedDate: null
	,get_selectedDate: function() {
		return this._selectedDate;
	}
	,set_selectedDate: function(value) {
		if(!this._selectable) {
			value = null;
		}
		if(this._selectedDate == value) {
			return this._selectedDate;
		}
		this._selectedDate = value;
		this.setInvalid(feathers_core_InvalidationFlag.SELECTION);
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._selectedDate;
	}
	,_currentBackgroundSkin: null
	,_backgroundSkinMeasurements: null
	,_oldDecrementMonthButtonFactory: null
	,_decrementMonthButtonFactory: null
	,get_decrementMonthButtonFactory: function() {
		return this._decrementMonthButtonFactory;
	}
	,set_decrementMonthButtonFactory: function(value) {
		if(this._decrementMonthButtonFactory == value) {
			return this._decrementMonthButtonFactory;
		}
		this._decrementMonthButtonFactory = value;
		this.setInvalid(feathers_controls_DatePicker.INVALIDATION_FLAG_DECREMENT_MONTH_BUTTON_FACTORY);
		return this._decrementMonthButtonFactory;
	}
	,_previousCustomDecrementMonthButtonVariant: null
	,_oldIncrementMonthButtonFactory: null
	,_incrementMonthButtonFactory: null
	,get_incrementMonthButtonFactory: function() {
		return this._incrementMonthButtonFactory;
	}
	,set_incrementMonthButtonFactory: function(value) {
		if(this._incrementMonthButtonFactory == value) {
			return this._incrementMonthButtonFactory;
		}
		this._incrementMonthButtonFactory = value;
		this.setInvalid(feathers_controls_DatePicker.INVALIDATION_FLAG_INCREMENT_MONTH_BUTTON_FACTORY);
		return this._incrementMonthButtonFactory;
	}
	,_previousCustomIncrementMonthButtonVariant: null
	,_oldDecrementYearButtonFactory: null
	,_decrementYearButtonFactory: null
	,get_decrementYearButtonFactory: function() {
		return this._decrementYearButtonFactory;
	}
	,set_decrementYearButtonFactory: function(value) {
		if(this._decrementYearButtonFactory == value) {
			return this._decrementYearButtonFactory;
		}
		this._decrementYearButtonFactory = value;
		this.setInvalid(feathers_controls_DatePicker.INVALIDATION_FLAG_DECREMENT_YEAR_BUTTON_FACTORY);
		return this._decrementYearButtonFactory;
	}
	,_previousCustomDecrementYearButtonVariant: null
	,_oldIncrementYearButtonFactory: null
	,_incrementYearButtonFactory: null
	,get_incrementYearButtonFactory: function() {
		return this._incrementYearButtonFactory;
	}
	,set_incrementYearButtonFactory: function(value) {
		if(this._incrementYearButtonFactory == value) {
			return this._incrementYearButtonFactory;
		}
		this._incrementYearButtonFactory = value;
		this.setInvalid(feathers_controls_DatePicker.INVALIDATION_FLAG_INCREMENT_YEAR_BUTTON_FACTORY);
		return this._incrementYearButtonFactory;
	}
	,_previousCustomIncrementYearButtonVariant: null
	,_oldMonthTitleViewFactory: null
	,_monthTitleViewFactory: null
	,get_monthTitleViewFactory: function() {
		return this._monthTitleViewFactory;
	}
	,set_monthTitleViewFactory: function(value) {
		if(this._monthTitleViewFactory == value) {
			return this._monthTitleViewFactory;
		}
		this._monthTitleViewFactory = value;
		this.setInvalid(feathers_controls_DatePicker.INVALIDATION_FLAG_MONTH_TITLE_VIEW_FACTORY);
		return this._monthTitleViewFactory;
	}
	,_previousCustomMonthTitleViewVariant: null
	,_currentMonthNames: null
	,_currentWeekdayNames: null
	,_currentDateFormatter: null
	,_requestedLocaleIDName: null
	,get_requestedLocaleIDName: function() {
		return this._requestedLocaleIDName;
	}
	,set_requestedLocaleIDName: function(value) {
		if(this._requestedLocaleIDName == value) {
			return this._requestedLocaleIDName;
		}
		this._requestedLocaleIDName = value;
		this._actualLocaleIDName = null;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		return this._requestedLocaleIDName;
	}
	,_actualLocaleIDName: null
	,get_actualLocaleIDName: function() {
		return this._actualLocaleIDName;
	}
	,setPadding: function(value) {
		this.set_paddingTop(value);
		this.set_paddingRight(value);
		this.set_paddingBottom(value);
		this.set_paddingLeft(value);
	}
	,_customMonthNames: null
	,get_customMonthNames: function() {
		return this._customMonthNames;
	}
	,set_customMonthNames: function(value) {
		if(value != null && value.length != 12) {
			throw new openfl_errors_ArgumentError("Length of customMonthNames must be exactly equal to 12");
		}
		if(this._customMonthNames == value) {
			return this._customMonthNames;
		}
		this._customMonthNames = value;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		return this._customMonthNames;
	}
	,_customWeekdayNames: null
	,get_customWeekdayNames: function() {
		return this._customWeekdayNames;
	}
	,set_customWeekdayNames: function(value) {
		if(value != null && value.length != 7) {
			throw new openfl_errors_ArgumentError("Length of customWeekdayNames must be exactly equal to 7");
		}
		if(this._customWeekdayNames == value) {
			return this._customWeekdayNames;
		}
		this._customWeekdayNames = value;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		return this._customWeekdayNames;
	}
	,_currentStartOfWeek: null
	,_customStartOfWeek: null
	,get_customStartOfWeek: function() {
		return this._customStartOfWeek;
	}
	,set_customStartOfWeek: function(value) {
		if(value != null && (value < 0 || value > 6)) {
			throw new openfl_errors_RangeError("startOfWeek must be in the range 0-6");
		}
		if(this._customStartOfWeek == value) {
			return this._customStartOfWeek;
		}
		this._customStartOfWeek = value;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		return this._customStartOfWeek;
	}
	,_oldWeekdayLabelFactory: null
	,_weekdayLabelFactory: null
	,get_weekdayLabelFactory: function() {
		return this._weekdayLabelFactory;
	}
	,set_weekdayLabelFactory: function(value) {
		if(this._weekdayLabelFactory == value) {
			return this._weekdayLabelFactory;
		}
		this._weekdayLabelFactory = value;
		this.setInvalid(feathers_controls_DatePicker.INVALIDATION_FLAG_WEEKDAY_LABEL_FACTORY);
		return this._weekdayLabelFactory;
	}
	,_previousCustomWeekdayLabelVariant: null
	,_previousCustomDateRendererVariant: null
	,_previousCustomMutedDateRendererVariant: null
	,get_dateRendererRecycler: function() {
		return this._defaultStorage.dateRendererRecycler;
	}
	,set_dateRendererRecycler: function(value) {
		if(this._defaultStorage.dateRendererRecycler == value) {
			return this._defaultStorage.dateRendererRecycler;
		}
		this._defaultStorage.oldDateRendererRecycler = this._defaultStorage.dateRendererRecycler;
		this._defaultStorage.dateRendererRecycler = value;
		this._defaultStorage.measurements = null;
		this._mutedStorage.oldDateRendererRecycler = this._mutedStorage.dateRendererRecycler;
		this._mutedStorage.dateRendererRecycler = value;
		this._mutedStorage.measurements = null;
		this.setInvalid(feathers_controls_DatePicker.INVALIDATION_FLAG_DATE_RENDERER_FACTORY);
		return this._defaultStorage.dateRendererRecycler;
	}
	,pointerSelectionEnabled: null
	,dispose: function() {
		this.destroyMonthTitleView();
		this.destroyDecrementMonthButton();
		this.destroyIncrementMonthButton();
		this.destroyDecrementYearButton();
		this.destroyIncrementYearButton();
		this.refreshInactiveDateRenderers(this._defaultStorage,true);
		this.refreshInactiveDateRenderers(this._mutedStorage,true);
		feathers_core_FeathersControl.prototype.dispose.call(this);
	}
	,initializeDatePickerTheme: function() {
		feathers_themes_steel_components_SteelDatePickerStyles.initialize();
	}
	,initialize: function() {
		if(this.dateContainer == null) {
			this.dateContainer = new feathers_controls_LayoutGroup();
			this.dateContainer.set_layout(new feathers_layout_CalendarGridLayout());
			this.addChild(this.dateContainer);
		}
		feathers_core_FeathersControl.prototype.initialize.call(this);
	}
	,update: function() {
		var dataInvalid = this.isInvalid(feathers_core_InvalidationFlag.DATA);
		var selectionInvalid = this.isInvalid(feathers_core_InvalidationFlag.SELECTION);
		var stateInvalid = this.isInvalid(feathers_core_InvalidationFlag.STATE);
		var stylesInvalid = this.isInvalid(feathers_core_InvalidationFlag.STYLES);
		if(this._previousCustomDateRendererVariant != this.get_customDateRendererVariant()) {
			this.setInvalidationFlag(feathers_controls_DatePicker.INVALIDATION_FLAG_DATE_RENDERER_FACTORY);
		}
		if(this._previousCustomMutedDateRendererVariant != this.get_customMutedDateRendererVariant()) {
			this.setInvalidationFlag(feathers_controls_DatePicker.INVALIDATION_FLAG_DATE_RENDERER_FACTORY);
		}
		if(this._previousCustomWeekdayLabelVariant != this.get_customWeekdayLabelVariant()) {
			this.setInvalidationFlag(feathers_controls_DatePicker.INVALIDATION_FLAG_WEEKDAY_LABEL_FACTORY);
		}
		if(this._previousCustomDecrementMonthButtonVariant != this.get_customDecrementMonthButtonVariant()) {
			this.setInvalidationFlag(feathers_controls_DatePicker.INVALIDATION_FLAG_DECREMENT_MONTH_BUTTON_FACTORY);
		}
		if(this._previousCustomIncrementMonthButtonVariant != this.get_customIncrementMonthButtonVariant()) {
			this.setInvalidationFlag(feathers_controls_DatePicker.INVALIDATION_FLAG_INCREMENT_MONTH_BUTTON_FACTORY);
		}
		if(this._previousCustomDecrementYearButtonVariant != this.get_customDecrementYearButtonVariant()) {
			this.setInvalidationFlag(feathers_controls_DatePicker.INVALIDATION_FLAG_DECREMENT_YEAR_BUTTON_FACTORY);
		}
		if(this._previousCustomIncrementYearButtonVariant != this.get_customIncrementYearButtonVariant()) {
			this.setInvalidationFlag(feathers_controls_DatePicker.INVALIDATION_FLAG_INCREMENT_YEAR_BUTTON_FACTORY);
		}
		if(this._previousCustomMonthTitleViewVariant != this.get_customMonthTitleViewVariant()) {
			this.setInvalidationFlag(feathers_controls_DatePicker.INVALIDATION_FLAG_MONTH_TITLE_VIEW_FACTORY);
		}
		var dateRendererFactoryInvalid = this.isInvalid(feathers_controls_DatePicker.INVALIDATION_FLAG_DATE_RENDERER_FACTORY);
		var weekdayLabelFactoryInvalid = this.isInvalid(feathers_controls_DatePicker.INVALIDATION_FLAG_WEEKDAY_LABEL_FACTORY);
		var decrementMonthButtonFactoryInvalid = this.isInvalid(feathers_controls_DatePicker.INVALIDATION_FLAG_DECREMENT_MONTH_BUTTON_FACTORY);
		var incrementMonthButtonFactoryInvalid = this.isInvalid(feathers_controls_DatePicker.INVALIDATION_FLAG_INCREMENT_MONTH_BUTTON_FACTORY);
		var decrementYearButtonFactoryInvalid = this.isInvalid(feathers_controls_DatePicker.INVALIDATION_FLAG_DECREMENT_YEAR_BUTTON_FACTORY);
		var incrementYearButtonFactoryInvalid = this.isInvalid(feathers_controls_DatePicker.INVALIDATION_FLAG_INCREMENT_YEAR_BUTTON_FACTORY);
		var monthTitleViewFactoryInvalid = this.isInvalid(feathers_controls_DatePicker.INVALIDATION_FLAG_MONTH_TITLE_VIEW_FACTORY);
		if(stylesInvalid || stateInvalid) {
			this.refreshBackgroundSkin();
		}
		if(monthTitleViewFactoryInvalid) {
			this.createMonthTitleView();
		}
		if(decrementMonthButtonFactoryInvalid) {
			this.createDecrementMonthButton();
		}
		if(incrementMonthButtonFactoryInvalid) {
			this.createIncrementMonthButton();
		}
		if(decrementYearButtonFactoryInvalid) {
			this.createDecrementYearButton();
		}
		if(incrementYearButtonFactoryInvalid) {
			this.createIncrementYearButton();
		}
		if(weekdayLabelFactoryInvalid) {
			this.createWeekdayLabels();
		}
		if(dataInvalid) {
			this.refreshLocale();
		}
		if(dataInvalid || selectionInvalid || dateRendererFactoryInvalid) {
			this.refreshDateRenderers();
		}
		if(weekdayLabelFactoryInvalid || dataInvalid || stylesInvalid) {
			this.refreshWeekdayLabels();
		}
		if(stateInvalid || monthTitleViewFactoryInvalid || decrementMonthButtonFactoryInvalid || incrementMonthButtonFactoryInvalid || decrementYearButtonFactoryInvalid || incrementYearButtonFactoryInvalid) {
			this.refreshEnabled();
		}
		if(dataInvalid || selectionInvalid) {
			this.refreshMonthTitle();
		}
		this.measure();
		this.layoutChildren();
		this._previousCustomDateRendererVariant = this.get_customDateRendererVariant();
		this._previousCustomMutedDateRendererVariant = this.get_customMutedDateRendererVariant();
		this._previousCustomMonthTitleViewVariant = this.get_customMonthTitleViewVariant();
		this._previousCustomWeekdayLabelVariant = this.get_customWeekdayLabelVariant();
		this._previousCustomDecrementMonthButtonVariant = this.get_customDecrementMonthButtonVariant();
		this._previousCustomIncrementMonthButtonVariant = this.get_customIncrementMonthButtonVariant();
		this._previousCustomDecrementYearButtonVariant = this.get_customDecrementYearButtonVariant();
		this._previousCustomIncrementYearButtonVariant = this.get_customIncrementYearButtonVariant();
	}
	,createMonthTitleView: function() {
		var factory = this._monthTitleViewFactory != null ? this._monthTitleViewFactory : feathers_controls_DatePicker.defaultMonthTitleViewFactory;
		this._oldMonthTitleViewFactory = factory;
		this.monthTitleView = factory.create();
		if(this.monthTitleView.get_variant() == null) {
			this.monthTitleView.set_variant(this.get_customMonthTitleViewVariant() != null ? this.get_customMonthTitleViewVariant() : feathers_controls_DatePicker.CHILD_VARIANT_MONTH_TITLE_VIEW);
		}
		this.monthTitleView.initializeNow();
		this.monthTitleViewMeasurements.save(this.monthTitleView);
		this.addChild(this.monthTitleView);
	}
	,destroyMonthTitleView: function() {
		if(this.monthTitleView == null) {
			return;
		}
		if(this._oldMonthTitleViewFactory.destroy != null) {
			this._oldMonthTitleViewFactory.destroy(this.monthTitleView);
		}
		this._oldMonthTitleViewFactory = null;
		this.monthTitleView = null;
	}
	,createDecrementMonthButton: function() {
		this.destroyDecrementMonthButton();
		var factory = this._decrementMonthButtonFactory != null ? this._decrementMonthButtonFactory : feathers_controls_DatePicker.defaultDecrementMonthButtonFactory;
		this._oldDecrementMonthButtonFactory = factory;
		this.decrementMonthButton = factory.create();
		if(this.decrementMonthButton.get_variant() == null) {
			this.decrementMonthButton.set_variant(this.get_customDecrementMonthButtonVariant() != null ? this.get_customDecrementMonthButtonVariant() : feathers_controls_DatePicker.CHILD_VARIANT_DECREMENT_MONTH_BUTTON);
		}
		this.decrementMonthButton.initializeNow();
		this.decrementMonthButtonMeasurements.save(this.decrementMonthButton);
		this.addChild(this.decrementMonthButton);
		this.decrementMonthButton.addEventListener("trigger",$bind(this,this.datePicker_decrementMonthButton_triggerHandler));
	}
	,destroyDecrementMonthButton: function() {
		if(this.decrementMonthButton == null) {
			return;
		}
		this.decrementMonthButton.removeEventListener("trigger",$bind(this,this.datePicker_decrementMonthButton_triggerHandler));
		if(this._oldDecrementMonthButtonFactory.destroy != null) {
			this._oldDecrementMonthButtonFactory.destroy(this.decrementMonthButton);
		}
		this._oldDecrementMonthButtonFactory = null;
		this.decrementMonthButton = null;
	}
	,createIncrementMonthButton: function() {
		this.destroyIncrementMonthButton();
		var factory = this._incrementMonthButtonFactory != null ? this._incrementMonthButtonFactory : feathers_controls_DatePicker.defaultIncrementMonthButtonFactory;
		this._oldIncrementMonthButtonFactory = factory;
		this.incrementMonthButton = factory.create();
		if(this.incrementMonthButton.get_variant() == null) {
			this.incrementMonthButton.set_variant(this.get_customIncrementMonthButtonVariant() != null ? this.get_customIncrementMonthButtonVariant() : feathers_controls_DatePicker.CHILD_VARIANT_INCREMENT_MONTH_BUTTON);
		}
		this.incrementMonthButton.initializeNow();
		this.incrementMonthButtonMeasurements.save(this.incrementMonthButton);
		this.addChild(this.incrementMonthButton);
		this.incrementMonthButton.addEventListener("trigger",$bind(this,this.datePicker_incrementMonthButton_triggerHandler));
	}
	,destroyIncrementMonthButton: function() {
		if(this.incrementMonthButton == null) {
			return;
		}
		this.incrementMonthButton.removeEventListener("trigger",$bind(this,this.datePicker_incrementMonthButton_triggerHandler));
		if(this._oldIncrementMonthButtonFactory.destroy != null) {
			this._oldIncrementMonthButtonFactory.destroy(this.incrementMonthButton);
		}
		this._oldIncrementMonthButtonFactory = null;
		this.incrementMonthButton = null;
	}
	,createDecrementYearButton: function() {
		this.destroyDecrementYearButton();
		var factory = this._decrementYearButtonFactory != null ? this._decrementYearButtonFactory : feathers_controls_DatePicker.defaultDecrementYearButtonFactory;
		this._oldDecrementYearButtonFactory = factory;
		this.decrementYearButton = factory.create();
		if(this.decrementYearButton.get_variant() == null) {
			this.decrementYearButton.set_variant(this.get_customDecrementYearButtonVariant() != null ? this.get_customDecrementYearButtonVariant() : feathers_controls_DatePicker.CHILD_VARIANT_DECREMENT_YEAR_BUTTON);
		}
		this.decrementYearButton.initializeNow();
		this.decrementYearButtonMeasurements.save(this.decrementYearButton);
		this.addChild(this.decrementYearButton);
		this.decrementYearButton.addEventListener("trigger",$bind(this,this.datePicker_decrementYearButton_triggerHandler));
	}
	,destroyDecrementYearButton: function() {
		if(this.decrementYearButton == null) {
			return;
		}
		this.decrementYearButton.removeEventListener("trigger",$bind(this,this.datePicker_decrementYearButton_triggerHandler));
		if(this._oldDecrementYearButtonFactory.destroy != null) {
			this._oldDecrementYearButtonFactory.destroy(this.decrementYearButton);
		}
		this._oldDecrementYearButtonFactory = null;
		this.decrementYearButton = null;
	}
	,createIncrementYearButton: function() {
		this.destroyIncrementYearButton();
		var factory = this._incrementYearButtonFactory != null ? this._incrementYearButtonFactory : feathers_controls_DatePicker.defaultIncrementYearButtonFactory;
		this._oldIncrementYearButtonFactory = factory;
		this.incrementYearButton = factory.create();
		if(this.incrementYearButton.get_variant() == null) {
			this.incrementYearButton.set_variant(this.get_customIncrementYearButtonVariant() != null ? this.get_customIncrementYearButtonVariant() : feathers_controls_DatePicker.CHILD_VARIANT_INCREMENT_YEAR_BUTTON);
		}
		this.incrementYearButton.initializeNow();
		this.incrementYearButtonMeasurements.save(this.incrementYearButton);
		this.addChild(this.incrementYearButton);
		this.incrementYearButton.addEventListener("trigger",$bind(this,this.datePicker_incrementYearButton_triggerHandler));
	}
	,destroyIncrementYearButton: function() {
		if(this.incrementYearButton == null) {
			return;
		}
		this.incrementYearButton.removeEventListener("trigger",$bind(this,this.datePicker_incrementYearButton_triggerHandler));
		if(this._oldIncrementYearButtonFactory.destroy != null) {
			this._oldIncrementYearButtonFactory.destroy(this.incrementYearButton);
		}
		this._oldIncrementYearButtonFactory = null;
		this.incrementYearButton = null;
	}
	,measure: function() {
		var needsWidth = this.get_explicitWidth() == null;
		var needsHeight = this.get_explicitHeight() == null;
		var needsMinWidth = this.get_explicitMinWidth() == null;
		var needsMinHeight = this.get_explicitMinHeight() == null;
		var needsMaxWidth = this.get_explicitMaxWidth() == null;
		var needsMaxHeight = this.get_explicitMaxHeight() == null;
		if(!needsWidth && !needsHeight && !needsMinWidth && !needsMinHeight && !needsMaxWidth && !needsMaxHeight) {
			return false;
		}
		this.dateContainer.validateNow();
		this.monthTitleViewMeasurements.restore(this.monthTitleView);
		var oldText = this.monthTitleView.get_text();
		var measureText = this.getMonthText(this.getMonthWithLongestName(),0);
		this.monthTitleView.set_text(measureText);
		this.monthTitleView.validateNow();
		this.decrementMonthButtonMeasurements.restore(this.decrementMonthButton);
		this.decrementMonthButton.validateNow();
		this.incrementMonthButtonMeasurements.restore(this.incrementMonthButton);
		this.incrementMonthButton.validateNow();
		this.decrementYearButtonMeasurements.restore(this.decrementYearButton);
		this.decrementYearButton.validateNow();
		this.incrementYearButtonMeasurements.restore(this.incrementYearButton);
		this.incrementYearButton.validateNow();
		var headerWidth = 0.0;
		var headerHeight = 0.0;
		if(this.get_showMonthTitleView()) {
			headerWidth = this.monthTitleView.get_width();
			headerHeight = this.monthTitleView.get_height();
		}
		if(this.get_showMonthButtons()) {
			headerWidth += 2.0 * this.get_headerGap() + this.decrementMonthButton.get_width() + this.incrementMonthButton.get_width();
			headerHeight = Math.max(headerHeight,Math.max(this.decrementMonthButton.get_height(),this.incrementMonthButton.get_height()));
		}
		if(this.get_showYearButtons()) {
			headerWidth += 2.0 * this.get_headerGap() + this.decrementYearButton.get_width() + this.incrementYearButton.get_width();
			headerHeight = Math.max(headerHeight,Math.max(this.decrementYearButton.get_height(),this.incrementYearButton.get_height()));
		}
		var newWidth = this.get_explicitWidth();
		if(needsWidth) {
			newWidth = Math.max(this.dateContainer.get_width(),headerWidth);
			newWidth += this.get_paddingLeft() + this.get_paddingRight();
		}
		var newHeight = this.get_explicitHeight();
		if(needsHeight) {
			newHeight = headerHeight + this.dateContainer.get_height();
			newHeight += this.get_paddingTop() + this.get_paddingBottom();
		}
		var newMinWidth = this.get_explicitMinWidth();
		if(needsMinWidth) {
			newMinWidth = Math.max(this.dateContainer.get_minWidth(),headerWidth);
			newMinWidth += this.get_paddingLeft() + this.get_paddingRight();
		}
		var newMinHeight = this.get_explicitMinHeight();
		if(needsMinHeight) {
			newMinHeight = headerHeight + this.dateContainer.get_minHeight();
			newMinHeight += this.get_paddingTop() + this.get_paddingBottom();
		}
		this.monthTitleView.set_text(oldText);
		return this.saveMeasurements(newWidth,newHeight,newMinWidth,newMinHeight);
	}
	,refreshEnabled: function() {
		this.monthTitleView.set_enabled(this.get_enabled());
		this.decrementMonthButton.set_enabled(this.get_enabled());
		this.incrementMonthButton.set_enabled(this.get_enabled());
		this.decrementYearButton.set_enabled(this.get_enabled());
		this.incrementYearButton.set_enabled(this.get_enabled());
		this.dateContainer.set_enabled(this.get_enabled());
	}
	,createWeekdayLabels: function() {
		var _g = 0;
		var _g1 = this._dayNameLabels;
		while(_g < _g1.length) {
			var dayNameLabel = _g1[_g];
			++_g;
			this.dateContainer.removeChild(dayNameLabel);
			if(this._oldWeekdayLabelFactory.destroy != null) {
				this._oldWeekdayLabelFactory.destroy(dayNameLabel);
			}
		}
		this._oldWeekdayLabelFactory = null;
		this._dayNameLabels.length = 0;
		var factory = this._weekdayLabelFactory != null ? this._weekdayLabelFactory : feathers_controls_DatePicker.defaultWeekdayLabelFactory;
		var weekdayLabelVariant = this.get_customWeekdayLabelVariant() != null ? this.get_customWeekdayLabelVariant() : feathers_controls_DatePicker.CHILD_VARIANT_WEEKDAY_LABEL;
		var dayNameLabel = js_Boot.__cast(factory.create() , feathers_controls_Label);
		this._oldWeekdayLabelFactory = factory;
		if(dayNameLabel.get_variant() == null) {
			dayNameLabel.set_variant(weekdayLabelVariant);
		}
		this.dateContainer.addChildAt(dayNameLabel,0);
		this._dayNameLabels.push(dayNameLabel);
		var dayNameLabel = js_Boot.__cast(factory.create() , feathers_controls_Label);
		this._oldWeekdayLabelFactory = factory;
		if(dayNameLabel.get_variant() == null) {
			dayNameLabel.set_variant(weekdayLabelVariant);
		}
		this.dateContainer.addChildAt(dayNameLabel,1);
		this._dayNameLabels.push(dayNameLabel);
		var dayNameLabel = js_Boot.__cast(factory.create() , feathers_controls_Label);
		this._oldWeekdayLabelFactory = factory;
		if(dayNameLabel.get_variant() == null) {
			dayNameLabel.set_variant(weekdayLabelVariant);
		}
		this.dateContainer.addChildAt(dayNameLabel,2);
		this._dayNameLabels.push(dayNameLabel);
		var dayNameLabel = js_Boot.__cast(factory.create() , feathers_controls_Label);
		this._oldWeekdayLabelFactory = factory;
		if(dayNameLabel.get_variant() == null) {
			dayNameLabel.set_variant(weekdayLabelVariant);
		}
		this.dateContainer.addChildAt(dayNameLabel,3);
		this._dayNameLabels.push(dayNameLabel);
		var dayNameLabel = js_Boot.__cast(factory.create() , feathers_controls_Label);
		this._oldWeekdayLabelFactory = factory;
		if(dayNameLabel.get_variant() == null) {
			dayNameLabel.set_variant(weekdayLabelVariant);
		}
		this.dateContainer.addChildAt(dayNameLabel,4);
		this._dayNameLabels.push(dayNameLabel);
		var dayNameLabel = js_Boot.__cast(factory.create() , feathers_controls_Label);
		this._oldWeekdayLabelFactory = factory;
		if(dayNameLabel.get_variant() == null) {
			dayNameLabel.set_variant(weekdayLabelVariant);
		}
		this.dateContainer.addChildAt(dayNameLabel,5);
		this._dayNameLabels.push(dayNameLabel);
		var dayNameLabel = js_Boot.__cast(factory.create() , feathers_controls_Label);
		this._oldWeekdayLabelFactory = factory;
		if(dayNameLabel.get_variant() == null) {
			dayNameLabel.set_variant(weekdayLabelVariant);
		}
		this.dateContainer.addChildAt(dayNameLabel,6);
		this._dayNameLabels.push(dayNameLabel);
	}
	,refreshWeekdayLabels: function() {
		var _g = 0;
		var _g1 = this._dayNameLabels.length;
		while(_g < _g1) {
			var i = _g++;
			var nameIndex = (i + this._currentStartOfWeek) % this._dayNameLabels.length;
			var dayNameLabel = this._dayNameLabels[i];
			dayNameLabel.set_text(this._currentWeekdayNames[nameIndex]);
			dayNameLabel.set_visible(this.get_showWeekdayLabels());
			dayNameLabel.set_includeInLayout(this.get_showWeekdayLabels());
		}
	}
	,refreshDateRenderers: function() {
		if(this._defaultStorage.dateRendererRecycler.update == null) {
			this._defaultStorage.dateRendererRecycler.update = feathers_controls_DatePicker.defaultUpdateDateRenderer;
			if(this._defaultStorage.dateRendererRecycler.reset == null) {
				this._defaultStorage.dateRendererRecycler.reset = feathers_controls_DatePicker.defaultResetDateRenderer;
			}
		}
		if(this._mutedStorage.dateRendererRecycler.update == null) {
			this._mutedStorage.dateRendererRecycler.update = feathers_controls_DatePicker.defaultUpdateDateRenderer;
			if(this._mutedStorage.dateRendererRecycler.reset == null) {
				this._mutedStorage.dateRendererRecycler.reset = feathers_controls_DatePicker.defaultResetDateRenderer;
			}
		}
		var dateRendererInvalid = this.isInvalid(feathers_controls_DatePicker.INVALIDATION_FLAG_DATE_RENDERER_FACTORY);
		this.refreshInactiveDateRenderers(this._defaultStorage,dateRendererInvalid);
		this.refreshInactiveDateRenderers(this._mutedStorage,dateRendererInvalid);
		this.recoverInactiveDateRenderers(this._defaultStorage);
		this.recoverInactiveDateRenderers(this._mutedStorage);
		this.renderUnrenderedData();
		this.freeInactiveDateRenderers(this._defaultStorage);
		this.freeInactiveDateRenderers(this._mutedStorage);
	}
	,refreshInactiveDateRenderers: function(storage,factoryInvalid) {
		var temp = storage.inactiveDateRenderers;
		storage.inactiveDateRenderers = storage.activeDateRenderers;
		storage.activeDateRenderers = temp;
		if(storage.activeDateRenderers.length > 0) {
			var c = js_Boot.getClass(this);
			throw new openfl_errors_IllegalOperationError("" + c.__name__ + ": active date renderers should be empty before updating.");
		}
		if(factoryInvalid) {
			this.recoverInactiveDateRenderers(storage);
			this.freeInactiveDateRenderers(storage);
			storage.oldDateRendererRecycler = null;
		}
	}
	,recoverInactiveDateRenderers: function(storage) {
		var _g = 0;
		var _g1 = storage.inactiveDateRenderers;
		while(_g < _g1.length) {
			var dateRenderer = _g1[_g];
			++_g;
			if(dateRenderer == null) {
				continue;
			}
			var state = this.dateRendererToItemState.h[dateRenderer.__id__];
			if(state == null) {
				continue;
			}
			this.dateRendererToItemState.remove(dateRenderer);
			dateRenderer.removeEventListener("trigger",$bind(this,this.datePicker_dateRenderer_triggerHandler));
			dateRenderer.removeEventListener("click",$bind(this,this.datePicker_dateRenderer_clickHandler));
			dateRenderer.removeEventListener("touchTap",$bind(this,this.datePicker_dateRenderer_touchTapHandler));
			dateRenderer.removeEventListener("change",$bind(this,this.datePicker_dateRenderer_changeHandler));
			this.resetDateRenderer(dateRenderer,state,storage);
			if(storage.measurements != null) {
				storage.measurements.restore(dateRenderer);
			}
			this.itemStatePool.release(state);
		}
	}
	,freeInactiveDateRenderers: function(storage) {
		var recycler = storage.oldDateRendererRecycler != null ? storage.oldDateRendererRecycler : storage.dateRendererRecycler;
		var _g = 0;
		var _g1 = storage.inactiveDateRenderers;
		while(_g < _g1.length) {
			var dateRenderer = _g1[_g];
			++_g;
			if(dateRenderer == null) {
				continue;
			}
			this.destroyDateRenderer(dateRenderer,recycler);
		}
		storage.inactiveDateRenderers.length = 0;
	}
	,createDateRenderer: function(state,storage) {
		var dateRenderer = null;
		if(storage.inactiveDateRenderers.length == 0) {
			dateRenderer = storage.dateRendererRecycler.create();
			if(js_Boot.__implements(dateRenderer,feathers_style_IVariantStyleObject)) {
				var variantItemRenderer = dateRenderer;
				if(variantItemRenderer.get_variant() == null) {
					if(storage == this._mutedStorage) {
						var variant = this.get_customMutedDateRendererVariant() != null ? this.get_customMutedDateRendererVariant() : feathers_controls_DatePicker.CHILD_VARIANT_MUTED_DATE_RENDERER;
						variantItemRenderer.set_variant(variant);
					} else {
						var variant = this.get_customDateRendererVariant() != null ? this.get_customDateRendererVariant() : feathers_controls_DatePicker.CHILD_VARIANT_DATE_RENDERER;
						variantItemRenderer.set_variant(variant);
					}
				}
			}
			if(js_Boot.__implements(dateRenderer,feathers_core_IUIControl)) {
				dateRenderer.initializeNow();
			}
			if(storage.measurements == null) {
				storage.measurements = new feathers_layout_Measurements(dateRenderer);
			}
		} else {
			dateRenderer = storage.inactiveDateRenderers.shift();
		}
		this.updateDateRenderer(dateRenderer,state,storage);
		if(js_Boot.__implements(dateRenderer,feathers_controls_ITriggerView)) {
			dateRenderer.addEventListener("trigger",$bind(this,this.datePicker_dateRenderer_triggerHandler));
		} else {
			dateRenderer.addEventListener("click",$bind(this,this.datePicker_dateRenderer_clickHandler));
			dateRenderer.addEventListener("touchTap",$bind(this,this.datePicker_dateRenderer_touchTapHandler));
		}
		if(js_Boot.__implements(dateRenderer,feathers_controls_IToggle)) {
			dateRenderer.addEventListener("change",$bind(this,this.datePicker_dateRenderer_changeHandler));
		}
		this.dateRendererToItemState.set(dateRenderer,state);
		storage.activeDateRenderers.push(dateRenderer);
		return dateRenderer;
	}
	,destroyDateRenderer: function(dateRenderer,recycler) {
		this.dateContainer.removeChild(dateRenderer);
		if(recycler != null && recycler.destroy != null) {
			recycler.destroy(dateRenderer);
		}
	}
	,populateCurrentItemState: function(date,state) {
		state.owner = this;
		state.date = date;
		state.selected = this._selectedDate != null && this._displayedFullYear == this._selectedDate.getFullYear() && this._displayedMonth == this._selectedDate.getMonth() && date.getFullYear() == this._selectedDate.getFullYear() && date.getMonth() == this._selectedDate.getMonth() && date.getDate() == this._selectedDate.getDate();
		state.enabled = this._enabled;
	}
	,resetDateRenderer: function(dateRenderer,state,storage) {
		var oldIgnoreSelectionChange = this._ignoreSelectionChange;
		this._ignoreSelectionChange = true;
		var recycler = storage.oldDateRendererRecycler != null ? storage.oldDateRendererRecycler : storage.dateRendererRecycler;
		if(recycler != null && recycler.reset != null) {
			recycler.reset(dateRenderer,state);
		}
		this._ignoreSelectionChange = oldIgnoreSelectionChange;
		this.refreshDateRendererProperties(dateRenderer,feathers_controls_DatePicker.RESET_ITEM_STATE);
		dateRenderer.set_visible(true);
	}
	,updateDateRenderer: function(dateRenderer,state,storage) {
		var oldIgnoreSelectionChange = this._ignoreSelectionChange;
		this._ignoreSelectionChange = true;
		if(storage.dateRendererRecycler.update != null) {
			storage.dateRendererRecycler.update(dateRenderer,state);
		}
		this._ignoreSelectionChange = oldIgnoreSelectionChange;
		this.refreshDateRendererProperties(dateRenderer,state);
		dateRenderer.set_visible(this.get_showDatesFromAdjacentMonths() || state.date != null && this._displayedFullYear == state.date.getFullYear() && this._displayedMonth == state.date.getMonth());
	}
	,refreshDateRendererProperties: function(dateRenderer,state) {
		var oldIgnoreSelectionChange = this._ignoreSelectionChange;
		this._ignoreSelectionChange = true;
		if(js_Boot.__implements(dateRenderer,feathers_core_IUIControl)) {
			var uiControl = dateRenderer;
			uiControl.set_enabled(state.enabled);
		}
		if(js_Boot.__implements(dateRenderer,feathers_controls_dataRenderers_IDataRenderer)) {
			var dataRenderer = dateRenderer;
			dataRenderer.set_data(state.date);
		}
		if(js_Boot.__implements(dateRenderer,feathers_controls_IToggle)) {
			var toggle = dateRenderer;
			toggle.set_selected(state.selected);
		}
		this._ignoreSelectionChange = oldIgnoreSelectionChange;
	}
	,renderUnrenderedData: function() {
		var startOfWeek = this._customStartOfWeek != null ? this._customStartOfWeek : 0;
		var dayIndexOfFirst = -startOfWeek + new Date(this._displayedFullYear,this._displayedMonth,1,0,0,0).getDay();
		if(dayIndexOfFirst < 0) {
			dayIndexOfFirst = 0;
		}
		var lastMonthYear = this._displayedFullYear;
		var lastMonth = this._displayedMonth - 1;
		if(lastMonth < 0) {
			lastMonth = 11;
			--lastMonthYear;
		}
		var numDays = feathers_utils_DateUtil.getDaysInMonth(this._displayedMonth,this._displayedFullYear);
		var numDaysLastMonth = feathers_utils_DateUtil.getDaysInMonth(lastMonth,lastMonthYear);
		var currentFullYear = this._displayedFullYear;
		var currentMonth = this._displayedMonth;
		var currentDate = numDaysLastMonth - dayIndexOfFirst + 1;
		if(currentDate > 1) {
			currentMonth = lastMonth;
			currentFullYear = lastMonthYear;
		}
		var _g = 0;
		while(_g < 42) {
			var i = _g++;
			if((currentMonth < this._displayedMonth || currentFullYear < this._displayedFullYear) && currentDate > numDaysLastMonth) {
				currentDate = 1;
				++currentMonth;
				if(currentMonth == 12) {
					currentMonth = 0;
					++currentFullYear;
				}
			}
			if(currentMonth == this._displayedMonth && currentDate > numDays) {
				currentDate = 1;
				++currentMonth;
				if(currentMonth == 12) {
					currentMonth = 0;
					++currentFullYear;
				}
			}
			var state = this.itemStatePool.get();
			var stateDate = new Date(currentFullYear,currentMonth,currentDate,0,0,0);
			this.populateCurrentItemState(stateDate,state);
			var storage = currentMonth == this._displayedMonth ? this._defaultStorage : this._mutedStorage;
			var dateRenderer = this.createDateRenderer(state,storage);
			this.dateContainer.addChildAt(dateRenderer,7 + i);
			this.updateDateRenderer(dateRenderer,state,storage);
			++currentDate;
		}
	}
	,refreshLocale: function() {
		var localeID = this._requestedLocaleIDName != null ? this._requestedLocaleIDName : "i-default";
		this._currentDateFormatter = new openfl_globalization_DateTimeFormatter(localeID,1,3);
		this._actualLocaleIDName = this._currentDateFormatter.actualLocaleIDName;
		this._currentDateFormatter.setDateTimePattern("MMMM yyyy");
		this._currentMonthNames = this._customMonthNames;
		if(this._currentMonthNames == null) {
			var monthNamesVector = this._currentDateFormatter.getMonthNames(0,0);
			this._currentMonthNames = [];
			var monthName = monthNamesVector.iterator();
			while(monthName.hasNext()) {
				var monthName1 = monthName.next();
				this._currentMonthNames.push(monthName1);
			}
		}
		this._currentWeekdayNames = this._customWeekdayNames;
		if(this._currentWeekdayNames == null) {
			var weekdayNamesVector = this._currentDateFormatter.getWeekdayNames(2,1);
			this._currentWeekdayNames = [];
			var weekdayName = weekdayNamesVector.iterator();
			while(weekdayName.hasNext()) {
				var weekdayName1 = weekdayName.next();
				this._currentWeekdayNames.push(weekdayName1.charAt(0));
			}
		}
		this._currentStartOfWeek = this._customStartOfWeek != null ? this._customStartOfWeek : this._currentDateFormatter.getFirstWeekday();
	}
	,refreshBackgroundSkin: function() {
		var oldSkin = this._currentBackgroundSkin;
		this._currentBackgroundSkin = this.getCurrentBackgroundSkin();
		if(this._currentBackgroundSkin == oldSkin) {
			return;
		}
		this.removeCurrentBackgroundSkin(oldSkin);
		this.addCurrentBackgroundSkin(this._currentBackgroundSkin);
	}
	,getCurrentBackgroundSkin: function() {
		if(!this._enabled && this.get_disabledBackgroundSkin() != null) {
			return this.get_disabledBackgroundSkin();
		}
		return this.get_backgroundSkin();
	}
	,addCurrentBackgroundSkin: function(skin) {
		if(skin == null) {
			this._backgroundSkinMeasurements = null;
			return;
		}
		if(js_Boot.__implements(skin,feathers_core_IUIControl)) {
			skin.initializeNow();
		}
		if(this._backgroundSkinMeasurements == null) {
			this._backgroundSkinMeasurements = new feathers_layout_Measurements(skin);
		} else {
			this._backgroundSkinMeasurements.save(skin);
		}
		if(js_Boot.__implements(skin,feathers_skins_IProgrammaticSkin)) {
			skin.set_uiContext(this);
		}
		this.addChildAt(skin,0);
	}
	,removeCurrentBackgroundSkin: function(skin) {
		if(skin == null) {
			return;
		}
		if(js_Boot.__implements(skin,feathers_skins_IProgrammaticSkin)) {
			skin.set_uiContext(null);
		}
		this._backgroundSkinMeasurements.restore(skin);
		if(skin.parent == this) {
			this.removeChild(skin);
		}
	}
	,layoutChildren: function() {
		this.layoutBackgroundSkin();
		this.decrementMonthButton.set_visible(this.get_showMonthButtons());
		this.incrementMonthButton.set_visible(this.get_showMonthButtons());
		this.decrementYearButton.set_visible(this.get_showYearButtons());
		this.incrementYearButton.set_visible(this.get_showYearButtons());
		this.monthTitleView.set_visible(this.get_showMonthTitleView());
		this.monthTitleView.validateNow();
		this.decrementMonthButton.validateNow();
		this.incrementMonthButton.validateNow();
		this.decrementYearButton.validateNow();
		this.incrementYearButton.validateNow();
		var maxButtonHeight = 0.0;
		if(this.get_showMonthButtons()) {
			maxButtonHeight = Math.max(maxButtonHeight,Math.max(this.decrementMonthButton.get_height(),this.incrementMonthButton.get_height()));
		}
		if(this.get_showYearButtons()) {
			maxButtonHeight = Math.max(maxButtonHeight,Math.max(this.decrementYearButton.get_height(),this.incrementYearButton.get_height()));
		}
		if(this.decrementMonthButton.get_height() != maxButtonHeight) {
			this.decrementMonthButton.set_height(maxButtonHeight);
		}
		if(this.incrementMonthButton.get_height() != maxButtonHeight) {
			this.incrementMonthButton.set_height(maxButtonHeight);
		}
		if(this.decrementYearButton.get_height() != maxButtonHeight) {
			this.decrementYearButton.set_height(maxButtonHeight);
		}
		if(this.incrementYearButton.get_height() != maxButtonHeight) {
			this.incrementYearButton.set_height(maxButtonHeight);
		}
		var headerHeight = maxButtonHeight;
		if(this.get_showMonthTitleView()) {
			headerHeight = Math.max(headerHeight,this.monthTitleView.get_height());
		}
		switch(this.get_monthTitleViewPosition()._hx_index) {
		case 0:
			this.monthTitleView.set_x(this.get_paddingLeft());
			var currentX = this.actualWidth - this.get_paddingRight();
			if(this.get_showYearButtons()) {
				currentX -= this.incrementYearButton.get_width();
				this.incrementYearButton.set_x(currentX);
				currentX -= this.get_headerGap();
			}
			if(this.get_showMonthButtons()) {
				currentX -= this.incrementMonthButton.get_width();
				this.incrementMonthButton.set_x(currentX);
				currentX -= this.get_headerGap();
			}
			if(this.get_showMonthButtons()) {
				currentX -= this.decrementMonthButton.get_width();
				this.decrementMonthButton.set_x(currentX);
				currentX -= this.get_headerGap();
			}
			if(this.get_showYearButtons()) {
				currentX -= this.decrementYearButton.get_width();
				this.decrementYearButton.set_x(currentX);
				currentX -= this.get_headerGap();
			}
			break;
		case 1:
			this.monthTitleView.set_x(this.get_paddingLeft() + (this.actualWidth - this.get_paddingLeft() - this.get_paddingRight() - this.monthTitleView.get_width()) / 2.0);
			var currentX = this.get_paddingLeft();
			if(this.get_showYearButtons()) {
				this.decrementYearButton.set_x(currentX);
				currentX += this.decrementYearButton.get_width() + this.get_headerGap();
			}
			if(this.get_showMonthButtons()) {
				this.decrementMonthButton.set_x(currentX);
				currentX += this.decrementMonthButton.get_width() + this.get_headerGap();
			}
			var currentX = this.actualWidth - this.get_paddingRight();
			if(this.get_showYearButtons()) {
				currentX -= this.incrementYearButton.get_width();
				this.incrementYearButton.set_x(currentX);
				currentX -= this.get_headerGap();
			}
			if(this.get_showMonthButtons()) {
				currentX -= this.incrementMonthButton.get_width();
				this.incrementMonthButton.set_x(currentX);
				currentX -= this.get_headerGap();
			}
			break;
		case 2:
			this.monthTitleView.set_x(this.actualWidth - this.get_paddingRight() - this.monthTitleView.get_width());
			var currentX = this.get_paddingLeft();
			if(this.get_showYearButtons()) {
				this.decrementYearButton.set_x(currentX);
				currentX += this.decrementYearButton.get_width() + this.get_headerGap();
			}
			if(this.get_showMonthButtons()) {
				this.decrementMonthButton.set_x(currentX);
				currentX += this.decrementMonthButton.get_width() + this.get_headerGap();
			}
			if(this.get_showMonthButtons()) {
				this.incrementMonthButton.set_x(currentX);
				currentX += this.incrementMonthButton.get_width() + this.get_headerGap();
			}
			if(this.get_showYearButtons()) {
				this.incrementYearButton.set_x(currentX);
				currentX += this.incrementYearButton.get_width() + this.get_headerGap();
			}
			break;
		default:
			throw new openfl_errors_ArgumentError("Invalid month position: " + Std.string(this.get_monthTitleViewPosition()));
		}
		if(this.get_showMonthTitleView()) {
			this.monthTitleView.set_y(this.get_paddingTop() + (headerHeight - this.monthTitleView.get_height()) / 2.0);
		}
		if(this.get_showMonthButtons()) {
			this.decrementMonthButton.set_y(this.get_paddingTop() + (headerHeight - this.decrementMonthButton.get_height()) / 2.0);
			this.incrementMonthButton.set_y(this.get_paddingTop() + (headerHeight - this.incrementMonthButton.get_height()) / 2.0);
		}
		if(this.get_showYearButtons()) {
			this.decrementYearButton.set_y(this.get_paddingTop() + (headerHeight - this.decrementYearButton.get_height()) / 2.0);
			this.incrementYearButton.set_y(this.get_paddingTop() + (headerHeight - this.incrementYearButton.get_height()) / 2.0);
		}
		this.dateContainer.set_x(this.get_paddingLeft());
		this.dateContainer.set_y(this.get_paddingTop() + headerHeight);
		var calendarWidth = this.actualWidth - this.get_paddingLeft() - this.get_paddingRight();
		var calendarHeight = this.actualHeight - headerHeight - this.get_paddingTop() - this.get_paddingBottom();
		if(this.dateContainer.get_width() != calendarWidth) {
			this.dateContainer.set_width(calendarWidth);
		}
		if(this.dateContainer.get_height() != calendarHeight) {
			this.dateContainer.set_height(calendarHeight);
		}
		this.dateContainer.validateNow();
	}
	,layoutBackgroundSkin: function() {
		if(this._currentBackgroundSkin == null) {
			return;
		}
		this._currentBackgroundSkin.set_x(0.0);
		this._currentBackgroundSkin.set_y(0.0);
		if(this._currentBackgroundSkin.get_width() != this.actualWidth) {
			this._currentBackgroundSkin.set_width(this.actualWidth);
		}
		if(this._currentBackgroundSkin.get_height() != this.actualHeight) {
			this._currentBackgroundSkin.set_height(this.actualHeight);
		}
		if(js_Boot.__implements(this._currentBackgroundSkin,feathers_core_IValidating)) {
			this._currentBackgroundSkin.validateNow();
		}
	}
	,refreshMonthTitle: function() {
		this.monthTitleView.set_text(this.getMonthText(this.get_displayedMonth(),this.get_displayedFullYear()));
	}
	,getMonthWithLongestName: function() {
		var maxLength = 0;
		var maxIndex = -1;
		var _g = 0;
		var _g1 = this._currentMonthNames.length;
		while(_g < _g1) {
			var i = _g++;
			var monthName = this._currentMonthNames[i];
			var currentLength = monthName.length;
			if(maxLength < currentLength) {
				maxLength = currentLength;
				maxIndex = i;
			}
		}
		return maxIndex;
	}
	,getMonthText: function(month,fullYear) {
		if(this._customMonthNames != null) {
			var monthName = this._currentMonthNames[month];
			return "" + monthName + " " + StringTools.lpad(fullYear == null ? "null" : "" + fullYear,"0",4);
		} else {
			return this._currentDateFormatter.format(new Date(fullYear,month,1,0,0,0));
		}
	}
	,navigateWithKeyboard: function(event) {
		if(event.isDefaultPrevented()) {
			return;
		}
		var result = null;
		if(this._selectedDate == null) {
			result = new Date();
		} else {
			var resultMonth = this._selectedDate.getMonth();
			var resultDate = this._selectedDate.getDate();
			switch(event.keyCode) {
			case 33:
				--resultMonth;
				break;
			case 34:
				++resultMonth;
				break;
			case 35:
				var currentDay = this._selectedDate.getDay();
				if(currentDay != 6) {
					resultDate += 6 - currentDay;
				}
				break;
			case 36:
				var currentDay = this._selectedDate.getDay();
				if(currentDay != 0) {
					resultDate -= currentDay;
				}
				break;
			case 37:
				--resultDate;
				break;
			case 38:
				resultDate -= 7;
				break;
			case 39:
				++resultDate;
				break;
			case 40:
				resultDate += 7;
				break;
			default:
				return;
			}
			result = new Date(this._selectedDate.getFullYear(),resultMonth,resultDate,this._selectedDate.getHours(),this._selectedDate.getMinutes(),this._selectedDate.getSeconds());
		}
		if(this._selectedDate != null && this._selectedDate.getTime() == result.getTime()) {
			return;
		}
		event.preventDefault();
		this.set_selectedDate(result);
		this.set_displayedFullYear(this.get_selectedDate().getFullYear());
		this.set_displayedMonth(this.get_selectedDate().getMonth());
	}
	,datePicker_decrementMonthButton_triggerHandler: function(event) {
		var displayedMonth = this._displayedMonth;
		var displayedFullYear = this._displayedFullYear;
		--displayedMonth;
		if(displayedMonth < 0) {
			displayedMonth = 11;
			--displayedFullYear;
		}
		this.set_displayedMonth(displayedMonth);
		this.set_displayedFullYear(displayedFullYear);
	}
	,datePicker_incrementMonthButton_triggerHandler: function(event) {
		var displayedMonth = this._displayedMonth;
		var displayedFullYear = this._displayedFullYear;
		++displayedMonth;
		if(displayedMonth > 11) {
			displayedMonth = 0;
			++displayedFullYear;
		}
		this.set_displayedMonth(displayedMonth);
		this.set_displayedFullYear(displayedFullYear);
	}
	,datePicker_decrementYearButton_triggerHandler: function(event) {
		this.set_displayedFullYear(this.get_displayedFullYear() - 1);
	}
	,datePicker_incrementYearButton_triggerHandler: function(event) {
		this.set_displayedFullYear(this.get_displayedFullYear() + 1);
	}
	,datePicker_dateRenderer_touchTapHandler: function(event) {
		if(!this._enabled) {
			return;
		}
		if(event.isPrimaryTouchPoint) {
			return;
		}
		var dateRenderer = js_Boot.__cast(event.currentTarget , openfl_display_DisplayObject);
		var state = this.dateRendererToItemState.h[dateRenderer.__id__];
		feathers_events_DatePickerEvent.dispatch(this,"itemTrigger",state);
		if(!this._selectable || !this.pointerSelectionEnabled) {
			return;
		}
		this.set_selectedDate(state.date);
		this.set_displayedFullYear(this.get_selectedDate().getFullYear());
		this.set_displayedMonth(this.get_selectedDate().getMonth());
	}
	,datePicker_dateRenderer_clickHandler: function(event) {
		if(!this._enabled) {
			return;
		}
		var dateRenderer = js_Boot.__cast(event.currentTarget , openfl_display_DisplayObject);
		var state = this.dateRendererToItemState.h[dateRenderer.__id__];
		feathers_events_DatePickerEvent.dispatch(this,"itemTrigger",state);
		if(!this._selectable || !this.pointerSelectionEnabled) {
			return;
		}
		this.set_selectedDate(state.date);
		this.set_displayedFullYear(this.get_selectedDate().getFullYear());
		this.set_displayedMonth(this.get_selectedDate().getMonth());
	}
	,datePicker_dateRenderer_triggerHandler: function(event) {
		if(!this._enabled) {
			return;
		}
		var dateRenderer = js_Boot.__cast(event.currentTarget , openfl_display_DisplayObject);
		var state = this.dateRendererToItemState.h[dateRenderer.__id__];
		feathers_events_DatePickerEvent.dispatch(this,"itemTrigger",state);
		if(!this._selectable) {
			return;
		}
		this.set_selectedDate(state.date);
		this.set_displayedFullYear(this.get_selectedDate().getFullYear());
		this.set_displayedMonth(this.get_selectedDate().getMonth());
	}
	,datePicker_dateRenderer_changeHandler: function(event) {
		if(this._ignoreSelectionChange) {
			return;
		}
		var dateRenderer = js_Boot.__cast(event.currentTarget , openfl_display_DisplayObject);
		var toggleDateRenderer = js_Boot.__cast(dateRenderer , feathers_controls_IToggle);
		var state = this.dateRendererToItemState.h[dateRenderer.__id__];
		if(toggleDateRenderer.get_selected() == state.selected) {
			return;
		}
		this.setInvalid(feathers_core_InvalidationFlag.SELECTION);
	}
	,datePicker_keyDownHandler: function(event) {
		if(!this._enabled || event.isDefaultPrevented()) {
			return;
		}
		if(this.stage != null && ((this.stage.get_focus()) instanceof openfl_text_TextField)) {
			var textField = this.stage.get_focus();
			if(textField.get_type() == 1) {
				return;
			}
		}
		this.navigateWithKeyboard(event);
	}
	,__backgroundSkin: null
	,get_backgroundSkin: function() {
		return this.__backgroundSkin;
	}
	,set_backgroundSkin: function(value) {
		if(!this.setStyle("backgroundSkin")) {
			return this.__backgroundSkin;
		}
		if(this.__backgroundSkin == value) {
			return this.__backgroundSkin;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_backgroundSkin);
		this.__backgroundSkin = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__backgroundSkin;
	}
	,clearStyle_backgroundSkin: function() {
		this.set_backgroundSkin(null);
		return this.get_backgroundSkin();
	}
	,__disabledBackgroundSkin: null
	,get_disabledBackgroundSkin: function() {
		return this.__disabledBackgroundSkin;
	}
	,set_disabledBackgroundSkin: function(value) {
		if(!this.setStyle("disabledBackgroundSkin")) {
			return this.__disabledBackgroundSkin;
		}
		if(this.__disabledBackgroundSkin == value) {
			return this.__disabledBackgroundSkin;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_disabledBackgroundSkin);
		this.__disabledBackgroundSkin = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__disabledBackgroundSkin;
	}
	,clearStyle_disabledBackgroundSkin: function() {
		this.set_disabledBackgroundSkin(null);
		return this.get_disabledBackgroundSkin();
	}
	,__customDecrementMonthButtonVariant: null
	,get_customDecrementMonthButtonVariant: function() {
		return this.__customDecrementMonthButtonVariant;
	}
	,set_customDecrementMonthButtonVariant: function(value) {
		if(!this.setStyle("customDecrementMonthButtonVariant")) {
			return this.__customDecrementMonthButtonVariant;
		}
		if(this.__customDecrementMonthButtonVariant == value) {
			return this.__customDecrementMonthButtonVariant;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_customDecrementMonthButtonVariant);
		this.__customDecrementMonthButtonVariant = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__customDecrementMonthButtonVariant;
	}
	,clearStyle_customDecrementMonthButtonVariant: function() {
		this.set_customDecrementMonthButtonVariant(null);
		return this.get_customDecrementMonthButtonVariant();
	}
	,__customIncrementMonthButtonVariant: null
	,get_customIncrementMonthButtonVariant: function() {
		return this.__customIncrementMonthButtonVariant;
	}
	,set_customIncrementMonthButtonVariant: function(value) {
		if(!this.setStyle("customIncrementMonthButtonVariant")) {
			return this.__customIncrementMonthButtonVariant;
		}
		if(this.__customIncrementMonthButtonVariant == value) {
			return this.__customIncrementMonthButtonVariant;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_customIncrementMonthButtonVariant);
		this.__customIncrementMonthButtonVariant = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__customIncrementMonthButtonVariant;
	}
	,clearStyle_customIncrementMonthButtonVariant: function() {
		this.set_customIncrementMonthButtonVariant(null);
		return this.get_customIncrementMonthButtonVariant();
	}
	,__customDecrementYearButtonVariant: null
	,get_customDecrementYearButtonVariant: function() {
		return this.__customDecrementYearButtonVariant;
	}
	,set_customDecrementYearButtonVariant: function(value) {
		if(!this.setStyle("customDecrementYearButtonVariant")) {
			return this.__customDecrementYearButtonVariant;
		}
		if(this.__customDecrementYearButtonVariant == value) {
			return this.__customDecrementYearButtonVariant;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_customDecrementYearButtonVariant);
		this.__customDecrementYearButtonVariant = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__customDecrementYearButtonVariant;
	}
	,clearStyle_customDecrementYearButtonVariant: function() {
		this.set_customDecrementYearButtonVariant(null);
		return this.get_customDecrementYearButtonVariant();
	}
	,__customIncrementYearButtonVariant: null
	,get_customIncrementYearButtonVariant: function() {
		return this.__customIncrementYearButtonVariant;
	}
	,set_customIncrementYearButtonVariant: function(value) {
		if(!this.setStyle("customIncrementYearButtonVariant")) {
			return this.__customIncrementYearButtonVariant;
		}
		if(this.__customIncrementYearButtonVariant == value) {
			return this.__customIncrementYearButtonVariant;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_customIncrementYearButtonVariant);
		this.__customIncrementYearButtonVariant = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__customIncrementYearButtonVariant;
	}
	,clearStyle_customIncrementYearButtonVariant: function() {
		this.set_customIncrementYearButtonVariant(null);
		return this.get_customIncrementYearButtonVariant();
	}
	,__customMonthTitleViewVariant: null
	,get_customMonthTitleViewVariant: function() {
		return this.__customMonthTitleViewVariant;
	}
	,set_customMonthTitleViewVariant: function(value) {
		if(!this.setStyle("customMonthTitleViewVariant")) {
			return this.__customMonthTitleViewVariant;
		}
		if(this.__customMonthTitleViewVariant == value) {
			return this.__customMonthTitleViewVariant;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_customMonthTitleViewVariant);
		this.__customMonthTitleViewVariant = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__customMonthTitleViewVariant;
	}
	,clearStyle_customMonthTitleViewVariant: function() {
		this.set_customMonthTitleViewVariant(null);
		return this.get_customMonthTitleViewVariant();
	}
	,__headerGap: null
	,get_headerGap: function() {
		return this.__headerGap;
	}
	,set_headerGap: function(value) {
		if(!this.setStyle("headerGap")) {
			return this.__headerGap;
		}
		if(this.__headerGap == value) {
			return this.__headerGap;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_headerGap);
		this.__headerGap = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__headerGap;
	}
	,clearStyle_headerGap: function() {
		this.set_headerGap(0.0);
		return this.get_headerGap();
	}
	,__paddingTop: null
	,get_paddingTop: function() {
		return this.__paddingTop;
	}
	,set_paddingTop: function(value) {
		if(!this.setStyle("paddingTop")) {
			return this.__paddingTop;
		}
		if(this.__paddingTop == value) {
			return this.__paddingTop;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_paddingTop);
		this.__paddingTop = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__paddingTop;
	}
	,clearStyle_paddingTop: function() {
		this.set_paddingTop(0.0);
		return this.get_paddingTop();
	}
	,__paddingRight: null
	,get_paddingRight: function() {
		return this.__paddingRight;
	}
	,set_paddingRight: function(value) {
		if(!this.setStyle("paddingRight")) {
			return this.__paddingRight;
		}
		if(this.__paddingRight == value) {
			return this.__paddingRight;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_paddingRight);
		this.__paddingRight = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__paddingRight;
	}
	,clearStyle_paddingRight: function() {
		this.set_paddingRight(0.0);
		return this.get_paddingRight();
	}
	,__paddingBottom: null
	,get_paddingBottom: function() {
		return this.__paddingBottom;
	}
	,set_paddingBottom: function(value) {
		if(!this.setStyle("paddingBottom")) {
			return this.__paddingBottom;
		}
		if(this.__paddingBottom == value) {
			return this.__paddingBottom;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_paddingBottom);
		this.__paddingBottom = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__paddingBottom;
	}
	,clearStyle_paddingBottom: function() {
		this.set_paddingBottom(0.0);
		return this.get_paddingBottom();
	}
	,__paddingLeft: null
	,get_paddingLeft: function() {
		return this.__paddingLeft;
	}
	,set_paddingLeft: function(value) {
		if(!this.setStyle("paddingLeft")) {
			return this.__paddingLeft;
		}
		if(this.__paddingLeft == value) {
			return this.__paddingLeft;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_paddingLeft);
		this.__paddingLeft = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__paddingLeft;
	}
	,clearStyle_paddingLeft: function() {
		this.set_paddingLeft(0.0);
		return this.get_paddingLeft();
	}
	,__monthTitleViewPosition: null
	,get_monthTitleViewPosition: function() {
		return this.__monthTitleViewPosition;
	}
	,set_monthTitleViewPosition: function(value) {
		if(!this.setStyle("monthTitleViewPosition")) {
			return this.__monthTitleViewPosition;
		}
		if(this.__monthTitleViewPosition == value) {
			return this.__monthTitleViewPosition;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_monthTitleViewPosition);
		this.__monthTitleViewPosition = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__monthTitleViewPosition;
	}
	,clearStyle_monthTitleViewPosition: function() {
		this.set_monthTitleViewPosition(feathers_layout_HorizontalAlign.CENTER);
		return this.get_monthTitleViewPosition();
	}
	,__showMonthTitleView: null
	,get_showMonthTitleView: function() {
		return this.__showMonthTitleView;
	}
	,set_showMonthTitleView: function(value) {
		if(!this.setStyle("showMonthTitleView")) {
			return this.__showMonthTitleView;
		}
		if(this.__showMonthTitleView == value) {
			return this.__showMonthTitleView;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_showMonthTitleView);
		this.__showMonthTitleView = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__showMonthTitleView;
	}
	,clearStyle_showMonthTitleView: function() {
		this.set_showMonthTitleView(true);
		return this.get_showMonthTitleView();
	}
	,__showMonthButtons: null
	,get_showMonthButtons: function() {
		return this.__showMonthButtons;
	}
	,set_showMonthButtons: function(value) {
		if(!this.setStyle("showMonthButtons")) {
			return this.__showMonthButtons;
		}
		if(this.__showMonthButtons == value) {
			return this.__showMonthButtons;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_showMonthButtons);
		this.__showMonthButtons = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__showMonthButtons;
	}
	,clearStyle_showMonthButtons: function() {
		this.set_showMonthButtons(true);
		return this.get_showMonthButtons();
	}
	,__showYearButtons: null
	,get_showYearButtons: function() {
		return this.__showYearButtons;
	}
	,set_showYearButtons: function(value) {
		if(!this.setStyle("showYearButtons")) {
			return this.__showYearButtons;
		}
		if(this.__showYearButtons == value) {
			return this.__showYearButtons;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_showYearButtons);
		this.__showYearButtons = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__showYearButtons;
	}
	,clearStyle_showYearButtons: function() {
		this.set_showYearButtons(true);
		return this.get_showYearButtons();
	}
	,__showWeekdayLabels: null
	,get_showWeekdayLabels: function() {
		return this.__showWeekdayLabels;
	}
	,set_showWeekdayLabels: function(value) {
		if(!this.setStyle("showWeekdayLabels")) {
			return this.__showWeekdayLabels;
		}
		if(this.__showWeekdayLabels == value) {
			return this.__showWeekdayLabels;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_showWeekdayLabels);
		this.__showWeekdayLabels = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__showWeekdayLabels;
	}
	,clearStyle_showWeekdayLabels: function() {
		this.set_showWeekdayLabels(true);
		return this.get_showWeekdayLabels();
	}
	,__customWeekdayLabelVariant: null
	,get_customWeekdayLabelVariant: function() {
		return this.__customWeekdayLabelVariant;
	}
	,set_customWeekdayLabelVariant: function(value) {
		if(!this.setStyle("customWeekdayLabelVariant")) {
			return this.__customWeekdayLabelVariant;
		}
		if(this.__customWeekdayLabelVariant == value) {
			return this.__customWeekdayLabelVariant;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_customWeekdayLabelVariant);
		this.__customWeekdayLabelVariant = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__customWeekdayLabelVariant;
	}
	,clearStyle_customWeekdayLabelVariant: function() {
		this.set_customWeekdayLabelVariant(null);
		return this.get_customWeekdayLabelVariant();
	}
	,__customDateRendererVariant: null
	,get_customDateRendererVariant: function() {
		return this.__customDateRendererVariant;
	}
	,set_customDateRendererVariant: function(value) {
		if(!this.setStyle("customDateRendererVariant")) {
			return this.__customDateRendererVariant;
		}
		if(this.__customDateRendererVariant == value) {
			return this.__customDateRendererVariant;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_customDateRendererVariant);
		this.__customDateRendererVariant = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__customDateRendererVariant;
	}
	,clearStyle_customDateRendererVariant: function() {
		this.set_customDateRendererVariant(null);
		return this.get_customDateRendererVariant();
	}
	,__customMutedDateRendererVariant: null
	,get_customMutedDateRendererVariant: function() {
		return this.__customMutedDateRendererVariant;
	}
	,set_customMutedDateRendererVariant: function(value) {
		if(!this.setStyle("customMutedDateRendererVariant")) {
			return this.__customMutedDateRendererVariant;
		}
		if(this.__customMutedDateRendererVariant == value) {
			return this.__customMutedDateRendererVariant;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_customMutedDateRendererVariant);
		this.__customMutedDateRendererVariant = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__customMutedDateRendererVariant;
	}
	,clearStyle_customMutedDateRendererVariant: function() {
		this.set_customMutedDateRendererVariant(null);
		return this.get_customMutedDateRendererVariant();
	}
	,__showDatesFromAdjacentMonths: null
	,get_showDatesFromAdjacentMonths: function() {
		return this.__showDatesFromAdjacentMonths;
	}
	,set_showDatesFromAdjacentMonths: function(value) {
		if(!this.setStyle("showDatesFromAdjacentMonths")) {
			return this.__showDatesFromAdjacentMonths;
		}
		if(this.__showDatesFromAdjacentMonths == value) {
			return this.__showDatesFromAdjacentMonths;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_showDatesFromAdjacentMonths);
		this.__showDatesFromAdjacentMonths = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__showDatesFromAdjacentMonths;
	}
	,clearStyle_showDatesFromAdjacentMonths: function() {
		this.set_showDatesFromAdjacentMonths(true);
		return this.get_showDatesFromAdjacentMonths();
	}
	,get_styleContext: function() {
		return feathers_controls_DatePicker;
	}
	,__class__: feathers_controls_DatePicker
	,__properties__: $extend(feathers_core_FeathersControl.prototype.__properties__,{set_showDatesFromAdjacentMonths:"set_showDatesFromAdjacentMonths",get_showDatesFromAdjacentMonths:"get_showDatesFromAdjacentMonths",set_dateRendererRecycler:"set_dateRendererRecycler",get_dateRendererRecycler:"get_dateRendererRecycler",set_customMutedDateRendererVariant:"set_customMutedDateRendererVariant",get_customMutedDateRendererVariant:"get_customMutedDateRendererVariant",set_customDateRendererVariant:"set_customDateRendererVariant",get_customDateRendererVariant:"get_customDateRendererVariant",set_customWeekdayLabelVariant:"set_customWeekdayLabelVariant",get_customWeekdayLabelVariant:"get_customWeekdayLabelVariant",set_weekdayLabelFactory:"set_weekdayLabelFactory",get_weekdayLabelFactory:"get_weekdayLabelFactory",set_customStartOfWeek:"set_customStartOfWeek",get_customStartOfWeek:"get_customStartOfWeek",set_customWeekdayNames:"set_customWeekdayNames",get_customWeekdayNames:"get_customWeekdayNames",set_customMonthNames:"set_customMonthNames",get_customMonthNames:"get_customMonthNames",get_actualLocaleIDName:"get_actualLocaleIDName",set_requestedLocaleIDName:"set_requestedLocaleIDName",get_requestedLocaleIDName:"get_requestedLocaleIDName",set_showWeekdayLabels:"set_showWeekdayLabels",get_showWeekdayLabels:"get_showWeekdayLabels",set_showYearButtons:"set_showYearButtons",get_showYearButtons:"get_showYearButtons",set_showMonthButtons:"set_showMonthButtons",get_showMonthButtons:"get_showMonthButtons",set_showMonthTitleView:"set_showMonthTitleView",get_showMonthTitleView:"get_showMonthTitleView",set_monthTitleViewPosition:"set_monthTitleViewPosition",get_monthTitleViewPosition:"get_monthTitleViewPosition",set_paddingLeft:"set_paddingLeft",get_paddingLeft:"get_paddingLeft",set_paddingBottom:"set_paddingBottom",get_paddingBottom:"get_paddingBottom",set_paddingRight:"set_paddingRight",get_paddingRight:"get_paddingRight",set_paddingTop:"set_paddingTop",get_paddingTop:"get_paddingTop",set_headerGap:"set_headerGap",get_headerGap:"get_headerGap",set_customMonthTitleViewVariant:"set_customMonthTitleViewVariant",get_customMonthTitleViewVariant:"get_customMonthTitleViewVariant",set_monthTitleViewFactory:"set_monthTitleViewFactory",get_monthTitleViewFactory:"get_monthTitleViewFactory",set_customIncrementYearButtonVariant:"set_customIncrementYearButtonVariant",get_customIncrementYearButtonVariant:"get_customIncrementYearButtonVariant",set_incrementYearButtonFactory:"set_incrementYearButtonFactory",get_incrementYearButtonFactory:"get_incrementYearButtonFactory",set_customDecrementYearButtonVariant:"set_customDecrementYearButtonVariant",get_customDecrementYearButtonVariant:"get_customDecrementYearButtonVariant",set_decrementYearButtonFactory:"set_decrementYearButtonFactory",get_decrementYearButtonFactory:"get_decrementYearButtonFactory",set_customIncrementMonthButtonVariant:"set_customIncrementMonthButtonVariant",get_customIncrementMonthButtonVariant:"get_customIncrementMonthButtonVariant",set_incrementMonthButtonFactory:"set_incrementMonthButtonFactory",get_incrementMonthButtonFactory:"get_incrementMonthButtonFactory",set_customDecrementMonthButtonVariant:"set_customDecrementMonthButtonVariant",get_customDecrementMonthButtonVariant:"get_customDecrementMonthButtonVariant",set_decrementMonthButtonFactory:"set_decrementMonthButtonFactory",get_decrementMonthButtonFactory:"get_decrementMonthButtonFactory",set_disabledBackgroundSkin:"set_disabledBackgroundSkin",get_disabledBackgroundSkin:"get_disabledBackgroundSkin",set_backgroundSkin:"set_backgroundSkin",get_backgroundSkin:"get_backgroundSkin",set_selectedDate:"set_selectedDate",get_selectedDate:"get_selectedDate",set_selectable:"set_selectable",get_selectable:"get_selectable",set_displayedMonth:"set_displayedMonth",get_displayedMonth:"get_displayedMonth",set_displayedFullYear:"set_displayedFullYear",get_displayedFullYear:"get_displayedFullYear"})
});
var feathers_controls__$DatePicker_DateRendererStorage = function(id,recycler) {
	this.inactiveDateRenderers = [];
	this.activeDateRenderers = [];
	this.id = id;
	this.dateRendererRecycler = recycler;
};
$hxClasses["feathers.controls._DatePicker.DateRendererStorage"] = feathers_controls__$DatePicker_DateRendererStorage;
feathers_controls__$DatePicker_DateRendererStorage.__name__ = "feathers.controls._DatePicker.DateRendererStorage";
feathers_controls__$DatePicker_DateRendererStorage.prototype = {
	id: null
	,oldDateRendererRecycler: null
	,dateRendererRecycler: null
	,activeDateRenderers: null
	,inactiveDateRenderers: null
	,measurements: null
	,__class__: feathers_controls__$DatePicker_DateRendererStorage
};
var feathers_controls_Form = function() {
	this.initializeFormTheme();
	feathers_controls_LayoutGroup.call(this);
	this.addEventListener("keyDown",$bind(this,this.form_keyDownHandler));
};
$hxClasses["feathers.controls.Form"] = feathers_controls_Form;
feathers_controls_Form.__name__ = "feathers.controls.Form";
feathers_controls_Form.__super__ = feathers_controls_LayoutGroup;
feathers_controls_Form.prototype = $extend(feathers_controls_LayoutGroup.prototype,{
	_submitButton: null
	,get_submitButton: function() {
		return this._submitButton;
	}
	,set_submitButton: function(value) {
		if(this._submitButton == value) {
			return this._submitButton;
		}
		if(this._submitButton != null) {
			this._submitButton.removeEventListener("trigger",$bind(this,this.form_submitButton_triggerHandler));
		}
		this._submitButton = value;
		if(this._submitButton != null) {
			this._submitButton.addEventListener("trigger",$bind(this,this.form_submitButton_triggerHandler),false,0,true);
		}
		return this._submitButton;
	}
	,submit: function() {
		feathers_events_FormEvent.dispatch(this,"submit");
	}
	,dispose: function() {
		if(this._submitButton != null) {
			this.set_submitButton(null);
		}
		feathers_controls_LayoutGroup.prototype.dispose.call(this);
	}
	,initializeFormTheme: function() {
		feathers_themes_steel_components_SteelFormStyles.initialize();
	}
	,form_keyDownHandler: function(event) {
		if(!this._enabled) {
			return;
		}
		if(event.keyCode != 13) {
			return;
		}
		if(event.isDefaultPrevented()) {
			return;
		}
		var current = js_Boot.__cast(event.target , openfl_display_DisplayObject);
		while(current != this && current != null) {
			if(((current) instanceof feathers_controls_FormItem)) {
				var formItem = current;
				if(!formItem.submitOnEnterEnabled) {
					return;
				}
			}
			current = current.parent;
		}
		event.preventDefault();
		this.submit();
	}
	,form_submitButton_triggerHandler: function(event) {
		this.submit();
	}
	,get_styleContext: function() {
		return feathers_controls_Form;
	}
	,__class__: feathers_controls_Form
	,__properties__: $extend(feathers_controls_LayoutGroup.prototype.__properties__,{set_submitButton:"set_submitButton",get_submitButton:"get_submitButton"})
});
var feathers_controls_FormItem = function(text,content,required) {
	if(required == null) {
		required = false;
	}
	if(text == null) {
		text = "";
	}
	this.__textPosition = feathers_layout_RelativePosition.TOP;
	this.__disabledBackgroundSkin = null;
	this.__backgroundSkin = null;
	this.__wordWrap = false;
	this.__verticalAlign = feathers_layout_VerticalAlign.MIDDLE;
	this.__horizontalAlign = feathers_layout_HorizontalAlign.LEFT;
	this.__gap = 0.0;
	this.__paddingLeft = 0.0;
	this.__paddingBottom = 0.0;
	this.__paddingRight = 0.0;
	this.__paddingTop = 0.0;
	this.__embedFonts = false;
	this.__disabledTextFormat = null;
	this.__styleSheet = null;
	this.__textFormat = null;
	this.__requiredSkin = null;
	this._backgroundSkinMeasurements = null;
	this._currentBackgroundSkin = null;
	this._customTextColumnWidth = null;
	this._requiredSkinMeasurements = null;
	this._currentRequiredSkin = null;
	this.submitOnEnterEnabled = true;
	this._required = false;
	this._selectable = false;
	this._ignoreContentResize = false;
	this._currentContent = null;
	this._contentMeasurements = null;
	this._htmlText = null;
	this._wrappedOnMeasure = false;
	this._updatedTextStyles = false;
	this._previousSimpleTextFormat = null;
	this._previousTextFormat = null;
	this._previousHTMLText = null;
	this._previousText = null;
	this.initializeFormItemTheme();
	feathers_core_FeathersControl.call(this);
	this.set_text(text);
	this.set_content(content);
	this.set_required(required);
};
$hxClasses["feathers.controls.FormItem"] = feathers_controls_FormItem;
feathers_controls_FormItem.__name__ = "feathers.controls.FormItem";
feathers_controls_FormItem.__interfaces__ = [feathers_core_IFocusManagerAware,feathers_core_ITextControl];
feathers_controls_FormItem.__super__ = feathers_core_FeathersControl;
feathers_controls_FormItem.prototype = $extend(feathers_core_FeathersControl.prototype,{
	textField: null
	,_previousText: null
	,_previousHTMLText: null
	,_previousTextFormat: null
	,_previousSimpleTextFormat: null
	,_updatedTextStyles: null
	,_textMeasuredWidth: null
	,_textMeasuredHeight: null
	,_wrappedOnMeasure: null
	,_text: null
	,get_text: function() {
		return this._text;
	}
	,set_text: function(value) {
		if(value == null) {
			if(this._text.length == 0) {
				return this._text;
			}
			value = "";
		}
		if(this._text == value) {
			return this._text;
		}
		this._text = value;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		if(this._customTextColumnWidth != null && (this.get_textPosition() == feathers_layout_RelativePosition.LEFT || this.get_textPosition() == feathers_layout_RelativePosition.RIGHT)) {
			feathers_events_FeathersEvent.dispatch(this,"resize");
		}
		return this._text;
	}
	,_htmlText: null
	,get_htmlText: function() {
		return this._htmlText;
	}
	,set_htmlText: function(value) {
		if(this._htmlText == value) {
			return this._htmlText;
		}
		this._htmlText = value;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		return this._htmlText;
	}
	,get_baseline: function() {
		if(this.textField == null) {
			return 0.0;
		}
		var textFieldBaseline = 0.0;
		var hasText = this._text != null && this._text.length > 0;
		var hasHTMLText = this._htmlText != null && this._htmlText.length > 0;
		if(hasText || hasHTMLText) {
			textFieldBaseline = this.textField.get_y() + this.textField.getLineMetrics(0).ascent;
		} else {
			this.textField.set_text("​");
			textFieldBaseline = this.textField.get_y() + this.textField.getLineMetrics(0).ascent;
			this.textField.set_text("");
		}
		var contentBaseline = 0.0;
		if(js_Boot.__implements(this._currentContent,feathers_core_ITextControl)) {
			contentBaseline = this._currentContent.get_y() + this._currentContent.get_baseline();
		}
		return Math.max(textFieldBaseline,contentBaseline);
	}
	,_contentMeasurements: null
	,_currentContent: null
	,_ignoreContentResize: null
	,_content: null
	,get_content: function() {
		return this._content;
	}
	,set_content: function(value) {
		if(this._content == value) {
			return this._content;
		}
		if(this._content != null) {
			this._content.removeEventListener("resize",$bind(this,this.formItem_content_resizeHandler));
		}
		this._content = value;
		if(this._content != null) {
			this._content.addEventListener("resize",$bind(this,this.formItem_content_resizeHandler),false,0,true);
		}
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		return this._content;
	}
	,_selectable: null
	,get_selectable: function() {
		return this._selectable;
	}
	,set_selectable: function(value) {
		if(this._selectable == value) {
			return this._selectable;
		}
		this._selectable = value;
		this.setInvalid(feathers_core_InvalidationFlag.SELECTION);
		return this._selectable;
	}
	,get_selectionBeginIndex: function() {
		if(!this._selectable) {
			return -1;
		}
		if(this.textField == null) {
			return 0;
		}
		return this.textField.get_selectionBeginIndex();
	}
	,get_selectionEndIndex: function() {
		if(!this._selectable) {
			return -1;
		}
		if(this.textField == null) {
			return 0;
		}
		return this.textField.get_selectionEndIndex();
	}
	,_required: null
	,get_required: function() {
		return this._required;
	}
	,set_required: function(value) {
		if(this._required == value) {
			return this._required;
		}
		this._required = value;
		this.setInvalid(feathers_core_InvalidationFlag.SELECTION);
		if(this._customTextColumnWidth != null && (this.get_textPosition() == feathers_layout_RelativePosition.LEFT || this.get_textPosition() == feathers_layout_RelativePosition.RIGHT)) {
			feathers_events_FeathersEvent.dispatch(this,"resize");
		}
		return this._required;
	}
	,submitOnEnterEnabled: null
	,_currentRequiredSkin: null
	,_requiredSkinMeasurements: null
	,_customTextColumnWidth: null
	,get_customTextColumnWidth: function() {
		return this._customTextColumnWidth;
	}
	,set_customTextColumnWidth: function(value) {
		if(this._customTextColumnWidth == value) {
			return this._customTextColumnWidth;
		}
		this._customTextColumnWidth = value;
		this.setInvalid(feathers_core_InvalidationFlag.SIZE);
		return this._customTextColumnWidth;
	}
	,_currentBackgroundSkin: null
	,_backgroundSkinMeasurements: null
	,getTextMeasuredWidth: function() {
		var result = this._textMeasuredWidth;
		if(this._currentRequiredSkin != null) {
			result += this.get_gap() + this._currentRequiredSkin.get_width();
		}
		return result;
	}
	,getTextMeasuredMaxWidth: function() {
		if(this._explicitWidth != null) {
			var textMeasuredWidth = this.getTextMeasuredWidth();
			var maxWidth = this._explicitWidth;
			if(this._currentContent != null) {
				if(js_Boot.__implements(this._currentContent,feathers_core_IMeasureObject)) {
					maxWidth -= this._currentContent.get_minWidth();
				} else {
					maxWidth -= this._currentContent.get_width();
				}
				maxWidth -= this.get_gap();
			}
			if(maxWidth < 0.0) {
				maxWidth = 0.0;
			}
			if(textMeasuredWidth > maxWidth) {
				return maxWidth;
			}
		}
		return 1.0 / 0.0;
	}
	,setPadding: function(value) {
		this.set_paddingTop(value);
		this.set_paddingRight(value);
		this.set_paddingBottom(value);
		this.set_paddingLeft(value);
	}
	,initializeFormItemTheme: function() {
		feathers_themes_steel_components_SteelFormItemStyles.initialize();
	}
	,initialize: function() {
		feathers_core_FeathersControl.prototype.initialize.call(this);
		if(this.textField == null) {
			this.textField = new openfl_text_TextField();
			this.textField.set_multiline(true);
			this.addChild(this.textField);
		}
		this.textField.addEventListener("click",$bind(this,this.formItem_textField_clickHandler));
	}
	,update: function() {
		var dataInvalid = this.isInvalid(feathers_core_InvalidationFlag.DATA);
		var selectionInvalid = this.isInvalid(feathers_core_InvalidationFlag.SELECTION);
		var sizeInvalid = this.isInvalid(feathers_core_InvalidationFlag.SIZE);
		var stateInvalid = this.isInvalid(feathers_core_InvalidationFlag.STATE);
		var stylesInvalid = this.isInvalid(feathers_core_InvalidationFlag.STYLES);
		this._updatedTextStyles = false;
		if(stylesInvalid || stateInvalid) {
			this.refreshBackgroundSkin();
		}
		if(stylesInvalid || selectionInvalid) {
			this.refreshRequiredSkin();
		}
		if(stylesInvalid || stateInvalid) {
			this.refreshTextStyles();
		}
		if(dataInvalid || stylesInvalid || stateInvalid || sizeInvalid) {
			this.refreshText(sizeInvalid);
		}
		if(dataInvalid || stylesInvalid || selectionInvalid) {
			this.refreshSelection();
		}
		if(dataInvalid) {
			this.refreshContent();
		}
		if(dataInvalid || stateInvalid) {
			this.refreshEnabled();
		}
		if(this.measure()) {
			sizeInvalid = true;
		}
		this.layoutContent();
	}
	,measure: function() {
		var needsWidth = this.get_explicitWidth() == null;
		var needsHeight = this.get_explicitHeight() == null;
		var needsMinWidth = this.get_explicitMinWidth() == null;
		var needsMinHeight = this.get_explicitMinHeight() == null;
		var needsMaxWidth = this.get_explicitMaxWidth() == null;
		var needsMaxHeight = this.get_explicitMaxHeight() == null;
		if(!needsWidth && !needsHeight && !needsMinWidth && !needsMinHeight && !needsMaxWidth && !needsMaxHeight) {
			return false;
		}
		if(this._currentBackgroundSkin != null) {
			feathers_utils_MeasurementsUtil.resetFluidlyWithParent(this._backgroundSkinMeasurements,this._currentBackgroundSkin,this);
		}
		var measureSkin = null;
		if(js_Boot.__implements(this._currentBackgroundSkin,feathers_core_IMeasureObject)) {
			measureSkin = this._currentBackgroundSkin;
		}
		if(js_Boot.__implements(this._currentBackgroundSkin,feathers_core_IValidating)) {
			this._currentBackgroundSkin.validateNow();
		}
		if(js_Boot.__implements(this._currentRequiredSkin,feathers_core_IValidating)) {
			this._currentRequiredSkin.validateNow();
		}
		var measureContent = null;
		if(js_Boot.__implements(this._currentContent,feathers_core_IMeasureObject)) {
			measureContent = this._currentContent;
		}
		var measureRequiredSkin = null;
		if(js_Boot.__implements(this._currentRequiredSkin,feathers_core_IMeasureObject)) {
			measureRequiredSkin = this._currentRequiredSkin;
		}
		if(this._currentContent != null) {
			var textWidthOffset = 0.0;
			var textHeightOffset = 0.0;
			if(this.get_textPosition() == feathers_layout_RelativePosition.TOP || this.get_textPosition() == feathers_layout_RelativePosition.BOTTOM) {
				textHeightOffset = this._textMeasuredHeight + this.get_gap();
			} else if(this._customTextColumnWidth != null) {
				textWidthOffset = this._customTextColumnWidth + this.get_gap();
			} else {
				textWidthOffset = this._textMeasuredWidth + this.get_gap();
				if(this._currentRequiredSkin != null) {
					textWidthOffset += this._currentRequiredSkin.get_width() + this.get_gap();
				}
			}
			if(this.get_horizontalAlign() == feathers_layout_HorizontalAlign.JUSTIFY || this.get_verticalAlign() == feathers_layout_VerticalAlign.JUSTIFY) {
				var justifyWidth = null;
				var justifyHeight = null;
				var justifyMinWidth = null;
				var justifyMinHeight = null;
				var justifyMaxWidth = null;
				var justifyMaxHeight = null;
				if(this.get_horizontalAlign() == feathers_layout_HorizontalAlign.JUSTIFY) {
					justifyWidth = this.get_explicitWidth() != null ? this.get_explicitWidth() - textWidthOffset - this.get_paddingLeft() - this.get_paddingRight() : null;
					justifyMinWidth = this.get_explicitMinWidth() != null ? this.get_explicitMinWidth() - textWidthOffset - this.get_paddingLeft() - this.get_paddingRight() : null;
					justifyMaxWidth = this.get_explicitMaxWidth() != null ? this.get_explicitMaxWidth() - textWidthOffset - this.get_paddingLeft() - this.get_paddingRight() : null;
				}
				if(this.get_verticalAlign() == feathers_layout_VerticalAlign.JUSTIFY) {
					justifyHeight = this.get_explicitHeight() != null ? this.get_explicitHeight() - textHeightOffset - this.get_paddingTop() - this.get_paddingBottom() : null;
					justifyMinHeight = this.get_explicitMinHeight() != null ? this.get_explicitMinHeight() - textHeightOffset - this.get_paddingLeft() - this.get_paddingRight() : null;
					justifyMaxHeight = this.get_explicitMaxHeight() != null ? this.get_explicitMaxHeight() - textHeightOffset - this.get_paddingLeft() - this.get_paddingRight() : null;
				}
				feathers_utils_MeasurementsUtil.resetFluidlyWithParentValues(this._contentMeasurements,this._currentContent,justifyWidth,justifyHeight,justifyMinWidth,justifyMinHeight,justifyMaxWidth,justifyMaxHeight);
			} else {
				this._contentMeasurements.restore(this._currentContent);
			}
			var oldIgnoreContentResize = this._ignoreContentResize;
			this._ignoreContentResize = true;
			if(js_Boot.__implements(this._currentContent,feathers_core_IValidating)) {
				this._currentContent.validateNow();
			}
			this._ignoreContentResize = oldIgnoreContentResize;
		}
		var newWidth = this.get_explicitWidth();
		if(needsWidth) {
			newWidth = this._textMeasuredWidth;
			if(this._customTextColumnWidth != null && (this.get_textPosition() == feathers_layout_RelativePosition.LEFT || this.get_textPosition() == feathers_layout_RelativePosition.RIGHT)) {
				newWidth = this._customTextColumnWidth;
			} else if(measureRequiredSkin != null) {
				newWidth += this.get_gap() + measureRequiredSkin.get_width();
			} else if(this._requiredSkinMeasurements != null && this._requiredSkinMeasurements.width != null) {
				newWidth += this.get_gap() + this._requiredSkinMeasurements.width;
			}
			newWidth += this.get_paddingLeft() + this.get_paddingRight();
			if(this._currentContent != null) {
				if(this.get_textPosition() == feathers_layout_RelativePosition.LEFT || this.get_textPosition() == feathers_layout_RelativePosition.RIGHT) {
					newWidth += this.get_gap() + this._currentContent.get_width();
				} else {
					newWidth = Math.max(newWidth,this._currentContent.get_width() + this.get_paddingLeft() + this.get_paddingRight());
				}
			}
			if(this._currentBackgroundSkin != null) {
				newWidth = Math.max(this._currentBackgroundSkin.get_width(),newWidth);
			}
		}
		var newHeight = this.get_explicitHeight();
		if(needsHeight) {
			newHeight = this._textMeasuredHeight;
			if(measureRequiredSkin != null) {
				newHeight = Math.max(newHeight,measureRequiredSkin.get_height());
			} else if(this._requiredSkinMeasurements != null && this._requiredSkinMeasurements.height != null) {
				newHeight = Math.max(newHeight,this._requiredSkinMeasurements.height);
			}
			if(this._currentContent != null) {
				if(this.get_textPosition() == feathers_layout_RelativePosition.LEFT || this.get_textPosition() == feathers_layout_RelativePosition.RIGHT) {
					newHeight = Math.max(newHeight,this._currentContent.get_height());
				} else {
					newHeight += this.get_gap() + this._currentContent.get_height();
				}
			}
			newHeight += this.get_paddingTop() + this.get_paddingBottom();
			if(this._currentBackgroundSkin != null) {
				newHeight = Math.max(this._currentBackgroundSkin.get_height(),newHeight);
			}
		}
		var newMinWidth = this.get_explicitMinWidth();
		if(needsMinWidth) {
			newMinWidth = this._textMeasuredWidth;
			if(this._customTextColumnWidth != null && (this.get_textPosition() == feathers_layout_RelativePosition.LEFT || this.get_textPosition() == feathers_layout_RelativePosition.RIGHT)) {
				newMinWidth = this._customTextColumnWidth;
			} else if(measureRequiredSkin != null) {
				newMinWidth += this.get_gap() + measureRequiredSkin.get_width();
			} else if(this._requiredSkinMeasurements != null && this._requiredSkinMeasurements.width != null) {
				newMinWidth += this.get_gap() + this._requiredSkinMeasurements.width;
			}
			newMinWidth += this.get_paddingLeft() + this.get_paddingRight();
			if(this._currentContent != null) {
				if(this.get_textPosition() == feathers_layout_RelativePosition.LEFT || this.get_textPosition() == feathers_layout_RelativePosition.RIGHT) {
					if(measureContent != null) {
						newMinWidth += measureContent.get_minWidth();
					} else {
						newMinWidth += this._currentContent.get_width();
					}
					newMinWidth += this.get_gap();
				} else if(measureContent != null) {
					newMinWidth = Math.max(newMinWidth,measureContent.get_minWidth() + this.get_paddingLeft() + this.get_paddingRight());
				} else {
					newMinWidth = Math.max(newMinWidth,this._currentContent.get_width() + this.get_paddingLeft() + this.get_paddingRight());
				}
			}
			if(measureSkin != null) {
				newMinWidth = Math.max(measureSkin.get_minWidth(),newMinWidth);
			} else if(this._backgroundSkinMeasurements != null && this._backgroundSkinMeasurements.minWidth != null) {
				newMinWidth = Math.max(this._backgroundSkinMeasurements.minWidth,newMinWidth);
			}
		}
		var newMinHeight = this.get_explicitMinHeight();
		if(needsMinHeight) {
			newMinHeight = this._textMeasuredHeight;
			if(measureRequiredSkin != null) {
				newMinHeight = Math.max(newMinHeight,measureRequiredSkin.get_height());
			} else if(this._requiredSkinMeasurements != null && this._requiredSkinMeasurements.height != null) {
				newMinHeight = Math.max(newMinHeight,this._requiredSkinMeasurements.height);
			}
			if(this._currentContent != null) {
				if(this.get_textPosition() == feathers_layout_RelativePosition.LEFT || this.get_textPosition() == feathers_layout_RelativePosition.RIGHT) {
					if(measureContent != null) {
						newMinHeight = Math.max(newMinHeight,measureContent.get_minHeight());
					} else {
						newMinHeight = Math.max(newMinHeight,this._currentContent.get_height());
					}
				} else {
					if(measureContent != null) {
						newMinHeight += measureContent.get_minHeight();
					} else {
						newMinHeight += this._currentContent.get_height();
					}
					newMinHeight += this.get_gap();
				}
			}
			newMinHeight += this.get_paddingTop() + this.get_paddingBottom();
			if(measureSkin != null) {
				newMinHeight = Math.max(measureSkin.get_minHeight(),newMinHeight);
			} else if(this._backgroundSkinMeasurements != null && this._backgroundSkinMeasurements.minHeight != null) {
				newMinHeight = Math.max(this._backgroundSkinMeasurements.minHeight,newMinHeight);
			}
		}
		var newMaxWidth = this.get_explicitMaxWidth();
		if(needsMaxWidth) {
			if(measureSkin != null) {
				newMaxWidth = measureSkin.get_maxWidth();
			} else if(this._backgroundSkinMeasurements != null && this._backgroundSkinMeasurements.maxWidth != null) {
				newMaxWidth = this._backgroundSkinMeasurements.maxWidth;
			} else {
				newMaxWidth = 1.0 / 0.0;
			}
		}
		var newMaxHeight = this.get_explicitMaxHeight();
		if(needsMaxHeight) {
			if(measureSkin != null) {
				newMaxHeight = measureSkin.get_maxHeight();
			} else if(this._backgroundSkinMeasurements != null && this._backgroundSkinMeasurements.maxHeight != null) {
				newMaxHeight = this._backgroundSkinMeasurements.maxHeight;
			} else {
				newMaxHeight = 1.0 / 0.0;
			}
		}
		return this.saveMeasurements(newWidth,newHeight,newMinWidth,newMinHeight,newMaxWidth,newMaxHeight);
	}
	,refreshTextStyles: function() {
		if(this.textField.get_wordWrap() != this.get_wordWrap()) {
			this.textField.set_wordWrap(this.get_wordWrap());
			this._updatedTextStyles = true;
		}
		if(this.textField.get_embedFonts() != this.get_embedFonts()) {
			this.textField.set_embedFonts(this.get_embedFonts());
			this._updatedTextStyles = true;
		}
		if(this.textField.get_styleSheet() != this.get_styleSheet()) {
			this.textField.set_styleSheet(this.get_styleSheet());
			this._updatedTextStyles = true;
		}
		var textFormat = this.getCurrentTextFormat();
		var simpleTextFormat = textFormat != null ? textFormat.toSimpleTextFormat() : null;
		if(simpleTextFormat == this._previousSimpleTextFormat) {
			return;
		}
		if(this._previousTextFormat != null) {
			this._previousTextFormat.removeEventListener("change",$bind(this,this.formItem_textFormat_changeHandler));
		}
		if(textFormat != null) {
			textFormat.addEventListener("change",$bind(this,this.formItem_textFormat_changeHandler),false,0,true);
			this.textField.set_defaultTextFormat(simpleTextFormat);
			this._updatedTextStyles = true;
		}
		this._previousTextFormat = textFormat;
		this._previousSimpleTextFormat = simpleTextFormat;
	}
	,refreshText: function(forceMeasurement) {
		var hasText = this._text != null && this._text.length > 0;
		var hasHTMLText = this._htmlText != null && this._htmlText.length > 0;
		this.textField.set_visible(hasText || hasHTMLText);
		if(this._text == this._previousText && this._htmlText == this._previousHTMLText && !this._updatedTextStyles && !forceMeasurement) {
			return;
		}
		this.textField.set_autoSize(1);
		if(hasHTMLText) {
			this.textField.set_text(this._htmlText);
		} else if(hasText) {
			this.textField.set_text(this._text);
		} else {
			this.textField.set_text("​");
		}
		if(this.get_wordWrap()) {
			this.textField.set_wordWrap(false);
		}
		this._textMeasuredWidth = this.textField.get_textWidth() + 4;
		this._wrappedOnMeasure = false;
		if(this.get_wordWrap()) {
			var textFieldExplicitWidth = this.calculateExplicitWidthForTextMeasurement();
			if(textFieldExplicitWidth != null && this._textMeasuredWidth > textFieldExplicitWidth) {
				this.textField.set_wordWrap(true);
				this.textField.set_width(textFieldExplicitWidth);
				this._textMeasuredWidth = this.textField.get_width();
				this._wrappedOnMeasure = true;
			}
		}
		this._textMeasuredHeight = this.textField.get_height();
		this.textField.set_autoSize(2);
		if(this.textField.get_wordWrap() != this.get_wordWrap()) {
			this.textField.set_wordWrap(this.get_wordWrap());
		}
		if(!hasText && !hasHTMLText) {
			this.textField.set_text("");
		}
		this._previousText = this._text;
		this._previousHTMLText = this._htmlText;
	}
	,calculateExplicitWidthForTextMeasurement: function() {
		var textFieldExplicitWidth = null;
		if(this.get_explicitWidth() != null) {
			textFieldExplicitWidth = this.get_explicitWidth();
		} else if(this.get_explicitMaxWidth() != null) {
			textFieldExplicitWidth = this.get_explicitMaxWidth();
		} else if(this._backgroundSkinMeasurements != null && this._backgroundSkinMeasurements.maxWidth != null) {
			textFieldExplicitWidth = this._backgroundSkinMeasurements.maxWidth;
		}
		if(textFieldExplicitWidth == null) {
			return textFieldExplicitWidth;
		}
		textFieldExplicitWidth -= this.get_paddingLeft() + this.get_paddingRight();
		if(this.get_content() != null) {
			if(this.get_textPosition() == feathers_layout_RelativePosition.LEFT || this.get_textPosition() == feathers_layout_RelativePosition.RIGHT) {
				var oldIgnoreContentResize = this._ignoreContentResize;
				this._ignoreContentResize = true;
				if(js_Boot.__implements(this._content,feathers_core_IValidating)) {
					this._content.validateNow();
				}
				this._ignoreContentResize = oldIgnoreContentResize;
				textFieldExplicitWidth -= this._content.get_width() + this.get_gap();
			}
		}
		if(textFieldExplicitWidth < 0.0) {
			textFieldExplicitWidth = 0.0;
		}
		return textFieldExplicitWidth;
	}
	,refreshSelection: function() {
		var selectable = this._selectable && this._enabled;
		if(this.textField.get_selectable() != selectable) {
			this.textField.set_selectable(selectable);
		}
	}
	,getCurrentTextFormat: function() {
		if(this.get_styleSheet() != null) {
			return null;
		}
		if(!this._enabled && this.get_disabledTextFormat() != null) {
			return this.get_disabledTextFormat();
		}
		return this.get_textFormat();
	}
	,refreshBackgroundSkin: function() {
		var oldSkin = this._currentBackgroundSkin;
		this._currentBackgroundSkin = this.getCurrentBackgroundSkin();
		if(this._currentBackgroundSkin == oldSkin) {
			return;
		}
		this.removeCurrentBackgroundSkin(oldSkin);
		this.addCurrentBackgroundSkin(this._currentBackgroundSkin);
	}
	,getCurrentBackgroundSkin: function() {
		if(!this._enabled && this.get_disabledBackgroundSkin() != null) {
			return this.get_disabledBackgroundSkin();
		}
		return this.get_backgroundSkin();
	}
	,addCurrentBackgroundSkin: function(skin) {
		if(skin == null) {
			this._backgroundSkinMeasurements = null;
			return;
		}
		if(js_Boot.__implements(skin,feathers_core_IUIControl)) {
			skin.initializeNow();
		}
		if(this._backgroundSkinMeasurements == null) {
			this._backgroundSkinMeasurements = new feathers_layout_Measurements(skin);
		} else {
			this._backgroundSkinMeasurements.save(skin);
		}
		if(js_Boot.__implements(skin,feathers_skins_IProgrammaticSkin)) {
			skin.set_uiContext(this);
		}
		this.addChildAt(skin,0);
	}
	,removeCurrentBackgroundSkin: function(skin) {
		if(skin == null) {
			return;
		}
		if(js_Boot.__implements(skin,feathers_skins_IProgrammaticSkin)) {
			skin.set_uiContext(null);
		}
		this._backgroundSkinMeasurements.restore(skin);
		if(skin.parent == this) {
			this.removeChild(skin);
		}
	}
	,refreshRequiredSkin: function() {
		var oldSkin = this._currentRequiredSkin;
		this._currentRequiredSkin = this.getCurrentRequiredSkin();
		if(this._currentRequiredSkin == oldSkin) {
			return;
		}
		this.removeCurrentRequiredSkin(oldSkin);
		this.addCurrentRequiredSkin(this._currentRequiredSkin);
	}
	,getCurrentRequiredSkin: function() {
		if(this._required) {
			return this.get_requiredSkin();
		}
		return null;
	}
	,addCurrentRequiredSkin: function(skin) {
		if(skin == null) {
			this._requiredSkinMeasurements = null;
			return;
		}
		if(js_Boot.__implements(skin,feathers_core_IUIControl)) {
			skin.initializeNow();
		}
		if(this._requiredSkinMeasurements == null) {
			this._requiredSkinMeasurements = new feathers_layout_Measurements(skin);
		} else {
			this._requiredSkinMeasurements.save(skin);
		}
		if(js_Boot.__implements(skin,feathers_skins_IProgrammaticSkin)) {
			skin.set_uiContext(this);
		}
		this.addChild(skin);
	}
	,removeCurrentRequiredSkin: function(skin) {
		if(skin == null) {
			return;
		}
		if(js_Boot.__implements(skin,feathers_skins_IProgrammaticSkin)) {
			skin.set_uiContext(null);
		}
		this._requiredSkinMeasurements.restore(skin);
		if(skin.parent == this) {
			this.removeChild(skin);
		}
	}
	,refreshContent: function() {
		var oldContent = this._currentContent;
		this._currentContent = this._content;
		if(this._currentContent == oldContent) {
			return;
		}
		if(oldContent != null) {
			this._contentMeasurements.restore(oldContent);
			this.removeChild(oldContent);
		}
		if(this._currentContent == null) {
			this._contentMeasurements = null;
			return;
		}
		if(js_Boot.__implements(this._currentContent,feathers_core_IUIControl)) {
			this._currentContent.initializeNow();
		}
		if(this._contentMeasurements == null) {
			this._contentMeasurements = new feathers_layout_Measurements(this._currentContent);
		} else {
			this._contentMeasurements.save(this._currentContent);
		}
		this.addChild(this._currentContent);
	}
	,refreshEnabled: function() {
		if(this._currentContent != null && js_Boot.__implements(this._currentContent,feathers_core_IUIControl)) {
			this._currentContent.set_enabled(this._enabled);
		}
	}
	,layoutContent: function() {
		this.layoutBackgroundSkin();
		if(js_Boot.__implements(this._currentRequiredSkin,feathers_core_IValidating)) {
			this._currentRequiredSkin.validateNow();
		}
		var oldIgnoreContentResize = this._ignoreContentResize;
		this._ignoreContentResize = true;
		if(js_Boot.__implements(this._currentContent,feathers_core_IValidating)) {
			this._currentContent.validateNow();
		}
		this._ignoreContentResize = oldIgnoreContentResize;
		var requiredOffset = 0.0;
		if(this._currentRequiredSkin != null) {
			requiredOffset = this.get_gap() + this._currentRequiredSkin.get_width();
		}
		var textFieldWidth = this._textMeasuredWidth;
		if(this._customTextColumnWidth != null && (this.get_textPosition() == feathers_layout_RelativePosition.LEFT || this.get_textPosition() == feathers_layout_RelativePosition.RIGHT)) {
			textFieldWidth = this._customTextColumnWidth - requiredOffset;
		}
		var textFieldHeight = this._textMeasuredHeight;
		var remainingWidth = this.actualWidth - this.get_paddingLeft() - this.get_paddingRight();
		if(this.get_textPosition() == feathers_layout_RelativePosition.LEFT || this.get_textPosition() == feathers_layout_RelativePosition.RIGHT) {
			remainingWidth -= this.get_gap() + requiredOffset;
		}
		if(remainingWidth < 0.0) {
			remainingWidth = 0.0;
		}
		if(textFieldWidth > remainingWidth) {
			textFieldWidth = remainingWidth;
		}
		if(textFieldWidth < 0.0) {
			textFieldWidth = 0.0;
		}
		var remainingHeight = this.actualHeight - this.get_paddingTop() - this.get_paddingBottom();
		if(this.get_textPosition() != feathers_layout_RelativePosition.LEFT && this.get_textPosition() != feathers_layout_RelativePosition.RIGHT) {
			remainingHeight -= this.get_gap();
		}
		if(remainingHeight < 0.0) {
			remainingHeight = 0.0;
		}
		if(textFieldHeight > remainingHeight) {
			textFieldHeight = remainingHeight;
		}
		if(textFieldHeight < 0.0) {
			textFieldHeight = 0.0;
		}
		switch(this.get_textPosition()._hx_index) {
		case 0:
			this.textField.set_x(this.get_paddingLeft());
			this.textField.set_y(this.get_paddingTop());
			remainingHeight -= textFieldHeight;
			break;
		case 1:
			this.textField.set_x(this.actualWidth - textFieldWidth - requiredOffset - this.get_paddingRight());
			remainingWidth -= textFieldWidth;
			break;
		case 2:
			this.textField.set_x(this.get_paddingLeft());
			this.textField.set_y(this.actualHeight - textFieldHeight - this.get_paddingBottom());
			remainingHeight -= textFieldHeight;
			break;
		case 3:
			this.textField.set_x(this.get_paddingLeft());
			remainingWidth -= textFieldWidth;
			break;
		default:
			throw new openfl_errors_ArgumentError("Unknown text position: " + Std.string(this.get_textPosition()));
		}
		this.textField.set_width(textFieldWidth);
		var wordWrap = this.get_wordWrap();
		if(wordWrap && !this._wrappedOnMeasure && textFieldWidth >= this._textMeasuredWidth) {
			wordWrap = false;
		}
		if(this.textField.get_wordWrap() != wordWrap) {
			this.textField.set_wordWrap(wordWrap);
		}
		this.textField.set_height(textFieldHeight);
		if(this._currentContent != null) {
			var contentStartX = this.get_paddingLeft();
			var contentStartY = this.get_paddingRight();
			switch(this.get_textPosition()._hx_index) {
			case 0:
				contentStartY = this.textField.get_y() + textFieldHeight + this.get_gap();
				break;
			case 1:
				break;
			case 2:
				break;
			case 3:
				contentStartX = this.textField.get_x() + textFieldWidth + this.get_gap() + requiredOffset;
				break;
			default:
				throw new openfl_errors_ArgumentError("Unknown text position: " + Std.string(this.get_textPosition()));
			}
			if(this._currentContent.get_width() > remainingWidth) {
				this._currentContent.set_width(remainingWidth);
			}
			if(this._currentContent.get_height() > remainingHeight) {
				this._currentContent.set_height(remainingHeight);
			}
			switch(this.get_horizontalAlign()._hx_index) {
			case 0:
				this._currentContent.set_x(contentStartX);
				break;
			case 1:
				this._currentContent.set_x(contentStartX + (remainingWidth - this._currentContent.get_width()) / 2.0);
				break;
			case 2:
				this._currentContent.set_x(contentStartX + remainingWidth - this._currentContent.get_width());
				break;
			case 3:
				this._currentContent.set_x(contentStartX);
				this._currentContent.set_width(remainingWidth);
				break;
			}
			switch(this.get_verticalAlign()._hx_index) {
			case 0:
				this._currentContent.set_y(contentStartY);
				break;
			case 1:
				this._currentContent.set_y(contentStartY + (remainingHeight - this._currentContent.get_height()) / 2.0);
				break;
			case 2:
				this._currentContent.set_y(contentStartY + remainingHeight - this._currentContent.get_height());
				break;
			case 3:
				this._currentContent.set_y(contentStartY);
				this._currentContent.set_height(remainingHeight);
				break;
			}
			if(this.get_textPosition() == feathers_layout_RelativePosition.LEFT || this.get_textPosition() == feathers_layout_RelativePosition.RIGHT) {
				if(js_Boot.__implements(this._currentContent,feathers_core_ITextControl)) {
					var textFieldLineMetrics = this.textField.getLineMetrics(0);
					var textFieldBaseline = textFieldLineMetrics.ascent + 2.0;
					var contentBaseline = this._currentContent.get_baseline();
					var maxBaseline = Math.max(contentBaseline,textFieldBaseline);
					var startY = this._currentContent.get_y();
					this.textField.set_y(startY + (maxBaseline - textFieldBaseline));
					if(this._currentContent != null) {
						this._currentContent.set_y(startY + (maxBaseline - contentBaseline));
					}
				} else {
					switch(this.get_verticalAlign()._hx_index) {
					case 0:
						this.textField.set_y(this._currentContent.get_y());
						break;
					case 1:
						this.textField.set_y(this._currentContent.get_y() + (this._currentContent.get_height() - this.textField.get_height()) / 2.0);
						break;
					case 2:
						this.textField.set_y(this._currentContent.get_y() + this._currentContent.get_height() - this.textField.get_height());
						break;
					case 3:
						this.textField.set_y(this._currentContent.get_y());
						break;
					}
				}
			}
			if(this._currentRequiredSkin != null) {
				this._currentRequiredSkin.set_y(this.textField.get_y() + (textFieldHeight - this._currentRequiredSkin.get_height()) / 2.0);
				this._currentRequiredSkin.set_x(this.textField.get_x() + textFieldWidth + this.get_gap());
			}
		}
	}
	,layoutBackgroundSkin: function() {
		if(this._currentBackgroundSkin == null) {
			return;
		}
		this._currentBackgroundSkin.set_x(0.0);
		this._currentBackgroundSkin.set_y(0.0);
		if(this._currentBackgroundSkin.get_width() != this.actualWidth) {
			this._currentBackgroundSkin.set_width(this.actualWidth);
		}
		if(this._currentBackgroundSkin.get_height() != this.actualHeight) {
			this._currentBackgroundSkin.set_height(this.actualHeight);
		}
		if(js_Boot.__implements(this._currentBackgroundSkin,feathers_core_IValidating)) {
			this._currentBackgroundSkin.validateNow();
		}
	}
	,formItem_textFormat_changeHandler: function(event) {
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
	}
	,formItem_textField_clickHandler: function(event) {
		if(this._focusManager == null) {
			return;
		}
		var newFocus = null;
		if(js_Boot.__implements(this._currentContent,feathers_core_IFocusObject)) {
			newFocus = this._currentContent;
		}
		this._focusManager.set_focus(newFocus);
	}
	,formItem_content_resizeHandler: function(event) {
		if(this._ignoreContentResize) {
			return;
		}
		if(this._contentMeasurements == null) {
			this._contentMeasurements = new feathers_layout_Measurements(this._currentContent);
		} else {
			this._contentMeasurements.save(this._currentContent);
		}
		this.setInvalid(feathers_core_InvalidationFlag.SIZE);
	}
	,__requiredSkin: null
	,get_requiredSkin: function() {
		return this.__requiredSkin;
	}
	,set_requiredSkin: function(value) {
		if(!this.setStyle("requiredSkin")) {
			return this.__requiredSkin;
		}
		if(this.__requiredSkin == value) {
			return this.__requiredSkin;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_requiredSkin);
		this.__requiredSkin = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__requiredSkin;
	}
	,clearStyle_requiredSkin: function() {
		this.set_requiredSkin(null);
		return this.get_requiredSkin();
	}
	,__textFormat: null
	,get_textFormat: function() {
		return this.__textFormat;
	}
	,set_textFormat: function(value) {
		if(!this.setStyle("textFormat")) {
			return this.__textFormat;
		}
		if(this.__textFormat == value) {
			return this.__textFormat;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_textFormat);
		this.__textFormat = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__textFormat;
	}
	,clearStyle_textFormat: function() {
		this.set_textFormat(null);
		return this.get_textFormat();
	}
	,__styleSheet: null
	,get_styleSheet: function() {
		return this.__styleSheet;
	}
	,set_styleSheet: function(value) {
		if(!this.setStyle("styleSheet")) {
			return this.__styleSheet;
		}
		if(this.__styleSheet == value) {
			return this.__styleSheet;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_styleSheet);
		this.__styleSheet = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__styleSheet;
	}
	,clearStyle_styleSheet: function() {
		this.set_styleSheet(null);
		return this.get_styleSheet();
	}
	,__disabledTextFormat: null
	,get_disabledTextFormat: function() {
		return this.__disabledTextFormat;
	}
	,set_disabledTextFormat: function(value) {
		if(!this.setStyle("disabledTextFormat")) {
			return this.__disabledTextFormat;
		}
		if(this.__disabledTextFormat == value) {
			return this.__disabledTextFormat;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_disabledTextFormat);
		this.__disabledTextFormat = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__disabledTextFormat;
	}
	,clearStyle_disabledTextFormat: function() {
		this.set_disabledTextFormat(null);
		return this.get_disabledTextFormat();
	}
	,__embedFonts: null
	,get_embedFonts: function() {
		return this.__embedFonts;
	}
	,set_embedFonts: function(value) {
		if(!this.setStyle("embedFonts")) {
			return this.__embedFonts;
		}
		if(this.__embedFonts == value) {
			return this.__embedFonts;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_embedFonts);
		this.__embedFonts = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__embedFonts;
	}
	,clearStyle_embedFonts: function() {
		this.set_embedFonts(false);
		return this.get_embedFonts();
	}
	,__paddingTop: null
	,get_paddingTop: function() {
		return this.__paddingTop;
	}
	,set_paddingTop: function(value) {
		if(!this.setStyle("paddingTop")) {
			return this.__paddingTop;
		}
		if(this.__paddingTop == value) {
			return this.__paddingTop;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_paddingTop);
		this.__paddingTop = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__paddingTop;
	}
	,clearStyle_paddingTop: function() {
		this.set_paddingTop(0.0);
		return this.get_paddingTop();
	}
	,__paddingRight: null
	,get_paddingRight: function() {
		return this.__paddingRight;
	}
	,set_paddingRight: function(value) {
		if(!this.setStyle("paddingRight")) {
			return this.__paddingRight;
		}
		if(this.__paddingRight == value) {
			return this.__paddingRight;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_paddingRight);
		this.__paddingRight = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__paddingRight;
	}
	,clearStyle_paddingRight: function() {
		this.set_paddingRight(0.0);
		return this.get_paddingRight();
	}
	,__paddingBottom: null
	,get_paddingBottom: function() {
		return this.__paddingBottom;
	}
	,set_paddingBottom: function(value) {
		if(!this.setStyle("paddingBottom")) {
			return this.__paddingBottom;
		}
		if(this.__paddingBottom == value) {
			return this.__paddingBottom;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_paddingBottom);
		this.__paddingBottom = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__paddingBottom;
	}
	,clearStyle_paddingBottom: function() {
		this.set_paddingBottom(0.0);
		return this.get_paddingBottom();
	}
	,__paddingLeft: null
	,get_paddingLeft: function() {
		return this.__paddingLeft;
	}
	,set_paddingLeft: function(value) {
		if(!this.setStyle("paddingLeft")) {
			return this.__paddingLeft;
		}
		if(this.__paddingLeft == value) {
			return this.__paddingLeft;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_paddingLeft);
		this.__paddingLeft = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__paddingLeft;
	}
	,clearStyle_paddingLeft: function() {
		this.set_paddingLeft(0.0);
		return this.get_paddingLeft();
	}
	,__gap: null
	,get_gap: function() {
		return this.__gap;
	}
	,set_gap: function(value) {
		if(!this.setStyle("gap")) {
			return this.__gap;
		}
		if(this.__gap == value) {
			return this.__gap;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_gap);
		this.__gap = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__gap;
	}
	,clearStyle_gap: function() {
		this.set_gap(0.0);
		return this.get_gap();
	}
	,__horizontalAlign: null
	,get_horizontalAlign: function() {
		return this.__horizontalAlign;
	}
	,set_horizontalAlign: function(value) {
		if(!this.setStyle("horizontalAlign")) {
			return this.__horizontalAlign;
		}
		if(this.__horizontalAlign == value) {
			return this.__horizontalAlign;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_horizontalAlign);
		this.__horizontalAlign = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__horizontalAlign;
	}
	,clearStyle_horizontalAlign: function() {
		this.set_horizontalAlign(feathers_layout_HorizontalAlign.LEFT);
		return this.get_horizontalAlign();
	}
	,__verticalAlign: null
	,get_verticalAlign: function() {
		return this.__verticalAlign;
	}
	,set_verticalAlign: function(value) {
		if(!this.setStyle("verticalAlign")) {
			return this.__verticalAlign;
		}
		if(this.__verticalAlign == value) {
			return this.__verticalAlign;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_verticalAlign);
		this.__verticalAlign = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__verticalAlign;
	}
	,clearStyle_verticalAlign: function() {
		this.set_verticalAlign(feathers_layout_VerticalAlign.MIDDLE);
		return this.get_verticalAlign();
	}
	,__wordWrap: null
	,get_wordWrap: function() {
		return this.__wordWrap;
	}
	,set_wordWrap: function(value) {
		if(!this.setStyle("wordWrap")) {
			return this.__wordWrap;
		}
		if(this.__wordWrap == value) {
			return this.__wordWrap;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_wordWrap);
		this.__wordWrap = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__wordWrap;
	}
	,clearStyle_wordWrap: function() {
		this.set_wordWrap(false);
		return this.get_wordWrap();
	}
	,__backgroundSkin: null
	,get_backgroundSkin: function() {
		return this.__backgroundSkin;
	}
	,set_backgroundSkin: function(value) {
		if(!this.setStyle("backgroundSkin")) {
			return this.__backgroundSkin;
		}
		if(this.__backgroundSkin == value) {
			return this.__backgroundSkin;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_backgroundSkin);
		this.__backgroundSkin = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__backgroundSkin;
	}
	,clearStyle_backgroundSkin: function() {
		this.set_backgroundSkin(null);
		return this.get_backgroundSkin();
	}
	,__disabledBackgroundSkin: null
	,get_disabledBackgroundSkin: function() {
		return this.__disabledBackgroundSkin;
	}
	,set_disabledBackgroundSkin: function(value) {
		if(!this.setStyle("disabledBackgroundSkin")) {
			return this.__disabledBackgroundSkin;
		}
		if(this.__disabledBackgroundSkin == value) {
			return this.__disabledBackgroundSkin;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_disabledBackgroundSkin);
		this.__disabledBackgroundSkin = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__disabledBackgroundSkin;
	}
	,clearStyle_disabledBackgroundSkin: function() {
		this.set_disabledBackgroundSkin(null);
		return this.get_disabledBackgroundSkin();
	}
	,__textPosition: null
	,get_textPosition: function() {
		return this.__textPosition;
	}
	,set_textPosition: function(value) {
		if(!this.setStyle("textPosition")) {
			return this.__textPosition;
		}
		if(this.__textPosition == value) {
			return this.__textPosition;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_textPosition);
		this.__textPosition = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__textPosition;
	}
	,clearStyle_textPosition: function() {
		this.set_textPosition(feathers_layout_RelativePosition.TOP);
		return this.get_textPosition();
	}
	,get_styleContext: function() {
		return feathers_controls_FormItem;
	}
	,__class__: feathers_controls_FormItem
	,__properties__: $extend(feathers_core_FeathersControl.prototype.__properties__,{set_textPosition:"set_textPosition",get_textPosition:"get_textPosition",set_disabledBackgroundSkin:"set_disabledBackgroundSkin",get_disabledBackgroundSkin:"get_disabledBackgroundSkin",set_backgroundSkin:"set_backgroundSkin",get_backgroundSkin:"get_backgroundSkin",set_customTextColumnWidth:"set_customTextColumnWidth",get_customTextColumnWidth:"get_customTextColumnWidth",set_wordWrap:"set_wordWrap",get_wordWrap:"get_wordWrap",set_verticalAlign:"set_verticalAlign",get_verticalAlign:"get_verticalAlign",set_horizontalAlign:"set_horizontalAlign",get_horizontalAlign:"get_horizontalAlign",set_gap:"set_gap",get_gap:"get_gap",set_paddingLeft:"set_paddingLeft",get_paddingLeft:"get_paddingLeft",set_paddingBottom:"set_paddingBottom",get_paddingBottom:"get_paddingBottom",set_paddingRight:"set_paddingRight",get_paddingRight:"get_paddingRight",set_paddingTop:"set_paddingTop",get_paddingTop:"get_paddingTop",set_embedFonts:"set_embedFonts",get_embedFonts:"get_embedFonts",set_disabledTextFormat:"set_disabledTextFormat",get_disabledTextFormat:"get_disabledTextFormat",set_styleSheet:"set_styleSheet",get_styleSheet:"get_styleSheet",set_textFormat:"set_textFormat",get_textFormat:"get_textFormat",set_requiredSkin:"set_requiredSkin",get_requiredSkin:"get_requiredSkin",set_required:"set_required",get_required:"get_required",get_selectionEndIndex:"get_selectionEndIndex",get_selectionBeginIndex:"get_selectionBeginIndex",set_selectable:"set_selectable",get_selectable:"get_selectable",set_content:"set_content",get_content:"get_content",get_baseline:"get_baseline",set_htmlText:"set_htmlText",get_htmlText:"get_htmlText",set_text:"set_text",get_text:"get_text"})
});
var feathers_data_GridViewHeaderState = function(column,columnIndex,text) {
	if(columnIndex == null) {
		columnIndex = -1;
	}
	this.sortOrder = feathers_data_SortOrder.NONE;
	this.enabled = true;
	this.columnIndex = -1;
	this.column = column;
	this.columnIndex = columnIndex;
	this.text = text;
};
$hxClasses["feathers.data.GridViewHeaderState"] = feathers_data_GridViewHeaderState;
feathers_data_GridViewHeaderState.__name__ = "feathers.data.GridViewHeaderState";
feathers_data_GridViewHeaderState.prototype = {
	owner: null
	,column: null
	,columnIndex: null
	,text: null
	,enabled: null
	,sortOrder: null
	,__class__: feathers_data_GridViewHeaderState
};
var feathers_controls__$GridView_GridViewRowState = function() {
	this.enabled = true;
	this.selected = false;
	this.rowIndex = -1;
};
$hxClasses["feathers.controls._GridView.GridViewRowState"] = feathers_controls__$GridView_GridViewRowState;
feathers_controls__$GridView_GridViewRowState.__name__ = "feathers.controls._GridView.GridViewRowState";
feathers_controls__$GridView_GridViewRowState.prototype = {
	owner: null
	,data: null
	,rowIndex: null
	,selected: null
	,enabled: null
	,columns: null
	,cellRendererRecycler: null
	,customColumnWidths: null
	,customCellRendererVariant: null
	,forceItemStateUpdate: null
	,__class__: feathers_controls__$GridView_GridViewRowState
};
var feathers_controls_GridView = function(dataProvider,columns,changeListener) {
	this.__dragDropIndicatorSkin = null;
	this.__showHeaderDividersOnlyWhenResizable = false;
	this.__extendedScrollBarY = false;
	this.__headerCornerSkin = null;
	this.__columnResizeSkin = null;
	this.__layout = null;
	this.__customColumnDividerVariant = null;
	this.__columnDividerFactory = null;
	this.__customHeaderDividerVariant = null;
	this.__headerDividerFactory = feathers_utils_DisplayObjectFactory.withClass(feathers_controls_Button);
	this.__customHeaderRendererVariant = null;
	this.__customCellRendererVariant = null;
	this.edgeAutoScrollDistance = 8.0;
	this._dragDropLastUpdateTime = -1;
	this._droppedOnSelf = false;
	this._dragRowIndex = -1;
	this._dragItem = null;
	this._dragMinDistance = 0.0;
	this._dragDropLocalY = 0.0;
	this._dragDropLocalX = 0.0;
	this._removeOnDragDropComplete = false;
	this._dropEnabled = false;
	this._dragEnabled = false;
	this._dragFormat = feathers_controls_GridView.DEFAULT_DRAG_FORMAT_ITEMS;
	this._pendingScrollDuration = null;
	this._pendingScrollRowIndex = -1;
	this._ignoreHeaderLayoutChanges = false;
	this._ignoreLayoutChanges = false;
	this._ignoreSelectionChange = false;
	this._selectable = true;
	this._tempVisibleIndices = new feathers_layout_VirtualLayoutRange(0,0);
	this._visibleIndices = new feathers_layout_VirtualLayoutRange(0,0);
	this._virtualCache = [];
	this._rowLayoutItems = [];
	this._unrenderedData = [];
	this.rowStatePool = new lime_utils_ObjectPool(function() {
		return new feathers_controls__$GridView_GridViewRowState();
	});
	this.headerStatePool = new lime_utils_ObjectPool(function() {
		return new feathers_data_GridViewHeaderState();
	});
	this.rowRendererToRowState = new haxe_ds_ObjectMap();
	this.dataToRowRenderer = new haxe_ds_ObjectMap();
	this.activeRowRenderers = [];
	this.inactiveRowRenderers = [];
	this.headerRendererToHeaderState = new haxe_ds_ObjectMap();
	this.dataToHeaderRenderer = new haxe_ds_ObjectMap();
	this._sortedColumn = null;
	this._sortOrder = feathers_data_SortOrder.NONE;
	this._resizableColumns = false;
	this._sortableColumns = false;
	this._cellRendererRecycler = feathers_utils_DisplayObjectRecycler.withClass(feathers_controls_dataRenderers_ItemRenderer);
	this._virtualLayout = true;
	this._selectedItems = [];
	this._selectedIndices = [];
	this._selectionAnchorIndex = -1;
	this._allowMultipleSelection = false;
	this._selectedItem = null;
	this._selectedIndex = -1;
	this._previousCustomHeaderRendererVariant = null;
	this._forceItemStateUpdate = false;
	this._columns = null;
	this._autoPopulatedColumns = null;
	this._ignoreDataProviderChanges = false;
	this._childFocusEnabled = true;
	this._headerScrollRect2 = new openfl_geom_Rectangle();
	this._headerScrollRect1 = new openfl_geom_Rectangle();
	this._columnDividerLayoutItems = [];
	this._defaultColumnDividerStorage = new feathers_controls__$GridView_ColumnDividerStorage();
	this._headerDividerLayoutItems = [];
	this._defaultHeaderDividerStorage = new feathers_controls__$GridView_HeaderDividerStorage(feathers_utils_DisplayObjectFactory.withClass(feathers_controls_Button));
	this._headerLayoutItems = [];
	this._unrenderedHeaderData = [];
	this._defaultHeaderStorage = new feathers_controls__$GridView_HeaderRendererStorage(feathers_utils_DisplayObjectRecycler.withClass(feathers_controls_dataRenderers_SortOrderHeaderRenderer));
	this._resizingHeaderTouchPointIsMouse = false;
	this._resizingHeaderTouchPointID = null;
	this._resizingHeaderIndex = -1;
	this.initializeGridViewTheme();
	feathers_controls_supportClasses_BaseScrollContainer.call(this);
	if(this._rowRendererFactory == null) {
		this.set_rowRendererFactory(feathers_utils_DisplayObjectFactory.withClass(feathers_controls_dataRenderers_GridViewRowRenderer));
	}
	this.set_dataProvider(dataProvider);
	this.set_columns(columns);
	this.set_tabEnabled(true);
	this.focusRect = null;
	if(this.get_viewPort() == null) {
		this.gridViewPort = new feathers_controls_supportClasses_AdvancedLayoutViewPort();
		this.addChild(this.gridViewPort);
		this.set_viewPort(this.gridViewPort);
	}
	if(changeListener != null) {
		this.addEventListener("change",changeListener);
	}
};
$hxClasses["feathers.controls.GridView"] = feathers_controls_GridView;
feathers_controls_GridView.__name__ = "feathers.controls.GridView";
feathers_controls_GridView.__interfaces__ = [feathers_dragDrop_IDropTarget,feathers_dragDrop_IDragSource,feathers_core_IFocusContainer,feathers_core_IDataSelector,feathers_core_IIndexSelector];
feathers_controls_GridView.defaultUpdateHeaderRenderer = function(headerRenderer,state) {
	if(js_Boot.__implements(headerRenderer,feathers_core_ITextControl)) {
		var textControl = headerRenderer;
		textControl.set_text(state.text);
	}
};
feathers_controls_GridView.defaultResetHeaderRenderer = function(headerRenderer,state) {
	if(js_Boot.__implements(headerRenderer,feathers_core_ITextControl)) {
		var textControl = headerRenderer;
		textControl.set_text(null);
	}
};
feathers_controls_GridView.defaultSortCompareFunction = function(a,b) {
	var aString = Std.string(a).toLowerCase();
	var bString = Std.string(b).toLowerCase();
	if(aString < bString) {
		return -1;
	}
	if(aString > bString) {
		return 1;
	}
	return 0;
};
feathers_controls_GridView.__super__ = feathers_controls_supportClasses_BaseScrollContainer;
feathers_controls_GridView.prototype = $extend(feathers_controls_supportClasses_BaseScrollContainer.prototype,{
	_headerContainer: null
	,_headerContainerLayout: null
	,_headerResizeContainer: null
	,_columnDividerContainer: null
	,_resizingHeaderIndex: null
	,_resizingHeaderTouchPointID: null
	,_resizingHeaderTouchPointIsMouse: null
	,_resizingHeaderStartStageX: null
	,_customColumnWidths: null
	,_defaultHeaderStorage: null
	,_unrenderedHeaderData: null
	,_headerLayoutItems: null
	,_defaultHeaderDividerStorage: null
	,_headerDividerLayoutItems: null
	,_defaultColumnDividerStorage: null
	,_columnDividerLayoutItems: null
	,_currentHeaderScrollRect: null
	,_headerScrollRect1: null
	,_headerScrollRect2: null
	,_oldHeaderDividerMouseCursor: null
	,get_tabEnabled: function() {
		if((this._selectable || this.get_maxScrollY() != this.get_minScrollY() || this.get_maxScrollX() != this.get_minScrollX()) && this._enabled) {
			return this.get_rawTabEnabled();
		} else {
			return false;
		}
	}
	,_childFocusEnabled: null
	,get_childFocusEnabled: function() {
		if(this._enabled) {
			return this._childFocusEnabled;
		} else {
			return false;
		}
	}
	,set_childFocusEnabled: function(value) {
		if(this._childFocusEnabled == value) {
			return this._childFocusEnabled;
		}
		this._childFocusEnabled = value;
		return this._childFocusEnabled;
	}
	,gridViewPort: null
	,_ignoreDataProviderChanges: null
	,_dataProvider: null
	,get_dataProvider: function() {
		return this._dataProvider;
	}
	,set_dataProvider: function(value) {
		if(this._dataProvider == value) {
			return this._dataProvider;
		}
		this._virtualCache.length = 0;
		if(this._dataProvider != null) {
			this._dataProvider.removeEventListener("change",$bind(this,this.gridView_dataProvider_changeHandler));
			this._dataProvider.removeEventListener("addItem",$bind(this,this.gridView_dataProvider_addItemHandler));
			this._dataProvider.removeEventListener("removeItem",$bind(this,this.gridView_dataProvider_removeItemHandler));
			this._dataProvider.removeEventListener("replaceItem",$bind(this,this.gridView_dataProvider_replaceItemHandler));
			this._dataProvider.removeEventListener("removeAll",$bind(this,this.gridView_dataProvider_removeAllHandler));
			this._dataProvider.removeEventListener("reset",$bind(this,this.gridView_dataProvider_resetHandler));
			this._dataProvider.removeEventListener("sortChange",$bind(this,this.gridView_dataProvider_sortChangeHandler));
			this._dataProvider.removeEventListener("filterChange",$bind(this,this.gridView_dataProvider_filterChangeHandler));
			this._dataProvider.removeEventListener("updateItem",$bind(this,this.gridView_dataProvider_updateItemHandler));
			this._dataProvider.removeEventListener("updateAll",$bind(this,this.gridView_dataProvider_updateAllHandler));
		}
		this._dataProvider = value;
		if(this._dataProvider != null) {
			this._virtualCache.length = this._dataProvider.get_length();
			this._dataProvider.addEventListener("change",$bind(this,this.gridView_dataProvider_changeHandler));
			this._dataProvider.addEventListener("addItem",$bind(this,this.gridView_dataProvider_addItemHandler));
			this._dataProvider.addEventListener("removeItem",$bind(this,this.gridView_dataProvider_removeItemHandler));
			this._dataProvider.addEventListener("replaceItem",$bind(this,this.gridView_dataProvider_replaceItemHandler));
			this._dataProvider.addEventListener("removeAll",$bind(this,this.gridView_dataProvider_removeAllHandler));
			this._dataProvider.addEventListener("reset",$bind(this,this.gridView_dataProvider_resetHandler));
			this._dataProvider.addEventListener("sortChange",$bind(this,this.gridView_dataProvider_sortChangeHandler));
			this._dataProvider.addEventListener("filterChange",$bind(this,this.gridView_dataProvider_filterChangeHandler));
			this._dataProvider.addEventListener("updateItem",$bind(this,this.gridView_dataProvider_updateItemHandler));
			this._dataProvider.addEventListener("updateAll",$bind(this,this.gridView_dataProvider_updateAllHandler));
		}
		this.set_scrollX(0.0);
		this.set_scrollY(0.0);
		this.set_selectedIndex(-1);
		if(this._autoPopulatedColumns != null) {
			this._autoPopulatedColumns = null;
			this.set_columns(null);
		}
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		feathers_events_FeathersEvent.dispatch(this,"dataChange");
		return this._dataProvider;
	}
	,_autoPopulatedColumns: null
	,_columns: null
	,get_columns: function() {
		return this._columns;
	}
	,set_columns: function(value) {
		if(this._columns == value) {
			return this._columns;
		}
		if(this._columns != null) {
			this._columns.removeEventListener("change",$bind(this,this.gridView_columns_changeHandler));
			this._columns.removeEventListener("addItem",$bind(this,this.gridView_columns_addItemHandler));
			this._columns.removeEventListener("removeItem",$bind(this,this.gridView_columns_removeItemHandler));
		}
		this._columns = value;
		if(this._columns != null) {
			this._columns.addEventListener("change",$bind(this,this.gridView_columns_changeHandler));
			this._columns.addEventListener("addItem",$bind(this,this.gridView_columns_addItemHandler));
			this._columns.addEventListener("removeItem",$bind(this,this.gridView_columns_removeItemHandler));
		}
		this._autoPopulatedColumns = null;
		this._customColumnWidths = null;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		return this._columns;
	}
	,get_rowRendererFactory: function() {
		return this._rowRendererFactory;
	}
	,set_rowRendererFactory: function(value) {
		if(this._rowRendererFactory == value) {
			return this._rowRendererFactory;
		}
		this._oldRowRendererFactory = this._rowRendererFactory;
		this._rowRendererFactory = value;
		this.setInvalid(feathers_controls_GridView.INVALIDATION_FLAG_ROW_RENDERER_FACTORY);
		return this._rowRendererFactory;
	}
	,get_headerRendererRecycler: function() {
		return this._defaultHeaderStorage.headerRendererRecycler;
	}
	,set_headerRendererRecycler: function(value) {
		if(this._defaultHeaderStorage.headerRendererRecycler == value) {
			return this._defaultHeaderStorage.headerRendererRecycler;
		}
		this._defaultHeaderStorage.oldHeaderRendererRecycler = this._defaultHeaderStorage.headerRendererRecycler;
		this._defaultHeaderStorage.headerRendererRecycler = value;
		this.setInvalid(feathers_controls_GridView.INVALIDATION_FLAG_HEADER_RENDERER_FACTORY);
		return this._defaultHeaderStorage.headerRendererRecycler;
	}
	,_forceItemStateUpdate: null
	,get_forceItemStateUpdate: function() {
		return this._forceItemStateUpdate;
	}
	,set_forceItemStateUpdate: function(value) {
		if(this._forceItemStateUpdate == value) {
			return this._forceItemStateUpdate;
		}
		this._forceItemStateUpdate = value;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		return this._forceItemStateUpdate;
	}
	,_previousCustomHeaderRendererVariant: null
	,_rowRendererFactory: null
	,_oldRowRendererFactory: null
	,_rowRendererMeasurements: null
	,_selectedIndex: null
	,get_selectedIndex: function() {
		return this._selectedIndex;
	}
	,set_selectedIndex: function(value) {
		if(!this._selectable || this._dataProvider == null) {
			value = -1;
		}
		if(this._selectedIndex == value && this._selectedIndices.length <= 1) {
			return this._selectedIndex;
		}
		if(value == -1) {
			this._selectionAnchorIndex = -1;
			this._selectedIndex = -1;
			this._selectedItem = null;
			this._selectedIndices.length = 0;
			this._selectedItems.length = 0;
			this.setInvalid(feathers_core_InvalidationFlag.SELECTION);
			feathers_events_FeathersEvent.dispatch(this,"change");
			return this._selectedIndex;
		}
		this._selectedIndex = value;
		this._selectedItem = this._dataProvider.get(this._selectedIndex);
		this._selectedIndices.length = 1;
		this._selectedIndices[0] = this._selectedIndex;
		this._selectedItems.length = 1;
		this._selectedItems[0] = this._selectedItem;
		this._selectionAnchorIndex = this._selectedIndex;
		this.setInvalid(feathers_core_InvalidationFlag.SELECTION);
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._selectedIndex;
	}
	,get_maxSelectedIndex: function() {
		if(this._dataProvider == null) {
			return -1;
		}
		return this._dataProvider.get_length() - 1;
	}
	,_selectedItem: null
	,get_selectedItem: function() {
		return this._selectedItem;
	}
	,set_selectedItem: function(value) {
		if(value == null || !this._selectable || this._dataProvider == null) {
			this.set_selectedIndex(-1);
			return this._selectedItem;
		}
		var index = this._dataProvider.indexOf(value);
		if(index == -1) {
			this.set_selectedIndex(-1);
			return this._selectedItem;
		}
		if(this._selectedItem == value && this._selectedIndex == index && this._selectedIndices.length == 1) {
			return this._selectedItem;
		}
		this._selectedIndex = index;
		this._selectedItem = value;
		this._selectedIndices.length = 1;
		this._selectedIndices[0] = this._selectedIndex;
		this._selectedItems.length = 1;
		this._selectedItems[0] = this._selectedItem;
		this._selectionAnchorIndex = this._selectedIndex;
		this.setInvalid(feathers_core_InvalidationFlag.SELECTION);
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._selectedItem;
	}
	,_allowMultipleSelection: null
	,get_allowMultipleSelection: function() {
		return this._allowMultipleSelection;
	}
	,set_allowMultipleSelection: function(value) {
		if(this._allowMultipleSelection == value) {
			return this._allowMultipleSelection;
		}
		this._allowMultipleSelection = value;
		this.setInvalid(feathers_core_InvalidationFlag.SELECTION);
		return this._allowMultipleSelection;
	}
	,_selectionAnchorIndex: null
	,_selectedIndices: null
	,get_selectedIndices: function() {
		return this._selectedIndices;
	}
	,set_selectedIndices: function(value) {
		if(value == null || value.length == 0 || !this._selectable || this._dataProvider == null) {
			this.set_selectedIndex(-1);
			return this._selectedIndices;
		}
		if(this._selectedIndices == value) {
			return this._selectedIndices;
		}
		if(!this._allowMultipleSelection && value.length > 1) {
			value.length = 1;
		}
		this._selectedIndices = value;
		this._selectedIndex = this._selectedIndices[0];
		this._selectedItems.length = this._selectedIndices.length;
		var _g = 0;
		var _g1 = this._selectedIndices.length;
		while(_g < _g1) {
			var i = _g++;
			var index = this._selectedIndices[i];
			this._selectedItems[i] = this._dataProvider.get(index);
		}
		this._selectedItem = this._selectedItems[0];
		this._selectionAnchorIndex = this._selectedIndex;
		this.setInvalid(feathers_core_InvalidationFlag.SELECTION);
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._selectedIndices;
	}
	,_selectedItems: null
	,get_selectedItems: function() {
		return this._selectedItems;
	}
	,set_selectedItems: function(value) {
		if(value == null || value.length == 0 || !this._selectable || this._dataProvider == null) {
			this.set_selectedIndex(-1);
			return this._selectedItems;
		}
		if(this._selectedItems == value) {
			return this._selectedItems;
		}
		if(!this._allowMultipleSelection && value.length > 1) {
			value.length = 1;
		}
		var indices = [];
		var i = 0;
		while(i < value.length) {
			var item = value[i];
			var index = this._dataProvider.indexOf(item);
			if(index == -1) {
				value.splice(i,1);
				continue;
			}
			indices.push(index);
			++i;
		}
		this._selectedIndices = indices;
		this._selectedItems = value;
		if(value.length == 0) {
			this._selectedIndex = -1;
			this._selectedItem = null;
		} else {
			this._selectedIndex = this._selectedIndices[0];
			this._selectedItem = this._selectedItems[0];
		}
		this._selectionAnchorIndex = this._selectedIndex;
		this.setInvalid(feathers_core_InvalidationFlag.SELECTION);
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._selectedIndices;
	}
	,_previousLayout: null
	,_virtualLayout: null
	,get_virtualLayout: function() {
		return this._virtualLayout;
	}
	,set_virtualLayout: function(value) {
		if(this._virtualLayout = value) {
			return this._virtualLayout;
		}
		this._virtualLayout = value;
		this.setInvalid(feathers_core_InvalidationFlag.LAYOUT);
		return this._virtualLayout;
	}
	,_cellRendererRecycler: null
	,get_cellRendererRecycler: function() {
		return this._cellRendererRecycler;
	}
	,set_cellRendererRecycler: function(value) {
		if(this._cellRendererRecycler == value) {
			return this._cellRendererRecycler;
		}
		this._cellRendererRecycler = value;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		return this._cellRendererRecycler;
	}
	,_sortableColumns: null
	,get_sortableColumns: function() {
		return this._sortableColumns;
	}
	,set_sortableColumns: function(value) {
		if(this._sortableColumns == value) {
			return this._sortableColumns;
		}
		this._sortableColumns = value;
		return this._sortableColumns;
	}
	,_resizableColumns: null
	,get_resizableColumns: function() {
		return this._resizableColumns;
	}
	,set_resizableColumns: function(value) {
		if(this._resizableColumns == value) {
			return this._resizableColumns;
		}
		this._resizableColumns = value;
		this.setInvalid(feathers_core_InvalidationFlag.LAYOUT);
		return this._resizableColumns;
	}
	,_currentColumnResizeSkin: null
	,_currentHeaderCornerSkin: null
	,_sortOrder: null
	,get_sortOrder: function() {
		return this._sortOrder;
	}
	,set_sortOrder: function(value) {
		if(this._sortedColumn == null) {
			value = feathers_data_SortOrder.NONE;
		}
		if(this._sortOrder == value) {
			return this._sortOrder;
		}
		this._sortOrder = value;
		this.setInvalid(feathers_core_InvalidationFlag.SORT);
		return this._sortOrder;
	}
	,_sortedColumn: null
	,get_sortedColumn: function() {
		return this._sortedColumn;
	}
	,set_sortedColumn: function(value) {
		if(this._sortedColumn == value) {
			return this._sortedColumn;
		}
		if(this._columns.indexOf(value) == -1) {
			this._sortedColumn = null;
			this._sortOrder = feathers_data_SortOrder.NONE;
			return this._sortedColumn;
		}
		this._sortedColumn = value;
		if(this._sortedColumn != null) {
			this.set_sortOrder(this._sortedColumn.defaultSortOrder);
		} else {
			this._sortOrder = feathers_data_SortOrder.NONE;
		}
		this.setInvalid(feathers_core_InvalidationFlag.SORT);
		return this._sortedColumn;
	}
	,dataToHeaderRenderer: null
	,headerRendererToHeaderState: null
	,inactiveRowRenderers: null
	,activeRowRenderers: null
	,dataToRowRenderer: null
	,rowRendererToRowState: null
	,headerStatePool: null
	,rowStatePool: null
	,_unrenderedData: null
	,_rowLayoutItems: null
	,_virtualCache: null
	,_visibleIndices: null
	,_tempVisibleIndices: null
	,_selectable: null
	,get_selectable: function() {
		return this._selectable;
	}
	,set_selectable: function(value) {
		if(this._selectable == value) {
			return this._selectable;
		}
		this._selectable = value;
		if(!this._selectable) {
			this.set_selectedIndex(-1);
		}
		return this._selectable;
	}
	,_ignoreSelectionChange: null
	,_ignoreLayoutChanges: null
	,_ignoreHeaderLayoutChanges: null
	,_pendingScrollRowIndex: null
	,_pendingScrollDuration: null
	,_dragDropIndicatorSkinMeasurements: null
	,_dragFormat: null
	,get_dragFormat: function() {
		return this._dragFormat;
	}
	,set_dragFormat: function(value) {
		if(value == null) {
			value = feathers_controls_GridView.DEFAULT_DRAG_FORMAT_ITEMS;
		}
		if(this._dragFormat == value) {
			return this._dragFormat;
		}
		this._dragFormat = value;
		return this._dragFormat;
	}
	,_dragEnabled: null
	,get_dragEnabled: function() {
		return this._dragEnabled;
	}
	,set_dragEnabled: function(value) {
		if(this._dragEnabled == value) {
			return this._dragEnabled;
		}
		if(this._dragEnabled) {
			this.removeEventListener("dragComplete",$bind(this,this.gridView_dragCompleteHandler));
		}
		this._dragEnabled = value;
		if(this._dragEnabled) {
			this.addEventListener("dragComplete",$bind(this,this.gridView_dragCompleteHandler));
		}
		return this._dragEnabled;
	}
	,_dropEnabled: null
	,get_dropEnabled: function() {
		return this._dropEnabled;
	}
	,set_dropEnabled: function(value) {
		if(this._dropEnabled == value) {
			return this._dropEnabled;
		}
		if(this._dropEnabled) {
			this.removeEventListener("dragEnter",$bind(this,this.gridView_dragEnterHandler));
			this.removeEventListener("dragExit",$bind(this,this.gridView_dragExitHandler));
			this.removeEventListener("dragMove",$bind(this,this.gridView_dragMoveHandler));
			this.removeEventListener("dragDrop",$bind(this,this.gridView_dragDropHandler));
		}
		this._dropEnabled = value;
		if(this._dropEnabled) {
			this.addEventListener("dragEnter",$bind(this,this.gridView_dragEnterHandler));
			this.addEventListener("dragExit",$bind(this,this.gridView_dragExitHandler));
			this.addEventListener("dragMove",$bind(this,this.gridView_dragMoveHandler));
			this.addEventListener("dragDrop",$bind(this,this.gridView_dragDropHandler));
		}
		return this._dropEnabled;
	}
	,_removeOnDragDropComplete: null
	,get_removeOnDragDropComplete: function() {
		return this._removeOnDragDropComplete;
	}
	,set_removeOnDragDropComplete: function(value) {
		this._removeOnDragDropComplete = value;
		return this._removeOnDragDropComplete;
	}
	,_dragDropLocalX: null
	,_dragDropLocalY: null
	,_dragMinDistance: null
	,_dragItem: null
	,_dragRowIndex: null
	,_dragRowRenderer: null
	,_droppedOnSelf: null
	,_dragDropLastUpdateTime: null
	,edgeAutoScrollDistance: null
	,scrollToRowIndex: function(rowIndex,animationDuration) {
		if(this._dataProvider == null || this._dataProvider.get_length() == 0) {
			return;
		}
		this._pendingScrollRowIndex = rowIndex;
		this._pendingScrollDuration = animationDuration;
		this.setInvalid(feathers_core_InvalidationFlag.SCROLL);
	}
	,itemAndColumnToCellRenderer: function(item,column) {
		if(item == null) {
			return null;
		}
		var rowRenderer = this.dataToRowRenderer.h[item.__id__];
		if(rowRenderer == null) {
			return null;
		}
		return rowRenderer.columnToCellRenderer(column);
	}
	,columnToHeaderRenderer: function(column) {
		return this.dataToHeaderRenderer.h[column.__id__];
	}
	,headerRendererToColumn: function(headerRenderer) {
		var state = this.headerRendererToHeaderState.h[headerRenderer.__id__];
		if(state == null) {
			return null;
		}
		return state.column;
	}
	,itemAndColumnToCellState: function(item,column) {
		if(item == null) {
			return null;
		}
		var rowRenderer = this.dataToRowRenderer.h[item.__id__];
		if(rowRenderer == null) {
			return null;
		}
		return rowRenderer.columnToCellState(column);
	}
	,dispose: function() {
		this.refreshInactiveHeaderRenderers(true);
		this.refreshInactiveRowRenderers(true);
		this._selectedItem = null;
		this._selectedIndex = -1;
		this.set_dataProvider(null);
		this.set_columns(null);
		feathers_controls_supportClasses_BaseScrollContainer.prototype.dispose.call(this);
	}
	,initializeGridViewTheme: function() {
		feathers_themes_steel_components_SteelGridViewStyles.initialize();
	}
	,initialize: function() {
		feathers_controls_supportClasses_BaseScrollContainer.prototype.initialize.call(this);
		if(this._headerContainerLayout == null) {
			this._headerContainerLayout = new feathers_layout_GridViewRowLayout();
			this._headerContainerLayout.set_heightResetEnabled(false);
		}
		if(this._headerContainer == null) {
			this._headerContainer = new feathers_controls_LayoutGroup();
			this._headerContainer.set_layout(this._headerContainerLayout);
			this.addChild(this._headerContainer);
		}
		if(this._headerResizeContainer == null) {
			this._headerResizeContainer = new openfl_display_Sprite();
			this.addChild(this._headerResizeContainer);
		}
		if(this._columnDividerContainer == null) {
			this._columnDividerContainer = new openfl_display_Sprite();
			this._columnDividerContainer.mouseEnabled = false;
			this._columnDividerContainer.mouseChildren = false;
			this.addChild(this._columnDividerContainer);
		}
	}
	,update: function() {
		var dataInvalid = this.isInvalid(feathers_core_InvalidationFlag.DATA);
		var layoutInvalid = this.isInvalid(feathers_core_InvalidationFlag.LAYOUT);
		var sortInvalid = this.isInvalid(feathers_core_InvalidationFlag.SORT);
		var stateInvalid = this.isInvalid(feathers_core_InvalidationFlag.STATE);
		var stylesInvalid = this.isInvalid(feathers_core_InvalidationFlag.STYLES);
		if(this._previousCustomHeaderRendererVariant != this.get_customHeaderRendererVariant()) {
			this.setInvalidationFlag(feathers_controls_GridView.INVALIDATION_FLAG_HEADER_RENDERER_FACTORY);
		}
		var headerRendererInvalid = this.isInvalid(feathers_controls_GridView.INVALIDATION_FLAG_HEADER_RENDERER_FACTORY);
		if(this._defaultHeaderDividerStorage.headerDividerFactory != this.get_headerDividerFactory()) {
			this._defaultHeaderDividerStorage.oldHeaderDividerFactory = this._defaultHeaderDividerStorage.headerDividerFactory;
			this._defaultHeaderDividerStorage.headerDividerFactory = this.get_headerDividerFactory();
			this.setInvalidationFlag(feathers_controls_GridView.INVALIDATION_FLAG_HEADER_DIVIDER_FACTORY);
		}
		if(this._defaultHeaderDividerStorage.customHeaderDividerVariant != this.get_customHeaderDividerVariant()) {
			this._defaultHeaderDividerStorage.customHeaderDividerVariant = this.get_customHeaderDividerVariant();
			this.setInvalidationFlag(feathers_controls_GridView.INVALIDATION_FLAG_HEADER_DIVIDER_FACTORY);
		}
		var headerDividerInvalid = this.isInvalid(feathers_controls_GridView.INVALIDATION_FLAG_HEADER_DIVIDER_FACTORY);
		if(this._defaultColumnDividerStorage.columnDividerFactory != this.get_columnDividerFactory()) {
			this._defaultColumnDividerStorage.oldColumnDividerFactory = this._defaultColumnDividerStorage.columnDividerFactory;
			this._defaultColumnDividerStorage.columnDividerFactory = this.get_columnDividerFactory();
			this.setInvalidationFlag(feathers_controls_GridView.INVALIDATION_FLAG_COLUMN_DIVIDER_FACTORY);
		}
		if(this._defaultColumnDividerStorage.customColumnDividerVariant != this.get_customColumnDividerVariant()) {
			this._defaultColumnDividerStorage.customColumnDividerVariant = this.get_customColumnDividerVariant();
			this.setInvalidationFlag(feathers_controls_GridView.INVALIDATION_FLAG_COLUMN_DIVIDER_FACTORY);
		}
		var columnDividerInvalid = this.isInvalid(feathers_controls_GridView.INVALIDATION_FLAG_COLUMN_DIVIDER_FACTORY);
		this.validateColumns();
		if(dataInvalid || sortInvalid) {
			this.refreshSortedColumn(sortInvalid);
		}
		if(stylesInvalid) {
			this.refreshHeaderCornerSkin();
		}
		if(stylesInvalid || layoutInvalid) {
			this.refreshColumnResizeSkin();
		}
		if(headerRendererInvalid || stateInvalid || dataInvalid || sortInvalid) {
			this.refreshHeaderRenderers();
		}
		if(headerDividerInvalid || stateInvalid || dataInvalid || sortInvalid) {
			this.refreshHeaderDividers();
		}
		if(columnDividerInvalid || stateInvalid || dataInvalid || sortInvalid) {
			this.refreshColumnDividers();
		}
		if(layoutInvalid) {
			this._headerResizeContainer.mouseEnabled = this._resizableColumns;
			this._headerResizeContainer.mouseChildren = this._resizableColumns;
		}
		if(dataInvalid || layoutInvalid) {
			var oldIgnoreHeaderLayoutChanges = this._ignoreHeaderLayoutChanges;
			this._ignoreHeaderLayoutChanges = true;
			this._headerContainerLayout.set_customColumnWidths(this._customColumnWidths);
			this._ignoreHeaderLayoutChanges = oldIgnoreHeaderLayoutChanges;
		}
		if(layoutInvalid || stylesInvalid) {
			if(this._previousLayout != this.get_layout()) {
				this._virtualCache.length = 0;
				if(this._dataProvider != null) {
					this._virtualCache.length = this._dataProvider.get_length();
				}
			}
			this.gridViewPort.set_layout(this.get_layout());
			this._previousLayout = this.get_layout();
		}
		this.gridViewPort.refreshChildren = $bind(this,this.refreshRowRenderers);
		var flag = this._invalidationFlags.keys();
		while(flag.hasNext()) {
			var flag1 = flag.next();
			this.gridViewPort.setInvalid(flag1);
		}
		if(this._allInvalid) {
			this.gridViewPort.setInvalid();
		}
		feathers_controls_supportClasses_BaseScrollContainer.prototype.update.call(this);
		this._previousCustomHeaderRendererVariant = this.get_customHeaderRendererVariant();
		this.validateCustomColumnWidths();
		this.layoutHeaders();
		this.layoutHeaderDividers();
		this.layoutColumnDividers();
		this.handlePendingScroll();
	}
	,createScroller: function() {
		feathers_controls_supportClasses_BaseScrollContainer.prototype.createScroller.call(this);
		this.gridViewPort.set_scroller(this.scroller);
	}
	,refreshScrollerValues: function() {
		feathers_controls_supportClasses_BaseScrollContainer.prototype.refreshScrollerValues.call(this);
		if(js_Boot.__implements(this.get_layout(),feathers_layout_IScrollLayout)) {
			var scrollLayout = this.get_layout();
			this.scroller.forceElasticTop = scrollLayout.get_elasticTop();
			this.scroller.forceElasticRight = scrollLayout.get_elasticRight();
			this.scroller.forceElasticBottom = scrollLayout.get_elasticBottom();
			this.scroller.forceElasticLeft = scrollLayout.get_elasticLeft();
		} else {
			this.scroller.forceElasticTop = false;
			this.scroller.forceElasticRight = false;
			this.scroller.forceElasticBottom = false;
			this.scroller.forceElasticLeft = false;
		}
		this.scroller.snapPositionsX = this.gridViewPort.get_snapPositionsX();
		this.scroller.snapPositionsY = this.gridViewPort.get_snapPositionsY();
	}
	,needsScrollMeasurement: function() {
		var oldStart = this._visibleIndices.start;
		var oldEnd = this._visibleIndices.end;
		if(this._virtualLayout && js_Boot.__implements(this.get_layout(),feathers_layout_IVirtualLayout)) {
			var virtualLayout = this.get_layout();
			var oldIgnoreLayoutChanges = this._ignoreLayoutChanges;
			this._ignoreLayoutChanges = true;
			virtualLayout.set_scrollX(this.scroller.get_scrollX());
			virtualLayout.set_scrollY(this.scroller.get_scrollY());
			this._ignoreLayoutChanges = oldIgnoreLayoutChanges;
			virtualLayout.getVisibleIndices(this._rowLayoutItems.length,this.gridViewPort.get_visibleWidth(),this.gridViewPort.get_visibleHeight(),this._tempVisibleIndices);
		} else {
			this._tempVisibleIndices.start = 0;
			this._tempVisibleIndices.end = this._rowLayoutItems.length - 1;
		}
		if(oldStart == this._tempVisibleIndices.start) {
			return oldEnd != this._tempVisibleIndices.end;
		} else {
			return true;
		}
	}
	,calculateViewPortOffsets: function(forceScrollBars,useActualBounds) {
		var oldTopViewPortOffset = this.topViewPortOffset;
		var oldRightViewPortOffset = this.rightViewPortOffset;
		var oldBottomViewPortOffset = this.bottomViewPortOffset;
		var oldLeftViewPortOffset = this.leftViewPortOffset;
		if(this.get_fixedScrollBars() && this.get_showScrollBars()) {
			feathers_controls_supportClasses_BaseScrollContainer.prototype.calculateViewPortOffsets.call(this,forceScrollBars,useActualBounds);
		}
		if(this._headerContainer != null) {
			var oldIgnoreHeaderLayoutChanges = this._ignoreHeaderLayoutChanges;
			this._ignoreHeaderLayoutChanges = true;
			if(this.get_scrollBarYPosition()._hx_index == 3) {
				this._headerContainerLayout.set_paddingLeft(this.leftViewPortOffset);
				this._headerContainerLayout.set_paddingRight(0.0);
			} else {
				this._headerContainerLayout.set_paddingLeft(0.0);
				this._headerContainerLayout.set_paddingRight(this.rightViewPortOffset);
			}
			this._ignoreHeaderLayoutChanges = oldIgnoreHeaderLayoutChanges;
			this.topViewPortOffset = oldTopViewPortOffset;
			this.rightViewPortOffset = oldRightViewPortOffset;
			this.bottomViewPortOffset = oldBottomViewPortOffset;
			this.leftViewPortOffset = oldLeftViewPortOffset;
			this._headerContainer.validateNow();
			this.topViewPortOffset += this._headerContainer.get_height();
			this.chromeMeasuredWidth = Math.max(this.chromeMeasuredWidth,this._headerContainer.get_width());
			this.chromeMeasuredMinWidth = Math.max(this.chromeMeasuredMinWidth,this._headerContainer.get_width());
			feathers_controls_supportClasses_BaseScrollContainer.prototype.calculateViewPortOffsets.call(this,forceScrollBars,useActualBounds);
			var oldIgnoreHeaderLayoutChanges = this._ignoreHeaderLayoutChanges;
			this._ignoreHeaderLayoutChanges = true;
			if(this.get_scrollBarYPosition()._hx_index == 3) {
				this._headerContainerLayout.set_paddingLeft(this.leftViewPortOffset);
				this._headerContainerLayout.set_paddingRight(0.0);
			} else {
				this._headerContainerLayout.set_paddingLeft(0.0);
				this._headerContainerLayout.set_paddingRight(this.rightViewPortOffset);
			}
			this._ignoreHeaderLayoutChanges = oldIgnoreHeaderLayoutChanges;
		}
	}
	,validateColumns: function() {
		var _gthis = this;
		if(this._columns != null) {
			return;
		}
		var newColumns = null;
		if(this._dataProvider != null && this._dataProvider.get_length() > 0) {
			var item = this._dataProvider.get(0);
			var _this = Reflect.fields(item);
			var result = new Array(_this.length);
			var _g = 0;
			var _g1 = _this.length;
			while(_g < _g1) {
				var i = _g++;
				var fieldName = [_this[i]];
				result[i] = new feathers_controls_GridViewColumn(fieldName[0],(function(fieldName) {
					return function(item) {
						return Std.string(Reflect.getProperty(item,fieldName[0]));
					};
				})(fieldName));
			}
			newColumns = new feathers_data_ArrayCollection(result);
		} else {
			newColumns = new feathers_data_ArrayCollection();
		}
		this.runWithInvalidationFlagsOnly(function() {
			_gthis.set_columns(newColumns);
		});
		this._autoPopulatedColumns = newColumns;
	}
	,layoutHeaders: function() {
		if(this._headerContainer == null) {
			return;
		}
		this._headerContainer.set_x(this.get_paddingLeft());
		this._headerContainer.set_y(this.get_paddingTop());
		var minHeaderWidth = this.actualWidth - this.get_paddingLeft() - this.get_paddingRight();
		this._headerContainer.set_width(Math.max(this._viewPort.get_width() + this._headerContainerLayout.get_paddingLeft() + this._headerContainerLayout.get_paddingRight(),minHeaderWidth));
		this._headerContainer.validateNow();
		if(!feathers_utils_MathUtil.fuzzyEquals(this.get_maxScrollX(),this.get_minScrollX())) {
			var scrollRect = this._scrollRect1;
			if(this._currentScrollRect == scrollRect) {
				scrollRect = this._scrollRect2;
			}
			this._currentScrollRect = scrollRect;
			var scrollRectWidth = minHeaderWidth;
			if(scrollRectWidth < 0.0) {
				scrollRectWidth = 0.0;
			}
			var scrollRectHeight = this._headerContainer.get_height();
			if(scrollRectHeight < 0.0) {
				scrollRectHeight = 0.0;
			}
			scrollRect.setTo(this.get_scrollX() - this.get_minScrollX(),0.0,scrollRectWidth,scrollRectHeight);
			this._headerContainer.set_scrollRect(scrollRect);
		} else {
			this._headerContainer.set_scrollRect(null);
		}
		if(this._currentHeaderCornerSkin != null) {
			if(this.get_fixedScrollBars() && !this.get_extendedScrollBarY() && this.scrollBarY != null && this.scrollBarY.get_visible()) {
				this._currentHeaderCornerSkin.set_x(this.scrollBarY.get_x());
				this._currentHeaderCornerSkin.set_width(this.scrollBarY.get_width());
				this._currentHeaderCornerSkin.set_y(this._headerContainer.get_y());
				this._currentHeaderCornerSkin.set_height(this._headerContainer.get_height());
				this._currentHeaderCornerSkin.set_visible(true);
			} else {
				this._currentHeaderCornerSkin.set_visible(false);
			}
		}
	}
	,layoutHeaderDividers: function() {
		this._headerResizeContainer.set_x(this._headerContainer.get_x());
		this._headerResizeContainer.set_y(this._headerContainer.get_y());
		var _g = 0;
		var _g1 = this._headerDividerLayoutItems.length;
		while(_g < _g1) {
			var i = _g++;
			var headerDivider = this._headerDividerLayoutItems[i];
			headerDivider.set_visible(!this.get_showHeaderDividersOnlyWhenResizable() || this.get_resizableColumns());
			if(js_Boot.__implements(headerDivider,feathers_core_IValidating)) {
				headerDivider.validateNow();
			}
			var headerRenderer = this._headerLayoutItems[i];
			headerDivider.set_x(headerRenderer.get_x() + headerRenderer.get_width() - headerDivider.get_width() / 2.0);
			headerDivider.set_y(headerRenderer.get_y());
			headerDivider.set_height(headerRenderer.get_height());
		}
	}
	,layoutColumnDividers: function() {
		this._columnDividerContainer.set_x(this._viewPort.get_x());
		this._columnDividerContainer.set_y(this._viewPort.get_y());
		var _g = 0;
		var _g1 = this._columnDividerLayoutItems.length;
		while(_g < _g1) {
			var i = _g++;
			var columnDivider = this._columnDividerLayoutItems[i];
			if(js_Boot.__implements(columnDivider,feathers_core_IValidating)) {
				columnDivider.validateNow();
			}
			var headerRenderer = this._headerLayoutItems[i];
			columnDivider.set_x(headerRenderer.get_x() + headerRenderer.get_width() - columnDivider.get_width() / 2.0);
			columnDivider.set_y(headerRenderer.get_y());
			columnDivider.set_height(this._viewPort.get_visibleHeight());
		}
	}
	,layoutScrollBars: function() {
		if(!this.get_extendedScrollBarY()) {
			feathers_controls_supportClasses_BaseScrollContainer.prototype.layoutScrollBars.call(this);
			return;
		}
		var oldTopViewPortOffset = this.topViewPortOffset;
		this.topViewPortOffset = 0.0;
		feathers_controls_supportClasses_BaseScrollContainer.prototype.layoutScrollBars.call(this);
		this.topViewPortOffset = oldTopViewPortOffset;
	}
	,refreshHeaderCornerSkin: function() {
		var oldSkin = this._currentHeaderCornerSkin;
		this._currentHeaderCornerSkin = this.getCurrentHeaderCornerSkin();
		if(this._currentHeaderCornerSkin == oldSkin) {
			return;
		}
		this.removeCurrentHeaderCornerSkin(oldSkin);
		this.addCurrentHeaderCornerSkin(this._currentHeaderCornerSkin);
	}
	,getCurrentHeaderCornerSkin: function() {
		return this.get_headerCornerSkin();
	}
	,addCurrentHeaderCornerSkin: function(skin) {
		if(skin == null) {
			return;
		}
		if(js_Boot.__implements(skin,feathers_core_IUIControl)) {
			skin.initializeNow();
		}
		if(js_Boot.__implements(skin,feathers_skins_IProgrammaticSkin)) {
			skin.set_uiContext(this);
		}
		this.addChild(skin);
	}
	,removeCurrentHeaderCornerSkin: function(skin) {
		if(skin == null) {
			return;
		}
		if(js_Boot.__implements(skin,feathers_skins_IProgrammaticSkin)) {
			skin.set_uiContext(null);
		}
		if(skin.parent == this) {
			this.removeChild(skin);
		}
	}
	,refreshColumnResizeSkin: function() {
		var oldSkin = this._currentColumnResizeSkin;
		this._currentColumnResizeSkin = this.getCurrentColumnResizeSkin();
		if(this._currentColumnResizeSkin == oldSkin) {
			return;
		}
		this.removeCurrentColumnResizeSkin(oldSkin);
		if(this._currentColumnResizeSkin == null) {
			return;
		}
		if(js_Boot.__implements(this._currentColumnResizeSkin,feathers_core_IUIControl)) {
			this._currentColumnResizeSkin.initializeNow();
		}
		if(js_Boot.__implements(this._currentColumnResizeSkin,feathers_skins_IProgrammaticSkin)) {
			this._currentColumnResizeSkin.set_uiContext(this);
		}
		this._currentColumnResizeSkin.set_visible(false);
		if(((this._currentColumnResizeSkin) instanceof openfl_display_InteractiveObject)) {
			this._currentColumnResizeSkin.mouseEnabled = false;
		}
		if(((this._currentColumnResizeSkin) instanceof openfl_display_DisplayObjectContainer)) {
			this._currentColumnResizeSkin.mouseChildren = false;
		}
		this.addChildAt(this._currentColumnResizeSkin,0);
	}
	,getCurrentColumnResizeSkin: function() {
		return this.get_columnResizeSkin();
	}
	,removeCurrentColumnResizeSkin: function(skin) {
		if(skin == null) {
			return;
		}
		if(js_Boot.__implements(skin,feathers_skins_IProgrammaticSkin)) {
			skin.set_uiContext(null);
		}
		if(skin.parent == this) {
			this.removeChild(skin);
		}
	}
	,refreshHeaderRenderers: function() {
		var oldIgnoreHeaderLayoutChanges = this._ignoreHeaderLayoutChanges;
		this._ignoreHeaderLayoutChanges = true;
		this._headerContainerLayout.set_columns(this._columns);
		this._ignoreHeaderLayoutChanges = oldIgnoreHeaderLayoutChanges;
		if(this._defaultHeaderStorage.headerRendererRecycler.update == null) {
			this._defaultHeaderStorage.headerRendererRecycler.update = feathers_controls_GridView.defaultUpdateHeaderRenderer;
			if(this._defaultHeaderStorage.headerRendererRecycler.reset == null) {
				this._defaultHeaderStorage.headerRendererRecycler.reset = feathers_controls_GridView.defaultResetHeaderRenderer;
			}
		}
		var headerRendererInvalid = this.isInvalid(feathers_controls_GridView.INVALIDATION_FLAG_HEADER_RENDERER_FACTORY);
		this.refreshInactiveHeaderRenderers(headerRendererInvalid);
		this.findUnrenderedHeaderData();
		this.recoverInactiveHeaderRenderers();
		this.renderUnrenderedHeaderData();
		this.freeInactiveHeaderRenderers();
		if(this._defaultHeaderStorage.inactiveHeaderRenderers.length > 0) {
			var c = js_Boot.getClass(this);
			throw new openfl_errors_IllegalOperationError("" + c.__name__ + ": inactive header renderers should be empty after updating.");
		}
	}
	,refreshHeaderDividers: function() {
		var headerDividerInvalid = this.isInvalid(feathers_controls_GridView.INVALIDATION_FLAG_HEADER_DIVIDER_FACTORY);
		this.refreshInactiveHeaderDividers(headerDividerInvalid);
		this.refreshActiveHeaderDividers();
		this.freeInactiveHeaderDividers();
		if(this._defaultHeaderDividerStorage.inactiveHeaderDividers.length > 0) {
			var c = js_Boot.getClass(this);
			throw new openfl_errors_IllegalOperationError("" + c.__name__ + ": inactive header dividers should be empty after updating.");
		}
	}
	,refreshColumnDividers: function() {
		var columnDividerInvalid = this.isInvalid(feathers_controls_GridView.INVALIDATION_FLAG_COLUMN_DIVIDER_FACTORY);
		this.refreshInactiveColumnDividers(columnDividerInvalid);
		this.refreshActiveColumnDividers();
		this.freeInactiveColumnDividers();
		if(this._defaultColumnDividerStorage.inactiveColumnDividers.length > 0) {
			var c = js_Boot.getClass(this);
			throw new openfl_errors_IllegalOperationError("" + c.__name__ + ": inactive column dividers should be empty after updating.");
		}
	}
	,refreshInactiveHeaderDividers: function(factoryInvalid) {
		var temp = this._defaultHeaderDividerStorage.inactiveHeaderDividers;
		this._defaultHeaderDividerStorage.inactiveHeaderDividers = this._defaultHeaderDividerStorage.activeHeaderDividers;
		this._defaultHeaderDividerStorage.activeHeaderDividers = temp;
		if(this._defaultHeaderDividerStorage.activeHeaderDividers.length > 0) {
			var c = js_Boot.getClass(this);
			throw new openfl_errors_IllegalOperationError("" + c.__name__ + ": active header dividers should be empty before updating.");
		}
		if(factoryInvalid) {
			this.freeInactiveHeaderDividers();
			this._defaultHeaderDividerStorage.oldHeaderDividerFactory = null;
		}
	}
	,freeInactiveHeaderDividers: function() {
		var factory = this._defaultHeaderDividerStorage.oldHeaderDividerFactory != null ? this._defaultHeaderDividerStorage.oldHeaderDividerFactory : this._defaultHeaderDividerStorage.headerDividerFactory;
		var _g = 0;
		var _g1 = this._defaultHeaderDividerStorage.inactiveHeaderDividers;
		while(_g < _g1.length) {
			var headerDivider = _g1[_g];
			++_g;
			if(headerDivider == null) {
				continue;
			}
			this.destroyHeaderDivider(headerDivider,factory);
		}
		this._defaultHeaderDividerStorage.inactiveHeaderDividers.length = 0;
	}
	,refreshActiveHeaderDividers: function() {
		this._headerDividerLayoutItems.length = 0;
		if(this._defaultHeaderDividerStorage.headerDividerFactory == null) {
			return;
		}
		var _g = 0;
		var _g1 = this._columns.get_length() - 1;
		while(_g < _g1) {
			var i = _g++;
			var column = this._columns.get(i);
			var headerDivider = this.createHeaderDivider(column,i);
			this._headerDividerLayoutItems[i] = headerDivider;
			this._defaultHeaderDividerStorage.activeHeaderDividers.push(headerDivider);
		}
	}
	,createHeaderDivider: function(column,columnIndex) {
		var headerDivider = null;
		if(this._defaultHeaderDividerStorage.inactiveHeaderDividers.length == 0) {
			headerDivider = this._defaultHeaderDividerStorage.headerDividerFactory.create();
			if(js_Boot.__implements(headerDivider,feathers_style_IVariantStyleObject)) {
				var variantHeaderDivider = headerDivider;
				if(variantHeaderDivider.get_variant() == null) {
					var variant = this.get_customHeaderDividerVariant() != null ? this.get_customHeaderDividerVariant() : feathers_controls_GridView.CHILD_VARIANT_HEADER_DIVIDER;
					variantHeaderDivider.set_variant(variant);
				}
			}
			if(js_Boot.__implements(headerDivider,feathers_core_IUIControl)) {
				headerDivider.initializeNow();
			}
			headerDivider.addEventListener("rollOver",$bind(this,this.gridView_headerDivider_rollOverHandler));
			headerDivider.addEventListener("rollOut",$bind(this,this.gridView_headerDivider_rollOutHandler));
			headerDivider.addEventListener("mouseDown",$bind(this,this.gridView_headerDivider_mouseDownHandler));
			headerDivider.addEventListener("touchBegin",$bind(this,this.gridView_headerDivider_touchBeginHandler));
			this._headerResizeContainer.addChildAt(headerDivider,columnIndex);
		} else {
			headerDivider = this._defaultHeaderDividerStorage.inactiveHeaderDividers.shift();
			this._headerResizeContainer.setChildIndex(headerDivider,columnIndex);
		}
		return headerDivider;
	}
	,destroyHeaderDivider: function(headerDivider,factory) {
		headerDivider.removeEventListener("rollOver",$bind(this,this.gridView_headerDivider_rollOverHandler));
		headerDivider.removeEventListener("rollOut",$bind(this,this.gridView_headerDivider_rollOutHandler));
		headerDivider.removeEventListener("mouseDown",$bind(this,this.gridView_headerDivider_mouseDownHandler));
		headerDivider.removeEventListener("touchBegin",$bind(this,this.gridView_headerDivider_touchBeginHandler));
		this._headerResizeContainer.removeChild(headerDivider);
		if(factory != null && factory.destroy != null) {
			factory.destroy(headerDivider);
		}
	}
	,refreshInactiveColumnDividers: function(factoryInvalid) {
		var temp = this._defaultColumnDividerStorage.inactiveColumnDividers;
		this._defaultColumnDividerStorage.inactiveColumnDividers = this._defaultColumnDividerStorage.activeColumnDividers;
		this._defaultColumnDividerStorage.activeColumnDividers = temp;
		if(this._defaultColumnDividerStorage.activeColumnDividers.length > 0) {
			var c = js_Boot.getClass(this);
			throw new openfl_errors_IllegalOperationError("" + c.__name__ + ": active column dividers should be empty before updating.");
		}
		if(factoryInvalid) {
			this.freeInactiveHeaderDividers();
			this._defaultColumnDividerStorage.oldColumnDividerFactory = null;
		}
	}
	,freeInactiveColumnDividers: function() {
		var factory = this._defaultColumnDividerStorage.oldColumnDividerFactory != null ? this._defaultColumnDividerStorage.oldColumnDividerFactory : this._defaultColumnDividerStorage.columnDividerFactory;
		var _g = 0;
		var _g1 = this._defaultColumnDividerStorage.inactiveColumnDividers;
		while(_g < _g1.length) {
			var headerDivider = _g1[_g];
			++_g;
			if(headerDivider == null) {
				continue;
			}
			this.destroyColumnDivider(headerDivider,factory);
		}
		this._defaultColumnDividerStorage.inactiveColumnDividers.length = 0;
	}
	,refreshActiveColumnDividers: function() {
		this._columnDividerLayoutItems.length = 0;
		if(this._defaultColumnDividerStorage.columnDividerFactory == null) {
			return;
		}
		var _g = 0;
		var _g1 = this._columns.get_length() - 1;
		while(_g < _g1) {
			var i = _g++;
			var column = this._columns.get(i);
			var columnDivider = this.createColumnDivider(column,i);
			this._columnDividerLayoutItems[i] = columnDivider;
			this._defaultColumnDividerStorage.activeColumnDividers.push(columnDivider);
		}
	}
	,createColumnDivider: function(column,columnIndex) {
		var columnDivider = null;
		if(this._defaultColumnDividerStorage.inactiveColumnDividers.length == 0) {
			columnDivider = this._defaultColumnDividerStorage.columnDividerFactory.create();
			if(js_Boot.__implements(columnDivider,feathers_style_IVariantStyleObject)) {
				var variantColumnDivider = columnDivider;
				if(variantColumnDivider.get_variant() == null) {
					var variant = this.get_customColumnDividerVariant() != null ? this.get_customColumnDividerVariant() : feathers_controls_GridView.CHILD_VARIANT_COLUMN_DIVIDER;
					variantColumnDivider.set_variant(variant);
				}
			}
			if(js_Boot.__implements(columnDivider,feathers_core_IUIControl)) {
				columnDivider.initializeNow();
			}
			this._columnDividerContainer.addChildAt(columnDivider,columnIndex);
		} else {
			columnDivider = this._defaultColumnDividerStorage.inactiveColumnDividers.shift();
			this._columnDividerContainer.setChildIndex(columnDivider,columnIndex);
		}
		return columnDivider;
	}
	,destroyColumnDivider: function(columnDivider,factory) {
		this._columnDividerContainer.removeChild(columnDivider);
		if(factory != null && factory.destroy != null) {
			factory.destroy(columnDivider);
		}
	}
	,refreshInactiveHeaderRenderers: function(factoryInvalid) {
		var temp = this._defaultHeaderStorage.inactiveHeaderRenderers;
		this._defaultHeaderStorage.inactiveHeaderRenderers = this._defaultHeaderStorage.activeHeaderRenderers;
		this._defaultHeaderStorage.activeHeaderRenderers = temp;
		if(this._defaultHeaderStorage.activeHeaderRenderers.length > 0) {
			var c = js_Boot.getClass(this);
			throw new openfl_errors_IllegalOperationError("" + c.__name__ + ": active header renderers should be empty before updating.");
		}
		if(factoryInvalid) {
			this.recoverInactiveHeaderRenderers();
			this.freeInactiveHeaderRenderers();
			this._defaultHeaderStorage.oldHeaderRendererRecycler = null;
		}
	}
	,recoverInactiveHeaderRenderers: function() {
		var _g = 0;
		var _g1 = this._defaultHeaderStorage.inactiveHeaderRenderers;
		while(_g < _g1.length) {
			var headerRenderer = _g1[_g];
			++_g;
			if(headerRenderer == null) {
				continue;
			}
			var state = this.headerRendererToHeaderState.h[headerRenderer.__id__];
			if(state == null) {
				continue;
			}
			var column = state.column;
			this.headerRendererToHeaderState.remove(headerRenderer);
			this.dataToHeaderRenderer.remove(column);
			headerRenderer.removeEventListener("trigger",$bind(this,this.gridView_headerRenderer_triggerHandler));
			headerRenderer.removeEventListener("click",$bind(this,this.gridView_headerRenderer_clickHandler));
			headerRenderer.removeEventListener("touchTap",$bind(this,this.gridView_headerRenderer_touchTapHandler));
			headerRenderer.removeEventListener("resize",$bind(this,this.gridView_headerRenderer_resizeHandler));
			this.resetHeaderRenderer(headerRenderer,state);
			if(this._defaultHeaderStorage.measurements != null) {
				this._defaultHeaderStorage.measurements.restore(headerRenderer);
			}
			this.headerStatePool.release(state);
		}
	}
	,freeInactiveHeaderRenderers: function() {
		var recycler = this._defaultHeaderStorage.oldHeaderRendererRecycler != null ? this._defaultHeaderStorage.oldHeaderRendererRecycler : this._defaultHeaderStorage.headerRendererRecycler;
		var _g = 0;
		var _g1 = this._defaultHeaderStorage.inactiveHeaderRenderers;
		while(_g < _g1.length) {
			var headerRenderer = _g1[_g];
			++_g;
			if(headerRenderer == null) {
				continue;
			}
			this.destroyHeaderRenderer(headerRenderer,recycler);
		}
		this._defaultHeaderStorage.inactiveHeaderRenderers.length = 0;
	}
	,findUnrenderedHeaderData: function() {
		this._rowLayoutItems.length = 0;
		if(this._columns == null || this._columns.get_length() == 0) {
			return;
		}
		this._rowLayoutItems.length = this._columns.get_length();
		var _g = 0;
		var _g1 = this._columns.get_length();
		while(_g < _g1) {
			var i = _g++;
			var column = this._columns.get(i);
			var headerRenderer = this.dataToHeaderRenderer.h[column.__id__];
			if(headerRenderer != null) {
				var state = this.headerRendererToHeaderState.h[headerRenderer.__id__];
				var changed = this.populateCurrentHeaderState(column,i,state,this._forceItemStateUpdate);
				if(changed) {
					this.updateHeaderRenderer(headerRenderer,state);
				}
				headerRenderer.set_visible(true);
				this._headerLayoutItems[i] = headerRenderer;
				var removed = HxOverrides.remove(this._defaultHeaderStorage.inactiveHeaderRenderers,headerRenderer);
				if(!removed) {
					var c = js_Boot.getClass(this);
					throw new openfl_errors_IllegalOperationError("" + c.__name__ + ": header renderer map contains bad data for column at index " + i + ". This may be caused by duplicate columns, which is not allowed.");
				}
				this._defaultHeaderStorage.activeHeaderRenderers.push(headerRenderer);
			} else {
				this._unrenderedHeaderData.push(column);
			}
		}
	}
	,renderUnrenderedHeaderData: function() {
		var _g = 0;
		var _g1 = this._unrenderedHeaderData;
		while(_g < _g1.length) {
			var column = _g1[_g];
			++_g;
			var index = this._columns.indexOf(column);
			var state = this.headerStatePool.get();
			this.populateCurrentHeaderState(column,index,state,true);
			var headerRenderer = this.createHeaderRenderer(state);
			headerRenderer.set_visible(true);
			this._headerContainer.addChildAt(headerRenderer,index);
			this._headerLayoutItems[index] = headerRenderer;
		}
		this._unrenderedHeaderData.length = 0;
	}
	,refreshRowRenderers: function(items) {
		this._rowLayoutItems = items;
		var rowRendererInvalid = this.gridViewPort.isInvalid(feathers_controls_GridView.INVALIDATION_FLAG_ROW_RENDERER_FACTORY);
		this.refreshInactiveRowRenderers(rowRendererInvalid);
		this.findUnrenderedData();
		this.recoverInactiveRowRenderers();
		this.renderUnrenderedData();
		this.freeInactiveRowRenderers();
		if(this.inactiveRowRenderers.length > 0) {
			var c = js_Boot.getClass(this);
			throw new openfl_errors_IllegalOperationError("" + c.__name__ + ": inactive row renderers should be empty after updating.");
		}
	}
	,refreshInactiveRowRenderers: function(factoryInvalid) {
		var temp = this.inactiveRowRenderers;
		this.inactiveRowRenderers = this.activeRowRenderers;
		this.activeRowRenderers = temp;
		if(this.activeRowRenderers.length > 0) {
			var c = js_Boot.getClass(this);
			throw new openfl_errors_IllegalOperationError("" + c.__name__ + ": active row renderers should be empty before updating.");
		}
		if(factoryInvalid) {
			this.recoverInactiveRowRenderers();
			this.freeInactiveRowRenderers();
			this._oldRowRendererFactory = null;
		}
	}
	,recoverInactiveRowRenderers: function() {
		var _g = 0;
		var _g1 = this.inactiveRowRenderers;
		while(_g < _g1.length) {
			var rowRenderer = _g1[_g];
			++_g;
			if(rowRenderer == null) {
				continue;
			}
			var state = this.rowRendererToRowState.h[rowRenderer.__id__];
			if(state == null) {
				continue;
			}
			var item = state.data;
			this.rowRendererToRowState.remove(rowRenderer);
			this.dataToRowRenderer.remove(item);
			rowRenderer.removeEventListener("cellTrigger",$bind(this,this.gridView_rowRenderer_cellTriggerHandler));
			rowRenderer.removeEventListener("trigger",$bind(this,this.gridView_rowRenderer_triggerHandler));
			rowRenderer.removeEventListener("mouseDown",$bind(this,this.gridView_rowRenderer_mouseDownHandler));
			this.resetRowRenderer(rowRenderer,state);
			if(this._rowRendererMeasurements != null) {
				this._rowRendererMeasurements.restore(rowRenderer);
			}
			this.rowStatePool.release(state);
		}
	}
	,freeInactiveRowRenderers: function() {
		var _g = 0;
		var _g1 = this.inactiveRowRenderers;
		while(_g < _g1.length) {
			var rowRenderer = _g1[_g];
			++_g;
			if(rowRenderer == null) {
				continue;
			}
			this.destroyRowRenderer(rowRenderer);
		}
		this.inactiveRowRenderers.length = 0;
	}
	,findUnrenderedData: function() {
		this._rowLayoutItems.length = 0;
		this._visibleIndices.start = 0;
		this._visibleIndices.end = 0;
		if(this._dataProvider == null || this._dataProvider.get_length() == 0) {
			return;
		}
		this._rowLayoutItems.length = this._dataProvider.get_length();
		if(this._virtualLayout && js_Boot.__implements(this.get_layout(),feathers_layout_IVirtualLayout)) {
			var virtualLayout = this.get_layout();
			var oldIgnoreLayoutChanges = this._ignoreLayoutChanges;
			this._ignoreLayoutChanges = true;
			virtualLayout.set_scrollX(this.scroller.get_scrollX());
			virtualLayout.set_scrollY(this.scroller.get_scrollY());
			virtualLayout.set_virtualCache(this._virtualCache);
			this._ignoreLayoutChanges = oldIgnoreLayoutChanges;
			virtualLayout.getVisibleIndices(this._dataProvider.get_length(),this.gridViewPort.get_visibleWidth(),this.gridViewPort.get_visibleHeight(),this._visibleIndices);
		} else {
			this._visibleIndices.start = 0;
			var tmp = this._dataProvider.get_length();
			this._visibleIndices.end = tmp - 1;
		}
		if(this._dataProvider == null || this._dataProvider.get_length() == 0) {
			return;
		}
		var _g = this._visibleIndices.start;
		var _g1 = this._visibleIndices.end + 1;
		while(_g < _g1) {
			var i = _g++;
			var item = this._dataProvider.get(i);
			var rowRenderer = this.dataToRowRenderer.h[item.__id__];
			if(rowRenderer != null) {
				var state = this.rowRendererToRowState.h[rowRenderer.__id__];
				var changed = this.populateCurrentRowState(item,i,state,this._forceItemStateUpdate);
				if(changed) {
					this.updateRowRenderer(rowRenderer,state);
				}
				this._rowLayoutItems[i] = rowRenderer;
				var removed = HxOverrides.remove(this.inactiveRowRenderers,rowRenderer);
				if(!removed) {
					var c = js_Boot.getClass(this);
					throw new openfl_errors_IllegalOperationError("" + c.__name__ + ": row renderer map contains bad data for item at index " + i + ". This may be caused by duplicate items in the data provider, which is not allowed.");
				}
				this.activeRowRenderers.push(rowRenderer);
			} else {
				this._unrenderedData.push(item);
			}
		}
	}
	,renderUnrenderedData: function() {
		var _g = 0;
		var _g1 = this._unrenderedData;
		while(_g < _g1.length) {
			var item = _g1[_g];
			++_g;
			var rowIndex = this._dataProvider.indexOf(item);
			var state = this.rowStatePool.get();
			this.populateCurrentRowState(item,rowIndex,state,true);
			var rowRenderer = this.createRowRenderer(state);
			rowRenderer.set_visible(true);
			this.activeRowRenderers.push(rowRenderer);
			this.gridViewPort.addChild(rowRenderer);
			this._rowLayoutItems[rowIndex] = rowRenderer;
		}
		this._unrenderedData.length = 0;
	}
	,createRowRenderer: function(state) {
		var rowRenderer = null;
		if(this.inactiveRowRenderers.length == 0) {
			rowRenderer = this._rowRendererFactory.create();
			if(this._rowRendererMeasurements == null) {
				this._rowRendererMeasurements = new feathers_layout_Measurements(rowRenderer);
			}
			rowRenderer.initializeNow();
		} else {
			rowRenderer = this.inactiveRowRenderers.shift();
		}
		this.updateRowRenderer(rowRenderer,state);
		rowRenderer.set_gridView(this);
		rowRenderer.addEventListener("cellTrigger",$bind(this,this.gridView_rowRenderer_cellTriggerHandler));
		rowRenderer.addEventListener("trigger",$bind(this,this.gridView_rowRenderer_triggerHandler));
		rowRenderer.addEventListener("mouseDown",$bind(this,this.gridView_rowRenderer_mouseDownHandler));
		this.rowRendererToRowState.set(rowRenderer,state);
		this.dataToRowRenderer.set(state.data,rowRenderer);
		return rowRenderer;
	}
	,destroyRowRenderer: function(rowRenderer) {
		var factory = this._oldRowRendererFactory != null ? this._oldRowRendererFactory : this._rowRendererFactory;
		rowRenderer.set_gridView(null);
		this.gridViewPort.removeChild(rowRenderer);
		if(factory.destroy != null) {
			factory.destroy(rowRenderer);
		}
	}
	,updateRowRenderer: function(rowRenderer,state) {
		this.refreshRowRendererProperties(rowRenderer,state);
	}
	,resetRowRenderer: function(rowRenderer,state) {
		this.refreshRowRendererProperties(rowRenderer,feathers_controls_GridView.RESET_ROW_STATE);
	}
	,populateCurrentRowState: function(item,rowIndex,state,force) {
		var changed = false;
		if(force || state.owner != this) {
			state.owner = this;
			changed = true;
		}
		if(force || state.data != item) {
			state.data = item;
			changed = true;
		}
		if(force || state.rowIndex != rowIndex) {
			state.rowIndex = rowIndex;
			changed = true;
		}
		var selected = this._selectedIndices.indexOf(rowIndex) != -1;
		if(force || state.selected != selected) {
			state.selected = selected;
			changed = true;
		}
		var enabled = this._enabled;
		if(force || state.enabled != enabled) {
			state.enabled = enabled;
			changed = true;
		}
		var columns = this._columns;
		if(force || state.columns != columns) {
			state.columns = columns;
			changed = true;
		}
		var cellRendererRecycler = this._cellRendererRecycler;
		if(force || state.cellRendererRecycler != cellRendererRecycler) {
			state.cellRendererRecycler = cellRendererRecycler;
			changed = true;
		}
		var customColumnWidths = this._customColumnWidths;
		if(force || state.customColumnWidths != customColumnWidths) {
			state.customColumnWidths = customColumnWidths;
			changed = true;
		}
		var customCellRendererVariant = this.get_customCellRendererVariant();
		if(force || state.customCellRendererVariant != customCellRendererVariant) {
			state.customCellRendererVariant = customCellRendererVariant;
			changed = true;
		}
		var forceItemStateUpdate = this._forceItemStateUpdate;
		if(force || state.forceItemStateUpdate != forceItemStateUpdate) {
			state.forceItemStateUpdate = forceItemStateUpdate;
			changed = true;
		}
		return changed;
	}
	,refreshRowRendererProperties: function(rowRenderer,state) {
		var oldIgnoreSelectionChange = this._ignoreSelectionChange;
		this._ignoreSelectionChange = true;
		rowRenderer.set_data(state.data);
		rowRenderer.set_rowIndex(state.rowIndex);
		rowRenderer.set_selected(state.selected);
		rowRenderer.set_enabled(state.enabled);
		rowRenderer.set_columns(state.columns);
		rowRenderer.set_cellRendererRecycler(state.cellRendererRecycler);
		rowRenderer.set_customColumnWidths(state.customColumnWidths);
		rowRenderer.set_customCellRendererVariant(state.customCellRendererVariant);
		rowRenderer.set_forceCellStateUpdate(state.forceItemStateUpdate);
		this._ignoreSelectionChange = oldIgnoreSelectionChange;
	}
	,createHeaderRenderer: function(state) {
		var headerRenderer = null;
		if(this._defaultHeaderStorage.inactiveHeaderRenderers.length == 0) {
			headerRenderer = this._defaultHeaderStorage.headerRendererRecycler.create();
			if(js_Boot.__implements(headerRenderer,feathers_style_IVariantStyleObject)) {
				var variantHeaderRenderer = headerRenderer;
				if(variantHeaderRenderer.get_variant() == null) {
					var variant = this.get_customHeaderRendererVariant() != null ? this.get_customHeaderRendererVariant() : feathers_controls_GridView.CHILD_VARIANT_HEADER_RENDERER;
					variantHeaderRenderer.set_variant(variant);
				}
			}
			if(js_Boot.__implements(headerRenderer,feathers_core_IUIControl)) {
				headerRenderer.initializeNow();
			}
			if(this._defaultHeaderStorage.measurements == null) {
				this._defaultHeaderStorage.measurements = new feathers_layout_Measurements(headerRenderer);
			}
		} else {
			headerRenderer = this._defaultHeaderStorage.inactiveHeaderRenderers.shift();
		}
		this.updateHeaderRenderer(headerRenderer,state);
		if(js_Boot.__implements(headerRenderer,feathers_controls_ITriggerView)) {
			headerRenderer.addEventListener("trigger",$bind(this,this.gridView_headerRenderer_triggerHandler));
		} else {
			headerRenderer.addEventListener("click",$bind(this,this.gridView_headerRenderer_clickHandler));
			headerRenderer.addEventListener("touchTap",$bind(this,this.gridView_headerRenderer_touchTapHandler));
		}
		if(js_Boot.__implements(headerRenderer,feathers_core_IMeasureObject)) {
			headerRenderer.addEventListener("resize",$bind(this,this.gridView_headerRenderer_resizeHandler));
		}
		this.headerRendererToHeaderState.set(headerRenderer,state);
		this.dataToHeaderRenderer.set(state.column,headerRenderer);
		this._defaultHeaderStorage.activeHeaderRenderers.push(headerRenderer);
		return headerRenderer;
	}
	,destroyHeaderRenderer: function(headerRenderer,recycler) {
		this._headerContainer.removeChild(headerRenderer);
		if(recycler != null && recycler.destroy != null) {
			recycler.destroy(headerRenderer);
		}
	}
	,populateCurrentHeaderState: function(column,columnIndex,state,force) {
		var changed = false;
		if(force || state.owner != this) {
			state.owner = this;
			changed = true;
		}
		if(force || state.column != column) {
			state.column = column;
			changed = true;
		}
		if(force || state.columnIndex != columnIndex) {
			state.columnIndex = columnIndex;
			changed = true;
		}
		var headerText = column.headerText;
		if(force || state.text != headerText) {
			state.text = headerText;
			changed = true;
		}
		var enabled = this._enabled;
		if(force || state.enabled != enabled) {
			state.enabled = enabled;
			changed = true;
		}
		var sortOrder = column == this._sortedColumn ? this._sortOrder : feathers_data_SortOrder.NONE;
		if(force || state.sortOrder != sortOrder) {
			state.sortOrder = sortOrder;
			changed = true;
		}
		return changed;
	}
	,updateHeaderRenderer: function(headerRenderer,state) {
		if(this._defaultHeaderStorage.headerRendererRecycler.update != null) {
			this._defaultHeaderStorage.headerRendererRecycler.update(headerRenderer,state);
		}
		this.refreshHeaderRendererProperties(headerRenderer,state);
	}
	,resetHeaderRenderer: function(headerRenderer,state) {
		var recycler = this._defaultHeaderStorage.oldHeaderRendererRecycler != null ? this._defaultHeaderStorage.oldHeaderRendererRecycler : this._defaultHeaderStorage.headerRendererRecycler;
		if(recycler != null && recycler.reset != null) {
			recycler.reset(headerRenderer,state);
		}
		this.refreshHeaderRendererProperties(headerRenderer,feathers_controls_GridView.RESET_HEADER_STATE);
	}
	,refreshHeaderRendererProperties: function(headerRenderer,state) {
		if(js_Boot.__implements(headerRenderer,feathers_core_IUIControl)) {
			var uiControl = headerRenderer;
			uiControl.set_enabled(state.enabled);
		}
		if(js_Boot.__implements(headerRenderer,feathers_controls_dataRenderers_IGridViewHeaderRenderer)) {
			var header = headerRenderer;
			header.set_column(state.column);
			header.set_columnIndex(state.columnIndex);
			header.set_gridViewOwner(state.owner);
		}
		if(js_Boot.__implements(headerRenderer,feathers_data_ISortOrderObserver)) {
			var sortObject = headerRenderer;
			sortObject.set_sortOrder(state.sortOrder);
		}
		if(js_Boot.__implements(headerRenderer,feathers_layout_ILayoutIndexObject)) {
			var layoutObject = headerRenderer;
			layoutObject.set_layoutIndex(state.columnIndex);
		}
	}
	,refreshSelectedIndicesAfterFilterOrSort: function() {
		if(this._selectedIndex == -1) {
			return;
		}
		this.set_selectedIndex(this._dataProvider.indexOf(this._selectedItem));
	}
	,navigateWithKeyboard: function(event) {
		if(event.isDefaultPrevented()) {
			return;
		}
		if(this._dataProvider == null || this._dataProvider.get_length() == 0) {
			return;
		}
		var result = this._selectedIndex;
		if(js_Boot.__implements(this.get_layout(),feathers_layout_IKeyboardNavigationLayout)) {
			if(event.keyCode != 38 && event.keyCode != 40 && event.keyCode != 37 && event.keyCode != 39 && event.keyCode != 33 && event.keyCode != 34 && event.keyCode != 36 && event.keyCode != 35) {
				return;
			}
			result = this.get_layout().findNextKeyboardIndex(result,event,false,this._rowLayoutItems,null,this.gridViewPort.get_visibleWidth(),this.gridViewPort.get_visibleHeight());
		} else {
			switch(event.keyCode) {
			case 33:
				--result;
				break;
			case 34:
				++result;
				break;
			case 35:
				result = this._dataProvider.get_length() - 1;
				break;
			case 36:
				result = 0;
				break;
			case 37:
				--result;
				break;
			case 38:
				--result;
				break;
			case 39:
				++result;
				break;
			case 40:
				++result;
				break;
			default:
				return;
			}
		}
		if(result < 0) {
			result = 0;
		} else if(result >= this._dataProvider.get_length()) {
			result = this._dataProvider.get_length() - 1;
		}
		var changed = this._selectedIndex != result;
		if(!changed && result != -1) {
			var _this = this.dataToRowRenderer;
			var key = this._dataProvider.get(result);
			var rowRenderer = _this.h[key.__id__];
			if(rowRenderer == null) {
				changed = true;
			} else if(js_Boot.__implements(this.get_layout(),feathers_layout_IScrollLayout)) {
				var scrollLayout = this.get_layout();
				var nearestScrollPosition = scrollLayout.getNearestScrollPositionForIndex(result,this._dataProvider.get_length(),this.get_viewPort().get_visibleWidth(),this.get_viewPort().get_visibleHeight());
				if(this.get_scrollX() != nearestScrollPosition.x || this.get_scrollY() != nearestScrollPosition.y) {
					changed = true;
				}
			}
		}
		if(!changed) {
			return;
		}
		event.preventDefault();
		this.set_selectedIndex(result);
		if(this._selectedIndex != -1) {
			this.scrollToRowIndex(this._selectedIndex);
		}
		if(this._focusManager != null) {
			this._focusManager.set_focus(this);
		} else if(this.stage != null) {
			this.stage.set_focus(this);
		}
	}
	,handleSelectionChange: function(item,index,ctrlKey,shiftKey) {
		if(index == -1 || !this._selectable) {
			this.set_selectedItem(null);
			return;
		}
		var selectionIndex = this._selectedItems.indexOf(item);
		if(this._allowMultipleSelection && (ctrlKey || shiftKey)) {
			if(shiftKey) {
				var anchorIndex = this._selectionAnchorIndex;
				if(anchorIndex == -1) {
					anchorIndex = 0;
				}
				var selectedIndices = [];
				if(index == anchorIndex) {
					selectedIndices.unshift(anchorIndex);
				} else {
					var i = anchorIndex;
					do {
						selectedIndices.unshift(i);
						i += anchorIndex > index ? -1 : 1;
					} while(i != index);
					if(index != anchorIndex) {
						selectedIndices.unshift(index);
					}
				}
				this.set_selectedIndices(selectedIndices);
				this._selectionAnchorIndex = anchorIndex;
			} else {
				if(selectionIndex == -1) {
					var selectedItems = this._selectedItems.slice();
					selectedItems.unshift(item);
					this.set_selectedItems(selectedItems);
				} else {
					var selectedItems = this._selectedItems.slice();
					selectedItems.splice(selectionIndex,1);
					this.set_selectedItems(selectedItems);
				}
				this._selectionAnchorIndex = index;
			}
		} else {
			this.set_selectedItem(item);
		}
		if(index != -1) {
			this.scrollToRowIndex(index);
		}
	}
	,handlePendingScroll: function() {
		if(this._pendingScrollRowIndex == -1) {
			return;
		}
		var rowIndex = this._pendingScrollRowIndex;
		var duration = this._pendingScrollDuration != null ? this._pendingScrollDuration : 0.0;
		this._pendingScrollRowIndex = -1;
		this._pendingScrollDuration = null;
		if(this._dataProvider == null || this._dataProvider.get_length() == 0) {
			return;
		}
		var targetX = this.get_scrollX();
		var targetY = this.get_scrollY();
		if(js_Boot.__implements(this.get_layout(),feathers_layout_IScrollLayout)) {
			var scrollLayout = this.get_layout();
			var result = scrollLayout.getNearestScrollPositionForIndex(rowIndex,this._dataProvider.get_length(),this.get_viewPort().get_visibleWidth(),this.get_viewPort().get_visibleHeight());
			targetX = result.x;
			targetY = result.y;
		} else {
			var row = this._dataProvider.get(rowIndex);
			var rowRenderer = this.dataToRowRenderer.h[row.__id__];
			if(rowRenderer == null) {
				return;
			}
			var maxX = rowRenderer.get_x();
			var minX = maxX + rowRenderer.get_width() - this.get_viewPort().get_visibleWidth();
			if(targetX < minX) {
				targetX = minX;
			} else if(targetX > maxX) {
				targetX = maxX;
			}
			var maxY = rowRenderer.get_y();
			var minY = maxY + rowRenderer.get_height() - this.get_viewPort().get_visibleHeight();
			if(targetY < minY) {
				targetY = minY;
			} else if(targetY > maxY) {
				targetY = maxY;
			}
		}
		if(duration == 0.0) {
			this.scroller.stop();
			this.scroller.set_scrollX(targetX);
			this.scroller.set_scrollY(targetY);
		} else {
			this.scroller.throwTo(targetX,targetY,duration);
		}
	}
	,refreshDragDropIndexIndicator: function() {
		if(this.get_dragDropIndicatorSkin() == null || !js_Boot.__implements(this.get_layout(),feathers_layout_IDragDropLayout)) {
			return;
		}
		if(js_Boot.__implements(this.get_dragDropIndicatorSkin(),feathers_core_IUIControl)) {
			this.get_dragDropIndicatorSkin().initializeNow();
		}
		if(this._dragDropIndicatorSkinMeasurements == null) {
			this._dragDropIndicatorSkinMeasurements = new feathers_layout_Measurements(this.get_dragDropIndicatorSkin());
		} else {
			this._dragDropIndicatorSkinMeasurements.save(this.get_dragDropIndicatorSkin());
		}
		var dropX = this.get_scrollX() + this._dragDropLocalX - this.leftViewPortOffset;
		var dropY = this.get_scrollY() + this._dragDropLocalY - this.topViewPortOffset;
		var dropDropLayout = this.get_layout();
		var dragDropIndex = dropDropLayout.getDragDropIndex(this._rowLayoutItems,dropX,dropY,this._viewPort.get_visibleWidth(),this._viewPort.get_visibleHeight());
		var dragDropRegion = dropDropLayout.getDragDropRegion(this._rowLayoutItems,dragDropIndex,dropX,dropY,this._viewPort.get_visibleWidth(),this._viewPort.get_visibleHeight());
		this.get_dragDropIndicatorSkin().set_x(dragDropRegion.x - this.get_scrollX() + this.leftViewPortOffset);
		this.get_dragDropIndicatorSkin().set_y(dragDropRegion.y - this.get_scrollY() + this.topViewPortOffset);
		if(dragDropRegion.width == 0.0) {
			this.get_dragDropIndicatorSkin().set_height(dragDropRegion.height);
		} else {
			this.get_dragDropIndicatorSkin().set_width(dragDropRegion.width);
		}
		this.addChild(this.get_dragDropIndicatorSkin());
	}
	,baseScrollContainer_keyDownHandler: function(event) {
		if(!this._selectable) {
			feathers_controls_supportClasses_BaseScrollContainer.prototype.baseScrollContainer_keyDownHandler.call(this,event);
			return;
		}
		if(!this._enabled || event.isDefaultPrevented()) {
			return;
		}
		if(this.stage != null && ((this.stage.get_focus()) instanceof openfl_text_TextField)) {
			var textField = this.stage.get_focus();
			if(textField.get_type() == 1) {
				return;
			}
		}
		this.navigateWithKeyboard(event);
	}
	,gridView_rowRenderer_triggerHandler: function(event) {
		var rowRenderer = js_Boot.__cast(event.currentTarget , feathers_controls_dataRenderers_GridViewRowRenderer);
		var state = this.rowRendererToRowState.h[rowRenderer.__id__];
		this.handleSelectionChange(state.data,state.rowIndex,event.ctrlKey,event.shiftKey);
	}
	,gridView_rowRenderer_cellTriggerHandler: function(event) {
		this.dispatchEvent(event.clone());
	}
	,gridView_rowRenderer_mouseDownHandler: function(event) {
		if(!this._enabled || !this._dragEnabled || this.stage == null) {
			return;
		}
		var rowRenderer = js_Boot.__cast(event.currentTarget , feathers_controls_dataRenderers_GridViewRowRenderer);
		var state = this.rowRendererToRowState.h[rowRenderer.__id__];
		if(state == null) {
			return;
		}
		this._dragRowRenderer = rowRenderer;
		this._dragItem = state.data;
		this._dragRowIndex = state.rowIndex;
		this._dragDropLocalX = this.get_mouseX();
		this._dragDropLocalY = this.get_mouseY();
		this._dragMinDistance = 6.0;
		this.stage.addEventListener("mouseMove",$bind(this,this.gridView_stage_pressAndMove_mouseMoveHandler),false,0,true);
		this.stage.addEventListener("mouseUp",$bind(this,this.gridView_stage_pressAndMove_mouseUpHandler),false,0,true);
	}
	,gridView_stage_pressAndMove_mouseMoveHandler: function(event) {
		var offsetX = this.get_mouseX() - this._dragDropLocalX;
		var offsetY = this.get_mouseY() - this._dragDropLocalY;
		if(offsetX > this._dragMinDistance || offsetY > this._dragMinDistance) {
			var stage = js_Boot.__cast(event.currentTarget , openfl_display_Stage);
			stage.removeEventListener("mouseMove",$bind(this,this.gridView_stage_pressAndMove_mouseMoveHandler));
			stage.removeEventListener("mouseUp",$bind(this,this.gridView_stage_pressAndMove_mouseUpHandler));
			var items = [];
			var draggedIndices = this._allowMultipleSelection ? this._selectedIndices.slice() : [];
			if(draggedIndices.indexOf(this._dragRowIndex) == -1) {
				draggedIndices.push(this._dragRowIndex);
			}
			draggedIndices.sort(function(a,b) {
				if(a < b) {
					return -1;
				}
				if(a > b) {
					return 1;
				}
				return 0;
			});
			var _g = 0;
			while(_g < draggedIndices.length) {
				var dragIndex = draggedIndices[_g];
				++_g;
				items.push(this._dataProvider.get(dragIndex));
			}
			var dragData = new feathers_dragDrop_DragData();
			dragData.set(this._dragFormat,items);
			var rowState = this.rowRendererToRowState.h[this._dragRowRenderer.__id__];
			var rowRenderer = this._rowRendererFactory.create();
			this.updateRowRenderer(rowRenderer,rowState);
			rowRenderer.set_width(this._dragRowRenderer.get_width());
			rowRenderer.set_height(this._dragRowRenderer.get_height());
			feathers_dragDrop_DragDropManager.startDrag(this,dragData,rowRenderer,-this._dragRowRenderer.get_mouseX(),-this._dragRowRenderer.get_mouseY());
		}
	}
	,gridView_stage_pressAndMove_mouseUpHandler: function(event) {
		var stage = js_Boot.__cast(event.currentTarget , openfl_display_Stage);
		stage.removeEventListener("mouseMove",$bind(this,this.gridView_stage_pressAndMove_mouseMoveHandler));
		stage.removeEventListener("mouseUp",$bind(this,this.gridView_stage_pressAndMove_mouseUpHandler));
		this._dragItem = null;
		this._dragRowIndex = -1;
		this._dragRowRenderer = null;
	}
	,gridView_dataProvider_changeHandler: function(event) {
		if(this._ignoreDataProviderChanges) {
			return;
		}
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
	}
	,gridView_dataProvider_addItemHandler: function(event) {
		if(this._virtualCache != null) {
			this._virtualCache.splice(event.index,0,null);
		}
		if(this._selectedIndex == -1) {
			return;
		}
		var changed = false;
		var _g = 0;
		var _g1 = this._selectedIndices.length;
		while(_g < _g1) {
			var i = _g++;
			var selectedIndex = this._selectedIndices[i];
			if(selectedIndex >= event.index) {
				this._selectedIndices[i] = selectedIndex + 1;
				changed = true;
			}
		}
		if(changed) {
			this._selectedIndex = this._selectedIndices[0];
			feathers_events_FeathersEvent.dispatch(this,"change");
		}
	}
	,gridView_dataProvider_removeItemHandler: function(event) {
		if(this._virtualCache != null) {
			HxOverrides.remove(this._virtualCache,event.index);
		}
		if(this._selectedIndex == -1) {
			return;
		}
		var changed = false;
		var i = this._selectedIndices.length - 1;
		while(i >= 0) {
			var selectedIndex = this._selectedIndices[i];
			if(selectedIndex == event.index) {
				this._selectedIndices.splice(i,1);
				this._selectedItems.splice(i,1);
				changed = true;
			} else if(selectedIndex > event.index) {
				this._selectedIndices[i] = selectedIndex - 1;
				changed = true;
			}
			--i;
		}
		if(changed) {
			if(this._selectedIndices.length > 0) {
				this._selectedIndex = this._selectedIndices[0];
				this._selectedItem = this._dataProvider.get(this._selectedIndex);
			} else {
				this._selectedIndex = -1;
				this._selectedItem = null;
			}
			feathers_events_FeathersEvent.dispatch(this,"change");
		}
	}
	,gridView_dataProvider_replaceItemHandler: function(event) {
		if(this._virtualCache != null) {
			this._virtualCache[event.index] = null;
		}
		if(this._selectedIndex == -1) {
			return;
		}
		var _g = 0;
		var _g1 = this._selectedIndices.length;
		while(_g < _g1) {
			var i = _g++;
			var selectedIndex = this._selectedIndices[i];
			if(selectedIndex == event.index) {
				this._selectedItems[i] = this._dataProvider.get(selectedIndex);
				this._selectedItem = this._selectedItems[0];
				feathers_events_FeathersEvent.dispatch(this,"change");
				break;
			}
		}
	}
	,gridView_dataProvider_removeAllHandler: function(event) {
		if(this._virtualCache != null) {
			this._virtualCache.length = 0;
		}
		this.set_selectedIndex(-1);
	}
	,gridView_dataProvider_resetHandler: function(event) {
		if(this._virtualCache != null) {
			this._virtualCache.length = 0;
			this._virtualCache.length = this._dataProvider.get_length();
		}
		this.set_selectedIndex(-1);
	}
	,gridView_dataProvider_sortChangeHandler: function(event) {
		if(this._virtualCache != null) {
			this._virtualCache.length = 0;
			this._virtualCache.length = this._dataProvider.get_length();
		}
		this.refreshSelectedIndicesAfterFilterOrSort();
	}
	,gridView_dataProvider_filterChangeHandler: function(event) {
		if(this._virtualCache != null) {
			this._virtualCache.length = 0;
			this._virtualCache.length = this._dataProvider.get_length();
		}
		this.refreshSelectedIndicesAfterFilterOrSort();
	}
	,updateRowRendererForIndex: function(index) {
		if(this._virtualCache != null) {
			this._virtualCache[index] = null;
		}
		var item = this._dataProvider.get(index);
		var rowRenderer = this.dataToRowRenderer.h[item.__id__];
		if(rowRenderer == null) {
			this.setInvalid(feathers_core_InvalidationFlag.DATA);
			return;
		}
		var state = this.rowRendererToRowState.h[rowRenderer.__id__];
		if(state.owner == null) {
			return;
		}
		rowRenderer.updateCells();
		this.populateCurrentRowState(item,index,state,true);
		this.resetRowRenderer(rowRenderer,state);
		if(this._rowRendererMeasurements != null) {
			this._rowRendererMeasurements.restore(rowRenderer);
		}
		state.owner = null;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
	}
	,validateCustomColumnWidths: function() {
		if(this._customColumnWidths == null || this._customColumnWidths.length < this._columns.get_length()) {
			return;
		}
		if(this._customColumnWidths.length > this._columns.get_length()) {
			this._customColumnWidths.length = this._columns.get_length();
		}
		var minContainerWidth = this.actualWidth - this.get_paddingLeft() - this.get_paddingRight();
		var totalContainerWidth = Math.max(this._viewPort.get_width() + this._headerContainerLayout.get_paddingLeft() + this._headerContainerLayout.get_paddingRight(),minContainerWidth);
		var availableWidth = totalContainerWidth - this._headerContainerLayout.get_paddingLeft() - this._headerContainerLayout.get_paddingRight();
		var totalWidth = 0.0;
		var indices = [];
		var _g = 0;
		var _g1 = this._customColumnWidths.length;
		while(_g < _g1) {
			var i = _g++;
			var column = this._columns.get(i);
			if(column.width != null) {
				availableWidth -= column.width;
				continue;
			}
			var size = this._customColumnWidths[i];
			totalWidth += size;
			indices.push(i);
		}
		if(totalWidth == availableWidth) {
			return;
		}
		this._customColumnWidths = this._customColumnWidths.slice();
		var widthToDistribute = availableWidth - totalWidth;
		this.distributeWidthToIndices(widthToDistribute,indices,totalWidth);
		this.setInvalid(feathers_core_InvalidationFlag.LAYOUT);
	}
	,calculateResizedColumnWidth: function(offset) {
		var columnCount = this._columns.get_length();
		if(this._customColumnWidths == null) {
			this._customColumnWidths = [];
			this._customColumnWidths.length = columnCount;
		} else {
			this._customColumnWidths = this._customColumnWidths.slice();
			this._customColumnWidths.length = columnCount;
		}
		var column = this._columns.get(this._resizingHeaderIndex);
		column.width = null;
		var headerRenderer = this.dataToHeaderRenderer.h[column.__id__];
		var column = this._columns.get(this._resizingHeaderIndex);
		var minX = this._headerContainer.get_x() + headerRenderer.get_x() + column.minWidth;
		var maxX = this.actualWidth - this.rightViewPortOffset;
		var originalX = this._headerContainer.get_x() + headerRenderer.get_x() + headerRenderer.get_width();
		var newX = Math.min(Math.max(originalX + offset,minX),maxX);
		var preferredWidth = newX - headerRenderer.get_x() - this._headerContainer.get_x();
		var totalMinWidth = 0.0;
		var originalWidth = headerRenderer.get_width();
		var totalWidthAfter = 0.0;
		var indicesAfter = [];
		var _g = 0;
		var _g1 = columnCount;
		while(_g < _g1) {
			var i = _g++;
			var currentColumn = this._columns.get(i);
			if(i == this._resizingHeaderIndex) {
				continue;
			} else if(i < this._resizingHeaderIndex) {
				headerRenderer = this.dataToHeaderRenderer.h[currentColumn.__id__];
				this._customColumnWidths[i] = headerRenderer.get_width();
				totalMinWidth += headerRenderer.get_width();
			} else {
				if(currentColumn.width != null) {
					totalMinWidth += currentColumn.width;
					continue;
				}
				totalMinWidth += currentColumn.minWidth;
				headerRenderer = this.dataToHeaderRenderer.h[currentColumn.__id__];
				var columnWidth = headerRenderer.get_width();
				totalWidthAfter += columnWidth;
				this._customColumnWidths[i] = columnWidth;
				indicesAfter[indicesAfter.length] = i;
			}
		}
		if(indicesAfter.length == 0) {
			var index = this._resizingHeaderIndex + 1;
			indicesAfter[0] = index;
			column = this._columns.get(index);
			totalWidthAfter = column.width;
			totalMinWidth -= totalWidthAfter;
			totalMinWidth += column.minWidth;
			this._customColumnWidths[index] = totalWidthAfter;
			column.width = null;
		}
		var newWidth = preferredWidth;
		var maxWidth = this._headerContainer.get_width() - totalMinWidth;
		if(newWidth > maxWidth) {
			newWidth = maxWidth;
		}
		if(newWidth < column.minWidth) {
			newWidth = column.minWidth;
		}
		this._customColumnWidths[this._resizingHeaderIndex] = newWidth;
		var widthToDistribute = originalWidth - newWidth;
		this.distributeWidthToIndices(widthToDistribute,indicesAfter,totalWidthAfter);
		this.setInvalid(feathers_core_InvalidationFlag.LAYOUT);
	}
	,distributeWidthToIndices: function(widthToDistribute,indices,totalWidthOfIndices) {
		while(Math.abs(widthToDistribute) > 1.0) {
			var nextWidthToDistribute = widthToDistribute;
			var i = indices.length - 1;
			while(i >= 0) {
				var index = indices[i];
				var column = this._columns.get(index);
				var headerRenderer = this.dataToHeaderRenderer.h[column.__id__];
				var columnWidth = headerRenderer.get_width();
				var percent = columnWidth / totalWidthOfIndices;
				var offset = widthToDistribute * percent;
				var newWidth = this._customColumnWidths[index] + offset;
				if(newWidth < column.minWidth) {
					offset += column.minWidth - newWidth;
					newWidth = column.minWidth;
					indices.splice(i,1);
					totalWidthOfIndices -= columnWidth;
				}
				this._customColumnWidths[index] = newWidth;
				nextWidthToDistribute -= offset;
				--i;
			}
			widthToDistribute = nextWidthToDistribute;
		}
		if(widthToDistribute != 0.0) {
			this._customColumnWidths[this._customColumnWidths.length - 1] += widthToDistribute;
		}
	}
	,layoutColumnResizeSkin: function(offset) {
		if(this._currentColumnResizeSkin == null) {
			return;
		}
		var column = this._columns.get(this._resizingHeaderIndex);
		var headerRenderer = this.dataToHeaderRenderer.h[column.__id__];
		var minX = this._headerContainer.get_x() + headerRenderer.get_x() + column.minWidth;
		var maxX = this.actualWidth - this.rightViewPortOffset;
		var originalX = this._headerContainer.get_x() + headerRenderer.get_x() + headerRenderer.get_width();
		var newX = Math.min(Math.max(originalX + offset,minX),maxX) - this._currentColumnResizeSkin.get_width() / 2.0;
		this._currentColumnResizeSkin.set_visible(true);
		this._currentColumnResizeSkin.set_x(newX);
		this._currentColumnResizeSkin.set_y(this.get_paddingTop());
		this._currentColumnResizeSkin.set_height(this.actualHeight - this.get_paddingTop() - this.bottomViewPortOffset);
		this.setChildIndex(this._currentColumnResizeSkin,this.get_numChildren() - 1);
	}
	,headerResizeTouchBegin: function(touchPointID,isMouse,divider,stageX) {
		if(!this._enabled || !this._resizableColumns || this._resizingHeaderIndex != -1 || this.stage == null) {
			return;
		}
		var exclusivePointer = feathers_utils_ExclusivePointer.forStage(this.stage);
		var result = false;
		if(isMouse) {
			result = exclusivePointer.claimMouse(divider);
		} else {
			result = exclusivePointer.claimTouch(touchPointID,divider);
		}
		if(!result) {
			return;
		}
		this._resizingHeaderTouchPointID = touchPointID;
		this._resizingHeaderTouchPointIsMouse = isMouse;
		this._resizingHeaderIndex = this._headerDividerLayoutItems.indexOf(divider);
		this._resizingHeaderStartStageX = stageX;
		this.layoutColumnResizeSkin(0.0);
		if(isMouse) {
			this.stage.addEventListener("mouseMove",$bind(this,this.gridView_headerDivider_stage_mouseMoveHandler),false,0,true);
			this.stage.addEventListener("mouseUp",$bind(this,this.gridView_headerDivider_stage_mouseUpHandler),false,0,true);
		} else {
			this.stage.addEventListener("touchMove",$bind(this,this.gridView_headerDivider_stage_touchMoveHandler),false,0,true);
			this.stage.addEventListener("touchEnd",$bind(this,this.gridView_headerDivider_stage_touchEndHandler),false,0,true);
		}
	}
	,headerResizeTouchMove: function(touchPointID,isMouse,stageX) {
		if(this._resizingHeaderTouchPointID == null || this._resizingHeaderTouchPointID != touchPointID || this._resizingHeaderTouchPointIsMouse != isMouse) {
			return;
		}
		var offset = stageX - this._resizingHeaderStartStageX;
		offset *= feathers_utils_DisplayUtil.getConcatenatedScaleX(this);
		this.layoutColumnResizeSkin(offset);
	}
	,headerResizeTouchEnd: function(touchPointID,isMouse,stageX) {
		if(this._resizingHeaderTouchPointID == null || this._resizingHeaderTouchPointID != touchPointID || this._resizingHeaderTouchPointIsMouse != isMouse) {
			return;
		}
		if(isMouse) {
			this.stage.removeEventListener("mouseMove",$bind(this,this.gridView_headerDivider_stage_mouseMoveHandler));
			this.stage.removeEventListener("mouseUp",$bind(this,this.gridView_headerDivider_stage_mouseUpHandler));
		} else {
			this.stage.removeEventListener("touchMove",$bind(this,this.gridView_headerDivider_stage_touchMoveHandler));
			this.stage.removeEventListener("touchEnd",$bind(this,this.gridView_headerDivider_stage_touchEndHandler));
		}
		if(this._currentColumnResizeSkin != null) {
			this._currentColumnResizeSkin.set_visible(false);
		}
		var offset = stageX - this._resizingHeaderStartStageX;
		offset *= feathers_utils_DisplayUtil.getConcatenatedScaleX(this);
		this.calculateResizedColumnWidth(offset);
		this._resizingHeaderTouchPointID = null;
		this._resizingHeaderTouchPointIsMouse = false;
		this._resizingHeaderIndex = -1;
		if(this._oldHeaderDividerMouseCursor != null) {
			openfl_ui_Mouse.set_cursor(this._oldHeaderDividerMouseCursor);
			this._oldHeaderDividerMouseCursor = null;
		}
	}
	,reverseSortCompareFunction: function(a,b) {
		return -this.sortCompareFunction(a,b);
	}
	,sortCompareFunction: function(a,b) {
		if(this._sortedColumn.sortCompareFunction == null) {
			var aText = this._sortedColumn.itemToText(a);
			var bText = this._sortedColumn.itemToText(b);
			return feathers_controls_GridView.defaultSortCompareFunction(aText,bText);
		}
		return this._sortedColumn.sortCompareFunction(a,b);
	}
	,refreshSortedColumn: function(sortInvalid) {
		if(this._dataProvider == null) {
			return;
		}
		var oldIgnoreDataProviderChanges = this._ignoreDataProviderChanges;
		this._ignoreDataProviderChanges = true;
		if(this._sortOrder == feathers_data_SortOrder.ASCENDING) {
			this._dataProvider.set_sortCompareFunction($bind(this,this.sortCompareFunction));
		} else if(this._sortOrder == feathers_data_SortOrder.DESCENDING) {
			this._dataProvider.set_sortCompareFunction($bind(this,this.reverseSortCompareFunction));
		} else if(this._dataProvider.get_sortCompareFunction() == $bind(this,this.sortCompareFunction) || this._dataProvider.get_sortCompareFunction() == $bind(this,this.sortCompareFunction) || this._dataProvider.get_sortCompareFunction() == $bind(this,this.reverseSortCompareFunction) || this._dataProvider.get_sortCompareFunction() == $bind(this,this.reverseSortCompareFunction)) {
			this._dataProvider.set_sortCompareFunction(null);
		}
		if(sortInvalid) {
			this._dataProvider.refresh();
		}
		this._ignoreDataProviderChanges = oldIgnoreDataProviderChanges;
	}
	,updateSortedColumn: function(column) {
		if(!this._sortableColumns || column.defaultSortOrder == feathers_data_SortOrder.NONE) {
			return;
		}
		if(this._sortedColumn != column) {
			this.set_sortedColumn(column);
		} else {
			this.set_sortOrder(this._sortOrder == feathers_data_SortOrder.ASCENDING ? feathers_data_SortOrder.DESCENDING : feathers_data_SortOrder.ASCENDING);
		}
	}
	,gridView_dataProvider_updateItemHandler: function(event) {
		this.updateRowRendererForIndex(event.index);
	}
	,gridView_dataProvider_updateAllHandler: function(event) {
		var _g = 0;
		var _g1 = this._dataProvider.get_length();
		while(_g < _g1) {
			var i = _g++;
			this.updateRowRendererForIndex(i);
		}
	}
	,gridView_columns_addItemHandler: function(event) {
		if(this._customColumnWidths == null) {
			return;
		}
		var column = js_Boot.__cast(event.addedItem , feathers_controls_GridViewColumn);
		var columnIndex = event.index;
		if(column.width != null || columnIndex > this._customColumnWidths.length) {
			return;
		}
		this._customColumnWidths.splice(columnIndex,0,0.0);
		var minContainerWidth = this.actualWidth - this.get_paddingLeft() - this.get_paddingRight();
		var totalContainerWidth = Math.max(this._viewPort.get_width() + this._headerContainerLayout.get_paddingLeft() + this._headerContainerLayout.get_paddingRight(),minContainerWidth);
		var availableWidth = totalContainerWidth - this._headerContainerLayout.get_paddingLeft() - this._headerContainerLayout.get_paddingRight();
		var totalWidth = 0.0;
		var indices = [];
		var _g = 0;
		var _g1 = this._customColumnWidths.length;
		while(_g < _g1) {
			var i = _g++;
			if(i == columnIndex) {
				continue;
			}
			var column = this._columns.get(i);
			if(column.width != null) {
				availableWidth -= column.width;
				continue;
			}
			var size = this._customColumnWidths[i];
			totalWidth += size;
			indices.push(i);
		}
		var idealColumnWidth = totalWidth / (indices.length + 1);
		this._customColumnWidths[columnIndex] = idealColumnWidth;
		this._customColumnWidths = this._customColumnWidths.slice();
		var widthToDistribute = -idealColumnWidth;
		this.distributeWidthToIndices(widthToDistribute,indices,totalWidth);
		this.setInvalid(feathers_core_InvalidationFlag.LAYOUT);
	}
	,gridView_columns_removeItemHandler: function(event) {
		if(this._customColumnWidths == null) {
			return;
		}
		var column = js_Boot.__cast(event.removedItem , feathers_controls_GridViewColumn);
		var columnIndex = event.index;
		if(column.width != null || columnIndex > this._customColumnWidths.length) {
			return;
		}
		this._customColumnWidths.splice(columnIndex,1);
		this.setInvalid(feathers_core_InvalidationFlag.LAYOUT);
	}
	,gridView_columns_changeHandler: function(event) {
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
	}
	,gridView_headerRenderer_touchTapHandler: function(event) {
		if(!this._enabled) {
			return;
		}
		if(event.isPrimaryTouchPoint) {
			return;
		}
		var headerRenderer = js_Boot.__cast(event.currentTarget , openfl_display_DisplayObject);
		var state = this.headerRendererToHeaderState.h[headerRenderer.__id__];
		this.updateSortedColumn(state.column);
		feathers_events_GridViewEvent.dispatchForHeader(this,"headerTrigger",state);
	}
	,gridView_headerRenderer_clickHandler: function(event) {
		if(!this._enabled) {
			return;
		}
		var headerRenderer = js_Boot.__cast(event.currentTarget , openfl_display_DisplayObject);
		var state = this.headerRendererToHeaderState.h[headerRenderer.__id__];
		this.updateSortedColumn(state.column);
		feathers_events_GridViewEvent.dispatchForHeader(this,"headerTrigger",state);
	}
	,gridView_headerRenderer_triggerHandler: function(event) {
		if(!this._enabled) {
			return;
		}
		var headerRenderer = js_Boot.__cast(event.currentTarget , openfl_display_DisplayObject);
		var state = this.headerRendererToHeaderState.h[headerRenderer.__id__];
		this.updateSortedColumn(state.column);
		feathers_events_GridViewEvent.dispatchForHeader(this,"headerTrigger",state);
	}
	,gridView_headerRenderer_resizeHandler: function(event) {
		if(this._validating) {
			return;
		}
		this.setInvalid(feathers_core_InvalidationFlag.LAYOUT);
	}
	,gridView_headerDivider_mouseDownHandler: function(event) {
		var headerDivider = js_Boot.__cast(event.currentTarget , openfl_display_InteractiveObject);
		this.headerResizeTouchBegin(feathers_controls_GridView.POINTER_ID_MOUSE,true,headerDivider,headerDivider.stage.get_mouseX());
	}
	,gridView_headerDivider_stage_mouseMoveHandler: function(event) {
		var stage = js_Boot.__cast(event.currentTarget , openfl_display_Stage);
		this.headerResizeTouchMove(feathers_controls_GridView.POINTER_ID_MOUSE,true,stage.get_mouseX());
	}
	,gridView_headerDivider_stage_mouseUpHandler: function(event) {
		var stage = js_Boot.__cast(event.currentTarget , openfl_display_Stage);
		this.headerResizeTouchEnd(feathers_controls_GridView.POINTER_ID_MOUSE,true,stage.get_mouseX());
	}
	,gridView_headerDivider_touchBeginHandler: function(event) {
		if(event.isPrimaryTouchPoint) {
			return;
		}
		var headerDivider = js_Boot.__cast(event.currentTarget , openfl_display_InteractiveObject);
		this.headerResizeTouchBegin(event.touchPointID,false,headerDivider,headerDivider.stage.get_mouseX());
	}
	,gridView_headerDivider_stage_touchMoveHandler: function(event) {
		var stage = js_Boot.__cast(event.currentTarget , openfl_display_Stage);
		this.headerResizeTouchMove(event.touchPointID,false,stage.get_mouseX());
	}
	,gridView_headerDivider_stage_touchEndHandler: function(event) {
		var stage = js_Boot.__cast(event.currentTarget , openfl_display_Stage);
		this.headerResizeTouchEnd(event.touchPointID,false,stage.get_mouseX());
	}
	,gridView_headerDivider_rollOverHandler: function(event) {
		if(!this._resizableColumns || this._resizingHeaderIndex != -1 || openfl_ui_Mouse.get_cursor() != "auto") {
			return;
		}
		this._oldHeaderDividerMouseCursor = openfl_ui_Mouse.get_cursor();
		openfl_ui_Mouse.set_cursor(openfl_ui_MouseCursor.fromLimeCursor(lime_ui_MouseCursor.RESIZE_WE));
	}
	,gridView_headerDivider_rollOutHandler: function(event) {
		if(!this._resizableColumns || this._resizingHeaderIndex != -1 || this._oldHeaderDividerMouseCursor == null) {
			return;
		}
		openfl_ui_Mouse.set_cursor(this._oldHeaderDividerMouseCursor);
		this._oldHeaderDividerMouseCursor = null;
	}
	,gridView_dragCompleteHandler: function(event) {
		if(!event.dropped) {
			return;
		}
		if(this._droppedOnSelf) {
			this._droppedOnSelf = false;
			return;
		}
		if(!this._removeOnDragDropComplete) {
			return;
		}
		var droppedItems = js_Boot.__cast(event.dragData.get(this._dragFormat) , Array);
		var _g = 0;
		while(_g < droppedItems.length) {
			var droppedItem = droppedItems[_g];
			++_g;
			this._dataProvider.remove(droppedItem);
		}
	}
	,gridView_dragEnterHandler: function(event) {
		if(!this._enabled || !this._dropEnabled || !event.dragData.exists(this._dragFormat)) {
			return;
		}
		event.acceptDrag(this);
		this.showFocus(true);
		this._dragDropLocalX = event.localX;
		this._dragDropLocalY = event.localY;
		this.refreshDragDropIndexIndicator();
		this._dragDropLastUpdateTime = openfl_Lib.getTimer();
		this.addEventListener("enterFrame",$bind(this,this.gridView_dragScroll_enterFrameHandler));
	}
	,gridView_dragExitHandler: function(event) {
		if(this.get_dragDropIndicatorSkin() != null) {
			this._dragDropIndicatorSkinMeasurements.restore(this.get_dragDropIndicatorSkin());
			if(this.get_dragDropIndicatorSkin().parent == this) {
				this.removeChild(this.get_dragDropIndicatorSkin());
			}
		}
		this.showFocus(false);
		this._dragDropLastUpdateTime = -1;
		this.removeEventListener("enterFrame",$bind(this,this.gridView_dragScroll_enterFrameHandler));
	}
	,gridView_dragScroll_enterFrameHandler: function(event) {
		var currentTime = openfl_Lib.getTimer();
		var passedTime = currentTime - this._dragDropLastUpdateTime;
		this._dragDropLastUpdateTime = currentTime;
		var dragX = this._dragDropLocalX - this.leftViewPortOffset;
		var dragY = this._dragDropLocalY - this.topViewPortOffset;
		var velocity = passedTime / 2.0;
		if(this.get_maxScrollY() > this.get_minScrollY()) {
			if(this.get_scrollY() < this.get_maxScrollY() && dragY > this._viewPort.get_visibleHeight() - this.edgeAutoScrollDistance) {
				velocity *= 1.0 - (this._viewPort.get_visibleHeight() - dragY) / this.edgeAutoScrollDistance;
			} else if(this.get_scrollY() > this.get_minScrollY() && dragY < this.edgeAutoScrollDistance) {
				velocity *= -(1.0 - dragY / this.edgeAutoScrollDistance);
			} else {
				velocity = 0.0;
			}
			if(velocity != 0.0) {
				var newScrollY = this.get_scrollY() + velocity;
				if(newScrollY > this.get_maxScrollY()) {
					newScrollY = this.get_maxScrollY();
				} else if(newScrollY < this.get_minScrollY()) {
					newScrollY = this.get_minScrollY();
				}
				this.set_scrollY(newScrollY);
			}
		}
		if(this.get_maxScrollX() > this.get_minScrollX()) {
			if(this.get_scrollX() < this.get_maxScrollX() && dragX > this._viewPort.get_visibleWidth() - this.edgeAutoScrollDistance) {
				velocity *= 1.0 - (this._viewPort.get_visibleWidth() - dragX) / this.edgeAutoScrollDistance;
			} else if(this.get_scrollX() > this.get_minScrollX() && dragX < this.edgeAutoScrollDistance) {
				velocity *= -(1.0 - dragX / this.edgeAutoScrollDistance);
			} else {
				velocity = 0.0;
			}
			if(velocity != 0.0) {
				var newScrollX = this.get_scrollX() + velocity;
				if(newScrollX > this.get_maxScrollX()) {
					newScrollX = this.get_maxScrollX();
				} else if(newScrollX < this.get_minScrollX()) {
					newScrollX = this.get_minScrollX();
				}
				this.set_scrollX(newScrollX);
			}
		}
		this.refreshDragDropIndexIndicator();
	}
	,gridView_dragMoveHandler: function(event) {
		if(!this._enabled || !this._dropEnabled || !event.dragData.exists(this._dragFormat)) {
			return;
		}
		this._dragDropLocalX = event.localX;
		this._dragDropLocalY = event.localY;
		this.refreshDragDropIndexIndicator();
	}
	,gridView_dragDropHandler: function(event) {
		if(this.get_dragDropIndicatorSkin() != null && this.get_dragDropIndicatorSkin().parent == this) {
			this._dragDropIndicatorSkinMeasurements.restore(this.get_dragDropIndicatorSkin());
			this.removeChild(this.get_dragDropIndicatorSkin());
		}
		this.showFocus(false);
		this._dragDropLastUpdateTime = -1;
		this.removeEventListener("enterFrame",$bind(this,this.gridView_dragScroll_enterFrameHandler));
		this._droppedOnSelf = false;
		if(!this._enabled || !this._dropEnabled || !event.dragData.exists(this._dragFormat)) {
			return;
		}
		var droppedItems = js_Boot.__cast(event.dragData.get(this._dragFormat) , Array);
		var dragDropIndex = this._dataProvider.get_length();
		if(js_Boot.__implements(this.get_layout(),feathers_layout_IDragDropLayout)) {
			var dragDropLayout = this.get_layout();
			var dropX = this.get_scrollX() + event.localX - this.leftViewPortOffset;
			var dropY = this.get_scrollY() + event.localY - this.topViewPortOffset;
			dragDropIndex = dragDropLayout.getDragDropIndex(this._rowLayoutItems,dropX,dropY,this._viewPort.get_visibleWidth(),this._viewPort.get_visibleHeight());
		}
		var dropOffset = 0;
		if(event.dragSource == this) {
			var _g = 0;
			while(_g < droppedItems.length) {
				var droppedItem = droppedItems[_g];
				++_g;
				var oldIndex = this._dataProvider.indexOf(droppedItem);
				if(oldIndex < dragDropIndex) {
					--dropOffset;
				}
				this._dataProvider.removeAt(oldIndex);
			}
			this._droppedOnSelf = true;
		}
		var _g = 0;
		var _g1 = droppedItems.length;
		while(_g < _g1) {
			var i = _g++;
			var droppedItem = droppedItems[i];
			this._dataProvider.addAt(droppedItem,dragDropIndex + dropOffset + i);
		}
	}
	,get_styleContext: function() {
		return feathers_controls_GridView;
	}
	,__customCellRendererVariant: null
	,get_customCellRendererVariant: function() {
		return this.__customCellRendererVariant;
	}
	,set_customCellRendererVariant: function(value) {
		if(!this.setStyle("customCellRendererVariant")) {
			return this.__customCellRendererVariant;
		}
		if(this.__customCellRendererVariant == value) {
			return this.__customCellRendererVariant;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_customCellRendererVariant);
		this.__customCellRendererVariant = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__customCellRendererVariant;
	}
	,clearStyle_customCellRendererVariant: function() {
		this.set_customCellRendererVariant(null);
		return this.get_customCellRendererVariant();
	}
	,__customHeaderRendererVariant: null
	,get_customHeaderRendererVariant: function() {
		return this.__customHeaderRendererVariant;
	}
	,set_customHeaderRendererVariant: function(value) {
		if(!this.setStyle("customHeaderRendererVariant")) {
			return this.__customHeaderRendererVariant;
		}
		if(this.__customHeaderRendererVariant == value) {
			return this.__customHeaderRendererVariant;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_customHeaderRendererVariant);
		this.__customHeaderRendererVariant = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__customHeaderRendererVariant;
	}
	,clearStyle_customHeaderRendererVariant: function() {
		this.set_customHeaderRendererVariant(null);
		return this.get_customHeaderRendererVariant();
	}
	,__headerDividerFactory: null
	,get_headerDividerFactory: function() {
		return this.__headerDividerFactory;
	}
	,set_headerDividerFactory: function(value) {
		if(!this.setStyle("headerDividerFactory")) {
			return this.__headerDividerFactory;
		}
		if(this.__headerDividerFactory == value) {
			return this.__headerDividerFactory;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_headerDividerFactory);
		this.__headerDividerFactory = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__headerDividerFactory;
	}
	,clearStyle_headerDividerFactory: function() {
		this.set_headerDividerFactory(feathers_utils_DisplayObjectFactory.withClass(feathers_controls_Button));
		return this.get_headerDividerFactory();
	}
	,__customHeaderDividerVariant: null
	,get_customHeaderDividerVariant: function() {
		return this.__customHeaderDividerVariant;
	}
	,set_customHeaderDividerVariant: function(value) {
		if(!this.setStyle("customHeaderDividerVariant")) {
			return this.__customHeaderDividerVariant;
		}
		if(this.__customHeaderDividerVariant == value) {
			return this.__customHeaderDividerVariant;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_customHeaderDividerVariant);
		this.__customHeaderDividerVariant = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__customHeaderDividerVariant;
	}
	,clearStyle_customHeaderDividerVariant: function() {
		this.set_customHeaderDividerVariant(null);
		return this.get_customHeaderDividerVariant();
	}
	,__columnDividerFactory: null
	,get_columnDividerFactory: function() {
		return this.__columnDividerFactory;
	}
	,set_columnDividerFactory: function(value) {
		if(!this.setStyle("columnDividerFactory")) {
			return this.__columnDividerFactory;
		}
		if(this.__columnDividerFactory == value) {
			return this.__columnDividerFactory;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_columnDividerFactory);
		this.__columnDividerFactory = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__columnDividerFactory;
	}
	,clearStyle_columnDividerFactory: function() {
		this.set_columnDividerFactory(null);
		return this.get_columnDividerFactory();
	}
	,__customColumnDividerVariant: null
	,get_customColumnDividerVariant: function() {
		return this.__customColumnDividerVariant;
	}
	,set_customColumnDividerVariant: function(value) {
		if(!this.setStyle("customColumnDividerVariant")) {
			return this.__customColumnDividerVariant;
		}
		if(this.__customColumnDividerVariant == value) {
			return this.__customColumnDividerVariant;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_customColumnDividerVariant);
		this.__customColumnDividerVariant = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__customColumnDividerVariant;
	}
	,clearStyle_customColumnDividerVariant: function() {
		this.set_customColumnDividerVariant(null);
		return this.get_customColumnDividerVariant();
	}
	,__layout: null
	,get_layout: function() {
		return this.__layout;
	}
	,set_layout: function(value) {
		if(!this.setStyle("layout")) {
			return this.__layout;
		}
		if(this.__layout == value) {
			return this.__layout;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_layout);
		this.__layout = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__layout;
	}
	,clearStyle_layout: function() {
		this.set_layout(null);
		return this.get_layout();
	}
	,__columnResizeSkin: null
	,get_columnResizeSkin: function() {
		return this.__columnResizeSkin;
	}
	,set_columnResizeSkin: function(value) {
		if(!this.setStyle("columnResizeSkin")) {
			return this.__columnResizeSkin;
		}
		if(this.__columnResizeSkin == value) {
			return this.__columnResizeSkin;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_columnResizeSkin);
		this.__columnResizeSkin = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__columnResizeSkin;
	}
	,clearStyle_columnResizeSkin: function() {
		this.set_columnResizeSkin(null);
		return this.get_columnResizeSkin();
	}
	,__headerCornerSkin: null
	,get_headerCornerSkin: function() {
		return this.__headerCornerSkin;
	}
	,set_headerCornerSkin: function(value) {
		if(!this.setStyle("headerCornerSkin")) {
			return this.__headerCornerSkin;
		}
		if(this.__headerCornerSkin == value) {
			return this.__headerCornerSkin;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_headerCornerSkin);
		this.__headerCornerSkin = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__headerCornerSkin;
	}
	,clearStyle_headerCornerSkin: function() {
		this.set_headerCornerSkin(null);
		return this.get_headerCornerSkin();
	}
	,__extendedScrollBarY: null
	,get_extendedScrollBarY: function() {
		return this.__extendedScrollBarY;
	}
	,set_extendedScrollBarY: function(value) {
		if(!this.setStyle("extendedScrollBarY")) {
			return this.__extendedScrollBarY;
		}
		if(this.__extendedScrollBarY == value) {
			return this.__extendedScrollBarY;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_extendedScrollBarY);
		this.__extendedScrollBarY = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__extendedScrollBarY;
	}
	,clearStyle_extendedScrollBarY: function() {
		this.set_extendedScrollBarY(false);
		return this.get_extendedScrollBarY();
	}
	,__showHeaderDividersOnlyWhenResizable: null
	,get_showHeaderDividersOnlyWhenResizable: function() {
		return this.__showHeaderDividersOnlyWhenResizable;
	}
	,set_showHeaderDividersOnlyWhenResizable: function(value) {
		if(!this.setStyle("showHeaderDividersOnlyWhenResizable")) {
			return this.__showHeaderDividersOnlyWhenResizable;
		}
		if(this.__showHeaderDividersOnlyWhenResizable == value) {
			return this.__showHeaderDividersOnlyWhenResizable;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_showHeaderDividersOnlyWhenResizable);
		this.__showHeaderDividersOnlyWhenResizable = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__showHeaderDividersOnlyWhenResizable;
	}
	,clearStyle_showHeaderDividersOnlyWhenResizable: function() {
		this.set_showHeaderDividersOnlyWhenResizable(false);
		return this.get_showHeaderDividersOnlyWhenResizable();
	}
	,__dragDropIndicatorSkin: null
	,get_dragDropIndicatorSkin: function() {
		return this.__dragDropIndicatorSkin;
	}
	,set_dragDropIndicatorSkin: function(value) {
		if(!this.setStyle("dragDropIndicatorSkin")) {
			return this.__dragDropIndicatorSkin;
		}
		if(this.__dragDropIndicatorSkin == value) {
			return this.__dragDropIndicatorSkin;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_dragDropIndicatorSkin);
		this.__dragDropIndicatorSkin = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__dragDropIndicatorSkin;
	}
	,clearStyle_dragDropIndicatorSkin: function() {
		this.set_dragDropIndicatorSkin(null);
		return this.get_dragDropIndicatorSkin();
	}
	,__class__: feathers_controls_GridView
	,__properties__: $extend(feathers_controls_supportClasses_BaseScrollContainer.prototype.__properties__,{set_removeOnDragDropComplete:"set_removeOnDragDropComplete",get_removeOnDragDropComplete:"get_removeOnDragDropComplete",set_dropEnabled:"set_dropEnabled",get_dropEnabled:"get_dropEnabled",set_dragEnabled:"set_dragEnabled",get_dragEnabled:"get_dragEnabled",set_dragFormat:"set_dragFormat",get_dragFormat:"get_dragFormat",set_dragDropIndicatorSkin:"set_dragDropIndicatorSkin",get_dragDropIndicatorSkin:"get_dragDropIndicatorSkin",set_showHeaderDividersOnlyWhenResizable:"set_showHeaderDividersOnlyWhenResizable",get_showHeaderDividersOnlyWhenResizable:"get_showHeaderDividersOnlyWhenResizable",set_extendedScrollBarY:"set_extendedScrollBarY",get_extendedScrollBarY:"get_extendedScrollBarY",set_selectable:"set_selectable",get_selectable:"get_selectable",set_sortedColumn:"set_sortedColumn",get_sortedColumn:"get_sortedColumn",set_sortOrder:"set_sortOrder",get_sortOrder:"get_sortOrder",set_headerCornerSkin:"set_headerCornerSkin",get_headerCornerSkin:"get_headerCornerSkin",set_columnResizeSkin:"set_columnResizeSkin",get_columnResizeSkin:"get_columnResizeSkin",set_resizableColumns:"set_resizableColumns",get_resizableColumns:"get_resizableColumns",set_sortableColumns:"set_sortableColumns",get_sortableColumns:"get_sortableColumns",set_cellRendererRecycler:"set_cellRendererRecycler",get_cellRendererRecycler:"get_cellRendererRecycler",set_virtualLayout:"set_virtualLayout",get_virtualLayout:"get_virtualLayout",set_layout:"set_layout",get_layout:"get_layout",set_selectedItems:"set_selectedItems",get_selectedItems:"get_selectedItems",set_selectedIndices:"set_selectedIndices",get_selectedIndices:"get_selectedIndices",set_allowMultipleSelection:"set_allowMultipleSelection",get_allowMultipleSelection:"get_allowMultipleSelection",set_selectedItem:"set_selectedItem",get_selectedItem:"get_selectedItem",get_maxSelectedIndex:"get_maxSelectedIndex",set_selectedIndex:"set_selectedIndex",get_selectedIndex:"get_selectedIndex",set_customColumnDividerVariant:"set_customColumnDividerVariant",get_customColumnDividerVariant:"get_customColumnDividerVariant",set_columnDividerFactory:"set_columnDividerFactory",get_columnDividerFactory:"get_columnDividerFactory",set_customHeaderDividerVariant:"set_customHeaderDividerVariant",get_customHeaderDividerVariant:"get_customHeaderDividerVariant",set_headerDividerFactory:"set_headerDividerFactory",get_headerDividerFactory:"get_headerDividerFactory",set_customHeaderRendererVariant:"set_customHeaderRendererVariant",get_customHeaderRendererVariant:"get_customHeaderRendererVariant",set_customCellRendererVariant:"set_customCellRendererVariant",get_customCellRendererVariant:"get_customCellRendererVariant",set_forceItemStateUpdate:"set_forceItemStateUpdate",get_forceItemStateUpdate:"get_forceItemStateUpdate",set_headerRendererRecycler:"set_headerRendererRecycler",get_headerRendererRecycler:"get_headerRendererRecycler",set_rowRendererFactory:"set_rowRendererFactory",get_rowRendererFactory:"get_rowRendererFactory",set_columns:"set_columns",get_columns:"get_columns",set_dataProvider:"set_dataProvider",get_dataProvider:"get_dataProvider",set_childFocusEnabled:"set_childFocusEnabled",get_childFocusEnabled:"get_childFocusEnabled"})
});
var feathers_controls__$GridView_HeaderRendererStorage = function(recycler) {
	this.inactiveHeaderRenderers = [];
	this.activeHeaderRenderers = [];
	this.headerRendererRecycler = recycler;
};
$hxClasses["feathers.controls._GridView.HeaderRendererStorage"] = feathers_controls__$GridView_HeaderRendererStorage;
feathers_controls__$GridView_HeaderRendererStorage.__name__ = "feathers.controls._GridView.HeaderRendererStorage";
feathers_controls__$GridView_HeaderRendererStorage.prototype = {
	oldHeaderRendererRecycler: null
	,headerRendererRecycler: null
	,activeHeaderRenderers: null
	,inactiveHeaderRenderers: null
	,measurements: null
	,__class__: feathers_controls__$GridView_HeaderRendererStorage
};
var feathers_controls__$GridView_HeaderDividerStorage = function(factory) {
	this.inactiveHeaderDividers = [];
	this.activeHeaderDividers = [];
	this.headerDividerFactory = factory;
};
$hxClasses["feathers.controls._GridView.HeaderDividerStorage"] = feathers_controls__$GridView_HeaderDividerStorage;
feathers_controls__$GridView_HeaderDividerStorage.__name__ = "feathers.controls._GridView.HeaderDividerStorage";
feathers_controls__$GridView_HeaderDividerStorage.prototype = {
	customHeaderDividerVariant: null
	,oldHeaderDividerFactory: null
	,headerDividerFactory: null
	,activeHeaderDividers: null
	,inactiveHeaderDividers: null
	,__class__: feathers_controls__$GridView_HeaderDividerStorage
};
var feathers_controls__$GridView_ColumnDividerStorage = function(factory) {
	this.inactiveColumnDividers = [];
	this.activeColumnDividers = [];
	this.columnDividerFactory = factory;
};
$hxClasses["feathers.controls._GridView.ColumnDividerStorage"] = feathers_controls__$GridView_ColumnDividerStorage;
feathers_controls__$GridView_ColumnDividerStorage.__name__ = "feathers.controls._GridView.ColumnDividerStorage";
feathers_controls__$GridView_ColumnDividerStorage.prototype = {
	customColumnDividerVariant: null
	,oldColumnDividerFactory: null
	,columnDividerFactory: null
	,activeColumnDividers: null
	,inactiveColumnDividers: null
	,__class__: feathers_controls__$GridView_ColumnDividerStorage
};
var feathers_controls_IGridViewColumn = function() { };
$hxClasses["feathers.controls.IGridViewColumn"] = feathers_controls_IGridViewColumn;
feathers_controls_IGridViewColumn.__name__ = "feathers.controls.IGridViewColumn";
feathers_controls_IGridViewColumn.__isInterface__ = true;
feathers_controls_IGridViewColumn.prototype = {
	width: null
	,minWidth: null
	,__class__: feathers_controls_IGridViewColumn
};
var feathers_controls_GridViewColumn = function(headerText,itemToText,width) {
	this.defaultSortOrder = feathers_data_SortOrder.ASCENDING;
	this.sortCompareFunction = null;
	this.cellRendererRecycler = null;
	this.minWidth = 0.0;
	this.width = null;
	openfl_events_EventDispatcher.call(this);
	this.headerText = headerText;
	if(itemToText != null) {
		this.itemToText = itemToText;
	}
	this.width = width;
};
$hxClasses["feathers.controls.GridViewColumn"] = feathers_controls_GridViewColumn;
feathers_controls_GridViewColumn.__name__ = "feathers.controls.GridViewColumn";
feathers_controls_GridViewColumn.__interfaces__ = [feathers_controls_IGridViewColumn];
feathers_controls_GridViewColumn.__super__ = openfl_events_EventDispatcher;
feathers_controls_GridViewColumn.prototype = $extend(openfl_events_EventDispatcher.prototype,{
	headerText: null
	,width: null
	,minWidth: null
	,cellRendererRecycler: null
	,sortCompareFunction: null
	,defaultSortOrder: null
	,itemToText: function(data) {
		return Std.string(data);
	}
	,__class__: feathers_controls_GridViewColumn
});
var feathers_data_GroupListViewItemState = function(type,data,location,layoutIndex,selected,text) {
	if(selected == null) {
		selected = false;
	}
	if(layoutIndex == null) {
		layoutIndex = -1;
	}
	if(type == null) {
		type = feathers_data_GroupListViewItemType.STANDARD;
	}
	this.enabled = true;
	this.selected = false;
	this.layoutIndex = -1;
	this.type = type;
	this.data = data;
	this.location = location;
	this.layoutIndex = layoutIndex;
	this.selected = false;
	this.text = text;
};
$hxClasses["feathers.data.GroupListViewItemState"] = feathers_data_GroupListViewItemState;
feathers_data_GroupListViewItemState.__name__ = "feathers.data.GroupListViewItemState";
feathers_data_GroupListViewItemState.prototype = {
	owner: null
	,type: null
	,data: null
	,location: null
	,layoutIndex: null
	,selected: null
	,text: null
	,enabled: null
	,recyclerID: null
	,__class__: feathers_data_GroupListViewItemState
};
var feathers_controls_GroupListView = function(dataProvider,changeListener) {
	this.__customItemRendererVariant = null;
	this.__customHeaderRendererVariant = null;
	this.__layout = null;
	this._pendingScrollDuration = null;
	this._pendingScrollLocation = null;
	this._ignoreLayoutChanges = false;
	this._ignoreSelectionChange = false;
	this.pointerSelectionEnabled = true;
	this._virtualLayout = true;
	this._selectable = true;
	this._layoutHeaderIndices = [];
	this._layoutItems = [];
	this._totalLayoutCount = 0;
	this._tempVisibleIndices = new feathers_layout_VirtualLayoutRange(0,0);
	this._visibleIndices = new feathers_layout_VirtualLayoutRange(0,0);
	this._virtualCache = [];
	this._unrenderedLayoutIndices = [];
	this._unrenderedLocations = [];
	this.itemStatePool = new lime_utils_ObjectPool(function() {
		return new feathers_data_GroupListViewItemState();
	});
	this.itemRendererToItemState = new haxe_ds_ObjectMap();
	this.stringDataToItemRenderer = new haxe_ds_StringMap();
	this.objectDataToItemRenderer = new haxe_ds_ObjectMap();
	this._additionalHeaderStorage = null;
	this._additionalItemStorage = null;
	this._defaultHeaderStorage = new feathers_controls__$GroupListView_ItemRendererStorage(feathers_data_GroupListViewItemType.HEADER,null,feathers_utils_DisplayObjectRecycler.withClass(feathers_controls_dataRenderers_ItemRenderer));
	this._defaultItemStorage = new feathers_controls__$GroupListView_ItemRendererStorage(feathers_data_GroupListViewItemType.STANDARD,null,feathers_utils_DisplayObjectRecycler.withClass(feathers_controls_dataRenderers_ItemRenderer));
	this._headerRendererRecyclerMap = null;
	this._itemRendererRecyclerMap = null;
	this._forceItemStateUpdate = false;
	this._previousCustomItemRendererVariant = null;
	this._previousCustomHeaderRendererVariant = null;
	this._selectedItem = null;
	this._selectedLocation = null;
	this._childFocusEnabled = true;
	this.initializeGroupListViewTheme();
	feathers_controls_supportClasses_BaseScrollContainer.call(this);
	this.set_dataProvider(dataProvider);
	this.set_tabEnabled(true);
	this.focusRect = null;
	if(this.get_viewPort() == null) {
		this.groupViewPort = new feathers_controls_supportClasses_AdvancedLayoutViewPort();
		this.addChild(this.groupViewPort);
		this.set_viewPort(this.groupViewPort);
	}
	this.addEventListener("keyDown",$bind(this,this.groupListView_keyDownHandler));
	if(changeListener != null) {
		this.addEventListener("change",changeListener);
	}
};
$hxClasses["feathers.controls.GroupListView"] = feathers_controls_GroupListView;
feathers_controls_GroupListView.__name__ = "feathers.controls.GroupListView";
feathers_controls_GroupListView.__interfaces__ = [feathers_core_IFocusContainer,feathers_core_IDataSelector];
feathers_controls_GroupListView.defaultUpdateItemRenderer = function(itemRenderer,state) {
	if(js_Boot.__implements(itemRenderer,feathers_core_ITextControl)) {
		var textControl = itemRenderer;
		textControl.set_text(state.text);
	}
};
feathers_controls_GroupListView.defaultResetItemRenderer = function(itemRenderer,state) {
	if(js_Boot.__implements(itemRenderer,feathers_core_ITextControl)) {
		var textControl = itemRenderer;
		textControl.set_text(null);
	}
};
feathers_controls_GroupListView.__super__ = feathers_controls_supportClasses_BaseScrollContainer;
feathers_controls_GroupListView.prototype = $extend(feathers_controls_supportClasses_BaseScrollContainer.prototype,{
	groupViewPort: null
	,get_tabEnabled: function() {
		if((this._selectable || this.get_maxScrollY() != this.get_minScrollY() || this.get_maxScrollX() != this.get_minScrollX()) && this._enabled) {
			return this.get_rawTabEnabled();
		} else {
			return false;
		}
	}
	,_childFocusEnabled: null
	,get_childFocusEnabled: function() {
		if(this._enabled) {
			return this._childFocusEnabled;
		} else {
			return false;
		}
	}
	,set_childFocusEnabled: function(value) {
		if(this._childFocusEnabled == value) {
			return this._childFocusEnabled;
		}
		this._childFocusEnabled = value;
		return this._childFocusEnabled;
	}
	,_dataProvider: null
	,get_dataProvider: function() {
		return this._dataProvider;
	}
	,set_dataProvider: function(value) {
		if(this._dataProvider == value) {
			return this._dataProvider;
		}
		this._virtualCache.length = 0;
		this._totalLayoutCount = 0;
		if(this._dataProvider != null) {
			this._dataProvider.removeEventListener("change",$bind(this,this.groupListView_dataProvider_changeHandler));
			this._dataProvider.removeEventListener("addItem",$bind(this,this.groupListView_dataProvider_addItemHandler));
			this._dataProvider.removeEventListener("removeItem",$bind(this,this.groupListView_dataProvider_removeItemHandler));
			this._dataProvider.removeEventListener("replaceItem",$bind(this,this.groupListView_dataProvider_replaceItemHandler));
			this._dataProvider.removeEventListener("removeAll",$bind(this,this.groupListView_dataProvider_removeAllHandler));
			this._dataProvider.removeEventListener("reset",$bind(this,this.groupListView_dataProvider_resetHandler));
			this._dataProvider.removeEventListener("filterChange",$bind(this,this.groupListView_dataProvider_filterChangeHandler));
			this._dataProvider.removeEventListener("sortChange",$bind(this,this.groupListView_dataProvider_sortChangeHandler));
			this._dataProvider.removeEventListener("updateItem",$bind(this,this.groupListView_dataProvider_updateItemHandler));
			this._dataProvider.removeEventListener("updateAll",$bind(this,this.groupListView_dataProvider_updateAllHandler));
		}
		this._dataProvider = value;
		if(this._dataProvider != null) {
			this._totalLayoutCount = this.calculateTotalLayoutCount([]);
			this._virtualCache.length = this._totalLayoutCount;
			this._dataProvider.addEventListener("change",$bind(this,this.groupListView_dataProvider_changeHandler));
			this._dataProvider.addEventListener("addItem",$bind(this,this.groupListView_dataProvider_addItemHandler));
			this._dataProvider.addEventListener("removeItem",$bind(this,this.groupListView_dataProvider_removeItemHandler));
			this._dataProvider.addEventListener("replaceItem",$bind(this,this.groupListView_dataProvider_replaceItemHandler));
			this._dataProvider.addEventListener("removeAll",$bind(this,this.groupListView_dataProvider_removeAllHandler));
			this._dataProvider.addEventListener("reset",$bind(this,this.groupListView_dataProvider_resetHandler));
			this._dataProvider.addEventListener("filterChange",$bind(this,this.groupListView_dataProvider_filterChangeHandler));
			this._dataProvider.addEventListener("sortChange",$bind(this,this.groupListView_dataProvider_sortChangeHandler));
			this._dataProvider.addEventListener("updateItem",$bind(this,this.groupListView_dataProvider_updateItemHandler));
			this._dataProvider.addEventListener("updateAll",$bind(this,this.groupListView_dataProvider_updateAllHandler));
		}
		this.set_scrollX(0.0);
		this.set_scrollY(0.0);
		this.set_selectedLocation(null);
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		feathers_events_FeathersEvent.dispatch(this,"dataChange");
		return this._dataProvider;
	}
	,_selectedLocation: null
	,get_selectedLocation: function() {
		return this._selectedLocation;
	}
	,set_selectedLocation: function(value) {
		if(!this._selectable || this._dataProvider == null) {
			value = null;
		}
		if(this._selectedLocation == value || this.compareLocations(this._selectedLocation,value) == 0) {
			return this._selectedLocation;
		}
		if(value != null && value.length != 2) {
			throw new openfl_errors_ArgumentError("GroupListView selectedLocation must have a length of 2");
		}
		this._selectedLocation = value;
		if(this._selectedLocation == null) {
			this._selectedItem = null;
		} else {
			this._selectedItem = this._dataProvider.get(this._selectedLocation);
		}
		this.setInvalid(feathers_core_InvalidationFlag.SELECTION);
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._selectedLocation;
	}
	,_selectedItem: null
	,get_selectedItem: function() {
		return this._selectedItem;
	}
	,set_selectedItem: function(value) {
		if(value == null || !this._selectable || this._dataProvider == null) {
			this.set_selectedLocation(null);
			return this._selectedItem;
		}
		var location = this._dataProvider.locationOf(value);
		if(this._selectedItem == value && this.compareLocations(this._selectedLocation,location) == 0) {
			return this._selectedItem;
		}
		this._selectedItem = value;
		this._selectedLocation = location;
		this.setInvalid(feathers_core_InvalidationFlag.SELECTION);
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._selectedItem;
	}
	,_previousLayout: null
	,_previousCustomHeaderRendererVariant: null
	,_previousCustomItemRendererVariant: null
	,_forceItemStateUpdate: null
	,get_forceItemStateUpdate: function() {
		return this._forceItemStateUpdate;
	}
	,set_forceItemStateUpdate: function(value) {
		if(this._forceItemStateUpdate == value) {
			return this._forceItemStateUpdate;
		}
		this._forceItemStateUpdate = value;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		return this._forceItemStateUpdate;
	}
	,get_itemRendererRecycler: function() {
		return this._defaultItemStorage.itemRendererRecycler;
	}
	,set_itemRendererRecycler: function(value) {
		if(this._defaultItemStorage.itemRendererRecycler == value) {
			return this._defaultItemStorage.itemRendererRecycler;
		}
		this._defaultItemStorage.oldItemRendererRecycler = this._defaultItemStorage.itemRendererRecycler;
		this._defaultItemStorage.itemRendererRecycler = value;
		this._defaultItemStorage.measurements = null;
		this.setInvalid(feathers_controls_GroupListView.INVALIDATION_FLAG_ITEM_RENDERER_FACTORY);
		return this._defaultItemStorage.itemRendererRecycler;
	}
	,get_headerRendererRecycler: function() {
		return this._defaultHeaderStorage.itemRendererRecycler;
	}
	,set_headerRendererRecycler: function(value) {
		if(this._defaultHeaderStorage.itemRendererRecycler == value) {
			return this._defaultHeaderStorage.itemRendererRecycler;
		}
		this._defaultHeaderStorage.oldItemRendererRecycler = this._defaultHeaderStorage.itemRendererRecycler;
		this._defaultHeaderStorage.itemRendererRecycler = value;
		this.setInvalid(feathers_controls_GroupListView.INVALIDATION_FLAG_HEADER_RENDERER_FACTORY);
		return this._defaultHeaderStorage.itemRendererRecycler;
	}
	,_itemRendererRecyclerMap: null
	,_headerRendererRecyclerMap: null
	,_itemRendererRecyclerIDFunction: null
	,get_itemRendererRecyclerIDFunction: function() {
		return this._itemRendererRecyclerIDFunction;
	}
	,set_itemRendererRecyclerIDFunction: function(value) {
		if(this._itemRendererRecyclerIDFunction == value) {
			return this._itemRendererRecyclerIDFunction;
		}
		this._itemRendererRecyclerIDFunction = value;
		if(this._itemRendererRecyclerIDFunction != null && this._additionalItemStorage == null) {
			this._additionalItemStorage = [];
		}
		this.setInvalid(feathers_controls_GroupListView.INVALIDATION_FLAG_ITEM_RENDERER_FACTORY);
		return this._itemRendererRecyclerIDFunction;
	}
	,_headerRendererRecyclerIDFunction: null
	,get_headerRendererRecyclerIDFunction: function() {
		return this._headerRendererRecyclerIDFunction;
	}
	,set_headerRendererRecyclerIDFunction: function(value) {
		if(this._headerRendererRecyclerIDFunction == value) {
			return this._headerRendererRecyclerIDFunction;
		}
		this._headerRendererRecyclerIDFunction = value;
		if(this._headerRendererRecyclerIDFunction != null && this._additionalHeaderStorage == null) {
			this._additionalHeaderStorage = [];
		}
		this.setInvalid(feathers_controls_GroupListView.INVALIDATION_FLAG_HEADER_RENDERER_FACTORY);
		return this._headerRendererRecyclerIDFunction;
	}
	,_defaultItemStorage: null
	,_defaultHeaderStorage: null
	,_additionalItemStorage: null
	,_additionalHeaderStorage: null
	,objectDataToItemRenderer: null
	,stringDataToItemRenderer: null
	,itemRendererToItemState: null
	,itemStatePool: null
	,_unrenderedLocations: null
	,_unrenderedLayoutIndices: null
	,_virtualCache: null
	,_visibleIndices: null
	,_tempVisibleIndices: null
	,_totalLayoutCount: null
	,_layoutItems: null
	,_layoutHeaderIndices: null
	,_selectable: null
	,get_selectable: function() {
		return this._selectable;
	}
	,set_selectable: function(value) {
		if(this._selectable == value) {
			return this._selectable;
		}
		this._selectable = value;
		if(!this._selectable) {
			this.set_selectedLocation(null);
		}
		return this._selectable;
	}
	,_virtualLayout: null
	,get_virtualLayout: function() {
		return this._virtualLayout;
	}
	,set_virtualLayout: function(value) {
		if(this._virtualLayout = value) {
			return this._virtualLayout;
		}
		this._virtualLayout = value;
		this.setInvalid(feathers_core_InvalidationFlag.LAYOUT);
		return this._virtualLayout;
	}
	,pointerSelectionEnabled: null
	,_ignoreSelectionChange: null
	,_ignoreLayoutChanges: null
	,itemToText: function(data) {
		return Std.string(data);
	}
	,itemToEnabled: function(data) {
		return true;
	}
	,itemToHeaderText: function(data) {
		return Std.string(data);
	}
	,itemToItemRenderer: function(item) {
		if(item == null) {
			return null;
		}
		if(typeof(item) == "string") {
			return this.stringDataToItemRenderer.h[item];
		}
		return this.objectDataToItemRenderer.h[item.__id__];
	}
	,itemRendererToItem: function(itemRenderer) {
		if(itemRenderer == null) {
			return null;
		}
		var state = this.itemRendererToItemState.h[itemRenderer.__id__];
		if(state == null) {
			return null;
		}
		return state.data;
	}
	,locationToItemRenderer: function(location) {
		if(this._dataProvider == null || !this.isValidLocation(location)) {
			return null;
		}
		var item = this._dataProvider.get(location);
		if(typeof(item) == "string") {
			return this.stringDataToItemRenderer.h[item];
		}
		return this.objectDataToItemRenderer.h[item.__id__];
	}
	,getItemRendererRecycler: function(id) {
		if(this._itemRendererRecyclerMap == null) {
			return null;
		}
		return this._itemRendererRecyclerMap.h[id];
	}
	,setItemRendererRecycler: function(id,recycler) {
		if(this._itemRendererRecyclerMap == null) {
			this._itemRendererRecyclerMap = new haxe_ds_StringMap();
		}
		if(recycler == null) {
			var _this = this._itemRendererRecyclerMap;
			if(Object.prototype.hasOwnProperty.call(_this.h,id)) {
				delete(_this.h[id]);
			}
			return;
		}
		this._itemRendererRecyclerMap.h[id] = recycler;
		this.setInvalid(feathers_controls_GroupListView.INVALIDATION_FLAG_ITEM_RENDERER_FACTORY);
	}
	,getHeaderRendererRecycler: function(id) {
		if(this._headerRendererRecyclerMap == null) {
			return null;
		}
		return this._headerRendererRecyclerMap.h[id];
	}
	,setHeaderRendererRecycler: function(id,recycler) {
		if(this._headerRendererRecyclerMap == null) {
			this._headerRendererRecyclerMap = new haxe_ds_StringMap();
		}
		if(recycler == null) {
			var _this = this._headerRendererRecyclerMap;
			if(Object.prototype.hasOwnProperty.call(_this.h,id)) {
				delete(_this.h[id]);
			}
			return;
		}
		this._headerRendererRecyclerMap.h[id] = recycler;
		this.setInvalid(feathers_controls_GroupListView.INVALIDATION_FLAG_HEADER_RENDERER_FACTORY);
	}
	,_pendingScrollLocation: null
	,_pendingScrollDuration: null
	,scrollToLocation: function(location,animationDuration) {
		if(this._dataProvider == null || this._dataProvider.getLength() == 0) {
			return;
		}
		this._pendingScrollLocation = location;
		this._pendingScrollDuration = animationDuration;
		this.setInvalid(feathers_core_InvalidationFlag.SCROLL);
	}
	,itemToItemState: function(item) {
		if(item == null) {
			return null;
		}
		var itemState = null;
		var itemRenderer = null;
		if(typeof(item) == "string") {
			itemRenderer = this.stringDataToItemRenderer.h[item];
		} else {
			itemRenderer = this.objectDataToItemRenderer.h[item.__id__];
		}
		if(itemRenderer != null) {
			itemState = this.itemRendererToItemState.h[itemRenderer.__id__];
		} else {
			var location = this._dataProvider.locationOf(item);
			if(location == null) {
				return null;
			}
			itemState = new feathers_data_GroupListViewItemState();
			var type = location.length == 1 ? feathers_data_GroupListViewItemType.HEADER : feathers_data_GroupListViewItemType.STANDARD;
			var layoutIndex = this.locationToDisplayIndex(location);
			this.populateCurrentItemState(item,type,location,layoutIndex,itemState,false);
		}
		return itemState;
	}
	,dispose: function() {
		this.refreshInactiveItemRenderers(this._defaultItemStorage,true);
		if(this._additionalItemStorage != null) {
			var _g = 0;
			var _g1 = this._additionalItemStorage.length;
			while(_g < _g1) {
				var i = _g++;
				var storage = this._additionalItemStorage[i];
				this.refreshInactiveItemRenderers(storage,true);
			}
		}
		this.refreshInactiveItemRenderers(this._defaultHeaderStorage,true);
		if(this._additionalHeaderStorage != null) {
			var _g = 0;
			var _g1 = this._additionalHeaderStorage.length;
			while(_g < _g1) {
				var i = _g++;
				var storage = this._additionalHeaderStorage[i];
				this.refreshInactiveItemRenderers(storage,true);
			}
		}
		this._selectedItem = null;
		this._selectedLocation = null;
		this.set_dataProvider(null);
		feathers_controls_supportClasses_BaseScrollContainer.prototype.dispose.call(this);
	}
	,initializeGroupListViewTheme: function() {
		feathers_themes_steel_components_SteelGroupListViewStyles.initialize();
	}
	,update: function() {
		var layoutInvalid = this.isInvalid(feathers_core_InvalidationFlag.LAYOUT);
		var stylesInvalid = this.isInvalid(feathers_core_InvalidationFlag.STYLES);
		if(this._previousCustomHeaderRendererVariant != this.get_customHeaderRendererVariant()) {
			this.setInvalidationFlag(feathers_controls_GroupListView.INVALIDATION_FLAG_HEADER_RENDERER_FACTORY);
		}
		if(this._previousCustomItemRendererVariant != this.get_customItemRendererVariant()) {
			this.setInvalidationFlag(feathers_controls_GroupListView.INVALIDATION_FLAG_ITEM_RENDERER_FACTORY);
		}
		if(layoutInvalid || stylesInvalid) {
			if(this._previousLayout != this.get_layout()) {
				this._virtualCache.length = 0;
				this._virtualCache.length = this._totalLayoutCount;
			}
			this.groupViewPort.set_layout(this.get_layout());
			this._previousLayout = this.get_layout();
		}
		this.groupViewPort.refreshChildren = $bind(this,this.refreshItemRenderers);
		var flag = this._invalidationFlags.keys();
		while(flag.hasNext()) {
			var flag1 = flag.next();
			this.groupViewPort.setInvalid(flag1);
		}
		if(this._allInvalid) {
			this.groupViewPort.setInvalid();
		}
		feathers_controls_supportClasses_BaseScrollContainer.prototype.update.call(this);
		this._previousCustomItemRendererVariant = this.get_customItemRendererVariant();
		this._previousCustomHeaderRendererVariant = this.get_customHeaderRendererVariant();
		this.handlePendingScroll();
	}
	,createScroller: function() {
		feathers_controls_supportClasses_BaseScrollContainer.prototype.createScroller.call(this);
		this.groupViewPort.set_scroller(this.scroller);
	}
	,refreshScrollerValues: function() {
		feathers_controls_supportClasses_BaseScrollContainer.prototype.refreshScrollerValues.call(this);
		if(js_Boot.__implements(this.get_layout(),feathers_layout_IScrollLayout)) {
			var scrollLayout = this.get_layout();
			this.scroller.forceElasticTop = scrollLayout.get_elasticTop();
			this.scroller.forceElasticRight = scrollLayout.get_elasticRight();
			this.scroller.forceElasticBottom = scrollLayout.get_elasticBottom();
			this.scroller.forceElasticLeft = scrollLayout.get_elasticLeft();
		} else {
			this.scroller.forceElasticTop = false;
			this.scroller.forceElasticRight = false;
			this.scroller.forceElasticBottom = false;
			this.scroller.forceElasticLeft = false;
		}
		this.scroller.snapPositionsX = this.groupViewPort.get_snapPositionsX();
		this.scroller.snapPositionsY = this.groupViewPort.get_snapPositionsY();
	}
	,needsScrollMeasurement: function() {
		var oldStart = this._visibleIndices.start;
		var oldEnd = this._visibleIndices.end;
		if(this._virtualLayout && js_Boot.__implements(this.get_layout(),feathers_layout_IVirtualLayout)) {
			var virtualLayout = this.get_layout();
			var oldIgnoreLayoutChanges = this._ignoreLayoutChanges;
			this._ignoreLayoutChanges = true;
			virtualLayout.set_scrollX(this.scroller.get_scrollX());
			virtualLayout.set_scrollY(this.scroller.get_scrollY());
			this._ignoreLayoutChanges = oldIgnoreLayoutChanges;
			virtualLayout.getVisibleIndices(this._layoutItems.length,this.groupViewPort.get_visibleWidth(),this.groupViewPort.get_visibleHeight(),this._tempVisibleIndices);
		} else {
			this._tempVisibleIndices.start = 0;
			this._tempVisibleIndices.end = this._layoutItems.length - 1;
		}
		if(oldStart == this._tempVisibleIndices.start) {
			return oldEnd != this._tempVisibleIndices.end;
		} else {
			return true;
		}
	}
	,refreshItemRenderers: function(items) {
		this._layoutItems = items;
		if(this._defaultItemStorage.itemRendererRecycler.update == null) {
			this._defaultItemStorage.itemRendererRecycler.update = feathers_controls_GroupListView.defaultUpdateItemRenderer;
			if(this._defaultItemStorage.itemRendererRecycler.reset == null) {
				this._defaultItemStorage.itemRendererRecycler.reset = feathers_controls_GroupListView.defaultResetItemRenderer;
			}
		}
		if(this._defaultHeaderStorage.itemRendererRecycler.update == null) {
			this._defaultHeaderStorage.itemRendererRecycler.update = feathers_controls_GroupListView.defaultUpdateItemRenderer;
			if(this._defaultHeaderStorage.itemRendererRecycler.reset == null) {
				this._defaultHeaderStorage.itemRendererRecycler.reset = feathers_controls_GroupListView.defaultResetItemRenderer;
			}
		}
		if(this._itemRendererRecyclerMap != null) {
			var h = this._itemRendererRecyclerMap.h;
			var recycler_h = h;
			var recycler_keys = Object.keys(h);
			var recycler_length = recycler_keys.length;
			var recycler_current = 0;
			while(recycler_current < recycler_length) {
				var recycler = recycler_h[recycler_keys[recycler_current++]];
				if(recycler.update == null) {
					if(recycler.update == null) {
						recycler.update = feathers_controls_GroupListView.defaultUpdateItemRenderer;
						if(recycler.reset == null) {
							recycler.reset = feathers_controls_GroupListView.defaultResetItemRenderer;
						}
					}
				}
			}
		}
		if(this._headerRendererRecyclerMap != null) {
			var h = this._headerRendererRecyclerMap.h;
			var recycler_h = h;
			var recycler_keys = Object.keys(h);
			var recycler_length = recycler_keys.length;
			var recycler_current = 0;
			while(recycler_current < recycler_length) {
				var recycler = recycler_h[recycler_keys[recycler_current++]];
				if(recycler.update == null) {
					if(recycler.update == null) {
						recycler.update = feathers_controls_GroupListView.defaultUpdateItemRenderer;
						if(recycler.reset == null) {
							recycler.reset = feathers_controls_GroupListView.defaultResetItemRenderer;
						}
					}
				}
			}
		}
		var itemRendererInvalid = this.groupViewPort.isInvalid(feathers_controls_GroupListView.INVALIDATION_FLAG_ITEM_RENDERER_FACTORY);
		var headerRendererInvalid = this.groupViewPort.isInvalid(feathers_controls_GroupListView.INVALIDATION_FLAG_HEADER_RENDERER_FACTORY);
		this.refreshInactiveItemRenderers(this._defaultItemStorage,itemRendererInvalid);
		if(this._additionalItemStorage != null) {
			var _g = 0;
			var _g1 = this._additionalItemStorage.length;
			while(_g < _g1) {
				var i = _g++;
				var storage = this._additionalItemStorage[i];
				this.refreshInactiveItemRenderers(storage,itemRendererInvalid);
			}
		}
		this.refreshInactiveItemRenderers(this._defaultHeaderStorage,headerRendererInvalid);
		if(this._additionalHeaderStorage != null) {
			var _g = 0;
			var _g1 = this._additionalHeaderStorage.length;
			while(_g < _g1) {
				var i = _g++;
				var storage = this._additionalHeaderStorage[i];
				this.refreshInactiveItemRenderers(storage,headerRendererInvalid);
			}
		}
		this.findUnrenderedData();
		this.recoverInactiveItemRenderers(this._defaultItemStorage);
		if(this._additionalItemStorage != null) {
			var _g = 0;
			var _g1 = this._additionalItemStorage.length;
			while(_g < _g1) {
				var i = _g++;
				var storage = this._additionalItemStorage[i];
				this.recoverInactiveItemRenderers(storage);
			}
		}
		this.recoverInactiveItemRenderers(this._defaultHeaderStorage);
		if(this._additionalHeaderStorage != null) {
			var _g = 0;
			var _g1 = this._additionalHeaderStorage.length;
			while(_g < _g1) {
				var i = _g++;
				var storage = this._additionalHeaderStorage[i];
				this.recoverInactiveItemRenderers(storage);
			}
		}
		this.renderUnrenderedData();
		this.freeInactiveItemRenderers(this._defaultItemStorage);
		if(this._defaultItemStorage.inactiveItemRenderers.length > 0) {
			var c = js_Boot.getClass(this);
			throw new openfl_errors_IllegalOperationError("" + c.__name__ + ": inactive item renderers should be empty after updating.");
		}
		if(this._additionalItemStorage != null) {
			var _g = 0;
			var _g1 = this._additionalItemStorage.length;
			while(_g < _g1) {
				var i = _g++;
				var storage = this._additionalItemStorage[i];
				this.freeInactiveItemRenderers(storage);
				if(storage.inactiveItemRenderers.length > 0) {
					var c = js_Boot.getClass(this);
					throw new openfl_errors_IllegalOperationError("" + c.__name__ + ": inactive item renderers " + storage.id + " should be empty after updating.");
				}
			}
		}
		this.freeInactiveItemRenderers(this._defaultHeaderStorage);
		if(this._defaultHeaderStorage.inactiveItemRenderers.length > 0) {
			var c = js_Boot.getClass(this);
			throw new openfl_errors_IllegalOperationError("" + c.__name__ + ": inactive header renderers should be empty after updating.");
		}
		if(this._additionalHeaderStorage != null) {
			var _g = 0;
			var _g1 = this._additionalHeaderStorage.length;
			while(_g < _g1) {
				var i = _g++;
				var storage = this._additionalHeaderStorage[i];
				this.freeInactiveItemRenderers(storage);
				if(storage.inactiveItemRenderers.length > 0) {
					var c = js_Boot.getClass(this);
					throw new openfl_errors_IllegalOperationError("" + c.__name__ + ": inactive header renderers " + storage.id + " should be empty after updating.");
				}
			}
		}
	}
	,refreshInactiveItemRenderers: function(storage,factoryInvalid) {
		var temp = storage.inactiveItemRenderers;
		storage.inactiveItemRenderers = storage.activeItemRenderers;
		storage.activeItemRenderers = temp;
		if(storage.activeItemRenderers.length > 0) {
			var c = js_Boot.getClass(this);
			throw new openfl_errors_IllegalOperationError("" + c.__name__ + ": active " + Std.string(storage.type) + " renderers should be empty before updating.");
		}
		if(factoryInvalid) {
			this.recoverInactiveItemRenderers(storage);
			this.freeInactiveItemRenderers(storage);
			storage.oldItemRendererRecycler = null;
		}
	}
	,recoverInactiveItemRenderers: function(storage) {
		var _g = 0;
		var _g1 = storage.inactiveItemRenderers;
		while(_g < _g1.length) {
			var itemRenderer = _g1[_g];
			++_g;
			if(itemRenderer == null) {
				continue;
			}
			var state = this.itemRendererToItemState.h[itemRenderer.__id__];
			if(state == null) {
				continue;
			}
			var item = state.data;
			this.itemRendererToItemState.remove(itemRenderer);
			if(typeof(item) == "string") {
				var _this = this.stringDataToItemRenderer;
				var key = item;
				if(Object.prototype.hasOwnProperty.call(_this.h,key)) {
					delete(_this.h[key]);
				}
			} else {
				this.objectDataToItemRenderer.remove(item);
			}
			if(storage.type == feathers_data_GroupListViewItemType.STANDARD) {
				itemRenderer.removeEventListener("trigger",$bind(this,this.groupListView_itemRenderer_triggerHandler));
				itemRenderer.removeEventListener("click",$bind(this,this.groupListView_itemRenderer_clickHandler));
				itemRenderer.removeEventListener("touchTap",$bind(this,this.groupListView_itemRenderer_touchTapHandler));
				itemRenderer.removeEventListener("change",$bind(this,this.groupListView_itemRenderer_changeHandler));
			}
			itemRenderer.removeEventListener("resize",$bind(this,this.groupListView_itemRenderer_resizeHandler));
			this.resetItemRenderer(itemRenderer,state,storage);
			if(storage.measurements != null) {
				storage.measurements.restore(itemRenderer);
			}
			this.itemStatePool.release(state);
		}
	}
	,freeInactiveItemRenderers: function(storage) {
		var recycler = storage.oldItemRendererRecycler != null ? storage.oldItemRendererRecycler : storage.itemRendererRecycler;
		var _g = 0;
		var _g1 = storage.inactiveItemRenderers;
		while(_g < _g1.length) {
			var itemRenderer = _g1[_g];
			++_g;
			if(itemRenderer == null) {
				continue;
			}
			this.destroyItemRenderer(itemRenderer,recycler);
		}
		storage.inactiveItemRenderers.length = 0;
	}
	,findUnrenderedData: function() {
		this._layoutItems.length = 0;
		this._layoutItems.length = this._totalLayoutCount;
		this._layoutHeaderIndices.length = 0;
		if(this._virtualLayout && js_Boot.__implements(this.get_layout(),feathers_layout_IVirtualLayout)) {
			var virtualLayout = this.get_layout();
			var oldIgnoreLayoutChanges = this._ignoreLayoutChanges;
			this._ignoreLayoutChanges = true;
			virtualLayout.set_scrollX(this.scroller.get_scrollX());
			virtualLayout.set_scrollY(this.scroller.get_scrollY());
			virtualLayout.set_virtualCache(this._virtualCache);
			this._ignoreLayoutChanges = oldIgnoreLayoutChanges;
			virtualLayout.getVisibleIndices(this._layoutItems.length,this.groupViewPort.get_visibleWidth(),this.groupViewPort.get_visibleHeight(),this._visibleIndices);
		} else {
			this._visibleIndices.start = 0;
			this._visibleIndices.end = this._layoutItems.length - 1;
		}
		this.findUnrenderedDataForLocation([],0);
	}
	,findUnrenderedDataForLocation: function(location,layoutIndex) {
		if(this._dataProvider == null) {
			return layoutIndex;
		}
		var _g = 0;
		var _g1 = this._dataProvider.getLength(location);
		while(_g < _g1) {
			var i = _g++;
			location.push(i);
			var item = this._dataProvider.get(location);
			if(layoutIndex < this._visibleIndices.start || layoutIndex > this._visibleIndices.end) {
				this._layoutItems[layoutIndex] = null;
				if(location.length == 1) {
					this._layoutHeaderIndices.push(layoutIndex);
				}
			} else {
				this.findItemRenderer(item,location.slice(),layoutIndex);
			}
			++layoutIndex;
			if(layoutIndex > this._visibleIndices.end) {
				break;
			}
			if(location.length == 1 && this._dataProvider.isBranch(item)) {
				layoutIndex = this.findUnrenderedDataForLocation(location,layoutIndex);
				if(layoutIndex > this._visibleIndices.end) {
					break;
				}
			}
			location.pop();
		}
		return layoutIndex;
	}
	,findItemRenderer: function(item,location,layoutIndex) {
		var itemRenderer = null;
		if(typeof(item) == "string") {
			itemRenderer = this.stringDataToItemRenderer.h[item];
		} else {
			itemRenderer = this.objectDataToItemRenderer.h[item.__id__];
		}
		if(itemRenderer == null) {
			this._unrenderedLocations.push(location);
			this._unrenderedLayoutIndices.push(layoutIndex);
			return;
		}
		var type = location.length == 1 ? feathers_data_GroupListViewItemType.HEADER : feathers_data_GroupListViewItemType.STANDARD;
		var state = this.itemRendererToItemState.h[itemRenderer.__id__];
		var changed = this.populateCurrentItemState(item,type,location,layoutIndex,state,this._forceItemStateUpdate);
		var oldRecyclerID = state.recyclerID;
		var storage = this.itemStateToStorage(state);
		if(storage.id != oldRecyclerID) {
			this._unrenderedLocations.push(location);
			this._unrenderedLayoutIndices.push(layoutIndex);
			return;
		}
		if(changed) {
			this.updateItemRenderer(itemRenderer,state,storage);
		}
		itemRenderer.set_visible(true);
		this._layoutItems[layoutIndex] = itemRenderer;
		if(state.type == feathers_data_GroupListViewItemType.HEADER) {
			this._layoutHeaderIndices.push(layoutIndex);
		}
		var removed = HxOverrides.remove(storage.inactiveItemRenderers,itemRenderer);
		if(!removed) {
			var c = js_Boot.getClass(this);
			throw new openfl_errors_IllegalOperationError("" + c.__name__ + ": item renderer map contains bad data for item at location " + Std.string(location) + ". This may be caused by duplicate items in the data provider, which is not allowed.");
		}
		storage.activeItemRenderers.push(itemRenderer);
	}
	,renderUnrenderedData: function() {
		var _g = 0;
		var _g1 = this._unrenderedLocations;
		while(_g < _g1.length) {
			var location = _g1[_g];
			++_g;
			var item = this._dataProvider.get(location);
			var type = location.length == 1 ? feathers_data_GroupListViewItemType.HEADER : feathers_data_GroupListViewItemType.STANDARD;
			var layoutIndex = this._unrenderedLayoutIndices.shift();
			var state = this.itemStatePool.get();
			this.populateCurrentItemState(item,type,location,layoutIndex,state,true);
			var itemRenderer = this.createItemRenderer(state);
			itemRenderer.set_visible(true);
			this.groupViewPort.addChild(itemRenderer);
			this._layoutItems[layoutIndex] = itemRenderer;
			if(type == feathers_data_GroupListViewItemType.HEADER) {
				this._layoutHeaderIndices.push(layoutIndex);
			}
		}
		this._unrenderedLocations.length = 0;
	}
	,createItemRenderer: function(state) {
		var storage = this.itemStateToStorage(state);
		var itemRenderer = null;
		if(storage.inactiveItemRenderers.length == 0) {
			itemRenderer = storage.itemRendererRecycler.create();
			if(js_Boot.__implements(itemRenderer,feathers_style_IVariantStyleObject)) {
				var variantItemRenderer = itemRenderer;
				if(variantItemRenderer.get_variant() == null) {
					if(state.type == feathers_data_GroupListViewItemType.HEADER) {
						var variant = this.get_customHeaderRendererVariant() != null ? this.get_customHeaderRendererVariant() : feathers_controls_GroupListView.CHILD_VARIANT_HEADER_RENDERER;
						variantItemRenderer.set_variant(variant);
					} else {
						var variant = this.get_customItemRendererVariant() != null ? this.get_customItemRendererVariant() : feathers_controls_GroupListView.CHILD_VARIANT_ITEM_RENDERER;
						variantItemRenderer.set_variant(variant);
					}
				}
			}
			if(js_Boot.__implements(itemRenderer,feathers_core_IUIControl)) {
				itemRenderer.initializeNow();
			}
			if(storage.measurements == null) {
				storage.measurements = new feathers_layout_Measurements(itemRenderer);
			}
		} else {
			itemRenderer = storage.inactiveItemRenderers.shift();
		}
		this.updateItemRenderer(itemRenderer,state,storage);
		if(state.type == feathers_data_GroupListViewItemType.STANDARD) {
			if(js_Boot.__implements(itemRenderer,feathers_controls_ITriggerView)) {
				itemRenderer.addEventListener("trigger",$bind(this,this.groupListView_itemRenderer_triggerHandler));
			} else {
				itemRenderer.addEventListener("click",$bind(this,this.groupListView_itemRenderer_clickHandler));
				itemRenderer.addEventListener("touchTap",$bind(this,this.groupListView_itemRenderer_touchTapHandler));
			}
			if(js_Boot.__implements(itemRenderer,feathers_controls_IToggle)) {
				itemRenderer.addEventListener("change",$bind(this,this.groupListView_itemRenderer_changeHandler));
			}
		}
		if(js_Boot.__implements(itemRenderer,feathers_core_IMeasureObject)) {
			itemRenderer.addEventListener("resize",$bind(this,this.groupListView_itemRenderer_resizeHandler));
		}
		this.itemRendererToItemState.set(itemRenderer,state);
		var item = state.data;
		if(typeof(item) == "string") {
			this.stringDataToItemRenderer.h[item] = itemRenderer;
		} else {
			this.objectDataToItemRenderer.set(item,itemRenderer);
		}
		storage.activeItemRenderers.push(itemRenderer);
		return itemRenderer;
	}
	,destroyItemRenderer: function(itemRenderer,recycler) {
		this.groupViewPort.removeChild(itemRenderer);
		if(recycler != null && recycler.destroy != null) {
			recycler.destroy(itemRenderer);
		}
	}
	,itemOrHeaderStateToStorage: function(state,recyclerIDFunction,recyclerMap,defaultStorage,additionalStorage) {
		var recyclerID = null;
		if(recyclerIDFunction != null) {
			recyclerID = recyclerIDFunction(state);
		}
		var recycler = null;
		if(recyclerID != null) {
			if(recyclerMap != null) {
				recycler = recyclerMap.h[recyclerID];
			}
			if(recycler == null) {
				throw new openfl_errors_IllegalOperationError("Item renderer recycler ID \"" + recyclerID + "\" is not registered.");
			}
		}
		if(recycler == null) {
			return defaultStorage;
		}
		var _g = 0;
		var _g1 = additionalStorage.length;
		while(_g < _g1) {
			var i = _g++;
			var storage = additionalStorage[i];
			if(storage.itemRendererRecycler == recycler) {
				return storage;
			}
		}
		var storage = new feathers_controls__$GroupListView_ItemRendererStorage(state.type,recyclerID,recycler);
		additionalStorage.push(storage);
		return storage;
	}
	,itemStateToStorage: function(state) {
		if(state.type == feathers_data_GroupListViewItemType.HEADER) {
			return this.itemOrHeaderStateToStorage(state,this._headerRendererRecyclerIDFunction,this._headerRendererRecyclerMap,this._defaultHeaderStorage,this._additionalHeaderStorage);
		}
		return this.itemOrHeaderStateToStorage(state,this._itemRendererRecyclerIDFunction,this._itemRendererRecyclerMap,this._defaultItemStorage,this._additionalItemStorage);
	}
	,populateCurrentItemState: function(item,type,location,layoutIndex,state,force) {
		var changed = false;
		if(force || state.owner != this) {
			state.owner = this;
			changed = true;
		}
		if(force || state.type != type) {
			state.type = type;
			changed = true;
		}
		if(force || state.data != item) {
			state.data = item;
			changed = true;
		}
		if(force || state.location != location && this.compareLocations(state.location,location) != 0) {
			state.location = location;
			changed = true;
		}
		if(force || state.layoutIndex != layoutIndex) {
			state.layoutIndex = layoutIndex;
			changed = true;
		}
		var selected = location.length > 1 && item == this._selectedItem;
		if(force || state.selected != selected) {
			state.selected = selected;
			changed = true;
		}
		var enabled = this._enabled && this.itemToEnabled(item);
		if(force || state.enabled != enabled) {
			state.enabled = enabled;
			changed = true;
		}
		var text = type == feathers_data_GroupListViewItemType.HEADER ? this.itemToHeaderText(item) : this.itemToText(item);
		if(force || state.text != text) {
			state.text = text;
			changed = true;
		}
		return changed;
	}
	,updateItemRenderer: function(itemRenderer,state,storage) {
		state.recyclerID = storage.id;
		var oldIgnoreSelectionChange = this._ignoreSelectionChange;
		this._ignoreSelectionChange = true;
		if(storage.itemRendererRecycler.update != null) {
			storage.itemRendererRecycler.update(itemRenderer,state);
		}
		this._ignoreSelectionChange = oldIgnoreSelectionChange;
		this.refreshItemRendererProperties(itemRenderer,state);
	}
	,resetItemRenderer: function(itemRenderer,state,storage) {
		var recycler = storage.oldItemRendererRecycler != null ? storage.oldItemRendererRecycler : storage.itemRendererRecycler;
		var oldIgnoreSelectionChange = this._ignoreSelectionChange;
		this._ignoreSelectionChange = true;
		if(recycler != null && recycler.reset != null) {
			recycler.reset(itemRenderer,state);
		}
		this._ignoreSelectionChange = oldIgnoreSelectionChange;
		this.refreshItemRendererProperties(itemRenderer,feathers_controls_GroupListView.RESET_ITEM_STATE);
	}
	,refreshItemRendererProperties: function(itemRenderer,state) {
		var oldIgnoreSelectionChange = this._ignoreSelectionChange;
		this._ignoreSelectionChange = true;
		if(js_Boot.__implements(itemRenderer,feathers_core_IUIControl)) {
			var uiControl = itemRenderer;
			uiControl.set_enabled(state.enabled);
		}
		if(js_Boot.__implements(itemRenderer,feathers_controls_dataRenderers_IDataRenderer)) {
			var dataRenderer = itemRenderer;
			dataRenderer.set_data(state.data);
		}
		if(js_Boot.__implements(itemRenderer,feathers_layout_ILayoutIndexObject)) {
			var layoutRenderer = itemRenderer;
			layoutRenderer.set_layoutIndex(state.layoutIndex);
		}
		if(js_Boot.__implements(itemRenderer,feathers_controls_dataRenderers_IGroupListViewItemRenderer)) {
			var groupListRenderer = itemRenderer;
			groupListRenderer.set_location(state.location);
			groupListRenderer.set_groupListViewOwner(state.owner);
		}
		if(js_Boot.__implements(itemRenderer,feathers_controls_IToggle)) {
			var toggle = itemRenderer;
			toggle.set_selected(state.selected);
		}
		this._ignoreSelectionChange = oldIgnoreSelectionChange;
	}
	,refreshSelectedLocationAfterFilterOrSort: function() {
		if(this._selectedLocation == null) {
			return;
		}
		this.set_selectedLocation(this._dataProvider.locationOf(this._selectedItem));
	}
	,calculateTotalLayoutCount: function(location) {
		if(this._dataProvider == null) {
			return 0;
		}
		var itemCount = this._dataProvider.getLength(location);
		var result = itemCount;
		var _g = 0;
		var _g1 = itemCount;
		while(_g < _g1) {
			var i = _g++;
			location.push(i);
			var item = this._dataProvider.get(location);
			if(location.length == 1 && this._dataProvider.isBranch(item)) {
				result += this.calculateTotalLayoutCount(location);
			}
			location.pop();
		}
		return result;
	}
	,containsLocation: function(parent,possibleChild) {
		if(parent == null || possibleChild == null || parent.length >= possibleChild.length) {
			return false;
		}
		var _g = 0;
		var _g1 = parent.length;
		while(_g < _g1) {
			var i = _g++;
			var a = parent[i];
			var b = possibleChild[i];
			if(a != b) {
				return false;
			}
		}
		return true;
	}
	,compareLocations: function(location1,location2) {
		var null1 = location1 == null;
		var null2 = location2 == null;
		if(null1 && null2) {
			return 0;
		} else if(null1) {
			return 1;
		} else if(null2) {
			return -1;
		}
		var length1 = location1.length;
		var length2 = location2.length;
		var min = length1;
		if(length2 < min) {
			min = length2;
		}
		var _g = 0;
		var _g1 = min;
		while(_g < _g1) {
			var i = _g++;
			var index1 = location1[i];
			var index2 = location2[i];
			if(index1 < index2) {
				return -1;
			}
			if(index1 > index2) {
				return 1;
			}
		}
		if(length1 < length2) {
			return -1;
		} else if(length1 > length2) {
			return 1;
		}
		return 0;
	}
	,_currentDisplayIndex: null
	,displayIndexToLocation: function(displayIndex) {
		if(displayIndex < 0) {
			return null;
		}
		this._currentDisplayIndex = -1;
		return this.displayIndexToLocationAtBranch(displayIndex,[]);
	}
	,displayIndexToLocationAtBranch: function(target,locationOfBranch) {
		var _g = 0;
		var _g1 = this._dataProvider.getLength(locationOfBranch);
		while(_g < _g1) {
			var i = _g++;
			this._currentDisplayIndex++;
			locationOfBranch[locationOfBranch.length] = i;
			if(this._currentDisplayIndex == target) {
				return locationOfBranch;
			}
			var child = this._dataProvider.get(locationOfBranch);
			if(locationOfBranch.length == 1 && this._dataProvider.isBranch(child)) {
				var result = this.displayIndexToLocationAtBranch(target,locationOfBranch);
				if(result != null) {
					return result;
				}
			}
			locationOfBranch.length -= 1;
		}
		return null;
	}
	,locationToDisplayIndex: function(location) {
		this._currentDisplayIndex = -1;
		return this.locationToDisplayIndexAtBranch([],location);
	}
	,locationToDisplayIndexAtBranch: function(locationOfBranch,locationToFind) {
		var _g = 0;
		var _g1 = this._dataProvider.getLength(locationOfBranch);
		while(_g < _g1) {
			var i = _g++;
			this._currentDisplayIndex++;
			locationOfBranch[locationOfBranch.length] = i;
			if(this.compareLocations(locationOfBranch,locationToFind) == 0) {
				return this._currentDisplayIndex;
			}
			var child = this._dataProvider.get(locationOfBranch);
			if(locationOfBranch.length == 1 && this._dataProvider.isBranch(child)) {
				var result = this.locationToDisplayIndexAtBranch(locationOfBranch,locationToFind);
				if(result != -1) {
					return result;
				}
			}
			locationOfBranch.length -= 1;
		}
		return -1;
	}
	,isValidLocation: function(location) {
		var locationOfBranch = [];
		var _g = 0;
		while(_g < location.length) {
			var index = location[_g];
			++_g;
			if(index < 0) {
				return false;
			}
			if(index >= this._dataProvider.getLength(locationOfBranch)) {
				return false;
			}
			locationOfBranch.push(index);
		}
		return true;
	}
	,navigateWithKeyboard: function(event) {
		if(event.isDefaultPrevented()) {
			return;
		}
		if(this._layoutItems.length == 0) {
			return;
		}
		var location = null;
		var startIndex = this.locationToDisplayIndex(this._selectedLocation);
		var result = startIndex;
		if(js_Boot.__implements(this.get_layout(),feathers_layout_IKeyboardNavigationLayout)) {
			if(event.keyCode != 38 && event.keyCode != 40 && event.keyCode != 37 && event.keyCode != 39 && event.keyCode != 33 && event.keyCode != 34 && event.keyCode != 36 && event.keyCode != 35) {
				return;
			}
			result = this.get_layout().findNextKeyboardIndex(result,event,false,this._layoutItems,this._layoutHeaderIndices,this.groupViewPort.get_visibleWidth(),this.groupViewPort.get_visibleHeight());
			location = this.displayIndexToLocation(result);
			if(location == null || location.length != 2) {
				return;
			}
		} else {
			var needsAnotherPass = true;
			var nextKeyCode = event.keyCode;
			var lastResult = -1;
			while(needsAnotherPass) {
				needsAnotherPass = false;
				switch(nextKeyCode) {
				case 33:
					--result;
					break;
				case 34:
					++result;
					break;
				case 35:
					result = this._layoutItems.length - 1;
					nextKeyCode = 38;
					break;
				case 36:
					result = 0;
					nextKeyCode = 40;
					break;
				case 37:
					--result;
					break;
				case 38:
					--result;
					break;
				case 39:
					++result;
					break;
				case 40:
					++result;
					break;
				default:
					return;
				}
				if(result < 0) {
					result = 0;
				} else if(result >= this._layoutItems.length) {
					result = this._layoutItems.length - 1;
				}
				location = this.displayIndexToLocation(result);
				if(location.length != 2) {
					if(result == lastResult) {
						return;
					}
					needsAnotherPass = true;
				}
				lastResult = result;
			}
		}
		var changed = result != startIndex;
		if(!changed && result != -1) {
			var itemRenderer = this.itemToItemRenderer(this._dataProvider.get(location));
			if(itemRenderer == null) {
				changed = true;
			} else if(js_Boot.__implements(this.get_layout(),feathers_layout_IScrollLayout)) {
				var scrollLayout = this.get_layout();
				var nearestScrollPosition = scrollLayout.getNearestScrollPositionForIndex(result,this._layoutItems.length,this.get_viewPort().get_visibleWidth(),this.get_viewPort().get_visibleHeight());
				if(this.get_scrollX() != nearestScrollPosition.x || this.get_scrollY() != nearestScrollPosition.y) {
					changed = true;
				}
			}
		}
		if(!changed) {
			return;
		}
		event.preventDefault();
		this.set_selectedLocation(location);
		if(this._selectedLocation != null) {
			this.scrollToLocation(this._selectedLocation);
		}
		if(this._focusManager != null) {
			this._focusManager.set_focus(this);
		} else if(this.stage != null) {
			this.stage.set_focus(this);
		}
	}
	,handleSelectionChange: function(item,location,ctrlKey,shiftKey) {
		if(location == null || location.length != 2 || !this._selectable) {
			this.set_selectedItem(null);
			return;
		}
		this.set_selectedLocation(location);
		if(location != null) {
			this.scrollToLocation(location);
		}
	}
	,handlePendingScroll: function() {
		if(this._pendingScrollLocation == null) {
			return;
		}
		var location = this._pendingScrollLocation;
		var duration = this._pendingScrollDuration != null ? this._pendingScrollDuration : 0.0;
		this._pendingScrollLocation = null;
		this._pendingScrollDuration = null;
		if(this._dataProvider == null || this._dataProvider.getLength() == 0) {
			return;
		}
		var targetX = this.get_scrollX();
		var targetY = this.get_scrollY();
		if(js_Boot.__implements(this.get_layout(),feathers_layout_IScrollLayout)) {
			var displayIndex = this.locationToDisplayIndex(location);
			var scrollLayout = this.get_layout();
			var result = scrollLayout.getNearestScrollPositionForIndex(displayIndex,this._layoutItems.length,this.get_viewPort().get_visibleWidth(),this.get_viewPort().get_visibleHeight());
			targetX = result.x;
			targetY = result.y;
		} else {
			var item = this._dataProvider.get(location);
			var itemRenderer = null;
			if(typeof(item) == "string") {
				itemRenderer = this.stringDataToItemRenderer.h[item];
			} else {
				itemRenderer = this.objectDataToItemRenderer.h[item.__id__];
			}
			if(itemRenderer == null) {
				return;
			}
			var maxX = itemRenderer.get_x();
			var minX = maxX + itemRenderer.get_width() - this.get_viewPort().get_visibleWidth();
			if(targetX < minX) {
				targetX = minX;
			} else if(targetX > maxX) {
				targetX = maxX;
			}
			var maxY = itemRenderer.get_y();
			var minY = maxY + itemRenderer.get_height() - this.get_viewPort().get_visibleHeight();
			if(targetY < minY) {
				targetY = minY;
			} else if(targetY > maxY) {
				targetY = maxY;
			}
		}
		if(duration == 0.0) {
			this.scroller.stop();
			this.scroller.set_scrollX(targetX);
			this.scroller.set_scrollY(targetY);
		} else {
			this.scroller.throwTo(targetX,targetY,duration);
		}
	}
	,baseScrollContainer_keyDownHandler: function(event) {
		if(!this._selectable) {
			feathers_controls_supportClasses_BaseScrollContainer.prototype.baseScrollContainer_keyDownHandler.call(this,event);
			return;
		}
		if(!this._enabled || event.isDefaultPrevented()) {
			return;
		}
		if(this.stage != null && ((this.stage.get_focus()) instanceof openfl_text_TextField)) {
			var textField = this.stage.get_focus();
			if(textField.get_type() == 1) {
				return;
			}
		}
		this.navigateWithKeyboard(event);
	}
	,groupListView_keyDownHandler: function(event) {
		if(!this._enabled || event.isDefaultPrevented()) {
			return;
		}
		if(event.keyCode == 32 || event.keyCode == 13) {
			if(this._selectedItem != null) {
				var itemRenderer = null;
				if(typeof(this._selectedItem) == "string") {
					itemRenderer = this.stringDataToItemRenderer.h[this._selectedItem];
				} else {
					itemRenderer = this.objectDataToItemRenderer.h[this._selectedItem.__id__];
				}
				var state = null;
				if(itemRenderer != null) {
					state = this.itemRendererToItemState.h[itemRenderer.__id__];
				}
				var isTemporary = false;
				if(state == null) {
					isTemporary = true;
					state = this.itemStatePool.get();
				}
				var type = this._selectedLocation.length == 1 ? feathers_data_GroupListViewItemType.HEADER : feathers_data_GroupListViewItemType.STANDARD;
				var layoutIndex = this.locationToDisplayIndex(this._selectedLocation);
				this.populateCurrentItemState(this._selectedItem,type,this._selectedLocation,layoutIndex,state,true);
				feathers_events_GroupListViewEvent.dispatch(this,"itemTrigger",state);
				if(isTemporary) {
					this.itemStatePool.release(state);
				}
			}
		}
	}
	,groupListView_itemRenderer_touchTapHandler: function(event) {
		if(!this._enabled) {
			return;
		}
		if(event.isPrimaryTouchPoint) {
			return;
		}
		var itemRenderer = js_Boot.__cast(event.currentTarget , openfl_display_DisplayObject);
		var state = this.itemRendererToItemState.h[itemRenderer.__id__];
		feathers_events_GroupListViewEvent.dispatch(this,"itemTrigger",state);
		if(!this._selectable || !this.pointerSelectionEnabled) {
			return;
		}
		this.handleSelectionChange(state.data,state.location,event.ctrlKey,event.shiftKey);
	}
	,groupListView_itemRenderer_clickHandler: function(event) {
		if(!this._enabled) {
			return;
		}
		var itemRenderer = js_Boot.__cast(event.currentTarget , openfl_display_DisplayObject);
		var state = this.itemRendererToItemState.h[itemRenderer.__id__];
		feathers_events_GroupListViewEvent.dispatch(this,"itemTrigger",state);
		if(!this._selectable || !this.pointerSelectionEnabled) {
			return;
		}
		this.handleSelectionChange(state.data,state.location,event.ctrlKey,event.shiftKey);
	}
	,groupListView_itemRenderer_triggerHandler: function(event) {
		if(!this._enabled) {
			return;
		}
		var itemRenderer = js_Boot.__cast(event.currentTarget , openfl_display_DisplayObject);
		var state = this.itemRendererToItemState.h[itemRenderer.__id__];
		feathers_events_GroupListViewEvent.dispatch(this,"itemTrigger",state);
		if(!this._selectable) {
			return;
		}
		this.handleSelectionChange(state.data,state.location,event.ctrlKey,event.shiftKey);
	}
	,groupListView_itemRenderer_resizeHandler: function(event) {
		if(this._validating) {
			return;
		}
		this.setInvalid(feathers_core_InvalidationFlag.LAYOUT);
	}
	,groupListView_itemRenderer_changeHandler: function(event) {
		if(this._ignoreSelectionChange) {
			return;
		}
		var itemRenderer = js_Boot.__cast(event.currentTarget , openfl_display_DisplayObject);
		var toggleItemRenderer = js_Boot.__cast(itemRenderer , feathers_controls_IToggle);
		var state = this.itemRendererToItemState.h[itemRenderer.__id__];
		if(toggleItemRenderer.get_selected() == state.selected) {
			return;
		}
		this.setInvalid(feathers_core_InvalidationFlag.SELECTION);
	}
	,groupListView_dataProvider_changeHandler: function(event) {
		this._totalLayoutCount = this.calculateTotalLayoutCount([]);
		if(this._virtualCache != null) {
			this._virtualCache.length = 0;
			this._virtualCache.length = this._totalLayoutCount;
		}
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
	}
	,groupListView_dataProvider_addItemHandler: function(event) {
		if(this._selectedLocation == null) {
			return;
		}
		if(this.compareLocations(this._selectedLocation,event.location) >= 0) {
			this.set_selectedLocation(this._dataProvider.locationOf(this._selectedItem));
		}
	}
	,groupListView_dataProvider_removeItemHandler: function(event) {
		if(this._selectedLocation != null) {
			if(this.containsLocation(event.location,this._selectedLocation)) {
				this.set_selectedLocation(null);
			} else {
				var comparisonResult = this.compareLocations(this._selectedLocation,event.location);
				if(comparisonResult == 0) {
					this.set_selectedLocation(null);
				} else if(comparisonResult > 0) {
					this.set_selectedLocation(this._dataProvider.locationOf(this._selectedItem));
				}
			}
		}
	}
	,groupListView_dataProvider_replaceItemHandler: function(event) {
		if(this._selectedLocation != null) {
			if(this.containsLocation(event.location,this._selectedLocation)) {
				this.set_selectedLocation(null);
			} else if(this.compareLocations(this._selectedLocation,event.location) == 0) {
				this._selectedItem = this._dataProvider.get(event.location);
				feathers_events_FeathersEvent.dispatch(this,"change");
			}
		}
	}
	,groupListView_dataProvider_removeAllHandler: function(event) {
		this.set_selectedLocation(null);
	}
	,groupListView_dataProvider_resetHandler: function(event) {
		this.set_selectedLocation(null);
	}
	,groupListView_dataProvider_sortChangeHandler: function(event) {
		this.refreshSelectedLocationAfterFilterOrSort();
	}
	,groupListView_dataProvider_filterChangeHandler: function(event) {
		this.refreshSelectedLocationAfterFilterOrSort();
	}
	,updateItemRendererForLocation: function(location) {
		var layoutIndex = this.locationToDisplayIndex(location);
		if(this._virtualCache != null) {
			this._virtualCache[layoutIndex] = null;
		}
		var item = this._dataProvider.get(location);
		var type = location.length == 1 ? feathers_data_GroupListViewItemType.HEADER : feathers_data_GroupListViewItemType.STANDARD;
		var itemRenderer = null;
		if(typeof(item) == "string") {
			itemRenderer = this.stringDataToItemRenderer.h[item];
		} else {
			itemRenderer = this.objectDataToItemRenderer.h[item.__id__];
		}
		if(itemRenderer == null) {
			this.setInvalid(feathers_core_InvalidationFlag.DATA);
		} else {
			var state = this.itemRendererToItemState.h[itemRenderer.__id__];
			if(state.owner != null) {
				var storage = this.itemStateToStorage(state);
				this.populateCurrentItemState(item,type,location,layoutIndex,state,true);
				this.resetItemRenderer(itemRenderer,state,storage);
				if(storage.measurements != null) {
					storage.measurements.restore(itemRenderer);
				}
				state.owner = null;
				this.setInvalid(feathers_core_InvalidationFlag.DATA);
			}
		}
		if(type == feathers_data_GroupListViewItemType.HEADER) {
			var _g = 0;
			var _g1 = this._dataProvider.getLength(location);
			while(_g < _g1) {
				var i = _g++;
				location.push(i);
				this.updateItemRendererForLocation(location);
				location.pop();
			}
		}
	}
	,groupListView_dataProvider_updateItemHandler: function(event) {
		this.updateItemRendererForLocation(event.location);
	}
	,groupListView_dataProvider_updateAllHandler: function(event) {
		var location = [];
		var _g = 0;
		var _g1 = this._dataProvider.getLength();
		while(_g < _g1) {
			var i = _g++;
			location[0] = i;
			this.updateItemRendererForLocation(location);
		}
	}
	,get_styleContext: function() {
		return feathers_controls_GroupListView;
	}
	,__layout: null
	,get_layout: function() {
		return this.__layout;
	}
	,set_layout: function(value) {
		if(!this.setStyle("layout")) {
			return this.__layout;
		}
		if(this.__layout == value) {
			return this.__layout;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_layout);
		this.__layout = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__layout;
	}
	,clearStyle_layout: function() {
		this.set_layout(null);
		return this.get_layout();
	}
	,__customHeaderRendererVariant: null
	,get_customHeaderRendererVariant: function() {
		return this.__customHeaderRendererVariant;
	}
	,set_customHeaderRendererVariant: function(value) {
		if(!this.setStyle("customHeaderRendererVariant")) {
			return this.__customHeaderRendererVariant;
		}
		if(this.__customHeaderRendererVariant == value) {
			return this.__customHeaderRendererVariant;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_customHeaderRendererVariant);
		this.__customHeaderRendererVariant = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__customHeaderRendererVariant;
	}
	,clearStyle_customHeaderRendererVariant: function() {
		this.set_customHeaderRendererVariant(null);
		return this.get_customHeaderRendererVariant();
	}
	,__customItemRendererVariant: null
	,get_customItemRendererVariant: function() {
		return this.__customItemRendererVariant;
	}
	,set_customItemRendererVariant: function(value) {
		if(!this.setStyle("customItemRendererVariant")) {
			return this.__customItemRendererVariant;
		}
		if(this.__customItemRendererVariant == value) {
			return this.__customItemRendererVariant;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_customItemRendererVariant);
		this.__customItemRendererVariant = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__customItemRendererVariant;
	}
	,clearStyle_customItemRendererVariant: function() {
		this.set_customItemRendererVariant(null);
		return this.get_customItemRendererVariant();
	}
	,__class__: feathers_controls_GroupListView
	,__properties__: $extend(feathers_controls_supportClasses_BaseScrollContainer.prototype.__properties__,{set_virtualLayout:"set_virtualLayout",get_virtualLayout:"get_virtualLayout",set_selectable:"set_selectable",get_selectable:"get_selectable",set_headerRendererRecyclerIDFunction:"set_headerRendererRecyclerIDFunction",get_headerRendererRecyclerIDFunction:"get_headerRendererRecyclerIDFunction",set_itemRendererRecyclerIDFunction:"set_itemRendererRecyclerIDFunction",get_itemRendererRecyclerIDFunction:"get_itemRendererRecyclerIDFunction",set_headerRendererRecycler:"set_headerRendererRecycler",get_headerRendererRecycler:"get_headerRendererRecycler",set_itemRendererRecycler:"set_itemRendererRecycler",get_itemRendererRecycler:"get_itemRendererRecycler",set_forceItemStateUpdate:"set_forceItemStateUpdate",get_forceItemStateUpdate:"get_forceItemStateUpdate",set_customItemRendererVariant:"set_customItemRendererVariant",get_customItemRendererVariant:"get_customItemRendererVariant",set_customHeaderRendererVariant:"set_customHeaderRendererVariant",get_customHeaderRendererVariant:"get_customHeaderRendererVariant",set_layout:"set_layout",get_layout:"get_layout",set_selectedItem:"set_selectedItem",get_selectedItem:"get_selectedItem",set_selectedLocation:"set_selectedLocation",get_selectedLocation:"get_selectedLocation",set_dataProvider:"set_dataProvider",get_dataProvider:"get_dataProvider",set_childFocusEnabled:"set_childFocusEnabled",get_childFocusEnabled:"get_childFocusEnabled"})
});
var feathers_controls__$GroupListView_ItemRendererStorage = function(type,id,recycler) {
	this.inactiveItemRenderers = [];
	this.activeItemRenderers = [];
	this.type = type;
	this.id = id;
	this.itemRendererRecycler = recycler;
};
$hxClasses["feathers.controls._GroupListView.ItemRendererStorage"] = feathers_controls__$GroupListView_ItemRendererStorage;
feathers_controls__$GroupListView_ItemRendererStorage.__name__ = "feathers.controls._GroupListView.ItemRendererStorage";
feathers_controls__$GroupListView_ItemRendererStorage.prototype = {
	type: null
	,id: null
	,oldItemRendererRecycler: null
	,itemRendererRecycler: null
	,activeItemRenderers: null
	,inactiveItemRenderers: null
	,measurements: null
	,__class__: feathers_controls__$GroupListView_ItemRendererStorage
};
var feathers_controls_supportClasses_BaseProgressBar = function(value,minimum,maximum,changeListener) {
	if(maximum == null) {
		maximum = 1.0;
	}
	if(minimum == null) {
		minimum = 0.0;
	}
	if(value == null) {
		value = 0.0;
	}
	this.__paddingLeft = 0.0;
	this.__paddingBottom = 0.0;
	this.__paddingRight = 0.0;
	this.__paddingTop = 0.0;
	this.__indeterminateDuration = 0.75;
	this.__indeterminateFillSkin = null;
	this.__fillMode = feathers_controls_ProgressBarFillMode.RESIZE;
	this.__disabledFillSkin = null;
	this.__fillSkin = null;
	this.__disabledBackgroundSkin = null;
	this.__backgroundSkin = null;
	this._currentFillSkin = null;
	this._fillSkinMeasurements = null;
	this._currentBackgroundSkin = null;
	this._backgroundSkinMeasurements = null;
	this._indeterminate = false;
	this._reversedIndeterminate = false;
	this._indeterminateActive = false;
	this._maximum = 1.0;
	this._minimum = 0.0;
	this._value = 0.0;
	feathers_core_FeathersControl.call(this);
	this.set_minimum(minimum);
	this.set_maximum(maximum);
	this.set_value(value);
	if(changeListener != null) {
		this.addEventListener("change",changeListener);
	}
};
$hxClasses["feathers.controls.supportClasses.BaseProgressBar"] = feathers_controls_supportClasses_BaseProgressBar;
feathers_controls_supportClasses_BaseProgressBar.__name__ = "feathers.controls.supportClasses.BaseProgressBar";
feathers_controls_supportClasses_BaseProgressBar.__interfaces__ = [feathers_controls_IRange];
feathers_controls_supportClasses_BaseProgressBar.__super__ = feathers_core_FeathersControl;
feathers_controls_supportClasses_BaseProgressBar.prototype = $extend(feathers_core_FeathersControl.prototype,{
	_value: null
	,get_value: function() {
		return this._value;
	}
	,set_value: function(value) {
		if(this._value == value) {
			return this._value;
		}
		this._value = value;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._value;
	}
	,_minimum: null
	,get_minimum: function() {
		return this._minimum;
	}
	,set_minimum: function(value) {
		if(this._minimum == value) {
			return this._minimum;
		}
		this._minimum = value;
		if(this.get_initialized() && this._value < this._minimum) {
			this.set_value(this._minimum);
		}
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		return this._minimum;
	}
	,_maximum: null
	,get_maximum: function() {
		return this._maximum;
	}
	,set_maximum: function(value) {
		if(this._maximum == value) {
			return this._maximum;
		}
		this._maximum = value;
		if(this.get_initialized() && this._value > this._maximum) {
			this.set_value(this._maximum);
		}
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		return this._maximum;
	}
	,_indeterminateActive: null
	,_lastIndeterminateUpdateTime: null
	,_reversedIndeterminate: null
	,_savedIndeterminateFillSkinAlpha: null
	,_indeterminate: null
	,get_indeterminate: function() {
		return this._indeterminate;
	}
	,set_indeterminate: function(value) {
		if(this._indeterminate == value) {
			return this._indeterminate;
		}
		this._indeterminate = value;
		this.setInvalid(feathers_core_InvalidationFlag.STATE);
		return this._indeterminate;
	}
	,_backgroundSkinMeasurements: null
	,_currentBackgroundSkin: null
	,_fillSkinMeasurements: null
	,_currentFillSkin: null
	,setPadding: function(value) {
		this.set_paddingTop(value);
		this.set_paddingRight(value);
		this.set_paddingBottom(value);
		this.set_paddingLeft(value);
	}
	,update: function() {
		var stylesInvalid = this.isInvalid(feathers_core_InvalidationFlag.STYLES);
		var stateInvalid = this.isInvalid(feathers_core_InvalidationFlag.STATE);
		if(stylesInvalid || stateInvalid) {
			this.refreshBackgroundSkin();
			this.refreshFillSkin();
		}
		this.measure();
		this.layoutContent();
	}
	,measure: function() {
		var c = js_Boot.getClass(this);
		throw new openfl_errors_TypeError("Missing override for 'measure' in type " + c.__name__);
	}
	,refreshBackgroundSkin: function() {
		var oldSkin = this._currentBackgroundSkin;
		this._currentBackgroundSkin = this.getCurrentBackgroundSkin();
		if(this._currentBackgroundSkin == oldSkin) {
			return;
		}
		this.removeCurrentBackgroundSkin(oldSkin);
		this.addCurrentBackgroundSkin(this._currentBackgroundSkin);
	}
	,getCurrentBackgroundSkin: function() {
		if(!this._enabled && this.get_disabledBackgroundSkin() != null) {
			return this.get_disabledBackgroundSkin();
		}
		return this.get_backgroundSkin();
	}
	,addCurrentBackgroundSkin: function(skin) {
		if(skin == null) {
			this._backgroundSkinMeasurements = null;
			return;
		}
		if(js_Boot.__implements(skin,feathers_core_IUIControl)) {
			skin.initializeNow();
		}
		if(this._backgroundSkinMeasurements == null) {
			this._backgroundSkinMeasurements = new feathers_layout_Measurements(skin);
		} else {
			this._backgroundSkinMeasurements.save(skin);
		}
		if(js_Boot.__implements(skin,feathers_skins_IProgrammaticSkin)) {
			skin.set_uiContext(this);
		}
		this.addChildAt(skin,0);
	}
	,removeCurrentBackgroundSkin: function(skin) {
		if(skin == null) {
			return;
		}
		if(js_Boot.__implements(skin,feathers_skins_IProgrammaticSkin)) {
			skin.set_uiContext(null);
		}
		this._backgroundSkinMeasurements.restore(skin);
		if(skin.parent == this) {
			this.removeChild(skin);
		}
	}
	,refreshFillSkin: function() {
		var oldSkin = this._currentFillSkin;
		this._currentFillSkin = this.getCurrentFillSkin();
		if(this._currentFillSkin != oldSkin) {
			this.removeCurrentFillSkin(oldSkin);
			this.addCurrentFillSkin(this._currentFillSkin);
		}
		if(!this._indeterminate && this._indeterminateActive && oldSkin != null) {
			oldSkin.set_alpha(this._savedIndeterminateFillSkinAlpha);
			this._indeterminateActive = false;
			this.removeEventListener("enterFrame",$bind(this,this.baseProgressBar_enterFrameHandler));
		} else if(this._indeterminate && !this._indeterminateActive && this._currentFillSkin != null) {
			this._savedIndeterminateFillSkinAlpha = this._currentFillSkin.get_alpha();
			this._indeterminateActive = true;
			this._lastIndeterminateUpdateTime = openfl_Lib.getTimer();
			this.addEventListener("enterFrame",$bind(this,this.baseProgressBar_enterFrameHandler));
		}
	}
	,getCurrentFillSkin: function() {
		if(!this._enabled && this.get_disabledFillSkin() != null) {
			return this.get_disabledFillSkin();
		}
		if(this._indeterminate && this.get_indeterminateFillSkin() != null) {
			return this.get_indeterminateFillSkin();
		}
		return this.get_fillSkin();
	}
	,addCurrentFillSkin: function(skin) {
		if(skin == null) {
			this._fillSkinMeasurements = null;
			return;
		}
		if(js_Boot.__implements(skin,feathers_core_IUIControl)) {
			skin.initializeNow();
		}
		if(this._fillSkinMeasurements == null) {
			this._fillSkinMeasurements = new feathers_layout_Measurements(skin);
		} else {
			this._fillSkinMeasurements.save(skin);
		}
		if(js_Boot.__implements(skin,feathers_skins_IProgrammaticSkin)) {
			skin.set_uiContext(this);
		}
		this.addChild(skin);
	}
	,removeCurrentFillSkin: function(skin) {
		if(skin == null) {
			return;
		}
		if(js_Boot.__implements(skin,feathers_skins_IProgrammaticSkin)) {
			skin.set_uiContext(null);
		}
		if(skin.parent == this) {
			this.removeChild(skin);
		}
	}
	,layoutContent: function() {
		this.layoutBackground();
		this.layoutFill();
	}
	,layoutBackground: function() {
		var c = js_Boot.getClass(this);
		throw new openfl_errors_TypeError("Missing override for 'layoutBackground' in type " + c.__name__);
	}
	,layoutFill: function() {
		var c = js_Boot.getClass(this);
		throw new openfl_errors_TypeError("Missing override for 'layoutFill' in type " + c.__name__);
	}
	,baseProgressBar_enterFrameHandler: function(event) {
		if(!this._enabled || !this.get_visible() || !this._indeterminate) {
			return;
		}
		var currentTime = openfl_Lib.getTimer();
		var ratio = (currentTime - this._lastIndeterminateUpdateTime) / (this.get_indeterminateDuration() * 1000.0);
		if(ratio >= 1.0) {
			ratio -= Math.floor(ratio);
			this._lastIndeterminateUpdateTime = currentTime;
			this._reversedIndeterminate = !this._reversedIndeterminate;
		}
		if(js_Boot.__implements(this._currentFillSkin,feathers_skins_IIndeterminateSkin)) {
			var activitySkin = this._currentFillSkin;
			activitySkin.set_indeterminatePosition(ratio);
		} else {
			this._currentFillSkin.set_alpha(this._savedIndeterminateFillSkinAlpha * (this._reversedIndeterminate ? 1.0 - ratio : ratio));
		}
	}
	,__backgroundSkin: null
	,get_backgroundSkin: function() {
		return this.__backgroundSkin;
	}
	,set_backgroundSkin: function(value) {
		if(!this.setStyle("backgroundSkin")) {
			return this.__backgroundSkin;
		}
		if(this.__backgroundSkin == value) {
			return this.__backgroundSkin;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_backgroundSkin);
		this.__backgroundSkin = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__backgroundSkin;
	}
	,clearStyle_backgroundSkin: function() {
		this.set_backgroundSkin(null);
		return this.get_backgroundSkin();
	}
	,__disabledBackgroundSkin: null
	,get_disabledBackgroundSkin: function() {
		return this.__disabledBackgroundSkin;
	}
	,set_disabledBackgroundSkin: function(value) {
		if(!this.setStyle("disabledBackgroundSkin")) {
			return this.__disabledBackgroundSkin;
		}
		if(this.__disabledBackgroundSkin == value) {
			return this.__disabledBackgroundSkin;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_disabledBackgroundSkin);
		this.__disabledBackgroundSkin = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__disabledBackgroundSkin;
	}
	,clearStyle_disabledBackgroundSkin: function() {
		this.set_disabledBackgroundSkin(null);
		return this.get_disabledBackgroundSkin();
	}
	,__fillSkin: null
	,get_fillSkin: function() {
		return this.__fillSkin;
	}
	,set_fillSkin: function(value) {
		if(!this.setStyle("fillSkin")) {
			return this.__fillSkin;
		}
		if(this.__fillSkin == value) {
			return this.__fillSkin;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_fillSkin);
		this.__fillSkin = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__fillSkin;
	}
	,clearStyle_fillSkin: function() {
		this.set_fillSkin(null);
		return this.get_fillSkin();
	}
	,__disabledFillSkin: null
	,get_disabledFillSkin: function() {
		return this.__disabledFillSkin;
	}
	,set_disabledFillSkin: function(value) {
		if(!this.setStyle("disabledFillSkin")) {
			return this.__disabledFillSkin;
		}
		if(this.__disabledFillSkin == value) {
			return this.__disabledFillSkin;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_disabledFillSkin);
		this.__disabledFillSkin = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__disabledFillSkin;
	}
	,clearStyle_disabledFillSkin: function() {
		this.set_disabledFillSkin(null);
		return this.get_disabledFillSkin();
	}
	,__fillMode: null
	,get_fillMode: function() {
		return this.__fillMode;
	}
	,set_fillMode: function(value) {
		if(!this.setStyle("fillMode")) {
			return this.__fillMode;
		}
		if(this.__fillMode == value) {
			return this.__fillMode;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_fillMode);
		this.__fillMode = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__fillMode;
	}
	,clearStyle_fillMode: function() {
		this.set_fillMode(feathers_controls_ProgressBarFillMode.RESIZE);
		return this.get_fillMode();
	}
	,__indeterminateFillSkin: null
	,get_indeterminateFillSkin: function() {
		return this.__indeterminateFillSkin;
	}
	,set_indeterminateFillSkin: function(value) {
		if(!this.setStyle("indeterminateFillSkin")) {
			return this.__indeterminateFillSkin;
		}
		if(this.__indeterminateFillSkin == value) {
			return this.__indeterminateFillSkin;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_indeterminateFillSkin);
		this.__indeterminateFillSkin = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__indeterminateFillSkin;
	}
	,clearStyle_indeterminateFillSkin: function() {
		this.set_indeterminateFillSkin(null);
		return this.get_indeterminateFillSkin();
	}
	,__indeterminateDuration: null
	,get_indeterminateDuration: function() {
		return this.__indeterminateDuration;
	}
	,set_indeterminateDuration: function(value) {
		if(!this.setStyle("indeterminateDuration")) {
			return this.__indeterminateDuration;
		}
		if(this.__indeterminateDuration == value) {
			return this.__indeterminateDuration;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_indeterminateDuration);
		this.__indeterminateDuration = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__indeterminateDuration;
	}
	,clearStyle_indeterminateDuration: function() {
		this.set_indeterminateDuration(0.75);
		return this.get_indeterminateDuration();
	}
	,__paddingTop: null
	,get_paddingTop: function() {
		return this.__paddingTop;
	}
	,set_paddingTop: function(value) {
		if(!this.setStyle("paddingTop")) {
			return this.__paddingTop;
		}
		if(this.__paddingTop == value) {
			return this.__paddingTop;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_paddingTop);
		this.__paddingTop = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__paddingTop;
	}
	,clearStyle_paddingTop: function() {
		this.set_paddingTop(0.0);
		return this.get_paddingTop();
	}
	,__paddingRight: null
	,get_paddingRight: function() {
		return this.__paddingRight;
	}
	,set_paddingRight: function(value) {
		if(!this.setStyle("paddingRight")) {
			return this.__paddingRight;
		}
		if(this.__paddingRight == value) {
			return this.__paddingRight;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_paddingRight);
		this.__paddingRight = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__paddingRight;
	}
	,clearStyle_paddingRight: function() {
		this.set_paddingRight(0.0);
		return this.get_paddingRight();
	}
	,__paddingBottom: null
	,get_paddingBottom: function() {
		return this.__paddingBottom;
	}
	,set_paddingBottom: function(value) {
		if(!this.setStyle("paddingBottom")) {
			return this.__paddingBottom;
		}
		if(this.__paddingBottom == value) {
			return this.__paddingBottom;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_paddingBottom);
		this.__paddingBottom = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__paddingBottom;
	}
	,clearStyle_paddingBottom: function() {
		this.set_paddingBottom(0.0);
		return this.get_paddingBottom();
	}
	,__paddingLeft: null
	,get_paddingLeft: function() {
		return this.__paddingLeft;
	}
	,set_paddingLeft: function(value) {
		if(!this.setStyle("paddingLeft")) {
			return this.__paddingLeft;
		}
		if(this.__paddingLeft == value) {
			return this.__paddingLeft;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_paddingLeft);
		this.__paddingLeft = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__paddingLeft;
	}
	,clearStyle_paddingLeft: function() {
		this.set_paddingLeft(0.0);
		return this.get_paddingLeft();
	}
	,__class__: feathers_controls_supportClasses_BaseProgressBar
	,__properties__: $extend(feathers_core_FeathersControl.prototype.__properties__,{set_paddingLeft:"set_paddingLeft",get_paddingLeft:"get_paddingLeft",set_paddingBottom:"set_paddingBottom",get_paddingBottom:"get_paddingBottom",set_paddingRight:"set_paddingRight",get_paddingRight:"get_paddingRight",set_paddingTop:"set_paddingTop",get_paddingTop:"get_paddingTop",set_indeterminateDuration:"set_indeterminateDuration",get_indeterminateDuration:"get_indeterminateDuration",set_indeterminateFillSkin:"set_indeterminateFillSkin",get_indeterminateFillSkin:"get_indeterminateFillSkin",set_fillMode:"set_fillMode",get_fillMode:"get_fillMode",set_disabledFillSkin:"set_disabledFillSkin",get_disabledFillSkin:"get_disabledFillSkin",set_fillSkin:"set_fillSkin",get_fillSkin:"get_fillSkin",set_disabledBackgroundSkin:"set_disabledBackgroundSkin",get_disabledBackgroundSkin:"get_disabledBackgroundSkin",set_backgroundSkin:"set_backgroundSkin",get_backgroundSkin:"get_backgroundSkin",set_indeterminate:"set_indeterminate",get_indeterminate:"get_indeterminate",set_maximum:"set_maximum",get_maximum:"get_maximum",set_minimum:"set_minimum",get_minimum:"get_minimum",set_value:"set_value",get_value:"get_value"})
});
var feathers_controls_HProgressBar = function(value,minimum,maximum,changeListener) {
	if(maximum == null) {
		maximum = 1.0;
	}
	if(minimum == null) {
		minimum = 0.0;
	}
	if(value == null) {
		value = 0.0;
	}
	this.initializeHProgressBarTheme();
	feathers_controls_supportClasses_BaseProgressBar.call(this,value,minimum,maximum,changeListener);
};
$hxClasses["feathers.controls.HProgressBar"] = feathers_controls_HProgressBar;
feathers_controls_HProgressBar.__name__ = "feathers.controls.HProgressBar";
feathers_controls_HProgressBar.__super__ = feathers_controls_supportClasses_BaseProgressBar;
feathers_controls_HProgressBar.prototype = $extend(feathers_controls_supportClasses_BaseProgressBar.prototype,{
	_currentMask: null
	,initializeHProgressBarTheme: function() {
		feathers_themes_steel_components_SteelHProgressBarStyles.initialize();
	}
	,measure: function() {
		var needsWidth = this.get_explicitWidth() == null;
		var needsHeight = this.get_explicitHeight() == null;
		var needsMinWidth = this.get_explicitMinWidth() == null;
		var needsMinHeight = this.get_explicitMinHeight() == null;
		var needsMaxWidth = this.get_explicitMaxWidth() == null;
		var needsMaxHeight = this.get_explicitMaxHeight() == null;
		if(!needsWidth && !needsHeight && !needsMinWidth && !needsMinHeight && !needsMaxWidth && !needsMaxHeight) {
			return false;
		}
		if(this._backgroundSkinMeasurements != null) {
			feathers_utils_MeasurementsUtil.resetFluidlyWithParent(this._backgroundSkinMeasurements,this._currentBackgroundSkin,this);
		}
		var measureBackgroundSkin = null;
		if(js_Boot.__implements(this._currentBackgroundSkin,feathers_core_IMeasureObject)) {
			measureBackgroundSkin = this._currentBackgroundSkin;
		}
		if(js_Boot.__implements(this._currentBackgroundSkin,feathers_core_IValidating)) {
			this._currentBackgroundSkin.validateNow();
		}
		var newWidth = this.get_explicitWidth();
		if(needsWidth) {
			if(this._currentBackgroundSkin != null) {
				newWidth = this._backgroundSkinMeasurements.width;
			} else {
				newWidth = 0.0;
			}
		}
		var newHeight = this.get_explicitHeight();
		if(needsHeight) {
			if(this._currentBackgroundSkin != null) {
				newHeight = this._backgroundSkinMeasurements.height;
			} else {
				newHeight = 0.0;
			}
		}
		var newMinWidth = this.get_explicitMinWidth();
		var needsMinWidth1 = needsMinWidth;
		var newMinHeight = this.get_explicitMinHeight();
		var needsMinHeight1 = needsMinHeight;
		var newMaxWidth = this.get_explicitMaxWidth();
		var needsMaxWidth1 = needsMaxWidth;
		var newMaxHeight = this.get_explicitMaxHeight();
		var needsMaxHeight1 = needsMaxHeight;
		return this.saveMeasurements(newWidth,newHeight,newMinWidth,newMinHeight,newMaxWidth,newMaxHeight);
	}
	,layoutBackground: function() {
		if(this._currentBackgroundSkin == null) {
			return;
		}
		this._currentBackgroundSkin.set_x(0.0);
		this._currentBackgroundSkin.set_y(0.0);
		if(this._currentBackgroundSkin.get_width() != this.actualWidth) {
			this._currentBackgroundSkin.set_width(this.actualWidth);
		}
		if(this._currentBackgroundSkin.get_height() != this.actualHeight) {
			this._currentBackgroundSkin.set_height(this.actualHeight);
		}
		if(js_Boot.__implements(this._currentBackgroundSkin,feathers_core_IValidating)) {
			this._currentBackgroundSkin.validateNow();
		}
	}
	,layoutFill: function() {
		if(this._currentFillSkin == null) {
			return;
		}
		var percentage = 1.0;
		if(this._minimum != this._maximum) {
			percentage = (this._value - this._minimum) / (this._maximum - this._minimum);
			if(percentage < 0.0) {
				percentage = 0.0;
			} else if(percentage > 1.0) {
				percentage = 1.0;
			}
		}
		var maxWidth = this.actualWidth - this.get_paddingLeft() - this.get_paddingRight();
		var calculatedWidth = this._indeterminate ? maxWidth : Math.round(percentage * maxWidth);
		this._currentFillSkin.set_x(this.get_paddingLeft());
		this._currentFillSkin.set_y(this.get_paddingTop());
		this._currentFillSkin.set_height(this.actualHeight - this.get_paddingTop() - this.get_paddingBottom());
		switch(this.get_fillMode()._hx_index) {
		case 0:
			this._currentFillSkin.set_scrollRect(null);
			if(this._currentMask == null) {
				this._currentMask = new feathers_skins_RectangleSkin(feathers_graphics_FillStyle.SolidColor(16711935));
				this.addChild(this._currentMask);
			}
			this._currentFillSkin.set_mask(this._currentMask);
			this._currentFillSkin.set_width(this.actualWidth - this.get_paddingLeft() - this.get_paddingRight());
			this._currentMask.set_x(this._currentFillSkin.get_x());
			this._currentMask.set_y(this._currentFillSkin.get_y());
			this._currentMask.set_width(calculatedWidth);
			this._currentMask.set_height(this._currentFillSkin.get_height());
			break;
		case 1:
			this._currentFillSkin.set_width(this.actualWidth - this.get_paddingLeft() - this.get_paddingRight());
			this._currentFillSkin.set_scrollRect(new openfl_geom_Rectangle(0.0,0.0,calculatedWidth,this._currentFillSkin.get_height()));
			break;
		case 2:
			this._currentFillSkin.set_mask(null);
			this._currentFillSkin.set_scrollRect(null);
			if(this._currentMask != null) {
				if(this._currentMask.parent == this) {
					this.removeChild(this._currentMask);
				}
				this._currentMask = null;
			}
			if(this._fillSkinMeasurements.minWidth != null && calculatedWidth < this._fillSkinMeasurements.minWidth) {
				calculatedWidth = this._fillSkinMeasurements.minWidth;
				this._currentFillSkin.set_visible(this._value > this._minimum);
			} else {
				this._currentFillSkin.set_visible(true);
			}
			this._currentFillSkin.set_width(calculatedWidth);
			break;
		}
		if(js_Boot.__implements(this._currentFillSkin,feathers_core_IValidating)) {
			this._currentFillSkin.validateNow();
		}
	}
	,get_styleContext: function() {
		return feathers_controls_HProgressBar;
	}
	,__class__: feathers_controls_HProgressBar
});
var feathers_controls_supportClasses_BaseSlider = function(value,minimum,maximum,changeListener) {
	if(maximum == null) {
		maximum = 1.0;
	}
	if(minimum == null) {
		minimum = 0.0;
	}
	if(value == null) {
		value = 0.0;
	}
	this.__maximumPadding = 0.0;
	this.__minimumPadding = 0.0;
	this.__secondaryTrackSkin = null;
	this.__trackSkin = null;
	this.__thumbSkin = null;
	this._thumbStartY = 0.0;
	this._thumbStartX = 0.0;
	this._pointerStartY = 0.0;
	this._pointerStartX = 0.0;
	this._dragging = false;
	this._secondaryTrackSkinMeasurements = null;
	this._currentSecondaryTrackSkin = null;
	this._trackSkinMeasurements = null;
	this._currentTrackSkin = null;
	this._thumbSkinMeasurements = null;
	this._currentThumbSkin = null;
	this.liveDragging = true;
	this._snapInterval = 0.0;
	this._step = 0.01;
	this._maximum = 1.0;
	this._minimum = 0.0;
	this._value = 0.0;
	this._isDefaultValue = true;
	feathers_core_FeathersControl.call(this);
	this.set_tabEnabled(true);
	this.set_tabChildren(false);
	this.set_minimum(minimum);
	this.set_maximum(maximum);
	this.set_value(value);
	if(changeListener != null) {
		this.addEventListener("change",changeListener);
	}
};
$hxClasses["feathers.controls.supportClasses.BaseSlider"] = feathers_controls_supportClasses_BaseSlider;
feathers_controls_supportClasses_BaseSlider.__name__ = "feathers.controls.supportClasses.BaseSlider";
feathers_controls_supportClasses_BaseSlider.__interfaces__ = [feathers_core_IFocusObject,feathers_controls_IRange];
feathers_controls_supportClasses_BaseSlider.__super__ = feathers_core_FeathersControl;
feathers_controls_supportClasses_BaseSlider.prototype = $extend(feathers_core_FeathersControl.prototype,{
	_isDefaultValue: null
	,_value: null
	,get_value: function() {
		return this._value;
	}
	,set_value: function(value) {
		if(this._value == value) {
			return this._value;
		}
		this._isDefaultValue = false;
		this._value = value;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		if(this.liveDragging || !this._dragging) {
			feathers_events_FeathersEvent.dispatch(this,"change");
		}
		return this._value;
	}
	,_minimum: null
	,get_minimum: function() {
		return this._minimum;
	}
	,set_minimum: function(value) {
		if(this._minimum == value) {
			return this._minimum;
		}
		this._minimum = value;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		return this._minimum;
	}
	,_maximum: null
	,get_maximum: function() {
		return this._maximum;
	}
	,set_maximum: function(value) {
		if(this._maximum == value) {
			return this._maximum;
		}
		this._maximum = value;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		return this._maximum;
	}
	,_step: null
	,get_step: function() {
		return this._step;
	}
	,set_step: function(value) {
		if(this._step == value) {
			return this._step;
		}
		this._step = value;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		return this._step;
	}
	,_snapInterval: null
	,get_snapInterval: function() {
		return this._snapInterval;
	}
	,set_snapInterval: function(value) {
		if(this._snapInterval == value) {
			return this._snapInterval;
		}
		this._snapInterval = value;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		return this._snapInterval;
	}
	,liveDragging: null
	,_currentThumbSkin: null
	,_thumbSkinMeasurements: null
	,_currentTrackSkin: null
	,_trackSkinMeasurements: null
	,_currentSecondaryTrackSkin: null
	,_secondaryTrackSkinMeasurements: null
	,_dragging: null
	,_pointerStartX: null
	,_pointerStartY: null
	,_thumbStartX: null
	,_thumbStartY: null
	,showFocus: function(show) {
		feathers_core_FeathersControl.prototype.showFocus.call(this,show);
		if(js_Boot.__implements(this._currentThumbSkin,feathers_core_IFocusObject)) {
			var focusThumb = this._currentThumbSkin;
			if(focusThumb.get_focusEnabled()) {
				focusThumb.showFocus(show);
			}
		}
	}
	,applyValueRestrictions: function() {
		this.set_value(this.restrictValue(this._value));
	}
	,initialize: function() {
		feathers_core_FeathersControl.prototype.initialize.call(this);
		if(this._isDefaultValue) {
			this.set_value(this.restrictValue(this._value));
		}
	}
	,update: function() {
		var sizeInvalid = this.isInvalid(feathers_core_InvalidationFlag.SIZE);
		var stateInvalid = this.isInvalid(feathers_core_InvalidationFlag.STATE);
		var stylesInvalid = this.isInvalid(feathers_core_InvalidationFlag.STYLES);
		if(stylesInvalid) {
			this.refreshThumb();
			this.refreshTrack();
			this.refreshSecondaryTrack();
		}
		if(stateInvalid || stylesInvalid) {
			this.refreshEnabled();
		}
		if(this.measure()) {
			sizeInvalid = true;
		}
		this.layoutContent();
	}
	,measure: function() {
		var c = js_Boot.getClass(this);
		throw new openfl_errors_TypeError("Missing override for 'measure' in type " + c.__name__);
	}
	,refreshThumb: function() {
		var oldSkin = this._currentThumbSkin;
		this._currentThumbSkin = this.get_thumbSkin();
		if(this._currentThumbSkin == oldSkin) {
			return;
		}
		if(oldSkin != null) {
			if(js_Boot.__implements(oldSkin,feathers_skins_IProgrammaticSkin)) {
				oldSkin.set_uiContext(null);
			}
			oldSkin.removeEventListener("mouseDown",$bind(this,this.thumbSkin_mouseDownHandler));
			this.removeChild(oldSkin);
		}
		if(this._currentThumbSkin != null) {
			if(js_Boot.__implements(this._currentThumbSkin,feathers_core_IUIControl)) {
				this._currentThumbSkin.initializeNow();
			}
			if(this._thumbSkinMeasurements == null) {
				this._thumbSkinMeasurements = new feathers_layout_Measurements(this._currentThumbSkin);
			} else {
				this._thumbSkinMeasurements.save(this._currentThumbSkin);
			}
			this.addChild(this._currentThumbSkin);
			this._currentThumbSkin.addEventListener("mouseDown",$bind(this,this.thumbSkin_mouseDownHandler));
			if(js_Boot.__implements(this._currentThumbSkin,feathers_skins_IProgrammaticSkin)) {
				this._currentThumbSkin.set_uiContext(this);
			}
		} else {
			this._thumbSkinMeasurements = null;
		}
	}
	,refreshTrack: function() {
		var oldSkin = this._currentTrackSkin;
		this._currentTrackSkin = this.get_trackSkin();
		if(this._currentTrackSkin == oldSkin) {
			return;
		}
		if(oldSkin != null) {
			if(js_Boot.__implements(oldSkin,feathers_skins_IProgrammaticSkin)) {
				oldSkin.set_uiContext(null);
			}
			this.removeChild(oldSkin);
			oldSkin.removeEventListener("mouseDown",$bind(this,this.trackSkin_mouseDownHandler));
		}
		if(this._currentTrackSkin != null) {
			if(js_Boot.__implements(this._currentTrackSkin,feathers_core_IUIControl)) {
				this._currentTrackSkin.initializeNow();
			}
			if(this._trackSkinMeasurements == null) {
				this._trackSkinMeasurements = new feathers_layout_Measurements(this._currentTrackSkin);
			} else {
				this._trackSkinMeasurements.save(this._currentTrackSkin);
			}
			this.addChildAt(this._currentTrackSkin,0);
			this._currentTrackSkin.addEventListener("mouseDown",$bind(this,this.trackSkin_mouseDownHandler));
			if(js_Boot.__implements(this._currentTrackSkin,feathers_skins_IProgrammaticSkin)) {
				this._currentTrackSkin.set_uiContext(this);
			}
		} else {
			this._trackSkinMeasurements = null;
		}
	}
	,refreshSecondaryTrack: function() {
		var oldSkin = this._currentSecondaryTrackSkin;
		this._currentSecondaryTrackSkin = this.get_secondaryTrackSkin();
		if(this._currentSecondaryTrackSkin == oldSkin) {
			return;
		}
		if(oldSkin != null) {
			if(js_Boot.__implements(oldSkin,feathers_skins_IProgrammaticSkin)) {
				oldSkin.set_uiContext(null);
			}
			this.removeChild(oldSkin);
			oldSkin.removeEventListener("mouseDown",$bind(this,this.trackSkin_mouseDownHandler));
		}
		if(this._currentSecondaryTrackSkin != null) {
			if(js_Boot.__implements(this._currentSecondaryTrackSkin,feathers_core_IUIControl)) {
				this._currentSecondaryTrackSkin.initializeNow();
			}
			if(this._secondaryTrackSkinMeasurements == null) {
				this._secondaryTrackSkinMeasurements = new feathers_layout_Measurements(this._currentSecondaryTrackSkin);
			} else {
				this._secondaryTrackSkinMeasurements.save(this._currentSecondaryTrackSkin);
			}
			var index = this._currentTrackSkin != null ? 1 : 0;
			this.addChildAt(this._currentSecondaryTrackSkin,index);
			this._currentSecondaryTrackSkin.addEventListener("mouseDown",$bind(this,this.trackSkin_mouseDownHandler));
			if(js_Boot.__implements(this._currentSecondaryTrackSkin,feathers_skins_IProgrammaticSkin)) {
				this._currentSecondaryTrackSkin.set_uiContext(this);
			}
		} else {
			this._secondaryTrackSkinMeasurements = null;
		}
	}
	,refreshEnabled: function() {
		if(js_Boot.__implements(this._currentThumbSkin,feathers_core_IUIControl)) {
			this._currentThumbSkin.set_enabled(this._enabled);
		}
		if(js_Boot.__implements(this._currentTrackSkin,feathers_core_IUIControl)) {
			this._currentTrackSkin.set_enabled(this._enabled);
		}
		if(js_Boot.__implements(this._currentSecondaryTrackSkin,feathers_core_IUIControl)) {
			this._currentSecondaryTrackSkin.set_enabled(this._enabled);
		}
	}
	,layoutContent: function() {
		if(this._currentTrackSkin != null && this._currentSecondaryTrackSkin != null) {
			this.layoutSplitTrack();
		} else {
			this.layoutSingleTrack();
		}
		this.layoutThumb();
	}
	,layoutSplitTrack: function() {
		var c = js_Boot.getClass(this);
		throw new openfl_errors_TypeError("Missing override for 'layoutSplitTrack' in type " + c.__name__);
	}
	,layoutSingleTrack: function() {
		var c = js_Boot.getClass(this);
		throw new openfl_errors_TypeError("Missing override for 'layoutSingleTrack' in type " + c.__name__);
	}
	,layoutThumb: function() {
		var c = js_Boot.getClass(this);
		throw new openfl_errors_TypeError("Missing override for 'layoutThumb' in type " + c.__name__);
	}
	,normalizeValue: function(value) {
		var normalized = 0.0;
		if(this._minimum != this._maximum) {
			normalized = (value - this._minimum) / (this._maximum - this._minimum);
			if(normalized < 0.0) {
				normalized = 0.0;
			} else if(normalized > 1.0) {
				normalized = 1.0;
			}
		}
		return normalized;
	}
	,restrictValue: function(value) {
		if(this._snapInterval != 0.0 && value != this._minimum && value != this._maximum) {
			value = feathers_utils_MathUtil.roundToNearest(value,this._snapInterval);
		}
		if(value < this._minimum) {
			value = this._minimum;
		} else if(value > this._maximum) {
			value = this._maximum;
		}
		return value;
	}
	,valueToLocation: function(value) {
		var c = js_Boot.getClass(this);
		throw new openfl_errors_TypeError("Missing override for 'valueToLocation' in type " + c.__name__);
	}
	,locationToValue: function(x,y) {
		var c = js_Boot.getClass(this);
		throw new openfl_errors_TypeError("Missing override for 'locationToValue' in type " + c.__name__);
	}
	,saveThumbStart: function(x,y) {
		var c = js_Boot.getClass(this);
		throw new openfl_errors_TypeError("Missing override for 'saveThumbStart' in type " + c.__name__);
	}
	,thumbSkin_mouseDownHandler: function(event) {
		if(!this._enabled || this.stage == null) {
			return;
		}
		var exclusivePointer = feathers_utils_ExclusivePointer.forStage(this.stage);
		var result = exclusivePointer.claimMouse(this);
		if(!result) {
			return;
		}
		this.stage.addEventListener("mouseMove",$bind(this,this.thumbSkin_stage_mouseMoveHandler),false,0,true);
		this.stage.addEventListener("mouseUp",$bind(this,this.thumbSkin_stage_mouseUpHandler),false,0,true);
		this._thumbStartX = this._currentThumbSkin.get_x();
		this._thumbStartY = this._currentThumbSkin.get_y();
		this._pointerStartX = this.get_mouseX();
		this._pointerStartY = this.get_mouseY();
		this._dragging = true;
	}
	,thumbSkin_stage_mouseMoveHandler: function(event) {
		var newValue = this.locationToValue(this.get_mouseX(),this.get_mouseY());
		newValue = this.restrictValue(newValue);
		this.set_value(newValue);
	}
	,thumbSkin_stage_mouseUpHandler: function(event) {
		var stage = js_Boot.__cast(event.currentTarget , openfl_display_Stage);
		stage.removeEventListener("mouseMove",$bind(this,this.thumbSkin_stage_mouseMoveHandler));
		stage.removeEventListener("mouseUp",$bind(this,this.thumbSkin_stage_mouseUpHandler));
		this._dragging = false;
		if(!this.liveDragging) {
			feathers_events_FeathersEvent.dispatch(this,"change");
		}
	}
	,trackSkin_mouseDownHandler: function(event) {
		if(!this._enabled || this.stage == null) {
			return;
		}
		var exclusivePointer = feathers_utils_ExclusivePointer.forStage(this.stage);
		var result = exclusivePointer.claimMouse(this);
		if(!result) {
			return;
		}
		this.stage.addEventListener("mouseMove",$bind(this,this.trackSkin_stage_mouseMoveHandler),false,0,true);
		this.stage.addEventListener("mouseUp",$bind(this,this.trackSkin_stage_mouseUpHandler),false,0,true);
		this.saveThumbStart(this.get_mouseX(),this.get_mouseY());
		this._pointerStartX = this.get_mouseX();
		this._pointerStartY = this.get_mouseY();
		this._dragging = true;
		var newValue = this.locationToValue(this.get_mouseX(),this.get_mouseY());
		newValue = this.restrictValue(newValue);
		this.set_value(newValue);
	}
	,trackSkin_stage_mouseMoveHandler: function(event) {
		var newValue = this.locationToValue(this.get_mouseX(),this.get_mouseY());
		newValue = this.restrictValue(newValue);
		this.set_value(newValue);
	}
	,trackSkin_stage_mouseUpHandler: function(event) {
		var stage = js_Boot.__cast(event.currentTarget , openfl_display_Stage);
		stage.removeEventListener("mouseMove",$bind(this,this.trackSkin_stage_mouseMoveHandler));
		stage.removeEventListener("mouseUp",$bind(this,this.trackSkin_stage_mouseUpHandler));
		this._dragging = false;
		if(!this.liveDragging) {
			feathers_events_FeathersEvent.dispatch(this,"change");
		}
	}
	,__thumbSkin: null
	,get_thumbSkin: function() {
		return this.__thumbSkin;
	}
	,set_thumbSkin: function(value) {
		if(!this.setStyle("thumbSkin")) {
			return this.__thumbSkin;
		}
		if(this.__thumbSkin == value) {
			return this.__thumbSkin;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_thumbSkin);
		this.__thumbSkin = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__thumbSkin;
	}
	,clearStyle_thumbSkin: function() {
		this.set_thumbSkin(null);
		return this.get_thumbSkin();
	}
	,__trackSkin: null
	,get_trackSkin: function() {
		return this.__trackSkin;
	}
	,set_trackSkin: function(value) {
		if(!this.setStyle("trackSkin")) {
			return this.__trackSkin;
		}
		if(this.__trackSkin == value) {
			return this.__trackSkin;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_trackSkin);
		this.__trackSkin = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__trackSkin;
	}
	,clearStyle_trackSkin: function() {
		this.set_trackSkin(null);
		return this.get_trackSkin();
	}
	,__secondaryTrackSkin: null
	,get_secondaryTrackSkin: function() {
		return this.__secondaryTrackSkin;
	}
	,set_secondaryTrackSkin: function(value) {
		if(!this.setStyle("secondaryTrackSkin")) {
			return this.__secondaryTrackSkin;
		}
		if(this.__secondaryTrackSkin == value) {
			return this.__secondaryTrackSkin;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_secondaryTrackSkin);
		this.__secondaryTrackSkin = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__secondaryTrackSkin;
	}
	,clearStyle_secondaryTrackSkin: function() {
		this.set_secondaryTrackSkin(null);
		return this.get_secondaryTrackSkin();
	}
	,__minimumPadding: null
	,get_minimumPadding: function() {
		return this.__minimumPadding;
	}
	,set_minimumPadding: function(value) {
		if(!this.setStyle("minimumPadding")) {
			return this.__minimumPadding;
		}
		if(this.__minimumPadding == value) {
			return this.__minimumPadding;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_minimumPadding);
		this.__minimumPadding = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__minimumPadding;
	}
	,clearStyle_minimumPadding: function() {
		this.set_minimumPadding(0.0);
		return this.get_minimumPadding();
	}
	,__maximumPadding: null
	,get_maximumPadding: function() {
		return this.__maximumPadding;
	}
	,set_maximumPadding: function(value) {
		if(!this.setStyle("maximumPadding")) {
			return this.__maximumPadding;
		}
		if(this.__maximumPadding == value) {
			return this.__maximumPadding;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_maximumPadding);
		this.__maximumPadding = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__maximumPadding;
	}
	,clearStyle_maximumPadding: function() {
		this.set_maximumPadding(0.0);
		return this.get_maximumPadding();
	}
	,__class__: feathers_controls_supportClasses_BaseSlider
	,__properties__: $extend(feathers_core_FeathersControl.prototype.__properties__,{set_maximumPadding:"set_maximumPadding",get_maximumPadding:"get_maximumPadding",set_minimumPadding:"set_minimumPadding",get_minimumPadding:"get_minimumPadding",set_secondaryTrackSkin:"set_secondaryTrackSkin",get_secondaryTrackSkin:"get_secondaryTrackSkin",set_trackSkin:"set_trackSkin",get_trackSkin:"get_trackSkin",set_thumbSkin:"set_thumbSkin",get_thumbSkin:"get_thumbSkin",set_snapInterval:"set_snapInterval",get_snapInterval:"get_snapInterval",set_step:"set_step",get_step:"get_step",set_maximum:"set_maximum",get_maximum:"get_maximum",set_minimum:"set_minimum",get_minimum:"get_minimum",set_value:"set_value",get_value:"get_value"})
});
var feathers_controls_HSlider = function(value,minimum,maximum,changeListener) {
	if(maximum == null) {
		maximum = 1.0;
	}
	if(minimum == null) {
		minimum = 0.0;
	}
	if(value == null) {
		value = 0.0;
	}
	this.initializeHSliderTheme();
	feathers_controls_supportClasses_BaseSlider.call(this,value,minimum,maximum,changeListener);
	this.addEventListener("keyDown",$bind(this,this.hSlider_keyDownHandler));
};
$hxClasses["feathers.controls.HSlider"] = feathers_controls_HSlider;
feathers_controls_HSlider.__name__ = "feathers.controls.HSlider";
feathers_controls_HSlider.__super__ = feathers_controls_supportClasses_BaseSlider;
feathers_controls_HSlider.prototype = $extend(feathers_controls_supportClasses_BaseSlider.prototype,{
	initializeHSliderTheme: function() {
		feathers_themes_steel_components_SteelHSliderStyles.initialize();
	}
	,valueToLocation: function(value) {
		if(js_Boot.__implements(this._currentThumbSkin,feathers_core_IValidating)) {
			this._currentThumbSkin.validateNow();
		}
		var normalized = this.normalizeValue(value);
		var trackScrollableWidth = this.actualWidth - this.get_minimumPadding() - this.get_maximumPadding();
		if(this._currentThumbSkin != null) {
			trackScrollableWidth -= this._currentThumbSkin.get_width();
		}
		return Math.round(this.get_minimumPadding() + trackScrollableWidth * normalized);
	}
	,locationToValue: function(x,y) {
		var percentage = 0.0;
		var trackScrollableWidth = this.actualWidth - this.get_minimumPadding() - this.get_maximumPadding();
		if(this._currentThumbSkin != null) {
			trackScrollableWidth -= this._currentThumbSkin.get_width();
		}
		var xOffset = x - this._pointerStartX - this.get_minimumPadding();
		var xPosition = Math.min(Math.max(0.0,this._thumbStartX + xOffset),trackScrollableWidth);
		percentage = xPosition / trackScrollableWidth;
		return this._minimum + percentage * (this._maximum - this._minimum);
	}
	,measure: function() {
		var needsWidth = this.get_explicitWidth() == null;
		var needsHeight = this.get_explicitHeight() == null;
		var needsMinWidth = this.get_explicitMinWidth() == null;
		var needsMinHeight = this.get_explicitMinHeight() == null;
		var needsMaxWidth = this.get_explicitMaxWidth() == null;
		var needsMaxHeight = this.get_explicitMaxHeight() == null;
		if(!needsWidth && !needsHeight && !needsMinWidth && !needsMinHeight && !needsMaxWidth && !needsMaxHeight) {
			return false;
		}
		if(this._currentThumbSkin != null) {
			this._thumbSkinMeasurements.restore(this._currentThumbSkin);
			if(js_Boot.__implements(this._currentThumbSkin,feathers_core_IValidating)) {
				this._currentThumbSkin.validateNow();
			}
		}
		if(this._currentTrackSkin != null) {
			this._trackSkinMeasurements.restore(this._currentTrackSkin);
			if(js_Boot.__implements(this._currentTrackSkin,feathers_core_IValidating)) {
				this._currentTrackSkin.validateNow();
			}
		}
		if(this._currentSecondaryTrackSkin != null) {
			this._secondaryTrackSkinMeasurements.restore(this._currentSecondaryTrackSkin);
			if(js_Boot.__implements(this._currentSecondaryTrackSkin,feathers_core_IValidating)) {
				this._currentSecondaryTrackSkin.validateNow();
			}
		}
		var newWidth = this.get_explicitWidth();
		if(needsWidth) {
			newWidth = 0.0;
			if(this._currentTrackSkin != null) {
				newWidth += this._currentTrackSkin.get_width();
				if(this._currentSecondaryTrackSkin != null) {
					newWidth += this._currentSecondaryTrackSkin.get_width();
				}
			}
		}
		var newHeight = this.get_explicitHeight();
		if(needsHeight) {
			newHeight = 0.0;
			if(this._currentThumbSkin != null) {
				newHeight += this._currentThumbSkin.get_height();
			}
			if(this._currentTrackSkin != null) {
				if(newHeight < this._currentTrackSkin.get_height()) {
					newHeight = this._currentTrackSkin.get_height();
				}
				if(this._currentSecondaryTrackSkin != null && newHeight < this._currentSecondaryTrackSkin.get_height()) {
					newHeight = this._currentSecondaryTrackSkin.get_height();
				}
			}
		}
		var newMinWidth = this.get_explicitMinWidth();
		if(needsMinWidth) {
			newMinWidth = 0.0;
			if(this._currentTrackSkin != null) {
				newMinWidth += this._currentTrackSkin.get_width();
				if(this._currentSecondaryTrackSkin != null) {
					newMinWidth += this._secondaryTrackSkinMeasurements.width;
				}
			}
		}
		var newMinHeight = this.get_explicitMinHeight();
		if(needsMinHeight) {
			newMinHeight = 0.0;
			if(this._currentThumbSkin != null) {
				newMinHeight += this._currentThumbSkin.get_height();
			}
			if(this._currentTrackSkin != null) {
				if(newMinHeight < this._currentTrackSkin.get_height()) {
					newMinHeight = this._currentTrackSkin.get_height();
				}
				if(this._currentSecondaryTrackSkin != null && newHeight < this._currentSecondaryTrackSkin.get_height()) {
					newMinHeight = this._currentSecondaryTrackSkin.get_height();
				}
			}
		}
		return this.saveMeasurements(newWidth,newHeight,newMinWidth,newMinHeight);
	}
	,saveThumbStart: function(x,y) {
		var trackWidthMinusThumbWidth = this.actualWidth;
		var locationMinusHalfThumbWidth = x;
		if(this._currentThumbSkin != null) {
			trackWidthMinusThumbWidth -= this._currentThumbSkin.get_width();
			locationMinusHalfThumbWidth -= this._currentThumbSkin.get_width() / 2.0;
		}
		this._thumbStartX = Math.min(trackWidthMinusThumbWidth - this.get_maximumPadding(),Math.max(this.get_minimumPadding(),locationMinusHalfThumbWidth));
		this._thumbStartY = y;
	}
	,layoutSplitTrack: function() {
		var location = this.valueToLocation(this.get_value());
		if(this._currentThumbSkin != null) {
			if(js_Boot.__implements(this._currentThumbSkin,feathers_core_IValidating)) {
				this._currentThumbSkin.validateNow();
			}
			location += Math.round(this._currentThumbSkin.get_width() / 2.0);
		}
		this._currentTrackSkin.set_x(0.0);
		this._currentTrackSkin.set_width(location);
		this._currentSecondaryTrackSkin.set_x(location);
		this._currentSecondaryTrackSkin.set_width(this.actualWidth - location);
		if(js_Boot.__implements(this._currentTrackSkin,feathers_core_IValidating)) {
			this._currentTrackSkin.validateNow();
		}
		if(js_Boot.__implements(this._currentSecondaryTrackSkin,feathers_core_IValidating)) {
			this._currentSecondaryTrackSkin.validateNow();
		}
		this._currentTrackSkin.set_y((this.actualHeight - this._currentTrackSkin.get_height()) / 2.0);
		this._currentSecondaryTrackSkin.set_y((this.actualHeight - this._currentSecondaryTrackSkin.get_height()) / 2.0);
	}
	,layoutSingleTrack: function() {
		if(this._currentTrackSkin == null) {
			return;
		}
		this._currentTrackSkin.set_x(0.0);
		this._currentTrackSkin.set_width(this.actualWidth);
		if(js_Boot.__implements(this._currentTrackSkin,feathers_core_IValidating)) {
			this._currentTrackSkin.validateNow();
		}
		this._currentTrackSkin.set_y((this.actualHeight - this._currentTrackSkin.get_height()) / 2.0);
	}
	,layoutThumb: function() {
		if(this._currentThumbSkin == null) {
			return;
		}
		var thumbLocation = this.valueToLocation(this._value);
		this._currentThumbSkin.set_x(thumbLocation);
		this._currentThumbSkin.set_y((this.actualHeight - this.get_thumbSkin().get_height()) / 2.0);
	}
	,hSlider_keyDownHandler: function(event) {
		if(!this._enabled) {
			return;
		}
		if(event.isDefaultPrevented()) {
			return;
		}
		var newValue = this._value;
		switch(event.keyCode) {
		case 35:
			newValue = this._maximum;
			break;
		case 36:
			newValue = this._minimum;
			break;
		case 37:
			newValue -= this._step;
			break;
		case 39:
			newValue += this._step;
			break;
		default:
			return;
		}
		if(newValue < this._minimum) {
			newValue = this._minimum;
		} else if(newValue > this._maximum) {
			newValue = this._maximum;
		}
		event.preventDefault();
		this.set_value(newValue);
	}
	,get_styleContext: function() {
		return feathers_controls_HSlider;
	}
	,__class__: feathers_controls_HSlider
});
var feathers_controls_IGroupedToggle = function() { };
$hxClasses["feathers.controls.IGroupedToggle"] = feathers_controls_IGroupedToggle;
feathers_controls_IGroupedToggle.__name__ = "feathers.controls.IGroupedToggle";
feathers_controls_IGroupedToggle.__isInterface__ = true;
feathers_controls_IGroupedToggle.__interfaces__ = [feathers_controls_IToggle];
feathers_controls_IGroupedToggle.prototype = {
	get_toggleGroup: null
	,set_toggleGroup: null
	,__class__: feathers_controls_IGroupedToggle
	,__properties__: {set_toggleGroup:"set_toggleGroup",get_toggleGroup:"get_toggleGroup"}
};
var feathers_controls__$ListView_ItemRendererStorage = function(id,recycler) {
	this.inactiveItemRenderers = [];
	this.activeItemRenderers = [];
	this.id = id;
	this.itemRendererRecycler = recycler;
};
$hxClasses["feathers.controls._ListView.ItemRendererStorage"] = feathers_controls__$ListView_ItemRendererStorage;
feathers_controls__$ListView_ItemRendererStorage.__name__ = "feathers.controls._ListView.ItemRendererStorage";
feathers_controls__$ListView_ItemRendererStorage.prototype = {
	id: null
	,oldItemRendererRecycler: null
	,itemRendererRecycler: null
	,activeItemRenderers: null
	,inactiveItemRenderers: null
	,measurements: null
	,__class__: feathers_controls__$ListView_ItemRendererStorage
};
var feathers_controls_NumericStepper = function(value,minimum,maximum,changeListener) {
	if(maximum == null) {
		maximum = 1.0;
	}
	if(minimum == null) {
		minimum = 0.0;
	}
	if(value == null) {
		value = 0.0;
	}
	this.__buttonGap = 0.0;
	this.__textInputGap = 0.0;
	this.__buttonDirection = feathers_layout_Direction.HORIZONTAL;
	this.__textInputPosition = feathers_layout_HorizontalAlign.CENTER;
	this.__customTextInputVariant = null;
	this.__customIncrementButtonVariant = null;
	this.__customDecrementButtonVariant = null;
	this._pendingTextInputChanges = false;
	this._previousCustomTextInputVariant = null;
	this._previousCustomIncrementButtonVariant = null;
	this._previousCustomDecrementButtonVariant = null;
	this._enableButtonsAtRangeLimits = true;
	this._editable = true;
	this._snapInterval = 0.0;
	this._step = 0.01;
	this._maximum = 1.0;
	this._minimum = 0.0;
	this._value = 0.0;
	this._isDefaultValue = true;
	this.textInputMeasurements = new feathers_layout_Measurements();
	this.incrementButtonMeasurements = new feathers_layout_Measurements();
	this.decrementButtonMeasurements = new feathers_layout_Measurements();
	this.initializeNumericStepperTheme();
	feathers_core_FeathersControl.call(this);
	this.addEventListener("focusIn",$bind(this,this.numericStepper_focusInHandler));
	this.set_minimum(minimum);
	this.set_maximum(maximum);
	this.set_value(value);
	if(changeListener != null) {
		this.addEventListener("change",changeListener);
	}
};
$hxClasses["feathers.controls.NumericStepper"] = feathers_controls_NumericStepper;
feathers_controls_NumericStepper.__name__ = "feathers.controls.NumericStepper";
feathers_controls_NumericStepper.__interfaces__ = [feathers_core_IStageFocusDelegate,feathers_controls_IRange];
feathers_controls_NumericStepper.__super__ = feathers_core_FeathersControl;
feathers_controls_NumericStepper.prototype = $extend(feathers_core_FeathersControl.prototype,{
	decrementButton: null
	,incrementButton: null
	,textInput: null
	,decrementButtonMeasurements: null
	,incrementButtonMeasurements: null
	,textInputMeasurements: null
	,_isDefaultValue: null
	,_value: null
	,get_value: function() {
		return this._value;
	}
	,set_value: function(value) {
		if(this._value == value) {
			return this._value;
		}
		this._isDefaultValue = false;
		this._value = value;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._value;
	}
	,_minimum: null
	,get_minimum: function() {
		return this._minimum;
	}
	,set_minimum: function(value) {
		if(this._minimum == value) {
			return this._minimum;
		}
		this._minimum = value;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		return this._minimum;
	}
	,_maximum: null
	,get_maximum: function() {
		return this._maximum;
	}
	,set_maximum: function(value) {
		if(this._maximum == value) {
			return this._maximum;
		}
		this._maximum = value;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		return this._maximum;
	}
	,_step: null
	,get_step: function() {
		return this._step;
	}
	,set_step: function(value) {
		if(this._step == value) {
			return this._step;
		}
		this._step = value;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		return this._step;
	}
	,_snapInterval: null
	,get_snapInterval: function() {
		return this._snapInterval;
	}
	,set_snapInterval: function(value) {
		if(this._snapInterval == value) {
			return this._snapInterval;
		}
		this._snapInterval = value;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		return this._snapInterval;
	}
	,_editable: null
	,get_editable: function() {
		return this._editable;
	}
	,set_editable: function(value) {
		if(this._editable == value) {
			return this._editable;
		}
		this._editable = value;
		this.setInvalid(feathers_core_InvalidationFlag.STATE);
		return this._editable;
	}
	,_enableButtonsAtRangeLimits: null
	,get_enableButtonsAtRangeLimits: function() {
		return this._enableButtonsAtRangeLimits;
	}
	,set_enableButtonsAtRangeLimits: function(value) {
		if(this._enableButtonsAtRangeLimits == value) {
			return this._enableButtonsAtRangeLimits;
		}
		this._enableButtonsAtRangeLimits = value;
		this.setInvalid(feathers_core_InvalidationFlag.STATE);
		return this._enableButtonsAtRangeLimits;
	}
	,_valueFormatFunction: null
	,get_valueFormatFunction: function() {
		return this._valueFormatFunction;
	}
	,set_valueFormatFunction: function(value) {
		if(this._valueFormatFunction == value) {
			return this._valueFormatFunction;
		}
		this._valueFormatFunction = value;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		return this._valueFormatFunction;
	}
	,_valueParseFunction: null
	,get_valueParseFunction: function() {
		return this._valueParseFunction;
	}
	,set_valueParseFunction: function(value) {
		if(this._valueParseFunction == value) {
			return this._valueParseFunction;
		}
		this._valueParseFunction = value;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		return this._valueParseFunction;
	}
	,get_stageFocusTarget: function() {
		return this.textInput;
	}
	,_oldDecrementButtonFactory: null
	,_decrementButtonFactory: null
	,get_decrementButtonFactory: function() {
		return this._decrementButtonFactory;
	}
	,set_decrementButtonFactory: function(value) {
		if(this._decrementButtonFactory == value) {
			return this._decrementButtonFactory;
		}
		this._decrementButtonFactory = value;
		this.setInvalid(feathers_controls_NumericStepper.INVALIDATION_FLAG_DECREMENT_BUTTON_FACTORY);
		return this._decrementButtonFactory;
	}
	,_oldIncrementButtonFactory: null
	,_incrementButtonFactory: null
	,get_incrementButtonFactory: function() {
		return this._incrementButtonFactory;
	}
	,set_incrementButtonFactory: function(value) {
		if(this._incrementButtonFactory == value) {
			return this._incrementButtonFactory;
		}
		this._incrementButtonFactory = value;
		this.setInvalid(feathers_controls_NumericStepper.INVALIDATION_FLAG_INCREMENT_BUTTON_FACTORY);
		return this._incrementButtonFactory;
	}
	,_oldTextInputFactory: null
	,_textInputFactory: null
	,get_textInputFactory: function() {
		return this._textInputFactory;
	}
	,set_textInputFactory: function(value) {
		if(this._textInputFactory == value) {
			return this._textInputFactory;
		}
		this._textInputFactory = value;
		this.setInvalid(feathers_controls_NumericStepper.INVALIDATION_FLAG_TEXT_INPUT_FACTORY);
		return this._textInputFactory;
	}
	,_previousCustomDecrementButtonVariant: null
	,_previousCustomIncrementButtonVariant: null
	,_previousCustomTextInputVariant: null
	,_pendingTextInputChanges: null
	,showFocus: function(show) {
		feathers_core_FeathersControl.prototype.showFocus.call(this,show);
		if(this.textInput != null) {
			this.textInput.showFocus(show);
		}
	}
	,applyValueRestrictions: function() {
		this.set_value(this.restrictValue(this._value));
	}
	,dispose: function() {
		this.destroyDecrementButton();
		this.destroyIncrementButton();
		this.destroyTextInput();
		feathers_core_FeathersControl.prototype.dispose.call(this);
	}
	,initializeNumericStepperTheme: function() {
		feathers_themes_steel_components_SteelNumericStepperStyles.initialize();
	}
	,initialize: function() {
		feathers_core_FeathersControl.prototype.initialize.call(this);
		if(this._isDefaultValue) {
			this.set_value(this.restrictValue(this._value));
		}
	}
	,update: function() {
		var dataInvalid = this.isInvalid(feathers_core_InvalidationFlag.DATA);
		var sizeInvalid = this.isInvalid(feathers_core_InvalidationFlag.SIZE);
		var stateInvalid = this.isInvalid(feathers_core_InvalidationFlag.STATE);
		var stylesInvalid = this.isInvalid(feathers_core_InvalidationFlag.STYLES);
		if(this._previousCustomTextInputVariant != this.get_customTextInputVariant()) {
			this.setInvalidationFlag(feathers_controls_NumericStepper.INVALIDATION_FLAG_TEXT_INPUT_FACTORY);
		}
		if(this._previousCustomDecrementButtonVariant != this.get_customDecrementButtonVariant()) {
			this.setInvalidationFlag(feathers_controls_NumericStepper.INVALIDATION_FLAG_DECREMENT_BUTTON_FACTORY);
		}
		if(this._previousCustomIncrementButtonVariant != this.get_customIncrementButtonVariant()) {
			this.setInvalidationFlag(feathers_controls_NumericStepper.INVALIDATION_FLAG_INCREMENT_BUTTON_FACTORY);
		}
		var decrementButtonFactoryInvalid = this.isInvalid(feathers_controls_NumericStepper.INVALIDATION_FLAG_DECREMENT_BUTTON_FACTORY);
		var incrementButtonFactoryInvalid = this.isInvalid(feathers_controls_NumericStepper.INVALIDATION_FLAG_INCREMENT_BUTTON_FACTORY);
		var textInputFactoryInvalid = this.isInvalid(feathers_controls_NumericStepper.INVALIDATION_FLAG_TEXT_INPUT_FACTORY);
		if(decrementButtonFactoryInvalid) {
			this.createDecrementButton();
		}
		if(incrementButtonFactoryInvalid) {
			this.createIncrementButton();
		}
		if(textInputFactoryInvalid) {
			this.createTextInput();
		}
		if(stateInvalid || dataInvalid) {
			this.refreshEnabled();
		}
		if(stateInvalid) {
			this.refreshEditable();
		}
		if(dataInvalid) {
			this.refreshMeasureText();
		}
		if(dataInvalid) {
			this.refreshTextInputData();
		}
		if(this.measure()) {
			sizeInvalid = true;
		}
		this.layoutContent();
		this._previousCustomTextInputVariant = this.get_customTextInputVariant();
		this._previousCustomDecrementButtonVariant = this.get_customDecrementButtonVariant();
		this._previousCustomIncrementButtonVariant = this.get_customIncrementButtonVariant();
	}
	,measure: function() {
		var needsWidth = this.get_explicitWidth() == null;
		var needsHeight = this.get_explicitHeight() == null;
		var needsMinWidth = this.get_explicitMinWidth() == null;
		var needsMinHeight = this.get_explicitMinHeight() == null;
		var needsMaxWidth = this.get_explicitMaxWidth() == null;
		var needsMaxHeight = this.get_explicitMaxHeight() == null;
		if(!needsWidth && !needsHeight && !needsMinWidth && !needsMinHeight && !needsMaxWidth && !needsMaxHeight) {
			return false;
		}
		this.decrementButtonMeasurements.restore(this.decrementButton);
		this.decrementButton.validateNow();
		this.incrementButtonMeasurements.restore(this.incrementButton);
		this.incrementButton.validateNow();
		this.textInputMeasurements.restore(this.textInput);
		this.textInput.validateNow();
		var newWidth = this.get_explicitWidth();
		if(needsWidth) {
			var buttonWidth = Math.max(this.decrementButton.get_width(),this.incrementButton.get_width());
			if(this.get_buttonDirection() == feathers_layout_Direction.VERTICAL) {
				if(this.get_textInputPosition() == feathers_layout_HorizontalAlign.CENTER) {
					newWidth = Math.max(this.textInput.get_width(),buttonWidth);
				} else {
					newWidth = this.textInput.get_width() + this.get_textInputGap() + buttonWidth;
				}
			} else if(this.get_textInputPosition() == feathers_layout_HorizontalAlign.CENTER) {
				newWidth = 2.0 * (buttonWidth + this.get_textInputGap()) + this.textInput.get_width();
			} else {
				newWidth = 2.0 * buttonWidth + this.get_buttonGap() + this.get_textInputGap() + this.textInput.get_width();
			}
		}
		var newHeight = this.get_explicitHeight();
		if(needsHeight) {
			var buttonHeight = Math.max(this.decrementButton.get_height(),this.incrementButton.get_height());
			if(this.get_buttonDirection() == feathers_layout_Direction.VERTICAL) {
				if(this.get_textInputPosition() == feathers_layout_HorizontalAlign.CENTER) {
					newHeight = 2.0 * (buttonHeight + this.get_textInputGap()) + this.textInput.get_height();
				} else {
					newHeight = Math.max(this.textInput.get_height(),2.0 * buttonHeight + this.get_buttonGap());
				}
			} else {
				newHeight = Math.max(this.textInput.get_height(),buttonHeight);
			}
		}
		var newMinWidth = this.get_explicitMinWidth();
		if(needsMinWidth) {
			var buttonWidth = Math.max(this.decrementButton.get_width(),this.incrementButton.get_width());
			if(this.get_buttonDirection() == feathers_layout_Direction.VERTICAL) {
				if(this.get_textInputPosition() == feathers_layout_HorizontalAlign.CENTER) {
					newMinWidth = Math.max(this.textInput.get_minWidth(),buttonWidth);
				} else {
					newMinWidth = this.textInput.get_minWidth() + this.get_textInputGap() + buttonWidth;
				}
			} else if(this.get_textInputPosition() == feathers_layout_HorizontalAlign.CENTER) {
				newMinWidth = 2.0 * (buttonWidth + this.get_textInputGap()) + this.textInput.get_minWidth();
			} else {
				newMinWidth = 2.0 * buttonWidth + this.get_buttonGap() + this.get_textInputGap() + this.textInput.get_minWidth();
			}
		}
		var newMinHeight = this.get_explicitMinHeight();
		if(needsMinHeight) {
			var buttonHeight = Math.max(this.decrementButton.get_height(),this.incrementButton.get_height());
			if(this.get_buttonDirection() == feathers_layout_Direction.VERTICAL) {
				if(this.get_textInputPosition() == feathers_layout_HorizontalAlign.CENTER) {
					newMinHeight = 2.0 * (buttonHeight + this.get_textInputGap()) + this.textInput.get_minHeight();
				} else {
					newMinHeight = Math.max(this.textInput.get_minHeight(),2.0 * buttonHeight + this.get_buttonGap());
				}
			} else {
				newMinHeight = Math.max(this.textInput.get_minHeight(),buttonHeight);
			}
		}
		return this.saveMeasurements(newWidth,newHeight,newMinWidth,newMinHeight);
	}
	,refreshMeasureText: function() {
		var maxCharactersBeforeDecimal = Math.max(Math.max(Std.string(this._minimum | 0).length,Std.string(this._maximum | 0).length),Std.string(this._step | 0).length) | 0;
		var maxCharactersAfterDecimal = (Math.max(Math.max(Std.string(feathers_utils_MathUtil.roundToPrecision(this._minimum - (this._minimum | 0),10)).length,Std.string(feathers_utils_MathUtil.roundToPrecision(this._maximum - (this._maximum | 0),10)).length),Std.string(feathers_utils_MathUtil.roundToPrecision(this._step - (this._step | 0),10)).length) | 0) - 2;
		if(maxCharactersAfterDecimal < 0) {
			maxCharactersAfterDecimal = 0;
		}
		var measureText = "";
		var _g = 0;
		var _g1 = maxCharactersBeforeDecimal + maxCharactersAfterDecimal;
		while(_g < _g1) {
			var i = _g++;
			measureText += "0";
		}
		if(maxCharactersAfterDecimal > 0) {
			measureText += ".";
		}
		this.textInput.set_measureText(measureText);
	}
	,refreshEnabled: function() {
		this.decrementButton.set_enabled(this._enabled && (this._enableButtonsAtRangeLimits || this._value != this._minimum));
		this.incrementButton.set_enabled(this._enabled && (this._enableButtonsAtRangeLimits || this._value != this._maximum));
		this.textInput.set_enabled(this._enabled);
	}
	,refreshEditable: function() {
		this.textInput.set_editable(this._editable);
	}
	,refreshTextInputData: function() {
		var valueToFormat = feathers_utils_MathUtil.roundToPrecision(this._value,10);
		if(this._valueFormatFunction != null) {
			this.textInput.set_text(this._valueFormatFunction(valueToFormat));
		} else {
			this.textInput.set_text(valueToFormat == null ? "null" : "" + valueToFormat);
		}
	}
	,parseTextInputValue: function() {
		var newValue = this._value;
		if(this._valueParseFunction != null) {
			newValue = this._valueParseFunction(this.textInput.get_text());
		} else {
			newValue = parseFloat(this.textInput.get_text());
		}
		if(!isNaN(newValue)) {
			newValue = this.restrictValue(newValue);
			this.set_value(newValue);
		}
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		this._pendingTextInputChanges = false;
	}
	,layoutContent: function() {
		this.decrementButton.validateNow();
		this.incrementButton.validateNow();
		this.textInput.validateNow();
		if(this.get_buttonDirection() == feathers_layout_Direction.VERTICAL) {
			this.layoutContentWithVerticalButtons();
		} else {
			this.layoutContentWithHorizontalButtons();
		}
	}
	,layoutContentWithHorizontalButtons: function() {
		var buttonWidth = Math.max(this.decrementButton.get_width(),this.incrementButton.get_width());
		var textInputWidth = this.actualWidth;
		if(this.get_textInputPosition() == feathers_layout_HorizontalAlign.CENTER) {
			textInputWidth -= 2.0 * (buttonWidth + this.get_textInputGap());
		} else {
			textInputWidth -= 2.0 * buttonWidth + this.get_buttonGap() + this.get_textInputGap();
		}
		textInputWidth = Math.max(0.0,textInputWidth);
		if(this.textInput.get_width() != textInputWidth) {
			this.textInput.set_width(textInputWidth);
		}
		if(this.textInput.get_height() != this.actualHeight) {
			this.textInput.set_height(this.actualHeight);
		}
		if(this.decrementButton.get_width() != buttonWidth) {
			this.decrementButton.set_width(buttonWidth);
		}
		if(this.decrementButton.get_height() != this.actualHeight) {
			this.decrementButton.set_height(this.actualHeight);
		}
		if(this.incrementButton.get_width() != buttonWidth) {
			this.incrementButton.set_width(buttonWidth);
		}
		if(this.incrementButton.get_height() != this.actualHeight) {
			this.incrementButton.set_height(this.actualHeight);
		}
		switch(this.get_textInputPosition()._hx_index) {
		case 0:
			this.textInput.set_x(0.0);
			this.textInput.set_y(0.0);
			this.incrementButton.set_x(this.actualWidth - buttonWidth);
			this.incrementButton.set_y(0.0);
			this.decrementButton.set_x(this.actualWidth - 2.0 * buttonWidth - this.get_buttonGap());
			this.decrementButton.set_y(0.0);
			break;
		case 1:
			this.decrementButton.set_x(0.0);
			this.decrementButton.set_y(0.0);
			this.incrementButton.set_x(this.actualWidth - buttonWidth);
			this.incrementButton.set_y(0.0);
			this.textInput.set_x(buttonWidth + this.get_textInputGap());
			this.textInput.set_y(0.0);
			break;
		case 2:
			this.decrementButton.set_x(0.0);
			this.decrementButton.set_y(0.0);
			this.incrementButton.set_x(buttonWidth + this.get_buttonGap());
			this.incrementButton.set_y(0.0);
			this.textInput.set_x(this.actualWidth - textInputWidth);
			this.textInput.set_y(0.0);
			break;
		default:
			throw new openfl_errors_ArgumentError("Invalid text input position: " + Std.string(this.get_textInputPosition()));
		}
	}
	,layoutContentWithVerticalButtons: function() {
		switch(this.get_textInputPosition()._hx_index) {
		case 0:
			var buttonWidth = Math.max(this.incrementButton.get_width(),this.decrementButton.get_width());
			var buttonHeight = (this.actualHeight - this.get_buttonGap()) / 2.0;
			var textInputWidth = Math.max(0.0,this.actualWidth - buttonWidth - this.get_textInputGap());
			if(this.textInput.get_width() != textInputWidth) {
				this.textInput.set_width(textInputWidth);
			}
			if(this.textInput.get_height() != this.actualHeight) {
				this.textInput.set_height(this.actualHeight);
			}
			this.textInput.set_x(0.0);
			this.textInput.set_y(0.0);
			this.incrementButton.set_x(this.actualWidth - buttonWidth);
			this.incrementButton.set_y(0.0);
			if(this.incrementButton.get_width() != buttonWidth) {
				this.incrementButton.set_width(buttonWidth);
			}
			if(this.incrementButton.get_height() != buttonHeight) {
				this.incrementButton.set_height(buttonHeight);
			}
			this.decrementButton.set_x(this.actualWidth - buttonWidth);
			this.decrementButton.set_y(this.actualHeight - buttonHeight);
			if(this.decrementButton.get_width() != buttonWidth) {
				this.decrementButton.set_width(buttonWidth);
			}
			if(this.decrementButton.get_height() != buttonHeight) {
				this.decrementButton.set_height(buttonHeight);
			}
			break;
		case 1:
			var buttonHeight = Math.max(this.decrementButton.get_height(),this.incrementButton.get_height());
			var textInputHeight = Math.max(0.0,this.actualHeight - 2.0 * (buttonHeight + this.get_textInputGap()));
			this.incrementButton.set_x(0.0);
			this.incrementButton.set_y(0.0);
			if(this.incrementButton.get_width() != this.actualWidth) {
				this.incrementButton.set_width(this.actualWidth);
			}
			if(this.incrementButton.get_height() != buttonHeight) {
				this.incrementButton.set_height(buttonHeight);
			}
			this.textInput.set_x(0.0);
			this.textInput.set_y(buttonHeight + this.get_textInputGap());
			if(this.textInput.get_width() != this.actualWidth) {
				this.textInput.set_width(this.actualWidth);
			}
			if(this.textInput.get_height() != textInputHeight) {
				this.textInput.set_height(textInputHeight);
			}
			this.decrementButton.set_x(0.0);
			this.decrementButton.set_y(this.actualHeight - buttonHeight);
			if(this.decrementButton.get_width() != this.actualWidth) {
				this.decrementButton.set_width(this.actualWidth);
			}
			if(this.decrementButton.get_height() != buttonHeight) {
				this.decrementButton.set_height(buttonHeight);
			}
			break;
		case 2:
			var buttonWidth = Math.max(this.incrementButton.get_width(),this.decrementButton.get_width());
			var buttonHeight = (this.actualHeight - this.get_buttonGap()) / 2.0;
			var textInputWidth = Math.max(0.0,this.actualWidth - buttonWidth - this.get_textInputGap());
			if(this.textInput.get_width() != textInputWidth) {
				this.textInput.set_width(textInputWidth);
			}
			if(this.textInput.get_height() != this.actualHeight) {
				this.textInput.set_height(this.actualHeight);
			}
			this.textInput.set_x(this.actualWidth - textInputWidth);
			this.textInput.set_y(0.0);
			this.incrementButton.set_x(0.0);
			this.incrementButton.set_y(0.0);
			if(this.incrementButton.get_width() != buttonWidth) {
				this.incrementButton.set_width(buttonWidth);
			}
			if(this.incrementButton.get_height() != buttonHeight) {
				this.incrementButton.set_height(buttonHeight);
			}
			this.decrementButton.set_x(0.0);
			this.decrementButton.set_y(this.actualHeight - buttonHeight);
			if(this.decrementButton.get_width() != buttonWidth) {
				this.decrementButton.set_width(buttonWidth);
			}
			if(this.decrementButton.get_height() != buttonHeight) {
				this.decrementButton.set_height(buttonHeight);
			}
			break;
		default:
			throw new openfl_errors_ArgumentError("Invalid text input position: " + Std.string(this.get_textInputPosition()));
		}
	}
	,createDecrementButton: function() {
		this.destroyDecrementButton();
		var factory = this._decrementButtonFactory != null ? this._decrementButtonFactory : feathers_controls_NumericStepper.defaultDecrementButtonFactory;
		this._oldDecrementButtonFactory = factory;
		this.decrementButton = factory.create();
		if(this.decrementButton.get_variant() == null) {
			this.decrementButton.set_variant(this.get_customDecrementButtonVariant() != null ? this.get_customDecrementButtonVariant() : feathers_controls_NumericStepper.CHILD_VARIANT_DECREMENT_BUTTON);
		}
		if(this.decrementButton.get_text() == null) {
			this.decrementButton.set_text("-");
		}
		this.decrementButton.addEventListener("mouseDown",$bind(this,this.numericStepper_decrementButton_mouseDownHandler));
		this.decrementButton.addEventListener("touchBegin",$bind(this,this.numericStepper_decrementButton_touchBeginHandler));
		this.decrementButton.initializeNow();
		this.decrementButtonMeasurements.save(this.decrementButton);
		this.addChild(this.decrementButton);
	}
	,destroyDecrementButton: function() {
		if(this.decrementButton == null) {
			return;
		}
		this.decrementButton.removeEventListener("mouseDown",$bind(this,this.numericStepper_decrementButton_mouseDownHandler));
		this.decrementButton.removeEventListener("touchBegin",$bind(this,this.numericStepper_decrementButton_touchBeginHandler));
		this.removeChild(this.decrementButton);
		if(this._oldDecrementButtonFactory.destroy != null) {
			this._oldDecrementButtonFactory.destroy(this.decrementButton);
		}
		this._oldDecrementButtonFactory = null;
		this.decrementButton = null;
	}
	,createIncrementButton: function() {
		this.destroyIncrementButton();
		var factory = this._incrementButtonFactory != null ? this._incrementButtonFactory : feathers_controls_NumericStepper.defaultIncrementButtonFactory;
		this._oldIncrementButtonFactory = factory;
		this.incrementButton = factory.create();
		if(this.incrementButton.get_variant() == null) {
			this.incrementButton.set_variant(this.get_customIncrementButtonVariant() != null ? this.get_customIncrementButtonVariant() : feathers_controls_NumericStepper.CHILD_VARIANT_INCREMENT_BUTTON);
		}
		if(this.incrementButton.get_text() == null) {
			this.incrementButton.set_text("+");
		}
		this.incrementButton.addEventListener("mouseDown",$bind(this,this.numericStepper_incrementButton_mouseDownHandler));
		this.incrementButton.addEventListener("touchBegin",$bind(this,this.numericStepper_incrementButton_touchBeginHandler));
		this.incrementButton.initializeNow();
		this.incrementButtonMeasurements.save(this.incrementButton);
		this.addChild(this.incrementButton);
	}
	,destroyIncrementButton: function() {
		if(this.incrementButton == null) {
			return;
		}
		this.incrementButton.removeEventListener("mouseDown",$bind(this,this.numericStepper_incrementButton_mouseDownHandler));
		this.incrementButton.removeEventListener("touchBegin",$bind(this,this.numericStepper_incrementButton_touchBeginHandler));
		this.removeChild(this.incrementButton);
		if(this._oldIncrementButtonFactory.destroy != null) {
			this._oldIncrementButtonFactory.destroy(this.incrementButton);
		}
		this._oldIncrementButtonFactory = null;
		this.incrementButton = null;
	}
	,createTextInput: function() {
		this.destroyTextInput();
		var factory = this._textInputFactory != null ? this._textInputFactory : feathers_controls_NumericStepper.defaultTextInputFactory;
		this._oldTextInputFactory = factory;
		this.textInput = factory.create();
		if(this.textInput.get_variant() == null) {
			this.textInput.set_variant(this.get_customTextInputVariant() != null ? this.get_customTextInputVariant() : feathers_controls_NumericStepper.CHILD_VARIANT_TEXT_INPUT);
		}
		this.textInput.addEventListener("keyDown",$bind(this,this.numericStepper_textInput_keyDownHandler));
		this.textInput.addEventListener("change",$bind(this,this.numericStepper_textInput_changeHandler));
		this.textInput.addEventListener("focusIn",$bind(this,this.numericStepper_textInput_focusInHandler));
		this.textInput.addEventListener("focusOut",$bind(this,this.numericStepper_textInput_focusOutHandler));
		this.textInput.initializeNow();
		this.textInputMeasurements.save(this.textInput);
		this.addChild(this.textInput);
	}
	,destroyTextInput: function() {
		if(this.textInput == null) {
			return;
		}
		this.textInput.removeEventListener("keyDown",$bind(this,this.numericStepper_textInput_keyDownHandler));
		this.textInput.removeEventListener("change",$bind(this,this.numericStepper_textInput_changeHandler));
		this.textInput.removeEventListener("focusIn",$bind(this,this.numericStepper_textInput_focusInHandler));
		this.textInput.removeEventListener("focusOut",$bind(this,this.numericStepper_textInput_focusOutHandler));
		this.removeChild(this.textInput);
		if(this._oldTextInputFactory.destroy != null) {
			this._oldTextInputFactory.destroy(this.textInput);
		}
		this._oldTextInputFactory = null;
		this.textInput = null;
	}
	,restrictValue: function(value) {
		if(this._snapInterval != 0.0 && value != this._minimum && value != this._maximum) {
			value = feathers_utils_MathUtil.roundToNearest(value,this._snapInterval);
		}
		if(value < this._minimum) {
			value = this._minimum;
		} else if(value > this._maximum) {
			value = this._maximum;
		}
		return value;
	}
	,decrement: function() {
		var newValue = this._value - this._step;
		newValue = this.restrictValue(newValue);
		this.set_value(newValue);
	}
	,increment: function() {
		var newValue = this._value + this._step;
		newValue = this.restrictValue(newValue);
		this.set_value(newValue);
	}
	,numericStepper_focusInHandler: function(event) {
		if(this.stage != null && this.stage.get_focus() != null && this.textInput != null && !this.textInput.contains(this.stage.get_focus())) {
			event.stopImmediatePropagation();
			this.stage.set_focus(this.textInput);
		}
	}
	,canKeyCodeUpdateValue: function(keyCode) {
		if(!(keyCode == 38 || keyCode == 40 || keyCode == 36)) {
			return keyCode == 35;
		} else {
			return true;
		}
	}
	,updateValueWithKeyboard: function(event) {
		if(event.isDefaultPrevented()) {
			return;
		}
		if(!this._enabled || !this.canKeyCodeUpdateValue(event.keyCode)) {
			return;
		}
		this.parseTextInputValue();
		var newValue = this._value;
		switch(event.keyCode) {
		case 35:
			newValue = this._maximum;
			break;
		case 36:
			newValue = this._minimum;
			break;
		case 38:
			newValue += this._step;
			break;
		case 40:
			newValue -= this._step;
			break;
		default:
			return;
		}
		if(newValue < this._minimum) {
			newValue = this._minimum;
		} else if(newValue > this._maximum) {
			newValue = this._maximum;
		}
		event.preventDefault();
		this.set_value(newValue);
		if(this.textInput.get_selectionActiveIndex() != this.textInput.get_selectionAnchorIndex()) {
			this.textInput.selectRange(this.textInput.get_selectionAnchorIndex(),this.textInput.get_selectionAnchorIndex());
		}
	}
	,numericStepper_decrementButton_mouseDownHandler: function(event) {
		if(!this._enabled || !this.decrementButton.get_enabled() || this.stage == null) {
			return;
		}
		var exclusivePointer = feathers_utils_ExclusivePointer.forStage(this.stage);
		var result = exclusivePointer.claimMouse(this);
		if(!result) {
			return;
		}
		this.decrement();
	}
	,numericStepper_decrementButton_touchBeginHandler: function(event) {
		if(event.isPrimaryTouchPoint) {
			return;
		}
		if(!this._enabled || !this.decrementButton.get_enabled() || this.stage == null) {
			return;
		}
		var exclusivePointer = feathers_utils_ExclusivePointer.forStage(this.stage);
		var result = exclusivePointer.claimMouse(this);
		if(!result) {
			return;
		}
		this.decrement();
	}
	,numericStepper_incrementButton_mouseDownHandler: function(event) {
		if(!this._enabled || !this.incrementButton.get_enabled() || this.stage == null) {
			return;
		}
		var exclusivePointer = feathers_utils_ExclusivePointer.forStage(this.stage);
		var result = exclusivePointer.claimMouse(this);
		if(!result) {
			return;
		}
		this.increment();
	}
	,numericStepper_incrementButton_touchBeginHandler: function(event) {
		if(event.isPrimaryTouchPoint) {
			return;
		}
		if(!this._enabled || !this.incrementButton.get_enabled() || this.stage == null) {
			return;
		}
		var exclusivePointer = feathers_utils_ExclusivePointer.forStage(this.stage);
		var result = exclusivePointer.claimMouse(this);
		if(!result) {
			return;
		}
		this.increment();
	}
	,numericStepper_textInput_keyDownHandler: function(event) {
		if(!this._enabled || event.isDefaultPrevented()) {
			return;
		}
		if(event.keyCode == 13) {
			event.preventDefault();
			this.parseTextInputValue();
			return;
		} else {
			this.updateValueWithKeyboard(event);
		}
	}
	,numericStepper_textInput_focusInHandler: function(event) {
		this._pendingTextInputChanges = false;
	}
	,numericStepper_textInput_changeHandler: function(event) {
		this._pendingTextInputChanges = true;
	}
	,numericStepper_textInput_focusOutHandler: function(event) {
		if(!this._pendingTextInputChanges) {
			return;
		}
		this.parseTextInputValue();
	}
	,__customDecrementButtonVariant: null
	,get_customDecrementButtonVariant: function() {
		return this.__customDecrementButtonVariant;
	}
	,set_customDecrementButtonVariant: function(value) {
		if(!this.setStyle("customDecrementButtonVariant")) {
			return this.__customDecrementButtonVariant;
		}
		if(this.__customDecrementButtonVariant == value) {
			return this.__customDecrementButtonVariant;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_customDecrementButtonVariant);
		this.__customDecrementButtonVariant = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__customDecrementButtonVariant;
	}
	,clearStyle_customDecrementButtonVariant: function() {
		this.set_customDecrementButtonVariant(null);
		return this.get_customDecrementButtonVariant();
	}
	,__customIncrementButtonVariant: null
	,get_customIncrementButtonVariant: function() {
		return this.__customIncrementButtonVariant;
	}
	,set_customIncrementButtonVariant: function(value) {
		if(!this.setStyle("customIncrementButtonVariant")) {
			return this.__customIncrementButtonVariant;
		}
		if(this.__customIncrementButtonVariant == value) {
			return this.__customIncrementButtonVariant;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_customIncrementButtonVariant);
		this.__customIncrementButtonVariant = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__customIncrementButtonVariant;
	}
	,clearStyle_customIncrementButtonVariant: function() {
		this.set_customIncrementButtonVariant(null);
		return this.get_customIncrementButtonVariant();
	}
	,__customTextInputVariant: null
	,get_customTextInputVariant: function() {
		return this.__customTextInputVariant;
	}
	,set_customTextInputVariant: function(value) {
		if(!this.setStyle("customTextInputVariant")) {
			return this.__customTextInputVariant;
		}
		if(this.__customTextInputVariant == value) {
			return this.__customTextInputVariant;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_customTextInputVariant);
		this.__customTextInputVariant = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__customTextInputVariant;
	}
	,clearStyle_customTextInputVariant: function() {
		this.set_customTextInputVariant(null);
		return this.get_customTextInputVariant();
	}
	,__textInputPosition: null
	,get_textInputPosition: function() {
		return this.__textInputPosition;
	}
	,set_textInputPosition: function(value) {
		if(!this.setStyle("textInputPosition")) {
			return this.__textInputPosition;
		}
		if(this.__textInputPosition == value) {
			return this.__textInputPosition;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_textInputPosition);
		this.__textInputPosition = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__textInputPosition;
	}
	,clearStyle_textInputPosition: function() {
		this.set_textInputPosition(feathers_layout_HorizontalAlign.CENTER);
		return this.get_textInputPosition();
	}
	,__buttonDirection: null
	,get_buttonDirection: function() {
		return this.__buttonDirection;
	}
	,set_buttonDirection: function(value) {
		if(!this.setStyle("buttonDirection")) {
			return this.__buttonDirection;
		}
		if(this.__buttonDirection == value) {
			return this.__buttonDirection;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_buttonDirection);
		this.__buttonDirection = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__buttonDirection;
	}
	,clearStyle_buttonDirection: function() {
		this.set_buttonDirection(feathers_layout_Direction.HORIZONTAL);
		return this.get_buttonDirection();
	}
	,__textInputGap: null
	,get_textInputGap: function() {
		return this.__textInputGap;
	}
	,set_textInputGap: function(value) {
		if(!this.setStyle("textInputGap")) {
			return this.__textInputGap;
		}
		if(this.__textInputGap == value) {
			return this.__textInputGap;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_textInputGap);
		this.__textInputGap = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__textInputGap;
	}
	,clearStyle_textInputGap: function() {
		this.set_textInputGap(0.0);
		return this.get_textInputGap();
	}
	,__buttonGap: null
	,get_buttonGap: function() {
		return this.__buttonGap;
	}
	,set_buttonGap: function(value) {
		if(!this.setStyle("buttonGap")) {
			return this.__buttonGap;
		}
		if(this.__buttonGap == value) {
			return this.__buttonGap;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_buttonGap);
		this.__buttonGap = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__buttonGap;
	}
	,clearStyle_buttonGap: function() {
		this.set_buttonGap(0.0);
		return this.get_buttonGap();
	}
	,__class__: feathers_controls_NumericStepper
	,__properties__: $extend(feathers_core_FeathersControl.prototype.__properties__,{set_buttonGap:"set_buttonGap",get_buttonGap:"get_buttonGap",set_textInputGap:"set_textInputGap",get_textInputGap:"get_textInputGap",set_buttonDirection:"set_buttonDirection",get_buttonDirection:"get_buttonDirection",set_textInputPosition:"set_textInputPosition",get_textInputPosition:"get_textInputPosition",set_customTextInputVariant:"set_customTextInputVariant",get_customTextInputVariant:"get_customTextInputVariant",set_customIncrementButtonVariant:"set_customIncrementButtonVariant",get_customIncrementButtonVariant:"get_customIncrementButtonVariant",set_customDecrementButtonVariant:"set_customDecrementButtonVariant",get_customDecrementButtonVariant:"get_customDecrementButtonVariant",set_textInputFactory:"set_textInputFactory",get_textInputFactory:"get_textInputFactory",set_incrementButtonFactory:"set_incrementButtonFactory",get_incrementButtonFactory:"get_incrementButtonFactory",set_decrementButtonFactory:"set_decrementButtonFactory",get_decrementButtonFactory:"get_decrementButtonFactory",get_stageFocusTarget:"get_stageFocusTarget",set_valueParseFunction:"set_valueParseFunction",get_valueParseFunction:"get_valueParseFunction",set_valueFormatFunction:"set_valueFormatFunction",get_valueFormatFunction:"get_valueFormatFunction",set_enableButtonsAtRangeLimits:"set_enableButtonsAtRangeLimits",get_enableButtonsAtRangeLimits:"get_enableButtonsAtRangeLimits",set_editable:"set_editable",get_editable:"get_editable",set_snapInterval:"set_snapInterval",get_snapInterval:"get_snapInterval",set_step:"set_step",get_step:"get_step",set_maximum:"set_maximum",get_maximum:"get_maximum",set_minimum:"set_minimum",get_minimum:"get_minimum",set_value:"set_value",get_value:"get_value"})
});
var feathers_controls_PageIndicator = function(maxSelectedIndex,changeListener) {
	if(maxSelectedIndex == null) {
		maxSelectedIndex = -1;
	}
	this.__disabledBackgroundSkin = null;
	this.__backgroundSkin = null;
	this.__layout = null;
	this.__customToggleButtonVariant = null;
	this._currentItemState = new feathers_data_PageIndicatorItemState();
	this._ignoreChildChanges = false;
	this._layoutResult = new feathers_layout_LayoutBoundsResult();
	this._layoutMeasurements = new feathers_layout_Measurements();
	this._interactionMode = feathers_controls_PageIndicatorInteractionMode.PREVIOUS_NEXT;
	this._backgroundSkinMeasurements = null;
	this._currentBackgroundSkin = null;
	this._ignoreSelectionChange = false;
	this._layoutItems = [];
	this.activeToggleButtons = [];
	this.inactiveToggleButtons = [];
	this._toggleButtonRecycler = feathers_utils_DisplayObjectRecycler.withClass(feathers_controls_ToggleButton);
	this._previousCustomToggleButtonVariant = null;
	this._maxSelectedIndex = -1;
	this._selectedIndex = -1;
	this.initializePageIndicatorTheme();
	feathers_core_FeathersControl.call(this);
	this.mouseChildren = this._interactionMode == feathers_controls_PageIndicatorInteractionMode.PRECISE;
	this.set_tabEnabled(true);
	this.set_tabChildren(false);
	this.set_maxSelectedIndex(maxSelectedIndex);
	this.addEventListener("click",$bind(this,this.pageIndicator_clickHandler));
	this.addEventListener("touchTap",$bind(this,this.pageIndicator_touchTapHandler));
	this.addEventListener("keyDown",$bind(this,this.pageIndicator_keyDownHandler));
	if(changeListener != null) {
		this.addEventListener("change",changeListener);
	}
};
$hxClasses["feathers.controls.PageIndicator"] = feathers_controls_PageIndicator;
feathers_controls_PageIndicator.__name__ = "feathers.controls.PageIndicator";
feathers_controls_PageIndicator.__interfaces__ = [feathers_core_IFocusObject,feathers_core_IIndexSelector];
feathers_controls_PageIndicator.__super__ = feathers_core_FeathersControl;
feathers_controls_PageIndicator.prototype = $extend(feathers_core_FeathersControl.prototype,{
	_selectedIndex: null
	,get_selectedIndex: function() {
		return this._selectedIndex;
	}
	,set_selectedIndex: function(value) {
		if(this._selectedIndex == value) {
			return this._selectedIndex;
		}
		if(value < -1 || value > this._maxSelectedIndex) {
			throw new openfl_errors_RangeError("Index " + value + " is out of range " + this._maxSelectedIndex + " for PageIndicator.");
		}
		this._selectedIndex = value;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._selectedIndex;
	}
	,_maxSelectedIndex: null
	,get_maxSelectedIndex: function() {
		return this._maxSelectedIndex;
	}
	,set_maxSelectedIndex: function(value) {
		if(this._maxSelectedIndex == value) {
			return this._maxSelectedIndex;
		}
		this._maxSelectedIndex = value;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		if(this._maxSelectedIndex >= 0 && this._selectedIndex < 0) {
			this.set_selectedIndex(0);
		} else if(this.get_selectedIndex() > this._maxSelectedIndex) {
			this.set_selectedIndex(this._maxSelectedIndex);
		}
		return this._maxSelectedIndex;
	}
	,_previousCustomToggleButtonVariant: null
	,_oldToggleButtonRecycler: null
	,_toggleButtonRecycler: null
	,get_toggleButtonRecycler: function() {
		return this._toggleButtonRecycler;
	}
	,set_toggleButtonRecycler: function(value) {
		if(this._toggleButtonRecycler == value) {
			return this._toggleButtonRecycler;
		}
		this._oldToggleButtonRecycler = this._toggleButtonRecycler;
		this._toggleButtonRecycler = value;
		this.setInvalid(feathers_controls_PageIndicator.INVALIDATION_FLAG_TOGGLE_BUTTON_FACTORY);
		return this._toggleButtonRecycler;
	}
	,inactiveToggleButtons: null
	,activeToggleButtons: null
	,_layoutItems: null
	,_ignoreSelectionChange: null
	,_currentBackgroundSkin: null
	,_backgroundSkinMeasurements: null
	,_interactionMode: null
	,get_interactionMode: function() {
		return this._interactionMode;
	}
	,set_interactionMode: function(value) {
		if(this._interactionMode == value) {
			return this._interactionMode;
		}
		this._interactionMode = value;
		this.mouseChildren = this._interactionMode == feathers_controls_PageIndicatorInteractionMode.PRECISE;
		return this._interactionMode;
	}
	,_layoutMeasurements: null
	,_layoutResult: null
	,_ignoreChildChanges: null
	,_currentItemState: null
	,indexToToggleButton: function(index) {
		if(index < 0 || index >= this.activeToggleButtons.length) {
			return null;
		}
		return this.activeToggleButtons[index];
	}
	,dispose: function() {
		this.refreshInactiveToggleButtons(true);
		this.set_maxSelectedIndex(-1);
		feathers_core_FeathersControl.prototype.dispose.call(this);
	}
	,initializePageIndicatorTheme: function() {
		feathers_themes_steel_components_SteelPageIndicatorStyles.initialize();
	}
	,update: function() {
		var dataInvalid = this.isInvalid(feathers_core_InvalidationFlag.DATA);
		var dataInvalid = this.isInvalid(feathers_core_InvalidationFlag.DATA);
		var layoutInvalid = this.isInvalid(feathers_core_InvalidationFlag.LAYOUT);
		var selectionInvalid = this.isInvalid(feathers_core_InvalidationFlag.SELECTION);
		var stateInvalid = this.isInvalid(feathers_core_InvalidationFlag.STATE);
		var stylesInvalid = this.isInvalid(feathers_core_InvalidationFlag.STYLES);
		if(this._previousCustomToggleButtonVariant != this.get_customToggleButtonVariant()) {
			this.setInvalidationFlag(feathers_controls_PageIndicator.INVALIDATION_FLAG_TOGGLE_BUTTON_FACTORY);
		}
		var buttonsInvalid = this.isInvalid(feathers_controls_PageIndicator.INVALIDATION_FLAG_TOGGLE_BUTTON_FACTORY);
		if(stylesInvalid || stateInvalid) {
			this.refreshBackgroundSkin();
		}
		if(buttonsInvalid || selectionInvalid || stateInvalid || dataInvalid) {
			this.refreshToggleButtons();
		}
		this.refreshViewPortBounds();
		this.handleLayout();
		this.handleLayoutResult();
		this.layoutBackgroundSkin();
		this.validateChildren();
		this._previousCustomToggleButtonVariant = this.get_customToggleButtonVariant();
	}
	,refreshViewPortBounds: function() {
		this._layoutMeasurements.save(this);
	}
	,handleLayout: function() {
		if(!((this.get_layout()) instanceof feathers_layout_HorizontalLayout) && !((this.get_layout()) instanceof feathers_layout_VerticalLayout)) {
			throw new openfl_errors_ArgumentError("PageIndicator must use HorizontalLayout or VerticalLayout");
		}
		var oldIgnoreChildChanges = this._ignoreChildChanges;
		this._ignoreChildChanges = true;
		this._layoutResult.reset();
		if(this.get_layout() != null) {
			this.get_layout().layout(this._layoutItems,this._layoutMeasurements,this._layoutResult);
		}
		this._ignoreChildChanges = oldIgnoreChildChanges;
	}
	,handleLayoutResult: function() {
		var viewPortWidth = this._layoutResult.viewPortWidth;
		var viewPortHeight = this._layoutResult.viewPortHeight;
		this.saveMeasurements(viewPortWidth,viewPortHeight,viewPortWidth,viewPortHeight);
	}
	,validateChildren: function() {
		var _g = 0;
		var _g1 = this.activeToggleButtons;
		while(_g < _g1.length) {
			var button = _g1[_g];
			++_g;
			button.validateNow();
		}
	}
	,refreshToggleButtons: function() {
		this._layoutItems.length = 0;
		this._layoutItems.length = this._maxSelectedIndex + 1;
		var buttonsInvalid = this.isInvalid(feathers_controls_PageIndicator.INVALIDATION_FLAG_TOGGLE_BUTTON_FACTORY);
		this.refreshInactiveToggleButtons(buttonsInvalid);
		this.recoverInactiveToggleButtons();
		var _g = 0;
		var _g1 = this._maxSelectedIndex + 1;
		while(_g < _g1) {
			var i = _g++;
			var button = this.createToggleButton(i);
			this._layoutItems[i] = button;
		}
		this.freeInactiveToggleButtons();
		if(this.inactiveToggleButtons.length > 0) {
			var c = js_Boot.getClass(this);
			throw new openfl_errors_IllegalOperationError(c.__name__ + ": inactive item renderers should be empty after updating.");
		}
	}
	,refreshInactiveToggleButtons: function(factoryInvalid) {
		var temp = this.inactiveToggleButtons;
		this.inactiveToggleButtons = this.activeToggleButtons;
		this.activeToggleButtons = temp;
		if(this.activeToggleButtons.length > 0) {
			var c = js_Boot.getClass(this);
			throw new openfl_errors_IllegalOperationError(c.__name__ + ": active item renderers should be empty before updating.");
		}
		if(factoryInvalid) {
			this.recoverInactiveToggleButtons();
			this.freeInactiveToggleButtons();
			this._oldToggleButtonRecycler = null;
		}
	}
	,recoverInactiveToggleButtons: function() {
		var recycler = this._oldToggleButtonRecycler != null ? this._oldToggleButtonRecycler : this._toggleButtonRecycler;
		var _g = 0;
		var _g1 = this.inactiveToggleButtons;
		while(_g < _g1.length) {
			var button = _g1[_g];
			++_g;
			if(button == null) {
				continue;
			}
			button.removeEventListener("change",$bind(this,this.pageIndicator_toggleButton_changeHandler));
			this._currentItemState.owner = this;
			this._currentItemState.index = -1;
			this._currentItemState.selected = false;
			this._currentItemState.enabled = true;
			var oldIgnoreSelectionChange = this._ignoreSelectionChange;
			this._ignoreSelectionChange = true;
			if(recycler.reset != null) {
				recycler.reset(button,this._currentItemState);
			}
			button.set_selected(this._currentItemState.selected);
			button.set_enabled(this._currentItemState.enabled);
			this._ignoreSelectionChange = oldIgnoreSelectionChange;
		}
	}
	,freeInactiveToggleButtons: function() {
		var recycler = this._oldToggleButtonRecycler != null ? this._oldToggleButtonRecycler : this._toggleButtonRecycler;
		var _g = 0;
		var _g1 = this.inactiveToggleButtons;
		while(_g < _g1.length) {
			var button = _g1[_g];
			++_g;
			if(button == null) {
				continue;
			}
			this.destroyToggleButton(button,recycler);
		}
		this.inactiveToggleButtons.length = 0;
	}
	,refreshBackgroundSkin: function() {
		var oldSkin = this._currentBackgroundSkin;
		this._currentBackgroundSkin = this.getCurrentBackgroundSkin();
		if(this._currentBackgroundSkin == oldSkin) {
			return;
		}
		this.removeCurrentBackgroundSkin(oldSkin);
		this.addCurrentBackgroundSkin(this._currentBackgroundSkin);
	}
	,getCurrentBackgroundSkin: function() {
		if(!this._enabled && this.get_disabledBackgroundSkin() != null) {
			return this.get_disabledBackgroundSkin();
		}
		return this.get_backgroundSkin();
	}
	,addCurrentBackgroundSkin: function(skin) {
		if(skin == null) {
			this._backgroundSkinMeasurements = null;
			return;
		}
		if(js_Boot.__implements(skin,feathers_core_IUIControl)) {
			skin.initializeNow();
		}
		if(this._backgroundSkinMeasurements == null) {
			this._backgroundSkinMeasurements = new feathers_layout_Measurements(skin);
		} else {
			this._backgroundSkinMeasurements.save(skin);
		}
		if(js_Boot.__implements(skin,feathers_skins_IProgrammaticSkin)) {
			skin.set_uiContext(this);
		}
		this.addChildAt(skin,0);
	}
	,removeCurrentBackgroundSkin: function(skin) {
		if(skin == null) {
			return;
		}
		if(js_Boot.__implements(skin,feathers_skins_IProgrammaticSkin)) {
			skin.set_uiContext(null);
		}
		this._backgroundSkinMeasurements.restore(skin);
		if(skin.parent == this) {
			this.removeChild(skin);
		}
	}
	,layoutBackgroundSkin: function() {
		if(this._currentBackgroundSkin == null) {
			this.get_graphics().clear();
			this.get_graphics().beginFill(16711935,0.0);
			this.get_graphics().drawRect(0,0,this.actualWidth,this.actualHeight);
			this.get_graphics().endFill();
			return;
		}
		this._currentBackgroundSkin.set_x(0.0);
		this._currentBackgroundSkin.set_y(0.0);
		if(this._currentBackgroundSkin.get_width() != this.actualWidth) {
			this._currentBackgroundSkin.set_width(this.actualWidth);
		}
		if(this._currentBackgroundSkin.get_height() != this.actualHeight) {
			this._currentBackgroundSkin.set_height(this.actualHeight);
		}
		if(js_Boot.__implements(this._currentBackgroundSkin,feathers_core_IValidating)) {
			this._currentBackgroundSkin.validateNow();
		}
	}
	,createToggleButton: function(index) {
		var depthOffset = this._currentBackgroundSkin != null ? 1 : 0;
		var button = null;
		if(this.inactiveToggleButtons.length == 0) {
			button = this._toggleButtonRecycler.create();
			if(button.get_variant() == null) {
				var variant = this.get_customToggleButtonVariant() != null ? this.get_customToggleButtonVariant() : feathers_controls_PageIndicator.CHILD_VARIANT_TOGGLE_BUTTON;
				button.set_variant(variant);
			}
			button.initializeNow();
			this.addChildAt(button,index + depthOffset);
		} else {
			button = this.inactiveToggleButtons.shift();
			this.setChildIndex(button,index + depthOffset);
		}
		this.refreshToggleButtonProperties(button,index);
		button.addEventListener("change",$bind(this,this.pageIndicator_toggleButton_changeHandler));
		this.activeToggleButtons.push(button);
		return button;
	}
	,destroyToggleButton: function(button,recycler) {
		this.removeChild(button);
		if(recycler.destroy != null) {
			recycler.destroy(button);
		}
	}
	,populateCurrentItemState: function(index) {
		this._currentItemState.owner = this;
		this._currentItemState.index = index;
		this._currentItemState.selected = index == this._selectedIndex;
		this._currentItemState.enabled = this._enabled;
	}
	,refreshToggleButtonProperties: function(button,index) {
		this.populateCurrentItemState(index);
		var oldIgnoreSelectionChange = this._ignoreSelectionChange;
		this._ignoreSelectionChange = true;
		if(this._toggleButtonRecycler.update != null) {
			this._toggleButtonRecycler.update(button,this._currentItemState);
		}
		button.set_selected(this._currentItemState.selected);
		button.set_enabled(this._currentItemState.enabled);
		this._ignoreSelectionChange = oldIgnoreSelectionChange;
	}
	,navigateWithKeyboard: function(event) {
		if(event.isDefaultPrevented()) {
			return;
		}
		var result = this._selectedIndex;
		switch(event.keyCode) {
		case 33:
			--result;
			break;
		case 34:
			++result;
			break;
		case 35:
			result = this._maxSelectedIndex;
			break;
		case 36:
			result = 0;
			break;
		case 37:
			--result;
			break;
		case 38:
			if(event.keyLocation == 4) {
				return;
			}
			++result;
			break;
		case 39:
			++result;
			break;
		case 40:
			if(event.keyLocation == 4) {
				return;
			}
			--result;
			break;
		default:
			return;
		}
		if(result < 0) {
			result = 0;
		} else if(result > this._maxSelectedIndex) {
			result = this._maxSelectedIndex;
		}
		event.preventDefault();
		this.set_selectedIndex(result);
	}
	,pageIndicator_keyDownHandler: function(event) {
		if(!this._enabled) {
			return;
		}
		this.navigateWithKeyboard(event);
	}
	,pageIndicator_toggleButton_changeHandler: function(event) {
		if(this._ignoreSelectionChange) {
			return;
		}
		var button = js_Boot.__cast(event.currentTarget , feathers_controls_ToggleButton);
		if(!button.get_selected()) {
			button.set_selected(true);
			return;
		}
		this.set_selectedIndex(this.activeToggleButtons.indexOf(button));
	}
	,handleClickOrTap: function(localX,localY) {
		var selectedIndex = this._selectedIndex;
		if(selectedIndex != -1) {
			var button = this.activeToggleButtons[selectedIndex];
			if(((this.get_layout()) instanceof feathers_layout_VerticalLayout)) {
				if(localY < button.get_y()) {
					--selectedIndex;
				} else if(localY > button.get_y() + button.get_height()) {
					++selectedIndex;
				}
			} else if(localX < button.get_x()) {
				--selectedIndex;
			} else if(localX > button.get_x() + button.get_width()) {
				++selectedIndex;
			}
		}
		if(selectedIndex < 0) {
			selectedIndex = 0;
		} else if(selectedIndex > this._maxSelectedIndex) {
			selectedIndex = this._maxSelectedIndex;
		}
		this.set_selectedIndex(selectedIndex);
	}
	,pageIndicator_clickHandler: function(event) {
		if(!this._enabled || this._interactionMode != feathers_controls_PageIndicatorInteractionMode.PREVIOUS_NEXT) {
			return;
		}
		this.handleClickOrTap(event.localX,event.localY);
	}
	,pageIndicator_touchTapHandler: function(event) {
		if(!this._enabled || this._interactionMode != feathers_controls_PageIndicatorInteractionMode.PREVIOUS_NEXT) {
			return;
		}
		if(event.isPrimaryTouchPoint) {
			return;
		}
		this.handleClickOrTap(event.localX,event.localY);
	}
	,__customToggleButtonVariant: null
	,get_customToggleButtonVariant: function() {
		return this.__customToggleButtonVariant;
	}
	,set_customToggleButtonVariant: function(value) {
		if(!this.setStyle("customToggleButtonVariant")) {
			return this.__customToggleButtonVariant;
		}
		if(this.__customToggleButtonVariant == value) {
			return this.__customToggleButtonVariant;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_customToggleButtonVariant);
		this.__customToggleButtonVariant = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__customToggleButtonVariant;
	}
	,clearStyle_customToggleButtonVariant: function() {
		this.set_customToggleButtonVariant(null);
		return this.get_customToggleButtonVariant();
	}
	,__layout: null
	,get_layout: function() {
		return this.__layout;
	}
	,set_layout: function(value) {
		if(!this.setStyle("layout")) {
			return this.__layout;
		}
		if(this.__layout == value) {
			return this.__layout;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_layout);
		this.__layout = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__layout;
	}
	,clearStyle_layout: function() {
		this.set_layout(null);
		return this.get_layout();
	}
	,__backgroundSkin: null
	,get_backgroundSkin: function() {
		return this.__backgroundSkin;
	}
	,set_backgroundSkin: function(value) {
		if(!this.setStyle("backgroundSkin")) {
			return this.__backgroundSkin;
		}
		if(this.__backgroundSkin == value) {
			return this.__backgroundSkin;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_backgroundSkin);
		this.__backgroundSkin = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__backgroundSkin;
	}
	,clearStyle_backgroundSkin: function() {
		this.set_backgroundSkin(null);
		return this.get_backgroundSkin();
	}
	,__disabledBackgroundSkin: null
	,get_disabledBackgroundSkin: function() {
		return this.__disabledBackgroundSkin;
	}
	,set_disabledBackgroundSkin: function(value) {
		if(!this.setStyle("disabledBackgroundSkin")) {
			return this.__disabledBackgroundSkin;
		}
		if(this.__disabledBackgroundSkin == value) {
			return this.__disabledBackgroundSkin;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_disabledBackgroundSkin);
		this.__disabledBackgroundSkin = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__disabledBackgroundSkin;
	}
	,clearStyle_disabledBackgroundSkin: function() {
		this.set_disabledBackgroundSkin(null);
		return this.get_disabledBackgroundSkin();
	}
	,get_styleContext: function() {
		return feathers_controls_PageIndicator;
	}
	,__class__: feathers_controls_PageIndicator
	,__properties__: $extend(feathers_core_FeathersControl.prototype.__properties__,{set_interactionMode:"set_interactionMode",get_interactionMode:"get_interactionMode",set_disabledBackgroundSkin:"set_disabledBackgroundSkin",get_disabledBackgroundSkin:"get_disabledBackgroundSkin",set_backgroundSkin:"set_backgroundSkin",get_backgroundSkin:"get_backgroundSkin",set_layout:"set_layout",get_layout:"get_layout",set_toggleButtonRecycler:"set_toggleButtonRecycler",get_toggleButtonRecycler:"get_toggleButtonRecycler",set_customToggleButtonVariant:"set_customToggleButtonVariant",get_customToggleButtonVariant:"get_customToggleButtonVariant",set_maxSelectedIndex:"set_maxSelectedIndex",get_maxSelectedIndex:"get_maxSelectedIndex",set_selectedIndex:"set_selectedIndex",get_selectedIndex:"get_selectedIndex"})
});
var feathers_controls_PageIndicatorInteractionMode = $hxEnums["feathers.controls.PageIndicatorInteractionMode"] = { __ename__:"feathers.controls.PageIndicatorInteractionMode",__constructs__:null
	,PREVIOUS_NEXT: {_hx_name:"PREVIOUS_NEXT",_hx_index:0,__enum__:"feathers.controls.PageIndicatorInteractionMode",toString:$estr}
	,PRECISE: {_hx_name:"PRECISE",_hx_index:1,__enum__:"feathers.controls.PageIndicatorInteractionMode",toString:$estr}
};
feathers_controls_PageIndicatorInteractionMode.__constructs__ = [feathers_controls_PageIndicatorInteractionMode.PREVIOUS_NEXT,feathers_controls_PageIndicatorInteractionMode.PRECISE];
var feathers_controls_PopUpDatePicker = function() {
	this.__customDatePickerVariant = null;
	this.__customButtonVariant = null;
	this.__customTextInputVariant = null;
	this.__popUpAdapter = new feathers_controls_popups_DropDownPopUpAdapter();
	this.openDatePickerOnFocus = false;
	this._filterText = null;
	this._customStartOfWeek = null;
	this._customWeekdayNames = null;
	this._customMonthNames = null;
	this._actualLocaleIDName = null;
	this._requestedLocaleIDName = null;
	this._previousCustomDatePickerVariant = null;
	this._previousCustomButtonVariant = null;
	this._previousCustomTextInputVariant = null;
	this._ignoreDatePickerChange = false;
	this._ignoreTextInputChange = false;
	this._selectedDate = null;
	this.textInputMeasurements = new feathers_layout_Measurements();
	this.buttonMeasurements = new feathers_layout_Measurements();
	this.initializePopUpDatePickerTheme();
	feathers_core_FeathersControl.call(this);
	this.addEventListener("focusIn",$bind(this,this.popUpDatePicker_focusInHandler));
};
$hxClasses["feathers.controls.PopUpDatePicker"] = feathers_controls_PopUpDatePicker;
feathers_controls_PopUpDatePicker.__name__ = "feathers.controls.PopUpDatePicker";
feathers_controls_PopUpDatePicker.__interfaces__ = [feathers_core_IStageFocusDelegate,feathers_core_IFocusObject,feathers_core_IDateSelector];
feathers_controls_PopUpDatePicker.__super__ = feathers_core_FeathersControl;
feathers_controls_PopUpDatePicker.prototype = $extend(feathers_core_FeathersControl.prototype,{
	button: null
	,textInput: null
	,datePicker: null
	,buttonMeasurements: null
	,textInputMeasurements: null
	,get_stageFocusTarget: function() {
		return this.textInput;
	}
	,_currentDateFormatter: null
	,_selectedDate: null
	,get_selectedDate: function() {
		return this._selectedDate;
	}
	,set_selectedDate: function(value) {
		if(this._selectedDate == value) {
			return this._selectedDate;
		}
		this._selectedDate = value;
		this.setInvalid(feathers_core_InvalidationFlag.SELECTION);
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._selectedDate;
	}
	,_prompt: null
	,get_prompt: function() {
		return this._prompt;
	}
	,set_prompt: function(value) {
		if(this._prompt == value) {
			return this._prompt;
		}
		this._prompt = value;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		return this._prompt;
	}
	,_ignoreTextInputChange: null
	,_ignoreDatePickerChange: null
	,_previousCustomTextInputVariant: null
	,_previousCustomButtonVariant: null
	,_previousCustomDatePickerVariant: null
	,_oldButtonFactory: null
	,_buttonFactory: null
	,get_buttonFactory: function() {
		return this._buttonFactory;
	}
	,set_buttonFactory: function(value) {
		if(this._buttonFactory == value) {
			return this._buttonFactory;
		}
		this._buttonFactory = value;
		this.setInvalid(feathers_controls_PopUpDatePicker.INVALIDATION_FLAG_BUTTON_FACTORY);
		return this._buttonFactory;
	}
	,_oldTextInputFactory: null
	,_textInputFactory: null
	,get_textInputFactory: function() {
		return this._textInputFactory;
	}
	,set_textInputFactory: function(value) {
		if(this._textInputFactory == value) {
			return this._textInputFactory;
		}
		this._textInputFactory = value;
		this.setInvalid(feathers_controls_PopUpDatePicker.INVALIDATION_FLAG_TEXT_INPUT_FACTORY);
		return this._textInputFactory;
	}
	,_oldDatePickerFactory: null
	,_datePickerFactory: null
	,get_datePickerFactory: function() {
		return this._datePickerFactory;
	}
	,set_datePickerFactory: function(value) {
		if(this._datePickerFactory == value) {
			return this._datePickerFactory;
		}
		this._datePickerFactory = value;
		this.setInvalid(feathers_controls_PopUpDatePicker.INVALIDATION_FLAG_DATE_PICKER_FACTORY);
		return this._datePickerFactory;
	}
	,_requestedLocaleIDName: null
	,get_requestedLocaleIDName: function() {
		return this._requestedLocaleIDName;
	}
	,set_requestedLocaleIDName: function(value) {
		if(this._requestedLocaleIDName == value) {
			return this._requestedLocaleIDName;
		}
		this._requestedLocaleIDName = value;
		this._actualLocaleIDName = null;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		return this._requestedLocaleIDName;
	}
	,_actualLocaleIDName: null
	,get_actualLocaleIDName: function() {
		return this._actualLocaleIDName;
	}
	,_customMonthNames: null
	,get_customMonthNames: function() {
		return this._customMonthNames;
	}
	,set_customMonthNames: function(value) {
		if(value != null && value.length != 12) {
			throw new openfl_errors_ArgumentError("Length of customMonthNames must be exactly equal to 12");
		}
		if(this._customMonthNames == value) {
			return this._customMonthNames;
		}
		this._customMonthNames = value;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		return this._customMonthNames;
	}
	,_customWeekdayNames: null
	,get_customWeekdayNames: function() {
		return this._customWeekdayNames;
	}
	,set_customWeekdayNames: function(value) {
		if(value != null && value.length != 7) {
			throw new openfl_errors_ArgumentError("Length of customWeekdayNames must be exactly equal to 7");
		}
		if(this._customWeekdayNames == value) {
			return this._customWeekdayNames;
		}
		this._customWeekdayNames = value;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		return this._customWeekdayNames;
	}
	,_customStartOfWeek: null
	,get_customStartOfWeek: function() {
		return this._customStartOfWeek;
	}
	,set_customStartOfWeek: function(value) {
		if(value != null && (value < 0 || value > 6)) {
			throw new openfl_errors_RangeError("startOfWeek must be in the range 0-6");
		}
		if(this._customStartOfWeek == value) {
			return this._customStartOfWeek;
		}
		this._customStartOfWeek = value;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		return this._customStartOfWeek;
	}
	,get_open: function() {
		if(this.datePicker != null) {
			return this.datePicker.parent != null;
		} else {
			return false;
		}
	}
	,_filterText: null
	,showFocus: function(show) {
		feathers_core_FeathersControl.prototype.showFocus.call(this,show);
		if(this.textInput != null) {
			this.textInput.showFocus(show);
		}
	}
	,openDatePickerOnFocus: null
	,openDatePicker: function() {
		if(this.get_open() || this.stage == null) {
			return;
		}
		this.validateNow();
		this.get_popUpAdapter().addEventListener("open",$bind(this,this.popUpDatePicker_popUpAdapter_openHandler));
		this.get_popUpAdapter().addEventListener("close",$bind(this,this.popUpDatePicker_popUpAdapter_closeHandler));
		this.get_popUpAdapter().open(this.datePicker,this);
		if(this.get_selectedDate() != null) {
			this.datePicker.set_displayedFullYear(this.get_selectedDate().getFullYear());
			this.datePicker.set_displayedMonth(this.get_selectedDate().getMonth());
		} else {
			var now = new Date();
			this.datePicker.set_displayedFullYear(now.getFullYear());
			this.datePicker.set_displayedMonth(now.getMonth());
		}
		this.datePicker.validateNow();
		this.textInput.addEventListener("focusOut",$bind(this,this.popUpDatePicker_textInput_focusOutHandler));
		this.datePicker.addEventListener("removedFromStage",$bind(this,this.popUpDatePicker_datePicker_removedFromStageHandler));
		this.stage.addEventListener("mouseDown",$bind(this,this.popUpDatePicker_stage_mouseDownHandler),false,0,true);
		this.stage.addEventListener("touchBegin",$bind(this,this.popUpDatePicker_stage_touchBeginHandler),false,0,true);
		if(this.datePicker.get_focusManager() != null) {
			this.datePicker.get_focusManager().set_focus(this.datePicker);
		} else {
			this.stage.set_focus(this.datePicker);
		}
	}
	,closeDatePicker: function() {
		if(!this.get_open()) {
			return;
		}
		this.get_popUpAdapter().close();
	}
	,dispose: function() {
		this.destroyButton();
		this.destroyTextInput();
		this.destroyDatePicker();
		feathers_core_FeathersControl.prototype.dispose.call(this);
	}
	,initializePopUpDatePickerTheme: function() {
		feathers_themes_steel_components_SteelPopUpDatePickerStyles.initialize();
	}
	,update: function() {
		var dataInvalid = this.isInvalid(feathers_core_InvalidationFlag.DATA);
		var selectionInvalid = this.isInvalid(feathers_core_InvalidationFlag.SELECTION);
		var stateInvalid = this.isInvalid(feathers_core_InvalidationFlag.STATE);
		if(this._previousCustomTextInputVariant != this.get_customTextInputVariant()) {
			this.setInvalidationFlag(feathers_controls_PopUpDatePicker.INVALIDATION_FLAG_TEXT_INPUT_FACTORY);
		}
		if(this._previousCustomButtonVariant != this.get_customButtonVariant()) {
			this.setInvalidationFlag(feathers_controls_PopUpDatePicker.INVALIDATION_FLAG_BUTTON_FACTORY);
		}
		if(this._previousCustomDatePickerVariant != this.get_customDatePickerVariant()) {
			this.setInvalidationFlag(feathers_controls_PopUpDatePicker.INVALIDATION_FLAG_DATE_PICKER_FACTORY);
		}
		var buttonFactoryInvalid = this.isInvalid(feathers_controls_PopUpDatePicker.INVALIDATION_FLAG_BUTTON_FACTORY);
		var textInputFactoryInvalid = this.isInvalid(feathers_controls_PopUpDatePicker.INVALIDATION_FLAG_TEXT_INPUT_FACTORY);
		var datePickerFactoryInvalid = this.isInvalid(feathers_controls_PopUpDatePicker.INVALIDATION_FLAG_DATE_PICKER_FACTORY);
		if(buttonFactoryInvalid) {
			this.createButton();
		}
		if(textInputFactoryInvalid) {
			this.createTextInput();
		}
		if(datePickerFactoryInvalid) {
			this.createDatePicker();
		}
		if(dataInvalid) {
			this.refreshLocale();
		}
		if(dataInvalid || selectionInvalid || datePickerFactoryInvalid) {
			this.refreshDatePickerData();
		}
		if(dataInvalid || selectionInvalid || textInputFactoryInvalid) {
			this.refreshTextInputData();
		}
		if(stateInvalid || datePickerFactoryInvalid || buttonFactoryInvalid || textInputFactoryInvalid) {
			this.refreshEnabled();
		}
		this.measure();
		this.layoutChildren();
		this._previousCustomTextInputVariant = this.get_customTextInputVariant();
		this._previousCustomButtonVariant = this.get_customButtonVariant();
		this._previousCustomDatePickerVariant = this.get_customDatePickerVariant();
	}
	,createButton: function() {
		this.destroyButton();
		var factory = this._buttonFactory != null ? this._buttonFactory : feathers_controls_PopUpDatePicker.defaultButtonFactory;
		this._oldButtonFactory = factory;
		this.button = factory.create();
		if(this.button.get_variant() == null) {
			this.button.set_variant(this.get_customButtonVariant() != null ? this.get_customButtonVariant() : feathers_controls_PopUpDatePicker.CHILD_VARIANT_BUTTON);
		}
		this.button.set_focusEnabled(false);
		this.button.addEventListener("mouseDown",$bind(this,this.popUpDatePicker_button_mouseDownHandler));
		this.button.addEventListener("touchBegin",$bind(this,this.popUpDatePicker_button_touchBeginHandler));
		this.button.initializeNow();
		this.buttonMeasurements.save(this.button);
		this.addChild(this.button);
	}
	,destroyButton: function() {
		if(this.button == null) {
			return;
		}
		this.button.removeEventListener("mouseDown",$bind(this,this.popUpDatePicker_button_mouseDownHandler));
		this.button.removeEventListener("touchBegin",$bind(this,this.popUpDatePicker_button_touchBeginHandler));
		this.removeChild(this.button);
		if(this._oldButtonFactory.destroy != null) {
			this._oldButtonFactory.destroy(this.button);
		}
		this._oldButtonFactory = null;
		this.button = null;
	}
	,createTextInput: function() {
		this.destroyTextInput();
		var factory = this._textInputFactory != null ? this._textInputFactory : feathers_controls_PopUpDatePicker.defaultTextInputFactory;
		this._oldTextInputFactory = factory;
		this.textInput = factory.create();
		this.textInput.set_editable(false);
		if(this.textInput.get_variant() == null) {
			this.textInput.set_variant(this.get_customTextInputVariant() != null ? this.get_customTextInputVariant() : feathers_controls_PopUpDatePicker.CHILD_VARIANT_TEXT_INPUT);
		}
		this.textInput.initializeNow();
		this.textInputMeasurements.save(this.textInput);
		this.textInput.addEventListener("mouseDown",$bind(this,this.popUpDatePicker_textInput_mouseDownHandler));
		this.addChild(this.textInput);
	}
	,destroyTextInput: function() {
		if(this.textInput == null) {
			return;
		}
		this.textInput.removeEventListener("mouseDown",$bind(this,this.popUpDatePicker_textInput_mouseDownHandler));
		this.removeChild(this.textInput);
		if(this._oldTextInputFactory.destroy != null) {
			this._oldTextInputFactory.destroy(this.textInput);
		}
		this._oldTextInputFactory = null;
		this.textInput = null;
	}
	,createDatePicker: function() {
		this.destroyDatePicker();
		var factory = this._datePickerFactory != null ? this._datePickerFactory : feathers_controls_PopUpDatePicker.defaultDatePickerFactory;
		this._oldDatePickerFactory = factory;
		this.datePicker = factory.create();
		this.datePicker.set_focusOwner(this);
		this.datePicker.set_focusEnabled(false);
		if(this.datePicker.get_variant() == null) {
			this.datePicker.set_variant(this.get_customDatePickerVariant() != null ? this.get_customDatePickerVariant() : feathers_controls_PopUpDatePicker.CHILD_VARIANT_DATE_PICKER);
		}
		this.datePicker.addEventListener("change",$bind(this,this.popUpDatePicker_datePicker_changeHandler));
		this.datePicker.addEventListener("itemTrigger",$bind(this,this.popUpDatePicker_datePicker_itemTriggerHandler));
	}
	,destroyDatePicker: function() {
		if(this.datePicker == null) {
			return;
		}
		this.datePicker.removeEventListener("change",$bind(this,this.popUpDatePicker_datePicker_changeHandler));
		this.datePicker.removeEventListener("itemTrigger",$bind(this,this.popUpDatePicker_datePicker_itemTriggerHandler));
		this.datePicker.set_focusOwner(null);
		if(this._oldDatePickerFactory.destroy != null) {
			this._oldDatePickerFactory.destroy(this.datePicker);
		}
		this._oldDatePickerFactory = null;
		this.datePicker = null;
	}
	,refreshLocale: function() {
		var localeID = this._requestedLocaleIDName != null ? this._requestedLocaleIDName : "i-default";
		this._currentDateFormatter = new openfl_globalization_DateTimeFormatter(localeID,4,3);
		this._actualLocaleIDName = this._currentDateFormatter.actualLocaleIDName;
	}
	,refreshDatePickerData: function() {
		var oldIgnoreDatePickerChange = this._ignoreDatePickerChange;
		this._ignoreDatePickerChange = true;
		this.datePicker.set_requestedLocaleIDName(this._requestedLocaleIDName);
		this.datePicker.set_selectedDate(this._selectedDate);
		this.datePicker.set_customMonthNames(this._customMonthNames);
		this.datePicker.set_customWeekdayNames(this._customWeekdayNames);
		this.datePicker.set_customStartOfWeek(this._customStartOfWeek);
		this._ignoreDatePickerChange = oldIgnoreDatePickerChange;
	}
	,refreshTextInputData: function() {
		this.textInput.set_prompt(this._prompt);
		if(this._selectedDate != null) {
			this.textInput.set_text(this._currentDateFormatter.format(this._selectedDate));
		} else {
			this.textInput.set_text("");
		}
	}
	,refreshEnabled: function() {
		this.button.set_enabled(this._enabled);
		this.textInput.set_enabled(this._enabled);
		this.datePicker.set_enabled(this._enabled);
	}
	,measure: function() {
		var needsWidth = this.get_explicitWidth() == null;
		var needsHeight = this.get_explicitHeight() == null;
		var needsMinWidth = this.get_explicitMinWidth() == null;
		var needsMinHeight = this.get_explicitMinHeight() == null;
		var needsMaxWidth = this.get_explicitMaxWidth() == null;
		var needsMaxHeight = this.get_explicitMaxHeight() == null;
		if(!needsWidth && !needsHeight && !needsMinWidth && !needsMinHeight && !needsMaxWidth && !needsMaxHeight) {
			return false;
		}
		this.buttonMeasurements.restore(this.button);
		this.button.validateNow();
		this.textInputMeasurements.restore(this.textInput);
		this.textInput.validateNow();
		var newWidth = this.get_explicitWidth();
		if(needsWidth) {
			newWidth = this.button.get_width() + this.textInput.get_width();
		}
		var newHeight = this.get_explicitHeight();
		if(needsHeight) {
			newHeight = Math.max(this.button.get_height(),this.textInput.get_height());
		}
		var newMinWidth = this.get_explicitMinWidth();
		if(needsMinWidth) {
			newMinWidth = this.button.get_minWidth() + this.textInput.get_minWidth();
		}
		var newMinHeight = this.get_explicitMinHeight();
		if(needsMinHeight) {
			newMinHeight = Math.max(this.button.get_minHeight(),this.textInput.get_minHeight());
		}
		return this.saveMeasurements(newWidth,newHeight,newMinWidth,newMinHeight);
	}
	,layoutChildren: function() {
		this.button.validateNow();
		this.button.set_x(this.actualWidth - this.button.get_width());
		this.button.set_y(0.0);
		if(this.button.get_height() != this.actualHeight) {
			this.button.set_height(this.actualHeight);
		}
		this.textInput.set_x(0.0);
		this.textInput.set_y(0.0);
		var textInputWidth = this.actualWidth - this.button.get_width();
		if(this.textInput.get_width() != textInputWidth) {
			this.textInput.set_width(textInputWidth);
		}
		if(this.textInput.get_height() != this.actualHeight) {
			this.textInput.set_height(this.actualHeight);
		}
		this.button.validateNow();
		this.textInput.validateNow();
	}
	,popUpDatePicker_textInput_focusOutHandler: function(event) {
		if(event.relatedObject != null && (event.relatedObject == this.datePicker || this.datePicker.contains(event.relatedObject))) {
			return;
		}
		this.closeDatePicker();
	}
	,popUpDatePicker_button_mouseDownHandler: function(event) {
		if(!this._enabled) {
			return;
		}
		if(this.get_open()) {
			this.closeDatePicker();
		} else {
			this.openDatePicker();
		}
	}
	,popUpDatePicker_button_touchBeginHandler: function(event) {
		if(!this._enabled) {
			return;
		}
		if(event.isPrimaryTouchPoint) {
			return;
		}
		if(this.get_open()) {
			this.closeDatePicker();
		} else {
			this.openDatePicker();
		}
	}
	,popUpDatePicker_datePicker_changeHandler: function(event) {
		if(this._ignoreDatePickerChange) {
			return;
		}
		this.set_selectedDate(this.datePicker.get_selectedDate());
	}
	,popUpDatePicker_datePicker_itemTriggerHandler: function(event) {
		this.dispatchEvent(event);
		if(this.get_popUpAdapter() == null || !this.get_popUpAdapter().get_persistent()) {
			this.closeDatePicker();
		}
	}
	,popUpDatePicker_datePicker_removedFromStageHandler: function(event) {
		this.textInput.removeEventListener("focusOut",$bind(this,this.popUpDatePicker_textInput_focusOutHandler));
		this.datePicker.removeEventListener("removedFromStage",$bind(this,this.popUpDatePicker_datePicker_removedFromStageHandler));
		this.stage.removeEventListener("mouseDown",$bind(this,this.popUpDatePicker_stage_mouseDownHandler));
		this.stage.removeEventListener("touchBegin",$bind(this,this.popUpDatePicker_stage_touchBeginHandler));
	}
	,popUpDatePicker_focusInHandler: function(event) {
		if(this.stage != null && this.stage.get_focus() != null && this.textInput != null && !this.textInput.contains(this.stage.get_focus())) {
			event.stopImmediatePropagation();
			this.stage.set_focus(this.textInput);
		}
	}
	,popUpDatePicker_removedFromStageHandler: function(event) {
		this.closeDatePicker();
	}
	,popUpDatePicker_keyUpHandler: function(event) {
		if(!this._enabled) {
			return;
		}
		switch(event.keyCode) {
		case 27:
			if(event.isDefaultPrevented()) {
				return;
			}
			if(!this.get_open()) {
				return;
			}
			event.preventDefault();
			this.closeDatePicker();
			break;
		case 1073742094:
			if(event.isDefaultPrevented()) {
				return;
			}
			if(!this.get_open()) {
				return;
			}
			event.preventDefault();
			this.closeDatePicker();
			break;
		}
	}
	,popUpDatePicker_stage_mouseDownHandler: function(event) {
		if(this.hitTestPoint(event.stageX,event.stageY) || this.datePicker.hitTestPoint(event.stageX,event.stageY)) {
			return;
		}
		this.closeDatePicker();
	}
	,popUpDatePicker_stage_touchBeginHandler: function(event) {
		if(event.isPrimaryTouchPoint) {
			return;
		}
		if(this.hitTestPoint(event.stageX,event.stageY) || this.datePicker.hitTestPoint(event.stageX,event.stageY)) {
			return;
		}
		this.closeDatePicker();
	}
	,popUpDatePicker_popUpAdapter_openHandler: function(event) {
		feathers_events_FeathersEvent.dispatch(this,"open");
	}
	,popUpDatePicker_popUpAdapter_closeHandler: function(event) {
		this.get_popUpAdapter().removeEventListener("open",$bind(this,this.popUpDatePicker_popUpAdapter_openHandler));
		this.get_popUpAdapter().removeEventListener("close",$bind(this,this.popUpDatePicker_popUpAdapter_closeHandler));
		feathers_events_FeathersEvent.dispatch(this,"close");
	}
	,popUpDatePicker_textInput_mouseDownHandler: function(event) {
		if(!this.get_enabled()) {
			return;
		}
		this.openDatePicker();
	}
	,__popUpAdapter: null
	,get_popUpAdapter: function() {
		return this.__popUpAdapter;
	}
	,set_popUpAdapter: function(value) {
		if(!this.setStyle("popUpAdapter")) {
			return this.__popUpAdapter;
		}
		if(this.__popUpAdapter == value) {
			return this.__popUpAdapter;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_popUpAdapter);
		this.__popUpAdapter = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__popUpAdapter;
	}
	,clearStyle_popUpAdapter: function() {
		this.set_popUpAdapter(new feathers_controls_popups_DropDownPopUpAdapter());
		return this.get_popUpAdapter();
	}
	,__customTextInputVariant: null
	,get_customTextInputVariant: function() {
		return this.__customTextInputVariant;
	}
	,set_customTextInputVariant: function(value) {
		if(!this.setStyle("customTextInputVariant")) {
			return this.__customTextInputVariant;
		}
		if(this.__customTextInputVariant == value) {
			return this.__customTextInputVariant;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_customTextInputVariant);
		this.__customTextInputVariant = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__customTextInputVariant;
	}
	,clearStyle_customTextInputVariant: function() {
		this.set_customTextInputVariant(null);
		return this.get_customTextInputVariant();
	}
	,__customButtonVariant: null
	,get_customButtonVariant: function() {
		return this.__customButtonVariant;
	}
	,set_customButtonVariant: function(value) {
		if(!this.setStyle("customButtonVariant")) {
			return this.__customButtonVariant;
		}
		if(this.__customButtonVariant == value) {
			return this.__customButtonVariant;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_customButtonVariant);
		this.__customButtonVariant = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__customButtonVariant;
	}
	,clearStyle_customButtonVariant: function() {
		this.set_customButtonVariant(null);
		return this.get_customButtonVariant();
	}
	,__customDatePickerVariant: null
	,get_customDatePickerVariant: function() {
		return this.__customDatePickerVariant;
	}
	,set_customDatePickerVariant: function(value) {
		if(!this.setStyle("customDatePickerVariant")) {
			return this.__customDatePickerVariant;
		}
		if(this.__customDatePickerVariant == value) {
			return this.__customDatePickerVariant;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_customDatePickerVariant);
		this.__customDatePickerVariant = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__customDatePickerVariant;
	}
	,clearStyle_customDatePickerVariant: function() {
		this.set_customDatePickerVariant(null);
		return this.get_customDatePickerVariant();
	}
	,get_styleContext: function() {
		return feathers_controls_PopUpDatePicker;
	}
	,__class__: feathers_controls_PopUpDatePicker
	,__properties__: $extend(feathers_core_FeathersControl.prototype.__properties__,{get_open:"get_open",set_customStartOfWeek:"set_customStartOfWeek",get_customStartOfWeek:"get_customStartOfWeek",set_customWeekdayNames:"set_customWeekdayNames",get_customWeekdayNames:"get_customWeekdayNames",set_customMonthNames:"set_customMonthNames",get_customMonthNames:"get_customMonthNames",get_actualLocaleIDName:"get_actualLocaleIDName",set_requestedLocaleIDName:"set_requestedLocaleIDName",get_requestedLocaleIDName:"get_requestedLocaleIDName",set_datePickerFactory:"set_datePickerFactory",get_datePickerFactory:"get_datePickerFactory",set_textInputFactory:"set_textInputFactory",get_textInputFactory:"get_textInputFactory",set_buttonFactory:"set_buttonFactory",get_buttonFactory:"get_buttonFactory",set_customDatePickerVariant:"set_customDatePickerVariant",get_customDatePickerVariant:"get_customDatePickerVariant",set_customButtonVariant:"set_customButtonVariant",get_customButtonVariant:"get_customButtonVariant",set_customTextInputVariant:"set_customTextInputVariant",get_customTextInputVariant:"get_customTextInputVariant",set_popUpAdapter:"set_popUpAdapter",get_popUpAdapter:"get_popUpAdapter",set_prompt:"set_prompt",get_prompt:"get_prompt",set_selectedDate:"set_selectedDate",get_selectedDate:"get_selectedDate",get_stageFocusTarget:"get_stageFocusTarget"})
});
var feathers_controls_ProgressBarFillMode = $hxEnums["feathers.controls.ProgressBarFillMode"] = { __ename__:"feathers.controls.ProgressBarFillMode",__constructs__:null
	,MASK: {_hx_name:"MASK",_hx_index:0,__enum__:"feathers.controls.ProgressBarFillMode",toString:$estr}
	,SCROLL_RECT: {_hx_name:"SCROLL_RECT",_hx_index:1,__enum__:"feathers.controls.ProgressBarFillMode",toString:$estr}
	,RESIZE: {_hx_name:"RESIZE",_hx_index:2,__enum__:"feathers.controls.ProgressBarFillMode",toString:$estr}
};
feathers_controls_ProgressBarFillMode.__constructs__ = [feathers_controls_ProgressBarFillMode.MASK,feathers_controls_ProgressBarFillMode.SCROLL_RECT,feathers_controls_ProgressBarFillMode.RESIZE];
var feathers_core_ToggleGroup = function() {
	this._requireSelection = true;
	this._selectedIndex = -1;
	this._ignoreChanges = false;
	this._items = [];
	openfl_events_EventDispatcher.call(this);
};
$hxClasses["feathers.core.ToggleGroup"] = feathers_core_ToggleGroup;
feathers_core_ToggleGroup.__name__ = "feathers.core.ToggleGroup";
feathers_core_ToggleGroup.__interfaces__ = [feathers_core_IDataSelector,feathers_core_IIndexSelector];
feathers_core_ToggleGroup.__super__ = openfl_events_EventDispatcher;
feathers_core_ToggleGroup.prototype = $extend(openfl_events_EventDispatcher.prototype,{
	_items: null
	,get_numItems: function() {
		return this._items.length;
	}
	,_ignoreChanges: null
	,_selectedIndex: null
	,get_selectedIndex: function() {
		return this._selectedIndex;
	}
	,set_selectedIndex: function(value) {
		var itemCount = this._items.length;
		if(value < -1 || value > itemCount) {
			throw new openfl_errors_RangeError("Index " + value + " is out of range " + itemCount + " for ToggleGroup.");
		}
		var hasChanged = this._selectedIndex != value;
		this._selectedIndex = value;
		var oldIgnoreChanges = this._ignoreChanges;
		this._ignoreChanges = true;
		var _g = 0;
		var _g1 = this._items.length;
		while(_g < _g1) {
			var i = _g++;
			var item = this._items[i];
			item.set_selected(i == value);
		}
		this._ignoreChanges = oldIgnoreChanges;
		if(hasChanged) {
			feathers_events_FeathersEvent.dispatch(this,"change");
		}
		return this._selectedIndex;
	}
	,get_maxSelectedIndex: function() {
		return this._items.length - 1;
	}
	,get_selectedItem: function() {
		if(this._selectedIndex == -1) {
			return null;
		}
		return this._items[this._selectedIndex];
	}
	,set_selectedItem: function(value) {
		this.set_selectedIndex(this._items.indexOf(value));
		return this.get_selectedItem();
	}
	,_requireSelection: null
	,get_requireSelection: function() {
		return this._requireSelection;
	}
	,set_requireSelection: function(value) {
		if(this._requireSelection == value) {
			return this._requireSelection;
		}
		this._requireSelection = value;
		if(this._requireSelection && this._selectedIndex == -1 && this._items.length > 0) {
			this.set_selectedIndex(0);
		}
		return this._requireSelection;
	}
	,addItem: function(item) {
		if(item == null) {
			throw new openfl_errors_ArgumentError("IToggle passed to ToggleGroup addItem() must not be null.");
		}
		var index = this._items.indexOf(item);
		if(index != -1) {
			throw new openfl_errors_IllegalOperationError("Cannot add an item to a ToggleGroup more than once.");
		}
		this._items.push(item);
		if(item.get_selected()) {
			this.set_selectedItem(item);
		} else if(this._selectedIndex < 0 && this._requireSelection) {
			this.set_selectedItem(item);
		} else {
			item.set_selected(false);
		}
		item.addEventListener("change",$bind(this,this.item_changeHandler),false,0,true);
		if(js_Boot.__implements(item,feathers_controls_IGroupedToggle)) {
			item.set_toggleGroup(this);
		}
	}
	,removeItem: function(item) {
		var index = this._items.indexOf(item);
		if(index == -1) {
			return;
		}
		HxOverrides.remove(this._items,item);
		item.removeEventListener("change",$bind(this,this.item_changeHandler));
		if(js_Boot.__implements(item,feathers_controls_IGroupedToggle)) {
			item.set_toggleGroup(null);
		}
		if(this._selectedIndex > index) {
			this.set_selectedIndex(this.get_selectedIndex() - 1);
		} else if(this.get_selectedIndex() == index) {
			if(this._requireSelection) {
				var maxSelectedIndex = this._items.length - 1;
				if(this._selectedIndex > maxSelectedIndex) {
					this.set_selectedIndex(maxSelectedIndex);
				} else {
					feathers_events_FeathersEvent.dispatch(this,"change");
				}
			} else {
				this.set_selectedIndex(-1);
			}
		}
	}
	,removeAllItems: function() {
		var _g = 0;
		var _g1 = this._items;
		while(_g < _g1.length) {
			var item = _g1[_g];
			++_g;
			item.removeEventListener("change",$bind(this,this.item_changeHandler));
			if(js_Boot.__implements(item,feathers_controls_IGroupedToggle)) {
				item.set_toggleGroup(null);
			}
		}
		this._items.length = 0;
		this.set_selectedIndex(-1);
	}
	,hasItem: function(item) {
		return this._items.indexOf(item) != -1;
	}
	,getItemAt: function(index) {
		if(index < 0 || index >= this._items.length) {
			throw new openfl_errors_RangeError("The supplied index is out of bounds.");
		}
		return this._items[index];
	}
	,getItemIndex: function(item) {
		return this._items.indexOf(item);
	}
	,setItemIndex: function(item,index) {
		var oldIndex = this._items.indexOf(item);
		if(oldIndex < 0) {
			throw new openfl_errors_ArgumentError("Attempting to set index of an item that has not been added to this ToggleGroup.");
		}
		if(oldIndex == index) {
			return;
		}
		HxOverrides.remove(this._items,item);
		this._items.splice(index,0,item);
		if(this._selectedIndex >= 0) {
			if(this._selectedIndex == oldIndex) {
				this.set_selectedIndex(index);
			} else if(oldIndex < this._selectedIndex && index > this._selectedIndex) {
				this.set_selectedIndex(this.get_selectedIndex() - 1);
			} else if(oldIndex > this._selectedIndex && index < this._selectedIndex) {
				this.set_selectedIndex(this.get_selectedIndex() + 1);
			}
		}
	}
	,item_changeHandler: function(event) {
		if(this._ignoreChanges) {
			return;
		}
		var item = js_Boot.__cast(event.currentTarget , feathers_controls_IToggle);
		var index = this._items.indexOf(item);
		if(item.get_selected() || this._requireSelection && this._selectedIndex == index) {
			this.set_selectedIndex(index);
		} else if(!item.get_selected()) {
			this.set_selectedIndex(-1);
		}
	}
	,__class__: feathers_core_ToggleGroup
	,__properties__: {set_requireSelection:"set_requireSelection",get_requireSelection:"get_requireSelection",set_selectedItem:"set_selectedItem",get_selectedItem:"get_selectedItem",get_maxSelectedIndex:"get_maxSelectedIndex",set_selectedIndex:"set_selectedIndex",get_selectedIndex:"get_selectedIndex",get_numItems:"get_numItems"}
});
var feathers_controls_Radio = function(text,selected,changeListener) {
	if(selected == null) {
		selected = false;
	}
	this._toggleGroup = null;
	this.initializeRadioTheme();
	feathers_controls_ToggleButton.call(this,text,selected);
	feathers_controls_ToggleButton.prototype.set_toggleable.call(this,true);
	this.addEventListener("addedToStage",$bind(this,this.radio_addedToStageHandler));
	this.addEventListener("keyDown",$bind(this,this.radio_keyDownHandler));
	if(changeListener != null) {
		this.addEventListener("change",changeListener);
	}
};
$hxClasses["feathers.controls.Radio"] = feathers_controls_Radio;
feathers_controls_Radio.__name__ = "feathers.controls.Radio";
feathers_controls_Radio.__interfaces__ = [feathers_controls_IGroupedToggle];
feathers_controls_Radio.__super__ = feathers_controls_ToggleButton;
feathers_controls_Radio.prototype = $extend(feathers_controls_ToggleButton.prototype,{
	set_toggleable: function(value) {
		throw new openfl_errors_IllegalOperationError("Radio toggleable must always be true");
	}
	,_toggleGroup: null
	,get_toggleGroup: function() {
		return this._toggleGroup;
	}
	,set_toggleGroup: function(value) {
		if(this._toggleGroup == value) {
			return this._toggleGroup;
		}
		if(value == null && this._toggleGroup != feathers_controls_Radio.defaultRadioGroup && this.stage != null) {
			value = feathers_controls_Radio.defaultRadioGroup;
		}
		if(this._toggleGroup != null && this._toggleGroup.hasItem(this)) {
			this._toggleGroup.removeItem(this);
		}
		this._toggleGroup = value;
		if(this._toggleGroup != null && !this._toggleGroup.hasItem(this)) {
			this._toggleGroup.addItem(this);
		}
		return this._toggleGroup;
	}
	,dispose: function() {
		if(this._toggleGroup != null) {
			this.set_toggleGroup(null);
		}
		feathers_controls_ToggleButton.prototype.dispose.call(this);
	}
	,initializeRadioTheme: function() {
		feathers_themes_steel_components_SteelRadioStyles.initialize();
	}
	,navigateWithKeyboard: function(event) {
		if(event.isDefaultPrevented()) {
			return;
		}
		if(this._toggleGroup == null) {
			return;
		}
		if(event.keyLocation == 4) {
			return;
		}
		var startIndex = this._toggleGroup.getItemIndex(this);
		if(startIndex == -1) {
			return;
		}
		var result = startIndex;
		var needsAnotherPass = true;
		var lastResult = -1;
		while(needsAnotherPass) {
			needsAnotherPass = false;
			switch(event.keyCode) {
			case 37:
				--result;
				break;
			case 38:
				--result;
				break;
			case 39:
				++result;
				break;
			case 40:
				++result;
				break;
			default:
				return;
			}
			if(result < 0) {
				result = 0;
			} else if(result >= this._toggleGroup.get_numItems()) {
				result = this._toggleGroup.get_numItems() - 1;
			}
			var nextItem = this._toggleGroup.getItemAt(result);
			if(!nextItem.get_enabled()) {
				if(result == lastResult) {
					return;
				}
				needsAnotherPass = true;
			}
			lastResult = result;
		}
		event.preventDefault();
		this._toggleGroup.set_selectedIndex(result);
		var nextFocus = js_Boot.__cast(this._toggleGroup.get_selectedItem() , feathers_core_IFocusObject);
		if(this._focusManager != null) {
			this._focusManager.set_focus(nextFocus);
			nextFocus.showFocus(true);
		} else {
			this.stage.set_focus(js_Boot.__cast(nextFocus , openfl_display_InteractiveObject));
		}
	}
	,radio_addedToStageHandler: function(event) {
		if(this._toggleGroup == null) {
			this.set_toggleGroup(feathers_controls_Radio.defaultRadioGroup);
		}
		this.addEventListener("removedFromStage",$bind(this,this.radio_removedFromStageHandler));
	}
	,radio_removedFromStageHandler: function(event) {
		this.removeEventListener("removedFromStage",$bind(this,this.radio_removedFromStageHandler));
		if(this._toggleGroup == feathers_controls_Radio.defaultRadioGroup) {
			this._toggleGroup.removeItem(this);
		}
	}
	,radio_keyDownHandler: function(event) {
		if(!this._enabled) {
			return;
		}
		this.navigateWithKeyboard(event);
	}
	,get_styleContext: function() {
		return feathers_controls_Radio;
	}
	,__class__: feathers_controls_Radio
	,__properties__: $extend(feathers_controls_ToggleButton.prototype.__properties__,{set_toggleGroup:"set_toggleGroup",get_toggleGroup:"get_toggleGroup"})
});
var feathers_controls_ScrollMode = $hxEnums["feathers.controls.ScrollMode"] = { __ename__:"feathers.controls.ScrollMode",__constructs__:null
	,SCROLL_RECT: {_hx_name:"SCROLL_RECT",_hx_index:0,__enum__:"feathers.controls.ScrollMode",toString:$estr}
	,MASK: {_hx_name:"MASK",_hx_index:1,__enum__:"feathers.controls.ScrollMode",toString:$estr}
	,MASKLESS: {_hx_name:"MASKLESS",_hx_index:2,__enum__:"feathers.controls.ScrollMode",toString:$estr}
};
feathers_controls_ScrollMode.__constructs__ = [feathers_controls_ScrollMode.SCROLL_RECT,feathers_controls_ScrollMode.MASK,feathers_controls_ScrollMode.MASKLESS];
var feathers_controls_ScrollPolicy = $hxEnums["feathers.controls.ScrollPolicy"] = { __ename__:"feathers.controls.ScrollPolicy",__constructs__:null
	,ON: {_hx_name:"ON",_hx_index:0,__enum__:"feathers.controls.ScrollPolicy",toString:$estr}
	,OFF: {_hx_name:"OFF",_hx_index:1,__enum__:"feathers.controls.ScrollPolicy",toString:$estr}
	,AUTO: {_hx_name:"AUTO",_hx_index:2,__enum__:"feathers.controls.ScrollPolicy",toString:$estr}
};
feathers_controls_ScrollPolicy.__constructs__ = [feathers_controls_ScrollPolicy.ON,feathers_controls_ScrollPolicy.OFF,feathers_controls_ScrollPolicy.AUTO];
var feathers_data_TabBarItemState = function(data,index,selected,text) {
	if(selected == null) {
		selected = false;
	}
	if(index == null) {
		index = -1;
	}
	this.enabled = true;
	this.selected = false;
	this.index = -1;
	this.data = data;
	this.index = index;
	this.selected = false;
	this.text = text;
};
$hxClasses["feathers.data.TabBarItemState"] = feathers_data_TabBarItemState;
feathers_data_TabBarItemState.__name__ = "feathers.data.TabBarItemState";
feathers_data_TabBarItemState.prototype = {
	owner: null
	,data: null
	,index: null
	,selected: null
	,text: null
	,enabled: null
	,recyclerID: null
	,__class__: feathers_data_TabBarItemState
};
var feathers_controls_TabBar = function(dataProvider,changeListener) {
	this.__disabledBackgroundSkin = null;
	this.__backgroundSkin = null;
	this.__layout = null;
	this.__customTabVariant = null;
	this._ignoreChildChanges = false;
	this._layoutResult = new feathers_layout_LayoutBoundsResult();
	this._layoutMeasurements = new feathers_layout_Measurements();
	this._backgroundSkinMeasurements = null;
	this._currentBackgroundSkin = null;
	this._ignoreSelectionChange = false;
	this._layoutItems = [];
	this._unrenderedData = [];
	this.itemStatePool = new lime_utils_ObjectPool(function() {
		return new feathers_data_TabBarItemState();
	});
	this.tabToItemState = new haxe_ds_ObjectMap();
	this.stringDataToTab = new haxe_ds_StringMap();
	this.objectDataToTab = new haxe_ds_ObjectMap();
	this._additionalStorage = null;
	this._defaultStorage = new feathers_controls__$TabBar_TabStorage(null,feathers_utils_DisplayObjectRecycler.withClass(feathers_controls_ToggleButton));
	this._recyclerMap = null;
	this._forceItemStateUpdate = false;
	this._previousCustomTabVariant = null;
	this._selectedItem = null;
	this._selectedIndex = -1;
	this._dataProvider = null;
	this.initializeTabBarTheme();
	feathers_core_FeathersControl.call(this);
	this.set_dataProvider(dataProvider);
	this.set_tabEnabled(true);
	this.set_tabChildren(false);
	this.addEventListener("keyDown",$bind(this,this.tabBar_keyDownHandler));
	if(changeListener != null) {
		this.addEventListener("change",changeListener);
	}
};
$hxClasses["feathers.controls.TabBar"] = feathers_controls_TabBar;
feathers_controls_TabBar.__name__ = "feathers.controls.TabBar";
feathers_controls_TabBar.__interfaces__ = [feathers_core_IFocusObject,feathers_core_IDataSelector,feathers_core_IIndexSelector];
feathers_controls_TabBar.defaultUpdateTab = function(tab,state) {
	tab.set_text(state.text);
};
feathers_controls_TabBar.defaultResetTab = function(tab,state) {
	tab.set_text(null);
};
feathers_controls_TabBar.__super__ = feathers_core_FeathersControl;
feathers_controls_TabBar.prototype = $extend(feathers_core_FeathersControl.prototype,{
	_dataProvider: null
	,get_dataProvider: function() {
		return this._dataProvider;
	}
	,set_dataProvider: function(value) {
		if(this._dataProvider == value) {
			return this._dataProvider;
		}
		if(this._dataProvider != null) {
			this._dataProvider.removeEventListener("change",$bind(this,this.tabBar_dataProvider_changeHandler));
			this._dataProvider.removeEventListener("addItem",$bind(this,this.tabBar_dataProvider_addItemHandler));
			this._dataProvider.removeEventListener("removeItem",$bind(this,this.tabBar_dataProvider_removeItemHandler));
			this._dataProvider.removeEventListener("replaceItem",$bind(this,this.tabBar_dataProvider_replaceItemHandler));
			this._dataProvider.removeEventListener("removeAll",$bind(this,this.tabBar_dataProvider_removeAllHandler));
			this._dataProvider.removeEventListener("reset",$bind(this,this.tabBar_dataProvider_resetHandler));
			this._dataProvider.removeEventListener("sortChange",$bind(this,this.tabBar_dataProvider_sortChangeHandler));
			this._dataProvider.removeEventListener("filterChange",$bind(this,this.tabBar_dataProvider_filterChangeHandler));
			this._dataProvider.removeEventListener("updateItem",$bind(this,this.tabBar_dataProvider_updateItemHandler));
			this._dataProvider.removeEventListener("updateAll",$bind(this,this.tabBar_dataProvider_updateAllHandler));
		}
		var oldSelectedIndex = this._selectedIndex;
		var oldSelectedItem = this._selectedItem;
		this._dataProvider = value;
		if(this._dataProvider != null) {
			this._dataProvider.addEventListener("change",$bind(this,this.tabBar_dataProvider_changeHandler));
			this._dataProvider.addEventListener("addItem",$bind(this,this.tabBar_dataProvider_addItemHandler));
			this._dataProvider.addEventListener("removeItem",$bind(this,this.tabBar_dataProvider_removeItemHandler));
			this._dataProvider.addEventListener("replaceItem",$bind(this,this.tabBar_dataProvider_replaceItemHandler));
			this._dataProvider.addEventListener("removeAll",$bind(this,this.tabBar_dataProvider_removeAllHandler));
			this._dataProvider.addEventListener("reset",$bind(this,this.tabBar_dataProvider_resetHandler));
			this._dataProvider.addEventListener("sortChange",$bind(this,this.tabBar_dataProvider_sortChangeHandler));
			this._dataProvider.addEventListener("filterChange",$bind(this,this.tabBar_dataProvider_filterChangeHandler));
			this._dataProvider.addEventListener("updateItem",$bind(this,this.tabBar_dataProvider_updateItemHandler));
			this._dataProvider.addEventListener("updateAll",$bind(this,this.tabBar_dataProvider_updateAllHandler));
		}
		if(this._dataProvider == null || this._dataProvider.get_length() == 0) {
			this._selectedIndex = -1;
			this._selectedItem = null;
		} else {
			this._selectedIndex = 0;
			this._selectedItem = this._dataProvider.get(0);
		}
		if(this._selectedIndex != oldSelectedIndex || this._selectedItem != oldSelectedItem) {
			this.setInvalid(feathers_core_InvalidationFlag.SELECTION);
			feathers_events_FeathersEvent.dispatch(this,"change");
		}
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		feathers_events_FeathersEvent.dispatch(this,"dataChange");
		return this._dataProvider;
	}
	,_selectedIndex: null
	,get_selectedIndex: function() {
		return this._selectedIndex;
	}
	,set_selectedIndex: function(value) {
		if(this._dataProvider == null) {
			value = -1;
		}
		if(this._selectedIndex == value) {
			return this._selectedIndex;
		}
		if(value == -1) {
			this._selectedIndex = -1;
			this._selectedItem = null;
			this.setInvalid(feathers_core_InvalidationFlag.SELECTION);
			feathers_events_FeathersEvent.dispatch(this,"change");
			return this._selectedIndex;
		}
		this._selectedIndex = value;
		this._selectedItem = this._dataProvider.get(this._selectedIndex);
		this.setInvalid(feathers_core_InvalidationFlag.SELECTION);
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._selectedIndex;
	}
	,get_maxSelectedIndex: function() {
		if(this._dataProvider == null) {
			return -1;
		}
		return this._dataProvider.get_length() - 1;
	}
	,_selectedItem: null
	,get_selectedItem: function() {
		return this._selectedItem;
	}
	,set_selectedItem: function(value) {
		if(value == null || this._dataProvider == null) {
			this.set_selectedIndex(-1);
			return this._selectedItem;
		}
		var index = this._dataProvider.indexOf(value);
		if(index == -1) {
			this.set_selectedIndex(-1);
			return this._selectedItem;
		}
		if(this._selectedItem == value && this._selectedIndex == index) {
			return this._selectedItem;
		}
		this._selectedIndex = index;
		this._selectedItem = value;
		this.setInvalid(feathers_core_InvalidationFlag.SELECTION);
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._selectedItem;
	}
	,_previousCustomTabVariant: null
	,get_tabRecycler: function() {
		return this._defaultStorage.tabRecycler;
	}
	,set_tabRecycler: function(value) {
		if(this._defaultStorage.tabRecycler == value) {
			return this._defaultStorage.tabRecycler;
		}
		this._defaultStorage.oldTabRecycler = this._defaultStorage.tabRecycler;
		this._defaultStorage.tabRecycler = value;
		this.setInvalid(feathers_controls_TabBar.INVALIDATION_FLAG_TAB_FACTORY);
		return this._defaultStorage.tabRecycler;
	}
	,_forceItemStateUpdate: null
	,get_forceItemStateUpdate: function() {
		return this._forceItemStateUpdate;
	}
	,set_forceItemStateUpdate: function(value) {
		if(this._forceItemStateUpdate == value) {
			return this._forceItemStateUpdate;
		}
		this._forceItemStateUpdate = value;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		return this._forceItemStateUpdate;
	}
	,_recyclerMap: null
	,_tabRecyclerIDFunction: null
	,get_tabRecyclerIDFunction: function() {
		return this._tabRecyclerIDFunction;
	}
	,set_tabRecyclerIDFunction: function(value) {
		if(this._tabRecyclerIDFunction == value) {
			return this._tabRecyclerIDFunction;
		}
		this._tabRecyclerIDFunction = value;
		this.setInvalid(feathers_controls_TabBar.INVALIDATION_FLAG_TAB_FACTORY);
		return this._tabRecyclerIDFunction;
	}
	,_defaultStorage: null
	,_additionalStorage: null
	,objectDataToTab: null
	,stringDataToTab: null
	,tabToItemState: null
	,itemStatePool: null
	,_unrenderedData: null
	,_layoutItems: null
	,_ignoreSelectionChange: null
	,itemToText: function(data) {
		return Std.string(data);
	}
	,itemToEnabled: function(data) {
		return true;
	}
	,_currentBackgroundSkin: null
	,_backgroundSkinMeasurements: null
	,_layoutMeasurements: null
	,_layoutResult: null
	,_ignoreChildChanges: null
	,itemToTab: function(item) {
		if(item == null) {
			return null;
		}
		if(typeof(item) == "string") {
			return this.stringDataToTab.h[item];
		}
		return this.objectDataToTab.h[item.__id__];
	}
	,indexToTab: function(index) {
		if(this._dataProvider == null || index < 0 || index >= this._dataProvider.get_length()) {
			return null;
		}
		var item = this._dataProvider.get(index);
		if(typeof(item) == "string") {
			return this.stringDataToTab.h[item];
		}
		return this.objectDataToTab.h[item.__id__];
	}
	,itemToItemState: function(item) {
		if(item == null) {
			return null;
		}
		var itemState = null;
		var tab = null;
		if(typeof(item) == "string") {
			tab = this.stringDataToTab.h[item];
		} else {
			tab = this.objectDataToTab.h[item.__id__];
		}
		if(tab != null) {
			itemState = this.tabToItemState.h[tab.__id__];
		} else {
			var index = this._dataProvider.indexOf(item);
			if(index == -1) {
				return null;
			}
			itemState = new feathers_data_TabBarItemState();
			this.populateCurrentItemState(item,index,itemState,false);
		}
		return itemState;
	}
	,getTabRecycler: function(id) {
		if(this._recyclerMap == null) {
			return null;
		}
		return this._recyclerMap.h[id];
	}
	,setTabRecycler: function(id,recycler) {
		if(this._recyclerMap == null) {
			this._recyclerMap = new haxe_ds_StringMap();
		}
		if(recycler == null) {
			var _this = this._recyclerMap;
			if(Object.prototype.hasOwnProperty.call(_this.h,id)) {
				delete(_this.h[id]);
			}
			return;
		}
		this._recyclerMap.h[id] = recycler;
		this.setInvalid(feathers_controls_TabBar.INVALIDATION_FLAG_TAB_FACTORY);
	}
	,dispose: function() {
		this.refreshInactiveTabs(this._defaultStorage,true);
		if(this._additionalStorage != null) {
			var _g = 0;
			var _g1 = this._additionalStorage.length;
			while(_g < _g1) {
				var i = _g++;
				var storage = this._additionalStorage[i];
				this.refreshInactiveTabs(storage,true);
			}
		}
		this._selectedItem = null;
		this._selectedIndex = -1;
		this.set_dataProvider(null);
		feathers_core_FeathersControl.prototype.dispose.call(this);
	}
	,initializeTabBarTheme: function() {
		feathers_themes_steel_components_SteelTabBarStyles.initialize();
	}
	,update: function() {
		var dataInvalid = this.isInvalid(feathers_core_InvalidationFlag.DATA);
		var layoutInvalid = this.isInvalid(feathers_core_InvalidationFlag.LAYOUT);
		var selectionInvalid = this.isInvalid(feathers_core_InvalidationFlag.SELECTION);
		var stateInvalid = this.isInvalid(feathers_core_InvalidationFlag.STATE);
		var stylesInvalid = this.isInvalid(feathers_core_InvalidationFlag.STYLES);
		if(this._previousCustomTabVariant != this.get_customTabVariant()) {
			this.setInvalidationFlag(feathers_controls_TabBar.INVALIDATION_FLAG_TAB_FACTORY);
		}
		var tabsInvalid = this.isInvalid(feathers_controls_TabBar.INVALIDATION_FLAG_TAB_FACTORY);
		if(stylesInvalid || stateInvalid) {
			this.refreshBackgroundSkin();
		}
		if(tabsInvalid || selectionInvalid || stateInvalid || dataInvalid) {
			this.refreshTabs();
		}
		this.refreshViewPortBounds();
		this.handleLayout();
		this.handleLayoutResult();
		this.layoutBackgroundSkin();
		this.validateChildren();
		this._previousCustomTabVariant = this.get_customTabVariant();
	}
	,refreshViewPortBounds: function() {
		this._layoutMeasurements.save(this);
	}
	,handleLayout: function() {
		var oldIgnoreChildChanges = this._ignoreChildChanges;
		this._ignoreChildChanges = true;
		this._layoutResult.reset();
		if(this.get_layout() != null) {
			this.get_layout().layout(this._layoutItems,this._layoutMeasurements,this._layoutResult);
		}
		this._ignoreChildChanges = oldIgnoreChildChanges;
	}
	,handleLayoutResult: function() {
		var viewPortWidth = this._layoutResult.viewPortWidth;
		var viewPortHeight = this._layoutResult.viewPortHeight;
		this.saveMeasurements(viewPortWidth,viewPortHeight,viewPortWidth,viewPortHeight);
	}
	,validateChildren: function() {
		var _g = 0;
		var _g1 = this._layoutItems;
		while(_g < _g1.length) {
			var tab = _g1[_g];
			++_g;
			if(!js_Boot.__implements(tab,feathers_core_IValidating)) {
				return;
			}
			tab.validateNow();
		}
	}
	,refreshTabs: function() {
		if(this.get_tabRecycler().update == null) {
			this.get_tabRecycler().update = feathers_controls_TabBar.defaultUpdateTab;
			if(this.get_tabRecycler().reset == null) {
				this.get_tabRecycler().reset = feathers_controls_TabBar.defaultResetTab;
			}
		}
		if(this._recyclerMap != null) {
			var h = this._recyclerMap.h;
			var recycler_h = h;
			var recycler_keys = Object.keys(h);
			var recycler_length = recycler_keys.length;
			var recycler_current = 0;
			while(recycler_current < recycler_length) {
				var recycler = recycler_h[recycler_keys[recycler_current++]];
				if(recycler.update == null) {
					if(recycler.update == null) {
						recycler.update = feathers_controls_TabBar.defaultUpdateTab;
						if(recycler.reset == null) {
							recycler.reset = feathers_controls_TabBar.defaultResetTab;
						}
					}
				}
			}
		}
		var tabsInvalid = this.isInvalid(feathers_controls_TabBar.INVALIDATION_FLAG_TAB_FACTORY);
		this.refreshInactiveTabs(this._defaultStorage,tabsInvalid);
		if(this._additionalStorage != null) {
			var _g = 0;
			var _g1 = this._additionalStorage.length;
			while(_g < _g1) {
				var i = _g++;
				var storage = this._additionalStorage[i];
				this.refreshInactiveTabs(storage,tabsInvalid);
			}
		}
		this.findUnrenderedData();
		this.recoverInactiveTabs(this._defaultStorage);
		if(this._additionalStorage != null) {
			var _g = 0;
			var _g1 = this._additionalStorage.length;
			while(_g < _g1) {
				var i = _g++;
				var storage = this._additionalStorage[i];
				this.recoverInactiveTabs(storage);
			}
		}
		this.renderUnrenderedData();
		this.freeInactiveTabs(this._defaultStorage);
		if(this._defaultStorage.inactiveTabs.length > 0) {
			var c = js_Boot.getClass(this);
			throw new openfl_errors_IllegalOperationError("" + c.__name__ + ": inactive tabs should be empty after updating.");
		}
		if(this._additionalStorage != null) {
			var _g = 0;
			var _g1 = this._additionalStorage.length;
			while(_g < _g1) {
				var i = _g++;
				var storage = this._additionalStorage[i];
				this.freeInactiveTabs(storage);
				if(storage.inactiveTabs.length > 0) {
					var c = js_Boot.getClass(this);
					throw new openfl_errors_IllegalOperationError("" + c.__name__ + ": inactive tabs " + storage.id + " should be empty after updating.");
				}
			}
		}
	}
	,refreshInactiveTabs: function(storage,factoryInvalid) {
		var temp = storage.inactiveTabs;
		storage.inactiveTabs = storage.activeTabs;
		storage.activeTabs = temp;
		if(storage.activeTabs.length > 0) {
			var c = js_Boot.getClass(this);
			throw new openfl_errors_IllegalOperationError("" + c.__name__ + ": active tabs should be empty before updating.");
		}
		if(factoryInvalid) {
			this.recoverInactiveTabs(storage);
			this.freeInactiveTabs(storage);
		}
	}
	,recoverInactiveTabs: function(storage) {
		var _g = 0;
		var _g1 = storage.inactiveTabs;
		while(_g < _g1.length) {
			var tab = _g1[_g];
			++_g;
			if(tab == null) {
				continue;
			}
			var state = this.tabToItemState.h[tab.__id__];
			if(state == null) {
				continue;
			}
			var item = state.data;
			this.tabToItemState.remove(tab);
			if(typeof(item) == "string") {
				var _this = this.stringDataToTab;
				var key = item;
				if(Object.prototype.hasOwnProperty.call(_this.h,key)) {
					delete(_this.h[key]);
				}
			} else {
				this.objectDataToTab.remove(item);
			}
			tab.removeEventListener("trigger",$bind(this,this.tabBar_tab_triggerHandler));
			tab.removeEventListener("change",$bind(this,this.tabBar_tab_changeHandler));
			this.resetTab(tab,state);
			this.itemStatePool.release(state);
		}
	}
	,freeInactiveTabs: function(storage) {
		var _g = 0;
		var _g1 = storage.inactiveTabs;
		while(_g < _g1.length) {
			var tab = _g1[_g];
			++_g;
			if(tab == null) {
				continue;
			}
			this.destroyTab(tab);
		}
		storage.inactiveTabs.length = 0;
	}
	,refreshBackgroundSkin: function() {
		var oldSkin = this._currentBackgroundSkin;
		this._currentBackgroundSkin = this.getCurrentBackgroundSkin();
		if(this._currentBackgroundSkin == oldSkin) {
			return;
		}
		this.removeCurrentBackgroundSkin(oldSkin);
		this.addCurrentBackgroundSkin(this._currentBackgroundSkin);
	}
	,getCurrentBackgroundSkin: function() {
		if(!this._enabled && this.get_disabledBackgroundSkin() != null) {
			return this.get_disabledBackgroundSkin();
		}
		return this.get_backgroundSkin();
	}
	,addCurrentBackgroundSkin: function(skin) {
		if(skin == null) {
			this._backgroundSkinMeasurements = null;
			return;
		}
		if(js_Boot.__implements(skin,feathers_core_IUIControl)) {
			skin.initializeNow();
		}
		if(this._backgroundSkinMeasurements == null) {
			this._backgroundSkinMeasurements = new feathers_layout_Measurements(skin);
		} else {
			this._backgroundSkinMeasurements.save(skin);
		}
		if(js_Boot.__implements(skin,feathers_skins_IProgrammaticSkin)) {
			skin.set_uiContext(this);
		}
		this.addChildAt(skin,0);
	}
	,removeCurrentBackgroundSkin: function(skin) {
		if(skin == null) {
			return;
		}
		if(js_Boot.__implements(skin,feathers_skins_IProgrammaticSkin)) {
			skin.set_uiContext(null);
		}
		this._backgroundSkinMeasurements.restore(skin);
		if(skin.parent == this) {
			this.removeChild(skin);
		}
	}
	,layoutBackgroundSkin: function() {
		if(this._currentBackgroundSkin == null) {
			return;
		}
		this._currentBackgroundSkin.set_x(0.0);
		this._currentBackgroundSkin.set_y(0.0);
		if(this._currentBackgroundSkin.get_width() != this.actualWidth) {
			this._currentBackgroundSkin.set_width(this.actualWidth);
		}
		if(this._currentBackgroundSkin.get_height() != this.actualHeight) {
			this._currentBackgroundSkin.set_height(this.actualHeight);
		}
		if(js_Boot.__implements(this._currentBackgroundSkin,feathers_core_IValidating)) {
			this._currentBackgroundSkin.validateNow();
		}
	}
	,findUnrenderedData: function() {
		this._layoutItems.length = 0;
		if(this._dataProvider == null || this._dataProvider.get_length() == 0) {
			return;
		}
		this._layoutItems.length = this._dataProvider.get_length();
		var depthOffset = this._currentBackgroundSkin != null ? 1 : 0;
		var _g = 0;
		var _g1 = this._dataProvider.get_length();
		while(_g < _g1) {
			var i = _g++;
			var item = this._dataProvider.get(i);
			var tab = null;
			if(typeof(item) == "string") {
				tab = this.stringDataToTab.h[item];
			} else {
				tab = this.objectDataToTab.h[item.__id__];
			}
			if(tab != null) {
				var state = this.tabToItemState.h[tab.__id__];
				var changed = this.populateCurrentItemState(item,i,state,this._forceItemStateUpdate);
				var oldRecyclerID = state.recyclerID;
				var storage = this.itemStateToStorage(state);
				if(storage.id != oldRecyclerID) {
					this._unrenderedData.push(item);
					continue;
				}
				if(changed) {
					this.updateTab(tab,state,storage);
				}
				this._layoutItems[i] = tab;
				this.setChildIndex(tab,i + depthOffset);
				var removed = HxOverrides.remove(storage.inactiveTabs,tab);
				if(!removed) {
					var c = js_Boot.getClass(this);
					throw new openfl_errors_IllegalOperationError("" + c.__name__ + ": tab renderer map contains bad data for item at index " + i + ". This may be caused by duplicate items in the data provider, which is not allowed.");
				}
				storage.activeTabs.push(tab);
			} else {
				this._unrenderedData.push(item);
			}
		}
	}
	,renderUnrenderedData: function() {
		var depthOffset = this._currentBackgroundSkin != null ? 1 : 0;
		var _g = 0;
		var _g1 = this._unrenderedData;
		while(_g < _g1.length) {
			var item = _g1[_g];
			++_g;
			var index = this._dataProvider.indexOf(item);
			var state = this.itemStatePool.get();
			this.populateCurrentItemState(item,index,state,true);
			var tab = this.createTab(state);
			this.addChildAt(tab,index + depthOffset);
			this._layoutItems[index] = tab;
		}
		this._unrenderedData.length = 0;
	}
	,createTab: function(state) {
		var storage = this.itemStateToStorage(state);
		var tab = null;
		if(storage.inactiveTabs.length == 0) {
			tab = this.get_tabRecycler().create();
			if(tab.get_variant() == null) {
				var variant = this.get_customTabVariant() != null ? this.get_customTabVariant() : feathers_controls_TabBar.CHILD_VARIANT_TAB;
				tab.set_variant(variant);
			}
			tab.initializeNow();
		} else {
			tab = storage.inactiveTabs.shift();
		}
		this.updateTab(tab,state,storage);
		tab.addEventListener("trigger",$bind(this,this.tabBar_tab_triggerHandler));
		tab.addEventListener("change",$bind(this,this.tabBar_tab_changeHandler));
		this.tabToItemState.set(tab,state);
		var item = state.data;
		if(typeof(item) == "string") {
			this.stringDataToTab.h[item] = tab;
		} else {
			this.objectDataToTab.set(item,tab);
		}
		storage.activeTabs.push(tab);
		return tab;
	}
	,destroyTab: function(tab) {
		this.removeChild(tab);
		if(this.get_tabRecycler().destroy != null) {
			this.get_tabRecycler().destroy(tab);
		}
	}
	,itemStateToStorage: function(state) {
		var recyclerID = null;
		if(this._tabRecyclerIDFunction != null) {
			recyclerID = this._tabRecyclerIDFunction(state);
		}
		var recycler = null;
		if(recyclerID != null) {
			if(this._recyclerMap != null) {
				recycler = this._recyclerMap.h[recyclerID];
			}
			if(recycler == null) {
				throw new openfl_errors_IllegalOperationError("Item renderer recycler ID \"" + recyclerID + "\" is not registered.");
			}
		}
		if(recycler == null) {
			return this._defaultStorage;
		}
		if(this._additionalStorage == null) {
			this._additionalStorage = [];
		}
		var _g = 0;
		var _g1 = this._additionalStorage.length;
		while(_g < _g1) {
			var i = _g++;
			var storage = this._additionalStorage[i];
			if(storage.tabRecycler == recycler) {
				return storage;
			}
		}
		var storage = new feathers_controls__$TabBar_TabStorage(recyclerID,recycler);
		this._additionalStorage.push(storage);
		return storage;
	}
	,populateCurrentItemState: function(item,index,state,force) {
		var changed = false;
		if(force || state.owner != this) {
			state.owner = this;
			changed = true;
		}
		if(force || state.data != item) {
			state.data = item;
			changed = true;
		}
		if(force || state.index != index) {
			state.index = index;
			changed = true;
		}
		var selected = item == this._selectedItem;
		if(force || state.selected != selected) {
			state.selected = selected;
			changed = true;
		}
		var enabled = this._enabled && this.itemToEnabled(item);
		if(force || state.enabled != enabled) {
			state.enabled = enabled;
			changed = true;
		}
		var text = this.itemToText(item);
		if(force || state.text != text) {
			state.text = text;
			changed = true;
		}
		return changed;
	}
	,updateTab: function(tab,state,storage) {
		state.recyclerID = storage.id;
		var oldIgnoreSelectionChange = this._ignoreSelectionChange;
		this._ignoreSelectionChange = true;
		if(this.get_tabRecycler().update != null) {
			this.get_tabRecycler().update(tab,state);
		}
		this._ignoreSelectionChange = oldIgnoreSelectionChange;
		this.refreshTabProperties(tab,state);
	}
	,resetTab: function(tab,state) {
		var oldIgnoreSelectionChange = this._ignoreSelectionChange;
		this._ignoreSelectionChange = true;
		if(this.get_tabRecycler() != null && this.get_tabRecycler().reset != null) {
			this.get_tabRecycler().reset(tab,state);
		}
		this._ignoreSelectionChange = oldIgnoreSelectionChange;
		this.refreshTabProperties(tab,feathers_controls_TabBar.RESET_TAB_STATE);
	}
	,refreshTabProperties: function(tab,state) {
		var oldIgnoreSelectionChange = this._ignoreSelectionChange;
		this._ignoreSelectionChange = true;
		if(js_Boot.__implements(tab,feathers_core_IUIControl)) {
			var uiControl = tab;
			uiControl.set_enabled(state.enabled);
		}
		if(js_Boot.__implements(tab,feathers_controls_dataRenderers_IDataRenderer)) {
			var dataRenderer = tab;
			dataRenderer.set_data(state.data);
		}
		if(js_Boot.__implements(tab,feathers_layout_ILayoutIndexObject)) {
			var layoutObject = tab;
			layoutObject.set_layoutIndex(state.index);
		}
		tab.set_selected(state.selected);
		tab.set_enabled(state.enabled);
		this._ignoreSelectionChange = oldIgnoreSelectionChange;
	}
	,refreshSelectedIndicesAfterFilterOrSort: function() {
		if(this._selectedIndex == -1) {
			return;
		}
		this.set_selectedIndex(this._dataProvider.indexOf(this._selectedItem));
	}
	,navigateWithKeyboard: function(event) {
		if(event.isDefaultPrevented()) {
			return;
		}
		if(this._dataProvider == null || this._dataProvider.get_length() == 0) {
			return;
		}
		var result = this._selectedIndex;
		switch(event.keyCode) {
		case 33:
			--result;
			break;
		case 34:
			++result;
			break;
		case 35:
			result = this._dataProvider.get_length() - 1;
			break;
		case 36:
			result = 0;
			break;
		case 37:
			--result;
			break;
		case 38:
			if(event.keyLocation == 4) {
				return;
			}
			--result;
			break;
		case 39:
			++result;
			break;
		case 40:
			if(event.keyLocation == 4) {
				return;
			}
			++result;
			break;
		default:
			return;
		}
		if(result < 0) {
			result = 0;
		} else if(result >= this._dataProvider.get_length()) {
			result = this._dataProvider.get_length() - 1;
		}
		event.preventDefault();
		this.set_selectedIndex(result);
	}
	,tabBar_keyDownHandler: function(event) {
		if(!this._enabled) {
			return;
		}
		this.navigateWithKeyboard(event);
	}
	,tabBar_tab_triggerHandler: function(event) {
		var tab = js_Boot.__cast(event.currentTarget , feathers_controls_ToggleButton);
		var state = this.tabToItemState.h[tab.__id__];
		feathers_events_TabBarEvent.dispatch(this,"itemTrigger",state);
	}
	,tabBar_tab_changeHandler: function(event) {
		if(this._ignoreSelectionChange) {
			return;
		}
		var tab = js_Boot.__cast(event.currentTarget , feathers_controls_ToggleButton);
		if(!tab.get_selected()) {
			tab.set_selected(true);
			return;
		}
		var state = this.tabToItemState.h[tab.__id__];
		this.set_selectedItem(state.data);
	}
	,tabBar_dataProvider_changeHandler: function(event) {
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
	}
	,tabBar_dataProvider_addItemHandler: function(event) {
		if(this._selectedIndex == -1) {
			return;
		}
		if(this._selectedIndex >= event.index) {
			this._selectedIndex++;
			feathers_events_FeathersEvent.dispatch(this,"change");
		}
	}
	,tabBar_dataProvider_removeItemHandler: function(event) {
		if(this._selectedIndex == -1) {
			return;
		}
		if(this._selectedIndex == event.index) {
			if(event.index == this._dataProvider.get_length()) {
				this._selectedIndex = this._dataProvider.get_length() - 1;
			}
			if(this._selectedIndex == -1) {
				this._selectedItem = null;
			} else {
				this._selectedItem = this._dataProvider.get(this._selectedIndex);
			}
			feathers_events_FeathersEvent.dispatch(this,"change");
		} else if(this._selectedIndex > event.index) {
			this._selectedIndex--;
			feathers_events_FeathersEvent.dispatch(this,"change");
		}
	}
	,tabBar_dataProvider_replaceItemHandler: function(event) {
		if(this._selectedIndex == -1) {
			return;
		}
		if(this._selectedIndex == event.index) {
			this._selectedItem = this._dataProvider.get(this._selectedIndex);
			feathers_events_FeathersEvent.dispatch(this,"change");
		}
	}
	,tabBar_dataProvider_removeAllHandler: function(event) {
		this.set_selectedIndex(-1);
	}
	,tabBar_dataProvider_resetHandler: function(event) {
		this.set_selectedIndex(-1);
	}
	,tabBar_dataProvider_sortChangeHandler: function(event) {
		this.refreshSelectedIndicesAfterFilterOrSort();
	}
	,tabBar_dataProvider_filterChangeHandler: function(event) {
		this.refreshSelectedIndicesAfterFilterOrSort();
	}
	,updateTabForIndex: function(index) {
		var item = this._dataProvider.get(index);
		var tab = null;
		if(typeof(item) == "string") {
			tab = this.stringDataToTab.h[item];
		} else {
			tab = this.objectDataToTab.h[item.__id__];
		}
		if(tab == null) {
			this.setInvalid(feathers_core_InvalidationFlag.DATA);
			return;
		}
		var state = this.tabToItemState.h[tab.__id__];
		if(state.owner == null) {
			return;
		}
		var storage = this.itemStateToStorage(state);
		this.populateCurrentItemState(item,index,state,true);
		this.resetTab(tab,state);
		state.owner = null;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
	}
	,tabBar_dataProvider_updateItemHandler: function(event) {
		this.updateTabForIndex(event.index);
	}
	,tabBar_dataProvider_updateAllHandler: function(event) {
		var _g = 0;
		var _g1 = this._dataProvider.get_length();
		while(_g < _g1) {
			var i = _g++;
			this.updateTabForIndex(i);
		}
	}
	,__customTabVariant: null
	,get_customTabVariant: function() {
		return this.__customTabVariant;
	}
	,set_customTabVariant: function(value) {
		if(!this.setStyle("customTabVariant")) {
			return this.__customTabVariant;
		}
		if(this.__customTabVariant == value) {
			return this.__customTabVariant;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_customTabVariant);
		this.__customTabVariant = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__customTabVariant;
	}
	,clearStyle_customTabVariant: function() {
		this.set_customTabVariant(null);
		return this.get_customTabVariant();
	}
	,__layout: null
	,get_layout: function() {
		return this.__layout;
	}
	,set_layout: function(value) {
		if(!this.setStyle("layout")) {
			return this.__layout;
		}
		if(this.__layout == value) {
			return this.__layout;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_layout);
		this.__layout = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__layout;
	}
	,clearStyle_layout: function() {
		this.set_layout(null);
		return this.get_layout();
	}
	,__backgroundSkin: null
	,get_backgroundSkin: function() {
		return this.__backgroundSkin;
	}
	,set_backgroundSkin: function(value) {
		if(!this.setStyle("backgroundSkin")) {
			return this.__backgroundSkin;
		}
		if(this.__backgroundSkin == value) {
			return this.__backgroundSkin;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_backgroundSkin);
		this.__backgroundSkin = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__backgroundSkin;
	}
	,clearStyle_backgroundSkin: function() {
		this.set_backgroundSkin(null);
		return this.get_backgroundSkin();
	}
	,__disabledBackgroundSkin: null
	,get_disabledBackgroundSkin: function() {
		return this.__disabledBackgroundSkin;
	}
	,set_disabledBackgroundSkin: function(value) {
		if(!this.setStyle("disabledBackgroundSkin")) {
			return this.__disabledBackgroundSkin;
		}
		if(this.__disabledBackgroundSkin == value) {
			return this.__disabledBackgroundSkin;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_disabledBackgroundSkin);
		this.__disabledBackgroundSkin = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__disabledBackgroundSkin;
	}
	,clearStyle_disabledBackgroundSkin: function() {
		this.set_disabledBackgroundSkin(null);
		return this.get_disabledBackgroundSkin();
	}
	,get_styleContext: function() {
		return feathers_controls_TabBar;
	}
	,__class__: feathers_controls_TabBar
	,__properties__: $extend(feathers_core_FeathersControl.prototype.__properties__,{set_disabledBackgroundSkin:"set_disabledBackgroundSkin",get_disabledBackgroundSkin:"get_disabledBackgroundSkin",set_backgroundSkin:"set_backgroundSkin",get_backgroundSkin:"get_backgroundSkin",set_layout:"set_layout",get_layout:"get_layout",set_tabRecyclerIDFunction:"set_tabRecyclerIDFunction",get_tabRecyclerIDFunction:"get_tabRecyclerIDFunction",set_forceItemStateUpdate:"set_forceItemStateUpdate",get_forceItemStateUpdate:"get_forceItemStateUpdate",set_tabRecycler:"set_tabRecycler",get_tabRecycler:"get_tabRecycler",set_customTabVariant:"set_customTabVariant",get_customTabVariant:"get_customTabVariant",set_selectedItem:"set_selectedItem",get_selectedItem:"get_selectedItem",get_maxSelectedIndex:"get_maxSelectedIndex",set_selectedIndex:"set_selectedIndex",get_selectedIndex:"get_selectedIndex",set_dataProvider:"set_dataProvider",get_dataProvider:"get_dataProvider"})
});
var feathers_controls__$TabBar_TabStorage = function(id,recycler) {
	this.inactiveTabs = [];
	this.activeTabs = [];
	this.id = id;
	this.tabRecycler = recycler;
};
$hxClasses["feathers.controls._TabBar.TabStorage"] = feathers_controls__$TabBar_TabStorage;
feathers_controls__$TabBar_TabStorage.__name__ = "feathers.controls._TabBar.TabStorage";
feathers_controls__$TabBar_TabStorage.prototype = {
	id: null
	,oldTabRecycler: null
	,tabRecycler: null
	,activeTabs: null
	,inactiveTabs: null
	,__class__: feathers_controls__$TabBar_TabStorage
};
var feathers_controls_TextArea = function(text,prompt,changeListener) {
	if(text == null) {
		text = "";
	}
	this.__customErrorCalloutVariant = null;
	this.__showPromptWhenEmptyAndFocused = true;
	this.__textPaddingLeft = 0.0;
	this.__textPaddingBottom = 0.0;
	this.__textPaddingRight = 0.0;
	this.__textPaddingTop = 0.0;
	this.__wordWrap = true;
	this.__embedFonts = false;
	this.__promptTextFormat = null;
	this.__disabledTextFormat = null;
	this.__textFormat = null;
	this.__smoothScrolling = false;
	this.__errorFocusRectSkin = null;
	this._stateToSkin = new haxe_ds_EnumValueMap();
	this._ignoreViewPortTextChange = false;
	this._previousCustomErrorCalloutVariant = null;
	this._maxChars = 0;
	this._stateToTextFormat = new haxe_ds_EnumValueMap();
	this._errorString = null;
	this._focusedStatePriority = 0;
	this._errorStatePriority = 0;
	this._displayAsPassword = false;
	this._currentState = feathers_controls_TextInputState.ENABLED;
	this._selectable = true;
	this._editable = true;
	this._updatedPromptStyles = false;
	this._previousSimplePromptTextFormat = null;
	this._previousPromptTextFormat = null;
	this._previousPrompt = null;
	this._previousSimpleTextFormat = null;
	this._previousTextFormat = null;
	this.initializeTextAreaTheme();
	feathers_controls_supportClasses_BaseScrollContainer.call(this);
	this.set_text(text);
	this.set_prompt(prompt);
	this.set_tabEnabled(true);
	this.set_tabChildren(false);
	this.focusRect = null;
	if(this.get_viewPort() == null) {
		this.textFieldViewPort = new feathers_controls_supportClasses_TextFieldViewPort();
		this.textFieldViewPort.set_wordWrap(true);
		this.textFieldViewPort.set_multiline(true);
		this.textFieldViewPort.addEventListener("change",$bind(this,this.textArea_viewPort_changeHandler));
		this.addChild(this.textFieldViewPort);
		this.set_viewPort(this.textFieldViewPort);
	}
	this.addEventListener("focusIn",$bind(this,this.textArea_focusInHandler));
	this.addEventListener("focusOut",$bind(this,this.textArea_focusOutHandler));
	if(changeListener != null) {
		this.addEventListener("change",changeListener);
	}
};
$hxClasses["feathers.controls.TextArea"] = feathers_controls_TextArea;
feathers_controls_TextArea.__name__ = "feathers.controls.TextArea";
feathers_controls_TextArea.__interfaces__ = [feathers_core_IStageFocusDelegate,feathers_core_ITextControl,feathers_core_IStateContext];
feathers_controls_TextArea.__super__ = feathers_controls_supportClasses_BaseScrollContainer;
feathers_controls_TextArea.prototype = $extend(feathers_controls_supportClasses_BaseScrollContainer.prototype,{
	textFieldViewPort: null
	,promptTextField: null
	,errorStringCallout: null
	,_previousTextFormat: null
	,_previousSimpleTextFormat: null
	,_previousPrompt: null
	,_previousPromptTextFormat: null
	,_previousSimplePromptTextFormat: null
	,_updatedPromptStyles: null
	,_promptTextMeasuredWidth: null
	,_promptTextMeasuredHeight: null
	,get_tabEnabled: function() {
		if(this._enabled) {
			return this.get_rawTabEnabled();
		} else {
			return false;
		}
	}
	,_editable: null
	,get_editable: function() {
		return this._editable;
	}
	,set_editable: function(value) {
		if(this._editable == value) {
			return this._editable;
		}
		this._editable = value;
		this.setInvalid(feathers_core_InvalidationFlag.STATE);
		return this._editable;
	}
	,_selectable: null
	,get_selectable: function() {
		return this._selectable;
	}
	,set_selectable: function(value) {
		if(this._selectable == value) {
			return this._selectable;
		}
		this._selectable = value;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		return this._selectable;
	}
	,_currentState: null
	,get_currentState: function() {
		return this._currentState;
	}
	,set_enabled: function(value) {
		feathers_controls_supportClasses_BaseScrollContainer.prototype.set_enabled.call(this,value);
		this.refreshState();
		return this._enabled;
	}
	,_text: null
	,get_text: function() {
		return this._text;
	}
	,set_text: function(value) {
		if(value == null) {
			if(this._text.length == 0) {
				return this._text;
			}
			value = "";
		}
		if(this._text == value) {
			return this._text;
		}
		this._text = value;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._text;
	}
	,get_baseline: function() {
		if(this.textFieldViewPort == null) {
			return 0.0;
		}
		return this.get_paddingTop() + this.textFieldViewPort.get_baseline();
	}
	,_prompt: null
	,get_prompt: function() {
		return this._prompt;
	}
	,set_prompt: function(value) {
		if(this._prompt == value) {
			return this._prompt;
		}
		this._prompt = value;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		return this._prompt;
	}
	,___restrict: null
	,get_restrict: function() {
		return this.___restrict;
	}
	,set_restrict: function(value) {
		if(this.___restrict == value) {
			return this.___restrict;
		}
		this.___restrict = value;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		return this.___restrict;
	}
	,_displayAsPassword: null
	,get_displayAsPassword: function() {
		return this._displayAsPassword;
	}
	,set_displayAsPassword: function(value) {
		if(this._displayAsPassword == value) {
			return this._displayAsPassword;
		}
		this._displayAsPassword = value;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		return this._displayAsPassword;
	}
	,_errorStatePriority: null
	,get_errorStatePriority: function() {
		return this._errorStatePriority;
	}
	,set_errorStatePriority: function(value) {
		if(this._errorStatePriority == value) {
			return this._errorStatePriority;
		}
		this._errorStatePriority = value;
		this.setInvalid(feathers_core_InvalidationFlag.STATE);
		return this._errorStatePriority;
	}
	,_focusedStatePriority: null
	,get_focusedStatePriority: function() {
		return this._errorStatePriority;
	}
	,set_focusedStatePriority: function(value) {
		if(this._focusedStatePriority == value) {
			return this._focusedStatePriority;
		}
		this._focusedStatePriority = value;
		this.setInvalid(feathers_core_InvalidationFlag.STATE);
		return this._focusedStatePriority;
	}
	,_errorString: null
	,get_errorString: function() {
		return this._errorString;
	}
	,set_errorString: function(value) {
		if(this._errorString == value) {
			return this._errorString;
		}
		this._errorString = value;
		this.refreshState();
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		return this._errorString;
	}
	,get_errorStringCalloutOpen: function() {
		if(this.errorStringCallout != null) {
			return this.errorStringCallout.parent != null;
		} else {
			return false;
		}
	}
	,_stateToTextFormat: null
	,get_selectionAnchorIndex: function() {
		return this.textFieldViewPort.get_selectionAnchorIndex();
	}
	,get_selectionActiveIndex: function() {
		return this.textFieldViewPort.get_selectionActiveIndex();
	}
	,_maxChars: null
	,get_maxChars: function() {
		return this._maxChars;
	}
	,set_maxChars: function(value) {
		if(this._maxChars == value) {
			return this._maxChars;
		}
		this._maxChars = value;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		return this._maxChars;
	}
	,_oldErrorCalloutFactory: null
	,_errorCalloutFactory: null
	,get_errorCalloutFactory: function() {
		return this._errorCalloutFactory;
	}
	,set_errorCalloutFactory: function(value) {
		if(this._errorCalloutFactory == value) {
			return this._errorCalloutFactory;
		}
		this._errorCalloutFactory = value;
		this.setInvalid(feathers_controls_TextArea.INVALIDATION_FLAG_ERROR_CALLOUT_FACTORY);
		return this._errorCalloutFactory;
	}
	,_previousCustomErrorCalloutVariant: null
	,_ignoreViewPortTextChange: null
	,get_measureViewPort: function() {
		return false;
	}
	,get_stageFocusTarget: function() {
		return this.textFieldViewPort;
	}
	,_stateToSkin: null
	,getSkinForState: function(state) {
		return this._stateToSkin.get(state);
	}
	,setSkinForState: function(state,skin) {
		if(!this.setStyle("setSkinForState",state)) {
			return;
		}
		var oldSkin = this._stateToSkin.get(state);
		if(oldSkin != null && oldSkin == this._currentBackgroundSkin) {
			this.removeCurrentBackgroundSkin(oldSkin);
			this._currentBackgroundSkin = null;
		}
		if(skin == null) {
			this._stateToSkin.remove(state);
		} else {
			this._stateToSkin.set(state,skin);
		}
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
	}
	,getTextFormatForState: function(state) {
		return this._stateToTextFormat.get(state);
	}
	,setTextFormatForState: function(state,textFormat) {
		if(!this.setStyle("setTextFormatForState",state)) {
			return;
		}
		if(textFormat == null) {
			this._stateToTextFormat.remove(state);
		} else {
			this._stateToTextFormat.set(state,textFormat);
		}
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
	}
	,selectRange: function(anchorIndex,activeIndex) {
		this.textFieldViewPort.selectRange(anchorIndex,activeIndex);
	}
	,selectAll: function() {
		this.textFieldViewPort.selectRange(0,this._text.length);
	}
	,setTextPadding: function(value) {
		this.set_textPaddingTop(value);
		this.set_textPaddingRight(value);
		this.set_textPaddingBottom(value);
		this.set_textPaddingLeft(value);
	}
	,showFocus: function(show) {
		feathers_controls_supportClasses_BaseScrollContainer.prototype.showFocus.call(this,show);
		if(show) {
			this.selectRange(this._text.length,0);
		}
	}
	,dispose: function() {
		this.destroyErrorCallout();
		feathers_controls_supportClasses_BaseScrollContainer.prototype.dispose.call(this);
	}
	,initializeTextAreaTheme: function() {
		feathers_themes_steel_components_SteelTextAreaStyles.initialize();
	}
	,update: function() {
		var dataInvalid = this.isInvalid(feathers_core_InvalidationFlag.DATA);
		var sizeInvalid = this.isInvalid(feathers_core_InvalidationFlag.SIZE);
		var stateInvalid = this.isInvalid(feathers_core_InvalidationFlag.STATE);
		var stylesInvalid = this.isInvalid(feathers_core_InvalidationFlag.STYLES);
		if(this._previousCustomErrorCalloutVariant != this.get_customErrorCalloutVariant()) {
			this.setInvalidationFlag(feathers_controls_TextArea.INVALIDATION_FLAG_ERROR_CALLOUT_FACTORY);
		}
		var errorCalloutFactoryInvalid = this.isInvalid(feathers_controls_TextArea.INVALIDATION_FLAG_ERROR_CALLOUT_FACTORY);
		this._updatedPromptStyles = false;
		if(errorCalloutFactoryInvalid || dataInvalid) {
			this.createErrorCallout();
		}
		if(dataInvalid || stateInvalid) {
			this.refreshPrompt();
		}
		if(dataInvalid || stylesInvalid || stateInvalid) {
			this.refreshPromptStyles();
		}
		if(dataInvalid || stylesInvalid || sizeInvalid) {
			this.refreshPromptText(sizeInvalid);
		}
		if(stylesInvalid) {
			this.refreshTextStyles();
			this.textFieldViewPort.set_embedFonts(this.get_embedFonts());
			this.textFieldViewPort.set_wordWrap(this.get_wordWrap());
			this.textFieldViewPort.set_paddingTop(this.get_textPaddingTop());
			this.textFieldViewPort.set_paddingRight(this.get_textPaddingRight());
			this.textFieldViewPort.set_paddingBottom(this.get_textPaddingBottom());
			this.textFieldViewPort.set_paddingLeft(this.get_textPaddingLeft());
			this.textFieldViewPort.set_smoothScrolling(this.get_smoothScrolling());
		}
		if(dataInvalid) {
			var oldIgnoreViewPortTextChange = this._ignoreViewPortTextChange;
			this._ignoreViewPortTextChange = true;
			this.textFieldViewPort.set_text(this._text);
			this._ignoreViewPortTextChange = oldIgnoreViewPortTextChange;
			this.textFieldViewPort.set_restrict(this.___restrict);
			this.textFieldViewPort.set_maxChars(this._maxChars);
			this.textFieldViewPort.set_displayAsPassword(this._displayAsPassword);
			if(this._editable) {
				this.textFieldViewPort.set_selectable(this._enabled);
			} else {
				this.textFieldViewPort.set_selectable(this._enabled && this._selectable);
			}
		}
		if(stateInvalid) {
			this.textFieldViewPort.set_enabled(this._enabled);
			this.textFieldViewPort.set_textFieldType(this._editable ? 1 : 0);
		}
		feathers_controls_supportClasses_BaseScrollContainer.prototype.update.call(this);
		if(errorCalloutFactoryInvalid || stateInvalid || dataInvalid) {
			this.refreshErrorString();
		}
		this._previousCustomErrorCalloutVariant = this.get_customErrorCalloutVariant();
	}
	,layoutChildren: function() {
		feathers_controls_supportClasses_BaseScrollContainer.prototype.layoutChildren.call(this);
		this.layoutPrompt();
	}
	,addCurrentBackgroundSkin: function(skin) {
		if(skin != null) {
			if(js_Boot.__implements(skin,feathers_core_IStateObserver)) {
				skin.set_stateContext(this);
			}
		}
		feathers_controls_supportClasses_BaseScrollContainer.prototype.addCurrentBackgroundSkin.call(this,skin);
	}
	,removeCurrentBackgroundSkin: function(skin) {
		if(skin == null) {
			return;
		}
		if(js_Boot.__implements(skin,feathers_core_IStateObserver)) {
			skin.set_stateContext(null);
		}
		feathers_controls_supportClasses_BaseScrollContainer.prototype.removeCurrentBackgroundSkin.call(this,skin);
	}
	,refreshTextStyles: function() {
		var textFormat = this.getCurrentTextFormat();
		var simpleTextFormat = textFormat != null ? textFormat.toSimpleTextFormat() : null;
		if(simpleTextFormat == this._previousSimpleTextFormat) {
			return;
		}
		if(this._previousTextFormat != null) {
			this._previousTextFormat.removeEventListener("change",$bind(this,this.textArea_textFormat_changeHandler));
		}
		if(textFormat != null) {
			textFormat.addEventListener("change",$bind(this,this.textArea_textFormat_changeHandler),false,0,true);
			this.textFieldViewPort.set_textFormat(simpleTextFormat);
		}
		this._previousTextFormat = textFormat;
		this._previousSimpleTextFormat = simpleTextFormat;
	}
	,refreshPrompt: function() {
		if(this._prompt == null) {
			if(this.promptTextField != null) {
				this.removeChild(this.promptTextField);
				this.promptTextField = null;
			}
			return;
		}
		if(this.promptTextField == null) {
			this.promptTextField = new openfl_text_TextField();
			this.promptTextField.set_selectable(false);
			this.promptTextField.set_mouseWheelEnabled(false);
			this.promptTextField.mouseEnabled = false;
			this.promptTextField.set_multiline(true);
			this.addChildAt(this.promptTextField,this.getChildIndex(this.textFieldViewPort));
		}
		this.promptTextField.set_visible(this._text.length == 0 && (this.get_currentState() != feathers_controls_TextInputState.FOCUSED || this.get_showPromptWhenEmptyAndFocused()));
	}
	,refreshPromptText: function(forceMeasurement) {
		if(this._prompt == null || this._prompt == this._previousPrompt && !this._updatedPromptStyles && !forceMeasurement) {
			return;
		}
		this.promptTextField.set_autoSize(1);
		var hasPromptText = this._prompt.length > 0;
		if(hasPromptText) {
			this.promptTextField.set_text(this._prompt);
		} else {
			this.promptTextField.set_text("​");
		}
		this.promptTextField.set_wordWrap(false);
		this._promptTextMeasuredWidth = this.promptTextField.get_width();
		this._promptTextMeasuredHeight = this.promptTextField.get_height();
		this.promptTextField.set_autoSize(2);
		this.promptTextField.set_wordWrap(true);
		if(!hasPromptText) {
			this.promptTextField.set_text("");
		}
		this._previousPrompt = this._prompt;
	}
	,refreshPromptStyles: function() {
		if(this._prompt == null) {
			return;
		}
		if(this.promptTextField.get_embedFonts() != this.get_embedFonts()) {
			this.promptTextField.set_embedFonts(this.get_embedFonts());
			this._updatedPromptStyles = true;
		}
		var textFormat = this.getCurrentPromptTextFormat();
		var simpleTextFormat = textFormat != null ? textFormat.toSimpleTextFormat() : null;
		if(simpleTextFormat == this._previousSimplePromptTextFormat) {
			return;
		}
		if(this._previousPromptTextFormat != null) {
			this._previousPromptTextFormat.removeEventListener("change",$bind(this,this.textArea_promptTextFormat_changeHandler));
		}
		if(textFormat != null) {
			textFormat.addEventListener("change",$bind(this,this.textArea_promptTextFormat_changeHandler),false,0,true);
			this.promptTextField.set_defaultTextFormat(simpleTextFormat);
			this._updatedPromptStyles = true;
		}
		this._previousPromptTextFormat = textFormat;
		this._previousSimplePromptTextFormat = simpleTextFormat;
	}
	,getCurrentPromptTextFormat: function() {
		var textFormat = this.get_promptTextFormat();
		if(!this._enabled && this.get_disabledTextFormat() != null) {
			textFormat = this.get_disabledTextFormat();
		}
		if(textFormat == null) {
			textFormat = this.get_textFormat();
		}
		return textFormat;
	}
	,refreshErrorString: function() {
		if(this.errorStringCallout == null) {
			return;
		}
		this.errorStringCallout.set_text(this._errorString);
		if(this._currentState == feathers_controls_TextInputState.FOCUSED && this.errorStringCallout.parent == null) {
			feathers_core_PopUpManager.addPopUp(this.errorStringCallout,this,false,false);
		} else if(this._currentState != feathers_controls_TextInputState.FOCUSED && this.errorStringCallout.parent != null) {
			this.errorStringCallout.parent.removeChild(this.errorStringCallout);
		}
	}
	,layoutPrompt: function() {
		if(this._prompt == null) {
			return;
		}
		this.promptTextField.set_x(this.leftViewPortOffset + this.get_textPaddingLeft());
		this.promptTextField.set_y(this.topViewPortOffset + this.get_textPaddingTop());
		var maxPromptWidth = this.get_viewPort().get_visibleWidth() - this.get_textPaddingLeft() - this.get_textPaddingRight();
		if(maxPromptWidth < 0.0) {
			maxPromptWidth = 0.0;
		}
		if(this._promptTextMeasuredWidth > maxPromptWidth) {
			this.promptTextField.set_width(maxPromptWidth);
		} else {
			this.promptTextField.set_width(this._promptTextMeasuredWidth);
		}
		var promptHeight = this.get_viewPort().get_visibleHeight() - this.get_textPaddingTop() - this.get_textPaddingBottom();
		if(promptHeight < 0.0) {
			promptHeight = 0.0;
		}
		this.promptTextField.set_height(promptHeight);
	}
	,getCurrentBackgroundSkin: function() {
		var result = this._stateToSkin.get(this._currentState);
		if(result != null) {
			return result;
		}
		return feathers_controls_supportClasses_BaseScrollContainer.prototype.getCurrentBackgroundSkin.call(this);
	}
	,getCurrentTextFormat: function() {
		var result = this._stateToTextFormat.get(this._currentState);
		if(result != null) {
			return result;
		}
		if(!this._enabled && this.get_disabledTextFormat() != null) {
			return this.get_disabledTextFormat();
		}
		return this.get_textFormat();
	}
	,createErrorCallout: function() {
		this.destroyErrorCallout();
		if(this._errorString == null || this._errorString.length == 0) {
			return;
		}
		var factory = this._errorCalloutFactory != null ? this._errorCalloutFactory : feathers_controls_TextArea.defaultErrorCalloutFactory;
		this._oldErrorCalloutFactory = factory;
		this.errorStringCallout = factory.create();
		if(this.errorStringCallout.get_variant() == null) {
			this.errorStringCallout.set_variant(this.get_customErrorCalloutVariant() != null ? this.get_customErrorCalloutVariant() : feathers_controls_TextArea.CHILD_VARIANT_ERROR_CALLOUT);
		}
		this.errorStringCallout.set_origin(this);
		this.errorStringCallout.closeOnPointerOutside = false;
	}
	,destroyErrorCallout: function() {
		if(this.errorStringCallout == null) {
			return;
		}
		if(this.errorStringCallout.parent != null) {
			this.errorStringCallout.parent.removeChild(this.errorStringCallout);
		}
		if(this._oldErrorCalloutFactory.destroy != null) {
			this._oldErrorCalloutFactory.destroy(this.errorStringCallout);
		}
		this._oldErrorCalloutFactory = null;
		this.errorStringCallout = null;
	}
	,changeState: function(state) {
		if(!this._enabled) {
			state = feathers_controls_TextInputState.DISABLED;
		}
		if(this._currentState == state) {
			return;
		}
		this._currentState = state;
		this.setInvalid(feathers_core_InvalidationFlag.STATE);
		feathers_events_FeathersEvent.dispatch(this,"stateChange");
	}
	,getCurrentFocusRectSkin: function() {
		if(this._errorString != null && this.get_errorFocusRectSkin() != null) {
			return this.get_errorFocusRectSkin();
		}
		return feathers_controls_supportClasses_BaseScrollContainer.prototype.getCurrentFocusRectSkin.call(this);
	}
	,refreshState: function() {
		if(this._enabled) {
			var focused = this.stage != null && this.stage.get_focus() == this.textFieldViewPort.get_textField();
			var error = this._errorString != null;
			if(focused && (!error || this._focusedStatePriority >= this._errorStatePriority)) {
				this.changeState(feathers_controls_TextInputState.FOCUSED);
			} else if(this._errorString != null) {
				this.changeState(feathers_controls_TextInputState.ERROR);
			} else {
				this.changeState(feathers_controls_TextInputState.ENABLED);
			}
		} else {
			this.changeState(feathers_controls_TextInputState.DISABLED);
		}
	}
	,textArea_focusInHandler: function(event) {
		if(this.stage != null && this.stage.get_focus() != null && this.textFieldViewPort != null && !this.textFieldViewPort.contains(this.stage.get_focus())) {
			event.stopImmediatePropagation();
			this.stage.set_focus(this.textFieldViewPort);
		}
		this.refreshState();
	}
	,textArea_focusOutHandler: function(event) {
		this.refreshState();
	}
	,baseScrollContainer_keyDownHandler: function(event) {
	}
	,textArea_viewPort_changeHandler: function(event) {
		if(this._ignoreViewPortTextChange) {
			return;
		}
		this.set_text(this.textFieldViewPort.get_text());
	}
	,textArea_textFormat_changeHandler: function(event) {
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
	}
	,textArea_promptTextFormat_changeHandler: function(event) {
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
	}
	,get_styleContext: function() {
		return feathers_controls_TextArea;
	}
	,__errorFocusRectSkin: null
	,get_errorFocusRectSkin: function() {
		return this.__errorFocusRectSkin;
	}
	,set_errorFocusRectSkin: function(value) {
		if(!this.setStyle("errorFocusRectSkin")) {
			return this.__errorFocusRectSkin;
		}
		if(this.__errorFocusRectSkin == value) {
			return this.__errorFocusRectSkin;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_errorFocusRectSkin);
		this.__errorFocusRectSkin = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__errorFocusRectSkin;
	}
	,clearStyle_errorFocusRectSkin: function() {
		this.set_errorFocusRectSkin(null);
		return this.get_errorFocusRectSkin();
	}
	,__smoothScrolling: null
	,get_smoothScrolling: function() {
		return this.__smoothScrolling;
	}
	,set_smoothScrolling: function(value) {
		if(!this.setStyle("smoothScrolling")) {
			return this.__smoothScrolling;
		}
		if(this.__smoothScrolling == value) {
			return this.__smoothScrolling;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_smoothScrolling);
		this.__smoothScrolling = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__smoothScrolling;
	}
	,clearStyle_smoothScrolling: function() {
		this.set_smoothScrolling(false);
		return this.get_smoothScrolling();
	}
	,__textFormat: null
	,get_textFormat: function() {
		return this.__textFormat;
	}
	,set_textFormat: function(value) {
		if(!this.setStyle("textFormat")) {
			return this.__textFormat;
		}
		if(this.__textFormat == value) {
			return this.__textFormat;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_textFormat);
		this.__textFormat = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__textFormat;
	}
	,clearStyle_textFormat: function() {
		this.set_textFormat(null);
		return this.get_textFormat();
	}
	,__disabledTextFormat: null
	,get_disabledTextFormat: function() {
		return this.__disabledTextFormat;
	}
	,set_disabledTextFormat: function(value) {
		if(!this.setStyle("disabledTextFormat")) {
			return this.__disabledTextFormat;
		}
		if(this.__disabledTextFormat == value) {
			return this.__disabledTextFormat;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_disabledTextFormat);
		this.__disabledTextFormat = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__disabledTextFormat;
	}
	,clearStyle_disabledTextFormat: function() {
		this.set_disabledTextFormat(null);
		return this.get_disabledTextFormat();
	}
	,__promptTextFormat: null
	,get_promptTextFormat: function() {
		return this.__promptTextFormat;
	}
	,set_promptTextFormat: function(value) {
		if(!this.setStyle("promptTextFormat")) {
			return this.__promptTextFormat;
		}
		if(this.__promptTextFormat == value) {
			return this.__promptTextFormat;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_promptTextFormat);
		this.__promptTextFormat = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__promptTextFormat;
	}
	,clearStyle_promptTextFormat: function() {
		this.set_promptTextFormat(null);
		return this.get_promptTextFormat();
	}
	,__embedFonts: null
	,get_embedFonts: function() {
		return this.__embedFonts;
	}
	,set_embedFonts: function(value) {
		if(!this.setStyle("embedFonts")) {
			return this.__embedFonts;
		}
		if(this.__embedFonts == value) {
			return this.__embedFonts;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_embedFonts);
		this.__embedFonts = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__embedFonts;
	}
	,clearStyle_embedFonts: function() {
		this.set_embedFonts(false);
		return this.get_embedFonts();
	}
	,__wordWrap: null
	,get_wordWrap: function() {
		return this.__wordWrap;
	}
	,set_wordWrap: function(value) {
		if(!this.setStyle("wordWrap")) {
			return this.__wordWrap;
		}
		if(this.__wordWrap == value) {
			return this.__wordWrap;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_wordWrap);
		this.__wordWrap = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__wordWrap;
	}
	,clearStyle_wordWrap: function() {
		this.set_wordWrap(true);
		return this.get_wordWrap();
	}
	,__textPaddingTop: null
	,get_textPaddingTop: function() {
		return this.__textPaddingTop;
	}
	,set_textPaddingTop: function(value) {
		if(!this.setStyle("textPaddingTop")) {
			return this.__textPaddingTop;
		}
		if(this.__textPaddingTop == value) {
			return this.__textPaddingTop;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_textPaddingTop);
		this.__textPaddingTop = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__textPaddingTop;
	}
	,clearStyle_textPaddingTop: function() {
		this.set_textPaddingTop(0.0);
		return this.get_textPaddingTop();
	}
	,__textPaddingRight: null
	,get_textPaddingRight: function() {
		return this.__textPaddingRight;
	}
	,set_textPaddingRight: function(value) {
		if(!this.setStyle("textPaddingRight")) {
			return this.__textPaddingRight;
		}
		if(this.__textPaddingRight == value) {
			return this.__textPaddingRight;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_textPaddingRight);
		this.__textPaddingRight = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__textPaddingRight;
	}
	,clearStyle_textPaddingRight: function() {
		this.set_textPaddingRight(0.0);
		return this.get_textPaddingRight();
	}
	,__textPaddingBottom: null
	,get_textPaddingBottom: function() {
		return this.__textPaddingBottom;
	}
	,set_textPaddingBottom: function(value) {
		if(!this.setStyle("textPaddingBottom")) {
			return this.__textPaddingBottom;
		}
		if(this.__textPaddingBottom == value) {
			return this.__textPaddingBottom;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_textPaddingBottom);
		this.__textPaddingBottom = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__textPaddingBottom;
	}
	,clearStyle_textPaddingBottom: function() {
		this.set_textPaddingBottom(0.0);
		return this.get_textPaddingBottom();
	}
	,__textPaddingLeft: null
	,get_textPaddingLeft: function() {
		return this.__textPaddingLeft;
	}
	,set_textPaddingLeft: function(value) {
		if(!this.setStyle("textPaddingLeft")) {
			return this.__textPaddingLeft;
		}
		if(this.__textPaddingLeft == value) {
			return this.__textPaddingLeft;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_textPaddingLeft);
		this.__textPaddingLeft = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__textPaddingLeft;
	}
	,clearStyle_textPaddingLeft: function() {
		this.set_textPaddingLeft(0.0);
		return this.get_textPaddingLeft();
	}
	,__showPromptWhenEmptyAndFocused: null
	,get_showPromptWhenEmptyAndFocused: function() {
		return this.__showPromptWhenEmptyAndFocused;
	}
	,set_showPromptWhenEmptyAndFocused: function(value) {
		if(!this.setStyle("showPromptWhenEmptyAndFocused")) {
			return this.__showPromptWhenEmptyAndFocused;
		}
		if(this.__showPromptWhenEmptyAndFocused == value) {
			return this.__showPromptWhenEmptyAndFocused;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_showPromptWhenEmptyAndFocused);
		this.__showPromptWhenEmptyAndFocused = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__showPromptWhenEmptyAndFocused;
	}
	,clearStyle_showPromptWhenEmptyAndFocused: function() {
		this.set_showPromptWhenEmptyAndFocused(true);
		return this.get_showPromptWhenEmptyAndFocused();
	}
	,__customErrorCalloutVariant: null
	,get_customErrorCalloutVariant: function() {
		return this.__customErrorCalloutVariant;
	}
	,set_customErrorCalloutVariant: function(value) {
		if(!this.setStyle("customErrorCalloutVariant")) {
			return this.__customErrorCalloutVariant;
		}
		if(this.__customErrorCalloutVariant == value) {
			return this.__customErrorCalloutVariant;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_customErrorCalloutVariant);
		this.__customErrorCalloutVariant = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__customErrorCalloutVariant;
	}
	,clearStyle_customErrorCalloutVariant: function() {
		this.set_customErrorCalloutVariant(null);
		return this.get_customErrorCalloutVariant();
	}
	,__class__: feathers_controls_TextArea
	,__properties__: $extend(feathers_controls_supportClasses_BaseScrollContainer.prototype.__properties__,{get_stageFocusTarget:"get_stageFocusTarget",set_customErrorCalloutVariant:"set_customErrorCalloutVariant",get_customErrorCalloutVariant:"get_customErrorCalloutVariant",set_errorCalloutFactory:"set_errorCalloutFactory",get_errorCalloutFactory:"get_errorCalloutFactory",set_maxChars:"set_maxChars",get_maxChars:"get_maxChars",get_selectionActiveIndex:"get_selectionActiveIndex",get_selectionAnchorIndex:"get_selectionAnchorIndex",set_showPromptWhenEmptyAndFocused:"set_showPromptWhenEmptyAndFocused",get_showPromptWhenEmptyAndFocused:"get_showPromptWhenEmptyAndFocused",set_textPaddingLeft:"set_textPaddingLeft",get_textPaddingLeft:"get_textPaddingLeft",set_textPaddingBottom:"set_textPaddingBottom",get_textPaddingBottom:"get_textPaddingBottom",set_textPaddingRight:"set_textPaddingRight",get_textPaddingRight:"get_textPaddingRight",set_textPaddingTop:"set_textPaddingTop",get_textPaddingTop:"get_textPaddingTop",set_wordWrap:"set_wordWrap",get_wordWrap:"get_wordWrap",set_embedFonts:"set_embedFonts",get_embedFonts:"get_embedFonts",set_promptTextFormat:"set_promptTextFormat",get_promptTextFormat:"get_promptTextFormat",set_disabledTextFormat:"set_disabledTextFormat",get_disabledTextFormat:"get_disabledTextFormat",set_textFormat:"set_textFormat",get_textFormat:"get_textFormat",set_smoothScrolling:"set_smoothScrolling",get_smoothScrolling:"get_smoothScrolling",get_errorStringCalloutOpen:"get_errorStringCalloutOpen",set_errorString:"set_errorString",get_errorString:"get_errorString",set_focusedStatePriority:"set_focusedStatePriority",get_focusedStatePriority:"get_focusedStatePriority",set_errorStatePriority:"set_errorStatePriority",get_errorStatePriority:"get_errorStatePriority",set_errorFocusRectSkin:"set_errorFocusRectSkin",get_errorFocusRectSkin:"get_errorFocusRectSkin",set_displayAsPassword:"set_displayAsPassword",get_displayAsPassword:"get_displayAsPassword",set_restrict:"set_restrict",get_restrict:"get_restrict",set_prompt:"set_prompt",get_prompt:"get_prompt",get_baseline:"get_baseline",set_text:"set_text",get_text:"get_text",get_currentState:"get_currentState",set_selectable:"set_selectable",get_selectable:"get_selectable",set_editable:"set_editable",get_editable:"get_editable"})
});
var feathers_controls_TextInputState = $hxEnums["feathers.controls.TextInputState"] = { __ename__:"feathers.controls.TextInputState",__constructs__:null
	,ENABLED: {_hx_name:"ENABLED",_hx_index:0,__enum__:"feathers.controls.TextInputState",toString:$estr}
	,DISABLED: {_hx_name:"DISABLED",_hx_index:1,__enum__:"feathers.controls.TextInputState",toString:$estr}
	,FOCUSED: {_hx_name:"FOCUSED",_hx_index:2,__enum__:"feathers.controls.TextInputState",toString:$estr}
	,ERROR: {_hx_name:"ERROR",_hx_index:3,__enum__:"feathers.controls.TextInputState",toString:$estr}
};
feathers_controls_TextInputState.__constructs__ = [feathers_controls_TextInputState.ENABLED,feathers_controls_TextInputState.DISABLED,feathers_controls_TextInputState.FOCUSED,feathers_controls_TextInputState.ERROR];
var feathers_controls_ToggleButtonState = $hxEnums["feathers.controls.ToggleButtonState"] = { __ename__:"feathers.controls.ToggleButtonState",__constructs__:null
	,UP: ($_=function(selected) { return {_hx_index:0,selected:selected,__enum__:"feathers.controls.ToggleButtonState",toString:$estr}; },$_._hx_name="UP",$_.__params__ = ["selected"],$_)
	,HOVER: ($_=function(selected) { return {_hx_index:1,selected:selected,__enum__:"feathers.controls.ToggleButtonState",toString:$estr}; },$_._hx_name="HOVER",$_.__params__ = ["selected"],$_)
	,DOWN: ($_=function(selected) { return {_hx_index:2,selected:selected,__enum__:"feathers.controls.ToggleButtonState",toString:$estr}; },$_._hx_name="DOWN",$_.__params__ = ["selected"],$_)
	,DISABLED: ($_=function(selected) { return {_hx_index:3,selected:selected,__enum__:"feathers.controls.ToggleButtonState",toString:$estr}; },$_._hx_name="DISABLED",$_.__params__ = ["selected"],$_)
};
feathers_controls_ToggleButtonState.__constructs__ = [feathers_controls_ToggleButtonState.UP,feathers_controls_ToggleButtonState.HOVER,feathers_controls_ToggleButtonState.DOWN,feathers_controls_ToggleButtonState.DISABLED];
var feathers_controls_ToggleSwitch = function(selected,changeListener) {
	if(selected == null) {
		selected = false;
	}
	this.__toggleEase = motion_easing_Quart.easeOut;
	this.__toggleDuration = 0.25;
	this.__paddingLeft = 0.0;
	this.__paddingRight = 0.0;
	this.__secondaryTrackSkin = null;
	this.__trackSkin = null;
	this.__thumbSkin = null;
	this.__embedFonts = false;
	this.__disabledTextFormat = null;
	this.__textFormat = null;
	this._animateSelectionChange = false;
	this._ignoreClick = false;
	this._toggleTween = null;
	this._secondaryTrackSkinMeasurements = null;
	this._currentSecondaryTrackSkin = null;
	this._trackSkinMeasurements = null;
	this._currentTrackSkin = null;
	this._thumbSkinMeasurements = null;
	this._currentThumbSkin = null;
	this._offTextMeasuredHeight = 0.0;
	this._offTextMeasuredWidth = 0.0;
	this._onTextMeasuredHeight = 0.0;
	this._onTextMeasuredWidth = 0.0;
	this._updatedOffTextStyles = false;
	this._updatedOnTextStyles = false;
	this._previousOffSimpleTextFormat = null;
	this._previousOffTextFormat = null;
	this._previousOnSimpleTextFormat = null;
	this._previousOnTextFormat = null;
	this._previousOffText = null;
	this._previousOnText = null;
	this._offText = null;
	this._onText = null;
	this._selected = false;
	this.initializeToggleSwitchTheme();
	feathers_core_FeathersControl.call(this);
	this.set_selected(selected);
	this.mouseChildren = false;
	this.set_buttonMode(true);
	this.useHandCursor = false;
	this.set_tabEnabled(true);
	this.set_tabChildren(false);
	this.focusRect = null;
	this.addEventListener("keyDown",$bind(this,this.toggleSwitch_keyDownHandler));
	this.addEventListener("mouseDown",$bind(this,this.toggleSwitch_mouseDownHandler));
	this.addEventListener("click",$bind(this,this.toggleSwitch_clickHandler));
	this.addEventListener("touchTap",$bind(this,this.toggleSwitch_touchTapHandler));
	if(changeListener != null) {
		this.addEventListener("change",changeListener);
	}
};
$hxClasses["feathers.controls.ToggleSwitch"] = feathers_controls_ToggleSwitch;
feathers_controls_ToggleSwitch.__name__ = "feathers.controls.ToggleSwitch";
feathers_controls_ToggleSwitch.__interfaces__ = [feathers_core_IFocusObject,feathers_controls_IToggle];
feathers_controls_ToggleSwitch.__super__ = feathers_core_FeathersControl;
feathers_controls_ToggleSwitch.prototype = $extend(feathers_core_FeathersControl.prototype,{
	onTextField: null
	,offTextField: null
	,_selected: null
	,get_selected: function() {
		return this._selected;
	}
	,set_selected: function(value) {
		this._animateSelectionChange = false;
		if(this._selected == value) {
			return this._selected;
		}
		this._selected = value;
		feathers_events_FeathersEvent.dispatch(this,"change");
		this.setInvalid(feathers_core_InvalidationFlag.SELECTION);
		return this._selected;
	}
	,_onText: null
	,get_onText: function() {
		return this._onText;
	}
	,set_onText: function(value) {
		if(this._onText == value) {
			return this._onText;
		}
		this._onText = value;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		return this._onText;
	}
	,_offText: null
	,get_offText: function() {
		return this._offText;
	}
	,set_offText: function(value) {
		if(this._offText == value) {
			return this._offText;
		}
		this._offText = value;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		return this._offText;
	}
	,_previousOnText: null
	,_previousOffText: null
	,_previousOnTextFormat: null
	,_previousOnSimpleTextFormat: null
	,_previousOffTextFormat: null
	,_previousOffSimpleTextFormat: null
	,_updatedOnTextStyles: null
	,_updatedOffTextStyles: null
	,_onTextMeasuredWidth: null
	,_onTextMeasuredHeight: null
	,_offTextMeasuredWidth: null
	,_offTextMeasuredHeight: null
	,_currentThumbSkin: null
	,_thumbSkinMeasurements: null
	,_currentTrackSkin: null
	,_trackSkinMeasurements: null
	,_currentSecondaryTrackSkin: null
	,_secondaryTrackSkinMeasurements: null
	,_toggleTween: null
	,_dragStartX: null
	,_ignoreClick: null
	,_animateSelectionChange: null
	,setSelectionWithAnimation: function(selected) {
		if(this._selected == selected) {
			return this._selected;
		}
		this.set_selected(selected);
		this._animateSelectionChange = true;
		return this._selected;
	}
	,setPadding: function(value) {
		this.set_paddingRight(value);
		this.set_paddingLeft(value);
	}
	,initializeToggleSwitchTheme: function() {
		feathers_themes_steel_components_SteelToggleSwitchStyles.initialize();
	}
	,update: function() {
		var dataInvalid = this.isInvalid(feathers_core_InvalidationFlag.DATA);
		var selectionInvalid = this.isInvalid(feathers_core_InvalidationFlag.SELECTION);
		var sizeInvalid = this.isInvalid(feathers_core_InvalidationFlag.SIZE);
		var stateInvalid = this.isInvalid(feathers_core_InvalidationFlag.STATE);
		var stylesInvalid = this.isInvalid(feathers_core_InvalidationFlag.STYLES);
		this._updatedOnTextStyles = false;
		this._updatedOffTextStyles = false;
		if(stylesInvalid) {
			this.refreshThumb();
			this.refreshTrack();
			this.refreshSecondaryTrack();
		}
		if(dataInvalid) {
			this.refreshTextFields();
		}
		if(dataInvalid || stylesInvalid || stateInvalid) {
			this.refreshTextStyles();
		}
		if(dataInvalid || stylesInvalid || stateInvalid || sizeInvalid) {
			this.refreshOnText(sizeInvalid);
			this.refreshOffText(sizeInvalid);
		}
		if(selectionInvalid || stylesInvalid) {
			this.refreshSelection();
		}
		if(stateInvalid || stylesInvalid) {
			this.refreshEnabled();
		}
		if(this.measure()) {
			sizeInvalid = true;
		}
		this.layoutContent();
	}
	,measure: function() {
		var needsWidth = this.get_explicitWidth() == null;
		var needsHeight = this.get_explicitHeight() == null;
		var needsMinWidth = this.get_explicitMinWidth() == null;
		var needsMinHeight = this.get_explicitMinHeight() == null;
		var needsMaxWidth = this.get_explicitMaxWidth() == null;
		var needsMaxHeight = this.get_explicitMaxHeight() == null;
		if(!needsWidth && !needsHeight && !needsMinWidth && !needsMinHeight && !needsMaxWidth && !needsMaxHeight) {
			return false;
		}
		if(this._currentThumbSkin != null) {
			this._thumbSkinMeasurements.restore(this._currentThumbSkin);
			if(js_Boot.__implements(this._currentThumbSkin,feathers_core_IValidating)) {
				this._currentThumbSkin.validateNow();
			}
		}
		if(this._currentTrackSkin != null) {
			this._trackSkinMeasurements.restore(this._currentTrackSkin);
			if(js_Boot.__implements(this._currentTrackSkin,feathers_core_IValidating)) {
				this._currentTrackSkin.validateNow();
			}
		}
		if(this._currentSecondaryTrackSkin != null) {
			this._secondaryTrackSkinMeasurements.restore(this._currentSecondaryTrackSkin);
			if(js_Boot.__implements(this._currentSecondaryTrackSkin,feathers_core_IValidating)) {
				this._currentSecondaryTrackSkin.validateNow();
			}
		}
		var newWidth = this.get_explicitWidth();
		if(needsWidth) {
			newWidth = 0.0;
			if(this._currentTrackSkin != null) {
				newWidth += this._currentTrackSkin.get_width();
				if(this._currentSecondaryTrackSkin != null) {
					newWidth += this._currentSecondaryTrackSkin.get_width();
				}
			}
			if(this.onTextField != null) {
				var onTextAndThumbWidth = this._onTextMeasuredWidth;
				if(this._currentThumbSkin != null) {
					onTextAndThumbWidth += this._currentThumbSkin.get_width();
				}
				if(newWidth < onTextAndThumbWidth) {
					newWidth = onTextAndThumbWidth;
				}
			}
			if(this.offTextField != null) {
				var offTextAndThumbWidth = this._offTextMeasuredWidth;
				if(this._currentThumbSkin != null) {
					offTextAndThumbWidth += this._currentThumbSkin.get_width();
				}
				if(newWidth < offTextAndThumbWidth) {
					newWidth = offTextAndThumbWidth;
				}
			}
		}
		var newHeight = this.get_explicitHeight();
		if(needsHeight) {
			newHeight = 0.0;
			if(this._currentThumbSkin != null) {
				newHeight += this._currentThumbSkin.get_height();
			}
			if(this._currentTrackSkin != null) {
				if(newHeight < this._currentTrackSkin.get_height()) {
					newHeight = this._currentTrackSkin.get_height();
				}
				if(this._currentSecondaryTrackSkin != null && newHeight < this._currentSecondaryTrackSkin.get_height()) {
					newHeight = this._currentSecondaryTrackSkin.get_height();
				}
			}
			if(this.onTextField != null && newHeight < this._onTextMeasuredHeight) {
				newHeight = this._onTextMeasuredHeight;
			}
			if(this.offTextField != null && newHeight < this._offTextMeasuredHeight) {
				newHeight = this._offTextMeasuredHeight;
			}
		}
		var newMinWidth = newWidth;
		var newMinHeight = newHeight;
		var newMaxWidth = newWidth;
		var newMaxHeight = newHeight;
		return this.saveMeasurements(newWidth,newHeight,newMinWidth,newMinHeight,newMaxWidth,newMaxHeight);
	}
	,refreshTextFields: function() {
		if(this._onText == null) {
			if(this.onTextField != null) {
				this.removeChild(this.onTextField);
				this.onTextField = null;
			}
		} else if(this.onTextField == null) {
			var index = 0;
			if(this._currentSecondaryTrackSkin != null) {
				index = 2;
			} else if(this._currentTrackSkin != null) {
				index = 1;
			}
			this.onTextField = new openfl_text_TextField();
			this.addChildAt(this.onTextField,index);
		}
		if(this._offText == null) {
			if(this.offTextField != null) {
				this.removeChild(this.offTextField);
				this.offTextField = null;
			}
		} else if(this.offTextField == null) {
			var index = 0;
			if(this._currentSecondaryTrackSkin != null) {
				index = 2;
			} else if(this._currentTrackSkin != null) {
				index = 1;
			}
			this.offTextField = new openfl_text_TextField();
			this.addChildAt(this.offTextField,index);
		}
	}
	,refreshTextStyles: function() {
		var textFormat = this.getCurrentTextFormat();
		var simpleTextFormat = textFormat != null ? textFormat.toSimpleTextFormat() : null;
		if(this.offTextField != null) {
			if(this.offTextField.get_embedFonts() != this.get_embedFonts()) {
				this.offTextField.set_embedFonts(this.get_embedFonts());
				this._updatedOffTextStyles = true;
			}
			if(simpleTextFormat != this._previousOffSimpleTextFormat) {
				if(this._previousOffTextFormat != null) {
					this._previousOffTextFormat.removeEventListener("change",$bind(this,this.toggleSwitch_offTextFormat_changeHandler));
				}
				if(this.offTextField.get_caretIndex() != -1 && this.offTextField.get_selectionBeginIndex() != this.offTextField.get_selectionEndIndex()) {
					this.offTextField.setSelection(0,0);
				}
				if(textFormat != null) {
					textFormat.addEventListener("change",$bind(this,this.toggleSwitch_offTextFormat_changeHandler),false,0,true);
					this.offTextField.set_defaultTextFormat(simpleTextFormat);
					this._updatedOffTextStyles = true;
				}
				this._previousOffTextFormat = textFormat;
				this._previousOffSimpleTextFormat = simpleTextFormat;
			}
		}
		if(this.onTextField != null) {
			if(this.onTextField.get_embedFonts() != this.get_embedFonts()) {
				this.onTextField.set_embedFonts(this.get_embedFonts());
				this._updatedOnTextStyles = true;
			}
			if(simpleTextFormat != this._previousOnSimpleTextFormat) {
				if(this._previousOnTextFormat != null) {
					this._previousOnTextFormat.removeEventListener("change",$bind(this,this.toggleSwitch_onTextFormat_changeHandler));
				}
				if(this.onTextField.get_caretIndex() != -1 && this.onTextField.get_selectionBeginIndex() != this.onTextField.get_selectionEndIndex()) {
					this.onTextField.setSelection(0,0);
				}
				if(textFormat != null) {
					textFormat.addEventListener("change",$bind(this,this.toggleSwitch_onTextFormat_changeHandler),false,0,true);
					this.onTextField.set_defaultTextFormat(simpleTextFormat);
					this._updatedOnTextStyles = true;
				}
				this._previousOnTextFormat = textFormat;
				this._previousOnSimpleTextFormat = simpleTextFormat;
			}
		}
	}
	,refreshOnText: function(forceMeasurement) {
		if(this.onTextField == null) {
			return;
		}
		var hasText = this._onText != null && this._onText.length > 0;
		if(this._onText == this._previousOnText && !this._updatedOnTextStyles && !forceMeasurement) {
			return;
		}
		this.onTextField.set_autoSize(1);
		if(hasText) {
			this.onTextField.set_text(this._onText);
		} else {
			this.onTextField.set_text("​");
		}
		this._onTextMeasuredWidth = this.onTextField.get_textWidth() + 4;
		this._onTextMeasuredHeight = this.onTextField.get_height();
		this.onTextField.set_autoSize(2);
		if(!hasText) {
			this.onTextField.set_text("");
		}
		this._previousOnText = this._onText;
	}
	,refreshOffText: function(forceMeasurement) {
		if(this.offTextField == null) {
			return;
		}
		var hasText = this._offText != null && this._offText.length > 0;
		if(this._offText == this._previousOffText && !this._updatedOffTextStyles && !forceMeasurement) {
			return;
		}
		this.offTextField.set_autoSize(1);
		if(hasText) {
			this.offTextField.set_text(this._offText);
		} else {
			this.offTextField.set_text("​");
		}
		this._offTextMeasuredWidth = this.offTextField.get_textWidth() + 4;
		this._offTextMeasuredHeight = this.offTextField.get_height();
		this.offTextField.set_autoSize(2);
		if(!hasText) {
			this.offTextField.set_text("");
		}
		this._previousOffText = this._offText;
	}
	,getCurrentTextFormat: function() {
		if(!this._enabled && this.get_disabledTextFormat() != null) {
			return this.get_disabledTextFormat();
		}
		return this.get_textFormat();
	}
	,refreshThumb: function() {
		var oldSkin = this._currentThumbSkin;
		this._currentThumbSkin = this.get_thumbSkin();
		if(this._currentThumbSkin == oldSkin) {
			return;
		}
		if(oldSkin != null && oldSkin.parent == this) {
			if(js_Boot.__implements(oldSkin,feathers_skins_IProgrammaticSkin)) {
				oldSkin.set_uiContext(null);
			}
			this.removeChild(oldSkin);
		}
		if(this._currentThumbSkin != null) {
			if(js_Boot.__implements(this._currentThumbSkin,feathers_core_IUIControl)) {
				this._currentThumbSkin.initializeNow();
			}
			if(this._thumbSkinMeasurements == null) {
				this._thumbSkinMeasurements = new feathers_layout_Measurements(this._currentThumbSkin);
			} else {
				this._thumbSkinMeasurements.save(this._currentThumbSkin);
			}
			if(js_Boot.__implements(this._currentThumbSkin,feathers_skins_IProgrammaticSkin)) {
				this._currentThumbSkin.set_uiContext(this);
			}
			this.addChild(this._currentThumbSkin);
		} else {
			this._thumbSkinMeasurements = null;
		}
	}
	,refreshTrack: function() {
		var oldSkin = this._currentTrackSkin;
		this._currentTrackSkin = this.get_trackSkin();
		if(this._currentTrackSkin == oldSkin) {
			return;
		}
		if(oldSkin != null && oldSkin.parent == this) {
			if(js_Boot.__implements(oldSkin,feathers_skins_IProgrammaticSkin)) {
				oldSkin.set_uiContext(null);
			}
			this.removeChild(oldSkin);
		}
		if(this._currentTrackSkin != null) {
			if(js_Boot.__implements(this._currentTrackSkin,feathers_core_IUIControl)) {
				this._currentTrackSkin.initializeNow();
			}
			if(this._trackSkinMeasurements == null) {
				this._trackSkinMeasurements = new feathers_layout_Measurements(this._currentTrackSkin);
			} else {
				this._trackSkinMeasurements.save(this._currentTrackSkin);
			}
			if(js_Boot.__implements(this._currentTrackSkin,feathers_skins_IProgrammaticSkin)) {
				this._currentTrackSkin.set_uiContext(this);
			}
			this.addChildAt(this._currentTrackSkin,0);
		} else {
			this._trackSkinMeasurements = null;
		}
	}
	,refreshSecondaryTrack: function() {
		var oldSkin = this._currentSecondaryTrackSkin;
		this._currentSecondaryTrackSkin = this.get_secondaryTrackSkin();
		if(this._currentSecondaryTrackSkin == oldSkin) {
			return;
		}
		if(oldSkin != null && oldSkin.parent == this) {
			if(js_Boot.__implements(oldSkin,feathers_skins_IProgrammaticSkin)) {
				oldSkin.set_uiContext(null);
			}
			this.removeChild(oldSkin);
		}
		if(this._currentSecondaryTrackSkin != null) {
			if(js_Boot.__implements(this._currentSecondaryTrackSkin,feathers_core_IUIControl)) {
				this._currentSecondaryTrackSkin.initializeNow();
			}
			if(this._secondaryTrackSkinMeasurements == null) {
				this._secondaryTrackSkinMeasurements = new feathers_layout_Measurements(this._currentSecondaryTrackSkin);
			} else {
				this._secondaryTrackSkinMeasurements.save(this._currentSecondaryTrackSkin);
			}
			if(js_Boot.__implements(this._currentSecondaryTrackSkin,feathers_skins_IProgrammaticSkin)) {
				this._currentSecondaryTrackSkin.set_uiContext(this);
			}
			var index = this._currentTrackSkin != null ? 1 : 0;
			this.addChildAt(this._currentSecondaryTrackSkin,index);
		} else {
			this._secondaryTrackSkinMeasurements = null;
		}
	}
	,refreshSelection: function() {
		if(js_Boot.__implements(this._currentThumbSkin,feathers_controls_IToggle)) {
			this._currentThumbSkin.set_selected(this._selected);
		}
		if(js_Boot.__implements(this._currentTrackSkin,feathers_controls_IToggle)) {
			this._currentTrackSkin.set_selected(this._selected);
		}
		if(js_Boot.__implements(this._currentSecondaryTrackSkin,feathers_controls_IToggle)) {
			this._currentSecondaryTrackSkin.set_selected(this._selected);
		}
		if(this._toggleTween != null) {
			motion_Actuate.stop(this._toggleTween,null,false,false);
			this._toggleTween = null;
		}
	}
	,refreshEnabled: function() {
		if(js_Boot.__implements(this._currentThumbSkin,feathers_core_IUIControl)) {
			this._currentThumbSkin.set_enabled(this._enabled);
		}
		if(js_Boot.__implements(this._currentTrackSkin,feathers_core_IUIControl)) {
			this._currentTrackSkin.set_enabled(this._enabled);
		}
		if(js_Boot.__implements(this._currentSecondaryTrackSkin,feathers_core_IUIControl)) {
			this._currentSecondaryTrackSkin.set_enabled(this._enabled);
		}
	}
	,layoutContent: function() {
		this.layoutThumb();
		if(this._currentTrackSkin != null && this._currentSecondaryTrackSkin != null) {
			this.layoutSplitTrack();
		} else {
			this.layoutSingleTrack();
		}
		this.layoutText();
	}
	,layoutText: function() {
		if(this.onTextField != null) {
			var availableWidth = this.actualWidth - this._currentThumbSkin.get_width() - this.get_paddingLeft() - this.get_paddingRight();
			var onWidth = this._onTextMeasuredWidth;
			if(onWidth > availableWidth) {
				onWidth = availableWidth;
			}
			this.onTextField.set_width(onWidth);
			this.onTextField.set_x(this.get_paddingLeft() + (availableWidth - onWidth) / 2.0);
			var onY = (this.actualHeight - this._onTextMeasuredHeight) / 2.0;
			if(onY < 0.0) {
				onY = 0.0;
			}
			this.onTextField.set_y(onY);
			this.onTextField.set_visible(this._currentThumbSkin.get_x() >= this.onTextField.get_x());
		}
		if(this.offTextField != null) {
			var availableWidth = this.actualWidth - this._currentThumbSkin.get_width() - this.get_paddingLeft() - this.get_paddingRight();
			var offWidth = this._offTextMeasuredWidth;
			if(offWidth > availableWidth) {
				offWidth = availableWidth;
			}
			this.offTextField.set_width(offWidth);
			this.offTextField.set_x(this.actualWidth - this.get_paddingRight() - availableWidth + (availableWidth - offWidth) / 2.0);
			var offY = (this.actualHeight - this._offTextMeasuredHeight) / 2.0;
			if(offY < 0.0) {
				offY = 0.0;
			}
			this.offTextField.set_y(offY);
			this.offTextField.set_visible(this._currentThumbSkin.get_x() + this._currentThumbSkin.get_width() <= this.offTextField.get_x() + offWidth);
		}
	}
	,layoutThumb: function() {
		var _gthis = this;
		if(this._currentThumbSkin == null) {
			return;
		}
		if(js_Boot.__implements(this._currentThumbSkin,feathers_core_IValidating)) {
			this._currentThumbSkin.validateNow();
		}
		var xPosition = this.get_paddingLeft();
		if(this._selected) {
			xPosition = this.actualWidth - this._currentThumbSkin.get_width() - this.get_paddingRight();
		}
		if(this._animateSelectionChange) {
			var tween = motion_Actuate.update(function(x) {
				return _gthis._currentThumbSkin.set_x(x);
			},this.get_toggleDuration(),[this._currentThumbSkin.get_x()],[xPosition],true);
			this._toggleTween = tween;
			this._toggleTween.ease(this.get_toggleEase());
			this._toggleTween.onUpdate($bind(this,this.toggleTween_onUpdate));
			this._toggleTween.onComplete($bind(this,this.toggleTween_onComplete));
		} else if(this._toggleTween == null) {
			this._currentThumbSkin.set_x(xPosition);
		}
		this._currentThumbSkin.set_y((this.actualHeight - this._currentThumbSkin.get_height()) / 2.0);
		this._animateSelectionChange = false;
	}
	,layoutSplitTrack: function() {
		if(this._currentTrackSkin == null || this._currentSecondaryTrackSkin == null) {
			return;
		}
		var location = this._currentThumbSkin.get_x() + this._currentThumbSkin.get_width() / 2.0;
		this._currentTrackSkin.set_x(0.0);
		this._currentTrackSkin.set_width(location);
		this._currentSecondaryTrackSkin.set_x(location);
		this._currentSecondaryTrackSkin.set_width(this.actualWidth - location);
		if(js_Boot.__implements(this._currentTrackSkin,feathers_core_IValidating)) {
			this._currentTrackSkin.validateNow();
		}
		if(js_Boot.__implements(this._currentSecondaryTrackSkin,feathers_core_IValidating)) {
			this._currentSecondaryTrackSkin.validateNow();
		}
		this._currentTrackSkin.set_y((this.actualHeight - this._currentTrackSkin.get_height()) / 2.0);
		this._currentSecondaryTrackSkin.set_y((this.actualHeight - this._currentSecondaryTrackSkin.get_height()) / 2.0);
	}
	,layoutSingleTrack: function() {
		if(this._currentTrackSkin == null) {
			return;
		}
		this._currentTrackSkin.set_x(0.0);
		this._currentTrackSkin.set_width(this.actualWidth);
		if(js_Boot.__implements(this._currentTrackSkin,feathers_core_IValidating)) {
			this._currentTrackSkin.validateNow();
		}
		this._currentTrackSkin.set_y((this.actualHeight - this._currentTrackSkin.get_height()) / 2.0);
	}
	,toggleSwitch_keyDownHandler: function(event) {
		if(!this._enabled || this.get_buttonMode() && this.focusRect == true) {
			return;
		}
		if(event.keyCode != 32 && event.keyCode != 13) {
			return;
		}
		event.preventDefault();
		this.dispatchEvent(new openfl_events_MouseEvent("click"));
	}
	,toggleSwitch_mouseDownHandler: function(event) {
		if(!this._enabled || this.stage == null) {
			return;
		}
		var exclusivePointer = feathers_utils_ExclusivePointer.forStage(this.stage);
		var result = exclusivePointer.claimMouse(this);
		if(!result) {
			return;
		}
		this._dragStartX = this.get_mouseX();
		this._ignoreClick = false;
		this.stage.addEventListener("mouseMove",$bind(this,this.toggleSwitch_stage_mouseMoveHandler),false,0,true);
		this.stage.addEventListener("mouseUp",$bind(this,this.toggleSwitch_stage_mouseUpHandler),false,0,true);
	}
	,toggleSwitch_clickHandler: function(event) {
		if(!this._enabled || this._ignoreClick) {
			return;
		}
		this.setSelectionWithAnimation(!this._selected);
	}
	,toggleSwitch_touchTapHandler: function(event) {
		if(event.isPrimaryTouchPoint) {
			return;
		}
		if(!this._enabled || this._ignoreClick) {
			return;
		}
		this.setSelectionWithAnimation(!this._selected);
	}
	,toggleSwitch_stage_mouseMoveHandler: function(event) {
		if(!this._enabled) {
			return;
		}
		var halfDistance = (this.actualWidth - this.get_paddingLeft() - this.get_paddingRight()) / 2.0;
		var dragOffset = this.get_mouseX() - this._dragStartX;
		var selected = this._selected;
		if(dragOffset >= halfDistance) {
			selected = true;
		} else if(dragOffset <= -halfDistance) {
			selected = false;
		}
		if(this._selected != selected) {
			this._ignoreClick = true;
			this._dragStartX = this.get_mouseX();
			this.setSelectionWithAnimation(selected);
		}
	}
	,toggleSwitch_stage_mouseUpHandler: function(event) {
		var stage = js_Boot.__cast(event.currentTarget , openfl_display_Stage);
		stage.removeEventListener("mouseMove",$bind(this,this.toggleSwitch_stage_mouseMoveHandler));
		stage.removeEventListener("mouseUp",$bind(this,this.toggleSwitch_stage_mouseUpHandler));
	}
	,toggleTween_onUpdate: function() {
		this.layoutContent();
	}
	,toggleTween_onComplete: function() {
		this._toggleTween = null;
	}
	,toggleSwitch_onTextFormat_changeHandler: function(event) {
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
	}
	,toggleSwitch_offTextFormat_changeHandler: function(event) {
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
	}
	,__textFormat: null
	,get_textFormat: function() {
		return this.__textFormat;
	}
	,set_textFormat: function(value) {
		if(!this.setStyle("textFormat")) {
			return this.__textFormat;
		}
		if(this.__textFormat == value) {
			return this.__textFormat;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_textFormat);
		this.__textFormat = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__textFormat;
	}
	,clearStyle_textFormat: function() {
		this.set_textFormat(null);
		return this.get_textFormat();
	}
	,__disabledTextFormat: null
	,get_disabledTextFormat: function() {
		return this.__disabledTextFormat;
	}
	,set_disabledTextFormat: function(value) {
		if(!this.setStyle("disabledTextFormat")) {
			return this.__disabledTextFormat;
		}
		if(this.__disabledTextFormat == value) {
			return this.__disabledTextFormat;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_disabledTextFormat);
		this.__disabledTextFormat = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__disabledTextFormat;
	}
	,clearStyle_disabledTextFormat: function() {
		this.set_disabledTextFormat(null);
		return this.get_disabledTextFormat();
	}
	,__embedFonts: null
	,get_embedFonts: function() {
		return this.__embedFonts;
	}
	,set_embedFonts: function(value) {
		if(!this.setStyle("embedFonts")) {
			return this.__embedFonts;
		}
		if(this.__embedFonts == value) {
			return this.__embedFonts;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_embedFonts);
		this.__embedFonts = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__embedFonts;
	}
	,clearStyle_embedFonts: function() {
		this.set_embedFonts(false);
		return this.get_embedFonts();
	}
	,__thumbSkin: null
	,get_thumbSkin: function() {
		return this.__thumbSkin;
	}
	,set_thumbSkin: function(value) {
		if(!this.setStyle("thumbSkin")) {
			return this.__thumbSkin;
		}
		if(this.__thumbSkin == value) {
			return this.__thumbSkin;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_thumbSkin);
		this.__thumbSkin = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__thumbSkin;
	}
	,clearStyle_thumbSkin: function() {
		this.set_thumbSkin(null);
		return this.get_thumbSkin();
	}
	,__trackSkin: null
	,get_trackSkin: function() {
		return this.__trackSkin;
	}
	,set_trackSkin: function(value) {
		if(!this.setStyle("trackSkin")) {
			return this.__trackSkin;
		}
		if(this.__trackSkin == value) {
			return this.__trackSkin;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_trackSkin);
		this.__trackSkin = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__trackSkin;
	}
	,clearStyle_trackSkin: function() {
		this.set_trackSkin(null);
		return this.get_trackSkin();
	}
	,__secondaryTrackSkin: null
	,get_secondaryTrackSkin: function() {
		return this.__secondaryTrackSkin;
	}
	,set_secondaryTrackSkin: function(value) {
		if(!this.setStyle("secondaryTrackSkin")) {
			return this.__secondaryTrackSkin;
		}
		if(this.__secondaryTrackSkin == value) {
			return this.__secondaryTrackSkin;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_secondaryTrackSkin);
		this.__secondaryTrackSkin = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__secondaryTrackSkin;
	}
	,clearStyle_secondaryTrackSkin: function() {
		this.set_secondaryTrackSkin(null);
		return this.get_secondaryTrackSkin();
	}
	,__paddingRight: null
	,get_paddingRight: function() {
		return this.__paddingRight;
	}
	,set_paddingRight: function(value) {
		if(!this.setStyle("paddingRight")) {
			return this.__paddingRight;
		}
		if(this.__paddingRight == value) {
			return this.__paddingRight;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_paddingRight);
		this.__paddingRight = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__paddingRight;
	}
	,clearStyle_paddingRight: function() {
		this.set_paddingRight(0.0);
		return this.get_paddingRight();
	}
	,__paddingLeft: null
	,get_paddingLeft: function() {
		return this.__paddingLeft;
	}
	,set_paddingLeft: function(value) {
		if(!this.setStyle("paddingLeft")) {
			return this.__paddingLeft;
		}
		if(this.__paddingLeft == value) {
			return this.__paddingLeft;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_paddingLeft);
		this.__paddingLeft = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__paddingLeft;
	}
	,clearStyle_paddingLeft: function() {
		this.set_paddingLeft(0.0);
		return this.get_paddingLeft();
	}
	,__toggleDuration: null
	,get_toggleDuration: function() {
		return this.__toggleDuration;
	}
	,set_toggleDuration: function(value) {
		if(!this.setStyle("toggleDuration")) {
			return this.__toggleDuration;
		}
		if(this.__toggleDuration == value) {
			return this.__toggleDuration;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_toggleDuration);
		this.__toggleDuration = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__toggleDuration;
	}
	,clearStyle_toggleDuration: function() {
		this.set_toggleDuration(0.25);
		return this.get_toggleDuration();
	}
	,__toggleEase: null
	,get_toggleEase: function() {
		return this.__toggleEase;
	}
	,set_toggleEase: function(value) {
		if(!this.setStyle("toggleEase")) {
			return this.__toggleEase;
		}
		if(this.__toggleEase == value) {
			return this.__toggleEase;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_toggleEase);
		this.__toggleEase = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__toggleEase;
	}
	,clearStyle_toggleEase: function() {
		this.set_toggleEase(motion_easing_Quart.easeOut);
		return this.get_toggleEase();
	}
	,get_styleContext: function() {
		return feathers_controls_ToggleSwitch;
	}
	,__class__: feathers_controls_ToggleSwitch
	,__properties__: $extend(feathers_core_FeathersControl.prototype.__properties__,{set_toggleEase:"set_toggleEase",get_toggleEase:"get_toggleEase",set_toggleDuration:"set_toggleDuration",get_toggleDuration:"get_toggleDuration",set_paddingLeft:"set_paddingLeft",get_paddingLeft:"get_paddingLeft",set_paddingRight:"set_paddingRight",get_paddingRight:"get_paddingRight",set_secondaryTrackSkin:"set_secondaryTrackSkin",get_secondaryTrackSkin:"get_secondaryTrackSkin",set_trackSkin:"set_trackSkin",get_trackSkin:"get_trackSkin",set_thumbSkin:"set_thumbSkin",get_thumbSkin:"get_thumbSkin",set_embedFonts:"set_embedFonts",get_embedFonts:"get_embedFonts",set_disabledTextFormat:"set_disabledTextFormat",get_disabledTextFormat:"get_disabledTextFormat",set_textFormat:"set_textFormat",get_textFormat:"get_textFormat",set_offText:"set_offText",get_offText:"get_offText",set_onText:"set_onText",get_onText:"get_onText",set_selected:"set_selected",get_selected:"get_selected"})
});
var feathers_data_TreeGridViewHeaderState = function(column,columnIndex,text) {
	if(columnIndex == null) {
		columnIndex = -1;
	}
	this.enabled = true;
	this.columnIndex = -1;
	this.column = column;
	this.columnIndex = columnIndex;
	this.text = text;
};
$hxClasses["feathers.data.TreeGridViewHeaderState"] = feathers_data_TreeGridViewHeaderState;
feathers_data_TreeGridViewHeaderState.__name__ = "feathers.data.TreeGridViewHeaderState";
feathers_data_TreeGridViewHeaderState.prototype = {
	owner: null
	,column: null
	,columnIndex: null
	,text: null
	,enabled: null
	,__class__: feathers_data_TreeGridViewHeaderState
};
var feathers_controls__$TreeGridView_TreeGridViewRowState = function() {
	this.enabled = true;
	this.selected = false;
	this.opened = false;
	this.branch = false;
	this.layoutIndex = -1;
	this.rowLocation = null;
};
$hxClasses["feathers.controls._TreeGridView.TreeGridViewRowState"] = feathers_controls__$TreeGridView_TreeGridViewRowState;
feathers_controls__$TreeGridView_TreeGridViewRowState.__name__ = "feathers.controls._TreeGridView.TreeGridViewRowState";
feathers_controls__$TreeGridView_TreeGridViewRowState.prototype = {
	owner: null
	,data: null
	,rowLocation: null
	,layoutIndex: null
	,branch: null
	,opened: null
	,selected: null
	,enabled: null
	,columns: null
	,cellRendererRecycler: null
	,customColumnWidths: null
	,customCellRendererVariant: null
	,forceItemStateUpdate: null
	,__class__: feathers_controls__$TreeGridView_TreeGridViewRowState
};
var feathers_controls_TreeGridView = function(dataProvider,columns,changeListener) {
	this.__showHeaderDividersOnlyWhenResizable = false;
	this.__extendedScrollBarY = false;
	this.__headerCornerSkin = null;
	this.__columnResizeSkin = null;
	this.__layout = null;
	this.__customColumnDividerVariant = null;
	this.__columnDividerFactory = null;
	this.__customHeaderDividerVariant = null;
	this.__headerDividerFactory = feathers_utils_DisplayObjectFactory.withClass(feathers_controls_Button);
	this.__customHeaderRendererVariant = null;
	this.__customCellRendererVariant = null;
	this._pendingScrollDuration = null;
	this._pendingScrollLocation = null;
	this._ignoreHeaderLayoutChanges = false;
	this._ignoreLayoutChanges = false;
	this._ignoreOpenedChange = false;
	this._ignoreSelectionChange = false;
	this._selectable = true;
	this._tempVisibleIndices = new feathers_layout_VirtualLayoutRange(0,0);
	this._visibleIndices = new feathers_layout_VirtualLayoutRange(0,0);
	this._virtualCache = [];
	this._totalRowLayoutCount = 0;
	this._rowLayoutItems = [];
	this._unrenderedLayoutIndices = [];
	this._unrenderedLocations = [];
	this.rowStatePool = new lime_utils_ObjectPool(function() {
		return new feathers_controls__$TreeGridView_TreeGridViewRowState();
	});
	this.headerStatePool = new lime_utils_ObjectPool(function() {
		return new feathers_data_TreeGridViewHeaderState();
	});
	this.rowRendererToRowState = new haxe_ds_ObjectMap();
	this.dataToRowRenderer = new haxe_ds_ObjectMap();
	this.activeRowRenderers = [];
	this.inactiveRowRenderers = [];
	this.headerRendererToHeaderState = new haxe_ds_ObjectMap();
	this.dataToHeaderRenderer = new haxe_ds_ObjectMap();
	this._resizableColumns = false;
	this._cellRendererRecycler = feathers_utils_DisplayObjectRecycler.withClass(feathers_controls_dataRenderers_HierarchicalItemRenderer);
	this._virtualLayout = true;
	this._selectedItem = null;
	this._selectedLocation = null;
	this._forceItemStateUpdate = false;
	this._previousCustomHeaderRendererVariant = null;
	this._columns = null;
	this._autoPopulatedColumns = null;
	this.openBranches = [];
	this._childFocusEnabled = true;
	this._headerScrollRect2 = new openfl_geom_Rectangle();
	this._headerScrollRect1 = new openfl_geom_Rectangle();
	this._columnDividerLayoutItems = [];
	this._defaultColumnDividerStorage = new feathers_controls__$TreeGridView_ColumnDividerStorage();
	this._headerDividerLayoutItems = [];
	this._defaultHeaderDividerStorage = new feathers_controls__$TreeGridView_HeaderDividerStorage(feathers_utils_DisplayObjectFactory.withClass(feathers_controls_Button));
	this._headerLayoutItems = [];
	this._unrenderedHeaderData = [];
	this._defaultHeaderStorage = new feathers_controls__$TreeGridView_HeaderRendererStorage(feathers_utils_DisplayObjectRecycler.withClass(feathers_controls_dataRenderers_SortOrderHeaderRenderer));
	this._resizingHeaderTouchPointIsMouse = false;
	this._resizingHeaderTouchPointID = null;
	this._resizingHeaderIndex = -1;
	this.initializeTreeGridViewTheme();
	feathers_controls_supportClasses_BaseScrollContainer.call(this);
	if(this._rowRendererFactory == null) {
		this.set_rowRendererFactory(feathers_utils_DisplayObjectRecycler.withClass(feathers_controls_dataRenderers_TreeGridViewRowRenderer));
	}
	this.set_dataProvider(dataProvider);
	this.set_columns(columns);
	this.set_tabEnabled(true);
	this.focusRect = null;
	if(this.get_viewPort() == null) {
		this.treeGridViewPort = new feathers_controls_supportClasses_AdvancedLayoutViewPort();
		this.addChild(this.treeGridViewPort);
		this.set_viewPort(this.treeGridViewPort);
	}
	if(changeListener != null) {
		this.addEventListener("change",changeListener);
	}
};
$hxClasses["feathers.controls.TreeGridView"] = feathers_controls_TreeGridView;
feathers_controls_TreeGridView.__name__ = "feathers.controls.TreeGridView";
feathers_controls_TreeGridView.__interfaces__ = [feathers_core_IFocusContainer,feathers_core_IDataSelector];
feathers_controls_TreeGridView.defaultUpdateHeaderRenderer = function(headerRenderer,state) {
	if(js_Boot.__implements(headerRenderer,feathers_core_ITextControl)) {
		var textControl = headerRenderer;
		textControl.set_text(state.text);
	}
};
feathers_controls_TreeGridView.defaultResetHeaderRenderer = function(headerRenderer,state) {
	if(js_Boot.__implements(headerRenderer,feathers_core_ITextControl)) {
		var textControl = headerRenderer;
		textControl.set_text(null);
	}
};
feathers_controls_TreeGridView.__super__ = feathers_controls_supportClasses_BaseScrollContainer;
feathers_controls_TreeGridView.prototype = $extend(feathers_controls_supportClasses_BaseScrollContainer.prototype,{
	_headerContainer: null
	,_headerContainerLayout: null
	,_headerResizeContainer: null
	,_columnDividerContainer: null
	,_resizingHeaderIndex: null
	,_resizingHeaderTouchPointID: null
	,_resizingHeaderTouchPointIsMouse: null
	,_resizingHeaderStartStageX: null
	,_customColumnWidths: null
	,_defaultHeaderStorage: null
	,_unrenderedHeaderData: null
	,_headerLayoutItems: null
	,_defaultHeaderDividerStorage: null
	,_headerDividerLayoutItems: null
	,_defaultColumnDividerStorage: null
	,_columnDividerLayoutItems: null
	,_currentHeaderScrollRect: null
	,_headerScrollRect1: null
	,_headerScrollRect2: null
	,_oldHeaderDividerMouseCursor: null
	,get_tabEnabled: function() {
		if((this._selectable || this.get_maxScrollY() != this.get_minScrollY() || this.get_maxScrollX() != this.get_minScrollX()) && this._enabled) {
			return this.get_rawTabEnabled();
		} else {
			return false;
		}
	}
	,_childFocusEnabled: null
	,get_childFocusEnabled: function() {
		if(this._enabled) {
			return this._childFocusEnabled;
		} else {
			return false;
		}
	}
	,set_childFocusEnabled: function(value) {
		if(this._childFocusEnabled == value) {
			return this._childFocusEnabled;
		}
		this._childFocusEnabled = value;
		return this._childFocusEnabled;
	}
	,openBranches: null
	,treeGridViewPort: null
	,_dataProvider: null
	,get_dataProvider: function() {
		return this._dataProvider;
	}
	,set_dataProvider: function(value) {
		if(this._dataProvider == value) {
			return this._dataProvider;
		}
		this._virtualCache.length = 0;
		this._totalRowLayoutCount = 0;
		this.openBranches.length = 0;
		if(this._dataProvider != null) {
			this._dataProvider.removeEventListener("change",$bind(this,this.treeGridView_dataProvider_changeHandler));
			this._dataProvider.removeEventListener("addItem",$bind(this,this.treeGridView_dataProvider_addItemHandler));
			this._dataProvider.removeEventListener("removeItem",$bind(this,this.treeGridView_dataProvider_removeItemHandler));
			this._dataProvider.removeEventListener("replaceItem",$bind(this,this.treeGridView_dataProvider_replaceItemHandler));
			this._dataProvider.removeEventListener("removeAll",$bind(this,this.treeGridView_dataProvider_removeAllHandler));
			this._dataProvider.removeEventListener("reset",$bind(this,this.treeGridView_dataProvider_resetHandler));
			this._dataProvider.removeEventListener("filterChange",$bind(this,this.treeGridView_dataProvider_filterChangeHandler));
			this._dataProvider.removeEventListener("sortChange",$bind(this,this.treeGridView_dataProvider_sortChangeHandler));
			this._dataProvider.removeEventListener("updateItem",$bind(this,this.treeGridView_dataProvider_updateItemHandler));
			this._dataProvider.removeEventListener("updateAll",$bind(this,this.treeGridView_dataProvider_updateAllHandler));
		}
		this._dataProvider = value;
		if(this._dataProvider != null) {
			this._totalRowLayoutCount = this.calculateTotalLayoutCount([]);
			this._virtualCache.length = this._totalRowLayoutCount;
			this._dataProvider.addEventListener("change",$bind(this,this.treeGridView_dataProvider_changeHandler));
			this._dataProvider.addEventListener("addItem",$bind(this,this.treeGridView_dataProvider_addItemHandler));
			this._dataProvider.addEventListener("removeItem",$bind(this,this.treeGridView_dataProvider_removeItemHandler));
			this._dataProvider.addEventListener("replaceItem",$bind(this,this.treeGridView_dataProvider_replaceItemHandler));
			this._dataProvider.addEventListener("removeAll",$bind(this,this.treeGridView_dataProvider_removeAllHandler));
			this._dataProvider.addEventListener("reset",$bind(this,this.treeGridView_dataProvider_resetHandler));
			this._dataProvider.addEventListener("filterChange",$bind(this,this.treeGridView_dataProvider_filterChangeHandler));
			this._dataProvider.addEventListener("sortChange",$bind(this,this.treeGridView_dataProvider_sortChangeHandler));
			this._dataProvider.addEventListener("updateItem",$bind(this,this.treeGridView_dataProvider_updateItemHandler));
			this._dataProvider.addEventListener("updateAll",$bind(this,this.treeGridView_dataProvider_updateAllHandler));
		}
		this.set_scrollX(0.0);
		this.set_scrollY(0.0);
		this.set_selectedLocation(null);
		if(this._autoPopulatedColumns != null) {
			this._autoPopulatedColumns = null;
			this.set_columns(null);
		}
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		feathers_events_FeathersEvent.dispatch(this,"dataChange");
		return this._dataProvider;
	}
	,_autoPopulatedColumns: null
	,_columns: null
	,get_columns: function() {
		return this._columns;
	}
	,set_columns: function(value) {
		if(this._columns == value) {
			return this._columns;
		}
		if(this._columns != null) {
			this._columns.removeEventListener("change",$bind(this,this.treeGridView_columns_changeHandler));
			this._columns.removeEventListener("addItem",$bind(this,this.treeGridView_columns_addItemHandler));
			this._columns.removeEventListener("removeItem",$bind(this,this.treeGridView_columns_removeItemHandler));
		}
		this._columns = value;
		if(this._columns != null) {
			this._columns.addEventListener("change",$bind(this,this.treeGridView_columns_changeHandler));
			this._columns.addEventListener("addItem",$bind(this,this.treeGridView_columns_addItemHandler));
			this._columns.addEventListener("removeItem",$bind(this,this.treeGridView_columns_removeItemHandler));
		}
		this._autoPopulatedColumns = null;
		this._customColumnWidths = null;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		return this._columns;
	}
	,get_rowRendererFactory: function() {
		return this._rowRendererFactory;
	}
	,set_rowRendererFactory: function(value) {
		if(this._rowRendererFactory == value) {
			return this._rowRendererFactory;
		}
		this._oldRowRendererFactory = this._rowRendererFactory;
		this._rowRendererFactory = value;
		this.setInvalid(feathers_controls_TreeGridView.INVALIDATION_FLAG_ROW_RENDERER_FACTORY);
		return this._rowRendererFactory;
	}
	,get_headerRendererRecycler: function() {
		return this._defaultHeaderStorage.headerRendererRecycler;
	}
	,set_headerRendererRecycler: function(value) {
		if(this._defaultHeaderStorage.headerRendererRecycler == value) {
			return this._defaultHeaderStorage.headerRendererRecycler;
		}
		this._defaultHeaderStorage.oldHeaderRendererRecycler = this._defaultHeaderStorage.headerRendererRecycler;
		this._defaultHeaderStorage.headerRendererRecycler = value;
		this.setInvalid(feathers_controls_TreeGridView.INVALIDATION_FLAG_HEADER_RENDERER_FACTORY);
		return this._defaultHeaderStorage.headerRendererRecycler;
	}
	,_previousCustomHeaderRendererVariant: null
	,_rowRendererFactory: null
	,_oldRowRendererFactory: null
	,_rowRendererMeasurements: null
	,_forceItemStateUpdate: null
	,get_forceItemStateUpdate: function() {
		return this._forceItemStateUpdate;
	}
	,set_forceItemStateUpdate: function(value) {
		if(this._forceItemStateUpdate == value) {
			return this._forceItemStateUpdate;
		}
		this._forceItemStateUpdate = value;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		return this._forceItemStateUpdate;
	}
	,_selectedLocation: null
	,get_selectedLocation: function() {
		return this._selectedLocation;
	}
	,set_selectedLocation: function(value) {
		if(!this._selectable || this._dataProvider == null) {
			value = null;
		}
		if(this._selectedLocation == value || this.compareLocations(this._selectedLocation,value) == 0) {
			return this._selectedLocation;
		}
		this._selectedLocation = value;
		if(this._selectedLocation == null) {
			this._selectedItem = null;
		} else {
			this._selectedItem = this._dataProvider.get(this._selectedLocation);
		}
		this.setInvalid(feathers_core_InvalidationFlag.SELECTION);
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._selectedLocation;
	}
	,_selectedItem: null
	,get_selectedItem: function() {
		return this._selectedItem;
	}
	,set_selectedItem: function(value) {
		if(value == null || !this._selectable || this._dataProvider == null) {
			this.set_selectedLocation(null);
			return this._selectedItem;
		}
		var location = this._dataProvider.locationOf(value);
		if(this._selectedItem == value && this.compareLocations(this._selectedLocation,location) == 0) {
			return this._selectedItem;
		}
		this._selectedItem = value;
		this._selectedLocation = location;
		this.setInvalid(feathers_core_InvalidationFlag.SELECTION);
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._selectedItem;
	}
	,_previousLayout: null
	,_virtualLayout: null
	,get_virtualLayout: function() {
		return this._virtualLayout;
	}
	,set_virtualLayout: function(value) {
		if(this._virtualLayout = value) {
			return this._virtualLayout;
		}
		this._virtualLayout = value;
		this.setInvalid(feathers_core_InvalidationFlag.LAYOUT);
		return this._virtualLayout;
	}
	,_cellRendererRecycler: null
	,get_cellRendererRecycler: function() {
		return this._cellRendererRecycler;
	}
	,set_cellRendererRecycler: function(value) {
		if(this._cellRendererRecycler == value) {
			return this._cellRendererRecycler;
		}
		this._cellRendererRecycler = value;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		return this._cellRendererRecycler;
	}
	,_resizableColumns: null
	,get_resizableColumns: function() {
		return this._resizableColumns;
	}
	,set_resizableColumns: function(value) {
		if(this._resizableColumns == value) {
			return this._resizableColumns;
		}
		this._resizableColumns = value;
		this.setInvalid(feathers_core_InvalidationFlag.LAYOUT);
		return this._resizableColumns;
	}
	,_currentColumnResizeSkin: null
	,_currentHeaderCornerSkin: null
	,dataToHeaderRenderer: null
	,headerRendererToHeaderState: null
	,inactiveRowRenderers: null
	,activeRowRenderers: null
	,dataToRowRenderer: null
	,rowRendererToRowState: null
	,headerStatePool: null
	,rowStatePool: null
	,_unrenderedLocations: null
	,_unrenderedLayoutIndices: null
	,_rowLayoutItems: null
	,_totalRowLayoutCount: null
	,_virtualCache: null
	,_visibleIndices: null
	,_tempVisibleIndices: null
	,_selectable: null
	,get_selectable: function() {
		return this._selectable;
	}
	,set_selectable: function(value) {
		if(this._selectable == value) {
			return this._selectable;
		}
		this._selectable = value;
		if(!this._selectable) {
			this.set_selectedLocation(null);
		}
		return this._selectable;
	}
	,_ignoreSelectionChange: null
	,_ignoreOpenedChange: null
	,_ignoreLayoutChanges: null
	,_ignoreHeaderLayoutChanges: null
	,_currentDisplayIndex: null
	,_pendingScrollLocation: null
	,_pendingScrollDuration: null
	,scrollToLocation: function(location,animationDuration) {
		if(this._dataProvider == null || this._dataProvider.getLength() == 0) {
			return;
		}
		this._pendingScrollLocation = location;
		this._pendingScrollDuration = animationDuration;
		this.setInvalid(feathers_core_InvalidationFlag.SCROLL);
	}
	,itemAndColumnToCellRenderer: function(item,column) {
		if(item == null) {
			return null;
		}
		var rowRenderer = this.dataToRowRenderer.h[item.__id__];
		if(rowRenderer == null) {
			return null;
		}
		return rowRenderer.columnToCellRenderer(column);
	}
	,columnToHeaderRenderer: function(column) {
		return this.dataToHeaderRenderer.h[column.__id__];
	}
	,headerRendererToColumn: function(headerRenderer) {
		var state = this.headerRendererToHeaderState.h[headerRenderer.__id__];
		if(state == null) {
			return null;
		}
		return state.column;
	}
	,isBranchOpen: function(branch) {
		if(this._dataProvider == null || !this._dataProvider.contains(branch)) {
			return false;
		}
		if(this._dataProvider.isBranch(branch)) {
			return this.openBranches.indexOf(branch) != -1;
		} else {
			return false;
		}
	}
	,toggleBranch: function(branch,open) {
		var location = this._dataProvider != null ? this._dataProvider.locationOf(branch) : null;
		if(location == null) {
			throw new openfl_errors_ArgumentError("Cannot open branch because it is not in the data provider.");
		}
		if(!this._dataProvider.isBranch(branch)) {
			throw new openfl_errors_ArgumentError("Cannot open item because it is not a branch.");
		}
		var alreadyOpen = this.openBranches.indexOf(branch) != -1;
		if(open && alreadyOpen || !open && !alreadyOpen) {
			return;
		}
		var layoutIndex = this.locationToDisplayIndex(location,false);
		this.toggleBranchInternal(branch,location,layoutIndex,open);
		this._totalRowLayoutCount = this.calculateTotalLayoutCount([]);
	}
	,toggleChildrenOf: function(branch,open) {
		var location = this._dataProvider != null ? this._dataProvider.locationOf(branch) : null;
		if(location == null) {
			throw new openfl_errors_ArgumentError("Cannot open branch because it is not in the data provider.");
		}
		if(!this._dataProvider.isBranch(branch)) {
			throw new openfl_errors_ArgumentError("Cannot open item because it is not a branch.");
		}
		var layoutIndex = this.locationToDisplayIndex(location,false);
		this.toggleChildrenOfInternal(branch,location,layoutIndex,open);
		this._totalRowLayoutCount = this.calculateTotalLayoutCount([]);
	}
	,itemAndColumnToCellState: function(item,column) {
		if(item == null) {
			return null;
		}
		var rowRenderer = this.dataToRowRenderer.h[item.__id__];
		if(rowRenderer == null) {
			return null;
		}
		return rowRenderer.columnToCellState(column);
	}
	,dispose: function() {
		this.refreshInactiveHeaderRenderers(true);
		this.refreshInactiveRowRenderers(true);
		this._selectedItem = null;
		this._selectedLocation = null;
		this.set_dataProvider(null);
		this.set_columns(null);
		feathers_controls_supportClasses_BaseScrollContainer.prototype.dispose.call(this);
	}
	,initializeTreeGridViewTheme: function() {
		feathers_themes_steel_components_SteelTreeGridViewStyles.initialize();
	}
	,initialize: function() {
		feathers_controls_supportClasses_BaseScrollContainer.prototype.initialize.call(this);
		if(this._headerContainerLayout == null) {
			this._headerContainerLayout = new feathers_layout_GridViewRowLayout();
			this._headerContainerLayout.set_heightResetEnabled(false);
		}
		if(this._headerContainer == null) {
			this._headerContainer = new feathers_controls_LayoutGroup();
			this._headerContainer.set_layout(this._headerContainerLayout);
			this.addChild(this._headerContainer);
		}
		if(this._headerResizeContainer == null) {
			this._headerResizeContainer = new openfl_display_Sprite();
			this.addChild(this._headerResizeContainer);
		}
		if(this._columnDividerContainer == null) {
			this._columnDividerContainer = new openfl_display_Sprite();
			this._columnDividerContainer.mouseEnabled = false;
			this._columnDividerContainer.mouseChildren = false;
			this.addChild(this._columnDividerContainer);
		}
	}
	,update: function() {
		var dataInvalid = this.isInvalid(feathers_core_InvalidationFlag.DATA);
		var layoutInvalid = this.isInvalid(feathers_core_InvalidationFlag.LAYOUT);
		var stateInvalid = this.isInvalid(feathers_core_InvalidationFlag.STATE);
		var stylesInvalid = this.isInvalid(feathers_core_InvalidationFlag.STYLES);
		if(this._previousCustomHeaderRendererVariant != this.get_customHeaderRendererVariant()) {
			this.setInvalidationFlag(feathers_controls_TreeGridView.INVALIDATION_FLAG_HEADER_RENDERER_FACTORY);
		}
		var headerRendererInvalid = this.isInvalid(feathers_controls_TreeGridView.INVALIDATION_FLAG_HEADER_RENDERER_FACTORY);
		if(this._defaultHeaderDividerStorage.headerDividerFactory != this.get_headerDividerFactory()) {
			this._defaultHeaderDividerStorage.oldHeaderDividerFactory = this._defaultHeaderDividerStorage.headerDividerFactory;
			this._defaultHeaderDividerStorage.headerDividerFactory = this.get_headerDividerFactory();
			this.setInvalidationFlag(feathers_controls_TreeGridView.INVALIDATION_FLAG_HEADER_DIVIDER_FACTORY);
		}
		if(this._defaultHeaderDividerStorage.customHeaderDividerVariant != this.get_customHeaderDividerVariant()) {
			this._defaultHeaderDividerStorage.customHeaderDividerVariant = this.get_customHeaderDividerVariant();
			this.setInvalidationFlag(feathers_controls_TreeGridView.INVALIDATION_FLAG_HEADER_DIVIDER_FACTORY);
		}
		var headerDividerInvalid = this.isInvalid(feathers_controls_TreeGridView.INVALIDATION_FLAG_HEADER_DIVIDER_FACTORY);
		if(this._defaultColumnDividerStorage.columnDividerFactory != this.get_columnDividerFactory()) {
			this._defaultColumnDividerStorage.oldColumnDividerFactory = this._defaultColumnDividerStorage.columnDividerFactory;
			this._defaultColumnDividerStorage.columnDividerFactory = this.get_columnDividerFactory();
			this.setInvalidationFlag(feathers_controls_TreeGridView.INVALIDATION_FLAG_COLUMN_DIVIDER_FACTORY);
		}
		if(this._defaultColumnDividerStorage.customColumnDividerVariant != this.get_customColumnDividerVariant()) {
			this._defaultColumnDividerStorage.customColumnDividerVariant = this.get_customColumnDividerVariant();
			this.setInvalidationFlag(feathers_controls_TreeGridView.INVALIDATION_FLAG_COLUMN_DIVIDER_FACTORY);
		}
		var columnDividerInvalid = this.isInvalid(feathers_controls_TreeGridView.INVALIDATION_FLAG_COLUMN_DIVIDER_FACTORY);
		this.validateColumns();
		if(stylesInvalid) {
			this.refreshHeaderCornerSkin();
		}
		if(stylesInvalid || layoutInvalid) {
			this.refreshColumnResizeSkin();
		}
		if(headerRendererInvalid || stateInvalid || dataInvalid) {
			this.refreshHeaderRenderers();
		}
		if(headerDividerInvalid || stateInvalid || dataInvalid) {
			this.refreshHeaderDividers();
		}
		if(columnDividerInvalid || stateInvalid || dataInvalid) {
			this.refreshColumnDividers();
		}
		if(layoutInvalid) {
			this._headerResizeContainer.mouseEnabled = this._resizableColumns;
			this._headerResizeContainer.mouseChildren = this._resizableColumns;
		}
		if(dataInvalid || layoutInvalid) {
			var oldIgnoreHeaderLayoutChanges = this._ignoreHeaderLayoutChanges;
			this._ignoreHeaderLayoutChanges = true;
			this._headerContainerLayout.set_customColumnWidths(this._customColumnWidths);
			this._ignoreHeaderLayoutChanges = oldIgnoreHeaderLayoutChanges;
		}
		if(layoutInvalid || stylesInvalid) {
			if(this._previousLayout != this.get_layout()) {
				this._virtualCache.length = 0;
				this._virtualCache.length = this._totalRowLayoutCount;
			}
			this.treeGridViewPort.set_layout(this.get_layout());
			this._previousLayout = this.get_layout();
		}
		this.treeGridViewPort.refreshChildren = $bind(this,this.refreshRowRenderers);
		var flag = this._invalidationFlags.keys();
		while(flag.hasNext()) {
			var flag1 = flag.next();
			this.treeGridViewPort.setInvalid(flag1);
		}
		if(this._allInvalid) {
			this.treeGridViewPort.setInvalid();
		}
		feathers_controls_supportClasses_BaseScrollContainer.prototype.update.call(this);
		this._previousCustomHeaderRendererVariant = this.get_customHeaderRendererVariant();
		this.validateCustomColumnWidths();
		this.layoutHeaders();
		this.layoutHeaderDividers();
		this.layoutColumnDividers();
		this.handlePendingScroll();
	}
	,createScroller: function() {
		feathers_controls_supportClasses_BaseScrollContainer.prototype.createScroller.call(this);
		this.treeGridViewPort.set_scroller(this.scroller);
	}
	,refreshScrollerValues: function() {
		feathers_controls_supportClasses_BaseScrollContainer.prototype.refreshScrollerValues.call(this);
		if(js_Boot.__implements(this.get_layout(),feathers_layout_IScrollLayout)) {
			var scrollLayout = this.get_layout();
			this.scroller.forceElasticTop = scrollLayout.get_elasticTop();
			this.scroller.forceElasticRight = scrollLayout.get_elasticRight();
			this.scroller.forceElasticBottom = scrollLayout.get_elasticBottom();
			this.scroller.forceElasticLeft = scrollLayout.get_elasticLeft();
		} else {
			this.scroller.forceElasticTop = false;
			this.scroller.forceElasticRight = false;
			this.scroller.forceElasticBottom = false;
			this.scroller.forceElasticLeft = false;
		}
		this.scroller.snapPositionsX = this.treeGridViewPort.get_snapPositionsX();
		this.scroller.snapPositionsY = this.treeGridViewPort.get_snapPositionsY();
	}
	,needsScrollMeasurement: function() {
		var oldStart = this._visibleIndices.start;
		var oldEnd = this._visibleIndices.end;
		if(this._virtualLayout && js_Boot.__implements(this.get_layout(),feathers_layout_IVirtualLayout)) {
			var virtualLayout = this.get_layout();
			var oldIgnoreLayoutChanges = this._ignoreLayoutChanges;
			this._ignoreLayoutChanges = true;
			virtualLayout.set_scrollX(this.scroller.get_scrollX());
			virtualLayout.set_scrollY(this.scroller.get_scrollY());
			this._ignoreLayoutChanges = oldIgnoreLayoutChanges;
			virtualLayout.getVisibleIndices(this._rowLayoutItems.length,this.treeGridViewPort.get_visibleWidth(),this.treeGridViewPort.get_visibleHeight(),this._tempVisibleIndices);
		} else {
			this._tempVisibleIndices.start = 0;
			this._tempVisibleIndices.end = this._rowLayoutItems.length - 1;
		}
		if(oldStart == this._tempVisibleIndices.start) {
			return oldEnd != this._tempVisibleIndices.end;
		} else {
			return true;
		}
	}
	,calculateViewPortOffsets: function(forceScrollBars,useActualBounds) {
		var oldTopViewPortOffset = this.topViewPortOffset;
		var oldRightViewPortOffset = this.rightViewPortOffset;
		var oldBottomViewPortOffset = this.bottomViewPortOffset;
		var oldLeftViewPortOffset = this.leftViewPortOffset;
		if(this.get_fixedScrollBars() && this.get_showScrollBars()) {
			feathers_controls_supportClasses_BaseScrollContainer.prototype.calculateViewPortOffsets.call(this,forceScrollBars,useActualBounds);
		}
		if(this._headerContainer != null) {
			var oldIgnoreHeaderLayoutChanges = this._ignoreHeaderLayoutChanges;
			this._ignoreHeaderLayoutChanges = true;
			if(this.get_scrollBarYPosition()._hx_index == 3) {
				this._headerContainerLayout.set_paddingLeft(this.leftViewPortOffset);
				this._headerContainerLayout.set_paddingRight(0.0);
			} else {
				this._headerContainerLayout.set_paddingLeft(0.0);
				this._headerContainerLayout.set_paddingRight(this.rightViewPortOffset);
			}
			this._ignoreHeaderLayoutChanges = oldIgnoreHeaderLayoutChanges;
			this.topViewPortOffset = oldTopViewPortOffset;
			this.rightViewPortOffset = oldRightViewPortOffset;
			this.bottomViewPortOffset = oldBottomViewPortOffset;
			this.leftViewPortOffset = oldLeftViewPortOffset;
			this._headerContainer.validateNow();
			this.topViewPortOffset += this._headerContainer.get_height();
			this.chromeMeasuredWidth = Math.max(this.chromeMeasuredWidth,this._headerContainer.get_width());
			this.chromeMeasuredMinWidth = Math.max(this.chromeMeasuredMinWidth,this._headerContainer.get_width());
			feathers_controls_supportClasses_BaseScrollContainer.prototype.calculateViewPortOffsets.call(this,forceScrollBars,useActualBounds);
			var oldIgnoreHeaderLayoutChanges = this._ignoreHeaderLayoutChanges;
			this._ignoreHeaderLayoutChanges = true;
			if(this.get_scrollBarYPosition()._hx_index == 3) {
				this._headerContainerLayout.set_paddingLeft(this.leftViewPortOffset);
				this._headerContainerLayout.set_paddingRight(0.0);
			} else {
				this._headerContainerLayout.set_paddingLeft(0.0);
				this._headerContainerLayout.set_paddingRight(this.rightViewPortOffset);
			}
			this._ignoreHeaderLayoutChanges = oldIgnoreHeaderLayoutChanges;
		}
	}
	,validateColumns: function() {
		var _gthis = this;
		if(this._columns != null) {
			return;
		}
		var newColumns = null;
		if(this._dataProvider != null && this._dataProvider.getLength() > 0) {
			var item = this._dataProvider.get([0]);
			var _this = Reflect.fields(item);
			var result = new Array(_this.length);
			var _g = 0;
			var _g1 = _this.length;
			while(_g < _g1) {
				var i = _g++;
				var fieldName = [_this[i]];
				result[i] = new feathers_controls_TreeGridViewColumn(fieldName[0],(function(fieldName) {
					return function(item) {
						return Std.string(Reflect.getProperty(item,fieldName[0]));
					};
				})(fieldName));
			}
			newColumns = new feathers_data_ArrayCollection(result);
		} else {
			newColumns = new feathers_data_ArrayCollection();
		}
		this.runWithInvalidationFlagsOnly(function() {
			_gthis.set_columns(newColumns);
		});
		this._autoPopulatedColumns = newColumns;
	}
	,layoutHeaders: function() {
		if(this._headerContainer == null) {
			return;
		}
		this._headerContainer.set_x(this.get_paddingLeft());
		this._headerContainer.set_y(this.get_paddingTop());
		var minHeaderWidth = this.actualWidth - this.get_paddingLeft() - this.get_paddingRight();
		this._headerContainer.set_width(Math.max(this._viewPort.get_width() + this._headerContainerLayout.get_paddingLeft() + this._headerContainerLayout.get_paddingRight(),minHeaderWidth));
		this._headerContainer.validateNow();
		if(!feathers_utils_MathUtil.fuzzyEquals(this.get_maxScrollX(),this.get_minScrollX())) {
			var scrollRect = this._scrollRect1;
			if(this._currentScrollRect == scrollRect) {
				scrollRect = this._scrollRect2;
			}
			this._currentScrollRect = scrollRect;
			var scrollRectWidth = minHeaderWidth;
			if(scrollRectWidth < 0.0) {
				scrollRectWidth = 0.0;
			}
			var scrollRectHeight = this._headerContainer.get_height();
			if(scrollRectHeight < 0.0) {
				scrollRectHeight = 0.0;
			}
			scrollRect.setTo(this.get_scrollX() - this.get_minScrollX(),0.0,scrollRectWidth,scrollRectHeight);
			this._headerContainer.set_scrollRect(scrollRect);
		} else {
			this._headerContainer.set_scrollRect(null);
		}
		if(this._currentHeaderCornerSkin != null) {
			if(this.get_fixedScrollBars() && !this.get_extendedScrollBarY() && this.scrollBarY != null && this.scrollBarY.get_visible()) {
				this._currentHeaderCornerSkin.set_x(this.scrollBarY.get_x());
				this._currentHeaderCornerSkin.set_width(this.scrollBarY.get_width());
				this._currentHeaderCornerSkin.set_y(this._headerContainer.get_y());
				this._currentHeaderCornerSkin.set_height(this._headerContainer.get_height());
				this._currentHeaderCornerSkin.set_visible(true);
			} else {
				this._currentHeaderCornerSkin.set_visible(false);
			}
		}
	}
	,layoutHeaderDividers: function() {
		this._headerResizeContainer.set_x(this._headerContainer.get_x());
		this._headerResizeContainer.set_y(this._headerContainer.get_y());
		var _g = 0;
		var _g1 = this._headerDividerLayoutItems.length;
		while(_g < _g1) {
			var i = _g++;
			var headerDivider = this._headerDividerLayoutItems[i];
			headerDivider.set_visible(!this.get_showHeaderDividersOnlyWhenResizable() || this.get_resizableColumns());
			if(js_Boot.__implements(headerDivider,feathers_core_IValidating)) {
				headerDivider.validateNow();
			}
			var headerRenderer = this._headerLayoutItems[i];
			headerDivider.set_x(headerRenderer.get_x() + headerRenderer.get_width() - headerDivider.get_width() / 2.0);
			headerDivider.set_y(headerRenderer.get_y());
			headerDivider.set_height(headerRenderer.get_height());
		}
	}
	,layoutColumnDividers: function() {
		this._columnDividerContainer.set_x(this._viewPort.get_x());
		this._columnDividerContainer.set_y(this._viewPort.get_y());
		var _g = 0;
		var _g1 = this._columnDividerLayoutItems.length;
		while(_g < _g1) {
			var i = _g++;
			var columnDivider = this._columnDividerLayoutItems[i];
			if(js_Boot.__implements(columnDivider,feathers_core_IValidating)) {
				columnDivider.validateNow();
			}
			var headerRenderer = this._headerLayoutItems[i];
			columnDivider.set_x(headerRenderer.get_x() + headerRenderer.get_width() - columnDivider.get_width() / 2.0);
			columnDivider.set_y(headerRenderer.get_y());
			columnDivider.set_height(this._viewPort.get_visibleHeight());
		}
	}
	,layoutScrollBars: function() {
		if(!this.get_extendedScrollBarY()) {
			feathers_controls_supportClasses_BaseScrollContainer.prototype.layoutScrollBars.call(this);
			return;
		}
		var oldTopViewPortOffset = this.topViewPortOffset;
		this.topViewPortOffset = 0.0;
		feathers_controls_supportClasses_BaseScrollContainer.prototype.layoutScrollBars.call(this);
		this.topViewPortOffset = oldTopViewPortOffset;
	}
	,refreshHeaderCornerSkin: function() {
		var oldSkin = this._currentHeaderCornerSkin;
		this._currentHeaderCornerSkin = this.getCurrentHeaderCornerSkin();
		if(this._currentHeaderCornerSkin == oldSkin) {
			return;
		}
		this.removeCurrentHeaderCornerSkin(oldSkin);
		this.addCurrentHeaderCornerSkin(this._currentHeaderCornerSkin);
	}
	,getCurrentHeaderCornerSkin: function() {
		return this.get_headerCornerSkin();
	}
	,addCurrentHeaderCornerSkin: function(skin) {
		if(skin == null) {
			return;
		}
		if(js_Boot.__implements(skin,feathers_core_IUIControl)) {
			skin.initializeNow();
		}
		if(js_Boot.__implements(skin,feathers_skins_IProgrammaticSkin)) {
			skin.set_uiContext(this);
		}
		this.addChild(skin);
	}
	,removeCurrentHeaderCornerSkin: function(skin) {
		if(skin == null) {
			return;
		}
		if(js_Boot.__implements(skin,feathers_skins_IProgrammaticSkin)) {
			skin.set_uiContext(null);
		}
		if(skin.parent == this) {
			this.removeChild(skin);
		}
	}
	,refreshColumnResizeSkin: function() {
		var oldSkin = this._currentColumnResizeSkin;
		this._currentColumnResizeSkin = this.getCurrentColumnResizeSkin();
		if(this._currentColumnResizeSkin == oldSkin) {
			return;
		}
		this.removeCurrentColumnResizeSkin(oldSkin);
		if(this._currentColumnResizeSkin == null) {
			return;
		}
		if(js_Boot.__implements(this._currentColumnResizeSkin,feathers_core_IUIControl)) {
			this._currentColumnResizeSkin.initializeNow();
		}
		if(js_Boot.__implements(this._currentColumnResizeSkin,feathers_skins_IProgrammaticSkin)) {
			this._currentColumnResizeSkin.set_uiContext(this);
		}
		this._currentColumnResizeSkin.set_visible(false);
		if(((this._currentColumnResizeSkin) instanceof openfl_display_InteractiveObject)) {
			this._currentColumnResizeSkin.mouseEnabled = false;
		}
		if(((this._currentColumnResizeSkin) instanceof openfl_display_DisplayObjectContainer)) {
			this._currentColumnResizeSkin.mouseChildren = false;
		}
		this.addChildAt(this._currentColumnResizeSkin,0);
	}
	,getCurrentColumnResizeSkin: function() {
		return this.get_columnResizeSkin();
	}
	,removeCurrentColumnResizeSkin: function(skin) {
		if(skin == null) {
			return;
		}
		if(js_Boot.__implements(skin,feathers_skins_IProgrammaticSkin)) {
			skin.set_uiContext(null);
		}
		if(skin.parent == this) {
			this.removeChild(skin);
		}
	}
	,refreshHeaderRenderers: function() {
		var oldIgnoreHeaderLayoutChanges = this._ignoreHeaderLayoutChanges;
		this._ignoreHeaderLayoutChanges = true;
		this._headerContainerLayout.set_columns(this._columns);
		this._ignoreHeaderLayoutChanges = oldIgnoreHeaderLayoutChanges;
		if(this._defaultHeaderStorage.headerRendererRecycler.update == null) {
			this._defaultHeaderStorage.headerRendererRecycler.update = feathers_controls_TreeGridView.defaultUpdateHeaderRenderer;
			if(this._defaultHeaderStorage.headerRendererRecycler.reset == null) {
				this._defaultHeaderStorage.headerRendererRecycler.reset = feathers_controls_TreeGridView.defaultResetHeaderRenderer;
			}
		}
		var headerRendererInvalid = this.isInvalid(feathers_controls_TreeGridView.INVALIDATION_FLAG_HEADER_RENDERER_FACTORY);
		this.refreshInactiveHeaderRenderers(headerRendererInvalid);
		this.findUnrenderedHeaderData();
		this.recoverInactiveHeaderRenderers();
		this.renderUnrenderedHeaderData();
		this.freeInactiveHeaderRenderers();
		if(this._defaultHeaderStorage.inactiveHeaderRenderers.length > 0) {
			var c = js_Boot.getClass(this);
			throw new openfl_errors_IllegalOperationError("" + c.__name__ + ": inactive header renderers should be empty after updating.");
		}
	}
	,refreshHeaderDividers: function() {
		var headerDividerInvalid = this.isInvalid(feathers_controls_TreeGridView.INVALIDATION_FLAG_HEADER_DIVIDER_FACTORY);
		this.refreshInactiveHeaderDividers(headerDividerInvalid);
		this.refreshActiveHeaderDividers();
		this.freeInactiveHeaderDividers();
		if(this._defaultHeaderDividerStorage.inactiveHeaderDividers.length > 0) {
			var c = js_Boot.getClass(this);
			throw new openfl_errors_IllegalOperationError("" + c.__name__ + ": inactive header dividers should be empty after updating.");
		}
	}
	,refreshColumnDividers: function() {
		var columnDividerInvalid = this.isInvalid(feathers_controls_TreeGridView.INVALIDATION_FLAG_COLUMN_DIVIDER_FACTORY);
		this.refreshInactiveColumnDividers(columnDividerInvalid);
		this.refreshActiveColumnDividers();
		this.freeInactiveColumnDividers();
		if(this._defaultColumnDividerStorage.inactiveColumnDividers.length > 0) {
			var c = js_Boot.getClass(this);
			throw new openfl_errors_IllegalOperationError("" + c.__name__ + ": inactive column dividers should be empty after updating.");
		}
	}
	,refreshInactiveHeaderDividers: function(factoryInvalid) {
		var temp = this._defaultHeaderDividerStorage.inactiveHeaderDividers;
		this._defaultHeaderDividerStorage.inactiveHeaderDividers = this._defaultHeaderDividerStorage.activeHeaderDividers;
		this._defaultHeaderDividerStorage.activeHeaderDividers = temp;
		if(this._defaultHeaderDividerStorage.activeHeaderDividers.length > 0) {
			var c = js_Boot.getClass(this);
			throw new openfl_errors_IllegalOperationError("" + c.__name__ + ": active header dividers should be empty before updating.");
		}
		if(factoryInvalid) {
			this.freeInactiveHeaderDividers();
			this._defaultHeaderDividerStorage.oldHeaderDividerFactory = null;
		}
	}
	,freeInactiveHeaderDividers: function() {
		var factory = this._defaultHeaderDividerStorage.oldHeaderDividerFactory != null ? this._defaultHeaderDividerStorage.oldHeaderDividerFactory : this._defaultHeaderDividerStorage.headerDividerFactory;
		var _g = 0;
		var _g1 = this._defaultHeaderDividerStorage.inactiveHeaderDividers;
		while(_g < _g1.length) {
			var headerDivider = _g1[_g];
			++_g;
			if(headerDivider == null) {
				continue;
			}
			this.destroyHeaderDivider(headerDivider,factory);
		}
		this._defaultHeaderDividerStorage.inactiveHeaderDividers.length = 0;
	}
	,refreshActiveHeaderDividers: function() {
		this._headerDividerLayoutItems.length = 0;
		if(this._defaultHeaderDividerStorage.headerDividerFactory == null) {
			return;
		}
		var _g = 0;
		var _g1 = this._columns.get_length() - 1;
		while(_g < _g1) {
			var i = _g++;
			var column = this._columns.get(i);
			var headerDivider = this.createHeaderDivider(column,i);
			this._headerDividerLayoutItems[i] = headerDivider;
			this._defaultHeaderDividerStorage.activeHeaderDividers.push(headerDivider);
		}
	}
	,createHeaderDivider: function(column,columnIndex) {
		var headerDivider = null;
		if(this._defaultHeaderDividerStorage.inactiveHeaderDividers.length == 0) {
			headerDivider = this._defaultHeaderDividerStorage.headerDividerFactory.create();
			if(js_Boot.__implements(headerDivider,feathers_style_IVariantStyleObject)) {
				var variantHeaderDivider = headerDivider;
				if(variantHeaderDivider.get_variant() == null) {
					var variant = this.get_customHeaderDividerVariant() != null ? this.get_customHeaderDividerVariant() : feathers_controls_TreeGridView.CHILD_VARIANT_HEADER_DIVIDER;
					variantHeaderDivider.set_variant(variant);
				}
			}
			if(js_Boot.__implements(headerDivider,feathers_core_IUIControl)) {
				headerDivider.initializeNow();
			}
			headerDivider.addEventListener("rollOver",$bind(this,this.treeGridView_headerDivider_rollOverHandler));
			headerDivider.addEventListener("rollOut",$bind(this,this.treeGridView_headerDivider_rollOutHandler));
			headerDivider.addEventListener("mouseDown",$bind(this,this.treeGridView_headerDivider_mouseDownHandler));
			headerDivider.addEventListener("touchBegin",$bind(this,this.treeGridView_headerDivider_touchBeginHandler));
			this._headerResizeContainer.addChildAt(headerDivider,columnIndex);
		} else {
			headerDivider = this._defaultHeaderDividerStorage.inactiveHeaderDividers.shift();
			this._headerResizeContainer.setChildIndex(headerDivider,columnIndex);
		}
		return headerDivider;
	}
	,destroyHeaderDivider: function(headerDivider,factory) {
		headerDivider.removeEventListener("rollOver",$bind(this,this.treeGridView_headerDivider_rollOverHandler));
		headerDivider.removeEventListener("rollOut",$bind(this,this.treeGridView_headerDivider_rollOutHandler));
		headerDivider.removeEventListener("mouseDown",$bind(this,this.treeGridView_headerDivider_mouseDownHandler));
		headerDivider.removeEventListener("touchBegin",$bind(this,this.treeGridView_headerDivider_touchBeginHandler));
		this._headerResizeContainer.removeChild(headerDivider);
		if(factory != null && factory.destroy != null) {
			factory.destroy(headerDivider);
		}
	}
	,refreshInactiveColumnDividers: function(factoryInvalid) {
		var temp = this._defaultColumnDividerStorage.inactiveColumnDividers;
		this._defaultColumnDividerStorage.inactiveColumnDividers = this._defaultColumnDividerStorage.activeColumnDividers;
		this._defaultColumnDividerStorage.activeColumnDividers = temp;
		if(this._defaultColumnDividerStorage.activeColumnDividers.length > 0) {
			var c = js_Boot.getClass(this);
			throw new openfl_errors_IllegalOperationError("" + c.__name__ + ": active column dividers should be empty before updating.");
		}
		if(factoryInvalid) {
			this.freeInactiveHeaderDividers();
			this._defaultColumnDividerStorage.oldColumnDividerFactory = null;
		}
	}
	,freeInactiveColumnDividers: function() {
		var factory = this._defaultColumnDividerStorage.oldColumnDividerFactory != null ? this._defaultColumnDividerStorage.oldColumnDividerFactory : this._defaultColumnDividerStorage.columnDividerFactory;
		var _g = 0;
		var _g1 = this._defaultColumnDividerStorage.inactiveColumnDividers;
		while(_g < _g1.length) {
			var headerDivider = _g1[_g];
			++_g;
			if(headerDivider == null) {
				continue;
			}
			this.destroyColumnDivider(headerDivider,factory);
		}
		this._defaultColumnDividerStorage.inactiveColumnDividers.length = 0;
	}
	,refreshActiveColumnDividers: function() {
		this._columnDividerLayoutItems.length = 0;
		if(this._defaultColumnDividerStorage.columnDividerFactory == null) {
			return;
		}
		var _g = 0;
		var _g1 = this._columns.get_length() - 1;
		while(_g < _g1) {
			var i = _g++;
			var column = this._columns.get(i);
			var columnDivider = this.createColumnDivider(column,i);
			this._columnDividerLayoutItems[i] = columnDivider;
			this._defaultColumnDividerStorage.activeColumnDividers.push(columnDivider);
		}
	}
	,createColumnDivider: function(column,columnIndex) {
		var columnDivider = null;
		if(this._defaultColumnDividerStorage.inactiveColumnDividers.length == 0) {
			columnDivider = this._defaultColumnDividerStorage.columnDividerFactory.create();
			if(js_Boot.__implements(columnDivider,feathers_style_IVariantStyleObject)) {
				var variantColumnDivider = columnDivider;
				if(variantColumnDivider.get_variant() == null) {
					var variant = this.get_customColumnDividerVariant() != null ? this.get_customColumnDividerVariant() : feathers_controls_TreeGridView.CHILD_VARIANT_COLUMN_DIVIDER;
					variantColumnDivider.set_variant(variant);
				}
			}
			if(js_Boot.__implements(columnDivider,feathers_core_IUIControl)) {
				columnDivider.initializeNow();
			}
			this._columnDividerContainer.addChildAt(columnDivider,columnIndex);
		} else {
			columnDivider = this._defaultColumnDividerStorage.inactiveColumnDividers.shift();
			this._columnDividerContainer.setChildIndex(columnDivider,columnIndex);
		}
		return columnDivider;
	}
	,destroyColumnDivider: function(columnDivider,factory) {
		this._columnDividerContainer.removeChild(columnDivider);
		if(factory != null && factory.destroy != null) {
			factory.destroy(columnDivider);
		}
	}
	,refreshInactiveHeaderRenderers: function(factoryInvalid) {
		var temp = this._defaultHeaderStorage.inactiveHeaderRenderers;
		this._defaultHeaderStorage.inactiveHeaderRenderers = this._defaultHeaderStorage.activeHeaderRenderers;
		this._defaultHeaderStorage.activeHeaderRenderers = temp;
		if(this._defaultHeaderStorage.activeHeaderRenderers.length > 0) {
			var c = js_Boot.getClass(this);
			throw new openfl_errors_IllegalOperationError("" + c.__name__ + ": active header renderers should be empty before updating.");
		}
		if(factoryInvalid) {
			this.recoverInactiveHeaderRenderers();
			this.freeInactiveHeaderRenderers();
			this._defaultHeaderStorage.oldHeaderRendererRecycler = null;
		}
	}
	,recoverInactiveHeaderRenderers: function() {
		var _g = 0;
		var _g1 = this._defaultHeaderStorage.inactiveHeaderRenderers;
		while(_g < _g1.length) {
			var headerRenderer = _g1[_g];
			++_g;
			if(headerRenderer == null) {
				continue;
			}
			var state = this.headerRendererToHeaderState.h[headerRenderer.__id__];
			if(state == null) {
				continue;
			}
			var column = state.column;
			this.headerRendererToHeaderState.remove(headerRenderer);
			this.dataToHeaderRenderer.remove(column);
			headerRenderer.removeEventListener("trigger",$bind(this,this.treeGridView_headerRenderer_triggerHandler));
			headerRenderer.removeEventListener("click",$bind(this,this.treeGridView_headerRenderer_clickHandler));
			headerRenderer.removeEventListener("touchTap",$bind(this,this.treeGridView_headerRenderer_touchTapHandler));
			headerRenderer.removeEventListener("resize",$bind(this,this.treeGridView_headerRenderer_resizeHandler));
			this.resetHeaderRenderer(headerRenderer,state);
			if(this._defaultHeaderStorage.measurements != null) {
				this._defaultHeaderStorage.measurements.restore(headerRenderer);
			}
			this.headerStatePool.release(state);
		}
	}
	,freeInactiveHeaderRenderers: function() {
		var recycler = this._defaultHeaderStorage.oldHeaderRendererRecycler != null ? this._defaultHeaderStorage.oldHeaderRendererRecycler : this._defaultHeaderStorage.headerRendererRecycler;
		var _g = 0;
		var _g1 = this._defaultHeaderStorage.inactiveHeaderRenderers;
		while(_g < _g1.length) {
			var headerRenderer = _g1[_g];
			++_g;
			if(headerRenderer == null) {
				continue;
			}
			this.destroyHeaderRenderer(headerRenderer,recycler);
		}
		this._defaultHeaderStorage.inactiveHeaderRenderers.length = 0;
	}
	,findUnrenderedHeaderData: function() {
		this._rowLayoutItems.length = 0;
		if(this._columns == null || this._columns.get_length() == 0) {
			return;
		}
		this._rowLayoutItems.length = this._columns.get_length();
		var _g = 0;
		var _g1 = this._columns.get_length();
		while(_g < _g1) {
			var i = _g++;
			var column = this._columns.get(i);
			var headerRenderer = this.dataToHeaderRenderer.h[column.__id__];
			if(headerRenderer != null) {
				var state = this.headerRendererToHeaderState.h[headerRenderer.__id__];
				var changed = this.populateCurrentHeaderState(column,i,state,this._forceItemStateUpdate);
				if(changed) {
					this.updateHeaderRenderer(headerRenderer,state);
				}
				headerRenderer.set_visible(true);
				this._headerLayoutItems[i] = headerRenderer;
				var removed = HxOverrides.remove(this._defaultHeaderStorage.inactiveHeaderRenderers,headerRenderer);
				if(!removed) {
					var c = js_Boot.getClass(this);
					throw new openfl_errors_IllegalOperationError("" + c.__name__ + ": header renderer map contains bad data for column at index " + i + ". This may be caused by duplicate columns, which is not allowed.");
				}
				this._defaultHeaderStorage.activeHeaderRenderers.push(headerRenderer);
			} else {
				this._unrenderedHeaderData.push(column);
			}
		}
	}
	,renderUnrenderedHeaderData: function() {
		var _g = 0;
		var _g1 = this._unrenderedHeaderData;
		while(_g < _g1.length) {
			var column = _g1[_g];
			++_g;
			var index = this._columns.indexOf(column);
			var state = this.headerStatePool.get();
			this.populateCurrentHeaderState(column,index,state,true);
			var headerRenderer = this.createHeaderRenderer(state);
			headerRenderer.set_visible(true);
			this._headerContainer.addChildAt(headerRenderer,index);
			this._headerLayoutItems[index] = headerRenderer;
		}
		this._unrenderedHeaderData.length = 0;
	}
	,refreshRowRenderers: function(items) {
		this._rowLayoutItems = items;
		var rowRendererInvalid = this.treeGridViewPort.isInvalid(feathers_controls_TreeGridView.INVALIDATION_FLAG_ROW_RENDERER_FACTORY);
		this.refreshInactiveRowRenderers(rowRendererInvalid);
		this.findUnrenderedData();
		this.recoverInactiveRowRenderers();
		this.renderUnrenderedData();
		this.freeInactiveRowRenderers();
		if(this.inactiveRowRenderers.length > 0) {
			var c = js_Boot.getClass(this);
			throw new openfl_errors_IllegalOperationError("" + c.__name__ + ": inactive row renderers should be empty after updating.");
		}
	}
	,refreshInactiveRowRenderers: function(factoryInvalid) {
		var temp = this.inactiveRowRenderers;
		this.inactiveRowRenderers = this.activeRowRenderers;
		this.activeRowRenderers = temp;
		if(this.activeRowRenderers.length > 0) {
			var c = js_Boot.getClass(this);
			throw new openfl_errors_IllegalOperationError("" + c.__name__ + ": active row renderers should be empty before updating.");
		}
		if(factoryInvalid) {
			this.recoverInactiveRowRenderers();
			this.freeInactiveRowRenderers();
			this._oldRowRendererFactory = null;
		}
	}
	,recoverInactiveRowRenderers: function() {
		var _g = 0;
		var _g1 = this.inactiveRowRenderers;
		while(_g < _g1.length) {
			var rowRenderer = _g1[_g];
			++_g;
			if(rowRenderer == null) {
				continue;
			}
			var state = this.rowRendererToRowState.h[rowRenderer.__id__];
			if(state == null) {
				continue;
			}
			var item = state.data;
			this.rowRendererToRowState.remove(rowRenderer);
			this.dataToRowRenderer.remove(item);
			rowRenderer.removeEventListener("cellTrigger",$bind(this,this.treeGridView_rowRenderer_cellTriggerHandler));
			rowRenderer.removeEventListener("trigger",$bind(this,this.treeGridView_rowRenderer_triggerHandler));
			rowRenderer.removeEventListener("open",$bind(this,this.treeGridView_rowRenderer_openHandler));
			rowRenderer.removeEventListener("close",$bind(this,this.treeGridView_rowRenderer_closeHandler));
			this.resetRowRenderer(rowRenderer,state);
			if(this._rowRendererMeasurements != null) {
				this._rowRendererMeasurements.restore(rowRenderer);
			}
			this.rowStatePool.release(state);
		}
	}
	,freeInactiveRowRenderers: function() {
		var _g = 0;
		var _g1 = this.inactiveRowRenderers;
		while(_g < _g1.length) {
			var rowRenderer = _g1[_g];
			++_g;
			if(rowRenderer == null) {
				continue;
			}
			this.destroyRowRenderer(rowRenderer);
		}
		this.inactiveRowRenderers.length = 0;
	}
	,findUnrenderedData: function() {
		this._rowLayoutItems.length = 0;
		this._rowLayoutItems.length = this._totalRowLayoutCount;
		if(this._virtualLayout && js_Boot.__implements(this.get_layout(),feathers_layout_IVirtualLayout)) {
			var virtualLayout = this.get_layout();
			var oldIgnoreLayoutChanges = this._ignoreLayoutChanges;
			this._ignoreLayoutChanges = true;
			virtualLayout.set_scrollX(this.scroller.get_scrollX());
			virtualLayout.set_scrollY(this.scroller.get_scrollY());
			virtualLayout.set_virtualCache(this._virtualCache);
			this._ignoreLayoutChanges = oldIgnoreLayoutChanges;
			virtualLayout.getVisibleIndices(this._rowLayoutItems.length,this.treeGridViewPort.get_visibleWidth(),this.treeGridViewPort.get_visibleHeight(),this._visibleIndices);
		} else {
			this._visibleIndices.start = 0;
			this._visibleIndices.end = this._rowLayoutItems.length - 1;
		}
		this.findUnrenderedDataForLocation([],0);
	}
	,findUnrenderedDataForLocation: function(location,layoutIndex) {
		if(this._dataProvider == null) {
			return layoutIndex;
		}
		var _g = 0;
		var _g1 = this._dataProvider.getLength(location);
		while(_g < _g1) {
			var i = _g++;
			location.push(i);
			var item = this._dataProvider.get(location);
			if(layoutIndex < this._visibleIndices.start || layoutIndex > this._visibleIndices.end) {
				this._rowLayoutItems[layoutIndex] = null;
			} else {
				this.findRowRenderer(item,location.slice(),layoutIndex);
			}
			++layoutIndex;
			if(layoutIndex > this._visibleIndices.end) {
				break;
			}
			if(this._dataProvider.isBranch(item) && this.openBranches.indexOf(item) != -1) {
				layoutIndex = this.findUnrenderedDataForLocation(location,layoutIndex);
				if(layoutIndex > this._visibleIndices.end) {
					break;
				}
			}
			location.pop();
		}
		return layoutIndex;
	}
	,findRowRenderer: function(item,location,layoutIndex) {
		var rowRenderer = this.dataToRowRenderer.h[item.__id__];
		if(rowRenderer == null) {
			this._unrenderedLocations.push(location);
			this._unrenderedLayoutIndices.push(layoutIndex);
			return;
		}
		var state = this.rowRendererToRowState.h[rowRenderer.__id__];
		var changed = this.populateCurrentRowState(item,location,layoutIndex,state,this._forceItemStateUpdate);
		if(changed) {
			this.updateRowRenderer(rowRenderer,state);
		}
		rowRenderer.set_visible(true);
		this._rowLayoutItems[layoutIndex] = rowRenderer;
		var removed = HxOverrides.remove(this.inactiveRowRenderers,rowRenderer);
		if(!removed) {
			var c = js_Boot.getClass(this);
			throw new openfl_errors_IllegalOperationError("" + c.__name__ + ": row renderer map contains bad data for item at location " + Std.string(location) + ". This may be caused by duplicate items in the data provider, which is not allowed.");
		}
		this.activeRowRenderers.push(rowRenderer);
	}
	,renderUnrenderedData: function() {
		var _g = 0;
		var _g1 = this._unrenderedLocations;
		while(_g < _g1.length) {
			var location = _g1[_g];
			++_g;
			var layoutIndex = this._unrenderedLayoutIndices.shift();
			var item = this._dataProvider.get(location);
			var state = this.rowStatePool.get();
			this.populateCurrentRowState(item,location,layoutIndex,state,true);
			var rowRenderer = this.createRowRenderer(state);
			rowRenderer.set_visible(true);
			this.treeGridViewPort.addChild(rowRenderer);
			this._rowLayoutItems[layoutIndex] = rowRenderer;
		}
		this._unrenderedLocations.length = 0;
	}
	,createRowRenderer: function(state) {
		var rowRenderer = null;
		if(this.inactiveRowRenderers.length == 0) {
			rowRenderer = this._rowRendererFactory.create();
			if(this._rowRendererMeasurements == null) {
				this._rowRendererMeasurements = new feathers_layout_Measurements(rowRenderer);
			}
			rowRenderer.initializeNow();
		} else {
			rowRenderer = this.inactiveRowRenderers.shift();
		}
		this.updateRowRenderer(rowRenderer,state);
		rowRenderer.set_treeGridView(this);
		rowRenderer.addEventListener("cellTrigger",$bind(this,this.treeGridView_rowRenderer_cellTriggerHandler));
		rowRenderer.addEventListener("trigger",$bind(this,this.treeGridView_rowRenderer_triggerHandler));
		rowRenderer.addEventListener("open",$bind(this,this.treeGridView_rowRenderer_openHandler));
		rowRenderer.addEventListener("close",$bind(this,this.treeGridView_rowRenderer_closeHandler));
		this.rowRendererToRowState.set(rowRenderer,state);
		this.dataToRowRenderer.set(state.data,rowRenderer);
		this.activeRowRenderers.push(rowRenderer);
		return rowRenderer;
	}
	,destroyRowRenderer: function(rowRenderer) {
		var factory = this._oldRowRendererFactory != null ? this._oldRowRendererFactory : this._rowRendererFactory;
		rowRenderer.set_treeGridView(null);
		this.treeGridViewPort.removeChild(rowRenderer);
		if(factory.destroy != null) {
			factory.destroy(rowRenderer);
		}
	}
	,updateRowRenderer: function(rowRenderer,state) {
		this.refreshRowRendererProperties(rowRenderer,state);
	}
	,resetRowRenderer: function(rowRenderer,state) {
		this.refreshRowRendererProperties(rowRenderer,feathers_controls_TreeGridView.RESET_ROW_STATE);
	}
	,populateCurrentRowState: function(item,location,layoutIndex,state,force) {
		var changed = false;
		if(force || state.owner != this) {
			state.owner = this;
			changed = true;
		}
		if(force || state.data != item) {
			state.data = item;
			changed = true;
		}
		if(force || state.rowLocation != location && this.compareLocations(state.rowLocation,location) != 0) {
			state.rowLocation = location;
			changed = true;
		}
		if(force || state.layoutIndex != layoutIndex) {
			state.layoutIndex = layoutIndex;
			changed = true;
		}
		var branch = this._dataProvider != null && this._dataProvider.isBranch(item);
		if(force || state.branch != branch) {
			state.branch = branch;
			changed = true;
		}
		var opened = state.branch && this.openBranches.indexOf(item) != -1;
		if(force || state.opened != opened) {
			state.opened = opened;
			changed = true;
		}
		var selected = this.compareLocations(location,this._selectedLocation) == 0;
		if(force || state.selected != selected) {
			state.selected = selected;
			changed = true;
		}
		var enabled = this._enabled;
		if(force || state.enabled != enabled) {
			state.enabled = enabled;
			changed = true;
		}
		var columns = this._columns;
		if(force || state.columns != columns) {
			state.columns = columns;
			changed = true;
		}
		var cellRendererRecycler = this._cellRendererRecycler;
		if(force || state.cellRendererRecycler != cellRendererRecycler) {
			state.cellRendererRecycler = cellRendererRecycler;
			changed = true;
		}
		var customColumnWidths = this._customColumnWidths;
		if(force || state.customColumnWidths != customColumnWidths) {
			state.customColumnWidths = customColumnWidths;
			changed = true;
		}
		var customCellRendererVariant = this.get_customCellRendererVariant();
		if(force || state.customCellRendererVariant != customCellRendererVariant) {
			state.customCellRendererVariant = customCellRendererVariant;
			changed = true;
		}
		var forceItemStateUpdate = this._forceItemStateUpdate;
		if(force || state.forceItemStateUpdate != forceItemStateUpdate) {
			state.forceItemStateUpdate = forceItemStateUpdate;
			changed = true;
		}
		return changed;
	}
	,populateCurrentRowCellState: function(item,location,column,columnIndex,layoutIndex,state,force) {
		var changed = false;
		if(force || state.owner != this) {
			state.owner = this;
			changed = true;
		}
		if(force || state.data != item) {
			state.data = item;
			changed = true;
		}
		if(force || state.rowLocation != location && this.compareLocations(state.rowLocation,location) != 0) {
			state.rowLocation = location;
			changed = true;
		}
		if(force || state.columnIndex != columnIndex) {
			state.columnIndex = columnIndex;
			changed = true;
		}
		if(force || state.column != column) {
			state.column = column;
			changed = true;
		}
		if(force || state.layoutIndex != layoutIndex) {
			state.layoutIndex = layoutIndex;
			changed = true;
		}
		var branch = this._dataProvider != null && this._dataProvider.isBranch(item);
		if(force || state.branch != branch) {
			state.branch = branch;
			changed = true;
		}
		var opened = state.branch && this.openBranches.indexOf(item) != -1;
		if(force || state.opened != opened) {
			state.opened = opened;
			changed = true;
		}
		var selected = this.compareLocations(location,this._selectedLocation) == 0;
		if(force || state.selected != selected) {
			state.selected = selected;
			changed = true;
		}
		var enabled = this._enabled;
		if(force || state.enabled != enabled) {
			state.enabled = enabled;
			changed = true;
		}
		var text = column != null ? column.itemToText(item) : null;
		if(force || state.text != text) {
			state.text = text;
			changed = true;
		}
		return changed;
	}
	,refreshRowRendererProperties: function(rowRenderer,state) {
		var oldIgnoreSelectionChange = this._ignoreSelectionChange;
		this._ignoreSelectionChange = true;
		var oldIgnoreOpenedChange = this._ignoreOpenedChange;
		this._ignoreOpenedChange = true;
		rowRenderer.set_data(state.data);
		rowRenderer.set_rowLocation(state.rowLocation);
		rowRenderer.set_layoutIndex(state.layoutIndex);
		rowRenderer.set_branch(state.branch);
		rowRenderer.set_opened(state.opened);
		rowRenderer.set_selected(state.selected);
		rowRenderer.set_enabled(state.enabled);
		rowRenderer.set_columns(state.columns);
		rowRenderer.set_cellRendererRecycler(state.cellRendererRecycler);
		rowRenderer.set_customCellRendererVariant(state.customCellRendererVariant);
		rowRenderer.set_customColumnWidths(state.customColumnWidths);
		rowRenderer.set_forceCellStateUpdate(state.forceItemStateUpdate);
		this._ignoreOpenedChange = oldIgnoreOpenedChange;
		this._ignoreSelectionChange = oldIgnoreSelectionChange;
	}
	,createHeaderRenderer: function(state) {
		var headerRenderer = null;
		if(this._defaultHeaderStorage.inactiveHeaderRenderers.length == 0) {
			headerRenderer = this._defaultHeaderStorage.headerRendererRecycler.create();
			if(js_Boot.__implements(headerRenderer,feathers_style_IVariantStyleObject)) {
				var variantHeaderRenderer = headerRenderer;
				if(variantHeaderRenderer.get_variant() == null) {
					var variant = this.get_customHeaderRendererVariant() != null ? this.get_customHeaderRendererVariant() : feathers_controls_TreeGridView.CHILD_VARIANT_HEADER_RENDERER;
					variantHeaderRenderer.set_variant(variant);
				}
			}
			if(js_Boot.__implements(headerRenderer,feathers_core_IUIControl)) {
				headerRenderer.initializeNow();
			}
			if(this._defaultHeaderStorage.measurements == null) {
				this._defaultHeaderStorage.measurements = new feathers_layout_Measurements(headerRenderer);
			}
		} else {
			headerRenderer = this._defaultHeaderStorage.inactiveHeaderRenderers.shift();
		}
		this.updateHeaderRenderer(headerRenderer,state);
		if(js_Boot.__implements(headerRenderer,feathers_controls_ITriggerView)) {
			headerRenderer.addEventListener("trigger",$bind(this,this.treeGridView_headerRenderer_triggerHandler));
		} else {
			headerRenderer.addEventListener("click",$bind(this,this.treeGridView_headerRenderer_clickHandler));
			headerRenderer.addEventListener("touchTap",$bind(this,this.treeGridView_headerRenderer_touchTapHandler));
		}
		if(js_Boot.__implements(headerRenderer,feathers_core_IMeasureObject)) {
			headerRenderer.addEventListener("resize",$bind(this,this.treeGridView_headerRenderer_resizeHandler));
		}
		this.headerRendererToHeaderState.set(headerRenderer,state);
		this.dataToHeaderRenderer.set(state.column,headerRenderer);
		this._defaultHeaderStorage.activeHeaderRenderers.push(headerRenderer);
		return headerRenderer;
	}
	,destroyHeaderRenderer: function(headerRenderer,recycler) {
		this._headerContainer.removeChild(headerRenderer);
		if(recycler != null && recycler.destroy != null) {
			recycler.destroy(headerRenderer);
		}
	}
	,populateCurrentHeaderState: function(column,columnIndex,state,force) {
		var changed = false;
		if(force || state.owner != this) {
			state.owner = this;
			changed = true;
		}
		if(force || state.column != column) {
			state.column = column;
			changed = true;
		}
		if(force || state.columnIndex != columnIndex) {
			state.columnIndex = columnIndex;
			changed = true;
		}
		var headerText = column.headerText;
		if(force || state.text != headerText) {
			state.text = headerText;
			changed = true;
		}
		var enabled = this._enabled;
		if(force || state.enabled != enabled) {
			state.enabled = enabled;
			changed = true;
		}
		return changed;
	}
	,updateHeaderRenderer: function(headerRenderer,state) {
		if(this._defaultHeaderStorage.headerRendererRecycler.update != null) {
			this._defaultHeaderStorage.headerRendererRecycler.update(headerRenderer,state);
		}
		this.refreshHeaderRendererProperties(headerRenderer,state);
	}
	,resetHeaderRenderer: function(headerRenderer,state) {
		var recycler = this._defaultHeaderStorage.oldHeaderRendererRecycler != null ? this._defaultHeaderStorage.oldHeaderRendererRecycler : this._defaultHeaderStorage.headerRendererRecycler;
		if(recycler != null && recycler.reset != null) {
			recycler.reset(headerRenderer,state);
		}
		this.refreshHeaderRendererProperties(headerRenderer,feathers_controls_TreeGridView.RESET_HEADER_STATE);
	}
	,refreshHeaderRendererProperties: function(headerRenderer,state) {
		if(js_Boot.__implements(headerRenderer,feathers_core_IUIControl)) {
			var uiControl = headerRenderer;
			uiControl.set_enabled(state.enabled);
		}
		if(js_Boot.__implements(headerRenderer,feathers_controls_dataRenderers_ITreeGridViewHeaderRenderer)) {
			var header = headerRenderer;
			header.set_column(state.column);
			header.set_columnIndex(state.columnIndex);
			header.set_treeGridViewOwner(state.owner);
		}
		if(js_Boot.__implements(headerRenderer,feathers_layout_ILayoutIndexObject)) {
			var layoutObject = headerRenderer;
			layoutObject.set_layoutIndex(state.columnIndex);
		}
	}
	,displayIndexToLocation: function(displayIndex) {
		this._currentDisplayIndex = -1;
		return this.displayIndexToLocationAtBranch(displayIndex,[]);
	}
	,displayIndexToLocationAtBranch: function(target,locationOfBranch) {
		var _g = 0;
		var _g1 = this._dataProvider.getLength(locationOfBranch);
		while(_g < _g1) {
			var i = _g++;
			this._currentDisplayIndex++;
			locationOfBranch[locationOfBranch.length] = i;
			if(this._currentDisplayIndex == target) {
				return locationOfBranch;
			}
			var child = this._dataProvider.get(locationOfBranch);
			if(this._dataProvider.isBranch(child)) {
				if(this.openBranches.indexOf(child) != -1) {
					var result = this.displayIndexToLocationAtBranch(target,locationOfBranch);
					if(result != null) {
						return result;
					}
				}
			}
			locationOfBranch.length -= 1;
		}
		return null;
	}
	,locationToDisplayIndex: function(location,returnNearestIfBranchNotOpen) {
		this._currentDisplayIndex = -1;
		var nearestNotOpenBranch = null;
		if(returnNearestIfBranchNotOpen) {
			nearestNotOpenBranch = [];
		}
		return this.locationToDisplayIndexAtBranch([],location,nearestNotOpenBranch);
	}
	,locationToDisplayIndexAtBranch: function(locationOfBranch,locationToFind,nearestNotOpenBranch) {
		if(nearestNotOpenBranch != null) {
			nearestNotOpenBranch.push(locationToFind[locationOfBranch.length]);
		}
		var _g = 0;
		var _g1 = this._dataProvider.getLength(locationOfBranch);
		while(_g < _g1) {
			var i = _g++;
			this._currentDisplayIndex++;
			locationOfBranch[locationOfBranch.length] = i;
			if(this.compareLocations(locationOfBranch,locationToFind) == 0) {
				return this._currentDisplayIndex;
			}
			var child = this._dataProvider.get(locationOfBranch);
			if(this._dataProvider.isBranch(child)) {
				if(this.openBranches.indexOf(child) != -1) {
					var result = this.locationToDisplayIndexAtBranch(locationOfBranch,locationToFind,nearestNotOpenBranch);
					if(result != -1) {
						return result;
					}
				} else if(nearestNotOpenBranch != null && this.compareLocations(nearestNotOpenBranch,locationOfBranch) == 0) {
					return this._currentDisplayIndex;
				}
			}
			locationOfBranch.length -= 1;
		}
		if(nearestNotOpenBranch != null) {
			nearestNotOpenBranch.pop();
		}
		return -1;
	}
	,navigateWithKeyboard: function(event) {
		if(event.isDefaultPrevented()) {
			return;
		}
		if(this._rowLayoutItems.length == 0) {
			return;
		}
		var startIndex = this.locationToDisplayIndex(this._selectedLocation,false);
		var result = startIndex;
		if(js_Boot.__implements(this.get_layout(),feathers_layout_IKeyboardNavigationLayout)) {
			if(event.keyCode != 38 && event.keyCode != 40 && event.keyCode != 37 && event.keyCode != 39 && event.keyCode != 33 && event.keyCode != 34 && event.keyCode != 36 && event.keyCode != 35) {
				return;
			}
			result = this.get_layout().findNextKeyboardIndex(result,event,false,this._rowLayoutItems,null,this.treeGridViewPort.get_visibleWidth(),this.treeGridViewPort.get_visibleHeight());
		} else {
			switch(event.keyCode) {
			case 33:
				--result;
				break;
			case 34:
				++result;
				break;
			case 35:
				result = this._rowLayoutItems.length - 1;
				break;
			case 36:
				result = 0;
				break;
			case 37:
				--result;
				break;
			case 38:
				--result;
				break;
			case 39:
				++result;
				break;
			case 40:
				++result;
				break;
			default:
				return;
			}
		}
		if(result < 0) {
			result = 0;
		} else if(result >= this._rowLayoutItems.length) {
			result = this._rowLayoutItems.length - 1;
		}
		var changed = result != startIndex;
		var pendingLocation = null;
		if(!changed && result != -1) {
			pendingLocation = this.displayIndexToLocation(result);
			var _this = this.dataToRowRenderer;
			var key = this._dataProvider.get(pendingLocation);
			var itemRenderer = _this.h[key.__id__];
			if(itemRenderer == null) {
				changed = true;
			} else if(js_Boot.__implements(this.get_layout(),feathers_layout_IScrollLayout)) {
				var scrollLayout = this.get_layout();
				var nearestScrollPosition = scrollLayout.getNearestScrollPositionForIndex(result,this._rowLayoutItems.length,this.get_viewPort().get_visibleWidth(),this.get_viewPort().get_visibleHeight());
				if(this.get_scrollX() != nearestScrollPosition.x || this.get_scrollY() != nearestScrollPosition.y) {
					changed = true;
				}
			}
		}
		if(!changed) {
			return;
		}
		event.preventDefault();
		if(pendingLocation == null) {
			pendingLocation = this.displayIndexToLocation(result);
		}
		this.set_selectedLocation(pendingLocation);
		if(this._selectedLocation != null) {
			this.scrollToLocation(this._selectedLocation);
		}
		if(this._focusManager != null) {
			this._focusManager.set_focus(this);
		} else if(this.stage != null) {
			this.stage.set_focus(this);
		}
	}
	,handlePendingScroll: function() {
		if(this._pendingScrollLocation == null) {
			return;
		}
		var location = this._pendingScrollLocation;
		var duration = this._pendingScrollDuration != null ? this._pendingScrollDuration : 0.0;
		this._pendingScrollLocation = null;
		this._pendingScrollDuration = null;
		if(this._dataProvider == null || this._dataProvider.getLength() == 0) {
			return;
		}
		var targetX = this.get_scrollX();
		var targetY = this.get_scrollY();
		if(js_Boot.__implements(this.get_layout(),feathers_layout_IScrollLayout)) {
			var displayIndex = this.locationToDisplayIndex(location,true);
			var scrollLayout = this.get_layout();
			var result = scrollLayout.getNearestScrollPositionForIndex(displayIndex,this._rowLayoutItems.length,this.get_viewPort().get_visibleWidth(),this.get_viewPort().get_visibleHeight());
			targetX = result.x;
			targetY = result.y;
		} else {
			var item = this._dataProvider.get(location);
			var rowRenderer = this.dataToRowRenderer.h[item.__id__];
			if(rowRenderer == null) {
				return;
			}
			var maxX = rowRenderer.get_x();
			var minX = maxX + rowRenderer.get_width() - this.get_viewPort().get_visibleWidth();
			if(targetX < minX) {
				targetX = minX;
			} else if(targetX > maxX) {
				targetX = maxX;
			}
			var maxY = rowRenderer.get_y();
			var minY = maxY + rowRenderer.get_height() - this.get_viewPort().get_visibleHeight();
			if(targetY < minY) {
				targetY = minY;
			} else if(targetY > maxY) {
				targetY = maxY;
			}
		}
		if(duration == 0.0) {
			this.scroller.stop();
			this.scroller.set_scrollX(targetX);
			this.scroller.set_scrollY(targetY);
		} else {
			this.scroller.throwTo(targetX,targetY,duration);
		}
	}
	,toggleBranchInternal: function(branch,location,layoutIndex,open) {
		var rowRenderer = this.dataToRowRenderer.h[branch.__id__];
		var state = null;
		if(rowRenderer != null) {
			state = this.rowRendererToRowState.h[rowRenderer.__id__];
		}
		var isTemporary = false;
		if(state == null) {
			isTemporary = true;
			state = this.rowStatePool.get();
		}
		state.rowLocation = location;
		state.layoutIndex = layoutIndex;
		var alreadyOpen = this.openBranches.indexOf(branch) != -1;
		if(open && !alreadyOpen) {
			this.openBranches.push(branch);
			this.populateCurrentRowState(branch,location,layoutIndex,state,true);
			layoutIndex = this.insertChildrenIntoVirtualCache(location,layoutIndex);
			if(rowRenderer != null) {
				this.updateRowRenderer(rowRenderer,state);
			}
			var cellState = new feathers_data_TreeGridViewCellState();
			this.populateCurrentRowCellState(branch,location,null,-1,layoutIndex,cellState,true);
			feathers_events_TreeGridViewEvent.dispatchForCell(this,"branchOpen",cellState);
		} else if(!open && alreadyOpen) {
			HxOverrides.remove(this.openBranches,branch);
			this.populateCurrentRowState(branch,location,layoutIndex,state,true);
			this.removeChildrenFromVirtualCache(location,layoutIndex);
			if(rowRenderer != null) {
				this.updateRowRenderer(rowRenderer,state);
			}
			var cellState = new feathers_data_TreeGridViewCellState();
			this.populateCurrentRowCellState(branch,location,null,-1,layoutIndex,cellState,true);
			feathers_events_TreeGridViewEvent.dispatchForCell(this,"branchClose",cellState);
		}
		if(isTemporary) {
			this.rowStatePool.release(state);
		}
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		return layoutIndex;
	}
	,toggleChildrenOfInternal: function(branch,location,layoutIndex,open) {
		layoutIndex = this.toggleBranchInternal(branch,location,layoutIndex,open);
		var itemCount = this._dataProvider.getLength(location);
		var _g = 0;
		var _g1 = itemCount;
		while(_g < _g1) {
			var i = _g++;
			location.push(i);
			var child = this._dataProvider.get(location);
			if(this._dataProvider.isBranch(child)) {
				this.toggleChildrenOfInternal(child,location,layoutIndex,open);
			}
			location.pop();
		}
	}
	,refreshOpenBranchesFromDataProviderChange: function(removedItem,addedItem) {
		if(removedItem == null) {
			return;
		}
		var i = this.openBranches.length - 1;
		while(i >= 0) {
			var openBranch = this.openBranches[i];
			if(openBranch == removedItem) {
				if(removedItem != addedItem) {
					this.openBranches.splice(i,1);
				}
				continue;
			}
			var location = this._dataProvider.locationOf(openBranch);
			if(location == null) {
				this.openBranches.splice(i,1);
			}
			--i;
		}
	}
	,baseScrollContainer_keyDownHandler: function(event) {
		if(!this._selectable) {
			feathers_controls_supportClasses_BaseScrollContainer.prototype.baseScrollContainer_keyDownHandler.call(this,event);
			return;
		}
		if(!this._enabled || event.isDefaultPrevented()) {
			return;
		}
		if(this.stage != null && ((this.stage.get_focus()) instanceof openfl_text_TextField)) {
			var textField = this.stage.get_focus();
			if(textField.get_type() == 1) {
				return;
			}
		}
		this.navigateWithKeyboard(event);
	}
	,treeGridView_rowRenderer_triggerHandler: function(event) {
		if(!this._selectable) {
			return;
		}
		var rowRenderer = js_Boot.__cast(event.currentTarget , feathers_controls_dataRenderers_TreeGridViewRowRenderer);
		var state = this.rowRendererToRowState.h[rowRenderer.__id__];
		this.set_selectedLocation(state.rowLocation.slice());
		if(this._selectedLocation != null) {
			this.scrollToLocation(this._selectedLocation);
		}
	}
	,treeGridView_rowRenderer_cellTriggerHandler: function(event) {
		this.dispatchEvent(event.clone());
	}
	,treeGridView_rowRenderer_openHandler: function(event) {
		if(this._ignoreOpenedChange) {
			return;
		}
		var rowRenderer = js_Boot.__cast(event.currentTarget , feathers_controls_dataRenderers_TreeGridViewRowRenderer);
		var state = this.rowRendererToRowState.h[rowRenderer.__id__];
		this.toggleBranch(state.data,true);
	}
	,treeGridView_rowRenderer_closeHandler: function(event) {
		if(this._ignoreOpenedChange) {
			return;
		}
		var rowRenderer = js_Boot.__cast(event.currentTarget , feathers_controls_dataRenderers_TreeGridViewRowRenderer);
		var state = this.rowRendererToRowState.h[rowRenderer.__id__];
		this.toggleBranch(state.data,false);
	}
	,treeGridView_dataProvider_changeHandler: function(event) {
		this._totalRowLayoutCount = this.calculateTotalLayoutCount([]);
		if(this._virtualCache != null) {
			this._virtualCache.length = 0;
			this._virtualCache.length = this._totalRowLayoutCount;
		}
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
	}
	,treeGridView_dataProvider_addItemHandler: function(event) {
		if(this._selectedLocation == null) {
			return;
		}
		if(this.compareLocations(this._selectedLocation,event.location) >= 0) {
			this.set_selectedLocation(this._dataProvider.locationOf(this._selectedItem));
		}
	}
	,treeGridView_dataProvider_removeItemHandler: function(event) {
		this.refreshOpenBranchesFromDataProviderChange(event.removedItem,event.addedItem);
		if(this._selectedLocation != null) {
			if(this.containsLocation(event.location,this._selectedLocation)) {
				this.set_selectedLocation(null);
			} else {
				var comparisonResult = this.compareLocations(this._selectedLocation,event.location);
				if(comparisonResult == 0) {
					this.set_selectedLocation(null);
				} else if(comparisonResult > 0) {
					this.set_selectedLocation(this._dataProvider.locationOf(this._selectedItem));
				}
			}
		}
	}
	,treeGridView_dataProvider_replaceItemHandler: function(event) {
		this.refreshOpenBranchesFromDataProviderChange(event.removedItem,event.addedItem);
		if(this._selectedLocation != null) {
			if(this.containsLocation(event.location,this._selectedLocation)) {
				this.set_selectedLocation(null);
			} else if(this.compareLocations(this._selectedLocation,event.location) == 0) {
				this._selectedItem = this._dataProvider.get(event.location);
				feathers_events_FeathersEvent.dispatch(this,"change");
			}
		}
	}
	,treeGridView_dataProvider_removeAllHandler: function(event) {
		this.openBranches.length = 0;
		this.set_selectedLocation(null);
	}
	,treeGridView_dataProvider_resetHandler: function(event) {
		this.openBranches.length = 0;
		this.set_selectedLocation(null);
	}
	,treeGridView_dataProvider_sortChangeHandler: function(event) {
		this.refreshSelectedLocationAfterFilterOrSort();
	}
	,treeGridView_dataProvider_filterChangeHandler: function(event) {
		this.refreshSelectedLocationAfterFilterOrSort();
	}
	,updateRowRendererForLocation: function(location) {
		var layoutIndex = this.locationToDisplayIndex(location,false);
		if(this._virtualCache != null && layoutIndex != -1) {
			this._virtualCache[layoutIndex] = null;
		}
		var item = this._dataProvider.get(location);
		var rowRenderer = this.dataToRowRenderer.h[item.__id__];
		if(rowRenderer == null) {
			this.setInvalid(feathers_core_InvalidationFlag.DATA);
			return;
		}
		var state = this.rowRendererToRowState.h[rowRenderer.__id__];
		if(state.owner == null) {
			return;
		}
		rowRenderer.updateCells();
		this.populateCurrentRowState(item,location,layoutIndex,state,true);
		this.resetRowRenderer(rowRenderer,state);
		if(this._rowRendererMeasurements != null) {
			this._rowRendererMeasurements.restore(rowRenderer);
		}
		state.owner = null;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
	}
	,validateCustomColumnWidths: function() {
		if(this._customColumnWidths == null || this._customColumnWidths.length < this._columns.get_length()) {
			return;
		}
		if(this._customColumnWidths.length > this._columns.get_length()) {
			this._customColumnWidths.length = this._columns.get_length();
		}
		var minContainerWidth = this.actualWidth - this.get_paddingLeft() - this.get_paddingRight();
		var totalContainerWidth = Math.max(this._viewPort.get_width() + this._headerContainerLayout.get_paddingLeft() + this._headerContainerLayout.get_paddingRight(),minContainerWidth);
		var availableWidth = totalContainerWidth - this._headerContainerLayout.get_paddingLeft() - this._headerContainerLayout.get_paddingRight();
		var totalWidth = 0.0;
		var indices = [];
		var _g = 0;
		var _g1 = this._customColumnWidths.length;
		while(_g < _g1) {
			var i = _g++;
			var column = this._columns.get(i);
			if(column.width != null) {
				availableWidth -= column.width;
				continue;
			}
			var size = this._customColumnWidths[i];
			totalWidth += size;
			indices.push(i);
		}
		if(totalWidth == availableWidth) {
			return;
		}
		this._customColumnWidths = this._customColumnWidths.slice();
		var widthToDistribute = availableWidth - totalWidth;
		this.distributeWidthToIndices(widthToDistribute,indices,totalWidth);
		this.setInvalid(feathers_core_InvalidationFlag.LAYOUT);
	}
	,calculateResizedColumnWidth: function(offset) {
		var columnCount = this._columns.get_length();
		if(this._customColumnWidths == null) {
			this._customColumnWidths = [];
			this._customColumnWidths.length = columnCount;
		} else {
			this._customColumnWidths = this._customColumnWidths.slice();
			this._customColumnWidths.length = columnCount;
		}
		var column = this._columns.get(this._resizingHeaderIndex);
		column.width = null;
		var headerRenderer = this.dataToHeaderRenderer.h[column.__id__];
		var column = this._columns.get(this._resizingHeaderIndex);
		var minX = this._headerContainer.get_x() + headerRenderer.get_x() + column.minWidth;
		var maxX = this.actualWidth - this.rightViewPortOffset;
		var originalX = this._headerContainer.get_x() + headerRenderer.get_x() + headerRenderer.get_width();
		var newX = Math.min(Math.max(originalX + offset,minX),maxX);
		var preferredWidth = newX - headerRenderer.get_x() - this._headerContainer.get_x();
		var totalMinWidth = 0.0;
		var originalWidth = headerRenderer.get_width();
		var totalWidthAfter = 0.0;
		var indicesAfter = [];
		var _g = 0;
		var _g1 = columnCount;
		while(_g < _g1) {
			var i = _g++;
			var currentColumn = this._columns.get(i);
			if(i == this._resizingHeaderIndex) {
				continue;
			} else if(i < this._resizingHeaderIndex) {
				headerRenderer = this.dataToHeaderRenderer.h[currentColumn.__id__];
				this._customColumnWidths[i] = headerRenderer.get_width();
				totalMinWidth += headerRenderer.get_width();
			} else {
				if(currentColumn.width != null) {
					totalMinWidth += currentColumn.width;
					continue;
				}
				totalMinWidth += currentColumn.minWidth;
				headerRenderer = this.dataToHeaderRenderer.h[currentColumn.__id__];
				var columnWidth = headerRenderer.get_width();
				totalWidthAfter += columnWidth;
				this._customColumnWidths[i] = columnWidth;
				indicesAfter[indicesAfter.length] = i;
			}
		}
		if(indicesAfter.length == 0) {
			var index = this._resizingHeaderIndex + 1;
			indicesAfter[0] = index;
			column = this._columns.get(index);
			totalWidthAfter = column.width;
			totalMinWidth -= totalWidthAfter;
			totalMinWidth += column.minWidth;
			this._customColumnWidths[index] = totalWidthAfter;
			column.width = null;
		}
		var newWidth = preferredWidth;
		var maxWidth = this._headerContainer.get_width() - totalMinWidth;
		if(newWidth > maxWidth) {
			newWidth = maxWidth;
		}
		if(newWidth < column.minWidth) {
			newWidth = column.minWidth;
		}
		this._customColumnWidths[this._resizingHeaderIndex] = newWidth;
		var widthToDistribute = originalWidth - newWidth;
		this.distributeWidthToIndices(widthToDistribute,indicesAfter,totalWidthAfter);
		this.setInvalid(feathers_core_InvalidationFlag.LAYOUT);
	}
	,distributeWidthToIndices: function(widthToDistribute,indices,totalWidthOfIndices) {
		while(Math.abs(widthToDistribute) > 1.0) {
			var nextWidthToDistribute = widthToDistribute;
			var i = indices.length - 1;
			while(i >= 0) {
				var index = indices[i];
				var column = this._columns.get(index);
				var headerRenderer = this.dataToHeaderRenderer.h[column.__id__];
				var columnWidth = headerRenderer.get_width();
				var percent = columnWidth / totalWidthOfIndices;
				var offset = widthToDistribute * percent;
				var newWidth = this._customColumnWidths[index] + offset;
				if(newWidth < column.minWidth) {
					offset += column.minWidth - newWidth;
					newWidth = column.minWidth;
					indices.splice(i,1);
					totalWidthOfIndices -= columnWidth;
				}
				this._customColumnWidths[index] = newWidth;
				nextWidthToDistribute -= offset;
				--i;
			}
			widthToDistribute = nextWidthToDistribute;
		}
		if(widthToDistribute != 0.0) {
			this._customColumnWidths[this._customColumnWidths.length - 1] += widthToDistribute;
		}
	}
	,layoutColumnResizeSkin: function(offset) {
		if(this._currentColumnResizeSkin == null) {
			return;
		}
		var column = this._columns.get(this._resizingHeaderIndex);
		var headerRenderer = this.dataToHeaderRenderer.h[column.__id__];
		var minX = this._headerContainer.get_x() + headerRenderer.get_x() + column.minWidth;
		var maxX = this.actualWidth - this.rightViewPortOffset;
		var originalX = this._headerContainer.get_x() + headerRenderer.get_x() + headerRenderer.get_width();
		var newX = Math.min(Math.max(originalX + offset,minX),maxX) - this._currentColumnResizeSkin.get_width() / 2.0;
		this._currentColumnResizeSkin.set_visible(true);
		this._currentColumnResizeSkin.set_x(newX);
		this._currentColumnResizeSkin.set_y(this.get_paddingTop());
		this._currentColumnResizeSkin.set_height(this.actualHeight - this.get_paddingTop() - this.bottomViewPortOffset);
		this.setChildIndex(this._currentColumnResizeSkin,this.get_numChildren() - 1);
	}
	,headerResizeTouchBegin: function(touchPointID,isMouse,divider,stageX) {
		if(!this._enabled || !this._resizableColumns || this._resizingHeaderIndex != -1 || this.stage == null) {
			return;
		}
		var exclusivePointer = feathers_utils_ExclusivePointer.forStage(this.stage);
		var result = false;
		if(isMouse) {
			result = exclusivePointer.claimMouse(divider);
		} else {
			result = exclusivePointer.claimTouch(touchPointID,divider);
		}
		if(!result) {
			return;
		}
		this._resizingHeaderTouchPointID = touchPointID;
		this._resizingHeaderTouchPointIsMouse = isMouse;
		this._resizingHeaderIndex = this._headerDividerLayoutItems.indexOf(divider);
		this._resizingHeaderStartStageX = stageX;
		this.layoutColumnResizeSkin(0.0);
		if(isMouse) {
			this.stage.addEventListener("mouseMove",$bind(this,this.treeGridView_headerDivider_stage_mouseMoveHandler),false,0,true);
			this.stage.addEventListener("mouseUp",$bind(this,this.treeGridView_headerDivider_stage_mouseUpHandler),false,0,true);
		} else {
			this.stage.addEventListener("touchMove",$bind(this,this.treeGridView_headerDivider_stage_touchMoveHandler),false,0,true);
			this.stage.addEventListener("touchEnd",$bind(this,this.treeGridView_headerDivider_stage_touchEndHandler),false,0,true);
		}
	}
	,headerResizeTouchMove: function(touchPointID,isMouse,stageX) {
		if(this._resizingHeaderTouchPointID == null || this._resizingHeaderTouchPointID != touchPointID || this._resizingHeaderTouchPointIsMouse != isMouse) {
			return;
		}
		var offset = stageX - this._resizingHeaderStartStageX;
		offset *= feathers_utils_DisplayUtil.getConcatenatedScaleX(this);
		this.layoutColumnResizeSkin(offset);
	}
	,headerResizeTouchEnd: function(touchPointID,isMouse,stageX) {
		if(this._resizingHeaderTouchPointID == null || this._resizingHeaderTouchPointID != touchPointID || this._resizingHeaderTouchPointIsMouse != isMouse) {
			return;
		}
		if(isMouse) {
			this.stage.removeEventListener("mouseMove",$bind(this,this.treeGridView_headerDivider_stage_mouseMoveHandler));
			this.stage.removeEventListener("mouseUp",$bind(this,this.treeGridView_headerDivider_stage_mouseUpHandler));
		} else {
			this.stage.removeEventListener("touchMove",$bind(this,this.treeGridView_headerDivider_stage_touchMoveHandler));
			this.stage.removeEventListener("touchEnd",$bind(this,this.treeGridView_headerDivider_stage_touchEndHandler));
		}
		if(this._currentColumnResizeSkin != null) {
			this._currentColumnResizeSkin.set_visible(false);
		}
		var offset = stageX - this._resizingHeaderStartStageX;
		offset *= feathers_utils_DisplayUtil.getConcatenatedScaleX(this);
		this.calculateResizedColumnWidth(offset);
		this._resizingHeaderTouchPointID = null;
		this._resizingHeaderTouchPointIsMouse = false;
		this._resizingHeaderIndex = -1;
		if(this._oldHeaderDividerMouseCursor != null) {
			openfl_ui_Mouse.set_cursor(this._oldHeaderDividerMouseCursor);
			this._oldHeaderDividerMouseCursor = null;
		}
	}
	,refreshSelectedLocationAfterFilterOrSort: function() {
		if(this._selectedLocation == null) {
			return;
		}
		this.set_selectedLocation(this._dataProvider.locationOf(this._selectedItem));
	}
	,calculateTotalLayoutCount: function(location) {
		if(this._dataProvider == null) {
			return 0;
		}
		var itemCount = this._dataProvider.getLength(location);
		var result = itemCount;
		var _g = 0;
		var _g1 = itemCount;
		while(_g < _g1) {
			var i = _g++;
			location.push(i);
			var item = this._dataProvider.get(location);
			if(this._dataProvider.isBranch(item) && this.openBranches.indexOf(item) != -1) {
				result += this.calculateTotalLayoutCount(location);
			}
			location.pop();
		}
		return result;
	}
	,insertChildrenIntoVirtualCache: function(location,layoutIndex) {
		var length = this._dataProvider.getLength(location);
		var _g = 0;
		var _g1 = length;
		while(_g < _g1) {
			var i = _g++;
			location.push(i);
			++layoutIndex;
			this._virtualCache.splice(layoutIndex,0,null);
			var item = this._dataProvider.get(location);
			if(this._dataProvider.isBranch(item) && this.openBranches.indexOf(item) != -1) {
				layoutIndex = this.insertChildrenIntoVirtualCache(location,layoutIndex);
			}
			location.pop();
		}
		return layoutIndex;
	}
	,removeChildrenFromVirtualCache: function(location,layoutIndex) {
		var length = this._dataProvider.getLength(location);
		++layoutIndex;
		var _g = 0;
		var _g1 = length;
		while(_g < _g1) {
			var i = _g++;
			location.push(i);
			var item = this._dataProvider.get(location);
			if(this._dataProvider.isBranch(item) && this.openBranches.indexOf(item) != -1) {
				this.removeChildrenFromVirtualCache(location,layoutIndex);
			}
			this._virtualCache.splice(layoutIndex,1);
			location.pop();
		}
	}
	,containsLocation: function(parent,possibleChild) {
		if(parent == null || possibleChild == null || parent.length >= possibleChild.length) {
			return false;
		}
		var _g = 0;
		var _g1 = parent.length;
		while(_g < _g1) {
			var i = _g++;
			var a = parent[i];
			var b = possibleChild[i];
			if(a != b) {
				return false;
			}
		}
		return true;
	}
	,compareLocations: function(location1,location2) {
		var null1 = location1 == null;
		var null2 = location2 == null;
		if(null1 && null2) {
			return 0;
		} else if(null1) {
			return 1;
		} else if(null2) {
			return -1;
		}
		var length1 = location1.length;
		var length2 = location2.length;
		var min = length1;
		if(length2 < min) {
			min = length2;
		}
		var _g = 0;
		var _g1 = min;
		while(_g < _g1) {
			var i = _g++;
			var index1 = location1[i];
			var index2 = location2[i];
			if(index1 < index2) {
				return -1;
			}
			if(index1 > index2) {
				return 1;
			}
		}
		if(length1 < length2) {
			return -1;
		} else if(length1 > length2) {
			return 1;
		}
		return 0;
	}
	,treeGridView_dataProvider_updateItemHandler: function(event) {
		this.updateRowRendererForLocation(event.location);
	}
	,treeGridView_dataProvider_updateAllHandler: function(event) {
		var location = [];
		var _g = 0;
		var _g1 = this._dataProvider.getLength();
		while(_g < _g1) {
			var i = _g++;
			location[0] = i;
			this.updateRowRendererForLocation(location);
		}
	}
	,treeGridView_columns_addItemHandler: function(event) {
		if(this._customColumnWidths == null) {
			return;
		}
		var column = js_Boot.__cast(event.addedItem , feathers_controls_TreeGridViewColumn);
		var columnIndex = event.index;
		if(column.width != null || columnIndex > this._customColumnWidths.length) {
			return;
		}
		this._customColumnWidths.splice(columnIndex,0,0.0);
		var minContainerWidth = this.actualWidth - this.get_paddingLeft() - this.get_paddingRight();
		var totalContainerWidth = Math.max(this._viewPort.get_width() + this._headerContainerLayout.get_paddingLeft() + this._headerContainerLayout.get_paddingRight(),minContainerWidth);
		var availableWidth = totalContainerWidth - this._headerContainerLayout.get_paddingLeft() - this._headerContainerLayout.get_paddingRight();
		var totalWidth = 0.0;
		var indices = [];
		var _g = 0;
		var _g1 = this._customColumnWidths.length;
		while(_g < _g1) {
			var i = _g++;
			if(i == columnIndex) {
				continue;
			}
			var column = this._columns.get(i);
			if(column.width != null) {
				availableWidth -= column.width;
				continue;
			}
			var size = this._customColumnWidths[i];
			totalWidth += size;
			indices.push(i);
		}
		var idealColumnWidth = totalWidth / (indices.length + 1);
		this._customColumnWidths[columnIndex] = idealColumnWidth;
		this._customColumnWidths = this._customColumnWidths.slice();
		var widthToDistribute = -idealColumnWidth;
		this.distributeWidthToIndices(widthToDistribute,indices,totalWidth);
		this.setInvalid(feathers_core_InvalidationFlag.LAYOUT);
	}
	,treeGridView_columns_removeItemHandler: function(event) {
		if(this._customColumnWidths == null) {
			return;
		}
		var column = js_Boot.__cast(event.removedItem , feathers_controls_TreeGridViewColumn);
		var columnIndex = event.index;
		if(column.width != null || columnIndex > this._customColumnWidths.length) {
			return;
		}
		this._customColumnWidths.splice(columnIndex,1);
		this.setInvalid(feathers_core_InvalidationFlag.LAYOUT);
	}
	,treeGridView_columns_changeHandler: function(event) {
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
	}
	,treeGridView_headerRenderer_touchTapHandler: function(event) {
		if(!this._enabled) {
			return;
		}
		if(event.isPrimaryTouchPoint) {
			return;
		}
		var headerRenderer = js_Boot.__cast(event.currentTarget , openfl_display_DisplayObject);
		var state = this.headerRendererToHeaderState.h[headerRenderer.__id__];
		feathers_events_TreeGridViewEvent.dispatchForHeader(this,"headerTrigger",state);
	}
	,treeGridView_headerRenderer_clickHandler: function(event) {
		if(!this._enabled) {
			return;
		}
		var headerRenderer = js_Boot.__cast(event.currentTarget , openfl_display_DisplayObject);
		var state = this.headerRendererToHeaderState.h[headerRenderer.__id__];
		feathers_events_TreeGridViewEvent.dispatchForHeader(this,"headerTrigger",state);
	}
	,treeGridView_headerRenderer_triggerHandler: function(event) {
		if(!this._enabled) {
			return;
		}
		var headerRenderer = js_Boot.__cast(event.currentTarget , openfl_display_DisplayObject);
		var state = this.headerRendererToHeaderState.h[headerRenderer.__id__];
		feathers_events_TreeGridViewEvent.dispatchForHeader(this,"headerTrigger",state);
	}
	,treeGridView_headerRenderer_resizeHandler: function(event) {
		if(this._validating) {
			return;
		}
		this.setInvalid(feathers_core_InvalidationFlag.LAYOUT);
	}
	,treeGridView_headerDivider_mouseDownHandler: function(event) {
		var headerDivider = js_Boot.__cast(event.currentTarget , openfl_display_InteractiveObject);
		this.headerResizeTouchBegin(feathers_controls_TreeGridView.POINTER_ID_MOUSE,true,headerDivider,headerDivider.stage.get_mouseX());
	}
	,treeGridView_headerDivider_stage_mouseMoveHandler: function(event) {
		var stage = js_Boot.__cast(event.currentTarget , openfl_display_Stage);
		this.headerResizeTouchMove(feathers_controls_TreeGridView.POINTER_ID_MOUSE,true,stage.get_mouseX());
	}
	,treeGridView_headerDivider_stage_mouseUpHandler: function(event) {
		var stage = js_Boot.__cast(event.currentTarget , openfl_display_Stage);
		this.headerResizeTouchEnd(feathers_controls_TreeGridView.POINTER_ID_MOUSE,true,stage.get_mouseX());
	}
	,treeGridView_headerDivider_touchBeginHandler: function(event) {
		if(event.isPrimaryTouchPoint) {
			return;
		}
		var headerDivider = js_Boot.__cast(event.currentTarget , openfl_display_InteractiveObject);
		this.headerResizeTouchBegin(event.touchPointID,false,headerDivider,headerDivider.stage.get_mouseX());
	}
	,treeGridView_headerDivider_stage_touchMoveHandler: function(event) {
		var stage = js_Boot.__cast(event.currentTarget , openfl_display_Stage);
		this.headerResizeTouchMove(event.touchPointID,false,stage.get_mouseX());
	}
	,treeGridView_headerDivider_stage_touchEndHandler: function(event) {
		var stage = js_Boot.__cast(event.currentTarget , openfl_display_Stage);
		this.headerResizeTouchEnd(event.touchPointID,false,stage.get_mouseX());
	}
	,treeGridView_headerDivider_rollOverHandler: function(event) {
		if(!this._resizableColumns || this._resizingHeaderIndex != -1 || openfl_ui_Mouse.get_cursor() != "auto") {
			return;
		}
		this._oldHeaderDividerMouseCursor = openfl_ui_Mouse.get_cursor();
		openfl_ui_Mouse.set_cursor(openfl_ui_MouseCursor.fromLimeCursor(lime_ui_MouseCursor.RESIZE_WE));
	}
	,treeGridView_headerDivider_rollOutHandler: function(event) {
		if(!this._resizableColumns || this._resizingHeaderIndex != -1 || this._oldHeaderDividerMouseCursor == null) {
			return;
		}
		openfl_ui_Mouse.set_cursor(this._oldHeaderDividerMouseCursor);
		this._oldHeaderDividerMouseCursor = null;
	}
	,get_styleContext: function() {
		return feathers_controls_TreeGridView;
	}
	,__customCellRendererVariant: null
	,get_customCellRendererVariant: function() {
		return this.__customCellRendererVariant;
	}
	,set_customCellRendererVariant: function(value) {
		if(!this.setStyle("customCellRendererVariant")) {
			return this.__customCellRendererVariant;
		}
		if(this.__customCellRendererVariant == value) {
			return this.__customCellRendererVariant;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_customCellRendererVariant);
		this.__customCellRendererVariant = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__customCellRendererVariant;
	}
	,clearStyle_customCellRendererVariant: function() {
		this.set_customCellRendererVariant(null);
		return this.get_customCellRendererVariant();
	}
	,__customHeaderRendererVariant: null
	,get_customHeaderRendererVariant: function() {
		return this.__customHeaderRendererVariant;
	}
	,set_customHeaderRendererVariant: function(value) {
		if(!this.setStyle("customHeaderRendererVariant")) {
			return this.__customHeaderRendererVariant;
		}
		if(this.__customHeaderRendererVariant == value) {
			return this.__customHeaderRendererVariant;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_customHeaderRendererVariant);
		this.__customHeaderRendererVariant = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__customHeaderRendererVariant;
	}
	,clearStyle_customHeaderRendererVariant: function() {
		this.set_customHeaderRendererVariant(null);
		return this.get_customHeaderRendererVariant();
	}
	,__headerDividerFactory: null
	,get_headerDividerFactory: function() {
		return this.__headerDividerFactory;
	}
	,set_headerDividerFactory: function(value) {
		if(!this.setStyle("headerDividerFactory")) {
			return this.__headerDividerFactory;
		}
		if(this.__headerDividerFactory == value) {
			return this.__headerDividerFactory;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_headerDividerFactory);
		this.__headerDividerFactory = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__headerDividerFactory;
	}
	,clearStyle_headerDividerFactory: function() {
		this.set_headerDividerFactory(feathers_utils_DisplayObjectFactory.withClass(feathers_controls_Button));
		return this.get_headerDividerFactory();
	}
	,__customHeaderDividerVariant: null
	,get_customHeaderDividerVariant: function() {
		return this.__customHeaderDividerVariant;
	}
	,set_customHeaderDividerVariant: function(value) {
		if(!this.setStyle("customHeaderDividerVariant")) {
			return this.__customHeaderDividerVariant;
		}
		if(this.__customHeaderDividerVariant == value) {
			return this.__customHeaderDividerVariant;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_customHeaderDividerVariant);
		this.__customHeaderDividerVariant = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__customHeaderDividerVariant;
	}
	,clearStyle_customHeaderDividerVariant: function() {
		this.set_customHeaderDividerVariant(null);
		return this.get_customHeaderDividerVariant();
	}
	,__columnDividerFactory: null
	,get_columnDividerFactory: function() {
		return this.__columnDividerFactory;
	}
	,set_columnDividerFactory: function(value) {
		if(!this.setStyle("columnDividerFactory")) {
			return this.__columnDividerFactory;
		}
		if(this.__columnDividerFactory == value) {
			return this.__columnDividerFactory;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_columnDividerFactory);
		this.__columnDividerFactory = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__columnDividerFactory;
	}
	,clearStyle_columnDividerFactory: function() {
		this.set_columnDividerFactory(null);
		return this.get_columnDividerFactory();
	}
	,__customColumnDividerVariant: null
	,get_customColumnDividerVariant: function() {
		return this.__customColumnDividerVariant;
	}
	,set_customColumnDividerVariant: function(value) {
		if(!this.setStyle("customColumnDividerVariant")) {
			return this.__customColumnDividerVariant;
		}
		if(this.__customColumnDividerVariant == value) {
			return this.__customColumnDividerVariant;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_customColumnDividerVariant);
		this.__customColumnDividerVariant = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__customColumnDividerVariant;
	}
	,clearStyle_customColumnDividerVariant: function() {
		this.set_customColumnDividerVariant(null);
		return this.get_customColumnDividerVariant();
	}
	,__layout: null
	,get_layout: function() {
		return this.__layout;
	}
	,set_layout: function(value) {
		if(!this.setStyle("layout")) {
			return this.__layout;
		}
		if(this.__layout == value) {
			return this.__layout;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_layout);
		this.__layout = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__layout;
	}
	,clearStyle_layout: function() {
		this.set_layout(null);
		return this.get_layout();
	}
	,__columnResizeSkin: null
	,get_columnResizeSkin: function() {
		return this.__columnResizeSkin;
	}
	,set_columnResizeSkin: function(value) {
		if(!this.setStyle("columnResizeSkin")) {
			return this.__columnResizeSkin;
		}
		if(this.__columnResizeSkin == value) {
			return this.__columnResizeSkin;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_columnResizeSkin);
		this.__columnResizeSkin = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__columnResizeSkin;
	}
	,clearStyle_columnResizeSkin: function() {
		this.set_columnResizeSkin(null);
		return this.get_columnResizeSkin();
	}
	,__headerCornerSkin: null
	,get_headerCornerSkin: function() {
		return this.__headerCornerSkin;
	}
	,set_headerCornerSkin: function(value) {
		if(!this.setStyle("headerCornerSkin")) {
			return this.__headerCornerSkin;
		}
		if(this.__headerCornerSkin == value) {
			return this.__headerCornerSkin;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_headerCornerSkin);
		this.__headerCornerSkin = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__headerCornerSkin;
	}
	,clearStyle_headerCornerSkin: function() {
		this.set_headerCornerSkin(null);
		return this.get_headerCornerSkin();
	}
	,__extendedScrollBarY: null
	,get_extendedScrollBarY: function() {
		return this.__extendedScrollBarY;
	}
	,set_extendedScrollBarY: function(value) {
		if(!this.setStyle("extendedScrollBarY")) {
			return this.__extendedScrollBarY;
		}
		if(this.__extendedScrollBarY == value) {
			return this.__extendedScrollBarY;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_extendedScrollBarY);
		this.__extendedScrollBarY = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__extendedScrollBarY;
	}
	,clearStyle_extendedScrollBarY: function() {
		this.set_extendedScrollBarY(false);
		return this.get_extendedScrollBarY();
	}
	,__showHeaderDividersOnlyWhenResizable: null
	,get_showHeaderDividersOnlyWhenResizable: function() {
		return this.__showHeaderDividersOnlyWhenResizable;
	}
	,set_showHeaderDividersOnlyWhenResizable: function(value) {
		if(!this.setStyle("showHeaderDividersOnlyWhenResizable")) {
			return this.__showHeaderDividersOnlyWhenResizable;
		}
		if(this.__showHeaderDividersOnlyWhenResizable == value) {
			return this.__showHeaderDividersOnlyWhenResizable;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_showHeaderDividersOnlyWhenResizable);
		this.__showHeaderDividersOnlyWhenResizable = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__showHeaderDividersOnlyWhenResizable;
	}
	,clearStyle_showHeaderDividersOnlyWhenResizable: function() {
		this.set_showHeaderDividersOnlyWhenResizable(false);
		return this.get_showHeaderDividersOnlyWhenResizable();
	}
	,__class__: feathers_controls_TreeGridView
	,__properties__: $extend(feathers_controls_supportClasses_BaseScrollContainer.prototype.__properties__,{set_showHeaderDividersOnlyWhenResizable:"set_showHeaderDividersOnlyWhenResizable",get_showHeaderDividersOnlyWhenResizable:"get_showHeaderDividersOnlyWhenResizable",set_extendedScrollBarY:"set_extendedScrollBarY",get_extendedScrollBarY:"get_extendedScrollBarY",set_selectable:"set_selectable",get_selectable:"get_selectable",set_headerCornerSkin:"set_headerCornerSkin",get_headerCornerSkin:"get_headerCornerSkin",set_columnResizeSkin:"set_columnResizeSkin",get_columnResizeSkin:"get_columnResizeSkin",set_resizableColumns:"set_resizableColumns",get_resizableColumns:"get_resizableColumns",set_cellRendererRecycler:"set_cellRendererRecycler",get_cellRendererRecycler:"get_cellRendererRecycler",set_virtualLayout:"set_virtualLayout",get_virtualLayout:"get_virtualLayout",set_layout:"set_layout",get_layout:"get_layout",set_selectedItem:"set_selectedItem",get_selectedItem:"get_selectedItem",set_selectedLocation:"set_selectedLocation",get_selectedLocation:"get_selectedLocation",set_forceItemStateUpdate:"set_forceItemStateUpdate",get_forceItemStateUpdate:"get_forceItemStateUpdate",set_customColumnDividerVariant:"set_customColumnDividerVariant",get_customColumnDividerVariant:"get_customColumnDividerVariant",set_columnDividerFactory:"set_columnDividerFactory",get_columnDividerFactory:"get_columnDividerFactory",set_customHeaderDividerVariant:"set_customHeaderDividerVariant",get_customHeaderDividerVariant:"get_customHeaderDividerVariant",set_headerDividerFactory:"set_headerDividerFactory",get_headerDividerFactory:"get_headerDividerFactory",set_customHeaderRendererVariant:"set_customHeaderRendererVariant",get_customHeaderRendererVariant:"get_customHeaderRendererVariant",set_customCellRendererVariant:"set_customCellRendererVariant",get_customCellRendererVariant:"get_customCellRendererVariant",set_headerRendererRecycler:"set_headerRendererRecycler",get_headerRendererRecycler:"get_headerRendererRecycler",set_rowRendererFactory:"set_rowRendererFactory",get_rowRendererFactory:"get_rowRendererFactory",set_columns:"set_columns",get_columns:"get_columns",set_dataProvider:"set_dataProvider",get_dataProvider:"get_dataProvider",set_childFocusEnabled:"set_childFocusEnabled",get_childFocusEnabled:"get_childFocusEnabled"})
});
var feathers_controls__$TreeGridView_HeaderRendererStorage = function(recycler) {
	this.inactiveHeaderRenderers = [];
	this.activeHeaderRenderers = [];
	this.headerRendererRecycler = recycler;
};
$hxClasses["feathers.controls._TreeGridView.HeaderRendererStorage"] = feathers_controls__$TreeGridView_HeaderRendererStorage;
feathers_controls__$TreeGridView_HeaderRendererStorage.__name__ = "feathers.controls._TreeGridView.HeaderRendererStorage";
feathers_controls__$TreeGridView_HeaderRendererStorage.prototype = {
	oldHeaderRendererRecycler: null
	,headerRendererRecycler: null
	,activeHeaderRenderers: null
	,inactiveHeaderRenderers: null
	,measurements: null
	,__class__: feathers_controls__$TreeGridView_HeaderRendererStorage
};
var feathers_controls__$TreeGridView_HeaderDividerStorage = function(factory) {
	this.inactiveHeaderDividers = [];
	this.activeHeaderDividers = [];
	this.headerDividerFactory = factory;
};
$hxClasses["feathers.controls._TreeGridView.HeaderDividerStorage"] = feathers_controls__$TreeGridView_HeaderDividerStorage;
feathers_controls__$TreeGridView_HeaderDividerStorage.__name__ = "feathers.controls._TreeGridView.HeaderDividerStorage";
feathers_controls__$TreeGridView_HeaderDividerStorage.prototype = {
	customHeaderDividerVariant: null
	,oldHeaderDividerFactory: null
	,headerDividerFactory: null
	,activeHeaderDividers: null
	,inactiveHeaderDividers: null
	,__class__: feathers_controls__$TreeGridView_HeaderDividerStorage
};
var feathers_controls__$TreeGridView_ColumnDividerStorage = function(factory) {
	this.inactiveColumnDividers = [];
	this.activeColumnDividers = [];
	this.columnDividerFactory = factory;
};
$hxClasses["feathers.controls._TreeGridView.ColumnDividerStorage"] = feathers_controls__$TreeGridView_ColumnDividerStorage;
feathers_controls__$TreeGridView_ColumnDividerStorage.__name__ = "feathers.controls._TreeGridView.ColumnDividerStorage";
feathers_controls__$TreeGridView_ColumnDividerStorage.prototype = {
	customColumnDividerVariant: null
	,oldColumnDividerFactory: null
	,columnDividerFactory: null
	,activeColumnDividers: null
	,inactiveColumnDividers: null
	,__class__: feathers_controls__$TreeGridView_ColumnDividerStorage
};
var feathers_controls_TreeGridViewColumn = function(headerText,itemToText,width) {
	this.cellRendererRecycler = null;
	this.minWidth = 0.0;
	this.width = null;
	openfl_events_EventDispatcher.call(this);
	this.headerText = headerText;
	if(itemToText != null) {
		this.itemToText = itemToText;
	}
	this.width = width;
};
$hxClasses["feathers.controls.TreeGridViewColumn"] = feathers_controls_TreeGridViewColumn;
feathers_controls_TreeGridViewColumn.__name__ = "feathers.controls.TreeGridViewColumn";
feathers_controls_TreeGridViewColumn.__interfaces__ = [feathers_controls_IGridViewColumn];
feathers_controls_TreeGridViewColumn.__super__ = openfl_events_EventDispatcher;
feathers_controls_TreeGridViewColumn.prototype = $extend(openfl_events_EventDispatcher.prototype,{
	headerText: null
	,width: null
	,minWidth: null
	,cellRendererRecycler: null
	,itemToText: function(data) {
		return Std.string(data);
	}
	,__class__: feathers_controls_TreeGridViewColumn
});
var feathers_data_TreeViewItemState = function(data,location,layoutIndex,branch,selected,text) {
	if(selected == null) {
		selected = false;
	}
	if(branch == null) {
		branch = false;
	}
	if(layoutIndex == null) {
		layoutIndex = -1;
	}
	this.enabled = true;
	this.selected = false;
	this.opened = false;
	this.branch = false;
	this.layoutIndex = -1;
	this.data = data;
	this.location = location;
	this.layoutIndex = layoutIndex;
	this.branch = branch;
	this.selected = false;
	this.text = text;
};
$hxClasses["feathers.data.TreeViewItemState"] = feathers_data_TreeViewItemState;
feathers_data_TreeViewItemState.__name__ = "feathers.data.TreeViewItemState";
feathers_data_TreeViewItemState.prototype = {
	owner: null
	,data: null
	,location: null
	,layoutIndex: null
	,branch: null
	,opened: null
	,selected: null
	,text: null
	,enabled: null
	,recyclerID: null
	,__class__: feathers_data_TreeViewItemState
};
var feathers_controls_TreeView = function(dataProvider,changeListener) {
	this.__customItemRendererVariant = null;
	this.__layout = null;
	this._pendingScrollDuration = null;
	this._pendingScrollLocation = null;
	this._ignoreLayoutChanges = false;
	this._ignoreOpenedChange = false;
	this._ignoreSelectionChange = false;
	this.pointerSelectionEnabled = true;
	this._virtualLayout = true;
	this._selectable = true;
	this._totalLayoutCount = 0;
	this._layoutItems = [];
	this._tempVisibleIndices = new feathers_layout_VirtualLayoutRange(0,0);
	this._visibleIndices = new feathers_layout_VirtualLayoutRange(0,0);
	this._virtualCache = [];
	this._unrenderedLayoutIndices = [];
	this._unrenderedLocations = [];
	this.itemStatePool = new lime_utils_ObjectPool(function() {
		return new feathers_data_TreeViewItemState();
	});
	this.itemRendererToItemState = new haxe_ds_ObjectMap();
	this.stringDataToItemRenderer = new haxe_ds_StringMap();
	this.objectDataToItemRenderer = new haxe_ds_ObjectMap();
	this._additionalStorage = null;
	this._defaultStorage = new feathers_controls__$TreeView_ItemRendererStorage(null,feathers_utils_DisplayObjectRecycler.withClass(feathers_controls_dataRenderers_HierarchicalItemRenderer));
	this._recyclerMap = null;
	this._forceItemStateUpdate = false;
	this._previousCustomItemRendererVariant = null;
	this._selectedItem = null;
	this._selectedLocation = null;
	this.openBranches = [];
	this._childFocusEnabled = true;
	this.initializeTreeViewTheme();
	feathers_controls_supportClasses_BaseScrollContainer.call(this);
	this.set_dataProvider(dataProvider);
	this.set_tabEnabled(true);
	this.focusRect = null;
	if(this.get_viewPort() == null) {
		this.treeViewPort = new feathers_controls_supportClasses_AdvancedLayoutViewPort();
		this.addChild(this.treeViewPort);
		this.set_viewPort(this.treeViewPort);
	}
	if(changeListener != null) {
		this.addEventListener("change",changeListener);
	}
};
$hxClasses["feathers.controls.TreeView"] = feathers_controls_TreeView;
feathers_controls_TreeView.__name__ = "feathers.controls.TreeView";
feathers_controls_TreeView.__interfaces__ = [feathers_core_IFocusContainer,feathers_core_IDataSelector];
feathers_controls_TreeView.defaultUpdateItemRenderer = function(itemRenderer,state) {
	if(js_Boot.__implements(itemRenderer,feathers_core_ITextControl)) {
		var textControl = itemRenderer;
		textControl.set_text(state.text);
	}
};
feathers_controls_TreeView.defaultResetItemRenderer = function(itemRenderer,state) {
	if(js_Boot.__implements(itemRenderer,feathers_core_ITextControl)) {
		var textControl = itemRenderer;
		textControl.set_text(null);
	}
};
feathers_controls_TreeView.__super__ = feathers_controls_supportClasses_BaseScrollContainer;
feathers_controls_TreeView.prototype = $extend(feathers_controls_supportClasses_BaseScrollContainer.prototype,{
	treeViewPort: null
	,get_tabEnabled: function() {
		if((this._selectable || this.get_maxScrollY() != this.get_minScrollY() || this.get_maxScrollX() != this.get_minScrollX()) && this._enabled) {
			return this.get_rawTabEnabled();
		} else {
			return false;
		}
	}
	,_childFocusEnabled: null
	,get_childFocusEnabled: function() {
		if(this._enabled) {
			return this._childFocusEnabled;
		} else {
			return false;
		}
	}
	,set_childFocusEnabled: function(value) {
		if(this._childFocusEnabled == value) {
			return this._childFocusEnabled;
		}
		this._childFocusEnabled = value;
		return this._childFocusEnabled;
	}
	,openBranches: null
	,_dataProvider: null
	,get_dataProvider: function() {
		return this._dataProvider;
	}
	,set_dataProvider: function(value) {
		if(this._dataProvider == value) {
			return this._dataProvider;
		}
		this._virtualCache.length = 0;
		this._totalLayoutCount = 0;
		this.openBranches.length = 0;
		if(this._dataProvider != null) {
			this._dataProvider.removeEventListener("change",$bind(this,this.treeView_dataProvider_changeHandler));
			this._dataProvider.removeEventListener("addItem",$bind(this,this.treeView_dataProvider_addItemHandler));
			this._dataProvider.removeEventListener("removeItem",$bind(this,this.treeView_dataProvider_removeItemHandler));
			this._dataProvider.removeEventListener("replaceItem",$bind(this,this.treeView_dataProvider_replaceItemHandler));
			this._dataProvider.removeEventListener("removeAll",$bind(this,this.treeView_dataProvider_removeAllHandler));
			this._dataProvider.removeEventListener("reset",$bind(this,this.treeView_dataProvider_resetHandler));
			this._dataProvider.removeEventListener("filterChange",$bind(this,this.treeView_dataProvider_filterChangeHandler));
			this._dataProvider.removeEventListener("sortChange",$bind(this,this.treeView_dataProvider_sortChangeHandler));
			this._dataProvider.removeEventListener("updateItem",$bind(this,this.treeView_dataProvider_updateItemHandler));
			this._dataProvider.removeEventListener("updateAll",$bind(this,this.treeView_dataProvider_updateAllHandler));
		}
		this._dataProvider = value;
		if(this._dataProvider != null) {
			this._totalLayoutCount = this.calculateTotalLayoutCount([]);
			this._virtualCache.length = this._totalLayoutCount;
			this._dataProvider.addEventListener("change",$bind(this,this.treeView_dataProvider_changeHandler));
			this._dataProvider.addEventListener("addItem",$bind(this,this.treeView_dataProvider_addItemHandler));
			this._dataProvider.addEventListener("removeItem",$bind(this,this.treeView_dataProvider_removeItemHandler));
			this._dataProvider.addEventListener("replaceItem",$bind(this,this.treeView_dataProvider_replaceItemHandler));
			this._dataProvider.addEventListener("removeAll",$bind(this,this.treeView_dataProvider_removeAllHandler));
			this._dataProvider.addEventListener("reset",$bind(this,this.treeView_dataProvider_resetHandler));
			this._dataProvider.addEventListener("filterChange",$bind(this,this.treeView_dataProvider_filterChangeHandler));
			this._dataProvider.addEventListener("sortChange",$bind(this,this.treeView_dataProvider_sortChangeHandler));
			this._dataProvider.addEventListener("updateItem",$bind(this,this.treeView_dataProvider_updateItemHandler));
			this._dataProvider.addEventListener("updateAll",$bind(this,this.treeView_dataProvider_updateAllHandler));
		}
		this.set_scrollX(0.0);
		this.set_scrollY(0.0);
		this.set_selectedLocation(null);
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		feathers_events_FeathersEvent.dispatch(this,"dataChange");
		return this._dataProvider;
	}
	,_selectedLocation: null
	,get_selectedLocation: function() {
		return this._selectedLocation;
	}
	,set_selectedLocation: function(value) {
		if(!this._selectable || this._dataProvider == null) {
			value = null;
		}
		if(this._selectedLocation == value || this.compareLocations(this._selectedLocation,value) == 0) {
			return this._selectedLocation;
		}
		this._selectedLocation = value;
		if(this._selectedLocation == null) {
			this._selectedItem = null;
		} else {
			this._selectedItem = this._dataProvider.get(this._selectedLocation);
		}
		this.setInvalid(feathers_core_InvalidationFlag.SELECTION);
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._selectedLocation;
	}
	,_selectedItem: null
	,get_selectedItem: function() {
		return this._selectedItem;
	}
	,set_selectedItem: function(value) {
		if(value == null || !this._selectable || this._dataProvider == null) {
			this.set_selectedLocation(null);
			return this._selectedItem;
		}
		var location = this._dataProvider.locationOf(value);
		if(this._selectedItem == value && this.compareLocations(this._selectedLocation,location) == 0) {
			return this._selectedItem;
		}
		this._selectedItem = value;
		this._selectedLocation = location;
		this.setInvalid(feathers_core_InvalidationFlag.SELECTION);
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._selectedItem;
	}
	,_previousLayout: null
	,_previousCustomItemRendererVariant: null
	,get_itemRendererRecycler: function() {
		return this._defaultStorage.itemRendererRecycler;
	}
	,set_itemRendererRecycler: function(value) {
		if(this._defaultStorage.itemRendererRecycler == value) {
			return this._defaultStorage.itemRendererRecycler;
		}
		this._defaultStorage.oldItemRendererRecycler = this._defaultStorage.itemRendererRecycler;
		this._defaultStorage.itemRendererRecycler = value;
		this._defaultStorage.measurements = null;
		this.setInvalid(feathers_controls_TreeView.INVALIDATION_FLAG_ITEM_RENDERER_FACTORY);
		return this._defaultStorage.itemRendererRecycler;
	}
	,_forceItemStateUpdate: null
	,get_forceItemStateUpdate: function() {
		return this._forceItemStateUpdate;
	}
	,set_forceItemStateUpdate: function(value) {
		if(this._forceItemStateUpdate == value) {
			return this._forceItemStateUpdate;
		}
		this._forceItemStateUpdate = value;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		return this._forceItemStateUpdate;
	}
	,_recyclerMap: null
	,_itemRendererRecyclerIDFunction: null
	,get_itemRendererRecyclerIDFunction: function() {
		return this._itemRendererRecyclerIDFunction;
	}
	,set_itemRendererRecyclerIDFunction: function(value) {
		if(this._itemRendererRecyclerIDFunction == value) {
			return this._itemRendererRecyclerIDFunction;
		}
		this._itemRendererRecyclerIDFunction = value;
		this.setInvalid(feathers_controls_TreeView.INVALIDATION_FLAG_ITEM_RENDERER_FACTORY);
		return this._itemRendererRecyclerIDFunction;
	}
	,_defaultStorage: null
	,_additionalStorage: null
	,objectDataToItemRenderer: null
	,stringDataToItemRenderer: null
	,itemRendererToItemState: null
	,itemStatePool: null
	,_unrenderedLocations: null
	,_unrenderedLayoutIndices: null
	,_virtualCache: null
	,_visibleIndices: null
	,_tempVisibleIndices: null
	,_layoutItems: null
	,_totalLayoutCount: null
	,_selectable: null
	,get_selectable: function() {
		return this._selectable;
	}
	,set_selectable: function(value) {
		if(this._selectable == value) {
			return this._selectable;
		}
		this._selectable = value;
		if(!this._selectable) {
			this.set_selectedLocation(null);
		}
		return this._selectable;
	}
	,_virtualLayout: null
	,get_virtualLayout: function() {
		return this._virtualLayout;
	}
	,set_virtualLayout: function(value) {
		if(this._virtualLayout = value) {
			return this._virtualLayout;
		}
		this._virtualLayout = value;
		this.setInvalid(feathers_core_InvalidationFlag.LAYOUT);
		return this._virtualLayout;
	}
	,pointerSelectionEnabled: null
	,_ignoreSelectionChange: null
	,_ignoreOpenedChange: null
	,_ignoreLayoutChanges: null
	,_currentDisplayIndex: null
	,_pendingScrollLocation: null
	,_pendingScrollDuration: null
	,itemToText: function(data) {
		return Std.string(data);
	}
	,itemToEnabled: function(data) {
		return true;
	}
	,isBranchOpen: function(branch) {
		if(this._dataProvider == null || !this._dataProvider.contains(branch)) {
			return false;
		}
		if(this._dataProvider.isBranch(branch)) {
			return this.openBranches.indexOf(branch) != -1;
		} else {
			return false;
		}
	}
	,toggleBranch: function(branch,open) {
		var location = this._dataProvider != null ? this._dataProvider.locationOf(branch) : null;
		if(location == null) {
			throw new openfl_errors_ArgumentError("Cannot open branch because it is not in the data provider.");
		}
		if(!this._dataProvider.isBranch(branch)) {
			throw new openfl_errors_ArgumentError("Cannot open item because it is not a branch.");
		}
		var alreadyOpen = this.openBranches.indexOf(branch) != -1;
		if(open && alreadyOpen || !open && !alreadyOpen) {
			return;
		}
		var layoutIndex = this.locationToDisplayIndex(location,false);
		this.toggleBranchInternal(branch,location,layoutIndex,open);
		this._totalLayoutCount = this.calculateTotalLayoutCount([]);
	}
	,toggleChildrenOf: function(branch,open) {
		var location = this._dataProvider != null ? this._dataProvider.locationOf(branch) : null;
		if(location == null) {
			throw new openfl_errors_ArgumentError("Cannot open branch because it is not in the data provider.");
		}
		if(!this._dataProvider.isBranch(branch)) {
			throw new openfl_errors_ArgumentError("Cannot open item because it is not a branch.");
		}
		var layoutIndex = this.locationToDisplayIndex(location,false);
		this.toggleChildrenOfInternal(branch,location,layoutIndex,open);
		this._totalLayoutCount = this.calculateTotalLayoutCount([]);
	}
	,itemToItemRenderer: function(item) {
		if(item == null) {
			return null;
		}
		if(typeof(item) == "string") {
			return this.stringDataToItemRenderer.h[item];
		}
		return this.objectDataToItemRenderer.h[item.__id__];
	}
	,itemRendererToItem: function(itemRenderer) {
		if(itemRenderer == null) {
			return null;
		}
		var state = this.itemRendererToItemState.h[itemRenderer.__id__];
		if(state == null) {
			return null;
		}
		return state.data;
	}
	,locationToItemRenderer: function(location) {
		if(this._dataProvider == null || !this.isValidLocation(location)) {
			return null;
		}
		var item = this._dataProvider.get(location);
		if(typeof(item) == "string") {
			return this.stringDataToItemRenderer.h[item];
		}
		return this.objectDataToItemRenderer.h[item.__id__];
	}
	,scrollToLocation: function(location,animationDuration) {
		if(this._dataProvider == null || this._dataProvider.getLength() == 0) {
			return;
		}
		this._pendingScrollLocation = location;
		this._pendingScrollDuration = animationDuration;
		this.setInvalid(feathers_core_InvalidationFlag.SCROLL);
	}
	,getItemRendererRecycler: function(id) {
		if(this._recyclerMap == null) {
			return null;
		}
		return this._recyclerMap.h[id];
	}
	,setItemRendererRecycler: function(id,recycler) {
		if(this._recyclerMap == null) {
			this._recyclerMap = new haxe_ds_StringMap();
		}
		if(recycler == null) {
			var _this = this._recyclerMap;
			if(Object.prototype.hasOwnProperty.call(_this.h,id)) {
				delete(_this.h[id]);
			}
			return;
		}
		this._recyclerMap.h[id] = recycler;
		this.setInvalid(feathers_controls_TreeView.INVALIDATION_FLAG_ITEM_RENDERER_FACTORY);
	}
	,itemToItemState: function(item) {
		if(item == null) {
			return null;
		}
		var itemState = null;
		var itemRenderer = null;
		if(typeof(item) == "string") {
			itemRenderer = this.stringDataToItemRenderer.h[item];
		} else {
			itemRenderer = this.objectDataToItemRenderer.h[item.__id__];
		}
		if(itemRenderer != null) {
			itemState = this.itemRendererToItemState.h[itemRenderer.__id__];
		} else {
			var location = this._dataProvider.locationOf(item);
			if(location == null) {
				return null;
			}
			itemState = new feathers_data_TreeViewItemState();
			var layoutIndex = this.locationToDisplayIndex(location,false);
			this.populateCurrentItemState(item,location,layoutIndex,itemState,false);
		}
		return itemState;
	}
	,dispose: function() {
		this.refreshInactiveItemRenderers(this._defaultStorage,true);
		if(this._additionalStorage != null) {
			var _g = 0;
			var _g1 = this._additionalStorage.length;
			while(_g < _g1) {
				var i = _g++;
				var storage = this._additionalStorage[i];
				this.refreshInactiveItemRenderers(storage,true);
			}
		}
		this._selectedItem = null;
		this._selectedLocation = null;
		this.set_dataProvider(null);
		feathers_controls_supportClasses_BaseScrollContainer.prototype.dispose.call(this);
	}
	,initializeTreeViewTheme: function() {
		feathers_themes_steel_components_SteelTreeViewStyles.initialize();
	}
	,update: function() {
		var layoutInvalid = this.isInvalid(feathers_core_InvalidationFlag.LAYOUT);
		var stylesInvalid = this.isInvalid(feathers_core_InvalidationFlag.STYLES);
		if(this._previousCustomItemRendererVariant != this.get_customItemRendererVariant()) {
			this.setInvalidationFlag(feathers_controls_TreeView.INVALIDATION_FLAG_ITEM_RENDERER_FACTORY);
		}
		if(layoutInvalid || stylesInvalid) {
			if(this._previousLayout != this.get_layout()) {
				this._virtualCache.length = 0;
				this._virtualCache.length = this._totalLayoutCount;
			}
			this.treeViewPort.set_layout(this.get_layout());
			this._previousLayout = this.get_layout();
		}
		this.treeViewPort.refreshChildren = $bind(this,this.refreshItemRenderers);
		var flag = this._invalidationFlags.keys();
		while(flag.hasNext()) {
			var flag1 = flag.next();
			this.treeViewPort.setInvalid(flag1);
		}
		if(this._allInvalid) {
			this.treeViewPort.setInvalid();
		}
		feathers_controls_supportClasses_BaseScrollContainer.prototype.update.call(this);
		this._previousCustomItemRendererVariant = this.get_customItemRendererVariant();
		this.handlePendingScroll();
	}
	,createScroller: function() {
		feathers_controls_supportClasses_BaseScrollContainer.prototype.createScroller.call(this);
		this.treeViewPort.set_scroller(this.scroller);
	}
	,refreshScrollerValues: function() {
		feathers_controls_supportClasses_BaseScrollContainer.prototype.refreshScrollerValues.call(this);
		if(js_Boot.__implements(this.get_layout(),feathers_layout_IScrollLayout)) {
			var scrollLayout = this.get_layout();
			this.scroller.forceElasticTop = scrollLayout.get_elasticTop();
			this.scroller.forceElasticRight = scrollLayout.get_elasticRight();
			this.scroller.forceElasticBottom = scrollLayout.get_elasticBottom();
			this.scroller.forceElasticLeft = scrollLayout.get_elasticLeft();
		} else {
			this.scroller.forceElasticTop = false;
			this.scroller.forceElasticRight = false;
			this.scroller.forceElasticBottom = false;
			this.scroller.forceElasticLeft = false;
		}
		this.scroller.snapPositionsX = this.treeViewPort.get_snapPositionsX();
		this.scroller.snapPositionsY = this.treeViewPort.get_snapPositionsY();
	}
	,needsScrollMeasurement: function() {
		var oldStart = this._visibleIndices.start;
		var oldEnd = this._visibleIndices.end;
		if(this._virtualLayout && js_Boot.__implements(this.get_layout(),feathers_layout_IVirtualLayout)) {
			var virtualLayout = this.get_layout();
			var oldIgnoreLayoutChanges = this._ignoreLayoutChanges;
			this._ignoreLayoutChanges = true;
			virtualLayout.set_scrollX(this.scroller.get_scrollX());
			virtualLayout.set_scrollY(this.scroller.get_scrollY());
			this._ignoreLayoutChanges = oldIgnoreLayoutChanges;
			virtualLayout.getVisibleIndices(this._layoutItems.length,this.treeViewPort.get_visibleWidth(),this.treeViewPort.get_visibleHeight(),this._tempVisibleIndices);
		} else {
			this._tempVisibleIndices.start = 0;
			this._tempVisibleIndices.end = this._layoutItems.length - 1;
		}
		if(oldStart == this._tempVisibleIndices.start) {
			return oldEnd != this._tempVisibleIndices.end;
		} else {
			return true;
		}
	}
	,refreshItemRenderers: function(items) {
		this._layoutItems = items;
		if(this._defaultStorage.itemRendererRecycler.update == null) {
			this._defaultStorage.itemRendererRecycler.update = feathers_controls_TreeView.defaultUpdateItemRenderer;
			if(this._defaultStorage.itemRendererRecycler.reset == null) {
				this._defaultStorage.itemRendererRecycler.reset = feathers_controls_TreeView.defaultResetItemRenderer;
			}
		}
		if(this._recyclerMap != null) {
			var h = this._recyclerMap.h;
			var recycler_h = h;
			var recycler_keys = Object.keys(h);
			var recycler_length = recycler_keys.length;
			var recycler_current = 0;
			while(recycler_current < recycler_length) {
				var recycler = recycler_h[recycler_keys[recycler_current++]];
				if(recycler.update == null) {
					if(recycler.update == null) {
						recycler.update = feathers_controls_TreeView.defaultUpdateItemRenderer;
						if(recycler.reset == null) {
							recycler.reset = feathers_controls_TreeView.defaultResetItemRenderer;
						}
					}
				}
			}
		}
		var itemRendererInvalid = this.treeViewPort.isInvalid(feathers_controls_TreeView.INVALIDATION_FLAG_ITEM_RENDERER_FACTORY);
		this.refreshInactiveItemRenderers(this._defaultStorage,itemRendererInvalid);
		if(this._additionalStorage != null) {
			var _g = 0;
			var _g1 = this._additionalStorage.length;
			while(_g < _g1) {
				var i = _g++;
				var storage = this._additionalStorage[i];
				this.refreshInactiveItemRenderers(storage,itemRendererInvalid);
			}
		}
		this.findUnrenderedData();
		this.recoverInactiveItemRenderers(this._defaultStorage);
		if(this._additionalStorage != null) {
			var _g = 0;
			var _g1 = this._additionalStorage.length;
			while(_g < _g1) {
				var i = _g++;
				var storage = this._additionalStorage[i];
				this.recoverInactiveItemRenderers(storage);
			}
		}
		this.renderUnrenderedData();
		this.freeInactiveItemRenderers(this._defaultStorage);
		if(this._defaultStorage.inactiveItemRenderers.length > 0) {
			var c = js_Boot.getClass(this);
			throw new openfl_errors_IllegalOperationError("" + c.__name__ + ": inactive item renderers should be empty after updating.");
		}
		if(this._additionalStorage != null) {
			var _g = 0;
			var _g1 = this._additionalStorage.length;
			while(_g < _g1) {
				var i = _g++;
				var storage = this._additionalStorage[i];
				this.freeInactiveItemRenderers(storage);
				if(storage.inactiveItemRenderers.length > 0) {
					var c = js_Boot.getClass(this);
					throw new openfl_errors_IllegalOperationError("" + c.__name__ + ": inactive item renderers " + storage.id + " should be empty after updating.");
				}
			}
		}
	}
	,refreshInactiveItemRenderers: function(storage,factoryInvalid) {
		var temp = storage.inactiveItemRenderers;
		storage.inactiveItemRenderers = storage.activeItemRenderers;
		storage.activeItemRenderers = temp;
		if(storage.activeItemRenderers.length > 0) {
			var c = js_Boot.getClass(this);
			throw new openfl_errors_IllegalOperationError("" + c.__name__ + ": active item renderers should be empty before updating.");
		}
		if(factoryInvalid) {
			this.recoverInactiveItemRenderers(storage);
			this.freeInactiveItemRenderers(storage);
			storage.oldItemRendererRecycler = null;
		}
	}
	,recoverInactiveItemRenderers: function(storage) {
		var _g = 0;
		var _g1 = storage.inactiveItemRenderers;
		while(_g < _g1.length) {
			var itemRenderer = _g1[_g];
			++_g;
			if(itemRenderer == null) {
				continue;
			}
			var state = this.itemRendererToItemState.h[itemRenderer.__id__];
			if(state == null) {
				continue;
			}
			var item = state.data;
			this.itemRendererToItemState.remove(itemRenderer);
			if(typeof(item) == "string") {
				var _this = this.stringDataToItemRenderer;
				var key = item;
				if(Object.prototype.hasOwnProperty.call(_this.h,key)) {
					delete(_this.h[key]);
				}
			} else {
				this.objectDataToItemRenderer.remove(item);
			}
			itemRenderer.removeEventListener("trigger",$bind(this,this.treeView_itemRenderer_triggerHandler));
			itemRenderer.removeEventListener("click",$bind(this,this.treeView_itemRenderer_clickHandler));
			itemRenderer.removeEventListener("touchTap",$bind(this,this.treeView_itemRenderer_touchTapHandler));
			itemRenderer.removeEventListener("change",$bind(this,this.treeView_itemRenderer_changeHandler));
			itemRenderer.removeEventListener("resize",$bind(this,this.treeView_itemRenderer_resizeHandler));
			itemRenderer.removeEventListener("open",$bind(this,this.treeView_itemRenderer_openHandler));
			itemRenderer.removeEventListener("close",$bind(this,this.treeView_itemRenderer_closeHandler));
			this.resetItemRenderer(itemRenderer,state,storage);
			if(storage.measurements != null) {
				storage.measurements.restore(itemRenderer);
			}
			this.itemStatePool.release(state);
		}
	}
	,freeInactiveItemRenderers: function(storage) {
		var recycler = storage.oldItemRendererRecycler != null ? storage.oldItemRendererRecycler : storage.itemRendererRecycler;
		var _g = 0;
		var _g1 = storage.inactiveItemRenderers;
		while(_g < _g1.length) {
			var itemRenderer = _g1[_g];
			++_g;
			if(itemRenderer == null) {
				continue;
			}
			this.destroyItemRenderer(itemRenderer,recycler);
		}
		storage.inactiveItemRenderers.length = 0;
	}
	,findUnrenderedData: function() {
		this._layoutItems.length = 0;
		this._layoutItems.length = this._totalLayoutCount;
		if(this._virtualLayout && js_Boot.__implements(this.get_layout(),feathers_layout_IVirtualLayout)) {
			var virtualLayout = this.get_layout();
			var oldIgnoreLayoutChanges = this._ignoreLayoutChanges;
			this._ignoreLayoutChanges = true;
			virtualLayout.set_scrollX(this.scroller.get_scrollX());
			virtualLayout.set_scrollY(this.scroller.get_scrollY());
			virtualLayout.set_virtualCache(this._virtualCache);
			this._ignoreLayoutChanges = oldIgnoreLayoutChanges;
			virtualLayout.getVisibleIndices(this._layoutItems.length,this.treeViewPort.get_visibleWidth(),this.treeViewPort.get_visibleHeight(),this._visibleIndices);
		} else {
			this._visibleIndices.start = 0;
			this._visibleIndices.end = this._layoutItems.length - 1;
		}
		this.findUnrenderedDataForLocation([],0);
	}
	,findUnrenderedDataForLocation: function(location,layoutIndex) {
		if(this._dataProvider == null) {
			return layoutIndex;
		}
		var _g = 0;
		var _g1 = this._dataProvider.getLength(location);
		while(_g < _g1) {
			var i = _g++;
			location.push(i);
			var item = this._dataProvider.get(location);
			if(layoutIndex < this._visibleIndices.start || layoutIndex > this._visibleIndices.end) {
				this._layoutItems[layoutIndex] = null;
			} else {
				this.findItemRenderer(item,location.slice(),layoutIndex);
			}
			++layoutIndex;
			if(layoutIndex > this._visibleIndices.end) {
				break;
			}
			if(this._dataProvider.isBranch(item) && this.openBranches.indexOf(item) != -1) {
				layoutIndex = this.findUnrenderedDataForLocation(location,layoutIndex);
				if(layoutIndex > this._visibleIndices.end) {
					break;
				}
			}
			location.pop();
		}
		return layoutIndex;
	}
	,findItemRenderer: function(item,location,layoutIndex) {
		var itemRenderer = null;
		if(typeof(item) == "string") {
			itemRenderer = this.stringDataToItemRenderer.h[item];
		} else {
			itemRenderer = this.objectDataToItemRenderer.h[item.__id__];
		}
		if(itemRenderer == null) {
			this._unrenderedLocations.push(location);
			this._unrenderedLayoutIndices.push(layoutIndex);
			return;
		}
		var state = this.itemRendererToItemState.h[itemRenderer.__id__];
		var changed = this.populateCurrentItemState(item,location,layoutIndex,state,this._forceItemStateUpdate);
		var oldRecyclerID = state.recyclerID;
		var storage = this.itemStateToStorage(state);
		if(storage.id != oldRecyclerID) {
			this._unrenderedLocations.push(location);
			this._unrenderedLayoutIndices.push(layoutIndex);
			return;
		}
		if(changed) {
			this.updateItemRenderer(itemRenderer,state,storage);
		}
		itemRenderer.set_visible(true);
		this._layoutItems[layoutIndex] = itemRenderer;
		var removed = HxOverrides.remove(storage.inactiveItemRenderers,itemRenderer);
		if(!removed) {
			var c = js_Boot.getClass(this);
			throw new openfl_errors_IllegalOperationError("" + c.__name__ + ": item renderer map contains bad data for item at location " + Std.string(location) + ". This may be caused by duplicate items in the data provider, which is not allowed.");
		}
		storage.activeItemRenderers.push(itemRenderer);
	}
	,populateCurrentItemState: function(item,location,layoutIndex,state,force) {
		var changed = false;
		if(force || state.owner != this) {
			state.owner = this;
			changed = true;
		}
		if(force || state.data != item) {
			state.data = item;
			changed = true;
		}
		if(force || state.location != location && this.compareLocations(state.location,location) != 0) {
			state.location = location;
			changed = true;
		}
		if(force || state.layoutIndex != layoutIndex) {
			state.layoutIndex = layoutIndex;
			changed = true;
		}
		var branch = this._dataProvider != null && this._dataProvider.isBranch(item);
		if(force || state.branch != branch) {
			state.branch = branch;
			changed = true;
		}
		var opened = state.branch && this.openBranches.indexOf(item) != -1;
		if(force || state.opened != opened) {
			state.opened = opened;
			changed = true;
		}
		var selected = item == this._selectedItem;
		if(force || state.selected != selected) {
			state.selected = selected;
			changed = true;
		}
		var enabled = this._enabled && this.itemToEnabled(item);
		if(force || state.enabled != enabled) {
			state.enabled = enabled;
			changed = true;
		}
		var text = this.itemToText(item);
		if(force || state.text != text) {
			state.text = text;
			changed = true;
		}
		return changed;
	}
	,updateItemRenderer: function(itemRenderer,state,storage) {
		state.recyclerID = storage.id;
		var oldIgnoreSelectionChange = this._ignoreSelectionChange;
		this._ignoreSelectionChange = true;
		var oldIgnoreOpenedChange = this._ignoreOpenedChange;
		this._ignoreOpenedChange = true;
		if(storage.itemRendererRecycler.update != null) {
			storage.itemRendererRecycler.update(itemRenderer,state);
		}
		this._ignoreOpenedChange = oldIgnoreOpenedChange;
		this._ignoreSelectionChange = oldIgnoreSelectionChange;
		this.refreshItemRendererProperties(itemRenderer,state);
	}
	,resetItemRenderer: function(itemRenderer,state,storage) {
		var oldIgnoreSelectionChange = this._ignoreSelectionChange;
		this._ignoreSelectionChange = true;
		var oldIgnoreOpenedChange = this._ignoreOpenedChange;
		this._ignoreOpenedChange = true;
		var recycler = storage.oldItemRendererRecycler != null ? storage.oldItemRendererRecycler : storage.itemRendererRecycler;
		if(recycler != null && recycler.reset != null) {
			recycler.reset(itemRenderer,state);
		}
		this._ignoreOpenedChange = oldIgnoreOpenedChange;
		this._ignoreSelectionChange = oldIgnoreSelectionChange;
		this.refreshItemRendererProperties(itemRenderer,feathers_controls_TreeView.RESET_ITEM_STATE);
	}
	,refreshItemRendererProperties: function(itemRenderer,state) {
		var oldIgnoreSelectionChange = this._ignoreSelectionChange;
		this._ignoreSelectionChange = true;
		var oldIgnoreOpenedChange = this._ignoreOpenedChange;
		this._ignoreOpenedChange = true;
		if(js_Boot.__implements(itemRenderer,feathers_core_IUIControl)) {
			var uiControl = itemRenderer;
			uiControl.set_enabled(state.enabled);
		}
		if(js_Boot.__implements(itemRenderer,feathers_controls_dataRenderers_IDataRenderer)) {
			var dataRenderer = itemRenderer;
			dataRenderer.set_data(state.data);
		}
		if(js_Boot.__implements(itemRenderer,feathers_controls_IToggle)) {
			var toggle = itemRenderer;
			toggle.set_selected(state.selected);
		}
		if(js_Boot.__implements(itemRenderer,feathers_controls_dataRenderers_IHierarchicalItemRenderer)) {
			var hierarchicalItem = itemRenderer;
			hierarchicalItem.set_branch(state.branch);
		}
		if(js_Boot.__implements(itemRenderer,feathers_controls_dataRenderers_IHierarchicalDepthItemRenderer)) {
			var depthItem = itemRenderer;
			depthItem.set_hierarchyDepth(state.location != null ? state.location.length - 1 : 0);
		}
		if(js_Boot.__implements(itemRenderer,feathers_controls_dataRenderers_ITreeViewItemRenderer)) {
			var treeItem = itemRenderer;
			treeItem.set_location(state.location);
			treeItem.set_treeViewOwner(state.owner);
		}
		if(js_Boot.__implements(itemRenderer,feathers_layout_ILayoutIndexObject)) {
			var layoutIndexObject = itemRenderer;
			layoutIndexObject.set_layoutIndex(state.layoutIndex);
		}
		if(js_Boot.__implements(itemRenderer,feathers_core_IOpenCloseToggle)) {
			var openCloseItem = itemRenderer;
			openCloseItem.set_opened(state.opened);
		}
		this._ignoreOpenedChange = oldIgnoreOpenedChange;
		this._ignoreSelectionChange = oldIgnoreSelectionChange;
	}
	,renderUnrenderedData: function() {
		var _g = 0;
		var _g1 = this._unrenderedLocations;
		while(_g < _g1.length) {
			var location = _g1[_g];
			++_g;
			var layoutIndex = this._unrenderedLayoutIndices.shift();
			var item = this._dataProvider.get(location);
			var state = this.itemStatePool.get();
			this.populateCurrentItemState(item,location,layoutIndex,state,true);
			var itemRenderer = this.createItemRenderer(state);
			itemRenderer.set_visible(true);
			this.treeViewPort.addChild(itemRenderer);
			this._layoutItems[layoutIndex] = itemRenderer;
		}
		this._unrenderedLocations.length = 0;
	}
	,createItemRenderer: function(state) {
		var storage = this.itemStateToStorage(state);
		var itemRenderer = null;
		if(storage.inactiveItemRenderers.length == 0) {
			itemRenderer = storage.itemRendererRecycler.create();
			if(js_Boot.__implements(itemRenderer,feathers_style_IVariantStyleObject)) {
				var variantItemRenderer = itemRenderer;
				if(variantItemRenderer.get_variant() == null) {
					var variant = this.get_customItemRendererVariant() != null ? this.get_customItemRendererVariant() : feathers_controls_TreeView.CHILD_VARIANT_ITEM_RENDERER;
					variantItemRenderer.set_variant(variant);
				}
			}
			if(js_Boot.__implements(itemRenderer,feathers_core_IUIControl)) {
				itemRenderer.initializeNow();
			}
			if(storage.measurements == null) {
				storage.measurements = new feathers_layout_Measurements(itemRenderer);
			}
		} else {
			itemRenderer = storage.inactiveItemRenderers.shift();
		}
		this.updateItemRenderer(itemRenderer,state,storage);
		if(js_Boot.__implements(itemRenderer,feathers_controls_ITriggerView)) {
			itemRenderer.addEventListener("trigger",$bind(this,this.treeView_itemRenderer_triggerHandler));
		} else {
			itemRenderer.addEventListener("click",$bind(this,this.treeView_itemRenderer_clickHandler));
			itemRenderer.addEventListener("touchTap",$bind(this,this.treeView_itemRenderer_touchTapHandler));
		}
		if(js_Boot.__implements(itemRenderer,feathers_controls_IToggle)) {
			itemRenderer.addEventListener("change",$bind(this,this.treeView_itemRenderer_changeHandler));
		}
		if(js_Boot.__implements(itemRenderer,feathers_core_IMeasureObject)) {
			itemRenderer.addEventListener("resize",$bind(this,this.treeView_itemRenderer_resizeHandler));
		}
		if(js_Boot.__implements(itemRenderer,feathers_core_IOpenCloseToggle)) {
			itemRenderer.addEventListener("open",$bind(this,this.treeView_itemRenderer_openHandler));
			itemRenderer.addEventListener("close",$bind(this,this.treeView_itemRenderer_closeHandler));
		}
		this.itemRendererToItemState.set(itemRenderer,state);
		var item = state.data;
		if(typeof(item) == "string") {
			this.stringDataToItemRenderer.h[item] = itemRenderer;
		} else {
			this.objectDataToItemRenderer.set(item,itemRenderer);
		}
		storage.activeItemRenderers.push(itemRenderer);
		return itemRenderer;
	}
	,destroyItemRenderer: function(itemRenderer,recycler) {
		this.treeViewPort.removeChild(itemRenderer);
		if(recycler != null && recycler.destroy != null) {
			recycler.destroy(itemRenderer);
		}
	}
	,itemStateToStorage: function(state) {
		var recyclerID = null;
		if(this._itemRendererRecyclerIDFunction != null) {
			recyclerID = this._itemRendererRecyclerIDFunction(state);
		}
		var recycler = null;
		if(recyclerID != null) {
			if(this._recyclerMap != null) {
				recycler = this._recyclerMap.h[recyclerID];
			}
			if(recycler == null) {
				throw new openfl_errors_IllegalOperationError("Item renderer recycler ID \"" + recyclerID + "\" is not registered.");
			}
		}
		if(recycler == null) {
			return this._defaultStorage;
		}
		if(this._additionalStorage == null) {
			this._additionalStorage = [];
		}
		var _g = 0;
		var _g1 = this._additionalStorage.length;
		while(_g < _g1) {
			var i = _g++;
			var storage = this._additionalStorage[i];
			if(storage.itemRendererRecycler == recycler) {
				return storage;
			}
		}
		var storage = new feathers_controls__$TreeView_ItemRendererStorage(recyclerID,recycler);
		this._additionalStorage.push(storage);
		return storage;
	}
	,refreshSelectedLocationAfterFilterOrSort: function() {
		if(this._selectedLocation == null) {
			return;
		}
		this.set_selectedLocation(this._dataProvider.locationOf(this._selectedItem));
	}
	,calculateTotalLayoutCount: function(location) {
		if(this._dataProvider == null) {
			return 0;
		}
		var itemCount = this._dataProvider.getLength(location);
		var result = itemCount;
		var _g = 0;
		var _g1 = itemCount;
		while(_g < _g1) {
			var i = _g++;
			location.push(i);
			var item = this._dataProvider.get(location);
			if(this._dataProvider.isBranch(item) && this.openBranches.indexOf(item) != -1) {
				result += this.calculateTotalLayoutCount(location);
			}
			location.pop();
		}
		return result;
	}
	,insertChildrenIntoVirtualCache: function(location,layoutIndex) {
		var length = this._dataProvider.getLength(location);
		var _g = 0;
		var _g1 = length;
		while(_g < _g1) {
			var i = _g++;
			location.push(i);
			++layoutIndex;
			this._virtualCache.splice(layoutIndex,0,null);
			var item = this._dataProvider.get(location);
			if(this._dataProvider.isBranch(item) && this.openBranches.indexOf(item) != -1) {
				layoutIndex = this.insertChildrenIntoVirtualCache(location,layoutIndex);
			}
			location.pop();
		}
		return layoutIndex;
	}
	,removeChildrenFromVirtualCache: function(location,layoutIndex) {
		var length = this._dataProvider.getLength(location);
		++layoutIndex;
		var _g = 0;
		var _g1 = length;
		while(_g < _g1) {
			var i = _g++;
			location.push(i);
			var item = this._dataProvider.get(location);
			if(this._dataProvider.isBranch(item) && this.openBranches.indexOf(item) != -1) {
				this.removeChildrenFromVirtualCache(location,layoutIndex);
			}
			this._virtualCache.splice(layoutIndex,1);
			location.pop();
		}
	}
	,containsLocation: function(parent,possibleChild) {
		if(parent == null || possibleChild == null || parent.length >= possibleChild.length) {
			return false;
		}
		var _g = 0;
		var _g1 = parent.length;
		while(_g < _g1) {
			var i = _g++;
			var a = parent[i];
			var b = possibleChild[i];
			if(a != b) {
				return false;
			}
		}
		return true;
	}
	,compareLocations: function(location1,location2) {
		var null1 = location1 == null;
		var null2 = location2 == null;
		if(null1 && null2) {
			return 0;
		} else if(null1) {
			return 1;
		} else if(null2) {
			return -1;
		}
		var length1 = location1.length;
		var length2 = location2.length;
		var min = length1;
		if(length2 < min) {
			min = length2;
		}
		var _g = 0;
		var _g1 = min;
		while(_g < _g1) {
			var i = _g++;
			var index1 = location1[i];
			var index2 = location2[i];
			if(index1 < index2) {
				return -1;
			}
			if(index1 > index2) {
				return 1;
			}
		}
		if(length1 < length2) {
			return -1;
		} else if(length1 > length2) {
			return 1;
		}
		return 0;
	}
	,displayIndexToLocation: function(displayIndex) {
		this._currentDisplayIndex = -1;
		return this.displayIndexToLocationAtBranch(displayIndex,[]);
	}
	,displayIndexToLocationAtBranch: function(target,locationOfBranch) {
		var _g = 0;
		var _g1 = this._dataProvider.getLength(locationOfBranch);
		while(_g < _g1) {
			var i = _g++;
			this._currentDisplayIndex++;
			locationOfBranch[locationOfBranch.length] = i;
			if(this._currentDisplayIndex == target) {
				return locationOfBranch;
			}
			var child = this._dataProvider.get(locationOfBranch);
			if(this._dataProvider.isBranch(child)) {
				if(this.openBranches.indexOf(child) != -1) {
					var result = this.displayIndexToLocationAtBranch(target,locationOfBranch);
					if(result != null) {
						return result;
					}
				}
			}
			locationOfBranch.length -= 1;
		}
		return null;
	}
	,locationToDisplayIndex: function(location,returnNearestIfBranchNotOpen) {
		this._currentDisplayIndex = -1;
		var nearestNotOpenBranch = null;
		if(returnNearestIfBranchNotOpen) {
			nearestNotOpenBranch = [];
		}
		return this.locationToDisplayIndexAtBranch([],location,nearestNotOpenBranch);
	}
	,locationToDisplayIndexAtBranch: function(locationOfBranch,locationToFind,nearestNotOpenBranch) {
		if(nearestNotOpenBranch != null) {
			nearestNotOpenBranch.push(locationToFind[locationOfBranch.length]);
		}
		var _g = 0;
		var _g1 = this._dataProvider.getLength(locationOfBranch);
		while(_g < _g1) {
			var i = _g++;
			this._currentDisplayIndex++;
			locationOfBranch[locationOfBranch.length] = i;
			if(this.compareLocations(locationOfBranch,locationToFind) == 0) {
				return this._currentDisplayIndex;
			}
			var child = this._dataProvider.get(locationOfBranch);
			if(this._dataProvider.isBranch(child)) {
				if(this.openBranches.indexOf(child) != -1) {
					var result = this.locationToDisplayIndexAtBranch(locationOfBranch,locationToFind,nearestNotOpenBranch);
					if(result != -1) {
						return result;
					}
				} else if(nearestNotOpenBranch != null && this.compareLocations(nearestNotOpenBranch,locationOfBranch) == 0) {
					return this._currentDisplayIndex;
				}
			}
			locationOfBranch.length -= 1;
		}
		if(nearestNotOpenBranch != null) {
			nearestNotOpenBranch.pop();
		}
		return -1;
	}
	,navigateWithKeyboard: function(event) {
		if(event.isDefaultPrevented()) {
			return;
		}
		if(this._layoutItems.length == 0) {
			return;
		}
		var startIndex = this.locationToDisplayIndex(this._selectedLocation,false);
		var result = startIndex;
		if(js_Boot.__implements(this.get_layout(),feathers_layout_IKeyboardNavigationLayout)) {
			if(event.keyCode != 38 && event.keyCode != 40 && event.keyCode != 37 && event.keyCode != 39 && event.keyCode != 33 && event.keyCode != 34 && event.keyCode != 36 && event.keyCode != 35) {
				return;
			}
			result = this.get_layout().findNextKeyboardIndex(result,event,false,this._layoutItems,null,this.treeViewPort.get_visibleWidth(),this.treeViewPort.get_visibleHeight());
		} else {
			switch(event.keyCode) {
			case 33:
				--result;
				break;
			case 34:
				++result;
				break;
			case 35:
				result = this._layoutItems.length - 1;
				break;
			case 36:
				result = 0;
				break;
			case 37:
				--result;
				break;
			case 38:
				--result;
				break;
			case 39:
				++result;
				break;
			case 40:
				++result;
				break;
			default:
				return;
			}
		}
		if(result < 0) {
			result = 0;
		} else if(result >= this._layoutItems.length) {
			result = this._layoutItems.length - 1;
		}
		var changed = result != startIndex;
		var pendingLocation = null;
		if(!changed && result != -1) {
			pendingLocation = this.displayIndexToLocation(result);
			var itemRenderer = this.itemToItemRenderer(this._dataProvider.get(pendingLocation));
			if(itemRenderer == null) {
				changed = true;
			} else if(js_Boot.__implements(this.get_layout(),feathers_layout_IScrollLayout)) {
				var scrollLayout = this.get_layout();
				var nearestScrollPosition = scrollLayout.getNearestScrollPositionForIndex(result,this._layoutItems.length,this.get_viewPort().get_visibleWidth(),this.get_viewPort().get_visibleHeight());
				if(this.get_scrollX() != nearestScrollPosition.x || this.get_scrollY() != nearestScrollPosition.y) {
					changed = true;
				}
			}
		}
		if(!changed) {
			return;
		}
		event.preventDefault();
		if(pendingLocation == null) {
			pendingLocation = this.displayIndexToLocation(result);
		}
		this.set_selectedLocation(pendingLocation);
		if(this._selectedLocation != null) {
			this.scrollToLocation(this._selectedLocation);
		}
		if(this._focusManager != null) {
			this._focusManager.set_focus(this);
		} else if(this.stage != null) {
			this.stage.set_focus(this);
		}
	}
	,handlePendingScroll: function() {
		if(this._pendingScrollLocation == null) {
			return;
		}
		var location = this._pendingScrollLocation;
		var duration = this._pendingScrollDuration != null ? this._pendingScrollDuration : 0.0;
		this._pendingScrollLocation = null;
		this._pendingScrollDuration = null;
		if(this._dataProvider == null || this._dataProvider.getLength() == 0) {
			return;
		}
		var targetX = this.get_scrollX();
		var targetY = this.get_scrollY();
		if(js_Boot.__implements(this.get_layout(),feathers_layout_IScrollLayout)) {
			var displayIndex = this.locationToDisplayIndex(location,true);
			var scrollLayout = this.get_layout();
			var result = scrollLayout.getNearestScrollPositionForIndex(displayIndex,this._layoutItems.length,this.get_viewPort().get_visibleWidth(),this.get_viewPort().get_visibleHeight());
			targetX = result.x;
			targetY = result.y;
		} else {
			var item = this._dataProvider.get(location);
			var itemRenderer = null;
			if(typeof(item) == "string") {
				itemRenderer = this.stringDataToItemRenderer.h[item];
			} else {
				itemRenderer = this.objectDataToItemRenderer.h[item.__id__];
			}
			if(itemRenderer == null) {
				return;
			}
			var maxX = itemRenderer.get_x();
			var minX = maxX + itemRenderer.get_width() - this.get_viewPort().get_visibleWidth();
			if(targetX < minX) {
				targetX = minX;
			} else if(targetX > maxX) {
				targetX = maxX;
			}
			var maxY = itemRenderer.get_y();
			var minY = maxY + itemRenderer.get_height() - this.get_viewPort().get_visibleHeight();
			if(targetY < minY) {
				targetY = minY;
			} else if(targetY > maxY) {
				targetY = maxY;
			}
		}
		if(duration == 0.0) {
			this.scroller.stop();
			this.scroller.set_scrollX(targetX);
			this.scroller.set_scrollY(targetY);
		} else {
			this.scroller.throwTo(targetX,targetY,duration);
		}
	}
	,baseScrollContainer_keyDownHandler: function(event) {
		if(!this._selectable) {
			feathers_controls_supportClasses_BaseScrollContainer.prototype.baseScrollContainer_keyDownHandler.call(this,event);
			return;
		}
		if(!this._enabled || event.isDefaultPrevented() || this._dataProvider == null) {
			return;
		}
		if(this.stage != null && ((this.stage.get_focus()) instanceof openfl_text_TextField)) {
			var textField = this.stage.get_focus();
			if(textField.get_type() == 1) {
				return;
			}
		}
		if(event.keyCode == 37) {
			if(this._dataProvider.isBranch(this._selectedItem)) {
				if(this.openBranches.indexOf(this._selectedItem) != -1) {
					this.toggleBranch(this._selectedItem,false);
					return;
				}
			}
			var parentLocation = this._selectedLocation.slice();
			parentLocation.pop();
			if(parentLocation.length > 0) {
				this.set_selectedLocation(parentLocation);
			}
		}
		if(event.keyCode == 39) {
			if(this._dataProvider.isBranch(this._selectedItem)) {
				if(this.openBranches.indexOf(this._selectedItem) == -1) {
					this.toggleBranch(this._selectedItem,true);
					return;
				}
				var childCount = this._dataProvider.getLength(this._selectedLocation);
				if(childCount > 0) {
					var childLocation = this._selectedLocation.slice();
					childLocation.push(0);
					this.set_selectedLocation(childLocation);
				}
			}
		}
		if(event.keyCode == 13) {
			if(this._selectedItem != null) {
				var itemRenderer = null;
				if(typeof(this._selectedItem) == "string") {
					itemRenderer = this.stringDataToItemRenderer.h[this._selectedItem];
				} else {
					itemRenderer = this.objectDataToItemRenderer.h[this._selectedItem.__id__];
				}
				var state = null;
				if(itemRenderer != null) {
					state = this.itemRendererToItemState.h[itemRenderer.__id__];
				}
				var isTemporary = false;
				if(state == null) {
					isTemporary = true;
					state = this.itemStatePool.get();
				}
				var layoutIndex = this.locationToDisplayIndex(this._selectedLocation,false);
				this.populateCurrentItemState(this._selectedItem,this._selectedLocation,layoutIndex,state,true);
				feathers_events_TreeViewEvent.dispatch(this,"itemTrigger",state);
				if(isTemporary) {
					this.itemStatePool.release(state);
				}
			}
		}
		if(this._selectedLocation != null && event.keyCode == 32) {
			if(this._dataProvider.isBranch(this._selectedItem)) {
				event.preventDefault();
				this.toggleBranch(this._selectedItem,this.openBranches.indexOf(this._selectedItem) == -1);
			}
			return;
		}
		this.navigateWithKeyboard(event);
	}
	,isValidLocation: function(location) {
		var locationOfBranch = [];
		var _g = 0;
		while(_g < location.length) {
			var index = location[_g];
			++_g;
			if(index < 0) {
				return false;
			}
			if(index >= this._dataProvider.getLength(locationOfBranch)) {
				return false;
			}
			locationOfBranch.push(index);
		}
		return true;
	}
	,toggleBranchInternal: function(branch,location,layoutIndex,open) {
		var itemRenderer = null;
		if(typeof(branch) == "string") {
			itemRenderer = this.stringDataToItemRenderer.h[branch];
		} else {
			itemRenderer = this.objectDataToItemRenderer.h[branch.__id__];
		}
		var state = null;
		if(itemRenderer != null) {
			state = this.itemRendererToItemState.h[itemRenderer.__id__];
		}
		var isTemporary = false;
		if(state == null) {
			isTemporary = true;
			state = this.itemStatePool.get();
		}
		state.location = location;
		state.layoutIndex = layoutIndex;
		var alreadyOpen = this.openBranches.indexOf(branch) != -1;
		if(open && !alreadyOpen) {
			this.openBranches.push(branch);
			this.populateCurrentItemState(branch,location,layoutIndex,state,true);
			layoutIndex = this.insertChildrenIntoVirtualCache(location,layoutIndex);
			if(itemRenderer != null) {
				var storage = this.itemStateToStorage(state);
				this.updateItemRenderer(itemRenderer,state,storage);
			}
			feathers_events_TreeViewEvent.dispatch(this,"branchOpen",state);
		} else if(!open && alreadyOpen) {
			HxOverrides.remove(this.openBranches,branch);
			this.populateCurrentItemState(branch,location,layoutIndex,state,true);
			this.removeChildrenFromVirtualCache(location,layoutIndex);
			if(itemRenderer != null) {
				var storage = this.itemStateToStorage(state);
				this.updateItemRenderer(itemRenderer,state,storage);
			}
			feathers_events_TreeViewEvent.dispatch(this,"branchClose",state);
		}
		if(isTemporary) {
			this.itemStatePool.release(state);
		}
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		return layoutIndex;
	}
	,toggleChildrenOfInternal: function(branch,location,layoutIndex,open) {
		layoutIndex = this.toggleBranchInternal(branch,location,layoutIndex,open);
		var itemCount = this._dataProvider.getLength(location);
		var _g = 0;
		var _g1 = itemCount;
		while(_g < _g1) {
			var i = _g++;
			location.push(i);
			var child = this._dataProvider.get(location);
			if(this._dataProvider.isBranch(child)) {
				this.toggleChildrenOfInternal(child,location,layoutIndex,open);
			}
			location.pop();
		}
	}
	,refreshOpenBranchesFromDataProviderChange: function(removedItem,addedItem) {
		if(removedItem == null) {
			return;
		}
		var i = this.openBranches.length - 1;
		while(i >= 0) {
			var openBranch = this.openBranches[i];
			if(openBranch == removedItem) {
				if(removedItem != addedItem) {
					this.openBranches.splice(i,1);
				}
				continue;
			}
			var location = this._dataProvider.locationOf(openBranch);
			if(location == null) {
				this.openBranches.splice(i,1);
			}
			--i;
		}
	}
	,treeView_itemRenderer_touchTapHandler: function(event) {
		if(!this._enabled) {
			return;
		}
		if(event.isPrimaryTouchPoint) {
			return;
		}
		var itemRenderer = js_Boot.__cast(event.currentTarget , openfl_display_DisplayObject);
		var state = this.itemRendererToItemState.h[itemRenderer.__id__];
		feathers_events_TreeViewEvent.dispatch(this,"itemTrigger",state);
		if(!this._selectable || !this.pointerSelectionEnabled) {
			return;
		}
		this.set_selectedLocation(state.location.slice());
		if(this._selectedLocation != null) {
			this.scrollToLocation(this._selectedLocation);
		}
	}
	,treeView_itemRenderer_clickHandler: function(event) {
		if(!this._enabled) {
			return;
		}
		var itemRenderer = js_Boot.__cast(event.currentTarget , openfl_display_DisplayObject);
		var state = this.itemRendererToItemState.h[itemRenderer.__id__];
		feathers_events_TreeViewEvent.dispatch(this,"itemTrigger",state);
		if(!this._selectable || !this.pointerSelectionEnabled) {
			return;
		}
		this.set_selectedLocation(state.location.slice());
		if(this._selectedLocation != null) {
			this.scrollToLocation(this._selectedLocation);
		}
	}
	,treeView_itemRenderer_triggerHandler: function(event) {
		if(!this._enabled) {
			return;
		}
		var itemRenderer = js_Boot.__cast(event.currentTarget , openfl_display_DisplayObject);
		var state = this.itemRendererToItemState.h[itemRenderer.__id__];
		feathers_events_TreeViewEvent.dispatch(this,"itemTrigger",state);
		if(!this._selectable || !this.pointerSelectionEnabled) {
			return;
		}
		this.set_selectedLocation(state.location.slice());
		if(this._selectedLocation != null) {
			this.scrollToLocation(this._selectedLocation);
		}
	}
	,treeView_itemRenderer_resizeHandler: function(event) {
		if(this._validating) {
			return;
		}
		this.setInvalid(feathers_core_InvalidationFlag.LAYOUT);
	}
	,treeView_itemRenderer_changeHandler: function(event) {
		if(this._ignoreSelectionChange) {
			return;
		}
		var itemRenderer = js_Boot.__cast(event.currentTarget , openfl_display_DisplayObject);
		var toggleItemRenderer = js_Boot.__cast(itemRenderer , feathers_controls_IToggle);
		var state = this.itemRendererToItemState.h[itemRenderer.__id__];
		if(toggleItemRenderer.get_selected() == state.selected) {
			return;
		}
		this.setInvalid(feathers_core_InvalidationFlag.SELECTION);
	}
	,treeView_itemRenderer_openHandler: function(event) {
		if(this._ignoreOpenedChange) {
			return;
		}
		var itemRenderer = js_Boot.__cast(event.currentTarget , openfl_display_DisplayObject);
		var state = this.itemRendererToItemState.h[itemRenderer.__id__];
		this.toggleBranch(state.data,true);
	}
	,treeView_itemRenderer_closeHandler: function(event) {
		if(this._ignoreOpenedChange) {
			return;
		}
		var itemRenderer = js_Boot.__cast(event.currentTarget , openfl_display_DisplayObject);
		var state = this.itemRendererToItemState.h[itemRenderer.__id__];
		this.toggleBranch(state.data,false);
	}
	,treeView_dataProvider_changeHandler: function(event) {
		this._totalLayoutCount = this.calculateTotalLayoutCount([]);
		if(this._virtualCache != null) {
			this._virtualCache.length = 0;
			this._virtualCache.length = this._totalLayoutCount;
		}
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
	}
	,treeView_dataProvider_addItemHandler: function(event) {
		if(this._selectedLocation == null) {
			return;
		}
		if(this.compareLocations(this._selectedLocation,event.location) >= 0) {
			this.set_selectedLocation(this._dataProvider.locationOf(this._selectedItem));
		}
	}
	,treeView_dataProvider_removeItemHandler: function(event) {
		this.refreshOpenBranchesFromDataProviderChange(event.removedItem,event.addedItem);
		if(this._selectedLocation != null) {
			if(this.containsLocation(event.location,this._selectedLocation)) {
				this.set_selectedLocation(null);
			} else {
				var comparisonResult = this.compareLocations(this._selectedLocation,event.location);
				if(comparisonResult == 0) {
					this.set_selectedLocation(null);
				} else if(comparisonResult > 0) {
					this.set_selectedLocation(this._dataProvider.locationOf(this._selectedItem));
				}
			}
		}
	}
	,treeView_dataProvider_replaceItemHandler: function(event) {
		this.refreshOpenBranchesFromDataProviderChange(event.removedItem,event.addedItem);
		if(this._selectedLocation != null) {
			if(this.containsLocation(event.location,this._selectedLocation)) {
				this.set_selectedLocation(null);
			} else if(this.compareLocations(this._selectedLocation,event.location) == 0) {
				this._selectedItem = this._dataProvider.get(event.location);
				feathers_events_FeathersEvent.dispatch(this,"change");
			}
		}
	}
	,treeView_dataProvider_removeAllHandler: function(event) {
		this.openBranches.length = 0;
		this.set_selectedLocation(null);
	}
	,treeView_dataProvider_resetHandler: function(event) {
		this.openBranches.length = 0;
		this.set_selectedLocation(null);
	}
	,treeView_dataProvider_sortChangeHandler: function(event) {
		this.refreshSelectedLocationAfterFilterOrSort();
	}
	,treeView_dataProvider_filterChangeHandler: function(event) {
		this.refreshSelectedLocationAfterFilterOrSort();
	}
	,updateItemRendererForLocation: function(location) {
		var layoutIndex = this.locationToDisplayIndex(location,false);
		if(this._virtualCache != null && layoutIndex != -1) {
			this._virtualCache[layoutIndex] = null;
		}
		var item = this._dataProvider.get(location);
		var itemRenderer = null;
		if(typeof(item) == "string") {
			itemRenderer = this.stringDataToItemRenderer.h[item];
		} else {
			itemRenderer = this.objectDataToItemRenderer.h[item.__id__];
		}
		if(itemRenderer == null) {
			this.setInvalid(feathers_core_InvalidationFlag.DATA);
		} else {
			var state = this.itemRendererToItemState.h[itemRenderer.__id__];
			if(state.owner != null) {
				var storage = this.itemStateToStorage(state);
				this.populateCurrentItemState(item,location,layoutIndex,state,true);
				this.resetItemRenderer(itemRenderer,state,storage);
				if(storage.measurements != null) {
					storage.measurements.restore(itemRenderer);
				}
				state.owner = null;
				this.setInvalid(feathers_core_InvalidationFlag.DATA);
			}
		}
		if(this._dataProvider.isBranch(item)) {
			var _g = 0;
			var _g1 = this._dataProvider.getLength(location);
			while(_g < _g1) {
				var i = _g++;
				location.push(i);
				this.updateItemRendererForLocation(location);
				location.pop();
			}
		}
	}
	,treeView_dataProvider_updateItemHandler: function(event) {
		this.updateItemRendererForLocation(event.location);
	}
	,treeView_dataProvider_updateAllHandler: function(event) {
		var location = [];
		var _g = 0;
		var _g1 = this._dataProvider.getLength();
		while(_g < _g1) {
			var i = _g++;
			location[0] = i;
			this.updateItemRendererForLocation(location);
		}
	}
	,get_styleContext: function() {
		return feathers_controls_TreeView;
	}
	,__layout: null
	,get_layout: function() {
		return this.__layout;
	}
	,set_layout: function(value) {
		if(!this.setStyle("layout")) {
			return this.__layout;
		}
		if(this.__layout == value) {
			return this.__layout;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_layout);
		this.__layout = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__layout;
	}
	,clearStyle_layout: function() {
		this.set_layout(null);
		return this.get_layout();
	}
	,__customItemRendererVariant: null
	,get_customItemRendererVariant: function() {
		return this.__customItemRendererVariant;
	}
	,set_customItemRendererVariant: function(value) {
		if(!this.setStyle("customItemRendererVariant")) {
			return this.__customItemRendererVariant;
		}
		if(this.__customItemRendererVariant == value) {
			return this.__customItemRendererVariant;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_customItemRendererVariant);
		this.__customItemRendererVariant = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__customItemRendererVariant;
	}
	,clearStyle_customItemRendererVariant: function() {
		this.set_customItemRendererVariant(null);
		return this.get_customItemRendererVariant();
	}
	,__class__: feathers_controls_TreeView
	,__properties__: $extend(feathers_controls_supportClasses_BaseScrollContainer.prototype.__properties__,{set_virtualLayout:"set_virtualLayout",get_virtualLayout:"get_virtualLayout",set_selectable:"set_selectable",get_selectable:"get_selectable",set_itemRendererRecyclerIDFunction:"set_itemRendererRecyclerIDFunction",get_itemRendererRecyclerIDFunction:"get_itemRendererRecyclerIDFunction",set_forceItemStateUpdate:"set_forceItemStateUpdate",get_forceItemStateUpdate:"get_forceItemStateUpdate",set_itemRendererRecycler:"set_itemRendererRecycler",get_itemRendererRecycler:"get_itemRendererRecycler",set_customItemRendererVariant:"set_customItemRendererVariant",get_customItemRendererVariant:"get_customItemRendererVariant",set_layout:"set_layout",get_layout:"get_layout",set_selectedItem:"set_selectedItem",get_selectedItem:"get_selectedItem",set_selectedLocation:"set_selectedLocation",get_selectedLocation:"get_selectedLocation",set_dataProvider:"set_dataProvider",get_dataProvider:"get_dataProvider",set_childFocusEnabled:"set_childFocusEnabled",get_childFocusEnabled:"get_childFocusEnabled"})
});
var feathers_controls__$TreeView_ItemRendererStorage = function(id,recycler) {
	this.inactiveItemRenderers = [];
	this.activeItemRenderers = [];
	this.id = id;
	this.itemRendererRecycler = recycler;
};
$hxClasses["feathers.controls._TreeView.ItemRendererStorage"] = feathers_controls__$TreeView_ItemRendererStorage;
feathers_controls__$TreeView_ItemRendererStorage.__name__ = "feathers.controls._TreeView.ItemRendererStorage";
feathers_controls__$TreeView_ItemRendererStorage.prototype = {
	id: null
	,oldItemRendererRecycler: null
	,itemRendererRecycler: null
	,activeItemRenderers: null
	,inactiveItemRenderers: null
	,measurements: null
	,__class__: feathers_controls__$TreeView_ItemRendererStorage
};
var feathers_controls_VProgressBar = function(value,minimum,maximum,changeListener) {
	if(maximum == null) {
		maximum = 1.0;
	}
	if(minimum == null) {
		minimum = 0.0;
	}
	if(value == null) {
		value = 0.0;
	}
	this.initializeVProgressBarTheme();
	feathers_controls_supportClasses_BaseProgressBar.call(this,value,minimum,maximum,changeListener);
};
$hxClasses["feathers.controls.VProgressBar"] = feathers_controls_VProgressBar;
feathers_controls_VProgressBar.__name__ = "feathers.controls.VProgressBar";
feathers_controls_VProgressBar.__super__ = feathers_controls_supportClasses_BaseProgressBar;
feathers_controls_VProgressBar.prototype = $extend(feathers_controls_supportClasses_BaseProgressBar.prototype,{
	_currentMask: null
	,initializeVProgressBarTheme: function() {
		feathers_themes_steel_components_SteelVProgressBarStyles.initialize();
	}
	,measure: function() {
		var needsWidth = this.get_explicitWidth() == null;
		var needsHeight = this.get_explicitHeight() == null;
		var needsMinWidth = this.get_explicitMinWidth() == null;
		var needsMinHeight = this.get_explicitMinHeight() == null;
		var needsMaxWidth = this.get_explicitMaxWidth() == null;
		var needsMaxHeight = this.get_explicitMaxHeight() == null;
		if(!needsWidth && !needsHeight && !needsMinWidth && !needsMinHeight && !needsMaxWidth && !needsMaxHeight) {
			return false;
		}
		if(this._backgroundSkinMeasurements != null) {
			feathers_utils_MeasurementsUtil.resetFluidlyWithParent(this._backgroundSkinMeasurements,this._currentBackgroundSkin,this);
		}
		var measureBackgroundSkin = null;
		if(js_Boot.__implements(this._currentBackgroundSkin,feathers_core_IMeasureObject)) {
			measureBackgroundSkin = this._currentBackgroundSkin;
		}
		if(js_Boot.__implements(this._currentBackgroundSkin,feathers_core_IValidating)) {
			this._currentBackgroundSkin.validateNow();
		}
		var newWidth = this.get_explicitWidth();
		if(needsWidth) {
			if(this._currentBackgroundSkin != null) {
				newWidth = this._backgroundSkinMeasurements.width;
			} else {
				newWidth = 0.0;
			}
		}
		var newHeight = this.get_explicitHeight();
		if(needsHeight) {
			if(this._currentBackgroundSkin != null) {
				newHeight = this._backgroundSkinMeasurements.height;
			} else {
				newHeight = 0.0;
			}
		}
		var newMinWidth = this.get_explicitMinWidth();
		var needsMinWidth1 = needsMinWidth;
		var newMinHeight = this.get_explicitMinHeight();
		var needsMinHeight1 = needsMinHeight;
		var newMaxWidth = this.get_explicitMaxWidth();
		var needsMaxWidth1 = needsMaxWidth;
		var newMaxHeight = this.get_explicitMaxHeight();
		var needsMaxHeight1 = needsMaxHeight;
		return this.saveMeasurements(newWidth,newHeight,newMinWidth,newMinHeight,newMaxWidth,newMaxHeight);
	}
	,layoutBackground: function() {
		if(this._currentBackgroundSkin == null) {
			return;
		}
		this._currentBackgroundSkin.set_x(0.0);
		this._currentBackgroundSkin.set_y(0.0);
		if(this._currentBackgroundSkin.get_width() != this.actualWidth) {
			this._currentBackgroundSkin.set_width(this.actualWidth);
		}
		if(this._currentBackgroundSkin.get_height() != this.actualHeight) {
			this._currentBackgroundSkin.set_height(this.actualHeight);
		}
		if(js_Boot.__implements(this._currentBackgroundSkin,feathers_core_IValidating)) {
			this._currentBackgroundSkin.validateNow();
		}
	}
	,layoutFill: function() {
		if(this._currentFillSkin == null) {
			return;
		}
		var percentage = 1.0;
		if(this._minimum != this._maximum) {
			percentage = (this._value - this._minimum) / (this._maximum - this._minimum);
			if(percentage < 0.0) {
				percentage = 0.0;
			} else if(percentage > 1.0) {
				percentage = 1.0;
			}
		}
		var maxHeight = this.actualHeight - this.get_paddingTop() - this.get_paddingBottom();
		var calculatedHeight = this._indeterminate ? maxHeight : Math.round(percentage * maxHeight);
		this._currentFillSkin.set_x(this.get_paddingLeft());
		this._currentFillSkin.set_width(this.actualWidth - this.get_paddingLeft() - this.get_paddingRight());
		switch(this.get_fillMode()._hx_index) {
		case 0:
			this._currentFillSkin.set_scrollRect(null);
			if(this._currentMask == null) {
				this._currentMask = new feathers_skins_RectangleSkin(feathers_graphics_FillStyle.SolidColor(16711935));
				this.addChild(this._currentMask);
			}
			this._currentFillSkin.set_mask(this._currentMask);
			this._currentFillSkin.set_y(this.get_paddingTop());
			this._currentFillSkin.set_height(this.actualHeight - this.get_paddingTop() - this.get_paddingBottom());
			this._currentMask.set_x(this._currentFillSkin.get_x());
			this._currentMask.set_y(this.actualHeight - this.get_paddingBottom() - calculatedHeight);
			this._currentMask.set_width(this._currentFillSkin.get_width());
			this._currentMask.set_height(calculatedHeight);
			break;
		case 1:
			this._currentFillSkin.set_y(this.actualHeight - this.get_paddingBottom() - calculatedHeight);
			this._currentFillSkin.set_height(this.actualHeight - this.get_paddingTop() - this.get_paddingBottom());
			this._currentFillSkin.set_scrollRect(new openfl_geom_Rectangle(0.0,this._currentFillSkin.get_height() - calculatedHeight,this._currentFillSkin.get_width(),calculatedHeight));
			break;
		case 2:
			this._currentFillSkin.set_mask(null);
			this._currentFillSkin.set_scrollRect(null);
			if(this._currentMask != null) {
				if(this._currentMask.parent == this) {
					this.removeChild(this._currentMask);
				}
				this._currentMask = null;
			}
			if(this._fillSkinMeasurements.minHeight != null && calculatedHeight < this._fillSkinMeasurements.minHeight) {
				calculatedHeight = this._fillSkinMeasurements.minHeight;
				this._currentFillSkin.set_visible(this._value > this._minimum);
			} else {
				this._currentFillSkin.set_visible(true);
			}
			this._currentFillSkin.set_y(this.actualHeight - this.get_paddingBottom() - calculatedHeight);
			this._currentFillSkin.set_height(calculatedHeight);
			break;
		}
		if(js_Boot.__implements(this._currentFillSkin,feathers_core_IValidating)) {
			this._currentFillSkin.validateNow();
		}
	}
	,get_styleContext: function() {
		return feathers_controls_VProgressBar;
	}
	,__class__: feathers_controls_VProgressBar
});
var feathers_controls_VSlider = function(value,minimum,maximum,changeListener) {
	if(maximum == null) {
		maximum = 1.0;
	}
	if(minimum == null) {
		minimum = 0.0;
	}
	if(value == null) {
		value = 0.0;
	}
	this.initializeVSliderTheme();
	feathers_controls_supportClasses_BaseSlider.call(this,value,minimum,maximum,changeListener);
	this.addEventListener("keyDown",$bind(this,this.vSlider_keyDownHandler));
};
$hxClasses["feathers.controls.VSlider"] = feathers_controls_VSlider;
feathers_controls_VSlider.__name__ = "feathers.controls.VSlider";
feathers_controls_VSlider.__super__ = feathers_controls_supportClasses_BaseSlider;
feathers_controls_VSlider.prototype = $extend(feathers_controls_supportClasses_BaseSlider.prototype,{
	initializeVSliderTheme: function() {
		feathers_themes_steel_components_SteelVSliderStyles.initialize();
	}
	,valueToLocation: function(value) {
		if(js_Boot.__implements(this._currentThumbSkin,feathers_core_IValidating)) {
			this._currentThumbSkin.validateNow();
		}
		var normalized = this.normalizeValue(value);
		var trackScrollableHeight = this.actualHeight - this.get_minimumPadding() - this.get_maximumPadding();
		if(this._currentThumbSkin != null) {
			trackScrollableHeight -= this._currentThumbSkin.get_height();
		}
		return Math.round(this.get_maximumPadding() + trackScrollableHeight * (1.0 - normalized));
	}
	,locationToValue: function(x,y) {
		var percentage = 0.0;
		var trackScrollableHeight = this.actualHeight - this.get_minimumPadding() - this.get_maximumPadding();
		if(this._currentThumbSkin != null) {
			trackScrollableHeight -= this._currentThumbSkin.get_height();
		}
		var yOffset = y - this._pointerStartY - this.get_maximumPadding();
		var yPosition = Math.min(Math.max(0.0,this._thumbStartY + yOffset),trackScrollableHeight);
		percentage = 1.0 - yPosition / trackScrollableHeight;
		return this._minimum + percentage * (this._maximum - this._minimum);
	}
	,measure: function() {
		var needsWidth = this.get_explicitWidth() == null;
		var needsHeight = this.get_explicitHeight() == null;
		var needsMinWidth = this.get_explicitMinWidth() == null;
		var needsMinHeight = this.get_explicitMinHeight() == null;
		var needsMaxWidth = this.get_explicitMaxWidth() == null;
		var needsMaxHeight = this.get_explicitMaxHeight() == null;
		if(!needsWidth && !needsHeight && !needsMinWidth && !needsMinHeight && !needsMaxWidth && !needsMaxHeight) {
			return false;
		}
		if(this._currentThumbSkin != null) {
			this._thumbSkinMeasurements.restore(this._currentThumbSkin);
			if(js_Boot.__implements(this._currentThumbSkin,feathers_core_IValidating)) {
				this._currentThumbSkin.validateNow();
			}
		}
		if(this._currentTrackSkin != null) {
			this._trackSkinMeasurements.restore(this._currentTrackSkin);
			if(js_Boot.__implements(this._currentTrackSkin,feathers_core_IValidating)) {
				this._currentTrackSkin.validateNow();
			}
		}
		if(this._currentSecondaryTrackSkin != null) {
			this._secondaryTrackSkinMeasurements.restore(this._currentSecondaryTrackSkin);
			if(js_Boot.__implements(this._currentSecondaryTrackSkin,feathers_core_IValidating)) {
				this._currentSecondaryTrackSkin.validateNow();
			}
		}
		var newWidth = this.get_explicitWidth();
		if(needsWidth) {
			newWidth = 0.0;
			if(this._currentThumbSkin != null) {
				newWidth += this._currentThumbSkin.get_width();
			}
			if(this._currentTrackSkin != null) {
				if(newWidth < this._currentTrackSkin.get_width()) {
					newWidth = this._currentTrackSkin.get_width();
				}
				if(this._currentSecondaryTrackSkin != null && newWidth < this._currentSecondaryTrackSkin.get_width()) {
					newWidth = this._currentSecondaryTrackSkin.get_width();
				}
			}
		}
		var newHeight = this.get_explicitHeight();
		if(needsHeight) {
			newHeight = 0.0;
			if(this._currentTrackSkin != null) {
				newHeight += this._currentTrackSkin.get_height();
				if(this._currentSecondaryTrackSkin != null) {
					newHeight += this._currentSecondaryTrackSkin.get_height();
				}
			}
		}
		var newMinWidth = this.get_explicitMinWidth();
		if(needsMinWidth) {
			newMinWidth = 0.0;
			if(this._currentThumbSkin != null) {
				newMinWidth += this._currentThumbSkin.get_width();
			}
			if(this._currentTrackSkin != null) {
				if(newMinWidth < this._currentTrackSkin.get_width()) {
					newMinWidth = this._currentTrackSkin.get_width();
				}
				if(this._currentSecondaryTrackSkin != null && newMinWidth < this._currentSecondaryTrackSkin.get_width()) {
					newMinWidth = this._currentSecondaryTrackSkin.get_width();
				}
			}
		}
		var newMinHeight = this.get_explicitMinHeight();
		if(needsMinHeight) {
			newMinHeight = 0.0;
			if(this._currentTrackSkin != null) {
				newMinHeight += this._currentTrackSkin.get_height();
				if(this._currentSecondaryTrackSkin != null) {
					newMinHeight += this._secondaryTrackSkinMeasurements.height;
				}
			}
		}
		return this.saveMeasurements(newWidth,newHeight,newMinWidth,newMinHeight);
	}
	,saveThumbStart: function(x,y) {
		var trackHeightMinusThumbHeight = this.actualHeight;
		var locationMinusHalfThumbHeight = y;
		if(this._currentThumbSkin != null) {
			trackHeightMinusThumbHeight -= this._currentThumbSkin.get_height();
			locationMinusHalfThumbHeight -= this._currentThumbSkin.get_height() / 2.0;
		}
		this._thumbStartX = x;
		this._thumbStartY = Math.min(trackHeightMinusThumbHeight - this.get_maximumPadding(),Math.max(this.get_minimumPadding(),locationMinusHalfThumbHeight));
	}
	,layoutSplitTrack: function() {
		var location = this.valueToLocation(this.get_value());
		if(this._currentThumbSkin != null) {
			if(js_Boot.__implements(this._currentThumbSkin,feathers_core_IValidating)) {
				this._currentThumbSkin.validateNow();
			}
			location += Math.round(this._currentThumbSkin.get_height() / 2.0);
		}
		this._currentSecondaryTrackSkin.set_y(0.0);
		this._currentSecondaryTrackSkin.set_height(location);
		this._currentTrackSkin.set_y(location);
		this._currentTrackSkin.set_height(this.actualHeight - location);
		if(js_Boot.__implements(this._currentSecondaryTrackSkin,feathers_core_IValidating)) {
			this._currentSecondaryTrackSkin.validateNow();
		}
		if(js_Boot.__implements(this._currentTrackSkin,feathers_core_IValidating)) {
			this._currentTrackSkin.validateNow();
		}
		this._currentSecondaryTrackSkin.set_x((this.actualWidth - this._currentSecondaryTrackSkin.get_width()) / 2.0);
		this._currentTrackSkin.set_x((this.actualWidth - this._currentTrackSkin.get_width()) / 2.0);
	}
	,layoutSingleTrack: function() {
		if(this._currentTrackSkin == null) {
			return;
		}
		this._currentTrackSkin.set_y(0.0);
		this._currentTrackSkin.set_height(this.actualHeight);
		if(js_Boot.__implements(this._currentTrackSkin,feathers_core_IValidating)) {
			this._currentTrackSkin.validateNow();
		}
		this._currentTrackSkin.set_x((this.actualWidth - this._currentTrackSkin.get_width()) / 2.0);
	}
	,layoutThumb: function() {
		if(this._currentThumbSkin == null) {
			return;
		}
		var thumbLocation = this.valueToLocation(this._value);
		this._currentThumbSkin.set_x((this.actualWidth - this._currentThumbSkin.get_width()) / 2.0);
		this._currentThumbSkin.set_y(thumbLocation);
	}
	,vSlider_keyDownHandler: function(event) {
		if(event.isDefaultPrevented()) {
			return;
		}
		if(!this._enabled) {
			return;
		}
		var newValue = this._value;
		switch(event.keyCode) {
		case 35:
			newValue = this._maximum;
			break;
		case 36:
			newValue = this._minimum;
			break;
		case 38:
			newValue += this._step;
			break;
		case 40:
			newValue -= this._step;
			break;
		default:
			return;
		}
		if(newValue < this._minimum) {
			newValue = this._minimum;
		} else if(newValue > this._maximum) {
			newValue = this._maximum;
		}
		event.preventDefault();
		this.set_value(newValue);
	}
	,get_styleContext: function() {
		return feathers_controls_VSlider;
	}
	,__class__: feathers_controls_VSlider
});
var feathers_controls_dataRenderers_IDataRenderer = function() { };
$hxClasses["feathers.controls.dataRenderers.IDataRenderer"] = feathers_controls_dataRenderers_IDataRenderer;
feathers_controls_dataRenderers_IDataRenderer.__name__ = "feathers.controls.dataRenderers.IDataRenderer";
feathers_controls_dataRenderers_IDataRenderer.__isInterface__ = true;
feathers_controls_dataRenderers_IDataRenderer.__interfaces__ = [feathers_core_IUIControl];
feathers_controls_dataRenderers_IDataRenderer.prototype = {
	get_data: null
	,set_data: null
	,__class__: feathers_controls_dataRenderers_IDataRenderer
	,__properties__: {set_data:"set_data",get_data:"get_data"}
};
var feathers_data_GridViewCellState = function(data,rowIndex,columnIndex,selected,text) {
	if(selected == null) {
		selected = false;
	}
	if(columnIndex == null) {
		columnIndex = -1;
	}
	if(rowIndex == null) {
		rowIndex = -1;
	}
	this.enabled = true;
	this.selected = false;
	this.columnIndex = -1;
	this.rowIndex = -1;
	this.data = data;
	this.rowIndex = rowIndex;
	this.columnIndex = columnIndex;
	this.selected = false;
	this.text = text;
};
$hxClasses["feathers.data.GridViewCellState"] = feathers_data_GridViewCellState;
feathers_data_GridViewCellState.__name__ = "feathers.data.GridViewCellState";
feathers_data_GridViewCellState.prototype = {
	owner: null
	,data: null
	,rowIndex: null
	,columnIndex: null
	,column: null
	,selected: null
	,text: null
	,enabled: null
	,__class__: feathers_data_GridViewCellState
};
var feathers_controls_dataRenderers_GridViewRowRenderer = function() {
	this._customCellRendererVariant = null;
	this._forceCellStateUpdate = false;
	this._columns = null;
	this._data = null;
	this._rowIndex = -1;
	this._ignoreSelectionChange = false;
	this._selected = false;
	this._currentState = feathers_controls_ToggleButtonState.UP(false);
	this.cellStatePool = new lime_utils_ObjectPool(function() {
		return new feathers_data_GridViewCellState();
	});
	this._cellRendererToCellState = new haxe_ds_ObjectMap();
	this._columnToCellRenderer = new haxe_ds_ObjectMap();
	this._unrenderedData = [];
	this._additionalStorage = null;
	this._defaultStorage = new feathers_controls_dataRenderers__$GridViewRowRenderer_CellRendererStorage();
	feathers_controls_LayoutGroup.call(this);
};
$hxClasses["feathers.controls.dataRenderers.GridViewRowRenderer"] = feathers_controls_dataRenderers_GridViewRowRenderer;
feathers_controls_dataRenderers_GridViewRowRenderer.__name__ = "feathers.controls.dataRenderers.GridViewRowRenderer";
feathers_controls_dataRenderers_GridViewRowRenderer.__interfaces__ = [feathers_core_IStateContext,feathers_controls_dataRenderers_IDataRenderer,feathers_controls_IToggle,feathers_controls_ITriggerView];
feathers_controls_dataRenderers_GridViewRowRenderer.defaultUpdateCellRenderer = function(cellRenderer,state) {
	if(js_Boot.__implements(cellRenderer,feathers_core_ITextControl)) {
		var textControl = cellRenderer;
		textControl.set_text(state.text);
	}
};
feathers_controls_dataRenderers_GridViewRowRenderer.defaultResetCellRenderer = function(cellRenderer,state) {
	if(js_Boot.__implements(cellRenderer,feathers_core_ITextControl)) {
		var textControl = cellRenderer;
		textControl.set_text(null);
	}
};
feathers_controls_dataRenderers_GridViewRowRenderer.__super__ = feathers_controls_LayoutGroup;
feathers_controls_dataRenderers_GridViewRowRenderer.prototype = $extend(feathers_controls_LayoutGroup.prototype,{
	_defaultStorage: null
	,_additionalStorage: null
	,_unrenderedData: null
	,_columnToCellRenderer: null
	,_cellRendererToCellState: null
	,cellStatePool: null
	,_currentState: null
	,get_currentState: function() {
		return this._currentState;
	}
	,set_enabled: function(value) {
		feathers_controls_LayoutGroup.prototype.set_enabled.call(this,value);
		if(this._enabled) {
			var _g = this._currentState;
			if(_g._hx_index == 3) {
				var selected = _g.selected;
				this.changeState(feathers_controls_ToggleButtonState.UP(selected));
			}
		} else {
			this.changeState(feathers_controls_ToggleButtonState.DISABLED(this._selected));
		}
		return this._enabled;
	}
	,_gridView: null
	,get_gridView: function() {
		return this._gridView;
	}
	,set_gridView: function(value) {
		if(this._gridView == value) {
			return this._gridView;
		}
		if(this._gridView != null) {
			this._gridView.removeEventListener("keyDown",$bind(this,this.gridViewRowRenderer_gridView_keyDownHandler));
		}
		this._gridView = value;
		if(this._gridView != null) {
			this._gridView.addEventListener("keyDown",$bind(this,this.gridViewRowRenderer_gridView_keyDownHandler),false,0,true);
		} else {
			this.refreshInactiveCellRenderers(this._defaultStorage,true);
			if(this._additionalStorage != null) {
				var _g = 0;
				var _g1 = this._additionalStorage.length;
				while(_g < _g1) {
					var i = _g++;
					var storage = this._additionalStorage[i];
					this.refreshInactiveCellRenderers(storage,true);
				}
			}
		}
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		return this._gridView;
	}
	,_selected: null
	,get_selected: function() {
		return this._selected;
	}
	,set_selected: function(value) {
		if(this._selected == value) {
			return this._selected;
		}
		this._selected = value;
		this.setInvalid(feathers_core_InvalidationFlag.SELECTION);
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._selected;
	}
	,_ignoreSelectionChange: null
	,_rowIndex: null
	,get_rowIndex: function() {
		return this._rowIndex;
	}
	,set_rowIndex: function(value) {
		if(this._rowIndex == value) {
			return this._rowIndex;
		}
		this._rowIndex = value;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		return this._rowIndex;
	}
	,_data: null
	,get_data: function() {
		return this._data;
	}
	,set_data: function(value) {
		if(this._data == value) {
			return this._data;
		}
		this._data = value;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		return this._data;
	}
	,_columns: null
	,get_columns: function() {
		return this._columns;
	}
	,set_columns: function(value) {
		if(this._columns == value) {
			return this._columns;
		}
		if(this._columns != null) {
			this._columns.removeEventListener("change",$bind(this,this.gridViewRowRenderer_columns_changeHandler));
		}
		this._columns = value;
		if(this._columns != null) {
			this._columns.addEventListener("change",$bind(this,this.gridViewRowRenderer_columns_changeHandler),false,0,true);
		}
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		return this._columns;
	}
	,get_cellRendererRecycler: function() {
		return this._defaultStorage.cellRendererRecycler;
	}
	,set_cellRendererRecycler: function(value) {
		if(this._defaultStorage.cellRendererRecycler == value) {
			return this._defaultStorage.cellRendererRecycler;
		}
		this._defaultStorage.oldCellRendererRecycler = this._defaultStorage.cellRendererRecycler;
		this._defaultStorage.cellRendererRecycler = value;
		this._defaultStorage.measurements = null;
		this.setInvalid(feathers_controls_dataRenderers_GridViewRowRenderer.INVALIDATION_FLAG_CELL_RENDERER_FACTORY);
		return this._defaultStorage.cellRendererRecycler;
	}
	,_forceCellStateUpdate: null
	,get_forceCellStateUpdate: function() {
		return this._forceCellStateUpdate;
	}
	,set_forceCellStateUpdate: function(value) {
		if(this._forceCellStateUpdate == value) {
			return this._forceCellStateUpdate;
		}
		this._forceCellStateUpdate = value;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		return this._forceCellStateUpdate;
	}
	,_customCellRendererVariant: null
	,get_customCellRendererVariant: function() {
		return this._customCellRendererVariant;
	}
	,set_customCellRendererVariant: function(value) {
		if(this._customCellRendererVariant == value) {
			return this._customCellRendererVariant;
		}
		this._customCellRendererVariant = value;
		this.setInvalid(feathers_controls_dataRenderers_GridViewRowRenderer.INVALIDATION_FLAG_CELL_RENDERER_FACTORY);
		return this._customCellRendererVariant;
	}
	,_customColumnWidths: null
	,get_customColumnWidths: function() {
		return this._customColumnWidths;
	}
	,set_customColumnWidths: function(value) {
		if(this._customColumnWidths == value) {
			return this._customColumnWidths;
		}
		this._customColumnWidths = value;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		return this._customColumnWidths;
	}
	,_rowLayout: null
	,_pointerToState: null
	,_keyToState: null
	,dispose: function() {
		this.refreshInactiveCellRenderers(this._defaultStorage,true);
		if(this._additionalStorage != null) {
			var _g = 0;
			var _g1 = this._additionalStorage.length;
			while(_g < _g1) {
				var i = _g++;
				var storage = this._additionalStorage[i];
				this.refreshInactiveCellRenderers(storage,true);
			}
		}
		feathers_controls_LayoutGroup.prototype.dispose.call(this);
	}
	,columnToCellRenderer: function(column) {
		if(column == null) {
			return null;
		}
		return this._columnToCellRenderer.h[column.__id__];
	}
	,columnToCellState: function(column) {
		if(column == null) {
			return null;
		}
		var cellState = null;
		var cellRenderer = this._columnToCellRenderer.h[column.__id__];
		if(cellRenderer != null) {
			cellState = this._cellRendererToCellState.h[cellRenderer.__id__];
		} else {
			var columnIndex = this._columns.indexOf(column);
			if(columnIndex == -1) {
				return null;
			}
			cellState = new feathers_data_GridViewCellState();
			this.populateCurrentItemState(column,columnIndex,cellState,false);
		}
		return cellState;
	}
	,initialize: function() {
		feathers_controls_LayoutGroup.prototype.initialize.call(this);
		if(this._pointerToState == null) {
			this._pointerToState = new feathers_utils_PointerToState(this,$bind(this,this.changeState),feathers_controls_ToggleButtonState.UP(false),feathers_controls_ToggleButtonState.DOWN(false),feathers_controls_ToggleButtonState.HOVER(false));
			this._pointerToState.set_customHitTest($bind(this,this.customHitTest));
		}
		if(this._keyToState == null) {
			this._keyToState = new feathers_utils_KeyToState(this,$bind(this,this.changeState),feathers_controls_ToggleButtonState.UP(false),feathers_controls_ToggleButtonState.DOWN(false));
		}
		if(this.get_layout() == null) {
			this._rowLayout = new feathers_layout_GridViewRowLayout();
			this.set_layout(this._rowLayout);
		}
	}
	,changeState: function(state) {
		var toggleState = state;
		if(!this._enabled) {
			toggleState = feathers_controls_ToggleButtonState.DISABLED(this._selected);
		}
		switch(toggleState._hx_index) {
		case 0:
			var selected = toggleState.selected;
			if(this._selected != selected) {
				toggleState = feathers_controls_ToggleButtonState.UP(this._selected);
			}
			break;
		case 1:
			var selected = toggleState.selected;
			if(this._selected != selected) {
				toggleState = feathers_controls_ToggleButtonState.HOVER(this._selected);
			}
			break;
		case 2:
			var selected = toggleState.selected;
			if(this._selected != selected) {
				toggleState = feathers_controls_ToggleButtonState.DOWN(this._selected);
			}
			break;
		case 3:
			var selected = toggleState.selected;
			if(this._selected != selected) {
				toggleState = feathers_controls_ToggleButtonState.DISABLED(this._selected);
			}
			break;
		}
		if(this._currentState == toggleState) {
			return;
		}
		this._currentState = toggleState;
		this.setInvalid(feathers_core_InvalidationFlag.STATE);
		feathers_events_FeathersEvent.dispatch(this,"stateChange");
	}
	,addCurrentBackgroundSkin: function(skin) {
		if(skin == null) {
			feathers_controls_LayoutGroup.prototype.addCurrentBackgroundSkin.call(this,skin);
			return;
		}
		if(js_Boot.__implements(skin,feathers_core_IStateObserver)) {
			skin.set_stateContext(this);
		}
		feathers_controls_LayoutGroup.prototype.addCurrentBackgroundSkin.call(this,skin);
	}
	,removeCurrentBackgroundSkin: function(skin) {
		if(skin == null) {
			feathers_controls_LayoutGroup.prototype.removeCurrentBackgroundSkin.call(this,skin);
			return;
		}
		if(js_Boot.__implements(skin,feathers_core_IStateObserver)) {
			skin.set_stateContext(null);
		}
		feathers_controls_LayoutGroup.prototype.removeCurrentBackgroundSkin.call(this,skin);
	}
	,updateCells: function() {
		var _g = 0;
		var _g1 = this._columns.get_length();
		while(_g < _g1) {
			var i = _g++;
			this.updateCellRendererForColumnIndex(i);
		}
	}
	,update: function() {
		this.preLayout();
		feathers_controls_LayoutGroup.prototype.update.call(this);
	}
	,preLayout: function() {
		this._rowLayout.set_columns(this._columns);
		this._rowLayout.set_customColumnWidths(this._customColumnWidths);
		if(this._defaultStorage.cellRendererRecycler.update == null) {
			this._defaultStorage.cellRendererRecycler.update = feathers_controls_dataRenderers_GridViewRowRenderer.defaultUpdateCellRenderer;
			if(this._defaultStorage.cellRendererRecycler.reset == null) {
				this._defaultStorage.cellRendererRecycler.reset = feathers_controls_dataRenderers_GridViewRowRenderer.defaultResetCellRenderer;
			}
		}
		var column = this._columns.iterator();
		while(column.hasNext()) {
			var column1 = column.next();
			if(column1.cellRendererRecycler != null) {
				if(column1.cellRendererRecycler.update == null) {
					column1.cellRendererRecycler.update = feathers_controls_dataRenderers_GridViewRowRenderer.defaultUpdateCellRenderer;
					if(column1.cellRendererRecycler.reset == null) {
						column1.cellRendererRecycler.reset = feathers_controls_dataRenderers_GridViewRowRenderer.defaultResetCellRenderer;
					}
				}
			}
		}
		this.refreshInactiveCellRenderers(this._defaultStorage,false);
		if(this._additionalStorage != null) {
			var _g = 0;
			var _g1 = this._additionalStorage.length;
			while(_g < _g1) {
				var i = _g++;
				var storage = this._additionalStorage[i];
				this.refreshInactiveCellRenderers(storage,false);
			}
		}
		this.findUnrenderedData();
		this.recoverInactiveCellRenderers(this._defaultStorage);
		if(this._additionalStorage != null) {
			var _g = 0;
			var _g1 = this._additionalStorage.length;
			while(_g < _g1) {
				var i = _g++;
				var storage = this._additionalStorage[i];
				this.recoverInactiveCellRenderers(storage);
			}
		}
		this.renderUnrenderedData();
		this.freeInactiveCellRenderers(this._defaultStorage);
		if(this._additionalStorage != null) {
			var _g = 0;
			var _g1 = this._additionalStorage.length;
			while(_g < _g1) {
				var i = _g++;
				var storage = this._additionalStorage[i];
				this.freeInactiveCellRenderers(storage);
			}
		}
		if(this._defaultStorage.inactiveCellRenderers.length > 0) {
			var c = js_Boot.getClass(this);
			throw new openfl_errors_IllegalOperationError("" + c.__name__ + ": inactive cell renderers should be empty after updating.");
		}
		if(this._additionalStorage != null) {
			var _g = 0;
			var _g1 = this._additionalStorage.length;
			while(_g < _g1) {
				var i = _g++;
				var storage = this._additionalStorage[i];
				if(storage.inactiveCellRenderers.length > 0) {
					var c = js_Boot.getClass(this);
					throw new openfl_errors_IllegalOperationError("" + c.__name__ + ": inactive cell renderers should be empty after updating.");
				}
			}
		}
	}
	,refreshInactiveCellRenderers: function(storage,forceCleanup) {
		var temp = storage.inactiveCellRenderers;
		storage.inactiveCellRenderers = storage.activeCellRenderers;
		storage.activeCellRenderers = temp;
		if(storage.activeCellRenderers.length > 0) {
			var c = js_Boot.getClass(this);
			throw new openfl_errors_IllegalOperationError("" + c.__name__ + ": active cell renderers should be empty before updating.");
		}
		if(forceCleanup) {
			this.recoverInactiveCellRenderers(storage);
			this.freeInactiveCellRenderers(storage);
			storage.oldCellRendererRecycler = null;
		}
	}
	,findUnrenderedData: function() {
		var currentChildIndex = 0;
		var _g = 0;
		var _g1 = this._columns.get_length();
		while(_g < _g1) {
			var i = _g++;
			var column = this._columns.get(i);
			var cellRenderer = this._columnToCellRenderer.h[column.__id__];
			if(cellRenderer != null) {
				var storage = this.cellRendererRecyclerToStorage(column.cellRendererRecycler);
				var state = this._cellRendererToCellState.h[cellRenderer.__id__];
				var changed = this.populateCurrentItemState(column,i,state,this._forceCellStateUpdate);
				if(changed) {
					this.updateCellRenderer(cellRenderer,state,storage);
				}
				this.setChildIndex(cellRenderer,currentChildIndex);
				var removed = HxOverrides.remove(storage.inactiveCellRenderers,cellRenderer);
				if(!removed) {
					var c = js_Boot.getClass(this);
					throw new openfl_errors_IllegalOperationError("" + c.__name__ + ": cell renderer map contains bad data for item at row index " + this._rowIndex + " and column index " + i + ". This may be caused by duplicate items in the data provider, which is not allowed.");
				}
				storage.activeCellRenderers.push(cellRenderer);
				++currentChildIndex;
			} else {
				this._unrenderedData.push(i);
			}
		}
	}
	,cellRendererRecyclerToStorage: function(recycler) {
		if(recycler == null) {
			return this._defaultStorage;
		}
		if(this._additionalStorage == null) {
			this._additionalStorage = [];
		}
		var _g = 0;
		var _g1 = this._additionalStorage.length;
		while(_g < _g1) {
			var i = _g++;
			var storage = this._additionalStorage[i];
			if(storage.cellRendererRecycler == recycler) {
				return storage;
			}
		}
		var storage = new feathers_controls_dataRenderers__$GridViewRowRenderer_CellRendererStorage(recycler);
		this._additionalStorage.push(storage);
		return storage;
	}
	,recoverInactiveCellRenderers: function(storage) {
		var _g = 0;
		var _g1 = storage.inactiveCellRenderers;
		while(_g < _g1.length) {
			var cellRenderer = _g1[_g];
			++_g;
			if(cellRenderer == null) {
				continue;
			}
			var state = this._cellRendererToCellState.h[cellRenderer.__id__];
			if(state == null) {
				continue;
			}
			var column = state.column;
			this._cellRendererToCellState.remove(cellRenderer);
			this._columnToCellRenderer.remove(column);
			cellRenderer.removeEventListener("click",$bind(this,this.gridViewRowRenderer_cellRenderer_clickHandler));
			cellRenderer.removeEventListener("touchTap",$bind(this,this.gridViewRowRenderer_cellRenderer_touchTapHandler));
			cellRenderer.removeEventListener("trigger",$bind(this,this.gridViewRowRenderer_cellRenderer_triggerHandler));
			cellRenderer.removeEventListener("change",$bind(this,this.gridViewRowRenderer_cellRenderer_changeHandler));
			this.resetCellRenderer(cellRenderer,state,storage);
			if(storage.measurements != null) {
				storage.measurements.restore(cellRenderer);
			}
			this.cellStatePool.release(state);
		}
	}
	,renderUnrenderedData: function() {
		var _g = 0;
		var _g1 = this._unrenderedData;
		while(_g < _g1.length) {
			var columnIndex = _g1[_g];
			++_g;
			var column = this._columns.get(columnIndex);
			var state = this.cellStatePool.get();
			this.populateCurrentItemState(column,columnIndex,state,true);
			var cellRenderer = this.createCellRenderer(state);
			this.addChildAt(cellRenderer,columnIndex);
		}
		this._unrenderedData.length = 0;
	}
	,freeInactiveCellRenderers: function(storage) {
		var cellRendererRecycler = storage.oldCellRendererRecycler != null ? storage.oldCellRendererRecycler : storage.cellRendererRecycler;
		var _g = 0;
		var _g1 = storage.inactiveCellRenderers;
		while(_g < _g1.length) {
			var cellRenderer = _g1[_g];
			++_g;
			if(cellRenderer == null) {
				continue;
			}
			this.destroyCellRenderer(cellRenderer,cellRendererRecycler);
		}
		storage.inactiveCellRenderers.length = 0;
	}
	,createCellRenderer: function(state) {
		var column = state.column;
		var cellRenderer = null;
		var storage = this.cellRendererRecyclerToStorage(column.cellRendererRecycler);
		if(storage.inactiveCellRenderers.length == 0) {
			cellRenderer = storage.cellRendererRecycler.create();
			if(js_Boot.__implements(cellRenderer,feathers_style_IVariantStyleObject)) {
				var variantCellRenderer = cellRenderer;
				if(variantCellRenderer.get_variant() == null) {
					var variant = this.get_customCellRendererVariant() != null ? this.get_customCellRendererVariant() : feathers_controls_GridView.CHILD_VARIANT_CELL_RENDERER;
					variantCellRenderer.set_variant(variant);
				}
			}
			if(js_Boot.__implements(cellRenderer,feathers_core_IUIControl)) {
				cellRenderer.initializeNow();
			}
			if(storage.measurements == null) {
				storage.measurements = new feathers_layout_Measurements(cellRenderer);
			}
		} else {
			cellRenderer = storage.inactiveCellRenderers.shift();
		}
		var storage = this.cellRendererRecyclerToStorage(column.cellRendererRecycler);
		this.updateCellRenderer(cellRenderer,state,storage);
		if(js_Boot.__implements(cellRenderer,feathers_controls_ITriggerView)) {
			cellRenderer.addEventListener("trigger",$bind(this,this.gridViewRowRenderer_cellRenderer_triggerHandler));
		} else {
			cellRenderer.addEventListener("click",$bind(this,this.gridViewRowRenderer_cellRenderer_clickHandler));
			cellRenderer.addEventListener("touchTap",$bind(this,this.gridViewRowRenderer_cellRenderer_touchTapHandler));
		}
		if(js_Boot.__implements(cellRenderer,feathers_controls_IToggle)) {
			cellRenderer.addEventListener("change",$bind(this,this.gridViewRowRenderer_cellRenderer_changeHandler));
		}
		if(js_Boot.__implements(cellRenderer,feathers_core_IMeasureObject)) {
			cellRenderer.addEventListener("resize",$bind(this,this.gridViewRowRenderer_cellRenderer_resizeHandler));
		}
		this._cellRendererToCellState.set(cellRenderer,state);
		this._columnToCellRenderer.set(column,cellRenderer);
		storage.activeCellRenderers.push(cellRenderer);
		return cellRenderer;
	}
	,destroyCellRenderer: function(cellRenderer,cellRendererRecycler) {
		this.removeChild(cellRenderer);
		if(cellRendererRecycler != null && cellRendererRecycler.destroy != null) {
			cellRendererRecycler.destroy(cellRenderer);
		}
	}
	,updateCellRendererForColumnIndex: function(columnIndex) {
		var column = this._columns.get(columnIndex);
		var cellRenderer = this._columnToCellRenderer.h[column.__id__];
		if(cellRenderer == null) {
			this.setInvalid(feathers_core_InvalidationFlag.DATA);
			return;
		}
		var storage = this.cellRendererRecyclerToStorage(column.cellRendererRecycler);
		var state = this._cellRendererToCellState.h[cellRenderer.__id__];
		if(state.owner == null) {
			return;
		}
		this.populateCurrentItemState(column,columnIndex,state,true);
		this.resetCellRenderer(cellRenderer,state,storage);
		state.owner = null;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
	}
	,populateCurrentItemState: function(column,columnIndex,state,force) {
		var changed = false;
		if(force || state.owner != this._gridView) {
			state.owner = this._gridView;
			changed = true;
		}
		if(force || state.data != this._data) {
			state.data = this._data;
			changed = true;
		}
		if(force || state.rowIndex != this._rowIndex) {
			state.rowIndex = this._rowIndex;
			changed = true;
		}
		if(force || state.columnIndex != columnIndex) {
			state.columnIndex = columnIndex;
			changed = true;
		}
		if(force || state.column != column) {
			state.column = column;
			changed = true;
		}
		if(force || state.selected != this._selected) {
			state.selected = this._selected;
			changed = true;
		}
		if(force || state.enabled != this._enabled) {
			state.enabled = this._enabled;
			changed = true;
		}
		var text = this._rowIndex != -1 ? column.itemToText(this._data) : null;
		if(force || state.text != text) {
			state.text = text;
			changed = true;
		}
		return changed;
	}
	,updateCellRenderer: function(cellRenderer,state,storage) {
		var oldIgnoreSelectionChange = this._ignoreSelectionChange;
		this._ignoreSelectionChange = true;
		if(storage.cellRendererRecycler.update != null) {
			storage.cellRendererRecycler.update(cellRenderer,state);
		}
		this._ignoreSelectionChange = oldIgnoreSelectionChange;
		this.refreshCellRendererProperties(cellRenderer,state);
	}
	,resetCellRenderer: function(cellRenderer,state,storage) {
		var oldIgnoreSelectionChange = this._ignoreSelectionChange;
		this._ignoreSelectionChange = true;
		var recycler = storage.oldCellRendererRecycler != null ? storage.oldCellRendererRecycler : storage.cellRendererRecycler;
		if(recycler != null && recycler.reset != null) {
			recycler.reset(cellRenderer,state);
		}
		this._ignoreSelectionChange = oldIgnoreSelectionChange;
		this.refreshCellRendererProperties(cellRenderer,feathers_controls_dataRenderers_GridViewRowRenderer.RESET_CELL_STATE);
	}
	,refreshCellRendererProperties: function(cellRenderer,state) {
		var oldIgnoreSelectionChange = this._ignoreSelectionChange;
		this._ignoreSelectionChange = true;
		if(js_Boot.__implements(cellRenderer,feathers_core_IUIControl)) {
			var uiControl = cellRenderer;
			uiControl.set_enabled(state.enabled);
		}
		if(js_Boot.__implements(cellRenderer,feathers_controls_dataRenderers_IDataRenderer)) {
			var dataRenderer = cellRenderer;
			dataRenderer.set_data(state.data);
		}
		if(js_Boot.__implements(cellRenderer,feathers_controls_IToggle)) {
			var toggle = cellRenderer;
			toggle.set_selected(state.selected);
		}
		if(js_Boot.__implements(cellRenderer,feathers_controls_dataRenderers_IGridViewCellRenderer)) {
			var gridCell = cellRenderer;
			gridCell.set_column(state.column);
			gridCell.set_columnIndex(state.columnIndex);
			gridCell.set_rowIndex(state.rowIndex);
			gridCell.set_gridViewOwner(state.owner);
		}
		if(js_Boot.__implements(cellRenderer,feathers_layout_ILayoutIndexObject)) {
			var layoutIndexObject = cellRenderer;
			layoutIndexObject.set_layoutIndex(state.rowIndex);
		}
		if(js_Boot.__implements(cellRenderer,feathers_core_IPointerDelegate)) {
			var pointerDelgate = cellRenderer;
			pointerDelgate.set_pointerTarget(state.rowIndex == -1 ? null : this);
		}
		this._ignoreSelectionChange = oldIgnoreSelectionChange;
	}
	,customHitTest: function(stageX,stageY) {
		if(this.stage == null) {
			return false;
		}
		if(this.mouseChildren) {
			var objects = this.stage.getObjectsUnderPoint(new openfl_geom_Point(stageX,stageY));
			if(objects.length > 0) {
				var lastObject = objects[objects.length - 1];
				if(this.contains(lastObject)) {
					while(lastObject != null && lastObject != this) {
						if(((lastObject) instanceof openfl_display_InteractiveObject)) {
							var interactive = lastObject;
							if(!interactive.mouseEnabled) {
								lastObject = lastObject.parent;
								continue;
							}
						}
						if(js_Boot.__implements(lastObject,feathers_core_IFocusObject)) {
							var focusable = lastObject;
							if(focusable.parent != this && focusable.get_focusEnabled()) {
								return false;
							}
						}
						lastObject = lastObject.parent;
					}
				}
			}
		}
		return true;
	}
	,gridViewRowRenderer_cellRenderer_touchTapHandler: function(event) {
		if(!this._enabled) {
			return;
		}
		if(event.isPrimaryTouchPoint) {
			return;
		}
		if(!this.customHitTest(event.stageX,event.stageY)) {
			return;
		}
		var cellRenderer = js_Boot.__cast(event.currentTarget , openfl_display_DisplayObject);
		var state = this._cellRendererToCellState.h[cellRenderer.__id__];
		feathers_events_GridViewEvent.dispatchForCell(this,"cellTrigger",state);
		feathers_events_TriggerEvent.dispatchFromTouchEvent(this,event);
	}
	,gridViewRowRenderer_cellRenderer_clickHandler: function(event) {
		if(!this._enabled) {
			return;
		}
		if(!this.customHitTest(event.stageX,event.stageY)) {
			return;
		}
		var cellRenderer = js_Boot.__cast(event.currentTarget , openfl_display_DisplayObject);
		var state = this._cellRendererToCellState.h[cellRenderer.__id__];
		feathers_events_GridViewEvent.dispatchForCell(this,"cellTrigger",state);
		feathers_events_TriggerEvent.dispatchFromMouseEvent(this,event);
	}
	,gridViewRowRenderer_cellRenderer_triggerHandler: function(event) {
		if(!this._enabled) {
			return;
		}
		if(!this.customHitTest(event.stageX,event.stageY)) {
			return;
		}
		var cellRenderer = js_Boot.__cast(event.currentTarget , openfl_display_DisplayObject);
		var state = this._cellRendererToCellState.h[cellRenderer.__id__];
		feathers_events_GridViewEvent.dispatchForCell(this,"cellTrigger",state);
		this.dispatchEvent(event);
	}
	,gridViewRowRenderer_cellRenderer_resizeHandler: function(event) {
		if(this._validating) {
			return;
		}
		this.setInvalid(feathers_core_InvalidationFlag.LAYOUT);
	}
	,gridViewRowRenderer_cellRenderer_changeHandler: function(event) {
		if(this._ignoreSelectionChange) {
			return;
		}
		var cellRenderer = js_Boot.__cast(event.currentTarget , openfl_display_DisplayObject);
		var toggleCellRenderer = js_Boot.__cast(cellRenderer , feathers_controls_IToggle);
		var state = this._cellRendererToCellState.h[cellRenderer.__id__];
		if(toggleCellRenderer.get_selected() == state.selected) {
			return;
		}
		this.setInvalid(feathers_core_InvalidationFlag.SELECTION);
	}
	,gridViewRowRenderer_gridView_keyDownHandler: function(event) {
		if(!this._enabled || event.isDefaultPrevented()) {
			return;
		}
		if(event.keyCode == 32 || event.keyCode == 13) {
			if(this._selected) {
				var column = this._columns.get(0);
				var cellRenderer = this.columnToCellRenderer(column);
				var state = null;
				if(cellRenderer != null) {
					state = this._cellRendererToCellState.h[cellRenderer.__id__];
				}
				var isTemporary = false;
				if(state == null) {
					isTemporary = true;
					state = this.cellStatePool.get();
				}
				this.populateCurrentItemState(column,0,state,true);
				feathers_events_GridViewEvent.dispatchForCell(this,"cellTrigger",state);
				if(isTemporary) {
					this.cellStatePool.release(state);
				}
			}
		}
	}
	,gridViewRowRenderer_columns_changeHandler: function(event) {
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
	}
	,get_styleContext: function() {
		return feathers_controls_dataRenderers_GridViewRowRenderer;
	}
	,__class__: feathers_controls_dataRenderers_GridViewRowRenderer
	,__properties__: $extend(feathers_controls_LayoutGroup.prototype.__properties__,{set_customColumnWidths:"set_customColumnWidths",get_customColumnWidths:"get_customColumnWidths",set_customCellRendererVariant:"set_customCellRendererVariant",get_customCellRendererVariant:"get_customCellRendererVariant",set_forceCellStateUpdate:"set_forceCellStateUpdate",get_forceCellStateUpdate:"get_forceCellStateUpdate",set_cellRendererRecycler:"set_cellRendererRecycler",get_cellRendererRecycler:"get_cellRendererRecycler",set_columns:"set_columns",get_columns:"get_columns",set_data:"set_data",get_data:"get_data",set_rowIndex:"set_rowIndex",get_rowIndex:"get_rowIndex",set_selected:"set_selected",get_selected:"get_selected",set_gridView:"set_gridView",get_gridView:"get_gridView",get_currentState:"get_currentState"})
});
var feathers_controls_dataRenderers__$GridViewRowRenderer_CellRendererStorage = function(recycler) {
	this.inactiveCellRenderers = [];
	this.activeCellRenderers = [];
	this.cellRendererRecycler = recycler;
};
$hxClasses["feathers.controls.dataRenderers._GridViewRowRenderer.CellRendererStorage"] = feathers_controls_dataRenderers__$GridViewRowRenderer_CellRendererStorage;
feathers_controls_dataRenderers__$GridViewRowRenderer_CellRendererStorage.__name__ = "feathers.controls.dataRenderers._GridViewRowRenderer.CellRendererStorage";
feathers_controls_dataRenderers__$GridViewRowRenderer_CellRendererStorage.prototype = {
	oldCellRendererRecycler: null
	,cellRendererRecycler: null
	,activeCellRenderers: null
	,inactiveCellRenderers: null
	,measurements: null
	,__class__: feathers_controls_dataRenderers__$GridViewRowRenderer_CellRendererStorage
};
var feathers_core_IPointerDelegate = function() { };
$hxClasses["feathers.core.IPointerDelegate"] = feathers_core_IPointerDelegate;
feathers_core_IPointerDelegate.__name__ = "feathers.core.IPointerDelegate";
feathers_core_IPointerDelegate.__isInterface__ = true;
feathers_core_IPointerDelegate.prototype = {
	get_pointerTarget: null
	,set_pointerTarget: null
	,__class__: feathers_core_IPointerDelegate
	,__properties__: {set_pointerTarget:"set_pointerTarget",get_pointerTarget:"get_pointerTarget"}
};
var feathers_layout_ILayoutIndexObject = function() { };
$hxClasses["feathers.layout.ILayoutIndexObject"] = feathers_layout_ILayoutIndexObject;
feathers_layout_ILayoutIndexObject.__name__ = "feathers.layout.ILayoutIndexObject";
feathers_layout_ILayoutIndexObject.__isInterface__ = true;
feathers_layout_ILayoutIndexObject.prototype = {
	get_layoutIndex: null
	,set_layoutIndex: null
	,__class__: feathers_layout_ILayoutIndexObject
	,__properties__: {set_layoutIndex:"set_layoutIndex",get_layoutIndex:"get_layoutIndex"}
};
var feathers_controls_dataRenderers_ItemRenderer = function() {
	this.__accessoryView = null;
	this.__showHoverAndDownStates = true;
	this.__showSecondaryText = true;
	this.__alternateBackgroundSkin = null;
	this.__selectedSecondaryTextFormat = null;
	this.__disabledSecondaryTextFormat = null;
	this.__secondaryTextFormat = null;
	this._stateToSecondaryTextFormat = new haxe_ds_EnumValueMap();
	this._ignoreAccessoryResizes = false;
	this._layoutIndex = -1;
	this._childFocusEnabled = true;
	this._secondaryHtmlText = null;
	this._updatedSecondaryTextStyles = false;
	this._previousSecondarySimpleTextFormat = null;
	this._previousSecondaryTextFormat = null;
	this._previousSecondaryHTMLText = null;
	this._previousSecondaryText = null;
	this.initializeItemRendererTheme();
	feathers_controls_ToggleButton.call(this);
	this.mouseChildren = true;
	this.set_buttonMode(false);
	this.set_toggleable(false);
	this.set_tabEnabled(false);
	this.set_tabChildren(true);
};
$hxClasses["feathers.controls.dataRenderers.ItemRenderer"] = feathers_controls_dataRenderers_ItemRenderer;
feathers_controls_dataRenderers_ItemRenderer.__name__ = "feathers.controls.dataRenderers.ItemRenderer";
feathers_controls_dataRenderers_ItemRenderer.__interfaces__ = [feathers_core_IPointerDelegate,feathers_controls_dataRenderers_IDataRenderer,feathers_layout_ILayoutIndexObject,feathers_core_IFocusContainer];
feathers_controls_dataRenderers_ItemRenderer.__super__ = feathers_controls_ToggleButton;
feathers_controls_dataRenderers_ItemRenderer.prototype = $extend(feathers_controls_ToggleButton.prototype,{
	_data: null
	,get_data: function() {
		return this._data;
	}
	,set_data: function(value) {
		if(this._data == value) {
			return this._data;
		}
		this._data = value;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		feathers_events_FeathersEvent.dispatch(this,"dataChange");
		return this._data;
	}
	,secondaryTextField: null
	,_secondaryTextMeasuredWidth: null
	,_secondaryTextMeasuredHeight: null
	,_previousSecondaryText: null
	,_previousSecondaryHTMLText: null
	,_previousSecondaryTextFormat: null
	,_previousSecondarySimpleTextFormat: null
	,_updatedSecondaryTextStyles: null
	,_secondaryText: null
	,get_secondaryText: function() {
		return this._secondaryText;
	}
	,set_secondaryText: function(value) {
		if(this._secondaryText == value) {
			return this._secondaryText;
		}
		this._secondaryText = value;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		return this._secondaryText;
	}
	,_secondaryHtmlText: null
	,get_secondaryHtmlText: function() {
		return this._secondaryHtmlText;
	}
	,set_secondaryHtmlText: function(value) {
		if(this._secondaryHtmlText == value) {
			return this._secondaryHtmlText;
		}
		this._secondaryHtmlText = value;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		return this._secondaryHtmlText;
	}
	,_childFocusEnabled: null
	,get_childFocusEnabled: function() {
		if(this._enabled) {
			return this._childFocusEnabled;
		} else {
			return false;
		}
	}
	,set_childFocusEnabled: function(value) {
		if(this._childFocusEnabled == value) {
			return this._childFocusEnabled;
		}
		this._childFocusEnabled = value;
		return this._childFocusEnabled;
	}
	,_layoutIndex: null
	,get_layoutIndex: function() {
		return this._layoutIndex;
	}
	,set_layoutIndex: function(value) {
		if(this._layoutIndex == value) {
			return this._layoutIndex;
		}
		this._layoutIndex = value;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this._layoutIndex;
	}
	,_pointerTarget: null
	,get_pointerTarget: function() {
		return this._pointerTarget;
	}
	,set_pointerTarget: function(value) {
		if(this._pointerTarget == value) {
			return this._pointerTarget;
		}
		this._pointerTarget = value;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		return this._pointerTarget;
	}
	,_ignoreAccessoryResizes: null
	,_accessoryViewMeasurements: null
	,_currentAccessoryView: null
	,get_baseline: function() {
		if(this.textField == null) {
			return 0.0;
		}
		var hasText = this._text != null && this._text.length > 0;
		var hasHTMLText = this._htmlText != null && this._htmlText.length > 0;
		if(!this.get_showText() || !hasText && !hasHTMLText) {
			var textFieldY = this.textField.get_y();
			if(!this.get_showText() || this._text == null && this._htmlText == null) {
				if(this._currentIcon != null) {
					textFieldY = this._currentIcon.get_y() + (this._currentIcon.get_height() - this._textMeasuredHeight) / 2.0;
				} else if(this._currentBackgroundSkin != null) {
					textFieldY = (this._currentBackgroundSkin.get_height() - this._textMeasuredHeight) / 2.0;
				} else {
					return 0.0;
				}
			}
			this.textField.set_text("​");
			var textFieldBaseline = textFieldY + this.textField.getLineMetrics(0).ascent;
			this.textField.set_text("");
			return textFieldBaseline;
		}
		return this.textField.get_y() + this.textField.getLineMetrics(0).ascent;
	}
	,_stateToSecondaryTextFormat: null
	,getSecondaryTextFormatForState: function(state) {
		return this._stateToSecondaryTextFormat.get(state);
	}
	,setSecondaryTextFormatForState: function(state,textFormat) {
		if(!this.setStyle("setSecondaryTextFormatForState",state)) {
			return;
		}
		if(textFormat == null) {
			this._stateToSecondaryTextFormat.remove(state);
		} else {
			this._stateToSecondaryTextFormat.set(state,textFormat);
		}
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
	}
	,initializeItemRendererTheme: function() {
		feathers_themes_steel_components_SteelItemRendererStyles.initialize();
	}
	,dispose: function() {
		this.set_data(null);
		this.set_layoutIndex(-1);
		this.set_pointerTarget(null);
		feathers_controls_ToggleButton.prototype.dispose.call(this);
	}
	,initialize: function() {
		feathers_controls_ToggleButton.prototype.initialize.call(this);
		this._pointerToState.set_customHitTest($bind(this,this.customHitTest));
		this._pointerTrigger.set_customHitTest($bind(this,this.customHitTest));
	}
	,update: function() {
		var dataInvalid = this.isInvalid(feathers_core_InvalidationFlag.DATA);
		var sizeInvalid = this.isInvalid(feathers_core_InvalidationFlag.SIZE);
		var stateInvalid = this.isInvalid(feathers_core_InvalidationFlag.STATE);
		var stylesInvalid = this.isInvalid(feathers_core_InvalidationFlag.STYLES);
		this._updatedSecondaryTextStyles = false;
		if(dataInvalid) {
			this._pointerToState.set_target(this._pointerTarget != null ? this._pointerTarget : this);
			this.refreshSecondaryTextField();
		}
		if(dataInvalid || stylesInvalid || stateInvalid) {
			this.refreshSecondaryTextStyles();
		}
		if(stylesInvalid || stateInvalid) {
			this.refreshAccessoryView();
		}
		if(dataInvalid || stylesInvalid || stateInvalid || sizeInvalid) {
			this.refreshSecondaryText(sizeInvalid);
		}
		feathers_controls_ToggleButton.prototype.update.call(this);
	}
	,refreshInteractivity: function() {
		feathers_controls_ToggleButton.prototype.refreshInteractivity.call(this);
		this._pointerToState.set_enabled(this.get_showHoverAndDownStates());
		this._keyToState.set_enabled(this.get_showHoverAndDownStates());
	}
	,refreshSecondaryTextField: function() {
		if(this._secondaryText == null && this._secondaryHtmlText == null) {
			if(this.secondaryTextField != null) {
				this.removeChild(this.secondaryTextField);
				this.secondaryTextField = null;
			}
			this._previousSecondaryText = null;
			this._previousSecondaryHTMLText = null;
			this._previousSecondaryTextFormat = null;
			this._previousSecondarySimpleTextFormat = null;
			return;
		}
		if(this.secondaryTextField != null) {
			return;
		}
		this.secondaryTextField = new openfl_text_TextField();
		this.secondaryTextField.set_selectable(false);
		this.secondaryTextField.set_multiline(true);
		this.addChild(this.secondaryTextField);
	}
	,refreshSecondaryTextStyles: function() {
		if(this.secondaryTextField == null) {
			return;
		}
		if(this.secondaryTextField.get_embedFonts() != this.get_embedFonts()) {
			this.secondaryTextField.set_embedFonts(this.get_embedFonts());
			this._updatedSecondaryTextStyles = true;
		}
		var textFormat = this.getCurrentSecondaryTextFormat();
		var simpleTextFormat = textFormat != null ? textFormat.toSimpleTextFormat() : null;
		if(simpleTextFormat == this._previousSecondarySimpleTextFormat) {
			return;
		}
		if(this._previousSecondaryTextFormat != null) {
			this._previousSecondaryTextFormat.removeEventListener("change",$bind(this,this.itemRenderer_secondaryTextFormat_changeHandler));
		}
		if(textFormat != null) {
			textFormat.addEventListener("change",$bind(this,this.itemRenderer_secondaryTextFormat_changeHandler),false,0,true);
			this.secondaryTextField.set_defaultTextFormat(simpleTextFormat);
			this._updatedSecondaryTextStyles = true;
		}
		this._previousSecondaryTextFormat = textFormat;
		this._previousSecondarySimpleTextFormat = simpleTextFormat;
	}
	,refreshSecondaryText: function(forceMeasurement) {
		if(this.secondaryTextField == null) {
			return;
		}
		var hasSecondaryText = this.get_showSecondaryText() && this._secondaryText != null && this._secondaryText.length > 0;
		var hasSecondaryHTMLText = this.get_showSecondaryText() && this._secondaryHtmlText != null && this._secondaryHtmlText.length > 0;
		this.secondaryTextField.set_visible(hasSecondaryText || hasSecondaryHTMLText);
		if(this._secondaryText == this._previousSecondaryText && this._secondaryHtmlText == this._previousSecondaryHTMLText && !this._updatedSecondaryTextStyles && !forceMeasurement) {
			return;
		}
		this.secondaryTextField.set_autoSize(1);
		if(hasSecondaryHTMLText) {
			this.secondaryTextField.set_htmlText(this._secondaryHtmlText);
		} else if(hasSecondaryText) {
			this.secondaryTextField.set_text(this._secondaryText);
		} else {
			this.secondaryTextField.set_text("​");
		}
		this._secondaryTextMeasuredWidth = this.secondaryTextField.get_width();
		this._secondaryTextMeasuredHeight = this.secondaryTextField.get_height();
		this.secondaryTextField.set_autoSize(2);
		if(!hasSecondaryText && !hasSecondaryHTMLText) {
			this.secondaryTextField.set_text("");
		}
		this._previousSecondaryText = this._secondaryText;
		this._previousSecondaryHTMLText = this._secondaryHtmlText;
	}
	,getCurrentSecondaryTextFormat: function() {
		var result = this._stateToSecondaryTextFormat.get(this._currentState);
		if(result != null) {
			return result;
		}
		if(!this._enabled && this.get_disabledSecondaryTextFormat() != null) {
			return this.get_disabledSecondaryTextFormat();
		}
		if(this._selected && this.get_selectedSecondaryTextFormat() != null) {
			return this.get_selectedSecondaryTextFormat();
		}
		return this.get_secondaryTextFormat();
	}
	,refreshAccessoryView: function() {
		var oldView = this._currentAccessoryView;
		this._currentAccessoryView = this.getCurrentAccessoryView();
		if(this._currentAccessoryView == oldView) {
			return;
		}
		this.removeCurrentAccessoryView(oldView);
		this.addCurrentAccessoryView(this._currentAccessoryView);
	}
	,getCurrentAccessoryView: function() {
		return this.get_accessoryView();
	}
	,removeCurrentAccessoryView: function(view) {
		if(view == null) {
			return;
		}
		view.removeEventListener("resize",$bind(this,this.itemRenderer_accessoryView_resizeHandler));
		if(js_Boot.__implements(view,feathers_skins_IProgrammaticSkin)) {
			view.set_uiContext(null);
		}
		if(js_Boot.__implements(view,feathers_core_IStateObserver)) {
			view.set_stateContext(null);
		}
		this._accessoryViewMeasurements.restore(view);
		if(view.parent == this) {
			this.removeChild(view);
		}
	}
	,addCurrentAccessoryView: function(view) {
		if(view == null) {
			this._accessoryViewMeasurements = null;
			return;
		}
		if(js_Boot.__implements(view,feathers_core_IUIControl)) {
			view.initializeNow();
		}
		if(this._accessoryViewMeasurements == null) {
			this._accessoryViewMeasurements = new feathers_layout_Measurements(view);
		} else {
			this._accessoryViewMeasurements.save(view);
		}
		if(js_Boot.__implements(view,feathers_skins_IProgrammaticSkin)) {
			view.set_uiContext(this);
		}
		if(js_Boot.__implements(view,feathers_core_IStateObserver)) {
			view.set_stateContext(this);
		}
		view.addEventListener("resize",$bind(this,this.itemRenderer_accessoryView_resizeHandler),false,0,true);
		this.addChild(view);
	}
	,customHitTest: function(stageX,stageY) {
		var value = this._pointerTarget;
		var pointerTargetContainer = ((value) instanceof openfl_display_DisplayObjectContainer) ? value : null;
		if(pointerTargetContainer == null) {
			pointerTargetContainer = this;
		}
		if(pointerTargetContainer.stage == null) {
			return false;
		}
		if(pointerTargetContainer.mouseChildren) {
			var objects = pointerTargetContainer.stage.getObjectsUnderPoint(new openfl_geom_Point(stageX,stageY));
			if(objects.length > 0) {
				var lastObject = objects[objects.length - 1];
				if(pointerTargetContainer.contains(lastObject)) {
					while(lastObject != null && lastObject != pointerTargetContainer) {
						if(((lastObject) instanceof openfl_display_InteractiveObject)) {
							var interactive = lastObject;
							if(!interactive.mouseEnabled) {
								lastObject = lastObject.parent;
								continue;
							}
						}
						if(js_Boot.__implements(lastObject,feathers_core_IFocusObject)) {
							var focusable = lastObject;
							if((this._pointerTarget == null || focusable.parent != this._pointerTarget) && focusable.get_focusEnabled()) {
								return false;
							}
						}
						lastObject = lastObject.parent;
					}
				}
			}
		}
		return true;
	}
	,refreshTextFieldDimensions: function(forMeasurement) {
		var oldIgnoreIconResizes = this._ignoreIconResizes;
		this._ignoreIconResizes = true;
		if(js_Boot.__implements(this._currentIcon,feathers_core_IValidating)) {
			this._currentIcon.validateNow();
		}
		this._ignoreIconResizes = oldIgnoreIconResizes;
		var oldIgnoreAccessoryResizes = this._ignoreAccessoryResizes;
		this._ignoreAccessoryResizes = true;
		if(js_Boot.__implements(this._currentAccessoryView,feathers_core_IValidating)) {
			this._currentAccessoryView.validateNow();
		}
		this._ignoreAccessoryResizes = oldIgnoreAccessoryResizes;
		var hasText = this.get_showText() && this._text != null;
		var hasHTMLText = this.get_showText() && this._htmlText != null && this._htmlText.length > 0;
		if(!hasText && !hasHTMLText) {
			return;
		}
		var calculatedWidth = this.actualWidth;
		var calculatedHeight = this.actualHeight;
		if(forMeasurement) {
			calculatedWidth = 0.0;
			var explicitCalculatedWidth = this.get_explicitWidth();
			if(explicitCalculatedWidth == null) {
				explicitCalculatedWidth = this.get_explicitMaxWidth();
			}
			if(explicitCalculatedWidth != null) {
				calculatedWidth = explicitCalculatedWidth;
			}
			calculatedHeight = 0.0;
			var explicitCalculatedHeight = this.get_explicitHeight();
			if(explicitCalculatedHeight == null) {
				explicitCalculatedHeight = this.get_explicitMaxHeight();
			}
			if(explicitCalculatedHeight != null) {
				calculatedHeight = explicitCalculatedHeight;
			}
		}
		calculatedWidth -= this.get_paddingLeft() + this.get_paddingRight();
		calculatedHeight -= this.get_paddingTop() + this.get_paddingBottom();
		var adjustedGap = this.get_gap();
		if(adjustedGap == 1.0 / 0.0) {
			adjustedGap = this.get_minGap();
		}
		if(this._currentIcon != null) {
			if(this.get_iconPosition() == feathers_layout_RelativePosition.LEFT || this.get_iconPosition() == feathers_layout_RelativePosition.RIGHT) {
				calculatedWidth -= this._currentIcon.get_width() + adjustedGap;
			}
			if(this.get_iconPosition() == feathers_layout_RelativePosition.TOP || this.get_iconPosition() == feathers_layout_RelativePosition.BOTTOM) {
				calculatedHeight -= this._currentIcon.get_height() + adjustedGap;
			}
		}
		if(this.hasAccessoryViewInLayout()) {
			calculatedWidth -= this._currentAccessoryView.get_width() + adjustedGap;
		}
		if(this.secondaryTextField != null) {
			calculatedHeight -= this._secondaryTextMeasuredHeight + adjustedGap;
		}
		if(calculatedWidth > this._textMeasuredWidth) {
			calculatedWidth = this._textMeasuredWidth;
		}
		if(calculatedHeight > this._textMeasuredHeight) {
			calculatedHeight = this._textMeasuredHeight;
		}
		if(calculatedWidth < 0.0) {
			calculatedWidth = 0.0;
		}
		if(calculatedHeight < 0.0) {
			calculatedHeight = 0.0;
		}
		this.textField.set_width(calculatedWidth);
		var wordWrap = this.get_wordWrap();
		if(wordWrap && !this._wrappedOnMeasure && calculatedWidth >= this._textMeasuredWidth) {
			wordWrap = false;
		}
		if(this.textField.get_wordWrap() != wordWrap) {
			this.textField.set_wordWrap(wordWrap);
		}
		this.textField.set_height(calculatedHeight);
	}
	,calculateExplicitWidthForTextMeasurement: function() {
		var textFieldExplicitWidth = feathers_controls_ToggleButton.prototype.calculateExplicitWidthForTextMeasurement.call(this);
		if(textFieldExplicitWidth == null) {
			return textFieldExplicitWidth;
		}
		var adjustedGap = this.get_gap();
		if(adjustedGap == 1.0 / 0.0) {
			adjustedGap = this.get_minGap();
		}
		if(this.hasAccessoryViewInLayout()) {
			var oldIgnoreAccessoryResizes = this._ignoreAccessoryResizes;
			this._ignoreAccessoryResizes = true;
			if(js_Boot.__implements(this._currentAccessoryView,feathers_core_IValidating)) {
				this._currentAccessoryView.validateNow();
			}
			this._ignoreAccessoryResizes = oldIgnoreAccessoryResizes;
			textFieldExplicitWidth -= this._currentAccessoryView.get_width() + adjustedGap;
		}
		if(textFieldExplicitWidth < 0.0) {
			textFieldExplicitWidth = 0.0;
		}
		return textFieldExplicitWidth;
	}
	,measureContentWidth: function() {
		var adjustedGap = this.get_gap();
		if(adjustedGap == 1.0 / 0.0) {
			adjustedGap = this.get_minGap();
		}
		var hasText = this.get_showText() && this._text != null;
		var hasHTMLText = this.get_showText() && this._htmlText != null && this._htmlText.length > 0;
		var contentWidth = hasText || hasHTMLText ? this._textMeasuredWidth : 0.0;
		var hasSecondaryText = this.get_showSecondaryText() && this._secondaryText != null;
		var hasSecondaryHTMLText = this.get_showSecondaryText() && this._secondaryHtmlText != null && this._secondaryHtmlText.length > 0;
		if(hasSecondaryText || hasSecondaryHTMLText) {
			contentWidth = Math.max(contentWidth,this._secondaryTextMeasuredWidth);
		}
		if(this.hasAccessoryViewInLayout()) {
			var oldIgnoreAccessoryResizes = this._ignoreAccessoryResizes;
			this._ignoreAccessoryResizes = true;
			if(js_Boot.__implements(this._currentAccessoryView,feathers_core_IValidating)) {
				this._currentAccessoryView.validateNow();
			}
			this._ignoreAccessoryResizes = oldIgnoreAccessoryResizes;
			if(hasText || hasHTMLText || hasSecondaryText || hasSecondaryHTMLText) {
				contentWidth += adjustedGap;
			}
			contentWidth += this._currentAccessoryView.get_width();
		}
		if(this._currentIcon != null) {
			if(this.get_iconPosition() == feathers_layout_RelativePosition.LEFT || this.get_iconPosition() == feathers_layout_RelativePosition.RIGHT) {
				if(hasText || hasHTMLText || hasSecondaryText || hasSecondaryHTMLText || this.hasAccessoryViewInLayout()) {
					contentWidth += adjustedGap;
				}
				contentWidth += this._currentIcon.get_width();
			} else if(this.get_iconPosition() == feathers_layout_RelativePosition.TOP || this.get_iconPosition() == feathers_layout_RelativePosition.BOTTOM) {
				contentWidth = Math.max(contentWidth,this._currentIcon.get_width());
			}
		}
		return contentWidth;
	}
	,measureContentHeight: function() {
		var adjustedGap = this.get_gap();
		if(adjustedGap == 1.0 / 0.0) {
			adjustedGap = this.get_minGap();
		}
		var hasText = this.get_showText() && this._text != null;
		var hasHTMLText = this.get_showText() && this._htmlText != null && this._htmlText.length > 0;
		var contentHeight = hasText || hasHTMLText ? this._textMeasuredHeight : 0.0;
		var hasSecondaryText = this.get_showSecondaryText() && this._secondaryText != null;
		var hasSecondaryHTMLText = this.get_showSecondaryText() && this._secondaryHtmlText != null && this._secondaryHtmlText.length > 0;
		if(hasSecondaryText || hasSecondaryHTMLText) {
			contentHeight += this._secondaryTextMeasuredHeight;
			if(hasText || hasHTMLText) {
				contentHeight += adjustedGap;
			}
		}
		if(this.hasAccessoryViewInLayout()) {
			var oldIgnoreAccessoryResizes = this._ignoreAccessoryResizes;
			this._ignoreAccessoryResizes = true;
			if(js_Boot.__implements(this._currentAccessoryView,feathers_core_IValidating)) {
				this._currentAccessoryView.validateNow();
			}
			this._ignoreAccessoryResizes = oldIgnoreAccessoryResizes;
			contentHeight = Math.max(contentHeight,this._currentAccessoryView.get_height());
		}
		if(this._currentIcon != null) {
			if(this.get_iconPosition() == feathers_layout_RelativePosition.TOP || this.get_iconPosition() == feathers_layout_RelativePosition.BOTTOM) {
				if(hasText || hasHTMLText || hasSecondaryText || hasSecondaryHTMLText) {
					contentHeight += adjustedGap;
				}
				contentHeight += this._currentIcon.get_height();
			} else if(this.get_iconPosition() == feathers_layout_RelativePosition.LEFT || this.get_iconPosition() == feathers_layout_RelativePosition.RIGHT) {
				contentHeight = Math.max(contentHeight,this._currentIcon.get_height());
			}
		}
		return contentHeight;
	}
	,measureContentMinWidth: function() {
		var adjustedGap = this.get_gap();
		if(adjustedGap == 1.0 / 0.0) {
			adjustedGap = this.get_minGap();
		}
		var hasText = this.get_showText() && this._text != null;
		var hasHTMLText = this.get_showText() && this._htmlText != null && this._htmlText.length > 0;
		var contentMinWidth = hasText || hasHTMLText ? this._textMeasuredWidth : 0.0;
		var hasSecondaryText = this.get_showSecondaryText() && this._secondaryText != null;
		var hasSecondaryHTMLText = this.get_showSecondaryText() && this._secondaryHtmlText != null && this._secondaryHtmlText.length > 0;
		if(hasSecondaryText || hasSecondaryHTMLText) {
			contentMinWidth = Math.max(contentMinWidth,this._secondaryTextMeasuredWidth);
		}
		if(this.hasAccessoryViewInLayout()) {
			var oldIgnoreAccessoryResizes = this._ignoreAccessoryResizes;
			this._ignoreAccessoryResizes = true;
			if(js_Boot.__implements(this._currentAccessoryView,feathers_core_IValidating)) {
				this._currentAccessoryView.validateNow();
			}
			this._ignoreAccessoryResizes = oldIgnoreAccessoryResizes;
			if(hasText || hasHTMLText || hasSecondaryText || hasSecondaryHTMLText) {
				contentMinWidth += adjustedGap;
			}
			contentMinWidth += this._currentAccessoryView.get_width();
		}
		if(this._currentIcon != null) {
			if(this.get_iconPosition() == feathers_layout_RelativePosition.LEFT || this.get_iconPosition() == feathers_layout_RelativePosition.RIGHT) {
				if(hasText || hasHTMLText || hasSecondaryText || hasSecondaryHTMLText || this.hasAccessoryViewInLayout()) {
					contentMinWidth += adjustedGap;
				}
				contentMinWidth += this._currentIcon.get_width();
			} else if(this.get_iconPosition() == feathers_layout_RelativePosition.TOP || this.get_iconPosition() == feathers_layout_RelativePosition.BOTTOM) {
				contentMinWidth = Math.max(contentMinWidth,this._currentIcon.get_width());
			}
		}
		return contentMinWidth;
	}
	,measureContentMinHeight: function() {
		var adjustedGap = this.get_gap();
		if(adjustedGap == 1.0 / 0.0) {
			adjustedGap = this.get_minGap();
		}
		var hasText = this.get_showText() && this._text != null;
		var hasHTMLText = this.get_showText() && this._htmlText != null && this._htmlText.length > 0;
		var contentMinHeight = hasText || hasHTMLText ? this._textMeasuredHeight : 0.0;
		var hasSecondaryText = this.get_showSecondaryText() && this._secondaryText != null;
		var hasSecondaryHTMLText = this.get_showSecondaryText() && this._secondaryHtmlText != null && this._secondaryHtmlText.length > 0;
		if(hasSecondaryText || hasSecondaryHTMLText) {
			contentMinHeight += this._secondaryTextMeasuredHeight;
			if(hasText || hasHTMLText) {
				contentMinHeight += adjustedGap;
			}
		}
		if(this.hasAccessoryViewInLayout()) {
			var oldIgnoreAccessoryResizes = this._ignoreAccessoryResizes;
			this._ignoreAccessoryResizes = true;
			if(js_Boot.__implements(this._currentAccessoryView,feathers_core_IValidating)) {
				this._currentAccessoryView.validateNow();
			}
			this._ignoreAccessoryResizes = oldIgnoreAccessoryResizes;
			contentMinHeight = Math.max(contentMinHeight,this._currentAccessoryView.get_height());
		}
		if(this._currentIcon != null) {
			if(this.get_iconPosition() == feathers_layout_RelativePosition.TOP || this.get_iconPosition() == feathers_layout_RelativePosition.BOTTOM) {
				if(hasText || hasHTMLText || hasSecondaryText || hasSecondaryHTMLText) {
					contentMinHeight += adjustedGap;
				}
				contentMinHeight += this._currentIcon.get_height();
			} else if(this.get_iconPosition() == feathers_layout_RelativePosition.LEFT || this.get_iconPosition() == feathers_layout_RelativePosition.RIGHT) {
				contentMinHeight = Math.max(contentMinHeight,this._currentIcon.get_height());
			}
		}
		return contentMinHeight;
	}
	,hasAccessoryViewInLayout: function() {
		if(this._currentAccessoryView == null) {
			return false;
		}
		if(js_Boot.__implements(this._currentAccessoryView,feathers_layout_ILayoutObject)) {
			return this._currentAccessoryView.get_includeInLayout();
		}
		return true;
	}
	,getCurrentBackgroundSkin: function() {
		var result = this._stateToSkin.get(this._currentState);
		if(result != null) {
			return result;
		}
		if(this._selected && this.get_selectedBackgroundSkin() != null) {
			return this.get_selectedBackgroundSkin();
		}
		if(this.get_alternateBackgroundSkin() != null && this._layoutIndex % 2 == 1) {
			return this.get_alternateBackgroundSkin();
		}
		return this.get_backgroundSkin();
	}
	,layoutChildren: function() {
		this.refreshTextFieldDimensions(false);
		var flexGap = false;
		var adjustedGap = this.get_gap();
		if(adjustedGap == 1.0 / 0.0) {
			adjustedGap = this.get_minGap();
			flexGap = true;
		}
		var hasText = this.get_showText() && this._text != null;
		var hasHTMLText = this.get_showText() && this._htmlText != null && this._htmlText.length > 0;
		var hasSecondaryText = this.get_showSecondaryText() && this._secondaryText != null;
		var hasSecondaryHTMLText = this.get_showSecondaryText() && this._secondaryHtmlText != null && this._secondaryHtmlText.length > 0;
		var availableContentWidth = this.actualWidth - this.get_paddingLeft() - this.get_paddingRight();
		var availableContentHeight = this.actualHeight - this.get_paddingTop() - this.get_paddingBottom();
		var totalContentWidth = hasText || hasHTMLText ? this._textMeasuredWidth : 0.0;
		var totalContentHeight = hasText || hasHTMLText ? this._textMeasuredHeight : 0.0;
		if((hasSecondaryText || hasSecondaryHTMLText) && this.secondaryTextField != null) {
			totalContentWidth = Math.max(totalContentWidth,this._secondaryTextMeasuredWidth);
			totalContentHeight += this._secondaryTextMeasuredHeight + adjustedGap;
		}
		if(this._currentIcon != null) {
			if(this.get_iconPosition() == feathers_layout_RelativePosition.LEFT || this.get_iconPosition() == feathers_layout_RelativePosition.RIGHT) {
				totalContentWidth += adjustedGap + this._currentIcon.get_width();
			}
			if(this.get_iconPosition() == feathers_layout_RelativePosition.TOP || this.get_iconPosition() == feathers_layout_RelativePosition.BOTTOM) {
				totalContentHeight += adjustedGap + this._currentIcon.get_height();
			}
		}
		var flexGapVertical = flexGap && (hasText || hasHTMLText || hasSecondaryText || hasSecondaryHTMLText) && this._currentIcon != null && (this.get_iconPosition() == feathers_layout_RelativePosition.TOP || this.get_iconPosition() == feathers_layout_RelativePosition.BOTTOM);
		var flexGapHorizontal = flexGap && (hasText || hasHTMLText || hasSecondaryText || hasSecondaryHTMLText) && this._currentIcon != null && (this.get_iconPosition() == feathers_layout_RelativePosition.LEFT || this.get_iconPosition() == feathers_layout_RelativePosition.RIGHT);
		if(this.hasAccessoryViewInLayout()) {
			this._currentAccessoryView.set_x(this.actualWidth - this.get_paddingRight() - this._currentAccessoryView.get_width());
			switch(this.get_verticalAlign()._hx_index) {
			case 0:
				this._currentAccessoryView.set_y(this.get_paddingTop());
				break;
			case 1:
				this._currentAccessoryView.set_y(Math.max(this.get_paddingTop(),this.get_paddingTop() + (availableContentHeight - this._currentAccessoryView.get_height()) / 2.0));
				break;
			case 2:
				this._currentAccessoryView.set_y(Math.max(this.get_paddingTop(),this.get_paddingTop() + availableContentHeight - this._currentAccessoryView.get_height()));
				break;
			default:
				throw new openfl_errors_ArgumentError("Unknown vertical align: " + Std.string(this.get_verticalAlign()));
			}
			availableContentWidth -= this._currentAccessoryView.get_width() + adjustedGap;
		}
		if(this._currentIcon != null) {
			if(this.get_iconPosition() == feathers_layout_RelativePosition.TOP || this.get_iconPosition() == feathers_layout_RelativePosition.BOTTOM) {
				switch(this.get_horizontalAlign()._hx_index) {
				case 0:
					this._currentIcon.set_x(this.get_paddingLeft());
					break;
				case 1:
					this._currentIcon.set_x(Math.max(this.get_paddingLeft(),this.get_paddingLeft() + (availableContentWidth - this._currentIcon.get_height()) / 2.0));
					break;
				case 2:
					this._currentIcon.set_x(Math.max(this.get_paddingLeft(),this.get_paddingLeft() + availableContentWidth - this._currentIcon.get_width()));
					break;
				default:
					throw new openfl_errors_ArgumentError("Unknown horizontal align: " + Std.string(this.get_horizontalAlign()));
				}
			}
			if(this.get_iconPosition() == feathers_layout_RelativePosition.LEFT || this.get_iconPosition() == feathers_layout_RelativePosition.RIGHT) {
				switch(this.get_verticalAlign()._hx_index) {
				case 0:
					this._currentIcon.set_y(this.get_paddingTop());
					break;
				case 1:
					this._currentIcon.set_y(Math.max(this.get_paddingTop(),this.get_paddingTop() + (availableContentHeight - this._currentIcon.get_height()) / 2.0));
					break;
				case 2:
					this._currentIcon.set_y(Math.max(this.get_paddingTop(),this.get_paddingTop() + availableContentHeight - this._currentIcon.get_height()));
					break;
				default:
					throw new openfl_errors_ArgumentError("Unknown vertical align: " + Std.string(this.get_verticalAlign()));
				}
			}
		}
		var currentX = this.get_paddingLeft();
		var currentY = this.get_paddingTop();
		if(flexGapHorizontal) {
			currentX = this.get_paddingLeft();
		} else {
			switch(this.get_horizontalAlign()._hx_index) {
			case 0:
				currentX = this.get_paddingLeft();
				break;
			case 1:
				currentX = Math.max(this.get_paddingLeft(),this.get_paddingLeft() + (availableContentWidth - totalContentWidth) / 2.0);
				break;
			case 2:
				currentX = Math.max(this.get_paddingLeft(),this.get_paddingLeft() + availableContentWidth - totalContentWidth);
				break;
			default:
				throw new openfl_errors_ArgumentError("Unknown horizontal align: " + Std.string(this.get_horizontalAlign()));
			}
		}
		if(flexGapVertical) {
			currentY = this.get_paddingTop();
		} else {
			switch(this.get_verticalAlign()._hx_index) {
			case 0:
				currentY = this.get_paddingTop();
				break;
			case 1:
				currentY = Math.max(this.get_paddingTop(),this.get_paddingTop() + (availableContentHeight - totalContentHeight) / 2.0);
				break;
			case 2:
				currentY = Math.max(this.get_paddingTop(),this.get_paddingTop() + availableContentHeight - totalContentHeight);
				break;
			default:
				throw new openfl_errors_ArgumentError("Unknown vertical align: " + Std.string(this.get_verticalAlign()));
			}
		}
		if(this._currentIcon != null) {
			if(this.get_iconPosition() == feathers_layout_RelativePosition.LEFT) {
				this._currentIcon.set_x(currentX);
				currentX += adjustedGap + this._currentIcon.get_width();
			} else if(this.get_iconPosition() == feathers_layout_RelativePosition.TOP) {
				this._currentIcon.set_y(currentY);
				currentY += adjustedGap + this._currentIcon.get_height();
			}
		}
		var totalTextWidth = 0.0;
		var totalTextHeight = 0.0;
		var availableTextWidth = availableContentWidth;
		if(this._currentIcon != null && (this.get_iconPosition() == feathers_layout_RelativePosition.LEFT || this.get_iconPosition() == feathers_layout_RelativePosition.RIGHT)) {
			availableTextWidth -= adjustedGap + this._currentIcon.get_width();
		}
		if(hasText || hasHTMLText) {
			this.textField.set_x(currentX);
			this.textField.set_y(currentY);
			currentY += this._textMeasuredHeight + adjustedGap;
			totalTextWidth = Math.max(totalTextWidth,this.textField.get_width());
			totalTextHeight += this.textField.get_height();
			if(hasSecondaryText || hasSecondaryHTMLText) {
				totalTextHeight += adjustedGap;
			}
		}
		if((hasSecondaryText || hasSecondaryHTMLText) && this.secondaryTextField != null) {
			this.secondaryTextField.set_x(currentX);
			this.secondaryTextField.set_y(currentY);
			var secondaryTextWidth = this._secondaryTextMeasuredWidth < availableTextWidth ? this._secondaryTextMeasuredWidth : availableTextWidth;
			if(secondaryTextWidth < 0.0) {
				secondaryTextWidth = 0.0;
			}
			this.secondaryTextField.set_width(secondaryTextWidth);
			currentY += this._secondaryTextMeasuredHeight + adjustedGap;
			totalTextWidth = Math.max(totalTextWidth,secondaryTextWidth);
			totalTextHeight += this.secondaryTextField.get_height();
		}
		if(flexGapHorizontal && this.get_iconPosition() == feathers_layout_RelativePosition.LEFT) {
			if(hasText || hasHTMLText) {
				this.textField.set_x(Math.max(this.textField.get_x(),this.get_paddingLeft() + availableContentWidth - totalTextWidth));
			}
			if(hasSecondaryText || hasSecondaryHTMLText) {
				this.secondaryTextField.set_x(Math.max(this.secondaryTextField.get_x(),this.get_paddingLeft() + availableContentWidth - totalTextWidth));
			}
		} else if(flexGapVertical && this.get_iconPosition() == feathers_layout_RelativePosition.TOP) {
			if(hasText || hasHTMLText) {
				this.textField.set_y(Math.max(this.textField.get_y(),this.get_paddingTop() + availableContentHeight - totalTextHeight));
			}
			if(hasSecondaryText || hasSecondaryHTMLText) {
				this.secondaryTextField.set_y(this.get_paddingTop() + availableContentHeight - this.secondaryTextField.get_height());
			}
		}
		if(hasText || hasHTMLText || hasSecondaryText || hasSecondaryHTMLText) {
			currentX += totalTextWidth + adjustedGap;
		}
		if(this._currentIcon != null) {
			if(this.get_iconPosition() == feathers_layout_RelativePosition.RIGHT) {
				if(flexGapHorizontal) {
					this._currentIcon.set_x(Math.max(currentX,this.get_paddingLeft() + availableContentWidth - this._currentIcon.get_width()));
				} else {
					this._currentIcon.set_x(currentX);
				}
			}
			if(this.get_iconPosition() == feathers_layout_RelativePosition.BOTTOM) {
				if(flexGapVertical) {
					this._currentIcon.set_y(Math.max(currentY,this.get_paddingTop() + availableContentHeight - this._currentIcon.get_height()));
				} else {
					this._currentIcon.set_y(currentY);
				}
			}
		}
	}
	,itemRenderer_secondaryTextFormat_changeHandler: function(event) {
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
	}
	,itemRenderer_accessoryView_resizeHandler: function(event) {
		if(this._ignoreAccessoryResizes) {
			return;
		}
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
	}
	,__secondaryTextFormat: null
	,get_secondaryTextFormat: function() {
		return this.__secondaryTextFormat;
	}
	,set_secondaryTextFormat: function(value) {
		if(!this.setStyle("secondaryTextFormat")) {
			return this.__secondaryTextFormat;
		}
		if(this.__secondaryTextFormat == value) {
			return this.__secondaryTextFormat;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_secondaryTextFormat);
		this.__secondaryTextFormat = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__secondaryTextFormat;
	}
	,clearStyle_secondaryTextFormat: function() {
		this.set_secondaryTextFormat(null);
		return this.get_secondaryTextFormat();
	}
	,__disabledSecondaryTextFormat: null
	,get_disabledSecondaryTextFormat: function() {
		return this.__disabledSecondaryTextFormat;
	}
	,set_disabledSecondaryTextFormat: function(value) {
		if(!this.setStyle("disabledSecondaryTextFormat")) {
			return this.__disabledSecondaryTextFormat;
		}
		if(this.__disabledSecondaryTextFormat == value) {
			return this.__disabledSecondaryTextFormat;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_disabledSecondaryTextFormat);
		this.__disabledSecondaryTextFormat = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__disabledSecondaryTextFormat;
	}
	,clearStyle_disabledSecondaryTextFormat: function() {
		this.set_disabledSecondaryTextFormat(null);
		return this.get_disabledSecondaryTextFormat();
	}
	,__selectedSecondaryTextFormat: null
	,get_selectedSecondaryTextFormat: function() {
		return this.__selectedSecondaryTextFormat;
	}
	,set_selectedSecondaryTextFormat: function(value) {
		if(!this.setStyle("selectedSecondaryTextFormat")) {
			return this.__selectedSecondaryTextFormat;
		}
		if(this.__selectedSecondaryTextFormat == value) {
			return this.__selectedSecondaryTextFormat;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_selectedSecondaryTextFormat);
		this.__selectedSecondaryTextFormat = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__selectedSecondaryTextFormat;
	}
	,clearStyle_selectedSecondaryTextFormat: function() {
		this.set_selectedSecondaryTextFormat(null);
		return this.get_selectedSecondaryTextFormat();
	}
	,__alternateBackgroundSkin: null
	,get_alternateBackgroundSkin: function() {
		return this.__alternateBackgroundSkin;
	}
	,set_alternateBackgroundSkin: function(value) {
		if(!this.setStyle("alternateBackgroundSkin")) {
			return this.__alternateBackgroundSkin;
		}
		if(this.__alternateBackgroundSkin == value) {
			return this.__alternateBackgroundSkin;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_alternateBackgroundSkin);
		this.__alternateBackgroundSkin = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__alternateBackgroundSkin;
	}
	,clearStyle_alternateBackgroundSkin: function() {
		this.set_alternateBackgroundSkin(null);
		return this.get_alternateBackgroundSkin();
	}
	,__showSecondaryText: null
	,get_showSecondaryText: function() {
		return this.__showSecondaryText;
	}
	,set_showSecondaryText: function(value) {
		if(!this.setStyle("showSecondaryText")) {
			return this.__showSecondaryText;
		}
		if(this.__showSecondaryText == value) {
			return this.__showSecondaryText;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_showSecondaryText);
		this.__showSecondaryText = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__showSecondaryText;
	}
	,clearStyle_showSecondaryText: function() {
		this.set_showSecondaryText(true);
		return this.get_showSecondaryText();
	}
	,__showHoverAndDownStates: null
	,get_showHoverAndDownStates: function() {
		return this.__showHoverAndDownStates;
	}
	,set_showHoverAndDownStates: function(value) {
		if(!this.setStyle("showHoverAndDownStates")) {
			return this.__showHoverAndDownStates;
		}
		if(this.__showHoverAndDownStates == value) {
			return this.__showHoverAndDownStates;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_showHoverAndDownStates);
		this.__showHoverAndDownStates = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__showHoverAndDownStates;
	}
	,clearStyle_showHoverAndDownStates: function() {
		this.set_showHoverAndDownStates(true);
		return this.get_showHoverAndDownStates();
	}
	,__accessoryView: null
	,get_accessoryView: function() {
		return this.__accessoryView;
	}
	,set_accessoryView: function(value) {
		if(!this.setStyle("accessoryView")) {
			return this.__accessoryView;
		}
		if(this.__accessoryView == value) {
			return this.__accessoryView;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_accessoryView);
		this.__accessoryView = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__accessoryView;
	}
	,clearStyle_accessoryView: function() {
		this.set_accessoryView(null);
		return this.get_accessoryView();
	}
	,get_styleContext: function() {
		return feathers_controls_dataRenderers_ItemRenderer;
	}
	,__class__: feathers_controls_dataRenderers_ItemRenderer
	,__properties__: $extend(feathers_controls_ToggleButton.prototype.__properties__,{set_accessoryView:"set_accessoryView",get_accessoryView:"get_accessoryView",set_showHoverAndDownStates:"set_showHoverAndDownStates",get_showHoverAndDownStates:"get_showHoverAndDownStates",set_showSecondaryText:"set_showSecondaryText",get_showSecondaryText:"get_showSecondaryText",set_alternateBackgroundSkin:"set_alternateBackgroundSkin",get_alternateBackgroundSkin:"get_alternateBackgroundSkin",set_selectedSecondaryTextFormat:"set_selectedSecondaryTextFormat",get_selectedSecondaryTextFormat:"get_selectedSecondaryTextFormat",set_disabledSecondaryTextFormat:"set_disabledSecondaryTextFormat",get_disabledSecondaryTextFormat:"get_disabledSecondaryTextFormat",set_secondaryTextFormat:"set_secondaryTextFormat",get_secondaryTextFormat:"get_secondaryTextFormat",set_pointerTarget:"set_pointerTarget",get_pointerTarget:"get_pointerTarget",set_layoutIndex:"set_layoutIndex",get_layoutIndex:"get_layoutIndex",set_childFocusEnabled:"set_childFocusEnabled",get_childFocusEnabled:"get_childFocusEnabled",set_secondaryHtmlText:"set_secondaryHtmlText",get_secondaryHtmlText:"get_secondaryHtmlText",set_secondaryText:"set_secondaryText",get_secondaryText:"get_secondaryText",set_data:"set_data",get_data:"get_data"})
});
var feathers_controls_dataRenderers_IOptionalHierarchyItemRenderer = function() { };
$hxClasses["feathers.controls.dataRenderers.IOptionalHierarchyItemRenderer"] = feathers_controls_dataRenderers_IOptionalHierarchyItemRenderer;
feathers_controls_dataRenderers_IOptionalHierarchyItemRenderer.__name__ = "feathers.controls.dataRenderers.IOptionalHierarchyItemRenderer";
feathers_controls_dataRenderers_IOptionalHierarchyItemRenderer.__isInterface__ = true;
feathers_controls_dataRenderers_IOptionalHierarchyItemRenderer.__interfaces__ = [feathers_core_IUIControl];
feathers_controls_dataRenderers_IOptionalHierarchyItemRenderer.prototype = {
	get_showHierarchy: null
	,set_showHierarchy: null
	,__class__: feathers_controls_dataRenderers_IOptionalHierarchyItemRenderer
	,__properties__: {set_showHierarchy:"set_showHierarchy",get_showHierarchy:"get_showHierarchy"}
};
var feathers_controls_dataRenderers_IHierarchicalDepthItemRenderer = function() { };
$hxClasses["feathers.controls.dataRenderers.IHierarchicalDepthItemRenderer"] = feathers_controls_dataRenderers_IHierarchicalDepthItemRenderer;
feathers_controls_dataRenderers_IHierarchicalDepthItemRenderer.__name__ = "feathers.controls.dataRenderers.IHierarchicalDepthItemRenderer";
feathers_controls_dataRenderers_IHierarchicalDepthItemRenderer.__isInterface__ = true;
feathers_controls_dataRenderers_IHierarchicalDepthItemRenderer.__interfaces__ = [feathers_core_IUIControl];
feathers_controls_dataRenderers_IHierarchicalDepthItemRenderer.prototype = {
	get_hierarchyDepth: null
	,set_hierarchyDepth: null
	,__class__: feathers_controls_dataRenderers_IHierarchicalDepthItemRenderer
	,__properties__: {set_hierarchyDepth:"set_hierarchyDepth",get_hierarchyDepth:"get_hierarchyDepth"}
};
var feathers_controls_dataRenderers_IHierarchicalItemRenderer = function() { };
$hxClasses["feathers.controls.dataRenderers.IHierarchicalItemRenderer"] = feathers_controls_dataRenderers_IHierarchicalItemRenderer;
feathers_controls_dataRenderers_IHierarchicalItemRenderer.__name__ = "feathers.controls.dataRenderers.IHierarchicalItemRenderer";
feathers_controls_dataRenderers_IHierarchicalItemRenderer.__isInterface__ = true;
feathers_controls_dataRenderers_IHierarchicalItemRenderer.__interfaces__ = [feathers_core_IUIControl];
feathers_controls_dataRenderers_IHierarchicalItemRenderer.prototype = {
	get_branch: null
	,set_branch: null
	,__class__: feathers_controls_dataRenderers_IHierarchicalItemRenderer
	,__properties__: {set_branch:"set_branch",get_branch:"get_branch"}
};
var feathers_controls_dataRenderers_HierarchicalItemRenderer = function() {
	this.__customDisclosureButtonVariant = null;
	this.__leafIcon = null;
	this.__branchClosedIcon = null;
	this.__branchOpenIcon = null;
	this.__branchIcon = null;
	this.__indentation = 0.0;
	this._previousCustomDisclosureButtonVariant = null;
	this._ignoreBranchOrLeafIconResizes = false;
	this._showHierarchy = true;
	this._ignoreOpenCloseChange = false;
	this._opened = false;
	this._branch = false;
	this._hierarchyDepth = 0;
	this.initializeHierarchicalItemRendererTheme();
	feathers_controls_dataRenderers_ItemRenderer.call(this);
};
$hxClasses["feathers.controls.dataRenderers.HierarchicalItemRenderer"] = feathers_controls_dataRenderers_HierarchicalItemRenderer;
feathers_controls_dataRenderers_HierarchicalItemRenderer.__name__ = "feathers.controls.dataRenderers.HierarchicalItemRenderer";
feathers_controls_dataRenderers_HierarchicalItemRenderer.__interfaces__ = [feathers_core_IOpenCloseToggle,feathers_controls_dataRenderers_IOptionalHierarchyItemRenderer,feathers_controls_dataRenderers_IHierarchicalDepthItemRenderer,feathers_controls_dataRenderers_IHierarchicalItemRenderer];
feathers_controls_dataRenderers_HierarchicalItemRenderer.__super__ = feathers_controls_dataRenderers_ItemRenderer;
feathers_controls_dataRenderers_HierarchicalItemRenderer.prototype = $extend(feathers_controls_dataRenderers_ItemRenderer.prototype,{
	_hierarchyDepth: null
	,get_hierarchyDepth: function() {
		return this._hierarchyDepth;
	}
	,set_hierarchyDepth: function(value) {
		if(this._hierarchyDepth == value) {
			return this._hierarchyDepth;
		}
		this._hierarchyDepth = value;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		return this._hierarchyDepth;
	}
	,_branch: null
	,get_branch: function() {
		return this._branch;
	}
	,set_branch: function(value) {
		if(this._branch == value) {
			return this._branch;
		}
		this._branch = value;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		return this._branch;
	}
	,_opened: null
	,get_opened: function() {
		return this._opened;
	}
	,set_opened: function(value) {
		if(this._opened == value) {
			return this._opened;
		}
		this._opened = value;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		if(this._opened) {
			feathers_events_FeathersEvent.dispatch(this,"open");
		} else {
			feathers_events_FeathersEvent.dispatch(this,"close");
		}
		return this._opened;
	}
	,_ignoreOpenCloseChange: null
	,_showHierarchy: null
	,get_showHierarchy: function() {
		return this._showHierarchy;
	}
	,set_showHierarchy: function(value) {
		if(this._showHierarchy == value) {
			return this._showHierarchy;
		}
		this._showHierarchy = value;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		return this._showHierarchy;
	}
	,_currentBranchOrLeafIcon: null
	,_branchOrLeafIconMeasurements: null
	,_ignoreBranchOrLeafIconResizes: null
	,disclosureButton: null
	,_previousCustomDisclosureButtonVariant: null
	,_oldDisclosureButtonFactory: null
	,_disclosureButtonFactory: null
	,get_disclosureButtonFactory: function() {
		return this._disclosureButtonFactory;
	}
	,set_disclosureButtonFactory: function(value) {
		if(this._disclosureButtonFactory == value) {
			return this._disclosureButtonFactory;
		}
		this._disclosureButtonFactory = value;
		this.setInvalid(feathers_controls_dataRenderers_HierarchicalItemRenderer.INVALIDATION_FLAG_DISCLOSURE_BUTTON_FACTORY);
		return this._disclosureButtonFactory;
	}
	,dispose: function() {
		this.destroyDisclosureButton();
		feathers_controls_dataRenderers_ItemRenderer.prototype.dispose.call(this);
	}
	,initializeHierarchicalItemRendererTheme: function() {
		feathers_themes_steel_components_SteelHierarchicalItemRendererStyles.initialize();
	}
	,update: function() {
		var dataInvalid = this.isInvalid(feathers_core_InvalidationFlag.DATA);
		var stateInvalid = this.isInvalid(feathers_core_InvalidationFlag.STATE);
		var stylesInvalid = this.isInvalid(feathers_core_InvalidationFlag.STYLES);
		if(this._previousCustomDisclosureButtonVariant != this.get_customDisclosureButtonVariant()) {
			this.setInvalidationFlag(feathers_controls_dataRenderers_HierarchicalItemRenderer.INVALIDATION_FLAG_DISCLOSURE_BUTTON_FACTORY);
		}
		var disclosureButtonFactoryInvalid = this.isInvalid(feathers_controls_dataRenderers_HierarchicalItemRenderer.INVALIDATION_FLAG_DISCLOSURE_BUTTON_FACTORY);
		if(disclosureButtonFactoryInvalid) {
			this.createDisclosureButton();
		}
		if(stylesInvalid || stateInvalid || dataInvalid) {
			this.refreshBranchOrLeafIcon();
		}
		if(dataInvalid) {
			this.refreshBranchOrLeafStatus();
		}
		if(stateInvalid || disclosureButtonFactoryInvalid) {
			this.disclosureButton.set_enabled(this._enabled);
		}
		if(dataInvalid || disclosureButtonFactoryInvalid) {
			this.refreshOpenedState();
		}
		feathers_controls_dataRenderers_ItemRenderer.prototype.update.call(this);
		this._previousCustomDisclosureButtonVariant = this.get_customDisclosureButtonVariant();
	}
	,calculateExplicitWidthForTextMeasurement: function() {
		var textFieldExplicitWidth = feathers_controls_dataRenderers_ItemRenderer.prototype.calculateExplicitWidthForTextMeasurement.call(this);
		if(textFieldExplicitWidth == null || !this._showHierarchy) {
			return textFieldExplicitWidth;
		}
		var adjustedGap = this.get_gap();
		if(adjustedGap == 1.0 / 0.0) {
			adjustedGap = this.get_minGap();
		}
		var indent = this._showHierarchy ? this.get_indentation() * this._hierarchyDepth : 0;
		textFieldExplicitWidth -= indent;
		this.disclosureButton.validateNow();
		textFieldExplicitWidth -= this.disclosureButton.get_width() + adjustedGap;
		if(this._currentBranchOrLeafIcon != null) {
			var oldgnoreBranchOrLeafIconResizes = this._ignoreBranchOrLeafIconResizes;
			this._ignoreBranchOrLeafIconResizes = true;
			if(js_Boot.__implements(this._currentBranchOrLeafIcon,feathers_core_IValidating)) {
				this._currentBranchOrLeafIcon.validateNow();
			}
			this._ignoreBranchOrLeafIconResizes = oldgnoreBranchOrLeafIconResizes;
			textFieldExplicitWidth -= this._currentBranchOrLeafIcon.get_width() + adjustedGap;
		}
		if(textFieldExplicitWidth < 0.0) {
			textFieldExplicitWidth = 0.0;
		}
		return textFieldExplicitWidth;
	}
	,measureContentWidth: function() {
		var contentWidth = feathers_controls_dataRenderers_ItemRenderer.prototype.measureContentWidth.call(this);
		if(!this._showHierarchy) {
			return contentWidth;
		}
		this.disclosureButton.validateNow();
		var oldgnoreBranchOrLeafIconResizes = this._ignoreBranchOrLeafIconResizes;
		this._ignoreBranchOrLeafIconResizes = true;
		if(js_Boot.__implements(this._currentBranchOrLeafIcon,feathers_core_IValidating)) {
			this._currentBranchOrLeafIcon.validateNow();
		}
		this._ignoreBranchOrLeafIconResizes = oldgnoreBranchOrLeafIconResizes;
		var adjustedGap = this.get_gap();
		if(adjustedGap == 1.0 / 0.0) {
			adjustedGap = this.get_minGap();
		}
		var indent = this._showHierarchy ? this.get_indentation() * this._hierarchyDepth : 0;
		contentWidth += indent + this.disclosureButton.get_width() + adjustedGap;
		if(this._currentBranchOrLeafIcon != null) {
			contentWidth += this._currentBranchOrLeafIcon.get_width() + adjustedGap;
		}
		return contentWidth;
	}
	,measureContentMinWidth: function() {
		var contentMinWidth = feathers_controls_dataRenderers_ItemRenderer.prototype.measureContentMinWidth.call(this);
		if(!this._showHierarchy) {
			return contentMinWidth;
		}
		this.disclosureButton.validateNow();
		var oldgnoreBranchOrLeafIconResizes = this._ignoreBranchOrLeafIconResizes;
		this._ignoreBranchOrLeafIconResizes = true;
		if(js_Boot.__implements(this._currentBranchOrLeafIcon,feathers_core_IValidating)) {
			this._currentBranchOrLeafIcon.validateNow();
		}
		this._ignoreBranchOrLeafIconResizes = oldgnoreBranchOrLeafIconResizes;
		var adjustedGap = this.get_gap();
		if(adjustedGap == 1.0 / 0.0) {
			adjustedGap = this.get_minGap();
		}
		var indent = this._showHierarchy ? this.get_indentation() * this._hierarchyDepth : 0;
		contentMinWidth += indent + this.disclosureButton.get_width() + adjustedGap;
		if(this._currentBranchOrLeafIcon != null) {
			contentMinWidth += this._currentBranchOrLeafIcon.get_width() + adjustedGap;
		}
		return contentMinWidth;
	}
	,layoutChildren: function() {
		var _gthis = this;
		if(!this._showHierarchy) {
			feathers_controls_dataRenderers_ItemRenderer.prototype.layoutChildren.call(this);
			return;
		}
		this.disclosureButton.validateNow();
		var oldgnoreBranchOrLeafIconResizes = this._ignoreBranchOrLeafIconResizes;
		this._ignoreBranchOrLeafIconResizes = true;
		if(js_Boot.__implements(this._currentBranchOrLeafIcon,feathers_core_IValidating)) {
			this._currentBranchOrLeafIcon.validateNow();
		}
		this._ignoreBranchOrLeafIconResizes = oldgnoreBranchOrLeafIconResizes;
		var paddingLeft = this.get_paddingLeft();
		var adjustedGap = this.get_gap();
		if(adjustedGap == 1.0 / 0.0) {
			adjustedGap = this.get_minGap();
		}
		var disclosureGap = adjustedGap;
		var branchOrLeafIconGap = adjustedGap;
		var indent = this._showHierarchy ? this.get_indentation() * this._hierarchyDepth : 0;
		this.runWithoutInvalidation(function() {
			var newPaddingLeft = paddingLeft + indent + _gthis.disclosureButton.get_width() + disclosureGap;
			if(_gthis._currentBranchOrLeafIcon != null) {
				newPaddingLeft += _gthis._currentBranchOrLeafIcon.get_width() + branchOrLeafIconGap;
			}
			_gthis.set_paddingLeft(newPaddingLeft);
		});
		feathers_controls_dataRenderers_ItemRenderer.prototype.layoutChildren.call(this);
		this.runWithoutInvalidation(function() {
			_gthis.set_paddingLeft(paddingLeft);
		});
		this.disclosureButton.set_x(this.get_paddingLeft() + indent);
		switch(this.get_verticalAlign()._hx_index) {
		case 0:
			this.disclosureButton.set_y(this.get_paddingTop());
			break;
		case 1:
			this.disclosureButton.set_y(Math.max(this.get_paddingTop(),this.get_paddingTop() + (this.actualHeight - this.get_paddingTop() - this.get_paddingBottom() - this.disclosureButton.get_height()) / 2.0));
			break;
		case 2:
			this.disclosureButton.set_y(Math.max(this.get_paddingTop(),this.get_paddingTop() + this.actualHeight - this.get_paddingTop() - this.get_paddingBottom() - this.disclosureButton.get_height()));
			break;
		default:
			throw new openfl_errors_ArgumentError("Unknown vertical align: " + Std.string(this.get_verticalAlign()));
		}
		if(this._currentBranchOrLeafIcon != null) {
			this._currentBranchOrLeafIcon.set_x(this.disclosureButton.get_x() + this.disclosureButton.get_width() + disclosureGap);
			switch(this.get_verticalAlign()._hx_index) {
			case 0:
				this._currentBranchOrLeafIcon.set_y(this.get_paddingTop());
				break;
			case 1:
				this._currentBranchOrLeafIcon.set_y(Math.max(this.get_paddingTop(),this.get_paddingTop() + (this.actualHeight - this.get_paddingTop() - this.get_paddingBottom() - this._currentBranchOrLeafIcon.get_height()) / 2.0));
				break;
			case 2:
				this._currentBranchOrLeafIcon.set_y(Math.max(this.get_paddingTop(),this.get_paddingTop() + this.actualHeight - this.get_paddingTop() - this.get_paddingBottom() - this._currentBranchOrLeafIcon.get_height()));
				break;
			default:
				throw new openfl_errors_ArgumentError("Unknown vertical align: " + Std.string(this.get_verticalAlign()));
			}
		}
	}
	,createDisclosureButton: function() {
		this.destroyDisclosureButton();
		var factory = this._disclosureButtonFactory != null ? this._disclosureButtonFactory : feathers_controls_dataRenderers_HierarchicalItemRenderer.defaultDisclosureButtonFactory;
		this._oldDisclosureButtonFactory = factory;
		this.disclosureButton = factory.create();
		if(this.disclosureButton.get_variant() == null) {
			this.disclosureButton.set_variant(this.get_customDisclosureButtonVariant() != null ? this.get_customDisclosureButtonVariant() : feathers_controls_dataRenderers_HierarchicalItemRenderer.CHILD_VARIANT_DISCLOSURE_BUTTON);
		}
		this.disclosureButton.set_tabEnabled(false);
		this.disclosureButton.addEventListener("change",$bind(this,this.hierarchicalItemRenderer_disclosureButton_changeHandler));
		this.disclosureButton.initializeNow();
		this.addChild(this.disclosureButton);
	}
	,destroyDisclosureButton: function() {
		if(this.disclosureButton == null) {
			return;
		}
		this.disclosureButton.removeEventListener("change",$bind(this,this.hierarchicalItemRenderer_disclosureButton_changeHandler));
		this.removeChild(this.disclosureButton);
		if(this._oldDisclosureButtonFactory.destroy != null) {
			this._oldDisclosureButtonFactory.destroy(this.disclosureButton);
		}
		this._oldDisclosureButtonFactory = null;
		this.disclosureButton = null;
	}
	,refreshBranchOrLeafIcon: function() {
		var oldIcon = this._currentBranchOrLeafIcon;
		this._currentBranchOrLeafIcon = this.getCurrentBranchOrLeafIcon();
		if(this._currentBranchOrLeafIcon != null) {
			this._currentBranchOrLeafIcon.set_visible(this._showHierarchy);
		}
		if(this._currentBranchOrLeafIcon == oldIcon) {
			return;
		}
		this.removeCurrentBranchOrLeafIcon(oldIcon);
		this.addCurrentBranchOrLeafIcon(this._currentBranchOrLeafIcon);
	}
	,getCurrentBranchOrLeafIcon: function() {
		if(this._branch) {
			if(this._opened && this.get_branchOpenIcon() != null) {
				return this.get_branchOpenIcon();
			}
			if(!this._opened && this.get_branchClosedIcon() != null) {
				return this.get_branchClosedIcon();
			}
			return this.get_branchIcon();
		}
		return this.get_leafIcon();
	}
	,removeCurrentBranchOrLeafIcon: function(icon) {
		if(icon == null) {
			return;
		}
		icon.removeEventListener("resize",$bind(this,this.hierarchicalItemRenderer_branchOrLeafIcon_resizeHandler));
		if(js_Boot.__implements(icon,feathers_skins_IProgrammaticSkin)) {
			icon.set_uiContext(null);
		}
		if(js_Boot.__implements(icon,feathers_core_IStateObserver)) {
			icon.set_stateContext(null);
		}
		this._branchOrLeafIconMeasurements.restore(icon);
		if(icon.parent == this) {
			this.removeChild(icon);
		}
	}
	,addCurrentBranchOrLeafIcon: function(icon) {
		if(icon == null) {
			this._branchOrLeafIconMeasurements = null;
			return;
		}
		if(js_Boot.__implements(icon,feathers_core_IUIControl)) {
			icon.initializeNow();
		}
		if(this._branchOrLeafIconMeasurements == null) {
			this._branchOrLeafIconMeasurements = new feathers_layout_Measurements(icon);
		} else {
			this._branchOrLeafIconMeasurements.save(icon);
		}
		if(js_Boot.__implements(icon,feathers_skins_IProgrammaticSkin)) {
			icon.set_uiContext(this);
		}
		if(js_Boot.__implements(icon,feathers_core_IStateObserver)) {
			icon.set_stateContext(this);
		}
		icon.addEventListener("resize",$bind(this,this.hierarchicalItemRenderer_branchOrLeafIcon_resizeHandler),false,0,true);
		this.addChild(icon);
	}
	,refreshBranchOrLeafStatus: function() {
		this.disclosureButton.set_visible(this._showHierarchy && this._branch);
	}
	,refreshOpenedState: function() {
		var oldIgnoreOpenCloseChange = this._ignoreOpenCloseChange;
		this._ignoreOpenCloseChange = true;
		this.disclosureButton.set_selected(this._opened);
		this._ignoreOpenCloseChange = oldIgnoreOpenCloseChange;
	}
	,hierarchicalItemRenderer_disclosureButton_changeHandler: function(event) {
		if(this._ignoreOpenCloseChange) {
			return;
		}
		this.set_opened(this.disclosureButton.get_selected());
	}
	,hierarchicalItemRenderer_branchOrLeafIcon_resizeHandler: function(event) {
		if(this._ignoreBranchOrLeafIconResizes) {
			return;
		}
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
	}
	,get_styleContext: function() {
		return feathers_controls_dataRenderers_HierarchicalItemRenderer;
	}
	,__indentation: null
	,get_indentation: function() {
		return this.__indentation;
	}
	,set_indentation: function(value) {
		if(!this.setStyle("indentation")) {
			return this.__indentation;
		}
		if(this.__indentation == value) {
			return this.__indentation;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_indentation);
		this.__indentation = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__indentation;
	}
	,clearStyle_indentation: function() {
		this.set_indentation(0.0);
		return this.get_indentation();
	}
	,__branchIcon: null
	,get_branchIcon: function() {
		return this.__branchIcon;
	}
	,set_branchIcon: function(value) {
		if(!this.setStyle("branchIcon")) {
			return this.__branchIcon;
		}
		if(this.__branchIcon == value) {
			return this.__branchIcon;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_branchIcon);
		this.__branchIcon = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__branchIcon;
	}
	,clearStyle_branchIcon: function() {
		this.set_branchIcon(null);
		return this.get_branchIcon();
	}
	,__branchOpenIcon: null
	,get_branchOpenIcon: function() {
		return this.__branchOpenIcon;
	}
	,set_branchOpenIcon: function(value) {
		if(!this.setStyle("branchOpenIcon")) {
			return this.__branchOpenIcon;
		}
		if(this.__branchOpenIcon == value) {
			return this.__branchOpenIcon;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_branchOpenIcon);
		this.__branchOpenIcon = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__branchOpenIcon;
	}
	,clearStyle_branchOpenIcon: function() {
		this.set_branchOpenIcon(null);
		return this.get_branchOpenIcon();
	}
	,__branchClosedIcon: null
	,get_branchClosedIcon: function() {
		return this.__branchClosedIcon;
	}
	,set_branchClosedIcon: function(value) {
		if(!this.setStyle("branchClosedIcon")) {
			return this.__branchClosedIcon;
		}
		if(this.__branchClosedIcon == value) {
			return this.__branchClosedIcon;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_branchClosedIcon);
		this.__branchClosedIcon = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__branchClosedIcon;
	}
	,clearStyle_branchClosedIcon: function() {
		this.set_branchClosedIcon(null);
		return this.get_branchClosedIcon();
	}
	,__leafIcon: null
	,get_leafIcon: function() {
		return this.__leafIcon;
	}
	,set_leafIcon: function(value) {
		if(!this.setStyle("leafIcon")) {
			return this.__leafIcon;
		}
		if(this.__leafIcon == value) {
			return this.__leafIcon;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_leafIcon);
		this.__leafIcon = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__leafIcon;
	}
	,clearStyle_leafIcon: function() {
		this.set_leafIcon(null);
		return this.get_leafIcon();
	}
	,__customDisclosureButtonVariant: null
	,get_customDisclosureButtonVariant: function() {
		return this.__customDisclosureButtonVariant;
	}
	,set_customDisclosureButtonVariant: function(value) {
		if(!this.setStyle("customDisclosureButtonVariant")) {
			return this.__customDisclosureButtonVariant;
		}
		if(this.__customDisclosureButtonVariant == value) {
			return this.__customDisclosureButtonVariant;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_customDisclosureButtonVariant);
		this.__customDisclosureButtonVariant = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__customDisclosureButtonVariant;
	}
	,clearStyle_customDisclosureButtonVariant: function() {
		this.set_customDisclosureButtonVariant(null);
		return this.get_customDisclosureButtonVariant();
	}
	,__class__: feathers_controls_dataRenderers_HierarchicalItemRenderer
	,__properties__: $extend(feathers_controls_dataRenderers_ItemRenderer.prototype.__properties__,{set_disclosureButtonFactory:"set_disclosureButtonFactory",get_disclosureButtonFactory:"get_disclosureButtonFactory",set_customDisclosureButtonVariant:"set_customDisclosureButtonVariant",get_customDisclosureButtonVariant:"get_customDisclosureButtonVariant",set_leafIcon:"set_leafIcon",get_leafIcon:"get_leafIcon",set_branchClosedIcon:"set_branchClosedIcon",get_branchClosedIcon:"get_branchClosedIcon",set_branchOpenIcon:"set_branchOpenIcon",get_branchOpenIcon:"get_branchOpenIcon",set_branchIcon:"set_branchIcon",get_branchIcon:"get_branchIcon",set_indentation:"set_indentation",get_indentation:"get_indentation",set_showHierarchy:"set_showHierarchy",get_showHierarchy:"get_showHierarchy",set_opened:"set_opened",get_opened:"get_opened",set_branch:"set_branch",get_branch:"get_branch",set_hierarchyDepth:"set_hierarchyDepth",get_hierarchyDepth:"get_hierarchyDepth"})
});
var feathers_controls_dataRenderers_IGridViewCellRenderer = function() { };
$hxClasses["feathers.controls.dataRenderers.IGridViewCellRenderer"] = feathers_controls_dataRenderers_IGridViewCellRenderer;
feathers_controls_dataRenderers_IGridViewCellRenderer.__name__ = "feathers.controls.dataRenderers.IGridViewCellRenderer";
feathers_controls_dataRenderers_IGridViewCellRenderer.__isInterface__ = true;
feathers_controls_dataRenderers_IGridViewCellRenderer.__interfaces__ = [feathers_core_IUIControl];
feathers_controls_dataRenderers_IGridViewCellRenderer.prototype = {
	get_column: null
	,set_column: null
	,get_columnIndex: null
	,set_columnIndex: null
	,get_rowIndex: null
	,set_rowIndex: null
	,get_gridViewOwner: null
	,set_gridViewOwner: null
	,__class__: feathers_controls_dataRenderers_IGridViewCellRenderer
	,__properties__: {set_gridViewOwner:"set_gridViewOwner",get_gridViewOwner:"get_gridViewOwner",set_rowIndex:"set_rowIndex",get_rowIndex:"get_rowIndex",set_columnIndex:"set_columnIndex",get_columnIndex:"get_columnIndex",set_column:"set_column",get_column:"get_column"}
};
var feathers_controls_dataRenderers_IGridViewHeaderRenderer = function() { };
$hxClasses["feathers.controls.dataRenderers.IGridViewHeaderRenderer"] = feathers_controls_dataRenderers_IGridViewHeaderRenderer;
feathers_controls_dataRenderers_IGridViewHeaderRenderer.__name__ = "feathers.controls.dataRenderers.IGridViewHeaderRenderer";
feathers_controls_dataRenderers_IGridViewHeaderRenderer.__isInterface__ = true;
feathers_controls_dataRenderers_IGridViewHeaderRenderer.__interfaces__ = [feathers_core_IUIControl];
feathers_controls_dataRenderers_IGridViewHeaderRenderer.prototype = {
	get_column: null
	,set_column: null
	,get_columnIndex: null
	,set_columnIndex: null
	,get_gridViewOwner: null
	,set_gridViewOwner: null
	,__class__: feathers_controls_dataRenderers_IGridViewHeaderRenderer
	,__properties__: {set_gridViewOwner:"set_gridViewOwner",get_gridViewOwner:"get_gridViewOwner",set_columnIndex:"set_columnIndex",get_columnIndex:"get_columnIndex",set_column:"set_column",get_column:"get_column"}
};
var feathers_controls_dataRenderers_IGroupListViewItemRenderer = function() { };
$hxClasses["feathers.controls.dataRenderers.IGroupListViewItemRenderer"] = feathers_controls_dataRenderers_IGroupListViewItemRenderer;
feathers_controls_dataRenderers_IGroupListViewItemRenderer.__name__ = "feathers.controls.dataRenderers.IGroupListViewItemRenderer";
feathers_controls_dataRenderers_IGroupListViewItemRenderer.__isInterface__ = true;
feathers_controls_dataRenderers_IGroupListViewItemRenderer.__interfaces__ = [feathers_core_IUIControl];
feathers_controls_dataRenderers_IGroupListViewItemRenderer.prototype = {
	get_location: null
	,set_location: null
	,get_groupListViewOwner: null
	,set_groupListViewOwner: null
	,__class__: feathers_controls_dataRenderers_IGroupListViewItemRenderer
	,__properties__: {set_groupListViewOwner:"set_groupListViewOwner",get_groupListViewOwner:"get_groupListViewOwner",set_location:"set_location",get_location:"get_location"}
};
var feathers_controls_dataRenderers_IListViewItemRenderer = function() { };
$hxClasses["feathers.controls.dataRenderers.IListViewItemRenderer"] = feathers_controls_dataRenderers_IListViewItemRenderer;
feathers_controls_dataRenderers_IListViewItemRenderer.__name__ = "feathers.controls.dataRenderers.IListViewItemRenderer";
feathers_controls_dataRenderers_IListViewItemRenderer.__isInterface__ = true;
feathers_controls_dataRenderers_IListViewItemRenderer.__interfaces__ = [feathers_core_IUIControl];
feathers_controls_dataRenderers_IListViewItemRenderer.prototype = {
	get_index: null
	,set_index: null
	,get_listViewOwner: null
	,set_listViewOwner: null
	,__class__: feathers_controls_dataRenderers_IListViewItemRenderer
	,__properties__: {set_listViewOwner:"set_listViewOwner",get_listViewOwner:"get_listViewOwner",set_index:"set_index",get_index:"get_index"}
};
var feathers_controls_dataRenderers_ITreeGridViewCellRenderer = function() { };
$hxClasses["feathers.controls.dataRenderers.ITreeGridViewCellRenderer"] = feathers_controls_dataRenderers_ITreeGridViewCellRenderer;
feathers_controls_dataRenderers_ITreeGridViewCellRenderer.__name__ = "feathers.controls.dataRenderers.ITreeGridViewCellRenderer";
feathers_controls_dataRenderers_ITreeGridViewCellRenderer.__isInterface__ = true;
feathers_controls_dataRenderers_ITreeGridViewCellRenderer.__interfaces__ = [feathers_controls_dataRenderers_IHierarchicalItemRenderer];
feathers_controls_dataRenderers_ITreeGridViewCellRenderer.prototype = {
	get_column: null
	,set_column: null
	,get_columnIndex: null
	,set_columnIndex: null
	,get_rowLocation: null
	,set_rowLocation: null
	,get_treeGridViewOwner: null
	,set_treeGridViewOwner: null
	,__class__: feathers_controls_dataRenderers_ITreeGridViewCellRenderer
	,__properties__: {set_treeGridViewOwner:"set_treeGridViewOwner",get_treeGridViewOwner:"get_treeGridViewOwner",set_rowLocation:"set_rowLocation",get_rowLocation:"get_rowLocation",set_columnIndex:"set_columnIndex",get_columnIndex:"get_columnIndex",set_column:"set_column",get_column:"get_column"}
};
var feathers_controls_dataRenderers_ITreeGridViewHeaderRenderer = function() { };
$hxClasses["feathers.controls.dataRenderers.ITreeGridViewHeaderRenderer"] = feathers_controls_dataRenderers_ITreeGridViewHeaderRenderer;
feathers_controls_dataRenderers_ITreeGridViewHeaderRenderer.__name__ = "feathers.controls.dataRenderers.ITreeGridViewHeaderRenderer";
feathers_controls_dataRenderers_ITreeGridViewHeaderRenderer.__isInterface__ = true;
feathers_controls_dataRenderers_ITreeGridViewHeaderRenderer.__interfaces__ = [feathers_core_IUIControl];
feathers_controls_dataRenderers_ITreeGridViewHeaderRenderer.prototype = {
	get_column: null
	,set_column: null
	,get_columnIndex: null
	,set_columnIndex: null
	,get_treeGridViewOwner: null
	,set_treeGridViewOwner: null
	,__class__: feathers_controls_dataRenderers_ITreeGridViewHeaderRenderer
	,__properties__: {set_treeGridViewOwner:"set_treeGridViewOwner",get_treeGridViewOwner:"get_treeGridViewOwner",set_columnIndex:"set_columnIndex",get_columnIndex:"get_columnIndex",set_column:"set_column",get_column:"get_column"}
};
var feathers_controls_dataRenderers_ITreeViewItemRenderer = function() { };
$hxClasses["feathers.controls.dataRenderers.ITreeViewItemRenderer"] = feathers_controls_dataRenderers_ITreeViewItemRenderer;
feathers_controls_dataRenderers_ITreeViewItemRenderer.__name__ = "feathers.controls.dataRenderers.ITreeViewItemRenderer";
feathers_controls_dataRenderers_ITreeViewItemRenderer.__isInterface__ = true;
feathers_controls_dataRenderers_ITreeViewItemRenderer.__interfaces__ = [feathers_controls_dataRenderers_IHierarchicalItemRenderer];
feathers_controls_dataRenderers_ITreeViewItemRenderer.prototype = {
	get_location: null
	,set_location: null
	,get_treeViewOwner: null
	,set_treeViewOwner: null
	,__class__: feathers_controls_dataRenderers_ITreeViewItemRenderer
	,__properties__: {set_treeViewOwner:"set_treeViewOwner",get_treeViewOwner:"get_treeViewOwner",set_location:"set_location",get_location:"get_location"}
};
var feathers_controls_dataRenderers_LayoutGroupItemRenderer = function() {
	this.__alternateBackgroundSkin = null;
	this.__selectedBackgroundSkin = null;
	this.__showHoverAndDownStates = true;
	this._stateToSkin = new haxe_ds_EnumValueMap();
	this._pointerToState = null;
	this._selected = false;
	this._layoutIndex = -1;
	this._currentState = feathers_controls_ToggleButtonState.UP(false);
	this.initializeLayoutGroupItemRendererTheme();
	feathers_controls_LayoutGroup.call(this);
};
$hxClasses["feathers.controls.dataRenderers.LayoutGroupItemRenderer"] = feathers_controls_dataRenderers_LayoutGroupItemRenderer;
feathers_controls_dataRenderers_LayoutGroupItemRenderer.__name__ = "feathers.controls.dataRenderers.LayoutGroupItemRenderer";
feathers_controls_dataRenderers_LayoutGroupItemRenderer.__interfaces__ = [feathers_core_IPointerDelegate,feathers_controls_IToggle,feathers_controls_dataRenderers_IDataRenderer,feathers_layout_ILayoutIndexObject,feathers_core_IStateContext];
feathers_controls_dataRenderers_LayoutGroupItemRenderer.__super__ = feathers_controls_LayoutGroup;
feathers_controls_dataRenderers_LayoutGroupItemRenderer.prototype = $extend(feathers_controls_LayoutGroup.prototype,{
	_data: null
	,get_data: function() {
		return this._data;
	}
	,set_data: function(value) {
		if(this._data == value) {
			return this._data;
		}
		this._data = value;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		feathers_events_FeathersEvent.dispatch(this,"dataChange");
		return this._data;
	}
	,_currentState: null
	,get_currentState: function() {
		return this._currentState;
	}
	,_layoutIndex: null
	,get_layoutIndex: function() {
		return this._layoutIndex;
	}
	,set_layoutIndex: function(value) {
		if(this._layoutIndex == value) {
			return this._layoutIndex;
		}
		this._layoutIndex = value;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this._layoutIndex;
	}
	,_selected: null
	,get_selected: function() {
		return this._selected;
	}
	,set_selected: function(value) {
		if(this._selected == value) {
			return this._selected;
		}
		this._selected = value;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		feathers_events_FeathersEvent.dispatch(this,"change");
		this.changeState(this.get_currentState());
		return this._selected;
	}
	,_pointerTarget: null
	,get_pointerTarget: function() {
		return this._pointerTarget;
	}
	,set_pointerTarget: function(value) {
		if(this._pointerTarget == value) {
			return this._pointerTarget;
		}
		this._pointerTarget = value;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		return this._pointerTarget;
	}
	,_pointerToState: null
	,_stateToSkin: null
	,getSkinForState: function(state) {
		return this._stateToSkin.get(state);
	}
	,setSkinForState: function(state,skin) {
		if(!this.setStyle("setSkinForState",state)) {
			return;
		}
		var oldSkin = this._stateToSkin.get(state);
		if(oldSkin != null && oldSkin == this._currentBackgroundSkin) {
			this.removeCurrentBackgroundSkin(oldSkin);
			this._currentBackgroundSkin = null;
		}
		if(skin == null) {
			this._stateToSkin.remove(state);
		} else {
			this._stateToSkin.set(state,skin);
		}
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
	}
	,initializeLayoutGroupItemRendererTheme: function() {
		feathers_themes_steel_components_SteelLayoutGroupItemRendererStyles.initialize();
	}
	,initialize: function() {
		feathers_controls_LayoutGroup.prototype.initialize.call(this);
		if(this._pointerToState == null) {
			this._pointerToState = new feathers_utils_PointerToState(this,$bind(this,this.changeState),feathers_controls_ToggleButtonState.UP(false),feathers_controls_ToggleButtonState.DOWN(false),feathers_controls_ToggleButtonState.HOVER(false));
		}
		this._pointerToState.set_customHitTest($bind(this,this.customHitTest));
	}
	,update: function() {
		var dataInvalid = this.isInvalid(feathers_core_InvalidationFlag.DATA);
		var stylesInvalid = this.isInvalid(feathers_core_InvalidationFlag.STYLES);
		if(dataInvalid) {
			this._pointerToState.set_target(this._pointerTarget != null ? this._pointerTarget : this);
		}
		if(stylesInvalid) {
			this.refreshInteractivity();
		}
		feathers_controls_LayoutGroup.prototype.update.call(this);
	}
	,refreshInteractivity: function() {
		this._pointerToState.set_enabled(this.get_showHoverAndDownStates());
	}
	,customHitTest: function(stageX,stageY) {
		var value = this._pointerTarget;
		var pointerTargetContainer = ((value) instanceof openfl_display_DisplayObjectContainer) ? value : null;
		if(pointerTargetContainer == null) {
			pointerTargetContainer = this;
		}
		if(pointerTargetContainer.stage == null) {
			return false;
		}
		if(pointerTargetContainer.mouseChildren) {
			var objects = pointerTargetContainer.stage.getObjectsUnderPoint(new openfl_geom_Point(stageX,stageY));
			if(objects.length > 0) {
				var lastObject = objects[objects.length - 1];
				if(pointerTargetContainer.contains(lastObject)) {
					while(lastObject != null && lastObject != pointerTargetContainer) {
						if(((lastObject) instanceof openfl_display_InteractiveObject)) {
							var interactive = lastObject;
							if(!interactive.mouseEnabled) {
								lastObject = lastObject.parent;
								continue;
							}
						}
						if(js_Boot.__implements(lastObject,feathers_core_IFocusObject)) {
							var focusable = lastObject;
							if((this._pointerTarget == null || focusable.parent != this._pointerTarget) && focusable.get_focusEnabled()) {
								return false;
							}
						}
						lastObject = lastObject.parent;
					}
				}
			}
		}
		return true;
	}
	,changeState: function(state) {
		var toggleState = state;
		if(!this._enabled) {
			toggleState = feathers_controls_ToggleButtonState.DISABLED(this._selected);
		}
		switch(toggleState._hx_index) {
		case 0:
			var selected = toggleState.selected;
			if(this._selected != selected) {
				toggleState = feathers_controls_ToggleButtonState.UP(this._selected);
			}
			break;
		case 1:
			var selected = toggleState.selected;
			if(this._selected != selected) {
				toggleState = feathers_controls_ToggleButtonState.HOVER(this._selected);
			}
			break;
		case 2:
			var selected = toggleState.selected;
			if(this._selected != selected) {
				toggleState = feathers_controls_ToggleButtonState.DOWN(this._selected);
			}
			break;
		case 3:
			var selected = toggleState.selected;
			if(this._selected != selected) {
				toggleState = feathers_controls_ToggleButtonState.DISABLED(this._selected);
			}
			break;
		}
		if(this._currentState == toggleState) {
			return;
		}
		this._currentState = toggleState;
		this.setInvalid(feathers_core_InvalidationFlag.STATE);
		feathers_events_FeathersEvent.dispatch(this,"stateChange");
	}
	,getCurrentBackgroundSkin: function() {
		var result = this._stateToSkin.get(this._currentState);
		if(result != null) {
			return result;
		}
		if(!this._enabled && this.get_disabledBackgroundSkin() != null) {
			return this.get_disabledBackgroundSkin();
		}
		if(this._selected && this.get_selectedBackgroundSkin() != null) {
			return this.get_selectedBackgroundSkin();
		}
		if(this.get_alternateBackgroundSkin() != null && this._layoutIndex % 2 == 1) {
			return this.get_alternateBackgroundSkin();
		}
		return this.get_backgroundSkin();
	}
	,addCurrentBackgroundSkin: function(skin) {
		if(skin != null) {
			if(js_Boot.__implements(skin,feathers_core_IStateObserver)) {
				skin.set_stateContext(this);
			}
		}
		feathers_controls_LayoutGroup.prototype.addCurrentBackgroundSkin.call(this,skin);
	}
	,removeCurrentBackgroundSkin: function(skin) {
		if(skin != null) {
			if(js_Boot.__implements(skin,feathers_core_IStateObserver)) {
				skin.set_stateContext(null);
			}
		}
		feathers_controls_LayoutGroup.prototype.removeCurrentBackgroundSkin.call(this,skin);
	}
	,get_styleContext: function() {
		return feathers_controls_dataRenderers_LayoutGroupItemRenderer;
	}
	,__showHoverAndDownStates: null
	,get_showHoverAndDownStates: function() {
		return this.__showHoverAndDownStates;
	}
	,set_showHoverAndDownStates: function(value) {
		if(!this.setStyle("showHoverAndDownStates")) {
			return this.__showHoverAndDownStates;
		}
		if(this.__showHoverAndDownStates == value) {
			return this.__showHoverAndDownStates;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_showHoverAndDownStates);
		this.__showHoverAndDownStates = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__showHoverAndDownStates;
	}
	,clearStyle_showHoverAndDownStates: function() {
		this.set_showHoverAndDownStates(true);
		return this.get_showHoverAndDownStates();
	}
	,__selectedBackgroundSkin: null
	,get_selectedBackgroundSkin: function() {
		return this.__selectedBackgroundSkin;
	}
	,set_selectedBackgroundSkin: function(value) {
		if(!this.setStyle("selectedBackgroundSkin")) {
			return this.__selectedBackgroundSkin;
		}
		if(this.__selectedBackgroundSkin == value) {
			return this.__selectedBackgroundSkin;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_selectedBackgroundSkin);
		this.__selectedBackgroundSkin = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__selectedBackgroundSkin;
	}
	,clearStyle_selectedBackgroundSkin: function() {
		this.set_selectedBackgroundSkin(null);
		return this.get_selectedBackgroundSkin();
	}
	,__alternateBackgroundSkin: null
	,get_alternateBackgroundSkin: function() {
		return this.__alternateBackgroundSkin;
	}
	,set_alternateBackgroundSkin: function(value) {
		if(!this.setStyle("alternateBackgroundSkin")) {
			return this.__alternateBackgroundSkin;
		}
		if(this.__alternateBackgroundSkin == value) {
			return this.__alternateBackgroundSkin;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_alternateBackgroundSkin);
		this.__alternateBackgroundSkin = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__alternateBackgroundSkin;
	}
	,clearStyle_alternateBackgroundSkin: function() {
		this.set_alternateBackgroundSkin(null);
		return this.get_alternateBackgroundSkin();
	}
	,__class__: feathers_controls_dataRenderers_LayoutGroupItemRenderer
	,__properties__: $extend(feathers_controls_LayoutGroup.prototype.__properties__,{set_alternateBackgroundSkin:"set_alternateBackgroundSkin",get_alternateBackgroundSkin:"get_alternateBackgroundSkin",set_selectedBackgroundSkin:"set_selectedBackgroundSkin",get_selectedBackgroundSkin:"get_selectedBackgroundSkin",set_showHoverAndDownStates:"set_showHoverAndDownStates",get_showHoverAndDownStates:"get_showHoverAndDownStates",set_pointerTarget:"set_pointerTarget",get_pointerTarget:"get_pointerTarget",set_selected:"set_selected",get_selected:"get_selected",set_layoutIndex:"set_layoutIndex",get_layoutIndex:"get_layoutIndex",get_currentState:"get_currentState",set_data:"set_data",get_data:"get_data"})
});
var feathers_data_ISortOrderObserver = function() { };
$hxClasses["feathers.data.ISortOrderObserver"] = feathers_data_ISortOrderObserver;
feathers_data_ISortOrderObserver.__name__ = "feathers.data.ISortOrderObserver";
feathers_data_ISortOrderObserver.__isInterface__ = true;
feathers_data_ISortOrderObserver.prototype = {
	get_sortOrder: null
	,set_sortOrder: null
	,__class__: feathers_data_ISortOrderObserver
	,__properties__: {set_sortOrder:"set_sortOrder",get_sortOrder:"get_sortOrder"}
};
var feathers_controls_dataRenderers_SortOrderHeaderRenderer = function() {
	this.__sortDescendingIcon = null;
	this.__sortAscendingIcon = null;
	this._sortOrder = feathers_data_SortOrder.NONE;
	this.initializeSortOrderHeaderRendererTheme();
	feathers_controls_dataRenderers_ItemRenderer.call(this);
	this.set_toggleable(false);
};
$hxClasses["feathers.controls.dataRenderers.SortOrderHeaderRenderer"] = feathers_controls_dataRenderers_SortOrderHeaderRenderer;
feathers_controls_dataRenderers_SortOrderHeaderRenderer.__name__ = "feathers.controls.dataRenderers.SortOrderHeaderRenderer";
feathers_controls_dataRenderers_SortOrderHeaderRenderer.__interfaces__ = [feathers_data_ISortOrderObserver];
feathers_controls_dataRenderers_SortOrderHeaderRenderer.__super__ = feathers_controls_dataRenderers_ItemRenderer;
feathers_controls_dataRenderers_SortOrderHeaderRenderer.prototype = $extend(feathers_controls_dataRenderers_ItemRenderer.prototype,{
	_sortOrder: null
	,get_sortOrder: function() {
		return this._sortOrder;
	}
	,set_sortOrder: function(value) {
		if(this._sortOrder == value) {
			return this._sortOrder;
		}
		this._sortOrder = value;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		return this._sortOrder;
	}
	,_currentSortOrderIcon: null
	,_sortOrderIconMeasurements: null
	,initializeSortOrderHeaderRendererTheme: function() {
		feathers_themes_steel_components_SteelSortOrderHeaderRendererStyles.initialize();
	}
	,update: function() {
		var dataInvalid = this.isInvalid(feathers_core_InvalidationFlag.DATA);
		var stateInvalid = this.isInvalid(feathers_core_InvalidationFlag.STATE);
		var stylesInvalid = this.isInvalid(feathers_core_InvalidationFlag.STYLES);
		if(stylesInvalid || stateInvalid || dataInvalid) {
			this.refreshSortOrderIcon();
		}
		feathers_controls_dataRenderers_ItemRenderer.prototype.update.call(this);
	}
	,calculateExplicitWidthForTextMeasurement: function() {
		var textFieldExplicitWidth = feathers_controls_dataRenderers_ItemRenderer.prototype.calculateExplicitWidthForTextMeasurement.call(this);
		if(textFieldExplicitWidth == null) {
			return textFieldExplicitWidth;
		}
		var adjustedGap = this.get_gap();
		if(adjustedGap == 1.0 / 0.0) {
			adjustedGap = this.get_minGap();
		}
		if(this._currentSortOrderIcon != null) {
			if(js_Boot.__implements(this._currentSortOrderIcon,feathers_core_IValidating)) {
				this._currentSortOrderIcon.validateNow();
			}
			textFieldExplicitWidth -= this._currentSortOrderIcon.get_width() + adjustedGap;
		}
		if(textFieldExplicitWidth < 0.0) {
			textFieldExplicitWidth = 0.0;
		}
		return textFieldExplicitWidth;
	}
	,measureContentWidth: function() {
		var contentWidth = feathers_controls_dataRenderers_ItemRenderer.prototype.measureContentWidth.call(this);
		if(js_Boot.__implements(this._currentSortOrderIcon,feathers_core_IValidating)) {
			this._currentSortOrderIcon.validateNow();
		}
		var adjustedGap = this.get_gap();
		if(adjustedGap == 1.0 / 0.0) {
			adjustedGap = this.get_minGap();
		}
		if(this._currentSortOrderIcon != null) {
			contentWidth += this._currentSortOrderIcon.get_width() + adjustedGap;
		}
		return contentWidth;
	}
	,measureContentMinWidth: function() {
		var contentMinWidth = feathers_controls_dataRenderers_ItemRenderer.prototype.measureContentMinWidth.call(this);
		if(js_Boot.__implements(this._currentSortOrderIcon,feathers_core_IValidating)) {
			this._currentSortOrderIcon.validateNow();
		}
		var adjustedGap = this.get_gap();
		if(adjustedGap == 1.0 / 0.0) {
			adjustedGap = this.get_minGap();
		}
		if(this._currentSortOrderIcon != null) {
			contentMinWidth += this._currentSortOrderIcon.get_width() + adjustedGap;
		}
		return contentMinWidth;
	}
	,layoutChildren: function() {
		var _gthis = this;
		if(js_Boot.__implements(this._currentSortOrderIcon,feathers_core_IValidating)) {
			this._currentSortOrderIcon.validateNow();
		}
		var paddingRight = this.get_paddingRight();
		var adjustedGap = this.get_gap();
		if(adjustedGap == 1.0 / 0.0) {
			adjustedGap = this.get_minGap();
		}
		this.runWithoutInvalidation(function() {
			var newPaddingRight = paddingRight;
			if(_gthis._currentSortOrderIcon != null) {
				newPaddingRight += _gthis._currentSortOrderIcon.get_width() + adjustedGap;
			}
			_gthis.set_paddingRight(newPaddingRight);
		});
		feathers_controls_dataRenderers_ItemRenderer.prototype.layoutChildren.call(this);
		this.runWithoutInvalidation(function() {
			_gthis.set_paddingRight(paddingRight);
		});
		if(this._currentSortOrderIcon != null) {
			this._currentSortOrderIcon.set_x(this.actualWidth - this.get_paddingRight() - this._currentSortOrderIcon.get_width());
			switch(this.get_verticalAlign()._hx_index) {
			case 0:
				this._currentSortOrderIcon.set_y(this.get_paddingTop());
				break;
			case 1:
				this._currentSortOrderIcon.set_y(Math.max(this.get_paddingTop(),this.get_paddingTop() + (this.actualHeight - this.get_paddingTop() - this.get_paddingBottom() - this._currentSortOrderIcon.get_height()) / 2.0));
				break;
			case 2:
				this._currentSortOrderIcon.set_y(Math.max(this.get_paddingTop(),this.get_paddingTop() + this.actualHeight - this.get_paddingTop() - this.get_paddingBottom() - this._currentSortOrderIcon.get_height()));
				break;
			default:
				throw new openfl_errors_ArgumentError("Unknown vertical align: " + Std.string(this.get_verticalAlign()));
			}
		}
	}
	,refreshSortOrderIcon: function() {
		var oldIcon = this._currentSortOrderIcon;
		this._currentSortOrderIcon = this.getCurrentSortOrderIcon();
		if(this._currentSortOrderIcon == oldIcon) {
			return;
		}
		this.removeCurrentSortOrderIcon(oldIcon);
		if(this._currentSortOrderIcon == null) {
			this._sortOrderIconMeasurements = null;
			return;
		}
		if(js_Boot.__implements(this._currentSortOrderIcon,feathers_core_IUIControl)) {
			this._currentSortOrderIcon.initializeNow();
		}
		if(this._sortOrderIconMeasurements == null) {
			this._sortOrderIconMeasurements = new feathers_layout_Measurements(this._currentSortOrderIcon);
		} else {
			this._sortOrderIconMeasurements.save(this._currentSortOrderIcon);
		}
		if(js_Boot.__implements(this._currentSortOrderIcon,feathers_skins_IProgrammaticSkin)) {
			this._currentSortOrderIcon.set_uiContext(this);
		}
		if(js_Boot.__implements(this._currentSortOrderIcon,feathers_core_IStateObserver)) {
			this._currentSortOrderIcon.set_stateContext(this);
		}
		this.addChild(this._currentSortOrderIcon);
	}
	,getCurrentSortOrderIcon: function() {
		switch(this._sortOrder._hx_index) {
		case 0:
			return this.get_sortAscendingIcon();
		case 1:
			return this.get_sortDescendingIcon();
		default:
			return null;
		}
	}
	,removeCurrentSortOrderIcon: function(icon) {
		if(icon == null) {
			return;
		}
		if(js_Boot.__implements(icon,feathers_skins_IProgrammaticSkin)) {
			icon.set_uiContext(null);
		}
		if(js_Boot.__implements(icon,feathers_core_IStateObserver)) {
			icon.set_stateContext(null);
		}
		this._sortOrderIconMeasurements.restore(icon);
		if(icon.parent == this) {
			this.removeChild(icon);
		}
	}
	,get_styleContext: function() {
		return feathers_controls_dataRenderers_SortOrderHeaderRenderer;
	}
	,__sortAscendingIcon: null
	,get_sortAscendingIcon: function() {
		return this.__sortAscendingIcon;
	}
	,set_sortAscendingIcon: function(value) {
		if(!this.setStyle("sortAscendingIcon")) {
			return this.__sortAscendingIcon;
		}
		if(this.__sortAscendingIcon == value) {
			return this.__sortAscendingIcon;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_sortAscendingIcon);
		this.__sortAscendingIcon = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__sortAscendingIcon;
	}
	,clearStyle_sortAscendingIcon: function() {
		this.set_sortAscendingIcon(null);
		return this.get_sortAscendingIcon();
	}
	,__sortDescendingIcon: null
	,get_sortDescendingIcon: function() {
		return this.__sortDescendingIcon;
	}
	,set_sortDescendingIcon: function(value) {
		if(!this.setStyle("sortDescendingIcon")) {
			return this.__sortDescendingIcon;
		}
		if(this.__sortDescendingIcon == value) {
			return this.__sortDescendingIcon;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_sortDescendingIcon);
		this.__sortDescendingIcon = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__sortDescendingIcon;
	}
	,clearStyle_sortDescendingIcon: function() {
		this.set_sortDescendingIcon(null);
		return this.get_sortDescendingIcon();
	}
	,__class__: feathers_controls_dataRenderers_SortOrderHeaderRenderer
	,__properties__: $extend(feathers_controls_dataRenderers_ItemRenderer.prototype.__properties__,{set_sortDescendingIcon:"set_sortDescendingIcon",get_sortDescendingIcon:"get_sortDescendingIcon",set_sortAscendingIcon:"set_sortAscendingIcon",get_sortAscendingIcon:"get_sortAscendingIcon",set_sortOrder:"set_sortOrder",get_sortOrder:"get_sortOrder"})
});
var feathers_data_TreeGridViewCellState = function(data,rowLocation,columnIndex,layoutIndex,branch,opened,selected,text) {
	if(selected == null) {
		selected = false;
	}
	if(opened == null) {
		opened = false;
	}
	if(branch == null) {
		branch = false;
	}
	if(layoutIndex == null) {
		layoutIndex = -1;
	}
	if(columnIndex == null) {
		columnIndex = -1;
	}
	this.enabled = true;
	this.selected = false;
	this.opened = false;
	this.branch = false;
	this.layoutIndex = -1;
	this.columnIndex = -1;
	this.rowLocation = null;
	this.data = data;
	this.rowLocation = rowLocation;
	this.columnIndex = columnIndex;
	this.layoutIndex = layoutIndex;
	this.branch = branch;
	this.opened = opened;
	this.selected = false;
	this.text = text;
};
$hxClasses["feathers.data.TreeGridViewCellState"] = feathers_data_TreeGridViewCellState;
feathers_data_TreeGridViewCellState.__name__ = "feathers.data.TreeGridViewCellState";
feathers_data_TreeGridViewCellState.prototype = {
	owner: null
	,data: null
	,rowLocation: null
	,columnIndex: null
	,layoutIndex: null
	,branch: null
	,opened: null
	,column: null
	,selected: null
	,text: null
	,enabled: null
	,__class__: feathers_data_TreeGridViewCellState
};
var feathers_controls_dataRenderers_TreeGridViewRowRenderer = function() {
	this._customCellRendererVariant = null;
	this._forceCellStateUpdate = false;
	this._columns = null;
	this._data = null;
	this._opened = false;
	this._branch = false;
	this._layoutIndex = -1;
	this._rowLocation = null;
	this._ignoreOpenedChange = false;
	this._ignoreSelectionChange = false;
	this._selected = false;
	this._currentState = feathers_controls_ToggleButtonState.UP(false);
	this.cellStatePool = new lime_utils_ObjectPool(function() {
		return new feathers_data_TreeGridViewCellState();
	});
	this._cellRendererToCellState = new haxe_ds_ObjectMap();
	this._columnToCellRenderer = new haxe_ds_ObjectMap();
	this._unrenderedData = [];
	this._additionalStorage = null;
	this._defaultStorage = new feathers_controls_dataRenderers__$TreeGridViewRowRenderer_CellRendererStorage();
	feathers_controls_LayoutGroup.call(this);
};
$hxClasses["feathers.controls.dataRenderers.TreeGridViewRowRenderer"] = feathers_controls_dataRenderers_TreeGridViewRowRenderer;
feathers_controls_dataRenderers_TreeGridViewRowRenderer.__name__ = "feathers.controls.dataRenderers.TreeGridViewRowRenderer";
feathers_controls_dataRenderers_TreeGridViewRowRenderer.__interfaces__ = [feathers_core_IStateContext,feathers_controls_dataRenderers_IDataRenderer,feathers_controls_IToggle,feathers_controls_ITriggerView];
feathers_controls_dataRenderers_TreeGridViewRowRenderer.defaultUpdateCellRenderer = function(cellRenderer,state) {
	if(js_Boot.__implements(cellRenderer,feathers_core_ITextControl)) {
		var textControl = cellRenderer;
		textControl.set_text(state.text);
	}
};
feathers_controls_dataRenderers_TreeGridViewRowRenderer.defaultResetCellRenderer = function(cellRenderer,state) {
	if(js_Boot.__implements(cellRenderer,feathers_core_ITextControl)) {
		var textControl = cellRenderer;
		textControl.set_text(null);
	}
};
feathers_controls_dataRenderers_TreeGridViewRowRenderer.__super__ = feathers_controls_LayoutGroup;
feathers_controls_dataRenderers_TreeGridViewRowRenderer.prototype = $extend(feathers_controls_LayoutGroup.prototype,{
	_defaultStorage: null
	,_additionalStorage: null
	,_unrenderedData: null
	,_columnToCellRenderer: null
	,_cellRendererToCellState: null
	,cellStatePool: null
	,_currentState: null
	,get_currentState: function() {
		return this._currentState;
	}
	,set_enabled: function(value) {
		feathers_controls_LayoutGroup.prototype.set_enabled.call(this,value);
		if(this._enabled) {
			var _g = this._currentState;
			if(_g._hx_index == 3) {
				var selected = _g.selected;
				this.changeState(feathers_controls_ToggleButtonState.UP(selected));
			}
		} else {
			this.changeState(feathers_controls_ToggleButtonState.DISABLED(this._selected));
		}
		return this._enabled;
	}
	,_treeGridView: null
	,get_treeGridView: function() {
		return this._treeGridView;
	}
	,set_treeGridView: function(value) {
		if(this._treeGridView == value) {
			return this._treeGridView;
		}
		if(this._treeGridView != null) {
			this._treeGridView.removeEventListener("keyDown",$bind(this,this.treeGridViewRowRenderer_treeGridView_keyDownHandler));
		}
		this._treeGridView = value;
		if(this._treeGridView != null) {
			this._treeGridView.addEventListener("keyDown",$bind(this,this.treeGridViewRowRenderer_treeGridView_keyDownHandler),false,0,true);
		} else {
			this.refreshInactiveCellRenderers(this._defaultStorage,true);
			if(this._additionalStorage != null) {
				var _g = 0;
				var _g1 = this._additionalStorage.length;
				while(_g < _g1) {
					var i = _g++;
					var storage = this._additionalStorage[i];
					this.refreshInactiveCellRenderers(storage,true);
				}
			}
		}
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		return this._treeGridView;
	}
	,_selected: null
	,get_selected: function() {
		return this._selected;
	}
	,set_selected: function(value) {
		if(this._selected == value) {
			return this._selected;
		}
		this._selected = value;
		this.setInvalid(feathers_core_InvalidationFlag.SELECTION);
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._selected;
	}
	,_ignoreSelectionChange: null
	,_ignoreOpenedChange: null
	,_rowLocation: null
	,get_rowLocation: function() {
		return this._rowLocation;
	}
	,set_rowLocation: function(value) {
		if(this._rowLocation == value) {
			return this._rowLocation;
		}
		this._rowLocation = value;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		return this._rowLocation;
	}
	,_layoutIndex: null
	,get_layoutIndex: function() {
		return this._layoutIndex;
	}
	,set_layoutIndex: function(value) {
		if(this._layoutIndex == value) {
			return this._layoutIndex;
		}
		this._layoutIndex = value;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		return this._layoutIndex;
	}
	,_branch: null
	,get_branch: function() {
		return this._branch;
	}
	,set_branch: function(value) {
		if(this._branch == value) {
			return this._branch;
		}
		this._branch = value;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		return this._branch;
	}
	,_opened: null
	,get_opened: function() {
		return this._branch;
	}
	,set_opened: function(value) {
		if(this._opened == value) {
			return this._opened;
		}
		this._opened = value;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		return this._opened;
	}
	,_data: null
	,get_data: function() {
		return this._data;
	}
	,set_data: function(value) {
		if(this._data == value) {
			return this._data;
		}
		this._data = value;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		return this._data;
	}
	,_columns: null
	,get_columns: function() {
		return this._columns;
	}
	,set_columns: function(value) {
		if(this._columns == value) {
			return this._columns;
		}
		if(this._columns != null) {
			this._columns.removeEventListener("change",$bind(this,this.treeGridViewRowRenderer_columns_changeHandler));
		}
		this._columns = value;
		if(this._columns != null) {
			this._columns.addEventListener("change",$bind(this,this.treeGridViewRowRenderer_columns_changeHandler),false,0,true);
		}
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		return this._columns;
	}
	,get_cellRendererRecycler: function() {
		return this._defaultStorage.cellRendererRecycler;
	}
	,set_cellRendererRecycler: function(value) {
		if(this._defaultStorage.cellRendererRecycler == value) {
			return this._defaultStorage.cellRendererRecycler;
		}
		this._defaultStorage.oldCellRendererRecycler = this._defaultStorage.cellRendererRecycler;
		this._defaultStorage.cellRendererRecycler = value;
		this._defaultStorage.measurements = null;
		this.setInvalid(feathers_controls_dataRenderers_TreeGridViewRowRenderer.INVALIDATION_FLAG_CELL_RENDERER_FACTORY);
		return this._defaultStorage.cellRendererRecycler;
	}
	,_forceCellStateUpdate: null
	,get_forceCellStateUpdate: function() {
		return this._forceCellStateUpdate;
	}
	,set_forceCellStateUpdate: function(value) {
		if(this._forceCellStateUpdate == value) {
			return this._forceCellStateUpdate;
		}
		this._forceCellStateUpdate = value;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		return this._forceCellStateUpdate;
	}
	,_customCellRendererVariant: null
	,get_customCellRendererVariant: function() {
		return this._customCellRendererVariant;
	}
	,set_customCellRendererVariant: function(value) {
		if(this._customCellRendererVariant == value) {
			return this._customCellRendererVariant;
		}
		this._customCellRendererVariant = value;
		this.setInvalid(feathers_controls_dataRenderers_TreeGridViewRowRenderer.INVALIDATION_FLAG_CELL_RENDERER_FACTORY);
		return this._customCellRendererVariant;
	}
	,_customColumnWidths: null
	,get_customColumnWidths: function() {
		return this._customColumnWidths;
	}
	,set_customColumnWidths: function(value) {
		if(this._customColumnWidths == value) {
			return this._customColumnWidths;
		}
		this._customColumnWidths = value;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		return this._customColumnWidths;
	}
	,_rowLayout: null
	,_pointerToState: null
	,_keyToState: null
	,dispose: function() {
		this.refreshInactiveCellRenderers(this._defaultStorage,true);
		if(this._additionalStorage != null) {
			var _g = 0;
			var _g1 = this._additionalStorage.length;
			while(_g < _g1) {
				var i = _g++;
				var storage = this._additionalStorage[i];
				this.refreshInactiveCellRenderers(storage,true);
			}
		}
		feathers_controls_LayoutGroup.prototype.dispose.call(this);
	}
	,columnToCellRenderer: function(column) {
		if(column == null) {
			return null;
		}
		return this._columnToCellRenderer.h[column.__id__];
	}
	,columnToCellState: function(column) {
		if(column == null) {
			return null;
		}
		var cellState = null;
		var cellRenderer = this._columnToCellRenderer.h[column.__id__];
		if(cellRenderer != null) {
			cellState = this._cellRendererToCellState.h[cellRenderer.__id__];
		} else {
			var columnIndex = this._columns.indexOf(column);
			if(columnIndex == -1) {
				return null;
			}
			cellState = new feathers_data_TreeGridViewCellState();
			this.populateCurrentItemState(column,columnIndex,cellState,false);
		}
		return cellState;
	}
	,initialize: function() {
		feathers_controls_LayoutGroup.prototype.initialize.call(this);
		if(this._pointerToState == null) {
			this._pointerToState = new feathers_utils_PointerToState(this,$bind(this,this.changeState),feathers_controls_ToggleButtonState.UP(false),feathers_controls_ToggleButtonState.DOWN(false),feathers_controls_ToggleButtonState.HOVER(false));
			this._pointerToState.set_customHitTest($bind(this,this.customHitTest));
		}
		if(this._keyToState == null) {
			this._keyToState = new feathers_utils_KeyToState(this,$bind(this,this.changeState),feathers_controls_ToggleButtonState.UP(false),feathers_controls_ToggleButtonState.DOWN(false));
		}
		if(this.get_layout() == null) {
			this._rowLayout = new feathers_layout_GridViewRowLayout();
			this.set_layout(this._rowLayout);
		}
	}
	,changeState: function(state) {
		var toggleState = state;
		if(!this._enabled) {
			toggleState = feathers_controls_ToggleButtonState.DISABLED(this._selected);
		}
		switch(toggleState._hx_index) {
		case 0:
			var selected = toggleState.selected;
			if(this._selected != selected) {
				toggleState = feathers_controls_ToggleButtonState.UP(this._selected);
			}
			break;
		case 1:
			var selected = toggleState.selected;
			if(this._selected != selected) {
				toggleState = feathers_controls_ToggleButtonState.HOVER(this._selected);
			}
			break;
		case 2:
			var selected = toggleState.selected;
			if(this._selected != selected) {
				toggleState = feathers_controls_ToggleButtonState.DOWN(this._selected);
			}
			break;
		case 3:
			var selected = toggleState.selected;
			if(this._selected != selected) {
				toggleState = feathers_controls_ToggleButtonState.DISABLED(this._selected);
			}
			break;
		}
		if(this._currentState == toggleState) {
			return;
		}
		this._currentState = toggleState;
		this.setInvalid(feathers_core_InvalidationFlag.STATE);
		feathers_events_FeathersEvent.dispatch(this,"stateChange");
	}
	,addCurrentBackgroundSkin: function(skin) {
		if(skin == null) {
			feathers_controls_LayoutGroup.prototype.addCurrentBackgroundSkin.call(this,skin);
			return;
		}
		if(js_Boot.__implements(skin,feathers_core_IStateObserver)) {
			skin.set_stateContext(this);
		}
		feathers_controls_LayoutGroup.prototype.addCurrentBackgroundSkin.call(this,skin);
	}
	,removeCurrentBackgroundSkin: function(skin) {
		if(skin == null) {
			feathers_controls_LayoutGroup.prototype.removeCurrentBackgroundSkin.call(this,skin);
			return;
		}
		if(js_Boot.__implements(skin,feathers_core_IStateObserver)) {
			skin.set_stateContext(null);
		}
		feathers_controls_LayoutGroup.prototype.removeCurrentBackgroundSkin.call(this,skin);
	}
	,updateCells: function() {
		var _g = 0;
		var _g1 = this._columns.get_length();
		while(_g < _g1) {
			var i = _g++;
			this.updateCellRendererForColumnIndex(i);
		}
	}
	,update: function() {
		this.preLayout();
		feathers_controls_LayoutGroup.prototype.update.call(this);
	}
	,preLayout: function() {
		this._rowLayout.set_columns(this._columns);
		this._rowLayout.set_customColumnWidths(this._customColumnWidths);
		if(this._defaultStorage.cellRendererRecycler.update == null) {
			this._defaultStorage.cellRendererRecycler.update = feathers_controls_dataRenderers_TreeGridViewRowRenderer.defaultUpdateCellRenderer;
			if(this._defaultStorage.cellRendererRecycler.reset == null) {
				this._defaultStorage.cellRendererRecycler.reset = feathers_controls_dataRenderers_TreeGridViewRowRenderer.defaultResetCellRenderer;
			}
		}
		var column = this._columns.iterator();
		while(column.hasNext()) {
			var column1 = column.next();
			if(column1.cellRendererRecycler != null) {
				if(column1.cellRendererRecycler.update == null) {
					column1.cellRendererRecycler.update = feathers_controls_dataRenderers_TreeGridViewRowRenderer.defaultUpdateCellRenderer;
					if(column1.cellRendererRecycler.reset == null) {
						column1.cellRendererRecycler.reset = feathers_controls_dataRenderers_TreeGridViewRowRenderer.defaultResetCellRenderer;
					}
				}
			}
		}
		this.refreshInactiveCellRenderers(this._defaultStorage,false);
		if(this._additionalStorage != null) {
			var _g = 0;
			var _g1 = this._additionalStorage.length;
			while(_g < _g1) {
				var i = _g++;
				var storage = this._additionalStorage[i];
				this.refreshInactiveCellRenderers(storage,false);
			}
		}
		this.findUnrenderedData();
		this.recoverInactiveCellRenderers(this._defaultStorage);
		if(this._additionalStorage != null) {
			var _g = 0;
			var _g1 = this._additionalStorage.length;
			while(_g < _g1) {
				var i = _g++;
				var storage = this._additionalStorage[i];
				this.recoverInactiveCellRenderers(storage);
			}
		}
		this.renderUnrenderedData();
		this.freeInactiveCellRenderers(this._defaultStorage);
		if(this._additionalStorage != null) {
			var _g = 0;
			var _g1 = this._additionalStorage.length;
			while(_g < _g1) {
				var i = _g++;
				var storage = this._additionalStorage[i];
				this.freeInactiveCellRenderers(storage);
			}
		}
		if(this._defaultStorage.inactiveCellRenderers.length > 0) {
			var c = js_Boot.getClass(this);
			throw new openfl_errors_IllegalOperationError("" + c.__name__ + ": inactive cell renderers should be empty after updating.");
		}
		if(this._additionalStorage != null) {
			var _g = 0;
			var _g1 = this._additionalStorage.length;
			while(_g < _g1) {
				var i = _g++;
				var storage = this._additionalStorage[i];
				if(storage.inactiveCellRenderers.length > 0) {
					var c = js_Boot.getClass(this);
					throw new openfl_errors_IllegalOperationError("" + c.__name__ + ": inactive cell renderers should be empty after updating.");
				}
			}
		}
	}
	,refreshInactiveCellRenderers: function(storage,forceCleanup) {
		var temp = storage.inactiveCellRenderers;
		storage.inactiveCellRenderers = storage.activeCellRenderers;
		storage.activeCellRenderers = temp;
		if(storage.activeCellRenderers.length > 0) {
			var c = js_Boot.getClass(this);
			throw new openfl_errors_IllegalOperationError("" + c.__name__ + ": active cell renderers should be empty before updating.");
		}
		if(forceCleanup) {
			this.recoverInactiveCellRenderers(storage);
			this.freeInactiveCellRenderers(storage);
			storage.oldCellRendererRecycler = null;
		}
	}
	,findUnrenderedData: function() {
		var currentChildIndex = 0;
		var _g = 0;
		var _g1 = this._columns.get_length();
		while(_g < _g1) {
			var i = _g++;
			var column = this._columns.get(i);
			var cellRenderer = this._columnToCellRenderer.h[column.__id__];
			if(cellRenderer != null) {
				var storage = this.cellRendererRecyclerToStorage(column.cellRendererRecycler);
				var state = this._cellRendererToCellState.h[cellRenderer.__id__];
				var changed = this.populateCurrentItemState(column,i,state,this._forceCellStateUpdate);
				if(changed) {
					this.updateCellRenderer(cellRenderer,state,storage);
				}
				this.setChildIndex(cellRenderer,currentChildIndex);
				var removed = HxOverrides.remove(storage.inactiveCellRenderers,cellRenderer);
				if(!removed) {
					var c = js_Boot.getClass(this);
					throw new openfl_errors_IllegalOperationError("" + c.__name__ + ": cell renderer map contains bad data for item at row location " + Std.string(this._rowLocation) + " and column index " + i + ". This may be caused by duplicate items in the data provider, which is not allowed.");
				}
				storage.activeCellRenderers.push(cellRenderer);
				++currentChildIndex;
			} else {
				this._unrenderedData.push(i);
			}
		}
	}
	,cellRendererRecyclerToStorage: function(recycler) {
		if(recycler == null) {
			return this._defaultStorage;
		}
		if(this._additionalStorage == null) {
			this._additionalStorage = [];
		}
		var _g = 0;
		var _g1 = this._additionalStorage.length;
		while(_g < _g1) {
			var i = _g++;
			var storage = this._additionalStorage[i];
			if(storage.cellRendererRecycler == recycler) {
				return storage;
			}
		}
		var storage = new feathers_controls_dataRenderers__$TreeGridViewRowRenderer_CellRendererStorage(recycler);
		this._additionalStorage.push(storage);
		return storage;
	}
	,recoverInactiveCellRenderers: function(storage) {
		var _g = 0;
		var _g1 = storage.inactiveCellRenderers;
		while(_g < _g1.length) {
			var cellRenderer = _g1[_g];
			++_g;
			if(cellRenderer == null) {
				continue;
			}
			var state = this._cellRendererToCellState.h[cellRenderer.__id__];
			if(state == null) {
				continue;
			}
			var column = state.column;
			this._cellRendererToCellState.remove(cellRenderer);
			this._columnToCellRenderer.remove(column);
			cellRenderer.removeEventListener("click",$bind(this,this.treeGridViewRowRenderer_cellRenderer_clickHandler));
			cellRenderer.removeEventListener("touchTap",$bind(this,this.treeGridViewRowRenderer_cellRenderer_touchTapHandler));
			cellRenderer.removeEventListener("trigger",$bind(this,this.treeGridViewRowRenderer_cellRenderer_triggerHandler));
			cellRenderer.removeEventListener("change",$bind(this,this.treeGridViewRowRenderer_cellRenderer_changeHandler));
			cellRenderer.removeEventListener("resize",$bind(this,this.treeGridViewRowRenderer_cellRenderer_resizeHandler));
			cellRenderer.removeEventListener("open",$bind(this,this.treeGridViewRowRenderer_cellRenderer_openHandler));
			cellRenderer.removeEventListener("close",$bind(this,this.treeGridViewRowRenderer_cellRenderer_closeHandler));
			this.resetCellRenderer(cellRenderer,state,storage);
			if(storage.measurements != null) {
				storage.measurements.restore(cellRenderer);
			}
			this.cellStatePool.release(state);
		}
	}
	,renderUnrenderedData: function() {
		var _g = 0;
		var _g1 = this._unrenderedData;
		while(_g < _g1.length) {
			var columnIndex = _g1[_g];
			++_g;
			var column = this._columns.get(columnIndex);
			var state = this.cellStatePool.get();
			this.populateCurrentItemState(column,columnIndex,state,true);
			var cellRenderer = this.createCellRenderer(state);
			this.addChildAt(cellRenderer,columnIndex);
		}
		this._unrenderedData.length = 0;
	}
	,freeInactiveCellRenderers: function(storage) {
		var cellRendererRecycler = storage.oldCellRendererRecycler != null ? storage.oldCellRendererRecycler : storage.cellRendererRecycler;
		var _g = 0;
		var _g1 = storage.inactiveCellRenderers;
		while(_g < _g1.length) {
			var cellRenderer = _g1[_g];
			++_g;
			if(cellRenderer == null) {
				continue;
			}
			this.destroyCellRenderer(cellRenderer,cellRendererRecycler);
		}
		storage.inactiveCellRenderers.length = 0;
	}
	,createCellRenderer: function(state) {
		var column = state.column;
		var cellRenderer = null;
		var storage = this.cellRendererRecyclerToStorage(column.cellRendererRecycler);
		if(storage.inactiveCellRenderers.length == 0) {
			cellRenderer = storage.cellRendererRecycler.create();
			if(js_Boot.__implements(cellRenderer,feathers_style_IVariantStyleObject)) {
				var variantCellRenderer = cellRenderer;
				if(variantCellRenderer.get_variant() == null) {
					var variant = this.get_customCellRendererVariant() != null ? this.get_customCellRendererVariant() : feathers_controls_TreeGridView.CHILD_VARIANT_CELL_RENDERER;
					variantCellRenderer.set_variant(variant);
				}
			}
			if(js_Boot.__implements(cellRenderer,feathers_core_IUIControl)) {
				cellRenderer.initializeNow();
			}
			if(storage.measurements == null) {
				storage.measurements = new feathers_layout_Measurements(cellRenderer);
			}
		} else {
			cellRenderer = storage.inactiveCellRenderers.shift();
		}
		var storage = this.cellRendererRecyclerToStorage(column.cellRendererRecycler);
		this.updateCellRenderer(cellRenderer,state,storage);
		if(js_Boot.__implements(cellRenderer,feathers_controls_ITriggerView)) {
			cellRenderer.addEventListener("trigger",$bind(this,this.treeGridViewRowRenderer_cellRenderer_triggerHandler));
		} else {
			cellRenderer.addEventListener("click",$bind(this,this.treeGridViewRowRenderer_cellRenderer_clickHandler));
			cellRenderer.addEventListener("touchTap",$bind(this,this.treeGridViewRowRenderer_cellRenderer_touchTapHandler));
		}
		if(js_Boot.__implements(cellRenderer,feathers_controls_IToggle)) {
			cellRenderer.addEventListener("change",$bind(this,this.treeGridViewRowRenderer_cellRenderer_changeHandler));
		}
		if(js_Boot.__implements(cellRenderer,feathers_core_IMeasureObject)) {
			cellRenderer.addEventListener("resize",$bind(this,this.treeGridViewRowRenderer_cellRenderer_resizeHandler));
		}
		if(js_Boot.__implements(cellRenderer,feathers_core_IOpenCloseToggle)) {
			cellRenderer.addEventListener("open",$bind(this,this.treeGridViewRowRenderer_cellRenderer_openHandler));
			cellRenderer.addEventListener("close",$bind(this,this.treeGridViewRowRenderer_cellRenderer_closeHandler));
		}
		this._cellRendererToCellState.set(cellRenderer,state);
		this._columnToCellRenderer.set(column,cellRenderer);
		storage.activeCellRenderers.push(cellRenderer);
		return cellRenderer;
	}
	,destroyCellRenderer: function(cellRenderer,cellRendererRecycler) {
		this.removeChild(cellRenderer);
		if(cellRendererRecycler != null && cellRendererRecycler.destroy != null) {
			cellRendererRecycler.destroy(cellRenderer);
		}
	}
	,updateCellRendererForColumnIndex: function(columnIndex) {
		var column = this._columns.get(columnIndex);
		var cellRenderer = this._columnToCellRenderer.h[column.__id__];
		if(cellRenderer == null) {
			this.setInvalid(feathers_core_InvalidationFlag.DATA);
			return;
		}
		var storage = this.cellRendererRecyclerToStorage(column.cellRendererRecycler);
		var state = this._cellRendererToCellState.h[cellRenderer.__id__];
		if(state.owner == null) {
			return;
		}
		this.populateCurrentItemState(column,columnIndex,state,true);
		this.resetCellRenderer(cellRenderer,state,storage);
		state.owner = null;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
	}
	,populateCurrentItemState: function(column,columnIndex,state,force) {
		var changed = false;
		if(force || state.owner != this._treeGridView) {
			state.owner = this._treeGridView;
			changed = true;
		}
		if(force || state.data != this._data) {
			state.data = this._data;
			changed = true;
		}
		if(force || state.rowLocation != this._rowLocation && this.compareLocations(state.rowLocation,this._rowLocation) != 0) {
			state.rowLocation = this._rowLocation;
			changed = true;
		}
		if(force || state.columnIndex != columnIndex) {
			state.columnIndex = columnIndex;
			changed = true;
		}
		if(force || state.column != column) {
			state.column = column;
			changed = true;
		}
		if(force || state.layoutIndex != this._layoutIndex) {
			state.layoutIndex = this._layoutIndex;
			changed = true;
		}
		if(force || state.branch != this._branch) {
			state.branch = this._branch;
			changed = true;
		}
		if(force || state.opened != this._opened) {
			state.opened = this._opened;
			changed = true;
		}
		if(force || state.selected != this._selected) {
			state.selected = this._selected;
			changed = true;
		}
		if(force || state.enabled != this._enabled) {
			state.enabled = this._enabled;
			changed = true;
		}
		var text = this._rowLocation != null ? column.itemToText(this._data) : null;
		if(force || state.text != text) {
			state.text = text;
			changed = true;
		}
		return changed;
	}
	,updateCellRenderer: function(cellRenderer,state,storage) {
		var oldIgnoreSelectionChange = this._ignoreSelectionChange;
		this._ignoreSelectionChange = true;
		var oldIgnoreOpenedChange = this._ignoreOpenedChange;
		this._ignoreOpenedChange = true;
		if(storage.cellRendererRecycler.update != null) {
			storage.cellRendererRecycler.update(cellRenderer,state);
		}
		this._ignoreOpenedChange = oldIgnoreOpenedChange;
		this._ignoreSelectionChange = oldIgnoreSelectionChange;
		this.refreshCellRendererProperties(cellRenderer,state);
	}
	,resetCellRenderer: function(cellRenderer,state,storage) {
		var oldIgnoreSelectionChange = this._ignoreSelectionChange;
		this._ignoreSelectionChange = true;
		var oldIgnoreOpenedChange = this._ignoreOpenedChange;
		this._ignoreOpenedChange = true;
		var recycler = storage.oldCellRendererRecycler != null ? storage.oldCellRendererRecycler : storage.cellRendererRecycler;
		if(recycler != null && recycler.reset != null) {
			recycler.reset(cellRenderer,state);
		}
		this._ignoreOpenedChange = oldIgnoreOpenedChange;
		this._ignoreSelectionChange = oldIgnoreSelectionChange;
		this.refreshCellRendererProperties(cellRenderer,feathers_controls_dataRenderers_TreeGridViewRowRenderer.RESET_CELL_STATE);
	}
	,refreshCellRendererProperties: function(cellRenderer,state) {
		var oldIgnoreSelectionChange = this._ignoreSelectionChange;
		this._ignoreSelectionChange = true;
		var oldIgnoreOpenedChange = this._ignoreOpenedChange;
		this._ignoreOpenedChange = true;
		if(js_Boot.__implements(cellRenderer,feathers_core_IUIControl)) {
			var uiControl = cellRenderer;
			uiControl.set_enabled(state.enabled);
		}
		if(js_Boot.__implements(cellRenderer,feathers_controls_dataRenderers_IDataRenderer)) {
			var dataRenderer = cellRenderer;
			dataRenderer.set_data(state.data);
		}
		if(js_Boot.__implements(cellRenderer,feathers_controls_IToggle)) {
			var toggle = cellRenderer;
			toggle.set_selected(state.selected);
		}
		if(js_Boot.__implements(cellRenderer,feathers_controls_dataRenderers_IHierarchicalItemRenderer)) {
			var hierarchicalCell = cellRenderer;
			hierarchicalCell.set_branch(state.branch);
		}
		if(js_Boot.__implements(cellRenderer,feathers_controls_dataRenderers_IOptionalHierarchyItemRenderer)) {
			var optionalCell = cellRenderer;
			optionalCell.set_showHierarchy(state.columnIndex == 0);
		}
		if(js_Boot.__implements(cellRenderer,feathers_controls_dataRenderers_IHierarchicalDepthItemRenderer)) {
			var depthCell = cellRenderer;
			depthCell.set_hierarchyDepth(state.rowLocation != null ? state.rowLocation.length - 1 : 0);
		}
		if(js_Boot.__implements(cellRenderer,feathers_controls_dataRenderers_ITreeGridViewCellRenderer)) {
			var gridCell = cellRenderer;
			gridCell.set_column(state.column);
			gridCell.set_columnIndex(state.columnIndex);
			gridCell.set_rowLocation(state.rowLocation);
			gridCell.set_treeGridViewOwner(state.owner);
		}
		if(js_Boot.__implements(cellRenderer,feathers_layout_ILayoutIndexObject)) {
			var layoutIndexObject = cellRenderer;
			layoutIndexObject.set_layoutIndex(state.layoutIndex);
		}
		if(js_Boot.__implements(cellRenderer,feathers_core_IOpenCloseToggle)) {
			var openCloseItem = cellRenderer;
			openCloseItem.set_opened(state.opened);
		}
		if(js_Boot.__implements(cellRenderer,feathers_core_IPointerDelegate)) {
			var pointerDelgate = cellRenderer;
			pointerDelgate.set_pointerTarget(state.rowLocation == null ? null : this);
		}
		this._ignoreOpenedChange = oldIgnoreOpenedChange;
		this._ignoreSelectionChange = oldIgnoreSelectionChange;
	}
	,compareLocations: function(location1,location2) {
		var null1 = location1 == null;
		var null2 = location2 == null;
		if(null1 && null2) {
			return 0;
		} else if(null1) {
			return 1;
		} else if(null2) {
			return -1;
		}
		var length1 = location1.length;
		var length2 = location2.length;
		var min = length1;
		if(length2 < min) {
			min = length2;
		}
		var _g = 0;
		var _g1 = min;
		while(_g < _g1) {
			var i = _g++;
			var index1 = location1[i];
			var index2 = location2[i];
			if(index1 < index2) {
				return -1;
			}
			if(index1 > index2) {
				return 1;
			}
		}
		if(length1 < length2) {
			return -1;
		} else if(length1 > length2) {
			return 1;
		}
		return 0;
	}
	,customHitTest: function(stageX,stageY) {
		if(this.stage == null) {
			return false;
		}
		if(this.mouseChildren) {
			var objects = this.stage.getObjectsUnderPoint(new openfl_geom_Point(stageX,stageY));
			if(objects.length > 0) {
				var lastObject = objects[objects.length - 1];
				if(this.contains(lastObject)) {
					while(lastObject != null && lastObject != this) {
						if(((lastObject) instanceof openfl_display_InteractiveObject)) {
							var interactive = lastObject;
							if(!interactive.mouseEnabled) {
								lastObject = lastObject.parent;
								continue;
							}
						}
						if(js_Boot.__implements(lastObject,feathers_core_IFocusObject)) {
							var focusable = lastObject;
							if(focusable.parent != this && focusable.get_focusEnabled()) {
								return false;
							}
						}
						lastObject = lastObject.parent;
					}
				}
			}
		}
		return true;
	}
	,treeGridViewRowRenderer_cellRenderer_touchTapHandler: function(event) {
		if(!this._enabled) {
			return;
		}
		if(event.isPrimaryTouchPoint) {
			return;
		}
		if(!this.customHitTest(event.stageX,event.stageY)) {
			return;
		}
		var cellRenderer = js_Boot.__cast(event.currentTarget , openfl_display_DisplayObject);
		var state = this._cellRendererToCellState.h[cellRenderer.__id__];
		feathers_events_TreeGridViewEvent.dispatchForCell(this,"cellTrigger",state);
		feathers_events_TriggerEvent.dispatchFromTouchEvent(this,event);
	}
	,treeGridViewRowRenderer_cellRenderer_clickHandler: function(event) {
		if(!this._enabled) {
			return;
		}
		if(!this.customHitTest(event.stageX,event.stageY)) {
			return;
		}
		var cellRenderer = js_Boot.__cast(event.currentTarget , openfl_display_DisplayObject);
		var state = this._cellRendererToCellState.h[cellRenderer.__id__];
		feathers_events_TreeGridViewEvent.dispatchForCell(this,"cellTrigger",state);
		feathers_events_TriggerEvent.dispatchFromMouseEvent(this,event);
	}
	,treeGridViewRowRenderer_cellRenderer_triggerHandler: function(event) {
		if(!this._enabled) {
			return;
		}
		if(!this.customHitTest(event.stageX,event.stageY)) {
			return;
		}
		var cellRenderer = js_Boot.__cast(event.currentTarget , openfl_display_DisplayObject);
		var state = this._cellRendererToCellState.h[cellRenderer.__id__];
		feathers_events_TreeGridViewEvent.dispatchForCell(this,"cellTrigger",state);
		this.dispatchEvent(event);
	}
	,treeGridViewRowRenderer_cellRenderer_resizeHandler: function(event) {
		if(this._validating) {
			return;
		}
		this.setInvalid(feathers_core_InvalidationFlag.LAYOUT);
	}
	,treeGridViewRowRenderer_cellRenderer_changeHandler: function(event) {
		if(this._ignoreSelectionChange) {
			return;
		}
		var cellRenderer = js_Boot.__cast(event.currentTarget , openfl_display_DisplayObject);
		var toggleCellRenderer = js_Boot.__cast(cellRenderer , feathers_controls_IToggle);
		var state = this._cellRendererToCellState.h[cellRenderer.__id__];
		if(toggleCellRenderer.get_selected() == state.selected) {
			return;
		}
		this.setInvalid(feathers_core_InvalidationFlag.SELECTION);
	}
	,treeGridViewRowRenderer_cellRenderer_openHandler: function(event) {
		if(this._ignoreOpenedChange) {
			return;
		}
		this.dispatchEvent(event.clone());
	}
	,treeGridViewRowRenderer_cellRenderer_closeHandler: function(event) {
		if(this._ignoreOpenedChange) {
			return;
		}
		this.dispatchEvent(event.clone());
	}
	,treeGridViewRowRenderer_treeGridView_keyDownHandler: function(event) {
		if(!this._enabled || event.isDefaultPrevented()) {
			return;
		}
		if(this._selected && event.keyCode == 37) {
			if(this._branch) {
				if(this._opened) {
					this.get_treeGridView().toggleBranch(this._data,false);
					return;
				}
			}
			var parentLocation = this._rowLocation.slice();
			parentLocation.pop();
			if(parentLocation.length > 0) {
				this.get_treeGridView().set_selectedLocation(parentLocation);
			}
		}
		if(this._selected && event.keyCode == 39) {
			if(this._branch) {
				if(!this._opened) {
					this.get_treeGridView().toggleBranch(this._data,true);
					return;
				}
				var childCount = this.get_treeGridView().get_dataProvider().getLength(this._rowLocation);
				if(childCount > 0) {
					var childLocation = this._rowLocation.slice();
					childLocation.push(0);
					this.get_treeGridView().set_selectedLocation(childLocation);
				}
			}
		}
		if(this._selected && event.keyCode == 13) {
			var column = this._columns.get(0);
			var cellRenderer = this.columnToCellRenderer(column);
			var state = null;
			if(cellRenderer != null) {
				state = this._cellRendererToCellState.h[cellRenderer.__id__];
			}
			var isTemporary = false;
			if(state == null) {
				isTemporary = true;
				state = this.cellStatePool.get();
			}
			this.populateCurrentItemState(column,0,state,true);
			feathers_events_TreeGridViewEvent.dispatchForCell(this,"cellTrigger",state);
			if(isTemporary) {
				this.cellStatePool.release(state);
			}
		}
		if(this._selected && event.keyCode == 32) {
			if(this._branch) {
				event.preventDefault();
				this.get_treeGridView().toggleBranch(this._data,!this._opened);
			}
		}
	}
	,treeGridViewRowRenderer_columns_changeHandler: function(event) {
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
	}
	,get_styleContext: function() {
		return feathers_controls_dataRenderers_TreeGridViewRowRenderer;
	}
	,__class__: feathers_controls_dataRenderers_TreeGridViewRowRenderer
	,__properties__: $extend(feathers_controls_LayoutGroup.prototype.__properties__,{set_customColumnWidths:"set_customColumnWidths",get_customColumnWidths:"get_customColumnWidths",set_customCellRendererVariant:"set_customCellRendererVariant",get_customCellRendererVariant:"get_customCellRendererVariant",set_forceCellStateUpdate:"set_forceCellStateUpdate",get_forceCellStateUpdate:"get_forceCellStateUpdate",set_cellRendererRecycler:"set_cellRendererRecycler",get_cellRendererRecycler:"get_cellRendererRecycler",set_columns:"set_columns",get_columns:"get_columns",set_data:"set_data",get_data:"get_data",set_opened:"set_opened",get_opened:"get_opened",set_branch:"set_branch",get_branch:"get_branch",set_layoutIndex:"set_layoutIndex",get_layoutIndex:"get_layoutIndex",set_rowLocation:"set_rowLocation",get_rowLocation:"get_rowLocation",set_selected:"set_selected",get_selected:"get_selected",set_treeGridView:"set_treeGridView",get_treeGridView:"get_treeGridView",get_currentState:"get_currentState"})
});
var feathers_controls_dataRenderers__$TreeGridViewRowRenderer_CellRendererStorage = function(recycler) {
	this.inactiveCellRenderers = [];
	this.activeCellRenderers = [];
	this.cellRendererRecycler = recycler;
};
$hxClasses["feathers.controls.dataRenderers._TreeGridViewRowRenderer.CellRendererStorage"] = feathers_controls_dataRenderers__$TreeGridViewRowRenderer_CellRendererStorage;
feathers_controls_dataRenderers__$TreeGridViewRowRenderer_CellRendererStorage.__name__ = "feathers.controls.dataRenderers._TreeGridViewRowRenderer.CellRendererStorage";
feathers_controls_dataRenderers__$TreeGridViewRowRenderer_CellRendererStorage.prototype = {
	oldCellRendererRecycler: null
	,cellRendererRecycler: null
	,activeCellRenderers: null
	,inactiveCellRenderers: null
	,measurements: null
	,__class__: feathers_controls_dataRenderers__$TreeGridViewRowRenderer_CellRendererStorage
};
var feathers_controls_navigators_BaseNavigator = function() {
	this.chromeMeasuredMaxHeight = 1.0 / 0.0;
	this.chromeMeasuredMinHeight = 0.0;
	this.chromeMeasuredHeight = 0.0;
	this.chromeMeasuredMaxWidth = 1.0 / 0.0;
	this.chromeMeasuredMinWidth = 0.0;
	this.chromeMeasuredWidth = 0.0;
	this.leftContentOffset = 0.0;
	this.bottomContentOffset = 0.0;
	this.rightContentOffset = 0.0;
	this.topContentOffset = 0.0;
	this._autoSizeMode = feathers_layout_AutoSizeMode.STAGE;
	this._waitingForTransitionFrameCount = 0;
	this._waitingForDelayedTransition = false;
	this._clearAfterTransition = false;
	this._nextViewInTransitionMeasurements = new feathers_layout_Measurements();
	this._previousViewInTransitionMeasurements = new feathers_layout_Measurements();
	this._addedItems = new haxe_ds_StringMap();
	this._addedItemIDs = [];
	this._activeViewMeasurements = new feathers_layout_Measurements();
	this._childFocusEnabled = true;
	feathers_core_FeathersControl.call(this);
	this._viewsContainer = this;
	this.addEventListener("addedToStage",$bind(this,this.baseNavigator_addedToStageHandler));
};
$hxClasses["feathers.controls.navigators.BaseNavigator"] = feathers_controls_navigators_BaseNavigator;
feathers_controls_navigators_BaseNavigator.__name__ = "feathers.controls.navigators.BaseNavigator";
feathers_controls_navigators_BaseNavigator.__interfaces__ = [feathers_core_IFocusContainer];
feathers_controls_navigators_BaseNavigator.defaultTransition = function(oldView,newView) {
	return new feathers_motion_effects_NoOpEffectContext(oldView);
};
feathers_controls_navigators_BaseNavigator.__super__ = feathers_core_FeathersControl;
feathers_controls_navigators_BaseNavigator.prototype = $extend(feathers_core_FeathersControl.prototype,{
	_activeItemID: null
	,get_activeItemID: function() {
		return this._activeItemID;
	}
	,_activeItemView: null
	,get_activeItemView: function() {
		return this._activeItemView;
	}
	,_transitionActive: null
	,get_transitionActive: function() {
		return this._transitionActive;
	}
	,get_tabEnabled: function() {
		return false;
	}
	,_childFocusEnabled: null
	,get_childFocusEnabled: function() {
		if(this._enabled && !this._transitionActive) {
			return this._childFocusEnabled;
		} else {
			return false;
		}
	}
	,set_childFocusEnabled: function(value) {
		if(this._childFocusEnabled == value) {
			return this._childFocusEnabled;
		}
		this._childFocusEnabled = value;
		return this._childFocusEnabled;
	}
	,_viewsContainer: null
	,_activeViewMeasurements: null
	,_addedItemIDs: null
	,_addedItems: null
	,_previousViewInTransition: null
	,_previousViewInTransitionID: null
	,_previousViewInTransitionMeasurements: null
	,_nextViewInTransition: null
	,_nextViewInTransitionID: null
	,_nextViewInTransitionMeasurements: null
	,_pendingItemID: null
	,_pendingItemTransition: null
	,_clearAfterTransition: null
	,_delayedTransition: null
	,_waitingForDelayedTransition: null
	,_waitingTransition: null
	,_waitingForTransitionFrameCount: null
	,_activeTransition: null
	,_autoSizeMode: null
	,get_autoSizeMode: function() {
		return this._autoSizeMode;
	}
	,set_autoSizeMode: function(value) {
		if(this._autoSizeMode == value) {
			return this._autoSizeMode;
		}
		this._autoSizeMode = value;
		this.setInvalid(feathers_core_InvalidationFlag.SIZE);
		if(this._activeItemView != null) {
			if(this._autoSizeMode == feathers_layout_AutoSizeMode.STAGE) {
				this._activeItemView.removeEventListener("resize",$bind(this,this.activeItemView_resizeHandler));
			} else {
				this._activeItemView.addEventListener("resize",$bind(this,this.activeItemView_resizeHandler));
			}
		}
		if(this.stage != null) {
			if(this._autoSizeMode == feathers_layout_AutoSizeMode.STAGE) {
				this.stage.addEventListener("resize",$bind(this,this.baseNavigator_stage_resizeHandler));
				this.addEventListener("removedFromStage",$bind(this,this.baseNavigator_removedFromStageHandler));
			} else {
				this.stage.removeEventListener("resize",$bind(this,this.baseNavigator_stage_resizeHandler));
				this.removeEventListener("removedFromStage",$bind(this,this.baseNavigator_removedFromStageHandler));
			}
		}
		return this._autoSizeMode;
	}
	,topContentOffset: null
	,rightContentOffset: null
	,bottomContentOffset: null
	,leftContentOffset: null
	,chromeMeasuredWidth: null
	,chromeMeasuredMinWidth: null
	,chromeMeasuredMaxWidth: null
	,chromeMeasuredHeight: null
	,chromeMeasuredMinHeight: null
	,chromeMeasuredMaxHeight: null
	,dispose: function() {
		this._pendingItemID = null;
		this._pendingItemTransition = null;
		this._transitionActive = false;
		if(this._activeTransition != null) {
			this._activeTransition.removeEventListener("complete",$bind(this,this.transition_completeHandler));
			this._activeTransition.removeEventListener("cancel",$bind(this,this.transition_cancelHandler));
			this._activeTransition.stop();
		}
		this._activeItemID = null;
		this._activeItemView = null;
		this.removeAllItems();
		feathers_core_FeathersControl.prototype.dispose.call(this);
	}
	,removeAllItems: function() {
		if(this._activeTransition != null) {
			this._clearAfterTransition = false;
			this._pendingItemID = null;
			this._pendingItemTransition = null;
			this._activeTransition.toEnd();
		}
		if(this._activeItemView != null) {
			this.clearActiveItemInternal(null);
			feathers_events_FeathersEvent.dispatch(this,"clear");
		}
		this._addedItems.h = Object.create(null);
		this._addedItemIDs.length = 0;
	}
	,hasItem: function(id) {
		return Object.prototype.hasOwnProperty.call(this._addedItems.h,id);
	}
	,getItemIDs: function(result) {
		if(result == null) {
			result = [];
		}
		var h = this._addedItems.h;
		var id_h = h;
		var id_keys = Object.keys(h);
		var id_length = id_keys.length;
		var id_current = 0;
		while(id_current < id_length) {
			var id = id_keys[id_current++];
			result.push(id);
		}
		return result;
	}
	,update: function() {
		var sizeInvalid = this.isInvalid(feathers_core_InvalidationFlag.SIZE);
		this.topContentOffset = 0.0;
		this.rightContentOffset = 0.0;
		this.bottomContentOffset = 0.0;
		this.leftContentOffset = 0.0;
		this.chromeMeasuredWidth = 0.0;
		this.chromeMeasuredMinWidth = 0.0;
		this.chromeMeasuredMaxWidth = 1.0 / 0.0;
		this.chromeMeasuredHeight = 0.0;
		this.chromeMeasuredMinHeight = 0.0;
		this.chromeMeasuredMaxHeight = 1.0 / 0.0;
		if(this.measure()) {
			sizeInvalid = true;
		}
		this.layoutContent();
	}
	,measure: function() {
		var needsWidth = this.get_explicitWidth() == null;
		var needsHeight = this.get_explicitHeight() == null;
		var needsMinWidth = this.get_explicitMinWidth() == null;
		var needsMinHeight = this.get_explicitMinHeight() == null;
		var needsMaxWidth = this.get_explicitMaxWidth() == null;
		var needsMaxHeight = this.get_explicitMaxHeight() == null;
		if(!needsWidth && !needsHeight && !needsMinWidth && !needsMinHeight && !needsMaxWidth && !needsMaxHeight) {
			return false;
		}
		var needsToMeasureContent = this._autoSizeMode == feathers_layout_AutoSizeMode.CONTENT || this.stage == null;
		var stageWidth = 0.0;
		var stageHeight = 0.0;
		if(!needsToMeasureContent) {
			var topLeft = this.globalToLocal(new openfl_geom_Point());
			var bottomRight = this.globalToLocal(new openfl_geom_Point(this.stage.stageWidth,this.stage.stageHeight));
			stageWidth = bottomRight.x - topLeft.x;
			stageHeight = bottomRight.y - topLeft.y;
		}
		var measureActiveView = null;
		if(js_Boot.__implements(this._activeItemView,feathers_core_IMeasureObject)) {
			measureActiveView = this._activeItemView;
		}
		var measurePrevView = null;
		var measureNextView = null;
		if(this._transitionActive) {
			if(js_Boot.__implements(this._previousViewInTransition,feathers_core_IMeasureObject)) {
				measurePrevView = this._previousViewInTransition;
			}
			if(js_Boot.__implements(this._nextViewInTransition,feathers_core_IMeasureObject)) {
				measureNextView = this._nextViewInTransition;
			}
		}
		if(this._transitionActive) {
			if(needsToMeasureContent) {
				if(this._previousViewInTransition != null) {
					this._previousViewInTransitionMeasurements.restore(this._previousViewInTransition);
				}
				if(this._nextViewInTransition != null) {
					this._nextViewInTransitionMeasurements.restore(this._nextViewInTransition);
				}
			}
			if(!needsWidth) {
				var viewWidth = this.get_explicitWidth() - this.leftContentOffset - this.rightContentOffset;
				if(this._previousViewInTransition != null && this._previousViewInTransition.get_width() != viewWidth) {
					this._previousViewInTransition.set_width(viewWidth);
				}
				if(this._nextViewInTransition != null && this._nextViewInTransition.get_width() != viewWidth) {
					this._nextViewInTransition.set_width(viewWidth);
				}
			} else if(!needsToMeasureContent) {
				var viewWidth = stageWidth - this.leftContentOffset - this.rightContentOffset;
				if(this._previousViewInTransition != null && this._previousViewInTransition.get_width() != viewWidth) {
					this._previousViewInTransition.set_width(viewWidth);
				}
				if(this._nextViewInTransition != null && this._nextViewInTransition.get_width() != viewWidth) {
					this._nextViewInTransition.set_width(viewWidth);
				}
			}
			if(!needsHeight) {
				var viewHeight = this.get_explicitHeight() - this.topContentOffset - this.leftContentOffset;
				if(this._previousViewInTransition != null && this._previousViewInTransition.get_height() != viewHeight) {
					this._previousViewInTransition.set_height(viewHeight);
				}
				if(this._nextViewInTransition != null && this._nextViewInTransition.get_height() != viewHeight) {
					this._nextViewInTransition.set_height(viewHeight);
				}
			} else if(!needsToMeasureContent) {
				var viewHeight = stageHeight - this.topContentOffset - this.leftContentOffset;
				if(this._previousViewInTransition != null && this._previousViewInTransition.get_height() != viewHeight) {
					this._previousViewInTransition.set_height(viewHeight);
				}
				if(this._nextViewInTransition != null && this._nextViewInTransition.get_height() != viewHeight) {
					this._nextViewInTransition.set_height(viewHeight);
				}
			}
		} else if(this._activeItemView != null) {
			if(needsToMeasureContent) {
				this._activeViewMeasurements.restore(this._activeItemView);
			}
			if(!needsWidth) {
				var viewWidth = this.get_explicitWidth() - this.leftContentOffset - this.rightContentOffset;
				if(this._activeItemView.get_width() != viewWidth) {
					this._activeItemView.set_width(viewWidth);
				}
			} else if(!needsToMeasureContent) {
				var viewWidth = stageWidth - this.leftContentOffset - this.rightContentOffset;
				if(this._activeItemView.get_width() != viewWidth) {
					this._activeItemView.set_width(viewWidth);
				}
			}
			if(!needsHeight) {
				var viewHeight = this.get_explicitHeight() - this.topContentOffset - this.leftContentOffset;
				if(this._activeItemView.get_height() != viewHeight) {
					this._activeItemView.set_height(viewHeight);
				}
			} else if(!needsToMeasureContent) {
				var viewHeight = stageHeight - this.topContentOffset - this.leftContentOffset;
				if(this._activeItemView.get_height() != viewHeight) {
					this._activeItemView.set_height(viewHeight);
				}
			}
		}
		if(this._transitionActive) {
			if(js_Boot.__implements(this._previousViewInTransition,feathers_core_IValidating)) {
				this._previousViewInTransition.validateNow();
			}
			if(js_Boot.__implements(this._nextViewInTransition,feathers_core_IValidating)) {
				this._nextViewInTransition.validateNow();
			}
		} else if(js_Boot.__implements(this._activeItemView,feathers_core_IValidating)) {
			this._activeItemView.validateNow();
		}
		var newWidth = this.get_explicitWidth();
		if(needsWidth) {
			if(needsToMeasureContent) {
				newWidth = 0.0;
				if(this._transitionActive) {
					if(this._previousViewInTransition != null && newWidth < this._previousViewInTransition.get_width()) {
						newWidth = this._previousViewInTransition.get_width();
					}
					if(this._nextViewInTransition != null && newWidth < this._nextViewInTransition.get_width()) {
						newWidth = this._nextViewInTransition.get_width();
					}
				} else if(this._activeItemView != null) {
					newWidth = this._activeItemView.get_width();
				}
				if(newWidth < this.chromeMeasuredWidth) {
					newWidth = this.chromeMeasuredWidth;
				}
				newWidth += this.rightContentOffset + this.leftContentOffset;
			} else {
				newWidth = stageWidth;
			}
		}
		var newHeight = this.get_explicitHeight();
		if(needsHeight) {
			if(needsToMeasureContent) {
				newHeight = 0.0;
				if(this._transitionActive) {
					if(this._previousViewInTransition != null && newHeight < this._previousViewInTransition.get_height()) {
						newHeight = this._previousViewInTransition.get_height();
					}
					if(this._nextViewInTransition != null && newHeight < this._nextViewInTransition.get_height()) {
						newHeight = this._nextViewInTransition.get_height();
					}
				} else if(this._activeItemView != null) {
					newHeight = this._activeItemView.get_height();
				}
				if(newHeight < this.chromeMeasuredHeight) {
					newHeight = this.chromeMeasuredHeight;
				}
				newHeight += this.topContentOffset + this.bottomContentOffset;
			} else {
				newHeight = stageHeight;
			}
		}
		var newMinWidth = this.get_explicitMinWidth();
		if(needsMinWidth) {
			if(needsToMeasureContent) {
				newMinWidth = 0.0;
				if(this._transitionActive) {
					if(measurePrevView != null && newMinWidth < measurePrevView.get_minWidth()) {
						newMinWidth = measurePrevView.get_minWidth();
					} else if(this._previousViewInTransition != null && newMinWidth < this._previousViewInTransition.get_width()) {
						newMinWidth = this._previousViewInTransition.get_width();
					}
					if(measureNextView != null && newMinWidth < measureNextView.get_minWidth()) {
						newMinWidth = measureNextView.get_minWidth();
					} else if(this._nextViewInTransition != null && newMinWidth < this._nextViewInTransition.get_width()) {
						newMinWidth = this._nextViewInTransition.get_width();
					}
				} else if(measureActiveView != null) {
					newMinWidth = measureActiveView.get_minWidth();
				} else if(this._activeItemView != null) {
					newMinWidth = this._activeItemView.get_width();
				}
				if(newMinWidth < this.chromeMeasuredMinWidth) {
					newMinWidth = this.chromeMeasuredMinWidth;
				}
				newMinWidth += this.rightContentOffset + this.leftContentOffset;
			} else {
				newMinWidth = stageWidth;
			}
		}
		var newMinHeight = this.get_explicitMinHeight();
		if(needsMinHeight) {
			if(needsToMeasureContent) {
				newMinHeight = 0.0;
				if(this._transitionActive) {
					if(measurePrevView != null && newMinHeight < measurePrevView.get_minHeight()) {
						newMinHeight = measurePrevView.get_minHeight();
					} else if(this._previousViewInTransition != null && newMinHeight < this._previousViewInTransition.get_height()) {
						newMinHeight = this._previousViewInTransition.get_height();
					}
					if(measureNextView != null && newMinHeight < measureNextView.get_minHeight()) {
						newMinHeight = measureNextView.get_minHeight();
					} else if(this._nextViewInTransition != null && newMinHeight < this._nextViewInTransition.get_height()) {
						newMinHeight = this._nextViewInTransition.get_height();
					}
				} else if(measureActiveView != null) {
					newMinHeight = measureActiveView.get_minHeight();
				} else if(this._activeItemView != null) {
					newMinHeight = this._activeItemView.get_height();
				}
				if(newMinHeight < this.chromeMeasuredMinHeight) {
					newMinHeight = this.chromeMeasuredMinHeight;
				}
				newMinHeight += this.topContentOffset + this.bottomContentOffset;
			} else {
				newMinHeight = stageHeight;
			}
		}
		var newMaxWidth = this.get_explicitMaxWidth();
		if(needsMaxWidth) {
			if(needsToMeasureContent) {
				newMaxWidth = 1.0 / 0.0;
				if(this._transitionActive) {
					if(measurePrevView != null && newMaxWidth < measurePrevView.get_maxWidth()) {
						newMaxWidth = measurePrevView.get_maxWidth();
					} else if(this._previousViewInTransition != null && newMaxWidth < this._previousViewInTransition.get_width()) {
						newMaxWidth = this._previousViewInTransition.get_width();
					}
					if(measureNextView != null && newMaxWidth < measureNextView.get_maxWidth()) {
						newMaxWidth = measureNextView.get_maxWidth();
					} else if(this._nextViewInTransition != null && newMaxWidth < this._nextViewInTransition.get_width()) {
						newMaxWidth = this._nextViewInTransition.get_width();
					}
				} else if(measureActiveView != null) {
					newMaxWidth = measureActiveView.get_maxWidth();
				} else if(this._activeItemView != null) {
					newMaxWidth = this._activeItemView.get_width();
				}
				if(newMaxWidth > this.chromeMeasuredMaxWidth) {
					newMaxWidth = this.chromeMeasuredMaxWidth;
				}
				newMaxWidth += this.rightContentOffset + this.leftContentOffset;
			} else {
				newMaxWidth = stageWidth;
			}
		}
		var newMaxHeight = this.get_explicitMaxHeight();
		if(needsMaxHeight) {
			if(needsToMeasureContent) {
				newMaxHeight = 1.0 / 0.0;
				if(this._transitionActive) {
					if(measurePrevView != null && newMaxHeight > measurePrevView.get_maxHeight()) {
						newMaxHeight = measurePrevView.get_maxHeight();
					} else if(this._previousViewInTransition != null && newMaxHeight > this._previousViewInTransition.get_height()) {
						newMaxHeight = this._previousViewInTransition.get_height();
					}
					if(measureNextView != null && newMaxHeight > measureNextView.get_maxHeight()) {
						newMaxHeight = measureNextView.get_maxHeight();
					} else if(this._nextViewInTransition != null && newMaxHeight > this._nextViewInTransition.get_height()) {
						newMaxHeight = this._nextViewInTransition.get_height();
					}
				} else if(measureActiveView != null) {
					newMaxHeight = measureActiveView.get_maxHeight();
				} else if(this._activeItemView != null) {
					newMaxHeight = this._activeItemView.get_height();
				}
				if(newMaxHeight > this.chromeMeasuredMaxHeight) {
					newMaxHeight = this.chromeMeasuredMaxHeight;
				}
				newMaxHeight += this.topContentOffset + this.bottomContentOffset;
			} else {
				newMaxHeight = stageHeight;
			}
		}
		return this.saveMeasurements(newWidth,newHeight,newMinWidth,newMinHeight,newMaxWidth,newMaxHeight);
	}
	,layoutContent: function() {
		var viewWidth = this.actualWidth - this.leftContentOffset - this.rightContentOffset;
		var viewHeight = this.actualHeight - this.topContentOffset - this.bottomContentOffset;
		if(this._viewsContainer != null && this._viewsContainer != this) {
			this._viewsContainer.set_x(this.leftContentOffset);
			this._viewsContainer.set_y(this.topContentOffset);
			this._viewsContainer.set_width(viewWidth);
			this._viewsContainer.set_height(viewHeight);
		}
		if(this._activeItemView != null) {
			if(this._viewsContainer != null && this._viewsContainer != this) {
				this._activeItemView.set_x(0.0);
				this._activeItemView.set_y(0.0);
			} else {
				this._activeItemView.set_x(this.leftContentOffset);
				this._activeItemView.set_y(this.topContentOffset);
			}
			if(this._activeItemView.get_width() != viewWidth) {
				this._activeItemView.set_width(viewWidth);
			}
			if(this._activeItemView.get_height() != viewHeight) {
				this._activeItemView.set_height(viewHeight);
			}
			if(js_Boot.__implements(this._activeItemView,feathers_core_IValidating)) {
				this._activeItemView.validateNow();
			}
		}
		if(this._nextViewInTransition != null) {
			if(this._viewsContainer != null && this._viewsContainer != this) {
				this._nextViewInTransition.set_x(0.0);
				this._nextViewInTransition.set_y(0.0);
			} else {
				this._nextViewInTransition.set_x(this.leftContentOffset);
				this._nextViewInTransition.set_y(this.topContentOffset);
			}
			if(this._nextViewInTransition.get_width() != viewWidth) {
				this._nextViewInTransition.set_width(viewWidth);
			}
			if(this._nextViewInTransition.get_height() != viewHeight) {
				this._nextViewInTransition.set_height(viewHeight);
			}
			if(js_Boot.__implements(this._nextViewInTransition,feathers_core_IValidating)) {
				this._nextViewInTransition.validateNow();
			}
		}
		if(this._viewsContainer != this && js_Boot.__implements(this._viewsContainer,feathers_core_IValidating)) {
			this._viewsContainer.validateNow();
		}
	}
	,getView: function(id) {
		throw new openfl_errors_IllegalOperationError("Missing override of BaseNavigator.getView()");
	}
	,disposeView: function(id,view) {
		throw new openfl_errors_IllegalOperationError("Missing override of BaseNavigator.disposeView()");
	}
	,transitionComplete: function() {
	}
	,transitionCancel: function() {
	}
	,addItemInternal: function(id,item) {
		if(Object.prototype.hasOwnProperty.call(this._addedItems.h,id)) {
			throw new openfl_errors_ArgumentError("Item with id '" + id + "' already defined. Cannot add two items with the same id.");
		}
		this._addedItems.h[id] = item;
		this._addedItemIDs.push(id);
	}
	,removeItemInternal: function(id) {
		if(!Object.prototype.hasOwnProperty.call(this._addedItems.h,id)) {
			throw new openfl_errors_ArgumentError("Item with id '" + id + "' cannot be removed because this id has not been added.");
		}
		if(this._transitionActive && (id == this._previousViewInTransitionID || id == this._activeItemID)) {
			throw new openfl_errors_IllegalOperationError("Cannot remove an item while it is transitioning in or out.");
		}
		if(id == this._activeItemID) {
			this.clearActiveItemInternal(null);
			feathers_events_FeathersEvent.dispatch(this,"clear");
		}
		var item = this._addedItems.h[id];
		var _this = this._addedItems;
		if(Object.prototype.hasOwnProperty.call(_this.h,id)) {
			delete(_this.h[id]);
		}
		HxOverrides.remove(this._addedItemIDs,id);
		return item;
	}
	,clearFocusFromPreviousView: function() {
		if(this._previousViewInTransition == null) {
			return;
		}
		if(this._focusManager != null) {
			if(this._focusManager.get_focus() == null) {
				return;
			}
			if(js_Boot.__implements(this._previousViewInTransition,feathers_core_IFocusObject) && this._focusManager.get_focus() == this._previousViewInTransition) {
				this._focusManager.set_focus(null);
			} else if(((this._previousViewInTransition) instanceof openfl_display_DisplayObjectContainer) && this._previousViewInTransition.contains(js_Boot.__cast(this._focusManager.get_focus() , openfl_display_DisplayObject))) {
				this._focusManager.set_focus(null);
			}
		}
		if(this.stage.get_focus() == null) {
			return;
		}
		if(this.stage.get_focus() == this._previousViewInTransition || ((this._previousViewInTransition) instanceof openfl_display_DisplayObjectContainer) && this._previousViewInTransition.contains(this.stage.get_focus())) {
			this.stage.set_focus(this.stage);
		}
	}
	,showItemInternal: function(id,transition) {
		if(!this.hasItem(id)) {
			throw new openfl_errors_ArgumentError("Item with id '" + id + "' cannot be displayed because this id has not been added.");
		}
		if(this._transitionActive) {
			this._pendingItemID = id;
			this._pendingItemTransition = transition;
			this._clearAfterTransition = false;
			return null;
		}
		this._previousViewInTransition = this._activeItemView;
		this._previousViewInTransitionID = this._activeItemID;
		var tempMeasurements = this._previousViewInTransitionMeasurements;
		this._previousViewInTransitionMeasurements = this._activeViewMeasurements;
		this._activeViewMeasurements = tempMeasurements;
		this.clearFocusFromPreviousView();
		this._transitionActive = true;
		var item = this._addedItems.h[id];
		this._nextViewInTransition = this.getView(id);
		this._nextViewInTransitionMeasurements.save(this._nextViewInTransition);
		if(this._nextViewInTransition == null) {
			throw new openfl_errors_IllegalOperationError("Failed to display navigator item with id '" + id + "'. Call to getView() incorrectly returned null.");
		}
		this._nextViewInTransitionID = id;
		if(this._autoSizeMode == feathers_layout_AutoSizeMode.CONTENT || this.stage == null) {
			this._nextViewInTransition.addEventListener("resize",$bind(this,this.activeItemView_resizeHandler));
		}
		var sameInstance = this._previousViewInTransition == this._nextViewInTransition;
		this._viewsContainer.addChild(this._nextViewInTransition);
		if(js_Boot.__implements(this._nextViewInTransition,feathers_core_IUIControl)) {
			this._nextViewInTransition.initializeNow();
		}
		this.setInvalid(feathers_core_InvalidationFlag.SELECTION);
		if(this._validationQueue != null && this._validationQueue.get_validating()) {
			this._validationQueue.validateNow();
		} else if(!this._validating) {
			this.validateNow();
		}
		if(sameInstance) {
			this._activeItemView = this._nextViewInTransition;
			this._activeItemID = this._nextViewInTransitionID;
			var tempMeasurements = this._activeViewMeasurements;
			this._activeViewMeasurements = this._nextViewInTransitionMeasurements;
			this._nextViewInTransitionMeasurements = tempMeasurements;
			this._previousViewInTransition = null;
			this._previousViewInTransitionID = null;
			this._nextViewInTransition = null;
			this._nextViewInTransitionID = null;
			this._transitionActive = false;
			this._activeTransition = null;
			feathers_events_FeathersEvent.dispatch(this,"change");
		} else {
			this.startTransition(transition);
		}
		return this._activeItemView;
	}
	,clearActiveItemInternal: function(transition) {
		if(this._activeItemView == null) {
			return;
		}
		if(this._transitionActive) {
			this._pendingItemID = null;
			this._pendingItemTransition = transition;
			this._clearAfterTransition = true;
			return;
		}
		this.clearFocusFromPreviousView();
		this._transitionActive = true;
		this._previousViewInTransition = this._activeItemView;
		this._previousViewInTransitionID = this._activeItemID;
		var tempMeasurements = this._previousViewInTransitionMeasurements;
		this._previousViewInTransitionMeasurements = this._activeViewMeasurements;
		this._activeViewMeasurements = tempMeasurements;
		this._nextViewInTransition = null;
		this._nextViewInTransitionID = null;
		this.setInvalid(feathers_core_InvalidationFlag.SELECTION);
		this.startTransition(transition);
	}
	,startTransition: function(transition) {
		feathers_events_TransitionEvent.dispatch(this,"transitionStart",this._previousViewInTransitionID,this._previousViewInTransition,this._nextViewInTransitionID,this._nextViewInTransition);
		if(transition != null && transition != feathers_controls_navigators_BaseNavigator.defaultTransition) {
			if(this._nextViewInTransition != null) {
				this._nextViewInTransition.set_visible(false);
			}
			this._waitingForTransitionFrameCount = 0;
			this._waitingTransition = transition;
			this.addEventListener("enterFrame",$bind(this,this.baseNavigator_transitionWait_enterFrameHandler));
		} else {
			if(this._nextViewInTransition != null) {
				this._nextViewInTransition.set_visible(true);
			}
			this._activeTransition = feathers_controls_navigators_BaseNavigator.defaultTransition(this._previousViewInTransition,this._nextViewInTransition);
			this._activeTransition.addEventListener("complete",$bind(this,this.transition_completeHandler));
			this._activeTransition.addEventListener("cancel",$bind(this,this.transition_cancelHandler));
			this._activeTransition.play();
		}
	}
	,startWaitingTransition: function() {
		this.removeEventListener("enterFrame",$bind(this,this.baseNavigator_transitionWait_enterFrameHandler));
		if(this._nextViewInTransition != null) {
			this._nextViewInTransition.set_visible(true);
		}
		var transition = this._waitingTransition;
		this._waitingTransition = null;
		this._activeTransition = transition(this._previousViewInTransition,this._nextViewInTransition);
		this._activeTransition.addEventListener("complete",$bind(this,this.transition_completeHandler));
		this._activeTransition.addEventListener("cancel",$bind(this,this.transition_cancelHandler));
		this._activeTransition.play();
	}
	,baseNavigator_addedToStageHandler: function(event) {
		if(this._autoSizeMode == feathers_layout_AutoSizeMode.STAGE) {
			this.setInvalid(feathers_core_InvalidationFlag.SIZE);
			this.stage.addEventListener("resize",$bind(this,this.baseNavigator_stage_resizeHandler));
			this.addEventListener("removedFromStage",$bind(this,this.baseNavigator_removedFromStageHandler));
		}
	}
	,baseNavigator_removedFromStageHandler: function(event) {
		this.removeEventListener("removedFromStage",$bind(this,this.baseNavigator_removedFromStageHandler));
		this.stage.removeEventListener("resize",$bind(this,this.baseNavigator_stage_resizeHandler));
	}
	,baseNavigator_transitionWait_enterFrameHandler: function(event) {
		if(this._waitingForTransitionFrameCount < 2) {
			this._waitingForTransitionFrameCount++;
			return;
		}
		this.startWaitingTransition();
	}
	,baseNavigator_stage_resizeHandler: function(event) {
		this.setInvalid(feathers_core_InvalidationFlag.SIZE);
	}
	,activeItemView_resizeHandler: function(event) {
		if(this._validating || this._autoSizeMode != feathers_layout_AutoSizeMode.CONTENT) {
			return;
		}
		this.setInvalid(feathers_core_InvalidationFlag.SIZE);
	}
	,transition_completeHandler: function(event) {
		this._activeTransition = null;
		this._transitionActive = this._clearAfterTransition || this._pendingItemID != null;
		this.transitionComplete();
		if(this._previousViewInTransition != null) {
			this._previousViewInTransition.removeEventListener("resize",$bind(this,this.activeItemView_resizeHandler));
			this._viewsContainer.removeChild(this._previousViewInTransition);
			this._previousViewInTransitionMeasurements.restore(this._previousViewInTransition);
			this.disposeView(this._previousViewInTransitionID,this._previousViewInTransition);
		}
		var nextView = this._nextViewInTransition;
		var nextItemID = this._nextViewInTransitionID;
		var previousView = this._previousViewInTransition;
		var previousItemID = this._previousViewInTransitionID;
		this._previousViewInTransition = null;
		this._previousViewInTransitionID = null;
		this._nextViewInTransition = null;
		this._nextViewInTransitionID = null;
		this._activeItemView = nextView;
		this._activeItemID = nextItemID;
		var tempMeasurements = this._activeViewMeasurements;
		this._activeViewMeasurements = this._nextViewInTransitionMeasurements;
		this._nextViewInTransitionMeasurements = tempMeasurements;
		feathers_events_TransitionEvent.dispatch(this,"transitionComplete",previousItemID,previousView,nextItemID,nextView);
		feathers_events_FeathersEvent.dispatch(this,"change");
		this.setInvalid(feathers_core_InvalidationFlag.LAYOUT);
		if(this.stage != null && (this.stage.get_focus() == null || this.stage.get_focus().stage == null)) {
			if(((nextView) instanceof openfl_display_InteractiveObject)) {
				this.stage.set_focus(js_Boot.__cast(nextView , openfl_display_InteractiveObject));
			}
		}
		this._transitionActive = false;
		var pendingTransition = this._pendingItemTransition;
		this._pendingItemTransition = null;
		if(this._clearAfterTransition) {
			this._clearAfterTransition = false;
			this.clearActiveItemInternal(pendingTransition);
		} else if(this._pendingItemID != null) {
			var pendingItemID = this._pendingItemID;
			this._pendingItemID = null;
			this.showItemInternal(pendingItemID,pendingTransition);
		}
	}
	,transition_cancelHandler: function(event) {
		this._activeTransition = null;
		this._transitionActive = this._clearAfterTransition || this._pendingItemID != null;
		if(this._nextViewInTransition != null) {
			this._viewsContainer.removeChild(this._nextViewInTransition);
			this._nextViewInTransitionMeasurements.restore(this._nextViewInTransition);
			this.disposeView(this._nextViewInTransitionID,this._nextViewInTransition);
		}
		var nextView = this._nextViewInTransition;
		var nextItemID = this._nextViewInTransitionID;
		var previousView = this._previousViewInTransition;
		var previousItemID = this._previousViewInTransitionID;
		this._previousViewInTransition = null;
		this._previousViewInTransitionID = null;
		this._nextViewInTransition = null;
		this._nextViewInTransitionID = null;
		this._activeItemView = previousView;
		this._activeItemID = previousItemID;
		var tempMeasurements = this._activeViewMeasurements;
		this._activeViewMeasurements = this._previousViewInTransitionMeasurements;
		this._previousViewInTransitionMeasurements = tempMeasurements;
		this.transitionCancel();
		feathers_events_TransitionEvent.dispatch(this,"transitionCancel",previousItemID,previousView,nextItemID,nextView);
		feathers_events_FeathersEvent.dispatch(this,"change");
		this.setInvalid(feathers_core_InvalidationFlag.LAYOUT);
		if(this.stage != null && (this.stage.get_focus() == null || this.stage.get_focus().stage == null)) {
			if(((this._activeItemView) instanceof openfl_display_InteractiveObject)) {
				this.stage.set_focus(js_Boot.__cast(this._activeItemView , openfl_display_InteractiveObject));
			}
		}
		this._transitionActive = false;
		var pendingTransition = this._pendingItemTransition;
		this._pendingItemTransition = null;
		if(this._clearAfterTransition) {
			this._clearAfterTransition = false;
			this.clearActiveItemInternal(pendingTransition);
		} else if(this._pendingItemID != null) {
			var pendingItemID = this._pendingItemID;
			this._pendingItemID = null;
			this.showItemInternal(pendingItemID,pendingTransition);
		}
	}
	,__class__: feathers_controls_navigators_BaseNavigator
	,__properties__: $extend(feathers_core_FeathersControl.prototype.__properties__,{set_autoSizeMode:"set_autoSizeMode",get_autoSizeMode:"get_autoSizeMode",set_childFocusEnabled:"set_childFocusEnabled",get_childFocusEnabled:"get_childFocusEnabled",get_transitionActive:"get_transitionActive",get_activeItemView:"get_activeItemView",get_activeItemID:"get_activeItemID"})
});
var feathers_controls_navigators_PageItem = function() {
	this.internalID = Std.string(feathers_controls_navigators_PageItem.internalIDCounter);
	feathers_controls_navigators_PageItem.internalIDCounter++;
};
$hxClasses["feathers.controls.navigators.PageItem"] = feathers_controls_navigators_PageItem;
feathers_controls_navigators_PageItem.__name__ = "feathers.controls.navigators.PageItem";
feathers_controls_navigators_PageItem.withClass = function(viewClass) {
	var item = new feathers_controls_navigators_PageItem();
	item.viewFactory = feathers_utils_AbstractDisplayObjectFactory.fromClass(viewClass);
	return item;
};
feathers_controls_navigators_PageItem.withFunction = function(viewFunction) {
	var item = new feathers_controls_navigators_PageItem();
	item.viewFactory = feathers_utils_AbstractDisplayObjectFactory.fromFunction(viewFunction);
	return item;
};
feathers_controls_navigators_PageItem.withDisplayObject = function(viewInstance) {
	var item = new feathers_controls_navigators_PageItem();
	item.viewFactory = feathers_utils_AbstractDisplayObjectFactory.fromDisplayObject(viewInstance);
	return item;
};
feathers_controls_navigators_PageItem.withFactory = function(viewFactory) {
	var item = new feathers_controls_navigators_PageItem();
	item.viewFactory = viewFactory;
	return item;
};
feathers_controls_navigators_PageItem.prototype = {
	internalID: null
	,viewFactory: null
	,getView: function(navigator) {
		var view = this.viewFactory.create();
		return view;
	}
	,returnView: function(view) {
		if(this.viewFactory.destroy != null) {
			this.viewFactory.destroy(view);
		}
	}
	,__class__: feathers_controls_navigators_PageItem
};
var feathers_controls_navigators_PageNavigator = function(dataProvider) {
	this.__customPageIndicatorVariant = null;
	this.__gap = 0.0;
	this.__nextTransition = null;
	this.__previousTransition = null;
	this.__pageIndicatorPosition = feathers_layout_RelativePosition.BOTTOM;
	this._ignoreSelectionChange = false;
	this._previousCustomPageIndicatorVariant = null;
	this._simulateTouch = false;
	this._swipeEnabled = true;
	this._selectedItem = null;
	this._selectedIndex = -1;
	this._activeItemIndex = -1;
	this.initializePageNavigatorTheme();
	this.set_dataProvider(dataProvider);
	feathers_controls_navigators_BaseNavigator.call(this);
	this._viewsContainer = new feathers_controls_LayoutGroup();
	this.addChild(this._viewsContainer);
};
$hxClasses["feathers.controls.navigators.PageNavigator"] = feathers_controls_navigators_PageNavigator;
feathers_controls_navigators_PageNavigator.__name__ = "feathers.controls.navigators.PageNavigator";
feathers_controls_navigators_PageNavigator.__interfaces__ = [feathers_core_IDataSelector,feathers_core_IIndexSelector];
feathers_controls_navigators_PageNavigator.__super__ = feathers_controls_navigators_BaseNavigator;
feathers_controls_navigators_PageNavigator.prototype = $extend(feathers_controls_navigators_BaseNavigator.prototype,{
	pageIndicator: null
	,_previousEdgePuller: null
	,_nextEdgePuller: null
	,_dataProvider: null
	,get_dataProvider: function() {
		return this._dataProvider;
	}
	,set_dataProvider: function(value) {
		if(this._dataProvider == value) {
			return this._dataProvider;
		}
		if(this._dataProvider != null) {
			this._dataProvider.removeEventListener("addItem",$bind(this,this.pageNavigator_dataProvider_addItemHandler));
			this._dataProvider.removeEventListener("removeItem",$bind(this,this.pageNavigator_dataProvider_removeItemHandler));
			this._dataProvider.removeEventListener("replaceItem",$bind(this,this.pageNavigator_dataProvider_replaceItemHandler));
			this._dataProvider.removeEventListener("removeAll",$bind(this,this.pageNavigator_dataProvider_removeAllHandler));
			this._dataProvider.removeEventListener("reset",$bind(this,this.pageNavigator_dataProvider_resetHandler));
			if(value == null) {
				this.removeAllItems();
			} else {
				var item = this._dataProvider.iterator();
				while(item.hasNext()) {
					var item1 = item.next();
					this.removeItemInternal(item1.internalID);
				}
			}
		}
		this._dataProvider = value;
		if(this._dataProvider != null) {
			var item = this._dataProvider.iterator();
			while(item.hasNext()) {
				var item1 = item.next();
				this.addItemInternal(item1.internalID,item1);
			}
			this._dataProvider.addEventListener("addItem",$bind(this,this.pageNavigator_dataProvider_addItemHandler),false,0,true);
			this._dataProvider.addEventListener("removeItem",$bind(this,this.pageNavigator_dataProvider_removeItemHandler),false,0,true);
			this._dataProvider.addEventListener("replaceItem",$bind(this,this.pageNavigator_dataProvider_replaceItemHandler),false,0,true);
			this._dataProvider.addEventListener("removeAll",$bind(this,this.pageNavigator_dataProvider_removeAllHandler),false,0,true);
			this._dataProvider.addEventListener("reset",$bind(this,this.pageNavigator_dataProvider_resetHandler),false,0,true);
		}
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		if(this._dataProvider == null || this._dataProvider.get_length() == 0) {
			this.set_selectedIndex(-1);
		} else {
			this.set_selectedIndex(0);
		}
		feathers_events_FeathersEvent.dispatch(this,"dataChange");
		return this._dataProvider;
	}
	,_activeItemIndex: null
	,_selectedIndex: null
	,get_selectedIndex: function() {
		return this._selectedIndex;
	}
	,set_selectedIndex: function(value) {
		if(this._dataProvider == null) {
			value = -1;
		}
		if(this._selectedIndex == value) {
			return this._selectedIndex;
		}
		this._selectedIndex = value;
		if(this._selectedIndex == -1) {
			this._selectedItem = null;
		} else {
			this._selectedItem = this._dataProvider.get(this._selectedIndex);
		}
		this.setInvalid(feathers_core_InvalidationFlag.SELECTION);
		return this._selectedIndex;
	}
	,get_maxSelectedIndex: function() {
		if(this._dataProvider == null) {
			return -1;
		}
		return this._dataProvider.get_length() - 1;
	}
	,_selectedItem: null
	,get_selectedItem: function() {
		return this._selectedItem;
	}
	,set_selectedItem: function(value) {
		if(this._dataProvider == null) {
			this.set_selectedIndex(-1);
			return this._selectedItem;
		}
		this.set_selectedIndex(this._dataProvider.indexOf(value));
		return this._selectedItem;
	}
	,_swipeEnabled: null
	,get_swipeEnabled: function() {
		return this._swipeEnabled;
	}
	,set_swipeEnabled: function(value) {
		if(this._swipeEnabled == value) {
			return this._swipeEnabled;
		}
		this._swipeEnabled = value;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		return this._swipeEnabled;
	}
	,_simulateTouch: null
	,get_simulateTouch: function() {
		return this._simulateTouch;
	}
	,set_simulateTouch: function(value) {
		if(this._simulateTouch == value) {
			return this._simulateTouch;
		}
		this._simulateTouch = value;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		return this._simulateTouch;
	}
	,_previousCustomPageIndicatorVariant: null
	,_oldPageIndicatorFactory: null
	,_pageIndicatorFactory: null
	,get_pageIndicatorFactory: function() {
		return this._pageIndicatorFactory;
	}
	,set_pageIndicatorFactory: function(value) {
		if(this._pageIndicatorFactory == value) {
			return this._pageIndicatorFactory;
		}
		this._pageIndicatorFactory = value;
		this.setInvalid(feathers_controls_navigators_PageNavigator.INVALIDATION_FLAG_PAGE_INDICATOR_FACTORY);
		return this._pageIndicatorFactory;
	}
	,_ignoreSelectionChange: null
	,_dragTransitionContext: null
	,dispose: function() {
		this._pendingItemID = null;
		this._pendingItemTransition = null;
		this._transitionActive = false;
		if(this._activeTransition != null) {
			this._activeTransition.removeEventListener("complete",$bind(this,this.transition_completeHandler));
			this._activeTransition.removeEventListener("cancel",$bind(this,this.transition_cancelHandler));
			this._activeTransition.stop();
		}
		this.destroyPageIndicator();
		this._activeItemID = null;
		this._activeItemView = null;
		this.set_dataProvider(null);
		feathers_controls_navigators_BaseNavigator.prototype.dispose.call(this);
	}
	,initialize: function() {
		feathers_controls_navigators_BaseNavigator.prototype.initialize.call(this);
		if(this._previousEdgePuller == null) {
			this._previousEdgePuller = new feathers_utils_EdgePuller(this,feathers_layout_RelativePosition.LEFT);
			this._previousEdgePuller.addEventListener("opening",$bind(this,this.pageNavigator_previousEdgePuller_openingHandler));
			this._previousEdgePuller.addEventListener("cancel",$bind(this,this.pageNavigator_previousEdgePuller_cancelHandler));
			this._previousEdgePuller.addEventListener("open",$bind(this,this.pageNavigator_previousEdgePuller_openHandler));
		}
		if(this._nextEdgePuller == null) {
			this._nextEdgePuller = new feathers_utils_EdgePuller(this,feathers_layout_RelativePosition.RIGHT);
			this._nextEdgePuller.addEventListener("opening",$bind(this,this.pageNavigator_nextEdgePuller_openingHandler));
			this._nextEdgePuller.addEventListener("cancel",$bind(this,this.pageNavigator_nextEdgePuller_cancelHandler));
			this._nextEdgePuller.addEventListener("open",$bind(this,this.pageNavigator_nextEdgePuller_openHandler));
		}
	}
	,initializePageNavigatorTheme: function() {
		feathers_themes_steel_components_SteelPageNavigatorStyles.initialize();
	}
	,update: function() {
		var dataInvalid = this.isInvalid(feathers_core_InvalidationFlag.DATA);
		var selectionInvalid = this.isInvalid(feathers_core_InvalidationFlag.SELECTION);
		if(this._previousCustomPageIndicatorVariant != this.get_customPageIndicatorVariant()) {
			this.setInvalidationFlag(feathers_controls_navigators_PageNavigator.INVALIDATION_FLAG_PAGE_INDICATOR_FACTORY);
		}
		var pageIndicatorInvalid = this.isInvalid(feathers_controls_navigators_PageNavigator.INVALIDATION_FLAG_PAGE_INDICATOR_FACTORY);
		if(pageIndicatorInvalid) {
			this.createPageIndicator();
		}
		if(dataInvalid) {
			this._previousEdgePuller.simulateTouch = this._simulateTouch;
			this._nextEdgePuller.simulateTouch = this._simulateTouch;
		}
		if(dataInvalid || selectionInvalid || pageIndicatorInvalid) {
			this.refreshSelection();
		}
		feathers_controls_navigators_BaseNavigator.prototype.update.call(this);
		this._previousCustomPageIndicatorVariant = this.get_customPageIndicatorVariant();
	}
	,measure: function() {
		if(this.get_explicitWidth() != null) {
			this.pageIndicator.set_width(this.get_explicitWidth());
		} else if(this._autoSizeMode == feathers_layout_AutoSizeMode.STAGE && this.stage != null) {
			this.pageIndicator.set_width(this.stage.stageWidth);
		} else {
			this.pageIndicator.resetWidth();
		}
		this.pageIndicator.validateNow();
		this.chromeMeasuredWidth = Math.max(this.chromeMeasuredWidth,this.pageIndicator.get_width());
		switch(this.get_pageIndicatorPosition()._hx_index) {
		case 0:
			this.topContentOffset += this.pageIndicator.get_height() + this.get_gap();
			break;
		case 2:
			this.bottomContentOffset += this.pageIndicator.get_height() + this.get_gap();
			break;
		default:
			throw new openfl_errors_ArgumentError("Invalid pageIndicatorPosition " + Std.string(this.get_pageIndicatorPosition()));
		}
		return feathers_controls_navigators_BaseNavigator.prototype.measure.call(this);
	}
	,createPageIndicator: function() {
		this.destroyPageIndicator();
		var factory = this._pageIndicatorFactory != null ? this._pageIndicatorFactory : feathers_controls_navigators_PageNavigator.defaultPageIndicatorFactory;
		this._oldPageIndicatorFactory = factory;
		this.pageIndicator = factory.create();
		if(this.pageIndicator.get_variant() == null) {
			this.pageIndicator.set_variant(this.get_customPageIndicatorVariant() != null ? this.get_customPageIndicatorVariant() : feathers_controls_navigators_PageNavigator.CHILD_VARIANT_PAGE_INDICATOR);
		}
		this.pageIndicator.addEventListener("change",$bind(this,this.pageNavigator_pageIndicator_changeHandler));
		this.addChild(this.pageIndicator);
	}
	,destroyPageIndicator: function() {
		if(this.pageIndicator == null) {
			return;
		}
		this.pageIndicator.removeEventListener("change",$bind(this,this.pageNavigator_pageIndicator_changeHandler));
		this.removeChild(this.pageIndicator);
		if(this._oldPageIndicatorFactory.destroy != null) {
			this._oldPageIndicatorFactory.destroy(this.pageIndicator);
		}
		this._oldPageIndicatorFactory = null;
		this.pageIndicator = null;
	}
	,layoutContent: function() {
		this.pageIndicator.set_x(0.0);
		this.pageIndicator.set_width(this.actualWidth);
		this.pageIndicator.validateNow();
		switch(this.get_pageIndicatorPosition()._hx_index) {
		case 0:
			this.pageIndicator.set_y(0.0);
			break;
		case 2:
			this.pageIndicator.set_y(this.actualHeight - this.pageIndicator.get_height());
			break;
		default:
			throw new openfl_errors_ArgumentError("Invalid pageIndicatorPosition " + Std.string(this.get_pageIndicatorPosition()));
		}
		feathers_controls_navigators_BaseNavigator.prototype.layoutContent.call(this);
	}
	,getView: function(id) {
		var item = js_Boot.__cast(this._addedItems.h[id] , feathers_controls_navigators_PageItem);
		return item.getView(this);
	}
	,disposeView: function(id,view) {
		var item = js_Boot.__cast(this._addedItems.h[id] , feathers_controls_navigators_PageItem);
		item.returnView(view);
	}
	,refreshSelection: function() {
		var _gthis = this;
		var oldIgnoreSelectionChange = this._ignoreSelectionChange;
		this._ignoreSelectionChange = true;
		this.pageIndicator.set_maxSelectedIndex(this.get_maxSelectedIndex());
		this.pageIndicator.set_selectedIndex(this._selectedIndex);
		this._ignoreSelectionChange = oldIgnoreSelectionChange;
		if(this._selectedItem == null) {
			this._activeItemIndex = -1;
			if(this.get_activeItemID() != null) {
				this.clearActiveItemInternal();
			}
		} else if(this._selectedItem != null) {
			var oldIndex = this._activeItemIndex;
			this._activeItemIndex = this._selectedIndex;
			if(!this._previousEdgePuller.get_active() && !this._nextEdgePuller.get_active()) {
				var activeID = this._transitionActive ? this._nextViewInTransitionID : this._activeItemID;
				if(activeID != this._selectedItem.internalID) {
					var transition = null;
					if(oldIndex != -1 && oldIndex != this._selectedIndex) {
						transition = oldIndex < this._selectedIndex ? this.get_nextTransition() : this.get_previousTransition();
					}
					this.runWithInvalidationFlagsOnly(function() {
						_gthis.showItemInternal(_gthis._selectedItem.internalID,transition);
					});
				}
			}
		}
		var tmp = this._enabled && this._swipeEnabled && this._selectedIndex > 0 && !this._nextEdgePuller.get_active();
		this._previousEdgePuller.enabled = tmp;
		var tmp = this._enabled && this._swipeEnabled && this._selectedIndex < this.get_maxSelectedIndex() && !this._previousEdgePuller.get_active();
		this._nextEdgePuller.enabled = tmp;
	}
	,startPreviousDragTransition: function(one,two) {
		var _gthis = this;
		var effectContext = (this.get_previousTransition())(one,two);
		this._previousEdgePuller.set_snapDuration(effectContext.get_duration());
		this._dragTransitionContext = new feathers_motion_effects_EventToPositionEffectContext(effectContext,this._previousEdgePuller,"change",function(event) {
			return _gthis._dragTransitionContext.set_position(_gthis._previousEdgePuller.get_pullDistance() / _gthis.actualWidth);
		});
		return this._dragTransitionContext;
	}
	,startNextDragTransition: function(one,two) {
		var _gthis = this;
		var effectContext = (this.get_nextTransition())(one,two);
		this._nextEdgePuller.set_snapDuration(effectContext.get_duration());
		this._dragTransitionContext = new feathers_motion_effects_EventToPositionEffectContext(effectContext,this._nextEdgePuller,"change",function(event) {
			return _gthis._dragTransitionContext.set_position(_gthis._nextEdgePuller.get_pullDistance() / _gthis.actualWidth);
		});
		return this._dragTransitionContext;
	}
	,pageNavigator_pageIndicator_changeHandler: function(event) {
		if(this._ignoreSelectionChange) {
			return;
		}
		this.set_selectedIndex(this.pageIndicator.get_selectedIndex());
	}
	,pageNavigator_dataProvider_addItemHandler: function(event) {
		var item = js_Boot.__cast(event.addedItem , feathers_controls_navigators_PageItem);
		this.addItemInternal(item.internalID,item);
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		if(this._selectedIndex >= event.index) {
			this.set_selectedIndex(this.get_selectedIndex() + 1);
		} else if(this._selectedIndex == -1) {
			this.set_selectedIndex(0);
		}
	}
	,pageNavigator_dataProvider_removeItemHandler: function(event) {
		var item = js_Boot.__cast(event.removedItem , feathers_controls_navigators_PageItem);
		this.removeItemInternal(item.internalID);
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		if(this._dataProvider.get_length() == 0) {
			this.set_selectedIndex(-1);
		} else if(this._selectedIndex >= event.index) {
			this.set_selectedIndex(this.get_selectedIndex() - 1);
		}
	}
	,pageNavigator_dataProvider_replaceItemHandler: function(event) {
		var addedItem = js_Boot.__cast(event.addedItem , feathers_controls_navigators_PageItem);
		var removedItem = js_Boot.__cast(event.removedItem , feathers_controls_navigators_PageItem);
		this.removeItemInternal(removedItem.internalID);
		this.addItemInternal(addedItem.internalID,addedItem);
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		if(this._selectedIndex == event.index) {
			this.set_selectedItem(this._dataProvider.get(this._selectedIndex));
		}
	}
	,pageNavigator_dataProvider_removeAllHandler: function(event) {
		this.set_selectedIndex(-1);
		var h = this._addedItems.h;
		var id_h = h;
		var id_keys = Object.keys(h);
		var id_length = id_keys.length;
		var id_current = 0;
		while(id_current < id_length) {
			var id = id_keys[id_current++];
			var item = this._addedItems.h[id];
			this.removeItemInternal(item.internalID);
		}
	}
	,pageNavigator_dataProvider_resetHandler: function(event) {
		this.set_selectedIndex(-1);
		var h = this._addedItems.h;
		var id_h = h;
		var id_keys = Object.keys(h);
		var id_length = id_keys.length;
		var id_current = 0;
		while(id_current < id_length) {
			var id = id_keys[id_current++];
			var item = this._addedItems.h[id];
			this.removeItemInternal(item.internalID);
		}
	}
	,pageNavigator_previousEdgePuller_openingHandler: function(event) {
		var newIndex = this._selectedIndex - 1;
		if(newIndex < 0) {
			event.preventDefault();
			return;
		}
		var touchPointID = this._previousEdgePuller.get_touchPointID();
		if(touchPointID != null) {
			var exclusivePointer = feathers_utils_ExclusivePointer.forStage(this.stage);
			if(this._previousEdgePuller.get_touchPointIsSimulated()) {
				var result = exclusivePointer.claimMouse(this);
				if(!result) {
					event.preventDefault();
					return;
				}
			} else {
				var result = exclusivePointer.claimTouch(touchPointID,this);
				if(!result) {
					event.preventDefault();
					return;
				}
			}
		}
		if(this.get_previousTransition() != null) {
			this._nextEdgePuller.enabled = false;
			var item = this._dataProvider.get(newIndex);
			this.showItemInternal(item.internalID,$bind(this,this.startPreviousDragTransition));
		} else {
			event.preventDefault();
			this.set_selectedIndex(newIndex);
		}
	}
	,pageNavigator_previousEdgePuller_cancelHandler: function(event) {
		this._previousEdgePuller.enabled = this._enabled && this._swipeEnabled && this._selectedIndex > 0;
		var tmp = this._enabled && this._swipeEnabled && this._selectedIndex < this.get_maxSelectedIndex();
		this._nextEdgePuller.enabled = tmp;
		var context = this._dragTransitionContext;
		this._dragTransitionContext = null;
		if(context != null) {
			context.set_dispatcher(null);
			feathers_events_FeathersEvent.dispatch(context,"cancel");
		}
	}
	,pageNavigator_previousEdgePuller_openHandler: function(event) {
		var oldSnapDuration = this._previousEdgePuller.get_snapDuration();
		this._previousEdgePuller.set_snapDuration(0.0);
		this._previousEdgePuller.set_opened(false);
		this._previousEdgePuller.set_snapDuration(oldSnapDuration);
		this.set_selectedIndex(this.get_selectedIndex() - 1);
		this._previousEdgePuller.enabled = this._enabled && this._swipeEnabled && this._selectedIndex > 0;
		var tmp = this._enabled && this._swipeEnabled && this._selectedIndex < this.get_maxSelectedIndex();
		this._nextEdgePuller.enabled = tmp;
		var context = this._dragTransitionContext;
		this._dragTransitionContext = null;
		if(context != null) {
			context.set_dispatcher(null);
			feathers_events_FeathersEvent.dispatch(context,"complete");
		}
	}
	,pageNavigator_nextEdgePuller_openingHandler: function(event) {
		var newIndex = this._selectedIndex + 1;
		if(newIndex > this.get_maxSelectedIndex()) {
			event.preventDefault();
			return;
		}
		var touchPointID = this._nextEdgePuller.get_touchPointID();
		if(touchPointID != null) {
			var exclusivePointer = feathers_utils_ExclusivePointer.forStage(this.stage);
			if(this._nextEdgePuller.get_touchPointIsSimulated()) {
				var result = exclusivePointer.claimMouse(this);
				if(!result) {
					event.preventDefault();
					return;
				}
			} else {
				var result = exclusivePointer.claimTouch(touchPointID,this);
				if(!result) {
					event.preventDefault();
					return;
				}
			}
		}
		if(this.get_nextTransition() != null) {
			this._previousEdgePuller.enabled = false;
			var item = this._dataProvider.get(newIndex);
			this.showItemInternal(item.internalID,$bind(this,this.startNextDragTransition));
		} else {
			event.preventDefault();
			this.set_selectedIndex(newIndex);
		}
	}
	,pageNavigator_nextEdgePuller_cancelHandler: function(event) {
		this._previousEdgePuller.enabled = this._enabled && this._swipeEnabled && this._selectedIndex > 0;
		var tmp = this._enabled && this._swipeEnabled && this._selectedIndex < this.get_maxSelectedIndex();
		this._nextEdgePuller.enabled = tmp;
		var context = this._dragTransitionContext;
		this._dragTransitionContext = null;
		if(context != null) {
			context.set_dispatcher(null);
			feathers_events_FeathersEvent.dispatch(context,"cancel");
		}
	}
	,pageNavigator_nextEdgePuller_openHandler: function(event) {
		var oldSnapDuration = this._nextEdgePuller.get_snapDuration();
		this._nextEdgePuller.set_snapDuration(0.0);
		this._nextEdgePuller.set_opened(false);
		this._nextEdgePuller.set_snapDuration(oldSnapDuration);
		this.set_selectedIndex(this.get_selectedIndex() + 1);
		this._previousEdgePuller.enabled = this._enabled && this._swipeEnabled && this._selectedIndex > 0;
		var tmp = this._enabled && this._swipeEnabled && this._selectedIndex < this.get_maxSelectedIndex();
		this._nextEdgePuller.enabled = tmp;
		var context = this._dragTransitionContext;
		this._dragTransitionContext = null;
		if(context != null) {
			context.set_dispatcher(null);
			feathers_events_FeathersEvent.dispatch(context,"complete");
		}
	}
	,get_styleContext: function() {
		return feathers_controls_navigators_PageNavigator;
	}
	,__pageIndicatorPosition: null
	,get_pageIndicatorPosition: function() {
		return this.__pageIndicatorPosition;
	}
	,set_pageIndicatorPosition: function(value) {
		if(!this.setStyle("pageIndicatorPosition")) {
			return this.__pageIndicatorPosition;
		}
		if(this.__pageIndicatorPosition == value) {
			return this.__pageIndicatorPosition;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_pageIndicatorPosition);
		this.__pageIndicatorPosition = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__pageIndicatorPosition;
	}
	,clearStyle_pageIndicatorPosition: function() {
		this.set_pageIndicatorPosition(feathers_layout_RelativePosition.BOTTOM);
		return this.get_pageIndicatorPosition();
	}
	,__previousTransition: null
	,get_previousTransition: function() {
		return this.__previousTransition;
	}
	,set_previousTransition: function(value) {
		if(!this.setStyle("previousTransition")) {
			return this.__previousTransition;
		}
		if(this.__previousTransition == value) {
			return this.__previousTransition;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_previousTransition);
		this.__previousTransition = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__previousTransition;
	}
	,clearStyle_previousTransition: function() {
		this.set_previousTransition(null);
		return this.get_previousTransition();
	}
	,__nextTransition: null
	,get_nextTransition: function() {
		return this.__nextTransition;
	}
	,set_nextTransition: function(value) {
		if(!this.setStyle("nextTransition")) {
			return this.__nextTransition;
		}
		if(this.__nextTransition == value) {
			return this.__nextTransition;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_nextTransition);
		this.__nextTransition = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__nextTransition;
	}
	,clearStyle_nextTransition: function() {
		this.set_nextTransition(null);
		return this.get_nextTransition();
	}
	,__gap: null
	,get_gap: function() {
		return this.__gap;
	}
	,set_gap: function(value) {
		if(!this.setStyle("gap")) {
			return this.__gap;
		}
		if(this.__gap == value) {
			return this.__gap;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_gap);
		this.__gap = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__gap;
	}
	,clearStyle_gap: function() {
		this.set_gap(0.0);
		return this.get_gap();
	}
	,__customPageIndicatorVariant: null
	,get_customPageIndicatorVariant: function() {
		return this.__customPageIndicatorVariant;
	}
	,set_customPageIndicatorVariant: function(value) {
		if(!this.setStyle("customPageIndicatorVariant")) {
			return this.__customPageIndicatorVariant;
		}
		if(this.__customPageIndicatorVariant == value) {
			return this.__customPageIndicatorVariant;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_customPageIndicatorVariant);
		this.__customPageIndicatorVariant = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__customPageIndicatorVariant;
	}
	,clearStyle_customPageIndicatorVariant: function() {
		this.set_customPageIndicatorVariant(null);
		return this.get_customPageIndicatorVariant();
	}
	,__class__: feathers_controls_navigators_PageNavigator
	,__properties__: $extend(feathers_controls_navigators_BaseNavigator.prototype.__properties__,{set_pageIndicatorFactory:"set_pageIndicatorFactory",get_pageIndicatorFactory:"get_pageIndicatorFactory",set_customPageIndicatorVariant:"set_customPageIndicatorVariant",get_customPageIndicatorVariant:"get_customPageIndicatorVariant",set_gap:"set_gap",get_gap:"get_gap",set_nextTransition:"set_nextTransition",get_nextTransition:"get_nextTransition",set_previousTransition:"set_previousTransition",get_previousTransition:"get_previousTransition",set_simulateTouch:"set_simulateTouch",get_simulateTouch:"get_simulateTouch",set_swipeEnabled:"set_swipeEnabled",get_swipeEnabled:"get_swipeEnabled",set_pageIndicatorPosition:"set_pageIndicatorPosition",get_pageIndicatorPosition:"get_pageIndicatorPosition",set_selectedItem:"set_selectedItem",get_selectedItem:"get_selectedItem",get_maxSelectedIndex:"get_maxSelectedIndex",set_selectedIndex:"set_selectedIndex",get_selectedIndex:"get_selectedIndex",set_dataProvider:"set_dataProvider",get_dataProvider:"get_dataProvider"})
});
var feathers_controls_navigators_Route = function() {
	this._viewToEvents = new haxe_ds_ObjectMap();
};
$hxClasses["feathers.controls.navigators.Route"] = feathers_controls_navigators_Route;
feathers_controls_navigators_Route.__name__ = "feathers.controls.navigators.Route";
feathers_controls_navigators_Route.withClass = function(path,viewClass,actions,updateState,saveData) {
	var item = new feathers_controls_navigators_Route();
	item.path = path;
	item.viewFactory = feathers_utils_DisplayObjectFactory.withClass(viewClass);
	item.actions = actions;
	item.updateState = updateState;
	item.saveData = saveData;
	return item;
};
feathers_controls_navigators_Route.withFunction = function(path,viewFunction,actions,updateState,saveData) {
	var item = new feathers_controls_navigators_Route();
	item.path = path;
	item.viewFactory = feathers_utils_DisplayObjectFactory.withFunction(viewFunction);
	item.actions = actions;
	item.updateState = updateState;
	item.saveData = saveData;
	return item;
};
feathers_controls_navigators_Route.withDisplayObject = function(path,viewInstance,actions,updateState,saveData) {
	var item = new feathers_controls_navigators_Route();
	item.path = path;
	item.viewFactory = feathers_utils_DisplayObjectFactory.withDisplayObject(viewInstance);
	item.actions = actions;
	item.updateState = updateState;
	item.saveData = saveData;
	return item;
};
feathers_controls_navigators_Route.withFactory = function(path,viewFactory,actions,updateState,saveData) {
	var item = new feathers_controls_navigators_Route();
	item.path = path;
	item.viewFactory = viewFactory;
	item.actions = actions;
	item.updateState = updateState;
	item.saveData = saveData;
	return item;
};
feathers_controls_navigators_Route.withRedirect = function(path,redirectTo) {
	var item = new feathers_controls_navigators_Route();
	item.path = path;
	item.redirectTo = redirectTo;
	return item;
};
feathers_controls_navigators_Route.prototype = {
	path: null
	,updateState: function(view,routeState) {
	}
	,saveData: function(view) {
		return null;
	}
	,viewFactory: null
	,redirectTo: null
	,actions: null
	,_viewToEvents: null
	,setAction: function(eventType,action) {
		if(this.actions == null) {
			this.actions = new haxe_ds_StringMap();
		}
		if(action == null) {
			var _this = this.actions;
			if(Object.prototype.hasOwnProperty.call(_this.h,eventType)) {
				delete(_this.h[eventType]);
			}
		} else {
			this.actions.h[eventType] = action;
		}
	}
	,getView: function(navigator) {
		var view = this.viewFactory.create();
		var listeners = this.addActionListeners(view,navigator);
		this._viewToEvents.set(view,listeners);
		return view;
	}
	,returnView: function(view) {
		var viewListeners = this._viewToEvents.h[view.__id__];
		this.removeEventsFromView(view,viewListeners);
		this._viewToEvents.remove(view);
		if(this.viewFactory.destroy != null) {
			this.viewFactory.destroy(view);
		}
	}
	,addActionListeners: function(view,navigator) {
		var listeners = [];
		if(this.actions == null) {
			return listeners;
		}
		var h = this.actions.h;
		var eventType_h = h;
		var eventType_keys = Object.keys(h);
		var eventType_length = eventType_keys.length;
		var eventType_current = 0;
		while(eventType_current < eventType_length) {
			var eventType = eventType_keys[eventType_current++];
			var action = this.actions.h[eventType];
			var listener = this.createActionEventListener(action,navigator);
			view.addEventListener(eventType,listener);
			listeners.push(new feathers_controls_navigators__$Route_ViewListener(eventType,listener));
		}
		return listeners;
	}
	,performAction: function(action,event,navigator) {
		switch(action._hx_index) {
		case 0:
			var url = action.url;
			var newHistoryState = action.newHistoryState;
			var transition = action.transition;
			navigator.push(url,newHistoryState,transition);
			break;
		case 1:
			var url = action.url;
			var newHistoryState = action.newHistoryState;
			var transition = action.transition;
			navigator.replace(url,newHistoryState,transition);
			break;
		case 2:
			var transition = action.transition;
			navigator.goBack(transition);
			break;
		case 3:
			var transition = action.transition;
			navigator.goForward(transition);
			break;
		case 4:
			var n = action.n;
			var transition = action.transition;
			navigator.go(n);
			break;
		case 5:
			var fn = action.callback;
			fn(event);
			break;
		case 6:
			var fn = action.callback;
			return fn(event);
		}
		return null;
	}
	,createActionEventListener: function(action,navigator) {
		var _gthis = this;
		var eventListener = function(event) {
			if(navigator.get_transitionActive()) {
				return;
			}
			var current = action;
			while(current != null) current = _gthis.performAction(current,event,navigator);
		};
		return eventListener;
	}
	,removeEventsFromView: function(view,viewListeners) {
		var _g = 0;
		while(_g < viewListeners.length) {
			var viewListener = viewListeners[_g];
			++_g;
			view.removeEventListener(viewListener.eventType,viewListener.listener);
		}
	}
	,__class__: feathers_controls_navigators_Route
};
var feathers_controls_navigators__$Route_ViewListener = function(eventType,listener) {
	this.eventType = eventType;
	this.listener = listener;
};
$hxClasses["feathers.controls.navigators._Route.ViewListener"] = feathers_controls_navigators__$Route_ViewListener;
feathers_controls_navigators__$Route_ViewListener.__name__ = "feathers.controls.navigators._Route.ViewListener";
feathers_controls_navigators__$Route_ViewListener.prototype = {
	eventType: null
	,listener: null
	,__class__: feathers_controls_navigators__$Route_ViewListener
};
var feathers_controls_navigators_RouterAction = $hxEnums["feathers.controls.navigators.RouterAction"] = { __ename__:"feathers.controls.navigators.RouterAction",__constructs__:null
	,Push: ($_=function(url,newHistoryState,transition) { return {_hx_index:0,url:url,newHistoryState:newHistoryState,transition:transition,__enum__:"feathers.controls.navigators.RouterAction",toString:$estr}; },$_._hx_name="Push",$_.__params__ = ["url","newHistoryState","transition"],$_)
	,Replace: ($_=function(url,newHistoryState,transition) { return {_hx_index:1,url:url,newHistoryState:newHistoryState,transition:transition,__enum__:"feathers.controls.navigators.RouterAction",toString:$estr}; },$_._hx_name="Replace",$_.__params__ = ["url","newHistoryState","transition"],$_)
	,GoBack: ($_=function(transition) { return {_hx_index:2,transition:transition,__enum__:"feathers.controls.navigators.RouterAction",toString:$estr}; },$_._hx_name="GoBack",$_.__params__ = ["transition"],$_)
	,GoForward: ($_=function(transition) { return {_hx_index:3,transition:transition,__enum__:"feathers.controls.navigators.RouterAction",toString:$estr}; },$_._hx_name="GoForward",$_.__params__ = ["transition"],$_)
	,Go: ($_=function(n,transition) { return {_hx_index:4,n:n,transition:transition,__enum__:"feathers.controls.navigators.RouterAction",toString:$estr}; },$_._hx_name="Go",$_.__params__ = ["n","transition"],$_)
	,Listener: ($_=function(callback) { return {_hx_index:5,callback:callback,__enum__:"feathers.controls.navigators.RouterAction",toString:$estr}; },$_._hx_name="Listener",$_.__params__ = ["callback"],$_)
	,NewAction: ($_=function(callback) { return {_hx_index:6,callback:callback,__enum__:"feathers.controls.navigators.RouterAction",toString:$estr}; },$_._hx_name="NewAction",$_.__params__ = ["callback"],$_)
};
feathers_controls_navigators_RouterAction.__constructs__ = [feathers_controls_navigators_RouterAction.Push,feathers_controls_navigators_RouterAction.Replace,feathers_controls_navigators_RouterAction.GoBack,feathers_controls_navigators_RouterAction.GoForward,feathers_controls_navigators_RouterAction.Go,feathers_controls_navigators_RouterAction.Listener,feathers_controls_navigators_RouterAction.NewAction];
var feathers_controls_navigators_RouterNavigator = function() {
	this.__replaceTransition = null;
	this.__backTransition = null;
	this.__forwardTransition = null;
	this._cachedPaths = new haxe_ds_StringMap();
	this._preferHashRouting = false;
	this._savedGoTransition = null;
	this.basePath = null;
	this.historyDepth = 0;
	this.initializeRouterNavigatorTheme();
	feathers_controls_navigators_BaseNavigator.call(this);
	this.addEventListener("addedToStage",$bind(this,this.routerNavigator_addedToStageHandler));
	this.addEventListener("removedFromStage",$bind(this,this.routerNavigator_removedFromStageHandler));
};
$hxClasses["feathers.controls.navigators.RouterNavigator"] = feathers_controls_navigators_RouterNavigator;
feathers_controls_navigators_RouterNavigator.__name__ = "feathers.controls.navigators.RouterNavigator";
feathers_controls_navigators_RouterNavigator.__super__ = feathers_controls_navigators_BaseNavigator;
feathers_controls_navigators_RouterNavigator.prototype = $extend(feathers_controls_navigators_BaseNavigator.prototype,{
	htmlWindow: null
	,historyDepth: null
	,basePath: null
	,_savedGoTransition: null
	,_preferHashRouting: null
	,get_preferHashRouting: function() {
		return this._preferHashRouting;
	}
	,set_preferHashRouting: function(value) {
		if(this._preferHashRouting == value) {
			return this._preferHashRouting;
		}
		if(this._activeItemView != null) {
			throw new openfl_errors_ArgumentError("Must set preferHashRouting before a view is displayed");
		}
		this._preferHashRouting = value;
		return this._preferHashRouting;
	}
	,initializeRouterNavigatorTheme: function() {
		feathers_themes_steel_components_SteelRouterNavigatorStyles.initialize();
	}
	,addRoute: function(route) {
		if(route.path == null) {
			route.path = "";
		}
		this.addItemInternal(route.path,route);
		if(this.stage != null && this.get_activeItemView() == null) {
			var matched = this.matchRoute();
			if(matched == route) {
				if(route.redirectTo != null) {
					this.redirect(route);
				} else {
					this.showItemInternal(matched.path,null);
				}
			}
		}
	}
	,push: function(path,newHistoryState,transition) {
		if(this._activeItemView != null) {
			var viewData = null;
			var oldItem = this._addedItems.h[this._activeItemID];
			if(oldItem.saveData != null) {
				viewData = oldItem.saveData(this._activeItemView);
			}
			var historyState = this.htmlWindow.history.state;
			if(historyState == null) {
				historyState = { depth : this.historyDepth, state : null, viewData : viewData};
			} else {
				historyState.viewData = viewData;
			}
			var oldPathname = this.getPathname();
			var oldURL = oldPathname + this.get_location().search;
			if(this.basePath != null && !StringTools.startsWith(oldPathname,this.basePath + "/")) {
				var needsSlash = !StringTools.startsWith(oldPathname,"/");
				oldPathname = this.basePath + (needsSlash ? "/" : "") + oldPathname;
				oldURL = oldPathname + this.get_location().search;
			}
			if(this._preferHashRouting || this.htmlWindow.location.protocol == "file:") {
				oldURL = this.htmlWindow.location.pathname + this.get_location().search + "#" + oldPathname;
			}
			this.htmlWindow.history.replaceState(historyState,null,oldURL);
		}
		var newPathParts = path.split("?");
		var newPathname = newPathParts[0];
		var newSearch = "";
		if(newPathParts.length > 1) {
			newSearch = "?" + newPathParts[1];
		}
		var newURL = newPathname + newSearch;
		if(this.basePath != null && !StringTools.startsWith(newPathname,this.basePath + "/")) {
			var needsSlash = !StringTools.startsWith(newPathname,"/");
			newPathname = this.basePath + (needsSlash ? "/" : "") + newPathname;
			newURL = newPathname + newSearch;
		}
		if(this._preferHashRouting || this.htmlWindow.location.protocol == "file:") {
			newURL = this.htmlWindow.location.pathname + newSearch + "#" + newPathname;
		}
		this.historyDepth++;
		this.htmlWindow.history.pushState({ depth : this.historyDepth, state : newHistoryState, viewData : null},null,newURL);
		if(transition == null) {
			transition = this.get_forwardTransition();
		}
		return this.matchRouteAndShow(transition);
	}
	,replace: function(path,newHistoryState,transition) {
		var newPathParts = path.split("?");
		var newPathname = newPathParts[0];
		var newSearch = "";
		if(newPathParts.length > 1) {
			newSearch = "?" + newPathParts[1];
		}
		var newURL = newPathname + newSearch;
		if(this.basePath != null && !StringTools.startsWith(newPathname,this.basePath + "/")) {
			var needsSlash = !StringTools.startsWith(newPathname,"/");
			newPathname = this.basePath + (needsSlash ? "/" : "") + newPathname;
			newURL = newPathname + newSearch;
		}
		if(this._preferHashRouting || this.htmlWindow.location.protocol == "file:") {
			newURL = this.htmlWindow.location.pathname + newSearch + "#" + newPathname;
		}
		this.htmlWindow.history.replaceState({ depth : this.historyDepth, state : newHistoryState, viewData : null},null,newURL);
		if(transition == null) {
			transition = this.get_replaceTransition();
		}
		return this.matchRouteAndShow(transition);
	}
	,go: function(n,transition) {
		if(n == 0) {
			return this.get_activeItemView();
		}
		if(transition == null) {
			transition = n < 0 ? this.get_backTransition() : this.get_forwardTransition();
		}
		this._savedGoTransition = transition;
		this.htmlWindow.history.go(n);
		return null;
	}
	,goBack: function(transition) {
		return this.go(-1,transition);
	}
	,goForward: function(transition) {
		return this.go(1,transition);
	}
	,routerNavigator_addedToStageHandler: function(event) {
		this.htmlWindow = js_Boot.__cast($global , Window);
		this.htmlWindow.addEventListener("popstate",$bind(this,this.htmlWindow_popstateHandler));
		this.matchRouteAndShow(null);
	}
	,get_location: function() {
		return this.htmlWindow.location;
	}
	,get_pathname: function() {
		return this.getPathname();
	}
	,_cachedPaths: null
	,getURLVariables: function() {
		var search = this.get_location().search;
		if(search.length > 0) {
			search = HxOverrides.substr(search,1,null);
		}
		try {
			return openfl_net_URLVariables._new(search);
		} catch( _g ) {
			haxe_NativeStackTrace.lastError = _g;
			return openfl_net_URLVariables._new();
		}
	}
	,getPathname: function() {
		var pathname = null;
		if(this._preferHashRouting || this.htmlWindow.location.protocol == "file:") {
			pathname = this.htmlWindow.location.hash;
			if(pathname.length == 0) {
				pathname = "/";
			} else {
				pathname = HxOverrides.substr(pathname,1,null);
			}
		} else {
			pathname = this.htmlWindow.location.pathname;
		}
		if(this.basePath != null && StringTools.startsWith(pathname,this.basePath + "/")) {
			pathname = HxOverrides.substr(pathname,this.basePath.length,null);
		}
		return pathname;
	}
	,redirect: function(route) {
		var newURL = route.redirectTo;
		var itemPath = route.path;
		var params_h = Object.create(null);
		if(itemPath != null && itemPath.length > 0) {
			var matcher = this.getMatcher(itemPath);
			var _g = 0;
			var _g1 = matcher.keys.length;
			while(_g < _g1) {
				var i = _g++;
				var key = matcher.keys[i];
				params_h[key.name] = matcher.ereg.matched(i + 1);
			}
		}
		var h = params_h;
		var _g_h = h;
		var _g_keys = Object.keys(h);
		var _g_length = _g_keys.length;
		var _g_current = 0;
		while(_g_current < _g_length) {
			var key = _g_keys[_g_current++];
			var _g_key = key;
			var _g_value = _g_h[key];
			var name = _g_key;
			var value = _g_value;
			newURL = StringTools.replace(newURL,":name",value);
		}
		this.replace(newURL);
	}
	,getMatcher: function(path) {
		var matcher = this._cachedPaths.h[path];
		if(matcher == null) {
			matcher = feathers_utils_Path2EReg.toEReg(path,{ end : true});
			this._cachedPaths.h[path] = matcher;
		}
		return matcher;
	}
	,matchRoute: function() {
		var pathname = this.getPathname();
		var _g = 0;
		var _g1 = this._addedItemIDs;
		while(_g < _g1.length) {
			var path = _g1[_g];
			++_g;
			if(path == null || path.length == 0) {
				return this._addedItems.h[path];
			}
			var matcher = this.getMatcher(path);
			if(matcher.ereg.match(pathname)) {
				return this._addedItems.h[path];
			}
		}
		return null;
	}
	,matchRouteAndShow: function(transition) {
		var matched = this.matchRoute();
		if(matched != null) {
			if(matched.redirectTo != null) {
				this.redirect(matched);
				return null;
			}
			return this.showItemInternal(matched.path,transition);
		}
		this.clearActiveItemInternal(null);
		return null;
	}
	,getView: function(id) {
		var item = js_Boot.__cast(this._addedItems.h[id] , feathers_controls_navigators_Route);
		var itemPath = item.path;
		var params = new haxe_ds_StringMap();
		if(itemPath != null && itemPath.length > 0) {
			var matcher = this.getMatcher(itemPath);
			var _g = 0;
			var _g1 = matcher.keys.length;
			while(_g < _g1) {
				var i = _g++;
				var key = matcher.keys[i];
				var key1 = key.name;
				var value = matcher.ereg.matched(i + 1);
				params.h[key1] = value;
			}
		}
		var routeState = new feathers_data_RouteState(item.path,this.getPathname(),params);
		var view = item.getView(this);
		var historyState = this.htmlWindow.history.state;
		routeState.historyState = historyState != null ? historyState.state : null;
		routeState.data = historyState != null ? historyState.viewData : null;
		routeState.urlVariables = this.getURLVariables();
		if(item.updateState != null) {
			item.updateState(view,routeState);
		}
		view.addEventListener("link",$bind(this,this.routerNavigator_activeView_linkHandler));
		return view;
	}
	,disposeView: function(id,view) {
		view.removeEventListener("link",$bind(this,this.routerNavigator_activeView_linkHandler));
		var item = js_Boot.__cast(this._addedItems.h[id] , feathers_controls_navigators_Route);
		item.returnView(view);
	}
	,routerNavigator_removedFromStageHandler: function(event) {
		if(this.htmlWindow != null) {
			this.htmlWindow.removeEventListener("popstate",$bind(this,this.htmlWindow_popstateHandler));
			this.htmlWindow = null;
		}
	}
	,routerNavigator_activeView_linkHandler: function(event) {
		if(event.isDefaultPrevented()) {
			return;
		}
		if(!StringTools.startsWith(event.text,"router:")) {
			return;
		}
		event.preventDefault();
		var url = HxOverrides.substr(event.text,7,null);
		this.push(url);
	}
	,htmlWindow_popstateHandler: function(event) {
		event.preventDefault();
		var newDepth = this.historyDepth;
		var historyState = this.htmlWindow.history.state;
		if(historyState != null && historyState.depth != null) {
			newDepth = historyState.depth;
		}
		var transition = this._savedGoTransition;
		this._savedGoTransition = null;
		if(this._activeItemView != null && transition == null) {
			if(this.historyDepth > newDepth) {
				transition = this.get_backTransition();
			} else if(this.historyDepth < newDepth) {
				transition = this.get_forwardTransition();
			}
		}
		this.historyDepth = newDepth;
		this.matchRouteAndShow(transition);
	}
	,get_styleContext: function() {
		return feathers_controls_navigators_RouterNavigator;
	}
	,__forwardTransition: null
	,get_forwardTransition: function() {
		return this.__forwardTransition;
	}
	,set_forwardTransition: function(value) {
		if(!this.setStyle("forwardTransition")) {
			return this.__forwardTransition;
		}
		if(this.__forwardTransition == value) {
			return this.__forwardTransition;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_forwardTransition);
		this.__forwardTransition = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__forwardTransition;
	}
	,clearStyle_forwardTransition: function() {
		this.set_forwardTransition(null);
		return this.get_forwardTransition();
	}
	,__backTransition: null
	,get_backTransition: function() {
		return this.__backTransition;
	}
	,set_backTransition: function(value) {
		if(!this.setStyle("backTransition")) {
			return this.__backTransition;
		}
		if(this.__backTransition == value) {
			return this.__backTransition;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_backTransition);
		this.__backTransition = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__backTransition;
	}
	,clearStyle_backTransition: function() {
		this.set_backTransition(null);
		return this.get_backTransition();
	}
	,__replaceTransition: null
	,get_replaceTransition: function() {
		return this.__replaceTransition;
	}
	,set_replaceTransition: function(value) {
		if(!this.setStyle("replaceTransition")) {
			return this.__replaceTransition;
		}
		if(this.__replaceTransition == value) {
			return this.__replaceTransition;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_replaceTransition);
		this.__replaceTransition = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__replaceTransition;
	}
	,clearStyle_replaceTransition: function() {
		this.set_replaceTransition(null);
		return this.get_replaceTransition();
	}
	,__class__: feathers_controls_navigators_RouterNavigator
	,__properties__: $extend(feathers_controls_navigators_BaseNavigator.prototype.__properties__,{get_pathname:"get_pathname",get_location:"get_location",set_preferHashRouting:"set_preferHashRouting",get_preferHashRouting:"get_preferHashRouting",set_replaceTransition:"set_replaceTransition",get_replaceTransition:"get_replaceTransition",set_backTransition:"set_backTransition",get_backTransition:"get_backTransition",set_forwardTransition:"set_forwardTransition",get_forwardTransition:"get_forwardTransition"})
});
var feathers_controls_navigators_StackAction = $hxEnums["feathers.controls.navigators.StackAction"] = { __ename__:"feathers.controls.navigators.StackAction",__constructs__:null
	,Push: ($_=function(id,inject,transition) { return {_hx_index:0,id:id,inject:inject,transition:transition,__enum__:"feathers.controls.navigators.StackAction",toString:$estr}; },$_._hx_name="Push",$_.__params__ = ["id","inject","transition"],$_)
	,Replace: ($_=function(id,inject,transition) { return {_hx_index:1,id:id,inject:inject,transition:transition,__enum__:"feathers.controls.navigators.StackAction",toString:$estr}; },$_._hx_name="Replace",$_.__params__ = ["id","inject","transition"],$_)
	,Pop: ($_=function(returnedObject,transition) { return {_hx_index:2,returnedObject:returnedObject,transition:transition,__enum__:"feathers.controls.navigators.StackAction",toString:$estr}; },$_._hx_name="Pop",$_.__params__ = ["returnedObject","transition"],$_)
	,PopMultiple: ($_=function(count,returnedObject,transition) { return {_hx_index:3,count:count,returnedObject:returnedObject,transition:transition,__enum__:"feathers.controls.navigators.StackAction",toString:$estr}; },$_._hx_name="PopMultiple",$_.__params__ = ["count","returnedObject","transition"],$_)
	,PopToRoot: ($_=function(returnedObject,transition) { return {_hx_index:4,returnedObject:returnedObject,transition:transition,__enum__:"feathers.controls.navigators.StackAction",toString:$estr}; },$_._hx_name="PopToRoot",$_.__params__ = ["returnedObject","transition"],$_)
	,PopToRootAndReplace: ($_=function(id,inject,transition) { return {_hx_index:5,id:id,inject:inject,transition:transition,__enum__:"feathers.controls.navigators.StackAction",toString:$estr}; },$_._hx_name="PopToRootAndReplace",$_.__params__ = ["id","inject","transition"],$_)
	,Listener: ($_=function(callback) { return {_hx_index:6,callback:callback,__enum__:"feathers.controls.navigators.StackAction",toString:$estr}; },$_._hx_name="Listener",$_.__params__ = ["callback"],$_)
	,NewAction: ($_=function(callback) { return {_hx_index:7,callback:callback,__enum__:"feathers.controls.navigators.StackAction",toString:$estr}; },$_._hx_name="NewAction",$_.__params__ = ["callback"],$_)
};
feathers_controls_navigators_StackAction.__constructs__ = [feathers_controls_navigators_StackAction.Push,feathers_controls_navigators_StackAction.Replace,feathers_controls_navigators_StackAction.Pop,feathers_controls_navigators_StackAction.PopMultiple,feathers_controls_navigators_StackAction.PopToRoot,feathers_controls_navigators_StackAction.PopToRootAndReplace,feathers_controls_navigators_StackAction.Listener,feathers_controls_navigators_StackAction.NewAction];
var feathers_controls_navigators_StackItem = function() {
	this._viewToEvents = new haxe_ds_ObjectMap();
};
$hxClasses["feathers.controls.navigators.StackItem"] = feathers_controls_navigators_StackItem;
feathers_controls_navigators_StackItem.__name__ = "feathers.controls.navigators.StackItem";
feathers_controls_navigators_StackItem.withClass = function(id,viewClass,actions,returnHandlers,saveData,restoreData) {
	var item = new feathers_controls_navigators_StackItem();
	item.id = id;
	item.viewFactory = feathers_utils_AbstractDisplayObjectFactory.fromClass(viewClass);
	item.actions = actions;
	item.returnHandlers = returnHandlers;
	item.saveData = saveData;
	item.restoreData = restoreData;
	return item;
};
feathers_controls_navigators_StackItem.withFunction = function(id,viewFunction,actions,returnHandlers,saveData,restoreData) {
	var item = new feathers_controls_navigators_StackItem();
	item.id = id;
	item.viewFactory = feathers_utils_AbstractDisplayObjectFactory.fromFunction(viewFunction);
	item.actions = actions;
	item.returnHandlers = returnHandlers;
	item.saveData = saveData;
	item.restoreData = restoreData;
	return item;
};
feathers_controls_navigators_StackItem.withDisplayObject = function(id,viewInstance,actions,returnHandlers,saveData,restoreData) {
	var item = new feathers_controls_navigators_StackItem();
	item.id = id;
	item.viewFactory = feathers_utils_AbstractDisplayObjectFactory.fromDisplayObject(viewInstance);
	item.actions = actions;
	item.returnHandlers = returnHandlers;
	item.saveData = saveData;
	item.restoreData = restoreData;
	return item;
};
feathers_controls_navigators_StackItem.withFactory = function(id,viewFactory,actions,returnHandlers,saveData,restoreData) {
	var item = new feathers_controls_navigators_StackItem();
	item.id = id;
	item.viewFactory = viewFactory;
	item.actions = actions;
	item.returnHandlers = returnHandlers;
	item.saveData = saveData;
	item.restoreData = restoreData;
	return item;
};
feathers_controls_navigators_StackItem.prototype = {
	id: null
	,viewFactory: null
	,actions: null
	,returnHandlers: null
	,pushTransition: null
	,popTransition: null
	,_viewToEvents: null
	,setAction: function(eventType,action) {
		if(this.actions == null) {
			this.actions = new haxe_ds_StringMap();
		}
		if(action == null) {
			var _this = this.actions;
			if(Object.prototype.hasOwnProperty.call(_this.h,eventType)) {
				delete(_this.h[eventType]);
			}
		} else {
			this.actions.h[eventType] = action;
		}
	}
	,saveData: function(view) {
		return null;
	}
	,restoreData: function(view,data) {
	}
	,getView: function(navigator) {
		var view = this.viewFactory.create();
		var listeners = this.addActionListeners(view,navigator);
		this._viewToEvents.set(view,listeners);
		return view;
	}
	,returnView: function(view) {
		var viewListeners = this._viewToEvents.h[view.__id__];
		this.removeEventsFromView(view,viewListeners);
		this._viewToEvents.remove(view);
		if(this.viewFactory.destroy != null) {
			this.viewFactory.destroy(view);
		}
	}
	,addActionListeners: function(view,navigator) {
		var listeners = [];
		if(this.actions == null) {
			return listeners;
		}
		var h = this.actions.h;
		var eventType_h = h;
		var eventType_keys = Object.keys(h);
		var eventType_length = eventType_keys.length;
		var eventType_current = 0;
		while(eventType_current < eventType_length) {
			var eventType = eventType_keys[eventType_current++];
			var action = this.actions.h[eventType];
			var listener = this.createActionEventListener(action,navigator);
			view.addEventListener(eventType,listener);
			listeners.push(new feathers_controls_navigators__$StackItem_ViewListener(eventType,listener));
		}
		return listeners;
	}
	,performAction: function(action,event,navigator) {
		switch(action._hx_index) {
		case 0:
			var id = action.id;
			var inject = action.inject;
			var transition = action.transition;
			navigator.pushItem(id,inject,transition);
			break;
		case 1:
			var id = action.id;
			var inject = action.inject;
			var transition = action.transition;
			navigator.replaceItem(id,inject,transition);
			break;
		case 2:
			var returnedObject = action.returnedObject;
			var transition = action.transition;
			navigator.popItem(returnedObject,transition);
			break;
		case 3:
			var count = action.count;
			var returnedObject = action.returnedObject;
			var transition = action.transition;
			navigator.popMultipleItems(count,returnedObject,transition);
			break;
		case 4:
			var returnedObject = action.returnedObject;
			var transition = action.transition;
			navigator.popToRootItem(returnedObject,transition);
			break;
		case 5:
			var id = action.id;
			var inject = action.inject;
			var transition = action.transition;
			navigator.popToRootItemAndReplace(id,inject,transition);
			break;
		case 6:
			var fn = action.callback;
			fn(event);
			break;
		case 7:
			var fn = action.callback;
			return fn(event);
		}
		return null;
	}
	,createActionEventListener: function(action,navigator) {
		var _gthis = this;
		var eventListener = function(event) {
			if(navigator.get_transitionActive()) {
				return;
			}
			var current = action;
			while(current != null) current = _gthis.performAction(current,event,navigator);
		};
		return eventListener;
	}
	,removeEventsFromView: function(view,viewListeners) {
		var _g = 0;
		while(_g < viewListeners.length) {
			var viewListener = viewListeners[_g];
			++_g;
			view.removeEventListener(viewListener.eventType,viewListener.listener);
		}
	}
	,__class__: feathers_controls_navigators_StackItem
};
var feathers_controls_navigators__$StackItem_ViewListener = function(eventType,listener) {
	this.eventType = eventType;
	this.listener = listener;
};
$hxClasses["feathers.controls.navigators._StackItem.ViewListener"] = feathers_controls_navigators__$StackItem_ViewListener;
feathers_controls_navigators__$StackItem_ViewListener.__name__ = "feathers.controls.navigators._StackItem.ViewListener";
feathers_controls_navigators__$StackItem_ViewListener.prototype = {
	eventType: null
	,listener: null
	,__class__: feathers_controls_navigators__$StackItem_ViewListener
};
var feathers_controls_navigators_StackNavigator = function() {
	this.__replaceTransition = null;
	this.__popTransition = null;
	this.__pushTransition = null;
	this._poppedHistoryItems = null;
	this.savedIsPop = false;
	this._popSwipeActiveEdgeSize = 30.0;
	this._simulateTouch = false;
	this._popSwipeEnabled = false;
	this._history = [];
	this.initializeStackNavigatorTheme();
	feathers_controls_navigators_BaseNavigator.call(this);
	this.addEventListener("initialize",$bind(this,this.stackNavigator_initializeHandler));
	this.addEventListener("addedToStage",$bind(this,this.stackNavigator_addedToStageHandler));
	this.addEventListener("removedFromStage",$bind(this,this.stackNavigator_removedFromStageHandler));
};
$hxClasses["feathers.controls.navigators.StackNavigator"] = feathers_controls_navigators_StackNavigator;
feathers_controls_navigators_StackNavigator.__name__ = "feathers.controls.navigators.StackNavigator";
feathers_controls_navigators_StackNavigator.__super__ = feathers_controls_navigators_BaseNavigator;
feathers_controls_navigators_StackNavigator.prototype = $extend(feathers_controls_navigators_BaseNavigator.prototype,{
	_backEdgePuller: null
	,_dragTransitionContext: null
	,_history: null
	,_tempRootItemID: null
	,get_stackSize: function() {
		return this._history.length;
	}
	,get_rootItemID: function() {
		if(this._history.length > 0) {
			return this._history[0].id;
		}
		return this._tempRootItemID;
	}
	,set_rootItemID: function(value) {
		if(!this.get_initialized()) {
			this._tempRootItemID = value;
			return this._tempRootItemID;
		}
		this._tempRootItemID = null;
		this._history.length = 0;
		if(value == null) {
			this.clearActiveItemInternal(null);
			return null;
		}
		var historyItem = new feathers_controls_navigators__$StackNavigator_HistoryItem(value,null,null,null);
		this._history.push(historyItem);
		this.showItemWithInjectAndReturnedObject(value,null,null,null,null,false);
		return value;
	}
	,_popSwipeEnabled: null
	,get_popSwipeEnabled: function() {
		return this._popSwipeEnabled;
	}
	,set_popSwipeEnabled: function(value) {
		if(this._popSwipeEnabled == value) {
			return this._popSwipeEnabled;
		}
		this._popSwipeEnabled = value;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		return this._popSwipeEnabled;
	}
	,_simulateTouch: null
	,get_simulateTouch: function() {
		return this._simulateTouch;
	}
	,set_simulateTouch: function(value) {
		if(this._simulateTouch == value) {
			return this._simulateTouch;
		}
		this._simulateTouch = value;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		return this._simulateTouch;
	}
	,_popSwipeActiveEdgeSize: null
	,get_popSwipeActiveEdgeSize: function() {
		return this._popSwipeActiveEdgeSize;
	}
	,set_popSwipeActiveEdgeSize: function(value) {
		if(this._popSwipeActiveEdgeSize == value) {
			return this._popSwipeActiveEdgeSize;
		}
		this._popSwipeActiveEdgeSize = value;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		return this._popSwipeActiveEdgeSize;
	}
	,savedInject: null
	,savedReturnedObject: null
	,savedIsPop: null
	,savedRestoreData: null
	,savedViewData: null
	,_poppedHistoryItems: null
	,initializeStackNavigatorTheme: function() {
		feathers_themes_steel_components_SteelStackNavigatorStyles.initialize();
	}
	,addItem: function(item) {
		this.addItemInternal(item.id,item);
	}
	,removeItem: function(id) {
		var _g = 0;
		var _g1 = this._history;
		while(_g < _g1.length) {
			var item = _g1[_g];
			++_g;
			if(item.id == id) {
				HxOverrides.remove(this._history,item);
			}
		}
		var item = this.removeItemInternal(id);
		return js_Boot.__cast(item , feathers_controls_navigators_StackItem);
	}
	,removeAllItems: function() {
		this._history.length = 0;
		feathers_controls_navigators_BaseNavigator.prototype.removeAllItems.call(this);
	}
	,getItem: function(id) {
		var item = this._addedItems.h[id];
		if(item == null) {
			return null;
		}
		return js_Boot.__cast(item , feathers_controls_navigators_StackItem);
	}
	,pushItem: function(id,inject,transition) {
		if(transition == null) {
			var item = this.getItem(id);
			if(item != null && item.pushTransition != null) {
				transition = item.pushTransition;
			} else {
				transition = this.get_pushTransition();
			}
		}
		if(this._activeItemView != null) {
			var viewData = null;
			var oldItem = this._addedItems.h[this._activeItemID];
			if(oldItem.saveData != null) {
				viewData = oldItem.saveData(this._activeItemView);
			}
			var historyItem = this._history[this._history.length - 1];
			historyItem.viewData = viewData;
		}
		var historyItem = new feathers_controls_navigators__$StackNavigator_HistoryItem(id,inject,null,transition);
		this._history.push(historyItem);
		return this.showItemWithInjectAndReturnedObject(id,transition,inject,null,null,false);
	}
	,popItem: function(returnedObject,transition) {
		if(this._history.length <= 1) {
			return this.get_activeItemView();
		}
		if(transition == null) {
			var item = this.getItem(this.get_activeItemID());
			if(item != null && item.popTransition != null) {
				transition = item.popTransition;
			} else {
				transition = this.get_popTransition();
			}
		}
		this._poppedHistoryItems = [this._history.pop()];
		var item = this._history[this._history.length - 1];
		return this.showItemWithInjectAndReturnedObject(item.id,transition,item.inject,returnedObject,item.viewData,true);
	}
	,popMultipleItems: function(count,returnedObject,transition) {
		if(count <= 0) {
			throw new openfl_errors_RangeError("popMultipleItems() must be called with a value greater than zero");
		}
		if(transition == null) {
			var item = this.getItem(this.get_activeItemID());
			if(item != null && item.popTransition != null) {
				transition = item.popTransition;
			} else {
				transition = this.get_popTransition();
			}
		}
		var newHistoryLength = this._history.length - count;
		if(newHistoryLength < 1) {
			throw new openfl_errors_RangeError("popMultipleItems() called with value larger than available history. Received " + count + ". Expected less than " + this._history.length + ".");
		}
		this._poppedHistoryItems = this._history.slice(newHistoryLength);
		this._history.length = newHistoryLength;
		var item = this._history[this._history.length - 1];
		return this.showItemWithInjectAndReturnedObject(item.id,transition,item.inject,returnedObject,item.viewData,true);
	}
	,popToRootItem: function(returnedObject,transition) {
		if(this._history.length <= 1) {
			return this.get_activeItemView();
		}
		if(transition == null) {
			transition = this.get_popTransition();
		}
		this._poppedHistoryItems = this._history.slice(1);
		this._history.length = 1;
		var item = this._history[0];
		return this.showItemWithInjectAndReturnedObject(item.id,transition,item.inject,returnedObject,null,true);
	}
	,popAll: function(transition) {
		if(this._history.length == 0) {
			return;
		}
		if(transition == null) {
			transition = this.get_popTransition();
		}
		this._poppedHistoryItems = this._history.slice();
		this._history.length = 0;
		this.clearActiveItemInternal(transition);
	}
	,replaceItem: function(id,inject,transition) {
		if(transition == null) {
			transition = this.get_replaceTransition();
		}
		var historyItem = new feathers_controls_navigators__$StackNavigator_HistoryItem(id,inject,null,transition);
		this._history[this._history.length - 1] = historyItem;
		return this.showItemWithInjectAndReturnedObject(id,transition,inject,null,null,false);
	}
	,popToRootItemAndReplace: function(id,inject,transition) {
		if(transition == null) {
			transition = this.get_popTransition();
		}
		this._history.length = 1;
		this._history[0] = new feathers_controls_navigators__$StackNavigator_HistoryItem(id,inject,null,transition);
		return this.showItemWithInjectAndReturnedObject(id,transition,inject,null,null,false);
	}
	,initialize: function() {
		feathers_controls_navigators_BaseNavigator.prototype.initialize.call(this);
		if(this._backEdgePuller == null) {
			this._backEdgePuller = new feathers_utils_EdgePuller(this,feathers_layout_RelativePosition.LEFT);
			this._backEdgePuller.addEventListener("opening",$bind(this,this.stackNavigator_backEdgePuller_openingHandler));
			this._backEdgePuller.addEventListener("cancel",$bind(this,this.stackNavigator_backEdgePuller_cancelHandler));
			this._backEdgePuller.addEventListener("open",$bind(this,this.stackNavigator_backEdgePuller_openHandler));
		}
	}
	,update: function() {
		var dataInvalid = this.isInvalid(feathers_core_InvalidationFlag.DATA);
		var selectionInvalid = this.isInvalid(feathers_core_InvalidationFlag.SELECTION);
		if(dataInvalid || selectionInvalid) {
			var tmp = this._enabled && this._popSwipeEnabled && this.get_stackSize() > 1;
			this._backEdgePuller.enabled = tmp;
			this._backEdgePuller.set_activeBorderSize(this._popSwipeActiveEdgeSize);
			this._backEdgePuller.simulateTouch = this._simulateTouch;
		}
		feathers_controls_navigators_BaseNavigator.prototype.update.call(this);
	}
	,getView: function(id) {
		var item = js_Boot.__cast(this._addedItems.h[id] , feathers_controls_navigators_StackItem);
		var view = item.getView(this);
		if(this.savedInject != null) {
			this.savedInject(view);
		}
		if(item.restoreData != null) {
			item.restoreData(view,this.savedViewData);
		}
		if(this.savedIsPop) {
			var returnHandlers = item.returnHandlers;
			if(returnHandlers != null && Object.prototype.hasOwnProperty.call(returnHandlers.h,this._previousViewInTransitionID)) {
				returnHandlers.h[this._previousViewInTransitionID](view,this.savedReturnedObject);
			}
		}
		return view;
	}
	,disposeView: function(id,view) {
		var item = js_Boot.__cast(this._addedItems.h[id] , feathers_controls_navigators_StackItem);
		item.returnView(view);
	}
	,transitionComplete: function() {
		this._poppedHistoryItems = null;
	}
	,transitionCancel: function() {
		if(this._poppedHistoryItems != null) {
			var _g = 0;
			var _g1 = this._poppedHistoryItems;
			while(_g < _g1.length) {
				var item = _g1[_g];
				++_g;
				this._history.push(item);
			}
			this._poppedHistoryItems = null;
		}
	}
	,showItemWithInjectAndReturnedObject: function(id,transition,inject,returnedObject,viewData,isPop) {
		this.savedInject = inject;
		this.savedReturnedObject = returnedObject;
		this.savedViewData = viewData;
		this.savedIsPop = isPop;
		var result = this.showItemInternal(id,transition);
		this.savedInject = null;
		this.savedReturnedObject = null;
		this.savedIsPop = false;
		this.savedViewData = null;
		return result;
	}
	,startBackDragTransition: function(one,two) {
		var _gthis = this;
		var effectContext = (this.get_popTransition())(one,two);
		this._backEdgePuller.set_snapDuration(effectContext.get_duration());
		this._dragTransitionContext = new feathers_motion_effects_EventToPositionEffectContext(effectContext,this._backEdgePuller,"change",function(event) {
			return _gthis._dragTransitionContext.set_position(_gthis._backEdgePuller.get_pullDistance() / _gthis.actualWidth);
		});
		return this._dragTransitionContext;
	}
	,stackNavigator_initializeHandler: function(event) {
		if(this._tempRootItemID != null) {
			var id = this._tempRootItemID;
			this._tempRootItemID = null;
			var historyItem = new feathers_controls_navigators__$StackNavigator_HistoryItem(id,null,null,null);
			this._history.push(historyItem);
			this.showItemWithInjectAndReturnedObject(id,null,null,null,null,false);
		}
	}
	,stackNavigator_addedToStageHandler: function(event) {
		this.stage.addEventListener("keyUp",$bind(this,this.stackNavigator_stage_keyUpHandler),false,0,true);
	}
	,stackNavigator_removedFromStageHandler: function(event) {
		this.stage.removeEventListener("keyUp",$bind(this,this.stackNavigator_stage_keyUpHandler));
	}
	,stackNavigator_stage_backKeyUpHandler: function(event) {
		if(event.isDefaultPrevented()) {
			return;
		}
		if(this._history.length <= 1) {
			return;
		}
		event.preventDefault();
		this.popItem();
	}
	,stackNavigator_stage_keyUpHandler: function(event) {
		if(!this._enabled) {
			return;
		}
		if(event.keyCode == 1073742094) {
			this.stackNavigator_stage_backKeyUpHandler(event);
		}
	}
	,stackNavigator_backEdgePuller_openingHandler: function(event) {
		if(this.get_stackSize() <= 1) {
			event.preventDefault();
			return;
		}
		var touchPointID = this._backEdgePuller.get_touchPointID();
		if(touchPointID != null) {
			var exclusivePointer = feathers_utils_ExclusivePointer.forStage(this.stage);
			if(this._backEdgePuller.get_touchPointIsSimulated()) {
				var result = exclusivePointer.claimMouse(this);
				if(!result) {
					event.preventDefault();
					return;
				}
			} else {
				var result = exclusivePointer.claimTouch(touchPointID,this);
				if(!result) {
					event.preventDefault();
					return;
				}
			}
		}
		if(this.get_popTransition() != null) {
			this.popItem(null,$bind(this,this.startBackDragTransition));
		} else {
			event.preventDefault();
			this.popItem();
		}
	}
	,stackNavigator_backEdgePuller_cancelHandler: function(event) {
		var context = this._dragTransitionContext;
		this._dragTransitionContext = null;
		if(context != null) {
			context.set_dispatcher(null);
			feathers_events_FeathersEvent.dispatch(context,"cancel");
		}
		var tmp = this._enabled && this._popSwipeEnabled && this.get_stackSize() > 1;
		this._backEdgePuller.enabled = tmp;
	}
	,stackNavigator_backEdgePuller_openHandler: function(event) {
		var context = this._dragTransitionContext;
		this._dragTransitionContext = null;
		if(context != null) {
			context.set_dispatcher(null);
			feathers_events_FeathersEvent.dispatch(context,"complete");
		}
		var oldSnapDuration = this._backEdgePuller.get_snapDuration();
		this._backEdgePuller.set_snapDuration(0.0);
		this._backEdgePuller.set_opened(false);
		this._backEdgePuller.set_snapDuration(oldSnapDuration);
		var tmp = this._enabled && this._popSwipeEnabled && this.get_stackSize() > 1;
		this._backEdgePuller.enabled = tmp;
	}
	,get_styleContext: function() {
		return feathers_controls_navigators_StackNavigator;
	}
	,__pushTransition: null
	,get_pushTransition: function() {
		return this.__pushTransition;
	}
	,set_pushTransition: function(value) {
		if(!this.setStyle("pushTransition")) {
			return this.__pushTransition;
		}
		if(this.__pushTransition == value) {
			return this.__pushTransition;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_pushTransition);
		this.__pushTransition = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__pushTransition;
	}
	,clearStyle_pushTransition: function() {
		this.set_pushTransition(null);
		return this.get_pushTransition();
	}
	,__popTransition: null
	,get_popTransition: function() {
		return this.__popTransition;
	}
	,set_popTransition: function(value) {
		if(!this.setStyle("popTransition")) {
			return this.__popTransition;
		}
		if(this.__popTransition == value) {
			return this.__popTransition;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_popTransition);
		this.__popTransition = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__popTransition;
	}
	,clearStyle_popTransition: function() {
		this.set_popTransition(null);
		return this.get_popTransition();
	}
	,__replaceTransition: null
	,get_replaceTransition: function() {
		return this.__replaceTransition;
	}
	,set_replaceTransition: function(value) {
		if(!this.setStyle("replaceTransition")) {
			return this.__replaceTransition;
		}
		if(this.__replaceTransition == value) {
			return this.__replaceTransition;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_replaceTransition);
		this.__replaceTransition = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__replaceTransition;
	}
	,clearStyle_replaceTransition: function() {
		this.set_replaceTransition(null);
		return this.get_replaceTransition();
	}
	,__class__: feathers_controls_navigators_StackNavigator
	,__properties__: $extend(feathers_controls_navigators_BaseNavigator.prototype.__properties__,{set_popSwipeActiveEdgeSize:"set_popSwipeActiveEdgeSize",get_popSwipeActiveEdgeSize:"get_popSwipeActiveEdgeSize",set_simulateTouch:"set_simulateTouch",get_simulateTouch:"get_simulateTouch",set_popSwipeEnabled:"set_popSwipeEnabled",get_popSwipeEnabled:"get_popSwipeEnabled",set_rootItemID:"set_rootItemID",get_rootItemID:"get_rootItemID",get_stackSize:"get_stackSize",set_replaceTransition:"set_replaceTransition",get_replaceTransition:"get_replaceTransition",set_popTransition:"set_popTransition",get_popTransition:"get_popTransition",set_pushTransition:"set_pushTransition",get_pushTransition:"get_pushTransition"})
});
var feathers_controls_navigators__$StackNavigator_HistoryItem = function(id,inject,viewData,transition) {
	this.id = id;
	this.inject = inject;
	this.viewData = viewData;
	this.transition = transition;
};
$hxClasses["feathers.controls.navigators._StackNavigator.HistoryItem"] = feathers_controls_navigators__$StackNavigator_HistoryItem;
feathers_controls_navigators__$StackNavigator_HistoryItem.__name__ = "feathers.controls.navigators._StackNavigator.HistoryItem";
feathers_controls_navigators__$StackNavigator_HistoryItem.prototype = {
	id: null
	,inject: null
	,viewData: null
	,transition: null
	,__class__: feathers_controls_navigators__$StackNavigator_HistoryItem
};
var feathers_controls_navigators_TabItem = function() {
	this.internalID = Std.string(feathers_controls_navigators_TabItem.internalIDCounter);
	feathers_controls_navigators_TabItem.internalIDCounter++;
};
$hxClasses["feathers.controls.navigators.TabItem"] = feathers_controls_navigators_TabItem;
feathers_controls_navigators_TabItem.__name__ = "feathers.controls.navigators.TabItem";
feathers_controls_navigators_TabItem.withClass = function(text,viewClass) {
	var item = new feathers_controls_navigators_TabItem();
	item.text = text;
	item.viewFactory = feathers_utils_AbstractDisplayObjectFactory.fromClass(viewClass);
	return item;
};
feathers_controls_navigators_TabItem.withFunction = function(text,viewFunction) {
	var item = new feathers_controls_navigators_TabItem();
	item.text = text;
	item.viewFactory = feathers_utils_AbstractDisplayObjectFactory.fromFunction(viewFunction);
	return item;
};
feathers_controls_navigators_TabItem.withDisplayObject = function(text,viewInstance) {
	var item = new feathers_controls_navigators_TabItem();
	item.text = text;
	item.viewFactory = feathers_utils_AbstractDisplayObjectFactory.fromDisplayObject(viewInstance);
	return item;
};
feathers_controls_navigators_TabItem.withFactory = function(text,viewFactory) {
	var item = new feathers_controls_navigators_TabItem();
	item.text = text;
	item.viewFactory = viewFactory;
	return item;
};
feathers_controls_navigators_TabItem.prototype = {
	internalID: null
	,text: null
	,viewFactory: null
	,getView: function(navigator) {
		var view = this.viewFactory.create();
		return view;
	}
	,returnView: function(view) {
		if(this.viewFactory.destroy != null) {
			this.viewFactory.destroy(view);
		}
	}
	,__class__: feathers_controls_navigators_TabItem
};
var feathers_controls_navigators_TabNavigator = function(dataProvider) {
	this.__customTabBarVariant = null;
	this.__gap = 0.0;
	this.__nextTransition = null;
	this.__previousTransition = null;
	this.__tabBarPosition = feathers_layout_RelativePosition.BOTTOM;
	this._ignoreSelectionChange = false;
	this._previousCustomTabBarVariant = null;
	this._simulateTouch = false;
	this._swipeEnabled = false;
	this._selectedItem = null;
	this._selectedIndex = -1;
	this._activeItemIndex = -1;
	this.initializeTabNavigatorTheme();
	feathers_controls_navigators_BaseNavigator.call(this);
	this.set_dataProvider(dataProvider);
	this._viewsContainer = new feathers_controls_LayoutGroup();
	this.addChild(this._viewsContainer);
};
$hxClasses["feathers.controls.navigators.TabNavigator"] = feathers_controls_navigators_TabNavigator;
feathers_controls_navigators_TabNavigator.__name__ = "feathers.controls.navigators.TabNavigator";
feathers_controls_navigators_TabNavigator.__interfaces__ = [feathers_core_IDataSelector,feathers_core_IIndexSelector];
feathers_controls_navigators_TabNavigator.__super__ = feathers_controls_navigators_BaseNavigator;
feathers_controls_navigators_TabNavigator.prototype = $extend(feathers_controls_navigators_BaseNavigator.prototype,{
	tabBar: null
	,_previousEdgePuller: null
	,_nextEdgePuller: null
	,_dataProvider: null
	,get_dataProvider: function() {
		return this._dataProvider;
	}
	,set_dataProvider: function(value) {
		if(this._dataProvider == value) {
			return this._dataProvider;
		}
		if(this._dataProvider != null) {
			this._dataProvider.removeEventListener("addItem",$bind(this,this.tabNavigator_dataProvider_addItemHandler));
			this._dataProvider.removeEventListener("removeItem",$bind(this,this.tabNavigator_dataProvider_removeItemHandler));
			this._dataProvider.removeEventListener("replaceItem",$bind(this,this.tabNavigator_dataProvider_replaceItemHandler));
			this._dataProvider.removeEventListener("removeAll",$bind(this,this.tabNavigator_dataProvider_removeAllHandler));
			this._dataProvider.removeEventListener("reset",$bind(this,this.tabNavigator_dataProvider_resetHandler));
			if(value == null) {
				this.removeAllItems();
			} else {
				var item = this._dataProvider.iterator();
				while(item.hasNext()) {
					var item1 = item.next();
					this.removeItemInternal(item1.internalID);
				}
			}
		}
		this._dataProvider = value;
		if(this._dataProvider != null) {
			var item = this._dataProvider.iterator();
			while(item.hasNext()) {
				var item1 = item.next();
				this.addItemInternal(item1.internalID,item1);
			}
			this._dataProvider.addEventListener("addItem",$bind(this,this.tabNavigator_dataProvider_addItemHandler),false,0,true);
			this._dataProvider.addEventListener("removeItem",$bind(this,this.tabNavigator_dataProvider_removeItemHandler),false,0,true);
			this._dataProvider.addEventListener("replaceItem",$bind(this,this.tabNavigator_dataProvider_replaceItemHandler),false,0,true);
			this._dataProvider.addEventListener("removeAll",$bind(this,this.tabNavigator_dataProvider_removeAllHandler),false,0,true);
			this._dataProvider.addEventListener("reset",$bind(this,this.tabNavigator_dataProvider_resetHandler),false,0,true);
		}
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		if(this._dataProvider == null || this._dataProvider.get_length() == 0) {
			this.set_selectedIndex(-1);
		} else {
			this.set_selectedIndex(0);
		}
		feathers_events_FeathersEvent.dispatch(this,"dataChange");
		return this._dataProvider;
	}
	,_activeItemIndex: null
	,_selectedIndex: null
	,get_selectedIndex: function() {
		return this._selectedIndex;
	}
	,set_selectedIndex: function(value) {
		if(this._dataProvider == null) {
			value = -1;
		}
		if(this._selectedIndex == value) {
			return this._selectedIndex;
		}
		this._selectedIndex = value;
		if(this._selectedIndex == -1) {
			this._selectedItem = null;
		} else {
			this._selectedItem = this._dataProvider.get(this._selectedIndex);
		}
		this.setInvalid(feathers_core_InvalidationFlag.SELECTION);
		return this._selectedIndex;
	}
	,get_maxSelectedIndex: function() {
		if(this._dataProvider == null) {
			return -1;
		}
		return this._dataProvider.get_length() - 1;
	}
	,_selectedItem: null
	,get_selectedItem: function() {
		return this._selectedItem;
	}
	,set_selectedItem: function(value) {
		if(this._dataProvider == null) {
			this.set_selectedIndex(-1);
			return this._selectedItem;
		}
		this.set_selectedIndex(this._dataProvider.indexOf(value));
		return this._selectedItem;
	}
	,_swipeEnabled: null
	,get_swipeEnabled: function() {
		return this._swipeEnabled;
	}
	,set_swipeEnabled: function(value) {
		if(this._swipeEnabled == value) {
			return this._swipeEnabled;
		}
		this._swipeEnabled = value;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		return this._swipeEnabled;
	}
	,_simulateTouch: null
	,_dragTransitionContext: null
	,get_simulateTouch: function() {
		return this._simulateTouch;
	}
	,set_simulateTouch: function(value) {
		if(this._simulateTouch == value) {
			return this._simulateTouch;
		}
		this._simulateTouch = value;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		return this._simulateTouch;
	}
	,_previousCustomTabBarVariant: null
	,_oldTabBarFactory: null
	,_tabBarFactory: null
	,get_tabBarFactory: function() {
		return this._tabBarFactory;
	}
	,set_tabBarFactory: function(value) {
		if(this._tabBarFactory == value) {
			return this._tabBarFactory;
		}
		this._tabBarFactory = value;
		this.setInvalid(feathers_controls_navigators_TabNavigator.INVALIDATION_FLAG_TAB_BAR_FACTORY);
		return this._tabBarFactory;
	}
	,_ignoreSelectionChange: null
	,dispose: function() {
		this._pendingItemID = null;
		this._pendingItemTransition = null;
		this._transitionActive = false;
		if(this._activeTransition != null) {
			this._activeTransition.removeEventListener("complete",$bind(this,this.transition_completeHandler));
			this._activeTransition.removeEventListener("cancel",$bind(this,this.transition_cancelHandler));
			this._activeTransition.stop();
		}
		this.destroyTabBar();
		this._activeItemID = null;
		this._activeItemView = null;
		this.set_dataProvider(null);
		feathers_controls_navigators_BaseNavigator.prototype.dispose.call(this);
	}
	,initialize: function() {
		feathers_controls_navigators_BaseNavigator.prototype.initialize.call(this);
		if(this._previousEdgePuller == null) {
			this._previousEdgePuller = new feathers_utils_EdgePuller(this,feathers_layout_RelativePosition.LEFT);
			this._previousEdgePuller.addEventListener("opening",$bind(this,this.tabNavigator_previousEdgePuller_openingHandler));
			this._previousEdgePuller.addEventListener("cancel",$bind(this,this.tabNavigator_previousEdgePuller_cancelHandler));
			this._previousEdgePuller.addEventListener("open",$bind(this,this.tabNavigator_previousEdgePuller_openHandler));
		}
		if(this._nextEdgePuller == null) {
			this._nextEdgePuller = new feathers_utils_EdgePuller(this,feathers_layout_RelativePosition.RIGHT);
			this._nextEdgePuller.addEventListener("opening",$bind(this,this.tabNavigator_nextEdgePuller_openingHandler));
			this._nextEdgePuller.addEventListener("cancel",$bind(this,this.tabNavigator_nextEdgePuller_cancelHandler));
			this._nextEdgePuller.addEventListener("open",$bind(this,this.tabNavigator_nextEdgePuller_openHandler));
		}
	}
	,itemToText: function(item) {
		return item.text;
	}
	,initializeTabNavigatorTheme: function() {
		feathers_themes_steel_components_SteelTabNavigatorStyles.initialize();
	}
	,update: function() {
		var dataInvalid = this.isInvalid(feathers_core_InvalidationFlag.DATA);
		var selectionInvalid = this.isInvalid(feathers_core_InvalidationFlag.SELECTION);
		if(this._previousCustomTabBarVariant != this.get_customTabBarVariant()) {
			this.setInvalidationFlag(feathers_controls_navigators_TabNavigator.INVALIDATION_FLAG_TAB_BAR_FACTORY);
		}
		var tabBarInvalid = this.isInvalid(feathers_controls_navigators_TabNavigator.INVALIDATION_FLAG_TAB_BAR_FACTORY);
		if(tabBarInvalid) {
			this.createTabBar();
		}
		if(dataInvalid || tabBarInvalid) {
			this.tabBar.itemToText = $bind(this,this.itemToText);
			var oldIgnoreSelectionChange = this._ignoreSelectionChange;
			this._ignoreSelectionChange = true;
			this.tabBar.set_dataProvider(this._dataProvider);
			this._ignoreSelectionChange = oldIgnoreSelectionChange;
		}
		if(dataInvalid) {
			this._previousEdgePuller.simulateTouch = this._simulateTouch;
			this._nextEdgePuller.simulateTouch = this._simulateTouch;
		}
		if(dataInvalid || selectionInvalid || tabBarInvalid) {
			this.refreshSelection();
		}
		feathers_controls_navigators_BaseNavigator.prototype.update.call(this);
		this._previousCustomTabBarVariant = this.get_customTabBarVariant();
	}
	,measure: function() {
		if(this.get_explicitWidth() != null) {
			this.tabBar.set_width(this.get_explicitWidth());
		} else if(this._autoSizeMode == feathers_layout_AutoSizeMode.STAGE && this.stage != null) {
			this.tabBar.set_width(this.stage.stageWidth);
		} else {
			this.tabBar.resetWidth();
		}
		this.tabBar.validateNow();
		this.chromeMeasuredWidth = Math.max(this.chromeMeasuredWidth,this.tabBar.get_width());
		switch(this.get_tabBarPosition()._hx_index) {
		case 0:
			this.topContentOffset += this.tabBar.get_height() + this.get_gap();
			break;
		case 2:
			this.bottomContentOffset += this.tabBar.get_height() + this.get_gap();
			break;
		default:
			throw new openfl_errors_ArgumentError("Invalid tabBarPosition " + Std.string(this.get_tabBarPosition()));
		}
		return feathers_controls_navigators_BaseNavigator.prototype.measure.call(this);
	}
	,createTabBar: function() {
		this.destroyTabBar();
		var factory = this._tabBarFactory != null ? this._tabBarFactory : feathers_controls_navigators_TabNavigator.defaultTabBarFactory;
		this._oldTabBarFactory = factory;
		this.tabBar = factory.create();
		if(this.tabBar.get_variant() == null) {
			this.tabBar.set_variant(this.get_customTabBarVariant() != null ? this.get_customTabBarVariant() : feathers_controls_navigators_TabNavigator.CHILD_VARIANT_TAB_BAR);
		}
		this.tabBar.addEventListener("itemTrigger",$bind(this,this.tabNavigator_tabBar_itemTriggerHandler));
		this.tabBar.addEventListener("change",$bind(this,this.tabNavigator_tabBar_changeHandler));
		this.addChild(this.tabBar);
	}
	,destroyTabBar: function() {
		if(this.tabBar == null) {
			return;
		}
		this.tabBar.removeEventListener("itemTrigger",$bind(this,this.tabNavigator_tabBar_itemTriggerHandler));
		this.tabBar.removeEventListener("change",$bind(this,this.tabNavigator_tabBar_changeHandler));
		this.removeChild(this.tabBar);
		if(this._oldTabBarFactory.destroy != null) {
			this._oldTabBarFactory.destroy(this.tabBar);
		}
		this._oldTabBarFactory = null;
		this.tabBar = null;
	}
	,layoutContent: function() {
		this.tabBar.set_x(0.0);
		this.tabBar.set_width(this.actualWidth);
		this.tabBar.validateNow();
		switch(this.get_tabBarPosition()._hx_index) {
		case 0:
			this.tabBar.set_y(0.0);
			break;
		case 2:
			this.tabBar.set_y(this.actualHeight - this.tabBar.get_height());
			break;
		default:
			throw new openfl_errors_ArgumentError("Invalid tabBarPosition " + Std.string(this.get_tabBarPosition()));
		}
		feathers_controls_navigators_BaseNavigator.prototype.layoutContent.call(this);
	}
	,getView: function(id) {
		var item = js_Boot.__cast(this._addedItems.h[id] , feathers_controls_navigators_TabItem);
		return item.getView(this);
	}
	,disposeView: function(id,view) {
		var item = js_Boot.__cast(this._addedItems.h[id] , feathers_controls_navigators_TabItem);
		item.returnView(view);
	}
	,refreshSelection: function() {
		var _gthis = this;
		var oldIgnoreSelectionChange = this._ignoreSelectionChange;
		this._ignoreSelectionChange = true;
		this.tabBar.set_selectedIndex(this._selectedIndex);
		this._ignoreSelectionChange = oldIgnoreSelectionChange;
		if(this._selectedItem == null) {
			this._activeItemIndex = -1;
			if(this.get_activeItemID() != null) {
				this.clearActiveItemInternal();
			}
		} else if(this._selectedItem != null) {
			var oldIndex = this._activeItemIndex;
			this._activeItemIndex = this._selectedIndex;
			if(!this._previousEdgePuller.get_active() && !this._nextEdgePuller.get_active()) {
				var activeID = this._transitionActive ? this._nextViewInTransitionID : this._activeItemID;
				if(activeID != this._selectedItem.internalID) {
					var transition = null;
					if(oldIndex != -1 && oldIndex != this._selectedIndex) {
						transition = oldIndex < this._selectedIndex ? this.get_nextTransition() : this.get_previousTransition();
					}
					this.runWithInvalidationFlagsOnly(function() {
						_gthis.showItemInternal(_gthis._selectedItem.internalID,transition);
					});
				}
			}
		}
		var tmp = this._enabled && this._swipeEnabled && this._selectedIndex > 0 && !this._nextEdgePuller.get_active();
		this._previousEdgePuller.enabled = tmp;
		var tmp = this._enabled && this._swipeEnabled && this._selectedIndex < this.get_maxSelectedIndex() && !this._previousEdgePuller.get_active();
		this._nextEdgePuller.enabled = tmp;
	}
	,startPreviousDragTransition: function(one,two) {
		var _gthis = this;
		var effectContext = (this.get_previousTransition())(one,two);
		this._previousEdgePuller.set_snapDuration(effectContext.get_duration());
		this._dragTransitionContext = new feathers_motion_effects_EventToPositionEffectContext(effectContext,this._previousEdgePuller,"change",function(event) {
			return _gthis._dragTransitionContext.set_position(_gthis._previousEdgePuller.get_pullDistance() / _gthis.actualWidth);
		});
		return this._dragTransitionContext;
	}
	,startNextDragTransition: function(one,two) {
		var _gthis = this;
		var effectContext = (this.get_nextTransition())(one,two);
		this._nextEdgePuller.set_snapDuration(effectContext.get_duration());
		this._dragTransitionContext = new feathers_motion_effects_EventToPositionEffectContext(effectContext,this._nextEdgePuller,"change",function(event) {
			return _gthis._dragTransitionContext.set_position(_gthis._nextEdgePuller.get_pullDistance() / _gthis.actualWidth);
		});
		return this._dragTransitionContext;
	}
	,tabNavigator_tabBar_changeHandler: function(event) {
		if(this._ignoreSelectionChange) {
			return;
		}
		this.set_selectedIndex(this.tabBar.get_selectedIndex());
	}
	,tabNavigator_tabBar_itemTriggerHandler: function(event) {
		this.dispatchEvent(event);
	}
	,tabNavigator_dataProvider_addItemHandler: function(event) {
		var item = js_Boot.__cast(event.addedItem , feathers_controls_navigators_TabItem);
		this.addItemInternal(item.internalID,item);
		if(this._selectedIndex >= event.index) {
			this.set_selectedIndex(this.get_selectedIndex() + 1);
		} else if(this._selectedIndex == -1) {
			this.set_selectedIndex(0);
		}
	}
	,tabNavigator_dataProvider_removeItemHandler: function(event) {
		var item = js_Boot.__cast(event.removedItem , feathers_controls_navigators_TabItem);
		this.removeItemInternal(item.internalID);
		if(this._dataProvider.get_length() == 0) {
			this.set_selectedIndex(-1);
		} else if(this._selectedIndex >= event.index) {
			this.set_selectedIndex(this.get_selectedIndex() - 1);
		}
	}
	,tabNavigator_dataProvider_replaceItemHandler: function(event) {
		var addedItem = js_Boot.__cast(event.addedItem , feathers_controls_navigators_TabItem);
		var removedItem = js_Boot.__cast(event.removedItem , feathers_controls_navigators_TabItem);
		this.removeItemInternal(removedItem.internalID);
		this.addItemInternal(addedItem.internalID,addedItem);
		if(this._selectedIndex == event.index) {
			this.set_selectedItem(this._dataProvider.get(this._selectedIndex));
		}
	}
	,tabNavigator_dataProvider_removeAllHandler: function(event) {
		this.set_selectedIndex(-1);
		var h = this._addedItems.h;
		var id_h = h;
		var id_keys = Object.keys(h);
		var id_length = id_keys.length;
		var id_current = 0;
		while(id_current < id_length) {
			var id = id_keys[id_current++];
			var item = this._addedItems.h[id];
			this.removeItemInternal(item.internalID);
		}
	}
	,tabNavigator_dataProvider_resetHandler: function(event) {
		this.set_selectedIndex(-1);
		var h = this._addedItems.h;
		var id_h = h;
		var id_keys = Object.keys(h);
		var id_length = id_keys.length;
		var id_current = 0;
		while(id_current < id_length) {
			var id = id_keys[id_current++];
			var item = this._addedItems.h[id];
			this.removeItemInternal(item.internalID);
		}
	}
	,tabNavigator_previousEdgePuller_openingHandler: function(event) {
		var newIndex = this._selectedIndex - 1;
		if(newIndex < 0) {
			event.preventDefault();
			return;
		}
		var touchPointID = this._previousEdgePuller.get_touchPointID();
		if(touchPointID != null) {
			var exclusivePointer = feathers_utils_ExclusivePointer.forStage(this.stage);
			if(this._previousEdgePuller.get_touchPointIsSimulated()) {
				var result = exclusivePointer.claimMouse(this);
				if(!result) {
					event.preventDefault();
					return;
				}
			} else {
				var result = exclusivePointer.claimTouch(touchPointID,this);
				if(!result) {
					event.preventDefault();
					return;
				}
			}
		}
		if(this.get_previousTransition() != null) {
			this._nextEdgePuller.enabled = false;
			var item = this._dataProvider.get(newIndex);
			this.showItemInternal(item.internalID,$bind(this,this.startPreviousDragTransition));
		} else {
			event.preventDefault();
			this.set_selectedIndex(newIndex);
		}
	}
	,tabNavigator_previousEdgePuller_cancelHandler: function(event) {
		this._previousEdgePuller.enabled = this._enabled && this._swipeEnabled && this._selectedIndex > 0;
		var tmp = this._enabled && this._swipeEnabled && this._selectedIndex < this.get_maxSelectedIndex();
		this._nextEdgePuller.enabled = tmp;
		var context = this._dragTransitionContext;
		this._dragTransitionContext = null;
		if(context != null) {
			context.set_dispatcher(null);
			feathers_events_FeathersEvent.dispatch(context,"cancel");
		}
	}
	,tabNavigator_previousEdgePuller_openHandler: function(event) {
		var oldSnapDuration = this._previousEdgePuller.get_snapDuration();
		this._previousEdgePuller.set_snapDuration(0.0);
		this._previousEdgePuller.set_opened(false);
		this._previousEdgePuller.set_snapDuration(oldSnapDuration);
		this.set_selectedIndex(this.get_selectedIndex() - 1);
		this._previousEdgePuller.enabled = this._enabled && this._swipeEnabled && this._selectedIndex > 0;
		var tmp = this._enabled && this._swipeEnabled && this._selectedIndex < this.get_maxSelectedIndex();
		this._nextEdgePuller.enabled = tmp;
		var context = this._dragTransitionContext;
		this._dragTransitionContext = null;
		if(context != null) {
			context.set_dispatcher(null);
			feathers_events_FeathersEvent.dispatch(context,"complete");
		}
	}
	,tabNavigator_nextEdgePuller_openingHandler: function(event) {
		var newIndex = this._selectedIndex + 1;
		if(newIndex > this.get_maxSelectedIndex()) {
			event.preventDefault();
			return;
		}
		var touchPointID = this._nextEdgePuller.get_touchPointID();
		if(touchPointID != null) {
			var exclusivePointer = feathers_utils_ExclusivePointer.forStage(this.stage);
			if(this._nextEdgePuller.get_touchPointIsSimulated()) {
				var result = exclusivePointer.claimMouse(this);
				if(!result) {
					event.preventDefault();
					return;
				}
			} else {
				var result = exclusivePointer.claimTouch(touchPointID,this);
				if(!result) {
					event.preventDefault();
					return;
				}
			}
		}
		if(this.get_nextTransition() != null) {
			this._previousEdgePuller.enabled = false;
			var item = this._dataProvider.get(newIndex);
			this.showItemInternal(item.internalID,$bind(this,this.startNextDragTransition));
		} else {
			event.preventDefault();
			this.set_selectedIndex(newIndex);
		}
	}
	,tabNavigator_nextEdgePuller_cancelHandler: function(event) {
		this._previousEdgePuller.enabled = this._enabled && this._swipeEnabled && this._selectedIndex > 0;
		var tmp = this._enabled && this._swipeEnabled && this._selectedIndex < this.get_maxSelectedIndex();
		this._nextEdgePuller.enabled = tmp;
		var context = this._dragTransitionContext;
		this._dragTransitionContext = null;
		if(context != null) {
			context.set_dispatcher(null);
			feathers_events_FeathersEvent.dispatch(context,"cancel");
		}
	}
	,tabNavigator_nextEdgePuller_openHandler: function(event) {
		var oldSnapDuration = this._nextEdgePuller.get_snapDuration();
		this._nextEdgePuller.set_snapDuration(0.0);
		this._nextEdgePuller.set_opened(false);
		this._nextEdgePuller.set_snapDuration(oldSnapDuration);
		this.set_selectedIndex(this.get_selectedIndex() + 1);
		this._previousEdgePuller.enabled = this._enabled && this._swipeEnabled && this._selectedIndex > 0;
		var tmp = this._enabled && this._swipeEnabled && this._selectedIndex < this.get_maxSelectedIndex();
		this._nextEdgePuller.enabled = tmp;
		var context = this._dragTransitionContext;
		this._dragTransitionContext = null;
		if(context != null) {
			context.set_dispatcher(null);
			feathers_events_FeathersEvent.dispatch(context,"complete");
		}
	}
	,get_styleContext: function() {
		return feathers_controls_navigators_TabNavigator;
	}
	,__tabBarPosition: null
	,get_tabBarPosition: function() {
		return this.__tabBarPosition;
	}
	,set_tabBarPosition: function(value) {
		if(!this.setStyle("tabBarPosition")) {
			return this.__tabBarPosition;
		}
		if(this.__tabBarPosition == value) {
			return this.__tabBarPosition;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_tabBarPosition);
		this.__tabBarPosition = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__tabBarPosition;
	}
	,clearStyle_tabBarPosition: function() {
		this.set_tabBarPosition(feathers_layout_RelativePosition.BOTTOM);
		return this.get_tabBarPosition();
	}
	,__previousTransition: null
	,get_previousTransition: function() {
		return this.__previousTransition;
	}
	,set_previousTransition: function(value) {
		if(!this.setStyle("previousTransition")) {
			return this.__previousTransition;
		}
		if(this.__previousTransition == value) {
			return this.__previousTransition;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_previousTransition);
		this.__previousTransition = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__previousTransition;
	}
	,clearStyle_previousTransition: function() {
		this.set_previousTransition(null);
		return this.get_previousTransition();
	}
	,__nextTransition: null
	,get_nextTransition: function() {
		return this.__nextTransition;
	}
	,set_nextTransition: function(value) {
		if(!this.setStyle("nextTransition")) {
			return this.__nextTransition;
		}
		if(this.__nextTransition == value) {
			return this.__nextTransition;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_nextTransition);
		this.__nextTransition = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__nextTransition;
	}
	,clearStyle_nextTransition: function() {
		this.set_nextTransition(null);
		return this.get_nextTransition();
	}
	,__gap: null
	,get_gap: function() {
		return this.__gap;
	}
	,set_gap: function(value) {
		if(!this.setStyle("gap")) {
			return this.__gap;
		}
		if(this.__gap == value) {
			return this.__gap;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_gap);
		this.__gap = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__gap;
	}
	,clearStyle_gap: function() {
		this.set_gap(0.0);
		return this.get_gap();
	}
	,__customTabBarVariant: null
	,get_customTabBarVariant: function() {
		return this.__customTabBarVariant;
	}
	,set_customTabBarVariant: function(value) {
		if(!this.setStyle("customTabBarVariant")) {
			return this.__customTabBarVariant;
		}
		if(this.__customTabBarVariant == value) {
			return this.__customTabBarVariant;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_customTabBarVariant);
		this.__customTabBarVariant = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__customTabBarVariant;
	}
	,clearStyle_customTabBarVariant: function() {
		this.set_customTabBarVariant(null);
		return this.get_customTabBarVariant();
	}
	,__class__: feathers_controls_navigators_TabNavigator
	,__properties__: $extend(feathers_controls_navigators_BaseNavigator.prototype.__properties__,{set_tabBarFactory:"set_tabBarFactory",get_tabBarFactory:"get_tabBarFactory",set_customTabBarVariant:"set_customTabBarVariant",get_customTabBarVariant:"get_customTabBarVariant",set_gap:"set_gap",get_gap:"get_gap",set_nextTransition:"set_nextTransition",get_nextTransition:"get_nextTransition",set_previousTransition:"set_previousTransition",get_previousTransition:"get_previousTransition",set_simulateTouch:"set_simulateTouch",get_simulateTouch:"get_simulateTouch",set_swipeEnabled:"set_swipeEnabled",get_swipeEnabled:"get_swipeEnabled",set_tabBarPosition:"set_tabBarPosition",get_tabBarPosition:"get_tabBarPosition",set_selectedItem:"set_selectedItem",get_selectedItem:"get_selectedItem",get_maxSelectedIndex:"get_maxSelectedIndex",set_selectedIndex:"set_selectedIndex",get_selectedIndex:"get_selectedIndex",set_dataProvider:"set_dataProvider",get_dataProvider:"get_dataProvider"})
});
var feathers_controls_popups_IPopUpAdapter = function() { };
$hxClasses["feathers.controls.popups.IPopUpAdapter"] = feathers_controls_popups_IPopUpAdapter;
feathers_controls_popups_IPopUpAdapter.__name__ = "feathers.controls.popups.IPopUpAdapter";
feathers_controls_popups_IPopUpAdapter.__isInterface__ = true;
feathers_controls_popups_IPopUpAdapter.__interfaces__ = [openfl_events_IEventDispatcher];
feathers_controls_popups_IPopUpAdapter.prototype = {
	get_active: null
	,get_persistent: null
	,open: null
	,close: null
	,__class__: feathers_controls_popups_IPopUpAdapter
	,__properties__: {get_persistent:"get_persistent",get_active:"get_active"}
};
var feathers_controls_popups_DropDownPopUpAdapter = function() {
	this._ignoreOriginResizing = false;
	this._ignoreContentResizing = false;
	this._contentMeasurements = new feathers_layout_Measurements();
	this.closeOnPointerActiveOutside = false;
	this._fitContentToOriginWidth = true;
	this.modal = false;
	this._gap = 0.0;
	this.origin = null;
	this.content = null;
	openfl_events_EventDispatcher.call(this);
};
$hxClasses["feathers.controls.popups.DropDownPopUpAdapter"] = feathers_controls_popups_DropDownPopUpAdapter;
feathers_controls_popups_DropDownPopUpAdapter.__name__ = "feathers.controls.popups.DropDownPopUpAdapter";
feathers_controls_popups_DropDownPopUpAdapter.__interfaces__ = [feathers_controls_popups_IPopUpAdapter];
feathers_controls_popups_DropDownPopUpAdapter.__super__ = openfl_events_EventDispatcher;
feathers_controls_popups_DropDownPopUpAdapter.prototype = $extend(openfl_events_EventDispatcher.prototype,{
	content: null
	,origin: null
	,get_active: function() {
		return this.content != null;
	}
	,_gap: null
	,get_gap: function() {
		return this._gap;
	}
	,set_gap: function(value) {
		if(this._gap == value) {
			return this._gap;
		}
		this._gap = value;
		if(this.get_active()) {
			this.layout();
		}
		return this._gap;
	}
	,modal: null
	,_fitContentToOriginWidth: null
	,get_fitContentToOriginWidth: function() {
		return this._fitContentToOriginWidth;
	}
	,set_fitContentToOriginWidth: function(value) {
		if(this._fitContentToOriginWidth == value) {
			return this._fitContentToOriginWidth;
		}
		this._fitContentToOriginWidth = value;
		if(this.get_active()) {
			this.layout();
		}
		return this._fitContentToOriginWidth;
	}
	,get_persistent: function() {
		return false;
	}
	,closeOnPointerActiveOutside: null
	,_stage: null
	,_prevOriginX: null
	,_prevOriginY: null
	,_contentMeasurements: null
	,_ignoreContentResizing: null
	,_ignoreOriginResizing: null
	,open: function(content,origin) {
		if(this.get_active()) {
			throw new openfl_errors_IllegalOperationError("Pop-up adapter is already open. Close the previous content before opening new content.");
		}
		if(origin.stage == null) {
			throw new openfl_errors_IllegalOperationError("Pop-up adapter failed to open because the origin is not added to the stage.");
		}
		this._stage = origin.stage;
		this._stage.addEventListener("mouseDown",$bind(this,this.dropDownPopUpAdapter_stage_mouseDownHandler),false,0,true);
		this._stage.addEventListener("touchBegin",$bind(this,this.dropDownPopUpAdapter_stage_touchBeginHandler),false,0,true);
		this._stage.addEventListener("resize",$bind(this,this.dropDownPopUpAdapter_stage_resizeHandler),false,0,true);
		this.content = content;
		this.content.addEventListener("enterFrame",$bind(this,this.dropDownPopUpAdapter_content_enterFrameHandler),false,0,true);
		this.content.addEventListener("resize",$bind(this,this.dropDownPopUpAdapter_content_resizeHandler),false,0,true);
		this.content.addEventListener("removedFromStage",$bind(this,this.dropDownPopUpAdapter_content_removedFromStageHandler),false,0,true);
		this.origin = origin;
		this.origin.addEventListener("resize",$bind(this,this.dropDownPopUpAdapter_origin_resizeHandler),false,0,true);
		this.origin.addEventListener("removedFromStage",$bind(this,this.dropDownPopUpAdapter_origin_removedFromStageHandler),false,0,true);
		feathers_core_PopUpManager.addPopUp(this.content,this.origin,this.modal,false);
		if(!this.get_active()) {
			return;
		}
		if(js_Boot.__implements(this.content,feathers_core_IValidating)) {
			var oldIgnoreContentResizing = this._ignoreContentResizing;
			this._ignoreContentResizing = true;
			this.content.validateNow();
			this._ignoreContentResizing = oldIgnoreContentResizing;
		}
		this._contentMeasurements.save(this.content);
		this.layout();
		feathers_events_FeathersEvent.dispatch(this,"open");
	}
	,close: function() {
		if(!this.get_active()) {
			return;
		}
		this._stage.removeEventListener("resize",$bind(this,this.dropDownPopUpAdapter_stage_resizeHandler));
		this._stage.removeEventListener("mouseDown",$bind(this,this.dropDownPopUpAdapter_stage_mouseDownHandler));
		this._stage.addEventListener("touchBegin",$bind(this,this.dropDownPopUpAdapter_stage_touchBeginHandler));
		this.content.removeEventListener("enterFrame",$bind(this,this.dropDownPopUpAdapter_content_enterFrameHandler));
		this.content.removeEventListener("resize",$bind(this,this.dropDownPopUpAdapter_content_resizeHandler));
		this.content.removeEventListener("removedFromStage",$bind(this,this.dropDownPopUpAdapter_content_removedFromStageHandler));
		this.origin.removeEventListener("resize",$bind(this,this.dropDownPopUpAdapter_origin_resizeHandler));
		this.origin.removeEventListener("removedFromStage",$bind(this,this.dropDownPopUpAdapter_origin_removedFromStageHandler));
		var content = this.content;
		this.origin = null;
		this.content = null;
		this._stage = null;
		if(content.parent != null) {
			content.parent.removeChild(content);
		}
		this._contentMeasurements.restore(content);
		feathers_events_FeathersEvent.dispatch(this,"close");
	}
	,layout: function() {
		if(js_Boot.__implements(this.origin,feathers_core_IValidating)) {
			var oldIgnoreOriginResizing = this._ignoreOriginResizing;
			this._ignoreOriginResizing = true;
			this.origin.validateNow();
			this._ignoreOriginResizing = oldIgnoreOriginResizing;
		}
		var popUpRoot = feathers_core_PopUpManager.forStage(this._stage).get_root();
		var originTopLeft = new openfl_geom_Point(this.origin.get_x(),this.origin.get_y());
		originTopLeft = this.origin.parent.localToGlobal(originTopLeft);
		originTopLeft = popUpRoot.globalToLocal(originTopLeft);
		var originBottomRight = new openfl_geom_Point(this.origin.get_x() + this.origin.get_width(),this.origin.get_y() + this.origin.get_height());
		originBottomRight = this.origin.parent.localToGlobal(originBottomRight);
		originBottomRight = popUpRoot.globalToLocal(originBottomRight);
		this._prevOriginX = originTopLeft.x;
		this._prevOriginY = originTopLeft.y;
		var originWidth = Math.max(0.0,originBottomRight.x - originTopLeft.x);
		var hasSetMinWidth = false;
		if(this._fitContentToOriginWidth && js_Boot.__implements(this.content,feathers_core_IMeasureObject)) {
			var measureContent = this.content;
			if(measureContent.get_minWidth() < originWidth) {
				measureContent.set_minWidth(originWidth);
				hasSetMinWidth = true;
			}
		}
		var oldIgnoreContentResizing = this._ignoreContentResizing;
		this._ignoreContentResizing = true;
		if(js_Boot.__implements(this.content,feathers_core_IValidating)) {
			this.content.validateNow();
		}
		if(this._fitContentToOriginWidth && !hasSetMinWidth && this.content.get_width() < originWidth) {
			this.content.set_width(originWidth);
		}
		this._ignoreContentResizing = oldIgnoreContentResizing;
		var stageTopLeft = popUpRoot.globalToLocal(new openfl_geom_Point());
		var stageBottomRight = popUpRoot.globalToLocal(new openfl_geom_Point(this._stage.stageWidth,this._stage.stageHeight));
		var contentX = originTopLeft.x;
		if(contentX < stageTopLeft.x) {
			contentX = stageTopLeft.x;
		} else if(contentX + this.content.get_width() > stageBottomRight.x) {
			contentX = Math.max(stageTopLeft.x,stageBottomRight.x - this.content.get_width());
		}
		this.content.set_x(contentX);
		var contentY = originBottomRight.y + this._gap;
		if(contentY + this.content.get_height() > stageBottomRight.y) {
			contentY = Math.max(stageTopLeft.y,originTopLeft.y - this._gap - this.content.get_height());
		}
		this.content.set_y(contentY);
	}
	,dropDownPopUpAdapter_origin_removedFromStageHandler: function(event) {
		if(!this.get_active()) {
			return;
		}
		this.close();
	}
	,dropDownPopUpAdapter_content_removedFromStageHandler: function(event) {
		if(!this.get_active()) {
			return;
		}
		this.close();
	}
	,dropDownPopUpAdapter_stage_resizeHandler: function(event) {
		if(!this.get_active()) {
			return;
		}
		var stage = js_Boot.__cast(event.currentTarget , openfl_display_Stage);
		feathers_core_ValidationQueue.forStage(stage).validateNow();
		this.layout();
	}
	,dropDownPopUpAdapter_content_resizeHandler: function(event) {
		if(!this.get_active() || this._ignoreContentResizing) {
			return;
		}
		this.layout();
	}
	,dropDownPopUpAdapter_origin_resizeHandler: function(event) {
		if(!this.get_active() || this._ignoreOriginResizing) {
			return;
		}
		this.layout();
	}
	,dropDownPopUpAdapter_content_enterFrameHandler: function(event) {
		if(!this.get_active()) {
			return;
		}
		var popUpRoot = feathers_core_PopUpManager.forStage(this._stage).get_root();
		var originTopLeft = new openfl_geom_Point(this.origin.get_x(),this.origin.get_y());
		originTopLeft = this.origin.parent.localToGlobal(originTopLeft);
		originTopLeft = popUpRoot.globalToLocal(originTopLeft);
		if(originTopLeft.x != this._prevOriginX || originTopLeft.y != this._prevOriginY) {
			this.layout();
		}
	}
	,dropDownPopUpAdapter_stage_mouseDownHandler: function(event) {
		if(!this.closeOnPointerActiveOutside) {
			return;
		}
		var mouseTarget = js_Boot.__cast(event.target , openfl_display_DisplayObject);
		if(((this.content) instanceof openfl_display_DisplayObjectContainer)) {
			var container = this.content;
			if(container.contains(mouseTarget)) {
				return;
			}
		} else if(this.content == mouseTarget) {
			return;
		}
		if(((this.origin) instanceof openfl_display_DisplayObjectContainer)) {
			var container = this.origin;
			if(container.contains(mouseTarget)) {
				return;
			}
		} else if(this.origin == mouseTarget) {
			return;
		}
		this.close();
	}
	,dropDownPopUpAdapter_stage_touchBeginHandler: function(event) {
		if(!this.closeOnPointerActiveOutside) {
			return;
		}
		if(event.isPrimaryTouchPoint) {
			return;
		}
		var mouseTarget = js_Boot.__cast(event.target , openfl_display_DisplayObject);
		if(((this.content) instanceof openfl_display_DisplayObjectContainer)) {
			var container = this.content;
			if(container.contains(mouseTarget)) {
				return;
			}
		} else if(this.content == mouseTarget) {
			return;
		}
		if(((this.origin) instanceof openfl_display_DisplayObjectContainer)) {
			var container = this.origin;
			if(container.contains(mouseTarget)) {
				return;
			}
		} else if(this.origin == mouseTarget) {
			return;
		}
		this.close();
	}
	,__class__: feathers_controls_popups_DropDownPopUpAdapter
	,__properties__: {get_persistent:"get_persistent",set_fitContentToOriginWidth:"set_fitContentToOriginWidth",get_fitContentToOriginWidth:"get_fitContentToOriginWidth",set_gap:"set_gap",get_gap:"get_gap",get_active:"get_active"}
});
var feathers_controls_supportClasses_IViewPort = function() { };
$hxClasses["feathers.controls.supportClasses.IViewPort"] = feathers_controls_supportClasses_IViewPort;
feathers_controls_supportClasses_IViewPort.__name__ = "feathers.controls.supportClasses.IViewPort";
feathers_controls_supportClasses_IViewPort.__isInterface__ = true;
feathers_controls_supportClasses_IViewPort.__interfaces__ = [feathers_core_IMeasureObject,feathers_core_IValidating,feathers_core_IUIControl];
feathers_controls_supportClasses_IViewPort.prototype = {
	get_visibleWidth: null
	,set_visibleWidth: null
	,get_visibleHeight: null
	,set_visibleHeight: null
	,get_minVisibleWidth: null
	,set_minVisibleWidth: null
	,get_minVisibleHeight: null
	,set_minVisibleHeight: null
	,get_maxVisibleWidth: null
	,set_maxVisibleWidth: null
	,get_maxVisibleHeight: null
	,set_maxVisibleHeight: null
	,get_scrollX: null
	,set_scrollX: null
	,get_scrollY: null
	,set_scrollY: null
	,__class__: feathers_controls_supportClasses_IViewPort
	,__properties__: {set_scrollY:"set_scrollY",get_scrollY:"get_scrollY",set_scrollX:"set_scrollX",get_scrollX:"get_scrollX",set_maxVisibleHeight:"set_maxVisibleHeight",get_maxVisibleHeight:"get_maxVisibleHeight",set_maxVisibleWidth:"set_maxVisibleWidth",get_maxVisibleWidth:"get_maxVisibleWidth",set_minVisibleHeight:"set_minVisibleHeight",get_minVisibleHeight:"get_minVisibleHeight",set_minVisibleWidth:"set_minVisibleWidth",get_minVisibleWidth:"get_minVisibleWidth",set_visibleHeight:"set_visibleHeight",get_visibleHeight:"get_visibleHeight",set_visibleWidth:"set_visibleWidth",get_visibleWidth:"get_visibleWidth"}
};
var feathers_controls_supportClasses_AdvancedLayoutViewPort = function() {
	this._layoutChanged = false;
	this._layoutActive = false;
	this._snapPositionsY = null;
	this._snapPositionsX = null;
	this._scrollY = 0.0;
	this._scrollX = 0.0;
	this._ignoreLayoutChanges = false;
	this._layoutResult = new feathers_layout_LayoutBoundsResult();
	this._layoutMeasurements = new feathers_layout_Measurements();
	this._layoutItems = [];
	this._layout = null;
	this._explicitVisibleHeight = null;
	this._actualVisibleHeight = 0.0;
	this._maxVisibleHeight = 1.0 / 0.0;
	this._actualMinVisibleHeight = 0.0;
	this._explicitVisibleWidth = null;
	this._actualVisibleWidth = 0.0;
	this._maxVisibleWidth = 1.0 / 0.0;
	this._explicitMinVisibleWidth = null;
	this._actualMinVisibleWidth = 0.0;
	feathers_core_FeathersControl.call(this);
	this._viewPortBackground = new openfl_display_Sprite();
	this._viewPortBackground.get_graphics().beginFill(16711935,0.0);
	this._viewPortBackground.get_graphics().drawRect(0.0,0.0,1.0,1.0);
	this._viewPortBackground.get_graphics().endFill();
	this.addChildAt(this._viewPortBackground,0);
};
$hxClasses["feathers.controls.supportClasses.AdvancedLayoutViewPort"] = feathers_controls_supportClasses_AdvancedLayoutViewPort;
feathers_controls_supportClasses_AdvancedLayoutViewPort.__name__ = "feathers.controls.supportClasses.AdvancedLayoutViewPort";
feathers_controls_supportClasses_AdvancedLayoutViewPort.__interfaces__ = [feathers_controls_supportClasses_IViewPort];
feathers_controls_supportClasses_AdvancedLayoutViewPort.__super__ = feathers_core_FeathersControl;
feathers_controls_supportClasses_AdvancedLayoutViewPort.prototype = $extend(feathers_core_FeathersControl.prototype,{
	_viewPortBackground: null
	,_actualMinVisibleWidth: null
	,_explicitMinVisibleWidth: null
	,get_minVisibleWidth: function() {
		if(this._explicitMinVisibleWidth == null) {
			return this._actualMinVisibleWidth;
		}
		return this._explicitMinVisibleWidth;
	}
	,set_minVisibleWidth: function(value) {
		if(this._explicitMinVisibleWidth == value) {
			return this._explicitMinVisibleWidth;
		}
		var oldValue = this._explicitMinVisibleWidth;
		this._explicitMinVisibleWidth = value;
		if(value == null) {
			this._actualMinVisibleWidth = 0.0;
			this.setInvalid(feathers_core_InvalidationFlag.SIZE);
		} else {
			this._actualMinVisibleWidth = value;
			if(this._explicitVisibleWidth == null && (this._actualVisibleWidth < value || this._actualVisibleWidth == oldValue)) {
				this.setInvalid(feathers_core_InvalidationFlag.SIZE);
			}
		}
		return this._explicitMinVisibleWidth;
	}
	,_maxVisibleWidth: null
	,get_maxVisibleWidth: function() {
		return this._maxVisibleWidth;
	}
	,set_maxVisibleWidth: function(value) {
		if(this._maxVisibleWidth == value) {
			return this._maxVisibleWidth;
		}
		if(value == null) {
			throw new openfl_errors_ArgumentError("maxVisibleWidth cannot be null");
		}
		var oldValue = this._maxVisibleWidth;
		this._maxVisibleWidth = value;
		if(this._explicitVisibleWidth == null && (this._actualVisibleWidth > value || this._actualVisibleWidth == oldValue)) {
			this.setInvalid(feathers_core_InvalidationFlag.SIZE);
		}
		return this._maxVisibleWidth;
	}
	,_actualVisibleWidth: null
	,_explicitVisibleWidth: null
	,get_visibleWidth: function() {
		if(this._explicitVisibleWidth == null) {
			return this._actualVisibleWidth;
		}
		return this._explicitVisibleWidth;
	}
	,set_visibleWidth: function(value) {
		if(this._explicitVisibleWidth == value) {
			return this._explicitVisibleWidth;
		}
		this._explicitVisibleWidth = value;
		if(this._actualVisibleWidth != value) {
			this.setInvalid(feathers_core_InvalidationFlag.SIZE);
		}
		return this._explicitVisibleWidth;
	}
	,_actualMinVisibleHeight: null
	,_explicitMinVisibleHeight: null
	,get_minVisibleHeight: function() {
		if(this._explicitMinVisibleHeight == null) {
			return this._actualMinVisibleHeight;
		}
		return this._explicitMinVisibleHeight;
	}
	,set_minVisibleHeight: function(value) {
		if(this._explicitMinVisibleHeight == value) {
			return this._explicitMinVisibleHeight;
		}
		var oldValue = this._explicitMinVisibleHeight;
		this._explicitMinVisibleHeight = value;
		if(value == null) {
			this._actualMinVisibleHeight = 0.0;
			this.setInvalid(feathers_core_InvalidationFlag.SIZE);
		} else {
			this._actualMinVisibleHeight = value;
			if(this._explicitVisibleHeight == null && (this._actualVisibleHeight < value || this._actualVisibleHeight == oldValue)) {
				this.setInvalid(feathers_core_InvalidationFlag.SIZE);
			}
		}
		return this._explicitMinVisibleHeight;
	}
	,_maxVisibleHeight: null
	,get_maxVisibleHeight: function() {
		return this._maxVisibleHeight;
	}
	,set_maxVisibleHeight: function(value) {
		if(this._maxVisibleHeight == value) {
			return this._maxVisibleHeight;
		}
		if(value == null) {
			throw new openfl_errors_ArgumentError("maxVisibleHeight cannot be null");
		}
		var oldValue = this._maxVisibleHeight;
		this._maxVisibleHeight = value;
		if(this._explicitVisibleHeight == null && (this._actualVisibleHeight > value || this._actualVisibleHeight == oldValue)) {
			this.setInvalid(feathers_core_InvalidationFlag.SIZE);
		}
		return this._maxVisibleHeight;
	}
	,_actualVisibleHeight: null
	,_explicitVisibleHeight: null
	,get_visibleHeight: function() {
		if(this._explicitVisibleHeight == null) {
			return this._actualVisibleHeight;
		}
		return this._explicitVisibleHeight;
	}
	,set_visibleHeight: function(value) {
		if(this._explicitVisibleHeight == value) {
			return this._explicitVisibleHeight;
		}
		this._explicitVisibleHeight = value;
		if(this._actualVisibleHeight != value) {
			this.setInvalid(feathers_core_InvalidationFlag.SIZE);
		}
		return this._explicitVisibleWidth;
	}
	,_layout: null
	,get_layout: function() {
		return this._layout;
	}
	,set_layout: function(value) {
		if(this._layout == value) {
			return this._layout;
		}
		if(this._layout != null) {
			this._layout.removeEventListener("change",$bind(this,this.advancedLayoutViewPort_layout_changeHandler));
			this._layout.removeEventListener("scroll",$bind(this,this.advancedLayoutViewPort_layout_scrollHandler));
		}
		this._layout = value;
		if(this._layout != null) {
			this._layout.addEventListener("change",$bind(this,this.advancedLayoutViewPort_layout_changeHandler));
			this._layout.addEventListener("scroll",$bind(this,this.advancedLayoutViewPort_layout_scrollHandler));
		}
		this.setInvalid(feathers_core_InvalidationFlag.LAYOUT);
		return this._layout;
	}
	,_layoutItems: null
	,_layoutMeasurements: null
	,_layoutResult: null
	,_ignoreLayoutChanges: null
	,_scrollX: null
	,get_scrollX: function() {
		return this._scrollX;
	}
	,set_scrollX: function(value) {
		if(this._scrollX == value) {
			return this._scrollX;
		}
		this._scrollX = value;
		this.setInvalid(feathers_core_InvalidationFlag.SCROLL);
		return this._scrollX;
	}
	,_scrollY: null
	,get_scrollY: function() {
		return this._scrollY;
	}
	,set_scrollY: function(value) {
		if(this._scrollY == value) {
			return this._scrollY;
		}
		this._scrollY = value;
		this.setInvalid(feathers_core_InvalidationFlag.SCROLL);
		return this._scrollY;
	}
	,_snapPositionsX: null
	,get_snapPositionsX: function() {
		return this._snapPositionsX;
	}
	,_snapPositionsY: null
	,get_snapPositionsY: function() {
		return this._snapPositionsY;
	}
	,_scroller: null
	,get_scroller: function() {
		return this._scroller;
	}
	,set_scroller: function(value) {
		if(this._scroller == value) {
			return this._scroller;
		}
		this._scroller = value;
		return this._scroller;
	}
	,_layoutActive: null
	,_layoutChanged: null
	,refreshChildren: function(items) {
	}
	,update: function() {
		var _gthis = this;
		this.refreshLayoutMeasurements();
		this.refreshLayoutProperties();
		this.runWithInvalidationFlagsOnly(function() {
			_gthis._layoutActive = true;
			var loopCount = 0;
			do {
				_gthis._layoutChanged = false;
				_gthis.refreshLayout();
				_gthis._invalidationFlags.clear();
				_gthis._allInvalid = false;
				++loopCount;
				if(loopCount >= 10) {
					_gthis._layoutActive = false;
					var c = js_Boot.getClass(_gthis.parent);
					var parentClassName = c.__name__;
					var layoutClassName;
					if(_gthis._layout != null) {
						var c1 = js_Boot.getClass(_gthis._layout);
						layoutClassName = c1.__name__;
					} else {
						layoutClassName = "The layout";
					}
					throw new openfl_errors_IllegalOperationError("" + parentClassName + " is stuck in an infinite loop during layout. " + layoutClassName + " may be dispatching Event.CHANGE too frequently.");
				}
			} while(_gthis._layoutChanged);
			_gthis._layoutActive = false;
		});
	}
	,refreshLayout: function() {
		this.refreshChildren(this._layoutItems);
		this._layoutResult.reset();
		if(this._layout != null) {
			this._layout.layout(this._layoutItems,this._layoutMeasurements,this._layoutResult);
		}
		this.handleLayoutResult();
	}
	,refreshLayoutProperties: function() {
		var oldIgnoreLayoutChanges = this._ignoreLayoutChanges;
		this._ignoreLayoutChanges = true;
		if(js_Boot.__implements(this._layout,feathers_layout_IScrollLayout)) {
			var scrollLayout = this._layout;
			scrollLayout.set_scrollX(this._scrollX);
			scrollLayout.set_scrollY(this._scrollY);
		}
		this._ignoreLayoutChanges = oldIgnoreLayoutChanges;
	}
	,refreshLayoutMeasurements: function() {
		var needsMinWidth = this._explicitMinVisibleWidth == null;
		var needsMinHeight = this._explicitMinVisibleHeight == null;
		var needsMaxWidth = this._maxVisibleWidth == null;
		var needsMaxHeight = this._maxVisibleHeight == null;
		this._layoutMeasurements.width = this._explicitVisibleWidth;
		this._layoutMeasurements.height = this._explicitVisibleHeight;
		var viewPortMinWidth = this._explicitMinVisibleWidth;
		if(needsMinWidth) {
			viewPortMinWidth = 0.0;
		}
		var viewPortMinHeight = this._explicitMinVisibleHeight;
		if(needsMinHeight) {
			viewPortMinHeight = 0.0;
		}
		var viewPortMaxWidth = this._maxVisibleWidth;
		if(needsMaxWidth) {
			viewPortMaxWidth = 1.0 / 0.0;
		}
		var viewPortMaxHeight = this._maxVisibleHeight;
		if(needsMaxHeight) {
			viewPortMaxHeight = 1.0 / 0.0;
		}
		this._layoutMeasurements.minWidth = viewPortMinWidth;
		this._layoutMeasurements.minHeight = viewPortMinHeight;
		this._layoutMeasurements.maxWidth = viewPortMaxWidth;
		this._layoutMeasurements.maxHeight = viewPortMaxHeight;
	}
	,handleLayoutResult: function() {
		this.saveMeasurements(this._layoutResult.contentWidth,this._layoutResult.contentHeight,this._layoutResult.contentMinWidth,this._layoutResult.contentMinHeight);
		var viewPortWidth = this._layoutResult.viewPortWidth;
		var viewPortHeight = this._layoutResult.viewPortHeight;
		this._actualVisibleWidth = viewPortWidth;
		this._actualVisibleHeight = viewPortHeight;
		this._actualMinVisibleWidth = this._layoutResult.contentMinWidth;
		this._actualMinVisibleHeight = this._layoutResult.contentMinHeight;
		this._viewPortBackground.set_x(Math.min(this.get_scrollX(),0.0));
		this._viewPortBackground.set_y(Math.min(this.get_scrollY(),0.0));
		this._viewPortBackground.set_width(Math.max(this.actualWidth,this._actualVisibleWidth));
		this._viewPortBackground.set_height(Math.max(this.actualHeight,this._actualVisibleHeight));
		if(js_Boot.__implements(this.get_layout(),feathers_layout_ISnapLayout)) {
			var snapLayout = this.get_layout();
			this._snapPositionsX = snapLayout.getSnapPositionsX(this._layoutItems,this._actualVisibleWidth,this._actualVisibleHeight,this._snapPositionsX);
			this._snapPositionsY = snapLayout.getSnapPositionsY(this._layoutItems,this._actualVisibleWidth,this._actualVisibleHeight,this._snapPositionsY);
		} else {
			this._snapPositionsX = null;
			this._snapPositionsY = null;
		}
	}
	,advancedLayoutViewPort_layout_changeHandler: function(event) {
		if(this._ignoreLayoutChanges) {
			return;
		}
		if(this._layoutActive) {
			this._layoutChanged = true;
			return;
		}
		this.setInvalid(feathers_core_InvalidationFlag.LAYOUT);
	}
	,advancedLayoutViewPort_layout_scrollHandler: function(event) {
		if(this._scroller == null || !this._scroller.get_scrolling()) {
			return;
		}
		this._scroller.applyLayoutShift(event.x,event.y);
		if(this._layoutActive) {
			this._layoutChanged = true;
			return;
		}
		this.setInvalid(feathers_core_InvalidationFlag.LAYOUT);
	}
	,__class__: feathers_controls_supportClasses_AdvancedLayoutViewPort
	,__properties__: $extend(feathers_core_FeathersControl.prototype.__properties__,{set_scroller:"set_scroller",get_scroller:"get_scroller",get_snapPositionsY:"get_snapPositionsY",get_snapPositionsX:"get_snapPositionsX",set_scrollY:"set_scrollY",get_scrollY:"get_scrollY",set_scrollX:"set_scrollX",get_scrollX:"get_scrollX",set_layout:"set_layout",get_layout:"get_layout",set_visibleHeight:"set_visibleHeight",get_visibleHeight:"get_visibleHeight",set_maxVisibleHeight:"set_maxVisibleHeight",get_maxVisibleHeight:"get_maxVisibleHeight",set_minVisibleHeight:"set_minVisibleHeight",get_minVisibleHeight:"get_minVisibleHeight",set_visibleWidth:"set_visibleWidth",get_visibleWidth:"get_visibleWidth",set_maxVisibleWidth:"set_maxVisibleWidth",get_maxVisibleWidth:"get_maxVisibleWidth",set_minVisibleWidth:"set_minVisibleWidth",get_minVisibleWidth:"get_minVisibleWidth"})
});
var feathers_controls_supportClasses_LayoutViewPort = function() {
	this._manageChildVisibility = false;
	this._snapPositionsY = null;
	this._snapPositionsX = null;
	this._scrollY = 0.0;
	this._scrollX = 0.0;
	this._explicitVisibleHeight = null;
	this._actualVisibleHeight = 0.0;
	this._maxVisibleHeight = 1.0 / 0.0;
	this._actualMinVisibleHeight = 0.0;
	this._explicitVisibleWidth = null;
	this._actualVisibleWidth = 0.0;
	this._maxVisibleWidth = 1.0 / 0.0;
	this._explicitMinVisibleWidth = null;
	this._actualMinVisibleWidth = 0.0;
	feathers_controls_LayoutGroup.call(this);
	this._viewPortBackground = new openfl_display_Sprite();
	this._viewPortBackground.get_graphics().beginFill(16711935,0.0);
	this._viewPortBackground.get_graphics().drawRect(0.0,0.0,1.0,1.0);
	this._viewPortBackground.get_graphics().endFill();
	this._addChildAt(this._viewPortBackground,0);
};
$hxClasses["feathers.controls.supportClasses.LayoutViewPort"] = feathers_controls_supportClasses_LayoutViewPort;
feathers_controls_supportClasses_LayoutViewPort.__name__ = "feathers.controls.supportClasses.LayoutViewPort";
feathers_controls_supportClasses_LayoutViewPort.__interfaces__ = [feathers_controls_supportClasses_IViewPort];
feathers_controls_supportClasses_LayoutViewPort.__super__ = feathers_controls_LayoutGroup;
feathers_controls_supportClasses_LayoutViewPort.prototype = $extend(feathers_controls_LayoutGroup.prototype,{
	_viewPortBackground: null
	,_actualMinVisibleWidth: null
	,_explicitMinVisibleWidth: null
	,get_minVisibleWidth: function() {
		if(this._explicitMinVisibleWidth == null) {
			return this._actualMinVisibleWidth;
		}
		return this._explicitMinVisibleWidth;
	}
	,set_minVisibleWidth: function(value) {
		if(this._explicitMinVisibleWidth == value) {
			return this._explicitMinVisibleWidth;
		}
		var oldValue = this._explicitMinVisibleWidth;
		this._explicitMinVisibleWidth = value;
		if(value == null) {
			this._actualMinVisibleWidth = 0.0;
			this.setInvalid(feathers_core_InvalidationFlag.SIZE);
		} else {
			this._actualMinVisibleWidth = value;
			if(this._explicitVisibleWidth == null && (this._actualVisibleWidth < value || this._actualVisibleWidth == oldValue)) {
				this.setInvalid(feathers_core_InvalidationFlag.SIZE);
			}
		}
		return this._explicitMinVisibleWidth;
	}
	,_maxVisibleWidth: null
	,get_maxVisibleWidth: function() {
		return this._maxVisibleWidth;
	}
	,set_maxVisibleWidth: function(value) {
		if(this._maxVisibleWidth == value) {
			return this._maxVisibleWidth;
		}
		if(value == null) {
			throw new openfl_errors_ArgumentError("maxVisibleWidth cannot be null");
		}
		var oldValue = this._maxVisibleWidth;
		this._maxVisibleWidth = value;
		if(this._explicitVisibleWidth == null && (this._actualVisibleWidth > value || this._actualVisibleWidth == oldValue)) {
			this.setInvalid(feathers_core_InvalidationFlag.SIZE);
		}
		return this._maxVisibleWidth;
	}
	,_actualVisibleWidth: null
	,_explicitVisibleWidth: null
	,get_visibleWidth: function() {
		if(this._explicitVisibleWidth == null) {
			return this._actualVisibleWidth;
		}
		return this._explicitVisibleWidth;
	}
	,set_visibleWidth: function(value) {
		if(this._explicitVisibleWidth == value) {
			return this._explicitVisibleWidth;
		}
		this._explicitVisibleWidth = value;
		if(this._actualVisibleWidth != value) {
			this.setInvalid(feathers_core_InvalidationFlag.SIZE);
		}
		return this._explicitVisibleWidth;
	}
	,_actualMinVisibleHeight: null
	,_explicitMinVisibleHeight: null
	,get_minVisibleHeight: function() {
		if(this._explicitMinVisibleHeight == null) {
			return this._actualMinVisibleHeight;
		}
		return this._explicitMinVisibleHeight;
	}
	,set_minVisibleHeight: function(value) {
		if(this._explicitMinVisibleHeight == value) {
			return this._explicitMinVisibleHeight;
		}
		var oldValue = this._explicitMinVisibleHeight;
		this._explicitMinVisibleHeight = value;
		if(value == null) {
			this._actualMinVisibleHeight = 0.0;
			this.setInvalid(feathers_core_InvalidationFlag.SIZE);
		} else {
			this._actualMinVisibleHeight = value;
			if(this._explicitVisibleHeight == null && (this._actualVisibleHeight < value || this._actualVisibleHeight == oldValue)) {
				this.setInvalid(feathers_core_InvalidationFlag.SIZE);
			}
		}
		return this._explicitMinVisibleHeight;
	}
	,_maxVisibleHeight: null
	,get_maxVisibleHeight: function() {
		return this._maxVisibleHeight;
	}
	,set_maxVisibleHeight: function(value) {
		if(this._maxVisibleHeight == value) {
			return this._maxVisibleHeight;
		}
		if(value == null) {
			throw new openfl_errors_ArgumentError("maxVisibleHeight cannot be null");
		}
		var oldValue = this._maxVisibleHeight;
		this._maxVisibleHeight = value;
		if(this._explicitVisibleHeight == null && (this._actualVisibleHeight > value || this._actualVisibleHeight == oldValue)) {
			this.setInvalid(feathers_core_InvalidationFlag.SIZE);
		}
		return this._maxVisibleHeight;
	}
	,_actualVisibleHeight: null
	,_explicitVisibleHeight: null
	,get_visibleHeight: function() {
		if(this._explicitVisibleHeight == null) {
			return this._actualVisibleHeight;
		}
		return this._explicitVisibleHeight;
	}
	,set_visibleHeight: function(value) {
		if(this._explicitVisibleHeight == value) {
			return this._explicitVisibleHeight;
		}
		this._explicitVisibleHeight = value;
		if(this._actualVisibleHeight != value) {
			this.setInvalid(feathers_core_InvalidationFlag.SIZE);
		}
		return this._explicitVisibleWidth;
	}
	,_scrollX: null
	,get_scrollX: function() {
		return this._scrollX;
	}
	,set_scrollX: function(value) {
		if(this._scrollX == value) {
			return this._scrollX;
		}
		this._scrollX = value;
		if(this._manageChildVisibility || js_Boot.__implements(this._currentLayout,feathers_layout_IScrollLayout)) {
			this.setInvalid(feathers_core_InvalidationFlag.LAYOUT);
		}
		return this._scrollX;
	}
	,_scrollY: null
	,get_scrollY: function() {
		return this._scrollY;
	}
	,set_scrollY: function(value) {
		if(this._scrollY == value) {
			return this._scrollY;
		}
		this._scrollY = value;
		if(this._manageChildVisibility || js_Boot.__implements(this._currentLayout,feathers_layout_IScrollLayout)) {
			this.setInvalid(feathers_core_InvalidationFlag.LAYOUT);
		}
		return this._scrollY;
	}
	,_snapPositionsX: null
	,get_snapPositionsX: function() {
		return this._snapPositionsX;
	}
	,_snapPositionsY: null
	,get_snapPositionsY: function() {
		return this._snapPositionsY;
	}
	,refreshViewPortBounds: function() {
		var needsWidth = this._explicitVisibleWidth == null;
		var needsHeight = this._explicitVisibleHeight == null;
		var needsMinWidth = this._explicitMinVisibleWidth == null;
		var needsMinHeight = this._explicitMinVisibleHeight == null;
		var needsMaxWidth = this._maxVisibleWidth == null;
		var needsMaxHeight = this._maxVisibleHeight == null;
		if(this._currentBackgroundSkin != null) {
			feathers_utils_MeasurementsUtil.resetFluidlyWithParent(this._backgroundSkinMeasurements,this._currentBackgroundSkin,this);
		}
		var needsToMeasureContent = this.get_autoSizeMode() == feathers_layout_AutoSizeMode.CONTENT || this.stage == null;
		var stageWidth = 0.0;
		var stageHeight = 0.0;
		if(!needsToMeasureContent) {
			var topLeft = this.globalToLocal(new openfl_geom_Point());
			var bottomRight = this.globalToLocal(new openfl_geom_Point(this.stage.stageWidth,this.stage.stageHeight));
			stageWidth = bottomRight.x - topLeft.x;
			stageHeight = bottomRight.y - topLeft.y;
		}
		if(needsWidth && !needsToMeasureContent) {
			this._layoutMeasurements.width = stageWidth;
		} else {
			this._layoutMeasurements.width = this._explicitVisibleWidth;
		}
		if(needsHeight && !needsToMeasureContent) {
			this._layoutMeasurements.height = stageHeight;
		} else {
			this._layoutMeasurements.height = this._explicitVisibleHeight;
		}
		var viewPortMinWidth = this._explicitMinVisibleWidth;
		if(needsMinWidth) {
			viewPortMinWidth = 0.0;
		}
		var viewPortMinHeight = this._explicitMinVisibleHeight;
		if(needsMinHeight) {
			viewPortMinHeight = 0.0;
		}
		var viewPortMaxWidth = this._maxVisibleWidth;
		if(needsMaxWidth) {
			viewPortMaxWidth = 1.0 / 0.0;
		}
		var viewPortMaxHeight = this._maxVisibleHeight;
		if(needsMaxHeight) {
			viewPortMaxHeight = 1.0 / 0.0;
		}
		if(this._currentBackgroundSkin != null) {
			if(this._currentBackgroundSkin.get_width() > viewPortMinWidth) {
				viewPortMinWidth = this._currentBackgroundSkin.get_width();
			}
			if(this._currentBackgroundSkin.get_height() > viewPortMinHeight) {
				viewPortMinHeight = this._currentBackgroundSkin.get_height();
			}
		}
		this._layoutMeasurements.minWidth = viewPortMinWidth;
		this._layoutMeasurements.minHeight = viewPortMinHeight;
		this._layoutMeasurements.maxWidth = viewPortMaxWidth;
		this._layoutMeasurements.maxHeight = viewPortMaxHeight;
	}
	,handleCustomLayout: function() {
		var oldIgnoreLayoutChanges = this._ignoreLayoutChanges;
		this._ignoreLayoutChanges = true;
		if(js_Boot.__implements(this._currentLayout,feathers_layout_IScrollLayout)) {
			var scrollLayout = this._currentLayout;
			scrollLayout.set_scrollX(this._scrollX);
			scrollLayout.set_scrollY(this._scrollY);
		}
		this._ignoreLayoutChanges = oldIgnoreLayoutChanges;
		feathers_controls_LayoutGroup.prototype.handleCustomLayout.call(this);
	}
	,handleLayoutResult: function() {
		this.saveMeasurements(this._layoutResult.contentWidth,this._layoutResult.contentHeight,this._layoutResult.contentMinWidth,this._layoutResult.contentMinHeight);
		var viewPortWidth = this._layoutResult.viewPortWidth;
		var viewPortHeight = this._layoutResult.viewPortHeight;
		this._actualVisibleWidth = viewPortWidth;
		this._actualVisibleHeight = viewPortHeight;
		this._actualMinVisibleWidth = this._layoutResult.contentMinWidth;
		this._actualMinVisibleHeight = this._layoutResult.contentMinHeight;
		this._viewPortBackground.set_x(Math.min(this.get_scrollX(),0.0));
		this._viewPortBackground.set_y(Math.min(this.get_scrollY(),0.0));
		this._viewPortBackground.set_width(Math.max(this.actualWidth,this._actualVisibleWidth));
		this._viewPortBackground.set_height(Math.max(this.actualHeight,this._actualVisibleHeight));
		if(js_Boot.__implements(this.get_layout(),feathers_layout_ISnapLayout)) {
			var snapLayout = this.get_layout();
			this._snapPositionsX = snapLayout.getSnapPositionsX(this.items,this._actualVisibleWidth,this._actualVisibleHeight,this._snapPositionsX);
			this._snapPositionsY = snapLayout.getSnapPositionsY(this.items,this._actualVisibleWidth,this._actualVisibleHeight,this._snapPositionsY);
		} else {
			this._snapPositionsX = null;
			this._snapPositionsY = null;
		}
	}
	,_manageChildVisibility: null
	,get_manageChildVisibility: function() {
		return this._manageChildVisibility;
	}
	,set_manageChildVisibility: function(value) {
		if(this._manageChildVisibility == value) {
			return this._manageChildVisibility;
		}
		this._manageChildVisibility = value;
		if(this._manageChildVisibility) {
			this.setInvalid(feathers_core_InvalidationFlag.LAYOUT);
		} else {
			var _g = 0;
			var _g1 = this.items;
			while(_g < _g1.length) {
				var child = _g1[_g];
				++_g;
				child.set_visible(true);
			}
		}
		return this._manageChildVisibility;
	}
	,update: function() {
		var layoutInvalid = this.isInvalid(feathers_core_InvalidationFlag.LAYOUT);
		var sizeInvalid = this.isInvalid(feathers_core_InvalidationFlag.SIZE);
		var scrollInvalid = this.isInvalid(feathers_core_InvalidationFlag.SCROLL);
		feathers_controls_LayoutGroup.prototype.update.call(this);
		if(layoutInvalid || sizeInvalid || scrollInvalid) {
			if(this._manageChildVisibility) {
				var maxX = this._scrollX + this._actualVisibleWidth;
				var maxY = this._scrollY + this._actualVisibleHeight;
				var _g = 0;
				var _g1 = this.items;
				while(_g < _g1.length) {
					var child = _g1[_g];
					++_g;
					child.set_visible(!(child.get_x() > maxX || child.get_x() + child.get_width() < this._scrollX || child.get_y() > maxY || child.get_y() + child.get_height() < this._scrollY));
				}
			}
		}
	}
	,refreshChildVisibility: function() {
		if(!this._manageChildVisibility) {
			return;
		}
		var maxX = this._scrollX + this._actualVisibleWidth;
		var maxY = this._scrollY + this._actualVisibleHeight;
		var _g = 0;
		var _g1 = this.items;
		while(_g < _g1.length) {
			var child = _g1[_g];
			++_g;
			child.set_visible(!(child.get_x() > maxX || child.get_x() + child.get_width() < this._scrollX || child.get_y() > maxY || child.get_y() + child.get_height() < this._scrollY));
		}
	}
	,removeChild: function(child) {
		if(this._manageChildVisibility && child != null) {
			child.set_visible(true);
		}
		return feathers_controls_LayoutGroup.prototype.removeChild.call(this,child);
	}
	,removeChildAt: function(index) {
		var child = feathers_controls_LayoutGroup.prototype.removeChildAt.call(this,index);
		if(this._manageChildVisibility && child != null) {
			child.set_visible(true);
		}
		return child;
	}
	,__class__: feathers_controls_supportClasses_LayoutViewPort
	,__properties__: $extend(feathers_controls_LayoutGroup.prototype.__properties__,{set_manageChildVisibility:"set_manageChildVisibility",get_manageChildVisibility:"get_manageChildVisibility",get_snapPositionsY:"get_snapPositionsY",get_snapPositionsX:"get_snapPositionsX",set_scrollY:"set_scrollY",get_scrollY:"get_scrollY",set_scrollX:"set_scrollX",get_scrollX:"get_scrollX",set_visibleHeight:"set_visibleHeight",get_visibleHeight:"get_visibleHeight",set_maxVisibleHeight:"set_maxVisibleHeight",get_maxVisibleHeight:"get_maxVisibleHeight",set_minVisibleHeight:"set_minVisibleHeight",get_minVisibleHeight:"get_minVisibleHeight",set_visibleWidth:"set_visibleWidth",get_visibleWidth:"get_visibleWidth",set_maxVisibleWidth:"set_maxVisibleWidth",get_maxVisibleWidth:"get_maxVisibleWidth",set_minVisibleWidth:"set_minVisibleWidth",get_minVisibleWidth:"get_minVisibleWidth"})
});
var feathers_controls_supportClasses_TextFieldViewPort = function() {
	this._ignoreTextFieldScroll = false;
	this._textFieldHasFocus = false;
	this._pendingSelectionActiveIndex = -1;
	this._pendingSelectionAnchorIndex = -1;
	this._scrollY = 0.0;
	this._scrollX = 0.0;
	this._explicitVisibleHeight = null;
	this._actualVisibleHeight = 0.0;
	this._maxVisibleHeight = 1.0 / 0.0;
	this._actualMinVisibleHeight = 0.0;
	this._explicitVisibleWidth = null;
	this._actualVisibleWidth = 0.0;
	this._maxVisibleWidth = 1.0 / 0.0;
	this._explicitMinVisibleWidth = null;
	this._actualMinVisibleWidth = 0.0;
	this._paddingLeft = 0.0;
	this._paddingBottom = 0.0;
	this._paddingRight = 0.0;
	this._paddingTop = 0.0;
	this._embedFonts = false;
	this._savedLineMetrics = null;
	this._previousWidth = null;
	this._previousTextFormat = null;
	this._previousText = null;
	this._updatedTextStyles = false;
	this._smoothScrolling = false;
	this._selectable = true;
	this._maxChars = 0;
	this._displayAsPassword = false;
	this._multiline = false;
	this._wordWrap = false;
	this._textFieldType = 0;
	feathers_core_FeathersControl.call(this);
	this.addEventListener("focusIn",$bind(this,this.textFieldViewPort_focusInHandler));
};
$hxClasses["feathers.controls.supportClasses.TextFieldViewPort"] = feathers_controls_supportClasses_TextFieldViewPort;
feathers_controls_supportClasses_TextFieldViewPort.__name__ = "feathers.controls.supportClasses.TextFieldViewPort";
feathers_controls_supportClasses_TextFieldViewPort.__interfaces__ = [feathers_core_IStageFocusDelegate,feathers_core_IFocusManagerAware,feathers_core_ITextControl,feathers_controls_supportClasses_IViewPort];
feathers_controls_supportClasses_TextFieldViewPort.__super__ = feathers_core_FeathersControl;
feathers_controls_supportClasses_TextFieldViewPort.prototype = $extend(feathers_core_FeathersControl.prototype,{
	_textField: null
	,get_textField: function() {
		return this._textField;
	}
	,_textFieldType: null
	,get_textFieldType: function() {
		return this._textFieldType;
	}
	,set_textFieldType: function(value) {
		if(this._textFieldType == value) {
			return this._textFieldType;
		}
		this._textFieldType = value;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		return this._textFieldType;
	}
	,_text: null
	,get_text: function() {
		return this._text;
	}
	,set_text: function(value) {
		if(this._text == value) {
			return this._text;
		}
		this._text = value;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._text;
	}
	,get_baseline: function() {
		if(this._textField == null) {
			return 0.0;
		}
		var hasText = this._text != null && this._text.length > 0;
		if(!hasText) {
			this.get_textField().set_text("​");
			var result = this.get_textField().get_y() + this.get_textField().getLineMetrics(0).ascent;
			this.get_textField().set_text("");
			return result;
		}
		return this._textField.get_y() + this._textField.getLineMetrics(0).ascent;
	}
	,_wordWrap: null
	,get_wordWrap: function() {
		return this._wordWrap;
	}
	,set_wordWrap: function(value) {
		if(this._wordWrap == value) {
			return this._wordWrap;
		}
		this._wordWrap = value;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		return this._wordWrap;
	}
	,_multiline: null
	,get_multiline: function() {
		return this._multiline;
	}
	,set_multiline: function(value) {
		if(this._multiline == value) {
			return this._multiline;
		}
		this._multiline = value;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		return this._multiline;
	}
	,___restrict: null
	,get_restrict: function() {
		return this.___restrict;
	}
	,set_restrict: function(value) {
		if(this.___restrict == value) {
			return this.___restrict;
		}
		this.___restrict = value;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		return this.___restrict;
	}
	,_displayAsPassword: null
	,get_displayAsPassword: function() {
		return this._displayAsPassword;
	}
	,set_displayAsPassword: function(value) {
		if(this._displayAsPassword == value) {
			return this._displayAsPassword;
		}
		this._displayAsPassword = value;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		return this._displayAsPassword;
	}
	,_maxChars: null
	,get_maxChars: function() {
		return this._maxChars;
	}
	,set_maxChars: function(value) {
		if(this._maxChars == value) {
			return this._maxChars;
		}
		this._maxChars = value;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		return this._maxChars;
	}
	,_selectable: null
	,get_selectable: function() {
		return this._selectable;
	}
	,set_selectable: function(value) {
		if(this._selectable == value) {
			return this._selectable;
		}
		this._selectable = value;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		return this._selectable;
	}
	,_smoothScrolling: null
	,get_smoothScrolling: function() {
		return this._smoothScrolling;
	}
	,set_smoothScrolling: function(value) {
		if(this._smoothScrolling == value) {
			return this._smoothScrolling;
		}
		this._smoothScrolling = value;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		return this._smoothScrolling;
	}
	,_updatedTextStyles: null
	,_previousText: null
	,_previousTextFormat: null
	,_previousWidth: null
	,_savedLineMetrics: null
	,_textMeasuredWidth: null
	,_textMeasuredHeight: null
	,_textFormat: null
	,get_textFormat: function() {
		return this._textFormat;
	}
	,set_textFormat: function(value) {
		if(this._textFormat == value) {
			return this._textFormat;
		}
		this._textFormat = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this._textFormat;
	}
	,_embedFonts: null
	,get_embedFonts: function() {
		return this._embedFonts;
	}
	,set_embedFonts: function(value) {
		if(this._embedFonts == value) {
			return this._embedFonts;
		}
		this._embedFonts = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this._embedFonts;
	}
	,_paddingTop: null
	,get_paddingTop: function() {
		return this._paddingTop;
	}
	,set_paddingTop: function(value) {
		if(this._paddingTop == value) {
			return this._paddingTop;
		}
		this._paddingTop = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this._paddingTop;
	}
	,_paddingRight: null
	,get_paddingRight: function() {
		return this._paddingRight;
	}
	,set_paddingRight: function(value) {
		if(this._paddingRight == value) {
			return this._paddingRight;
		}
		this._paddingRight = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this._paddingRight;
	}
	,_paddingBottom: null
	,get_paddingBottom: function() {
		return this._paddingBottom;
	}
	,set_paddingBottom: function(value) {
		if(this._paddingBottom == value) {
			return this._paddingBottom;
		}
		this._paddingBottom = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this._paddingBottom;
	}
	,_paddingLeft: null
	,get_paddingLeft: function() {
		return this._paddingLeft;
	}
	,set_paddingLeft: function(value) {
		if(this._paddingLeft == value) {
			return this._paddingLeft;
		}
		this._paddingLeft = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this._paddingLeft;
	}
	,get_stageFocusTarget: function() {
		return this._textField;
	}
	,_actualMinVisibleWidth: null
	,_explicitMinVisibleWidth: null
	,get_minVisibleWidth: function() {
		if(this._explicitMinVisibleWidth == null) {
			return this._actualMinVisibleWidth;
		}
		return this._explicitMinVisibleWidth;
	}
	,set_minVisibleWidth: function(value) {
		if(this._explicitMinVisibleWidth == value) {
			return this._explicitMinVisibleWidth;
		}
		var oldValue = this._explicitMinVisibleWidth;
		this._explicitMinVisibleWidth = value;
		if(value == null) {
			this._actualMinVisibleWidth = 0.0;
			this.setInvalid(feathers_core_InvalidationFlag.SIZE);
		} else {
			this._actualMinVisibleWidth = value;
			if(this._explicitVisibleWidth == null && (this._actualVisibleWidth < value || this._actualVisibleWidth == oldValue)) {
				this.setInvalid(feathers_core_InvalidationFlag.SIZE);
			}
		}
		return this._explicitMinVisibleWidth;
	}
	,_maxVisibleWidth: null
	,get_maxVisibleWidth: function() {
		return this._maxVisibleWidth;
	}
	,set_maxVisibleWidth: function(value) {
		if(this._maxVisibleWidth == value) {
			return this._maxVisibleWidth;
		}
		if(value == null) {
			throw new openfl_errors_ArgumentError("maxVisibleWidth cannot be null");
		}
		var oldValue = this._maxVisibleWidth;
		this._maxVisibleWidth = value;
		if(this._explicitVisibleWidth == null && (this._actualVisibleWidth > value || this._actualVisibleWidth == oldValue)) {
			this.setInvalid(feathers_core_InvalidationFlag.SIZE);
		}
		return this._maxVisibleWidth;
	}
	,_actualVisibleWidth: null
	,_explicitVisibleWidth: null
	,get_visibleWidth: function() {
		if(this._explicitVisibleWidth == null) {
			return this._actualVisibleWidth;
		}
		return this._explicitVisibleWidth;
	}
	,set_visibleWidth: function(value) {
		if(this._explicitVisibleWidth == value) {
			return this._explicitVisibleWidth;
		}
		this._explicitVisibleWidth = value;
		if(this._actualVisibleWidth != value) {
			this.setInvalid(feathers_core_InvalidationFlag.SIZE);
		}
		return this._explicitVisibleWidth;
	}
	,_actualMinVisibleHeight: null
	,_explicitMinVisibleHeight: null
	,get_minVisibleHeight: function() {
		if(this._explicitMinVisibleHeight == null) {
			return this._actualMinVisibleHeight;
		}
		return this._explicitMinVisibleHeight;
	}
	,set_minVisibleHeight: function(value) {
		if(this._explicitMinVisibleHeight == value) {
			return this._explicitMinVisibleHeight;
		}
		var oldValue = this._explicitMinVisibleHeight;
		this._explicitMinVisibleHeight = value;
		if(value == null) {
			this._actualMinVisibleHeight = 0.0;
			this.setInvalid(feathers_core_InvalidationFlag.SIZE);
		} else {
			this._actualMinVisibleHeight = value;
			if(this._explicitVisibleHeight == null && (this._actualVisibleHeight < value || this._actualVisibleHeight == oldValue)) {
				this.setInvalid(feathers_core_InvalidationFlag.SIZE);
			}
		}
		return this._explicitMinVisibleHeight;
	}
	,_maxVisibleHeight: null
	,get_maxVisibleHeight: function() {
		return this._maxVisibleHeight;
	}
	,set_maxVisibleHeight: function(value) {
		if(this._maxVisibleHeight == value) {
			return this._maxVisibleHeight;
		}
		if(value == null) {
			throw new openfl_errors_ArgumentError("maxVisibleHeight cannot be null");
		}
		var oldValue = this._maxVisibleHeight;
		this._maxVisibleHeight = value;
		if(this._explicitVisibleHeight == null && (this._actualVisibleHeight > value || this._actualVisibleHeight == oldValue)) {
			this.setInvalid(feathers_core_InvalidationFlag.SIZE);
		}
		return this._maxVisibleHeight;
	}
	,_actualVisibleHeight: null
	,_explicitVisibleHeight: null
	,get_visibleHeight: function() {
		if(this._explicitVisibleHeight == null) {
			return this._actualVisibleHeight;
		}
		return this._explicitVisibleHeight;
	}
	,set_visibleHeight: function(value) {
		if(this._explicitVisibleHeight == value) {
			return this._explicitVisibleHeight;
		}
		this._explicitVisibleHeight = value;
		if(this._actualVisibleHeight != value) {
			this.setInvalid(feathers_core_InvalidationFlag.SIZE);
		}
		return this._explicitVisibleWidth;
	}
	,_scrollX: null
	,get_scrollX: function() {
		return this._scrollX;
	}
	,set_scrollX: function(value) {
		if(this._scrollX == value) {
			return this._scrollX;
		}
		this._scrollX = value;
		this.setInvalid(feathers_core_InvalidationFlag.SCROLL);
		return this._scrollX;
	}
	,_scrollY: null
	,get_scrollY: function() {
		return this._scrollY;
	}
	,set_scrollY: function(value) {
		if(this._scrollY == value) {
			return this._scrollY;
		}
		this._scrollY = value;
		this.setInvalid(feathers_core_InvalidationFlag.SCROLL);
		return this._scrollY;
	}
	,_pendingSelectionAnchorIndex: null
	,get_selectionAnchorIndex: function() {
		if(this._textField != null && this._pendingSelectionAnchorIndex == -1) {
			if(this._textField.get_caretIndex() == this._textField.get_selectionBeginIndex()) {
				return this._textField.get_selectionEndIndex();
			}
			return this._textField.get_selectionBeginIndex();
		}
		return this._pendingSelectionAnchorIndex;
	}
	,_pendingSelectionActiveIndex: null
	,get_selectionActiveIndex: function() {
		if(this._textField != null && this._pendingSelectionActiveIndex == -1) {
			return this._textField.get_caretIndex();
		}
		return this._pendingSelectionActiveIndex;
	}
	,_textFieldHasFocus: null
	,_ignoreTextFieldScroll: null
	,setPadding: function(value) {
		this.set_paddingTop(value);
		this.set_paddingRight(value);
		this.set_paddingBottom(value);
		this.set_paddingLeft(value);
	}
	,selectRange: function(anchorIndex,activeIndex) {
		this._pendingSelectionAnchorIndex = anchorIndex;
		this._pendingSelectionActiveIndex = activeIndex;
		this.setInvalid(feathers_core_InvalidationFlag.SELECTION);
	}
	,initialize: function() {
		feathers_core_FeathersControl.prototype.initialize.call(this);
		if(this._textField == null) {
			this._textField = new openfl_text_TextField();
			this.addChild(this._textField);
		}
		this._textField.set_selectable(true);
		this._textField.set_tabEnabled(false);
		this._textField.set_mouseWheelEnabled(false);
		this._textField.addEventListener("change",$bind(this,this.textFieldViewPort_textField_changeHandler));
		this._textField.addEventListener("scroll",$bind(this,this.textFieldViewPort_textField_scrollHandler));
		this._textField.addEventListener("focusIn",$bind(this,this.textFieldViewPort_textField_focusInHandler));
		this._textField.addEventListener("focusOut",$bind(this,this.textFieldViewPort_textField_focusOutHandler));
	}
	,update: function() {
		var dataInvalid = this.isInvalid(feathers_core_InvalidationFlag.DATA);
		var selectionInvalid = this.isInvalid(feathers_core_InvalidationFlag.SELECTION);
		var sizeInvalid = this.isInvalid(feathers_core_InvalidationFlag.SIZE);
		var stylesInvalid = this.isInvalid(feathers_core_InvalidationFlag.STYLES);
		this._updatedTextStyles = false;
		var oldIgnoreTextFieldScroll = this._ignoreTextFieldScroll;
		this._ignoreTextFieldScroll = true;
		if(stylesInvalid) {
			this.refreshTextStyles();
		}
		if(dataInvalid || sizeInvalid || stylesInvalid) {
			this.refreshText();
		}
		this.measure();
		if(selectionInvalid) {
			this.refreshSelection();
		}
		this.layoutTextField();
		this._ignoreTextFieldScroll = oldIgnoreTextFieldScroll;
	}
	,measureSelf: function() {
		var needsWidth = this._explicitVisibleWidth == null;
		var needsHeight = this.get_explicitHeight() == null;
		var needsMinWidth = this._explicitMinVisibleWidth == null;
		var needsMinHeight = this.get_explicitMinHeight() == null;
		var needsMaxWidth = this.get_explicitMaxWidth() == null;
		var needsMaxHeight = this.get_explicitMaxHeight() == null;
		if(!needsWidth && !needsHeight && !needsMinWidth && !needsMinHeight && !needsMaxWidth && !needsMaxHeight) {
			return false;
		}
		var newWidth = this._explicitVisibleWidth;
		if(needsWidth) {
			newWidth = this._paddingLeft + this._paddingRight;
		}
		var newHeight = this.get_explicitHeight();
		if(needsHeight) {
			newHeight = this._textMeasuredHeight + this._paddingTop + this._paddingBottom;
		}
		var newMinWidth = this._explicitMinVisibleWidth;
		if(needsMinWidth) {
			newMinWidth = this._paddingLeft + this._paddingRight;
		}
		var newMinHeight = this.get_explicitMinHeight();
		if(needsMinHeight) {
			newMinHeight = this._textMeasuredHeight + this._paddingTop + this._paddingBottom;
		}
		var newMaxWidth = this.get_explicitMaxWidth();
		if(needsMaxWidth) {
			newMaxWidth = 1.0 / 0.0;
		}
		var newMaxHeight = this.get_explicitMaxHeight();
		if(needsMaxHeight) {
			newMaxHeight = 1.0 / 0.0;
		}
		return this.saveMeasurements(newWidth,newHeight,newMinWidth,newMinHeight,newMaxWidth,newMaxHeight);
	}
	,measure: function() {
		var result = this.measureSelf();
		var needsVisibleWidth = this._explicitVisibleWidth == null;
		var needsVisibleHeight = this._explicitVisibleHeight == null;
		var needsVisibleMinWidth = this._explicitMinVisibleWidth == null;
		var needsVisibleMinHeight = this._explicitMinVisibleHeight == null;
		if(needsVisibleWidth) {
			this._actualVisibleWidth = this.actualWidth;
		} else {
			this._actualVisibleWidth = this._explicitVisibleWidth;
		}
		if(needsVisibleHeight) {
			this._actualVisibleHeight = this.actualHeight;
		} else {
			this._actualVisibleHeight = this._explicitVisibleHeight;
		}
		if(needsVisibleMinWidth) {
			this._actualMinVisibleWidth = this.actualMinWidth;
		} else {
			this._actualMinVisibleWidth = this._explicitMinVisibleWidth;
		}
		if(needsVisibleMinHeight) {
			this._actualMinVisibleHeight = this.actualMinHeight;
		} else {
			this._actualMinVisibleHeight = this._explicitMinVisibleHeight;
		}
		return result;
	}
	,refreshTextStyles: function() {
		if(this._textField.get_embedFonts() != this._embedFonts) {
			this._textField.set_embedFonts(this._embedFonts);
			this._updatedTextStyles = true;
		}
		if(this._textFormat != this._previousTextFormat) {
			this._textField.set_defaultTextFormat(this._textFormat);
			this._updatedTextStyles = true;
			this._previousTextFormat = this._textFormat;
		}
	}
	,refreshText: function() {
		var textFieldType = this._enabled ? this._textFieldType : 0;
		if(this._textField.get_type() != textFieldType) {
			this._textField.set_type(textFieldType);
		}
		var calculatedWordWrap = this._explicitVisibleWidth != null && this._wordWrap;
		if(this._textField.get_wordWrap() != calculatedWordWrap) {
			this._textField.set_wordWrap(calculatedWordWrap);
			this._updatedTextStyles = true;
		}
		if(this._textField.get_multiline() != this._multiline) {
			this._textField.set_multiline(this._multiline);
			this._updatedTextStyles = true;
		}
		this._textField.set_restrict(this.___restrict);
		this._textField.set_displayAsPassword(this._displayAsPassword);
		this._textField.set_maxChars(this._maxChars);
		this._textField.set_selectable(this._selectable);
		var calculatedWidth = this._explicitVisibleWidth;
		if(calculatedWidth != null) {
			calculatedWidth -= this._paddingLeft + this._paddingRight;
			if(calculatedWidth < 0.0) {
				calculatedWidth = 0.0;
			}
		}
		if(this._text == this._previousText && !this._updatedTextStyles && calculatedWidth == this._previousWidth) {
			return;
		}
		if(calculatedWidth != null) {
			this._textField.set_width(calculatedWidth);
		}
		this._textField.set_autoSize(1);
		var hasText = this._text != null && this._text.length > 0;
		if(hasText) {
			this._textField.set_text(this._text);
		} else {
			this._textField.set_text("​");
		}
		this._savedLineMetrics = this._textField.getLineMetrics(0);
		this._textMeasuredWidth = this._textField.get_width();
		this._textMeasuredHeight = 4 + (this._savedLineMetrics.height + this._savedLineMetrics.leading) * this._textField.get_numLines();
		this._textField.set_autoSize(2);
		if(!hasText) {
			this._textField.set_text("");
		}
		this._previousText = this._text;
		this._previousWidth = calculatedWidth;
	}
	,refreshSelection: function() {
		if(this._pendingSelectionActiveIndex == -1 && this._pendingSelectionAnchorIndex == -1) {
			return;
		}
		var anchorIndex = this._pendingSelectionAnchorIndex;
		var activeIndex = this._pendingSelectionActiveIndex;
		this._pendingSelectionAnchorIndex = -1;
		this._pendingSelectionActiveIndex = -1;
		this._textField.setSelection(anchorIndex,activeIndex);
	}
	,layoutTextField: function() {
		if(this._smoothScrolling) {
			this._textField.set_x(this._paddingLeft);
			this._textField.set_y(this._paddingTop);
			var calculatedWidth = Math.max(this.actualWidth,this._actualVisibleWidth);
			var calculatedHeight = Math.max(this.actualHeight,this._actualVisibleHeight);
			var textFieldWidth = calculatedWidth - this._paddingLeft - this._paddingRight;
			if(textFieldWidth < 0.0) {
				textFieldWidth = 0.0;
			}
			this._textField.set_width(textFieldWidth);
			var textFieldHeight = calculatedHeight - this._paddingTop - this._paddingBottom;
			if(textFieldHeight < 0.0) {
				textFieldHeight = 0.0;
			}
			this._textField.set_height(textFieldHeight);
			this._textField.set_scrollV(1);
		} else {
			this._textField.set_x(this._paddingLeft + this._scrollX);
			this._textField.set_y(this._paddingTop + this._scrollY);
			var textFieldWidth = this._actualVisibleWidth - this._paddingLeft - this._paddingRight;
			if(textFieldWidth < 0.0) {
				textFieldWidth = 0.0;
			}
			this._textField.set_width(textFieldWidth);
			var textFieldHeight = this._actualVisibleHeight - this._paddingTop - this._paddingBottom;
			if(textFieldHeight < 0.0) {
				textFieldHeight = 0.0;
			}
			this._textField.set_height(textFieldHeight);
			var textFieldHeight = this._textField.get_textHeight();
			var maxScrollX = Math.max(0.0,this.actualWidth - this._actualVisibleWidth);
			var maxScrollY = Math.max(0.0,this.actualHeight - this._actualVisibleHeight);
			if(this._textField.get_maxScrollV() == 1 || maxScrollY == 0.0) {
				this._textField.set_scrollV(1);
			} else {
				this._textField.set_scrollV(1 + Math.ceil(this._scrollY / (this._savedLineMetrics.height + this._savedLineMetrics.leading)));
			}
			if(this._textField.get_maxScrollH() == 0 || maxScrollX == 0.0) {
				this._textField.set_scrollH(0);
			} else {
				this._textField.set_scrollH(Math.round(this._textField.get_maxScrollH() * (this._scrollX / maxScrollX)));
			}
		}
	}
	,textFieldViewPort_textField_changeHandler: function(event) {
		event.stopPropagation();
		this.set_text(this._textField.get_text());
		if(this._textFieldHasFocus) {
			var container = js_Boot.__cast(this.parent , feathers_controls_supportClasses_BaseScrollContainer);
			container.validateNow();
			if(container.get_maxScrollY() > 0.0) {
				var lineIndex = -1;
				var caretIndex = this._textField.get_caretIndex();
				if(caretIndex == this._textField.get_length()) {
					if(caretIndex == 0) {
						return;
					}
					--caretIndex;
					lineIndex = this._textField.getLineIndexOfChar(caretIndex);
					var charAtIndex = this._textField.get_text().charAt(caretIndex);
					if(charAtIndex == "\n" || charAtIndex == "\r") {
						++lineIndex;
					}
				} else {
					lineIndex = this._textField.getLineIndexOfChar(caretIndex);
				}
				if(this._smoothScrolling) {
					var lineHeight = this._savedLineMetrics.height + this._savedLineMetrics.leading;
					var minScrollYForLine = container.get_maxScrollY() - (this._textField.get_numLines() - lineIndex - 1) * lineHeight;
					var maxScrollYForLine = minScrollYForLine + (this._textField.get_numLines() - Math.floor(this.get_visibleHeight() / lineHeight)) * lineHeight;
					var targetScrollY = this._scrollY;
					if(minScrollYForLine - targetScrollY > 0.0) {
						targetScrollY = minScrollYForLine;
					} else if(targetScrollY - maxScrollYForLine > 0.0) {
						targetScrollY = maxScrollYForLine;
					}
					container.set_scrollY(targetScrollY);
				} else if(this._textField.get_maxScrollV() > 1) {
					var minScrollVForLine = this._textField.get_maxScrollV() - (this._textField.get_numLines() - lineIndex - 1);
					var maxScrollVForLine = minScrollVForLine + (this._textField.get_numLines() - this._textField.get_maxScrollV());
					if(maxScrollVForLine > this._textField.get_maxScrollV()) {
						maxScrollVForLine = this._textField.get_maxScrollV();
					}
					var targetScrollV = this._textField.get_scrollV();
					if(minScrollVForLine - targetScrollV > 0) {
						targetScrollV = minScrollVForLine;
					} else if(targetScrollV - maxScrollVForLine > 0) {
						targetScrollV = maxScrollVForLine;
					}
					if(targetScrollV != this._textField.get_scrollV()) {
						container.set_scrollY((targetScrollV - 1) * (this._savedLineMetrics.height + this._savedLineMetrics.leading));
					}
				}
			}
		}
	}
	,textFieldViewPort_textField_focusInHandler: function(event) {
		this._textFieldHasFocus = true;
	}
	,textFieldViewPort_textField_focusOutHandler: function(event) {
		this._textFieldHasFocus = false;
	}
	,textFieldViewPort_textField_scrollHandler: function(event) {
		if(this._ignoreTextFieldScroll || this._smoothScrolling) {
			return;
		}
		var container = js_Boot.__cast(this.parent , feathers_controls_supportClasses_BaseScrollContainer);
		if(container.get_maxScrollY() > 0.0 && this._textField.get_maxScrollV() > 1) {
			container.set_scrollY((this._textField.get_scrollV() - 1) * (this._savedLineMetrics.height + this._savedLineMetrics.leading));
		}
	}
	,textFieldViewPort_focusInHandler: function(event) {
		if(this.stage != null && this.stage.get_focus() != this._textField) {
			event.stopImmediatePropagation();
			this.stage.set_focus(this._textField);
		}
	}
	,__class__: feathers_controls_supportClasses_TextFieldViewPort
	,__properties__: $extend(feathers_core_FeathersControl.prototype.__properties__,{get_selectionActiveIndex:"get_selectionActiveIndex",get_selectionAnchorIndex:"get_selectionAnchorIndex",set_scrollY:"set_scrollY",get_scrollY:"get_scrollY",set_scrollX:"set_scrollX",get_scrollX:"get_scrollX",set_visibleHeight:"set_visibleHeight",get_visibleHeight:"get_visibleHeight",set_maxVisibleHeight:"set_maxVisibleHeight",get_maxVisibleHeight:"get_maxVisibleHeight",set_minVisibleHeight:"set_minVisibleHeight",get_minVisibleHeight:"get_minVisibleHeight",set_visibleWidth:"set_visibleWidth",get_visibleWidth:"get_visibleWidth",set_maxVisibleWidth:"set_maxVisibleWidth",get_maxVisibleWidth:"get_maxVisibleWidth",set_minVisibleWidth:"set_minVisibleWidth",get_minVisibleWidth:"get_minVisibleWidth",get_stageFocusTarget:"get_stageFocusTarget",set_paddingLeft:"set_paddingLeft",get_paddingLeft:"get_paddingLeft",set_paddingBottom:"set_paddingBottom",get_paddingBottom:"get_paddingBottom",set_paddingRight:"set_paddingRight",get_paddingRight:"get_paddingRight",set_paddingTop:"set_paddingTop",get_paddingTop:"get_paddingTop",set_embedFonts:"set_embedFonts",get_embedFonts:"get_embedFonts",set_textFormat:"set_textFormat",get_textFormat:"get_textFormat",set_smoothScrolling:"set_smoothScrolling",get_smoothScrolling:"get_smoothScrolling",set_selectable:"set_selectable",get_selectable:"get_selectable",set_maxChars:"set_maxChars",get_maxChars:"get_maxChars",set_displayAsPassword:"set_displayAsPassword",get_displayAsPassword:"get_displayAsPassword",set_restrict:"set_restrict",get_restrict:"get_restrict",set_multiline:"set_multiline",get_multiline:"get_multiline",set_wordWrap:"set_wordWrap",get_wordWrap:"get_wordWrap",get_baseline:"get_baseline",set_text:"set_text",get_text:"get_text",set_textFieldType:"set_textFieldType",get_textFieldType:"get_textFieldType",get_textField:"get_textField"})
});
var feathers_core_IFocusManager = function() { };
$hxClasses["feathers.core.IFocusManager"] = feathers_core_IFocusManager;
feathers_core_IFocusManager.__name__ = "feathers.core.IFocusManager";
feathers_core_IFocusManager.__isInterface__ = true;
feathers_core_IFocusManager.__interfaces__ = [openfl_events_IEventDispatcher];
feathers_core_IFocusManager.prototype = {
	get_root: null
	,get_focus: null
	,set_focus: null
	,get_focusPane: null
	,get_showFocusIndicator: null
	,get_enabled: null
	,set_enabled: null
	,findNextFocus: null
	,dispose: null
	,__class__: feathers_core_IFocusManager
	,__properties__: {set_enabled:"set_enabled",get_enabled:"get_enabled",get_showFocusIndicator:"get_showFocusIndicator",get_focusPane:"get_focusPane",set_focus:"set_focus",get_focus:"get_focus",get_root:"get_root"}
};
var feathers_core_DefaultFocusManager = function(root) {
	this._cancelMouseFocusChange = false;
	this._showFocusIndicator = false;
	this._focusPane = null;
	this._root = null;
	this._enabled = true;
	openfl_events_EventDispatcher.call(this);
	this.set_root(root);
};
$hxClasses["feathers.core.DefaultFocusManager"] = feathers_core_DefaultFocusManager;
feathers_core_DefaultFocusManager.__name__ = "feathers.core.DefaultFocusManager";
feathers_core_DefaultFocusManager.__interfaces__ = [feathers_core_IFocusManager];
feathers_core_DefaultFocusManager.__super__ = openfl_events_EventDispatcher;
feathers_core_DefaultFocusManager.prototype = $extend(openfl_events_EventDispatcher.prototype,{
	_enabled: null
	,get_enabled: function() {
		return this._enabled;
	}
	,set_enabled: function(value) {
		if(this._enabled == value) {
			return this._enabled;
		}
		if(value && this._root == null) {
			throw new openfl_errors_IllegalOperationError("Cannot enable focus manager without a root container.");
		}
		this._enabled = value;
		if(this._root.stage != null) {
			if(this._enabled) {
				this.restoreFocus();
			} else {
				this.set_focus(null);
			}
		}
		return this._enabled;
	}
	,_root: null
	,get_root: function() {
		return this._root;
	}
	,set_root: function(value) {
		if(this._root == value) {
			return this._root;
		}
		if(this._root != null) {
			this.clearFocusManager(this._root);
			this._root.removeEventListener("addedToStage",$bind(this,this.defaultFocusManager_root_addedToStageHandler));
			this._root.removeEventListener("removedFromStage",$bind(this,this.defaultFocusManager_root_removedFromStageHandler));
			this._root.removeEventListener("added",$bind(this,this.defaultFocusManager_root_addedHandler));
			this._root.removeEventListener("removed",$bind(this,this.defaultFocusManager_root_removedHandler));
			this._root.removeEventListener("mouseDown",$bind(this,this.defaultFocusManager_root_mouseDownCaptureHandler),true);
			this._root.removeEventListener("focusIn",$bind(this,this.defaultFocusManager_root_focusInCaptureHandler),true);
			this._root.removeEventListener("mouseFocusChange",$bind(this,this.defaultFocusManager_root_mouseFocusChangeHandler));
			this._root.removeEventListener("activate",$bind(this,this.defaultFocusManager_root_activateHandler));
			this._root.removeEventListener("deactivate",$bind(this,this.defaultFocusManager_root_deactivateHandler));
			this.handleRootRemovedFromStage(this._root.stage);
		}
		this._root = value;
		if(this._root != null) {
			this.handleRootAddedToStage(this._root);
			this.setFocusManager(this._root);
			this._root.addEventListener("addedToStage",$bind(this,this.defaultFocusManager_root_addedToStageHandler),false,0,true);
			this._root.addEventListener("removedFromStage",$bind(this,this.defaultFocusManager_root_removedFromStageHandler),false,0,true);
			this._root.addEventListener("added",$bind(this,this.defaultFocusManager_root_addedHandler),false,0,true);
			this._root.addEventListener("removed",$bind(this,this.defaultFocusManager_root_removedHandler),false,0,true);
			this._root.addEventListener("mouseDown",$bind(this,this.defaultFocusManager_root_mouseDownCaptureHandler),true,0,true);
			this._root.addEventListener("focusIn",$bind(this,this.defaultFocusManager_root_focusInCaptureHandler),true,0,true);
			this._root.addEventListener("mouseFocusChange",$bind(this,this.defaultFocusManager_root_mouseFocusChangeHandler),false,0,true);
			this._root.addEventListener("activate",$bind(this,this.defaultFocusManager_root_activateHandler),false,0,true);
			this._root.addEventListener("deactivate",$bind(this,this.defaultFocusManager_root_deactivateHandler),false,0,true);
		}
		return this._root;
	}
	,_focusPane: null
	,get_focusPane: function() {
		if(this._focusPane == null) {
			this._focusPane = new openfl_display_Sprite();
			this._focusPane.mouseEnabled = false;
			this._focusPane.mouseChildren = false;
			this._focusPane.set_tabEnabled(false);
			this._focusPane.set_tabChildren(false);
			feathers_core_PopUpManager.forStage(this._root.stage).addPopUp(this._focusPane,false,false);
		}
		return this._focusPane;
	}
	,_showFocusIndicator: null
	,get_showFocusIndicator: function() {
		return this._showFocusIndicator;
	}
	,_focusToRestore: null
	,get_focus: function() {
		if(this._root.stage == null) {
			return null;
		}
		return this.findFocusForDisplayObject(this._root.stage.get_focus());
	}
	,set_focus: function(value) {
		if(this._enabled && this._root.stage != null) {
			var oldFocus = this.findFocusForDisplayObject(this._root.stage.get_focus());
			if(oldFocus == value) {
				this.setStageFocus(js_Boot.__cast(value , openfl_display_InteractiveObject));
				return this.get_focus();
			}
		}
		if(value != null && value.get_focusManager() != this) {
			throw new openfl_errors_ArgumentError("Failed to change focus. Object is not managed by this focus manager: " + Std.string(value));
		}
		if(this._enabled && this._root.stage != null) {
			this.setStageFocus(js_Boot.__cast(value , openfl_display_InteractiveObject));
		}
		return this.get_focus();
	}
	,_wrapObject: null
	,_cancelMouseFocusChange: null
	,dispose: function() {
		if(this.get_focus() != null) {
			this.set_focus(null);
		}
		if(this._focusPane != null) {
			if(this._focusPane.parent != null) {
				this._focusPane.parent.removeChild(this._focusPane);
			}
			this._focusPane = null;
		}
		var savedRoot = this._root;
		this.set_root(null);
		this._root = savedRoot;
		feathers_events_FeathersEvent.dispatch(this,"clear");
		this._root = null;
	}
	,findNextFocus: function(backward) {
		if(backward == null) {
			backward = false;
		}
		var result = this.findNextFocusInternal(backward);
		return result.newFocus;
	}
	,findNextFocusInternal: function(backward) {
		if(backward == null) {
			backward = false;
		}
		var newFocus = null;
		var wrapped = false;
		var currentFocus = this.get_focus();
		if(currentFocus != null && currentFocus.get_focusOwner() != null) {
			var focusOwner = currentFocus.get_focusOwner();
			if(focusOwner != null && focusOwner.get_focusManager() != this) {
				focusOwner = null;
			}
			if(focusOwner != null) {
				newFocus = focusOwner;
			}
		} else if(backward) {
			if(currentFocus != null && currentFocus.parent != null) {
				newFocus = this.findPreviousContainerFocus(currentFocus.parent,js_Boot.__cast(currentFocus , openfl_display_DisplayObject),true);
			}
			if(newFocus == null) {
				newFocus = this.findPreviousChildFocus(this._root);
				wrapped = currentFocus != null;
			}
		} else {
			if(currentFocus != null) {
				if(js_Boot.__implements(currentFocus,feathers_core_IFocusContainer) && currentFocus.get_childFocusEnabled()) {
					newFocus = this.findNextContainerFocus(js_Boot.__cast(currentFocus , openfl_display_DisplayObjectContainer),null,true);
				} else if(currentFocus.parent != null) {
					newFocus = this.findNextContainerFocus(currentFocus.parent,js_Boot.__cast(currentFocus , openfl_display_DisplayObject),true);
				}
			}
			if(newFocus == null) {
				newFocus = this.findNextChildFocus(this._root);
				wrapped = currentFocus != null;
			}
		}
		return new feathers_core__$DefaultFocusManager_FocusResult(newFocus,wrapped);
	}
	,findNextRelativeFocusInternal: function(keyCode) {
		var relativePosition;
		switch(keyCode) {
		case 37:
			relativePosition = feathers_layout_RelativePosition.LEFT;
			break;
		case 38:
			relativePosition = feathers_layout_RelativePosition.TOP;
			break;
		case 39:
			relativePosition = feathers_layout_RelativePosition.RIGHT;
			break;
		case 40:
			relativePosition = feathers_layout_RelativePosition.BOTTOM;
			break;
		default:
			return new feathers_core__$DefaultFocusManager_FocusResult(null,false);
		}
		var currentFocus = this.get_focus();
		var focusableObjects = feathers_utils_FocusUtil.findAllFocusableObjects(this._root);
		if(currentFocus == null) {
			if(focusableObjects.length > 0) {
				return new feathers_core__$DefaultFocusManager_FocusResult(focusableObjects[0],false);
			}
			return new feathers_core__$DefaultFocusManager_FocusResult(null,false);
		}
		var newFocus = currentFocus;
		var focusedRect = (js_Boot.__cast(currentFocus , openfl_display_DisplayObject)).getBounds(currentFocus.stage);
		var _g = 0;
		while(_g < focusableObjects.length) {
			var focusableObject = focusableObjects[_g];
			++_g;
			if(focusableObject == currentFocus) {
				continue;
			}
			if(!this.isValidFocus(focusableObject)) {
				continue;
			}
			if(feathers_utils_DPadFocusUtil.isBetterFocusForRelativePosition(js_Boot.__cast(focusableObject , openfl_display_DisplayObject),js_Boot.__cast(newFocus , openfl_display_DisplayObject),focusedRect,relativePosition)) {
				newFocus = focusableObject;
			}
		}
		return new feathers_core__$DefaultFocusManager_FocusResult(newFocus,false);
	}
	,isValidFocusWithKeyboard: function(target) {
		if(((target) instanceof openfl_display_InteractiveObject) && !target.get_tabEnabled()) {
			return false;
		}
		return this.isValidFocus(target);
	}
	,isValidFocus: function(target,allowIfUnderModal) {
		if(allowIfUnderModal == null) {
			allowIfUnderModal = false;
		}
		if(target == null || target.stage == null || target.get_focusManager() != this || !target.get_focusEnabled() || !target.get_visible()) {
			return false;
		}
		if(js_Boot.__implements(target,feathers_core_IUIControl)) {
			var uiTarget = target;
			if(!uiTarget.get_enabled()) {
				return false;
			}
		}
		if(!allowIfUnderModal) {
			var popUpManager = feathers_core_PopUpManager.forStage(this._root.stage);
			if(popUpManager.hasModalPopUps()) {
				var displayTarget = js_Boot.__cast(target , openfl_display_DisplayObject);
				if(!feathers_utils_PopUpUtil.isTopLevelPopUpOrIsContainedByTopLevelPopUp(displayTarget)) {
					return false;
				}
			}
		}
		return true;
	}
	,setFocusManager: function(target) {
		if(js_Boot.__implements(target,feathers_core_IFocusManagerAware)) {
			var targetWithFocus = target;
			targetWithFocus.set_focusManager(this);
		}
		var container = ((target) instanceof openfl_display_DisplayObjectContainer) ? target : null;
		if(container != null) {
			var _g = 0;
			var _g1 = container.get_numChildren();
			while(_g < _g1) {
				var i = _g++;
				var child = container.getChildAt(i);
				this.setFocusManager(child);
			}
			if(js_Boot.__implements(container,feathers_core_IFocusExtras)) {
				var focusWithExtras = container;
				var extras = focusWithExtras.get_focusExtrasBefore();
				if(extras != null) {
					var _g = 0;
					while(_g < extras.length) {
						var child = extras[_g];
						++_g;
						this.setFocusManager(child);
					}
				}
				extras = focusWithExtras.get_focusExtrasAfter();
				if(extras != null) {
					var _g = 0;
					while(_g < extras.length) {
						var child = extras[_g];
						++_g;
						this.setFocusManager(child);
					}
				}
			}
		}
	}
	,clearFocusManager: function(target) {
		if(js_Boot.__implements(target,feathers_core_IFocusManagerAware)) {
			var targetWithFocus = target;
			if(targetWithFocus.get_focusManager() == this) {
				if(targetWithFocus == this._focusToRestore) {
					this._focusToRestore = null;
				}
				if(this.get_focus() == targetWithFocus) {
					var focusOwner = null;
					if(js_Boot.__implements(target,feathers_core_IFocusObject)) {
						focusOwner = targetWithFocus.get_focusOwner();
					}
					if(focusOwner != null && focusOwner.get_focusManager() != this) {
						focusOwner = null;
					}
					this.set_focus(focusOwner);
				}
				targetWithFocus.set_focusManager(null);
			}
		}
		var container = ((target) instanceof openfl_display_DisplayObjectContainer) ? target : null;
		if(container != null) {
			var _g = 0;
			var _g1 = container.get_numChildren();
			while(_g < _g1) {
				var i = _g++;
				var child = container.getChildAt(i);
				this.clearFocusManager(child);
			}
			if(js_Boot.__implements(container,feathers_core_IFocusExtras)) {
				var focusWithExtras = container;
				var extras = focusWithExtras.get_focusExtrasBefore();
				if(extras != null) {
					var _g = 0;
					while(_g < extras.length) {
						var child = extras[_g];
						++_g;
						this.clearFocusManager(child);
					}
				}
				extras = focusWithExtras.get_focusExtrasAfter();
				if(extras != null) {
					var _g = 0;
					while(_g < extras.length) {
						var child = extras[_g];
						++_g;
						this.clearFocusManager(child);
					}
				}
			}
		}
	}
	,findPreviousContainerFocus: function(container,beforeChild,fallbackToGlobal) {
		var outerContainer = container;
		if(js_Boot.__implements(container,feathers_controls_supportClasses_IViewPort) && !js_Boot.__implements(container,feathers_core_IFocusContainer)) {
			outerContainer = container.parent;
		}
		var hasProcessedBeforeChild = beforeChild == null;
		if(js_Boot.__implements(outerContainer,feathers_core_IFocusExtras)) {
			var focusWithExtras = outerContainer;
			var extras = focusWithExtras.get_focusExtrasAfter();
			if(extras != null) {
				var startIndex = extras.length - 1;
				if(!hasProcessedBeforeChild) {
					var extraIndex = extras.indexOf(beforeChild);
					if(extraIndex != -1) {
						startIndex = extraIndex - 1;
						hasProcessedBeforeChild = true;
					}
				}
				if(hasProcessedBeforeChild) {
					var i = startIndex;
					while(i >= 0) {
						var child = extras[i];
						var foundChild = this.findPreviousChildFocus(child);
						if(foundChild != null) {
							return foundChild;
						}
						--i;
					}
				}
			}
		}
		var startIndex = container.get_numChildren() - 1;
		if(!hasProcessedBeforeChild) {
			var childIndex = -1;
			try {
				childIndex = container.getChildIndex(beforeChild);
			} catch( _g ) {
				haxe_NativeStackTrace.lastError = _g;
			}
			if(childIndex != -1) {
				startIndex = childIndex - 1;
				hasProcessedBeforeChild = true;
			}
		}
		if(hasProcessedBeforeChild) {
			var i = startIndex;
			while(i >= 0) {
				var child = container.getChildAt(i);
				var foundChild = this.findPreviousChildFocus(child);
				if(foundChild != null) {
					return foundChild;
				}
				--i;
			}
		}
		if(js_Boot.__implements(outerContainer,feathers_core_IFocusExtras)) {
			var focusWithExtras = outerContainer;
			var extras = focusWithExtras.get_focusExtrasBefore();
			if(extras != null) {
				var startIndex = extras.length - 1;
				if(!hasProcessedBeforeChild) {
					var extraIndex = extras.indexOf(beforeChild);
					if(extraIndex != -1) {
						startIndex = extraIndex - 1;
						hasProcessedBeforeChild = true;
					}
				}
				if(hasProcessedBeforeChild) {
					var i = startIndex;
					while(i >= 0) {
						var child = extras[i];
						var foundChild = this.findPreviousChildFocus(child);
						if(foundChild != null) {
							return foundChild;
						}
						--i;
					}
				}
			}
		}
		if(fallbackToGlobal && outerContainer != this._root) {
			if(js_Boot.__implements(outerContainer,feathers_core_IFocusObject)) {
				var focusContainer = outerContainer;
				if(this.isValidFocusWithKeyboard(focusContainer)) {
					return focusContainer;
				}
			}
			return this.findPreviousContainerFocus(outerContainer.parent,outerContainer,true);
		}
		return null;
	}
	,findNextContainerFocus: function(container,afterChild,fallbackToGlobal) {
		var outerContainer = container;
		if(js_Boot.__implements(container,feathers_controls_supportClasses_IViewPort) && !js_Boot.__implements(container,feathers_core_IFocusContainer)) {
			outerContainer = container.parent;
		}
		var hasProcessedAfterChild = afterChild == null;
		var exclusions = null;
		if(js_Boot.__implements(outerContainer,feathers_core_IFocusExclusions)) {
			exclusions = outerContainer.get_focusExclusions();
		}
		if(js_Boot.__implements(outerContainer,feathers_core_IFocusExtras)) {
			var focusWithExtras = outerContainer;
			var extras = focusWithExtras.get_focusExtrasBefore();
			if(extras != null) {
				var startIndex = 0;
				if(!hasProcessedAfterChild) {
					var extrasIndex = extras.indexOf(afterChild);
					if(extrasIndex != -1) {
						startIndex = extrasIndex + 1;
						hasProcessedAfterChild = true;
					}
				}
				if(hasProcessedAfterChild) {
					var _g = startIndex;
					var _g1 = extras.length;
					while(_g < _g1) {
						var i = _g++;
						var child = extras[i];
						if(exclusions != null && exclusions.indexOf(child) != -1) {
							continue;
						}
						var foundChild = this.findNextChildFocus(child);
						if(foundChild != null) {
							return foundChild;
						}
					}
				}
			}
		}
		var startIndex = 0;
		if(!hasProcessedAfterChild) {
			var childIndex = -1;
			try {
				childIndex = container.getChildIndex(afterChild);
			} catch( _g ) {
				haxe_NativeStackTrace.lastError = _g;
			}
			if(childIndex != -1) {
				startIndex = childIndex + 1;
				hasProcessedAfterChild = true;
			}
		}
		if(hasProcessedAfterChild) {
			var _g = startIndex;
			var _g1 = container.get_numChildren();
			while(_g < _g1) {
				var i = _g++;
				var child = container.getChildAt(i);
				if(exclusions != null && exclusions.indexOf(child) != -1) {
					continue;
				}
				var foundChild = this.findNextChildFocus(child);
				if(foundChild != null) {
					return foundChild;
				}
			}
		}
		if(js_Boot.__implements(outerContainer,feathers_core_IFocusExtras)) {
			var focusWithExtras = outerContainer;
			var extras = focusWithExtras.get_focusExtrasAfter();
			if(extras != null) {
				var startIndex = 0;
				if(!hasProcessedAfterChild) {
					var extrasIndex = extras.indexOf(afterChild);
					if(extrasIndex != -1) {
						startIndex = extrasIndex + 1;
						hasProcessedAfterChild = true;
					}
				}
				if(hasProcessedAfterChild) {
					var _g = startIndex;
					var _g1 = extras.length;
					while(_g < _g1) {
						var i = _g++;
						var child = extras[i];
						if(exclusions != null && exclusions.indexOf(child) != -1) {
							continue;
						}
						var foundChild = this.findNextChildFocus(child);
						if(foundChild != null) {
							return foundChild;
						}
					}
				}
			}
		}
		if(fallbackToGlobal && outerContainer != this._root && outerContainer.parent != null) {
			var foundChild = this.findNextContainerFocus(outerContainer.parent,outerContainer,true);
			if(foundChild != null) {
				return foundChild;
			}
		}
		return null;
	}
	,findPreviousChildFocus: function(child) {
		var childContainer = ((child) instanceof openfl_display_DisplayObjectContainer) ? child : null;
		if(childContainer != null) {
			var findPrevChildContainer = !js_Boot.__implements(childContainer,feathers_core_IFocusObject);
			if(!findPrevChildContainer && js_Boot.__implements(childContainer,feathers_core_IFocusContainer)) {
				var focusContainer = childContainer;
				findPrevChildContainer = focusContainer.get_childFocusEnabled();
			}
			if(findPrevChildContainer) {
				var foundChild = this.findPreviousContainerFocus(childContainer,null,false);
				if(foundChild != null) {
					return foundChild;
				}
			}
		}
		if(js_Boot.__implements(child,feathers_core_IFocusObject)) {
			var childWithFocus = child;
			if(this.isValidFocusWithKeyboard(childWithFocus)) {
				if(!js_Boot.__implements(childWithFocus,feathers_controls_IGroupedToggle)) {
					return childWithFocus;
				}
				var toggleGroup = childWithFocus.get_toggleGroup();
				if(toggleGroup == null) {
					return childWithFocus;
				}
				if(js_Boot.__implements(toggleGroup.get_selectedItem(),feathers_core_IFocusObject)) {
					var selectedItem = toggleGroup.get_selectedItem();
					if(this.get_focus() != selectedItem) {
						return selectedItem;
					}
				}
			}
		}
		return null;
	}
	,findNextChildFocus: function(child) {
		if(js_Boot.__implements(child,feathers_core_IFocusObject)) {
			var childWithFocus = child;
			if(this.isValidFocusWithKeyboard(childWithFocus)) {
				if(!js_Boot.__implements(childWithFocus,feathers_controls_IGroupedToggle)) {
					return childWithFocus;
				}
				var toggleGroup = childWithFocus.get_toggleGroup();
				if(toggleGroup == null) {
					return childWithFocus;
				}
				if(js_Boot.__implements(toggleGroup.get_selectedItem(),feathers_core_IFocusObject)) {
					var selectedItem = toggleGroup.get_selectedItem();
					if(this.get_focus() != selectedItem) {
						return selectedItem;
					}
				}
			}
		}
		var childContainer = ((child) instanceof openfl_display_DisplayObjectContainer) ? child : null;
		if(childContainer != null) {
			var findNextChildContainer = !js_Boot.__implements(childContainer,feathers_core_IFocusObject);
			if(!findNextChildContainer && js_Boot.__implements(childContainer,feathers_core_IFocusContainer)) {
				var focusContainer = childContainer;
				findNextChildContainer = focusContainer.get_childFocusEnabled();
			}
			if(findNextChildContainer) {
				var foundChild = this.findNextContainerFocus(childContainer,null,false);
				if(foundChild != null) {
					return foundChild;
				}
			}
		}
		return null;
	}
	,setStageFocus: function(value) {
		while(js_Boot.__implements(value,feathers_core_IStageFocusDelegate)) {
			var newFocusTarget = value.get_stageFocusTarget();
			if(newFocusTarget == null) {
				break;
			}
			value = newFocusTarget;
		}
		if(value == null) {
			value = this._root.stage;
		}
		if(this._root.stage.window == null) {
			return;
		}
		if(this._root.stage.get_focus() != value) {
			this._root.stage.set_focus(value);
		}
	}
	,handleRootAddedToStage: function(root) {
		var stage = this._root.stage;
		if(stage == null) {
			return;
		}
		stage.stageFocusRect = false;
		if(this._enabled && stage.get_focus() == null) {
			stage.set_focus(stage);
		}
		this._root.addEventListener("keyDown",$bind(this,this.defaultFocusManager_root_keyDownHandler),false,0,true);
		this._root.addEventListener("keyFocusChange",$bind(this,this.defaultFocusManager_root_keyFocusChangeHandler),false,0,true);
	}
	,handleRootRemovedFromStage: function(root) {
		this.set_focus(null);
		var stage = this._root.stage;
		if(stage == null) {
			return;
		}
		this._root.removeEventListener("keyDown",$bind(this,this.defaultFocusManager_root_keyDownHandler));
		this._root.removeEventListener("keyFocusChange",$bind(this,this.defaultFocusManager_root_keyFocusChangeHandler));
	}
	,defaultFocusManager_root_addedToStageHandler: function(event) {
		this.handleRootAddedToStage(js_Boot.__cast(event.currentTarget , openfl_display_DisplayObject));
	}
	,defaultFocusManager_root_removedFromStageHandler: function(event) {
		this.handleRootRemovedFromStage(js_Boot.__cast(event.currentTarget , openfl_display_DisplayObject));
	}
	,restoreFocus: function() {
		if(this._root.stage == null || this._focusToRestore == null || !this.isValidFocus(this._focusToRestore)) {
			return;
		}
		this.set_focus(this._focusToRestore);
	}
	,shouldBeManaged: function(target) {
		if(target == this._root) {
			return true;
		}
		var container = target.parent;
		var valid = false;
		try {
			valid = container.getChildIndex(target) != -1;
		} catch( _g ) {
			haxe_NativeStackTrace.lastError = _g;
		}
		if(valid && js_Boot.__implements(container,feathers_controls_supportClasses_IViewPort) && !js_Boot.__implements(container,feathers_core_IFocusContainer)) {
			container = container.parent;
		} else if(!valid && js_Boot.__implements(container,feathers_core_IFocusExtras)) {
			var focusWithExtras = container;
			if(focusWithExtras.get_focusExtrasBefore() != null) {
				var _g = 0;
				var _g1 = focusWithExtras.get_focusExtrasBefore();
				while(_g < _g1.length) {
					var child = _g1[_g];
					++_g;
					if(child == target) {
						valid = true;
						break;
					}
					if(((child) instanceof openfl_display_DisplayObjectContainer)) {
						valid = child.contains(child);
						if(valid) {
							break;
						}
					}
				}
			}
			if(!valid && focusWithExtras.get_focusExtrasAfter() != null) {
				var _g = 0;
				var _g1 = focusWithExtras.get_focusExtrasAfter();
				while(_g < _g1.length) {
					var child = _g1[_g];
					++_g;
					if(child == target) {
						valid = true;
						break;
					}
					if(((child) instanceof openfl_display_DisplayObjectContainer)) {
						valid = child.contains(child);
						if(valid) {
							break;
						}
					}
				}
			}
		}
		if(!valid) {
			return false;
		}
		if(container != null && container != this._root) {
			return this.shouldBeManaged(container);
		}
		return true;
	}
	,defaultFocusManager_root_addedHandler: function(event) {
		var target = js_Boot.__cast(event.target , openfl_display_DisplayObject);
		if(this._focusPane != null) {
			if(this._focusPane == target || this._focusPane.contains(target)) {
				feathers_core_PopUpManager.forStage(this._root.stage).addPopUp(this._focusPane,false,false);
				return;
			}
		}
		if(this.shouldBeManaged(target)) {
			this.setFocusManager(target);
		}
		var currentFocus = null;
		if(this._root.stage != null) {
			currentFocus = this.findFocusForDisplayObject(this._root.stage.get_focus(),true);
		}
		if(currentFocus != null && !this.isValidFocus(currentFocus)) {
			this.set_focus(null);
		}
	}
	,defaultFocusManager_root_removedHandler: function(event) {
		var target = js_Boot.__cast(event.target , openfl_display_DisplayObject);
		this.clearFocusManager(target);
	}
	,defaultFocusManager_root_mouseFocusChangeHandler: function(event) {
		if(event.isDefaultPrevented()) {
			this._cancelMouseFocusChange = true;
			return;
		}
		if(!this._enabled) {
			return;
		}
		this._showFocusIndicator = false;
		var value = event.relatedObject;
		var textField = ((value) instanceof openfl_text_TextField) ? value : null;
		if(textField != null) {
			if(textField.get_type() == 1 || textField.get_selectable()) {
				return;
			}
			var newFocus = js_Boot.__cast(this.findFocusForDisplayObject(textField) , openfl_display_DisplayObject);
			while(js_Boot.__implements(newFocus,feathers_core_IStageFocusDelegate)) {
				var newFocusTarget = newFocus.get_stageFocusTarget();
				if(newFocusTarget == null) {
					break;
				}
				newFocus = newFocusTarget;
			}
			if(textField == newFocus) {
				return;
			}
		}
		event.preventDefault();
	}
	,handleKeyDownFocusWrapping: function(event) {
		if(openfl_system_Capabilities.playerType == "StandAlone" || openfl_system_Capabilities.playerType == "Desktop") {
			return;
		}
		if(!this._enabled || event.isDefaultPrevented()) {
			return;
		}
		if(event.keyCode != 9 && event.keyCode != 0) {
			return;
		}
		if(this._wrapObject != null) {
			if(this._wrapObject.get_tabIndex() == feathers_core_DefaultFocusManager.WRAP_OBJECT_HIGH_TAB_INDEX) {
				this._wrapObject.set_tabIndex(-1);
			}
			this._wrapObject = null;
		}
		var result = this.findNextFocusInternal(event.shiftKey);
		if(result.wrapped) {
			this._wrapObject = this._root.stage.get_focus();
			if(this._wrapObject != null && this._wrapObject.get_tabIndex() == -1) {
				this._wrapObject.set_tabIndex(event.shiftKey ? 0 : feathers_core_DefaultFocusManager.WRAP_OBJECT_HIGH_TAB_INDEX);
			}
			return;
		}
	}
	,handleDPadArrowKeys: function(event) {
		if(event.keyLocation != 4) {
			return;
		}
		if(event.keyCode != 38 && event.keyCode != 40 && event.keyCode != 37 && event.keyCode != 39) {
			return;
		}
		if(event.isDefaultPrevented()) {
			return;
		}
		this._showFocusIndicator = true;
		var result = this.findNextRelativeFocusInternal(event.keyCode);
		this.set_focus(result.newFocus);
	}
	,defaultFocusManager_root_keyDownHandler: function(event) {
		this.handleKeyDownFocusWrapping(event);
		this.handleDPadArrowKeys(event);
	}
	,defaultFocusManager_root_keyFocusChangeHandler: function(event) {
		if(!this._enabled || event.isDefaultPrevented()) {
			return;
		}
		if(event.keyCode != 9 && event.keyCode != 0) {
			return;
		}
		this._showFocusIndicator = true;
		var result = this.findNextFocusInternal(event.shiftKey);
		this.set_focus(result.newFocus);
		if(this._wrapObject == null) {
			event.preventDefault();
		} else if(((this._wrapObject) instanceof openfl_text_TextField) && this._wrapObject.get_type() == 1) {
			event.preventDefault();
		}
	}
	,findFocusForDisplayObject: function(target,allowIfUnderModal) {
		if(allowIfUnderModal == null) {
			allowIfUnderModal = false;
		}
		if(target == null) {
			return null;
		}
		var focusTarget = null;
		do {
			if(js_Boot.__implements(target,feathers_core_IFocusObject)) {
				var tempFocusTarget = target;
				if(this.isValidFocus(tempFocusTarget,allowIfUnderModal)) {
					if(focusTarget == null || !js_Boot.__implements(tempFocusTarget,feathers_core_IFocusContainer) || !tempFocusTarget.get_childFocusEnabled()) {
						focusTarget = tempFocusTarget;
					}
				} else if(tempFocusTarget.get_focusOwner() != null && this.isValidFocus(tempFocusTarget.get_focusOwner(),allowIfUnderModal)) {
					focusTarget = tempFocusTarget.get_focusOwner();
					target = js_Boot.__cast(tempFocusTarget , openfl_display_DisplayObject);
				}
			}
			if(target == this._root) {
				break;
			}
			target = target.parent;
		} while(target != null);
		return focusTarget;
	}
	,defaultFocusManager_root_mouseDownCaptureHandler: function(event) {
		this._showFocusIndicator = false;
		if(this._cancelMouseFocusChange) {
			this._cancelMouseFocusChange = false;
			return;
		}
		if(!this._enabled) {
			return;
		}
		var interactiveTarget = event.target;
		var newFocus = this.findFocusForDisplayObject(interactiveTarget);
		this.set_focus(newFocus);
	}
	,defaultFocusManager_root_focusInCaptureHandler: function(event) {
		if(!this._enabled) {
			return;
		}
		this._focusToRestore = this.findFocusForDisplayObject(js_Boot.__cast(event.target , openfl_display_DisplayObject));
	}
	,defaultFocusManager_root_activateHandler: function(event) {
		if(!this._enabled) {
			return;
		}
		this.restoreFocus();
	}
	,defaultFocusManager_root_deactivateHandler: function(event) {
		if(!this._enabled) {
			return;
		}
		this.set_focus(null);
	}
	,__class__: feathers_core_DefaultFocusManager
	,__properties__: {set_focus:"set_focus",get_focus:"get_focus",get_showFocusIndicator:"get_showFocusIndicator",get_focusPane:"get_focusPane",set_root:"set_root",get_root:"get_root",set_enabled:"set_enabled",get_enabled:"get_enabled"}
});
var feathers_core__$DefaultFocusManager_FocusResult = function(newFocus,wrapped) {
	this.newFocus = newFocus;
	this.wrapped = wrapped;
};
$hxClasses["feathers.core._DefaultFocusManager.FocusResult"] = feathers_core__$DefaultFocusManager_FocusResult;
feathers_core__$DefaultFocusManager_FocusResult.__name__ = "feathers.core._DefaultFocusManager.FocusResult";
feathers_core__$DefaultFocusManager_FocusResult.prototype = {
	newFocus: null
	,wrapped: null
	,__class__: feathers_core__$DefaultFocusManager_FocusResult
};
var feathers_core_IPopUpManager = function() { };
$hxClasses["feathers.core.IPopUpManager"] = feathers_core_IPopUpManager;
feathers_core_IPopUpManager.__name__ = "feathers.core.IPopUpManager";
feathers_core_IPopUpManager.__isInterface__ = true;
feathers_core_IPopUpManager.prototype = {
	get_overlayFactory: null
	,set_overlayFactory: null
	,get_root: null
	,set_root: null
	,get_popUpCount: null
	,get_topLevelPopUpCount: null
	,getPopUpAt: null
	,isPopUp: null
	,isTopLevelPopUp: null
	,isModal: null
	,hasModalPopUps: null
	,addPopUp: null
	,removePopUp: null
	,removeAllPopUps: null
	,centerPopUp: null
	,bringToFront: null
	,__class__: feathers_core_IPopUpManager
	,__properties__: {get_topLevelPopUpCount:"get_topLevelPopUpCount",get_popUpCount:"get_popUpCount",set_root:"set_root",get_root:"get_root",set_overlayFactory:"set_overlayFactory",get_overlayFactory:"get_overlayFactory"}
};
var feathers_core_DefaultPopUpManager = function(root) {
	this._popUpToOverlay = new haxe_ds_ObjectMap();
	this._centeredPopUps = [];
	this.popUps = [];
	this._ignoreRemoval = false;
	this.set_root(root);
};
$hxClasses["feathers.core.DefaultPopUpManager"] = feathers_core_DefaultPopUpManager;
feathers_core_DefaultPopUpManager.__name__ = "feathers.core.DefaultPopUpManager";
feathers_core_DefaultPopUpManager.__interfaces__ = [feathers_core_IPopUpManager];
feathers_core_DefaultPopUpManager.defaultOverlayFactory = function() {
	var overlay = new openfl_display_Sprite();
	overlay.get_graphics().beginFill(8421504,0.75);
	overlay.get_graphics().drawRect(0,0,1,1);
	overlay.get_graphics().endFill();
	return overlay;
};
feathers_core_DefaultPopUpManager.prototype = {
	_ignoreRemoval: null
	,_root: null
	,get_root: function() {
		return this._root;
	}
	,set_root: function(value) {
		if(this._root == value) {
			return this._root;
		}
		if(value.stage == null) {
			throw new openfl_errors_ArgumentError("DefaultPopUpManager root's stage property must not be null.");
		}
		var oldIgnoreRemoval = this._ignoreRemoval;
		this._ignoreRemoval = true;
		var _g = 0;
		var _g1 = this.popUps;
		while(_g < _g1.length) {
			var popUp = _g1[_g];
			++_g;
			this._root.removeChild(popUp);
			var overlay = this._popUpToOverlay.h[popUp.__id__];
			if(overlay != null) {
				this._root.removeChild(overlay);
			}
		}
		this._ignoreRemoval = oldIgnoreRemoval;
		this._root = value;
		var _g = 0;
		var _g1 = this.popUps;
		while(_g < _g1.length) {
			var popUp = _g1[_g];
			++_g;
			var overlay = this._popUpToOverlay.h[popUp.__id__];
			if(overlay != null) {
				this._root.addChild(overlay);
			}
			this._root.addChild(popUp);
		}
		return this._root;
	}
	,popUps: null
	,_centeredPopUps: null
	,_popUpToOverlay: null
	,_overlayFactory: null
	,get_overlayFactory: function() {
		return this._overlayFactory;
	}
	,set_overlayFactory: function(value) {
		if(this._overlayFactory == value) {
			return this._overlayFactory;
		}
		this._overlayFactory = value;
		return this._overlayFactory;
	}
	,get_popUpCount: function() {
		return this.popUps.length;
	}
	,get_topLevelPopUpCount: function() {
		var count = 0;
		var i = this.popUps.length - 1;
		while(i >= 0) {
			++count;
			var popUp = this.popUps[i];
			var overlay = this._popUpToOverlay.h[popUp.__id__];
			if(overlay != null) {
				return count;
			}
			--i;
		}
		return count;
	}
	,getPopUpAt: function(index) {
		return this.popUps[index];
	}
	,isPopUp: function(target) {
		return this.popUps.indexOf(target) != -1;
	}
	,isTopLevelPopUp: function(target) {
		var i = this.popUps.length - 1;
		while(i >= 0) {
			var otherPopUp = this.popUps[i];
			if(otherPopUp == target) {
				return true;
			}
			var overlay = this._popUpToOverlay.h[otherPopUp.__id__];
			if(overlay != null) {
				return false;
			}
			--i;
		}
		return false;
	}
	,isModal: function(target) {
		if(target == null) {
			return false;
		}
		return this._popUpToOverlay.h[target.__id__] != null;
	}
	,hasModalPopUps: function() {
		var map = this._popUpToOverlay;
		var inlMapKeyValueIterator_map = map;
		var inlMapKeyValueIterator_keys = map.keys();
		return inlMapKeyValueIterator_keys.hasNext();
	}
	,addPopUp: function(popUp,isModal,isCentered,customOverlayFactory) {
		if(isCentered == null) {
			isCentered = true;
		}
		if(isModal == null) {
			isModal = true;
		}
		var index = this.popUps.indexOf(popUp);
		if(index != -1) {
			this.cleanupOverlay(popUp);
			this.popUps.splice(index,1);
		}
		if(isModal) {
			if(customOverlayFactory == null) {
				customOverlayFactory = this._overlayFactory;
			}
			if(customOverlayFactory == null) {
				customOverlayFactory = feathers_core_DefaultPopUpManager.defaultOverlayFactory;
			}
			var overlay = customOverlayFactory();
			var stage = this._root.stage;
			var stageTopLeft = this._root.globalToLocal(new openfl_geom_Point());
			var stageBottomRight = this._root.globalToLocal(new openfl_geom_Point(stage.stageWidth,stage.stageHeight));
			overlay.set_x(stageTopLeft.x);
			overlay.set_y(stageTopLeft.y);
			overlay.set_width(stageBottomRight.x - stageTopLeft.x);
			overlay.set_height(stageBottomRight.y - stageTopLeft.y);
			this._root.addChild(overlay);
			this._popUpToOverlay.set(popUp,overlay);
		}
		this.popUps.push(popUp);
		var result = this._root.addChild(popUp);
		if(popUp.parent == null) {
			this.cleanupOverlay(popUp);
			HxOverrides.remove(this.popUps,popUp);
			return null;
		}
		popUp.addEventListener("removedFromStage",$bind(this,this.defaultPopUpManager_popUp_removedFromStageHandler));
		if(this.popUps.length == 1) {
			this._root.stage.addEventListener("resize",$bind(this,this.defaultPopUpManager_stage_resizeHandler),false,0,true);
		}
		if(isCentered) {
			if(js_Boot.__implements(popUp,feathers_core_IMeasureObject)) {
				var measurePopUp = popUp;
				measurePopUp.addEventListener("resize",$bind(this,this.defaultPopUpManager_popUp_resizeHandler));
			}
			this._centeredPopUps.push(popUp);
			this.centerPopUp(popUp);
		}
		return result;
	}
	,removePopUp: function(popUp) {
		var index = this.popUps.indexOf(popUp);
		if(index == -1) {
			return popUp;
		}
		return this._root.removeChild(popUp);
	}
	,removeAllPopUps: function() {
		var popUps = this.popUps.slice();
		var _g = 0;
		while(_g < popUps.length) {
			var popUp = popUps[_g];
			++_g;
			if(this.isPopUp(popUp)) {
				this.removePopUp(popUp);
			}
		}
	}
	,centerPopUp: function(popUp) {
		if(js_Boot.__implements(popUp,feathers_core_IValidating)) {
			popUp.validateNow();
		}
		var stage = this._root.stage;
		var stageTopLeft = this._root.globalToLocal(new openfl_geom_Point());
		var stageBottomRight = this._root.globalToLocal(new openfl_geom_Point(stage.stageWidth,stage.stageHeight));
		popUp.set_x(stageTopLeft.x + (stageBottomRight.x - stageTopLeft.x - popUp.get_width()) / 2.0);
		popUp.set_y(stageTopLeft.y + (stageBottomRight.y - stageTopLeft.y - popUp.get_height()) / 2.0);
	}
	,bringToFront: function(popUp) {
		if(!HxOverrides.remove(this.popUps,popUp)) {
			throw new openfl_errors_Error("Not a popup");
		}
		this.popUps.push(popUp);
		var overlay = this._popUpToOverlay.h[popUp.__id__];
		if(overlay != null) {
			this._root.setChildIndex(overlay,this._root.get_numChildren() - 1);
		}
		this._root.setChildIndex(popUp,this._root.get_numChildren() - 1);
	}
	,cleanupOverlay: function(popUp) {
		var overlay = this._popUpToOverlay.h[popUp.__id__];
		if(overlay == null) {
			return;
		}
		this._root.removeChild(overlay);
		this._popUpToOverlay.remove(popUp);
	}
	,defaultPopUpManager_popUp_removedFromStageHandler: function(event) {
		if(this._ignoreRemoval) {
			return;
		}
		var popUp = js_Boot.__cast(event.currentTarget , openfl_display_DisplayObject);
		popUp.removeEventListener("removedFromStage",$bind(this,this.defaultPopUpManager_popUp_removedFromStageHandler));
		HxOverrides.remove(this.popUps,popUp);
		this.cleanupOverlay(popUp);
		if(this.popUps.length == 0) {
			this._root.stage.removeEventListener("resize",$bind(this,this.defaultPopUpManager_stage_resizeHandler));
		}
	}
	,defaultPopUpManager_popUp_resizeHandler: function(event) {
		var popUp = js_Boot.__cast(event.currentTarget , openfl_display_DisplayObject);
		this.centerPopUp(popUp);
	}
	,defaultPopUpManager_stage_resizeHandler: function(event) {
		var stage = js_Boot.__cast(event.currentTarget , openfl_display_Stage);
		var stageTopLeft = this._root.globalToLocal(new openfl_geom_Point());
		var stageBottomRight = this._root.globalToLocal(new openfl_geom_Point(stage.stageWidth,stage.stageHeight));
		var _g = 0;
		var _g1 = this.popUps;
		while(_g < _g1.length) {
			var popUp = _g1[_g];
			++_g;
			var overlay = this._popUpToOverlay.h[popUp.__id__];
			if(overlay != null) {
				overlay.set_x(stageTopLeft.x);
				overlay.set_y(stageTopLeft.y);
				overlay.set_width(stageBottomRight.x - stageTopLeft.x);
				overlay.set_height(stageBottomRight.y - stageTopLeft.y);
			}
		}
		var _g = 0;
		var _g1 = this._centeredPopUps;
		while(_g < _g1.length) {
			var popUp = _g1[_g];
			++_g;
			this.centerPopUp(popUp);
		}
	}
	,__class__: feathers_core_DefaultPopUpManager
	,__properties__: {get_topLevelPopUpCount:"get_topLevelPopUpCount",get_popUpCount:"get_popUpCount",set_overlayFactory:"set_overlayFactory",get_overlayFactory:"get_overlayFactory",set_root:"set_root",get_root:"get_root"}
};
var feathers_core_IToolTipManager = function() { };
$hxClasses["feathers.core.IToolTipManager"] = feathers_core_IToolTipManager;
feathers_core_IToolTipManager.__name__ = "feathers.core.IToolTipManager";
feathers_core_IToolTipManager.__isInterface__ = true;
feathers_core_IToolTipManager.prototype = {
	get_root: null
	,dispose: null
	,__class__: feathers_core_IToolTipManager
	,__properties__: {get_root:"get_root"}
};
var feathers_core_DefaultToolTipManager = function(root) {
	this._offsetY = 0.0;
	this._offsetX = 0.0;
	this._hideTime = -1;
	this._delay = 0.5;
	this._delayTimeoutID = null;
	this.initializeToolTipStyles();
	this._root = root;
	this._root.addEventListener("mouseMove",$bind(this,this.defaultToolTipManager_root_mouseMoveHandler),false,0,true);
};
$hxClasses["feathers.core.DefaultToolTipManager"] = feathers_core_DefaultToolTipManager;
feathers_core_DefaultToolTipManager.__name__ = "feathers.core.DefaultToolTipManager";
feathers_core_DefaultToolTipManager.__interfaces__ = [feathers_core_IToolTipManager];
feathers_core_DefaultToolTipManager.prototype = {
	_root: null
	,get_root: function() {
		return this._root;
	}
	,_target: null
	,_toolTip: null
	,_toolTipStageX: null
	,_toolTipStageY: null
	,_delayTimeoutID: null
	,_delay: null
	,_hideTime: null
	,_offsetX: null
	,_offsetY: null
	,dispose: function() {
		this.clearTarget();
		if(this._root != null) {
			this._root.removeEventListener("mouseMove",$bind(this,this.defaultToolTipManager_root_mouseMoveHandler));
			this._root = null;
		}
	}
	,initializeToolTipStyles: function() {
		feathers_themes_steel_components_SteelToolTipStyles.initialize();
	}
	,clearTarget: function() {
		this.hideToolTip();
		if(this._target != null) {
			this._target.removeEventListener("mouseDown",$bind(this,this.defaultToolTipManager_target_mouseDownHandler));
			this._target.removeEventListener("rightMouseDown",$bind(this,this.defaultToolTipManager_target_rightMouseDownHandler));
			this._target.removeEventListener("middleMouseDown",$bind(this,this.defaultToolTipManager_target_middleMouseDownHandler));
			this._target.removeEventListener("rollOut",$bind(this,this.defaultToolTipManager_target_rollOutHandler));
			this._target.removeEventListener("removedFromStage",$bind(this,this.defaultToolTipManager_target_removedFromStageHandler));
			this._target = null;
		}
	}
	,hideToolTip: function() {
		if(this._delayTimeoutID != null) {
			openfl_Lib.clearTimeout(this._delayTimeoutID);
			this._delayTimeoutID = null;
		}
		if(this._toolTip != null && this._toolTip.parent != null) {
			feathers_core_PopUpManager.removePopUp(js_Boot.__cast(this._toolTip , openfl_display_DisplayObject));
			this._hideTime = openfl_Lib.getTimer();
		}
	}
	,hoverDelayCallback: function() {
		this._delayTimeoutID = null;
		if(this._target.get_toolTip() == null) {
			return;
		}
		if(this._toolTip == null) {
			var toolTip = new feathers_controls_Label();
			toolTip.set_variant(feathers_core_DefaultToolTipManager.CHILD_VARIANT_TOOL_TIP);
			this._toolTip = toolTip;
		}
		if(((this._toolTip) instanceof openfl_display_InteractiveObject)) {
			var interactiveToolTip = this._toolTip;
			interactiveToolTip.mouseEnabled = false;
			interactiveToolTip.set_tabEnabled(false);
		}
		if(((this._toolTip) instanceof openfl_display_DisplayObjectContainer)) {
			this._toolTip.mouseChildren = false;
		}
		if(js_Boot.__implements(this._toolTip,feathers_style_IVariantStyleObject)) {
			var variantToolTip = this._toolTip;
			if(variantToolTip.get_variant() == null) {
				variantToolTip.set_variant(feathers_core_DefaultToolTipManager.CHILD_VARIANT_TOOL_TIP);
			}
		}
		this._toolTip.set_text(this._target.get_toolTip());
		if(js_Boot.__implements(this._toolTip,feathers_core_IValidating)) {
			this._toolTip.validateNow();
		}
		var stage = this._target.stage;
		var popUpManager = feathers_core_PopUpManager.forStage(stage);
		var position = popUpManager.get_root().globalToLocal(new openfl_geom_Point(this._toolTipStageX,this._toolTipStageY));
		var dimensions = popUpManager.get_root().globalToLocal(new openfl_geom_Point(stage.stageWidth,stage.stageHeight));
		var toolTipX = position.x + this._offsetX;
		if(toolTipX < 0.0) {
			toolTipX = 0.0;
		} else if(toolTipX + this._toolTip.get_width() > dimensions.x) {
			toolTipX = dimensions.x - this._toolTip.get_width();
		}
		var toolTipY = position.y - this._toolTip.get_height() + this._offsetY;
		if(toolTipY < 0.0) {
			toolTipY = 0.0;
		} else if(toolTipY + this._toolTip.get_height() > dimensions.y) {
			toolTipY = dimensions.y - this._toolTip.get_height();
		}
		this._toolTip.set_x(toolTipX);
		this._toolTip.set_y(toolTipY);
		feathers_core_PopUpManager.addPopUp(js_Boot.__cast(this._toolTip , openfl_display_DisplayObject),js_Boot.__cast(this._target , openfl_display_DisplayObject),false,false);
	}
	,defaultToolTipManager_root_mouseMoveHandler: function(event) {
		if(event.buttonDown) {
			return;
		}
		var eventTarget = js_Boot.__cast(event.target , openfl_display_DisplayObject);
		while(eventTarget != null && !js_Boot.__implements(eventTarget,feathers_core_IUIControl)) eventTarget = eventTarget.parent;
		if(!js_Boot.__implements(eventTarget,feathers_core_IUIControl)) {
			this.clearTarget();
			return;
		}
		var uiTarget = eventTarget;
		if(this._target == uiTarget) {
			this._toolTipStageX = event.stageX;
			this._toolTipStageY = event.stageY;
			return;
		}
		this.clearTarget();
		this._target = uiTarget;
		if(this._target.get_toolTip() == null) {
			this._target = null;
			return;
		}
		this._target.addEventListener("mouseDown",$bind(this,this.defaultToolTipManager_target_mouseDownHandler),false,0,true);
		this._target.addEventListener("rightMouseDown",$bind(this,this.defaultToolTipManager_target_rightMouseDownHandler),false,0,true);
		this._target.addEventListener("middleMouseDown",$bind(this,this.defaultToolTipManager_target_middleMouseDownHandler),false,0,true);
		this._target.addEventListener("rollOut",$bind(this,this.defaultToolTipManager_target_rollOutHandler),false,0,true);
		this._target.addEventListener("removedFromStage",$bind(this,this.defaultToolTipManager_target_removedFromStageHandler),false,0,true);
		this._toolTipStageX = event.stageX;
		this._toolTipStageY = event.stageY;
		this._delayTimeoutID = openfl_Lib.setTimeout($bind(this,this.hoverDelayCallback),this._delay * 1000.0 | 0);
	}
	,defaultToolTipManager_target_mouseDownHandler: function(event) {
		this.hideToolTip();
	}
	,defaultToolTipManager_target_rightMouseDownHandler: function(event) {
		this.hideToolTip();
	}
	,defaultToolTipManager_target_middleMouseDownHandler: function(event) {
		this.hideToolTip();
	}
	,defaultToolTipManager_target_rollOutHandler: function(event) {
		this.clearTarget();
	}
	,defaultToolTipManager_target_removedFromStageHandler: function(event) {
		this.clearTarget();
	}
	,__class__: feathers_core_DefaultToolTipManager
	,__properties__: {get_root:"get_root"}
};
var feathers_core__$FeathersControl_StyleDefinition = $hxEnums["feathers.core._FeathersControl.StyleDefinition"] = { __ename__:"feathers.core._FeathersControl.StyleDefinition",__constructs__:null
	,Name: ($_=function(name) { return {_hx_index:0,name:name,__enum__:"feathers.core._FeathersControl.StyleDefinition",toString:$estr}; },$_._hx_name="Name",$_.__params__ = ["name"],$_)
	,NameAndState: ($_=function(name,state) { return {_hx_index:1,name:name,state:state,__enum__:"feathers.core._FeathersControl.StyleDefinition",toString:$estr}; },$_._hx_name="NameAndState",$_.__params__ = ["name","state"],$_)
};
feathers_core__$FeathersControl_StyleDefinition.__constructs__ = [feathers_core__$FeathersControl_StyleDefinition.Name,feathers_core__$FeathersControl_StyleDefinition.NameAndState];
var feathers_core_FocusManager = function() { };
$hxClasses["feathers.core.FocusManager"] = feathers_core_FocusManager;
feathers_core_FocusManager.__name__ = "feathers.core.FocusManager";
feathers_core_FocusManager.__properties__ = {set_focusManagerFactory:"set_focusManagerFactory",get_focusManagerFactory:"get_focusManagerFactory"};
feathers_core_FocusManager.defaultFocusManagerFactory = function(root) {
	return new feathers_core_DefaultFocusManager(root);
};
feathers_core_FocusManager.get_focusManagerFactory = function() {
	return feathers_core_FocusManager._focusManagerFactory;
};
feathers_core_FocusManager.set_focusManagerFactory = function(value) {
	if(value == null) {
		feathers_core_FocusManager._focusManagerFactory = feathers_core_FocusManager.defaultFocusManagerFactory;
	}
	if(feathers_core_FocusManager._focusManagerFactory == value) {
		return feathers_core_FocusManager._focusManagerFactory;
	}
	feathers_core_FocusManager._focusManagerFactory = value;
	return feathers_core_FocusManager._focusManagerFactory;
};
feathers_core_FocusManager.hasRoot = function(stage) {
	return feathers_core_FocusManager.stageToManager.h.__keys__[stage.__id__] != null;
};
feathers_core_FocusManager.addRoot = function(stage) {
	if(stage == null) {
		throw new openfl_errors_ArgumentError("FocusManager stage argument must not be null.");
	}
	if(feathers_core_FocusManager.stageToManager.h.__keys__[stage.__id__] != null) {
		throw new openfl_errors_ArgumentError("Focus manager root already exists");
	}
	var focusManager = feathers_core_FocusManager.stageToManager.h[stage.__id__];
	var factory = feathers_core_FocusManager.get_focusManagerFactory();
	if(factory == null) {
		factory = feathers_core_FocusManager.defaultFocusManagerFactory;
	}
	focusManager = factory(stage);
	focusManager.addEventListener("clear",feathers_core_FocusManager.focusManager_clearHandler,false,0,true);
	feathers_core_FocusManager.stageToManager.set(stage,focusManager);
	return focusManager;
};
feathers_core_FocusManager.removeRoot = function(stage) {
	var focusManager = feathers_core_FocusManager.stageToManager.h[stage.__id__];
	if(focusManager == null) {
		return;
	}
	focusManager.dispose();
};
feathers_core_FocusManager.dispose = function() {
	var stage = feathers_core_FocusManager.stageToManager.keys();
	while(stage.hasNext()) {
		var stage1 = stage.next();
		var focusManager = feathers_core_FocusManager.stageToManager.h[stage1.__id__];
		focusManager.dispose();
		feathers_core_FocusManager.stageToManager.remove(stage1);
	}
};
feathers_core_FocusManager.setFocus = function(focusable) {
	var focusManager = focusable.get_focusManager();
	if(focusManager == null) {
		throw new openfl_errors_ArgumentError("Cannot set focus because focus manager is null.");
	}
	focusManager.set_focus(focusable);
};
feathers_core_FocusManager.focusManager_clearHandler = function(event) {
	var focusManager = js_Boot.__cast(event.currentTarget , feathers_core_IFocusManager);
	focusManager.removeEventListener("clear",feathers_core_FocusManager.focusManager_clearHandler);
	var value = focusManager.get_root();
	var stage = ((value) instanceof openfl_display_Stage) ? value : null;
	if(stage != null) {
		feathers_core_FocusManager.stageToManager.remove(stage);
	}
};
feathers_core_FocusManager.prototype = {
	FocusManager: function() {
	}
	,__class__: feathers_core_FocusManager
};
var feathers_core_IScaleManager = function() { };
$hxClasses["feathers.core.IScaleManager"] = feathers_core_IScaleManager;
feathers_core_IScaleManager.__name__ = "feathers.core.IScaleManager";
feathers_core_IScaleManager.__isInterface__ = true;
feathers_core_IScaleManager.__interfaces__ = [openfl_events_IEventDispatcher];
feathers_core_IScaleManager.prototype = {
	get_target: null
	,set_target: null
	,getScale: null
	,getBounds: null
	,__class__: feathers_core_IScaleManager
	,__properties__: {set_target:"set_target",get_target:"get_target"}
};
var feathers_core_PopUpManager = function() { };
$hxClasses["feathers.core.PopUpManager"] = feathers_core_PopUpManager;
feathers_core_PopUpManager.__name__ = "feathers.core.PopUpManager";
feathers_core_PopUpManager.__properties__ = {get_popUpCount:"get_popUpCount",set_root:"set_root"};
feathers_core_PopUpManager.set_root = function(value) {
	var popUpManager = feathers_core_PopUpManager.forStage(value.stage);
	popUpManager.set_root(value);
	return value;
};
feathers_core_PopUpManager.get_popUpCount = function() {
	var count = 0;
	var popUpManager = feathers_core_PopUpManager.stageToManager.iterator();
	while(popUpManager.hasNext()) {
		var popUpManager1 = popUpManager.next();
		count += popUpManager1.get_popUpCount();
	}
	return count;
};
feathers_core_PopUpManager.forStage = function(stage) {
	if(stage == null) {
		throw new openfl_errors_ArgumentError("PopUpManager stage argument must not be null.");
	}
	var popUpManager = feathers_core_PopUpManager.stageToManager.h[stage.__id__];
	if(popUpManager == null) {
		var factory = feathers_core_PopUpManager.popUpManagerFactory;
		if(factory == null) {
			factory = feathers_core_PopUpManager.defaultPopUpManagerFactory;
		}
		popUpManager = factory(stage);
		feathers_core_PopUpManager.stageToManager.set(stage,popUpManager);
	}
	return popUpManager;
};
feathers_core_PopUpManager.dispose = function() {
	feathers_core_PopUpManager.removeAllPopUps();
	var stage = feathers_core_PopUpManager.stageToManager.keys();
	while(stage.hasNext()) {
		var stage1 = stage.next();
		feathers_core_PopUpManager.stageToManager.remove(stage1);
	}
};
feathers_core_PopUpManager.addPopUp = function(popUp,owner,isModal,isCentered,customOverlayFactory) {
	if(isCentered == null) {
		isCentered = true;
	}
	if(isModal == null) {
		isModal = true;
	}
	if(owner == null) {
		throw new openfl_errors_ArgumentError("The pop-up's owner must not be null.");
	}
	var stage = owner.stage;
	if(stage == null) {
		throw new openfl_errors_ArgumentError("The stage property of a pop-up's owner must not be null.");
	}
	var popUpManager = feathers_core_PopUpManager.forStage(stage);
	return popUpManager.addPopUp(popUp,isModal,isCentered,customOverlayFactory);
};
feathers_core_PopUpManager.removePopUp = function(popUp) {
	var stage = popUp.stage;
	if(stage == null) {
		return popUp;
	}
	var popUpManager = feathers_core_PopUpManager.forStage(stage);
	return popUpManager.removePopUp(popUp);
};
feathers_core_PopUpManager.removeAllPopUps = function() {
	var popUpManager = feathers_core_PopUpManager.stageToManager.iterator();
	while(popUpManager.hasNext()) {
		var popUpManager1 = popUpManager.next();
		popUpManager1.removeAllPopUps();
	}
};
feathers_core_PopUpManager.centerPopUp = function(target) {
	var stage = target.stage;
	if(stage == null) {
		throw new openfl_errors_ArgumentError("A pop-up's stage property must not be null.");
	}
	var popUpManager = feathers_core_PopUpManager.forStage(stage);
	popUpManager.centerPopUp(target);
};
feathers_core_PopUpManager.bringToFront = function(target) {
	var stage = target.stage;
	if(stage == null) {
		throw new openfl_errors_ArgumentError("A pop-up's stage property must not be null.");
	}
	var popUpManager = feathers_core_PopUpManager.forStage(stage);
	popUpManager.bringToFront(target);
};
feathers_core_PopUpManager.isPopUp = function(target) {
	if(target == null) {
		return false;
	}
	var stage = target.stage;
	if(stage == null) {
		return false;
	}
	var popUpManager = feathers_core_PopUpManager.forStage(stage);
	return popUpManager.isPopUp(target);
};
feathers_core_PopUpManager.isModal = function(target) {
	if(target == null) {
		return false;
	}
	var stage = target.stage;
	if(stage == null) {
		return false;
	}
	var popUpManager = feathers_core_PopUpManager.forStage(stage);
	return popUpManager.isModal(target);
};
feathers_core_PopUpManager.isTopLevelPopUp = function(target) {
	if(target == null) {
		return false;
	}
	var stage = target.stage;
	if(stage == null) {
		return false;
	}
	var popUpManager = feathers_core_PopUpManager.forStage(stage);
	return popUpManager.isTopLevelPopUp(target);
};
feathers_core_PopUpManager.defaultPopUpManagerFactory = function(stage) {
	return new feathers_core_DefaultPopUpManager(stage);
};
var feathers_core_ScreenDensityScaleManager = function(scaler) {
	openfl_events_EventDispatcher.call(this);
	this._scaler = scaler;
};
$hxClasses["feathers.core.ScreenDensityScaleManager"] = feathers_core_ScreenDensityScaleManager;
feathers_core_ScreenDensityScaleManager.__name__ = "feathers.core.ScreenDensityScaleManager";
feathers_core_ScreenDensityScaleManager.__interfaces__ = [feathers_core_IScaleManager];
feathers_core_ScreenDensityScaleManager.__super__ = openfl_events_EventDispatcher;
feathers_core_ScreenDensityScaleManager.prototype = $extend(openfl_events_EventDispatcher.prototype,{
	_target: null
	,get_target: function() {
		return this._target;
	}
	,set_target: function(value) {
		if(this._target == value) {
			return this._target;
		}
		if(this._target != null) {
			this.removeTargetStageListeners();
			this._target.removeEventListener("addedToStage",$bind(this,this.screenDensityScaleManager_target_addedToStageHandler));
			this._target.removeEventListener("removedFromStage",$bind(this,this.screenDensityScaleManager_target_removedFromStageHandler));
		}
		this._target = value;
		if(this._target != null) {
			this._target.addEventListener("addedToStage",$bind(this,this.screenDensityScaleManager_target_addedToStageHandler),false,0,true);
			this._target.addEventListener("removedFromStage",$bind(this,this.screenDensityScaleManager_target_removedFromStageHandler),false,0,true);
			this.addTargetStageListeners();
		}
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._target;
	}
	,_scaler: null
	,get_scaler: function() {
		return this._scaler;
	}
	,set_scaler: function(value) {
		if(this._scaler == value) {
			return this._scaler;
		}
		this._scaler = value;
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._scaler;
	}
	,getScale: function() {
		var result = 1.0;
		if(this._target == null) {
			return result;
		}
		var jsWindow = js_Boot.__cast($global , Window);
		var viewportElement = jsWindow.document.getElementById("viewport");
		if(viewportElement != null && viewportElement.localName == "meta") {
			var content = viewportElement.getAttribute("content");
			if(content.indexOf("user-scalable=no") != -1) {
				var initialScalePattern = new EReg("initial-scale=(\\d(?:\\.\\d+)?)","");
				if(initialScalePattern.match(content)) {
					var initialScale = parseFloat(initialScalePattern.matched(1));
					result *= 1.0 / initialScale;
				}
			}
		}
		return result;
	}
	,getBounds: function() {
		var bounds = new openfl_geom_Rectangle();
		if(this._target == null) {
			return bounds;
		}
		var stage = this._target.stage;
		if(stage == null) {
			return bounds;
		}
		var needsToBeDivisibleByTwo = Math.floor(this._target.get_scaleX()) != this._target.get_scaleX();
		var appWidth = Math.floor(stage.stageWidth);
		if(needsToBeDivisibleByTwo) {
			appWidth = feathers_utils_MathUtil.roundDownToNearest(appWidth,2);
		}
		bounds.width = appWidth;
		var appHeight = Math.floor(stage.stageHeight);
		if(needsToBeDivisibleByTwo) {
			appHeight = feathers_utils_MathUtil.roundDownToNearest(appHeight,2);
		}
		bounds.height = appHeight;
		return bounds;
	}
	,addTargetStageListeners: function() {
		if(this._target == null || this._target.stage == null) {
			return;
		}
		this._target.stage.addEventListener("resize",$bind(this,this.screenDensityScaleManager_stage_resizeHandler),false,0,true);
	}
	,removeTargetStageListeners: function() {
		if(this._target == null || this._target.stage == null) {
			return;
		}
		this._target.stage.removeEventListener("resize",$bind(this,this.screenDensityScaleManager_stage_resizeHandler));
	}
	,screenDensityScaleManager_target_addedToStageHandler: function(event) {
		this.addTargetStageListeners();
	}
	,screenDensityScaleManager_target_removedFromStageHandler: function(event) {
		this.removeTargetStageListeners();
	}
	,screenDensityScaleManager_stage_resizeHandler: function(event) {
		feathers_events_FeathersEvent.dispatch(this,"change");
	}
	,__class__: feathers_core_ScreenDensityScaleManager
	,__properties__: {set_scaler:"set_scaler",get_scaler:"get_scaler",set_target:"set_target",get_target:"get_target"}
});
var feathers_core_ToolTipManager = function() { };
$hxClasses["feathers.core.ToolTipManager"] = feathers_core_ToolTipManager;
feathers_core_ToolTipManager.__name__ = "feathers.core.ToolTipManager";
feathers_core_ToolTipManager.__properties__ = {set_toolTipManagerFactory:"set_toolTipManagerFactory",get_toolTipManagerFactory:"get_toolTipManagerFactory"};
feathers_core_ToolTipManager.defaultToolTipManagerFactory = function(root) {
	return new feathers_core_DefaultToolTipManager(root);
};
feathers_core_ToolTipManager.get_toolTipManagerFactory = function() {
	return feathers_core_ToolTipManager._toolTipManagerFactory;
};
feathers_core_ToolTipManager.set_toolTipManagerFactory = function(value) {
	if(value == null) {
		feathers_core_ToolTipManager._toolTipManagerFactory = feathers_core_ToolTipManager.defaultToolTipManagerFactory;
	}
	if(feathers_core_ToolTipManager._toolTipManagerFactory == value) {
		return feathers_core_ToolTipManager._toolTipManagerFactory;
	}
	feathers_core_ToolTipManager._toolTipManagerFactory = value;
	return feathers_core_ToolTipManager._toolTipManagerFactory;
};
feathers_core_ToolTipManager.hasRoot = function(stage) {
	return feathers_core_ToolTipManager.stageToManager.h.__keys__[stage.__id__] != null;
};
feathers_core_ToolTipManager.forRoot = function(stage) {
	return feathers_core_ToolTipManager.stageToManager.h[stage.__id__];
};
feathers_core_ToolTipManager.addRoot = function(stage) {
	if(stage == null) {
		throw new openfl_errors_ArgumentError("ToolTipManager stage argument must not be null.");
	}
	if(feathers_core_ToolTipManager.stageToManager.h.__keys__[stage.__id__] != null) {
		throw new openfl_errors_ArgumentError("Tool tip manager root already exists");
	}
	var toolTipManager = feathers_core_ToolTipManager.stageToManager.h[stage.__id__];
	var factory = feathers_core_ToolTipManager.get_toolTipManagerFactory();
	if(factory == null) {
		factory = feathers_core_ToolTipManager.defaultToolTipManagerFactory;
	}
	toolTipManager = factory(stage);
	feathers_core_ToolTipManager.stageToManager.set(stage,toolTipManager);
	return toolTipManager;
};
feathers_core_ToolTipManager.removeRoot = function(stage) {
	var toolTipManager = feathers_core_ToolTipManager.stageToManager.h[stage.__id__];
	if(toolTipManager == null) {
		return;
	}
	toolTipManager.dispose();
	feathers_core_ToolTipManager.stageToManager.remove(stage);
};
feathers_core_ToolTipManager.dispose = function() {
	var stage = feathers_core_ToolTipManager.stageToManager.keys();
	while(stage.hasNext()) {
		var stage1 = stage.next();
		feathers_core_ToolTipManager.stageToManager.remove(stage1);
	}
};
feathers_core_ToolTipManager.prototype = {
	ToolTipManager: function() {
	}
	,__class__: feathers_core_ToolTipManager
};
var feathers_core_ValidationQueue = function(stage) {
	this._validating = false;
	this._queue = [];
	this._stage = null;
	this._stage = stage;
	this._stage.addEventListener("render",$bind(this,this.validationQueue_stage_renderHandler),false,-1000,true);
};
$hxClasses["feathers.core.ValidationQueue"] = feathers_core_ValidationQueue;
feathers_core_ValidationQueue.__name__ = "feathers.core.ValidationQueue";
feathers_core_ValidationQueue.forStage = function(stage) {
	if(stage == null) {
		return null;
	}
	if(feathers_core_ValidationQueue.STAGE_TO_VALIDATION_QUEUE.h.__keys__[stage.__id__] == null) {
		feathers_core_ValidationQueue.STAGE_TO_VALIDATION_QUEUE.set(stage,new feathers_core_ValidationQueue(stage));
	}
	return feathers_core_ValidationQueue.STAGE_TO_VALIDATION_QUEUE.h[stage.__id__];
};
feathers_core_ValidationQueue.prototype = {
	_stage: null
	,_queue: null
	,_validating: null
	,get_validating: function() {
		return this._validating;
	}
	,dispose: function() {
		if(this._stage == null) {
			return;
		}
		this._stage.removeEventListener("render",$bind(this,this.validationQueue_stage_renderHandler));
		this._stage = null;
	}
	,addControl: function(control) {
		if(this._queue.indexOf(control) != -1) {
			return;
		}
		var queueLength = this._queue.length;
		if(this._validating) {
			var depth = control.get_depth();
			var i = queueLength - 1;
			while(i >= 0) {
				var otherControl = this._queue[i];
				var otherDepth = otherControl.get_depth();
				if(depth >= otherDepth) {
					break;
				}
				--i;
			}
			++i;
			this._queue.splice(i,0,control);
		} else {
			this._queue[queueLength] = control;
			this._stage.invalidate();
		}
	}
	,validateNow: function() {
		if(this._validating) {
			return;
		}
		var queueLength = this._queue.length;
		if(queueLength == 0) {
			return;
		}
		this._validating = true;
		if(queueLength > 1) {
			this._queue.sort(function(first,second) {
				var difference = second.get_depth() - first.get_depth();
				if(difference > 0) {
					return -1;
				} else if(difference < 0) {
					return 1;
				}
				return 0;
			});
		}
		while(this._queue.length > 0) {
			var item = this._queue.shift();
			if(item.get_depth() < 0) {
				continue;
			}
			item.validateNow();
		}
		this._validating = false;
	}
	,validationQueue_stage_renderHandler: function(event) {
		this.validateNow();
	}
	,__class__: feathers_core_ValidationQueue
	,__properties__: {get_validating:"get_validating"}
};
var openfl_utils_IExternalizable = function() { };
$hxClasses["openfl.utils.IExternalizable"] = openfl_utils_IExternalizable;
openfl_utils_IExternalizable.__name__ = "openfl.utils.IExternalizable";
openfl_utils_IExternalizable.__isInterface__ = true;
openfl_utils_IExternalizable.prototype = {
	readExternal: null
	,writeExternal: null
	,__class__: openfl_utils_IExternalizable
};
var feathers_data_IFlatCollection = function() { };
$hxClasses["feathers.data.IFlatCollection"] = feathers_data_IFlatCollection;
feathers_data_IFlatCollection.__name__ = "feathers.data.IFlatCollection";
feathers_data_IFlatCollection.__isInterface__ = true;
feathers_data_IFlatCollection.__interfaces__ = [openfl_events_IEventDispatcher];
feathers_data_IFlatCollection.prototype = {
	get_length: null
	,get_filterFunction: null
	,set_filterFunction: null
	,get_sortCompareFunction: null
	,set_sortCompareFunction: null
	,get: null
	,set: null
	,add: null
	,addAt: null
	,addAll: null
	,addAllAt: null
	,reset: null
	,remove: null
	,removeAt: null
	,removeAll: null
	,indexOf: null
	,contains: null
	,updateAt: null
	,updateAll: null
	,iterator: null
	,refresh: null
	,__class__: feathers_data_IFlatCollection
	,__properties__: {set_sortCompareFunction:"set_sortCompareFunction",get_sortCompareFunction:"get_sortCompareFunction",set_filterFunction:"set_filterFunction",get_filterFunction:"get_filterFunction",get_length:"get_length"}
};
var feathers_data_ArrayCollection = function(array) {
	this._sortCompareFunction = null;
	this._filterFunction = null;
	this._pendingRefresh = false;
	this._array = null;
	this._filterAndSortData = null;
	openfl_events_EventDispatcher.call(this);
	if(array == null) {
		array = [];
	}
	this.set_array(array);
};
$hxClasses["feathers.data.ArrayCollection"] = feathers_data_ArrayCollection;
feathers_data_ArrayCollection.__name__ = "feathers.data.ArrayCollection";
feathers_data_ArrayCollection.__interfaces__ = [openfl_utils_IExternalizable,feathers_data_IFlatCollection];
feathers_data_ArrayCollection.__super__ = openfl_events_EventDispatcher;
feathers_data_ArrayCollection.prototype = $extend(openfl_events_EventDispatcher.prototype,{
	_filterAndSortData: null
	,_array: null
	,get_array: function() {
		return this._array;
	}
	,set_array: function(value) {
		if(this._array == value) {
			return this._array;
		}
		if(value == null) {
			value = [];
		}
		this._array = value;
		feathers_events_FlatCollectionEvent.dispatch(this,"reset",-1);
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._array;
	}
	,get_length: function() {
		if(this._pendingRefresh) {
			this.refreshFilterAndSort();
		}
		if(this._filterAndSortData != null) {
			return this._filterAndSortData.length;
		}
		return this._array.length;
	}
	,_pendingRefresh: null
	,_filterFunction: null
	,get_filterFunction: function() {
		return this._filterFunction;
	}
	,set_filterFunction: function(value) {
		if(this._filterFunction == value) {
			return this._filterFunction;
		}
		this._filterFunction = value;
		this._pendingRefresh = true;
		feathers_events_FlatCollectionEvent.dispatch(this,"filterChange",-1);
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._filterFunction;
	}
	,_sortCompareFunction: null
	,get_sortCompareFunction: function() {
		return this._sortCompareFunction;
	}
	,set_sortCompareFunction: function(value) {
		if(this._sortCompareFunction == value) {
			return this._sortCompareFunction;
		}
		this._sortCompareFunction = value;
		this._pendingRefresh = true;
		feathers_events_FlatCollectionEvent.dispatch(this,"sortChange",-1);
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._sortCompareFunction;
	}
	,get: function(index) {
		if(this._pendingRefresh) {
			this.refreshFilterAndSort();
		}
		if(index < 0 || index >= this.get_length()) {
			throw new openfl_errors_RangeError("Failed to get item at index " + index + ". Expected a value between 0 and " + (this.get_length() - 1) + ".");
		}
		if(this._filterAndSortData != null) {
			return this._filterAndSortData[index];
		}
		return this._array[index];
	}
	,set: function(index,item) {
		if(this._pendingRefresh) {
			this.refreshFilterAndSort();
		}
		if(index < 0 || index > this.get_length()) {
			throw new openfl_errors_RangeError("Failed to set item at index " + index + ". Expected a value between 0 and " + this.get_length() + ".");
		}
		if(this._filterAndSortData != null) {
			var unfilteredIndex = this._array.length;
			var oldItem = null;
			if(index < this._filterAndSortData.length) {
				oldItem = this._filterAndSortData[index];
				unfilteredIndex = this._array.indexOf(oldItem);
			}
			this._array[unfilteredIndex] = item;
			if(this._filterFunction != null) {
				var includeItem = this._filterFunction(item);
				if(index < this._filterAndSortData.length) {
					if(includeItem) {
						this._filterAndSortData[index] = item;
						feathers_events_FlatCollectionEvent.dispatch(this,"replaceItem",index,item,oldItem);
						feathers_events_FeathersEvent.dispatch(this,"change");
					} else {
						this._filterAndSortData.splice(index,1);
						feathers_events_FlatCollectionEvent.dispatch(this,"removeItem",index,null,oldItem);
						feathers_events_FeathersEvent.dispatch(this,"change");
					}
				} else if(includeItem) {
					this._filterAndSortData[this._filterAndSortData.length] = item;
					feathers_events_FlatCollectionEvent.dispatch(this,"addItem",index,item);
					feathers_events_FeathersEvent.dispatch(this,"change");
				}
				return;
			} else if(this._sortCompareFunction != null) {
				HxOverrides.remove(this._filterAndSortData,oldItem);
				var sortedIndex = this.getSortedInsertionIndex(item);
				this._filterAndSortData[sortedIndex] = item;
				feathers_events_FlatCollectionEvent.dispatch(this,"replaceItem",index,item,oldItem);
				feathers_events_FeathersEvent.dispatch(this,"change");
				return;
			}
		}
		if(index < this._array.length) {
			var oldItem = this._array[index];
			this._array[index] = item;
			feathers_events_FlatCollectionEvent.dispatch(this,"replaceItem",index,item,oldItem);
		} else {
			this._array[index] = item;
			feathers_events_FlatCollectionEvent.dispatch(this,"addItem",index,item);
		}
		feathers_events_FeathersEvent.dispatch(this,"change");
	}
	,add: function(item) {
		this.addAtInternal(item,this.get_length(),true);
	}
	,addAt: function(item,index) {
		this.addAtInternal(item,index,true);
	}
	,addAll: function(collection) {
		var item = collection.iterator();
		while(item.hasNext()) {
			var item1 = item.next();
			this.add(item1);
		}
	}
	,addAllAt: function(collection,index) {
		if(index < 0 || index > this.get_length()) {
			throw new openfl_errors_RangeError("Failed to add collection at index " + index + ". Expected a value between 0 and " + this.get_length() + ".");
		}
		var item = collection.iterator();
		while(item.hasNext()) {
			var item1 = item.next();
			this.addAt(item1,index);
			++index;
		}
	}
	,reset: function(collection) {
		if(this._pendingRefresh) {
			this.refreshFilterAndSort();
		}
		if(this._filterAndSortData != null) {
			this._filterAndSortData.length = 0;
		}
		this._array.length = 0;
		if(collection != null) {
			var item = collection.iterator();
			while(item.hasNext()) {
				var item1 = item.next();
				this.addAtInternal(item1,this.get_length(),false);
			}
		}
		feathers_events_FlatCollectionEvent.dispatch(this,"reset",-1);
		feathers_events_FeathersEvent.dispatch(this,"change");
	}
	,remove: function(item) {
		if(this._pendingRefresh) {
			this.refreshFilterAndSort();
		}
		var index = this.indexOf(item);
		if(index == -1) {
			return;
		}
		if(this._filterAndSortData != null) {
			HxOverrides.remove(this._filterAndSortData,item);
		}
		HxOverrides.remove(this._array,item);
		feathers_events_FlatCollectionEvent.dispatch(this,"removeItem",index,null,item);
		feathers_events_FeathersEvent.dispatch(this,"change");
	}
	,removeAt: function(index) {
		if(this._pendingRefresh) {
			this.refreshFilterAndSort();
		}
		if(index < 0 || index >= this.get_length()) {
			throw new openfl_errors_RangeError("Failed to remove item at index " + index + ". Expected a value between 0 and " + (this.get_length() - 1) + ".");
		}
		var item = null;
		if(this._filterAndSortData != null) {
			item = this._filterAndSortData[index];
			HxOverrides.remove(this._filterAndSortData,item);
			HxOverrides.remove(this._array,item);
		} else {
			item = this._array[index];
			HxOverrides.remove(this._array,item);
		}
		feathers_events_FlatCollectionEvent.dispatch(this,"removeItem",index,null,item);
		feathers_events_FeathersEvent.dispatch(this,"change");
		return item;
	}
	,removeAll: function() {
		if(this._pendingRefresh) {
			this.refreshFilterAndSort();
		}
		if(this._array.length == 0) {
			return;
		}
		if(this._filterAndSortData != null) {
			this._filterAndSortData.length = 0;
		}
		this._array.length = 0;
		feathers_events_FlatCollectionEvent.dispatch(this,"removeAll",-1);
		feathers_events_FeathersEvent.dispatch(this,"change");
	}
	,indexOf: function(item) {
		if(this._pendingRefresh) {
			this.refreshFilterAndSort();
		}
		if(this._filterAndSortData != null) {
			return this._filterAndSortData.indexOf(item);
		}
		return this._array.indexOf(item);
	}
	,contains: function(item) {
		return this.indexOf(item) != -1;
	}
	,iterator: function() {
		if(this._pendingRefresh) {
			this.refreshFilterAndSort();
		}
		if(this._filterAndSortData != null) {
			return new haxe_iterators_ArrayIterator(this._filterAndSortData);
		}
		return new haxe_iterators_ArrayIterator(this._array);
	}
	,updateAt: function(index) {
		if(index < 0 || index >= this.get_length()) {
			throw new openfl_errors_RangeError("Failed to update item at index " + index + ". Expected a value between 0 and " + (this.get_length() - 1) + ".");
		}
		feathers_events_FlatCollectionEvent.dispatch(this,"updateItem",index);
		this.refresh();
	}
	,updateAll: function() {
		feathers_events_FlatCollectionEvent.dispatch(this,"updateAll",-1);
		this.refresh();
	}
	,refresh: function() {
		if(this._filterFunction == null && this._sortCompareFunction == null) {
			return;
		}
		this._pendingRefresh = true;
		if(this._filterFunction != null) {
			feathers_events_FlatCollectionEvent.dispatch(this,"filterChange",-1);
		}
		if(this._sortCompareFunction != null) {
			feathers_events_FlatCollectionEvent.dispatch(this,"sortChange",-1);
		}
		feathers_events_FeathersEvent.dispatch(this,"change");
	}
	,find: function(callback) {
		var _g = 0;
		var _g1 = this.get_length();
		while(_g < _g1) {
			var i = _g++;
			var item = this.get(i);
			var result = callback(item,i,this);
			if(result) {
				return item;
			}
		}
		return null;
	}
	,findIndex: function(callback) {
		var _g = 0;
		var _g1 = this.get_length();
		while(_g < _g1) {
			var i = _g++;
			var item = this.get(i);
			var result = callback(item,i,this);
			if(result) {
				return i;
			}
		}
		return -1;
	}
	,some: function(callback) {
		var _g = 0;
		var _g1 = this.get_length();
		while(_g < _g1) {
			var i = _g++;
			var item = this.get(i);
			var result = callback(item,i,this);
			if(result) {
				return true;
			}
		}
		return false;
	}
	,every: function(callback) {
		var _g = 0;
		var _g1 = this.get_length();
		while(_g < _g1) {
			var i = _g++;
			var item = this.get(i);
			var result = callback(item,i,this);
			if(!result) {
				return false;
			}
		}
		return true;
	}
	,forEach: function(callback) {
		var _g = 0;
		var _g1 = this.get_length();
		while(_g < _g1) {
			var i = _g++;
			var item = this.get(i);
			callback(item,i,this);
		}
	}
	,map: function(callback) {
		var result = [];
		var _g = 0;
		var _g1 = this.get_length();
		while(_g < _g1) {
			var i = _g++;
			var item = this.get(i);
			result.push(callback(item,i,this));
		}
		return new feathers_data_ArrayCollection(result);
	}
	,readExternal: function(input) {
		var value = input.readObject();
		this.set_array(((value) instanceof Array) ? value : null);
	}
	,writeExternal: function(output) {
		output.writeObject(this.get_array());
	}
	,refreshFilterAndSort: function() {
		this._pendingRefresh = false;
		var oldFilterAndSortData = this._filterAndSortData;
		this._filterAndSortData = null;
		if(this._filterFunction != null) {
			var result = oldFilterAndSortData;
			if(result != null) {
				result.length = 0;
			} else {
				result = [];
			}
			var _g = 0;
			var _g1 = this._array.length;
			while(_g < _g1) {
				var i = _g++;
				var item = this._array[i];
				if(this._filterFunction(item)) {
					result.push(item);
				}
			}
			this._filterAndSortData = result;
		} else if(this._sortCompareFunction != null) {
			var result = oldFilterAndSortData;
			if(result != null) {
				result.length = this._array.length;
				var _g = 0;
				var _g1 = this._array.length;
				while(_g < _g1) {
					var i = _g++;
					result[i] = this._array[i];
				}
			} else {
				result = this._array.slice(0);
			}
			this._filterAndSortData = result;
		}
		if(this._sortCompareFunction != null) {
			this._filterAndSortData.sort(this._sortCompareFunction);
		}
	}
	,toArray: function() {
		if(this._filterAndSortData != null) {
			return this._filterAndSortData.slice();
		}
		return this._array.slice();
	}
	,getSortedInsertionIndex: function(item) {
		if(this._sortCompareFunction == null) {
			return this._filterAndSortData.length;
		}
		var _g = 0;
		var _g1 = this._filterAndSortData.length;
		while(_g < _g1) {
			var i = _g++;
			var otherItem = this._filterAndSortData[i];
			var result = this._sortCompareFunction(item,otherItem);
			if(result < 1) {
				return i;
			}
		}
		return this._filterAndSortData.length;
	}
	,addAtInternal: function(item,index,dispatchEvents) {
		if(this._pendingRefresh) {
			this.refreshFilterAndSort();
		}
		if(index < 0 || index > this.get_length()) {
			throw new openfl_errors_RangeError("Failed to add item at index " + index + ". Expected a value between 0 and " + this.get_length() + ".");
		}
		if(this._filterAndSortData != null) {
			var unfilteredIndex = this._array.length;
			if(index < this._filterAndSortData.length) {
				var oldItem = this._filterAndSortData[index];
				unfilteredIndex = this._array.indexOf(oldItem);
			}
			this._array.splice(unfilteredIndex,0,item);
			var includeItem = true;
			if(this._filterFunction != null) {
				includeItem = this._filterFunction(item);
			}
			if(includeItem) {
				var sortedIndex = index;
				if(this._sortCompareFunction != null) {
					sortedIndex = this.getSortedInsertionIndex(item);
				}
				this._filterAndSortData.splice(sortedIndex,0,item);
				if(dispatchEvents) {
					feathers_events_FlatCollectionEvent.dispatch(this,"addItem",index,item);
					feathers_events_FeathersEvent.dispatch(this,"change");
				}
			}
		} else {
			this._array.splice(index,0,item);
			if(dispatchEvents) {
				feathers_events_FlatCollectionEvent.dispatch(this,"addItem",index,item);
				feathers_events_FeathersEvent.dispatch(this,"change");
			}
		}
	}
	,__class__: feathers_data_ArrayCollection
	,__properties__: {set_sortCompareFunction:"set_sortCompareFunction",get_sortCompareFunction:"get_sortCompareFunction",set_filterFunction:"set_filterFunction",get_filterFunction:"get_filterFunction",get_length:"get_length",set_array:"set_array",get_array:"get_array"}
});
var feathers_data_GroupListViewItemType = $hxEnums["feathers.data.GroupListViewItemType"] = { __ename__:"feathers.data.GroupListViewItemType",__constructs__:null
	,STANDARD: {_hx_name:"STANDARD",_hx_index:0,__enum__:"feathers.data.GroupListViewItemType",toString:$estr}
	,HEADER: {_hx_name:"HEADER",_hx_index:1,__enum__:"feathers.data.GroupListViewItemType",toString:$estr}
};
feathers_data_GroupListViewItemType.__constructs__ = [feathers_data_GroupListViewItemType.STANDARD,feathers_data_GroupListViewItemType.HEADER];
var feathers_data_IHierarchicalCollection = function() { };
$hxClasses["feathers.data.IHierarchicalCollection"] = feathers_data_IHierarchicalCollection;
feathers_data_IHierarchicalCollection.__name__ = "feathers.data.IHierarchicalCollection";
feathers_data_IHierarchicalCollection.__isInterface__ = true;
feathers_data_IHierarchicalCollection.__interfaces__ = [openfl_events_IEventDispatcher];
feathers_data_IHierarchicalCollection.prototype = {
	get_filterFunction: null
	,set_filterFunction: null
	,get_sortCompareFunction: null
	,set_sortCompareFunction: null
	,get: null
	,set: null
	,getLength: null
	,locationOf: null
	,contains: null
	,isBranch: null
	,addAt: null
	,remove: null
	,removeAt: null
	,removeAll: null
	,updateAt: null
	,updateAll: null
	,__class__: feathers_data_IHierarchicalCollection
	,__properties__: {set_sortCompareFunction:"set_sortCompareFunction",get_sortCompareFunction:"get_sortCompareFunction",set_filterFunction:"set_filterFunction",get_filterFunction:"get_filterFunction"}
};
var feathers_data_PageIndicatorItemState = function(index,selected) {
	if(selected == null) {
		selected = false;
	}
	if(index == null) {
		index = -1;
	}
	this.enabled = true;
	this.selected = false;
	this.index = -1;
	this.index = index;
	this.selected = false;
};
$hxClasses["feathers.data.PageIndicatorItemState"] = feathers_data_PageIndicatorItemState;
feathers_data_PageIndicatorItemState.__name__ = "feathers.data.PageIndicatorItemState";
feathers_data_PageIndicatorItemState.prototype = {
	owner: null
	,index: null
	,selected: null
	,enabled: null
	,__class__: feathers_data_PageIndicatorItemState
};
var feathers_data_RouteState = function(pattern,pathname,params,historyState,data) {
	this.pattern = pattern;
	this.pathname = pathname;
	this.params = params;
	this.historyState = historyState;
	this.data = data;
};
$hxClasses["feathers.data.RouteState"] = feathers_data_RouteState;
feathers_data_RouteState.__name__ = "feathers.data.RouteState";
feathers_data_RouteState.prototype = {
	pattern: null
	,pathname: null
	,params: null
	,urlVariables: null
	,historyState: null
	,data: null
	,__class__: feathers_data_RouteState
};
var feathers_data_SortOrder = $hxEnums["feathers.data.SortOrder"] = { __ename__:"feathers.data.SortOrder",__constructs__:null
	,ASCENDING: {_hx_name:"ASCENDING",_hx_index:0,__enum__:"feathers.data.SortOrder",toString:$estr}
	,DESCENDING: {_hx_name:"DESCENDING",_hx_index:1,__enum__:"feathers.data.SortOrder",toString:$estr}
	,NONE: {_hx_name:"NONE",_hx_index:2,__enum__:"feathers.data.SortOrder",toString:$estr}
};
feathers_data_SortOrder.__constructs__ = [feathers_data_SortOrder.ASCENDING,feathers_data_SortOrder.DESCENDING,feathers_data_SortOrder.NONE];
var feathers_dragDrop_DragData = function() {
	this._data = new haxe_ds_StringMap();
};
$hxClasses["feathers.dragDrop.DragData"] = feathers_dragDrop_DragData;
feathers_dragDrop_DragData.__name__ = "feathers.dragDrop.DragData";
feathers_dragDrop_DragData.prototype = {
	_data: null
	,exists: function(dataFormat) {
		return Object.prototype.hasOwnProperty.call(this._data.h,dataFormat);
	}
	,get: function(dataFormat) {
		return this._data.h[dataFormat];
	}
	,set: function(dataFormat,value) {
		this._data.h[dataFormat] = value;
	}
	,remove: function(dataFormat) {
		var _this = this._data;
		if(Object.prototype.hasOwnProperty.call(_this.h,dataFormat)) {
			delete(_this.h[dataFormat]);
			return true;
		} else {
			return false;
		}
	}
	,__class__: feathers_dragDrop_DragData
};
var feathers_dragDrop_DragDropManager = function() { };
$hxClasses["feathers.dragDrop.DragDropManager"] = feathers_dragDrop_DragDropManager;
feathers_dragDrop_DragDropManager.__name__ = "feathers.dragDrop.DragDropManager";
feathers_dragDrop_DragDropManager.__properties__ = {get_dragging:"get_dragging"};
feathers_dragDrop_DragDropManager.get_dragging = function() {
	return feathers_dragDrop_DragDropManager.dragData != null;
};
feathers_dragDrop_DragDropManager.startDrag = function(source,data,avatar,avatarOffsetX,avatarOffsetY) {
	if(avatarOffsetY == null) {
		avatarOffsetY = 0.0;
	}
	if(avatarOffsetX == null) {
		avatarOffsetX = 0.0;
	}
	if(feathers_dragDrop_DragDropManager.get_dragging()) {
		feathers_dragDrop_DragDropManager.cancelDrag();
	}
	if(source == null) {
		throw new openfl_errors_ArgumentError("Drag source must not be null.");
	}
	if(data == null) {
		throw new openfl_errors_ArgumentError("Drag data must not be null.");
	}
	feathers_dragDrop_DragDropManager.dragSource = source;
	feathers_dragDrop_DragDropManager.dragData = data;
	feathers_dragDrop_DragDropManager.dragAvatar = avatar;
	feathers_dragDrop_DragDropManager.dragAvatarOffsetX = avatarOffsetX;
	feathers_dragDrop_DragDropManager.dragAvatarOffsetY = avatarOffsetY;
	var displaySource = js_Boot.__cast(source , openfl_display_DisplayObject);
	feathers_dragDrop_DragDropManager._dragSourceStage = displaySource.stage;
	if(feathers_dragDrop_DragDropManager.dragAvatar == null) {
		var scale = 1.0;
		feathers_dragDrop_DragDropManager._dragSourceBitmapData = new openfl_display_BitmapData(Math.ceil(displaySource.get_width() * scale),Math.ceil(displaySource.get_height() * scale));
		var matrix = new openfl_geom_Matrix();
		matrix.scale(scale,scale);
		feathers_dragDrop_DragDropManager._dragSourceBitmapData.draw(displaySource,matrix);
		feathers_dragDrop_DragDropManager.dragAvatar = new openfl_display_Bitmap(feathers_dragDrop_DragDropManager._dragSourceBitmapData);
		feathers_dragDrop_DragDropManager.dragAvatar.set_alpha(0.75);
		feathers_dragDrop_DragDropManager.dragAvatar.set_scaleX(1.0 / scale);
		feathers_dragDrop_DragDropManager.dragAvatar.set_scaleY(1.0 / scale);
	}
	if(((feathers_dragDrop_DragDropManager.dragAvatar) instanceof openfl_display_InteractiveObject)) {
		var interactiveAvatar = feathers_dragDrop_DragDropManager.dragAvatar;
		feathers_dragDrop_DragDropManager._oldDragAvatarMouseEnabled = interactiveAvatar.mouseEnabled;
		interactiveAvatar.mouseEnabled = false;
	}
	if(((feathers_dragDrop_DragDropManager.dragAvatar) instanceof openfl_display_DisplayObjectContainer)) {
		var containerAvatar = feathers_dragDrop_DragDropManager.dragAvatar;
		feathers_dragDrop_DragDropManager._oldDragAvatarMouseChildren = containerAvatar.mouseChildren;
		containerAvatar.mouseChildren = false;
	}
	feathers_dragDrop_DragDropManager.dragAvatar.set_x(feathers_dragDrop_DragDropManager._dragSourceStage.get_mouseX() + feathers_dragDrop_DragDropManager.dragAvatarOffsetX);
	feathers_dragDrop_DragDropManager.dragAvatar.set_y(feathers_dragDrop_DragDropManager._dragSourceStage.get_mouseY() + feathers_dragDrop_DragDropManager.dragAvatarOffsetY);
	feathers_core_PopUpManager.addPopUp(feathers_dragDrop_DragDropManager.dragAvatar,feathers_dragDrop_DragDropManager._dragSourceStage,false,false);
	feathers_dragDrop_DragDropManager._dragSourceStage.addEventListener("mouseMove",feathers_dragDrop_DragDropManager.dragDropManager_stage_mouseMoveHandler,false,0,true);
	feathers_dragDrop_DragDropManager._dragSourceStage.addEventListener("mouseUp",feathers_dragDrop_DragDropManager.dragDropManager_stage_mouseUpHandler,false,0,true);
	feathers_events_DragDropEvent.dispatch(feathers_dragDrop_DragDropManager.dragSource,"dragStart",data,false,null,null,feathers_dragDrop_DragDropManager.dragSource);
	feathers_dragDrop_DragDropManager.updateDropTarget(feathers_dragDrop_DragDropManager._dragSourceStage,feathers_dragDrop_DragDropManager._dragSourceStage.get_mouseX(),feathers_dragDrop_DragDropManager._dragSourceStage.get_mouseY());
};
feathers_dragDrop_DragDropManager.acceptDrag = function(target) {
	if(feathers_dragDrop_DragDropManager.currentDropTarget != target) {
		throw new openfl_errors_ArgumentError("Drop target cannot accept a drag at this time. Acceptance may only happen after the DragDropEvent.DRAG_ENTER event is dispatched and before the DragDropEvent.DRAG_EXIT event is dispatched.");
	}
	feathers_dragDrop_DragDropManager.dropAccepted = true;
};
feathers_dragDrop_DragDropManager.cancelDrag = function() {
	if(!feathers_dragDrop_DragDropManager.get_dragging()) {
		return;
	}
	feathers_dragDrop_DragDropManager.completeDrag(false);
};
feathers_dragDrop_DragDropManager.completeDrag = function(dropped) {
	if(!feathers_dragDrop_DragDropManager.get_dragging()) {
		throw new openfl_errors_IllegalOperationError("Drag cannot be completed because none is currently active.");
	}
	if(feathers_dragDrop_DragDropManager.currentDropTarget != null) {
		feathers_events_DragDropEvent.dispatch(feathers_dragDrop_DragDropManager.currentDropTarget,"dragExit",feathers_dragDrop_DragDropManager.dragData,false,feathers_dragDrop_DragDropManager._dropTargetLocalX,feathers_dragDrop_DragDropManager._dropTargetLocalY,feathers_dragDrop_DragDropManager.dragSource);
		feathers_dragDrop_DragDropManager.currentDropTarget = null;
	}
	var source = feathers_dragDrop_DragDropManager.dragSource;
	var data = feathers_dragDrop_DragDropManager.dragData;
	feathers_dragDrop_DragDropManager.cleanup();
	feathers_events_DragDropEvent.dispatch(source,"dragComplete",data,dropped,null,null,source);
};
feathers_dragDrop_DragDropManager.cleanup = function() {
	if(feathers_dragDrop_DragDropManager._dragSourceStage != null) {
		feathers_dragDrop_DragDropManager._dragSourceStage.removeEventListener("mouseMove",feathers_dragDrop_DragDropManager.dragDropManager_stage_mouseMoveHandler);
		feathers_dragDrop_DragDropManager._dragSourceStage.removeEventListener("mouseUp",feathers_dragDrop_DragDropManager.dragDropManager_stage_mouseUpHandler);
		feathers_dragDrop_DragDropManager._dragSourceStage = null;
	}
	if(feathers_dragDrop_DragDropManager._dragSourceBitmapData != null) {
		feathers_dragDrop_DragDropManager._dragSourceBitmapData.dispose();
		feathers_dragDrop_DragDropManager._dragSourceBitmapData = null;
	}
	if(feathers_dragDrop_DragDropManager.dragAvatar != null) {
		if(feathers_core_PopUpManager.isPopUp(feathers_dragDrop_DragDropManager.dragAvatar)) {
			feathers_core_PopUpManager.removePopUp(feathers_dragDrop_DragDropManager.dragAvatar);
		}
		if(((feathers_dragDrop_DragDropManager.dragAvatar) instanceof openfl_display_InteractiveObject)) {
			feathers_dragDrop_DragDropManager.dragAvatar.mouseEnabled = feathers_dragDrop_DragDropManager._oldDragAvatarMouseEnabled;
		}
		if(((feathers_dragDrop_DragDropManager.dragAvatar) instanceof openfl_display_DisplayObjectContainer)) {
			feathers_dragDrop_DragDropManager.dragAvatar.mouseChildren = feathers_dragDrop_DragDropManager._oldDragAvatarMouseChildren;
		}
		feathers_dragDrop_DragDropManager.dragAvatar = null;
	}
	feathers_dragDrop_DragDropManager.dragSource = null;
	feathers_dragDrop_DragDropManager.dragData = null;
};
feathers_dragDrop_DragDropManager.updateDropTarget = function(stage,globalX,globalY) {
	var location = new openfl_geom_Point(globalX,globalY);
	var newTarget = null;
	var objectsUnderPoint = stage.getObjectsUnderPoint(location);
	var _g = 0;
	while(_g < objectsUnderPoint.length) {
		var object = objectsUnderPoint[_g];
		++_g;
		if(((object) instanceof openfl_display_InteractiveObject)) {
			var interactiveObject = object;
			if(!interactiveObject.mouseEnabled) {
				continue;
			}
		}
		var current = object;
		while(current != null) {
			if(js_Boot.__implements(current,feathers_dragDrop_IDropTarget)) {
				newTarget = current;
				break;
			}
			current = current.parent;
		}
		if(newTarget != null) {
			break;
		}
	}
	if(newTarget != null) {
		location = newTarget.globalToLocal(location);
	}
	if(newTarget != feathers_dragDrop_DragDropManager.currentDropTarget) {
		if(feathers_dragDrop_DragDropManager.currentDropTarget != null) {
			feathers_events_DragDropEvent.dispatch(feathers_dragDrop_DragDropManager.currentDropTarget,"dragExit",feathers_dragDrop_DragDropManager.dragData,false,feathers_dragDrop_DragDropManager._dropTargetLocalX,feathers_dragDrop_DragDropManager._dropTargetLocalY,feathers_dragDrop_DragDropManager.dragSource);
		}
		feathers_dragDrop_DragDropManager.currentDropTarget = newTarget;
		feathers_dragDrop_DragDropManager.dropAccepted = false;
		if(feathers_dragDrop_DragDropManager.currentDropTarget != null) {
			feathers_dragDrop_DragDropManager._dropTargetLocalX = location.x;
			feathers_dragDrop_DragDropManager._dropTargetLocalY = location.y;
			feathers_events_DragDropEvent.dispatch(feathers_dragDrop_DragDropManager.currentDropTarget,"dragEnter",feathers_dragDrop_DragDropManager.dragData,false,feathers_dragDrop_DragDropManager._dropTargetLocalX,feathers_dragDrop_DragDropManager._dropTargetLocalY,feathers_dragDrop_DragDropManager.dragSource);
		}
	} else if(feathers_dragDrop_DragDropManager.currentDropTarget != null) {
		feathers_dragDrop_DragDropManager._dropTargetLocalX = location.x;
		feathers_dragDrop_DragDropManager._dropTargetLocalY = location.y;
		feathers_events_DragDropEvent.dispatch(feathers_dragDrop_DragDropManager.currentDropTarget,"dragMove",feathers_dragDrop_DragDropManager.dragData,false,feathers_dragDrop_DragDropManager._dropTargetLocalX,feathers_dragDrop_DragDropManager._dropTargetLocalY,feathers_dragDrop_DragDropManager.dragSource);
	}
};
feathers_dragDrop_DragDropManager.dragDropManager_stage_mouseMoveHandler = function(event) {
	var stage = js_Boot.__cast(event.currentTarget , openfl_display_Stage);
	if(feathers_dragDrop_DragDropManager.dragAvatar != null) {
		feathers_dragDrop_DragDropManager.dragAvatar.set_x(stage.get_mouseX() + feathers_dragDrop_DragDropManager.dragAvatarOffsetX);
		feathers_dragDrop_DragDropManager.dragAvatar.set_y(stage.get_mouseY() + feathers_dragDrop_DragDropManager.dragAvatarOffsetY);
	}
	feathers_dragDrop_DragDropManager.updateDropTarget(stage,stage.get_mouseX(),stage.get_mouseY());
};
feathers_dragDrop_DragDropManager.dragDropManager_stage_mouseUpHandler = function(event) {
	var isDropped = false;
	if(feathers_dragDrop_DragDropManager.currentDropTarget != null && feathers_dragDrop_DragDropManager.dropAccepted) {
		feathers_events_DragDropEvent.dispatch(feathers_dragDrop_DragDropManager.currentDropTarget,"dragDrop",feathers_dragDrop_DragDropManager.dragData,true,feathers_dragDrop_DragDropManager._dropTargetLocalX,feathers_dragDrop_DragDropManager._dropTargetLocalY,feathers_dragDrop_DragDropManager.dragSource);
		isDropped = true;
	}
	feathers_dragDrop_DragDropManager.currentDropTarget = null;
	feathers_dragDrop_DragDropManager.completeDrag(isDropped);
};
var feathers_events_ButtonBarEvent = function(type,state) {
	openfl_events_Event.call(this,type,false,false);
	this.state = state;
};
$hxClasses["feathers.events.ButtonBarEvent"] = feathers_events_ButtonBarEvent;
feathers_events_ButtonBarEvent.__name__ = "feathers.events.ButtonBarEvent";
feathers_events_ButtonBarEvent.dispatch = function(dispatcher,type,state) {
	var event = feathers_events_ButtonBarEvent._pool.get();
	event.type = type;
	event.state = state;
	var result = dispatcher.dispatchEvent(event);
	feathers_events_ButtonBarEvent._pool.release(event);
	return result;
};
feathers_events_ButtonBarEvent.__super__ = openfl_events_Event;
feathers_events_ButtonBarEvent.prototype = $extend(openfl_events_Event.prototype,{
	state: null
	,clone: function() {
		return new feathers_events_ButtonBarEvent(this.type,this.state);
	}
	,__class__: feathers_events_ButtonBarEvent
});
var feathers_events_DatePickerEvent = function(type,state) {
	openfl_events_Event.call(this,type,false,false);
	this.state = state;
};
$hxClasses["feathers.events.DatePickerEvent"] = feathers_events_DatePickerEvent;
feathers_events_DatePickerEvent.__name__ = "feathers.events.DatePickerEvent";
feathers_events_DatePickerEvent.dispatch = function(dispatcher,type,state) {
	var event = feathers_events_DatePickerEvent._pool.get();
	event.type = type;
	event.state = state;
	var result = dispatcher.dispatchEvent(event);
	feathers_events_DatePickerEvent._pool.release(event);
	return result;
};
feathers_events_DatePickerEvent.__super__ = openfl_events_Event;
feathers_events_DatePickerEvent.prototype = $extend(openfl_events_Event.prototype,{
	state: null
	,clone: function() {
		return new feathers_events_DatePickerEvent(this.type,this.state);
	}
	,__class__: feathers_events_DatePickerEvent
});
var feathers_events_DragDropEvent = function(type,dragData,dropped,localX,localY,dragSource) {
	openfl_events_Event.call(this,type,false,this.cancelable);
	this.dragData = dragData;
	this.dropped = dropped;
	this.localX = localX;
	this.localY = localY;
	this.dragSource = dragSource;
};
$hxClasses["feathers.events.DragDropEvent"] = feathers_events_DragDropEvent;
feathers_events_DragDropEvent.__name__ = "feathers.events.DragDropEvent";
feathers_events_DragDropEvent.dispatch = function(dispatcher,type,dragData,dropped,localX,localY,dragSource) {
	var event = feathers_events_DragDropEvent._pool.get();
	event.type = type;
	event.dragData = dragData;
	event.dropped = dropped;
	event.localX = localX;
	event.localY = localY;
	event.dragSource = dragSource;
	var result = dispatcher.dispatchEvent(event);
	feathers_events_DragDropEvent._pool.release(event);
	return result;
};
feathers_events_DragDropEvent.__super__ = openfl_events_Event;
feathers_events_DragDropEvent.prototype = $extend(openfl_events_Event.prototype,{
	dragData: null
	,dropped: null
	,localX: null
	,localY: null
	,dragSource: null
	,acceptDrag: function(target) {
		feathers_dragDrop_DragDropManager.acceptDrag(target);
	}
	,clone: function() {
		return new feathers_events_DragDropEvent(this.type,this.dragData,this.dropped,this.localX,this.localY,this.dragSource);
	}
	,__class__: feathers_events_DragDropEvent
});
var feathers_events_FeathersEvent = function(type,bubbles,cancelable) {
	if(cancelable == null) {
		cancelable = false;
	}
	if(bubbles == null) {
		bubbles = false;
	}
	openfl_events_Event.call(this,type,bubbles,cancelable);
};
$hxClasses["feathers.events.FeathersEvent"] = feathers_events_FeathersEvent;
feathers_events_FeathersEvent.__name__ = "feathers.events.FeathersEvent";
feathers_events_FeathersEvent.dispatch = function(dispatcher,type,bubbles,cancelable) {
	if(cancelable == null) {
		cancelable = false;
	}
	if(bubbles == null) {
		bubbles = false;
	}
	var event = feathers_events_FeathersEvent._pool.get();
	event.type = type;
	event.bubbles = bubbles;
	event.cancelable = cancelable;
	var result = dispatcher.dispatchEvent(event);
	feathers_events_FeathersEvent._pool.release(event);
	return result;
};
feathers_events_FeathersEvent.__super__ = openfl_events_Event;
feathers_events_FeathersEvent.prototype = $extend(openfl_events_Event.prototype,{
	clone: function() {
		return new feathers_events_FeathersEvent(this.type,this.bubbles,this.cancelable);
	}
	,__class__: feathers_events_FeathersEvent
});
var feathers_events_FlatCollectionEvent = function(type,index,addedItem,removedItem,bubbles,cancelable) {
	if(cancelable == null) {
		cancelable = false;
	}
	if(bubbles == null) {
		bubbles = false;
	}
	openfl_events_Event.call(this,type,bubbles,cancelable);
	this.index = index;
	this.addedItem = addedItem;
	this.removedItem = removedItem;
};
$hxClasses["feathers.events.FlatCollectionEvent"] = feathers_events_FlatCollectionEvent;
feathers_events_FlatCollectionEvent.__name__ = "feathers.events.FlatCollectionEvent";
feathers_events_FlatCollectionEvent.dispatch = function(dispatcher,type,index,addedItem,removedItem,bubbles,cancelable) {
	if(cancelable == null) {
		cancelable = false;
	}
	if(bubbles == null) {
		bubbles = false;
	}
	var event = feathers_events_FlatCollectionEvent._pool.get();
	event.type = type;
	event.index = index;
	event.addedItem = addedItem;
	event.removedItem = removedItem;
	event.bubbles = bubbles;
	event.cancelable = cancelable;
	var result = dispatcher.dispatchEvent(event);
	feathers_events_FlatCollectionEvent._pool.release(event);
	return result;
};
feathers_events_FlatCollectionEvent.__super__ = openfl_events_Event;
feathers_events_FlatCollectionEvent.prototype = $extend(openfl_events_Event.prototype,{
	index: null
	,addedItem: null
	,removedItem: null
	,clone: function() {
		return new feathers_events_FlatCollectionEvent(this.type,this.index,this.addedItem,this.removedItem,this.bubbles,this.cancelable);
	}
	,__class__: feathers_events_FlatCollectionEvent
});
var feathers_events_FormEvent = function(type) {
	openfl_events_Event.call(this,type,false,false);
};
$hxClasses["feathers.events.FormEvent"] = feathers_events_FormEvent;
feathers_events_FormEvent.__name__ = "feathers.events.FormEvent";
feathers_events_FormEvent.dispatch = function(dispatcher,type) {
	var event = feathers_events_FormEvent._pool.get();
	event.type = type;
	var result = dispatcher.dispatchEvent(event);
	feathers_events_FormEvent._pool.release(event);
	return result;
};
feathers_events_FormEvent.__super__ = openfl_events_Event;
feathers_events_FormEvent.prototype = $extend(openfl_events_Event.prototype,{
	clone: function() {
		return new feathers_events_FormEvent(this.type);
	}
	,__class__: feathers_events_FormEvent
});
var feathers_events_GridViewEvent = function(type,state) {
	openfl_events_Event.call(this,type,false,false);
	this.state = state;
};
$hxClasses["feathers.events.GridViewEvent"] = feathers_events_GridViewEvent;
feathers_events_GridViewEvent.__name__ = "feathers.events.GridViewEvent";
feathers_events_GridViewEvent.dispatchForCell = function(dispatcher,type,state) {
	var event = feathers_events_GridViewEvent._cellPool.get();
	event.type = type;
	event.state = state;
	var result = dispatcher.dispatchEvent(event);
	feathers_events_GridViewEvent._cellPool.release(event);
	return result;
};
feathers_events_GridViewEvent.dispatchForHeader = function(dispatcher,type,state) {
	var event = feathers_events_GridViewEvent._headerPool.get();
	event.type = type;
	event.state = state;
	var result = dispatcher.dispatchEvent(event);
	feathers_events_GridViewEvent._headerPool.release(event);
	return result;
};
feathers_events_GridViewEvent.__super__ = openfl_events_Event;
feathers_events_GridViewEvent.prototype = $extend(openfl_events_Event.prototype,{
	state: null
	,clone: function() {
		return new feathers_events_GridViewEvent(this.type,this.state);
	}
	,__class__: feathers_events_GridViewEvent
});
var feathers_events_GroupListViewEvent = function(type,state) {
	openfl_events_Event.call(this,type,false,false);
	this.state = state;
};
$hxClasses["feathers.events.GroupListViewEvent"] = feathers_events_GroupListViewEvent;
feathers_events_GroupListViewEvent.__name__ = "feathers.events.GroupListViewEvent";
feathers_events_GroupListViewEvent.dispatch = function(dispatcher,type,state) {
	var event = feathers_events_GroupListViewEvent._pool.get();
	event.type = type;
	event.state = state;
	var result = dispatcher.dispatchEvent(event);
	feathers_events_GroupListViewEvent._pool.release(event);
	return result;
};
feathers_events_GroupListViewEvent.__super__ = openfl_events_Event;
feathers_events_GroupListViewEvent.prototype = $extend(openfl_events_Event.prototype,{
	state: null
	,clone: function() {
		return new feathers_events_GroupListViewEvent(this.type,this.state);
	}
	,__class__: feathers_events_GroupListViewEvent
});
var feathers_events_HierarchicalCollectionEvent = function(type,location,addedItem,removedItem,bubbles,cancelable) {
	if(cancelable == null) {
		cancelable = false;
	}
	if(bubbles == null) {
		bubbles = false;
	}
	openfl_events_Event.call(this,type,bubbles,cancelable);
	this.location = location;
	this.addedItem = addedItem;
	this.removedItem = removedItem;
};
$hxClasses["feathers.events.HierarchicalCollectionEvent"] = feathers_events_HierarchicalCollectionEvent;
feathers_events_HierarchicalCollectionEvent.__name__ = "feathers.events.HierarchicalCollectionEvent";
feathers_events_HierarchicalCollectionEvent.dispatch = function(dispatcher,type,location,addedItem,removedItem,bubbles,cancelable) {
	if(cancelable == null) {
		cancelable = false;
	}
	if(bubbles == null) {
		bubbles = false;
	}
	var event = feathers_events_HierarchicalCollectionEvent._pool.get();
	event.type = type;
	event.location = location;
	event.addedItem = addedItem;
	event.removedItem = removedItem;
	event.bubbles = bubbles;
	event.cancelable = cancelable;
	var result = dispatcher.dispatchEvent(event);
	feathers_events_HierarchicalCollectionEvent._pool.release(event);
	return result;
};
feathers_events_HierarchicalCollectionEvent.__super__ = openfl_events_Event;
feathers_events_HierarchicalCollectionEvent.prototype = $extend(openfl_events_Event.prototype,{
	location: null
	,addedItem: null
	,removedItem: null
	,clone: function() {
		return new feathers_events_HierarchicalCollectionEvent(this.type,this.location,this.addedItem,this.removedItem,this.bubbles,this.cancelable);
	}
	,__class__: feathers_events_HierarchicalCollectionEvent
});
var feathers_events_ListViewEvent = function(type,state) {
	openfl_events_Event.call(this,type,false,false);
	this.state = state;
};
$hxClasses["feathers.events.ListViewEvent"] = feathers_events_ListViewEvent;
feathers_events_ListViewEvent.__name__ = "feathers.events.ListViewEvent";
feathers_events_ListViewEvent.dispatch = function(dispatcher,type,state) {
	var event = feathers_events_ListViewEvent._pool.get();
	event.type = type;
	event.state = state;
	var result = dispatcher.dispatchEvent(event);
	feathers_events_ListViewEvent._pool.release(event);
	return result;
};
feathers_events_ListViewEvent.__super__ = openfl_events_Event;
feathers_events_ListViewEvent.prototype = $extend(openfl_events_Event.prototype,{
	state: null
	,clone: function() {
		return new feathers_events_ListViewEvent(this.type,this.state);
	}
	,__class__: feathers_events_ListViewEvent
});
var feathers_events_ScrollEvent = function(type,bubbles,cancelable,x,y) {
	if(y == null) {
		y = 0.0;
	}
	if(x == null) {
		x = 0.0;
	}
	if(cancelable == null) {
		cancelable = false;
	}
	if(bubbles == null) {
		bubbles = false;
	}
	openfl_events_Event.call(this,type,bubbles,cancelable);
	this.x = x;
	this.y = y;
};
$hxClasses["feathers.events.ScrollEvent"] = feathers_events_ScrollEvent;
feathers_events_ScrollEvent.__name__ = "feathers.events.ScrollEvent";
feathers_events_ScrollEvent.dispatch = function(dispatcher,type,bubbles,cancelable,x,y) {
	if(y == null) {
		y = 0.0;
	}
	if(x == null) {
		x = 0.0;
	}
	if(cancelable == null) {
		cancelable = false;
	}
	if(bubbles == null) {
		bubbles = false;
	}
	var event = feathers_events_ScrollEvent._pool.get();
	event.type = type;
	event.bubbles = bubbles;
	event.cancelable = cancelable;
	event.x = x;
	event.y = y;
	var result = dispatcher.dispatchEvent(event);
	feathers_events_ScrollEvent._pool.release(event);
	return result;
};
feathers_events_ScrollEvent.__super__ = openfl_events_Event;
feathers_events_ScrollEvent.prototype = $extend(openfl_events_Event.prototype,{
	x: null
	,y: null
	,clone: function() {
		return new feathers_events_ScrollEvent(this.type,this.bubbles,this.cancelable,this.x,this.y);
	}
	,__class__: feathers_events_ScrollEvent
});
var feathers_events_StyleProviderEvent = function(type,affectsTarget) {
	openfl_events_Event.call(this,type);
	this.affectsTarget = affectsTarget != null ? affectsTarget : feathers_events_StyleProviderEvent.defaultAffectsTarget;
};
$hxClasses["feathers.events.StyleProviderEvent"] = feathers_events_StyleProviderEvent;
feathers_events_StyleProviderEvent.__name__ = "feathers.events.StyleProviderEvent";
feathers_events_StyleProviderEvent.dispatch = function(dispatcher,type,affectsTarget) {
	var event = feathers_events_StyleProviderEvent._pool.get();
	event.type = type;
	event.affectsTarget = affectsTarget != null ? affectsTarget : feathers_events_StyleProviderEvent.defaultAffectsTarget;
	var result = dispatcher.dispatchEvent(event);
	feathers_events_StyleProviderEvent._pool.release(event);
	return result;
};
feathers_events_StyleProviderEvent.defaultAffectsTarget = function(value) {
	return true;
};
feathers_events_StyleProviderEvent.__super__ = openfl_events_Event;
feathers_events_StyleProviderEvent.prototype = $extend(openfl_events_Event.prototype,{
	affectsTarget: null
	,clone: function() {
		return new feathers_events_StyleProviderEvent(this.type,this.affectsTarget);
	}
	,__class__: feathers_events_StyleProviderEvent
});
var feathers_events_TabBarEvent = function(type,state) {
	openfl_events_Event.call(this,type,false,false);
	this.state = state;
};
$hxClasses["feathers.events.TabBarEvent"] = feathers_events_TabBarEvent;
feathers_events_TabBarEvent.__name__ = "feathers.events.TabBarEvent";
feathers_events_TabBarEvent.dispatch = function(dispatcher,type,state) {
	var event = feathers_events_TabBarEvent._pool.get();
	event.type = type;
	event.state = state;
	var result = dispatcher.dispatchEvent(event);
	feathers_events_TabBarEvent._pool.release(event);
	return result;
};
feathers_events_TabBarEvent.__super__ = openfl_events_Event;
feathers_events_TabBarEvent.prototype = $extend(openfl_events_Event.prototype,{
	state: null
	,clone: function() {
		return new feathers_events_TabBarEvent(this.type,this.state);
	}
	,__class__: feathers_events_TabBarEvent
});
var feathers_events_TransitionEvent = function(type,previousViewID,previousView,nextViewID,nextView) {
	openfl_events_Event.call(this,type,false,false);
	this.previousViewID = previousViewID;
	this.previousView = previousView;
	this.nextViewID = nextViewID;
	this.nextView = nextView;
};
$hxClasses["feathers.events.TransitionEvent"] = feathers_events_TransitionEvent;
feathers_events_TransitionEvent.__name__ = "feathers.events.TransitionEvent";
feathers_events_TransitionEvent.dispatch = function(dispatcher,type,previousViewID,previousView,nextViewID,nextView) {
	var event = feathers_events_TransitionEvent._pool.get();
	event.type = type;
	event.bubbles = false;
	event.cancelable = false;
	event.previousViewID = previousViewID;
	event.previousView = previousView;
	event.nextViewID = nextViewID;
	event.nextView = nextView;
	var result = dispatcher.dispatchEvent(event);
	feathers_events_TransitionEvent._pool.release(event);
	return result;
};
feathers_events_TransitionEvent.__super__ = openfl_events_Event;
feathers_events_TransitionEvent.prototype = $extend(openfl_events_Event.prototype,{
	previousView: null
	,previousViewID: null
	,nextView: null
	,nextViewID: null
	,clone: function() {
		return new feathers_events_TransitionEvent(this.type,this.previousViewID,this.previousView,this.nextViewID,this.nextView);
	}
	,__class__: feathers_events_TransitionEvent
});
var feathers_events_TreeGridViewEvent = function(type,state) {
	openfl_events_Event.call(this,type,false,false);
	this.state = state;
};
$hxClasses["feathers.events.TreeGridViewEvent"] = feathers_events_TreeGridViewEvent;
feathers_events_TreeGridViewEvent.__name__ = "feathers.events.TreeGridViewEvent";
feathers_events_TreeGridViewEvent.dispatchForCell = function(dispatcher,type,state) {
	var event = feathers_events_TreeGridViewEvent._cellPool.get();
	event.type = type;
	event.state = state;
	var result = dispatcher.dispatchEvent(event);
	feathers_events_TreeGridViewEvent._cellPool.release(event);
	return result;
};
feathers_events_TreeGridViewEvent.dispatchForHeader = function(dispatcher,type,state) {
	var event = feathers_events_TreeGridViewEvent._headerPool.get();
	event.type = type;
	event.state = state;
	var result = dispatcher.dispatchEvent(event);
	feathers_events_TreeGridViewEvent._headerPool.release(event);
	return result;
};
feathers_events_TreeGridViewEvent.__super__ = openfl_events_Event;
feathers_events_TreeGridViewEvent.prototype = $extend(openfl_events_Event.prototype,{
	state: null
	,clone: function() {
		return new feathers_events_TreeGridViewEvent(this.type,this.state);
	}
	,__class__: feathers_events_TreeGridViewEvent
});
var feathers_events_TreeViewEvent = function(type,state) {
	openfl_events_Event.call(this,type,false,false);
	this.state = state;
};
$hxClasses["feathers.events.TreeViewEvent"] = feathers_events_TreeViewEvent;
feathers_events_TreeViewEvent.__name__ = "feathers.events.TreeViewEvent";
feathers_events_TreeViewEvent.dispatch = function(dispatcher,type,state) {
	var event = feathers_events_TreeViewEvent._pool.get();
	event.type = type;
	event.state = state;
	var result = dispatcher.dispatchEvent(event);
	feathers_events_TreeViewEvent._pool.release(event);
	return result;
};
feathers_events_TreeViewEvent.__super__ = openfl_events_Event;
feathers_events_TreeViewEvent.prototype = $extend(openfl_events_Event.prototype,{
	state: null
	,clone: function() {
		return new feathers_events_TreeViewEvent(this.type,this.state);
	}
	,__class__: feathers_events_TreeViewEvent
});
var feathers_events_TriggerEvent = function(type,bubbles,cancelable,touchPointID,isPrimaryTouchPoint,localX,localY,sizeX,sizeY,pressure,relatedObject,ctrlKey,altKey,shiftKey,commandKey) {
	if(commandKey == null) {
		commandKey = false;
	}
	if(shiftKey == null) {
		shiftKey = false;
	}
	if(altKey == null) {
		altKey = false;
	}
	if(ctrlKey == null) {
		ctrlKey = false;
	}
	if(pressure == null) {
		pressure = 1.0;
	}
	if(sizeY == null) {
		sizeY = 0.0;
	}
	if(sizeX == null) {
		sizeX = 0.0;
	}
	if(localY == null) {
		localY = 0.0;
	}
	if(localX == null) {
		localX = 0.0;
	}
	if(isPrimaryTouchPoint == null) {
		isPrimaryTouchPoint = false;
	}
	if(touchPointID == null) {
		touchPointID = 0;
	}
	if(cancelable == null) {
		cancelable = false;
	}
	if(bubbles == null) {
		bubbles = false;
	}
	openfl_events_Event.call(this,type,bubbles,cancelable);
	this.touchPointID = touchPointID;
	this.isPrimaryTouchPoint = isPrimaryTouchPoint;
	this.localX = localX;
	this.localY = localY;
	this.stageX = NaN;
	this.stageY = NaN;
	this.sizeX = sizeX;
	this.sizeY = sizeY;
	this.pressure = pressure;
	this.relatedObject = relatedObject;
	this.ctrlKey = ctrlKey;
	this.altKey = altKey;
	this.shiftKey = shiftKey;
	this.commandKey = commandKey;
};
$hxClasses["feathers.events.TriggerEvent"] = feathers_events_TriggerEvent;
feathers_events_TriggerEvent.__name__ = "feathers.events.TriggerEvent";
feathers_events_TriggerEvent.dispatchFromMouseEvent = function(dispatcher,mouseEvent) {
	var event = feathers_events_TriggerEvent._pool.get();
	event = feathers_events_TriggerEvent.fromMouseEvent(mouseEvent,event);
	var result = dispatcher.dispatchEvent(event);
	feathers_events_TriggerEvent._pool.release(event);
	return result;
};
feathers_events_TriggerEvent.dispatchFromTouchEvent = function(dispatcher,touchEvent) {
	var event = feathers_events_TriggerEvent._pool.get();
	event = feathers_events_TriggerEvent.fromTouchEvent(touchEvent,event);
	var result = dispatcher.dispatchEvent(event);
	feathers_events_TriggerEvent._pool.release(event);
	return result;
};
feathers_events_TriggerEvent.fromMouseEvent = function(event,existing) {
	if(event.type != "click") {
		throw new openfl_errors_ArgumentError("TriggerEvent.fromMouseEvent() requires MouseEvent.CLICK");
	}
	if(existing != null) {
		existing.type = "trigger";
		existing.bubbles = false;
		existing.cancelable = event.cancelable;
		existing.touchPointID = -1;
		existing.isPrimaryTouchPoint = false;
		existing.localX = event.localX;
		existing.localY = event.localY;
		existing.stageX = event.stageX;
		existing.stageY = event.stageY;
		existing.sizeX = 0.0;
		existing.sizeY = 0.0;
		existing.pressure = 1.0;
		existing.relatedObject = event.relatedObject;
		existing.ctrlKey = event.ctrlKey;
		existing.altKey = event.altKey;
		existing.shiftKey = event.shiftKey;
		existing.commandKey = event.commandKey;
		return existing;
	}
	var result = new feathers_events_TriggerEvent("trigger",false,event.cancelable,-1,false,event.localX,event.localY,0.0,0.0,1.0,event.relatedObject,event.ctrlKey,event.altKey,event.shiftKey,Object.prototype.hasOwnProperty.call(event,"commandKey") && Reflect.field(event,"commandKey"));
	result.stageX = event.stageX;
	result.stageY = event.stageY;
	return result;
};
feathers_events_TriggerEvent.fromTouchEvent = function(event,existing) {
	if(event.type != "touchTap") {
		throw new openfl_errors_ArgumentError("TriggerEvent.fromTouchEvent() requires TouchEvent.TOUCH_TAP");
	}
	if(existing != null) {
		existing.type = "trigger";
		existing.bubbles = false;
		existing.cancelable = event.cancelable;
		existing.touchPointID = event.touchPointID;
		existing.isPrimaryTouchPoint = event.isPrimaryTouchPoint;
		existing.localX = event.localX;
		existing.localY = event.localY;
		existing.stageX = event.stageX;
		existing.stageY = event.stageY;
		existing.sizeX = event.sizeX;
		existing.sizeY = event.sizeY;
		existing.pressure = event.pressure;
		existing.relatedObject = event.relatedObject;
		existing.ctrlKey = event.ctrlKey;
		existing.altKey = event.altKey;
		existing.shiftKey = event.shiftKey;
		existing.commandKey = event.commandKey;
		return existing;
	}
	var result = new feathers_events_TriggerEvent("trigger",false,event.cancelable,event.touchPointID,event.isPrimaryTouchPoint,event.localX,event.localY,event.sizeX,event.sizeY,event.pressure,event.relatedObject,event.ctrlKey,event.altKey,event.shiftKey,Object.prototype.hasOwnProperty.call(event,"commandKey") && Reflect.field(event,"commandKey"));
	result.stageX = event.stageX;
	result.stageY = event.stageY;
	return result;
};
feathers_events_TriggerEvent.__super__ = openfl_events_Event;
feathers_events_TriggerEvent.prototype = $extend(openfl_events_Event.prototype,{
	touchPointID: null
	,isPrimaryTouchPoint: null
	,altKey: null
	,commandKey: null
	,ctrlKey: null
	,controlKey: null
	,shiftKey: null
	,localX: null
	,localY: null
	,sizeX: null
	,sizeY: null
	,pressure: null
	,stageX: null
	,stageY: null
	,relatedObject: null
	,clone: function() {
		var result = new feathers_events_TriggerEvent(this.type,this.bubbles,this.cancelable,this.touchPointID,this.isPrimaryTouchPoint,this.localX,this.localY,this.sizeX,this.sizeY,this.pressure,this.relatedObject,this.ctrlKey,this.altKey,this.shiftKey,this.commandKey);
		result.stageX = this.stageX;
		result.stageY = this.stageY;
		return result;
	}
	,__class__: feathers_events_TriggerEvent
});
var feathers_graphics_CreateGradientBoxMatrix = {};
feathers_graphics_CreateGradientBoxMatrix.fromGradientBoxTransform = function(transform) {
	switch(transform._hx_index) {
	case 0:
		var rotation = transform.rotation;
		return function(defaultWidth,defaultHeight,defaultRadians,defaultTx,defaultTy) {
			var matrix = new openfl_geom_Matrix();
			matrix.createGradientBox(defaultWidth,defaultHeight,rotation,defaultTx,defaultTy);
			return matrix;
		};
	case 1:
		var rotation1 = transform.rotation;
		return function(defaultWidth,defaultHeight,defaultRadians,defaultTx,defaultTy) {
			var matrix = new openfl_geom_Matrix();
			matrix.createGradientBox(defaultWidth,defaultHeight,rotation1 * Math.PI / 180.0,defaultTx,defaultTy);
			return matrix;
		};
	case 2:
		var tx = transform.tx;
		var ty = transform.ty;
		return function(defaultWidth,defaultHeight,defaultRadians,defaultTx,defaultTy) {
			var matrix = new openfl_geom_Matrix();
			matrix.createGradientBox(defaultWidth,defaultHeight,defaultRadians,tx,ty);
			return matrix;
		};
	case 3:
		var rotation2 = transform.rotation;
		var tx1 = transform.tx;
		var ty1 = transform.ty;
		return function(defaultWidth,defaultHeight,defaultRadians,defaultTx,defaultTy) {
			var matrix = new openfl_geom_Matrix();
			matrix.createGradientBox(defaultWidth,defaultHeight,rotation2,tx1,ty1);
			return matrix;
		};
	case 4:
		var rotation3 = transform.rotation;
		var tx2 = transform.tx;
		var ty2 = transform.ty;
		return function(defaultWidth,defaultHeight,defaultRadians,defaultTx,defaultTy) {
			var matrix = new openfl_geom_Matrix();
			matrix.createGradientBox(defaultWidth,defaultHeight,rotation3 * Math.PI / 180.0,tx2,ty2);
			return matrix;
		};
	}
};
feathers_graphics_CreateGradientBoxMatrix.fromRadians = function(radians) {
	return function(defaultWidth,defaultHeight,defaultRadians,defaultTx,defaultTy) {
		var matrix = new openfl_geom_Matrix();
		matrix.createGradientBox(defaultWidth,defaultHeight,radians,defaultTx,defaultTy);
		return matrix;
	};
};
feathers_graphics_CreateGradientBoxMatrix.fromMatrix = function(matrix) {
	return function(defaultWidth,defaultHeight,defaultRadians,defaultTx,defaultTy) {
		return matrix;
	};
};
var feathers_graphics_FillStyle = $hxEnums["feathers.graphics.FillStyle"] = { __ename__:"feathers.graphics.FillStyle",__constructs__:null
	,SolidColor: ($_=function(color,alpha) { return {_hx_index:0,color:color,alpha:alpha,__enum__:"feathers.graphics.FillStyle",toString:$estr}; },$_._hx_name="SolidColor",$_.__params__ = ["color","alpha"],$_)
	,Bitmap: ($_=function(bitmapData,matrix,repeat,smoothing) { return {_hx_index:1,bitmapData:bitmapData,matrix:matrix,repeat:repeat,smoothing:smoothing,__enum__:"feathers.graphics.FillStyle",toString:$estr}; },$_._hx_name="Bitmap",$_.__params__ = ["bitmapData","matrix","repeat","smoothing"],$_)
	,Gradient: ($_=function(type,colors,alphas,ratios,matrix,spreadMethod,interpolationMethod,focalPointRatio) { return {_hx_index:2,type:type,colors:colors,alphas:alphas,ratios:ratios,matrix:matrix,spreadMethod:spreadMethod,interpolationMethod:interpolationMethod,focalPointRatio:focalPointRatio,__enum__:"feathers.graphics.FillStyle",toString:$estr}; },$_._hx_name="Gradient",$_.__params__ = ["type","colors","alphas","ratios","matrix","spreadMethod","interpolationMethod","focalPointRatio"],$_)
	,None: {_hx_name:"None",_hx_index:3,__enum__:"feathers.graphics.FillStyle",toString:$estr}
};
feathers_graphics_FillStyle.__constructs__ = [feathers_graphics_FillStyle.SolidColor,feathers_graphics_FillStyle.Bitmap,feathers_graphics_FillStyle.Gradient,feathers_graphics_FillStyle.None];
var feathers_graphics_GradientBoxTransform = $hxEnums["feathers.graphics.GradientBoxTransform"] = { __ename__:"feathers.graphics.GradientBoxTransform",__constructs__:null
	,RotateRadians: ($_=function(rotation) { return {_hx_index:0,rotation:rotation,__enum__:"feathers.graphics.GradientBoxTransform",toString:$estr}; },$_._hx_name="RotateRadians",$_.__params__ = ["rotation"],$_)
	,RotateDegrees: ($_=function(rotation) { return {_hx_index:1,rotation:rotation,__enum__:"feathers.graphics.GradientBoxTransform",toString:$estr}; },$_._hx_name="RotateDegrees",$_.__params__ = ["rotation"],$_)
	,Translate: ($_=function(tx,ty) { return {_hx_index:2,tx:tx,ty:ty,__enum__:"feathers.graphics.GradientBoxTransform",toString:$estr}; },$_._hx_name="Translate",$_.__params__ = ["tx","ty"],$_)
	,RotateRadiansAndTranslate: ($_=function(rotation,tx,ty) { return {_hx_index:3,rotation:rotation,tx:tx,ty:ty,__enum__:"feathers.graphics.GradientBoxTransform",toString:$estr}; },$_._hx_name="RotateRadiansAndTranslate",$_.__params__ = ["rotation","tx","ty"],$_)
	,RotateDegreesAndTranslate: ($_=function(rotation,tx,ty) { return {_hx_index:4,rotation:rotation,tx:tx,ty:ty,__enum__:"feathers.graphics.GradientBoxTransform",toString:$estr}; },$_._hx_name="RotateDegreesAndTranslate",$_.__params__ = ["rotation","tx","ty"],$_)
};
feathers_graphics_GradientBoxTransform.__constructs__ = [feathers_graphics_GradientBoxTransform.RotateRadians,feathers_graphics_GradientBoxTransform.RotateDegrees,feathers_graphics_GradientBoxTransform.Translate,feathers_graphics_GradientBoxTransform.RotateRadiansAndTranslate,feathers_graphics_GradientBoxTransform.RotateDegreesAndTranslate];
var feathers_graphics_LineStyle = $hxEnums["feathers.graphics.LineStyle"] = { __ename__:"feathers.graphics.LineStyle",__constructs__:null
	,SolidColor: ($_=function(thickness,color,alpha,pixelHinting,scaleMode,caps,joints,miterLimit) { return {_hx_index:0,thickness:thickness,color:color,alpha:alpha,pixelHinting:pixelHinting,scaleMode:scaleMode,caps:caps,joints:joints,miterLimit:miterLimit,__enum__:"feathers.graphics.LineStyle",toString:$estr}; },$_._hx_name="SolidColor",$_.__params__ = ["thickness","color","alpha","pixelHinting","scaleMode","caps","joints","miterLimit"],$_)
	,Bitmap: ($_=function(thickness,bitmapData,matrix,repeat,smooth) { return {_hx_index:1,thickness:thickness,bitmapData:bitmapData,matrix:matrix,repeat:repeat,smooth:smooth,__enum__:"feathers.graphics.LineStyle",toString:$estr}; },$_._hx_name="Bitmap",$_.__params__ = ["thickness","bitmapData","matrix","repeat","smooth"],$_)
	,Gradient: ($_=function(thickness,type,colors,alphas,ratios,matrix,spreadMethod,interpolationMethod,focalPointRatio) { return {_hx_index:2,thickness:thickness,type:type,colors:colors,alphas:alphas,ratios:ratios,matrix:matrix,spreadMethod:spreadMethod,interpolationMethod:interpolationMethod,focalPointRatio:focalPointRatio,__enum__:"feathers.graphics.LineStyle",toString:$estr}; },$_._hx_name="Gradient",$_.__params__ = ["thickness","type","colors","alphas","ratios","matrix","spreadMethod","interpolationMethod","focalPointRatio"],$_)
	,None: {_hx_name:"None",_hx_index:3,__enum__:"feathers.graphics.LineStyle",toString:$estr}
};
feathers_graphics_LineStyle.__constructs__ = [feathers_graphics_LineStyle.SolidColor,feathers_graphics_LineStyle.Bitmap,feathers_graphics_LineStyle.Gradient,feathers_graphics_LineStyle.None];
var feathers_layout_ILayout = function() { };
$hxClasses["feathers.layout.ILayout"] = feathers_layout_ILayout;
feathers_layout_ILayout.__name__ = "feathers.layout.ILayout";
feathers_layout_ILayout.__isInterface__ = true;
feathers_layout_ILayout.__interfaces__ = [openfl_events_IEventDispatcher];
feathers_layout_ILayout.prototype = {
	layout: null
	,__class__: feathers_layout_ILayout
};
var feathers_layout_AnchorLayout = function() {
	openfl_events_EventDispatcher.call(this);
};
$hxClasses["feathers.layout.AnchorLayout"] = feathers_layout_AnchorLayout;
feathers_layout_AnchorLayout.__name__ = "feathers.layout.AnchorLayout";
feathers_layout_AnchorLayout.__interfaces__ = [feathers_layout_ILayout];
feathers_layout_AnchorLayout.__super__ = openfl_events_EventDispatcher;
feathers_layout_AnchorLayout.prototype = $extend(openfl_events_EventDispatcher.prototype,{
	layout: function(items,measurements,result) {
		var _g = 0;
		while(_g < items.length) {
			var item = items[_g];
			++_g;
			var layoutObject = null;
			if(js_Boot.__implements(item,feathers_layout_ILayoutObject)) {
				layoutObject = item;
				if(!layoutObject.get_includeInLayout()) {
					continue;
				}
				var layoutData = null;
				if(layoutObject != null && ((layoutObject.get_layoutData()) instanceof feathers_layout_AnchorLayoutData)) {
					layoutData = layoutObject.get_layoutData();
				}
				if(layoutData != null) {
					if(measurements.width != null) {
						var leftAnchor = layoutData.get_left();
						var rightAnchor = layoutData.get_right();
						if(leftAnchor != null && rightAnchor != null && leftAnchor.get_relativeTo() == null && rightAnchor.get_relativeTo() == null) {
							item.set_width(measurements.width - leftAnchor.get_value() - rightAnchor.get_value());
						}
					}
					if(measurements.height != null) {
						var topAnchor = layoutData.get_top();
						var bottomAnchor = layoutData.get_bottom();
						if(topAnchor != null && bottomAnchor != null && topAnchor.get_relativeTo() == null && bottomAnchor.get_relativeTo() == null) {
							item.set_height(measurements.height - topAnchor.get_value() - bottomAnchor.get_value());
						}
					}
				}
			}
			if(js_Boot.__implements(item,feathers_core_IValidating)) {
				item.validateNow();
			}
		}
		var maxX = 0.0;
		var maxY = 0.0;
		var doneItems = [];
		while(doneItems.length < items.length) {
			var oldDoneCount = doneItems.length;
			var _g = 0;
			while(_g < items.length) {
				var item = items[_g];
				++_g;
				if(doneItems.indexOf(item) != -1) {
					continue;
				}
				var layoutObject = null;
				if(js_Boot.__implements(item,feathers_layout_ILayoutObject)) {
					layoutObject = item;
					if(!layoutObject.get_includeInLayout()) {
						doneItems.push(item);
						continue;
					}
				}
				var layoutData = null;
				if(layoutObject != null && ((layoutObject.get_layoutData()) instanceof feathers_layout_AnchorLayoutData)) {
					layoutData = layoutObject.get_layoutData();
				}
				if(js_Boot.__implements(item,feathers_core_IValidating)) {
					item.validateNow();
				}
				if(layoutData == null) {
					var itemMaxX = item.get_x() + item.get_width();
					if(maxX < itemMaxX) {
						maxX = itemMaxX;
					}
					var itemMaxY = item.get_y() + item.get_height();
					if(maxY < itemMaxY) {
						maxY = itemMaxY;
					}
				} else {
					if(layoutData.get_top() != null) {
						var top = layoutData.get_top();
						var value = top.get_value();
						var relativeTo = top.get_relativeTo();
						if(relativeTo != null && doneItems.indexOf(relativeTo) == -1) {
							if(item.parent != relativeTo.parent) {
								throw new openfl_errors_IllegalOperationError("relativeTo must have the same parent");
							}
							continue;
						}
						item.set_y(value);
						if(relativeTo != null) {
							item.set_y(item.get_y() + (relativeTo.get_y() + relativeTo.get_height()));
						}
					}
					if(layoutData.get_left() != null) {
						var left = layoutData.get_left();
						var value1 = left.get_value();
						var relativeTo1 = left.get_relativeTo();
						if(relativeTo1 != null && doneItems.indexOf(relativeTo1) == -1) {
							if(item.parent != relativeTo1.parent) {
								throw new openfl_errors_IllegalOperationError("relativeTo must have the same parent");
							}
							continue;
						}
						item.set_x(value1);
						if(relativeTo1 != null) {
							item.set_x(item.get_x() + (relativeTo1.get_x() + relativeTo1.get_width()));
						}
					}
					if(layoutData.get_verticalCenter() == null) {
						var itemMaxY1 = item.get_y() + item.get_height();
						if(layoutData.get_bottom() != null) {
							var bottom = layoutData.get_bottom();
							var value2 = bottom.get_value();
							if(layoutData.get_top() != null) {
								itemMaxY1 += value2;
							} else {
								itemMaxY1 = item.get_height() + value2;
							}
						}
						if(maxY < itemMaxY1) {
							maxY = itemMaxY1;
						}
					} else {
						var itemMaxY2 = item.get_height();
						if(maxY < itemMaxY2) {
							maxY = itemMaxY2;
						}
					}
					if(layoutData.get_horizontalCenter() == null) {
						var itemMaxX1 = item.get_x() + item.get_width();
						if(layoutData.get_right() != null) {
							var right = layoutData.get_right();
							var value3 = right.get_value();
							if(layoutData.get_left() != null) {
								itemMaxX1 += value3;
							} else {
								itemMaxX1 = item.get_width() + value3;
							}
						}
						if(maxX < itemMaxX1) {
							maxX = itemMaxX1;
						}
					} else {
						var itemMaxX2 = item.get_width();
						if(maxX < itemMaxX2) {
							maxX = itemMaxX2;
						}
					}
				}
				doneItems.push(item);
			}
			if(oldDoneCount == doneItems.length) {
				throw new openfl_errors_IllegalOperationError("relativeTo circular reference detected");
			}
		}
		var viewPortWidth = 0.0;
		var viewPortHeight = 0.0;
		var loopCount = 0;
		var needsAnotherPass = true;
		while(needsAnotherPass) {
			needsAnotherPass = false;
			if(measurements.width != null) {
				viewPortWidth = measurements.width;
			} else {
				viewPortWidth = maxX;
				if(measurements.minWidth != null && viewPortWidth < measurements.minWidth) {
					viewPortWidth = measurements.minWidth;
				} else if(measurements.maxWidth != null && viewPortWidth > measurements.maxWidth) {
					viewPortWidth = measurements.maxWidth;
				}
			}
			if(measurements.height != null) {
				viewPortHeight = measurements.height;
			} else {
				viewPortHeight = maxY;
				if(measurements.minHeight != null && viewPortHeight < measurements.minHeight) {
					viewPortHeight = measurements.minHeight;
				} else if(measurements.maxHeight != null && viewPortHeight > measurements.maxHeight) {
					viewPortHeight = measurements.maxHeight;
				}
			}
			doneItems.length = 0;
			while(doneItems.length < items.length) {
				var oldDoneCount = doneItems.length;
				var _g = 0;
				while(_g < items.length) {
					var item = items[_g];
					++_g;
					if(doneItems.indexOf(item) != -1) {
						continue;
					}
					var layoutObject = null;
					if(js_Boot.__implements(item,feathers_layout_ILayoutObject)) {
						layoutObject = item;
						if(!layoutObject.get_includeInLayout()) {
							doneItems.push(item);
							continue;
						}
					}
					var layoutData = null;
					if(layoutObject != null && ((layoutObject.get_layoutData()) instanceof feathers_layout_AnchorLayoutData)) {
						layoutData = layoutObject.get_layoutData();
					}
					if(layoutData == null) {
						doneItems.push(item);
						continue;
					}
					if(layoutData.get_top() != null) {
						var top = layoutData.get_top();
						var relativeTo = top.get_relativeTo();
						if(relativeTo != null && doneItems.indexOf(relativeTo) == -1) {
							if(item.parent != relativeTo.parent) {
								throw new openfl_errors_IllegalOperationError("relativeTo must have the same parent");
							}
							continue;
						}
						var y = top.get_value();
						if(relativeTo != null) {
							y += relativeTo.get_y() + relativeTo.get_height();
						}
						item.set_y(y);
					}
					if(layoutData.get_left() != null) {
						var left = layoutData.get_left();
						var relativeTo1 = left.get_relativeTo();
						if(relativeTo1 != null && doneItems.indexOf(relativeTo1) == -1) {
							if(item.parent != relativeTo1.parent) {
								throw new openfl_errors_IllegalOperationError("relativeTo must have the same parent");
							}
							continue;
						}
						var x = left.get_value();
						if(relativeTo1 != null) {
							x += relativeTo1.get_x() + relativeTo1.get_width();
						}
						item.set_x(x);
					}
					if(layoutData.get_bottom() != null) {
						var bottom = layoutData.get_bottom();
						var relativeTo2 = bottom.get_relativeTo();
						if(relativeTo2 != null && doneItems.indexOf(relativeTo2) == -1) {
							if(item.parent != relativeTo2.parent) {
								throw new openfl_errors_IllegalOperationError("relativeTo must have the same parent");
							}
							continue;
						}
						var bottomPixels = bottom.get_value();
						var bottomEdge = viewPortHeight;
						if(relativeTo2 != null) {
							bottomEdge = relativeTo2.get_y();
						}
						if(layoutData.get_top() == null) {
							item.set_y(bottomEdge - bottomPixels - item.get_height());
						} else {
							var itemHeight = bottomEdge - bottomPixels - item.get_y();
							if(itemHeight < 0.0) {
								itemHeight = 0.0;
							}
							if(item.get_height() != itemHeight) {
								item.set_height(itemHeight);
								if(measurements.width == null && js_Boot.__implements(item,feathers_core_IValidating)) {
									item.validateNow();
									var maxItemX = item.get_x() + item.get_width();
									if(maxX < maxItemX) {
										maxX = maxItemX;
										needsAnotherPass = true;
										break;
									}
								}
							}
						}
					} else if(layoutData.get_verticalCenter() != null) {
						item.set_y(layoutData.get_verticalCenter() + (viewPortHeight - item.get_height()) / 2.0);
					}
					if(layoutData.get_right() != null) {
						var right = layoutData.get_right();
						var relativeTo3 = right.get_relativeTo();
						if(relativeTo3 != null && doneItems.indexOf(relativeTo3) == -1) {
							if(item.parent != relativeTo3.parent) {
								throw new openfl_errors_IllegalOperationError("relativeTo must have the same parent");
							}
							continue;
						}
						var rightPixels = right.get_value();
						var rightEdge = viewPortWidth;
						if(relativeTo3 != null) {
							rightEdge = relativeTo3.get_x();
						}
						if(layoutData.get_left() == null) {
							item.set_x(rightEdge - rightPixels - item.get_width());
						} else {
							var itemWidth = rightEdge - rightPixels - item.get_x();
							if(itemWidth < 0.0) {
								itemWidth = 0.0;
							}
							if(item.get_width() != itemWidth) {
								item.set_width(itemWidth);
								if(measurements.height == null && js_Boot.__implements(item,feathers_core_IValidating)) {
									item.validateNow();
									var maxItemY = item.get_y() + item.get_height();
									if(maxY < maxItemY) {
										maxY = maxItemY;
										needsAnotherPass = true;
										break;
									}
								}
							}
						}
					} else if(layoutData.get_horizontalCenter() != null) {
						item.set_x(layoutData.get_horizontalCenter() + (viewPortWidth - item.get_width()) / 2.0);
					}
					doneItems.push(item);
				}
				if(!needsAnotherPass && oldDoneCount == doneItems.length) {
					throw new openfl_errors_IllegalOperationError("relativeTo circular reference detected");
				}
			}
			if(needsAnotherPass) {
				++loopCount;
				if(loopCount > items.length) {
					throw new openfl_errors_IllegalOperationError("AnchorLayout is stuck in an infinite loop.");
				}
			}
		}
		if(result == null) {
			result = new feathers_layout_LayoutBoundsResult();
		}
		result.contentX = 0.0;
		result.contentY = 0.0;
		result.contentWidth = viewPortWidth;
		result.contentHeight = viewPortHeight;
		result.viewPortWidth = viewPortWidth;
		result.viewPortHeight = viewPortHeight;
		return result;
	}
	,__class__: feathers_layout_AnchorLayout
});
var feathers_layout_Anchor = function(value,relativeTo) {
	if(value == null) {
		value = 0.0;
	}
	openfl_events_EventDispatcher.call(this);
	this._value = value;
	this._relativeTo = relativeTo;
};
$hxClasses["feathers.layout.Anchor"] = feathers_layout_Anchor;
feathers_layout_Anchor.__name__ = "feathers.layout.Anchor";
feathers_layout_Anchor.__super__ = openfl_events_EventDispatcher;
feathers_layout_Anchor.prototype = $extend(openfl_events_EventDispatcher.prototype,{
	_value: null
	,get_value: function() {
		return this._value;
	}
	,set_value: function(newValue) {
		if(this._value == newValue) {
			return this._value;
		}
		this._value = newValue;
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._value;
	}
	,_relativeTo: null
	,get_relativeTo: function() {
		return this._relativeTo;
	}
	,set_relativeTo: function(value) {
		if(this._relativeTo == value) {
			return this._relativeTo;
		}
		this._relativeTo = value;
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._relativeTo;
	}
	,__class__: feathers_layout_Anchor
	,__properties__: {set_relativeTo:"set_relativeTo",get_relativeTo:"get_relativeTo",set_value:"set_value",get_value:"get_value"}
});
var feathers_layout_AbstractAnchor = {};
feathers_layout_AbstractAnchor.fromPixels = function(pixels) {
	return new feathers_layout_Anchor(pixels);
};
feathers_layout_AbstractAnchor.fromDisplayObject = function(relativeTo) {
	return new feathers_layout_Anchor(0.0,relativeTo);
};
var feathers_layout_ILayoutData = function() { };
$hxClasses["feathers.layout.ILayoutData"] = feathers_layout_ILayoutData;
feathers_layout_ILayoutData.__name__ = "feathers.layout.ILayoutData";
feathers_layout_ILayoutData.__isInterface__ = true;
feathers_layout_ILayoutData.__interfaces__ = [openfl_events_IEventDispatcher];
var feathers_layout_AnchorLayoutData = function(top,right,bottom,left,horizontalCenter,verticalCenter) {
	this._verticalCenter = null;
	this._horizontalCenter = null;
	this._left = null;
	this._bottom = null;
	this._right = null;
	this._top = null;
	openfl_events_EventDispatcher.call(this);
	this.set_top(top);
	this.set_right(right);
	this.set_bottom(bottom);
	this.set_left(left);
	this.set_horizontalCenter(horizontalCenter);
	this.set_verticalCenter(verticalCenter);
};
$hxClasses["feathers.layout.AnchorLayoutData"] = feathers_layout_AnchorLayoutData;
feathers_layout_AnchorLayoutData.__name__ = "feathers.layout.AnchorLayoutData";
feathers_layout_AnchorLayoutData.__interfaces__ = [feathers_layout_ILayoutData];
feathers_layout_AnchorLayoutData.center = function(x,y) {
	if(y == null) {
		y = 0.0;
	}
	if(x == null) {
		x = 0.0;
	}
	return new feathers_layout_AnchorLayoutData(null,null,null,null,x,y);
};
feathers_layout_AnchorLayoutData.fill = function(padding) {
	if(padding == null) {
		padding = 0.0;
	}
	return new feathers_layout_AnchorLayoutData(feathers_layout_AbstractAnchor.fromPixels(padding),feathers_layout_AbstractAnchor.fromPixels(padding),feathers_layout_AbstractAnchor.fromPixels(padding),feathers_layout_AbstractAnchor.fromPixels(padding));
};
feathers_layout_AnchorLayoutData.fillHorizontal = function(padding) {
	if(padding == null) {
		padding = 0.0;
	}
	return new feathers_layout_AnchorLayoutData(null,feathers_layout_AbstractAnchor.fromPixels(padding),null,feathers_layout_AbstractAnchor.fromPixels(padding));
};
feathers_layout_AnchorLayoutData.fillVertical = function(padding) {
	if(padding == null) {
		padding = 0.0;
	}
	return new feathers_layout_AnchorLayoutData(feathers_layout_AbstractAnchor.fromPixels(padding),null,feathers_layout_AbstractAnchor.fromPixels(padding),null);
};
feathers_layout_AnchorLayoutData.topLeft = function(top,left) {
	if(left == null) {
		left = 0.0;
	}
	if(top == null) {
		top = 0.0;
	}
	return new feathers_layout_AnchorLayoutData(feathers_layout_AbstractAnchor.fromPixels(top),null,null,feathers_layout_AbstractAnchor.fromPixels(left));
};
feathers_layout_AnchorLayoutData.topCenter = function(top,horizontalCenter) {
	if(horizontalCenter == null) {
		horizontalCenter = 0.0;
	}
	if(top == null) {
		top = 0.0;
	}
	return new feathers_layout_AnchorLayoutData(feathers_layout_AbstractAnchor.fromPixels(top),null,null,null,horizontalCenter);
};
feathers_layout_AnchorLayoutData.topRight = function(top,right) {
	if(right == null) {
		right = 0.0;
	}
	if(top == null) {
		top = 0.0;
	}
	return new feathers_layout_AnchorLayoutData(feathers_layout_AbstractAnchor.fromPixels(top),feathers_layout_AbstractAnchor.fromPixels(right));
};
feathers_layout_AnchorLayoutData.middleLeft = function(verticalCenter,left) {
	if(left == null) {
		left = 0.0;
	}
	if(verticalCenter == null) {
		verticalCenter = 0.0;
	}
	return new feathers_layout_AnchorLayoutData(null,null,null,feathers_layout_AbstractAnchor.fromPixels(left),null,verticalCenter);
};
feathers_layout_AnchorLayoutData.middleRight = function(verticalCenter,right) {
	if(right == null) {
		right = 0.0;
	}
	if(verticalCenter == null) {
		verticalCenter = 0.0;
	}
	return new feathers_layout_AnchorLayoutData(null,feathers_layout_AbstractAnchor.fromPixels(right),null,null,null,verticalCenter);
};
feathers_layout_AnchorLayoutData.bottomLeft = function(bottom,left) {
	if(left == null) {
		left = 0.0;
	}
	if(bottom == null) {
		bottom = 0.0;
	}
	return new feathers_layout_AnchorLayoutData(null,null,feathers_layout_AbstractAnchor.fromPixels(bottom),feathers_layout_AbstractAnchor.fromPixels(left));
};
feathers_layout_AnchorLayoutData.bottomCenter = function(bottom,horizontalCenter) {
	if(horizontalCenter == null) {
		horizontalCenter = 0.0;
	}
	if(bottom == null) {
		bottom = 0.0;
	}
	return new feathers_layout_AnchorLayoutData(null,null,feathers_layout_AbstractAnchor.fromPixels(bottom),null,horizontalCenter);
};
feathers_layout_AnchorLayoutData.bottomRight = function(bottom,right) {
	if(right == null) {
		right = 0.0;
	}
	if(bottom == null) {
		bottom = 0.0;
	}
	return new feathers_layout_AnchorLayoutData(null,feathers_layout_AbstractAnchor.fromPixels(right),feathers_layout_AbstractAnchor.fromPixels(bottom));
};
feathers_layout_AnchorLayoutData.__super__ = openfl_events_EventDispatcher;
feathers_layout_AnchorLayoutData.prototype = $extend(openfl_events_EventDispatcher.prototype,{
	_top: null
	,get_top: function() {
		return this._top;
	}
	,set_top: function(value) {
		if(this._top == value) {
			return this._top;
		}
		if(this._top != null) {
			var top = this._top;
			top.removeEventListener("change",$bind(this,this.anchorLayoutData_anchor_changeHandler));
		}
		this._top = value;
		if(this._top != null) {
			var top = this._top;
			top.addEventListener("change",$bind(this,this.anchorLayoutData_anchor_changeHandler),false,0,true);
		}
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._top;
	}
	,_right: null
	,get_right: function() {
		return this._right;
	}
	,set_right: function(value) {
		if(this._right == value) {
			return this._right;
		}
		if(this._right != null) {
			var anchor = this._right;
			anchor.removeEventListener("change",$bind(this,this.anchorLayoutData_anchor_changeHandler));
		}
		this._right = value;
		if(this._right != null) {
			var anchor = this._right;
			anchor.addEventListener("change",$bind(this,this.anchorLayoutData_anchor_changeHandler),false,0,true);
		}
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._right;
	}
	,_bottom: null
	,get_bottom: function() {
		return this._bottom;
	}
	,set_bottom: function(value) {
		if(this._bottom == value) {
			return this._bottom;
		}
		if(this._bottom != null) {
			var anchor = this._bottom;
			anchor.removeEventListener("change",$bind(this,this.anchorLayoutData_anchor_changeHandler));
		}
		this._bottom = value;
		if(this._bottom != null) {
			var anchor = this._bottom;
			anchor.addEventListener("change",$bind(this,this.anchorLayoutData_anchor_changeHandler),false,0,true);
		}
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._bottom;
	}
	,_left: null
	,get_left: function() {
		return this._left;
	}
	,set_left: function(value) {
		if(this._left == value) {
			return this._left;
		}
		if(this._left != null) {
			var anchor = this._left;
			anchor.removeEventListener("change",$bind(this,this.anchorLayoutData_anchor_changeHandler));
		}
		this._left = value;
		if(this._left != null) {
			var anchor = this._left;
			anchor.addEventListener("change",$bind(this,this.anchorLayoutData_anchor_changeHandler),false,0,true);
		}
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._left;
	}
	,_horizontalCenter: null
	,get_horizontalCenter: function() {
		return this._horizontalCenter;
	}
	,set_horizontalCenter: function(value) {
		if(this._horizontalCenter == value) {
			return this._horizontalCenter;
		}
		this._horizontalCenter = value;
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._horizontalCenter;
	}
	,_verticalCenter: null
	,get_verticalCenter: function() {
		return this._verticalCenter;
	}
	,set_verticalCenter: function(value) {
		if(this._verticalCenter == value) {
			return this._verticalCenter;
		}
		this._verticalCenter = value;
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._verticalCenter;
	}
	,anchorLayoutData_anchor_changeHandler: function(event) {
		feathers_events_FeathersEvent.dispatch(this,"change");
	}
	,__class__: feathers_layout_AnchorLayoutData
	,__properties__: {set_verticalCenter:"set_verticalCenter",get_verticalCenter:"get_verticalCenter",set_horizontalCenter:"set_horizontalCenter",get_horizontalCenter:"get_horizontalCenter",set_left:"set_left",get_left:"get_left",set_bottom:"set_bottom",get_bottom:"get_bottom",set_right:"set_right",get_right:"get_right",set_top:"set_top",get_top:"get_top"}
});
var feathers_layout_AutoSizeMode = $hxEnums["feathers.layout.AutoSizeMode"] = { __ename__:"feathers.layout.AutoSizeMode",__constructs__:null
	,STAGE: {_hx_name:"STAGE",_hx_index:0,__enum__:"feathers.layout.AutoSizeMode",toString:$estr}
	,CONTENT: {_hx_name:"CONTENT",_hx_index:1,__enum__:"feathers.layout.AutoSizeMode",toString:$estr}
};
feathers_layout_AutoSizeMode.__constructs__ = [feathers_layout_AutoSizeMode.STAGE,feathers_layout_AutoSizeMode.CONTENT];
var feathers_layout_CalendarGridLayout = function() {
	this._verticalGap = 0.0;
	this._horizontalGap = 0.0;
	this._paddingLeft = 0.0;
	this._paddingBottom = 0.0;
	this._paddingRight = 0.0;
	this._paddingTop = 0.0;
	openfl_events_EventDispatcher.call(this);
};
$hxClasses["feathers.layout.CalendarGridLayout"] = feathers_layout_CalendarGridLayout;
feathers_layout_CalendarGridLayout.__name__ = "feathers.layout.CalendarGridLayout";
feathers_layout_CalendarGridLayout.__interfaces__ = [feathers_layout_ILayout];
feathers_layout_CalendarGridLayout.__super__ = openfl_events_EventDispatcher;
feathers_layout_CalendarGridLayout.prototype = $extend(openfl_events_EventDispatcher.prototype,{
	_paddingTop: null
	,get_paddingTop: function() {
		return this._paddingTop;
	}
	,set_paddingTop: function(value) {
		if(this._paddingTop == value) {
			return this._paddingTop;
		}
		this._paddingTop = value;
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._paddingTop;
	}
	,_paddingRight: null
	,get_paddingRight: function() {
		return this._paddingRight;
	}
	,set_paddingRight: function(value) {
		if(this._paddingRight == value) {
			return this._paddingRight;
		}
		this._paddingRight = value;
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._paddingRight;
	}
	,_paddingBottom: null
	,get_paddingBottom: function() {
		return this._paddingBottom;
	}
	,set_paddingBottom: function(value) {
		if(this._paddingBottom == value) {
			return this._paddingBottom;
		}
		this._paddingBottom = value;
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._paddingBottom;
	}
	,_paddingLeft: null
	,get_paddingLeft: function() {
		return this._paddingLeft;
	}
	,set_paddingLeft: function(value) {
		if(this._paddingLeft == value) {
			return this._paddingLeft;
		}
		this._paddingLeft = value;
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._paddingLeft;
	}
	,_horizontalGap: null
	,get_horizontalGap: function() {
		return this._horizontalGap;
	}
	,set_horizontalGap: function(value) {
		if(this._horizontalGap == value) {
			return this._horizontalGap;
		}
		this._horizontalGap = value;
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._horizontalGap;
	}
	,_verticalGap: null
	,get_verticalGap: function() {
		return this._verticalGap;
	}
	,set_verticalGap: function(value) {
		if(this._verticalGap == value) {
			return this._verticalGap;
		}
		this._verticalGap = value;
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._verticalGap;
	}
	,setPadding: function(value) {
		this.set_paddingTop(value);
		this.set_paddingRight(value);
		this.set_paddingBottom(value);
		this.set_paddingLeft(value);
	}
	,setGap: function(value) {
		this.set_horizontalGap(value);
		this.set_verticalGap(value);
	}
	,layout: function(items,measurements,result) {
		var _g = 0;
		while(_g < items.length) {
			var item = items[_g];
			++_g;
			if(js_Boot.__implements(item,feathers_layout_ILayoutObject)) {
				var layoutItem = item;
				if(!layoutItem.get_includeInLayout()) {
					continue;
				}
			}
			if(js_Boot.__implements(item,feathers_core_IValidating)) {
				item.validateNow();
			}
		}
		var tileWidth = 0.0;
		var tileHeight = 0.0;
		var _g = 0;
		while(_g < items.length) {
			var item = items[_g];
			++_g;
			if(js_Boot.__implements(item,feathers_layout_ILayoutObject)) {
				var layoutItem = item;
				if(!layoutItem.get_includeInLayout()) {
					continue;
				}
			}
			tileWidth = Math.max(tileWidth,item.get_width());
			tileHeight = Math.max(tileHeight,item.get_height());
		}
		if(tileWidth < 0.0) {
			tileWidth = 0.0;
		}
		if(tileHeight < 0.0) {
			tileHeight = 0.0;
		}
		var horizontalTileCount = 7;
		var verticalTileCount = Math.ceil(items.length / horizontalTileCount);
		var viewPortWidth = measurements.width;
		if(viewPortWidth != null) {
			var availableWidth = viewPortWidth - this._paddingLeft - this._paddingRight - this._horizontalGap * horizontalTileCount + this._horizontalGap;
			tileWidth = availableWidth / horizontalTileCount;
		} else {
			viewPortWidth = this._paddingLeft + this._paddingRight + horizontalTileCount * (tileWidth + this._horizontalGap) - this._horizontalGap;
			if(measurements.minWidth != null && viewPortWidth < measurements.minWidth) {
				viewPortWidth = measurements.minWidth;
			} else if(measurements.maxWidth != null && viewPortWidth > measurements.maxWidth) {
				viewPortWidth = measurements.maxWidth;
			}
		}
		var viewPortHeight = measurements.height;
		if(viewPortHeight != null) {
			var availableHeight = viewPortHeight - this._paddingTop - this._paddingBottom - this._verticalGap * verticalTileCount + this._verticalGap;
			tileHeight = availableHeight / verticalTileCount;
		} else {
			viewPortHeight = this._paddingTop + this._paddingBottom + verticalTileCount * (tileHeight + this._verticalGap) - this._verticalGap;
			if(measurements.minHeight != null && viewPortHeight < measurements.minHeight) {
				viewPortHeight = measurements.minHeight;
			} else if(measurements.maxHeight != null && viewPortHeight > measurements.maxHeight) {
				viewPortHeight = measurements.maxHeight;
			}
		}
		var currentColumnCount = 0;
		var xPosition = this._paddingLeft;
		var yPosition = this._paddingTop;
		var _g = 0;
		var _g1 = items.length;
		while(_g < _g1) {
			var i = _g++;
			var item = items[i];
			if(js_Boot.__implements(item,feathers_layout_ILayoutObject)) {
				var layoutItem = item;
				if(!layoutItem.get_includeInLayout()) {
					continue;
				}
			}
			if(item.get_width() != tileWidth) {
				item.set_width(tileWidth);
			}
			if(item.get_height() != tileHeight) {
				item.set_height(tileHeight);
			}
			if(currentColumnCount >= horizontalTileCount) {
				xPosition = this._paddingLeft;
				yPosition += tileHeight + this._verticalGap;
				currentColumnCount = 0;
			}
			item.set_x(xPosition);
			item.set_y(yPosition);
			xPosition += tileWidth + this._horizontalGap;
			++currentColumnCount;
		}
		yPosition += tileHeight + this.get_paddingBottom();
		if(result == null) {
			result = new feathers_layout_LayoutBoundsResult();
		}
		result.contentX = 0.0;
		result.contentY = 0.0;
		result.contentWidth = viewPortWidth;
		result.contentHeight = viewPortHeight;
		result.viewPortWidth = viewPortWidth;
		result.viewPortHeight = viewPortHeight;
		return result;
	}
	,validateItems: function(items,measurements) {
		var _g = 0;
		while(_g < items.length) {
			var item = items[_g];
			++_g;
			if(js_Boot.__implements(item,feathers_layout_ILayoutObject)) {
				var layoutItem = item;
				if(!layoutItem.get_includeInLayout()) {
					continue;
				}
			}
			if(js_Boot.__implements(item,feathers_core_IValidating)) {
				item.validateNow();
			}
		}
	}
	,__class__: feathers_layout_CalendarGridLayout
	,__properties__: {set_verticalGap:"set_verticalGap",get_verticalGap:"get_verticalGap",set_horizontalGap:"set_horizontalGap",get_horizontalGap:"get_horizontalGap",set_paddingLeft:"set_paddingLeft",get_paddingLeft:"get_paddingLeft",set_paddingBottom:"set_paddingBottom",get_paddingBottom:"get_paddingBottom",set_paddingRight:"set_paddingRight",get_paddingRight:"get_paddingRight",set_paddingTop:"set_paddingTop",get_paddingTop:"get_paddingTop"}
});
var feathers_layout_Direction = $hxEnums["feathers.layout.Direction"] = { __ename__:"feathers.layout.Direction",__constructs__:null
	,VERTICAL: {_hx_name:"VERTICAL",_hx_index:0,__enum__:"feathers.layout.Direction",toString:$estr}
	,HORIZONTAL: {_hx_name:"HORIZONTAL",_hx_index:1,__enum__:"feathers.layout.Direction",toString:$estr}
	,NONE: {_hx_name:"NONE",_hx_index:2,__enum__:"feathers.layout.Direction",toString:$estr}
};
feathers_layout_Direction.__constructs__ = [feathers_layout_Direction.VERTICAL,feathers_layout_Direction.HORIZONTAL,feathers_layout_Direction.NONE];
var feathers_layout_FormLayout = function() {
	this._verticalAlign = feathers_layout_VerticalAlign.TOP;
	this._gap = 0.0;
	this._paddingLeft = 0.0;
	this._paddingBottom = 0.0;
	this._paddingRight = 0.0;
	this._paddingTop = 0.0;
	openfl_events_EventDispatcher.call(this);
};
$hxClasses["feathers.layout.FormLayout"] = feathers_layout_FormLayout;
feathers_layout_FormLayout.__name__ = "feathers.layout.FormLayout";
feathers_layout_FormLayout.__interfaces__ = [feathers_layout_ILayout];
feathers_layout_FormLayout.__super__ = openfl_events_EventDispatcher;
feathers_layout_FormLayout.prototype = $extend(openfl_events_EventDispatcher.prototype,{
	_paddingTop: null
	,get_paddingTop: function() {
		return this._paddingTop;
	}
	,set_paddingTop: function(value) {
		if(this._paddingTop == value) {
			return this._paddingTop;
		}
		this._paddingTop = value;
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._paddingTop;
	}
	,_paddingRight: null
	,get_paddingRight: function() {
		return this._paddingRight;
	}
	,set_paddingRight: function(value) {
		if(this._paddingRight == value) {
			return this._paddingRight;
		}
		this._paddingRight = value;
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._paddingRight;
	}
	,_paddingBottom: null
	,get_paddingBottom: function() {
		return this._paddingBottom;
	}
	,set_paddingBottom: function(value) {
		if(this._paddingBottom == value) {
			return this._paddingBottom;
		}
		this._paddingBottom = value;
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._paddingBottom;
	}
	,_paddingLeft: null
	,get_paddingLeft: function() {
		return this._paddingLeft;
	}
	,set_paddingLeft: function(value) {
		if(this._paddingLeft == value) {
			return this._paddingLeft;
		}
		this._paddingLeft = value;
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._paddingLeft;
	}
	,_gap: null
	,get_gap: function() {
		return this._gap;
	}
	,set_gap: function(value) {
		if(this._gap == value) {
			return this._gap;
		}
		this._gap = value;
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._gap;
	}
	,_verticalAlign: null
	,get_verticalAlign: function() {
		return this._verticalAlign;
	}
	,set_verticalAlign: function(value) {
		if(this._verticalAlign == value) {
			return this._verticalAlign;
		}
		this._verticalAlign = value;
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._verticalAlign;
	}
	,setPadding: function(value) {
		this.set_paddingTop(value);
		this.set_paddingRight(value);
		this.set_paddingBottom(value);
		this.set_paddingLeft(value);
	}
	,layout: function(items,measurements,result) {
		var _g = 0;
		while(_g < items.length) {
			var item = items[_g];
			++_g;
			var formItem = ((item) instanceof feathers_controls_FormItem) ? item : null;
			if(formItem != null) {
				formItem.set_customTextColumnWidth(null);
			}
			if(js_Boot.__implements(item,feathers_core_IValidating)) {
				item.validateNow();
			}
		}
		var maxMaxLeftTextWidth = 1.0 / 0.0;
		var maxMaxRightTextWidth = 1.0 / 0.0;
		var maxLeftTextWidth = 0.0;
		var maxRightTextWidth = 0.0;
		var _g = 0;
		while(_g < items.length) {
			var item = items[_g];
			++_g;
			var layoutObject = null;
			if(js_Boot.__implements(item,feathers_layout_ILayoutObject)) {
				layoutObject = item;
				if(!layoutObject.get_includeInLayout()) {
					continue;
				}
			}
			var formItem = ((item) instanceof feathers_controls_FormItem) ? item : null;
			if(formItem == null) {
				continue;
			}
			switch(formItem.get_textPosition()._hx_index) {
			case 1:
				maxRightTextWidth = Math.max(maxRightTextWidth,formItem.getTextMeasuredWidth());
				maxMaxRightTextWidth = Math.min(maxMaxRightTextWidth,formItem.getTextMeasuredMaxWidth());
				break;
			case 3:
				maxLeftTextWidth = Math.max(maxLeftTextWidth,formItem.getTextMeasuredWidth());
				maxMaxLeftTextWidth = Math.min(maxMaxLeftTextWidth,formItem.getTextMeasuredMaxWidth());
				break;
			default:
				continue;
			}
		}
		if(maxLeftTextWidth > maxMaxLeftTextWidth) {
			maxLeftTextWidth = maxMaxLeftTextWidth;
		}
		if(maxRightTextWidth > maxMaxRightTextWidth) {
			maxRightTextWidth = maxMaxRightTextWidth;
		}
		var contentWidth = 0.0;
		var contentHeight = this._paddingTop;
		var _g = 0;
		while(_g < items.length) {
			var item = items[_g];
			++_g;
			var layoutObject = null;
			if(js_Boot.__implements(item,feathers_layout_ILayoutObject)) {
				layoutObject = item;
				if(!layoutObject.get_includeInLayout()) {
					continue;
				}
			}
			var formItem = ((item) instanceof feathers_controls_FormItem) ? item : null;
			if(formItem != null) {
				switch(formItem.get_textPosition()._hx_index) {
				case 1:
					formItem.set_customTextColumnWidth(maxRightTextWidth);
					break;
				case 3:
					formItem.set_customTextColumnWidth(maxLeftTextWidth);
					break;
				default:
					formItem.set_customTextColumnWidth(null);
				}
				if(js_Boot.__implements(item,feathers_core_IValidating)) {
					item.validateNow();
				}
			}
			if(contentWidth < item.get_width()) {
				contentWidth = item.get_width();
			}
			item.set_x(this._paddingLeft);
			item.set_y(contentHeight);
			contentHeight += item.get_height() + this._gap;
		}
		contentWidth += this._paddingLeft + this._paddingRight;
		contentHeight += this._paddingBottom;
		if(items.length > 0) {
			contentHeight -= this._gap;
		}
		var viewPortWidth = contentWidth;
		if(measurements.width != null) {
			viewPortWidth = measurements.width;
		} else if(measurements.minWidth != null && viewPortWidth < measurements.minWidth) {
			viewPortWidth = measurements.minWidth;
		} else if(measurements.maxWidth != null && viewPortWidth > measurements.maxWidth) {
			viewPortWidth = measurements.maxWidth;
		}
		var viewPortHeight = contentHeight;
		if(measurements.height != null) {
			viewPortHeight = measurements.height;
		} else if(measurements.minHeight != null && viewPortHeight < measurements.minHeight) {
			viewPortHeight = measurements.minHeight;
		} else if(measurements.maxHeight != null && viewPortHeight > measurements.maxHeight) {
			viewPortHeight = measurements.maxHeight;
		}
		var _g = 0;
		while(_g < items.length) {
			var item = items[_g];
			++_g;
			var layoutObject = null;
			if(js_Boot.__implements(item,feathers_layout_ILayoutObject)) {
				layoutObject = item;
				if(!layoutObject.get_includeInLayout()) {
					continue;
				}
			}
			item.set_width(viewPortWidth - this._paddingLeft - this._paddingRight);
		}
		var contentHeight1 = contentHeight - this._paddingTop - this._paddingBottom;
		if(!(this._verticalAlign != feathers_layout_VerticalAlign.BOTTOM && this._verticalAlign != feathers_layout_VerticalAlign.MIDDLE)) {
			var maxAlignmentHeight = viewPortHeight - this._paddingTop - this._paddingBottom;
			if(!(contentHeight1 >= maxAlignmentHeight)) {
				var verticalOffset = 0.0;
				if(this._verticalAlign == feathers_layout_VerticalAlign.BOTTOM) {
					verticalOffset = maxAlignmentHeight - contentHeight1;
				} else if(this._verticalAlign == feathers_layout_VerticalAlign.MIDDLE) {
					verticalOffset = (maxAlignmentHeight - contentHeight1) / 2.0;
				}
				var _g = 0;
				while(_g < items.length) {
					var item = items[_g];
					++_g;
					var layoutObject = null;
					if(js_Boot.__implements(item,feathers_layout_ILayoutObject)) {
						layoutObject = item;
						if(!layoutObject.get_includeInLayout()) {
							continue;
						}
					}
					item.set_y(Math.max(this._paddingTop,item.get_y() + verticalOffset));
				}
			}
		}
		if(contentWidth < viewPortWidth) {
			contentWidth = viewPortWidth;
		}
		if(contentHeight < viewPortHeight) {
			contentHeight = viewPortHeight;
		}
		if(result == null) {
			result = new feathers_layout_LayoutBoundsResult();
		}
		result.contentX = 0.0;
		result.contentY = 0.0;
		result.contentWidth = contentWidth;
		result.contentHeight = contentHeight;
		result.viewPortWidth = viewPortWidth;
		result.viewPortHeight = viewPortHeight;
		return result;
	}
	,validateItems: function(items) {
		var _g = 0;
		while(_g < items.length) {
			var item = items[_g];
			++_g;
			var formItem = ((item) instanceof feathers_controls_FormItem) ? item : null;
			if(formItem != null) {
				formItem.set_customTextColumnWidth(null);
			}
			if(js_Boot.__implements(item,feathers_core_IValidating)) {
				item.validateNow();
			}
		}
	}
	,applyHorizontalAlign: function(items,viewPortWidth) {
		var _g = 0;
		while(_g < items.length) {
			var item = items[_g];
			++_g;
			var layoutObject = null;
			if(js_Boot.__implements(item,feathers_layout_ILayoutObject)) {
				layoutObject = item;
				if(!layoutObject.get_includeInLayout()) {
					continue;
				}
			}
			item.set_width(viewPortWidth - this._paddingLeft - this._paddingRight);
		}
	}
	,applyVerticalAlign: function(items,contentHeight,viewPortHeight) {
		if(this._verticalAlign != feathers_layout_VerticalAlign.BOTTOM && this._verticalAlign != feathers_layout_VerticalAlign.MIDDLE) {
			return;
		}
		var maxAlignmentHeight = viewPortHeight - this._paddingTop - this._paddingBottom;
		if(contentHeight >= maxAlignmentHeight) {
			return;
		}
		var verticalOffset = 0.0;
		if(this._verticalAlign == feathers_layout_VerticalAlign.BOTTOM) {
			verticalOffset = maxAlignmentHeight - contentHeight;
		} else if(this._verticalAlign == feathers_layout_VerticalAlign.MIDDLE) {
			verticalOffset = (maxAlignmentHeight - contentHeight) / 2.0;
		}
		var _g = 0;
		while(_g < items.length) {
			var item = items[_g];
			++_g;
			var layoutObject = null;
			if(js_Boot.__implements(item,feathers_layout_ILayoutObject)) {
				layoutObject = item;
				if(!layoutObject.get_includeInLayout()) {
					continue;
				}
			}
			item.set_y(Math.max(this._paddingTop,item.get_y() + verticalOffset));
		}
	}
	,__class__: feathers_layout_FormLayout
	,__properties__: {set_verticalAlign:"set_verticalAlign",get_verticalAlign:"get_verticalAlign",set_gap:"set_gap",get_gap:"get_gap",set_paddingLeft:"set_paddingLeft",get_paddingLeft:"get_paddingLeft",set_paddingBottom:"set_paddingBottom",get_paddingBottom:"get_paddingBottom",set_paddingRight:"set_paddingRight",get_paddingRight:"get_paddingRight",set_paddingTop:"set_paddingTop",get_paddingTop:"get_paddingTop"}
});
var feathers_layout_GridViewRowLayout = function() {
	this._heightResetEnabled = true;
	this._paddingRight = 0.0;
	this._paddingLeft = 0.0;
	openfl_events_EventDispatcher.call(this);
};
$hxClasses["feathers.layout.GridViewRowLayout"] = feathers_layout_GridViewRowLayout;
feathers_layout_GridViewRowLayout.__name__ = "feathers.layout.GridViewRowLayout";
feathers_layout_GridViewRowLayout.__interfaces__ = [feathers_layout_ILayout];
feathers_layout_GridViewRowLayout.__super__ = openfl_events_EventDispatcher;
feathers_layout_GridViewRowLayout.prototype = $extend(openfl_events_EventDispatcher.prototype,{
	_paddingLeft: null
	,get_paddingLeft: function() {
		return this._paddingLeft;
	}
	,set_paddingLeft: function(value) {
		if(this._paddingLeft == value) {
			return this._paddingLeft;
		}
		this._paddingLeft = value;
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._paddingLeft;
	}
	,_paddingRight: null
	,get_paddingRight: function() {
		return this._paddingRight;
	}
	,set_paddingRight: function(value) {
		if(this._paddingRight == value) {
			return this._paddingRight;
		}
		this._paddingRight = value;
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._paddingRight;
	}
	,_columns: null
	,get_columns: function() {
		return this._columns;
	}
	,set_columns: function(value) {
		if(this._columns == value) {
			return this._columns;
		}
		this._columns = value;
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._columns;
	}
	,_customColumnWidths: null
	,get_customColumnWidths: function() {
		return this._customColumnWidths;
	}
	,set_customColumnWidths: function(value) {
		if(this._customColumnWidths == value) {
			return this._customColumnWidths;
		}
		this._customColumnWidths = value;
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._customColumnWidths;
	}
	,_heightResetEnabled: null
	,get_heightResetEnabled: function() {
		return this._heightResetEnabled;
	}
	,set_heightResetEnabled: function(value) {
		if(this._heightResetEnabled == value) {
			return this._heightResetEnabled;
		}
		this._heightResetEnabled = value;
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._heightResetEnabled;
	}
	,setPadding: function(value) {
		this.set_paddingRight(value);
		this.set_paddingLeft(value);
	}
	,layout: function(items,measurements,result) {
		this.applyColumnWidths(items,measurements.width,measurements.minWidth,measurements.maxWidth);
		var contentWidth = this._paddingLeft;
		var contentHeight = 0.0;
		var _g = 0;
		while(_g < items.length) {
			var item = items[_g];
			++_g;
			if(this._heightResetEnabled && measurements.height == null && js_Boot.__implements(item,feathers_core_IMeasureObject)) {
				item.resetHeight();
			}
			if(js_Boot.__implements(item,feathers_core_IValidating)) {
				item.validateNow();
			}
			if(contentHeight < item.get_height()) {
				contentHeight = item.get_height();
			}
			item.set_x(contentWidth);
			contentWidth += item.get_width();
		}
		var viewPortWidth = contentWidth += this._paddingRight;
		if(measurements.width != null) {
			viewPortWidth = measurements.width;
		} else if(measurements.minWidth != null && viewPortWidth < measurements.minWidth) {
			viewPortWidth = measurements.minWidth;
		} else if(measurements.maxWidth != null && viewPortWidth > measurements.maxWidth) {
			viewPortWidth = measurements.maxWidth;
		}
		var viewPortHeight = contentHeight;
		if(measurements.height != null) {
			viewPortHeight = measurements.height;
		} else if(measurements.minHeight != null && viewPortHeight < measurements.minHeight) {
			viewPortHeight = measurements.minHeight;
		} else if(measurements.maxHeight != null && viewPortHeight > measurements.maxHeight) {
			viewPortHeight = measurements.maxHeight;
		}
		var _g = 0;
		while(_g < items.length) {
			var item = items[_g];
			++_g;
			item.set_height(viewPortHeight);
		}
		if(contentWidth < viewPortWidth) {
			contentWidth = viewPortWidth;
		}
		if(contentHeight < viewPortHeight) {
			contentHeight = viewPortHeight;
		}
		if(result == null) {
			result = new feathers_layout_LayoutBoundsResult();
		}
		result.contentX = 0.0;
		result.contentY = 0.0;
		result.contentWidth = contentWidth;
		result.contentHeight = contentHeight;
		result.viewPortWidth = viewPortWidth;
		result.viewPortHeight = viewPortHeight;
		return result;
	}
	,applyViewPortHeight: function(items,viewPortHeight) {
		var _g = 0;
		while(_g < items.length) {
			var item = items[_g];
			++_g;
			item.set_height(viewPortHeight);
		}
	}
	,applyColumnWidths: function(items,explicitWidth,explicitMinWidth,explicitMaxWidth) {
		var pendingIndices = [];
		var totalMeasuredWidth = 0.0;
		var totalPercentWidth = 0.0;
		var maxMinWidth = 0.0;
		var _g = 0;
		var _g1 = this._columns.get_length();
		while(_g < _g1) {
			var i = _g++;
			var column = this._columns.get(i);
			var columnWidth = column.width;
			var item = items[i];
			if(columnWidth != null) {
				item.set_width(columnWidth);
				if(js_Boot.__implements(item,feathers_core_IValidating)) {
					item.validateNow();
				}
			} else if(this._customColumnWidths != null && i < this._customColumnWidths.length) {
				item.set_width(this._customColumnWidths[i]);
				if(js_Boot.__implements(item,feathers_core_IValidating)) {
					item.validateNow();
				}
			} else {
				var percentWidth = 100.0;
				var itemMinWidth = 0.0;
				if(js_Boot.__implements(item,feathers_core_IMeasureObject)) {
					if(js_Boot.__implements(item,feathers_core_IValidating)) {
						item.validateNow();
					}
					itemMinWidth = item.get_minWidth();
				}
				itemMinWidth = Math.max(column.minWidth,itemMinWidth);
				maxMinWidth = Math.max(itemMinWidth,maxMinWidth);
				totalPercentWidth += percentWidth;
				pendingIndices.push(i);
				continue;
			}
			totalMeasuredWidth += item.get_width();
		}
		totalMeasuredWidth += this._paddingLeft + this._paddingRight;
		var remainingWidth = 0.0;
		if(explicitWidth != null) {
			remainingWidth = explicitWidth;
		} else {
			var totalMaxMinWidth = pendingIndices.length * maxMinWidth;
			remainingWidth = totalMeasuredWidth + totalMaxMinWidth;
			if(explicitMinWidth != null && remainingWidth < explicitMinWidth) {
				remainingWidth = explicitMinWidth;
			} else if(explicitMaxWidth != null && remainingWidth > explicitMaxWidth) {
				remainingWidth = explicitMaxWidth;
			}
		}
		remainingWidth -= totalMeasuredWidth;
		if(remainingWidth < 0.0) {
			remainingWidth = 0.0;
		}
		var needsAnotherPass = false;
		do {
			needsAnotherPass = false;
			var widthSum = 0.0;
			var percentToPixels = remainingWidth / totalPercentWidth;
			var _g = 0;
			while(_g < pendingIndices.length) {
				var index = pendingIndices[_g];
				++_g;
				var item = items[index];
				var column = this._columns.get(index);
				var percentWidth = 100.0;
				var itemWidth = Math.floor(percentToPixels * percentWidth);
				var columnMinWidth = column.minWidth;
				if(columnMinWidth > remainingWidth) {
					columnMinWidth = remainingWidth;
				}
				if(itemWidth < columnMinWidth) {
					itemWidth = columnMinWidth;
					remainingWidth -= itemWidth;
					totalPercentWidth -= percentWidth;
					HxOverrides.remove(pendingIndices,index);
					needsAnotherPass = true;
				}
				item.set_width(itemWidth);
				if(js_Boot.__implements(item,feathers_core_IValidating)) {
					item.validateNow();
				}
				widthSum += itemWidth;
			}
			if(needsAnotherPass) {
				widthSum = 0.0;
			} else {
				remainingWidth -= widthSum;
			}
		} while(needsAnotherPass);
		if(remainingWidth > 0.0 && pendingIndices.length > 0) {
			var index = pendingIndices[pendingIndices.length - 1];
			var finalItem = items[index];
			finalItem.set_width(finalItem.get_width() + remainingWidth);
		}
	}
	,__class__: feathers_layout_GridViewRowLayout
	,__properties__: {set_heightResetEnabled:"set_heightResetEnabled",get_heightResetEnabled:"get_heightResetEnabled",set_customColumnWidths:"set_customColumnWidths",get_customColumnWidths:"get_customColumnWidths",set_columns:"set_columns",get_columns:"get_columns",set_paddingRight:"set_paddingRight",get_paddingRight:"get_paddingRight",set_paddingLeft:"set_paddingLeft",get_paddingLeft:"get_paddingLeft"}
});
var feathers_layout_HDividedBoxLayout = function() {
	this._fallbackFluidIndex = -1;
	this._verticalAlign = feathers_layout_VerticalAlign.JUSTIFY;
	this._paddingLeft = 0.0;
	this._paddingBottom = 0.0;
	this._paddingRight = 0.0;
	this._paddingTop = 0.0;
	openfl_events_EventDispatcher.call(this);
};
$hxClasses["feathers.layout.HDividedBoxLayout"] = feathers_layout_HDividedBoxLayout;
feathers_layout_HDividedBoxLayout.__name__ = "feathers.layout.HDividedBoxLayout";
feathers_layout_HDividedBoxLayout.__interfaces__ = [feathers_layout_ILayout];
feathers_layout_HDividedBoxLayout.__super__ = openfl_events_EventDispatcher;
feathers_layout_HDividedBoxLayout.prototype = $extend(openfl_events_EventDispatcher.prototype,{
	_paddingTop: null
	,get_paddingTop: function() {
		return this._paddingTop;
	}
	,set_paddingTop: function(value) {
		if(this._paddingTop == value) {
			return this._paddingTop;
		}
		this._paddingTop = value;
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._paddingTop;
	}
	,_paddingRight: null
	,get_paddingRight: function() {
		return this._paddingRight;
	}
	,set_paddingRight: function(value) {
		if(this._paddingRight == value) {
			return this._paddingRight;
		}
		this._paddingRight = value;
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._paddingRight;
	}
	,_paddingBottom: null
	,get_paddingBottom: function() {
		return this._paddingBottom;
	}
	,set_paddingBottom: function(value) {
		if(this._paddingBottom == value) {
			return this._paddingBottom;
		}
		this._paddingBottom = value;
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._paddingBottom;
	}
	,_paddingLeft: null
	,get_paddingLeft: function() {
		return this._paddingLeft;
	}
	,set_paddingLeft: function(value) {
		if(this._paddingLeft == value) {
			return this._paddingLeft;
		}
		this._paddingLeft = value;
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._paddingLeft;
	}
	,_verticalAlign: null
	,get_verticalAlign: function() {
		return this._verticalAlign;
	}
	,set_verticalAlign: function(value) {
		if(this._verticalAlign == value) {
			return this._verticalAlign;
		}
		this._verticalAlign = value;
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._verticalAlign;
	}
	,_customItemWidths: null
	,get_customItemWidths: function() {
		return this._customItemWidths;
	}
	,set_customItemWidths: function(value) {
		if(this._customItemWidths == value) {
			return this._customItemWidths;
		}
		this._customItemWidths = value;
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._customItemWidths;
	}
	,_fallbackFluidIndex: null
	,get_fallbackFluidIndex: function() {
		return this._fallbackFluidIndex;
	}
	,set_fallbackFluidIndex: function(value) {
		if(this._fallbackFluidIndex == value) {
			return this._fallbackFluidIndex;
		}
		this._fallbackFluidIndex = value;
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._fallbackFluidIndex;
	}
	,setPadding: function(value) {
		this.set_paddingTop(value);
		this.set_paddingRight(value);
		this.set_paddingBottom(value);
		this.set_paddingLeft(value);
	}
	,layout: function(items,measurements,result) {
		var i = 0;
		while(i < items.length) {
			var item = items[i];
			var divider = null;
			if(i > 0) {
				divider = items[i - 1];
			}
			if(js_Boot.__implements(item,feathers_layout_ILayoutObject) && !item.get_includeInLayout()) {
				i += 2;
				continue;
			}
			if(this._customItemWidths != null && i < this._customItemWidths.length) {
				var itemWidth = this._customItemWidths[i];
				if(itemWidth != null) {
					item.set_width(itemWidth);
				}
			}
			if(js_Boot.__implements(item,feathers_core_IValidating)) {
				item.validateNow();
			}
			if(js_Boot.__implements(divider,feathers_core_IValidating)) {
				divider.validateNow();
			}
			i += 2;
		}
		this.applyPercentWidth(items,measurements.width,measurements.minWidth,measurements.maxWidth);
		var contentWidth = this._paddingLeft;
		var contentHeight = 0.0;
		var i = 0;
		while(i < items.length) {
			var item = items[i];
			var divider = null;
			if(i > 0) {
				divider = items[i - 1];
			}
			if(js_Boot.__implements(item,feathers_layout_ILayoutObject) && !item.get_includeInLayout()) {
				i += 2;
				continue;
			}
			if(js_Boot.__implements(divider,feathers_core_IValidating)) {
				divider.validateNow();
			}
			if(divider != null && divider.get_visible()) {
				divider.set_x(contentWidth);
				contentWidth += divider.get_width();
			}
			if(js_Boot.__implements(item,feathers_core_IValidating)) {
				item.validateNow();
			}
			if(contentHeight < item.get_height()) {
				contentHeight = item.get_height();
			}
			item.set_x(contentWidth);
			contentWidth += item.get_width();
			i += 2;
		}
		contentWidth += this._paddingRight;
		contentHeight += this._paddingTop + this._paddingBottom;
		var viewPortWidth = contentWidth;
		if(measurements.width != null) {
			viewPortWidth = measurements.width;
		} else if(measurements.minWidth != null && viewPortWidth < measurements.minWidth) {
			viewPortWidth = measurements.minWidth;
		} else if(measurements.maxWidth != null && viewPortWidth > measurements.maxWidth) {
			viewPortWidth = measurements.maxWidth;
		}
		var viewPortHeight = contentHeight;
		if(measurements.height != null) {
			viewPortHeight = measurements.height;
		} else if(measurements.minHeight != null && viewPortHeight < measurements.minHeight) {
			viewPortHeight = measurements.minHeight;
		} else if(measurements.maxHeight != null && viewPortHeight > measurements.maxHeight) {
			viewPortHeight = measurements.maxHeight;
		}
		this.applyPercentHeight(items,viewPortHeight);
		var i = 0;
		while(i < items.length) {
			var divider = null;
			if(i > 0) {
				divider = items[i - 1];
			}
			if(divider == null) {
				i += 2;
				continue;
			}
			switch(this._verticalAlign._hx_index) {
			case 0:
				divider.set_y(this._paddingTop);
				break;
			case 1:
				divider.set_y(Math.max(this._paddingTop,this._paddingTop + (viewPortHeight - this._paddingTop - this._paddingBottom - divider.get_height()) / 2.0));
				break;
			case 2:
				divider.set_y(Math.max(this._paddingTop,this._paddingTop + (viewPortHeight - this._paddingTop - this._paddingBottom) - divider.get_height()));
				break;
			case 3:
				divider.set_y(this._paddingTop);
				divider.set_height(viewPortHeight - this._paddingTop - this._paddingBottom);
				break;
			}
			i += 2;
		}
		if(contentWidth < viewPortWidth) {
			contentWidth = viewPortWidth;
		}
		if(contentHeight < viewPortHeight) {
			contentHeight = viewPortHeight;
		}
		if(result == null) {
			result = new feathers_layout_LayoutBoundsResult();
		}
		result.contentX = 0.0;
		result.contentY = 0.0;
		result.contentWidth = contentWidth;
		result.contentHeight = contentHeight;
		result.viewPortWidth = viewPortWidth;
		result.viewPortHeight = viewPortHeight;
		return result;
	}
	,validateItems: function(items) {
		var i = 0;
		while(i < items.length) {
			var item = items[i];
			var divider = null;
			if(i > 0) {
				divider = items[i - 1];
			}
			if(js_Boot.__implements(item,feathers_layout_ILayoutObject) && !item.get_includeInLayout()) {
				i += 2;
				continue;
			}
			if(this._customItemWidths != null && i < this._customItemWidths.length) {
				var itemWidth = this._customItemWidths[i];
				if(itemWidth != null) {
					item.set_width(itemWidth);
				}
			}
			if(js_Boot.__implements(item,feathers_core_IValidating)) {
				item.validateNow();
			}
			if(js_Boot.__implements(divider,feathers_core_IValidating)) {
				divider.validateNow();
			}
			i += 2;
		}
	}
	,applyVerticalAlign: function(items,viewPortHeight) {
		var i = 0;
		while(i < items.length) {
			var divider = null;
			if(i > 0) {
				divider = items[i - 1];
			}
			if(divider == null) {
				i += 2;
				continue;
			}
			switch(this._verticalAlign._hx_index) {
			case 0:
				divider.set_y(this._paddingTop);
				break;
			case 1:
				divider.set_y(Math.max(this._paddingTop,this._paddingTop + (viewPortHeight - this._paddingTop - this._paddingBottom - divider.get_height()) / 2.0));
				break;
			case 2:
				divider.set_y(Math.max(this._paddingTop,this._paddingTop + (viewPortHeight - this._paddingTop - this._paddingBottom) - divider.get_height()));
				break;
			case 3:
				divider.set_y(this._paddingTop);
				divider.set_height(viewPortHeight - this._paddingTop - this._paddingBottom);
				break;
			}
			i += 2;
		}
	}
	,applyPercentWidth: function(items,explicitWidth,explicitMinWidth,explicitMaxWidth) {
		var customWidthIndices = [];
		var pendingIndices = [];
		var totalMeasuredWidth = 0.0;
		var totalMinWidth = 0.0;
		var totalPercentWidth = 0.0;
		var fallbackFluidIndex = this._fallbackFluidIndex;
		var fallbackFallbackFluidIndex = -1;
		var i = 0;
		while(i < items.length) {
			var item = items[i];
			var divider = null;
			if(i > 0) {
				divider = items[i - 1];
			}
			if(js_Boot.__implements(item,feathers_layout_ILayoutObject) && !item.get_includeInLayout()) {
				if(fallbackFluidIndex == i) {
					fallbackFluidIndex = -1;
				}
				i += 2;
				continue;
			}
			if(divider != null && divider.get_visible()) {
				totalMeasuredWidth += divider.get_width();
			}
			fallbackFallbackFluidIndex = i;
			var nonDividerIndex = Math.floor(i / 2);
			var needsPercentWidth = true;
			if(this._customItemWidths != null && nonDividerIndex < this._customItemWidths.length) {
				var itemWidth = this._customItemWidths[nonDividerIndex];
				if(itemWidth != null) {
					needsPercentWidth = false;
					item.set_width(itemWidth);
					customWidthIndices.push(i);
					if(js_Boot.__implements(item,feathers_core_IValidating)) {
						item.validateNow();
					}
				}
			}
			if(needsPercentWidth) {
				var percentWidth = 100.0;
				if(js_Boot.__implements(item,feathers_core_IMeasureObject)) {
					var measureItem = item;
					var columnExplicitMinWidth = measureItem.get_explicitMinWidth();
					if(columnExplicitMinWidth != null) {
						totalMinWidth += columnExplicitMinWidth;
					}
				}
				totalPercentWidth += percentWidth;
				pendingIndices.push(i);
				i += 2;
				continue;
			}
			totalMeasuredWidth += item.get_width();
			i += 2;
		}
		totalMeasuredWidth += this._paddingLeft + this._paddingRight;
		var remainingWidth = 0.0;
		if(explicitWidth != null) {
			remainingWidth = explicitWidth;
		} else {
			remainingWidth = totalMeasuredWidth + totalMinWidth;
			if(explicitMinWidth != null && remainingWidth < explicitMinWidth) {
				remainingWidth = explicitMinWidth;
			} else if(explicitMaxWidth != null && remainingWidth > explicitMaxWidth) {
				remainingWidth = explicitMaxWidth;
			}
		}
		remainingWidth -= totalMeasuredWidth;
		var needsAnotherPass = false;
		do {
			needsAnotherPass = false;
			var widthSum = 0.0;
			var percentToPixels = remainingWidth / totalPercentWidth;
			if(percentToPixels < 0.0) {
				percentToPixels = 0.0;
			}
			var _g = 0;
			while(_g < pendingIndices.length) {
				var index = pendingIndices[_g];
				++_g;
				var item = items[index];
				var percentWidth = 100.0;
				var itemWidth = Math.floor(percentToPixels * percentWidth);
				var columnMinWidth = null;
				if(js_Boot.__implements(item,feathers_core_IMeasureObject)) {
					var measureItem = item;
					columnMinWidth = measureItem.get_explicitMinWidth();
				}
				if(columnMinWidth != null) {
					if(columnMinWidth > remainingWidth) {
						columnMinWidth = remainingWidth;
					}
					if(itemWidth < columnMinWidth) {
						itemWidth = columnMinWidth;
						remainingWidth -= itemWidth;
						totalPercentWidth -= percentWidth;
						HxOverrides.remove(pendingIndices,index);
						needsAnotherPass = true;
					}
				}
				item.set_width(itemWidth);
				if(js_Boot.__implements(item,feathers_core_IValidating)) {
					item.validateNow();
				}
				widthSum += itemWidth;
			}
			if(needsAnotherPass) {
				widthSum = 0.0;
			} else {
				remainingWidth -= widthSum;
			}
		} while(needsAnotherPass);
		if(remainingWidth > 0.0 && pendingIndices.length > 0) {
			var index = pendingIndices[pendingIndices.length - 1];
			var finalItem = items[index];
			finalItem.set_width(finalItem.get_width() + remainingWidth);
			return;
		}
		if(remainingWidth == 0.0) {
			return;
		}
		if(fallbackFluidIndex == -1 || fallbackFallbackFluidIndex < fallbackFluidIndex) {
			fallbackFluidIndex = fallbackFallbackFluidIndex;
		}
		if(fallbackFluidIndex != -1) {
			var fallbackItem = items[fallbackFluidIndex];
			var itemWidth = fallbackItem.get_width() + remainingWidth;
			if(itemWidth < 0.0) {
				remainingWidth = itemWidth;
				itemWidth = 0.0;
				HxOverrides.remove(customWidthIndices,fallbackFluidIndex);
			} else {
				remainingWidth = 0.0;
			}
			fallbackItem.set_width(itemWidth);
		}
		if(remainingWidth == 0.0) {
			return;
		}
		var offset = remainingWidth / customWidthIndices.length;
		var _g = 0;
		while(_g < customWidthIndices.length) {
			var index = customWidthIndices[_g];
			++_g;
			var item = items[index];
			item.set_width(item.get_width() + offset);
		}
	}
	,applyPercentHeight: function(items,viewPortHeight) {
		var availableHeight = viewPortHeight - this._paddingTop - this._paddingBottom;
		var i = 0;
		while(i < items.length) {
			var item = items[i];
			if(js_Boot.__implements(item,feathers_layout_ILayoutObject) && !item.get_includeInLayout()) {
				i += 2;
				continue;
			}
			var itemHeight = availableHeight;
			if(js_Boot.__implements(item,feathers_core_IMeasureObject)) {
				var measureItem = item;
				var itemMinHeight = measureItem.get_explicitMinHeight();
				if(itemMinHeight != null) {
					if(itemMinHeight > availableHeight) {
						itemMinHeight = availableHeight;
					}
					if(itemHeight < itemMinHeight) {
						itemHeight = itemMinHeight;
					}
				}
				var itemMaxHeight = measureItem.get_explicitMaxHeight();
				if(itemMaxHeight != null && itemHeight > itemMaxHeight) {
					itemHeight = itemMaxHeight;
				}
			}
			item.set_height(itemHeight);
			i += 2;
		}
	}
	,__class__: feathers_layout_HDividedBoxLayout
	,__properties__: {set_fallbackFluidIndex:"set_fallbackFluidIndex",get_fallbackFluidIndex:"get_fallbackFluidIndex",set_customItemWidths:"set_customItemWidths",get_customItemWidths:"get_customItemWidths",set_verticalAlign:"set_verticalAlign",get_verticalAlign:"get_verticalAlign",set_paddingLeft:"set_paddingLeft",get_paddingLeft:"get_paddingLeft",set_paddingBottom:"set_paddingBottom",get_paddingBottom:"get_paddingBottom",set_paddingRight:"set_paddingRight",get_paddingRight:"get_paddingRight",set_paddingTop:"set_paddingTop",get_paddingTop:"get_paddingTop"}
});
var feathers_layout_HorizontalAlign = $hxEnums["feathers.layout.HorizontalAlign"] = { __ename__:"feathers.layout.HorizontalAlign",__constructs__:null
	,LEFT: {_hx_name:"LEFT",_hx_index:0,__enum__:"feathers.layout.HorizontalAlign",toString:$estr}
	,CENTER: {_hx_name:"CENTER",_hx_index:1,__enum__:"feathers.layout.HorizontalAlign",toString:$estr}
	,RIGHT: {_hx_name:"RIGHT",_hx_index:2,__enum__:"feathers.layout.HorizontalAlign",toString:$estr}
	,JUSTIFY: {_hx_name:"JUSTIFY",_hx_index:3,__enum__:"feathers.layout.HorizontalAlign",toString:$estr}
};
feathers_layout_HorizontalAlign.__constructs__ = [feathers_layout_HorizontalAlign.LEFT,feathers_layout_HorizontalAlign.CENTER,feathers_layout_HorizontalAlign.RIGHT,feathers_layout_HorizontalAlign.JUSTIFY];
var feathers_layout_IDragDropLayout = function() { };
$hxClasses["feathers.layout.IDragDropLayout"] = feathers_layout_IDragDropLayout;
feathers_layout_IDragDropLayout.__name__ = "feathers.layout.IDragDropLayout";
feathers_layout_IDragDropLayout.__isInterface__ = true;
feathers_layout_IDragDropLayout.__interfaces__ = [feathers_layout_ILayout];
feathers_layout_IDragDropLayout.prototype = {
	getDragDropIndex: null
	,getDragDropRegion: null
	,__class__: feathers_layout_IDragDropLayout
};
var feathers_layout_HorizontalDistributedLayout = function() {
	this._verticalAlign = feathers_layout_VerticalAlign.TOP;
	this._minItemWidth = 0.0;
	this._maxItemWidth = 1.0 / 0.0;
	this._gap = 0.0;
	this._paddingLeft = 0.0;
	this._paddingBottom = 0.0;
	this._paddingRight = 0.0;
	this._paddingTop = 0.0;
	openfl_events_EventDispatcher.call(this);
};
$hxClasses["feathers.layout.HorizontalDistributedLayout"] = feathers_layout_HorizontalDistributedLayout;
feathers_layout_HorizontalDistributedLayout.__name__ = "feathers.layout.HorizontalDistributedLayout";
feathers_layout_HorizontalDistributedLayout.__interfaces__ = [feathers_layout_IDragDropLayout,feathers_layout_ILayout];
feathers_layout_HorizontalDistributedLayout.__super__ = openfl_events_EventDispatcher;
feathers_layout_HorizontalDistributedLayout.prototype = $extend(openfl_events_EventDispatcher.prototype,{
	_paddingTop: null
	,get_paddingTop: function() {
		return this._paddingTop;
	}
	,set_paddingTop: function(value) {
		if(this._paddingTop == value) {
			return this._paddingTop;
		}
		this._paddingTop = value;
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._paddingTop;
	}
	,_paddingRight: null
	,get_paddingRight: function() {
		return this._paddingRight;
	}
	,set_paddingRight: function(value) {
		if(this._paddingRight == value) {
			return this._paddingRight;
		}
		this._paddingRight = value;
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._paddingRight;
	}
	,_paddingBottom: null
	,get_paddingBottom: function() {
		return this._paddingBottom;
	}
	,set_paddingBottom: function(value) {
		if(this._paddingBottom == value) {
			return this._paddingBottom;
		}
		this._paddingBottom = value;
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._paddingBottom;
	}
	,_paddingLeft: null
	,get_paddingLeft: function() {
		return this._paddingLeft;
	}
	,set_paddingLeft: function(value) {
		if(this._paddingLeft == value) {
			return this._paddingLeft;
		}
		this._paddingLeft = value;
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._paddingLeft;
	}
	,_gap: null
	,get_gap: function() {
		return this._gap;
	}
	,set_gap: function(value) {
		if(this._gap == value) {
			return this._gap;
		}
		this._gap = value;
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._gap;
	}
	,_maxItemWidth: null
	,get_maxItemWidth: function() {
		return this._maxItemWidth;
	}
	,set_maxItemWidth: function(value) {
		if(this._maxItemWidth == value) {
			return this._maxItemWidth;
		}
		this._maxItemWidth = value;
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._maxItemWidth;
	}
	,_minItemWidth: null
	,get_minItemWidth: function() {
		return this._minItemWidth;
	}
	,set_minItemWidth: function(value) {
		if(this._minItemWidth == value) {
			return this._minItemWidth;
		}
		this._minItemWidth = value;
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._minItemWidth;
	}
	,_verticalAlign: null
	,get_verticalAlign: function() {
		return this._verticalAlign;
	}
	,set_verticalAlign: function(value) {
		if(this._verticalAlign == value) {
			return this._verticalAlign;
		}
		this._verticalAlign = value;
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._verticalAlign;
	}
	,setPadding: function(value) {
		this.set_paddingTop(value);
		this.set_paddingRight(value);
		this.set_paddingBottom(value);
		this.set_paddingLeft(value);
	}
	,layout: function(items,measurements,result) {
		this.applyDistributedWidth(items,measurements.width,measurements.minWidth,measurements.maxWidth);
		var contentWidth = this._paddingLeft;
		var contentHeight = 0.0;
		var _g = 0;
		while(_g < items.length) {
			var item = items[_g];
			++_g;
			var layoutObject = null;
			if(js_Boot.__implements(item,feathers_layout_ILayoutObject)) {
				layoutObject = item;
				if(!layoutObject.get_includeInLayout()) {
					continue;
				}
			}
			if(js_Boot.__implements(item,feathers_core_IValidating)) {
				item.validateNow();
			}
			if(contentHeight < item.get_height()) {
				contentHeight = item.get_height();
			}
			item.set_x(contentWidth);
			contentWidth += item.get_width() + this._gap;
		}
		contentWidth += this._paddingRight;
		if(items.length > 0) {
			contentWidth -= this._gap;
		}
		contentHeight += this._paddingTop + this._paddingBottom;
		var viewPortWidth = contentWidth;
		if(measurements.width != null) {
			viewPortWidth = measurements.width;
		} else if(measurements.minWidth != null && viewPortWidth < measurements.minWidth) {
			viewPortWidth = measurements.minWidth;
		} else if(measurements.maxWidth != null && viewPortWidth > measurements.maxWidth) {
			viewPortWidth = measurements.maxWidth;
		}
		var viewPortHeight = contentHeight;
		if(measurements.height != null) {
			viewPortHeight = measurements.height;
		} else if(measurements.minHeight != null && viewPortHeight < measurements.minHeight) {
			viewPortHeight = measurements.minHeight;
		} else if(measurements.maxHeight != null && viewPortHeight > measurements.maxHeight) {
			viewPortHeight = measurements.maxHeight;
		}
		var _g = 0;
		while(_g < items.length) {
			var item = items[_g];
			++_g;
			var layoutObject = null;
			if(js_Boot.__implements(item,feathers_layout_ILayoutObject)) {
				layoutObject = item;
				if(!layoutObject.get_includeInLayout()) {
					continue;
				}
			}
			switch(this._verticalAlign._hx_index) {
			case 0:
				item.set_y(this._paddingTop);
				break;
			case 1:
				item.set_y(Math.max(this._paddingTop,this._paddingTop + (viewPortHeight - this._paddingTop - this._paddingBottom - item.get_height()) / 2.0));
				break;
			case 2:
				item.set_y(Math.max(this._paddingTop,this._paddingTop + (viewPortHeight - this._paddingTop - this._paddingBottom) - item.get_height()));
				break;
			case 3:
				item.set_y(this._paddingTop);
				item.set_height(viewPortHeight - this._paddingTop - this._paddingBottom);
				break;
			}
		}
		if(contentWidth < viewPortWidth) {
			contentWidth = viewPortWidth;
		}
		if(contentHeight < viewPortHeight) {
			contentHeight = viewPortHeight;
		}
		if(result == null) {
			result = new feathers_layout_LayoutBoundsResult();
		}
		result.contentX = 0.0;
		result.contentY = 0.0;
		result.contentWidth = contentWidth;
		result.contentHeight = contentHeight;
		result.viewPortWidth = viewPortWidth;
		result.viewPortHeight = viewPortHeight;
		return result;
	}
	,getDragDropIndex: function(items,x,y,width,height) {
		var positionX = this._paddingLeft;
		var _g = 0;
		var _g1 = items.length;
		while(_g < _g1) {
			var i = _g++;
			var item = items[i];
			if(js_Boot.__implements(item,feathers_layout_ILayoutObject)) {
				var layoutItem = item;
				if(!layoutItem.get_includeInLayout()) {
					continue;
				}
			}
			if(js_Boot.__implements(item,feathers_core_IValidating)) {
				item.validateNow();
			}
			var itemWidth = item.get_width();
			if(x < positionX + itemWidth / 2.0) {
				return i;
			}
			positionX += itemWidth + this._gap;
		}
		return items.length;
	}
	,getDragDropRegion: function(items,dropIndex,x,y,width,height,result) {
		var maxIndex = dropIndex;
		if(dropIndex < 0) {
			dropIndex = 0;
		} else if(maxIndex > items.length) {
			maxIndex = items.length;
		}
		var positionX = this._paddingLeft;
		var _g = 0;
		var _g1 = maxIndex;
		while(_g < _g1) {
			var i = _g++;
			var item = items[i];
			if(js_Boot.__implements(item,feathers_layout_ILayoutObject)) {
				var layoutItem = item;
				if(!layoutItem.get_includeInLayout()) {
					continue;
				}
			}
			if(js_Boot.__implements(item,feathers_core_IValidating)) {
				item.validateNow();
			}
			positionX += item.get_width() + this._gap;
		}
		if(result == null) {
			result = new openfl_geom_Rectangle(positionX,0.0,0.0,height);
		} else {
			result.setTo(positionX,0.0,0.0,height);
		}
		return result;
	}
	,applyDistributedWidth: function(items,explicitWidth,explicitMinWidth,explicitMaxWidth) {
		var maxMinWidth = 0.0;
		var totalPercentWidth = 0.0;
		var itemsInLayoutCount = 0;
		var _g = 0;
		while(_g < items.length) {
			var item = items[_g];
			++_g;
			if(js_Boot.__implements(item,feathers_layout_ILayoutObject)) {
				var layoutObject = item;
				if(!layoutObject.get_includeInLayout()) {
					continue;
				}
			}
			if(js_Boot.__implements(item,feathers_core_IValidating)) {
				item.validateNow();
			}
			var itemMinWidth = 0.0;
			if(js_Boot.__implements(item,feathers_core_IMeasureObject)) {
				var measureItem = item;
				itemMinWidth = measureItem.get_minWidth();
			} else {
				itemMinWidth = item.get_width();
			}
			if(maxMinWidth < itemMinWidth) {
				maxMinWidth = itemMinWidth;
			}
			totalPercentWidth += 100.0;
			++itemsInLayoutCount;
		}
		var remainingWidth = 0.0;
		if(explicitWidth != null) {
			remainingWidth = explicitWidth;
		} else {
			remainingWidth = this._paddingLeft + this._paddingRight + (maxMinWidth + this._gap) * itemsInLayoutCount - this._gap;
			if(explicitMinWidth != null && remainingWidth < explicitMinWidth) {
				remainingWidth = explicitMinWidth;
			} else if(explicitMaxWidth != null && remainingWidth > explicitMaxWidth) {
				remainingWidth = explicitMaxWidth;
			}
		}
		remainingWidth -= this._paddingLeft + this._paddingRight + this._gap * (itemsInLayoutCount - 1);
		if(remainingWidth < 0.0) {
			remainingWidth = 0.0;
		}
		var percentToPixels = remainingWidth / totalPercentWidth;
		var _g = 0;
		while(_g < items.length) {
			var item = items[_g];
			++_g;
			if(js_Boot.__implements(item,feathers_layout_ILayoutObject)) {
				var layoutObject = item;
				if(!layoutObject.get_includeInLayout()) {
					continue;
				}
			}
			var itemWidth = percentToPixels * 100.0;
			if(itemWidth < this._minItemWidth) {
				itemWidth = this._minItemWidth;
			} else if(itemWidth > this._maxItemWidth) {
				itemWidth = this._maxItemWidth;
			}
			item.set_width(itemWidth);
			if(js_Boot.__implements(item,feathers_core_IValidating)) {
				item.validateNow();
			}
		}
	}
	,applyVerticalAlign: function(items,viewPortHeight) {
		var _g = 0;
		while(_g < items.length) {
			var item = items[_g];
			++_g;
			var layoutObject = null;
			if(js_Boot.__implements(item,feathers_layout_ILayoutObject)) {
				layoutObject = item;
				if(!layoutObject.get_includeInLayout()) {
					continue;
				}
			}
			switch(this._verticalAlign._hx_index) {
			case 0:
				item.set_y(this._paddingTop);
				break;
			case 1:
				item.set_y(Math.max(this._paddingTop,this._paddingTop + (viewPortHeight - this._paddingTop - this._paddingBottom - item.get_height()) / 2.0));
				break;
			case 2:
				item.set_y(Math.max(this._paddingTop,this._paddingTop + (viewPortHeight - this._paddingTop - this._paddingBottom) - item.get_height()));
				break;
			case 3:
				item.set_y(this._paddingTop);
				item.set_height(viewPortHeight - this._paddingTop - this._paddingBottom);
				break;
			}
		}
	}
	,__class__: feathers_layout_HorizontalDistributedLayout
	,__properties__: {set_verticalAlign:"set_verticalAlign",get_verticalAlign:"get_verticalAlign",set_minItemWidth:"set_minItemWidth",get_minItemWidth:"get_minItemWidth",set_maxItemWidth:"set_maxItemWidth",get_maxItemWidth:"get_maxItemWidth",set_gap:"set_gap",get_gap:"get_gap",set_paddingLeft:"set_paddingLeft",get_paddingLeft:"get_paddingLeft",set_paddingBottom:"set_paddingBottom",get_paddingBottom:"get_paddingBottom",set_paddingRight:"set_paddingRight",get_paddingRight:"get_paddingRight",set_paddingTop:"set_paddingTop",get_paddingTop:"get_paddingTop"}
});
var feathers_layout_HorizontalLayout = function() {
	this._percentHeightResetEnabled = false;
	this._percentWidthResetEnabled = false;
	this._justifyResetEnabled = false;
	this._verticalAlign = feathers_layout_VerticalAlign.TOP;
	this._horizontalAlign = feathers_layout_HorizontalAlign.LEFT;
	this._minGap = 0.0;
	this._gap = 0.0;
	this._paddingLeft = 0.0;
	this._paddingBottom = 0.0;
	this._paddingRight = 0.0;
	this._paddingTop = 0.0;
	openfl_events_EventDispatcher.call(this);
};
$hxClasses["feathers.layout.HorizontalLayout"] = feathers_layout_HorizontalLayout;
feathers_layout_HorizontalLayout.__name__ = "feathers.layout.HorizontalLayout";
feathers_layout_HorizontalLayout.__interfaces__ = [feathers_layout_IDragDropLayout,feathers_layout_ILayout];
feathers_layout_HorizontalLayout.__super__ = openfl_events_EventDispatcher;
feathers_layout_HorizontalLayout.prototype = $extend(openfl_events_EventDispatcher.prototype,{
	_paddingTop: null
	,get_paddingTop: function() {
		return this._paddingTop;
	}
	,set_paddingTop: function(value) {
		if(this._paddingTop == value) {
			return this._paddingTop;
		}
		this._paddingTop = value;
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._paddingTop;
	}
	,_paddingRight: null
	,get_paddingRight: function() {
		return this._paddingRight;
	}
	,set_paddingRight: function(value) {
		if(this._paddingRight == value) {
			return this._paddingRight;
		}
		this._paddingRight = value;
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._paddingRight;
	}
	,_paddingBottom: null
	,get_paddingBottom: function() {
		return this._paddingBottom;
	}
	,set_paddingBottom: function(value) {
		if(this._paddingBottom == value) {
			return this._paddingBottom;
		}
		this._paddingBottom = value;
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._paddingBottom;
	}
	,_paddingLeft: null
	,get_paddingLeft: function() {
		return this._paddingLeft;
	}
	,set_paddingLeft: function(value) {
		if(this._paddingLeft == value) {
			return this._paddingLeft;
		}
		this._paddingLeft = value;
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._paddingLeft;
	}
	,_gap: null
	,get_gap: function() {
		return this._gap;
	}
	,set_gap: function(value) {
		if(this._gap == value) {
			return this._gap;
		}
		this._gap = value;
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._gap;
	}
	,_minGap: null
	,get_minGap: function() {
		return this._minGap;
	}
	,set_minGap: function(value) {
		if(this._minGap == value) {
			return this._minGap;
		}
		this._minGap = value;
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._minGap;
	}
	,_horizontalAlign: null
	,get_horizontalAlign: function() {
		return this._horizontalAlign;
	}
	,set_horizontalAlign: function(value) {
		if(this._horizontalAlign == value) {
			return this._horizontalAlign;
		}
		this._horizontalAlign = value;
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._horizontalAlign;
	}
	,_verticalAlign: null
	,get_verticalAlign: function() {
		return this._verticalAlign;
	}
	,set_verticalAlign: function(value) {
		if(this._verticalAlign == value) {
			return this._verticalAlign;
		}
		this._verticalAlign = value;
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._verticalAlign;
	}
	,_justifyResetEnabled: null
	,get_justifyResetEnabled: function() {
		return this._justifyResetEnabled;
	}
	,set_justifyResetEnabled: function(value) {
		if(this._justifyResetEnabled == value) {
			return this._justifyResetEnabled;
		}
		this._justifyResetEnabled = value;
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._justifyResetEnabled;
	}
	,_percentWidthResetEnabled: null
	,get_percentWidthResetEnabled: function() {
		return this._percentWidthResetEnabled;
	}
	,set_percentWidthResetEnabled: function(value) {
		if(this._percentWidthResetEnabled == value) {
			return this._percentWidthResetEnabled;
		}
		this._percentWidthResetEnabled = value;
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._percentWidthResetEnabled;
	}
	,_percentHeightResetEnabled: null
	,get_percentHeightResetEnabled: function() {
		return this._percentHeightResetEnabled;
	}
	,set_percentHeightResetEnabled: function(value) {
		if(this._percentHeightResetEnabled == value) {
			return this._percentHeightResetEnabled;
		}
		this._percentHeightResetEnabled = value;
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._percentHeightResetEnabled;
	}
	,setPadding: function(value) {
		this.set_paddingTop(value);
		this.set_paddingRight(value);
		this.set_paddingBottom(value);
		this.set_paddingLeft(value);
	}
	,layout: function(items,measurements,result) {
		var adjustedGap = this._gap;
		var hasFlexGap = this._gap == 1.0 / 0.0;
		if(hasFlexGap) {
			adjustedGap = this._minGap;
		}
		var isJustified = this._verticalAlign == feathers_layout_VerticalAlign.JUSTIFY;
		var explicitContentWidth = measurements.width;
		if(explicitContentWidth != null) {
			explicitContentWidth -= this._paddingLeft + this._paddingRight;
		}
		var explicitContentHeight = measurements.height;
		if(explicitContentHeight != null) {
			explicitContentHeight -= this._paddingTop + this._paddingBottom;
		}
		var _g = 0;
		while(_g < items.length) {
			var item = items[_g];
			++_g;
			var percentWidth = null;
			var percentHeight = null;
			if(js_Boot.__implements(item,feathers_layout_ILayoutObject)) {
				var layoutItem = item;
				if(!layoutItem.get_includeInLayout()) {
					continue;
				}
				var value = layoutItem.get_layoutData();
				var layoutData = ((value) instanceof feathers_layout_HorizontalLayoutData) ? value : null;
				if(layoutData != null) {
					percentWidth = layoutData.get_percentWidth();
					percentHeight = layoutData.get_percentHeight();
				}
			}
			if(isJustified) {
				if(explicitContentHeight != null) {
					item.set_height(explicitContentHeight);
				} else if(this._justifyResetEnabled && js_Boot.__implements(item,feathers_core_IMeasureObject)) {
					item.resetHeight();
				}
			} else if(explicitContentHeight != null) {
				if(percentHeight != null) {
					if(percentHeight < 0.0) {
						percentHeight = 0.0;
					} else if(percentHeight > 100.0) {
						percentHeight = 100.0;
					}
					item.set_height(explicitContentHeight * (percentHeight / 100.0));
				}
			} else if(percentHeight != null && this._percentHeightResetEnabled && js_Boot.__implements(item,feathers_core_IMeasureObject)) {
				item.resetHeight();
			}
			if(percentWidth != null && this._percentWidthResetEnabled && explicitContentWidth == null && js_Boot.__implements(item,feathers_core_IMeasureObject)) {
				item.resetWidth();
			}
			if(js_Boot.__implements(item,feathers_core_IValidating)) {
				item.validateNow();
			}
			if(isJustified && explicitContentHeight == null && measurements.maxHeight != null) {
				var maxExplicitContentHeight = measurements.maxHeight - this._paddingTop - this._paddingBottom;
				if(item.get_height() > maxExplicitContentHeight) {
					item.set_height(maxExplicitContentHeight);
					if(js_Boot.__implements(item,feathers_core_IValidating)) {
						item.validateNow();
					}
				}
			}
		}
		this.applyPercentWidth(items,measurements.width,measurements.minWidth,measurements.maxWidth,adjustedGap);
		var contentWidth = this._paddingLeft;
		var contentHeight = 0.0;
		var _g = 0;
		while(_g < items.length) {
			var item = items[_g];
			++_g;
			var layoutData = null;
			var layoutObject = null;
			if(js_Boot.__implements(item,feathers_layout_ILayoutObject)) {
				layoutObject = item;
				if(!layoutObject.get_includeInLayout()) {
					continue;
				}
				var value = layoutObject.get_layoutData();
				layoutData = ((value) instanceof feathers_layout_HorizontalLayoutData) ? value : null;
			}
			if(js_Boot.__implements(item,feathers_core_IValidating)) {
				item.validateNow();
			}
			if(layoutData != null && layoutData.get_marginLeft() != null) {
				contentWidth += layoutData.get_marginLeft();
			}
			if(contentHeight < item.get_height()) {
				contentHeight = item.get_height();
			}
			item.set_x(contentWidth);
			contentWidth += item.get_width() + adjustedGap;
			if(layoutData != null && layoutData.get_marginRight() != null) {
				contentWidth += layoutData.get_marginRight();
			}
		}
		var maxItemHeight = contentHeight;
		contentWidth += this._paddingRight;
		if(items.length > 0) {
			contentWidth -= adjustedGap;
		}
		contentHeight += this._paddingTop + this._paddingBottom;
		var viewPortWidth = contentWidth;
		if(measurements.width != null) {
			viewPortWidth = measurements.width;
		} else if(measurements.minWidth != null && viewPortWidth < measurements.minWidth) {
			viewPortWidth = measurements.minWidth;
		} else if(measurements.maxWidth != null && viewPortWidth > measurements.maxWidth) {
			viewPortWidth = measurements.maxWidth;
		}
		var viewPortHeight = contentHeight;
		if(measurements.height != null) {
			viewPortHeight = measurements.height;
		} else if(measurements.minHeight != null && viewPortHeight < measurements.minHeight) {
			viewPortHeight = measurements.minHeight;
		} else if(measurements.maxHeight != null && viewPortHeight > measurements.maxHeight) {
			viewPortHeight = measurements.maxHeight;
		}
		this.applyPercentHeight(items,viewPortHeight);
		var _g = 0;
		while(_g < items.length) {
			var item = items[_g];
			++_g;
			var layoutObject = null;
			if(js_Boot.__implements(item,feathers_layout_ILayoutObject)) {
				layoutObject = item;
				if(!layoutObject.get_includeInLayout()) {
					continue;
				}
			}
			switch(this._verticalAlign._hx_index) {
			case 0:
				item.set_y(this._paddingTop);
				break;
			case 1:
				item.set_y(Math.max(this._paddingTop,this._paddingTop + (viewPortHeight - this._paddingTop - this._paddingBottom - item.get_height()) / 2.0));
				break;
			case 2:
				item.set_y(Math.max(this._paddingTop,this._paddingTop + (viewPortHeight - this._paddingTop - this._paddingBottom) - item.get_height()));
				break;
			case 3:
				item.set_y(this._paddingTop);
				item.set_height(viewPortHeight - this._paddingTop - this._paddingBottom);
				break;
			}
		}
		var contentWidth1 = contentWidth - this._paddingLeft - this._paddingRight;
		var alignOffset = 0.0;
		var gapOffset = 0.0;
		var maxAlignmentWidth = viewPortWidth - this._paddingLeft - this._paddingRight;
		var adjustedGap = this._gap;
		var hasFlexGap = this._gap == 1.0 / 0.0;
		if(hasFlexGap) {
			adjustedGap = this._minGap;
			if(items.length > 1 && maxAlignmentWidth > contentWidth1) {
				adjustedGap += (maxAlignmentWidth - contentWidth1) / (items.length - 1);
			}
			gapOffset = adjustedGap - this._minGap;
		} else {
			switch(this._horizontalAlign._hx_index) {
			case 0:
				alignOffset = 0.0;
				break;
			case 1:
				alignOffset = (maxAlignmentWidth - contentWidth1) / 2.0;
				break;
			case 2:
				alignOffset = maxAlignmentWidth - contentWidth1;
				break;
			default:
				throw new openfl_errors_ArgumentError("Unknown horizontal align: " + Std.string(this._horizontalAlign));
			}
			if(alignOffset < 0.0) {
				alignOffset = 0.0;
			}
		}
		if(!(alignOffset == 0.0 && gapOffset == 0.0)) {
			var totalOffset = alignOffset;
			var _g = 0;
			while(_g < items.length) {
				var item = items[_g];
				++_g;
				var layoutObject = null;
				if(js_Boot.__implements(item,feathers_layout_ILayoutObject)) {
					layoutObject = item;
					if(!layoutObject.get_includeInLayout()) {
						continue;
					}
				}
				item.set_x(Math.max(this._paddingLeft,item.get_x() + totalOffset));
				totalOffset += gapOffset;
			}
		}
		if(contentWidth < viewPortWidth) {
			contentWidth = viewPortWidth;
		}
		if(contentHeight < viewPortHeight) {
			contentHeight = viewPortHeight;
		}
		if(result == null) {
			result = new feathers_layout_LayoutBoundsResult();
		}
		result.contentX = 0.0;
		result.contentY = 0.0;
		result.contentWidth = contentWidth;
		result.contentHeight = contentHeight;
		result.viewPortWidth = viewPortWidth;
		result.viewPortHeight = viewPortHeight;
		return result;
	}
	,getDragDropIndex: function(items,x,y,width,height) {
		var adjustedGap = this._gap;
		var hasFlexGap = this._gap == 1.0 / 0.0;
		if(hasFlexGap) {
			adjustedGap = this._minGap;
		}
		var positionX = this._paddingLeft;
		var _g = 0;
		var _g1 = items.length;
		while(_g < _g1) {
			var i = _g++;
			var item = items[i];
			if(js_Boot.__implements(item,feathers_layout_ILayoutObject)) {
				var layoutItem = item;
				if(!layoutItem.get_includeInLayout()) {
					continue;
				}
			}
			if(js_Boot.__implements(item,feathers_core_IValidating)) {
				item.validateNow();
			}
			var itemWidth = item.get_width();
			if(x < positionX + itemWidth / 2.0) {
				return i;
			}
			positionX += itemWidth + adjustedGap;
		}
		return items.length;
	}
	,getDragDropRegion: function(items,dropIndex,x,y,width,height,result) {
		var adjustedGap = this._gap;
		var hasFlexGap = this._gap == 1.0 / 0.0;
		if(hasFlexGap) {
			adjustedGap = this._minGap;
		}
		var maxIndex = dropIndex;
		if(maxIndex < 0) {
			maxIndex = 0;
		} else if(maxIndex > items.length) {
			maxIndex = items.length;
		}
		var positionX = this._paddingLeft;
		var _g = 0;
		var _g1 = maxIndex;
		while(_g < _g1) {
			var i = _g++;
			var item = items[i];
			if(js_Boot.__implements(item,feathers_layout_ILayoutObject)) {
				var layoutItem = item;
				if(!layoutItem.get_includeInLayout()) {
					continue;
				}
			}
			if(js_Boot.__implements(item,feathers_core_IValidating)) {
				item.validateNow();
			}
			positionX += item.get_width() + adjustedGap;
		}
		if(result == null) {
			result = new openfl_geom_Rectangle(positionX,0.0,0.0,height);
		} else {
			result.setTo(positionX,0.0,0.0,height);
		}
		return result;
	}
	,validateItems: function(items,measurements) {
		var isJustified = this._verticalAlign == feathers_layout_VerticalAlign.JUSTIFY;
		var explicitContentWidth = measurements.width;
		if(explicitContentWidth != null) {
			explicitContentWidth -= this._paddingLeft + this._paddingRight;
		}
		var explicitContentHeight = measurements.height;
		if(explicitContentHeight != null) {
			explicitContentHeight -= this._paddingTop + this._paddingBottom;
		}
		var _g = 0;
		while(_g < items.length) {
			var item = items[_g];
			++_g;
			var percentWidth = null;
			var percentHeight = null;
			if(js_Boot.__implements(item,feathers_layout_ILayoutObject)) {
				var layoutItem = item;
				if(!layoutItem.get_includeInLayout()) {
					continue;
				}
				var value = layoutItem.get_layoutData();
				var layoutData = ((value) instanceof feathers_layout_HorizontalLayoutData) ? value : null;
				if(layoutData != null) {
					percentWidth = layoutData.get_percentWidth();
					percentHeight = layoutData.get_percentHeight();
				}
			}
			if(isJustified) {
				if(explicitContentHeight != null) {
					item.set_height(explicitContentHeight);
				} else if(this._justifyResetEnabled && js_Boot.__implements(item,feathers_core_IMeasureObject)) {
					item.resetHeight();
				}
			} else if(explicitContentHeight != null) {
				if(percentHeight != null) {
					if(percentHeight < 0.0) {
						percentHeight = 0.0;
					} else if(percentHeight > 100.0) {
						percentHeight = 100.0;
					}
					item.set_height(explicitContentHeight * (percentHeight / 100.0));
				}
			} else if(percentHeight != null && this._percentHeightResetEnabled && js_Boot.__implements(item,feathers_core_IMeasureObject)) {
				item.resetHeight();
			}
			if(percentWidth != null && this._percentWidthResetEnabled && explicitContentWidth == null && js_Boot.__implements(item,feathers_core_IMeasureObject)) {
				item.resetWidth();
			}
			if(js_Boot.__implements(item,feathers_core_IValidating)) {
				item.validateNow();
			}
			if(isJustified && explicitContentHeight == null && measurements.maxHeight != null) {
				var maxExplicitContentHeight = measurements.maxHeight - this._paddingTop - this._paddingBottom;
				if(item.get_height() > maxExplicitContentHeight) {
					item.set_height(maxExplicitContentHeight);
					if(js_Boot.__implements(item,feathers_core_IValidating)) {
						item.validateNow();
					}
				}
			}
		}
	}
	,applyVerticalAlign: function(items,maxItemHeight,viewPortHeight) {
		var _g = 0;
		while(_g < items.length) {
			var item = items[_g];
			++_g;
			var layoutObject = null;
			if(js_Boot.__implements(item,feathers_layout_ILayoutObject)) {
				layoutObject = item;
				if(!layoutObject.get_includeInLayout()) {
					continue;
				}
			}
			switch(this._verticalAlign._hx_index) {
			case 0:
				item.set_y(this._paddingTop);
				break;
			case 1:
				item.set_y(Math.max(this._paddingTop,this._paddingTop + (viewPortHeight - this._paddingTop - this._paddingBottom - item.get_height()) / 2.0));
				break;
			case 2:
				item.set_y(Math.max(this._paddingTop,this._paddingTop + (viewPortHeight - this._paddingTop - this._paddingBottom) - item.get_height()));
				break;
			case 3:
				item.set_y(this._paddingTop);
				item.set_height(viewPortHeight - this._paddingTop - this._paddingBottom);
				break;
			}
		}
	}
	,applyHorizontalAlign: function(items,contentWidth,viewPortWidth) {
		var alignOffset = 0.0;
		var gapOffset = 0.0;
		var maxAlignmentWidth = viewPortWidth - this._paddingLeft - this._paddingRight;
		var adjustedGap = this._gap;
		var hasFlexGap = this._gap == 1.0 / 0.0;
		if(hasFlexGap) {
			adjustedGap = this._minGap;
			if(items.length > 1 && maxAlignmentWidth > contentWidth) {
				adjustedGap += (maxAlignmentWidth - contentWidth) / (items.length - 1);
			}
			gapOffset = adjustedGap - this._minGap;
		} else {
			switch(this._horizontalAlign._hx_index) {
			case 0:
				alignOffset = 0.0;
				break;
			case 1:
				alignOffset = (maxAlignmentWidth - contentWidth) / 2.0;
				break;
			case 2:
				alignOffset = maxAlignmentWidth - contentWidth;
				break;
			default:
				throw new openfl_errors_ArgumentError("Unknown horizontal align: " + Std.string(this._horizontalAlign));
			}
			if(alignOffset < 0.0) {
				alignOffset = 0.0;
			}
		}
		if(alignOffset == 0.0 && gapOffset == 0.0) {
			return;
		}
		var totalOffset = alignOffset;
		var _g = 0;
		while(_g < items.length) {
			var item = items[_g];
			++_g;
			var layoutObject = null;
			if(js_Boot.__implements(item,feathers_layout_ILayoutObject)) {
				layoutObject = item;
				if(!layoutObject.get_includeInLayout()) {
					continue;
				}
			}
			item.set_x(Math.max(this._paddingLeft,item.get_x() + totalOffset));
			totalOffset += gapOffset;
		}
	}
	,applyPercentWidth: function(items,explicitWidth,explicitMinWidth,explicitMaxWidth,adjustedGap) {
		var pendingItems = [];
		var totalMeasuredWidth = 0.0;
		var totalMinWidth = 0.0;
		var totalPercentWidth = 0.0;
		var _g = 0;
		while(_g < items.length) {
			var item = items[_g];
			++_g;
			if(js_Boot.__implements(item,feathers_layout_ILayoutObject)) {
				var layoutItem = item;
				if(!layoutItem.get_includeInLayout()) {
					continue;
				}
				var value = layoutItem.get_layoutData();
				var layoutData = ((value) instanceof feathers_layout_HorizontalLayoutData) ? value : null;
				if(layoutData != null) {
					var percentWidth = layoutData.get_percentWidth();
					if(percentWidth != null) {
						if(percentWidth < 0.0) {
							percentWidth = 0.0;
						}
						if(js_Boot.__implements(layoutItem,feathers_core_IMeasureObject)) {
							var measureItem = layoutItem;
							totalMinWidth += measureItem.get_minWidth();
						}
						totalPercentWidth += percentWidth;
						if(layoutData.get_marginLeft() != null) {
							totalMeasuredWidth += layoutData.get_marginLeft();
						}
						if(layoutData.get_marginRight() != null) {
							totalMeasuredWidth += layoutData.get_marginRight();
						}
						totalMeasuredWidth += adjustedGap;
						pendingItems.push(layoutItem);
						continue;
					}
				}
			}
			totalMeasuredWidth += item.get_width() + adjustedGap;
		}
		totalMeasuredWidth -= adjustedGap;
		totalMeasuredWidth += this._paddingLeft + this._paddingRight;
		if(totalPercentWidth < 100.0) {
			totalPercentWidth = 100.0;
		}
		var remainingWidth = 0.0;
		if(explicitWidth != null) {
			remainingWidth = explicitWidth;
		} else {
			remainingWidth = totalMeasuredWidth + totalMinWidth;
			if(explicitMinWidth != null && remainingWidth < explicitMinWidth) {
				remainingWidth = explicitMinWidth;
			} else if(explicitMaxWidth != null && remainingWidth > explicitMaxWidth) {
				remainingWidth = explicitMaxWidth;
			}
		}
		remainingWidth -= totalMeasuredWidth;
		if(remainingWidth < 0.0) {
			remainingWidth = 0.0;
		}
		var needsAnotherPass = true;
		while(needsAnotherPass) {
			needsAnotherPass = false;
			var percentToPixels = remainingWidth / totalPercentWidth;
			var _g = 0;
			while(_g < pendingItems.length) {
				var layoutItem = pendingItems[_g];
				++_g;
				var layoutData = js_Boot.__cast(layoutItem.get_layoutData() , feathers_layout_HorizontalLayoutData);
				var percentWidth = layoutData.get_percentWidth();
				if(percentWidth < 0.0) {
					percentWidth = 0.0;
				}
				var itemWidth = percentToPixels * percentWidth;
				if(js_Boot.__implements(layoutItem,feathers_core_IMeasureObject)) {
					var measureItem = layoutItem;
					var itemMinWidth = measureItem.get_explicitMinWidth();
					if(itemMinWidth != null && itemMinWidth > remainingWidth) {
						itemMinWidth = remainingWidth;
					}
					if(itemWidth < itemMinWidth) {
						itemWidth = itemMinWidth;
						remainingWidth -= itemWidth;
						totalPercentWidth -= percentWidth;
						HxOverrides.remove(pendingItems,layoutItem);
						needsAnotherPass = true;
					}
				}
				(js_Boot.__cast(layoutItem , openfl_display_DisplayObject)).set_width(itemWidth);
				if(js_Boot.__implements(layoutItem,feathers_core_IValidating)) {
					layoutItem.validateNow();
				}
			}
		}
	}
	,applyPercentHeight: function(items,viewPortHeight) {
		var availableHeight = viewPortHeight - this._paddingTop - this._paddingBottom;
		var _g = 0;
		while(_g < items.length) {
			var item = items[_g];
			++_g;
			if(!js_Boot.__implements(item,feathers_layout_ILayoutObject)) {
				continue;
			}
			var layoutItem = item;
			if(!layoutItem.get_includeInLayout()) {
				continue;
			}
			var value = layoutItem.get_layoutData();
			var layoutData = ((value) instanceof feathers_layout_HorizontalLayoutData) ? value : null;
			if(layoutData == null) {
				continue;
			}
			var percentHeight = layoutData.get_percentHeight();
			if(percentHeight == null) {
				continue;
			}
			if(percentHeight < 0.0) {
				percentHeight = 0.0;
			} else if(percentHeight > 100.0) {
				percentHeight = 100.0;
			}
			var itemHeight = availableHeight * percentHeight / 100.0;
			if(js_Boot.__implements(item,feathers_core_IMeasureObject)) {
				var measureItem = item;
				var itemMinHeight = measureItem.get_explicitMinHeight();
				if(itemMinHeight != null) {
					if(itemMinHeight > availableHeight) {
						itemMinHeight = availableHeight;
					}
					if(itemHeight < itemMinHeight) {
						itemHeight = itemMinHeight;
					}
				}
				var itemMaxHeight = measureItem.get_explicitMaxHeight();
				if(itemMaxHeight != null && itemHeight > itemMaxHeight) {
					itemHeight = itemMaxHeight;
				}
			}
			item.set_height(itemHeight);
		}
	}
	,__class__: feathers_layout_HorizontalLayout
	,__properties__: {set_percentHeightResetEnabled:"set_percentHeightResetEnabled",get_percentHeightResetEnabled:"get_percentHeightResetEnabled",set_percentWidthResetEnabled:"set_percentWidthResetEnabled",get_percentWidthResetEnabled:"get_percentWidthResetEnabled",set_justifyResetEnabled:"set_justifyResetEnabled",get_justifyResetEnabled:"get_justifyResetEnabled",set_verticalAlign:"set_verticalAlign",get_verticalAlign:"get_verticalAlign",set_horizontalAlign:"set_horizontalAlign",get_horizontalAlign:"get_horizontalAlign",set_minGap:"set_minGap",get_minGap:"get_minGap",set_gap:"set_gap",get_gap:"get_gap",set_paddingLeft:"set_paddingLeft",get_paddingLeft:"get_paddingLeft",set_paddingBottom:"set_paddingBottom",get_paddingBottom:"get_paddingBottom",set_paddingRight:"set_paddingRight",get_paddingRight:"get_paddingRight",set_paddingTop:"set_paddingTop",get_paddingTop:"get_paddingTop"}
});
var feathers_layout_HorizontalLayoutData = function(percentWidth,percentHeight) {
	this._marginRight = null;
	this._marginLeft = null;
	this._percentHeight = null;
	this._percentWidth = null;
	openfl_events_EventDispatcher.call(this);
	this.set_percentWidth(percentWidth);
	this.set_percentHeight(percentHeight);
};
$hxClasses["feathers.layout.HorizontalLayoutData"] = feathers_layout_HorizontalLayoutData;
feathers_layout_HorizontalLayoutData.__name__ = "feathers.layout.HorizontalLayoutData";
feathers_layout_HorizontalLayoutData.__interfaces__ = [feathers_layout_ILayoutData];
feathers_layout_HorizontalLayoutData.fill = function() {
	return new feathers_layout_HorizontalLayoutData(100.0,100.0);
};
feathers_layout_HorizontalLayoutData.fillHorizontal = function(percentWidth) {
	if(percentWidth == null) {
		percentWidth = 100.0;
	}
	return new feathers_layout_HorizontalLayoutData(percentWidth,null);
};
feathers_layout_HorizontalLayoutData.fillVertical = function(percentHeight) {
	if(percentHeight == null) {
		percentHeight = 100.0;
	}
	return new feathers_layout_HorizontalLayoutData(null,percentHeight);
};
feathers_layout_HorizontalLayoutData.__super__ = openfl_events_EventDispatcher;
feathers_layout_HorizontalLayoutData.prototype = $extend(openfl_events_EventDispatcher.prototype,{
	_percentWidth: null
	,get_percentWidth: function() {
		return this._percentWidth;
	}
	,set_percentWidth: function(value) {
		if(this._percentWidth == value) {
			return this._percentWidth;
		}
		this._percentWidth = value;
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._percentWidth;
	}
	,_percentHeight: null
	,get_percentHeight: function() {
		return this._percentHeight;
	}
	,set_percentHeight: function(value) {
		if(this._percentHeight == value) {
			return this._percentHeight;
		}
		this._percentHeight = value;
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._percentHeight;
	}
	,_marginLeft: null
	,get_marginLeft: function() {
		return this._marginLeft;
	}
	,set_marginLeft: function(value) {
		if(this._marginLeft == value) {
			return this._marginLeft;
		}
		this._marginLeft = value;
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._marginLeft;
	}
	,_marginRight: null
	,get_marginRight: function() {
		return this._marginRight;
	}
	,set_marginRight: function(value) {
		if(this._marginRight == value) {
			return this._marginRight;
		}
		this._marginRight = value;
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._marginRight;
	}
	,__class__: feathers_layout_HorizontalLayoutData
	,__properties__: {set_marginRight:"set_marginRight",get_marginRight:"get_marginRight",set_marginLeft:"set_marginLeft",get_marginLeft:"get_marginLeft",set_percentHeight:"set_percentHeight",get_percentHeight:"get_percentHeight",set_percentWidth:"set_percentWidth",get_percentWidth:"get_percentWidth"}
});
var feathers_layout_IKeyboardNavigationLayout = function() { };
$hxClasses["feathers.layout.IKeyboardNavigationLayout"] = feathers_layout_IKeyboardNavigationLayout;
feathers_layout_IKeyboardNavigationLayout.__name__ = "feathers.layout.IKeyboardNavigationLayout";
feathers_layout_IKeyboardNavigationLayout.__isInterface__ = true;
feathers_layout_IKeyboardNavigationLayout.__interfaces__ = [feathers_layout_ILayout];
feathers_layout_IKeyboardNavigationLayout.prototype = {
	findNextKeyboardIndex: null
	,__class__: feathers_layout_IKeyboardNavigationLayout
};
var feathers_layout_IScrollLayout = function() { };
$hxClasses["feathers.layout.IScrollLayout"] = feathers_layout_IScrollLayout;
feathers_layout_IScrollLayout.__name__ = "feathers.layout.IScrollLayout";
feathers_layout_IScrollLayout.__isInterface__ = true;
feathers_layout_IScrollLayout.__interfaces__ = [feathers_layout_ILayout];
feathers_layout_IScrollLayout.prototype = {
	get_scrollX: null
	,set_scrollX: null
	,get_scrollY: null
	,set_scrollY: null
	,get_elasticTop: null
	,get_elasticRight: null
	,get_elasticBottom: null
	,get_elasticLeft: null
	,getNearestScrollPositionForIndex: null
	,__class__: feathers_layout_IScrollLayout
	,__properties__: {get_elasticLeft:"get_elasticLeft",get_elasticBottom:"get_elasticBottom",get_elasticRight:"get_elasticRight",get_elasticTop:"get_elasticTop",set_scrollY:"set_scrollY",get_scrollY:"get_scrollY",set_scrollX:"set_scrollX",get_scrollX:"get_scrollX"}
};
var feathers_layout_ISnapLayout = function() { };
$hxClasses["feathers.layout.ISnapLayout"] = feathers_layout_ISnapLayout;
feathers_layout_ISnapLayout.__name__ = "feathers.layout.ISnapLayout";
feathers_layout_ISnapLayout.__isInterface__ = true;
feathers_layout_ISnapLayout.__interfaces__ = [feathers_layout_ILayout];
feathers_layout_ISnapLayout.prototype = {
	getSnapPositionsX: null
	,getSnapPositionsY: null
	,__class__: feathers_layout_ISnapLayout
};
var feathers_layout_IVirtualLayout = function() { };
$hxClasses["feathers.layout.IVirtualLayout"] = feathers_layout_IVirtualLayout;
feathers_layout_IVirtualLayout.__name__ = "feathers.layout.IVirtualLayout";
feathers_layout_IVirtualLayout.__isInterface__ = true;
feathers_layout_IVirtualLayout.__interfaces__ = [feathers_layout_IScrollLayout];
feathers_layout_IVirtualLayout.prototype = {
	get_virtualCache: null
	,set_virtualCache: null
	,getVisibleIndices: null
	,__class__: feathers_layout_IVirtualLayout
	,__properties__: {set_virtualCache:"set_virtualCache",get_virtualCache:"get_virtualCache"}
};
var feathers_layout_VirtualLayoutRange = function(start,end) {
	this.start = start;
	this.end = end;
};
$hxClasses["feathers.layout.VirtualLayoutRange"] = feathers_layout_VirtualLayoutRange;
feathers_layout_VirtualLayoutRange.__name__ = "feathers.layout.VirtualLayoutRange";
feathers_layout_VirtualLayoutRange.prototype = {
	start: null
	,end: null
	,__class__: feathers_layout_VirtualLayoutRange
};
var feathers_layout_LayoutBoundsResult = function() {
	this.reset();
};
$hxClasses["feathers.layout.LayoutBoundsResult"] = feathers_layout_LayoutBoundsResult;
feathers_layout_LayoutBoundsResult.__name__ = "feathers.layout.LayoutBoundsResult";
feathers_layout_LayoutBoundsResult.prototype = {
	contentX: null
	,contentY: null
	,viewPortWidth: null
	,viewPortHeight: null
	,contentWidth: null
	,contentHeight: null
	,contentMinWidth: null
	,contentMinHeight: null
	,contentMaxWidth: null
	,contentMaxHeight: null
	,reset: function() {
		this.contentX = 0.0;
		this.contentY = 0.0;
		this.contentWidth = 0.0;
		this.contentHeight = 0.0;
		this.contentMinWidth = 0.0;
		this.contentMinHeight = 0.0;
		this.contentMaxWidth = 1.0 / 0.0;
		this.contentMaxHeight = 1.0 / 0.0;
		this.viewPortWidth = 0.0;
		this.viewPortHeight = 0.0;
	}
	,__class__: feathers_layout_LayoutBoundsResult
};
var feathers_layout_Measurements = function(target) {
	this.maxHeight = null;
	this.maxWidth = null;
	this.minHeight = null;
	this.minWidth = null;
	this.height = null;
	this.width = null;
	this.save(target);
};
$hxClasses["feathers.layout.Measurements"] = feathers_layout_Measurements;
feathers_layout_Measurements.__name__ = "feathers.layout.Measurements";
feathers_layout_Measurements.prototype = {
	save: function(target) {
		if(target == null) {
			this.width = null;
			this.height = null;
			this.minWidth = null;
			this.minHeight = null;
			this.maxWidth = null;
			this.maxHeight = null;
			return;
		}
		if(js_Boot.__implements(target,feathers_core_IMeasureObject)) {
			var measureTarget = target;
			this.width = measureTarget.get_explicitWidth();
			this.height = measureTarget.get_explicitHeight();
			this.minWidth = measureTarget.get_explicitMinWidth();
			this.minHeight = measureTarget.get_explicitMinHeight();
			this.maxWidth = measureTarget.get_explicitMaxWidth();
			this.maxHeight = measureTarget.get_explicitMaxHeight();
			return;
		}
		this.width = target.get_width();
		this.height = target.get_height();
		this.minWidth = this.width;
		this.minHeight = this.height;
		this.maxWidth = this.width;
		this.maxHeight = this.height;
	}
	,restore: function(target) {
		if(js_Boot.__implements(target,feathers_core_IMeasureObject)) {
			var measureTarget = target;
			if(this.width == null) {
				measureTarget.resetWidth();
			} else {
				measureTarget.set_width(this.width);
			}
			if(this.height == null) {
				measureTarget.resetHeight();
			} else {
				measureTarget.set_height(this.height);
			}
			if(this.minWidth == null) {
				measureTarget.resetMinWidth();
			} else {
				measureTarget.set_minWidth(this.minWidth);
			}
			if(this.minHeight == null) {
				measureTarget.resetMinHeight();
			} else {
				measureTarget.set_minHeight(this.minHeight);
			}
			if(this.maxWidth == null) {
				measureTarget.resetMaxWidth();
			} else {
				measureTarget.set_maxWidth(this.maxWidth);
			}
			if(this.maxHeight == null) {
				measureTarget.resetMaxHeight();
			} else {
				measureTarget.set_maxHeight(this.maxHeight);
			}
			return;
		}
		if(this.width != null) {
			target.set_width(this.width);
		}
		if(this.height != null) {
			target.set_height(this.height);
		}
	}
	,width: null
	,height: null
	,minWidth: null
	,minHeight: null
	,maxWidth: null
	,maxHeight: null
	,__class__: feathers_layout_Measurements
};
var feathers_layout_RelativePosition = $hxEnums["feathers.layout.RelativePosition"] = { __ename__:"feathers.layout.RelativePosition",__constructs__:null
	,TOP: {_hx_name:"TOP",_hx_index:0,__enum__:"feathers.layout.RelativePosition",toString:$estr}
	,RIGHT: {_hx_name:"RIGHT",_hx_index:1,__enum__:"feathers.layout.RelativePosition",toString:$estr}
	,BOTTOM: {_hx_name:"BOTTOM",_hx_index:2,__enum__:"feathers.layout.RelativePosition",toString:$estr}
	,LEFT: {_hx_name:"LEFT",_hx_index:3,__enum__:"feathers.layout.RelativePosition",toString:$estr}
	,MANUAL: {_hx_name:"MANUAL",_hx_index:4,__enum__:"feathers.layout.RelativePosition",toString:$estr}
};
feathers_layout_RelativePosition.__constructs__ = [feathers_layout_RelativePosition.TOP,feathers_layout_RelativePosition.RIGHT,feathers_layout_RelativePosition.BOTTOM,feathers_layout_RelativePosition.LEFT,feathers_layout_RelativePosition.MANUAL];
var feathers_layout_RelativePositions = {};
feathers_layout_RelativePositions._new = function(positions) {
	return positions;
};
feathers_layout_RelativePositions.fromRelativePosition = function(position) {
	return [position];
};
var feathers_layout_VDividedBoxLayout = function() {
	this._fallbackFluidIndex = -1;
	this._horizontalAlign = feathers_layout_HorizontalAlign.JUSTIFY;
	this._paddingLeft = 0.0;
	this._paddingBottom = 0.0;
	this._paddingRight = 0.0;
	this._paddingTop = 0.0;
	openfl_events_EventDispatcher.call(this);
};
$hxClasses["feathers.layout.VDividedBoxLayout"] = feathers_layout_VDividedBoxLayout;
feathers_layout_VDividedBoxLayout.__name__ = "feathers.layout.VDividedBoxLayout";
feathers_layout_VDividedBoxLayout.__interfaces__ = [feathers_layout_ILayout];
feathers_layout_VDividedBoxLayout.__super__ = openfl_events_EventDispatcher;
feathers_layout_VDividedBoxLayout.prototype = $extend(openfl_events_EventDispatcher.prototype,{
	_paddingTop: null
	,get_paddingTop: function() {
		return this._paddingTop;
	}
	,set_paddingTop: function(value) {
		if(this._paddingTop == value) {
			return this._paddingTop;
		}
		this._paddingTop = value;
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._paddingTop;
	}
	,_paddingRight: null
	,get_paddingRight: function() {
		return this._paddingRight;
	}
	,set_paddingRight: function(value) {
		if(this._paddingRight == value) {
			return this._paddingRight;
		}
		this._paddingRight = value;
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._paddingRight;
	}
	,_paddingBottom: null
	,get_paddingBottom: function() {
		return this._paddingBottom;
	}
	,set_paddingBottom: function(value) {
		if(this._paddingBottom == value) {
			return this._paddingBottom;
		}
		this._paddingBottom = value;
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._paddingBottom;
	}
	,_paddingLeft: null
	,get_paddingLeft: function() {
		return this._paddingLeft;
	}
	,set_paddingLeft: function(value) {
		if(this._paddingLeft == value) {
			return this._paddingLeft;
		}
		this._paddingLeft = value;
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._paddingLeft;
	}
	,_horizontalAlign: null
	,get_horizontalAlign: function() {
		return this._horizontalAlign;
	}
	,set_horizontalAlign: function(value) {
		if(this._horizontalAlign == value) {
			return this._horizontalAlign;
		}
		this._horizontalAlign = value;
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._horizontalAlign;
	}
	,_customItemHeights: null
	,get_customItemHeights: function() {
		return this._customItemHeights;
	}
	,set_customItemHeights: function(value) {
		if(this._customItemHeights == value) {
			return this._customItemHeights;
		}
		this._customItemHeights = value;
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._customItemHeights;
	}
	,_fallbackFluidIndex: null
	,get_fallbackFluidIndex: function() {
		return this._fallbackFluidIndex;
	}
	,set_fallbackFluidIndex: function(value) {
		if(this._fallbackFluidIndex == value) {
			return this._fallbackFluidIndex;
		}
		this._fallbackFluidIndex = value;
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._fallbackFluidIndex;
	}
	,setPadding: function(value) {
		this.set_paddingTop(value);
		this.set_paddingRight(value);
		this.set_paddingBottom(value);
		this.set_paddingLeft(value);
	}
	,layout: function(items,measurements,result) {
		var i = 0;
		while(i < items.length) {
			var item = items[i];
			var divider = null;
			if(i > 0) {
				divider = items[i - 1];
			}
			if(js_Boot.__implements(item,feathers_layout_ILayoutObject) && !item.get_includeInLayout()) {
				i += 2;
				continue;
			}
			if(this._customItemHeights != null && i < this._customItemHeights.length) {
				var itemHeight = this._customItemHeights[i];
				if(itemHeight != null) {
					item.set_height(itemHeight);
				}
			}
			if(js_Boot.__implements(item,feathers_core_IValidating)) {
				item.validateNow();
			}
			if(js_Boot.__implements(divider,feathers_core_IValidating)) {
				divider.validateNow();
			}
			i += 2;
		}
		this.applyPercentHeight(items,measurements.height,measurements.minHeight,measurements.maxHeight);
		var contentWidth = 0.0;
		var contentHeight = this._paddingTop;
		var i = 0;
		while(i < items.length) {
			var item = items[i];
			var divider = null;
			if(i > 0) {
				divider = items[i - 1];
			}
			if(js_Boot.__implements(item,feathers_layout_ILayoutObject) && !item.get_includeInLayout()) {
				i += 2;
				continue;
			}
			if(js_Boot.__implements(divider,feathers_core_IValidating)) {
				divider.validateNow();
			}
			if(divider != null && divider.get_visible()) {
				divider.set_y(contentHeight);
				contentHeight += divider.get_height();
			}
			if(js_Boot.__implements(item,feathers_core_IValidating)) {
				item.validateNow();
			}
			if(contentWidth < item.get_width()) {
				contentWidth = item.get_width();
			}
			item.set_y(contentHeight);
			contentHeight += item.get_height();
			i += 2;
		}
		contentWidth += this._paddingLeft + this._paddingRight;
		contentHeight += this._paddingBottom;
		var viewPortWidth = contentWidth;
		if(measurements.width != null) {
			viewPortWidth = measurements.width;
		} else if(measurements.minWidth != null && viewPortWidth < measurements.minWidth) {
			viewPortWidth = measurements.minWidth;
		} else if(measurements.maxWidth != null && viewPortWidth > measurements.maxWidth) {
			viewPortWidth = measurements.maxWidth;
		}
		var viewPortHeight = contentHeight;
		if(measurements.height != null) {
			viewPortHeight = measurements.height;
		} else if(measurements.minHeight != null && viewPortHeight < measurements.minHeight) {
			viewPortHeight = measurements.minHeight;
		} else if(measurements.maxHeight != null && viewPortHeight > measurements.maxHeight) {
			viewPortHeight = measurements.maxHeight;
		}
		this.applyPercentWidth(items,viewPortWidth);
		var i = 0;
		while(i < items.length) {
			var divider = null;
			if(i > 0) {
				divider = items[i - 1];
			}
			if(divider == null) {
				i += 2;
				continue;
			}
			switch(this._horizontalAlign._hx_index) {
			case 0:
				divider.set_x(this._paddingLeft);
				break;
			case 1:
				divider.set_x(Math.max(this._paddingLeft,this._paddingLeft + (viewPortWidth - this._paddingLeft - this._paddingRight - divider.get_width()) / 2.0));
				break;
			case 2:
				divider.set_x(Math.max(this._paddingLeft,this._paddingLeft + (viewPortWidth - this._paddingLeft - this._paddingRight) - divider.get_width()));
				break;
			case 3:
				divider.set_x(this._paddingLeft);
				divider.set_width(viewPortWidth - this._paddingLeft - this._paddingRight);
				break;
			}
			i += 2;
		}
		if(contentWidth < viewPortWidth) {
			contentWidth = viewPortWidth;
		}
		if(contentHeight < viewPortHeight) {
			contentHeight = viewPortHeight;
		}
		if(result == null) {
			result = new feathers_layout_LayoutBoundsResult();
		}
		result.contentX = 0.0;
		result.contentY = 0.0;
		result.contentWidth = contentWidth;
		result.contentHeight = contentHeight;
		result.viewPortWidth = viewPortWidth;
		result.viewPortHeight = viewPortHeight;
		return result;
	}
	,validateItems: function(items) {
		var i = 0;
		while(i < items.length) {
			var item = items[i];
			var divider = null;
			if(i > 0) {
				divider = items[i - 1];
			}
			if(js_Boot.__implements(item,feathers_layout_ILayoutObject) && !item.get_includeInLayout()) {
				i += 2;
				continue;
			}
			if(this._customItemHeights != null && i < this._customItemHeights.length) {
				var itemHeight = this._customItemHeights[i];
				if(itemHeight != null) {
					item.set_height(itemHeight);
				}
			}
			if(js_Boot.__implements(item,feathers_core_IValidating)) {
				item.validateNow();
			}
			if(js_Boot.__implements(divider,feathers_core_IValidating)) {
				divider.validateNow();
			}
			i += 2;
		}
	}
	,applyHorizontalAlign: function(items,viewPortWidth) {
		var i = 0;
		while(i < items.length) {
			var divider = null;
			if(i > 0) {
				divider = items[i - 1];
			}
			if(divider == null) {
				i += 2;
				continue;
			}
			switch(this._horizontalAlign._hx_index) {
			case 0:
				divider.set_x(this._paddingLeft);
				break;
			case 1:
				divider.set_x(Math.max(this._paddingLeft,this._paddingLeft + (viewPortWidth - this._paddingLeft - this._paddingRight - divider.get_width()) / 2.0));
				break;
			case 2:
				divider.set_x(Math.max(this._paddingLeft,this._paddingLeft + (viewPortWidth - this._paddingLeft - this._paddingRight) - divider.get_width()));
				break;
			case 3:
				divider.set_x(this._paddingLeft);
				divider.set_width(viewPortWidth - this._paddingLeft - this._paddingRight);
				break;
			}
			i += 2;
		}
	}
	,applyPercentHeight: function(items,explicitHeight,explicitMinHeight,explicitMaxHeight) {
		var customHeightIndices = [];
		var pendingIndices = [];
		var totalMeasuredHeight = 0.0;
		var totalMinHeight = 0.0;
		var totalPercentHeight = 0.0;
		var fallbackFluidIndex = this._fallbackFluidIndex;
		var fallbackFallbackFluidIndex = -1;
		var i = 0;
		while(i < items.length) {
			var item = items[i];
			var divider = null;
			if(i > 0) {
				divider = items[i - 1];
			}
			if(js_Boot.__implements(item,feathers_layout_ILayoutObject) && !item.get_includeInLayout()) {
				if(fallbackFluidIndex == i) {
					fallbackFluidIndex = -1;
				}
				i += 2;
				continue;
			}
			fallbackFallbackFluidIndex = i;
			if(divider != null && divider.get_visible()) {
				totalMeasuredHeight += divider.get_height();
			}
			var nonDividerIndex = Math.floor(i / 2);
			var needsPercentHeight = true;
			if(this._customItemHeights != null && nonDividerIndex < this._customItemHeights.length) {
				var itemHeight = this._customItemHeights[nonDividerIndex];
				if(itemHeight != null) {
					needsPercentHeight = false;
					item.set_height(itemHeight);
					customHeightIndices.push(i);
					if(js_Boot.__implements(item,feathers_core_IValidating)) {
						item.validateNow();
					}
				}
			}
			if(needsPercentHeight) {
				var percentHeight = 100.0;
				if(js_Boot.__implements(item,feathers_core_IMeasureObject)) {
					var measureItem = item;
					var columnExplicitMinHeight = measureItem.get_explicitMinHeight();
					if(columnExplicitMinHeight != null) {
						totalMinHeight += columnExplicitMinHeight;
					}
				}
				totalPercentHeight += percentHeight;
				pendingIndices.push(i);
				i += 2;
				continue;
			}
			totalMeasuredHeight += item.get_height();
			i += 2;
		}
		totalMeasuredHeight += this._paddingTop + this._paddingBottom;
		var remainingHeight = 0.0;
		if(explicitHeight != null) {
			remainingHeight = explicitHeight;
		} else {
			remainingHeight = totalMeasuredHeight + totalMinHeight;
			if(explicitMinHeight != null && remainingHeight < explicitMinHeight) {
				remainingHeight = explicitMinHeight;
			} else if(explicitMaxHeight != null && remainingHeight > explicitMaxHeight) {
				remainingHeight = explicitMaxHeight;
			}
		}
		remainingHeight -= totalMeasuredHeight;
		var needsAnotherPass = false;
		do {
			needsAnotherPass = false;
			var heightSum = 0.0;
			var percentToPixels = remainingHeight / totalPercentHeight;
			if(percentToPixels < 0.0) {
				percentToPixels = 0.0;
			}
			var _g = 0;
			while(_g < pendingIndices.length) {
				var index = pendingIndices[_g];
				++_g;
				var item = items[index];
				var percentHeight = 100.0;
				var itemHeight = Math.floor(percentToPixels * percentHeight);
				var columnMinHeight = null;
				if(js_Boot.__implements(item,feathers_core_IMeasureObject)) {
					var measureItem = item;
					columnMinHeight = measureItem.get_explicitMinHeight();
				}
				if(columnMinHeight != null) {
					if(columnMinHeight > remainingHeight) {
						columnMinHeight = remainingHeight;
					}
					if(itemHeight < columnMinHeight) {
						itemHeight = columnMinHeight;
						remainingHeight -= itemHeight;
						totalPercentHeight -= percentHeight;
						HxOverrides.remove(pendingIndices,index);
						needsAnotherPass = true;
					}
				}
				item.set_height(itemHeight);
				if(js_Boot.__implements(item,feathers_core_IValidating)) {
					item.validateNow();
				}
				heightSum += itemHeight;
			}
			if(needsAnotherPass) {
				heightSum = 0.0;
			} else {
				remainingHeight -= heightSum;
			}
		} while(needsAnotherPass);
		if(remainingHeight > 0.0 && pendingIndices.length > 0) {
			var index = pendingIndices[pendingIndices.length - 1];
			var finalItem = items[index];
			finalItem.set_height(finalItem.get_height() + remainingHeight);
			return;
		}
		if(remainingHeight == 0.0) {
			return;
		}
		if(fallbackFluidIndex == -1 || fallbackFallbackFluidIndex < fallbackFluidIndex) {
			fallbackFluidIndex = fallbackFallbackFluidIndex;
		}
		if(fallbackFluidIndex != -1) {
			var fallbackItem = items[fallbackFluidIndex];
			var itemHeight = fallbackItem.get_height() + remainingHeight;
			if(itemHeight < 0.0) {
				remainingHeight = itemHeight;
				itemHeight = 0.0;
				HxOverrides.remove(customHeightIndices,fallbackFluidIndex);
			} else {
				remainingHeight = 0.0;
			}
			fallbackItem.set_height(itemHeight);
		}
		if(remainingHeight == 0.0) {
			return;
		}
		var offset = remainingHeight / customHeightIndices.length;
		var _g = 0;
		while(_g < customHeightIndices.length) {
			var index = customHeightIndices[_g];
			++_g;
			var item = items[index];
			item.set_height(item.get_height() + offset);
		}
	}
	,applyPercentWidth: function(items,viewPortWidth) {
		var availableWidth = viewPortWidth - this._paddingLeft - this._paddingRight;
		var i = 0;
		while(i < items.length) {
			var item = items[i];
			if(js_Boot.__implements(item,feathers_layout_ILayoutObject) && !item.get_includeInLayout()) {
				i += 2;
				continue;
			}
			var itemWidth = availableWidth;
			if(js_Boot.__implements(item,feathers_core_IMeasureObject)) {
				var measureItem = item;
				var itemMinWidth = measureItem.get_explicitMinWidth();
				if(itemMinWidth != null) {
					if(itemMinWidth > availableWidth) {
						itemMinWidth = availableWidth;
					}
					if(itemWidth < itemMinWidth) {
						itemWidth = itemMinWidth;
					}
				}
				var itemMaxWidth = measureItem.get_explicitMaxWidth();
				if(itemMaxWidth != null && itemWidth > itemMaxWidth) {
					itemWidth = itemMaxWidth;
				}
			}
			item.set_width(itemWidth);
			i += 2;
		}
	}
	,__class__: feathers_layout_VDividedBoxLayout
	,__properties__: {set_fallbackFluidIndex:"set_fallbackFluidIndex",get_fallbackFluidIndex:"get_fallbackFluidIndex",set_customItemHeights:"set_customItemHeights",get_customItemHeights:"get_customItemHeights",set_horizontalAlign:"set_horizontalAlign",get_horizontalAlign:"get_horizontalAlign",set_paddingLeft:"set_paddingLeft",get_paddingLeft:"get_paddingLeft",set_paddingBottom:"set_paddingBottom",get_paddingBottom:"get_paddingBottom",set_paddingRight:"set_paddingRight",get_paddingRight:"get_paddingRight",set_paddingTop:"set_paddingTop",get_paddingTop:"get_paddingTop"}
});
var feathers_layout_VerticalAlign = $hxEnums["feathers.layout.VerticalAlign"] = { __ename__:"feathers.layout.VerticalAlign",__constructs__:null
	,TOP: {_hx_name:"TOP",_hx_index:0,__enum__:"feathers.layout.VerticalAlign",toString:$estr}
	,MIDDLE: {_hx_name:"MIDDLE",_hx_index:1,__enum__:"feathers.layout.VerticalAlign",toString:$estr}
	,BOTTOM: {_hx_name:"BOTTOM",_hx_index:2,__enum__:"feathers.layout.VerticalAlign",toString:$estr}
	,JUSTIFY: {_hx_name:"JUSTIFY",_hx_index:3,__enum__:"feathers.layout.VerticalAlign",toString:$estr}
};
feathers_layout_VerticalAlign.__constructs__ = [feathers_layout_VerticalAlign.TOP,feathers_layout_VerticalAlign.MIDDLE,feathers_layout_VerticalAlign.BOTTOM,feathers_layout_VerticalAlign.JUSTIFY];
var feathers_layout_VerticalLayout = function() {
	this._percentHeightResetEnabled = false;
	this._percentWidthResetEnabled = false;
	this._justifyResetEnabled = false;
	this._verticalAlign = feathers_layout_VerticalAlign.TOP;
	this._horizontalAlign = feathers_layout_HorizontalAlign.LEFT;
	this._minGap = 0.0;
	this._gap = 0.0;
	this._paddingLeft = 0.0;
	this._paddingBottom = 0.0;
	this._paddingRight = 0.0;
	this._paddingTop = 0.0;
	openfl_events_EventDispatcher.call(this);
};
$hxClasses["feathers.layout.VerticalLayout"] = feathers_layout_VerticalLayout;
feathers_layout_VerticalLayout.__name__ = "feathers.layout.VerticalLayout";
feathers_layout_VerticalLayout.__interfaces__ = [feathers_layout_IDragDropLayout,feathers_layout_ILayout];
feathers_layout_VerticalLayout.__super__ = openfl_events_EventDispatcher;
feathers_layout_VerticalLayout.prototype = $extend(openfl_events_EventDispatcher.prototype,{
	_paddingTop: null
	,get_paddingTop: function() {
		return this._paddingTop;
	}
	,set_paddingTop: function(value) {
		if(this._paddingTop == value) {
			return this._paddingTop;
		}
		this._paddingTop = value;
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._paddingTop;
	}
	,_paddingRight: null
	,get_paddingRight: function() {
		return this._paddingRight;
	}
	,set_paddingRight: function(value) {
		if(this._paddingRight == value) {
			return this._paddingRight;
		}
		this._paddingRight = value;
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._paddingRight;
	}
	,_paddingBottom: null
	,get_paddingBottom: function() {
		return this._paddingBottom;
	}
	,set_paddingBottom: function(value) {
		if(this._paddingBottom == value) {
			return this._paddingBottom;
		}
		this._paddingBottom = value;
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._paddingBottom;
	}
	,_paddingLeft: null
	,get_paddingLeft: function() {
		return this._paddingLeft;
	}
	,set_paddingLeft: function(value) {
		if(this._paddingLeft == value) {
			return this._paddingLeft;
		}
		this._paddingLeft = value;
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._paddingLeft;
	}
	,_gap: null
	,get_gap: function() {
		return this._gap;
	}
	,set_gap: function(value) {
		if(this._gap == value) {
			return this._gap;
		}
		this._gap = value;
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._gap;
	}
	,_minGap: null
	,get_minGap: function() {
		return this._minGap;
	}
	,set_minGap: function(value) {
		if(this._minGap == value) {
			return this._minGap;
		}
		this._minGap = value;
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._minGap;
	}
	,_horizontalAlign: null
	,get_horizontalAlign: function() {
		return this._horizontalAlign;
	}
	,set_horizontalAlign: function(value) {
		if(this._horizontalAlign == value) {
			return this._horizontalAlign;
		}
		this._horizontalAlign = value;
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._horizontalAlign;
	}
	,_verticalAlign: null
	,get_verticalAlign: function() {
		return this._verticalAlign;
	}
	,set_verticalAlign: function(value) {
		if(this._verticalAlign == value) {
			return this._verticalAlign;
		}
		this._verticalAlign = value;
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._verticalAlign;
	}
	,_justifyResetEnabled: null
	,get_justifyResetEnabled: function() {
		return this._justifyResetEnabled;
	}
	,set_justifyResetEnabled: function(value) {
		if(this._justifyResetEnabled == value) {
			return this._justifyResetEnabled;
		}
		this._justifyResetEnabled = value;
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._justifyResetEnabled;
	}
	,_percentWidthResetEnabled: null
	,get_percentWidthResetEnabled: function() {
		return this._percentWidthResetEnabled;
	}
	,set_percentWidthResetEnabled: function(value) {
		if(this._percentWidthResetEnabled == value) {
			return this._percentWidthResetEnabled;
		}
		this._percentWidthResetEnabled = value;
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._percentWidthResetEnabled;
	}
	,_percentHeightResetEnabled: null
	,get_percentHeightResetEnabled: function() {
		return this._percentHeightResetEnabled;
	}
	,set_percentHeightResetEnabled: function(value) {
		if(this._percentHeightResetEnabled == value) {
			return this._percentHeightResetEnabled;
		}
		this._percentHeightResetEnabled = value;
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._percentHeightResetEnabled;
	}
	,setPadding: function(value) {
		this.set_paddingTop(value);
		this.set_paddingRight(value);
		this.set_paddingBottom(value);
		this.set_paddingLeft(value);
	}
	,layout: function(items,measurements,result) {
		var adjustedGap = this._gap;
		var hasFlexGap = this._gap == 1.0 / 0.0;
		if(hasFlexGap) {
			adjustedGap = this._minGap;
		}
		var isJustified = this._horizontalAlign == feathers_layout_HorizontalAlign.JUSTIFY;
		var explicitContentWidth = measurements.width;
		if(explicitContentWidth != null) {
			explicitContentWidth -= this._paddingLeft + this._paddingRight;
		}
		var explicitContentHeight = measurements.height;
		if(explicitContentHeight != null) {
			explicitContentHeight -= this._paddingTop + this._paddingBottom;
		}
		var _g = 0;
		while(_g < items.length) {
			var item = items[_g];
			++_g;
			var percentWidth = null;
			var percentHeight = null;
			if(js_Boot.__implements(item,feathers_layout_ILayoutObject)) {
				var layoutItem = item;
				if(!layoutItem.get_includeInLayout()) {
					continue;
				}
				var value = layoutItem.get_layoutData();
				var layoutData = ((value) instanceof feathers_layout_VerticalLayoutData) ? value : null;
				if(layoutData != null) {
					percentWidth = layoutData.get_percentWidth();
					percentHeight = layoutData.get_percentHeight();
				}
			}
			if(isJustified) {
				if(explicitContentWidth != null) {
					item.set_width(explicitContentWidth);
				} else if(this._justifyResetEnabled && js_Boot.__implements(item,feathers_core_IMeasureObject)) {
					item.resetWidth();
				}
			} else if(explicitContentWidth != null) {
				if(percentWidth != null) {
					if(percentWidth < 0.0) {
						percentWidth = 0.0;
					} else if(percentWidth > 100.0) {
						percentWidth = 100.0;
					}
					item.set_width(explicitContentWidth * (percentWidth / 100.0));
				}
			} else if(percentWidth != null && this._percentWidthResetEnabled && js_Boot.__implements(item,feathers_core_IMeasureObject)) {
				item.resetWidth();
			}
			if(percentHeight != null && this._percentHeightResetEnabled && explicitContentHeight == null && js_Boot.__implements(item,feathers_core_IMeasureObject)) {
				item.resetHeight();
			}
			if(js_Boot.__implements(item,feathers_core_IValidating)) {
				item.validateNow();
			}
			if(isJustified && explicitContentWidth == null && measurements.maxWidth != null) {
				var maxExplicitContentWidth = measurements.maxWidth - this._paddingLeft - this._paddingRight;
				if(item.get_width() > maxExplicitContentWidth) {
					item.set_width(maxExplicitContentWidth);
					if(js_Boot.__implements(item,feathers_core_IValidating)) {
						item.validateNow();
					}
				}
			}
		}
		this.applyPercentHeight(items,measurements.height,measurements.minHeight,measurements.maxHeight,adjustedGap);
		var contentWidth = 0.0;
		var contentHeight = this._paddingTop;
		var _g = 0;
		while(_g < items.length) {
			var item = items[_g];
			++_g;
			var layoutData = null;
			var layoutObject = null;
			if(js_Boot.__implements(item,feathers_layout_ILayoutObject)) {
				layoutObject = item;
				if(!layoutObject.get_includeInLayout()) {
					continue;
				}
				var value = layoutObject.get_layoutData();
				layoutData = ((value) instanceof feathers_layout_VerticalLayoutData) ? value : null;
			}
			if(js_Boot.__implements(item,feathers_core_IValidating)) {
				item.validateNow();
			}
			if(contentWidth < item.get_width()) {
				contentWidth = item.get_width();
			}
			if(layoutData != null && layoutData.get_marginTop() != null) {
				contentHeight += layoutData.get_marginTop();
			}
			item.set_y(contentHeight);
			contentHeight += item.get_height() + adjustedGap;
			if(layoutData != null && layoutData.get_marginBottom() != null) {
				contentHeight += layoutData.get_marginBottom();
			}
		}
		var maxItemWidth = contentWidth;
		contentWidth += this._paddingLeft + this._paddingRight;
		contentHeight += this._paddingBottom;
		if(items.length > 0) {
			contentHeight -= adjustedGap;
		}
		var viewPortWidth = contentWidth;
		if(measurements.width != null) {
			viewPortWidth = measurements.width;
		} else if(measurements.minWidth != null && viewPortWidth < measurements.minWidth) {
			viewPortWidth = measurements.minWidth;
		} else if(measurements.maxWidth != null && viewPortWidth > measurements.maxWidth) {
			viewPortWidth = measurements.maxWidth;
		}
		var viewPortHeight = contentHeight;
		if(measurements.height != null) {
			viewPortHeight = measurements.height;
		} else if(measurements.minHeight != null && viewPortHeight < measurements.minHeight) {
			viewPortHeight = measurements.minHeight;
		} else if(measurements.maxHeight != null && viewPortHeight > measurements.maxHeight) {
			viewPortHeight = measurements.maxHeight;
		}
		this.applyPercentWidth(items,viewPortWidth);
		var _g = 0;
		while(_g < items.length) {
			var item = items[_g];
			++_g;
			var layoutObject = null;
			if(js_Boot.__implements(item,feathers_layout_ILayoutObject)) {
				layoutObject = item;
				if(!layoutObject.get_includeInLayout()) {
					continue;
				}
			}
			switch(this._horizontalAlign._hx_index) {
			case 0:
				item.set_x(this._paddingLeft);
				break;
			case 1:
				item.set_x(Math.max(this._paddingLeft,this._paddingLeft + (viewPortWidth - this._paddingLeft - this._paddingRight - item.get_width()) / 2.0));
				break;
			case 2:
				item.set_x(Math.max(this._paddingLeft,this._paddingLeft + (viewPortWidth - this._paddingLeft - this._paddingRight) - item.get_width()));
				break;
			case 3:
				item.set_x(this._paddingLeft);
				item.set_width(viewPortWidth - this._paddingLeft - this._paddingRight);
				break;
			}
		}
		var contentHeight1 = contentHeight - this._paddingTop - this._paddingBottom;
		var alignOffset = 0.0;
		var gapOffset = 0.0;
		var maxAlignmentHeight = viewPortHeight - this._paddingTop - this._paddingBottom;
		var adjustedGap = this._gap;
		var hasFlexGap = this._gap == 1.0 / 0.0;
		if(hasFlexGap) {
			adjustedGap = this._minGap;
			if(items.length > 1 && maxAlignmentHeight > contentHeight1) {
				adjustedGap += (maxAlignmentHeight - contentHeight1) / (items.length - 1);
			}
			gapOffset = adjustedGap - this._minGap;
		} else {
			switch(this._verticalAlign._hx_index) {
			case 0:
				alignOffset = 0.0;
				break;
			case 1:
				alignOffset = (maxAlignmentHeight - contentHeight1) / 2.0;
				break;
			case 2:
				alignOffset = maxAlignmentHeight - contentHeight1;
				break;
			default:
				throw new openfl_errors_ArgumentError("Unknown vertical align: " + Std.string(this._verticalAlign));
			}
			if(alignOffset < 0.0) {
				alignOffset = 0.0;
			}
		}
		if(!(alignOffset == 0.0 && gapOffset == 0.0)) {
			var totalOffset = alignOffset;
			var _g = 0;
			while(_g < items.length) {
				var item = items[_g];
				++_g;
				var layoutObject = null;
				if(js_Boot.__implements(item,feathers_layout_ILayoutObject)) {
					layoutObject = item;
					if(!layoutObject.get_includeInLayout()) {
						continue;
					}
				}
				item.set_y(Math.max(this._paddingTop,item.get_y() + totalOffset));
				totalOffset += gapOffset;
			}
		}
		if(contentWidth < viewPortWidth) {
			contentWidth = viewPortWidth;
		}
		if(contentHeight < viewPortHeight) {
			contentHeight = viewPortHeight;
		}
		if(result == null) {
			result = new feathers_layout_LayoutBoundsResult();
		}
		result.contentX = 0.0;
		result.contentY = 0.0;
		result.contentWidth = contentWidth;
		result.contentHeight = contentHeight;
		result.viewPortWidth = viewPortWidth;
		result.viewPortHeight = viewPortHeight;
		return result;
	}
	,getDragDropIndex: function(items,x,y,width,height) {
		var adjustedGap = this._gap;
		var hasFlexGap = this._gap == 1.0 / 0.0;
		if(hasFlexGap) {
			adjustedGap = this._minGap;
		}
		var positionY = this._paddingTop;
		var _g = 0;
		var _g1 = items.length;
		while(_g < _g1) {
			var i = _g++;
			var item = items[i];
			if(js_Boot.__implements(item,feathers_layout_ILayoutObject)) {
				var layoutItem = item;
				if(!layoutItem.get_includeInLayout()) {
					continue;
				}
			}
			if(js_Boot.__implements(item,feathers_core_IValidating)) {
				item.validateNow();
			}
			var itemHeight = item.get_height();
			if(y < positionY + itemHeight / 2.0) {
				return i;
			}
			positionY += itemHeight + adjustedGap;
		}
		return items.length;
	}
	,getDragDropRegion: function(items,dropIndex,x,y,width,height,result) {
		var adjustedGap = this._gap;
		var hasFlexGap = this._gap == 1.0 / 0.0;
		if(hasFlexGap) {
			adjustedGap = this._minGap;
		}
		var maxIndex = dropIndex;
		if(maxIndex < 0) {
			maxIndex = 0;
		} else if(maxIndex > items.length) {
			maxIndex = items.length;
		}
		var positionY = this._paddingTop;
		var _g = 0;
		var _g1 = maxIndex;
		while(_g < _g1) {
			var i = _g++;
			var item = items[i];
			if(js_Boot.__implements(item,feathers_layout_ILayoutObject)) {
				var layoutItem = item;
				if(!layoutItem.get_includeInLayout()) {
					continue;
				}
			}
			if(js_Boot.__implements(item,feathers_core_IValidating)) {
				item.validateNow();
			}
			positionY += item.get_height() + adjustedGap;
		}
		if(result == null) {
			result = new openfl_geom_Rectangle(0.0,positionY,width,0.0);
		} else {
			result.setTo(0.0,positionY,width,0.0);
		}
		return result;
	}
	,validateItems: function(items,measurements) {
		var isJustified = this._horizontalAlign == feathers_layout_HorizontalAlign.JUSTIFY;
		var explicitContentWidth = measurements.width;
		if(explicitContentWidth != null) {
			explicitContentWidth -= this._paddingLeft + this._paddingRight;
		}
		var explicitContentHeight = measurements.height;
		if(explicitContentHeight != null) {
			explicitContentHeight -= this._paddingTop + this._paddingBottom;
		}
		var _g = 0;
		while(_g < items.length) {
			var item = items[_g];
			++_g;
			var percentWidth = null;
			var percentHeight = null;
			if(js_Boot.__implements(item,feathers_layout_ILayoutObject)) {
				var layoutItem = item;
				if(!layoutItem.get_includeInLayout()) {
					continue;
				}
				var value = layoutItem.get_layoutData();
				var layoutData = ((value) instanceof feathers_layout_VerticalLayoutData) ? value : null;
				if(layoutData != null) {
					percentWidth = layoutData.get_percentWidth();
					percentHeight = layoutData.get_percentHeight();
				}
			}
			if(isJustified) {
				if(explicitContentWidth != null) {
					item.set_width(explicitContentWidth);
				} else if(this._justifyResetEnabled && js_Boot.__implements(item,feathers_core_IMeasureObject)) {
					item.resetWidth();
				}
			} else if(explicitContentWidth != null) {
				if(percentWidth != null) {
					if(percentWidth < 0.0) {
						percentWidth = 0.0;
					} else if(percentWidth > 100.0) {
						percentWidth = 100.0;
					}
					item.set_width(explicitContentWidth * (percentWidth / 100.0));
				}
			} else if(percentWidth != null && this._percentWidthResetEnabled && js_Boot.__implements(item,feathers_core_IMeasureObject)) {
				item.resetWidth();
			}
			if(percentHeight != null && this._percentHeightResetEnabled && explicitContentHeight == null && js_Boot.__implements(item,feathers_core_IMeasureObject)) {
				item.resetHeight();
			}
			if(js_Boot.__implements(item,feathers_core_IValidating)) {
				item.validateNow();
			}
			if(isJustified && explicitContentWidth == null && measurements.maxWidth != null) {
				var maxExplicitContentWidth = measurements.maxWidth - this._paddingLeft - this._paddingRight;
				if(item.get_width() > maxExplicitContentWidth) {
					item.set_width(maxExplicitContentWidth);
					if(js_Boot.__implements(item,feathers_core_IValidating)) {
						item.validateNow();
					}
				}
			}
		}
	}
	,applyHorizontalAlign: function(items,maxItemWidth,viewPortWidth) {
		var _g = 0;
		while(_g < items.length) {
			var item = items[_g];
			++_g;
			var layoutObject = null;
			if(js_Boot.__implements(item,feathers_layout_ILayoutObject)) {
				layoutObject = item;
				if(!layoutObject.get_includeInLayout()) {
					continue;
				}
			}
			switch(this._horizontalAlign._hx_index) {
			case 0:
				item.set_x(this._paddingLeft);
				break;
			case 1:
				item.set_x(Math.max(this._paddingLeft,this._paddingLeft + (viewPortWidth - this._paddingLeft - this._paddingRight - item.get_width()) / 2.0));
				break;
			case 2:
				item.set_x(Math.max(this._paddingLeft,this._paddingLeft + (viewPortWidth - this._paddingLeft - this._paddingRight) - item.get_width()));
				break;
			case 3:
				item.set_x(this._paddingLeft);
				item.set_width(viewPortWidth - this._paddingLeft - this._paddingRight);
				break;
			}
		}
	}
	,applyVerticalAlign: function(items,contentHeight,viewPortHeight) {
		var alignOffset = 0.0;
		var gapOffset = 0.0;
		var maxAlignmentHeight = viewPortHeight - this._paddingTop - this._paddingBottom;
		var adjustedGap = this._gap;
		var hasFlexGap = this._gap == 1.0 / 0.0;
		if(hasFlexGap) {
			adjustedGap = this._minGap;
			if(items.length > 1 && maxAlignmentHeight > contentHeight) {
				adjustedGap += (maxAlignmentHeight - contentHeight) / (items.length - 1);
			}
			gapOffset = adjustedGap - this._minGap;
		} else {
			switch(this._verticalAlign._hx_index) {
			case 0:
				alignOffset = 0.0;
				break;
			case 1:
				alignOffset = (maxAlignmentHeight - contentHeight) / 2.0;
				break;
			case 2:
				alignOffset = maxAlignmentHeight - contentHeight;
				break;
			default:
				throw new openfl_errors_ArgumentError("Unknown vertical align: " + Std.string(this._verticalAlign));
			}
			if(alignOffset < 0.0) {
				alignOffset = 0.0;
			}
		}
		if(alignOffset == 0.0 && gapOffset == 0.0) {
			return;
		}
		var totalOffset = alignOffset;
		var _g = 0;
		while(_g < items.length) {
			var item = items[_g];
			++_g;
			var layoutObject = null;
			if(js_Boot.__implements(item,feathers_layout_ILayoutObject)) {
				layoutObject = item;
				if(!layoutObject.get_includeInLayout()) {
					continue;
				}
			}
			item.set_y(Math.max(this._paddingTop,item.get_y() + totalOffset));
			totalOffset += gapOffset;
		}
	}
	,applyPercentWidth: function(items,viewPortWidth) {
		var availableWidth = viewPortWidth - this._paddingLeft - this._paddingRight;
		var _g = 0;
		while(_g < items.length) {
			var item = items[_g];
			++_g;
			if(!js_Boot.__implements(item,feathers_layout_ILayoutObject)) {
				continue;
			}
			var layoutItem = item;
			if(!layoutItem.get_includeInLayout()) {
				continue;
			}
			var value = layoutItem.get_layoutData();
			var layoutData = ((value) instanceof feathers_layout_VerticalLayoutData) ? value : null;
			if(layoutData == null) {
				continue;
			}
			var percentWidth = layoutData.get_percentWidth();
			if(percentWidth == null) {
				continue;
			}
			if(percentWidth < 0.0) {
				percentWidth = 0.0;
			} else if(percentWidth > 100.0) {
				percentWidth = 100.0;
			}
			var itemWidth = availableWidth * percentWidth / 100.0;
			if(js_Boot.__implements(item,feathers_core_IMeasureObject)) {
				var measureItem = item;
				var itemMinWidth = measureItem.get_explicitMinWidth();
				if(itemMinWidth != null) {
					if(itemMinWidth > availableWidth) {
						itemMinWidth = availableWidth;
					}
					if(itemWidth < itemMinWidth) {
						itemWidth = itemMinWidth;
					}
				}
				var itemMaxWidth = measureItem.get_explicitMaxWidth();
				if(itemMaxWidth != null && itemWidth > itemMaxWidth) {
					itemWidth = itemMaxWidth;
				}
			}
			item.set_width(itemWidth);
		}
	}
	,applyPercentHeight: function(items,explicitHeight,explicitMinHeight,explicitMaxHeight,adjustedGap) {
		var pendingItems = [];
		var totalMeasuredHeight = 0.0;
		var totalMinHeight = 0.0;
		var totalPercentHeight = 0.0;
		var _g = 0;
		while(_g < items.length) {
			var item = items[_g];
			++_g;
			if(js_Boot.__implements(item,feathers_layout_ILayoutObject)) {
				var layoutItem = item;
				if(!layoutItem.get_includeInLayout()) {
					continue;
				}
				var value = layoutItem.get_layoutData();
				var layoutData = ((value) instanceof feathers_layout_VerticalLayoutData) ? value : null;
				if(layoutData != null) {
					var percentHeight = layoutData.get_percentHeight();
					if(percentHeight != null) {
						if(percentHeight < 0.0) {
							percentHeight = 0.0;
						}
						if(js_Boot.__implements(layoutItem,feathers_core_IMeasureObject)) {
							var measureItem = layoutItem;
							totalMinHeight += measureItem.get_minHeight();
						}
						totalPercentHeight += percentHeight;
						if(layoutData.get_marginTop() != null) {
							totalMeasuredHeight += layoutData.get_marginTop();
						}
						if(layoutData.get_marginBottom() != null) {
							totalMeasuredHeight += layoutData.get_marginBottom();
						}
						totalMeasuredHeight += adjustedGap;
						pendingItems.push(layoutItem);
						continue;
					}
				}
			}
			totalMeasuredHeight += item.get_height() + adjustedGap;
		}
		totalMeasuredHeight -= adjustedGap;
		totalMeasuredHeight += this._paddingTop + this._paddingBottom;
		if(totalPercentHeight < 100.0) {
			totalPercentHeight = 100.0;
		}
		var remainingHeight = 0.0;
		if(explicitHeight != null) {
			remainingHeight = explicitHeight;
		} else {
			remainingHeight = totalMeasuredHeight + totalMinHeight;
			if(explicitMinHeight != null && remainingHeight < explicitMinHeight) {
				remainingHeight = explicitMinHeight;
			} else if(explicitMaxHeight != null && remainingHeight > explicitMaxHeight) {
				remainingHeight = explicitMaxHeight;
			}
		}
		remainingHeight -= totalMeasuredHeight;
		if(remainingHeight < 0.0) {
			remainingHeight = 0.0;
		}
		var needsAnotherPass = true;
		while(needsAnotherPass) {
			needsAnotherPass = false;
			var percentToPixels = remainingHeight / totalPercentHeight;
			var _g = 0;
			while(_g < pendingItems.length) {
				var layoutItem = pendingItems[_g];
				++_g;
				var layoutData = js_Boot.__cast(layoutItem.get_layoutData() , feathers_layout_VerticalLayoutData);
				var percentHeight = layoutData.get_percentHeight();
				if(percentHeight < 0.0) {
					percentHeight = 0.0;
				}
				var itemHeight = percentToPixels * percentHeight;
				if(js_Boot.__implements(layoutItem,feathers_core_IMeasureObject)) {
					var measureItem = layoutItem;
					var itemMinHeight = measureItem.get_explicitMinHeight();
					if(itemMinHeight != null && itemMinHeight > remainingHeight) {
						itemMinHeight = remainingHeight;
					}
					if(itemHeight < itemMinHeight) {
						itemHeight = itemMinHeight;
						remainingHeight -= itemHeight;
						totalPercentHeight -= percentHeight;
						HxOverrides.remove(pendingItems,layoutItem);
						needsAnotherPass = true;
					}
				}
				(js_Boot.__cast(layoutItem , openfl_display_DisplayObject)).set_height(itemHeight);
				if(js_Boot.__implements(layoutItem,feathers_core_IValidating)) {
					layoutItem.validateNow();
				}
			}
		}
	}
	,__class__: feathers_layout_VerticalLayout
	,__properties__: {set_percentHeightResetEnabled:"set_percentHeightResetEnabled",get_percentHeightResetEnabled:"get_percentHeightResetEnabled",set_percentWidthResetEnabled:"set_percentWidthResetEnabled",get_percentWidthResetEnabled:"get_percentWidthResetEnabled",set_justifyResetEnabled:"set_justifyResetEnabled",get_justifyResetEnabled:"get_justifyResetEnabled",set_verticalAlign:"set_verticalAlign",get_verticalAlign:"get_verticalAlign",set_horizontalAlign:"set_horizontalAlign",get_horizontalAlign:"get_horizontalAlign",set_minGap:"set_minGap",get_minGap:"get_minGap",set_gap:"set_gap",get_gap:"get_gap",set_paddingLeft:"set_paddingLeft",get_paddingLeft:"get_paddingLeft",set_paddingBottom:"set_paddingBottom",get_paddingBottom:"get_paddingBottom",set_paddingRight:"set_paddingRight",get_paddingRight:"get_paddingRight",set_paddingTop:"set_paddingTop",get_paddingTop:"get_paddingTop"}
});
var feathers_layout_VerticalLayoutData = function(percentWidth,percentHeight) {
	this._marginBottom = null;
	this._marginTop = null;
	this._percentHeight = null;
	this._percentWidth = null;
	openfl_events_EventDispatcher.call(this);
	this.set_percentWidth(percentWidth);
	this.set_percentHeight(percentHeight);
};
$hxClasses["feathers.layout.VerticalLayoutData"] = feathers_layout_VerticalLayoutData;
feathers_layout_VerticalLayoutData.__name__ = "feathers.layout.VerticalLayoutData";
feathers_layout_VerticalLayoutData.__interfaces__ = [feathers_layout_ILayoutData];
feathers_layout_VerticalLayoutData.fill = function() {
	return new feathers_layout_VerticalLayoutData(100.0,100.0);
};
feathers_layout_VerticalLayoutData.fillHorizontal = function(percentWidth) {
	if(percentWidth == null) {
		percentWidth = 100.0;
	}
	return new feathers_layout_VerticalLayoutData(percentWidth,null);
};
feathers_layout_VerticalLayoutData.fillVertical = function(percentHeight) {
	if(percentHeight == null) {
		percentHeight = 100.0;
	}
	return new feathers_layout_VerticalLayoutData(null,percentHeight);
};
feathers_layout_VerticalLayoutData.__super__ = openfl_events_EventDispatcher;
feathers_layout_VerticalLayoutData.prototype = $extend(openfl_events_EventDispatcher.prototype,{
	_percentWidth: null
	,get_percentWidth: function() {
		return this._percentWidth;
	}
	,set_percentWidth: function(value) {
		if(this._percentWidth == value) {
			return this._percentWidth;
		}
		this._percentWidth = value;
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._percentWidth;
	}
	,_percentHeight: null
	,get_percentHeight: function() {
		return this._percentHeight;
	}
	,set_percentHeight: function(value) {
		if(this._percentHeight == value) {
			return this._percentHeight;
		}
		this._percentHeight = value;
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._percentHeight;
	}
	,_marginTop: null
	,get_marginTop: function() {
		return this._marginTop;
	}
	,set_marginTop: function(value) {
		if(this._marginTop == value) {
			return this._marginTop;
		}
		this._marginTop = value;
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._marginTop;
	}
	,_marginBottom: null
	,get_marginBottom: function() {
		return this._marginBottom;
	}
	,set_marginBottom: function(value) {
		if(this._marginBottom == value) {
			return this._marginBottom;
		}
		this._marginBottom = value;
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._marginBottom;
	}
	,__class__: feathers_layout_VerticalLayoutData
	,__properties__: {set_marginBottom:"set_marginBottom",get_marginBottom:"get_marginBottom",set_marginTop:"set_marginTop",get_marginTop:"get_marginTop",set_percentHeight:"set_percentHeight",get_percentHeight:"get_percentHeight",set_percentWidth:"set_percentWidth",get_percentWidth:"get_percentWidth"}
});
var feathers_layout_VerticalListLayout = function() {
	this._widthResetEnabled = true;
	this._contentJustify = false;
	this._verticalAlign = feathers_layout_VerticalAlign.TOP;
	this._minGap = 0.0;
	this._gap = 0.0;
	this._paddingLeft = 0.0;
	this._paddingBottom = 0.0;
	this._paddingRight = 0.0;
	this._paddingTop = 0.0;
	this._requestedMaxRowCount = null;
	this._requestedMinRowCount = null;
	this._requestedRowCount = null;
	this._scrollY = 0.0;
	this._scrollX = 0.0;
	openfl_events_EventDispatcher.call(this);
};
$hxClasses["feathers.layout.VerticalListLayout"] = feathers_layout_VerticalListLayout;
feathers_layout_VerticalListLayout.__name__ = "feathers.layout.VerticalListLayout";
feathers_layout_VerticalListLayout.__interfaces__ = [feathers_layout_IDragDropLayout,feathers_layout_IKeyboardNavigationLayout,feathers_layout_IVirtualLayout];
feathers_layout_VerticalListLayout.__super__ = openfl_events_EventDispatcher;
feathers_layout_VerticalListLayout.prototype = $extend(openfl_events_EventDispatcher.prototype,{
	_scrollX: null
	,get_scrollX: function() {
		return this._scrollX;
	}
	,set_scrollX: function(value) {
		this._scrollX = value;
		return this._scrollX;
	}
	,_scrollY: null
	,get_scrollY: function() {
		return this._scrollY;
	}
	,set_scrollY: function(value) {
		this._scrollY = value;
		return this._scrollY;
	}
	,_virtualCache: null
	,get_virtualCache: function() {
		return this._virtualCache;
	}
	,set_virtualCache: function(value) {
		this._virtualCache = value;
		return this._virtualCache;
	}
	,get_elasticTop: function() {
		return true;
	}
	,get_elasticRight: function() {
		return false;
	}
	,get_elasticBottom: function() {
		return true;
	}
	,get_elasticLeft: function() {
		return false;
	}
	,_requestedRowCount: null
	,get_requestedRowCount: function() {
		return this._requestedRowCount;
	}
	,set_requestedRowCount: function(value) {
		if(this._requestedRowCount == value) {
			return this._requestedRowCount;
		}
		this._requestedRowCount = value;
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._requestedRowCount;
	}
	,_requestedMinRowCount: null
	,get_requestedMinRowCount: function() {
		return this._requestedMinRowCount;
	}
	,set_requestedMinRowCount: function(value) {
		if(this._requestedMinRowCount == value) {
			return this._requestedMinRowCount;
		}
		this._requestedMinRowCount = value;
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._requestedMinRowCount;
	}
	,_requestedMaxRowCount: null
	,get_requestedMaxRowCount: function() {
		return this._requestedMaxRowCount;
	}
	,set_requestedMaxRowCount: function(value) {
		if(this._requestedMaxRowCount == value) {
			return this._requestedMaxRowCount;
		}
		this._requestedMaxRowCount = value;
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._requestedMaxRowCount;
	}
	,_paddingTop: null
	,get_paddingTop: function() {
		return this._paddingTop;
	}
	,set_paddingTop: function(value) {
		if(this._paddingTop == value) {
			return this._paddingTop;
		}
		this._paddingTop = value;
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._paddingTop;
	}
	,_paddingRight: null
	,get_paddingRight: function() {
		return this._paddingRight;
	}
	,set_paddingRight: function(value) {
		if(this._paddingRight == value) {
			return this._paddingRight;
		}
		this._paddingRight = value;
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._paddingRight;
	}
	,_paddingBottom: null
	,get_paddingBottom: function() {
		return this._paddingBottom;
	}
	,set_paddingBottom: function(value) {
		if(this._paddingBottom == value) {
			return this._paddingBottom;
		}
		this._paddingBottom = value;
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._paddingBottom;
	}
	,_paddingLeft: null
	,get_paddingLeft: function() {
		return this._paddingLeft;
	}
	,set_paddingLeft: function(value) {
		if(this._paddingLeft == value) {
			return this._paddingLeft;
		}
		this._paddingLeft = value;
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._paddingLeft;
	}
	,_gap: null
	,get_gap: function() {
		return this._gap;
	}
	,set_gap: function(value) {
		if(this._gap == value) {
			return this._gap;
		}
		this._gap = value;
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._gap;
	}
	,_minGap: null
	,get_minGap: function() {
		return this._minGap;
	}
	,set_minGap: function(value) {
		if(this._minGap == value) {
			return this._minGap;
		}
		this._minGap = value;
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._minGap;
	}
	,_verticalAlign: null
	,get_verticalAlign: function() {
		return this._verticalAlign;
	}
	,set_verticalAlign: function(value) {
		if(this._verticalAlign == value) {
			return this._verticalAlign;
		}
		this._verticalAlign = value;
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._verticalAlign;
	}
	,_contentJustify: null
	,get_contentJustify: function() {
		return this._contentJustify;
	}
	,set_contentJustify: function(value) {
		if(this._contentJustify == value) {
			return this._contentJustify;
		}
		this._contentJustify = value;
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._contentJustify;
	}
	,_widthResetEnabled: null
	,get_widthResetEnabled: function() {
		return this._widthResetEnabled;
	}
	,set_widthResetEnabled: function(value) {
		if(this._widthResetEnabled == value) {
			return this._widthResetEnabled;
		}
		this._widthResetEnabled = value;
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._widthResetEnabled;
	}
	,setPadding: function(value) {
		this.set_paddingTop(value);
		this.set_paddingRight(value);
		this.set_paddingBottom(value);
		this.set_paddingLeft(value);
	}
	,layout: function(items,measurements,result) {
		var adjustedGap = this._gap;
		var hasFlexGap = this._gap == 1.0 / 0.0;
		if(hasFlexGap) {
			adjustedGap = this._minGap;
		}
		var maxItemWidth = this.calculateMaxItemWidth(items,measurements);
		var viewPortWidth = this.calculateViewPortWidth(maxItemWidth,measurements);
		var minItemWidth = viewPortWidth - this._paddingLeft - this._paddingRight;
		var itemWidth = maxItemWidth;
		if(!this._contentJustify || itemWidth < minItemWidth) {
			itemWidth = minItemWidth;
		}
		var virtualRowHeight = this.calculateVirtualRowHeight(items,itemWidth);
		var positionY = this._paddingTop;
		var _g = 0;
		var _g1 = items.length;
		while(_g < _g1) {
			var i = _g++;
			var item = items[i];
			if(item == null) {
				var itemHeight = virtualRowHeight;
				if(this._virtualCache != null) {
					var value = this._virtualCache[i];
					var cacheItem = ((value) instanceof feathers_layout__$VerticalListLayout_VirtualCacheItem) ? value : null;
					if(cacheItem != null && cacheItem.itemHeight != null) {
						itemHeight = cacheItem.itemHeight;
					}
				}
				positionY += itemHeight + adjustedGap;
				continue;
			}
			if(js_Boot.__implements(item,feathers_layout_ILayoutObject)) {
				if(!item.get_includeInLayout()) {
					continue;
				}
			}
			item.set_x(this._paddingLeft);
			item.set_y(positionY);
			item.set_width(itemWidth);
			if(js_Boot.__implements(item,feathers_core_IValidating)) {
				item.validateNow();
			}
			var itemHeight1 = item.get_height();
			if(this._virtualCache != null) {
				var value1 = this._virtualCache[i];
				var cacheItem1 = ((value1) instanceof feathers_layout__$VerticalListLayout_VirtualCacheItem) ? value1 : null;
				if(cacheItem1 != null && (cacheItem1.itemHeight == null || cacheItem1.itemHeight != itemHeight1)) {
					var cachedHeight = cacheItem1.itemHeight;
					cacheItem1.itemHeight = itemHeight1;
					if(cachedHeight == null && positionY < this.get_scrollY()) {
						var offsetY = itemHeight1 - virtualRowHeight;
						feathers_events_ScrollEvent.dispatch(this,"scroll",false,false,0.0,offsetY);
					}
					if(cachedHeight != null || itemHeight1 != virtualRowHeight) {
						feathers_events_FeathersEvent.dispatch(this,"change");
					}
				}
			}
			positionY += itemHeight1 + adjustedGap;
		}
		if(items.length > 0) {
			positionY -= adjustedGap;
		}
		var viewPortHeight = positionY += this._paddingBottom;
		if(measurements.height != null) {
			viewPortHeight = measurements.height;
		} else {
			if(this._requestedRowCount != null) {
				viewPortHeight = this._paddingTop + this._paddingBottom + (this._requestedRowCount * (virtualRowHeight + adjustedGap) - adjustedGap);
			} else if(this._requestedMinRowCount != null && items.length < this._requestedMinRowCount) {
				viewPortHeight = this._paddingTop + this._paddingBottom + (this._requestedMinRowCount * (virtualRowHeight + adjustedGap) - adjustedGap);
			} else if(this._requestedMaxRowCount != null && items.length > this._requestedMaxRowCount) {
				viewPortHeight = this._paddingTop + this._paddingBottom + (this._requestedMaxRowCount * (virtualRowHeight + adjustedGap) - adjustedGap);
			}
			if(measurements.minHeight != null && viewPortHeight < measurements.minHeight) {
				viewPortHeight = measurements.minHeight;
			} else if(measurements.maxHeight != null && viewPortHeight > measurements.maxHeight) {
				viewPortHeight = measurements.maxHeight;
			}
		}
		var contentHeight = positionY - this._paddingTop - this._paddingBottom;
		var alignOffset = 0.0;
		var gapOffset = 0.0;
		var maxAlignmentHeight = viewPortHeight - this._paddingTop - this._paddingBottom;
		var adjustedGap1 = this._gap;
		var hasFlexGap = this._gap == 1.0 / 0.0;
		if(hasFlexGap) {
			adjustedGap1 = this._minGap;
			if(items.length > 1 && maxAlignmentHeight > contentHeight) {
				adjustedGap1 += (maxAlignmentHeight - contentHeight) / (items.length - 1);
			}
			gapOffset = adjustedGap1 - this._minGap;
		} else {
			switch(this._verticalAlign._hx_index) {
			case 0:
				alignOffset = 0.0;
				break;
			case 1:
				alignOffset = (maxAlignmentHeight - contentHeight) / 2.0;
				break;
			case 2:
				alignOffset = maxAlignmentHeight - contentHeight;
				break;
			default:
				throw new openfl_errors_ArgumentError("Unknown vertical align: " + Std.string(this._verticalAlign));
			}
			if(alignOffset < 0.0) {
				alignOffset = 0.0;
			}
		}
		if(!(alignOffset == 0.0 && gapOffset == 0.0)) {
			var totalOffset = alignOffset;
			var _g = 0;
			while(_g < items.length) {
				var item = items[_g];
				++_g;
				var layoutObject = null;
				if(js_Boot.__implements(item,feathers_layout_ILayoutObject)) {
					layoutObject = item;
					if(!layoutObject.get_includeInLayout()) {
						continue;
					}
				}
				if(item != null) {
					item.set_y(Math.max(this._paddingTop,item.get_y() + totalOffset));
				}
				totalOffset += gapOffset;
			}
		}
		if(result == null) {
			result = new feathers_layout_LayoutBoundsResult();
		}
		result.contentX = 0.0;
		result.contentY = 0.0;
		result.contentWidth = itemWidth + this._paddingLeft + this._paddingRight;
		result.contentHeight = positionY;
		if(this._requestedMinRowCount != null) {
			result.contentMinHeight = this._paddingTop + this._paddingBottom + (this._requestedMinRowCount * (virtualRowHeight + adjustedGap) - adjustedGap);
		}
		result.viewPortWidth = viewPortWidth;
		result.viewPortHeight = viewPortHeight;
		return result;
	}
	,calculateMaxItemWidth: function(items,measurements) {
		var maxItemWidth = 0.0;
		var _g = 0;
		var _g1 = items.length;
		while(_g < _g1) {
			var i = _g++;
			var item = items[i];
			if(this._virtualCache != null && this._virtualCache.length > i) {
				var value = this._virtualCache[i];
				var cacheItem = ((value) instanceof feathers_layout__$VerticalListLayout_VirtualCacheItem) ? value : null;
				if(cacheItem != null) {
					var itemWidth = cacheItem.itemWidth;
					if(maxItemWidth < itemWidth) {
						maxItemWidth = itemWidth;
					}
					continue;
				}
			}
			if(item == null) {
				continue;
			}
			if(js_Boot.__implements(item,feathers_layout_ILayoutObject)) {
				if(!item.get_includeInLayout()) {
					continue;
				}
			}
			if(this._widthResetEnabled && measurements.width == null && js_Boot.__implements(item,feathers_core_IMeasureObject)) {
				item.resetWidth();
			}
			if(js_Boot.__implements(item,feathers_core_IValidating)) {
				item.validateNow();
			}
			var itemWidth1 = item.get_width();
			if(maxItemWidth < itemWidth1) {
				maxItemWidth = itemWidth1;
			}
			if(this._virtualCache != null) {
				var value1 = this._virtualCache[i];
				var cacheItem1 = ((value1) instanceof feathers_layout__$VerticalListLayout_VirtualCacheItem) ? value1 : null;
				if(cacheItem1 == null) {
					if(js_Boot.__implements(item,feathers_core_IValidating)) {
						item.validateNow();
					}
					cacheItem1 = new feathers_layout__$VerticalListLayout_VirtualCacheItem(itemWidth1,null);
					this._virtualCache[i] = cacheItem1;
				}
			}
		}
		if(measurements.maxWidth != null) {
			var maxJustifyWidth = measurements.maxWidth - this._paddingLeft - this._paddingRight;
			if(maxItemWidth > maxJustifyWidth) {
				maxItemWidth = maxJustifyWidth;
			}
		}
		return maxItemWidth;
	}
	,calculateViewPortWidth: function(maxItemWidth,measurements) {
		if(measurements.width != null) {
			return measurements.width;
		}
		return maxItemWidth + this._paddingLeft + this._paddingRight;
	}
	,calculateVirtualRowHeight: function(items,itemWidth) {
		var _g = 0;
		var _g1 = items.length;
		while(_g < _g1) {
			var i = _g++;
			var item = items[i];
			if(item == null) {
				if(this._virtualCache == null || this._virtualCache.length <= i) {
					continue;
				}
				var value = this._virtualCache[i];
				var cacheItem = ((value) instanceof feathers_layout__$VerticalListLayout_VirtualCacheItem) ? value : null;
				if(cacheItem == null || cacheItem.itemHeight == null) {
					continue;
				}
				return cacheItem.itemHeight;
			}
			if(js_Boot.__implements(item,feathers_layout_ILayoutObject)) {
				if(!item.get_includeInLayout()) {
					continue;
				}
			}
			item.set_width(itemWidth);
			if(js_Boot.__implements(item,feathers_core_IValidating)) {
				item.validateNow();
			}
			var itemHeight = item.get_height();
			if(this._virtualCache != null) {
				var value1 = this._virtualCache[i];
				var cacheItem1 = ((value1) instanceof feathers_layout__$VerticalListLayout_VirtualCacheItem) ? value1 : null;
				if(cacheItem1 != null && (cacheItem1.itemHeight == null || cacheItem1.itemHeight != itemHeight)) {
					cacheItem1.itemHeight = itemHeight;
					feathers_events_FeathersEvent.dispatch(this,"change");
				}
			}
			return itemHeight;
		}
		return 0.0;
	}
	,getVisibleIndices: function(itemCount,width,height,result) {
		var adjustedGap = this._gap;
		var hasFlexGap = this._gap == 1.0 / 0.0;
		if(hasFlexGap) {
			adjustedGap = this._minGap;
		}
		var startIndex = -1;
		var endIndex = -1;
		var estimatedItemHeight = null;
		var positionY = this._paddingTop;
		var scrollY = this._scrollY;
		if(scrollY < 0.0) {
			scrollY = 0.0;
		}
		var minItems = 0;
		var maxY = scrollY + height;
		var skippedMissingItems = 0;
		var _g = 0;
		var _g1 = itemCount;
		while(_g < _g1) {
			var i = _g++;
			var itemHeight = 0.0;
			if(this._virtualCache != null) {
				var value = this._virtualCache[i];
				var cacheItem = ((value) instanceof feathers_layout__$VerticalListLayout_VirtualCacheItem) ? value : null;
				if(cacheItem != null && cacheItem.itemHeight != null) {
					itemHeight = cacheItem.itemHeight;
					if(estimatedItemHeight == null) {
						estimatedItemHeight = itemHeight;
						minItems = Math.ceil(height / (estimatedItemHeight + adjustedGap)) + 1;
						if(skippedMissingItems > 0) {
							var _g2 = 0;
							var _g3 = skippedMissingItems;
							while(_g2 < _g3) {
								var j = _g2++;
								positionY += estimatedItemHeight + adjustedGap;
								if(startIndex == -1 && positionY >= scrollY) {
									startIndex = j;
								}
								if(startIndex != -1) {
									endIndex = j;
									if(positionY >= maxY && endIndex - startIndex + 1 >= minItems) {
										break;
									}
								}
							}
							skippedMissingItems = 0;
						}
					}
				} else if(estimatedItemHeight != null) {
					itemHeight = estimatedItemHeight;
				} else {
					if(skippedMissingItems < 5) {
						++skippedMissingItems;
						continue;
					}
					startIndex = 0;
					endIndex = 0;
					break;
				}
			}
			positionY += itemHeight + adjustedGap;
			if(startIndex == -1 && positionY >= scrollY) {
				startIndex = i;
			}
			if(startIndex != -1) {
				endIndex = i;
				if(positionY >= maxY && endIndex - startIndex + 1 >= minItems) {
					break;
				}
			}
		}
		if(startIndex == -1 && this._verticalAlign != feathers_layout_VerticalAlign.TOP) {
			startIndex = itemCount - 1;
			endIndex = startIndex;
		}
		if((positionY < maxY || endIndex - startIndex + 1 < minItems) && startIndex > 0) {
			do {
				--startIndex;
				var itemHeight = 0.0;
				if(this._virtualCache != null) {
					var value = this._virtualCache[startIndex];
					var cacheItem = ((value) instanceof feathers_layout__$VerticalListLayout_VirtualCacheItem) ? value : null;
					if(cacheItem != null && cacheItem.itemHeight != null) {
						itemHeight = cacheItem.itemHeight;
						if(estimatedItemHeight == null) {
							estimatedItemHeight = itemHeight;
							minItems = Math.ceil(height / (estimatedItemHeight + adjustedGap)) + 1;
						}
					} else if(estimatedItemHeight != null) {
						itemHeight = estimatedItemHeight;
					}
				}
				positionY += itemHeight + adjustedGap;
				if(positionY >= maxY && endIndex - startIndex + 1 >= minItems) {
					break;
				}
			} while(startIndex > 0);
		}
		if(startIndex < 0) {
			startIndex = 0;
		}
		if(estimatedItemHeight == null) {
			endIndex = startIndex;
		} else if(endIndex < 0) {
			endIndex = startIndex;
		}
		if(result == null) {
			return new feathers_layout_VirtualLayoutRange(startIndex,endIndex);
		}
		result.start = startIndex;
		result.end = endIndex;
		return result;
	}
	,getNearestScrollPositionForIndex: function(index,itemCount,width,height,result) {
		var adjustedGap = this._gap;
		var hasFlexGap = this._gap == 1.0 / 0.0;
		if(hasFlexGap) {
			adjustedGap = this._minGap;
		}
		var estimatedItemHeight = null;
		var minY = 0.0;
		var maxY = 0.0;
		var positionY = this._paddingTop;
		var _g = 0;
		var _g1 = itemCount;
		while(_g < _g1) {
			var i = _g++;
			var itemHeight = 0.0;
			if(this._virtualCache != null) {
				var value = this._virtualCache[i];
				var cacheItem = ((value) instanceof feathers_layout__$VerticalListLayout_VirtualCacheItem) ? value : null;
				if(cacheItem != null && cacheItem.itemHeight != null) {
					itemHeight = cacheItem.itemHeight;
					if(estimatedItemHeight == null) {
						estimatedItemHeight = itemHeight;
					}
				} else if(estimatedItemHeight != null) {
					itemHeight = estimatedItemHeight;
				}
			}
			if(i == index) {
				maxY = positionY;
				minY = maxY + itemHeight - height;
				break;
			}
			positionY += itemHeight + adjustedGap;
		}
		var targetY = this._scrollY;
		if(targetY < minY) {
			targetY = minY;
		} else if(targetY > maxY) {
			targetY = maxY;
		}
		if(result == null) {
			result = new openfl_geom_Point();
		}
		result.x = this._scrollX;
		result.y = targetY;
		return result;
	}
	,getDragDropIndex: function(items,x,y,width,height) {
		var adjustedGap = this._gap;
		var hasFlexGap = this._gap == 1.0 / 0.0;
		if(hasFlexGap) {
			adjustedGap = this._minGap;
		}
		var estimatedItemHeight = null;
		var positionY = this._paddingTop;
		var _g = 0;
		var _g1 = items.length;
		while(_g < _g1) {
			var i = _g++;
			var item = items[i];
			var itemHeight = estimatedItemHeight;
			if(item == null) {
				if(this._virtualCache != null) {
					var value = this._virtualCache[i];
					var cacheItem = ((value) instanceof feathers_layout__$VerticalListLayout_VirtualCacheItem) ? value : null;
					if(cacheItem != null && cacheItem.itemHeight != null) {
						itemHeight = cacheItem.itemHeight;
						if(estimatedItemHeight == null) {
							estimatedItemHeight = itemHeight;
						}
					} else if(estimatedItemHeight != null) {
						itemHeight = estimatedItemHeight;
					}
				}
			} else {
				itemHeight = item.get_height();
			}
			if(y < positionY + itemHeight / 2.0) {
				return i;
			}
			positionY += itemHeight + adjustedGap;
		}
		return items.length;
	}
	,getDragDropRegion: function(items,dropIndex,x,y,width,height,result) {
		var adjustedGap = this._gap;
		var hasFlexGap = this._gap == 1.0 / 0.0;
		if(hasFlexGap) {
			adjustedGap = this._minGap;
		}
		var maxIndex = dropIndex;
		if(maxIndex < 0) {
			maxIndex = 0;
		} else if(maxIndex > items.length) {
			maxIndex = items.length;
		}
		var estimatedItemHeight = null;
		var positionY = this._paddingTop;
		var _g = 0;
		var _g1 = maxIndex;
		while(_g < _g1) {
			var i = _g++;
			var item = items[i];
			var itemHeight = 0.0;
			if(item == null) {
				if(this._virtualCache != null) {
					var value = this._virtualCache[i];
					var cacheItem = ((value) instanceof feathers_layout__$VerticalListLayout_VirtualCacheItem) ? value : null;
					if(cacheItem != null && cacheItem.itemHeight != null) {
						itemHeight = cacheItem.itemHeight;
						if(estimatedItemHeight == null) {
							estimatedItemHeight = itemHeight;
						}
					} else if(estimatedItemHeight != null) {
						itemHeight = estimatedItemHeight;
					}
				}
			} else {
				itemHeight = item.get_height();
			}
			positionY += itemHeight + adjustedGap;
		}
		if(result == null) {
			result = new openfl_geom_Rectangle(0.0,positionY,width,0.0);
		} else {
			result.setTo(0.0,positionY,width,0.0);
		}
		return result;
	}
	,findNextKeyboardIndex: function(startIndex,event,wrapArrowKeys,items,indicesToSkip,viewPortWidth,viewPortHeight) {
		if(items.length == 0) {
			return -1;
		}
		var adjustedGap = this._gap;
		var hasFlexGap = this._gap == 1.0 / 0.0;
		if(hasFlexGap) {
			adjustedGap = this._minGap;
		}
		var estimatedItemHeight = null;
		var _g = 0;
		var _g1 = items.length;
		while(_g < _g1) {
			var i = _g++;
			var itemHeight = 0.0;
			if(this._virtualCache != null) {
				var value = this._virtualCache[i];
				var cacheItem = ((value) instanceof feathers_layout__$VerticalListLayout_VirtualCacheItem) ? value : null;
				if(cacheItem != null && cacheItem.itemHeight != null) {
					itemHeight = cacheItem.itemHeight;
					if(estimatedItemHeight == null) {
						estimatedItemHeight = itemHeight;
						break;
					}
				}
			}
		}
		var maxIndex = items.length - 1;
		var result = startIndex;
		if(result == -1) {
			switch(event.keyCode) {
			case 38:
				result = wrapArrowKeys ? maxIndex : -1;
				break;
			case 40:
				result = 0;
				break;
			default:
				result = -1;
			}
			if(result == -1) {
				return result;
			}
			if(indicesToSkip == null || indicesToSkip.indexOf(result) == -1) {
				return result;
			}
		}
		var needsAnotherPass = true;
		var nextKeyCode = event.keyCode;
		var lastResult = result;
		while(needsAnotherPass) {
			needsAnotherPass = false;
			switch(nextKeyCode) {
			case 33:
				var yPosition = 0.0;
				var i = startIndex;
				while(i >= 0) {
					var item = items[i];
					var itemHeight = estimatedItemHeight;
					if(item == null) {
						if(this._virtualCache != null) {
							var value = this._virtualCache[i];
							var cacheItem = ((value) instanceof feathers_layout__$VerticalListLayout_VirtualCacheItem) ? value : null;
							if(cacheItem != null && cacheItem.itemHeight != null) {
								itemHeight = cacheItem.itemHeight;
							}
						}
					} else {
						itemHeight = item.get_height();
					}
					yPosition += itemHeight;
					if(indicesToSkip != null && indicesToSkip.indexOf(i) != -1) {
						yPosition += adjustedGap;
						--i;
						continue;
					}
					if(yPosition > viewPortHeight) {
						break;
					}
					yPosition += adjustedGap;
					result = i;
					--i;
				}
				nextKeyCode = 38;
				break;
			case 34:
				var yPosition1 = 0.0;
				var _g = startIndex;
				var _g1 = items.length;
				while(_g < _g1) {
					var i1 = _g++;
					var item1 = items[i1];
					var itemHeight1 = estimatedItemHeight;
					if(item1 == null) {
						if(this._virtualCache != null) {
							var value1 = this._virtualCache[i1];
							var cacheItem1 = ((value1) instanceof feathers_layout__$VerticalListLayout_VirtualCacheItem) ? value1 : null;
							if(cacheItem1 != null && cacheItem1.itemHeight != null) {
								itemHeight1 = cacheItem1.itemHeight;
							}
						}
					} else {
						itemHeight1 = item1.get_height();
					}
					yPosition1 += itemHeight1;
					if(indicesToSkip != null && indicesToSkip.indexOf(i1) != -1) {
						yPosition1 += adjustedGap;
						continue;
					}
					if(yPosition1 > viewPortHeight) {
						break;
					}
					yPosition1 += adjustedGap;
					result = i1;
				}
				nextKeyCode = 40;
				break;
			case 35:
				var i2 = maxIndex;
				while(i2 > startIndex) {
					if(indicesToSkip == null || indicesToSkip.indexOf(i2) == -1) {
						result = i2;
						break;
					}
					--i2;
				}
				break;
			case 36:
				var _g2 = 0;
				var _g3 = startIndex;
				while(_g2 < _g3) {
					var i3 = _g2++;
					if(indicesToSkip == null || indicesToSkip.indexOf(i3) == -1) {
						result = i3;
						break;
					}
				}
				break;
			case 38:
				--result;
				break;
			case 40:
				++result;
				break;
			default:
				return startIndex;
			}
			if(result < 0) {
				if(wrapArrowKeys) {
					result = maxIndex;
				} else {
					result = 0;
				}
			} else if(result > maxIndex) {
				if(wrapArrowKeys) {
					result = 0;
				} else {
					result = maxIndex;
				}
			}
			if(indicesToSkip != null && indicesToSkip.indexOf(result) != -1) {
				if(result == lastResult) {
					return startIndex;
				}
				needsAnotherPass = true;
			}
			lastResult = result;
		}
		return result;
	}
	,applyVerticalAlign: function(items,contentHeight,viewPortHeight) {
		var alignOffset = 0.0;
		var gapOffset = 0.0;
		var maxAlignmentHeight = viewPortHeight - this._paddingTop - this._paddingBottom;
		var adjustedGap = this._gap;
		var hasFlexGap = this._gap == 1.0 / 0.0;
		if(hasFlexGap) {
			adjustedGap = this._minGap;
			if(items.length > 1 && maxAlignmentHeight > contentHeight) {
				adjustedGap += (maxAlignmentHeight - contentHeight) / (items.length - 1);
			}
			gapOffset = adjustedGap - this._minGap;
		} else {
			switch(this._verticalAlign._hx_index) {
			case 0:
				alignOffset = 0.0;
				break;
			case 1:
				alignOffset = (maxAlignmentHeight - contentHeight) / 2.0;
				break;
			case 2:
				alignOffset = maxAlignmentHeight - contentHeight;
				break;
			default:
				throw new openfl_errors_ArgumentError("Unknown vertical align: " + Std.string(this._verticalAlign));
			}
			if(alignOffset < 0.0) {
				alignOffset = 0.0;
			}
		}
		if(alignOffset == 0.0 && gapOffset == 0.0) {
			return;
		}
		var totalOffset = alignOffset;
		var _g = 0;
		while(_g < items.length) {
			var item = items[_g];
			++_g;
			var layoutObject = null;
			if(js_Boot.__implements(item,feathers_layout_ILayoutObject)) {
				layoutObject = item;
				if(!layoutObject.get_includeInLayout()) {
					continue;
				}
			}
			if(item != null) {
				item.set_y(Math.max(this._paddingTop,item.get_y() + totalOffset));
			}
			totalOffset += gapOffset;
		}
	}
	,__class__: feathers_layout_VerticalListLayout
	,__properties__: {set_widthResetEnabled:"set_widthResetEnabled",get_widthResetEnabled:"get_widthResetEnabled",set_contentJustify:"set_contentJustify",get_contentJustify:"get_contentJustify",set_verticalAlign:"set_verticalAlign",get_verticalAlign:"get_verticalAlign",set_minGap:"set_minGap",get_minGap:"get_minGap",set_gap:"set_gap",get_gap:"get_gap",set_paddingLeft:"set_paddingLeft",get_paddingLeft:"get_paddingLeft",set_paddingBottom:"set_paddingBottom",get_paddingBottom:"get_paddingBottom",set_paddingRight:"set_paddingRight",get_paddingRight:"get_paddingRight",set_paddingTop:"set_paddingTop",get_paddingTop:"get_paddingTop",set_requestedMaxRowCount:"set_requestedMaxRowCount",get_requestedMaxRowCount:"get_requestedMaxRowCount",set_requestedMinRowCount:"set_requestedMinRowCount",get_requestedMinRowCount:"get_requestedMinRowCount",set_requestedRowCount:"set_requestedRowCount",get_requestedRowCount:"get_requestedRowCount",get_elasticLeft:"get_elasticLeft",get_elasticBottom:"get_elasticBottom",get_elasticRight:"get_elasticRight",get_elasticTop:"get_elasticTop",set_virtualCache:"set_virtualCache",get_virtualCache:"get_virtualCache",set_scrollY:"set_scrollY",get_scrollY:"get_scrollY",set_scrollX:"set_scrollX",get_scrollX:"get_scrollX"}
});
var feathers_layout__$VerticalListLayout_VirtualCacheItem = function(itemWidth,itemHeight) {
	this.itemWidth = itemWidth;
	this.itemHeight = itemHeight;
};
$hxClasses["feathers.layout._VerticalListLayout.VirtualCacheItem"] = feathers_layout__$VerticalListLayout_VirtualCacheItem;
feathers_layout__$VerticalListLayout_VirtualCacheItem.__name__ = "feathers.layout._VerticalListLayout.VirtualCacheItem";
feathers_layout__$VerticalListLayout_VirtualCacheItem.prototype = {
	itemWidth: null
	,itemHeight: null
	,__class__: feathers_layout__$VerticalListLayout_VirtualCacheItem
};
var feathers_motion_effects_IEffectContext = function() { };
$hxClasses["feathers.motion.effects.IEffectContext"] = feathers_motion_effects_IEffectContext;
feathers_motion_effects_IEffectContext.__name__ = "feathers.motion.effects.IEffectContext";
feathers_motion_effects_IEffectContext.__isInterface__ = true;
feathers_motion_effects_IEffectContext.__interfaces__ = [openfl_events_IEventDispatcher];
feathers_motion_effects_IEffectContext.prototype = {
	get_target: null
	,get_duration: null
	,get_position: null
	,set_position: null
	,play: null
	,playReverse: null
	,pause: null
	,stop: null
	,toEnd: null
	,interrupt: null
	,__class__: feathers_motion_effects_IEffectContext
	,__properties__: {set_position:"set_position",get_position:"get_position",get_duration:"get_duration",get_target:"get_target"}
};
var feathers_motion_effects_BaseDelegateEffectContext = function(context) {
	openfl_events_EventDispatcher.call(this);
	this._context = context;
	this._context.addEventListener("change",$bind(this,this.baseDelegateEffectContext_context_changeHandler));
	this._context.addEventListener("complete",$bind(this,this.baseDelegateEffectContext_context_completeHandler));
};
$hxClasses["feathers.motion.effects.BaseDelegateEffectContext"] = feathers_motion_effects_BaseDelegateEffectContext;
feathers_motion_effects_BaseDelegateEffectContext.__name__ = "feathers.motion.effects.BaseDelegateEffectContext";
feathers_motion_effects_BaseDelegateEffectContext.__interfaces__ = [feathers_motion_effects_IEffectContext];
feathers_motion_effects_BaseDelegateEffectContext.__super__ = openfl_events_EventDispatcher;
feathers_motion_effects_BaseDelegateEffectContext.prototype = $extend(openfl_events_EventDispatcher.prototype,{
	_context: null
	,get_context: function() {
		return this._context;
	}
	,get_target: function() {
		return this.get_context().get_target();
	}
	,get_duration: function() {
		return this.get_context().get_duration();
	}
	,get_position: function() {
		return this.get_context().get_position();
	}
	,set_position: function(value) {
		this.get_context().set_position(value);
		return this.get_context().get_position();
	}
	,play: function() {
		this._context.play();
	}
	,playReverse: function() {
		this._context.playReverse();
	}
	,pause: function() {
		this._context.pause();
	}
	,stop: function() {
		this._context.stop();
	}
	,toEnd: function() {
		this._context.toEnd();
	}
	,interrupt: function() {
		this._context.interrupt();
	}
	,baseDelegateEffectContext_context_changeHandler: function(event) {
		feathers_events_FeathersEvent.dispatch(this,"change");
	}
	,baseDelegateEffectContext_context_completeHandler: function(event) {
		feathers_events_FeathersEvent.dispatch(this,"complete");
	}
	,__class__: feathers_motion_effects_BaseDelegateEffectContext
	,__properties__: {set_position:"set_position",get_position:"get_position",get_duration:"get_duration",get_target:"get_target",get_context:"get_context"}
});
var feathers_motion_effects_BaseEffectContext = function(target,duration,ease) {
	this._reversed = false;
	this._playing = false;
	this._position = 0.0;
	this._duration = 0.0;
	openfl_events_EventDispatcher.call(this);
	this._target = target;
	this._duration = duration;
	this._ease = ease;
};
$hxClasses["feathers.motion.effects.BaseEffectContext"] = feathers_motion_effects_BaseEffectContext;
feathers_motion_effects_BaseEffectContext.__name__ = "feathers.motion.effects.BaseEffectContext";
feathers_motion_effects_BaseEffectContext.__interfaces__ = [feathers_motion_effects_IEffectContext];
feathers_motion_effects_BaseEffectContext.__super__ = openfl_events_EventDispatcher;
feathers_motion_effects_BaseEffectContext.prototype = $extend(openfl_events_EventDispatcher.prototype,{
	_target: null
	,get_target: function() {
		return this._target;
	}
	,_duration: null
	,get_duration: function() {
		return this._duration;
	}
	,_position: null
	,get_position: function() {
		return this._position;
	}
	,set_position: function(value) {
		if(this._position == value) {
			return this._position;
		}
		this._position = value;
		this.updateEffect();
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._position;
	}
	,_ease: null
	,get_ease: function() {
		return this._ease;
	}
	,_playing: null
	,_reversed: null
	,_animatePlayback: null
	,play: function() {
		var _gthis = this;
		if(this._playing && !this._reversed) {
			return;
		}
		if(this._animatePlayback != null) {
			motion_Actuate.stop(this._animatePlayback,null,false,false);
			this._animatePlayback = null;
		}
		this._playing = true;
		this._reversed = false;
		var duration = this._duration * (1.0 - this._position);
		this._animatePlayback = motion_Actuate.update(function(value) {
			_gthis.set_position(value);
		},duration,[this._position],[1.0]);
		this._animatePlayback.ease(this._ease);
		this._animatePlayback.onComplete($bind(this,this.animatePlayback_onComplete));
	}
	,playReverse: function() {
		var _gthis = this;
		if(this._playing && this._reversed) {
			return;
		}
		if(this._animatePlayback != null) {
			motion_Actuate.stop(this._animatePlayback,null,false,false);
			this._animatePlayback = null;
		}
		this._playing = true;
		this._reversed = true;
		var duration = this._duration * this._position;
		this._animatePlayback = motion_Actuate.update(function(value) {
			_gthis.set_position(value);
		},duration,[this._position],[0.0]);
		this._animatePlayback.ease(this._ease);
		this._animatePlayback.onComplete($bind(this,this.animatePlayback_onComplete));
	}
	,pause: function() {
		if(!this._playing) {
			return;
		}
		if(this._animatePlayback != null) {
			motion_Actuate.stop(this._animatePlayback,null,false,false);
			this._animatePlayback = null;
		}
		this._playing = false;
	}
	,stop: function() {
		this.pause();
		this.cleanupEffect();
		feathers_events_FeathersEvent.dispatch(this,"complete");
	}
	,toEnd: function() {
		this.pause();
		this._position = 1.0;
		this.cleanupEffect();
		feathers_events_FeathersEvent.dispatch(this,"complete");
	}
	,interrupt: function() {
		this.toEnd();
	}
	,prepareEffect: function() {
	}
	,updateEffect: function() {
	}
	,cleanupEffect: function() {
	}
	,animatePlayback_onComplete: function() {
		this._animatePlayback = null;
		this.cleanupEffect();
		feathers_events_FeathersEvent.dispatch(this,"complete");
	}
	,__class__: feathers_motion_effects_BaseEffectContext
	,__properties__: {get_ease:"get_ease",set_position:"set_position",get_position:"get_position",get_duration:"get_duration",get_target:"get_target"}
});
var feathers_motion_effects_EffectInterruptBehavior = $hxEnums["feathers.motion.effects.EffectInterruptBehavior"] = { __ename__:"feathers.motion.effects.EffectInterruptBehavior",__constructs__:null
	,END: {_hx_name:"END",_hx_index:0,__enum__:"feathers.motion.effects.EffectInterruptBehavior",toString:$estr}
	,STOP: {_hx_name:"STOP",_hx_index:1,__enum__:"feathers.motion.effects.EffectInterruptBehavior",toString:$estr}
};
feathers_motion_effects_EffectInterruptBehavior.__constructs__ = [feathers_motion_effects_EffectInterruptBehavior.END,feathers_motion_effects_EffectInterruptBehavior.STOP];
var feathers_motion_effects_EventToPositionEffectContext = function(context,dispatcher,eventType,callback) {
	this._paused = true;
	feathers_motion_effects_BaseDelegateEffectContext.call(this,context);
	this.set_callback(callback);
	this.set_eventType(eventType);
	this.set_dispatcher(dispatcher);
};
$hxClasses["feathers.motion.effects.EventToPositionEffectContext"] = feathers_motion_effects_EventToPositionEffectContext;
feathers_motion_effects_EventToPositionEffectContext.__name__ = "feathers.motion.effects.EventToPositionEffectContext";
feathers_motion_effects_EventToPositionEffectContext.__super__ = feathers_motion_effects_BaseDelegateEffectContext;
feathers_motion_effects_EventToPositionEffectContext.prototype = $extend(feathers_motion_effects_BaseDelegateEffectContext.prototype,{
	_dispatcher: null
	,get_dispatcher: function() {
		return this._dispatcher;
	}
	,set_dispatcher: function(value) {
		if(this._dispatcher == value) {
			return this._dispatcher;
		}
		this.clearEvent();
		this._dispatcher = value;
		this.updateEvent();
		return this.get_dispatcher();
	}
	,_eventType: null
	,get_eventType: function() {
		return this._eventType;
	}
	,set_eventType: function(value) {
		if(this._eventType == value) {
			return this._eventType;
		}
		this.clearEvent();
		this._eventType = value;
		this.updateEvent();
		return this._eventType;
	}
	,_callback: null
	,get_callback: function() {
		return this._callback;
	}
	,set_callback: function(value) {
		if(this._callback == value) {
			return this._callback;
		}
		this._callback = value;
		return this._callback;
	}
	,_paused: null
	,play: function() {
		this._paused = false;
	}
	,playReverse: function() {
		this._paused = false;
	}
	,pause: function() {
		this._paused = true;
	}
	,clearEvent: function() {
		if(this._dispatcher == null || this._eventType == null) {
			return;
		}
		this._dispatcher.removeEventListener(this._eventType,$bind(this,this.eventToPositionEffectContext_dispatcher_eventHandler));
	}
	,updateEvent: function() {
		if(this._dispatcher == null || this._eventType == null) {
			return;
		}
		this._dispatcher.addEventListener(this._eventType,$bind(this,this.eventToPositionEffectContext_dispatcher_eventHandler),false,0,true);
	}
	,eventToPositionEffectContext_dispatcher_eventHandler: function(event) {
		if(this._paused) {
			return;
		}
		this.set_position(this._callback(event));
	}
	,__class__: feathers_motion_effects_EventToPositionEffectContext
	,__properties__: $extend(feathers_motion_effects_BaseDelegateEffectContext.prototype.__properties__,{set_callback:"set_callback",get_callback:"get_callback",set_eventType:"set_eventType",get_eventType:"get_eventType",set_dispatcher:"set_dispatcher",get_dispatcher:"get_dispatcher"})
});
var feathers_motion_effects_NoOpEffectContext = function(target) {
	this._position = 0.0;
	this._duration = 0.0;
	openfl_events_EventDispatcher.call(this);
	this._target = target;
};
$hxClasses["feathers.motion.effects.NoOpEffectContext"] = feathers_motion_effects_NoOpEffectContext;
feathers_motion_effects_NoOpEffectContext.__name__ = "feathers.motion.effects.NoOpEffectContext";
feathers_motion_effects_NoOpEffectContext.__interfaces__ = [feathers_motion_effects_IEffectContext];
feathers_motion_effects_NoOpEffectContext.__super__ = openfl_events_EventDispatcher;
feathers_motion_effects_NoOpEffectContext.prototype = $extend(openfl_events_EventDispatcher.prototype,{
	_target: null
	,get_target: function() {
		return this._target;
	}
	,_duration: null
	,get_duration: function() {
		return this._duration;
	}
	,_position: null
	,get_position: function() {
		return this._position;
	}
	,set_position: function(value) {
		if(value != 0.0) {
			throw new openfl_errors_RangeError("Position must always be 0.0");
		}
		return this._position;
	}
	,play: function() {
		this.toEnd();
	}
	,pause: function() {
	}
	,playReverse: function() {
		this.toEnd();
	}
	,stop: function() {
		this.toEnd();
	}
	,toEnd: function() {
		feathers_events_FeathersEvent.dispatch(this,"complete");
	}
	,interrupt: function() {
		this.toEnd();
	}
	,__class__: feathers_motion_effects_NoOpEffectContext
	,__properties__: {set_position:"set_position",get_position:"get_position",get_duration:"get_duration",get_target:"get_target"}
});
var feathers_motion_effects_actuate_ActuateEffectContext = function(target,actuator,interruptBehavior) {
	if(interruptBehavior == null) {
		interruptBehavior = feathers_motion_effects_EffectInterruptBehavior.END;
	}
	this._actuator = actuator;
	this.interruptBehavior = interruptBehavior;
	var originalEase = this._actuator.getEase();
	this._actuator.ease(motion_easing_Linear.get_easeNone());
	this._onComplete = this._actuator.getOnComplete();
	this._onCompleteParams = this._actuator.getOnCompleteParams();
	this._actuator.onComplete(null,null);
	if(target == null) {
		target = this._actuator.getTarget();
	}
	feathers_motion_effects_BaseEffectContext.call(this,target,this._actuator.getDuration(),originalEase);
};
$hxClasses["feathers.motion.effects.actuate.ActuateEffectContext"] = feathers_motion_effects_actuate_ActuateEffectContext;
feathers_motion_effects_actuate_ActuateEffectContext.__name__ = "feathers.motion.effects.actuate.ActuateEffectContext";
feathers_motion_effects_actuate_ActuateEffectContext.__super__ = feathers_motion_effects_BaseEffectContext;
feathers_motion_effects_actuate_ActuateEffectContext.prototype = $extend(feathers_motion_effects_BaseEffectContext.prototype,{
	_actuator: null
	,get_actuator: function() {
		return this._actuator;
	}
	,interruptBehavior: null
	,_onComplete: null
	,_onCompleteParams: null
	,interrupt: function() {
		if(this.interruptBehavior == feathers_motion_effects_EffectInterruptBehavior.STOP) {
			this.stop();
			return;
		}
		this.toEnd();
	}
	,updateEffect: function() {
		this._actuator.goto(this.get_position());
	}
	,cleanupEffect: function() {
		if(this._onComplete != null) {
			var params = this._onCompleteParams;
			if(params == null) {
				params = [];
			}
			this._onComplete.apply(this._onComplete,params);
		}
	}
	,__class__: feathers_motion_effects_actuate_ActuateEffectContext
	,__properties__: $extend(feathers_motion_effects_BaseEffectContext.prototype.__properties__,{get_actuator:"get_actuator"})
});
var feathers_motion_effects_actuate_ActuateForEffects = function() { };
$hxClasses["feathers.motion.effects.actuate.ActuateForEffects"] = feathers_motion_effects_actuate_ActuateForEffects;
feathers_motion_effects_actuate_ActuateForEffects.__name__ = "feathers.motion.effects.actuate.ActuateForEffects";
feathers_motion_effects_actuate_ActuateForEffects.tween = function(target,duration,properties,overwrite) {
	if(overwrite == null) {
		overwrite = true;
	}
	var result = motion_Actuate.tween(target,duration,properties,overwrite,feathers_motion_effects_actuate_SimpleEffectActuator);
	return js_Boot.__cast(result , feathers_motion_effects_actuate_IReadableGenericActuator);
};
feathers_motion_effects_actuate_ActuateForEffects.update = function(target,duration,start,end,overwrite) {
	if(overwrite == null) {
		overwrite = true;
	}
	var properties = { start : start, end : end};
	var result = motion_Actuate.tween(target,duration,properties,overwrite,feathers_motion_effects_actuate_MethodEffectActuator);
	return js_Boot.__cast(result , feathers_motion_effects_actuate_IReadableGenericActuator);
};
var motion_actuators_IGenericActuator = function() { };
$hxClasses["motion.actuators.IGenericActuator"] = motion_actuators_IGenericActuator;
motion_actuators_IGenericActuator.__name__ = "motion.actuators.IGenericActuator";
motion_actuators_IGenericActuator.__isInterface__ = true;
motion_actuators_IGenericActuator.prototype = {
	autoVisible: null
	,delay: null
	,ease: null
	,onComplete: null
	,onRepeat: null
	,onUpdate: null
	,reflect: null
	,repeat: null
	,reverse: null
	,smartRotation: null
	,snapping: null
	,onPause: null
	,onResume: null
	,apply: null
	,move: null
	,pause: null
	,resume: null
	,stop: null
	,__class__: motion_actuators_IGenericActuator
};
var feathers_motion_effects_actuate_IGotoActuator = function() { };
$hxClasses["feathers.motion.effects.actuate.IGotoActuator"] = feathers_motion_effects_actuate_IGotoActuator;
feathers_motion_effects_actuate_IGotoActuator.__name__ = "feathers.motion.effects.actuate.IGotoActuator";
feathers_motion_effects_actuate_IGotoActuator.__isInterface__ = true;
feathers_motion_effects_actuate_IGotoActuator.__interfaces__ = [motion_actuators_IGenericActuator];
feathers_motion_effects_actuate_IGotoActuator.prototype = {
	goto: null
	,__class__: feathers_motion_effects_actuate_IGotoActuator
};
var feathers_motion_effects_actuate_IReadableGenericActuator = function() { };
$hxClasses["feathers.motion.effects.actuate.IReadableGenericActuator"] = feathers_motion_effects_actuate_IReadableGenericActuator;
feathers_motion_effects_actuate_IReadableGenericActuator.__name__ = "feathers.motion.effects.actuate.IReadableGenericActuator";
feathers_motion_effects_actuate_IReadableGenericActuator.__isInterface__ = true;
feathers_motion_effects_actuate_IReadableGenericActuator.__interfaces__ = [feathers_motion_effects_actuate_IGotoActuator,motion_actuators_IGenericActuator];
feathers_motion_effects_actuate_IReadableGenericActuator.prototype = {
	getTarget: null
	,getDuration: null
	,getAutoVisible: null
	,getDelay: null
	,getEase: null
	,getReflect: null
	,getRepeat: null
	,getReverse: null
	,getSmartRotation: null
	,getSnapping: null
	,getOnComplete: null
	,getOnCompleteParams: null
	,getOnRepeat: null
	,getOnRepeatParams: null
	,getOnUpdate: null
	,getOnUpdateParams: null
	,getOnPause: null
	,getOnPauseParams: null
	,getOnResume: null
	,getOnResumeParams: null
	,__class__: feathers_motion_effects_actuate_IReadableGenericActuator
};
var motion_actuators_GenericActuator = function(target,duration,properties) {
	this._autoVisible = true;
	this._delay = 0;
	this._reflect = false;
	this._repeat = 0;
	this._reverse = false;
	this._smartRotation = false;
	this._snapping = false;
	this.special = false;
	this.target = target;
	this.properties = properties;
	this.duration = duration;
	this._ease = motion_Actuate.defaultEase;
};
$hxClasses["motion.actuators.GenericActuator"] = motion_actuators_GenericActuator;
motion_actuators_GenericActuator.__name__ = "motion.actuators.GenericActuator";
motion_actuators_GenericActuator.__interfaces__ = [motion_actuators_IGenericActuator];
motion_actuators_GenericActuator.prototype = {
	duration: null
	,id: null
	,properties: null
	,target: null
	,_autoVisible: null
	,_delay: null
	,_ease: null
	,_onComplete: null
	,_onCompleteParams: null
	,_onRepeat: null
	,_onRepeatParams: null
	,_onUpdate: null
	,_onUpdateParams: null
	,_onResume: null
	,_onResumeParams: null
	,_onPause: null
	,_onPauseParams: null
	,_reflect: null
	,_repeat: null
	,_reverse: null
	,_smartRotation: null
	,_snapping: null
	,special: null
	,apply: function() {
		var _g = 0;
		var _g1 = Reflect.fields(this.properties);
		while(_g < _g1.length) {
			var i = _g1[_g];
			++_g;
			if(Object.prototype.hasOwnProperty.call(this.target,i)) {
				this.target[i] = Reflect.field(this.properties,i);
			} else {
				Reflect.setProperty(this.target,i,Reflect.field(this.properties,i));
			}
		}
	}
	,autoVisible: function(value) {
		if(value == null) {
			value = true;
		}
		this._autoVisible = value;
		return this;
	}
	,callMethod: function(method,params) {
		if(params == null) {
			params = [];
		}
		return method.apply(method,params);
	}
	,change: function() {
		if(this._onUpdate != null) {
			var method = this._onUpdate;
			var params = this._onUpdateParams;
			if(params == null) {
				params = [];
			}
			method.apply(method,params);
		}
	}
	,complete: function(sendEvent) {
		if(sendEvent == null) {
			sendEvent = true;
		}
		if(sendEvent) {
			this.change();
			if(this._onComplete != null) {
				var method = this._onComplete;
				var params = this._onCompleteParams;
				if(params == null) {
					params = [];
				}
				method.apply(method,params);
			}
		}
		motion_Actuate.unload(this);
	}
	,delay: function(duration) {
		this._delay = duration;
		return this;
	}
	,ease: function(easing) {
		this._ease = easing;
		return this;
	}
	,move: function() {
	}
	,onComplete: function(handler,parameters) {
		this._onComplete = handler;
		if(parameters == null) {
			this._onCompleteParams = [];
		} else {
			this._onCompleteParams = parameters;
		}
		if(this.duration == 0) {
			this.complete();
		}
		return this;
	}
	,onRepeat: function(handler,parameters) {
		this._onRepeat = handler;
		if(parameters == null) {
			this._onRepeatParams = [];
		} else {
			this._onRepeatParams = parameters;
		}
		return this;
	}
	,onUpdate: function(handler,parameters) {
		this._onUpdate = handler;
		if(parameters == null) {
			this._onUpdateParams = [];
		} else {
			this._onUpdateParams = parameters;
		}
		return this;
	}
	,onPause: function(handler,parameters) {
		this._onPause = handler;
		if(parameters == null) {
			this._onPauseParams = [];
		} else {
			this._onPauseParams = parameters;
		}
		return this;
	}
	,onResume: function(handler,parameters) {
		this._onResume = handler;
		if(parameters == null) {
			this._onResumeParams = [];
		} else {
			this._onResumeParams = parameters;
		}
		return this;
	}
	,pause: function() {
		if(this._onPause != null) {
			var method = this._onPause;
			var params = this._onPauseParams;
			if(params == null) {
				params = [];
			}
			method.apply(method,params);
		}
	}
	,reflect: function(value) {
		if(value == null) {
			value = true;
		}
		this._reflect = value;
		this.special = true;
		return this;
	}
	,repeat: function(times) {
		if(times == null) {
			times = -1;
		}
		this._repeat = times;
		return this;
	}
	,resume: function() {
		if(this._onResume != null) {
			var method = this._onResume;
			var params = this._onResumeParams;
			if(params == null) {
				params = [];
			}
			method.apply(method,params);
		}
	}
	,reverse: function(value) {
		if(value == null) {
			value = true;
		}
		this._reverse = value;
		this.special = true;
		return this;
	}
	,smartRotation: function(value) {
		if(value == null) {
			value = true;
		}
		this._smartRotation = value;
		this.special = true;
		return this;
	}
	,snapping: function(value) {
		if(value == null) {
			value = true;
		}
		this._snapping = value;
		this.special = true;
		return this;
	}
	,stop: function(properties,complete,sendEvent) {
	}
	,__class__: motion_actuators_GenericActuator
};
var motion_actuators_SimpleActuator = function(target,duration,properties) {
	this.active = true;
	this.propertyDetails = [];
	this.sendChange = false;
	this.paused = false;
	this.cacheVisible = false;
	this.initialized = false;
	this.setVisible = false;
	this.toggleVisible = false;
	this.startTime = openfl_Lib.getTimer() / 1000;
	motion_actuators_GenericActuator.call(this,target,duration,properties);
	if(!motion_actuators_SimpleActuator.addedEvent) {
		motion_actuators_SimpleActuator.addedEvent = true;
		openfl_Lib.get_current().stage.addEventListener("enterFrame",motion_actuators_SimpleActuator.stage_onEnterFrame);
	}
};
$hxClasses["motion.actuators.SimpleActuator"] = motion_actuators_SimpleActuator;
motion_actuators_SimpleActuator.__name__ = "motion.actuators.SimpleActuator";
motion_actuators_SimpleActuator.stage_onEnterFrame = function(event) {
	var currentTime = openfl_Lib.getTimer() / 1000;
	var actuator;
	var j = 0;
	var cleanup = false;
	var _g = 0;
	var _g1 = motion_actuators_SimpleActuator.actuatorsLength;
	while(_g < _g1) {
		var i = _g++;
		actuator = motion_actuators_SimpleActuator.actuators[j];
		if(actuator != null && actuator.active) {
			if(currentTime >= actuator.timeOffset) {
				actuator.update(currentTime);
			}
			++j;
		} else {
			motion_actuators_SimpleActuator.actuators.splice(j,1);
			--motion_actuators_SimpleActuator.actuatorsLength;
		}
	}
};
motion_actuators_SimpleActuator.__super__ = motion_actuators_GenericActuator;
motion_actuators_SimpleActuator.prototype = $extend(motion_actuators_GenericActuator.prototype,{
	timeOffset: null
	,active: null
	,cacheVisible: null
	,detailsLength: null
	,initialized: null
	,paused: null
	,pauseTime: null
	,propertyDetails: null
	,sendChange: null
	,setVisible: null
	,startTime: null
	,toggleVisible: null
	,reverse: function(value) {
		var ga = motion_actuators_GenericActuator.prototype.reverse.call(this,value);
		var startTime = 0;
		startTime = openfl_Lib.getTimer() / 1000;
		this.update(startTime);
		return ga;
	}
	,apply: function() {
		motion_actuators_GenericActuator.prototype.apply.call(this);
		if(this.toggleVisible && Object.prototype.hasOwnProperty.call(this.properties,"alpha")) {
			var target = this.target;
			var value = null;
			if(Object.prototype.hasOwnProperty.call(target,"visible")) {
				value = Reflect.field(target,"visible");
			} else {
				value = Reflect.getProperty(target,"visible");
			}
			if(value != null) {
				var target = this.target;
				var value = Reflect.field(this.properties,"alpha") > 0;
				if(Object.prototype.hasOwnProperty.call(target,"visible") && !(target.__properties__ && target.__properties__["set_" + "visible"])) {
					target["visible"] = value;
				} else {
					Reflect.setProperty(target,"visible",value);
				}
			}
		}
	}
	,autoVisible: function(value) {
		if(value == null) {
			value = true;
		}
		this._autoVisible = value;
		if(!value) {
			this.toggleVisible = false;
			if(this.setVisible) {
				var target = this.target;
				var value = this.cacheVisible;
				if(Object.prototype.hasOwnProperty.call(target,"visible") && !(target.__properties__ && target.__properties__["set_" + "visible"])) {
					target["visible"] = value;
				} else {
					Reflect.setProperty(target,"visible",value);
				}
			}
		}
		return this;
	}
	,delay: function(duration) {
		this._delay = duration;
		this.timeOffset = this.startTime + duration;
		return this;
	}
	,getField: function(target,propertyName) {
		var value = null;
		if(Object.prototype.hasOwnProperty.call(target,propertyName)) {
			value = Reflect.field(target,propertyName);
		} else {
			value = Reflect.getProperty(target,propertyName);
		}
		return value;
	}
	,initialize: function() {
		var details;
		var start;
		var _g = 0;
		var _g1 = Reflect.fields(this.properties);
		while(_g < _g1.length) {
			var i = _g1[_g];
			++_g;
			var isField = true;
			if(Object.prototype.hasOwnProperty.call(this.target,i) && !(this.target.__properties__ && this.target.__properties__["set_" + i])) {
				start = Reflect.field(this.target,i);
			} else {
				isField = false;
				start = Reflect.getProperty(this.target,i);
			}
			if(typeof(start) == "number") {
				var target = this.properties;
				var value = null;
				if(Object.prototype.hasOwnProperty.call(target,i)) {
					value = Reflect.field(target,i);
				} else {
					value = Reflect.getProperty(target,i);
				}
				var value1 = value;
				if(start == null) {
					start = 0;
				}
				if(value1 == null) {
					value1 = 0;
				}
				details = new motion_actuators_PropertyDetails(this.target,i,start,value1 - start,isField);
				this.propertyDetails.push(details);
			}
		}
		this.detailsLength = this.propertyDetails.length;
		this.initialized = true;
	}
	,move: function() {
		this.toggleVisible = Object.prototype.hasOwnProperty.call(this.properties,"alpha") && ((this.target) instanceof openfl_display_DisplayObject);
		var tmp;
		if(this.toggleVisible && this.properties.alpha != 0) {
			var target = this.target;
			var value = null;
			if(Object.prototype.hasOwnProperty.call(target,"visible")) {
				value = Reflect.field(target,"visible");
			} else {
				value = Reflect.getProperty(target,"visible");
			}
			tmp = !value;
		} else {
			tmp = false;
		}
		if(tmp) {
			this.setVisible = true;
			var target = this.target;
			var value = null;
			if(Object.prototype.hasOwnProperty.call(target,"visible")) {
				value = Reflect.field(target,"visible");
			} else {
				value = Reflect.getProperty(target,"visible");
			}
			this.cacheVisible = value;
			var target = this.target;
			var value = true;
			if(Object.prototype.hasOwnProperty.call(target,"visible") && !(target.__properties__ && target.__properties__["set_" + "visible"])) {
				target["visible"] = value;
			} else {
				Reflect.setProperty(target,"visible",value);
			}
		}
		this.timeOffset = this.startTime;
		motion_actuators_SimpleActuator.actuators.push(this);
		++motion_actuators_SimpleActuator.actuatorsLength;
	}
	,onUpdate: function(handler,parameters) {
		this._onUpdate = handler;
		if(parameters == null) {
			this._onUpdateParams = [];
		} else {
			this._onUpdateParams = parameters;
		}
		this.sendChange = true;
		return this;
	}
	,pause: function() {
		if(!this.paused) {
			this.paused = true;
			motion_actuators_GenericActuator.prototype.pause.call(this);
			this.pauseTime = openfl_Lib.getTimer();
		}
	}
	,resume: function() {
		if(this.paused) {
			this.paused = false;
			this.timeOffset += (openfl_Lib.getTimer() - this.pauseTime) / 1000;
			motion_actuators_GenericActuator.prototype.resume.call(this);
		}
	}
	,setField: function(target,propertyName,value) {
		if(Object.prototype.hasOwnProperty.call(target,propertyName) && !(target.__properties__ && target.__properties__["set_" + propertyName])) {
			target[propertyName] = value;
		} else {
			Reflect.setProperty(target,propertyName,value);
		}
	}
	,setProperty: function(details,value) {
		if(details.isField) {
			details.target[details.propertyName] = value;
		} else {
			Reflect.setProperty(details.target,details.propertyName,value);
		}
	}
	,stop: function(properties,complete,sendEvent) {
		if(this.active) {
			if(properties == null) {
				this.active = false;
				if(complete) {
					this.apply();
				}
				this.complete(sendEvent);
				return;
			}
			var _g = 0;
			var _g1 = Reflect.fields(properties);
			while(_g < _g1.length) {
				var i = _g1[_g];
				++_g;
				if(Object.prototype.hasOwnProperty.call(this.properties,i)) {
					this.active = false;
					if(complete) {
						this.apply();
					}
					this.complete(sendEvent);
					return;
				}
			}
		}
	}
	,update: function(currentTime) {
		if(!this.paused) {
			var details;
			var easing;
			var i;
			var tweenPosition = (currentTime - this.timeOffset) / this.duration;
			if(tweenPosition > 1) {
				tweenPosition = 1;
			}
			if(!this.initialized) {
				this.initialize();
			}
			if(!this.special) {
				easing = this._ease.calculate(tweenPosition);
				var _g = 0;
				var _g1 = this.detailsLength;
				while(_g < _g1) {
					var i = _g++;
					details = this.propertyDetails[i];
					this.setProperty(details,details.start + details.change * easing);
				}
			} else {
				if(!this._reverse) {
					easing = this._ease.calculate(tweenPosition);
				} else {
					easing = this._ease.calculate(1 - tweenPosition);
				}
				var endValue;
				var _g = 0;
				var _g1 = this.detailsLength;
				while(_g < _g1) {
					var i = _g++;
					details = this.propertyDetails[i];
					if(this._smartRotation && (details.propertyName == "rotation" || details.propertyName == "rotationX" || details.propertyName == "rotationY" || details.propertyName == "rotationZ")) {
						var rotation = details.change % 360;
						if(rotation > 180) {
							rotation -= 360;
						} else if(rotation < -180) {
							rotation += 360;
						}
						endValue = details.start + rotation * easing;
					} else {
						endValue = details.start + details.change * easing;
					}
					if(!this._snapping) {
						this.setProperty(details,endValue);
					} else {
						this.setProperty(details,Math.round(endValue));
					}
				}
			}
			if(tweenPosition == 1) {
				if(this._repeat == 0) {
					this.active = false;
					var tmp;
					if(this.toggleVisible) {
						var target = this.target;
						var value = null;
						if(Object.prototype.hasOwnProperty.call(target,"alpha")) {
							value = Reflect.field(target,"alpha");
						} else {
							value = Reflect.getProperty(target,"alpha");
						}
						tmp = value == 0;
					} else {
						tmp = false;
					}
					if(tmp) {
						var target = this.target;
						var value = false;
						if(Object.prototype.hasOwnProperty.call(target,"visible") && !(target.__properties__ && target.__properties__["set_" + "visible"])) {
							target["visible"] = value;
						} else {
							Reflect.setProperty(target,"visible",value);
						}
					}
					this.complete(true);
					return;
				} else {
					if(this._onRepeat != null) {
						var method = this._onRepeat;
						var params = this._onRepeatParams;
						if(params == null) {
							params = [];
						}
						method.apply(method,params);
					}
					if(this._reflect) {
						this._reverse = !this._reverse;
					}
					this.startTime = currentTime;
					this.timeOffset = this.startTime + this._delay;
					if(this._repeat > 0) {
						this._repeat--;
					}
				}
			}
			if(this.sendChange) {
				this.change();
			}
		}
	}
	,__class__: motion_actuators_SimpleActuator
});
var motion_actuators_MethodActuator = function(target,duration,properties) {
	this.currentParameters = [];
	this.tweenProperties = { };
	motion_actuators_SimpleActuator.call(this,target,duration,properties);
	if(!Object.prototype.hasOwnProperty.call(properties,"start")) {
		this.properties.start = [];
	}
	if(!Object.prototype.hasOwnProperty.call(properties,"end")) {
		this.properties.end = this.properties.start;
	}
	var _g = 0;
	var _g1 = this.properties.start.length;
	while(_g < _g1) {
		var i = _g++;
		this.currentParameters.push(this.properties.start[i]);
	}
};
$hxClasses["motion.actuators.MethodActuator"] = motion_actuators_MethodActuator;
motion_actuators_MethodActuator.__name__ = "motion.actuators.MethodActuator";
motion_actuators_MethodActuator.__super__ = motion_actuators_SimpleActuator;
motion_actuators_MethodActuator.prototype = $extend(motion_actuators_SimpleActuator.prototype,{
	currentParameters: null
	,tweenProperties: null
	,apply: function() {
		var method = this.target;
		var params = this.properties.end;
		if(params == null) {
			params = [];
		}
		method.apply(method,params);
	}
	,complete: function(sendEvent) {
		if(sendEvent == null) {
			sendEvent = true;
		}
		if(this.initialized) {
			var _g = 0;
			var _g1 = this.properties.start.length;
			while(_g < _g1) {
				var i = _g++;
				this.currentParameters[i] = Reflect.field(this.tweenProperties,"param" + i);
			}
			var method = this.target;
			var params = this.currentParameters;
			if(params == null) {
				params = [];
			}
			method.apply(method,params);
		}
		motion_actuators_SimpleActuator.prototype.complete.call(this,sendEvent);
	}
	,initialize: function() {
		var details;
		var propertyName;
		var start;
		var _g = 0;
		var _g1 = this.properties.start.length;
		while(_g < _g1) {
			var i = _g++;
			propertyName = "param" + i;
			start = this.properties.start[i];
			this.tweenProperties[propertyName] = start;
			if(typeof(start) == "number" || typeof(start) == "number" && ((start | 0) === start)) {
				details = new motion_actuators_PropertyDetails(this.tweenProperties,propertyName,start,this.properties.end[i] - start);
				this.propertyDetails.push(details);
			}
		}
		this.detailsLength = this.propertyDetails.length;
		this.initialized = true;
	}
	,update: function(currentTime) {
		motion_actuators_SimpleActuator.prototype.update.call(this,currentTime);
		if(this.active && !this.paused) {
			var _g = 0;
			var _g1 = this.properties.start.length;
			while(_g < _g1) {
				var i = _g++;
				this.currentParameters[i] = Reflect.field(this.tweenProperties,"param" + i);
			}
			var method = this.target;
			var params = this.currentParameters;
			if(params == null) {
				params = [];
			}
			method.apply(method,params);
		}
	}
	,__class__: motion_actuators_MethodActuator
});
var feathers_motion_effects_actuate_MethodEffectActuator = function(target,duration,properties) {
	motion_actuators_MethodActuator.call(this,target,duration,properties);
};
$hxClasses["feathers.motion.effects.actuate.MethodEffectActuator"] = feathers_motion_effects_actuate_MethodEffectActuator;
feathers_motion_effects_actuate_MethodEffectActuator.__name__ = "feathers.motion.effects.actuate.MethodEffectActuator";
feathers_motion_effects_actuate_MethodEffectActuator.__interfaces__ = [feathers_motion_effects_actuate_IReadableGenericActuator];
feathers_motion_effects_actuate_MethodEffectActuator.__super__ = motion_actuators_MethodActuator;
feathers_motion_effects_actuate_MethodEffectActuator.prototype = $extend(motion_actuators_MethodActuator.prototype,{
	getTarget: function() {
		return this.target;
	}
	,getDuration: function() {
		return this.duration;
	}
	,getEase: function() {
		return this._ease;
	}
	,getAutoVisible: function() {
		return this._autoVisible;
	}
	,getDelay: function() {
		return this._delay;
	}
	,getReflect: function() {
		return this._reflect;
	}
	,getRepeat: function() {
		return this._repeat;
	}
	,getReverse: function() {
		return this._reverse;
	}
	,getSmartRotation: function() {
		return this._smartRotation;
	}
	,getSnapping: function() {
		return this._snapping;
	}
	,getOnComplete: function() {
		return this._onComplete;
	}
	,getOnCompleteParams: function() {
		return this._onCompleteParams;
	}
	,getOnRepeat: function() {
		return this._onRepeat;
	}
	,getOnRepeatParams: function() {
		return this._onRepeatParams;
	}
	,getOnUpdate: function() {
		return this._onUpdate;
	}
	,getOnUpdateParams: function() {
		return this._onUpdateParams;
	}
	,getOnPause: function() {
		return this._onPause;
	}
	,getOnPauseParams: function() {
		return this._onPauseParams;
	}
	,getOnResume: function() {
		return this._onResume;
	}
	,getOnResumeParams: function() {
		return this._onResumeParams;
	}
	,goto: function(tweenPosition) {
		var details;
		var easing;
		var i;
		if(!this.initialized) {
			this.initialize();
		}
		if(!this.special) {
			easing = this._ease.calculate(tweenPosition);
			var _g = 0;
			var _g1 = this.detailsLength;
			while(_g < _g1) {
				var i = _g++;
				details = this.propertyDetails[i];
				this.setProperty(details,details.start + details.change * easing);
			}
		} else {
			if(!this._reverse) {
				easing = this._ease.calculate(tweenPosition);
			} else {
				easing = this._ease.calculate(1 - tweenPosition);
			}
			var endValue;
			var _g = 0;
			var _g1 = this.detailsLength;
			while(_g < _g1) {
				var i = _g++;
				details = this.propertyDetails[i];
				if(this._smartRotation && (details.propertyName == "rotation" || details.propertyName == "rotationX" || details.propertyName == "rotationY" || details.propertyName == "rotationZ")) {
					var rotation = details.change % 360;
					if(rotation > 180) {
						rotation -= 360;
					} else if(rotation < -180) {
						rotation += 360;
					}
					endValue = details.start + rotation * easing;
				} else {
					endValue = details.start + details.change * easing;
				}
				if(!this._snapping) {
					this.setProperty(details,endValue);
				} else {
					this.setProperty(details,Math.round(endValue));
				}
			}
		}
		var _g = 0;
		var _g1 = this.properties.start.length;
		while(_g < _g1) {
			var i = _g++;
			this.currentParameters[i] = Reflect.field(this.tweenProperties,"param" + i);
		}
		var method = this.target;
		var params = this.currentParameters;
		if(params == null) {
			params = [];
		}
		method.apply(method,params);
	}
	,update: function(currentTime) {
		if(!this.paused) {
			var tweenPosition = (currentTime - this.timeOffset) / this.duration;
			if(tweenPosition > 1) {
				tweenPosition = 1;
			}
			this.goto(tweenPosition);
			if(tweenPosition == 1) {
				if(this._repeat == 0) {
					this.active = false;
					var tmp;
					if(this.toggleVisible) {
						var target = this.target;
						var value = null;
						if(Object.prototype.hasOwnProperty.call(target,"alpha")) {
							value = Reflect.field(target,"alpha");
						} else {
							value = Reflect.getProperty(target,"alpha");
						}
						tmp = value == 0;
					} else {
						tmp = false;
					}
					if(tmp) {
						var target = this.target;
						var value = false;
						if(Object.prototype.hasOwnProperty.call(target,"visible") && !(target.__properties__ && target.__properties__["set_" + "visible"])) {
							target["visible"] = value;
						} else {
							Reflect.setProperty(target,"visible",value);
						}
					}
					this.complete(true);
					return;
				} else {
					if(this._onRepeat != null) {
						var method = this._onRepeat;
						var params = this._onRepeatParams;
						if(params == null) {
							params = [];
						}
						method.apply(method,params);
					}
					if(this._reflect) {
						this._reverse = !this._reverse;
					}
					this.startTime = currentTime;
					this.timeOffset = this.startTime + this._delay;
					if(this._repeat > 0) {
						this._repeat--;
					}
				}
			}
			if(this.sendChange) {
				this.change();
			}
		}
	}
	,__class__: feathers_motion_effects_actuate_MethodEffectActuator
});
var feathers_motion_effects_actuate_SimpleEffectActuator = function(target,duration,properties) {
	motion_actuators_SimpleActuator.call(this,target,duration,properties);
};
$hxClasses["feathers.motion.effects.actuate.SimpleEffectActuator"] = feathers_motion_effects_actuate_SimpleEffectActuator;
feathers_motion_effects_actuate_SimpleEffectActuator.__name__ = "feathers.motion.effects.actuate.SimpleEffectActuator";
feathers_motion_effects_actuate_SimpleEffectActuator.__interfaces__ = [feathers_motion_effects_actuate_IReadableGenericActuator];
feathers_motion_effects_actuate_SimpleEffectActuator.__super__ = motion_actuators_SimpleActuator;
feathers_motion_effects_actuate_SimpleEffectActuator.prototype = $extend(motion_actuators_SimpleActuator.prototype,{
	getTarget: function() {
		return this.target;
	}
	,getDuration: function() {
		return this.duration;
	}
	,getEase: function() {
		return this._ease;
	}
	,getAutoVisible: function() {
		return this._autoVisible;
	}
	,getDelay: function() {
		return this._delay;
	}
	,getReflect: function() {
		return this._reflect;
	}
	,getRepeat: function() {
		return this._repeat;
	}
	,getReverse: function() {
		return this._reverse;
	}
	,getSmartRotation: function() {
		return this._smartRotation;
	}
	,getSnapping: function() {
		return this._snapping;
	}
	,getOnComplete: function() {
		return this._onComplete;
	}
	,getOnCompleteParams: function() {
		return this._onCompleteParams;
	}
	,getOnRepeat: function() {
		return this._onRepeat;
	}
	,getOnRepeatParams: function() {
		return this._onRepeatParams;
	}
	,getOnUpdate: function() {
		return this._onUpdate;
	}
	,getOnUpdateParams: function() {
		return this._onUpdateParams;
	}
	,getOnPause: function() {
		return this._onPause;
	}
	,getOnPauseParams: function() {
		return this._onPauseParams;
	}
	,getOnResume: function() {
		return this._onResume;
	}
	,getOnResumeParams: function() {
		return this._onResumeParams;
	}
	,goto: function(tweenPosition) {
		var details;
		var easing;
		var i;
		if(!this.initialized) {
			this.initialize();
		}
		if(!this.special) {
			easing = this._ease.calculate(tweenPosition);
			var _g = 0;
			var _g1 = this.detailsLength;
			while(_g < _g1) {
				var i = _g++;
				details = this.propertyDetails[i];
				this.setProperty(details,details.start + details.change * easing);
			}
		} else {
			if(!this._reverse) {
				easing = this._ease.calculate(tweenPosition);
			} else {
				easing = this._ease.calculate(1 - tweenPosition);
			}
			var endValue;
			var _g = 0;
			var _g1 = this.detailsLength;
			while(_g < _g1) {
				var i = _g++;
				details = this.propertyDetails[i];
				if(this._smartRotation && (details.propertyName == "rotation" || details.propertyName == "rotationX" || details.propertyName == "rotationY" || details.propertyName == "rotationZ")) {
					var rotation = details.change % 360;
					if(rotation > 180) {
						rotation -= 360;
					} else if(rotation < -180) {
						rotation += 360;
					}
					endValue = details.start + rotation * easing;
				} else {
					endValue = details.start + details.change * easing;
				}
				if(!this._snapping) {
					this.setProperty(details,endValue);
				} else {
					this.setProperty(details,Math.round(endValue));
				}
			}
		}
	}
	,update: function(currentTime) {
		if(!this.paused) {
			var tweenPosition = (currentTime - this.timeOffset) / this.duration;
			if(tweenPosition > 1) {
				tweenPosition = 1;
			}
			this.goto(tweenPosition);
			if(tweenPosition == 1) {
				if(this._repeat == 0) {
					this.active = false;
					var tmp;
					if(this.toggleVisible) {
						var target = this.target;
						var value = null;
						if(Object.prototype.hasOwnProperty.call(target,"alpha")) {
							value = Reflect.field(target,"alpha");
						} else {
							value = Reflect.getProperty(target,"alpha");
						}
						tmp = value == 0;
					} else {
						tmp = false;
					}
					if(tmp) {
						var target = this.target;
						var value = false;
						if(Object.prototype.hasOwnProperty.call(target,"visible") && !(target.__properties__ && target.__properties__["set_" + "visible"])) {
							target["visible"] = value;
						} else {
							Reflect.setProperty(target,"visible",value);
						}
					}
					this.complete(true);
					return;
				} else {
					if(this._onRepeat != null) {
						var method = this._onRepeat;
						var params = this._onRepeatParams;
						if(params == null) {
							params = [];
						}
						method.apply(method,params);
					}
					if(this._reflect) {
						this._reverse = !this._reverse;
					}
					this.startTime = currentTime;
					this.timeOffset = this.startTime + this._delay;
					if(this._repeat > 0) {
						this._repeat--;
					}
				}
			}
			if(this.sendChange) {
				this.change();
			}
		}
	}
	,__class__: feathers_motion_effects_actuate_SimpleEffectActuator
});
var feathers_motion_transitions_SlideTransitionBuilder = function(angleDegrees,duration,ease) {
	if(duration == null) {
		duration = 0.5;
	}
	if(angleDegrees == null) {
		angleDegrees = 0.0;
	}
	this._parallax = 1.0;
	this._angle = angleDegrees;
	this._duration = duration;
	this._ease = ease;
};
$hxClasses["feathers.motion.transitions.SlideTransitionBuilder"] = feathers_motion_transitions_SlideTransitionBuilder;
feathers_motion_transitions_SlideTransitionBuilder.__name__ = "feathers.motion.transitions.SlideTransitionBuilder";
feathers_motion_transitions_SlideTransitionBuilder.prototype = {
	_angle: null
	,_duration: null
	,_ease: null
	,_interruptBehavior: null
	,_parallax: null
	,setAngle: function(angleDegrees) {
		this._angle = angleDegrees;
		return this;
	}
	,setRadians: function(angleRadians) {
		this._angle = angleRadians * 180.0 / Math.PI;
		return this;
	}
	,setUp: function() {
		this._angle = 90.0;
		return this;
	}
	,setDown: function() {
		this._angle = 270.0;
		return this;
	}
	,setLeft: function() {
		this._angle = 180.0;
		return this;
	}
	,setRight: function() {
		this._angle = 0.0;
		return this;
	}
	,setDuration: function(duration) {
		this._duration = duration;
		return this;
	}
	,setEase: function(ease) {
		this._ease = ease;
		return this;
	}
	,setParallax: function(parallax) {
		if(parallax < 0.0 || parallax > 1.0) {
			throw new openfl_errors_RangeError("Invalid parallax value: " + parallax + ". Expected a value between 0.0 and 1.0.");
		}
		this._parallax = parallax;
		return this;
	}
	,setInterruptBehavior: function(interruptBehavior) {
		this._interruptBehavior = interruptBehavior;
		return this;
	}
	,build: function() {
		var _gthis = this;
		var angle = this._angle % 360.0;
		if(angle < 0.0) {
			angle += 360.0;
		}
		var duration = this._duration;
		var ease = this._ease;
		var interruptBehavior = this._interruptBehavior;
		return function(oldView,newView) {
			if(oldView == null && newView == null) {
				throw new openfl_errors_ArgumentError(feathers_motion_transitions_SlideTransitionBuilder.VIEW_REQUIRED_ERROR);
			}
			var parent = null;
			var width = 0.0;
			var height = 0.0;
			if(oldView != null) {
				parent = oldView.parent;
				width = oldView.get_width();
				height = oldView.get_height();
			}
			if(newView != null) {
				parent = newView.parent;
				width = Math.max(width,newView.get_width());
				height = Math.max(height,newView.get_height());
			}
			var endX = 0.0;
			var endY = 0.0;
			if(angle >= 0.0 && angle < 45.0) {
				endX = width;
				var hy = width / Math.cos(angle * Math.PI / 180.0);
				endY = -Math.sqrt(hy * hy - width * width);
			} else if(angle >= 45.0 && angle < 90.0) {
				endY = -height;
				var hy = height / Math.sin(angle * Math.PI / 180.0);
				endX = Math.sqrt(hy * hy - height * height);
			} else if(angle >= 90.0 && angle < 135.0) {
				endY = -height;
				var hy = height / Math.cos((angle - 90.0) * Math.PI / 180.0);
				endX = -Math.sqrt(hy * hy - height * height);
			} else if(angle >= 135.0 && angle < 180.0) {
				endX = -width;
				var hy = width / Math.sin((angle - 90.0) * Math.PI / 180.0);
				endY = -Math.sqrt(hy * hy - width * width);
			} else if(angle >= 180.0 && angle < 225.0) {
				endX = -width;
				var hy = width / Math.cos((angle - 180.0) * Math.PI / 180.0);
				endY = Math.sqrt(hy * hy - width * width);
			} else if(angle >= 225.0 && angle < 270.0) {
				endY = height;
				var hy = height / Math.sin((angle - 180.0) * Math.PI / 180.0);
				endX = -Math.sqrt(hy * hy - height * height);
			} else if(angle >= 270.0 && angle < 315.0) {
				endY = height;
				var hy = height / Math.cos((angle - 270.0) * Math.PI / 180.0);
				endX = Math.sqrt(hy * hy - height * height);
			} else {
				endX = width;
				var hy = width / Math.sin((angle - 270.0) * Math.PI / 180.0);
				endY = Math.sqrt(hy * hy - width * width);
			}
			if(newView != null) {
				newView.set_x(-endX);
				newView.set_y(-endY);
			}
			if(parent != null && oldView != null && newView != null) {
				var oldViewIndex = parent.getChildIndex(oldView);
				var newViewIndex = parent.getChildIndex(newView);
				if(oldViewIndex > newViewIndex) {
					parent.swapChildren(oldView,newView);
				}
			}
			var actuator = feathers_motion_effects_actuate_ActuateForEffects.update(function(x,y) {
				if(oldView != null) {
					oldView.set_x(x * _gthis._parallax);
					oldView.set_y(y * _gthis._parallax);
				}
				if(newView != null) {
					newView.set_x(x - endX);
					newView.set_y(y - endY);
				}
			},duration,[0.0,0.0],[endX,endY]);
			if(ease != null) {
				actuator.ease(ease);
			}
			motion_Actuate.pause(actuator);
			return new feathers_motion_effects_actuate_ActuateEffectContext(null,actuator,interruptBehavior);
		};
	}
	,__class__: feathers_motion_transitions_SlideTransitionBuilder
};
var feathers_skins_CircleSkin = function(fill,border) {
	feathers_skins_BaseGraphicsPathSkin.call(this,fill,border);
};
$hxClasses["feathers.skins.CircleSkin"] = feathers_skins_CircleSkin;
feathers_skins_CircleSkin.__name__ = "feathers.skins.CircleSkin";
feathers_skins_CircleSkin.__super__ = feathers_skins_BaseGraphicsPathSkin;
feathers_skins_CircleSkin.prototype = $extend(feathers_skins_BaseGraphicsPathSkin.prototype,{
	drawPath: function() {
		var currentBorder = this.getCurrentBorder();
		var thicknessOffset = this.getLineThickness(currentBorder) / 2.0;
		var shorterSide = this.actualWidth;
		if(shorterSide > this.actualHeight) {
			shorterSide = this.actualHeight;
		}
		var radius = shorterSide / 2.0 - thicknessOffset;
		var radius1 = Math.max(0.0,radius);
		this.get_graphics().drawCircle(this.actualWidth / 2.0,this.actualHeight / 2.0,radius1);
	}
	,getRadius: function() {
		var currentBorder = this.getCurrentBorder();
		var thicknessOffset = this.getLineThickness(currentBorder) / 2.0;
		var shorterSide = this.actualWidth;
		if(shorterSide > this.actualHeight) {
			shorterSide = this.actualHeight;
		}
		var radius = shorterSide / 2.0 - thicknessOffset;
		return Math.max(0.0,radius);
	}
	,getDefaultGradientMatrixWidth: function() {
		var currentBorder = this.getCurrentBorder();
		var thicknessOffset = this.getLineThickness(currentBorder) / 2.0;
		var shorterSide = this.actualWidth;
		if(shorterSide > this.actualHeight) {
			shorterSide = this.actualHeight;
		}
		var radius = shorterSide / 2.0 - thicknessOffset;
		return Math.max(0.0,radius);
	}
	,getDefaultGradientMatrixHeight: function() {
		var currentBorder = this.getCurrentBorder();
		var thicknessOffset = this.getLineThickness(currentBorder) / 2.0;
		var shorterSide = this.actualWidth;
		if(shorterSide > this.actualHeight) {
			shorterSide = this.actualHeight;
		}
		var radius = shorterSide / 2.0 - thicknessOffset;
		return Math.max(0.0,radius);
	}
	,getDefaultGradientMatrixTx: function() {
		var drawWidth = this.actualWidth;
		var currentBorder = this.getCurrentBorder();
		var thicknessOffset = this.getLineThickness(currentBorder) / 2.0;
		var shorterSide = this.actualWidth;
		if(shorterSide > this.actualHeight) {
			shorterSide = this.actualHeight;
		}
		var radius = shorterSide / 2.0 - thicknessOffset;
		var drawWidth1 = Math.max(0.0,drawWidth - Math.max(0.0,radius));
		return drawWidth1 / 2.0;
	}
	,getDefaultGradientMatrixTy: function() {
		var drawHeight = this.actualHeight;
		var currentBorder = this.getCurrentBorder();
		var thicknessOffset = this.getLineThickness(currentBorder) / 2.0;
		var shorterSide = this.actualWidth;
		if(shorterSide > this.actualHeight) {
			shorterSide = this.actualHeight;
		}
		var radius = shorterSide / 2.0 - thicknessOffset;
		var drawHeight1 = Math.max(0.0,drawHeight - Math.max(0.0,radius));
		return drawHeight1 / 2.0;
	}
	,__class__: feathers_skins_CircleSkin
});
var feathers_skins_IIndeterminateSkin = function() { };
$hxClasses["feathers.skins.IIndeterminateSkin"] = feathers_skins_IIndeterminateSkin;
feathers_skins_IIndeterminateSkin.__name__ = "feathers.skins.IIndeterminateSkin";
feathers_skins_IIndeterminateSkin.__isInterface__ = true;
feathers_skins_IIndeterminateSkin.__interfaces__ = [feathers_skins_IProgrammaticSkin];
feathers_skins_IIndeterminateSkin.prototype = {
	get_indeterminatePosition: null
	,set_indeterminatePosition: null
	,__class__: feathers_skins_IIndeterminateSkin
	,__properties__: {set_indeterminatePosition:"set_indeterminatePosition",get_indeterminatePosition:"get_indeterminatePosition"}
};
var feathers_skins_MultiSkin = function(defaultView) {
	feathers_skins_ProgrammaticSkin.call(this);
	this.mouseChildren = false;
	this.set_defaultView(defaultView);
};
$hxClasses["feathers.skins.MultiSkin"] = feathers_skins_MultiSkin;
feathers_skins_MultiSkin.__name__ = "feathers.skins.MultiSkin";
feathers_skins_MultiSkin.__super__ = feathers_skins_ProgrammaticSkin;
feathers_skins_MultiSkin.prototype = $extend(feathers_skins_ProgrammaticSkin.prototype,{
	_previousView: null
	,_currentView: null
	,_currentViewMeasurements: null
	,_stateToView: null
	,_defaultView: null
	,get_defaultView: function() {
		return this._defaultView;
	}
	,set_defaultView: function(value) {
		if(this._defaultView == value) {
			return this._defaultView;
		}
		this._defaultView = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this._defaultView;
	}
	,_disabledView: null
	,get_disabledView: function() {
		return this._disabledView;
	}
	,set_disabledView: function(value) {
		if(this._disabledView == value) {
			return this._disabledView;
		}
		this._disabledView = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this._disabledView;
	}
	,_selectedView: null
	,get_selectedView: function() {
		return this._selectedView;
	}
	,set_selectedView: function(value) {
		if(this._selectedView == value) {
			return this._disabledView;
		}
		this._selectedView = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this._selectedView;
	}
	,getViewForState: function(state) {
		if(this._stateToView == null) {
			return null;
		}
		return this._stateToView.get(state);
	}
	,setViewForState: function(state,view) {
		if(this._stateToView == null) {
			this._stateToView = new haxe_ds_EnumValueMap();
		}
		if(this._stateToView.get(state) == view) {
			return;
		}
		this._stateToView.set(state,view);
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
	}
	,update: function() {
		this.refreshView();
		this.measure();
		this.layoutView();
		this._previousView = this._currentView;
	}
	,refreshView: function() {
		var oldView = this._currentView;
		this._currentView = this.getCurrentView();
		if(this._currentView == oldView) {
			return;
		}
		this.removeCurrentView(oldView);
		if(this._currentView == null) {
			this._currentViewMeasurements = null;
			return;
		}
		if(js_Boot.__implements(this._currentView,feathers_core_IUIControl)) {
			this._currentView.initializeNow();
		}
		if(this._currentViewMeasurements == null) {
			this._currentViewMeasurements = new feathers_layout_Measurements(this._currentView);
		} else {
			this._currentViewMeasurements.save(this._currentView);
		}
		if(js_Boot.__implements(this._currentView,feathers_skins_IProgrammaticSkin)) {
			this._currentView.set_uiContext(this._uiContext);
		}
		if(js_Boot.__implements(this._currentView,feathers_core_IStateObserver)) {
			this._currentView.set_stateContext(this._stateContext);
		}
		this.addChild(this._currentView);
	}
	,removeCurrentView: function(view) {
		if(view == null) {
			return;
		}
		if(js_Boot.__implements(view,feathers_skins_IProgrammaticSkin)) {
			view.set_uiContext(null);
		}
		if(js_Boot.__implements(view,feathers_core_IStateObserver)) {
			view.set_stateContext(null);
		}
		this._currentViewMeasurements.restore(view);
		if(view.parent == this) {
			this.removeChild(view);
		}
	}
	,getCurrentView: function() {
		if(this._previousView != null) {
			return this._previousView;
		}
		return this.getCurrentViewWithoutCache();
	}
	,getCurrentViewWithoutCache: function() {
		var stateContext = this._stateContext;
		if(stateContext == null && js_Boot.__implements(this._uiContext,feathers_core_IStateContext)) {
			stateContext = this._uiContext;
		}
		if(this._stateToView != null && stateContext != null) {
			var result = this._stateToView.get(stateContext.get_currentState());
			if(result != null) {
				return result;
			}
		}
		if(this._uiContext == null) {
			return this._defaultView;
		}
		if(this._disabledView != null) {
			if(!this._uiContext.get_enabled()) {
				return this._disabledView;
			}
		}
		if(this._selectedView != null && js_Boot.__implements(this._uiContext,feathers_controls_IToggle)) {
			var toggle = this._uiContext;
			if(toggle.get_selected()) {
				return this._selectedView;
			}
		}
		return this._defaultView;
	}
	,measure: function() {
		var needsWidth = this.get_explicitWidth() == null;
		var needsHeight = this.get_explicitHeight() == null;
		var needsMinWidth = this.get_explicitMinWidth() == null;
		var needsMinHeight = this.get_explicitMinHeight() == null;
		var needsMaxWidth = this.get_explicitMaxWidth() == null;
		var needsMaxHeight = this.get_explicitMaxHeight() == null;
		if(!needsWidth && !needsHeight && !needsMinWidth && !needsMinHeight && !needsMaxWidth && !needsMaxHeight) {
			return false;
		}
		if(this._currentView != null) {
			feathers_utils_MeasurementsUtil.resetFluidlyWithParent(this._currentViewMeasurements,this._currentView,this);
		}
		var measureSkin = null;
		if(js_Boot.__implements(this._currentView,feathers_core_IMeasureObject)) {
			measureSkin = this._currentView;
		}
		if(js_Boot.__implements(this._currentView,feathers_core_IValidating)) {
			this._currentView.validateNow();
		}
		var newWidth = this.get_explicitWidth();
		if(needsWidth) {
			newWidth = 0.0;
			if(this._currentView != null) {
				newWidth = Math.max(this._currentView.get_width(),newWidth);
			}
		}
		var newHeight = this.get_explicitHeight();
		if(needsHeight) {
			newHeight = 0.0;
			if(this._currentView != null) {
				newHeight = Math.max(this._currentView.get_height(),newHeight);
			}
		}
		var newMinWidth = this.get_explicitMinWidth();
		if(needsMinWidth) {
			newMinWidth = 0.0;
			if(measureSkin != null) {
				newMinWidth = Math.max(measureSkin.get_minWidth(),newMinWidth);
			} else if(this._currentViewMeasurements != null && this._currentViewMeasurements.minWidth != null) {
				newMinWidth = Math.max(this._currentViewMeasurements.minWidth,newMinWidth);
			}
		}
		var newMinHeight = this.get_explicitMinHeight();
		if(needsMinHeight) {
			newMinHeight = 0.0;
			if(measureSkin != null) {
				newMinHeight = Math.max(measureSkin.get_minHeight(),newMinHeight);
			} else if(this._currentViewMeasurements != null && this._currentViewMeasurements.minHeight != null) {
				newMinHeight = Math.max(this._currentViewMeasurements.minHeight,newMinHeight);
			}
		}
		var newMaxWidth = this.get_explicitMaxWidth();
		if(needsMaxWidth) {
			if(measureSkin != null) {
				newMaxWidth = measureSkin.get_maxWidth();
			} else if(this._currentViewMeasurements != null && this._currentViewMeasurements.maxWidth != null) {
				newMaxWidth = this._currentViewMeasurements.maxWidth;
			} else {
				newMaxWidth = 1.0 / 0.0;
			}
		}
		var newMaxHeight = this.get_explicitMaxHeight();
		if(needsMaxHeight) {
			if(measureSkin != null) {
				newMaxHeight = measureSkin.get_maxHeight();
			} else if(this._currentViewMeasurements != null && this._currentViewMeasurements.maxHeight != null) {
				newMaxHeight = this._currentViewMeasurements.maxHeight;
			} else {
				newMaxHeight = 1.0 / 0.0;
			}
		}
		return this.saveMeasurements(newWidth,newHeight,newMinWidth,newMinHeight,newMaxWidth,newMaxHeight);
	}
	,layoutView: function() {
		if(this._currentView == null) {
			return;
		}
		if(this._currentView.get_width() != this.actualWidth) {
			this._currentView.set_width(this.actualWidth);
		}
		if(this._currentView.get_height() != this.actualHeight) {
			this._currentView.set_height(this.actualHeight);
		}
	}
	,needsStateUpdate: function() {
		var updated = false;
		if(this._previousView != this.getCurrentViewWithoutCache()) {
			this._previousView = null;
			updated = true;
		}
		return updated;
	}
	,__class__: feathers_skins_MultiSkin
	,__properties__: $extend(feathers_skins_ProgrammaticSkin.prototype.__properties__,{set_selectedView:"set_selectedView",get_selectedView:"get_selectedView",set_disabledView:"set_disabledView",get_disabledView:"get_disabledView",set_defaultView:"set_defaultView",get_defaultView:"get_defaultView"})
});
var feathers_skins_PillSkin = function(fill,border,capDirection) {
	if(capDirection == null) {
		capDirection = feathers_layout_Direction.HORIZONTAL;
	}
	feathers_skins_BaseGraphicsPathSkin.call(this,fill,border);
	this._capDirection = capDirection;
};
$hxClasses["feathers.skins.PillSkin"] = feathers_skins_PillSkin;
feathers_skins_PillSkin.__name__ = "feathers.skins.PillSkin";
feathers_skins_PillSkin.__super__ = feathers_skins_BaseGraphicsPathSkin;
feathers_skins_PillSkin.prototype = $extend(feathers_skins_BaseGraphicsPathSkin.prototype,{
	_capDirection: null
	,get_capDirection: function() {
		return this._capDirection;
	}
	,set_capDirection: function(value) {
		if(this._capDirection == value) {
			return this._capDirection;
		}
		this._capDirection = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this._capDirection;
	}
	,drawPath: function() {
		var currentBorder = this.getCurrentBorder();
		var thickness = this.getLineThickness(currentBorder);
		var thicknessOffset = thickness / 2.0;
		var drawWidth = Math.max(0.0,this.actualWidth - thickness);
		var drawHeight = Math.max(0.0,this.actualHeight - thickness);
		var ellipseSize = this.get_capDirection() == feathers_layout_Direction.VERTICAL ? this.actualWidth : this.actualHeight;
		this.get_graphics().drawRoundRect(thicknessOffset,thicknessOffset,drawWidth,drawHeight,ellipseSize);
	}
	,__class__: feathers_skins_PillSkin
	,__properties__: $extend(feathers_skins_BaseGraphicsPathSkin.prototype.__properties__,{set_capDirection:"set_capDirection",get_capDirection:"get_capDirection"})
});
var feathers_skins_TabSkin = function(fill,border,cornerRadius) {
	if(cornerRadius == null) {
		cornerRadius = 0.0;
	}
	this._cornerRadius = 0.0;
	this._drawBaseBorder = true;
	this._cornerRadiusPosition = feathers_layout_RelativePosition.TOP;
	feathers_skins_BaseGraphicsPathSkin.call(this,fill,border);
	this._cornerRadius = cornerRadius;
};
$hxClasses["feathers.skins.TabSkin"] = feathers_skins_TabSkin;
feathers_skins_TabSkin.__name__ = "feathers.skins.TabSkin";
feathers_skins_TabSkin.__super__ = feathers_skins_BaseGraphicsPathSkin;
feathers_skins_TabSkin.prototype = $extend(feathers_skins_BaseGraphicsPathSkin.prototype,{
	_cornerRadiusPosition: null
	,get_cornerRadiusPosition: function() {
		return this._cornerRadiusPosition;
	}
	,set_cornerRadiusPosition: function(value) {
		if(this._cornerRadiusPosition == value) {
			return this._cornerRadiusPosition;
		}
		this._cornerRadiusPosition = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this._cornerRadiusPosition;
	}
	,_drawBaseBorder: null
	,get_drawBaseBorder: function() {
		return this._drawBaseBorder;
	}
	,set_drawBaseBorder: function(value) {
		if(this._drawBaseBorder == value) {
			return this._drawBaseBorder;
		}
		this._drawBaseBorder = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this._drawBaseBorder;
	}
	,_cornerRadius: null
	,get_cornerRadius: function() {
		return this._cornerRadius;
	}
	,set_cornerRadius: function(value) {
		if(this._cornerRadius == value) {
			return this._cornerRadius;
		}
		this._cornerRadius = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this._cornerRadius;
	}
	,drawPath: function() {
		var currentBorder = this.getCurrentBorder();
		var thicknessOffset = this.getLineThickness(currentBorder) / 2.0;
		var drawWidth = Math.max(0.0,this.actualWidth - thicknessOffset);
		var drawHeight = Math.max(0.0,this.actualHeight - thicknessOffset);
		var adjustedCornerRadius = Math.min(this._cornerRadius,Math.min(this.actualWidth / 2.0,this.actualHeight / 2.0));
		if(adjustedCornerRadius == 0.0 && this._drawBaseBorder) {
			this.get_graphics().drawRect(thicknessOffset,thicknessOffset,drawWidth,drawHeight);
		} else {
			switch(this._cornerRadiusPosition._hx_index) {
			case 0:
				this.get_graphics().moveTo(thicknessOffset + adjustedCornerRadius,thicknessOffset);
				this.get_graphics().lineTo(drawWidth - adjustedCornerRadius,thicknessOffset);
				this.get_graphics().curveTo(drawWidth,thicknessOffset,drawWidth,thicknessOffset + adjustedCornerRadius);
				if(this._drawBaseBorder) {
					this.get_graphics().lineTo(drawWidth,drawHeight);
					this.get_graphics().lineTo(thicknessOffset,drawHeight);
				} else {
					this.get_graphics().lineTo(drawWidth,this.actualHeight);
					this.get_graphics().lineStyle(0.0,null,0.0,null,null,null,null,0.0);
					this.get_graphics().lineTo(thicknessOffset,this.actualHeight);
					this.applyLineStyle(currentBorder);
				}
				this.get_graphics().lineTo(thicknessOffset,thicknessOffset + adjustedCornerRadius);
				this.get_graphics().curveTo(thicknessOffset,thicknessOffset,thicknessOffset + adjustedCornerRadius,thicknessOffset);
				break;
			case 1:
				this.get_graphics().moveTo(thicknessOffset,thicknessOffset);
				this.get_graphics().lineTo(drawWidth - adjustedCornerRadius,thicknessOffset);
				this.get_graphics().curveTo(drawWidth,thicknessOffset,drawWidth,thicknessOffset + adjustedCornerRadius);
				this.get_graphics().lineTo(drawWidth,drawHeight - adjustedCornerRadius);
				this.get_graphics().curveTo(drawWidth,drawHeight,drawWidth - adjustedCornerRadius,drawHeight);
				if(this._drawBaseBorder) {
					this.get_graphics().lineTo(thicknessOffset,drawHeight);
					this.get_graphics().lineTo(thicknessOffset,thicknessOffset);
				} else {
					this.get_graphics().lineTo(0.0,drawHeight);
					this.get_graphics().lineStyle(0.0,null,0.0,null,null,null,null,0.0);
					this.get_graphics().lineTo(0.0,thicknessOffset);
					this.applyLineStyle(currentBorder);
				}
				break;
			case 2:
				if(this._drawBaseBorder) {
					this.get_graphics().moveTo(thicknessOffset,thicknessOffset);
					this.get_graphics().lineTo(drawWidth,thicknessOffset);
				} else {
					this.get_graphics().lineStyle(0.0,null,0.0,null,null,null,null,0.0);
					this.get_graphics().moveTo(thicknessOffset,0.0);
					this.get_graphics().lineTo(drawWidth,0.0);
					this.applyLineStyle(currentBorder);
				}
				this.get_graphics().lineTo(drawWidth,drawHeight - adjustedCornerRadius);
				this.get_graphics().curveTo(drawWidth,drawHeight,drawWidth - adjustedCornerRadius,drawHeight);
				this.get_graphics().lineTo(thicknessOffset + adjustedCornerRadius,drawHeight);
				this.get_graphics().curveTo(thicknessOffset,drawHeight,thicknessOffset,drawHeight - adjustedCornerRadius);
				this.get_graphics().lineTo(thicknessOffset,thicknessOffset);
				break;
			case 3:
				this.get_graphics().moveTo(thicknessOffset + adjustedCornerRadius,thicknessOffset);
				if(this._drawBaseBorder) {
					this.get_graphics().lineTo(drawWidth,thicknessOffset);
					this.get_graphics().lineTo(drawWidth,drawHeight);
				} else {
					this.get_graphics().lineTo(this.actualWidth,thicknessOffset);
					this.get_graphics().lineStyle(0.0,null,0.0,null,null,null,null,0.0);
					this.get_graphics().lineTo(this.actualWidth,drawHeight);
					this.applyLineStyle(currentBorder);
				}
				this.get_graphics().lineTo(thicknessOffset + adjustedCornerRadius,drawHeight);
				this.get_graphics().curveTo(thicknessOffset,drawHeight,thicknessOffset,drawHeight - adjustedCornerRadius);
				this.get_graphics().lineTo(thicknessOffset,thicknessOffset + adjustedCornerRadius);
				this.get_graphics().curveTo(thicknessOffset,thicknessOffset,thicknessOffset + adjustedCornerRadius,thicknessOffset);
				break;
			default:
				throw new openfl_errors_ArgumentError("Tab cornerRadiusPosition not supported: " + Std.string(this._cornerRadiusPosition));
			}
		}
	}
	,__class__: feathers_skins_TabSkin
	,__properties__: $extend(feathers_skins_BaseGraphicsPathSkin.prototype.__properties__,{set_cornerRadius:"set_cornerRadius",get_cornerRadius:"get_cornerRadius",set_drawBaseBorder:"set_drawBaseBorder",get_drawBaseBorder:"get_drawBaseBorder",set_cornerRadiusPosition:"set_cornerRadiusPosition",get_cornerRadiusPosition:"get_cornerRadiusPosition"})
});
var feathers_skins_TriangleSkin = function(fill,border) {
	this._drawBaseBorder = true;
	this._pointPosition = feathers_layout_RelativePosition.TOP;
	feathers_skins_BaseGraphicsPathSkin.call(this,fill,border);
};
$hxClasses["feathers.skins.TriangleSkin"] = feathers_skins_TriangleSkin;
feathers_skins_TriangleSkin.__name__ = "feathers.skins.TriangleSkin";
feathers_skins_TriangleSkin.__super__ = feathers_skins_BaseGraphicsPathSkin;
feathers_skins_TriangleSkin.prototype = $extend(feathers_skins_BaseGraphicsPathSkin.prototype,{
	_pointPosition: null
	,get_pointPosition: function() {
		return this._pointPosition;
	}
	,set_pointPosition: function(value) {
		if(this._pointPosition == value) {
			return this._pointPosition;
		}
		this._pointPosition = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this._pointPosition;
	}
	,_drawBaseBorder: null
	,get_drawBaseBorder: function() {
		return this._drawBaseBorder;
	}
	,set_drawBaseBorder: function(value) {
		if(this._drawBaseBorder == value) {
			return this._drawBaseBorder;
		}
		this._drawBaseBorder = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this._drawBaseBorder;
	}
	,drawPath: function() {
		var currentBorder = this.getCurrentBorder();
		var thicknessOffset = this.getLineThickness(currentBorder) / 2.0;
		var maxX = Math.max(0.0,this.actualWidth - thicknessOffset);
		var maxY = Math.max(0.0,this.actualHeight - thicknessOffset);
		switch(this._pointPosition._hx_index) {
		case 0:
			this.get_graphics().moveTo(this.actualWidth / 2.0,thicknessOffset);
			if(this._drawBaseBorder) {
				this.get_graphics().lineTo(maxX,maxY);
				this.get_graphics().lineTo(thicknessOffset,maxY);
			} else {
				this.get_graphics().lineTo(maxX,this.actualHeight);
				this.get_graphics().lineStyle(0.0,null,0.0,null,null,null,null,0.0);
				this.get_graphics().lineTo(thicknessOffset,this.actualHeight);
				this.applyLineStyle(currentBorder);
			}
			this.get_graphics().lineTo(this.actualWidth / 2.0,thicknessOffset);
			break;
		case 1:
			if(this._drawBaseBorder) {
				this.get_graphics().moveTo(thicknessOffset,thicknessOffset);
			} else {
				this.get_graphics().moveTo(0.0,thicknessOffset);
			}
			this.get_graphics().lineTo(maxX,this.actualHeight / 2.0);
			if(this._drawBaseBorder) {
				this.get_graphics().lineTo(thicknessOffset,maxY);
				this.get_graphics().lineTo(thicknessOffset,thicknessOffset);
			} else {
				this.get_graphics().lineTo(0.0,maxY);
				this.get_graphics().lineStyle(0.0,null,0.0,null,null,null,null,0.0);
				this.get_graphics().lineTo(0.0,thicknessOffset);
				this.applyLineStyle(currentBorder);
			}
			break;
		case 2:
			if(this._drawBaseBorder) {
				this.get_graphics().moveTo(thicknessOffset,thicknessOffset);
				this.get_graphics().lineTo(maxX,thicknessOffset);
			} else {
				this.get_graphics().lineStyle(0.0,null,0.0,null,null,null,null,0.0);
				this.get_graphics().moveTo(thicknessOffset,0.0);
				this.get_graphics().lineTo(maxX,0.0);
				this.applyLineStyle(currentBorder);
			}
			this.get_graphics().lineTo(this.actualWidth / 2.0,maxY);
			if(this._drawBaseBorder) {
				this.get_graphics().lineTo(thicknessOffset,thicknessOffset);
			} else {
				this.get_graphics().lineTo(thicknessOffset,0.0);
			}
			break;
		case 3:
			if(this._drawBaseBorder) {
				this.get_graphics().moveTo(maxX,thicknessOffset);
				this.get_graphics().lineTo(maxX,maxY);
			} else {
				this.get_graphics().moveTo(this.actualWidth,thicknessOffset);
				this.get_graphics().lineStyle(0.0,null,0.0,null,null,null,null,0.0);
				this.get_graphics().lineTo(this.actualWidth,maxY);
				this.applyLineStyle(currentBorder);
			}
			this.get_graphics().lineTo(thicknessOffset,this.actualHeight / 2.0);
			if(this._drawBaseBorder) {
				this.get_graphics().lineTo(maxX,thicknessOffset);
			} else {
				this.get_graphics().lineTo(this.actualWidth,thicknessOffset);
			}
			break;
		default:
			throw new openfl_errors_ArgumentError("Triangle pointPosition not supported: " + Std.string(this._pointPosition));
		}
	}
	,__class__: feathers_skins_TriangleSkin
	,__properties__: $extend(feathers_skins_BaseGraphicsPathSkin.prototype.__properties__,{set_drawBaseBorder:"set_drawBaseBorder",get_drawBaseBorder:"get_drawBaseBorder",set_pointPosition:"set_pointPosition",get_pointPosition:"get_pointPosition"})
});
var feathers_skins_UnderlineSkin = function(fill,border) {
	feathers_skins_BaseGraphicsPathSkin.call(this,fill,border);
};
$hxClasses["feathers.skins.UnderlineSkin"] = feathers_skins_UnderlineSkin;
feathers_skins_UnderlineSkin.__name__ = "feathers.skins.UnderlineSkin";
feathers_skins_UnderlineSkin.__super__ = feathers_skins_BaseGraphicsPathSkin;
feathers_skins_UnderlineSkin.prototype = $extend(feathers_skins_BaseGraphicsPathSkin.prototype,{
	draw: function() {
		var currentBorder = this.getCurrentBorder();
		var thicknessOffset = this.getLineThickness(currentBorder) / 2.0;
		var currentFill = this.getCurrentFill();
		if(currentFill != null) {
			this.applyFillStyle(currentFill);
			this.get_graphics().drawRect(0.0,0.0,this.actualWidth,Math.max(0.0,this.actualHeight - thicknessOffset));
			this.get_graphics().endFill();
		}
		var minLineX = Math.min(this.actualWidth,thicknessOffset);
		var minLineY = Math.min(this.actualHeight,thicknessOffset);
		var maxLineX = Math.max(minLineX,this.actualWidth - thicknessOffset);
		var maxLineY = Math.max(minLineY,this.actualHeight - thicknessOffset);
		this.applyLineStyle(currentBorder);
		this.get_graphics().moveTo(minLineX,maxLineY);
		this.get_graphics().lineTo(maxLineX,maxLineY);
	}
	,__class__: feathers_skins_UnderlineSkin
});
var feathers_skins_VerticalLineSkin = function(fill,border) {
	this._paddingBottom = 0.0;
	this._paddingTop = 0.0;
	this._horizontalAlign = feathers_layout_HorizontalAlign.CENTER;
	feathers_skins_BaseGraphicsPathSkin.call(this,fill,border);
};
$hxClasses["feathers.skins.VerticalLineSkin"] = feathers_skins_VerticalLineSkin;
feathers_skins_VerticalLineSkin.__name__ = "feathers.skins.VerticalLineSkin";
feathers_skins_VerticalLineSkin.__super__ = feathers_skins_BaseGraphicsPathSkin;
feathers_skins_VerticalLineSkin.prototype = $extend(feathers_skins_BaseGraphicsPathSkin.prototype,{
	_horizontalAlign: null
	,get_horizontalAlign: function() {
		return this._horizontalAlign;
	}
	,set_horizontalAlign: function(value) {
		if(this._horizontalAlign == value) {
			return this._horizontalAlign;
		}
		this._horizontalAlign = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this._horizontalAlign;
	}
	,_paddingTop: null
	,get_paddingTop: function() {
		return this._paddingTop;
	}
	,set_paddingTop: function(value) {
		if(this._paddingTop == value) {
			return this._paddingTop;
		}
		this._paddingTop = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this._paddingTop;
	}
	,_paddingBottom: null
	,get_paddingBottom: function() {
		return this._paddingBottom;
	}
	,set_paddingBottom: function(value) {
		if(this._paddingBottom == value) {
			return this._paddingBottom;
		}
		this._paddingBottom = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this._paddingBottom;
	}
	,draw: function() {
		var currentBorder = this.getCurrentBorder();
		var thicknessOffset = this.getLineThickness(currentBorder) / 2.0;
		var currentFill = this.getCurrentFill();
		if(currentFill != null) {
			this.applyFillStyle(currentFill);
			this.get_graphics().drawRect(0.0,0.0,this.actualWidth,this.actualHeight);
			this.get_graphics().endFill();
		}
		var positionX;
		switch(this._horizontalAlign._hx_index) {
		case 0:
			positionX = thicknessOffset;
			break;
		case 1:
			positionX = this.actualWidth / 2.0;
			break;
		case 2:
			positionX = this.actualWidth - thicknessOffset;
			break;
		default:
			throw new openfl_errors_ArgumentError("Unknown horizontal align: " + Std.string(this._horizontalAlign));
		}
		var minLineY = Math.min(this.actualHeight,thicknessOffset + this._paddingTop);
		var maxLineY = Math.max(minLineY,this.actualHeight - thicknessOffset - this._paddingTop - this._paddingBottom);
		this.applyLineStyle(currentBorder);
		this.get_graphics().moveTo(positionX,minLineY);
		this.get_graphics().lineTo(positionX,maxLineY);
	}
	,__class__: feathers_skins_VerticalLineSkin
	,__properties__: $extend(feathers_skins_BaseGraphicsPathSkin.prototype.__properties__,{set_paddingBottom:"set_paddingBottom",get_paddingBottom:"get_paddingBottom",set_paddingTop:"set_paddingTop",get_paddingTop:"get_paddingTop",set_horizontalAlign:"set_horizontalAlign",get_horizontalAlign:"get_horizontalAlign"})
});
var feathers_skins_activity_DotsActivitySkin = function() {
	this._endDotAlpha = 0.0;
	this._dotAlpha = 1.0;
	this._endDotColor = null;
	this._dotColor = 0;
	this._endDotRadius = null;
	this._dotRadius = 3.0;
	this._numEmptyDots = 0;
	this._numDots = 8;
	this._indeterminatePosition = 0.0;
	feathers_skins_ProgrammaticSkin.call(this);
};
$hxClasses["feathers.skins.activity.DotsActivitySkin"] = feathers_skins_activity_DotsActivitySkin;
feathers_skins_activity_DotsActivitySkin.__name__ = "feathers.skins.activity.DotsActivitySkin";
feathers_skins_activity_DotsActivitySkin.__interfaces__ = [feathers_skins_IIndeterminateSkin];
feathers_skins_activity_DotsActivitySkin.__super__ = feathers_skins_ProgrammaticSkin;
feathers_skins_activity_DotsActivitySkin.prototype = $extend(feathers_skins_ProgrammaticSkin.prototype,{
	_indeterminatePosition: null
	,get_indeterminatePosition: function() {
		return this._indeterminatePosition;
	}
	,set_indeterminatePosition: function(value) {
		if(this._indeterminatePosition == value) {
			return this._indeterminatePosition;
		}
		this._indeterminatePosition = value;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		return this._indeterminatePosition;
	}
	,_numDots: null
	,get_numDots: function() {
		return this._numDots;
	}
	,set_numDots: function(value) {
		if(this._numDots == value) {
			return this._numDots;
		}
		this._numDots = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this._numDots;
	}
	,_numEmptyDots: null
	,get_numEmptyDots: function() {
		return this._numEmptyDots;
	}
	,set_numEmptyDots: function(value) {
		if(this._numEmptyDots == value) {
			return this._numEmptyDots;
		}
		this._numEmptyDots = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this._numEmptyDots;
	}
	,_dotRadius: null
	,get_dotRadius: function() {
		return this._dotRadius;
	}
	,set_dotRadius: function(value) {
		if(this._dotRadius == value) {
			return this._dotRadius;
		}
		this._dotRadius = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this._dotRadius;
	}
	,_endDotRadius: null
	,get_endDotRadius: function() {
		return this._endDotRadius;
	}
	,set_endDotRadius: function(value) {
		if(this._endDotRadius == value) {
			return this._endDotRadius;
		}
		this._endDotRadius = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this._endDotRadius;
	}
	,_dotColor: null
	,get_dotColor: function() {
		return this._dotColor;
	}
	,set_dotColor: function(value) {
		if(this._dotColor == value) {
			return this._dotColor;
		}
		this._dotColor = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this._dotColor;
	}
	,_endDotColor: null
	,get_endDotColor: function() {
		return this._endDotColor;
	}
	,set_endDotColor: function(value) {
		if(this._endDotColor == value) {
			return this._endDotColor;
		}
		this._endDotColor = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this._endDotColor;
	}
	,_dotAlpha: null
	,get_dotAlpha: function() {
		return this._dotAlpha;
	}
	,set_dotAlpha: function(value) {
		if(this._dotAlpha == value) {
			return this._dotAlpha;
		}
		this._dotAlpha = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this._dotAlpha;
	}
	,_endDotAlpha: null
	,get_endDotAlpha: function() {
		return this._endDotAlpha;
	}
	,set_endDotAlpha: function(value) {
		if(this._endDotAlpha == value) {
			return this._endDotAlpha;
		}
		this._endDotAlpha = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this._endDotAlpha;
	}
	,update: function() {
		var dataInvalid = this.isInvalid(feathers_core_InvalidationFlag.DATA);
		var sizeInvalid = this.isInvalid(feathers_core_InvalidationFlag.SIZE);
		if(this.measure()) {
			sizeInvalid = true;
		}
		if(dataInvalid || sizeInvalid) {
			this.drawSkin();
		}
	}
	,measure: function() {
		var needsWidth = this.get_explicitWidth() == null;
		var needsHeight = this.get_explicitHeight() == null;
		if(!needsWidth && !needsHeight) {
			return false;
		}
		var endDotRadius = this._dotRadius;
		if(this._endDotRadius != null) {
			endDotRadius = this._endDotRadius;
		}
		var maxDotRadius = Math.max(this.get_dotRadius(),endDotRadius);
		var newWidth = this.get_explicitWidth();
		if(needsWidth) {
			if(needsHeight) {
				newWidth = maxDotRadius * this._numDots;
			} else {
				newWidth = this.get_explicitHeight();
			}
		}
		var newHeight = this.get_explicitHeight();
		if(needsHeight) {
			if(needsHeight) {
				newHeight = maxDotRadius * this._numDots;
			} else {
				newHeight = this.get_explicitWidth();
			}
		}
		return this.saveMeasurements(newWidth,newHeight);
	}
	,drawSkin: function() {
		this.get_graphics().clear();
		if(this._numDots == 0) {
			return;
		}
		var radius = Math.min(this.actualWidth,this.actualHeight) / 2.0;
		var centerX = this.actualWidth / 2.0;
		var centerY = this.actualHeight / 2.0;
		var degreesPerSegment = 360.0 / this._numDots;
		var nearestAngle = feathers_utils_MathUtil.roundToNearest(this._indeterminatePosition * 360.0,degreesPerSegment);
		var endDotRadius = this._dotRadius;
		if(this._endDotRadius != null) {
			endDotRadius = this._endDotRadius;
		}
		var maxDotRadius = Math.max(this.get_dotRadius(),endDotRadius);
		var adjustScale = true;
		var adjustAlpha = true;
		this.get_graphics().beginFill(16711935,0.0);
		this.get_graphics().drawCircle(centerX,centerY,radius);
		this.get_graphics().endFill();
		var numEmptyDots = 0;
		if(this._numDots > this._numEmptyDots) {
			numEmptyDots = this._numEmptyDots;
		}
		var _g = 0;
		var _g1 = this._numDots;
		while(_g < _g1) {
			var i = _g++;
			var point = openfl_geom_Point.polar(radius - maxDotRadius,-i * 2.0 * Math.PI / this._numDots + nearestAngle * Math.PI / 180.0);
			var ratio = i / (this._numDots - numEmptyDots);
			var currentColor = this._dotColor;
			if(this._endDotColor != null && this._endDotColor != this._dotColor) {
				currentColor = this.blendColors(this._dotColor,this._endDotColor,ratio);
			}
			var currentAlpha = this._dotAlpha;
			if(adjustAlpha) {
				currentAlpha = this._dotAlpha - (this._dotAlpha - this._endDotAlpha) * ratio;
			}
			var currentRadius = this.get_dotRadius();
			if(adjustScale) {
				currentRadius = this.get_dotRadius() - (this.get_dotRadius() - endDotRadius) * ratio;
			}
			this.get_graphics().beginFill(currentColor,currentAlpha);
			this.get_graphics().drawCircle(centerX + point.x,centerY + point.y,currentRadius);
			this.get_graphics().endFill();
		}
	}
	,blendColors: function(color1,color2,ratio) {
		var r1 = color1 >>> 16 & 255;
		var g1 = color1 >>> 8 & 255;
		var b1 = color1 & 255;
		var r2 = color2 >>> 16 & 255;
		var g2 = color2 >>> 8 & 255;
		var b2 = color2 & 255;
		var r3 = r1 + ((r2 - r1) * ratio | 0);
		var g3 = g1 + ((g2 - g1) * ratio | 0);
		var b3 = b1 + ((b2 - b1) * ratio | 0);
		return r3 << 16 | g3 << 8 | b3;
	}
	,__class__: feathers_skins_activity_DotsActivitySkin
	,__properties__: $extend(feathers_skins_ProgrammaticSkin.prototype.__properties__,{set_endDotAlpha:"set_endDotAlpha",get_endDotAlpha:"get_endDotAlpha",set_dotAlpha:"set_dotAlpha",get_dotAlpha:"get_dotAlpha",set_endDotColor:"set_endDotColor",get_endDotColor:"get_endDotColor",set_dotColor:"set_dotColor",get_dotColor:"get_dotColor",set_endDotRadius:"set_endDotRadius",get_endDotRadius:"get_endDotRadius",set_dotRadius:"set_dotRadius",get_dotRadius:"get_dotRadius",set_numEmptyDots:"set_numEmptyDots",get_numEmptyDots:"get_numEmptyDots",set_numDots:"set_numDots",get_numDots:"get_numDots",set_indeterminatePosition:"set_indeterminatePosition",get_indeterminatePosition:"get_indeterminatePosition"})
});
var feathers_style_IStyleProvider = function() { };
$hxClasses["feathers.style.IStyleProvider"] = feathers_style_IStyleProvider;
feathers_style_IStyleProvider.__name__ = "feathers.style.IStyleProvider";
feathers_style_IStyleProvider.__isInterface__ = true;
feathers_style_IStyleProvider.__interfaces__ = [openfl_events_IEventDispatcher];
feathers_style_IStyleProvider.prototype = {
	applyStyles: null
	,__class__: feathers_style_IStyleProvider
};
var feathers_style_ClassVariantStyleProvider = function() {
	openfl_events_EventDispatcher.call(this);
};
$hxClasses["feathers.style.ClassVariantStyleProvider"] = feathers_style_ClassVariantStyleProvider;
feathers_style_ClassVariantStyleProvider.__name__ = "feathers.style.ClassVariantStyleProvider";
feathers_style_ClassVariantStyleProvider.__interfaces__ = [feathers_style_IStyleProvider];
feathers_style_ClassVariantStyleProvider.__super__ = openfl_events_EventDispatcher;
feathers_style_ClassVariantStyleProvider.prototype = $extend(openfl_events_EventDispatcher.prototype,{
	styleTargets: null
	,setStyleFunction: function(type,variant,callback) {
		var _gthis = this;
		if(this.styleTargets == null) {
			this.styleTargets = new haxe_ds_EnumValueMap();
		}
		var typeName = type.__name__;
		var styleTarget = variant == null ? feathers_style__$ClassVariantStyleProvider_StyleTarget.Class(typeName) : feathers_style__$ClassVariantStyleProvider_StyleTarget.ClassAndVariant(typeName,variant);
		if(callback == null) {
			if(!this.styleTargets.exists(styleTarget)) {
				return;
			}
			this.styleTargets.remove(styleTarget);
		} else {
			var oldCallback = this.styleTargets.get(styleTarget);
			if(callback == oldCallback || Reflect.compare(callback,oldCallback) == 0) {
				return;
			}
			this.styleTargets.set(styleTarget,callback);
		}
		feathers_events_StyleProviderEvent.dispatch(this,"stylesChange",function(target) {
			var styleContext = _gthis.getStyleContext(target);
			var variant = _gthis.getVariant(target);
			var otherCallback = _gthis.getStyleFunctionInternal(styleContext,variant,false);
			if(callback != otherCallback) {
				return Reflect.compare(callback,otherCallback) == 0;
			} else {
				return true;
			}
		});
	}
	,getStyleFunction: function(type,variant) {
		return this.getStyleFunctionInternal(type,variant,true);
	}
	,applyStyles: function(target) {
		if(this.styleTargets == null) {
			return;
		}
		var styleContext = this.getStyleContext(target);
		var variant = this.getVariant(target);
		var callback = this.getStyleFunctionInternal(styleContext,variant,false);
		if(callback == null) {
			return;
		}
		callback(target);
	}
	,getStyleContext: function(target) {
		var styleContext = null;
		if(js_Boot.__implements(target,feathers_style_IVariantStyleObject)) {
			var variantObject = target;
			styleContext = variantObject.get_styleContext();
		}
		if(styleContext == null) {
			styleContext = js_Boot.getClass(target);
		}
		return styleContext;
	}
	,getVariant: function(target) {
		var variant = null;
		if(js_Boot.__implements(target,feathers_style_IVariantStyleObject)) {
			var variantObject = target;
			variant = variantObject.get_variant();
		}
		return variant;
	}
	,getStyleFunctionInternal: function(type,variant,strict) {
		if(this.styleTargets == null) {
			return null;
		}
		var typeName = type.__name__;
		var styleTarget = variant == null ? feathers_style__$ClassVariantStyleProvider_StyleTarget.Class(typeName) : feathers_style__$ClassVariantStyleProvider_StyleTarget.ClassAndVariant(typeName,variant);
		var result = this.styleTargets.get(styleTarget);
		if(result != null || strict) {
			return result;
		}
		return this.styleTargets.get(feathers_style__$ClassVariantStyleProvider_StyleTarget.Class(typeName));
	}
	,__class__: feathers_style_ClassVariantStyleProvider
});
var feathers_style__$ClassVariantStyleProvider_StyleTarget = $hxEnums["feathers.style._ClassVariantStyleProvider.StyleTarget"] = { __ename__:"feathers.style._ClassVariantStyleProvider.StyleTarget",__constructs__:null
	,Class: ($_=function(type) { return {_hx_index:0,type:type,__enum__:"feathers.style._ClassVariantStyleProvider.StyleTarget",toString:$estr}; },$_._hx_name="Class",$_.__params__ = ["type"],$_)
	,ClassAndVariant: ($_=function(type,variant) { return {_hx_index:1,type:type,variant:variant,__enum__:"feathers.style._ClassVariantStyleProvider.StyleTarget",toString:$estr}; },$_._hx_name="ClassAndVariant",$_.__params__ = ["type","variant"],$_)
};
feathers_style__$ClassVariantStyleProvider_StyleTarget.__constructs__ = [feathers_style__$ClassVariantStyleProvider_StyleTarget.Class,feathers_style__$ClassVariantStyleProvider_StyleTarget.ClassAndVariant];
var feathers_style_Theme = function() { };
$hxClasses["feathers.style.Theme"] = feathers_style_Theme;
feathers_style_Theme.__name__ = "feathers.style.Theme";
feathers_style_Theme.__properties__ = {get_fallbackTheme:"get_fallbackTheme"};
feathers_style_Theme.get_fallbackTheme = function() {
	if(feathers_style_Theme._fallbackTheme == null) {
		feathers_style_Theme._fallbackTheme = new feathers_themes_steel_DefaultSteelTheme();
	}
	return feathers_style_Theme._fallbackTheme;
};
feathers_style_Theme.setTheme = function(theme,root,disposeOldTheme) {
	if(disposeOldTheme == null) {
		disposeOldTheme = true;
	}
	var oldTheme = null;
	if(root == null) {
		oldTheme = feathers_style_Theme.primaryTheme;
		feathers_style_Theme.primaryTheme = theme;
	} else if(feathers_style_Theme.roots == null) {
		feathers_style_Theme.roots = [root];
		var _g = new haxe_ds_ObjectMap();
		_g.set(root,theme);
		feathers_style_Theme.rootToTheme = _g;
	} else {
		oldTheme = feathers_style_Theme.rootToTheme.h[root.__id__];
		if(oldTheme == null) {
			feathers_style_Theme.roots.push(root);
		}
		feathers_style_Theme.rootToTheme.set(root,theme);
	}
	if(oldTheme != null && disposeOldTheme) {
		oldTheme.dispose();
	}
};
feathers_style_Theme.getTheme = function(object) {
	if(((object) instanceof openfl_display_DisplayObject)) {
		var current = object;
		while(current != null) {
			if(js_Boot.__implements(current,feathers_style_IStyleObject)) {
				var currentStylable = current;
				if(!currentStylable.get_themeEnabled()) {
					return null;
				}
			}
			current = current.parent;
		}
		if(feathers_style_Theme.roots != null) {
			var displayObject = object;
			var _g = 0;
			var _g1 = feathers_style_Theme.roots;
			while(_g < _g1.length) {
				var root = _g1[_g];
				++_g;
				if(root.contains(displayObject)) {
					return feathers_style_Theme.rootToTheme.h[root.__id__];
				}
			}
		}
	} else if(object != null && !object.get_themeEnabled()) {
		return null;
	}
	if(feathers_style_Theme.primaryTheme != null) {
		return feathers_style_Theme.primaryTheme;
	}
	return feathers_style_Theme.get_fallbackTheme();
};
var feathers_text_TextFormat = function(font,size,color,bold,italic,underline,url,target,align,leftMargin,rightMargin,indent,leading) {
	openfl_events_EventDispatcher.call(this);
	this._textFormat = new openfl_text_TextFormat(font,size,color,bold,italic,underline,url,target,align,leftMargin,rightMargin,indent,leading);
};
$hxClasses["feathers.text.TextFormat"] = feathers_text_TextFormat;
feathers_text_TextFormat.__name__ = "feathers.text.TextFormat";
feathers_text_TextFormat.__super__ = openfl_events_EventDispatcher;
feathers_text_TextFormat.prototype = $extend(openfl_events_EventDispatcher.prototype,{
	_textFormat: null
	,get_font: function() {
		return this._textFormat.font;
	}
	,set_font: function(value) {
		if(this._textFormat.font == value) {
			return this._textFormat.font;
		}
		this._textFormat = feathers_utils_TextFormatUtil.clone(this._textFormat);
		this._textFormat.set_font(value);
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._textFormat.font;
	}
	,get_size: function() {
		return this._textFormat.size;
	}
	,set_size: function(value) {
		if(this._textFormat.size == value) {
			return this._textFormat.size;
		}
		this._textFormat = feathers_utils_TextFormatUtil.clone(this._textFormat);
		this._textFormat.set_size(value);
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._textFormat.size;
	}
	,get_color: function() {
		return this._textFormat.color;
	}
	,set_color: function(value) {
		if(this._textFormat.color == value) {
			return this._textFormat.color;
		}
		this._textFormat = feathers_utils_TextFormatUtil.clone(this._textFormat);
		this._textFormat.color = value;
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._textFormat.color;
	}
	,get_bold: function() {
		return this._textFormat.bold;
	}
	,set_bold: function(value) {
		if(this._textFormat.bold == value) {
			return this._textFormat.bold;
		}
		this._textFormat = feathers_utils_TextFormatUtil.clone(this._textFormat);
		this._textFormat.set_bold(value);
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._textFormat.bold;
	}
	,get_italic: function() {
		return this._textFormat.italic;
	}
	,set_italic: function(value) {
		if(this._textFormat.italic == value) {
			return this._textFormat.italic;
		}
		this._textFormat = feathers_utils_TextFormatUtil.clone(this._textFormat);
		this._textFormat.set_italic(value);
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._textFormat.italic;
	}
	,get_underline: function() {
		return this._textFormat.underline;
	}
	,set_underline: function(value) {
		if(this._textFormat.underline == value) {
			return this._textFormat.underline;
		}
		this._textFormat = feathers_utils_TextFormatUtil.clone(this._textFormat);
		this._textFormat.underline = value;
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._textFormat.underline;
	}
	,get_url: function() {
		return this._textFormat.url;
	}
	,set_url: function(value) {
		if(this._textFormat.url == value) {
			return this._textFormat.url;
		}
		this._textFormat = feathers_utils_TextFormatUtil.clone(this._textFormat);
		this._textFormat.url = value;
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._textFormat.url;
	}
	,get_target: function() {
		return this._textFormat.target;
	}
	,set_target: function(value) {
		if(this._textFormat.target == value) {
			return this._textFormat.target;
		}
		this._textFormat = feathers_utils_TextFormatUtil.clone(this._textFormat);
		this._textFormat.target = value;
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._textFormat.target;
	}
	,get_align: function() {
		return this._textFormat.align;
	}
	,set_align: function(value) {
		if(this._textFormat.align == value) {
			return this._textFormat.align;
		}
		this._textFormat = feathers_utils_TextFormatUtil.clone(this._textFormat);
		this._textFormat.align = value;
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._textFormat.align;
	}
	,get_leftMargin: function() {
		return this._textFormat.leftMargin;
	}
	,set_leftMargin: function(value) {
		if(this._textFormat.leftMargin == value) {
			return this._textFormat.leftMargin;
		}
		this._textFormat = feathers_utils_TextFormatUtil.clone(this._textFormat);
		this._textFormat.leftMargin = value;
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._textFormat.leftMargin;
	}
	,get_rightMargin: function() {
		return this._textFormat.rightMargin;
	}
	,set_rightMargin: function(value) {
		if(this._textFormat.rightMargin == value) {
			return this._textFormat.rightMargin;
		}
		this._textFormat = feathers_utils_TextFormatUtil.clone(this._textFormat);
		this._textFormat.rightMargin = value;
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._textFormat.rightMargin;
	}
	,get_indent: function() {
		return this._textFormat.indent;
	}
	,set_indent: function(value) {
		if(this._textFormat.indent == value) {
			return this._textFormat.indent;
		}
		this._textFormat = feathers_utils_TextFormatUtil.clone(this._textFormat);
		this._textFormat.indent = value;
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._textFormat.indent;
	}
	,get_leading: function() {
		return this._textFormat.leading;
	}
	,set_leading: function(value) {
		if(this._textFormat.leading == value) {
			return this._textFormat.leading;
		}
		this._textFormat = feathers_utils_TextFormatUtil.clone(this._textFormat);
		this._textFormat.leading = value;
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._textFormat.leading;
	}
	,get_blockIndent: function() {
		return this._textFormat.blockIndent;
	}
	,set_blockIndent: function(value) {
		if(this._textFormat.blockIndent == value) {
			return this._textFormat.blockIndent;
		}
		this._textFormat = feathers_utils_TextFormatUtil.clone(this._textFormat);
		this._textFormat.blockIndent = value;
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._textFormat.blockIndent;
	}
	,get_bullet: function() {
		return this._textFormat.bullet;
	}
	,set_bullet: function(value) {
		if(this._textFormat.bullet == value) {
			return this._textFormat.bullet;
		}
		this._textFormat = feathers_utils_TextFormatUtil.clone(this._textFormat);
		this._textFormat.bullet = value;
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._textFormat.bullet;
	}
	,get_kerning: function() {
		return this._textFormat.kerning;
	}
	,set_kerning: function(value) {
		if(this._textFormat.kerning == value) {
			return this._textFormat.kerning;
		}
		this._textFormat = feathers_utils_TextFormatUtil.clone(this._textFormat);
		this._textFormat.kerning = value;
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._textFormat.kerning;
	}
	,get_letterSpacing: function() {
		return this._textFormat.letterSpacing;
	}
	,set_letterSpacing: function(value) {
		if(this._textFormat.letterSpacing == value) {
			return this._textFormat.letterSpacing;
		}
		this._textFormat = feathers_utils_TextFormatUtil.clone(this._textFormat);
		this._textFormat.letterSpacing = value;
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._textFormat.letterSpacing;
	}
	,get_tabStops: function() {
		return this._textFormat.tabStops;
	}
	,set_tabStops: function(value) {
		if(this._textFormat.tabStops == value) {
			return this._textFormat.tabStops;
		}
		this._textFormat = feathers_utils_TextFormatUtil.clone(this._textFormat);
		this._textFormat.tabStops = value;
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._textFormat.tabStops;
	}
	,clone: function() {
		var clone = new feathers_text_TextFormat(this.get_font(),this.get_size(),this.get_color(),this.get_bold(),this.get_italic(),this.get_underline(),this.get_url(),this.get_target(),this.get_align(),this.get_leftMargin(),this.get_rightMargin(),this.get_indent(),this.get_leading());
		clone._textFormat.blockIndent = this.get_blockIndent();
		clone._textFormat.bullet = this.get_bullet();
		clone._textFormat.kerning = this.get_kerning();
		clone._textFormat.letterSpacing = this.get_letterSpacing();
		clone._textFormat.tabStops = this.get_tabStops();
		return clone;
	}
	,toSimpleTextFormat: function() {
		return this._textFormat;
	}
	,__class__: feathers_text_TextFormat
	,__properties__: {set_tabStops:"set_tabStops",get_tabStops:"get_tabStops",set_letterSpacing:"set_letterSpacing",get_letterSpacing:"get_letterSpacing",set_kerning:"set_kerning",get_kerning:"get_kerning",set_bullet:"set_bullet",get_bullet:"get_bullet",set_blockIndent:"set_blockIndent",get_blockIndent:"get_blockIndent",set_leading:"set_leading",get_leading:"get_leading",set_indent:"set_indent",get_indent:"get_indent",set_rightMargin:"set_rightMargin",get_rightMargin:"get_rightMargin",set_leftMargin:"set_leftMargin",get_leftMargin:"get_leftMargin",set_align:"set_align",get_align:"get_align",set_target:"set_target",get_target:"get_target",set_url:"set_url",get_url:"get_url",set_underline:"set_underline",get_underline:"get_underline",set_italic:"set_italic",get_italic:"get_italic",set_bold:"set_bold",get_bold:"get_bold",set_color:"set_color",get_color:"get_color",set_size:"set_size",get_size:"get_size",set_font:"set_font",get_font:"get_font"}
});
var feathers_text_AbstractTextFormat = {};
feathers_text_AbstractTextFormat.fromSimpleTextFormat = function(textFormat) {
	var clone = new feathers_text_TextFormat(textFormat.font,textFormat.size,textFormat.color,textFormat.bold,textFormat.italic,textFormat.underline,textFormat.url,textFormat.target,textFormat.align,textFormat.leftMargin,textFormat.rightMargin,textFormat.indent,textFormat.leading);
	clone.set_blockIndent(textFormat.blockIndent);
	clone.set_bullet(textFormat.bullet);
	clone.set_kerning(textFormat.kerning);
	clone.set_letterSpacing(textFormat.letterSpacing);
	clone.set_tabStops(textFormat.tabStops);
	return clone;
};
feathers_text_AbstractTextFormat.toSimpleTextFormat = function(this1) {
	return this1.toSimpleTextFormat();
};
var feathers_themes_steel_DefaultSteelTheme = function(themeColor,darkThemeColor) {
	feathers_themes_steel_BaseSteelTheme.call(this,themeColor,darkThemeColor);
};
$hxClasses["feathers.themes.steel.DefaultSteelTheme"] = feathers_themes_steel_DefaultSteelTheme;
feathers_themes_steel_DefaultSteelTheme.__name__ = "feathers.themes.steel.DefaultSteelTheme";
feathers_themes_steel_DefaultSteelTheme.__super__ = feathers_themes_steel_BaseSteelTheme;
feathers_themes_steel_DefaultSteelTheme.prototype = $extend(feathers_themes_steel_BaseSteelTheme.prototype,{
	__class__: feathers_themes_steel_DefaultSteelTheme
});
var feathers_themes_steel_components_SteelActivityIndicatorStyles = function() { };
$hxClasses["feathers.themes.steel.components.SteelActivityIndicatorStyles"] = feathers_themes_steel_components_SteelActivityIndicatorStyles;
feathers_themes_steel_components_SteelActivityIndicatorStyles.__name__ = "feathers.themes.steel.components.SteelActivityIndicatorStyles";
feathers_themes_steel_components_SteelActivityIndicatorStyles.initialize = function(theme) {
	if(theme == null) {
		var value = feathers_style_Theme.get_fallbackTheme();
		theme = ((value) instanceof feathers_themes_steel_BaseSteelTheme) ? value : null;
	}
	if(theme == null) {
		return;
	}
	var styleProvider = theme.styleProvider;
	if(styleProvider.getStyleFunction(feathers_controls_ActivityIndicator,null) == null) {
		styleProvider.setStyleFunction(feathers_controls_ActivityIndicator,null,function(indicator) {
			if(indicator.get_activitySkin() == null) {
				var activitySkin = new feathers_skins_activity_DotsActivitySkin();
				activitySkin.set_numDots(8);
				activitySkin.set_dotRadius(3.0);
				activitySkin.set_endDotRadius(null);
				activitySkin.set_dotColor(theme.textColor);
				activitySkin.set_endDotColor(null);
				activitySkin.set_dotAlpha(1.0);
				activitySkin.set_endDotAlpha(0.0);
				var size = 1.1 * activitySkin.get_dotRadius() * activitySkin.get_numDots();
				activitySkin.set_width(size);
				activitySkin.set_height(size);
				indicator.set_activitySkin(activitySkin);
			}
		});
	}
};
var feathers_themes_steel_components_SteelAlertStyles = function() { };
$hxClasses["feathers.themes.steel.components.SteelAlertStyles"] = feathers_themes_steel_components_SteelAlertStyles;
feathers_themes_steel_components_SteelAlertStyles.__name__ = "feathers.themes.steel.components.SteelAlertStyles";
feathers_themes_steel_components_SteelAlertStyles.initialize = function(theme) {
	if(theme == null) {
		var value = feathers_style_Theme.get_fallbackTheme();
		theme = ((value) instanceof feathers_themes_steel_BaseSteelTheme) ? value : null;
	}
	if(theme == null) {
		return;
	}
	var styleProvider = theme.styleProvider;
	if(styleProvider.getStyleFunction(feathers_controls_Alert,null) == null) {
		styleProvider.setStyleFunction(feathers_controls_Alert,null,function(alert) {
			var isDesktop = feathers_utils_DeviceUtil.isDesktop();
			alert.set_autoHideScrollBars(!isDesktop);
			alert.set_fixedScrollBars(isDesktop);
			if(alert.get_backgroundSkin() == null) {
				var backgroundSkin = new feathers_skins_RectangleSkin();
				backgroundSkin.set_border(feathers_graphics_LineStyle.None);
				backgroundSkin.set_fill(theme.getContainerFill());
				backgroundSkin.set_maxWidth(276.0);
				alert.set_backgroundSkin(backgroundSkin);
			}
			if(alert.get_layout() == null) {
				var layout = new feathers_layout_HorizontalLayout();
				layout.set_paddingTop(theme.largePadding);
				layout.set_paddingRight(theme.largePadding);
				layout.set_paddingBottom(theme.largePadding);
				layout.set_paddingLeft(theme.largePadding);
				layout.set_gap(theme.mediumPadding);
				layout.set_percentWidthResetEnabled(true);
				alert.set_layout(layout);
			}
		});
	}
	if(styleProvider.getStyleFunction(feathers_controls_ButtonBar,feathers_controls_Alert.CHILD_VARIANT_BUTTON_BAR) == null) {
		styleProvider.setStyleFunction(feathers_controls_ButtonBar,feathers_controls_Alert.CHILD_VARIANT_BUTTON_BAR,function(buttonBar) {
			if(buttonBar.get_layout() == null) {
				var layout = new feathers_layout_HorizontalDistributedLayout();
				layout.set_paddingTop(theme.largePadding);
				layout.set_paddingRight(theme.largePadding);
				layout.set_paddingBottom(theme.largePadding);
				layout.set_paddingLeft(theme.largePadding);
				layout.set_gap(theme.mediumPadding);
				buttonBar.set_layout(layout);
			}
		});
	}
	if(styleProvider.getStyleFunction(feathers_controls_Label,feathers_controls_Alert.CHILD_VARIANT_MESSAGE_LABEL) == null) {
		styleProvider.setStyleFunction(feathers_controls_Label,feathers_controls_Alert.CHILD_VARIANT_MESSAGE_LABEL,function(label) {
			if(label.get_textFormat() == null) {
				label.set_textFormat(theme.getTextFormat());
			}
			if(label.get_disabledTextFormat() == null) {
				label.set_disabledTextFormat(theme.getDisabledTextFormat());
			}
			if(label.get_layoutData() == null) {
				label.set_layoutData(feathers_layout_HorizontalLayoutData.fillHorizontal());
			}
			label.set_wordWrap(true);
		});
	}
};
var feathers_themes_steel_components_SteelApplicationStyles = function() { };
$hxClasses["feathers.themes.steel.components.SteelApplicationStyles"] = feathers_themes_steel_components_SteelApplicationStyles;
feathers_themes_steel_components_SteelApplicationStyles.__name__ = "feathers.themes.steel.components.SteelApplicationStyles";
feathers_themes_steel_components_SteelApplicationStyles.initialize = function(theme) {
	if(theme == null) {
		var value = feathers_style_Theme.get_fallbackTheme();
		theme = ((value) instanceof feathers_themes_steel_BaseSteelTheme) ? value : null;
	}
	if(theme == null) {
		return;
	}
	var styleProvider = theme.styleProvider;
	if(styleProvider.getStyleFunction(feathers_controls_Application,null) == null) {
		styleProvider.setStyleFunction(feathers_controls_Application,null,function(app) {
			if(app.get_scaleManager() == null) {
				app.set_scaleManager(new feathers_core_ScreenDensityScaleManager());
			}
		});
	}
};
feathers_themes_steel_components_SteelApplicationStyles.refreshStageColor = function(stage,theme) {
	if(stage == null) {
		return;
	}
	stage.set_color(theme.rootFillColor);
};
var feathers_themes_steel_components_SteelButtonBarStyles = function() { };
$hxClasses["feathers.themes.steel.components.SteelButtonBarStyles"] = feathers_themes_steel_components_SteelButtonBarStyles;
feathers_themes_steel_components_SteelButtonBarStyles.__name__ = "feathers.themes.steel.components.SteelButtonBarStyles";
feathers_themes_steel_components_SteelButtonBarStyles.initialize = function(theme) {
	if(theme == null) {
		var value = feathers_style_Theme.get_fallbackTheme();
		theme = ((value) instanceof feathers_themes_steel_BaseSteelTheme) ? value : null;
	}
	if(theme == null) {
		return;
	}
	var styleProvider = theme.styleProvider;
	if(styleProvider.getStyleFunction(feathers_controls_ButtonBar,null) == null) {
		styleProvider.setStyleFunction(feathers_controls_ButtonBar,null,function(buttonBar) {
			if(buttonBar.get_layout() == null) {
				var layout = new feathers_layout_HorizontalLayout();
				layout.set_gap(theme.mediumPadding);
				buttonBar.set_layout(layout);
			}
		});
	}
};
var feathers_themes_steel_components_SteelButtonStyles = function() { };
$hxClasses["feathers.themes.steel.components.SteelButtonStyles"] = feathers_themes_steel_components_SteelButtonStyles;
feathers_themes_steel_components_SteelButtonStyles.__name__ = "feathers.themes.steel.components.SteelButtonStyles";
feathers_themes_steel_components_SteelButtonStyles.initialize = function(theme) {
	if(theme == null) {
		var value = feathers_style_Theme.get_fallbackTheme();
		theme = ((value) instanceof feathers_themes_steel_BaseSteelTheme) ? value : null;
	}
	if(theme == null) {
		return;
	}
	var styleProvider = theme.styleProvider;
	if(styleProvider.getStyleFunction(feathers_controls_Button,null) == null) {
		styleProvider.setStyleFunction(feathers_controls_Button,null,function(button) {
			if(button.get_backgroundSkin() == null) {
				var skin = new feathers_skins_RectangleSkin();
				skin.set_fill(theme.getButtonFill());
				skin.set_disabledFill(theme.getButtonDisabledFill());
				skin.setFillForState(feathers_controls_ButtonState.DOWN,theme.getReversedActiveThemeFill());
				skin.set_border(theme.getButtonBorder());
				skin.set_disabledBorder(theme.getButtonDisabledBorder());
				skin.setBorderForState(feathers_controls_ButtonState.DOWN,theme.getActiveFillBorder());
				skin.set_cornerRadius(3.0);
				button.set_backgroundSkin(skin);
			}
			if(button.get_focusRectSkin() == null) {
				var focusRectSkin = new feathers_skins_RectangleSkin();
				focusRectSkin.set_fill(feathers_graphics_FillStyle.None);
				focusRectSkin.set_border(theme.getFocusBorder());
				focusRectSkin.set_cornerRadius(3.0);
				button.set_focusRectSkin(focusRectSkin);
			}
			if(button.get_textFormat() == null) {
				button.set_textFormat(theme.getTextFormat());
			}
			if(button.get_disabledTextFormat() == null) {
				button.set_disabledTextFormat(theme.getDisabledTextFormat());
			}
			button.set_paddingTop(theme.smallPadding);
			button.set_paddingRight(theme.largePadding);
			button.set_paddingBottom(theme.smallPadding);
			button.set_paddingLeft(theme.largePadding);
			button.set_gap(theme.smallPadding);
		});
	}
	if(styleProvider.getStyleFunction(feathers_controls_Button,feathers_controls_Button.VARIANT_PRIMARY) == null) {
		styleProvider.setStyleFunction(feathers_controls_Button,feathers_controls_Button.VARIANT_PRIMARY,function(button) {
			if(button.get_backgroundSkin() == null) {
				var skin = new feathers_skins_RectangleSkin();
				skin.set_fill(theme.getActiveThemeFill());
				skin.set_disabledFill(theme.getButtonDisabledFill());
				skin.setFillForState(feathers_controls_ButtonState.DOWN,theme.getReversedActiveThemeFill());
				skin.set_border(theme.getActiveFillBorder());
				skin.set_disabledBorder(theme.getButtonDisabledBorder());
				skin.set_cornerRadius(3.0);
				button.set_backgroundSkin(skin);
			}
			if(button.get_focusRectSkin() == null) {
				var focusRectSkin = new feathers_skins_RectangleSkin();
				focusRectSkin.set_fill(feathers_graphics_FillStyle.None);
				focusRectSkin.set_border(theme.getFocusBorder());
				focusRectSkin.set_cornerRadius(3.0);
				button.set_focusRectSkin(focusRectSkin);
			}
			if(button.get_textFormat() == null) {
				button.set_textFormat(theme.getTextFormat());
			}
			if(button.get_disabledTextFormat() == null) {
				button.set_disabledTextFormat(theme.getDisabledTextFormat());
			}
			button.set_paddingTop(theme.smallPadding);
			button.set_paddingRight(theme.largePadding);
			button.set_paddingBottom(theme.smallPadding);
			button.set_paddingLeft(theme.largePadding);
			button.set_gap(theme.smallPadding);
		});
	}
	if(styleProvider.getStyleFunction(feathers_controls_Button,feathers_controls_Button.VARIANT_DANGER) == null) {
		styleProvider.setStyleFunction(feathers_controls_Button,feathers_controls_Button.VARIANT_DANGER,function(button) {
			if(button.get_backgroundSkin() == null) {
				var skin = new feathers_skins_RectangleSkin();
				skin.set_fill(theme.getDangerFill());
				skin.set_disabledFill(theme.getButtonDisabledFill());
				skin.setFillForState(feathers_controls_ButtonState.DOWN,theme.getReversedDangerFill());
				skin.set_border(theme.getDangerBorder());
				skin.set_disabledBorder(theme.getButtonDisabledBorder());
				skin.set_cornerRadius(3.0);
				button.set_backgroundSkin(skin);
			}
			if(button.get_focusRectSkin() == null) {
				var focusRectSkin = new feathers_skins_RectangleSkin();
				focusRectSkin.set_fill(feathers_graphics_FillStyle.None);
				focusRectSkin.set_border(theme.getFocusBorder());
				focusRectSkin.set_cornerRadius(3.0);
				button.set_focusRectSkin(focusRectSkin);
			}
			if(button.get_textFormat() == null) {
				button.set_textFormat(theme.getTextFormat());
			}
			if(button.get_disabledTextFormat() == null) {
				button.set_disabledTextFormat(theme.getDisabledTextFormat());
			}
			button.set_paddingTop(theme.smallPadding);
			button.set_paddingRight(theme.largePadding);
			button.set_paddingBottom(theme.smallPadding);
			button.set_paddingLeft(theme.largePadding);
			button.set_gap(theme.smallPadding);
		});
	}
};
var feathers_themes_steel_components_SteelCalloutStyles = function() { };
$hxClasses["feathers.themes.steel.components.SteelCalloutStyles"] = feathers_themes_steel_components_SteelCalloutStyles;
feathers_themes_steel_components_SteelCalloutStyles.__name__ = "feathers.themes.steel.components.SteelCalloutStyles";
feathers_themes_steel_components_SteelCalloutStyles.initialize = function(theme) {
	if(theme == null) {
		var value = feathers_style_Theme.get_fallbackTheme();
		theme = ((value) instanceof feathers_themes_steel_BaseSteelTheme) ? value : null;
	}
	if(theme == null) {
		return;
	}
	var styleProvider = theme.styleProvider;
	if(styleProvider.getStyleFunction(feathers_controls_Callout,null) == null) {
		styleProvider.setStyleFunction(feathers_controls_Callout,null,function(callout) {
			if(callout.get_backgroundSkin() == null) {
				var backgroundSkin = new feathers_skins_RectangleSkin();
				backgroundSkin.set_fill(theme.getContainerFill());
				backgroundSkin.set_border(theme.getContainerBorder());
				callout.set_backgroundSkin(backgroundSkin);
			}
			if(callout.get_topArrowSkin() == null) {
				var topArrowSkin = new feathers_skins_TriangleSkin();
				topArrowSkin.set_pointPosition(feathers_layout_RelativePosition.TOP);
				topArrowSkin.set_drawBaseBorder(false);
				topArrowSkin.set_fill(theme.getContainerFill());
				topArrowSkin.set_border(theme.getContainerBorder());
				topArrowSkin.set_width(14.0);
				topArrowSkin.set_height(8.0);
				callout.set_topArrowSkin(topArrowSkin);
			}
			if(callout.get_rightArrowSkin() == null) {
				var rightArrowSkin = new feathers_skins_TriangleSkin();
				rightArrowSkin.set_pointPosition(feathers_layout_RelativePosition.RIGHT);
				rightArrowSkin.set_drawBaseBorder(false);
				rightArrowSkin.set_fill(theme.getContainerFill());
				rightArrowSkin.set_border(theme.getContainerBorder());
				rightArrowSkin.set_width(8.0);
				rightArrowSkin.set_height(14.0);
				callout.set_rightArrowSkin(rightArrowSkin);
			}
			if(callout.get_bottomArrowSkin() == null) {
				var bottomArrowSkin = new feathers_skins_TriangleSkin();
				bottomArrowSkin.set_pointPosition(feathers_layout_RelativePosition.BOTTOM);
				bottomArrowSkin.set_drawBaseBorder(false);
				bottomArrowSkin.set_fill(theme.getContainerFill());
				bottomArrowSkin.set_border(theme.getContainerBorder());
				bottomArrowSkin.set_width(14.0);
				bottomArrowSkin.set_height(8.0);
				callout.set_bottomArrowSkin(bottomArrowSkin);
			}
			if(callout.get_leftArrowSkin() == null) {
				var leftArrowSkin = new feathers_skins_TriangleSkin();
				leftArrowSkin.set_pointPosition(feathers_layout_RelativePosition.LEFT);
				leftArrowSkin.set_drawBaseBorder(false);
				leftArrowSkin.set_fill(theme.getContainerFill());
				leftArrowSkin.set_border(theme.getContainerBorder());
				leftArrowSkin.set_width(8.0);
				leftArrowSkin.set_height(14.0);
				callout.set_leftArrowSkin(leftArrowSkin);
			}
			callout.set_topArrowGap(-theme.borderThickness);
			callout.set_rightArrowGap(-theme.borderThickness);
			callout.set_bottomArrowGap(-theme.borderThickness);
			callout.set_leftArrowGap(-theme.borderThickness);
			callout.set_paddingTop(theme.borderThickness);
			callout.set_paddingRight(theme.borderThickness);
			callout.set_paddingBottom(theme.borderThickness);
			callout.set_paddingLeft(theme.borderThickness);
			callout.set_marginTop(theme.xlargePadding);
			callout.set_marginRight(theme.xlargePadding);
			callout.set_marginBottom(theme.xlargePadding);
			callout.set_marginLeft(theme.xlargePadding);
		});
	}
};
var feathers_themes_steel_components_SteelCheckStyles = function() { };
$hxClasses["feathers.themes.steel.components.SteelCheckStyles"] = feathers_themes_steel_components_SteelCheckStyles;
feathers_themes_steel_components_SteelCheckStyles.__name__ = "feathers.themes.steel.components.SteelCheckStyles";
feathers_themes_steel_components_SteelCheckStyles.initialize = function(theme) {
	if(theme == null) {
		var value = feathers_style_Theme.get_fallbackTheme();
		theme = ((value) instanceof feathers_themes_steel_BaseSteelTheme) ? value : null;
	}
	if(theme == null) {
		return;
	}
	var styleProvider = theme.styleProvider;
	if(styleProvider.getStyleFunction(feathers_controls_Check,null) == null) {
		styleProvider.setStyleFunction(feathers_controls_Check,null,function(check) {
			var isDesktop = feathers_utils_DeviceUtil.isDesktop();
			if(check.get_textFormat() == null) {
				check.set_textFormat(theme.getTextFormat());
			}
			if(check.get_disabledTextFormat() == null) {
				check.set_disabledTextFormat(theme.getDisabledTextFormat());
			}
			if(check.get_backgroundSkin() == null) {
				var backgroundSkin = new feathers_skins_RectangleSkin();
				backgroundSkin.set_fill(feathers_graphics_FillStyle.SolidColor(0,0.0));
				backgroundSkin.set_border(feathers_graphics_LineStyle.None);
				check.set_backgroundSkin(backgroundSkin);
			}
			if(check.get_icon() == null) {
				var icon = new feathers_skins_MultiSkin();
				check.set_icon(icon);
				var defaultIcon = new feathers_skins_RectangleSkin();
				if(isDesktop) {
					defaultIcon.set_width(16.0);
					defaultIcon.set_height(16.0);
					defaultIcon.set_minWidth(16.0);
					defaultIcon.set_minHeight(16.0);
				} else {
					defaultIcon.set_width(20.0);
					defaultIcon.set_height(20.0);
					defaultIcon.set_minWidth(20.0);
					defaultIcon.set_minHeight(20.0);
				}
				defaultIcon.set_border(theme.getInsetBorder());
				defaultIcon.set_disabledBorder(theme.getDisabledInsetBorder());
				defaultIcon.setBorderForState(feathers_controls_ToggleButtonState.DOWN(false),theme.getSelectedInsetBorder());
				defaultIcon.set_fill(theme.getInsetFill());
				defaultIcon.set_disabledFill(theme.getDisabledInsetFill());
				icon.set_defaultView(defaultIcon);
				var selectedIcon = new feathers_skins_RectangleSkin();
				if(isDesktop) {
					selectedIcon.set_width(16.0);
					selectedIcon.set_height(16.0);
					selectedIcon.set_minWidth(16.0);
					selectedIcon.set_minHeight(16.0);
				} else {
					selectedIcon.set_width(20.0);
					selectedIcon.set_height(20.0);
					selectedIcon.set_minWidth(20.0);
					selectedIcon.set_minHeight(20.0);
				}
				selectedIcon.set_border(theme.getSelectedInsetBorder());
				selectedIcon.set_disabledBorder(theme.getDisabledInsetBorder());
				selectedIcon.setBorderForState(feathers_controls_ToggleButtonState.DOWN(true),theme.getSelectedInsetBorder());
				selectedIcon.set_fill(theme.getReversedActiveThemeFill());
				selectedIcon.set_disabledFill(theme.getDisabledInsetFill());
				var checkMark = new openfl_display_Shape();
				if(isDesktop) {
					checkMark.get_graphics().beginFill(theme.textColor);
					checkMark.get_graphics().drawRect(-1.0,-8.0,3.0,11.0);
					checkMark.get_graphics().endFill();
					checkMark.get_graphics().beginFill(theme.textColor);
					checkMark.get_graphics().drawRect(-4.0,0.0,5.0,3.0);
					checkMark.get_graphics().endFill();
					checkMark.set_x(7.0);
					checkMark.set_y(9.0);
				} else {
					checkMark.get_graphics().beginFill(theme.textColor);
					checkMark.get_graphics().drawRect(-1.0,-8.0,3.0,14.0);
					checkMark.get_graphics().endFill();
					checkMark.get_graphics().beginFill(theme.textColor);
					checkMark.get_graphics().drawRect(-5.0,3.0,5.0,3.0);
					checkMark.get_graphics().endFill();
					checkMark.set_x(10.0);
					checkMark.set_y(10.0);
				}
				checkMark.set_rotation(45.0);
				selectedIcon.addChild(checkMark);
				icon.set_selectedView(selectedIcon);
				var disabledAndSelectedIcon = new feathers_skins_RectangleSkin();
				disabledAndSelectedIcon.set_width(20.0);
				disabledAndSelectedIcon.set_height(20.0);
				disabledAndSelectedIcon.set_minWidth(20.0);
				disabledAndSelectedIcon.set_minHeight(20.0);
				disabledAndSelectedIcon.set_border(theme.getDisabledInsetBorder());
				disabledAndSelectedIcon.set_fill(theme.getDisabledInsetFill());
				var disabledCheckMark = new openfl_display_Shape();
				disabledCheckMark.get_graphics().beginFill(theme.disabledTextColor);
				disabledCheckMark.get_graphics().drawRect(-1.0,-8.0,3.0,14.0);
				disabledCheckMark.get_graphics().endFill();
				disabledCheckMark.get_graphics().beginFill(theme.disabledTextColor);
				disabledCheckMark.get_graphics().drawRect(-5.0,3.0,5.0,3.0);
				disabledCheckMark.get_graphics().endFill();
				disabledCheckMark.set_rotation(45.0);
				disabledCheckMark.set_x(10.0);
				disabledCheckMark.set_y(10.0);
				disabledAndSelectedIcon.addChild(disabledCheckMark);
				icon.setViewForState(feathers_controls_ToggleButtonState.DISABLED(true),disabledAndSelectedIcon);
			}
			if(check.get_focusRectSkin() == null) {
				var focusRectSkin = new feathers_skins_RectangleSkin();
				focusRectSkin.set_fill(feathers_graphics_FillStyle.None);
				focusRectSkin.set_border(theme.getFocusBorder());
				focusRectSkin.set_cornerRadius(3.0);
				check.set_focusRectSkin(focusRectSkin);
				check.set_focusPaddingTop(3.0);
				check.set_focusPaddingRight(3.0);
				check.set_focusPaddingBottom(3.0);
				check.set_focusPaddingLeft(3.0);
			}
			check.set_horizontalAlign(feathers_layout_HorizontalAlign.LEFT);
			check.set_gap(theme.smallPadding);
		});
	}
};
var feathers_themes_steel_components_SteelCollapsibleStyles = function() { };
$hxClasses["feathers.themes.steel.components.SteelCollapsibleStyles"] = feathers_themes_steel_components_SteelCollapsibleStyles;
feathers_themes_steel_components_SteelCollapsibleStyles.__name__ = "feathers.themes.steel.components.SteelCollapsibleStyles";
feathers_themes_steel_components_SteelCollapsibleStyles.initialize = function(theme) {
	if(theme == null) {
		var value = feathers_style_Theme.get_fallbackTheme();
		theme = ((value) instanceof feathers_themes_steel_BaseSteelTheme) ? value : null;
	}
	if(theme == null) {
		return;
	}
	var styleProvider = theme.styleProvider;
	if(styleProvider.getStyleFunction(feathers_controls_ToggleButton,feathers_controls_Collapsible.CHILD_VARIANT_HEADER) == null) {
		styleProvider.setStyleFunction(feathers_controls_ToggleButton,feathers_controls_Collapsible.CHILD_VARIANT_HEADER,function(button) {
			var isDesktop = feathers_utils_DeviceUtil.isDesktop();
			if(button.get_backgroundSkin() == null) {
				var skin = new feathers_skins_RectangleSkin();
				skin.set_fill(theme.getButtonFill());
				skin.set_disabledFill(theme.getButtonDisabledFill());
				skin.setFillForState(feathers_controls_ToggleButtonState.DOWN(false),theme.getReversedActiveThemeFill());
				skin.setFillForState(feathers_controls_ToggleButtonState.DOWN(true),theme.getReversedActiveThemeFill());
				skin.set_border(theme.getButtonBorder());
				skin.set_disabledBorder(theme.getButtonDisabledBorder());
				skin.setBorderForState(feathers_controls_ToggleButtonState.DOWN(false),theme.getActiveFillBorder());
				skin.setBorderForState(feathers_controls_ToggleButtonState.DOWN(true),theme.getActiveFillBorder());
				skin.set_cornerRadius(0.0);
				skin.set_minWidth(22.0);
				skin.set_minHeight(22.0);
				button.set_backgroundSkin(skin);
			}
			if(button.get_icon() == null) {
				var icon = new feathers_skins_MultiSkin();
				button.set_icon(icon);
				var defaultIcon = new openfl_display_Shape();
				feathers_themes_steel_components_SteelCollapsibleStyles.drawDisclosureClosedIcon(defaultIcon,theme.textColor,isDesktop);
				icon.set_defaultView(defaultIcon);
				var disabledIcon = new openfl_display_Shape();
				feathers_themes_steel_components_SteelCollapsibleStyles.drawDisclosureClosedIcon(disabledIcon,theme.disabledTextColor,isDesktop);
				icon.set_disabledView(disabledIcon);
				var selectedIcon = new openfl_display_Shape();
				feathers_themes_steel_components_SteelCollapsibleStyles.drawDisclosureOpenIcon(selectedIcon,theme.textColor,isDesktop);
				icon.set_selectedView(selectedIcon);
				var selectedDisabledIcon = new openfl_display_Shape();
				feathers_themes_steel_components_SteelCollapsibleStyles.drawDisclosureOpenIcon(selectedDisabledIcon,theme.disabledTextColor,isDesktop);
				icon.setViewForState(feathers_controls_ToggleButtonState.DISABLED(true),selectedDisabledIcon);
			}
			if(button.get_textFormat() == null) {
				button.set_textFormat(theme.getTextFormat());
			}
			if(button.get_disabledTextFormat() == null) {
				button.set_disabledTextFormat(theme.getDisabledTextFormat());
			}
			if(isDesktop) {
				button.set_paddingTop(theme.smallPadding);
				button.set_paddingRight(theme.mediumPadding);
				button.set_paddingBottom(theme.smallPadding);
				button.set_paddingLeft(theme.mediumPadding);
			} else {
				button.set_paddingTop(theme.smallPadding);
				button.set_paddingRight(theme.largePadding);
				button.set_paddingBottom(theme.smallPadding);
				button.set_paddingLeft(theme.largePadding);
			}
			button.set_gap(1.0 / 0.0);
			button.set_minGap(theme.smallPadding);
			button.set_iconPosition(feathers_layout_RelativePosition.RIGHT);
			button.set_horizontalAlign(feathers_layout_HorizontalAlign.LEFT);
			button.set_verticalAlign(feathers_layout_VerticalAlign.MIDDLE);
		});
	}
};
feathers_themes_steel_components_SteelCollapsibleStyles.drawDisclosureClosedIcon = function(icon,color,isDesktop) {
	icon.get_graphics().beginFill(16711935,0.0);
	if(isDesktop) {
		icon.get_graphics().drawRect(0.0,0.0,16.0,16.0);
	} else {
		icon.get_graphics().drawRect(0.0,0.0,20.0,20.0);
	}
	icon.get_graphics().endFill();
	icon.get_graphics().beginFill(color);
	if(isDesktop) {
		icon.get_graphics().moveTo(4.0,6.0);
		icon.get_graphics().lineTo(12.0,6.0);
		icon.get_graphics().lineTo(8.0,10.0);
		icon.get_graphics().lineTo(4.0,6.0);
	} else {
		icon.get_graphics().moveTo(4.0,6.0);
		icon.get_graphics().lineTo(16.0,6.0);
		icon.get_graphics().lineTo(10.0,14.0);
		icon.get_graphics().lineTo(4.0,6.0);
	}
	icon.get_graphics().endFill();
	icon.get_graphics().beginFill(color);
	icon.get_graphics().endFill();
};
feathers_themes_steel_components_SteelCollapsibleStyles.drawDisclosureOpenIcon = function(icon,color,isDesktop) {
	icon.get_graphics().beginFill(16711935,0.0);
	if(isDesktop) {
		icon.get_graphics().drawRect(0.0,0.0,16.0,16.0);
	} else {
		icon.get_graphics().drawRect(0.0,0.0,20.0,20.0);
	}
	icon.get_graphics().endFill();
	icon.get_graphics().beginFill(color);
	if(isDesktop) {
		icon.get_graphics().moveTo(4.0,10.0);
		icon.get_graphics().lineTo(12.0,10.0);
		icon.get_graphics().lineTo(8.0,6.0);
		icon.get_graphics().lineTo(4.0,10.0);
	} else {
		icon.get_graphics().moveTo(4.0,14.0);
		icon.get_graphics().lineTo(16.0,14.0);
		icon.get_graphics().lineTo(10.0,6.0);
		icon.get_graphics().lineTo(4.0,14.0);
	}
	icon.get_graphics().endFill();
};
var feathers_themes_steel_components_SteelComboBoxStyles = function() { };
$hxClasses["feathers.themes.steel.components.SteelComboBoxStyles"] = feathers_themes_steel_components_SteelComboBoxStyles;
feathers_themes_steel_components_SteelComboBoxStyles.__name__ = "feathers.themes.steel.components.SteelComboBoxStyles";
feathers_themes_steel_components_SteelComboBoxStyles.initialize = function(theme) {
	if(theme == null) {
		var value = feathers_style_Theme.get_fallbackTheme();
		theme = ((value) instanceof feathers_themes_steel_BaseSteelTheme) ? value : null;
	}
	if(theme == null) {
		return;
	}
	var styleProvider = theme.styleProvider;
	if(styleProvider.getStyleFunction(feathers_controls_Button,feathers_controls_ComboBox.CHILD_VARIANT_BUTTON) == null) {
		styleProvider.setStyleFunction(feathers_controls_Button,feathers_controls_ComboBox.CHILD_VARIANT_BUTTON,function(button) {
			if(button.get_backgroundSkin() == null) {
				var skin = new feathers_skins_TabSkin();
				skin.set_cornerRadiusPosition(feathers_layout_RelativePosition.RIGHT);
				skin.set_fill(theme.getButtonFill());
				skin.set_disabledFill(theme.getButtonDisabledFill());
				skin.setFillForState(feathers_controls_ButtonState.DOWN,theme.getReversedActiveThemeFill());
				skin.set_border(theme.getButtonBorder());
				skin.set_disabledBorder(theme.getButtonDisabledBorder());
				skin.setBorderForState(feathers_controls_ButtonState.DOWN,theme.getActiveFillBorder());
				skin.set_cornerRadius(3.0);
				button.set_backgroundSkin(skin);
			}
			if(button.get_icon() == null) {
				var icon = new feathers_skins_TriangleSkin();
				icon.set_pointPosition(feathers_layout_RelativePosition.BOTTOM);
				icon.set_fill(feathers_graphics_FillStyle.SolidColor(theme.textColor));
				icon.set_disabledFill(feathers_graphics_FillStyle.SolidColor(theme.disabledTextColor));
				icon.set_width(8.0);
				icon.set_height(4.0);
				button.set_icon(icon);
			}
			button.set_paddingTop(theme.smallPadding);
			button.set_paddingRight(theme.largePadding);
			button.set_paddingBottom(theme.smallPadding);
			button.set_paddingLeft(theme.largePadding);
			button.set_gap(theme.smallPadding);
		});
	}
	if(styleProvider.getStyleFunction(feathers_controls_TextInput,feathers_controls_ComboBox.CHILD_VARIANT_TEXT_INPUT) == null) {
		styleProvider.setStyleFunction(feathers_controls_TextInput,feathers_controls_ComboBox.CHILD_VARIANT_TEXT_INPUT,function(input) {
			var isDesktop = feathers_utils_DeviceUtil.isDesktop();
			if(input.get_backgroundSkin() == null) {
				var inputSkin = new feathers_skins_TabSkin();
				inputSkin.set_cornerRadiusPosition(feathers_layout_RelativePosition.LEFT);
				inputSkin.set_cornerRadius(3.0);
				inputSkin.set_drawBaseBorder(false);
				if(isDesktop) {
					inputSkin.set_width(120.0);
				} else {
					inputSkin.set_width(160.0);
				}
				inputSkin.set_fill(theme.getInsetFill());
				inputSkin.set_disabledFill(theme.getDisabledInsetFill());
				inputSkin.set_border(theme.getInsetBorder());
				inputSkin.set_disabledBorder(theme.getDisabledInsetBorder());
				inputSkin.setBorderForState(feathers_controls_TextInputState.FOCUSED,theme.getThemeBorder());
				input.set_backgroundSkin(inputSkin);
			}
			if(input.get_textFormat() == null) {
				input.set_textFormat(theme.getTextFormat());
			}
			if(input.get_disabledTextFormat() == null) {
				input.set_disabledTextFormat(theme.getDisabledTextFormat());
			}
			if(input.get_promptTextFormat() == null) {
				input.set_promptTextFormat(theme.getSecondaryTextFormat());
			}
			if(isDesktop) {
				input.set_paddingTop(theme.smallPadding);
				input.set_paddingRight(theme.mediumPadding);
				input.set_paddingBottom(theme.smallPadding);
				input.set_paddingLeft(theme.mediumPadding);
			} else {
				input.set_paddingTop(theme.mediumPadding);
				input.set_paddingRight(theme.largePadding);
				input.set_paddingBottom(theme.mediumPadding);
				input.set_paddingLeft(theme.largePadding);
			}
		});
	}
	if(styleProvider.getStyleFunction(feathers_controls_ListView,feathers_controls_ComboBox.CHILD_VARIANT_LIST_VIEW) == null) {
		styleProvider.setStyleFunction(feathers_controls_ListView,feathers_controls_ComboBox.CHILD_VARIANT_LIST_VIEW,function(listView) {
			(theme.styleProvider.getStyleFunction(feathers_controls_ListView,feathers_controls_ListView.VARIANT_POP_UP))(listView);
		});
	}
};
var feathers_themes_steel_components_SteelDatePickerStyles = function() { };
$hxClasses["feathers.themes.steel.components.SteelDatePickerStyles"] = feathers_themes_steel_components_SteelDatePickerStyles;
feathers_themes_steel_components_SteelDatePickerStyles.__name__ = "feathers.themes.steel.components.SteelDatePickerStyles";
feathers_themes_steel_components_SteelDatePickerStyles.initialize = function(theme) {
	if(theme == null) {
		var value = feathers_style_Theme.get_fallbackTheme();
		theme = ((value) instanceof feathers_themes_steel_BaseSteelTheme) ? value : null;
	}
	if(theme == null) {
		return;
	}
	var styleProvider = theme.styleProvider;
	if(styleProvider.getStyleFunction(feathers_controls_DatePicker,null) == null) {
		styleProvider.setStyleFunction(feathers_controls_DatePicker,null,function(datePicker) {
			if(datePicker.get_backgroundSkin() == null) {
				var backgroundSkin = new feathers_skins_RectangleSkin();
				backgroundSkin.set_border(feathers_graphics_LineStyle.None);
				backgroundSkin.set_fill(theme.getContainerFill());
				datePicker.set_backgroundSkin(backgroundSkin);
			}
			if(datePicker.get_focusRectSkin() == null) {
				var focusRectSkin = new feathers_skins_RectangleSkin();
				focusRectSkin.set_fill(feathers_graphics_FillStyle.None);
				focusRectSkin.set_border(theme.getFocusBorder());
				datePicker.set_focusRectSkin(focusRectSkin);
			}
			datePicker.set_focusPaddingTop(3.0);
			datePicker.set_focusPaddingRight(3.0);
			datePicker.set_focusPaddingBottom(3.0);
			datePicker.set_focusPaddingLeft(3.0);
			datePicker.set_headerGap(theme.xsmallPadding);
		});
	}
	if(styleProvider.getStyleFunction(feathers_controls_Label,feathers_controls_DatePicker.CHILD_VARIANT_MONTH_TITLE_VIEW) == null) {
		styleProvider.setStyleFunction(feathers_controls_Label,feathers_controls_DatePicker.CHILD_VARIANT_MONTH_TITLE_VIEW,function(view) {
			if(view.get_textFormat() == null) {
				view.set_textFormat(theme.getTextFormat());
			}
			if(view.get_disabledTextFormat() == null) {
				view.set_disabledTextFormat(theme.getDisabledTextFormat());
			}
		});
	}
	if(styleProvider.getStyleFunction(feathers_controls_Button,feathers_controls_DatePicker.CHILD_VARIANT_DECREMENT_MONTH_BUTTON) == null) {
		styleProvider.setStyleFunction(feathers_controls_Button,feathers_controls_DatePicker.CHILD_VARIANT_DECREMENT_MONTH_BUTTON,function(button) {
			var isDesktop = feathers_utils_DeviceUtil.isDesktop();
			if(button.get_backgroundSkin() == null) {
				var skin = new feathers_skins_RectangleSkin();
				skin.set_fill(theme.getButtonFill());
				skin.setFillForState(feathers_controls_ButtonState.DOWN,theme.getReversedActiveThemeFill());
				skin.setFillForState(feathers_controls_ButtonState.DISABLED,theme.getButtonDisabledFill());
				skin.set_border(theme.getButtonBorder());
				skin.set_disabledBorder(theme.getButtonDisabledBorder());
				skin.setBorderForState(feathers_controls_ButtonState.DOWN,theme.getActiveFillBorder());
				skin.set_cornerRadius(3.0);
				if(isDesktop) {
					skin.set_width(20.0);
					skin.set_height(20.0);
				} else {
					skin.set_width(24.0);
					skin.set_height(24.0);
				}
				button.set_backgroundSkin(skin);
			}
			if(button.get_icon() == null) {
				var icon = new openfl_display_Shape();
				feathers_themes_steel_components_SteelDatePickerStyles.drawDecrementMonthIcon(icon,theme.textColor);
				button.set_icon(icon);
			}
			if(button.getIconForState(feathers_controls_ButtonState.DISABLED) == null) {
				var disabledIcon = new openfl_display_Shape();
				feathers_themes_steel_components_SteelDatePickerStyles.drawDecrementMonthIcon(disabledIcon,theme.disabledTextColor);
				button.setIconForState(feathers_controls_ButtonState.DISABLED,disabledIcon);
			}
			button.setPadding(theme.smallPadding);
			button.set_gap(theme.smallPadding);
		});
	}
	if(styleProvider.getStyleFunction(feathers_controls_Button,feathers_controls_DatePicker.CHILD_VARIANT_INCREMENT_MONTH_BUTTON) == null) {
		styleProvider.setStyleFunction(feathers_controls_Button,feathers_controls_DatePicker.CHILD_VARIANT_INCREMENT_MONTH_BUTTON,function(button) {
			var isDesktop = feathers_utils_DeviceUtil.isDesktop();
			if(button.get_backgroundSkin() == null) {
				var skin = new feathers_skins_RectangleSkin();
				skin.set_fill(theme.getButtonFill());
				skin.setFillForState(feathers_controls_ButtonState.DOWN,theme.getReversedActiveThemeFill());
				skin.setFillForState(feathers_controls_ButtonState.DISABLED,theme.getButtonDisabledFill());
				skin.set_border(theme.getButtonBorder());
				skin.set_disabledBorder(theme.getButtonDisabledBorder());
				skin.setBorderForState(feathers_controls_ButtonState.DOWN,theme.getActiveFillBorder());
				skin.set_cornerRadius(3.0);
				if(isDesktop) {
					skin.set_width(20.0);
					skin.set_height(20.0);
				} else {
					skin.set_width(24.0);
					skin.set_height(24.0);
				}
				button.set_backgroundSkin(skin);
			}
			if(button.get_icon() == null) {
				var icon = new openfl_display_Shape();
				feathers_themes_steel_components_SteelDatePickerStyles.drawIncrementMonthIcon(icon,theme.textColor);
				button.set_icon(icon);
			}
			if(button.getIconForState(feathers_controls_ButtonState.DISABLED) == null) {
				var disabledIcon = new openfl_display_Shape();
				feathers_themes_steel_components_SteelDatePickerStyles.drawIncrementMonthIcon(disabledIcon,theme.disabledTextColor);
				button.setIconForState(feathers_controls_ButtonState.DISABLED,disabledIcon);
			}
			button.setPadding(theme.smallPadding);
			button.set_gap(theme.smallPadding);
		});
	}
	if(styleProvider.getStyleFunction(feathers_controls_Button,feathers_controls_DatePicker.CHILD_VARIANT_DECREMENT_YEAR_BUTTON) == null) {
		styleProvider.setStyleFunction(feathers_controls_Button,feathers_controls_DatePicker.CHILD_VARIANT_DECREMENT_YEAR_BUTTON,function(button) {
			var isDesktop = feathers_utils_DeviceUtil.isDesktop();
			if(button.get_backgroundSkin() == null) {
				var skin = new feathers_skins_RectangleSkin();
				skin.set_fill(theme.getButtonFill());
				skin.setFillForState(feathers_controls_ButtonState.DOWN,theme.getReversedActiveThemeFill());
				skin.setFillForState(feathers_controls_ButtonState.DISABLED,theme.getButtonDisabledFill());
				skin.set_border(theme.getButtonBorder());
				skin.set_disabledBorder(theme.getButtonDisabledBorder());
				skin.setBorderForState(feathers_controls_ButtonState.DOWN,theme.getActiveFillBorder());
				skin.set_cornerRadius(3.0);
				if(isDesktop) {
					skin.set_width(20.0);
					skin.set_height(20.0);
				} else {
					skin.set_width(24.0);
					skin.set_height(24.0);
				}
				button.set_backgroundSkin(skin);
			}
			if(button.get_icon() == null) {
				var icon = new openfl_display_Shape();
				feathers_themes_steel_components_SteelDatePickerStyles.drawDecrementYearIcon(icon,theme.textColor);
				button.set_icon(icon);
			}
			if(button.getIconForState(feathers_controls_ButtonState.DISABLED) == null) {
				var disabledIcon = new openfl_display_Shape();
				feathers_themes_steel_components_SteelDatePickerStyles.drawDecrementYearIcon(disabledIcon,theme.disabledTextColor);
				button.setIconForState(feathers_controls_ButtonState.DISABLED,disabledIcon);
			}
			button.setPadding(theme.smallPadding);
			button.set_gap(theme.smallPadding);
		});
	}
	if(styleProvider.getStyleFunction(feathers_controls_Button,feathers_controls_DatePicker.CHILD_VARIANT_INCREMENT_YEAR_BUTTON) == null) {
		styleProvider.setStyleFunction(feathers_controls_Button,feathers_controls_DatePicker.CHILD_VARIANT_INCREMENT_YEAR_BUTTON,function(button) {
			var isDesktop = feathers_utils_DeviceUtil.isDesktop();
			if(button.get_backgroundSkin() == null) {
				var skin = new feathers_skins_RectangleSkin();
				skin.set_fill(theme.getButtonFill());
				skin.setFillForState(feathers_controls_ButtonState.DOWN,theme.getReversedActiveThemeFill());
				skin.setFillForState(feathers_controls_ButtonState.DISABLED,theme.getButtonDisabledFill());
				skin.set_border(theme.getButtonBorder());
				skin.set_disabledBorder(theme.getButtonDisabledBorder());
				skin.setBorderForState(feathers_controls_ButtonState.DOWN,theme.getActiveFillBorder());
				skin.set_cornerRadius(3.0);
				if(isDesktop) {
					skin.set_width(20.0);
					skin.set_height(20.0);
				} else {
					skin.set_width(24.0);
					skin.set_height(24.0);
				}
				button.set_backgroundSkin(skin);
			}
			if(button.get_icon() == null) {
				var icon = new openfl_display_Shape();
				feathers_themes_steel_components_SteelDatePickerStyles.drawIncrementYearIcon(icon,theme.textColor);
				button.set_icon(icon);
			}
			if(button.getIconForState(feathers_controls_ButtonState.DISABLED) == null) {
				var disabledIcon = new openfl_display_Shape();
				feathers_themes_steel_components_SteelDatePickerStyles.drawIncrementYearIcon(disabledIcon,theme.disabledTextColor);
				button.setIconForState(feathers_controls_ButtonState.DISABLED,disabledIcon);
			}
			button.setPadding(theme.smallPadding);
			button.set_gap(theme.smallPadding);
		});
	}
	if(styleProvider.getStyleFunction(feathers_controls_Label,feathers_controls_DatePicker.CHILD_VARIANT_WEEKDAY_LABEL) == null) {
		styleProvider.setStyleFunction(feathers_controls_Label,feathers_controls_DatePicker.CHILD_VARIANT_WEEKDAY_LABEL,function(label) {
			if(label.get_textFormat() == null) {
				label.set_textFormat(theme.getSecondaryTextFormat(0));
			}
			if(label.get_disabledTextFormat() == null) {
				label.set_disabledTextFormat(theme.getDisabledTextFormat(0));
			}
			label.set_verticalAlign(feathers_layout_VerticalAlign.MIDDLE);
		});
	}
	if(styleProvider.getStyleFunction(feathers_controls_dataRenderers_ItemRenderer,feathers_controls_DatePicker.CHILD_VARIANT_DATE_RENDERER) == null) {
		styleProvider.setStyleFunction(feathers_controls_dataRenderers_ItemRenderer,feathers_controls_DatePicker.CHILD_VARIANT_DATE_RENDERER,function(dateRenderer) {
			var isDesktop = feathers_utils_DeviceUtil.isDesktop();
			if(dateRenderer.get_backgroundSkin() == null) {
				var backgroundSkin = new feathers_skins_RectangleSkin();
				backgroundSkin.set_fill(feathers_graphics_FillStyle.SolidColor(16711935,0.0));
				backgroundSkin.set_selectedFill(theme.getActiveThemeFill());
				backgroundSkin.setFillForState(feathers_controls_ToggleButtonState.DOWN(false),theme.getReversedActiveThemeFill());
				backgroundSkin.set_border(feathers_graphics_LineStyle.None);
				backgroundSkin.set_selectedBorder(theme.getSelectedBorder());
				backgroundSkin.setBorderForState(feathers_controls_ToggleButtonState.DOWN(false),theme.getActiveFillBorder());
				if(isDesktop) {
					backgroundSkin.set_width(20.0);
					backgroundSkin.set_height(20.0);
				} else {
					backgroundSkin.set_width(32.0);
					backgroundSkin.set_height(32.0);
				}
				backgroundSkin.set_cornerRadius(4.0);
				dateRenderer.set_backgroundSkin(backgroundSkin);
			}
			if(dateRenderer.get_textFormat() == null) {
				dateRenderer.set_textFormat(theme.getTextFormat());
			}
			if(dateRenderer.get_disabledTextFormat() == null) {
				dateRenderer.set_disabledTextFormat(theme.getDisabledTextFormat());
			}
			if(dateRenderer.get_secondaryTextFormat() == null) {
				dateRenderer.set_secondaryTextFormat(theme.getSecondaryDetailTextFormat());
			}
			if(dateRenderer.get_disabledSecondaryTextFormat() == null) {
				dateRenderer.set_disabledSecondaryTextFormat(theme.getDisabledDetailTextFormat());
			}
			dateRenderer.set_horizontalAlign(feathers_layout_HorizontalAlign.CENTER);
			dateRenderer.set_verticalAlign(feathers_layout_VerticalAlign.MIDDLE);
			dateRenderer.set_paddingTop(theme.xsmallPadding);
			dateRenderer.set_paddingRight(theme.xsmallPadding);
			dateRenderer.set_paddingBottom(theme.xsmallPadding);
			dateRenderer.set_paddingLeft(theme.xsmallPadding);
		});
	}
	if(styleProvider.getStyleFunction(feathers_controls_dataRenderers_ItemRenderer,feathers_controls_DatePicker.CHILD_VARIANT_MUTED_DATE_RENDERER) == null) {
		styleProvider.setStyleFunction(feathers_controls_dataRenderers_ItemRenderer,feathers_controls_DatePicker.CHILD_VARIANT_MUTED_DATE_RENDERER,function(dateRenderer) {
			var isDesktop = feathers_utils_DeviceUtil.isDesktop();
			if(dateRenderer.get_backgroundSkin() == null) {
				var backgroundSkin = new feathers_skins_RectangleSkin();
				backgroundSkin.set_fill(feathers_graphics_FillStyle.SolidColor(16711935,0.0));
				backgroundSkin.set_selectedFill(theme.getActiveThemeFill());
				backgroundSkin.setFillForState(feathers_controls_ToggleButtonState.DOWN(false),theme.getReversedActiveThemeFill());
				backgroundSkin.set_border(feathers_graphics_LineStyle.None);
				backgroundSkin.set_selectedBorder(theme.getSelectedBorder());
				backgroundSkin.setBorderForState(feathers_controls_ToggleButtonState.DOWN(false),theme.getActiveFillBorder());
				if(isDesktop) {
					backgroundSkin.set_width(20.0);
					backgroundSkin.set_height(20.0);
				} else {
					backgroundSkin.set_width(32.0);
					backgroundSkin.set_height(32.0);
				}
				backgroundSkin.set_cornerRadius(4.0);
				dateRenderer.set_backgroundSkin(backgroundSkin);
			}
			if(dateRenderer.get_textFormat() == null) {
				dateRenderer.set_textFormat(theme.getSecondaryTextFormat());
			}
			if(dateRenderer.get_disabledTextFormat() == null) {
				dateRenderer.set_disabledTextFormat(theme.getDisabledTextFormat());
			}
			if(dateRenderer.get_secondaryTextFormat() == null) {
				dateRenderer.set_secondaryTextFormat(theme.getSecondaryDetailTextFormat());
			}
			if(dateRenderer.get_disabledSecondaryTextFormat() == null) {
				dateRenderer.set_disabledSecondaryTextFormat(theme.getDisabledDetailTextFormat());
			}
			dateRenderer.set_horizontalAlign(feathers_layout_HorizontalAlign.CENTER);
			dateRenderer.set_verticalAlign(feathers_layout_VerticalAlign.MIDDLE);
			dateRenderer.set_paddingTop(theme.xsmallPadding);
			dateRenderer.set_paddingRight(theme.xsmallPadding);
			dateRenderer.set_paddingBottom(theme.xsmallPadding);
			dateRenderer.set_paddingLeft(theme.xsmallPadding);
		});
	}
};
feathers_themes_steel_components_SteelDatePickerStyles.drawDecrementMonthIcon = function(icon,color) {
	icon.get_graphics().beginFill(16711935,0.0);
	icon.get_graphics().drawRect(0.0,0.0,8.0,8.0);
	icon.get_graphics().endFill();
	icon.get_graphics().beginFill(color);
	icon.get_graphics().moveTo(2.0,4.0);
	icon.get_graphics().lineTo(6.0,0.0);
	icon.get_graphics().lineTo(6.0,8.0);
	icon.get_graphics().lineTo(2.0,4.0);
	icon.get_graphics().endFill();
};
feathers_themes_steel_components_SteelDatePickerStyles.drawIncrementMonthIcon = function(icon,color) {
	icon.get_graphics().beginFill(16711935,0.0);
	icon.get_graphics().drawRect(0.0,0.0,8.0,8.0);
	icon.get_graphics().endFill();
	icon.get_graphics().beginFill(color);
	icon.get_graphics().moveTo(2.0,0.0);
	icon.get_graphics().lineTo(6.0,4.0);
	icon.get_graphics().lineTo(2.0,8.0);
	icon.get_graphics().lineTo(2.0,0.0);
	icon.get_graphics().endFill();
};
feathers_themes_steel_components_SteelDatePickerStyles.drawDecrementYearIcon = function(icon,color) {
	icon.get_graphics().beginFill(color);
	icon.get_graphics().moveTo(0.0,4.0);
	icon.get_graphics().lineTo(4.0,0.0);
	icon.get_graphics().lineTo(4.0,8.0);
	icon.get_graphics().lineTo(0.0,4.0);
	icon.get_graphics().moveTo(4.0,4.0);
	icon.get_graphics().lineTo(8.0,0.0);
	icon.get_graphics().lineTo(8.0,8.0);
	icon.get_graphics().lineTo(4.0,4.0);
	icon.get_graphics().endFill();
};
feathers_themes_steel_components_SteelDatePickerStyles.drawIncrementYearIcon = function(icon,color) {
	icon.get_graphics().beginFill(color);
	icon.get_graphics().moveTo(0.0,0.0);
	icon.get_graphics().lineTo(4.0,4.0);
	icon.get_graphics().lineTo(0.0,8.0);
	icon.get_graphics().lineTo(0.0,0.0);
	icon.get_graphics().moveTo(4.0,0.0);
	icon.get_graphics().lineTo(8.0,4.0);
	icon.get_graphics().lineTo(4.0,8.0);
	icon.get_graphics().lineTo(4.0,0.0);
	icon.get_graphics().endFill();
};
var feathers_themes_steel_components_SteelDrawerStyles = function() { };
$hxClasses["feathers.themes.steel.components.SteelDrawerStyles"] = feathers_themes_steel_components_SteelDrawerStyles;
feathers_themes_steel_components_SteelDrawerStyles.__name__ = "feathers.themes.steel.components.SteelDrawerStyles";
feathers_themes_steel_components_SteelDrawerStyles.initialize = function(theme) {
	if(theme == null) {
		var value = feathers_style_Theme.get_fallbackTheme();
		theme = ((value) instanceof feathers_themes_steel_BaseSteelTheme) ? value : null;
	}
	if(theme == null) {
		return;
	}
	var styleProvider = theme.styleProvider;
	if(styleProvider.getStyleFunction(feathers_controls_Drawer,null) == null) {
		styleProvider.setStyleFunction(feathers_controls_Drawer,null,function(drawer) {
			if(drawer.get_overlaySkin() == null) {
				var overlaySkin = new feathers_skins_RectangleSkin();
				overlaySkin.set_fill(theme.getOverlayFill());
				overlaySkin.set_border(feathers_graphics_LineStyle.None);
				overlaySkin.set_width(1.0);
				overlaySkin.set_height(1.0);
				drawer.set_overlaySkin(overlaySkin);
			}
		});
	}
};
var feathers_themes_steel_components_SteelFormItemStyles = function() { };
$hxClasses["feathers.themes.steel.components.SteelFormItemStyles"] = feathers_themes_steel_components_SteelFormItemStyles;
feathers_themes_steel_components_SteelFormItemStyles.__name__ = "feathers.themes.steel.components.SteelFormItemStyles";
feathers_themes_steel_components_SteelFormItemStyles.initialize = function(theme) {
	if(theme == null) {
		var value = feathers_style_Theme.get_fallbackTheme();
		theme = ((value) instanceof feathers_themes_steel_BaseSteelTheme) ? value : null;
	}
	if(theme == null) {
		return;
	}
	var styleProvider = theme.styleProvider;
	if(styleProvider.getStyleFunction(feathers_controls_FormItem,null) == null) {
		styleProvider.setStyleFunction(feathers_controls_FormItem,null,function(formItem) {
			if(formItem.get_requiredSkin() == null) {
				var requiredSkin = new openfl_display_Shape();
				requiredSkin.get_graphics().lineStyle(1.0,theme.dangerTextColor);
				requiredSkin.get_graphics().moveTo(4.0,0.5);
				requiredSkin.get_graphics().lineTo(4.0,6.5);
				requiredSkin.get_graphics().moveTo(1.0,1.5);
				requiredSkin.get_graphics().lineTo(7.0,5.5);
				requiredSkin.get_graphics().moveTo(1.0,5.5);
				requiredSkin.get_graphics().lineTo(7.0,1.5);
				requiredSkin.get_graphics().lineStyle();
				requiredSkin.get_graphics().beginFill(16711935,0.0);
				requiredSkin.get_graphics().drawRect(0.0,0.0,8.0,7.0);
				requiredSkin.get_graphics().endFill();
				formItem.set_requiredSkin(requiredSkin);
			}
			if(formItem.get_textFormat() == null) {
				formItem.set_textFormat(theme.getTextFormat());
			}
			if(formItem.get_disabledTextFormat() == null) {
				formItem.set_disabledTextFormat(theme.getDisabledTextFormat());
			}
			formItem.set_gap(theme.mediumPadding);
		});
	}
};
var feathers_themes_steel_components_SteelFormStyles = function() { };
$hxClasses["feathers.themes.steel.components.SteelFormStyles"] = feathers_themes_steel_components_SteelFormStyles;
feathers_themes_steel_components_SteelFormStyles.__name__ = "feathers.themes.steel.components.SteelFormStyles";
feathers_themes_steel_components_SteelFormStyles.initialize = function(theme) {
	if(theme == null) {
		var value = feathers_style_Theme.get_fallbackTheme();
		theme = ((value) instanceof feathers_themes_steel_BaseSteelTheme) ? value : null;
	}
	if(theme == null) {
		return;
	}
	var styleProvider = theme.styleProvider;
	if(styleProvider.getStyleFunction(feathers_controls_Form,null) == null) {
		styleProvider.setStyleFunction(feathers_controls_Form,null,function(form) {
			if(form.get_layout() == null) {
				var layout = new feathers_layout_FormLayout();
				layout.set_gap(theme.mediumPadding);
				form.set_layout(layout);
			}
		});
	}
};
var feathers_themes_steel_components_SteelGridViewStyles = function() { };
$hxClasses["feathers.themes.steel.components.SteelGridViewStyles"] = feathers_themes_steel_components_SteelGridViewStyles;
feathers_themes_steel_components_SteelGridViewStyles.__name__ = "feathers.themes.steel.components.SteelGridViewStyles";
feathers_themes_steel_components_SteelGridViewStyles.initialize = function(theme) {
	if(theme == null) {
		var value = feathers_style_Theme.get_fallbackTheme();
		theme = ((value) instanceof feathers_themes_steel_BaseSteelTheme) ? value : null;
	}
	if(theme == null) {
		return;
	}
	var styleGridViewWithBorderVariant = function(gridView) {
		var isDesktop = feathers_utils_DeviceUtil.isDesktop();
		gridView.set_autoHideScrollBars(!isDesktop);
		gridView.set_fixedScrollBars(isDesktop);
		if(gridView.get_layout() == null) {
			var layout = new feathers_layout_VerticalListLayout();
			layout.set_requestedRowCount(5.0);
			gridView.set_layout(layout);
		}
		if(gridView.get_backgroundSkin() == null) {
			var backgroundSkin = new feathers_skins_RectangleSkin();
			backgroundSkin.set_fill(theme.getContainerFill());
			backgroundSkin.set_border(theme.getContainerBorder());
			backgroundSkin.set_width(10.0);
			backgroundSkin.set_height(10.0);
			gridView.set_backgroundSkin(backgroundSkin);
		}
		if(gridView.get_columnResizeSkin() == null) {
			var columnResizeSkin = new feathers_skins_RectangleSkin();
			columnResizeSkin.set_fill(theme.getThemeFill());
			columnResizeSkin.set_border(feathers_graphics_LineStyle.None);
			columnResizeSkin.set_width(2.0);
			columnResizeSkin.set_height(2.0);
			gridView.set_columnResizeSkin(columnResizeSkin);
		}
		if(gridView.get_headerCornerSkin() == null) {
			var headerCornerSkin = new feathers_skins_RectangleSkin();
			headerCornerSkin.set_fill(theme.getSubHeadingFill());
			headerCornerSkin.set_border(feathers_graphics_LineStyle.None);
			gridView.set_headerCornerSkin(headerCornerSkin);
		}
		if(gridView.get_focusRectSkin() == null) {
			var focusRectSkin = new feathers_skins_RectangleSkin();
			focusRectSkin.set_fill(feathers_graphics_FillStyle.None);
			focusRectSkin.set_border(theme.getFocusBorder());
			gridView.set_focusRectSkin(focusRectSkin);
		}
		if(gridView.get_dragDropIndicatorSkin() == null) {
			var dragDropIndicatorSkin = new feathers_skins_RectangleSkin();
			dragDropIndicatorSkin.set_fill(theme.getActiveThemeFill());
			dragDropIndicatorSkin.set_border(feathers_graphics_LineStyle.None);
			dragDropIndicatorSkin.set_width(2.0);
			dragDropIndicatorSkin.set_height(2.0);
			gridView.set_dragDropIndicatorSkin(dragDropIndicatorSkin);
		}
		gridView.set_showHeaderDividersOnlyWhenResizable(true);
		gridView.set_paddingTop(theme.borderThickness);
		gridView.set_paddingRight(theme.borderThickness);
		gridView.set_paddingBottom(theme.borderThickness);
		gridView.set_paddingLeft(theme.borderThickness);
	};
	var styleGridViewWithBorderlessVariant = function(gridView) {
		var isDesktop = feathers_utils_DeviceUtil.isDesktop();
		gridView.set_autoHideScrollBars(!isDesktop);
		gridView.set_fixedScrollBars(isDesktop);
		if(gridView.get_layout() == null) {
			var layout = new feathers_layout_VerticalListLayout();
			layout.set_requestedRowCount(5.0);
			gridView.set_layout(layout);
		}
		if(gridView.get_backgroundSkin() == null) {
			var backgroundSkin = new feathers_skins_RectangleSkin();
			backgroundSkin.set_fill(theme.getContainerFill());
			backgroundSkin.set_border(feathers_graphics_LineStyle.None);
			backgroundSkin.set_width(10.0);
			backgroundSkin.set_height(10.0);
			gridView.set_backgroundSkin(backgroundSkin);
		}
		if(gridView.get_columnResizeSkin() == null) {
			var columnResizeSkin = new feathers_skins_RectangleSkin();
			columnResizeSkin.set_fill(theme.getThemeFill());
			columnResizeSkin.set_border(feathers_graphics_LineStyle.None);
			columnResizeSkin.set_width(2.0);
			columnResizeSkin.set_height(2.0);
			gridView.set_columnResizeSkin(columnResizeSkin);
		}
		if(gridView.get_headerCornerSkin() == null) {
			var headerCornerSkin = new feathers_skins_RectangleSkin();
			headerCornerSkin.set_fill(theme.getSubHeadingFill());
			headerCornerSkin.set_border(feathers_graphics_LineStyle.None);
			gridView.set_headerCornerSkin(headerCornerSkin);
		}
		if(gridView.get_focusRectSkin() == null) {
			var skin = new feathers_skins_RectangleSkin();
			skin.set_fill(feathers_graphics_FillStyle.None);
			skin.set_border(theme.getFocusBorder());
			gridView.set_focusRectSkin(skin);
		}
		gridView.set_showHeaderDividersOnlyWhenResizable(true);
	};
	var styleProvider = theme.styleProvider;
	if(styleProvider.getStyleFunction(feathers_controls_GridView,null) == null) {
		styleProvider.setStyleFunction(feathers_controls_GridView,null,function(gridView) {
			var isDesktop = feathers_utils_DeviceUtil.isDesktop();
			if(isDesktop) {
				styleGridViewWithBorderVariant(gridView);
			} else {
				styleGridViewWithBorderlessVariant(gridView);
			}
		});
	}
	if(styleProvider.getStyleFunction(feathers_controls_GridView,feathers_controls_GridView.VARIANT_BORDER) == null) {
		styleProvider.setStyleFunction(feathers_controls_GridView,feathers_controls_GridView.VARIANT_BORDER,styleGridViewWithBorderVariant);
	}
	if(styleProvider.getStyleFunction(feathers_controls_GridView,feathers_controls_GridView.VARIANT_BORDERLESS) == null) {
		styleProvider.setStyleFunction(feathers_controls_GridView,feathers_controls_GridView.VARIANT_BORDERLESS,styleGridViewWithBorderlessVariant);
	}
	if(styleProvider.getStyleFunction(feathers_controls_dataRenderers_ItemRenderer,feathers_controls_GridView.CHILD_VARIANT_CELL_RENDERER) == null) {
		styleProvider.setStyleFunction(feathers_controls_dataRenderers_ItemRenderer,feathers_controls_GridView.CHILD_VARIANT_CELL_RENDERER,function(itemRenderer) {
			var isDesktop = feathers_utils_DeviceUtil.isDesktop();
			if(itemRenderer.get_backgroundSkin() == null) {
				var backgroundSkin = new feathers_skins_RectangleSkin();
				backgroundSkin.set_fill(feathers_graphics_FillStyle.SolidColor(16711935,0.0));
				backgroundSkin.set_border(feathers_graphics_LineStyle.None);
				if(isDesktop) {
					backgroundSkin.set_width(26.0);
					backgroundSkin.set_height(26.0);
					backgroundSkin.set_minWidth(26.0);
					backgroundSkin.set_minHeight(26.0);
				} else {
					backgroundSkin.set_width(44.0);
					backgroundSkin.set_height(44.0);
					backgroundSkin.set_minWidth(44.0);
					backgroundSkin.set_minHeight(44.0);
				}
				itemRenderer.set_backgroundSkin(backgroundSkin);
			}
			(theme.styleProvider.getStyleFunction(feathers_controls_dataRenderers_ItemRenderer,null))(itemRenderer);
		});
	}
	if(styleProvider.getStyleFunction(feathers_controls_dataRenderers_ItemRenderer,feathers_controls_GridView.CHILD_VARIANT_HEADER_RENDERER) == null) {
		styleProvider.setStyleFunction(feathers_controls_dataRenderers_ItemRenderer,feathers_controls_GridView.CHILD_VARIANT_HEADER_RENDERER,function(itemRenderer) {
			var isDesktop = feathers_utils_DeviceUtil.isDesktop();
			if(itemRenderer.get_backgroundSkin() == null) {
				var skin = new feathers_skins_RectangleSkin();
				skin.set_fill(theme.getSubHeadingFill());
				skin.set_border(feathers_graphics_LineStyle.None);
				if(isDesktop) {
					skin.set_width(22.0);
					skin.set_height(22.0);
					skin.set_minWidth(22.0);
					skin.set_minHeight(22.0);
				} else {
					skin.set_width(44.0);
					skin.set_height(44.0);
					skin.set_minWidth(44.0);
					skin.set_minHeight(44.0);
				}
				itemRenderer.set_backgroundSkin(skin);
			}
			if(itemRenderer.get_textFormat() == null) {
				itemRenderer.set_textFormat(theme.getTextFormat());
			}
			if(itemRenderer.get_disabledTextFormat() == null) {
				itemRenderer.set_disabledTextFormat(theme.getDisabledTextFormat());
			}
			if(itemRenderer.get_secondaryTextFormat() == null) {
				itemRenderer.set_secondaryTextFormat(theme.getSecondaryDetailTextFormat());
			}
			if(itemRenderer.get_disabledSecondaryTextFormat() == null) {
				itemRenderer.set_disabledSecondaryTextFormat(theme.getDisabledDetailTextFormat());
			}
			itemRenderer.set_paddingTop(theme.smallPadding);
			itemRenderer.set_paddingRight(theme.largePadding);
			itemRenderer.set_paddingBottom(theme.smallPadding);
			itemRenderer.set_paddingLeft(theme.largePadding);
			itemRenderer.set_gap(theme.smallPadding);
			itemRenderer.set_horizontalAlign(feathers_layout_HorizontalAlign.LEFT);
		});
	}
	if(styleProvider.getStyleFunction(feathers_controls_Button,feathers_controls_GridView.CHILD_VARIANT_HEADER_DIVIDER) == null) {
		styleProvider.setStyleFunction(feathers_controls_Button,feathers_controls_GridView.CHILD_VARIANT_HEADER_DIVIDER,function(headerDivider) {
			var isDesktop = feathers_utils_DeviceUtil.isDesktop();
			if(headerDivider.get_backgroundSkin() == null) {
				var skin = new feathers_skins_VerticalLineSkin();
				skin.set_fill(feathers_graphics_FillStyle.SolidColor(16711935,0.0));
				skin.set_border(theme.getSubHeadingDividerBorder());
				skin.setBorderForState(feathers_controls_ButtonState.HOVER,theme.getThemeBorder());
				if(isDesktop) {
					skin.set_width(6.0);
					skin.set_height(1.0);
					skin.set_minWidth(6.0);
					skin.set_minHeight(1.0);
				} else {
					skin.set_width(10.0);
					skin.set_height(1.0);
					skin.set_minWidth(10.0);
					skin.set_minHeight(1.0);
				}
				headerDivider.set_backgroundSkin(skin);
			}
		});
	}
	if(styleProvider.getStyleFunction(feathers_controls_dataRenderers_GridViewRowRenderer,null) == null) {
		styleProvider.setStyleFunction(feathers_controls_dataRenderers_GridViewRowRenderer,null,function(rowRenderer) {
			var isDesktop = feathers_utils_DeviceUtil.isDesktop();
			if(rowRenderer.get_backgroundSkin() == null) {
				var skin = new feathers_skins_UnderlineSkin();
				skin.set_fill(theme.getContainerFill());
				skin.set_border(theme.getDividerBorder());
				skin.set_selectedFill(theme.getActiveThemeFill());
				skin.setFillForState(feathers_controls_ToggleButtonState.DOWN(false),theme.getActiveThemeFill());
				if(isDesktop) {
					skin.set_width(26.0);
					skin.set_height(26.0);
					skin.set_minWidth(26.0);
					skin.set_minHeight(26.0);
				} else {
					skin.set_width(44.0);
					skin.set_height(44.0);
					skin.set_minWidth(44.0);
					skin.set_minHeight(44.0);
				}
				rowRenderer.set_backgroundSkin(skin);
			}
		});
	}
};
var feathers_themes_steel_components_SteelGroupListViewStyles = function() { };
$hxClasses["feathers.themes.steel.components.SteelGroupListViewStyles"] = feathers_themes_steel_components_SteelGroupListViewStyles;
feathers_themes_steel_components_SteelGroupListViewStyles.__name__ = "feathers.themes.steel.components.SteelGroupListViewStyles";
feathers_themes_steel_components_SteelGroupListViewStyles.initialize = function(theme) {
	if(theme == null) {
		var value = feathers_style_Theme.get_fallbackTheme();
		theme = ((value) instanceof feathers_themes_steel_BaseSteelTheme) ? value : null;
	}
	if(theme == null) {
		return;
	}
	var styleGroupListViewWithBorderVariant = function(listView) {
		var isDesktop = feathers_utils_DeviceUtil.isDesktop();
		listView.set_autoHideScrollBars(!isDesktop);
		listView.set_fixedScrollBars(isDesktop);
		if(listView.get_layout() == null) {
			var layout = new feathers_layout_VerticalListLayout();
			layout.set_requestedRowCount(5.0);
			listView.set_layout(layout);
		}
		if(listView.get_backgroundSkin() == null) {
			var backgroundSkin = new feathers_skins_RectangleSkin();
			backgroundSkin.set_fill(theme.getContainerFill());
			backgroundSkin.set_border(theme.getContainerBorder());
			backgroundSkin.set_width(10.0);
			backgroundSkin.set_height(10.0);
			listView.set_backgroundSkin(backgroundSkin);
		}
		if(listView.get_focusRectSkin() == null) {
			var focusRectSkin = new feathers_skins_RectangleSkin();
			focusRectSkin.set_fill(feathers_graphics_FillStyle.None);
			focusRectSkin.set_border(theme.getFocusBorder());
			listView.set_focusRectSkin(focusRectSkin);
		}
		listView.set_paddingTop(theme.borderThickness);
		listView.set_paddingRight(theme.borderThickness);
		listView.set_paddingBottom(theme.borderThickness);
		listView.set_paddingLeft(theme.borderThickness);
	};
	var styleGroupListViewWithBorderlessVariant = function(listView) {
		var isDesktop = feathers_utils_DeviceUtil.isDesktop();
		listView.set_autoHideScrollBars(!isDesktop);
		listView.set_fixedScrollBars(isDesktop);
		if(listView.get_layout() == null) {
			var layout = new feathers_layout_VerticalListLayout();
			layout.set_requestedRowCount(5.0);
			listView.set_layout(layout);
		}
		if(listView.get_backgroundSkin() == null) {
			var backgroundSkin = new feathers_skins_RectangleSkin();
			backgroundSkin.set_fill(theme.getContainerFill());
			backgroundSkin.set_border(feathers_graphics_LineStyle.None);
			backgroundSkin.set_width(10.0);
			backgroundSkin.set_height(10.0);
			listView.set_backgroundSkin(backgroundSkin);
		}
		if(listView.get_focusRectSkin() == null) {
			var skin = new feathers_skins_RectangleSkin();
			skin.set_fill(feathers_graphics_FillStyle.None);
			skin.set_border(theme.getFocusBorder());
			listView.set_focusRectSkin(skin);
		}
	};
	var styleProvider = theme.styleProvider;
	if(styleProvider.getStyleFunction(feathers_controls_GroupListView,null) == null) {
		styleProvider.setStyleFunction(feathers_controls_GroupListView,null,function(listView) {
			var isDesktop = feathers_utils_DeviceUtil.isDesktop();
			if(isDesktop) {
				styleGroupListViewWithBorderVariant(listView);
			} else {
				styleGroupListViewWithBorderlessVariant(listView);
			}
		});
	}
	if(styleProvider.getStyleFunction(feathers_controls_GroupListView,feathers_controls_GroupListView.VARIANT_BORDER) == null) {
		styleProvider.setStyleFunction(feathers_controls_GroupListView,feathers_controls_GroupListView.VARIANT_BORDER,styleGroupListViewWithBorderVariant);
	}
	if(styleProvider.getStyleFunction(feathers_controls_GroupListView,feathers_controls_GroupListView.VARIANT_BORDERLESS) == null) {
		styleProvider.setStyleFunction(feathers_controls_GroupListView,feathers_controls_GroupListView.VARIANT_BORDERLESS,styleGroupListViewWithBorderlessVariant);
	}
	if(styleProvider.getStyleFunction(feathers_controls_dataRenderers_ItemRenderer,feathers_controls_GroupListView.CHILD_VARIANT_HEADER_RENDERER) == null) {
		styleProvider.setStyleFunction(feathers_controls_dataRenderers_ItemRenderer,feathers_controls_GroupListView.CHILD_VARIANT_HEADER_RENDERER,function(itemRenderer) {
			if(itemRenderer.get_backgroundSkin() == null) {
				var skin = new feathers_skins_RectangleSkin();
				skin.set_fill(theme.getSubHeadingFill());
				skin.set_border(feathers_graphics_LineStyle.None);
				skin.set_width(22.0);
				skin.set_height(22.0);
				skin.set_minWidth(22.0);
				skin.set_minHeight(22.0);
				itemRenderer.set_backgroundSkin(skin);
			}
			if(itemRenderer.get_textFormat() == null) {
				itemRenderer.set_textFormat(theme.getTextFormat());
			}
			if(itemRenderer.get_disabledTextFormat() == null) {
				itemRenderer.set_disabledTextFormat(theme.getDisabledTextFormat());
			}
			if(itemRenderer.get_secondaryTextFormat() == null) {
				itemRenderer.set_secondaryTextFormat(theme.getSecondaryDetailTextFormat());
			}
			if(itemRenderer.get_disabledSecondaryTextFormat() == null) {
				itemRenderer.set_disabledSecondaryTextFormat(theme.getDisabledDetailTextFormat());
			}
			itemRenderer.set_paddingTop(theme.smallPadding);
			itemRenderer.set_paddingRight(theme.largePadding);
			itemRenderer.set_paddingBottom(theme.smallPadding);
			itemRenderer.set_paddingLeft(theme.largePadding);
			itemRenderer.set_gap(theme.smallPadding);
			itemRenderer.set_horizontalAlign(feathers_layout_HorizontalAlign.LEFT);
		});
	}
};
var feathers_themes_steel_components_SteelHDividedBoxStyles = function() { };
$hxClasses["feathers.themes.steel.components.SteelHDividedBoxStyles"] = feathers_themes_steel_components_SteelHDividedBoxStyles;
feathers_themes_steel_components_SteelHDividedBoxStyles.__name__ = "feathers.themes.steel.components.SteelHDividedBoxStyles";
feathers_themes_steel_components_SteelHDividedBoxStyles.initialize = function(theme) {
	if(theme == null) {
		var value = feathers_style_Theme.get_fallbackTheme();
		theme = ((value) instanceof feathers_themes_steel_BaseSteelTheme) ? value : null;
	}
	if(theme == null) {
		return;
	}
	var styleProvider = theme.styleProvider;
	if(styleProvider.getStyleFunction(feathers_controls_HDividedBox,null) == null) {
		styleProvider.setStyleFunction(feathers_controls_HDividedBox,null,function(dividedBox) {
			if(dividedBox.get_resizeDraggingSkin() == null) {
				var resizeDraggingSkin = new feathers_skins_RectangleSkin();
				resizeDraggingSkin.set_fill(theme.getThemeFill());
				resizeDraggingSkin.set_border(feathers_graphics_LineStyle.None);
				resizeDraggingSkin.set_width(2.0);
				resizeDraggingSkin.set_height(2.0);
				dividedBox.set_resizeDraggingSkin(resizeDraggingSkin);
			}
		});
	}
};
var feathers_themes_steel_components_SteelHProgressBarStyles = function() { };
$hxClasses["feathers.themes.steel.components.SteelHProgressBarStyles"] = feathers_themes_steel_components_SteelHProgressBarStyles;
feathers_themes_steel_components_SteelHProgressBarStyles.__name__ = "feathers.themes.steel.components.SteelHProgressBarStyles";
feathers_themes_steel_components_SteelHProgressBarStyles.initialize = function(theme) {
	if(theme == null) {
		var value = feathers_style_Theme.get_fallbackTheme();
		theme = ((value) instanceof feathers_themes_steel_BaseSteelTheme) ? value : null;
	}
	if(theme == null) {
		return;
	}
	var styleProvider = theme.styleProvider;
	if(styleProvider.getStyleFunction(feathers_controls_HProgressBar,null) == null) {
		styleProvider.setStyleFunction(feathers_controls_HProgressBar,null,function(progress) {
			if(progress.get_fillSkin() == null) {
				var fillSkin = new feathers_skins_RectangleSkin();
				fillSkin.set_fill(theme.getActiveThemeFill());
				fillSkin.set_disabledFill(theme.getControlDisabledFill());
				fillSkin.set_border(theme.getActiveFillBorder());
				fillSkin.set_disabledBorder(theme.getDisabledInsetBorder());
				fillSkin.set_cornerRadius(8.0);
				fillSkin.set_minWidth(8.0);
				fillSkin.set_height(8.0);
				progress.set_fillSkin(fillSkin);
			}
			if(progress.get_backgroundSkin() == null) {
				var backgroundSkin = new feathers_skins_RectangleSkin();
				backgroundSkin.set_fill(theme.getInsetFill());
				backgroundSkin.set_disabledFill(theme.getDisabledInsetFill());
				backgroundSkin.set_border(theme.getInsetBorder());
				backgroundSkin.set_disabledBorder(theme.getDisabledInsetBorder());
				backgroundSkin.set_cornerRadius(8.0);
				backgroundSkin.set_width(200.0);
				backgroundSkin.set_height(8.0);
				progress.set_backgroundSkin(backgroundSkin);
			}
		});
	}
};
var feathers_themes_steel_components_SteelHScrollBarStyles = function() { };
$hxClasses["feathers.themes.steel.components.SteelHScrollBarStyles"] = feathers_themes_steel_components_SteelHScrollBarStyles;
feathers_themes_steel_components_SteelHScrollBarStyles.__name__ = "feathers.themes.steel.components.SteelHScrollBarStyles";
feathers_themes_steel_components_SteelHScrollBarStyles.initialize = function(theme) {
	if(theme == null) {
		var value = feathers_style_Theme.get_fallbackTheme();
		theme = ((value) instanceof feathers_themes_steel_BaseSteelTheme) ? value : null;
	}
	if(theme == null) {
		return;
	}
	var styleProvider = theme.styleProvider;
	if(styleProvider.getStyleFunction(feathers_controls_HScrollBar,null) == null) {
		styleProvider.setStyleFunction(feathers_controls_HScrollBar,null,function(scrollBar) {
			var isDesktop = feathers_utils_DeviceUtil.isDesktop();
			if(scrollBar.get_thumbSkin() == null) {
				var thumbSkin = new feathers_skins_RectangleSkin();
				thumbSkin.set_fill(theme.getScrollBarThumbFill());
				thumbSkin.set_disabledFill(theme.getScrollBarThumbDisabledFill());
				thumbSkin.set_border(feathers_graphics_LineStyle.None);
				var size = isDesktop ? 6.0 : 4.0;
				thumbSkin.set_width(size);
				thumbSkin.set_height(size);
				thumbSkin.set_minWidth(size);
				thumbSkin.set_minHeight(size);
				thumbSkin.set_cornerRadius(size / 2.0);
				var thumb = new feathers_controls_BasicButton();
				thumb.set_keepDownStateOnRollOut(true);
				thumb.set_backgroundSkin(thumbSkin);
				scrollBar.set_thumbSkin(thumb);
			}
			if(isDesktop && scrollBar.get_trackSkin() == null) {
				var trackSkin = new feathers_skins_RectangleSkin();
				trackSkin.set_fill(theme.getControlFill());
				trackSkin.set_disabledFill(theme.getControlDisabledFill());
				trackSkin.set_border(feathers_graphics_LineStyle.None);
				trackSkin.set_width(12.0);
				trackSkin.set_height(12.0);
				trackSkin.set_minWidth(12.0);
				trackSkin.set_minHeight(12.0);
				scrollBar.set_trackSkin(trackSkin);
			}
			scrollBar.set_paddingTop(theme.xsmallPadding);
			scrollBar.set_paddingRight(theme.xsmallPadding);
			scrollBar.set_paddingBottom(theme.xsmallPadding);
			scrollBar.set_paddingLeft(theme.xsmallPadding);
		});
	}
	if(styleProvider.getStyleFunction(feathers_controls_Button,feathers_controls_HScrollBar.CHILD_VARIANT_DECREMENT_BUTTON) == null) {
		styleProvider.setStyleFunction(feathers_controls_Button,feathers_controls_HScrollBar.CHILD_VARIANT_DECREMENT_BUTTON,function(button) {
			if(button.get_backgroundSkin() == null) {
				var skin = new feathers_skins_RectangleSkin();
				skin.set_fill(theme.getControlFill());
				skin.set_disabledFill(theme.getControlDisabledFill());
				skin.setFillForState(feathers_controls_ButtonState.DOWN,theme.getReversedActiveThemeFill());
				skin.set_border(feathers_graphics_LineStyle.None);
				skin.set_width(12.0);
				skin.set_height(12.0);
				button.set_backgroundSkin(skin);
			}
			if(button.get_icon() == null) {
				var icon = new feathers_skins_TriangleSkin();
				icon.set_pointPosition(feathers_layout_RelativePosition.LEFT);
				icon.set_fill(feathers_graphics_FillStyle.SolidColor(theme.scrollBarThumbFillColor));
				icon.set_disabledFill(feathers_graphics_FillStyle.SolidColor(theme.scrollBarThumbDisabledFillColor));
				icon.set_width(4.0);
				icon.set_height(8.0);
				button.set_icon(icon);
			}
			button.set_showText(false);
			button.set_paddingTop(theme.xsmallPadding);
			button.set_paddingRight(theme.xsmallPadding);
			button.set_paddingBottom(theme.xsmallPadding);
			button.set_paddingLeft(theme.xsmallPadding);
			button.set_gap(theme.xsmallPadding);
		});
	}
	if(styleProvider.getStyleFunction(feathers_controls_Button,feathers_controls_HScrollBar.CHILD_VARIANT_INCREMENT_BUTTON) == null) {
		styleProvider.setStyleFunction(feathers_controls_Button,feathers_controls_HScrollBar.CHILD_VARIANT_INCREMENT_BUTTON,function(button) {
			if(button.get_backgroundSkin() == null) {
				var skin = new feathers_skins_RectangleSkin();
				skin.set_fill(theme.getControlFill());
				skin.set_disabledFill(theme.getControlDisabledFill());
				skin.setFillForState(feathers_controls_ButtonState.DOWN,theme.getReversedActiveThemeFill());
				skin.set_border(feathers_graphics_LineStyle.None);
				skin.set_width(12.0);
				skin.set_height(12.0);
				button.set_backgroundSkin(skin);
			}
			if(button.get_icon() == null) {
				var icon = new feathers_skins_TriangleSkin();
				icon.set_pointPosition(feathers_layout_RelativePosition.RIGHT);
				icon.set_fill(feathers_graphics_FillStyle.SolidColor(theme.scrollBarThumbFillColor));
				icon.set_disabledFill(feathers_graphics_FillStyle.SolidColor(theme.scrollBarThumbDisabledFillColor));
				icon.set_width(4.0);
				icon.set_height(8.0);
				button.set_icon(icon);
			}
			button.set_showText(false);
			button.set_paddingTop(theme.xsmallPadding);
			button.set_paddingRight(theme.xsmallPadding);
			button.set_paddingBottom(theme.xsmallPadding);
			button.set_paddingLeft(theme.xsmallPadding);
			button.set_gap(theme.xsmallPadding);
		});
	}
};
var feathers_themes_steel_components_SteelHSliderStyles = function() { };
$hxClasses["feathers.themes.steel.components.SteelHSliderStyles"] = feathers_themes_steel_components_SteelHSliderStyles;
feathers_themes_steel_components_SteelHSliderStyles.__name__ = "feathers.themes.steel.components.SteelHSliderStyles";
feathers_themes_steel_components_SteelHSliderStyles.initialize = function(theme) {
	if(theme == null) {
		var value = feathers_style_Theme.get_fallbackTheme();
		theme = ((value) instanceof feathers_themes_steel_BaseSteelTheme) ? value : null;
	}
	if(theme == null) {
		return;
	}
	var styleProvider = theme.styleProvider;
	if(styleProvider.getStyleFunction(feathers_controls_HSlider,null) == null) {
		styleProvider.setStyleFunction(feathers_controls_HSlider,null,function(slider) {
			var isDesktop = feathers_utils_DeviceUtil.isDesktop();
			if(slider.get_thumbSkin() == null) {
				var thumb = new feathers_controls_Button();
				thumb.set_styleProvider(null);
				thumb.set_keepDownStateOnRollOut(true);
				var backgroundSkin = new feathers_skins_CircleSkin();
				backgroundSkin.set_fill(theme.getButtonFill());
				backgroundSkin.set_disabledFill(theme.getButtonDisabledFill());
				backgroundSkin.setFillForState(feathers_controls_ButtonState.DOWN,theme.getButtonDownFill());
				backgroundSkin.set_border(theme.getButtonBorder());
				backgroundSkin.set_disabledBorder(theme.getButtonDisabledBorder());
				if(isDesktop) {
					backgroundSkin.set_width(20.0);
					backgroundSkin.set_height(20.0);
				} else {
					backgroundSkin.set_width(24.0);
					backgroundSkin.set_height(24.0);
				}
				thumb.set_backgroundSkin(backgroundSkin);
				var focusRectSkin = new feathers_skins_CircleSkin();
				focusRectSkin.set_fill(feathers_graphics_FillStyle.None);
				focusRectSkin.set_border(theme.getFocusBorder());
				thumb.set_focusRectSkin(focusRectSkin);
				slider.set_thumbSkin(thumb);
			}
			if(slider.get_trackSkin() == null) {
				var trackSkin = new feathers_skins_TabSkin();
				trackSkin.set_fill(theme.getActiveThemeFill());
				trackSkin.set_disabledFill(theme.getControlDisabledFill());
				trackSkin.set_border(theme.getActiveFillBorder());
				trackSkin.set_disabledBorder(theme.getDisabledInsetBorder());
				trackSkin.set_cornerRadius(8.0);
				trackSkin.set_cornerRadiusPosition(feathers_layout_RelativePosition.LEFT);
				trackSkin.set_width(100.0);
				trackSkin.set_height(8.0);
				slider.set_trackSkin(trackSkin);
				if(slider.get_secondaryTrackSkin() == null) {
					var secondaryTrackSkin = new feathers_skins_TabSkin();
					secondaryTrackSkin.set_fill(theme.getInsetFill());
					secondaryTrackSkin.set_disabledFill(theme.getDisabledInsetFill());
					secondaryTrackSkin.set_border(theme.getInsetBorder());
					secondaryTrackSkin.set_disabledBorder(theme.getDisabledInsetBorder());
					secondaryTrackSkin.set_cornerRadius(8.0);
					secondaryTrackSkin.set_cornerRadiusPosition(feathers_layout_RelativePosition.RIGHT);
					secondaryTrackSkin.set_width(100.0);
					secondaryTrackSkin.set_height(8.0);
					slider.set_secondaryTrackSkin(secondaryTrackSkin);
				}
			}
		});
	}
};
var feathers_themes_steel_components_SteelHeaderStyles = function() { };
$hxClasses["feathers.themes.steel.components.SteelHeaderStyles"] = feathers_themes_steel_components_SteelHeaderStyles;
feathers_themes_steel_components_SteelHeaderStyles.__name__ = "feathers.themes.steel.components.SteelHeaderStyles";
feathers_themes_steel_components_SteelHeaderStyles.initialize = function(theme) {
	if(theme == null) {
		var value = feathers_style_Theme.get_fallbackTheme();
		theme = ((value) instanceof feathers_themes_steel_BaseSteelTheme) ? value : null;
	}
	if(theme == null) {
		return;
	}
	var styleProvider = theme.styleProvider;
	if(styleProvider.getStyleFunction(feathers_controls_Header,null) == null) {
		styleProvider.setStyleFunction(feathers_controls_Header,null,function(header) {
			var isDesktop = feathers_utils_DeviceUtil.isDesktop();
			if(header.get_backgroundSkin() == null) {
				var backgroundSkin = new feathers_skins_RectangleSkin();
				backgroundSkin.set_fill(theme.getHeaderFill());
				backgroundSkin.set_border(feathers_graphics_LineStyle.None);
				if(isDesktop) {
					backgroundSkin.set_width(32.0);
					backgroundSkin.set_height(32.0);
					backgroundSkin.set_minHeight(32.0);
				} else {
					backgroundSkin.set_width(44.0);
					backgroundSkin.set_height(44.0);
					backgroundSkin.set_minHeight(44.0);
				}
				header.set_backgroundSkin(backgroundSkin);
			}
			if(header.get_textFormat() == null) {
				header.set_textFormat(theme.getHeaderTextFormat());
			}
			if(header.get_disabledTextFormat() == null) {
				header.set_disabledTextFormat(theme.getDisabledHeaderTextFormat());
			}
			if(isDesktop) {
				header.set_paddingTop(theme.mediumPadding);
				header.set_paddingRight(theme.largePadding);
				header.set_paddingBottom(theme.mediumPadding);
				header.set_paddingLeft(theme.largePadding);
				header.set_minGap(theme.mediumPadding);
			} else {
				header.set_paddingTop(theme.largePadding);
				header.set_paddingRight(theme.largePadding);
				header.set_paddingBottom(theme.largePadding);
				header.set_paddingLeft(theme.largePadding);
				header.set_minGap(theme.largePadding);
			}
		});
	}
};
var feathers_themes_steel_components_SteelHierarchicalItemRendererStyles = function() { };
$hxClasses["feathers.themes.steel.components.SteelHierarchicalItemRendererStyles"] = feathers_themes_steel_components_SteelHierarchicalItemRendererStyles;
feathers_themes_steel_components_SteelHierarchicalItemRendererStyles.__name__ = "feathers.themes.steel.components.SteelHierarchicalItemRendererStyles";
feathers_themes_steel_components_SteelHierarchicalItemRendererStyles.initialize = function(theme) {
	if(theme == null) {
		var value = feathers_style_Theme.get_fallbackTheme();
		theme = ((value) instanceof feathers_themes_steel_BaseSteelTheme) ? value : null;
	}
	if(theme == null) {
		return;
	}
	var styleProvider = theme.styleProvider;
	if(styleProvider.getStyleFunction(feathers_controls_dataRenderers_HierarchicalItemRenderer,null) == null) {
		styleProvider.setStyleFunction(feathers_controls_dataRenderers_HierarchicalItemRenderer,null,function(itemRenderer) {
			var isDesktop = feathers_utils_DeviceUtil.isDesktop();
			if(itemRenderer.get_backgroundSkin() == null) {
				var skin = new feathers_skins_UnderlineSkin();
				skin.set_fill(theme.getContainerFill());
				skin.set_border(theme.getDividerBorder());
				skin.set_selectedFill(theme.getActiveThemeFill());
				skin.setFillForState(feathers_controls_ToggleButtonState.DOWN(false),theme.getActiveThemeFill());
				if(isDesktop) {
					skin.set_width(26.0);
					skin.set_height(26.0);
					skin.set_minWidth(26.0);
					skin.set_minHeight(26.0);
				} else {
					skin.set_width(44.0);
					skin.set_height(44.0);
					skin.set_minWidth(44.0);
					skin.set_minHeight(44.0);
				}
				itemRenderer.set_backgroundSkin(skin);
			}
			if(itemRenderer.get_textFormat() == null) {
				itemRenderer.set_textFormat(theme.getTextFormat());
			}
			if(itemRenderer.get_disabledTextFormat() == null) {
				itemRenderer.set_disabledTextFormat(theme.getDisabledTextFormat());
			}
			if(itemRenderer.get_secondaryTextFormat() == null) {
				itemRenderer.set_secondaryTextFormat(theme.getSecondaryDetailTextFormat());
			}
			if(itemRenderer.get_disabledSecondaryTextFormat() == null) {
				itemRenderer.set_disabledSecondaryTextFormat(theme.getDisabledDetailTextFormat());
			}
			itemRenderer.set_paddingTop(theme.smallPadding);
			itemRenderer.set_paddingRight(theme.largePadding);
			itemRenderer.set_paddingBottom(theme.smallPadding);
			itemRenderer.set_paddingLeft(theme.largePadding);
			itemRenderer.set_gap(theme.smallPadding);
			itemRenderer.set_indentation(20.0);
			itemRenderer.set_horizontalAlign(feathers_layout_HorizontalAlign.LEFT);
		});
	}
	if(styleProvider.getStyleFunction(feathers_controls_ToggleButton,feathers_controls_dataRenderers_HierarchicalItemRenderer.CHILD_VARIANT_DISCLOSURE_BUTTON) == null) {
		styleProvider.setStyleFunction(feathers_controls_ToggleButton,feathers_controls_dataRenderers_HierarchicalItemRenderer.CHILD_VARIANT_DISCLOSURE_BUTTON,function(button) {
			var isDesktop = feathers_utils_DeviceUtil.isDesktop();
			if(button.get_icon() == null) {
				var icon = new feathers_skins_MultiSkin();
				button.set_icon(icon);
				var defaultIcon = new openfl_display_Shape();
				feathers_themes_steel_components_SteelHierarchicalItemRendererStyles.drawDisclosureClosedIcon(defaultIcon,theme.textColor,isDesktop);
				icon.set_defaultView(defaultIcon);
				var disabledIcon = new openfl_display_Shape();
				feathers_themes_steel_components_SteelHierarchicalItemRendererStyles.drawDisclosureClosedIcon(disabledIcon,theme.disabledTextColor,isDesktop);
				icon.set_disabledView(disabledIcon);
				var selectedIcon = new openfl_display_Shape();
				feathers_themes_steel_components_SteelHierarchicalItemRendererStyles.drawDisclosureOpenIcon(selectedIcon,theme.textColor,isDesktop);
				icon.set_selectedView(selectedIcon);
				var selectedDisabledIcon = new openfl_display_Shape();
				feathers_themes_steel_components_SteelHierarchicalItemRendererStyles.drawDisclosureOpenIcon(selectedDisabledIcon,theme.disabledTextColor,isDesktop);
				icon.setViewForState(feathers_controls_ToggleButtonState.DISABLED(true),selectedDisabledIcon);
			}
		});
	}
};
feathers_themes_steel_components_SteelHierarchicalItemRendererStyles.drawDisclosureClosedIcon = function(icon,color,isDesktop) {
	icon.get_graphics().beginFill(16711935,0.0);
	if(isDesktop) {
		icon.get_graphics().drawRect(0.0,0.0,16.0,16.0);
	} else {
		icon.get_graphics().drawRect(0.0,0.0,20.0,20.0);
	}
	icon.get_graphics().endFill();
	icon.get_graphics().beginFill(color);
	if(isDesktop) {
		icon.get_graphics().moveTo(4.0,4.0);
		icon.get_graphics().lineTo(12.0,8.0);
		icon.get_graphics().lineTo(4.0,12.0);
		icon.get_graphics().lineTo(4.0,4.0);
	} else {
		icon.get_graphics().moveTo(4.0,4.0);
		icon.get_graphics().lineTo(16.0,10.0);
		icon.get_graphics().lineTo(4.0,16.0);
		icon.get_graphics().lineTo(4.0,4.0);
	}
	icon.get_graphics().endFill();
};
feathers_themes_steel_components_SteelHierarchicalItemRendererStyles.drawDisclosureOpenIcon = function(icon,color,isDesktop) {
	icon.get_graphics().beginFill(16711935,0.0);
	if(isDesktop) {
		icon.get_graphics().drawRect(0.0,0.0,16.0,16.0);
	} else {
		icon.get_graphics().drawRect(0.0,0.0,20.0,20.0);
	}
	icon.get_graphics().endFill();
	icon.get_graphics().beginFill(color);
	if(isDesktop) {
		icon.get_graphics().moveTo(4.0,4.0);
		icon.get_graphics().lineTo(12.0,4.0);
		icon.get_graphics().lineTo(8.0,12.0);
		icon.get_graphics().lineTo(4.0,4.0);
	} else {
		icon.get_graphics().moveTo(4.0,4.0);
		icon.get_graphics().lineTo(16.0,4.0);
		icon.get_graphics().lineTo(10.0,16.0);
		icon.get_graphics().lineTo(4.0,4.0);
	}
	icon.get_graphics().endFill();
};
var feathers_themes_steel_components_SteelItemRendererStyles = function() { };
$hxClasses["feathers.themes.steel.components.SteelItemRendererStyles"] = feathers_themes_steel_components_SteelItemRendererStyles;
feathers_themes_steel_components_SteelItemRendererStyles.__name__ = "feathers.themes.steel.components.SteelItemRendererStyles";
feathers_themes_steel_components_SteelItemRendererStyles.initialize = function(theme) {
	if(theme == null) {
		var value = feathers_style_Theme.get_fallbackTheme();
		theme = ((value) instanceof feathers_themes_steel_BaseSteelTheme) ? value : null;
	}
	if(theme == null) {
		return;
	}
	var styleProvider = theme.styleProvider;
	if(styleProvider.getStyleFunction(feathers_controls_dataRenderers_ItemRenderer,null) == null) {
		styleProvider.setStyleFunction(feathers_controls_dataRenderers_ItemRenderer,null,function(itemRenderer) {
			var isDesktop = feathers_utils_DeviceUtil.isDesktop();
			if(itemRenderer.get_backgroundSkin() == null) {
				var skin = new feathers_skins_UnderlineSkin();
				skin.set_fill(theme.getContainerFill());
				skin.set_border(theme.getDividerBorder());
				skin.set_selectedFill(theme.getActiveThemeFill());
				skin.setFillForState(feathers_controls_ToggleButtonState.DOWN(false),theme.getActiveThemeFill());
				if(isDesktop) {
					skin.set_width(26.0);
					skin.set_height(26.0);
					skin.set_minWidth(26.0);
					skin.set_minHeight(26.0);
				} else {
					skin.set_width(44.0);
					skin.set_height(44.0);
					skin.set_minWidth(44.0);
					skin.set_minHeight(44.0);
				}
				itemRenderer.set_backgroundSkin(skin);
			}
			if(itemRenderer.get_textFormat() == null) {
				itemRenderer.set_textFormat(theme.getTextFormat());
			}
			if(itemRenderer.get_disabledTextFormat() == null) {
				itemRenderer.set_disabledTextFormat(theme.getDisabledTextFormat());
			}
			if(itemRenderer.get_secondaryTextFormat() == null) {
				itemRenderer.set_secondaryTextFormat(theme.getSecondaryDetailTextFormat());
			}
			if(itemRenderer.get_disabledSecondaryTextFormat() == null) {
				itemRenderer.set_disabledSecondaryTextFormat(theme.getDisabledDetailTextFormat());
			}
			itemRenderer.set_paddingTop(theme.smallPadding);
			itemRenderer.set_paddingRight(theme.largePadding);
			itemRenderer.set_paddingBottom(theme.smallPadding);
			itemRenderer.set_paddingLeft(theme.largePadding);
			itemRenderer.set_gap(theme.smallPadding);
			itemRenderer.set_horizontalAlign(feathers_layout_HorizontalAlign.LEFT);
		});
	}
};
var feathers_themes_steel_components_SteelLabelStyles = function() { };
$hxClasses["feathers.themes.steel.components.SteelLabelStyles"] = feathers_themes_steel_components_SteelLabelStyles;
feathers_themes_steel_components_SteelLabelStyles.__name__ = "feathers.themes.steel.components.SteelLabelStyles";
feathers_themes_steel_components_SteelLabelStyles.initialize = function(theme) {
	if(theme == null) {
		var value = feathers_style_Theme.get_fallbackTheme();
		theme = ((value) instanceof feathers_themes_steel_BaseSteelTheme) ? value : null;
	}
	if(theme == null) {
		return;
	}
	var styleProvider = theme.styleProvider;
	if(styleProvider.getStyleFunction(feathers_controls_Label,null) == null) {
		styleProvider.setStyleFunction(feathers_controls_Label,null,function(label) {
			if(label.get_textFormat() == null) {
				label.set_textFormat(theme.getTextFormat());
			}
			if(label.get_disabledTextFormat() == null) {
				label.set_disabledTextFormat(theme.getDisabledTextFormat());
			}
		});
	}
	if(styleProvider.getStyleFunction(feathers_controls_Label,feathers_controls_Label.VARIANT_HEADING) == null) {
		styleProvider.setStyleFunction(feathers_controls_Label,feathers_controls_Label.VARIANT_HEADING,function(label) {
			if(label.get_textFormat() == null) {
				label.set_textFormat(theme.getHeaderTextFormat());
			}
			if(label.get_disabledTextFormat() == null) {
				label.set_disabledTextFormat(theme.getDisabledHeaderTextFormat());
			}
		});
	}
	if(styleProvider.getStyleFunction(feathers_controls_Label,feathers_controls_Label.VARIANT_DETAIL) == null) {
		styleProvider.setStyleFunction(feathers_controls_Label,feathers_controls_Label.VARIANT_DETAIL,function(label) {
			if(label.get_textFormat() == null) {
				label.set_textFormat(theme.getDetailTextFormat());
			}
			if(label.get_disabledTextFormat() == null) {
				label.set_disabledTextFormat(theme.getDisabledDetailTextFormat());
			}
		});
	}
	if(styleProvider.getStyleFunction(feathers_controls_Label,feathers_controls_Label.VARIANT_DANGER) == null) {
		styleProvider.setStyleFunction(feathers_controls_Label,feathers_controls_Label.VARIANT_DANGER,function(label) {
			if(label.get_textFormat() == null) {
				label.set_textFormat(theme.getDangerTextFormat());
			}
			if(label.get_disabledTextFormat() == null) {
				label.set_disabledTextFormat(theme.getDisabledTextFormat());
			}
		});
	}
};
var feathers_themes_steel_components_SteelLayoutGroupItemRendererStyles = function() { };
$hxClasses["feathers.themes.steel.components.SteelLayoutGroupItemRendererStyles"] = feathers_themes_steel_components_SteelLayoutGroupItemRendererStyles;
feathers_themes_steel_components_SteelLayoutGroupItemRendererStyles.__name__ = "feathers.themes.steel.components.SteelLayoutGroupItemRendererStyles";
feathers_themes_steel_components_SteelLayoutGroupItemRendererStyles.initialize = function(theme) {
	if(theme == null) {
		var value = feathers_style_Theme.get_fallbackTheme();
		theme = ((value) instanceof feathers_themes_steel_BaseSteelTheme) ? value : null;
	}
	if(theme == null) {
		return;
	}
	var styleProvider = theme.styleProvider;
	if(styleProvider.getStyleFunction(feathers_controls_dataRenderers_LayoutGroupItemRenderer,null) == null) {
		styleProvider.setStyleFunction(feathers_controls_dataRenderers_LayoutGroupItemRenderer,null,function(itemRenderer) {
			var isDesktop = feathers_utils_DeviceUtil.isDesktop();
			if(itemRenderer.get_backgroundSkin() == null) {
				var skin = new feathers_skins_UnderlineSkin();
				skin.set_fill(theme.getContainerFill());
				skin.set_border(theme.getDividerBorder());
				skin.set_selectedFill(theme.getActiveThemeFill());
				skin.setFillForState(feathers_controls_ToggleButtonState.DOWN(false),theme.getActiveThemeFill());
				if(isDesktop) {
					skin.set_width(26.0);
					skin.set_height(26.0);
					skin.set_minWidth(26.0);
					skin.set_minHeight(26.0);
				} else {
					skin.set_width(44.0);
					skin.set_height(44.0);
					skin.set_minWidth(44.0);
					skin.set_minHeight(44.0);
				}
				itemRenderer.set_backgroundSkin(skin);
			}
		});
	}
};
var feathers_themes_steel_components_SteelLayoutGroupStyles = function() { };
$hxClasses["feathers.themes.steel.components.SteelLayoutGroupStyles"] = feathers_themes_steel_components_SteelLayoutGroupStyles;
feathers_themes_steel_components_SteelLayoutGroupStyles.__name__ = "feathers.themes.steel.components.SteelLayoutGroupStyles";
feathers_themes_steel_components_SteelLayoutGroupStyles.initialize = function(theme) {
	if(theme == null) {
		var value = feathers_style_Theme.get_fallbackTheme();
		theme = ((value) instanceof feathers_themes_steel_BaseSteelTheme) ? value : null;
	}
	if(theme == null) {
		return;
	}
	var styleProvider = theme.styleProvider;
	if(styleProvider.getStyleFunction(feathers_controls_LayoutGroup,feathers_controls_LayoutGroup.VARIANT_TOOL_BAR) == null) {
		styleProvider.setStyleFunction(feathers_controls_LayoutGroup,feathers_controls_LayoutGroup.VARIANT_TOOL_BAR,function(group) {
			var isDesktop = feathers_utils_DeviceUtil.isDesktop();
			if(group.get_backgroundSkin() == null) {
				var backgroundSkin = new feathers_skins_RectangleSkin();
				backgroundSkin.set_fill(theme.getHeaderFill());
				backgroundSkin.set_border(feathers_graphics_LineStyle.None);
				if(isDesktop) {
					backgroundSkin.set_width(32.0);
					backgroundSkin.set_height(32.0);
					backgroundSkin.set_minHeight(32.0);
				} else {
					backgroundSkin.set_width(44.0);
					backgroundSkin.set_height(44.0);
					backgroundSkin.set_minHeight(44.0);
				}
				group.set_backgroundSkin(backgroundSkin);
			}
			if(group.get_layout() == null) {
				var layout = new feathers_layout_HorizontalLayout();
				layout.set_horizontalAlign(feathers_layout_HorizontalAlign.LEFT);
				layout.set_verticalAlign(feathers_layout_VerticalAlign.MIDDLE);
				layout.set_paddingTop(theme.smallPadding);
				layout.set_paddingRight(theme.largePadding);
				layout.set_paddingBottom(theme.smallPadding);
				layout.set_paddingLeft(theme.largePadding);
				layout.set_gap(theme.smallPadding);
				group.set_layout(layout);
			}
		});
	}
};
var feathers_themes_steel_components_SteelListViewStyles = function() { };
$hxClasses["feathers.themes.steel.components.SteelListViewStyles"] = feathers_themes_steel_components_SteelListViewStyles;
feathers_themes_steel_components_SteelListViewStyles.__name__ = "feathers.themes.steel.components.SteelListViewStyles";
feathers_themes_steel_components_SteelListViewStyles.initialize = function(theme) {
	if(theme == null) {
		var value = feathers_style_Theme.get_fallbackTheme();
		theme = ((value) instanceof feathers_themes_steel_BaseSteelTheme) ? value : null;
	}
	if(theme == null) {
		return;
	}
	var styleListViewWithBorderVariant = function(listView) {
		var isDesktop = feathers_utils_DeviceUtil.isDesktop();
		listView.set_autoHideScrollBars(!isDesktop);
		listView.set_fixedScrollBars(isDesktop);
		if(listView.get_layout() == null) {
			var layout = new feathers_layout_VerticalListLayout();
			layout.set_requestedRowCount(5.0);
			listView.set_layout(layout);
		}
		if(listView.get_backgroundSkin() == null) {
			var backgroundSkin = new feathers_skins_RectangleSkin();
			backgroundSkin.set_fill(theme.getContainerFill());
			backgroundSkin.set_border(theme.getContainerBorder());
			backgroundSkin.set_width(10.0);
			backgroundSkin.set_height(10.0);
			listView.set_backgroundSkin(backgroundSkin);
		}
		if(listView.get_focusRectSkin() == null) {
			var focusRectSkin = new feathers_skins_RectangleSkin();
			focusRectSkin.set_fill(feathers_graphics_FillStyle.None);
			focusRectSkin.set_border(theme.getFocusBorder());
			listView.set_focusRectSkin(focusRectSkin);
		}
		if(listView.get_dragDropIndicatorSkin() == null) {
			var dragDropIndicatorSkin = new feathers_skins_RectangleSkin();
			dragDropIndicatorSkin.set_fill(theme.getActiveThemeFill());
			dragDropIndicatorSkin.set_border(feathers_graphics_LineStyle.None);
			dragDropIndicatorSkin.set_width(2.0);
			dragDropIndicatorSkin.set_height(2.0);
			listView.set_dragDropIndicatorSkin(dragDropIndicatorSkin);
		}
		listView.set_paddingTop(theme.borderThickness);
		listView.set_paddingRight(theme.borderThickness);
		listView.set_paddingBottom(theme.borderThickness);
		listView.set_paddingLeft(theme.borderThickness);
	};
	var styleListViewWithBorderlessVariant = function(listView) {
		var isDesktop = feathers_utils_DeviceUtil.isDesktop();
		listView.set_autoHideScrollBars(!isDesktop);
		listView.set_fixedScrollBars(isDesktop);
		if(listView.get_layout() == null) {
			var layout = new feathers_layout_VerticalListLayout();
			layout.set_requestedRowCount(5.0);
			listView.set_layout(layout);
		}
		if(listView.get_backgroundSkin() == null) {
			var backgroundSkin = new feathers_skins_RectangleSkin();
			backgroundSkin.set_fill(theme.getContainerFill());
			backgroundSkin.set_border(feathers_graphics_LineStyle.None);
			backgroundSkin.set_width(10.0);
			backgroundSkin.set_height(10.0);
			listView.set_backgroundSkin(backgroundSkin);
		}
		if(listView.get_focusRectSkin() == null) {
			var focusRectSkin = new feathers_skins_RectangleSkin();
			focusRectSkin.set_fill(feathers_graphics_FillStyle.None);
			focusRectSkin.set_border(theme.getFocusBorder());
			listView.set_focusRectSkin(focusRectSkin);
		}
	};
	var styleProvider = theme.styleProvider;
	if(styleProvider.getStyleFunction(feathers_controls_ListView,null) == null) {
		styleProvider.setStyleFunction(feathers_controls_ListView,null,function(listView) {
			var isDesktop = feathers_utils_DeviceUtil.isDesktop();
			if(isDesktop) {
				styleListViewWithBorderVariant(listView);
			} else {
				styleListViewWithBorderlessVariant(listView);
			}
		});
	}
	if(styleProvider.getStyleFunction(feathers_controls_ListView,feathers_controls_ListView.VARIANT_BORDER) == null) {
		styleProvider.setStyleFunction(feathers_controls_ListView,feathers_controls_ListView.VARIANT_BORDER,styleListViewWithBorderVariant);
	}
	if(styleProvider.getStyleFunction(feathers_controls_ListView,feathers_controls_ListView.VARIANT_BORDERLESS) == null) {
		styleProvider.setStyleFunction(feathers_controls_ListView,feathers_controls_ListView.VARIANT_BORDERLESS,styleListViewWithBorderlessVariant);
	}
	if(styleProvider.getStyleFunction(feathers_controls_ListView,feathers_controls_ListView.VARIANT_POP_UP) == null) {
		styleProvider.setStyleFunction(feathers_controls_ListView,feathers_controls_ListView.VARIANT_POP_UP,function(listView) {
			if(listView.get_layout() == null) {
				var layout = new feathers_layout_VerticalListLayout();
				layout.set_requestedMinRowCount(1.0);
				layout.set_requestedMaxRowCount(5.0);
				listView.set_layout(layout);
			}
			styleListViewWithBorderVariant(listView);
		});
	}
};
var feathers_themes_steel_components_SteelNumericStepperStyles = function() { };
$hxClasses["feathers.themes.steel.components.SteelNumericStepperStyles"] = feathers_themes_steel_components_SteelNumericStepperStyles;
feathers_themes_steel_components_SteelNumericStepperStyles.__name__ = "feathers.themes.steel.components.SteelNumericStepperStyles";
feathers_themes_steel_components_SteelNumericStepperStyles.initialize = function(theme) {
	if(theme == null) {
		var value = feathers_style_Theme.get_fallbackTheme();
		theme = ((value) instanceof feathers_themes_steel_BaseSteelTheme) ? value : null;
	}
	if(theme == null) {
		return;
	}
	var styleProvider = theme.styleProvider;
	if(styleProvider.getStyleFunction(feathers_controls_Button,feathers_controls_NumericStepper.CHILD_VARIANT_DECREMENT_BUTTON) == null) {
		styleProvider.setStyleFunction(feathers_controls_Button,feathers_controls_NumericStepper.CHILD_VARIANT_DECREMENT_BUTTON,function(button) {
			var isDesktop = feathers_utils_DeviceUtil.isDesktop();
			if(button.get_backgroundSkin() == null) {
				var skin = new feathers_skins_TabSkin();
				skin.set_cornerRadiusPosition(feathers_layout_RelativePosition.LEFT);
				skin.set_drawBaseBorder(false);
				skin.set_fill(theme.getButtonFill());
				skin.set_disabledFill(theme.getButtonDisabledFill());
				skin.setFillForState(feathers_controls_ButtonState.DOWN,theme.getReversedActiveThemeFill());
				skin.set_border(theme.getButtonBorder());
				skin.set_disabledBorder(theme.getButtonDisabledBorder());
				skin.setBorderForState(feathers_controls_ButtonState.DOWN,theme.getActiveFillBorder());
				skin.set_cornerRadius(3.0);
				skin.set_minWidth(22.0);
				skin.set_minHeight(22.0);
				button.set_backgroundSkin(skin);
			}
			if(button.get_textFormat() == null) {
				button.set_textFormat(theme.getTextFormat());
			}
			if(button.get_disabledTextFormat() == null) {
				button.set_disabledTextFormat(theme.getDisabledTextFormat());
			}
			if(isDesktop) {
				button.set_paddingTop(theme.smallPadding);
				button.set_paddingRight(theme.mediumPadding);
				button.set_paddingBottom(theme.smallPadding);
				button.set_paddingLeft(theme.mediumPadding);
			} else {
				button.set_paddingTop(theme.smallPadding);
				button.set_paddingRight(theme.largePadding);
				button.set_paddingBottom(theme.smallPadding);
				button.set_paddingLeft(theme.largePadding);
			}
			button.set_gap(theme.smallPadding);
		});
	}
	if(styleProvider.getStyleFunction(feathers_controls_Button,feathers_controls_NumericStepper.CHILD_VARIANT_INCREMENT_BUTTON) == null) {
		styleProvider.setStyleFunction(feathers_controls_Button,feathers_controls_NumericStepper.CHILD_VARIANT_INCREMENT_BUTTON,function(button) {
			var isDesktop = feathers_utils_DeviceUtil.isDesktop();
			if(button.get_backgroundSkin() == null) {
				var skin = new feathers_skins_TabSkin();
				skin.set_cornerRadiusPosition(feathers_layout_RelativePosition.RIGHT);
				skin.set_drawBaseBorder(false);
				skin.set_fill(theme.getButtonFill());
				skin.set_disabledFill(theme.getButtonDisabledFill());
				skin.setFillForState(feathers_controls_ButtonState.DOWN,theme.getReversedActiveThemeFill());
				skin.set_border(theme.getButtonBorder());
				skin.set_disabledBorder(theme.getButtonDisabledBorder());
				skin.setBorderForState(feathers_controls_ButtonState.DOWN,theme.getActiveFillBorder());
				skin.set_cornerRadius(3.0);
				skin.set_minWidth(22.0);
				skin.set_minHeight(22.0);
				button.set_backgroundSkin(skin);
			}
			if(button.get_textFormat() == null) {
				button.set_textFormat(theme.getTextFormat());
			}
			if(button.get_disabledTextFormat() == null) {
				button.set_disabledTextFormat(theme.getDisabledTextFormat());
			}
			if(isDesktop) {
				button.set_paddingTop(theme.smallPadding);
				button.set_paddingRight(theme.mediumPadding);
				button.set_paddingBottom(theme.smallPadding);
				button.set_paddingLeft(theme.mediumPadding);
			} else {
				button.set_paddingTop(theme.smallPadding);
				button.set_paddingRight(theme.largePadding);
				button.set_paddingBottom(theme.smallPadding);
				button.set_paddingLeft(theme.largePadding);
			}
			button.set_gap(theme.smallPadding);
		});
	}
	if(styleProvider.getStyleFunction(feathers_controls_TextInput,feathers_controls_NumericStepper.CHILD_VARIANT_TEXT_INPUT) == null) {
		styleProvider.setStyleFunction(feathers_controls_TextInput,feathers_controls_NumericStepper.CHILD_VARIANT_TEXT_INPUT,function(input) {
			var isDesktop = feathers_utils_DeviceUtil.isDesktop();
			if(input.get_backgroundSkin() == null) {
				var inputSkin = new feathers_skins_RectangleSkin();
				inputSkin.set_width(3.0);
				inputSkin.set_fill(theme.getInsetFill());
				inputSkin.set_disabledFill(theme.getDisabledInsetFill());
				inputSkin.set_border(theme.getInsetBorder());
				inputSkin.set_disabledBorder(theme.getDisabledInsetBorder());
				inputSkin.setBorderForState(feathers_controls_TextInputState.FOCUSED,theme.getThemeBorder());
				input.set_backgroundSkin(inputSkin);
			}
			if(input.get_textFormat() == null) {
				input.set_textFormat(theme.getTextFormat());
			}
			if(input.get_disabledTextFormat() == null) {
				input.set_disabledTextFormat(theme.getDisabledTextFormat());
			}
			if(input.get_promptTextFormat() == null) {
				input.set_promptTextFormat(theme.getSecondaryTextFormat());
			}
			if(isDesktop) {
				input.set_paddingTop(theme.smallPadding);
				input.set_paddingRight(theme.mediumPadding);
				input.set_paddingBottom(theme.smallPadding);
				input.set_paddingLeft(theme.mediumPadding);
			} else {
				input.set_paddingTop(theme.mediumPadding);
				input.set_paddingRight(theme.largePadding);
				input.set_paddingBottom(theme.mediumPadding);
				input.set_paddingLeft(theme.largePadding);
			}
		});
	}
};
var feathers_themes_steel_components_SteelPageIndicatorStyles = function() { };
$hxClasses["feathers.themes.steel.components.SteelPageIndicatorStyles"] = feathers_themes_steel_components_SteelPageIndicatorStyles;
feathers_themes_steel_components_SteelPageIndicatorStyles.__name__ = "feathers.themes.steel.components.SteelPageIndicatorStyles";
feathers_themes_steel_components_SteelPageIndicatorStyles.initialize = function(theme) {
	if(theme == null) {
		var value = feathers_style_Theme.get_fallbackTheme();
		theme = ((value) instanceof feathers_themes_steel_BaseSteelTheme) ? value : null;
	}
	if(theme == null) {
		return;
	}
	var styleProvider = theme.styleProvider;
	if(styleProvider.getStyleFunction(feathers_controls_PageIndicator,null) == null) {
		styleProvider.setStyleFunction(feathers_controls_PageIndicator,null,function(pages) {
			if(pages.get_focusRectSkin() == null) {
				var focusRectSkin = new feathers_skins_RectangleSkin();
				focusRectSkin.set_fill(feathers_graphics_FillStyle.None);
				focusRectSkin.set_border(theme.getFocusBorder());
				focusRectSkin.set_cornerRadius(3.0);
				pages.set_focusRectSkin(focusRectSkin);
			}
			if(pages.get_layout() == null) {
				var layout = new feathers_layout_HorizontalLayout();
				layout.set_gap(theme.largePadding);
				layout.set_paddingTop(theme.smallPadding);
				layout.set_paddingRight(theme.smallPadding);
				layout.set_paddingBottom(theme.smallPadding);
				layout.set_paddingLeft(theme.smallPadding);
				layout.set_horizontalAlign(feathers_layout_HorizontalAlign.CENTER);
				layout.set_verticalAlign(feathers_layout_VerticalAlign.MIDDLE);
				pages.set_layout(layout);
			}
		});
	}
	if(styleProvider.getStyleFunction(feathers_controls_ToggleButton,feathers_controls_PageIndicator.CHILD_VARIANT_TOGGLE_BUTTON) == null) {
		styleProvider.setStyleFunction(feathers_controls_ToggleButton,feathers_controls_PageIndicator.CHILD_VARIANT_TOGGLE_BUTTON,function(button) {
			if(button.get_backgroundSkin() == null) {
				var skin = new feathers_skins_CircleSkin();
				skin.set_fill(theme.getButtonFill());
				skin.set_disabledFill(theme.getButtonDisabledFill());
				skin.set_selectedFill(theme.getThemeFill());
				skin.setFillForState(feathers_controls_ToggleButtonState.DOWN(false),theme.getReversedActiveThemeFill());
				skin.setFillForState(feathers_controls_ToggleButtonState.DOWN(false),theme.getReversedActiveThemeFill());
				skin.set_border(theme.getButtonBorder());
				skin.set_disabledBorder(theme.getButtonDisabledBorder());
				skin.set_selectedBorder(theme.getSelectedInsetBorder());
				skin.setBorderForState(feathers_controls_ToggleButtonState.DOWN(false),theme.getActiveFillBorder());
				skin.set_minWidth(10.0);
				skin.set_minHeight(10.0);
				button.set_backgroundSkin(skin);
			}
		});
	}
};
var feathers_themes_steel_components_SteelPageNavigatorStyles = function() { };
$hxClasses["feathers.themes.steel.components.SteelPageNavigatorStyles"] = feathers_themes_steel_components_SteelPageNavigatorStyles;
feathers_themes_steel_components_SteelPageNavigatorStyles.__name__ = "feathers.themes.steel.components.SteelPageNavigatorStyles";
feathers_themes_steel_components_SteelPageNavigatorStyles.initialize = function(theme) {
	if(theme == null) {
		var value = feathers_style_Theme.get_fallbackTheme();
		theme = ((value) instanceof feathers_themes_steel_BaseSteelTheme) ? value : null;
	}
	if(theme == null) {
		return;
	}
	var styleProvider = theme.styleProvider;
	if(styleProvider.getStyleFunction(feathers_controls_navigators_PageNavigator,null) == null) {
		styleProvider.setStyleFunction(feathers_controls_navigators_PageNavigator,null,function(navigator) {
			navigator.set_pageIndicatorPosition(feathers_layout_RelativePosition.BOTTOM);
			navigator.set_previousTransition(new feathers_motion_transitions_SlideTransitionBuilder().setRight().build());
			navigator.set_nextTransition(new feathers_motion_transitions_SlideTransitionBuilder().setLeft().build());
		});
	}
};
var feathers_themes_steel_components_SteelPanelStyles = function() { };
$hxClasses["feathers.themes.steel.components.SteelPanelStyles"] = feathers_themes_steel_components_SteelPanelStyles;
feathers_themes_steel_components_SteelPanelStyles.__name__ = "feathers.themes.steel.components.SteelPanelStyles";
feathers_themes_steel_components_SteelPanelStyles.initialize = function(theme) {
	if(theme == null) {
		var value = feathers_style_Theme.get_fallbackTheme();
		theme = ((value) instanceof feathers_themes_steel_BaseSteelTheme) ? value : null;
	}
	if(theme == null) {
		return;
	}
	var styleProvider = theme.styleProvider;
	if(styleProvider.getStyleFunction(feathers_controls_Panel,null) == null) {
		styleProvider.setStyleFunction(feathers_controls_Panel,null,function(panel) {
			var isDesktop = feathers_utils_DeviceUtil.isDesktop();
			panel.set_autoHideScrollBars(!isDesktop);
			panel.set_fixedScrollBars(isDesktop);
			if(panel.get_backgroundSkin() == null) {
				var backgroundSkin = new feathers_skins_RectangleSkin();
				backgroundSkin.set_fill(theme.getContainerFill());
				backgroundSkin.set_border(feathers_graphics_LineStyle.None);
				panel.set_backgroundSkin(backgroundSkin);
			}
			if(panel.get_scrollBarsCornerSkin() == null) {
				var scrollBarsCornerSkin = new feathers_skins_RectangleSkin();
				scrollBarsCornerSkin.set_fill(theme.getContainerFill());
				scrollBarsCornerSkin.set_border(feathers_graphics_LineStyle.None);
				panel.set_scrollBarsCornerSkin(scrollBarsCornerSkin);
			}
		});
	}
};
var feathers_themes_steel_components_SteelPopUpDatePickerStyles = function() { };
$hxClasses["feathers.themes.steel.components.SteelPopUpDatePickerStyles"] = feathers_themes_steel_components_SteelPopUpDatePickerStyles;
feathers_themes_steel_components_SteelPopUpDatePickerStyles.__name__ = "feathers.themes.steel.components.SteelPopUpDatePickerStyles";
feathers_themes_steel_components_SteelPopUpDatePickerStyles.initialize = function(theme) {
	if(theme == null) {
		var value = feathers_style_Theme.get_fallbackTheme();
		theme = ((value) instanceof feathers_themes_steel_BaseSteelTheme) ? value : null;
	}
	if(theme == null) {
		return;
	}
	var styleProvider = theme.styleProvider;
	if(styleProvider.getStyleFunction(feathers_controls_Button,feathers_controls_PopUpDatePicker.CHILD_VARIANT_BUTTON) == null) {
		styleProvider.setStyleFunction(feathers_controls_Button,feathers_controls_PopUpDatePicker.CHILD_VARIANT_BUTTON,function(button) {
			var isDesktop = feathers_utils_DeviceUtil.isDesktop();
			if(button.get_backgroundSkin() == null) {
				var skin = new feathers_skins_TabSkin();
				skin.set_cornerRadiusPosition(feathers_layout_RelativePosition.RIGHT);
				skin.set_fill(theme.getButtonFill());
				skin.set_disabledFill(theme.getButtonDisabledFill());
				skin.setFillForState(feathers_controls_ButtonState.DOWN,theme.getReversedActiveThemeFill());
				skin.set_border(theme.getButtonBorder());
				skin.set_disabledBorder(theme.getButtonDisabledBorder());
				skin.setBorderForState(feathers_controls_ButtonState.DOWN,theme.getActiveFillBorder());
				skin.set_cornerRadius(3.0);
				button.set_backgroundSkin(skin);
			}
			if(button.get_icon() == null) {
				var icon = new openfl_display_Shape();
				feathers_themes_steel_components_SteelPopUpDatePickerStyles.drawIcon(icon,theme.textColor);
				button.set_icon(icon);
				if(button.getIconForState(feathers_controls_ButtonState.DISABLED) == null) {
					var disabledIcon = new openfl_display_Shape();
					feathers_themes_steel_components_SteelPopUpDatePickerStyles.drawIcon(disabledIcon,theme.disabledTextColor);
					button.setIconForState(feathers_controls_ButtonState.DISABLED,disabledIcon);
				}
			}
			if(isDesktop) {
				button.set_paddingTop(theme.smallPadding);
				button.set_paddingRight(theme.mediumPadding);
				button.set_paddingBottom(theme.smallPadding);
				button.set_paddingLeft(theme.mediumPadding);
			} else {
				button.set_paddingTop(theme.smallPadding);
				button.set_paddingRight(theme.largePadding);
				button.set_paddingBottom(theme.smallPadding);
				button.set_paddingLeft(theme.largePadding);
			}
			button.set_gap(theme.smallPadding);
		});
	}
	if(styleProvider.getStyleFunction(feathers_controls_TextInput,feathers_controls_PopUpDatePicker.CHILD_VARIANT_TEXT_INPUT) == null) {
		styleProvider.setStyleFunction(feathers_controls_TextInput,feathers_controls_PopUpDatePicker.CHILD_VARIANT_TEXT_INPUT,function(input) {
			var isDesktop = feathers_utils_DeviceUtil.isDesktop();
			if(input.get_backgroundSkin() == null) {
				var inputSkin = new feathers_skins_TabSkin();
				inputSkin.set_cornerRadiusPosition(feathers_layout_RelativePosition.LEFT);
				inputSkin.set_cornerRadius(3.0);
				inputSkin.set_drawBaseBorder(false);
				if(isDesktop) {
					inputSkin.set_width(120.0);
				} else {
					inputSkin.set_width(160.0);
				}
				inputSkin.set_fill(theme.getInsetFill());
				inputSkin.set_disabledFill(theme.getDisabledInsetFill());
				inputSkin.set_border(theme.getInsetBorder());
				inputSkin.set_disabledBorder(theme.getDisabledInsetBorder());
				inputSkin.setBorderForState(feathers_controls_TextInputState.FOCUSED,theme.getThemeBorder());
				input.set_backgroundSkin(inputSkin);
			}
			if(input.get_textFormat() == null) {
				input.set_textFormat(theme.getTextFormat());
			}
			if(input.get_disabledTextFormat() == null) {
				input.set_disabledTextFormat(theme.getDisabledTextFormat());
			}
			if(input.get_promptTextFormat() == null) {
				input.set_promptTextFormat(theme.getSecondaryTextFormat());
			}
			if(isDesktop) {
				input.set_paddingTop(theme.smallPadding);
				input.set_paddingRight(theme.mediumPadding);
				input.set_paddingBottom(theme.smallPadding);
				input.set_paddingLeft(theme.mediumPadding);
			} else {
				input.set_paddingTop(theme.mediumPadding);
				input.set_paddingRight(theme.largePadding);
				input.set_paddingBottom(theme.mediumPadding);
				input.set_paddingLeft(theme.largePadding);
			}
		});
	}
	if(styleProvider.getStyleFunction(feathers_controls_DatePicker,feathers_controls_PopUpDatePicker.CHILD_VARIANT_DATE_PICKER) == null) {
		styleProvider.setStyleFunction(feathers_controls_DatePicker,feathers_controls_PopUpDatePicker.CHILD_VARIANT_DATE_PICKER,function(datePicker) {
			if(datePicker.get_backgroundSkin() == null) {
				var backgroundSkin = new feathers_skins_RectangleSkin();
				backgroundSkin.set_fill(theme.getContainerFill());
				backgroundSkin.set_border(theme.getContainerBorder());
				backgroundSkin.set_cornerRadius(4.0);
				datePicker.set_backgroundSkin(backgroundSkin);
			}
			datePicker.setPadding(theme.mediumPadding);
			datePicker.set_headerGap(theme.xsmallPadding);
		});
	}
};
feathers_themes_steel_components_SteelPopUpDatePickerStyles.drawIcon = function(icon,iconColor) {
	icon.get_graphics().lineStyle(1.0,iconColor);
	icon.get_graphics().drawRect(0.5,1.5,11.0,10.0);
	icon.get_graphics().moveTo(3.0,0.5);
	icon.get_graphics().lineTo(3.0,1.5);
	icon.get_graphics().moveTo(9.0,0.5);
	icon.get_graphics().lineTo(9.0,1.5);
	icon.get_graphics().lineStyle();
	icon.get_graphics().beginFill(iconColor);
	icon.get_graphics().drawRect(1.0,2.0,11.0,2.0);
	icon.get_graphics().drawRect(2.0,5.0,2.0,2.0);
	icon.get_graphics().drawRect(5.0,5.0,2.0,2.0);
	icon.get_graphics().drawRect(8.0,5.0,2.0,2.0);
	icon.get_graphics().drawRect(2.0,8.0,2.0,2.0);
	icon.get_graphics().drawRect(5.0,8.0,2.0,2.0);
	icon.get_graphics().drawRect(8.0,8.0,2.0,2.0);
	icon.get_graphics().endFill();
};
var feathers_themes_steel_components_SteelPopUpListViewStyles = function() { };
$hxClasses["feathers.themes.steel.components.SteelPopUpListViewStyles"] = feathers_themes_steel_components_SteelPopUpListViewStyles;
feathers_themes_steel_components_SteelPopUpListViewStyles.__name__ = "feathers.themes.steel.components.SteelPopUpListViewStyles";
feathers_themes_steel_components_SteelPopUpListViewStyles.initialize = function(theme) {
	if(theme == null) {
		var value = feathers_style_Theme.get_fallbackTheme();
		theme = ((value) instanceof feathers_themes_steel_BaseSteelTheme) ? value : null;
	}
	if(theme == null) {
		return;
	}
	var styleProvider = theme.styleProvider;
	if(styleProvider.getStyleFunction(feathers_controls_PopUpListView,null) == null) {
		styleProvider.setStyleFunction(feathers_controls_PopUpListView,null,function(listView) {
			var isDesktop = feathers_utils_DeviceUtil.isDesktop();
			if(isDesktop) {
				listView.set_popUpAdapter(new feathers_controls_popups_DropDownPopUpAdapter());
			}
		});
	}
	if(styleProvider.getStyleFunction(feathers_controls_Button,feathers_controls_PopUpListView.CHILD_VARIANT_BUTTON) == null) {
		styleProvider.setStyleFunction(feathers_controls_Button,feathers_controls_PopUpListView.CHILD_VARIANT_BUTTON,function(button) {
			(theme.styleProvider.getStyleFunction(feathers_controls_Button,null))(button);
			button.set_horizontalAlign(feathers_layout_HorizontalAlign.LEFT);
			button.set_gap(1.0 / 0.0);
			button.set_minGap(theme.mediumPadding);
			if(button.get_icon() == null) {
				var icon = new feathers_skins_TriangleSkin();
				icon.set_pointPosition(feathers_layout_RelativePosition.BOTTOM);
				icon.set_fill(feathers_graphics_FillStyle.SolidColor(theme.textColor));
				icon.set_disabledFill(feathers_graphics_FillStyle.SolidColor(theme.disabledTextColor));
				icon.set_width(8.0);
				icon.set_height(4.0);
				button.set_icon(icon);
			}
			button.set_iconPosition(feathers_layout_RelativePosition.RIGHT);
		});
	}
	if(styleProvider.getStyleFunction(feathers_controls_ListView,feathers_controls_PopUpListView.CHILD_VARIANT_LIST_VIEW) == null) {
		styleProvider.setStyleFunction(feathers_controls_ListView,feathers_controls_PopUpListView.CHILD_VARIANT_LIST_VIEW,function(listView) {
			(theme.styleProvider.getStyleFunction(feathers_controls_ListView,feathers_controls_ListView.VARIANT_POP_UP))(listView);
		});
	}
};
var feathers_themes_steel_components_SteelRadioStyles = function() { };
$hxClasses["feathers.themes.steel.components.SteelRadioStyles"] = feathers_themes_steel_components_SteelRadioStyles;
feathers_themes_steel_components_SteelRadioStyles.__name__ = "feathers.themes.steel.components.SteelRadioStyles";
feathers_themes_steel_components_SteelRadioStyles.initialize = function(theme) {
	if(theme == null) {
		var value = feathers_style_Theme.get_fallbackTheme();
		theme = ((value) instanceof feathers_themes_steel_BaseSteelTheme) ? value : null;
	}
	if(theme == null) {
		return;
	}
	var styleProvider = theme.styleProvider;
	if(styleProvider.getStyleFunction(feathers_controls_Radio,null) == null) {
		styleProvider.setStyleFunction(feathers_controls_Radio,null,function(radio) {
			var isDesktop = feathers_utils_DeviceUtil.isDesktop();
			if(radio.get_textFormat() == null) {
				radio.set_textFormat(theme.getTextFormat());
			}
			if(radio.get_disabledTextFormat() == null) {
				radio.set_disabledTextFormat(theme.getDisabledTextFormat());
			}
			if(radio.get_backgroundSkin() == null) {
				var backgroundSkin = new feathers_skins_RectangleSkin();
				backgroundSkin.set_fill(feathers_graphics_FillStyle.SolidColor(0,0.0));
				backgroundSkin.set_border(feathers_graphics_LineStyle.None);
				radio.set_backgroundSkin(backgroundSkin);
			}
			if(radio.get_icon() == null) {
				var icon = new feathers_skins_MultiSkin();
				radio.set_icon(icon);
				var defaultIcon = new feathers_skins_CircleSkin();
				if(isDesktop) {
					defaultIcon.set_width(16.0);
					defaultIcon.set_height(16.0);
					defaultIcon.set_minWidth(16.0);
					defaultIcon.set_minHeight(16.0);
				} else {
					defaultIcon.set_width(20.0);
					defaultIcon.set_height(20.0);
					defaultIcon.set_minWidth(20.0);
					defaultIcon.set_minHeight(20.0);
				}
				defaultIcon.set_border(theme.getInsetBorder());
				defaultIcon.set_disabledBorder(theme.getDisabledInsetBorder());
				defaultIcon.setBorderForState(feathers_controls_ToggleButtonState.DOWN(false),theme.getSelectedInsetBorder());
				defaultIcon.set_fill(theme.getInsetFill());
				defaultIcon.set_disabledFill(theme.getDisabledInsetFill());
				icon.set_defaultView(defaultIcon);
				var selectedIcon = new feathers_skins_CircleSkin();
				if(isDesktop) {
					selectedIcon.set_width(16.0);
					selectedIcon.set_height(16.0);
					selectedIcon.set_minWidth(16.0);
					selectedIcon.set_minHeight(16.0);
				} else {
					selectedIcon.set_width(20.0);
					selectedIcon.set_height(20.0);
					selectedIcon.set_minWidth(20.0);
					selectedIcon.set_minHeight(20.0);
				}
				selectedIcon.set_border(theme.getSelectedInsetBorder());
				selectedIcon.set_disabledBorder(theme.getDisabledInsetBorder());
				selectedIcon.setBorderForState(feathers_controls_ToggleButtonState.DOWN(true),theme.getSelectedInsetBorder());
				selectedIcon.set_fill(theme.getReversedActiveThemeFill());
				selectedIcon.set_disabledFill(theme.getDisabledInsetFill());
				var symbol = new openfl_display_Shape();
				symbol.get_graphics().beginFill(theme.textColor);
				if(isDesktop) {
					symbol.get_graphics().drawCircle(8.0,8.0,3.0);
				} else {
					symbol.get_graphics().drawCircle(10.0,10.0,4.0);
				}
				symbol.get_graphics().endFill();
				selectedIcon.addChild(symbol);
				icon.set_selectedView(selectedIcon);
				var disabledAndSelectedIcon = new feathers_skins_CircleSkin();
				disabledAndSelectedIcon.set_width(20.0);
				disabledAndSelectedIcon.set_height(20.0);
				disabledAndSelectedIcon.set_minWidth(20.0);
				disabledAndSelectedIcon.set_minHeight(20.0);
				disabledAndSelectedIcon.set_border(theme.getDisabledInsetBorder(2.0));
				disabledAndSelectedIcon.set_fill(theme.getDisabledInsetFill());
				var disabledSymbol = new openfl_display_Shape();
				disabledSymbol.get_graphics().beginFill(theme.disabledTextColor);
				disabledSymbol.get_graphics().drawCircle(10.0,10.0,4.0);
				disabledSymbol.get_graphics().endFill();
				disabledAndSelectedIcon.addChild(disabledSymbol);
				icon.setViewForState(feathers_controls_ToggleButtonState.DISABLED(true),disabledAndSelectedIcon);
			}
			if(radio.get_focusRectSkin() == null) {
				var focusRectSkin = new feathers_skins_RectangleSkin();
				focusRectSkin.set_fill(feathers_graphics_FillStyle.None);
				focusRectSkin.set_border(theme.getFocusBorder());
				focusRectSkin.set_cornerRadius(3.0);
				radio.set_focusRectSkin(focusRectSkin);
				radio.set_focusPaddingTop(3.0);
				radio.set_focusPaddingRight(3.0);
				radio.set_focusPaddingBottom(3.0);
				radio.set_focusPaddingLeft(3.0);
			}
			radio.set_horizontalAlign(feathers_layout_HorizontalAlign.LEFT);
			radio.set_gap(theme.smallPadding);
		});
	}
};
var feathers_themes_steel_components_SteelRouterNavigatorStyles = function() { };
$hxClasses["feathers.themes.steel.components.SteelRouterNavigatorStyles"] = feathers_themes_steel_components_SteelRouterNavigatorStyles;
feathers_themes_steel_components_SteelRouterNavigatorStyles.__name__ = "feathers.themes.steel.components.SteelRouterNavigatorStyles";
feathers_themes_steel_components_SteelRouterNavigatorStyles.initialize = function(theme) {
	if(theme == null) {
		var value = feathers_style_Theme.get_fallbackTheme();
		theme = ((value) instanceof feathers_themes_steel_BaseSteelTheme) ? value : null;
	}
	if(theme == null) {
		return;
	}
	var styleProvider = theme.styleProvider;
	if(styleProvider.getStyleFunction(feathers_controls_navigators_RouterNavigator,null) == null) {
		styleProvider.setStyleFunction(feathers_controls_navigators_RouterNavigator,null,function(navigator) {
			navigator.set_backTransition(new feathers_motion_transitions_SlideTransitionBuilder().setRight().build());
			navigator.set_forwardTransition(new feathers_motion_transitions_SlideTransitionBuilder().setLeft().build());
		});
	}
};
var feathers_themes_steel_components_SteelScrollContainerStyles = function() { };
$hxClasses["feathers.themes.steel.components.SteelScrollContainerStyles"] = feathers_themes_steel_components_SteelScrollContainerStyles;
feathers_themes_steel_components_SteelScrollContainerStyles.__name__ = "feathers.themes.steel.components.SteelScrollContainerStyles";
feathers_themes_steel_components_SteelScrollContainerStyles.initialize = function(theme) {
	if(theme == null) {
		var value = feathers_style_Theme.get_fallbackTheme();
		theme = ((value) instanceof feathers_themes_steel_BaseSteelTheme) ? value : null;
	}
	if(theme == null) {
		return;
	}
	var styleProvider = theme.styleProvider;
	if(styleProvider.getStyleFunction(feathers_controls_ScrollContainer,null) == null) {
		styleProvider.setStyleFunction(feathers_controls_ScrollContainer,null,function(container) {
			var isDesktop = feathers_utils_DeviceUtil.isDesktop();
			container.set_autoHideScrollBars(!isDesktop);
			container.set_fixedScrollBars(isDesktop);
			if(container.get_backgroundSkin() == null) {
				var backgroundSkin = new feathers_skins_RectangleSkin();
				backgroundSkin.set_fill(theme.getContainerFill());
				backgroundSkin.set_border(feathers_graphics_LineStyle.None);
				container.set_backgroundSkin(backgroundSkin);
			}
			if(container.get_scrollBarsCornerSkin() == null) {
				var scrollBarsCornerSkin = new feathers_skins_RectangleSkin();
				scrollBarsCornerSkin.set_fill(theme.getContainerFill());
				scrollBarsCornerSkin.set_border(feathers_graphics_LineStyle.None);
				container.set_scrollBarsCornerSkin(scrollBarsCornerSkin);
			}
			if(container.get_focusRectSkin() == null) {
				var focusRectSkin = new feathers_skins_RectangleSkin();
				focusRectSkin.set_fill(feathers_graphics_FillStyle.None);
				focusRectSkin.set_border(theme.getFocusBorder());
				container.set_focusRectSkin(focusRectSkin);
			}
		});
	}
};
var feathers_themes_steel_components_SteelSortOrderHeaderRendererStyles = function() { };
$hxClasses["feathers.themes.steel.components.SteelSortOrderHeaderRendererStyles"] = feathers_themes_steel_components_SteelSortOrderHeaderRendererStyles;
feathers_themes_steel_components_SteelSortOrderHeaderRendererStyles.__name__ = "feathers.themes.steel.components.SteelSortOrderHeaderRendererStyles";
feathers_themes_steel_components_SteelSortOrderHeaderRendererStyles.initialize = function(theme) {
	if(theme == null) {
		var value = feathers_style_Theme.get_fallbackTheme();
		theme = ((value) instanceof feathers_themes_steel_BaseSteelTheme) ? value : null;
	}
	if(theme == null) {
		return;
	}
	var styleProvider = theme.styleProvider;
	if(styleProvider.getStyleFunction(feathers_controls_dataRenderers_SortOrderHeaderRenderer,null) == null) {
		styleProvider.setStyleFunction(feathers_controls_dataRenderers_SortOrderHeaderRenderer,null,function(itemRenderer) {
			var isDesktop = feathers_utils_DeviceUtil.isDesktop();
			if(itemRenderer.get_backgroundSkin() == null) {
				var skin = new feathers_skins_RectangleSkin();
				skin.set_fill(theme.getSubHeadingFill());
				skin.set_border(feathers_graphics_LineStyle.None);
				if(isDesktop) {
					skin.set_width(22.0);
					skin.set_height(22.0);
					skin.set_minWidth(22.0);
					skin.set_minHeight(22.0);
				} else {
					skin.set_width(44.0);
					skin.set_height(44.0);
					skin.set_minWidth(44.0);
					skin.set_minHeight(44.0);
				}
				itemRenderer.set_backgroundSkin(skin);
			}
			if(itemRenderer.get_sortAscendingIcon() == null) {
				var sortAscendingIcon = new feathers_skins_TriangleSkin();
				sortAscendingIcon.set_pointPosition(feathers_layout_RelativePosition.TOP);
				sortAscendingIcon.set_fill(feathers_graphics_FillStyle.SolidColor(theme.textColor));
				sortAscendingIcon.set_disabledFill(feathers_graphics_FillStyle.SolidColor(theme.disabledTextColor));
				sortAscendingIcon.set_width(8.0);
				sortAscendingIcon.set_height(4.0);
				itemRenderer.set_sortAscendingIcon(sortAscendingIcon);
			}
			if(itemRenderer.get_sortDescendingIcon() == null) {
				var sortDescendingIcon = new feathers_skins_TriangleSkin();
				sortDescendingIcon.set_pointPosition(feathers_layout_RelativePosition.BOTTOM);
				sortDescendingIcon.set_fill(feathers_graphics_FillStyle.SolidColor(theme.textColor));
				sortDescendingIcon.set_disabledFill(feathers_graphics_FillStyle.SolidColor(theme.disabledTextColor));
				sortDescendingIcon.set_width(8.0);
				sortDescendingIcon.set_height(4.0);
				itemRenderer.set_sortDescendingIcon(sortDescendingIcon);
			}
			if(itemRenderer.get_textFormat() == null) {
				itemRenderer.set_textFormat(theme.getTextFormat());
			}
			if(itemRenderer.get_disabledTextFormat() == null) {
				itemRenderer.set_disabledTextFormat(theme.getDisabledTextFormat());
			}
			if(itemRenderer.get_secondaryTextFormat() == null) {
				itemRenderer.set_secondaryTextFormat(theme.getSecondaryDetailTextFormat());
			}
			if(itemRenderer.get_disabledSecondaryTextFormat() == null) {
				itemRenderer.set_disabledSecondaryTextFormat(theme.getDisabledDetailTextFormat());
			}
			itemRenderer.set_paddingTop(theme.smallPadding);
			itemRenderer.set_paddingRight(theme.largePadding);
			itemRenderer.set_paddingBottom(theme.smallPadding);
			itemRenderer.set_paddingLeft(theme.largePadding);
			itemRenderer.set_gap(theme.smallPadding);
			itemRenderer.set_horizontalAlign(feathers_layout_HorizontalAlign.LEFT);
		});
	}
};
var feathers_themes_steel_components_SteelStackNavigatorStyles = function() { };
$hxClasses["feathers.themes.steel.components.SteelStackNavigatorStyles"] = feathers_themes_steel_components_SteelStackNavigatorStyles;
feathers_themes_steel_components_SteelStackNavigatorStyles.__name__ = "feathers.themes.steel.components.SteelStackNavigatorStyles";
feathers_themes_steel_components_SteelStackNavigatorStyles.initialize = function(theme) {
	if(theme == null) {
		var value = feathers_style_Theme.get_fallbackTheme();
		theme = ((value) instanceof feathers_themes_steel_BaseSteelTheme) ? value : null;
	}
	if(theme == null) {
		return;
	}
	var styleProvider = theme.styleProvider;
	if(styleProvider.getStyleFunction(feathers_controls_navigators_StackNavigator,null) == null) {
		styleProvider.setStyleFunction(feathers_controls_navigators_StackNavigator,null,function(navigator) {
			navigator.set_popTransition(new feathers_motion_transitions_SlideTransitionBuilder().setRight().build());
			navigator.set_pushTransition(new feathers_motion_transitions_SlideTransitionBuilder().setLeft().build());
		});
	}
};
var feathers_themes_steel_components_SteelTabBarStyles = function() { };
$hxClasses["feathers.themes.steel.components.SteelTabBarStyles"] = feathers_themes_steel_components_SteelTabBarStyles;
feathers_themes_steel_components_SteelTabBarStyles.__name__ = "feathers.themes.steel.components.SteelTabBarStyles";
feathers_themes_steel_components_SteelTabBarStyles.initialize = function(theme) {
	if(theme == null) {
		var value = feathers_style_Theme.get_fallbackTheme();
		theme = ((value) instanceof feathers_themes_steel_BaseSteelTheme) ? value : null;
	}
	if(theme == null) {
		return;
	}
	var styleProvider = theme.styleProvider;
	if(styleProvider.getStyleFunction(feathers_controls_TabBar,null) == null) {
		styleProvider.setStyleFunction(feathers_controls_TabBar,null,function(tabBar) {
			var isDesktop = feathers_utils_DeviceUtil.isDesktop();
			if(tabBar.get_backgroundSkin() == null) {
				var skin = new feathers_skins_RectangleSkin();
				skin.set_fill(theme.getControlFill());
				skin.set_disabledFill(theme.getControlDisabledFill());
				skin.set_border(feathers_graphics_LineStyle.None);
				tabBar.set_backgroundSkin(skin);
			}
			if(tabBar.get_focusRectSkin() == null) {
				var focusRectSkin = new feathers_skins_RectangleSkin();
				focusRectSkin.set_fill(feathers_graphics_FillStyle.None);
				focusRectSkin.set_border(theme.getFocusBorder());
				tabBar.set_focusRectSkin(focusRectSkin);
			}
			if(tabBar.get_layout() == null) {
				var layout = new feathers_layout_HorizontalLayout();
				if(!isDesktop) {
					layout.set_horizontalAlign(feathers_layout_HorizontalAlign.CENTER);
				}
				tabBar.set_layout(layout);
			}
		});
	}
	if(styleProvider.getStyleFunction(feathers_controls_ToggleButton,feathers_controls_TabBar.CHILD_VARIANT_TAB) == null) {
		styleProvider.setStyleFunction(feathers_controls_ToggleButton,feathers_controls_TabBar.CHILD_VARIANT_TAB,function(button) {
			var isDesktop = feathers_utils_DeviceUtil.isDesktop();
			if(button.get_backgroundSkin() == null) {
				var skin = null;
				if(isDesktop) {
					var desktopSkin = new feathers_skins_TabSkin();
					desktopSkin.set_cornerRadius(3.0);
					desktopSkin.set_cornerRadiusPosition(feathers_layout_RelativePosition.TOP);
					desktopSkin.set_drawBaseBorder(false);
					desktopSkin.set_maxWidth(100.0);
					desktopSkin.set_minWidth(20.0);
					skin = desktopSkin;
				} else {
					var mobileSkin = new feathers_skins_RectangleSkin();
					mobileSkin.set_minWidth(44.0);
					mobileSkin.set_minHeight(44.0);
					skin = mobileSkin;
				}
				skin.set_fill(theme.getButtonFill());
				skin.set_disabledFill(theme.getButtonDisabledFill());
				skin.set_selectedFill(theme.getThemeFill());
				skin.setFillForState(feathers_controls_ToggleButtonState.DOWN(false),theme.getReversedActiveThemeFill());
				skin.setFillForState(feathers_controls_ToggleButtonState.DOWN(false),theme.getReversedActiveThemeFill());
				skin.set_border(theme.getButtonBorder());
				skin.set_disabledBorder(theme.getButtonDisabledBorder());
				skin.set_selectedBorder(theme.getActiveFillBorder());
				skin.setBorderForState(feathers_controls_ToggleButtonState.DOWN(false),theme.getActiveFillBorder());
				button.set_backgroundSkin(skin);
			}
			if(button.get_textFormat() == null) {
				button.set_textFormat(theme.getTextFormat());
			}
			if(button.get_disabledTextFormat() == null) {
				button.set_disabledTextFormat(theme.getDisabledTextFormat());
			}
			button.set_paddingTop(theme.smallPadding);
			button.set_paddingRight(theme.largePadding);
			button.set_paddingBottom(theme.smallPadding);
			button.set_paddingLeft(theme.largePadding);
			button.set_gap(theme.smallPadding);
		});
	}
};
var feathers_themes_steel_components_SteelTabNavigatorStyles = function() { };
$hxClasses["feathers.themes.steel.components.SteelTabNavigatorStyles"] = feathers_themes_steel_components_SteelTabNavigatorStyles;
feathers_themes_steel_components_SteelTabNavigatorStyles.__name__ = "feathers.themes.steel.components.SteelTabNavigatorStyles";
feathers_themes_steel_components_SteelTabNavigatorStyles.initialize = function(theme) {
	if(theme == null) {
		var value = feathers_style_Theme.get_fallbackTheme();
		theme = ((value) instanceof feathers_themes_steel_BaseSteelTheme) ? value : null;
	}
	if(theme == null) {
		return;
	}
	var styleProvider = theme.styleProvider;
	if(styleProvider.getStyleFunction(feathers_controls_navigators_TabNavigator,null) == null) {
		styleProvider.setStyleFunction(feathers_controls_navigators_TabNavigator,null,function(navigator) {
			var isDesktop = feathers_utils_DeviceUtil.isDesktop();
			navigator.set_tabBarPosition(isDesktop ? feathers_layout_RelativePosition.TOP : feathers_layout_RelativePosition.BOTTOM);
			if(!isDesktop) {
				navigator.set_previousTransition(new feathers_motion_transitions_SlideTransitionBuilder().setRight().build());
				navigator.set_nextTransition(new feathers_motion_transitions_SlideTransitionBuilder().setLeft().build());
			}
		});
	}
};
var feathers_themes_steel_components_SteelTextAreaStyles = function() { };
$hxClasses["feathers.themes.steel.components.SteelTextAreaStyles"] = feathers_themes_steel_components_SteelTextAreaStyles;
feathers_themes_steel_components_SteelTextAreaStyles.__name__ = "feathers.themes.steel.components.SteelTextAreaStyles";
feathers_themes_steel_components_SteelTextAreaStyles.initialize = function(theme) {
	if(theme == null) {
		var value = feathers_style_Theme.get_fallbackTheme();
		theme = ((value) instanceof feathers_themes_steel_BaseSteelTheme) ? value : null;
	}
	if(theme == null) {
		return;
	}
	var styleProvider = theme.styleProvider;
	if(styleProvider.getStyleFunction(feathers_controls_TextArea,null) == null) {
		styleProvider.setStyleFunction(feathers_controls_TextArea,null,function(textArea) {
			var isDesktop = feathers_utils_DeviceUtil.isDesktop();
			textArea.set_autoHideScrollBars(!isDesktop);
			textArea.set_fixedScrollBars(isDesktop);
			if(textArea.get_backgroundSkin() == null) {
				var backgroundSkin = new feathers_skins_RectangleSkin();
				backgroundSkin.set_cornerRadius(3.0);
				if(isDesktop) {
					backgroundSkin.set_width(120.0);
					backgroundSkin.set_height(100.0);
				} else {
					backgroundSkin.set_width(160.0);
					backgroundSkin.set_height(120.0);
				}
				backgroundSkin.set_fill(theme.getInsetFill());
				backgroundSkin.set_border(theme.getInsetBorder());
				backgroundSkin.setBorderForState(feathers_controls_TextInputState.FOCUSED,theme.getThemeBorder());
				backgroundSkin.setBorderForState(feathers_controls_TextInputState.ERROR,theme.getDangerBorder());
				textArea.set_backgroundSkin(backgroundSkin);
			}
			if(textArea.get_textFormat() == null) {
				textArea.set_textFormat(theme.getTextFormat());
			}
			if(textArea.get_disabledTextFormat() == null) {
				textArea.set_disabledTextFormat(theme.getDisabledTextFormat());
			}
			if(textArea.get_promptTextFormat() == null) {
				textArea.set_promptTextFormat(theme.getSecondaryTextFormat());
			}
			textArea.set_paddingTop(theme.borderThickness);
			textArea.set_paddingRight(theme.borderThickness);
			textArea.set_paddingBottom(theme.borderThickness);
			textArea.set_paddingLeft(theme.borderThickness);
			if(isDesktop) {
				textArea.set_textPaddingTop(theme.smallPadding);
				textArea.set_textPaddingRight(theme.mediumPadding);
				textArea.set_textPaddingBottom(theme.smallPadding + 1);
				textArea.set_textPaddingLeft(theme.mediumPadding);
			} else {
				textArea.set_textPaddingTop(theme.mediumPadding);
				textArea.set_textPaddingRight(theme.largePadding);
				textArea.set_textPaddingBottom(theme.mediumPadding + 1);
				textArea.set_textPaddingLeft(theme.largePadding);
			}
		});
	}
	if(styleProvider.getStyleFunction(feathers_controls_TextCallout,feathers_controls_TextArea.CHILD_VARIANT_ERROR_CALLOUT) == null) {
		styleProvider.setStyleFunction(feathers_controls_TextCallout,feathers_controls_TextArea.CHILD_VARIANT_ERROR_CALLOUT,function(callout) {
			(theme.styleProvider.getStyleFunction(feathers_controls_TextCallout,feathers_controls_TextCallout.VARIANT_DANGER))(callout);
		});
	}
};
var feathers_themes_steel_components_SteelTextCalloutStyles = function() { };
$hxClasses["feathers.themes.steel.components.SteelTextCalloutStyles"] = feathers_themes_steel_components_SteelTextCalloutStyles;
feathers_themes_steel_components_SteelTextCalloutStyles.__name__ = "feathers.themes.steel.components.SteelTextCalloutStyles";
feathers_themes_steel_components_SteelTextCalloutStyles.initialize = function(theme) {
	if(theme == null) {
		var value = feathers_style_Theme.get_fallbackTheme();
		theme = ((value) instanceof feathers_themes_steel_BaseSteelTheme) ? value : null;
	}
	if(theme == null) {
		return;
	}
	var styleProvider = theme.styleProvider;
	if(styleProvider.getStyleFunction(feathers_controls_TextCallout,null) == null) {
		styleProvider.setStyleFunction(feathers_controls_TextCallout,null,function(callout) {
			if(callout.get_textFormat() == null) {
				callout.set_textFormat(theme.getTextFormat());
			}
			if(callout.get_disabledTextFormat() == null) {
				callout.set_disabledTextFormat(theme.getDisabledTextFormat());
			}
			if(callout.get_backgroundSkin() == null) {
				var backgroundSkin = new feathers_skins_RectangleSkin();
				backgroundSkin.set_fill(theme.getContainerFill());
				backgroundSkin.set_border(theme.getContainerBorder());
				callout.set_backgroundSkin(backgroundSkin);
			}
			if(callout.get_topArrowSkin() == null) {
				var topArrowSkin = new feathers_skins_TriangleSkin();
				topArrowSkin.set_pointPosition(feathers_layout_RelativePosition.TOP);
				topArrowSkin.set_drawBaseBorder(false);
				topArrowSkin.set_fill(theme.getContainerFill());
				topArrowSkin.set_border(theme.getContainerBorder());
				topArrowSkin.set_width(10.0);
				topArrowSkin.set_height(6.0);
				callout.set_topArrowSkin(topArrowSkin);
			}
			if(callout.get_rightArrowSkin() == null) {
				var rightArrowSkin = new feathers_skins_TriangleSkin();
				rightArrowSkin.set_pointPosition(feathers_layout_RelativePosition.RIGHT);
				rightArrowSkin.set_drawBaseBorder(false);
				rightArrowSkin.set_fill(theme.getContainerFill());
				rightArrowSkin.set_border(theme.getContainerBorder());
				rightArrowSkin.set_width(6.0);
				rightArrowSkin.set_height(10.0);
				callout.set_rightArrowSkin(rightArrowSkin);
			}
			if(callout.get_bottomArrowSkin() == null) {
				var bottomArrowSkin = new feathers_skins_TriangleSkin();
				bottomArrowSkin.set_pointPosition(feathers_layout_RelativePosition.BOTTOM);
				bottomArrowSkin.set_drawBaseBorder(false);
				bottomArrowSkin.set_fill(theme.getContainerFill());
				bottomArrowSkin.set_border(theme.getContainerBorder());
				bottomArrowSkin.set_width(10.0);
				bottomArrowSkin.set_height(6.0);
				callout.set_bottomArrowSkin(bottomArrowSkin);
			}
			if(callout.get_leftArrowSkin() == null) {
				var leftArrowSkin = new feathers_skins_TriangleSkin();
				leftArrowSkin.set_pointPosition(feathers_layout_RelativePosition.LEFT);
				leftArrowSkin.set_drawBaseBorder(false);
				leftArrowSkin.set_fill(theme.getContainerFill());
				leftArrowSkin.set_border(theme.getContainerBorder());
				leftArrowSkin.set_width(6.0);
				leftArrowSkin.set_height(10.0);
				callout.set_leftArrowSkin(leftArrowSkin);
			}
			callout.set_topArrowGap(-theme.borderThickness);
			callout.set_rightArrowGap(-theme.borderThickness);
			callout.set_bottomArrowGap(-theme.borderThickness);
			callout.set_leftArrowGap(-theme.borderThickness);
			callout.set_paddingTop(theme.borderThickness);
			callout.set_paddingRight(theme.borderThickness);
			callout.set_paddingBottom(theme.borderThickness);
			callout.set_paddingLeft(theme.borderThickness);
			callout.set_marginTop(theme.xlargePadding);
			callout.set_marginRight(theme.xlargePadding);
			callout.set_marginBottom(theme.xlargePadding);
			callout.set_marginLeft(theme.xlargePadding);
		});
	}
	if(styleProvider.getStyleFunction(feathers_controls_TextCallout,feathers_controls_TextCallout.VARIANT_DANGER) == null) {
		styleProvider.setStyleFunction(feathers_controls_TextCallout,feathers_controls_TextCallout.VARIANT_DANGER,function(callout) {
			if(callout.get_textFormat() == null) {
				callout.set_textFormat(theme.getTextFormat());
			}
			if(callout.get_disabledTextFormat() == null) {
				callout.set_disabledTextFormat(theme.getDisabledTextFormat());
			}
			if(callout.get_backgroundSkin() == null) {
				var backgroundSkin = new feathers_skins_RectangleSkin();
				backgroundSkin.set_fill(theme.getDangerFill());
				backgroundSkin.set_border(theme.getDangerBorder());
				callout.set_backgroundSkin(backgroundSkin);
			}
			if(callout.get_topArrowSkin() == null) {
				var topArrowSkin = new feathers_skins_TriangleSkin();
				topArrowSkin.set_pointPosition(feathers_layout_RelativePosition.TOP);
				topArrowSkin.set_drawBaseBorder(false);
				topArrowSkin.set_fill(theme.getDangerFill());
				topArrowSkin.set_border(theme.getDangerBorder());
				topArrowSkin.set_width(10.0);
				topArrowSkin.set_height(6.0);
				callout.set_topArrowSkin(topArrowSkin);
			}
			if(callout.get_rightArrowSkin() == null) {
				var rightArrowSkin = new feathers_skins_TriangleSkin();
				rightArrowSkin.set_pointPosition(feathers_layout_RelativePosition.RIGHT);
				rightArrowSkin.set_drawBaseBorder(false);
				rightArrowSkin.set_fill(theme.getDangerFill());
				rightArrowSkin.set_border(theme.getDangerBorder());
				rightArrowSkin.set_width(6.0);
				rightArrowSkin.set_height(10.0);
				callout.set_rightArrowSkin(rightArrowSkin);
			}
			if(callout.get_bottomArrowSkin() == null) {
				var bottomArrowSkin = new feathers_skins_TriangleSkin();
				bottomArrowSkin.set_pointPosition(feathers_layout_RelativePosition.BOTTOM);
				bottomArrowSkin.set_drawBaseBorder(false);
				bottomArrowSkin.set_fill(theme.getDangerFill());
				bottomArrowSkin.set_border(theme.getDangerBorder());
				bottomArrowSkin.set_width(10.0);
				bottomArrowSkin.set_height(6.0);
				callout.set_bottomArrowSkin(bottomArrowSkin);
			}
			if(callout.get_leftArrowSkin() == null) {
				var leftArrowSkin = new feathers_skins_TriangleSkin();
				leftArrowSkin.set_pointPosition(feathers_layout_RelativePosition.LEFT);
				leftArrowSkin.set_drawBaseBorder(false);
				leftArrowSkin.set_fill(theme.getDangerFill());
				leftArrowSkin.set_border(theme.getDangerBorder());
				leftArrowSkin.set_width(6.0);
				leftArrowSkin.set_height(10.0);
				callout.set_leftArrowSkin(leftArrowSkin);
			}
			callout.set_topArrowGap(-theme.borderThickness);
			callout.set_rightArrowGap(-theme.borderThickness);
			callout.set_bottomArrowGap(-theme.borderThickness);
			callout.set_leftArrowGap(-theme.borderThickness);
			callout.set_paddingTop(theme.borderThickness);
			callout.set_paddingRight(theme.borderThickness);
			callout.set_paddingBottom(theme.borderThickness);
			callout.set_paddingLeft(theme.borderThickness);
			callout.set_marginTop(theme.xlargePadding);
			callout.set_marginRight(theme.xlargePadding);
			callout.set_marginBottom(theme.xlargePadding);
			callout.set_marginLeft(theme.xlargePadding);
		});
	}
};
var feathers_themes_steel_components_SteelTextInputStyles = function() { };
$hxClasses["feathers.themes.steel.components.SteelTextInputStyles"] = feathers_themes_steel_components_SteelTextInputStyles;
feathers_themes_steel_components_SteelTextInputStyles.__name__ = "feathers.themes.steel.components.SteelTextInputStyles";
feathers_themes_steel_components_SteelTextInputStyles.initialize = function(theme) {
	if(theme == null) {
		var value = feathers_style_Theme.get_fallbackTheme();
		theme = ((value) instanceof feathers_themes_steel_BaseSteelTheme) ? value : null;
	}
	if(theme == null) {
		return;
	}
	var styleProvider = theme.styleProvider;
	if(styleProvider.getStyleFunction(feathers_controls_TextInput,null) == null) {
		styleProvider.setStyleFunction(feathers_controls_TextInput,null,function(input) {
			var isDesktop = feathers_utils_DeviceUtil.isDesktop();
			if(input.get_backgroundSkin() == null) {
				var inputSkin = new feathers_skins_RectangleSkin();
				inputSkin.set_cornerRadius(3.0);
				if(isDesktop) {
					inputSkin.set_width(120.0);
				} else {
					inputSkin.set_width(160.0);
				}
				inputSkin.set_fill(theme.getInsetFill());
				inputSkin.set_border(theme.getInsetBorder());
				inputSkin.set_disabledFill(theme.getDisabledInsetFill());
				inputSkin.setBorderForState(feathers_controls_TextInputState.FOCUSED,theme.getThemeBorder());
				inputSkin.setBorderForState(feathers_controls_TextInputState.ERROR,theme.getDangerBorder());
				input.set_backgroundSkin(inputSkin);
			}
			if(input.get_textFormat() == null) {
				input.set_textFormat(theme.getTextFormat());
			}
			if(input.get_disabledTextFormat() == null) {
				input.set_disabledTextFormat(theme.getDisabledTextFormat());
			}
			if(input.get_promptTextFormat() == null) {
				input.set_promptTextFormat(theme.getSecondaryTextFormat());
			}
			if(isDesktop) {
				input.set_paddingTop(theme.smallPadding);
				input.set_paddingRight(theme.mediumPadding);
				input.set_paddingBottom(theme.smallPadding);
				input.set_paddingLeft(theme.mediumPadding);
			} else {
				input.set_paddingTop(theme.mediumPadding);
				input.set_paddingRight(theme.largePadding);
				input.set_paddingBottom(theme.mediumPadding);
				input.set_paddingLeft(theme.largePadding);
			}
		});
	}
	if(styleProvider.getStyleFunction(feathers_controls_TextInput,feathers_controls_TextInput.VARIANT_SEARCH) == null) {
		styleProvider.setStyleFunction(feathers_controls_TextInput,feathers_controls_TextInput.VARIANT_SEARCH,function(input) {
			var isDesktop = feathers_utils_DeviceUtil.isDesktop();
			if(input.get_backgroundSkin() == null) {
				var inputSkin = new feathers_skins_PillSkin();
				inputSkin.set_capDirection(feathers_layout_Direction.HORIZONTAL);
				if(isDesktop) {
					inputSkin.set_width(120.0);
				} else {
					inputSkin.set_width(160.0);
				}
				inputSkin.set_fill(theme.getInsetFill());
				inputSkin.set_border(theme.getInsetBorder());
				inputSkin.set_disabledFill(theme.getDisabledInsetFill());
				inputSkin.setBorderForState(feathers_controls_TextInputState.FOCUSED,theme.getThemeBorder());
				input.set_backgroundSkin(inputSkin);
			}
			if(input.get_textFormat() == null) {
				input.set_textFormat(theme.getTextFormat());
			}
			if(input.get_disabledTextFormat() == null) {
				input.set_disabledTextFormat(theme.getDisabledTextFormat());
			}
			if(input.get_promptTextFormat() == null) {
				input.set_promptTextFormat(theme.getSecondaryTextFormat());
			}
			if(isDesktop) {
				input.set_paddingTop(theme.smallPadding);
				input.set_paddingRight(theme.largePadding);
				input.set_paddingBottom(theme.smallPadding);
				input.set_paddingLeft(theme.largePadding);
			} else {
				input.set_paddingTop(theme.mediumPadding);
				input.set_paddingRight(theme.largePadding);
				input.set_paddingBottom(theme.mediumPadding);
				input.set_paddingLeft(theme.largePadding);
			}
		});
	}
	if(styleProvider.getStyleFunction(feathers_controls_TextCallout,feathers_controls_TextInput.CHILD_VARIANT_ERROR_CALLOUT) == null) {
		styleProvider.setStyleFunction(feathers_controls_TextCallout,feathers_controls_TextInput.CHILD_VARIANT_ERROR_CALLOUT,function(callout) {
			(theme.styleProvider.getStyleFunction(feathers_controls_TextCallout,feathers_controls_TextCallout.VARIANT_DANGER))(callout);
		});
	}
};
var feathers_themes_steel_components_SteelToggleButtonStyles = function() { };
$hxClasses["feathers.themes.steel.components.SteelToggleButtonStyles"] = feathers_themes_steel_components_SteelToggleButtonStyles;
feathers_themes_steel_components_SteelToggleButtonStyles.__name__ = "feathers.themes.steel.components.SteelToggleButtonStyles";
feathers_themes_steel_components_SteelToggleButtonStyles.initialize = function(theme) {
	if(theme == null) {
		var value = feathers_style_Theme.get_fallbackTheme();
		theme = ((value) instanceof feathers_themes_steel_BaseSteelTheme) ? value : null;
	}
	if(theme == null) {
		return;
	}
	var styleProvider = theme.styleProvider;
	if(styleProvider.getStyleFunction(feathers_controls_ToggleButton,null) == null) {
		styleProvider.setStyleFunction(feathers_controls_ToggleButton,null,function(button) {
			if(button.get_backgroundSkin() == null) {
				var skin = new feathers_skins_RectangleSkin();
				skin.set_fill(theme.getButtonFill());
				skin.set_disabledFill(theme.getButtonDisabledFill());
				skin.set_selectedFill(theme.getThemeFill());
				skin.setFillForState(feathers_controls_ToggleButtonState.DOWN(false),theme.getReversedActiveThemeFill());
				skin.set_border(theme.getButtonBorder());
				skin.set_selectedBorder(theme.getSelectedBorder());
				skin.set_disabledBorder(theme.getButtonDisabledBorder());
				skin.setBorderForState(feathers_controls_ToggleButtonState.DOWN(false),theme.getActiveFillBorder());
				skin.setBorderForState(feathers_controls_ToggleButtonState.DOWN(true),theme.getActiveFillBorder());
				skin.set_cornerRadius(3.0);
				button.set_backgroundSkin(skin);
			}
			if(button.get_focusRectSkin() == null) {
				var focusRectSkin = new feathers_skins_RectangleSkin();
				focusRectSkin.set_fill(feathers_graphics_FillStyle.None);
				focusRectSkin.set_border(theme.getFocusBorder());
				focusRectSkin.set_cornerRadius(3.0);
				button.set_focusRectSkin(focusRectSkin);
			}
			if(button.get_textFormat() == null) {
				button.set_textFormat(theme.getTextFormat());
			}
			if(button.get_disabledTextFormat() == null) {
				button.set_disabledTextFormat(theme.getDisabledTextFormat());
			}
			button.set_paddingTop(theme.smallPadding);
			button.set_paddingRight(theme.largePadding);
			button.set_paddingBottom(theme.smallPadding);
			button.set_paddingLeft(theme.largePadding);
			button.set_gap(theme.smallPadding);
		});
	}
};
var feathers_themes_steel_components_SteelToggleSwitchStyles = function() { };
$hxClasses["feathers.themes.steel.components.SteelToggleSwitchStyles"] = feathers_themes_steel_components_SteelToggleSwitchStyles;
feathers_themes_steel_components_SteelToggleSwitchStyles.__name__ = "feathers.themes.steel.components.SteelToggleSwitchStyles";
feathers_themes_steel_components_SteelToggleSwitchStyles.initialize = function(theme) {
	if(theme == null) {
		var value = feathers_style_Theme.get_fallbackTheme();
		theme = ((value) instanceof feathers_themes_steel_BaseSteelTheme) ? value : null;
	}
	if(theme == null) {
		return;
	}
	var styleProvider = theme.styleProvider;
	if(styleProvider.getStyleFunction(feathers_controls_ToggleSwitch,null) == null) {
		styleProvider.setStyleFunction(feathers_controls_ToggleSwitch,null,function(toggle) {
			var isDesktop = feathers_utils_DeviceUtil.isDesktop();
			if(toggle.get_trackSkin() == null) {
				var trackSkin = new feathers_skins_RectangleSkin();
				if(isDesktop) {
					trackSkin.set_width(48.0);
					trackSkin.set_height(24.0);
					trackSkin.set_minWidth(48.0);
					trackSkin.set_minHeight(24.0);
					trackSkin.set_cornerRadius(12.0);
				} else {
					trackSkin.set_width(64.0);
					trackSkin.set_height(32.0);
					trackSkin.set_minWidth(64.0);
					trackSkin.set_minHeight(32.0);
					trackSkin.set_cornerRadius(16.0);
				}
				trackSkin.set_border(theme.getInsetBorder());
				trackSkin.set_disabledBorder(theme.getInsetBorder());
				trackSkin.set_selectedBorder(theme.getSelectedInsetBorder());
				trackSkin.set_fill(theme.getInsetFill());
				trackSkin.set_selectedFill(theme.getReversedActiveThemeFill());
				trackSkin.set_disabledFill(theme.getDisabledInsetFill());
				var track = new feathers_controls_BasicToggleButton();
				track.set_toggleable(false);
				track.set_keepDownStateOnRollOut(true);
				track.set_backgroundSkin(trackSkin);
				toggle.set_trackSkin(track);
			}
			if(toggle.get_thumbSkin() == null) {
				var thumbSkin = new feathers_skins_CircleSkin();
				if(isDesktop) {
					thumbSkin.set_width(24.0);
					thumbSkin.set_height(24.0);
					thumbSkin.set_minWidth(24.0);
					thumbSkin.set_minHeight(24.0);
				} else {
					thumbSkin.set_width(32.0);
					thumbSkin.set_height(32.0);
					thumbSkin.set_minWidth(32.0);
					thumbSkin.set_minHeight(32.0);
				}
				thumbSkin.set_border(theme.getBorder());
				thumbSkin.set_disabledBorder(theme.getBorder());
				thumbSkin.set_fill(theme.getButtonFill());
				thumbSkin.set_disabledFill(theme.getButtonDisabledFill());
				var thumb = new feathers_controls_BasicToggleButton();
				thumb.set_toggleable(false);
				thumb.set_keepDownStateOnRollOut(true);
				thumb.set_backgroundSkin(thumbSkin);
				toggle.set_thumbSkin(thumb);
			}
			if(toggle.get_focusRectSkin() == null) {
				var focusRectSkin = new feathers_skins_RectangleSkin();
				focusRectSkin.set_fill(feathers_graphics_FillStyle.None);
				focusRectSkin.set_border(theme.getFocusBorder());
				if(isDesktop) {
					focusRectSkin.set_cornerRadius(12.0);
				} else {
					focusRectSkin.set_cornerRadius(16.0);
				}
				toggle.set_focusRectSkin(focusRectSkin);
			}
		});
	}
};
var feathers_themes_steel_components_SteelToolTipStyles = function() { };
$hxClasses["feathers.themes.steel.components.SteelToolTipStyles"] = feathers_themes_steel_components_SteelToolTipStyles;
feathers_themes_steel_components_SteelToolTipStyles.__name__ = "feathers.themes.steel.components.SteelToolTipStyles";
feathers_themes_steel_components_SteelToolTipStyles.initialize = function(theme) {
	if(theme == null) {
		var value = feathers_style_Theme.get_fallbackTheme();
		theme = ((value) instanceof feathers_themes_steel_BaseSteelTheme) ? value : null;
	}
	if(theme == null) {
		return;
	}
	var styleProvider = theme.styleProvider;
	if(styleProvider.getStyleFunction(feathers_controls_Label,feathers_core_DefaultToolTipManager.CHILD_VARIANT_TOOL_TIP) == null) {
		styleProvider.setStyleFunction(feathers_controls_Label,feathers_core_DefaultToolTipManager.CHILD_VARIANT_TOOL_TIP,function(label) {
			if(label.get_backgroundSkin() == null) {
				var backgroundSkin = new feathers_skins_RectangleSkin();
				backgroundSkin.set_border(theme.getBorder());
				backgroundSkin.set_fill(theme.getContainerFill());
				backgroundSkin.set_cornerRadius(2.0);
				backgroundSkin.set_maxWidth(276.0);
				label.set_backgroundSkin(backgroundSkin);
			}
			if(label.get_textFormat() == null) {
				label.set_textFormat(theme.getTextFormat());
			}
			if(label.get_disabledTextFormat() == null) {
				label.set_disabledTextFormat(theme.getDisabledDetailTextFormat());
			}
			label.set_wordWrap(true);
			label.set_paddingTop(theme.xsmallPadding);
			label.set_paddingRight(theme.xsmallPadding);
			label.set_paddingBottom(theme.xsmallPadding);
			label.set_paddingLeft(theme.xsmallPadding);
		});
	}
};
var feathers_themes_steel_components_SteelTreeGridViewStyles = function() { };
$hxClasses["feathers.themes.steel.components.SteelTreeGridViewStyles"] = feathers_themes_steel_components_SteelTreeGridViewStyles;
feathers_themes_steel_components_SteelTreeGridViewStyles.__name__ = "feathers.themes.steel.components.SteelTreeGridViewStyles";
feathers_themes_steel_components_SteelTreeGridViewStyles.initialize = function(theme) {
	if(theme == null) {
		var value = feathers_style_Theme.get_fallbackTheme();
		theme = ((value) instanceof feathers_themes_steel_BaseSteelTheme) ? value : null;
	}
	if(theme == null) {
		return;
	}
	var styleGridViewWithBorderVariant = function(gridView) {
		var isDesktop = feathers_utils_DeviceUtil.isDesktop();
		gridView.set_autoHideScrollBars(!isDesktop);
		gridView.set_fixedScrollBars(isDesktop);
		if(gridView.get_layout() == null) {
			var layout = new feathers_layout_VerticalListLayout();
			layout.set_requestedRowCount(5.0);
			gridView.set_layout(layout);
		}
		if(gridView.get_backgroundSkin() == null) {
			var backgroundSkin = new feathers_skins_RectangleSkin();
			backgroundSkin.set_fill(theme.getContainerFill());
			backgroundSkin.set_border(theme.getContainerBorder());
			backgroundSkin.set_width(10.0);
			backgroundSkin.set_height(10.0);
			gridView.set_backgroundSkin(backgroundSkin);
		}
		if(gridView.get_columnResizeSkin() == null) {
			var columnResizeSkin = new feathers_skins_RectangleSkin();
			columnResizeSkin.set_fill(theme.getThemeFill());
			columnResizeSkin.set_border(feathers_graphics_LineStyle.None);
			columnResizeSkin.set_width(2.0);
			columnResizeSkin.set_height(2.0);
			gridView.set_columnResizeSkin(columnResizeSkin);
		}
		if(gridView.get_headerCornerSkin() == null) {
			var headerCornerSkin = new feathers_skins_RectangleSkin();
			headerCornerSkin.set_fill(theme.getSubHeadingFill());
			headerCornerSkin.set_border(feathers_graphics_LineStyle.None);
			gridView.set_headerCornerSkin(headerCornerSkin);
		}
		if(gridView.get_focusRectSkin() == null) {
			var focusRectSkin = new feathers_skins_RectangleSkin();
			focusRectSkin.set_fill(feathers_graphics_FillStyle.None);
			focusRectSkin.set_border(theme.getFocusBorder());
			gridView.set_focusRectSkin(focusRectSkin);
		}
		gridView.set_showHeaderDividersOnlyWhenResizable(true);
		gridView.set_paddingTop(theme.borderThickness);
		gridView.set_paddingRight(theme.borderThickness);
		gridView.set_paddingBottom(theme.borderThickness);
		gridView.set_paddingLeft(theme.borderThickness);
	};
	var styleGridViewWithBorderlessVariant = function(gridView) {
		var isDesktop = feathers_utils_DeviceUtil.isDesktop();
		gridView.set_autoHideScrollBars(!isDesktop);
		gridView.set_fixedScrollBars(isDesktop);
		if(gridView.get_layout() == null) {
			var layout = new feathers_layout_VerticalListLayout();
			layout.set_requestedRowCount(5.0);
			gridView.set_layout(layout);
		}
		if(gridView.get_backgroundSkin() == null) {
			var backgroundSkin = new feathers_skins_RectangleSkin();
			backgroundSkin.set_fill(theme.getContainerFill());
			backgroundSkin.set_border(feathers_graphics_LineStyle.None);
			backgroundSkin.set_width(10.0);
			backgroundSkin.set_height(10.0);
			gridView.set_backgroundSkin(backgroundSkin);
		}
		if(gridView.get_columnResizeSkin() == null) {
			var columnResizeSkin = new feathers_skins_RectangleSkin();
			columnResizeSkin.set_fill(theme.getThemeFill());
			columnResizeSkin.set_border(feathers_graphics_LineStyle.None);
			columnResizeSkin.set_width(2.0);
			columnResizeSkin.set_height(2.0);
			gridView.set_columnResizeSkin(columnResizeSkin);
		}
		if(gridView.get_headerCornerSkin() == null) {
			var headerCornerSkin = new feathers_skins_RectangleSkin();
			headerCornerSkin.set_fill(theme.getSubHeadingFill());
			headerCornerSkin.set_border(feathers_graphics_LineStyle.None);
			gridView.set_headerCornerSkin(headerCornerSkin);
		}
		if(gridView.get_focusRectSkin() == null) {
			var skin = new feathers_skins_RectangleSkin();
			skin.set_fill(feathers_graphics_FillStyle.None);
			skin.set_border(theme.getFocusBorder());
			gridView.set_focusRectSkin(skin);
		}
		gridView.set_showHeaderDividersOnlyWhenResizable(true);
	};
	var styleProvider = theme.styleProvider;
	if(styleProvider.getStyleFunction(feathers_controls_TreeGridView,null) == null) {
		styleProvider.setStyleFunction(feathers_controls_TreeGridView,null,function(gridView) {
			var isDesktop = feathers_utils_DeviceUtil.isDesktop();
			if(isDesktop) {
				styleGridViewWithBorderVariant(gridView);
			} else {
				styleGridViewWithBorderlessVariant(gridView);
			}
		});
	}
	if(styleProvider.getStyleFunction(feathers_controls_TreeGridView,feathers_controls_TreeGridView.VARIANT_BORDER) == null) {
		styleProvider.setStyleFunction(feathers_controls_TreeGridView,feathers_controls_TreeGridView.VARIANT_BORDER,styleGridViewWithBorderVariant);
	}
	if(styleProvider.getStyleFunction(feathers_controls_TreeGridView,feathers_controls_TreeGridView.VARIANT_BORDERLESS) == null) {
		styleProvider.setStyleFunction(feathers_controls_TreeGridView,feathers_controls_TreeGridView.VARIANT_BORDERLESS,styleGridViewWithBorderlessVariant);
	}
	if(styleProvider.getStyleFunction(feathers_controls_dataRenderers_HierarchicalItemRenderer,feathers_controls_TreeGridView.CHILD_VARIANT_CELL_RENDERER) == null) {
		styleProvider.setStyleFunction(feathers_controls_dataRenderers_HierarchicalItemRenderer,feathers_controls_TreeGridView.CHILD_VARIANT_CELL_RENDERER,function(itemRenderer) {
			var isDesktop = feathers_utils_DeviceUtil.isDesktop();
			if(itemRenderer.get_backgroundSkin() == null) {
				var backgroundSkin = new feathers_skins_RectangleSkin();
				backgroundSkin.set_fill(feathers_graphics_FillStyle.SolidColor(16711935,0.0));
				backgroundSkin.set_border(feathers_graphics_LineStyle.None);
				if(isDesktop) {
					backgroundSkin.set_width(26.0);
					backgroundSkin.set_height(26.0);
					backgroundSkin.set_minWidth(26.0);
					backgroundSkin.set_minHeight(26.0);
				} else {
					backgroundSkin.set_width(44.0);
					backgroundSkin.set_height(44.0);
					backgroundSkin.set_minWidth(44.0);
					backgroundSkin.set_minHeight(44.0);
				}
				itemRenderer.set_backgroundSkin(backgroundSkin);
			}
			(theme.styleProvider.getStyleFunction(feathers_controls_dataRenderers_HierarchicalItemRenderer,null))(itemRenderer);
		});
	}
	if(styleProvider.getStyleFunction(feathers_controls_dataRenderers_ItemRenderer,feathers_controls_TreeGridView.CHILD_VARIANT_HEADER_RENDERER) == null) {
		styleProvider.setStyleFunction(feathers_controls_dataRenderers_ItemRenderer,feathers_controls_TreeGridView.CHILD_VARIANT_HEADER_RENDERER,function(itemRenderer) {
			var isDesktop = feathers_utils_DeviceUtil.isDesktop();
			if(itemRenderer.get_backgroundSkin() == null) {
				var skin = new feathers_skins_RectangleSkin();
				skin.set_fill(theme.getSubHeadingFill());
				skin.set_border(feathers_graphics_LineStyle.None);
				if(isDesktop) {
					skin.set_width(22.0);
					skin.set_height(22.0);
					skin.set_minWidth(22.0);
					skin.set_minHeight(22.0);
				} else {
					skin.set_width(44.0);
					skin.set_height(44.0);
					skin.set_minWidth(44.0);
					skin.set_minHeight(44.0);
				}
				itemRenderer.set_backgroundSkin(skin);
			}
			if(itemRenderer.get_textFormat() == null) {
				itemRenderer.set_textFormat(theme.getTextFormat());
			}
			if(itemRenderer.get_disabledTextFormat() == null) {
				itemRenderer.set_disabledTextFormat(theme.getDisabledTextFormat());
			}
			if(itemRenderer.get_secondaryTextFormat() == null) {
				itemRenderer.set_secondaryTextFormat(theme.getSecondaryDetailTextFormat());
			}
			if(itemRenderer.get_disabledSecondaryTextFormat() == null) {
				itemRenderer.set_disabledSecondaryTextFormat(theme.getDisabledDetailTextFormat());
			}
			itemRenderer.set_paddingTop(theme.smallPadding);
			itemRenderer.set_paddingRight(theme.largePadding);
			itemRenderer.set_paddingBottom(theme.smallPadding);
			itemRenderer.set_paddingLeft(theme.largePadding);
			itemRenderer.set_gap(theme.smallPadding);
			itemRenderer.set_horizontalAlign(feathers_layout_HorizontalAlign.LEFT);
		});
	}
	if(styleProvider.getStyleFunction(feathers_controls_Button,feathers_controls_TreeGridView.CHILD_VARIANT_HEADER_DIVIDER) == null) {
		styleProvider.setStyleFunction(feathers_controls_Button,feathers_controls_TreeGridView.CHILD_VARIANT_HEADER_DIVIDER,function(headerDivider) {
			var isDesktop = feathers_utils_DeviceUtil.isDesktop();
			if(headerDivider.get_backgroundSkin() == null) {
				var skin = new feathers_skins_VerticalLineSkin();
				skin.set_fill(feathers_graphics_FillStyle.SolidColor(16711935,0.0));
				skin.set_border(theme.getSubHeadingDividerBorder());
				skin.setBorderForState(feathers_controls_ButtonState.HOVER,theme.getThemeBorder());
				if(isDesktop) {
					skin.set_width(6.0);
					skin.set_height(1.0);
					skin.set_minWidth(6.0);
					skin.set_minHeight(1.0);
				} else {
					skin.set_width(10.0);
					skin.set_height(1.0);
					skin.set_minWidth(10.0);
					skin.set_minHeight(1.0);
				}
				headerDivider.set_backgroundSkin(skin);
			}
		});
	}
	if(styleProvider.getStyleFunction(feathers_controls_dataRenderers_TreeGridViewRowRenderer,null) == null) {
		styleProvider.setStyleFunction(feathers_controls_dataRenderers_TreeGridViewRowRenderer,null,function(rowRenderer) {
			var isDesktop = feathers_utils_DeviceUtil.isDesktop();
			if(rowRenderer.get_backgroundSkin() == null) {
				var skin = new feathers_skins_UnderlineSkin();
				skin.set_fill(theme.getContainerFill());
				skin.set_border(theme.getDividerBorder());
				skin.set_selectedFill(theme.getActiveThemeFill());
				skin.setFillForState(feathers_controls_ToggleButtonState.DOWN(false),theme.getActiveThemeFill());
				if(isDesktop) {
					skin.set_width(26.0);
					skin.set_height(26.0);
					skin.set_minWidth(26.0);
					skin.set_minHeight(26.0);
				} else {
					skin.set_width(44.0);
					skin.set_height(44.0);
					skin.set_minWidth(44.0);
					skin.set_minHeight(44.0);
				}
				rowRenderer.set_backgroundSkin(skin);
			}
		});
	}
};
var feathers_themes_steel_components_SteelTreeViewStyles = function() { };
$hxClasses["feathers.themes.steel.components.SteelTreeViewStyles"] = feathers_themes_steel_components_SteelTreeViewStyles;
feathers_themes_steel_components_SteelTreeViewStyles.__name__ = "feathers.themes.steel.components.SteelTreeViewStyles";
feathers_themes_steel_components_SteelTreeViewStyles.initialize = function(theme) {
	if(theme == null) {
		var value = feathers_style_Theme.get_fallbackTheme();
		theme = ((value) instanceof feathers_themes_steel_BaseSteelTheme) ? value : null;
	}
	if(theme == null) {
		return;
	}
	var styleTreeViewWithBorderVariant = function(treeView) {
		var isDesktop = feathers_utils_DeviceUtil.isDesktop();
		treeView.set_autoHideScrollBars(!isDesktop);
		treeView.set_fixedScrollBars(isDesktop);
		if(treeView.get_layout() == null) {
			var layout = new feathers_layout_VerticalListLayout();
			layout.set_requestedRowCount(5.0);
			treeView.set_layout(layout);
		}
		if(treeView.get_backgroundSkin() == null) {
			var backgroundSkin = new feathers_skins_RectangleSkin();
			backgroundSkin.set_fill(theme.getContainerFill());
			backgroundSkin.set_border(theme.getContainerBorder());
			backgroundSkin.set_width(10.0);
			backgroundSkin.set_height(10.0);
			treeView.set_backgroundSkin(backgroundSkin);
		}
		if(treeView.get_focusRectSkin() == null) {
			var focusRectSkin = new feathers_skins_RectangleSkin();
			focusRectSkin.set_fill(feathers_graphics_FillStyle.None);
			focusRectSkin.set_border(theme.getFocusBorder());
			treeView.set_focusRectSkin(focusRectSkin);
		}
		treeView.set_paddingTop(theme.borderThickness);
		treeView.set_paddingRight(theme.borderThickness);
		treeView.set_paddingBottom(theme.borderThickness);
		treeView.set_paddingLeft(theme.borderThickness);
	};
	var styleTreeViewWithBorderlessVariant = function(treeView) {
		var isDesktop = feathers_utils_DeviceUtil.isDesktop();
		treeView.set_autoHideScrollBars(!isDesktop);
		treeView.set_fixedScrollBars(isDesktop);
		if(treeView.get_layout() == null) {
			treeView.set_layout(new feathers_layout_VerticalListLayout());
		}
		if(treeView.get_backgroundSkin() == null) {
			var backgroundSkin = new feathers_skins_RectangleSkin();
			backgroundSkin.set_fill(theme.getContainerFill());
			backgroundSkin.set_border(feathers_graphics_LineStyle.None);
			backgroundSkin.set_width(10.0);
			backgroundSkin.set_height(10.0);
			treeView.set_backgroundSkin(backgroundSkin);
		}
		if(treeView.get_focusRectSkin() == null) {
			var skin = new feathers_skins_RectangleSkin();
			skin.set_fill(feathers_graphics_FillStyle.None);
			skin.set_border(theme.getFocusBorder());
			treeView.set_focusRectSkin(skin);
		}
	};
	var styleProvider = theme.styleProvider;
	if(styleProvider.getStyleFunction(feathers_controls_TreeView,null) == null) {
		styleProvider.setStyleFunction(feathers_controls_TreeView,null,function(treeView) {
			var isDesktop = feathers_utils_DeviceUtil.isDesktop();
			if(isDesktop) {
				styleTreeViewWithBorderVariant(treeView);
			} else {
				styleTreeViewWithBorderlessVariant(treeView);
			}
		});
	}
	if(styleProvider.getStyleFunction(feathers_controls_TreeView,feathers_controls_TreeView.VARIANT_BORDER) == null) {
		styleProvider.setStyleFunction(feathers_controls_TreeView,feathers_controls_TreeView.VARIANT_BORDER,styleTreeViewWithBorderVariant);
	}
	if(styleProvider.getStyleFunction(feathers_controls_TreeView,feathers_controls_TreeView.VARIANT_BORDERLESS) == null) {
		styleProvider.setStyleFunction(feathers_controls_TreeView,feathers_controls_TreeView.VARIANT_BORDERLESS,styleTreeViewWithBorderlessVariant);
	}
};
var feathers_themes_steel_components_SteelVDividedBoxStyles = function() { };
$hxClasses["feathers.themes.steel.components.SteelVDividedBoxStyles"] = feathers_themes_steel_components_SteelVDividedBoxStyles;
feathers_themes_steel_components_SteelVDividedBoxStyles.__name__ = "feathers.themes.steel.components.SteelVDividedBoxStyles";
feathers_themes_steel_components_SteelVDividedBoxStyles.initialize = function(theme) {
	if(theme == null) {
		var value = feathers_style_Theme.get_fallbackTheme();
		theme = ((value) instanceof feathers_themes_steel_BaseSteelTheme) ? value : null;
	}
	if(theme == null) {
		return;
	}
	var styleProvider = theme.styleProvider;
	if(styleProvider.getStyleFunction(feathers_controls_VDividedBox,null) == null) {
		styleProvider.setStyleFunction(feathers_controls_VDividedBox,null,function(dividedBox) {
			if(dividedBox.get_resizeDraggingSkin() == null) {
				var resizeDraggingSkin = new feathers_skins_RectangleSkin();
				resizeDraggingSkin.set_fill(theme.getThemeFill());
				resizeDraggingSkin.set_border(feathers_graphics_LineStyle.None);
				resizeDraggingSkin.set_width(2.0);
				resizeDraggingSkin.set_height(2.0);
				dividedBox.set_resizeDraggingSkin(resizeDraggingSkin);
			}
		});
	}
};
var feathers_themes_steel_components_SteelVProgressBarStyles = function() { };
$hxClasses["feathers.themes.steel.components.SteelVProgressBarStyles"] = feathers_themes_steel_components_SteelVProgressBarStyles;
feathers_themes_steel_components_SteelVProgressBarStyles.__name__ = "feathers.themes.steel.components.SteelVProgressBarStyles";
feathers_themes_steel_components_SteelVProgressBarStyles.initialize = function(theme) {
	if(theme == null) {
		var value = feathers_style_Theme.get_fallbackTheme();
		theme = ((value) instanceof feathers_themes_steel_BaseSteelTheme) ? value : null;
	}
	if(theme == null) {
		return;
	}
	var styleProvider = theme.styleProvider;
	if(styleProvider.getStyleFunction(feathers_controls_VProgressBar,null) == null) {
		styleProvider.setStyleFunction(feathers_controls_VProgressBar,null,function(progress) {
			if(progress.get_fillSkin() == null) {
				var fillSkin = new feathers_skins_RectangleSkin();
				fillSkin.set_fill(theme.getActiveThemeFill());
				fillSkin.set_disabledFill(theme.getControlDisabledFill());
				fillSkin.set_border(theme.getActiveFillBorder());
				fillSkin.set_disabledBorder(theme.getDisabledInsetBorder());
				fillSkin.set_cornerRadius(8.0);
				fillSkin.set_width(8.0);
				fillSkin.set_minHeight(8.0);
				progress.set_fillSkin(fillSkin);
			}
			if(progress.get_backgroundSkin() == null) {
				var backgroundSkin = new feathers_skins_RectangleSkin();
				backgroundSkin.set_fill(theme.getInsetFill());
				backgroundSkin.set_disabledFill(theme.getDisabledInsetFill());
				backgroundSkin.set_border(theme.getInsetBorder());
				backgroundSkin.set_disabledBorder(theme.getDisabledInsetBorder());
				backgroundSkin.set_cornerRadius(8.0);
				backgroundSkin.set_width(8.0);
				backgroundSkin.set_height(200.0);
				progress.set_backgroundSkin(backgroundSkin);
			}
		});
	}
};
var feathers_themes_steel_components_SteelVScrollBarStyles = function() { };
$hxClasses["feathers.themes.steel.components.SteelVScrollBarStyles"] = feathers_themes_steel_components_SteelVScrollBarStyles;
feathers_themes_steel_components_SteelVScrollBarStyles.__name__ = "feathers.themes.steel.components.SteelVScrollBarStyles";
feathers_themes_steel_components_SteelVScrollBarStyles.initialize = function(theme) {
	if(theme == null) {
		var value = feathers_style_Theme.get_fallbackTheme();
		theme = ((value) instanceof feathers_themes_steel_BaseSteelTheme) ? value : null;
	}
	if(theme == null) {
		return;
	}
	var styleProvider = theme.styleProvider;
	if(styleProvider.getStyleFunction(feathers_controls_VScrollBar,null) == null) {
		styleProvider.setStyleFunction(feathers_controls_VScrollBar,null,function(scrollBar) {
			var isDesktop = feathers_utils_DeviceUtil.isDesktop();
			if(scrollBar.get_thumbSkin() == null) {
				var thumbSkin = new feathers_skins_RectangleSkin();
				thumbSkin.set_fill(theme.getScrollBarThumbFill());
				thumbSkin.set_disabledFill(theme.getScrollBarThumbDisabledFill());
				thumbSkin.set_border(feathers_graphics_LineStyle.None);
				var size = isDesktop ? 6.0 : 4.0;
				thumbSkin.set_width(size);
				thumbSkin.set_height(size);
				thumbSkin.set_minWidth(size);
				thumbSkin.set_minHeight(size);
				thumbSkin.set_cornerRadius(size / 2.0);
				var thumb = new feathers_controls_BasicButton();
				thumb.set_keepDownStateOnRollOut(true);
				thumb.set_backgroundSkin(thumbSkin);
				scrollBar.set_thumbSkin(thumb);
			}
			if(isDesktop && scrollBar.get_trackSkin() == null) {
				var trackSkin = new feathers_skins_RectangleSkin();
				trackSkin.set_fill(theme.getControlFill());
				trackSkin.set_disabledFill(theme.getControlDisabledFill());
				trackSkin.set_border(feathers_graphics_LineStyle.None);
				trackSkin.set_width(12.0);
				trackSkin.set_height(12.0);
				trackSkin.set_minWidth(12.0);
				trackSkin.set_minHeight(12.0);
				scrollBar.set_trackSkin(trackSkin);
			}
			scrollBar.set_paddingTop(theme.xsmallPadding);
			scrollBar.set_paddingRight(theme.xsmallPadding);
			scrollBar.set_paddingBottom(theme.xsmallPadding);
			scrollBar.set_paddingLeft(theme.xsmallPadding);
		});
	}
	if(styleProvider.getStyleFunction(feathers_controls_Button,feathers_controls_VScrollBar.CHILD_VARIANT_DECREMENT_BUTTON) == null) {
		styleProvider.setStyleFunction(feathers_controls_Button,feathers_controls_VScrollBar.CHILD_VARIANT_DECREMENT_BUTTON,function(button) {
			if(button.get_backgroundSkin() == null) {
				var skin = new feathers_skins_RectangleSkin();
				skin.set_fill(theme.getControlFill());
				skin.set_disabledFill(theme.getControlDisabledFill());
				skin.setFillForState(feathers_controls_ButtonState.DOWN,theme.getReversedActiveThemeFill());
				skin.set_border(feathers_graphics_LineStyle.None);
				skin.set_width(12.0);
				skin.set_height(12.0);
				button.set_backgroundSkin(skin);
			}
			if(button.get_icon() == null) {
				var icon = new feathers_skins_TriangleSkin();
				icon.set_pointPosition(feathers_layout_RelativePosition.TOP);
				icon.set_fill(feathers_graphics_FillStyle.SolidColor(theme.scrollBarThumbFillColor));
				icon.set_disabledFill(feathers_graphics_FillStyle.SolidColor(theme.scrollBarThumbDisabledFillColor));
				icon.set_width(8.0);
				icon.set_height(4.0);
				button.set_icon(icon);
			}
			button.set_showText(false);
			button.set_paddingTop(theme.xsmallPadding);
			button.set_paddingRight(theme.xsmallPadding);
			button.set_paddingBottom(theme.xsmallPadding);
			button.set_paddingLeft(theme.xsmallPadding);
			button.set_gap(theme.xsmallPadding);
		});
	}
	if(styleProvider.getStyleFunction(feathers_controls_Button,feathers_controls_VScrollBar.CHILD_VARIANT_INCREMENT_BUTTON) == null) {
		styleProvider.setStyleFunction(feathers_controls_Button,feathers_controls_VScrollBar.CHILD_VARIANT_INCREMENT_BUTTON,function(button) {
			if(button.get_backgroundSkin() == null) {
				var skin = new feathers_skins_RectangleSkin();
				skin.set_fill(theme.getControlFill());
				skin.set_disabledFill(theme.getControlDisabledFill());
				skin.setFillForState(feathers_controls_ButtonState.DOWN,theme.getReversedActiveThemeFill());
				skin.set_border(feathers_graphics_LineStyle.None);
				skin.set_width(12.0);
				skin.set_height(12.0);
				button.set_backgroundSkin(skin);
			}
			if(button.get_icon() == null) {
				var icon = new feathers_skins_TriangleSkin();
				icon.set_pointPosition(feathers_layout_RelativePosition.BOTTOM);
				icon.set_fill(feathers_graphics_FillStyle.SolidColor(theme.scrollBarThumbFillColor));
				icon.set_disabledFill(feathers_graphics_FillStyle.SolidColor(theme.scrollBarThumbDisabledFillColor));
				icon.set_width(8.0);
				icon.set_height(4.0);
				button.set_icon(icon);
			}
			button.set_showText(false);
			button.set_paddingTop(theme.xsmallPadding);
			button.set_paddingRight(theme.xsmallPadding);
			button.set_paddingBottom(theme.xsmallPadding);
			button.set_paddingLeft(theme.xsmallPadding);
			button.set_gap(theme.xsmallPadding);
		});
	}
};
var feathers_themes_steel_components_SteelVSliderStyles = function() { };
$hxClasses["feathers.themes.steel.components.SteelVSliderStyles"] = feathers_themes_steel_components_SteelVSliderStyles;
feathers_themes_steel_components_SteelVSliderStyles.__name__ = "feathers.themes.steel.components.SteelVSliderStyles";
feathers_themes_steel_components_SteelVSliderStyles.initialize = function(theme) {
	if(theme == null) {
		var value = feathers_style_Theme.get_fallbackTheme();
		theme = ((value) instanceof feathers_themes_steel_BaseSteelTheme) ? value : null;
	}
	if(theme == null) {
		return;
	}
	var styleProvider = theme.styleProvider;
	if(styleProvider.getStyleFunction(feathers_controls_VSlider,null) == null) {
		styleProvider.setStyleFunction(feathers_controls_VSlider,null,function(slider) {
			var isDesktop = feathers_utils_DeviceUtil.isDesktop();
			if(slider.get_thumbSkin() == null) {
				var thumb = new feathers_controls_Button();
				thumb.set_styleProvider(null);
				thumb.set_keepDownStateOnRollOut(true);
				var backgroundSkin = new feathers_skins_CircleSkin();
				backgroundSkin.set_fill(theme.getButtonFill());
				backgroundSkin.set_disabledFill(theme.getButtonDisabledFill());
				backgroundSkin.setFillForState(feathers_controls_ButtonState.DOWN,theme.getButtonDownFill());
				backgroundSkin.set_border(theme.getButtonBorder());
				backgroundSkin.set_disabledBorder(theme.getButtonDisabledBorder());
				if(isDesktop) {
					backgroundSkin.set_width(20.0);
					backgroundSkin.set_height(20.0);
				} else {
					backgroundSkin.set_width(24.0);
					backgroundSkin.set_height(24.0);
				}
				thumb.set_backgroundSkin(backgroundSkin);
				var focusRectSkin = new feathers_skins_CircleSkin();
				focusRectSkin.set_fill(feathers_graphics_FillStyle.None);
				focusRectSkin.set_border(theme.getFocusBorder());
				thumb.set_focusRectSkin(focusRectSkin);
				slider.set_thumbSkin(thumb);
			}
			if(slider.get_trackSkin() == null) {
				var trackSkin = new feathers_skins_TabSkin();
				trackSkin.set_fill(theme.getActiveThemeFill());
				trackSkin.set_disabledFill(theme.getControlDisabledFill());
				trackSkin.set_border(theme.getActiveFillBorder());
				trackSkin.set_disabledBorder(theme.getDisabledInsetBorder());
				trackSkin.set_cornerRadius(8.0);
				trackSkin.set_cornerRadiusPosition(feathers_layout_RelativePosition.BOTTOM);
				trackSkin.set_width(8.0);
				trackSkin.set_height(100.0);
				slider.set_trackSkin(trackSkin);
				if(slider.get_secondaryTrackSkin() == null) {
					var secondaryTrackSkin = new feathers_skins_TabSkin();
					secondaryTrackSkin.set_fill(theme.getInsetFill());
					secondaryTrackSkin.set_disabledFill(theme.getDisabledInsetFill());
					secondaryTrackSkin.set_border(theme.getInsetBorder());
					secondaryTrackSkin.set_disabledBorder(theme.getDisabledInsetBorder());
					secondaryTrackSkin.set_cornerRadius(8.0);
					secondaryTrackSkin.set_cornerRadiusPosition(feathers_layout_RelativePosition.TOP);
					secondaryTrackSkin.set_width(8.0);
					secondaryTrackSkin.set_height(100.0);
					slider.set_secondaryTrackSkin(secondaryTrackSkin);
				}
			}
		});
	}
};
var feathers_utils_AbstractDisplayObjectFactory = {};
feathers_utils_AbstractDisplayObjectFactory.fromFunction = function(func) {
	return feathers_utils_DisplayObjectFactory.withFunction(func);
};
feathers_utils_AbstractDisplayObjectFactory.fromClass = function(type) {
	return feathers_utils_DisplayObjectFactory.withClass(type);
};
feathers_utils_AbstractDisplayObjectFactory.fromDisplayObject = function(displayObject) {
	return feathers_utils_DisplayObjectFactory.withDisplayObject(displayObject);
};
var feathers_utils_AbstractDisplayObjectRecycler = {};
feathers_utils_AbstractDisplayObjectRecycler.fromFunction = function(func) {
	return feathers_utils_DisplayObjectRecycler.withFunction(func);
};
feathers_utils_AbstractDisplayObjectRecycler.fromClass = function(type) {
	return feathers_utils_DisplayObjectRecycler.withClass(type);
};
var feathers_utils_DPadFocusUtil = function() { };
$hxClasses["feathers.utils.DPadFocusUtil"] = feathers_utils_DPadFocusUtil;
feathers_utils_DPadFocusUtil.__name__ = "feathers.utils.DPadFocusUtil";
feathers_utils_DPadFocusUtil.isBetterFocusForRelativePosition = function(object1,object2,focusedRect,relativePosition) {
	var rect = object1.getBounds(object1.stage);
	var minPrimaryDistance1 = feathers_utils_DPadFocusUtil.calculateMinPrimaryAxisDistanceForRelativePosition(focusedRect,rect,relativePosition);
	if(minPrimaryDistance1 == Infinity) {
		return false;
	}
	var maxPrimaryDistance1 = feathers_utils_DPadFocusUtil.calculateMaxPrimaryAxisDistanceForRelativePosition(focusedRect,rect,relativePosition);
	var secondaryDistance1 = feathers_utils_DPadFocusUtil.calculateSecondaryAxisDistanceForRelativePosition(focusedRect,rect,relativePosition);
	var onSameAxis1 = feathers_utils_DPadFocusUtil.itemsAreOnSameAxis(focusedRect,rect,relativePosition);
	var minPrimaryDistance2 = Infinity;
	var maxPrimaryDistance2 = Infinity;
	var secondaryDistance2 = Infinity;
	var onSameAxis2 = false;
	if(object2 != null) {
		rect = object2.getBounds(object2.stage);
		minPrimaryDistance2 = feathers_utils_DPadFocusUtil.calculateMinPrimaryAxisDistanceForRelativePosition(focusedRect,rect,relativePosition);
		maxPrimaryDistance2 = feathers_utils_DPadFocusUtil.calculateMaxPrimaryAxisDistanceForRelativePosition(focusedRect,rect,relativePosition);
		secondaryDistance2 = feathers_utils_DPadFocusUtil.calculateSecondaryAxisDistanceForRelativePosition(focusedRect,rect,relativePosition);
		onSameAxis2 = feathers_utils_DPadFocusUtil.itemsAreOnSameAxis(focusedRect,rect,relativePosition);
	}
	if(onSameAxis1 && onSameAxis2) {
		if(minPrimaryDistance1 > 0.0) {
			return minPrimaryDistance1 < minPrimaryDistance2;
		} else {
			return false;
		}
	}
	var isVertical = relativePosition == feathers_layout_RelativePosition.TOP || relativePosition == feathers_layout_RelativePosition.BOTTOM;
	if(onSameAxis1) {
		if(isVertical) {
			if(minPrimaryDistance1 > 0.0 && minPrimaryDistance1 < maxPrimaryDistance2) {
				return true;
			}
		} else {
			return true;
		}
	} else if(onSameAxis2) {
		if(isVertical) {
			if(minPrimaryDistance2 > 0.0 && minPrimaryDistance2 < maxPrimaryDistance1) {
				return false;
			}
		} else {
			return false;
		}
	}
	var weightedDistance1 = 13.0 * minPrimaryDistance1 * minPrimaryDistance1 + secondaryDistance1 * secondaryDistance1;
	var weightedDistance2 = 13.0 * minPrimaryDistance2 * minPrimaryDistance2 + secondaryDistance2 * secondaryDistance2;
	return weightedDistance1 < weightedDistance2;
};
feathers_utils_DPadFocusUtil.calculateSecondaryAxisDistanceForRelativePosition = function(globalRect1,globalRect2,position) {
	if(position == feathers_layout_RelativePosition.TOP || position == feathers_layout_RelativePosition.BOTTOM) {
		return Math.abs(globalRect1.x + globalRect1.width / 2.0 - (globalRect2.x + globalRect2.width / 2.0));
	}
	return Math.abs(globalRect1.y + globalRect1.height / 2.0 - (globalRect2.y + globalRect2.height / 2.0));
};
feathers_utils_DPadFocusUtil.calculateMaxPrimaryAxisDistanceForRelativePosition = function(globalRect1,globalRect2,position) {
	switch(position._hx_index) {
	case 0:
		if(globalRect1.get_bottom() > globalRect2.get_bottom() || globalRect1.y >= globalRect2.get_bottom()) {
			var result = globalRect1.get_bottom() - globalRect2.y;
			if(result > 0.0) {
				return result;
			}
		}
		break;
	case 1:
		if(globalRect1.x < globalRect2.x || globalRect1.get_right() <= globalRect2.x) {
			var result = globalRect2.get_right() - globalRect1.x;
			if(result > 0.0) {
				return result;
			}
		}
		break;
	case 2:
		if(globalRect1.y < globalRect2.y || globalRect1.get_bottom() <= globalRect2.y) {
			var result = globalRect2.get_bottom() - globalRect1.y;
			if(result > 0.0) {
				return result;
			}
		}
		break;
	case 3:
		if(globalRect1.get_right() > globalRect2.get_right() || globalRect1.x >= globalRect2.get_right()) {
			var result = globalRect1.get_right() - globalRect2.x;
			if(result > 0.0) {
				return result;
			}
		}
		break;
	default:
	}
	return Infinity;
};
feathers_utils_DPadFocusUtil.calculateMinPrimaryAxisDistanceForRelativePosition = function(globalRect1,globalRect2,position) {
	switch(position._hx_index) {
	case 0:
		if(globalRect1.get_bottom() > globalRect2.get_bottom() || globalRect1.y >= globalRect2.get_bottom()) {
			var result = globalRect1.get_bottom() - globalRect2.get_bottom();
			if(result > 0.0) {
				return result;
			}
		}
		break;
	case 1:
		if(globalRect1.x < globalRect2.x || globalRect1.get_right() <= globalRect2.x) {
			var result = globalRect2.x - globalRect1.x;
			if(result > 0.0) {
				return result;
			}
		}
		break;
	case 2:
		if(globalRect1.y < globalRect2.y || globalRect1.get_bottom() <= globalRect2.y) {
			var result = globalRect2.y - globalRect1.y;
			if(result > 0.0) {
				return result;
			}
		}
		break;
	case 3:
		if(globalRect1.get_right() > globalRect2.get_right() || globalRect1.x >= globalRect2.get_right()) {
			var result = globalRect1.get_right() - globalRect2.get_right();
			if(result > 0.0) {
				return result;
			}
		}
		break;
	default:
	}
	return Infinity;
};
feathers_utils_DPadFocusUtil.itemsAreOnSameAxis = function(globalRect1,globalRect2,position) {
	if(position == feathers_layout_RelativePosition.TOP || position == feathers_layout_RelativePosition.BOTTOM) {
		if(globalRect1.x <= globalRect2.get_right()) {
			return globalRect2.x <= globalRect1.get_right();
		} else {
			return false;
		}
	}
	if(globalRect1.y <= globalRect2.get_bottom()) {
		return globalRect2.y <= globalRect1.get_bottom();
	} else {
		return false;
	}
};
var feathers_utils_DateUtil = function() { };
$hxClasses["feathers.utils.DateUtil"] = feathers_utils_DateUtil;
feathers_utils_DateUtil.__name__ = "feathers.utils.DateUtil";
feathers_utils_DateUtil.getDaysInMonth = function(month,year) {
	if(month == 1 && year != null && feathers_utils_DateUtil.isLeapYear(year)) {
		return feathers_utils_DateUtil.FEBRUARY_NUMBER_OF_DAYS_LEAP_YEAR;
	}
	return feathers_utils_DateUtil.MONTH_NUMBER_OF_DAYS[month];
};
feathers_utils_DateUtil.isLeapYear = function(year) {
	if(year % 100 == 0) {
		return year % 400 == 0;
	}
	return year % 4 == 0;
};
var feathers_utils_DeviceUtil = function() { };
$hxClasses["feathers.utils.DeviceUtil"] = feathers_utils_DeviceUtil;
feathers_utils_DeviceUtil.__name__ = "feathers.utils.DeviceUtil";
feathers_utils_DeviceUtil.isDesktop = function() {
	var htmlWindow = js_Boot.__cast($global , Window);
	return htmlWindow.matchMedia(feathers_utils_DeviceUtil.MEDIA_QUERY_DESKTOP).matches;
};
feathers_utils_DeviceUtil.isMobile = function() {
	var htmlWindow = js_Boot.__cast($global , Window);
	return htmlWindow.matchMedia(feathers_utils_DeviceUtil.MEDIA_QUERY_MOBILE).matches;
};
var feathers_utils_DisplayObjectRecycler = function() {
	feathers_utils_DisplayObjectFactory.call(this);
};
$hxClasses["feathers.utils.DisplayObjectRecycler"] = feathers_utils_DisplayObjectRecycler;
feathers_utils_DisplayObjectRecycler.__name__ = "feathers.utils.DisplayObjectRecycler";
feathers_utils_DisplayObjectRecycler.withClass = function(displayObjectType,update,reset,destroy) {
	if(destroy == null) {
		destroy = function(target) {
			if(js_Boot.__implements(target,feathers_core_IUIControl)) {
				target.dispose();
			}
		};
	}
	var item = new feathers_utils_DisplayObjectRecycler();
	item.create = function() {
		return Type.createInstance(displayObjectType,[]);
	};
	item.update = update;
	item.reset = reset;
	item.destroy = destroy;
	return item;
};
feathers_utils_DisplayObjectRecycler.withFunction = function(create,update,reset,destroy) {
	var item = new feathers_utils_DisplayObjectRecycler();
	item.create = create;
	item.update = update;
	item.reset = reset;
	item.destroy = destroy;
	return item;
};
feathers_utils_DisplayObjectRecycler.withFactory = function(factory,update,reset) {
	var item = new feathers_utils_DisplayObjectRecycler();
	item.create = $bind(factory,factory.create);
	item.update = update;
	item.reset = reset;
	item.destroy = $bind(factory,factory.destroy);
	return item;
};
feathers_utils_DisplayObjectRecycler.__super__ = feathers_utils_DisplayObjectFactory;
feathers_utils_DisplayObjectRecycler.prototype = $extend(feathers_utils_DisplayObjectFactory.prototype,{
	update: function(target,state) {
	}
	,reset: function(target,state) {
	}
	,__class__: feathers_utils_DisplayObjectRecycler
});
var feathers_utils_DisplayUtil = function() { };
$hxClasses["feathers.utils.DisplayUtil"] = feathers_utils_DisplayUtil;
feathers_utils_DisplayUtil.__name__ = "feathers.utils.DisplayUtil";
feathers_utils_DisplayUtil.getDisplayObjectDepthFromStage = function(target) {
	if(target.stage == null) {
		return -1;
	}
	var count = 0;
	while(target.parent != null) {
		target = target.parent;
		++count;
	}
	return count;
};
feathers_utils_DisplayUtil.getConcatenatedScaleX = function(target) {
	if(target == null) {
		throw new openfl_errors_ArgumentError("getConcatenatedScaleX target must not be null");
	}
	var result = 1.0;
	var current = target;
	do {
		result /= current.get_scaleX();
		current = current.parent;
	} while(current != null && current != current.stage);
	return result;
};
feathers_utils_DisplayUtil.getConcatenatedScaleY = function(target) {
	if(target == null) {
		throw new openfl_errors_ArgumentError("getConcatenatedScaleY target must not be null");
	}
	var result = 1.0;
	var current = target;
	do {
		result /= current.get_scaleY();
		current = current.parent;
	} while(current != null && current != current.stage);
	return result;
};
feathers_utils_DisplayUtil.getConcatenatedScale = function(target,result) {
	if(target == null) {
		throw new openfl_errors_ArgumentError("getConcatenatedScale target must not be null");
	}
	var resultX = 1.0;
	var resultY = 1.0;
	var current = target;
	do {
		resultX /= current.get_scaleX();
		resultY /= current.get_scaleY();
		current = current.parent;
	} while(current != null && current != current.stage);
	if(result == null) {
		return new openfl_geom_Point(resultX,resultY);
	}
	result.setTo(resultX,resultY);
	return result;
};
var feathers_utils_EdgePuller = function(target,pullableEdge,maxPullDistance) {
	if(pullableEdge == null) {
		pullableEdge = feathers_layout_RelativePosition.LEFT;
	}
	this._animatePull = null;
	this._savedTouchMoves = [];
	this._targetPullDistance = 0.0;
	this._startPullDistance = 0.0;
	this._startTouch = 0.0;
	this._restoreMouseChildren = false;
	this._touchPointIsSimulated = false;
	this._touchPointID = null;
	this._snapDuration = 0.5;
	this._opened = false;
	this._pendingOpened = null;
	this._pullableEdge = feathers_layout_RelativePosition.LEFT;
	this._activeBorderSize = null;
	this._pullDistance = 0.0;
	this._maxPullDistance = null;
	this.simulateTouch = false;
	this.ease = motion_easing_Quart.easeOut;
	this.minDragDistance = 6.0;
	this._dragging = false;
	this._active = false;
	this.enabled = true;
	openfl_events_EventDispatcher.call(this);
	this.set_target(target);
	this.set_pullableEdge(pullableEdge);
	this.set_maxPullDistance(maxPullDistance);
};
$hxClasses["feathers.utils.EdgePuller"] = feathers_utils_EdgePuller;
feathers_utils_EdgePuller.__name__ = "feathers.utils.EdgePuller";
feathers_utils_EdgePuller.__super__ = openfl_events_EventDispatcher;
feathers_utils_EdgePuller.prototype = $extend(openfl_events_EventDispatcher.prototype,{
	enabled: null
	,_active: null
	,get_active: function() {
		return this._active;
	}
	,_dragging: null
	,get_dragging: function() {
		return this._dragging;
	}
	,minDragDistance: null
	,ease: null
	,simulateTouch: null
	,_target: null
	,get_target: function() {
		return this._target;
	}
	,set_target: function(value) {
		if(this._target == value) {
			return this._target;
		}
		if(this._target != null) {
			this.cleanupAfterDrag();
			this._target.removeEventListener("mouseDown",$bind(this,this.edgePuller_target_mouseDownHandler));
			this._target.removeEventListener("mouseDown",$bind(this,this.edgePuller_target_mouseDownCaptureHandler),true);
			this._target.removeEventListener("touchBegin",$bind(this,this.edgePuller_target_touchBeginHandler));
			this._target.removeEventListener("touchBegin",$bind(this,this.edgePuller_target_touchBeginCaptureHandler),true);
			this._target.removeEventListener("addedToStage",$bind(this,this.edgePuller_target_addedToStageHandler));
			this._target.removeEventListener("removedFromStage",$bind(this,this.edgePuller_target_removedFromStageHandler));
			this.removeStageEvents();
		}
		this._target = value;
		if(this._target != null) {
			this._target.addEventListener("mouseDown",$bind(this,this.edgePuller_target_mouseDownHandler),false,0,true);
			this._target.addEventListener("mouseDown",$bind(this,this.edgePuller_target_mouseDownCaptureHandler),true,0,true);
			this._target.addEventListener("touchBegin",$bind(this,this.edgePuller_target_touchBeginHandler),false,0,true);
			this._target.addEventListener("touchBegin",$bind(this,this.edgePuller_target_touchBeginCaptureHandler),true,0,true);
			this._target.addEventListener("addedToStage",$bind(this,this.edgePuller_target_addedToStageHandler),false,0,true);
			this._target.addEventListener("removedFromStage",$bind(this,this.edgePuller_target_removedFromStageHandler),false,0,true);
			this.addStageEvents();
		}
		return this._target;
	}
	,_maxPullDistance: null
	,get_maxPullDistance: function() {
		return this._maxPullDistance;
	}
	,set_maxPullDistance: function(value) {
		if(this._maxPullDistance == value) {
			return this._maxPullDistance;
		}
		this._maxPullDistance = value;
		return this._maxPullDistance;
	}
	,_pullDistance: null
	,get_pullDistance: function() {
		return this._pullDistance;
	}
	,_activeBorderSize: null
	,get_activeBorderSize: function() {
		return this._activeBorderSize;
	}
	,set_activeBorderSize: function(value) {
		if(this._activeBorderSize == value) {
			return this._activeBorderSize;
		}
		this._activeBorderSize = value;
		return this._activeBorderSize;
	}
	,_pullableEdge: null
	,get_pullableEdge: function() {
		return this._pullableEdge;
	}
	,set_pullableEdge: function(value) {
		if(this._pullableEdge == value) {
			return this._pullableEdge;
		}
		this._pullableEdge = value;
		return this._pullableEdge;
	}
	,_pendingOpened: null
	,_opened: null
	,get_opened: function() {
		if(this._pendingOpened != null) {
			return this._pendingOpened;
		}
		return this._opened;
	}
	,set_opened: function(value) {
		if(this._pendingOpened != null) {
			if(this._pendingOpened == value) {
				return this._pendingOpened;
			}
		} else if(this._opened == value) {
			return this._opened;
		}
		this._pendingOpened = value;
		if(this._pendingOpened) {
			this.throwTo(this.getMaxPullDistance());
		} else {
			this.throwTo(0.0);
		}
		return this._pendingOpened;
	}
	,_snapDuration: null
	,get_snapDuration: function() {
		return this._snapDuration;
	}
	,set_snapDuration: function(value) {
		if(this._snapDuration == value) {
			return this._snapDuration;
		}
		this._snapDuration = value;
		return this._snapDuration;
	}
	,_touchPointID: null
	,get_touchPointID: function() {
		return this._touchPointID;
	}
	,_touchPointIsSimulated: null
	,get_touchPointIsSimulated: function() {
		return this._touchPointIsSimulated;
	}
	,_restoreMouseChildren: null
	,_startTouch: null
	,_startPullDistance: null
	,_targetPullDistance: null
	,_savedTouchMoves: null
	,_animatePull: null
	,setOpened: function(value) {
		this._pendingOpened = null;
		if(this._opened == value) {
			return this._opened;
		}
		this._opened = value;
		if(this._opened) {
			feathers_events_FeathersEvent.dispatch(this,"open");
		} else {
			feathers_events_FeathersEvent.dispatch(this,"close");
		}
		return this._opened;
	}
	,setPullDistance: function(value) {
		if(this._pullDistance == value) {
			return this._pullDistance;
		}
		this._pullDistance = value;
		feathers_events_FeathersEvent.dispatch(this,"change");
		return this._pullDistance;
	}
	,getMaxPullDistance: function() {
		if(this._maxPullDistance != null) {
			return this._maxPullDistance;
		}
		switch(this._pullableEdge._hx_index) {
		case 0:
			return this._target.get_height();
		case 1:
			return this._target.get_width();
		case 2:
			return this._target.get_height();
		case 3:
			return this._target.get_width();
		default:
			throw new openfl_errors_ArgumentError("Unknown pullable edge position: " + Std.string(this._pullableEdge));
		}
	}
	,getTouchPosition: function(stageX,stageY) {
		switch(this._pullableEdge._hx_index) {
		case 0:
			return stageY;
		case 1:
			return stageX;
		case 2:
			return stageY;
		case 3:
			return stageX;
		default:
			throw new openfl_errors_ArgumentError("Unknown pullable edge position: " + Std.string(this._pullableEdge));
		}
	}
	,getTouchScale: function() {
		switch(this._pullableEdge._hx_index) {
		case 0:
			return feathers_utils_DisplayUtil.getConcatenatedScaleY(this._target);
		case 1:
			return feathers_utils_DisplayUtil.getConcatenatedScaleX(this._target);
		case 2:
			return feathers_utils_DisplayUtil.getConcatenatedScaleY(this._target);
		case 3:
			return feathers_utils_DisplayUtil.getConcatenatedScaleX(this._target);
		default:
			throw new openfl_errors_ArgumentError("Unknown pullable edge position: " + Std.string(this._pullableEdge));
		}
	}
	,isInActiveBorder: function(stageX,stageY,activeBorderSize) {
		var point = new openfl_geom_Point(stageX,stageY);
		point = this._target.globalToLocal(point);
		switch(this._pullableEdge._hx_index) {
		case 0:
			if(point.y >= 0.0) {
				return point.y < activeBorderSize;
			} else {
				return false;
			}
			break;
		case 1:
			if(point.x >= this._target.get_width() - activeBorderSize) {
				return point.x < this._target.get_width();
			} else {
				return false;
			}
			break;
		case 2:
			if(point.y >= this._target.get_height() - activeBorderSize) {
				return point.y < this._target.get_height();
			} else {
				return false;
			}
			break;
		case 3:
			if(point.x >= 0.0) {
				return point.x < activeBorderSize;
			} else {
				return false;
			}
			break;
		default:
			throw new openfl_errors_ArgumentError("Unknown pullable edge position: " + Std.string(this._pullableEdge));
		}
	}
	,checkMinDrag: function(touchOffset) {
		if(this._opened) {
			switch(this._pullableEdge._hx_index) {
			case 0:
				return touchOffset < -this.minDragDistance;
			case 1:
				return touchOffset > this.minDragDistance;
			case 2:
				return touchOffset > this.minDragDistance;
			case 3:
				return touchOffset < -this.minDragDistance;
			default:
				throw new openfl_errors_ArgumentError("Unknown pullable edge position: " + Std.string(this._pullableEdge));
			}
		}
		switch(this._pullableEdge._hx_index) {
		case 0:
			return touchOffset > this.minDragDistance;
		case 1:
			return touchOffset < -this.minDragDistance;
		case 2:
			return touchOffset < -this.minDragDistance;
		case 3:
			return touchOffset > this.minDragDistance;
		default:
			throw new openfl_errors_ArgumentError("Unknown pullable edge position: " + Std.string(this._pullableEdge));
		}
	}
	,touchBegin: function(touchPointID,simulatedTouch,stageX,stageY) {
		if(!this.enabled) {
			return;
		}
		if(simulatedTouch && !this.simulateTouch) {
			return;
		}
		if(this._touchPointID != null) {
			return;
		}
		if(!this._opened && this._activeBorderSize != null) {
			if(!this.isInActiveBorder(stageX,stageY,this._activeBorderSize)) {
				return;
			}
		}
		if(this._animatePull != null) {
			motion_Actuate.stop(this._animatePull,null,false,false);
			this._animatePull = null;
		}
		this._target.stage.addEventListener("mouseMove",$bind(this,this.edgePuller_target_stage_mouseMoveHandler),false,0,true);
		this._target.stage.addEventListener("mouseUp",$bind(this,this.edgePuller_target_stage_mouseUpHandler),false,0,true);
		this._target.stage.addEventListener("touchMove",$bind(this,this.edgePuller_target_stage_touchMoveHandler),false,0,true);
		this._target.stage.addEventListener("touchEnd",$bind(this,this.edgePuller_target_stage_touchEndHandler),false,0,true);
		if(((this._target) instanceof openfl_display_DisplayObjectContainer)) {
			var container = this._target;
			if(this._active) {
				container.mouseChildren = false;
			}
		}
		this._pendingOpened = null;
		this._touchPointID = touchPointID;
		this._touchPointIsSimulated = simulatedTouch;
		this._startTouch = this.getTouchPosition(stageX,stageY);
		this._startPullDistance = this._pullDistance;
		this._savedTouchMoves.length = 0;
	}
	,touchMove: function(touchPointID,simulatedTouch,stageX,stageY) {
		if(this._touchPointID == null) {
			return;
		}
		if(this._touchPointID != touchPointID) {
			return;
		}
		if(this._touchPointIsSimulated != simulatedTouch) {
			return;
		}
		var touchPosition = this.getTouchPosition(stageX,stageY);
		var touchOffset = touchPosition - this._startTouch;
		var touchScale = this.getTouchScale();
		touchOffset *= touchScale;
		if(!this._dragging && this.enabled && this.checkMinDrag(touchOffset)) {
			this._startTouch = touchPosition;
			touchOffset = 0.0;
			this._dragging = this.startPull();
		}
		if(!this._dragging) {
			return;
		}
		var maxPullDistance = this.getMaxPullDistance();
		var pullDistance = this._startPullDistance;
		if(this._pullableEdge == feathers_layout_RelativePosition.RIGHT || this._pullableEdge == feathers_layout_RelativePosition.BOTTOM) {
			pullDistance -= touchOffset;
		} else {
			pullDistance += touchOffset;
		}
		if(pullDistance < 0.0) {
			pullDistance = 0.0;
		} else if(pullDistance > maxPullDistance) {
			pullDistance = maxPullDistance;
		}
		this.setPullDistance(pullDistance);
		if(this._savedTouchMoves.length > 60) {
			this._savedTouchMoves.length = 30;
		}
		this._savedTouchMoves.push(pullDistance);
		this._savedTouchMoves.push(openfl_Lib.getTimer());
	}
	,touchEnd: function(touchPointID,simulatedTouch) {
		if(this._touchPointID == null) {
			return;
		}
		if(this._touchPointID != touchPointID) {
			return;
		}
		if(this._touchPointIsSimulated != simulatedTouch) {
			return;
		}
		this.cleanupAfterDrag();
		if(!this._dragging) {
			return;
		}
		var targetTime = openfl_Lib.getTimer() - 100;
		var endIndex = this._savedTouchMoves.length - 1;
		var startIndex = endIndex;
		var i = endIndex;
		while(endIndex > 0 && this._savedTouchMoves[i] > targetTime) {
			startIndex = i;
			i -= 2;
		}
		var velocity = 0.0;
		if(this._dragging && startIndex != endIndex) {
			var timeOffset = this._savedTouchMoves[endIndex] - this._savedTouchMoves[startIndex];
			var moved = this._pullDistance - this._savedTouchMoves[startIndex - 1];
			velocity = moved / timeOffset;
		}
		if(velocity != 0.0 || this._dragging) {
			this.throwWithVelocity(velocity);
		} else {
			this.completeDrag();
		}
	}
	,startPull: function() {
		if(this._active) {
			return true;
		}
		this._active = true;
		var result = true;
		if(this._opened) {
			result = feathers_events_FeathersEvent.dispatch(this,"closing",false,true);
		} else {
			result = feathers_events_FeathersEvent.dispatch(this,"opening",false,true);
		}
		if(!result) {
			this._active = false;
			this._dragging = false;
			this.cleanupAfterDrag();
			return false;
		}
		if(((this._target) instanceof openfl_display_DisplayObjectContainer)) {
			var container = this._target;
			this._restoreMouseChildren = container.mouseChildren;
			container.mouseChildren = false;
		}
		feathers_events_FeathersEvent.dispatch(this,"change");
		return true;
	}
	,completeDrag: function() {
		this._dragging = false;
		this.completePull();
	}
	,completePull: function() {
		if(!this._active || this._dragging || this._animatePull != null) {
			return;
		}
		this._active = false;
		if(((this._target) instanceof openfl_display_DisplayObjectContainer)) {
			var container = this._target;
			container.mouseChildren = this._restoreMouseChildren;
		}
		var oldOpened = this._opened;
		var newOpened = this._pullDistance != 0.0;
		this.setOpened(newOpened);
		if(newOpened == oldOpened) {
			feathers_events_FeathersEvent.dispatch(this,"cancel");
		}
	}
	,addStageEvents: function() {
		if(this._target == null || this._target.stage == null) {
			return;
		}
		this._target.stage.addEventListener("touchBegin",$bind(this,this.edgePuller_target_stage_touchBeginHandler),false,0,true);
		this._target.stage.addEventListener("mouseDown",$bind(this,this.edgePuller_target_stage_mouseDownHandler),false,0,true);
	}
	,removeStageEvents: function() {
		if(this._target == null || this._target.stage == null) {
			return;
		}
		this._target.stage.removeEventListener("touchBegin",$bind(this,this.edgePuller_target_stage_touchBeginHandler));
		this._target.stage.removeEventListener("mouseDown",$bind(this,this.edgePuller_target_stage_mouseDownHandler));
	}
	,cleanupAfterDrag: function() {
		if(this._touchPointID == null) {
			return;
		}
		this._touchPointID = null;
		this._touchPointIsSimulated = false;
		if(this._target.stage != null) {
			this._target.stage.removeEventListener("mouseMove",$bind(this,this.edgePuller_target_stage_mouseMoveHandler));
			this._target.stage.removeEventListener("mouseUp",$bind(this,this.edgePuller_target_stage_mouseUpHandler));
			this._target.stage.removeEventListener("touchMove",$bind(this,this.edgePuller_target_stage_touchMoveHandler));
			this._target.stage.removeEventListener("touchEnd",$bind(this,this.edgePuller_target_stage_touchEndHandler));
		}
	}
	,throwWithVelocity: function(velocity) {
		var maxPullDistance = this.getMaxPullDistance();
		var targetPosition = 0.0;
		if(Math.abs(velocity) <= feathers_utils_EdgePuller.MINIMUM_VELOCITY) {
			targetPosition = this._pullDistance < maxPullDistance / 2.0 ? 0.0 : maxPullDistance;
		} else {
			targetPosition = velocity < 0.0 ? 0.0 : maxPullDistance;
		}
		this.throwTo(targetPosition);
	}
	,throwTo: function(targetPosition) {
		var _gthis = this;
		var pullChanged = false;
		if(targetPosition != null) {
			if(this._animatePull != null) {
				motion_Actuate.stop(this._animatePull,null,false,false);
				this._animatePull = null;
			}
			if(this._pullDistance != targetPosition) {
				pullChanged = true;
				if(!this.startPull()) {
					return;
				}
				this._startPullDistance = this._pullDistance;
				this._targetPullDistance = targetPosition;
				if(this._snapDuration > 0.0) {
					var tween = motion_Actuate.update(function(pullDistance) {
						return _gthis.setPullDistance(pullDistance);
					},this._snapDuration,[this._startPullDistance],[this._targetPullDistance],true);
					this._animatePull = tween;
					this._animatePull.ease(this.ease);
					this._animatePull.onComplete($bind(this,this.animatePull_onComplete));
				} else {
					this.setPullDistance(this._targetPullDistance);
					this.completeDrag();
				}
			} else {
				this.completeDrag();
			}
		}
	}
	,animatePull_onComplete: function() {
		this._animatePull = null;
		this.completeDrag();
	}
	,edgePuller_target_addedToStageHandler: function(event) {
		this.addStageEvents();
	}
	,edgePuller_target_removedFromStageHandler: function(event) {
		this.removeStageEvents();
		this.cleanupAfterDrag();
	}
	,edgePuller_target_touchBeginCaptureHandler: function(event) {
		if(!this._active) {
			return;
		}
		event.stopImmediatePropagation();
		this.edgePuller_target_touchBeginHandler(event);
	}
	,edgePuller_target_touchBeginHandler: function(event) {
		if(this.simulateTouch && event.isPrimaryTouchPoint) {
			return;
		}
		this.touchBegin(event.touchPointID,false,event.stageX,event.stageY);
	}
	,edgePuller_target_mouseDownCaptureHandler: function(event) {
		if(!this._active) {
			return;
		}
		event.stopImmediatePropagation();
		this.edgePuller_target_mouseDownHandler(event);
	}
	,edgePuller_target_mouseDownHandler: function(event) {
		if(this._opened) {
			return;
		}
		var stage = this._target.stage;
		if(stage == null) {
			return;
		}
		this.touchBegin(feathers_utils_EdgePuller.POINTER_ID_MOUSE,true,stage.get_mouseX(),stage.get_mouseY());
	}
	,edgePuller_target_stage_touchMoveHandler: function(event) {
		this.touchMove(event.touchPointID,false,event.stageX,event.stageY);
	}
	,edgePuller_target_stage_mouseMoveHandler: function(event) {
		var stage = js_Boot.__cast(event.currentTarget , openfl_display_Stage);
		this.touchMove(feathers_utils_EdgePuller.POINTER_ID_MOUSE,true,stage.get_mouseX(),stage.get_mouseY());
	}
	,edgePuller_target_stage_touchEndHandler: function(event) {
		this.touchEnd(event.touchPointID,false);
	}
	,edgePuller_target_stage_mouseUpHandler: function(event) {
		this.touchEnd(feathers_utils_EdgePuller.POINTER_ID_MOUSE,true);
	}
	,edgePuller_target_stage_touchBeginHandler: function(event) {
		if(!this._opened || !this.enabled || this._touchPointID != null) {
			return;
		}
		var stage = js_Boot.__cast(event.currentTarget , openfl_display_Stage);
		var maxPullDistance = this.getMaxPullDistance();
		if(!this.isInActiveBorder(event.stageX,event.stageY,maxPullDistance)) {
			this._touchPointID = event.touchPointID;
			stage.addEventListener("touchMove",$bind(this,this.edgePuller_target_stage_touchMoveHandler2),false,0,true);
			stage.addEventListener("touchEnd",$bind(this,this.edgePuller_target_stage_touchEndHandler2),false,0,true);
			return;
		}
		this.touchBegin(event.touchPointID,false,event.stageX,event.stageY);
	}
	,edgePuller_target_stage_touchMoveHandler2: function(event) {
		if(this._touchPointID == null || event.touchPointID != this._touchPointID) {
			return;
		}
		var stage = js_Boot.__cast(event.currentTarget , openfl_display_Stage);
		var maxPullDistance = this.getMaxPullDistance();
		var point = new openfl_geom_Point(event.stageX,event.stageY);
		point = this._target.globalToLocal(point);
		switch(this._pullableEdge._hx_index) {
		case 0:
			if(point.y > maxPullDistance || point.y < 0.0) {
				return;
			}
			break;
		case 1:
			if(point.x < this._target.get_width() - maxPullDistance || point.x > this._target.get_width()) {
				return;
			}
			break;
		case 2:
			if(point.y < this._target.get_height() - maxPullDistance || point.y > this._target.get_height()) {
				return;
			}
			break;
		case 3:
			if(point.x > maxPullDistance || point.x < 0.0) {
				return;
			}
			break;
		default:
			throw new openfl_errors_ArgumentError("Unknown pullable edge position: " + Std.string(this._pullableEdge));
		}
		stage.removeEventListener("touchMove",$bind(this,this.edgePuller_target_stage_touchMoveHandler2));
		stage.removeEventListener("touchEnd",$bind(this,this.edgePuller_target_stage_touchEndHandler2));
		this._touchPointID = null;
		this._touchPointIsSimulated = false;
		this.touchBegin(event.touchPointID,false,event.stageX,event.stageY);
	}
	,edgePuller_target_stage_touchEndHandler2: function(event) {
		if(this._touchPointID == null || event.touchPointID != this._touchPointID) {
			return;
		}
		var stage = js_Boot.__cast(event.currentTarget , openfl_display_Stage);
		stage.removeEventListener("touchMove",$bind(this,this.edgePuller_target_stage_touchMoveHandler2));
		stage.removeEventListener("touchEnd",$bind(this,this.edgePuller_target_stage_touchEndHandler2));
		this._touchPointID = null;
		this._touchPointIsSimulated = false;
	}
	,edgePuller_target_stage_mouseDownHandler: function(event) {
		if(!this._opened || !this.enabled || this._touchPointID != null || !this.simulateTouch) {
			return;
		}
		var stage = js_Boot.__cast(event.currentTarget , openfl_display_Stage);
		var maxPullDistance = this.getMaxPullDistance();
		if(!this.isInActiveBorder(stage.get_mouseX(),stage.get_mouseY(),maxPullDistance)) {
			this._touchPointID = feathers_utils_EdgePuller.POINTER_ID_MOUSE;
			this._touchPointIsSimulated = true;
			stage.addEventListener("mouseMove",$bind(this,this.edgePuller_target_stage_mouseMoveHandler2),false,0,true);
			stage.addEventListener("mouseUp",$bind(this,this.edgePuller_target_stage_mouseUpHandler2),false,0,true);
			return;
		}
		this.touchBegin(feathers_utils_EdgePuller.POINTER_ID_MOUSE,true,stage.get_mouseX(),stage.get_mouseY());
	}
	,edgePuller_target_stage_mouseMoveHandler2: function(event) {
		if(!this._touchPointIsSimulated || this._touchPointID == null || feathers_utils_EdgePuller.POINTER_ID_MOUSE != this._touchPointID) {
			return;
		}
		var stage = js_Boot.__cast(event.currentTarget , openfl_display_Stage);
		var maxPullDistance = this.getMaxPullDistance();
		var point = new openfl_geom_Point(stage.get_mouseX(),stage.get_mouseY());
		point = this._target.globalToLocal(point);
		switch(this._pullableEdge._hx_index) {
		case 0:
			if(point.y > maxPullDistance || point.y < 0.0) {
				return;
			}
			break;
		case 1:
			if(point.x < this._target.get_width() - maxPullDistance || point.x > this._target.get_width()) {
				return;
			}
			break;
		case 2:
			if(point.y < this._target.get_height() - maxPullDistance || point.y > this._target.get_height()) {
				return;
			}
			break;
		case 3:
			if(point.x > maxPullDistance || point.x < 0.0) {
				return;
			}
			break;
		default:
			throw new openfl_errors_ArgumentError("Unknown pullable edge position: " + Std.string(this._pullableEdge));
		}
		stage.removeEventListener("mouseMove",$bind(this,this.edgePuller_target_stage_mouseMoveHandler2));
		stage.removeEventListener("mouseUp",$bind(this,this.edgePuller_target_stage_mouseUpHandler2));
		this._touchPointID = null;
		this._touchPointIsSimulated = false;
		this.touchBegin(feathers_utils_EdgePuller.POINTER_ID_MOUSE,true,stage.get_mouseX(),stage.get_mouseY());
	}
	,edgePuller_target_stage_mouseUpHandler2: function(event) {
		if(!this._touchPointIsSimulated || this._touchPointID == null || feathers_utils_EdgePuller.POINTER_ID_MOUSE != this._touchPointID) {
			return;
		}
		var stage = js_Boot.__cast(event.currentTarget , openfl_display_Stage);
		stage.removeEventListener("mouseMove",$bind(this,this.edgePuller_target_stage_mouseMoveHandler2));
		stage.removeEventListener("mouseUp",$bind(this,this.edgePuller_target_stage_mouseUpHandler2));
		this._touchPointID = null;
		this._touchPointIsSimulated = false;
	}
	,__class__: feathers_utils_EdgePuller
	,__properties__: {get_touchPointIsSimulated:"get_touchPointIsSimulated",get_touchPointID:"get_touchPointID",set_snapDuration:"set_snapDuration",get_snapDuration:"get_snapDuration",set_opened:"set_opened",get_opened:"get_opened",set_pullableEdge:"set_pullableEdge",get_pullableEdge:"get_pullableEdge",set_activeBorderSize:"set_activeBorderSize",get_activeBorderSize:"get_activeBorderSize",get_pullDistance:"get_pullDistance",set_maxPullDistance:"set_maxPullDistance",get_maxPullDistance:"get_maxPullDistance",set_target:"set_target",get_target:"get_target",get_dragging:"get_dragging",get_active:"get_active"}
});
var feathers_utils_ExclusivePointer = function(stage) {
	this._touchClaims = new haxe_ds_IntMap();
	this._mouseClaim = null;
	this._stageListenerCount = 0;
	if(stage == null) {
		throw new openfl_errors_ArgumentError("Stage cannot be null.");
	}
	this._stage = stage;
};
$hxClasses["feathers.utils.ExclusivePointer"] = feathers_utils_ExclusivePointer;
feathers_utils_ExclusivePointer.__name__ = "feathers.utils.ExclusivePointer";
feathers_utils_ExclusivePointer.forStage = function(stage) {
	if(stage == null) {
		throw new openfl_errors_ArgumentError("Stage cannot be null.");
	}
	var exclusivePointer = feathers_utils_ExclusivePointer.stageToObject.h[stage.__id__];
	if(exclusivePointer != null) {
		return exclusivePointer;
	}
	exclusivePointer = new feathers_utils_ExclusivePointer(stage);
	feathers_utils_ExclusivePointer.stageToObject.set(stage,exclusivePointer);
	return exclusivePointer;
};
feathers_utils_ExclusivePointer.disposeForStage = function(stage) {
	var exclusivePointer = feathers_utils_ExclusivePointer.stageToObject.h[stage.__id__];
	if(exclusivePointer == null) {
		return;
	}
	exclusivePointer.dispose();
	feathers_utils_ExclusivePointer.stageToObject.remove(stage);
};
feathers_utils_ExclusivePointer.prototype = {
	_stageListenerCount: null
	,_stage: null
	,_mouseClaim: null
	,_touchClaims: null
	,claimTouch: function(touchPointID,target) {
		if(target == null) {
			throw new openfl_errors_ArgumentError("Target cannot be null.");
		}
		if(target.stage != this._stage) {
			throw new openfl_errors_ArgumentError("Target cannot claim a pointer on the selected stage because it appears on a different stage.");
		}
		var existingTarget = this._touchClaims.h[touchPointID];
		if(existingTarget != null) {
			return false;
		}
		this._touchClaims.h[touchPointID] = target;
		target.addEventListener("removedFromStage",$bind(this,this.exclusivePointer_target_removedFromStageHandler),false,0,true);
		if(this._stageListenerCount == 0) {
			this._stage.addEventListener("mouseUp",$bind(this,this.exclusivePointer_stage_mouseUpHandler),false,0,true);
			this._stage.addEventListener("touchEnd",$bind(this,this.exclusivePointer_stage_touchEndHandler),false,0,true);
		}
		this._stageListenerCount++;
		return true;
	}
	,claimMouse: function(target) {
		if(target == null) {
			throw new openfl_errors_ArgumentError("Target cannot be null.");
		}
		if(target.stage != this._stage) {
			throw new openfl_errors_ArgumentError("Target cannot claim a pointer on the selected stage because it appears on a different stage.");
		}
		if(this._mouseClaim != null) {
			return false;
		}
		this._mouseClaim = target;
		target.addEventListener("removedFromStage",$bind(this,this.exclusivePointer_target_removedFromStageHandler),false,0,true);
		if(this._stageListenerCount == 0) {
			this._stage.addEventListener("mouseUp",$bind(this,this.exclusivePointer_stage_mouseUpHandler),false,0,true);
			this._stage.addEventListener("touchEnd",$bind(this,this.exclusivePointer_stage_touchEndHandler),false,0,true);
		}
		this._stageListenerCount++;
		return true;
	}
	,removeTouchClaim: function(touchPointID) {
		var existingTarget = this._touchClaims.h[touchPointID];
		if(existingTarget == null) {
			return;
		}
		this._touchClaims.remove(touchPointID);
		if(!this.hasClaimOn(existingTarget)) {
			existingTarget.removeEventListener("removedFromStage",$bind(this,this.exclusivePointer_target_removedFromStageHandler));
		}
		this._stageListenerCount--;
		if(this._stageListenerCount == 0) {
			this._stage.removeEventListener("mouseUp",$bind(this,this.exclusivePointer_stage_mouseUpHandler));
			this._stage.removeEventListener("touchEnd",$bind(this,this.exclusivePointer_stage_touchEndHandler));
		}
	}
	,removeMouseClaim: function() {
		var existingTarget = this._mouseClaim;
		if(existingTarget == null) {
			return;
		}
		this._mouseClaim = null;
		if(!this.hasClaimOn(existingTarget)) {
			existingTarget.removeEventListener("removedFromStage",$bind(this,this.exclusivePointer_target_removedFromStageHandler));
		}
		this._stageListenerCount--;
		if(this._stageListenerCount == 0) {
			this._stage.removeEventListener("mouseUp",$bind(this,this.exclusivePointer_stage_mouseUpHandler));
			this._stage.removeEventListener("touchEnd",$bind(this,this.exclusivePointer_stage_touchEndHandler));
		}
	}
	,hasClaim: function() {
		if(this._mouseClaim != null) {
			return true;
		}
		var touchPointID = this._touchClaims.keys();
		while(touchPointID.hasNext()) {
			var touchPointID1 = touchPointID.next();
			return true;
		}
		return false;
	}
	,getTouchClaim: function(touchPointID) {
		return this._touchClaims.h[touchPointID];
	}
	,getMouseClaim: function() {
		return this._mouseClaim;
	}
	,removeAllClaims: function() {
		var touchPointID = this._touchClaims.keys();
		while(touchPointID.hasNext()) {
			var touchPointID1 = touchPointID.next();
			this.removeTouchClaim(touchPointID1);
		}
		this.removeMouseClaim();
	}
	,dispose: function() {
		this.removeAllClaims();
	}
	,hasClaimOn: function(target) {
		if(this._mouseClaim == target) {
			return true;
		}
		var map = this._touchClaims;
		var _g_map = map;
		var _g_keys = map.keys();
		while(_g_keys.hasNext()) {
			var key = _g_keys.next();
			var _g_value = _g_map.get(key);
			var _g_key = key;
			var touchPointID = _g_key;
			var existingTarget = _g_value;
			if(existingTarget == target) {
				return true;
			}
		}
		return false;
	}
	,exclusivePointer_target_removedFromStageHandler: function(event) {
		var target = js_Boot.__cast(event.currentTarget , openfl_display_DisplayObject);
		if(this._mouseClaim == target) {
			this.removeMouseClaim();
		}
		var map = this._touchClaims;
		var _g_map = map;
		var _g_keys = map.keys();
		while(_g_keys.hasNext()) {
			var key = _g_keys.next();
			var _g_value = _g_map.get(key);
			var _g_key = key;
			var touchPointID = _g_key;
			var existingTarget = _g_value;
			if(existingTarget == target) {
				this.removeTouchClaim(touchPointID);
			}
		}
	}
	,exclusivePointer_stage_mouseUpHandler: function(event) {
		this.removeMouseClaim();
	}
	,exclusivePointer_stage_touchEndHandler: function(event) {
		this.removeTouchClaim(event.touchPointID);
	}
	,__class__: feathers_utils_ExclusivePointer
};
var feathers_utils_FocusUtil = function() { };
$hxClasses["feathers.utils.FocusUtil"] = feathers_utils_FocusUtil;
feathers_utils_FocusUtil.__name__ = "feathers.utils.FocusUtil";
feathers_utils_FocusUtil.findAllFocusableObjects = function(target,result) {
	if(result == null) {
		result = [];
	}
	if(js_Boot.__implements(target,feathers_core_IFocusObject)) {
		var focusableObject = target;
		if(focusableObject.get_focusEnabled()) {
			result.push(focusableObject);
		}
	}
	if(js_Boot.__implements(target,feathers_core_IFocusExtras)) {
		var focusExtras = target;
		var extras = focusExtras.get_focusExtrasBefore();
		if(extras != null) {
			var _g = 0;
			var _g1 = extras.length;
			while(_g < _g1) {
				var i = _g++;
				var childOfTarget = extras[i];
				feathers_utils_FocusUtil.findAllFocusableObjects(childOfTarget,result);
			}
		}
	}
	if(js_Boot.__implements(target,feathers_core_IFocusObject)) {
		if(js_Boot.__implements(target,feathers_core_IFocusContainer) && target.get_childFocusEnabled()) {
			var otherContainer = js_Boot.__cast(target , openfl_display_DisplayObjectContainer);
			var _g = 0;
			var _g1 = otherContainer.get_numChildren();
			while(_g < _g1) {
				var i = _g++;
				var childOfTarget = otherContainer.getChildAt(i);
				feathers_utils_FocusUtil.findAllFocusableObjects(childOfTarget,result);
			}
		}
	} else if(((target) instanceof openfl_display_DisplayObjectContainer)) {
		var otherContainer = target;
		var _g = 0;
		var _g1 = otherContainer.get_numChildren();
		while(_g < _g1) {
			var i = _g++;
			var childOfTarget = otherContainer.getChildAt(i);
			feathers_utils_FocusUtil.findAllFocusableObjects(childOfTarget,result);
		}
	}
	if(js_Boot.__implements(target,feathers_core_IFocusExtras)) {
		var focusExtras = target;
		var extras = focusExtras.get_focusExtrasAfter();
		if(extras != null) {
			var _g = 0;
			var _g1 = extras.length;
			while(_g < _g1) {
				var i = _g++;
				var childOfTarget = extras[i];
				feathers_utils_FocusUtil.findAllFocusableObjects(childOfTarget,result);
			}
		}
	}
	return result;
};
var feathers_utils_KeyToState = function(target,callback,upState,downState) {
	this._downKeyCode = null;
	this._enabled = true;
	this._downState = null;
	this._upState = null;
	this._callback = null;
	this._target = null;
	this.set_target(target);
	if(upState != null) {
		this._upState = upState;
	}
	if(downState != null) {
		this.set_downState(downState);
	}
	this._currentState = this._upState;
	this.set_callback(callback);
};
$hxClasses["feathers.utils.KeyToState"] = feathers_utils_KeyToState;
feathers_utils_KeyToState.__name__ = "feathers.utils.KeyToState";
feathers_utils_KeyToState.prototype = {
	_target: null
	,get_target: function() {
		return this._target;
	}
	,set_target: function(value) {
		if(this._target == value) {
			return this._target;
		}
		if(this._target != null) {
			this._target.removeEventListener("removedFromStage",$bind(this,this.keyToState_target_removedFromStageHandler));
			this._target.removeEventListener("focusOut",$bind(this,this.keyToState_target_focusOutHandler));
			this._target.removeEventListener("keyDown",$bind(this,this.keyToState_target_keyDownHandler));
			this._target.removeEventListener("keyUp",$bind(this,this.keyToState_target_keyUpHandler));
		}
		this._target = value;
		if(this._target != null) {
			this._currentState = this._upState;
			this._target.addEventListener("removedFromStage",$bind(this,this.keyToState_target_removedFromStageHandler));
			this._target.addEventListener("focusOut",$bind(this,this.keyToState_target_focusOutHandler));
			this._target.addEventListener("keyDown",$bind(this,this.keyToState_target_keyDownHandler));
			this._target.addEventListener("keyUp",$bind(this,this.keyToState_target_keyUpHandler));
		}
		return this._target;
	}
	,_callback: null
	,get_callback: function() {
		return this._callback;
	}
	,set_callback: function(value) {
		if(this._callback == value) {
			return this._callback;
		}
		this._callback = value;
		if(this._callback != null) {
			this._callback(this._currentState);
		}
		return this._callback;
	}
	,_currentState: null
	,get_currentState: function() {
		return this._currentState;
	}
	,_upState: null
	,get_upState: function() {
		return this._upState;
	}
	,set_upState: function(value) {
		this._upState = value;
		return this._upState;
	}
	,_downState: null
	,get_downState: function() {
		return this._downState;
	}
	,set_downState: function(value) {
		this._downState = value;
		return this._downState;
	}
	,_enabled: null
	,get_enabled: function() {
		return this._enabled;
	}
	,set_enabled: function(value) {
		if(this._enabled == value) {
			return this._enabled;
		}
		this._enabled = value;
		if(!this._enabled) {
			this.resetKeyState();
		}
		return this._enabled;
	}
	,_downKeyCode: null
	,changeState: function(value) {
		var oldState = this._currentState;
		if(js_Boot.__implements(this._target,feathers_core_IStateContext)) {
			oldState = this._target.get_currentState();
		}
		this._currentState = value;
		if(oldState == value) {
			return;
		}
		if(this._callback != null) {
			this._callback(value);
		}
	}
	,resetKeyState: function() {
		if(this._downKeyCode == null) {
			return;
		}
		this._downKeyCode = null;
		this.changeState(this._upState);
	}
	,keyToState_target_removedFromStageHandler: function(event) {
		this.resetKeyState();
	}
	,keyToState_target_focusOutHandler: function(event) {
		this.resetKeyState();
	}
	,keyToState_target_keyDownHandler: function(event) {
		if(js_Boot.__implements(this._target,feathers_core_IFocusObject)) {
			var focusObject = this._target;
			var focusManager = focusObject.get_focusManager();
			if(focusManager != null && focusManager.get_focus() != focusObject) {
				return;
			}
		}
		if(!this._enabled || this._downKeyCode != null || event.keyCode != 32 && event.keyCode != 13) {
			return;
		}
		this._downKeyCode = event.keyCode;
		this.changeState(this._downState);
	}
	,keyToState_target_keyUpHandler: function(event) {
		if(event.keyCode != this._downKeyCode) {
			return;
		}
		this.resetKeyState();
	}
	,__class__: feathers_utils_KeyToState
	,__properties__: {set_enabled:"set_enabled",get_enabled:"get_enabled",set_downState:"set_downState",get_downState:"get_downState",set_upState:"set_upState",get_upState:"get_upState",get_currentState:"get_currentState",set_callback:"set_callback",get_callback:"get_callback",set_target:"set_target",get_target:"get_target"}
};
var feathers_utils_MathUtil = function() { };
$hxClasses["feathers.utils.MathUtil"] = feathers_utils_MathUtil;
feathers_utils_MathUtil.__name__ = "feathers.utils.MathUtil";
feathers_utils_MathUtil.roundDownToNearest = function(number,nearest) {
	if(nearest == null) {
		nearest = 1.0;
	}
	if(nearest == 0) {
		return number;
	}
	return Math.floor(feathers_utils_MathUtil.roundToPrecision(number / nearest,10)) * nearest;
};
feathers_utils_MathUtil.roundUpToNearest = function(number,nearest) {
	if(nearest == null) {
		nearest = 1.0;
	}
	if(nearest == 0) {
		return number;
	}
	return Math.ceil(feathers_utils_MathUtil.roundToPrecision(number / nearest,10)) * nearest;
};
feathers_utils_MathUtil.roundToNearest = function(number,nearest) {
	if(nearest == null) {
		nearest = 1.0;
	}
	if(nearest == 0) {
		return number;
	}
	return Math.round(feathers_utils_MathUtil.roundToPrecision(number / nearest,10)) * nearest;
};
feathers_utils_MathUtil.roundToPrecision = function(number,precision) {
	if(precision == null) {
		precision = 0;
	}
	var decimalPlaces = Math.pow(10,precision);
	return Math.round(decimalPlaces * number) / decimalPlaces;
};
feathers_utils_MathUtil.fuzzyEquals = function(n1,n2,maxDifference) {
	if(maxDifference == null) {
		maxDifference = 0.000001;
	}
	return Math.abs(n1 - n2) <= maxDifference;
};
var feathers_utils_MeasurementsUtil = function() { };
$hxClasses["feathers.utils.MeasurementsUtil"] = feathers_utils_MeasurementsUtil;
feathers_utils_MeasurementsUtil.__name__ = "feathers.utils.MeasurementsUtil";
feathers_utils_MeasurementsUtil.resetFluidlyWithParentValues = function(measurements,target,parentExplicitWidth,parentExplicitHeight,parentExplicitMinWidth,parentExplicitMinHeight,parentExplicitMaxWidth,parentExplicitMaxHeight) {
	if(target == null) {
		return;
	}
	if(js_Boot.__implements(target,feathers_core_IMeasureObject)) {
		var measureTarget = target;
		var width = parentExplicitWidth;
		if(width == null) {
			width = measurements.width;
		}
		if(width == null) {
			measureTarget.resetWidth();
		} else {
			measureTarget.set_width(width);
		}
		var height = parentExplicitHeight;
		if(height == null) {
			height = measurements.height;
		}
		if(height == null) {
			measureTarget.resetHeight();
		} else {
			measureTarget.set_height(height);
		}
		var minWidth = parentExplicitMinWidth;
		if(minWidth == null || measureTarget.get_explicitMinWidth() != null && measureTarget.get_explicitMinWidth() > minWidth) {
			minWidth = measureTarget.get_explicitMinWidth();
		}
		if(minWidth == null) {
			minWidth = 0.0;
		}
		measureTarget.set_minWidth(minWidth);
		var minHeight = parentExplicitMinHeight;
		if(minHeight == null || measureTarget.get_explicitMinHeight() != null && measureTarget.get_explicitMinHeight() > minHeight) {
			minHeight = measureTarget.get_explicitMinHeight();
		}
		if(minHeight == null) {
			minHeight = 0.0;
		}
		measureTarget.set_minHeight(minHeight);
		var maxWidth = parentExplicitMaxWidth;
		if(maxWidth == null || measureTarget.get_explicitMaxWidth() != null && measureTarget.get_explicitMaxWidth() < maxWidth) {
			maxWidth = measureTarget.get_explicitMaxWidth();
		}
		if(maxWidth == null) {
			maxWidth = 1.0 / 0.0;
		}
		measureTarget.set_maxWidth(maxWidth);
		var maxHeight = parentExplicitMaxHeight;
		if(maxHeight == null || measureTarget.get_explicitMaxHeight() != null && measureTarget.get_explicitMaxHeight() < maxHeight) {
			maxHeight = measureTarget.get_explicitMaxHeight();
		}
		if(maxHeight == null) {
			maxHeight = 1.0 / 0.0;
		}
		measureTarget.set_maxHeight(maxHeight);
		return;
	}
	if(parentExplicitWidth != null) {
		target.set_width(parentExplicitWidth);
	} else if(measurements.width != null) {
		target.set_width(measurements.width);
	}
	if(parentExplicitHeight != null) {
		target.set_height(parentExplicitHeight);
	} else if(measurements.height != null) {
		target.set_height(measurements.height);
	}
};
feathers_utils_MeasurementsUtil.resetFluidlyWithParent = function(measurements,target,parent) {
	feathers_utils_MeasurementsUtil.resetFluidlyWithParentValues(measurements,target,parent.get_explicitWidth(),parent.get_explicitHeight(),parent.get_explicitMinWidth(),parent.get_explicitMinHeight(),parent.get_explicitMaxWidth(),parent.get_explicitMaxHeight());
};
var feathers_utils__$Path2EReg_Token = $hxEnums["feathers.utils._Path2EReg.Token"] = { __ename__:"feathers.utils._Path2EReg.Token",__constructs__:null
	,Static: ($_=function(token) { return {_hx_index:0,token:token,__enum__:"feathers.utils._Path2EReg.Token",toString:$estr}; },$_._hx_name="Static",$_.__params__ = ["token"],$_)
	,Capture: ($_=function(key) { return {_hx_index:1,key:key,__enum__:"feathers.utils._Path2EReg.Token",toString:$estr}; },$_._hx_name="Capture",$_.__params__ = ["key"],$_)
};
feathers_utils__$Path2EReg_Token.__constructs__ = [feathers_utils__$Path2EReg_Token.Static,feathers_utils__$Path2EReg_Token.Capture];
var feathers_utils_Path2EReg = function() { };
$hxClasses["feathers.utils.Path2EReg"] = feathers_utils_Path2EReg;
feathers_utils_Path2EReg.__name__ = "feathers.utils.Path2EReg";
feathers_utils_Path2EReg.parse = function(str) {
	var matcher = new EReg(["(\\\\.)","([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))"].join("|"),"g");
	var tokens = [];
	var key = 0;
	var index = 0;
	var path = "";
	var matched = function(index) {
		try {
			return matcher.matched(index);
		} catch( _g ) {
			haxe_NativeStackTrace.lastError = _g;
			return null;
		}
	};
	matcher.map(str,function(matcher) {
		var m = matched(0);
		var escaped = matched(1);
		var offset = matcher.matchedPos().pos;
		path += str.substring(index,offset);
		index = offset + m.length;
		if(escaped != null) {
			path += escaped.charAt(1);
			return "";
		}
		var next = str.charAt(index);
		var prefix = matched(2);
		var name = matched(3);
		var capture = matched(4);
		var group = matched(5);
		var modifier = matched(6);
		var asterisk = matched(7);
		var delimiter = prefix == null ? "/" : prefix;
		if(path != "") {
			tokens.push(feathers_utils__$Path2EReg_Token.Static(path));
			path = "";
		}
		var tmp;
		if(name == null) {
			key += 1;
			tmp = "" + (key - 1);
		} else {
			tmp = name;
		}
		var tmp1;
		if(capture == null) {
			if(group == null) {
				if(asterisk == null) {
					tmp1 = "[^" + delimiter + "]+?";
				} else {
					var x = asterisk;
					tmp1 = ".*";
				}
			} else {
				var x = group;
				tmp1 = x;
			}
		} else {
			var x = capture;
			tmp1 = x;
		}
		tokens.push(feathers_utils__$Path2EReg_Token.Capture({ name : tmp, prefix : prefix == null ? "" : prefix, delimiter : delimiter, optional : modifier == "?" || modifier == "*", repeat : modifier == "+" || modifier == "*", partial : prefix != null && next != "" && next != prefix, asterisk : asterisk != null, pattern : feathers_utils_Path2EReg.escapeGroup(tmp1)}));
		return "";
	});
	if(index < str.length) {
		path += HxOverrides.substr(str,index,null);
	}
	if(path != "") {
		tokens.push(feathers_utils__$Path2EReg_Token.Static(path));
	}
	return tokens;
};
feathers_utils_Path2EReg.tokensToEReg = function(tokens,options) {
	options = feathers_utils_Path2EReg.defaults(options);
	var strict = options.strict;
	var end = options.end;
	var route = "";
	var lastToken = tokens[tokens.length - 1];
	var endsWithSlash;
	if(lastToken._hx_index == 0) {
		var token = lastToken.token;
		endsWithSlash = token.charAt(token.length - 1) == "/";
	} else {
		endsWithSlash = false;
	}
	var _g = 0;
	while(_g < tokens.length) {
		var token = tokens[_g];
		++_g;
		switch(token._hx_index) {
		case 0:
			var token1 = token.token;
			route += feathers_utils_Path2EReg.escapeString(token1);
			break;
		case 1:
			var token2 = token.key;
			var prefix = feathers_utils_Path2EReg.escapeString(token2.prefix);
			var capture = "(?:" + token2.pattern + ")";
			if(token2.repeat) {
				capture += "(?:" + prefix + capture + ")*";
			}
			if(token2.optional) {
				if(!token2.partial) {
					capture = "(?:" + prefix + "(" + capture + "))?";
				} else {
					capture = prefix + "(" + capture + ")?";
				}
			} else {
				capture = prefix + "(" + capture + ")";
			}
			route += capture;
			break;
		}
	}
	if(!strict) {
		route = (endsWithSlash ? HxOverrides.substr(route,0,route.length - 2) : route) + "(?:\\/(?=$))?";
	}
	if(end) {
		route += "$";
	} else {
		route += strict && endsWithSlash ? "" : "(?=\\/|$)";
	}
	return new EReg("^" + route,feathers_utils_Path2EReg.flags(options));
};
feathers_utils_Path2EReg.defaults = function(options) {
	if(options == null) {
		options = { };
	}
	return { strict : options.strict == null ? false : options.strict, end : options.end == null ? true : options.end, sensitive : options.sensitive == null ? false : options.sensitive};
};
feathers_utils_Path2EReg.escapeGroup = function(group) {
	var chars = "=!:$/()".split("");
	var _g = 0;
	while(_g < chars.length) {
		var char = chars[_g];
		++_g;
		group = StringTools.replace(group,char,"\\" + char);
	}
	return group;
};
feathers_utils_Path2EReg.escapeString = function(str) {
	var chars = "\\.+*?=^!:${}()[]|/".split("");
	var _g = 0;
	while(_g < chars.length) {
		var char = chars[_g];
		++_g;
		str = StringTools.replace(str,char,"\\" + char);
	}
	return str;
};
feathers_utils_Path2EReg.flags = function(options) {
	if(options.sensitive) {
		return "";
	} else {
		return "i";
	}
};
feathers_utils_Path2EReg.encodeAsterisk = function(str) {
	return new EReg("[?#]","g").map(str,function(matcher) {
		var c = matcher.matched(0);
		return "%" + StringTools.hex(HxOverrides.cca(c,0)).toUpperCase();
	});
};
feathers_utils_Path2EReg.toEReg = function(path,options) {
	var tokens = feathers_utils_Path2EReg.parse(path);
	var keys = [];
	var _g = 0;
	while(_g < tokens.length) {
		var token = tokens[_g];
		++_g;
		if(token._hx_index == 1) {
			var key = token.key;
			keys.push(key);
		} else {
			continue;
		}
	}
	return { ereg : feathers_utils_Path2EReg.tokensToEReg(tokens,options), keys : keys};
};
var feathers_utils_PointerToState = function(target,callback,upState,downState,hoverState) {
	this._down = false;
	this._hoverBeforeDown = false;
	this._keepDownStateOnRollOut = false;
	this._enabled = true;
	this._hoverState = null;
	this._downState = null;
	this._upState = null;
	this._callback = null;
	this._stateContext = null;
	this._target = null;
	this.set_target(target);
	if(upState != null) {
		this.set_upState(upState);
	}
	if(downState != null) {
		this.set_downState(downState);
	}
	if(hoverState != null) {
		this.set_hoverState(hoverState);
	}
	this._currentState = this._upState;
	this.set_callback(callback);
};
$hxClasses["feathers.utils.PointerToState"] = feathers_utils_PointerToState;
feathers_utils_PointerToState.__name__ = "feathers.utils.PointerToState";
feathers_utils_PointerToState.prototype = {
	_target: null
	,get_target: function() {
		return this._target;
	}
	,set_target: function(value) {
		if(this._target == value) {
			return this._target;
		}
		if(this._target != null) {
			this._target.removeEventListener("removedFromStage",$bind(this,this.pointerToState_target_removedFromStageHandler));
			this._target.removeEventListener("rollOver",$bind(this,this.pointerToState_target_rollOverHandler));
			this._target.removeEventListener("rollOut",$bind(this,this.pointerToState_target_rollOutHandler));
			this._target.removeEventListener("mouseDown",$bind(this,this.pointerToState_target_mouseDownHandler));
		}
		this._target = value;
		if(this._target != null) {
			this._currentState = this._upState;
			this._target.addEventListener("removedFromStage",$bind(this,this.pointerToState_target_removedFromStageHandler));
			this._target.addEventListener("rollOver",$bind(this,this.pointerToState_target_rollOverHandler));
			this._target.addEventListener("rollOut",$bind(this,this.pointerToState_target_rollOutHandler));
			this._target.addEventListener("mouseDown",$bind(this,this.pointerToState_target_mouseDownHandler));
		}
		return this._target;
	}
	,_stateContext: null
	,get_stateContext: function() {
		return this._stateContext;
	}
	,set_stateContext: function(value) {
		if(this._stateContext == value) {
			return this._stateContext;
		}
		this._stateContext = value;
		return this._stateContext;
	}
	,_callback: null
	,get_callback: function() {
		return this._callback;
	}
	,set_callback: function(value) {
		if(this._callback == value) {
			return this._callback;
		}
		this._callback = value;
		if(this._callback != null) {
			this._callback(this._currentState);
		}
		return this._callback;
	}
	,_currentState: null
	,get_currentState: function() {
		return this._currentState;
	}
	,_upState: null
	,get_upState: function() {
		return this._upState;
	}
	,set_upState: function(value) {
		this._upState = value;
		return this._upState;
	}
	,_downState: null
	,get_downState: function() {
		return this._downState;
	}
	,set_downState: function(value) {
		this._downState = value;
		return this._downState;
	}
	,_hoverState: null
	,get_hoverState: function() {
		return this._hoverState;
	}
	,set_hoverState: function(value) {
		this._hoverState = value;
		return this._hoverState;
	}
	,_enabled: null
	,get_enabled: function() {
		return this._enabled;
	}
	,set_enabled: function(value) {
		this._enabled = value;
		return this._enabled;
	}
	,_keepDownStateOnRollOut: null
	,get_keepDownStateOnRollOut: function() {
		return this._keepDownStateOnRollOut;
	}
	,set_keepDownStateOnRollOut: function(value) {
		this._keepDownStateOnRollOut = value;
		return this._keepDownStateOnRollOut;
	}
	,_customHitTest: null
	,get_customHitTest: function() {
		return this._customHitTest;
	}
	,set_customHitTest: function(value) {
		this._customHitTest = value;
		return this._customHitTest;
	}
	,_hoverBeforeDown: null
	,_down: null
	,changeState: function(value) {
		var oldState = this._currentState;
		var targetStateContext = this._stateContext;
		if(targetStateContext == null && js_Boot.__implements(this._target,feathers_core_IStateContext)) {
			targetStateContext = this._target;
		}
		if(targetStateContext != null) {
			oldState = targetStateContext.get_currentState();
		}
		this._currentState = value;
		if(oldState == value) {
			return;
		}
		if(this._callback != null) {
			this._callback(value);
		}
	}
	,resetTouchState: function() {
		this._hoverBeforeDown = false;
		this.changeState(this._upState);
	}
	,pointerToState_target_removedFromStageHandler: function(event) {
		if(this._target.stage != null) {
			this._target.stage.removeEventListener("mouseUp",$bind(this,this.pointerToState_stage_mouseUpHandler));
		}
		this.resetTouchState();
	}
	,pointerToState_target_rollOverHandler: function(event) {
		if(!this._enabled) {
			return;
		}
		if(this._customHitTest != null && !this._customHitTest(event.stageX,event.stageY)) {
			return;
		}
		this._hoverBeforeDown = true;
		if(this._down) {
			this.changeState(this._downState);
		} else {
			this.changeState(this._hoverState);
		}
	}
	,pointerToState_target_rollOutHandler: function(event) {
		if(!this._enabled) {
			return;
		}
		this._hoverBeforeDown = false;
		if(this._keepDownStateOnRollOut && this._down) {
			this.changeState(this._downState);
			return;
		}
		this.changeState(this._upState);
	}
	,pointerToState_target_mouseDownHandler: function(event) {
		if(!this._enabled || this._target.stage == null) {
			return;
		}
		if(this._customHitTest != null && !this._customHitTest(event.stageX,event.stageY)) {
			return;
		}
		this._down = true;
		this._target.stage.addEventListener("mouseUp",$bind(this,this.pointerToState_stage_mouseUpHandler),false,0,true);
		this.changeState(this._downState);
	}
	,pointerToState_stage_mouseUpHandler: function(event) {
		var stage = js_Boot.__cast(event.currentTarget , openfl_display_Stage);
		this._down = false;
		stage.removeEventListener("mouseUp",$bind(this,this.pointerToState_stage_mouseUpHandler));
		if(this._hoverBeforeDown && this._target.hitTestPoint(event.stageX,event.stageY)) {
			this.changeState(this._hoverState);
		} else {
			this.resetTouchState();
		}
	}
	,__class__: feathers_utils_PointerToState
	,__properties__: {set_customHitTest:"set_customHitTest",get_customHitTest:"get_customHitTest",set_keepDownStateOnRollOut:"set_keepDownStateOnRollOut",get_keepDownStateOnRollOut:"get_keepDownStateOnRollOut",set_enabled:"set_enabled",get_enabled:"get_enabled",set_hoverState:"set_hoverState",get_hoverState:"get_hoverState",set_downState:"set_downState",get_downState:"get_downState",set_upState:"set_upState",get_upState:"get_upState",get_currentState:"get_currentState",set_callback:"set_callback",get_callback:"get_callback",set_stateContext:"set_stateContext",get_stateContext:"get_stateContext",set_target:"set_target",get_target:"get_target"}
};
var feathers_utils_PointerTrigger = function(target,eventFactory) {
	this._enabled = true;
	this._eventFactory = null;
	this._target = null;
	this.set_target(target);
	this.set_eventFactory(eventFactory);
};
$hxClasses["feathers.utils.PointerTrigger"] = feathers_utils_PointerTrigger;
feathers_utils_PointerTrigger.__name__ = "feathers.utils.PointerTrigger";
feathers_utils_PointerTrigger.prototype = {
	_target: null
	,get_target: function() {
		return this._target;
	}
	,set_target: function(value) {
		if(this._target == value) {
			return this._target;
		}
		if(this._target != null) {
			this._target.removeEventListener("click",$bind(this,this.pointerTrigger_target_clickHandler));
			this._target.removeEventListener("touchTap",$bind(this,this.pointerTrigger_target_touchTapHandler));
		}
		this._target = value;
		if(this._target != null) {
			this._target.addEventListener("click",$bind(this,this.pointerTrigger_target_clickHandler));
			this._target.addEventListener("touchTap",$bind(this,this.pointerTrigger_target_touchTapHandler));
		}
		return this._target;
	}
	,_eventFactory: null
	,get_eventFactory: function() {
		return this._eventFactory;
	}
	,set_eventFactory: function(value) {
		if(this._eventFactory == value) {
			return this._eventFactory;
		}
		this._eventFactory = value;
		return this._eventFactory;
	}
	,_enabled: null
	,get_enabled: function() {
		return this._enabled;
	}
	,set_enabled: function(value) {
		this._enabled = value;
		return this._enabled;
	}
	,_customHitTest: null
	,get_customHitTest: function() {
		return this._customHitTest;
	}
	,set_customHitTest: function(value) {
		this._customHitTest = value;
		return this._customHitTest;
	}
	,pointerTrigger_target_clickHandler: function(event) {
		if(!this._enabled) {
			return;
		}
		if(this._customHitTest != null && !this._customHitTest(event.stageX,event.stageY)) {
			return;
		}
		if(this._eventFactory != null) {
			this._target.dispatchEvent(this._eventFactory());
			return;
		}
		feathers_events_TriggerEvent.dispatchFromMouseEvent(this._target,event);
	}
	,pointerTrigger_target_touchTapHandler: function(event) {
		if(!this._enabled) {
			return;
		}
		if(event.isPrimaryTouchPoint) {
			return;
		}
		if(this._customHitTest != null && !this._customHitTest(event.stageX,event.stageY)) {
			return;
		}
		if(this._eventFactory != null) {
			this._target.dispatchEvent(this._eventFactory());
			return;
		}
		feathers_events_TriggerEvent.dispatchFromTouchEvent(this._target,event);
	}
	,__class__: feathers_utils_PointerTrigger
	,__properties__: {set_customHitTest:"set_customHitTest",get_customHitTest:"get_customHitTest",set_enabled:"set_enabled",get_enabled:"get_enabled",set_eventFactory:"set_eventFactory",get_eventFactory:"get_eventFactory",set_target:"set_target",get_target:"get_target"}
};
var feathers_utils_PopUpUtil = function() { };
$hxClasses["feathers.utils.PopUpUtil"] = feathers_utils_PopUpUtil;
feathers_utils_PopUpUtil.__name__ = "feathers.utils.PopUpUtil";
feathers_utils_PopUpUtil.isTopLevelPopUpOrIsContainedByTopLevelPopUp = function(target) {
	if(target.stage == null) {
		return false;
	}
	var popUpManager = feathers_core_PopUpManager.forStage(target.stage);
	var _g = popUpManager.get_popUpCount() - popUpManager.get_topLevelPopUpCount();
	var _g1 = popUpManager.get_popUpCount();
	while(_g < _g1) {
		var i = _g++;
		var popUp = popUpManager.getPopUpAt(i);
		if(target == popUp) {
			return true;
		}
		if(((popUp) instanceof openfl_display_DisplayObjectContainer)) {
			var popUpContainer = popUp;
			if(popUpContainer.contains(target)) {
				return true;
			}
		}
	}
	return false;
};
var feathers_utils_ScaleUtil = function() { };
$hxClasses["feathers.utils.ScaleUtil"] = feathers_utils_ScaleUtil;
feathers_utils_ScaleUtil.__name__ = "feathers.utils.ScaleUtil";
feathers_utils_ScaleUtil.fitRectangle = function(original,into,result) {
	var width = original.width;
	var height = original.height;
	var intoWidth = into.width;
	var intoHeight = into.height;
	var scale = feathers_utils_ScaleUtil.scaleToFit(width,height,intoWidth,intoHeight);
	if(result == null) {
		result = new openfl_geom_Rectangle();
	}
	var resultWidth = width * scale;
	var resultHeight = height * scale;
	result.width = resultWidth;
	result.height = resultHeight;
	result.x = into.x + (intoWidth - resultWidth) / 2.0;
	result.y = into.y + (intoHeight - resultHeight) / 2.0;
	return result;
};
feathers_utils_ScaleUtil.fillRectangle = function(original,into,result) {
	var width = original.width;
	var height = original.height;
	var intoWidth = into.width;
	var intoHeight = into.height;
	var scale = feathers_utils_ScaleUtil.scaleToFill(width,height,intoWidth,intoHeight);
	if(result == null) {
		result = new openfl_geom_Rectangle();
	}
	var resultWidth = width * scale;
	var resultHeight = height * scale;
	result.width = resultWidth;
	result.height = resultHeight;
	result.x = into.x + (intoWidth - resultWidth) / 2.0;
	result.y = into.y + (intoHeight - resultHeight) / 2.0;
	return result;
};
feathers_utils_ScaleUtil.scaleToFit = function(originalWidth,originalHeight,targetWidth,targetHeight) {
	var widthRatio = targetWidth / originalWidth;
	var heightRatio = targetHeight / originalHeight;
	if(widthRatio < heightRatio) {
		return widthRatio;
	}
	return heightRatio;
};
feathers_utils_ScaleUtil.scaleToFill = function(originalWidth,originalHeight,targetWidth,targetHeight) {
	var widthRatio = targetWidth / originalWidth;
	var heightRatio = targetHeight / originalHeight;
	if(widthRatio > heightRatio) {
		return widthRatio;
	}
	return heightRatio;
};
var feathers_utils_ScreenDensityScaleCalculator = function() {
	this._buckets = [];
};
$hxClasses["feathers.utils.ScreenDensityScaleCalculator"] = feathers_utils_ScreenDensityScaleCalculator;
feathers_utils_ScreenDensityScaleCalculator.__name__ = "feathers.utils.ScreenDensityScaleCalculator";
feathers_utils_ScreenDensityScaleCalculator.prototype = {
	_buckets: null
	,addScaleForDensity: function(density,scale) {
		var i = this._buckets.length;
		var _g = 0;
		var _g1 = this._buckets;
		while(_g < _g1.length) {
			var bucket = _g1[_g];
			++_g;
			if(bucket.density > density) {
				break;
			}
			if(bucket.density == density) {
				throw new openfl_errors_ArgumentError("Screen density cannot be added more than once: " + density);
			}
		}
		var _this = this._buckets;
		var x = new feathers_utils__$ScreenDensityScaleCalculator_ScreenDensityBucket(density,scale);
		_this.splice(i,0,x);
	}
	,removeScaleForDensity: function(density) {
		var _g = 0;
		var _g1 = this._buckets;
		while(_g < _g1.length) {
			var bucket = _g1[_g];
			++_g;
			if(bucket.density == density) {
				HxOverrides.remove(this._buckets,bucket);
				return;
			}
		}
	}
	,getScale: function(density) {
		if(this._buckets.length == 0) {
			throw new openfl_errors_IllegalOperationError("Cannot choose scale because none have been added");
		}
		var bucket = this._buckets[0];
		if(density <= bucket.density) {
			return bucket.scale;
		}
		var previousBucket = bucket;
		var _g = 1;
		var _g1 = this._buckets.length;
		while(_g < _g1) {
			var i = _g++;
			bucket = this._buckets[i];
			if(density > bucket.density) {
				previousBucket = bucket;
				continue;
			}
			var midDPI = (bucket.density + previousBucket.density) / 2.0;
			if(density < midDPI) {
				return previousBucket.scale;
			}
			return bucket.scale;
		}
		return bucket.scale;
	}
	,__class__: feathers_utils_ScreenDensityScaleCalculator
};
var feathers_utils__$ScreenDensityScaleCalculator_ScreenDensityBucket = function(density,scale) {
	this.density = density;
	this.scale = scale;
};
$hxClasses["feathers.utils._ScreenDensityScaleCalculator.ScreenDensityBucket"] = feathers_utils__$ScreenDensityScaleCalculator_ScreenDensityBucket;
feathers_utils__$ScreenDensityScaleCalculator_ScreenDensityBucket.__name__ = "feathers.utils._ScreenDensityScaleCalculator.ScreenDensityBucket";
feathers_utils__$ScreenDensityScaleCalculator_ScreenDensityBucket.prototype = {
	density: null
	,scale: null
	,__class__: feathers_utils__$ScreenDensityScaleCalculator_ScreenDensityBucket
};
var feathers_utils_Scroller = function(target) {
	this._touchPointIsSimulated = false;
	this._touchPointID = null;
	this._previousTouchPointID = null;
	this.snappingToEdge = false;
	this.targetScrollY = 0.0;
	this.targetScrollX = 0.0;
	this.animateScrollYEndRatio = 1.0;
	this.animateScrollXEndRatio = 1.0;
	this.animateScrollY = null;
	this.animateScrollX = null;
	this.savedScrollMoves = [];
	this.startScrollY = 0.0;
	this.startScrollX = 0.0;
	this.startTouchY = 0.0;
	this.startTouchX = 0.0;
	this.restoreMouseChildren = false;
	this._fixedThrowDuration = 2.996998998998728;
	this._logDecelerationRate = -0.0020020026706730793;
	this.snapPositionsY = null;
	this.snapPositionsX = null;
	this._decelerationRate = 0.998;
	this.simulateTouch = false;
	this.mouseWheelDuration = 0.0;
	this._mouseWheelDeltaMode = 1;
	this.mouseWheelYScrollsX = false;
	this.mouseWheelDeltaY = 10.0;
	this.mouseWheelDeltaX = 10.0;
	this.bounceEase = null;
	this.ease = motion_easing_Quart.easeOut;
	this.elasticSnapDuration = 0.5;
	this.throwElasticity = 0.05;
	this.elasticity = 0.33;
	this.forceElasticLeft = false;
	this.forceElasticBottom = false;
	this.forceElasticRight = false;
	this.forceElasticTop = false;
	this.elasticEdges = true;
	this.minDragDistance = 6.0;
	this._draggingY = false;
	this._draggingX = false;
	this._scrolling = false;
	this._contentHeight = 0.0;
	this._contentWidth = 0.0;
	this._visibleHeight = 0.0;
	this._visibleWidth = 0.0;
	this._maxScrollY = 0.0;
	this._maxScrollX = 0.0;
	this._minScrollY = 0.0;
	this._minScrollX = 0.0;
	this._scrollY = 0.0;
	this._scrollX = 0.0;
	this.enabledY = true;
	this.enabledX = true;
	openfl_events_EventDispatcher.call(this);
	this.set_target(target);
};
$hxClasses["feathers.utils.Scroller"] = feathers_utils_Scroller;
feathers_utils_Scroller.__name__ = "feathers.utils.Scroller";
feathers_utils_Scroller.__super__ = openfl_events_EventDispatcher;
feathers_utils_Scroller.prototype = $extend(openfl_events_EventDispatcher.prototype,{
	enabledX: null
	,enabledY: null
	,_scrollX: null
	,get_scrollX: function() {
		return this._scrollX;
	}
	,set_scrollX: function(value) {
		if(this._scrollX == value) {
			return this._scrollX;
		}
		this._scrollX = value;
		feathers_events_ScrollEvent.dispatch(this,"scroll",false,false,this._scrollX,this._scrollY);
		return this._scrollX;
	}
	,_scrollY: null
	,get_scrollY: function() {
		return this._scrollY;
	}
	,set_scrollY: function(value) {
		if(this._scrollY == value) {
			return this._scrollY;
		}
		this._scrollY = value;
		feathers_events_ScrollEvent.dispatch(this,"scroll",false,false,this._scrollX,this._scrollY);
		return this._scrollY;
	}
	,get_restrictedScrollX: function() {
		return this._scrollX;
	}
	,set_restrictedScrollX: function(value) {
		if(value < this._minScrollX) {
			value = this._minScrollX;
		} else if(value > this._maxScrollX) {
			value = this._maxScrollX;
		}
		if(this._scrollX == value) {
			return this._scrollX;
		}
		this._scrollX = value;
		feathers_events_ScrollEvent.dispatch(this,"scroll",false,false,this._scrollX,this._scrollY);
		return this._scrollX;
	}
	,get_restrictedScrollY: function() {
		return this._scrollY;
	}
	,set_restrictedScrollY: function(value) {
		if(value < this._minScrollY) {
			value = this._minScrollY;
		} else if(value > this._maxScrollY) {
			value = this._maxScrollY;
		}
		if(this._scrollY == value) {
			return this._scrollY;
		}
		this._scrollY = value;
		feathers_events_ScrollEvent.dispatch(this,"scroll",false,false,this._scrollX,this._scrollY);
		return this._scrollY;
	}
	,_minScrollX: null
	,get_minScrollX: function() {
		return this._minScrollX;
	}
	,_minScrollY: null
	,get_minScrollY: function() {
		return this._minScrollY;
	}
	,_maxScrollX: null
	,get_maxScrollX: function() {
		return this._maxScrollX;
	}
	,_maxScrollY: null
	,get_maxScrollY: function() {
		return this._maxScrollY;
	}
	,_visibleWidth: null
	,get_visibleWidth: function() {
		return this._visibleWidth;
	}
	,_visibleHeight: null
	,get_visibleHeight: function() {
		return this._visibleHeight;
	}
	,_contentWidth: null
	,get_contentWidth: function() {
		return this._contentWidth;
	}
	,_contentHeight: null
	,get_contentHeight: function() {
		return this._contentHeight;
	}
	,_scrolling: null
	,get_scrolling: function() {
		return this._scrolling;
	}
	,_draggingX: null
	,get_draggingX: function() {
		return this._draggingX;
	}
	,_draggingY: null
	,get_draggingY: function() {
		return this._draggingY;
	}
	,minDragDistance: null
	,elasticEdges: null
	,forceElasticTop: null
	,forceElasticRight: null
	,forceElasticBottom: null
	,forceElasticLeft: null
	,elasticity: null
	,throwElasticity: null
	,elasticSnapDuration: null
	,ease: null
	,bounceEase: null
	,mouseWheelDeltaX: null
	,mouseWheelDeltaY: null
	,mouseWheelYScrollsX: null
	,_mouseWheelDeltaMode: null
	,mouseWheelDuration: null
	,simulateTouch: null
	,_decelerationRate: null
	,get_decelerationRate: function() {
		return this._decelerationRate;
	}
	,set_decelerationRate: function(value) {
		if(this._decelerationRate == value) {
			return this._decelerationRate;
		}
		this._decelerationRate = value;
		this._logDecelerationRate = Math.log(this._decelerationRate);
		this._fixedThrowDuration = -0.1 / Math.log(Math.pow(this._decelerationRate,16.666666666666668));
		return this._decelerationRate;
	}
	,snapPositionsX: null
	,snapPositionsY: null
	,_logDecelerationRate: null
	,_fixedThrowDuration: null
	,restoreMouseChildren: null
	,startTouchX: null
	,startTouchY: null
	,startScrollX: null
	,startScrollY: null
	,savedScrollMoves: null
	,animateScrollX: null
	,animateScrollY: null
	,animateScrollXEndRatio: null
	,animateScrollYEndRatio: null
	,targetScrollX: null
	,targetScrollY: null
	,snappingToEdge: null
	,_target: null
	,get_target: function() {
		return this._target;
	}
	,set_target: function(value) {
		if(this._target == value) {
			return this._target;
		}
		if(this._target != null) {
			this.cleanupAfterDrag();
			this._target.removeEventListener("removedFromStage",$bind(this,this.scroller_target_removedFromStageHandler));
			this._target.removeEventListener("mouseDown",$bind(this,this.scroller_target_mouseDownHandler));
			this._target.removeEventListener("mouseDown",$bind(this,this.scroller_target_mouseDownCaptureHandler),true);
			this._target.removeEventListener("mouseWheel",$bind(this,this.scroller_target_mouseWheelHandler));
			var window1 = js_Boot.__cast($global , Window);
			window1.removeEventListener("wheel",$bind(this,this.scroller_window_wheelCaptureHandler),{ capture : true});
			this._target.removeEventListener("touchBegin",$bind(this,this.scroller_target_touchBeginHandler));
			this._target.removeEventListener("touchBegin",$bind(this,this.scroller_target_touchBeginCaptureHandler),true);
			this._target.removeEventListener("click",$bind(this,this.scroller_target_clickCaptureHandler),true);
			this._target.removeEventListener("touchTap",$bind(this,this.scroller_target_touchTapCaptureHandler),true);
		}
		this._target = value;
		if(this._target != null) {
			this._target.addEventListener("mouseDown",$bind(this,this.scroller_target_mouseDownHandler),false,0,true);
			this._target.addEventListener("mouseDown",$bind(this,this.scroller_target_mouseDownCaptureHandler),true,0,true);
			this._target.addEventListener("mouseWheel",$bind(this,this.scroller_target_mouseWheelHandler),false,0,true);
			var window1 = js_Boot.__cast($global , Window);
			window1.addEventListener("wheel",$bind(this,this.scroller_window_wheelCaptureHandler),{ capture : true});
			this._target.addEventListener("touchBegin",$bind(this,this.scroller_target_touchBeginHandler),false,0,true);
			this._target.addEventListener("touchBegin",$bind(this,this.scroller_target_touchBeginCaptureHandler),true,0,true);
			this._target.addEventListener("click",$bind(this,this.scroller_target_clickCaptureHandler),true,0,true);
			this._target.addEventListener("touchTap",$bind(this,this.scroller_target_touchTapCaptureHandler),true,0,true);
		}
		return this._target;
	}
	,_previousTouchPointID: null
	,_touchPointID: null
	,get_touchPointID: function() {
		return this._touchPointID;
	}
	,_touchPointIsSimulated: null
	,get_touchPointIsSimulated: function() {
		return this._touchPointIsSimulated;
	}
	,setDimensions: function(visibleWidth,visibleHeight,contentWidth,contentHeight) {
		this._visibleWidth = visibleWidth != null ? visibleWidth : 0.0;
		this._visibleHeight = visibleHeight != null ? visibleHeight : 0.0;
		this._contentWidth = contentWidth != null ? contentWidth : 0.0;
		this._contentHeight = contentHeight != null ? contentHeight : 0.0;
		this.calculateMinAndMax();
	}
	,applyScrollRestrictions: function() {
		var scrollChanged = false;
		if(this._scrollX < this._minScrollX) {
			this._scrollX = this._minScrollX;
			scrollChanged = true;
		} else if(this._scrollX > this._maxScrollX) {
			this._scrollX = this._maxScrollX;
			scrollChanged = true;
		}
		if(this._scrollY < this._minScrollY) {
			this._scrollY = this._minScrollY;
			scrollChanged = true;
		} else if(this._scrollY > this._maxScrollY) {
			this._scrollY = this._maxScrollY;
			scrollChanged = true;
		}
		if(scrollChanged) {
			feathers_events_ScrollEvent.dispatch(this,"scroll",false,false,this._scrollX,this._scrollY);
		}
	}
	,stop: function() {
		if(this.animateScrollX != null) {
			motion_Actuate.stop(this.animateScrollX,null,false,false);
			this.animateScrollX = null;
		}
		if(this.animateScrollY != null) {
			motion_Actuate.stop(this.animateScrollY,null,false,false);
			this.animateScrollY = null;
		}
		this.cleanupAfterDrag();
		this._draggingX = false;
		this._draggingY = false;
		this.completeScroll();
	}
	,applyLayoutShift: function(x,y) {
		if(x != null) {
			var animateScrollX = this.animateScrollX;
			this.animateScrollX = null;
			if(animateScrollX != null) {
				motion_Actuate.stop(animateScrollX,null,false,false);
			}
			this.startScrollX += x;
			this.set_scrollX(this.get_scrollX() + x);
			var i = 0;
			while(i < this.savedScrollMoves.length) {
				this.savedScrollMoves[i] += x;
				i += 3;
			}
			if(animateScrollX != null) {
				var newTargetScrollX = this.targetScrollX + x;
				var position = openfl_Lib.getTimer() / 1000.0 - animateScrollX.startTime;
				var newDuration = animateScrollX.duration - position;
				this.throwTo(newTargetScrollX,null,newDuration,animateScrollX._ease);
			}
		}
		if(y != null) {
			var animateScrollY = this.animateScrollY;
			this.animateScrollY = null;
			if(animateScrollY != null) {
				motion_Actuate.stop(animateScrollY,null,false,false);
			}
			this.startScrollY += y;
			this.set_scrollY(this.get_scrollY() + y);
			var i = 1;
			while(i < this.savedScrollMoves.length) {
				this.savedScrollMoves[i] += y;
				i += 3;
			}
			if(animateScrollY != null) {
				var newTargetScrollY = this.targetScrollY + y;
				var position = openfl_Lib.getTimer() / 1000.0 - animateScrollY.startTime;
				var newDuration = animateScrollY.duration - position;
				this.throwTo(null,newTargetScrollY,newDuration,animateScrollY._ease);
			}
		}
	}
	,throwTo: function(scrollX,scrollY,duration,ease) {
		var _gthis = this;
		if(duration == null) {
			duration = this._fixedThrowDuration;
		}
		if(ease == null) {
			ease = this.ease;
		}
		var scrollChanged = false;
		if(scrollX != null) {
			if(this.animateScrollX != null) {
				motion_Actuate.stop(this.animateScrollX,null,false,false);
				this.animateScrollX = null;
			}
			if(this._scrollX != scrollX) {
				scrollChanged = true;
				this.startScroll();
				if(duration == 0.0) {
					this.set_scrollX(scrollX);
				} else {
					this.startScrollX = this._scrollX;
					this.targetScrollX = scrollX;
					var tween = motion_Actuate.update(function(scrollX) {
						if(scrollX == null) {
							scrollX = _gthis.targetScrollX;
						}
						return _gthis.set_scrollX(scrollX);
					},duration,[this._scrollX],[this.targetScrollX],true);
					this.animateScrollX = tween;
					this.animateScrollX.ease(ease);
					this.animateScrollX.onComplete($bind(this,this.animateScrollX_onComplete));
					this.refreshAnimateScrollXEndRatio();
				}
			} else {
				this.finishScrollX();
			}
		}
		if(scrollY != null) {
			if(this.animateScrollY != null) {
				motion_Actuate.stop(this.animateScrollY,null,false,false);
				this.animateScrollY = null;
			}
			if(this._scrollY != scrollY) {
				scrollChanged = true;
				this.startScroll();
				if(duration == 0.0) {
					this.set_scrollY(scrollY);
				} else {
					this.startScrollY = this._scrollY;
					this.targetScrollY = scrollY;
					var tween = motion_Actuate.update(function(scrollY) {
						if(scrollY == null) {
							scrollY = _gthis.targetScrollY;
						}
						return _gthis.set_scrollY(scrollY);
					},duration,[this._scrollY],[this.targetScrollY],true);
					this.animateScrollY = tween;
					this.animateScrollY.ease(ease);
					this.animateScrollY.onComplete($bind(this,this.animateScrollY_onComplete));
					this.refreshAnimateScrollYEndRatio();
				}
			} else {
				this.finishScrollY();
			}
		}
		if(scrollChanged && duration == 0.0) {
			this.completeScroll();
		}
	}
	,throwWithVelocity: function(velocityX,velocityY) {
		var targetX = null;
		var targetY = null;
		if(velocityX != null) {
			if(Math.abs(velocityX) <= feathers_utils_Scroller.MINIMUM_VELOCITY) {
				this.finishScrollX();
			} else if(this.snapPositionsX != null) {
				var _g = 0;
				var _g1 = this.snapPositionsX.length;
				while(_g < _g1) {
					var i = _g++;
					var posX = this.snapPositionsX[i];
					if(velocityX < 0.0) {
						targetX = posX;
						if(posX > this._scrollX) {
							break;
						}
					}
					if(velocityX > 0.0) {
						targetX = i == 0 ? posX : this.snapPositionsX[i - 1];
						if(posX >= this._scrollX) {
							break;
						}
					}
				}
			} else {
				targetX = this._scrollX + this.calculateDistanceFromVelocity(velocityX);
			}
		}
		if(velocityY != null) {
			if(Math.abs(velocityY) <= feathers_utils_Scroller.MINIMUM_VELOCITY) {
				this.finishScrollY();
			} else if(this.snapPositionsY != null) {
				var _g = 0;
				var _g1 = this.snapPositionsY.length;
				while(_g < _g1) {
					var i = _g++;
					var posY = this.snapPositionsY[i];
					if(velocityY < 0.0) {
						targetY = posY;
						if(posY > this._scrollY) {
							break;
						}
					}
					if(velocityY > 0.0) {
						targetY = i == 0 ? posY : this.snapPositionsY[i - 1];
						if(posY >= this._scrollY) {
							break;
						}
					}
				}
			} else {
				targetY = this._scrollY + this.calculateDistanceFromVelocity(velocityY);
			}
		}
		this.throwTo(targetX,targetY,this._fixedThrowDuration);
	}
	,calculateDistanceFromVelocity: function(velocity) {
		return (velocity - feathers_utils_Scroller.MINIMUM_VELOCITY) / this._logDecelerationRate;
	}
	,refreshAnimateScrollXEndRatio: function() {
		var distance = Math.abs(this.targetScrollX - this.startScrollX);
		var ratioOutOfBounds = 0.0;
		if(this.targetScrollX > this._maxScrollX) {
			ratioOutOfBounds = (this.targetScrollX - this._maxScrollX) / distance;
		} else if(this.targetScrollX < this._minScrollX) {
			ratioOutOfBounds = (this._minScrollX - this.targetScrollX) / distance;
		}
		if(ratioOutOfBounds > 0.0) {
			if(this.elasticEdges) {
				this.animateScrollXEndRatio = 1.0 - ratioOutOfBounds + ratioOutOfBounds * this.throwElasticity;
			} else {
				this.animateScrollXEndRatio = 1.0 - ratioOutOfBounds;
			}
		} else {
			this.animateScrollXEndRatio = 1.0;
		}
		if(this.animateScrollX != null) {
			if(this.animateScrollXEndRatio < 1.0) {
				this.animateScrollX.onUpdate($bind(this,this.animateScrollX_endRatio_onUpdate));
			} else {
				this.animateScrollX.onUpdate(null);
			}
		}
	}
	,refreshAnimateScrollYEndRatio: function() {
		var distance = Math.abs(this.targetScrollY - this.startScrollY);
		var ratioOutOfBounds = 0.0;
		if(this.targetScrollY > this._maxScrollY) {
			ratioOutOfBounds = (this.targetScrollY - this._maxScrollY) / distance;
		} else if(this.targetScrollY < this._minScrollY) {
			ratioOutOfBounds = (this._minScrollY - this.targetScrollY) / distance;
		}
		if(ratioOutOfBounds > 0.0) {
			if(this.elasticEdges) {
				this.animateScrollYEndRatio = 1.0 - ratioOutOfBounds + ratioOutOfBounds * this.throwElasticity;
			} else {
				this.animateScrollYEndRatio = 1.0 - ratioOutOfBounds;
			}
		} else {
			this.animateScrollYEndRatio = 1.0;
		}
		if(this.animateScrollY != null) {
			if(this.animateScrollYEndRatio < 1.0) {
				this.animateScrollY.onUpdate($bind(this,this.animateScrollY_endRatio_onUpdate));
			} else {
				this.animateScrollY.onUpdate(null);
			}
		}
	}
	,calculateMinAndMax: function() {
		var oldMinScrollX = this._minScrollX;
		var oldMaxScrollX = this._maxScrollX;
		var oldMinScrollY = this._minScrollY;
		var oldMaxScrollY = this._maxScrollY;
		this._minScrollX = 0.0;
		this._minScrollY = 0.0;
		this._maxScrollX = Math.max(this._contentWidth,this._visibleWidth) - this._visibleWidth;
		this._maxScrollY = Math.max(this._contentHeight,this._visibleHeight) - this._visibleHeight;
		if(oldMinScrollX != this._minScrollX || oldMaxScrollX != this._maxScrollX) {
			this.refreshAnimateScrollXEndRatio();
		}
		if(oldMinScrollY != this._minScrollY || oldMaxScrollY != this._maxScrollY) {
			this.refreshAnimateScrollYEndRatio();
		}
	}
	,startScroll: function() {
		if(this._scrolling) {
			return;
		}
		this._scrolling = true;
		if(((this._target) instanceof openfl_display_DisplayObjectContainer)) {
			var container = this._target;
			this.restoreMouseChildren = container.mouseChildren;
			container.mouseChildren = false;
		}
		feathers_events_ScrollEvent.dispatch(this,"scrollStart",false,false,this._scrollX,this._scrollY);
	}
	,completeScroll: function() {
		if(!this._scrolling || this._draggingX || this._draggingY || this.animateScrollX != null || this.animateScrollY != null) {
			return;
		}
		this._scrolling = false;
		if(((this._target) instanceof openfl_display_DisplayObjectContainer)) {
			var container = this._target;
			container.mouseChildren = this.restoreMouseChildren;
		}
		feathers_events_ScrollEvent.dispatch(this,"scrollComplete",false,false,this._scrollX,this._scrollY);
	}
	,finishScrollX: function() {
		this._draggingX = false;
		var targetScrollX = null;
		if(this.snapPositionsX != null) {
			var minOffsetX = Infinity;
			var _g = 0;
			var _g1 = this.snapPositionsX;
			while(_g < _g1.length) {
				var snapX = _g1[_g];
				++_g;
				var offsetX = Math.abs(snapX - this._scrollX);
				if(minOffsetX > offsetX) {
					minOffsetX = offsetX;
					targetScrollX = snapX;
				}
			}
			if(targetScrollX == this._scrollX) {
				targetScrollX = null;
			}
		}
		if(this._scrollX < this._minScrollX) {
			targetScrollX = this._minScrollX;
		} else if(this._scrollX > this._maxScrollX) {
			targetScrollX = this._maxScrollX;
		}
		if(targetScrollX == null) {
			this.completeScroll();
		} else {
			var duration = Math.abs(this._scrollX - targetScrollX) >= 1.0 ? this.elasticSnapDuration : 0.0;
			this.throwTo(targetScrollX,null,duration,this.bounceEase);
		}
	}
	,finishScrollY: function() {
		this._draggingY = false;
		var targetScrollY = null;
		if(this.snapPositionsY != null) {
			var minOffsetY = Infinity;
			var _g = 0;
			var _g1 = this.snapPositionsY;
			while(_g < _g1.length) {
				var snapY = _g1[_g];
				++_g;
				var offsetY = Math.abs(snapY - this._scrollY);
				if(minOffsetY > offsetY) {
					minOffsetY = offsetY;
					targetScrollY = snapY;
				}
			}
			if(targetScrollY == this._scrollY) {
				targetScrollY = null;
			}
		}
		if(this._scrollY < this._minScrollY) {
			targetScrollY = this._minScrollY;
		} else if(this._scrollY > this._maxScrollY) {
			targetScrollY = this._maxScrollY;
		}
		if(targetScrollY == null) {
			this.completeScroll();
		} else {
			var duration = Math.abs(this._scrollY - targetScrollY) >= 1.0 ? this.elasticSnapDuration : 0.0;
			this.throwTo(null,targetScrollY,duration,this.bounceEase);
		}
	}
	,animateScrollX_endRatio_onUpdate: function() {
		var time = openfl_Lib.getTimer() / 1000.0;
		var currentTime = time - this.animateScrollX.startTime;
		var ratio = currentTime / this.animateScrollX.duration;
		var ease = this.animateScrollX._ease;
		if(ease != null) {
			ratio = ease.calculate(ratio);
		}
		if(ratio >= this.animateScrollXEndRatio && currentTime < this.animateScrollX.duration) {
			if(!this.elasticEdges) {
				if(this._scrollX < this._minScrollX) {
					this.set_scrollX(this._minScrollX);
				} else if(this._scrollX > this._maxScrollX) {
					this.set_scrollX(this._maxScrollX);
				}
			}
			motion_Actuate.stop(this.animateScrollX,null,false,false);
			this.animateScrollX = null;
			this.finishScrollX();
			return;
		}
	}
	,animateScrollX_onComplete: function() {
		this.animateScrollX = null;
		this.finishScrollX();
	}
	,animateScrollY_endRatio_onUpdate: function() {
		var time = openfl_Lib.getTimer() / 1000.0;
		var currentTime = time - this.animateScrollY.startTime;
		var ratio = currentTime / this.animateScrollY.duration;
		var ease = this.animateScrollY._ease;
		if(ease != null) {
			ratio = ease.calculate(ratio);
		}
		if(ratio >= this.animateScrollYEndRatio && currentTime < this.animateScrollY.duration) {
			if(!this.elasticEdges) {
				if(this._scrollY < this._minScrollY) {
					this.set_scrollY(this._minScrollY);
				} else if(this._scrollY > this._maxScrollY) {
					this.set_scrollY(this._maxScrollY);
				}
			}
			motion_Actuate.stop(this.animateScrollY,null,false,false);
			this.animateScrollY = null;
			this.finishScrollY();
			return;
		}
	}
	,animateScrollY_onComplete: function() {
		this.animateScrollY = null;
		this.finishScrollY();
	}
	,cleanupAfterDrag: function() {
		if(this._touchPointID == null) {
			return;
		}
		this._previousTouchPointID = this._scrolling ? this._touchPointID : null;
		this._touchPointID = null;
		this._touchPointIsSimulated = false;
		this._target.removeEventListener("removedFromStage",$bind(this,this.scroller_target_removedFromStageHandler));
		if(this._target.stage != null) {
			this._target.stage.removeEventListener("mouseMove",$bind(this,this.scroller_target_stage_mouseMoveHandler));
			this._target.stage.removeEventListener("mouseUp",$bind(this,this.scroller_target_stage_mouseUpHandler));
			this._target.stage.removeEventListener("touchMove",$bind(this,this.scroller_target_stage_touchMoveHandler));
			this._target.stage.removeEventListener("touchEnd",$bind(this,this.scroller_target_stage_touchEndHandler));
		}
	}
	,scroller_target_removedFromStageHandler: function(event) {
		this.cleanupAfterDrag();
	}
	,touchBegin: function(touchPointID,simulatedTouch,stageX,stageY) {
		if(simulatedTouch && !this.simulateTouch) {
			return;
		}
		if(this._touchPointID != null) {
			return;
		}
		if(this.animateScrollX != null) {
			motion_Actuate.stop(this.animateScrollX,null,false,false);
			this.animateScrollX = null;
		}
		if(this.animateScrollY != null) {
			motion_Actuate.stop(this.animateScrollY,null,false,false);
			this.animateScrollY = null;
		}
		this._target.addEventListener("removedFromStage",$bind(this,this.scroller_target_removedFromStageHandler),false,0,true);
		this._target.stage.addEventListener("mouseMove",$bind(this,this.scroller_target_stage_mouseMoveHandler),false,0,true);
		this._target.stage.addEventListener("mouseUp",$bind(this,this.scroller_target_stage_mouseUpHandler),false,0,true);
		this._target.stage.addEventListener("touchMove",$bind(this,this.scroller_target_stage_touchMoveHandler),false,0,true);
		this._target.stage.addEventListener("touchEnd",$bind(this,this.scroller_target_stage_touchEndHandler),false,0,true);
		if(((this._target) instanceof openfl_display_DisplayObjectContainer)) {
			var container = this._target;
			if(this._scrolling) {
				container.mouseChildren = false;
			}
		}
		this._previousTouchPointID = null;
		this._touchPointID = touchPointID;
		this._touchPointIsSimulated = simulatedTouch;
		this.startTouchX = stageX;
		this.startTouchY = stageY;
		this.startScrollX = this._scrollX;
		this.startScrollY = this._scrollY;
		this.savedScrollMoves.length = 0;
	}
	,touchMove: function(touchPointID,simulatedTouch,stageX,stageY) {
		if(this._touchPointID == null) {
			return;
		}
		if(this._touchPointID != touchPointID) {
			return;
		}
		if(this._touchPointIsSimulated != simulatedTouch) {
			return;
		}
		var touchOffsetX = stageX - this.startTouchX;
		var touchOffsetY = stageY - this.startTouchY;
		var scaleX = 1.0;
		var scaleY = 1.0;
		var current = this._target;
		while(current != current.stage) {
			scaleX /= current.get_scaleX();
			scaleY /= current.get_scaleY();
			current = current.parent;
		}
		touchOffsetX *= scaleX;
		touchOffsetY *= scaleY;
		var canDragX = this.canDragX();
		var canDragY = this.canDragY();
		if(!this._draggingX && canDragX && Math.abs(touchOffsetX) > this.minDragDistance) {
			this.startTouchX = stageX;
			touchOffsetX = 0.0;
			this._draggingX = true;
			if(!this._draggingY) {
				this.startScroll();
				if(this._touchPointID == null) {
					return;
				}
			}
		}
		if(!this._draggingY && canDragY && Math.abs(touchOffsetY) > this.minDragDistance) {
			this.startTouchY = stageY;
			touchOffsetY = 0.0;
			this._draggingY = true;
			if(!this._draggingX) {
				this.startScroll();
				if(this._touchPointID == null) {
					return;
				}
			}
		}
		if(!this._draggingX && !this._draggingY) {
			return;
		}
		var scrollX = this.startScrollX;
		if(canDragX) {
			scrollX -= touchOffsetX;
			if(this.elasticEdges) {
				var minElasticScrollX = this._minScrollX;
				if(minElasticScrollX > this.startScrollX) {
					minElasticScrollX = this.startScrollX;
				}
				var maxElasticScrollX = this._maxScrollX;
				if(maxElasticScrollX < this.startScrollX) {
					maxElasticScrollX = this.startScrollX;
				}
				if(scrollX < this._minScrollX) {
					if(this._maxScrollX > this._minScrollX || this.forceElasticLeft) {
						scrollX -= (scrollX - minElasticScrollX) * (1.0 - this.elasticity);
					} else {
						scrollX = this._minScrollX;
					}
				} else if(scrollX > this._maxScrollX) {
					if(this._maxScrollX > this._minScrollX || this.forceElasticRight) {
						scrollX -= (scrollX - maxElasticScrollX) * (1.0 - this.elasticity);
					} else {
						scrollX = this._maxScrollX;
					}
				}
			} else if(scrollX < this._minScrollX) {
				scrollX = this._minScrollX;
			} else if(scrollX > this._maxScrollX) {
				scrollX = this._maxScrollX;
			}
		}
		var scrollY = this.startScrollY;
		if(canDragY) {
			scrollY -= touchOffsetY;
			if(this.elasticEdges) {
				var minElasticScrollY = this._minScrollY;
				if(minElasticScrollY > this.startScrollY) {
					minElasticScrollY = this.startScrollY;
				}
				var maxElasticScrollY = this._maxScrollY;
				if(maxElasticScrollY < this.startScrollY) {
					maxElasticScrollY = this.startScrollY;
				}
				if(scrollY < this._minScrollY) {
					if(this._maxScrollY > this._minScrollY || this.forceElasticTop) {
						scrollY -= (scrollY - minElasticScrollY) * (1.0 - this.elasticity);
					} else {
						scrollY = this._minScrollY;
					}
				} else if(scrollY > this._maxScrollY) {
					if(this._maxScrollY > this._minScrollY || this.forceElasticBottom) {
						scrollY -= (scrollY - maxElasticScrollY) * (1.0 - this.elasticity);
					} else {
						scrollY = this._maxScrollY;
					}
				}
			} else if(scrollY < this._minScrollY) {
				scrollY = this._minScrollY;
			} else if(scrollY > this._maxScrollY) {
				scrollY = this._maxScrollY;
			}
		}
		this.set_scrollX(scrollX);
		this.set_scrollY(scrollY);
		if(this.savedScrollMoves.length > 60) {
			this.savedScrollMoves.length = 30;
		}
		this.savedScrollMoves.push(scrollX);
		this.savedScrollMoves.push(scrollY);
		this.savedScrollMoves.push(openfl_Lib.getTimer());
	}
	,touchEnd: function(touchPointID,simulatedTouch) {
		if(this._touchPointID == null) {
			return;
		}
		if(this._touchPointID != touchPointID) {
			return;
		}
		if(this._touchPointIsSimulated != simulatedTouch) {
			return;
		}
		this.cleanupAfterDrag();
		var finishingX = !this.canDragX();
		var finishingY = !this.canDragY();
		if(this._scrollX < this._minScrollX || this._scrollX > this._maxScrollX) {
			finishingX = true;
			this.finishScrollX();
		}
		if(this._scrollY < this._minScrollY || this._scrollY > this._maxScrollY) {
			finishingY = true;
			this.finishScrollY();
		}
		if(finishingX && finishingY) {
			return;
		}
		if(!this._draggingX && !this._draggingY) {
			return;
		}
		var targetTime = openfl_Lib.getTimer() - 100;
		var endIndex = this.savedScrollMoves.length - 1;
		var startIndex = endIndex;
		var i = endIndex;
		while(endIndex > 0 && this.savedScrollMoves[i] > targetTime) {
			startIndex = i;
			i -= 3;
		}
		if(startIndex == endIndex) {
			if(!finishingX && this._draggingX) {
				this.finishScrollX();
			}
			if(!finishingY && this._draggingY) {
				this.finishScrollY();
			}
			return;
		}
		var timeOffset = this.savedScrollMoves[endIndex] - this.savedScrollMoves[startIndex];
		var velocityX = null;
		var velocityY = null;
		if(timeOffset > 0.0) {
			if(!finishingX && this._draggingX) {
				var movedX = this._scrollX - this.savedScrollMoves[startIndex - 2];
				velocityX = -movedX / timeOffset;
			}
			if(!finishingY && this._draggingY) {
				var movedY = this._scrollY - this.savedScrollMoves[startIndex - 1];
				velocityY = -movedY / timeOffset;
			}
		}
		if(velocityX != null || velocityY != null) {
			this.throwWithVelocity(velocityX,velocityY);
		}
		if(velocityX == null && this._draggingX) {
			this.finishScrollX();
		}
		if(velocityY == null && this._draggingY) {
			this.finishScrollY();
		}
	}
	,canDragX: function() {
		if(this.enabledX) {
			if(!(this._maxScrollX > this._minScrollX || this.forceElasticLeft)) {
				return this.forceElasticRight;
			} else {
				return true;
			}
		} else {
			return false;
		}
	}
	,canDragY: function() {
		if(this.enabledY) {
			if(!(this._maxScrollY > this._minScrollY || this.forceElasticTop)) {
				return this.forceElasticBottom;
			} else {
				return true;
			}
		} else {
			return false;
		}
	}
	,scroller_target_touchBeginCaptureHandler: function(event) {
		if(!this._scrolling) {
			return;
		}
		event.stopImmediatePropagation();
		this.scroller_target_touchBeginHandler(event);
	}
	,scroller_target_touchBeginHandler: function(event) {
		if(this.simulateTouch && event.isPrimaryTouchPoint) {
			return;
		}
		this.touchBegin(event.touchPointID,false,event.stageX,event.stageY);
	}
	,scroller_target_mouseDownCaptureHandler: function(event) {
		if(!this._scrolling) {
			return;
		}
		event.stopImmediatePropagation();
		this.scroller_target_mouseDownHandler(event);
	}
	,scroller_target_mouseDownHandler: function(event) {
		var stage = this._target.stage;
		if(stage == null) {
			return;
		}
		this.touchBegin(feathers_utils_Scroller.POINTER_ID_MOUSE,true,stage.get_mouseX(),stage.get_mouseY());
	}
	,scroller_target_stage_touchMoveHandler: function(event) {
		this.touchMove(event.touchPointID,false,event.stageX,event.stageY);
	}
	,scroller_target_stage_mouseMoveHandler: function(event) {
		var stage = js_Boot.__cast(event.currentTarget , openfl_display_Stage);
		this.touchMove(feathers_utils_Scroller.POINTER_ID_MOUSE,true,stage.get_mouseX(),stage.get_mouseY());
	}
	,scroller_target_stage_touchEndHandler: function(event) {
		this.touchEnd(event.touchPointID,false);
	}
	,scroller_target_clickCaptureHandler: function(event) {
		if(this._previousTouchPointID == null) {
			return;
		}
		this._previousTouchPointID = null;
		event.stopImmediatePropagation();
	}
	,scroller_target_touchTapCaptureHandler: function(event) {
		if(this._previousTouchPointID == null || this._previousTouchPointID != event.touchPointID) {
			return;
		}
		if(event.isPrimaryTouchPoint) {
			this._previousTouchPointID = feathers_utils_Scroller.POINTER_ID_MOUSE;
			return;
		}
		this._previousTouchPointID = null;
		event.stopImmediatePropagation();
	}
	,scroller_target_stage_mouseUpHandler: function(event) {
		this.touchEnd(feathers_utils_Scroller.POINTER_ID_MOUSE,true);
	}
	,scroller_window_wheelCaptureHandler: function(event) {
		this._mouseWheelDeltaMode = event.deltaMode;
	}
	,scroller_target_mouseWheelHandler: function(event) {
		if(this._scrolling) {
			event.stopImmediatePropagation();
			this.stop();
		}
		var deltaLines = event.delta;
		switch(this._mouseWheelDeltaMode) {
		case 0:
			if(deltaLines < 0) {
				deltaLines = Math.min(-1.0,deltaLines / 40) | 0;
			} else {
				deltaLines = Math.max(1.0,deltaLines / 40) | 0;
			}
			break;
		case 2:
			deltaLines *= 16;
			break;
		}
		var newScrollX = null;
		var newScrollY = null;
		if(this.mouseWheelYScrollsX) {
			var targetScrollX = this._scrollX;
			if(this.animateScrollX != null) {
				targetScrollX = this.targetScrollX;
			}
			newScrollX = targetScrollX - deltaLines * this.mouseWheelDeltaX;
			if(newScrollX < this._minScrollX) {
				newScrollX = this._minScrollX;
			} else if(newScrollX > this._maxScrollX) {
				newScrollX = this._maxScrollX;
			}
		} else {
			var targetScrollY = this._scrollY;
			if(this.animateScrollY != null) {
				targetScrollY = this.targetScrollY;
			}
			newScrollY = targetScrollY - deltaLines * this.mouseWheelDeltaY;
			if(newScrollY < this._minScrollY) {
				newScrollY = this._minScrollY;
			} else if(newScrollY > this._maxScrollY) {
				newScrollY = this._maxScrollY;
			}
		}
		if((newScrollX == null || newScrollX == this._scrollX) && (newScrollY == null || newScrollY == this._scrollY)) {
			return;
		}
		event.preventDefault();
		if(!this._scrolling) {
			event.stopImmediatePropagation();
			this.stop();
		}
		if(newScrollX != null) {
			this._draggingX = true;
		}
		if(newScrollY != null) {
			this._draggingY = true;
		}
		if(this.mouseWheelDuration > 0.0) {
			this.throwTo(newScrollX,newScrollY,this.mouseWheelDuration,this.ease);
		} else {
			this.startScroll();
			if(newScrollX != null) {
				this.set_scrollX(newScrollX);
			}
			if(newScrollY != null) {
				this.set_scrollY(newScrollY);
			}
			this._draggingX = false;
			this._draggingY = false;
			this.completeScroll();
		}
	}
	,__class__: feathers_utils_Scroller
	,__properties__: {get_touchPointIsSimulated:"get_touchPointIsSimulated",get_touchPointID:"get_touchPointID",set_target:"set_target",get_target:"get_target",set_decelerationRate:"set_decelerationRate",get_decelerationRate:"get_decelerationRate",get_draggingY:"get_draggingY",get_draggingX:"get_draggingX",get_scrolling:"get_scrolling",get_contentHeight:"get_contentHeight",get_contentWidth:"get_contentWidth",get_visibleHeight:"get_visibleHeight",get_visibleWidth:"get_visibleWidth",get_maxScrollY:"get_maxScrollY",get_maxScrollX:"get_maxScrollX",get_minScrollY:"get_minScrollY",get_minScrollX:"get_minScrollX",set_restrictedScrollY:"set_restrictedScrollY",get_restrictedScrollY:"get_restrictedScrollY",set_restrictedScrollX:"set_restrictedScrollX",get_restrictedScrollX:"get_restrictedScrollX",set_scrollY:"set_scrollY",get_scrollY:"get_scrollY",set_scrollX:"set_scrollX",get_scrollX:"get_scrollX"}
});
var feathers_utils_TextFormatUtil = function() { };
$hxClasses["feathers.utils.TextFormatUtil"] = feathers_utils_TextFormatUtil;
feathers_utils_TextFormatUtil.__name__ = "feathers.utils.TextFormatUtil";
feathers_utils_TextFormatUtil.clone = function(original) {
	var clone = new openfl_text_TextFormat(original.font,original.size,original.color,original.bold,original.italic,original.underline,original.url,original.target,original.align,original.leftMargin,original.rightMargin,original.indent,original.leading);
	clone.blockIndent = original.blockIndent;
	clone.bullet = original.bullet;
	clone.kerning = original.kerning;
	clone.letterSpacing = original.letterSpacing;
	clone.tabStops = original.tabStops;
	return clone;
};
var haxe_StackItem = $hxEnums["haxe.StackItem"] = { __ename__:"haxe.StackItem",__constructs__:null
	,CFunction: {_hx_name:"CFunction",_hx_index:0,__enum__:"haxe.StackItem",toString:$estr}
	,Module: ($_=function(m) { return {_hx_index:1,m:m,__enum__:"haxe.StackItem",toString:$estr}; },$_._hx_name="Module",$_.__params__ = ["m"],$_)
	,FilePos: ($_=function(s,file,line,column) { return {_hx_index:2,s:s,file:file,line:line,column:column,__enum__:"haxe.StackItem",toString:$estr}; },$_._hx_name="FilePos",$_.__params__ = ["s","file","line","column"],$_)
	,Method: ($_=function(classname,method) { return {_hx_index:3,classname:classname,method:method,__enum__:"haxe.StackItem",toString:$estr}; },$_._hx_name="Method",$_.__params__ = ["classname","method"],$_)
	,LocalFunction: ($_=function(v) { return {_hx_index:4,v:v,__enum__:"haxe.StackItem",toString:$estr}; },$_._hx_name="LocalFunction",$_.__params__ = ["v"],$_)
};
haxe_StackItem.__constructs__ = [haxe_StackItem.CFunction,haxe_StackItem.Module,haxe_StackItem.FilePos,haxe_StackItem.Method,haxe_StackItem.LocalFunction];
var haxe_CallStack = {};
haxe_CallStack.callStack = function() {
	return haxe_NativeStackTrace.toHaxe(haxe_NativeStackTrace.callStack());
};
haxe_CallStack.exceptionStack = function(fullStack) {
	if(fullStack == null) {
		fullStack = false;
	}
	var eStack = haxe_NativeStackTrace.toHaxe(haxe_NativeStackTrace.exceptionStack());
	return fullStack ? eStack : haxe_CallStack.subtract(eStack,haxe_CallStack.callStack());
};
haxe_CallStack.toString = function(stack) {
	var b = new StringBuf();
	var _g = 0;
	var _g1 = stack;
	while(_g < _g1.length) {
		var s = _g1[_g];
		++_g;
		b.b += "\nCalled from ";
		haxe_CallStack.itemToString(b,s);
	}
	return b.b;
};
haxe_CallStack.subtract = function(this1,stack) {
	var startIndex = -1;
	var i = -1;
	while(++i < this1.length) {
		var _g = 0;
		var _g1 = stack.length;
		while(_g < _g1) {
			var j = _g++;
			if(haxe_CallStack.equalItems(this1[i],stack[j])) {
				if(startIndex < 0) {
					startIndex = i;
				}
				++i;
				if(i >= this1.length) {
					break;
				}
			} else {
				startIndex = -1;
			}
		}
		if(startIndex >= 0) {
			break;
		}
	}
	if(startIndex >= 0) {
		return this1.slice(0,startIndex);
	} else {
		return this1;
	}
};
haxe_CallStack.equalItems = function(item1,item2) {
	if(item1 == null) {
		if(item2 == null) {
			return true;
		} else {
			return false;
		}
	} else {
		switch(item1._hx_index) {
		case 0:
			if(item2 == null) {
				return false;
			} else if(item2._hx_index == 0) {
				return true;
			} else {
				return false;
			}
			break;
		case 1:
			if(item2 == null) {
				return false;
			} else if(item2._hx_index == 1) {
				var m2 = item2.m;
				var m1 = item1.m;
				return m1 == m2;
			} else {
				return false;
			}
			break;
		case 2:
			if(item2 == null) {
				return false;
			} else if(item2._hx_index == 2) {
				var item21 = item2.s;
				var file2 = item2.file;
				var line2 = item2.line;
				var col2 = item2.column;
				var col1 = item1.column;
				var line1 = item1.line;
				var file1 = item1.file;
				var item11 = item1.s;
				if(file1 == file2 && line1 == line2 && col1 == col2) {
					return haxe_CallStack.equalItems(item11,item21);
				} else {
					return false;
				}
			} else {
				return false;
			}
			break;
		case 3:
			if(item2 == null) {
				return false;
			} else if(item2._hx_index == 3) {
				var class2 = item2.classname;
				var method2 = item2.method;
				var method1 = item1.method;
				var class1 = item1.classname;
				if(class1 == class2) {
					return method1 == method2;
				} else {
					return false;
				}
			} else {
				return false;
			}
			break;
		case 4:
			if(item2 == null) {
				return false;
			} else if(item2._hx_index == 4) {
				var v2 = item2.v;
				var v1 = item1.v;
				return v1 == v2;
			} else {
				return false;
			}
			break;
		}
	}
};
haxe_CallStack.itemToString = function(b,s) {
	switch(s._hx_index) {
	case 0:
		b.b += "a C function";
		break;
	case 1:
		var m = s.m;
		b.b += "module ";
		b.b += m == null ? "null" : "" + m;
		break;
	case 2:
		var s1 = s.s;
		var file = s.file;
		var line = s.line;
		var col = s.column;
		if(s1 != null) {
			haxe_CallStack.itemToString(b,s1);
			b.b += " (";
		}
		b.b += file == null ? "null" : "" + file;
		b.b += " line ";
		b.b += line == null ? "null" : "" + line;
		if(col != null) {
			b.b += " column ";
			b.b += col == null ? "null" : "" + col;
		}
		if(s1 != null) {
			b.b += ")";
		}
		break;
	case 3:
		var cname = s.classname;
		var meth = s.method;
		b.b += Std.string(cname == null ? "<unknown>" : cname);
		b.b += ".";
		b.b += meth == null ? "null" : "" + meth;
		break;
	case 4:
		var n = s.v;
		b.b += "local function #";
		b.b += n == null ? "null" : "" + n;
		break;
	}
};
var haxe_Exception = function(message,previous,native) {
	Error.call(this,message);
	this.message = message;
	this.__previousException = previous;
	this.__nativeException = native != null ? native : this;
	this.__skipStack = 0;
	var old = Error.prepareStackTrace;
	Error.prepareStackTrace = function(e) { return e.stack; }
	if(((native) instanceof Error)) {
		this.stack = native.stack;
	} else {
		var e = null;
		if(Error.captureStackTrace) {
			Error.captureStackTrace(this,haxe_Exception);
			e = this;
		} else {
			e = new Error();
			if(typeof(e.stack) == "undefined") {
				try { throw e; } catch(_) {}
				this.__skipStack++;
			}
		}
		this.stack = e.stack;
	}
	Error.prepareStackTrace = old;
};
$hxClasses["haxe.Exception"] = haxe_Exception;
haxe_Exception.__name__ = "haxe.Exception";
haxe_Exception.caught = function(value) {
	if(((value) instanceof haxe_Exception)) {
		return value;
	} else if(((value) instanceof Error)) {
		return new haxe_Exception(value.message,null,value);
	} else {
		return new haxe_ValueException(value,null,value);
	}
};
haxe_Exception.thrown = function(value) {
	if(((value) instanceof haxe_Exception)) {
		return value.get_native();
	} else if(((value) instanceof Error)) {
		return value;
	} else {
		var e = new haxe_ValueException(value);
		e.__skipStack++;
		return e;
	}
};
haxe_Exception.__super__ = Error;
haxe_Exception.prototype = $extend(Error.prototype,{
	__skipStack: null
	,__nativeException: null
	,__previousException: null
	,unwrap: function() {
		return this.__nativeException;
	}
	,toString: function() {
		return this.get_message();
	}
	,details: function() {
		if(this.get_previous() == null) {
			var tmp = "Exception: " + this.toString();
			var tmp1 = this.get_stack();
			return tmp + (tmp1 == null ? "null" : haxe_CallStack.toString(tmp1));
		} else {
			var result = "";
			var e = this;
			var prev = null;
			while(e != null) {
				if(prev == null) {
					var result1 = "Exception: " + e.get_message();
					var tmp = e.get_stack();
					result = result1 + (tmp == null ? "null" : haxe_CallStack.toString(tmp)) + result;
				} else {
					var prevStack = haxe_CallStack.subtract(e.get_stack(),prev.get_stack());
					result = "Exception: " + e.get_message() + (prevStack == null ? "null" : haxe_CallStack.toString(prevStack)) + "\n\nNext " + result;
				}
				prev = e;
				e = e.get_previous();
			}
			return result;
		}
	}
	,__shiftStack: function() {
		this.__skipStack++;
	}
	,get_message: function() {
		return this.message;
	}
	,get_previous: function() {
		return this.__previousException;
	}
	,get_native: function() {
		return this.__nativeException;
	}
	,get_stack: function() {
		var _g = this.__exceptionStack;
		if(_g == null) {
			var value = haxe_NativeStackTrace.toHaxe(haxe_NativeStackTrace.normalize(this.stack),this.__skipStack);
			this.setProperty("__exceptionStack",value);
			return value;
		} else {
			var s = _g;
			return s;
		}
	}
	,setProperty: function(name,value) {
		try {
			Object.defineProperty(this,name,{ value : value});
		} catch( _g ) {
			this[name] = value;
		}
	}
	,__class__: haxe_Exception
	,__properties__: {get_native:"get_native",get_previous:"get_previous",get_stack:"get_stack",get_message:"get_message"}
});
var haxe_Int32 = {};
var haxe__$Int64__$_$_$Int64 = function(high,low) {
	this.high = high;
	this.low = low;
};
$hxClasses["haxe._Int64.___Int64"] = haxe__$Int64__$_$_$Int64;
haxe__$Int64__$_$_$Int64.__name__ = "haxe._Int64.___Int64";
haxe__$Int64__$_$_$Int64.prototype = {
	high: null
	,low: null
	,__class__: haxe__$Int64__$_$_$Int64
};
var haxe_Log = function() { };
$hxClasses["haxe.Log"] = haxe_Log;
haxe_Log.__name__ = "haxe.Log";
haxe_Log.formatOutput = function(v,infos) {
	var str = Std.string(v);
	if(infos == null) {
		return str;
	}
	var pstr = infos.fileName + ":" + infos.lineNumber;
	if(infos.customParams != null) {
		var _g = 0;
		var _g1 = infos.customParams;
		while(_g < _g1.length) {
			var v = _g1[_g];
			++_g;
			str += ", " + Std.string(v);
		}
	}
	return pstr + ": " + str;
};
haxe_Log.trace = function(v,infos) {
	var str = haxe_Log.formatOutput(v,infos);
	if(typeof(console) != "undefined" && console.log != null) {
		console.log(str);
	}
};
var haxe_NativeStackTrace = function() { };
$hxClasses["haxe.NativeStackTrace"] = haxe_NativeStackTrace;
haxe_NativeStackTrace.__name__ = "haxe.NativeStackTrace";
haxe_NativeStackTrace.saveStack = function(e) {
	haxe_NativeStackTrace.lastError = e;
};
haxe_NativeStackTrace.callStack = function() {
	var e = new Error("");
	var stack = haxe_NativeStackTrace.tryHaxeStack(e);
	if(typeof(stack) == "undefined") {
		try {
			throw e;
		} catch( _g ) {
		}
		stack = e.stack;
	}
	return haxe_NativeStackTrace.normalize(stack,2);
};
haxe_NativeStackTrace.exceptionStack = function() {
	return haxe_NativeStackTrace.normalize(haxe_NativeStackTrace.tryHaxeStack(haxe_NativeStackTrace.lastError));
};
haxe_NativeStackTrace.toHaxe = function(s,skip) {
	if(skip == null) {
		skip = 0;
	}
	if(s == null) {
		return [];
	} else if(typeof(s) == "string") {
		var stack = s.split("\n");
		if(stack[0] == "Error") {
			stack.shift();
		}
		var m = [];
		var _g = 0;
		var _g1 = stack.length;
		while(_g < _g1) {
			var i = _g++;
			if(skip > i) {
				continue;
			}
			var line = stack[i];
			var matched = line.match(/^    at ([$A-Za-z0-9_. ]+) \(([^)]+):([0-9]+):([0-9]+)\)$/);
			if(matched != null) {
				var path = matched[1].split(".");
				if(path[0] == "$hxClasses") {
					path.shift();
				}
				var meth = path.pop();
				var file = matched[2];
				var line1 = Std.parseInt(matched[3]);
				var column = Std.parseInt(matched[4]);
				m.push(haxe_StackItem.FilePos(meth == "Anonymous function" ? haxe_StackItem.LocalFunction() : meth == "Global code" ? null : haxe_StackItem.Method(path.join("."),meth),file,line1,column));
			} else {
				m.push(haxe_StackItem.Module(StringTools.trim(line)));
			}
		}
		return m;
	} else if(skip > 0 && Array.isArray(s)) {
		return s.slice(skip);
	} else {
		return s;
	}
};
haxe_NativeStackTrace.tryHaxeStack = function(e) {
	if(e == null) {
		return [];
	}
	var oldValue = Error.prepareStackTrace;
	Error.prepareStackTrace = haxe_NativeStackTrace.prepareHxStackTrace;
	var stack = e.stack;
	Error.prepareStackTrace = oldValue;
	return stack;
};
haxe_NativeStackTrace.prepareHxStackTrace = function(e,callsites) {
	var stack = [];
	var _g = 0;
	while(_g < callsites.length) {
		var site = callsites[_g];
		++_g;
		if(haxe_NativeStackTrace.wrapCallSite != null) {
			site = haxe_NativeStackTrace.wrapCallSite(site);
		}
		var method = null;
		var fullName = site.getFunctionName();
		if(fullName != null) {
			var idx = fullName.lastIndexOf(".");
			if(idx >= 0) {
				var className = fullName.substring(0,idx);
				var methodName = fullName.substring(idx + 1);
				method = haxe_StackItem.Method(className,methodName);
			} else {
				method = haxe_StackItem.Method(null,fullName);
			}
		}
		var fileName = site.getFileName();
		var fileAddr = fileName == null ? -1 : fileName.indexOf("file:");
		if(haxe_NativeStackTrace.wrapCallSite != null && fileAddr > 0) {
			fileName = fileName.substring(fileAddr + 6);
		}
		stack.push(haxe_StackItem.FilePos(method,fileName,site.getLineNumber(),site.getColumnNumber()));
	}
	return stack;
};
haxe_NativeStackTrace.normalize = function(stack,skipItems) {
	if(skipItems == null) {
		skipItems = 0;
	}
	if(Array.isArray(stack) && skipItems > 0) {
		return stack.slice(skipItems);
	} else if(typeof(stack) == "string") {
		switch(stack.substring(0,6)) {
		case "Error\n":case "Error:":
			++skipItems;
			break;
		default:
		}
		return haxe_NativeStackTrace.skipLines(stack,skipItems);
	} else {
		return stack;
	}
};
haxe_NativeStackTrace.skipLines = function(stack,skip,pos) {
	if(pos == null) {
		pos = 0;
	}
	if(skip > 0) {
		pos = stack.indexOf("\n",pos);
		if(pos < 0) {
			return "";
		} else {
			return haxe_NativeStackTrace.skipLines(stack,--skip,pos + 1);
		}
	} else {
		return stack.substring(pos);
	}
};
var haxe_Serializer = function() {
	this.buf = new StringBuf();
	this.cache = [];
	this.useCache = haxe_Serializer.USE_CACHE;
	this.useEnumIndex = haxe_Serializer.USE_ENUM_INDEX;
	this.shash = new haxe_ds_StringMap();
	this.scount = 0;
};
$hxClasses["haxe.Serializer"] = haxe_Serializer;
haxe_Serializer.__name__ = "haxe.Serializer";
haxe_Serializer.run = function(v) {
	var s = new haxe_Serializer();
	s.serialize(v);
	return s.toString();
};
haxe_Serializer.prototype = {
	buf: null
	,cache: null
	,shash: null
	,scount: null
	,useCache: null
	,useEnumIndex: null
	,toString: function() {
		return this.buf.b;
	}
	,serializeString: function(s) {
		var x = this.shash.h[s];
		if(x != null) {
			this.buf.b += "R";
			this.buf.b += x == null ? "null" : "" + x;
			return;
		}
		this.shash.h[s] = this.scount++;
		this.buf.b += "y";
		s = encodeURIComponent(s);
		this.buf.b += Std.string(s.length);
		this.buf.b += ":";
		this.buf.b += s == null ? "null" : "" + s;
	}
	,serializeRef: function(v) {
		var vt = typeof(v);
		var _g = 0;
		var _g1 = this.cache.length;
		while(_g < _g1) {
			var i = _g++;
			var ci = this.cache[i];
			if(typeof(ci) == vt && ci == v) {
				this.buf.b += "r";
				this.buf.b += i == null ? "null" : "" + i;
				return true;
			}
		}
		this.cache.push(v);
		return false;
	}
	,serializeFields: function(v) {
		var _g = 0;
		var _g1 = Reflect.fields(v);
		while(_g < _g1.length) {
			var f = _g1[_g];
			++_g;
			this.serializeString(f);
			this.serialize(Reflect.field(v,f));
		}
		this.buf.b += "g";
	}
	,serialize: function(v) {
		var _g = Type.typeof(v);
		switch(_g._hx_index) {
		case 0:
			this.buf.b += "n";
			break;
		case 1:
			var v1 = v;
			if(v1 == 0) {
				this.buf.b += "z";
				return;
			}
			this.buf.b += "i";
			this.buf.b += v1 == null ? "null" : "" + v1;
			break;
		case 2:
			var v1 = v;
			if(isNaN(v1)) {
				this.buf.b += "k";
			} else if(!isFinite(v1)) {
				this.buf.b += v1 < 0 ? "m" : "p";
			} else {
				this.buf.b += "d";
				this.buf.b += v1 == null ? "null" : "" + v1;
			}
			break;
		case 3:
			this.buf.b += v ? "t" : "f";
			break;
		case 4:
			if(js_Boot.__instanceof(v,Class)) {
				var className = v.__name__;
				this.buf.b += "A";
				this.serializeString(className);
			} else if(js_Boot.__instanceof(v,Enum)) {
				this.buf.b += "B";
				this.serializeString(v.__ename__);
			} else {
				if(this.useCache && this.serializeRef(v)) {
					return;
				}
				this.buf.b += "o";
				this.serializeFields(v);
			}
			break;
		case 5:
			throw haxe_Exception.thrown("Cannot serialize function");
		case 6:
			var c = _g.c;
			if(c == String) {
				this.serializeString(v);
				return;
			}
			if(this.useCache && this.serializeRef(v)) {
				return;
			}
			switch(c) {
			case Array:
				var ucount = 0;
				this.buf.b += "a";
				var l = v["length"];
				var _g1 = 0;
				var _g2 = l;
				while(_g1 < _g2) {
					var i = _g1++;
					if(v[i] == null) {
						++ucount;
					} else {
						if(ucount > 0) {
							if(ucount == 1) {
								this.buf.b += "n";
							} else {
								this.buf.b += "u";
								this.buf.b += ucount == null ? "null" : "" + ucount;
							}
							ucount = 0;
						}
						this.serialize(v[i]);
					}
				}
				if(ucount > 0) {
					if(ucount == 1) {
						this.buf.b += "n";
					} else {
						this.buf.b += "u";
						this.buf.b += ucount == null ? "null" : "" + ucount;
					}
				}
				this.buf.b += "h";
				break;
			case Date:
				var d = v;
				this.buf.b += "v";
				this.buf.b += Std.string(d.getTime());
				break;
			case haxe_ds_IntMap:
				this.buf.b += "q";
				var v1 = v;
				var k = v1.keys();
				while(k.hasNext()) {
					var k1 = k.next();
					this.buf.b += ":";
					this.buf.b += k1 == null ? "null" : "" + k1;
					this.serialize(v1.h[k1]);
				}
				this.buf.b += "h";
				break;
			case haxe_ds_List:
				this.buf.b += "l";
				var v1 = v;
				var _g_head = v1.h;
				while(_g_head != null) {
					var val = _g_head.item;
					_g_head = _g_head.next;
					var i = val;
					this.serialize(i);
				}
				this.buf.b += "h";
				break;
			case haxe_ds_ObjectMap:
				this.buf.b += "M";
				var v1 = v;
				var k = v1.keys();
				while(k.hasNext()) {
					var k1 = k.next();
					var id = Reflect.field(k1,"__id__");
					Reflect.deleteField(k1,"__id__");
					this.serialize(k1);
					k1["__id__"] = id;
					this.serialize(v1.h[k1.__id__]);
				}
				this.buf.b += "h";
				break;
			case haxe_ds_StringMap:
				this.buf.b += "b";
				var v1 = v;
				var h = v1.h;
				var _g_h = h;
				var _g_keys = Object.keys(h);
				var _g_length = _g_keys.length;
				var _g_current = 0;
				while(_g_current < _g_length) {
					var k = _g_keys[_g_current++];
					this.serializeString(k);
					this.serialize(v1.h[k]);
				}
				this.buf.b += "h";
				break;
			case haxe_io_Bytes:
				var v1 = v;
				this.buf.b += "s";
				this.buf.b += Std.string(Math.ceil(v1.length * 8 / 6));
				this.buf.b += ":";
				var i = 0;
				var max = v1.length - 2;
				var b64 = haxe_Serializer.BASE64_CODES;
				if(b64 == null) {
					b64 = new Array(haxe_Serializer.BASE64.length);
					var _g1 = 0;
					var _g2 = haxe_Serializer.BASE64.length;
					while(_g1 < _g2) {
						var i1 = _g1++;
						b64[i1] = HxOverrides.cca(haxe_Serializer.BASE64,i1);
					}
					haxe_Serializer.BASE64_CODES = b64;
				}
				while(i < max) {
					var b1 = v1.b[i++];
					var b2 = v1.b[i++];
					var b3 = v1.b[i++];
					this.buf.b += String.fromCodePoint(b64[b1 >> 2]);
					this.buf.b += String.fromCodePoint(b64[(b1 << 4 | b2 >> 4) & 63]);
					this.buf.b += String.fromCodePoint(b64[(b2 << 2 | b3 >> 6) & 63]);
					this.buf.b += String.fromCodePoint(b64[b3 & 63]);
				}
				if(i == max) {
					var b1 = v1.b[i++];
					var b2 = v1.b[i++];
					this.buf.b += String.fromCodePoint(b64[b1 >> 2]);
					this.buf.b += String.fromCodePoint(b64[(b1 << 4 | b2 >> 4) & 63]);
					this.buf.b += String.fromCodePoint(b64[b2 << 2 & 63]);
				} else if(i == max + 1) {
					var b1 = v1.b[i++];
					this.buf.b += String.fromCodePoint(b64[b1 >> 2]);
					this.buf.b += String.fromCodePoint(b64[b1 << 4 & 63]);
				}
				break;
			default:
				if(this.useCache) {
					this.cache.pop();
				}
				if(v.hxSerialize != null) {
					this.buf.b += "C";
					this.serializeString(c.__name__);
					if(this.useCache) {
						this.cache.push(v);
					}
					v.hxSerialize(this);
					this.buf.b += "g";
				} else {
					this.buf.b += "c";
					this.serializeString(c.__name__);
					if(this.useCache) {
						this.cache.push(v);
					}
					this.serializeFields(v);
				}
			}
			break;
		case 7:
			var e = _g.e;
			if(this.useCache) {
				if(this.serializeRef(v)) {
					return;
				}
				this.cache.pop();
			}
			this.buf.b += Std.string(this.useEnumIndex ? "j" : "w");
			this.serializeString(e.__ename__);
			if(this.useEnumIndex) {
				this.buf.b += ":";
				this.buf.b += Std.string(v._hx_index);
			} else {
				var e = v;
				this.serializeString($hxEnums[e.__enum__].__constructs__[e._hx_index]._hx_name);
			}
			this.buf.b += ":";
			var params = Type.enumParameters(v);
			this.buf.b += Std.string(params.length);
			var _g = 0;
			while(_g < params.length) {
				var p = params[_g];
				++_g;
				this.serialize(p);
			}
			if(this.useCache) {
				this.cache.push(v);
			}
			break;
		default:
			throw haxe_Exception.thrown("Cannot serialize " + Std.string(v));
		}
	}
	,__class__: haxe_Serializer
};
var haxe_Timer = function(time_ms) {
	var me = this;
	this.id = setInterval(function() {
		me.run();
	},time_ms);
};
$hxClasses["haxe.Timer"] = haxe_Timer;
haxe_Timer.__name__ = "haxe.Timer";
haxe_Timer.delay = function(f,time_ms) {
	var t = new haxe_Timer(time_ms);
	t.run = function() {
		t.stop();
		f();
	};
	return t;
};
haxe_Timer.measure = function(f,pos) {
	var t0 = new Date().getTime() / 1000;
	var r = f();
	haxe_Log.trace(new Date().getTime() / 1000 - t0 + "s",pos);
	return r;
};
haxe_Timer.stamp = function() {
	return new Date().getTime() / 1000;
};
haxe_Timer.prototype = {
	id: null
	,stop: function() {
		if(this.id == null) {
			return;
		}
		clearInterval(this.id);
		this.id = null;
	}
	,run: function() {
	}
	,__class__: haxe_Timer
};
var haxe__$Unserializer_DefaultResolver = function() {
};
$hxClasses["haxe._Unserializer.DefaultResolver"] = haxe__$Unserializer_DefaultResolver;
haxe__$Unserializer_DefaultResolver.__name__ = "haxe._Unserializer.DefaultResolver";
haxe__$Unserializer_DefaultResolver.prototype = {
	resolveClass: function(name) {
		return $hxClasses[name];
	}
	,resolveEnum: function(name) {
		return $hxEnums[name];
	}
	,__class__: haxe__$Unserializer_DefaultResolver
};
var haxe_Unserializer = function(buf) {
	this.buf = buf;
	this.length = this.buf.length;
	this.pos = 0;
	this.scache = [];
	this.cache = [];
	var r = haxe_Unserializer.DEFAULT_RESOLVER;
	if(r == null) {
		r = new haxe__$Unserializer_DefaultResolver();
		haxe_Unserializer.DEFAULT_RESOLVER = r;
	}
	this.resolver = r;
};
$hxClasses["haxe.Unserializer"] = haxe_Unserializer;
haxe_Unserializer.__name__ = "haxe.Unserializer";
haxe_Unserializer.initCodes = function() {
	var codes = [];
	var _g = 0;
	var _g1 = haxe_Unserializer.BASE64.length;
	while(_g < _g1) {
		var i = _g++;
		codes[haxe_Unserializer.BASE64.charCodeAt(i)] = i;
	}
	return codes;
};
haxe_Unserializer.run = function(v) {
	return new haxe_Unserializer(v).unserialize();
};
haxe_Unserializer.prototype = {
	buf: null
	,pos: null
	,length: null
	,cache: null
	,scache: null
	,resolver: null
	,setResolver: function(r) {
		if(r == null) {
			if(haxe__$Unserializer_NullResolver.instance == null) {
				haxe__$Unserializer_NullResolver.instance = new haxe__$Unserializer_NullResolver();
			}
			this.resolver = haxe__$Unserializer_NullResolver.instance;
		} else {
			this.resolver = r;
		}
	}
	,readDigits: function() {
		var k = 0;
		var s = false;
		var fpos = this.pos;
		while(true) {
			var c = this.buf.charCodeAt(this.pos);
			if(c != c) {
				break;
			}
			if(c == 45) {
				if(this.pos != fpos) {
					break;
				}
				s = true;
				this.pos++;
				continue;
			}
			if(c < 48 || c > 57) {
				break;
			}
			k = k * 10 + (c - 48);
			this.pos++;
		}
		if(s) {
			k *= -1;
		}
		return k;
	}
	,readFloat: function() {
		var p1 = this.pos;
		while(true) {
			var c = this.buf.charCodeAt(this.pos);
			if(c != c) {
				break;
			}
			if(c >= 43 && c < 58 || c == 101 || c == 69) {
				this.pos++;
			} else {
				break;
			}
		}
		return parseFloat(HxOverrides.substr(this.buf,p1,this.pos - p1));
	}
	,unserializeObject: function(o) {
		while(true) {
			if(this.pos >= this.length) {
				throw haxe_Exception.thrown("Invalid object");
			}
			if(this.buf.charCodeAt(this.pos) == 103) {
				break;
			}
			var k = this.unserialize();
			if(typeof(k) != "string") {
				throw haxe_Exception.thrown("Invalid object key");
			}
			var v = this.unserialize();
			o[k] = v;
		}
		this.pos++;
	}
	,unserializeEnum: function(edecl,tag) {
		if(this.buf.charCodeAt(this.pos++) != 58) {
			throw haxe_Exception.thrown("Invalid enum format");
		}
		var nargs = this.readDigits();
		if(nargs == 0) {
			return Type.createEnum(edecl,tag);
		}
		var args = [];
		while(nargs-- > 0) args.push(this.unserialize());
		return Type.createEnum(edecl,tag,args);
	}
	,unserialize: function() {
		switch(this.buf.charCodeAt(this.pos++)) {
		case 65:
			var name = this.unserialize();
			var cl = this.resolver.resolveClass(name);
			if(cl == null) {
				throw haxe_Exception.thrown("Class not found " + name);
			}
			return cl;
		case 66:
			var name = this.unserialize();
			var e = this.resolver.resolveEnum(name);
			if(e == null) {
				throw haxe_Exception.thrown("Enum not found " + name);
			}
			return e;
		case 67:
			var name = this.unserialize();
			var cl = this.resolver.resolveClass(name);
			if(cl == null) {
				throw haxe_Exception.thrown("Class not found " + name);
			}
			var o = Object.create(cl.prototype);
			this.cache.push(o);
			o.hxUnserialize(this);
			if(this.buf.charCodeAt(this.pos++) != 103) {
				throw haxe_Exception.thrown("Invalid custom data");
			}
			return o;
		case 77:
			var h = new haxe_ds_ObjectMap();
			this.cache.push(h);
			var buf = this.buf;
			while(this.buf.charCodeAt(this.pos) != 104) {
				var s = this.unserialize();
				h.set(s,this.unserialize());
			}
			this.pos++;
			return h;
		case 82:
			var n = this.readDigits();
			if(n < 0 || n >= this.scache.length) {
				throw haxe_Exception.thrown("Invalid string reference");
			}
			return this.scache[n];
		case 97:
			var buf = this.buf;
			var a = [];
			this.cache.push(a);
			while(true) {
				var c = this.buf.charCodeAt(this.pos);
				if(c == 104) {
					this.pos++;
					break;
				}
				if(c == 117) {
					this.pos++;
					var n = this.readDigits();
					a[a.length + n - 1] = null;
				} else {
					a.push(this.unserialize());
				}
			}
			return a;
		case 98:
			var h = new haxe_ds_StringMap();
			this.cache.push(h);
			var buf = this.buf;
			while(this.buf.charCodeAt(this.pos) != 104) {
				var s = this.unserialize();
				var value = this.unserialize();
				h.h[s] = value;
			}
			this.pos++;
			return h;
		case 99:
			var name = this.unserialize();
			var cl = this.resolver.resolveClass(name);
			if(cl == null) {
				throw haxe_Exception.thrown("Class not found " + name);
			}
			var o = Object.create(cl.prototype);
			this.cache.push(o);
			this.unserializeObject(o);
			return o;
		case 100:
			return this.readFloat();
		case 102:
			return false;
		case 105:
			return this.readDigits();
		case 106:
			var name = this.unserialize();
			var edecl = this.resolver.resolveEnum(name);
			if(edecl == null) {
				throw haxe_Exception.thrown("Enum not found " + name);
			}
			this.pos++;
			var index = this.readDigits();
			var _this = edecl.__constructs__;
			var result = new Array(_this.length);
			var _g = 0;
			var _g1 = _this.length;
			while(_g < _g1) {
				var i = _g++;
				result[i] = _this[i]._hx_name;
			}
			var tag = result[index];
			if(tag == null) {
				throw haxe_Exception.thrown("Unknown enum index " + name + "@" + index);
			}
			var e = this.unserializeEnum(edecl,tag);
			this.cache.push(e);
			return e;
		case 107:
			return NaN;
		case 108:
			var l = new haxe_ds_List();
			this.cache.push(l);
			var buf = this.buf;
			while(this.buf.charCodeAt(this.pos) != 104) l.add(this.unserialize());
			this.pos++;
			return l;
		case 109:
			return -Infinity;
		case 110:
			return null;
		case 111:
			var o = { };
			this.cache.push(o);
			this.unserializeObject(o);
			return o;
		case 112:
			return Infinity;
		case 113:
			var h = new haxe_ds_IntMap();
			this.cache.push(h);
			var buf = this.buf;
			var c = this.buf.charCodeAt(this.pos++);
			while(c == 58) {
				var i = this.readDigits();
				var value = this.unserialize();
				h.h[i] = value;
				c = this.buf.charCodeAt(this.pos++);
			}
			if(c != 104) {
				throw haxe_Exception.thrown("Invalid IntMap format");
			}
			return h;
		case 114:
			var n = this.readDigits();
			if(n < 0 || n >= this.cache.length) {
				throw haxe_Exception.thrown("Invalid reference");
			}
			return this.cache[n];
		case 115:
			var len = this.readDigits();
			var buf = this.buf;
			if(this.buf.charCodeAt(this.pos++) != 58 || this.length - this.pos < len) {
				throw haxe_Exception.thrown("Invalid bytes length");
			}
			var codes = haxe_Unserializer.CODES;
			if(codes == null) {
				codes = haxe_Unserializer.initCodes();
				haxe_Unserializer.CODES = codes;
			}
			var i = this.pos;
			var rest = len & 3;
			var size = (len >> 2) * 3 + (rest >= 2 ? rest - 1 : 0);
			var max = i + (len - rest);
			var bytes = new haxe_io_Bytes(new ArrayBuffer(size));
			var bpos = 0;
			while(i < max) {
				var c1 = codes[buf.charCodeAt(i++)];
				var c2 = codes[buf.charCodeAt(i++)];
				bytes.b[bpos++] = c1 << 2 | c2 >> 4;
				var c3 = codes[buf.charCodeAt(i++)];
				bytes.b[bpos++] = c2 << 4 | c3 >> 2;
				var c4 = codes[buf.charCodeAt(i++)];
				bytes.b[bpos++] = c3 << 6 | c4;
			}
			if(rest >= 2) {
				var c1 = codes[buf.charCodeAt(i++)];
				var c2 = codes[buf.charCodeAt(i++)];
				bytes.b[bpos++] = c1 << 2 | c2 >> 4;
				if(rest == 3) {
					var c3 = codes[buf.charCodeAt(i++)];
					bytes.b[bpos++] = c2 << 4 | c3 >> 2;
				}
			}
			this.pos += len;
			this.cache.push(bytes);
			return bytes;
		case 116:
			return true;
		case 118:
			var d;
			if(this.buf.charCodeAt(this.pos) >= 48 && this.buf.charCodeAt(this.pos) <= 57 && this.buf.charCodeAt(this.pos + 1) >= 48 && this.buf.charCodeAt(this.pos + 1) <= 57 && this.buf.charCodeAt(this.pos + 2) >= 48 && this.buf.charCodeAt(this.pos + 2) <= 57 && this.buf.charCodeAt(this.pos + 3) >= 48 && this.buf.charCodeAt(this.pos + 3) <= 57 && this.buf.charCodeAt(this.pos + 4) == 45) {
				d = HxOverrides.strDate(HxOverrides.substr(this.buf,this.pos,19));
				this.pos += 19;
			} else {
				d = new Date(this.readFloat());
			}
			this.cache.push(d);
			return d;
		case 119:
			var name = this.unserialize();
			var edecl = this.resolver.resolveEnum(name);
			if(edecl == null) {
				throw haxe_Exception.thrown("Enum not found " + name);
			}
			var e = this.unserializeEnum(edecl,this.unserialize());
			this.cache.push(e);
			return e;
		case 120:
			throw haxe_Exception.thrown(this.unserialize());
		case 121:
			var len = this.readDigits();
			if(this.buf.charCodeAt(this.pos++) != 58 || this.length - this.pos < len) {
				throw haxe_Exception.thrown("Invalid string length");
			}
			var s = HxOverrides.substr(this.buf,this.pos,len);
			this.pos += len;
			s = decodeURIComponent(s.split("+").join(" "));
			this.scache.push(s);
			return s;
		case 122:
			return 0;
		default:
		}
		this.pos--;
		throw haxe_Exception.thrown("Invalid char " + this.buf.charAt(this.pos) + " at position " + this.pos);
	}
	,__class__: haxe_Unserializer
};
var haxe__$Unserializer_NullResolver = function() {
};
$hxClasses["haxe._Unserializer.NullResolver"] = haxe__$Unserializer_NullResolver;
haxe__$Unserializer_NullResolver.__name__ = "haxe._Unserializer.NullResolver";
haxe__$Unserializer_NullResolver.prototype = {
	resolveClass: function(name) {
		return null;
	}
	,resolveEnum: function(name) {
		return null;
	}
	,__class__: haxe__$Unserializer_NullResolver
};
var haxe_ValueException = function(value,previous,native) {
	haxe_Exception.call(this,String(value),previous,native);
	this.value = value;
	this.__skipStack++;
};
$hxClasses["haxe.ValueException"] = haxe_ValueException;
haxe_ValueException.__name__ = "haxe.ValueException";
haxe_ValueException.__super__ = haxe_Exception;
haxe_ValueException.prototype = $extend(haxe_Exception.prototype,{
	value: null
	,unwrap: function() {
		return this.value;
	}
	,__class__: haxe_ValueException
});
var haxe_crypto_Adler32 = function() {
	this.a1 = 1;
	this.a2 = 0;
};
$hxClasses["haxe.crypto.Adler32"] = haxe_crypto_Adler32;
haxe_crypto_Adler32.__name__ = "haxe.crypto.Adler32";
haxe_crypto_Adler32.read = function(i) {
	var a = new haxe_crypto_Adler32();
	var a2a = i.readByte();
	var a2b = i.readByte();
	var a1a = i.readByte();
	var a1b = i.readByte();
	a.a1 = a1a << 8 | a1b;
	a.a2 = a2a << 8 | a2b;
	return a;
};
haxe_crypto_Adler32.make = function(b) {
	var a = new haxe_crypto_Adler32();
	a.update(b,0,b.length);
	return a.get();
};
haxe_crypto_Adler32.prototype = {
	a1: null
	,a2: null
	,get: function() {
		return this.a2 << 16 | this.a1;
	}
	,update: function(b,pos,len) {
		var a1 = this.a1;
		var a2 = this.a2;
		var _g = pos;
		var _g1 = pos + len;
		while(_g < _g1) {
			var p = _g++;
			var c = b.b[p];
			a1 = (a1 + c) % 65521;
			a2 = (a2 + a1) % 65521;
		}
		this.a1 = a1;
		this.a2 = a2;
	}
	,equals: function(a) {
		if(a.a1 == this.a1) {
			return a.a2 == this.a2;
		} else {
			return false;
		}
	}
	,toString: function() {
		return StringTools.hex(this.a2,8) + StringTools.hex(this.a1,8);
	}
	,__class__: haxe_crypto_Adler32
};
var haxe_crypto_Aes = function(key,iv) {
	haxe_crypto_Aes.initTable();
	if(key != null) {
		this.init(key,iv);
	}
};
$hxClasses["haxe.crypto.Aes"] = haxe_crypto_Aes;
haxe_crypto_Aes.__name__ = "haxe.crypto.Aes";
haxe_crypto_Aes.initTable = function() {
	haxe_crypto_Aes.SBOX = new Array(256);
	haxe_crypto_Aes.RSBOX = new Array(256);
	haxe_crypto_Aes.SUB_BYTES_MIX_COLUMN_0 = new Array(256);
	haxe_crypto_Aes.SUB_BYTES_MIX_COLUMN_1 = new Array(256);
	haxe_crypto_Aes.SUB_BYTES_MIX_COLUMN_2 = new Array(256);
	haxe_crypto_Aes.SUB_BYTES_MIX_COLUMN_3 = new Array(256);
	haxe_crypto_Aes.RSUB_BYTES_MIX_COLUMN_0 = new Array(256);
	haxe_crypto_Aes.RSUB_BYTES_MIX_COLUMN_1 = new Array(256);
	haxe_crypto_Aes.RSUB_BYTES_MIX_COLUMN_2 = new Array(256);
	haxe_crypto_Aes.RSUB_BYTES_MIX_COLUMN_3 = new Array(256);
	haxe_crypto_Aes.RCON = new Array(11);
	var d = new Array(256);
	var _g = 0;
	while(_g < 256) {
		var i = _g++;
		if(i < 128) {
			d[i] = i << 1;
		} else {
			d[i] = i << 1 ^ 283;
		}
	}
	var x = 0;
	var xi = 0;
	var _g = 0;
	while(_g < 256) {
		var i = _g++;
		var sx = xi ^ xi << 1 ^ xi << 2 ^ xi << 3 ^ xi << 4;
		sx = sx >>> 8 ^ sx & 255 ^ 99;
		haxe_crypto_Aes.SBOX[x] = sx;
		haxe_crypto_Aes.RSBOX[sx] = x;
		var x2 = d[x];
		var x4 = d[x2];
		var x8 = d[x4];
		var t = d[sx] * 257 ^ haxe_Int32._mul(sx,16843008);
		haxe_crypto_Aes.SUB_BYTES_MIX_COLUMN_0[x] = t << 24 | t >>> 8;
		haxe_crypto_Aes.SUB_BYTES_MIX_COLUMN_1[x] = t << 16 | t >>> 16;
		haxe_crypto_Aes.SUB_BYTES_MIX_COLUMN_2[x] = t << 8 | t >>> 24;
		haxe_crypto_Aes.SUB_BYTES_MIX_COLUMN_3[x] = t;
		t = x8 * 16843009 ^ x4 * 65537 ^ x2 * 257 ^ x * 16843008;
		haxe_crypto_Aes.RSUB_BYTES_MIX_COLUMN_0[sx] = t << 24 | t >>> 8;
		haxe_crypto_Aes.RSUB_BYTES_MIX_COLUMN_1[sx] = t << 16 | t >>> 16;
		haxe_crypto_Aes.RSUB_BYTES_MIX_COLUMN_2[sx] = t << 8 | t >>> 24;
		haxe_crypto_Aes.RSUB_BYTES_MIX_COLUMN_3[sx] = t;
		if(x == 0) {
			xi = 1;
			x = xi;
		} else {
			x = x2 ^ d[d[d[x8 ^ x2]]];
			xi ^= d[d[xi]];
		}
	}
	haxe_crypto_Aes.RCON[0] = 0;
	haxe_crypto_Aes.RCON[1] = 1;
	haxe_crypto_Aes.RCON[2] = 2;
	haxe_crypto_Aes.RCON[3] = 4;
	haxe_crypto_Aes.RCON[4] = 8;
	haxe_crypto_Aes.RCON[5] = 16;
	haxe_crypto_Aes.RCON[6] = 32;
	haxe_crypto_Aes.RCON[7] = 64;
	haxe_crypto_Aes.RCON[8] = 128;
	haxe_crypto_Aes.RCON[9] = 27;
	haxe_crypto_Aes.RCON[10] = 54;
};
haxe_crypto_Aes.prototype = {
	Nk: null
	,Nr: null
	,roundKey: null
	,rRoundKey: null
	,keyRows: null
	,state: null
	,key: null
	,iv: null
	,set_iv: function(vector) {
		this.iv = vector;
		return this.iv;
	}
	,init: function(key,iv) {
		this.key = key;
		this.Nk = key.length >> 2;
		this.Nr = this.Nk + 6;
		this.keyRows = (this.Nr + 1) * 4;
		this.state = new Array(this.Nk);
		this.set_iv(iv);
		this.keyExpansion(key);
	}
	,keyExpansion: function(key) {
		this.roundKey = new Array(this.keyRows);
		var _g = 0;
		var _g1 = this.keyRows;
		while(_g < _g1) {
			var ksRow = _g++;
			if(ksRow < this.Nk) {
				this.roundKey[ksRow] = this.bytesToInt32(key,ksRow << 2);
			} else {
				var t = this.roundKey[ksRow - 1];
				if(ksRow % this.Nk == 0) {
					t = t << 8 | t >>> 24;
					t = haxe_crypto_Aes.SBOX[t >>> 24] << 24 | haxe_crypto_Aes.SBOX[t >>> 16 & 255] << 16 | haxe_crypto_Aes.SBOX[t >>> 8 & 255] << 8 | haxe_crypto_Aes.SBOX[t & 255];
					t ^= haxe_crypto_Aes.RCON[Math.floor(ksRow / this.Nk) | 0] << 24;
				} else if(this.Nk > 6 && ksRow % this.Nk == 4) {
					t = haxe_crypto_Aes.SBOX[t >>> 24] << 24 | haxe_crypto_Aes.SBOX[t >>> 16 & 255] << 16 | haxe_crypto_Aes.SBOX[t >>> 8 & 255] << 8 | haxe_crypto_Aes.SBOX[t & 255];
				}
				this.roundKey[ksRow] = this.roundKey[ksRow - this.Nk] ^ t;
			}
		}
		this.rRoundKey = new Array(this.keyRows);
		var keyRow;
		var t;
		var _g = 0;
		var _g1 = this.keyRows;
		while(_g < _g1) {
			var i = _g++;
			keyRow = this.keyRows - i;
			if(i % 4 != 0) {
				t = this.roundKey[keyRow];
			} else {
				t = this.roundKey[keyRow - 4];
			}
			if(i < 4 || keyRow <= 4) {
				this.rRoundKey[i] = t;
			} else {
				this.rRoundKey[i] = haxe_crypto_Aes.RSUB_BYTES_MIX_COLUMN_0[haxe_crypto_Aes.SBOX[t >>> 24]] ^ haxe_crypto_Aes.RSUB_BYTES_MIX_COLUMN_1[haxe_crypto_Aes.SBOX[t >>> 16 & 255]] ^ haxe_crypto_Aes.RSUB_BYTES_MIX_COLUMN_2[haxe_crypto_Aes.SBOX[t >>> 8 & 255]] ^ haxe_crypto_Aes.RSUB_BYTES_MIX_COLUMN_3[haxe_crypto_Aes.SBOX[t & 255]];
			}
		}
	}
	,getBlockSize: function() {
		return 16;
	}
	,encrypt: function(cipherMode,data,padding,aad,tagLen,aadCollection) {
		if(tagLen == null) {
			tagLen = 16;
		}
		if(padding == null) {
			padding = "NoPadding";
		}
		var out;
		switch(padding) {
		case "AnsiX923":
			out = haxe_crypto_padding_AnsiX923.pad(data,16);
			break;
		case "BitPadding":
			out = haxe_crypto_padding_BitPadding.pad(data,16);
			break;
		case "ISO10126":
			out = haxe_crypto_padding_ISO10126.pad(data,16);
			break;
		case "NoPadding":
			out = haxe_crypto_padding_NoPadding.pad(data,16);
			break;
		case "NullPadding":
			out = haxe_crypto_padding_NullPadding.pad(data,16);
			break;
		case "PKCS7":
			out = haxe_crypto_padding_PKCS7.pad(data,16);
			break;
		case "SpacePadding":
			out = haxe_crypto_padding_SpacePadding.pad(data,16);
			break;
		case "TBC":
			out = haxe_crypto_padding_TBC.pad(data,16);
			break;
		}
		switch(cipherMode) {
		case "cbc":
			haxe_crypto_mode_CBC.encrypt(out,this.iv,16,$bind(this,this.encryptBlock));
			break;
		case "ccm":
			return haxe_crypto_mode_CCM.encrypt(out,this.iv,aad,tagLen,16,$bind(this,this.encryptBlock));
		case "cfb":
			haxe_crypto_mode_CFB.encrypt(out,this.iv,16,$bind(this,this.encryptBlock));
			break;
		case "ctr":
			haxe_crypto_mode_CTR.encrypt(out,this.iv,16,$bind(this,this.encryptBlock));
			break;
		case "eax":
			return haxe_crypto_mode_EAX.encrypt(out,this.key,this.iv,$bind(this,this.encryptBlock),aadCollection);
		case "ecb":
			haxe_crypto_mode_ECB.encrypt(out,16,$bind(this,this.encryptBlock));
			break;
		case "gcm":
			return haxe_crypto_mode_GCM.encrypt(out,this.iv,aad,tagLen,16,$bind(this,this.encryptBlock));
		case "gcmsiv":
			return haxe_crypto_mode_GCMSIV.encrypt(this.key,this.iv,out,aad,$bind(this,this.encryptBlock),$bind(this,this.init));
		case "ofb":
			haxe_crypto_mode_OFB.encrypt(out,this.iv,16,$bind(this,this.encryptBlock));
			break;
		case "pcbc":
			haxe_crypto_mode_PCBC.encrypt(out,this.iv,16,$bind(this,this.encryptBlock));
			break;
		case "siv":
			return haxe_crypto_mode_SIV.encrypt(this.key,out,this.iv,aadCollection,$bind(this,this.encryptBlock),$bind(this,this.init));
		}
		return out;
	}
	,decrypt: function(cipherMode,data,padding,aad,tagLen,aadCollection) {
		if(tagLen == null) {
			tagLen = 16;
		}
		if(padding == null) {
			padding = "NoPadding";
		}
		var out = data.sub(0,data.length);
		switch(cipherMode) {
		case "cbc":
			haxe_crypto_mode_CBC.decrypt(out,this.iv,16,$bind(this,this.decryptBlock));
			break;
		case "ccm":
			return haxe_crypto_mode_CCM.decrypt(out,this.iv,aad,tagLen,16,$bind(this,this.encryptBlock));
		case "cfb":
			haxe_crypto_mode_CFB.decrypt(out,this.iv,16,$bind(this,this.encryptBlock));
			break;
		case "ctr":
			haxe_crypto_mode_CTR.decrypt(out,this.iv,16,$bind(this,this.encryptBlock));
			break;
		case "eax":
			return haxe_crypto_mode_EAX.decrypt(out,this.key,this.iv,$bind(this,this.encryptBlock),aadCollection);
		case "ecb":
			haxe_crypto_mode_ECB.decrypt(out,16,$bind(this,this.decryptBlock));
			break;
		case "gcm":
			return haxe_crypto_mode_GCM.decrypt(out,this.iv,aad,tagLen,16,$bind(this,this.encryptBlock));
		case "gcmsiv":
			return haxe_crypto_mode_GCMSIV.decrypt(this.key,this.iv,out,aad,$bind(this,this.encryptBlock),$bind(this,this.init));
		case "ofb":
			haxe_crypto_mode_OFB.decrypt(out,this.iv,16,$bind(this,this.encryptBlock));
			break;
		case "pcbc":
			haxe_crypto_mode_PCBC.decrypt(out,this.iv,16,$bind(this,this.decryptBlock));
			break;
		case "siv":
			return haxe_crypto_mode_SIV.decrypt(this.key,out,this.iv,aadCollection,$bind(this,this.encryptBlock),$bind(this,this.init));
		}
		switch(padding) {
		case "AnsiX923":
			out = haxe_crypto_padding_AnsiX923.unpad(out);
			break;
		case "BitPadding":
			out = haxe_crypto_padding_BitPadding.unpad(out);
			break;
		case "ISO10126":
			out = haxe_crypto_padding_ISO10126.unpad(out);
			break;
		case "NoPadding":
			out = haxe_crypto_padding_NoPadding.unpad(out);
			break;
		case "NullPadding":
			out = haxe_crypto_padding_NullPadding.unpad(out);
			break;
		case "PKCS7":
			out = haxe_crypto_padding_PKCS7.unpad(out);
			break;
		case "SpacePadding":
			out = haxe_crypto_padding_SpacePadding.unpad(out);
			break;
		case "TBC":
			out = haxe_crypto_padding_TBC.unpad(out);
			break;
		}
		return out;
	}
	,encryptBlock: function(src,srcIndex,dst,dstIndex) {
		this.state[0] = this.bytesToInt32(src,srcIndex);
		this.state[1] = this.bytesToInt32(src,srcIndex + 4);
		this.state[2] = this.bytesToInt32(src,srcIndex + 8);
		this.state[3] = this.bytesToInt32(src,srcIndex + 12);
		this.generateBlock(this.roundKey,haxe_crypto_Aes.SUB_BYTES_MIX_COLUMN_0,haxe_crypto_Aes.SUB_BYTES_MIX_COLUMN_1,haxe_crypto_Aes.SUB_BYTES_MIX_COLUMN_2,haxe_crypto_Aes.SUB_BYTES_MIX_COLUMN_3,haxe_crypto_Aes.SBOX);
		this.int32ToBytes(this.state[0],dst,dstIndex);
		this.int32ToBytes(this.state[1],dst,dstIndex + 4);
		this.int32ToBytes(this.state[2],dst,dstIndex + 8);
		this.int32ToBytes(this.state[3],dst,dstIndex + 12);
	}
	,decryptBlock: function(src,srcIndex,dst,dstIndex) {
		if(dstIndex == null) {
			dstIndex = 0;
		}
		this.state[0] = this.bytesToInt32(src,srcIndex);
		this.state[1] = this.bytesToInt32(src,srcIndex + 4);
		this.state[2] = this.bytesToInt32(src,srcIndex + 8);
		this.state[3] = this.bytesToInt32(src,srcIndex + 12);
		var t = this.state[1];
		this.state[1] = this.state[3];
		this.state[3] = t;
		this.generateBlock(this.rRoundKey,haxe_crypto_Aes.RSUB_BYTES_MIX_COLUMN_0,haxe_crypto_Aes.RSUB_BYTES_MIX_COLUMN_1,haxe_crypto_Aes.RSUB_BYTES_MIX_COLUMN_2,haxe_crypto_Aes.RSUB_BYTES_MIX_COLUMN_3,haxe_crypto_Aes.RSBOX);
		t = this.state[1];
		this.state[1] = this.state[3];
		this.state[3] = t;
		this.int32ToBytes(this.state[0],dst,dstIndex);
		this.int32ToBytes(this.state[1],dst,dstIndex + 4);
		this.int32ToBytes(this.state[2],dst,dstIndex + 8);
		this.int32ToBytes(this.state[3],dst,dstIndex + 12);
	}
	,generateBlock: function(keySchedule,SUB_MIX_0,SUB_MIX_1,SUB_MIX_2,SUB_MIX_3,SBOX) {
		var state0 = this.state[0] ^ keySchedule[0];
		var state1 = this.state[1] ^ keySchedule[1];
		var state2 = this.state[2] ^ keySchedule[2];
		var state3 = this.state[3] ^ keySchedule[3];
		var ksRow = 4;
		var tmp0;
		var tmp1;
		var tmp2;
		var tmp3;
		var _g = 1;
		var _g1 = this.Nr;
		while(_g < _g1) {
			var round = _g++;
			tmp0 = SUB_MIX_0[state0 >>> 24] ^ SUB_MIX_1[state1 >>> 16 & 255] ^ SUB_MIX_2[state2 >>> 8 & 255] ^ SUB_MIX_3[state3 & 255] ^ keySchedule[ksRow++];
			tmp1 = SUB_MIX_0[state1 >>> 24] ^ SUB_MIX_1[state2 >>> 16 & 255] ^ SUB_MIX_2[state3 >>> 8 & 255] ^ SUB_MIX_3[state0 & 255] ^ keySchedule[ksRow++];
			tmp2 = SUB_MIX_0[state2 >>> 24] ^ SUB_MIX_1[state3 >>> 16 & 255] ^ SUB_MIX_2[state0 >>> 8 & 255] ^ SUB_MIX_3[state1 & 255] ^ keySchedule[ksRow++];
			tmp3 = SUB_MIX_0[state3 >>> 24] ^ SUB_MIX_1[state0 >>> 16 & 255] ^ SUB_MIX_2[state1 >>> 8 & 255] ^ SUB_MIX_3[state2 & 255] ^ keySchedule[ksRow++];
			state0 = tmp0;
			state1 = tmp1;
			state2 = tmp2;
			state3 = tmp3;
		}
		tmp0 = (SBOX[state0 >>> 24] << 24 | SBOX[state1 >>> 16 & 255] << 16 | SBOX[state2 >>> 8 & 255] << 8 | SBOX[state3 & 255]) ^ keySchedule[ksRow++];
		tmp1 = (SBOX[state1 >>> 24] << 24 | SBOX[state2 >>> 16 & 255] << 16 | SBOX[state3 >>> 8 & 255] << 8 | SBOX[state0 & 255]) ^ keySchedule[ksRow++];
		tmp2 = (SBOX[state2 >>> 24] << 24 | SBOX[state3 >>> 16 & 255] << 16 | SBOX[state0 >>> 8 & 255] << 8 | SBOX[state1 & 255]) ^ keySchedule[ksRow++];
		tmp3 = (SBOX[state3 >>> 24] << 24 | SBOX[state0 >>> 16 & 255] << 16 | SBOX[state1 >>> 8 & 255] << 8 | SBOX[state2 & 255]) ^ keySchedule[ksRow++];
		this.state[0] = tmp0;
		this.state[1] = tmp1;
		this.state[2] = tmp2;
		this.state[3] = tmp3;
	}
	,bytesToInt32: function(bs,off) {
		var n = (bs.b[off] & 255) << 24;
		n |= (bs.b[++off] & 255) << 16;
		n |= (bs.b[++off] & 255) << 8;
		n |= bs.b[++off] & 255;
		return n;
	}
	,int32ToBytes: function(n,bs,off) {
		bs.b[off] = n >> 24;
		bs.b[++off] = n >> 16;
		bs.b[++off] = n >> 8;
		bs.b[++off] = n;
	}
	,__class__: haxe_crypto_Aes
	,__properties__: {set_iv:"set_iv"}
};
var haxe_io_Bytes = function(data) {
	this.length = data.byteLength;
	this.b = new Uint8Array(data);
	this.b.bufferValue = data;
	data.hxBytes = this;
	data.bytes = this.b;
};
$hxClasses["haxe.io.Bytes"] = haxe_io_Bytes;
haxe_io_Bytes.__name__ = "haxe.io.Bytes";
haxe_io_Bytes.ofString = function(s,encoding) {
	if(encoding == haxe_io_Encoding.RawNative) {
		var buf = new Uint8Array(s.length << 1);
		var _g = 0;
		var _g1 = s.length;
		while(_g < _g1) {
			var i = _g++;
			var c = s.charCodeAt(i);
			buf[i << 1] = c & 255;
			buf[i << 1 | 1] = c >> 8;
		}
		return new haxe_io_Bytes(buf.buffer);
	}
	var a = [];
	var i = 0;
	while(i < s.length) {
		var c = s.charCodeAt(i++);
		if(55296 <= c && c <= 56319) {
			c = c - 55232 << 10 | s.charCodeAt(i++) & 1023;
		}
		if(c <= 127) {
			a.push(c);
		} else if(c <= 2047) {
			a.push(192 | c >> 6);
			a.push(128 | c & 63);
		} else if(c <= 65535) {
			a.push(224 | c >> 12);
			a.push(128 | c >> 6 & 63);
			a.push(128 | c & 63);
		} else {
			a.push(240 | c >> 18);
			a.push(128 | c >> 12 & 63);
			a.push(128 | c >> 6 & 63);
			a.push(128 | c & 63);
		}
	}
	return new haxe_io_Bytes(new Uint8Array(a).buffer);
};
haxe_io_Bytes.ofData = function(b) {
	var hb = b.hxBytes;
	if(hb != null) {
		return hb;
	}
	return new haxe_io_Bytes(b);
};
haxe_io_Bytes.ofHex = function(s) {
	if((s.length & 1) != 0) {
		throw haxe_Exception.thrown("Not a hex string (odd number of digits)");
	}
	var a = [];
	var i = 0;
	var len = s.length >> 1;
	while(i < len) {
		var high = s.charCodeAt(i * 2);
		var low = s.charCodeAt(i * 2 + 1);
		high = (high & 15) + ((high & 64) >> 6) * 9;
		low = (low & 15) + ((low & 64) >> 6) * 9;
		a.push((high << 4 | low) & 255);
		++i;
	}
	return new haxe_io_Bytes(new Uint8Array(a).buffer);
};
haxe_io_Bytes.prototype = {
	length: null
	,b: null
	,data: null
	,blit: function(pos,src,srcpos,len) {
		if(pos < 0 || srcpos < 0 || len < 0 || pos + len > this.length || srcpos + len > src.length) {
			throw haxe_Exception.thrown(haxe_io_Error.OutsideBounds);
		}
		if(srcpos == 0 && len == src.b.byteLength) {
			this.b.set(src.b,pos);
		} else {
			this.b.set(src.b.subarray(srcpos,srcpos + len),pos);
		}
	}
	,sub: function(pos,len) {
		if(pos < 0 || len < 0 || pos + len > this.length) {
			throw haxe_Exception.thrown(haxe_io_Error.OutsideBounds);
		}
		return new haxe_io_Bytes(this.b.buffer.slice(pos + this.b.byteOffset,pos + this.b.byteOffset + len));
	}
	,getDouble: function(pos) {
		if(this.data == null) {
			this.data = new DataView(this.b.buffer,this.b.byteOffset,this.b.byteLength);
		}
		return this.data.getFloat64(pos,true);
	}
	,getFloat: function(pos) {
		if(this.data == null) {
			this.data = new DataView(this.b.buffer,this.b.byteOffset,this.b.byteLength);
		}
		return this.data.getFloat32(pos,true);
	}
	,setFloat: function(pos,v) {
		if(this.data == null) {
			this.data = new DataView(this.b.buffer,this.b.byteOffset,this.b.byteLength);
		}
		this.data.setFloat32(pos,v,true);
	}
	,setUInt16: function(pos,v) {
		if(this.data == null) {
			this.data = new DataView(this.b.buffer,this.b.byteOffset,this.b.byteLength);
		}
		this.data.setUint16(pos,v,true);
	}
	,getInt32: function(pos) {
		if(this.data == null) {
			this.data = new DataView(this.b.buffer,this.b.byteOffset,this.b.byteLength);
		}
		return this.data.getInt32(pos,true);
	}
	,setInt32: function(pos,v) {
		if(this.data == null) {
			this.data = new DataView(this.b.buffer,this.b.byteOffset,this.b.byteLength);
		}
		this.data.setInt32(pos,v,true);
	}
	,getString: function(pos,len,encoding) {
		if(pos < 0 || len < 0 || pos + len > this.length) {
			throw haxe_Exception.thrown(haxe_io_Error.OutsideBounds);
		}
		if(encoding == null) {
			encoding = haxe_io_Encoding.UTF8;
		}
		var s = "";
		var b = this.b;
		var i = pos;
		var max = pos + len;
		switch(encoding._hx_index) {
		case 0:
			var debug = pos > 0;
			while(i < max) {
				var c = b[i++];
				if(c < 128) {
					if(c == 0) {
						break;
					}
					s += String.fromCodePoint(c);
				} else if(c < 224) {
					var code = (c & 63) << 6 | b[i++] & 127;
					s += String.fromCodePoint(code);
				} else if(c < 240) {
					var c2 = b[i++];
					var code1 = (c & 31) << 12 | (c2 & 127) << 6 | b[i++] & 127;
					s += String.fromCodePoint(code1);
				} else {
					var c21 = b[i++];
					var c3 = b[i++];
					var u = (c & 15) << 18 | (c21 & 127) << 12 | (c3 & 127) << 6 | b[i++] & 127;
					s += String.fromCodePoint(u);
				}
			}
			break;
		case 1:
			while(i < max) {
				var c = b[i++] | b[i++] << 8;
				s += String.fromCodePoint(c);
			}
			break;
		}
		return s;
	}
	,toString: function() {
		return this.getString(0,this.length);
	}
	,toHex: function() {
		var s_b = "";
		var chars = [];
		var str = "0123456789abcdef";
		var _g = 0;
		var _g1 = str.length;
		while(_g < _g1) {
			var i = _g++;
			chars.push(HxOverrides.cca(str,i));
		}
		var _g = 0;
		var _g1 = this.length;
		while(_g < _g1) {
			var i = _g++;
			var c = this.b[i];
			s_b += String.fromCodePoint(chars[c >> 4]);
			s_b += String.fromCodePoint(chars[c & 15]);
		}
		return s_b;
	}
	,__class__: haxe_io_Bytes
};
var haxe_io_Encoding = $hxEnums["haxe.io.Encoding"] = { __ename__:"haxe.io.Encoding",__constructs__:null
	,UTF8: {_hx_name:"UTF8",_hx_index:0,__enum__:"haxe.io.Encoding",toString:$estr}
	,RawNative: {_hx_name:"RawNative",_hx_index:1,__enum__:"haxe.io.Encoding",toString:$estr}
};
haxe_io_Encoding.__constructs__ = [haxe_io_Encoding.UTF8,haxe_io_Encoding.RawNative];
var haxe_crypto_Base64 = function() { };
$hxClasses["haxe.crypto.Base64"] = haxe_crypto_Base64;
haxe_crypto_Base64.__name__ = "haxe.crypto.Base64";
haxe_crypto_Base64.encode = function(bytes,complement) {
	if(complement == null) {
		complement = true;
	}
	var str = new haxe_crypto_BaseCode(haxe_crypto_Base64.BYTES).encodeBytes(bytes).toString();
	if(complement) {
		switch(bytes.length % 3) {
		case 1:
			str += "==";
			break;
		case 2:
			str += "=";
			break;
		default:
		}
	}
	return str;
};
haxe_crypto_Base64.decode = function(str,complement) {
	if(complement == null) {
		complement = true;
	}
	if(complement) {
		while(HxOverrides.cca(str,str.length - 1) == 61) str = HxOverrides.substr(str,0,-1);
	}
	return new haxe_crypto_BaseCode(haxe_crypto_Base64.BYTES).decodeBytes(haxe_io_Bytes.ofString(str));
};
var haxe_crypto_BaseCode = function(base) {
	var len = base.length;
	var nbits = 1;
	while(len > 1 << nbits) ++nbits;
	if(nbits > 8 || len != 1 << nbits) {
		throw haxe_Exception.thrown("BaseCode : base length must be a power of two.");
	}
	this.base = base;
	this.nbits = nbits;
};
$hxClasses["haxe.crypto.BaseCode"] = haxe_crypto_BaseCode;
haxe_crypto_BaseCode.__name__ = "haxe.crypto.BaseCode";
haxe_crypto_BaseCode.prototype = {
	base: null
	,nbits: null
	,tbl: null
	,encodeBytes: function(b) {
		var nbits = this.nbits;
		var base = this.base;
		var size = b.length * 8 / nbits | 0;
		var out = new haxe_io_Bytes(new ArrayBuffer(size + (b.length * 8 % nbits == 0 ? 0 : 1)));
		var buf = 0;
		var curbits = 0;
		var mask = (1 << nbits) - 1;
		var pin = 0;
		var pout = 0;
		while(pout < size) {
			while(curbits < nbits) {
				curbits += 8;
				buf <<= 8;
				buf |= b.b[pin++];
			}
			curbits -= nbits;
			out.b[pout++] = base.b[buf >> curbits & mask];
		}
		if(curbits > 0) {
			out.b[pout++] = base.b[buf << nbits - curbits & mask];
		}
		return out;
	}
	,initTable: function() {
		var tbl = [];
		var _g = 0;
		while(_g < 256) {
			var i = _g++;
			tbl[i] = -1;
		}
		var _g = 0;
		var _g1 = this.base.length;
		while(_g < _g1) {
			var i = _g++;
			tbl[this.base.b[i]] = i;
		}
		this.tbl = tbl;
	}
	,decodeBytes: function(b) {
		var nbits = this.nbits;
		var base = this.base;
		if(this.tbl == null) {
			this.initTable();
		}
		var tbl = this.tbl;
		var size = b.length * nbits >> 3;
		var out = new haxe_io_Bytes(new ArrayBuffer(size));
		var buf = 0;
		var curbits = 0;
		var pin = 0;
		var pout = 0;
		while(pout < size) {
			while(curbits < 8) {
				curbits += nbits;
				buf <<= nbits;
				var i = tbl[b.b[pin++]];
				if(i == -1) {
					throw haxe_Exception.thrown("BaseCode : invalid encoded char");
				}
				buf |= i;
			}
			curbits -= 8;
			out.b[pout++] = buf >> curbits & 255;
		}
		return out;
	}
	,__class__: haxe_crypto_BaseCode
};
var haxe_crypto_Md5 = function() {
};
$hxClasses["haxe.crypto.Md5"] = haxe_crypto_Md5;
haxe_crypto_Md5.__name__ = "haxe.crypto.Md5";
haxe_crypto_Md5.encode = function(s) {
	var m = new haxe_crypto_Md5();
	var h = m.doEncode(haxe_crypto_Md5.str2blks(s));
	return m.hex(h);
};
haxe_crypto_Md5.make = function(b) {
	var h = new haxe_crypto_Md5().doEncode(haxe_crypto_Md5.bytes2blks(b));
	var out = new haxe_io_Bytes(new ArrayBuffer(16));
	var p = 0;
	out.b[p++] = h[0] & 255;
	out.b[p++] = h[0] >> 8 & 255;
	out.b[p++] = h[0] >> 16 & 255;
	out.b[p++] = h[0] >>> 24;
	out.b[p++] = h[1] & 255;
	out.b[p++] = h[1] >> 8 & 255;
	out.b[p++] = h[1] >> 16 & 255;
	out.b[p++] = h[1] >>> 24;
	out.b[p++] = h[2] & 255;
	out.b[p++] = h[2] >> 8 & 255;
	out.b[p++] = h[2] >> 16 & 255;
	out.b[p++] = h[2] >>> 24;
	out.b[p++] = h[3] & 255;
	out.b[p++] = h[3] >> 8 & 255;
	out.b[p++] = h[3] >> 16 & 255;
	out.b[p++] = h[3] >>> 24;
	return out;
};
haxe_crypto_Md5.bytes2blks = function(b) {
	var nblk = (b.length + 8 >> 6) + 1;
	var blks = [];
	var blksSize = nblk * 16;
	var _g = 0;
	var _g1 = blksSize;
	while(_g < _g1) {
		var i = _g++;
		blks[i] = 0;
	}
	var i = 0;
	while(i < b.length) {
		blks[i >> 2] |= b.b[i] << (((b.length << 3) + i & 3) << 3);
		++i;
	}
	blks[i >> 2] |= 128 << (b.length * 8 + i) % 4 * 8;
	var l = b.length * 8;
	var k = nblk * 16 - 2;
	blks[k] = l & 255;
	blks[k] |= (l >>> 8 & 255) << 8;
	blks[k] |= (l >>> 16 & 255) << 16;
	blks[k] |= (l >>> 24 & 255) << 24;
	return blks;
};
haxe_crypto_Md5.str2blks = function(str) {
	var str1 = haxe_io_Bytes.ofString(str);
	var nblk = (str1.length + 8 >> 6) + 1;
	var blks = [];
	var blksSize = nblk * 16;
	var _g = 0;
	var _g1 = blksSize;
	while(_g < _g1) {
		var i = _g++;
		blks[i] = 0;
	}
	var i = 0;
	var max = str1.length;
	var l = max * 8;
	while(i < max) {
		blks[i >> 2] |= str1.b[i] << (l + i) % 4 * 8;
		++i;
	}
	blks[i >> 2] |= 128 << (l + i) % 4 * 8;
	var k = nblk * 16 - 2;
	blks[k] = l & 255;
	blks[k] |= (l >>> 8 & 255) << 8;
	blks[k] |= (l >>> 16 & 255) << 16;
	blks[k] |= (l >>> 24 & 255) << 24;
	return blks;
};
haxe_crypto_Md5.prototype = {
	bitOR: function(a,b) {
		var lsb = a & 1 | b & 1;
		var msb31 = a >>> 1 | b >>> 1;
		return msb31 << 1 | lsb;
	}
	,bitXOR: function(a,b) {
		var lsb = a & 1 ^ b & 1;
		var msb31 = a >>> 1 ^ b >>> 1;
		return msb31 << 1 | lsb;
	}
	,bitAND: function(a,b) {
		var lsb = a & 1 & (b & 1);
		var msb31 = a >>> 1 & b >>> 1;
		return msb31 << 1 | lsb;
	}
	,addme: function(x,y) {
		var lsw = (x & 65535) + (y & 65535);
		var msw = (x >> 16) + (y >> 16) + (lsw >> 16);
		return msw << 16 | lsw & 65535;
	}
	,hex: function(a) {
		var str = "";
		var hex_chr = "0123456789abcdef";
		var _g = 0;
		while(_g < a.length) {
			var num = a[_g];
			++_g;
			str += hex_chr.charAt(num >> 4 & 15) + hex_chr.charAt(num & 15);
			str += hex_chr.charAt(num >> 12 & 15) + hex_chr.charAt(num >> 8 & 15);
			str += hex_chr.charAt(num >> 20 & 15) + hex_chr.charAt(num >> 16 & 15);
			str += hex_chr.charAt(num >> 28 & 15) + hex_chr.charAt(num >> 24 & 15);
		}
		return str;
	}
	,rol: function(num,cnt) {
		return num << cnt | num >>> 32 - cnt;
	}
	,cmn: function(q,a,b,x,s,t) {
		return this.addme(this.rol(this.addme(this.addme(a,q),this.addme(x,t)),s),b);
	}
	,ff: function(a,b,c,d,x,s,t) {
		return this.cmn(this.bitOR(this.bitAND(b,c),this.bitAND(~b,d)),a,b,x,s,t);
	}
	,gg: function(a,b,c,d,x,s,t) {
		return this.cmn(this.bitOR(this.bitAND(b,d),this.bitAND(c,~d)),a,b,x,s,t);
	}
	,hh: function(a,b,c,d,x,s,t) {
		return this.cmn(this.bitXOR(this.bitXOR(b,c),d),a,b,x,s,t);
	}
	,ii: function(a,b,c,d,x,s,t) {
		return this.cmn(this.bitXOR(c,this.bitOR(b,~d)),a,b,x,s,t);
	}
	,doEncode: function(x) {
		var a = 1732584193;
		var b = -271733879;
		var c = -1732584194;
		var d = 271733878;
		var step;
		var i = 0;
		while(i < x.length) {
			var olda = a;
			var oldb = b;
			var oldc = c;
			var oldd = d;
			step = 0;
			a = this.ff(a,b,c,d,x[i],7,-680876936);
			d = this.ff(d,a,b,c,x[i + 1],12,-389564586);
			c = this.ff(c,d,a,b,x[i + 2],17,606105819);
			b = this.ff(b,c,d,a,x[i + 3],22,-1044525330);
			a = this.ff(a,b,c,d,x[i + 4],7,-176418897);
			d = this.ff(d,a,b,c,x[i + 5],12,1200080426);
			c = this.ff(c,d,a,b,x[i + 6],17,-1473231341);
			b = this.ff(b,c,d,a,x[i + 7],22,-45705983);
			a = this.ff(a,b,c,d,x[i + 8],7,1770035416);
			d = this.ff(d,a,b,c,x[i + 9],12,-1958414417);
			c = this.ff(c,d,a,b,x[i + 10],17,-42063);
			b = this.ff(b,c,d,a,x[i + 11],22,-1990404162);
			a = this.ff(a,b,c,d,x[i + 12],7,1804603682);
			d = this.ff(d,a,b,c,x[i + 13],12,-40341101);
			c = this.ff(c,d,a,b,x[i + 14],17,-1502002290);
			b = this.ff(b,c,d,a,x[i + 15],22,1236535329);
			a = this.gg(a,b,c,d,x[i + 1],5,-165796510);
			d = this.gg(d,a,b,c,x[i + 6],9,-1069501632);
			c = this.gg(c,d,a,b,x[i + 11],14,643717713);
			b = this.gg(b,c,d,a,x[i],20,-373897302);
			a = this.gg(a,b,c,d,x[i + 5],5,-701558691);
			d = this.gg(d,a,b,c,x[i + 10],9,38016083);
			c = this.gg(c,d,a,b,x[i + 15],14,-660478335);
			b = this.gg(b,c,d,a,x[i + 4],20,-405537848);
			a = this.gg(a,b,c,d,x[i + 9],5,568446438);
			d = this.gg(d,a,b,c,x[i + 14],9,-1019803690);
			c = this.gg(c,d,a,b,x[i + 3],14,-187363961);
			b = this.gg(b,c,d,a,x[i + 8],20,1163531501);
			a = this.gg(a,b,c,d,x[i + 13],5,-1444681467);
			d = this.gg(d,a,b,c,x[i + 2],9,-51403784);
			c = this.gg(c,d,a,b,x[i + 7],14,1735328473);
			b = this.gg(b,c,d,a,x[i + 12],20,-1926607734);
			a = this.hh(a,b,c,d,x[i + 5],4,-378558);
			d = this.hh(d,a,b,c,x[i + 8],11,-2022574463);
			c = this.hh(c,d,a,b,x[i + 11],16,1839030562);
			b = this.hh(b,c,d,a,x[i + 14],23,-35309556);
			a = this.hh(a,b,c,d,x[i + 1],4,-1530992060);
			d = this.hh(d,a,b,c,x[i + 4],11,1272893353);
			c = this.hh(c,d,a,b,x[i + 7],16,-155497632);
			b = this.hh(b,c,d,a,x[i + 10],23,-1094730640);
			a = this.hh(a,b,c,d,x[i + 13],4,681279174);
			d = this.hh(d,a,b,c,x[i],11,-358537222);
			c = this.hh(c,d,a,b,x[i + 3],16,-722521979);
			b = this.hh(b,c,d,a,x[i + 6],23,76029189);
			a = this.hh(a,b,c,d,x[i + 9],4,-640364487);
			d = this.hh(d,a,b,c,x[i + 12],11,-421815835);
			c = this.hh(c,d,a,b,x[i + 15],16,530742520);
			b = this.hh(b,c,d,a,x[i + 2],23,-995338651);
			a = this.ii(a,b,c,d,x[i],6,-198630844);
			d = this.ii(d,a,b,c,x[i + 7],10,1126891415);
			c = this.ii(c,d,a,b,x[i + 14],15,-1416354905);
			b = this.ii(b,c,d,a,x[i + 5],21,-57434055);
			a = this.ii(a,b,c,d,x[i + 12],6,1700485571);
			d = this.ii(d,a,b,c,x[i + 3],10,-1894986606);
			c = this.ii(c,d,a,b,x[i + 10],15,-1051523);
			b = this.ii(b,c,d,a,x[i + 1],21,-2054922799);
			a = this.ii(a,b,c,d,x[i + 8],6,1873313359);
			d = this.ii(d,a,b,c,x[i + 15],10,-30611744);
			c = this.ii(c,d,a,b,x[i + 6],15,-1560198380);
			b = this.ii(b,c,d,a,x[i + 13],21,1309151649);
			a = this.ii(a,b,c,d,x[i + 4],6,-145523070);
			d = this.ii(d,a,b,c,x[i + 11],10,-1120210379);
			c = this.ii(c,d,a,b,x[i + 2],15,718787259);
			b = this.ii(b,c,d,a,x[i + 9],21,-343485551);
			a = this.addme(a,olda);
			b = this.addme(b,oldb);
			c = this.addme(c,oldc);
			d = this.addme(d,oldd);
			i += 16;
		}
		return [a,b,c,d];
	}
	,__class__: haxe_crypto_Md5
};
var haxe_crypto_mode_CBC = function() { };
$hxClasses["haxe.crypto.mode.CBC"] = haxe_crypto_mode_CBC;
haxe_crypto_mode_CBC.__name__ = "haxe.crypto.mode.CBC";
haxe_crypto_mode_CBC.encrypt = function(src,iv,blockSize,encryptBlock) {
	var vector = iv.b.bufferValue;
	var i = 0;
	var len = src.length;
	var ivpos = 0;
	while(i < len) {
		var _g = 0;
		var _g1 = blockSize;
		while(_g < _g1) {
			var j = _g++;
			src.b[i + j] ^= vector.bytes[ivpos + j];
		}
		encryptBlock(src,i,src,i);
		ivpos = i;
		vector = src.b.bufferValue;
		i += blockSize;
	}
};
haxe_crypto_mode_CBC.decrypt = function(src,iv,blockSize,decryptBlock) {
	var vpos = src.length - blockSize;
	var i = src.length;
	while(i > 0) {
		i -= blockSize;
		vpos -= blockSize;
		decryptBlock(src,i,src,i);
		if(vpos < 0) {
			var _g = 0;
			var _g1 = blockSize;
			while(_g < _g1) {
				var j = _g++;
				src.b[j] ^= iv.b[j];
			}
		} else {
			var _g2 = 0;
			var _g3 = blockSize;
			while(_g2 < _g3) {
				var j1 = _g2++;
				src.b[i + j1] ^= src.b[vpos + j1];
			}
		}
	}
};
var haxe_crypto_mode_CCM = function() { };
$hxClasses["haxe.crypto.mode.CCM"] = haxe_crypto_mode_CCM;
haxe_crypto_mode_CCM.__name__ = "haxe.crypto.mode.CCM";
haxe_crypto_mode_CCM.encrypt = function(src,nonce,aad,tagLen,blockSize,encryptBlock) {
	if(nonce.length < 7 || nonce.length > 13) {
		throw haxe_Exception.thrown("Nonce length must be between 7 and 13 bytes");
	}
	if(tagLen < 4 || tagLen > 16 || (tagLen & 1) != 0) {
		throw haxe_Exception.thrown("Tag length must be even and between 4 and 16 bytes");
	}
	var L = 15 - nonce.length;
	var hasAAD = aad.length > 0;
	var M_prime = tagLen - 2 >> 1;
	var L_prime = L - 1;
	var flags = (hasAAD ? 64 : 0) | M_prime << 3 | L_prime;
	var B0 = new haxe_io_Bytes(new ArrayBuffer(blockSize));
	B0.b[0] = flags;
	B0.blit(1,nonce,0,nonce.length);
	var msgLen = src.length;
	var pos = 15;
	while(msgLen > 0) {
		B0.b[pos] = msgLen & 255;
		msgLen >>>= 8;
		--pos;
	}
	var authBlocks = haxe_crypto_mode_CCM.createAuthBlocks(B0,aad,src,blockSize);
	var tag = haxe_crypto_mode_CCM.computeCBCMac(authBlocks,blockSize,encryptBlock);
	var ciphertext = haxe_crypto_mode_CCM.encryptCTR(nonce,src,blockSize,encryptBlock);
	var encryptedTag = haxe_crypto_mode_CCM.encryptTag(nonce,tag,tagLen,blockSize,encryptBlock);
	var result = new haxe_io_Bytes(new ArrayBuffer(ciphertext.length + tagLen));
	result.blit(0,ciphertext,0,ciphertext.length);
	result.blit(ciphertext.length,encryptedTag,0,tagLen);
	return result;
};
haxe_crypto_mode_CCM.decrypt = function(ciphertextWithTag,nonce,aad,tagLen,blockSize,encryptBlock) {
	if(nonce.length < 7 || nonce.length > 13) {
		throw haxe_Exception.thrown("Nonce length must be between 7 and 13 bytes");
	}
	if(tagLen < 4 || tagLen > 16 || (tagLen & 1) != 0) {
		throw haxe_Exception.thrown("Tag length must be even and between 4 and 16 bytes");
	}
	if(ciphertextWithTag.length < tagLen) {
		throw haxe_Exception.thrown("Ciphertext too short for specified tag length");
	}
	var ciphertextLen = ciphertextWithTag.length - tagLen;
	var src = ciphertextWithTag.sub(0,ciphertextLen);
	var providedTag = ciphertextWithTag.sub(ciphertextLen,tagLen);
	var plaintext = haxe_crypto_mode_CCM.encryptCTR(nonce,src,blockSize,encryptBlock);
	var L = 15 - nonce.length;
	var hasAAD = aad.length > 0;
	var M_prime = tagLen - 2 >> 1;
	var L_prime = L - 1;
	var flags = (hasAAD ? 64 : 0) | M_prime << 3 | L_prime;
	var B0 = new haxe_io_Bytes(new ArrayBuffer(blockSize));
	B0.b[0] = flags;
	B0.blit(1,nonce,0,nonce.length);
	var msgLen = plaintext.length;
	var pos = 15;
	while(msgLen > 0) {
		B0.b[pos] = msgLen & 255;
		msgLen >>>= 8;
		--pos;
	}
	var authBlocks = haxe_crypto_mode_CCM.createAuthBlocks(B0,aad,plaintext,blockSize);
	var computedTag = haxe_crypto_mode_CCM.computeCBCMac(authBlocks,blockSize,encryptBlock);
	var encryptedComputedTag = haxe_crypto_mode_CCM.encryptTag(nonce,computedTag,tagLen,blockSize,encryptBlock);
	if(!haxe_crypto_mode_CCM.constantTimeCompare(encryptedComputedTag,providedTag)) {
		throw haxe_Exception.thrown("Authentication failed");
	}
	return plaintext;
};
haxe_crypto_mode_CCM.createAuthBlocks = function(B0,aad,message,blockSize) {
	var blocks = [];
	blocks.push(B0);
	if(aad.length > 0) {
		var formattedAAD = haxe_crypto_mode_CCM.formatAuthData(aad);
		var pos = 0;
		var remaining = formattedAAD.length;
		while(remaining > 0) {
			var block = new haxe_io_Bytes(new ArrayBuffer(blockSize));
			var bytesToCopy = remaining < blockSize ? remaining : blockSize;
			block.blit(0,formattedAAD,pos,bytesToCopy);
			blocks.push(block);
			pos += blockSize;
			remaining -= blockSize;
		}
	}
	if(message.length > 0) {
		var pos = 0;
		var remaining = message.length;
		while(remaining > 0) {
			var block = new haxe_io_Bytes(new ArrayBuffer(blockSize));
			var bytesToCopy = remaining < blockSize ? remaining : blockSize;
			block.blit(0,message,pos,bytesToCopy);
			blocks.push(block);
			pos += blockSize;
			remaining -= blockSize;
		}
	}
	return blocks;
};
haxe_crypto_mode_CCM.computeCBCMac = function(blocks,blockSize,encryptBlock) {
	var X = new haxe_io_Bytes(new ArrayBuffer(blockSize));
	var blocksLen = blocks.length;
	var _g = 0;
	var _g1 = blocksLen;
	while(_g < _g1) {
		var i = _g++;
		var currentBlock = blocks[i];
		var _g2 = 0;
		var _g3 = blockSize;
		while(_g2 < _g3) {
			var j = _g2++;
			X.b[j] ^= currentBlock.b[j];
		}
		encryptBlock(X,0,X,0);
	}
	return X;
};
haxe_crypto_mode_CCM.formatAuthData = function(aad) {
	if(aad.length == 0) {
		return new haxe_io_Bytes(new ArrayBuffer(0));
	}
	var len = aad.length;
	var authData;
	if(len < 65280) {
		authData = new haxe_io_Bytes(new ArrayBuffer(2 + len));
		authData.b[0] = len >>> 8;
		authData.b[1] = len & 255;
		authData.blit(2,aad,0,len);
	} else if(len <= -1) {
		authData = new haxe_io_Bytes(new ArrayBuffer(6 + len));
		authData.b[0] = 255;
		authData.b[1] = 254;
		authData.b[2] = len >>> 24;
		authData.b[3] = len >>> 16 & 255;
		authData.b[4] = len >>> 8 & 255;
		authData.b[5] = len & 255;
		authData.blit(6,aad,0,len);
	} else {
		authData = new haxe_io_Bytes(new ArrayBuffer(10 + len));
		authData.b[0] = 255;
		authData.b[1] = 255;
		authData.b[2] = 0;
		authData.b[3] = 0;
		authData.b[4] = 0;
		authData.b[5] = 0;
		authData.b[6] = len >>> 24;
		authData.b[7] = len >>> 16 & 255;
		authData.b[8] = len >>> 8 & 255;
		authData.b[9] = len & 255;
		authData.blit(10,aad,0,len);
	}
	return authData;
};
haxe_crypto_mode_CCM.encryptCTR = function(nonce,message,blockSize,encryptBlock) {
	if(message.length == 0) {
		return new haxe_io_Bytes(new ArrayBuffer(0));
	}
	var result = new haxe_io_Bytes(new ArrayBuffer(message.length));
	var counter = new haxe_io_Bytes(new ArrayBuffer(blockSize));
	var keystream = new haxe_io_Bytes(new ArrayBuffer(blockSize));
	var L = 15 - nonce.length;
	var L_prime = L - 1;
	counter.b[0] = L_prime;
	counter.blit(1,nonce,0,nonce.length);
	var pos = 0;
	var counterValue = 1;
	var remaining = message.length;
	while(remaining > 0) {
		var tempCounter = counterValue;
		var counterPos = 15;
		while(tempCounter > 0) {
			counter.b[counterPos] = tempCounter & 255;
			tempCounter >>>= 8;
			--counterPos;
		}
		encryptBlock(counter,0,keystream,0);
		var bytesToProcess = remaining < blockSize ? remaining : blockSize;
		var _g = 0;
		var _g1 = bytesToProcess;
		while(_g < _g1) {
			var j = _g++;
			result.b[pos + j] = message.b[pos + j] ^ keystream.b[j];
		}
		pos += blockSize;
		remaining -= blockSize;
		++counterValue;
	}
	return result;
};
haxe_crypto_mode_CCM.encryptTag = function(nonce,tag,tagLen,blockSize,encryptBlock) {
	var counter = new haxe_io_Bytes(new ArrayBuffer(blockSize));
	var L = 15 - nonce.length;
	var L_prime = L - 1;
	counter.b[0] = L_prime;
	counter.blit(1,nonce,0,nonce.length);
	var keystream = new haxe_io_Bytes(new ArrayBuffer(blockSize));
	encryptBlock(counter,0,keystream,0);
	var encryptedTag = new haxe_io_Bytes(new ArrayBuffer(tagLen));
	var _g = 0;
	var _g1 = tagLen;
	while(_g < _g1) {
		var i = _g++;
		encryptedTag.b[i] = tag.b[i] ^ keystream.b[i];
	}
	return encryptedTag;
};
haxe_crypto_mode_CCM.constantTimeCompare = function(a,b) {
	if(a.length != b.length) {
		return false;
	}
	var result = 0;
	var len = a.length;
	var _g = 0;
	var _g1 = len;
	while(_g < _g1) {
		var i = _g++;
		result |= a.b[i] ^ b.b[i];
	}
	return result == 0;
};
var haxe_crypto_mode_CFB = function() { };
$hxClasses["haxe.crypto.mode.CFB"] = haxe_crypto_mode_CFB;
haxe_crypto_mode_CFB.__name__ = "haxe.crypto.mode.CFB";
haxe_crypto_mode_CFB.encrypt = function(src,iv,blockSize,encryptBlock) {
	var vector = iv.sub(0,iv.length);
	var i = 0;
	var len = src.length;
	while(i < len) {
		encryptBlock(vector,0,vector,0);
		var block = i + blockSize > len ? len - i : blockSize;
		var _g = 0;
		var _g1 = block;
		while(_g < _g1) {
			var j = _g++;
			src.b[i + j] ^= vector.b[j];
			vector.b[j] = src.b[i + j];
		}
		i += blockSize;
	}
};
haxe_crypto_mode_CFB.decrypt = function(src,iv,blockSize,decryptBlock) {
	var vector = iv.sub(0,iv.length);
	var i = 0;
	var len = src.length;
	var vectorResult = new haxe_io_Bytes(new ArrayBuffer(iv.length));
	while(i < len) {
		decryptBlock(vector,0,vectorResult,0);
		var block = i + blockSize > len ? len - i : blockSize;
		var _g = 0;
		var _g1 = block;
		while(_g < _g1) {
			var j = _g++;
			vector.b[j] = src.b[i + j];
			src.b[i + j] ^= vectorResult.b[j];
		}
		i += blockSize;
	}
};
var haxe_crypto_mode_CMAC = function() { };
$hxClasses["haxe.crypto.mode.CMAC"] = haxe_crypto_mode_CMAC;
haxe_crypto_mode_CMAC.__name__ = "haxe.crypto.mode.CMAC";
haxe_crypto_mode_CMAC.calculate = function(message,key) {
	if(haxe_crypto_mode_CMAC.aes == null) {
		haxe_crypto_mode_CMAC.aes = new haxe_crypto_Aes(key);
	} else {
		haxe_crypto_mode_CMAC.aes.init(key);
	}
	return haxe_crypto_mode_CMAC.generate(message,key,16,($_=haxe_crypto_mode_CMAC.aes,$bind($_,$_.encryptBlock)));
};
haxe_crypto_mode_CMAC.generate = function(message,key,blockSize,encryptBlock) {
	var subkeys = haxe_crypto_mode_CMAC.generateSubkeys(key,blockSize,encryptBlock);
	var k1 = subkeys.k1;
	var k2 = subkeys.k2;
	var messageLen = message.length;
	var numBlocks = Math.ceil(messageLen / blockSize);
	if(numBlocks == 0) {
		numBlocks = 1;
	}
	var lastBlock;
	var isComplete;
	if(messageLen == 0) {
		lastBlock = new haxe_io_Bytes(new ArrayBuffer(blockSize));
		lastBlock.b[0] = 128;
		isComplete = false;
	} else if(messageLen % blockSize == 0) {
		lastBlock = message.sub(messageLen - blockSize,blockSize);
		isComplete = true;
	} else {
		var remainingBytes = messageLen % blockSize;
		lastBlock = new haxe_io_Bytes(new ArrayBuffer(blockSize));
		lastBlock.blit(0,message,messageLen - remainingBytes,remainingBytes);
		lastBlock.b[remainingBytes] = 128;
		isComplete = false;
	}
	var keyToUse = isComplete ? k1 : k2;
	var _g = 0;
	var _g1 = blockSize;
	while(_g < _g1) {
		var i = _g++;
		lastBlock.b[i] ^= keyToUse.b[i];
	}
	var mac = new haxe_io_Bytes(new ArrayBuffer(blockSize));
	var fullBlocks = isComplete ? numBlocks - 1 : numBlocks - 1;
	var _g = 0;
	var _g1 = fullBlocks;
	while(_g < _g1) {
		var blockIndex = _g++;
		var offset = blockIndex * blockSize;
		var _g2 = 0;
		var _g3 = blockSize;
		while(_g2 < _g3) {
			var i = _g2++;
			mac.b[i] ^= message.b[offset + i];
		}
		encryptBlock(mac,0,mac,0);
	}
	var _g = 0;
	var _g1 = blockSize;
	while(_g < _g1) {
		var i = _g++;
		mac.b[i] ^= lastBlock.b[i];
	}
	encryptBlock(mac,0,mac,0);
	return mac;
};
haxe_crypto_mode_CMAC.verify = function(message,tag,key,encryptBlock) {
	if(encryptBlock == null) {
		if(haxe_crypto_mode_CMAC.aes == null) {
			haxe_crypto_mode_CMAC.aes = new haxe_crypto_Aes(key);
		} else {
			haxe_crypto_mode_CMAC.aes.init(key);
		}
		encryptBlock = ($_=haxe_crypto_mode_CMAC.aes,$bind($_,$_.encryptBlock));
	}
	var computedTag = haxe_crypto_mode_CMAC.generate(message,key,16,encryptBlock);
	if(tag.length != computedTag.length) {
		return false;
	}
	var result = 0;
	var _g = 0;
	var _g1 = tag.length;
	while(_g < _g1) {
		var i = _g++;
		result |= tag.b[i] ^ computedTag.b[i];
	}
	return result == 0;
};
haxe_crypto_mode_CMAC.generateSubkeys = function(key,blockSize,encryptBlock) {
	var rb;
	if(blockSize == 16) {
		rb = 135;
	} else if(blockSize == 8) {
		rb = 27;
	} else {
		throw haxe_Exception.thrown("Unsupported block size for CMAC");
	}
	var zeroBlock = new haxe_io_Bytes(new ArrayBuffer(blockSize));
	var l = zeroBlock.sub(0,blockSize);
	encryptBlock(l,0,l,0);
	var k1 = haxe_crypto_mode_CMAC.leftShiftOnebit(l);
	if((l.b[0] & 128) != 0) {
		k1.b[blockSize - 1] ^= rb;
	}
	var k2 = haxe_crypto_mode_CMAC.leftShiftOnebit(k1);
	if((k1.b[0] & 128) != 0) {
		k2.b[blockSize - 1] ^= rb;
	}
	return { k1 : k1, k2 : k2};
};
haxe_crypto_mode_CMAC.leftShiftOnebit = function(input) {
	var output = new haxe_io_Bytes(new ArrayBuffer(input.length));
	var carry = 0;
	var _g = 0;
	var _g1 = input.length;
	while(_g < _g1) {
		var i = _g++;
		var b = input.b[input.length - 1 - i];
		output.b[input.length - 1 - i] = (b << 1 | carry) & 255;
		carry = (b & 128) != 0 ? 1 : 0;
	}
	return output;
};
var haxe_crypto_mode_CTR = function() { };
$hxClasses["haxe.crypto.mode.CTR"] = haxe_crypto_mode_CTR;
haxe_crypto_mode_CTR.__name__ = "haxe.crypto.mode.CTR";
haxe_crypto_mode_CTR.encrypt = function(src,iv,blockSize,encryptBlock) {
	var vector = new haxe_io_Bytes(new ArrayBuffer(iv.length));
	var vkey = iv.sub(0,iv.length);
	var i = 0;
	var len = src.length;
	while(i < len) {
		encryptBlock(vkey,0,vector,0);
		var block = i + blockSize > len ? len - i : blockSize;
		var _g = 0;
		var _g1 = block;
		while(_g < _g1) {
			var j = _g++;
			src.b[i + j] ^= vector.b[j];
		}
		var j1 = blockSize;
		while(j1-- >= 0) {
			vkey.b[j1] = vkey.b[j1] + 1 & 255;
			if(vkey.b[j1] != 0) {
				break;
			}
		}
		i += blockSize;
	}
};
haxe_crypto_mode_CTR.decrypt = function(src,iv,blockSize,decryptBlock) {
	haxe_crypto_mode_CTR.encrypt(src,iv,blockSize,decryptBlock);
};
var haxe_crypto_mode_EAX = function() { };
$hxClasses["haxe.crypto.mode.EAX"] = haxe_crypto_mode_EAX;
haxe_crypto_mode_EAX.__name__ = "haxe.crypto.mode.EAX";
haxe_crypto_mode_EAX.encrypt = function(src,key,iv,encryptBlock,aad) {
	var n = haxe_crypto_mode_EAX.omac(0,iv,key,encryptBlock);
	var h;
	if(aad != null && aad.length > 0) {
		var totalAadLength = 0;
		var _g = 0;
		while(_g < aad.length) {
			var aadItem = aad[_g];
			++_g;
			totalAadLength += aadItem.length;
		}
		var combinedAad = new haxe_io_Bytes(new ArrayBuffer(totalAadLength));
		var offset = 0;
		var _g = 0;
		while(_g < aad.length) {
			var aadItem = aad[_g];
			++_g;
			combinedAad.blit(offset,aadItem,0,aadItem.length);
			offset += aadItem.length;
		}
		h = haxe_crypto_mode_EAX.omac(1,combinedAad,key,encryptBlock);
	} else {
		h = haxe_crypto_mode_EAX.omac(1,new haxe_io_Bytes(new ArrayBuffer(0)),key,encryptBlock);
	}
	haxe_crypto_mode_CTR.encrypt(src,n,16,encryptBlock);
	var c = haxe_crypto_mode_EAX.omac(2,src,key,encryptBlock);
	var tag = new haxe_io_Bytes(new ArrayBuffer(16));
	var _g = 0;
	while(_g < 16) {
		var i = _g++;
		tag.b[i] = n.b[i] ^ h.b[i] ^ c.b[i];
	}
	var result = new haxe_io_Bytes(new ArrayBuffer(src.length + 16));
	result.blit(0,src,0,src.length);
	result.blit(src.length,tag,0,16);
	return result;
};
haxe_crypto_mode_EAX.decrypt = function(src,key,iv,encryptBlock,aad) {
	if(src.length < 16) {
		return null;
	}
	var ciphertextLen = src.length - 16;
	var ciphertext = src.sub(0,ciphertextLen);
	var receivedTag = src.sub(ciphertextLen,16);
	var n = haxe_crypto_mode_EAX.omac(0,iv,key,encryptBlock);
	var h;
	if(aad != null && aad.length > 0) {
		var totalAadLength = 0;
		var _g = 0;
		while(_g < aad.length) {
			var aadItem = aad[_g];
			++_g;
			totalAadLength += aadItem.length;
		}
		var combinedAad = new haxe_io_Bytes(new ArrayBuffer(totalAadLength));
		var offset = 0;
		var _g = 0;
		while(_g < aad.length) {
			var aadItem = aad[_g];
			++_g;
			combinedAad.blit(offset,aadItem,0,aadItem.length);
			offset += aadItem.length;
		}
		h = haxe_crypto_mode_EAX.omac(1,combinedAad,key,encryptBlock);
	} else {
		h = haxe_crypto_mode_EAX.omac(1,new haxe_io_Bytes(new ArrayBuffer(0)),key,encryptBlock);
	}
	var c = haxe_crypto_mode_EAX.omac(2,ciphertext,key,encryptBlock);
	var expectedTag = new haxe_io_Bytes(new ArrayBuffer(16));
	var _g = 0;
	while(_g < 16) {
		var i = _g++;
		expectedTag.b[i] = n.b[i] ^ h.b[i] ^ c.b[i];
	}
	if(!haxe_crypto_mode_EAX.constantTimeEquals(receivedTag,expectedTag)) {
		return null;
	}
	var plaintext = new haxe_io_Bytes(new ArrayBuffer(ciphertext.length));
	plaintext.blit(0,ciphertext,0,ciphertext.length);
	haxe_crypto_mode_CTR.decrypt(plaintext,n,16,encryptBlock);
	return plaintext;
};
haxe_crypto_mode_EAX.omac = function(t,message,key,encryptBlock) {
	var prefixedMessage = new haxe_io_Bytes(new ArrayBuffer(16 + message.length));
	var _g = 0;
	var _g1 = 15;
	while(_g < _g1) {
		var i = _g++;
		prefixedMessage.b[i] = 0;
	}
	prefixedMessage.b[15] = t;
	if(message.length > 0) {
		prefixedMessage.blit(16,message,0,message.length);
	}
	return haxe_crypto_mode_CMAC.generate(prefixedMessage,key,16,encryptBlock);
};
haxe_crypto_mode_EAX.constantTimeEquals = function(a,b) {
	if(a.length != b.length) {
		return false;
	}
	var result = 0;
	var _g = 0;
	var _g1 = a.length;
	while(_g < _g1) {
		var i = _g++;
		result |= a.b[i] ^ b.b[i];
	}
	return result == 0;
};
var haxe_crypto_mode_ECB = function() { };
$hxClasses["haxe.crypto.mode.ECB"] = haxe_crypto_mode_ECB;
haxe_crypto_mode_ECB.__name__ = "haxe.crypto.mode.ECB";
haxe_crypto_mode_ECB.encrypt = function(src,blockSize,encryptBlock) {
	var i = 0;
	var len = src.length;
	while(i < len) {
		encryptBlock(src,i,src,i);
		i += blockSize;
	}
};
haxe_crypto_mode_ECB.decrypt = function(src,blockSize,decryptBlock) {
	var i = 0;
	var len = src.length;
	while(i < len) {
		decryptBlock(src,i,src,i);
		i += blockSize;
	}
};
var haxe_crypto_mode_GCM = function() { };
$hxClasses["haxe.crypto.mode.GCM"] = haxe_crypto_mode_GCM;
haxe_crypto_mode_GCM.__name__ = "haxe.crypto.mode.GCM";
haxe_crypto_mode_GCM.encrypt = function(src,iv,aad,tagLen,blockSize,encryptBlock) {
	if(tagLen < 4 || tagLen > 16) {
		throw haxe_Exception.thrown("Tag length must be between 4 and 16 bytes (32-128 bits)");
	}
	if(aad == null) {
		aad = new haxe_io_Bytes(new ArrayBuffer(0));
	}
	var H = new haxe_io_Bytes(new ArrayBuffer(blockSize));
	encryptBlock(new haxe_io_Bytes(new ArrayBuffer(blockSize)),0,H,0);
	var J0 = haxe_crypto_mode_GCM.calculateJ0(H,iv);
	var counter = haxe_crypto_mode_GCM.incrementCounter(J0);
	var ciphertext = src.sub(0,src.length);
	haxe_crypto_mode_CTR.encrypt(ciphertext,counter,blockSize,encryptBlock);
	var tag = haxe_crypto_mode_GCM.calculateTag(H,aad,ciphertext,J0,encryptBlock);
	var result = new haxe_io_Bytes(new ArrayBuffer(ciphertext.length + tagLen));
	result.blit(0,ciphertext,0,ciphertext.length);
	result.blit(ciphertext.length,tag,0,tagLen);
	return result;
};
haxe_crypto_mode_GCM.decrypt = function(ciphertextWithTag,iv,aad,tagLen,blockSize,encryptBlock) {
	if(tagLen < 4 || tagLen > 16) {
		throw haxe_Exception.thrown("Tag length must be between 4 and 16 bytes (32-128 bits)");
	}
	if(ciphertextWithTag.length < tagLen) {
		throw haxe_Exception.thrown("Ciphertext too short for specified tag length");
	}
	var ciphertextLen = ciphertextWithTag.length - tagLen;
	var ciphertext = ciphertextWithTag.sub(0,ciphertextLen);
	var providedTag = ciphertextWithTag.sub(ciphertextLen,tagLen);
	var H = new haxe_io_Bytes(new ArrayBuffer(blockSize));
	encryptBlock(new haxe_io_Bytes(new ArrayBuffer(blockSize)),0,H,0);
	var J0 = haxe_crypto_mode_GCM.calculateJ0(H,iv);
	var computedTag = haxe_crypto_mode_GCM.calculateTag(H,aad,ciphertext,J0,encryptBlock);
	var truncatedComputedTag = computedTag.sub(0,tagLen);
	if(!haxe_crypto_mode_GCM.constantTimeCompare(truncatedComputedTag,providedTag)) {
		throw haxe_Exception.thrown("Authentication failed");
	}
	var counter = haxe_crypto_mode_GCM.incrementCounter(J0);
	var plaintext = ciphertext.sub(0,ciphertext.length);
	haxe_crypto_mode_CTR.encrypt(plaintext,counter,blockSize,encryptBlock);
	return plaintext;
};
haxe_crypto_mode_GCM.calculateJ0 = function(H,iv) {
	if(iv.length == 12) {
		var J0 = new haxe_io_Bytes(new ArrayBuffer(16));
		J0.blit(0,iv,0,12);
		J0.b[15] = 1;
		return J0;
	} else {
		var J0 = new haxe_io_Bytes(new ArrayBuffer(16));
		J0 = haxe_crypto_mode_GCM.ghashUpdate(H,J0,iv);
		var lenBlock = new haxe_io_Bytes(new ArrayBuffer(16));
		var ivBitLen = iv.length * 8;
		lenBlock.b[12] = ivBitLen >>> 24 & 255;
		lenBlock.b[13] = ivBitLen >>> 16 & 255;
		lenBlock.b[14] = ivBitLen >>> 8 & 255;
		lenBlock.b[15] = ivBitLen & 255;
		J0 = haxe_crypto_mode_GCM.ghashUpdate(H,J0,lenBlock);
		return J0;
	}
};
haxe_crypto_mode_GCM.incrementCounter = function(counter) {
	var result = counter.sub(0,counter.length);
	var carry = 1;
	var i = 15;
	while(carry > 0 && i >= 12) {
		var val = result.b[i] + carry;
		result.b[i] = val & 255;
		carry = val >>> 8;
		--i;
	}
	return result;
};
haxe_crypto_mode_GCM.calculateTag = function(H,aad,ciphertext,J0,encryptBlock) {
	var authData = haxe_crypto_mode_GCM.ghash(H,aad,ciphertext);
	var encryptedJ0 = new haxe_io_Bytes(new ArrayBuffer(16));
	encryptBlock(J0,0,encryptedJ0,0);
	authData.b[0] ^= encryptedJ0.b[0];
	authData.b[1] ^= encryptedJ0.b[1];
	authData.b[2] ^= encryptedJ0.b[2];
	authData.b[3] ^= encryptedJ0.b[3];
	authData.b[4] ^= encryptedJ0.b[4];
	authData.b[5] ^= encryptedJ0.b[5];
	authData.b[6] ^= encryptedJ0.b[6];
	authData.b[7] ^= encryptedJ0.b[7];
	authData.b[8] ^= encryptedJ0.b[8];
	authData.b[9] ^= encryptedJ0.b[9];
	authData.b[10] ^= encryptedJ0.b[10];
	authData.b[11] ^= encryptedJ0.b[11];
	authData.b[12] ^= encryptedJ0.b[12];
	authData.b[13] ^= encryptedJ0.b[13];
	authData.b[14] ^= encryptedJ0.b[14];
	authData.b[15] ^= encryptedJ0.b[15];
	return authData;
};
haxe_crypto_mode_GCM.ghash = function(H,aad,ciphertext) {
	var X = new haxe_io_Bytes(new ArrayBuffer(16));
	if(aad.length > 0) {
		X = haxe_crypto_mode_GCM.ghashUpdate(H,X,aad);
	}
	if(ciphertext.length > 0) {
		X = haxe_crypto_mode_GCM.ghashUpdate(H,X,ciphertext);
	}
	var lenBlock = new haxe_io_Bytes(new ArrayBuffer(16));
	var aadBitLen = aad.length * 8;
	var cipherBitLen = ciphertext.length * 8;
	lenBlock.b[4] = aadBitLen >>> 24 & 255;
	lenBlock.b[5] = aadBitLen >>> 16 & 255;
	lenBlock.b[6] = aadBitLen >>> 8 & 255;
	lenBlock.b[7] = aadBitLen & 255;
	lenBlock.b[12] = cipherBitLen >>> 24 & 255;
	lenBlock.b[13] = cipherBitLen >>> 16 & 255;
	lenBlock.b[14] = cipherBitLen >>> 8 & 255;
	lenBlock.b[15] = cipherBitLen & 255;
	X.b[0] ^= lenBlock.b[0];
	X.b[1] ^= lenBlock.b[1];
	X.b[2] ^= lenBlock.b[2];
	X.b[3] ^= lenBlock.b[3];
	X.b[4] ^= lenBlock.b[4];
	X.b[5] ^= lenBlock.b[5];
	X.b[6] ^= lenBlock.b[6];
	X.b[7] ^= lenBlock.b[7];
	X.b[8] ^= lenBlock.b[8];
	X.b[9] ^= lenBlock.b[9];
	X.b[10] ^= lenBlock.b[10];
	X.b[11] ^= lenBlock.b[11];
	X.b[12] ^= lenBlock.b[12];
	X.b[13] ^= lenBlock.b[13];
	X.b[14] ^= lenBlock.b[14];
	X.b[15] ^= lenBlock.b[15];
	X = haxe_crypto_mode_GCM.gmult(X,H);
	return X;
};
haxe_crypto_mode_GCM.ghashUpdate = function(H,state,data) {
	var X = state.sub(0,16);
	var pos = 0;
	var remaining = data.length;
	while(remaining > 0) {
		var block = new haxe_io_Bytes(new ArrayBuffer(16));
		var bytesToCopy = remaining < 16 ? remaining : 16;
		block.blit(0,data,pos,bytesToCopy);
		X.b[0] ^= block.b[0];
		X.b[1] ^= block.b[1];
		X.b[2] ^= block.b[2];
		X.b[3] ^= block.b[3];
		X.b[4] ^= block.b[4];
		X.b[5] ^= block.b[5];
		X.b[6] ^= block.b[6];
		X.b[7] ^= block.b[7];
		X.b[8] ^= block.b[8];
		X.b[9] ^= block.b[9];
		X.b[10] ^= block.b[10];
		X.b[11] ^= block.b[11];
		X.b[12] ^= block.b[12];
		X.b[13] ^= block.b[13];
		X.b[14] ^= block.b[14];
		X.b[15] ^= block.b[15];
		X = haxe_crypto_mode_GCM.gmult(X,H);
		pos += 16;
		remaining -= 16;
	}
	return X;
};
haxe_crypto_mode_GCM.xorBytes = function(a,b) {
	var result = new haxe_io_Bytes(new ArrayBuffer(a.length));
	var len = a.length;
	var _g = 0;
	var _g1 = len;
	while(_g < _g1) {
		var i = _g++;
		result.b[i] = a.b[i] ^ b.b[i];
	}
	return result;
};
haxe_crypto_mode_GCM.gmult = function(X,Y) {
	var Z = new haxe_io_Bytes(new ArrayBuffer(16));
	var V = Y.sub(0,16);
	var _g = 0;
	while(_g < 128) {
		var i = _g++;
		var byteIndex = i >>> 3;
		var bitIndex = 7 - (i & 7);
		var bit = X.b[byteIndex] >>> bitIndex & 1;
		if(bit == 1) {
			Z.b[0] ^= V.b[0];
			Z.b[1] ^= V.b[1];
			Z.b[2] ^= V.b[2];
			Z.b[3] ^= V.b[3];
			Z.b[4] ^= V.b[4];
			Z.b[5] ^= V.b[5];
			Z.b[6] ^= V.b[6];
			Z.b[7] ^= V.b[7];
			Z.b[8] ^= V.b[8];
			Z.b[9] ^= V.b[9];
			Z.b[10] ^= V.b[10];
			Z.b[11] ^= V.b[11];
			Z.b[12] ^= V.b[12];
			Z.b[13] ^= V.b[13];
			Z.b[14] ^= V.b[14];
			Z.b[15] ^= V.b[15];
		}
		var lsb = V.b[15] & 1;
		var carry = 0;
		var _g1 = 0;
		while(_g1 < 16) {
			var j = _g1++;
			var b = V.b[j];
			var newCarry = (b & 1) << 7;
			V.b[j] = b >>> 1 | carry;
			carry = newCarry;
		}
		if(lsb == 1) {
			V.b[0] ^= 225;
		}
	}
	return Z;
};
haxe_crypto_mode_GCM.constantTimeCompare = function(a,b) {
	if(a.length != b.length) {
		return false;
	}
	var result = 0;
	var len = a.length;
	var _g = 0;
	var _g1 = len;
	while(_g < _g1) {
		var i = _g++;
		result |= a.b[i] ^ b.b[i];
	}
	return result == 0;
};
var haxe_crypto_mode_GCMSIV = function() { };
$hxClasses["haxe.crypto.mode.GCMSIV"] = haxe_crypto_mode_GCMSIV;
haxe_crypto_mode_GCMSIV.__name__ = "haxe.crypto.mode.GCMSIV";
haxe_crypto_mode_GCMSIV.encrypt = function(key,nonce,plaintext,aad,encryptBlock,initKey) {
	if(key.length != 16 && key.length != 32) {
		throw haxe_Exception.thrown("Invalid key length");
	}
	if(nonce.length != haxe_crypto_mode_GCMSIV.NONCE_SIZE) {
		throw haxe_Exception.thrown("Invalid nonce length");
	}
	var aes128 = key.length == 16;
	var authKey = haxe_crypto_mode_GCMSIV.subKey(0,1,nonce,encryptBlock);
	var encKey = haxe_crypto_mode_GCMSIV.subKey(2,aes128 ? 3 : 5,nonce,encryptBlock);
	initKey(encKey);
	var tag = haxe_crypto_mode_GCMSIV.hash(encKey,authKey,nonce,plaintext,aad,encryptBlock);
	var output = new haxe_io_Bytes(new ArrayBuffer(plaintext.length + haxe_crypto_mode_GCMSIV.AES_BLOCK_SIZE));
	if(plaintext.length > 0) {
		output.blit(0,plaintext,0,plaintext.length);
		haxe_crypto_mode_GCMSIV.aesCTR(encKey,tag,plaintext,output,encryptBlock);
	}
	initKey(key,nonce);
	output.blit(plaintext.length,tag,0,haxe_crypto_mode_GCMSIV.AES_BLOCK_SIZE);
	return output;
};
haxe_crypto_mode_GCMSIV.decrypt = function(key,nonce,ciphertext,aad,encryptBlock,initKey) {
	if(key.length != 16 && key.length != 32) {
		throw haxe_Exception.thrown("Invalid key length");
	}
	if(nonce.length != haxe_crypto_mode_GCMSIV.NONCE_SIZE) {
		throw haxe_Exception.thrown("Invalid nonce length");
	}
	if(ciphertext.length < haxe_crypto_mode_GCMSIV.AES_BLOCK_SIZE) {
		throw haxe_Exception.thrown("Invalid ciphertext length");
	}
	var aes128 = key.length == 16;
	var ctLen = ciphertext.length - haxe_crypto_mode_GCMSIV.AES_BLOCK_SIZE;
	var c = ciphertext.sub(0,ctLen);
	var tag = ciphertext.sub(ctLen,haxe_crypto_mode_GCMSIV.AES_BLOCK_SIZE);
	var authKey = haxe_crypto_mode_GCMSIV.subKey(0,1,nonce,encryptBlock);
	var encKey = haxe_crypto_mode_GCMSIV.subKey(2,aes128 ? 3 : 5,nonce,encryptBlock);
	initKey(encKey);
	var plaintext = new haxe_io_Bytes(new ArrayBuffer(ctLen));
	if(ctLen > 0) {
		plaintext.blit(0,c,0,ctLen);
		haxe_crypto_mode_GCMSIV.aesCTR(encKey,tag,c,plaintext,encryptBlock);
	}
	var actualTag = haxe_crypto_mode_GCMSIV.hash(encKey,authKey,nonce,plaintext,aad,encryptBlock);
	initKey(key,nonce);
	var tmp;
	if(tag.length != actualTag.length) {
		tmp = false;
	} else {
		var result = 0;
		var _g = 0;
		var _g1 = tag.length;
		while(_g < _g1) {
			var i = _g++;
			result |= tag.b[i] ^ actualTag.b[i];
		}
		tmp = result == 0;
	}
	if(!tmp) {
		return null;
	}
	return plaintext;
};
haxe_crypto_mode_GCMSIV.subKey = function(ctrStart,ctrEnd,nonce,encryptBlock) {
	var counter = new haxe_io_Bytes(new ArrayBuffer(haxe_crypto_mode_GCMSIV.AES_BLOCK_SIZE));
	counter.blit(counter.length - nonce.length,nonce,0,nonce.length);
	var keyLen = ctrEnd - ctrStart + 1 << 3;
	var key = new haxe_io_Bytes(new ArrayBuffer(keyLen));
	var block = new haxe_io_Bytes(new ArrayBuffer(haxe_crypto_mode_GCMSIV.AES_BLOCK_SIZE));
	var _g = ctrStart;
	var _g1 = ctrEnd + 1;
	while(_g < _g1) {
		var i = _g++;
		var offset = 0;
		if(offset == null) {
			offset = 0;
		}
		counter.b[offset] = i & 255;
		counter.b[offset + 1] = i >> 8 & 255;
		counter.b[offset + 2] = i >> 16 & 255;
		counter.b[offset + 3] = i >> 24 & 255;
		encryptBlock(counter,0,block,0);
		var keyOffset = i - ctrStart << 3;
		key.blit(keyOffset,block,0,8);
	}
	return key;
};
haxe_crypto_mode_GCMSIV.hash = function(encKey,authKey,nonce,plaintext,aad,encryptBlock) {
	haxe_crypto_mode_GCMSIV.initPolyval(authKey);
	var extra = aad.length & 15;
	var fullBlocks = aad.length - extra;
	var i = 0;
	while(i < fullBlocks) {
		haxe_crypto_mode_GCMSIV.updateBlockPolyval(aad,i);
		i += haxe_crypto_mode_GCMSIV.AES_BLOCK_SIZE;
	}
	if(extra != 0) {
		var block = new haxe_io_Bytes(new ArrayBuffer(haxe_crypto_mode_GCMSIV.AES_BLOCK_SIZE));
		block.blit(0,aad,fullBlocks,extra);
		haxe_crypto_mode_GCMSIV.updateBlockPolyval(block,0);
	}
	var extra = plaintext.length & 15;
	var fullBlocks = plaintext.length - extra;
	var i = 0;
	while(i < fullBlocks) {
		haxe_crypto_mode_GCMSIV.updateBlockPolyval(plaintext,i);
		i += haxe_crypto_mode_GCMSIV.AES_BLOCK_SIZE;
	}
	if(extra != 0) {
		var block = new haxe_io_Bytes(new ArrayBuffer(haxe_crypto_mode_GCMSIV.AES_BLOCK_SIZE));
		block.blit(0,plaintext,fullBlocks,extra);
		haxe_crypto_mode_GCMSIV.updateBlockPolyval(block,0);
	}
	var block = new haxe_io_Bytes(new ArrayBuffer(haxe_crypto_mode_GCMSIV.AES_BLOCK_SIZE));
	var hi = aad.length << 3 & -1;
	block.b[0] = hi & 255;
	block.b[1] = hi >> 8 & 255;
	block.b[2] = hi >> 16 & 255;
	block.b[3] = hi >> 24 & 255;
	block.b[4] = 0;
	block.b[5] = 0;
	block.b[6] = 0;
	block.b[7] = 0;
	var hi = plaintext.length << 3 & -1;
	block.b[8] = hi & 255;
	block.b[9] = hi >> 8 & 255;
	block.b[10] = hi >> 16 & 255;
	block.b[11] = hi >> 24 & 255;
	block.b[12] = 0;
	block.b[13] = 0;
	block.b[14] = 0;
	block.b[15] = 0;
	haxe_crypto_mode_GCMSIV.updateBlockPolyval(block,0);
	var n = haxe_crypto_mode_GCMSIV.s1;
	var hi = n.high;
	var lo = n.low;
	block.b[0] = lo;
	block.b[1] = lo >> 8 & 255;
	block.b[2] = lo >> 16 & 255;
	block.b[3] = lo >> 24 & 255;
	block.b[4] = hi;
	block.b[5] = hi >> 8 & 255;
	block.b[6] = hi >> 16 & 255;
	block.b[7] = hi >> 24 & 255;
	var n = haxe_crypto_mode_GCMSIV.s0;
	var hi = n.high;
	var lo = n.low;
	block.b[8] = lo;
	block.b[9] = lo >> 8 & 255;
	block.b[10] = lo >> 16 & 255;
	block.b[11] = lo >> 24 & 255;
	block.b[12] = hi;
	block.b[13] = hi >> 8 & 255;
	block.b[14] = hi >> 16 & 255;
	block.b[15] = hi >> 24 & 255;
	var _g = 0;
	var _g1 = nonce.length;
	while(_g < _g1) {
		var i = _g++;
		block.b[i] ^= nonce.b[i];
	}
	block.b[haxe_crypto_mode_GCMSIV.AES_BLOCK_SIZE - 1] &= 127;
	var result = new haxe_io_Bytes(new ArrayBuffer(haxe_crypto_mode_GCMSIV.AES_BLOCK_SIZE));
	encryptBlock(block,0,result,0);
	return result;
};
haxe_crypto_mode_GCMSIV.initPolyval = function(authKey) {
	var v3 = authKey.b[0] & 255 | (authKey.b[1] & 255) << 8 | (authKey.b[2] & 255) << 16 | authKey.b[3] << 24;
	var v2 = authKey.b[4] & 255 | (authKey.b[5] & 255) << 8 | (authKey.b[6] & 255) << 16 | authKey.b[7] << 24;
	var v1 = authKey.b[8] & 255 | (authKey.b[9] & 255) << 8 | (authKey.b[10] & 255) << 16 | authKey.b[11] << 24;
	var v0 = authKey.b[12] & 255 | (authKey.b[13] & 255) << 8 | (authKey.b[14] & 255) << 16 | authKey.b[15] << 24;
	var b = v0;
	v0 = b >>> 1;
	var c = b << 31;
	b = v1;
	v1 = b >>> 1 | c;
	c = b << 31;
	b = v2;
	v2 = b >>> 1 | c;
	c = b << 31;
	b = v3;
	v3 = b >>> 1 | c;
	var reduction = b << 31 >> 8 & -520093696;
	v0 ^= reduction;
	haxe_crypto_mode_GCMSIV.h0 = new haxe__$Int64__$_$_$Int64(v0,v1);
	haxe_crypto_mode_GCMSIV.h1 = new haxe__$Int64__$_$_$Int64(v2,v3);
	haxe_crypto_mode_GCMSIV.s0 = new haxe__$Int64__$_$_$Int64(0,0);
	haxe_crypto_mode_GCMSIV.s1 = new haxe__$Int64__$_$_$Int64(0,0);
};
haxe_crypto_mode_GCMSIV.updatePolyval = function(b) {
	var extra = b.length & 15;
	var fullBlocks = b.length - extra;
	var i = 0;
	while(i < fullBlocks) {
		haxe_crypto_mode_GCMSIV.updateBlockPolyval(b,i);
		i += haxe_crypto_mode_GCMSIV.AES_BLOCK_SIZE;
	}
	if(extra != 0) {
		var block = new haxe_io_Bytes(new ArrayBuffer(haxe_crypto_mode_GCMSIV.AES_BLOCK_SIZE));
		block.blit(0,b,fullBlocks,extra);
		haxe_crypto_mode_GCMSIV.updateBlockPolyval(block,0);
	}
};
haxe_crypto_mode_GCMSIV.updateBlockPolyval = function(b,offset) {
	var lo = b.b[offset] & 255;
	lo |= (b.b[offset + 1] & 255) << 8;
	lo |= (b.b[offset + 2] & 255) << 16;
	lo |= b.b[offset + 3] << 24;
	var hi = b.b[offset + 4] & 255;
	hi |= (b.b[offset + 5] & 255) << 8;
	hi |= (b.b[offset + 6] & 255) << 16;
	var block1_high = hi |= b.b[offset + 7] << 24;
	var block1_low = lo;
	var offset1 = offset + 8;
	var lo = b.b[offset1] & 255;
	lo |= (b.b[offset1 + 1] & 255) << 8;
	lo |= (b.b[offset1 + 2] & 255) << 16;
	lo |= b.b[offset1 + 3] << 24;
	var hi = b.b[offset1 + 4] & 255;
	hi |= (b.b[offset1 + 5] & 255) << 8;
	hi |= (b.b[offset1 + 6] & 255) << 16;
	var block2_high = hi |= b.b[offset1 + 7] << 24;
	var block2_low = lo;
	var a = haxe_crypto_mode_GCMSIV.s1;
	var x0 = new haxe__$Int64__$_$_$Int64(a.high ^ block1_high,a.low ^ block1_low);
	var a = haxe_crypto_mode_GCMSIV.s0;
	var x1 = new haxe__$Int64__$_$_$Int64(a.high ^ block2_high,a.low ^ block2_low);
	var v0 = new haxe__$Int64__$_$_$Int64(haxe_crypto_mode_GCMSIV.h0.high,haxe_crypto_mode_GCMSIV.h0.low);
	var v1 = new haxe__$Int64__$_$_$Int64(haxe_crypto_mode_GCMSIV.h1.high,haxe_crypto_mode_GCMSIV.h1.low);
	var z0 = new haxe__$Int64__$_$_$Int64(0,0);
	var z1 = new haxe__$Int64__$_$_$Int64(0,0);
	var _g = 0;
	while(_g < 64) {
		var i = _g++;
		var b = 63;
		b &= 63;
		var m = b == 0 ? new haxe__$Int64__$_$_$Int64(x1.high,x1.low) : b < 32 ? new haxe__$Int64__$_$_$Int64(x1.high >> b,x1.high << 32 - b | x1.low >>> b) : new haxe__$Int64__$_$_$Int64(x1.high >> 31,x1.high >> b - 32);
		var b_high = 0;
		var b_low = 0;
		if(m.high != b_high || m.low != b_low) {
			z0 = new haxe__$Int64__$_$_$Int64(z0.high ^ v0.high,z0.low ^ v0.low);
			z1 = new haxe__$Int64__$_$_$Int64(z1.high ^ v1.high,z1.low ^ v1.low);
		}
		var b_high1 = 0;
		var b_low1 = 1;
		var v1SignBit_high = v1.high & b_high1;
		var v1SignBit_low = v1.low & b_low1;
		var b_high2 = 0;
		var b_low2 = 1;
		var c_high = v0.high & b_high2;
		var c_low = v0.low & b_low2;
		v0 = new haxe__$Int64__$_$_$Int64(v0.high >>> 1,v0.low >>> 1 | (v0.high & 1) << 31);
		v1 = new haxe__$Int64__$_$_$Int64(v1.high >>> 1,v1.low >>> 1 | (v1.high & 1) << 31);
		var b1 = 63;
		b1 &= 63;
		var b2 = b1 == 0 ? new haxe__$Int64__$_$_$Int64(c_high,c_low) : b1 < 32 ? new haxe__$Int64__$_$_$Int64(c_high << b1 | c_low >>> 32 - b1,c_low << b1) : new haxe__$Int64__$_$_$Int64(c_low << b1 - 32,0);
		v1 = new haxe__$Int64__$_$_$Int64(v1.high ^ b2.high,v1.low ^ b2.low);
		var b_high3 = 0;
		var b_low3 = 0;
		if(v1SignBit_high != b_high3 || v1SignBit_low != b_low3) {
			var b3 = haxe_crypto_mode_GCMSIV.E;
			v0 = new haxe__$Int64__$_$_$Int64(v0.high ^ b3.high,v0.low ^ b3.low);
		}
		var b4 = 1;
		b4 &= 63;
		x1 = b4 == 0 ? new haxe__$Int64__$_$_$Int64(x1.high,x1.low) : b4 < 32 ? new haxe__$Int64__$_$_$Int64(x1.high << b4 | x1.low >>> 32 - b4,x1.low << b4) : new haxe__$Int64__$_$_$Int64(x1.low << b4 - 32,0);
	}
	var _g = 64;
	while(_g < 127) {
		var i = _g++;
		var b = 63;
		b &= 63;
		var m = b == 0 ? new haxe__$Int64__$_$_$Int64(x0.high,x0.low) : b < 32 ? new haxe__$Int64__$_$_$Int64(x0.high >> b,x0.high << 32 - b | x0.low >>> b) : new haxe__$Int64__$_$_$Int64(x0.high >> 31,x0.high >> b - 32);
		var b_high = 0;
		var b_low = 0;
		if(m.high != b_high || m.low != b_low) {
			z0 = new haxe__$Int64__$_$_$Int64(z0.high ^ v0.high,z0.low ^ v0.low);
			z1 = new haxe__$Int64__$_$_$Int64(z1.high ^ v1.high,z1.low ^ v1.low);
		}
		var b_high1 = 0;
		var b_low1 = 1;
		var v1SignBit_high = v1.high & b_high1;
		var v1SignBit_low = v1.low & b_low1;
		var b_high2 = 0;
		var b_low2 = 1;
		var c_high = v0.high & b_high2;
		var c_low = v0.low & b_low2;
		v0 = new haxe__$Int64__$_$_$Int64(v0.high >>> 1,v0.low >>> 1 | (v0.high & 1) << 31);
		v1 = new haxe__$Int64__$_$_$Int64(v1.high >>> 1,v1.low >>> 1 | (v1.high & 1) << 31);
		var b1 = 63;
		b1 &= 63;
		var b2 = b1 == 0 ? new haxe__$Int64__$_$_$Int64(c_high,c_low) : b1 < 32 ? new haxe__$Int64__$_$_$Int64(c_high << b1 | c_low >>> 32 - b1,c_low << b1) : new haxe__$Int64__$_$_$Int64(c_low << b1 - 32,0);
		v1 = new haxe__$Int64__$_$_$Int64(v1.high ^ b2.high,v1.low ^ b2.low);
		var b_high3 = 0;
		var b_low3 = 0;
		if(v1SignBit_high != b_high3 || v1SignBit_low != b_low3) {
			var b3 = haxe_crypto_mode_GCMSIV.E;
			v0 = new haxe__$Int64__$_$_$Int64(v0.high ^ b3.high,v0.low ^ b3.low);
		}
		var b4 = 1;
		b4 &= 63;
		x0 = b4 == 0 ? new haxe__$Int64__$_$_$Int64(x0.high,x0.low) : b4 < 32 ? new haxe__$Int64__$_$_$Int64(x0.high << b4 | x0.low >>> 32 - b4,x0.low << b4) : new haxe__$Int64__$_$_$Int64(x0.low << b4 - 32,0);
	}
	var b = 63;
	b &= 63;
	var finalM = b == 0 ? new haxe__$Int64__$_$_$Int64(x0.high,x0.low) : b < 32 ? new haxe__$Int64__$_$_$Int64(x0.high >> b,x0.high << 32 - b | x0.low >>> b) : new haxe__$Int64__$_$_$Int64(x0.high >> 31,x0.high >> b - 32);
	var b_high = 0;
	var b_low = 0;
	if(finalM.high != b_high || finalM.low != b_low) {
		var b_high = v0.high & finalM.high;
		var b_low = v0.low & finalM.low;
		haxe_crypto_mode_GCMSIV.s0 = new haxe__$Int64__$_$_$Int64(z0.high ^ b_high,z0.low ^ b_low);
		var b_high = v1.high & finalM.high;
		var b_low = v1.low & finalM.low;
		haxe_crypto_mode_GCMSIV.s1 = new haxe__$Int64__$_$_$Int64(z1.high ^ b_high,z1.low ^ b_low);
	} else {
		haxe_crypto_mode_GCMSIV.s0 = z0;
		haxe_crypto_mode_GCMSIV.s1 = z1;
	}
};
haxe_crypto_mode_GCMSIV.digestPolyval = function(d) {
	var n = haxe_crypto_mode_GCMSIV.s1;
	var hi = n.high;
	var lo = n.low;
	d.b[0] = lo;
	d.b[1] = lo >> 8 & 255;
	d.b[2] = lo >> 16 & 255;
	d.b[3] = lo >> 24 & 255;
	d.b[4] = hi;
	d.b[5] = hi >> 8 & 255;
	d.b[6] = hi >> 16 & 255;
	d.b[7] = hi >> 24 & 255;
	var n = haxe_crypto_mode_GCMSIV.s0;
	var hi = n.high;
	var lo = n.low;
	d.b[8] = lo;
	d.b[9] = lo >> 8 & 255;
	d.b[10] = lo >> 16 & 255;
	d.b[11] = lo >> 24 & 255;
	d.b[12] = hi;
	d.b[13] = hi >> 8 & 255;
	d.b[14] = hi >> 16 & 255;
	d.b[15] = hi >> 24 & 255;
};
haxe_crypto_mode_GCMSIV.putLong64 = function(n,b,offset) {
	var hi = n.high;
	var lo = n.low;
	b.b[offset] = lo;
	b.b[offset + 1] = lo >> 8 & 255;
	b.b[offset + 2] = lo >> 16 & 255;
	b.b[offset + 3] = lo >> 24 & 255;
	b.b[offset + 4] = hi;
	b.b[offset + 5] = hi >> 8 & 255;
	b.b[offset + 6] = hi >> 16 & 255;
	b.b[offset + 7] = hi >> 24 & 255;
};
haxe_crypto_mode_GCMSIV.aesCTR = function(key,tag,input,output,encryptBlock) {
	var counter = new haxe_io_Bytes(new ArrayBuffer(tag.length));
	counter.blit(0,tag,0,tag.length);
	counter.b[counter.length - 1] |= 128;
	var k = new haxe_io_Bytes(new ArrayBuffer(haxe_crypto_mode_GCMSIV.AES_BLOCK_SIZE));
	var i = 0;
	while(i < input.length) {
		encryptBlock(counter,0,k,0);
		var len = Math.min(haxe_crypto_mode_GCMSIV.AES_BLOCK_SIZE,input.length - i) | 0;
		var _g = 0;
		var _g1 = len;
		while(_g < _g1) {
			var j = _g++;
			output.b[i + j] = input.b[i + j] ^ k.b[j];
		}
		var carry = 1;
		var _g2 = 0;
		while(_g2 < 4) {
			var j1 = _g2++;
			var val = counter.b[j1] + carry;
			counter.b[j1] = val & 255;
			carry = val >>> 8;
			if(carry == 0) {
				break;
			}
		}
		i += haxe_crypto_mode_GCMSIV.AES_BLOCK_SIZE;
	}
};
haxe_crypto_mode_GCMSIV.putInt = function(n,b,offset) {
	if(offset == null) {
		offset = 0;
	}
	b.b[offset] = n & 255;
	b.b[offset + 1] = n >> 8 & 255;
	b.b[offset + 2] = n >> 16 & 255;
	b.b[offset + 3] = n >> 24 & 255;
};
haxe_crypto_mode_GCMSIV.putLong = function(n,b,offset) {
	var hi = n & -1;
	var lo = 0;
	b.b[offset] = hi & 255;
	b.b[offset + 1] = hi >> 8 & 255;
	b.b[offset + 2] = hi >> 16 & 255;
	b.b[offset + 3] = hi >> 24 & 255;
	b.b[offset + 4] = 0;
	b.b[offset + 5] = 0;
	b.b[offset + 6] = 0;
	b.b[offset + 7] = 0;
};
haxe_crypto_mode_GCMSIV.getInt = function(b,offset) {
	return b.b[offset] & 255 | (b.b[offset + 1] & 255) << 8 | (b.b[offset + 2] & 255) << 16 | b.b[offset + 3] << 24;
};
haxe_crypto_mode_GCMSIV.getLong = function(b,offset) {
	var lo = b.b[offset] & 255;
	lo |= (b.b[offset + 1] & 255) << 8;
	lo |= (b.b[offset + 2] & 255) << 16;
	lo |= b.b[offset + 3] << 24;
	var hi = b.b[offset + 4] & 255;
	hi |= (b.b[offset + 5] & 255) << 8;
	hi |= (b.b[offset + 6] & 255) << 16;
	hi |= b.b[offset + 7] << 24;
	var result = new haxe__$Int64__$_$_$Int64(hi,lo);
	return result;
};
haxe_crypto_mode_GCMSIV.constantTimeCompare = function(a,b) {
	if(a.length != b.length) {
		return false;
	}
	var result = 0;
	var _g = 0;
	var _g1 = a.length;
	while(_g < _g1) {
		var i = _g++;
		result |= a.b[i] ^ b.b[i];
	}
	return result == 0;
};
var haxe_crypto_mode_OFB = function() { };
$hxClasses["haxe.crypto.mode.OFB"] = haxe_crypto_mode_OFB;
haxe_crypto_mode_OFB.__name__ = "haxe.crypto.mode.OFB";
haxe_crypto_mode_OFB.encrypt = function(src,iv,blockSize,encryptBlock) {
	var vector = iv.sub(0,iv.length);
	var i = 0;
	var len = src.length;
	while(i < len) {
		encryptBlock(vector,0,vector,0);
		var block = i + blockSize > len ? len - i : blockSize;
		var _g = 0;
		var _g1 = block;
		while(_g < _g1) {
			var j = _g++;
			src.b[i + j] ^= vector.b[j];
		}
		i += blockSize;
	}
};
haxe_crypto_mode_OFB.decrypt = function(src,iv,blockSize,decryptBlock) {
	haxe_crypto_mode_OFB.encrypt(src,iv,blockSize,decryptBlock);
};
var haxe_crypto_mode_PCBC = function() { };
$hxClasses["haxe.crypto.mode.PCBC"] = haxe_crypto_mode_PCBC;
haxe_crypto_mode_PCBC.__name__ = "haxe.crypto.mode.PCBC";
haxe_crypto_mode_PCBC.encrypt = function(src,iv,blockSize,encryptBlock) {
	var vector = iv.sub(0,iv.length);
	var i = 0;
	var len = src.length;
	var plainText = new haxe_io_Bytes(new ArrayBuffer(blockSize));
	while(i < len) {
		var _g = 0;
		var _g1 = blockSize;
		while(_g < _g1) {
			var j = _g++;
			plainText.b[j] = src.b[i + j];
			src.b[i + j] ^= vector.b[j];
		}
		encryptBlock(src,i,src,i);
		var _g2 = 0;
		var _g3 = blockSize;
		while(_g2 < _g3) {
			var j1 = _g2++;
			vector.b[j1] = src.b[i + j1] ^ plainText.b[j1];
		}
		i += blockSize;
	}
};
haxe_crypto_mode_PCBC.decrypt = function(src,iv,blockSize,decryptBlock) {
	var vector = iv.sub(0,iv.length);
	var i = 0;
	var len = src.length;
	var cipherText = new haxe_io_Bytes(new ArrayBuffer(blockSize));
	while(i < len) {
		var _g = 0;
		var _g1 = blockSize;
		while(_g < _g1) {
			var j = _g++;
			cipherText.b[j] = src.b[i + j];
		}
		decryptBlock(src,i,src,i);
		var _g2 = 0;
		var _g3 = blockSize;
		while(_g2 < _g3) {
			var j1 = _g2++;
			src.b[i + j1] ^= vector.b[j1];
			vector.b[j1] = src.b[i + j1] ^ cipherText.b[j1];
		}
		i += blockSize;
	}
};
var haxe_crypto_mode_SIV = function() { };
$hxClasses["haxe.crypto.mode.SIV"] = haxe_crypto_mode_SIV;
haxe_crypto_mode_SIV.__name__ = "haxe.crypto.mode.SIV";
haxe_crypto_mode_SIV.encrypt = function(key,plaintext,nonce,associatedData,encryptBlock,initKey) {
	if(associatedData == null) {
		associatedData = [];
	}
	if(plaintext.length > 2147483631) {
		throw haxe_Exception.thrown("Text to encrypt is too long");
	}
	if(key.length != 64 && key.length != 48 && key.length != 32) {
		throw haxe_Exception.thrown("Key should be 32, 48, or 64 bytes (256, 384, 512 bits)");
	}
	var subkeyLen = key.length >> 1;
	var macKey = key.sub(0,subkeyLen);
	var ctrKey = key.sub(subkeyLen,subkeyLen);
	var iv = haxe_crypto_mode_SIV.s2v(macKey,plaintext,associatedData,nonce,encryptBlock,initKey);
	var ciphertext = haxe_crypto_mode_SIV.computeCtr(plaintext,ctrKey,iv,encryptBlock,initKey);
	var result = new haxe_io_Bytes(new ArrayBuffer(iv.length + ciphertext.length));
	result.blit(0,iv,0,iv.length);
	result.blit(iv.length,ciphertext,0,ciphertext.length);
	initKey(key,nonce);
	return result;
};
haxe_crypto_mode_SIV.decrypt = function(combinedKey,ciphertext,nonce,associatedData,encryptBlock,initKey) {
	if(combinedKey.length != 64 && combinedKey.length != 48 && combinedKey.length != 32) {
		throw haxe_Exception.thrown("Key should be 32, 48, or 64 bytes (256, 384, 512 bits)");
	}
	var subkeyLen = combinedKey.length / 2 | 0;
	var macKey = combinedKey.sub(0,subkeyLen);
	var ctrKey = combinedKey.sub(subkeyLen,subkeyLen);
	if(associatedData == null) {
		associatedData = [];
	}
	if(ciphertext.length < 16) {
		throw haxe_Exception.thrown("Input length must be greater than or equal 16");
	}
	var iv = ciphertext.sub(0,16);
	var actualCiphertext = ciphertext.sub(16,ciphertext.length - 16);
	var plaintext = haxe_crypto_mode_SIV.computeCtr(actualCiphertext,ctrKey,iv,encryptBlock,initKey);
	var control = haxe_crypto_mode_SIV.s2v(macKey,plaintext,associatedData,nonce,encryptBlock,initKey);
	initKey(combinedKey,nonce);
	var diff = 0;
	var _g = 0;
	var _g1 = iv.length;
	while(_g < _g1) {
		var i = _g++;
		diff |= iv.b[i] ^ control.b[i];
	}
	if(diff == 0) {
		return plaintext;
	} else {
		return null;
	}
};
haxe_crypto_mode_SIV.computeCtr = function(input,key,iv,encryptBlock,initKey) {
	var adjustedIv = new haxe_io_Bytes(new ArrayBuffer(16));
	adjustedIv.blit(0,iv,0,16);
	adjustedIv.b[8] &= 127;
	adjustedIv.b[12] &= 127;
	initKey(key,iv);
	haxe_crypto_mode_CTR.encrypt(input,adjustedIv,16,encryptBlock);
	return input;
};
haxe_crypto_mode_SIV.s2v = function(macKey,plaintext,associatedData,nonce,encryptBlock,initKey) {
	if(associatedData.length > 126) {
		throw haxe_Exception.thrown("Too many associatedData fields");
	}
	initKey(macKey,nonce);
	var d = haxe_crypto_mode_CMAC.generate(new haxe_io_Bytes(new ArrayBuffer(16)),macKey,16,encryptBlock);
	var _g = 0;
	while(_g < associatedData.length) {
		var s = associatedData[_g];
		++_g;
		var mac = haxe_crypto_mode_CMAC.generate(s,macKey,16,encryptBlock);
		var ddbl = haxe_crypto_mode_SIV.dbl(d);
		d = haxe_crypto_mode_SIV.xor(ddbl,mac);
	}
	if(nonce != null) {
		var mac = haxe_crypto_mode_CMAC.generate(nonce,macKey,16,encryptBlock);
		var ddbl = haxe_crypto_mode_SIV.dbl(d);
		d = haxe_crypto_mode_SIV.xor(ddbl,mac);
	}
	var t;
	if(plaintext.length >= 16) {
		t = haxe_crypto_mode_SIV.xorend(plaintext,d);
	} else {
		var padded = haxe_crypto_padding_BitPadding.pad(plaintext,16);
		t = haxe_crypto_mode_SIV.xor(haxe_crypto_mode_SIV.dbl(d),padded);
	}
	var mf = haxe_crypto_mode_CMAC.generate(t,macKey,16,encryptBlock);
	return mf;
};
haxe_crypto_mode_SIV.shiftLeft = function(block,output) {
	var i = block.length;
	var bit = 0;
	while(--i >= 0) {
		var b = block.b[i] & 255;
		output.b[i] = b << 1 | bit;
		bit = b >>> 7 & 1;
	}
	return bit;
};
haxe_crypto_mode_SIV.dbl = function(input) {
	var ret = new haxe_io_Bytes(new ArrayBuffer(input.length));
	var carry = haxe_crypto_mode_SIV.shiftLeft(input,ret);
	var mask = -carry & 255;
	ret.b[input.length - 1] ^= 135 & mask;
	return ret;
};
haxe_crypto_mode_SIV.xor = function(in1,in2) {
	if(in1.length > in2.length) {
		throw haxe_Exception.thrown("in1.length must be <= in2.length");
	}
	var result = new haxe_io_Bytes(new ArrayBuffer(in1.length));
	var _g = 0;
	var _g1 = result.length;
	while(_g < _g1) {
		var i = _g++;
		result.b[i] = in1.b[i] ^ in2.b[i];
	}
	return result;
};
haxe_crypto_mode_SIV.xorend = function(in1,in2) {
	if(in1.length < in2.length) {
		throw haxe_Exception.thrown("in1.length must be >= in2.length");
	}
	var result = new haxe_io_Bytes(new ArrayBuffer(in1.length));
	result.blit(0,in1,0,in1.length);
	var diff = in1.length - in2.length;
	var _g = 0;
	var _g1 = in2.length;
	while(_g < _g1) {
		var i = _g++;
		result.b[i + diff] ^= in2.b[i];
	}
	return result;
};
var haxe_crypto_padding_AnsiX923 = function() { };
$hxClasses["haxe.crypto.padding.AnsiX923"] = haxe_crypto_padding_AnsiX923;
haxe_crypto_padding_AnsiX923.__name__ = "haxe.crypto.padding.AnsiX923";
haxe_crypto_padding_AnsiX923.pad = function(ciphertext,blockSize) {
	var padding = blockSize - ciphertext.length % blockSize - 1;
	var bsize = ciphertext.length + padding;
	var buffer = new haxe_io_Bytes(new ArrayBuffer(bsize + 1));
	buffer.blit(0,ciphertext,0,ciphertext.length);
	var _g = ciphertext.length;
	var _g1 = bsize;
	while(_g < _g1) {
		var i = _g++;
		buffer.b[i] = 0;
	}
	buffer.b[bsize] = padding + 1;
	return buffer;
};
haxe_crypto_padding_AnsiX923.unpad = function(encrypt) {
	var padding = encrypt.b[encrypt.length - 1];
	return encrypt.sub(0,encrypt.length - padding);
};
var haxe_crypto_padding_BitPadding = function() { };
$hxClasses["haxe.crypto.padding.BitPadding"] = haxe_crypto_padding_BitPadding;
haxe_crypto_padding_BitPadding.__name__ = "haxe.crypto.padding.BitPadding";
haxe_crypto_padding_BitPadding.pad = function(ciphertext,blockSize) {
	var padding = blockSize - ciphertext.length % blockSize - 1;
	var bsize = ciphertext.length + padding + 1;
	var buffer = new haxe_io_Bytes(new ArrayBuffer(bsize));
	buffer.blit(0,ciphertext,0,ciphertext.length);
	buffer.b[ciphertext.length] = 128;
	var _g = ciphertext.length + 1;
	var _g1 = bsize;
	while(_g < _g1) {
		var i = _g++;
		buffer.b[i] = 0;
	}
	return buffer;
};
haxe_crypto_padding_BitPadding.unpad = function(encrypt) {
	var padding = 0;
	var pos = encrypt.length - 1;
	while(padding != 128 && pos > -1) {
		padding = encrypt.b[pos];
		--pos;
	}
	return encrypt.sub(0,pos + 1);
};
var haxe_crypto_padding_ISO10126 = function() { };
$hxClasses["haxe.crypto.padding.ISO10126"] = haxe_crypto_padding_ISO10126;
haxe_crypto_padding_ISO10126.__name__ = "haxe.crypto.padding.ISO10126";
haxe_crypto_padding_ISO10126.pad = function(ciphertext,blockSize) {
	var padding = blockSize - ciphertext.length % blockSize - 1;
	var bsize = ciphertext.length + padding;
	var buffer = new haxe_io_Bytes(new ArrayBuffer(bsize + 1));
	buffer.blit(0,ciphertext,0,ciphertext.length);
	var _g = ciphertext.length;
	var _g1 = bsize;
	while(_g < _g1) {
		var i = _g++;
		var v = Std.random(256);
		buffer.b[i] = v;
	}
	buffer.b[bsize] = padding + 1;
	return buffer;
};
haxe_crypto_padding_ISO10126.unpad = function(encrypt) {
	var padding = encrypt.b[encrypt.length - 1];
	return encrypt.sub(0,encrypt.length - padding);
};
var haxe_crypto_padding_NoPadding = function() { };
$hxClasses["haxe.crypto.padding.NoPadding"] = haxe_crypto_padding_NoPadding;
haxe_crypto_padding_NoPadding.__name__ = "haxe.crypto.padding.NoPadding";
haxe_crypto_padding_NoPadding.pad = function(ciphertext,blockSize) {
	return ciphertext.sub(0,ciphertext.length);
};
haxe_crypto_padding_NoPadding.unpad = function(encrypt) {
	return encrypt;
};
var haxe_crypto_padding_NullPadding = function() { };
$hxClasses["haxe.crypto.padding.NullPadding"] = haxe_crypto_padding_NullPadding;
haxe_crypto_padding_NullPadding.__name__ = "haxe.crypto.padding.NullPadding";
haxe_crypto_padding_NullPadding.pad = function(ciphertext,blockSize) {
	var padding = blockSize - ciphertext.length % blockSize;
	var bsize = ciphertext.length + padding;
	var buffer = new haxe_io_Bytes(new ArrayBuffer(bsize));
	buffer.blit(0,ciphertext,0,ciphertext.length);
	var _g = ciphertext.length;
	var _g1 = bsize;
	while(_g < _g1) {
		var i = _g++;
		buffer.b[i] = 0;
	}
	return buffer;
};
haxe_crypto_padding_NullPadding.unpad = function(encrypt) {
	var padding = 0;
	var pos = encrypt.length;
	while(padding == 0 && pos > 0) {
		--pos;
		padding = encrypt.b[pos];
	}
	return encrypt.sub(0,pos + 1);
};
var haxe_crypto_padding_PKCS7 = function() { };
$hxClasses["haxe.crypto.padding.PKCS7"] = haxe_crypto_padding_PKCS7;
haxe_crypto_padding_PKCS7.__name__ = "haxe.crypto.padding.PKCS7";
haxe_crypto_padding_PKCS7.pad = function(ciphertext,blockSize) {
	if(blockSize > 255) {
		throw haxe_Exception.thrown("PKCS#7 padding cannot be longer than 255 bytes");
	}
	if(blockSize < 0) {
		throw haxe_Exception.thrown("PKCS#7 padding size must be positive");
	}
	var padding = blockSize - ciphertext.length % blockSize;
	var bsize = ciphertext.length + padding;
	var buffer = new haxe_io_Bytes(new ArrayBuffer(bsize));
	buffer.blit(0,ciphertext,0,ciphertext.length);
	var _g = ciphertext.length;
	var _g1 = bsize;
	while(_g < _g1) {
		var i = _g++;
		buffer.b[i] = padding & 255;
	}
	return buffer;
};
haxe_crypto_padding_PKCS7.unpad = function(encrypt) {
	var padding = encrypt.b[encrypt.length - 1];
	if(padding > encrypt.length) {
		throw haxe_Exception.thrown("Cannot remove " + padding + " bytes, because message is " + encrypt.length + " bytes");
	}
	var block = encrypt.length - padding;
	var _g = block;
	var _g1 = encrypt.length;
	while(_g < _g1) {
		var i = _g++;
		if(encrypt.b[i] != padding) {
			throw haxe_Exception.thrown("Invalid padding value. Got " + encrypt.b[i] + ", expected " + padding + " at position " + i);
		}
	}
	return encrypt.sub(0,block);
};
var haxe_crypto_padding_SpacePadding = function() { };
$hxClasses["haxe.crypto.padding.SpacePadding"] = haxe_crypto_padding_SpacePadding;
haxe_crypto_padding_SpacePadding.__name__ = "haxe.crypto.padding.SpacePadding";
haxe_crypto_padding_SpacePadding.pad = function(ciphertext,blockSize) {
	var padding = blockSize - ciphertext.length % blockSize;
	var bsize = ciphertext.length + padding;
	var buffer = new haxe_io_Bytes(new ArrayBuffer(bsize));
	buffer.blit(0,ciphertext,0,ciphertext.length);
	var _g = ciphertext.length;
	var _g1 = bsize;
	while(_g < _g1) {
		var i = _g++;
		buffer.b[i] = 32;
	}
	return buffer;
};
haxe_crypto_padding_SpacePadding.unpad = function(encrypt) {
	var padding = 32;
	var pos = encrypt.length;
	while(padding == 32 && pos > 0) {
		--pos;
		padding = encrypt.b[pos];
	}
	return encrypt.sub(0,pos + 1);
};
var haxe_crypto_padding_TBC = function() { };
$hxClasses["haxe.crypto.padding.TBC"] = haxe_crypto_padding_TBC;
haxe_crypto_padding_TBC.__name__ = "haxe.crypto.padding.TBC";
haxe_crypto_padding_TBC.pad = function(ciphertext,blockSize) {
	var tb = ciphertext.b[ciphertext.length - 1] & 1;
	var paddingByte = tb == 1 ? 0 : 255;
	var padding = blockSize - ciphertext.length % blockSize;
	var bsize = ciphertext.length + padding;
	var buffer = new haxe_io_Bytes(new ArrayBuffer(bsize));
	buffer.blit(0,ciphertext,0,ciphertext.length);
	var _g = ciphertext.length;
	var _g1 = bsize;
	while(_g < _g1) {
		var i = _g++;
		buffer.b[i] = paddingByte;
	}
	return buffer;
};
haxe_crypto_padding_TBC.unpad = function(encrypt) {
	var pos = encrypt.length - 1;
	var paddingByte = encrypt.b[pos];
	var padding = paddingByte;
	while(padding == paddingByte && pos > -1) {
		--pos;
		padding = encrypt.b[pos];
	}
	return encrypt.sub(0,pos + 1);
};
var haxe_ds_ArraySort = function() { };
$hxClasses["haxe.ds.ArraySort"] = haxe_ds_ArraySort;
haxe_ds_ArraySort.__name__ = "haxe.ds.ArraySort";
haxe_ds_ArraySort.sort = function(a,cmp) {
	haxe_ds_ArraySort.rec(a,cmp,0,a.length);
};
haxe_ds_ArraySort.rec = function(a,cmp,from,to) {
	var middle = from + to >> 1;
	if(to - from < 12) {
		if(to <= from) {
			return;
		}
		var _g = from + 1;
		var _g1 = to;
		while(_g < _g1) {
			var i = _g++;
			var j = i;
			while(j > from) {
				if(cmp(a[j],a[j - 1]) < 0) {
					haxe_ds_ArraySort.swap(a,j - 1,j);
				} else {
					break;
				}
				--j;
			}
		}
		return;
	}
	haxe_ds_ArraySort.rec(a,cmp,from,middle);
	haxe_ds_ArraySort.rec(a,cmp,middle,to);
	haxe_ds_ArraySort.doMerge(a,cmp,from,middle,to,middle - from,to - middle);
};
haxe_ds_ArraySort.doMerge = function(a,cmp,from,pivot,to,len1,len2) {
	var first_cut;
	var second_cut;
	var len11;
	var len22;
	if(len1 == 0 || len2 == 0) {
		return;
	}
	if(len1 + len2 == 2) {
		if(cmp(a[pivot],a[from]) < 0) {
			haxe_ds_ArraySort.swap(a,pivot,from);
		}
		return;
	}
	if(len1 > len2) {
		len11 = len1 >> 1;
		first_cut = from + len11;
		second_cut = haxe_ds_ArraySort.lower(a,cmp,pivot,to,first_cut);
		len22 = second_cut - pivot;
	} else {
		len22 = len2 >> 1;
		second_cut = pivot + len22;
		first_cut = haxe_ds_ArraySort.upper(a,cmp,from,pivot,second_cut);
		len11 = first_cut - from;
	}
	haxe_ds_ArraySort.rotate(a,cmp,first_cut,pivot,second_cut);
	var new_mid = first_cut + len22;
	haxe_ds_ArraySort.doMerge(a,cmp,from,first_cut,new_mid,len11,len22);
	haxe_ds_ArraySort.doMerge(a,cmp,new_mid,second_cut,to,len1 - len11,len2 - len22);
};
haxe_ds_ArraySort.rotate = function(a,cmp,from,mid,to) {
	if(from == mid || mid == to) {
		return;
	}
	var n = haxe_ds_ArraySort.gcd(to - from,mid - from);
	while(n-- != 0) {
		var val = a[from + n];
		var shift = mid - from;
		var p1 = from + n;
		var p2 = from + n + shift;
		while(p2 != from + n) {
			a[p1] = a[p2];
			p1 = p2;
			if(to - p2 > shift) {
				p2 += shift;
			} else {
				p2 = from + (shift - (to - p2));
			}
		}
		a[p1] = val;
	}
};
haxe_ds_ArraySort.gcd = function(m,n) {
	while(n != 0) {
		var t = m % n;
		m = n;
		n = t;
	}
	return m;
};
haxe_ds_ArraySort.upper = function(a,cmp,from,to,val) {
	var len = to - from;
	var half;
	var mid;
	while(len > 0) {
		half = len >> 1;
		mid = from + half;
		if(cmp(a[val],a[mid]) < 0) {
			len = half;
		} else {
			from = mid + 1;
			len = len - half - 1;
		}
	}
	return from;
};
haxe_ds_ArraySort.lower = function(a,cmp,from,to,val) {
	var len = to - from;
	var half;
	var mid;
	while(len > 0) {
		half = len >> 1;
		mid = from + half;
		if(cmp(a[mid],a[val]) < 0) {
			from = mid + 1;
			len = len - half - 1;
		} else {
			len = half;
		}
	}
	return from;
};
haxe_ds_ArraySort.swap = function(a,i,j) {
	var tmp = a[i];
	a[i] = a[j];
	a[j] = tmp;
};
var haxe_ds_BalancedTree = function() {
};
$hxClasses["haxe.ds.BalancedTree"] = haxe_ds_BalancedTree;
haxe_ds_BalancedTree.__name__ = "haxe.ds.BalancedTree";
haxe_ds_BalancedTree.__interfaces__ = [haxe_IMap];
haxe_ds_BalancedTree.iteratorLoop = function(node,acc) {
	if(node != null) {
		haxe_ds_BalancedTree.iteratorLoop(node.left,acc);
		acc.push(node.value);
		haxe_ds_BalancedTree.iteratorLoop(node.right,acc);
	}
};
haxe_ds_BalancedTree.prototype = {
	root: null
	,set: function(key,value) {
		this.root = this.setLoop(key,value,this.root);
	}
	,get: function(key) {
		var node = this.root;
		while(node != null) {
			var c = this.compare(key,node.key);
			if(c == 0) {
				return node.value;
			}
			if(c < 0) {
				node = node.left;
			} else {
				node = node.right;
			}
		}
		return null;
	}
	,remove: function(key) {
		try {
			this.root = this.removeLoop(key,this.root);
			return true;
		} catch( _g ) {
			haxe_NativeStackTrace.lastError = _g;
			if(typeof(haxe_Exception.caught(_g).unwrap()) == "string") {
				return false;
			} else {
				throw _g;
			}
		}
	}
	,exists: function(key) {
		var node = this.root;
		while(node != null) {
			var c = this.compare(key,node.key);
			if(c == 0) {
				return true;
			} else if(c < 0) {
				node = node.left;
			} else {
				node = node.right;
			}
		}
		return false;
	}
	,iterator: function() {
		var ret = [];
		haxe_ds_BalancedTree.iteratorLoop(this.root,ret);
		return new haxe_iterators_ArrayIterator(ret);
	}
	,keyValueIterator: function() {
		return new haxe_iterators_MapKeyValueIterator(this);
	}
	,keys: function() {
		var ret = [];
		this.keysLoop(this.root,ret);
		return new haxe_iterators_ArrayIterator(ret);
	}
	,setLoop: function(k,v,node) {
		if(node == null) {
			return new haxe_ds_TreeNode(null,k,v,null);
		}
		var c = this.compare(k,node.key);
		if(c == 0) {
			return new haxe_ds_TreeNode(node.left,k,v,node.right,node == null ? 0 : node._height);
		} else if(c < 0) {
			var nl = this.setLoop(k,v,node.left);
			return this.balance(nl,node.key,node.value,node.right);
		} else {
			var nr = this.setLoop(k,v,node.right);
			return this.balance(node.left,node.key,node.value,nr);
		}
	}
	,removeLoop: function(k,node) {
		if(node == null) {
			throw haxe_Exception.thrown("Not_found");
		}
		var c = this.compare(k,node.key);
		if(c == 0) {
			return this.merge(node.left,node.right);
		} else if(c < 0) {
			return this.balance(this.removeLoop(k,node.left),node.key,node.value,node.right);
		} else {
			return this.balance(node.left,node.key,node.value,this.removeLoop(k,node.right));
		}
	}
	,keysLoop: function(node,acc) {
		if(node != null) {
			this.keysLoop(node.left,acc);
			acc.push(node.key);
			this.keysLoop(node.right,acc);
		}
	}
	,merge: function(t1,t2) {
		if(t1 == null) {
			return t2;
		}
		if(t2 == null) {
			return t1;
		}
		var t = this.minBinding(t2);
		return this.balance(t1,t.key,t.value,this.removeMinBinding(t2));
	}
	,minBinding: function(t) {
		if(t == null) {
			throw haxe_Exception.thrown("Not_found");
		} else if(t.left == null) {
			return t;
		} else {
			return this.minBinding(t.left);
		}
	}
	,removeMinBinding: function(t) {
		if(t.left == null) {
			return t.right;
		} else {
			return this.balance(this.removeMinBinding(t.left),t.key,t.value,t.right);
		}
	}
	,balance: function(l,k,v,r) {
		var hl = l == null ? 0 : l._height;
		var hr = r == null ? 0 : r._height;
		if(hl > hr + 2) {
			var _this = l.left;
			var _this1 = l.right;
			if((_this == null ? 0 : _this._height) >= (_this1 == null ? 0 : _this1._height)) {
				return new haxe_ds_TreeNode(l.left,l.key,l.value,new haxe_ds_TreeNode(l.right,k,v,r));
			} else {
				return new haxe_ds_TreeNode(new haxe_ds_TreeNode(l.left,l.key,l.value,l.right.left),l.right.key,l.right.value,new haxe_ds_TreeNode(l.right.right,k,v,r));
			}
		} else if(hr > hl + 2) {
			var _this = r.right;
			var _this1 = r.left;
			if((_this == null ? 0 : _this._height) > (_this1 == null ? 0 : _this1._height)) {
				return new haxe_ds_TreeNode(new haxe_ds_TreeNode(l,k,v,r.left),r.key,r.value,r.right);
			} else {
				return new haxe_ds_TreeNode(new haxe_ds_TreeNode(l,k,v,r.left.left),r.left.key,r.left.value,new haxe_ds_TreeNode(r.left.right,r.key,r.value,r.right));
			}
		} else {
			return new haxe_ds_TreeNode(l,k,v,r,(hl > hr ? hl : hr) + 1);
		}
	}
	,compare: function(k1,k2) {
		return Reflect.compare(k1,k2);
	}
	,clear: function() {
		this.root = null;
	}
	,__class__: haxe_ds_BalancedTree
};
var haxe_ds_TreeNode = function(l,k,v,r,h) {
	if(h == null) {
		h = -1;
	}
	this.left = l;
	this.key = k;
	this.value = v;
	this.right = r;
	if(h == -1) {
		var tmp;
		var _this = this.left;
		var _this1 = this.right;
		if((_this == null ? 0 : _this._height) > (_this1 == null ? 0 : _this1._height)) {
			var _this = this.left;
			tmp = _this == null ? 0 : _this._height;
		} else {
			var _this = this.right;
			tmp = _this == null ? 0 : _this._height;
		}
		this._height = tmp + 1;
	} else {
		this._height = h;
	}
};
$hxClasses["haxe.ds.TreeNode"] = haxe_ds_TreeNode;
haxe_ds_TreeNode.__name__ = "haxe.ds.TreeNode";
haxe_ds_TreeNode.prototype = {
	left: null
	,right: null
	,key: null
	,value: null
	,_height: null
	,__class__: haxe_ds_TreeNode
};
var haxe_ds_EnumValueMap = function() {
	haxe_ds_BalancedTree.call(this);
};
$hxClasses["haxe.ds.EnumValueMap"] = haxe_ds_EnumValueMap;
haxe_ds_EnumValueMap.__name__ = "haxe.ds.EnumValueMap";
haxe_ds_EnumValueMap.__interfaces__ = [haxe_IMap];
haxe_ds_EnumValueMap.__super__ = haxe_ds_BalancedTree;
haxe_ds_EnumValueMap.prototype = $extend(haxe_ds_BalancedTree.prototype,{
	compare: function(k1,k2) {
		var d = k1._hx_index - k2._hx_index;
		if(d != 0) {
			return d;
		}
		var p1 = Type.enumParameters(k1);
		var p2 = Type.enumParameters(k2);
		if(p1.length == 0 && p2.length == 0) {
			return 0;
		}
		return this.compareArgs(p1,p2);
	}
	,compareArgs: function(a1,a2) {
		var ld = a1.length - a2.length;
		if(ld != 0) {
			return ld;
		}
		var _g = 0;
		var _g1 = a1.length;
		while(_g < _g1) {
			var i = _g++;
			var d = this.compareArg(a1[i],a2[i]);
			if(d != 0) {
				return d;
			}
		}
		return 0;
	}
	,compareArg: function(v1,v2) {
		if(Reflect.isEnumValue(v1) && Reflect.isEnumValue(v2)) {
			return this.compare(v1,v2);
		} else if(((v1) instanceof Array) && ((v2) instanceof Array)) {
			return this.compareArgs(v1,v2);
		} else {
			return Reflect.compare(v1,v2);
		}
	}
	,__class__: haxe_ds_EnumValueMap
});
var haxe_ds_GenericCell = function(elt,next) {
	this.elt = elt;
	this.next = next;
};
$hxClasses["haxe.ds.GenericCell"] = haxe_ds_GenericCell;
haxe_ds_GenericCell.__name__ = "haxe.ds.GenericCell";
haxe_ds_GenericCell.prototype = {
	elt: null
	,next: null
	,__class__: haxe_ds_GenericCell
};
var haxe_ds_GenericStack = function() {
};
$hxClasses["haxe.ds.GenericStack"] = haxe_ds_GenericStack;
haxe_ds_GenericStack.__name__ = "haxe.ds.GenericStack";
haxe_ds_GenericStack.prototype = {
	head: null
	,__class__: haxe_ds_GenericStack
};
var haxe_ds_IntMap = function() {
	this.h = { };
};
$hxClasses["haxe.ds.IntMap"] = haxe_ds_IntMap;
haxe_ds_IntMap.__name__ = "haxe.ds.IntMap";
haxe_ds_IntMap.__interfaces__ = [haxe_IMap];
haxe_ds_IntMap.prototype = {
	h: null
	,set: function(key,value) {
		this.h[key] = value;
	}
	,get: function(key) {
		return this.h[key];
	}
	,exists: function(key) {
		return this.h.hasOwnProperty(key);
	}
	,remove: function(key) {
		if(!this.h.hasOwnProperty(key)) {
			return false;
		}
		delete(this.h[key]);
		return true;
	}
	,keys: function() {
		var a = [];
		for( var key in this.h ) if(this.h.hasOwnProperty(key)) a.push(+key);
		return new haxe_iterators_ArrayIterator(a);
	}
	,iterator: function() {
		return { ref : this.h, it : this.keys(), hasNext : function() {
			return this.it.hasNext();
		}, next : function() {
			var i = this.it.next();
			return this.ref[i];
		}};
	}
	,keyValueIterator: function() {
		return new haxe_iterators_MapKeyValueIterator(this);
	}
	,__class__: haxe_ds_IntMap
};
var haxe_ds__$List_ListNode = function(item,next) {
	this.item = item;
	this.next = next;
};
$hxClasses["haxe.ds._List.ListNode"] = haxe_ds__$List_ListNode;
haxe_ds__$List_ListNode.__name__ = "haxe.ds._List.ListNode";
haxe_ds__$List_ListNode.prototype = {
	item: null
	,next: null
	,__class__: haxe_ds__$List_ListNode
};
var haxe_ds__$List_ListIterator = function(head) {
	this.head = head;
};
$hxClasses["haxe.ds._List.ListIterator"] = haxe_ds__$List_ListIterator;
haxe_ds__$List_ListIterator.__name__ = "haxe.ds._List.ListIterator";
haxe_ds__$List_ListIterator.prototype = {
	head: null
	,hasNext: function() {
		return this.head != null;
	}
	,next: function() {
		var val = this.head.item;
		this.head = this.head.next;
		return val;
	}
	,__class__: haxe_ds__$List_ListIterator
};
var haxe_ds_StringMap = function() {
	this.h = Object.create(null);
};
$hxClasses["haxe.ds.StringMap"] = haxe_ds_StringMap;
haxe_ds_StringMap.__name__ = "haxe.ds.StringMap";
haxe_ds_StringMap.__interfaces__ = [haxe_IMap];
haxe_ds_StringMap.stringify = function(h) {
	var s = "[";
	var first = true;
	for (var key in h) {
		if (first) first = false; else s += ',';
		s += key + ' => ' + Std.string(h[key]);
	}
	return s + "]";
};
haxe_ds_StringMap.prototype = {
	h: null
	,exists: function(key) {
		return Object.prototype.hasOwnProperty.call(this.h,key);
	}
	,get: function(key) {
		return this.h[key];
	}
	,set: function(key,value) {
		this.h[key] = value;
	}
	,remove: function(key) {
		if(Object.prototype.hasOwnProperty.call(this.h,key)) {
			delete(this.h[key]);
			return true;
		} else {
			return false;
		}
	}
	,keys: function() {
		return new haxe_ds__$StringMap_StringMapKeyIterator(this.h);
	}
	,iterator: function() {
		return new haxe_ds__$StringMap_StringMapValueIterator(this.h);
	}
	,keyValueIterator: function() {
		return new haxe_ds__$StringMap_StringMapKeyValueIterator(this.h);
	}
	,__class__: haxe_ds_StringMap
};
var haxe_ds__$StringMap_StringMapKeyIterator = function(h) {
	this.h = h;
	this.keys = Object.keys(h);
	this.length = this.keys.length;
	this.current = 0;
};
$hxClasses["haxe.ds._StringMap.StringMapKeyIterator"] = haxe_ds__$StringMap_StringMapKeyIterator;
haxe_ds__$StringMap_StringMapKeyIterator.__name__ = "haxe.ds._StringMap.StringMapKeyIterator";
haxe_ds__$StringMap_StringMapKeyIterator.prototype = {
	h: null
	,keys: null
	,length: null
	,current: null
	,hasNext: function() {
		return this.current < this.length;
	}
	,next: function() {
		return this.keys[this.current++];
	}
	,__class__: haxe_ds__$StringMap_StringMapKeyIterator
};
var haxe_ds__$StringMap_StringMapValueIterator = function(h) {
	this.h = h;
	this.keys = Object.keys(h);
	this.length = this.keys.length;
	this.current = 0;
};
$hxClasses["haxe.ds._StringMap.StringMapValueIterator"] = haxe_ds__$StringMap_StringMapValueIterator;
haxe_ds__$StringMap_StringMapValueIterator.__name__ = "haxe.ds._StringMap.StringMapValueIterator";
haxe_ds__$StringMap_StringMapValueIterator.prototype = {
	h: null
	,keys: null
	,length: null
	,current: null
	,hasNext: function() {
		return this.current < this.length;
	}
	,next: function() {
		return this.h[this.keys[this.current++]];
	}
	,__class__: haxe_ds__$StringMap_StringMapValueIterator
};
var haxe_ds__$StringMap_StringMapKeyValueIterator = function(h) {
	this.h = h;
	this.keys = Object.keys(h);
	this.length = this.keys.length;
	this.current = 0;
};
$hxClasses["haxe.ds._StringMap.StringMapKeyValueIterator"] = haxe_ds__$StringMap_StringMapKeyValueIterator;
haxe_ds__$StringMap_StringMapKeyValueIterator.__name__ = "haxe.ds._StringMap.StringMapKeyValueIterator";
haxe_ds__$StringMap_StringMapKeyValueIterator.prototype = {
	h: null
	,keys: null
	,length: null
	,current: null
	,hasNext: function() {
		return this.current < this.length;
	}
	,next: function() {
		var key = this.keys[this.current++];
		return { key : key, value : this.h[key]};
	}
	,__class__: haxe_ds__$StringMap_StringMapKeyValueIterator
};
var haxe_exceptions_PosException = function(message,previous,pos) {
	haxe_Exception.call(this,message,previous);
	if(pos == null) {
		this.posInfos = { fileName : "(unknown)", lineNumber : 0, className : "(unknown)", methodName : "(unknown)"};
	} else {
		this.posInfos = pos;
	}
	this.__skipStack++;
};
$hxClasses["haxe.exceptions.PosException"] = haxe_exceptions_PosException;
haxe_exceptions_PosException.__name__ = "haxe.exceptions.PosException";
haxe_exceptions_PosException.__super__ = haxe_Exception;
haxe_exceptions_PosException.prototype = $extend(haxe_Exception.prototype,{
	posInfos: null
	,toString: function() {
		return "" + haxe_Exception.prototype.toString.call(this) + " in " + this.posInfos.className + "." + this.posInfos.methodName + " at " + this.posInfos.fileName + ":" + this.posInfos.lineNumber;
	}
	,__class__: haxe_exceptions_PosException
});
var haxe_exceptions_NotImplementedException = function(message,previous,pos) {
	if(message == null) {
		message = "Not implemented";
	}
	haxe_exceptions_PosException.call(this,message,previous,pos);
	this.__skipStack++;
};
$hxClasses["haxe.exceptions.NotImplementedException"] = haxe_exceptions_NotImplementedException;
haxe_exceptions_NotImplementedException.__name__ = "haxe.exceptions.NotImplementedException";
haxe_exceptions_NotImplementedException.__super__ = haxe_exceptions_PosException;
haxe_exceptions_NotImplementedException.prototype = $extend(haxe_exceptions_PosException.prototype,{
	__class__: haxe_exceptions_NotImplementedException
});
var haxe_format_JsonParser = function(str) {
	this.str = str;
	this.pos = 0;
};
$hxClasses["haxe.format.JsonParser"] = haxe_format_JsonParser;
haxe_format_JsonParser.__name__ = "haxe.format.JsonParser";
haxe_format_JsonParser.prototype = {
	str: null
	,pos: null
	,doParse: function() {
		var result = this.parseRec();
		var c;
		while(true) {
			c = this.str.charCodeAt(this.pos++);
			var c1 = c;
			if(!(c1 == c1)) {
				break;
			}
			switch(c) {
			case 9:case 10:case 13:case 32:
				break;
			default:
				this.invalidChar();
			}
		}
		return result;
	}
	,parseRec: function() {
		while(true) {
			var c = this.str.charCodeAt(this.pos++);
			switch(c) {
			case 9:case 10:case 13:case 32:
				break;
			case 34:
				return this.parseString();
			case 45:case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:
				var c1 = c;
				var start = this.pos - 1;
				var minus = c1 == 45;
				var digit = !minus;
				var zero = c1 == 48;
				var point = false;
				var e = false;
				var pm = false;
				var end = false;
				do {
					c1 = this.str.charCodeAt(this.pos++);
					switch(c1) {
					case 43:case 45:
						if(!e || pm) {
							this.invalidNumber(start);
						}
						digit = false;
						pm = true;
						break;
					case 46:
						if(minus || point || e) {
							this.invalidNumber(start);
						}
						digit = false;
						point = true;
						break;
					case 48:
						if(zero && !point) {
							this.invalidNumber(start);
						}
						if(minus) {
							minus = false;
							zero = true;
						}
						digit = true;
						break;
					case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:
						if(zero && !point) {
							this.invalidNumber(start);
						}
						if(minus) {
							minus = false;
						}
						digit = true;
						zero = false;
						break;
					case 69:case 101:
						if(minus || zero || e) {
							this.invalidNumber(start);
						}
						digit = false;
						e = true;
						break;
					default:
						if(!digit) {
							this.invalidNumber(start);
						}
						this.pos--;
						end = true;
					}
				} while(!end);
				var f = parseFloat(HxOverrides.substr(this.str,start,this.pos - start));
				if(point) {
					return f;
				} else {
					var i = f | 0;
					if(i == f) {
						return i;
					} else {
						return f;
					}
				}
				break;
			case 91:
				var arr = [];
				var comma = null;
				while(true) {
					var c2 = this.str.charCodeAt(this.pos++);
					switch(c2) {
					case 9:case 10:case 13:case 32:
						break;
					case 44:
						if(comma) {
							comma = false;
						} else {
							this.invalidChar();
						}
						break;
					case 93:
						if(comma == false) {
							this.invalidChar();
						}
						return arr;
					default:
						if(comma) {
							this.invalidChar();
						}
						this.pos--;
						arr.push(this.parseRec());
						comma = true;
					}
				}
				break;
			case 102:
				var save = this.pos;
				if(this.str.charCodeAt(this.pos++) != 97 || this.str.charCodeAt(this.pos++) != 108 || this.str.charCodeAt(this.pos++) != 115 || this.str.charCodeAt(this.pos++) != 101) {
					this.pos = save;
					this.invalidChar();
				}
				return false;
			case 110:
				var save1 = this.pos;
				if(this.str.charCodeAt(this.pos++) != 117 || this.str.charCodeAt(this.pos++) != 108 || this.str.charCodeAt(this.pos++) != 108) {
					this.pos = save1;
					this.invalidChar();
				}
				return null;
			case 116:
				var save2 = this.pos;
				if(this.str.charCodeAt(this.pos++) != 114 || this.str.charCodeAt(this.pos++) != 117 || this.str.charCodeAt(this.pos++) != 101) {
					this.pos = save2;
					this.invalidChar();
				}
				return true;
			case 123:
				var obj = { };
				var field = null;
				var comma1 = null;
				while(true) {
					var c3 = this.str.charCodeAt(this.pos++);
					switch(c3) {
					case 9:case 10:case 13:case 32:
						break;
					case 34:
						if(field != null || comma1) {
							this.invalidChar();
						}
						field = this.parseString();
						break;
					case 44:
						if(comma1) {
							comma1 = false;
						} else {
							this.invalidChar();
						}
						break;
					case 58:
						if(field == null) {
							this.invalidChar();
						}
						obj[field] = this.parseRec();
						field = null;
						comma1 = true;
						break;
					case 125:
						if(field != null || comma1 == false) {
							this.invalidChar();
						}
						return obj;
					default:
						this.invalidChar();
					}
				}
				break;
			default:
				this.invalidChar();
			}
		}
	}
	,parseString: function() {
		var start = this.pos;
		var buf = null;
		var prev = -1;
		while(true) {
			var c = this.str.charCodeAt(this.pos++);
			if(c == 34) {
				break;
			}
			if(c == 92) {
				if(buf == null) {
					buf = new StringBuf();
				}
				var s = this.str;
				var len = this.pos - start - 1;
				buf.b += len == null ? HxOverrides.substr(s,start,null) : HxOverrides.substr(s,start,len);
				c = this.str.charCodeAt(this.pos++);
				if(c != 117 && prev != -1) {
					buf.b += String.fromCodePoint(65533);
					prev = -1;
				}
				switch(c) {
				case 34:case 47:case 92:
					buf.b += String.fromCodePoint(c);
					break;
				case 98:
					buf.b += String.fromCodePoint(8);
					break;
				case 102:
					buf.b += String.fromCodePoint(12);
					break;
				case 110:
					buf.b += String.fromCodePoint(10);
					break;
				case 114:
					buf.b += String.fromCodePoint(13);
					break;
				case 116:
					buf.b += String.fromCodePoint(9);
					break;
				case 117:
					var uc = Std.parseInt("0x" + HxOverrides.substr(this.str,this.pos,4));
					this.pos += 4;
					if(prev != -1) {
						if(uc < 56320 || uc > 57343) {
							buf.b += String.fromCodePoint(65533);
							prev = -1;
						} else {
							buf.b += String.fromCodePoint(((prev - 55296 << 10) + (uc - 56320) + 65536));
							prev = -1;
						}
					} else if(uc >= 55296 && uc <= 56319) {
						prev = uc;
					} else {
						buf.b += String.fromCodePoint(uc);
					}
					break;
				default:
					throw haxe_Exception.thrown("Invalid escape sequence \\" + String.fromCodePoint(c) + " at position " + (this.pos - 1));
				}
				start = this.pos;
			} else if(c != c) {
				throw haxe_Exception.thrown("Unclosed string");
			}
		}
		if(prev != -1) {
			buf.b += String.fromCodePoint(65533);
			prev = -1;
		}
		if(buf == null) {
			return HxOverrides.substr(this.str,start,this.pos - start - 1);
		} else {
			var s = this.str;
			var len = this.pos - start - 1;
			buf.b += len == null ? HxOverrides.substr(s,start,null) : HxOverrides.substr(s,start,len);
			return buf.b;
		}
	}
	,invalidChar: function() {
		this.pos--;
		throw haxe_Exception.thrown("Invalid char " + this.str.charCodeAt(this.pos) + " at position " + this.pos);
	}
	,invalidNumber: function(start) {
		throw haxe_Exception.thrown("Invalid number at position " + start + ": " + HxOverrides.substr(this.str,start,this.pos - start));
	}
	,__class__: haxe_format_JsonParser
};
var haxe_format_JsonPrinter = function(replacer,space) {
	this.replacer = replacer;
	this.indent = space;
	this.pretty = space != null;
	this.nind = 0;
	this.buf = new StringBuf();
};
$hxClasses["haxe.format.JsonPrinter"] = haxe_format_JsonPrinter;
haxe_format_JsonPrinter.__name__ = "haxe.format.JsonPrinter";
haxe_format_JsonPrinter.print = function(o,replacer,space) {
	var printer = new haxe_format_JsonPrinter(replacer,space);
	printer.write("",o);
	return printer.buf.b;
};
haxe_format_JsonPrinter.prototype = {
	buf: null
	,replacer: null
	,indent: null
	,pretty: null
	,nind: null
	,write: function(k,v) {
		if(this.replacer != null) {
			v = this.replacer(k,v);
		}
		var _g = Type.typeof(v);
		switch(_g._hx_index) {
		case 0:
			this.buf.b += "null";
			break;
		case 1:
			this.buf.b += Std.string(v);
			break;
		case 2:
			var v1 = isFinite(v) ? Std.string(v) : "null";
			this.buf.b += Std.string(v1);
			break;
		case 3:
			this.buf.b += Std.string(v);
			break;
		case 4:
			this.fieldsString(v,Reflect.fields(v));
			break;
		case 5:
			this.buf.b += "\"<fun>\"";
			break;
		case 6:
			var c = _g.c;
			if(c == String) {
				this.quote(v);
			} else if(c == Array) {
				var v1 = v;
				this.buf.b += String.fromCodePoint(91);
				var len = v1.length;
				var last = len - 1;
				var _g1 = 0;
				var _g2 = len;
				while(_g1 < _g2) {
					var i = _g1++;
					if(i > 0) {
						this.buf.b += String.fromCodePoint(44);
					} else {
						this.nind++;
					}
					if(this.pretty) {
						this.buf.b += String.fromCodePoint(10);
					}
					if(this.pretty) {
						var v2 = StringTools.lpad("",this.indent,this.nind * this.indent.length);
						this.buf.b += Std.string(v2);
					}
					this.write(i,v1[i]);
					if(i == last) {
						this.nind--;
						if(this.pretty) {
							this.buf.b += String.fromCodePoint(10);
						}
						if(this.pretty) {
							var v3 = StringTools.lpad("",this.indent,this.nind * this.indent.length);
							this.buf.b += Std.string(v3);
						}
					}
				}
				this.buf.b += String.fromCodePoint(93);
			} else if(c == haxe_ds_StringMap) {
				var v1 = v;
				var o = { };
				var h = v1.h;
				var _g_h = h;
				var _g_keys = Object.keys(h);
				var _g_length = _g_keys.length;
				var _g_current = 0;
				while(_g_current < _g_length) {
					var k = _g_keys[_g_current++];
					o[k] = v1.h[k];
				}
				var v1 = o;
				this.fieldsString(v1,Reflect.fields(v1));
			} else if(c == Date) {
				var v1 = v;
				this.quote(HxOverrides.dateStr(v1));
			} else {
				this.classString(v);
			}
			break;
		case 7:
			var _g1 = _g.e;
			var i = v._hx_index;
			this.buf.b += Std.string(i == null ? "null" : "" + i);
			break;
		case 8:
			this.buf.b += "\"???\"";
			break;
		}
	}
	,classString: function(v) {
		this.fieldsString(v,Type.getInstanceFields(js_Boot.getClass(v)));
	}
	,fieldsString: function(v,fields) {
		this.buf.b += String.fromCodePoint(123);
		var len = fields.length;
		var last = len - 1;
		var first = true;
		var _g = 0;
		var _g1 = len;
		while(_g < _g1) {
			var i = _g++;
			var f = fields[i];
			var value = Reflect.field(v,f);
			if(Reflect.isFunction(value)) {
				continue;
			}
			if(first) {
				this.nind++;
				first = false;
			} else {
				this.buf.b += String.fromCodePoint(44);
			}
			if(this.pretty) {
				this.buf.b += String.fromCodePoint(10);
			}
			if(this.pretty) {
				var v1 = StringTools.lpad("",this.indent,this.nind * this.indent.length);
				this.buf.b += Std.string(v1);
			}
			this.quote(f);
			this.buf.b += String.fromCodePoint(58);
			if(this.pretty) {
				this.buf.b += String.fromCodePoint(32);
			}
			this.write(f,value);
			if(i == last) {
				this.nind--;
				if(this.pretty) {
					this.buf.b += String.fromCodePoint(10);
				}
				if(this.pretty) {
					var v2 = StringTools.lpad("",this.indent,this.nind * this.indent.length);
					this.buf.b += Std.string(v2);
				}
			}
		}
		this.buf.b += String.fromCodePoint(125);
	}
	,quote: function(s) {
		this.buf.b += String.fromCodePoint(34);
		var i = 0;
		var length = s.length;
		while(i < length) {
			var c = s.charCodeAt(i++);
			switch(c) {
			case 8:
				this.buf.b += "\\b";
				break;
			case 9:
				this.buf.b += "\\t";
				break;
			case 10:
				this.buf.b += "\\n";
				break;
			case 12:
				this.buf.b += "\\f";
				break;
			case 13:
				this.buf.b += "\\r";
				break;
			case 34:
				this.buf.b += "\\\"";
				break;
			case 92:
				this.buf.b += "\\\\";
				break;
			default:
				this.buf.b += String.fromCodePoint(c);
			}
		}
		this.buf.b += String.fromCodePoint(34);
	}
	,__class__: haxe_format_JsonPrinter
};
var haxe_io_BytesBuffer = function() {
	this.pos = 0;
	this.size = 0;
};
$hxClasses["haxe.io.BytesBuffer"] = haxe_io_BytesBuffer;
haxe_io_BytesBuffer.__name__ = "haxe.io.BytesBuffer";
haxe_io_BytesBuffer.prototype = {
	buffer: null
	,view: null
	,u8: null
	,pos: null
	,size: null
	,addByte: function(byte) {
		if(this.pos == this.size) {
			this.grow(1);
		}
		this.view.setUint8(this.pos++,byte);
	}
	,add: function(src) {
		if(this.pos + src.length > this.size) {
			this.grow(src.length);
		}
		if(this.size == 0) {
			return;
		}
		var sub = new Uint8Array(src.b.buffer,src.b.byteOffset,src.length);
		this.u8.set(sub,this.pos);
		this.pos += src.length;
	}
	,addBytes: function(src,pos,len) {
		if(pos < 0 || len < 0 || pos + len > src.length) {
			throw haxe_Exception.thrown(haxe_io_Error.OutsideBounds);
		}
		if(this.pos + len > this.size) {
			this.grow(len);
		}
		if(this.size == 0) {
			return;
		}
		var sub = new Uint8Array(src.b.buffer,src.b.byteOffset + pos,len);
		this.u8.set(sub,this.pos);
		this.pos += len;
	}
	,grow: function(delta) {
		var req = this.pos + delta;
		var nsize = this.size == 0 ? 16 : this.size;
		while(nsize < req) nsize = nsize * 3 >> 1;
		var nbuf = new ArrayBuffer(nsize);
		var nu8 = new Uint8Array(nbuf);
		if(this.size > 0) {
			nu8.set(this.u8);
		}
		this.size = nsize;
		this.buffer = nbuf;
		this.u8 = nu8;
		this.view = new DataView(this.buffer);
	}
	,getBytes: function() {
		if(this.size == 0) {
			return new haxe_io_Bytes(new ArrayBuffer(0));
		}
		var b = new haxe_io_Bytes(this.buffer);
		b.length = this.pos;
		return b;
	}
	,__class__: haxe_io_BytesBuffer
};
var haxe_io_Input = function() { };
$hxClasses["haxe.io.Input"] = haxe_io_Input;
haxe_io_Input.__name__ = "haxe.io.Input";
haxe_io_Input.prototype = {
	bigEndian: null
	,readByte: function() {
		throw new haxe_exceptions_NotImplementedException(null,null,{ fileName : "haxe/io/Input.hx", lineNumber : 53, className : "haxe.io.Input", methodName : "readByte"});
	}
	,readBytes: function(s,pos,len) {
		var k = len;
		var b = s.b;
		if(pos < 0 || len < 0 || pos + len > s.length) {
			throw haxe_Exception.thrown(haxe_io_Error.OutsideBounds);
		}
		try {
			while(k > 0) {
				b[pos] = this.readByte();
				++pos;
				--k;
			}
		} catch( _g ) {
			haxe_NativeStackTrace.lastError = _g;
			if(!((haxe_Exception.caught(_g).unwrap()) instanceof haxe_io_Eof)) {
				throw _g;
			}
		}
		return len - k;
	}
	,set_bigEndian: function(b) {
		this.bigEndian = b;
		return b;
	}
	,readFullBytes: function(s,pos,len) {
		while(len > 0) {
			var k = this.readBytes(s,pos,len);
			if(k == 0) {
				throw haxe_Exception.thrown(haxe_io_Error.Blocked);
			}
			pos += k;
			len -= k;
		}
	}
	,read: function(nbytes) {
		var s = new haxe_io_Bytes(new ArrayBuffer(nbytes));
		var p = 0;
		while(nbytes > 0) {
			var k = this.readBytes(s,p,nbytes);
			if(k == 0) {
				throw haxe_Exception.thrown(haxe_io_Error.Blocked);
			}
			p += k;
			nbytes -= k;
		}
		return s;
	}
	,readFloat: function() {
		return haxe_io_FPHelper.i32ToFloat(this.readInt32());
	}
	,readDouble: function() {
		var i1 = this.readInt32();
		var i2 = this.readInt32();
		if(this.bigEndian) {
			return haxe_io_FPHelper.i64ToDouble(i2,i1);
		} else {
			return haxe_io_FPHelper.i64ToDouble(i1,i2);
		}
	}
	,readInt16: function() {
		var ch1 = this.readByte();
		var ch2 = this.readByte();
		var n = this.bigEndian ? ch2 | ch1 << 8 : ch1 | ch2 << 8;
		if((n & 32768) != 0) {
			return n - 65536;
		}
		return n;
	}
	,readUInt16: function() {
		var ch1 = this.readByte();
		var ch2 = this.readByte();
		if(this.bigEndian) {
			return ch2 | ch1 << 8;
		} else {
			return ch1 | ch2 << 8;
		}
	}
	,readInt32: function() {
		var ch1 = this.readByte();
		var ch2 = this.readByte();
		var ch3 = this.readByte();
		var ch4 = this.readByte();
		if(this.bigEndian) {
			return ch4 | ch3 << 8 | ch2 << 16 | ch1 << 24;
		} else {
			return ch1 | ch2 << 8 | ch3 << 16 | ch4 << 24;
		}
	}
	,readString: function(len,encoding) {
		var b = new haxe_io_Bytes(new ArrayBuffer(len));
		this.readFullBytes(b,0,len);
		return b.getString(0,len,encoding);
	}
	,__class__: haxe_io_Input
	,__properties__: {set_bigEndian:"set_bigEndian"}
};
var haxe_io_BytesInput = function(b,pos,len) {
	if(pos == null) {
		pos = 0;
	}
	if(len == null) {
		len = b.length - pos;
	}
	if(pos < 0 || len < 0 || pos + len > b.length) {
		throw haxe_Exception.thrown(haxe_io_Error.OutsideBounds);
	}
	this.b = b.b;
	this.pos = pos;
	this.len = len;
	this.totlen = len;
};
$hxClasses["haxe.io.BytesInput"] = haxe_io_BytesInput;
haxe_io_BytesInput.__name__ = "haxe.io.BytesInput";
haxe_io_BytesInput.__super__ = haxe_io_Input;
haxe_io_BytesInput.prototype = $extend(haxe_io_Input.prototype,{
	b: null
	,pos: null
	,len: null
	,totlen: null
	,readByte: function() {
		if(this.len == 0) {
			throw haxe_Exception.thrown(new haxe_io_Eof());
		}
		this.len--;
		return this.b[this.pos++];
	}
	,readBytes: function(buf,pos,len) {
		if(pos < 0 || len < 0 || pos + len > buf.length) {
			throw haxe_Exception.thrown(haxe_io_Error.OutsideBounds);
		}
		if(this.len == 0 && len > 0) {
			throw haxe_Exception.thrown(new haxe_io_Eof());
		}
		if(this.len < len) {
			len = this.len;
		}
		var b1 = this.b;
		var b2 = buf.b;
		var _g = 0;
		var _g1 = len;
		while(_g < _g1) {
			var i = _g++;
			b2[pos + i] = b1[this.pos + i];
		}
		this.pos += len;
		this.len -= len;
		return len;
	}
	,__class__: haxe_io_BytesInput
});
var haxe_io_Output = function() { };
$hxClasses["haxe.io.Output"] = haxe_io_Output;
haxe_io_Output.__name__ = "haxe.io.Output";
haxe_io_Output.prototype = {
	bigEndian: null
	,writeByte: function(c) {
		throw new haxe_exceptions_NotImplementedException(null,null,{ fileName : "haxe/io/Output.hx", lineNumber : 47, className : "haxe.io.Output", methodName : "writeByte"});
	}
	,writeBytes: function(s,pos,len) {
		if(pos < 0 || len < 0 || pos + len > s.length) {
			throw haxe_Exception.thrown(haxe_io_Error.OutsideBounds);
		}
		var b = s.b;
		var k = len;
		while(k > 0) {
			this.writeByte(b[pos]);
			++pos;
			--k;
		}
		return len;
	}
	,set_bigEndian: function(b) {
		this.bigEndian = b;
		return b;
	}
	,write: function(s) {
		var l = s.length;
		var p = 0;
		while(l > 0) {
			var k = this.writeBytes(s,p,l);
			if(k == 0) {
				throw haxe_Exception.thrown(haxe_io_Error.Blocked);
			}
			p += k;
			l -= k;
		}
	}
	,writeFullBytes: function(s,pos,len) {
		while(len > 0) {
			var k = this.writeBytes(s,pos,len);
			pos += k;
			len -= k;
		}
	}
	,writeDouble: function(x) {
		var i64 = haxe_io_FPHelper.doubleToI64(x);
		if(this.bigEndian) {
			this.writeInt32(i64.high);
			this.writeInt32(i64.low);
		} else {
			this.writeInt32(i64.low);
			this.writeInt32(i64.high);
		}
	}
	,writeUInt16: function(x) {
		if(x < 0 || x >= 65536) {
			throw haxe_Exception.thrown(haxe_io_Error.Overflow);
		}
		if(this.bigEndian) {
			this.writeByte(x >> 8);
			this.writeByte(x & 255);
		} else {
			this.writeByte(x & 255);
			this.writeByte(x >> 8);
		}
	}
	,writeInt32: function(x) {
		if(this.bigEndian) {
			this.writeByte(x >>> 24);
			this.writeByte(x >> 16 & 255);
			this.writeByte(x >> 8 & 255);
			this.writeByte(x & 255);
		} else {
			this.writeByte(x & 255);
			this.writeByte(x >> 8 & 255);
			this.writeByte(x >> 16 & 255);
			this.writeByte(x >>> 24);
		}
	}
	,writeString: function(s,encoding) {
		var b = haxe_io_Bytes.ofString(s,encoding);
		this.writeFullBytes(b,0,b.length);
	}
	,__class__: haxe_io_Output
	,__properties__: {set_bigEndian:"set_bigEndian"}
};
var haxe_io_BytesOutput = function() {
	this.b = new haxe_io_BytesBuffer();
};
$hxClasses["haxe.io.BytesOutput"] = haxe_io_BytesOutput;
haxe_io_BytesOutput.__name__ = "haxe.io.BytesOutput";
haxe_io_BytesOutput.__super__ = haxe_io_Output;
haxe_io_BytesOutput.prototype = $extend(haxe_io_Output.prototype,{
	b: null
	,writeByte: function(c) {
		this.b.addByte(c);
	}
	,writeBytes: function(buf,pos,len) {
		this.b.addBytes(buf,pos,len);
		return len;
	}
	,getBytes: function() {
		return this.b.getBytes();
	}
	,__class__: haxe_io_BytesOutput
});
var haxe_io_Eof = function() {
};
$hxClasses["haxe.io.Eof"] = haxe_io_Eof;
haxe_io_Eof.__name__ = "haxe.io.Eof";
haxe_io_Eof.prototype = {
	toString: function() {
		return "Eof";
	}
	,__class__: haxe_io_Eof
};
var haxe_io_Error = $hxEnums["haxe.io.Error"] = { __ename__:"haxe.io.Error",__constructs__:null
	,Blocked: {_hx_name:"Blocked",_hx_index:0,__enum__:"haxe.io.Error",toString:$estr}
	,Overflow: {_hx_name:"Overflow",_hx_index:1,__enum__:"haxe.io.Error",toString:$estr}
	,OutsideBounds: {_hx_name:"OutsideBounds",_hx_index:2,__enum__:"haxe.io.Error",toString:$estr}
	,Custom: ($_=function(e) { return {_hx_index:3,e:e,__enum__:"haxe.io.Error",toString:$estr}; },$_._hx_name="Custom",$_.__params__ = ["e"],$_)
};
haxe_io_Error.__constructs__ = [haxe_io_Error.Blocked,haxe_io_Error.Overflow,haxe_io_Error.OutsideBounds,haxe_io_Error.Custom];
var haxe_io_FPHelper = function() { };
$hxClasses["haxe.io.FPHelper"] = haxe_io_FPHelper;
haxe_io_FPHelper.__name__ = "haxe.io.FPHelper";
haxe_io_FPHelper.i32ToFloat = function(i) {
	haxe_io_FPHelper.helper.setInt32(0,i,true);
	return haxe_io_FPHelper.helper.getFloat32(0,true);
};
haxe_io_FPHelper.floatToI32 = function(f) {
	haxe_io_FPHelper.helper.setFloat32(0,f,true);
	return haxe_io_FPHelper.helper.getInt32(0,true);
};
haxe_io_FPHelper.i64ToDouble = function(low,high) {
	haxe_io_FPHelper.helper.setInt32(0,low,true);
	haxe_io_FPHelper.helper.setInt32(4,high,true);
	return haxe_io_FPHelper.helper.getFloat64(0,true);
};
haxe_io_FPHelper.doubleToI64 = function(v) {
	var i64 = haxe_io_FPHelper.i64tmp;
	haxe_io_FPHelper.helper.setFloat64(0,v,true);
	i64.low = haxe_io_FPHelper.helper.getInt32(0,true);
	i64.high = haxe_io_FPHelper.helper.getInt32(4,true);
	return i64;
};
var haxe_io_Float32Array = {};
haxe_io_Float32Array.fromBytes = function(bytes,bytePos,length) {
	if(bytePos == null) {
		bytePos = 0;
	}
	if(length == null) {
		length = bytes.length - bytePos >> 2;
	}
	return new Float32Array(bytes.b.bufferValue,bytePos,length);
};
var haxe_io_Path = function(path) {
	switch(path) {
	case ".":case "..":
		this.dir = path;
		this.file = "";
		return;
	}
	var c1 = path.lastIndexOf("/");
	var c2 = path.lastIndexOf("\\");
	if(c1 < c2) {
		this.dir = HxOverrides.substr(path,0,c2);
		path = HxOverrides.substr(path,c2 + 1,null);
		this.backslash = true;
	} else if(c2 < c1) {
		this.dir = HxOverrides.substr(path,0,c1);
		path = HxOverrides.substr(path,c1 + 1,null);
	} else {
		this.dir = null;
	}
	var cp = path.lastIndexOf(".");
	if(cp != -1) {
		this.ext = HxOverrides.substr(path,cp + 1,null);
		this.file = HxOverrides.substr(path,0,cp);
	} else {
		this.ext = null;
		this.file = path;
	}
};
$hxClasses["haxe.io.Path"] = haxe_io_Path;
haxe_io_Path.__name__ = "haxe.io.Path";
haxe_io_Path.withoutDirectory = function(path) {
	var s = new haxe_io_Path(path);
	s.dir = null;
	return s.toString();
};
haxe_io_Path.directory = function(path) {
	var s = new haxe_io_Path(path);
	if(s.dir == null) {
		return "";
	}
	return s.dir;
};
haxe_io_Path.extension = function(path) {
	var s = new haxe_io_Path(path);
	if(s.ext == null) {
		return "";
	}
	return s.ext;
};
haxe_io_Path.prototype = {
	dir: null
	,file: null
	,ext: null
	,backslash: null
	,toString: function() {
		return (this.dir == null ? "" : this.dir + (this.backslash ? "\\" : "/")) + this.file + (this.ext == null ? "" : "." + this.ext);
	}
	,__class__: haxe_io_Path
};
var haxe_iterators_ArrayIterator = function(array) {
	this.current = 0;
	this.array = array;
};
$hxClasses["haxe.iterators.ArrayIterator"] = haxe_iterators_ArrayIterator;
haxe_iterators_ArrayIterator.__name__ = "haxe.iterators.ArrayIterator";
haxe_iterators_ArrayIterator.prototype = {
	array: null
	,current: null
	,hasNext: function() {
		return this.current < this.array.length;
	}
	,next: function() {
		return this.array[this.current++];
	}
	,__class__: haxe_iterators_ArrayIterator
};
var haxe_iterators_ArrayKeyValueIterator = function(array) {
	this.current = 0;
	this.array = array;
};
$hxClasses["haxe.iterators.ArrayKeyValueIterator"] = haxe_iterators_ArrayKeyValueIterator;
haxe_iterators_ArrayKeyValueIterator.__name__ = "haxe.iterators.ArrayKeyValueIterator";
haxe_iterators_ArrayKeyValueIterator.prototype = {
	current: null
	,array: null
	,hasNext: function() {
		return this.current < this.array.length;
	}
	,next: function() {
		return { value : this.array[this.current], key : this.current++};
	}
	,__class__: haxe_iterators_ArrayKeyValueIterator
};
var haxe_iterators_MapKeyValueIterator = function(map) {
	this.map = map;
	this.keys = map.keys();
};
$hxClasses["haxe.iterators.MapKeyValueIterator"] = haxe_iterators_MapKeyValueIterator;
haxe_iterators_MapKeyValueIterator.__name__ = "haxe.iterators.MapKeyValueIterator";
haxe_iterators_MapKeyValueIterator.prototype = {
	map: null
	,keys: null
	,hasNext: function() {
		return this.keys.hasNext();
	}
	,next: function() {
		var key = this.keys.next();
		return { value : this.map.get(key), key : key};
	}
	,__class__: haxe_iterators_MapKeyValueIterator
};
var haxe_xml_XmlParserException = function(message,xml,position) {
	this.xml = xml;
	this.message = message;
	this.position = position;
	this.lineNumber = 1;
	this.positionAtLine = 0;
	var _g = 0;
	var _g1 = position;
	while(_g < _g1) {
		var i = _g++;
		var c = xml.charCodeAt(i);
		if(c == 10) {
			this.lineNumber++;
			this.positionAtLine = 0;
		} else if(c != 13) {
			this.positionAtLine++;
		}
	}
};
$hxClasses["haxe.xml.XmlParserException"] = haxe_xml_XmlParserException;
haxe_xml_XmlParserException.__name__ = "haxe.xml.XmlParserException";
haxe_xml_XmlParserException.prototype = {
	message: null
	,lineNumber: null
	,positionAtLine: null
	,position: null
	,xml: null
	,toString: function() {
		var c = js_Boot.getClass(this);
		return c.__name__ + ": " + this.message + " at line " + this.lineNumber + " char " + this.positionAtLine;
	}
	,__class__: haxe_xml_XmlParserException
};
var haxe_xml_Parser = function() { };
$hxClasses["haxe.xml.Parser"] = haxe_xml_Parser;
haxe_xml_Parser.__name__ = "haxe.xml.Parser";
haxe_xml_Parser.parse = function(str,strict) {
	if(strict == null) {
		strict = false;
	}
	var doc = Xml.createDocument();
	haxe_xml_Parser.doParse(str,strict,0,doc);
	return doc;
};
haxe_xml_Parser.doParse = function(str,strict,p,parent) {
	if(p == null) {
		p = 0;
	}
	var xml = null;
	var state = 1;
	var next = 1;
	var aname = null;
	var start = 0;
	var nsubs = 0;
	var nbrackets = 0;
	var buf = new StringBuf();
	var escapeNext = 1;
	var attrValQuote = -1;
	while(p < str.length) {
		var c = str.charCodeAt(p);
		switch(state) {
		case 0:
			switch(c) {
			case 9:case 10:case 13:case 32:
				break;
			default:
				state = next;
				continue;
			}
			break;
		case 1:
			if(c == 60) {
				state = 0;
				next = 2;
			} else {
				start = p;
				state = 13;
				continue;
			}
			break;
		case 2:
			switch(c) {
			case 33:
				if(str.charCodeAt(p + 1) == 91) {
					p += 2;
					if(HxOverrides.substr(str,p,6).toUpperCase() != "CDATA[") {
						throw haxe_Exception.thrown(new haxe_xml_XmlParserException("Expected <![CDATA[",str,p));
					}
					p += 5;
					state = 17;
					start = p + 1;
				} else if(str.charCodeAt(p + 1) == 68 || str.charCodeAt(p + 1) == 100) {
					if(HxOverrides.substr(str,p + 2,6).toUpperCase() != "OCTYPE") {
						throw haxe_Exception.thrown(new haxe_xml_XmlParserException("Expected <!DOCTYPE",str,p));
					}
					p += 8;
					state = 16;
					start = p + 1;
				} else if(str.charCodeAt(p + 1) != 45 || str.charCodeAt(p + 2) != 45) {
					throw haxe_Exception.thrown(new haxe_xml_XmlParserException("Expected <!--",str,p));
				} else {
					p += 2;
					state = 15;
					start = p + 1;
				}
				break;
			case 47:
				if(parent == null) {
					throw haxe_Exception.thrown(new haxe_xml_XmlParserException("Expected node name",str,p));
				}
				start = p + 1;
				state = 0;
				next = 10;
				break;
			case 63:
				state = 14;
				start = p;
				break;
			default:
				state = 3;
				start = p;
				continue;
			}
			break;
		case 3:
			if(!(c >= 97 && c <= 122 || c >= 65 && c <= 90 || c >= 48 && c <= 57 || c == 58 || c == 46 || c == 95 || c == 45)) {
				if(p == start) {
					throw haxe_Exception.thrown(new haxe_xml_XmlParserException("Expected node name",str,p));
				}
				xml = Xml.createElement(HxOverrides.substr(str,start,p - start));
				parent.addChild(xml);
				++nsubs;
				state = 0;
				next = 4;
				continue;
			}
			break;
		case 4:
			switch(c) {
			case 47:
				state = 11;
				break;
			case 62:
				state = 9;
				break;
			default:
				state = 5;
				start = p;
				continue;
			}
			break;
		case 5:
			if(!(c >= 97 && c <= 122 || c >= 65 && c <= 90 || c >= 48 && c <= 57 || c == 58 || c == 46 || c == 95 || c == 45)) {
				if(start == p) {
					throw haxe_Exception.thrown(new haxe_xml_XmlParserException("Expected attribute name",str,p));
				}
				var tmp = HxOverrides.substr(str,start,p - start);
				aname = tmp;
				if(xml.exists(aname)) {
					throw haxe_Exception.thrown(new haxe_xml_XmlParserException("Duplicate attribute [" + aname + "]",str,p));
				}
				state = 0;
				next = 6;
				continue;
			}
			break;
		case 6:
			if(c == 61) {
				state = 0;
				next = 7;
			} else {
				throw haxe_Exception.thrown(new haxe_xml_XmlParserException("Expected =",str,p));
			}
			break;
		case 7:
			switch(c) {
			case 34:case 39:
				buf = new StringBuf();
				state = 8;
				start = p + 1;
				attrValQuote = c;
				break;
			default:
				throw haxe_Exception.thrown(new haxe_xml_XmlParserException("Expected \"",str,p));
			}
			break;
		case 8:
			switch(c) {
			case 38:
				var len = p - start;
				buf.b += len == null ? HxOverrides.substr(str,start,null) : HxOverrides.substr(str,start,len);
				state = 18;
				escapeNext = 8;
				start = p + 1;
				break;
			case 60:case 62:
				if(strict) {
					throw haxe_Exception.thrown(new haxe_xml_XmlParserException("Invalid unescaped " + String.fromCodePoint(c) + " in attribute value",str,p));
				} else if(c == attrValQuote) {
					var len1 = p - start;
					buf.b += len1 == null ? HxOverrides.substr(str,start,null) : HxOverrides.substr(str,start,len1);
					var val = buf.b;
					buf = new StringBuf();
					xml.set(aname,val);
					state = 0;
					next = 4;
				}
				break;
			default:
				if(c == attrValQuote) {
					var len2 = p - start;
					buf.b += len2 == null ? HxOverrides.substr(str,start,null) : HxOverrides.substr(str,start,len2);
					var val1 = buf.b;
					buf = new StringBuf();
					xml.set(aname,val1);
					state = 0;
					next = 4;
				}
			}
			break;
		case 9:
			p = haxe_xml_Parser.doParse(str,strict,p,xml);
			start = p;
			state = 1;
			break;
		case 10:
			if(!(c >= 97 && c <= 122 || c >= 65 && c <= 90 || c >= 48 && c <= 57 || c == 58 || c == 46 || c == 95 || c == 45)) {
				if(start == p) {
					throw haxe_Exception.thrown(new haxe_xml_XmlParserException("Expected node name",str,p));
				}
				var v = HxOverrides.substr(str,start,p - start);
				if(parent == null || parent.nodeType != 0) {
					throw haxe_Exception.thrown(new haxe_xml_XmlParserException("Unexpected </" + v + ">, tag is not open",str,p));
				}
				if(parent.nodeType != Xml.Element) {
					throw haxe_Exception.thrown("Bad node type, expected Element but found " + (parent.nodeType == null ? "null" : XmlType.toString(parent.nodeType)));
				}
				if(v != parent.nodeName) {
					if(parent.nodeType != Xml.Element) {
						throw haxe_Exception.thrown("Bad node type, expected Element but found " + (parent.nodeType == null ? "null" : XmlType.toString(parent.nodeType)));
					}
					throw haxe_Exception.thrown(new haxe_xml_XmlParserException("Expected </" + parent.nodeName + ">",str,p));
				}
				state = 0;
				next = 12;
				continue;
			}
			break;
		case 11:
			if(c == 62) {
				state = 1;
			} else {
				throw haxe_Exception.thrown(new haxe_xml_XmlParserException("Expected >",str,p));
			}
			break;
		case 12:
			if(c == 62) {
				if(nsubs == 0) {
					parent.addChild(Xml.createPCData(""));
				}
				return p;
			} else {
				throw haxe_Exception.thrown(new haxe_xml_XmlParserException("Expected >",str,p));
			}
			break;
		case 13:
			if(c == 60) {
				var len3 = p - start;
				buf.b += len3 == null ? HxOverrides.substr(str,start,null) : HxOverrides.substr(str,start,len3);
				var child = Xml.createPCData(buf.b);
				buf = new StringBuf();
				parent.addChild(child);
				++nsubs;
				state = 0;
				next = 2;
			} else if(c == 38) {
				var len4 = p - start;
				buf.b += len4 == null ? HxOverrides.substr(str,start,null) : HxOverrides.substr(str,start,len4);
				state = 18;
				escapeNext = 13;
				start = p + 1;
			}
			break;
		case 14:
			if(c == 63 && str.charCodeAt(p + 1) == 62) {
				++p;
				var str1 = HxOverrides.substr(str,start + 1,p - start - 2);
				parent.addChild(Xml.createProcessingInstruction(str1));
				++nsubs;
				state = 1;
			}
			break;
		case 15:
			if(c == 45 && str.charCodeAt(p + 1) == 45 && str.charCodeAt(p + 2) == 62) {
				parent.addChild(Xml.createComment(HxOverrides.substr(str,start,p - start)));
				++nsubs;
				p += 2;
				state = 1;
			}
			break;
		case 16:
			if(c == 91) {
				++nbrackets;
			} else if(c == 93) {
				--nbrackets;
			} else if(c == 62 && nbrackets == 0) {
				parent.addChild(Xml.createDocType(HxOverrides.substr(str,start,p - start)));
				++nsubs;
				state = 1;
			}
			break;
		case 17:
			if(c == 93 && str.charCodeAt(p + 1) == 93 && str.charCodeAt(p + 2) == 62) {
				var child1 = Xml.createCData(HxOverrides.substr(str,start,p - start));
				parent.addChild(child1);
				++nsubs;
				p += 2;
				state = 1;
			}
			break;
		case 18:
			if(c == 59) {
				var s = HxOverrides.substr(str,start,p - start);
				if(s.charCodeAt(0) == 35) {
					var c1 = s.charCodeAt(1) == 120 ? Std.parseInt("0" + HxOverrides.substr(s,1,s.length - 1)) : Std.parseInt(HxOverrides.substr(s,1,s.length - 1));
					buf.b += String.fromCodePoint(c1);
				} else if(!Object.prototype.hasOwnProperty.call(haxe_xml_Parser.escapes.h,s)) {
					if(strict) {
						throw haxe_Exception.thrown(new haxe_xml_XmlParserException("Undefined entity: " + s,str,p));
					}
					buf.b += Std.string("&" + s + ";");
				} else {
					buf.b += Std.string(haxe_xml_Parser.escapes.h[s]);
				}
				start = p + 1;
				state = escapeNext;
			} else if(!(c >= 97 && c <= 122 || c >= 65 && c <= 90 || c >= 48 && c <= 57 || c == 58 || c == 46 || c == 95 || c == 45) && c != 35) {
				if(strict) {
					throw haxe_Exception.thrown(new haxe_xml_XmlParserException("Invalid character in entity: " + String.fromCodePoint(c),str,p));
				}
				buf.b += String.fromCodePoint(38);
				var len5 = p - start;
				buf.b += len5 == null ? HxOverrides.substr(str,start,null) : HxOverrides.substr(str,start,len5);
				--p;
				start = p + 1;
				state = escapeNext;
			}
			break;
		}
		++p;
	}
	if(state == 1) {
		start = p;
		state = 13;
	}
	if(state == 13) {
		if(parent.nodeType == 0) {
			if(parent.nodeType != Xml.Element) {
				throw haxe_Exception.thrown("Bad node type, expected Element but found " + (parent.nodeType == null ? "null" : XmlType.toString(parent.nodeType)));
			}
			throw haxe_Exception.thrown(new haxe_xml_XmlParserException("Unclosed node <" + parent.nodeName + ">",str,p));
		}
		if(p != start || nsubs == 0) {
			var len = p - start;
			buf.b += len == null ? HxOverrides.substr(str,start,null) : HxOverrides.substr(str,start,len);
			parent.addChild(Xml.createPCData(buf.b));
			++nsubs;
		}
		return p;
	}
	if(!strict && state == 18 && escapeNext == 13) {
		buf.b += String.fromCodePoint(38);
		var len = p - start;
		buf.b += len == null ? HxOverrides.substr(str,start,null) : HxOverrides.substr(str,start,len);
		parent.addChild(Xml.createPCData(buf.b));
		++nsubs;
		return p;
	}
	throw haxe_Exception.thrown(new haxe_xml_XmlParserException("Unexpected end",str,p));
};
var haxe_xml_Printer = function(pretty) {
	this.output = new StringBuf();
	this.pretty = pretty;
};
$hxClasses["haxe.xml.Printer"] = haxe_xml_Printer;
haxe_xml_Printer.__name__ = "haxe.xml.Printer";
haxe_xml_Printer.print = function(xml,pretty) {
	if(pretty == null) {
		pretty = false;
	}
	var printer = new haxe_xml_Printer(pretty);
	printer.writeNode(xml,"");
	return printer.output.b;
};
haxe_xml_Printer.prototype = {
	output: null
	,pretty: null
	,writeNode: function(value,tabs) {
		switch(value.nodeType) {
		case 0:
			this.output.b += Std.string(tabs + "<");
			if(value.nodeType != Xml.Element) {
				throw haxe_Exception.thrown("Bad node type, expected Element but found " + (value.nodeType == null ? "null" : XmlType.toString(value.nodeType)));
			}
			this.output.b += Std.string(value.nodeName);
			var attribute = value.attributes();
			while(attribute.hasNext()) {
				var attribute1 = attribute.next();
				this.output.b += Std.string(" " + attribute1 + "=\"");
				var input = StringTools.htmlEscape(value.get(attribute1),true);
				this.output.b += Std.string(input);
				this.output.b += "\"";
			}
			if(this.hasChildren(value)) {
				this.output.b += ">";
				if(this.pretty) {
					this.output.b += "\n";
				}
				if(value.nodeType != Xml.Document && value.nodeType != Xml.Element) {
					throw haxe_Exception.thrown("Bad node type, expected Element or Document but found " + (value.nodeType == null ? "null" : XmlType.toString(value.nodeType)));
				}
				var _g_current = 0;
				var _g_array = value.children;
				while(_g_current < _g_array.length) {
					var child = _g_array[_g_current++];
					this.writeNode(child,this.pretty ? tabs + "\t" : tabs);
				}
				this.output.b += Std.string(tabs + "</");
				if(value.nodeType != Xml.Element) {
					throw haxe_Exception.thrown("Bad node type, expected Element but found " + (value.nodeType == null ? "null" : XmlType.toString(value.nodeType)));
				}
				this.output.b += Std.string(value.nodeName);
				this.output.b += ">";
				if(this.pretty) {
					this.output.b += "\n";
				}
			} else {
				this.output.b += "/>";
				if(this.pretty) {
					this.output.b += "\n";
				}
			}
			break;
		case 1:
			if(value.nodeType == Xml.Document || value.nodeType == Xml.Element) {
				throw haxe_Exception.thrown("Bad node type, unexpected " + (value.nodeType == null ? "null" : XmlType.toString(value.nodeType)));
			}
			var nodeValue = value.nodeValue;
			if(nodeValue.length != 0) {
				var input = tabs + StringTools.htmlEscape(nodeValue);
				this.output.b += Std.string(input);
				if(this.pretty) {
					this.output.b += "\n";
				}
			}
			break;
		case 2:
			this.output.b += Std.string(tabs + "<![CDATA[");
			if(value.nodeType == Xml.Document || value.nodeType == Xml.Element) {
				throw haxe_Exception.thrown("Bad node type, unexpected " + (value.nodeType == null ? "null" : XmlType.toString(value.nodeType)));
			}
			this.output.b += Std.string(value.nodeValue);
			this.output.b += "]]>";
			if(this.pretty) {
				this.output.b += "\n";
			}
			break;
		case 3:
			if(value.nodeType == Xml.Document || value.nodeType == Xml.Element) {
				throw haxe_Exception.thrown("Bad node type, unexpected " + (value.nodeType == null ? "null" : XmlType.toString(value.nodeType)));
			}
			var commentContent = value.nodeValue;
			var _this_r = new RegExp("[\n\r\t]+","g".split("u").join(""));
			commentContent = commentContent.replace(_this_r,"");
			commentContent = "<!--" + commentContent + "-->";
			this.output.b += tabs == null ? "null" : "" + tabs;
			var input = StringTools.trim(commentContent);
			this.output.b += Std.string(input);
			if(this.pretty) {
				this.output.b += "\n";
			}
			break;
		case 4:
			if(value.nodeType == Xml.Document || value.nodeType == Xml.Element) {
				throw haxe_Exception.thrown("Bad node type, unexpected " + (value.nodeType == null ? "null" : XmlType.toString(value.nodeType)));
			}
			this.output.b += Std.string("<!DOCTYPE " + value.nodeValue + ">");
			if(this.pretty) {
				this.output.b += "\n";
			}
			break;
		case 5:
			if(value.nodeType == Xml.Document || value.nodeType == Xml.Element) {
				throw haxe_Exception.thrown("Bad node type, unexpected " + (value.nodeType == null ? "null" : XmlType.toString(value.nodeType)));
			}
			this.output.b += Std.string("<?" + value.nodeValue + "?>");
			if(this.pretty) {
				this.output.b += "\n";
			}
			break;
		case 6:
			if(value.nodeType != Xml.Document && value.nodeType != Xml.Element) {
				throw haxe_Exception.thrown("Bad node type, expected Element or Document but found " + (value.nodeType == null ? "null" : XmlType.toString(value.nodeType)));
			}
			var _g_current = 0;
			var _g_array = value.children;
			while(_g_current < _g_array.length) {
				var child = _g_array[_g_current++];
				this.writeNode(child,tabs);
			}
			break;
		}
	}
	,hasChildren: function(value) {
		if(value.nodeType != Xml.Document && value.nodeType != Xml.Element) {
			throw haxe_Exception.thrown("Bad node type, expected Element or Document but found " + (value.nodeType == null ? "null" : XmlType.toString(value.nodeType)));
		}
		var _g_current = 0;
		var _g_array = value.children;
		while(_g_current < _g_array.length) {
			var child = _g_array[_g_current++];
			switch(child.nodeType) {
			case 0:case 1:
				return true;
			case 2:case 3:
				if(child.nodeType == Xml.Document || child.nodeType == Xml.Element) {
					throw haxe_Exception.thrown("Bad node type, unexpected " + (child.nodeType == null ? "null" : XmlType.toString(child.nodeType)));
				}
				if(StringTools.ltrim(child.nodeValue).length != 0) {
					return true;
				}
				break;
			default:
			}
		}
		return false;
	}
	,__class__: haxe_xml_Printer
};
var haxe_zip_ExtraField = $hxEnums["haxe.zip.ExtraField"] = { __ename__:"haxe.zip.ExtraField",__constructs__:null
	,FUnknown: ($_=function(tag,bytes) { return {_hx_index:0,tag:tag,bytes:bytes,__enum__:"haxe.zip.ExtraField",toString:$estr}; },$_._hx_name="FUnknown",$_.__params__ = ["tag","bytes"],$_)
	,FInfoZipUnicodePath: ($_=function(name,crc) { return {_hx_index:1,name:name,crc:crc,__enum__:"haxe.zip.ExtraField",toString:$estr}; },$_._hx_name="FInfoZipUnicodePath",$_.__params__ = ["name","crc"],$_)
	,FUtf8: {_hx_name:"FUtf8",_hx_index:2,__enum__:"haxe.zip.ExtraField",toString:$estr}
};
haxe_zip_ExtraField.__constructs__ = [haxe_zip_ExtraField.FUnknown,haxe_zip_ExtraField.FInfoZipUnicodePath,haxe_zip_ExtraField.FUtf8];
var haxe_zip_Huffman = $hxEnums["haxe.zip.Huffman"] = { __ename__:"haxe.zip.Huffman",__constructs__:null
	,Found: ($_=function(i) { return {_hx_index:0,i:i,__enum__:"haxe.zip.Huffman",toString:$estr}; },$_._hx_name="Found",$_.__params__ = ["i"],$_)
	,NeedBit: ($_=function(left,right) { return {_hx_index:1,left:left,right:right,__enum__:"haxe.zip.Huffman",toString:$estr}; },$_._hx_name="NeedBit",$_.__params__ = ["left","right"],$_)
	,NeedBits: ($_=function(n,table) { return {_hx_index:2,n:n,table:table,__enum__:"haxe.zip.Huffman",toString:$estr}; },$_._hx_name="NeedBits",$_.__params__ = ["n","table"],$_)
};
haxe_zip_Huffman.__constructs__ = [haxe_zip_Huffman.Found,haxe_zip_Huffman.NeedBit,haxe_zip_Huffman.NeedBits];
var haxe_zip_HuffTools = function() {
};
$hxClasses["haxe.zip.HuffTools"] = haxe_zip_HuffTools;
haxe_zip_HuffTools.__name__ = "haxe.zip.HuffTools";
haxe_zip_HuffTools.prototype = {
	treeDepth: function(t) {
		switch(t._hx_index) {
		case 0:
			var _g = t.i;
			return 0;
		case 1:
			var a = t.left;
			var b = t.right;
			var da = this.treeDepth(a);
			var db = this.treeDepth(b);
			return 1 + (da < db ? da : db);
		case 2:
			var _g = t.n;
			var _g = t.table;
			throw haxe_Exception.thrown("assert");
		}
	}
	,treeCompress: function(t) {
		var d = this.treeDepth(t);
		if(d == 0) {
			return t;
		}
		if(d == 1) {
			if(t._hx_index == 1) {
				var a = t.left;
				var b = t.right;
				return haxe_zip_Huffman.NeedBit(this.treeCompress(a),this.treeCompress(b));
			} else {
				throw haxe_Exception.thrown("assert");
			}
		}
		var size = 1 << d;
		var table = [];
		var _g = 0;
		var _g1 = size;
		while(_g < _g1) {
			var i = _g++;
			table.push(haxe_zip_Huffman.Found(-1));
		}
		this.treeWalk(table,0,0,d,t);
		return haxe_zip_Huffman.NeedBits(d,table);
	}
	,treeWalk: function(table,p,cd,d,t) {
		if(t._hx_index == 1) {
			var a = t.left;
			var b = t.right;
			if(d > 0) {
				this.treeWalk(table,p,cd + 1,d - 1,a);
				this.treeWalk(table,p | 1 << cd,cd + 1,d - 1,b);
			} else {
				table[p] = this.treeCompress(t);
			}
		} else {
			table[p] = this.treeCompress(t);
		}
	}
	,treeMake: function(bits,maxbits,v,len) {
		if(len > maxbits) {
			throw haxe_Exception.thrown("Invalid huffman");
		}
		var idx = v << 5 | len;
		if(bits.h.hasOwnProperty(idx)) {
			return haxe_zip_Huffman.Found(bits.h[idx]);
		}
		v <<= 1;
		++len;
		return haxe_zip_Huffman.NeedBit(this.treeMake(bits,maxbits,v,len),this.treeMake(bits,maxbits,v | 1,len));
	}
	,make: function(lengths,pos,nlengths,maxbits) {
		if(nlengths == 1) {
			return haxe_zip_Huffman.NeedBit(haxe_zip_Huffman.Found(0),haxe_zip_Huffman.Found(0));
		}
		var counts = [];
		var tmp = [];
		if(maxbits > 32) {
			throw haxe_Exception.thrown("Invalid huffman");
		}
		var _g = 0;
		var _g1 = maxbits;
		while(_g < _g1) {
			var i = _g++;
			counts.push(0);
			tmp.push(0);
		}
		var _g = 0;
		var _g1 = nlengths;
		while(_g < _g1) {
			var i = _g++;
			var p = lengths[i + pos];
			if(p >= maxbits) {
				throw haxe_Exception.thrown("Invalid huffman");
			}
			counts[p]++;
		}
		var code = 0;
		var _g = 1;
		var _g1 = maxbits - 1;
		while(_g < _g1) {
			var i = _g++;
			code = code + counts[i] << 1;
			tmp[i] = code;
		}
		var bits = new haxe_ds_IntMap();
		var _g = 0;
		var _g1 = nlengths;
		while(_g < _g1) {
			var i = _g++;
			var l = lengths[i + pos];
			if(l != 0) {
				var n = tmp[l - 1];
				tmp[l - 1] = n + 1;
				bits.h[n << 5 | l] = i;
			}
		}
		return this.treeCompress(haxe_zip_Huffman.NeedBit(this.treeMake(bits,maxbits,0,1),this.treeMake(bits,maxbits,1,1)));
	}
	,__class__: haxe_zip_HuffTools
};
var haxe_zip__$InflateImpl_Window = function(hasCrc) {
	this.buffer = new haxe_io_Bytes(new ArrayBuffer(65536));
	this.pos = 0;
	if(hasCrc) {
		this.crc = new haxe_crypto_Adler32();
	}
};
$hxClasses["haxe.zip._InflateImpl.Window"] = haxe_zip__$InflateImpl_Window;
haxe_zip__$InflateImpl_Window.__name__ = "haxe.zip._InflateImpl.Window";
haxe_zip__$InflateImpl_Window.prototype = {
	buffer: null
	,pos: null
	,crc: null
	,slide: function() {
		if(this.crc != null) {
			this.crc.update(this.buffer,0,32768);
		}
		var b = new haxe_io_Bytes(new ArrayBuffer(65536));
		this.pos -= 32768;
		b.blit(0,this.buffer,32768,this.pos);
		this.buffer = b;
	}
	,addBytes: function(b,p,len) {
		if(this.pos + len > 65536) {
			this.slide();
		}
		this.buffer.blit(this.pos,b,p,len);
		this.pos += len;
	}
	,addByte: function(c) {
		if(this.pos == 65536) {
			this.slide();
		}
		this.buffer.b[this.pos] = c;
		this.pos++;
	}
	,getLastChar: function() {
		return this.buffer.b[this.pos - 1];
	}
	,available: function() {
		return this.pos;
	}
	,checksum: function() {
		if(this.crc != null) {
			this.crc.update(this.buffer,0,this.pos);
		}
		return this.crc;
	}
	,__class__: haxe_zip__$InflateImpl_Window
};
var haxe_zip__$InflateImpl_State = $hxEnums["haxe.zip._InflateImpl.State"] = { __ename__:"haxe.zip._InflateImpl.State",__constructs__:null
	,Head: {_hx_name:"Head",_hx_index:0,__enum__:"haxe.zip._InflateImpl.State",toString:$estr}
	,Block: {_hx_name:"Block",_hx_index:1,__enum__:"haxe.zip._InflateImpl.State",toString:$estr}
	,CData: {_hx_name:"CData",_hx_index:2,__enum__:"haxe.zip._InflateImpl.State",toString:$estr}
	,Flat: {_hx_name:"Flat",_hx_index:3,__enum__:"haxe.zip._InflateImpl.State",toString:$estr}
	,Crc: {_hx_name:"Crc",_hx_index:4,__enum__:"haxe.zip._InflateImpl.State",toString:$estr}
	,Dist: {_hx_name:"Dist",_hx_index:5,__enum__:"haxe.zip._InflateImpl.State",toString:$estr}
	,DistOne: {_hx_name:"DistOne",_hx_index:6,__enum__:"haxe.zip._InflateImpl.State",toString:$estr}
	,Done: {_hx_name:"Done",_hx_index:7,__enum__:"haxe.zip._InflateImpl.State",toString:$estr}
};
haxe_zip__$InflateImpl_State.__constructs__ = [haxe_zip__$InflateImpl_State.Head,haxe_zip__$InflateImpl_State.Block,haxe_zip__$InflateImpl_State.CData,haxe_zip__$InflateImpl_State.Flat,haxe_zip__$InflateImpl_State.Crc,haxe_zip__$InflateImpl_State.Dist,haxe_zip__$InflateImpl_State.DistOne,haxe_zip__$InflateImpl_State.Done];
var haxe_zip_InflateImpl = function(i,header,crc) {
	if(crc == null) {
		crc = true;
	}
	if(header == null) {
		header = true;
	}
	this.isFinal = false;
	this.htools = new haxe_zip_HuffTools();
	this.huffman = this.buildFixedHuffman();
	this.huffdist = null;
	this.len = 0;
	this.dist = 0;
	this.state = header ? haxe_zip__$InflateImpl_State.Head : haxe_zip__$InflateImpl_State.Block;
	this.input = i;
	this.bits = 0;
	this.nbits = 0;
	this.needed = 0;
	this.output = null;
	this.outpos = 0;
	this.lengths = [];
	this.lengths.push(-1);
	this.lengths.push(-1);
	this.lengths.push(-1);
	this.lengths.push(-1);
	this.lengths.push(-1);
	this.lengths.push(-1);
	this.lengths.push(-1);
	this.lengths.push(-1);
	this.lengths.push(-1);
	this.lengths.push(-1);
	this.lengths.push(-1);
	this.lengths.push(-1);
	this.lengths.push(-1);
	this.lengths.push(-1);
	this.lengths.push(-1);
	this.lengths.push(-1);
	this.lengths.push(-1);
	this.lengths.push(-1);
	this.lengths.push(-1);
	this.window = new haxe_zip__$InflateImpl_Window(crc);
};
$hxClasses["haxe.zip.InflateImpl"] = haxe_zip_InflateImpl;
haxe_zip_InflateImpl.__name__ = "haxe.zip.InflateImpl";
haxe_zip_InflateImpl.prototype = {
	nbits: null
	,bits: null
	,state: null
	,isFinal: null
	,huffman: null
	,huffdist: null
	,htools: null
	,len: null
	,dist: null
	,needed: null
	,output: null
	,outpos: null
	,input: null
	,lengths: null
	,window: null
	,buildFixedHuffman: function() {
		if(haxe_zip_InflateImpl.FIXED_HUFFMAN != null) {
			return haxe_zip_InflateImpl.FIXED_HUFFMAN;
		}
		var a = [];
		var _g = 0;
		while(_g < 288) {
			var n = _g++;
			a.push(n <= 143 ? 8 : n <= 255 ? 9 : n <= 279 ? 7 : 8);
		}
		haxe_zip_InflateImpl.FIXED_HUFFMAN = this.htools.make(a,0,288,10);
		return haxe_zip_InflateImpl.FIXED_HUFFMAN;
	}
	,readBytes: function(b,pos,len) {
		this.needed = len;
		this.outpos = pos;
		this.output = b;
		if(len > 0) {
			while(this.inflateLoop()) {
			}
		}
		return len - this.needed;
	}
	,getBits: function(n) {
		while(this.nbits < n) {
			this.bits |= this.input.readByte() << this.nbits;
			this.nbits += 8;
		}
		var b = this.bits & (1 << n) - 1;
		this.nbits -= n;
		this.bits >>= n;
		return b;
	}
	,getBit: function() {
		if(this.nbits == 0) {
			this.nbits = 8;
			this.bits = this.input.readByte();
		}
		var b = (this.bits & 1) == 1;
		this.nbits--;
		this.bits >>= 1;
		return b;
	}
	,getRevBits: function(n) {
		if(n == 0) {
			return 0;
		} else if(this.getBit()) {
			return 1 << n - 1 | this.getRevBits(n - 1);
		} else {
			return this.getRevBits(n - 1);
		}
	}
	,resetBits: function() {
		this.bits = 0;
		this.nbits = 0;
	}
	,addBytes: function(b,p,len) {
		this.window.addBytes(b,p,len);
		this.output.blit(this.outpos,b,p,len);
		this.needed -= len;
		this.outpos += len;
	}
	,addByte: function(b) {
		this.window.addByte(b);
		this.output.b[this.outpos] = b;
		this.needed--;
		this.outpos++;
	}
	,addDistOne: function(n) {
		var c = this.window.getLastChar();
		var _g = 0;
		var _g1 = n;
		while(_g < _g1) {
			var i = _g++;
			this.addByte(c);
		}
	}
	,addDist: function(d,len) {
		this.addBytes(this.window.buffer,this.window.pos - d,len);
	}
	,applyHuffman: function(h) {
		switch(h._hx_index) {
		case 0:
			var n = h.i;
			return n;
		case 1:
			var a = h.left;
			var b = h.right;
			return this.applyHuffman(this.getBit() ? b : a);
		case 2:
			var n = h.n;
			var tbl = h.table;
			return this.applyHuffman(tbl[this.getBits(n)]);
		}
	}
	,inflateLengths: function(a,max) {
		var i = 0;
		var prev = 0;
		while(i < max) {
			var n = this.applyHuffman(this.huffman);
			switch(n) {
			case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:case 11:case 12:case 13:case 14:case 15:
				prev = n;
				a[i] = n;
				++i;
				break;
			case 16:
				var end = i + 3 + this.getBits(2);
				if(end > max) {
					throw haxe_Exception.thrown("Invalid data");
				}
				while(i < end) {
					a[i] = prev;
					++i;
				}
				break;
			case 17:
				i += 3 + this.getBits(3);
				if(i > max) {
					throw haxe_Exception.thrown("Invalid data");
				}
				break;
			case 18:
				i += 11 + this.getBits(7);
				if(i > max) {
					throw haxe_Exception.thrown("Invalid data");
				}
				break;
			default:
				throw haxe_Exception.thrown("Invalid data");
			}
		}
	}
	,inflateLoop: function() {
		switch(this.state._hx_index) {
		case 0:
			var cmf = this.input.readByte();
			var cm = cmf & 15;
			var cinfo = cmf >> 4;
			if(cm != 8) {
				throw haxe_Exception.thrown("Invalid data");
			}
			var flg = this.input.readByte();
			var fdict = (flg & 32) != 0;
			if(((cmf << 8) + flg) % 31 != 0) {
				throw haxe_Exception.thrown("Invalid data");
			}
			if(fdict) {
				throw haxe_Exception.thrown("Unsupported dictionary");
			}
			this.state = haxe_zip__$InflateImpl_State.Block;
			return true;
		case 1:
			this.isFinal = this.getBit();
			switch(this.getBits(2)) {
			case 0:
				this.len = this.input.readUInt16();
				var nlen = this.input.readUInt16();
				if(nlen != 65535 - this.len) {
					throw haxe_Exception.thrown("Invalid data");
				}
				this.state = haxe_zip__$InflateImpl_State.Flat;
				var r = this.inflateLoop();
				this.resetBits();
				return r;
			case 1:
				this.huffman = this.buildFixedHuffman();
				this.huffdist = null;
				this.state = haxe_zip__$InflateImpl_State.CData;
				return true;
			case 2:
				var hlit = this.getBits(5) + 257;
				var hdist = this.getBits(5) + 1;
				var hclen = this.getBits(4) + 4;
				var _g = 0;
				var _g1 = hclen;
				while(_g < _g1) {
					var i = _g++;
					this.lengths[haxe_zip_InflateImpl.CODE_LENGTHS_POS[i]] = this.getBits(3);
				}
				var _g = hclen;
				var _g1 = 19;
				while(_g < _g1) {
					var i = _g++;
					this.lengths[haxe_zip_InflateImpl.CODE_LENGTHS_POS[i]] = 0;
				}
				this.huffman = this.htools.make(this.lengths,0,19,8);
				var lengths = [];
				var _g = 0;
				var _g1 = hlit + hdist;
				while(_g < _g1) {
					var i = _g++;
					lengths.push(0);
				}
				this.inflateLengths(lengths,hlit + hdist);
				this.huffdist = this.htools.make(lengths,hlit,hdist,16);
				this.huffman = this.htools.make(lengths,0,hlit,16);
				this.state = haxe_zip__$InflateImpl_State.CData;
				return true;
			default:
				throw haxe_Exception.thrown("Invalid data");
			}
			break;
		case 2:
			var n = this.applyHuffman(this.huffman);
			if(n < 256) {
				this.addByte(n);
				return this.needed > 0;
			} else if(n == 256) {
				this.state = this.isFinal ? haxe_zip__$InflateImpl_State.Crc : haxe_zip__$InflateImpl_State.Block;
				return true;
			} else {
				n -= 257;
				var extra_bits = haxe_zip_InflateImpl.LEN_EXTRA_BITS_TBL[n];
				if(extra_bits == -1) {
					throw haxe_Exception.thrown("Invalid data");
				}
				this.len = haxe_zip_InflateImpl.LEN_BASE_VAL_TBL[n] + this.getBits(extra_bits);
				var dist_code = this.huffdist == null ? this.getRevBits(5) : this.applyHuffman(this.huffdist);
				extra_bits = haxe_zip_InflateImpl.DIST_EXTRA_BITS_TBL[dist_code];
				if(extra_bits == -1) {
					throw haxe_Exception.thrown("Invalid data");
				}
				this.dist = haxe_zip_InflateImpl.DIST_BASE_VAL_TBL[dist_code] + this.getBits(extra_bits);
				if(this.dist > this.window.available()) {
					throw haxe_Exception.thrown("Invalid data");
				}
				this.state = this.dist == 1 ? haxe_zip__$InflateImpl_State.DistOne : haxe_zip__$InflateImpl_State.Dist;
				return true;
			}
			break;
		case 3:
			var rlen = this.len < this.needed ? this.len : this.needed;
			var bytes = this.input.read(rlen);
			this.len -= rlen;
			this.addBytes(bytes,0,rlen);
			if(this.len == 0) {
				this.state = this.isFinal ? haxe_zip__$InflateImpl_State.Crc : haxe_zip__$InflateImpl_State.Block;
			}
			return this.needed > 0;
		case 4:
			var calc = this.window.checksum();
			if(calc == null) {
				this.state = haxe_zip__$InflateImpl_State.Done;
				return true;
			}
			var crc = haxe_crypto_Adler32.read(this.input);
			if(!calc.equals(crc)) {
				throw haxe_Exception.thrown("Invalid CRC");
			}
			this.state = haxe_zip__$InflateImpl_State.Done;
			return true;
		case 5:
			while(this.len > 0 && this.needed > 0) {
				var rdist = this.len < this.dist ? this.len : this.dist;
				var rlen = this.needed < rdist ? this.needed : rdist;
				this.addDist(this.dist,rlen);
				this.len -= rlen;
			}
			if(this.len == 0) {
				this.state = haxe_zip__$InflateImpl_State.CData;
			}
			return this.needed > 0;
		case 6:
			var rlen = this.len < this.needed ? this.len : this.needed;
			this.addDistOne(rlen);
			this.len -= rlen;
			if(this.len == 0) {
				this.state = haxe_zip__$InflateImpl_State.CData;
			}
			return this.needed > 0;
		case 7:
			return false;
		}
	}
	,__class__: haxe_zip_InflateImpl
};
var haxe_zip_Reader = function(i) {
	this.i = i;
};
$hxClasses["haxe.zip.Reader"] = haxe_zip_Reader;
haxe_zip_Reader.__name__ = "haxe.zip.Reader";
haxe_zip_Reader.readZip = function(i) {
	var r = new haxe_zip_Reader(i);
	return r.read();
};
haxe_zip_Reader.prototype = {
	i: null
	,readZipDate: function() {
		var t = this.i.readUInt16();
		var hour = t >> 11 & 31;
		var min = t >> 5 & 63;
		var sec = t & 31;
		var d = this.i.readUInt16();
		var year = d >> 9;
		var month = d >> 5 & 15;
		var day = d & 31;
		return new Date(year + 1980,month - 1,day,hour,min,sec << 1);
	}
	,readExtraFields: function(length) {
		var fields = new haxe_ds_List();
		while(length > 0) {
			if(length < 4) {
				throw haxe_Exception.thrown("Invalid extra fields data");
			}
			var tag = this.i.readUInt16();
			var len = this.i.readUInt16();
			if(length < len) {
				throw haxe_Exception.thrown("Invalid extra fields data");
			}
			if(tag == 28789) {
				var version = this.i.readByte();
				if(version != 1) {
					var data = new haxe_io_BytesBuffer();
					data.addByte(version);
					data.add(this.i.read(len - 1));
					fields.add(haxe_zip_ExtraField.FUnknown(tag,data.getBytes()));
				} else {
					var crc = this.i.readInt32();
					var name = this.i.read(len - 5).toString();
					fields.add(haxe_zip_ExtraField.FInfoZipUnicodePath(name,crc));
				}
			} else {
				fields.add(haxe_zip_ExtraField.FUnknown(tag,this.i.read(len)));
			}
			length -= 4 + len;
		}
		return fields;
	}
	,readEntryHeader: function() {
		var i = this.i;
		var h = i.readInt32();
		if(h == 33639248 || h == 101010256) {
			return null;
		}
		if(h != 67324752) {
			throw haxe_Exception.thrown("Invalid Zip Data");
		}
		var version = i.readUInt16();
		var flags = i.readUInt16();
		var utf8 = (flags & 2048) != 0;
		if((flags & 63473) != 0) {
			throw haxe_Exception.thrown("Unsupported flags " + flags);
		}
		var compression = i.readUInt16();
		var compressed = compression != 0;
		if(compressed && compression != 8) {
			throw haxe_Exception.thrown("Unsupported compression " + compression);
		}
		var mtime = this.readZipDate();
		var crc32 = i.readInt32();
		var csize = i.readInt32();
		var usize = i.readInt32();
		var fnamelen = i.readInt16();
		var elen = i.readInt16();
		var fname = i.readString(fnamelen);
		var fields = this.readExtraFields(elen);
		if(utf8) {
			fields.push(haxe_zip_ExtraField.FUtf8);
		}
		var data = null;
		if((flags & 8) != 0) {
			crc32 = null;
		}
		return { fileName : fname, fileSize : usize, fileTime : mtime, compressed : compressed, dataSize : csize, data : data, crc32 : crc32, extraFields : fields};
	}
	,read: function() {
		var l = new haxe_ds_List();
		var buf = null;
		var tmp = null;
		while(true) {
			var e = this.readEntryHeader();
			if(e == null) {
				break;
			}
			if(e.crc32 == null) {
				if(e.compressed) {
					var bufSize = 65536;
					if(tmp == null) {
						tmp = new haxe_io_Bytes(new ArrayBuffer(bufSize));
					}
					var out = new haxe_io_BytesBuffer();
					var z = new haxe_zip_InflateImpl(this.i,false,false);
					while(true) {
						var n = z.readBytes(tmp,0,bufSize);
						out.addBytes(tmp,0,n);
						if(n < bufSize) {
							break;
						}
					}
					e.data = out.getBytes();
				} else {
					e.data = this.i.read(e.dataSize);
				}
				e.crc32 = this.i.readInt32();
				if(e.crc32 == 134695760) {
					e.crc32 = this.i.readInt32();
				}
				e.dataSize = this.i.readInt32();
				e.fileSize = this.i.readInt32();
				e.dataSize = e.fileSize;
				e.compressed = false;
			} else {
				e.data = this.i.read(e.dataSize);
			}
			l.add(e);
		}
		return l;
	}
	,__class__: haxe_zip_Reader
};
var hscript_Const = $hxEnums["hscript.Const"] = { __ename__:"hscript.Const",__constructs__:null
	,CInt: ($_=function(v) { return {_hx_index:0,v:v,__enum__:"hscript.Const",toString:$estr}; },$_._hx_name="CInt",$_.__params__ = ["v"],$_)
	,CFloat: ($_=function(f) { return {_hx_index:1,f:f,__enum__:"hscript.Const",toString:$estr}; },$_._hx_name="CFloat",$_.__params__ = ["f"],$_)
	,CString: ($_=function(s) { return {_hx_index:2,s:s,__enum__:"hscript.Const",toString:$estr}; },$_._hx_name="CString",$_.__params__ = ["s"],$_)
};
hscript_Const.__constructs__ = [hscript_Const.CInt,hscript_Const.CFloat,hscript_Const.CString];
var hscript_Expr = $hxEnums["hscript.Expr"] = { __ename__:"hscript.Expr",__constructs__:null
	,EConst: ($_=function(c) { return {_hx_index:0,c:c,__enum__:"hscript.Expr",toString:$estr}; },$_._hx_name="EConst",$_.__params__ = ["c"],$_)
	,EIdent: ($_=function(v) { return {_hx_index:1,v:v,__enum__:"hscript.Expr",toString:$estr}; },$_._hx_name="EIdent",$_.__params__ = ["v"],$_)
	,EVar: ($_=function(n,t,e) { return {_hx_index:2,n:n,t:t,e:e,__enum__:"hscript.Expr",toString:$estr}; },$_._hx_name="EVar",$_.__params__ = ["n","t","e"],$_)
	,EParent: ($_=function(e) { return {_hx_index:3,e:e,__enum__:"hscript.Expr",toString:$estr}; },$_._hx_name="EParent",$_.__params__ = ["e"],$_)
	,EBlock: ($_=function(e) { return {_hx_index:4,e:e,__enum__:"hscript.Expr",toString:$estr}; },$_._hx_name="EBlock",$_.__params__ = ["e"],$_)
	,EField: ($_=function(e,f) { return {_hx_index:5,e:e,f:f,__enum__:"hscript.Expr",toString:$estr}; },$_._hx_name="EField",$_.__params__ = ["e","f"],$_)
	,EBinop: ($_=function(op,e1,e2) { return {_hx_index:6,op:op,e1:e1,e2:e2,__enum__:"hscript.Expr",toString:$estr}; },$_._hx_name="EBinop",$_.__params__ = ["op","e1","e2"],$_)
	,EUnop: ($_=function(op,prefix,e) { return {_hx_index:7,op:op,prefix:prefix,e:e,__enum__:"hscript.Expr",toString:$estr}; },$_._hx_name="EUnop",$_.__params__ = ["op","prefix","e"],$_)
	,ECall: ($_=function(e,params) { return {_hx_index:8,e:e,params:params,__enum__:"hscript.Expr",toString:$estr}; },$_._hx_name="ECall",$_.__params__ = ["e","params"],$_)
	,EIf: ($_=function(cond,e1,e2) { return {_hx_index:9,cond:cond,e1:e1,e2:e2,__enum__:"hscript.Expr",toString:$estr}; },$_._hx_name="EIf",$_.__params__ = ["cond","e1","e2"],$_)
	,EWhile: ($_=function(cond,e) { return {_hx_index:10,cond:cond,e:e,__enum__:"hscript.Expr",toString:$estr}; },$_._hx_name="EWhile",$_.__params__ = ["cond","e"],$_)
	,EFor: ($_=function(v,it,e) { return {_hx_index:11,v:v,it:it,e:e,__enum__:"hscript.Expr",toString:$estr}; },$_._hx_name="EFor",$_.__params__ = ["v","it","e"],$_)
	,EBreak: {_hx_name:"EBreak",_hx_index:12,__enum__:"hscript.Expr",toString:$estr}
	,EContinue: {_hx_name:"EContinue",_hx_index:13,__enum__:"hscript.Expr",toString:$estr}
	,EFunction: ($_=function(args,e,name,ret) { return {_hx_index:14,args:args,e:e,name:name,ret:ret,__enum__:"hscript.Expr",toString:$estr}; },$_._hx_name="EFunction",$_.__params__ = ["args","e","name","ret"],$_)
	,EReturn: ($_=function(e) { return {_hx_index:15,e:e,__enum__:"hscript.Expr",toString:$estr}; },$_._hx_name="EReturn",$_.__params__ = ["e"],$_)
	,EArray: ($_=function(e,index) { return {_hx_index:16,e:e,index:index,__enum__:"hscript.Expr",toString:$estr}; },$_._hx_name="EArray",$_.__params__ = ["e","index"],$_)
	,EArrayDecl: ($_=function(e) { return {_hx_index:17,e:e,__enum__:"hscript.Expr",toString:$estr}; },$_._hx_name="EArrayDecl",$_.__params__ = ["e"],$_)
	,ENew: ($_=function(cl,params) { return {_hx_index:18,cl:cl,params:params,__enum__:"hscript.Expr",toString:$estr}; },$_._hx_name="ENew",$_.__params__ = ["cl","params"],$_)
	,EThrow: ($_=function(e) { return {_hx_index:19,e:e,__enum__:"hscript.Expr",toString:$estr}; },$_._hx_name="EThrow",$_.__params__ = ["e"],$_)
	,ETry: ($_=function(e,v,t,ecatch) { return {_hx_index:20,e:e,v:v,t:t,ecatch:ecatch,__enum__:"hscript.Expr",toString:$estr}; },$_._hx_name="ETry",$_.__params__ = ["e","v","t","ecatch"],$_)
	,EObject: ($_=function(fl) { return {_hx_index:21,fl:fl,__enum__:"hscript.Expr",toString:$estr}; },$_._hx_name="EObject",$_.__params__ = ["fl"],$_)
	,ETernary: ($_=function(cond,e1,e2) { return {_hx_index:22,cond:cond,e1:e1,e2:e2,__enum__:"hscript.Expr",toString:$estr}; },$_._hx_name="ETernary",$_.__params__ = ["cond","e1","e2"],$_)
	,ESwitch: ($_=function(e,cases,defaultExpr) { return {_hx_index:23,e:e,cases:cases,defaultExpr:defaultExpr,__enum__:"hscript.Expr",toString:$estr}; },$_._hx_name="ESwitch",$_.__params__ = ["e","cases","defaultExpr"],$_)
	,EDoWhile: ($_=function(cond,e) { return {_hx_index:24,cond:cond,e:e,__enum__:"hscript.Expr",toString:$estr}; },$_._hx_name="EDoWhile",$_.__params__ = ["cond","e"],$_)
	,EMeta: ($_=function(name,args,e) { return {_hx_index:25,name:name,args:args,e:e,__enum__:"hscript.Expr",toString:$estr}; },$_._hx_name="EMeta",$_.__params__ = ["name","args","e"],$_)
	,ECheckType: ($_=function(e,t) { return {_hx_index:26,e:e,t:t,__enum__:"hscript.Expr",toString:$estr}; },$_._hx_name="ECheckType",$_.__params__ = ["e","t"],$_)
	,EForGen: ($_=function(it,e) { return {_hx_index:27,it:it,e:e,__enum__:"hscript.Expr",toString:$estr}; },$_._hx_name="EForGen",$_.__params__ = ["it","e"],$_)
	,ECast: ($_=function(e,t) { return {_hx_index:28,e:e,t:t,__enum__:"hscript.Expr",toString:$estr}; },$_._hx_name="ECast",$_.__params__ = ["e","t"],$_)
};
hscript_Expr.__constructs__ = [hscript_Expr.EConst,hscript_Expr.EIdent,hscript_Expr.EVar,hscript_Expr.EParent,hscript_Expr.EBlock,hscript_Expr.EField,hscript_Expr.EBinop,hscript_Expr.EUnop,hscript_Expr.ECall,hscript_Expr.EIf,hscript_Expr.EWhile,hscript_Expr.EFor,hscript_Expr.EBreak,hscript_Expr.EContinue,hscript_Expr.EFunction,hscript_Expr.EReturn,hscript_Expr.EArray,hscript_Expr.EArrayDecl,hscript_Expr.ENew,hscript_Expr.EThrow,hscript_Expr.ETry,hscript_Expr.EObject,hscript_Expr.ETernary,hscript_Expr.ESwitch,hscript_Expr.EDoWhile,hscript_Expr.EMeta,hscript_Expr.ECheckType,hscript_Expr.EForGen,hscript_Expr.ECast];
var hscript_CType = $hxEnums["hscript.CType"] = { __ename__:"hscript.CType",__constructs__:null
	,CTPath: ($_=function(path,params) { return {_hx_index:0,path:path,params:params,__enum__:"hscript.CType",toString:$estr}; },$_._hx_name="CTPath",$_.__params__ = ["path","params"],$_)
	,CTFun: ($_=function(args,ret) { return {_hx_index:1,args:args,ret:ret,__enum__:"hscript.CType",toString:$estr}; },$_._hx_name="CTFun",$_.__params__ = ["args","ret"],$_)
	,CTAnon: ($_=function(fields) { return {_hx_index:2,fields:fields,__enum__:"hscript.CType",toString:$estr}; },$_._hx_name="CTAnon",$_.__params__ = ["fields"],$_)
	,CTParent: ($_=function(t) { return {_hx_index:3,t:t,__enum__:"hscript.CType",toString:$estr}; },$_._hx_name="CTParent",$_.__params__ = ["t"],$_)
	,CTOpt: ($_=function(t) { return {_hx_index:4,t:t,__enum__:"hscript.CType",toString:$estr}; },$_._hx_name="CTOpt",$_.__params__ = ["t"],$_)
	,CTNamed: ($_=function(n,t) { return {_hx_index:5,n:n,t:t,__enum__:"hscript.CType",toString:$estr}; },$_._hx_name="CTNamed",$_.__params__ = ["n","t"],$_)
	,CTExpr: ($_=function(e) { return {_hx_index:6,e:e,__enum__:"hscript.CType",toString:$estr}; },$_._hx_name="CTExpr",$_.__params__ = ["e"],$_)
};
hscript_CType.__constructs__ = [hscript_CType.CTPath,hscript_CType.CTFun,hscript_CType.CTAnon,hscript_CType.CTParent,hscript_CType.CTOpt,hscript_CType.CTNamed,hscript_CType.CTExpr];
var hscript_Error = $hxEnums["hscript.Error"] = { __ename__:"hscript.Error",__constructs__:null
	,EInvalidChar: ($_=function(c) { return {_hx_index:0,c:c,__enum__:"hscript.Error",toString:$estr}; },$_._hx_name="EInvalidChar",$_.__params__ = ["c"],$_)
	,EUnexpected: ($_=function(s) { return {_hx_index:1,s:s,__enum__:"hscript.Error",toString:$estr}; },$_._hx_name="EUnexpected",$_.__params__ = ["s"],$_)
	,EUnterminatedString: {_hx_name:"EUnterminatedString",_hx_index:2,__enum__:"hscript.Error",toString:$estr}
	,EUnterminatedComment: {_hx_name:"EUnterminatedComment",_hx_index:3,__enum__:"hscript.Error",toString:$estr}
	,EInvalidPreprocessor: ($_=function(msg) { return {_hx_index:4,msg:msg,__enum__:"hscript.Error",toString:$estr}; },$_._hx_name="EInvalidPreprocessor",$_.__params__ = ["msg"],$_)
	,EUnknownVariable: ($_=function(v) { return {_hx_index:5,v:v,__enum__:"hscript.Error",toString:$estr}; },$_._hx_name="EUnknownVariable",$_.__params__ = ["v"],$_)
	,EInvalidIterator: ($_=function(v) { return {_hx_index:6,v:v,__enum__:"hscript.Error",toString:$estr}; },$_._hx_name="EInvalidIterator",$_.__params__ = ["v"],$_)
	,EInvalidOp: ($_=function(op) { return {_hx_index:7,op:op,__enum__:"hscript.Error",toString:$estr}; },$_._hx_name="EInvalidOp",$_.__params__ = ["op"],$_)
	,EInvalidAccess: ($_=function(f) { return {_hx_index:8,f:f,__enum__:"hscript.Error",toString:$estr}; },$_._hx_name="EInvalidAccess",$_.__params__ = ["f"],$_)
	,ECustom: ($_=function(msg) { return {_hx_index:9,msg:msg,__enum__:"hscript.Error",toString:$estr}; },$_._hx_name="ECustom",$_.__params__ = ["msg"],$_)
};
hscript_Error.__constructs__ = [hscript_Error.EInvalidChar,hscript_Error.EUnexpected,hscript_Error.EUnterminatedString,hscript_Error.EUnterminatedComment,hscript_Error.EInvalidPreprocessor,hscript_Error.EUnknownVariable,hscript_Error.EInvalidIterator,hscript_Error.EInvalidOp,hscript_Error.EInvalidAccess,hscript_Error.ECustom];
var hscript_ModuleDecl = $hxEnums["hscript.ModuleDecl"] = { __ename__:"hscript.ModuleDecl",__constructs__:null
	,DPackage: ($_=function(path) { return {_hx_index:0,path:path,__enum__:"hscript.ModuleDecl",toString:$estr}; },$_._hx_name="DPackage",$_.__params__ = ["path"],$_)
	,DImport: ($_=function(path,everything,name) { return {_hx_index:1,path:path,everything:everything,name:name,__enum__:"hscript.ModuleDecl",toString:$estr}; },$_._hx_name="DImport",$_.__params__ = ["path","everything","name"],$_)
	,DClass: ($_=function(c) { return {_hx_index:2,c:c,__enum__:"hscript.ModuleDecl",toString:$estr}; },$_._hx_name="DClass",$_.__params__ = ["c"],$_)
	,DTypedef: ($_=function(c) { return {_hx_index:3,c:c,__enum__:"hscript.ModuleDecl",toString:$estr}; },$_._hx_name="DTypedef",$_.__params__ = ["c"],$_)
};
hscript_ModuleDecl.__constructs__ = [hscript_ModuleDecl.DPackage,hscript_ModuleDecl.DImport,hscript_ModuleDecl.DClass,hscript_ModuleDecl.DTypedef];
var hscript_FieldAccess = $hxEnums["hscript.FieldAccess"] = { __ename__:"hscript.FieldAccess",__constructs__:null
	,APublic: {_hx_name:"APublic",_hx_index:0,__enum__:"hscript.FieldAccess",toString:$estr}
	,APrivate: {_hx_name:"APrivate",_hx_index:1,__enum__:"hscript.FieldAccess",toString:$estr}
	,AInline: {_hx_name:"AInline",_hx_index:2,__enum__:"hscript.FieldAccess",toString:$estr}
	,AOverride: {_hx_name:"AOverride",_hx_index:3,__enum__:"hscript.FieldAccess",toString:$estr}
	,AStatic: {_hx_name:"AStatic",_hx_index:4,__enum__:"hscript.FieldAccess",toString:$estr}
	,AMacro: {_hx_name:"AMacro",_hx_index:5,__enum__:"hscript.FieldAccess",toString:$estr}
};
hscript_FieldAccess.__constructs__ = [hscript_FieldAccess.APublic,hscript_FieldAccess.APrivate,hscript_FieldAccess.AInline,hscript_FieldAccess.AOverride,hscript_FieldAccess.AStatic,hscript_FieldAccess.AMacro];
var hscript_FieldKind = $hxEnums["hscript.FieldKind"] = { __ename__:"hscript.FieldKind",__constructs__:null
	,KFunction: ($_=function(f) { return {_hx_index:0,f:f,__enum__:"hscript.FieldKind",toString:$estr}; },$_._hx_name="KFunction",$_.__params__ = ["f"],$_)
	,KVar: ($_=function(v) { return {_hx_index:1,v:v,__enum__:"hscript.FieldKind",toString:$estr}; },$_._hx_name="KVar",$_.__params__ = ["v"],$_)
};
hscript_FieldKind.__constructs__ = [hscript_FieldKind.KFunction,hscript_FieldKind.KVar];
var hscript__$Interp_Stop = $hxEnums["hscript._Interp.Stop"] = { __ename__:"hscript._Interp.Stop",__constructs__:null
	,SBreak: {_hx_name:"SBreak",_hx_index:0,__enum__:"hscript._Interp.Stop",toString:$estr}
	,SContinue: {_hx_name:"SContinue",_hx_index:1,__enum__:"hscript._Interp.Stop",toString:$estr}
	,SReturn: {_hx_name:"SReturn",_hx_index:2,__enum__:"hscript._Interp.Stop",toString:$estr}
};
hscript__$Interp_Stop.__constructs__ = [hscript__$Interp_Stop.SBreak,hscript__$Interp_Stop.SContinue,hscript__$Interp_Stop.SReturn];
var hscript_Interp = function() {
	this.locals = new haxe_ds_StringMap();
	this.declared = [];
	this.resetVariables();
	this.initOps();
};
$hxClasses["hscript.Interp"] = hscript_Interp;
hscript_Interp.__name__ = "hscript.Interp";
hscript_Interp.prototype = {
	variables: null
	,locals: null
	,binops: null
	,depth: null
	,inTry: null
	,declared: null
	,returnValue: null
	,resetVariables: function() {
		var _gthis = this;
		this.variables = new haxe_ds_StringMap();
		this.variables.h["null"] = null;
		this.variables.h["true"] = true;
		this.variables.h["false"] = false;
		var this1 = this.variables;
		var value = Reflect.makeVarArgs(function(el) {
			var inf = _gthis.posInfos();
			var v = el.shift();
			if(el.length > 0) {
				inf.customParams = el;
			}
			haxe_Log.trace(Std.string(v),inf);
		});
		this1.h["trace"] = value;
	}
	,posInfos: function() {
		return { fileName : "hscript", lineNumber : 0};
	}
	,initOps: function() {
		var me = this;
		this.binops = new haxe_ds_StringMap();
		this.binops.h["+"] = function(e1,e2) {
			return me.expr(e1) + me.expr(e2);
		};
		this.binops.h["-"] = function(e1,e2) {
			return me.expr(e1) - me.expr(e2);
		};
		this.binops.h["*"] = function(e1,e2) {
			return me.expr(e1) * me.expr(e2);
		};
		this.binops.h["/"] = function(e1,e2) {
			return me.expr(e1) / me.expr(e2);
		};
		this.binops.h["%"] = function(e1,e2) {
			return me.expr(e1) % me.expr(e2);
		};
		this.binops.h["&"] = function(e1,e2) {
			return me.expr(e1) & me.expr(e2);
		};
		this.binops.h["|"] = function(e1,e2) {
			return me.expr(e1) | me.expr(e2);
		};
		this.binops.h["^"] = function(e1,e2) {
			return me.expr(e1) ^ me.expr(e2);
		};
		this.binops.h["<<"] = function(e1,e2) {
			return me.expr(e1) << me.expr(e2);
		};
		this.binops.h[">>"] = function(e1,e2) {
			return me.expr(e1) >> me.expr(e2);
		};
		this.binops.h[">>>"] = function(e1,e2) {
			return me.expr(e1) >>> me.expr(e2);
		};
		this.binops.h["=="] = function(e1,e2) {
			return me.expr(e1) == me.expr(e2);
		};
		this.binops.h["!="] = function(e1,e2) {
			return me.expr(e1) != me.expr(e2);
		};
		this.binops.h[">="] = function(e1,e2) {
			return me.expr(e1) >= me.expr(e2);
		};
		this.binops.h["<="] = function(e1,e2) {
			return me.expr(e1) <= me.expr(e2);
		};
		this.binops.h[">"] = function(e1,e2) {
			return me.expr(e1) > me.expr(e2);
		};
		this.binops.h["<"] = function(e1,e2) {
			return me.expr(e1) < me.expr(e2);
		};
		this.binops.h["||"] = function(e1,e2) {
			if(me.expr(e1) != true) {
				return me.expr(e2) == true;
			} else {
				return true;
			}
		};
		this.binops.h["&&"] = function(e1,e2) {
			if(me.expr(e1) == true) {
				return me.expr(e2) == true;
			} else {
				return false;
			}
		};
		this.binops.h["="] = $bind(this,this.assign);
		this.binops.h["..."] = function(e1,e2) {
			return new IntIterator(me.expr(e1),me.expr(e2));
		};
		this.binops.h["is"] = function(e1,e2) {
			return js_Boot.__instanceof(me.expr(e1),me.expr(e2));
		};
		this.assignOp("+=",function(v1,v2) {
			return v1 + v2;
		});
		this.assignOp("-=",function(v1,v2) {
			return v1 - v2;
		});
		this.assignOp("*=",function(v1,v2) {
			return v1 * v2;
		});
		this.assignOp("/=",function(v1,v2) {
			return v1 / v2;
		});
		this.assignOp("%=",function(v1,v2) {
			return v1 % v2;
		});
		this.assignOp("&=",function(v1,v2) {
			return v1 & v2;
		});
		this.assignOp("|=",function(v1,v2) {
			return v1 | v2;
		});
		this.assignOp("^=",function(v1,v2) {
			return v1 ^ v2;
		});
		this.assignOp("<<=",function(v1,v2) {
			return v1 << v2;
		});
		this.assignOp(">>=",function(v1,v2) {
			return v1 >> v2;
		});
		this.assignOp(">>>=",function(v1,v2) {
			return v1 >>> v2;
		});
	}
	,setVar: function(name,v) {
		this.variables.h[name] = v;
		return v;
	}
	,assign: function(e1,e2) {
		var v = this.expr(e2);
		switch(e1._hx_index) {
		case 1:
			var id = e1.v;
			var l = this.locals.h[id];
			if(l == null) {
				this.setVar(id,v);
			} else {
				l.r = v;
			}
			break;
		case 5:
			var e = e1.e;
			var f = e1.f;
			v = this.set(this.expr(e),f,v);
			break;
		case 16:
			var e = e1.e;
			var index = e1.index;
			var arr = this.expr(e);
			var index1 = this.expr(index);
			if(js_Boot.__implements(arr,haxe_IMap)) {
				(js_Boot.__cast(arr , haxe_IMap)).set(index1,v);
			} else {
				arr[index1] = v;
			}
			break;
		default:
			var e = hscript_Error.EInvalidOp("=");
			throw haxe_Exception.thrown(e);
		}
		return v;
	}
	,assignOp: function(op,fop) {
		var me = this;
		this.binops.h[op] = function(e1,e2) {
			return me.evalAssignOp(op,fop,e1,e2);
		};
	}
	,evalAssignOp: function(op,fop,e1,e2) {
		var v;
		switch(e1._hx_index) {
		case 1:
			var id = e1.v;
			var l = this.locals.h[id];
			v = fop(this.expr(e1),this.expr(e2));
			if(l == null) {
				this.setVar(id,v);
			} else {
				l.r = v;
			}
			break;
		case 5:
			var e = e1.e;
			var f = e1.f;
			var obj = this.expr(e);
			v = fop(this.get(obj,f),this.expr(e2));
			v = this.set(obj,f,v);
			break;
		case 16:
			var e = e1.e;
			var index = e1.index;
			var arr = this.expr(e);
			var index1 = this.expr(index);
			if(js_Boot.__implements(arr,haxe_IMap)) {
				v = fop((js_Boot.__cast(arr , haxe_IMap)).get(index1),this.expr(e2));
				(js_Boot.__cast(arr , haxe_IMap)).set(index1,v);
			} else {
				v = fop(arr[index1],this.expr(e2));
				arr[index1] = v;
			}
			break;
		default:
			var e = hscript_Error.EInvalidOp(op);
			throw haxe_Exception.thrown(e);
		}
		return v;
	}
	,increment: function(e,prefix,delta) {
		switch(e._hx_index) {
		case 1:
			var id = e.v;
			var l = this.locals.h[id];
			var v = l == null ? this.resolve(id) : l.r;
			if(prefix) {
				v += delta;
				if(l == null) {
					this.setVar(id,v);
				} else {
					l.r = v;
				}
			} else if(l == null) {
				this.setVar(id,v + delta);
			} else {
				l.r = v + delta;
			}
			return v;
		case 5:
			var e1 = e.e;
			var f = e.f;
			var obj = this.expr(e1);
			var v = this.get(obj,f);
			if(prefix) {
				v += delta;
				this.set(obj,f,v);
			} else {
				this.set(obj,f,v + delta);
			}
			return v;
		case 16:
			var e1 = e.e;
			var index = e.index;
			var arr = this.expr(e1);
			var index1 = this.expr(index);
			if(js_Boot.__implements(arr,haxe_IMap)) {
				var v = (js_Boot.__cast(arr , haxe_IMap)).get(index1);
				if(prefix) {
					v += delta;
					(js_Boot.__cast(arr , haxe_IMap)).set(index1,v);
				} else {
					(js_Boot.__cast(arr , haxe_IMap)).set(index1,v + delta);
				}
				return v;
			} else {
				var v = arr[index1];
				if(prefix) {
					v += delta;
					arr[index1] = v;
				} else {
					arr[index1] = v + delta;
				}
				return v;
			}
			break;
		default:
			var e = hscript_Error.EInvalidOp(delta > 0 ? "++" : "--");
			throw haxe_Exception.thrown(e);
		}
	}
	,execute: function(expr) {
		this.depth = 0;
		this.locals = new haxe_ds_StringMap();
		this.declared = [];
		return this.exprReturn(expr);
	}
	,exprReturn: function(e) {
		try {
			return this.expr(e);
		} catch( _g ) {
			haxe_NativeStackTrace.lastError = _g;
			var _g1 = haxe_Exception.caught(_g).unwrap();
			if(js_Boot.__instanceof(_g1,hscript__$Interp_Stop)) {
				var e = _g1;
				switch(e._hx_index) {
				case 0:
					throw haxe_Exception.thrown("Invalid break");
				case 1:
					throw haxe_Exception.thrown("Invalid continue");
				case 2:
					var v = this.returnValue;
					this.returnValue = null;
					return v;
				}
			} else {
				throw _g;
			}
		}
	}
	,duplicate: function(h) {
		var h2 = new haxe_ds_StringMap();
		var h1 = h.h;
		var k_h = h1;
		var k_keys = Object.keys(h1);
		var k_length = k_keys.length;
		var k_current = 0;
		while(k_current < k_length) {
			var k = k_keys[k_current++];
			h2.h[k] = h.h[k];
		}
		return h2;
	}
	,restore: function(old) {
		while(this.declared.length > old) {
			var d = this.declared.pop();
			this.locals.h[d.n] = d.old;
		}
	}
	,error: function(e,rethrow) {
		if(rethrow == null) {
			rethrow = false;
		}
		if(rethrow) {
			throw haxe_Exception.thrown(e);
		} else {
			throw haxe_Exception.thrown(e);
		}
	}
	,rethrow: function(e) {
		throw haxe_Exception.thrown(e);
	}
	,resolve: function(id) {
		var v = this.variables.h[id];
		if(v == null && !Object.prototype.hasOwnProperty.call(this.variables.h,id)) {
			var e = hscript_Error.EUnknownVariable(id);
			throw haxe_Exception.thrown(e);
		}
		return v;
	}
	,expr: function(e) {
		var _gthis = this;
		switch(e._hx_index) {
		case 0:
			var c = e.c;
			switch(c._hx_index) {
			case 0:
				var v = c.v;
				return v;
			case 1:
				var f = c.f;
				return f;
			case 2:
				var s = c.s;
				return s;
			}
			break;
		case 1:
			var id = e.v;
			var l = this.locals.h[id];
			if(l != null) {
				return l.r;
			}
			return this.resolve(id);
		case 2:
			var _g = e.t;
			var n = e.n;
			var e1 = e.e;
			this.declared.push({ n : n, old : this.locals.h[n]});
			var this1 = this.locals;
			var value = e1 == null ? null : this.expr(e1);
			this1.h[n] = { r : value};
			return null;
		case 3:
			var e1 = e.e;
			return this.expr(e1);
		case 4:
			var exprs = e.e;
			var old = this.declared.length;
			var v = null;
			var _g = 0;
			while(_g < exprs.length) {
				var e1 = exprs[_g];
				++_g;
				v = this.expr(e1);
			}
			this.restore(old);
			return v;
		case 5:
			var e1 = e.e;
			var f = e.f;
			return this.get(this.expr(e1),f);
		case 6:
			var op = e.op;
			var e1 = e.e1;
			var e2 = e.e2;
			var fop = this.binops.h[op];
			if(fop == null) {
				var e3 = hscript_Error.EInvalidOp(op);
				throw haxe_Exception.thrown(e3);
			}
			return fop(e1,e2);
		case 7:
			var op = e.op;
			var prefix = e.prefix;
			var e1 = e.e;
			switch(op) {
			case "!":
				return this.expr(e1) != true;
			case "++":
				return this.increment(e1,prefix,1);
			case "-":
				return -this.expr(e1);
			case "--":
				return this.increment(e1,prefix,-1);
			case "~":
				return ~this.expr(e1);
			default:
				var e1 = hscript_Error.EInvalidOp(op);
				throw haxe_Exception.thrown(e1);
			}
			break;
		case 8:
			var e1 = e.e;
			var params = e.params;
			var args = [];
			var _g = 0;
			while(_g < params.length) {
				var p = params[_g];
				++_g;
				args.push(this.expr(p));
			}
			if(e1._hx_index == 5) {
				var e2 = e1.e;
				var f = e1.f;
				var obj = this.expr(e2);
				if(obj == null) {
					var e2 = hscript_Error.EInvalidAccess(f);
					throw haxe_Exception.thrown(e2);
				}
				return this.fcall(obj,f,args);
			} else {
				return this.call(null,this.expr(e1),args);
			}
			break;
		case 9:
			var econd = e.cond;
			var e1 = e.e1;
			var e2 = e.e2;
			if(this.expr(econd) == true) {
				return this.expr(e1);
			} else if(e2 == null) {
				return null;
			} else {
				return this.expr(e2);
			}
			break;
		case 10:
			var econd = e.cond;
			var e1 = e.e;
			this.whileLoop(econd,e1);
			return null;
		case 11:
			var v = e.v;
			var it = e.it;
			var e1 = e.e;
			this.forLoop(v,it,e1);
			return null;
		case 12:
			throw haxe_Exception.thrown(hscript__$Interp_Stop.SBreak);
		case 13:
			throw haxe_Exception.thrown(hscript__$Interp_Stop.SContinue);
		case 14:
			var _g = e.ret;
			var params = e.args;
			var fexpr = e.e;
			var name = e.name;
			var capturedLocals = this.duplicate(this.locals);
			var me = this;
			var hasOpt = false;
			var minParams = 0;
			var _g = 0;
			while(_g < params.length) {
				var p = params[_g];
				++_g;
				if(p.opt) {
					hasOpt = true;
				} else {
					minParams += 1;
				}
			}
			var f = function(args) {
				if((args == null ? 0 : args.length) != params.length) {
					if(args.length < minParams) {
						var str = "Invalid number of parameters. Got " + args.length + ", required " + minParams;
						if(name != null) {
							str += " for function '" + name + "'";
						}
						var e = hscript_Error.ECustom(str);
						throw haxe_Exception.thrown(e);
					}
					var args2 = [];
					var extraParams = args.length - minParams;
					var pos = 0;
					var _g = 0;
					while(_g < params.length) {
						var p = params[_g];
						++_g;
						if(p.opt) {
							if(extraParams > 0) {
								args2.push(args[pos++]);
								--extraParams;
							} else {
								args2.push(null);
							}
						} else {
							args2.push(args[pos++]);
						}
					}
					args = args2;
				}
				var old = me.locals;
				var depth = me.depth;
				me.depth++;
				me.locals = me.duplicate(capturedLocals);
				var _g = 0;
				var _g1 = params.length;
				while(_g < _g1) {
					var i = _g++;
					me.locals.h[params[i].name] = { r : args[i]};
				}
				var r = null;
				var oldDecl = _gthis.declared.length;
				if(_gthis.inTry) {
					try {
						r = me.exprReturn(fexpr);
					} catch( _g ) {
						haxe_NativeStackTrace.lastError = _g;
						var e = haxe_Exception.caught(_g).unwrap();
						_gthis.restore(oldDecl);
						me.locals = old;
						me.depth = depth;
						throw haxe_Exception.thrown(e);
					}
				} else {
					r = me.exprReturn(fexpr);
				}
				_gthis.restore(oldDecl);
				me.locals = old;
				me.depth = depth;
				return r;
			};
			var f1 = Reflect.makeVarArgs(f);
			if(name != null) {
				if(this.depth == 0) {
					this.variables.h[name] = f1;
				} else {
					this.declared.push({ n : name, old : this.locals.h[name]});
					var ref = { r : f1};
					this.locals.h[name] = ref;
					capturedLocals.h[name] = ref;
				}
			}
			return f1;
		case 15:
			var e1 = e.e;
			this.returnValue = e1 == null ? null : this.expr(e1);
			throw haxe_Exception.thrown(hscript__$Interp_Stop.SReturn);
		case 16:
			var e1 = e.e;
			var index = e.index;
			var arr = this.expr(e1);
			var index1 = this.expr(index);
			if(js_Boot.__implements(arr,haxe_IMap)) {
				return (js_Boot.__cast(arr , haxe_IMap)).get(index1);
			}
			return arr[index1];
		case 17:
			var arr = e.e;
			var tmp;
			if(arr.length > 0) {
				var _g = arr[0];
				if(_g._hx_index == 6) {
					var _g1 = _g.e1;
					var _g1 = _g.e2;
					tmp = _g.op == "=>";
				} else {
					tmp = false;
				}
			} else {
				tmp = false;
			}
			if(tmp) {
				var keys = [];
				var values = [];
				var _g = 0;
				while(_g < arr.length) {
					var e1 = arr[_g];
					++_g;
					if(e1._hx_index == 6) {
						if(e1.op == "=>") {
							var eKey = e1.e1;
							var eValue = e1.e2;
							keys.push(this.expr(eKey));
							values.push(this.expr(eValue));
						} else {
							var e2 = hscript_Error.ECustom("Invalid map key=>value expression");
							throw haxe_Exception.thrown(e2);
						}
					} else {
						var e3 = hscript_Error.ECustom("Invalid map key=>value expression");
						throw haxe_Exception.thrown(e3);
					}
				}
				return this.makeMap(keys,values);
			} else {
				var a = [];
				var _g = 0;
				while(_g < arr.length) {
					var e1 = arr[_g];
					++_g;
					a.push(this.expr(e1));
				}
				return a;
			}
			break;
		case 18:
			var cl = e.cl;
			var params1 = e.params;
			var a = [];
			var _g = 0;
			while(_g < params1.length) {
				var e1 = params1[_g];
				++_g;
				a.push(this.expr(e1));
			}
			return this.cnew(cl,a);
		case 19:
			var e1 = e.e;
			throw haxe_Exception.thrown(this.expr(e1));
		case 20:
			var _g = e.t;
			var e1 = e.e;
			var n = e.v;
			var ecatch = e.ecatch;
			var old = this.declared.length;
			var oldTry = this.inTry;
			try {
				this.inTry = true;
				var v = this.expr(e1);
				this.restore(old);
				this.inTry = oldTry;
				return v;
			} catch( _g ) {
				haxe_NativeStackTrace.lastError = _g;
				var _g1 = haxe_Exception.caught(_g).unwrap();
				if(js_Boot.__instanceof(_g1,hscript__$Interp_Stop)) {
					var err = _g1;
					this.inTry = oldTry;
					throw haxe_Exception.thrown(err);
				} else {
					var err = _g1;
					this.restore(old);
					this.inTry = oldTry;
					this.declared.push({ n : n, old : this.locals.h[n]});
					this.locals.h[n] = { r : err};
					var v = this.expr(ecatch);
					this.restore(old);
					return v;
				}
			}
			break;
		case 21:
			var fl = e.fl;
			var o = { };
			var _g = 0;
			while(_g < fl.length) {
				var f = fl[_g];
				++_g;
				this.set(o,f.name,this.expr(f.e));
			}
			return o;
		case 22:
			var econd = e.cond;
			var e1 = e.e1;
			var e2 = e.e2;
			if(this.expr(econd) == true) {
				return this.expr(e1);
			} else {
				return this.expr(e2);
			}
			break;
		case 23:
			var e1 = e.e;
			var cases = e.cases;
			var def = e.defaultExpr;
			var val = this.expr(e1);
			var match = false;
			var _g = 0;
			while(_g < cases.length) {
				var c = cases[_g];
				++_g;
				var _g1 = 0;
				var _g2 = c.values;
				while(_g1 < _g2.length) {
					var v = _g2[_g1];
					++_g1;
					if(this.expr(v) == val) {
						match = true;
						break;
					}
				}
				if(match) {
					val = this.expr(c.expr);
					break;
				}
			}
			if(!match) {
				val = def == null ? null : this.expr(def);
			}
			return val;
		case 24:
			var econd = e.cond;
			var e1 = e.e;
			this.doWhileLoop(econd,e1);
			return null;
		case 25:
			var meta = e.name;
			var args = e.args;
			var e1 = e.e;
			return this.exprMeta(meta,args,e1);
		case 26:
			var _g = e.t;
			var e1 = e.e;
			return this.expr(e1);
		case 27:
			var it = e.it;
			var e1 = e.e;
			var key = null;
			var value = null;
			var it1 = it;
			if(it1._hx_index == 6) {
				if(it1.op == "in") {
					var ekv = it1.e1;
					var eiter = it1.e2;
					if(ekv._hx_index == 6) {
						if(ekv.op == "=>") {
							var v1 = ekv.e1;
							var v2 = ekv.e2;
							if(v1._hx_index == 1) {
								if(v2._hx_index == 1) {
									var v21 = v2.v;
									var v11 = v1.v;
									key = v11;
									value = v21;
									it1 = eiter;
								}
							}
						}
					}
				}
			}
			if(key == null) {
				var e2 = hscript_Error.ECustom("Invalid for expression");
				throw haxe_Exception.thrown(e2);
			} else {
				_gthis.forKeyValueLoop(key,value,it1,e1);
			}
			return null;
		case 28:
			var _g = e.t;
			var e1 = e.e;
			return this.expr(e1);
		}
	}
	,exprMeta: function(meta,args,e) {
		return this.expr(e);
	}
	,doWhileLoop: function(econd,e) {
		var _gthis = this;
		var old = this.declared.length;
		do {
			var cont = true;
			try {
				_gthis.expr(e);
			} catch( _g ) {
				haxe_NativeStackTrace.lastError = _g;
				var _g1 = haxe_Exception.caught(_g).unwrap();
				if(js_Boot.__instanceof(_g1,hscript__$Interp_Stop)) {
					var err = _g1;
					switch(err._hx_index) {
					case 0:
						cont = false;
						break;
					case 1:
						break;
					case 2:
						throw haxe_Exception.thrown(err);
					}
				} else {
					throw _g;
				}
			}
			if(!cont) {
				break;
			}
		} while(this.expr(econd) == true);
		this.restore(old);
	}
	,whileLoop: function(econd,e) {
		var _gthis = this;
		var old = this.declared.length;
		while(this.expr(econd) == true) {
			var cont = true;
			try {
				_gthis.expr(e);
			} catch( _g ) {
				haxe_NativeStackTrace.lastError = _g;
				var _g1 = haxe_Exception.caught(_g).unwrap();
				if(js_Boot.__instanceof(_g1,hscript__$Interp_Stop)) {
					var err = _g1;
					switch(err._hx_index) {
					case 0:
						cont = false;
						break;
					case 1:
						break;
					case 2:
						throw haxe_Exception.thrown(err);
					}
				} else {
					throw _g;
				}
			}
			if(!cont) {
				break;
			}
		}
		this.restore(old);
	}
	,makeIterator: function(v) {
		if(((v) instanceof Array)) {
			return new haxe_iterators_ArrayIterator(v);
		}
		if(v.iterator != null) {
			v = $getIterator(v);
		}
		if(v.hasNext == null || v.next == null) {
			var e = hscript_Error.EInvalidIterator(v);
			throw haxe_Exception.thrown(e);
		}
		return v;
	}
	,makeKeyValueIterator: function(v) {
		if(((v) instanceof Array)) {
			return new haxe_iterators_ArrayKeyValueIterator(v);
		}
		if(v.keyValueIterator != null) {
			v = $getKeyValueIterator(v);
		}
		if(v.hasNext == null || v.next == null) {
			var e = hscript_Error.EInvalidIterator(v);
			throw haxe_Exception.thrown(e);
		}
		return v;
	}
	,forLoop: function(n,it,e) {
		var _gthis = this;
		var old = this.declared.length;
		this.declared.push({ n : n, old : this.locals.h[n]});
		var it1 = this.makeIterator(this.expr(it));
		while(it1.hasNext()) {
			var this1 = this.locals;
			var value = { r : it1.next()};
			this1.h[n] = value;
			var cont = true;
			try {
				_gthis.expr(e);
			} catch( _g ) {
				haxe_NativeStackTrace.lastError = _g;
				var _g1 = haxe_Exception.caught(_g).unwrap();
				if(js_Boot.__instanceof(_g1,hscript__$Interp_Stop)) {
					var err = _g1;
					switch(err._hx_index) {
					case 0:
						cont = false;
						break;
					case 1:
						break;
					case 2:
						throw haxe_Exception.thrown(err);
					}
				} else {
					throw _g;
				}
			}
			if(!cont) {
				break;
			}
		}
		this.restore(old);
	}
	,forKeyValueLoop: function(vk,vv,it,e) {
		var _gthis = this;
		var old = this.declared.length;
		this.declared.push({ n : vk, old : this.locals.h[vk]});
		this.declared.push({ n : vv, old : this.locals.h[vv]});
		var it1 = this.makeKeyValueIterator(this.expr(it));
		while(it1.hasNext()) {
			var v = it1.next();
			this.locals.h[vk] = { r : v.key};
			this.locals.h[vv] = { r : v.value};
			var cont = true;
			try {
				_gthis.expr(e);
			} catch( _g ) {
				haxe_NativeStackTrace.lastError = _g;
				var _g1 = haxe_Exception.caught(_g).unwrap();
				if(js_Boot.__instanceof(_g1,hscript__$Interp_Stop)) {
					var err = _g1;
					switch(err._hx_index) {
					case 0:
						cont = false;
						break;
					case 1:
						break;
					case 2:
						throw haxe_Exception.thrown(err);
					}
				} else {
					throw _g;
				}
			}
			if(!cont) {
				break;
			}
		}
		this.restore(old);
	}
	,loopRun: function(f) {
		var cont = true;
		try {
			f();
		} catch( _g ) {
			haxe_NativeStackTrace.lastError = _g;
			var _g1 = haxe_Exception.caught(_g).unwrap();
			if(js_Boot.__instanceof(_g1,hscript__$Interp_Stop)) {
				var err = _g1;
				switch(err._hx_index) {
				case 0:
					cont = false;
					break;
				case 1:
					break;
				case 2:
					throw haxe_Exception.thrown(err);
				}
			} else {
				throw _g;
			}
		}
		return cont;
	}
	,isMap: function(o) {
		return js_Boot.__implements(o,haxe_IMap);
	}
	,getMapValue: function(map,key) {
		return (js_Boot.__cast(map , haxe_IMap)).get(key);
	}
	,setMapValue: function(map,key,value) {
		(js_Boot.__cast(map , haxe_IMap)).set(key,value);
	}
	,makeMap: function(keys,values) {
		var isAllString = true;
		var isAllInt = true;
		var isAllObject = true;
		var isAllEnum = true;
		var _g = 0;
		while(_g < keys.length) {
			var key = keys[_g];
			++_g;
			isAllString = isAllString && typeof(key) == "string";
			isAllInt = isAllInt && (typeof(key) == "number" && ((key | 0) === key));
			isAllObject = isAllObject && Reflect.isObject(key);
			isAllEnum = isAllEnum && Reflect.isEnumValue(key);
		}
		if(isAllInt) {
			var m = new haxe_ds_IntMap();
			var _g_current = 0;
			var _g_array = keys;
			while(_g_current < _g_array.length) {
				var _g_value = _g_array[_g_current];
				var _g_key = _g_current++;
				var i = _g_key;
				var key = _g_value;
				m.h[key] = values[i];
			}
			return m;
		}
		if(isAllString) {
			var m = new haxe_ds_StringMap();
			var _g_current = 0;
			var _g_array = keys;
			while(_g_current < _g_array.length) {
				var _g_value = _g_array[_g_current];
				var _g_key = _g_current++;
				var i = _g_key;
				var key = _g_value;
				m.h[key] = values[i];
			}
			return m;
		}
		if(isAllEnum) {
			var m = new haxe_ds_EnumValueMap();
			var _g_current = 0;
			var _g_array = keys;
			while(_g_current < _g_array.length) {
				var _g_value = _g_array[_g_current];
				var _g_key = _g_current++;
				var i = _g_key;
				var key = _g_value;
				m.set(key,values[i]);
			}
			return m;
		}
		if(isAllObject) {
			var m = new haxe_ds_ObjectMap();
			var _g_current = 0;
			var _g_array = keys;
			while(_g_current < _g_array.length) {
				var _g_value = _g_array[_g_current];
				var _g_key = _g_current++;
				var i = _g_key;
				var key = _g_value;
				m.set(key,values[i]);
			}
			return m;
		}
		var e = hscript_Error.ECustom("Invalid map keys " + Std.string(keys));
		throw haxe_Exception.thrown(e);
	}
	,get: function(o,f) {
		if(o == null) {
			var e = hscript_Error.EInvalidAccess(f);
			throw haxe_Exception.thrown(e);
		}
		return Reflect.getProperty(o,f);
	}
	,set: function(o,f,v) {
		if(o == null) {
			var e = hscript_Error.EInvalidAccess(f);
			throw haxe_Exception.thrown(e);
		}
		Reflect.setProperty(o,f,v);
		return v;
	}
	,fcall: function(o,f,args) {
		return this.call(o,this.get(o,f),args);
	}
	,call: function(o,f,args) {
		return f.apply(o,args);
	}
	,cnew: function(cl,args) {
		var c = $hxClasses[cl];
		if(c == null) {
			c = this.resolve(cl);
		}
		return Type.createInstance(c,args);
	}
	,__class__: hscript_Interp
};
var hscript_Token = $hxEnums["hscript.Token"] = { __ename__:"hscript.Token",__constructs__:null
	,TEof: {_hx_name:"TEof",_hx_index:0,__enum__:"hscript.Token",toString:$estr}
	,TConst: ($_=function(c) { return {_hx_index:1,c:c,__enum__:"hscript.Token",toString:$estr}; },$_._hx_name="TConst",$_.__params__ = ["c"],$_)
	,TId: ($_=function(s) { return {_hx_index:2,s:s,__enum__:"hscript.Token",toString:$estr}; },$_._hx_name="TId",$_.__params__ = ["s"],$_)
	,TOp: ($_=function(s) { return {_hx_index:3,s:s,__enum__:"hscript.Token",toString:$estr}; },$_._hx_name="TOp",$_.__params__ = ["s"],$_)
	,TPOpen: {_hx_name:"TPOpen",_hx_index:4,__enum__:"hscript.Token",toString:$estr}
	,TPClose: {_hx_name:"TPClose",_hx_index:5,__enum__:"hscript.Token",toString:$estr}
	,TBrOpen: {_hx_name:"TBrOpen",_hx_index:6,__enum__:"hscript.Token",toString:$estr}
	,TBrClose: {_hx_name:"TBrClose",_hx_index:7,__enum__:"hscript.Token",toString:$estr}
	,TDot: {_hx_name:"TDot",_hx_index:8,__enum__:"hscript.Token",toString:$estr}
	,TQuestionDot: {_hx_name:"TQuestionDot",_hx_index:9,__enum__:"hscript.Token",toString:$estr}
	,TComma: {_hx_name:"TComma",_hx_index:10,__enum__:"hscript.Token",toString:$estr}
	,TSemicolon: {_hx_name:"TSemicolon",_hx_index:11,__enum__:"hscript.Token",toString:$estr}
	,TBkOpen: {_hx_name:"TBkOpen",_hx_index:12,__enum__:"hscript.Token",toString:$estr}
	,TBkClose: {_hx_name:"TBkClose",_hx_index:13,__enum__:"hscript.Token",toString:$estr}
	,TQuestion: {_hx_name:"TQuestion",_hx_index:14,__enum__:"hscript.Token",toString:$estr}
	,TDoubleDot: {_hx_name:"TDoubleDot",_hx_index:15,__enum__:"hscript.Token",toString:$estr}
	,TMeta: ($_=function(s) { return {_hx_index:16,s:s,__enum__:"hscript.Token",toString:$estr}; },$_._hx_name="TMeta",$_.__params__ = ["s"],$_)
	,TPrepro: ($_=function(s) { return {_hx_index:17,s:s,__enum__:"hscript.Token",toString:$estr}; },$_._hx_name="TPrepro",$_.__params__ = ["s"],$_)
};
hscript_Token.__constructs__ = [hscript_Token.TEof,hscript_Token.TConst,hscript_Token.TId,hscript_Token.TOp,hscript_Token.TPOpen,hscript_Token.TPClose,hscript_Token.TBrOpen,hscript_Token.TBrClose,hscript_Token.TDot,hscript_Token.TQuestionDot,hscript_Token.TComma,hscript_Token.TSemicolon,hscript_Token.TBkOpen,hscript_Token.TBkClose,hscript_Token.TQuestion,hscript_Token.TDoubleDot,hscript_Token.TMeta,hscript_Token.TPrepro];
var hscript_Parser = function() {
	this.uid = 0;
	this.preprocesorValues = new haxe_ds_StringMap();
	this.line = 1;
	this.opChars = "+*/-=!><&|^%~";
	this.identChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_";
	var priorities = [["%"],["*","/"],["+","-"],["<<",">>",">>>"],["|","&","^"],["==","!=",">","<",">=","<="],["..."],["&&"],["||"],["=","+=","-=","*=","/=","%=","<<=",">>=",">>>=","|=","&=","^=","=>"],["->"],["in","is"]];
	this.opPriority = new haxe_ds_StringMap();
	this.opRightAssoc = new haxe_ds_StringMap();
	var _g = 0;
	var _g1 = priorities.length;
	while(_g < _g1) {
		var i = _g++;
		var _g2 = 0;
		var _g3 = priorities[i];
		while(_g2 < _g3.length) {
			var x = _g3[_g2];
			++_g2;
			this.opPriority.h[x] = i;
			if(i == 9) {
				this.opRightAssoc.h[x] = true;
			}
		}
	}
	var x = "!";
	this.opPriority.h[x] = x == "++" || x == "--" ? -1 : -2;
	var x = "++";
	this.opPriority.h[x] = x == "++" || x == "--" ? -1 : -2;
	var x = "--";
	this.opPriority.h[x] = x == "++" || x == "--" ? -1 : -2;
	var x = "~";
	this.opPriority.h[x] = x == "++" || x == "--" ? -1 : -2;
};
$hxClasses["hscript.Parser"] = hscript_Parser;
hscript_Parser.__name__ = "hscript.Parser";
hscript_Parser.prototype = {
	line: null
	,opChars: null
	,identChars: null
	,opPriority: null
	,opRightAssoc: null
	,preprocesorValues: null
	,allowJSON: null
	,allowTypes: null
	,allowMetadata: null
	,resumeErrors: null
	,input: null
	,readPos: null
	,offset: null
	,char: null
	,ops: null
	,idents: null
	,uid: null
	,tokens: null
	,get_currentPos: function() {
		return this.readPos + this.offset;
	}
	,error: function(err,pmin,pmax) {
		if(!this.resumeErrors) {
			throw haxe_Exception.thrown(err);
		}
	}
	,invalidChar: function(c) {
		if(!this.resumeErrors) {
			throw haxe_Exception.thrown(hscript_Error.EInvalidChar(c));
		}
	}
	,initParser: function(origin,pos) {
		this.preprocStack = [];
		this.tokens = new haxe_ds_GenericStack();
		this.offset = pos;
		this.char = -1;
		this.ops = [];
		this.idents = [];
		this.uid = 0;
		var _g = 0;
		var _g1 = this.opChars.length;
		while(_g < _g1) {
			var i = _g++;
			this.ops[HxOverrides.cca(this.opChars,i)] = true;
		}
		var _g = 0;
		var _g1 = this.identChars.length;
		while(_g < _g1) {
			var i = _g++;
			this.idents[HxOverrides.cca(this.identChars,i)] = true;
		}
	}
	,parseString: function(s,origin,position) {
		if(position == null) {
			position = 0;
		}
		if(origin == null) {
			origin = "hscript";
		}
		this.initParser(origin,position);
		this.input = s;
		this.readPos = 0;
		var a = [];
		while(true) {
			var tk = this.token();
			if(tk == hscript_Token.TEof) {
				break;
			}
			var _this = this.tokens;
			_this.head = new haxe_ds_GenericCell(tk,_this.head);
			this.parseFullExpr(a);
		}
		if(a.length == 1) {
			return a[0];
		} else {
			return hscript_Expr.EBlock(a);
		}
	}
	,unexpected: function(tk) {
		var err = hscript_Error.EUnexpected(this.tokenString(tk));
		if(!this.resumeErrors) {
			throw haxe_Exception.thrown(err);
		}
		return null;
	}
	,push: function(tk) {
		var _this = this.tokens;
		_this.head = new haxe_ds_GenericCell(tk,_this.head);
	}
	,ensure: function(tk) {
		var t = this.token();
		if(t != tk) {
			this.unexpected(t);
		}
	}
	,ensureToken: function(tk) {
		var t = this.token();
		if(!Type.enumEq(t,tk)) {
			this.unexpected(t);
		}
	}
	,maybe: function(tk) {
		var t = this.token();
		if(Type.enumEq(t,tk)) {
			return true;
		}
		var _this = this.tokens;
		_this.head = new haxe_ds_GenericCell(t,_this.head);
		return false;
	}
	,getIdent: function() {
		var tk = this.token();
		if(tk == null) {
			this.unexpected(tk);
			return null;
		} else if(tk._hx_index == 2) {
			var id = tk.s;
			return id;
		} else {
			this.unexpected(tk);
			return null;
		}
	}
	,expr: function(e) {
		return e;
	}
	,pmin: function(e) {
		return 0;
	}
	,pmax: function(e) {
		return 0;
	}
	,mk: function(e,pmin,pmax) {
		if(pmax == null) {
			pmax = -1;
		}
		if(pmin == null) {
			pmin = -1;
		}
		return e;
	}
	,isBlock: function(e) {
		if(e == null) {
			return false;
		}
		if(e == null) {
			return false;
		} else {
			switch(e._hx_index) {
			case 2:
				var _g = e.n;
				var t = e.t;
				var e1 = e.e;
				if(e1 != null) {
					return this.isBlock(e1);
				} else if(t != null) {
					if(t == null) {
						return false;
					} else if(t._hx_index == 2) {
						var _g = t.fields;
						return true;
					} else {
						return false;
					}
				} else {
					return false;
				}
				break;
			case 4:
				var _g = e.e;
				return true;
			case 6:
				var _g = e.op;
				var _g = e.e1;
				var e1 = e.e2;
				return this.isBlock(e1);
			case 7:
				var _g = e.op;
				var prefix = e.prefix;
				var e1 = e.e;
				if(!prefix) {
					return this.isBlock(e1);
				} else {
					return false;
				}
				break;
			case 9:
				var _g = e.cond;
				var e1 = e.e1;
				var e2 = e.e2;
				if(e2 != null) {
					return this.isBlock(e2);
				} else {
					return this.isBlock(e1);
				}
				break;
			case 10:
				var _g = e.cond;
				var e1 = e.e;
				return this.isBlock(e1);
			case 11:
				var _g = e.v;
				var _g = e.it;
				var e1 = e.e;
				return this.isBlock(e1);
			case 14:
				var _g = e.args;
				var _g = e.name;
				var _g = e.ret;
				var e1 = e.e;
				return this.isBlock(e1);
			case 15:
				var e1 = e.e;
				if(e1 != null) {
					return this.isBlock(e1);
				} else {
					return false;
				}
				break;
			case 20:
				var _g = e.e;
				var _g = e.v;
				var _g = e.t;
				var e1 = e.ecatch;
				return this.isBlock(e1);
			case 21:
				var _g = e.fl;
				return true;
			case 23:
				var _g = e.e;
				var _g = e.cases;
				var _g = e.defaultExpr;
				return true;
			case 24:
				var _g = e.cond;
				var e1 = e.e;
				return this.isBlock(e1);
			case 25:
				var _g = e.args;
				if(e.name == ":markup") {
					return true;
				} else {
					var e1 = e.e;
					return this.isBlock(e1);
				}
				break;
			case 27:
				var _g = e.it;
				var e1 = e.e;
				return this.isBlock(e1);
			default:
				return false;
			}
		}
	}
	,parseFullExpr: function(exprs) {
		var e = this.parseExpr();
		exprs.push(e);
		var tk = this.token();
		while(true) {
			var tmp;
			if(tk == hscript_Token.TComma && e != null) {
				if(e == null) {
					tmp = false;
				} else if(e._hx_index == 2) {
					var _g = e.n;
					var _g1 = e.t;
					var _g2 = e.e;
					tmp = true;
				} else {
					tmp = false;
				}
			} else {
				tmp = false;
			}
			if(!tmp) {
				break;
			}
			e = this.parseStructure("var");
			exprs.push(e);
			tk = this.token();
		}
		if(tk != hscript_Token.TSemicolon && tk != hscript_Token.TEof) {
			if(this.isBlock(e)) {
				var _this = this.tokens;
				_this.head = new haxe_ds_GenericCell(tk,_this.head);
			} else {
				this.unexpected(tk);
			}
		}
	}
	,parseObject: function(p1) {
		var fl = [];
		_hx_loop1: while(true) {
			var tk = this.token();
			var id = null;
			if(tk == null) {
				this.unexpected(tk);
				break;
			} else {
				switch(tk._hx_index) {
				case 1:
					var c = tk.c;
					if(!this.allowJSON) {
						this.unexpected(tk);
					}
					if(c._hx_index == 2) {
						var s = c.s;
						id = s;
					} else {
						this.unexpected(tk);
					}
					break;
				case 2:
					var i = tk.s;
					id = i;
					break;
				case 7:
					break _hx_loop1;
				default:
					this.unexpected(tk);
					break _hx_loop1;
				}
			}
			var t = this.token();
			if(t != hscript_Token.TDoubleDot) {
				this.unexpected(t);
			}
			fl.push({ name : id, e : this.parseExpr()});
			tk = this.token();
			if(tk == null) {
				this.unexpected(tk);
			} else {
				switch(tk._hx_index) {
				case 7:
					break _hx_loop1;
				case 10:
					break;
				default:
					this.unexpected(tk);
				}
			}
		}
		var pmin = p1;
		return this.parseExprNext(hscript_Expr.EObject(fl));
	}
	,parseExpr: function() {
		var tk = this.token();
		if(tk == null) {
			return this.unexpected(tk);
		} else {
			switch(tk._hx_index) {
			case 1:
				var c = tk.c;
				return this.parseExprNext(hscript_Expr.EConst(c));
			case 2:
				var id = tk.s;
				var e = this.parseStructure(id);
				if(e == null) {
					e = hscript_Expr.EIdent(id);
				}
				return this.parseExprNext(e);
			case 3:
				var op = tk.s;
				if(op == "-") {
					var start = 0;
					var e = this.parseExpr();
					if(e == null) {
						return this.makeUnop(op,e);
					}
					if(e == null) {
						return this.makeUnop(op,e);
					} else if(e._hx_index == 0) {
						var _g = e.c;
						switch(_g._hx_index) {
						case 0:
							var i = _g.v;
							var pmin = start;
							return hscript_Expr.EConst(hscript_Const.CInt(-i));
						case 1:
							var f = _g.f;
							var pmin = start;
							return hscript_Expr.EConst(hscript_Const.CFloat(-f));
						default:
							return this.makeUnop(op,e);
						}
					} else {
						return this.makeUnop(op,e);
					}
				}
				if(this.opPriority.h[op] < 0) {
					return this.makeUnop(op,this.parseExpr());
				}
				if(op == "<") {
					var start = this.readPos - 1;
					var ident = this.getIdent();
					if(this.tokens.head != null) {
						throw haxe_Exception.thrown("assert");
					}
					if(this.readPos == start + ident.length + 1) {
						var endTag = "</" + ident + ">";
						var end = this.input.indexOf(endTag,this.readPos);
						if(end < 0) {
							endTag = "/>";
							end = this.input.indexOf(endTag,this.readPos);
						}
						if(end >= 0) {
							this.readPos = end + endTag.length;
							this.char = -1;
							--start;
							var end = this.readPos - 1;
							var str = HxOverrides.substr(this.input,start,end - start + 1);
							return hscript_Expr.EMeta(":markup",[],hscript_Expr.EConst(hscript_Const.CString(str)));
						}
					}
				}
				return this.unexpected(tk);
			case 4:
				tk = this.token();
				if(tk == hscript_Token.TPClose) {
					var t = this.token();
					if(!Type.enumEq(t,hscript_Token.TOp("->"))) {
						this.unexpected(t);
					}
					var eret = this.parseExpr();
					return this.mkLambda([],eret,0);
				}
				var _this = this.tokens;
				_this.head = new haxe_ds_GenericCell(tk,_this.head);
				var e = this.parseExpr();
				tk = this.token();
				if(tk != null) {
					switch(tk._hx_index) {
					case 0:
						if(this.resumeErrors) {
							return e;
						}
						break;
					case 5:
						return this.parseExprNext(hscript_Expr.EParent(e));
					case 10:
						if(e != null) {
							if(e._hx_index == 1) {
								var v = e.v;
								return this.parseLambda([{ name : v}],0);
							}
						}
						break;
					case 15:
						var t = this.parseType();
						tk = this.token();
						if(tk != null) {
							switch(tk._hx_index) {
							case 5:
								return this.parseExprNext(hscript_Expr.ECheckType(e,t));
							case 10:
								if(e != null) {
									if(e._hx_index == 1) {
										var v = e.v;
										return this.parseLambda([{ name : v, t : t}],0);
									}
								}
								break;
							default:
							}
						}
						break;
					default:
					}
				}
				return this.unexpected(tk);
			case 6:
				tk = this.token();
				if(tk == null) {
					var _this = this.tokens;
					_this.head = new haxe_ds_GenericCell(tk,_this.head);
				} else {
					switch(tk._hx_index) {
					case 1:
						var c = tk.c;
						if(this.allowJSON) {
							if(c._hx_index == 2) {
								var _g = c.s;
								var tk2 = this.token();
								var _this = this.tokens;
								_this.head = new haxe_ds_GenericCell(tk2,_this.head);
								var _this = this.tokens;
								_this.head = new haxe_ds_GenericCell(tk,_this.head);
								if(tk2 != null) {
									if(tk2._hx_index == 15) {
										return this.parseExprNext(this.parseObject(0));
									}
								}
							} else {
								var _this = this.tokens;
								_this.head = new haxe_ds_GenericCell(tk,_this.head);
							}
						} else {
							var _this = this.tokens;
							_this.head = new haxe_ds_GenericCell(tk,_this.head);
						}
						break;
					case 2:
						var _g = tk.s;
						var tk2 = this.token();
						var _this = this.tokens;
						_this.head = new haxe_ds_GenericCell(tk2,_this.head);
						var _this = this.tokens;
						_this.head = new haxe_ds_GenericCell(tk,_this.head);
						if(tk2 != null) {
							if(tk2._hx_index == 15) {
								return this.parseExprNext(this.parseObject(0));
							}
						}
						break;
					case 7:
						return this.parseExprNext(hscript_Expr.EObject([]));
					default:
						var _this = this.tokens;
						_this.head = new haxe_ds_GenericCell(tk,_this.head);
					}
				}
				var a = [];
				while(true) {
					this.parseFullExpr(a);
					tk = this.token();
					if(tk == hscript_Token.TBrClose || this.resumeErrors && tk == hscript_Token.TEof) {
						break;
					}
					var _this = this.tokens;
					_this.head = new haxe_ds_GenericCell(tk,_this.head);
				}
				return hscript_Expr.EBlock(a);
			case 12:
				var a = [];
				tk = this.token();
				var first = true;
				while(tk != hscript_Token.TBkClose && (!this.resumeErrors || tk != hscript_Token.TEof)) {
					if(!first) {
						if(tk != hscript_Token.TComma) {
							this.unexpected(tk);
						} else {
							tk = this.token();
							if(tk == hscript_Token.TBkClose) {
								break;
							}
						}
					}
					first = false;
					var _this = this.tokens;
					_this.head = new haxe_ds_GenericCell(tk,_this.head);
					a.push(this.parseExpr());
					tk = this.token();
				}
				if(a.length == 1 && a[0] != null) {
					var _g = a[0];
					if(_g != null) {
						switch(_g._hx_index) {
						case 10:
							var _g1 = _g.cond;
							var _g1 = _g.e;
							var tmp = "__a_" + this.uid++;
							var e = hscript_Expr.EBlock([hscript_Expr.EVar(tmp,null,hscript_Expr.EArrayDecl([])),this.mapCompr(tmp,a[0]),hscript_Expr.EIdent(tmp)]);
							return this.parseExprNext(e);
						case 11:
							var _g1 = _g.v;
							var _g1 = _g.it;
							var _g1 = _g.e;
							var tmp = "__a_" + this.uid++;
							var e = hscript_Expr.EBlock([hscript_Expr.EVar(tmp,null,hscript_Expr.EArrayDecl([])),this.mapCompr(tmp,a[0]),hscript_Expr.EIdent(tmp)]);
							return this.parseExprNext(e);
						case 24:
							var _g1 = _g.cond;
							var _g1 = _g.e;
							var tmp = "__a_" + this.uid++;
							var e = hscript_Expr.EBlock([hscript_Expr.EVar(tmp,null,hscript_Expr.EArrayDecl([])),this.mapCompr(tmp,a[0]),hscript_Expr.EIdent(tmp)]);
							return this.parseExprNext(e);
						default:
						}
					}
				}
				return this.parseExprNext(hscript_Expr.EArrayDecl(a));
			case 16:
				var id = tk.s;
				if(this.allowMetadata) {
					var args = this.parseMetaArgs();
					return hscript_Expr.EMeta(id,args,this.parseExpr());
				} else {
					return this.unexpected(tk);
				}
				break;
			default:
				return this.unexpected(tk);
			}
		}
	}
	,parseLambda: function(args,pmin) {
		_hx_loop1: while(true) {
			var id = this.getIdent();
			var t = this.maybe(hscript_Token.TDoubleDot) ? this.parseType() : null;
			args.push({ name : id, t : t});
			var tk = this.token();
			if(tk == null) {
				this.unexpected(tk);
				break;
			} else {
				switch(tk._hx_index) {
				case 5:
					break _hx_loop1;
				case 10:
					break;
				default:
					this.unexpected(tk);
					break _hx_loop1;
				}
			}
		}
		var t = this.token();
		if(!Type.enumEq(t,hscript_Token.TOp("->"))) {
			this.unexpected(t);
		}
		var eret = this.parseExpr();
		return this.mkLambda(args,eret,pmin);
	}
	,mkLambda: function(args,eret,p) {
		var pmin = p;
		var pmin = p;
		return hscript_Expr.EFunction(args,hscript_Expr.EMeta(":lambda",[],hscript_Expr.EReturn(eret)));
	}
	,parseMetaArgs: function() {
		var tk = this.token();
		if(tk != hscript_Token.TPOpen) {
			var _this = this.tokens;
			_this.head = new haxe_ds_GenericCell(tk,_this.head);
			return null;
		}
		var args = [];
		tk = this.token();
		if(tk != hscript_Token.TPClose) {
			var _this = this.tokens;
			_this.head = new haxe_ds_GenericCell(tk,_this.head);
			_hx_loop1: while(true) {
				args.push(this.parseExpr());
				var _g = this.token();
				if(_g == null) {
					var tk = _g;
					this.unexpected(tk);
				} else {
					switch(_g._hx_index) {
					case 5:
						break _hx_loop1;
					case 10:
						break;
					default:
						var tk1 = _g;
						this.unexpected(tk1);
					}
				}
			}
		}
		return args;
	}
	,mapCompr: function(tmp,e) {
		if(e == null) {
			return null;
		}
		var edef;
		switch(e._hx_index) {
		case 3:
			var e2 = e.e;
			edef = hscript_Expr.EParent(this.mapCompr(tmp,e2));
			break;
		case 4:
			var _g = e.e;
			if(_g.length == 1) {
				var e1 = _g[0];
				edef = hscript_Expr.EBlock([this.mapCompr(tmp,e1)]);
			} else {
				edef = hscript_Expr.ECall(hscript_Expr.EField(hscript_Expr.EIdent(tmp),"push"),[e]);
			}
			break;
		case 9:
			var cond = e.cond;
			var e1 = e.e1;
			var e2 = e.e2;
			edef = e2 == null ? hscript_Expr.EIf(cond,this.mapCompr(tmp,e1),null) : hscript_Expr.ECall(hscript_Expr.EField(hscript_Expr.EIdent(tmp),"push"),[e]);
			break;
		case 10:
			var cond = e.cond;
			var e2 = e.e;
			edef = hscript_Expr.EWhile(cond,this.mapCompr(tmp,e2));
			break;
		case 11:
			var v = e.v;
			var it = e.it;
			var e2 = e.e;
			edef = hscript_Expr.EFor(v,it,this.mapCompr(tmp,e2));
			break;
		case 24:
			var cond = e.cond;
			var e2 = e.e;
			edef = hscript_Expr.EDoWhile(cond,this.mapCompr(tmp,e2));
			break;
		case 27:
			var it = e.it;
			var e2 = e.e;
			edef = hscript_Expr.EForGen(it,this.mapCompr(tmp,e2));
			break;
		default:
			edef = hscript_Expr.ECall(hscript_Expr.EField(hscript_Expr.EIdent(tmp),"push"),[e]);
		}
		return edef;
	}
	,makeUnop: function(op,e) {
		if(e == null && this.resumeErrors) {
			return null;
		}
		if(e == null) {
			return hscript_Expr.EUnop(op,true,e);
		} else {
			switch(e._hx_index) {
			case 6:
				var bop = e.op;
				var e1 = e.e1;
				var e2 = e.e2;
				return hscript_Expr.EBinop(bop,this.makeUnop(op,e1),e2);
			case 22:
				var e1 = e.cond;
				var e2 = e.e1;
				var e3 = e.e2;
				return hscript_Expr.ETernary(this.makeUnop(op,e1),e2,e3);
			default:
				return hscript_Expr.EUnop(op,true,e);
			}
		}
	}
	,makeBinop: function(op,e1,e) {
		if(e == null && this.resumeErrors) {
			return hscript_Expr.EBinop(op,e1,e);
		}
		if(e == null) {
			return hscript_Expr.EBinop(op,e1,e);
		} else {
			switch(e._hx_index) {
			case 6:
				var op2 = e.op;
				var e2 = e.e1;
				var e3 = e.e2;
				var delta = this.opPriority.h[op] - this.opPriority.h[op2];
				if(delta < 0 || delta == 0 && !Object.prototype.hasOwnProperty.call(this.opRightAssoc.h,op)) {
					return hscript_Expr.EBinop(op2,this.makeBinop(op,e1,e2),e3);
				} else {
					return hscript_Expr.EBinop(op,e1,e);
				}
				break;
			case 22:
				var e2 = e.cond;
				var e3 = e.e1;
				var e4 = e.e2;
				if(Object.prototype.hasOwnProperty.call(this.opRightAssoc.h,op)) {
					return hscript_Expr.EBinop(op,e1,e);
				} else {
					return hscript_Expr.ETernary(this.makeBinop(op,e1,e2),e3,e4);
				}
				break;
			default:
				return hscript_Expr.EBinop(op,e1,e);
			}
		}
	}
	,parseStructure: function(id) {
		switch(id) {
		case "break":
			return hscript_Expr.EBreak;
		case "cast":
			var tk = this.token();
			if(tk == hscript_Token.TPOpen) {
				var e = this.parseExpr();
				var t = this.token();
				if(t != hscript_Token.TComma) {
					this.unexpected(t);
				}
				var t = this.parseType();
				return hscript_Expr.ECast(e,t);
			} else {
				var _this = this.tokens;
				_this.head = new haxe_ds_GenericCell(tk,_this.head);
				var e = this.parseExpr();
				return hscript_Expr.ECast(e,null);
			}
			break;
		case "continue":
			return hscript_Expr.EContinue;
		case "do":
			var e = this.parseExpr();
			var tk = this.token();
			if(tk == null) {
				this.unexpected(tk);
			} else if(tk._hx_index == 2) {
				if(tk.s != "while") {
					this.unexpected(tk);
				}
			} else {
				this.unexpected(tk);
			}
			var econd = this.parseExpr();
			return hscript_Expr.EDoWhile(econd,e);
		case "else":
			return this.unexpected(hscript_Token.TId(id));
		case "final":case "var":
			var ident = this.getIdent();
			var tk = this.token();
			var t = null;
			if(tk == hscript_Token.TDoubleDot && this.allowTypes) {
				t = this.parseType();
				tk = this.token();
			}
			var e = null;
			if(tk == null) {
				if(t != null) {
					var _this = this.tokens;
					_this.head = new haxe_ds_GenericCell(tk,_this.head);
				} else {
					this.unexpected(tk);
				}
			} else {
				switch(tk._hx_index) {
				case 3:
					if(tk.s == "=") {
						e = this.parseExpr();
					} else {
						this.unexpected(tk);
					}
					break;
				case 10:case 11:
					var _this = this.tokens;
					_this.head = new haxe_ds_GenericCell(tk,_this.head);
					break;
				default:
					if(t != null) {
						var _this = this.tokens;
						_this.head = new haxe_ds_GenericCell(tk,_this.head);
					} else {
						this.unexpected(tk);
					}
				}
			}
			var pmax = e == null ? 0 : 0;
			return hscript_Expr.EVar(ident,t,e);
		case "for":
			var t = this.token();
			if(t != hscript_Token.TPOpen) {
				this.unexpected(t);
			}
			var eit = this.parseExpr();
			var t = this.token();
			if(t != hscript_Token.TPClose) {
				this.unexpected(t);
			}
			var e = this.parseExpr();
			if(eit != null) {
				if(eit._hx_index == 6) {
					if(eit.op == "in") {
						var ev = eit.e1;
						var eit1 = eit.e2;
						if(ev._hx_index == 1) {
							var v = ev.v;
							return hscript_Expr.EFor(v,eit1,e);
						}
					}
				}
			}
			return hscript_Expr.EForGen(eit,e);
		case "function":
			var tk = this.token();
			var name = null;
			if(tk == null) {
				var _this = this.tokens;
				_this.head = new haxe_ds_GenericCell(tk,_this.head);
			} else if(tk._hx_index == 2) {
				var id = tk.s;
				name = id;
			} else {
				var _this = this.tokens;
				_this.head = new haxe_ds_GenericCell(tk,_this.head);
			}
			var inf = this.parseFunctionDecl();
			return hscript_Expr.EFunction(inf.args,inf.body,name,inf.ret);
		case "if":
			var t = this.token();
			if(t != hscript_Token.TPOpen) {
				this.unexpected(t);
			}
			var cond = this.parseExpr();
			var t = this.token();
			if(t != hscript_Token.TPClose) {
				this.unexpected(t);
			}
			var e1 = this.parseExpr();
			var e2 = null;
			var semic = false;
			var tk = this.token();
			if(tk == hscript_Token.TSemicolon) {
				semic = true;
				tk = this.token();
			}
			if(Type.enumEq(tk,hscript_Token.TId("else"))) {
				e2 = this.parseExpr();
			} else {
				var _this = this.tokens;
				_this.head = new haxe_ds_GenericCell(tk,_this.head);
				if(semic) {
					var _this = this.tokens;
					_this.head = new haxe_ds_GenericCell(hscript_Token.TSemicolon,_this.head);
				}
			}
			var pmax = e2 == null ? 0 : 0;
			return hscript_Expr.EIf(cond,e1,e2);
		case "inline":
			if(!this.maybe(hscript_Token.TId("function"))) {
				this.unexpected(hscript_Token.TId("inline"));
			}
			return this.parseStructure("function");
		case "new":
			var a = [];
			a.push(this.getIdent());
			_hx_loop1: while(true) {
				var tk = this.token();
				if(tk == null) {
					this.unexpected(tk);
					break;
				} else {
					switch(tk._hx_index) {
					case 4:
						break _hx_loop1;
					case 8:
						a.push(this.getIdent());
						break;
					default:
						this.unexpected(tk);
						break _hx_loop1;
					}
				}
			}
			var args = this.parseExprList(hscript_Token.TPClose);
			return hscript_Expr.ENew(a.join("."),args);
		case "return":
			var tk = this.token();
			var _this = this.tokens;
			_this.head = new haxe_ds_GenericCell(tk,_this.head);
			var e = tk == hscript_Token.TSemicolon ? null : this.parseExpr();
			var pmax = e == null ? 0 : 0;
			return hscript_Expr.EReturn(e);
		case "switch":
			var e = this.parseExpr();
			var def = null;
			var cases = [];
			var t = this.token();
			if(t != hscript_Token.TBrOpen) {
				this.unexpected(t);
			}
			_hx_loop2: while(true) {
				var tk = this.token();
				if(tk == null) {
					this.unexpected(tk);
					break;
				} else {
					switch(tk._hx_index) {
					case 2:
						switch(tk.s) {
						case "case":
							var c = { values : [], expr : null};
							cases.push(c);
							_hx_loop3: while(true) {
								var e1 = this.parseExpr();
								c.values.push(e1);
								tk = this.token();
								if(tk == null) {
									this.unexpected(tk);
									break;
								} else {
									switch(tk._hx_index) {
									case 10:
										break;
									case 15:
										break _hx_loop3;
									default:
										this.unexpected(tk);
										break _hx_loop3;
									}
								}
							}
							var exprs = [];
							_hx_loop4: while(true) {
								tk = this.token();
								var _this = this.tokens;
								_this.head = new haxe_ds_GenericCell(tk,_this.head);
								if(tk == null) {
									this.parseFullExpr(exprs);
								} else {
									switch(tk._hx_index) {
									case 0:
										if(this.resumeErrors) {
											break _hx_loop4;
										} else {
											this.parseFullExpr(exprs);
										}
										break;
									case 2:
										switch(tk.s) {
										case "case":case "default":
											break _hx_loop4;
										default:
											this.parseFullExpr(exprs);
										}
										break;
									case 7:
										break _hx_loop4;
									default:
										this.parseFullExpr(exprs);
									}
								}
							}
							c.expr = exprs.length == 1 ? exprs[0] : exprs.length == 0 ? hscript_Expr.EBlock([]) : hscript_Expr.EBlock(exprs);
							break;
						case "default":
							if(def != null) {
								this.unexpected(tk);
							}
							var t = this.token();
							if(t != hscript_Token.TDoubleDot) {
								this.unexpected(t);
							}
							var exprs1 = [];
							_hx_loop5: while(true) {
								tk = this.token();
								var _this1 = this.tokens;
								_this1.head = new haxe_ds_GenericCell(tk,_this1.head);
								if(tk == null) {
									this.parseFullExpr(exprs1);
								} else {
									switch(tk._hx_index) {
									case 0:
										if(this.resumeErrors) {
											break _hx_loop5;
										} else {
											this.parseFullExpr(exprs1);
										}
										break;
									case 2:
										switch(tk.s) {
										case "case":case "default":
											break _hx_loop5;
										default:
											this.parseFullExpr(exprs1);
										}
										break;
									case 7:
										break _hx_loop5;
									default:
										this.parseFullExpr(exprs1);
									}
								}
							}
							def = exprs1.length == 1 ? exprs1[0] : exprs1.length == 0 ? hscript_Expr.EBlock([]) : hscript_Expr.EBlock(exprs1);
							break;
						default:
							this.unexpected(tk);
							break _hx_loop2;
						}
						break;
					case 7:
						break _hx_loop2;
					default:
						this.unexpected(tk);
						break _hx_loop2;
					}
				}
			}
			return hscript_Expr.ESwitch(e,cases,def);
		case "throw":
			var e = this.parseExpr();
			return hscript_Expr.EThrow(e);
		case "try":
			var e = this.parseExpr();
			var t = this.token();
			if(!Type.enumEq(t,hscript_Token.TId("catch"))) {
				this.unexpected(t);
			}
			var t = this.token();
			if(t != hscript_Token.TPOpen) {
				this.unexpected(t);
			}
			var vname = this.getIdent();
			var t = this.token();
			if(t != hscript_Token.TDoubleDot) {
				this.unexpected(t);
			}
			var t = null;
			if(this.allowTypes) {
				t = this.parseType();
			} else {
				var t1 = this.token();
				if(!Type.enumEq(t1,hscript_Token.TId("Dynamic"))) {
					this.unexpected(t1);
				}
			}
			var t1 = this.token();
			if(t1 != hscript_Token.TPClose) {
				this.unexpected(t1);
			}
			var ec = this.parseExpr();
			return hscript_Expr.ETry(e,vname,t,ec);
		case "while":
			var econd = this.parseExpr();
			var e = this.parseExpr();
			return hscript_Expr.EWhile(econd,e);
		default:
			return null;
		}
	}
	,parseExprNext: function(e1) {
		var tk = this.token();
		if(tk == null) {
			var _this = this.tokens;
			_this.head = new haxe_ds_GenericCell(tk,_this.head);
			return e1;
		} else {
			switch(tk._hx_index) {
			case 2:
				var op = tk.s;
				if(Object.prototype.hasOwnProperty.call(this.opPriority.h,op)) {
					return this.parseExprNext(this.makeBinop(op,e1,this.parseExpr()));
				} else {
					var _this = this.tokens;
					_this.head = new haxe_ds_GenericCell(tk,_this.head);
					return e1;
				}
				break;
			case 3:
				var op = tk.s;
				if(op == "->") {
					switch(e1._hx_index) {
					case 1:
						var i = e1.v;
						var eret = this.parseExpr();
						return this.mkLambda([{ name : i}],eret,0);
					case 3:
						var _hx_tmp = e1.e;
						if(_hx_tmp._hx_index == 1) {
							var i = _hx_tmp.v;
							var eret = this.parseExpr();
							return this.mkLambda([{ name : i}],eret,0);
						}
						break;
					case 26:
						var _hx_tmp = e1.e;
						if(_hx_tmp._hx_index == 1) {
							var i = _hx_tmp.v;
							var t = e1.t;
							var eret = this.parseExpr();
							return this.mkLambda([{ name : i, t : t}],eret,0);
						}
						break;
					default:
					}
					this.unexpected(tk);
				}
				if(this.opPriority.h[op] == -1) {
					var tmp;
					if(!this.isBlock(e1)) {
						if(e1._hx_index == 3) {
							var _g = e1.e;
							tmp = true;
						} else {
							tmp = false;
						}
					} else {
						tmp = true;
					}
					if(tmp) {
						var _this = this.tokens;
						_this.head = new haxe_ds_GenericCell(tk,_this.head);
						return e1;
					}
					return this.parseExprNext(hscript_Expr.EUnop(op,false,e1));
				}
				return this.makeBinop(op,e1,this.parseExpr());
			case 4:
				return this.parseExprNext(hscript_Expr.ECall(e1,this.parseExprList(hscript_Token.TPClose)));
			case 8:
				var field = this.getIdent();
				return this.parseExprNext(hscript_Expr.EField(e1,field));
			case 9:
				var field = this.getIdent();
				var tmp = "__a_" + this.uid++;
				var e = hscript_Expr.EBlock([hscript_Expr.EVar(tmp,null,e1),hscript_Expr.ETernary(hscript_Expr.EBinop("==",hscript_Expr.EIdent(tmp),hscript_Expr.EIdent("null")),hscript_Expr.EIdent("null"),hscript_Expr.EField(hscript_Expr.EIdent(tmp),field))]);
				return this.parseExprNext(e);
			case 12:
				var e2 = this.parseExpr();
				var t = this.token();
				if(t != hscript_Token.TBkClose) {
					this.unexpected(t);
				}
				return this.parseExprNext(hscript_Expr.EArray(e1,e2));
			case 14:
				var e2 = this.parseExpr();
				var t = this.token();
				if(t != hscript_Token.TDoubleDot) {
					this.unexpected(t);
				}
				var e3 = this.parseExpr();
				return hscript_Expr.ETernary(e1,e2,e3);
			default:
				var _this = this.tokens;
				_this.head = new haxe_ds_GenericCell(tk,_this.head);
				return e1;
			}
		}
	}
	,parseFunctionArgs: function() {
		var args = [];
		var tk = this.token();
		if(tk != hscript_Token.TPClose) {
			var done = false;
			while(!done) {
				var name = null;
				var opt = false;
				if(tk != null) {
					if(tk._hx_index == 14) {
						opt = true;
						tk = this.token();
					}
				}
				if(tk == null) {
					this.unexpected(tk);
					break;
				} else if(tk._hx_index == 2) {
					var id = tk.s;
					name = id;
				} else {
					this.unexpected(tk);
					break;
				}
				var arg = { name : name};
				args.push(arg);
				if(opt) {
					arg.opt = true;
				}
				if(this.allowTypes) {
					if(this.maybe(hscript_Token.TDoubleDot)) {
						arg.t = this.parseType();
					}
					if(this.maybe(hscript_Token.TOp("="))) {
						arg.value = this.parseExpr();
					}
				}
				tk = this.token();
				if(tk == null) {
					this.unexpected(tk);
				} else {
					switch(tk._hx_index) {
					case 5:
						done = true;
						break;
					case 10:
						tk = this.token();
						break;
					default:
						this.unexpected(tk);
					}
				}
			}
		}
		return args;
	}
	,parseFunctionDecl: function() {
		var t = this.token();
		if(t != hscript_Token.TPOpen) {
			this.unexpected(t);
		}
		var args = this.parseFunctionArgs();
		var ret = null;
		if(this.allowTypes) {
			var tk = this.token();
			if(tk != hscript_Token.TDoubleDot) {
				var _this = this.tokens;
				_this.head = new haxe_ds_GenericCell(tk,_this.head);
			} else {
				ret = this.parseType();
			}
		}
		return { args : args, ret : ret, body : this.parseExpr()};
	}
	,parsePath: function() {
		var path = [this.getIdent()];
		while(true) {
			var t = this.token();
			if(t != hscript_Token.TDot) {
				var _this = this.tokens;
				_this.head = new haxe_ds_GenericCell(t,_this.head);
				break;
			}
			path.push(this.getIdent());
		}
		return path;
	}
	,parseType: function() {
		var _gthis = this;
		var t = this.token();
		if(t == null) {
			return this.unexpected(t);
		} else {
			switch(t._hx_index) {
			case 2:
				var v = t.s;
				var _this = this.tokens;
				_this.head = new haxe_ds_GenericCell(t,_this.head);
				var path = this.parsePath();
				var params = null;
				t = this.token();
				if(t == null) {
					var _this = this.tokens;
					_this.head = new haxe_ds_GenericCell(t,_this.head);
				} else if(t._hx_index == 3) {
					var op = t.s;
					if(op == "<") {
						params = [];
						_hx_loop1: while(true) {
							var _g = this.token();
							if(_g == null) {
								var tk = _g;
								var _this = this.tokens;
								_this.head = new haxe_ds_GenericCell(tk,_this.head);
								params.push(this.parseType());
							} else if(_g._hx_index == 1) {
								var c = _g.c;
								params.push(hscript_CType.CTExpr(hscript_Expr.EConst(c)));
							} else {
								var tk1 = _g;
								var _this1 = this.tokens;
								_this1.head = new haxe_ds_GenericCell(tk1,_this1.head);
								params.push(this.parseType());
							}
							t = this.token();
							if(t != null) {
								switch(t._hx_index) {
								case 3:
									var op = t.s;
									if(op == ">") {
										break _hx_loop1;
									}
									if(HxOverrides.cca(op,0) == 62) {
										var _this2 = this.tokens;
										_this2.head = new haxe_ds_GenericCell(hscript_Token.TOp(HxOverrides.substr(op,1,null)),_this2.head);
										break _hx_loop1;
									}
									break;
								case 10:
									continue;
								default:
								}
							}
							this.unexpected(t);
							break;
						}
					} else {
						var _this = this.tokens;
						_this.head = new haxe_ds_GenericCell(t,_this.head);
					}
				} else {
					var _this = this.tokens;
					_this.head = new haxe_ds_GenericCell(t,_this.head);
				}
				return this.parseTypeNext(hscript_CType.CTPath(path,params));
			case 4:
				var a = this.token();
				var b = this.token();
				var _this = this.tokens;
				_this.head = new haxe_ds_GenericCell(b,_this.head);
				var _this = this.tokens;
				_this.head = new haxe_ds_GenericCell(a,_this.head);
				var withReturn = function(args) {
					var _g = _gthis.token();
					if(_g == null) {
						var t = _g;
						_gthis.unexpected(t);
					} else if(_g._hx_index == 3) {
						if(_g.s != "->") {
							var t = _g;
							_gthis.unexpected(t);
						}
					} else {
						var t = _g;
						_gthis.unexpected(t);
					}
					return hscript_CType.CTFun(args,_gthis.parseType());
				};
				if(a == null) {
					var t1 = this.parseType();
					var _g = this.token();
					if(_g == null) {
						var t2 = _g;
						return this.unexpected(t2);
					} else {
						switch(_g._hx_index) {
						case 5:
							return this.parseTypeNext(hscript_CType.CTParent(t1));
						case 10:
							var args = [t1];
							do args.push(this.parseType()); while(this.maybe(hscript_Token.TComma));
							var t1 = this.token();
							if(t1 != hscript_Token.TPClose) {
								this.unexpected(t1);
							}
							return withReturn(args);
						default:
							var t1 = _g;
							return this.unexpected(t1);
						}
					}
				} else {
					switch(a._hx_index) {
					case 2:
						var _g = a.s;
						if(b == null) {
							var t1 = this.parseType();
							var _g = this.token();
							if(_g == null) {
								var t2 = _g;
								return this.unexpected(t2);
							} else {
								switch(_g._hx_index) {
								case 5:
									return this.parseTypeNext(hscript_CType.CTParent(t1));
								case 10:
									var args = [t1];
									do args.push(this.parseType()); while(this.maybe(hscript_Token.TComma));
									var t1 = this.token();
									if(t1 != hscript_Token.TPClose) {
										this.unexpected(t1);
									}
									return withReturn(args);
								default:
									var t1 = _g;
									return this.unexpected(t1);
								}
							}
						} else if(b._hx_index == 15) {
							var _g = [];
							var _g1 = 0;
							var _g2 = this.parseFunctionArgs();
							while(_g1 < _g2.length) {
								var arg = _g2[_g1];
								++_g1;
								var _g3 = arg.value;
								if(_g3 != null) {
									var v = _g3;
									if(!this.resumeErrors) {
										throw haxe_Exception.thrown(hscript_Error.ECustom("Default values not allowed in function types"));
									}
								}
								_g.push(hscript_CType.CTNamed(arg.name,arg.opt ? hscript_CType.CTOpt(arg.t) : arg.t));
							}
							var args = _g;
							return withReturn(args);
						} else {
							var t1 = this.parseType();
							var _g = this.token();
							if(_g == null) {
								var t2 = _g;
								return this.unexpected(t2);
							} else {
								switch(_g._hx_index) {
								case 5:
									return this.parseTypeNext(hscript_CType.CTParent(t1));
								case 10:
									var args = [t1];
									do args.push(this.parseType()); while(this.maybe(hscript_Token.TComma));
									var t1 = this.token();
									if(t1 != hscript_Token.TPClose) {
										this.unexpected(t1);
									}
									return withReturn(args);
								default:
									var t1 = _g;
									return this.unexpected(t1);
								}
							}
						}
						break;
					case 5:
						var _g = [];
						var _g1 = 0;
						var _g2 = this.parseFunctionArgs();
						while(_g1 < _g2.length) {
							var arg = _g2[_g1];
							++_g1;
							var _g3 = arg.value;
							if(_g3 != null) {
								var v = _g3;
								if(!this.resumeErrors) {
									throw haxe_Exception.thrown(hscript_Error.ECustom("Default values not allowed in function types"));
								}
							}
							_g.push(hscript_CType.CTNamed(arg.name,arg.opt ? hscript_CType.CTOpt(arg.t) : arg.t));
						}
						var args = _g;
						return withReturn(args);
					default:
						var t1 = this.parseType();
						var _g = this.token();
						if(_g == null) {
							var t2 = _g;
							return this.unexpected(t2);
						} else {
							switch(_g._hx_index) {
							case 5:
								return this.parseTypeNext(hscript_CType.CTParent(t1));
							case 10:
								var args = [t1];
								do args.push(this.parseType()); while(this.maybe(hscript_Token.TComma));
								var t1 = this.token();
								if(t1 != hscript_Token.TPClose) {
									this.unexpected(t1);
								}
								return withReturn(args);
							default:
								var t1 = _g;
								return this.unexpected(t1);
							}
						}
					}
				}
				break;
			case 6:
				var fields = [];
				var meta = null;
				_hx_loop8: while(true) {
					t = this.token();
					if(t == null) {
						this.unexpected(t);
						break;
					} else {
						switch(t._hx_index) {
						case 2:
							var _g = t.s;
							switch(_g) {
							case "final":case "var":
								var name = this.getIdent();
								var t1 = this.token();
								if(t1 != hscript_Token.TDoubleDot) {
									this.unexpected(t1);
								}
								if(t == null ? false : t._hx_index == 2 && t.s == "final") {
									if(meta == null) {
										meta = [];
									}
									meta.push({ name : ":final", params : []});
								}
								fields.push({ name : name, t : this.parseType(), meta : meta});
								meta = null;
								var t2 = this.token();
								if(t2 != hscript_Token.TSemicolon) {
									this.unexpected(t2);
								}
								break;
							default:
								var name1 = _g;
								var t3 = this.token();
								if(t3 != hscript_Token.TDoubleDot) {
									this.unexpected(t3);
								}
								fields.push({ name : name1, t : this.parseType(), meta : meta});
								t = this.token();
								if(t == null) {
									this.unexpected(t);
								} else {
									switch(t._hx_index) {
									case 7:
										break _hx_loop8;
									case 10:
										break;
									default:
										this.unexpected(t);
									}
								}
							}
							break;
						case 7:
							break _hx_loop8;
						case 16:
							var name2 = t.s;
							if(meta == null) {
								meta = [];
							}
							meta.push({ name : name2, params : this.parseMetaArgs()});
							break;
						default:
							this.unexpected(t);
							break _hx_loop8;
						}
					}
				}
				return this.parseTypeNext(hscript_CType.CTAnon(fields));
			default:
				return this.unexpected(t);
			}
		}
	}
	,parseTypeNext: function(t) {
		var tk = this.token();
		if(tk == null) {
			var _this = this.tokens;
			_this.head = new haxe_ds_GenericCell(tk,_this.head);
			return t;
		} else if(tk._hx_index == 3) {
			var op = tk.s;
			if(op != "->") {
				var _this = this.tokens;
				_this.head = new haxe_ds_GenericCell(tk,_this.head);
				return t;
			}
		} else {
			var _this = this.tokens;
			_this.head = new haxe_ds_GenericCell(tk,_this.head);
			return t;
		}
		var t2 = this.parseType();
		if(t2._hx_index == 1) {
			var _g = t2.ret;
			var args = t2.args;
			args.unshift(t);
			return t2;
		} else {
			return hscript_CType.CTFun([t],t2);
		}
	}
	,parseExprList: function(etk) {
		var args = [];
		var tk = this.token();
		if(tk == etk) {
			return args;
		}
		var _this = this.tokens;
		_this.head = new haxe_ds_GenericCell(tk,_this.head);
		while(true) {
			args.push(this.parseExpr());
			tk = this.token();
			if(tk == null) {
				if(tk == etk) {
					break;
				}
				this.unexpected(tk);
				break;
			} else if(tk._hx_index != 10) {
				if(tk == etk) {
					break;
				}
				this.unexpected(tk);
				break;
			}
		}
		return args;
	}
	,parseModule: function(content,origin,position) {
		if(position == null) {
			position = 0;
		}
		if(origin == null) {
			origin = "hscript";
		}
		this.initParser(origin,position);
		this.input = content;
		this.readPos = 0;
		this.allowTypes = true;
		this.allowMetadata = true;
		var decls = [];
		while(true) {
			var tk = this.token();
			if(tk == hscript_Token.TEof) {
				break;
			}
			var _this = this.tokens;
			_this.head = new haxe_ds_GenericCell(tk,_this.head);
			decls.push(this.parseModuleDecl());
		}
		return decls;
	}
	,parseMetadata: function() {
		var meta = [];
		while(true) {
			var tk = this.token();
			if(tk == null) {
				var _this = this.tokens;
				_this.head = new haxe_ds_GenericCell(tk,_this.head);
				break;
			} else if(tk._hx_index == 16) {
				var name = tk.s;
				meta.push({ name : name, params : this.parseMetaArgs()});
			} else {
				var _this1 = this.tokens;
				_this1.head = new haxe_ds_GenericCell(tk,_this1.head);
				break;
			}
		}
		return meta;
	}
	,parseParams: function() {
		if(this.maybe(hscript_Token.TOp("<"))) {
			if(!this.resumeErrors) {
				throw haxe_Exception.thrown(hscript_Error.EInvalidOp("Unsupported class type parameters"));
			}
		}
		return { };
	}
	,parseModuleDecl: function() {
		var meta = this.parseMetadata();
		var ident = this.getIdent();
		var isPrivate = false;
		var isExtern = false;
		_hx_loop1: while(true) {
			switch(ident) {
			case "extern":
				isExtern = true;
				break;
			case "private":
				isPrivate = true;
				break;
			default:
				break _hx_loop1;
			}
			ident = this.getIdent();
		}
		switch(ident) {
		case "class":
			var name = this.getIdent();
			var params = this.parseParams();
			var extend = null;
			var implement = [];
			_hx_loop2: while(true) {
				var t = this.token();
				if(t == null) {
					var _this = this.tokens;
					_this.head = new haxe_ds_GenericCell(t,_this.head);
					break;
				} else if(t._hx_index == 2) {
					switch(t.s) {
					case "extends":
						extend = this.parseType();
						break;
					case "implements":
						implement.push(this.parseType());
						break;
					default:
						var _this1 = this.tokens;
						_this1.head = new haxe_ds_GenericCell(t,_this1.head);
						break _hx_loop2;
					}
				} else {
					var _this2 = this.tokens;
					_this2.head = new haxe_ds_GenericCell(t,_this2.head);
					break;
				}
			}
			var fields = [];
			var t = this.token();
			if(t != hscript_Token.TBrOpen) {
				this.unexpected(t);
			}
			while(!this.maybe(hscript_Token.TBrClose)) fields.push(this.parseField());
			return hscript_ModuleDecl.DClass({ name : name, meta : meta, params : params, extend : extend, implement : implement, fields : fields, isPrivate : isPrivate, isExtern : isExtern});
		case "import":
			var path = [this.getIdent()];
			var star = false;
			while(true) {
				var t = this.token();
				if(t != hscript_Token.TDot) {
					var _this = this.tokens;
					_this.head = new haxe_ds_GenericCell(t,_this.head);
					break;
				}
				t = this.token();
				if(t == null) {
					this.unexpected(t);
				} else {
					switch(t._hx_index) {
					case 2:
						var id = t.s;
						path.push(id);
						break;
					case 3:
						if(t.s == "*") {
							star = true;
						} else {
							this.unexpected(t);
						}
						break;
					default:
						this.unexpected(t);
					}
				}
			}
			var name = null;
			if(this.maybe(hscript_Token.TId("as")) && !star) {
				var t = this.token();
				if(t == null) {
					this.unexpected(t);
				} else if(t._hx_index == 2) {
					var id = t.s;
					name = id;
				} else {
					this.unexpected(t);
				}
			}
			var t = this.token();
			if(t != hscript_Token.TSemicolon) {
				this.unexpected(t);
			}
			return hscript_ModuleDecl.DImport(path,star,name);
		case "package":
			var path = this.parsePath();
			var t = this.token();
			if(t != hscript_Token.TSemicolon) {
				this.unexpected(t);
			}
			return hscript_ModuleDecl.DPackage(path);
		case "typedef":
			var name = this.getIdent();
			var params = this.parseParams();
			var t = this.token();
			if(!Type.enumEq(t,hscript_Token.TOp("="))) {
				this.unexpected(t);
			}
			var t = this.parseType();
			return hscript_ModuleDecl.DTypedef({ name : name, meta : meta, params : params, isPrivate : isPrivate, t : t});
		default:
			this.unexpected(hscript_Token.TId(ident));
		}
		return null;
	}
	,parseField: function() {
		var meta = this.parseMetadata();
		var access = [];
		_hx_loop1: while(true) {
			var id = this.getIdent();
			switch(id) {
			case "final":case "var":
				var name = this.getIdent();
				var get = null;
				var set = null;
				if(this.maybe(hscript_Token.TPOpen)) {
					get = this.getIdent();
					var t = this.token();
					if(t != hscript_Token.TComma) {
						this.unexpected(t);
					}
					set = this.getIdent();
					var t1 = this.token();
					if(t1 != hscript_Token.TPClose) {
						this.unexpected(t1);
					}
				}
				var type = this.maybe(hscript_Token.TDoubleDot) ? this.parseType() : null;
				var expr = this.maybe(hscript_Token.TOp("=")) ? this.parseExpr() : null;
				if(expr != null) {
					if(this.isBlock(expr)) {
						this.maybe(hscript_Token.TSemicolon);
					} else {
						var t2 = this.token();
						if(t2 != hscript_Token.TSemicolon) {
							this.unexpected(t2);
						}
					}
				} else {
					var tmp;
					if(type != null) {
						if(type == null) {
							tmp = false;
						} else if(type._hx_index == 2) {
							var _g = type.fields;
							tmp = true;
						} else {
							tmp = false;
						}
					} else {
						tmp = false;
					}
					if(tmp) {
						this.maybe(hscript_Token.TSemicolon);
					} else {
						var t3 = this.token();
						if(t3 != hscript_Token.TSemicolon) {
							this.unexpected(t3);
						}
					}
				}
				return { name : name, meta : meta, access : access, kind : hscript_FieldKind.KVar({ get : get, set : set, type : type, expr : expr})};
			case "function":
				var name1 = this.getIdent();
				var inf = this.parseFunctionDecl();
				return { name : name1, meta : meta, access : access, kind : hscript_FieldKind.KFunction({ args : inf.args, expr : inf.body, ret : inf.ret})};
			case "inline":
				access.push(hscript_FieldAccess.AInline);
				break;
			case "macro":
				access.push(hscript_FieldAccess.AMacro);
				break;
			case "override":
				access.push(hscript_FieldAccess.AOverride);
				break;
			case "private":
				access.push(hscript_FieldAccess.APrivate);
				break;
			case "public":
				access.push(hscript_FieldAccess.APublic);
				break;
			case "static":
				access.push(hscript_FieldAccess.AStatic);
				break;
			default:
				this.unexpected(hscript_Token.TId(id));
				break _hx_loop1;
			}
		}
		return null;
	}
	,readChar: function() {
		return this.input.charCodeAt(this.readPos++);
	}
	,readString: function(until) {
		var c = 0;
		var b_b = "";
		var esc = false;
		var old = this.line;
		var s = this.input;
		while(true) {
			var c = this.input.charCodeAt(this.readPos++);
			if(c != c) {
				this.line = old;
				if(!this.resumeErrors) {
					throw haxe_Exception.thrown(hscript_Error.EUnterminatedString);
				}
				break;
			}
			if(esc) {
				esc = false;
				switch(c) {
				case 47:
					if(this.allowJSON) {
						b_b += String.fromCodePoint(c);
					} else {
						this.invalidChar(c);
					}
					break;
				case 34:case 39:case 92:
					b_b += String.fromCodePoint(c);
					break;
				case 110:
					b_b += String.fromCodePoint(10);
					break;
				case 114:
					b_b += String.fromCodePoint(13);
					break;
				case 116:
					b_b += String.fromCodePoint(9);
					break;
				case 117:
					if(!this.allowJSON) {
						this.invalidChar(c);
					}
					var k = 0;
					var _g = 0;
					while(_g < 4) {
						var i = _g++;
						k <<= 4;
						var char = this.input.charCodeAt(this.readPos++);
						switch(char) {
						case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:
							k += char - 48;
							break;
						case 65:case 66:case 67:case 68:case 69:case 70:
							k += char - 55;
							break;
						case 97:case 98:case 99:case 100:case 101:case 102:
							k += char - 87;
							break;
						default:
							if(char != char) {
								this.line = old;
								if(!this.resumeErrors) {
									throw haxe_Exception.thrown(hscript_Error.EUnterminatedString);
								}
							}
							this.invalidChar(char);
						}
					}
					b_b += String.fromCodePoint(k);
					break;
				default:
					this.invalidChar(c);
				}
			} else if(c == 92) {
				esc = true;
			} else if(c == until) {
				break;
			} else {
				if(c == 10) {
					this.line++;
				}
				b_b += String.fromCodePoint(c);
			}
		}
		return b_b;
	}
	,token: function() {
		if(this.tokens.head != null) {
			var _this = this.tokens;
			var k = _this.head;
			if(k == null) {
				return null;
			} else {
				_this.head = k.next;
				return k.elt;
			}
		}
		var char;
		if(this.char < 0) {
			char = this.input.charCodeAt(this.readPos++);
		} else {
			char = this.char;
			this.char = -1;
		}
		while(true) {
			if(char != char) {
				this.char = char;
				return hscript_Token.TEof;
			}
			switch(char) {
			case 0:
				return hscript_Token.TEof;
			case 10:
				this.line++;
				break;
			case 9:case 13:case 32:
				break;
			case 34:case 39:
				return hscript_Token.TConst(hscript_Const.CString(this.readString(char)));
			case 35:
				char = this.input.charCodeAt(this.readPos++);
				if(this.idents[char]) {
					var id = String.fromCodePoint(char);
					while(true) {
						char = this.input.charCodeAt(this.readPos++);
						if(!this.idents[char]) {
							this.char = char;
							return this.preprocess(id);
						}
						id += String.fromCodePoint(char);
					}
				}
				this.invalidChar(char);
				break;
			case 40:
				return hscript_Token.TPOpen;
			case 41:
				return hscript_Token.TPClose;
			case 44:
				return hscript_Token.TComma;
			case 46:
				char = this.input.charCodeAt(this.readPos++);
				switch(char) {
				case 46:
					char = this.input.charCodeAt(this.readPos++);
					if(char != 46) {
						this.invalidChar(char);
					}
					return hscript_Token.TOp("...");
				case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:
					var n = char - 48;
					var exp = 1;
					while(true) {
						char = this.input.charCodeAt(this.readPos++);
						exp *= 10;
						switch(char) {
						case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:
							n = n * 10 + (char - 48);
							break;
						default:
							this.char = char;
							return hscript_Token.TConst(hscript_Const.CFloat(n / exp));
						}
					}
					break;
				default:
					this.char = char;
					return hscript_Token.TDot;
				}
				break;
			case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:
				var n1 = (char - 48) * 1.0;
				var exp1 = 0.;
				while(true) {
					char = this.input.charCodeAt(this.readPos++);
					exp1 *= 10;
					switch(char) {
					case 46:
						if(exp1 > 0) {
							if(exp1 == 10 && this.input.charCodeAt(this.readPos++) == 46) {
								var _this = this.tokens;
								_this.head = new haxe_ds_GenericCell(hscript_Token.TOp("..."),_this.head);
								var i = n1 | 0;
								return hscript_Token.TConst(i == n1 ? hscript_Const.CInt(i) : hscript_Const.CFloat(n1));
							}
							this.invalidChar(char);
						}
						exp1 = 1.;
						break;
					case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:
						n1 = n1 * 10 + (char - 48);
						break;
					case 69:case 101:
						var tk = this.token();
						var pow = null;
						if(tk == null) {
							var _this1 = this.tokens;
							_this1.head = new haxe_ds_GenericCell(tk,_this1.head);
						} else {
							switch(tk._hx_index) {
							case 1:
								var _g = tk.c;
								if(_g._hx_index == 0) {
									var e = _g.v;
									pow = e;
								} else {
									var _this2 = this.tokens;
									_this2.head = new haxe_ds_GenericCell(tk,_this2.head);
								}
								break;
							case 3:
								if(tk.s == "-") {
									tk = this.token();
									if(tk == null) {
										var _this3 = this.tokens;
										_this3.head = new haxe_ds_GenericCell(tk,_this3.head);
									} else if(tk._hx_index == 1) {
										var _g1 = tk.c;
										if(_g1._hx_index == 0) {
											var e1 = _g1.v;
											pow = -e1;
										} else {
											var _this4 = this.tokens;
											_this4.head = new haxe_ds_GenericCell(tk,_this4.head);
										}
									} else {
										var _this5 = this.tokens;
										_this5.head = new haxe_ds_GenericCell(tk,_this5.head);
									}
								} else {
									var _this6 = this.tokens;
									_this6.head = new haxe_ds_GenericCell(tk,_this6.head);
								}
								break;
							default:
								var _this7 = this.tokens;
								_this7.head = new haxe_ds_GenericCell(tk,_this7.head);
							}
						}
						if(pow == null) {
							this.invalidChar(char);
						}
						if(exp1 == 0) {
							exp1 = 10;
						}
						return hscript_Token.TConst(hscript_Const.CFloat(Math.pow(10,pow) / exp1 * n1 * 10));
					case 120:
						if(n1 > 0 || exp1 > 0) {
							this.invalidChar(char);
						}
						var n2 = 0;
						while(true) {
							char = this.input.charCodeAt(this.readPos++);
							switch(char) {
							case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:
								n2 = (n2 << 4) + char - 48;
								break;
							case 65:case 66:case 67:case 68:case 69:case 70:
								n2 = (n2 << 4) + (char - 55);
								break;
							case 97:case 98:case 99:case 100:case 101:case 102:
								n2 = (n2 << 4) + (char - 87);
								break;
							default:
								this.char = char;
								return hscript_Token.TConst(hscript_Const.CInt(n2));
							}
						}
						break;
					default:
						this.char = char;
						var i1 = n1 | 0;
						return hscript_Token.TConst(exp1 > 0 ? hscript_Const.CFloat(n1 * 10 / exp1) : i1 == n1 ? hscript_Const.CInt(i1) : hscript_Const.CFloat(n1));
					}
				}
				break;
			case 58:
				return hscript_Token.TDoubleDot;
			case 59:
				return hscript_Token.TSemicolon;
			case 61:
				char = this.input.charCodeAt(this.readPos++);
				if(char == 61) {
					return hscript_Token.TOp("==");
				} else if(char == 62) {
					return hscript_Token.TOp("=>");
				}
				this.char = char;
				return hscript_Token.TOp("=");
			case 63:
				char = this.input.charCodeAt(this.readPos++);
				if(char == 46) {
					return hscript_Token.TQuestionDot;
				}
				this.char = char;
				return hscript_Token.TQuestion;
			case 64:
				char = this.input.charCodeAt(this.readPos++);
				if(this.idents[char] || char == 58) {
					var id1 = String.fromCodePoint(char);
					while(true) {
						char = this.input.charCodeAt(this.readPos++);
						if(!this.idents[char]) {
							this.char = char;
							return hscript_Token.TMeta(id1);
						}
						id1 += String.fromCodePoint(char);
					}
				}
				this.invalidChar(char);
				break;
			case 91:
				return hscript_Token.TBkOpen;
			case 93:
				return hscript_Token.TBkClose;
			case 123:
				return hscript_Token.TBrOpen;
			case 125:
				return hscript_Token.TBrClose;
			default:
				if(this.ops[char]) {
					var op = String.fromCodePoint(char);
					while(true) {
						char = this.input.charCodeAt(this.readPos++);
						if(char != char) {
							char = 0;
						}
						if(!this.ops[char]) {
							this.char = char;
							return hscript_Token.TOp(op);
						}
						var pop = op;
						op += String.fromCodePoint(char);
						if(!Object.prototype.hasOwnProperty.call(this.opPriority.h,op) && Object.prototype.hasOwnProperty.call(this.opPriority.h,pop)) {
							if(op == "//" || op == "/*") {
								return this.tokenComment(op,char);
							}
							this.char = char;
							return hscript_Token.TOp(pop);
						}
					}
				}
				if(this.idents[char]) {
					var id2 = String.fromCodePoint(char);
					while(true) {
						char = this.input.charCodeAt(this.readPos++);
						if(char != char) {
							char = 0;
						}
						if(!this.idents[char]) {
							this.char = char;
							return hscript_Token.TId(id2);
						}
						id2 += String.fromCodePoint(char);
					}
				}
				this.invalidChar(char);
			}
			char = this.input.charCodeAt(this.readPos++);
		}
	}
	,preprocValue: function(id) {
		return this.preprocesorValues.h[id];
	}
	,preprocStack: null
	,parsePreproCond: function() {
		var tk = this.token();
		if(tk == null) {
			return this.unexpected(tk);
		} else {
			switch(tk._hx_index) {
			case 2:
				var id = tk.s;
				return hscript_Expr.EIdent(id);
			case 3:
				if(tk.s == "!") {
					return hscript_Expr.EUnop("!",true,this.parsePreproCond());
				} else {
					return this.unexpected(tk);
				}
				break;
			case 4:
				var _this = this.tokens;
				_this.head = new haxe_ds_GenericCell(hscript_Token.TPOpen,_this.head);
				return this.parseExpr();
			default:
				return this.unexpected(tk);
			}
		}
	}
	,evalPreproCond: function(e) {
		switch(e._hx_index) {
		case 1:
			var id = e.v;
			return this.preprocValue(id) != null;
		case 3:
			var e1 = e.e;
			return this.evalPreproCond(e1);
		case 6:
			var _g = e.e1;
			var _g1 = e.e2;
			switch(e.op) {
			case "&&":
				var e1 = _g;
				var e2 = _g1;
				if(this.evalPreproCond(e1)) {
					return this.evalPreproCond(e2);
				} else {
					return false;
				}
				break;
			case "||":
				var e1 = _g;
				var e2 = _g1;
				if(!this.evalPreproCond(e1)) {
					return this.evalPreproCond(e2);
				} else {
					return true;
				}
				break;
			default:
				if(!this.resumeErrors) {
					throw haxe_Exception.thrown(hscript_Error.EInvalidPreprocessor("Can't eval " + $hxEnums[e.__enum__].__constructs__[e._hx_index]._hx_name));
				}
				return false;
			}
			break;
		case 7:
			var _g = e.prefix;
			if(e.op == "!") {
				var e1 = e.e;
				return !this.evalPreproCond(e1);
			} else {
				if(!this.resumeErrors) {
					throw haxe_Exception.thrown(hscript_Error.EInvalidPreprocessor("Can't eval " + $hxEnums[e.__enum__].__constructs__[e._hx_index]._hx_name));
				}
				return false;
			}
			break;
		default:
			if(!this.resumeErrors) {
				throw haxe_Exception.thrown(hscript_Error.EInvalidPreprocessor("Can't eval " + $hxEnums[e.__enum__].__constructs__[e._hx_index]._hx_name));
			}
			return false;
		}
	}
	,preprocess: function(id) {
		switch(id) {
		case "else":case "elseif":
			if(this.preprocStack.length > 0) {
				if(this.preprocStack[this.preprocStack.length - 1].r) {
					this.preprocStack[this.preprocStack.length - 1].r = false;
					this.skipTokens();
					return this.token();
				} else if(id == "else") {
					this.preprocStack.pop();
					this.preprocStack.push({ r : true});
					return this.token();
				} else {
					this.preprocStack.pop();
					return this.preprocess("if");
				}
			} else {
				return hscript_Token.TPrepro(id);
			}
			break;
		case "end":
			if(this.preprocStack.length > 0) {
				this.preprocStack.pop();
				return this.token();
			} else {
				return hscript_Token.TPrepro(id);
			}
			break;
		case "if":
			var e = this.parsePreproCond();
			if(this.evalPreproCond(e)) {
				this.preprocStack.push({ r : true});
				return this.token();
			}
			this.preprocStack.push({ r : false});
			this.skipTokens();
			return this.token();
		default:
			return hscript_Token.TPrepro(id);
		}
	}
	,skipTokens: function() {
		var spos = this.preprocStack.length - 1;
		var obj = this.preprocStack[spos];
		var pos = this.readPos + this.offset;
		while(true) {
			var tk = this.token();
			if(tk == hscript_Token.TEof) {
				if(!this.resumeErrors) {
					throw haxe_Exception.thrown(hscript_Error.EInvalidPreprocessor("Unclosed"));
				}
			}
			if(this.preprocStack[spos] != obj) {
				var _this = this.tokens;
				_this.head = new haxe_ds_GenericCell(tk,_this.head);
				break;
			}
		}
	}
	,tokenComment: function(op,char) {
		var c = HxOverrides.cca(op,1);
		var s = this.input;
		if(c == 47) {
			while(char != 13 && char != 10) {
				char = this.input.charCodeAt(this.readPos++);
				if(char != char) {
					break;
				}
			}
			this.char = char;
			return this.token();
		}
		if(c == 42) {
			var old = this.line;
			if(op == "/**/") {
				this.char = char;
				return this.token();
			}
			do {
				while(char != 42) {
					if(char == 10) {
						this.line++;
					}
					char = this.input.charCodeAt(this.readPos++);
					if(char != char) {
						this.line = old;
						if(!this.resumeErrors) {
							throw haxe_Exception.thrown(hscript_Error.EUnterminatedComment);
						}
						break;
					}
				}
				char = this.input.charCodeAt(this.readPos++);
				if(char != char) {
					this.line = old;
					if(!this.resumeErrors) {
						throw haxe_Exception.thrown(hscript_Error.EUnterminatedComment);
					}
					break;
				}
			} while(char != 47);
			return this.token();
		}
		this.char = char;
		return hscript_Token.TOp(op);
	}
	,constString: function(c) {
		switch(c._hx_index) {
		case 0:
			var v = c.v;
			if(v == null) {
				return "null";
			} else {
				return "" + v;
			}
			break;
		case 1:
			var f = c.f;
			if(f == null) {
				return "null";
			} else {
				return "" + f;
			}
			break;
		case 2:
			var s = c.s;
			return s;
		}
	}
	,tokenString: function(t) {
		switch(t._hx_index) {
		case 0:
			return "<eof>";
		case 1:
			var c = t.c;
			return this.constString(c);
		case 2:
			var s = t.s;
			return s;
		case 3:
			var s = t.s;
			return s;
		case 4:
			return "(";
		case 5:
			return ")";
		case 6:
			return "{";
		case 7:
			return "}";
		case 8:
			return ".";
		case 9:
			return "?.";
		case 10:
			return ",";
		case 11:
			return ";";
		case 12:
			return "[";
		case 13:
			return "]";
		case 14:
			return "?";
		case 15:
			return ":";
		case 16:
			var id = t.s;
			return "@" + id;
		case 17:
			var id = t.s;
			return "#" + id;
		}
	}
	,__class__: hscript_Parser
	,__properties__: {get_currentPos:"get_currentPos"}
};
var hscript_Tools = function() { };
$hxClasses["hscript.Tools"] = hscript_Tools;
hscript_Tools.__name__ = "hscript.Tools";
hscript_Tools.iter = function(e,f) {
	switch(e._hx_index) {
	case 0:
		var _g = e.c;
		break;
	case 1:
		var _g = e.v;
		break;
	case 2:
		var _g = e.n;
		var _g = e.t;
		var e1 = e.e;
		if(e1 != null) {
			f(e1);
		}
		break;
	case 3:
		var e1 = e.e;
		f(e1);
		break;
	case 4:
		var el = e.e;
		var _g = 0;
		while(_g < el.length) {
			var e1 = el[_g];
			++_g;
			f(e1);
		}
		break;
	case 5:
		var _g = e.f;
		var e1 = e.e;
		f(e1);
		break;
	case 6:
		var _g = e.op;
		var e1 = e.e1;
		var e2 = e.e2;
		f(e1);
		f(e2);
		break;
	case 7:
		var _g = e.op;
		var _g = e.prefix;
		var e1 = e.e;
		f(e1);
		break;
	case 8:
		var e1 = e.e;
		var args = e.params;
		f(e1);
		var _g = 0;
		while(_g < args.length) {
			var a = args[_g];
			++_g;
			f(a);
		}
		break;
	case 9:
		var c = e.cond;
		var e1 = e.e1;
		var e2 = e.e2;
		f(c);
		f(e1);
		if(e2 != null) {
			f(e2);
		}
		break;
	case 10:
		var c = e.cond;
		var e1 = e.e;
		f(c);
		f(e1);
		break;
	case 11:
		var _g = e.v;
		var it = e.it;
		var e1 = e.e;
		f(it);
		f(e1);
		break;
	case 12:case 13:
		break;
	case 14:
		var _g = e.args;
		var _g = e.name;
		var _g = e.ret;
		var e1 = e.e;
		f(e1);
		break;
	case 15:
		var e1 = e.e;
		if(e1 != null) {
			f(e1);
		}
		break;
	case 16:
		var e1 = e.e;
		var i = e.index;
		f(e1);
		f(i);
		break;
	case 17:
		var el = e.e;
		var _g = 0;
		while(_g < el.length) {
			var e1 = el[_g];
			++_g;
			f(e1);
		}
		break;
	case 18:
		var _g = e.cl;
		var el = e.params;
		var _g = 0;
		while(_g < el.length) {
			var e1 = el[_g];
			++_g;
			f(e1);
		}
		break;
	case 19:
		var e1 = e.e;
		f(e1);
		break;
	case 20:
		var _g = e.v;
		var _g = e.t;
		var e1 = e.e;
		var c = e.ecatch;
		f(e1);
		f(c);
		break;
	case 21:
		var fl = e.fl;
		var _g = 0;
		while(_g < fl.length) {
			var fi = fl[_g];
			++_g;
			f(fi.e);
		}
		break;
	case 22:
		var c = e.cond;
		var e1 = e.e1;
		var e2 = e.e2;
		f(c);
		f(e1);
		f(e2);
		break;
	case 23:
		var e1 = e.e;
		var cases = e.cases;
		var def = e.defaultExpr;
		f(e1);
		var _g = 0;
		while(_g < cases.length) {
			var c = cases[_g];
			++_g;
			var _g1 = 0;
			var _g2 = c.values;
			while(_g1 < _g2.length) {
				var v = _g2[_g1];
				++_g1;
				f(v);
			}
			f(c.expr);
		}
		if(def != null) {
			f(def);
		}
		break;
	case 24:
		var c = e.cond;
		var e1 = e.e;
		f(c);
		f(e1);
		break;
	case 25:
		var name = e.name;
		var args = e.args;
		var e1 = e.e;
		if(args != null) {
			var _g = 0;
			while(_g < args.length) {
				var a = args[_g];
				++_g;
				f(a);
			}
		}
		f(e1);
		break;
	case 26:
		var _g = e.t;
		var e1 = e.e;
		f(e1);
		break;
	case 27:
		var it = e.it;
		var e1 = e.e;
		f(it);
		f(e1);
		break;
	case 28:
		var _g = e.t;
		var e1 = e.e;
		f(e1);
		break;
	}
};
hscript_Tools.map = function(e,f) {
	var edef;
	switch(e._hx_index) {
	case 0:
		var _g = e.c;
		edef = e;
		break;
	case 1:
		var _g = e.v;
		edef = e;
		break;
	case 2:
		var n = e.n;
		var t = e.t;
		var e1 = e.e;
		edef = hscript_Expr.EVar(n,t,e1 != null ? f(e1) : null);
		break;
	case 3:
		var e1 = e.e;
		edef = hscript_Expr.EParent(f(e1));
		break;
	case 4:
		var el = e.e;
		var _g = [];
		var _g1 = 0;
		while(_g1 < el.length) {
			var e1 = el[_g1];
			++_g1;
			_g.push(f(e1));
		}
		edef = hscript_Expr.EBlock(_g);
		break;
	case 5:
		var e1 = e.e;
		var fi = e.f;
		edef = hscript_Expr.EField(f(e1),fi);
		break;
	case 6:
		var op = e.op;
		var e1 = e.e1;
		var e2 = e.e2;
		edef = hscript_Expr.EBinop(op,f(e1),f(e2));
		break;
	case 7:
		var op = e.op;
		var pre = e.prefix;
		var e1 = e.e;
		edef = hscript_Expr.EUnop(op,pre,f(e1));
		break;
	case 8:
		var e1 = e.e;
		var args = e.params;
		var edef1 = f(e1);
		var _g = [];
		var _g1 = 0;
		while(_g1 < args.length) {
			var a = args[_g1];
			++_g1;
			_g.push(f(a));
		}
		edef = hscript_Expr.ECall(edef1,_g);
		break;
	case 9:
		var c = e.cond;
		var e1 = e.e1;
		var e2 = e.e2;
		edef = hscript_Expr.EIf(f(c),f(e1),e2 != null ? f(e2) : null);
		break;
	case 10:
		var c = e.cond;
		var e1 = e.e;
		edef = hscript_Expr.EWhile(f(c),f(e1));
		break;
	case 11:
		var v = e.v;
		var it = e.it;
		var e1 = e.e;
		edef = hscript_Expr.EFor(v,f(it),f(e1));
		break;
	case 12:case 13:
		edef = e;
		break;
	case 14:
		var args = e.args;
		var e1 = e.e;
		var name = e.name;
		var t = e.ret;
		edef = hscript_Expr.EFunction(args,f(e1),name,t);
		break;
	case 15:
		var e1 = e.e;
		edef = hscript_Expr.EReturn(e1 != null ? f(e1) : null);
		break;
	case 16:
		var e1 = e.e;
		var i = e.index;
		edef = hscript_Expr.EArray(f(e1),f(i));
		break;
	case 17:
		var el = e.e;
		var _g = [];
		var _g1 = 0;
		while(_g1 < el.length) {
			var e1 = el[_g1];
			++_g1;
			_g.push(f(e1));
		}
		edef = hscript_Expr.EArrayDecl(_g);
		break;
	case 18:
		var cl = e.cl;
		var el = e.params;
		var _g = [];
		var _g1 = 0;
		while(_g1 < el.length) {
			var e1 = el[_g1];
			++_g1;
			_g.push(f(e1));
		}
		edef = hscript_Expr.ENew(cl,_g);
		break;
	case 19:
		var e1 = e.e;
		edef = hscript_Expr.EThrow(f(e1));
		break;
	case 20:
		var e1 = e.e;
		var v = e.v;
		var t = e.t;
		var c = e.ecatch;
		edef = hscript_Expr.ETry(f(e1),v,t,f(c));
		break;
	case 21:
		var fl = e.fl;
		var _g = [];
		var _g1 = 0;
		while(_g1 < fl.length) {
			var fi = fl[_g1];
			++_g1;
			_g.push({ name : fi.name, e : f(fi.e)});
		}
		edef = hscript_Expr.EObject(_g);
		break;
	case 22:
		var c = e.cond;
		var e1 = e.e1;
		var e2 = e.e2;
		edef = hscript_Expr.ETernary(f(c),f(e1),f(e2));
		break;
	case 23:
		var e1 = e.e;
		var cases = e.cases;
		var def = e.defaultExpr;
		var edef1 = f(e1);
		var _g = [];
		var _g1 = 0;
		while(_g1 < cases.length) {
			var c = cases[_g1];
			++_g1;
			var _g2 = [];
			var _g3 = 0;
			var _g4 = c.values;
			while(_g3 < _g4.length) {
				var v = _g4[_g3];
				++_g3;
				_g2.push(f(v));
			}
			_g.push({ values : _g2, expr : f(c.expr)});
		}
		edef = hscript_Expr.ESwitch(edef1,_g,def == null ? null : f(def));
		break;
	case 24:
		var c = e.cond;
		var e1 = e.e;
		edef = hscript_Expr.EDoWhile(f(c),f(e1));
		break;
	case 25:
		var name = e.name;
		var args = e.args;
		var e1 = e.e;
		var edef1;
		if(args == null) {
			edef1 = null;
		} else {
			var _g = [];
			var _g1 = 0;
			while(_g1 < args.length) {
				var a = args[_g1];
				++_g1;
				_g.push(f(a));
			}
			edef1 = _g;
		}
		edef = hscript_Expr.EMeta(name,edef1,f(e1));
		break;
	case 26:
		var e1 = e.e;
		var t = e.t;
		edef = hscript_Expr.ECheckType(f(e1),t);
		break;
	case 27:
		var it = e.it;
		var e1 = e.e;
		edef = hscript_Expr.EForGen(f(it),f(e1));
		break;
	case 28:
		var e1 = e.e;
		var t = e.t;
		edef = hscript_Expr.ECast(f(e1),t);
		break;
	}
	return edef;
};
hscript_Tools.expr = function(e) {
	return e;
};
hscript_Tools.mk = function(e,p) {
	return e;
};
hscript_Tools.getKeyIterator = function(e,callb) {
	var key = null;
	var value = null;
	var it = e;
	if(it._hx_index == 6) {
		if(it.op == "in") {
			var ekv = it.e1;
			var eiter = it.e2;
			if(ekv._hx_index == 6) {
				if(ekv.op == "=>") {
					var v1 = ekv.e1;
					var v2 = ekv.e2;
					if(v1._hx_index == 1) {
						if(v2._hx_index == 1) {
							var v21 = v2.v;
							var v11 = v1.v;
							key = v11;
							value = v21;
							it = eiter;
						}
					}
				}
			}
		}
	}
	return callb(key,value,it);
};
var js_Browser = function() { };
$hxClasses["js.Browser"] = js_Browser;
js_Browser.__name__ = "js.Browser";
js_Browser.__properties__ = {get_supported:"get_supported"};
js_Browser.get_supported = function() {
	if(typeof(window) != "undefined" && typeof(window.location) != "undefined") {
		return typeof(window.location.protocol) == "string";
	} else {
		return false;
	}
};
js_Browser.getLocalStorage = function() {
	try {
		var s = window.localStorage;
		s.getItem("");
		if(s.length == 0) {
			var key = "_hx_" + Math.random();
			s.setItem(key,key);
			s.removeItem(key);
		}
		return s;
	} catch( _g ) {
		haxe_NativeStackTrace.lastError = _g;
		return null;
	}
};
var js_html__$CanvasElement_CanvasUtil = function() { };
$hxClasses["js.html._CanvasElement.CanvasUtil"] = js_html__$CanvasElement_CanvasUtil;
js_html__$CanvasElement_CanvasUtil.__name__ = "js.html._CanvasElement.CanvasUtil";
js_html__$CanvasElement_CanvasUtil.getContextWebGL = function(canvas,attribs) {
	var name = "webgl";
	var ctx = canvas.getContext(name,attribs);
	if(ctx != null) {
		return ctx;
	}
	var name = "experimental-webgl";
	var ctx = canvas.getContext(name,attribs);
	if(ctx != null) {
		return ctx;
	}
	return null;
};
var js_lib__$ArrayBuffer_ArrayBufferCompat = function() { };
$hxClasses["js.lib._ArrayBuffer.ArrayBufferCompat"] = js_lib__$ArrayBuffer_ArrayBufferCompat;
js_lib__$ArrayBuffer_ArrayBufferCompat.__name__ = "js.lib._ArrayBuffer.ArrayBufferCompat";
js_lib__$ArrayBuffer_ArrayBufferCompat.sliceImpl = function(begin,end) {
	var u = new Uint8Array(this,begin,end == null ? null : end - begin);
	var resultArray = new Uint8Array(u.byteLength);
	resultArray.set(u);
	return resultArray.buffer;
};
var lime__$internal_backend_html5_GameDeviceData = function() {
	this.connected = true;
	this.buttons = [];
	this.axes = [];
};
$hxClasses["lime._internal.backend.html5.GameDeviceData"] = lime__$internal_backend_html5_GameDeviceData;
lime__$internal_backend_html5_GameDeviceData.__name__ = "lime._internal.backend.html5.GameDeviceData";
lime__$internal_backend_html5_GameDeviceData.prototype = {
	connected: null
	,id: null
	,isGamepad: null
	,buttons: null
	,axes: null
	,__class__: lime__$internal_backend_html5_GameDeviceData
};
var lime__$internal_backend_html5_HTML5AudioSource = function(parent) {
	this.parent = parent;
	this.id = -1;
	this.gain = 1;
	this.position = new lime_math_Vector4();
};
$hxClasses["lime._internal.backend.html5.HTML5AudioSource"] = lime__$internal_backend_html5_HTML5AudioSource;
lime__$internal_backend_html5_HTML5AudioSource.__name__ = "lime._internal.backend.html5.HTML5AudioSource";
lime__$internal_backend_html5_HTML5AudioSource.prototype = {
	completed: null
	,gain: null
	,id: null
	,length: null
	,loops: null
	,parent: null
	,playing: null
	,position: null
	,dispose: function() {
	}
	,init: function() {
		this.parent.buffer.get_src().pannerAttr({ coneInnerAngle : 360, coneOuterAngle : 360, coneOuterGain : 0, distanceModel : "inverse", maxDistance : 10000, refDistance : 1, rolloffFactor : 1, panningModel : "equalpower"});
	}
	,play: function() {
		if(this.playing || this.parent.buffer == null || this.parent.buffer.__srcHowl == null) {
			return;
		}
		this.playing = true;
		var time = this.getCurrentTime();
		this.completed = false;
		var cacheVolume = this.parent.buffer.__srcHowl._volume;
		this.parent.buffer.__srcHowl._volume = this.parent.get_gain();
		this.id = this.parent.buffer.__srcHowl.play();
		this.parent.buffer.__srcHowl._volume = cacheVolume;
		this.setPosition(this.parent.get_position());
		this.parent.buffer.__srcHowl.on("end",$bind(this,this.howl_onEnd),this.id);
		this.setCurrentTime(time);
	}
	,pause: function() {
		this.playing = false;
		if(this.parent.buffer != null && this.parent.buffer.__srcHowl != null) {
			this.parent.buffer.__srcHowl.pause(this.id);
		}
	}
	,stop: function() {
		this.playing = false;
		if(this.parent.buffer != null && this.parent.buffer.__srcHowl != null) {
			this.parent.buffer.__srcHowl.stop(this.id);
			this.parent.buffer.__srcHowl.off("end",$bind(this,this.howl_onEnd),this.id);
		}
	}
	,howl_onEnd: function() {
		this.playing = false;
		if(this.loops > 0) {
			this.loops--;
			this.stop();
			this.play();
			return;
		} else if(this.parent.buffer != null && this.parent.buffer.__srcHowl != null) {
			this.parent.buffer.__srcHowl.stop(this.id);
			this.parent.buffer.__srcHowl.off("end",$bind(this,this.howl_onEnd),this.id);
		}
		this.completed = true;
		this.parent.onComplete.dispatch();
	}
	,getCurrentTime: function() {
		if(this.id == -1) {
			return 0;
		}
		if(this.completed) {
			return this.getLength();
		} else if(this.parent.buffer != null && this.parent.buffer.__srcHowl != null) {
			var time = (this.parent.buffer.__srcHowl.seek(this.id) * 1000 | 0) - this.parent.offset;
			if(time < 0) {
				return 0;
			}
			return time;
		}
		return 0;
	}
	,setCurrentTime: function(value) {
		if(this.parent.buffer != null && this.parent.buffer.__srcHowl != null) {
			var pos = (value + this.parent.offset) / 1000;
			if(pos < 0) {
				pos = 0;
			}
			this.parent.buffer.__srcHowl.seek(pos,this.id);
		}
		return value;
	}
	,getGain: function() {
		return this.gain;
	}
	,setGain: function(value) {
		if(this.parent.buffer != null && this.parent.buffer.__srcHowl != null && this.id != -1) {
			this.parent.buffer.__srcHowl.volume(value,this.id);
		}
		return this.gain = value;
	}
	,getLength: function() {
		if(this.length != 0) {
			return this.length;
		}
		if(this.parent.buffer != null && this.parent.buffer.__srcHowl != null) {
			return this.parent.buffer.__srcHowl.duration() * 1000 | 0;
		}
		return 0;
	}
	,setLength: function(value) {
		return this.length = value;
	}
	,getLoops: function() {
		return this.loops;
	}
	,setLoops: function(value) {
		return this.loops = value;
	}
	,getPitch: function() {
		return this.parent.buffer.__srcHowl.rate();
	}
	,setPitch: function(value) {
		this.parent.buffer.__srcHowl.rate(value);
		return this.getPitch();
	}
	,getPosition: function() {
		return this.position;
	}
	,setPosition: function(value) {
		this.position.x = value.x;
		this.position.y = value.y;
		this.position.z = value.z;
		this.position.w = value.w;
		if(this.parent.buffer != null && this.parent.buffer.__srcHowl != null && this.parent.buffer.__srcHowl.pos != null) {
			this.parent.buffer.__srcHowl.pos(this.position.x,this.position.y,this.position.z,this.id);
		}
		return this.position;
	}
	,__class__: lime__$internal_backend_html5_HTML5AudioSource
};
var lime__$internal_backend_html5_HTML5HTTPRequest = function() {
	this.validStatus0 = new EReg("Tizen","gi").match(window.navigator.userAgent);
};
$hxClasses["lime._internal.backend.html5.HTML5HTTPRequest"] = lime__$internal_backend_html5_HTML5HTTPRequest;
lime__$internal_backend_html5_HTML5HTTPRequest.__name__ = "lime._internal.backend.html5.HTML5HTTPRequest";
lime__$internal_backend_html5_HTML5HTTPRequest.loadImage = function(uri) {
	var promise = new lime_app_Promise();
	if(lime__$internal_backend_html5_HTML5HTTPRequest.activeRequests < lime__$internal_backend_html5_HTML5HTTPRequest.requestLimit) {
		lime__$internal_backend_html5_HTML5HTTPRequest.activeRequests++;
		lime__$internal_backend_html5_HTML5HTTPRequest.__loadImage(uri,promise,0);
	} else {
		lime__$internal_backend_html5_HTML5HTTPRequest.requestQueue.add({ instance : null, uri : uri, promise : promise, type : "IMAGE", options : 0});
	}
	return promise.future;
};
lime__$internal_backend_html5_HTML5HTTPRequest.loadImageFromBytes = function(bytes,type) {
	var uri = URL.createObjectURL(new Blob([bytes.b.bufferValue],{ type : type}));
	if(uri != null) {
		var promise = new lime_app_Promise();
		if(lime__$internal_backend_html5_HTML5HTTPRequest.activeRequests < lime__$internal_backend_html5_HTML5HTTPRequest.requestLimit) {
			lime__$internal_backend_html5_HTML5HTTPRequest.activeRequests++;
			lime__$internal_backend_html5_HTML5HTTPRequest.__loadImage(uri,promise,1);
		} else {
			lime__$internal_backend_html5_HTML5HTTPRequest.requestQueue.add({ instance : null, uri : uri, promise : promise, type : "IMAGE", options : 1});
		}
		return promise.future;
	} else {
		return lime__$internal_backend_html5_HTML5HTTPRequest.loadImage("data:" + type + ";base64," + lime__$internal_format_Base64.encode(bytes));
	}
};
lime__$internal_backend_html5_HTML5HTTPRequest.processQueue = function() {
	if(lime__$internal_backend_html5_HTML5HTTPRequest.activeRequests < lime__$internal_backend_html5_HTML5HTTPRequest.requestLimit && lime__$internal_backend_html5_HTML5HTTPRequest.requestQueue.length > 0) {
		lime__$internal_backend_html5_HTML5HTTPRequest.activeRequests++;
		var queueItem = lime__$internal_backend_html5_HTML5HTTPRequest.requestQueue.pop();
		switch(queueItem.type) {
		case "BINARY":
			queueItem.instance.__loadData(queueItem.uri,queueItem.promise);
			break;
		case "IMAGE":
			lime__$internal_backend_html5_HTML5HTTPRequest.__loadImage(queueItem.uri,queueItem.promise,queueItem.options);
			break;
		case "TEXT":
			queueItem.instance.__loadText(queueItem.uri,queueItem.promise);
			break;
		default:
			lime__$internal_backend_html5_HTML5HTTPRequest.activeRequests--;
		}
	}
};
lime__$internal_backend_html5_HTML5HTTPRequest.__createBlobURIFromBytes = function(bytes,type) {
	return URL.createObjectURL(new Blob([bytes.b.bufferValue],{ type : type}));
};
lime__$internal_backend_html5_HTML5HTTPRequest.__fixHostname = function(hostname) {
	if(hostname == null) {
		return "";
	} else {
		return hostname;
	}
};
lime__$internal_backend_html5_HTML5HTTPRequest.__fixPort = function(port,protocol) {
	if(port == null || port == "") {
		switch(protocol) {
		case "ftp:":
			return "21";
		case "gopher:":
			return "70";
		case "http:":
			return "80";
		case "https:":
			return "443";
		case "ws:":
			return "80";
		case "wss:":
			return "443";
		default:
			return "";
		}
	}
	return port;
};
lime__$internal_backend_html5_HTML5HTTPRequest.__fixProtocol = function(protocol) {
	if(protocol == null || protocol == "") {
		return "http:";
	} else {
		return protocol;
	}
};
lime__$internal_backend_html5_HTML5HTTPRequest.__isInMemoryURI = function(uri) {
	if(!StringTools.startsWith(uri,"data:")) {
		return StringTools.startsWith(uri,"blob:");
	} else {
		return true;
	}
};
lime__$internal_backend_html5_HTML5HTTPRequest.__isSameOrigin = function(path) {
	if(path == null || path == "") {
		return true;
	}
	if(lime__$internal_backend_html5_HTML5HTTPRequest.__isInMemoryURI(path)) {
		return true;
	}
	if(lime__$internal_backend_html5_HTML5HTTPRequest.originElement == null) {
		lime__$internal_backend_html5_HTML5HTTPRequest.originElement = window.document.createElement("a");
		lime__$internal_backend_html5_HTML5HTTPRequest.originHostname = lime__$internal_backend_html5_HTML5HTTPRequest.__fixHostname($global.location.hostname);
		lime__$internal_backend_html5_HTML5HTTPRequest.originProtocol = lime__$internal_backend_html5_HTML5HTTPRequest.__fixProtocol($global.location.protocol);
		lime__$internal_backend_html5_HTML5HTTPRequest.originPort = lime__$internal_backend_html5_HTML5HTTPRequest.__fixPort($global.location.port,lime__$internal_backend_html5_HTML5HTTPRequest.originProtocol);
	}
	var a = lime__$internal_backend_html5_HTML5HTTPRequest.originElement;
	a.href = path;
	if(a.hostname == "") {
		a.href = a.href;
	}
	var hostname = lime__$internal_backend_html5_HTML5HTTPRequest.__fixHostname(a.hostname);
	var protocol = lime__$internal_backend_html5_HTML5HTTPRequest.__fixProtocol(a.protocol);
	var port = lime__$internal_backend_html5_HTML5HTTPRequest.__fixPort(a.port,protocol);
	var sameHost = hostname == "" || hostname == lime__$internal_backend_html5_HTML5HTTPRequest.originHostname;
	var samePort = port == "" || port == lime__$internal_backend_html5_HTML5HTTPRequest.originPort;
	if(protocol != "file:" && sameHost) {
		return samePort;
	} else {
		return false;
	}
};
lime__$internal_backend_html5_HTML5HTTPRequest.__loadImage = function(uri,promise,options) {
	var image = new window.Image ();
	if(!lime__$internal_backend_html5_HTML5HTTPRequest.__isSameOrigin(uri)) {
		image.crossOrigin = "Anonymous";
	}
	if(lime__$internal_backend_html5_HTML5HTTPRequest.supportsImageProgress == null) {
		lime__$internal_backend_html5_HTML5HTTPRequest.supportsImageProgress = 'onprogress' in image;
	}
	if(lime__$internal_backend_html5_HTML5HTTPRequest.supportsImageProgress || lime__$internal_backend_html5_HTML5HTTPRequest.__isInMemoryURI(uri)) {
		image.addEventListener("load",function(event) {
			lime__$internal_backend_html5_HTML5HTTPRequest.__revokeBlobURI(uri,options);
			var buffer = new lime_graphics_ImageBuffer(null,image.width,image.height);
			buffer.__srcImage = image;
			lime__$internal_backend_html5_HTML5HTTPRequest.activeRequests--;
			lime__$internal_backend_html5_HTML5HTTPRequest.processQueue();
			promise.complete(new lime_graphics_Image(buffer));
		},false);
		image.addEventListener("progress",function(event) {
			promise.progress(event.loaded,event.total);
		},false);
		image.addEventListener("error",function(event) {
			lime__$internal_backend_html5_HTML5HTTPRequest.__revokeBlobURI(uri,options);
			lime__$internal_backend_html5_HTML5HTTPRequest.activeRequests--;
			lime__$internal_backend_html5_HTML5HTTPRequest.processQueue();
			promise.error(new lime_net__$HTTPRequestErrorResponse(event.detail,null));
		},false);
		image.src = uri;
	} else {
		var request = new XMLHttpRequest();
		request.onload = function(_) {
			lime__$internal_backend_html5_HTML5HTTPRequest.activeRequests--;
			lime__$internal_backend_html5_HTML5HTTPRequest.processQueue();
			var img = new lime_graphics_Image();
			img.__fromBytes(haxe_io_Bytes.ofData(request.response),function(img) {
				promise.complete(img);
			});
		};
		request.onerror = function(event) {
			promise.error(new lime_net__$HTTPRequestErrorResponse(event.message,null));
		};
		request.onprogress = function(event) {
			if(event.lengthComputable) {
				promise.progress(event.loaded,event.total);
			}
		};
		request.open("GET",uri,true);
		request.responseType = "arraybuffer";
		request.overrideMimeType("text/plain; charset=x-user-defined");
		request.send(null);
	}
};
lime__$internal_backend_html5_HTML5HTTPRequest.__revokeBlobURI = function(uri,options) {
	if((options & 1) != 0) {
		URL.revokeObjectURL(uri);
	}
};
lime__$internal_backend_html5_HTML5HTTPRequest.prototype = {
	binary: null
	,parent: null
	,request: null
	,validStatus0: null
	,cancel: function() {
		if(this.request != null) {
			this.request.abort();
		}
	}
	,init: function(parent) {
		this.parent = parent;
	}
	,load: function(uri,progress,readyStateChange) {
		this.request = new XMLHttpRequest();
		if(this.parent.method == "POST") {
			if(this.request.upload != null) {
				this.request.upload.addEventListener("progress",progress,false);
			}
		} else {
			this.request.addEventListener("progress",progress,false);
		}
		this.request.onreadystatechange = readyStateChange;
		var query = "";
		if(this.parent.data == null) {
			var h = this.parent.formData.h;
			var key_h = h;
			var key_keys = Object.keys(h);
			var key_length = key_keys.length;
			var key_current = 0;
			while(key_current < key_length) {
				var key = key_keys[key_current++];
				if(query.length > 0) {
					query += "&";
				}
				var value = this.parent.formData.h[key];
				if(key.indexOf("[]") > -1 && ((value) instanceof Array)) {
					var _g = [];
					var x = $getIterator(value);
					while(x.hasNext()) {
						var x1 = x.next();
						_g.push(encodeURIComponent(x1));
					}
					var arrayValue = _g.join("&amp;" + key + "=");
					query += encodeURIComponent(key) + "=" + arrayValue;
				} else {
					var query1 = encodeURIComponent(key) + "=";
					var s = Std.string(value);
					query += query1 + encodeURIComponent(s);
				}
			}
			if(this.parent.method == "GET" && query != "") {
				if(uri.indexOf("?") > -1) {
					uri += "&" + query;
				} else {
					uri += "?" + query;
				}
				query = "";
			}
		}
		this.request.open(Std.string(this.parent.method),uri,true);
		if(this.parent.timeout > 0) {
			this.request.timeout = this.parent.timeout;
		}
		if(this.binary) {
			this.request.responseType = "arraybuffer";
		}
		var contentType = null;
		var _g = 0;
		var _g1 = this.parent.headers;
		while(_g < _g1.length) {
			var header = _g1[_g];
			++_g;
			if(header.name == "Content-Type") {
				contentType = header.value;
			} else {
				this.request.setRequestHeader(header.name,header.value);
			}
		}
		if(this.parent.contentType != null) {
			contentType = this.parent.contentType;
		}
		if(contentType == null) {
			if(this.parent.data != null) {
				contentType = "application/octet-stream";
			} else if(query != "") {
				contentType = "application/x-www-form-urlencoded";
			}
		}
		if(contentType != null) {
			this.request.setRequestHeader("Content-Type",contentType);
		}
		if(this.parent.withCredentials) {
			this.request.withCredentials = true;
		}
		if(this.parent.data != null) {
			this.request.send(this.parent.data.b.bufferValue);
		} else {
			this.request.send(query);
		}
	}
	,loadData: function(uri) {
		var promise = new lime_app_Promise();
		if(lime__$internal_backend_html5_HTML5HTTPRequest.activeRequests < lime__$internal_backend_html5_HTML5HTTPRequest.requestLimit) {
			lime__$internal_backend_html5_HTML5HTTPRequest.activeRequests++;
			this.__loadData(uri,promise);
		} else {
			lime__$internal_backend_html5_HTML5HTTPRequest.requestQueue.add({ instance : this, uri : uri, promise : promise, type : "BINARY", options : 0});
		}
		return promise.future;
	}
	,loadText: function(uri) {
		var promise = new lime_app_Promise();
		if(lime__$internal_backend_html5_HTML5HTTPRequest.activeRequests < lime__$internal_backend_html5_HTML5HTTPRequest.requestLimit) {
			lime__$internal_backend_html5_HTML5HTTPRequest.activeRequests++;
			this.__loadText(uri,promise);
		} else {
			lime__$internal_backend_html5_HTML5HTTPRequest.requestQueue.add({ instance : this, uri : uri, promise : promise, type : "TEXT", options : 0});
		}
		return promise.future;
	}
	,processResponse: function() {
		if(this.parent.enableResponseHeaders) {
			this.parent.responseHeaders = [];
			var name;
			var value;
			var _g = 0;
			var _g1 = this.request.getAllResponseHeaders().split("\n");
			while(_g < _g1.length) {
				var line = _g1[_g];
				++_g;
				name = StringTools.trim(HxOverrides.substr(line,0,line.indexOf(":")));
				value = StringTools.trim(HxOverrides.substr(line,line.indexOf(":") + 1,null));
				if(name != "") {
					this.parent.responseHeaders.push(new lime_net_HTTPRequestHeader(name,value));
				}
			}
		}
		this.parent.responseStatus = this.request.status;
	}
	,__loadData: function(uri,promise) {
		var _gthis = this;
		var progress = function(event) {
			promise.progress(event.loaded,event.total);
		};
		var readyStateChange = function(event) {
			if(_gthis.request.readyState != 4) {
				return;
			}
			var bytes = null;
			if(_gthis.request.responseType == "") {
				if(_gthis.request.responseText != null) {
					bytes = haxe_io_Bytes.ofString(_gthis.request.responseText);
				}
			} else if(_gthis.request.response != null) {
				bytes = haxe_io_Bytes.ofData(_gthis.request.response);
			}
			if(_gthis.request.status != null && (_gthis.request.status >= 200 && _gthis.request.status < 400 || _gthis.validStatus0 && _gthis.request.status == 0)) {
				_gthis.processResponse();
				promise.complete(bytes);
			} else {
				_gthis.processResponse();
				promise.error(new lime_net__$HTTPRequestErrorResponse(_gthis.request.status,bytes));
			}
			_gthis.request = null;
			lime__$internal_backend_html5_HTML5HTTPRequest.activeRequests--;
			lime__$internal_backend_html5_HTML5HTTPRequest.processQueue();
		};
		this.binary = true;
		this.load(uri,progress,readyStateChange);
	}
	,__loadText: function(uri,promise) {
		var _gthis = this;
		var progress = function(event) {
			promise.progress(event.loaded,event.total);
		};
		var readyStateChange = function(event) {
			if(_gthis.request.readyState != 4) {
				return;
			}
			if(_gthis.request.status != null && (_gthis.request.status >= 200 && _gthis.request.status < 400 || _gthis.validStatus0 && _gthis.request.status == 0)) {
				_gthis.processResponse();
				promise.complete(_gthis.request.responseText);
			} else {
				_gthis.processResponse();
				promise.error(new lime_net__$HTTPRequestErrorResponse(_gthis.request.status,_gthis.request.responseText));
			}
			_gthis.request = null;
			lime__$internal_backend_html5_HTML5HTTPRequest.activeRequests--;
			lime__$internal_backend_html5_HTML5HTTPRequest.processQueue();
		};
		this.binary = false;
		this.load(uri,progress,readyStateChange);
	}
	,__class__: lime__$internal_backend_html5_HTML5HTTPRequest
};
var lime_app__$Event_$Dynamic_$Void = function() {
	this.canceled = false;
	this.__listeners = [];
	this.__priorities = [];
	this.__repeat = [];
};
$hxClasses["lime.app._Event_Dynamic_Void"] = lime_app__$Event_$Dynamic_$Void;
lime_app__$Event_$Dynamic_$Void.__name__ = "lime.app._Event_Dynamic_Void";
lime_app__$Event_$Dynamic_$Void.prototype = {
	canceled: null
	,__repeat: null
	,__priorities: null
	,add: function(listener,once,priority) {
		if(priority == null) {
			priority = 0;
		}
		if(once == null) {
			once = false;
		}
		var _g = 0;
		var _g1 = this.__priorities.length;
		while(_g < _g1) {
			var i = _g++;
			if(priority > this.__priorities[i]) {
				this.__listeners.splice(i,0,listener);
				this.__priorities.splice(i,0,priority);
				this.__repeat.splice(i,0,!once);
				return;
			}
		}
		this.__listeners.push(listener);
		this.__priorities.push(priority);
		this.__repeat.push(!once);
	}
	,cancel: function() {
		this.canceled = true;
	}
	,has: function(listener) {
		var _g = 0;
		var _g1 = this.__listeners;
		while(_g < _g1.length) {
			var l = _g1[_g];
			++_g;
			if(l == listener) {
				return true;
			}
		}
		return false;
	}
	,remove: function(listener) {
		var i = this.__listeners.length;
		while(--i >= 0) if(this.__listeners[i] == listener) {
			this.__listeners.splice(i,1);
			this.__priorities.splice(i,1);
			this.__repeat.splice(i,1);
		}
	}
	,removeAll: function() {
		var len = this.__listeners.length;
		this.__listeners.splice(0,len);
		this.__priorities.splice(0,len);
		this.__repeat.splice(0,len);
	}
	,__listeners: null
	,dispatch: function(a) {
		this.canceled = false;
		var listeners = this.__listeners;
		var repeat = this.__repeat;
		var i = 0;
		while(i < listeners.length) {
			listeners[i](a);
			if(!repeat[i]) {
				this.remove(listeners[i]);
			} else {
				++i;
			}
			if(this.canceled) {
				break;
			}
		}
	}
	,__class__: lime_app__$Event_$Dynamic_$Void
};
var lime__$internal_backend_html5_Message = {};
lime__$internal_backend_html5_Message.skip = function(object) {
	if(!(object == null || !((object) instanceof Object) || Reflect.field(object,"__skipPrototype__") == true)) {
		if(object.byteLength != null && object.byteOffset != null && object.buffer != null) {
			return ((object.buffer) instanceof ArrayBuffer);
		} else {
			return false;
		}
	} else {
		return true;
	}
};
lime__$internal_backend_html5_Message.disablePreserveClasses = function(object) {
	if(object == null || !((object) instanceof Object) || Reflect.field(object,"__skipPrototype__") == true || object.byteLength != null && object.byteOffset != null && object.buffer != null && ((object.buffer) instanceof ArrayBuffer)) {
		return;
	}
	object["__skipPrototype__"] = true;
};
lime__$internal_backend_html5_Message.preserveClasses = function(this1) {
	if(this1 == null || !((this1) instanceof Object) || Reflect.field(this1,"__skipPrototype__") == true || this1.byteLength != null && this1.byteOffset != null && this1.buffer != null && ((this1.buffer) instanceof ArrayBuffer) || Object.prototype.hasOwnProperty.call(this1,"__prototype__")) {
		return;
	}
	if(!((this1) instanceof Array)) {
		try {
			if(this1.__class__ != null) {
				this1["__prototype__"] = this1.__class__.__name__;
			} else {
				this1["__prototype__"] = null;
			}
		} catch( _g ) {
			haxe_NativeStackTrace.lastError = _g;
			return;
		}
		if(typeof this1.toString == "function") {
			Reflect.deleteField(this1,"toString");
		}
	}
	var _g = 0;
	var _g1 = Object.values(this1);
	while(_g < _g1.length) {
		var child = _g1[_g];
		++_g;
		lime__$internal_backend_html5_Message.preserveClasses(child);
	}
};
lime__$internal_backend_html5_Message.restoreClasses = function(this1,flag) {
	if(flag == null) {
		flag = Math.random() * 2147483647 | 0;
		if(Reflect.field(this1,"__restoreFlag__") == flag) {
			++flag;
		}
	}
	if(this1 == null || !((this1) instanceof Object) || Reflect.field(this1,"__skipPrototype__") == true || this1.byteLength != null && this1.byteOffset != null && this1.buffer != null && ((this1.buffer) instanceof ArrayBuffer) || Reflect.field(this1,"__restoreFlag__") == flag) {
		return;
	}
	try {
		this1["__restoreFlag__"] = flag;
	} catch( _g ) {
		haxe_NativeStackTrace.lastError = _g;
		return;
	}
	if(Reflect.field(this1,"__prototype__") != null) {
		try {
			Object.setPrototypeOf(this1,$hxClasses[Reflect.field(this1,"__prototype__")].prototype);
		} catch( _g ) {
			haxe_NativeStackTrace.lastError = _g;
		}
	}
	var _g = 0;
	var _g1 = Object.values(this1);
	while(_g < _g1.length) {
		var child = _g1[_g];
		++_g;
		lime__$internal_backend_html5_Message.restoreClasses(child,flag);
	}
};
var lime__$internal_backend_html5_WorkFunction = {};
lime__$internal_backend_html5_WorkFunction.__properties__ = {get_portable:"get_portable"};
lime__$internal_backend_html5_WorkFunction.toFunction = function(this1) {
	if(this1.func != null) {
		return this1.func;
	} else if(this1.classPath != null && this1.functionName != null) {
		this1.func = $hxClasses[this1.classPath][this1.functionName];
		return this1.func;
	} else if(this1.sourceCode != null) {
		this1.func = new Function("return " + this1.sourceCode)();
		return this1.func;
	}
	throw haxe_Exception.thrown("Object is not a valid WorkFunction: " + Std.string(this1));
};
lime__$internal_backend_html5_WorkFunction.makePortable = function(this1,throwError) {
	if(throwError == null) {
		throwError = true;
	}
	if(this1.func != null) {
		if(this1.classPath != null || this1.functionName != null) {
			var func = $hxClasses[this1.classPath] && $hxClasses[this1.classPath][this1.functionName];
			if(func != this1.func) {
				throw haxe_Exception.thrown("Could not make " + this1.functionName + " portable. Either " + this1.functionName + " isn't static, or " + this1.classPath + " is something other than a class.");
			} else {
				this1.func = null;
				return true;
			}
		} else {
			this1.sourceCode = this1.func.toString();
			if(this1.sourceCode.indexOf("[native code]") < 0) {
				this1.func = null;
				return true;
			} else {
				this1.sourceCode = null;
			}
			throw haxe_Exception.thrown("Only static class functions can be made portable. Set -Dlime-warn-portability to see which line caused this.");
		}
	}
	return this1.func == null;
};
lime__$internal_backend_html5_WorkFunction.get_portable = function(this1) {
	return this1.func == null;
};
var lime__$internal_backend_html5_HTML5Thread = function(href,worker) {
	this.__href = href;
	if(worker != null) {
		this.__worker = worker;
		this.__worker.onmessage = $bind(this,this.dispatchMessage);
		this.onMessage = new lime_app__$Event_$Dynamic_$Void();
	}
	lime__$internal_backend_html5_Message.disablePreserveClasses(this);
};
$hxClasses["lime._internal.backend.html5.HTML5Thread"] = lime__$internal_backend_html5_HTML5Thread;
lime__$internal_backend_html5_HTML5Thread.__name__ = "lime._internal.backend.html5.HTML5Thread";
lime__$internal_backend_html5_HTML5Thread.current = function() {
	return lime__$internal_backend_html5_HTML5Thread.__current;
};
lime__$internal_backend_html5_HTML5Thread.create = function(job) {
	var url = new URL(lime__$internal_backend_html5_HTML5Thread.__current.__href);
	url.pathname = HxOverrides.substr(url.pathname,0,url.pathname.lastIndexOf("/") + 1) + lime_app_Application.current.meta.h["file"] + ".js";
	if(url.hash.length > 0) {
		url.hash += "_";
	}
	url.hash += lime__$internal_backend_html5_HTML5Thread.__workerCount;
	lime__$internal_backend_html5_HTML5Thread.__workerCount++;
	lime__$internal_backend_html5_WorkFunction.makePortable(job);
	var thread = new lime__$internal_backend_html5_HTML5Thread(url.href,new Worker(url.href));
	thread.sendMessage(job);
	return thread;
};
lime__$internal_backend_html5_HTML5Thread.zeroDelay = function() {
	return new Promise(function(resolve,_) {
		$global.setTimeout(resolve);
	});
};
lime__$internal_backend_html5_HTML5Thread.returnMessage = function(message,transferList,preserveClasses) {
	if(preserveClasses == null) {
		preserveClasses = true;
	}
	if(lime__$internal_backend_html5_HTML5Thread.__isWorker) {
		if(preserveClasses) {
			lime__$internal_backend_html5_Message.preserveClasses(message);
		}
		$global.postMessage(message,transferList);
	}
};
lime__$internal_backend_html5_HTML5Thread.equals = function(a,b) {
	return a.__href == b.__href;
};
lime__$internal_backend_html5_HTML5Thread.prototype = {
	onMessage: null
	,__href: null
	,__worker: null
	,sendMessage: function(message,transferList,preserveClasses) {
		if(preserveClasses == null) {
			preserveClasses = true;
		}
		if(this.__worker != null) {
			if(preserveClasses) {
				lime__$internal_backend_html5_Message.preserveClasses(message);
			}
			this.__worker.postMessage(message,transferList);
		} else {
			lime__$internal_backend_html5_HTML5Thread.__messages.add(message);
		}
	}
	,dispatchMessage: function(event) {
		var message = event.data;
		lime__$internal_backend_html5_Message.restoreClasses(message);
		if(this.onMessage != null) {
			this.onMessage.dispatch(message);
		}
		if(lime__$internal_backend_html5_HTML5Thread.__resolveMethods.isEmpty()) {
			lime__$internal_backend_html5_HTML5Thread.__messages.add(message);
		} else {
			(lime__$internal_backend_html5_HTML5Thread.__resolveMethods.pop())(message);
		}
	}
	,destroy: function() {
		if(this.__worker != null) {
			this.__worker.terminate();
		} else if(lime__$internal_backend_html5_HTML5Thread.__isWorker) {
			try {
				$global.close();
			} catch( _g ) {
				haxe_NativeStackTrace.lastError = _g;
			}
		}
	}
	,isWorker: function() {
		if(this.__worker == null) {
			return lime__$internal_backend_html5_HTML5Thread.__isWorker;
		} else {
			return true;
		}
	}
	,__class__: lime__$internal_backend_html5_HTML5Thread
};
var lime__$internal_backend_html5_HTML5Window = function(parent) {
	this.imeCompositionActive = false;
	this.__stopMousePropagation = false;
	this.unusedTouchesPool = new haxe_ds_List();
	this.scale = 1.0;
	this.currentTouches = new haxe_ds_IntMap();
	this.parent = parent;
	this.cursor = lime_ui_MouseCursor.DEFAULT;
	this.cacheMouseX = 0;
	this.cacheMouseY = 0;
	var attributes = parent.__attributes;
	if(!Object.prototype.hasOwnProperty.call(attributes,"context")) {
		attributes.context = { };
	}
	this.renderType = attributes.context.type;
	if(Object.prototype.hasOwnProperty.call(attributes,"element")) {
		parent.element = attributes.element;
	}
	var element = parent.element;
	if(Object.prototype.hasOwnProperty.call(attributes,"allowHighDPI") && attributes.allowHighDPI && this.renderType != "dom") {
		this.scale = window.devicePixelRatio;
	}
	parent.__scale = this.scale;
	this.setWidth = Object.prototype.hasOwnProperty.call(attributes,"width") ? attributes.width : 0;
	this.setHeight = Object.prototype.hasOwnProperty.call(attributes,"height") ? attributes.height : 0;
	parent.__width = this.setWidth;
	parent.__height = this.setHeight;
	parent.id = lime__$internal_backend_html5_HTML5Window.windowID++;
	if(((element) instanceof HTMLCanvasElement)) {
		this.canvas = element;
	} else if(this.renderType == "dom") {
		this.div = window.document.createElement("div");
	} else {
		this.canvas = window.document.createElement("canvas");
	}
	if(this.canvas != null) {
		var style = this.canvas.style;
		style.setProperty("-webkit-transform","translateZ(0)",null);
		style.setProperty("transform","translateZ(0)",null);
	} else if(this.div != null) {
		var style = this.div.style;
		style.setProperty("-webkit-transform","translate3D(0,0,0)",null);
		style.setProperty("transform","translate3D(0,0,0)",null);
		style.position = "relative";
		style.overflow = "hidden";
		style.setProperty("-webkit-user-select","none",null);
		style.setProperty("-moz-user-select","none",null);
		style.setProperty("-ms-user-select","none",null);
		style.setProperty("-o-user-select","none",null);
	}
	if(parent.__width == 0 && parent.__height == 0) {
		if(element != null) {
			parent.__width = element.clientWidth;
			parent.__height = element.clientHeight;
		} else {
			parent.__width = window.innerWidth;
			parent.__height = window.innerHeight;
		}
		this.cacheElementWidth = parent.__width;
		this.cacheElementHeight = parent.__height;
		this.resizeElement = true;
	}
	if(this.canvas != null) {
		this.canvas.width = Math.round(parent.__width * this.scale);
		this.canvas.height = Math.round(parent.__height * this.scale);
		this.canvas.style.width = parent.__width + "px";
		this.canvas.style.height = parent.__height + "px";
	} else {
		this.div.style.width = parent.__width + "px";
		this.div.style.height = parent.__height + "px";
	}
	if(Object.prototype.hasOwnProperty.call(attributes,"resizable") && attributes.resizable || !Object.prototype.hasOwnProperty.call(attributes,"width") && this.setWidth == 0 && this.setHeight == 0) {
		parent.__resizable = true;
	}
	this.updateSize();
	if(element != null) {
		if(this.canvas != null) {
			if(element != this.canvas) {
				element.appendChild(this.canvas);
			}
		} else {
			element.appendChild(this.div);
		}
		var events = ["mousedown","mouseenter","mouseleave","mousemove","mouseup","wheel"];
		var _g = 0;
		while(_g < events.length) {
			var event = events[_g];
			++_g;
			element.addEventListener(event,$bind(this,this.handleMouseEvent),true);
		}
		element.addEventListener("contextmenu",$bind(this,this.handleContextMenuEvent),true);
		element.addEventListener("dragstart",$bind(this,this.handleDragEvent),true);
		element.addEventListener("dragover",$bind(this,this.handleDragEvent),true);
		element.addEventListener("drop",$bind(this,this.handleDragEvent),true);
		element.addEventListener("touchstart",$bind(this,this.handleTouchEvent),true);
		element.addEventListener("touchmove",$bind(this,this.handleTouchEvent),true);
		element.addEventListener("touchend",$bind(this,this.handleTouchEvent),true);
		element.addEventListener("touchcancel",$bind(this,this.handleTouchEvent),true);
		element.addEventListener("gamepadconnected",$bind(this,this.handleGamepadEvent),true);
		element.addEventListener("gamepaddisconnected",$bind(this,this.handleGamepadEvent),true);
	}
	this.createContext();
	if(parent.context.type == "webgl") {
		this.canvas.addEventListener("webglcontextlost",$bind(this,this.handleContextEvent),false);
		this.canvas.addEventListener("webglcontextrestored",$bind(this,this.handleContextEvent),false);
	}
};
$hxClasses["lime._internal.backend.html5.HTML5Window"] = lime__$internal_backend_html5_HTML5Window;
lime__$internal_backend_html5_HTML5Window.__name__ = "lime._internal.backend.html5.HTML5Window";
lime__$internal_backend_html5_HTML5Window.prototype = {
	canvas: null
	,div: null
	,cacheElementHeight: null
	,cacheElementWidth: null
	,cacheMouseX: null
	,cacheMouseY: null
	,cursor: null
	,currentTouches: null
	,isFullscreen: null
	,parent: null
	,primaryTouch: null
	,renderType: null
	,requestedFullscreen: null
	,resizeElement: null
	,scale: null
	,setHeight: null
	,setWidth: null
	,textInputEnabled: null
	,textInputRect: null
	,unusedTouchesPool: null
	,__focusPending: null
	,__stopMousePropagation: null
	,alert: function(message,title) {
		if(message != null) {
			window.alert(Std.string(message));
		}
	}
	,close: function() {
		var element = this.parent.element;
		if(element != null) {
			if(this.canvas != null) {
				if(element != this.canvas) {
					element.removeChild(this.canvas);
				}
				this.canvas = null;
			} else if(this.div != null) {
				element.removeChild(this.div);
				this.div = null;
			}
			var events = ["mousedown","mouseenter","mouseleave","mousemove","mouseup","wheel"];
			var _g = 0;
			while(_g < events.length) {
				var event = events[_g];
				++_g;
				element.removeEventListener(event,$bind(this,this.handleMouseEvent),true);
			}
			element.removeEventListener("contextmenu",$bind(this,this.handleContextMenuEvent),true);
			element.removeEventListener("dragstart",$bind(this,this.handleDragEvent),true);
			element.removeEventListener("dragover",$bind(this,this.handleDragEvent),true);
			element.removeEventListener("drop",$bind(this,this.handleDragEvent),true);
			element.removeEventListener("touchstart",$bind(this,this.handleTouchEvent),true);
			element.removeEventListener("touchmove",$bind(this,this.handleTouchEvent),true);
			element.removeEventListener("touchend",$bind(this,this.handleTouchEvent),true);
			element.removeEventListener("touchcancel",$bind(this,this.handleTouchEvent),true);
			element.removeEventListener("gamepadconnected",$bind(this,this.handleGamepadEvent),true);
			element.removeEventListener("gamepaddisconnected",$bind(this,this.handleGamepadEvent),true);
		}
		this.parent.application.__removeWindow(this.parent);
	}
	,createContext: function() {
		var context = new lime_graphics_RenderContext();
		var contextAttributes = this.parent.__attributes.context;
		context.window = this.parent;
		context.attributes = contextAttributes;
		if(this.div != null) {
			context.dom = this.div;
			context.type = "dom";
			context.version = "";
		} else if(this.canvas != null) {
			var webgl = null;
			var forceCanvas = this.renderType == "canvas";
			var forceWebGL = this.renderType == "opengl" || this.renderType == "opengles" || this.renderType == "webgl";
			var allowWebGL2 = !Object.prototype.hasOwnProperty.call(contextAttributes,"version") || contextAttributes.version != "1";
			var isWebGL2 = false;
			if(forceWebGL || !forceCanvas && (!Object.prototype.hasOwnProperty.call(contextAttributes,"hardware") || contextAttributes.hardware)) {
				var transparentBackground = Object.prototype.hasOwnProperty.call(contextAttributes,"background") && contextAttributes.background == null;
				var colorDepth = Object.prototype.hasOwnProperty.call(contextAttributes,"colorDepth") ? contextAttributes.colorDepth : 16;
				var options = Object.prototype.hasOwnProperty.call(contextAttributes,"antialiasing") && contextAttributes.antialiasing > 0;
				var options1 = Object.prototype.hasOwnProperty.call(contextAttributes,"depth") ? contextAttributes.depth : true;
				var options2 = Object.prototype.hasOwnProperty.call(contextAttributes,"stencil") && contextAttributes.stencil;
				var options3 = Object.prototype.hasOwnProperty.call(contextAttributes,"preserveDrawingBuffer") && contextAttributes.preserveDrawingBuffer;
				var options4 = { alpha : transparentBackground || colorDepth > 16, antialias : options, depth : options1, premultipliedAlpha : true, stencil : options2, preserveDrawingBuffer : options3, failIfMajorPerformanceCaveat : false};
				var glContextType = ["webgl","experimental-webgl"];
				if(allowWebGL2) {
					glContextType.unshift("webgl2");
				}
				var _g = 0;
				while(_g < glContextType.length) {
					var name = glContextType[_g];
					++_g;
					webgl = this.canvas.getContext(name,options4);
					if(webgl != null && name == "webgl2") {
						isWebGL2 = true;
					}
					if(webgl != null) {
						break;
					}
				}
			}
			if(webgl == null) {
				context.canvas2D = this.canvas.getContext("2d");
				context.type = "canvas";
				context.version = "";
				context.attributes.hardware = false;
			} else {
				context.webgl = lime_graphics_WebGLRenderContext.fromWebGL2RenderContext(webgl);
				if(isWebGL2) {
					context.webgl2 = webgl;
				}
				if(lime_graphics_opengl_GL.context == null) {
					lime_graphics_opengl_GL.context = webgl;
					lime_graphics_opengl_GL.type = "webgl";
					lime_graphics_opengl_GL.version = isWebGL2 ? 2 : 1;
				}
				context.type = "webgl";
				context.version = isWebGL2 ? "2" : "1";
				context.attributes.hardware = true;
			}
		}
		this.parent.context = context;
	}
	,focus: function() {
	}
	,focusTextInput: function() {
		var _gthis = this;
		if(this.__focusPending) {
			return;
		}
		this.__focusPending = true;
		haxe_Timer.delay(function() {
			_gthis.__focusPending = false;
			if(_gthis.textInputEnabled) {
				lime__$internal_backend_html5_HTML5Window.textInput.focus();
			}
		},20);
	}
	,getCursor: function() {
		return this.cursor;
	}
	,getDisplay: function() {
		return lime_system_System.getDisplay(0);
	}
	,getDisplayMode: function() {
		return lime_system_System.getDisplay(0).currentMode;
	}
	,getFrameRate: function() {
		if(this.parent.application == null) {
			return 0;
		}
		if(this.parent.application.__backend.framePeriod < 0) {
			return 60;
		} else if(this.parent.application.__backend.framePeriod == 1000) {
			return 0;
		} else {
			return 1000 / this.parent.application.__backend.framePeriod;
		}
	}
	,getMouseLock: function() {
		return false;
	}
	,getOpacity: function() {
		return 1.0;
	}
	,getTextInputEnabled: function() {
		return this.textInputEnabled;
	}
	,handleContextEvent: function(event) {
		switch(event.type) {
		case "webglcontextlost":
			if(event.cancelable) {
				event.preventDefault();
			}
			var tmp = lime_graphics_opengl_GL.context != null;
			this.parent.context = null;
			this.parent.onRenderContextLost.dispatch();
			break;
		case "webglcontextrestored":
			this.createContext();
			this.parent.onRenderContextRestored.dispatch(this.parent.context);
			break;
		default:
		}
	}
	,handleContextMenuEvent: function(event) {
		if((this.parent.onMouseUp.canceled || this.parent.onMouseDown.canceled) && event.cancelable) {
			event.preventDefault();
		}
	}
	,handleCutOrCopyEvent: function(event) {
		var text = lime_system_Clipboard.get_text();
		if(text == null) {
			text = "";
		}
		event.clipboardData.setData("text/plain",text);
		if(event.cancelable) {
			event.preventDefault();
		}
	}
	,handleDragEvent: function(event) {
		switch(event.type) {
		case "dragover":
			event.preventDefault();
			return false;
		case "dragstart":
			if((js_Boot.__cast(event.target , HTMLElement)).nodeName.toLowerCase() == "img" && event.cancelable) {
				event.preventDefault();
				return false;
			}
			break;
		case "drop":
			if(event.dataTransfer != null && event.dataTransfer.files.length > 0) {
				this.parent.onDropFile.dispatch(event.dataTransfer.files);
				event.preventDefault();
				return false;
			}
			break;
		}
		return true;
	}
	,handleFocusEvent: function(event) {
		if(this.textInputEnabled) {
			if(event.relatedTarget == null || this.isDescendent(event.relatedTarget)) {
				this.focusTextInput();
			}
		}
	}
	,handleFullscreenEvent: function(event) {
		var fullscreenElement = document.fullscreenElement || document.mozFullScreenElement || document.webkitFullscreenElement || document.msFullscreenElement;
		if(fullscreenElement != null) {
			this.isFullscreen = true;
			this.parent.__fullscreen = true;
			if(this.requestedFullscreen) {
				this.requestedFullscreen = false;
				this.parent.onFullscreen.dispatch();
			}
		} else {
			this.isFullscreen = false;
			this.parent.__fullscreen = false;
			this.parent.onRestore.dispatch();
			var changeEvents = ["fullscreenchange","mozfullscreenchange","webkitfullscreenchange","MSFullscreenChange"];
			var errorEvents = ["fullscreenerror","mozfullscreenerror","webkitfullscreenerror","MSFullscreenError"];
			var _g = 0;
			var _g1 = changeEvents.length;
			while(_g < _g1) {
				var i = _g++;
				window.document.removeEventListener(changeEvents[i],$bind(this,this.handleFullscreenEvent),false);
				window.document.removeEventListener(errorEvents[i],$bind(this,this.handleFullscreenEvent),false);
			}
		}
	}
	,handleGamepadEvent: function(event) {
		switch(event.type) {
		case "gamepadconnected":
			lime_ui_Joystick.__connect(event.gamepad.index);
			if(event.gamepad.mapping == "standard") {
				lime_ui_Gamepad.__connect(event.gamepad.index);
			}
			break;
		case "gamepaddisconnected":
			lime_ui_Joystick.__disconnect(event.gamepad.index);
			lime_ui_Gamepad.__disconnect(event.gamepad.index);
			break;
		default:
		}
	}
	,handleInputEvent: function(event) {
		if(this.imeCompositionActive) {
			return;
		}
		if(lime__$internal_backend_html5_HTML5Window.textInput.value != lime__$internal_backend_html5_HTML5Window.dummyCharacter) {
			var value = StringTools.replace(lime__$internal_backend_html5_HTML5Window.textInput.value,lime__$internal_backend_html5_HTML5Window.dummyCharacter,"");
			if(value.length > 0) {
				this.parent.onTextInput.dispatch(value);
			}
			lime__$internal_backend_html5_HTML5Window.textInput.value = lime__$internal_backend_html5_HTML5Window.dummyCharacter;
		}
	}
	,handleMouseEvent: function(event) {
		var x = 0.0;
		var y = 0.0;
		if(event.type != "wheel") {
			if(this.parent.element != null) {
				if(this.canvas != null) {
					var rect = this.canvas.getBoundingClientRect();
					x = (event.clientX - rect.left) * (this.parent.__width / rect.width);
					y = (event.clientY - rect.top) * (this.parent.__height / rect.height);
				} else if(this.div != null) {
					var rect = this.div.getBoundingClientRect();
					x = event.clientX - rect.left;
					y = event.clientY - rect.top;
				} else {
					var rect = this.parent.element.getBoundingClientRect();
					x = (event.clientX - rect.left) * (this.parent.__width / rect.width);
					y = (event.clientY - rect.top) * (this.parent.__height / rect.height);
				}
			} else {
				x = event.clientX;
				y = event.clientY;
			}
			switch(event.type) {
			case "mousedown":
				if(event.currentTarget == this.parent.element) {
					window.addEventListener("mouseup",$bind(this,this.handleMouseEvent));
					window.addEventListener("mousemove",$bind(this,this.handleMouseEvent));
				}
				this.__stopMousePropagation = false;
				this.parent.clickCount = event.detail;
				this.parent.onMouseDown.dispatch(x,y,event.button);
				this.parent.clickCount = 0;
				if(this.parent.onMouseDown.canceled && event.cancelable) {
					event.preventDefault();
				}
				break;
			case "mouseenter":
				if(event.target == this.parent.element) {
					this.parent.onEnter.dispatch();
					if(this.parent.onEnter.canceled && event.cancelable) {
						event.preventDefault();
					}
				}
				break;
			case "mouseleave":
				if(event.target == this.parent.element) {
					this.parent.onLeave.dispatch();
					if(this.parent.onLeave.canceled && event.cancelable) {
						event.preventDefault();
					}
				}
				break;
			case "mousemove":
				if(this.__stopMousePropagation && event.currentTarget != this.parent.element) {
					this.__stopMousePropagation = false;
					return;
				}
				this.__stopMousePropagation = event.currentTarget == this.parent.element;
				if(x != this.cacheMouseX || y != this.cacheMouseY) {
					this.parent.onMouseMove.dispatch(x,y);
					this.parent.onMouseMoveRelative.dispatch(x - this.cacheMouseX,y - this.cacheMouseY);
					if((this.parent.onMouseMove.canceled || this.parent.onMouseMoveRelative.canceled) && event.cancelable) {
						event.preventDefault();
					}
				}
				break;
			case "mouseup":
				if(this.__stopMousePropagation && event.currentTarget != this.parent.element) {
					this.__stopMousePropagation = false;
					return;
				}
				window.removeEventListener("mouseup",$bind(this,this.handleMouseEvent));
				window.removeEventListener("mousemove",$bind(this,this.handleMouseEvent));
				this.__stopMousePropagation = event.currentTarget == this.parent.element;
				this.parent.clickCount = event.detail;
				this.parent.onMouseUp.dispatch(x,y,event.button);
				this.parent.clickCount = 0;
				if(this.parent.onMouseUp.canceled && event.cancelable) {
					event.preventDefault();
				}
				break;
			default:
			}
			this.cacheMouseX = x;
			this.cacheMouseY = y;
		} else {
			var deltaMode;
			switch(event.deltaMode) {
			case 0:
				deltaMode = lime_ui_MouseWheelMode.PIXELS;
				break;
			case 1:
				deltaMode = lime_ui_MouseWheelMode.LINES;
				break;
			case 2:
				deltaMode = lime_ui_MouseWheelMode.PAGES;
				break;
			default:
				deltaMode = lime_ui_MouseWheelMode.UNKNOWN;
			}
			this.parent.onMouseWheel.dispatch(event.deltaX,-event.deltaY,deltaMode);
			if(this.parent.onMouseWheel.canceled && event.cancelable) {
				event.preventDefault();
			}
		}
	}
	,handlePasteEvent: function(event) {
		if(event.clipboardData.types.indexOf("text/plain") > -1) {
			var text = event.clipboardData.getData("text/plain");
			lime_system_Clipboard.set_text(text);
			if(this.textInputEnabled) {
				this.parent.onTextInput.dispatch(text);
			}
			if(event.cancelable) {
				event.preventDefault();
			}
		}
	}
	,handleResizeEvent: function(event) {
		this.primaryTouch = null;
		this.updateSize();
	}
	,handleTouchEvent: function(event) {
		if(event.cancelable) {
			event.preventDefault();
		}
		var rect = null;
		if(this.parent.element != null) {
			if(this.canvas != null) {
				rect = this.canvas.getBoundingClientRect();
			} else if(this.div != null) {
				rect = this.div.getBoundingClientRect();
			} else {
				rect = this.parent.element.getBoundingClientRect();
			}
		}
		var windowWidth = this.setWidth;
		var windowHeight = this.setHeight;
		if(windowWidth == 0 || windowHeight == 0) {
			if(rect != null) {
				windowWidth = rect.width;
				windowHeight = rect.height;
			} else {
				windowWidth = 1;
				windowHeight = 1;
			}
		}
		var touch;
		var x;
		var y;
		var cacheX;
		var cacheY;
		var _g = 0;
		var _g1 = event.changedTouches;
		while(_g < _g1.length) {
			var data = _g1[_g];
			++_g;
			x = 0.0;
			y = 0.0;
			if(rect != null) {
				x = (data.clientX - rect.left) * (windowWidth / rect.width);
				y = (data.clientY - rect.top) * (windowHeight / rect.height);
			} else {
				x = data.clientX;
				y = data.clientY;
			}
			if(event.type == "touchstart") {
				touch = this.unusedTouchesPool.pop();
				if(touch == null) {
					touch = new lime_ui_Touch(x / windowWidth,y / windowHeight,data.identifier,0,0,data.force,this.parent.id);
				} else {
					touch.x = x / windowWidth;
					touch.y = y / windowHeight;
					touch.id = data.identifier;
					touch.dx = 0;
					touch.dy = 0;
					touch.pressure = data.force;
					touch.device = this.parent.id;
				}
				this.currentTouches.h[data.identifier] = touch;
				lime_ui_Touch.onStart.dispatch(touch);
				if(this.primaryTouch == null) {
					this.primaryTouch = touch;
				}
				if(touch == this.primaryTouch) {
					this.parent.onMouseDown.dispatch(x,y,0);
				}
			} else {
				touch = this.currentTouches.h[data.identifier];
				if(touch != null) {
					cacheX = touch.x;
					cacheY = touch.y;
					touch.x = x / windowWidth;
					touch.y = y / windowHeight;
					touch.dx = touch.x - cacheX;
					touch.dy = touch.y - cacheY;
					touch.pressure = data.force;
					switch(event.type) {
					case "touchcancel":
						lime_ui_Touch.onCancel.dispatch(touch);
						this.currentTouches.remove(data.identifier);
						this.unusedTouchesPool.add(touch);
						if(touch == this.primaryTouch) {
							this.primaryTouch = null;
						}
						break;
					case "touchend":
						lime_ui_Touch.onEnd.dispatch(touch);
						this.currentTouches.remove(data.identifier);
						this.unusedTouchesPool.add(touch);
						if(touch == this.primaryTouch) {
							this.parent.onMouseUp.dispatch(x,y,0);
							this.primaryTouch = null;
						}
						break;
					case "touchmove":
						lime_ui_Touch.onMove.dispatch(touch);
						if(touch == this.primaryTouch) {
							this.parent.onMouseMove.dispatch(x,y);
						}
						break;
					default:
					}
				}
			}
		}
	}
	,isDescendent: function(node) {
		if(node == this.parent.element) {
			return true;
		}
		while(node != null) {
			if(node.parentNode == this.parent.element) {
				return true;
			}
			node = node.parentNode;
		}
		return false;
	}
	,move: function(x,y) {
	}
	,readPixels: function(rect) {
		if(this.canvas != null) {
			var stageRect = new lime_math_Rectangle(0,0,this.canvas.width,this.canvas.height);
			if(rect == null) {
				rect = stageRect;
			} else {
				rect.intersection(stageRect,rect);
			}
			if(rect.width > 0 && rect.height > 0) {
				var canvas2 = window.document.createElement("canvas");
				canvas2.width = rect.width | 0;
				canvas2.height = rect.height | 0;
				var context = canvas2.getContext("2d");
				context.drawImage(this.canvas,-rect.x,-rect.y);
				return lime_graphics_Image.fromCanvas(canvas2);
			}
		}
		return null;
	}
	,resize: function(width,height) {
	}
	,setMinSize: function(width,height) {
	}
	,setMaxSize: function(width,height) {
	}
	,setBorderless: function(value) {
		return value;
	}
	,setClipboard: function(value) {
		if(lime__$internal_backend_html5_HTML5Window.textArea == null) {
			lime__$internal_backend_html5_HTML5Window.textArea = window.document.createElement("textarea");
			lime__$internal_backend_html5_HTML5Window.textArea.style.height = "0px";
			lime__$internal_backend_html5_HTML5Window.textArea.style.left = "-100px";
			lime__$internal_backend_html5_HTML5Window.textArea.style.opacity = "0";
			lime__$internal_backend_html5_HTML5Window.textArea.style.position = "fixed";
			lime__$internal_backend_html5_HTML5Window.textArea.style.top = "-100px";
			lime__$internal_backend_html5_HTML5Window.textArea.style.width = "0px";
			window.document.body.appendChild(lime__$internal_backend_html5_HTML5Window.textArea);
		}
		lime__$internal_backend_html5_HTML5Window.textArea.value = value;
		lime__$internal_backend_html5_HTML5Window.textArea.focus();
		lime__$internal_backend_html5_HTML5Window.textArea.select();
		if(window.document.queryCommandEnabled("copy")) {
			window.document.execCommand("copy");
		}
		if(this.textInputEnabled) {
			this.focusTextInput();
		}
	}
	,setCursor: function(value) {
		if(this.cursor != value) {
			if(value == null) {
				this.parent.element.style.cursor = "none";
			} else {
				var tmp;
				switch(value._hx_index) {
				case 0:
					tmp = "default";
					break;
				case 1:
					tmp = "crosshair";
					break;
				case 3:
					tmp = "move";
					break;
				case 4:
					tmp = "pointer";
					break;
				case 5:
					tmp = "nesw-resize";
					break;
				case 6:
					tmp = "ns-resize";
					break;
				case 7:
					tmp = "nwse-resize";
					break;
				case 8:
					tmp = "ew-resize";
					break;
				case 9:
					tmp = "text";
					break;
				case 10:
					tmp = "wait";
					break;
				case 11:
					tmp = "wait";
					break;
				default:
					tmp = "auto";
				}
				this.parent.element.style.cursor = tmp;
			}
			this.cursor = value;
		}
		return this.cursor;
	}
	,setDisplayMode: function(value) {
		return value;
	}
	,setFrameRate: function(value) {
		if(this.parent.application != null) {
			if(value >= 60) {
				if(this.parent == this.parent.application.__window) {
					this.parent.application.__backend.framePeriod = -1;
				}
			} else if(value > 0) {
				if(this.parent == this.parent.application.__window) {
					this.parent.application.__backend.framePeriod = 1000 / value;
				}
			} else if(this.parent == this.parent.application.__window) {
				this.parent.application.__backend.framePeriod = 1000;
			}
		}
		return value;
	}
	,setFullscreen: function(value) {
		if(value) {
			if(!this.requestedFullscreen && !this.isFullscreen) {
				this.requestedFullscreen = true;
				if(($_=this.parent.element,$bind($_,$_.requestFullscreen))) {
					document.addEventListener("fullscreenchange",$bind(this,this.handleFullscreenEvent),false);
					document.addEventListener("fullscreenerror",$bind(this,this.handleFullscreenEvent),false);
					this.parent.element.requestFullscreen();
				} else if(this.parent.element.mozRequestFullScreen) {
					document.addEventListener("mozfullscreenchange",$bind(this,this.handleFullscreenEvent),false);
					document.addEventListener("mozfullscreenerror",$bind(this,this.handleFullscreenEvent),false);
					this.parent.element.mozRequestFullScreen();
				} else if(this.parent.element.webkitRequestFullscreen) {
					document.addEventListener("webkitfullscreenchange",$bind(this,this.handleFullscreenEvent),false);
					document.addEventListener("webkitfullscreenerror",$bind(this,this.handleFullscreenEvent),false);
					this.parent.element.webkitRequestFullscreen();
				} else if(this.parent.element.msRequestFullscreen) {
					document.addEventListener("MSFullscreenChange",$bind(this,this.handleFullscreenEvent),false);
					document.addEventListener("MSFullscreenError",$bind(this,this.handleFullscreenEvent),false);
					this.parent.element.msRequestFullscreen();
				}
			}
		} else if(this.isFullscreen) {
			this.requestedFullscreen = false;
			if(document.exitFullscreen) {
				document.exitFullscreen();
			} else if(document.mozCancelFullScreen) {
				document.mozCancelFullScreen();
			} else if(document.webkitExitFullscreen) {
				document.webkitExitFullscreen();
			} else if(document.msExitFullscreen) {
				document.msExitFullscreen();
			}
		}
		return value;
	}
	,setIcon: function(image) {
		lime__$internal_graphics_ImageCanvasUtil.convertToCanvas(image);
		var link = window.document.querySelector("link[rel*='icon']");
		if(link == null) {
			link = window.document.createElement("link");
		}
		link.type = "image/x-icon";
		link.rel = "shortcut icon";
		link.href = image.buffer.get_src().toDataURL("image/x-icon");
		window.document.getElementsByTagName("head")[0].appendChild(link);
	}
	,setMaximized: function(value) {
		return false;
	}
	,setMinimized: function(value) {
		return false;
	}
	,setMouseLock: function(value) {
	}
	,setOpacity: function(value) {
	}
	,setResizable: function(value) {
		return value;
	}
	,setTextInputEnabled: function(value) {
		if(value) {
			if(lime__$internal_backend_html5_HTML5Window.textInput == null) {
				lime__$internal_backend_html5_HTML5Window.textInput = window.document.createElement("input");
				var tmp = $global.navigator.userAgent.indexOf("Android") >= 0 ? "password" : "text";
				lime__$internal_backend_html5_HTML5Window.textInput.type = tmp;
				lime__$internal_backend_html5_HTML5Window.textInput.style.position = "absolute";
				lime__$internal_backend_html5_HTML5Window.textInput.style.opacity = "0";
				lime__$internal_backend_html5_HTML5Window.textInput.style.color = "transparent";
				lime__$internal_backend_html5_HTML5Window.textInput.value = lime__$internal_backend_html5_HTML5Window.dummyCharacter;
				lime__$internal_backend_html5_HTML5Window.textInput.autocapitalize = "off";
				lime__$internal_backend_html5_HTML5Window.textInput.autocorrect = "off";
				lime__$internal_backend_html5_HTML5Window.textInput.autocomplete = "off";
				lime__$internal_backend_html5_HTML5Window.textInput.style.left = "0px";
				lime__$internal_backend_html5_HTML5Window.textInput.style.top = "50%";
				if(new EReg("(iPad|iPhone|iPod).*OS 8_","gi").match(window.navigator.userAgent)) {
					lime__$internal_backend_html5_HTML5Window.textInput.style.fontSize = "0px";
					lime__$internal_backend_html5_HTML5Window.textInput.style.width = "0px";
					lime__$internal_backend_html5_HTML5Window.textInput.style.height = "0px";
				} else {
					lime__$internal_backend_html5_HTML5Window.textInput.style.width = "1px";
					lime__$internal_backend_html5_HTML5Window.textInput.style.height = "1px";
				}
				lime__$internal_backend_html5_HTML5Window.textInput.style.pointerEvents = "none";
				lime__$internal_backend_html5_HTML5Window.textInput.style.zIndex = "-10000000";
			}
			if(lime__$internal_backend_html5_HTML5Window.textInput.parentNode == null) {
				this.parent.element.appendChild(lime__$internal_backend_html5_HTML5Window.textInput);
			}
			if(!this.textInputEnabled) {
				lime__$internal_backend_html5_HTML5Window.textInput.addEventListener("input",$bind(this,this.handleInputEvent),true);
				lime__$internal_backend_html5_HTML5Window.textInput.addEventListener("blur",$bind(this,this.handleFocusEvent),true);
				lime__$internal_backend_html5_HTML5Window.textInput.addEventListener("cut",$bind(this,this.handleCutOrCopyEvent),true);
				lime__$internal_backend_html5_HTML5Window.textInput.addEventListener("copy",$bind(this,this.handleCutOrCopyEvent),true);
				lime__$internal_backend_html5_HTML5Window.textInput.addEventListener("paste",$bind(this,this.handlePasteEvent),true);
				lime__$internal_backend_html5_HTML5Window.textInput.addEventListener("compositionstart",$bind(this,this.handleCompositionstartEvent),true);
				lime__$internal_backend_html5_HTML5Window.textInput.addEventListener("compositionend",$bind(this,this.handleCompositionendEvent),true);
			}
			lime__$internal_backend_html5_HTML5Window.textInput.focus();
			lime__$internal_backend_html5_HTML5Window.textInput.select();
		} else if(lime__$internal_backend_html5_HTML5Window.textInput != null) {
			lime__$internal_backend_html5_HTML5Window.textInput.blur();
			lime__$internal_backend_html5_HTML5Window.textInput.removeEventListener("input",$bind(this,this.handleInputEvent),true);
			lime__$internal_backend_html5_HTML5Window.textInput.removeEventListener("blur",$bind(this,this.handleFocusEvent),true);
			lime__$internal_backend_html5_HTML5Window.textInput.removeEventListener("cut",$bind(this,this.handleCutOrCopyEvent),true);
			lime__$internal_backend_html5_HTML5Window.textInput.removeEventListener("copy",$bind(this,this.handleCutOrCopyEvent),true);
			lime__$internal_backend_html5_HTML5Window.textInput.removeEventListener("paste",$bind(this,this.handlePasteEvent),true);
			lime__$internal_backend_html5_HTML5Window.textInput.removeEventListener("compositionstart",$bind(this,this.handleCompositionstartEvent),true);
			lime__$internal_backend_html5_HTML5Window.textInput.removeEventListener("compositionend",$bind(this,this.handleCompositionendEvent),true);
		}
		return this.textInputEnabled = value;
	}
	,setTextInputRect: function(value) {
		return this.textInputRect = value;
	}
	,imeCompositionActive: null
	,handleCompositionstartEvent: function(e) {
		this.imeCompositionActive = true;
	}
	,handleCompositionendEvent: function(e) {
		this.imeCompositionActive = false;
		this.handleInputEvent(e);
	}
	,setTitle: function(value) {
		if(value != null) {
			window.document.title = value;
		}
		return value;
	}
	,setVisible: function(value) {
		return value;
	}
	,updateSize: function() {
		if(!this.parent.__resizable) {
			return;
		}
		var elementWidth;
		var elementHeight;
		if(this.parent.element != null) {
			elementWidth = this.parent.element.clientWidth;
			elementHeight = this.parent.element.clientHeight;
		} else {
			elementWidth = window.innerWidth;
			elementHeight = window.innerHeight;
		}
		if(elementWidth != this.cacheElementWidth || elementHeight != this.cacheElementHeight) {
			this.cacheElementWidth = elementWidth;
			this.cacheElementHeight = elementHeight;
			var stretch = this.resizeElement || this.setWidth == 0 && this.setHeight == 0;
			if(this.parent.element != null && (this.div == null || this.div != null && stretch)) {
				if(stretch) {
					if(this.parent.__width != elementWidth || this.parent.__height != elementHeight) {
						this.parent.__width = elementWidth | 0;
						this.parent.__height = elementHeight | 0;
						if(this.canvas != null) {
							if(this.parent.element != this.canvas) {
								this.canvas.width = Math.round(elementWidth * this.scale);
								this.canvas.height = Math.round(elementHeight * this.scale);
								this.canvas.style.width = elementWidth + "px";
								this.canvas.style.height = elementHeight + "px";
							}
						} else {
							this.div.style.width = elementWidth + "px";
							this.div.style.height = elementHeight + "px";
						}
						this.parent.onResize.dispatch(elementWidth | 0,elementHeight | 0);
					}
				} else {
					var scaleX = this.setWidth != 0 ? elementWidth / this.setWidth : 1;
					var scaleY = this.setHeight != 0 ? elementHeight / this.setHeight : 1;
					var targetWidth = elementWidth;
					var targetHeight = elementHeight;
					var marginLeft = 0;
					var marginTop = 0;
					if(scaleX < scaleY) {
						targetHeight = Math.floor(this.setHeight * scaleX);
						marginTop = Math.floor((elementHeight - targetHeight) / 2);
					} else {
						targetWidth = Math.floor(this.setWidth * scaleY);
						marginLeft = Math.floor((elementWidth - targetWidth) / 2);
					}
					if(this.canvas != null) {
						if(this.parent.element != this.canvas) {
							this.canvas.style.width = targetWidth + "px";
							this.canvas.style.height = targetHeight + "px";
							this.canvas.style.marginLeft = marginLeft + "px";
							this.canvas.style.marginTop = marginTop + "px";
						}
					} else {
						this.div.style.width = targetWidth + "px";
						this.div.style.height = targetHeight + "px";
						this.div.style.marginLeft = marginLeft + "px";
						this.div.style.marginTop = marginTop + "px";
					}
				}
			}
		}
	}
	,warpMouse: function(x,y) {
	}
	,__class__: lime__$internal_backend_html5_HTML5Window
};
var lime__$internal_backend_native_NativeCFFI = function() { };
$hxClasses["lime._internal.backend.native.NativeCFFI"] = lime__$internal_backend_native_NativeCFFI;
lime__$internal_backend_native_NativeCFFI.__name__ = "lime._internal.backend.native.NativeCFFI";
var lime__$internal_format_BMP = function() { };
$hxClasses["lime._internal.format.BMP"] = lime__$internal_format_BMP;
lime__$internal_format_BMP.__name__ = "lime._internal.format.BMP";
lime__$internal_format_BMP.encode = function(image,type) {
	if(image.get_premultiplied() || image.get_format() != 0) {
		image = image.clone();
		image.set_premultiplied(false);
		image.set_format(0);
	}
	if(type == null) {
		type = lime__$internal_format_BMPType.RGB;
	}
	var fileHeaderLength = 14;
	var infoHeaderLength = 40;
	var pixelValuesLength = image.width * image.height * 4;
	if(type != null) {
		switch(type._hx_index) {
		case 0:
			pixelValuesLength = (image.width * 3 + image.width * 3 % 4) * image.height;
			break;
		case 1:
			infoHeaderLength = 108;
			break;
		case 2:
			fileHeaderLength = 0;
			pixelValuesLength += image.width * image.height;
			break;
		}
	}
	var data = new haxe_io_Bytes(new ArrayBuffer(fileHeaderLength + infoHeaderLength + pixelValuesLength));
	var position = 0;
	if(fileHeaderLength > 0) {
		data.b[position++] = 66;
		data.b[position++] = 77;
		data.setInt32(position,data.length);
		position += 4;
		data.setUInt16(position,0);
		position += 2;
		data.setUInt16(position,0);
		position += 2;
		data.setInt32(position,fileHeaderLength + infoHeaderLength);
		position += 4;
	}
	data.setInt32(position,infoHeaderLength);
	position += 4;
	data.setInt32(position,image.width);
	position += 4;
	data.setInt32(position,type == lime__$internal_format_BMPType.ICO ? image.height * 2 : image.height);
	position += 4;
	data.setUInt16(position,1);
	position += 2;
	data.setUInt16(position,type == lime__$internal_format_BMPType.RGB ? 24 : 32);
	position += 2;
	data.setInt32(position,type == lime__$internal_format_BMPType.BITFIELD ? 3 : 0);
	position += 4;
	data.setInt32(position,pixelValuesLength);
	position += 4;
	data.setInt32(position,11824);
	position += 4;
	data.setInt32(position,11824);
	position += 4;
	data.setInt32(position,0);
	position += 4;
	data.setInt32(position,0);
	position += 4;
	if(type == lime__$internal_format_BMPType.BITFIELD) {
		data.setInt32(position,16711680);
		position += 4;
		data.setInt32(position,65280);
		position += 4;
		data.setInt32(position,255);
		position += 4;
		data.setInt32(position,-16777216);
		position += 4;
		data.b[position++] = 32;
		data.b[position++] = 110;
		data.b[position++] = 105;
		data.b[position++] = 87;
		var _g = 0;
		while(_g < 48) {
			var i = _g++;
			data.b[position++] = 0;
		}
	}
	var pixels = image.getPixels(new lime_math_Rectangle(0,0,image.width,image.height),1);
	var readPosition = 0;
	var a;
	var r;
	var g;
	var b;
	if(type != null) {
		switch(type._hx_index) {
		case 0:
			var _g = 0;
			var _g1 = image.height;
			while(_g < _g1) {
				var y = _g++;
				readPosition = (image.height - 1 - y) * 4 * image.width;
				var _g2 = 0;
				var _g3 = image.width;
				while(_g2 < _g3) {
					var x = _g2++;
					a = pixels.b[readPosition++];
					r = pixels.b[readPosition++];
					g = pixels.b[readPosition++];
					b = pixels.b[readPosition++];
					data.b[position++] = b;
					data.b[position++] = g;
					data.b[position++] = r;
				}
				var _g4 = 0;
				var _g5 = image.width * 3 % 4;
				while(_g4 < _g5) {
					var i = _g4++;
					data.b[position++] = 0;
				}
			}
			break;
		case 1:
			var _g = 0;
			var _g1 = image.height;
			while(_g < _g1) {
				var y = _g++;
				readPosition = (image.height - 1 - y) * 4 * image.width;
				var _g2 = 0;
				var _g3 = image.width;
				while(_g2 < _g3) {
					var x = _g2++;
					a = pixels.b[readPosition++];
					r = pixels.b[readPosition++];
					g = pixels.b[readPosition++];
					b = pixels.b[readPosition++];
					data.b[position++] = b;
					data.b[position++] = g;
					data.b[position++] = r;
					data.b[position++] = a;
				}
			}
			break;
		case 2:
			var andMask = new haxe_io_Bytes(new ArrayBuffer(image.width * image.height));
			var maskPosition = 0;
			var _g = 0;
			var _g1 = image.height;
			while(_g < _g1) {
				var y = _g++;
				readPosition = (image.height - 1 - y) * 4 * image.width;
				var _g2 = 0;
				var _g3 = image.width;
				while(_g2 < _g3) {
					var x = _g2++;
					a = pixels.b[readPosition++];
					r = pixels.b[readPosition++];
					g = pixels.b[readPosition++];
					b = pixels.b[readPosition++];
					data.b[position++] = b;
					data.b[position++] = g;
					data.b[position++] = r;
					data.b[position++] = a;
					andMask.b[maskPosition++] = 0;
				}
			}
			data.blit(position,andMask,0,image.width * image.height);
			break;
		}
	}
	return data;
};
var lime__$internal_format_BMPType = $hxEnums["lime._internal.format.BMPType"] = { __ename__:"lime._internal.format.BMPType",__constructs__:null
	,RGB: {_hx_name:"RGB",_hx_index:0,__enum__:"lime._internal.format.BMPType",toString:$estr}
	,BITFIELD: {_hx_name:"BITFIELD",_hx_index:1,__enum__:"lime._internal.format.BMPType",toString:$estr}
	,ICO: {_hx_name:"ICO",_hx_index:2,__enum__:"lime._internal.format.BMPType",toString:$estr}
};
lime__$internal_format_BMPType.__constructs__ = [lime__$internal_format_BMPType.RGB,lime__$internal_format_BMPType.BITFIELD,lime__$internal_format_BMPType.ICO];
var lime__$internal_format_Base64 = function() { };
$hxClasses["lime._internal.format.Base64"] = lime__$internal_format_Base64;
lime__$internal_format_Base64.__name__ = "lime._internal.format.Base64";
lime__$internal_format_Base64.decode = function(source) {
	return haxe_crypto_Base64.decode(source);
};
lime__$internal_format_Base64.encode = function(source) {
	var result = [];
	var dictionary = lime__$internal_format_Base64.DICTIONARY;
	var extendedDictionary = lime__$internal_format_Base64.EXTENDED_DICTIONARY;
	var numBytes = source.length;
	var numInputTriplets = Math.floor(numBytes / 3);
	var numChunksToWrite = numInputTriplets * 2;
	result.length = Math.ceil(numBytes / 3) * 2;
	var numBytesRead = 0;
	var numChunksWritten = 0;
	var inputTriplet;
	while(numChunksWritten < numChunksToWrite) {
		inputTriplet = source.b[numBytesRead] << 16 | source.b[numBytesRead + 1] << 8 | source.b[numBytesRead + 2];
		result[numChunksWritten] = extendedDictionary[inputTriplet >> 12 & 4095];
		result[numChunksWritten + 1] = extendedDictionary[inputTriplet & 4095];
		numBytesRead += 3;
		numChunksWritten += 2;
	}
	switch(numBytes - numInputTriplets * 3) {
	case 1:
		inputTriplet = source.b[numBytesRead] << 16;
		result[numChunksWritten] = extendedDictionary[inputTriplet >> 12 & 4095];
		result[numChunksWritten + 1] = "==";
		break;
	case 2:
		inputTriplet = source.b[numBytesRead] << 16 | source.b[numBytesRead + 1] << 8;
		result[numChunksWritten] = extendedDictionary[inputTriplet >> 12 & 4095];
		result[numChunksWritten + 1] = dictionary[inputTriplet >> 6 & 63] + "=";
		break;
	default:
	}
	return result.join("");
};
var lime__$internal_format_Deflate = function() { };
$hxClasses["lime._internal.format.Deflate"] = lime__$internal_format_Deflate;
lime__$internal_format_Deflate.__name__ = "lime._internal.format.Deflate";
lime__$internal_format_Deflate.compress = function(bytes) {
	var data = pako.deflateRaw(bytes.b.bufferValue);
	return haxe_io_Bytes.ofData(data);
};
lime__$internal_format_Deflate.decompress = function(bytes) {
	var data = pako.inflateRaw(bytes.b.bufferValue);
	return haxe_io_Bytes.ofData(data);
};
var lime__$internal_format_GZip = function() { };
$hxClasses["lime._internal.format.GZip"] = lime__$internal_format_GZip;
lime__$internal_format_GZip.__name__ = "lime._internal.format.GZip";
lime__$internal_format_GZip.compress = function(bytes) {
	var data = pako.gzip(bytes.b.bufferValue);
	return haxe_io_Bytes.ofData(data);
};
lime__$internal_format_GZip.decompress = function(bytes) {
	var data = pako.ungzip(bytes.b.bufferValue);
	return haxe_io_Bytes.ofData(data);
};
var lime__$internal_format_JPEG = function() { };
$hxClasses["lime._internal.format.JPEG"] = lime__$internal_format_JPEG;
lime__$internal_format_JPEG.__name__ = "lime._internal.format.JPEG";
lime__$internal_format_JPEG.decodeBytes = function(bytes,decodeData) {
	if(decodeData == null) {
		decodeData = true;
	}
	return null;
};
lime__$internal_format_JPEG.decodeFile = function(path,decodeData) {
	if(decodeData == null) {
		decodeData = true;
	}
	return null;
};
lime__$internal_format_JPEG.encode = function(image,quality) {
	if(image.get_premultiplied() || image.get_format() != 0) {
		image = image.clone();
		image.set_premultiplied(false);
		image.set_format(0);
	}
	lime__$internal_graphics_ImageCanvasUtil.convertToCanvas(image,false);
	if(image.buffer.__srcCanvas != null) {
		var data = image.buffer.__srcCanvas.toDataURL("image/jpeg",quality / 100);
		var buffer = window.atob(data.split(";base64,")[1]);
		var bytes = new haxe_io_Bytes(new ArrayBuffer(buffer.length));
		var _g = 0;
		var _g1 = buffer.length;
		while(_g < _g1) {
			var i = _g++;
			bytes.b[i] = HxOverrides.cca(buffer,i);
		}
		return bytes;
	}
	return null;
};
var lime__$internal_format_LZMA = function() { };
$hxClasses["lime._internal.format.LZMA"] = lime__$internal_format_LZMA;
lime__$internal_format_LZMA.__name__ = "lime._internal.format.LZMA";
lime__$internal_format_LZMA.compress = function(bytes) {
	var data = LZMA.compress;
	var elements = null;
	var array = null;
	var vector = null;
	var view = null;
	var buffer = bytes.b.bufferValue;
	var len = null;
	var this1;
	if(elements != null) {
		this1 = new Uint8Array(elements);
	} else if(array != null) {
		this1 = new Uint8Array(array);
	} else if(vector != null) {
		this1 = new Uint8Array(vector.__array);
	} else if(view != null) {
		this1 = new Uint8Array(view);
	} else if(buffer != null) {
		if(len == null) {
			this1 = new Uint8Array(buffer,0);
		} else {
			this1 = new Uint8Array(buffer,0,len);
		}
	} else {
		this1 = null;
	}
	var data1 = data(this1,5);
	if(typeof(data1) == "string") {
		return haxe_io_Bytes.ofString(data1);
	} else {
		return haxe_io_Bytes.ofData(data1);
	}
};
lime__$internal_format_LZMA.decompress = function(bytes) {
	var data = LZMA.decompress;
	var elements = null;
	var array = null;
	var vector = null;
	var view = null;
	var buffer = bytes.b.bufferValue;
	var len = null;
	var this1;
	if(elements != null) {
		this1 = new Uint8Array(elements);
	} else if(array != null) {
		this1 = new Uint8Array(array);
	} else if(vector != null) {
		this1 = new Uint8Array(vector.__array);
	} else if(view != null) {
		this1 = new Uint8Array(view);
	} else if(buffer != null) {
		if(len == null) {
			this1 = new Uint8Array(buffer,0);
		} else {
			this1 = new Uint8Array(buffer,0,len);
		}
	} else {
		this1 = null;
	}
	var data1 = data(this1);
	if(typeof(data1) == "string") {
		return haxe_io_Bytes.ofString(data1);
	} else {
		return haxe_io_Bytes.ofData(data1);
	}
};
var lime__$internal_format_PNG = function() { };
$hxClasses["lime._internal.format.PNG"] = lime__$internal_format_PNG;
lime__$internal_format_PNG.__name__ = "lime._internal.format.PNG";
lime__$internal_format_PNG.decodeBytes = function(bytes,decodeData) {
	if(decodeData == null) {
		decodeData = true;
	}
	return null;
};
lime__$internal_format_PNG.decodeFile = function(path,decodeData) {
	if(decodeData == null) {
		decodeData = true;
	}
	return null;
};
lime__$internal_format_PNG.encode = function(image) {
	if(image.get_premultiplied() || image.get_format() != 0) {
		image = image.clone();
		image.set_premultiplied(false);
		image.set_format(0);
	}
	lime__$internal_graphics_ImageCanvasUtil.convertToCanvas(image,false);
	if(image.buffer.__srcCanvas != null) {
		var data = image.buffer.__srcCanvas.toDataURL("image/png");
		var buffer = window.atob(data.split(";base64,")[1]);
		var bytes = new haxe_io_Bytes(new ArrayBuffer(buffer.length));
		var _g = 0;
		var _g1 = buffer.length;
		while(_g < _g1) {
			var i = _g++;
			bytes.b[i] = HxOverrides.cca(buffer,i);
		}
		return bytes;
	}
	return null;
};
var lime__$internal_format_Zlib = function() { };
$hxClasses["lime._internal.format.Zlib"] = lime__$internal_format_Zlib;
lime__$internal_format_Zlib.__name__ = "lime._internal.format.Zlib";
lime__$internal_format_Zlib.compress = function(bytes) {
	var data = pako.deflate(bytes.b.bufferValue);
	return haxe_io_Bytes.ofData(data);
};
lime__$internal_format_Zlib.decompress = function(bytes) {
	var data = pako.inflate(bytes.b.bufferValue);
	return haxe_io_Bytes.ofData(data);
};
var lime__$internal_graphics_ImageCanvasUtil = function() { };
$hxClasses["lime._internal.graphics.ImageCanvasUtil"] = lime__$internal_graphics_ImageCanvasUtil;
lime__$internal_graphics_ImageCanvasUtil.__name__ = "lime._internal.graphics.ImageCanvasUtil";
lime__$internal_graphics_ImageCanvasUtil.colorTransform = function(image,rect,colorMatrix) {
	lime__$internal_graphics_ImageCanvasUtil.convertToData(image);
	lime__$internal_graphics_ImageDataUtil.colorTransform(image,rect,colorMatrix);
};
lime__$internal_graphics_ImageCanvasUtil.convertToCanvas = function(image,clear) {
	if(clear == null) {
		clear = false;
	}
	var buffer = image.buffer;
	if(buffer.__srcImage != null) {
		if(buffer.__srcCanvas == null) {
			lime__$internal_graphics_ImageCanvasUtil.createCanvas(image,buffer.__srcImage.width,buffer.__srcImage.height);
			buffer.__srcContext.drawImage(buffer.__srcImage,0,0);
		}
		buffer.__srcImage = null;
	} else if(buffer.__srcCanvas == null && buffer.data != null) {
		image.set_transparent(true);
		lime__$internal_graphics_ImageCanvasUtil.createCanvas(image,buffer.width,buffer.height);
		lime__$internal_graphics_ImageCanvasUtil.createImageData(image);
		buffer.__srcContext.putImageData(buffer.__srcImageData,0,0);
	} else if(image.type == lime_graphics_ImageType.DATA && buffer.__srcImageData != null && image.dirty) {
		buffer.__srcContext.putImageData(buffer.__srcImageData,0,0);
		image.dirty = false;
	}
	if(clear) {
		buffer.data = null;
		buffer.__srcImageData = null;
	} else if(buffer.data == null && buffer.__srcImageData != null) {
		buffer.data = buffer.__srcImageData.data;
	}
	image.type = lime_graphics_ImageType.CANVAS;
};
lime__$internal_graphics_ImageCanvasUtil.convertToData = function(image,clear) {
	if(clear == null) {
		clear = false;
	}
	var buffer = image.buffer;
	if(buffer.__srcImage != null) {
		lime__$internal_graphics_ImageCanvasUtil.convertToCanvas(image);
	}
	if(buffer.__srcCanvas != null && buffer.data == null) {
		lime__$internal_graphics_ImageCanvasUtil.createImageData(image);
		if(image.type == lime_graphics_ImageType.CANVAS) {
			image.dirty = false;
		}
	} else if(image.type == lime_graphics_ImageType.CANVAS && buffer.__srcCanvas != null && image.dirty) {
		if(buffer.__srcImageData == null) {
			lime__$internal_graphics_ImageCanvasUtil.createImageData(image);
		} else {
			buffer.__srcImageData = buffer.__srcContext.getImageData(0,0,buffer.width,buffer.height);
			var elements = buffer.__srcImageData.data.buffer;
			var array = null;
			var vector = null;
			var view = null;
			var buffer1 = null;
			var len = null;
			var this1;
			if(elements != null) {
				this1 = new Uint8Array(elements);
			} else if(array != null) {
				this1 = new Uint8Array(array);
			} else if(vector != null) {
				this1 = new Uint8Array(vector.__array);
			} else if(view != null) {
				this1 = new Uint8Array(view);
			} else if(buffer1 != null) {
				if(len == null) {
					this1 = new Uint8Array(buffer1,0);
				} else {
					this1 = new Uint8Array(buffer1,0,len);
				}
			} else {
				this1 = null;
			}
			buffer.data = this1;
		}
		image.dirty = false;
	}
	if(clear) {
		image.buffer.__srcCanvas = null;
		image.buffer.__srcContext = null;
	}
	image.type = lime_graphics_ImageType.DATA;
};
lime__$internal_graphics_ImageCanvasUtil.copyChannel = function(image,sourceImage,sourceRect,destPoint,sourceChannel,destChannel) {
	lime__$internal_graphics_ImageCanvasUtil.convertToData(sourceImage);
	lime__$internal_graphics_ImageCanvasUtil.convertToData(image);
	lime__$internal_graphics_ImageDataUtil.copyChannel(image,sourceImage,sourceRect,destPoint,sourceChannel,destChannel);
};
lime__$internal_graphics_ImageCanvasUtil.copyPixels = function(image,sourceImage,sourceRect,destPoint,alphaImage,alphaPoint,mergeAlpha) {
	if(mergeAlpha == null) {
		mergeAlpha = false;
	}
	if(destPoint == null || destPoint.x >= image.width || destPoint.y >= image.height || sourceRect == null || sourceRect.width < 1 || sourceRect.height < 1) {
		return;
	}
	if(alphaImage != null && alphaImage.get_transparent()) {
		if(alphaPoint == null) {
			alphaPoint = new lime_math_Vector2();
		}
		var tempData = sourceImage.clone();
		tempData.copyChannel(alphaImage,new lime_math_Rectangle(sourceRect.x + alphaPoint.x,sourceRect.y + alphaPoint.y,sourceRect.width,sourceRect.height),new lime_math_Vector2(sourceRect.x,sourceRect.y),lime_graphics_ImageChannel.ALPHA,lime_graphics_ImageChannel.ALPHA);
		sourceImage = tempData;
	}
	lime__$internal_graphics_ImageCanvasUtil.convertToCanvas(image,true);
	if(!mergeAlpha) {
		if(image.get_transparent() && sourceImage.get_transparent()) {
			image.buffer.__srcContext.clearRect(destPoint.x + image.offsetX,destPoint.y + image.offsetY,sourceRect.width + image.offsetX,sourceRect.height + image.offsetY);
		}
	}
	lime__$internal_graphics_ImageCanvasUtil.convertToCanvas(sourceImage);
	if(sourceImage.buffer.get_src() != null) {
		image.buffer.__srcContext.globalCompositeOperation = "source-over";
		image.buffer.__srcContext.drawImage(sourceImage.buffer.get_src(),sourceRect.x + sourceImage.offsetX | 0,sourceRect.y + sourceImage.offsetY | 0,sourceRect.width | 0,sourceRect.height | 0,destPoint.x + image.offsetX | 0,destPoint.y + image.offsetY | 0,sourceRect.width | 0,sourceRect.height | 0);
	}
	image.dirty = true;
	image.version++;
};
lime__$internal_graphics_ImageCanvasUtil.createCanvas = function(image,width,height) {
	var buffer = image.buffer;
	if(buffer.__srcCanvas == null) {
		buffer.__srcCanvas = window.document.createElement("canvas");
		buffer.__srcCanvas.width = width;
		buffer.__srcCanvas.height = height;
		if(!image.get_transparent()) {
			buffer.__srcCanvas.setAttribute("moz-opaque","true");
		}
		buffer.__srcContext = buffer.__srcCanvas.getContext("2d",{ alpha : image.get_transparent()});
	}
};
lime__$internal_graphics_ImageCanvasUtil.createImageData = function(image) {
	var buffer = image.buffer;
	if(buffer.__srcImageData == null) {
		if(buffer.data == null) {
			buffer.__srcImageData = buffer.__srcContext.getImageData(0,0,buffer.width,buffer.height);
		} else {
			buffer.__srcImageData = buffer.__srcContext.createImageData(buffer.width,buffer.height);
			buffer.__srcImageData.data.set(buffer.data);
		}
		var elements = buffer.__srcImageData.data.buffer;
		var array = null;
		var vector = null;
		var view = null;
		var buffer1 = null;
		var len = null;
		var this1;
		if(elements != null) {
			this1 = new Uint8Array(elements);
		} else if(array != null) {
			this1 = new Uint8Array(array);
		} else if(vector != null) {
			this1 = new Uint8Array(vector.__array);
		} else if(view != null) {
			this1 = new Uint8Array(view);
		} else if(buffer1 != null) {
			if(len == null) {
				this1 = new Uint8Array(buffer1,0);
			} else {
				this1 = new Uint8Array(buffer1,0,len);
			}
		} else {
			this1 = null;
		}
		buffer.data = this1;
	}
};
lime__$internal_graphics_ImageCanvasUtil.fillRect = function(image,rect,color,format) {
	lime__$internal_graphics_ImageCanvasUtil.convertToCanvas(image);
	var r;
	var g;
	var b;
	var a;
	if(format == 1) {
		r = color >> 16 & 255;
		g = color >> 8 & 255;
		b = color & 255;
		a = image.get_transparent() ? color >> 24 & 255 : 255;
	} else {
		r = color >> 24 & 255;
		g = color >> 16 & 255;
		b = color >> 8 & 255;
		a = image.get_transparent() ? color & 255 : 255;
	}
	if(rect.x == 0 && rect.y == 0 && rect.width == image.width && rect.height == image.height) {
		if(image.get_transparent() && a == 0) {
			image.buffer.__srcCanvas.width = image.buffer.width;
			return;
		}
	}
	if(a < 255) {
		image.buffer.__srcContext.clearRect(rect.x + image.offsetX,rect.y + image.offsetY,rect.width + image.offsetX,rect.height + image.offsetY);
	}
	if(a > 0) {
		image.buffer.__srcContext.fillStyle = "rgba(" + r + ", " + g + ", " + b + ", " + a / 255 + ")";
		image.buffer.__srcContext.fillRect(rect.x + image.offsetX,rect.y + image.offsetY,rect.width + image.offsetX,rect.height + image.offsetY);
	}
	image.dirty = true;
	image.version++;
};
lime__$internal_graphics_ImageCanvasUtil.floodFill = function(image,x,y,color,format) {
	lime__$internal_graphics_ImageCanvasUtil.convertToData(image);
	lime__$internal_graphics_ImageDataUtil.floodFill(image,x,y,color,format);
};
lime__$internal_graphics_ImageCanvasUtil.getPixel = function(image,x,y,format) {
	lime__$internal_graphics_ImageCanvasUtil.convertToData(image);
	return lime__$internal_graphics_ImageDataUtil.getPixel(image,x,y,format);
};
lime__$internal_graphics_ImageCanvasUtil.getPixel32 = function(image,x,y,format) {
	lime__$internal_graphics_ImageCanvasUtil.convertToData(image);
	return lime__$internal_graphics_ImageDataUtil.getPixel32(image,x,y,format);
};
lime__$internal_graphics_ImageCanvasUtil.getPixels = function(image,rect,format) {
	lime__$internal_graphics_ImageCanvasUtil.convertToData(image);
	return lime__$internal_graphics_ImageDataUtil.getPixels(image,rect,format);
};
lime__$internal_graphics_ImageCanvasUtil.merge = function(image,sourceImage,sourceRect,destPoint,redMultiplier,greenMultiplier,blueMultiplier,alphaMultiplier) {
	lime__$internal_graphics_ImageCanvasUtil.convertToData(sourceImage);
	lime__$internal_graphics_ImageCanvasUtil.convertToData(image);
	lime__$internal_graphics_ImageDataUtil.merge(image,sourceImage,sourceRect,destPoint,redMultiplier,greenMultiplier,blueMultiplier,alphaMultiplier);
};
lime__$internal_graphics_ImageCanvasUtil.resize = function(image,newWidth,newHeight) {
	var buffer = image.buffer;
	if(buffer.__srcCanvas == null) {
		lime__$internal_graphics_ImageCanvasUtil.createCanvas(image,newWidth,newHeight);
		buffer.__srcContext.drawImage(buffer.get_src(),0,0,newWidth,newHeight);
	} else {
		lime__$internal_graphics_ImageCanvasUtil.convertToCanvas(image,true);
		var sourceCanvas = buffer.__srcCanvas;
		buffer.__srcCanvas = null;
		lime__$internal_graphics_ImageCanvasUtil.createCanvas(image,newWidth,newHeight);
		buffer.__srcContext.drawImage(sourceCanvas,0,0,newWidth,newHeight);
	}
	buffer.__srcImageData = null;
	buffer.data = null;
	image.dirty = true;
	image.version++;
};
lime__$internal_graphics_ImageCanvasUtil.scroll = function(image,x,y) {
	if(x % image.width == 0 && y % image.height == 0) {
		return;
	}
	var copy = image.clone();
	lime__$internal_graphics_ImageCanvasUtil.convertToCanvas(image,true);
	image.buffer.__srcContext.clearRect(x,y,image.width,image.height);
	image.buffer.__srcContext.drawImage(copy.get_src(),x,y);
	image.dirty = true;
	image.version++;
};
lime__$internal_graphics_ImageCanvasUtil.setPixel = function(image,x,y,color,format) {
	lime__$internal_graphics_ImageCanvasUtil.convertToData(image);
	lime__$internal_graphics_ImageDataUtil.setPixel(image,x,y,color,format);
};
lime__$internal_graphics_ImageCanvasUtil.setPixel32 = function(image,x,y,color,format) {
	lime__$internal_graphics_ImageCanvasUtil.convertToData(image);
	lime__$internal_graphics_ImageDataUtil.setPixel32(image,x,y,color,format);
};
lime__$internal_graphics_ImageCanvasUtil.setPixels = function(image,rect,bytePointer,format,endian) {
	lime__$internal_graphics_ImageCanvasUtil.convertToData(image);
	lime__$internal_graphics_ImageDataUtil.setPixels(image,rect,bytePointer,format,endian);
};
lime__$internal_graphics_ImageCanvasUtil.sync = function(image,clear) {
	if(image == null) {
		return;
	}
	if(image.type == lime_graphics_ImageType.CANVAS && (image.buffer.__srcCanvas != null || image.buffer.data != null)) {
		lime__$internal_graphics_ImageCanvasUtil.convertToCanvas(image,clear);
	} else if(image.type == lime_graphics_ImageType.DATA) {
		lime__$internal_graphics_ImageCanvasUtil.convertToData(image,clear);
	}
};
var lime__$internal_graphics_ImageDataUtil = function() { };
$hxClasses["lime._internal.graphics.ImageDataUtil"] = lime__$internal_graphics_ImageDataUtil;
lime__$internal_graphics_ImageDataUtil.__name__ = "lime._internal.graphics.ImageDataUtil";
lime__$internal_graphics_ImageDataUtil.displaceMap = function(target,source,map,mapPoint,componentX,componentY,smooth) {
	var targetData = target.buffer.data;
	var sourceData = source.buffer.data;
	var mapData = map.buffer.data;
	var targetFormat = target.buffer.format;
	var sourceFormat = source.buffer.format;
	var mapFormat = map.buffer.format;
	var targetPremultiplied = target.get_premultiplied();
	var sourcePremultiplied = source.get_premultiplied();
	var mapPremultiplied = map.get_premultiplied();
	var sourceView = new lime__$internal_graphics__$ImageDataUtil_ImageDataView(source);
	var mapView = new lime__$internal_graphics__$ImageDataUtil_ImageDataView(map);
	var row;
	var sourceOffset;
	var sourcePixel = 0;
	var mapPixel = 0;
	var targetPixel = 0;
	var mapPixelX;
	var mapPixelY;
	var mapPixelA;
	var s1 = 0;
	var s2 = 0;
	var s3 = 0;
	var s4 = 0;
	var mPointXFloor;
	var mPointYFloor;
	var disOffsetXFloor;
	var disOffsetYFloor;
	var disX;
	var disY;
	var _g = 0;
	var _g1 = sourceView.height;
	while(_g < _g1) {
		var y = _g++;
		row = sourceView.byteOffset + sourceView.stride * y;
		var _g2 = 0;
		var _g3 = sourceView.width;
		while(_g2 < _g3) {
			var x = _g2++;
			sourceOffset = row + x * 4;
			mPointXFloor = mapPoint.x | 0;
			mPointYFloor = mapPoint.y | 0;
			if(smooth) {
				var offset = sourceView.byteOffset + sourceView.stride * (y - mPointYFloor + 1) + (x - mPointXFloor) * 4;
				var format = mapFormat;
				var premultiplied = mapPremultiplied;
				if(premultiplied == null) {
					premultiplied = false;
				}
				if(format == null) {
					format = 0;
				}
				switch(format) {
				case 0:
					s1 = (mapData[offset] & 255) << 24 | (mapData[offset + 1] & 255) << 16 | (mapData[offset + 2] & 255) << 8 | mapData[offset + 3] & 255;
					break;
				case 1:
					s1 = (mapData[offset + 1] & 255) << 24 | (mapData[offset + 2] & 255) << 16 | (mapData[offset + 3] & 255) << 8 | mapData[offset] & 255;
					break;
				case 2:
					s1 = (mapData[offset + 2] & 255) << 24 | (mapData[offset + 1] & 255) << 16 | (mapData[offset] & 255) << 8 | mapData[offset + 3] & 255;
					break;
				}
				if(premultiplied) {
					if((s1 & 255) != 0 && (s1 & 255) != 255) {
						lime_math_RGBA.unmult = 255.0 / (s1 & 255);
						s1 = (lime_math_RGBA.__clamp[Math.round((s1 >>> 24 & 255) * lime_math_RGBA.unmult)] & 255) << 24 | (lime_math_RGBA.__clamp[Math.round((s1 >>> 16 & 255) * lime_math_RGBA.unmult)] & 255) << 16 | (lime_math_RGBA.__clamp[Math.round((s1 >>> 8 & 255) * lime_math_RGBA.unmult)] & 255) << 8 | s1 & 255 & 255;
					}
				}
				var offset1 = sourceView.byteOffset + sourceView.stride * (y - mPointYFloor) + (x - mPointXFloor + 1) * 4;
				var format1 = mapFormat;
				var premultiplied1 = mapPremultiplied;
				if(premultiplied1 == null) {
					premultiplied1 = false;
				}
				if(format1 == null) {
					format1 = 0;
				}
				switch(format1) {
				case 0:
					s2 = (mapData[offset1] & 255) << 24 | (mapData[offset1 + 1] & 255) << 16 | (mapData[offset1 + 2] & 255) << 8 | mapData[offset1 + 3] & 255;
					break;
				case 1:
					s2 = (mapData[offset1 + 1] & 255) << 24 | (mapData[offset1 + 2] & 255) << 16 | (mapData[offset1 + 3] & 255) << 8 | mapData[offset1] & 255;
					break;
				case 2:
					s2 = (mapData[offset1 + 2] & 255) << 24 | (mapData[offset1 + 1] & 255) << 16 | (mapData[offset1] & 255) << 8 | mapData[offset1 + 3] & 255;
					break;
				}
				if(premultiplied1) {
					if((s2 & 255) != 0 && (s2 & 255) != 255) {
						lime_math_RGBA.unmult = 255.0 / (s2 & 255);
						s2 = (lime_math_RGBA.__clamp[Math.round((s2 >>> 24 & 255) * lime_math_RGBA.unmult)] & 255) << 24 | (lime_math_RGBA.__clamp[Math.round((s2 >>> 16 & 255) * lime_math_RGBA.unmult)] & 255) << 16 | (lime_math_RGBA.__clamp[Math.round((s2 >>> 8 & 255) * lime_math_RGBA.unmult)] & 255) << 8 | s2 & 255 & 255;
					}
				}
				var offset2 = sourceView.byteOffset + sourceView.stride * (y - mPointYFloor + 1) + (x - mPointXFloor + 1) * 4;
				var format2 = mapFormat;
				var premultiplied2 = mapPremultiplied;
				if(premultiplied2 == null) {
					premultiplied2 = false;
				}
				if(format2 == null) {
					format2 = 0;
				}
				switch(format2) {
				case 0:
					s3 = (mapData[offset2] & 255) << 24 | (mapData[offset2 + 1] & 255) << 16 | (mapData[offset2 + 2] & 255) << 8 | mapData[offset2 + 3] & 255;
					break;
				case 1:
					s3 = (mapData[offset2 + 1] & 255) << 24 | (mapData[offset2 + 2] & 255) << 16 | (mapData[offset2 + 3] & 255) << 8 | mapData[offset2] & 255;
					break;
				case 2:
					s3 = (mapData[offset2 + 2] & 255) << 24 | (mapData[offset2 + 1] & 255) << 16 | (mapData[offset2] & 255) << 8 | mapData[offset2 + 3] & 255;
					break;
				}
				if(premultiplied2) {
					if((s3 & 255) != 0 && (s3 & 255) != 255) {
						lime_math_RGBA.unmult = 255.0 / (s3 & 255);
						s3 = (lime_math_RGBA.__clamp[Math.round((s3 >>> 24 & 255) * lime_math_RGBA.unmult)] & 255) << 24 | (lime_math_RGBA.__clamp[Math.round((s3 >>> 16 & 255) * lime_math_RGBA.unmult)] & 255) << 16 | (lime_math_RGBA.__clamp[Math.round((s3 >>> 8 & 255) * lime_math_RGBA.unmult)] & 255) << 8 | s3 & 255 & 255;
					}
				}
				var offset3 = sourceView.byteOffset + sourceView.stride * (y - mPointYFloor) + (x - mPointXFloor) * 4;
				var format3 = mapFormat;
				var premultiplied3 = mapPremultiplied;
				if(premultiplied3 == null) {
					premultiplied3 = false;
				}
				if(format3 == null) {
					format3 = 0;
				}
				switch(format3) {
				case 0:
					s4 = (mapData[offset3] & 255) << 24 | (mapData[offset3 + 1] & 255) << 16 | (mapData[offset3 + 2] & 255) << 8 | mapData[offset3 + 3] & 255;
					break;
				case 1:
					s4 = (mapData[offset3 + 1] & 255) << 24 | (mapData[offset3 + 2] & 255) << 16 | (mapData[offset3 + 3] & 255) << 8 | mapData[offset3] & 255;
					break;
				case 2:
					s4 = (mapData[offset3 + 2] & 255) << 24 | (mapData[offset3 + 1] & 255) << 16 | (mapData[offset3] & 255) << 8 | mapData[offset3 + 3] & 255;
					break;
				}
				if(premultiplied3) {
					if((s4 & 255) != 0 && (s4 & 255) != 255) {
						lime_math_RGBA.unmult = 255.0 / (s4 & 255);
						s4 = (lime_math_RGBA.__clamp[Math.round((s4 >>> 24 & 255) * lime_math_RGBA.unmult)] & 255) << 24 | (lime_math_RGBA.__clamp[Math.round((s4 >>> 16 & 255) * lime_math_RGBA.unmult)] & 255) << 16 | (lime_math_RGBA.__clamp[Math.round((s4 >>> 8 & 255) * lime_math_RGBA.unmult)] & 255) << 8 | s4 & 255 & 255;
					}
				}
				mapPixel = lime__$internal_graphics_ImageDataUtil.bilinear(s1,s2,s3,s4,mapPoint.x - mPointXFloor,mapPoint.y - mPointYFloor);
			} else {
				var offset4 = mapView.byteOffset + mapView.stride * (y - mPointYFloor) + (x - mPointXFloor) * 4;
				var format4 = mapFormat;
				var premultiplied4 = mapPremultiplied;
				if(premultiplied4 == null) {
					premultiplied4 = false;
				}
				if(format4 == null) {
					format4 = 0;
				}
				switch(format4) {
				case 0:
					mapPixel = (mapData[offset4] & 255) << 24 | (mapData[offset4 + 1] & 255) << 16 | (mapData[offset4 + 2] & 255) << 8 | mapData[offset4 + 3] & 255;
					break;
				case 1:
					mapPixel = (mapData[offset4 + 1] & 255) << 24 | (mapData[offset4 + 2] & 255) << 16 | (mapData[offset4 + 3] & 255) << 8 | mapData[offset4] & 255;
					break;
				case 2:
					mapPixel = (mapData[offset4 + 2] & 255) << 24 | (mapData[offset4 + 1] & 255) << 16 | (mapData[offset4] & 255) << 8 | mapData[offset4 + 3] & 255;
					break;
				}
				if(premultiplied4) {
					if((mapPixel & 255) != 0 && (mapPixel & 255) != 255) {
						lime_math_RGBA.unmult = 255.0 / (mapPixel & 255);
						mapPixel = (lime_math_RGBA.__clamp[Math.round((mapPixel >>> 24 & 255) * lime_math_RGBA.unmult)] & 255) << 24 | (lime_math_RGBA.__clamp[Math.round((mapPixel >>> 16 & 255) * lime_math_RGBA.unmult)] & 255) << 16 | (lime_math_RGBA.__clamp[Math.round((mapPixel >>> 8 & 255) * lime_math_RGBA.unmult)] & 255) << 8 | mapPixel & 255 & 255;
					}
				}
			}
			mapPixelA = (mapPixel & 255) / 255.0;
			mapPixelX = ((mapPixel >>> 24 & 255) - 128) / 255.0 * mapPixelA;
			mapPixelY = ((mapPixel >>> 16 & 255) - 128) / 255.0 * mapPixelA;
			disX = mapPixelX * componentX.x + mapPixelY * componentY.x;
			disY = mapPixelX * componentX.y + mapPixelY * componentY.y;
			disOffsetXFloor = Math.floor(disX * sourceView.width);
			disOffsetYFloor = Math.floor(disY * sourceView.height);
			if(smooth) {
				var offset5 = sourceView.byteOffset + sourceView.stride * (y + disOffsetYFloor + 1) + (x + disOffsetXFloor) * 4;
				var format5 = sourceFormat;
				var premultiplied5 = sourcePremultiplied;
				if(premultiplied5 == null) {
					premultiplied5 = false;
				}
				if(format5 == null) {
					format5 = 0;
				}
				switch(format5) {
				case 0:
					s1 = (sourceData[offset5] & 255) << 24 | (sourceData[offset5 + 1] & 255) << 16 | (sourceData[offset5 + 2] & 255) << 8 | sourceData[offset5 + 3] & 255;
					break;
				case 1:
					s1 = (sourceData[offset5 + 1] & 255) << 24 | (sourceData[offset5 + 2] & 255) << 16 | (sourceData[offset5 + 3] & 255) << 8 | sourceData[offset5] & 255;
					break;
				case 2:
					s1 = (sourceData[offset5 + 2] & 255) << 24 | (sourceData[offset5 + 1] & 255) << 16 | (sourceData[offset5] & 255) << 8 | sourceData[offset5 + 3] & 255;
					break;
				}
				if(premultiplied5) {
					if((s1 & 255) != 0 && (s1 & 255) != 255) {
						lime_math_RGBA.unmult = 255.0 / (s1 & 255);
						s1 = (lime_math_RGBA.__clamp[Math.round((s1 >>> 24 & 255) * lime_math_RGBA.unmult)] & 255) << 24 | (lime_math_RGBA.__clamp[Math.round((s1 >>> 16 & 255) * lime_math_RGBA.unmult)] & 255) << 16 | (lime_math_RGBA.__clamp[Math.round((s1 >>> 8 & 255) * lime_math_RGBA.unmult)] & 255) << 8 | s1 & 255 & 255;
					}
				}
				var offset6 = sourceView.byteOffset + sourceView.stride * (y + disOffsetYFloor) + (x + disOffsetXFloor + 1) * 4;
				var format6 = sourceFormat;
				var premultiplied6 = sourcePremultiplied;
				if(premultiplied6 == null) {
					premultiplied6 = false;
				}
				if(format6 == null) {
					format6 = 0;
				}
				switch(format6) {
				case 0:
					s2 = (sourceData[offset6] & 255) << 24 | (sourceData[offset6 + 1] & 255) << 16 | (sourceData[offset6 + 2] & 255) << 8 | sourceData[offset6 + 3] & 255;
					break;
				case 1:
					s2 = (sourceData[offset6 + 1] & 255) << 24 | (sourceData[offset6 + 2] & 255) << 16 | (sourceData[offset6 + 3] & 255) << 8 | sourceData[offset6] & 255;
					break;
				case 2:
					s2 = (sourceData[offset6 + 2] & 255) << 24 | (sourceData[offset6 + 1] & 255) << 16 | (sourceData[offset6] & 255) << 8 | sourceData[offset6 + 3] & 255;
					break;
				}
				if(premultiplied6) {
					if((s2 & 255) != 0 && (s2 & 255) != 255) {
						lime_math_RGBA.unmult = 255.0 / (s2 & 255);
						s2 = (lime_math_RGBA.__clamp[Math.round((s2 >>> 24 & 255) * lime_math_RGBA.unmult)] & 255) << 24 | (lime_math_RGBA.__clamp[Math.round((s2 >>> 16 & 255) * lime_math_RGBA.unmult)] & 255) << 16 | (lime_math_RGBA.__clamp[Math.round((s2 >>> 8 & 255) * lime_math_RGBA.unmult)] & 255) << 8 | s2 & 255 & 255;
					}
				}
				var offset7 = sourceView.byteOffset + sourceView.stride * (y + disOffsetYFloor + 1) + (x + disOffsetXFloor + 1) * 4;
				var format7 = sourceFormat;
				var premultiplied7 = sourcePremultiplied;
				if(premultiplied7 == null) {
					premultiplied7 = false;
				}
				if(format7 == null) {
					format7 = 0;
				}
				switch(format7) {
				case 0:
					s3 = (sourceData[offset7] & 255) << 24 | (sourceData[offset7 + 1] & 255) << 16 | (sourceData[offset7 + 2] & 255) << 8 | sourceData[offset7 + 3] & 255;
					break;
				case 1:
					s3 = (sourceData[offset7 + 1] & 255) << 24 | (sourceData[offset7 + 2] & 255) << 16 | (sourceData[offset7 + 3] & 255) << 8 | sourceData[offset7] & 255;
					break;
				case 2:
					s3 = (sourceData[offset7 + 2] & 255) << 24 | (sourceData[offset7 + 1] & 255) << 16 | (sourceData[offset7] & 255) << 8 | sourceData[offset7 + 3] & 255;
					break;
				}
				if(premultiplied7) {
					if((s3 & 255) != 0 && (s3 & 255) != 255) {
						lime_math_RGBA.unmult = 255.0 / (s3 & 255);
						s3 = (lime_math_RGBA.__clamp[Math.round((s3 >>> 24 & 255) * lime_math_RGBA.unmult)] & 255) << 24 | (lime_math_RGBA.__clamp[Math.round((s3 >>> 16 & 255) * lime_math_RGBA.unmult)] & 255) << 16 | (lime_math_RGBA.__clamp[Math.round((s3 >>> 8 & 255) * lime_math_RGBA.unmult)] & 255) << 8 | s3 & 255 & 255;
					}
				}
				var offset8 = sourceView.byteOffset + sourceView.stride * (y + disOffsetYFloor) + (x + disOffsetXFloor) * 4;
				var format8 = sourceFormat;
				var premultiplied8 = sourcePremultiplied;
				if(premultiplied8 == null) {
					premultiplied8 = false;
				}
				if(format8 == null) {
					format8 = 0;
				}
				switch(format8) {
				case 0:
					s4 = (sourceData[offset8] & 255) << 24 | (sourceData[offset8 + 1] & 255) << 16 | (sourceData[offset8 + 2] & 255) << 8 | sourceData[offset8 + 3] & 255;
					break;
				case 1:
					s4 = (sourceData[offset8 + 1] & 255) << 24 | (sourceData[offset8 + 2] & 255) << 16 | (sourceData[offset8 + 3] & 255) << 8 | sourceData[offset8] & 255;
					break;
				case 2:
					s4 = (sourceData[offset8 + 2] & 255) << 24 | (sourceData[offset8 + 1] & 255) << 16 | (sourceData[offset8] & 255) << 8 | sourceData[offset8 + 3] & 255;
					break;
				}
				if(premultiplied8) {
					if((s4 & 255) != 0 && (s4 & 255) != 255) {
						lime_math_RGBA.unmult = 255.0 / (s4 & 255);
						s4 = (lime_math_RGBA.__clamp[Math.round((s4 >>> 24 & 255) * lime_math_RGBA.unmult)] & 255) << 24 | (lime_math_RGBA.__clamp[Math.round((s4 >>> 16 & 255) * lime_math_RGBA.unmult)] & 255) << 16 | (lime_math_RGBA.__clamp[Math.round((s4 >>> 8 & 255) * lime_math_RGBA.unmult)] & 255) << 8 | s4 & 255 & 255;
					}
				}
				sourcePixel = lime__$internal_graphics_ImageDataUtil.bilinear(s1,s2,s3,s4,disX * sourceView.width - disOffsetXFloor,disY * sourceView.height - disOffsetYFloor);
			} else {
				var offset9 = sourceView.byteOffset + sourceView.stride * (y + disOffsetYFloor) + (x + disOffsetXFloor) * 4;
				var format9 = sourceFormat;
				var premultiplied9 = sourcePremultiplied;
				if(premultiplied9 == null) {
					premultiplied9 = false;
				}
				if(format9 == null) {
					format9 = 0;
				}
				switch(format9) {
				case 0:
					sourcePixel = (sourceData[offset9] & 255) << 24 | (sourceData[offset9 + 1] & 255) << 16 | (sourceData[offset9 + 2] & 255) << 8 | sourceData[offset9 + 3] & 255;
					break;
				case 1:
					sourcePixel = (sourceData[offset9 + 1] & 255) << 24 | (sourceData[offset9 + 2] & 255) << 16 | (sourceData[offset9 + 3] & 255) << 8 | sourceData[offset9] & 255;
					break;
				case 2:
					sourcePixel = (sourceData[offset9 + 2] & 255) << 24 | (sourceData[offset9 + 1] & 255) << 16 | (sourceData[offset9] & 255) << 8 | sourceData[offset9 + 3] & 255;
					break;
				}
				if(premultiplied9) {
					if((sourcePixel & 255) != 0 && (sourcePixel & 255) != 255) {
						lime_math_RGBA.unmult = 255.0 / (sourcePixel & 255);
						sourcePixel = (lime_math_RGBA.__clamp[Math.round((sourcePixel >>> 24 & 255) * lime_math_RGBA.unmult)] & 255) << 24 | (lime_math_RGBA.__clamp[Math.round((sourcePixel >>> 16 & 255) * lime_math_RGBA.unmult)] & 255) << 16 | (lime_math_RGBA.__clamp[Math.round((sourcePixel >>> 8 & 255) * lime_math_RGBA.unmult)] & 255) << 8 | sourcePixel & 255 & 255;
					}
				}
			}
			var format10 = targetFormat;
			var premultiplied10 = targetPremultiplied;
			if(premultiplied10 == null) {
				premultiplied10 = false;
			}
			if(format10 == null) {
				format10 = 0;
			}
			if(premultiplied10) {
				if((sourcePixel & 255) == 0) {
					if(sourcePixel != 0) {
						sourcePixel = 0;
					}
				} else if((sourcePixel & 255) != 255) {
					lime_math_RGBA.a16 = lime_math_RGBA.__alpha16[sourcePixel & 255];
					sourcePixel = ((sourcePixel >>> 24 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 24 | ((sourcePixel >>> 16 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 16 | ((sourcePixel >>> 8 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 8 | sourcePixel & 255 & 255;
				}
			}
			switch(format10) {
			case 0:
				targetData[sourceOffset] = sourcePixel >>> 24 & 255;
				targetData[sourceOffset + 1] = sourcePixel >>> 16 & 255;
				targetData[sourceOffset + 2] = sourcePixel >>> 8 & 255;
				targetData[sourceOffset + 3] = sourcePixel & 255;
				break;
			case 1:
				targetData[sourceOffset] = sourcePixel & 255;
				targetData[sourceOffset + 1] = sourcePixel >>> 24 & 255;
				targetData[sourceOffset + 2] = sourcePixel >>> 16 & 255;
				targetData[sourceOffset + 3] = sourcePixel >>> 8 & 255;
				break;
			case 2:
				targetData[sourceOffset] = sourcePixel >>> 8 & 255;
				targetData[sourceOffset + 1] = sourcePixel >>> 16 & 255;
				targetData[sourceOffset + 2] = sourcePixel >>> 24 & 255;
				targetData[sourceOffset + 3] = sourcePixel & 255;
				break;
			}
		}
	}
	target.dirty = true;
	target.version++;
};
lime__$internal_graphics_ImageDataUtil.bilinear = function(s1,s2,s3,s4,su,sv) {
	return lime__$internal_graphics_ImageDataUtil.lerpRGBA(lime__$internal_graphics_ImageDataUtil.lerpRGBA(s4,s2,su),lime__$internal_graphics_ImageDataUtil.lerpRGBA(s1,s3,su),sv);
};
lime__$internal_graphics_ImageDataUtil.lerpRGBA = function(v0,v1,x) {
	var result = 0;
	var value = Math.floor(lime__$internal_graphics_ImageDataUtil.lerp(v0 >>> 24 & 255,v1 >>> 24 & 255,x));
	result = (value & 255) << 24 | (result >>> 16 & 255 & 255) << 16 | (result >>> 8 & 255 & 255) << 8 | result & 255 & 255;
	var value = Math.floor(lime__$internal_graphics_ImageDataUtil.lerp(v0 >>> 16 & 255,v1 >>> 16 & 255,x));
	result = (result >>> 24 & 255 & 255) << 24 | (value & 255) << 16 | (result >>> 8 & 255 & 255) << 8 | result & 255 & 255;
	var value = Math.floor(lime__$internal_graphics_ImageDataUtil.lerp(v0 >>> 8 & 255,v1 >>> 8 & 255,x));
	result = (result >>> 24 & 255 & 255) << 24 | (result >>> 16 & 255 & 255) << 16 | (value & 255) << 8 | result & 255 & 255;
	var value = Math.floor(lime__$internal_graphics_ImageDataUtil.lerp(v0 & 255,v1 & 255,x));
	result = (result >>> 24 & 255 & 255) << 24 | (result >>> 16 & 255 & 255) << 16 | (result >>> 8 & 255 & 255) << 8 | value & 255;
	return result;
};
lime__$internal_graphics_ImageDataUtil.lerp4f = function(v0,v1,x) {
	return new lime_math_Vector4(lime__$internal_graphics_ImageDataUtil.lerp(v0.x,v1.x,x),lime__$internal_graphics_ImageDataUtil.lerp(v0.y,v1.y,x),lime__$internal_graphics_ImageDataUtil.lerp(v0.z,v1.z,x),lime__$internal_graphics_ImageDataUtil.lerp(v0.w,v1.w,x));
};
lime__$internal_graphics_ImageDataUtil.lerp = function(v0,v1,x) {
	return (1.0 - x) * v0 + x * v1;
};
lime__$internal_graphics_ImageDataUtil.colorTransform = function(image,rect,colorMatrix) {
	var data = image.buffer.data;
	if(data == null) {
		return;
	}
	var format = image.buffer.format;
	var premultiplied = image.buffer.premultiplied;
	var dataView = new lime__$internal_graphics__$ImageDataUtil_ImageDataView(image,rect);
	var alphaTable = lime_math_ColorMatrix.getAlphaTable(colorMatrix);
	var redTable = lime_math_ColorMatrix.getRedTable(colorMatrix);
	var greenTable = lime_math_ColorMatrix.getGreenTable(colorMatrix);
	var blueTable = lime_math_ColorMatrix.getBlueTable(colorMatrix);
	var row;
	var offset;
	var pixel = 0;
	var _g = 0;
	var _g1 = dataView.height;
	while(_g < _g1) {
		var y = _g++;
		row = dataView.byteOffset + dataView.stride * y;
		var _g2 = 0;
		var _g3 = dataView.width;
		while(_g2 < _g3) {
			var x = _g2++;
			offset = row + x * 4;
			var format1 = format;
			var premultiplied1 = premultiplied;
			if(premultiplied1 == null) {
				premultiplied1 = false;
			}
			if(format1 == null) {
				format1 = 0;
			}
			switch(format1) {
			case 0:
				pixel = (data[offset] & 255) << 24 | (data[offset + 1] & 255) << 16 | (data[offset + 2] & 255) << 8 | data[offset + 3] & 255;
				break;
			case 1:
				pixel = (data[offset + 1] & 255) << 24 | (data[offset + 2] & 255) << 16 | (data[offset + 3] & 255) << 8 | data[offset] & 255;
				break;
			case 2:
				pixel = (data[offset + 2] & 255) << 24 | (data[offset + 1] & 255) << 16 | (data[offset] & 255) << 8 | data[offset + 3] & 255;
				break;
			}
			if(premultiplied1) {
				if((pixel & 255) != 0 && (pixel & 255) != 255) {
					lime_math_RGBA.unmult = 255.0 / (pixel & 255);
					pixel = (lime_math_RGBA.__clamp[Math.round((pixel >>> 24 & 255) * lime_math_RGBA.unmult)] & 255) << 24 | (lime_math_RGBA.__clamp[Math.round((pixel >>> 16 & 255) * lime_math_RGBA.unmult)] & 255) << 16 | (lime_math_RGBA.__clamp[Math.round((pixel >>> 8 & 255) * lime_math_RGBA.unmult)] & 255) << 8 | pixel & 255 & 255;
				}
			}
			pixel = (redTable[pixel >>> 24 & 255] & 255) << 24 | (greenTable[pixel >>> 16 & 255] & 255) << 16 | (blueTable[pixel >>> 8 & 255] & 255) << 8 | alphaTable[pixel & 255] & 255;
			var format2 = format;
			var premultiplied2 = premultiplied;
			if(premultiplied2 == null) {
				premultiplied2 = false;
			}
			if(format2 == null) {
				format2 = 0;
			}
			if(premultiplied2) {
				if((pixel & 255) == 0) {
					if(pixel != 0) {
						pixel = 0;
					}
				} else if((pixel & 255) != 255) {
					lime_math_RGBA.a16 = lime_math_RGBA.__alpha16[pixel & 255];
					pixel = ((pixel >>> 24 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 24 | ((pixel >>> 16 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 16 | ((pixel >>> 8 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 8 | pixel & 255 & 255;
				}
			}
			switch(format2) {
			case 0:
				data[offset] = pixel >>> 24 & 255;
				data[offset + 1] = pixel >>> 16 & 255;
				data[offset + 2] = pixel >>> 8 & 255;
				data[offset + 3] = pixel & 255;
				break;
			case 1:
				data[offset] = pixel & 255;
				data[offset + 1] = pixel >>> 24 & 255;
				data[offset + 2] = pixel >>> 16 & 255;
				data[offset + 3] = pixel >>> 8 & 255;
				break;
			case 2:
				data[offset] = pixel >>> 8 & 255;
				data[offset + 1] = pixel >>> 16 & 255;
				data[offset + 2] = pixel >>> 24 & 255;
				data[offset + 3] = pixel & 255;
				break;
			}
		}
	}
	image.dirty = true;
	image.version++;
};
lime__$internal_graphics_ImageDataUtil.copyChannel = function(image,sourceImage,sourceRect,destPoint,sourceChannel,destChannel) {
	var destIdx;
	switch(destChannel._hx_index) {
	case 0:
		destIdx = 0;
		break;
	case 1:
		destIdx = 1;
		break;
	case 2:
		destIdx = 2;
		break;
	case 3:
		destIdx = 3;
		break;
	}
	var srcIdx;
	switch(sourceChannel._hx_index) {
	case 0:
		srcIdx = 0;
		break;
	case 1:
		srcIdx = 1;
		break;
	case 2:
		srcIdx = 2;
		break;
	case 3:
		srcIdx = 3;
		break;
	}
	var srcData = sourceImage.buffer.data;
	var destData = image.buffer.data;
	if(srcData == null || destData == null) {
		return;
	}
	var srcView = new lime__$internal_graphics__$ImageDataUtil_ImageDataView(sourceImage,sourceRect);
	var destView = new lime__$internal_graphics__$ImageDataUtil_ImageDataView(image,new lime_math_Rectangle(destPoint.x,destPoint.y,srcView.width,srcView.height));
	var srcFormat = sourceImage.buffer.format;
	var destFormat = image.buffer.format;
	var srcPremultiplied = sourceImage.buffer.premultiplied;
	var destPremultiplied = image.buffer.premultiplied;
	var srcPosition;
	var destPosition;
	var srcPixel = 0;
	var destPixel = 0;
	var value = 0;
	var _g = 0;
	var _g1 = destView.height;
	while(_g < _g1) {
		var y = _g++;
		srcPosition = srcView.byteOffset + srcView.stride * y;
		destPosition = destView.byteOffset + destView.stride * y;
		var _g2 = 0;
		var _g3 = destView.width;
		while(_g2 < _g3) {
			var x = _g2++;
			var format = srcFormat;
			var premultiplied = srcPremultiplied;
			if(premultiplied == null) {
				premultiplied = false;
			}
			if(format == null) {
				format = 0;
			}
			switch(format) {
			case 0:
				srcPixel = (srcData[srcPosition] & 255) << 24 | (srcData[srcPosition + 1] & 255) << 16 | (srcData[srcPosition + 2] & 255) << 8 | srcData[srcPosition + 3] & 255;
				break;
			case 1:
				srcPixel = (srcData[srcPosition + 1] & 255) << 24 | (srcData[srcPosition + 2] & 255) << 16 | (srcData[srcPosition + 3] & 255) << 8 | srcData[srcPosition] & 255;
				break;
			case 2:
				srcPixel = (srcData[srcPosition + 2] & 255) << 24 | (srcData[srcPosition + 1] & 255) << 16 | (srcData[srcPosition] & 255) << 8 | srcData[srcPosition + 3] & 255;
				break;
			}
			if(premultiplied) {
				if((srcPixel & 255) != 0 && (srcPixel & 255) != 255) {
					lime_math_RGBA.unmult = 255.0 / (srcPixel & 255);
					srcPixel = (lime_math_RGBA.__clamp[Math.round((srcPixel >>> 24 & 255) * lime_math_RGBA.unmult)] & 255) << 24 | (lime_math_RGBA.__clamp[Math.round((srcPixel >>> 16 & 255) * lime_math_RGBA.unmult)] & 255) << 16 | (lime_math_RGBA.__clamp[Math.round((srcPixel >>> 8 & 255) * lime_math_RGBA.unmult)] & 255) << 8 | srcPixel & 255 & 255;
				}
			}
			var format1 = destFormat;
			var premultiplied1 = destPremultiplied;
			if(premultiplied1 == null) {
				premultiplied1 = false;
			}
			if(format1 == null) {
				format1 = 0;
			}
			switch(format1) {
			case 0:
				destPixel = (destData[destPosition] & 255) << 24 | (destData[destPosition + 1] & 255) << 16 | (destData[destPosition + 2] & 255) << 8 | destData[destPosition + 3] & 255;
				break;
			case 1:
				destPixel = (destData[destPosition + 1] & 255) << 24 | (destData[destPosition + 2] & 255) << 16 | (destData[destPosition + 3] & 255) << 8 | destData[destPosition] & 255;
				break;
			case 2:
				destPixel = (destData[destPosition + 2] & 255) << 24 | (destData[destPosition + 1] & 255) << 16 | (destData[destPosition] & 255) << 8 | destData[destPosition + 3] & 255;
				break;
			}
			if(premultiplied1) {
				if((destPixel & 255) != 0 && (destPixel & 255) != 255) {
					lime_math_RGBA.unmult = 255.0 / (destPixel & 255);
					destPixel = (lime_math_RGBA.__clamp[Math.round((destPixel >>> 24 & 255) * lime_math_RGBA.unmult)] & 255) << 24 | (lime_math_RGBA.__clamp[Math.round((destPixel >>> 16 & 255) * lime_math_RGBA.unmult)] & 255) << 16 | (lime_math_RGBA.__clamp[Math.round((destPixel >>> 8 & 255) * lime_math_RGBA.unmult)] & 255) << 8 | destPixel & 255 & 255;
				}
			}
			switch(srcIdx) {
			case 0:
				value = srcPixel >>> 24 & 255;
				break;
			case 1:
				value = srcPixel >>> 16 & 255;
				break;
			case 2:
				value = srcPixel >>> 8 & 255;
				break;
			case 3:
				value = srcPixel & 255;
				break;
			}
			switch(destIdx) {
			case 0:
				destPixel = (value & 255) << 24 | (destPixel >>> 16 & 255 & 255) << 16 | (destPixel >>> 8 & 255 & 255) << 8 | destPixel & 255 & 255;
				break;
			case 1:
				destPixel = (destPixel >>> 24 & 255 & 255) << 24 | (value & 255) << 16 | (destPixel >>> 8 & 255 & 255) << 8 | destPixel & 255 & 255;
				break;
			case 2:
				destPixel = (destPixel >>> 24 & 255 & 255) << 24 | (destPixel >>> 16 & 255 & 255) << 16 | (value & 255) << 8 | destPixel & 255 & 255;
				break;
			case 3:
				destPixel = (destPixel >>> 24 & 255 & 255) << 24 | (destPixel >>> 16 & 255 & 255) << 16 | (destPixel >>> 8 & 255 & 255) << 8 | value & 255;
				break;
			}
			var format2 = destFormat;
			var premultiplied2 = destPremultiplied;
			if(premultiplied2 == null) {
				premultiplied2 = false;
			}
			if(format2 == null) {
				format2 = 0;
			}
			if(premultiplied2) {
				if((destPixel & 255) == 0) {
					if(destPixel != 0) {
						destPixel = 0;
					}
				} else if((destPixel & 255) != 255) {
					lime_math_RGBA.a16 = lime_math_RGBA.__alpha16[destPixel & 255];
					destPixel = ((destPixel >>> 24 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 24 | ((destPixel >>> 16 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 16 | ((destPixel >>> 8 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 8 | destPixel & 255 & 255;
				}
			}
			switch(format2) {
			case 0:
				destData[destPosition] = destPixel >>> 24 & 255;
				destData[destPosition + 1] = destPixel >>> 16 & 255;
				destData[destPosition + 2] = destPixel >>> 8 & 255;
				destData[destPosition + 3] = destPixel & 255;
				break;
			case 1:
				destData[destPosition] = destPixel & 255;
				destData[destPosition + 1] = destPixel >>> 24 & 255;
				destData[destPosition + 2] = destPixel >>> 16 & 255;
				destData[destPosition + 3] = destPixel >>> 8 & 255;
				break;
			case 2:
				destData[destPosition] = destPixel >>> 8 & 255;
				destData[destPosition + 1] = destPixel >>> 16 & 255;
				destData[destPosition + 2] = destPixel >>> 24 & 255;
				destData[destPosition + 3] = destPixel & 255;
				break;
			}
			srcPosition += 4;
			destPosition += 4;
		}
	}
	image.dirty = true;
	image.version++;
};
lime__$internal_graphics_ImageDataUtil.copyPixels = function(image,sourceImage,sourceRect,destPoint,alphaImage,alphaPoint,mergeAlpha) {
	if(mergeAlpha == null) {
		mergeAlpha = false;
	}
	if(image.width == sourceImage.width && image.height == sourceImage.height && sourceRect.width == sourceImage.width && sourceRect.height == sourceImage.height && sourceRect.x == 0 && sourceRect.y == 0 && destPoint.x == 0 && destPoint.y == 0 && alphaImage == null && alphaPoint == null && mergeAlpha == false && image.get_format() == sourceImage.get_format()) {
		image.buffer.data.set(sourceImage.buffer.data);
	} else {
		var sourceData = sourceImage.buffer.data;
		var destData = image.buffer.data;
		if(sourceData == null || destData == null) {
			return;
		}
		var sourceView = new lime__$internal_graphics__$ImageDataUtil_ImageDataView(sourceImage,sourceRect);
		var destRect = new lime_math_Rectangle(destPoint.x,destPoint.y,sourceView.width,sourceView.height);
		var destView = new lime__$internal_graphics__$ImageDataUtil_ImageDataView(image,destRect);
		var sourceFormat = sourceImage.buffer.format;
		var destFormat = image.buffer.format;
		var sourcePosition;
		var destPosition;
		var sourceAlpha;
		var destAlpha;
		var oneMinusSourceAlpha;
		var blendAlpha;
		var sourcePixel = 0;
		var destPixel = 0;
		var sourcePremultiplied = sourceImage.buffer.premultiplied;
		var destPremultiplied = image.buffer.premultiplied;
		var sourceBytesPerPixel = sourceImage.buffer.bitsPerPixel / 8 | 0;
		var destBytesPerPixel = image.buffer.bitsPerPixel / 8 | 0;
		var useAlphaImage = alphaImage != null && alphaImage.get_transparent();
		var blend = mergeAlpha || useAlphaImage && !image.get_transparent() || !mergeAlpha && !image.get_transparent() && sourceImage.get_transparent();
		if(!useAlphaImage) {
			if(blend) {
				var _g = 0;
				var _g1 = destView.height;
				while(_g < _g1) {
					var y = _g++;
					sourcePosition = sourceView.byteOffset + sourceView.stride * y;
					destPosition = destView.byteOffset + destView.stride * y;
					var _g2 = 0;
					var _g3 = destView.width;
					while(_g2 < _g3) {
						var x = _g2++;
						var format = sourceFormat;
						var premultiplied = sourcePremultiplied;
						if(premultiplied == null) {
							premultiplied = false;
						}
						if(format == null) {
							format = 0;
						}
						switch(format) {
						case 0:
							sourcePixel = (sourceData[sourcePosition] & 255) << 24 | (sourceData[sourcePosition + 1] & 255) << 16 | (sourceData[sourcePosition + 2] & 255) << 8 | sourceData[sourcePosition + 3] & 255;
							break;
						case 1:
							sourcePixel = (sourceData[sourcePosition + 1] & 255) << 24 | (sourceData[sourcePosition + 2] & 255) << 16 | (sourceData[sourcePosition + 3] & 255) << 8 | sourceData[sourcePosition] & 255;
							break;
						case 2:
							sourcePixel = (sourceData[sourcePosition + 2] & 255) << 24 | (sourceData[sourcePosition + 1] & 255) << 16 | (sourceData[sourcePosition] & 255) << 8 | sourceData[sourcePosition + 3] & 255;
							break;
						}
						if(premultiplied) {
							if((sourcePixel & 255) != 0 && (sourcePixel & 255) != 255) {
								lime_math_RGBA.unmult = 255.0 / (sourcePixel & 255);
								sourcePixel = (lime_math_RGBA.__clamp[Math.round((sourcePixel >>> 24 & 255) * lime_math_RGBA.unmult)] & 255) << 24 | (lime_math_RGBA.__clamp[Math.round((sourcePixel >>> 16 & 255) * lime_math_RGBA.unmult)] & 255) << 16 | (lime_math_RGBA.__clamp[Math.round((sourcePixel >>> 8 & 255) * lime_math_RGBA.unmult)] & 255) << 8 | sourcePixel & 255 & 255;
							}
						}
						var format1 = destFormat;
						var premultiplied1 = destPremultiplied;
						if(premultiplied1 == null) {
							premultiplied1 = false;
						}
						if(format1 == null) {
							format1 = 0;
						}
						switch(format1) {
						case 0:
							destPixel = (destData[destPosition] & 255) << 24 | (destData[destPosition + 1] & 255) << 16 | (destData[destPosition + 2] & 255) << 8 | destData[destPosition + 3] & 255;
							break;
						case 1:
							destPixel = (destData[destPosition + 1] & 255) << 24 | (destData[destPosition + 2] & 255) << 16 | (destData[destPosition + 3] & 255) << 8 | destData[destPosition] & 255;
							break;
						case 2:
							destPixel = (destData[destPosition + 2] & 255) << 24 | (destData[destPosition + 1] & 255) << 16 | (destData[destPosition] & 255) << 8 | destData[destPosition + 3] & 255;
							break;
						}
						if(premultiplied1) {
							if((destPixel & 255) != 0 && (destPixel & 255) != 255) {
								lime_math_RGBA.unmult = 255.0 / (destPixel & 255);
								destPixel = (lime_math_RGBA.__clamp[Math.round((destPixel >>> 24 & 255) * lime_math_RGBA.unmult)] & 255) << 24 | (lime_math_RGBA.__clamp[Math.round((destPixel >>> 16 & 255) * lime_math_RGBA.unmult)] & 255) << 16 | (lime_math_RGBA.__clamp[Math.round((destPixel >>> 8 & 255) * lime_math_RGBA.unmult)] & 255) << 8 | destPixel & 255 & 255;
							}
						}
						sourceAlpha = (sourcePixel & 255) / 255.0;
						destAlpha = (destPixel & 255) / 255.0;
						oneMinusSourceAlpha = 1 - sourceAlpha;
						blendAlpha = sourceAlpha + destAlpha * oneMinusSourceAlpha;
						if(blendAlpha == 0) {
							destPixel = 0;
						} else {
							var value = lime_math_RGBA.__clamp[Math.round(((sourcePixel >>> 24 & 255) * sourceAlpha + (destPixel >>> 24 & 255) * destAlpha * oneMinusSourceAlpha) / blendAlpha)];
							destPixel = (value & 255) << 24 | (destPixel >>> 16 & 255 & 255) << 16 | (destPixel >>> 8 & 255 & 255) << 8 | destPixel & 255 & 255;
							var value1 = lime_math_RGBA.__clamp[Math.round(((sourcePixel >>> 16 & 255) * sourceAlpha + (destPixel >>> 16 & 255) * destAlpha * oneMinusSourceAlpha) / blendAlpha)];
							destPixel = (destPixel >>> 24 & 255 & 255) << 24 | (value1 & 255) << 16 | (destPixel >>> 8 & 255 & 255) << 8 | destPixel & 255 & 255;
							var value2 = lime_math_RGBA.__clamp[Math.round(((sourcePixel >>> 8 & 255) * sourceAlpha + (destPixel >>> 8 & 255) * destAlpha * oneMinusSourceAlpha) / blendAlpha)];
							destPixel = (destPixel >>> 24 & 255 & 255) << 24 | (destPixel >>> 16 & 255 & 255) << 16 | (value2 & 255) << 8 | destPixel & 255 & 255;
							var value3 = lime_math_RGBA.__clamp[Math.round(blendAlpha * 255.0)];
							destPixel = (destPixel >>> 24 & 255 & 255) << 24 | (destPixel >>> 16 & 255 & 255) << 16 | (destPixel >>> 8 & 255 & 255) << 8 | value3 & 255;
						}
						var format2 = destFormat;
						var premultiplied2 = destPremultiplied;
						if(premultiplied2 == null) {
							premultiplied2 = false;
						}
						if(format2 == null) {
							format2 = 0;
						}
						if(premultiplied2) {
							if((destPixel & 255) == 0) {
								if(destPixel != 0) {
									destPixel = 0;
								}
							} else if((destPixel & 255) != 255) {
								lime_math_RGBA.a16 = lime_math_RGBA.__alpha16[destPixel & 255];
								destPixel = ((destPixel >>> 24 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 24 | ((destPixel >>> 16 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 16 | ((destPixel >>> 8 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 8 | destPixel & 255 & 255;
							}
						}
						switch(format2) {
						case 0:
							destData[destPosition] = destPixel >>> 24 & 255;
							destData[destPosition + 1] = destPixel >>> 16 & 255;
							destData[destPosition + 2] = destPixel >>> 8 & 255;
							destData[destPosition + 3] = destPixel & 255;
							break;
						case 1:
							destData[destPosition] = destPixel & 255;
							destData[destPosition + 1] = destPixel >>> 24 & 255;
							destData[destPosition + 2] = destPixel >>> 16 & 255;
							destData[destPosition + 3] = destPixel >>> 8 & 255;
							break;
						case 2:
							destData[destPosition] = destPixel >>> 8 & 255;
							destData[destPosition + 1] = destPixel >>> 16 & 255;
							destData[destPosition + 2] = destPixel >>> 24 & 255;
							destData[destPosition + 3] = destPixel & 255;
							break;
						}
						sourcePosition += 4;
						destPosition += 4;
					}
				}
			} else if(sourceFormat == destFormat && sourcePremultiplied == destPremultiplied && sourceBytesPerPixel == destBytesPerPixel) {
				var _g = 0;
				var _g1 = destView.height;
				while(_g < _g1) {
					var y = _g++;
					sourcePosition = sourceView.byteOffset + sourceView.stride * y;
					destPosition = destView.byteOffset + destView.stride * y;
					destData.set(sourceData.subarray(sourcePosition,sourcePosition + destView.width * destBytesPerPixel),destPosition);
				}
			} else {
				var _g = 0;
				var _g1 = destView.height;
				while(_g < _g1) {
					var y = _g++;
					sourcePosition = sourceView.byteOffset + sourceView.stride * y;
					destPosition = destView.byteOffset + destView.stride * y;
					var _g2 = 0;
					var _g3 = destView.width;
					while(_g2 < _g3) {
						var x = _g2++;
						var format = sourceFormat;
						var premultiplied = sourcePremultiplied;
						if(premultiplied == null) {
							premultiplied = false;
						}
						if(format == null) {
							format = 0;
						}
						switch(format) {
						case 0:
							sourcePixel = (sourceData[sourcePosition] & 255) << 24 | (sourceData[sourcePosition + 1] & 255) << 16 | (sourceData[sourcePosition + 2] & 255) << 8 | sourceData[sourcePosition + 3] & 255;
							break;
						case 1:
							sourcePixel = (sourceData[sourcePosition + 1] & 255) << 24 | (sourceData[sourcePosition + 2] & 255) << 16 | (sourceData[sourcePosition + 3] & 255) << 8 | sourceData[sourcePosition] & 255;
							break;
						case 2:
							sourcePixel = (sourceData[sourcePosition + 2] & 255) << 24 | (sourceData[sourcePosition + 1] & 255) << 16 | (sourceData[sourcePosition] & 255) << 8 | sourceData[sourcePosition + 3] & 255;
							break;
						}
						if(premultiplied) {
							if((sourcePixel & 255) != 0 && (sourcePixel & 255) != 255) {
								lime_math_RGBA.unmult = 255.0 / (sourcePixel & 255);
								sourcePixel = (lime_math_RGBA.__clamp[Math.round((sourcePixel >>> 24 & 255) * lime_math_RGBA.unmult)] & 255) << 24 | (lime_math_RGBA.__clamp[Math.round((sourcePixel >>> 16 & 255) * lime_math_RGBA.unmult)] & 255) << 16 | (lime_math_RGBA.__clamp[Math.round((sourcePixel >>> 8 & 255) * lime_math_RGBA.unmult)] & 255) << 8 | sourcePixel & 255 & 255;
							}
						}
						var format1 = destFormat;
						var premultiplied1 = destPremultiplied;
						if(premultiplied1 == null) {
							premultiplied1 = false;
						}
						if(format1 == null) {
							format1 = 0;
						}
						if(premultiplied1) {
							if((sourcePixel & 255) == 0) {
								if(sourcePixel != 0) {
									sourcePixel = 0;
								}
							} else if((sourcePixel & 255) != 255) {
								lime_math_RGBA.a16 = lime_math_RGBA.__alpha16[sourcePixel & 255];
								sourcePixel = ((sourcePixel >>> 24 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 24 | ((sourcePixel >>> 16 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 16 | ((sourcePixel >>> 8 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 8 | sourcePixel & 255 & 255;
							}
						}
						switch(format1) {
						case 0:
							destData[destPosition] = sourcePixel >>> 24 & 255;
							destData[destPosition + 1] = sourcePixel >>> 16 & 255;
							destData[destPosition + 2] = sourcePixel >>> 8 & 255;
							destData[destPosition + 3] = sourcePixel & 255;
							break;
						case 1:
							destData[destPosition] = sourcePixel & 255;
							destData[destPosition + 1] = sourcePixel >>> 24 & 255;
							destData[destPosition + 2] = sourcePixel >>> 16 & 255;
							destData[destPosition + 3] = sourcePixel >>> 8 & 255;
							break;
						case 2:
							destData[destPosition] = sourcePixel >>> 8 & 255;
							destData[destPosition + 1] = sourcePixel >>> 16 & 255;
							destData[destPosition + 2] = sourcePixel >>> 24 & 255;
							destData[destPosition + 3] = sourcePixel & 255;
							break;
						}
						sourcePosition += 4;
						destPosition += 4;
					}
				}
			}
		} else {
			var alphaData = alphaImage.buffer.data;
			var alphaFormat = alphaImage.buffer.format;
			var alphaPosition;
			var alphaPixel = 0;
			var alphaView = new lime__$internal_graphics__$ImageDataUtil_ImageDataView(alphaImage,new lime_math_Rectangle(sourceView.x + (alphaPoint == null ? 0 : alphaPoint.x),sourceView.y + (alphaPoint == null ? 0 : alphaPoint.y),sourceView.width,sourceView.height));
			destView.clip(destPoint.x | 0,destPoint.y | 0,alphaView.width,alphaView.height);
			if(blend) {
				var _g = 0;
				var _g1 = destView.height;
				while(_g < _g1) {
					var y = _g++;
					sourcePosition = sourceView.byteOffset + sourceView.stride * y;
					destPosition = destView.byteOffset + destView.stride * y;
					alphaPosition = alphaView.byteOffset + alphaView.stride * y;
					var _g2 = 0;
					var _g3 = destView.width;
					while(_g2 < _g3) {
						var x = _g2++;
						var format = sourceFormat;
						var premultiplied = sourcePremultiplied;
						if(premultiplied == null) {
							premultiplied = false;
						}
						if(format == null) {
							format = 0;
						}
						switch(format) {
						case 0:
							sourcePixel = (sourceData[sourcePosition] & 255) << 24 | (sourceData[sourcePosition + 1] & 255) << 16 | (sourceData[sourcePosition + 2] & 255) << 8 | sourceData[sourcePosition + 3] & 255;
							break;
						case 1:
							sourcePixel = (sourceData[sourcePosition + 1] & 255) << 24 | (sourceData[sourcePosition + 2] & 255) << 16 | (sourceData[sourcePosition + 3] & 255) << 8 | sourceData[sourcePosition] & 255;
							break;
						case 2:
							sourcePixel = (sourceData[sourcePosition + 2] & 255) << 24 | (sourceData[sourcePosition + 1] & 255) << 16 | (sourceData[sourcePosition] & 255) << 8 | sourceData[sourcePosition + 3] & 255;
							break;
						}
						if(premultiplied) {
							if((sourcePixel & 255) != 0 && (sourcePixel & 255) != 255) {
								lime_math_RGBA.unmult = 255.0 / (sourcePixel & 255);
								sourcePixel = (lime_math_RGBA.__clamp[Math.round((sourcePixel >>> 24 & 255) * lime_math_RGBA.unmult)] & 255) << 24 | (lime_math_RGBA.__clamp[Math.round((sourcePixel >>> 16 & 255) * lime_math_RGBA.unmult)] & 255) << 16 | (lime_math_RGBA.__clamp[Math.round((sourcePixel >>> 8 & 255) * lime_math_RGBA.unmult)] & 255) << 8 | sourcePixel & 255 & 255;
							}
						}
						var format1 = destFormat;
						var premultiplied1 = destPremultiplied;
						if(premultiplied1 == null) {
							premultiplied1 = false;
						}
						if(format1 == null) {
							format1 = 0;
						}
						switch(format1) {
						case 0:
							destPixel = (destData[destPosition] & 255) << 24 | (destData[destPosition + 1] & 255) << 16 | (destData[destPosition + 2] & 255) << 8 | destData[destPosition + 3] & 255;
							break;
						case 1:
							destPixel = (destData[destPosition + 1] & 255) << 24 | (destData[destPosition + 2] & 255) << 16 | (destData[destPosition + 3] & 255) << 8 | destData[destPosition] & 255;
							break;
						case 2:
							destPixel = (destData[destPosition + 2] & 255) << 24 | (destData[destPosition + 1] & 255) << 16 | (destData[destPosition] & 255) << 8 | destData[destPosition + 3] & 255;
							break;
						}
						if(premultiplied1) {
							if((destPixel & 255) != 0 && (destPixel & 255) != 255) {
								lime_math_RGBA.unmult = 255.0 / (destPixel & 255);
								destPixel = (lime_math_RGBA.__clamp[Math.round((destPixel >>> 24 & 255) * lime_math_RGBA.unmult)] & 255) << 24 | (lime_math_RGBA.__clamp[Math.round((destPixel >>> 16 & 255) * lime_math_RGBA.unmult)] & 255) << 16 | (lime_math_RGBA.__clamp[Math.round((destPixel >>> 8 & 255) * lime_math_RGBA.unmult)] & 255) << 8 | destPixel & 255 & 255;
							}
						}
						var format2 = alphaFormat;
						var premultiplied2 = false;
						if(premultiplied2 == null) {
							premultiplied2 = false;
						}
						if(format2 == null) {
							format2 = 0;
						}
						switch(format2) {
						case 0:
							alphaPixel = (alphaData[alphaPosition] & 255) << 24 | (alphaData[alphaPosition + 1] & 255) << 16 | (alphaData[alphaPosition + 2] & 255) << 8 | alphaData[alphaPosition + 3] & 255;
							break;
						case 1:
							alphaPixel = (alphaData[alphaPosition + 1] & 255) << 24 | (alphaData[alphaPosition + 2] & 255) << 16 | (alphaData[alphaPosition + 3] & 255) << 8 | alphaData[alphaPosition] & 255;
							break;
						case 2:
							alphaPixel = (alphaData[alphaPosition + 2] & 255) << 24 | (alphaData[alphaPosition + 1] & 255) << 16 | (alphaData[alphaPosition] & 255) << 8 | alphaData[alphaPosition + 3] & 255;
							break;
						}
						if(premultiplied2) {
							if((alphaPixel & 255) != 0 && (alphaPixel & 255) != 255) {
								lime_math_RGBA.unmult = 255.0 / (alphaPixel & 255);
								alphaPixel = (lime_math_RGBA.__clamp[Math.round((alphaPixel >>> 24 & 255) * lime_math_RGBA.unmult)] & 255) << 24 | (lime_math_RGBA.__clamp[Math.round((alphaPixel >>> 16 & 255) * lime_math_RGBA.unmult)] & 255) << 16 | (lime_math_RGBA.__clamp[Math.round((alphaPixel >>> 8 & 255) * lime_math_RGBA.unmult)] & 255) << 8 | alphaPixel & 255 & 255;
							}
						}
						sourceAlpha = (alphaPixel & 255) / 255.0 * ((sourcePixel & 255) / 255.0);
						if(sourceAlpha > 0) {
							destAlpha = (destPixel & 255) / 255.0;
							oneMinusSourceAlpha = 1 - sourceAlpha;
							blendAlpha = sourceAlpha + destAlpha * oneMinusSourceAlpha;
							var value = lime_math_RGBA.__clamp[Math.round(((sourcePixel >>> 24 & 255) * sourceAlpha + (destPixel >>> 24 & 255) * destAlpha * oneMinusSourceAlpha) / blendAlpha)];
							destPixel = (value & 255) << 24 | (destPixel >>> 16 & 255 & 255) << 16 | (destPixel >>> 8 & 255 & 255) << 8 | destPixel & 255 & 255;
							var value1 = lime_math_RGBA.__clamp[Math.round(((sourcePixel >>> 16 & 255) * sourceAlpha + (destPixel >>> 16 & 255) * destAlpha * oneMinusSourceAlpha) / blendAlpha)];
							destPixel = (destPixel >>> 24 & 255 & 255) << 24 | (value1 & 255) << 16 | (destPixel >>> 8 & 255 & 255) << 8 | destPixel & 255 & 255;
							var value2 = lime_math_RGBA.__clamp[Math.round(((sourcePixel >>> 8 & 255) * sourceAlpha + (destPixel >>> 8 & 255) * destAlpha * oneMinusSourceAlpha) / blendAlpha)];
							destPixel = (destPixel >>> 24 & 255 & 255) << 24 | (destPixel >>> 16 & 255 & 255) << 16 | (value2 & 255) << 8 | destPixel & 255 & 255;
							var value3 = lime_math_RGBA.__clamp[Math.round(blendAlpha * 255.0)];
							destPixel = (destPixel >>> 24 & 255 & 255) << 24 | (destPixel >>> 16 & 255 & 255) << 16 | (destPixel >>> 8 & 255 & 255) << 8 | value3 & 255;
							var format3 = destFormat;
							var premultiplied3 = destPremultiplied;
							if(premultiplied3 == null) {
								premultiplied3 = false;
							}
							if(format3 == null) {
								format3 = 0;
							}
							if(premultiplied3) {
								if((destPixel & 255) == 0) {
									if(destPixel != 0) {
										destPixel = 0;
									}
								} else if((destPixel & 255) != 255) {
									lime_math_RGBA.a16 = lime_math_RGBA.__alpha16[destPixel & 255];
									destPixel = ((destPixel >>> 24 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 24 | ((destPixel >>> 16 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 16 | ((destPixel >>> 8 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 8 | destPixel & 255 & 255;
								}
							}
							switch(format3) {
							case 0:
								destData[destPosition] = destPixel >>> 24 & 255;
								destData[destPosition + 1] = destPixel >>> 16 & 255;
								destData[destPosition + 2] = destPixel >>> 8 & 255;
								destData[destPosition + 3] = destPixel & 255;
								break;
							case 1:
								destData[destPosition] = destPixel & 255;
								destData[destPosition + 1] = destPixel >>> 24 & 255;
								destData[destPosition + 2] = destPixel >>> 16 & 255;
								destData[destPosition + 3] = destPixel >>> 8 & 255;
								break;
							case 2:
								destData[destPosition] = destPixel >>> 8 & 255;
								destData[destPosition + 1] = destPixel >>> 16 & 255;
								destData[destPosition + 2] = destPixel >>> 24 & 255;
								destData[destPosition + 3] = destPixel & 255;
								break;
							}
						}
						sourcePosition += 4;
						destPosition += 4;
						alphaPosition += 4;
					}
				}
			} else {
				var _g = 0;
				var _g1 = destView.height;
				while(_g < _g1) {
					var y = _g++;
					sourcePosition = sourceView.byteOffset + sourceView.stride * y;
					destPosition = destView.byteOffset + destView.stride * y;
					alphaPosition = alphaView.byteOffset + alphaView.stride * y;
					var _g2 = 0;
					var _g3 = destView.width;
					while(_g2 < _g3) {
						var x = _g2++;
						var format = sourceFormat;
						var premultiplied = sourcePremultiplied;
						if(premultiplied == null) {
							premultiplied = false;
						}
						if(format == null) {
							format = 0;
						}
						switch(format) {
						case 0:
							sourcePixel = (sourceData[sourcePosition] & 255) << 24 | (sourceData[sourcePosition + 1] & 255) << 16 | (sourceData[sourcePosition + 2] & 255) << 8 | sourceData[sourcePosition + 3] & 255;
							break;
						case 1:
							sourcePixel = (sourceData[sourcePosition + 1] & 255) << 24 | (sourceData[sourcePosition + 2] & 255) << 16 | (sourceData[sourcePosition + 3] & 255) << 8 | sourceData[sourcePosition] & 255;
							break;
						case 2:
							sourcePixel = (sourceData[sourcePosition + 2] & 255) << 24 | (sourceData[sourcePosition + 1] & 255) << 16 | (sourceData[sourcePosition] & 255) << 8 | sourceData[sourcePosition + 3] & 255;
							break;
						}
						if(premultiplied) {
							if((sourcePixel & 255) != 0 && (sourcePixel & 255) != 255) {
								lime_math_RGBA.unmult = 255.0 / (sourcePixel & 255);
								sourcePixel = (lime_math_RGBA.__clamp[Math.round((sourcePixel >>> 24 & 255) * lime_math_RGBA.unmult)] & 255) << 24 | (lime_math_RGBA.__clamp[Math.round((sourcePixel >>> 16 & 255) * lime_math_RGBA.unmult)] & 255) << 16 | (lime_math_RGBA.__clamp[Math.round((sourcePixel >>> 8 & 255) * lime_math_RGBA.unmult)] & 255) << 8 | sourcePixel & 255 & 255;
							}
						}
						var format1 = alphaFormat;
						var premultiplied1 = false;
						if(premultiplied1 == null) {
							premultiplied1 = false;
						}
						if(format1 == null) {
							format1 = 0;
						}
						switch(format1) {
						case 0:
							alphaPixel = (alphaData[alphaPosition] & 255) << 24 | (alphaData[alphaPosition + 1] & 255) << 16 | (alphaData[alphaPosition + 2] & 255) << 8 | alphaData[alphaPosition + 3] & 255;
							break;
						case 1:
							alphaPixel = (alphaData[alphaPosition + 1] & 255) << 24 | (alphaData[alphaPosition + 2] & 255) << 16 | (alphaData[alphaPosition + 3] & 255) << 8 | alphaData[alphaPosition] & 255;
							break;
						case 2:
							alphaPixel = (alphaData[alphaPosition + 2] & 255) << 24 | (alphaData[alphaPosition + 1] & 255) << 16 | (alphaData[alphaPosition] & 255) << 8 | alphaData[alphaPosition + 3] & 255;
							break;
						}
						if(premultiplied1) {
							if((alphaPixel & 255) != 0 && (alphaPixel & 255) != 255) {
								lime_math_RGBA.unmult = 255.0 / (alphaPixel & 255);
								alphaPixel = (lime_math_RGBA.__clamp[Math.round((alphaPixel >>> 24 & 255) * lime_math_RGBA.unmult)] & 255) << 24 | (lime_math_RGBA.__clamp[Math.round((alphaPixel >>> 16 & 255) * lime_math_RGBA.unmult)] & 255) << 16 | (lime_math_RGBA.__clamp[Math.round((alphaPixel >>> 8 & 255) * lime_math_RGBA.unmult)] & 255) << 8 | alphaPixel & 255 & 255;
							}
						}
						var value = Math.round((sourcePixel & 255) * ((alphaPixel & 255) / 255));
						sourcePixel = (sourcePixel >>> 24 & 255 & 255) << 24 | (sourcePixel >>> 16 & 255 & 255) << 16 | (sourcePixel >>> 8 & 255 & 255) << 8 | value & 255;
						var format2 = destFormat;
						var premultiplied2 = destPremultiplied;
						if(premultiplied2 == null) {
							premultiplied2 = false;
						}
						if(format2 == null) {
							format2 = 0;
						}
						if(premultiplied2) {
							if((sourcePixel & 255) == 0) {
								if(sourcePixel != 0) {
									sourcePixel = 0;
								}
							} else if((sourcePixel & 255) != 255) {
								lime_math_RGBA.a16 = lime_math_RGBA.__alpha16[sourcePixel & 255];
								sourcePixel = ((sourcePixel >>> 24 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 24 | ((sourcePixel >>> 16 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 16 | ((sourcePixel >>> 8 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 8 | sourcePixel & 255 & 255;
							}
						}
						switch(format2) {
						case 0:
							destData[destPosition] = sourcePixel >>> 24 & 255;
							destData[destPosition + 1] = sourcePixel >>> 16 & 255;
							destData[destPosition + 2] = sourcePixel >>> 8 & 255;
							destData[destPosition + 3] = sourcePixel & 255;
							break;
						case 1:
							destData[destPosition] = sourcePixel & 255;
							destData[destPosition + 1] = sourcePixel >>> 24 & 255;
							destData[destPosition + 2] = sourcePixel >>> 16 & 255;
							destData[destPosition + 3] = sourcePixel >>> 8 & 255;
							break;
						case 2:
							destData[destPosition] = sourcePixel >>> 8 & 255;
							destData[destPosition + 1] = sourcePixel >>> 16 & 255;
							destData[destPosition + 2] = sourcePixel >>> 24 & 255;
							destData[destPosition + 3] = sourcePixel & 255;
							break;
						}
						sourcePosition += 4;
						destPosition += 4;
						alphaPosition += 4;
					}
				}
			}
		}
	}
	image.dirty = true;
	image.version++;
};
lime__$internal_graphics_ImageDataUtil.fillRect = function(image,rect,color,format) {
	var fillColor;
	switch(format) {
	case 1:
		var argb = color;
		var rgba = 0;
		rgba = (argb >>> 16 & 255 & 255) << 24 | (argb >>> 8 & 255 & 255) << 16 | (argb & 255 & 255) << 8 | argb >>> 24 & 255 & 255;
		fillColor = rgba;
		break;
	case 2:
		var bgra = color;
		var rgba = 0;
		rgba = (bgra >>> 8 & 255 & 255) << 24 | (bgra >>> 16 & 255 & 255) << 16 | (bgra >>> 24 & 255 & 255) << 8 | bgra & 255 & 255;
		fillColor = rgba;
		break;
	default:
		fillColor = color;
	}
	if(!image.get_transparent()) {
		fillColor = (fillColor >>> 24 & 255 & 255) << 24 | (fillColor >>> 16 & 255 & 255) << 16 | (fillColor >>> 8 & 255 & 255) << 8 | 255;
	}
	var data = image.buffer.data;
	if(data == null) {
		return;
	}
	var format = image.buffer.format;
	var premultiplied = image.buffer.premultiplied;
	if(premultiplied) {
		if((fillColor & 255) == 0) {
			if(fillColor != 0) {
				fillColor = 0;
			}
		} else if((fillColor & 255) != 255) {
			lime_math_RGBA.a16 = lime_math_RGBA.__alpha16[fillColor & 255];
			fillColor = ((fillColor >>> 24 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 24 | ((fillColor >>> 16 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 16 | ((fillColor >>> 8 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 8 | fillColor & 255 & 255;
		}
	}
	var dataView = new lime__$internal_graphics__$ImageDataUtil_ImageDataView(image,rect);
	var row;
	var _g = 0;
	var _g1 = dataView.height;
	while(_g < _g1) {
		var y = _g++;
		row = dataView.byteOffset + dataView.stride * y;
		var _g2 = 0;
		var _g3 = dataView.width;
		while(_g2 < _g3) {
			var x = _g2++;
			var offset = row + x * 4;
			var format1 = format;
			var premultiplied = false;
			if(premultiplied == null) {
				premultiplied = false;
			}
			if(format1 == null) {
				format1 = 0;
			}
			if(premultiplied) {
				if((fillColor & 255) == 0) {
					if(fillColor != 0) {
						fillColor = 0;
					}
				} else if((fillColor & 255) != 255) {
					lime_math_RGBA.a16 = lime_math_RGBA.__alpha16[fillColor & 255];
					fillColor = ((fillColor >>> 24 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 24 | ((fillColor >>> 16 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 16 | ((fillColor >>> 8 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 8 | fillColor & 255 & 255;
				}
			}
			switch(format1) {
			case 0:
				data[offset] = fillColor >>> 24 & 255;
				data[offset + 1] = fillColor >>> 16 & 255;
				data[offset + 2] = fillColor >>> 8 & 255;
				data[offset + 3] = fillColor & 255;
				break;
			case 1:
				data[offset] = fillColor & 255;
				data[offset + 1] = fillColor >>> 24 & 255;
				data[offset + 2] = fillColor >>> 16 & 255;
				data[offset + 3] = fillColor >>> 8 & 255;
				break;
			case 2:
				data[offset] = fillColor >>> 8 & 255;
				data[offset + 1] = fillColor >>> 16 & 255;
				data[offset + 2] = fillColor >>> 24 & 255;
				data[offset + 3] = fillColor & 255;
				break;
			}
		}
	}
	image.dirty = true;
	image.version++;
};
lime__$internal_graphics_ImageDataUtil.floodFill = function(image,x,y,color,format) {
	var data = image.buffer.data;
	if(data == null) {
		return;
	}
	if(format == 1) {
		color = (color & 16777215) << 8 | color >> 24 & 255;
	}
	var format = image.buffer.format;
	var premultiplied = image.buffer.premultiplied;
	var fillColor = color;
	var hitColor = 0;
	var offset = (y + image.offsetY) * (image.buffer.width * 4) + (x + image.offsetX) * 4;
	var format1 = format;
	var premultiplied1 = premultiplied;
	if(premultiplied1 == null) {
		premultiplied1 = false;
	}
	if(format1 == null) {
		format1 = 0;
	}
	switch(format1) {
	case 0:
		hitColor = (data[offset] & 255) << 24 | (data[offset + 1] & 255) << 16 | (data[offset + 2] & 255) << 8 | data[offset + 3] & 255;
		break;
	case 1:
		hitColor = (data[offset + 1] & 255) << 24 | (data[offset + 2] & 255) << 16 | (data[offset + 3] & 255) << 8 | data[offset] & 255;
		break;
	case 2:
		hitColor = (data[offset + 2] & 255) << 24 | (data[offset + 1] & 255) << 16 | (data[offset] & 255) << 8 | data[offset + 3] & 255;
		break;
	}
	if(premultiplied1) {
		if((hitColor & 255) != 0 && (hitColor & 255) != 255) {
			lime_math_RGBA.unmult = 255.0 / (hitColor & 255);
			hitColor = (lime_math_RGBA.__clamp[Math.round((hitColor >>> 24 & 255) * lime_math_RGBA.unmult)] & 255) << 24 | (lime_math_RGBA.__clamp[Math.round((hitColor >>> 16 & 255) * lime_math_RGBA.unmult)] & 255) << 16 | (lime_math_RGBA.__clamp[Math.round((hitColor >>> 8 & 255) * lime_math_RGBA.unmult)] & 255) << 8 | hitColor & 255 & 255;
		}
	}
	if(!image.get_transparent()) {
		fillColor = (fillColor >>> 24 & 255 & 255) << 24 | (fillColor >>> 16 & 255 & 255) << 16 | (fillColor >>> 8 & 255 & 255) << 8 | 255;
		hitColor = (hitColor >>> 24 & 255 & 255) << 24 | (hitColor >>> 16 & 255 & 255) << 16 | (hitColor >>> 8 & 255 & 255) << 8 | 255;
	}
	if(fillColor == hitColor) {
		return;
	}
	if(premultiplied) {
		if((fillColor & 255) == 0) {
			if(fillColor != 0) {
				fillColor = 0;
			}
		} else if((fillColor & 255) != 255) {
			lime_math_RGBA.a16 = lime_math_RGBA.__alpha16[fillColor & 255];
			fillColor = ((fillColor >>> 24 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 24 | ((fillColor >>> 16 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 16 | ((fillColor >>> 8 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 8 | fillColor & 255 & 255;
		}
	}
	var dx = [0,-1,1,0];
	var dy = [-1,0,0,1];
	var minX = -image.offsetX;
	var minY = -image.offsetY;
	var maxX = minX + image.width;
	var maxY = minY + image.height;
	var queue = [];
	queue.push(x);
	queue.push(y);
	var curPointX;
	var curPointY;
	var nextPointX;
	var nextPointY;
	var nextPointOffset;
	var readColor = 0;
	while(queue.length > 0) {
		curPointY = queue.pop();
		curPointX = queue.pop();
		var _g = 0;
		while(_g < 4) {
			var i = _g++;
			nextPointX = curPointX + dx[i];
			nextPointY = curPointY + dy[i];
			if(nextPointX < minX || nextPointY < minY || nextPointX >= maxX || nextPointY >= maxY) {
				continue;
			}
			nextPointOffset = (nextPointY * image.width + nextPointX) * 4;
			var format1 = format;
			var premultiplied1 = premultiplied;
			if(premultiplied1 == null) {
				premultiplied1 = false;
			}
			if(format1 == null) {
				format1 = 0;
			}
			switch(format1) {
			case 0:
				readColor = (data[nextPointOffset] & 255) << 24 | (data[nextPointOffset + 1] & 255) << 16 | (data[nextPointOffset + 2] & 255) << 8 | data[nextPointOffset + 3] & 255;
				break;
			case 1:
				readColor = (data[nextPointOffset + 1] & 255) << 24 | (data[nextPointOffset + 2] & 255) << 16 | (data[nextPointOffset + 3] & 255) << 8 | data[nextPointOffset] & 255;
				break;
			case 2:
				readColor = (data[nextPointOffset + 2] & 255) << 24 | (data[nextPointOffset + 1] & 255) << 16 | (data[nextPointOffset] & 255) << 8 | data[nextPointOffset + 3] & 255;
				break;
			}
			if(premultiplied1) {
				if((readColor & 255) != 0 && (readColor & 255) != 255) {
					lime_math_RGBA.unmult = 255.0 / (readColor & 255);
					readColor = (lime_math_RGBA.__clamp[Math.round((readColor >>> 24 & 255) * lime_math_RGBA.unmult)] & 255) << 24 | (lime_math_RGBA.__clamp[Math.round((readColor >>> 16 & 255) * lime_math_RGBA.unmult)] & 255) << 16 | (lime_math_RGBA.__clamp[Math.round((readColor >>> 8 & 255) * lime_math_RGBA.unmult)] & 255) << 8 | readColor & 255 & 255;
				}
			}
			if(readColor == hitColor) {
				var format2 = format;
				var premultiplied2 = false;
				if(premultiplied2 == null) {
					premultiplied2 = false;
				}
				if(format2 == null) {
					format2 = 0;
				}
				if(premultiplied2) {
					if((fillColor & 255) == 0) {
						if(fillColor != 0) {
							fillColor = 0;
						}
					} else if((fillColor & 255) != 255) {
						lime_math_RGBA.a16 = lime_math_RGBA.__alpha16[fillColor & 255];
						fillColor = ((fillColor >>> 24 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 24 | ((fillColor >>> 16 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 16 | ((fillColor >>> 8 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 8 | fillColor & 255 & 255;
					}
				}
				switch(format2) {
				case 0:
					data[nextPointOffset] = fillColor >>> 24 & 255;
					data[nextPointOffset + 1] = fillColor >>> 16 & 255;
					data[nextPointOffset + 2] = fillColor >>> 8 & 255;
					data[nextPointOffset + 3] = fillColor & 255;
					break;
				case 1:
					data[nextPointOffset] = fillColor & 255;
					data[nextPointOffset + 1] = fillColor >>> 24 & 255;
					data[nextPointOffset + 2] = fillColor >>> 16 & 255;
					data[nextPointOffset + 3] = fillColor >>> 8 & 255;
					break;
				case 2:
					data[nextPointOffset] = fillColor >>> 8 & 255;
					data[nextPointOffset + 1] = fillColor >>> 16 & 255;
					data[nextPointOffset + 2] = fillColor >>> 24 & 255;
					data[nextPointOffset + 3] = fillColor & 255;
					break;
				}
				queue.push(nextPointX);
				queue.push(nextPointY);
			}
		}
	}
	image.dirty = true;
	image.version++;
};
lime__$internal_graphics_ImageDataUtil.gaussianBlur = function(image,sourceImage,sourceRect,destPoint,blurX,blurY,quality,strength,color) {
	if(strength == null) {
		strength = 1;
	}
	if(quality == null) {
		quality = 1;
	}
	if(blurY == null) {
		blurY = 4;
	}
	if(blurX == null) {
		blurX = 4;
	}
	var imagePremultiplied = image.get_premultiplied();
	if(imagePremultiplied) {
		image.set_premultiplied(false);
	}
	lime__$internal_graphics_StackBlur.blur(image,sourceImage,sourceRect,destPoint,blurX,blurY,quality);
	image.dirty = true;
	image.version++;
	if(imagePremultiplied) {
		image.set_premultiplied(true);
	}
	return image;
};
lime__$internal_graphics_ImageDataUtil.getColorBoundsRect = function(image,mask,color,findColor,format) {
	var left = image.width + 1;
	var right = 0;
	var top = image.height + 1;
	var bottom = 0;
	var _color;
	var _mask;
	switch(format) {
	case 1:
		var argb = color;
		var rgba = 0;
		rgba = (argb >>> 16 & 255 & 255) << 24 | (argb >>> 8 & 255 & 255) << 16 | (argb & 255 & 255) << 8 | argb >>> 24 & 255 & 255;
		_color = rgba;
		var argb = mask;
		var rgba = 0;
		rgba = (argb >>> 16 & 255 & 255) << 24 | (argb >>> 8 & 255 & 255) << 16 | (argb & 255 & 255) << 8 | argb >>> 24 & 255 & 255;
		_mask = rgba;
		break;
	case 2:
		var bgra = color;
		var rgba = 0;
		rgba = (bgra >>> 8 & 255 & 255) << 24 | (bgra >>> 16 & 255 & 255) << 16 | (bgra >>> 24 & 255 & 255) << 8 | bgra & 255 & 255;
		_color = rgba;
		var bgra = mask;
		var rgba = 0;
		rgba = (bgra >>> 8 & 255 & 255) << 24 | (bgra >>> 16 & 255 & 255) << 16 | (bgra >>> 24 & 255 & 255) << 8 | bgra & 255 & 255;
		_mask = rgba;
		break;
	default:
		_color = color;
		_mask = mask;
	}
	if(!image.get_transparent()) {
		_color = (_color >>> 24 & 255 & 255) << 24 | (_color >>> 16 & 255 & 255) << 16 | (_color >>> 8 & 255 & 255) << 8 | 255;
		_mask = (_mask >>> 24 & 255 & 255) << 24 | (_mask >>> 16 & 255 & 255) << 16 | (_mask >>> 8 & 255 & 255) << 8 | 255;
	}
	var pixel;
	var hit;
	var _g = 0;
	var _g1 = image.width;
	while(_g < _g1) {
		var x = _g++;
		hit = false;
		var _g2 = 0;
		var _g3 = image.height;
		while(_g2 < _g3) {
			var y = _g2++;
			pixel = image.getPixel32(x,y,0);
			hit = findColor ? (pixel & _mask) == _color : (pixel & _mask) != _color;
			if(hit) {
				if(x < left) {
					left = x;
				}
				break;
			}
		}
		if(hit) {
			break;
		}
	}
	var ix;
	var _g = 0;
	var _g1 = image.width;
	while(_g < _g1) {
		var x = _g++;
		ix = image.width - 1 - x;
		hit = false;
		var _g2 = 0;
		var _g3 = image.height;
		while(_g2 < _g3) {
			var y = _g2++;
			pixel = image.getPixel32(ix,y,0);
			hit = findColor ? (pixel & _mask) == _color : (pixel & _mask) != _color;
			if(hit) {
				if(ix > right) {
					right = ix;
				}
				break;
			}
		}
		if(hit) {
			break;
		}
	}
	var _g = 0;
	var _g1 = image.height;
	while(_g < _g1) {
		var y = _g++;
		hit = false;
		var _g2 = 0;
		var _g3 = image.width;
		while(_g2 < _g3) {
			var x = _g2++;
			pixel = image.getPixel32(x,y,0);
			hit = findColor ? (pixel & _mask) == _color : (pixel & _mask) != _color;
			if(hit) {
				if(y < top) {
					top = y;
				}
				break;
			}
		}
		if(hit) {
			break;
		}
	}
	var iy;
	var _g = 0;
	var _g1 = image.height;
	while(_g < _g1) {
		var y = _g++;
		iy = image.height - 1 - y;
		hit = false;
		var _g2 = 0;
		var _g3 = image.width;
		while(_g2 < _g3) {
			var x = _g2++;
			pixel = image.getPixel32(x,iy,0);
			hit = findColor ? (pixel & _mask) == _color : (pixel & _mask) != _color;
			if(hit) {
				if(iy > bottom) {
					bottom = iy;
				}
				break;
			}
		}
		if(hit) {
			break;
		}
	}
	var w = right - left;
	var h = bottom - top;
	if(w > 0) {
		++w;
	}
	if(h > 0) {
		++h;
	}
	if(w < 0) {
		w = 0;
	}
	if(h < 0) {
		h = 0;
	}
	if(left == right) {
		w = 1;
	}
	if(top == bottom) {
		h = 1;
	}
	if(left > image.width) {
		left = 0;
	}
	if(top > image.height) {
		top = 0;
	}
	return new lime_math_Rectangle(left,top,w,h);
};
lime__$internal_graphics_ImageDataUtil.getPixel = function(image,x,y,format) {
	var pixel = 0;
	var data = image.buffer.data;
	var offset = 4 * (y + image.offsetY) * image.buffer.width + (x + image.offsetX) * 4;
	var format1 = image.buffer.format;
	var premultiplied = image.buffer.premultiplied;
	if(premultiplied == null) {
		premultiplied = false;
	}
	if(format1 == null) {
		format1 = 0;
	}
	switch(format1) {
	case 0:
		pixel = (data[offset] & 255) << 24 | (data[offset + 1] & 255) << 16 | (data[offset + 2] & 255) << 8 | data[offset + 3] & 255;
		break;
	case 1:
		pixel = (data[offset + 1] & 255) << 24 | (data[offset + 2] & 255) << 16 | (data[offset + 3] & 255) << 8 | data[offset] & 255;
		break;
	case 2:
		pixel = (data[offset + 2] & 255) << 24 | (data[offset + 1] & 255) << 16 | (data[offset] & 255) << 8 | data[offset + 3] & 255;
		break;
	}
	if(premultiplied) {
		if((pixel & 255) != 0 && (pixel & 255) != 255) {
			lime_math_RGBA.unmult = 255.0 / (pixel & 255);
			pixel = (lime_math_RGBA.__clamp[Math.round((pixel >>> 24 & 255) * lime_math_RGBA.unmult)] & 255) << 24 | (lime_math_RGBA.__clamp[Math.round((pixel >>> 16 & 255) * lime_math_RGBA.unmult)] & 255) << 16 | (lime_math_RGBA.__clamp[Math.round((pixel >>> 8 & 255) * lime_math_RGBA.unmult)] & 255) << 8 | pixel & 255 & 255;
		}
	}
	pixel = (pixel >>> 24 & 255 & 255) << 24 | (pixel >>> 16 & 255 & 255) << 16 | (pixel >>> 8 & 255 & 255) << 8 | 0;
	switch(format) {
	case 1:
		var argb = 0;
		argb = (pixel & 255 & 255) << 24 | (pixel >>> 24 & 255 & 255) << 16 | (pixel >>> 16 & 255 & 255) << 8 | pixel >>> 8 & 255 & 255;
		return argb;
	case 2:
		var bgra = 0;
		bgra = (pixel >>> 8 & 255 & 255) << 24 | (pixel >>> 16 & 255 & 255) << 16 | (pixel >>> 24 & 255 & 255) << 8 | pixel & 255 & 255;
		return bgra;
	default:
		return pixel;
	}
};
lime__$internal_graphics_ImageDataUtil.getPixel32 = function(image,x,y,format) {
	var pixel = 0;
	var data = image.buffer.data;
	var offset = 4 * (y + image.offsetY) * image.buffer.width + (x + image.offsetX) * 4;
	var format1 = image.buffer.format;
	var premultiplied = image.buffer.premultiplied;
	if(premultiplied == null) {
		premultiplied = false;
	}
	if(format1 == null) {
		format1 = 0;
	}
	switch(format1) {
	case 0:
		pixel = (data[offset] & 255) << 24 | (data[offset + 1] & 255) << 16 | (data[offset + 2] & 255) << 8 | data[offset + 3] & 255;
		break;
	case 1:
		pixel = (data[offset + 1] & 255) << 24 | (data[offset + 2] & 255) << 16 | (data[offset + 3] & 255) << 8 | data[offset] & 255;
		break;
	case 2:
		pixel = (data[offset + 2] & 255) << 24 | (data[offset + 1] & 255) << 16 | (data[offset] & 255) << 8 | data[offset + 3] & 255;
		break;
	}
	if(premultiplied) {
		if((pixel & 255) != 0 && (pixel & 255) != 255) {
			lime_math_RGBA.unmult = 255.0 / (pixel & 255);
			pixel = (lime_math_RGBA.__clamp[Math.round((pixel >>> 24 & 255) * lime_math_RGBA.unmult)] & 255) << 24 | (lime_math_RGBA.__clamp[Math.round((pixel >>> 16 & 255) * lime_math_RGBA.unmult)] & 255) << 16 | (lime_math_RGBA.__clamp[Math.round((pixel >>> 8 & 255) * lime_math_RGBA.unmult)] & 255) << 8 | pixel & 255 & 255;
		}
	}
	switch(format) {
	case 1:
		var argb = 0;
		argb = (pixel & 255 & 255) << 24 | (pixel >>> 24 & 255 & 255) << 16 | (pixel >>> 16 & 255 & 255) << 8 | pixel >>> 8 & 255 & 255;
		return argb;
	case 2:
		var bgra = 0;
		bgra = (pixel >>> 8 & 255 & 255) << 24 | (pixel >>> 16 & 255 & 255) << 16 | (pixel >>> 24 & 255 & 255) << 8 | pixel & 255 & 255;
		return bgra;
	default:
		return pixel;
	}
};
lime__$internal_graphics_ImageDataUtil.getPixels = function(image,rect,format) {
	if(image.buffer.data == null) {
		return null;
	}
	var length = rect.width * rect.height | 0;
	var bytes = new haxe_io_Bytes(new ArrayBuffer(length * 4));
	var data = image.buffer.data;
	var sourceFormat = image.buffer.format;
	var premultiplied = image.buffer.premultiplied;
	var dataView = new lime__$internal_graphics__$ImageDataUtil_ImageDataView(image,rect);
	var position;
	var argb = 0;
	var bgra = 0;
	var pixel = 0;
	var destPosition = 0;
	var _g = 0;
	var _g1 = dataView.height;
	while(_g < _g1) {
		var y = _g++;
		position = dataView.byteOffset + dataView.stride * y;
		var _g2 = 0;
		var _g3 = dataView.width;
		while(_g2 < _g3) {
			var x = _g2++;
			var format1 = sourceFormat;
			var premultiplied1 = premultiplied;
			if(premultiplied1 == null) {
				premultiplied1 = false;
			}
			if(format1 == null) {
				format1 = 0;
			}
			switch(format1) {
			case 0:
				pixel = (data[position] & 255) << 24 | (data[position + 1] & 255) << 16 | (data[position + 2] & 255) << 8 | data[position + 3] & 255;
				break;
			case 1:
				pixel = (data[position + 1] & 255) << 24 | (data[position + 2] & 255) << 16 | (data[position + 3] & 255) << 8 | data[position] & 255;
				break;
			case 2:
				pixel = (data[position + 2] & 255) << 24 | (data[position + 1] & 255) << 16 | (data[position] & 255) << 8 | data[position + 3] & 255;
				break;
			}
			if(premultiplied1) {
				if((pixel & 255) != 0 && (pixel & 255) != 255) {
					lime_math_RGBA.unmult = 255.0 / (pixel & 255);
					pixel = (lime_math_RGBA.__clamp[Math.round((pixel >>> 24 & 255) * lime_math_RGBA.unmult)] & 255) << 24 | (lime_math_RGBA.__clamp[Math.round((pixel >>> 16 & 255) * lime_math_RGBA.unmult)] & 255) << 16 | (lime_math_RGBA.__clamp[Math.round((pixel >>> 8 & 255) * lime_math_RGBA.unmult)] & 255) << 8 | pixel & 255 & 255;
				}
			}
			switch(format) {
			case 1:
				var argb1 = 0;
				argb1 = (pixel & 255 & 255) << 24 | (pixel >>> 24 & 255 & 255) << 16 | (pixel >>> 16 & 255 & 255) << 8 | pixel >>> 8 & 255 & 255;
				argb = argb1;
				pixel = argb;
				break;
			case 2:
				var bgra1 = 0;
				bgra1 = (pixel >>> 8 & 255 & 255) << 24 | (pixel >>> 16 & 255 & 255) << 16 | (pixel >>> 24 & 255 & 255) << 8 | pixel & 255 & 255;
				bgra = bgra1;
				pixel = bgra;
				break;
			default:
			}
			bytes.b[destPosition++] = pixel >>> 24 & 255;
			bytes.b[destPosition++] = pixel >>> 16 & 255;
			bytes.b[destPosition++] = pixel >>> 8 & 255;
			bytes.b[destPosition++] = pixel & 255;
			position += 4;
		}
	}
	return bytes;
};
lime__$internal_graphics_ImageDataUtil.merge = function(image,sourceImage,sourceRect,destPoint,redMultiplier,greenMultiplier,blueMultiplier,alphaMultiplier) {
	if(image.buffer.data == null || sourceImage.buffer.data == null) {
		return;
	}
	var sourceView = new lime__$internal_graphics__$ImageDataUtil_ImageDataView(sourceImage,sourceRect);
	var destView = new lime__$internal_graphics__$ImageDataUtil_ImageDataView(image,new lime_math_Rectangle(destPoint.x,destPoint.y,sourceView.width,sourceView.height));
	var sourceData = sourceImage.buffer.data;
	var destData = image.buffer.data;
	var sourceFormat = sourceImage.buffer.format;
	var destFormat = image.buffer.format;
	var sourcePremultiplied = sourceImage.buffer.premultiplied;
	var destPremultiplied = image.buffer.premultiplied;
	var sourcePosition;
	var destPosition;
	var sourcePixel = 0;
	var destPixel = 0;
	var _g = 0;
	var _g1 = destView.height;
	while(_g < _g1) {
		var y = _g++;
		sourcePosition = sourceView.byteOffset + sourceView.stride * y;
		destPosition = destView.byteOffset + destView.stride * y;
		var _g2 = 0;
		var _g3 = destView.width;
		while(_g2 < _g3) {
			var x = _g2++;
			var format = sourceFormat;
			var premultiplied = sourcePremultiplied;
			if(premultiplied == null) {
				premultiplied = false;
			}
			if(format == null) {
				format = 0;
			}
			switch(format) {
			case 0:
				sourcePixel = (sourceData[sourcePosition] & 255) << 24 | (sourceData[sourcePosition + 1] & 255) << 16 | (sourceData[sourcePosition + 2] & 255) << 8 | sourceData[sourcePosition + 3] & 255;
				break;
			case 1:
				sourcePixel = (sourceData[sourcePosition + 1] & 255) << 24 | (sourceData[sourcePosition + 2] & 255) << 16 | (sourceData[sourcePosition + 3] & 255) << 8 | sourceData[sourcePosition] & 255;
				break;
			case 2:
				sourcePixel = (sourceData[sourcePosition + 2] & 255) << 24 | (sourceData[sourcePosition + 1] & 255) << 16 | (sourceData[sourcePosition] & 255) << 8 | sourceData[sourcePosition + 3] & 255;
				break;
			}
			if(premultiplied) {
				if((sourcePixel & 255) != 0 && (sourcePixel & 255) != 255) {
					lime_math_RGBA.unmult = 255.0 / (sourcePixel & 255);
					sourcePixel = (lime_math_RGBA.__clamp[Math.round((sourcePixel >>> 24 & 255) * lime_math_RGBA.unmult)] & 255) << 24 | (lime_math_RGBA.__clamp[Math.round((sourcePixel >>> 16 & 255) * lime_math_RGBA.unmult)] & 255) << 16 | (lime_math_RGBA.__clamp[Math.round((sourcePixel >>> 8 & 255) * lime_math_RGBA.unmult)] & 255) << 8 | sourcePixel & 255 & 255;
				}
			}
			var format1 = destFormat;
			var premultiplied1 = destPremultiplied;
			if(premultiplied1 == null) {
				premultiplied1 = false;
			}
			if(format1 == null) {
				format1 = 0;
			}
			switch(format1) {
			case 0:
				destPixel = (destData[destPosition] & 255) << 24 | (destData[destPosition + 1] & 255) << 16 | (destData[destPosition + 2] & 255) << 8 | destData[destPosition + 3] & 255;
				break;
			case 1:
				destPixel = (destData[destPosition + 1] & 255) << 24 | (destData[destPosition + 2] & 255) << 16 | (destData[destPosition + 3] & 255) << 8 | destData[destPosition] & 255;
				break;
			case 2:
				destPixel = (destData[destPosition + 2] & 255) << 24 | (destData[destPosition + 1] & 255) << 16 | (destData[destPosition] & 255) << 8 | destData[destPosition + 3] & 255;
				break;
			}
			if(premultiplied1) {
				if((destPixel & 255) != 0 && (destPixel & 255) != 255) {
					lime_math_RGBA.unmult = 255.0 / (destPixel & 255);
					destPixel = (lime_math_RGBA.__clamp[Math.round((destPixel >>> 24 & 255) * lime_math_RGBA.unmult)] & 255) << 24 | (lime_math_RGBA.__clamp[Math.round((destPixel >>> 16 & 255) * lime_math_RGBA.unmult)] & 255) << 16 | (lime_math_RGBA.__clamp[Math.round((destPixel >>> 8 & 255) * lime_math_RGBA.unmult)] & 255) << 8 | destPixel & 255 & 255;
				}
			}
			var value = ((sourcePixel >>> 24 & 255) * redMultiplier + (destPixel >>> 24 & 255) * (256 - redMultiplier)) / 256 | 0;
			destPixel = (value & 255) << 24 | (destPixel >>> 16 & 255 & 255) << 16 | (destPixel >>> 8 & 255 & 255) << 8 | destPixel & 255 & 255;
			var value1 = ((sourcePixel >>> 16 & 255) * greenMultiplier + (destPixel >>> 16 & 255) * (256 - greenMultiplier)) / 256 | 0;
			destPixel = (destPixel >>> 24 & 255 & 255) << 24 | (value1 & 255) << 16 | (destPixel >>> 8 & 255 & 255) << 8 | destPixel & 255 & 255;
			var value2 = ((sourcePixel >>> 8 & 255) * blueMultiplier + (destPixel >>> 8 & 255) * (256 - blueMultiplier)) / 256 | 0;
			destPixel = (destPixel >>> 24 & 255 & 255) << 24 | (destPixel >>> 16 & 255 & 255) << 16 | (value2 & 255) << 8 | destPixel & 255 & 255;
			var value3 = ((sourcePixel & 255) * alphaMultiplier + (destPixel & 255) * (256 - alphaMultiplier)) / 256 | 0;
			destPixel = (destPixel >>> 24 & 255 & 255) << 24 | (destPixel >>> 16 & 255 & 255) << 16 | (destPixel >>> 8 & 255 & 255) << 8 | value3 & 255;
			var format2 = destFormat;
			var premultiplied2 = destPremultiplied;
			if(premultiplied2 == null) {
				premultiplied2 = false;
			}
			if(format2 == null) {
				format2 = 0;
			}
			if(premultiplied2) {
				if((destPixel & 255) == 0) {
					if(destPixel != 0) {
						destPixel = 0;
					}
				} else if((destPixel & 255) != 255) {
					lime_math_RGBA.a16 = lime_math_RGBA.__alpha16[destPixel & 255];
					destPixel = ((destPixel >>> 24 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 24 | ((destPixel >>> 16 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 16 | ((destPixel >>> 8 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 8 | destPixel & 255 & 255;
				}
			}
			switch(format2) {
			case 0:
				destData[destPosition] = destPixel >>> 24 & 255;
				destData[destPosition + 1] = destPixel >>> 16 & 255;
				destData[destPosition + 2] = destPixel >>> 8 & 255;
				destData[destPosition + 3] = destPixel & 255;
				break;
			case 1:
				destData[destPosition] = destPixel & 255;
				destData[destPosition + 1] = destPixel >>> 24 & 255;
				destData[destPosition + 2] = destPixel >>> 16 & 255;
				destData[destPosition + 3] = destPixel >>> 8 & 255;
				break;
			case 2:
				destData[destPosition] = destPixel >>> 8 & 255;
				destData[destPosition + 1] = destPixel >>> 16 & 255;
				destData[destPosition + 2] = destPixel >>> 24 & 255;
				destData[destPosition + 3] = destPixel & 255;
				break;
			}
			sourcePosition += 4;
			destPosition += 4;
		}
	}
	image.dirty = true;
	image.version++;
};
lime__$internal_graphics_ImageDataUtil.multiplyAlpha = function(image) {
	var data = image.buffer.data;
	if(data == null || !image.buffer.transparent) {
		return;
	}
	var format = image.buffer.format;
	var length = data.length / 4 | 0;
	var pixel = 0;
	var _g = 0;
	var _g1 = length;
	while(_g < _g1) {
		var i = _g++;
		var offset = i * 4;
		var format1 = format;
		var premultiplied = false;
		if(premultiplied == null) {
			premultiplied = false;
		}
		if(format1 == null) {
			format1 = 0;
		}
		switch(format1) {
		case 0:
			pixel = (data[offset] & 255) << 24 | (data[offset + 1] & 255) << 16 | (data[offset + 2] & 255) << 8 | data[offset + 3] & 255;
			break;
		case 1:
			pixel = (data[offset + 1] & 255) << 24 | (data[offset + 2] & 255) << 16 | (data[offset + 3] & 255) << 8 | data[offset] & 255;
			break;
		case 2:
			pixel = (data[offset + 2] & 255) << 24 | (data[offset + 1] & 255) << 16 | (data[offset] & 255) << 8 | data[offset + 3] & 255;
			break;
		}
		if(premultiplied) {
			if((pixel & 255) != 0 && (pixel & 255) != 255) {
				lime_math_RGBA.unmult = 255.0 / (pixel & 255);
				pixel = (lime_math_RGBA.__clamp[Math.round((pixel >>> 24 & 255) * lime_math_RGBA.unmult)] & 255) << 24 | (lime_math_RGBA.__clamp[Math.round((pixel >>> 16 & 255) * lime_math_RGBA.unmult)] & 255) << 16 | (lime_math_RGBA.__clamp[Math.round((pixel >>> 8 & 255) * lime_math_RGBA.unmult)] & 255) << 8 | pixel & 255 & 255;
			}
		}
		var offset1 = i * 4;
		var format2 = format;
		var premultiplied1 = true;
		if(premultiplied1 == null) {
			premultiplied1 = false;
		}
		if(format2 == null) {
			format2 = 0;
		}
		if(premultiplied1) {
			if((pixel & 255) == 0) {
				if(pixel != 0) {
					pixel = 0;
				}
			} else if((pixel & 255) != 255) {
				lime_math_RGBA.a16 = lime_math_RGBA.__alpha16[pixel & 255];
				pixel = ((pixel >>> 24 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 24 | ((pixel >>> 16 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 16 | ((pixel >>> 8 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 8 | pixel & 255 & 255;
			}
		}
		switch(format2) {
		case 0:
			data[offset1] = pixel >>> 24 & 255;
			data[offset1 + 1] = pixel >>> 16 & 255;
			data[offset1 + 2] = pixel >>> 8 & 255;
			data[offset1 + 3] = pixel & 255;
			break;
		case 1:
			data[offset1] = pixel & 255;
			data[offset1 + 1] = pixel >>> 24 & 255;
			data[offset1 + 2] = pixel >>> 16 & 255;
			data[offset1 + 3] = pixel >>> 8 & 255;
			break;
		case 2:
			data[offset1] = pixel >>> 8 & 255;
			data[offset1 + 1] = pixel >>> 16 & 255;
			data[offset1 + 2] = pixel >>> 24 & 255;
			data[offset1 + 3] = pixel & 255;
			break;
		}
	}
	image.buffer.premultiplied = true;
	image.dirty = true;
	image.version++;
};
lime__$internal_graphics_ImageDataUtil.resize = function(image,newWidth,newHeight) {
	var buffer = image.buffer;
	if(buffer.width == newWidth && buffer.height == newHeight) {
		return;
	}
	var elements = newWidth * newHeight * 4;
	var array = null;
	var vector = null;
	var view = null;
	var buffer1 = null;
	var len = null;
	var this1;
	if(elements != null) {
		this1 = new Uint8Array(elements);
	} else if(array != null) {
		this1 = new Uint8Array(array);
	} else if(vector != null) {
		this1 = new Uint8Array(vector.__array);
	} else if(view != null) {
		this1 = new Uint8Array(view);
	} else if(buffer1 != null) {
		if(len == null) {
			this1 = new Uint8Array(buffer1,0);
		} else {
			this1 = new Uint8Array(buffer1,0,len);
		}
	} else {
		this1 = null;
	}
	var newBuffer = new lime_graphics_ImageBuffer(this1,newWidth,newHeight);
	var imageWidth = image.width;
	var imageHeight = image.height;
	var data = image.get_data();
	var newData = newBuffer.data;
	var sourceIndex;
	var sourceIndexX;
	var sourceIndexY;
	var sourceIndexXY;
	var index;
	var sourceX;
	var sourceY;
	var u;
	var v;
	var uRatio;
	var vRatio;
	var uOpposite;
	var vOpposite;
	var _g = 0;
	var _g1 = newHeight;
	while(_g < _g1) {
		var y = _g++;
		var _g2 = 0;
		var _g3 = newWidth;
		while(_g2 < _g3) {
			var x = _g2++;
			u = (x + 0.5) / newWidth * imageWidth - 0.5;
			v = (y + 0.5) / newHeight * imageHeight - 0.5;
			sourceX = u | 0;
			sourceY = v | 0;
			sourceIndex = (sourceY * imageWidth + sourceX) * 4;
			sourceIndexX = sourceX < imageWidth - 1 ? sourceIndex + 4 : sourceIndex;
			sourceIndexY = sourceY < imageHeight - 1 ? sourceIndex + imageWidth * 4 : sourceIndex;
			sourceIndexXY = sourceIndexX != sourceIndex ? sourceIndexY + 4 : sourceIndexY;
			index = (y * newWidth + x) * 4;
			uRatio = u - sourceX;
			vRatio = v - sourceY;
			uOpposite = 1 - uRatio;
			vOpposite = 1 - vRatio;
			newData[index] = (UInt.toFloat(data[sourceIndex]) * uOpposite + UInt.toFloat(data[sourceIndexX]) * uRatio) * vOpposite + (UInt.toFloat(data[sourceIndexY]) * uOpposite + UInt.toFloat(data[sourceIndexXY]) * uRatio) * vRatio | 0;
			newData[index + 1] = (UInt.toFloat(data[sourceIndex + 1]) * uOpposite + UInt.toFloat(data[sourceIndexX + 1]) * uRatio) * vOpposite + (UInt.toFloat(data[sourceIndexY + 1]) * uOpposite + UInt.toFloat(data[sourceIndexXY + 1]) * uRatio) * vRatio | 0;
			newData[index + 2] = (UInt.toFloat(data[sourceIndex + 2]) * uOpposite + UInt.toFloat(data[sourceIndexX + 2]) * uRatio) * vOpposite + (UInt.toFloat(data[sourceIndexY + 2]) * uOpposite + UInt.toFloat(data[sourceIndexXY + 2]) * uRatio) * vRatio | 0;
			if(data[sourceIndexX + 3] == 0 || data[sourceIndexY + 3] == 0 || data[sourceIndexXY + 3] == 0) {
				newData[index + 3] = 0;
			} else {
				newData[index + 3] = data[sourceIndex + 3];
			}
		}
	}
	buffer.data = newBuffer.data;
	buffer.width = newWidth;
	buffer.height = newHeight;
	buffer.__srcImage = null;
	buffer.__srcImageData = null;
	buffer.__srcCanvas = null;
	buffer.__srcContext = null;
	image.dirty = true;
	image.version++;
};
lime__$internal_graphics_ImageDataUtil.resizeBuffer = function(image,newWidth,newHeight) {
	var buffer = image.buffer;
	var data = image.get_data();
	var elements = newWidth * newHeight * 4;
	var array = null;
	var vector = null;
	var view = null;
	var buffer1 = null;
	var len = null;
	var this1;
	if(elements != null) {
		this1 = new Uint8Array(elements);
	} else if(array != null) {
		this1 = new Uint8Array(array);
	} else if(vector != null) {
		this1 = new Uint8Array(vector.__array);
	} else if(view != null) {
		this1 = new Uint8Array(view);
	} else if(buffer1 != null) {
		if(len == null) {
			this1 = new Uint8Array(buffer1,0);
		} else {
			this1 = new Uint8Array(buffer1,0,len);
		}
	} else {
		this1 = null;
	}
	var newData = this1;
	var sourceIndex;
	var index;
	var _g = 0;
	var _g1 = buffer.height;
	while(_g < _g1) {
		var y = _g++;
		var _g2 = 0;
		var _g3 = buffer.width;
		while(_g2 < _g3) {
			var x = _g2++;
			sourceIndex = (y * buffer.width + x) * 4;
			index = (y * newWidth + x) * 4;
			newData[index] = data[sourceIndex];
			newData[index + 1] = data[sourceIndex + 1];
			newData[index + 2] = data[sourceIndex + 2];
			newData[index + 3] = data[sourceIndex + 3];
		}
	}
	buffer.data = newData;
	buffer.width = newWidth;
	buffer.height = newHeight;
	buffer.__srcImage = null;
	buffer.__srcImageData = null;
	buffer.__srcCanvas = null;
	buffer.__srcContext = null;
	image.dirty = true;
	image.version++;
};
lime__$internal_graphics_ImageDataUtil.setFormat = function(image,format) {
	var data = image.buffer.data;
	if(data == null) {
		return;
	}
	var index;
	var length = data.length / 4 | 0;
	var r1;
	var g1;
	var b1;
	var a1;
	var r2;
	var g2;
	var b2;
	var a2;
	var r;
	var g;
	var b;
	var a;
	switch(image.get_format()) {
	case 0:
		r1 = 0;
		g1 = 1;
		b1 = 2;
		a1 = 3;
		break;
	case 1:
		r1 = 1;
		g1 = 2;
		b1 = 3;
		a1 = 0;
		break;
	case 2:
		r1 = 2;
		g1 = 1;
		b1 = 0;
		a1 = 3;
		break;
	}
	switch(format) {
	case 0:
		r2 = 0;
		g2 = 1;
		b2 = 2;
		a2 = 3;
		break;
	case 1:
		r2 = 1;
		g2 = 2;
		b2 = 3;
		a2 = 0;
		break;
	case 2:
		r2 = 2;
		g2 = 1;
		b2 = 0;
		a2 = 3;
		break;
	}
	var _g = 0;
	var _g1 = length;
	while(_g < _g1) {
		var i = _g++;
		index = i * 4;
		r = data[index + r1];
		g = data[index + g1];
		b = data[index + b1];
		a = data[index + a1];
		data[index + r2] = r;
		data[index + g2] = g;
		data[index + b2] = b;
		data[index + a2] = a;
	}
	image.buffer.format = format;
	image.dirty = true;
	image.version++;
};
lime__$internal_graphics_ImageDataUtil.setPixel = function(image,x,y,color,format) {
	var pixel;
	switch(format) {
	case 1:
		var argb = color;
		var rgba = 0;
		rgba = (argb >>> 16 & 255 & 255) << 24 | (argb >>> 8 & 255 & 255) << 16 | (argb & 255 & 255) << 8 | argb >>> 24 & 255 & 255;
		pixel = rgba;
		break;
	case 2:
		var bgra = color;
		var rgba = 0;
		rgba = (bgra >>> 8 & 255 & 255) << 24 | (bgra >>> 16 & 255 & 255) << 16 | (bgra >>> 24 & 255 & 255) << 8 | bgra & 255 & 255;
		pixel = rgba;
		break;
	default:
		pixel = color;
	}
	var source = 0;
	var data = image.buffer.data;
	var offset = 4 * (y + image.offsetY) * image.buffer.width + (x + image.offsetX) * 4;
	var format = image.buffer.format;
	var premultiplied = image.buffer.premultiplied;
	if(premultiplied == null) {
		premultiplied = false;
	}
	if(format == null) {
		format = 0;
	}
	switch(format) {
	case 0:
		source = (data[offset] & 255) << 24 | (data[offset + 1] & 255) << 16 | (data[offset + 2] & 255) << 8 | data[offset + 3] & 255;
		break;
	case 1:
		source = (data[offset + 1] & 255) << 24 | (data[offset + 2] & 255) << 16 | (data[offset + 3] & 255) << 8 | data[offset] & 255;
		break;
	case 2:
		source = (data[offset + 2] & 255) << 24 | (data[offset + 1] & 255) << 16 | (data[offset] & 255) << 8 | data[offset + 3] & 255;
		break;
	}
	if(premultiplied) {
		if((source & 255) != 0 && (source & 255) != 255) {
			lime_math_RGBA.unmult = 255.0 / (source & 255);
			source = (lime_math_RGBA.__clamp[Math.round((source >>> 24 & 255) * lime_math_RGBA.unmult)] & 255) << 24 | (lime_math_RGBA.__clamp[Math.round((source >>> 16 & 255) * lime_math_RGBA.unmult)] & 255) << 16 | (lime_math_RGBA.__clamp[Math.round((source >>> 8 & 255) * lime_math_RGBA.unmult)] & 255) << 8 | source & 255 & 255;
		}
	}
	var value = source & 255;
	pixel = (pixel >>> 24 & 255 & 255) << 24 | (pixel >>> 16 & 255 & 255) << 16 | (pixel >>> 8 & 255 & 255) << 8 | value & 255;
	var data = image.buffer.data;
	var offset = 4 * (y + image.offsetY) * image.buffer.width + (x + image.offsetX) * 4;
	var format = image.buffer.format;
	var premultiplied = image.buffer.premultiplied;
	if(premultiplied == null) {
		premultiplied = false;
	}
	if(format == null) {
		format = 0;
	}
	if(premultiplied) {
		if((pixel & 255) == 0) {
			if(pixel != 0) {
				pixel = 0;
			}
		} else if((pixel & 255) != 255) {
			lime_math_RGBA.a16 = lime_math_RGBA.__alpha16[pixel & 255];
			pixel = ((pixel >>> 24 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 24 | ((pixel >>> 16 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 16 | ((pixel >>> 8 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 8 | pixel & 255 & 255;
		}
	}
	switch(format) {
	case 0:
		data[offset] = pixel >>> 24 & 255;
		data[offset + 1] = pixel >>> 16 & 255;
		data[offset + 2] = pixel >>> 8 & 255;
		data[offset + 3] = pixel & 255;
		break;
	case 1:
		data[offset] = pixel & 255;
		data[offset + 1] = pixel >>> 24 & 255;
		data[offset + 2] = pixel >>> 16 & 255;
		data[offset + 3] = pixel >>> 8 & 255;
		break;
	case 2:
		data[offset] = pixel >>> 8 & 255;
		data[offset + 1] = pixel >>> 16 & 255;
		data[offset + 2] = pixel >>> 24 & 255;
		data[offset + 3] = pixel & 255;
		break;
	}
	image.dirty = true;
	image.version++;
};
lime__$internal_graphics_ImageDataUtil.setPixel32 = function(image,x,y,color,format) {
	var pixel;
	switch(format) {
	case 1:
		var argb = color;
		var rgba = 0;
		rgba = (argb >>> 16 & 255 & 255) << 24 | (argb >>> 8 & 255 & 255) << 16 | (argb & 255 & 255) << 8 | argb >>> 24 & 255 & 255;
		pixel = rgba;
		break;
	case 2:
		var bgra = color;
		var rgba = 0;
		rgba = (bgra >>> 8 & 255 & 255) << 24 | (bgra >>> 16 & 255 & 255) << 16 | (bgra >>> 24 & 255 & 255) << 8 | bgra & 255 & 255;
		pixel = rgba;
		break;
	default:
		pixel = color;
	}
	if(!image.get_transparent()) {
		pixel = (pixel >>> 24 & 255 & 255) << 24 | (pixel >>> 16 & 255 & 255) << 16 | (pixel >>> 8 & 255 & 255) << 8 | 255;
	}
	var data = image.buffer.data;
	var offset = 4 * (y + image.offsetY) * image.buffer.width + (x + image.offsetX) * 4;
	var format = image.buffer.format;
	var premultiplied = image.buffer.premultiplied;
	if(premultiplied == null) {
		premultiplied = false;
	}
	if(format == null) {
		format = 0;
	}
	if(premultiplied) {
		if((pixel & 255) == 0) {
			if(pixel != 0) {
				pixel = 0;
			}
		} else if((pixel & 255) != 255) {
			lime_math_RGBA.a16 = lime_math_RGBA.__alpha16[pixel & 255];
			pixel = ((pixel >>> 24 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 24 | ((pixel >>> 16 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 16 | ((pixel >>> 8 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 8 | pixel & 255 & 255;
		}
	}
	switch(format) {
	case 0:
		data[offset] = pixel >>> 24 & 255;
		data[offset + 1] = pixel >>> 16 & 255;
		data[offset + 2] = pixel >>> 8 & 255;
		data[offset + 3] = pixel & 255;
		break;
	case 1:
		data[offset] = pixel & 255;
		data[offset + 1] = pixel >>> 24 & 255;
		data[offset + 2] = pixel >>> 16 & 255;
		data[offset + 3] = pixel >>> 8 & 255;
		break;
	case 2:
		data[offset] = pixel >>> 8 & 255;
		data[offset + 1] = pixel >>> 16 & 255;
		data[offset + 2] = pixel >>> 24 & 255;
		data[offset + 3] = pixel & 255;
		break;
	}
	image.dirty = true;
	image.version++;
};
lime__$internal_graphics_ImageDataUtil.setPixels = function(image,rect,bytePointer,format,endian) {
	if(image.buffer.data == null) {
		return;
	}
	var data = image.buffer.data;
	var sourceFormat = image.buffer.format;
	var premultiplied = image.buffer.premultiplied;
	var dataView = new lime__$internal_graphics__$ImageDataUtil_ImageDataView(image,rect);
	var row;
	var color;
	var pixel;
	var transparent = image.get_transparent();
	var bytes = bytePointer.bytes;
	var dataPosition = bytePointer.offset;
	var littleEndian = endian != lime_system_Endian.BIG_ENDIAN;
	var _g = 0;
	var _g1 = dataView.height;
	while(_g < _g1) {
		var y = _g++;
		row = dataView.byteOffset + dataView.stride * y;
		var _g2 = 0;
		var _g3 = dataView.width;
		while(_g2 < _g3) {
			var x = _g2++;
			if(littleEndian) {
				color = bytes.getInt32(dataPosition);
			} else {
				color = bytes.b[dataPosition + 3] | bytes.b[dataPosition + 2] << 8 | bytes.b[dataPosition + 1] << 16 | bytes.b[dataPosition] << 24;
			}
			dataPosition += 4;
			switch(format) {
			case 1:
				var argb = color;
				var rgba = 0;
				rgba = (argb >>> 16 & 255 & 255) << 24 | (argb >>> 8 & 255 & 255) << 16 | (argb & 255 & 255) << 8 | argb >>> 24 & 255 & 255;
				pixel = rgba;
				break;
			case 2:
				var bgra = color;
				var rgba1 = 0;
				rgba1 = (bgra >>> 8 & 255 & 255) << 24 | (bgra >>> 16 & 255 & 255) << 16 | (bgra >>> 24 & 255 & 255) << 8 | bgra & 255 & 255;
				pixel = rgba1;
				break;
			default:
				pixel = color;
			}
			if(!transparent) {
				pixel = (pixel >>> 24 & 255 & 255) << 24 | (pixel >>> 16 & 255 & 255) << 16 | (pixel >>> 8 & 255 & 255) << 8 | 255;
			}
			var offset = row + x * 4;
			var format1 = sourceFormat;
			var premultiplied1 = premultiplied;
			if(premultiplied1 == null) {
				premultiplied1 = false;
			}
			if(format1 == null) {
				format1 = 0;
			}
			if(premultiplied1) {
				if((pixel & 255) == 0) {
					if(pixel != 0) {
						pixel = 0;
					}
				} else if((pixel & 255) != 255) {
					lime_math_RGBA.a16 = lime_math_RGBA.__alpha16[pixel & 255];
					pixel = ((pixel >>> 24 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 24 | ((pixel >>> 16 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 16 | ((pixel >>> 8 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 8 | pixel & 255 & 255;
				}
			}
			switch(format1) {
			case 0:
				data[offset] = pixel >>> 24 & 255;
				data[offset + 1] = pixel >>> 16 & 255;
				data[offset + 2] = pixel >>> 8 & 255;
				data[offset + 3] = pixel & 255;
				break;
			case 1:
				data[offset] = pixel & 255;
				data[offset + 1] = pixel >>> 24 & 255;
				data[offset + 2] = pixel >>> 16 & 255;
				data[offset + 3] = pixel >>> 8 & 255;
				break;
			case 2:
				data[offset] = pixel >>> 8 & 255;
				data[offset + 1] = pixel >>> 16 & 255;
				data[offset + 2] = pixel >>> 24 & 255;
				data[offset + 3] = pixel & 255;
				break;
			}
		}
	}
	image.dirty = true;
	image.version++;
};
lime__$internal_graphics_ImageDataUtil.threshold = function(image,sourceImage,sourceRect,destPoint,operation,threshold,color,mask,copySource,format) {
	var _color;
	var _mask;
	var _threshold;
	switch(format) {
	case 1:
		var argb = color;
		var rgba = 0;
		rgba = (argb >>> 16 & 255 & 255) << 24 | (argb >>> 8 & 255 & 255) << 16 | (argb & 255 & 255) << 8 | argb >>> 24 & 255 & 255;
		_color = rgba;
		var argb = mask;
		var rgba = 0;
		rgba = (argb >>> 16 & 255 & 255) << 24 | (argb >>> 8 & 255 & 255) << 16 | (argb & 255 & 255) << 8 | argb >>> 24 & 255 & 255;
		_mask = rgba;
		var argb = threshold;
		var rgba = 0;
		rgba = (argb >>> 16 & 255 & 255) << 24 | (argb >>> 8 & 255 & 255) << 16 | (argb & 255 & 255) << 8 | argb >>> 24 & 255 & 255;
		_threshold = rgba;
		break;
	case 2:
		var bgra = color;
		var rgba = 0;
		rgba = (bgra >>> 8 & 255 & 255) << 24 | (bgra >>> 16 & 255 & 255) << 16 | (bgra >>> 24 & 255 & 255) << 8 | bgra & 255 & 255;
		_color = rgba;
		var bgra = mask;
		var rgba = 0;
		rgba = (bgra >>> 8 & 255 & 255) << 24 | (bgra >>> 16 & 255 & 255) << 16 | (bgra >>> 24 & 255 & 255) << 8 | bgra & 255 & 255;
		_mask = rgba;
		var bgra = threshold;
		var rgba = 0;
		rgba = (bgra >>> 8 & 255 & 255) << 24 | (bgra >>> 16 & 255 & 255) << 16 | (bgra >>> 24 & 255 & 255) << 8 | bgra & 255 & 255;
		_threshold = rgba;
		break;
	default:
		_color = color;
		_mask = mask;
		_threshold = threshold;
	}
	var _operation;
	switch(operation) {
	case "!=":
		_operation = 0;
		break;
	case "<":
		_operation = 2;
		break;
	case "<=":
		_operation = 3;
		break;
	case "==":
		_operation = 1;
		break;
	case ">":
		_operation = 4;
		break;
	case ">=":
		_operation = 5;
		break;
	default:
		_operation = -1;
	}
	if(_operation == -1) {
		return 0;
	}
	var srcData = sourceImage.buffer.data;
	var destData = image.buffer.data;
	if(srcData == null || destData == null) {
		return 0;
	}
	var hits = 0;
	var srcView = new lime__$internal_graphics__$ImageDataUtil_ImageDataView(sourceImage,sourceRect);
	var destView = new lime__$internal_graphics__$ImageDataUtil_ImageDataView(image,new lime_math_Rectangle(destPoint.x,destPoint.y,srcView.width,srcView.height));
	var srcFormat = sourceImage.buffer.format;
	var destFormat = image.buffer.format;
	var srcPremultiplied = sourceImage.buffer.premultiplied;
	var destPremultiplied = image.buffer.premultiplied;
	var srcPosition;
	var destPosition;
	var srcPixel = 0;
	var destPixel = 0;
	var pixelMask;
	var test;
	var value;
	var _g = 0;
	var _g1 = destView.height;
	while(_g < _g1) {
		var y = _g++;
		srcPosition = srcView.byteOffset + srcView.stride * y;
		destPosition = destView.byteOffset + destView.stride * y;
		var _g2 = 0;
		var _g3 = destView.width;
		while(_g2 < _g3) {
			var x = _g2++;
			var format = srcFormat;
			var premultiplied = srcPremultiplied;
			if(premultiplied == null) {
				premultiplied = false;
			}
			if(format == null) {
				format = 0;
			}
			switch(format) {
			case 0:
				srcPixel = (srcData[srcPosition] & 255) << 24 | (srcData[srcPosition + 1] & 255) << 16 | (srcData[srcPosition + 2] & 255) << 8 | srcData[srcPosition + 3] & 255;
				break;
			case 1:
				srcPixel = (srcData[srcPosition + 1] & 255) << 24 | (srcData[srcPosition + 2] & 255) << 16 | (srcData[srcPosition + 3] & 255) << 8 | srcData[srcPosition] & 255;
				break;
			case 2:
				srcPixel = (srcData[srcPosition + 2] & 255) << 24 | (srcData[srcPosition + 1] & 255) << 16 | (srcData[srcPosition] & 255) << 8 | srcData[srcPosition + 3] & 255;
				break;
			}
			if(premultiplied) {
				if((srcPixel & 255) != 0 && (srcPixel & 255) != 255) {
					lime_math_RGBA.unmult = 255.0 / (srcPixel & 255);
					srcPixel = (lime_math_RGBA.__clamp[Math.round((srcPixel >>> 24 & 255) * lime_math_RGBA.unmult)] & 255) << 24 | (lime_math_RGBA.__clamp[Math.round((srcPixel >>> 16 & 255) * lime_math_RGBA.unmult)] & 255) << 16 | (lime_math_RGBA.__clamp[Math.round((srcPixel >>> 8 & 255) * lime_math_RGBA.unmult)] & 255) << 8 | srcPixel & 255 & 255;
				}
			}
			pixelMask = srcPixel & _mask;
			var tmp1 = pixelMask >>> 24 & 255;
			var tmp2 = _threshold >>> 24 & 255;
			if(tmp1 != tmp2) {
				value = UInt.gt(tmp1,tmp2) ? 1 : -1;
			} else {
				tmp1 = pixelMask >>> 16 & 255;
				tmp2 = _threshold >>> 16 & 255;
				if(tmp1 != tmp2) {
					value = UInt.gt(tmp1,tmp2) ? 1 : -1;
				} else {
					tmp1 = pixelMask >>> 8 & 255;
					tmp2 = _threshold >>> 8 & 255;
					if(tmp1 != tmp2) {
						value = UInt.gt(tmp1,tmp2) ? 1 : -1;
					} else {
						tmp1 = pixelMask & 255;
						tmp2 = _threshold & 255;
						value = tmp1 != tmp2 ? UInt.gt(tmp1,tmp2) ? 1 : -1 : 0;
					}
				}
			}
			switch(_operation) {
			case 0:
				test = value != 0;
				break;
			case 1:
				test = value == 0;
				break;
			case 2:
				test = value == -1;
				break;
			case 3:
				test = value == 0 || value == -1;
				break;
			case 4:
				test = value == 1;
				break;
			case 5:
				test = value == 0 || value == 1;
				break;
			default:
				test = false;
			}
			if(test) {
				var format1 = destFormat;
				var premultiplied1 = destPremultiplied;
				if(premultiplied1 == null) {
					premultiplied1 = false;
				}
				if(format1 == null) {
					format1 = 0;
				}
				if(premultiplied1) {
					if((_color & 255) == 0) {
						if(_color != 0) {
							_color = 0;
						}
					} else if((_color & 255) != 255) {
						lime_math_RGBA.a16 = lime_math_RGBA.__alpha16[_color & 255];
						_color = ((_color >>> 24 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 24 | ((_color >>> 16 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 16 | ((_color >>> 8 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 8 | _color & 255 & 255;
					}
				}
				switch(format1) {
				case 0:
					destData[destPosition] = _color >>> 24 & 255;
					destData[destPosition + 1] = _color >>> 16 & 255;
					destData[destPosition + 2] = _color >>> 8 & 255;
					destData[destPosition + 3] = _color & 255;
					break;
				case 1:
					destData[destPosition] = _color & 255;
					destData[destPosition + 1] = _color >>> 24 & 255;
					destData[destPosition + 2] = _color >>> 16 & 255;
					destData[destPosition + 3] = _color >>> 8 & 255;
					break;
				case 2:
					destData[destPosition] = _color >>> 8 & 255;
					destData[destPosition + 1] = _color >>> 16 & 255;
					destData[destPosition + 2] = _color >>> 24 & 255;
					destData[destPosition + 3] = _color & 255;
					break;
				}
				++hits;
			} else if(copySource) {
				var format2 = destFormat;
				var premultiplied2 = destPremultiplied;
				if(premultiplied2 == null) {
					premultiplied2 = false;
				}
				if(format2 == null) {
					format2 = 0;
				}
				if(premultiplied2) {
					if((srcPixel & 255) == 0) {
						if(srcPixel != 0) {
							srcPixel = 0;
						}
					} else if((srcPixel & 255) != 255) {
						lime_math_RGBA.a16 = lime_math_RGBA.__alpha16[srcPixel & 255];
						srcPixel = ((srcPixel >>> 24 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 24 | ((srcPixel >>> 16 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 16 | ((srcPixel >>> 8 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 8 | srcPixel & 255 & 255;
					}
				}
				switch(format2) {
				case 0:
					destData[destPosition] = srcPixel >>> 24 & 255;
					destData[destPosition + 1] = srcPixel >>> 16 & 255;
					destData[destPosition + 2] = srcPixel >>> 8 & 255;
					destData[destPosition + 3] = srcPixel & 255;
					break;
				case 1:
					destData[destPosition] = srcPixel & 255;
					destData[destPosition + 1] = srcPixel >>> 24 & 255;
					destData[destPosition + 2] = srcPixel >>> 16 & 255;
					destData[destPosition + 3] = srcPixel >>> 8 & 255;
					break;
				case 2:
					destData[destPosition] = srcPixel >>> 8 & 255;
					destData[destPosition + 1] = srcPixel >>> 16 & 255;
					destData[destPosition + 2] = srcPixel >>> 24 & 255;
					destData[destPosition + 3] = srcPixel & 255;
					break;
				}
			}
			srcPosition += 4;
			destPosition += 4;
		}
	}
	if(hits > 0) {
		image.dirty = true;
		image.version++;
	}
	return hits;
};
lime__$internal_graphics_ImageDataUtil.unmultiplyAlpha = function(image) {
	var data = image.buffer.data;
	if(data == null) {
		return;
	}
	var format = image.buffer.format;
	var length = data.length / 4 | 0;
	var pixel = 0;
	var _g = 0;
	var _g1 = length;
	while(_g < _g1) {
		var i = _g++;
		var offset = i * 4;
		var format1 = format;
		var premultiplied = true;
		if(premultiplied == null) {
			premultiplied = false;
		}
		if(format1 == null) {
			format1 = 0;
		}
		switch(format1) {
		case 0:
			pixel = (data[offset] & 255) << 24 | (data[offset + 1] & 255) << 16 | (data[offset + 2] & 255) << 8 | data[offset + 3] & 255;
			break;
		case 1:
			pixel = (data[offset + 1] & 255) << 24 | (data[offset + 2] & 255) << 16 | (data[offset + 3] & 255) << 8 | data[offset] & 255;
			break;
		case 2:
			pixel = (data[offset + 2] & 255) << 24 | (data[offset + 1] & 255) << 16 | (data[offset] & 255) << 8 | data[offset + 3] & 255;
			break;
		}
		if(premultiplied) {
			if((pixel & 255) != 0 && (pixel & 255) != 255) {
				lime_math_RGBA.unmult = 255.0 / (pixel & 255);
				pixel = (lime_math_RGBA.__clamp[Math.round((pixel >>> 24 & 255) * lime_math_RGBA.unmult)] & 255) << 24 | (lime_math_RGBA.__clamp[Math.round((pixel >>> 16 & 255) * lime_math_RGBA.unmult)] & 255) << 16 | (lime_math_RGBA.__clamp[Math.round((pixel >>> 8 & 255) * lime_math_RGBA.unmult)] & 255) << 8 | pixel & 255 & 255;
			}
		}
		var offset1 = i * 4;
		var format2 = format;
		var premultiplied1 = false;
		if(premultiplied1 == null) {
			premultiplied1 = false;
		}
		if(format2 == null) {
			format2 = 0;
		}
		if(premultiplied1) {
			if((pixel & 255) == 0) {
				if(pixel != 0) {
					pixel = 0;
				}
			} else if((pixel & 255) != 255) {
				lime_math_RGBA.a16 = lime_math_RGBA.__alpha16[pixel & 255];
				pixel = ((pixel >>> 24 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 24 | ((pixel >>> 16 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 16 | ((pixel >>> 8 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 8 | pixel & 255 & 255;
			}
		}
		switch(format2) {
		case 0:
			data[offset1] = pixel >>> 24 & 255;
			data[offset1 + 1] = pixel >>> 16 & 255;
			data[offset1 + 2] = pixel >>> 8 & 255;
			data[offset1 + 3] = pixel & 255;
			break;
		case 1:
			data[offset1] = pixel & 255;
			data[offset1 + 1] = pixel >>> 24 & 255;
			data[offset1 + 2] = pixel >>> 16 & 255;
			data[offset1 + 3] = pixel >>> 8 & 255;
			break;
		case 2:
			data[offset1] = pixel >>> 8 & 255;
			data[offset1 + 1] = pixel >>> 16 & 255;
			data[offset1 + 2] = pixel >>> 24 & 255;
			data[offset1 + 3] = pixel & 255;
			break;
		}
	}
	image.buffer.premultiplied = false;
	image.dirty = true;
	image.version++;
};
lime__$internal_graphics_ImageDataUtil.__boxBlur = function(imgA,imgB,w,h,bx,by) {
	imgB.set(imgA);
	var bx1 = bx | 0;
	var by1 = by | 0;
	lime__$internal_graphics_ImageDataUtil.__boxBlurH(imgB,imgA,w,h,bx1,0);
	lime__$internal_graphics_ImageDataUtil.__boxBlurH(imgB,imgA,w,h,bx1,1);
	lime__$internal_graphics_ImageDataUtil.__boxBlurH(imgB,imgA,w,h,bx1,2);
	lime__$internal_graphics_ImageDataUtil.__boxBlurH(imgB,imgA,w,h,bx1,3);
	var iarr = 1 / (by1 + by1 + 1);
	var ws = w * 4;
	var ti;
	var li;
	var ri;
	var fv;
	var lv;
	var val;
	var _g = 0;
	var _g1 = w;
	while(_g < _g1) {
		var i = _g++;
		ti = i * 4;
		li = ti;
		ri = ti + by1 * ws;
		fv = imgA[ti];
		lv = imgA[ti + ws * (h - 1)];
		val = (by1 + 1) * fv;
		var _g2 = 0;
		var _g3 = by1;
		while(_g2 < _g3) {
			var j = _g2++;
			val = val + imgA[ti + j * ws];
		}
		var _g4 = 0;
		var _g5 = by1 + 1;
		while(_g4 < _g5) {
			var j1 = _g4++;
			val = val + (imgA[ri] - fv);
			imgB[ti] = Math.round(val * iarr);
			ri += ws;
			ti += ws;
		}
		var _g6 = by1 + 1;
		var _g7 = h - by1;
		while(_g6 < _g7) {
			var j2 = _g6++;
			val = val + (imgA[ri] - imgA[li]);
			imgB[ti] = Math.round(val * iarr);
			li += ws;
			ri += ws;
			ti += ws;
		}
		var _g8 = h - by1;
		var _g9 = h;
		while(_g8 < _g9) {
			var j3 = _g8++;
			val = val + (lv - imgA[li]);
			imgB[ti] = Math.round(val * iarr);
			li += ws;
			ti += ws;
		}
	}
	var iarr = 1 / (by1 + by1 + 1);
	var ws = w * 4;
	var ti;
	var li;
	var ri;
	var fv;
	var lv;
	var val;
	var _g = 0;
	var _g1 = w;
	while(_g < _g1) {
		var i = _g++;
		ti = i * 4 + 1;
		li = ti;
		ri = ti + by1 * ws;
		fv = imgA[ti];
		lv = imgA[ti + ws * (h - 1)];
		val = (by1 + 1) * fv;
		var _g2 = 0;
		var _g3 = by1;
		while(_g2 < _g3) {
			var j = _g2++;
			val = val + imgA[ti + j * ws];
		}
		var _g4 = 0;
		var _g5 = by1 + 1;
		while(_g4 < _g5) {
			var j1 = _g4++;
			val = val + (imgA[ri] - fv);
			imgB[ti] = Math.round(val * iarr);
			ri += ws;
			ti += ws;
		}
		var _g6 = by1 + 1;
		var _g7 = h - by1;
		while(_g6 < _g7) {
			var j2 = _g6++;
			val = val + (imgA[ri] - imgA[li]);
			imgB[ti] = Math.round(val * iarr);
			li += ws;
			ri += ws;
			ti += ws;
		}
		var _g8 = h - by1;
		var _g9 = h;
		while(_g8 < _g9) {
			var j3 = _g8++;
			val = val + (lv - imgA[li]);
			imgB[ti] = Math.round(val * iarr);
			li += ws;
			ti += ws;
		}
	}
	var iarr = 1 / (by1 + by1 + 1);
	var ws = w * 4;
	var ti;
	var li;
	var ri;
	var fv;
	var lv;
	var val;
	var _g = 0;
	var _g1 = w;
	while(_g < _g1) {
		var i = _g++;
		ti = i * 4 + 2;
		li = ti;
		ri = ti + by1 * ws;
		fv = imgA[ti];
		lv = imgA[ti + ws * (h - 1)];
		val = (by1 + 1) * fv;
		var _g2 = 0;
		var _g3 = by1;
		while(_g2 < _g3) {
			var j = _g2++;
			val = val + imgA[ti + j * ws];
		}
		var _g4 = 0;
		var _g5 = by1 + 1;
		while(_g4 < _g5) {
			var j1 = _g4++;
			val = val + (imgA[ri] - fv);
			imgB[ti] = Math.round(val * iarr);
			ri += ws;
			ti += ws;
		}
		var _g6 = by1 + 1;
		var _g7 = h - by1;
		while(_g6 < _g7) {
			var j2 = _g6++;
			val = val + (imgA[ri] - imgA[li]);
			imgB[ti] = Math.round(val * iarr);
			li += ws;
			ri += ws;
			ti += ws;
		}
		var _g8 = h - by1;
		var _g9 = h;
		while(_g8 < _g9) {
			var j3 = _g8++;
			val = val + (lv - imgA[li]);
			imgB[ti] = Math.round(val * iarr);
			li += ws;
			ti += ws;
		}
	}
	var iarr = 1 / (by1 + by1 + 1);
	var ws = w * 4;
	var ti;
	var li;
	var ri;
	var fv;
	var lv;
	var val;
	var _g = 0;
	var _g1 = w;
	while(_g < _g1) {
		var i = _g++;
		ti = i * 4 + 3;
		li = ti;
		ri = ti + by1 * ws;
		fv = imgA[ti];
		lv = imgA[ti + ws * (h - 1)];
		val = (by1 + 1) * fv;
		var _g2 = 0;
		var _g3 = by1;
		while(_g2 < _g3) {
			var j = _g2++;
			val = val + imgA[ti + j * ws];
		}
		var _g4 = 0;
		var _g5 = by1 + 1;
		while(_g4 < _g5) {
			var j1 = _g4++;
			val = val + (imgA[ri] - fv);
			imgB[ti] = Math.round(val * iarr);
			ri += ws;
			ti += ws;
		}
		var _g6 = by1 + 1;
		var _g7 = h - by1;
		while(_g6 < _g7) {
			var j2 = _g6++;
			val = val + (imgA[ri] - imgA[li]);
			imgB[ti] = Math.round(val * iarr);
			li += ws;
			ri += ws;
			ti += ws;
		}
		var _g8 = h - by1;
		var _g9 = h;
		while(_g8 < _g9) {
			var j3 = _g8++;
			val = val + (lv - imgA[li]);
			imgB[ti] = Math.round(val * iarr);
			li += ws;
			ti += ws;
		}
	}
};
lime__$internal_graphics_ImageDataUtil.__boxBlurH = function(imgA,imgB,w,h,r,off) {
	var iarr = 1 / (r + r + 1);
	var ti;
	var li;
	var ri;
	var fv;
	var lv;
	var val;
	var _g = 0;
	var _g1 = h;
	while(_g < _g1) {
		var i = _g++;
		ti = i * w;
		li = ti;
		ri = ti + r;
		fv = imgA[ti * 4 + off];
		lv = imgA[(ti + w - 1) * 4 + off];
		val = (r + 1) * fv;
		var _g2 = 0;
		var _g3 = r;
		while(_g2 < _g3) {
			var j = _g2++;
			val = val + imgA[(ti + j) * 4 + off];
		}
		var _g4 = 0;
		var _g5 = r + 1;
		while(_g4 < _g5) {
			var j1 = _g4++;
			val = val + (imgA[ri * 4 + off] - fv);
			imgB[ti * 4 + off] = Math.round(val * iarr);
			++ri;
			++ti;
		}
		var _g6 = r + 1;
		var _g7 = w - r;
		while(_g6 < _g7) {
			var j2 = _g6++;
			val = val + (imgA[ri * 4 + off] - imgA[li * 4 + off]);
			imgB[ti * 4 + off] = Math.round(val * iarr);
			++ri;
			++li;
			++ti;
		}
		var _g8 = w - r;
		var _g9 = w;
		while(_g8 < _g9) {
			var j3 = _g8++;
			val = val + (lv - imgA[li * 4 + off]);
			imgB[ti * 4 + off] = Math.round(val * iarr);
			++li;
			++ti;
		}
	}
};
lime__$internal_graphics_ImageDataUtil.__boxBlurT = function(imgA,imgB,w,h,r,off) {
	var iarr = 1 / (r + r + 1);
	var ws = w * 4;
	var ti;
	var li;
	var ri;
	var fv;
	var lv;
	var val;
	var _g = 0;
	var _g1 = w;
	while(_g < _g1) {
		var i = _g++;
		ti = i * 4 + off;
		li = ti;
		ri = ti + r * ws;
		fv = imgA[ti];
		lv = imgA[ti + ws * (h - 1)];
		val = (r + 1) * fv;
		var _g2 = 0;
		var _g3 = r;
		while(_g2 < _g3) {
			var j = _g2++;
			val = val + imgA[ti + j * ws];
		}
		var _g4 = 0;
		var _g5 = r + 1;
		while(_g4 < _g5) {
			var j1 = _g4++;
			val = val + (imgA[ri] - fv);
			imgB[ti] = Math.round(val * iarr);
			ri += ws;
			ti += ws;
		}
		var _g6 = r + 1;
		var _g7 = h - r;
		while(_g6 < _g7) {
			var j2 = _g6++;
			val = val + (imgA[ri] - imgA[li]);
			imgB[ti] = Math.round(val * iarr);
			li += ws;
			ri += ws;
			ti += ws;
		}
		var _g8 = h - r;
		var _g9 = h;
		while(_g8 < _g9) {
			var j3 = _g8++;
			val = val + (lv - imgA[li]);
			imgB[ti] = Math.round(val * iarr);
			li += ws;
			ti += ws;
		}
	}
};
lime__$internal_graphics_ImageDataUtil.__calculateSourceOffset = function(sourceRect,destPoint,destX,destY) {
	var sourceX = destX - (destPoint.x | 0);
	var sourceY = destY - (destPoint.y | 0);
	var offset = 0;
	if(sourceX < 0 || sourceY < 0 || sourceX >= sourceRect.width || sourceY >= sourceRect.height) {
		offset = -1;
	} else {
		offset = 4 * (sourceY * (sourceRect.width | 0) + sourceX);
	}
	return offset;
};
lime__$internal_graphics_ImageDataUtil.__getBoxesForGaussianBlur = function(sigma,n) {
	var wIdeal = Math.sqrt(12 * sigma * sigma / n + 1);
	var wl = Math.floor(wIdeal);
	if(wl % 2 == 0) {
		--wl;
	}
	var wu = wl + 2;
	var mIdeal = (12 * sigma * sigma - n * wl * wl - 4 * n * wl - 3 * n) / (-4 * wl - 4);
	var m = Math.round(mIdeal);
	var sizes = [];
	var _g = 0;
	var _g1 = n;
	while(_g < _g1) {
		var i = _g++;
		sizes.push(i < m ? wl : wu);
	}
	return sizes;
};
lime__$internal_graphics_ImageDataUtil.__pixelCompare = function(n1,n2) {
	var tmp1 = n1 >>> 24 & 255;
	var tmp2 = n2 >>> 24 & 255;
	if(tmp1 != tmp2) {
		if(UInt.gt(tmp1,tmp2)) {
			return 1;
		} else {
			return -1;
		}
	} else {
		tmp1 = n1 >>> 16 & 255;
		tmp2 = n2 >>> 16 & 255;
		if(tmp1 != tmp2) {
			if(UInt.gt(tmp1,tmp2)) {
				return 1;
			} else {
				return -1;
			}
		} else {
			tmp1 = n1 >>> 8 & 255;
			tmp2 = n2 >>> 8 & 255;
			if(tmp1 != tmp2) {
				if(UInt.gt(tmp1,tmp2)) {
					return 1;
				} else {
					return -1;
				}
			} else {
				tmp1 = n1 & 255;
				tmp2 = n2 & 255;
				if(tmp1 != tmp2) {
					if(UInt.gt(tmp1,tmp2)) {
						return 1;
					} else {
						return -1;
					}
				} else {
					return 0;
				}
			}
		}
	}
};
lime__$internal_graphics_ImageDataUtil.__translatePixel = function(imgB,sourceRect,destRect,destPoint,destX,destY,strength) {
	var d = 4 * (destY * (destRect.width | 0) + destX);
	var s = lime__$internal_graphics_ImageDataUtil.__calculateSourceOffset(sourceRect,destPoint,destX,destY);
	if(s < 0) {
		imgB[d] = imgB[d + 1] = imgB[d + 2] = imgB[d + 3] = 0;
	} else {
		imgB[d] = imgB[s];
		imgB[d + 1] = imgB[s + 1];
		imgB[d + 2] = imgB[s + 2];
		var a = UInt.toFloat(imgB[s + 3]) * strength | 0;
		imgB[d + 3] = a < 0 ? 0 : a > 255 ? 255 : a;
	}
};
var lime__$internal_graphics__$ImageDataUtil_ImageDataView = function(image,rect) {
	this.image = image;
	if(rect == null) {
		this.rect = image.get_rect();
	} else {
		if(rect.x < 0) {
			rect.x = 0;
		}
		if(rect.y < 0) {
			rect.y = 0;
		}
		if(rect.x + rect.width > image.width) {
			rect.width = image.width - rect.x;
		}
		if(rect.y + rect.height > image.height) {
			rect.height = image.height - rect.y;
		}
		if(rect.width < 0) {
			rect.width = 0;
		}
		if(rect.height < 0) {
			rect.height = 0;
		}
		this.rect = rect;
	}
	this.stride = image.buffer.get_stride();
	this.__update();
};
$hxClasses["lime._internal.graphics._ImageDataUtil.ImageDataView"] = lime__$internal_graphics__$ImageDataUtil_ImageDataView;
lime__$internal_graphics__$ImageDataUtil_ImageDataView.__name__ = "lime._internal.graphics._ImageDataUtil.ImageDataView";
lime__$internal_graphics__$ImageDataUtil_ImageDataView.prototype = {
	x: null
	,y: null
	,height: null
	,width: null
	,byteOffset: null
	,image: null
	,rect: null
	,stride: null
	,tempRect: null
	,clip: function(x,y,width,height) {
		if(this.tempRect == null) {
			this.tempRect = new lime_math_Rectangle();
		}
		this.tempRect.setTo(x,y,width,height);
		this.rect.intersection(this.tempRect,this.rect);
		this.__update();
	}
	,hasRow: function(y) {
		if(y >= 0) {
			return y < this.height;
		} else {
			return false;
		}
	}
	,offset: function(x,y) {
		if(x < 0) {
			this.rect.x += x;
			if(this.rect.x < 0) {
				this.rect.x = 0;
			}
		} else {
			this.rect.x += x;
			this.rect.width -= x;
		}
		if(y < 0) {
			this.rect.y += y;
			if(this.rect.y < 0) {
				this.rect.y = 0;
			}
		} else {
			this.rect.y += y;
			this.rect.height -= y;
		}
		this.__update();
	}
	,row: function(y) {
		return this.byteOffset + this.stride * y;
	}
	,__update: function() {
		this.x = Math.ceil(this.rect.x);
		this.y = Math.ceil(this.rect.y);
		this.width = Math.floor(this.rect.width);
		this.height = Math.floor(this.rect.height);
		this.byteOffset = this.stride * (this.y + this.image.offsetY) + (this.x + this.image.offsetX) * 4;
	}
	,__class__: lime__$internal_graphics__$ImageDataUtil_ImageDataView
};
var lime__$internal_graphics_StackBlur = function() { };
$hxClasses["lime._internal.graphics.StackBlur"] = lime__$internal_graphics_StackBlur;
lime__$internal_graphics_StackBlur.__name__ = "lime._internal.graphics.StackBlur";
lime__$internal_graphics_StackBlur.blur = function(dest,source,sourceRect,destPoint,blurX,blurY,quality) {
	dest.copyPixels(source,sourceRect,destPoint);
	lime__$internal_graphics_StackBlur.__stackBlurCanvasRGBA(dest,sourceRect.width | 0,sourceRect.height | 0,blurX,blurY,quality);
};
lime__$internal_graphics_StackBlur.__stackBlurCanvasRGBA = function(image,width,height,blurX,blurY,quality) {
	var radiusX = Math.round(blurX) >> 1;
	var radiusY = Math.round(blurY) >> 1;
	if(lime__$internal_graphics_StackBlur.MUL_TABLE == null) {
		return;
	}
	if(radiusX >= lime__$internal_graphics_StackBlur.MUL_TABLE.length) {
		radiusX = lime__$internal_graphics_StackBlur.MUL_TABLE.length - 1;
	}
	if(radiusY >= lime__$internal_graphics_StackBlur.MUL_TABLE.length) {
		radiusY = lime__$internal_graphics_StackBlur.MUL_TABLE.length - 1;
	}
	if(radiusX < 0 || radiusY < 0) {
		return;
	}
	var iterations = quality;
	if(iterations < 1) {
		iterations = 1;
	}
	if(iterations > 3) {
		iterations = 3;
	}
	var px = image.get_data();
	var x;
	var y;
	var i;
	var p;
	var yp;
	var yi;
	var yw;
	var r;
	var g;
	var b;
	var a;
	var pr;
	var pg;
	var pb;
	var pa;
	var f;
	var divx = radiusX + radiusX + 1;
	var divy = radiusY + radiusY + 1;
	var w = width;
	var h = height;
	var w1 = w - 1;
	var h1 = h - 1;
	var rxp1 = radiusX + 1;
	var ryp1 = radiusY + 1;
	var ssx = new lime__$internal_graphics_BlurStack();
	var sx = ssx;
	var _g = 1;
	var _g1 = divx;
	while(_g < _g1) {
		var i1 = _g++;
		sx = sx.n = new lime__$internal_graphics_BlurStack();
	}
	sx.n = ssx;
	var ssy = new lime__$internal_graphics_BlurStack();
	var sy = ssy;
	var _g = 1;
	var _g1 = divy;
	while(_g < _g1) {
		var i1 = _g++;
		sy = sy.n = new lime__$internal_graphics_BlurStack();
	}
	sy.n = ssy;
	var si = null;
	var mtx = lime__$internal_graphics_StackBlur.MUL_TABLE[radiusX];
	var stx = lime__$internal_graphics_StackBlur.SHG_TABLE[radiusX];
	var mty = lime__$internal_graphics_StackBlur.MUL_TABLE[radiusY];
	var sty = lime__$internal_graphics_StackBlur.SHG_TABLE[radiusY];
	while(iterations > 0) {
		--iterations;
		yi = 0;
		yw = yi;
		var ms = mtx;
		var ss = stx;
		y = h;
		do {
			pr = px[yi];
			r = rxp1 * pr;
			pg = px[yi + 1];
			g = rxp1 * pg;
			pb = px[yi + 2];
			b = rxp1 * pb;
			pa = px[yi + 3];
			a = rxp1 * pa;
			sx = ssx;
			i = rxp1;
			do {
				sx.r = pr;
				sx.g = pg;
				sx.b = pb;
				sx.a = pa;
				sx = sx.n;
			} while(--i > -1);
			var _g = 1;
			var _g1 = rxp1;
			while(_g < _g1) {
				var i1 = _g++;
				p = yi + ((w1 < i1 ? w1 : i1) << 2);
				r += sx.r = px[p];
				g += sx.g = px[p + 1];
				b += sx.b = px[p + 2];
				a += sx.a = px[p + 3];
				sx = sx.n;
			}
			si = ssx;
			var _g2 = 0;
			var _g3 = w;
			while(_g2 < _g3) {
				var x = _g2++;
				px[yi++] = r * ms >>> ss;
				px[yi++] = g * ms >>> ss;
				px[yi++] = b * ms >>> ss;
				px[yi++] = a * ms >>> ss;
				p = x + radiusX + 1;
				p = yw + (p < w1 ? p : w1) << 2;
				r -= si.r - (si.r = px[p]);
				g -= si.g - (si.g = px[p + 1]);
				b -= si.b - (si.b = px[p + 2]);
				a -= si.a - (si.a = px[p + 3]);
				si = si.n;
			}
			yw += w;
		} while(--y > 0);
		ms = mty;
		ss = sty;
		var _g4 = 0;
		var _g5 = w;
		while(_g4 < _g5) {
			var x1 = _g4++;
			yi = x1 << 2;
			pr = px[yi];
			r = ryp1 * pr;
			pg = px[yi + 1];
			g = ryp1 * pg;
			pb = px[yi + 2];
			b = ryp1 * pb;
			pa = px[yi + 3];
			a = ryp1 * pa;
			sy = ssy;
			var _g6 = 0;
			var _g7 = ryp1;
			while(_g6 < _g7) {
				var i2 = _g6++;
				sy.r = pr;
				sy.g = pg;
				sy.b = pb;
				sy.a = pa;
				sy = sy.n;
			}
			yp = w;
			var _g8 = 1;
			var _g9 = radiusY + 1;
			while(_g8 < _g9) {
				var i3 = _g8++;
				yi = yp + x1 << 2;
				r += sy.r = px[yi];
				g += sy.g = px[yi + 1];
				b += sy.b = px[yi + 2];
				a += sy.a = px[yi + 3];
				sy = sy.n;
				if(i3 < h1) {
					yp += w;
				}
			}
			yi = x1;
			si = ssy;
			if(iterations > 0) {
				var _g10 = 0;
				var _g11 = h;
				while(_g10 < _g11) {
					var y1 = _g10++;
					p = yi << 2;
					pa = a * ms >>> ss;
					px[p + 3] = pa;
					if(pa > 0) {
						px[p] = r * ms >>> ss;
						px[p + 1] = g * ms >>> ss;
						px[p + 2] = b * ms >>> ss;
					} else {
						px[p] = px[p + 1] = px[p + 2] = 0;
					}
					p = y1 + ryp1;
					p = x1 + (p < h1 ? p : h1) * w << 2;
					r -= si.r - (si.r = px[p]);
					g -= si.g - (si.g = px[p + 1]);
					b -= si.b - (si.b = px[p + 2]);
					a -= si.a - (si.a = px[p + 3]);
					si = si.n;
					yi += w;
				}
			} else {
				var _g12 = 0;
				var _g13 = h;
				while(_g12 < _g13) {
					var y2 = _g12++;
					p = yi << 2;
					pa = a * ms >>> ss;
					px[p + 3] = pa;
					if(pa > 0) {
						f = 255 / pa;
						pr = (r * ms >>> ss) * f | 0;
						pg = (g * ms >>> ss) * f | 0;
						pb = (b * ms >>> ss) * f | 0;
						px[p] = pr > 255 ? 255 : pr;
						px[p + 1] = pg > 255 ? 255 : pg;
						px[p + 2] = pb > 255 ? 255 : pb;
					} else {
						px[p] = px[p + 1] = px[p + 2] = 0;
					}
					p = y2 + ryp1;
					p = x1 + (p < h1 ? p : h1) * w << 2;
					r -= si.r - (si.r = px[p]);
					g -= si.g - (si.g = px[p + 1]);
					b -= si.b - (si.b = px[p + 2]);
					a -= si.a - (si.a = px[p + 3]);
					si = si.n;
					yi += w;
				}
			}
		}
	}
};
var lime__$internal_graphics_BlurStack = function() {
	this.r = 0;
	this.g = 0;
	this.b = 0;
	this.a = 0;
	this.n = null;
};
$hxClasses["lime._internal.graphics.BlurStack"] = lime__$internal_graphics_BlurStack;
lime__$internal_graphics_BlurStack.__name__ = "lime._internal.graphics.BlurStack";
lime__$internal_graphics_BlurStack.prototype = {
	r: null
	,g: null
	,b: null
	,a: null
	,n: null
	,__class__: lime__$internal_graphics_BlurStack
};
var lime__$internal_macros_AssetsMacro = function() { };
$hxClasses["lime._internal.macros.AssetsMacro"] = lime__$internal_macros_AssetsMacro;
lime__$internal_macros_AssetsMacro.__name__ = "lime._internal.macros.AssetsMacro";
var lime_app_Event = function() {
	this.canceled = false;
	this.__listeners = [];
	this.__priorities = [];
	this.__repeat = [];
};
$hxClasses["lime.app.Event"] = lime_app_Event;
lime_app_Event.__name__ = "lime.app.Event";
lime_app_Event.prototype = {
	canceled: null
	,__listeners: null
	,__repeat: null
	,__priorities: null
	,add: function(listener,once,priority) {
		if(priority == null) {
			priority = 0;
		}
		if(once == null) {
			once = false;
		}
		var _g = 0;
		var _g1 = this.__priorities.length;
		while(_g < _g1) {
			var i = _g++;
			if(priority > this.__priorities[i]) {
				this.__listeners.splice(i,0,listener);
				this.__priorities.splice(i,0,priority);
				this.__repeat.splice(i,0,!once);
				return;
			}
		}
		this.__listeners.push(listener);
		this.__priorities.push(priority);
		this.__repeat.push(!once);
	}
	,cancel: function() {
		this.canceled = true;
	}
	,dispatch: null
	,has: function(listener) {
		var _g = 0;
		var _g1 = this.__listeners;
		while(_g < _g1.length) {
			var l = _g1[_g];
			++_g;
			if(l == listener) {
				return true;
			}
		}
		return false;
	}
	,remove: function(listener) {
		var i = this.__listeners.length;
		while(--i >= 0) if(this.__listeners[i] == listener) {
			this.__listeners.splice(i,1);
			this.__priorities.splice(i,1);
			this.__repeat.splice(i,1);
		}
	}
	,removeAll: function() {
		var len = this.__listeners.length;
		this.__listeners.splice(0,len);
		this.__priorities.splice(0,len);
		this.__repeat.splice(0,len);
	}
	,__class__: lime_app_Event
};
var lime_app_Future = function(work,useThreads) {
	if(useThreads == null) {
		useThreads = false;
	}
	if(work != null) {
		try {
			this.value = work();
			this.isComplete = true;
		} catch( _g ) {
			haxe_NativeStackTrace.lastError = _g;
			var e = haxe_Exception.caught(_g).unwrap();
			this.error = e;
			this.isError = true;
		}
	}
};
$hxClasses["lime.app.Future"] = lime_app_Future;
lime_app_Future.__name__ = "lime.app.Future";
lime_app_Future.ofEvents = function(onComplete,onError,onProgress) {
	var promise = new lime_app_Promise();
	onComplete.add($bind(promise,promise.complete),true);
	if(onError != null) {
		onError.add($bind(promise,promise.error),true);
	}
	if(onProgress != null) {
		onProgress.add($bind(promise,promise.progress),true);
	}
	return promise.future;
};
lime_app_Future.withError = function(error) {
	var future = new lime_app_Future();
	future.isError = true;
	future.error = error;
	return future;
};
lime_app_Future.withValue = function(value) {
	var future = new lime_app_Future();
	future.isComplete = true;
	future.value = value;
	return future;
};
lime_app_Future.prototype = {
	error: null
	,isComplete: null
	,isError: null
	,value: null
	,__completeListeners: null
	,__errorListeners: null
	,__progressListeners: null
	,onComplete: function(listener) {
		if(listener != null) {
			if(this.isComplete) {
				listener(this.value);
			} else if(!this.isError) {
				if(this.__completeListeners == null) {
					this.__completeListeners = [];
				}
				this.__completeListeners.push(listener);
			}
		}
		return this;
	}
	,onError: function(listener) {
		if(listener != null) {
			if(this.isError) {
				listener(this.error);
			} else if(!this.isComplete) {
				if(this.__errorListeners == null) {
					this.__errorListeners = [];
				}
				this.__errorListeners.push(listener);
			}
		}
		return this;
	}
	,onProgress: function(listener) {
		if(listener != null) {
			if(this.__progressListeners == null) {
				this.__progressListeners = [];
			}
			this.__progressListeners.push(listener);
		}
		return this;
	}
	,ready: function(waitTime) {
		if(waitTime == null) {
			waitTime = -1;
		}
		return this;
	}
	,result: function(waitTime) {
		if(waitTime == null) {
			waitTime = -1;
		}
		this.ready(waitTime);
		if(this.isComplete) {
			return this.value;
		} else {
			return null;
		}
	}
	,then: function(next) {
		if(this.isComplete) {
			return next(this.value);
		} else if(this.isError) {
			var future = new lime_app_Future();
			future.isError = true;
			future.error = this.error;
			return future;
		} else {
			var promise = new lime_app_Promise();
			this.onError($bind(promise,promise.error));
			this.onProgress($bind(promise,promise.progress));
			this.onComplete(function(val) {
				var future = next(val);
				future.onError($bind(promise,promise.error));
				future.onComplete($bind(promise,promise.complete));
			});
			return promise.future;
		}
	}
	,__class__: lime_app_Future
};
var lime_app_Promise = function() {
	this.future = new lime_app_Future();
};
$hxClasses["lime.app.Promise"] = lime_app_Promise;
lime_app_Promise.__name__ = "lime.app.Promise";
lime_app_Promise.prototype = {
	future: null
	,complete: function(data) {
		if(!this.future.isError) {
			this.future.isComplete = true;
			this.future.value = data;
			if(this.future.__completeListeners != null) {
				var _g = 0;
				var _g1 = this.future.__completeListeners;
				while(_g < _g1.length) {
					var listener = _g1[_g];
					++_g;
					listener(data);
				}
				this.future.__completeListeners = null;
			}
		}
		return this;
	}
	,completeWith: function(future) {
		future.onComplete($bind(this,this.complete));
		future.onError($bind(this,this.error));
		future.onProgress($bind(this,this.progress));
		return this;
	}
	,error: function(msg) {
		if(!this.future.isComplete) {
			this.future.isError = true;
			this.future.error = msg;
			if(this.future.__errorListeners != null) {
				var _g = 0;
				var _g1 = this.future.__errorListeners;
				while(_g < _g1.length) {
					var listener = _g1[_g];
					++_g;
					listener(msg);
				}
				this.future.__errorListeners = null;
			}
		}
		return this;
	}
	,progress: function(progress,total) {
		if(!this.future.isError && !this.future.isComplete) {
			if(this.future.__progressListeners != null) {
				var _g = 0;
				var _g1 = this.future.__progressListeners;
				while(_g < _g1.length) {
					var listener = _g1[_g];
					++_g;
					listener(progress,total);
				}
			}
		}
		return this;
	}
	,get_isComplete: function() {
		return this.future.isComplete;
	}
	,get_isError: function() {
		return this.future.isError;
	}
	,__class__: lime_app_Promise
	,__properties__: {get_isError:"get_isError",get_isComplete:"get_isComplete"}
};
var lime_app__$Event_$Array_$String_$_$Void = function() {
	this.canceled = false;
	this.__listeners = [];
	this.__priorities = [];
	this.__repeat = [];
};
$hxClasses["lime.app._Event_Array_String__Void"] = lime_app__$Event_$Array_$String_$_$Void;
lime_app__$Event_$Array_$String_$_$Void.__name__ = "lime.app._Event_Array_String__Void";
lime_app__$Event_$Array_$String_$_$Void.prototype = {
	canceled: null
	,__repeat: null
	,__priorities: null
	,add: function(listener,once,priority) {
		if(priority == null) {
			priority = 0;
		}
		if(once == null) {
			once = false;
		}
		var _g = 0;
		var _g1 = this.__priorities.length;
		while(_g < _g1) {
			var i = _g++;
			if(priority > this.__priorities[i]) {
				this.__listeners.splice(i,0,listener);
				this.__priorities.splice(i,0,priority);
				this.__repeat.splice(i,0,!once);
				return;
			}
		}
		this.__listeners.push(listener);
		this.__priorities.push(priority);
		this.__repeat.push(!once);
	}
	,cancel: function() {
		this.canceled = true;
	}
	,has: function(listener) {
		var _g = 0;
		var _g1 = this.__listeners;
		while(_g < _g1.length) {
			var l = _g1[_g];
			++_g;
			if(l == listener) {
				return true;
			}
		}
		return false;
	}
	,remove: function(listener) {
		var i = this.__listeners.length;
		while(--i >= 0) if(this.__listeners[i] == listener) {
			this.__listeners.splice(i,1);
			this.__priorities.splice(i,1);
			this.__repeat.splice(i,1);
		}
	}
	,removeAll: function() {
		var len = this.__listeners.length;
		this.__listeners.splice(0,len);
		this.__priorities.splice(0,len);
		this.__repeat.splice(0,len);
	}
	,__listeners: null
	,dispatch: function(a) {
		this.canceled = false;
		var listeners = this.__listeners;
		var repeat = this.__repeat;
		var i = 0;
		while(i < listeners.length) {
			listeners[i](a);
			if(!repeat[i]) {
				this.remove(listeners[i]);
			} else {
				++i;
			}
			if(this.canceled) {
				break;
			}
		}
	}
	,__class__: lime_app__$Event_$Array_$String_$_$Void
};
var lime_app__$Event_$Float_$Float_$Float_$Void = function() {
	this.canceled = false;
	this.__listeners = [];
	this.__priorities = [];
	this.__repeat = [];
};
$hxClasses["lime.app._Event_Float_Float_Float_Void"] = lime_app__$Event_$Float_$Float_$Float_$Void;
lime_app__$Event_$Float_$Float_$Float_$Void.__name__ = "lime.app._Event_Float_Float_Float_Void";
lime_app__$Event_$Float_$Float_$Float_$Void.prototype = {
	canceled: null
	,__repeat: null
	,__priorities: null
	,add: function(listener,once,priority) {
		if(priority == null) {
			priority = 0;
		}
		if(once == null) {
			once = false;
		}
		var _g = 0;
		var _g1 = this.__priorities.length;
		while(_g < _g1) {
			var i = _g++;
			if(priority > this.__priorities[i]) {
				this.__listeners.splice(i,0,listener);
				this.__priorities.splice(i,0,priority);
				this.__repeat.splice(i,0,!once);
				return;
			}
		}
		this.__listeners.push(listener);
		this.__priorities.push(priority);
		this.__repeat.push(!once);
	}
	,cancel: function() {
		this.canceled = true;
	}
	,has: function(listener) {
		var _g = 0;
		var _g1 = this.__listeners;
		while(_g < _g1.length) {
			var l = _g1[_g];
			++_g;
			if(l == listener) {
				return true;
			}
		}
		return false;
	}
	,remove: function(listener) {
		var i = this.__listeners.length;
		while(--i >= 0) if(this.__listeners[i] == listener) {
			this.__listeners.splice(i,1);
			this.__priorities.splice(i,1);
			this.__repeat.splice(i,1);
		}
	}
	,removeAll: function() {
		var len = this.__listeners.length;
		this.__listeners.splice(0,len);
		this.__priorities.splice(0,len);
		this.__repeat.splice(0,len);
	}
	,__listeners: null
	,dispatch: function(a,a1,a2) {
		this.canceled = false;
		var listeners = this.__listeners;
		var repeat = this.__repeat;
		var i = 0;
		while(i < listeners.length) {
			listeners[i](a,a1,a2);
			if(!repeat[i]) {
				this.remove(listeners[i]);
			} else {
				++i;
			}
			if(this.canceled) {
				break;
			}
		}
	}
	,__class__: lime_app__$Event_$Float_$Float_$Float_$Void
};
var lime_app__$Event_$Float_$Float_$Int_$Void = function() {
	this.canceled = false;
	this.__listeners = [];
	this.__priorities = [];
	this.__repeat = [];
};
$hxClasses["lime.app._Event_Float_Float_Int_Void"] = lime_app__$Event_$Float_$Float_$Int_$Void;
lime_app__$Event_$Float_$Float_$Int_$Void.__name__ = "lime.app._Event_Float_Float_Int_Void";
lime_app__$Event_$Float_$Float_$Int_$Void.prototype = {
	canceled: null
	,__repeat: null
	,__priorities: null
	,add: function(listener,once,priority) {
		if(priority == null) {
			priority = 0;
		}
		if(once == null) {
			once = false;
		}
		var _g = 0;
		var _g1 = this.__priorities.length;
		while(_g < _g1) {
			var i = _g++;
			if(priority > this.__priorities[i]) {
				this.__listeners.splice(i,0,listener);
				this.__priorities.splice(i,0,priority);
				this.__repeat.splice(i,0,!once);
				return;
			}
		}
		this.__listeners.push(listener);
		this.__priorities.push(priority);
		this.__repeat.push(!once);
	}
	,cancel: function() {
		this.canceled = true;
	}
	,has: function(listener) {
		var _g = 0;
		var _g1 = this.__listeners;
		while(_g < _g1.length) {
			var l = _g1[_g];
			++_g;
			if(l == listener) {
				return true;
			}
		}
		return false;
	}
	,remove: function(listener) {
		var i = this.__listeners.length;
		while(--i >= 0) if(this.__listeners[i] == listener) {
			this.__listeners.splice(i,1);
			this.__priorities.splice(i,1);
			this.__repeat.splice(i,1);
		}
	}
	,removeAll: function() {
		var len = this.__listeners.length;
		this.__listeners.splice(0,len);
		this.__priorities.splice(0,len);
		this.__repeat.splice(0,len);
	}
	,__listeners: null
	,dispatch: function(a,a1,a2) {
		this.canceled = false;
		var listeners = this.__listeners;
		var repeat = this.__repeat;
		var i = 0;
		while(i < listeners.length) {
			listeners[i](a,a1,a2);
			if(!repeat[i]) {
				this.remove(listeners[i]);
			} else {
				++i;
			}
			if(this.canceled) {
				break;
			}
		}
	}
	,__class__: lime_app__$Event_$Float_$Float_$Int_$Void
};
var lime_app__$Event_$Float_$Float_$Void = function() {
	this.canceled = false;
	this.__listeners = [];
	this.__priorities = [];
	this.__repeat = [];
};
$hxClasses["lime.app._Event_Float_Float_Void"] = lime_app__$Event_$Float_$Float_$Void;
lime_app__$Event_$Float_$Float_$Void.__name__ = "lime.app._Event_Float_Float_Void";
lime_app__$Event_$Float_$Float_$Void.prototype = {
	canceled: null
	,__repeat: null
	,__priorities: null
	,add: function(listener,once,priority) {
		if(priority == null) {
			priority = 0;
		}
		if(once == null) {
			once = false;
		}
		var _g = 0;
		var _g1 = this.__priorities.length;
		while(_g < _g1) {
			var i = _g++;
			if(priority > this.__priorities[i]) {
				this.__listeners.splice(i,0,listener);
				this.__priorities.splice(i,0,priority);
				this.__repeat.splice(i,0,!once);
				return;
			}
		}
		this.__listeners.push(listener);
		this.__priorities.push(priority);
		this.__repeat.push(!once);
	}
	,cancel: function() {
		this.canceled = true;
	}
	,has: function(listener) {
		var _g = 0;
		var _g1 = this.__listeners;
		while(_g < _g1.length) {
			var l = _g1[_g];
			++_g;
			if(l == listener) {
				return true;
			}
		}
		return false;
	}
	,remove: function(listener) {
		var i = this.__listeners.length;
		while(--i >= 0) if(this.__listeners[i] == listener) {
			this.__listeners.splice(i,1);
			this.__priorities.splice(i,1);
			this.__repeat.splice(i,1);
		}
	}
	,removeAll: function() {
		var len = this.__listeners.length;
		this.__listeners.splice(0,len);
		this.__priorities.splice(0,len);
		this.__repeat.splice(0,len);
	}
	,__listeners: null
	,dispatch: function(a,a1) {
		this.canceled = false;
		var listeners = this.__listeners;
		var repeat = this.__repeat;
		var i = 0;
		while(i < listeners.length) {
			listeners[i](a,a1);
			if(!repeat[i]) {
				this.remove(listeners[i]);
			} else {
				++i;
			}
			if(this.canceled) {
				break;
			}
		}
	}
	,__class__: lime_app__$Event_$Float_$Float_$Void
};
var lime_app__$Event_$Float_$Float_$lime_$ui_$MouseButton_$Void = function() {
	this.canceled = false;
	this.__listeners = [];
	this.__priorities = [];
	this.__repeat = [];
};
$hxClasses["lime.app._Event_Float_Float_lime_ui_MouseButton_Void"] = lime_app__$Event_$Float_$Float_$lime_$ui_$MouseButton_$Void;
lime_app__$Event_$Float_$Float_$lime_$ui_$MouseButton_$Void.__name__ = "lime.app._Event_Float_Float_lime_ui_MouseButton_Void";
lime_app__$Event_$Float_$Float_$lime_$ui_$MouseButton_$Void.prototype = {
	canceled: null
	,__repeat: null
	,__priorities: null
	,add: function(listener,once,priority) {
		if(priority == null) {
			priority = 0;
		}
		if(once == null) {
			once = false;
		}
		var _g = 0;
		var _g1 = this.__priorities.length;
		while(_g < _g1) {
			var i = _g++;
			if(priority > this.__priorities[i]) {
				this.__listeners.splice(i,0,listener);
				this.__priorities.splice(i,0,priority);
				this.__repeat.splice(i,0,!once);
				return;
			}
		}
		this.__listeners.push(listener);
		this.__priorities.push(priority);
		this.__repeat.push(!once);
	}
	,cancel: function() {
		this.canceled = true;
	}
	,has: function(listener) {
		var _g = 0;
		var _g1 = this.__listeners;
		while(_g < _g1.length) {
			var l = _g1[_g];
			++_g;
			if(l == listener) {
				return true;
			}
		}
		return false;
	}
	,remove: function(listener) {
		var i = this.__listeners.length;
		while(--i >= 0) if(this.__listeners[i] == listener) {
			this.__listeners.splice(i,1);
			this.__priorities.splice(i,1);
			this.__repeat.splice(i,1);
		}
	}
	,removeAll: function() {
		var len = this.__listeners.length;
		this.__listeners.splice(0,len);
		this.__priorities.splice(0,len);
		this.__repeat.splice(0,len);
	}
	,__listeners: null
	,dispatch: function(a,a1,a2) {
		this.canceled = false;
		var listeners = this.__listeners;
		var repeat = this.__repeat;
		var i = 0;
		while(i < listeners.length) {
			listeners[i](a,a1,a2);
			if(!repeat[i]) {
				this.remove(listeners[i]);
			} else {
				++i;
			}
			if(this.canceled) {
				break;
			}
		}
	}
	,__class__: lime_app__$Event_$Float_$Float_$lime_$ui_$MouseButton_$Void
};
var lime_app__$Event_$Float_$Float_$lime_$ui_$MouseWheelMode_$Void = function() {
	this.canceled = false;
	this.__listeners = [];
	this.__priorities = [];
	this.__repeat = [];
};
$hxClasses["lime.app._Event_Float_Float_lime_ui_MouseWheelMode_Void"] = lime_app__$Event_$Float_$Float_$lime_$ui_$MouseWheelMode_$Void;
lime_app__$Event_$Float_$Float_$lime_$ui_$MouseWheelMode_$Void.__name__ = "lime.app._Event_Float_Float_lime_ui_MouseWheelMode_Void";
lime_app__$Event_$Float_$Float_$lime_$ui_$MouseWheelMode_$Void.prototype = {
	canceled: null
	,__repeat: null
	,__priorities: null
	,add: function(listener,once,priority) {
		if(priority == null) {
			priority = 0;
		}
		if(once == null) {
			once = false;
		}
		var _g = 0;
		var _g1 = this.__priorities.length;
		while(_g < _g1) {
			var i = _g++;
			if(priority > this.__priorities[i]) {
				this.__listeners.splice(i,0,listener);
				this.__priorities.splice(i,0,priority);
				this.__repeat.splice(i,0,!once);
				return;
			}
		}
		this.__listeners.push(listener);
		this.__priorities.push(priority);
		this.__repeat.push(!once);
	}
	,cancel: function() {
		this.canceled = true;
	}
	,has: function(listener) {
		var _g = 0;
		var _g1 = this.__listeners;
		while(_g < _g1.length) {
			var l = _g1[_g];
			++_g;
			if(l == listener) {
				return true;
			}
		}
		return false;
	}
	,remove: function(listener) {
		var i = this.__listeners.length;
		while(--i >= 0) if(this.__listeners[i] == listener) {
			this.__listeners.splice(i,1);
			this.__priorities.splice(i,1);
			this.__repeat.splice(i,1);
		}
	}
	,removeAll: function() {
		var len = this.__listeners.length;
		this.__listeners.splice(0,len);
		this.__priorities.splice(0,len);
		this.__repeat.splice(0,len);
	}
	,__listeners: null
	,dispatch: function(a,a1,a2) {
		this.canceled = false;
		var listeners = this.__listeners;
		var repeat = this.__repeat;
		var i = 0;
		while(i < listeners.length) {
			listeners[i](a,a1,a2);
			if(!repeat[i]) {
				this.remove(listeners[i]);
			} else {
				++i;
			}
			if(this.canceled) {
				break;
			}
		}
	}
	,__class__: lime_app__$Event_$Float_$Float_$lime_$ui_$MouseWheelMode_$Void
};
var lime_app__$Event_$Int_$Float_$Void = function() {
	this.canceled = false;
	this.__listeners = [];
	this.__priorities = [];
	this.__repeat = [];
};
$hxClasses["lime.app._Event_Int_Float_Void"] = lime_app__$Event_$Int_$Float_$Void;
lime_app__$Event_$Int_$Float_$Void.__name__ = "lime.app._Event_Int_Float_Void";
lime_app__$Event_$Int_$Float_$Void.prototype = {
	canceled: null
	,__repeat: null
	,__priorities: null
	,add: function(listener,once,priority) {
		if(priority == null) {
			priority = 0;
		}
		if(once == null) {
			once = false;
		}
		var _g = 0;
		var _g1 = this.__priorities.length;
		while(_g < _g1) {
			var i = _g++;
			if(priority > this.__priorities[i]) {
				this.__listeners.splice(i,0,listener);
				this.__priorities.splice(i,0,priority);
				this.__repeat.splice(i,0,!once);
				return;
			}
		}
		this.__listeners.push(listener);
		this.__priorities.push(priority);
		this.__repeat.push(!once);
	}
	,cancel: function() {
		this.canceled = true;
	}
	,has: function(listener) {
		var _g = 0;
		var _g1 = this.__listeners;
		while(_g < _g1.length) {
			var l = _g1[_g];
			++_g;
			if(l == listener) {
				return true;
			}
		}
		return false;
	}
	,remove: function(listener) {
		var i = this.__listeners.length;
		while(--i >= 0) if(this.__listeners[i] == listener) {
			this.__listeners.splice(i,1);
			this.__priorities.splice(i,1);
			this.__repeat.splice(i,1);
		}
	}
	,removeAll: function() {
		var len = this.__listeners.length;
		this.__listeners.splice(0,len);
		this.__priorities.splice(0,len);
		this.__repeat.splice(0,len);
	}
	,__listeners: null
	,dispatch: function(a,a1) {
		this.canceled = false;
		var listeners = this.__listeners;
		var repeat = this.__repeat;
		var i = 0;
		while(i < listeners.length) {
			listeners[i](a,a1);
			if(!repeat[i]) {
				this.remove(listeners[i]);
			} else {
				++i;
			}
			if(this.canceled) {
				break;
			}
		}
	}
	,__class__: lime_app__$Event_$Int_$Float_$Void
};
var lime_app__$Event_$Int_$Int_$Void = function() {
	this.canceled = false;
	this.__listeners = [];
	this.__priorities = [];
	this.__repeat = [];
};
$hxClasses["lime.app._Event_Int_Int_Void"] = lime_app__$Event_$Int_$Int_$Void;
lime_app__$Event_$Int_$Int_$Void.__name__ = "lime.app._Event_Int_Int_Void";
lime_app__$Event_$Int_$Int_$Void.prototype = {
	canceled: null
	,__repeat: null
	,__priorities: null
	,add: function(listener,once,priority) {
		if(priority == null) {
			priority = 0;
		}
		if(once == null) {
			once = false;
		}
		var _g = 0;
		var _g1 = this.__priorities.length;
		while(_g < _g1) {
			var i = _g++;
			if(priority > this.__priorities[i]) {
				this.__listeners.splice(i,0,listener);
				this.__priorities.splice(i,0,priority);
				this.__repeat.splice(i,0,!once);
				return;
			}
		}
		this.__listeners.push(listener);
		this.__priorities.push(priority);
		this.__repeat.push(!once);
	}
	,cancel: function() {
		this.canceled = true;
	}
	,has: function(listener) {
		var _g = 0;
		var _g1 = this.__listeners;
		while(_g < _g1.length) {
			var l = _g1[_g];
			++_g;
			if(l == listener) {
				return true;
			}
		}
		return false;
	}
	,remove: function(listener) {
		var i = this.__listeners.length;
		while(--i >= 0) if(this.__listeners[i] == listener) {
			this.__listeners.splice(i,1);
			this.__priorities.splice(i,1);
			this.__repeat.splice(i,1);
		}
	}
	,removeAll: function() {
		var len = this.__listeners.length;
		this.__listeners.splice(0,len);
		this.__priorities.splice(0,len);
		this.__repeat.splice(0,len);
	}
	,__listeners: null
	,dispatch: function(a,a1) {
		this.canceled = false;
		var listeners = this.__listeners;
		var repeat = this.__repeat;
		var i = 0;
		while(i < listeners.length) {
			listeners[i](a,a1);
			if(!repeat[i]) {
				this.remove(listeners[i]);
			} else {
				++i;
			}
			if(this.canceled) {
				break;
			}
		}
	}
	,__class__: lime_app__$Event_$Int_$Int_$Void
};
var lime_app__$Event_$Int_$Void = function() {
	this.canceled = false;
	this.__listeners = [];
	this.__priorities = [];
	this.__repeat = [];
};
$hxClasses["lime.app._Event_Int_Void"] = lime_app__$Event_$Int_$Void;
lime_app__$Event_$Int_$Void.__name__ = "lime.app._Event_Int_Void";
lime_app__$Event_$Int_$Void.prototype = {
	canceled: null
	,__repeat: null
	,__priorities: null
	,add: function(listener,once,priority) {
		if(priority == null) {
			priority = 0;
		}
		if(once == null) {
			once = false;
		}
		var _g = 0;
		var _g1 = this.__priorities.length;
		while(_g < _g1) {
			var i = _g++;
			if(priority > this.__priorities[i]) {
				this.__listeners.splice(i,0,listener);
				this.__priorities.splice(i,0,priority);
				this.__repeat.splice(i,0,!once);
				return;
			}
		}
		this.__listeners.push(listener);
		this.__priorities.push(priority);
		this.__repeat.push(!once);
	}
	,cancel: function() {
		this.canceled = true;
	}
	,has: function(listener) {
		var _g = 0;
		var _g1 = this.__listeners;
		while(_g < _g1.length) {
			var l = _g1[_g];
			++_g;
			if(l == listener) {
				return true;
			}
		}
		return false;
	}
	,remove: function(listener) {
		var i = this.__listeners.length;
		while(--i >= 0) if(this.__listeners[i] == listener) {
			this.__listeners.splice(i,1);
			this.__priorities.splice(i,1);
			this.__repeat.splice(i,1);
		}
	}
	,removeAll: function() {
		var len = this.__listeners.length;
		this.__listeners.splice(0,len);
		this.__priorities.splice(0,len);
		this.__repeat.splice(0,len);
	}
	,__listeners: null
	,dispatch: function(a) {
		this.canceled = false;
		var listeners = this.__listeners;
		var repeat = this.__repeat;
		var i = 0;
		while(i < listeners.length) {
			listeners[i](a);
			if(!repeat[i]) {
				this.remove(listeners[i]);
			} else {
				++i;
			}
			if(this.canceled) {
				break;
			}
		}
	}
	,__class__: lime_app__$Event_$Int_$Void
};
var lime_app__$Event_$Int_$lime_$system_$Orientation_$Void = function() {
	this.canceled = false;
	this.__listeners = [];
	this.__priorities = [];
	this.__repeat = [];
};
$hxClasses["lime.app._Event_Int_lime_system_Orientation_Void"] = lime_app__$Event_$Int_$lime_$system_$Orientation_$Void;
lime_app__$Event_$Int_$lime_$system_$Orientation_$Void.__name__ = "lime.app._Event_Int_lime_system_Orientation_Void";
lime_app__$Event_$Int_$lime_$system_$Orientation_$Void.prototype = {
	canceled: null
	,__repeat: null
	,__priorities: null
	,add: function(listener,once,priority) {
		if(priority == null) {
			priority = 0;
		}
		if(once == null) {
			once = false;
		}
		var _g = 0;
		var _g1 = this.__priorities.length;
		while(_g < _g1) {
			var i = _g++;
			if(priority > this.__priorities[i]) {
				this.__listeners.splice(i,0,listener);
				this.__priorities.splice(i,0,priority);
				this.__repeat.splice(i,0,!once);
				return;
			}
		}
		this.__listeners.push(listener);
		this.__priorities.push(priority);
		this.__repeat.push(!once);
	}
	,cancel: function() {
		this.canceled = true;
	}
	,has: function(listener) {
		var _g = 0;
		var _g1 = this.__listeners;
		while(_g < _g1.length) {
			var l = _g1[_g];
			++_g;
			if(l == listener) {
				return true;
			}
		}
		return false;
	}
	,remove: function(listener) {
		var i = this.__listeners.length;
		while(--i >= 0) if(this.__listeners[i] == listener) {
			this.__listeners.splice(i,1);
			this.__priorities.splice(i,1);
			this.__repeat.splice(i,1);
		}
	}
	,removeAll: function() {
		var len = this.__listeners.length;
		this.__listeners.splice(0,len);
		this.__priorities.splice(0,len);
		this.__repeat.splice(0,len);
	}
	,__listeners: null
	,dispatch: function(a,a1) {
		this.canceled = false;
		var listeners = this.__listeners;
		var repeat = this.__repeat;
		var i = 0;
		while(i < listeners.length) {
			listeners[i](a,a1);
			if(!repeat[i]) {
				this.remove(listeners[i]);
			} else {
				++i;
			}
			if(this.canceled) {
				break;
			}
		}
	}
	,__class__: lime_app__$Event_$Int_$lime_$system_$Orientation_$Void
};
var lime_app__$Event_$Int_$lime_$ui_$JoystickHatPosition_$Void = function() {
	this.canceled = false;
	this.__listeners = [];
	this.__priorities = [];
	this.__repeat = [];
};
$hxClasses["lime.app._Event_Int_lime_ui_JoystickHatPosition_Void"] = lime_app__$Event_$Int_$lime_$ui_$JoystickHatPosition_$Void;
lime_app__$Event_$Int_$lime_$ui_$JoystickHatPosition_$Void.__name__ = "lime.app._Event_Int_lime_ui_JoystickHatPosition_Void";
lime_app__$Event_$Int_$lime_$ui_$JoystickHatPosition_$Void.prototype = {
	canceled: null
	,__repeat: null
	,__priorities: null
	,add: function(listener,once,priority) {
		if(priority == null) {
			priority = 0;
		}
		if(once == null) {
			once = false;
		}
		var _g = 0;
		var _g1 = this.__priorities.length;
		while(_g < _g1) {
			var i = _g++;
			if(priority > this.__priorities[i]) {
				this.__listeners.splice(i,0,listener);
				this.__priorities.splice(i,0,priority);
				this.__repeat.splice(i,0,!once);
				return;
			}
		}
		this.__listeners.push(listener);
		this.__priorities.push(priority);
		this.__repeat.push(!once);
	}
	,cancel: function() {
		this.canceled = true;
	}
	,has: function(listener) {
		var _g = 0;
		var _g1 = this.__listeners;
		while(_g < _g1.length) {
			var l = _g1[_g];
			++_g;
			if(l == listener) {
				return true;
			}
		}
		return false;
	}
	,remove: function(listener) {
		var i = this.__listeners.length;
		while(--i >= 0) if(this.__listeners[i] == listener) {
			this.__listeners.splice(i,1);
			this.__priorities.splice(i,1);
			this.__repeat.splice(i,1);
		}
	}
	,removeAll: function() {
		var len = this.__listeners.length;
		this.__listeners.splice(0,len);
		this.__priorities.splice(0,len);
		this.__repeat.splice(0,len);
	}
	,__listeners: null
	,dispatch: function(a,a1) {
		this.canceled = false;
		var listeners = this.__listeners;
		var repeat = this.__repeat;
		var i = 0;
		while(i < listeners.length) {
			listeners[i](a,a1);
			if(!repeat[i]) {
				this.remove(listeners[i]);
			} else {
				++i;
			}
			if(this.canceled) {
				break;
			}
		}
	}
	,__class__: lime_app__$Event_$Int_$lime_$ui_$JoystickHatPosition_$Void
};
var lime_app__$Event_$String_$Int_$Int_$Void = function() {
	this.canceled = false;
	this.__listeners = [];
	this.__priorities = [];
	this.__repeat = [];
};
$hxClasses["lime.app._Event_String_Int_Int_Void"] = lime_app__$Event_$String_$Int_$Int_$Void;
lime_app__$Event_$String_$Int_$Int_$Void.__name__ = "lime.app._Event_String_Int_Int_Void";
lime_app__$Event_$String_$Int_$Int_$Void.prototype = {
	canceled: null
	,__repeat: null
	,__priorities: null
	,add: function(listener,once,priority) {
		if(priority == null) {
			priority = 0;
		}
		if(once == null) {
			once = false;
		}
		var _g = 0;
		var _g1 = this.__priorities.length;
		while(_g < _g1) {
			var i = _g++;
			if(priority > this.__priorities[i]) {
				this.__listeners.splice(i,0,listener);
				this.__priorities.splice(i,0,priority);
				this.__repeat.splice(i,0,!once);
				return;
			}
		}
		this.__listeners.push(listener);
		this.__priorities.push(priority);
		this.__repeat.push(!once);
	}
	,cancel: function() {
		this.canceled = true;
	}
	,has: function(listener) {
		var _g = 0;
		var _g1 = this.__listeners;
		while(_g < _g1.length) {
			var l = _g1[_g];
			++_g;
			if(l == listener) {
				return true;
			}
		}
		return false;
	}
	,remove: function(listener) {
		var i = this.__listeners.length;
		while(--i >= 0) if(this.__listeners[i] == listener) {
			this.__listeners.splice(i,1);
			this.__priorities.splice(i,1);
			this.__repeat.splice(i,1);
		}
	}
	,removeAll: function() {
		var len = this.__listeners.length;
		this.__listeners.splice(0,len);
		this.__priorities.splice(0,len);
		this.__repeat.splice(0,len);
	}
	,__listeners: null
	,dispatch: function(a,a1,a2) {
		this.canceled = false;
		var listeners = this.__listeners;
		var repeat = this.__repeat;
		var i = 0;
		while(i < listeners.length) {
			listeners[i](a,a1,a2);
			if(!repeat[i]) {
				this.remove(listeners[i]);
			} else {
				++i;
			}
			if(this.canceled) {
				break;
			}
		}
	}
	,__class__: lime_app__$Event_$String_$Int_$Int_$Void
};
var lime_app__$Event_$String_$Void = function() {
	this.canceled = false;
	this.__listeners = [];
	this.__priorities = [];
	this.__repeat = [];
};
$hxClasses["lime.app._Event_String_Void"] = lime_app__$Event_$String_$Void;
lime_app__$Event_$String_$Void.__name__ = "lime.app._Event_String_Void";
lime_app__$Event_$String_$Void.prototype = {
	canceled: null
	,__repeat: null
	,__priorities: null
	,add: function(listener,once,priority) {
		if(priority == null) {
			priority = 0;
		}
		if(once == null) {
			once = false;
		}
		var _g = 0;
		var _g1 = this.__priorities.length;
		while(_g < _g1) {
			var i = _g++;
			if(priority > this.__priorities[i]) {
				this.__listeners.splice(i,0,listener);
				this.__priorities.splice(i,0,priority);
				this.__repeat.splice(i,0,!once);
				return;
			}
		}
		this.__listeners.push(listener);
		this.__priorities.push(priority);
		this.__repeat.push(!once);
	}
	,cancel: function() {
		this.canceled = true;
	}
	,has: function(listener) {
		var _g = 0;
		var _g1 = this.__listeners;
		while(_g < _g1.length) {
			var l = _g1[_g];
			++_g;
			if(l == listener) {
				return true;
			}
		}
		return false;
	}
	,remove: function(listener) {
		var i = this.__listeners.length;
		while(--i >= 0) if(this.__listeners[i] == listener) {
			this.__listeners.splice(i,1);
			this.__priorities.splice(i,1);
			this.__repeat.splice(i,1);
		}
	}
	,removeAll: function() {
		var len = this.__listeners.length;
		this.__listeners.splice(0,len);
		this.__priorities.splice(0,len);
		this.__repeat.splice(0,len);
	}
	,__listeners: null
	,dispatch: function(a) {
		this.canceled = false;
		var listeners = this.__listeners;
		var repeat = this.__repeat;
		var i = 0;
		while(i < listeners.length) {
			listeners[i](a);
			if(!repeat[i]) {
				this.remove(listeners[i]);
			} else {
				++i;
			}
			if(this.canceled) {
				break;
			}
		}
	}
	,__class__: lime_app__$Event_$String_$Void
};
var lime_app__$Event_$Void_$Void = function() {
	this.canceled = false;
	this.__listeners = [];
	this.__priorities = [];
	this.__repeat = [];
};
$hxClasses["lime.app._Event_Void_Void"] = lime_app__$Event_$Void_$Void;
lime_app__$Event_$Void_$Void.__name__ = "lime.app._Event_Void_Void";
lime_app__$Event_$Void_$Void.prototype = {
	canceled: null
	,__repeat: null
	,__priorities: null
	,add: function(listener,once,priority) {
		if(priority == null) {
			priority = 0;
		}
		if(once == null) {
			once = false;
		}
		var _g = 0;
		var _g1 = this.__priorities.length;
		while(_g < _g1) {
			var i = _g++;
			if(priority > this.__priorities[i]) {
				this.__listeners.splice(i,0,listener);
				this.__priorities.splice(i,0,priority);
				this.__repeat.splice(i,0,!once);
				return;
			}
		}
		this.__listeners.push(listener);
		this.__priorities.push(priority);
		this.__repeat.push(!once);
	}
	,cancel: function() {
		this.canceled = true;
	}
	,has: function(listener) {
		var _g = 0;
		var _g1 = this.__listeners;
		while(_g < _g1.length) {
			var l = _g1[_g];
			++_g;
			if(l == listener) {
				return true;
			}
		}
		return false;
	}
	,remove: function(listener) {
		var i = this.__listeners.length;
		while(--i >= 0) if(this.__listeners[i] == listener) {
			this.__listeners.splice(i,1);
			this.__priorities.splice(i,1);
			this.__repeat.splice(i,1);
		}
	}
	,removeAll: function() {
		var len = this.__listeners.length;
		this.__listeners.splice(0,len);
		this.__priorities.splice(0,len);
		this.__repeat.splice(0,len);
	}
	,__listeners: null
	,dispatch: function() {
		this.canceled = false;
		var listeners = this.__listeners;
		var repeat = this.__repeat;
		var i = 0;
		while(i < listeners.length) {
			listeners[i]();
			if(!repeat[i]) {
				this.remove(listeners[i]);
			} else {
				++i;
			}
			if(this.canceled) {
				break;
			}
		}
	}
	,__class__: lime_app__$Event_$Void_$Void
};
var lime_app__$Event_$haxe_$Exception_$Void = function() {
	this.canceled = false;
	this.__listeners = [];
	this.__priorities = [];
	this.__repeat = [];
};
$hxClasses["lime.app._Event_haxe_Exception_Void"] = lime_app__$Event_$haxe_$Exception_$Void;
lime_app__$Event_$haxe_$Exception_$Void.__name__ = "lime.app._Event_haxe_Exception_Void";
lime_app__$Event_$haxe_$Exception_$Void.prototype = {
	canceled: null
	,__repeat: null
	,__priorities: null
	,add: function(listener,once,priority) {
		if(priority == null) {
			priority = 0;
		}
		if(once == null) {
			once = false;
		}
		var _g = 0;
		var _g1 = this.__priorities.length;
		while(_g < _g1) {
			var i = _g++;
			if(priority > this.__priorities[i]) {
				this.__listeners.splice(i,0,listener);
				this.__priorities.splice(i,0,priority);
				this.__repeat.splice(i,0,!once);
				return;
			}
		}
		this.__listeners.push(listener);
		this.__priorities.push(priority);
		this.__repeat.push(!once);
	}
	,cancel: function() {
		this.canceled = true;
	}
	,has: function(listener) {
		var _g = 0;
		var _g1 = this.__listeners;
		while(_g < _g1.length) {
			var l = _g1[_g];
			++_g;
			if(l == listener) {
				return true;
			}
		}
		return false;
	}
	,remove: function(listener) {
		var i = this.__listeners.length;
		while(--i >= 0) if(this.__listeners[i] == listener) {
			this.__listeners.splice(i,1);
			this.__priorities.splice(i,1);
			this.__repeat.splice(i,1);
		}
	}
	,removeAll: function() {
		var len = this.__listeners.length;
		this.__listeners.splice(0,len);
		this.__priorities.splice(0,len);
		this.__repeat.splice(0,len);
	}
	,__listeners: null
	,dispatch: function(a) {
		this.canceled = false;
		var listeners = this.__listeners;
		var repeat = this.__repeat;
		var i = 0;
		while(i < listeners.length) {
			listeners[i](a);
			if(!repeat[i]) {
				this.remove(listeners[i]);
			} else {
				++i;
			}
			if(this.canceled) {
				break;
			}
		}
	}
	,__class__: lime_app__$Event_$haxe_$Exception_$Void
};
var lime_app__$Event_$lime_$graphics_$RenderContext_$Void = function() {
	this.canceled = false;
	this.__listeners = [];
	this.__priorities = [];
	this.__repeat = [];
};
$hxClasses["lime.app._Event_lime_graphics_RenderContext_Void"] = lime_app__$Event_$lime_$graphics_$RenderContext_$Void;
lime_app__$Event_$lime_$graphics_$RenderContext_$Void.__name__ = "lime.app._Event_lime_graphics_RenderContext_Void";
lime_app__$Event_$lime_$graphics_$RenderContext_$Void.prototype = {
	canceled: null
	,__repeat: null
	,__priorities: null
	,add: function(listener,once,priority) {
		if(priority == null) {
			priority = 0;
		}
		if(once == null) {
			once = false;
		}
		var _g = 0;
		var _g1 = this.__priorities.length;
		while(_g < _g1) {
			var i = _g++;
			if(priority > this.__priorities[i]) {
				this.__listeners.splice(i,0,listener);
				this.__priorities.splice(i,0,priority);
				this.__repeat.splice(i,0,!once);
				return;
			}
		}
		this.__listeners.push(listener);
		this.__priorities.push(priority);
		this.__repeat.push(!once);
	}
	,cancel: function() {
		this.canceled = true;
	}
	,has: function(listener) {
		var _g = 0;
		var _g1 = this.__listeners;
		while(_g < _g1.length) {
			var l = _g1[_g];
			++_g;
			if(l == listener) {
				return true;
			}
		}
		return false;
	}
	,remove: function(listener) {
		var i = this.__listeners.length;
		while(--i >= 0) if(this.__listeners[i] == listener) {
			this.__listeners.splice(i,1);
			this.__priorities.splice(i,1);
			this.__repeat.splice(i,1);
		}
	}
	,removeAll: function() {
		var len = this.__listeners.length;
		this.__listeners.splice(0,len);
		this.__priorities.splice(0,len);
		this.__repeat.splice(0,len);
	}
	,__listeners: null
	,dispatch: function(a) {
		this.canceled = false;
		var listeners = this.__listeners;
		var repeat = this.__repeat;
		var i = 0;
		while(i < listeners.length) {
			listeners[i](a);
			if(!repeat[i]) {
				this.remove(listeners[i]);
			} else {
				++i;
			}
			if(this.canceled) {
				break;
			}
		}
	}
	,__class__: lime_app__$Event_$lime_$graphics_$RenderContext_$Void
};
var lime_app__$Event_$lime_$system_$Orientation_$Void = function() {
	this.canceled = false;
	this.__listeners = [];
	this.__priorities = [];
	this.__repeat = [];
};
$hxClasses["lime.app._Event_lime_system_Orientation_Void"] = lime_app__$Event_$lime_$system_$Orientation_$Void;
lime_app__$Event_$lime_$system_$Orientation_$Void.__name__ = "lime.app._Event_lime_system_Orientation_Void";
lime_app__$Event_$lime_$system_$Orientation_$Void.prototype = {
	canceled: null
	,__repeat: null
	,__priorities: null
	,add: function(listener,once,priority) {
		if(priority == null) {
			priority = 0;
		}
		if(once == null) {
			once = false;
		}
		var _g = 0;
		var _g1 = this.__priorities.length;
		while(_g < _g1) {
			var i = _g++;
			if(priority > this.__priorities[i]) {
				this.__listeners.splice(i,0,listener);
				this.__priorities.splice(i,0,priority);
				this.__repeat.splice(i,0,!once);
				return;
			}
		}
		this.__listeners.push(listener);
		this.__priorities.push(priority);
		this.__repeat.push(!once);
	}
	,cancel: function() {
		this.canceled = true;
	}
	,has: function(listener) {
		var _g = 0;
		var _g1 = this.__listeners;
		while(_g < _g1.length) {
			var l = _g1[_g];
			++_g;
			if(l == listener) {
				return true;
			}
		}
		return false;
	}
	,remove: function(listener) {
		var i = this.__listeners.length;
		while(--i >= 0) if(this.__listeners[i] == listener) {
			this.__listeners.splice(i,1);
			this.__priorities.splice(i,1);
			this.__repeat.splice(i,1);
		}
	}
	,removeAll: function() {
		var len = this.__listeners.length;
		this.__listeners.splice(0,len);
		this.__priorities.splice(0,len);
		this.__repeat.splice(0,len);
	}
	,__listeners: null
	,dispatch: function(a) {
		this.canceled = false;
		var listeners = this.__listeners;
		var repeat = this.__repeat;
		var i = 0;
		while(i < listeners.length) {
			listeners[i](a);
			if(!repeat[i]) {
				this.remove(listeners[i]);
			} else {
				++i;
			}
			if(this.canceled) {
				break;
			}
		}
	}
	,__class__: lime_app__$Event_$lime_$system_$Orientation_$Void
};
var lime_app__$Event_$lime_$system_$State_$Void = function() {
	this.canceled = false;
	this.__listeners = [];
	this.__priorities = [];
	this.__repeat = [];
};
$hxClasses["lime.app._Event_lime_system_State_Void"] = lime_app__$Event_$lime_$system_$State_$Void;
lime_app__$Event_$lime_$system_$State_$Void.__name__ = "lime.app._Event_lime_system_State_Void";
lime_app__$Event_$lime_$system_$State_$Void.prototype = {
	canceled: null
	,__repeat: null
	,__priorities: null
	,add: function(listener,once,priority) {
		if(priority == null) {
			priority = 0;
		}
		if(once == null) {
			once = false;
		}
		var _g = 0;
		var _g1 = this.__priorities.length;
		while(_g < _g1) {
			var i = _g++;
			if(priority > this.__priorities[i]) {
				this.__listeners.splice(i,0,listener);
				this.__priorities.splice(i,0,priority);
				this.__repeat.splice(i,0,!once);
				return;
			}
		}
		this.__listeners.push(listener);
		this.__priorities.push(priority);
		this.__repeat.push(!once);
	}
	,cancel: function() {
		this.canceled = true;
	}
	,has: function(listener) {
		var _g = 0;
		var _g1 = this.__listeners;
		while(_g < _g1.length) {
			var l = _g1[_g];
			++_g;
			if(l == listener) {
				return true;
			}
		}
		return false;
	}
	,remove: function(listener) {
		var i = this.__listeners.length;
		while(--i >= 0) if(this.__listeners[i] == listener) {
			this.__listeners.splice(i,1);
			this.__priorities.splice(i,1);
			this.__repeat.splice(i,1);
		}
	}
	,removeAll: function() {
		var len = this.__listeners.length;
		this.__listeners.splice(0,len);
		this.__priorities.splice(0,len);
		this.__repeat.splice(0,len);
	}
	,__listeners: null
	,dispatch: function(a) {
		this.canceled = false;
		var listeners = this.__listeners;
		var repeat = this.__repeat;
		var i = 0;
		while(i < listeners.length) {
			listeners[i](a);
			if(!repeat[i]) {
				this.remove(listeners[i]);
			} else {
				++i;
			}
			if(this.canceled) {
				break;
			}
		}
	}
	,__class__: lime_app__$Event_$lime_$system_$State_$Void
};
var lime_app__$Event_$lime_$ui_$GamepadAxis_$Float_$Void = function() {
	this.canceled = false;
	this.__listeners = [];
	this.__priorities = [];
	this.__repeat = [];
};
$hxClasses["lime.app._Event_lime_ui_GamepadAxis_Float_Void"] = lime_app__$Event_$lime_$ui_$GamepadAxis_$Float_$Void;
lime_app__$Event_$lime_$ui_$GamepadAxis_$Float_$Void.__name__ = "lime.app._Event_lime_ui_GamepadAxis_Float_Void";
lime_app__$Event_$lime_$ui_$GamepadAxis_$Float_$Void.prototype = {
	canceled: null
	,__repeat: null
	,__priorities: null
	,add: function(listener,once,priority) {
		if(priority == null) {
			priority = 0;
		}
		if(once == null) {
			once = false;
		}
		var _g = 0;
		var _g1 = this.__priorities.length;
		while(_g < _g1) {
			var i = _g++;
			if(priority > this.__priorities[i]) {
				this.__listeners.splice(i,0,listener);
				this.__priorities.splice(i,0,priority);
				this.__repeat.splice(i,0,!once);
				return;
			}
		}
		this.__listeners.push(listener);
		this.__priorities.push(priority);
		this.__repeat.push(!once);
	}
	,cancel: function() {
		this.canceled = true;
	}
	,has: function(listener) {
		var _g = 0;
		var _g1 = this.__listeners;
		while(_g < _g1.length) {
			var l = _g1[_g];
			++_g;
			if(l == listener) {
				return true;
			}
		}
		return false;
	}
	,remove: function(listener) {
		var i = this.__listeners.length;
		while(--i >= 0) if(this.__listeners[i] == listener) {
			this.__listeners.splice(i,1);
			this.__priorities.splice(i,1);
			this.__repeat.splice(i,1);
		}
	}
	,removeAll: function() {
		var len = this.__listeners.length;
		this.__listeners.splice(0,len);
		this.__priorities.splice(0,len);
		this.__repeat.splice(0,len);
	}
	,__listeners: null
	,dispatch: function(a,a1) {
		this.canceled = false;
		var listeners = this.__listeners;
		var repeat = this.__repeat;
		var i = 0;
		while(i < listeners.length) {
			listeners[i](a,a1);
			if(!repeat[i]) {
				this.remove(listeners[i]);
			} else {
				++i;
			}
			if(this.canceled) {
				break;
			}
		}
	}
	,__class__: lime_app__$Event_$lime_$ui_$GamepadAxis_$Float_$Void
};
var lime_app__$Event_$lime_$ui_$GamepadButton_$Void = function() {
	this.canceled = false;
	this.__listeners = [];
	this.__priorities = [];
	this.__repeat = [];
};
$hxClasses["lime.app._Event_lime_ui_GamepadButton_Void"] = lime_app__$Event_$lime_$ui_$GamepadButton_$Void;
lime_app__$Event_$lime_$ui_$GamepadButton_$Void.__name__ = "lime.app._Event_lime_ui_GamepadButton_Void";
lime_app__$Event_$lime_$ui_$GamepadButton_$Void.prototype = {
	canceled: null
	,__repeat: null
	,__priorities: null
	,add: function(listener,once,priority) {
		if(priority == null) {
			priority = 0;
		}
		if(once == null) {
			once = false;
		}
		var _g = 0;
		var _g1 = this.__priorities.length;
		while(_g < _g1) {
			var i = _g++;
			if(priority > this.__priorities[i]) {
				this.__listeners.splice(i,0,listener);
				this.__priorities.splice(i,0,priority);
				this.__repeat.splice(i,0,!once);
				return;
			}
		}
		this.__listeners.push(listener);
		this.__priorities.push(priority);
		this.__repeat.push(!once);
	}
	,cancel: function() {
		this.canceled = true;
	}
	,has: function(listener) {
		var _g = 0;
		var _g1 = this.__listeners;
		while(_g < _g1.length) {
			var l = _g1[_g];
			++_g;
			if(l == listener) {
				return true;
			}
		}
		return false;
	}
	,remove: function(listener) {
		var i = this.__listeners.length;
		while(--i >= 0) if(this.__listeners[i] == listener) {
			this.__listeners.splice(i,1);
			this.__priorities.splice(i,1);
			this.__repeat.splice(i,1);
		}
	}
	,removeAll: function() {
		var len = this.__listeners.length;
		this.__listeners.splice(0,len);
		this.__priorities.splice(0,len);
		this.__repeat.splice(0,len);
	}
	,__listeners: null
	,dispatch: function(a) {
		this.canceled = false;
		var listeners = this.__listeners;
		var repeat = this.__repeat;
		var i = 0;
		while(i < listeners.length) {
			listeners[i](a);
			if(!repeat[i]) {
				this.remove(listeners[i]);
			} else {
				++i;
			}
			if(this.canceled) {
				break;
			}
		}
	}
	,__class__: lime_app__$Event_$lime_$ui_$GamepadButton_$Void
};
var lime_app__$Event_$lime_$ui_$Gamepad_$Void = function() {
	this.canceled = false;
	this.__listeners = [];
	this.__priorities = [];
	this.__repeat = [];
};
$hxClasses["lime.app._Event_lime_ui_Gamepad_Void"] = lime_app__$Event_$lime_$ui_$Gamepad_$Void;
lime_app__$Event_$lime_$ui_$Gamepad_$Void.__name__ = "lime.app._Event_lime_ui_Gamepad_Void";
lime_app__$Event_$lime_$ui_$Gamepad_$Void.prototype = {
	canceled: null
	,__repeat: null
	,__priorities: null
	,add: function(listener,once,priority) {
		if(priority == null) {
			priority = 0;
		}
		if(once == null) {
			once = false;
		}
		var _g = 0;
		var _g1 = this.__priorities.length;
		while(_g < _g1) {
			var i = _g++;
			if(priority > this.__priorities[i]) {
				this.__listeners.splice(i,0,listener);
				this.__priorities.splice(i,0,priority);
				this.__repeat.splice(i,0,!once);
				return;
			}
		}
		this.__listeners.push(listener);
		this.__priorities.push(priority);
		this.__repeat.push(!once);
	}
	,cancel: function() {
		this.canceled = true;
	}
	,has: function(listener) {
		var _g = 0;
		var _g1 = this.__listeners;
		while(_g < _g1.length) {
			var l = _g1[_g];
			++_g;
			if(l == listener) {
				return true;
			}
		}
		return false;
	}
	,remove: function(listener) {
		var i = this.__listeners.length;
		while(--i >= 0) if(this.__listeners[i] == listener) {
			this.__listeners.splice(i,1);
			this.__priorities.splice(i,1);
			this.__repeat.splice(i,1);
		}
	}
	,removeAll: function() {
		var len = this.__listeners.length;
		this.__listeners.splice(0,len);
		this.__priorities.splice(0,len);
		this.__repeat.splice(0,len);
	}
	,__listeners: null
	,dispatch: function(a) {
		this.canceled = false;
		var listeners = this.__listeners;
		var repeat = this.__repeat;
		var i = 0;
		while(i < listeners.length) {
			listeners[i](a);
			if(!repeat[i]) {
				this.remove(listeners[i]);
			} else {
				++i;
			}
			if(this.canceled) {
				break;
			}
		}
	}
	,__class__: lime_app__$Event_$lime_$ui_$Gamepad_$Void
};
var lime_app__$Event_$lime_$ui_$Joystick_$Void = function() {
	this.canceled = false;
	this.__listeners = [];
	this.__priorities = [];
	this.__repeat = [];
};
$hxClasses["lime.app._Event_lime_ui_Joystick_Void"] = lime_app__$Event_$lime_$ui_$Joystick_$Void;
lime_app__$Event_$lime_$ui_$Joystick_$Void.__name__ = "lime.app._Event_lime_ui_Joystick_Void";
lime_app__$Event_$lime_$ui_$Joystick_$Void.prototype = {
	canceled: null
	,__repeat: null
	,__priorities: null
	,add: function(listener,once,priority) {
		if(priority == null) {
			priority = 0;
		}
		if(once == null) {
			once = false;
		}
		var _g = 0;
		var _g1 = this.__priorities.length;
		while(_g < _g1) {
			var i = _g++;
			if(priority > this.__priorities[i]) {
				this.__listeners.splice(i,0,listener);
				this.__priorities.splice(i,0,priority);
				this.__repeat.splice(i,0,!once);
				return;
			}
		}
		this.__listeners.push(listener);
		this.__priorities.push(priority);
		this.__repeat.push(!once);
	}
	,cancel: function() {
		this.canceled = true;
	}
	,has: function(listener) {
		var _g = 0;
		var _g1 = this.__listeners;
		while(_g < _g1.length) {
			var l = _g1[_g];
			++_g;
			if(l == listener) {
				return true;
			}
		}
		return false;
	}
	,remove: function(listener) {
		var i = this.__listeners.length;
		while(--i >= 0) if(this.__listeners[i] == listener) {
			this.__listeners.splice(i,1);
			this.__priorities.splice(i,1);
			this.__repeat.splice(i,1);
		}
	}
	,removeAll: function() {
		var len = this.__listeners.length;
		this.__listeners.splice(0,len);
		this.__priorities.splice(0,len);
		this.__repeat.splice(0,len);
	}
	,__listeners: null
	,dispatch: function(a) {
		this.canceled = false;
		var listeners = this.__listeners;
		var repeat = this.__repeat;
		var i = 0;
		while(i < listeners.length) {
			listeners[i](a);
			if(!repeat[i]) {
				this.remove(listeners[i]);
			} else {
				++i;
			}
			if(this.canceled) {
				break;
			}
		}
	}
	,__class__: lime_app__$Event_$lime_$ui_$Joystick_$Void
};
var lime_app__$Event_$lime_$ui_$KeyCode_$lime_$ui_$KeyModifier_$Void = function() {
	this.canceled = false;
	this.__listeners = [];
	this.__priorities = [];
	this.__repeat = [];
};
$hxClasses["lime.app._Event_lime_ui_KeyCode_lime_ui_KeyModifier_Void"] = lime_app__$Event_$lime_$ui_$KeyCode_$lime_$ui_$KeyModifier_$Void;
lime_app__$Event_$lime_$ui_$KeyCode_$lime_$ui_$KeyModifier_$Void.__name__ = "lime.app._Event_lime_ui_KeyCode_lime_ui_KeyModifier_Void";
lime_app__$Event_$lime_$ui_$KeyCode_$lime_$ui_$KeyModifier_$Void.prototype = {
	canceled: null
	,__repeat: null
	,__priorities: null
	,add: function(listener,once,priority) {
		if(priority == null) {
			priority = 0;
		}
		if(once == null) {
			once = false;
		}
		var _g = 0;
		var _g1 = this.__priorities.length;
		while(_g < _g1) {
			var i = _g++;
			if(priority > this.__priorities[i]) {
				this.__listeners.splice(i,0,listener);
				this.__priorities.splice(i,0,priority);
				this.__repeat.splice(i,0,!once);
				return;
			}
		}
		this.__listeners.push(listener);
		this.__priorities.push(priority);
		this.__repeat.push(!once);
	}
	,cancel: function() {
		this.canceled = true;
	}
	,has: function(listener) {
		var _g = 0;
		var _g1 = this.__listeners;
		while(_g < _g1.length) {
			var l = _g1[_g];
			++_g;
			if(l == listener) {
				return true;
			}
		}
		return false;
	}
	,remove: function(listener) {
		var i = this.__listeners.length;
		while(--i >= 0) if(this.__listeners[i] == listener) {
			this.__listeners.splice(i,1);
			this.__priorities.splice(i,1);
			this.__repeat.splice(i,1);
		}
	}
	,removeAll: function() {
		var len = this.__listeners.length;
		this.__listeners.splice(0,len);
		this.__priorities.splice(0,len);
		this.__repeat.splice(0,len);
	}
	,__listeners: null
	,dispatch: function(a,a1) {
		this.canceled = false;
		var listeners = this.__listeners;
		var repeat = this.__repeat;
		var i = 0;
		while(i < listeners.length) {
			listeners[i](a,a1);
			if(!repeat[i]) {
				this.remove(listeners[i]);
			} else {
				++i;
			}
			if(this.canceled) {
				break;
			}
		}
	}
	,__class__: lime_app__$Event_$lime_$ui_$KeyCode_$lime_$ui_$KeyModifier_$Void
};
var lime_app__$Event_$lime_$ui_$Touch_$Void = function() {
	this.canceled = false;
	this.__listeners = [];
	this.__priorities = [];
	this.__repeat = [];
};
$hxClasses["lime.app._Event_lime_ui_Touch_Void"] = lime_app__$Event_$lime_$ui_$Touch_$Void;
lime_app__$Event_$lime_$ui_$Touch_$Void.__name__ = "lime.app._Event_lime_ui_Touch_Void";
lime_app__$Event_$lime_$ui_$Touch_$Void.prototype = {
	canceled: null
	,__repeat: null
	,__priorities: null
	,add: function(listener,once,priority) {
		if(priority == null) {
			priority = 0;
		}
		if(once == null) {
			once = false;
		}
		var _g = 0;
		var _g1 = this.__priorities.length;
		while(_g < _g1) {
			var i = _g++;
			if(priority > this.__priorities[i]) {
				this.__listeners.splice(i,0,listener);
				this.__priorities.splice(i,0,priority);
				this.__repeat.splice(i,0,!once);
				return;
			}
		}
		this.__listeners.push(listener);
		this.__priorities.push(priority);
		this.__repeat.push(!once);
	}
	,cancel: function() {
		this.canceled = true;
	}
	,has: function(listener) {
		var _g = 0;
		var _g1 = this.__listeners;
		while(_g < _g1.length) {
			var l = _g1[_g];
			++_g;
			if(l == listener) {
				return true;
			}
		}
		return false;
	}
	,remove: function(listener) {
		var i = this.__listeners.length;
		while(--i >= 0) if(this.__listeners[i] == listener) {
			this.__listeners.splice(i,1);
			this.__priorities.splice(i,1);
			this.__repeat.splice(i,1);
		}
	}
	,removeAll: function() {
		var len = this.__listeners.length;
		this.__listeners.splice(0,len);
		this.__priorities.splice(0,len);
		this.__repeat.splice(0,len);
	}
	,__listeners: null
	,dispatch: function(a) {
		this.canceled = false;
		var listeners = this.__listeners;
		var repeat = this.__repeat;
		var i = 0;
		while(i < listeners.length) {
			listeners[i](a);
			if(!repeat[i]) {
				this.remove(listeners[i]);
			} else {
				++i;
			}
			if(this.canceled) {
				break;
			}
		}
	}
	,__class__: lime_app__$Event_$lime_$ui_$Touch_$Void
};
var lime_app__$Event_$lime_$ui_$Window_$Void = function() {
	this.canceled = false;
	this.__listeners = [];
	this.__priorities = [];
	this.__repeat = [];
};
$hxClasses["lime.app._Event_lime_ui_Window_Void"] = lime_app__$Event_$lime_$ui_$Window_$Void;
lime_app__$Event_$lime_$ui_$Window_$Void.__name__ = "lime.app._Event_lime_ui_Window_Void";
lime_app__$Event_$lime_$ui_$Window_$Void.prototype = {
	canceled: null
	,__repeat: null
	,__priorities: null
	,add: function(listener,once,priority) {
		if(priority == null) {
			priority = 0;
		}
		if(once == null) {
			once = false;
		}
		var _g = 0;
		var _g1 = this.__priorities.length;
		while(_g < _g1) {
			var i = _g++;
			if(priority > this.__priorities[i]) {
				this.__listeners.splice(i,0,listener);
				this.__priorities.splice(i,0,priority);
				this.__repeat.splice(i,0,!once);
				return;
			}
		}
		this.__listeners.push(listener);
		this.__priorities.push(priority);
		this.__repeat.push(!once);
	}
	,cancel: function() {
		this.canceled = true;
	}
	,has: function(listener) {
		var _g = 0;
		var _g1 = this.__listeners;
		while(_g < _g1.length) {
			var l = _g1[_g];
			++_g;
			if(l == listener) {
				return true;
			}
		}
		return false;
	}
	,remove: function(listener) {
		var i = this.__listeners.length;
		while(--i >= 0) if(this.__listeners[i] == listener) {
			this.__listeners.splice(i,1);
			this.__priorities.splice(i,1);
			this.__repeat.splice(i,1);
		}
	}
	,removeAll: function() {
		var len = this.__listeners.length;
		this.__listeners.splice(0,len);
		this.__priorities.splice(0,len);
		this.__repeat.splice(0,len);
	}
	,__listeners: null
	,dispatch: function(a) {
		this.canceled = false;
		var listeners = this.__listeners;
		var repeat = this.__repeat;
		var i = 0;
		while(i < listeners.length) {
			listeners[i](a);
			if(!repeat[i]) {
				this.remove(listeners[i]);
			} else {
				++i;
			}
			if(this.canceled) {
				break;
			}
		}
	}
	,__class__: lime_app__$Event_$lime_$ui_$Window_$Void
};
var lime_app__$Event_$lime_$utils_$Resource_$Void = function() {
	this.canceled = false;
	this.__listeners = [];
	this.__priorities = [];
	this.__repeat = [];
};
$hxClasses["lime.app._Event_lime_utils_Resource_Void"] = lime_app__$Event_$lime_$utils_$Resource_$Void;
lime_app__$Event_$lime_$utils_$Resource_$Void.__name__ = "lime.app._Event_lime_utils_Resource_Void";
lime_app__$Event_$lime_$utils_$Resource_$Void.prototype = {
	canceled: null
	,__repeat: null
	,__priorities: null
	,add: function(listener,once,priority) {
		if(priority == null) {
			priority = 0;
		}
		if(once == null) {
			once = false;
		}
		var _g = 0;
		var _g1 = this.__priorities.length;
		while(_g < _g1) {
			var i = _g++;
			if(priority > this.__priorities[i]) {
				this.__listeners.splice(i,0,listener);
				this.__priorities.splice(i,0,priority);
				this.__repeat.splice(i,0,!once);
				return;
			}
		}
		this.__listeners.push(listener);
		this.__priorities.push(priority);
		this.__repeat.push(!once);
	}
	,cancel: function() {
		this.canceled = true;
	}
	,has: function(listener) {
		var _g = 0;
		var _g1 = this.__listeners;
		while(_g < _g1.length) {
			var l = _g1[_g];
			++_g;
			if(l == listener) {
				return true;
			}
		}
		return false;
	}
	,remove: function(listener) {
		var i = this.__listeners.length;
		while(--i >= 0) if(this.__listeners[i] == listener) {
			this.__listeners.splice(i,1);
			this.__priorities.splice(i,1);
			this.__repeat.splice(i,1);
		}
	}
	,removeAll: function() {
		var len = this.__listeners.length;
		this.__listeners.splice(0,len);
		this.__priorities.splice(0,len);
		this.__repeat.splice(0,len);
	}
	,__listeners: null
	,dispatch: function(a) {
		this.canceled = false;
		var listeners = this.__listeners;
		var repeat = this.__repeat;
		var i = 0;
		while(i < listeners.length) {
			listeners[i](a);
			if(!repeat[i]) {
				this.remove(listeners[i]);
			} else {
				++i;
			}
			if(this.canceled) {
				break;
			}
		}
	}
	,__class__: lime_app__$Event_$lime_$utils_$Resource_$Void
};
var lime_app__$Event_$ofEvents_$T_$Void = function() {
	this.canceled = false;
	this.__listeners = [];
	this.__priorities = [];
	this.__repeat = [];
};
$hxClasses["lime.app._Event_ofEvents_T_Void"] = lime_app__$Event_$ofEvents_$T_$Void;
lime_app__$Event_$ofEvents_$T_$Void.__name__ = "lime.app._Event_ofEvents_T_Void";
lime_app__$Event_$ofEvents_$T_$Void.prototype = {
	canceled: null
	,__repeat: null
	,__priorities: null
	,add: function(listener,once,priority) {
		if(priority == null) {
			priority = 0;
		}
		if(once == null) {
			once = false;
		}
		var _g = 0;
		var _g1 = this.__priorities.length;
		while(_g < _g1) {
			var i = _g++;
			if(priority > this.__priorities[i]) {
				this.__listeners.splice(i,0,listener);
				this.__priorities.splice(i,0,priority);
				this.__repeat.splice(i,0,!once);
				return;
			}
		}
		this.__listeners.push(listener);
		this.__priorities.push(priority);
		this.__repeat.push(!once);
	}
	,cancel: function() {
		this.canceled = true;
	}
	,has: function(listener) {
		var _g = 0;
		var _g1 = this.__listeners;
		while(_g < _g1.length) {
			var l = _g1[_g];
			++_g;
			if(l == listener) {
				return true;
			}
		}
		return false;
	}
	,remove: function(listener) {
		var i = this.__listeners.length;
		while(--i >= 0) if(this.__listeners[i] == listener) {
			this.__listeners.splice(i,1);
			this.__priorities.splice(i,1);
			this.__repeat.splice(i,1);
		}
	}
	,removeAll: function() {
		var len = this.__listeners.length;
		this.__listeners.splice(0,len);
		this.__priorities.splice(0,len);
		this.__repeat.splice(0,len);
	}
	,__listeners: null
	,dispatch: function(a) {
		this.canceled = false;
		var listeners = this.__listeners;
		var repeat = this.__repeat;
		var i = 0;
		while(i < listeners.length) {
			listeners[i](a);
			if(!repeat[i]) {
				this.remove(listeners[i]);
			} else {
				++i;
			}
			if(this.canceled) {
				break;
			}
		}
	}
	,__class__: lime_app__$Event_$ofEvents_$T_$Void
};
var lime_graphics_CairoRenderContext = {};
lime_graphics_CairoRenderContext.fromRenderContext = function(context) {
	return context.cairo;
};
var lime_graphics_Canvas2DRenderContext = {};
lime_graphics_Canvas2DRenderContext.fromRenderContext = function(context) {
	return context.canvas2D;
};
var lime_graphics_DOMRenderContext = {};
lime_graphics_DOMRenderContext.fromRenderContext = function(context) {
	return context.dom;
};
var lime_graphics_FlashRenderContext = {};
lime_graphics_FlashRenderContext.fromRenderContext = function(context) {
	return null;
};
var lime_graphics_Image = function(buffer,offsetX,offsetY,width,height,color,type) {
	if(height == null) {
		height = -1;
	}
	if(width == null) {
		width = -1;
	}
	if(offsetY == null) {
		offsetY = 0;
	}
	if(offsetX == null) {
		offsetX = 0;
	}
	this.offsetX = offsetX;
	this.offsetY = offsetY;
	this.width = width;
	this.height = height;
	this.version = 0;
	if(type == null) {
		type = lime_graphics_ImageType.CANVAS;
		if(lime__$internal_backend_html5_HTML5Thread.__current.__worker != null || lime__$internal_backend_html5_HTML5Thread.__isWorker) {
			type = lime_graphics_ImageType.DATA;
		}
	}
	this.type = type;
	if(buffer == null) {
		if(width > 0 && height > 0) {
			switch(this.type._hx_index) {
			case 0:
				this.buffer = new lime_graphics_ImageBuffer(null,width,height);
				lime__$internal_graphics_ImageCanvasUtil.createCanvas(this,width,height);
				if(color != null && color != 0) {
					this.fillRect(new lime_math_Rectangle(0,0,width,height),color);
				}
				break;
			case 1:
				var elements = width * height * 4;
				var array = null;
				var vector = null;
				var view = null;
				var buffer1 = null;
				var len = null;
				var this1;
				if(elements != null) {
					this1 = new Uint8Array(elements);
				} else if(array != null) {
					this1 = new Uint8Array(array);
				} else if(vector != null) {
					this1 = new Uint8Array(vector.__array);
				} else if(view != null) {
					this1 = new Uint8Array(view);
				} else if(buffer1 != null) {
					if(len == null) {
						this1 = new Uint8Array(buffer1,0);
					} else {
						this1 = new Uint8Array(buffer1,0,len);
					}
				} else {
					this1 = null;
				}
				this.buffer = new lime_graphics_ImageBuffer(this1,width,height);
				if(color != null && color != 0) {
					this.fillRect(new lime_math_Rectangle(0,0,width,height),color);
				}
				break;
			case 2:
				break;
			default:
			}
		}
	} else {
		this.__fromImageBuffer(buffer);
	}
};
$hxClasses["lime.graphics.Image"] = lime_graphics_Image;
lime_graphics_Image.__name__ = "lime.graphics.Image";
lime_graphics_Image.fromBase64 = function(base64,type) {
	if(base64 == null) {
		return null;
	}
	var image = new lime_graphics_Image();
	image.__fromBase64(base64,type);
	return image;
};
lime_graphics_Image.fromBitmapData = function(bitmapData) {
	if(bitmapData == null) {
		return null;
	}
	return bitmapData.image;
};
lime_graphics_Image.fromBytes = function(bytes) {
	if(bytes == null) {
		return null;
	}
	var image = new lime_graphics_Image();
	if(image.__fromBytes(bytes)) {
		return image;
	} else {
		return null;
	}
};
lime_graphics_Image.fromCanvas = function(canvas) {
	if(canvas == null) {
		return null;
	}
	var buffer = new lime_graphics_ImageBuffer(null,canvas.width,canvas.height);
	buffer.set_src(canvas);
	var image = new lime_graphics_Image(buffer);
	image.type = lime_graphics_ImageType.CANVAS;
	return image;
};
lime_graphics_Image.fromFile = function(path) {
	if(path == null) {
		return null;
	}
	var image = new lime_graphics_Image();
	if(image.__fromFile(path)) {
		return image;
	} else {
		return null;
	}
};
lime_graphics_Image.fromImageElement = function(image) {
	if(image == null) {
		return null;
	}
	var buffer = new lime_graphics_ImageBuffer(null,image.width,image.height);
	buffer.set_src(image);
	var _image = new lime_graphics_Image(buffer);
	_image.type = lime_graphics_ImageType.CANVAS;
	return _image;
};
lime_graphics_Image.loadFromBase64 = function(base64,type) {
	if(base64 == null || type == null) {
		return lime_app_Future.withValue(null);
	}
	return lime__$internal_backend_html5_HTML5HTTPRequest.loadImage("data:" + type + ";base64," + base64);
};
lime_graphics_Image.loadFromBytes = function(bytes) {
	if(bytes == null) {
		return lime_app_Future.withValue(null);
	}
	var type = "";
	if(lime_graphics_Image.__isPNG(bytes)) {
		type = "image/png";
	} else if(lime_graphics_Image.__isJPG(bytes)) {
		type = "image/jpeg";
	} else if(lime_graphics_Image.__isGIF(bytes)) {
		type = "image/gif";
	} else if(lime_graphics_Image.__isWebP(bytes)) {
		type = "image/webp";
	} else {
		return lime_app_Future.withValue(null);
	}
	return lime__$internal_backend_html5_HTML5HTTPRequest.loadImageFromBytes(bytes,type);
};
lime_graphics_Image.loadFromFile = function(path) {
	if(path == null) {
		return lime_app_Future.withValue(null);
	}
	return lime__$internal_backend_html5_HTML5HTTPRequest.loadImage(path);
};
lime_graphics_Image.__isGIF = function(bytes) {
	if(bytes == null || bytes.length < 6) {
		return false;
	}
	var header = bytes.getString(0,6);
	if(header != "GIF87a") {
		return header == "GIF89a";
	} else {
		return true;
	}
};
lime_graphics_Image.__isJPG = function(bytes) {
	if(bytes == null || bytes.length < 4) {
		return false;
	}
	if(bytes.b[0] == 255 && bytes.b[1] == 216 && bytes.b[bytes.length - 2] == 255) {
		return bytes.b[bytes.length - 1] == 217;
	} else {
		return false;
	}
};
lime_graphics_Image.__isPNG = function(bytes) {
	if(bytes == null || bytes.length < 8) {
		return false;
	}
	if(bytes.b[0] == 137 && bytes.b[1] == 80 && bytes.b[2] == 78 && bytes.b[3] == 71 && bytes.b[4] == 13 && bytes.b[5] == 10 && bytes.b[6] == 26) {
		return bytes.b[7] == 10;
	} else {
		return false;
	}
};
lime_graphics_Image.__isWebP = function(bytes) {
	if(bytes == null || bytes.length < 16) {
		return false;
	}
	if(bytes.getString(0,4) == "RIFF") {
		return bytes.getString(8,4) == "WEBP";
	} else {
		return false;
	}
};
lime_graphics_Image.prototype = {
	buffer: null
	,dirty: null
	,height: null
	,offsetX: null
	,offsetY: null
	,rect: null
	,type: null
	,version: null
	,width: null
	,x: null
	,y: null
	,clone: function() {
		if(this.buffer != null) {
			if(this.type == lime_graphics_ImageType.CANVAS) {
				lime__$internal_graphics_ImageCanvasUtil.convertToCanvas(this);
			} else {
				lime__$internal_graphics_ImageCanvasUtil.convertToData(this);
			}
			var image = new lime_graphics_Image(this.buffer.clone(),this.offsetX,this.offsetY,this.width,this.height,null,this.type);
			image.version = this.version;
			return image;
		} else {
			return new lime_graphics_Image(null,this.offsetX,this.offsetY,this.width,this.height,null,this.type);
		}
	}
	,colorTransform: function(rect,colorMatrix) {
		rect = this.__clipRect(rect);
		if(this.buffer == null || rect == null) {
			return;
		}
		switch(this.type._hx_index) {
		case 0:
			lime__$internal_graphics_ImageCanvasUtil.colorTransform(this,rect,colorMatrix);
			break;
		case 1:
			lime__$internal_graphics_ImageCanvasUtil.convertToData(this);
			lime__$internal_graphics_ImageDataUtil.colorTransform(this,rect,colorMatrix);
			break;
		case 2:
			rect.offset(this.offsetX,this.offsetY);
			this.buffer.__srcBitmapData.colorTransform(rect.__toFlashRectangle(),lime_math_ColorMatrix.__toFlashColorTransform(colorMatrix));
			break;
		default:
		}
	}
	,copyChannel: function(sourceImage,sourceRect,destPoint,sourceChannel,destChannel) {
		sourceRect = this.__clipRect(sourceRect);
		if(this.buffer == null || sourceRect == null) {
			return;
		}
		if(destChannel == lime_graphics_ImageChannel.ALPHA && !this.get_transparent()) {
			return;
		}
		if(sourceRect.width <= 0 || sourceRect.height <= 0) {
			return;
		}
		if(sourceRect.x + sourceRect.width > sourceImage.width) {
			sourceRect.width = sourceImage.width - sourceRect.x;
		}
		if(sourceRect.y + sourceRect.height > sourceImage.height) {
			sourceRect.height = sourceImage.height - sourceRect.y;
		}
		switch(this.type._hx_index) {
		case 0:
			lime__$internal_graphics_ImageCanvasUtil.copyChannel(this,sourceImage,sourceRect,destPoint,sourceChannel,destChannel);
			break;
		case 1:
			lime__$internal_graphics_ImageCanvasUtil.convertToData(this);
			lime__$internal_graphics_ImageCanvasUtil.convertToData(sourceImage);
			lime__$internal_graphics_ImageDataUtil.copyChannel(this,sourceImage,sourceRect,destPoint,sourceChannel,destChannel);
			break;
		case 2:
			var srcChannel;
			switch(sourceChannel._hx_index) {
			case 0:
				srcChannel = 1;
				break;
			case 1:
				srcChannel = 2;
				break;
			case 2:
				srcChannel = 4;
				break;
			case 3:
				srcChannel = 8;
				break;
			}
			var dstChannel;
			switch(destChannel._hx_index) {
			case 0:
				dstChannel = 1;
				break;
			case 1:
				dstChannel = 2;
				break;
			case 2:
				dstChannel = 4;
				break;
			case 3:
				dstChannel = 8;
				break;
			}
			sourceRect.offset(sourceImage.offsetX,sourceImage.offsetY);
			destPoint.offset(this.offsetX,this.offsetY);
			this.buffer.__srcBitmapData.copyChannel(sourceImage.buffer.get_src(),sourceRect.__toFlashRectangle(),destPoint.__toFlashPoint(),srcChannel,dstChannel);
			break;
		default:
		}
	}
	,copyPixels: function(sourceImage,sourceRect,destPoint,alphaImage,alphaPoint,mergeAlpha) {
		if(mergeAlpha == null) {
			mergeAlpha = false;
		}
		if(this.buffer == null || sourceImage == null) {
			return;
		}
		if(sourceRect.width <= 0 || sourceRect.height <= 0) {
			return;
		}
		if(this.width <= 0 || this.height <= 0) {
			return;
		}
		if(sourceRect.x + sourceRect.width > sourceImage.width) {
			sourceRect.width = sourceImage.width - sourceRect.x;
		}
		if(sourceRect.y + sourceRect.height > sourceImage.height) {
			sourceRect.height = sourceImage.height - sourceRect.y;
		}
		if(sourceRect.x < 0) {
			sourceRect.width += sourceRect.x;
			sourceRect.x = 0;
		}
		if(sourceRect.y < 0) {
			sourceRect.height += sourceRect.y;
			sourceRect.y = 0;
		}
		if(destPoint.x + sourceRect.width > this.width) {
			sourceRect.width = this.width - destPoint.x;
		}
		if(destPoint.y + sourceRect.height > this.height) {
			sourceRect.height = this.height - destPoint.y;
		}
		if(destPoint.x < 0) {
			sourceRect.width += destPoint.x;
			sourceRect.x -= destPoint.x;
			destPoint.x = 0;
		}
		if(destPoint.y < 0) {
			sourceRect.height += destPoint.y;
			sourceRect.y -= destPoint.y;
			destPoint.y = 0;
		}
		if(sourceImage == this && destPoint.x < sourceRect.get_right() && destPoint.y < sourceRect.get_bottom()) {
			sourceImage = this.clone();
		}
		if(alphaImage == sourceImage && (alphaPoint == null || alphaPoint.x == 0 && alphaPoint.y == 0)) {
			alphaImage = null;
			alphaPoint = null;
		}
		switch(this.type._hx_index) {
		case 0:
			if(alphaImage != null) {
				lime__$internal_graphics_ImageCanvasUtil.convertToData(this);
				lime__$internal_graphics_ImageCanvasUtil.convertToData(sourceImage);
				if(alphaImage != null) {
					lime__$internal_graphics_ImageCanvasUtil.convertToData(alphaImage);
				}
				lime__$internal_graphics_ImageDataUtil.copyPixels(this,sourceImage,sourceRect,destPoint,alphaImage,alphaPoint,mergeAlpha);
			} else {
				lime__$internal_graphics_ImageCanvasUtil.convertToCanvas(this);
				lime__$internal_graphics_ImageCanvasUtil.convertToCanvas(sourceImage);
				lime__$internal_graphics_ImageCanvasUtil.copyPixels(this,sourceImage,sourceRect,destPoint,alphaImage,alphaPoint,mergeAlpha);
			}
			break;
		case 1:
			lime__$internal_graphics_ImageCanvasUtil.convertToData(this);
			lime__$internal_graphics_ImageCanvasUtil.convertToData(sourceImage);
			if(alphaImage != null) {
				lime__$internal_graphics_ImageCanvasUtil.convertToData(alphaImage);
			}
			lime__$internal_graphics_ImageDataUtil.copyPixels(this,sourceImage,sourceRect,destPoint,alphaImage,alphaPoint,mergeAlpha);
			break;
		case 2:
			sourceRect.offset(sourceImage.offsetX,sourceImage.offsetY);
			destPoint.offset(this.offsetX,this.offsetY);
			if(alphaImage != null && alphaPoint != null) {
				alphaPoint.offset(alphaImage.offsetX,alphaImage.offsetY);
			}
			this.buffer.__srcBitmapData.copyPixels(sourceImage.buffer.__srcBitmapData,sourceRect.__toFlashRectangle(),destPoint.__toFlashPoint(),alphaImage != null ? alphaImage.buffer.get_src() : null,alphaPoint != null ? alphaPoint.__toFlashPoint() : null,mergeAlpha);
			break;
		default:
		}
	}
	,encode: function(format,quality) {
		if(quality == null) {
			quality = 90;
		}
		if(format == null) {
			return lime__$internal_format_PNG.encode(this);
		} else {
			switch(format._hx_index) {
			case 0:
				return lime__$internal_format_BMP.encode(this);
			case 1:
				return lime__$internal_format_JPEG.encode(this,quality);
			case 2:
				return lime__$internal_format_PNG.encode(this);
			}
		}
	}
	,fillRect: function(rect,color,format) {
		rect = this.__clipRect(rect);
		if(this.buffer == null || rect == null) {
			return;
		}
		switch(this.type._hx_index) {
		case 0:
			lime__$internal_graphics_ImageCanvasUtil.fillRect(this,rect,color,format);
			break;
		case 1:
			lime__$internal_graphics_ImageCanvasUtil.convertToData(this);
			if(this.buffer.data.length == 0) {
				return;
			}
			lime__$internal_graphics_ImageDataUtil.fillRect(this,rect,color,format);
			break;
		case 2:
			rect.offset(this.offsetX,this.offsetY);
			var argb;
			if(format == null) {
				var rgba = color;
				var argb1 = 0;
				argb1 = (rgba & 255 & 255) << 24 | (rgba >>> 24 & 255 & 255) << 16 | (rgba >>> 16 & 255 & 255) << 8 | rgba >>> 8 & 255 & 255;
				argb = argb1;
			} else {
				switch(format) {
				case 1:
					argb = color;
					break;
				case 2:
					var bgra = color;
					var argb1 = 0;
					argb1 = (bgra & 255 & 255) << 24 | (bgra >>> 8 & 255 & 255) << 16 | (bgra >>> 16 & 255 & 255) << 8 | bgra >>> 24 & 255 & 255;
					argb = argb1;
					break;
				default:
					var rgba = color;
					var argb1 = 0;
					argb1 = (rgba & 255 & 255) << 24 | (rgba >>> 24 & 255 & 255) << 16 | (rgba >>> 16 & 255 & 255) << 8 | rgba >>> 8 & 255 & 255;
					argb = argb1;
				}
			}
			this.buffer.__srcBitmapData.fillRect(rect.__toFlashRectangle(),argb);
			break;
		default:
		}
	}
	,floodFill: function(x,y,color,format) {
		if(this.buffer == null) {
			return;
		}
		switch(this.type._hx_index) {
		case 0:
			lime__$internal_graphics_ImageCanvasUtil.floodFill(this,x,y,color,format);
			break;
		case 1:
			lime__$internal_graphics_ImageCanvasUtil.convertToData(this);
			lime__$internal_graphics_ImageDataUtil.floodFill(this,x,y,color,format);
			break;
		case 2:
			var argb;
			if(format == null) {
				var rgba = color;
				var argb1 = 0;
				argb1 = (rgba & 255 & 255) << 24 | (rgba >>> 24 & 255 & 255) << 16 | (rgba >>> 16 & 255 & 255) << 8 | rgba >>> 8 & 255 & 255;
				argb = argb1;
			} else {
				switch(format) {
				case 1:
					argb = color;
					break;
				case 2:
					var bgra = color;
					var argb1 = 0;
					argb1 = (bgra & 255 & 255) << 24 | (bgra >>> 8 & 255 & 255) << 16 | (bgra >>> 16 & 255 & 255) << 8 | bgra >>> 24 & 255 & 255;
					argb = argb1;
					break;
				default:
					var rgba = color;
					var argb1 = 0;
					argb1 = (rgba & 255 & 255) << 24 | (rgba >>> 24 & 255 & 255) << 16 | (rgba >>> 16 & 255 & 255) << 8 | rgba >>> 8 & 255 & 255;
					argb = argb1;
				}
			}
			this.buffer.__srcBitmapData.floodFill(x + this.offsetX,y + this.offsetY,argb);
			break;
		default:
		}
	}
	,getColorBoundsRect: function(mask,color,findColor,format) {
		if(findColor == null) {
			findColor = true;
		}
		if(this.buffer == null) {
			return null;
		}
		switch(this.type._hx_index) {
		case 0:
			lime__$internal_graphics_ImageCanvasUtil.convertToData(this);
			return lime__$internal_graphics_ImageDataUtil.getColorBoundsRect(this,mask,color,findColor,format);
		case 1:
			return lime__$internal_graphics_ImageDataUtil.getColorBoundsRect(this,mask,color,findColor,format);
		case 2:
			var rect = this.buffer.__srcBitmapData.getColorBoundsRect(mask,color,findColor);
			return new lime_math_Rectangle(rect.x,rect.y,rect.width,rect.height);
		default:
			return null;
		}
	}
	,getPixel: function(x,y,format) {
		if(this.buffer == null || x < 0 || y < 0 || x >= this.width || y >= this.height) {
			return 0;
		}
		switch(this.type._hx_index) {
		case 0:
			return lime__$internal_graphics_ImageCanvasUtil.getPixel(this,x,y,format);
		case 1:
			lime__$internal_graphics_ImageCanvasUtil.convertToData(this);
			return lime__$internal_graphics_ImageDataUtil.getPixel(this,x,y,format);
		case 2:
			var color = this.buffer.__srcBitmapData.getPixel(x + this.offsetX,y + this.offsetY);
			if(format == null) {
				var rgba = 0;
				rgba = (color >>> 16 & 255 & 255) << 24 | (color >>> 8 & 255 & 255) << 16 | (color & 255 & 255) << 8 | color >>> 24 & 255 & 255;
				var rgba1 = rgba;
				return rgba1;
			} else {
				switch(format) {
				case 1:
					return color;
				case 2:
					var bgra = 0;
					bgra = (color & 255 & 255) << 24 | (color >>> 8 & 255 & 255) << 16 | (color >>> 16 & 255 & 255) << 8 | color >>> 24 & 255 & 255;
					var bgra1 = bgra;
					return bgra1;
				default:
					var rgba = 0;
					rgba = (color >>> 16 & 255 & 255) << 24 | (color >>> 8 & 255 & 255) << 16 | (color & 255 & 255) << 8 | color >>> 24 & 255 & 255;
					var rgba1 = rgba;
					return rgba1;
				}
			}
			break;
		default:
			return 0;
		}
	}
	,getPixel32: function(x,y,format) {
		if(this.buffer == null || x < 0 || y < 0 || x >= this.width || y >= this.height) {
			return 0;
		}
		switch(this.type._hx_index) {
		case 0:
			return lime__$internal_graphics_ImageCanvasUtil.getPixel32(this,x,y,format);
		case 1:
			lime__$internal_graphics_ImageCanvasUtil.convertToData(this);
			return lime__$internal_graphics_ImageDataUtil.getPixel32(this,x,y,format);
		case 2:
			var color = this.buffer.__srcBitmapData.getPixel32(x + this.offsetX,y + this.offsetY);
			if(format == null) {
				var rgba = 0;
				rgba = (color >>> 16 & 255 & 255) << 24 | (color >>> 8 & 255 & 255) << 16 | (color & 255 & 255) << 8 | color >>> 24 & 255 & 255;
				var rgba1 = rgba;
				return rgba1;
			} else {
				switch(format) {
				case 1:
					return color;
				case 2:
					var bgra = 0;
					bgra = (color & 255 & 255) << 24 | (color >>> 8 & 255 & 255) << 16 | (color >>> 16 & 255 & 255) << 8 | color >>> 24 & 255 & 255;
					var bgra1 = bgra;
					return bgra1;
				default:
					var rgba = 0;
					rgba = (color >>> 16 & 255 & 255) << 24 | (color >>> 8 & 255 & 255) << 16 | (color & 255 & 255) << 8 | color >>> 24 & 255 & 255;
					var rgba1 = rgba;
					return rgba1;
				}
			}
			break;
		default:
			return 0;
		}
	}
	,getPixels: function(rect,format) {
		if(this.buffer == null) {
			return null;
		}
		switch(this.type._hx_index) {
		case 0:
			return lime__$internal_graphics_ImageCanvasUtil.getPixels(this,rect,format);
		case 1:
			lime__$internal_graphics_ImageCanvasUtil.convertToData(this);
			return lime__$internal_graphics_ImageDataUtil.getPixels(this,rect,format);
		case 2:
			return null;
		default:
			return null;
		}
	}
	,merge: function(sourceImage,sourceRect,destPoint,redMultiplier,greenMultiplier,blueMultiplier,alphaMultiplier) {
		if(this.buffer == null || sourceImage == null) {
			return;
		}
		switch(this.type._hx_index) {
		case 0:
			lime__$internal_graphics_ImageCanvasUtil.convertToCanvas(this);
			lime__$internal_graphics_ImageCanvasUtil.merge(this,sourceImage,sourceRect,destPoint,redMultiplier,greenMultiplier,blueMultiplier,alphaMultiplier);
			break;
		case 1:
			lime__$internal_graphics_ImageCanvasUtil.convertToData(this);
			lime__$internal_graphics_ImageCanvasUtil.convertToData(sourceImage);
			lime__$internal_graphics_ImageDataUtil.merge(this,sourceImage,sourceRect,destPoint,redMultiplier,greenMultiplier,blueMultiplier,alphaMultiplier);
			break;
		case 2:
			sourceRect.offset(this.offsetX,this.offsetY);
			this.buffer.__srcBitmapData.merge(sourceImage.buffer.__srcBitmapData,sourceRect.__toFlashRectangle(),destPoint.__toFlashPoint(),redMultiplier,greenMultiplier,blueMultiplier,alphaMultiplier);
			break;
		default:
			return;
		}
	}
	,resize: function(newWidth,newHeight) {
		switch(this.type._hx_index) {
		case 0:
			lime__$internal_graphics_ImageCanvasUtil.resize(this,newWidth,newHeight);
			break;
		case 1:
			lime__$internal_graphics_ImageDataUtil.resize(this,newWidth,newHeight);
			break;
		case 2:
			break;
		default:
		}
		this.buffer.width = newWidth;
		this.buffer.height = newHeight;
		this.offsetX = 0;
		this.offsetY = 0;
		this.width = newWidth;
		this.height = newHeight;
	}
	,scroll: function(x,y) {
		if(this.buffer == null) {
			return;
		}
		switch(this.type._hx_index) {
		case 0:
			lime__$internal_graphics_ImageCanvasUtil.scroll(this,x,y);
			break;
		case 1:
			this.copyPixels(this,this.get_rect(),new lime_math_Vector2(x,y));
			break;
		case 2:
			this.buffer.__srcBitmapData.scroll(x + this.offsetX,y + this.offsetX);
			break;
		default:
		}
	}
	,setPixel: function(x,y,color,format) {
		if(this.buffer == null || x < 0 || y < 0 || x >= this.width || y >= this.height) {
			return;
		}
		switch(this.type._hx_index) {
		case 0:
			lime__$internal_graphics_ImageCanvasUtil.setPixel(this,x,y,color,format);
			break;
		case 1:
			lime__$internal_graphics_ImageCanvasUtil.convertToData(this);
			lime__$internal_graphics_ImageDataUtil.setPixel(this,x,y,color,format);
			break;
		case 2:
			var argb;
			if(format == null) {
				var rgba = color;
				var argb1 = 0;
				argb1 = (rgba & 255 & 255) << 24 | (rgba >>> 24 & 255 & 255) << 16 | (rgba >>> 16 & 255 & 255) << 8 | rgba >>> 8 & 255 & 255;
				argb = argb1;
			} else {
				switch(format) {
				case 1:
					argb = color;
					break;
				case 2:
					var bgra = color;
					var argb1 = 0;
					argb1 = (bgra & 255 & 255) << 24 | (bgra >>> 8 & 255 & 255) << 16 | (bgra >>> 16 & 255 & 255) << 8 | bgra >>> 24 & 255 & 255;
					argb = argb1;
					break;
				default:
					var rgba = color;
					var argb1 = 0;
					argb1 = (rgba & 255 & 255) << 24 | (rgba >>> 24 & 255 & 255) << 16 | (rgba >>> 16 & 255 & 255) << 8 | rgba >>> 8 & 255 & 255;
					argb = argb1;
				}
			}
			this.buffer.__srcBitmapData.setPixel(x + this.offsetX,y + this.offsetX,argb);
			break;
		default:
		}
	}
	,setPixel32: function(x,y,color,format) {
		if(this.buffer == null || x < 0 || y < 0 || x >= this.width || y >= this.height) {
			return;
		}
		switch(this.type._hx_index) {
		case 0:
			lime__$internal_graphics_ImageCanvasUtil.setPixel32(this,x,y,color,format);
			break;
		case 1:
			lime__$internal_graphics_ImageCanvasUtil.convertToData(this);
			lime__$internal_graphics_ImageDataUtil.setPixel32(this,x,y,color,format);
			break;
		case 2:
			var argb;
			if(format == null) {
				var rgba = color;
				var argb1 = 0;
				argb1 = (rgba & 255 & 255) << 24 | (rgba >>> 24 & 255 & 255) << 16 | (rgba >>> 16 & 255 & 255) << 8 | rgba >>> 8 & 255 & 255;
				argb = argb1;
			} else {
				switch(format) {
				case 1:
					argb = color;
					break;
				case 2:
					var bgra = color;
					var argb1 = 0;
					argb1 = (bgra & 255 & 255) << 24 | (bgra >>> 8 & 255 & 255) << 16 | (bgra >>> 16 & 255 & 255) << 8 | bgra >>> 24 & 255 & 255;
					argb = argb1;
					break;
				default:
					var rgba = color;
					var argb1 = 0;
					argb1 = (rgba & 255 & 255) << 24 | (rgba >>> 24 & 255 & 255) << 16 | (rgba >>> 16 & 255 & 255) << 8 | rgba >>> 8 & 255 & 255;
					argb = argb1;
				}
			}
			this.buffer.__srcBitmapData.setPixel32(x + this.offsetX,y + this.offsetY,argb);
			break;
		default:
		}
	}
	,setPixels: function(rect,bytePointer,format,endian) {
		rect = this.__clipRect(rect);
		if(this.buffer == null || rect == null) {
			return;
		}
		if(endian == null) {
			endian = lime_system_Endian.BIG_ENDIAN;
		}
		switch(this.type._hx_index) {
		case 0:
			lime__$internal_graphics_ImageCanvasUtil.setPixels(this,rect,bytePointer,format,endian);
			break;
		case 1:
			lime__$internal_graphics_ImageCanvasUtil.convertToData(this);
			lime__$internal_graphics_ImageDataUtil.setPixels(this,rect,bytePointer,format,endian);
			break;
		case 2:
			break;
		default:
		}
	}
	,threshold: function(sourceImage,sourceRect,destPoint,operation,threshold,color,mask,copySource,format) {
		if(copySource == null) {
			copySource = false;
		}
		if(mask == null) {
			mask = -1;
		}
		if(color == null) {
			color = 0;
		}
		if(this.buffer == null || sourceImage == null || sourceRect == null) {
			return 0;
		}
		switch(this.type._hx_index) {
		case 0:case 1:
			lime__$internal_graphics_ImageCanvasUtil.convertToData(this);
			lime__$internal_graphics_ImageCanvasUtil.convertToData(sourceImage);
			return lime__$internal_graphics_ImageDataUtil.threshold(this,sourceImage,sourceRect,destPoint,operation,threshold,color,mask,copySource,format);
		case 2:
			var _color;
			if(format == null) {
				var rgba = color;
				var argb = 0;
				argb = (rgba & 255 & 255) << 24 | (rgba >>> 24 & 255 & 255) << 16 | (rgba >>> 16 & 255 & 255) << 8 | rgba >>> 8 & 255 & 255;
				_color = argb;
			} else {
				switch(format) {
				case 1:
					_color = color;
					break;
				case 2:
					var bgra = color;
					var argb = 0;
					argb = (bgra & 255 & 255) << 24 | (bgra >>> 8 & 255 & 255) << 16 | (bgra >>> 16 & 255 & 255) << 8 | bgra >>> 24 & 255 & 255;
					_color = argb;
					break;
				default:
					var rgba = color;
					var argb = 0;
					argb = (rgba & 255 & 255) << 24 | (rgba >>> 24 & 255 & 255) << 16 | (rgba >>> 16 & 255 & 255) << 8 | rgba >>> 8 & 255 & 255;
					_color = argb;
				}
			}
			var _mask;
			if(format == null) {
				var rgba = mask;
				var argb = 0;
				argb = (rgba & 255 & 255) << 24 | (rgba >>> 24 & 255 & 255) << 16 | (rgba >>> 16 & 255 & 255) << 8 | rgba >>> 8 & 255 & 255;
				_mask = argb;
			} else {
				switch(format) {
				case 1:
					_mask = mask;
					break;
				case 2:
					var bgra = mask;
					var argb = 0;
					argb = (bgra & 255 & 255) << 24 | (bgra >>> 8 & 255 & 255) << 16 | (bgra >>> 16 & 255 & 255) << 8 | bgra >>> 24 & 255 & 255;
					_mask = argb;
					break;
				default:
					var rgba = mask;
					var argb = 0;
					argb = (rgba & 255 & 255) << 24 | (rgba >>> 24 & 255 & 255) << 16 | (rgba >>> 16 & 255 & 255) << 8 | rgba >>> 8 & 255 & 255;
					_mask = argb;
				}
			}
			sourceRect.offset(sourceImage.offsetX,sourceImage.offsetY);
			destPoint.offset(this.offsetX,this.offsetY);
			return this.buffer.__srcBitmapData.threshold(sourceImage.buffer.get_src(),sourceRect.__toFlashRectangle(),destPoint.__toFlashPoint(),operation,threshold,_color,_mask,copySource);
		default:
		}
		return 0;
	}
	,__clipRect: function(r) {
		if(r == null) {
			return null;
		}
		if(r.x < 0) {
			r.width -= -r.x;
			r.x = 0;
			if(r.x + r.width <= 0) {
				return null;
			}
		}
		if(r.y < 0) {
			r.height -= -r.y;
			r.y = 0;
			if(r.y + r.height <= 0) {
				return null;
			}
		}
		if(r.x + r.width >= this.width) {
			r.width -= r.x + r.width - this.width;
			if(r.width <= 0) {
				return null;
			}
		}
		if(r.y + r.height >= this.height) {
			r.height -= r.y + r.height - this.height;
			if(r.height <= 0) {
				return null;
			}
		}
		return r;
	}
	,__fromBase64: function(base64,type,onload) {
		var _gthis = this;
		var image = new window.Image ();
		var image_onLoaded = function(event) {
			_gthis.buffer = new lime_graphics_ImageBuffer(null,image.width,image.height);
			_gthis.buffer.__srcImage = image;
			_gthis.offsetX = 0;
			_gthis.offsetY = 0;
			_gthis.width = _gthis.buffer.width;
			_gthis.height = _gthis.buffer.height;
			if(onload != null) {
				onload(_gthis);
			}
		};
		image.addEventListener("load",image_onLoaded,false);
		image.src = "data:" + type + ";base64," + base64;
	}
	,__fromBytes: function(bytes,onload) {
		var type = "";
		if(lime_graphics_Image.__isPNG(bytes)) {
			type = "image/png";
		} else if(lime_graphics_Image.__isJPG(bytes)) {
			type = "image/jpeg";
		} else if(lime_graphics_Image.__isGIF(bytes)) {
			type = "image/gif";
		} else {
			return false;
		}
		this.__fromBase64(lime__$internal_format_Base64.encode(bytes),type,onload);
		return true;
	}
	,__fromFile: function(path,onload,onerror) {
		var _gthis = this;
		var image = new window.Image ();
		if(!lime__$internal_backend_html5_HTML5HTTPRequest.__isSameOrigin(path)) {
			image.crossOrigin = "Anonymous";
		}
		image.onload = function(_) {
			_gthis.buffer = new lime_graphics_ImageBuffer(null,image.width,image.height);
			_gthis.buffer.__srcImage = image;
			_gthis.width = image.width;
			_gthis.height = image.height;
			if(onload != null) {
				onload(_gthis);
			}
		};
		image.onerror = function(_) {
			if(onerror != null) {
				onerror();
			}
		};
		image.src = path;
		var image1 = image.complete;
		return true;
	}
	,__fromImageBuffer: function(buffer) {
		this.buffer = buffer;
		if(buffer != null) {
			if(this.width == -1) {
				this.width = buffer.width;
			}
			if(this.height == -1) {
				this.height = buffer.height;
			}
		}
	}
	,get_data: function() {
		if(this.buffer.data == null && this.buffer.width > 0 && this.buffer.height > 0) {
			lime__$internal_graphics_ImageCanvasUtil.convertToData(this);
		}
		return this.buffer.data;
	}
	,set_data: function(value) {
		return this.buffer.data = value;
	}
	,get_format: function() {
		return this.buffer.format;
	}
	,set_format: function(value) {
		if(this.buffer.format != value) {
			if(this.type._hx_index == 1) {
				lime__$internal_graphics_ImageDataUtil.setFormat(this,value);
			}
		}
		return this.buffer.format = value;
	}
	,get_powerOfTwo: function() {
		if(this.buffer.width != 0 && (this.buffer.width & ~this.buffer.width + 1) == this.buffer.width) {
			if(this.buffer.height != 0) {
				return (this.buffer.height & ~this.buffer.height + 1) == this.buffer.height;
			} else {
				return false;
			}
		} else {
			return false;
		}
	}
	,set_powerOfTwo: function(value) {
		if(value != this.get_powerOfTwo()) {
			var newWidth = 1;
			var newHeight = 1;
			while(newWidth < this.buffer.width) newWidth <<= 1;
			while(newHeight < this.buffer.height) newHeight <<= 1;
			if(newWidth == this.buffer.width && newHeight == this.buffer.height) {
				return value;
			}
			switch(this.type._hx_index) {
			case 0:
				lime__$internal_graphics_ImageCanvasUtil.convertToData(this);
				lime__$internal_graphics_ImageDataUtil.resizeBuffer(this,newWidth,newHeight);
				break;
			case 1:
				lime__$internal_graphics_ImageDataUtil.resizeBuffer(this,newWidth,newHeight);
				break;
			case 2:
				break;
			default:
			}
		}
		return value;
	}
	,get_premultiplied: function() {
		return this.buffer.premultiplied;
	}
	,set_premultiplied: function(value) {
		if(value && !this.buffer.premultiplied) {
			switch(this.type._hx_index) {
			case 0:case 1:
				lime__$internal_graphics_ImageCanvasUtil.convertToData(this);
				lime__$internal_graphics_ImageDataUtil.multiplyAlpha(this);
				break;
			default:
			}
		} else if(!value && this.buffer.premultiplied) {
			if(this.type._hx_index == 1) {
				lime__$internal_graphics_ImageCanvasUtil.convertToData(this);
				lime__$internal_graphics_ImageDataUtil.unmultiplyAlpha(this);
			}
		}
		return value;
	}
	,get_rect: function() {
		return new lime_math_Rectangle(0,0,this.width,this.height);
	}
	,get_src: function() {
		if(this.buffer.__srcCanvas == null && (this.buffer.data != null || this.type == lime_graphics_ImageType.DATA)) {
			lime__$internal_graphics_ImageCanvasUtil.convertToCanvas(this);
		}
		return this.buffer.get_src();
	}
	,set_src: function(value) {
		return this.buffer.set_src(value);
	}
	,get_transparent: function() {
		if(this.buffer == null) {
			return false;
		}
		return this.buffer.transparent;
	}
	,set_transparent: function(value) {
		if(this.buffer == null) {
			return false;
		}
		return this.buffer.transparent = value;
	}
	,__class__: lime_graphics_Image
	,__properties__: {set_transparent:"set_transparent",get_transparent:"get_transparent",set_src:"set_src",get_src:"get_src",get_rect:"get_rect",set_premultiplied:"set_premultiplied",get_premultiplied:"get_premultiplied",set_powerOfTwo:"set_powerOfTwo",get_powerOfTwo:"get_powerOfTwo",set_format:"set_format",get_format:"get_format",set_data:"set_data",get_data:"get_data"}
};
var lime_graphics_ImageBuffer = function(data,width,height,bitsPerPixel,format) {
	if(bitsPerPixel == null) {
		bitsPerPixel = 32;
	}
	if(height == null) {
		height = 0;
	}
	if(width == null) {
		width = 0;
	}
	this.data = data;
	this.width = width;
	this.height = height;
	this.bitsPerPixel = bitsPerPixel;
	this.format = format == null ? 0 : format;
	this.premultiplied = false;
	this.transparent = true;
};
$hxClasses["lime.graphics.ImageBuffer"] = lime_graphics_ImageBuffer;
lime_graphics_ImageBuffer.__name__ = "lime.graphics.ImageBuffer";
lime_graphics_ImageBuffer.prototype = {
	bitsPerPixel: null
	,data: null
	,format: null
	,height: null
	,premultiplied: null
	,transparent: null
	,width: null
	,__srcBitmapData: null
	,__srcCanvas: null
	,__srcContext: null
	,__srcCustom: null
	,__srcImage: null
	,__srcImageData: null
	,clone: function() {
		var buffer = new lime_graphics_ImageBuffer(this.data,this.width,this.height,this.bitsPerPixel);
		if(this.data != null) {
			var elements = this.data.byteLength;
			var array = null;
			var vector = null;
			var view = null;
			var buffer1 = null;
			var len = null;
			var this1;
			if(elements != null) {
				this1 = new Uint8Array(elements);
			} else if(array != null) {
				this1 = new Uint8Array(array);
			} else if(vector != null) {
				this1 = new Uint8Array(vector.__array);
			} else if(view != null) {
				this1 = new Uint8Array(view);
			} else if(buffer1 != null) {
				if(len == null) {
					this1 = new Uint8Array(buffer1,0);
				} else {
					this1 = new Uint8Array(buffer1,0,len);
				}
			} else {
				this1 = null;
			}
			buffer.data = this1;
			var elements = null;
			var array = null;
			var vector = null;
			var view = this.data;
			var buffer1 = null;
			var len = null;
			var this1;
			if(elements != null) {
				this1 = new Uint8Array(elements);
			} else if(array != null) {
				this1 = new Uint8Array(array);
			} else if(vector != null) {
				this1 = new Uint8Array(vector.__array);
			} else if(view != null) {
				this1 = new Uint8Array(view);
			} else if(buffer1 != null) {
				if(len == null) {
					this1 = new Uint8Array(buffer1,0);
				} else {
					this1 = new Uint8Array(buffer1,0,len);
				}
			} else {
				this1 = null;
			}
			var copy = this1;
			buffer.data.set(copy);
		} else if(this.__srcImageData != null) {
			buffer.__srcCanvas = window.document.createElement("canvas");
			buffer.__srcContext = buffer.__srcCanvas.getContext("2d");
			buffer.__srcCanvas.width = this.__srcImageData.width;
			buffer.__srcCanvas.height = this.__srcImageData.height;
			buffer.__srcImageData = buffer.__srcContext.createImageData(this.__srcImageData.width,this.__srcImageData.height);
			var copy = new Uint8ClampedArray(this.__srcImageData.data);
			buffer.__srcImageData.data.set(copy);
		} else if(this.__srcCanvas != null) {
			buffer.__srcCanvas = window.document.createElement("canvas");
			buffer.__srcContext = buffer.__srcCanvas.getContext("2d");
			buffer.__srcCanvas.width = this.__srcCanvas.width;
			buffer.__srcCanvas.height = this.__srcCanvas.height;
			buffer.__srcContext.drawImage(this.__srcCanvas,0,0);
		} else {
			buffer.__srcImage = this.__srcImage;
		}
		buffer.bitsPerPixel = this.bitsPerPixel;
		buffer.format = this.format;
		buffer.premultiplied = this.premultiplied;
		buffer.transparent = this.transparent;
		return buffer;
	}
	,get_src: function() {
		if(this.__srcImage != null) {
			return this.__srcImage;
		}
		return this.__srcCanvas;
	}
	,set_src: function(value) {
		if(((value) instanceof Image)) {
			this.__srcImage = value;
		} else if(((value) instanceof HTMLCanvasElement)) {
			this.__srcCanvas = value;
			this.__srcContext = this.__srcCanvas.getContext("2d");
		}
		return value;
	}
	,get_stride: function() {
		return this.width * (this.bitsPerPixel / 8 | 0);
	}
	,__class__: lime_graphics_ImageBuffer
	,__properties__: {get_stride:"get_stride",set_src:"set_src",get_src:"get_src"}
};
var lime_graphics_ImageChannel = $hxEnums["lime.graphics.ImageChannel"] = { __ename__:"lime.graphics.ImageChannel",__constructs__:null
	,RED: {_hx_name:"RED",_hx_index:0,__enum__:"lime.graphics.ImageChannel",toString:$estr}
	,GREEN: {_hx_name:"GREEN",_hx_index:1,__enum__:"lime.graphics.ImageChannel",toString:$estr}
	,BLUE: {_hx_name:"BLUE",_hx_index:2,__enum__:"lime.graphics.ImageChannel",toString:$estr}
	,ALPHA: {_hx_name:"ALPHA",_hx_index:3,__enum__:"lime.graphics.ImageChannel",toString:$estr}
};
lime_graphics_ImageChannel.__constructs__ = [lime_graphics_ImageChannel.RED,lime_graphics_ImageChannel.GREEN,lime_graphics_ImageChannel.BLUE,lime_graphics_ImageChannel.ALPHA];
var lime_graphics_ImageFileFormat = $hxEnums["lime.graphics.ImageFileFormat"] = { __ename__:"lime.graphics.ImageFileFormat",__constructs__:null
	,BMP: {_hx_name:"BMP",_hx_index:0,__enum__:"lime.graphics.ImageFileFormat",toString:$estr}
	,JPEG: {_hx_name:"JPEG",_hx_index:1,__enum__:"lime.graphics.ImageFileFormat",toString:$estr}
	,PNG: {_hx_name:"PNG",_hx_index:2,__enum__:"lime.graphics.ImageFileFormat",toString:$estr}
};
lime_graphics_ImageFileFormat.__constructs__ = [lime_graphics_ImageFileFormat.BMP,lime_graphics_ImageFileFormat.JPEG,lime_graphics_ImageFileFormat.PNG];
var lime_graphics_ImageType = $hxEnums["lime.graphics.ImageType"] = { __ename__:"lime.graphics.ImageType",__constructs__:null
	,CANVAS: {_hx_name:"CANVAS",_hx_index:0,__enum__:"lime.graphics.ImageType",toString:$estr}
	,DATA: {_hx_name:"DATA",_hx_index:1,__enum__:"lime.graphics.ImageType",toString:$estr}
	,FLASH: {_hx_name:"FLASH",_hx_index:2,__enum__:"lime.graphics.ImageType",toString:$estr}
	,CUSTOM: {_hx_name:"CUSTOM",_hx_index:3,__enum__:"lime.graphics.ImageType",toString:$estr}
};
lime_graphics_ImageType.__constructs__ = [lime_graphics_ImageType.CANVAS,lime_graphics_ImageType.DATA,lime_graphics_ImageType.FLASH,lime_graphics_ImageType.CUSTOM];
var lime_graphics_OpenGLES2RenderContext = {};
lime_graphics_OpenGLES2RenderContext.fromGL = function(gl) {
	return null;
};
lime_graphics_OpenGLES2RenderContext.fromOpenGLES3RenderContext = function(gl) {
	return null;
};
lime_graphics_OpenGLES2RenderContext.fromRenderContext = function(context) {
	return null;
};
lime_graphics_OpenGLES2RenderContext.fromWebGLRenderContext = function(gl) {
	return null;
};
var lime_graphics_OpenGLES3RenderContext = {};
lime_graphics_OpenGLES3RenderContext.fromRenderContext = function(context) {
	return null;
};
lime_graphics_OpenGLES3RenderContext.fromGL = function(gl) {
	return null;
};
lime_graphics_OpenGLES3RenderContext.fromOpenGLES2RenderContext = function(context) {
	return null;
};
lime_graphics_OpenGLES3RenderContext.fromWebGLRenderContext = function(context) {
	return null;
};
lime_graphics_OpenGLES3RenderContext.fromWebGL2RenderContext = function(context) {
	return null;
};
var lime_graphics_OpenGLRenderContext = {};
lime_graphics_OpenGLRenderContext.fromRenderContext = function(context) {
	return null;
};
var lime_graphics_RenderContext = function() {
};
$hxClasses["lime.graphics.RenderContext"] = lime_graphics_RenderContext;
lime_graphics_RenderContext.__name__ = "lime.graphics.RenderContext";
lime_graphics_RenderContext.prototype = {
	attributes: null
	,cairo: null
	,canvas2D: null
	,dom: null
	,flash: null
	,gl: null
	,gles2: null
	,gles3: null
	,type: null
	,version: null
	,webgl: null
	,webgl2: null
	,window: null
	,__class__: lime_graphics_RenderContext
};
var lime_graphics_WebGL2RenderContext = {};
lime_graphics_WebGL2RenderContext.bufferData = function(this1,target,srcData,usage,srcOffset,length) {
	if(srcOffset != null) {
		this1.bufferData(target,srcData,usage,srcOffset,length);
	} else {
		this1.bufferData(target,srcData,usage);
	}
};
lime_graphics_WebGL2RenderContext.bufferSubData = function(this1,target,dstByteOffset,srcData,srcOffset,length) {
	if(srcOffset != null) {
		this1.bufferSubData(target,dstByteOffset,srcData,srcOffset,length);
	} else {
		this1.bufferSubData(target,dstByteOffset,srcData);
	}
};
lime_graphics_WebGL2RenderContext.compressedTexImage2D = function(this1,target,level,internalformat,width,height,border,srcData,srcOffset,srcLengthOverride) {
	if(srcOffset != null) {
		this1.compressedTexImage2D(target,level,internalformat,width,height,border,srcData,srcOffset,srcLengthOverride);
	} else {
		this1.compressedTexImage2D(target,level,internalformat,width,height,border,srcData);
	}
};
lime_graphics_WebGL2RenderContext.compressedTexSubImage2D = function(this1,target,level,xoffset,yoffset,width,height,format,srcData,srcOffset,srcLengthOverride) {
	if(srcOffset != null) {
		this1.compressedTexSubImage2D(target,level,xoffset,yoffset,width,height,format,srcData,srcOffset,srcLengthOverride);
	} else {
		this1.compressedTexSubImage2D(target,level,xoffset,yoffset,width,height,format,srcData);
	}
};
lime_graphics_WebGL2RenderContext.getBufferSubData = function(this1,target,srcByteOffset,dstData,srcOffset,length) {
	if(srcOffset != null) {
		this1.getBufferSubData(target,srcByteOffset,dstData,srcOffset,length);
	} else {
		this1.getBufferSubData(target,srcByteOffset,dstData);
	}
};
lime_graphics_WebGL2RenderContext.readPixels = function(this1,x,y,width,height,format,type,pixels,dstOffset) {
	if(dstOffset != null) {
		this1.readPixels(x,y,width,height,format,type,pixels,dstOffset);
	} else {
		this1.readPixels(x,y,width,height,format,type,pixels);
	}
};
lime_graphics_WebGL2RenderContext.texImage2D = function(this1,target,level,internalformat,width,height,border,format,type,srcData,srcOffset) {
	if(srcOffset != null) {
		this1.texImage2D(target,level,internalformat,width,height,border,format,type,srcData,srcOffset);
	} else if(format != null) {
		this1.texImage2D(target,level,internalformat,width,height,border,format,type,srcData);
	} else {
		this1.texImage2D(target,level,internalformat,width,height,border);
	}
};
lime_graphics_WebGL2RenderContext.texSubImage2D = function(this1,target,level,xoffset,yoffset,width,height,format,type,srcData,srcOffset) {
	if(srcOffset != null) {
		this1.texSubImage2D(target,level,xoffset,yoffset,width,height,format,type,srcData,srcOffset);
	} else if(type != null) {
		this1.texSubImage2D(target,level,xoffset,yoffset,width,height,format,type,srcData);
	} else {
		this1.texSubImage2D(target,level,xoffset,yoffset,width,height,format);
	}
};
lime_graphics_WebGL2RenderContext.uniform1fv = function(this1,location,data,srcOffset,srcLength) {
	if(srcOffset != null) {
		this1.uniform1fv(location,data,srcOffset,srcLength);
	} else {
		this1.uniform1fv(location,data);
	}
};
lime_graphics_WebGL2RenderContext.uniform1iv = function(this1,location,data,srcOffset,srcLength) {
	if(srcOffset != null) {
		this1.uniform1iv(location,data,srcOffset,srcLength);
	} else {
		this1.uniform1iv(location,data);
	}
};
lime_graphics_WebGL2RenderContext.uniform2fv = function(this1,location,data,srcOffset,srcLength) {
	if(srcOffset != null) {
		this1.uniform2fv(location,data,srcOffset,srcLength);
	} else {
		this1.uniform2fv(location,data);
	}
};
lime_graphics_WebGL2RenderContext.uniform2iv = function(this1,location,data,srcOffset,srcLength) {
	if(srcOffset != null) {
		this1.uniform2iv(location,data,srcOffset,srcLength);
	} else {
		this1.uniform2iv(location,data);
	}
};
lime_graphics_WebGL2RenderContext.uniform3fv = function(this1,location,data,srcOffset,srcLength) {
	if(srcOffset != null) {
		this1.uniform3fv(location,data,srcOffset,srcLength);
	} else {
		this1.uniform3fv(location,data);
	}
};
lime_graphics_WebGL2RenderContext.uniform3iv = function(this1,location,data,srcOffset,srcLength) {
	if(srcOffset != null) {
		this1.uniform3iv(location,data,srcOffset,srcLength);
	} else {
		this1.uniform3iv(location,data);
	}
};
lime_graphics_WebGL2RenderContext.uniform4fv = function(this1,location,data,srcOffset,srcLength) {
	if(srcOffset != null) {
		this1.uniform4fv(location,data,srcOffset,srcLength);
	} else {
		this1.uniform4fv(location,data);
	}
};
lime_graphics_WebGL2RenderContext.uniform4iv = function(this1,location,data,srcOffset,srcLength) {
	if(srcOffset != null) {
		this1.uniform4iv(location,data,srcOffset,srcLength);
	} else {
		this1.uniform4iv(location,data);
	}
};
lime_graphics_WebGL2RenderContext.uniformMatrix2fv = function(this1,location,transpose,data,srcOffset,srcLength) {
	if(srcOffset != null) {
		this1.uniformMatrix2fv(location,transpose,data,srcOffset,srcLength);
	} else {
		this1.uniformMatrix2fv(location,transpose,data);
	}
};
lime_graphics_WebGL2RenderContext.uniformMatrix3fv = function(this1,location,transpose,data,srcOffset,srcLength) {
	if(srcOffset != null) {
		this1.uniformMatrix3fv(location,transpose,data,srcOffset,srcLength);
	} else {
		this1.uniformMatrix3fv(location,transpose,data);
	}
};
lime_graphics_WebGL2RenderContext.uniformMatrix4fv = function(this1,location,transpose,data,srcOffset,srcLength) {
	if(srcOffset != null) {
		this1.uniformMatrix4fv(location,transpose,data,srcOffset,srcLength);
	} else {
		this1.uniformMatrix4fv(location,transpose,data);
	}
};
lime_graphics_WebGL2RenderContext.fromGL = function(gl) {
	return null;
};
lime_graphics_WebGL2RenderContext.fromRenderContext = function(context) {
	return context.webgl2;
};
lime_graphics_WebGL2RenderContext.toWebGLRenderContext = function(gl) {
	return gl;
};
var lime_graphics_WebGLRenderContext = {};
lime_graphics_WebGLRenderContext.bufferData = function(this1,target,srcData,usage) {
	var srcOffset = null;
	if(srcOffset != null) {
		this1.bufferData(target,srcData,usage,srcOffset,null);
	} else {
		this1.bufferData(target,srcData,usage);
	}
};
lime_graphics_WebGLRenderContext.bufferSubData = function(this1,target,offset,srcData) {
	var srcOffset = null;
	if(srcOffset != null) {
		this1.bufferSubData(target,offset,srcData,srcOffset,null);
	} else {
		this1.bufferSubData(target,offset,srcData);
	}
};
lime_graphics_WebGLRenderContext.compressedTexImage2D = function(this1,target,level,internalformat,width,height,border,srcData) {
	var srcOffset = null;
	if(srcOffset != null) {
		this1.compressedTexImage2D(target,level,internalformat,width,height,border,srcData,srcOffset,null);
	} else {
		this1.compressedTexImage2D(target,level,internalformat,width,height,border,srcData);
	}
};
lime_graphics_WebGLRenderContext.compressedTexSubImage2D = function(this1,target,level,xoffset,yoffset,width,height,format,srcData) {
	var srcOffset = null;
	if(srcOffset != null) {
		this1.compressedTexSubImage2D(target,level,xoffset,yoffset,width,height,format,srcData,srcOffset,null);
	} else {
		this1.compressedTexSubImage2D(target,level,xoffset,yoffset,width,height,format,srcData);
	}
};
lime_graphics_WebGLRenderContext.readPixels = function(this1,x,y,width,height,format,type,pixels) {
	var dstOffset = null;
	if(dstOffset != null) {
		this1.readPixels(x,y,width,height,format,type,pixels,dstOffset);
	} else {
		this1.readPixels(x,y,width,height,format,type,pixels);
	}
};
lime_graphics_WebGLRenderContext.texImage2D = function(this1,target,level,internalformat,width,height,border,format,type,srcData) {
	var srcOffset = null;
	if(srcOffset != null) {
		this1.texImage2D(target,level,internalformat,width,height,border,format,type,srcData,srcOffset);
	} else if(format != null) {
		this1.texImage2D(target,level,internalformat,width,height,border,format,type,srcData);
	} else {
		this1.texImage2D(target,level,internalformat,width,height,border);
	}
};
lime_graphics_WebGLRenderContext.texSubImage2D = function(this1,target,level,xoffset,yoffset,width,height,format,type,srcData) {
	var srcOffset = null;
	if(srcOffset != null) {
		this1.texSubImage2D(target,level,xoffset,yoffset,width,height,format,type,srcData,srcOffset);
	} else if(type != null) {
		this1.texSubImage2D(target,level,xoffset,yoffset,width,height,format,type,srcData);
	} else {
		this1.texSubImage2D(target,level,xoffset,yoffset,width,height,format);
	}
};
lime_graphics_WebGLRenderContext.uniformMatrix2fv = function(this1,location,transpose,v) {
	var data = v;
	var srcOffset = null;
	if(srcOffset != null) {
		this1.uniformMatrix2fv(location,transpose,data,srcOffset,null);
	} else {
		this1.uniformMatrix2fv(location,transpose,data);
	}
};
lime_graphics_WebGLRenderContext.uniformMatrix3fv = function(this1,location,transpose,v) {
	var data = v;
	var srcOffset = null;
	if(srcOffset != null) {
		this1.uniformMatrix3fv(location,transpose,data,srcOffset,null);
	} else {
		this1.uniformMatrix3fv(location,transpose,data);
	}
};
lime_graphics_WebGLRenderContext.uniformMatrix4fv = function(this1,location,transpose,v) {
	var data = v;
	var srcOffset = null;
	if(srcOffset != null) {
		this1.uniformMatrix4fv(location,transpose,data,srcOffset,null);
	} else {
		this1.uniformMatrix4fv(location,transpose,data);
	}
};
lime_graphics_WebGLRenderContext.fromWebGL2RenderContext = function(gl) {
	return gl;
};
lime_graphics_WebGLRenderContext.fromRenderContext = function(context) {
	return context.webgl;
};
lime_graphics_WebGLRenderContext.fromGL = function(gl) {
	return lime_graphics_opengl_GL.context;
};
var lime_graphics_cairo_Cairo = function(surface) {
	var tmp = surface != null;
};
$hxClasses["lime.graphics.cairo.Cairo"] = lime_graphics_cairo_Cairo;
lime_graphics_cairo_Cairo.__name__ = "lime.graphics.cairo.Cairo";
lime_graphics_cairo_Cairo.__properties__ = {get_versionString:"get_versionString",get_version:"get_version"};
lime_graphics_cairo_Cairo.get_version = function() {
	return 0;
};
lime_graphics_cairo_Cairo.get_versionString = function() {
	return "";
};
lime_graphics_cairo_Cairo.prototype = {
	target: null
	,userData: null
	,handle: null
	,arc: function(xc,yc,radius,angle1,angle2) {
	}
	,arcNegative: function(xc,yc,radius,angle1,angle2) {
	}
	,clip: function() {
	}
	,clipExtents: function(x1,y1,x2,y2) {
	}
	,clipPreserve: function() {
	}
	,closePath: function() {
	}
	,copyPage: function() {
	}
	,curveTo: function(x1,y1,x2,y2,x3,y3) {
	}
	,fill: function() {
	}
	,fillExtents: function(x1,y1,x2,y2) {
	}
	,fillPreserve: function() {
	}
	,getOperator: function() {
		return 0;
	}
	,identityMatrix: function() {
	}
	,inClip: function(x,y) {
		return false;
	}
	,inFill: function(x,y) {
		return false;
	}
	,inStroke: function(x,y) {
		return false;
	}
	,lineTo: function(x,y) {
	}
	,mask: function(pattern) {
	}
	,maskSurface: function(surface,x,y) {
	}
	,moveTo: function(x,y) {
	}
	,newPath: function() {
	}
	,paint: function() {
	}
	,paintWithAlpha: function(alpha) {
	}
	,popGroup: function() {
		return null;
	}
	,popGroupToSource: function() {
	}
	,pushGroup: function() {
	}
	,pushGroupWithContent: function(content) {
	}
	,recreate: function(surface) {
	}
	,rectangle: function(x,y,width,height) {
	}
	,relCurveTo: function(dx1,dy1,dx2,dy2,dx3,dy3) {
	}
	,relLineTo: function(dx,dy) {
	}
	,relMoveTo: function(dx,dy) {
	}
	,resetClip: function() {
	}
	,restore: function() {
	}
	,rotate: function(amount) {
	}
	,save: function() {
	}
	,scale: function(x,y) {
	}
	,setFontSize: function(size) {
	}
	,setOperator: function(value) {
		return value;
	}
	,setSourceRGB: function(r,g,b) {
	}
	,setSourceRGBA: function(r,g,b,a) {
	}
	,setSourceSurface: function(surface,x,y) {
	}
	,showGlyphs: function(glyphs) {
	}
	,showPage: function() {
	}
	,showText: function(utf8) {
	}
	,status: function() {
		return 0;
	}
	,stroke: function() {
	}
	,strokeExtents: function(x1,y1,x2,y2) {
	}
	,strokePreserve: function() {
	}
	,textPath: function(utf8) {
	}
	,transform: function(matrix) {
	}
	,translate: function(x,y) {
	}
	,get_antialias: function() {
		return 0;
	}
	,set_antialias: function(value) {
		return value;
	}
	,get_currentPoint: function() {
		return null;
	}
	,get_dash: function() {
		return [];
	}
	,set_dash: function(value) {
		return value;
	}
	,get_dashCount: function() {
		return 0;
	}
	,get_fillRule: function() {
		return 0;
	}
	,set_fillRule: function(value) {
		return value;
	}
	,get_fontFace: function() {
		return 0;
	}
	,set_fontFace: function(value) {
		return value;
	}
	,get_fontOptions: function() {
		return null;
	}
	,set_fontOptions: function(value) {
		return value;
	}
	,get_groupTarget: function() {
		return 0;
	}
	,get_hasCurrentPoint: function() {
		return false;
	}
	,get_lineCap: function() {
		return 0;
	}
	,set_lineCap: function(value) {
		return value;
	}
	,get_lineJoin: function() {
		return 0;
	}
	,set_lineJoin: function(value) {
		return value;
	}
	,get_lineWidth: function() {
		return 0;
	}
	,set_lineWidth: function(value) {
		return value;
	}
	,get_matrix: function() {
		return null;
	}
	,set_matrix: function(value) {
		return value;
	}
	,get_miterLimit: function() {
		return 0;
	}
	,set_miterLimit: function(value) {
		return value;
	}
	,get_source: function() {
		return 0;
	}
	,set_source: function(value) {
		return value;
	}
	,get_target: function() {
		return 0;
	}
	,get_tolerance: function() {
		return 0;
	}
	,set_tolerance: function(value) {
		return value;
	}
	,__class__: lime_graphics_cairo_Cairo
	,__properties__: {set_tolerance:"set_tolerance",get_tolerance:"get_tolerance",get_target:"get_target",set_source:"set_source",get_source:"get_source",set_miterLimit:"set_miterLimit",get_miterLimit:"get_miterLimit",set_matrix:"set_matrix",get_matrix:"get_matrix",set_lineWidth:"set_lineWidth",get_lineWidth:"get_lineWidth",set_lineJoin:"set_lineJoin",get_lineJoin:"get_lineJoin",set_lineCap:"set_lineCap",get_lineCap:"get_lineCap",get_hasCurrentPoint:"get_hasCurrentPoint",get_groupTarget:"get_groupTarget",set_fontOptions:"set_fontOptions",get_fontOptions:"get_fontOptions",set_fontFace:"set_fontFace",get_fontFace:"get_fontFace",set_fillRule:"set_fillRule",get_fillRule:"get_fillRule",get_dashCount:"get_dashCount",set_dash:"set_dash",get_dash:"get_dash",get_currentPoint:"get_currentPoint",set_antialias:"set_antialias",get_antialias:"get_antialias"}
};
var lime_graphics_cairo_CairoFTFontFace = {};
lime_graphics_cairo_CairoFTFontFace._new = function() {
	return 0;
};
lime_graphics_cairo_CairoFTFontFace.create = function(face,loadFlags) {
	return 0;
};
var lime_graphics_cairo_CairoFontFace = {};
lime_graphics_cairo_CairoFontFace._new = function() {
	return null;
};
lime_graphics_cairo_CairoFontFace.status = function(this1) {
	return 0;
};
var lime_graphics_cairo_CairoFontOptions = {};
lime_graphics_cairo_CairoFontOptions.__properties__ = {set_subpixelOrder:"set_subpixelOrder",get_subpixelOrder:"get_subpixelOrder",set_hintStyle:"set_hintStyle",get_hintStyle:"get_hintStyle",set_hintMetrics:"set_hintMetrics",get_hintMetrics:"get_hintMetrics",set_antialias:"set_antialias",get_antialias:"get_antialias"};
lime_graphics_cairo_CairoFontOptions._new = function() {
	return null;
};
lime_graphics_cairo_CairoFontOptions.get_antialias = function(this1) {
	return 0;
};
lime_graphics_cairo_CairoFontOptions.set_antialias = function(this1,value) {
	return value;
};
lime_graphics_cairo_CairoFontOptions.get_hintMetrics = function(this1) {
	return 0;
};
lime_graphics_cairo_CairoFontOptions.set_hintMetrics = function(this1,value) {
	return value;
};
lime_graphics_cairo_CairoFontOptions.get_hintStyle = function(this1) {
	return 0;
};
lime_graphics_cairo_CairoFontOptions.set_hintStyle = function(this1,value) {
	return value;
};
lime_graphics_cairo_CairoFontOptions.get_subpixelOrder = function(this1) {
	return 0;
};
lime_graphics_cairo_CairoFontOptions.set_subpixelOrder = function(this1,value) {
	return value;
};
var lime_graphics_cairo_CairoGlyph = function(index,x,y) {
	if(y == null) {
		y = 0;
	}
	if(x == null) {
		x = 0;
	}
	this.index = index;
	this.x = x;
	this.y = y;
};
$hxClasses["lime.graphics.cairo.CairoGlyph"] = lime_graphics_cairo_CairoGlyph;
lime_graphics_cairo_CairoGlyph.__name__ = "lime.graphics.cairo.CairoGlyph";
lime_graphics_cairo_CairoGlyph.prototype = {
	index: null
	,x: null
	,y: null
	,__class__: lime_graphics_cairo_CairoGlyph
};
var lime_graphics_cairo_CairoImageSurface = {};
lime_graphics_cairo_CairoImageSurface.__properties__ = {get_width:"get_width",get_stride:"get_stride",get_height:"get_height",get_format:"get_format",get_data:"get_data"};
lime_graphics_cairo_CairoImageSurface._new = function(format,width,height) {
	return 0;
};
lime_graphics_cairo_CairoImageSurface.create = function(data,format,width,height,stride) {
	return 0;
};
lime_graphics_cairo_CairoImageSurface.fromImage = function(image) {
	return null;
};
lime_graphics_cairo_CairoImageSurface.get_data = function(this1) {
	return lime_utils_DataPointer.fromFloat(0);
};
lime_graphics_cairo_CairoImageSurface.get_format = function(this1) {
	return 0;
};
lime_graphics_cairo_CairoImageSurface.get_height = function(this1) {
	return 0;
};
lime_graphics_cairo_CairoImageSurface.get_stride = function(this1) {
	return 0;
};
lime_graphics_cairo_CairoImageSurface.get_width = function(this1) {
	return 0;
};
var lime_graphics_cairo_CairoPattern = {};
lime_graphics_cairo_CairoPattern.__properties__ = {set_matrix:"set_matrix",get_matrix:"get_matrix",set_filter:"set_filter",get_filter:"get_filter",set_extend:"set_extend",get_extend:"get_extend",get_colorStopCount:"get_colorStopCount"};
lime_graphics_cairo_CairoPattern._new = function(handle) {
	return handle;
};
lime_graphics_cairo_CairoPattern.addColorStopRGB = function(this1,offset,r,g,b) {
};
lime_graphics_cairo_CairoPattern.addColorStopRGBA = function(this1,offset,r,g,b,a) {
};
lime_graphics_cairo_CairoPattern.createForSurface = function(surface) {
	return 0;
};
lime_graphics_cairo_CairoPattern.createLinear = function(x0,y0,x1,y1) {
	return 0;
};
lime_graphics_cairo_CairoPattern.createRadial = function(cx0,cy0,radius0,cx1,cy1,radius1) {
	return 0;
};
lime_graphics_cairo_CairoPattern.createRGB = function(r,g,b) {
	return 0;
};
lime_graphics_cairo_CairoPattern.createRGBA = function(r,g,b,a) {
	return 0;
};
lime_graphics_cairo_CairoPattern.get_colorStopCount = function(this1) {
	return 0;
};
lime_graphics_cairo_CairoPattern.get_extend = function(this1) {
	return 0;
};
lime_graphics_cairo_CairoPattern.set_extend = function(this1,value) {
	return value;
};
lime_graphics_cairo_CairoPattern.get_filter = function(this1) {
	return 0;
};
lime_graphics_cairo_CairoPattern.set_filter = function(this1,value) {
	return value;
};
lime_graphics_cairo_CairoPattern.get_matrix = function(this1) {
	return null;
};
lime_graphics_cairo_CairoPattern.set_matrix = function(this1,value) {
	return value;
};
var lime_graphics_cairo_CairoSurface = {};
lime_graphics_cairo_CairoSurface.flush = function(this1) {
};
var lime_graphics_opengl_GL = function() { };
$hxClasses["lime.graphics.opengl.GL"] = lime_graphics_opengl_GL;
lime_graphics_opengl_GL.__name__ = "lime.graphics.opengl.GL";
lime_graphics_opengl_GL.activeTexture = function(texture) {
	lime_graphics_opengl_GL.context.activeTexture(texture);
};
lime_graphics_opengl_GL.attachShader = function(program,shader) {
	lime_graphics_opengl_GL.context.attachShader(program,shader);
};
lime_graphics_opengl_GL.beginQuery = function(target,query) {
	lime_graphics_opengl_GL.context.beginQuery(target,query);
};
lime_graphics_opengl_GL.beginTransformFeedback = function(primitiveNode) {
	lime_graphics_opengl_GL.context.beginTransformFeedback(primitiveNode);
};
lime_graphics_opengl_GL.bindAttribLocation = function(program,index,name) {
	lime_graphics_opengl_GL.context.bindAttribLocation(program,index,name);
};
lime_graphics_opengl_GL.bindBuffer = function(target,buffer) {
	lime_graphics_opengl_GL.context.bindBuffer(target,buffer);
};
lime_graphics_opengl_GL.bindBufferBase = function(target,index,buffer) {
	lime_graphics_opengl_GL.context.bindBufferBase(target,index,buffer);
};
lime_graphics_opengl_GL.bindBufferRange = function(target,index,buffer,offset,size) {
	lime_graphics_opengl_GL.context.bindBufferRange(target,index,buffer,offset,lime_utils_DataPointer.fromFloat(size));
};
lime_graphics_opengl_GL.bindFramebuffer = function(target,framebuffer) {
	lime_graphics_opengl_GL.context.bindFramebuffer(target,framebuffer);
};
lime_graphics_opengl_GL.bindRenderbuffer = function(target,renderbuffer) {
	lime_graphics_opengl_GL.context.bindRenderbuffer(target,renderbuffer);
};
lime_graphics_opengl_GL.bindSampler = function(unit,sampler) {
	lime_graphics_opengl_GL.context.bindSampler(unit,sampler);
};
lime_graphics_opengl_GL.bindTexture = function(target,texture) {
	lime_graphics_opengl_GL.context.bindTexture(target,texture);
};
lime_graphics_opengl_GL.bindTransformFeedback = function(target,transformFeedback) {
	lime_graphics_opengl_GL.context.bindTransformFeedback(target,transformFeedback);
};
lime_graphics_opengl_GL.bindVertexArray = function(vertexArray) {
	lime_graphics_opengl_GL.context.bindVertexArray(vertexArray);
};
lime_graphics_opengl_GL.blitFramebuffer = function(srcX0,srcY0,srcX1,srcY1,dstX0,dstY0,dstX1,dstY1,mask,filter) {
	lime_graphics_opengl_GL.context.blitFramebuffer(srcX0,srcY0,srcX1,srcY1,dstX0,dstY0,dstX1,dstY1,mask,filter);
};
lime_graphics_opengl_GL.blendColor = function(red,green,blue,alpha) {
	lime_graphics_opengl_GL.context.blendColor(red,green,blue,alpha);
};
lime_graphics_opengl_GL.blendEquation = function(mode) {
	lime_graphics_opengl_GL.context.blendEquation(mode);
};
lime_graphics_opengl_GL.blendEquationSeparate = function(modeRGB,modeAlpha) {
	lime_graphics_opengl_GL.context.blendEquationSeparate(modeRGB,modeAlpha);
};
lime_graphics_opengl_GL.blendFunc = function(sfactor,dfactor) {
	lime_graphics_opengl_GL.context.blendFunc(sfactor,dfactor);
};
lime_graphics_opengl_GL.blendFuncSeparate = function(srcRGB,dstRGB,srcAlpha,dstAlpha) {
	lime_graphics_opengl_GL.context.blendFuncSeparate(srcRGB,dstRGB,srcAlpha,dstAlpha);
};
lime_graphics_opengl_GL.bufferDataWEBGL = function(target,srcData,usage,srcOffset,length) {
	var this1 = lime_graphics_opengl_GL.context;
	if(srcOffset != null) {
		this1.bufferData(target,srcData,usage,srcOffset,length);
	} else {
		this1.bufferData(target,srcData,usage);
	}
};
lime_graphics_opengl_GL.bufferSubDataWEBGL = function(target,dstByteOffset,srcData,srcOffset,length) {
	var this1 = lime_graphics_opengl_GL.context;
	if(srcOffset != null) {
		this1.bufferSubData(target,dstByteOffset,srcData,srcOffset,length);
	} else {
		this1.bufferSubData(target,dstByteOffset,srcData);
	}
};
lime_graphics_opengl_GL.checkFramebufferStatus = function(target) {
	return lime_graphics_opengl_GL.context.checkFramebufferStatus(target);
};
lime_graphics_opengl_GL.clear = function(mask) {
	lime_graphics_opengl_GL.context.clear(mask);
};
lime_graphics_opengl_GL.clearBufferfi = function(buffer,drawbuffer,depth,stencil) {
	lime_graphics_opengl_GL.context.clearBufferfi(buffer,drawbuffer,depth,stencil);
};
lime_graphics_opengl_GL.clearBufferfvWEBGL = function(buffer,drawbuffer,values,srcOffset) {
	lime_graphics_opengl_GL.context.clearBufferfv(buffer,drawbuffer,values,srcOffset);
};
lime_graphics_opengl_GL.clearBufferivWEBGL = function(buffer,drawbuffer,values,srcOffset) {
	lime_graphics_opengl_GL.context.clearBufferiv(buffer,drawbuffer,values,srcOffset);
};
lime_graphics_opengl_GL.clearBufferuivWEBGL = function(buffer,drawbuffer,values,srcOffset) {
	lime_graphics_opengl_GL.context.clearBufferuiv(buffer,drawbuffer,values,srcOffset);
};
lime_graphics_opengl_GL.clearColor = function(red,green,blue,alpha) {
	lime_graphics_opengl_GL.context.clearColor(red,green,blue,alpha);
};
lime_graphics_opengl_GL.clearDepth = function(depth) {
	lime_graphics_opengl_GL.context.clearDepth(depth);
};
lime_graphics_opengl_GL.clearStencil = function(s) {
	lime_graphics_opengl_GL.context.clearStencil(s);
};
lime_graphics_opengl_GL.clientWaitSync = function(sync,flags,timeout) {
	return lime_graphics_opengl_GL.context.clientWaitSync(sync,flags,timeout);
};
lime_graphics_opengl_GL.colorMask = function(red,green,blue,alpha) {
	lime_graphics_opengl_GL.context.colorMask(red,green,blue,alpha);
};
lime_graphics_opengl_GL.compileShader = function(shader) {
	lime_graphics_opengl_GL.context.compileShader(shader);
};
lime_graphics_opengl_GL.compressedTexImage2DWEBGL = function(target,level,internalformat,width,height,border,srcData,srcOffset,srcLengthOverride) {
	var this1 = lime_graphics_opengl_GL.context;
	if(srcOffset != null) {
		this1.compressedTexImage2D(target,level,internalformat,width,height,border,srcData,srcOffset,srcLengthOverride);
	} else {
		this1.compressedTexImage2D(target,level,internalformat,width,height,border,srcData);
	}
};
lime_graphics_opengl_GL.compressedTexImage3DWEBGL = function(target,level,internalformat,width,height,depth,border,srcData,srcOffset,srcLengthOverride) {
	lime_graphics_opengl_GL.context.compressedTexImage3D(target,level,internalformat,width,height,depth,border,srcData,srcOffset,srcLengthOverride);
};
lime_graphics_opengl_GL.compressedTexSubImage2DWEBGL = function(target,level,xoffset,yoffset,width,height,format,srcData,srcOffset,srcLengthOverride) {
	var this1 = lime_graphics_opengl_GL.context;
	if(srcOffset != null) {
		this1.compressedTexSubImage2D(target,level,xoffset,yoffset,width,height,format,srcData,srcOffset,srcLengthOverride);
	} else {
		this1.compressedTexSubImage2D(target,level,xoffset,yoffset,width,height,format,srcData);
	}
};
lime_graphics_opengl_GL.compressedTexSubImage3DWEBGL = function(target,level,xoffset,yoffset,zoffset,width,height,depth,format,srcData,srcOffset,srcLengthOverride) {
	lime_graphics_opengl_GL.context.compressedTexSubImage3D(target,level,xoffset,yoffset,zoffset,width,height,depth,format,srcData,srcOffset,srcLengthOverride);
};
lime_graphics_opengl_GL.copyTexImage2D = function(target,level,internalformat,x,y,width,height,border) {
	lime_graphics_opengl_GL.context.copyTexImage2D(target,level,internalformat,x,y,width,height,border);
};
lime_graphics_opengl_GL.copyTexSubImage2D = function(target,level,xoffset,yoffset,x,y,width,height) {
	lime_graphics_opengl_GL.context.copyTexSubImage2D(target,level,xoffset,yoffset,x,y,width,height);
};
lime_graphics_opengl_GL.copyTexSubImage3D = function(target,level,xoffset,yoffset,zoffset,x,y,width,height) {
	lime_graphics_opengl_GL.context.copyTexSubImage3D(target,level,xoffset,yoffset,zoffset,x,y,width,height);
};
lime_graphics_opengl_GL.createBuffer = function() {
	return lime_graphics_opengl_GL.context.createBuffer();
};
lime_graphics_opengl_GL.createFramebuffer = function() {
	return lime_graphics_opengl_GL.context.createFramebuffer();
};
lime_graphics_opengl_GL.createProgram = function() {
	return lime_graphics_opengl_GL.context.createProgram();
};
lime_graphics_opengl_GL.createQuery = function() {
	return lime_graphics_opengl_GL.context.createQuery();
};
lime_graphics_opengl_GL.createRenderbuffer = function() {
	return lime_graphics_opengl_GL.context.createRenderbuffer();
};
lime_graphics_opengl_GL.createSampler = function() {
	return lime_graphics_opengl_GL.context.createSampler();
};
lime_graphics_opengl_GL.createShader = function(type) {
	return lime_graphics_opengl_GL.context.createShader(type);
};
lime_graphics_opengl_GL.createTexture = function() {
	return lime_graphics_opengl_GL.context.createTexture();
};
lime_graphics_opengl_GL.createTransformFeedback = function() {
	return lime_graphics_opengl_GL.context.createTransformFeedback();
};
lime_graphics_opengl_GL.createVertexArray = function() {
	return lime_graphics_opengl_GL.context.createVertexArray();
};
lime_graphics_opengl_GL.cullFace = function(mode) {
	lime_graphics_opengl_GL.context.cullFace(mode);
};
lime_graphics_opengl_GL.deleteBuffer = function(buffer) {
	lime_graphics_opengl_GL.context.deleteBuffer(buffer);
};
lime_graphics_opengl_GL.deleteFramebuffer = function(framebuffer) {
	lime_graphics_opengl_GL.context.deleteFramebuffer(framebuffer);
};
lime_graphics_opengl_GL.deleteProgram = function(program) {
	lime_graphics_opengl_GL.context.deleteProgram(program);
};
lime_graphics_opengl_GL.deleteQuery = function(query) {
	lime_graphics_opengl_GL.context.deleteQuery(query);
};
lime_graphics_opengl_GL.deleteRenderbuffer = function(renderbuffer) {
	lime_graphics_opengl_GL.context.deleteRenderbuffer(renderbuffer);
};
lime_graphics_opengl_GL.deleteSampler = function(sampler) {
	lime_graphics_opengl_GL.context.deleteSampler(sampler);
};
lime_graphics_opengl_GL.deleteShader = function(shader) {
	lime_graphics_opengl_GL.context.deleteShader(shader);
};
lime_graphics_opengl_GL.deleteSync = function(sync) {
	lime_graphics_opengl_GL.context.deleteSync(sync);
};
lime_graphics_opengl_GL.deleteTexture = function(texture) {
	lime_graphics_opengl_GL.context.deleteTexture(texture);
};
lime_graphics_opengl_GL.deleteTransformFeedback = function(transformFeedback) {
	lime_graphics_opengl_GL.context.deleteTransformFeedback(transformFeedback);
};
lime_graphics_opengl_GL.deleteVertexArray = function(vertexArray) {
	lime_graphics_opengl_GL.context.deleteVertexArray(vertexArray);
};
lime_graphics_opengl_GL.depthFunc = function(func) {
	lime_graphics_opengl_GL.context.depthFunc(func);
};
lime_graphics_opengl_GL.depthMask = function(flag) {
	lime_graphics_opengl_GL.context.depthMask(flag);
};
lime_graphics_opengl_GL.depthRange = function(zNear,zFar) {
	lime_graphics_opengl_GL.context.depthRange(zNear,zFar);
};
lime_graphics_opengl_GL.detachShader = function(program,shader) {
	lime_graphics_opengl_GL.context.detachShader(program,shader);
};
lime_graphics_opengl_GL.disable = function(cap) {
	lime_graphics_opengl_GL.context.disable(cap);
};
lime_graphics_opengl_GL.disableVertexAttribArray = function(index) {
	lime_graphics_opengl_GL.context.disableVertexAttribArray(index);
};
lime_graphics_opengl_GL.drawArrays = function(mode,first,count) {
	lime_graphics_opengl_GL.context.drawArrays(mode,first,count);
};
lime_graphics_opengl_GL.drawArraysInstanced = function(mode,first,count,instanceCount) {
	lime_graphics_opengl_GL.context.drawArraysInstanced(mode,first,count,instanceCount);
};
lime_graphics_opengl_GL.drawBuffers = function(buffers) {
	lime_graphics_opengl_GL.context.drawBuffers(buffers);
};
lime_graphics_opengl_GL.drawElements = function(mode,count,type,offset) {
	lime_graphics_opengl_GL.context.drawElements(mode,count,type,offset);
};
lime_graphics_opengl_GL.drawElementsInstanced = function(mode,count,type,offset,instanceCount) {
	lime_graphics_opengl_GL.context.drawElementsInstanced(mode,count,type,offset,instanceCount);
};
lime_graphics_opengl_GL.drawRangeElements = function(mode,start,end,count,type,offset) {
	lime_graphics_opengl_GL.context.drawRangeElements(mode,start,end,count,type,offset);
};
lime_graphics_opengl_GL.enable = function(cap) {
	lime_graphics_opengl_GL.context.enable(cap);
};
lime_graphics_opengl_GL.enableVertexAttribArray = function(index) {
	lime_graphics_opengl_GL.context.enableVertexAttribArray(index);
};
lime_graphics_opengl_GL.endQuery = function(target) {
	lime_graphics_opengl_GL.context.endQuery(target);
};
lime_graphics_opengl_GL.endTransformFeedback = function() {
	lime_graphics_opengl_GL.context.endTransformFeedback();
};
lime_graphics_opengl_GL.fenceSync = function(condition,flags) {
	return lime_graphics_opengl_GL.context.fenceSync(condition,flags);
};
lime_graphics_opengl_GL.finish = function() {
	lime_graphics_opengl_GL.context.finish();
};
lime_graphics_opengl_GL.flush = function() {
	lime_graphics_opengl_GL.context.flush();
};
lime_graphics_opengl_GL.framebufferRenderbuffer = function(target,attachment,renderbuffertarget,renderbuffer) {
	lime_graphics_opengl_GL.context.framebufferRenderbuffer(target,attachment,renderbuffertarget,renderbuffer);
};
lime_graphics_opengl_GL.framebufferTexture2D = function(target,attachment,textarget,texture,level) {
	lime_graphics_opengl_GL.context.framebufferTexture2D(target,attachment,textarget,texture,level);
};
lime_graphics_opengl_GL.framebufferTextureLayer = function(target,attachment,texture,level,layer) {
	lime_graphics_opengl_GL.context.framebufferTextureLayer(target,attachment,texture,level,layer);
};
lime_graphics_opengl_GL.frontFace = function(mode) {
	lime_graphics_opengl_GL.context.frontFace(mode);
};
lime_graphics_opengl_GL.generateMipmap = function(target) {
	lime_graphics_opengl_GL.context.generateMipmap(target);
};
lime_graphics_opengl_GL.getActiveAttrib = function(program,index) {
	return lime_graphics_opengl_GL.context.getActiveAttrib(program,index);
};
lime_graphics_opengl_GL.getActiveUniform = function(program,index) {
	return lime_graphics_opengl_GL.context.getActiveUniform(program,index);
};
lime_graphics_opengl_GL.getActiveUniformBlockName = function(program,uniformBlockIndex) {
	return lime_graphics_opengl_GL.context.getActiveUniformBlockName(program,uniformBlockIndex);
};
lime_graphics_opengl_GL.getActiveUniformBlockParameter = function(program,uniformBlockIndex,pname) {
	return lime_graphics_opengl_GL.context.getActiveUniformBlockParameter(program,uniformBlockIndex,pname);
};
lime_graphics_opengl_GL.getActiveUniforms = function(program,uniformIndices,pname) {
	return lime_graphics_opengl_GL.context.getActiveUniforms(program,uniformIndices,pname);
};
lime_graphics_opengl_GL.getAttachedShaders = function(program) {
	return lime_graphics_opengl_GL.context.getAttachedShaders(program);
};
lime_graphics_opengl_GL.getAttribLocation = function(program,name) {
	return lime_graphics_opengl_GL.context.getAttribLocation(program,name);
};
lime_graphics_opengl_GL.getBufferParameter = function(target,pname) {
	return lime_graphics_opengl_GL.context.getBufferParameter(target,pname);
};
lime_graphics_opengl_GL.getBufferSubDataWEBGL = function(target,srcByteOffset,dstData,srcOffset,length) {
	var this1 = lime_graphics_opengl_GL.context;
	if(srcOffset != null) {
		this1.getBufferSubData(target,srcByteOffset,dstData,srcOffset,length);
	} else {
		this1.getBufferSubData(target,srcByteOffset,dstData);
	}
};
lime_graphics_opengl_GL.getContextAttributes = function() {
	return lime_graphics_opengl_GL.context.getContextAttributes();
};
lime_graphics_opengl_GL.getError = function() {
	return lime_graphics_opengl_GL.context.getError();
};
lime_graphics_opengl_GL.getExtension = function(name) {
	return lime_graphics_opengl_GL.context.getExtension(name);
};
lime_graphics_opengl_GL.getFragDataLocation = function(program,name) {
	return lime_graphics_opengl_GL.context.getFragDataLocation(program,name);
};
lime_graphics_opengl_GL.getFramebufferAttachmentParameter = function(target,attachment,pname) {
	return lime_graphics_opengl_GL.context.getFramebufferAttachmentParameter(target,attachment,pname);
};
lime_graphics_opengl_GL.getIndexedParameter = function(target,index) {
	return lime_graphics_opengl_GL.context.getIndexedParameter(target,index);
};
lime_graphics_opengl_GL.getInternalformatParameter = function(target,internalformat,pname) {
	return lime_graphics_opengl_GL.context.getInternalformatParameter(target,internalformat,pname);
};
lime_graphics_opengl_GL.getParameter = function(pname) {
	return lime_graphics_opengl_GL.context.getParameter(pname);
};
lime_graphics_opengl_GL.getProgramInfoLog = function(program) {
	return lime_graphics_opengl_GL.context.getProgramInfoLog(program);
};
lime_graphics_opengl_GL.getProgramParameter = function(program,pname) {
	return lime_graphics_opengl_GL.context.getProgramParameter(program,pname);
};
lime_graphics_opengl_GL.getQuery = function(target,pname) {
	return lime_graphics_opengl_GL.context.getQuery(target,pname);
};
lime_graphics_opengl_GL.getQueryParameter = function(query,pname) {
	return lime_graphics_opengl_GL.context.getQueryParameter(query,pname);
};
lime_graphics_opengl_GL.getRenderbufferParameter = function(target,pname) {
	return lime_graphics_opengl_GL.context.getRenderbufferParameter(target,pname);
};
lime_graphics_opengl_GL.getSamplerParameter = function(sampler,pname) {
	return lime_graphics_opengl_GL.context.getSamplerParameter(sampler,pname);
};
lime_graphics_opengl_GL.getShaderInfoLog = function(shader) {
	return lime_graphics_opengl_GL.context.getShaderInfoLog(shader);
};
lime_graphics_opengl_GL.getShaderParameter = function(shader,pname) {
	return lime_graphics_opengl_GL.context.getShaderParameter(shader,pname);
};
lime_graphics_opengl_GL.getShaderPrecisionFormat = function(shadertype,precisiontype) {
	return lime_graphics_opengl_GL.context.getShaderPrecisionFormat(shadertype,precisiontype);
};
lime_graphics_opengl_GL.getShaderSource = function(shader) {
	return lime_graphics_opengl_GL.context.getShaderSource(shader);
};
lime_graphics_opengl_GL.getSupportedExtensions = function() {
	return lime_graphics_opengl_GL.context.getSupportedExtensions();
};
lime_graphics_opengl_GL.getSyncParameter = function(sync,pname) {
	return lime_graphics_opengl_GL.context.getSyncParameter(sync,pname);
};
lime_graphics_opengl_GL.getTexParameter = function(target,pname) {
	return lime_graphics_opengl_GL.context.getTexParameter(target,pname);
};
lime_graphics_opengl_GL.getTransformFeedbackVarying = function(program,index) {
	return lime_graphics_opengl_GL.context.getTransformFeedbackVarying(program,index);
};
lime_graphics_opengl_GL.getUniform = function(program,location) {
	return lime_graphics_opengl_GL.context.getUniform(program,location);
};
lime_graphics_opengl_GL.getUniformBlockIndex = function(program,uniformBlockName) {
	return lime_graphics_opengl_GL.context.getUniformBlockIndex(program,uniformBlockName);
};
lime_graphics_opengl_GL.getUniformIndices = function(program,uniformNames) {
	return lime_graphics_opengl_GL.context.getUniformIndices(program,uniformNames);
};
lime_graphics_opengl_GL.getUniformLocation = function(program,name) {
	return lime_graphics_opengl_GL.context.getUniformLocation(program,name);
};
lime_graphics_opengl_GL.getVertexAttrib = function(index,pname) {
	return lime_graphics_opengl_GL.context.getVertexAttrib(index,pname);
};
lime_graphics_opengl_GL.getVertexAttribOffset = function(index,pname) {
	return lime_utils_DataPointer.fromFloat(lime_graphics_opengl_GL.context.getVertexAttribOffset(index,pname));
};
lime_graphics_opengl_GL.hint = function(target,mode) {
	lime_graphics_opengl_GL.context.hint(target,mode);
};
lime_graphics_opengl_GL.invalidateFramebuffer = function(target,attachments) {
	lime_graphics_opengl_GL.context.invalidateFramebuffer(target,attachments);
};
lime_graphics_opengl_GL.invalidateSubFramebuffer = function(target,attachments,x,y,width,height) {
	lime_graphics_opengl_GL.context.invalidateSubFramebuffer(target,attachments,x,y,width,height);
};
lime_graphics_opengl_GL.isBuffer = function(buffer) {
	return lime_graphics_opengl_GL.context.isBuffer(buffer);
};
lime_graphics_opengl_GL.isContextLost = function() {
	return lime_graphics_opengl_GL.context.isContextLost();
};
lime_graphics_opengl_GL.isEnabled = function(cap) {
	return lime_graphics_opengl_GL.context.isEnabled(cap);
};
lime_graphics_opengl_GL.isFramebuffer = function(framebuffer) {
	return lime_graphics_opengl_GL.context.isFramebuffer(framebuffer);
};
lime_graphics_opengl_GL.isProgram = function(program) {
	return lime_graphics_opengl_GL.context.isProgram(program);
};
lime_graphics_opengl_GL.isQuery = function(query) {
	return lime_graphics_opengl_GL.context.isQuery(query);
};
lime_graphics_opengl_GL.isRenderbuffer = function(renderbuffer) {
	return lime_graphics_opengl_GL.context.isRenderbuffer(renderbuffer);
};
lime_graphics_opengl_GL.isSampler = function(sampler) {
	return lime_graphics_opengl_GL.context.isSampler(sampler);
};
lime_graphics_opengl_GL.isShader = function(shader) {
	return lime_graphics_opengl_GL.context.isShader(shader);
};
lime_graphics_opengl_GL.isSync = function(sync) {
	return lime_graphics_opengl_GL.context.isSync(sync);
};
lime_graphics_opengl_GL.isTexture = function(texture) {
	return lime_graphics_opengl_GL.context.isTexture(texture);
};
lime_graphics_opengl_GL.isTransformFeedback = function(transformFeedback) {
	return lime_graphics_opengl_GL.context.isTransformFeedback(transformFeedback);
};
lime_graphics_opengl_GL.isVertexArray = function(vertexArray) {
	return lime_graphics_opengl_GL.context.isVertexArray(vertexArray);
};
lime_graphics_opengl_GL.lineWidth = function(width) {
	lime_graphics_opengl_GL.context.lineWidth(width);
};
lime_graphics_opengl_GL.linkProgram = function(program) {
	lime_graphics_opengl_GL.context.linkProgram(program);
};
lime_graphics_opengl_GL.pauseTransformFeedback = function() {
	lime_graphics_opengl_GL.context.pauseTransformFeedback();
};
lime_graphics_opengl_GL.pixelStorei = function(pname,param) {
	lime_graphics_opengl_GL.context.pixelStorei(pname,param);
};
lime_graphics_opengl_GL.polygonOffset = function(factor,units) {
	lime_graphics_opengl_GL.context.polygonOffset(factor,units);
};
lime_graphics_opengl_GL.readBuffer = function(src) {
	lime_graphics_opengl_GL.context.readBuffer(src);
};
lime_graphics_opengl_GL.readPixelsWEBGL = function(x,y,width,height,format,type,pixels,dstOffset) {
	var this1 = lime_graphics_opengl_GL.context;
	if(dstOffset != null) {
		this1.readPixels(x,y,width,height,format,type,pixels,dstOffset);
	} else {
		this1.readPixels(x,y,width,height,format,type,pixels);
	}
};
lime_graphics_opengl_GL.renderbufferStorage = function(target,internalformat,width,height) {
	lime_graphics_opengl_GL.context.renderbufferStorage(target,internalformat,width,height);
};
lime_graphics_opengl_GL.renderbufferStorageMultisample = function(target,samples,internalformat,width,height) {
	lime_graphics_opengl_GL.context.renderbufferStorageMultisample(target,samples,internalformat,width,height);
};
lime_graphics_opengl_GL.resumeTransformFeedback = function() {
	lime_graphics_opengl_GL.context.resumeTransformFeedback();
};
lime_graphics_opengl_GL.sampleCoverage = function(value,invert) {
	lime_graphics_opengl_GL.context.sampleCoverage(value,invert);
};
lime_graphics_opengl_GL.samplerParameterf = function(sampler,pname,param) {
	lime_graphics_opengl_GL.context.samplerParameterf(sampler,pname,param);
};
lime_graphics_opengl_GL.samplerParameteri = function(sampler,pname,param) {
	lime_graphics_opengl_GL.context.samplerParameteri(sampler,pname,param);
};
lime_graphics_opengl_GL.scissor = function(x,y,width,height) {
	lime_graphics_opengl_GL.context.scissor(x,y,width,height);
};
lime_graphics_opengl_GL.shaderSource = function(shader,source) {
	lime_graphics_opengl_GL.context.shaderSource(shader,source);
};
lime_graphics_opengl_GL.stencilFunc = function(func,ref,mask) {
	lime_graphics_opengl_GL.context.stencilFunc(func,ref,mask);
};
lime_graphics_opengl_GL.stencilFuncSeparate = function(face,func,ref,mask) {
	lime_graphics_opengl_GL.context.stencilFuncSeparate(face,func,ref,mask);
};
lime_graphics_opengl_GL.stencilMask = function(mask) {
	lime_graphics_opengl_GL.context.stencilMask(mask);
};
lime_graphics_opengl_GL.stencilMaskSeparate = function(face,mask) {
	lime_graphics_opengl_GL.context.stencilMaskSeparate(face,mask);
};
lime_graphics_opengl_GL.stencilOp = function(fail,zfail,zpass) {
	lime_graphics_opengl_GL.context.stencilOp(fail,zfail,zpass);
};
lime_graphics_opengl_GL.stencilOpSeparate = function(face,fail,zfail,zpass) {
	lime_graphics_opengl_GL.context.stencilOpSeparate(face,fail,zfail,zpass);
};
lime_graphics_opengl_GL.texImage2DWEBGL = function(target,level,internalformat,width,height,border,format,type,srcData,srcOffset) {
	var this1 = lime_graphics_opengl_GL.context;
	if(srcOffset != null) {
		this1.texImage2D(target,level,internalformat,width,height,border,format,type,srcData,srcOffset);
	} else if(format != null) {
		this1.texImage2D(target,level,internalformat,width,height,border,format,type,srcData);
	} else {
		this1.texImage2D(target,level,internalformat,width,height,border);
	}
};
lime_graphics_opengl_GL.texImage3DWEBGL = function(target,level,internalformat,width,height,depth,border,format,type,srcData,srcOffset) {
	lime_graphics_opengl_GL.context.texImage3D(target,level,internalformat,width,height,depth,border,format,type,srcData,srcOffset);
};
lime_graphics_opengl_GL.texStorage2D = function(target,level,internalformat,width,height) {
	lime_graphics_opengl_GL.context.texStorage2D(target,level,internalformat,width,height);
};
lime_graphics_opengl_GL.texStorage3D = function(target,level,internalformat,width,height,depth) {
	lime_graphics_opengl_GL.context.texStorage3D(target,level,internalformat,width,height,depth);
};
lime_graphics_opengl_GL.texParameterf = function(target,pname,param) {
	lime_graphics_opengl_GL.context.texParameterf(target,pname,param);
};
lime_graphics_opengl_GL.texParameteri = function(target,pname,param) {
	lime_graphics_opengl_GL.context.texParameteri(target,pname,param);
};
lime_graphics_opengl_GL.texSubImage2DWEBGL = function(target,level,xoffset,yoffset,width,height,format,type,srcData,srcOffset) {
	var this1 = lime_graphics_opengl_GL.context;
	if(srcOffset != null) {
		this1.texSubImage2D(target,level,xoffset,yoffset,width,height,format,type,srcData,srcOffset);
	} else if(type != null) {
		this1.texSubImage2D(target,level,xoffset,yoffset,width,height,format,type,srcData);
	} else {
		this1.texSubImage2D(target,level,xoffset,yoffset,width,height,format);
	}
};
lime_graphics_opengl_GL.texSubImage3DWEBGL = function(target,level,xoffset,yoffset,zoffset,width,height,depth,format,type,source,srcOffset) {
	lime_graphics_opengl_GL.context.texSubImage3D(target,level,xoffset,yoffset,zoffset,width,height,depth,format,type,source,srcOffset);
};
lime_graphics_opengl_GL.transformFeedbackVaryings = function(program,varyings,bufferMode) {
	lime_graphics_opengl_GL.context.transformFeedbackVaryings(program,varyings,bufferMode);
};
lime_graphics_opengl_GL.uniform1f = function(location,v0) {
	lime_graphics_opengl_GL.context.uniform1f(location,v0);
};
lime_graphics_opengl_GL.uniform1fvWEBGL = function(location,data,srcOffset,srcLength) {
	var this1 = lime_graphics_opengl_GL.context;
	if(srcOffset != null) {
		this1.uniform1fv(location,data,srcOffset,srcLength);
	} else {
		this1.uniform1fv(location,data);
	}
};
lime_graphics_opengl_GL.uniform1i = function(location,v0) {
	lime_graphics_opengl_GL.context.uniform1i(location,v0);
};
lime_graphics_opengl_GL.uniform1ivWEBGL = function(location,data,srcOffset,srcLength) {
	var this1 = lime_graphics_opengl_GL.context;
	if(srcOffset != null) {
		this1.uniform1iv(location,data,srcOffset,srcLength);
	} else {
		this1.uniform1iv(location,data);
	}
};
lime_graphics_opengl_GL.uniform1ui = function(location,v0) {
	lime_graphics_opengl_GL.context.uniform1ui(location,v0);
};
lime_graphics_opengl_GL.uniform1uivWEBGL = function(location,data,srcOffset,srcLength) {
	lime_graphics_opengl_GL.context.uniform1uiv(location,data,srcOffset,srcLength);
};
lime_graphics_opengl_GL.uniform2f = function(location,v0,v1) {
	lime_graphics_opengl_GL.context.uniform2f(location,v0,v1);
};
lime_graphics_opengl_GL.uniform2fvWEBGL = function(location,data,srcOffset,srcLength) {
	lime_graphics_WebGL2RenderContext.uniform2fv(lime_graphics_opengl_GL.context,location,data,srcOffset,srcLength);
};
lime_graphics_opengl_GL.uniform2i = function(location,x,y) {
	lime_graphics_opengl_GL.context.uniform2i(location,x,y);
};
lime_graphics_opengl_GL.uniform2ivWEBGL = function(location,data,srcOffset,srcLength) {
	var this1 = lime_graphics_opengl_GL.context;
	if(srcOffset != null) {
		this1.uniform2iv(location,data,srcOffset,srcLength);
	} else {
		this1.uniform2iv(location,data);
	}
};
lime_graphics_opengl_GL.uniform2ui = function(location,x,y) {
	lime_graphics_opengl_GL.context.uniform2ui(location,x,y);
};
lime_graphics_opengl_GL.uniform2uivWEBGL = function(location,data,srcOffset,srcLength) {
	lime_graphics_opengl_GL.context.uniform2uiv(location,data,srcOffset,srcLength);
};
lime_graphics_opengl_GL.uniform3f = function(location,v0,v1,v2) {
	lime_graphics_opengl_GL.context.uniform3f(location,v0,v1,v2);
};
lime_graphics_opengl_GL.uniform3fvWEBGL = function(location,data,srcOffset,srcLength) {
	var this1 = lime_graphics_opengl_GL.context;
	if(srcOffset != null) {
		this1.uniform3fv(location,data,srcOffset,srcLength);
	} else {
		this1.uniform3fv(location,data);
	}
};
lime_graphics_opengl_GL.uniform3i = function(location,v0,v1,v2) {
	lime_graphics_opengl_GL.context.uniform3i(location,v0,v1,v2);
};
lime_graphics_opengl_GL.uniform3ivWEBGL = function(location,data,srcOffset,srcLength) {
	var this1 = lime_graphics_opengl_GL.context;
	if(srcOffset != null) {
		this1.uniform3iv(location,data,srcOffset,srcLength);
	} else {
		this1.uniform3iv(location,data);
	}
};
lime_graphics_opengl_GL.uniform3ui = function(location,v0,v1,v2) {
	lime_graphics_opengl_GL.context.uniform3ui(location,v0,v1,v2);
};
lime_graphics_opengl_GL.uniform3uivWEBGL = function(location,data,srcOffset,srcLength) {
	lime_graphics_opengl_GL.context.uniform3uiv(location,data,srcOffset,srcLength);
};
lime_graphics_opengl_GL.uniform4f = function(location,v0,v1,v2,v3) {
	lime_graphics_opengl_GL.context.uniform4f(location,v0,v1,v2,v3);
};
lime_graphics_opengl_GL.uniform4fvWEBGL = function(location,data,srcOffset,srcLength) {
	var this1 = lime_graphics_opengl_GL.context;
	if(srcOffset != null) {
		this1.uniform4fv(location,data,srcOffset,srcLength);
	} else {
		this1.uniform4fv(location,data);
	}
};
lime_graphics_opengl_GL.uniform4i = function(location,v0,v1,v2,v3) {
	lime_graphics_opengl_GL.context.uniform4i(location,v0,v1,v2,v3);
};
lime_graphics_opengl_GL.uniform4ivWEBGL = function(location,data,srcOffset,srcLength) {
	var this1 = lime_graphics_opengl_GL.context;
	if(srcOffset != null) {
		this1.uniform4iv(location,data,srcOffset,srcLength);
	} else {
		this1.uniform4iv(location,data);
	}
};
lime_graphics_opengl_GL.uniform4ui = function(location,v0,v1,v2,v3) {
	lime_graphics_opengl_GL.context.uniform4ui(location,v0,v1,v2,v3);
};
lime_graphics_opengl_GL.uniform4uivWEBGL = function(location,data,srcOffset,srcLength) {
	lime_graphics_opengl_GL.context.uniform4uiv(location,data,srcOffset,srcLength);
};
lime_graphics_opengl_GL.uniformBlockBinding = function(program,uniformBlockIndex,uniformBlockBinding) {
	lime_graphics_opengl_GL.context.uniformBlockBinding(program,uniformBlockIndex,uniformBlockBinding);
};
lime_graphics_opengl_GL.uniformMatrix2fvWEBGL = function(location,transpose,v,srcOffset,srcLength) {
	var this1 = lime_graphics_opengl_GL.context;
	if(srcOffset != null) {
		this1.uniformMatrix2fv(location,transpose,v,srcOffset,srcLength);
	} else {
		this1.uniformMatrix2fv(location,transpose,v);
	}
};
lime_graphics_opengl_GL.uniformMatrix2x3fvWEBGL = function(location,transpose,v,srcOffset,srcLength) {
	lime_graphics_opengl_GL.context.uniformMatrix2x3fv(location,transpose,v,srcOffset,srcLength);
};
lime_graphics_opengl_GL.uniformMatrix2x4fvWEBGL = function(location,transpose,v,srcOffset,srcLength) {
	lime_graphics_opengl_GL.context.uniformMatrix2x4fv(location,transpose,v,srcOffset,srcLength);
};
lime_graphics_opengl_GL.uniformMatrix3fvWEBGL = function(location,transpose,v,srcOffset,srcLength) {
	var this1 = lime_graphics_opengl_GL.context;
	if(srcOffset != null) {
		this1.uniformMatrix3fv(location,transpose,v,srcOffset,srcLength);
	} else {
		this1.uniformMatrix3fv(location,transpose,v);
	}
};
lime_graphics_opengl_GL.uniformMatrix3x2fvWEBGL = function(location,transpose,v,srcOffset,srcLength) {
	lime_graphics_opengl_GL.context.uniformMatrix3x2fv(location,transpose,v,srcOffset,srcLength);
};
lime_graphics_opengl_GL.uniformMatrix3x4fvWEBGL = function(location,transpose,v,srcOffset,srcLength) {
	lime_graphics_opengl_GL.context.uniformMatrix3x4fv(location,transpose,v,srcOffset,srcLength);
};
lime_graphics_opengl_GL.uniformMatrix4fvWEBGL = function(location,transpose,v,srcOffset,srcLength) {
	var this1 = lime_graphics_opengl_GL.context;
	if(srcOffset != null) {
		this1.uniformMatrix4fv(location,transpose,v,srcOffset,srcLength);
	} else {
		this1.uniformMatrix4fv(location,transpose,v);
	}
};
lime_graphics_opengl_GL.uniformMatrix4x2fvWEBGL = function(location,transpose,v,srcOffset,srcLength) {
	lime_graphics_opengl_GL.context.uniformMatrix4x2fv(location,transpose,v,srcOffset,srcLength);
};
lime_graphics_opengl_GL.uniformMatrix4x3fvWEBGL = function(location,transpose,v,srcOffset,srcLength) {
	lime_graphics_opengl_GL.context.uniformMatrix4x3fv(location,transpose,v,srcOffset,srcLength);
};
lime_graphics_opengl_GL.useProgram = function(program) {
	lime_graphics_opengl_GL.context.useProgram(program);
};
lime_graphics_opengl_GL.validateProgram = function(program) {
	lime_graphics_opengl_GL.context.validateProgram(program);
};
lime_graphics_opengl_GL.vertexAttrib1f = function(index,v0) {
	lime_graphics_opengl_GL.context.vertexAttrib1f(index,v0);
};
lime_graphics_opengl_GL.vertexAttrib1fv = function(index,v) {
	lime_graphics_opengl_GL.context.vertexAttrib1fv(index,v);
};
lime_graphics_opengl_GL.vertexAttrib1fvWEBGL = function(index,v) {
	lime_graphics_opengl_GL.context.vertexAttrib1fv(index,v);
};
lime_graphics_opengl_GL.vertexAttrib2f = function(index,v0,v1) {
	lime_graphics_opengl_GL.context.vertexAttrib2f(index,v0,v1);
};
lime_graphics_opengl_GL.vertexAttrib2fv = function(index,v) {
	lime_graphics_opengl_GL.context.vertexAttrib2fv(index,v);
};
lime_graphics_opengl_GL.vertexAttrib2fvWEBGL = function(index,v) {
	lime_graphics_opengl_GL.context.vertexAttrib2fv(index,v);
};
lime_graphics_opengl_GL.vertexAttrib3f = function(index,v0,v1,v2) {
	lime_graphics_opengl_GL.context.vertexAttrib3f(index,v0,v1,v2);
};
lime_graphics_opengl_GL.vertexAttrib3fv = function(index,v) {
	lime_graphics_opengl_GL.context.vertexAttrib3fv(index,v);
};
lime_graphics_opengl_GL.vertexAttrib3fvWEBGL = function(index,v) {
	lime_graphics_opengl_GL.context.vertexAttrib3fv(index,v);
};
lime_graphics_opengl_GL.vertexAttrib4f = function(index,v0,v1,v2,v3) {
	lime_graphics_opengl_GL.context.vertexAttrib4f(index,v0,v1,v2,v3);
};
lime_graphics_opengl_GL.vertexAttrib4fv = function(index,v) {
	lime_graphics_opengl_GL.context.vertexAttrib4fv(index,v);
};
lime_graphics_opengl_GL.vertexAttrib4fvWEBGL = function(index,v) {
	lime_graphics_opengl_GL.context.vertexAttrib4fv(index,v);
};
lime_graphics_opengl_GL.vertexAttribDivisor = function(index,divisor) {
	lime_graphics_opengl_GL.context.vertexAttribDivisor(index,divisor);
};
lime_graphics_opengl_GL.vertexAttribI4i = function(index,v0,v1,v2,v3) {
	lime_graphics_opengl_GL.context.vertexAttribI4i(index,v0,v1,v2,v3);
};
lime_graphics_opengl_GL.vertexAttribI4iv = function(index,v) {
	lime_graphics_opengl_GL.context.vertexAttribI4iv(index,v);
};
lime_graphics_opengl_GL.vertexAttribI4ivWEBGL = function(index,v) {
	lime_graphics_opengl_GL.context.vertexAttribI4iv(index,v);
};
lime_graphics_opengl_GL.vertexAttribI4ui = function(index,v0,v1,v2,v3) {
	lime_graphics_opengl_GL.context.vertexAttribI4ui(index,v0,v1,v2,v3);
};
lime_graphics_opengl_GL.vertexAttribI4uiv = function(index,v) {
	lime_graphics_opengl_GL.context.vertexAttribI4uiv(index,v);
};
lime_graphics_opengl_GL.vertexAttribI4uivWEBGL = function(index,v) {
	lime_graphics_opengl_GL.context.vertexAttribI4uiv(index,v);
};
lime_graphics_opengl_GL.vertexAttribIPointer = function(index,size,type,stride,offset) {
	lime_graphics_opengl_GL.context.vertexAttribIPointer(index,size,type,stride,offset);
};
lime_graphics_opengl_GL.vertexAttribPointer = function(index,size,type,normalized,stride,offset) {
	lime_graphics_opengl_GL.context.vertexAttribPointer(index,size,type,normalized,stride,offset);
};
lime_graphics_opengl_GL.viewport = function(x,y,width,height) {
	lime_graphics_opengl_GL.context.viewport(x,y,width,height);
};
lime_graphics_opengl_GL.waitSync = function(sync,flags,timeout) {
	lime_graphics_opengl_GL.context.waitSync(sync,flags,timeout);
};
lime_graphics_opengl_GL.__getObjectID = function(object) {
	if(object == null) {
		return 0;
	} else {
		return object.id;
	}
};
var lime_graphics_opengl_GLProgram = {};
lime_graphics_opengl_GLProgram.fromSources = function(gl,vertexSource,fragmentSource) {
	var vertexShader = lime_graphics_opengl_GLShader.fromSource(gl,vertexSource,gl.VERTEX_SHADER);
	var fragmentShader = lime_graphics_opengl_GLShader.fromSource(gl,fragmentSource,gl.FRAGMENT_SHADER);
	var program = gl.createProgram();
	gl.attachShader(program,vertexShader);
	gl.attachShader(program,fragmentShader);
	gl.linkProgram(program);
	if(gl.getProgramParameter(program,35714) == 0) {
		var message = "Unable to initialize the shader program";
		message += "\n" + lime_graphics_opengl_GL.context.getProgramInfoLog(program);
		lime_utils_Log.error(message,{ fileName : "lime/graphics/opengl/GLProgram.hx", lineNumber : 39, className : "lime.graphics.opengl._GLProgram.GLProgram_Impl_", methodName : "fromSources"});
	}
	return program;
};
var lime_graphics_opengl_GLShader = {};
lime_graphics_opengl_GLShader.fromSource = function(gl,source,type) {
	var shader = gl.createShader(type);
	gl.shaderSource(shader,source);
	gl.compileShader(shader);
	var shaderInfoLog = gl.getShaderInfoLog(shader);
	var compileStatus = gl.getShaderParameter(shader,gl.COMPILE_STATUS);
	if(shaderInfoLog != null || compileStatus == 0) {
		var message;
		if(compileStatus == 0) {
			message = "Error ";
		} else {
			message = "Info ";
		}
		if(type == gl.VERTEX_SHADER) {
			message = "compiling vertex shader";
		} else if(type == gl.FRAGMENT_SHADER) {
			message = "compiling fragment shader";
		} else {
			message = "compiling unknown shader type";
		}
		message += "\n" + shaderInfoLog;
		if(compileStatus == 0) {
			lime_utils_Log.error(message,{ fileName : "lime/graphics/opengl/GLShader.hx", lineNumber : 47, className : "lime.graphics.opengl._GLShader.GLShader_Impl_", methodName : "fromSource"});
		} else if(shaderInfoLog != null) {
			lime_utils_Log.debug(message,{ fileName : "lime/graphics/opengl/GLShader.hx", lineNumber : 48, className : "lime.graphics.opengl._GLShader.GLShader_Impl_", methodName : "fromSource"});
		}
	}
	return shader;
};
var lime_graphics_opengl_ext_KHR_$debug = function() {
	this.STACK_UNDERFLOW = 1284;
	this.STACK_OVERFLOW = 1283;
	this.CONTEXT_FLAG_DEBUG_BIT = 2;
	this.DEBUG_OUTPUT = 37600;
	this.DEBUG_SEVERITY_LOW = 37192;
	this.DEBUG_SEVERITY_MEDIUM = 37191;
	this.DEBUG_SEVERITY_HIGH = 37190;
	this.DEBUG_LOGGED_MESSAGES = 37189;
	this.MAX_DEBUG_LOGGED_MESSAGES = 37188;
	this.MAX_DEBUG_MESSAGE_LENGTH = 37187;
	this.MAX_LABEL_LENGTH = 33512;
	this.SAMPLER = 33510;
	this.QUERY = 33507;
	this.PROGRAM = 33506;
	this.SHADER = 33505;
	this.BUFFER = 33504;
	this.DEBUG_GROUP_STACK_DEPTH = 33389;
	this.MAX_DEBUG_GROUP_STACK_DEPTH = 33388;
	this.DEBUG_SEVERITY_NOTIFICATION = 33387;
	this.DEBUG_TYPE_POP_GROUP = 33386;
	this.DEBUG_TYPE_PUSH_GROUP = 33385;
	this.DEBUG_TYPE_MARKER = 33384;
	this.DEBUG_TYPE_OTHER = 33361;
	this.DEBUG_TYPE_PERFORMANCE = 33360;
	this.DEBUG_TYPE_PORTABILITY = 33359;
	this.DEBUG_TYPE_UNDEFINED_BEHAVIOR = 33358;
	this.DEBUG_TYPE_DEPRECATED_BEHAVIOR = 33357;
	this.DEBUG_TYPE_ERROR = 33356;
	this.DEBUG_SOURCE_OTHER = 33355;
	this.DEBUG_SOURCE_APPLICATION = 33354;
	this.DEBUG_SOURCE_THIRD_PARTY = 33353;
	this.DEBUG_SOURCE_SHADER_COMPILER = 33352;
	this.DEBUG_SOURCE_WINDOW_SYSTEM = 33351;
	this.DEBUG_SOURCE_API = 33350;
	this.DEBUG_CALLBACK_USER_PARAM = 33349;
	this.DEBUG_CALLBACK_FUNCTION = 33348;
	this.DEBUG_NEXT_LOGGED_MESSAGE_LENGTH = 33347;
	this.DEBUG_OUTPUT_SYNCHRONOUS = 33346;
};
$hxClasses["lime.graphics.opengl.ext.KHR_debug"] = lime_graphics_opengl_ext_KHR_$debug;
lime_graphics_opengl_ext_KHR_$debug.__name__ = "lime.graphics.opengl.ext.KHR_debug";
lime_graphics_opengl_ext_KHR_$debug.prototype = {
	DEBUG_OUTPUT_SYNCHRONOUS: null
	,DEBUG_NEXT_LOGGED_MESSAGE_LENGTH: null
	,DEBUG_CALLBACK_FUNCTION: null
	,DEBUG_CALLBACK_USER_PARAM: null
	,DEBUG_SOURCE_API: null
	,DEBUG_SOURCE_WINDOW_SYSTEM: null
	,DEBUG_SOURCE_SHADER_COMPILER: null
	,DEBUG_SOURCE_THIRD_PARTY: null
	,DEBUG_SOURCE_APPLICATION: null
	,DEBUG_SOURCE_OTHER: null
	,DEBUG_TYPE_ERROR: null
	,DEBUG_TYPE_DEPRECATED_BEHAVIOR: null
	,DEBUG_TYPE_UNDEFINED_BEHAVIOR: null
	,DEBUG_TYPE_PORTABILITY: null
	,DEBUG_TYPE_PERFORMANCE: null
	,DEBUG_TYPE_OTHER: null
	,DEBUG_TYPE_MARKER: null
	,DEBUG_TYPE_PUSH_GROUP: null
	,DEBUG_TYPE_POP_GROUP: null
	,DEBUG_SEVERITY_NOTIFICATION: null
	,MAX_DEBUG_GROUP_STACK_DEPTH: null
	,DEBUG_GROUP_STACK_DEPTH: null
	,BUFFER: null
	,SHADER: null
	,PROGRAM: null
	,QUERY: null
	,SAMPLER: null
	,MAX_LABEL_LENGTH: null
	,MAX_DEBUG_MESSAGE_LENGTH: null
	,MAX_DEBUG_LOGGED_MESSAGES: null
	,DEBUG_LOGGED_MESSAGES: null
	,DEBUG_SEVERITY_HIGH: null
	,DEBUG_SEVERITY_MEDIUM: null
	,DEBUG_SEVERITY_LOW: null
	,DEBUG_OUTPUT: null
	,CONTEXT_FLAG_DEBUG_BIT: null
	,STACK_OVERFLOW: null
	,STACK_UNDERFLOW: null
	,__class__: lime_graphics_opengl_ext_KHR_$debug
};
var lime_math_ARGB = {};
lime_math_ARGB.__properties__ = {set_r:"set_r",get_r:"get_r",set_g:"set_g",get_g:"get_g",set_b:"set_b",get_b:"get_b",set_a:"set_a",get_a:"get_a"};
lime_math_ARGB._new = function(argb) {
	if(argb == null) {
		argb = 0;
	}
	return argb;
};
lime_math_ARGB.create = function(a,r,g,b) {
	var argb = 0;
	argb = (a & 255) << 24 | (r & 255) << 16 | (g & 255) << 8 | b & 255;
	return argb;
};
lime_math_ARGB.multiplyAlpha = function(this1) {
	if((this1 >>> 24 & 255) == 0) {
		this1 = 0;
	} else if((this1 >>> 24 & 255) != 255) {
		lime_math_ARGB.a16 = lime_math_RGBA.__alpha16[this1 >>> 24 & 255];
		this1 = (this1 >>> 24 & 255 & 255) << 24 | ((this1 >>> 16 & 255) * lime_math_ARGB.a16 >> 16 & 255) << 16 | ((this1 >>> 8 & 255) * lime_math_ARGB.a16 >> 16 & 255) << 8 | (this1 & 255) * lime_math_ARGB.a16 >> 16 & 255;
	}
};
lime_math_ARGB.readUInt8 = function(this1,data,offset,format,premultiplied) {
	if(premultiplied == null) {
		premultiplied = false;
	}
	if(format == null) {
		format = 0;
	}
	switch(format) {
	case 0:
		this1 = (data[offset + 1] & 255) << 24 | (data[offset + 2] & 255) << 16 | (data[offset + 3] & 255) << 8 | data[offset] & 255;
		break;
	case 1:
		this1 = (data[offset + 2] & 255) << 24 | (data[offset + 3] & 255) << 16 | (data[offset] & 255) << 8 | data[offset + 1] & 255;
		break;
	case 2:
		this1 = (data[offset + 1] & 255) << 24 | (data[offset] & 255) << 16 | (data[offset + 3] & 255) << 8 | data[offset + 2] & 255;
		break;
	}
	if(premultiplied) {
		if((this1 >>> 24 & 255) != 0 && (this1 >>> 24 & 255) != 255) {
			lime_math_ARGB.unmult = 255.0 / (this1 >>> 24 & 255);
			this1 = (this1 >>> 24 & 255 & 255) << 24 | (lime_math_RGBA.__clamp[Math.floor((this1 >>> 16 & 255) * lime_math_ARGB.unmult)] & 255) << 16 | (lime_math_RGBA.__clamp[Math.floor((this1 >>> 8 & 255) * lime_math_ARGB.unmult)] & 255) << 8 | lime_math_RGBA.__clamp[Math.floor((this1 & 255) * lime_math_ARGB.unmult)] & 255;
		}
	}
};
lime_math_ARGB.set = function(this1,a,r,g,b) {
	this1 = (a & 255) << 24 | (r & 255) << 16 | (g & 255) << 8 | b & 255;
};
lime_math_ARGB.unmultiplyAlpha = function(this1) {
	if((this1 >>> 24 & 255) != 0 && (this1 >>> 24 & 255) != 255) {
		lime_math_ARGB.unmult = 255.0 / (this1 >>> 24 & 255);
		this1 = (this1 >>> 24 & 255 & 255) << 24 | (lime_math_RGBA.__clamp[Math.floor((this1 >>> 16 & 255) * lime_math_ARGB.unmult)] & 255) << 16 | (lime_math_RGBA.__clamp[Math.floor((this1 >>> 8 & 255) * lime_math_ARGB.unmult)] & 255) << 8 | lime_math_RGBA.__clamp[Math.floor((this1 & 255) * lime_math_ARGB.unmult)] & 255;
	}
};
lime_math_ARGB.writeUInt8 = function(this1,data,offset,format,premultiplied) {
	if(premultiplied == null) {
		premultiplied = false;
	}
	if(format == null) {
		format = 0;
	}
	if(premultiplied) {
		if((this1 >>> 24 & 255) == 0) {
			this1 = 0;
		} else if((this1 >>> 24 & 255) != 255) {
			lime_math_ARGB.a16 = lime_math_RGBA.__alpha16[this1 >>> 24 & 255];
			this1 = (this1 >>> 24 & 255 & 255) << 24 | ((this1 >>> 16 & 255) * lime_math_ARGB.a16 >> 16 & 255) << 16 | ((this1 >>> 8 & 255) * lime_math_ARGB.a16 >> 16 & 255) << 8 | (this1 & 255) * lime_math_ARGB.a16 >> 16 & 255;
		}
	}
	switch(format) {
	case 0:
		data[offset] = this1 >>> 16 & 255;
		data[offset + 1] = this1 >>> 8 & 255;
		data[offset + 2] = this1 & 255;
		data[offset + 3] = this1 >>> 24 & 255;
		break;
	case 1:
		data[offset] = this1 >>> 24 & 255;
		data[offset + 1] = this1 >>> 16 & 255;
		data[offset + 2] = this1 >>> 8 & 255;
		data[offset + 3] = this1 & 255;
		break;
	case 2:
		data[offset] = this1 & 255;
		data[offset + 1] = this1 >>> 8 & 255;
		data[offset + 2] = this1 >>> 16 & 255;
		data[offset + 3] = this1 >>> 24 & 255;
		break;
	}
};
lime_math_ARGB.__fromBGRA = function(bgra) {
	var argb = 0;
	argb = (bgra & 255 & 255) << 24 | (bgra >>> 8 & 255 & 255) << 16 | (bgra >>> 16 & 255 & 255) << 8 | bgra >>> 24 & 255 & 255;
	return argb;
};
lime_math_ARGB.__fromRGBA = function(rgba) {
	var argb = 0;
	argb = (rgba & 255 & 255) << 24 | (rgba >>> 24 & 255 & 255) << 16 | (rgba >>> 16 & 255 & 255) << 8 | rgba >>> 8 & 255 & 255;
	return argb;
};
lime_math_ARGB.get_a = function(this1) {
	return this1 >>> 24 & 255;
};
lime_math_ARGB.set_a = function(this1,value) {
	this1 = (value & 255) << 24 | (this1 >>> 16 & 255 & 255) << 16 | (this1 >>> 8 & 255 & 255) << 8 | this1 & 255 & 255;
	return value;
};
lime_math_ARGB.get_b = function(this1) {
	return this1 & 255;
};
lime_math_ARGB.set_b = function(this1,value) {
	this1 = (this1 >>> 24 & 255 & 255) << 24 | (this1 >>> 16 & 255 & 255) << 16 | (this1 >>> 8 & 255 & 255) << 8 | value & 255;
	return value;
};
lime_math_ARGB.get_g = function(this1) {
	return this1 >>> 8 & 255;
};
lime_math_ARGB.set_g = function(this1,value) {
	this1 = (this1 >>> 24 & 255 & 255) << 24 | (this1 >>> 16 & 255 & 255) << 16 | (value & 255) << 8 | this1 & 255 & 255;
	return value;
};
lime_math_ARGB.get_r = function(this1) {
	return this1 >>> 16 & 255;
};
lime_math_ARGB.set_r = function(this1,value) {
	this1 = (this1 >>> 24 & 255 & 255) << 24 | (value & 255) << 16 | (this1 >>> 8 & 255 & 255) << 8 | this1 & 255 & 255;
	return value;
};
var lime_math_BGRA = {};
lime_math_BGRA.__properties__ = {set_r:"set_r",get_r:"get_r",set_g:"set_g",get_g:"get_g",set_b:"set_b",get_b:"get_b",set_a:"set_a",get_a:"get_a"};
lime_math_BGRA._new = function(bgra) {
	if(bgra == null) {
		bgra = 0;
	}
	return bgra;
};
lime_math_BGRA.create = function(b,g,r,a) {
	var bgra = 0;
	bgra = (b & 255) << 24 | (g & 255) << 16 | (r & 255) << 8 | a & 255;
	return bgra;
};
lime_math_BGRA.multiplyAlpha = function(this1) {
	if((this1 & 255) == 0) {
		this1 = 0;
	} else if((this1 & 255) != 255) {
		lime_math_BGRA.a16 = lime_math_RGBA.__alpha16[this1 & 255];
		this1 = ((this1 >>> 24 & 255) * lime_math_BGRA.a16 >> 16 & 255) << 24 | ((this1 >>> 16 & 255) * lime_math_BGRA.a16 >> 16 & 255) << 16 | ((this1 >>> 8 & 255) * lime_math_BGRA.a16 >> 16 & 255) << 8 | this1 & 255 & 255;
	}
};
lime_math_BGRA.readUInt8 = function(this1,data,offset,format,premultiplied) {
	if(premultiplied == null) {
		premultiplied = false;
	}
	if(format == null) {
		format = 0;
	}
	switch(format) {
	case 0:
		this1 = (data[offset + 2] & 255) << 24 | (data[offset + 1] & 255) << 16 | (data[offset] & 255) << 8 | data[offset + 3] & 255;
		break;
	case 1:
		this1 = (data[offset + 3] & 255) << 24 | (data[offset + 2] & 255) << 16 | (data[offset + 1] & 255) << 8 | data[offset] & 255;
		break;
	case 2:
		this1 = (data[offset] & 255) << 24 | (data[offset + 1] & 255) << 16 | (data[offset + 2] & 255) << 8 | data[offset + 3] & 255;
		break;
	}
	if(premultiplied) {
		if((this1 & 255) != 0 && (this1 & 255) != 255) {
			lime_math_BGRA.unmult = 255.0 / (this1 & 255);
			this1 = (lime_math_RGBA.__clamp[Math.floor((this1 >>> 24 & 255) * lime_math_BGRA.unmult)] & 255) << 24 | (lime_math_RGBA.__clamp[Math.floor((this1 >>> 16 & 255) * lime_math_BGRA.unmult)] & 255) << 16 | (lime_math_RGBA.__clamp[Math.floor((this1 >>> 8 & 255) * lime_math_BGRA.unmult)] & 255) << 8 | this1 & 255 & 255;
		}
	}
};
lime_math_BGRA.set = function(this1,b,g,r,a) {
	this1 = (b & 255) << 24 | (g & 255) << 16 | (r & 255) << 8 | a & 255;
};
lime_math_BGRA.unmultiplyAlpha = function(this1) {
	if((this1 & 255) != 0 && (this1 & 255) != 255) {
		lime_math_BGRA.unmult = 255.0 / (this1 & 255);
		this1 = (lime_math_RGBA.__clamp[Math.floor((this1 >>> 24 & 255) * lime_math_BGRA.unmult)] & 255) << 24 | (lime_math_RGBA.__clamp[Math.floor((this1 >>> 16 & 255) * lime_math_BGRA.unmult)] & 255) << 16 | (lime_math_RGBA.__clamp[Math.floor((this1 >>> 8 & 255) * lime_math_BGRA.unmult)] & 255) << 8 | this1 & 255 & 255;
	}
};
lime_math_BGRA.writeUInt8 = function(this1,data,offset,format,premultiplied) {
	if(premultiplied == null) {
		premultiplied = false;
	}
	if(format == null) {
		format = 0;
	}
	if(premultiplied) {
		if((this1 & 255) == 0) {
			this1 = 0;
		} else if((this1 & 255) != 255) {
			lime_math_BGRA.a16 = lime_math_RGBA.__alpha16[this1 & 255];
			this1 = ((this1 >>> 24 & 255) * lime_math_BGRA.a16 >> 16 & 255) << 24 | ((this1 >>> 16 & 255) * lime_math_BGRA.a16 >> 16 & 255) << 16 | ((this1 >>> 8 & 255) * lime_math_BGRA.a16 >> 16 & 255) << 8 | this1 & 255 & 255;
		}
	}
	switch(format) {
	case 0:
		data[offset] = this1 >>> 8 & 255;
		data[offset + 1] = this1 >>> 16 & 255;
		data[offset + 2] = this1 >>> 24 & 255;
		data[offset + 3] = this1 & 255;
		break;
	case 1:
		data[offset] = this1 & 255;
		data[offset + 1] = this1 >>> 8 & 255;
		data[offset + 2] = this1 >>> 16 & 255;
		data[offset + 3] = this1 >>> 24 & 255;
		break;
	case 2:
		data[offset] = this1 >>> 24 & 255;
		data[offset + 1] = this1 >>> 16 & 255;
		data[offset + 2] = this1 >>> 8 & 255;
		data[offset + 3] = this1 & 255;
		break;
	}
};
lime_math_BGRA.__fromARGB = function(argb) {
	var bgra = 0;
	bgra = (argb & 255 & 255) << 24 | (argb >>> 8 & 255 & 255) << 16 | (argb >>> 16 & 255 & 255) << 8 | argb >>> 24 & 255 & 255;
	return bgra;
};
lime_math_BGRA.__fromRGBA = function(rgba) {
	var bgra = 0;
	bgra = (rgba >>> 8 & 255 & 255) << 24 | (rgba >>> 16 & 255 & 255) << 16 | (rgba >>> 24 & 255 & 255) << 8 | rgba & 255 & 255;
	return bgra;
};
lime_math_BGRA.get_a = function(this1) {
	return this1 & 255;
};
lime_math_BGRA.set_a = function(this1,value) {
	this1 = (this1 >>> 24 & 255 & 255) << 24 | (this1 >>> 16 & 255 & 255) << 16 | (this1 >>> 8 & 255 & 255) << 8 | value & 255;
	return value;
};
lime_math_BGRA.get_b = function(this1) {
	return this1 >>> 24 & 255;
};
lime_math_BGRA.set_b = function(this1,value) {
	this1 = (value & 255) << 24 | (this1 >>> 16 & 255 & 255) << 16 | (this1 >>> 8 & 255 & 255) << 8 | this1 & 255 & 255;
	return value;
};
lime_math_BGRA.get_g = function(this1) {
	return this1 >>> 16 & 255;
};
lime_math_BGRA.set_g = function(this1,value) {
	this1 = (this1 >>> 24 & 255 & 255) << 24 | (value & 255) << 16 | (this1 >>> 8 & 255 & 255) << 8 | this1 & 255 & 255;
	return value;
};
lime_math_BGRA.get_r = function(this1) {
	return this1 >>> 8 & 255;
};
lime_math_BGRA.set_r = function(this1,value) {
	this1 = (this1 >>> 24 & 255 & 255) << 24 | (this1 >>> 16 & 255 & 255) << 16 | (value & 255) << 8 | this1 & 255 & 255;
	return value;
};
var lime_math_ColorMatrix = {};
lime_math_ColorMatrix.__properties__ = {set_redOffset:"set_redOffset",get_redOffset:"get_redOffset",set_redMultiplier:"set_redMultiplier",get_redMultiplier:"get_redMultiplier",set_greenOffset:"set_greenOffset",get_greenOffset:"get_greenOffset",set_greenMultiplier:"set_greenMultiplier",get_greenMultiplier:"get_greenMultiplier",set_color:"set_color",get_color:"get_color",set_blueOffset:"set_blueOffset",get_blueOffset:"get_blueOffset",set_blueMultiplier:"set_blueMultiplier",get_blueMultiplier:"get_blueMultiplier",set_alphaOffset:"set_alphaOffset",get_alphaOffset:"get_alphaOffset",set_alphaMultiplier:"set_alphaMultiplier",get_alphaMultiplier:"get_alphaMultiplier"};
lime_math_ColorMatrix._new = function(data) {
	var this1;
	if(data != null && data.length == 20) {
		this1 = data;
	} else {
		var elements = null;
		var array = lime_math_ColorMatrix.__identity;
		var vector = null;
		var view = null;
		var buffer = null;
		var len = null;
		var this2;
		if(elements != null) {
			this2 = new Float32Array(elements);
		} else if(array != null) {
			this2 = new Float32Array(array);
		} else if(vector != null) {
			this2 = new Float32Array(vector.__array);
		} else if(view != null) {
			this2 = new Float32Array(view);
		} else if(buffer != null) {
			if(len == null) {
				this2 = new Float32Array(buffer,0);
			} else {
				this2 = new Float32Array(buffer,0,len);
			}
		} else {
			this2 = null;
		}
		this1 = this2;
	}
	return this1;
};
lime_math_ColorMatrix.clone = function(this1) {
	var elements = null;
	var array = null;
	var vector = null;
	var view = lime_utils_Float32Array.toArrayBufferView(this1);
	var buffer = null;
	var len = null;
	var this1;
	if(elements != null) {
		this1 = new Float32Array(elements);
	} else if(array != null) {
		this1 = new Float32Array(array);
	} else if(vector != null) {
		this1 = new Float32Array(vector.__array);
	} else if(view != null) {
		this1 = new Float32Array(view);
	} else if(buffer != null) {
		if(len == null) {
			this1 = new Float32Array(buffer,0);
		} else {
			this1 = new Float32Array(buffer,0,len);
		}
	} else {
		this1 = null;
	}
	return lime_math_ColorMatrix._new(this1);
};
lime_math_ColorMatrix.concat = function(this1,second) {
	this1[0] += second[0];
	this1[6] += second[6];
	this1[12] += second[12];
	this1[18] += second[18];
};
lime_math_ColorMatrix.copyFrom = function(this1,other) {
	this1.set(other);
};
lime_math_ColorMatrix.identity = function(this1) {
	this1[0] = 1;
	this1[1] = 0;
	this1[2] = 0;
	this1[3] = 0;
	this1[4] = 0;
	this1[5] = 0;
	this1[6] = 1;
	this1[7] = 0;
	this1[8] = 0;
	this1[9] = 0;
	this1[10] = 0;
	this1[11] = 0;
	this1[12] = 1;
	this1[13] = 0;
	this1[14] = 0;
	this1[15] = 0;
	this1[16] = 0;
	this1[17] = 0;
	this1[18] = 1;
	this1[19] = 0;
};
lime_math_ColorMatrix.getAlphaTable = function(this1) {
	if(lime_math_ColorMatrix.__alphaTable == null) {
		var array = null;
		var vector = null;
		var view = null;
		var buffer = null;
		var len = null;
		lime_math_ColorMatrix.__alphaTable = new Uint8Array(256);
	}
	var value;
	lime_math_ColorMatrix.__alphaTable[0] = 0;
	var _g = 1;
	while(_g < 256) {
		var i = _g++;
		value = Math.floor(i * this1[18] + this1[19] * 255);
		if(value > 255) {
			value = 255;
		}
		if(value < 0) {
			value = 0;
		}
		lime_math_ColorMatrix.__alphaTable[i] = value;
	}
	return lime_math_ColorMatrix.__alphaTable;
};
lime_math_ColorMatrix.getBlueTable = function(this1) {
	if(lime_math_ColorMatrix.__blueTable == null) {
		var array = null;
		var vector = null;
		var view = null;
		var buffer = null;
		var len = null;
		lime_math_ColorMatrix.__blueTable = new Uint8Array(256);
	}
	var value;
	var _g = 0;
	while(_g < 256) {
		var i = _g++;
		value = Math.floor(i * this1[12] + this1[14] * 255);
		if(value > 255) {
			value = 255;
		}
		if(value < 0) {
			value = 0;
		}
		lime_math_ColorMatrix.__blueTable[i] = value;
	}
	return lime_math_ColorMatrix.__blueTable;
};
lime_math_ColorMatrix.getGreenTable = function(this1) {
	if(lime_math_ColorMatrix.__greenTable == null) {
		var array = null;
		var vector = null;
		var view = null;
		var buffer = null;
		var len = null;
		lime_math_ColorMatrix.__greenTable = new Uint8Array(256);
	}
	var value;
	var _g = 0;
	while(_g < 256) {
		var i = _g++;
		value = Math.floor(i * this1[6] + this1[9] * 255);
		if(value > 255) {
			value = 255;
		}
		if(value < 0) {
			value = 0;
		}
		lime_math_ColorMatrix.__greenTable[i] = value;
	}
	return lime_math_ColorMatrix.__greenTable;
};
lime_math_ColorMatrix.getRedTable = function(this1) {
	if(lime_math_ColorMatrix.__redTable == null) {
		var array = null;
		var vector = null;
		var view = null;
		var buffer = null;
		var len = null;
		lime_math_ColorMatrix.__redTable = new Uint8Array(256);
	}
	var value;
	var _g = 0;
	while(_g < 256) {
		var i = _g++;
		value = Math.floor(i * this1[0] + this1[4] * 255);
		if(value > 255) {
			value = 255;
		}
		if(value < 0) {
			value = 0;
		}
		lime_math_ColorMatrix.__redTable[i] = value;
	}
	return lime_math_ColorMatrix.__redTable;
};
lime_math_ColorMatrix.__toFlashColorTransform = function(this1) {
	return null;
};
lime_math_ColorMatrix.get_alphaMultiplier = function(this1) {
	return this1[18];
};
lime_math_ColorMatrix.set_alphaMultiplier = function(this1,value) {
	return this1[18] = value;
};
lime_math_ColorMatrix.get_alphaOffset = function(this1) {
	return this1[19] * 255;
};
lime_math_ColorMatrix.set_alphaOffset = function(this1,value) {
	return this1[19] = value / 255;
};
lime_math_ColorMatrix.get_blueMultiplier = function(this1) {
	return this1[12];
};
lime_math_ColorMatrix.set_blueMultiplier = function(this1,value) {
	return this1[12] = value;
};
lime_math_ColorMatrix.get_blueOffset = function(this1) {
	return this1[14] * 255;
};
lime_math_ColorMatrix.set_blueOffset = function(this1,value) {
	return this1[14] = value / 255;
};
lime_math_ColorMatrix.get_color = function(this1) {
	return (this1[4] * 255 | 0) << 16 | (this1[9] * 255 | 0) << 8 | (this1[14] * 255 | 0);
};
lime_math_ColorMatrix.set_color = function(this1,value) {
	this1[4] = (value >> 16 & 255) / 255;
	this1[9] = (value >> 8 & 255) / 255;
	this1[14] = (value & 255) / 255;
	this1[0] = 0;
	this1[6] = 0;
	this1[12] = 0;
	return lime_math_ColorMatrix.get_color(this1);
};
lime_math_ColorMatrix.get_greenMultiplier = function(this1) {
	return this1[6];
};
lime_math_ColorMatrix.set_greenMultiplier = function(this1,value) {
	return this1[6] = value;
};
lime_math_ColorMatrix.get_greenOffset = function(this1) {
	return this1[9] * 255;
};
lime_math_ColorMatrix.set_greenOffset = function(this1,value) {
	return this1[9] = value / 255;
};
lime_math_ColorMatrix.get_redMultiplier = function(this1) {
	return this1[0];
};
lime_math_ColorMatrix.set_redMultiplier = function(this1,value) {
	return this1[0] = value;
};
lime_math_ColorMatrix.get_redOffset = function(this1) {
	return this1[4] * 255;
};
lime_math_ColorMatrix.set_redOffset = function(this1,value) {
	return this1[4] = value / 255;
};
lime_math_ColorMatrix.get = function(this1,index) {
	return this1[index];
};
lime_math_ColorMatrix.set = function(this1,index,value) {
	return this1[index] = value;
};
var lime_math_CairoMatrix3 = function(a,b,c,d,tx,ty) {
	if(ty == null) {
		ty = 0;
	}
	if(tx == null) {
		tx = 0;
	}
	if(d == null) {
		d = 1;
	}
	if(c == null) {
		c = 0;
	}
	if(b == null) {
		b = 0;
	}
	if(a == null) {
		a = 1;
	}
	this.a = a;
	this.b = b;
	this.c = c;
	this.d = d;
	this.tx = tx;
	this.ty = ty;
};
$hxClasses["lime.math.CairoMatrix3"] = lime_math_CairoMatrix3;
lime_math_CairoMatrix3.__name__ = "lime.math.CairoMatrix3";
lime_math_CairoMatrix3.prototype = {
	a: null
	,b: null
	,c: null
	,d: null
	,tx: null
	,ty: null
	,__class__: lime_math_CairoMatrix3
};
var lime_math_Matrix4 = {};
lime_math_Matrix4.__properties__ = {set_position:"set_position",get_position:"get_position",get_determinant:"get_determinant"};
lime_math_Matrix4._new = function(data) {
	var this1;
	if(data != null && data.length == 16) {
		this1 = data;
	} else {
		var elements = null;
		var array = lime_math_Matrix4.__identity;
		var vector = null;
		var view = null;
		var buffer = null;
		var len = null;
		var this2;
		if(elements != null) {
			this2 = new Float32Array(elements);
		} else if(array != null) {
			this2 = new Float32Array(array);
		} else if(vector != null) {
			this2 = new Float32Array(vector.__array);
		} else if(view != null) {
			this2 = new Float32Array(view);
		} else if(buffer != null) {
			if(len == null) {
				this2 = new Float32Array(buffer,0);
			} else {
				this2 = new Float32Array(buffer,0,len);
			}
		} else {
			this2 = null;
		}
		this1 = this2;
	}
	return this1;
};
lime_math_Matrix4.append = function(this1,lhs) {
	var m111 = this1[0];
	var m121 = this1[4];
	var m131 = this1[8];
	var m141 = this1[12];
	var m112 = this1[1];
	var m122 = this1[5];
	var m132 = this1[9];
	var m142 = this1[13];
	var m113 = this1[2];
	var m123 = this1[6];
	var m133 = this1[10];
	var m143 = this1[14];
	var m114 = this1[3];
	var m124 = this1[7];
	var m134 = this1[11];
	var m144 = this1[15];
	var m211 = lime_math_Matrix4.get(lhs,0);
	var m221 = lime_math_Matrix4.get(lhs,4);
	var m231 = lime_math_Matrix4.get(lhs,8);
	var m241 = lime_math_Matrix4.get(lhs,12);
	var m212 = lime_math_Matrix4.get(lhs,1);
	var m222 = lime_math_Matrix4.get(lhs,5);
	var m232 = lime_math_Matrix4.get(lhs,9);
	var m242 = lime_math_Matrix4.get(lhs,13);
	var m213 = lime_math_Matrix4.get(lhs,2);
	var m223 = lime_math_Matrix4.get(lhs,6);
	var m233 = lime_math_Matrix4.get(lhs,10);
	var m243 = lime_math_Matrix4.get(lhs,14);
	var m214 = lime_math_Matrix4.get(lhs,3);
	var m224 = lime_math_Matrix4.get(lhs,7);
	var m234 = lime_math_Matrix4.get(lhs,11);
	var m244 = lime_math_Matrix4.get(lhs,15);
	this1[0] = m111 * m211 + m112 * m221 + m113 * m231 + m114 * m241;
	this1[1] = m111 * m212 + m112 * m222 + m113 * m232 + m114 * m242;
	this1[2] = m111 * m213 + m112 * m223 + m113 * m233 + m114 * m243;
	this1[3] = m111 * m214 + m112 * m224 + m113 * m234 + m114 * m244;
	this1[4] = m121 * m211 + m122 * m221 + m123 * m231 + m124 * m241;
	this1[5] = m121 * m212 + m122 * m222 + m123 * m232 + m124 * m242;
	this1[6] = m121 * m213 + m122 * m223 + m123 * m233 + m124 * m243;
	this1[7] = m121 * m214 + m122 * m224 + m123 * m234 + m124 * m244;
	this1[8] = m131 * m211 + m132 * m221 + m133 * m231 + m134 * m241;
	this1[9] = m131 * m212 + m132 * m222 + m133 * m232 + m134 * m242;
	this1[10] = m131 * m213 + m132 * m223 + m133 * m233 + m134 * m243;
	this1[11] = m131 * m214 + m132 * m224 + m133 * m234 + m134 * m244;
	this1[12] = m141 * m211 + m142 * m221 + m143 * m231 + m144 * m241;
	this1[13] = m141 * m212 + m142 * m222 + m143 * m232 + m144 * m242;
	this1[14] = m141 * m213 + m142 * m223 + m143 * m233 + m144 * m243;
	this1[15] = m141 * m214 + m142 * m224 + m143 * m234 + m144 * m244;
};
lime_math_Matrix4.appendRotation = function(this1,degrees,axis,pivotPoint) {
	var m = lime_math_Matrix4.__getAxisRotation(this1,axis.x,axis.y,axis.z,degrees);
	if(pivotPoint != null) {
		var p = pivotPoint;
		lime_math_Matrix4.appendTranslation(m,p.x,p.y,p.z);
	}
	lime_math_Matrix4.append(this1,m);
};
lime_math_Matrix4.appendScale = function(this1,xScale,yScale,zScale) {
	var elements = null;
	var array = [xScale,0.0,0.0,0.0,0.0,yScale,0.0,0.0,0.0,0.0,zScale,0.0,0.0,0.0,0.0,1.0];
	var vector = null;
	var view = null;
	var buffer = null;
	var len = null;
	var this2;
	if(elements != null) {
		this2 = new Float32Array(elements);
	} else if(array != null) {
		this2 = new Float32Array(array);
	} else if(vector != null) {
		this2 = new Float32Array(vector.__array);
	} else if(view != null) {
		this2 = new Float32Array(view);
	} else if(buffer != null) {
		if(len == null) {
			this2 = new Float32Array(buffer,0);
		} else {
			this2 = new Float32Array(buffer,0,len);
		}
	} else {
		this2 = null;
	}
	lime_math_Matrix4.append(this1,lime_math_Matrix4._new(this2));
};
lime_math_Matrix4.appendTranslation = function(this1,x,y,z) {
	this1[12] += x;
	this1[13] += y;
	this1[14] += z;
};
lime_math_Matrix4.clone = function(this1) {
	var elements = null;
	var array = null;
	var vector = null;
	var view = lime_utils_Float32Array.toArrayBufferView(this1);
	var buffer = null;
	var len = null;
	var this1;
	if(elements != null) {
		this1 = new Float32Array(elements);
	} else if(array != null) {
		this1 = new Float32Array(array);
	} else if(vector != null) {
		this1 = new Float32Array(vector.__array);
	} else if(view != null) {
		this1 = new Float32Array(view);
	} else if(buffer != null) {
		if(len == null) {
			this1 = new Float32Array(buffer,0);
		} else {
			this1 = new Float32Array(buffer,0,len);
		}
	} else {
		this1 = null;
	}
	return lime_math_Matrix4._new(this1);
};
lime_math_Matrix4.copyColumnFrom = function(this1,column,vector) {
	switch(column) {
	case 0:
		this1[0] = vector.x;
		this1[1] = vector.y;
		this1[2] = vector.z;
		this1[3] = vector.w;
		break;
	case 1:
		this1[4] = vector.x;
		this1[5] = vector.y;
		this1[6] = vector.z;
		this1[7] = vector.w;
		break;
	case 2:
		this1[8] = vector.x;
		this1[9] = vector.y;
		this1[10] = vector.z;
		this1[11] = vector.w;
		break;
	case 3:
		this1[12] = vector.x;
		this1[13] = vector.y;
		this1[14] = vector.z;
		this1[15] = vector.w;
		break;
	default:
		lime_utils_Log.error("Column " + column + " out of bounds [0, ..., 3]",{ fileName : "lime/math/Matrix4.hx", lineNumber : 187, className : "lime.math._Matrix4.Matrix4_Impl_", methodName : "copyColumnFrom"});
	}
};
lime_math_Matrix4.copyColumnTo = function(this1,column,vector) {
	switch(column) {
	case 0:
		vector.x = this1[0];
		vector.y = this1[1];
		vector.z = this1[2];
		vector.w = this1[3];
		break;
	case 1:
		vector.x = this1[4];
		vector.y = this1[5];
		vector.z = this1[6];
		vector.w = this1[7];
		break;
	case 2:
		vector.x = this1[8];
		vector.y = this1[9];
		vector.z = this1[10];
		vector.w = this1[11];
		break;
	case 3:
		vector.x = this1[12];
		vector.y = this1[13];
		vector.z = this1[14];
		vector.w = this1[15];
		break;
	default:
		lime_utils_Log.error("Column " + column + " out of bounds [0, ..., 3]",{ fileName : "lime/math/Matrix4.hx", lineNumber : 225, className : "lime.math._Matrix4.Matrix4_Impl_", methodName : "copyColumnTo"});
	}
};
lime_math_Matrix4.copyFrom = function(this1,other) {
	this1.set(other);
};
lime_math_Matrix4.copyRowFrom = function(this1,row,vector) {
	switch(row) {
	case 0:
		this1[0] = vector.x;
		this1[4] = vector.y;
		this1[8] = vector.z;
		this1[12] = vector.w;
		break;
	case 1:
		this1[1] = vector.x;
		this1[5] = vector.y;
		this1[9] = vector.z;
		this1[13] = vector.w;
		break;
	case 2:
		this1[2] = vector.x;
		this1[6] = vector.y;
		this1[10] = vector.z;
		this1[14] = vector.w;
		break;
	case 3:
		this1[3] = vector.x;
		this1[7] = vector.y;
		this1[11] = vector.z;
		this1[15] = vector.w;
		break;
	default:
		lime_utils_Log.error("Row " + row + " out of bounds [0, ..., 3]",{ fileName : "lime/math/Matrix4.hx", lineNumber : 272, className : "lime.math._Matrix4.Matrix4_Impl_", methodName : "copyRowFrom"});
	}
};
lime_math_Matrix4.copyRowTo = function(this1,row,vector) {
	switch(row) {
	case 0:
		vector.x = this1[0];
		vector.y = this1[4];
		vector.z = this1[8];
		vector.w = this1[12];
		break;
	case 1:
		vector.x = this1[1];
		vector.y = this1[5];
		vector.z = this1[9];
		vector.w = this1[13];
		break;
	case 2:
		vector.x = this1[2];
		vector.y = this1[6];
		vector.z = this1[10];
		vector.w = this1[14];
		break;
	case 3:
		vector.x = this1[3];
		vector.y = this1[7];
		vector.z = this1[11];
		vector.w = this1[15];
		break;
	default:
		lime_utils_Log.error("Row " + row + " out of bounds [0, ..., 3]",{ fileName : "lime/math/Matrix4.hx", lineNumber : 310, className : "lime.math._Matrix4.Matrix4_Impl_", methodName : "copyRowTo"});
	}
};
lime_math_Matrix4.create2D = function(this1,a,b,c,d,tx,ty) {
	if(ty == null) {
		ty = 0;
	}
	if(tx == null) {
		tx = 0;
	}
	this1[0] = a;
	this1[1] = b;
	this1[2] = 0;
	this1[3] = 0;
	this1[4] = c;
	this1[5] = d;
	this1[6] = 0;
	this1[7] = 0;
	this1[8] = 0;
	this1[9] = 0;
	this1[10] = 1;
	this1[11] = 0;
	this1[12] = tx;
	this1[13] = ty;
	this1[14] = 0;
	this1[15] = 1;
};
lime_math_Matrix4.createOrtho = function(this1,left,right,bottom,top,zNear,zFar) {
	var sx = 1.0 / (right - left);
	var sy = 1.0 / (top - bottom);
	var sz = 1.0 / (zFar - zNear);
	this1[0] = 2 * sx;
	this1[1] = 0;
	this1[2] = 0;
	this1[3] = 0;
	this1[4] = 0;
	this1[5] = 2 * sy;
	this1[6] = 0;
	this1[7] = 0;
	this1[8] = 0;
	this1[9] = 0;
	this1[10] = -2 * sz;
	this1[11] = 0;
	this1[12] = -(left + right) * sx;
	this1[13] = -(bottom + top) * sy;
	this1[14] = -(zNear + zFar) * sz;
	this1[15] = 1;
};
lime_math_Matrix4.createPerspective = function(this1,fov,aspect,zNear,zFar) {
	if(aspect > -0.0000001 && aspect < 0.0000001) {
		throw haxe_Exception.thrown("Aspect ratio may not be 0");
	}
	var top = fov * zNear;
	var bottom = -top;
	var right = top * aspect;
	var left = -right;
	this1[0] = 2.0 * zNear / (right - left);
	this1[1] = 0;
	this1[2] = 0;
	this1[3] = 0;
	this1[4] = 0;
	this1[5] = 2.0 * zNear / (top - bottom);
	this1[6] = 0;
	this1[7] = 0;
	this1[8] = (right + left) / (right - left);
	this1[9] = (top + bottom) / (top - bottom);
	this1[10] = -(zFar + zNear) / (zFar - zNear);
	this1[11] = -1.0;
	this1[12] = 0;
	this1[13] = 0;
	this1[14] = -2 * zFar * zNear / (zFar - zNear);
	this1[15] = 1;
};
lime_math_Matrix4.deltaTransformVector = function(this1,v,result) {
	if(result == null) {
		result = new lime_math_Vector4();
	}
	var x = v.x;
	var y = v.y;
	var z = v.z;
	result.x = x * this1[0] + y * this1[4] + z * this1[8] + this1[3];
	result.y = x * this1[1] + y * this1[5] + z * this1[9] + this1[7];
	result.z = x * this1[2] + y * this1[6] + z * this1[10] + this1[11];
	return result;
};
lime_math_Matrix4.fromMatrix3 = function(matrix3) {
	var mat = lime_math_Matrix4._new();
	lime_math_Matrix4.create2D(mat,matrix3[0],matrix3[1],matrix3[3],matrix3[4],matrix3[6],matrix3[7]);
	return mat;
};
lime_math_Matrix4.identity = function(this1) {
	this1[0] = 1;
	this1[1] = 0;
	this1[2] = 0;
	this1[3] = 0;
	this1[4] = 0;
	this1[5] = 1;
	this1[6] = 0;
	this1[7] = 0;
	this1[8] = 0;
	this1[9] = 0;
	this1[10] = 1;
	this1[11] = 0;
	this1[12] = 0;
	this1[13] = 0;
	this1[14] = 0;
	this1[15] = 1;
};
lime_math_Matrix4.interpolate = function(thisMat,toMat,percent,result) {
	if(result == null) {
		result = lime_math_Matrix4._new();
	}
	var _g = 0;
	while(_g < 16) {
		var i = _g++;
		lime_math_Matrix4.set(result,i,lime_math_Matrix4.get(thisMat,i) + (lime_math_Matrix4.get(toMat,i) - lime_math_Matrix4.get(thisMat,i)) * percent);
	}
	return result;
};
lime_math_Matrix4.interpolateTo = function(this1,toMat,percent) {
	var _g = 0;
	while(_g < 16) {
		var i = _g++;
		this1[i] += (lime_math_Matrix4.get(toMat,i) - this1[i]) * percent;
	}
};
lime_math_Matrix4.invert = function(this1) {
	var d = lime_math_Matrix4.get_determinant(this1);
	var invertable = Math.abs(d) > 0.00000000001;
	if(invertable) {
		d = 1 / d;
		var m11 = this1[0];
		var m21 = this1[4];
		var m31 = this1[8];
		var m41 = this1[12];
		var m12 = this1[1];
		var m22 = this1[5];
		var m32 = this1[9];
		var m42 = this1[13];
		var m13 = this1[2];
		var m23 = this1[6];
		var m33 = this1[10];
		var m43 = this1[14];
		var m14 = this1[3];
		var m24 = this1[7];
		var m34 = this1[11];
		var m44 = this1[15];
		this1[0] = d * (m22 * (m33 * m44 - m43 * m34) - m32 * (m23 * m44 - m43 * m24) + m42 * (m23 * m34 - m33 * m24));
		this1[1] = -d * (m12 * (m33 * m44 - m43 * m34) - m32 * (m13 * m44 - m43 * m14) + m42 * (m13 * m34 - m33 * m14));
		this1[2] = d * (m12 * (m23 * m44 - m43 * m24) - m22 * (m13 * m44 - m43 * m14) + m42 * (m13 * m24 - m23 * m14));
		this1[3] = -d * (m12 * (m23 * m34 - m33 * m24) - m22 * (m13 * m34 - m33 * m14) + m32 * (m13 * m24 - m23 * m14));
		this1[4] = -d * (m21 * (m33 * m44 - m43 * m34) - m31 * (m23 * m44 - m43 * m24) + m41 * (m23 * m34 - m33 * m24));
		this1[5] = d * (m11 * (m33 * m44 - m43 * m34) - m31 * (m13 * m44 - m43 * m14) + m41 * (m13 * m34 - m33 * m14));
		this1[6] = -d * (m11 * (m23 * m44 - m43 * m24) - m21 * (m13 * m44 - m43 * m14) + m41 * (m13 * m24 - m23 * m14));
		this1[7] = d * (m11 * (m23 * m34 - m33 * m24) - m21 * (m13 * m34 - m33 * m14) + m31 * (m13 * m24 - m23 * m14));
		this1[8] = d * (m21 * (m32 * m44 - m42 * m34) - m31 * (m22 * m44 - m42 * m24) + m41 * (m22 * m34 - m32 * m24));
		this1[9] = -d * (m11 * (m32 * m44 - m42 * m34) - m31 * (m12 * m44 - m42 * m14) + m41 * (m12 * m34 - m32 * m14));
		this1[10] = d * (m11 * (m22 * m44 - m42 * m24) - m21 * (m12 * m44 - m42 * m14) + m41 * (m12 * m24 - m22 * m14));
		this1[11] = -d * (m11 * (m22 * m34 - m32 * m24) - m21 * (m12 * m34 - m32 * m14) + m31 * (m12 * m24 - m22 * m14));
		this1[12] = -d * (m21 * (m32 * m43 - m42 * m33) - m31 * (m22 * m43 - m42 * m23) + m41 * (m22 * m33 - m32 * m23));
		this1[13] = d * (m11 * (m32 * m43 - m42 * m33) - m31 * (m12 * m43 - m42 * m13) + m41 * (m12 * m33 - m32 * m13));
		this1[14] = -d * (m11 * (m22 * m43 - m42 * m23) - m21 * (m12 * m43 - m42 * m13) + m41 * (m12 * m23 - m22 * m13));
		this1[15] = d * (m11 * (m22 * m33 - m32 * m23) - m21 * (m12 * m33 - m32 * m13) + m31 * (m12 * m23 - m22 * m13));
	}
	return invertable;
};
lime_math_Matrix4.pointAt = function(this1,pos,at,up) {
	if(at == null) {
		at = new lime_math_Vector4(0,0,1);
	}
	if(up == null) {
		up = new lime_math_Vector4(0,1,0);
	}
	var result = null;
	if(result == null) {
		result = new lime_math_Vector4();
	}
	result.x = pos.x - at.x;
	result.y = pos.y - at.y;
	result.z = pos.z - at.z;
	var dir = result;
	var vup = new lime_math_Vector4(up.x,up.y,up.z,up.w);
	var l = Math.sqrt(dir.x * dir.x + dir.y * dir.y + dir.z * dir.z);
	if(l != 0) {
		dir.x /= l;
		dir.y /= l;
		dir.z /= l;
	}
	var l = Math.sqrt(vup.x * vup.x + vup.y * vup.y + vup.z * vup.z);
	if(l != 0) {
		vup.x /= l;
		vup.y /= l;
		vup.z /= l;
	}
	var dir2 = new lime_math_Vector4(dir.x,dir.y,dir.z,dir.w);
	var s = vup.x * dir.x + vup.y * dir.y + vup.z * dir.z;
	dir2.x *= s;
	dir2.y *= s;
	dir2.z *= s;
	var result = null;
	if(result == null) {
		result = new lime_math_Vector4();
	}
	result.x = vup.x - dir2.x;
	result.y = vup.y - dir2.y;
	result.z = vup.z - dir2.z;
	vup = result;
	if(Math.sqrt(vup.x * vup.x + vup.y * vup.y + vup.z * vup.z) > 0) {
		var l = Math.sqrt(vup.x * vup.x + vup.y * vup.y + vup.z * vup.z);
		if(l != 0) {
			vup.x /= l;
			vup.y /= l;
			vup.z /= l;
		}
	} else if(dir.x != 0) {
		vup = new lime_math_Vector4(-dir.y,dir.x,0);
	} else {
		vup = new lime_math_Vector4(1,0,0);
	}
	var result = null;
	if(result == null) {
		result = new lime_math_Vector4();
	}
	var ya = vup.z * dir.x - vup.x * dir.z;
	var za = vup.x * dir.y - vup.y * dir.x;
	result.x = vup.y * dir.z - vup.z * dir.y;
	result.y = ya;
	result.z = za;
	result.w = 1;
	var right = result;
	var l = Math.sqrt(right.x * right.x + right.y * right.y + right.z * right.z);
	if(l != 0) {
		right.x /= l;
		right.y /= l;
		right.z /= l;
	}
	this1[0] = right.x;
	this1[4] = right.y;
	this1[8] = right.z;
	this1[12] = 0.0;
	this1[1] = vup.x;
	this1[5] = vup.y;
	this1[9] = vup.z;
	this1[13] = 0.0;
	this1[2] = dir.x;
	this1[6] = dir.y;
	this1[10] = dir.z;
	this1[14] = 0.0;
	this1[3] = pos.x;
	this1[7] = pos.y;
	this1[11] = pos.z;
	this1[15] = 1.0;
};
lime_math_Matrix4.prepend = function(this1,rhs) {
	var m111 = lime_math_Matrix4.get(rhs,0);
	var m121 = lime_math_Matrix4.get(rhs,4);
	var m131 = lime_math_Matrix4.get(rhs,8);
	var m141 = lime_math_Matrix4.get(rhs,12);
	var m112 = lime_math_Matrix4.get(rhs,1);
	var m122 = lime_math_Matrix4.get(rhs,5);
	var m132 = lime_math_Matrix4.get(rhs,9);
	var m142 = lime_math_Matrix4.get(rhs,13);
	var m113 = lime_math_Matrix4.get(rhs,2);
	var m123 = lime_math_Matrix4.get(rhs,6);
	var m133 = lime_math_Matrix4.get(rhs,10);
	var m143 = lime_math_Matrix4.get(rhs,14);
	var m114 = lime_math_Matrix4.get(rhs,3);
	var m124 = lime_math_Matrix4.get(rhs,7);
	var m134 = lime_math_Matrix4.get(rhs,11);
	var m144 = lime_math_Matrix4.get(rhs,15);
	var m211 = this1[0];
	var m221 = this1[4];
	var m231 = this1[8];
	var m241 = this1[12];
	var m212 = this1[1];
	var m222 = this1[5];
	var m232 = this1[9];
	var m242 = this1[13];
	var m213 = this1[2];
	var m223 = this1[6];
	var m233 = this1[10];
	var m243 = this1[14];
	var m214 = this1[3];
	var m224 = this1[7];
	var m234 = this1[11];
	var m244 = this1[15];
	this1[0] = m111 * m211 + m112 * m221 + m113 * m231 + m114 * m241;
	this1[1] = m111 * m212 + m112 * m222 + m113 * m232 + m114 * m242;
	this1[2] = m111 * m213 + m112 * m223 + m113 * m233 + m114 * m243;
	this1[3] = m111 * m214 + m112 * m224 + m113 * m234 + m114 * m244;
	this1[4] = m121 * m211 + m122 * m221 + m123 * m231 + m124 * m241;
	this1[5] = m121 * m212 + m122 * m222 + m123 * m232 + m124 * m242;
	this1[6] = m121 * m213 + m122 * m223 + m123 * m233 + m124 * m243;
	this1[7] = m121 * m214 + m122 * m224 + m123 * m234 + m124 * m244;
	this1[8] = m131 * m211 + m132 * m221 + m133 * m231 + m134 * m241;
	this1[9] = m131 * m212 + m132 * m222 + m133 * m232 + m134 * m242;
	this1[10] = m131 * m213 + m132 * m223 + m133 * m233 + m134 * m243;
	this1[11] = m131 * m214 + m132 * m224 + m133 * m234 + m134 * m244;
	this1[12] = m141 * m211 + m142 * m221 + m143 * m231 + m144 * m241;
	this1[13] = m141 * m212 + m142 * m222 + m143 * m232 + m144 * m242;
	this1[14] = m141 * m213 + m142 * m223 + m143 * m233 + m144 * m243;
	this1[15] = m141 * m214 + m142 * m224 + m143 * m234 + m144 * m244;
};
lime_math_Matrix4.prependRotation = function(this1,degrees,axis,pivotPoint) {
	var m = lime_math_Matrix4.__getAxisRotation(this1,axis.x,axis.y,axis.z,degrees);
	if(pivotPoint != null) {
		var p = pivotPoint;
		lime_math_Matrix4.appendTranslation(m,p.x,p.y,p.z);
	}
	lime_math_Matrix4.prepend(this1,m);
};
lime_math_Matrix4.prependScale = function(this1,xScale,yScale,zScale) {
	var elements = null;
	var array = [xScale,0.0,0.0,0.0,0.0,yScale,0.0,0.0,0.0,0.0,zScale,0.0,0.0,0.0,0.0,1.0];
	var vector = null;
	var view = null;
	var buffer = null;
	var len = null;
	var this2;
	if(elements != null) {
		this2 = new Float32Array(elements);
	} else if(array != null) {
		this2 = new Float32Array(array);
	} else if(vector != null) {
		this2 = new Float32Array(vector.__array);
	} else if(view != null) {
		this2 = new Float32Array(view);
	} else if(buffer != null) {
		if(len == null) {
			this2 = new Float32Array(buffer,0);
		} else {
			this2 = new Float32Array(buffer,0,len);
		}
	} else {
		this2 = null;
	}
	lime_math_Matrix4.prepend(this1,lime_math_Matrix4._new(this2));
};
lime_math_Matrix4.prependTranslation = function(this1,x,y,z) {
	var m = lime_math_Matrix4._new();
	lime_math_Matrix4.set_position(m,new lime_math_Vector4(x,y,z));
	lime_math_Matrix4.prepend(this1,m);
};
lime_math_Matrix4.transformVector = function(this1,v,result) {
	if(result == null) {
		result = new lime_math_Vector4();
	}
	var x = v.x;
	var y = v.y;
	var z = v.z;
	result.x = x * this1[0] + y * this1[4] + z * this1[8] + this1[12];
	result.y = x * this1[1] + y * this1[5] + z * this1[9] + this1[13];
	result.z = x * this1[2] + y * this1[6] + z * this1[10] + this1[14];
	result.w = x * this1[3] + y * this1[7] + z * this1[11] + this1[15];
	return result;
};
lime_math_Matrix4.transformVectors = function(this1,ain,aout) {
	var i = 0;
	var x;
	var y;
	var z;
	while(i + 3 <= ain.length) {
		x = ain[i];
		y = ain[i + 1];
		z = ain[i + 2];
		aout[i] = x * this1[0] + y * this1[4] + z * this1[8] + this1[12];
		aout[i + 1] = x * this1[1] + y * this1[5] + z * this1[9] + this1[13];
		aout[i + 2] = x * this1[2] + y * this1[6] + z * this1[10] + this1[14];
		i += 3;
	}
};
lime_math_Matrix4.transpose = function(this1) {
	var temp = this1[1];
	this1[1] = this1[4];
	this1[4] = temp;
	var temp = this1[2];
	this1[2] = this1[8];
	this1[8] = temp;
	var temp = this1[3];
	this1[3] = this1[12];
	this1[12] = temp;
	var temp = this1[6];
	this1[6] = this1[9];
	this1[9] = temp;
	var temp = this1[7];
	this1[7] = this1[13];
	this1[13] = temp;
	var temp = this1[11];
	this1[11] = this1[14];
	this1[14] = temp;
};
lime_math_Matrix4.__getAxisRotation = function(this1,x,y,z,degrees) {
	var m = lime_math_Matrix4._new();
	var a1 = new lime_math_Vector4(x,y,z);
	var rad = -degrees * (Math.PI / 180);
	var c = Math.cos(rad);
	var s = Math.sin(rad);
	var t = 1.0 - c;
	lime_math_Matrix4.set(m,0,c + a1.x * a1.x * t);
	lime_math_Matrix4.set(m,5,c + a1.y * a1.y * t);
	lime_math_Matrix4.set(m,10,c + a1.z * a1.z * t);
	var tmp1 = a1.x * a1.y * t;
	var tmp2 = a1.z * s;
	lime_math_Matrix4.set(m,4,tmp1 + tmp2);
	lime_math_Matrix4.set(m,1,tmp1 - tmp2);
	tmp1 = a1.x * a1.z * t;
	tmp2 = a1.y * s;
	lime_math_Matrix4.set(m,8,tmp1 - tmp2);
	lime_math_Matrix4.set(m,2,tmp1 + tmp2);
	tmp1 = a1.y * a1.z * t;
	tmp2 = a1.x * s;
	lime_math_Matrix4.set(m,9,tmp1 + tmp2);
	lime_math_Matrix4.set(m,6,tmp1 - tmp2);
	return m;
};
lime_math_Matrix4.__swap = function(this1,a,b) {
	var temp = this1[a];
	this1[a] = this1[b];
	this1[b] = temp;
};
lime_math_Matrix4.get_determinant = function(this1) {
	return (this1[0] * this1[5] - this1[4] * this1[1]) * (this1[10] * this1[15] - this1[14] * this1[11]) - (this1[0] * this1[9] - this1[8] * this1[1]) * (this1[6] * this1[15] - this1[14] * this1[7]) + (this1[0] * this1[13] - this1[12] * this1[1]) * (this1[6] * this1[11] - this1[10] * this1[7]) + (this1[4] * this1[9] - this1[8] * this1[5]) * (this1[2] * this1[15] - this1[14] * this1[3]) - (this1[4] * this1[13] - this1[12] * this1[5]) * (this1[2] * this1[11] - this1[10] * this1[3]) + (this1[8] * this1[13] - this1[12] * this1[9]) * (this1[2] * this1[7] - this1[6] * this1[3]);
};
lime_math_Matrix4.get_position = function(this1) {
	return new lime_math_Vector4(this1[12],this1[13],this1[14]);
};
lime_math_Matrix4.set_position = function(this1,val) {
	this1[12] = val.x;
	this1[13] = val.y;
	this1[14] = val.z;
	return val;
};
lime_math_Matrix4.get = function(this1,index) {
	return this1[index];
};
lime_math_Matrix4.set = function(this1,index,value) {
	this1[index] = value;
	return value;
};
var lime_math_RGBA = {};
lime_math_RGBA.__properties__ = {set_r:"set_r",get_r:"get_r",set_g:"set_g",get_g:"get_g",set_b:"set_b",get_b:"get_b",set_a:"set_a",get_a:"get_a"};
lime_math_RGBA._new = function(rgba) {
	if(rgba == null) {
		rgba = 0;
	}
	return rgba;
};
lime_math_RGBA.create = function(r,g,b,a) {
	var rgba = 0;
	rgba = (r & 255) << 24 | (g & 255) << 16 | (b & 255) << 8 | a & 255;
	return rgba;
};
lime_math_RGBA.multiplyAlpha = function(this1) {
	if((this1 & 255) == 0) {
		if(this1 != 0) {
			this1 = 0;
		}
	} else if((this1 & 255) != 255) {
		lime_math_RGBA.a16 = lime_math_RGBA.__alpha16[this1 & 255];
		this1 = ((this1 >>> 24 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 24 | ((this1 >>> 16 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 16 | ((this1 >>> 8 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 8 | this1 & 255 & 255;
	}
};
lime_math_RGBA.readUInt8 = function(this1,data,offset,format,premultiplied) {
	if(premultiplied == null) {
		premultiplied = false;
	}
	if(format == null) {
		format = 0;
	}
	switch(format) {
	case 0:
		this1 = (data[offset] & 255) << 24 | (data[offset + 1] & 255) << 16 | (data[offset + 2] & 255) << 8 | data[offset + 3] & 255;
		break;
	case 1:
		this1 = (data[offset + 1] & 255) << 24 | (data[offset + 2] & 255) << 16 | (data[offset + 3] & 255) << 8 | data[offset] & 255;
		break;
	case 2:
		this1 = (data[offset + 2] & 255) << 24 | (data[offset + 1] & 255) << 16 | (data[offset] & 255) << 8 | data[offset + 3] & 255;
		break;
	}
	if(premultiplied) {
		if((this1 & 255) != 0 && (this1 & 255) != 255) {
			lime_math_RGBA.unmult = 255.0 / (this1 & 255);
			this1 = (lime_math_RGBA.__clamp[Math.round((this1 >>> 24 & 255) * lime_math_RGBA.unmult)] & 255) << 24 | (lime_math_RGBA.__clamp[Math.round((this1 >>> 16 & 255) * lime_math_RGBA.unmult)] & 255) << 16 | (lime_math_RGBA.__clamp[Math.round((this1 >>> 8 & 255) * lime_math_RGBA.unmult)] & 255) << 8 | this1 & 255 & 255;
		}
	}
};
lime_math_RGBA.set = function(this1,r,g,b,a) {
	this1 = (r & 255) << 24 | (g & 255) << 16 | (b & 255) << 8 | a & 255;
};
lime_math_RGBA.unmultiplyAlpha = function(this1) {
	if((this1 & 255) != 0 && (this1 & 255) != 255) {
		lime_math_RGBA.unmult = 255.0 / (this1 & 255);
		this1 = (lime_math_RGBA.__clamp[Math.round((this1 >>> 24 & 255) * lime_math_RGBA.unmult)] & 255) << 24 | (lime_math_RGBA.__clamp[Math.round((this1 >>> 16 & 255) * lime_math_RGBA.unmult)] & 255) << 16 | (lime_math_RGBA.__clamp[Math.round((this1 >>> 8 & 255) * lime_math_RGBA.unmult)] & 255) << 8 | this1 & 255 & 255;
	}
};
lime_math_RGBA.writeUInt8 = function(this1,data,offset,format,premultiplied) {
	if(premultiplied == null) {
		premultiplied = false;
	}
	if(format == null) {
		format = 0;
	}
	if(premultiplied) {
		if((this1 & 255) == 0) {
			if(this1 != 0) {
				this1 = 0;
			}
		} else if((this1 & 255) != 255) {
			lime_math_RGBA.a16 = lime_math_RGBA.__alpha16[this1 & 255];
			this1 = ((this1 >>> 24 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 24 | ((this1 >>> 16 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 16 | ((this1 >>> 8 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 8 | this1 & 255 & 255;
		}
	}
	switch(format) {
	case 0:
		data[offset] = this1 >>> 24 & 255;
		data[offset + 1] = this1 >>> 16 & 255;
		data[offset + 2] = this1 >>> 8 & 255;
		data[offset + 3] = this1 & 255;
		break;
	case 1:
		data[offset] = this1 & 255;
		data[offset + 1] = this1 >>> 24 & 255;
		data[offset + 2] = this1 >>> 16 & 255;
		data[offset + 3] = this1 >>> 8 & 255;
		break;
	case 2:
		data[offset] = this1 >>> 8 & 255;
		data[offset + 1] = this1 >>> 16 & 255;
		data[offset + 2] = this1 >>> 24 & 255;
		data[offset + 3] = this1 & 255;
		break;
	}
};
lime_math_RGBA.__fromARGB = function(argb) {
	var rgba = 0;
	rgba = (argb >>> 16 & 255 & 255) << 24 | (argb >>> 8 & 255 & 255) << 16 | (argb & 255 & 255) << 8 | argb >>> 24 & 255 & 255;
	return rgba;
};
lime_math_RGBA.__fromBGRA = function(bgra) {
	var rgba = 0;
	rgba = (bgra >>> 8 & 255 & 255) << 24 | (bgra >>> 16 & 255 & 255) << 16 | (bgra >>> 24 & 255 & 255) << 8 | bgra & 255 & 255;
	return rgba;
};
lime_math_RGBA.get_a = function(this1) {
	return this1 & 255;
};
lime_math_RGBA.set_a = function(this1,value) {
	this1 = (this1 >>> 24 & 255 & 255) << 24 | (this1 >>> 16 & 255 & 255) << 16 | (this1 >>> 8 & 255 & 255) << 8 | value & 255;
	return value;
};
lime_math_RGBA.get_b = function(this1) {
	return this1 >>> 8 & 255;
};
lime_math_RGBA.set_b = function(this1,value) {
	this1 = (this1 >>> 24 & 255 & 255) << 24 | (this1 >>> 16 & 255 & 255) << 16 | (value & 255) << 8 | this1 & 255 & 255;
	return value;
};
lime_math_RGBA.get_g = function(this1) {
	return this1 >>> 16 & 255;
};
lime_math_RGBA.set_g = function(this1,value) {
	this1 = (this1 >>> 24 & 255 & 255) << 24 | (value & 255) << 16 | (this1 >>> 8 & 255 & 255) << 8 | this1 & 255 & 255;
	return value;
};
lime_math_RGBA.get_r = function(this1) {
	return this1 >>> 24 & 255;
};
lime_math_RGBA.set_r = function(this1,value) {
	this1 = (value & 255) << 24 | (this1 >>> 16 & 255 & 255) << 16 | (this1 >>> 8 & 255 & 255) << 8 | this1 & 255 & 255;
	return value;
};
var lime_math_Rectangle = function(x,y,width,height) {
	if(height == null) {
		height = 0;
	}
	if(width == null) {
		width = 0;
	}
	if(y == null) {
		y = 0;
	}
	if(x == null) {
		x = 0;
	}
	this.x = x;
	this.y = y;
	this.width = width;
	this.height = height;
};
$hxClasses["lime.math.Rectangle"] = lime_math_Rectangle;
lime_math_Rectangle.__name__ = "lime.math.Rectangle";
lime_math_Rectangle.prototype = {
	height: null
	,width: null
	,x: null
	,y: null
	,clone: function() {
		return new lime_math_Rectangle(this.x,this.y,this.width,this.height);
	}
	,contains: function(x,y) {
		if(x >= this.x && y >= this.y && x < this.get_right()) {
			return y < this.get_bottom();
		} else {
			return false;
		}
	}
	,containsPoint: function(point) {
		return this.containsVector(point);
	}
	,containsRect: function(rect) {
		if(rect.width <= 0 || rect.height <= 0) {
			if(rect.x > this.x && rect.y > this.y && rect.get_right() < this.get_right()) {
				return rect.get_bottom() < this.get_bottom();
			} else {
				return false;
			}
		} else if(rect.x >= this.x && rect.y >= this.y && rect.get_right() <= this.get_right()) {
			return rect.get_bottom() <= this.get_bottom();
		} else {
			return false;
		}
	}
	,containsVector: function(vector) {
		return this.contains(vector.x,vector.y);
	}
	,copyFrom: function(sourceRect) {
		this.x = sourceRect.x;
		this.y = sourceRect.y;
		this.width = sourceRect.width;
		this.height = sourceRect.height;
	}
	,equals: function(toCompare) {
		if(toCompare != null && this.x == toCompare.x && this.y == toCompare.y && this.width == toCompare.width) {
			return this.height == toCompare.height;
		} else {
			return false;
		}
	}
	,inflate: function(dx,dy) {
		this.x -= dx;
		this.width += dx * 2;
		this.y -= dy;
		this.height += dy * 2;
	}
	,inflateVector: function(vector) {
		this.inflate(vector.x,vector.y);
	}
	,intersection: function(toIntersect,result) {
		if(result == null) {
			result = new lime_math_Rectangle();
		}
		var x0 = this.x < toIntersect.x ? toIntersect.x : this.x;
		var x1 = this.get_right() > toIntersect.get_right() ? toIntersect.get_right() : this.get_right();
		if(x1 <= x0) {
			result.setEmpty();
			return result;
		}
		var y0 = this.y < toIntersect.y ? toIntersect.y : this.y;
		var y1 = this.get_bottom() > toIntersect.get_bottom() ? toIntersect.get_bottom() : this.get_bottom();
		if(y1 <= y0) {
			result.setEmpty();
			return result;
		}
		result.x = x0;
		result.y = y0;
		result.width = x1 - x0;
		result.height = y1 - y0;
		return result;
	}
	,intersects: function(toIntersect) {
		var x0 = this.x < toIntersect.x ? toIntersect.x : this.x;
		var x1 = this.get_right() > toIntersect.get_right() ? toIntersect.get_right() : this.get_right();
		if(x1 <= x0) {
			return false;
		}
		var y0 = this.y < toIntersect.y ? toIntersect.y : this.y;
		var y1 = this.get_bottom() > toIntersect.get_bottom() ? toIntersect.get_bottom() : this.get_bottom();
		return y1 > y0;
	}
	,isEmpty: function() {
		if(!(this.width <= 0)) {
			return this.height <= 0;
		} else {
			return true;
		}
	}
	,offset: function(dx,dy) {
		this.x += dx;
		this.y += dy;
	}
	,offsetVector: function(vector) {
		this.x += vector.x;
		this.y += vector.y;
	}
	,setEmpty: function() {
		this.x = this.y = this.width = this.height = 0;
	}
	,setTo: function(xa,ya,widtha,heighta) {
		this.x = xa;
		this.y = ya;
		this.width = widtha;
		this.height = heighta;
	}
	,union: function(toUnion,result) {
		if(result == null) {
			result = new lime_math_Rectangle();
		}
		if(this.width == 0 || this.height == 0) {
			result.copyFrom(toUnion);
		} else if(toUnion.width == 0 || toUnion.height == 0) {
			result.copyFrom(this);
		} else {
			var x0 = this.x > toUnion.x ? toUnion.x : this.x;
			var x1 = this.get_right() < toUnion.get_right() ? toUnion.get_right() : this.get_right();
			var y0 = this.y > toUnion.y ? toUnion.y : this.y;
			var y1 = this.get_bottom() < toUnion.get_bottom() ? toUnion.get_bottom() : this.get_bottom();
			result.setTo(x0,y0,x1 - x0,y1 - y0);
		}
		return result;
	}
	,__toFlashRectangle: function() {
		return null;
	}
	,get_bottom: function() {
		return this.y + this.height;
	}
	,set_bottom: function(b) {
		this.height = b - this.y;
		return b;
	}
	,get_bottomRight: function() {
		return new lime_math_Vector2(this.x + this.width,this.y + this.height);
	}
	,set_bottomRight: function(p) {
		this.width = p.x - this.x;
		this.height = p.y - this.y;
		return p.clone();
	}
	,get_left: function() {
		return this.x;
	}
	,set_left: function(l) {
		this.width -= l - this.x;
		this.x = l;
		return l;
	}
	,get_right: function() {
		return this.x + this.width;
	}
	,set_right: function(r) {
		this.width = r - this.x;
		return r;
	}
	,get_size: function() {
		return new lime_math_Vector2(this.width,this.height);
	}
	,set_size: function(p) {
		this.width = p.x;
		this.height = p.y;
		return p.clone();
	}
	,get_top: function() {
		return this.y;
	}
	,set_top: function(t) {
		this.height -= t - this.y;
		this.y = t;
		return t;
	}
	,get_topLeft: function() {
		return new lime_math_Vector2(this.x,this.y);
	}
	,set_topLeft: function(p) {
		this.x = p.x;
		this.y = p.y;
		return p.clone();
	}
	,__class__: lime_math_Rectangle
	,__properties__: {set_topLeft:"set_topLeft",get_topLeft:"get_topLeft",set_top:"set_top",get_top:"get_top",set_size:"set_size",get_size:"get_size",set_right:"set_right",get_right:"get_right",set_left:"set_left",get_left:"get_left",set_bottomRight:"set_bottomRight",get_bottomRight:"get_bottomRight",set_bottom:"set_bottom",get_bottom:"get_bottom"}
};
var lime_math_Vector2 = function(x,y) {
	if(y == null) {
		y = 0;
	}
	if(x == null) {
		x = 0;
	}
	this.x = x;
	this.y = y;
};
$hxClasses["lime.math.Vector2"] = lime_math_Vector2;
lime_math_Vector2.__name__ = "lime.math.Vector2";
lime_math_Vector2.distance = function(pt1,pt2) {
	var dx = pt1.x - pt2.x;
	var dy = pt1.y - pt2.y;
	return Math.sqrt(dx * dx + dy * dy);
};
lime_math_Vector2.interpolate = function(pt1,pt2,f,result) {
	if(result == null) {
		result = new lime_math_Vector2();
	}
	result.x = pt2.x + f * (pt1.x - pt2.x);
	result.y = pt2.y + f * (pt1.y - pt2.y);
	return result;
};
lime_math_Vector2.polar = function(len,angle,result) {
	if(result == null) {
		result = new lime_math_Vector2();
	}
	var ya = len * Math.sin(angle);
	result.x = len * Math.cos(angle);
	result.y = ya;
	return result;
};
lime_math_Vector2.prototype = {
	x: null
	,y: null
	,add: function(v,result) {
		if(result == null) {
			result = new lime_math_Vector2();
		}
		result.x = v.x + this.x;
		result.y = v.y + this.y;
		return result;
	}
	,clone: function() {
		return new lime_math_Vector2(this.x,this.y);
	}
	,equals: function(toCompare) {
		if(toCompare != null && toCompare.x == this.x) {
			return toCompare.y == this.y;
		} else {
			return false;
		}
	}
	,normalize: function(thickness) {
		if(this.x == 0 && this.y == 0) {
			return;
		} else {
			var norm = thickness / Math.sqrt(this.x * this.x + this.y * this.y);
			this.x *= norm;
			this.y *= norm;
		}
	}
	,offset: function(dx,dy) {
		this.x += dx;
		this.y += dy;
	}
	,setTo: function(xa,ya) {
		this.x = xa;
		this.y = ya;
	}
	,subtract: function(v,result) {
		if(result == null) {
			result = new lime_math_Vector2();
		}
		result.x = this.x - v.x;
		result.y = this.y - v.y;
		return result;
	}
	,__toFlashPoint: function() {
		return null;
	}
	,get_length: function() {
		return Math.sqrt(this.x * this.x + this.y * this.y);
	}
	,get_lengthSquared: function() {
		return this.x * this.x + this.y * this.y;
	}
	,__class__: lime_math_Vector2
	,__properties__: {get_lengthSquared:"get_lengthSquared",get_length:"get_length"}
};
var lime_math_Vector4 = function(x,y,z,w) {
	if(w == null) {
		w = 0.;
	}
	if(z == null) {
		z = 0.;
	}
	if(y == null) {
		y = 0.;
	}
	if(x == null) {
		x = 0.;
	}
	this.w = w;
	this.x = x;
	this.y = y;
	this.z = z;
};
$hxClasses["lime.math.Vector4"] = lime_math_Vector4;
lime_math_Vector4.__name__ = "lime.math.Vector4";
lime_math_Vector4.__properties__ = {get_Z_AXIS:"get_Z_AXIS",get_Y_AXIS:"get_Y_AXIS",get_X_AXIS:"get_X_AXIS"};
lime_math_Vector4.angleBetween = function(a,b) {
	var a0 = new lime_math_Vector4(a.x,a.y,a.z,a.w);
	var l = Math.sqrt(a0.x * a0.x + a0.y * a0.y + a0.z * a0.z);
	if(l != 0) {
		a0.x /= l;
		a0.y /= l;
		a0.z /= l;
	}
	var b0 = new lime_math_Vector4(b.x,b.y,b.z,b.w);
	var l = Math.sqrt(b0.x * b0.x + b0.y * b0.y + b0.z * b0.z);
	if(l != 0) {
		b0.x /= l;
		b0.y /= l;
		b0.z /= l;
	}
	return Math.acos(a0.x * b0.x + a0.y * b0.y + a0.z * b0.z);
};
lime_math_Vector4.distance = function(pt1,pt2) {
	var x = pt2.x - pt1.x;
	var y = pt2.y - pt1.y;
	var z = pt2.z - pt1.z;
	return Math.sqrt(x * x + y * y + z * z);
};
lime_math_Vector4.distanceSquared = function(pt1,pt2) {
	var x = pt2.x - pt1.x;
	var y = pt2.y - pt1.y;
	var z = pt2.z - pt1.z;
	return x * x + y * y + z * z;
};
lime_math_Vector4.get_X_AXIS = function() {
	return new lime_math_Vector4(1,0,0);
};
lime_math_Vector4.get_Y_AXIS = function() {
	return new lime_math_Vector4(0,1,0);
};
lime_math_Vector4.get_Z_AXIS = function() {
	return new lime_math_Vector4(0,0,1);
};
lime_math_Vector4.prototype = {
	w: null
	,x: null
	,y: null
	,z: null
	,add: function(a,result) {
		if(result == null) {
			result = new lime_math_Vector4();
		}
		result.x = this.x + a.x;
		result.y = this.y + a.y;
		result.z = this.z + a.z;
		return result;
	}
	,clone: function() {
		return new lime_math_Vector4(this.x,this.y,this.z,this.w);
	}
	,copyFrom: function(sourceVector4) {
		this.x = sourceVector4.x;
		this.y = sourceVector4.y;
		this.z = sourceVector4.z;
	}
	,crossProduct: function(a,result) {
		if(result == null) {
			result = new lime_math_Vector4();
		}
		var ya = this.z * a.x - this.x * a.z;
		var za = this.x * a.y - this.y * a.x;
		result.x = this.y * a.z - this.z * a.y;
		result.y = ya;
		result.z = za;
		result.w = 1;
		return result;
	}
	,decrementBy: function(a) {
		this.x -= a.x;
		this.y -= a.y;
		this.z -= a.z;
	}
	,dotProduct: function(a) {
		return this.x * a.x + this.y * a.y + this.z * a.z;
	}
	,equals: function(toCompare,allFour) {
		if(allFour == null) {
			allFour = false;
		}
		if(this.x == toCompare.x && this.y == toCompare.y && this.z == toCompare.z) {
			if(!(!allFour)) {
				return this.w == toCompare.w;
			} else {
				return true;
			}
		} else {
			return false;
		}
	}
	,incrementBy: function(a) {
		this.x += a.x;
		this.y += a.y;
		this.z += a.z;
	}
	,nearEquals: function(toCompare,tolerance,allFour) {
		if(allFour == null) {
			allFour = false;
		}
		if(Math.abs(this.x - toCompare.x) < tolerance && Math.abs(this.y - toCompare.y) < tolerance && Math.abs(this.z - toCompare.z) < tolerance) {
			if(!(!allFour)) {
				return Math.abs(this.w - toCompare.w) < tolerance;
			} else {
				return true;
			}
		} else {
			return false;
		}
	}
	,negate: function() {
		this.x *= -1;
		this.y *= -1;
		this.z *= -1;
	}
	,normalize: function() {
		var l = Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z);
		if(l != 0) {
			this.x /= l;
			this.y /= l;
			this.z /= l;
		}
		return l;
	}
	,project: function() {
		this.x /= this.w;
		this.y /= this.w;
		this.z /= this.w;
	}
	,scaleBy: function(s) {
		this.x *= s;
		this.y *= s;
		this.z *= s;
	}
	,setTo: function(xa,ya,za) {
		this.x = xa;
		this.y = ya;
		this.z = za;
	}
	,subtract: function(a,result) {
		if(result == null) {
			result = new lime_math_Vector4();
		}
		result.x = this.x - a.x;
		result.y = this.y - a.y;
		result.z = this.z - a.z;
		return result;
	}
	,toString: function() {
		return "Vector4(" + this.x + ", " + this.y + ", " + this.z + ")";
	}
	,get_length: function() {
		return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z);
	}
	,get_lengthSquared: function() {
		return this.x * this.x + this.y * this.y + this.z * this.z;
	}
	,__class__: lime_math_Vector4
	,__properties__: {get_lengthSquared:"get_lengthSquared",get_length:"get_length"}
};
var lime_media_AudioBuffer = function() {
};
$hxClasses["lime.media.AudioBuffer"] = lime_media_AudioBuffer;
lime_media_AudioBuffer.__name__ = "lime.media.AudioBuffer";
lime_media_AudioBuffer.fromBase64 = function(base64String) {
	if(base64String == null) {
		return null;
	}
	if(base64String.indexOf(",") == -1) {
		base64String = "data:" + lime_media_AudioBuffer.__getCodec(lime__$internal_format_Base64.decode(base64String)) + ";base64," + base64String;
	}
	var audioBuffer = new lime_media_AudioBuffer();
	audioBuffer.set_src(new Howl({ src : [base64String], html5 : true, preload : false}));
	return audioBuffer;
};
lime_media_AudioBuffer.fromBytes = function(bytes) {
	if(bytes == null) {
		return null;
	}
	var audioBuffer = new lime_media_AudioBuffer();
	audioBuffer.set_src(new Howl({ src : ["data:" + lime_media_AudioBuffer.__getCodec(bytes) + ";base64," + lime__$internal_format_Base64.encode(bytes)], html5 : true, preload : false}));
	return audioBuffer;
};
lime_media_AudioBuffer.fromFile = function(path) {
	if(path == null) {
		return null;
	}
	var audioBuffer = new lime_media_AudioBuffer();
	audioBuffer.__srcHowl = new Howl({ src : [path], preload : false});
	return audioBuffer;
};
lime_media_AudioBuffer.fromFiles = function(paths) {
	var audioBuffer = new lime_media_AudioBuffer();
	audioBuffer.__srcHowl = new Howl({ src : paths, preload : false});
	return audioBuffer;
};
lime_media_AudioBuffer.fromVorbisFile = function(vorbisFile) {
	return null;
};
lime_media_AudioBuffer.loadFromFile = function(path) {
	var promise = new lime_app_Promise();
	var audioBuffer = lime_media_AudioBuffer.fromFile(path);
	if(audioBuffer != null) {
		if(audioBuffer != null) {
			audioBuffer.__srcHowl.on("load",function() {
				promise.complete(audioBuffer);
			});
			audioBuffer.__srcHowl.on("loaderror",function(id,msg) {
				promise.error(msg);
			});
			audioBuffer.__srcHowl.load();
		}
	} else {
		promise.error(null);
	}
	return promise.future;
};
lime_media_AudioBuffer.loadFromFiles = function(paths) {
	var promise = new lime_app_Promise();
	var audioBuffer = lime_media_AudioBuffer.fromFiles(paths);
	if(audioBuffer != null) {
		audioBuffer.__srcHowl.on("load",function() {
			promise.complete(audioBuffer);
		});
		audioBuffer.__srcHowl.on("loaderror",function() {
			promise.error(null);
		});
		audioBuffer.__srcHowl.load();
	} else {
		promise.error(null);
	}
	return promise.future;
};
lime_media_AudioBuffer.__getCodec = function(bytes) {
	var signature = null;
	try {
		signature = bytes.getString(0,4);
	} catch( _g ) {
		haxe_NativeStackTrace.lastError = _g;
	}
	switch(signature) {
	case "OggS":
		return "audio/ogg";
	case "RIFF":
		if(bytes.getString(8,4) == "WAVE") {
			return "audio/wav";
		} else {
			var _g = bytes.b[1];
			var _g1 = bytes.b[2];
			switch(bytes.b[0]) {
			case 73:
				if(_g == 68) {
					if(_g1 == 51) {
						return "audio/mp3";
					}
				}
				break;
			case 255:
				switch(_g) {
				case 243:case 250:case 251:
					return "audio/mp3";
				default:
				}
				break;
			default:
			}
		}
		break;
	case "fLaC":
		return "audio/flac";
	default:
		var _g = bytes.b[1];
		var _g1 = bytes.b[2];
		switch(bytes.b[0]) {
		case 73:
			if(_g == 68) {
				if(_g1 == 51) {
					return "audio/mp3";
				}
			}
			break;
		case 255:
			switch(_g) {
			case 243:case 250:case 251:
				return "audio/mp3";
			default:
			}
			break;
		default:
		}
	}
	lime_utils_Log.error("Unsupported sound format",{ fileName : "lime/media/AudioBuffer.hx", lineNumber : 450, className : "lime.media.AudioBuffer", methodName : "__getCodec"});
	return null;
};
lime_media_AudioBuffer.prototype = {
	bitsPerSample: null
	,channels: null
	,data: null
	,sampleRate: null
	,__srcAudio: null
	,__srcBuffer: null
	,__srcCustom: null
	,__srcHowl: null
	,__srcSound: null
	,__srcVorbisFile: null
	,dispose: function() {
		this.__srcHowl.unload();
	}
	,get_src: function() {
		return this.__srcHowl;
	}
	,set_src: function(value) {
		return this.__srcHowl = value;
	}
	,__class__: lime_media_AudioBuffer
	,__properties__: {set_src:"set_src",get_src:"get_src"}
};
var lime_media_AudioContext = function(type) {
	if(type != "custom") {
		if(type == null || type == "web") {
			try {
				window.AudioContext = window.AudioContext || window.webkitAudioContext;
				this.web = new window.AudioContext ();
				this.type = "web";
			} catch( _g ) {
				haxe_NativeStackTrace.lastError = _g;
			}
		}
		if(this.web == null && type != "web") {
			this.html5 = new lime_media_HTML5AudioContext();
			this.type = "html5";
		}
	} else {
		this.type = "custom";
	}
};
$hxClasses["lime.media.AudioContext"] = lime_media_AudioContext;
lime_media_AudioContext.__name__ = "lime.media.AudioContext";
lime_media_AudioContext.prototype = {
	custom: null
	,flash: null
	,html5: null
	,openal: null
	,type: null
	,web: null
	,__class__: lime_media_AudioContext
};
var lime_media_AudioSource = function(buffer,offset,length,loops) {
	if(loops == null) {
		loops = 0;
	}
	if(offset == null) {
		offset = 0;
	}
	this.onComplete = new lime_app__$Event_$Void_$Void();
	this.buffer = buffer;
	this.offset = offset;
	this.__backend = new lime__$internal_backend_html5_HTML5AudioSource(this);
	if(length != null && length != 0) {
		this.set_length(length);
	}
	this.set_loops(loops);
	if(buffer != null) {
		this.init();
	}
};
$hxClasses["lime.media.AudioSource"] = lime_media_AudioSource;
lime_media_AudioSource.__name__ = "lime.media.AudioSource";
lime_media_AudioSource.prototype = {
	onComplete: null
	,buffer: null
	,offset: null
	,__backend: null
	,dispose: function() {
		this.__backend.dispose();
	}
	,init: function() {
		this.__backend.init();
	}
	,play: function() {
		this.__backend.play();
	}
	,pause: function() {
		this.__backend.pause();
	}
	,stop: function() {
		this.__backend.stop();
	}
	,get_currentTime: function() {
		return this.__backend.getCurrentTime();
	}
	,set_currentTime: function(value) {
		return this.__backend.setCurrentTime(value);
	}
	,get_gain: function() {
		return this.__backend.getGain();
	}
	,set_gain: function(value) {
		return this.__backend.setGain(value);
	}
	,get_length: function() {
		return this.__backend.getLength();
	}
	,set_length: function(value) {
		return this.__backend.setLength(value);
	}
	,get_loops: function() {
		return this.__backend.getLoops();
	}
	,set_loops: function(value) {
		return this.__backend.setLoops(value);
	}
	,get_pitch: function() {
		return this.__backend.getPitch();
	}
	,set_pitch: function(value) {
		return this.__backend.setPitch(value);
	}
	,get_position: function() {
		return this.__backend.getPosition();
	}
	,set_position: function(value) {
		return this.__backend.setPosition(value);
	}
	,__class__: lime_media_AudioSource
	,__properties__: {set_position:"set_position",get_position:"get_position",set_pitch:"set_pitch",get_pitch:"get_pitch",set_loops:"set_loops",get_loops:"get_loops",set_length:"set_length",get_length:"get_length",set_gain:"set_gain",get_gain:"get_gain",set_currentTime:"set_currentTime",get_currentTime:"get_currentTime"}
};
var lime_media_FlashAudioContext = function() {
};
$hxClasses["lime.media.FlashAudioContext"] = lime_media_FlashAudioContext;
lime_media_FlashAudioContext.__name__ = "lime.media.FlashAudioContext";
lime_media_FlashAudioContext.prototype = {
	createBuffer: function(stream,context) {
		return null;
	}
	,getBytesLoaded: function(buffer) {
		return 0;
	}
	,getBytesTotal: function(buffer) {
		return 0;
	}
	,getID3: function(buffer) {
		return null;
	}
	,getIsBuffering: function(buffer) {
		return false;
	}
	,getIsURLInaccessible: function(buffer) {
		return false;
	}
	,getLength: function(buffer) {
		return 0;
	}
	,getURL: function(buffer) {
		return null;
	}
	,close: function(buffer) {
	}
	,extract: function(buffer,target,length,startPosition) {
		if(startPosition == null) {
			startPosition = -1;
		}
		return 0;
	}
	,load: function(buffer,stream,context) {
	}
	,loadCompressedDataFromByteArray: function(buffer,bytes,bytesLength) {
	}
	,loadPCMFromByteArray: function(buffer,bytes,samples,format,stereo,sampleRate) {
		if(sampleRate == null) {
			sampleRate = 44100;
		}
		if(stereo == null) {
			stereo = true;
		}
	}
	,play: function(buffer,startTime,loops,sndTransform) {
		if(loops == null) {
			loops = 0;
		}
		if(startTime == null) {
			startTime = 0;
		}
		return null;
	}
	,__class__: lime_media_FlashAudioContext
};
var lime_media_HTML5AudioContext = function() {
	this.NETWORK_NO_SOURCE = 3;
	this.NETWORK_LOADING = 2;
	this.NETWORK_IDLE = 1;
	this.NETWORK_EMPTY = 0;
	this.HAVE_NOTHING = 0;
	this.HAVE_METADATA = 1;
	this.HAVE_FUTURE_DATA = 3;
	this.HAVE_ENOUGH_DATA = 4;
	this.HAVE_CURRENT_DATA = 2;
};
$hxClasses["lime.media.HTML5AudioContext"] = lime_media_HTML5AudioContext;
lime_media_HTML5AudioContext.__name__ = "lime.media.HTML5AudioContext";
lime_media_HTML5AudioContext.prototype = {
	HAVE_CURRENT_DATA: null
	,HAVE_ENOUGH_DATA: null
	,HAVE_FUTURE_DATA: null
	,HAVE_METADATA: null
	,HAVE_NOTHING: null
	,NETWORK_EMPTY: null
	,NETWORK_IDLE: null
	,NETWORK_LOADING: null
	,NETWORK_NO_SOURCE: null
	,canPlayType: function(buffer,type) {
		if(buffer.__srcAudio != null) {
			return buffer.__srcAudio.canPlayType(type);
		}
		return null;
	}
	,createBuffer: function(urlString) {
		var buffer = new lime_media_AudioBuffer();
		buffer.__srcAudio = new Audio();
		buffer.__srcAudio.src = urlString;
		return buffer;
	}
	,getAutoplay: function(buffer) {
		if(buffer.__srcAudio != null) {
			return buffer.__srcAudio.autoplay;
		}
		return false;
	}
	,getBuffered: function(buffer) {
		if(buffer.__srcAudio != null) {
			return buffer.__srcAudio.buffered;
		}
		return null;
	}
	,getCurrentSrc: function(buffer) {
		if(buffer.__srcAudio != null) {
			return buffer.__srcAudio.currentSrc;
		}
		return null;
	}
	,getCurrentTime: function(buffer) {
		if(buffer.__srcAudio != null) {
			return buffer.__srcAudio.currentTime;
		}
		return 0;
	}
	,getDefaultPlaybackRate: function(buffer) {
		if(buffer.__srcAudio != null) {
			return buffer.__srcAudio.defaultPlaybackRate;
		}
		return 1;
	}
	,getDuration: function(buffer) {
		if(buffer.__srcAudio != null) {
			return buffer.__srcAudio.duration;
		}
		return 0;
	}
	,getEnded: function(buffer) {
		if(buffer.__srcAudio != null) {
			return buffer.__srcAudio.ended;
		}
		return false;
	}
	,getError: function(buffer) {
		if(buffer.__srcAudio != null) {
			return buffer.__srcAudio.error;
		}
		return null;
	}
	,getLoop: function(buffer) {
		if(buffer.__srcAudio != null) {
			return buffer.__srcAudio.loop;
		}
		return false;
	}
	,getMuted: function(buffer) {
		if(buffer.__srcAudio != null) {
			return buffer.__srcAudio.muted;
		}
		return false;
	}
	,getNetworkState: function(buffer) {
		if(buffer.__srcAudio != null) {
			return buffer.__srcAudio.networkState;
		}
		return 0;
	}
	,getPaused: function(buffer) {
		if(buffer.__srcAudio != null) {
			return buffer.__srcAudio.paused;
		}
		return false;
	}
	,getPlaybackRate: function(buffer) {
		if(buffer.__srcAudio != null) {
			return buffer.__srcAudio.playbackRate;
		}
		return 1;
	}
	,getPlayed: function(buffer) {
		if(buffer.__srcAudio != null) {
			return buffer.__srcAudio.played;
		}
		return null;
	}
	,getPreload: function(buffer) {
		if(buffer.__srcAudio != null) {
			return buffer.__srcAudio.preload;
		}
		return null;
	}
	,getReadyState: function(buffer) {
		if(buffer.__srcAudio != null) {
			return buffer.__srcAudio.readyState;
		}
		return 0;
	}
	,getSeekable: function(buffer) {
		if(buffer.__srcAudio != null) {
			return buffer.__srcAudio.seekable;
		}
		return null;
	}
	,getSeeking: function(buffer) {
		if(buffer.__srcAudio != null) {
			return buffer.__srcAudio.seeking;
		}
		return false;
	}
	,getSrc: function(buffer) {
		if(buffer.__srcAudio != null) {
			return buffer.__srcAudio.src;
		}
		return null;
	}
	,getStartTime: function(buffer) {
		if(buffer.__srcAudio != null) {
			return buffer.__srcAudio.playbackRate;
		}
		return 0;
	}
	,getVolume: function(buffer) {
		if(buffer.__srcAudio != null) {
			return buffer.__srcAudio.volume;
		}
		return 1;
	}
	,load: function(buffer) {
		if(buffer.__srcAudio != null) {
			buffer.__srcAudio.load();
		}
	}
	,pause: function(buffer) {
		if(buffer.__srcAudio != null) {
			buffer.__srcAudio.pause();
		}
	}
	,play: function(buffer) {
		if(buffer.__srcAudio != null) {
			buffer.__srcAudio.play();
		}
	}
	,setAutoplay: function(buffer,value) {
		if(buffer.__srcAudio != null) {
			buffer.__srcAudio.autoplay = value;
		}
	}
	,setCurrentTime: function(buffer,value) {
		if(buffer.__srcAudio != null) {
			buffer.__srcAudio.currentTime = value;
		}
	}
	,setDefaultPlaybackRate: function(buffer,value) {
		if(buffer.__srcAudio != null) {
			buffer.__srcAudio.defaultPlaybackRate = value;
		}
	}
	,setLoop: function(buffer,value) {
		if(buffer.__srcAudio != null) {
			buffer.__srcAudio.loop = value;
		}
	}
	,setMuted: function(buffer,value) {
		if(buffer.__srcAudio != null) {
			buffer.__srcAudio.muted = value;
		}
	}
	,setPlaybackRate: function(buffer,value) {
		if(buffer.__srcAudio != null) {
			buffer.__srcAudio.playbackRate = value;
		}
	}
	,setPreload: function(buffer,value) {
		if(buffer.__srcAudio != null) {
			buffer.__srcAudio.preload = value;
		}
	}
	,setSrc: function(buffer,value) {
		if(buffer.__srcAudio != null) {
			buffer.__srcAudio.src = value;
		}
	}
	,setVolume: function(buffer,value) {
		if(buffer.__srcAudio != null) {
			buffer.__srcAudio.volume = value;
		}
	}
	,__class__: lime_media_HTML5AudioContext
};
var lime_media_OpenALAudioContext = function() {
	this.ALL_DEVICES_SPECIFIER = 4115;
	this.DEFAULT_ALL_DEVICES_SPECIFIER = 4114;
	this.ENUMERATE_ALL_EXT = 1;
	this.DEVICE_SPECIFIER = 4101;
	this.DEFAULT_DEVICE_SPECIFIER = 4100;
	this.ALL_ATTRIBUTES = 4099;
	this.ATTRIBUTES_SIZE = 4098;
	this.INVALID_CONTEXT = 40962;
	this.INVALID_DEVICE = 40961;
	this.STEREO_SOURCES = 4113;
	this.MONO_SOURCES = 4112;
	this.SYNC = 4105;
	this.REFRESH = 4104;
	this.EXPONENT_DISTANCE_CLAMPED = 53254;
	this.EXPONENT_DISTANCE = 53253;
	this.LINEAR_DISTANCE_CLAMPED = 53252;
	this.LINEAR_DISTANCE = 53251;
	this.INVERSE_DISTANCE_CLAMPED = 53250;
	this.INVERSE_DISTANCE = 53249;
	this.DISTANCE_MODEL = 53248;
	this.DOPPLER_VELOCITY = 49153;
	this.SPEED_OF_SOUND = 49155;
	this.DOPPLER_FACTOR = 49152;
	this.EXTENSIONS = 45060;
	this.RENDERER = 45059;
	this.VERSION = 45058;
	this.VENDOR = 45057;
	this.OUT_OF_MEMORY = 40965;
	this.INVALID_OPERATION = 40964;
	this.INVALID_VALUE = 40963;
	this.INVALID_ENUM = 40962;
	this.INVALID_NAME = 40961;
	this.NO_ERROR = 0;
	this.SIZE = 8196;
	this.CHANNELS = 8195;
	this.BITS = 8194;
	this.FREQUENCY = 8193;
	this.FORMAT_STEREO16 = 4355;
	this.FORMAT_STEREO8 = 4354;
	this.FORMAT_MONO16 = 4353;
	this.FORMAT_MONO8 = 4352;
	this.UNDETERMINED = 4144;
	this.STREAMING = 4137;
	this.STATIC = 4136;
	this.SOURCE_TYPE = 4135;
	this.BYTE_OFFSET = 4134;
	this.SAMPLE_OFFSET = 4133;
	this.SEC_OFFSET = 4132;
	this.MAX_DISTANCE = 4131;
	this.CONE_OUTER_GAIN = 4130;
	this.ROLLOFF_FACTOR = 4129;
	this.REFERENCE_DISTANCE = 4128;
	this.BUFFERS_PROCESSED = 4118;
	this.BUFFERS_QUEUED = 4117;
	this.STOPPED = 4116;
	this.PAUSED = 4115;
	this.PLAYING = 4114;
	this.INITIAL = 4113;
	this.SOURCE_STATE = 4112;
	this.ORIENTATION = 4111;
	this.MAX_GAIN = 4110;
	this.MIN_GAIN = 4109;
	this.GAIN = 4106;
	this.BUFFER = 4105;
	this.LOOPING = 4103;
	this.VELOCITY = 4102;
	this.DIRECTION = 4101;
	this.POSITION = 4100;
	this.PITCH = 4099;
	this.CONE_OUTER_ANGLE = 4098;
	this.CONE_INNER_ANGLE = 4097;
	this.SOURCE_RELATIVE = 514;
	this.TRUE = 1;
	this.FALSE = 0;
	this.NONE = 0;
};
$hxClasses["lime.media.OpenALAudioContext"] = lime_media_OpenALAudioContext;
lime_media_OpenALAudioContext.__name__ = "lime.media.OpenALAudioContext";
lime_media_OpenALAudioContext.prototype = {
	NONE: null
	,FALSE: null
	,TRUE: null
	,SOURCE_RELATIVE: null
	,CONE_INNER_ANGLE: null
	,CONE_OUTER_ANGLE: null
	,PITCH: null
	,POSITION: null
	,DIRECTION: null
	,VELOCITY: null
	,LOOPING: null
	,BUFFER: null
	,GAIN: null
	,MIN_GAIN: null
	,MAX_GAIN: null
	,ORIENTATION: null
	,SOURCE_STATE: null
	,INITIAL: null
	,PLAYING: null
	,PAUSED: null
	,STOPPED: null
	,BUFFERS_QUEUED: null
	,BUFFERS_PROCESSED: null
	,REFERENCE_DISTANCE: null
	,ROLLOFF_FACTOR: null
	,CONE_OUTER_GAIN: null
	,MAX_DISTANCE: null
	,SEC_OFFSET: null
	,SAMPLE_OFFSET: null
	,BYTE_OFFSET: null
	,SOURCE_TYPE: null
	,STATIC: null
	,STREAMING: null
	,UNDETERMINED: null
	,FORMAT_MONO8: null
	,FORMAT_MONO16: null
	,FORMAT_STEREO8: null
	,FORMAT_STEREO16: null
	,FREQUENCY: null
	,BITS: null
	,CHANNELS: null
	,SIZE: null
	,NO_ERROR: null
	,INVALID_NAME: null
	,INVALID_ENUM: null
	,INVALID_VALUE: null
	,INVALID_OPERATION: null
	,OUT_OF_MEMORY: null
	,VENDOR: null
	,VERSION: null
	,RENDERER: null
	,EXTENSIONS: null
	,DOPPLER_FACTOR: null
	,SPEED_OF_SOUND: null
	,DOPPLER_VELOCITY: null
	,DISTANCE_MODEL: null
	,INVERSE_DISTANCE: null
	,INVERSE_DISTANCE_CLAMPED: null
	,LINEAR_DISTANCE: null
	,LINEAR_DISTANCE_CLAMPED: null
	,EXPONENT_DISTANCE: null
	,EXPONENT_DISTANCE_CLAMPED: null
	,REFRESH: null
	,SYNC: null
	,MONO_SOURCES: null
	,STEREO_SOURCES: null
	,INVALID_DEVICE: null
	,INVALID_CONTEXT: null
	,ATTRIBUTES_SIZE: null
	,ALL_ATTRIBUTES: null
	,DEFAULT_DEVICE_SPECIFIER: null
	,DEVICE_SPECIFIER: null
	,ENUMERATE_ALL_EXT: null
	,DEFAULT_ALL_DEVICES_SPECIFIER: null
	,ALL_DEVICES_SPECIFIER: null
	,bufferData: function(buffer,format,data,size,freq) {
		lime_media_openal_AL.bufferData(buffer,format,data,size,freq);
	}
	,buffer3f: function(buffer,param,value1,value2,value3) {
		lime_media_openal_AL.buffer3f(buffer,param,value1,value2,value3);
	}
	,buffer3i: function(buffer,param,value1,value2,value3) {
		lime_media_openal_AL.buffer3i(buffer,param,value1,value2,value3);
	}
	,bufferf: function(buffer,param,value) {
		lime_media_openal_AL.bufferf(buffer,param,value);
	}
	,bufferfv: function(buffer,param,values) {
		lime_media_openal_AL.bufferfv(buffer,param,values);
	}
	,bufferi: function(buffer,param,value) {
		lime_media_openal_AL.bufferi(buffer,param,value);
	}
	,bufferiv: function(buffer,param,values) {
		lime_media_openal_AL.bufferiv(buffer,param,values);
	}
	,closeDevice: function(device) {
		return lime_media_openal_ALC.closeDevice(device);
	}
	,createContext: function(device,attrlist) {
		return lime_media_openal_ALC.createContext(device,attrlist);
	}
	,createBuffer: function() {
		return lime_media_openal_AL.createBuffer();
	}
	,createSource: function() {
		return lime_media_openal_AL.createSource();
	}
	,deleteBuffer: function(buffer) {
		lime_media_openal_AL.deleteBuffer(buffer);
	}
	,deleteBuffers: function(buffers) {
		lime_media_openal_AL.deleteBuffers(buffers);
	}
	,deleteSource: function(source) {
		lime_media_openal_AL.deleteSource(source);
	}
	,deleteSources: function(sources) {
		lime_media_openal_AL.deleteSources(sources);
	}
	,destroyContext: function(context) {
		if(context == null) {
			return;
		}
		lime_media_openal_ALC.destroyContext(context);
	}
	,disable: function(capability) {
		lime_media_openal_AL.disable(capability);
	}
	,distanceModel: function(distanceModel) {
		lime_media_openal_AL.distanceModel(distanceModel);
	}
	,dopplerFactor: function(value) {
		lime_media_openal_AL.dopplerFactor(value);
	}
	,dopplerVelocity: function(value) {
		lime_media_openal_AL.dopplerVelocity(value);
	}
	,enable: function(capability) {
		lime_media_openal_AL.enable(capability);
	}
	,genSource: function() {
		return this.createSource();
	}
	,genSources: function(n) {
		return lime_media_openal_AL.genSources(n);
	}
	,genBuffer: function() {
		return this.createBuffer();
	}
	,genBuffers: function(n) {
		return lime_media_openal_AL.genBuffers(n);
	}
	,getBoolean: function(param) {
		return lime_media_openal_AL.getBoolean(param);
	}
	,getBooleanv: function(param,count) {
		if(count == null) {
			count = 1;
		}
		return lime_media_openal_AL.getBooleanv(param,count);
	}
	,getBuffer3f: function(buffer,param) {
		return lime_media_openal_AL.getBuffer3f(buffer,param);
	}
	,getBuffer3i: function(buffer,param) {
		return lime_media_openal_AL.getBuffer3i(buffer,param);
	}
	,getBufferf: function(buffer,param) {
		return lime_media_openal_AL.getBufferf(buffer,param);
	}
	,getBufferfv: function(buffer,param,count) {
		if(count == null) {
			count = 1;
		}
		return lime_media_openal_AL.getBufferfv(buffer,param,count);
	}
	,getBufferi: function(buffer,param) {
		return lime_media_openal_AL.getBufferi(buffer,param);
	}
	,getBufferiv: function(buffer,param,count) {
		if(count == null) {
			count = 1;
		}
		return lime_media_openal_AL.getBufferiv(buffer,param,count);
	}
	,getContextsDevice: function(context) {
		if(context == null) {
			return null;
		}
		return lime_media_openal_ALC.getContextsDevice(context);
	}
	,getCurrentContext: function() {
		return lime_media_openal_ALC.getCurrentContext();
	}
	,getDouble: function(param) {
		return lime_media_openal_AL.getDouble(param);
	}
	,getDoublev: function(param,count) {
		if(count == null) {
			count = 1;
		}
		return lime_media_openal_AL.getDoublev(param,count);
	}
	,getEnumValue: function(ename) {
		return lime_media_openal_AL.getEnumValue(ename);
	}
	,getError: function(device) {
		if(device == null) {
			return lime_media_openal_AL.getError();
		} else {
			return lime_media_openal_ALC.getError(device);
		}
	}
	,getErrorString: function(device) {
		if(device == null) {
			return lime_media_openal_AL.getErrorString();
		} else {
			return lime_media_openal_ALC.getErrorString(device);
		}
	}
	,getFloat: function(param) {
		return lime_media_openal_AL.getFloat(param);
	}
	,getFloatv: function(param,count) {
		if(count == null) {
			count = 1;
		}
		return lime_media_openal_AL.getFloatv(param,count);
	}
	,getInteger: function(param) {
		return lime_media_openal_AL.getInteger(param);
	}
	,getIntegerv: function(param,count,device) {
		if(count == null) {
			count = 1;
		}
		if(device == null) {
			return lime_media_openal_AL.getIntegerv(param,count);
		} else {
			return lime_media_openal_ALC.getIntegerv(device,param,count);
		}
	}
	,getListener3f: function(param) {
		return lime_media_openal_AL.getListener3f(param);
	}
	,getListener3i: function(param) {
		return lime_media_openal_AL.getListener3i(param);
	}
	,getListenerf: function(param) {
		return lime_media_openal_AL.getListenerf(param);
	}
	,getListenerfv: function(param,count) {
		if(count == null) {
			count = 1;
		}
		return lime_media_openal_AL.getListenerfv(param,count);
	}
	,getListeneri: function(param) {
		return lime_media_openal_AL.getListeneri(param);
	}
	,getListeneriv: function(param,count) {
		if(count == null) {
			count = 1;
		}
		return lime_media_openal_AL.getListeneriv(param,count);
	}
	,getProcAddress: function(fname) {
		return lime_media_openal_AL.getProcAddress(fname);
	}
	,getSource3f: function(source,param) {
		return lime_media_openal_AL.getSource3f(source,param);
	}
	,getSourcef: function(source,param) {
		return lime_media_openal_AL.getSourcef(source,param);
	}
	,getSource3i: function(source,param) {
		return lime_media_openal_AL.getSource3i(source,param);
	}
	,getSourcefv: function(source,param,count) {
		if(count == null) {
			count = 1;
		}
		return lime_media_openal_AL.getSourcefv(source,param);
	}
	,getSourcei: function(source,param) {
		return lime_media_openal_AL.getSourcei(source,param);
	}
	,getSourceiv: function(source,param,count) {
		if(count == null) {
			count = 1;
		}
		return lime_media_openal_AL.getSourceiv(source,param,count);
	}
	,getString: function(param,device) {
		if(device == null) {
			return lime_media_openal_AL.getString(param);
		} else {
			return lime_media_openal_ALC.getString(device,param);
		}
	}
	,isBuffer: function(buffer) {
		return lime_media_openal_AL.isBuffer(buffer);
	}
	,isEnabled: function(capability) {
		return lime_media_openal_AL.isEnabled(capability);
	}
	,isExtensionPresent: function(extname) {
		return lime_media_openal_AL.isExtensionPresent(extname);
	}
	,isSource: function(source) {
		return lime_media_openal_AL.isSource(source);
	}
	,listener3f: function(param,value1,value2,value3) {
		lime_media_openal_AL.listener3f(param,value1,value2,value3);
	}
	,listener3i: function(param,value1,value2,value3) {
		lime_media_openal_AL.listener3i(param,value1,value2,value3);
	}
	,listenerf: function(param,value) {
		lime_media_openal_AL.listenerf(param,value);
	}
	,listenerfv: function(param,values) {
		lime_media_openal_AL.listenerfv(param,values);
	}
	,listeneri: function(param,value) {
		lime_media_openal_AL.listeneri(param,value);
	}
	,listeneriv: function(param,values) {
		lime_media_openal_AL.listeneriv(param,values);
	}
	,makeContextCurrent: function(context) {
		return lime_media_openal_ALC.makeContextCurrent(context);
	}
	,openDevice: function(deviceName) {
		return lime_media_openal_ALC.openDevice(deviceName);
	}
	,pauseDevice: function(device) {
		lime_media_openal_ALC.pauseDevice(device);
	}
	,processContext: function(context) {
		lime_media_openal_ALC.processContext(context);
	}
	,resumeDevice: function(device) {
		lime_media_openal_ALC.resumeDevice(device);
	}
	,source3f: function(source,param,value1,value2,value3) {
		lime_media_openal_AL.source3f(source,param,value1,value2,value3);
	}
	,source3i: function(source,param,value1,value2,value3) {
		lime_media_openal_AL.source3i(source,param,value1,value2,value3);
	}
	,sourcef: function(source,param,value) {
		lime_media_openal_AL.sourcef(source,param,value);
	}
	,sourcefv: function(source,param,values) {
		lime_media_openal_AL.sourcefv(source,param,values);
	}
	,sourcei: function(source,param,value) {
		lime_media_openal_AL.sourcei(source,param,value);
	}
	,sourceiv: function(source,param,values) {
		lime_media_openal_AL.sourceiv(source,param,values);
	}
	,sourcePlay: function(source) {
		lime_media_openal_AL.sourcePlay(source);
	}
	,sourcePlayv: function(sources) {
		lime_media_openal_AL.sourcePlayv(sources);
	}
	,sourceStop: function(source) {
		lime_media_openal_AL.sourceStop(source);
	}
	,sourceStopv: function(sources) {
		lime_media_openal_AL.sourceStopv(sources);
	}
	,sourceRewind: function(source) {
		lime_media_openal_AL.sourceRewind(source);
	}
	,sourceRewindv: function(sources) {
		lime_media_openal_AL.sourceRewindv(sources);
	}
	,sourcePause: function(source) {
		lime_media_openal_AL.sourcePause(source);
	}
	,sourcePausev: function(sources) {
		lime_media_openal_AL.sourcePausev(sources);
	}
	,sourceQueueBuffer: function(source,buffer) {
		lime_media_openal_AL.sourceQueueBuffer(source,buffer);
	}
	,sourceQueueBuffers: function(source,nb,buffers) {
		lime_media_openal_AL.sourceQueueBuffers(source,nb,buffers);
	}
	,sourceUnqueueBuffer: function(source) {
		return lime_media_openal_AL.sourceUnqueueBuffer(source);
	}
	,sourceUnqueueBuffers: function(source,nb) {
		return lime_media_openal_AL.sourceUnqueueBuffers(source,nb);
	}
	,speedOfSound: function(value) {
		lime_media_openal_AL.speedOfSound(value);
	}
	,suspendContext: function(context) {
		lime_media_openal_ALC.suspendContext(context);
	}
	,__class__: lime_media_OpenALAudioContext
};
var lime_media_openal_AL = function() { };
$hxClasses["lime.media.openal.AL"] = lime_media_openal_AL;
lime_media_openal_AL.__name__ = "lime.media.openal.AL";
lime_media_openal_AL.removeDirectFilter = function(source) {
};
lime_media_openal_AL.removeSend = function(source,index) {
};
lime_media_openal_AL.auxf = function(aux,param,value) {
};
lime_media_openal_AL.auxfv = function(aux,param,values) {
};
lime_media_openal_AL.auxi = function(aux,param,value) {
};
lime_media_openal_AL.auxiv = function(aux,param,values) {
};
lime_media_openal_AL.bufferData = function(buffer,format,data,size,freq) {
};
lime_media_openal_AL.buffer3f = function(buffer,param,value1,value2,value3) {
};
lime_media_openal_AL.buffer3i = function(buffer,param,value1,value2,value3) {
};
lime_media_openal_AL.bufferf = function(buffer,param,value) {
};
lime_media_openal_AL.bufferfv = function(buffer,param,values) {
};
lime_media_openal_AL.bufferi = function(buffer,param,value) {
};
lime_media_openal_AL.bufferiv = function(buffer,param,values) {
};
lime_media_openal_AL.createAux = function() {
	return null;
};
lime_media_openal_AL.createBuffer = function() {
	return null;
};
lime_media_openal_AL.createEffect = function() {
	return null;
};
lime_media_openal_AL.createFilter = function() {
	return null;
};
lime_media_openal_AL.createSource = function() {
	return null;
};
lime_media_openal_AL.deleteBuffer = function(buffer) {
};
lime_media_openal_AL.deleteBuffers = function(buffers) {
};
lime_media_openal_AL.deleteSource = function(source) {
};
lime_media_openal_AL.deleteSources = function(sources) {
};
lime_media_openal_AL.disable = function(capability) {
};
lime_media_openal_AL.distanceModel = function(distanceModel) {
};
lime_media_openal_AL.dopplerFactor = function(value) {
};
lime_media_openal_AL.dopplerVelocity = function(value) {
};
lime_media_openal_AL.effectf = function(effect,param,value) {
};
lime_media_openal_AL.effectfv = function(effect,param,values) {
};
lime_media_openal_AL.effecti = function(effect,param,value) {
};
lime_media_openal_AL.effectiv = function(effect,param,values) {
};
lime_media_openal_AL.enable = function(capability) {
};
lime_media_openal_AL.genSource = function() {
	return null;
};
lime_media_openal_AL.genSources = function(n) {
	return null;
};
lime_media_openal_AL.genBuffer = function() {
	return null;
};
lime_media_openal_AL.genBuffers = function(n) {
	return null;
};
lime_media_openal_AL.getBoolean = function(param) {
	return false;
};
lime_media_openal_AL.getBooleanv = function(param,count) {
	if(count == null) {
		count = 1;
	}
	return null;
};
lime_media_openal_AL.getBuffer3f = function(buffer,param) {
	return null;
};
lime_media_openal_AL.getBuffer3i = function(buffer,param) {
	return null;
};
lime_media_openal_AL.getBufferf = function(buffer,param) {
	return 0;
};
lime_media_openal_AL.getBufferfv = function(buffer,param,count) {
	if(count == null) {
		count = 1;
	}
	return null;
};
lime_media_openal_AL.getBufferi = function(buffer,param) {
	return 0;
};
lime_media_openal_AL.getBufferiv = function(buffer,param,count) {
	if(count == null) {
		count = 1;
	}
	return null;
};
lime_media_openal_AL.getDouble = function(param) {
	return 0;
};
lime_media_openal_AL.getDoublev = function(param,count) {
	if(count == null) {
		count = 1;
	}
	return null;
};
lime_media_openal_AL.getEnumValue = function(ename) {
	return 0;
};
lime_media_openal_AL.getError = function() {
	return 0;
};
lime_media_openal_AL.getErrorString = function() {
	switch(lime_media_openal_AL.getError()) {
	case 40961:
		return "INVALID_NAME: Invalid parameter name";
	case 40962:
		return "INVALID_ENUM: Invalid enum value";
	case 40963:
		return "INVALID_VALUE: Invalid parameter value";
	case 40964:
		return "INVALID_OPERATION: Illegal operation or call";
	case 40965:
		return "OUT_OF_MEMORY: OpenAL has run out of memory";
	default:
		return "";
	}
};
lime_media_openal_AL.getFilteri = function(filter,param) {
	return 0;
};
lime_media_openal_AL.getFloat = function(param) {
	return 0;
};
lime_media_openal_AL.getFloatv = function(param,count) {
	if(count == null) {
		count = 1;
	}
	return null;
};
lime_media_openal_AL.getInteger = function(param) {
	return 0;
};
lime_media_openal_AL.getIntegerv = function(param,count) {
	if(count == null) {
		count = 1;
	}
	return null;
};
lime_media_openal_AL.getListener3f = function(param) {
	return null;
};
lime_media_openal_AL.getListener3i = function(param) {
	return null;
};
lime_media_openal_AL.getListenerf = function(param) {
	return 0;
};
lime_media_openal_AL.getListenerfv = function(param,count) {
	if(count == null) {
		count = 1;
	}
	return null;
};
lime_media_openal_AL.getListeneri = function(param) {
	return 0;
};
lime_media_openal_AL.getListeneriv = function(param,count) {
	if(count == null) {
		count = 1;
	}
	return null;
};
lime_media_openal_AL.getParameter = function(param) {
	return null;
};
lime_media_openal_AL.getProcAddress = function(fname) {
	return null;
};
lime_media_openal_AL.getSource3f = function(source,param) {
	return null;
};
lime_media_openal_AL.getSourcef = function(source,param) {
	return 0;
};
lime_media_openal_AL.getSource3i = function(source,param) {
	return null;
};
lime_media_openal_AL.getSourcefv = function(source,param,count) {
	if(count == null) {
		count = 1;
	}
	return null;
};
lime_media_openal_AL.getSourcei = function(source,param) {
	return 0;
};
lime_media_openal_AL.getSourceiv = function(source,param,count) {
	if(count == null) {
		count = 1;
	}
	return null;
};
lime_media_openal_AL.getString = function(param) {
	return null;
};
lime_media_openal_AL.isBuffer = function(buffer) {
	return false;
};
lime_media_openal_AL.isEnabled = function(capability) {
	return false;
};
lime_media_openal_AL.isExtensionPresent = function(extname) {
	return false;
};
lime_media_openal_AL.isAux = function(aux) {
	return false;
};
lime_media_openal_AL.isEffect = function(effect) {
	return false;
};
lime_media_openal_AL.isFilter = function(filter) {
	return false;
};
lime_media_openal_AL.isSource = function(source) {
	return false;
};
lime_media_openal_AL.listener3f = function(param,value1,value2,value3) {
};
lime_media_openal_AL.listener3i = function(param,value1,value2,value3) {
};
lime_media_openal_AL.listenerf = function(param,value) {
};
lime_media_openal_AL.listenerfv = function(param,values) {
};
lime_media_openal_AL.listeneri = function(param,value) {
};
lime_media_openal_AL.listeneriv = function(param,values) {
};
lime_media_openal_AL.source3f = function(source,param,value1,value2,value3) {
};
lime_media_openal_AL.source3i = function(source,param,value1,value2,value3) {
};
lime_media_openal_AL.sourcef = function(source,param,value) {
};
lime_media_openal_AL.sourcefv = function(source,param,values) {
};
lime_media_openal_AL.sourcei = function(source,param,value) {
};
lime_media_openal_AL.filteri = function(filter,param,value) {
};
lime_media_openal_AL.filterf = function(filter,param,value) {
};
lime_media_openal_AL.sourceiv = function(source,param,values) {
};
lime_media_openal_AL.sourcePlay = function(source) {
};
lime_media_openal_AL.sourcePlayv = function(sources) {
};
lime_media_openal_AL.sourceStop = function(source) {
};
lime_media_openal_AL.sourceStopv = function(sources) {
};
lime_media_openal_AL.sourceRewind = function(source) {
};
lime_media_openal_AL.sourceRewindv = function(sources) {
};
lime_media_openal_AL.sourcePause = function(source) {
};
lime_media_openal_AL.sourcePausev = function(sources) {
};
lime_media_openal_AL.sourceQueueBuffer = function(source,buffer) {
};
lime_media_openal_AL.sourceQueueBuffers = function(source,nb,buffers) {
};
lime_media_openal_AL.sourceUnqueueBuffer = function(source) {
	return 0;
};
lime_media_openal_AL.sourceUnqueueBuffers = function(source,nb) {
	return null;
};
lime_media_openal_AL.speedOfSound = function(value) {
};
var lime_media_openal_ALAuxiliaryEffectSlot = {};
lime_media_openal_ALAuxiliaryEffectSlot._new = function(handle) {
	return handle;
};
var lime_media_openal_ALBuffer = {};
lime_media_openal_ALBuffer._new = function(handle) {
	return handle;
};
var lime_media_openal_ALC = function() { };
$hxClasses["lime.media.openal.ALC"] = lime_media_openal_ALC;
lime_media_openal_ALC.__name__ = "lime.media.openal.ALC";
lime_media_openal_ALC.closeDevice = function(device) {
	return false;
};
lime_media_openal_ALC.createContext = function(device,attrlist) {
	return null;
};
lime_media_openal_ALC.destroyContext = function(context) {
};
lime_media_openal_ALC.getContextsDevice = function(context) {
	return null;
};
lime_media_openal_ALC.getCurrentContext = function() {
	return null;
};
lime_media_openal_ALC.getError = function(device) {
	return 0;
};
lime_media_openal_ALC.getErrorString = function(device) {
	switch(lime_media_openal_ALC.getError(device)) {
	case 40961:
		return "INVALID_DEVICE: Invalid device (or no device?)";
	case 40962:
		return "INVALID_CONTEXT: Invalid context (or no context?)";
	case 40963:
		return "INVALID_ENUM: Invalid enum value";
	case 40964:
		return "INVALID_VALUE: Invalid param value";
	case 40965:
		return "OUT_OF_MEMORY: OpenAL has run out of memory";
	default:
		return "";
	}
};
lime_media_openal_ALC.getIntegerv = function(device,param,size) {
	return null;
};
lime_media_openal_ALC.getString = function(device,param) {
	return null;
};
lime_media_openal_ALC.makeContextCurrent = function(context) {
	return false;
};
lime_media_openal_ALC.openDevice = function(deviceName) {
	return null;
};
lime_media_openal_ALC.pauseDevice = function(device) {
};
lime_media_openal_ALC.processContext = function(context) {
};
lime_media_openal_ALC.resumeDevice = function(device) {
};
lime_media_openal_ALC.suspendContext = function(context) {
};
var lime_media_openal_ALContext = {};
lime_media_openal_ALContext._new = function(handle) {
	return handle;
};
var lime_media_openal_ALDevice = {};
lime_media_openal_ALDevice._new = function(handle) {
	return handle;
};
var lime_media_openal_ALEffect = {};
lime_media_openal_ALEffect._new = function(handle) {
	return handle;
};
var lime_media_openal_ALFilter = {};
lime_media_openal_ALFilter._new = function(handle) {
	return handle;
};
var lime_media_openal_ALSource = {};
lime_media_openal_ALSource._new = function(handle) {
	return handle;
};
var lime_media_vorbis_VorbisComment = function() {
};
$hxClasses["lime.media.vorbis.VorbisComment"] = lime_media_vorbis_VorbisComment;
lime_media_vorbis_VorbisComment.__name__ = "lime.media.vorbis.VorbisComment";
lime_media_vorbis_VorbisComment.prototype = {
	userComments: null
	,vendor: null
	,__class__: lime_media_vorbis_VorbisComment
};
var lime_media_vorbis_VorbisFile = function(handle) {
	this.handle = handle;
};
$hxClasses["lime.media.vorbis.VorbisFile"] = lime_media_vorbis_VorbisFile;
lime_media_vorbis_VorbisFile.__name__ = "lime.media.vorbis.VorbisFile";
lime_media_vorbis_VorbisFile.fromBytes = function(bytes) {
	return null;
};
lime_media_vorbis_VorbisFile.fromFile = function(path) {
	return null;
};
lime_media_vorbis_VorbisFile.prototype = {
	bitstream: null
	,handle: null
	,bitrate: function(bitstream) {
		if(bitstream == null) {
			bitstream = -1;
		}
		return 0;
	}
	,bitrateInstant: function() {
		return 0;
	}
	,clear: function() {
	}
	,comment: function(bitstream) {
		if(bitstream == null) {
			bitstream = -1;
		}
		return null;
	}
	,crosslap: function(other) {
		return 0;
	}
	,info: function(bitstream) {
		if(bitstream == null) {
			bitstream = -1;
		}
		return null;
	}
	,pcmSeek: function(pos) {
		return 0;
	}
	,pcmSeekLap: function(pos) {
		return 0;
	}
	,pcmSeekPage: function(pos) {
		return 0;
	}
	,pcmSeekPageLap: function(pos) {
		return 0;
	}
	,pcmTell: function() {
		return new haxe__$Int64__$_$_$Int64(0,0);
	}
	,pcmTotal: function(bitstream) {
		if(bitstream == null) {
			bitstream = -1;
		}
		return new haxe__$Int64__$_$_$Int64(0,0);
	}
	,rawSeek: function(pos) {
		return 0;
	}
	,rawSeekLap: function(pos) {
		return 0;
	}
	,rawTell: function() {
		return new haxe__$Int64__$_$_$Int64(0,0);
	}
	,rawTotal: function(bitstream) {
		if(bitstream == null) {
			bitstream = -1;
		}
		return new haxe__$Int64__$_$_$Int64(0,0);
	}
	,read: function(buffer,position,length,bigEndianPacking,wordSize,signed) {
		if(signed == null) {
			signed = true;
		}
		if(wordSize == null) {
			wordSize = 2;
		}
		if(bigEndianPacking == null) {
			bigEndianPacking = false;
		}
		if(length == null) {
			length = 4096;
		}
		return 0;
	}
	,readFloat: function(pcmChannels,samples) {
		return 0;
	}
	,seekable: function() {
		return false;
	}
	,serialNumber: function(bitstream) {
		if(bitstream == null) {
			bitstream = -1;
		}
		return 0;
	}
	,streams: function() {
		return 0;
	}
	,timeSeek: function(s) {
		return 0;
	}
	,timeSeekLap: function(s) {
		return 0;
	}
	,timeSeekPage: function(s) {
		return 0;
	}
	,timeSeekPageLap: function(s) {
		return 0;
	}
	,timeTell: function() {
		return 0;
	}
	,timeTotal: function(bitstream) {
		if(bitstream == null) {
			bitstream = -1;
		}
		return 0;
	}
	,__class__: lime_media_vorbis_VorbisFile
};
var lime_media_vorbis_VorbisInfo = function() {
};
$hxClasses["lime.media.vorbis.VorbisInfo"] = lime_media_vorbis_VorbisInfo;
lime_media_vorbis_VorbisInfo.__name__ = "lime.media.vorbis.VorbisInfo";
lime_media_vorbis_VorbisInfo.prototype = {
	bitrateLower: null
	,bitrateNominal: null
	,bitrateUpper: null
	,channels: null
	,rate: null
	,version: null
	,__class__: lime_media_vorbis_VorbisInfo
};
var lime_net__$IHTTPRequest = function() { };
$hxClasses["lime.net._IHTTPRequest"] = lime_net__$IHTTPRequest;
lime_net__$IHTTPRequest.__name__ = "lime.net._IHTTPRequest";
lime_net__$IHTTPRequest.__isInterface__ = true;
lime_net__$IHTTPRequest.prototype = {
	contentType: null
	,data: null
	,enableResponseHeaders: null
	,followRedirects: null
	,formData: null
	,headers: null
	,method: null
	,responseHeaders: null
	,responseStatus: null
	,timeout: null
	,uri: null
	,userAgent: null
	,withCredentials: null
	,manageCookies: null
	,cancel: null
	,__class__: lime_net__$IHTTPRequest
};
var lime_net__$HTTPRequest_AbstractHTTPRequest = function(uri) {
	this.uri = uri;
	this.contentType = "application/x-www-form-urlencoded";
	this.followRedirects = true;
	this.enableResponseHeaders = false;
	this.formData = new haxe_ds_StringMap();
	this.headers = [];
	this.method = "GET";
	this.timeout = 30000;
	this.withCredentials = false;
	this.manageCookies = true;
	this.__backend = new lime__$internal_backend_html5_HTML5HTTPRequest();
	this.__backend.init(this);
};
$hxClasses["lime.net._HTTPRequest.AbstractHTTPRequest"] = lime_net__$HTTPRequest_AbstractHTTPRequest;
lime_net__$HTTPRequest_AbstractHTTPRequest.__name__ = "lime.net._HTTPRequest.AbstractHTTPRequest";
lime_net__$HTTPRequest_AbstractHTTPRequest.__interfaces__ = [lime_net__$IHTTPRequest];
lime_net__$HTTPRequest_AbstractHTTPRequest.prototype = {
	contentType: null
	,data: null
	,enableResponseHeaders: null
	,followRedirects: null
	,formData: null
	,headers: null
	,method: null
	,responseData: null
	,responseHeaders: null
	,responseStatus: null
	,timeout: null
	,uri: null
	,userAgent: null
	,withCredentials: null
	,manageCookies: null
	,__backend: null
	,cancel: function() {
		this.__backend.cancel();
	}
	,load: function(uri) {
		return null;
	}
	,__class__: lime_net__$HTTPRequest_AbstractHTTPRequest
};
var lime_net_HTTPRequest = function(uri) {
	lime_net__$HTTPRequest_AbstractHTTPRequest.call(this,uri);
};
$hxClasses["lime.net.HTTPRequest"] = lime_net_HTTPRequest;
lime_net_HTTPRequest.__name__ = "lime.net.HTTPRequest";
lime_net_HTTPRequest.__super__ = lime_net__$HTTPRequest_AbstractHTTPRequest;
lime_net_HTTPRequest.prototype = $extend(lime_net__$HTTPRequest_AbstractHTTPRequest.prototype,{
	__class__: lime_net_HTTPRequest
});
var lime_net__$HTTPRequest_$Bytes = function(uri) {
	lime_net__$HTTPRequest_AbstractHTTPRequest.call(this,uri);
};
$hxClasses["lime.net._HTTPRequest_Bytes"] = lime_net__$HTTPRequest_$Bytes;
lime_net__$HTTPRequest_$Bytes.__name__ = "lime.net._HTTPRequest_Bytes";
lime_net__$HTTPRequest_$Bytes.__super__ = lime_net__$HTTPRequest_AbstractHTTPRequest;
lime_net__$HTTPRequest_$Bytes.prototype = $extend(lime_net__$HTTPRequest_AbstractHTTPRequest.prototype,{
	fromBytes: function(bytes) {
		return bytes;
	}
	,load: function(uri) {
		var _gthis = this;
		if(uri != null) {
			this.uri = uri;
		}
		var promise = new lime_app_Promise();
		var future = this.__backend.loadData(this.uri);
		future.onProgress($bind(promise,promise.progress));
		future.onError(function(errorResponse) {
			_gthis.responseData = errorResponse.responseData;
			promise.error(errorResponse.error);
		});
		future.onComplete(function(bytes) {
			_gthis.responseData = _gthis.fromBytes(bytes);
			promise.complete(_gthis.responseData);
		});
		return promise.future;
	}
	,__class__: lime_net__$HTTPRequest_$Bytes
});
var lime_net__$HTTPRequest_$String = function(uri) {
	lime_net__$HTTPRequest_AbstractHTTPRequest.call(this,uri);
};
$hxClasses["lime.net._HTTPRequest_String"] = lime_net__$HTTPRequest_$String;
lime_net__$HTTPRequest_$String.__name__ = "lime.net._HTTPRequest_String";
lime_net__$HTTPRequest_$String.__super__ = lime_net__$HTTPRequest_AbstractHTTPRequest;
lime_net__$HTTPRequest_$String.prototype = $extend(lime_net__$HTTPRequest_AbstractHTTPRequest.prototype,{
	load: function(uri) {
		var _gthis = this;
		if(uri != null) {
			this.uri = uri;
		}
		var promise = new lime_app_Promise();
		var future = this.__backend.loadText(this.uri);
		future.onProgress($bind(promise,promise.progress));
		future.onError(function(errorResponse) {
			_gthis.responseData = errorResponse.responseData;
			promise.error(errorResponse.error);
		});
		future.onComplete(function(text) {
			_gthis.responseData = text;
			promise.complete(_gthis.responseData);
		});
		return promise.future;
	}
	,__class__: lime_net__$HTTPRequest_$String
});
var lime_net__$HTTPRequestErrorResponse = function(error,responseData) {
	this.error = error;
	this.responseData = responseData;
};
$hxClasses["lime.net._HTTPRequestErrorResponse"] = lime_net__$HTTPRequestErrorResponse;
lime_net__$HTTPRequestErrorResponse.__name__ = "lime.net._HTTPRequestErrorResponse";
lime_net__$HTTPRequestErrorResponse.prototype = {
	error: null
	,responseData: null
	,__class__: lime_net__$HTTPRequestErrorResponse
};
var lime_net_HTTPRequestHeader = function(name,value) {
	if(value == null) {
		value = "";
	}
	this.name = name;
	this.value = value;
};
$hxClasses["lime.net.HTTPRequestHeader"] = lime_net_HTTPRequestHeader;
lime_net_HTTPRequestHeader.__name__ = "lime.net.HTTPRequestHeader";
lime_net_HTTPRequestHeader.prototype = {
	name: null
	,value: null
	,__class__: lime_net_HTTPRequestHeader
};
var lime_net__$HTTPRequest_$lime_$text_$Font = function(uri) {
	lime_net__$HTTPRequest_$Bytes.call(this,uri);
};
$hxClasses["lime.net._HTTPRequest_lime_text_Font"] = lime_net__$HTTPRequest_$lime_$text_$Font;
lime_net__$HTTPRequest_$lime_$text_$Font.__name__ = "lime.net._HTTPRequest_lime_text_Font";
lime_net__$HTTPRequest_$lime_$text_$Font.__super__ = lime_net__$HTTPRequest_$Bytes;
lime_net__$HTTPRequest_$lime_$text_$Font.prototype = $extend(lime_net__$HTTPRequest_$Bytes.prototype,{
	fromBytes: function(bytes) {
		return lime_text_Font.fromBytes(bytes);
	}
	,__class__: lime_net__$HTTPRequest_$lime_$text_$Font
});
var lime_net__$HTTPRequest_$lime_$utils_$Bytes = function(uri) {
	lime_net__$HTTPRequest_$Bytes.call(this,uri);
};
$hxClasses["lime.net._HTTPRequest_lime_utils_Bytes"] = lime_net__$HTTPRequest_$lime_$utils_$Bytes;
lime_net__$HTTPRequest_$lime_$utils_$Bytes.__name__ = "lime.net._HTTPRequest_lime_utils_Bytes";
lime_net__$HTTPRequest_$lime_$utils_$Bytes.__super__ = lime_net__$HTTPRequest_$Bytes;
lime_net__$HTTPRequest_$lime_$utils_$Bytes.prototype = $extend(lime_net__$HTTPRequest_$Bytes.prototype,{
	fromBytes: function(bytes) {
		return lime_utils_Bytes.fromBytes(bytes);
	}
	,__class__: lime_net__$HTTPRequest_$lime_$utils_$Bytes
});
var lime_net__$HTTPRequest_$openfl_$utils_$ByteArray = function(uri) {
	lime_net__$HTTPRequest_$Bytes.call(this,uri);
};
$hxClasses["lime.net._HTTPRequest_openfl_utils_ByteArray"] = lime_net__$HTTPRequest_$openfl_$utils_$ByteArray;
lime_net__$HTTPRequest_$openfl_$utils_$ByteArray.__name__ = "lime.net._HTTPRequest_openfl_utils_ByteArray";
lime_net__$HTTPRequest_$openfl_$utils_$ByteArray.__super__ = lime_net__$HTTPRequest_$Bytes;
lime_net__$HTTPRequest_$openfl_$utils_$ByteArray.prototype = $extend(lime_net__$HTTPRequest_$Bytes.prototype,{
	fromBytes: function(bytes) {
		return openfl_utils_ByteArray.fromBytes(bytes);
	}
	,__class__: lime_net__$HTTPRequest_$openfl_$utils_$ByteArray
});
var lime_system_CFFI = function() { };
$hxClasses["lime.system.CFFI"] = lime_system_CFFI;
lime_system_CFFI.__name__ = "lime.system.CFFI";
lime_system_CFFI.load = function(library,method,args,lazy) {
	if(lazy == null) {
		lazy = false;
	}
	if(args == null) {
		args = 0;
	}
	if(!lime_system_CFFI.enabled) {
		return Reflect.makeVarArgs(function(__) {
			return { };
		});
	}
	var result = null;
	return result;
};
lime_system_CFFI.stringValue = function(value) {
	return value;
};
lime_system_CFFI.__findNDLLFolder = function() {
	return "";
};
lime_system_CFFI.__loaderTrace = function(message) {
};
lime_system_CFFI.__sysName = function() {
	return null;
};
lime_system_CFFI.__tryLoad = function(name,library,func,args) {
	return null;
};
var lime_system_CFFIPointer = {};
lime_system_CFFIPointer._new = function(handle) {
	return handle;
};
lime_system_CFFIPointer.get = function(this1) {
	var tmp = this1 != null;
	return 0;
};
lime_system_CFFIPointer.equals = function(a,b) {
	return lime_system_CFFIPointer.get(a) == b;
};
lime_system_CFFIPointer.equalsPointer = function(a,b) {
	return lime_system_CFFIPointer.get(a) == lime_system_CFFIPointer.get(b);
};
lime_system_CFFIPointer.greaterThan = function(a,b) {
	return lime_system_CFFIPointer.get(a) > b;
};
lime_system_CFFIPointer.greaterThanPointer = function(a,b) {
	return lime_system_CFFIPointer.get(a) > lime_system_CFFIPointer.get(b);
};
lime_system_CFFIPointer.greaterThanOrEqual = function(a,b) {
	return lime_system_CFFIPointer.get(a) >= b;
};
lime_system_CFFIPointer.greaterThanOrEqualPointer = function(a,b) {
	return lime_system_CFFIPointer.get(a) >= lime_system_CFFIPointer.get(b);
};
lime_system_CFFIPointer.lessThan = function(a,b) {
	return lime_system_CFFIPointer.get(a) < b;
};
lime_system_CFFIPointer.lessThanPointer = function(a,b) {
	return lime_system_CFFIPointer.get(a) < lime_system_CFFIPointer.get(b);
};
lime_system_CFFIPointer.lessThanOrEqual = function(a,b) {
	return lime_system_CFFIPointer.get(a) <= b;
};
lime_system_CFFIPointer.lessThanOrEqualPointer = function(a,b) {
	return lime_system_CFFIPointer.get(a) <= lime_system_CFFIPointer.get(b);
};
lime_system_CFFIPointer.notEquals = function(a,b) {
	return lime_system_CFFIPointer.get(a) != b;
};
lime_system_CFFIPointer.notEqualsPointer = function(a,b) {
	return lime_system_CFFIPointer.get(a) != lime_system_CFFIPointer.get(b);
};
var lime_system_Clipboard = function() { };
$hxClasses["lime.system.Clipboard"] = lime_system_Clipboard;
lime_system_Clipboard.__name__ = "lime.system.Clipboard";
lime_system_Clipboard.__properties__ = {set_text:"set_text",get_text:"get_text"};
lime_system_Clipboard.__update = function() {
	var cacheText = lime_system_Clipboard._text;
	lime_system_Clipboard._text = null;
	lime_system_Clipboard._text = cacheText;
	lime_system_Clipboard.__updated = true;
	if(lime_system_Clipboard._text != cacheText) {
		lime_system_Clipboard.onUpdate.dispatch();
	}
};
lime_system_Clipboard.get_text = function() {
	lime_system_Clipboard.__update();
	return lime_system_Clipboard._text;
};
lime_system_Clipboard.set_text = function(value) {
	var cacheText = lime_system_Clipboard._text;
	lime_system_Clipboard._text = value;
	var window1 = lime_app_Application.current.__window;
	if(window1 != null) {
		window1.__backend.setClipboard(value);
	}
	if(lime_system_Clipboard._text != cacheText) {
		lime_system_Clipboard.onUpdate.dispatch();
	}
	return value;
};
var lime_system_Display = function() {
};
$hxClasses["lime.system.Display"] = lime_system_Display;
lime_system_Display.__name__ = "lime.system.Display";
lime_system_Display.prototype = {
	bounds: null
	,currentMode: null
	,id: null
	,dpi: null
	,orientation: null
	,name: null
	,supportedModes: null
	,safeArea: null
	,__class__: lime_system_Display
};
var lime_system_DisplayMode = function(width,height,refreshRate,pixelFormat) {
	this.width = width;
	this.height = height;
	this.refreshRate = refreshRate;
	this.pixelFormat = pixelFormat;
};
$hxClasses["lime.system.DisplayMode"] = lime_system_DisplayMode;
lime_system_DisplayMode.__name__ = "lime.system.DisplayMode";
lime_system_DisplayMode.prototype = {
	height: null
	,pixelFormat: null
	,refreshRate: null
	,width: null
	,__class__: lime_system_DisplayMode
};
var lime_system_Endian = $hxEnums["lime.system.Endian"] = { __ename__:"lime.system.Endian",__constructs__:null
	,LITTLE_ENDIAN: {_hx_name:"LITTLE_ENDIAN",_hx_index:0,__enum__:"lime.system.Endian",toString:$estr}
	,BIG_ENDIAN: {_hx_name:"BIG_ENDIAN",_hx_index:1,__enum__:"lime.system.Endian",toString:$estr}
};
lime_system_Endian.__constructs__ = [lime_system_Endian.LITTLE_ENDIAN,lime_system_Endian.BIG_ENDIAN];
var lime_system_JNI = function() { };
$hxClasses["lime.system.JNI"] = lime_system_JNI;
lime_system_JNI.__name__ = "lime.system.JNI";
lime_system_JNI.transformClassName = function(className) {
	var parts = className.split(".");
	if(parts.length <= 1) {
		return className;
	}
	var nestedClassName = "";
	if(new EReg("^[A-Z]","").match(parts[parts.length - 2])) {
		nestedClassName = "$" + parts.pop();
	}
	return parts.join("/") + nestedClassName;
};
lime_system_JNI.callMember = function(method,jobject,a) {
	return method.apply(null,[jobject].concat(a));
};
lime_system_JNI.callStatic = function(method,a) {
	return method.apply(null,a);
};
lime_system_JNI.createMemberField = function(className,memberName,signature) {
	lime_system_JNI.init();
	return new lime_system_JNIMemberField(null);
};
lime_system_JNI.createMemberMethod = function(className,memberName,signature,useArray,quietFail) {
	if(quietFail == null) {
		quietFail = false;
	}
	if(useArray == null) {
		useArray = false;
	}
	lime_system_JNI.init();
	return null;
};
lime_system_JNI.createStaticField = function(className,memberName,signature) {
	lime_system_JNI.init();
	return new lime_system_JNIStaticField(null);
};
lime_system_JNI.createStaticMethod = function(className,memberName,signature,useArray,quietFail) {
	if(quietFail == null) {
		quietFail = false;
	}
	if(useArray == null) {
		useArray = false;
	}
	lime_system_JNI.init();
	return null;
};
lime_system_JNI.getEnv = function() {
	lime_system_JNI.init();
	return null;
};
lime_system_JNI.init = function() {
	if(!lime_system_JNI.initialized) {
		lime_system_JNI.initialized = true;
	}
};
lime_system_JNI.onCallback = function(object,method,args) {
	var field = Reflect.field(object,method);
	if(field != null) {
		if(args == null) {
			args = [];
		}
		return field.apply(object,args);
	}
	haxe_Log.trace("onCallback - unknown field " + method,{ fileName : "lime/system/JNI.hx", lineNumber : 223, className : "lime.system.JNI", methodName : "onCallback"});
	return null;
};
lime_system_JNI.postUICallback = function(callback) {
	callback();
};
var lime_system_JNIMemberField = function(field) {
	this.field = field;
};
$hxClasses["lime.system.JNIMemberField"] = lime_system_JNIMemberField;
lime_system_JNIMemberField.__name__ = "lime.system.JNIMemberField";
lime_system_JNIMemberField.prototype = {
	field: null
	,get: function(jobject) {
		return null;
	}
	,set: function(jobject,value) {
		return value;
	}
	,__class__: lime_system_JNIMemberField
};
var lime_system_JNIStaticField = function(field) {
	this.field = field;
};
$hxClasses["lime.system.JNIStaticField"] = lime_system_JNIStaticField;
lime_system_JNIStaticField.__name__ = "lime.system.JNIStaticField";
lime_system_JNIStaticField.prototype = {
	field: null
	,get: function() {
		return null;
	}
	,set: function(value) {
		return value;
	}
	,__class__: lime_system_JNIStaticField
};
var lime_system_JNIMethod = function(method) {
	this.method = method;
};
$hxClasses["lime.system.JNIMethod"] = lime_system_JNIMethod;
lime_system_JNIMethod.__name__ = "lime.system.JNIMethod";
lime_system_JNIMethod.prototype = {
	method: null
	,callMember: function(args) {
		return null;
	}
	,callStatic: function(args) {
		return null;
	}
	,getMemberMethod: function(useArray) {
		if(useArray) {
			return $bind(this,this.callMember);
		} else {
			return Reflect.makeVarArgs($bind(this,this.callMember));
		}
	}
	,getStaticMethod: function(useArray) {
		if(useArray) {
			return $bind(this,this.callStatic);
		} else {
			return Reflect.makeVarArgs($bind(this,this.callStatic));
		}
	}
	,__class__: lime_system_JNIMethod
};
var lime_system_JNISafety = function() { };
$hxClasses["lime.system.JNISafety"] = lime_system_JNISafety;
lime_system_JNISafety.__name__ = "lime.system.JNISafety";
lime_system_JNISafety.__isInterface__ = true;
var lime_system_JNISafetyTools = function() { };
$hxClasses["lime.system.JNISafetyTools"] = lime_system_JNISafetyTools;
lime_system_JNISafetyTools.__name__ = "lime.system.JNISafetyTools";
lime_system_JNISafetyTools.onMainThread = function() {
	return true;
};
var lime_system_Locale = {};
lime_system_Locale.__properties__ = {get_region:"get_region",get_language:"get_language",get_systemLocale:"get_systemLocale",set_currentLocale:"set_currentLocale",get_currentLocale:"get_currentLocale"};
lime_system_Locale._new = function(value) {
	return value;
};
lime_system_Locale.equals = function(a,b) {
	var language = lime_system_Locale.get_language(a);
	var region = lime_system_Locale.get_region(a);
	var language2 = lime_system_Locale.get_language(b);
	var region2 = lime_system_Locale.get_region(b);
	var languageMatch = language == language2;
	var regionMatch = region == region2;
	if(!languageMatch && language != null && language2 != null) {
		languageMatch = language.toLowerCase() == language2.toLowerCase();
	}
	if(!regionMatch && region != null && region2 != null) {
		regionMatch = region.toLowerCase() == region2.toLowerCase();
	}
	if(languageMatch) {
		return regionMatch;
	} else {
		return false;
	}
};
lime_system_Locale.__init = function() {
	if(lime_system_Locale.__systemLocale == null) {
		var locale = null;
		locale = navigator.language;
		if(locale != null) {
			lime_system_Locale.__systemLocale = locale;
		} else {
			lime_system_Locale.__systemLocale = "en-US";
		}
		lime_system_Locale.set_currentLocale(lime_system_Locale.__systemLocale);
	}
};
lime_system_Locale.get_language = function(this1) {
	if(this1 != null) {
		var index = this1.indexOf("_");
		if(index > -1) {
			var dashIndex = this1.indexOf("-");
			if(dashIndex > -1 && dashIndex < index) {
				index = dashIndex;
			}
			return this1.substring(0,index);
		}
		index = this1.indexOf("-");
		if(index > -1) {
			return this1.substring(0,index);
		}
	}
	return this1;
};
lime_system_Locale.get_region = function(this1) {
	if(this1 != null) {
		var underscoreIndex = this1.indexOf("_");
		var dotIndex = this1.indexOf(".");
		var dashIndex = this1.indexOf("-");
		if(underscoreIndex > -1) {
			if(dotIndex > -1) {
				return this1.substring(underscoreIndex + 1,dotIndex);
			} else {
				return this1.substring(underscoreIndex + 1);
			}
		} else if(dashIndex > -1) {
			if(dotIndex > -1) {
				return this1.substring(dashIndex + 1,dotIndex);
			} else {
				return this1.substring(dashIndex + 1);
			}
		}
	}
	return null;
};
lime_system_Locale.get_currentLocale = function() {
	lime_system_Locale.__init();
	return lime_system_Locale.currentLocale;
};
lime_system_Locale.set_currentLocale = function(value) {
	lime_system_Locale.__init();
	return lime_system_Locale.currentLocale = value;
};
lime_system_Locale.get_systemLocale = function() {
	lime_system_Locale.__init();
	return lime_system_Locale.__systemLocale;
};
var lime_system_Sensor = function(type,id) {
	this.onUpdate = new lime_app__$Event_$Float_$Float_$Float_$Void();
	this.type = type;
	this.id = id;
};
$hxClasses["lime.system.Sensor"] = lime_system_Sensor;
lime_system_Sensor.__name__ = "lime.system.Sensor";
lime_system_Sensor.getSensors = function(type) {
	if(type == null) {
		return lime_system_Sensor.sensors.slice();
	} else {
		var result = [];
		var _g = 0;
		var _g1 = lime_system_Sensor.sensors;
		while(_g < _g1.length) {
			var sensor = _g1[_g];
			++_g;
			if(sensor.type == type) {
				result.push(sensor);
			}
		}
		return result;
	}
};
lime_system_Sensor.registerSensor = function(type,id) {
	var sensor = new lime_system_Sensor(type,id);
	lime_system_Sensor.sensors.push(sensor);
	lime_system_Sensor.sensorByID.h[id] = sensor;
	return sensor;
};
lime_system_Sensor.prototype = {
	id: null
	,onUpdate: null
	,type: null
	,__class__: lime_system_Sensor
};
var lime_system_SensorType = $hxEnums["lime.system.SensorType"] = { __ename__:"lime.system.SensorType",__constructs__:null
	,ACCELEROMETER: {_hx_name:"ACCELEROMETER",_hx_index:0,__enum__:"lime.system.SensorType",toString:$estr}
};
lime_system_SensorType.__constructs__ = [lime_system_SensorType.ACCELEROMETER];
var lime_system_System = function() { };
$hxClasses["lime.system.System"] = lime_system_System;
lime_system_System.__name__ = "lime.system.System";
lime_system_System.__properties__ = {get_userDirectory:"get_userDirectory",get_platformVersion:"get_platformVersion",get_platformName:"get_platformName",get_platformLabel:"get_platformLabel",get_numDisplays:"get_numDisplays",get_fontsDirectory:"get_fontsDirectory",get_endianness:"get_endianness",get_documentsDirectory:"get_documentsDirectory",get_deviceVendor:"get_deviceVendor",get_deviceModel:"get_deviceModel",get_desktopDirectory:"get_desktopDirectory",get_applicationStorageDirectory:"get_applicationStorageDirectory",get_applicationDirectory:"get_applicationDirectory",set_allowScreenTimeout:"set_allowScreenTimeout",get_allowScreenTimeout:"get_allowScreenTimeout"};
lime_system_System.embed = $hx_exports["lime"]["embed"] = function(projectName,element,width,height,config) {
	if(lime_system_System.__applicationEntryPoint == null) {
		return;
	}
	if(Object.prototype.hasOwnProperty.call(lime_system_System.__applicationEntryPoint.h,projectName)) {
		var htmlElement = null;
		if(typeof(element) == "string") {
			htmlElement = window.document.getElementById(element);
		} else if(element == null) {
			htmlElement = window.document.createElement("div");
		} else {
			htmlElement = element;
		}
		if(htmlElement == null) {
			window.console.log("[lime.embed] ERROR: Cannot find target element: " + Std.string(element));
			return;
		}
		if(width == null) {
			width = 0;
		}
		if(height == null) {
			height = 0;
		}
		if(config == null) {
			config = { };
		}
		if(Object.prototype.hasOwnProperty.call(config,"background") && typeof(config.background) == "string") {
			var background = StringTools.replace(Std.string(config.background),"#","");
			if(background.indexOf("0x") > -1) {
				config.background = Std.parseInt(background);
			} else {
				config.background = Std.parseInt("0x" + background);
			}
		}
		config.element = htmlElement;
		config.width = width;
		config.height = height;
		lime_system_System.__applicationEntryPoint.h[projectName](config);
	}
};
lime_system_System.exit = function(code) {
	var currentApp = lime_app_Application.current;
	if(currentApp != null) {
		currentApp.onExit.dispatch(code);
		if(currentApp.onExit.canceled) {
			return;
		}
	}
	if(currentApp != null && currentApp.__window != null) {
		currentApp.__window.close();
	}
};
lime_system_System.getDisplay = function(id) {
	if(id == 0) {
		var display = new lime_system_Display();
		display.id = 0;
		display.name = "Generic Display";
		display.dpi = 96 * window.devicePixelRatio;
		display.currentMode = new lime_system_DisplayMode(window.screen.width,window.screen.height,60,1);
		if(window.screen.orientation != null) {
			switch(window.screen.orientation.type) {
			case "landscape-primary":
				display.orientation = 1;
				break;
			case "landscape-secondary":
				display.orientation = 2;
				break;
			case "portrait-primary":
				display.orientation = 3;
				break;
			case "portrait-secondary":
				display.orientation = 4;
				break;
			default:
				display.orientation = 0;
			}
		} else {
			display.orientation = 0;
		}
		display.supportedModes = [display.currentMode];
		display.bounds = new lime_math_Rectangle(0,0,display.currentMode.width,display.currentMode.height);
		display.safeArea = new lime_math_Rectangle(0,0,display.currentMode.width,display.currentMode.height);
		return display;
	}
	return null;
};
lime_system_System.getTimer = function() {
	return window.performance.now() | 0;
};
lime_system_System.load = function(library,method,args,lazy) {
	if(lazy == null) {
		lazy = false;
	}
	if(args == null) {
		args = 0;
	}
	return lime_system_CFFI.load(library,method,args,lazy);
};
lime_system_System.openFile = function(path) {
	if(path != null) {
		window.open(path,"_blank");
	}
};
lime_system_System.openURL = function(url,target) {
	if(target == null) {
		target = "_blank";
	}
	if(url != null) {
		window.open(url,target);
	}
};
lime_system_System.__copyMissingFields = function(target,source) {
	if(source == null || target == null) {
		return;
	}
	var _g = 0;
	var _g1 = Reflect.fields(source);
	while(_g < _g1.length) {
		var field = _g1[_g];
		++_g;
		if(!Object.prototype.hasOwnProperty.call(target,field)) {
			target[field] = Reflect.field(source,field);
		}
	}
};
lime_system_System.__getDirectory = function(type) {
	return null;
};
lime_system_System.__parseBool = function(value) {
	return value == "true";
};
lime_system_System.__registerEntryPoint = function(projectName,entryPoint) {
	if(lime_system_System.__applicationEntryPoint == null) {
		lime_system_System.__applicationEntryPoint = new haxe_ds_StringMap();
	}
	lime_system_System.__applicationEntryPoint.h[projectName] = entryPoint;
};
lime_system_System.__runProcess = function(command,args) {
	return null;
};
lime_system_System.get_allowScreenTimeout = function() {
	return true;
};
lime_system_System.set_allowScreenTimeout = function(value) {
	return true;
};
lime_system_System.get_applicationDirectory = function() {
	if(lime_system_System.__applicationDirectory == null) {
		lime_system_System.__applicationDirectory = lime_system_System.__getDirectory(0);
	}
	return lime_system_System.__applicationDirectory;
};
lime_system_System.get_applicationStorageDirectory = function() {
	if(lime_system_System.__applicationStorageDirectory == null) {
		lime_system_System.__applicationStorageDirectory = lime_system_System.__getDirectory(1);
	}
	return lime_system_System.__applicationStorageDirectory;
};
lime_system_System.get_deviceModel = function() {
	var tmp = lime_system_System.__deviceModel == null;
	return lime_system_System.__deviceModel;
};
lime_system_System.get_deviceVendor = function() {
	var tmp = lime_system_System.__deviceVendor == null;
	return lime_system_System.__deviceVendor;
};
lime_system_System.get_desktopDirectory = function() {
	if(lime_system_System.__desktopDirectory == null) {
		lime_system_System.__desktopDirectory = lime_system_System.__getDirectory(2);
	}
	return lime_system_System.__desktopDirectory;
};
lime_system_System.get_documentsDirectory = function() {
	if(lime_system_System.__documentsDirectory == null) {
		lime_system_System.__documentsDirectory = lime_system_System.__getDirectory(3);
	}
	return lime_system_System.__documentsDirectory;
};
lime_system_System.get_endianness = function() {
	if(lime_system_System.__endianness == null) {
		var arrayBuffer = new ArrayBuffer(2);
		var elements = null;
		var array = null;
		var vector = null;
		var view = null;
		var len = null;
		var this1;
		if(elements != null) {
			this1 = new Uint8Array(elements);
		} else if(array != null) {
			this1 = new Uint8Array(array);
		} else if(vector != null) {
			this1 = new Uint8Array(vector.__array);
		} else if(view != null) {
			this1 = new Uint8Array(view);
		} else if(arrayBuffer != null) {
			if(len == null) {
				this1 = new Uint8Array(arrayBuffer,0);
			} else {
				this1 = new Uint8Array(arrayBuffer,0,len);
			}
		} else {
			this1 = null;
		}
		var uint8Array = this1;
		var elements = null;
		var array = null;
		var vector = null;
		var view = null;
		var len = null;
		var this1;
		if(elements != null) {
			this1 = new Uint16Array(elements);
		} else if(array != null) {
			this1 = new Uint16Array(array);
		} else if(vector != null) {
			this1 = new Uint16Array(vector.__array);
		} else if(view != null) {
			this1 = new Uint16Array(view);
		} else if(arrayBuffer != null) {
			if(len == null) {
				this1 = new Uint16Array(arrayBuffer,0);
			} else {
				this1 = new Uint16Array(arrayBuffer,0,len);
			}
		} else {
			this1 = null;
		}
		var uint16array = this1;
		uint8Array[0] = 170;
		uint8Array[1] = 187;
		if(uint16array[0] == 43707) {
			lime_system_System.__endianness = lime_system_Endian.BIG_ENDIAN;
		} else {
			lime_system_System.__endianness = lime_system_Endian.LITTLE_ENDIAN;
		}
	}
	return lime_system_System.__endianness;
};
lime_system_System.get_fontsDirectory = function() {
	if(lime_system_System.__fontsDirectory == null) {
		lime_system_System.__fontsDirectory = lime_system_System.__getDirectory(4);
	}
	return lime_system_System.__fontsDirectory;
};
lime_system_System.get_numDisplays = function() {
	return 1;
};
lime_system_System.get_platformLabel = function() {
	if(lime_system_System.__platformLabel == null) {
		var name = lime_system_System.get_platformName();
		var version = lime_system_System.get_platformVersion();
		if(name != null && version != null) {
			lime_system_System.__platformLabel = name + " " + version;
		} else if(name != null) {
			lime_system_System.__platformLabel = name;
		}
	}
	return lime_system_System.__platformLabel;
};
lime_system_System.get_platformName = function() {
	if(lime_system_System.__platformName == null) {
		lime_system_System.__platformName = "HTML5";
	}
	return lime_system_System.__platformName;
};
lime_system_System.get_platformVersion = function() {
	var tmp = lime_system_System.__platformVersion == null;
	return lime_system_System.__platformVersion;
};
lime_system_System.get_userDirectory = function() {
	if(lime_system_System.__userDirectory == null) {
		lime_system_System.__userDirectory = lime_system_System.__getDirectory(5);
	}
	return lime_system_System.__userDirectory;
};
var lime_system_WorkOutput = function(mode) {
	this.__activeJob = new lime_system_Tls();
	this.__jobComplete = new lime_system_Tls();
	this.__jobOutput = new haxe_ds_List();
	this.workIterations = new lime_system_Tls();
	this.workIterations.value = 0;
	this.__jobComplete.value = false;
	this.mode = mode != null && mode;
};
$hxClasses["lime.system.WorkOutput"] = lime_system_WorkOutput;
lime_system_WorkOutput.__name__ = "lime.system.WorkOutput";
lime_system_WorkOutput.prototype = {
	workIterations: null
	,mode: null
	,__jobOutput: null
	,__jobComplete: null
	,__activeJob: null
	,sendComplete: function(message,transferList) {
		if(!this.__jobComplete.value) {
			this.__jobComplete.value = true;
			var event = { event : "COMPLETE", message : message, jobID : this.__activeJob.value.id};
			if(lime__$internal_backend_html5_HTML5Thread.__current.__worker != null || lime__$internal_backend_html5_HTML5Thread.__isWorker) {
				lime__$internal_backend_html5_HTML5Thread.returnMessage(event,transferList);
			} else {
				this.__jobOutput.add(event);
			}
		}
	}
	,sendError: function(message,transferList) {
		if(!this.__jobComplete.value) {
			this.__jobComplete.value = true;
			var event = { event : "ERROR", message : message, jobID : this.__activeJob.value.id};
			if(lime__$internal_backend_html5_HTML5Thread.__current.__worker != null || lime__$internal_backend_html5_HTML5Thread.__isWorker) {
				lime__$internal_backend_html5_HTML5Thread.returnMessage(event,transferList);
			} else {
				this.__jobOutput.add(event);
			}
		}
	}
	,sendProgress: function(message,transferList) {
		if(!this.__jobComplete.value) {
			var event = { event : "PROGRESS", message : message, jobID : this.__activeJob.value.id};
			if(lime__$internal_backend_html5_HTML5Thread.__current.__worker != null || lime__$internal_backend_html5_HTML5Thread.__isWorker) {
				lime__$internal_backend_html5_HTML5Thread.returnMessage(event,transferList);
			} else {
				this.__jobOutput.add(event);
			}
		}
	}
	,sendUncaughtError: function(message) {
		if(!this.__jobComplete.value) {
			this.__jobComplete.value = true;
			var event = { event : "UNCAUGHT_ERROR", message : message, jobID : this.__activeJob.value.id};
			if(lime__$internal_backend_html5_HTML5Thread.__current.__worker != null || lime__$internal_backend_html5_HTML5Thread.__isWorker) {
				lime__$internal_backend_html5_HTML5Thread.returnMessage(event,null);
			} else {
				this.__jobOutput.add(event);
			}
		}
	}
	,sendThreadEvent: function(event,transferList) {
		if(lime__$internal_backend_html5_HTML5Thread.__current.__worker != null || lime__$internal_backend_html5_HTML5Thread.__isWorker) {
			lime__$internal_backend_html5_HTML5Thread.returnMessage(event,transferList);
		} else {
			this.__jobOutput.add(event);
		}
	}
	,resetJobProgress: function() {
		this.__jobComplete.value = false;
		this.workIterations.value = 0;
	}
	,createThread: function(executeThread) {
		var _gthis = this;
		var thread = lime__$internal_backend_html5_HTML5Thread.create(executeThread);
		thread.onMessage.add(function(event) {
			_gthis.__jobOutput.add(event);
		});
		return thread;
	}
	,get_activeJob: function() {
		return this.__activeJob.value;
	}
	,set_activeJob: function(value) {
		return this.__activeJob.value = value;
	}
	,__class__: lime_system_WorkOutput
	,__properties__: {set_activeJob:"set_activeJob",get_activeJob:"get_activeJob"}
};
var lime_system_ThreadPool = function(minThreads,maxThreads,mode) {
	if(maxThreads == null) {
		maxThreads = 1;
	}
	if(minThreads == null) {
		minThreads = 0;
	}
	this.__singleThreadedJobs = new lime_system__$ThreadPool_JobArray();
	this.__singleThreadedJobRunning = false;
	this.__threads = [];
	this.__queuedExitEvents = 0;
	this.__multiThreadedJobs = new lime_system__$ThreadPool_JobArray();
	this.workPriority = 1;
	this.onUncaughtError = new lime_app__$Event_$haxe_$Exception_$Void();
	this.onRun = new lime_app__$Event_$lime_$system_$State_$Void();
	this.onProgress = new lime_app__$Event_$Dynamic_$Void();
	this.onError = new lime_app__$Event_$Dynamic_$Void();
	this.onComplete = new lime_app__$Event_$Dynamic_$Void();
	this.__idleThreads = 0;
	this.activeThreads = 0;
	if(lime__$internal_backend_html5_HTML5Thread.__current.__worker != null || lime__$internal_backend_html5_HTML5Thread.__isWorker) {
		throw haxe_Exception.thrown("Call new ThreadPool() only from the main thread.");
	}
	lime_system_WorkOutput.call(this,mode);
	this.minThreads = minThreads;
	this.maxThreads = maxThreads;
};
$hxClasses["lime.system.ThreadPool"] = lime_system_ThreadPool;
lime_system_ThreadPool.__name__ = "lime.system.ThreadPool";
lime_system_ThreadPool.isMainThread = function() {
	return !(lime__$internal_backend_html5_HTML5Thread.__current.__worker != null || lime__$internal_backend_html5_HTML5Thread.__isWorker);
};
lime_system_ThreadPool.__executeThread = function() {
	(async function() {
		var args = lime__$internal_backend_html5_HTML5Thread.__messages.isEmpty() ? await new Promise(function(resolve,_) {
			lime__$internal_backend_html5_HTML5Thread.__resolveMethods.add(resolve);
		}) : await new Promise(function(resolve,_) {
			$global.setTimeout(resolve);
		}).then(function(_) {
			return lime__$internal_backend_html5_HTML5Thread.__messages.pop();
		});
		var output = new lime_system_WorkOutput(true);
		var event = null;
		var firstLoop = true;
		while(true) {
			if(event == null) {
				event = await new Promise(function(resolve,_) {
					$global.setTimeout(resolve);
				}).then(function(_) {
					return lime__$internal_backend_html5_HTML5Thread.__messages.pop();
				});
				if(event == null && !firstLoop) {
					var event1 = { event : "IDLE", threadID : args.threadID};
					if(lime__$internal_backend_html5_HTML5Thread.__current.__worker != null || lime__$internal_backend_html5_HTML5Thread.__isWorker) {
						lime__$internal_backend_html5_HTML5Thread.returnMessage(event1,null);
					} else {
						output.__jobOutput.add(event1);
					}
				}
				while(event == null) event = lime__$internal_backend_html5_HTML5Thread.__messages.isEmpty() ? await new Promise(function(resolve,_) {
					lime__$internal_backend_html5_HTML5Thread.__resolveMethods.add(resolve);
				}) : await new Promise(function(resolve,_) {
					$global.setTimeout(resolve);
				}).then(function(_) {
					return lime__$internal_backend_html5_HTML5Thread.__messages.pop();
				});
				output.__jobComplete.value = false;
				output.workIterations.value = 0;
				firstLoop = false;
			}
			if(event.event == "EXIT") {
				var event2 = { event : "EXIT", threadID : args.threadID};
				if(lime__$internal_backend_html5_HTML5Thread.__current.__worker != null || lime__$internal_backend_html5_HTML5Thread.__isWorker) {
					lime__$internal_backend_html5_HTML5Thread.returnMessage(event2,null);
				} else {
					output.__jobOutput.add(event2);
				}
				lime__$internal_backend_html5_HTML5Thread.__current.destroy();
				return;
			}
			if(event.event != "WORK" || event.doWork == null || event.jobID == null) {
				event = null;
				continue;
			}
			var value = new lime_system_JobData(event.doWork,event.state,event.jobID);
			output.__activeJob.value = value;
			var interruption = null;
			try {
				while(true) {
					var tmp;
					if(!output.__jobComplete.value) {
						interruption = await new Promise(function(resolve,_) {
							$global.setTimeout(resolve);
						}).then(function(_) {
							return lime__$internal_backend_html5_HTML5Thread.__messages.pop();
						});
						tmp = interruption == null;
					} else {
						tmp = false;
					}
					if(!tmp) {
						break;
					}
					if(output.workIterations.value == 0) {
						var event3 = { event : "WORK", jobID : event.jobID, threadID : args.threadID};
						if(lime__$internal_backend_html5_HTML5Thread.__current.__worker != null || lime__$internal_backend_html5_HTML5Thread.__isWorker) {
							lime__$internal_backend_html5_HTML5Thread.returnMessage(event3,null);
						} else {
							output.__jobOutput.add(event3);
						}
					}
					output.workIterations.value += 1;
					(lime__$internal_backend_html5_WorkFunction.toFunction(event.doWork))(event.state,output);
				}
			} catch( _g ) {
				var e = haxe_Exception.caught(_g);
				output.sendUncaughtError(e);
			}
			output.__activeJob.value = null;
			if(interruption == null || output.__jobComplete.value) {
				event = interruption;
			} else {
				event = interruption;
				output.__jobComplete.value = false;
				output.workIterations.value = 0;
			}
		}
	})();
};
lime_system_ThreadPool.timestamp = function() {
	return new Date().getTime() / 1000;
};
lime_system_ThreadPool.__super__ = lime_system_WorkOutput;
lime_system_ThreadPool.prototype = $extend(lime_system_WorkOutput.prototype,{
	activeThreads: null
	,__idleThreads: null
	,maxThreads: null
	,minThreads: null
	,onComplete: null
	,onError: null
	,onProgress: null
	,onRun: null
	,onUncaughtError: null
	,workPriority: null
	,__doWork: null
	,__multiThreadedJobs: null
	,__queuedExitEvents: null
	,__threads: null
	,__singleThreadedJobRunning: null
	,__singleThreadedJobs: null
	,cancel: function(error) {
		if(lime__$internal_backend_html5_HTML5Thread.__current.__worker != null || lime__$internal_backend_html5_HTML5Thread.__isWorker) {
			throw haxe_Exception.thrown("Call cancel() only from the main thread.");
		}
		if(error != null) {
			var _this = this.__multiThreadedJobs;
			var _g_jobs = _this.jobs;
			var _g_index = _this.startIndex;
			while(_g_index < _g_jobs.length) {
				var job = _g_jobs[_g_index++];
				if(job.startTime >= 0) {
					job.duration = new Date().getTime() / 1000 - job.startTime;
				}
				this.__activeJob.value = job;
				this.onError.dispatch(error);
				this.__activeJob.value = null;
			}
		}
		var _this = this.__multiThreadedJobs;
		_this.jobs.length = 0;
		_this.startIndex = 0;
		var _g = 0;
		var _g1 = this.__threads.length;
		while(_g < _g1) {
			var threadID = _g++;
			var threadData = this.__threads[threadID];
			if(threadData != null && threadData.jobID != null) {
				threadData.thread.sendMessage({ event : "IDLE"});
			}
		}
		if(error != null) {
			var _this = this.__singleThreadedJobs;
			var _g_jobs = _this.jobs;
			var _g_index = _this.startIndex;
			while(_g_index < _g_jobs.length) {
				var job = _g_jobs[_g_index++];
				this.__activeJob.value = job;
				this.onError.dispatch(error);
			}
		}
		var _this = this.__singleThreadedJobs;
		_this.jobs.length = 0;
		_this.startIndex = 0;
		if(false != this.__singleThreadedJobRunning) {
			lime_system_ThreadPool.__totalWorkPriority -= this.workPriority;
		}
		this.__singleThreadedJobRunning = false;
		this.__jobComplete.value = false;
		this.__activeJob.value = null;
	}
	,cancelJob: function(jobID) {
		if(this.__singleThreadedJobs.removeJob(jobID) != null) {
			var _this = this.__singleThreadedJobs;
			var value = _this.jobs.length - _this.startIndex > 0;
			if(value != this.__singleThreadedJobRunning) {
				if(value) {
					lime_system_ThreadPool.__totalWorkPriority += this.workPriority;
				} else {
					lime_system_ThreadPool.__totalWorkPriority -= this.workPriority;
				}
			}
			this.__singleThreadedJobRunning = value;
			return true;
		}
		var job = this.__multiThreadedJobs.removeJob(jobID);
		if(job != null) {
			var _g = 0;
			var _g1 = this.__threads;
			while(_g < _g1.length) {
				var threadData = _g1[_g];
				++_g;
				if(threadData != null && threadData.jobID == jobID) {
					threadData.thread.sendMessage({ event : "IDLE"});
					break;
				}
			}
			return true;
		}
		return false;
	}
	,queue: function(doWork,state) {
		return this.run(doWork,state);
	}
	,run: function(doWork,state,mode) {
		if(lime__$internal_backend_html5_HTML5Thread.__current.__worker != null || lime__$internal_backend_html5_HTML5Thread.__isWorker) {
			throw haxe_Exception.thrown("Call run() only from the main thread.");
		}
		if(mode == null) {
			mode = this.mode;
		}
		if(doWork == null) {
			if(this.__doWork == null || mode == true) {
				throw haxe_Exception.thrown("run() requires doWork argument.");
			} else {
				doWork = this.__doWork;
			}
		}
		if(state == null) {
			state = { };
		}
		var job = new lime_system_JobData(doWork,state);
		if(mode == true) {
			this.__multiThreadedJobs.jobs.push(job);
			this.__runMultiThreadedJob(job);
		} else {
			this.__singleThreadedJobs.jobs.push(job);
			if(true != this.__singleThreadedJobRunning) {
				lime_system_ThreadPool.__totalWorkPriority += this.workPriority;
			}
			this.__singleThreadedJobRunning = true;
		}
		if(lime_app_Application.current != null && !lime_app_Application.current.onUpdate.has($bind(this,this.__update))) {
			lime_app_Application.current.onUpdate.add($bind(this,this.__update));
		}
		return job.id;
	}
	,__dispatchJobOutput: function(event) {
		var oldActiveJob = this.__activeJob.value;
		this.__activeJob.value = null;
		var tmp;
		var _this = this.__singleThreadedJobs;
		if(_this.jobs.length - _this.startIndex > 0) {
			var _this = this.__singleThreadedJobs;
			tmp = event.jobID == _this.jobs[_this.startIndex].id;
		} else {
			tmp = false;
		}
		if(tmp) {
			var _this = this.__singleThreadedJobs;
			this.__activeJob.value = _this.jobs[_this.startIndex];
		} else {
			var value = this.__multiThreadedJobs.getJob(event.jobID);
			if((this.__activeJob.value = value) != null) {
				if(this.__activeJob.value.startTime >= 0) {
					var tmp = new Date().getTime() / 1000;
					this.__activeJob.value.duration = tmp - this.__activeJob.value.startTime;
				}
				if(event.event == "COMPLETE" || event.event == "ERROR" || event.event == "UNCAUGHT_ERROR") {
					this.__multiThreadedJobs.removeJob(this.__activeJob.value.id);
				}
			} else if(event.jobID != null) {
				this.__activeJob.value = oldActiveJob;
				return;
			}
		}
		switch(event.event) {
		case "COMPLETE":
			this.onComplete.dispatch(event.message);
			break;
		case "ERROR":
			this.onError.dispatch(event.message);
			break;
		case "EXIT":
			var threadData = this.__threads[event.threadID];
			if(threadData.jobID != null) {
				this.activeThreads--;
			} else {
				this.__idleThreads--;
			}
			this.__threads[event.threadID] = null;
			this.__queuedExitEvents--;
			break;
		case "IDLE":
			this.__onThreadIdle(event.threadID);
			break;
		case "PROGRESS":
			this.onProgress.dispatch(event.message);
			break;
		case "UNCAUGHT_ERROR":
			var message;
			if(((event.message) instanceof haxe_Exception)) {
				if(this.onUncaughtError.__listeners.length > 0) {
					this.onUncaughtError.dispatch(event.message);
					message = null;
				} else {
					message = event.message.details();
				}
			} else {
				message = Std.string(event.message);
			}
			if(message != null) {
				this.__activeJob.value = null;
				lime_utils_Log.error(message,{ fileName : "lime/system/ThreadPool.hx", lineNumber : 529, className : "lime.system.ThreadPool", methodName : "__dispatchJobOutput"});
			}
			break;
		case "WORK":
			var tmp = new Date().getTime();
			this.__activeJob.value.startTime = tmp / 1000;
			this.onRun.dispatch(this.__activeJob.value.state);
			var threadData = this.__threads[event.threadID];
			if(threadData.jobID == null) {
				this.__idleThreads--;
				this.activeThreads++;
			}
			threadData.jobID = event.jobID;
			break;
		default:
		}
		this.__activeJob.value = oldActiveJob;
	}
	,sendComplete: function(message,transferList) {
		if(this.__jobComplete.value) {
			return;
		} else {
			var tmp;
			if(!(lime__$internal_backend_html5_HTML5Thread.__current.__worker != null || lime__$internal_backend_html5_HTML5Thread.__isWorker)) {
				var _this = this.__singleThreadedJobs;
				tmp = this.__activeJob.value == _this.jobs[_this.startIndex];
			} else {
				tmp = false;
			}
			if(tmp) {
				this.__jobComplete.value = true;
				this.__dispatchJobOutput({ event : "COMPLETE", message : message, jobID : this.__activeJob.value.id});
			} else {
				lime_system_WorkOutput.prototype.sendComplete.call(this,message,transferList);
			}
		}
	}
	,sendError: function(message,transferList) {
		if(this.__jobComplete.value) {
			return;
		} else {
			var tmp;
			if(!(lime__$internal_backend_html5_HTML5Thread.__current.__worker != null || lime__$internal_backend_html5_HTML5Thread.__isWorker)) {
				var _this = this.__singleThreadedJobs;
				tmp = this.__activeJob.value == _this.jobs[_this.startIndex];
			} else {
				tmp = false;
			}
			if(tmp) {
				this.__jobComplete.value = true;
				this.__dispatchJobOutput({ event : "ERROR", message : message, jobID : this.__activeJob.value.id});
			} else {
				lime_system_WorkOutput.prototype.sendError.call(this,message,transferList);
			}
		}
	}
	,sendProgress: function(message,transferList) {
		if(this.__jobComplete.value) {
			return;
		} else {
			var tmp;
			if(!(lime__$internal_backend_html5_HTML5Thread.__current.__worker != null || lime__$internal_backend_html5_HTML5Thread.__isWorker)) {
				var _this = this.__singleThreadedJobs;
				tmp = this.__activeJob.value == _this.jobs[_this.startIndex];
			} else {
				tmp = false;
			}
			if(tmp) {
				this.__dispatchJobOutput({ event : "PROGRESS", message : message, jobID : this.__activeJob.value.id});
			} else {
				lime_system_WorkOutput.prototype.sendProgress.call(this,message,transferList);
			}
		}
	}
	,__update: function(deltaTime) {
		if(lime__$internal_backend_html5_HTML5Thread.__current.__worker != null || lime__$internal_backend_html5_HTML5Thread.__isWorker) {
			return;
		}
		var endTime = new Date().getTime() / 1000;
		if(lime_system_ThreadPool.__totalWorkPriority > 0) {
			var frameRate = 60;
			if(lime_app_Application.current.__window != null) {
				frameRate = lime_app_Application.current.__window.__backend.getFrameRate();
			}
			endTime += lime_system_ThreadPool.workLoad * this.workPriority / (frameRate * lime_system_ThreadPool.__totalWorkPriority);
		}
		var jobStartTime;
		while(true) {
			var tmp;
			var _this = this.__singleThreadedJobs;
			if(_this.jobs.length - _this.startIndex > 0) {
				jobStartTime = new Date().getTime() / 1000;
				tmp = jobStartTime < endTime;
			} else {
				tmp = false;
			}
			if(!tmp) {
				break;
			}
			var _this1 = this.__singleThreadedJobs;
			this.__activeJob.value = _this1.jobs[_this1.startIndex];
			if(!(this.__activeJob.value.startTime >= 0)) {
				this.__activeJob.value.startTime = jobStartTime;
				this.onRun.dispatch(this.__activeJob.value.state);
			}
			this.__jobComplete.value = false;
			this.workIterations.value = 0;
			try {
				do {
					this.workIterations.value += 1;
					(lime__$internal_backend_html5_WorkFunction.toFunction(this.__activeJob.value.doWork))(this.__activeJob.value.state,this);
				} while(!this.__jobComplete.value && new Date().getTime() / 1000 < endTime);
			} catch( _g ) {
				var e = haxe_Exception.caught(_g);
				this.__jobComplete.value = true;
				this.__dispatchJobOutput({ event : "UNCAUGHT_ERROR", message : e, jobID : this.__activeJob.value.id});
			}
			var jobEndTime = new Date().getTime() / 1000;
			this.__activeJob.value.duration += jobEndTime - jobStartTime;
			this.__activeJob.value = null;
			if(this.__jobComplete.value) {
				this.__singleThreadedJobs.shift();
				var _this2 = this.__singleThreadedJobs;
				var value = _this2.jobs.length - _this2.startIndex > 0;
				if(value != this.__singleThreadedJobRunning) {
					if(value) {
						lime_system_ThreadPool.__totalWorkPriority += this.workPriority;
					} else {
						lime_system_ThreadPool.__totalWorkPriority -= this.workPriority;
					}
				}
				this.__singleThreadedJobRunning = value;
			}
		}
		this.__runMultiThreadedJobs();
		var threadEvent;
		while(true) {
			threadEvent = this.__jobOutput.pop();
			if(!(threadEvent != null)) {
				break;
			}
			this.__dispatchJobOutput(threadEvent);
		}
		var _this = this.__singleThreadedJobs;
		if(this.activeThreads + (_this.jobs.length - _this.startIndex > 0 ? 1 : 0) + this.__queuedExitEvents <= 0) {
			lime_app_Application.current.onUpdate.remove($bind(this,this.__update));
		}
	}
	,__onThreadIdle: function(threadID) {
		if(lime__$internal_backend_html5_HTML5Thread.__current.__worker != null || lime__$internal_backend_html5_HTML5Thread.__isWorker) {
			throw haxe_Exception.thrown("Call __onThreadIdle() only from the main thread.");
		}
		var threadData = this.__threads[threadID];
		if(threadData == null) {
			return;
		}
		if(threadData.jobID != null) {
			threadData.jobID = null;
			this.activeThreads--;
			this.__idleThreads++;
		}
		this.__runMultiThreadedJobs();
		if(this.__idleThreads - this.__queuedExitEvents > this.minThreads) {
			threadData.thread.destroy();
			this.__threads[threadID] = null;
			this.__idleThreads--;
		}
	}
	,__runMultiThreadedJob: function(job) {
		if(job.startTime >= 0) {
			throw haxe_Exception.thrown("Job " + job.id + " was already started!");
		}
		lime__$internal_backend_html5_WorkFunction.makePortable(job.doWork);
		var threadEvent = { event : "WORK", jobID : job.id, doWork : job.doWork, state : job.state};
		var threadData = null;
		if(this.__idleThreads - this.__queuedExitEvents > 0) {
			var _g = 0;
			var _g1 = this.__threads;
			while(_g < _g1.length) {
				var data = _g1[_g];
				++_g;
				if(data != null && data.jobID == null) {
					threadData = data;
					break;
				}
			}
		}
		if(threadData == null) {
			if(this.activeThreads + (this.__idleThreads - this.__queuedExitEvents) >= this.maxThreads) {
				return;
			}
			var thread = this.createThread({ func : lime_system_ThreadPool.__executeThread, classPath : "lime.system.ThreadPool", functionName : "__executeThread"});
			var _g = 0;
			var _g1 = this.__threads;
			while(_g < _g1.length) {
				var data = _g1[_g];
				++_g;
				if(data.thread == thread) {
					threadData = data;
					break;
				}
			}
			if(threadData == null) {
				return;
			}
		}
		threadData.jobID = job.id;
		threadData.thread.sendMessage(threadEvent);
		this.__idleThreads--;
		this.activeThreads++;
		job.startTime = 0;
	}
	,__runMultiThreadedJobs: function() {
		if(this.activeThreads >= this.maxThreads) {
			return;
		}
		var _this = this.__multiThreadedJobs;
		var _g_jobs = _this.jobs;
		var _g_index = _this.startIndex;
		while(_g_index < _g_jobs.length) {
			var job = _g_jobs[_g_index++];
			if(!(job.startTime >= 0)) {
				this.__runMultiThreadedJob(job);
				if(this.activeThreads >= this.maxThreads) {
					break;
				}
			}
		}
	}
	,createThread: function(executeThread) {
		var thread = lime_system_WorkOutput.prototype.createThread.call(this,executeThread);
		var index = this.__threads.indexOf(null);
		if(index < 0) {
			index = this.__threads.length;
		}
		this.__threads[index] = { thread : thread, jobID : null};
		this.__idleThreads++;
		thread.sendMessage({ threadID : index});
		return thread;
	}
	,get_activeJobs: function() {
		var _this = this.__singleThreadedJobs;
		return this.activeThreads + (_this.jobs.length - _this.startIndex > 0 ? 1 : 0);
	}
	,get_currentThreads: function() {
		return this.activeThreads + (this.__idleThreads - this.__queuedExitEvents);
	}
	,get_doWork: function() {
		return this;
	}
	,get_idleThreads: function() {
		return this.__idleThreads - this.__queuedExitEvents;
	}
	,set___singleThreadedJobRunning: function(value) {
		if(value != this.__singleThreadedJobRunning) {
			if(value) {
				lime_system_ThreadPool.__totalWorkPriority += this.workPriority;
			} else {
				lime_system_ThreadPool.__totalWorkPriority -= this.workPriority;
			}
		}
		return this.__singleThreadedJobRunning = value;
	}
	,set_workPriority: function(value) {
		if(this.__singleThreadedJobRunning) {
			lime_system_ThreadPool.__totalWorkPriority += value - this.workPriority;
		}
		return this.workPriority = value;
	}
	,__class__: lime_system_ThreadPool
	,__properties__: $extend(lime_system_WorkOutput.prototype.__properties__,{set___singleThreadedJobRunning:"set___singleThreadedJobRunning",get_doWork:"get_doWork",set_workPriority:"set_workPriority",get_idleThreads:"get_idleThreads",get_currentThreads:"get_currentThreads",get_activeJobs:"get_activeJobs"})
});
var lime_system__$ThreadPool_PseudoEvent = {};
lime_system__$ThreadPool_PseudoEvent.__properties__ = {get___repeat:"get___repeat",get___listeners:"get___listeners"};
lime_system__$ThreadPool_PseudoEvent.get___listeners = function(this1) {
	return [];
};
lime_system__$ThreadPool_PseudoEvent.get___repeat = function(this1) {
	return [];
};
lime_system__$ThreadPool_PseudoEvent.add = function(this1,callback) {
	var callCallback = function(state,output) {
		callback(state);
	};
	this1.__doWork = { func : callCallback};
};
lime_system__$ThreadPool_PseudoEvent.cancel = function(this1) {
};
lime_system__$ThreadPool_PseudoEvent.dispatch = function(this1) {
};
lime_system__$ThreadPool_PseudoEvent.has = function(this1,callback) {
	return this1.__doWork != null;
};
lime_system__$ThreadPool_PseudoEvent.remove = function(this1,callback) {
	this1.__doWork = null;
};
lime_system__$ThreadPool_PseudoEvent.removeAll = function(this1) {
	this1.__doWork = null;
};
var lime_system__$ThreadPool_JobArray = function() {
	this.startIndex = 0;
	this.jobs = [];
};
$hxClasses["lime.system._ThreadPool.JobArray"] = lime_system__$ThreadPool_JobArray;
lime_system__$ThreadPool_JobArray.__name__ = "lime.system._ThreadPool.JobArray";
lime_system__$ThreadPool_JobArray.prototype = {
	jobs: null
	,startIndex: null
	,clear: function() {
		this.jobs.length = 0;
		this.startIndex = 0;
	}
	,first: function() {
		return this.jobs[this.startIndex];
	}
	,getJob: function(id) {
		var _g = this.startIndex;
		var _g1 = this.jobs.length;
		while(_g < _g1) {
			var i = _g++;
			if(this.jobs[i].id == id) {
				return this.jobs[i];
			}
		}
		return null;
	}
	,get_length: function() {
		return this.jobs.length - this.startIndex;
	}
	,iterator: function() {
		return new lime_system__$ThreadPool_JobArrayIterator(this.jobs,this.startIndex);
	}
	,push: function(job) {
		return this.jobs.push(job);
	}
	,removeJob: function(id) {
		var _g = this.startIndex;
		var _g1 = this.jobs.length;
		while(_g < _g1) {
			var i = _g++;
			var job = this.jobs[i];
			if(job.id != id) {
				continue;
			}
			if((i - this.startIndex) * 2 <= this.jobs.length - this.startIndex) {
				var j = i;
				while(j > this.startIndex) {
					this.jobs[j] = this.jobs[j - 1];
					--j;
				}
				this.shift();
			} else {
				this.jobs.splice(i,1);
			}
			return job;
		}
		return null;
	}
	,shift: function() {
		var job = this.jobs[this.startIndex];
		this.jobs[this.startIndex] = null;
		this.startIndex++;
		if(this.startIndex >= this.jobs.length) {
			this.jobs.length = 0;
			this.startIndex = 0;
		} else if(this.startIndex >= 100) {
			this.jobs.splice(0,this.startIndex);
			this.startIndex = 0;
		}
		return job;
	}
	,__class__: lime_system__$ThreadPool_JobArray
	,__properties__: {get_length:"get_length"}
};
var lime_system__$ThreadPool_JobArrayIterator = function(jobs,startIndex) {
	this.jobs = jobs;
	this.index = startIndex;
};
$hxClasses["lime.system._ThreadPool.JobArrayIterator"] = lime_system__$ThreadPool_JobArrayIterator;
lime_system__$ThreadPool_JobArrayIterator.__name__ = "lime.system._ThreadPool.JobArrayIterator";
lime_system__$ThreadPool_JobArrayIterator.prototype = {
	index: null
	,jobs: null
	,hasNext: function() {
		return this.index < this.jobs.length;
	}
	,next: function() {
		return this.jobs[this.index++];
	}
	,__class__: lime_system__$ThreadPool_JobArrayIterator
};
var lime_system_JobData = function(doWork,state,id) {
	this.startTime = -1;
	this.duration = 0;
	this.id = id != null ? id : lime_system_JobData.nextID++;
	this.doWork = doWork;
	this.state = state;
};
$hxClasses["lime.system.JobData"] = lime_system_JobData;
lime_system_JobData.__name__ = "lime.system.JobData";
lime_system_JobData.prototype = {
	id: null
	,doWork: null
	,state: null
	,duration: null
	,startTime: null
	,get_started: function() {
		return this.startTime >= 0;
	}
	,__class__: lime_system_JobData
	,__properties__: {get_started:"get_started"}
};
var lime_system_JSAsync = function() { };
$hxClasses["lime.system.JSAsync"] = lime_system_JSAsync;
lime_system_JSAsync.__name__ = "lime.system.JSAsync";
var lime_system_Deque = {};
lime_system_Deque._new = function() {
	return new haxe_ds_List();
};
lime_system_Deque.pop = function(this1,block) {
	return this1.pop();
};
var lime_system_Tls = function() {
};
$hxClasses["lime.system.Tls"] = lime_system_Tls;
lime_system_Tls.__name__ = "lime.system.Tls";
lime_system_Tls.prototype = {
	value: null
	,__class__: lime_system_Tls
};
var lime_text_Font = function(name) {
	if(name != null) {
		this.name = name;
	}
	if(!this.__init) {
		if(this.ascender == undefined) {
			this.ascender = 0;
		}
		if(this.descender == undefined) {
			this.descender = 0;
		}
		if(this.height == undefined) {
			this.height = 0;
		}
		if(this.numGlyphs == undefined) {
			this.numGlyphs = 0;
		}
		if(this.underlinePosition == undefined) {
			this.underlinePosition = 0;
		}
		if(this.underlineThickness == undefined) {
			this.underlineThickness = 0;
		}
		if(this.unitsPerEM == undefined) {
			this.unitsPerEM = 0;
		}
		if(this.__fontID != null) {
			if(lime_utils_Assets.isLocal(this.__fontID)) {
				this.__fromBytes(lime_utils_Assets.getBytes(this.__fontID));
			}
		} else if(this.__fontPath != null) {
			this.__fromFile(this.__fontPath);
		}
	}
};
$hxClasses["lime.text.Font"] = lime_text_Font;
lime_text_Font.__name__ = "lime.text.Font";
lime_text_Font.fromBytes = function(bytes) {
	if(bytes == null) {
		return null;
	}
	var font = new lime_text_Font();
	font.__fromBytes(bytes);
	return font;
};
lime_text_Font.fromFile = function(path) {
	if(path == null) {
		return null;
	}
	var font = new lime_text_Font();
	font.__fromFile(path);
	return font;
};
lime_text_Font.loadFromBytes = function(bytes) {
	return lime_app_Future.withValue(lime_text_Font.fromBytes(bytes));
};
lime_text_Font.loadFromFile = function(path) {
	var request = new lime_net__$HTTPRequest_$lime_$text_$Font();
	return request.load(path).then(function(font) {
		if(font != null) {
			return lime_app_Future.withValue(font);
		} else {
			return lime_app_Future.withError("");
		}
	});
};
lime_text_Font.loadFromName = function(path) {
	var font = new lime_text_Font();
	return font.__loadFromName(path);
};
lime_text_Font.__measureFontNode = function(fontFamily) {
	var node = window.document.createElement("span");
	node.setAttribute("aria-hidden","true");
	var text = window.document.createTextNode("BESbswy");
	node.appendChild(text);
	var style = node.style;
	style.display = "block";
	style.position = "absolute";
	style.top = "-9999px";
	style.left = "-9999px";
	style.fontSize = "300px";
	style.width = "auto";
	style.height = "auto";
	style.lineHeight = "normal";
	style.margin = "0";
	style.padding = "0";
	style.fontVariant = "normal";
	style.whiteSpace = "nowrap";
	style.fontFamily = fontFamily;
	window.document.body.appendChild(node);
	return node;
};
lime_text_Font.prototype = {
	ascender: null
	,descender: null
	,height: null
	,name: null
	,numGlyphs: null
	,src: null
	,underlinePosition: null
	,underlineThickness: null
	,strikethroughPosition: null
	,strikethroughThickness: null
	,unitsPerEM: null
	,__fontID: null
	,__fontPath: null
	,__init: null
	,decompose: function() {
		return null;
	}
	,getGlyph: function(character) {
		return -1;
	}
	,getGlyphs: function(characters) {
		if(characters == null) {
			characters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^`'\"/\\&*()[]{}<>|:;_-+=?,. ";
		}
		return null;
	}
	,getGlyphMetrics: function(glyph) {
		return null;
	}
	,renderGlyph: function(glyph,fontSize) {
		return null;
	}
	,renderGlyphs: function(glyphs,fontSize) {
		return null;
	}
	,__copyFrom: function(other) {
		if(other != null) {
			this.ascender = other.ascender;
			this.descender = other.descender;
			this.height = other.height;
			this.name = other.name;
			this.numGlyphs = other.numGlyphs;
			this.src = other.src;
			this.underlinePosition = other.underlinePosition;
			this.underlineThickness = other.underlineThickness;
			this.unitsPerEM = other.unitsPerEM;
			this.__fontID = other.__fontID;
			this.__fontPath = other.__fontPath;
			this.__init = true;
		}
	}
	,__fromBytes: function(bytes) {
		this.__fontPath = null;
	}
	,__fromFile: function(path) {
		this.__fontPath = path;
	}
	,__initializeSource: function() {
		this.__init = true;
	}
	,__loadFromName: function(name) {
		var _gthis = this;
		var promise = new lime_app_Promise();
		this.name = name;
		var userAgent = $global.navigator.userAgent.toLowerCase();
		var isSafari = userAgent.indexOf(" safari/") >= 0 && userAgent.indexOf(" chrome/") < 0;
		var isUIWebView = new EReg("(iPhone|iPod|iPad).*AppleWebKit(?!.*Version)","i").match(userAgent);
		if(!isSafari && !isUIWebView && (window.document.fonts && ($_=window.document.fonts,$bind($_,$_.load)))) {
			window.document.fonts.load("1em '" + name + "'").then(function(_) {
				promise.complete(_gthis);
			},function(_) {
				lime_utils_Log.warn("Could not load web font \"" + name + "\"",{ fileName : "lime/text/Font.hx", lineNumber : 656, className : "lime.text.Font", methodName : "__loadFromName"});
				promise.complete(_gthis);
			});
		} else {
			var node1 = lime_text_Font.__measureFontNode("'" + name + "', sans-serif");
			var node2 = lime_text_Font.__measureFontNode("'" + name + "', serif");
			var width1 = node1.offsetWidth;
			var width2 = node2.offsetWidth;
			var interval = -1;
			var timeout = 3000;
			var intervalLength = 50;
			var intervalCount = 0;
			var loaded;
			var timeExpired;
			var checkFont = function() {
				intervalCount += 1;
				loaded = node1.offsetWidth != width1 || node2.offsetWidth != width2;
				timeExpired = intervalCount * intervalLength >= timeout;
				if(loaded || timeExpired) {
					window.clearInterval(interval);
					node1.parentNode.removeChild(node1);
					node2.parentNode.removeChild(node2);
					node1 = null;
					node2 = null;
					if(timeExpired) {
						lime_utils_Log.warn("Could not load web font \"" + name + "\"",{ fileName : "lime/text/Font.hx", lineNumber : 692, className : "lime.text.Font", methodName : "__loadFromName"});
					}
					promise.complete(_gthis);
				}
			};
			interval = window.setInterval(checkFont,intervalLength);
		}
		return promise.future;
	}
	,__setSize: function(size,dpi) {
		if(dpi == null) {
			dpi = 72;
		}
	}
	,__class__: lime_text_Font
};
var lime_text_Glyph = {};
lime_text_Glyph._new = function(i) {
	return i;
};
var lime_text_GlyphMetrics = function() {
};
$hxClasses["lime.text.GlyphMetrics"] = lime_text_GlyphMetrics;
lime_text_GlyphMetrics.__name__ = "lime.text.GlyphMetrics";
lime_text_GlyphMetrics.prototype = {
	advance: null
	,height: null
	,horizontalBearing: null
	,verticalBearing: null
	,__class__: lime_text_GlyphMetrics
};
var lime_text_harfbuzz_HB = function() { };
$hxClasses["lime.text.harfbuzz.HB"] = lime_text_harfbuzz_HB;
lime_text_harfbuzz_HB.__name__ = "lime.text.harfbuzz.HB";
lime_text_harfbuzz_HB.shape = function(font,buffer,features) {
};
var lime_text_harfbuzz_HBBlob = {};
lime_text_harfbuzz_HBBlob.__properties__ = {get_length:"get_length",get_immutable:"get_immutable",get_dataWritable:"get_dataWritable",get_data:"get_data",get_empty:"get_empty"};
lime_text_harfbuzz_HBBlob._new = function(data,length,memoryMode) {
	return null;
};
lime_text_harfbuzz_HBBlob.createSubBlob = function(this1,offset,length) {
	return null;
};
lime_text_harfbuzz_HBBlob.makeImmutable = function(this1) {
};
lime_text_harfbuzz_HBBlob.get_data = function(this1) {
	return 0;
};
lime_text_harfbuzz_HBBlob.get_dataWritable = function(this1) {
	return 0;
};
lime_text_harfbuzz_HBBlob.get_empty = function() {
	return null;
};
lime_text_harfbuzz_HBBlob.get_immutable = function(this1) {
	return false;
};
lime_text_harfbuzz_HBBlob.get_length = function(this1) {
	return 0;
};
var lime_text_harfbuzz_HBBuffer = {};
lime_text_harfbuzz_HBBuffer.__properties__ = {set_segmentProperties:"set_segmentProperties",get_segmentProperties:"get_segmentProperties",set_script:"set_script",get_script:"get_script",set_replacementCodepoint:"set_replacementCodepoint",get_replacementCodepoint:"get_replacementCodepoint",set_length:"set_length",get_length:"get_length",set_language:"set_language",get_language:"get_language",set_flags:"set_flags",get_flags:"get_flags",set_direction:"set_direction",get_direction:"get_direction",set_contentType:"set_contentType",get_contentType:"get_contentType",set_clusterLevel:"set_clusterLevel",get_clusterLevel:"get_clusterLevel",get_allocationSuccessful:"get_allocationSuccessful"};
lime_text_harfbuzz_HBBuffer._new = function() {
	return null;
};
lime_text_harfbuzz_HBBuffer.add = function(this1,codepoint,cluster) {
};
lime_text_harfbuzz_HBBuffer.addString = function(this1,text,itemOffset,itemLength) {
};
lime_text_harfbuzz_HBBuffer.addCodepoints = function(this1,text,textLength,itemOffset,itemLength) {
};
lime_text_harfbuzz_HBBuffer.addUTF8 = function(this1,text,itemOffset,itemLength) {
};
lime_text_harfbuzz_HBBuffer.addUTF16 = function(this1,text,textLength,itemOffset,itemLength) {
};
lime_text_harfbuzz_HBBuffer.addUTF32 = function(this1,text,textLength,itemOffset,itemLength) {
};
lime_text_harfbuzz_HBBuffer.clearContents = function(this1) {
};
lime_text_harfbuzz_HBBuffer.getGlyphInfo = function(this1) {
	return null;
};
lime_text_harfbuzz_HBBuffer.getGlyphPositions = function(this1) {
	return null;
};
lime_text_harfbuzz_HBBuffer.guessSegmentProperties = function(this1) {
};
lime_text_harfbuzz_HBBuffer.normalizeGlyphs = function(this1) {
};
lime_text_harfbuzz_HBBuffer.preallocate = function(this1,size) {
	return false;
};
lime_text_harfbuzz_HBBuffer.reset = function(this1) {
};
lime_text_harfbuzz_HBBuffer.reverse = function(this1) {
};
lime_text_harfbuzz_HBBuffer.reverseClusters = function(this1) {
};
lime_text_harfbuzz_HBBuffer.get_allocationSuccessful = function(this1) {
	return false;
};
lime_text_harfbuzz_HBBuffer.get_clusterLevel = function(this1) {
	return 0;
};
lime_text_harfbuzz_HBBuffer.set_clusterLevel = function(this1,value) {
	return value;
};
lime_text_harfbuzz_HBBuffer.get_contentType = function(this1) {
	return 0;
};
lime_text_harfbuzz_HBBuffer.set_contentType = function(this1,value) {
	return value;
};
lime_text_harfbuzz_HBBuffer.get_direction = function(this1) {
	return 0;
};
lime_text_harfbuzz_HBBuffer.set_direction = function(this1,value) {
	return value;
};
lime_text_harfbuzz_HBBuffer.get_empty = function() {
	return null;
};
lime_text_harfbuzz_HBBuffer.get_flags = function(this1) {
	return 0;
};
lime_text_harfbuzz_HBBuffer.set_flags = function(this1,value) {
	return value;
};
lime_text_harfbuzz_HBBuffer.get_language = function(this1) {
	return null;
};
lime_text_harfbuzz_HBBuffer.set_language = function(this1,value) {
	return value;
};
lime_text_harfbuzz_HBBuffer.get_length = function(this1) {
	return 0;
};
lime_text_harfbuzz_HBBuffer.set_length = function(this1,value) {
	return value;
};
lime_text_harfbuzz_HBBuffer.get_replacementCodepoint = function(this1) {
	return 0;
};
lime_text_harfbuzz_HBBuffer.set_replacementCodepoint = function(this1,value) {
	return value;
};
lime_text_harfbuzz_HBBuffer.get_script = function(this1) {
	return 0;
};
lime_text_harfbuzz_HBBuffer.set_script = function(this1,value) {
	return value;
};
lime_text_harfbuzz_HBBuffer.get_segmentProperties = function(this1) {
	return null;
};
lime_text_harfbuzz_HBBuffer.set_segmentProperties = function(this1,value) {
	return value;
};
var lime_text_harfbuzz_HBFTFont = {};
lime_text_harfbuzz_HBFTFont.__properties__ = {set_loadFlags:"set_loadFlags",get_loadFlags:"get_loadFlags"};
lime_text_harfbuzz_HBFTFont._new = function(font) {
	var this1;
	if(font.src != null) {
		this1 = null;
	} else {
		this1 = null;
	}
	return this1;
};
lime_text_harfbuzz_HBFTFont.get_loadFlags = function(this1) {
	return 0;
};
lime_text_harfbuzz_HBFTFont.set_loadFlags = function(this1,value) {
	return value;
};
var lime_text_harfbuzz_HBFace = {};
lime_text_harfbuzz_HBFace.__properties__ = {set_upem:"set_upem",get_upem:"get_upem",set_index:"set_index",get_index:"get_index",get_immutable:"get_immutable",set_glyphCount:"set_glyphCount",get_glyphCount:"get_glyphCount",get_empty:"get_empty"};
lime_text_harfbuzz_HBFace._new = function(blob,index) {
	return null;
};
lime_text_harfbuzz_HBFace.get_empty = function() {
	return null;
};
lime_text_harfbuzz_HBFace.get_glyphCount = function(this1) {
	return 0;
};
lime_text_harfbuzz_HBFace.set_glyphCount = function(this1,value) {
	return value;
};
lime_text_harfbuzz_HBFace.get_immutable = function(this1) {
	return false;
};
lime_text_harfbuzz_HBFace.get_index = function(this1) {
	return 0;
};
lime_text_harfbuzz_HBFace.set_index = function(this1,value) {
	return value;
};
lime_text_harfbuzz_HBFace.get_upem = function(this1) {
	return 0;
};
lime_text_harfbuzz_HBFace.set_upem = function(this1,value) {
	return value;
};
var lime_text_harfbuzz_HBFeature = function() {
};
$hxClasses["lime.text.harfbuzz.HBFeature"] = lime_text_harfbuzz_HBFeature;
lime_text_harfbuzz_HBFeature.__name__ = "lime.text.harfbuzz.HBFeature";
lime_text_harfbuzz_HBFeature.prototype = {
	__class__: lime_text_harfbuzz_HBFeature
};
var lime_text_harfbuzz_HBFont = {};
lime_text_harfbuzz_HBFont.__properties__ = {set_scale:"set_scale",get_scale:"get_scale",set_ppem:"set_ppem",get_ppem:"get_ppem",get_parent:"get_parent",get_immutable:"get_immutable",get_face:"get_face",get_empty:"get_empty"};
lime_text_harfbuzz_HBFont._new = function(face) {
	return null;
};
lime_text_harfbuzz_HBFont.addGlyphOriginForDirection = function(this1,glyph,direction,x,y) {
};
lime_text_harfbuzz_HBFont.createSubFont = function(this1) {
	return null;
};
lime_text_harfbuzz_HBFont.getGlyphAdvanceForDirection = function(this1,glyph,direction) {
	return null;
};
lime_text_harfbuzz_HBFont.getGlyphKerningForDirection = function(this1,glyph,firstGlyph,secondGlyph,direction) {
	return null;
};
lime_text_harfbuzz_HBFont.getGlyphOriginForDirection = function(this1,glyph,direction) {
	return null;
};
lime_text_harfbuzz_HBFont.glyphFromString = function(this1,s) {
	return 0;
};
lime_text_harfbuzz_HBFont.glyphToString = function(this1,codepoint) {
	return null;
};
lime_text_harfbuzz_HBFont.makeImmutable = function(this1) {
};
lime_text_harfbuzz_HBFont.subtractGlyphOriginForDirection = function(this1,glyph,direction,x,y) {
};
lime_text_harfbuzz_HBFont.get_empty = function() {
	return null;
};
lime_text_harfbuzz_HBFont.get_face = function(this1) {
	return null;
};
lime_text_harfbuzz_HBFont.get_immutable = function(this1) {
	return false;
};
lime_text_harfbuzz_HBFont.get_parent = function(this1) {
	return null;
};
lime_text_harfbuzz_HBFont.get_ppem = function(this1) {
	return null;
};
lime_text_harfbuzz_HBFont.set_ppem = function(this1,value) {
	return value;
};
lime_text_harfbuzz_HBFont.get_scale = function(this1) {
	return null;
};
lime_text_harfbuzz_HBFont.set_scale = function(this1,value) {
	return value;
};
var lime_text_harfbuzz_HBGlyphInfo = function() {
};
$hxClasses["lime.text.harfbuzz.HBGlyphInfo"] = lime_text_harfbuzz_HBGlyphInfo;
lime_text_harfbuzz_HBGlyphInfo.__name__ = "lime.text.harfbuzz.HBGlyphInfo";
lime_text_harfbuzz_HBGlyphInfo.prototype = {
	codepoint: null
	,mask: null
	,cluster: null
	,__class__: lime_text_harfbuzz_HBGlyphInfo
};
var lime_text_harfbuzz_HBGlyphPosition = function() {
};
$hxClasses["lime.text.harfbuzz.HBGlyphPosition"] = lime_text_harfbuzz_HBGlyphPosition;
lime_text_harfbuzz_HBGlyphPosition.__name__ = "lime.text.harfbuzz.HBGlyphPosition";
lime_text_harfbuzz_HBGlyphPosition.prototype = {
	xAdvance: null
	,xOffset: null
	,yAdvance: null
	,yOffset: null
	,__class__: lime_text_harfbuzz_HBGlyphPosition
};
var lime_text_harfbuzz_HBLanguage = {};
lime_text_harfbuzz_HBLanguage._new = function(language) {
	return null;
};
lime_text_harfbuzz_HBLanguage.toString = function(this1) {
	return null;
};
lime_text_harfbuzz_HBLanguage.fromString = function(value) {
	return lime_text_harfbuzz_HBLanguage._new(value);
};
var lime_text_harfbuzz_HBSegmentProperties = function() {
};
$hxClasses["lime.text.harfbuzz.HBSegmentProperties"] = lime_text_harfbuzz_HBSegmentProperties;
lime_text_harfbuzz_HBSegmentProperties.__name__ = "lime.text.harfbuzz.HBSegmentProperties";
lime_text_harfbuzz_HBSegmentProperties.prototype = {
	__class__: lime_text_harfbuzz_HBSegmentProperties
};
var lime_ui_FileDialog = function() {
	this.onSelectMultiple = new lime_app__$Event_$Array_$String_$_$Void();
	this.onSelect = new lime_app__$Event_$String_$Void();
	this.onSave = new lime_app__$Event_$String_$Void();
	this.onOpen = new lime_app__$Event_$lime_$utils_$Resource_$Void();
	this.onCancel = new lime_app__$Event_$Void_$Void();
};
$hxClasses["lime.ui.FileDialog"] = lime_ui_FileDialog;
lime_ui_FileDialog.__name__ = "lime.ui.FileDialog";
lime_ui_FileDialog.prototype = {
	onCancel: null
	,onOpen: null
	,onSave: null
	,onSelect: null
	,onSelectMultiple: null
	,browse: function(type,filter,defaultPath,title) {
		if(type == null) {
			type = lime_ui_FileDialogType.OPEN;
		}
		this.onCancel.dispatch();
		return false;
	}
	,open: function(filter,defaultPath,title) {
		this.onCancel.dispatch();
		return false;
	}
	,save: function(data,filter,defaultPath,title,type) {
		if(type == null) {
			type = "application/octet-stream";
		}
		if(data == null) {
			this.onCancel.dispatch();
			return false;
		}
		var defaultExtension = "";
		if(lime_graphics_Image.__isPNG(data)) {
			type = "image/png";
			defaultExtension = ".png";
		} else if(lime_graphics_Image.__isJPG(data)) {
			type = "image/jpeg";
			defaultExtension = ".jpg";
		} else if(lime_graphics_Image.__isGIF(data)) {
			type = "image/gif";
			defaultExtension = ".gif";
		} else if(lime_graphics_Image.__isWebP(data)) {
			type = "image/webp";
			defaultExtension = ".webp";
		}
		var path = defaultPath != null ? haxe_io_Path.withoutDirectory(defaultPath) : "download" + defaultExtension;
		var buffer = data.b.bufferValue;
		buffer = buffer.slice(0,data.length);
		window.saveAs(new Blob([buffer],{ type : type}),path,true);
		this.onSave.dispatch(path);
		return true;
	}
	,__class__: lime_ui_FileDialog
};
var lime_ui_FileDialogType = $hxEnums["lime.ui.FileDialogType"] = { __ename__:"lime.ui.FileDialogType",__constructs__:null
	,OPEN: {_hx_name:"OPEN",_hx_index:0,__enum__:"lime.ui.FileDialogType",toString:$estr}
	,OPEN_MULTIPLE: {_hx_name:"OPEN_MULTIPLE",_hx_index:1,__enum__:"lime.ui.FileDialogType",toString:$estr}
	,SAVE: {_hx_name:"SAVE",_hx_index:2,__enum__:"lime.ui.FileDialogType",toString:$estr}
	,OPEN_DIRECTORY: {_hx_name:"OPEN_DIRECTORY",_hx_index:3,__enum__:"lime.ui.FileDialogType",toString:$estr}
};
lime_ui_FileDialogType.__constructs__ = [lime_ui_FileDialogType.OPEN,lime_ui_FileDialogType.OPEN_MULTIPLE,lime_ui_FileDialogType.SAVE,lime_ui_FileDialogType.OPEN_DIRECTORY];
var lime_ui_Gamepad = function(id) {
	this.onDisconnect = new lime_app__$Event_$Void_$Void();
	this.onButtonUp = new lime_app__$Event_$lime_$ui_$GamepadButton_$Void();
	this.onButtonDown = new lime_app__$Event_$lime_$ui_$GamepadButton_$Void();
	this.onAxisMove = new lime_app__$Event_$lime_$ui_$GamepadAxis_$Float_$Void();
	this.id = id;
	this.connected = true;
	var devices = lime_ui_Joystick.__getDeviceData();
	this.__jsGamepad = devices[this.id];
};
$hxClasses["lime.ui.Gamepad"] = lime_ui_Gamepad;
lime_ui_Gamepad.__name__ = "lime.ui.Gamepad";
lime_ui_Gamepad.addMappings = function(mappings) {
};
lime_ui_Gamepad.__connect = function(id) {
	if(!lime_ui_Gamepad.devices.h.hasOwnProperty(id)) {
		var gamepad = new lime_ui_Gamepad(id);
		lime_ui_Gamepad.devices.h[id] = gamepad;
		lime_ui_Gamepad.onConnect.dispatch(gamepad);
	}
};
lime_ui_Gamepad.__disconnect = function(id) {
	var gamepad = lime_ui_Gamepad.devices.h[id];
	if(gamepad != null) {
		gamepad.connected = false;
	}
	lime_ui_Gamepad.devices.remove(id);
	if(gamepad != null) {
		gamepad.onDisconnect.dispatch();
	}
};
lime_ui_Gamepad.prototype = {
	connected: null
	,id: null
	,onAxisMove: null
	,onButtonDown: null
	,onButtonUp: null
	,onDisconnect: null
	,__jsGamepad: null
	,rumble: function(lowFrequencyRumble,highFrequencyRumble,duration) {
		var actuator = this.__jsGamepad.vibrationActuator ? this.__jsGamepad.vibrationActuator : this.__jsGamepad.hapticActuators ? this.__jsGamepad.hapticActuators[0] : null;
		if(actuator == null) {
			return;
		}
		if(actuator.playEffect) {
			actuator.playEffect("dual-rumble",{ duration : duration, strongMagnitude : lowFrequencyRumble, weakMagnitude : highFrequencyRumble});
		} else if(actuator.pulse) {
			actuator.pulse(lowFrequencyRumble,duration);
		}
	}
	,get_guid: function() {
		return this.__jsGamepad.id;
	}
	,get_name: function() {
		return this.__jsGamepad.id;
	}
	,__class__: lime_ui_Gamepad
	,__properties__: {get_name:"get_name",get_guid:"get_guid"}
};
var lime_ui_GamepadAxis = {};
lime_ui_GamepadAxis.toString = function(this1) {
	switch(this1) {
	case 0:
		return "LEFT_X";
	case 1:
		return "LEFT_Y";
	case 2:
		return "RIGHT_X";
	case 3:
		return "RIGHT_Y";
	case 4:
		return "TRIGGER_LEFT";
	case 5:
		return "TRIGGER_RIGHT";
	default:
		return "UNKNOWN (" + this1 + ")";
	}
};
var lime_ui_GamepadButton = {};
lime_ui_GamepadButton.toString = function(this1) {
	switch(this1) {
	case 0:
		return "A";
	case 1:
		return "B";
	case 2:
		return "X";
	case 3:
		return "Y";
	case 4:
		return "BACK";
	case 5:
		return "GUIDE";
	case 6:
		return "START";
	case 7:
		return "LEFT_STICK";
	case 8:
		return "RIGHT_STICK";
	case 9:
		return "LEFT_SHOULDER";
	case 10:
		return "RIGHT_SHOULDER";
	case 11:
		return "DPAD_UP";
	case 12:
		return "DPAD_DOWN";
	case 13:
		return "DPAD_LEFT";
	case 14:
		return "DPAD_RIGHT";
	default:
		return "UNKNOWN (" + this1 + ")";
	}
};
var lime_ui_Joystick = function(id) {
	this.onHatMove = new lime_app__$Event_$Int_$lime_$ui_$JoystickHatPosition_$Void();
	this.onDisconnect = new lime_app__$Event_$Void_$Void();
	this.onButtonUp = new lime_app__$Event_$Int_$Void();
	this.onButtonDown = new lime_app__$Event_$Int_$Void();
	this.onAxisMove = new lime_app__$Event_$Int_$Float_$Void();
	this.id = id;
	this.connected = true;
};
$hxClasses["lime.ui.Joystick"] = lime_ui_Joystick;
lime_ui_Joystick.__name__ = "lime.ui.Joystick";
lime_ui_Joystick.__connect = function(id) {
	if(!lime_ui_Joystick.devices.h.hasOwnProperty(id)) {
		var joystick = new lime_ui_Joystick(id);
		lime_ui_Joystick.devices.h[id] = joystick;
		lime_ui_Joystick.onConnect.dispatch(joystick);
	}
};
lime_ui_Joystick.__disconnect = function(id) {
	var joystick = lime_ui_Joystick.devices.h[id];
	if(joystick != null) {
		joystick.connected = false;
	}
	lime_ui_Joystick.devices.remove(id);
	if(joystick != null) {
		joystick.onDisconnect.dispatch();
	}
};
lime_ui_Joystick.__getDeviceData = function() {
	var res = null;
	try {
		res = navigator.getGamepads ? navigator.getGamepads() : navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : null;
	} catch( _g ) {
		haxe_NativeStackTrace.lastError = _g;
	}
	return res;
};
lime_ui_Joystick.prototype = {
	connected: null
	,id: null
	,onAxisMove: null
	,onButtonDown: null
	,onButtonUp: null
	,onDisconnect: null
	,onHatMove: null
	,get_guid: function() {
		var devices = lime_ui_Joystick.__getDeviceData();
		return devices[this.id].id;
	}
	,get_name: function() {
		var devices = lime_ui_Joystick.__getDeviceData();
		return devices[this.id].id;
	}
	,get_numAxes: function() {
		var devices = lime_ui_Joystick.__getDeviceData();
		return devices[this.id].axes.length;
	}
	,get_numButtons: function() {
		var devices = lime_ui_Joystick.__getDeviceData();
		return devices[this.id].buttons.length;
	}
	,get_numHats: function() {
		return 0;
	}
	,__class__: lime_ui_Joystick
	,__properties__: {get_numHats:"get_numHats",get_numButtons:"get_numButtons",get_numAxes:"get_numAxes",get_name:"get_name",get_guid:"get_guid"}
};
var lime_ui_JoystickHatPosition = {};
lime_ui_JoystickHatPosition.__properties__ = {set_up:"set_up",get_up:"get_up",set_right:"set_right",get_right:"get_right",set_left:"set_left",get_left:"get_left",set_down:"set_down",get_down:"get_down",set_center:"set_center",get_center:"get_center"};
lime_ui_JoystickHatPosition._new = function(value) {
	return value;
};
lime_ui_JoystickHatPosition.get_center = function(this1) {
	return this1 == 0;
};
lime_ui_JoystickHatPosition.set_center = function(this1,value) {
	if(value) {
		this1 = 0;
	}
	return value;
};
lime_ui_JoystickHatPosition.get_down = function(this1) {
	return (this1 & 4) > 0;
};
lime_ui_JoystickHatPosition.set_down = function(this1,value) {
	if(value) {
		this1 |= 4;
	} else {
		this1 &= 268435455 - 4;
	}
	return value;
};
lime_ui_JoystickHatPosition.get_left = function(this1) {
	return (this1 & 8) > 0;
};
lime_ui_JoystickHatPosition.set_left = function(this1,value) {
	if(value) {
		this1 |= 8;
	} else {
		this1 &= 268435455 - 8;
	}
	return value;
};
lime_ui_JoystickHatPosition.get_right = function(this1) {
	return (this1 & 2) > 0;
};
lime_ui_JoystickHatPosition.set_right = function(this1,value) {
	if(value) {
		this1 |= 2;
	} else {
		this1 &= 268435455 - 2;
	}
	return value;
};
lime_ui_JoystickHatPosition.get_up = function(this1) {
	return (this1 & 1) > 0;
};
lime_ui_JoystickHatPosition.set_up = function(this1,value) {
	if(value) {
		this1 |= 1;
	} else {
		this1 &= 268435455 - 1;
	}
	return value;
};
var lime_ui_KeyCode = {};
lime_ui_KeyCode.fromScanCode = function(scanCode) {
	return 0;
};
lime_ui_KeyCode.toScanCode = function(keyCode) {
	return 0;
};
lime_ui_KeyCode.gt = function(a,b) {
	return a > b;
};
lime_ui_KeyCode.gte = function(a,b) {
	return a >= b;
};
lime_ui_KeyCode.lt = function(a,b) {
	return a < b;
};
lime_ui_KeyCode.lte = function(a,b) {
	return a <= b;
};
lime_ui_KeyCode.plus = function(a,b) {
	return a + b;
};
var lime_ui_KeyModifier = {};
lime_ui_KeyModifier.__properties__ = {set_shiftKey:"set_shiftKey",get_shiftKey:"get_shiftKey",set_numLock:"set_numLock",get_numLock:"get_numLock",set_metaKey:"set_metaKey",get_metaKey:"get_metaKey",set_ctrlKey:"set_ctrlKey",get_ctrlKey:"get_ctrlKey",set_capsLock:"set_capsLock",get_capsLock:"get_capsLock",set_altKey:"set_altKey",get_altKey:"get_altKey"};
lime_ui_KeyModifier.get_altKey = function(this1) {
	if((this1 & 256) <= 0) {
		return (this1 & 512) > 0;
	} else {
		return true;
	}
};
lime_ui_KeyModifier.set_altKey = function(this1,value) {
	if(value) {
		this1 |= 768;
	} else {
		this1 &= 268435455 - 768;
	}
	return value;
};
lime_ui_KeyModifier.get_capsLock = function(this1) {
	if((this1 & 8192) <= 0) {
		return (this1 & 8192) > 0;
	} else {
		return true;
	}
};
lime_ui_KeyModifier.set_capsLock = function(this1,value) {
	if(value) {
		this1 |= 8192;
	} else {
		this1 &= 268435455 - 8192;
	}
	return value;
};
lime_ui_KeyModifier.get_ctrlKey = function(this1) {
	if((this1 & 64) <= 0) {
		return (this1 & 128) > 0;
	} else {
		return true;
	}
};
lime_ui_KeyModifier.set_ctrlKey = function(this1,value) {
	if(value) {
		this1 |= 192;
	} else {
		this1 &= 268435455 - 192;
	}
	return value;
};
lime_ui_KeyModifier.get_metaKey = function(this1) {
	if((this1 & 1024) <= 0) {
		return (this1 & 2048) > 0;
	} else {
		return true;
	}
};
lime_ui_KeyModifier.set_metaKey = function(this1,value) {
	if(value) {
		this1 |= 3072;
	} else {
		this1 &= 268435455 - 3072;
	}
	return value;
};
lime_ui_KeyModifier.get_numLock = function(this1) {
	if((this1 & 4096) <= 0) {
		return (this1 & 4096) > 0;
	} else {
		return true;
	}
};
lime_ui_KeyModifier.set_numLock = function(this1,value) {
	if(value) {
		this1 |= 4096;
	} else {
		this1 &= 268435455 - 4096;
	}
	return value;
};
lime_ui_KeyModifier.get_shiftKey = function(this1) {
	if((this1 & 1) <= 0) {
		return (this1 & 2) > 0;
	} else {
		return true;
	}
};
lime_ui_KeyModifier.set_shiftKey = function(this1,value) {
	if(value) {
		this1 |= 3;
	} else {
		this1 &= 268435455 - 3;
	}
	return value;
};
var lime_ui_MouseCursor = $hxEnums["lime.ui.MouseCursor"] = { __ename__:"lime.ui.MouseCursor",__constructs__:null
	,ARROW: {_hx_name:"ARROW",_hx_index:0,__enum__:"lime.ui.MouseCursor",toString:$estr}
	,CROSSHAIR: {_hx_name:"CROSSHAIR",_hx_index:1,__enum__:"lime.ui.MouseCursor",toString:$estr}
	,DEFAULT: {_hx_name:"DEFAULT",_hx_index:2,__enum__:"lime.ui.MouseCursor",toString:$estr}
	,MOVE: {_hx_name:"MOVE",_hx_index:3,__enum__:"lime.ui.MouseCursor",toString:$estr}
	,POINTER: {_hx_name:"POINTER",_hx_index:4,__enum__:"lime.ui.MouseCursor",toString:$estr}
	,RESIZE_NESW: {_hx_name:"RESIZE_NESW",_hx_index:5,__enum__:"lime.ui.MouseCursor",toString:$estr}
	,RESIZE_NS: {_hx_name:"RESIZE_NS",_hx_index:6,__enum__:"lime.ui.MouseCursor",toString:$estr}
	,RESIZE_NWSE: {_hx_name:"RESIZE_NWSE",_hx_index:7,__enum__:"lime.ui.MouseCursor",toString:$estr}
	,RESIZE_WE: {_hx_name:"RESIZE_WE",_hx_index:8,__enum__:"lime.ui.MouseCursor",toString:$estr}
	,TEXT: {_hx_name:"TEXT",_hx_index:9,__enum__:"lime.ui.MouseCursor",toString:$estr}
	,WAIT: {_hx_name:"WAIT",_hx_index:10,__enum__:"lime.ui.MouseCursor",toString:$estr}
	,WAIT_ARROW: {_hx_name:"WAIT_ARROW",_hx_index:11,__enum__:"lime.ui.MouseCursor",toString:$estr}
	,CUSTOM: {_hx_name:"CUSTOM",_hx_index:12,__enum__:"lime.ui.MouseCursor",toString:$estr}
};
lime_ui_MouseCursor.__constructs__ = [lime_ui_MouseCursor.ARROW,lime_ui_MouseCursor.CROSSHAIR,lime_ui_MouseCursor.DEFAULT,lime_ui_MouseCursor.MOVE,lime_ui_MouseCursor.POINTER,lime_ui_MouseCursor.RESIZE_NESW,lime_ui_MouseCursor.RESIZE_NS,lime_ui_MouseCursor.RESIZE_NWSE,lime_ui_MouseCursor.RESIZE_WE,lime_ui_MouseCursor.TEXT,lime_ui_MouseCursor.WAIT,lime_ui_MouseCursor.WAIT_ARROW,lime_ui_MouseCursor.CUSTOM];
var lime_ui_MouseWheelMode = $hxEnums["lime.ui.MouseWheelMode"] = { __ename__:"lime.ui.MouseWheelMode",__constructs__:null
	,PIXELS: {_hx_name:"PIXELS",_hx_index:0,__enum__:"lime.ui.MouseWheelMode",toString:$estr}
	,LINES: {_hx_name:"LINES",_hx_index:1,__enum__:"lime.ui.MouseWheelMode",toString:$estr}
	,PAGES: {_hx_name:"PAGES",_hx_index:2,__enum__:"lime.ui.MouseWheelMode",toString:$estr}
	,UNKNOWN: {_hx_name:"UNKNOWN",_hx_index:3,__enum__:"lime.ui.MouseWheelMode",toString:$estr}
};
lime_ui_MouseWheelMode.__constructs__ = [lime_ui_MouseWheelMode.PIXELS,lime_ui_MouseWheelMode.LINES,lime_ui_MouseWheelMode.PAGES,lime_ui_MouseWheelMode.UNKNOWN];
var lime_ui_ScanCode = {};
lime_ui_ScanCode.fromKeyCode = function(keyCode) {
	return lime_ui_KeyCode.toScanCode(keyCode);
};
lime_ui_ScanCode.toKeyCode = function(scanCode) {
	return lime_ui_KeyCode.fromScanCode(scanCode);
};
lime_ui_ScanCode.gt = function(a,b) {
	return a > b;
};
lime_ui_ScanCode.gte = function(a,b) {
	return a >= b;
};
lime_ui_ScanCode.lt = function(a,b) {
	return a < b;
};
lime_ui_ScanCode.lte = function(a,b) {
	return a <= b;
};
lime_ui_ScanCode.plus = function(a,b) {
	return a + b;
};
var lime_ui_Touch = function(x,y,id,dx,dy,pressure,device) {
	this.x = x;
	this.y = y;
	this.id = id;
	this.dx = dx;
	this.dy = dy;
	this.pressure = pressure;
	this.device = device;
};
$hxClasses["lime.ui.Touch"] = lime_ui_Touch;
lime_ui_Touch.__name__ = "lime.ui.Touch";
lime_ui_Touch.prototype = {
	device: null
	,dx: null
	,dy: null
	,id: null
	,pressure: null
	,x: null
	,y: null
	,__class__: lime_ui_Touch
};
var lime_ui_Window = function(application,attributes) {
	this.__maxHeight = 2147483647;
	this.__maxWidth = 2147483647;
	this.__minHeight = 0;
	this.__minWidth = 0;
	this.clickCount = 0;
	this.onTextInput = new lime_app__$Event_$String_$Void();
	this.onTextEdit = new lime_app__$Event_$String_$Int_$Int_$Void();
	this.onShow = new lime_app__$Event_$Void_$Void();
	this.onRestore = new lime_app__$Event_$Void_$Void();
	this.onResize = new lime_app__$Event_$Int_$Int_$Void();
	this.onRenderContextRestored = new lime_app__$Event_$lime_$graphics_$RenderContext_$Void();
	this.onRenderContextLost = new lime_app__$Event_$Void_$Void();
	this.onRender = new lime_app__$Event_$lime_$graphics_$RenderContext_$Void();
	this.onMove = new lime_app__$Event_$Float_$Float_$Void();
	this.onMouseWheel = new lime_app__$Event_$Float_$Float_$lime_$ui_$MouseWheelMode_$Void();
	this.onMouseUp = new lime_app__$Event_$Float_$Float_$Int_$Void();
	this.onMouseMoveRelative = new lime_app__$Event_$Float_$Float_$Void();
	this.onMouseMove = new lime_app__$Event_$Float_$Float_$Void();
	this.onMouseDown = new lime_app__$Event_$Float_$Float_$lime_$ui_$MouseButton_$Void();
	this.onMinimize = new lime_app__$Event_$Void_$Void();
	this.onMaximize = new lime_app__$Event_$Void_$Void();
	this.onLeave = new lime_app__$Event_$Void_$Void();
	this.onKeyUp = new lime_app__$Event_$lime_$ui_$KeyCode_$lime_$ui_$KeyModifier_$Void();
	this.onKeyDown = new lime_app__$Event_$lime_$ui_$KeyCode_$lime_$ui_$KeyModifier_$Void();
	this.onHide = new lime_app__$Event_$Void_$Void();
	this.onFullscreen = new lime_app__$Event_$Void_$Void();
	this.onFocusOut = new lime_app__$Event_$Void_$Void();
	this.onFocusIn = new lime_app__$Event_$Void_$Void();
	this.onExpose = new lime_app__$Event_$Void_$Void();
	this.onEnter = new lime_app__$Event_$Void_$Void();
	this.onDropFile = new lime_app__$Event_$String_$Void();
	this.onDeactivate = new lime_app__$Event_$Void_$Void();
	this.onClose = new lime_app__$Event_$Void_$Void();
	this.onActivate = new lime_app__$Event_$Void_$Void();
	this.application = application;
	this.__attributes = attributes != null ? attributes : { };
	if(Object.prototype.hasOwnProperty.call(this.__attributes,"parameters")) {
		this.parameters = this.__attributes.parameters;
	}
	this.__width = 0;
	this.__height = 0;
	this.__fullscreen = false;
	this.__scale = 1;
	this.__x = 0;
	this.__y = 0;
	this.__title = Object.prototype.hasOwnProperty.call(this.__attributes,"title") ? this.__attributes.title : "";
	this.__hidden = false;
	this.__borderless = Object.prototype.hasOwnProperty.call(this.__attributes,"borderless") && this.__attributes.borderless;
	this.__resizable = Object.prototype.hasOwnProperty.call(this.__attributes,"resizable") && this.__attributes.resizable;
	this.__maximized = Object.prototype.hasOwnProperty.call(this.__attributes,"maximized") && this.__attributes.maximized;
	this.__minimized = Object.prototype.hasOwnProperty.call(this.__attributes,"minimized") && this.__attributes.minimized;
	this.id = -1;
	this.__backend = new lime__$internal_backend_html5_HTML5Window(this);
};
$hxClasses["lime.ui.Window"] = lime_ui_Window;
lime_ui_Window.__name__ = "lime.ui.Window";
lime_ui_Window.prototype = {
	application: null
	,context: null
	,display: null
	,element: null
	,hidden: null
	,id: null
	,onActivate: null
	,onClose: null
	,onDeactivate: null
	,onDropFile: null
	,onEnter: null
	,onExpose: null
	,onFocusIn: null
	,onFocusOut: null
	,onFullscreen: null
	,onHide: null
	,onKeyDown: null
	,onKeyUp: null
	,onLeave: null
	,onMaximize: null
	,onMinimize: null
	,onMouseDown: null
	,onMouseMove: null
	,onMouseMoveRelative: null
	,onMouseUp: null
	,onMouseWheel: null
	,onMove: null
	,onRender: null
	,onRenderContextLost: null
	,onRenderContextRestored: null
	,onResize: null
	,onRestore: null
	,onShow: null
	,onTextEdit: null
	,onTextInput: null
	,parameters: null
	,scale: null
	,stage: null
	,clickCount: null
	,__attributes: null
	,__backend: null
	,__borderless: null
	,__fullscreen: null
	,__height: null
	,__hidden: null
	,__maximized: null
	,__minimized: null
	,__resizable: null
	,__scale: null
	,__title: null
	,__width: null
	,__x: null
	,__y: null
	,__minWidth: null
	,__minHeight: null
	,__maxWidth: null
	,__maxHeight: null
	,alert: function(message,title) {
		this.__backend.alert(message,title);
	}
	,close: function() {
		this.__backend.close();
	}
	,focus: function() {
		this.__backend.focus();
	}
	,move: function(x,y) {
		this.__backend.move(x,y);
		this.__x = x;
		this.__y = y;
	}
	,readPixels: function(rect) {
		return this.__backend.readPixels(rect);
	}
	,resize: function(width,height) {
		if(width < this.__minWidth) {
			width = this.__minWidth;
		} else if(width > this.__maxWidth) {
			width = this.__maxWidth;
		}
		if(height < this.__minHeight) {
			height = this.__minHeight;
		} else if(height > this.__maxHeight) {
			height = this.__maxHeight;
		}
		this.__backend.resize(width,height);
		this.__width = width;
		this.__height = height;
	}
	,setMinSize: function(width,height) {
		this.__backend.setMinSize(width,height);
		this.__minWidth = width;
		this.__minHeight = height;
		if(this.__width < this.__minWidth || this.__height < this.__minHeight) {
			this.resize(this.__width,this.__height);
		}
	}
	,setMaxSize: function(width,height) {
		this.__backend.setMaxSize(width,height);
		this.__maxWidth = width;
		this.__maxHeight = height;
		if(this.__width > this.__maxWidth || this.__height > this.__maxHeight) {
			this.resize(this.__width,this.__height);
		}
	}
	,setIcon: function(image) {
		if(image == null) {
			return;
		}
		this.__backend.setIcon(image);
	}
	,toString: function() {
		return "[object Window]";
	}
	,warpMouse: function(x,y) {
		this.__backend.warpMouse(x,y);
	}
	,get_cursor: function() {
		return this.__backend.getCursor();
	}
	,set_cursor: function(value) {
		return this.__backend.setCursor(value);
	}
	,get_display: function() {
		return this.__backend.getDisplay();
	}
	,get_displayMode: function() {
		return this.__backend.getDisplayMode();
	}
	,set_displayMode: function(value) {
		return this.__backend.setDisplayMode(value);
	}
	,get_borderless: function() {
		return this.__borderless;
	}
	,set_borderless: function(value) {
		return this.__borderless = this.__backend.setBorderless(value);
	}
	,get_frameRate: function() {
		return this.__backend.getFrameRate();
	}
	,set_frameRate: function(value) {
		return this.__backend.setFrameRate(value);
	}
	,get_fullscreen: function() {
		return this.__fullscreen;
	}
	,set_fullscreen: function(value) {
		return this.__fullscreen = this.__backend.setFullscreen(value);
	}
	,get_height: function() {
		return this.__height;
	}
	,set_height: function(value) {
		this.resize(this.__width,value);
		return this.__height;
	}
	,get_hidden: function() {
		return this.__hidden;
	}
	,get_maxHeight: function() {
		return this.__maxHeight;
	}
	,set_maxHeight: function(value) {
		this.setMaxSize(this.__maxWidth,value);
		return this.__maxHeight;
	}
	,get_maximized: function() {
		return this.__maximized;
	}
	,set_maximized: function(value) {
		this.__minimized = false;
		return this.__maximized = this.__backend.setMaximized(value);
	}
	,get_maxWidth: function() {
		return this.__maxWidth;
	}
	,set_maxWidth: function(value) {
		this.setMinSize(value,this.__maxHeight);
		return this.__maxWidth;
	}
	,get_minHeight: function() {
		return this.__minHeight;
	}
	,set_minHeight: function(value) {
		this.setMinSize(this.__minWidth,value);
		return this.__minHeight;
	}
	,get_minimized: function() {
		return this.__minimized;
	}
	,set_minimized: function(value) {
		this.__maximized = false;
		return this.__minimized = this.__backend.setMinimized(value);
	}
	,get_minWidth: function() {
		return this.__minWidth;
	}
	,set_minWidth: function(value) {
		this.setMinSize(value,this.__minHeight);
		return this.__minWidth;
	}
	,get_mouseLock: function() {
		return this.__backend.getMouseLock();
	}
	,set_mouseLock: function(value) {
		this.__backend.setMouseLock(value);
		return value;
	}
	,get_opacity: function() {
		return this.__backend.getOpacity();
	}
	,set_opacity: function(value) {
		this.__backend.setOpacity(value);
		return value;
	}
	,get_resizable: function() {
		return this.__resizable;
	}
	,set_resizable: function(value) {
		this.__resizable = this.__backend.setResizable(value);
		return this.__resizable;
	}
	,get_scale: function() {
		return this.__scale;
	}
	,get_textInputEnabled: function() {
		return this.__backend.getTextInputEnabled();
	}
	,set_textInputEnabled: function(value) {
		return this.__backend.setTextInputEnabled(value);
	}
	,setTextInputRect: function(value) {
		return this.__backend.setTextInputRect(value);
	}
	,get_title: function() {
		return this.__title;
	}
	,set_title: function(value) {
		return this.__title = this.__backend.setTitle(value);
	}
	,get_visible: function() {
		return !this.__hidden;
	}
	,set_visible: function(value) {
		this.__hidden = !this.__backend.setVisible(value);
		return !this.__hidden;
	}
	,get_width: function() {
		return this.__width;
	}
	,set_width: function(value) {
		this.resize(value,this.__height);
		return this.__width;
	}
	,get_x: function() {
		return this.__x;
	}
	,set_x: function(value) {
		this.move(value,this.__y);
		return this.__x;
	}
	,get_y: function() {
		return this.__y;
	}
	,set_y: function(value) {
		this.move(this.__x,value);
		return this.__y;
	}
	,__class__: lime_ui_Window
	,__properties__: {set_y:"set_y",get_y:"get_y",set_x:"set_x",get_x:"get_x",set_width:"set_width",get_width:"get_width",set_visible:"set_visible",get_visible:"get_visible",set_title:"set_title",get_title:"get_title",set_textInputEnabled:"set_textInputEnabled",get_textInputEnabled:"get_textInputEnabled",get_scale:"get_scale",set_resizable:"set_resizable",get_resizable:"get_resizable",set_opacity:"set_opacity",get_opacity:"get_opacity",set_mouseLock:"set_mouseLock",get_mouseLock:"get_mouseLock",set_minWidth:"set_minWidth",get_minWidth:"get_minWidth",set_minimized:"set_minimized",get_minimized:"get_minimized",set_minHeight:"set_minHeight",get_minHeight:"get_minHeight",set_maxWidth:"set_maxWidth",get_maxWidth:"get_maxWidth",set_maximized:"set_maximized",get_maximized:"get_maximized",set_maxHeight:"set_maxHeight",get_maxHeight:"get_maxHeight",get_hidden:"get_hidden",set_height:"set_height",get_height:"get_height",set_fullscreen:"set_fullscreen",get_fullscreen:"get_fullscreen",set_frameRate:"set_frameRate",get_frameRate:"get_frameRate",set_displayMode:"set_displayMode",get_displayMode:"get_displayMode",get_display:"get_display",set_cursor:"set_cursor",get_cursor:"get_cursor",set_borderless:"set_borderless",get_borderless:"get_borderless"}
};
var lime_utils_TAError = $hxEnums["lime.utils.TAError"] = { __ename__:"lime.utils.TAError",__constructs__:null
	,RangeError: {_hx_name:"RangeError",_hx_index:0,__enum__:"lime.utils.TAError",toString:$estr}
};
lime_utils_TAError.__constructs__ = [lime_utils_TAError.RangeError];
var lime_utils_AssetBundle = function() {
	this.data = new haxe_ds_StringMap();
	this.paths = [];
};
$hxClasses["lime.utils.AssetBundle"] = lime_utils_AssetBundle;
lime_utils_AssetBundle.__name__ = "lime.utils.AssetBundle";
lime_utils_AssetBundle.fromBytes = function(bytes) {
	var input = new haxe_io_BytesInput(bytes);
	return lime_utils_AssetBundle.__extractBundle(input);
};
lime_utils_AssetBundle.fromFile = function(path) {
	return null;
};
lime_utils_AssetBundle.loadFromBytes = function(bytes) {
	return lime_app_Future.withValue(lime_utils_AssetBundle.fromBytes(bytes));
};
lime_utils_AssetBundle.loadFromFile = function(path) {
	return lime_utils_Bytes.loadFromFile(path).then(lime_utils_AssetBundle.loadFromBytes);
};
lime_utils_AssetBundle.__extractBundle = function(input) {
	var entries = haxe_zip_Reader.readZip(input);
	var bundle = new lime_utils_AssetBundle();
	var _g_head = entries.h;
	while(_g_head != null) {
		var val = _g_head.item;
		_g_head = _g_head.next;
		var entry = val;
		if(entry.compressed) {
			var bytes = entry.data;
			var this1 = bundle.data;
			var key = entry.fileName;
			var value = lime_utils_Bytes.decompress(bytes,lime_utils_CompressionAlgorithm.DEFLATE);
			this1.h[key] = value;
		} else {
			bundle.data.h[entry.fileName] = entry.data;
		}
		bundle.paths.push(entry.fileName);
	}
	return bundle;
};
lime_utils_AssetBundle.prototype = {
	data: null
	,paths: null
	,__class__: lime_utils_AssetBundle
};
var lime_utils_AssetCache = function() {
	this.enabled = true;
	this.audio = new haxe_ds_StringMap();
	this.font = new haxe_ds_StringMap();
	this.image = new haxe_ds_StringMap();
	this.version = 915027;
};
$hxClasses["lime.utils.AssetCache"] = lime_utils_AssetCache;
lime_utils_AssetCache.__name__ = "lime.utils.AssetCache";
lime_utils_AssetCache.prototype = {
	audio: null
	,enabled: null
	,image: null
	,font: null
	,version: null
	,exists: function(id,type) {
		if(type == "IMAGE" || type == null) {
			if(Object.prototype.hasOwnProperty.call(this.image.h,id)) {
				return true;
			}
		}
		if(type == "FONT" || type == null) {
			if(Object.prototype.hasOwnProperty.call(this.font.h,id)) {
				return true;
			}
		}
		if(type == "SOUND" || type == "MUSIC" || type == null) {
			if(Object.prototype.hasOwnProperty.call(this.audio.h,id)) {
				return true;
			}
		}
		return false;
	}
	,set: function(id,type,asset) {
		switch(type) {
		case "FONT":
			this.font.h[id] = asset;
			break;
		case "IMAGE":
			if(!((asset) instanceof lime_graphics_Image)) {
				throw haxe_Exception.thrown("Cannot cache non-Image asset: " + Std.string(asset) + " as Image");
			}
			this.image.h[id] = asset;
			break;
		case "MUSIC":case "SOUND":
			if(!((asset) instanceof lime_media_AudioBuffer)) {
				throw haxe_Exception.thrown("Cannot cache non-AudioBuffer asset: " + Std.string(asset) + " as AudioBuffer");
			}
			this.audio.h[id] = asset;
			break;
		default:
			throw haxe_Exception.thrown(type + " assets are not cachable");
		}
	}
	,clear: function(prefix) {
		if(prefix == null) {
			this.audio = new haxe_ds_StringMap();
			this.font = new haxe_ds_StringMap();
			this.image = new haxe_ds_StringMap();
		} else {
			var h = this.audio.h;
			var key_h = h;
			var key_keys = Object.keys(h);
			var key_length = key_keys.length;
			var key_current = 0;
			while(key_current < key_length) {
				var key = key_keys[key_current++];
				if(StringTools.startsWith(key,prefix)) {
					var _this = this.audio;
					if(Object.prototype.hasOwnProperty.call(_this.h,key)) {
						delete(_this.h[key]);
					}
				}
			}
			var h = this.font.h;
			var key_h = h;
			var key_keys = Object.keys(h);
			var key_length = key_keys.length;
			var key_current = 0;
			while(key_current < key_length) {
				var key = key_keys[key_current++];
				if(StringTools.startsWith(key,prefix)) {
					var _this = this.font;
					if(Object.prototype.hasOwnProperty.call(_this.h,key)) {
						delete(_this.h[key]);
					}
				}
			}
			var h = this.image.h;
			var key_h = h;
			var key_keys = Object.keys(h);
			var key_length = key_keys.length;
			var key_current = 0;
			while(key_current < key_length) {
				var key = key_keys[key_current++];
				if(StringTools.startsWith(key,prefix)) {
					var _this = this.image;
					if(Object.prototype.hasOwnProperty.call(_this.h,key)) {
						delete(_this.h[key]);
					}
				}
			}
		}
	}
	,__class__: lime_utils_AssetCache
};
var lime_utils_AssetLibrary = function() {
	this.types = new haxe_ds_StringMap();
	this.sizes = new haxe_ds_StringMap();
	this.preload = new haxe_ds_StringMap();
	this.paths = new haxe_ds_StringMap();
	this.pathGroups = new haxe_ds_StringMap();
	this.classTypes = new haxe_ds_StringMap();
	this.cachedText = new haxe_ds_StringMap();
	this.cachedImages = new haxe_ds_StringMap();
	this.cachedFonts = new haxe_ds_StringMap();
	this.cachedBytes = new haxe_ds_StringMap();
	this.cachedAudioBuffers = new haxe_ds_StringMap();
	this.onChange = new lime_app__$Event_$Void_$Void();
	this.bytesLoaded = 0;
	this.bytesTotal = 0;
};
$hxClasses["lime.utils.AssetLibrary"] = lime_utils_AssetLibrary;
lime_utils_AssetLibrary.__name__ = "lime.utils.AssetLibrary";
lime_utils_AssetLibrary.fromBytes = function(bytes,rootPath) {
	return lime_utils_AssetLibrary.fromManifest(lime_utils_AssetManifest.fromBytes(bytes,rootPath));
};
lime_utils_AssetLibrary.fromFile = function(path,rootPath) {
	return lime_utils_AssetLibrary.fromManifest(lime_utils_AssetManifest.fromFile(path,rootPath));
};
lime_utils_AssetLibrary.fromBundle = function(bundle) {
	if(Object.prototype.hasOwnProperty.call(bundle.data.h,"library.json")) {
		var manifest = lime_utils_AssetManifest.fromBytes(bundle.data.h["library.json"]);
		if(manifest != null) {
			var library = null;
			if(manifest.libraryType == null) {
				library = new lime_utils_AssetLibrary();
			} else {
				var name = manifest.libraryType;
				var libraryClass = $hxClasses[name];
				if(libraryClass != null) {
					library = Type.createInstance(libraryClass,manifest.libraryArgs);
				} else {
					lime_utils_Log.warn("Could not find library type: " + manifest.libraryType,{ fileName : "lime/utils/AssetLibrary.hx", lineNumber : 122, className : "lime.utils.AssetLibrary", methodName : "fromBundle"});
					return null;
				}
			}
			library.__fromBundle(bundle,manifest);
			return library;
		}
	} else {
		var library = new lime_utils_AssetLibrary();
		library.__fromBundle(bundle);
		return library;
	}
	return null;
};
lime_utils_AssetLibrary.fromManifest = function(manifest) {
	if(manifest == null) {
		return null;
	}
	var library = null;
	if(manifest.libraryType == null) {
		library = new lime_utils_AssetLibrary();
	} else {
		var name = manifest.libraryType;
		var libraryClass = $hxClasses[name];
		if(libraryClass != null) {
			library = Type.createInstance(libraryClass,manifest.libraryArgs);
		} else {
			lime_utils_Log.warn("Could not find library type: " + manifest.libraryType,{ fileName : "lime/utils/AssetLibrary.hx", lineNumber : 160, className : "lime.utils.AssetLibrary", methodName : "fromManifest"});
			return null;
		}
	}
	library.__fromManifest(manifest);
	return library;
};
lime_utils_AssetLibrary.loadFromBytes = function(bytes,rootPath) {
	return lime_utils_AssetManifest.loadFromBytes(bytes,rootPath).then(function(manifest) {
		return lime_utils_AssetLibrary.loadFromManifest(manifest);
	});
};
lime_utils_AssetLibrary.loadFromFile = function(path,rootPath) {
	return lime_utils_AssetManifest.loadFromFile(path,rootPath).then(function(manifest) {
		return lime_utils_AssetLibrary.loadFromManifest(manifest);
	});
};
lime_utils_AssetLibrary.loadFromManifest = function(manifest) {
	var library = lime_utils_AssetLibrary.fromManifest(manifest);
	if(library != null) {
		return library.load();
	} else {
		return lime_app_Future.withError("Could not load asset manifest");
	}
};
lime_utils_AssetLibrary.prototype = {
	onChange: null
	,assetsLoaded: null
	,assetsTotal: null
	,bytesLoaded: null
	,bytesLoadedCache: null
	,bytesTotal: null
	,cachedAudioBuffers: null
	,cachedBytes: null
	,cachedFonts: null
	,cachedImages: null
	,cachedText: null
	,classTypes: null
	,loaded: null
	,pathGroups: null
	,paths: null
	,preload: null
	,promise: null
	,sizes: null
	,types: null
	,exists: function(id,type) {
		var requestedType = type != null ? js_Boot.__cast(type , String) : null;
		var assetType = this.types.h[id];
		if(assetType != null) {
			if(assetType == requestedType || (requestedType == "SOUND" || requestedType == "MUSIC") && (assetType == "MUSIC" || assetType == "SOUND")) {
				return true;
			}
			if(requestedType == "BINARY" || requestedType == null || assetType == "BINARY" && requestedType == "TEXT") {
				return true;
			}
		}
		return false;
	}
	,getAsset: function(id,type) {
		switch(type) {
		case "BINARY":
			return this.getBytes(id);
		case "FONT":
			return this.getFont(id);
		case "IMAGE":
			return this.getImage(id);
		case "MUSIC":case "SOUND":
			return this.getAudioBuffer(id);
		case "TEMPLATE":
			throw haxe_Exception.thrown("Not sure how to get template: " + id);
		case "TEXT":
			return this.getText(id);
		default:
			throw haxe_Exception.thrown("Unknown asset type: " + type);
		}
	}
	,getAudioBuffer: function(id) {
		if(Object.prototype.hasOwnProperty.call(this.cachedAudioBuffers.h,id)) {
			return this.cachedAudioBuffers.h[id];
		} else if(Object.prototype.hasOwnProperty.call(this.classTypes.h,id)) {
			return lime_media_AudioBuffer.fromBytes(js_Boot.__cast(Type.createInstance(this.classTypes.h[id],[]) , haxe_io_Bytes));
		} else {
			return lime_media_AudioBuffer.fromFile(this.getPath(id));
		}
	}
	,getBytes: function(id) {
		if(Object.prototype.hasOwnProperty.call(this.cachedBytes.h,id)) {
			return this.cachedBytes.h[id];
		} else if(Object.prototype.hasOwnProperty.call(this.cachedText.h,id)) {
			var bytes = lime_utils_Bytes.ofString(this.cachedText.h[id]);
			this.cachedBytes.h[id] = bytes;
			return bytes;
		} else if(Object.prototype.hasOwnProperty.call(this.classTypes.h,id)) {
			return js_Boot.__cast(Type.createInstance(this.classTypes.h[id],[]) , haxe_io_Bytes);
		} else {
			return lime_utils_Bytes.fromFile(this.getPath(id));
		}
	}
	,getFont: function(id) {
		if(Object.prototype.hasOwnProperty.call(this.cachedFonts.h,id)) {
			return this.cachedFonts.h[id];
		} else if(Object.prototype.hasOwnProperty.call(this.classTypes.h,id)) {
			return js_Boot.__cast(Type.createInstance(this.classTypes.h[id],[]) , lime_text_Font);
		} else {
			return lime_text_Font.fromFile(this.getPath(id));
		}
	}
	,getImage: function(id) {
		if(Object.prototype.hasOwnProperty.call(this.cachedImages.h,id)) {
			return this.cachedImages.h[id];
		} else if(Object.prototype.hasOwnProperty.call(this.classTypes.h,id)) {
			return js_Boot.__cast(Type.createInstance(this.classTypes.h[id],[]) , lime_graphics_Image);
		} else {
			return lime_graphics_Image.fromFile(this.getPath(id));
		}
	}
	,getPath: function(id) {
		if(Object.prototype.hasOwnProperty.call(this.paths.h,id)) {
			return this.paths.h[id];
		} else if(Object.prototype.hasOwnProperty.call(this.pathGroups.h,id)) {
			return this.pathGroups.h[id][0];
		} else {
			return null;
		}
	}
	,getText: function(id) {
		if(Object.prototype.hasOwnProperty.call(this.cachedText.h,id)) {
			return this.cachedText.h[id];
		} else {
			var bytes = this.getBytes(id);
			if(bytes == null) {
				return null;
			} else {
				return bytes.getString(0,bytes.length);
			}
		}
	}
	,isLocal: function(id,type) {
		if(Object.prototype.hasOwnProperty.call(this.classTypes.h,id)) {
			return true;
		}
		var _g = js_Boot.__cast(type , String);
		if(_g == null) {
			if(!(Object.prototype.hasOwnProperty.call(this.cachedBytes.h,id) || Object.prototype.hasOwnProperty.call(this.cachedText.h,id) || Object.prototype.hasOwnProperty.call(this.cachedImages.h,id) || Object.prototype.hasOwnProperty.call(this.cachedAudioBuffers.h,id))) {
				return Object.prototype.hasOwnProperty.call(this.cachedFonts.h,id);
			} else {
				return true;
			}
		} else {
			switch(_g) {
			case "FONT":
				return Object.prototype.hasOwnProperty.call(this.cachedFonts.h,id);
			case "IMAGE":
				return Object.prototype.hasOwnProperty.call(this.cachedImages.h,id);
			case "MUSIC":case "SOUND":
				return Object.prototype.hasOwnProperty.call(this.cachedAudioBuffers.h,id);
			default:
				if(!Object.prototype.hasOwnProperty.call(this.cachedBytes.h,id)) {
					return Object.prototype.hasOwnProperty.call(this.cachedText.h,id);
				} else {
					return true;
				}
			}
		}
	}
	,list: function(type) {
		var requestedType = type != null ? js_Boot.__cast(type , String) : null;
		var items = [];
		var h = this.types.h;
		var id_h = h;
		var id_keys = Object.keys(h);
		var id_length = id_keys.length;
		var id_current = 0;
		while(id_current < id_length) {
			var id = id_keys[id_current++];
			if(requestedType == null || this.exists(id,type)) {
				items.push(id);
			}
		}
		return items;
	}
	,loadAsset: function(id,type) {
		switch(type) {
		case "BINARY":
			return this.loadBytes(id);
		case "FONT":
			return this.loadFont(id);
		case "IMAGE":
			return this.loadImage(id);
		case "MUSIC":case "SOUND":
			return this.loadAudioBuffer(id);
		case "TEMPLATE":
			throw haxe_Exception.thrown("Not sure how to load template: " + id);
		case "TEXT":
			return this.loadText(id);
		default:
			throw haxe_Exception.thrown("Unknown asset type: " + type);
		}
	}
	,load: function() {
		if(this.loaded) {
			return lime_app_Future.withValue(this);
		}
		if(this.promise == null) {
			this.promise = new lime_app_Promise();
			this.bytesLoadedCache = new haxe_ds_StringMap();
			this.assetsLoaded = 0;
			this.assetsTotal = 1;
			var h = this.preload.h;
			var id_h = h;
			var id_keys = Object.keys(h);
			var id_length = id_keys.length;
			var id_current = 0;
			while(id_current < id_length) {
				var id = id_keys[id_current++];
				if(!this.preload.h[id]) {
					continue;
				}
				lime_utils_Log.verbose("Preloading asset: " + id + " [" + this.types.h[id] + "]",{ fileName : "lime/utils/AssetLibrary.hx", lineNumber : 408, className : "lime.utils.AssetLibrary", methodName : "load"});
				var _g = this.types.h[id];
				if(_g != null) {
					switch(_g) {
					case "BINARY":
						this.assetsTotal++;
						var future = this.loadBytes(id);
						future.onProgress((function(id,_g) {
							return function(bytesLoaded,bytesTotal) {
								_g[0].load_onProgress(id[0],bytesLoaded,bytesTotal);
							};
						})([id],[this]));
						future.onError((function(id,_g) {
							return function(message) {
								_g[0].load_onError(id[0],message);
							};
						})([id],[this]));
						future.onComplete((function(id,_g) {
							return function(bytes) {
								_g[0].loadBytes_onComplete(id[0],bytes);
							};
						})([id],[this]));
						break;
					case "FONT":
						this.assetsTotal++;
						var future1 = this.loadFont(id);
						future1.onProgress((function(id,_g) {
							return function(bytesLoaded,bytesTotal) {
								_g[0].load_onProgress(id[0],bytesLoaded,bytesTotal);
							};
						})([id],[this]));
						future1.onError((function(id,_g) {
							return function(message) {
								_g[0].load_onError(id[0],message);
							};
						})([id],[this]));
						future1.onComplete((function(id,_g) {
							return function(font) {
								_g[0].loadFont_onComplete(id[0],font);
							};
						})([id],[this]));
						break;
					case "IMAGE":
						this.assetsTotal++;
						var future2 = this.loadImage(id);
						future2.onProgress((function(id,_g) {
							return function(bytesLoaded,bytesTotal) {
								_g[0].load_onProgress(id[0],bytesLoaded,bytesTotal);
							};
						})([id],[this]));
						future2.onError((function(id,_g) {
							return function(message) {
								_g[0].load_onError(id[0],message);
							};
						})([id],[this]));
						future2.onComplete((function(id,_g) {
							return function(image) {
								_g[0].loadImage_onComplete(id[0],image);
							};
						})([id],[this]));
						break;
					case "MUSIC":case "SOUND":
						this.assetsTotal++;
						var future3 = this.loadAudioBuffer(id);
						future3.onProgress((function(id,_g) {
							return function(bytesLoaded,bytesTotal) {
								_g[0].load_onProgress(id[0],bytesLoaded,bytesTotal);
							};
						})([id],[this]));
						future3.onError((function(id,_g) {
							return function(message) {
								_g[0].loadAudioBuffer_onError(id[0],message);
							};
						})([id],[this]));
						future3.onComplete((function(id,_g) {
							return function(audioBuffer) {
								_g[0].loadAudioBuffer_onComplete(id[0],audioBuffer);
							};
						})([id],[this]));
						break;
					case "TEXT":
						this.assetsTotal++;
						var future4 = this.loadText(id);
						future4.onProgress((function(id,_g) {
							return function(bytesLoaded,bytesTotal) {
								_g[0].load_onProgress(id[0],bytesLoaded,bytesTotal);
							};
						})([id],[this]));
						future4.onError((function(id,_g) {
							return function(message) {
								_g[0].load_onError(id[0],message);
							};
						})([id],[this]));
						future4.onComplete((function(id,_g) {
							return function(text) {
								_g[0].loadText_onComplete(id[0],text);
							};
						})([id],[this]));
						break;
					default:
					}
				}
			}
			this.__assetLoaded(null);
		}
		return this.promise.future;
	}
	,loadAudioBuffer: function(id) {
		if(Object.prototype.hasOwnProperty.call(this.cachedAudioBuffers.h,id)) {
			return lime_app_Future.withValue(this.cachedAudioBuffers.h[id]);
		} else if(Object.prototype.hasOwnProperty.call(this.classTypes.h,id)) {
			return lime_app_Future.withValue(lime_media_AudioBuffer.fromBytes(js_Boot.__cast(Type.createInstance(this.classTypes.h[id],[]) , haxe_io_Bytes)));
		} else if(Object.prototype.hasOwnProperty.call(this.pathGroups.h,id)) {
			return lime_media_AudioBuffer.loadFromFiles(this.pathGroups.h[id]);
		} else {
			return lime_media_AudioBuffer.loadFromFile(this.paths.h[id]);
		}
	}
	,loadBytes: function(id) {
		if(Object.prototype.hasOwnProperty.call(this.cachedBytes.h,id)) {
			return lime_app_Future.withValue(this.cachedBytes.h[id]);
		} else if(Object.prototype.hasOwnProperty.call(this.classTypes.h,id)) {
			return lime_app_Future.withValue(Type.createInstance(this.classTypes.h[id],[]));
		} else {
			return lime_utils_Bytes.loadFromFile(this.getPath(id));
		}
	}
	,loadFont: function(id) {
		if(Object.prototype.hasOwnProperty.call(this.cachedFonts.h,id)) {
			return lime_app_Future.withValue(this.cachedFonts.h[id]);
		} else if(Object.prototype.hasOwnProperty.call(this.classTypes.h,id)) {
			var font = Type.createInstance(this.classTypes.h[id],[]);
			return font.__loadFromName(font.name);
		} else {
			return lime_text_Font.loadFromName(this.getPath(id));
		}
	}
	,loadImage: function(id) {
		var _gthis = this;
		if(Object.prototype.hasOwnProperty.call(this.cachedImages.h,id)) {
			return lime_app_Future.withValue(this.cachedImages.h[id]);
		} else if(Object.prototype.hasOwnProperty.call(this.classTypes.h,id)) {
			return lime_app_Future.withValue(Type.createInstance(this.classTypes.h[id],[]));
		} else if(Object.prototype.hasOwnProperty.call(this.cachedBytes.h,id)) {
			return lime_graphics_Image.loadFromBytes(this.cachedBytes.h[id]).then(function(image) {
				var _this = _gthis.cachedBytes;
				if(Object.prototype.hasOwnProperty.call(_this.h,id)) {
					delete(_this.h[id]);
				}
				_gthis.cachedImages.h[id] = image;
				return lime_app_Future.withValue(image);
			});
		} else {
			return lime_graphics_Image.loadFromFile(this.getPath(id));
		}
	}
	,loadText: function(id) {
		if(Object.prototype.hasOwnProperty.call(this.cachedText.h,id)) {
			return lime_app_Future.withValue(this.cachedText.h[id]);
		} else if(Object.prototype.hasOwnProperty.call(this.cachedBytes.h,id) || Object.prototype.hasOwnProperty.call(this.classTypes.h,id)) {
			var bytes = this.getBytes(id);
			if(bytes == null) {
				return lime_app_Future.withValue(null);
			} else {
				var text = bytes.getString(0,bytes.length);
				this.cachedText.h[id] = text;
				return lime_app_Future.withValue(text);
			}
		} else {
			var request = new lime_net__$HTTPRequest_$String();
			return request.load(this.getPath(id));
		}
	}
	,unload: function() {
		this.cachedBytes.h = Object.create(null);
		this.cachedFonts.h = Object.create(null);
		this.cachedImages.h = Object.create(null);
		this.cachedAudioBuffers.h = Object.create(null);
		this.cachedText.h = Object.create(null);
	}
	,__assetLoaded: function(id) {
		this.assetsLoaded++;
		if(id != null) {
			lime_utils_Log.verbose("Loaded asset: " + id + " [" + this.types.h[id] + "] (" + (this.assetsLoaded - 1) + "/" + (this.assetsTotal - 1) + ")",{ fileName : "lime/utils/AssetLibrary.hx", lineNumber : 637, className : "lime.utils.AssetLibrary", methodName : "__assetLoaded"});
		}
		if(id != null) {
			var size = Object.prototype.hasOwnProperty.call(this.sizes.h,id) ? this.sizes.h[id] : 0;
			if(!Object.prototype.hasOwnProperty.call(this.bytesLoadedCache.h,id)) {
				this.bytesLoaded += size;
			} else {
				var cache = this.bytesLoadedCache.h[id];
				if(cache < size) {
					this.bytesLoaded += size - cache;
				}
			}
			this.bytesLoadedCache.h[id] = size;
		}
		if(this.assetsLoaded < this.assetsTotal) {
			this.promise.progress(this.bytesLoaded,this.bytesTotal);
		} else {
			this.loaded = true;
			this.promise.progress(this.bytesTotal,this.bytesTotal);
			this.promise.complete(this);
		}
	}
	,__cacheBreak: function(path) {
		return lime_utils_Assets.__cacheBreak(path);
	}
	,__fromBundle: function(bundle,manifest) {
		if(manifest != null) {
			var id;
			var data;
			var type;
			var _g = 0;
			var _g1 = manifest.assets;
			while(_g < _g1.length) {
				var asset = _g1[_g];
				++_g;
				id = Object.prototype.hasOwnProperty.call(asset,"id") ? asset.id : asset.path;
				data = bundle.data.h[asset.path];
				if(Object.prototype.hasOwnProperty.call(asset,"type")) {
					type = asset.type;
					if(type == "TEXT") {
						this.cachedText.h[id] = data != null ? Std.string(data) : null;
					} else {
						this.cachedBytes.h[id] = data;
					}
					this.types.h[id] = asset.type;
				} else {
					this.cachedBytes.h[id] = data;
					this.types.h[id] = "BINARY";
				}
			}
		} else {
			var _g = 0;
			var _g1 = bundle.paths;
			while(_g < _g1.length) {
				var path = _g1[_g];
				++_g;
				this.cachedBytes.h[path] = bundle.data.h[path];
				this.types.h[path] = "BINARY";
			}
		}
	}
	,__fromManifest: function(manifest) {
		var hasSize = manifest.version >= 2;
		var size;
		var id;
		var pathGroup;
		var classRef;
		var basePath = manifest.rootPath;
		if(basePath == null) {
			basePath = "";
		}
		if(basePath != "") {
			basePath += "/";
		}
		var _g = 0;
		var _g1 = manifest.assets;
		while(_g < _g1.length) {
			var asset = _g1[_g];
			++_g;
			size = hasSize && Object.prototype.hasOwnProperty.call(asset,"size") ? asset.size : 100;
			id = Object.prototype.hasOwnProperty.call(asset,"id") ? asset.id : asset.path;
			if(Object.prototype.hasOwnProperty.call(asset,"path")) {
				var this1 = this.paths;
				var value = this.__cacheBreak(this.__resolvePath(basePath + Std.string(Reflect.field(asset,"path"))));
				this1.h[id] = value;
			}
			if(Object.prototype.hasOwnProperty.call(asset,"pathGroup")) {
				pathGroup = Reflect.field(asset,"pathGroup");
				var _g2 = 0;
				var _g3 = pathGroup.length;
				while(_g2 < _g3) {
					var i = _g2++;
					pathGroup[i] = this.__cacheBreak(this.__resolvePath(basePath + pathGroup[i]));
				}
				this.pathGroups.h[id] = pathGroup;
			}
			this.sizes.h[id] = size;
			this.types.h[id] = asset.type;
			if(Object.prototype.hasOwnProperty.call(asset,"preload")) {
				this.preload.h[id] = Reflect.field(asset,"preload");
			}
			if(Object.prototype.hasOwnProperty.call(asset,"className")) {
				var name = Reflect.field(asset,"className");
				classRef = $hxClasses[name];
				this.classTypes.h[id] = classRef;
			}
		}
		this.bytesTotal = 0;
		var _g = 0;
		var _g1 = manifest.assets;
		while(_g < _g1.length) {
			var asset = _g1[_g];
			++_g;
			id = Object.prototype.hasOwnProperty.call(asset,"id") ? asset.id : asset.path;
			if(Object.prototype.hasOwnProperty.call(this.preload.h,id) && this.preload.h[id] && Object.prototype.hasOwnProperty.call(this.sizes.h,id)) {
				this.bytesTotal += this.sizes.h[id];
			}
		}
	}
	,__resolvePath: function(path) {
		path = StringTools.replace(path,"\\","/");
		var colonIdx = path.indexOf(":");
		if(StringTools.startsWith(path,"http") && colonIdx > 0) {
			var lastSlashIdx = colonIdx + 3;
			var httpSection = HxOverrides.substr(path,0,lastSlashIdx);
			path = httpSection + StringTools.replace(HxOverrides.substr(path,lastSlashIdx,null),"//","/");
		} else {
			path = StringTools.replace(path,"//","/");
		}
		if(path.indexOf("./") > -1) {
			var split = path.split("/");
			var newPath = [];
			var _g = 0;
			var _g1 = split.length;
			while(_g < _g1) {
				var i = _g++;
				if(split[i] == "..") {
					if(i == 0 || newPath[i - 1] == "..") {
						newPath.push("..");
					} else {
						newPath.pop();
					}
				} else if(split[i] == ".") {
					if(i == 0) {
						newPath.push(".");
					}
				} else {
					newPath.push(split[i]);
				}
			}
			path = newPath.join("/");
		}
		return path;
	}
	,loadAudioBuffer_onComplete: function(id,audioBuffer) {
		this.cachedAudioBuffers.h[id] = audioBuffer;
		if(Object.prototype.hasOwnProperty.call(this.pathGroups.h,id)) {
			var pathGroup = this.pathGroups.h[id];
			var h = this.pathGroups.h;
			var otherID_h = h;
			var otherID_keys = Object.keys(h);
			var otherID_length = otherID_keys.length;
			var otherID_current = 0;
			while(otherID_current < otherID_length) {
				var otherID = otherID_keys[otherID_current++];
				if(otherID == id) {
					continue;
				}
				var _g = 0;
				while(_g < pathGroup.length) {
					var path = pathGroup[_g];
					++_g;
					if(this.pathGroups.h[otherID].indexOf(path) > -1) {
						this.cachedAudioBuffers.h[otherID] = audioBuffer;
						break;
					}
				}
			}
		}
		this.__assetLoaded(id);
	}
	,loadAudioBuffer_onError: function(id,message) {
		if(message != null && message != "") {
			lime_utils_Log.warn("Could not load \"" + id + "\": " + Std.string(message),{ fileName : "lime/utils/AssetLibrary.hx", lineNumber : 883, className : "lime.utils.AssetLibrary", methodName : "loadAudioBuffer_onError"});
		} else {
			lime_utils_Log.warn("Could not load \"" + id + "\"",{ fileName : "lime/utils/AssetLibrary.hx", lineNumber : 887, className : "lime.utils.AssetLibrary", methodName : "loadAudioBuffer_onError"});
		}
		this.loadAudioBuffer_onComplete(id,new lime_media_AudioBuffer());
	}
	,loadBytes_onComplete: function(id,bytes) {
		this.cachedBytes.h[id] = bytes;
		this.__assetLoaded(id);
	}
	,loadFont_onComplete: function(id,font) {
		this.cachedFonts.h[id] = font;
		this.__assetLoaded(id);
	}
	,loadImage_onComplete: function(id,image) {
		this.cachedImages.h[id] = image;
		this.__assetLoaded(id);
	}
	,loadText_onComplete: function(id,text) {
		this.cachedText.h[id] = text;
		this.__assetLoaded(id);
	}
	,load_onError: function(id,message) {
		if(message != null && message != "") {
			this.promise.error("Error loading asset \"" + id + "\": " + Std.string(message));
		} else {
			this.promise.error("Error loading asset \"" + id + "\"");
		}
	}
	,load_onProgress: function(id,bytesLoaded,bytesTotal) {
		if(bytesLoaded > 0) {
			var size = this.sizes.h[id];
			var percent;
			if(bytesTotal > 0) {
				percent = bytesLoaded / bytesTotal;
				if(percent > 1) {
					percent = 1;
				}
				bytesLoaded = Math.floor(percent * size);
			} else if(bytesLoaded > size) {
				bytesLoaded = size;
			}
			if(Object.prototype.hasOwnProperty.call(this.bytesLoadedCache.h,id)) {
				var cache = this.bytesLoadedCache.h[id];
				if(bytesLoaded != cache) {
					this.bytesLoaded += bytesLoaded - cache;
				}
			} else {
				this.bytesLoaded += bytesLoaded;
			}
			this.bytesLoadedCache.h[id] = bytesLoaded;
			this.promise.progress(this.bytesLoaded,this.bytesTotal);
		}
	}
	,__class__: lime_utils_AssetLibrary
};
var lime_utils_AssetManifest = function() {
	this.assets = [];
	this.libraryArgs = [];
	this.version = 2;
};
$hxClasses["lime.utils.AssetManifest"] = lime_utils_AssetManifest;
lime_utils_AssetManifest.__name__ = "lime.utils.AssetManifest";
lime_utils_AssetManifest.fromBytes = function(bytes,rootPath) {
	if(bytes != null) {
		return lime_utils_AssetManifest.parse(bytes.getString(0,bytes.length),rootPath);
	} else {
		return null;
	}
};
lime_utils_AssetManifest.fromFile = function(path,rootPath) {
	path = lime_utils_AssetManifest.__resolvePath(path);
	rootPath = lime_utils_AssetManifest.__resolveRootPath(rootPath,path);
	if(path == null) {
		return null;
	}
	return lime_utils_AssetManifest.fromBytes(lime_utils_Bytes.fromFile(path),rootPath);
};
lime_utils_AssetManifest.loadFromBytes = function(bytes,rootPath) {
	return lime_app_Future.withValue(lime_utils_AssetManifest.fromBytes(bytes,rootPath));
};
lime_utils_AssetManifest.loadFromFile = function(path,rootPath) {
	path = lime_utils_AssetManifest.__resolvePath(path);
	rootPath = lime_utils_AssetManifest.__resolveRootPath(rootPath,path);
	if(path == null) {
		return null;
	}
	return lime_utils_Bytes.loadFromFile(path).then(function(bytes) {
		return lime_app_Future.withValue(lime_utils_AssetManifest.fromBytes(bytes,rootPath));
	});
};
lime_utils_AssetManifest.parse = function(data,rootPath) {
	if(data == null || data == "") {
		return null;
	}
	var manifestData = new haxe_format_JsonParser(data).doParse();
	var manifest = new lime_utils_AssetManifest();
	if(Object.prototype.hasOwnProperty.call(manifestData,"name")) {
		manifest.name = manifestData.name;
	}
	if(Object.prototype.hasOwnProperty.call(manifestData,"libraryType")) {
		manifest.libraryType = manifestData.libraryType;
	}
	if(Object.prototype.hasOwnProperty.call(manifestData,"libraryArgs")) {
		manifest.libraryArgs = manifestData.libraryArgs;
	}
	if(Object.prototype.hasOwnProperty.call(manifestData,"assets")) {
		var assets = manifestData.assets;
		if(Object.prototype.hasOwnProperty.call(manifestData,"version") && manifestData.version <= 2) {
			manifest.assets = haxe_Unserializer.run(assets);
		} else {
			manifest.assets = assets;
		}
	}
	if(Object.prototype.hasOwnProperty.call(manifestData,"rootPath")) {
		manifest.rootPath = manifestData.rootPath;
	}
	if(rootPath != null && rootPath != "") {
		if(manifest.rootPath == null || manifest.rootPath == "") {
			manifest.rootPath = rootPath;
		} else {
			manifest.rootPath = rootPath + "/" + manifest.rootPath;
		}
	}
	return manifest;
};
lime_utils_AssetManifest.__resolvePath = function(path) {
	if(path == null) {
		return null;
	}
	var queryIndex = path.indexOf("?");
	var basePath;
	if(queryIndex > -1) {
		basePath = HxOverrides.substr(path,0,queryIndex);
	} else {
		basePath = path;
	}
	basePath = StringTools.replace(basePath,"\\","/");
	while(StringTools.endsWith(basePath,"/")) basePath = HxOverrides.substr(basePath,0,basePath.length - 1);
	if(StringTools.endsWith(basePath,".bundle")) {
		if(queryIndex > -1) {
			return basePath + "/library.json" + HxOverrides.substr(path,queryIndex,null);
		} else {
			return basePath + "/library.json";
		}
	} else {
		return path;
	}
};
lime_utils_AssetManifest.__resolveRootPath = function(rootPath,path) {
	if(rootPath != null) {
		return rootPath;
	}
	var queryIndex = path.indexOf("?");
	if(queryIndex > -1) {
		rootPath = HxOverrides.substr(path,0,queryIndex);
	} else {
		rootPath = path;
	}
	rootPath = StringTools.replace(rootPath,"\\","/");
	while(StringTools.endsWith(rootPath,"/")) {
		if(rootPath == "/") {
			return rootPath;
		}
		rootPath = HxOverrides.substr(rootPath,0,rootPath.length - 1);
	}
	if(StringTools.endsWith(rootPath,".bundle")) {
		return rootPath;
	} else {
		return haxe_io_Path.directory(rootPath);
	}
};
lime_utils_AssetManifest.prototype = {
	assets: null
	,libraryArgs: null
	,libraryType: null
	,name: null
	,rootPath: null
	,version: null
	,serialize: function() {
		var manifestData = { };
		manifestData.version = this.version;
		manifestData.libraryType = this.libraryType;
		manifestData.libraryArgs = this.libraryArgs;
		manifestData.name = this.name;
		manifestData.assets = haxe_Serializer.run(this.assets);
		manifestData.rootPath = this.rootPath;
		return haxe_format_JsonPrinter.print(manifestData,null,null);
	}
	,__class__: lime_utils_AssetManifest
};
var lime_utils_Assets = function() { };
$hxClasses["lime.utils.Assets"] = lime_utils_Assets;
lime_utils_Assets.__name__ = "lime.utils.Assets";
lime_utils_Assets.exists = function(id,type) {
	if(type == null) {
		type = "BINARY";
	}
	var id1 = id;
	var colonIndex = id1.indexOf(":");
	var symbol_libraryName = id1.substring(0,colonIndex);
	var symbol_symbolName = id1.substring(colonIndex + 1);
	var symbol_library = lime_utils_Assets.getLibrary(symbol_libraryName);
	if(symbol_library != null) {
		return symbol_library.exists(symbol_symbolName,type);
	}
	return false;
};
lime_utils_Assets.getAsset = function(id,type,useCache) {
	if(useCache && lime_utils_Assets.cache.enabled) {
		switch(type) {
		case "FONT":
			var font = lime_utils_Assets.cache.font.h[id];
			if(font != null) {
				return font;
			}
			break;
		case "IMAGE":
			var image = lime_utils_Assets.cache.image.h[id];
			if(lime_utils_Assets.isValidImage(image)) {
				return image;
			}
			break;
		case "MUSIC":case "SOUND":
			var audio = lime_utils_Assets.cache.audio.h[id];
			if(lime_utils_Assets.isValidAudio(audio)) {
				return audio;
			}
			break;
		case "TEMPLATE":
			throw haxe_Exception.thrown("Not sure how to get template: " + id);
		case "BINARY":case "TEXT":
			useCache = false;
			break;
		default:
			return null;
		}
	}
	var id1 = id;
	var colonIndex = id1.indexOf(":");
	var symbol_libraryName = id1.substring(0,colonIndex);
	var symbol_symbolName = id1.substring(colonIndex + 1);
	var symbol_library = lime_utils_Assets.getLibrary(symbol_libraryName);
	if(symbol_library != null) {
		if(symbol_library.exists(symbol_symbolName,type)) {
			if(symbol_library.isLocal(symbol_symbolName,type)) {
				var asset = symbol_library.getAsset(symbol_symbolName,type);
				if(useCache && lime_utils_Assets.cache.enabled) {
					lime_utils_Assets.cache.set(id,type,asset);
				}
				return asset;
			} else {
				lime_utils_Log.error(type + " asset \"" + id + "\" exists, but only asynchronously",{ fileName : "lime/utils/Assets.hx", lineNumber : 133, className : "lime.utils.Assets", methodName : "getAsset"});
			}
		} else {
			lime_utils_Log.error("There is no " + type + " asset with an ID of \"" + id + "\"",{ fileName : "lime/utils/Assets.hx", lineNumber : 138, className : "lime.utils.Assets", methodName : "getAsset"});
		}
	} else {
		lime_utils_Log.error(lime_utils_Assets.__libraryNotFound(symbol_libraryName),{ fileName : "lime/utils/Assets.hx", lineNumber : 143, className : "lime.utils.Assets", methodName : "getAsset"});
	}
	return null;
};
lime_utils_Assets.getAudioBuffer = function(id,useCache) {
	if(useCache == null) {
		useCache = true;
	}
	return lime_utils_Assets.getAsset(id,"SOUND",useCache);
};
lime_utils_Assets.getBytes = function(id) {
	return lime_utils_Assets.getAsset(id,"BINARY",false);
};
lime_utils_Assets.getFont = function(id,useCache) {
	if(useCache == null) {
		useCache = true;
	}
	return lime_utils_Assets.getAsset(id,"FONT",useCache);
};
lime_utils_Assets.getImage = function(id,useCache) {
	if(useCache == null) {
		useCache = true;
	}
	return lime_utils_Assets.getAsset(id,"IMAGE",useCache);
};
lime_utils_Assets.getLibrary = function(name) {
	if(name == null || name == "") {
		name = "default";
	}
	return lime_utils_Assets.libraries.h[name];
};
lime_utils_Assets.getPath = function(id) {
	var id1 = id;
	var colonIndex = id1.indexOf(":");
	var symbol_libraryName = id1.substring(0,colonIndex);
	var symbol_symbolName = id1.substring(colonIndex + 1);
	var symbol_library = lime_utils_Assets.getLibrary(symbol_libraryName);
	if(symbol_library != null) {
		if(symbol_library.exists(symbol_symbolName,null)) {
			return symbol_library.getPath(symbol_symbolName);
		} else {
			lime_utils_Log.error("There is no asset with an ID of \"" + id + "\"",{ fileName : "lime/utils/Assets.hx", lineNumber : 240, className : "lime.utils.Assets", methodName : "getPath"});
		}
	} else {
		lime_utils_Log.error(lime_utils_Assets.__libraryNotFound(symbol_libraryName),{ fileName : "lime/utils/Assets.hx", lineNumber : 245, className : "lime.utils.Assets", methodName : "getPath"});
	}
	return null;
};
lime_utils_Assets.getText = function(id) {
	return lime_utils_Assets.getAsset(id,"TEXT",false);
};
lime_utils_Assets.hasLibrary = function(name) {
	if(name == null || name == "") {
		name = "default";
	}
	return Object.prototype.hasOwnProperty.call(lime_utils_Assets.libraries.h,name);
};
lime_utils_Assets.isLocal = function(id,type,useCache) {
	if(useCache == null) {
		useCache = true;
	}
	if(useCache && lime_utils_Assets.cache.enabled) {
		if(lime_utils_Assets.cache.exists(id,type)) {
			return true;
		}
	}
	var id1 = id;
	var colonIndex = id1.indexOf(":");
	var symbol_libraryName = id1.substring(0,colonIndex);
	var symbol_symbolName = id1.substring(colonIndex + 1);
	var symbol_library = lime_utils_Assets.getLibrary(symbol_libraryName);
	if(symbol_library != null) {
		return symbol_library.isLocal(symbol_symbolName,type);
	} else {
		return false;
	}
};
lime_utils_Assets.isValidAudio = function(buffer) {
	return buffer != null;
};
lime_utils_Assets.isValidImage = function(image) {
	if(image != null) {
		return image.buffer != null;
	} else {
		return false;
	}
};
lime_utils_Assets.list = function(type) {
	var items = [];
	var h = lime_utils_Assets.libraries.h;
	var library_h = h;
	var library_keys = Object.keys(h);
	var library_length = library_keys.length;
	var library_current = 0;
	while(library_current < library_length) {
		var library = library_h[library_keys[library_current++]];
		var libraryItems = library.list(type);
		if(libraryItems != null) {
			items = items.concat(libraryItems);
		}
	}
	return items;
};
lime_utils_Assets.loadAsset = function(id,type,useCache) {
	if(useCache && lime_utils_Assets.cache.enabled) {
		switch(type) {
		case "FONT":
			var font = lime_utils_Assets.cache.font.h[id];
			if(font != null) {
				return lime_app_Future.withValue(font);
			}
			break;
		case "IMAGE":
			var image = lime_utils_Assets.cache.image.h[id];
			if(lime_utils_Assets.isValidImage(image)) {
				return lime_app_Future.withValue(image);
			}
			break;
		case "MUSIC":case "SOUND":
			var audio = lime_utils_Assets.cache.audio.h[id];
			if(lime_utils_Assets.isValidAudio(audio)) {
				return lime_app_Future.withValue(audio);
			}
			break;
		case "TEMPLATE":
			throw haxe_Exception.thrown("Not sure how to get template: " + id);
		case "BINARY":case "TEXT":
			useCache = false;
			break;
		default:
			return null;
		}
	}
	var id1 = id;
	var colonIndex = id1.indexOf(":");
	var symbol_libraryName = id1.substring(0,colonIndex);
	var symbol_symbolName = id1.substring(colonIndex + 1);
	var symbol_library = lime_utils_Assets.getLibrary(symbol_libraryName);
	if(symbol_library != null) {
		if(symbol_library.exists(symbol_symbolName,type)) {
			var future = symbol_library.loadAsset(symbol_symbolName,type);
			if(useCache && lime_utils_Assets.cache.enabled) {
				future.onComplete(function(asset) {
					lime_utils_Assets.cache.set(id,type,asset);
				});
			}
			return future;
		} else {
			return lime_app_Future.withError("There is no " + type + " asset with an ID of \"" + id + "\"");
		}
	} else {
		return lime_app_Future.withError(lime_utils_Assets.__libraryNotFound(symbol_libraryName));
	}
};
lime_utils_Assets.loadAudioBuffer = function(id,useCache) {
	if(useCache == null) {
		useCache = true;
	}
	return lime_utils_Assets.loadAsset(id,"SOUND",useCache);
};
lime_utils_Assets.loadBytes = function(id) {
	return lime_utils_Assets.loadAsset(id,"BINARY",false);
};
lime_utils_Assets.loadFont = function(id,useCache) {
	if(useCache == null) {
		useCache = true;
	}
	return lime_utils_Assets.loadAsset(id,"FONT",useCache);
};
lime_utils_Assets.loadImage = function(id,useCache) {
	if(useCache == null) {
		useCache = true;
	}
	return lime_utils_Assets.loadAsset(id,"IMAGE",useCache);
};
lime_utils_Assets.loadLibrary = function(id) {
	var promise = new lime_app_Promise();
	var library = lime_utils_Assets.getLibrary(id);
	if(library != null) {
		return library.load();
	}
	var path = id;
	var rootPath = null;
	if(Object.prototype.hasOwnProperty.call(lime_utils_Assets.bundlePaths.h,id)) {
		lime_utils_AssetBundle.loadFromFile(lime_utils_Assets.bundlePaths.h[id]).onComplete(function(bundle) {
			if(bundle == null) {
				promise.error("Cannot load bundle for library \"" + id + "\"");
				return;
			}
			var library = lime_utils_AssetLibrary.fromBundle(bundle);
			if(library == null) {
				promise.error("Cannot open library \"" + id + "\"");
			} else {
				lime_utils_Assets.libraries.h[id] = library;
				library.onChange.add(($_=lime_utils_Assets.onChange,$bind($_,$_.dispatch)));
				promise.completeWith(library.load());
			}
		}).onError(function(_) {
			promise.error("There is no asset library with an ID of \"" + id + "\"");
		});
	} else {
		if(Object.prototype.hasOwnProperty.call(lime_utils_Assets.libraryPaths.h,id)) {
			path = lime_utils_Assets.libraryPaths.h[id];
			rootPath = haxe_io_Path.directory(path);
		} else {
			if(StringTools.endsWith(path,".bundle")) {
				rootPath = path;
				path += "/library.json";
			} else {
				rootPath = haxe_io_Path.directory(path);
			}
			path = lime_utils_Assets.__cacheBreak(path);
		}
		lime_utils_AssetManifest.loadFromFile(path,rootPath).onComplete(function(manifest) {
			if(manifest == null) {
				promise.error("Cannot parse asset manifest for library \"" + id + "\"");
				return;
			}
			var library = lime_utils_AssetLibrary.fromManifest(manifest);
			if(library == null) {
				promise.error("Cannot open library \"" + id + "\"");
			} else {
				lime_utils_Assets.libraries.h[id] = library;
				library.onChange.add(($_=lime_utils_Assets.onChange,$bind($_,$_.dispatch)));
				promise.completeWith(library.load());
			}
		}).onError(function(_) {
			promise.error("There is no asset library with an ID of \"" + id + "\"");
		});
	}
	return promise.future;
};
lime_utils_Assets.loadText = function(id) {
	return lime_utils_Assets.loadAsset(id,"TEXT",false);
};
lime_utils_Assets.registerLibrary = function(name,library) {
	if(name == null || name == "") {
		name = "default";
	}
	if(Object.prototype.hasOwnProperty.call(lime_utils_Assets.libraries.h,name)) {
		if(lime_utils_Assets.libraries.h[name] == library) {
			return;
		} else {
			lime_utils_Assets.unloadLibrary(name);
		}
	}
	if(library != null) {
		library.onChange.add(lime_utils_Assets.library_onChange);
	}
	lime_utils_Assets.libraries.h[name] = library;
};
lime_utils_Assets.unloadLibrary = function(name) {
	lime_utils_Assets.removeLibrary(name,true);
};
lime_utils_Assets.removeLibrary = function(name,unload) {
	if(unload == null) {
		unload = true;
	}
	if(name == null || name == "") {
		name = "default";
	}
	var library = lime_utils_Assets.libraries.h[name];
	if(library != null) {
		lime_utils_Assets.cache.clear(name + ":");
		library.onChange.remove(lime_utils_Assets.library_onChange);
		if(unload) {
			library.unload();
		}
	}
	var _this = lime_utils_Assets.libraries;
	if(Object.prototype.hasOwnProperty.call(_this.h,name)) {
		delete(_this.h[name]);
	}
};
lime_utils_Assets.__cacheBreak = function(path) {
	if(lime_utils_Assets.cache.version > 0) {
		if(path.indexOf("?") > -1) {
			path += "&" + lime_utils_Assets.cache.version;
		} else {
			path += "?" + lime_utils_Assets.cache.version;
		}
	}
	return path;
};
lime_utils_Assets.__libraryNotFound = function(name) {
	if(name == null || name == "") {
		name = "default";
	}
	if(lime_app_Application.current != null && lime_app_Application.current.__preloader != null && !lime_app_Application.current.__preloader.complete) {
		return "There is no asset library named \"" + name + "\", or it is not yet preloaded";
	} else {
		return "There is no asset library named \"" + name + "\"";
	}
};
lime_utils_Assets.library_onChange = function() {
	lime_utils_Assets.cache.clear();
	lime_utils_Assets.onChange.dispatch();
};
var lime_utils__$Assets_LibrarySymbol = function(id) {
	var colonIndex = id.indexOf(":");
	this.libraryName = id.substring(0,colonIndex);
	this.symbolName = id.substring(colonIndex + 1);
	this.library = lime_utils_Assets.getLibrary(this.libraryName);
};
$hxClasses["lime.utils._Assets.LibrarySymbol"] = lime_utils__$Assets_LibrarySymbol;
lime_utils__$Assets_LibrarySymbol.__name__ = "lime.utils._Assets.LibrarySymbol";
lime_utils__$Assets_LibrarySymbol.prototype = {
	library: null
	,libraryName: null
	,symbolName: null
	,isLocal: function(type) {
		return this.library.isLocal(this.symbolName,type);
	}
	,exists: function(type) {
		return this.library.exists(this.symbolName,type);
	}
	,__class__: lime_utils__$Assets_LibrarySymbol
};
var lime_utils_BytePointer = {};
lime_utils_BytePointer._new = function(bytes,offset) {
	if(offset == null) {
		offset = 0;
	}
	return new lime_utils_BytePointerData(bytes,offset);
};
lime_utils_BytePointer.set = function(this1,bytes,bufferView,buffer,offset) {
	if(buffer != null) {
		bytes = haxe_io_Bytes.ofData(buffer);
	}
	if(bytes != null || bufferView == null) {
		this1.bytes = bytes;
		this1.offset = offset != null ? offset : 0;
	} else {
		this1.bytes = haxe_io_Bytes.ofData(bufferView.buffer);
		this1.offset = offset != null ? bufferView.byteOffset + offset : bufferView.byteOffset;
	}
};
lime_utils_BytePointer.__arrayGet = function(this1,index) {
	if(this1.bytes != null) {
		return this1.bytes.b[index + this1.offset];
	} else {
		return 0;
	}
};
lime_utils_BytePointer.__arraySet = function(this1,index,value) {
	if(this1.bytes == null) {
		this1.bytes.b[index + this1.offset] = value;
	}
	return value;
};
lime_utils_BytePointer.fromArrayBufferView = function(arrayBufferView) {
	if(arrayBufferView == null) {
		return null;
	}
	return new lime_utils_BytePointerData(haxe_io_Bytes.ofData(arrayBufferView.buffer),arrayBufferView.byteOffset);
};
lime_utils_BytePointer.fromArrayBuffer = function(buffer) {
	if(buffer == null) {
		return null;
	}
	return new lime_utils_BytePointerData(haxe_io_Bytes.ofData(buffer),0);
};
lime_utils_BytePointer.fromBytes = function(bytes) {
	return new lime_utils_BytePointerData(bytes,0);
};
lime_utils_BytePointer.fromBytesData = function(bytesData) {
	if(bytesData == null) {
		return new lime_utils_BytePointerData(null,0);
	} else {
		return new lime_utils_BytePointerData(haxe_io_Bytes.ofData(bytesData),0);
	}
};
lime_utils_BytePointer.fromFile = function(path) {
	return new lime_utils_BytePointerData(lime_utils_Bytes.fromFile(path),0);
};
lime_utils_BytePointer.fromLimeBytes = function(bytes) {
	return new lime_utils_BytePointerData(bytes,0);
};
lime_utils_BytePointer.toUInt8Array = function(bytePointer) {
	var elements = null;
	var array = null;
	var vector = null;
	var view = null;
	var buffer = bytePointer.bytes.b.bufferValue;
	var byteoffset = bytePointer.offset / 8 | 0;
	var len = null;
	if(byteoffset == null) {
		byteoffset = 0;
	}
	var this1;
	if(elements != null) {
		this1 = new Uint8Array(elements);
	} else if(array != null) {
		this1 = new Uint8Array(array);
	} else if(vector != null) {
		this1 = new Uint8Array(vector.__array);
	} else if(view != null) {
		this1 = new Uint8Array(view);
	} else if(buffer != null) {
		if(len == null) {
			this1 = new Uint8Array(buffer,byteoffset);
		} else {
			this1 = new Uint8Array(buffer,byteoffset,len);
		}
	} else {
		this1 = null;
	}
	return this1;
};
lime_utils_BytePointer.toUInt8ClampedArray = function(bytePointer) {
	if(bytePointer == null || bytePointer.bytes == null) {
		return null;
	}
	var elements = null;
	var array = null;
	var vector = null;
	var view = null;
	var buffer = bytePointer.bytes.b.bufferValue;
	var byteoffset = bytePointer.offset / 8 | 0;
	var len = null;
	if(byteoffset == null) {
		byteoffset = 0;
	}
	var this1;
	if(elements != null) {
		this1 = new Uint8ClampedArray(elements);
	} else if(array != null) {
		this1 = new Uint8ClampedArray(array);
	} else if(vector != null) {
		this1 = new Uint8ClampedArray(vector.__array);
	} else if(view != null) {
		this1 = new Uint8ClampedArray(view);
	} else if(buffer != null) {
		if(len == null) {
			this1 = new Uint8ClampedArray(buffer,byteoffset);
		} else {
			this1 = new Uint8ClampedArray(buffer,byteoffset,len);
		}
	} else {
		this1 = null;
	}
	return this1;
};
lime_utils_BytePointer.toInt8Array = function(bytePointer) {
	if(bytePointer == null || bytePointer.bytes == null) {
		return null;
	}
	var elements = null;
	var array = null;
	var vector = null;
	var view = null;
	var buffer = bytePointer.bytes.b.bufferValue;
	var byteoffset = bytePointer.offset / 8 | 0;
	var len = null;
	if(byteoffset == null) {
		byteoffset = 0;
	}
	var this1;
	if(elements != null) {
		this1 = new Int8Array(elements);
	} else if(array != null) {
		this1 = new Int8Array(array);
	} else if(vector != null) {
		this1 = new Int8Array(vector.__array);
	} else if(view != null) {
		this1 = new Int8Array(view);
	} else if(buffer != null) {
		if(len == null) {
			this1 = new Int8Array(buffer,byteoffset);
		} else {
			this1 = new Int8Array(buffer,byteoffset,len);
		}
	} else {
		this1 = null;
	}
	return this1;
};
lime_utils_BytePointer.toUInt16Array = function(bytePointer) {
	if(bytePointer == null || bytePointer.bytes == null) {
		return null;
	}
	var elements = null;
	var array = null;
	var vector = null;
	var view = null;
	var buffer = bytePointer.bytes.b.bufferValue;
	var byteoffset = bytePointer.offset / 16 | 0;
	var len = null;
	if(byteoffset == null) {
		byteoffset = 0;
	}
	var this1;
	if(elements != null) {
		this1 = new Uint16Array(elements);
	} else if(array != null) {
		this1 = new Uint16Array(array);
	} else if(vector != null) {
		this1 = new Uint16Array(vector.__array);
	} else if(view != null) {
		this1 = new Uint16Array(view);
	} else if(buffer != null) {
		if(len == null) {
			this1 = new Uint16Array(buffer,byteoffset);
		} else {
			this1 = new Uint16Array(buffer,byteoffset,len);
		}
	} else {
		this1 = null;
	}
	return this1;
};
lime_utils_BytePointer.toInt16Array = function(bytePointer) {
	if(bytePointer == null || bytePointer.bytes == null) {
		return null;
	}
	var elements = null;
	var array = null;
	var vector = null;
	var view = null;
	var buffer = bytePointer.bytes.b.bufferValue;
	var byteoffset = bytePointer.offset / 16 | 0;
	var len = null;
	if(byteoffset == null) {
		byteoffset = 0;
	}
	var this1;
	if(elements != null) {
		this1 = new Int16Array(elements);
	} else if(array != null) {
		this1 = new Int16Array(array);
	} else if(vector != null) {
		this1 = new Int16Array(vector.__array);
	} else if(view != null) {
		this1 = new Int16Array(view);
	} else if(buffer != null) {
		if(len == null) {
			this1 = new Int16Array(buffer,byteoffset);
		} else {
			this1 = new Int16Array(buffer,byteoffset,len);
		}
	} else {
		this1 = null;
	}
	return this1;
};
lime_utils_BytePointer.toUInt32Array = function(bytePointer) {
	if(bytePointer == null || bytePointer.bytes == null) {
		return null;
	}
	var elements = null;
	var array = null;
	var vector = null;
	var view = null;
	var buffer = bytePointer.bytes.b.bufferValue;
	var byteoffset = bytePointer.offset / 32 | 0;
	var len = null;
	if(byteoffset == null) {
		byteoffset = 0;
	}
	var this1;
	if(elements != null) {
		this1 = new Uint32Array(elements);
	} else if(array != null) {
		this1 = new Uint32Array(array);
	} else if(vector != null) {
		this1 = new Uint32Array(vector.__array);
	} else if(view != null) {
		this1 = new Uint32Array(view);
	} else if(buffer != null) {
		if(len == null) {
			this1 = new Uint32Array(buffer,byteoffset);
		} else {
			this1 = new Uint32Array(buffer,byteoffset,len);
		}
	} else {
		this1 = null;
	}
	return this1;
};
lime_utils_BytePointer.toInt32Array = function(bytePointer) {
	if(bytePointer == null || bytePointer.bytes == null) {
		return null;
	}
	var elements = null;
	var array = null;
	var vector = null;
	var view = null;
	var buffer = bytePointer.bytes.b.bufferValue;
	var byteoffset = bytePointer.offset / 32 | 0;
	var len = null;
	if(byteoffset == null) {
		byteoffset = 0;
	}
	var this1;
	if(elements != null) {
		this1 = new Int32Array(elements);
	} else if(array != null) {
		this1 = new Int32Array(array);
	} else if(vector != null) {
		this1 = new Int32Array(vector.__array);
	} else if(view != null) {
		this1 = new Int32Array(view);
	} else if(buffer != null) {
		if(len == null) {
			this1 = new Int32Array(buffer,byteoffset);
		} else {
			this1 = new Int32Array(buffer,byteoffset,len);
		}
	} else {
		this1 = null;
	}
	return this1;
};
lime_utils_BytePointer.toFloat32Array = function(bytePointer) {
	if(bytePointer == null || bytePointer.bytes == null) {
		return null;
	}
	var elements = null;
	var array = null;
	var vector = null;
	var view = null;
	var buffer = bytePointer.bytes.b.bufferValue;
	var byteoffset = bytePointer.offset / 32 | 0;
	var len = null;
	if(byteoffset == null) {
		byteoffset = 0;
	}
	var this1;
	if(elements != null) {
		this1 = new Float32Array(elements);
	} else if(array != null) {
		this1 = new Float32Array(array);
	} else if(vector != null) {
		this1 = new Float32Array(vector.__array);
	} else if(view != null) {
		this1 = new Float32Array(view);
	} else if(buffer != null) {
		if(len == null) {
			this1 = new Float32Array(buffer,byteoffset);
		} else {
			this1 = new Float32Array(buffer,byteoffset,len);
		}
	} else {
		this1 = null;
	}
	return this1;
};
lime_utils_BytePointer.toFloat64Array = function(bytePointer) {
	if(bytePointer == null || bytePointer.bytes == null) {
		return null;
	}
	var elements = null;
	var array = null;
	var vector = null;
	var view = null;
	var buffer = bytePointer.bytes.b.bufferValue;
	var byteoffset = bytePointer.offset / 64 | 0;
	var len = null;
	if(byteoffset == null) {
		byteoffset = 0;
	}
	var this1;
	if(elements != null) {
		this1 = new Float64Array(elements);
	} else if(array != null) {
		this1 = new Float64Array(array);
	} else if(vector != null) {
		this1 = new Float64Array(vector.__array);
	} else if(view != null) {
		this1 = new Float64Array(view);
	} else if(buffer != null) {
		if(len == null) {
			this1 = new Float64Array(buffer,byteoffset);
		} else {
			this1 = new Float64Array(buffer,byteoffset,len);
		}
	} else {
		this1 = null;
	}
	return this1;
};
var lime_utils_BytePointerData = function(bytes,offset) {
	this.bytes = bytes;
	this.offset = offset;
};
$hxClasses["lime.utils.BytePointerData"] = lime_utils_BytePointerData;
lime_utils_BytePointerData.__name__ = "lime.utils.BytePointerData";
lime_utils_BytePointerData.prototype = {
	bytes: null
	,offset: null
	,__class__: lime_utils_BytePointerData
};
var lime_utils_Bytes = {};
lime_utils_Bytes._new = function(length,bytesData) {
	var this1 = new haxe_io_Bytes(bytesData);
	this1.length = length;
	return this1;
};
lime_utils_Bytes.alloc = function(length) {
	return new haxe_io_Bytes(new ArrayBuffer(length));
};
lime_utils_Bytes.compress = function(this1,algorithm) {
	switch(algorithm._hx_index) {
	case 0:
		return lime__$internal_format_Deflate.compress(this1);
	case 1:
		return lime__$internal_format_GZip.compress(this1);
	case 2:
		return lime__$internal_format_LZMA.compress(this1);
	case 3:
		return lime__$internal_format_Zlib.compress(this1);
	}
};
lime_utils_Bytes.decompress = function(this1,algorithm) {
	switch(algorithm._hx_index) {
	case 0:
		return lime__$internal_format_Deflate.decompress(this1);
	case 1:
		return lime__$internal_format_GZip.decompress(this1);
	case 2:
		return lime__$internal_format_LZMA.decompress(this1);
	case 3:
		return lime__$internal_format_Zlib.decompress(this1);
	}
};
lime_utils_Bytes.fastGet = function(b,pos) {
	return b.bytes[pos];
};
lime_utils_Bytes.fromBytes = function(bytes) {
	if(bytes == null) {
		return null;
	}
	return lime_utils_Bytes._new(bytes.length,bytes.b.bufferValue);
};
lime_utils_Bytes.fromFile = function(path) {
	return null;
};
lime_utils_Bytes.loadFromBytes = function(bytes) {
	return lime_app_Future.withValue(lime_utils_Bytes.fromBytes(bytes));
};
lime_utils_Bytes.loadFromFile = function(path) {
	var request = new lime_net__$HTTPRequest_$lime_$utils_$Bytes();
	return request.load(path);
};
lime_utils_Bytes.ofData = function(b) {
	var bytes = haxe_io_Bytes.ofData(b);
	return lime_utils_Bytes._new(bytes.length,bytes.b.bufferValue);
};
lime_utils_Bytes.ofString = function(s) {
	var bytes = haxe_io_Bytes.ofString(s);
	return lime_utils_Bytes._new(bytes.length,bytes.b.bufferValue);
};
var lime_utils_CompressionAlgorithm = $hxEnums["lime.utils.CompressionAlgorithm"] = { __ename__:"lime.utils.CompressionAlgorithm",__constructs__:null
	,DEFLATE: {_hx_name:"DEFLATE",_hx_index:0,__enum__:"lime.utils.CompressionAlgorithm",toString:$estr}
	,GZIP: {_hx_name:"GZIP",_hx_index:1,__enum__:"lime.utils.CompressionAlgorithm",toString:$estr}
	,LZMA: {_hx_name:"LZMA",_hx_index:2,__enum__:"lime.utils.CompressionAlgorithm",toString:$estr}
	,ZLIB: {_hx_name:"ZLIB",_hx_index:3,__enum__:"lime.utils.CompressionAlgorithm",toString:$estr}
};
lime_utils_CompressionAlgorithm.__constructs__ = [lime_utils_CompressionAlgorithm.DEFLATE,lime_utils_CompressionAlgorithm.GZIP,lime_utils_CompressionAlgorithm.LZMA,lime_utils_CompressionAlgorithm.ZLIB];
var lime_utils_DataPointer = {};
lime_utils_DataPointer._new = function(data) {
	return data;
};
lime_utils_DataPointer.fromFloat = function(value) {
	return value;
};
lime_utils_DataPointer.fromBytesPointer = function(pointer) {
	return lime_utils_DataPointer.fromFloat(0);
};
lime_utils_DataPointer.fromArrayBufferView = function(arrayBufferView) {
	return lime_utils_DataPointer.fromFloat(0);
};
lime_utils_DataPointer.fromArrayBuffer = function(buffer) {
	return lime_utils_DataPointer.fromFloat(0);
};
lime_utils_DataPointer.fromBytes = function(bytes) {
	return lime_utils_DataPointer.fromFloat(0);
};
lime_utils_DataPointer.fromBytesData = function(bytesData) {
	return lime_utils_DataPointer.fromFloat(0);
};
lime_utils_DataPointer.fromLimeBytes = function(bytes) {
	return lime_utils_DataPointer.fromBytes(bytes);
};
lime_utils_DataPointer.fromCFFIPointer = function(pointer) {
	return lime_utils_DataPointer.fromFloat(0);
};
lime_utils_DataPointer.fromFile = function(path) {
	return lime_utils_DataPointer.fromFloat(0);
};
lime_utils_DataPointer.__withOffset = function(data,offset) {
	return lime_utils_DataPointer.fromFloat(0);
};
lime_utils_DataPointer.equals = function(a,b) {
	return a == b;
};
lime_utils_DataPointer.equalsPointer = function(a,b) {
	return a == b;
};
lime_utils_DataPointer.greaterThan = function(a,b) {
	return a > b;
};
lime_utils_DataPointer.greaterThanPointer = function(a,b) {
	return lime_system_CFFIPointer.get(a) > lime_system_CFFIPointer.get(b);
};
lime_utils_DataPointer.greaterThanOrEqual = function(a,b) {
	return a >= b;
};
lime_utils_DataPointer.greaterThanOrEqualPointer = function(a,b) {
	return lime_system_CFFIPointer.get(a) >= lime_system_CFFIPointer.get(b);
};
lime_utils_DataPointer.lessThan = function(a,b) {
	return a < b;
};
lime_utils_DataPointer.lessThanPointer = function(a,b) {
	return lime_system_CFFIPointer.get(a) < lime_system_CFFIPointer.get(b);
};
lime_utils_DataPointer.lessThanOrEqual = function(a,b) {
	return a <= b;
};
lime_utils_DataPointer.lessThanOrEqualPointer = function(a,b) {
	return lime_system_CFFIPointer.get(a) <= lime_system_CFFIPointer.get(b);
};
lime_utils_DataPointer.notEquals = function(a,b) {
	return a != b;
};
lime_utils_DataPointer.notEqualsPointer = function(a,b) {
	return a != b;
};
lime_utils_DataPointer.plus = function(a,b) {
	return lime_utils_DataPointer.__withOffset(a,b);
};
lime_utils_DataPointer.plusPointer = function(a,b) {
	return lime_utils_DataPointer.__withOffset(a,b | 0);
};
lime_utils_DataPointer.minus = function(a,b) {
	return lime_utils_DataPointer.__withOffset(a,-b);
};
lime_utils_DataPointer.minusPointer = function(a,b) {
	return lime_utils_DataPointer.__withOffset(a,-(b | 0));
};
var lime_utils_Float32Array = {};
lime_utils_Float32Array.toArrayBufferView = function(this1) {
	return this1;
};
lime_utils_Float32Array.fromBytes = function(bytes,byteOffset,len) {
	if(byteOffset == null) {
		byteOffset = 0;
	}
	if(byteOffset == null) {
		return new Float32Array(bytes.b.bufferValue);
	}
	if(len == null) {
		return new Float32Array(bytes.b.bufferValue,byteOffset);
	}
	return new Float32Array(bytes.b.bufferValue,byteOffset,len);
};
lime_utils_Float32Array.toBytes = function(this1) {
	return new haxe_io_Bytes(new Uint8Array(this1.buffer));
};
lime_utils_Float32Array.toString = function(this1) {
	if(this1 != null) {
		return "Float32Array [byteLength:" + this1.byteLength + ", length:" + this1.length + "]";
	} else {
		return null;
	}
};
var lime_utils_Float64Array = {};
lime_utils_Float64Array.toArrayBufferView = function(this1) {
	return this1;
};
lime_utils_Float64Array.fromBytes = function(bytes,byteOffset,len) {
	if(byteOffset == null) {
		byteOffset = 0;
	}
	if(byteOffset == null) {
		return new Float64Array(bytes.b.bufferValue);
	}
	if(len == null) {
		return new Float64Array(bytes.b.bufferValue,byteOffset);
	}
	return new Float64Array(bytes.b.bufferValue,byteOffset,len);
};
lime_utils_Float64Array.toBytes = function(this1) {
	return new haxe_io_Bytes(new Uint8Array(this1.buffer));
};
lime_utils_Float64Array.toString = function(this1) {
	if(this1 != null) {
		return "Float64Array [byteLength:" + this1.byteLength + ", length:" + this1.length + "]";
	} else {
		return null;
	}
};
var lime_utils_Int16Array = {};
lime_utils_Int16Array.toArrayBufferView = function(this1) {
	return this1;
};
lime_utils_Int16Array.fromBytes = function(bytes,byteOffset,len) {
	if(byteOffset == null) {
		byteOffset = 0;
	}
	if(byteOffset == null) {
		return new Int16Array(bytes.b.bufferValue);
	}
	if(len == null) {
		return new Int16Array(bytes.b.bufferValue,byteOffset);
	}
	return new Int16Array(bytes.b.bufferValue,byteOffset,len);
};
lime_utils_Int16Array.toBytes = function(this1) {
	return new haxe_io_Bytes(new Uint8Array(this1.buffer));
};
lime_utils_Int16Array.toString = function(this1) {
	if(this1 != null) {
		return "Int16Array [byteLength:" + this1.byteLength + ", length:" + this1.length + "]";
	} else {
		return null;
	}
};
var lime_utils_Int32Array = {};
lime_utils_Int32Array.toArrayBufferView = function(this1) {
	return this1;
};
lime_utils_Int32Array.fromBytes = function(bytes,byteOffset,len) {
	if(byteOffset == null) {
		byteOffset = 0;
	}
	if(byteOffset == null) {
		return new Int32Array(bytes.b.bufferValue);
	}
	if(len == null) {
		return new Int32Array(bytes.b.bufferValue,byteOffset);
	}
	return new Int32Array(bytes.b.bufferValue,byteOffset,len);
};
lime_utils_Int32Array.toBytes = function(this1) {
	return new haxe_io_Bytes(new Uint8Array(this1.buffer));
};
lime_utils_Int32Array.toString = function(this1) {
	if(this1 != null) {
		return "Int32Array [byteLength:" + this1.byteLength + ", length:" + this1.length + "]";
	} else {
		return null;
	}
};
var lime_utils_Int8Array = {};
lime_utils_Int8Array.toArrayBufferView = function(this1) {
	return this1;
};
lime_utils_Int8Array.fromBytes = function(bytes,byteOffset,len) {
	if(byteOffset == null) {
		byteOffset = 0;
	}
	return new Int8Array(bytes.b.bufferValue,byteOffset,len);
};
lime_utils_Int8Array.toBytes = function(this1) {
	return new haxe_io_Bytes(new Uint8Array(this1.buffer));
};
lime_utils_Int8Array.toString = function(this1) {
	if(this1 != null) {
		return "Int8Array [byteLength:" + this1.byteLength + ", length:" + this1.length + "]";
	} else {
		return null;
	}
};
var lime_utils_Log = function() { };
$hxClasses["lime.utils.Log"] = lime_utils_Log;
lime_utils_Log.__name__ = "lime.utils.Log";
lime_utils_Log.debug = function(message,info) {
	if(lime_utils_Log.level >= 4) {
		console.debug("[" + info.className + "] " + Std.string(message));
	}
};
lime_utils_Log.error = function(message,info) {
	if(lime_utils_Log.level >= 1) {
		var message1 = "[" + info.className + "] ERROR: " + Std.string(message);
		if(lime_utils_Log.throwErrors) {
			throw haxe_Exception.thrown(message1);
		} else {
			console.error(message1);
		}
	}
};
lime_utils_Log.info = function(message,info) {
	if(lime_utils_Log.level >= 3) {
		console.info("[" + info.className + "] " + Std.string(message));
	}
};
lime_utils_Log.print = function(message) {
	console.log(message);
};
lime_utils_Log.println = function(message) {
	console.log(message);
};
lime_utils_Log.verbose = function(message,info) {
	if(lime_utils_Log.level >= 5) {
		var message1 = "[" + info.className + "] " + Std.string(message);
		console.log(message1);
	}
};
lime_utils_Log.warn = function(message,info) {
	if(lime_utils_Log.level >= 2) {
		console.warn("[" + info.className + "] WARNING: " + Std.string(message));
	}
};
var lime_utils_LogLevel = {};
lime_utils_LogLevel.gt = function(a,b) {
	return a > b;
};
lime_utils_LogLevel.gte = function(a,b) {
	return a >= b;
};
lime_utils_LogLevel.lt = function(a,b) {
	return a < b;
};
lime_utils_LogLevel.lte = function(a,b) {
	return a <= b;
};
var lime_utils_Preloader = function() {
	this.bytesTotalCache = new haxe_ds_StringMap();
	this.bytesLoadedCache2 = new haxe_ds_StringMap();
	this.bytesLoadedCache = new haxe_ds_ObjectMap();
	this.onProgress = new lime_app__$Event_$Int_$Int_$Void();
	this.onComplete = new lime_app__$Event_$Void_$Void();
	this.bytesLoaded = 0;
	this.bytesTotal = 0;
	this.libraries = [];
	this.libraryNames = [];
	this.onProgress.add($bind(this,this.update));
};
$hxClasses["lime.utils.Preloader"] = lime_utils_Preloader;
lime_utils_Preloader.__name__ = "lime.utils.Preloader";
lime_utils_Preloader.prototype = {
	complete: null
	,onComplete: null
	,onProgress: null
	,bytesLoaded: null
	,bytesLoadedCache: null
	,bytesLoadedCache2: null
	,bytesTotal: null
	,bytesTotalCache: null
	,initLibraryNames: null
	,libraries: null
	,libraryNames: null
	,loadedLibraries: null
	,loadedStage: null
	,preloadComplete: null
	,preloadStarted: null
	,simulateProgress: null
	,addLibrary: function(library) {
		this.libraries.push(library);
	}
	,addLibraryName: function(name) {
		if(this.libraryNames.indexOf(name) == -1) {
			this.libraryNames.push(name);
		}
	}
	,load: function() {
		var _gthis = this;
		var _g = 0;
		var _g1 = this.libraries;
		while(_g < _g1.length) {
			var library = _g1[_g];
			++_g;
			this.bytesTotal += library.bytesTotal;
		}
		this.loadedLibraries = -1;
		this.preloadStarted = false;
		var _g = 0;
		var _g1 = this.libraries;
		while(_g < _g1.length) {
			var library = [_g1[_g]];
			++_g;
			lime_utils_Log.verbose("Preloading asset library",{ fileName : "lime/utils/Preloader.hx", lineNumber : 134, className : "lime.utils.Preloader", methodName : "load"});
			library[0].load().onProgress((function(library) {
				return function(loaded,total) {
					if(_gthis.bytesLoadedCache.h.__keys__[library[0].__id__] == null) {
						_gthis.bytesLoaded += loaded;
					} else {
						_gthis.bytesLoaded += loaded - _gthis.bytesLoadedCache.h[library[0].__id__];
					}
					_gthis.bytesLoadedCache.set(library[0],loaded);
					if(!_gthis.simulateProgress) {
						_gthis.onProgress.dispatch(_gthis.bytesLoaded,_gthis.bytesTotal);
					}
				};
			})(library)).onComplete((function(library) {
				return function(_) {
					if(_gthis.bytesLoadedCache.h.__keys__[library[0].__id__] == null) {
						_gthis.bytesLoaded += library[0].bytesTotal;
					} else {
						_gthis.bytesLoaded += (library[0].bytesTotal | 0) - _gthis.bytesLoadedCache.h[library[0].__id__];
					}
					_gthis.loadedAssetLibrary();
				};
			})(library)).onError((function() {
				return function(e) {
					lime_utils_Log.error(e,{ fileName : "lime/utils/Preloader.hx", lineNumber : 170, className : "lime.utils.Preloader", methodName : "load"});
				};
			})());
		}
		var _g = 0;
		var _g1 = this.libraryNames;
		while(_g < _g1.length) {
			var name = _g1[_g];
			++_g;
			this.bytesTotal += 200;
		}
		this.loadedLibraries++;
		this.preloadStarted = true;
		this.updateProgress();
	}
	,loadedAssetLibrary: function(name) {
		this.loadedLibraries++;
		var current = this.loadedLibraries;
		if(!this.preloadStarted) {
			++current;
		}
		var totalLibraries = this.libraries.length + this.libraryNames.length;
		if(name != null) {
			lime_utils_Log.verbose("Loaded asset library: " + name + " [" + current + "/" + totalLibraries + "]",{ fileName : "lime/utils/Preloader.hx", lineNumber : 197, className : "lime.utils.Preloader", methodName : "loadedAssetLibrary"});
		} else {
			lime_utils_Log.verbose("Loaded asset library [" + current + "/" + totalLibraries + "]",{ fileName : "lime/utils/Preloader.hx", lineNumber : 201, className : "lime.utils.Preloader", methodName : "loadedAssetLibrary"});
		}
		this.updateProgress();
	}
	,start: function() {
		if(this.complete || this.simulateProgress || !this.preloadComplete) {
			return;
		}
		this.complete = true;
		this.onComplete.dispatch();
	}
	,update: function(loaded,total) {
	}
	,updateProgress: function() {
		var _gthis = this;
		if(!this.simulateProgress) {
			this.onProgress.dispatch(this.bytesLoaded,this.bytesTotal);
		}
		if(this.loadedLibraries == this.libraries.length && !this.initLibraryNames) {
			this.initLibraryNames = true;
			var _g = 0;
			var _g1 = this.libraryNames;
			while(_g < _g1.length) {
				var name = [_g1[_g]];
				++_g;
				lime_utils_Log.verbose("Preloading asset library: " + name[0],{ fileName : "lime/utils/Preloader.hx", lineNumber : 239, className : "lime.utils.Preloader", methodName : "updateProgress"});
				lime_utils_Assets.loadLibrary(name[0]).onProgress((function(name) {
					return function(loaded,total) {
						if(total > 0) {
							if(!Object.prototype.hasOwnProperty.call(_gthis.bytesTotalCache.h,name[0])) {
								_gthis.bytesTotalCache.h[name[0]] = total;
								_gthis.bytesTotal += total - 200;
							}
							if(loaded > total) {
								loaded = total;
							}
							if(!Object.prototype.hasOwnProperty.call(_gthis.bytesLoadedCache2.h,name[0])) {
								_gthis.bytesLoaded += loaded;
							} else {
								_gthis.bytesLoaded += loaded - _gthis.bytesLoadedCache2.h[name[0]];
							}
							_gthis.bytesLoadedCache2.h[name[0]] = loaded;
							if(!_gthis.simulateProgress) {
								_gthis.onProgress.dispatch(_gthis.bytesLoaded,_gthis.bytesTotal);
							}
						}
					};
				})(name)).onComplete((function(name) {
					return function(library) {
						var total = 200;
						if(Object.prototype.hasOwnProperty.call(_gthis.bytesTotalCache.h,name[0])) {
							total = _gthis.bytesTotalCache.h[name[0]];
						}
						if(!Object.prototype.hasOwnProperty.call(_gthis.bytesLoadedCache2.h,name[0])) {
							_gthis.bytesLoaded += total;
						} else {
							_gthis.bytesLoaded += total - _gthis.bytesLoadedCache2.h[name[0]];
						}
						_gthis.loadedAssetLibrary(name[0]);
					};
				})(name)).onError((function() {
					return function(e) {
						lime_utils_Log.error(e,{ fileName : "lime/utils/Preloader.hx", lineNumber : 293, className : "lime.utils.Preloader", methodName : "updateProgress"});
					};
				})());
			}
		}
		if(!this.simulateProgress && this.loadedLibraries == this.libraries.length + this.libraryNames.length) {
			if(!this.preloadComplete) {
				this.preloadComplete = true;
				lime_utils_Log.verbose("Preload complete",{ fileName : "lime/utils/Preloader.hx", lineNumber : 306, className : "lime.utils.Preloader", methodName : "updateProgress"});
			}
			this.start();
		}
	}
	,__class__: lime_utils_Preloader
};
var lime_utils_Resource = {};
lime_utils_Resource._new = function(size) {
	if(size == null) {
		size = 0;
	}
	return new haxe_io_Bytes(new ArrayBuffer(size));
};
lime_utils_Resource.__fromString = function(value) {
	return haxe_io_Bytes.ofString(value);
};
lime_utils_Resource.__toString = function(value) {
	return value.toString();
};
var lime_utils_UInt16Array = {};
lime_utils_UInt16Array.toArrayBufferView = function(this1) {
	return this1;
};
lime_utils_UInt16Array.fromBytes = function(bytes,byteOffset,len) {
	if(byteOffset == null) {
		byteOffset = 0;
	}
	if(byteOffset == null) {
		return new Uint16Array(bytes.b.bufferValue);
	}
	if(len == null) {
		return new Uint16Array(bytes.b.bufferValue,byteOffset);
	}
	return new Uint16Array(bytes.b.bufferValue,byteOffset,len);
};
lime_utils_UInt16Array.toBytes = function(this1) {
	return new haxe_io_Bytes(new Uint8Array(this1.buffer));
};
lime_utils_UInt16Array.toString = function(this1) {
	if(this1 != null) {
		return "UInt16Array [byteLength:" + this1.byteLength + ", length:" + this1.length + "]";
	} else {
		return null;
	}
};
var lime_utils_UInt32Array = {};
lime_utils_UInt32Array.toArrayBufferView = function(this1) {
	return this1;
};
lime_utils_UInt32Array.fromBytes = function(bytes,byteOffset,len) {
	if(byteOffset == null) {
		byteOffset = 0;
	}
	if(byteOffset == null) {
		return new Uint32Array(bytes.b.bufferValue);
	}
	if(len == null) {
		return new Uint32Array(bytes.b.bufferValue,byteOffset);
	}
	return new Uint32Array(bytes.b.bufferValue,byteOffset,len);
};
lime_utils_UInt32Array.toBytes = function(this1) {
	return new haxe_io_Bytes(new Uint8Array(this1.buffer));
};
lime_utils_UInt32Array.toString = function(this1) {
	if(this1 != null) {
		return "UInt32Array [byteLength:" + this1.byteLength + ", length:" + this1.length + "]";
	} else {
		return null;
	}
};
var lime_utils_UInt8Array = {};
lime_utils_UInt8Array.toArrayBufferView = function(this1) {
	return this1;
};
lime_utils_UInt8Array.fromBytes = function(bytes,byteOffset,len) {
	if(byteOffset == null) {
		return new Uint8Array(bytes.b.bufferValue);
	}
	if(len == null) {
		return new Uint8Array(bytes.b.bufferValue,byteOffset);
	}
	return new Uint8Array(bytes.b.bufferValue,byteOffset,len);
};
lime_utils_UInt8Array.toBytes = function(this1) {
	return new haxe_io_Bytes(new Uint8Array(this1.buffer));
};
lime_utils_UInt8Array.toString = function(this1) {
	if(this1 != null) {
		return "UInt8Array [byteLength:" + this1.byteLength + ", length:" + this1.length + "]";
	} else {
		return null;
	}
};
var lime_utils_UInt8ClampedArray = {};
lime_utils_UInt8ClampedArray.toArrayBufferView = function(this1) {
	return this1;
};
lime_utils_UInt8ClampedArray.fromBytes = function(bytes,byteOffset,len) {
	if(byteOffset == null) {
		byteOffset = 0;
	}
	if(byteOffset == null) {
		return new Uint8ClampedArray(bytes.b.bufferValue);
	}
	if(len == null) {
		return new Uint8ClampedArray(bytes.b.bufferValue,byteOffset);
	}
	return new Uint8ClampedArray(bytes.b.bufferValue,byteOffset,len);
};
lime_utils_UInt8ClampedArray.toBytes = function(this1) {
	return new haxe_io_Bytes(new Uint8Array(this1.buffer));
};
lime_utils_UInt8ClampedArray.toString = function(this1) {
	if(this1 != null) {
		return "UInt8ClampedArray [byteLength:" + this1.byteLength + ", length:" + this1.length + "]";
	} else {
		return null;
	}
};
lime_utils_UInt8ClampedArray._clamp = function(_in) {
	var _out = _in | 0;
	if(_out > 255) {
		_out = 255;
	}
	if(_out < 0) {
		return 0;
	} else {
		return _out;
	}
};
var moonshine_editor_text__$TextEditor_TextEditorListView = function() {
	feathers_controls_ListView.call(this);
	this.set_selectable(false);
	this.set_backgroundSkin(null);
	this.set_disabledBackgroundSkin(null);
};
$hxClasses["moonshine.editor.text._TextEditor.TextEditorListView"] = moonshine_editor_text__$TextEditor_TextEditorListView;
moonshine_editor_text__$TextEditor_TextEditorListView.__name__ = "moonshine.editor.text._TextEditor.TextEditorListView";
moonshine_editor_text__$TextEditor_TextEditorListView.__super__ = feathers_controls_ListView;
moonshine_editor_text__$TextEditor_TextEditorListView.prototype = $extend(feathers_controls_ListView.prototype,{
	get_tabEnabled: function() {
		if(this._enabled) {
			return this.get_rawTabEnabled();
		} else {
			return false;
		}
	}
	,__class__: moonshine_editor_text__$TextEditor_TextEditorListView
});
var moonshine_editor_text_TextEditorPosition = function(line,character) {
	if(character == null) {
		character = 0;
	}
	if(line == null) {
		line = 0;
	}
	this.line = line;
	this.character = character;
};
$hxClasses["moonshine.editor.text.TextEditorPosition"] = moonshine_editor_text_TextEditorPosition;
moonshine_editor_text_TextEditorPosition.__name__ = "moonshine.editor.text.TextEditorPosition";
moonshine_editor_text_TextEditorPosition.prototype = {
	line: null
	,character: null
	,__class__: moonshine_editor_text_TextEditorPosition
};
var moonshine_editor_text_TextEditorSearchResult = function(search,backwards,allowWrap,results,replaced) {
	this.didWrap = false;
	this.current = null;
	this.selectedIndex = -1;
	this.search = search;
	this.backwards = backwards;
	this.allowWrap = allowWrap;
	if(results == null) {
		results = [];
	}
	this.results = results;
	if(replaced == null) {
		replaced = [];
	}
	this.replaced = replaced;
};
$hxClasses["moonshine.editor.text.TextEditorSearchResult"] = moonshine_editor_text_TextEditorSearchResult;
moonshine_editor_text_TextEditorSearchResult.__name__ = "moonshine.editor.text.TextEditorSearchResult";
moonshine_editor_text_TextEditorSearchResult.prototype = {
	selectedIndex: null
	,current: null
	,results: null
	,replaced: null
	,didWrap: null
	,search: null
	,backwards: null
	,allowWrap: null
	,__class__: moonshine_editor_text_TextEditorSearchResult
};
var moonshine_editor_text_SearchResultItem = function(index,length,startLine,startChar,endLine,endChar) {
	this.index = index;
	this.length = length;
	this.startLine = startLine;
	this.startChar = startChar;
	this.endLine = endLine;
	this.endChar = endChar;
};
$hxClasses["moonshine.editor.text.SearchResultItem"] = moonshine_editor_text_SearchResultItem;
moonshine_editor_text_SearchResultItem.__name__ = "moonshine.editor.text.SearchResultItem";
moonshine_editor_text_SearchResultItem.prototype = {
	index: null
	,length: null
	,startLine: null
	,startChar: null
	,endLine: null
	,endChar: null
	,__class__: moonshine_editor_text_SearchResultItem
};
var moonshine_editor_text_changes_TextEditorChange = function(startLine,startChar,endLine,endChar,newText) {
	this._startLine = startLine;
	this._startChar = startChar;
	this._endLine = endLine;
	this._endChar = endChar;
	this._newText = newText;
};
$hxClasses["moonshine.editor.text.changes.TextEditorChange"] = moonshine_editor_text_changes_TextEditorChange;
moonshine_editor_text_changes_TextEditorChange.__name__ = "moonshine.editor.text.changes.TextEditorChange";
moonshine_editor_text_changes_TextEditorChange.prototype = {
	_startLine: null
	,get_startLine: function() {
		return this._startLine;
	}
	,_startChar: null
	,get_startChar: function() {
		return this._startChar;
	}
	,_endLine: null
	,get_endLine: function() {
		return this._endLine;
	}
	,_endChar: null
	,get_endChar: function() {
		return this._endChar;
	}
	,_newText: null
	,get_newText: function() {
		return this._newText;
	}
	,__class__: moonshine_editor_text_changes_TextEditorChange
	,__properties__: {get_newText:"get_newText",get_endChar:"get_endChar",get_endLine:"get_endLine",get_startChar:"get_startChar",get_startLine:"get_startLine"}
};
var moonshine_editor_text_events_TextEditorChangeEvent = function(type,changes,origin) {
	openfl_events_Event.call(this,type);
	this.changes = changes;
	this.origin = origin != null ? origin : moonshine_editor_text_events_TextEditorChangeEvent.ORIGIN_LOCAL;
};
$hxClasses["moonshine.editor.text.events.TextEditorChangeEvent"] = moonshine_editor_text_events_TextEditorChangeEvent;
moonshine_editor_text_events_TextEditorChangeEvent.__name__ = "moonshine.editor.text.events.TextEditorChangeEvent";
moonshine_editor_text_events_TextEditorChangeEvent.__super__ = openfl_events_Event;
moonshine_editor_text_events_TextEditorChangeEvent.prototype = $extend(openfl_events_Event.prototype,{
	changes: null
	,origin: null
	,clone: function() {
		return new moonshine_editor_text_events_TextEditorChangeEvent(this.type,this.changes,this.origin);
	}
	,__class__: moonshine_editor_text_events_TextEditorChangeEvent
});
var moonshine_editor_text_events_TextEditorEvent = function(type) {
	openfl_events_Event.call(this,type);
};
$hxClasses["moonshine.editor.text.events.TextEditorEvent"] = moonshine_editor_text_events_TextEditorEvent;
moonshine_editor_text_events_TextEditorEvent.__name__ = "moonshine.editor.text.events.TextEditorEvent";
moonshine_editor_text_events_TextEditorEvent.__super__ = openfl_events_Event;
moonshine_editor_text_events_TextEditorEvent.prototype = $extend(openfl_events_Event.prototype,{
	clone: function() {
		return new moonshine_editor_text_events_TextEditorEvent(this.type);
	}
	,__class__: moonshine_editor_text_events_TextEditorEvent
});
var moonshine_editor_text_events_TextEditorLineEvent = function(type,lineIndex) {
	openfl_events_Event.call(this,type);
	this.lineIndex = lineIndex;
};
$hxClasses["moonshine.editor.text.events.TextEditorLineEvent"] = moonshine_editor_text_events_TextEditorLineEvent;
moonshine_editor_text_events_TextEditorLineEvent.__name__ = "moonshine.editor.text.events.TextEditorLineEvent";
moonshine_editor_text_events_TextEditorLineEvent.__super__ = openfl_events_Event;
moonshine_editor_text_events_TextEditorLineEvent.prototype = $extend(openfl_events_Event.prototype,{
	lineIndex: null
	,clone: function() {
		return new moonshine_editor_text_events_TextEditorLineEvent(this.type,this.lineIndex);
	}
	,__class__: moonshine_editor_text_events_TextEditorLineEvent
});
var moonshine_editor_text_lines_TextLineModel = function(text,lineIndex) {
	this.styleRanges = null;
	this.caretIndex = -1;
	openfl_events_EventDispatcher.call(this);
	this.text = text;
	this.lineIndex = lineIndex;
};
$hxClasses["moonshine.editor.text.lines.TextLineModel"] = moonshine_editor_text_lines_TextLineModel;
moonshine_editor_text_lines_TextLineModel.__name__ = "moonshine.editor.text.lines.TextLineModel";
moonshine_editor_text_lines_TextLineModel.__super__ = openfl_events_EventDispatcher;
moonshine_editor_text_lines_TextLineModel.prototype = $extend(openfl_events_EventDispatcher.prototype,{
	lineIndex: null
	,caretIndex: null
	,text: null
	,debuggerStoppedAtLine: null
	,styleRanges: null
	,__class__: moonshine_editor_text_lines_TextLineModel
});
var moonshine_editor_text_lines_TextLineRenderer = function() {
	this.__highlightAllFindResults = false;
	this.__gutterPaddingRight = 0.0;
	this.__gutterPaddingLeft = 0.0;
	this.__gutterGap = 0.0;
	this.__unverifiedBreakpointSkin = null;
	this.__breakpointSkin = null;
	this.__textStyles = null;
	this.__searchResultBackgroundSkinFactory = null;
	this.__selectedTextUnfocusedBackgroundSkinFactory = null;
	this.__selectedTextUnfocusedBackgroundSkin = null;
	this.__selectedTextBackgroundSkinFactory = null;
	this.__selectedTextBackgroundSkin = null;
	this.__debuggerStoppedBackgroundSkin = null;
	this.__focusedBackgroundSkin = null;
	this.__backgroundSkin = null;
	this.__breakpointGutterBackgroundSkin = null;
	this.__gutterBackgroundSkin = null;
	this.__lineNumberTextFormat = null;
	this.__embedFonts = false;
	this._searchResult = null;
	this._currentSearchResults = [];
	this._searchResultBackgroundSkins = [];
	this._linkEndChar = -1;
	this._linkStartChar = -1;
	this._selectionEndIndex = -1;
	this._selectionStartIndex = -1;
	this._textEditorHasFocus = false;
	this._caretIndex = -1;
	this._defaultTextStyleContext = 0;
	this._selectedTextBackgroundSkins = [];
	this._selectedTextSkinsAreFocused = false;
	this._wordWrap = false;
	this._allowToggleBreakpoints = false;
	this._showLineNumbers = true;
	this._lineNumberWidth = null;
	this._gutterWidth = 0.0;
	this._caretX = 0.0;
	this._debuggerStopped = false;
	this._renderTabsWithSpaces = true;
	this._breakpointVerified = true;
	this._tabWidth = 4;
	this._numLines = -1;
	this._minLineNumberCharacters = 1;
	this._lineIndex = -1;
	this._spaceToTabOffsets = [];
	this._tabToSpaceOffsets = [];
	moonshine_editor_text_theme_TextLineRendererStyles.initialize();
	feathers_core_FeathersControl.call(this);
	this._caretTimer = new openfl_utils_Timer(600.0);
	this._caretTimer.addEventListener("timer",$bind(this,this.textLineRenderer_caretTimer_timerHandler));
	this.addEventListener("mouseDown",$bind(this,this.textLineRenderer_mouseDownHandler));
};
$hxClasses["moonshine.editor.text.lines.TextLineRenderer"] = moonshine_editor_text_lines_TextLineRenderer;
moonshine_editor_text_lines_TextLineRenderer.__name__ = "moonshine.editor.text.lines.TextLineRenderer";
moonshine_editor_text_lines_TextLineRenderer.__super__ = feathers_core_FeathersControl;
moonshine_editor_text_lines_TextLineRenderer.prototype = $extend(feathers_core_FeathersControl.prototype,{
	_oldMouseCursor: null
	,_mainTextField: null
	,_lineNumberTextField: null
	,_tabToSpaceOffsets: null
	,_spaceToTabOffsets: null
	,_renderedText: null
	,_text: null
	,get_text: function() {
		return this._text;
	}
	,set_text: function(value) {
		if(this._text == value) {
			return this._text;
		}
		this._text = value;
		this.refreshTabOffsets();
		this.refreshRenderedText();
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		return this._text;
	}
	,_lineIndex: null
	,get_lineIndex: function() {
		return this._lineIndex;
	}
	,set_lineIndex: function(value) {
		if(this._lineIndex == value) {
			return this._lineIndex;
		}
		this._lineIndex = value;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		return this._lineIndex;
	}
	,_minLineNumberCharacters: null
	,get_minLineNumberCharacters: function() {
		return this._minLineNumberCharacters;
	}
	,set_minLineNumberCharacters: function(value) {
		if(this._minLineNumberCharacters == value) {
			return this._minLineNumberCharacters;
		}
		this._minLineNumberCharacters = value;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		return this._minLineNumberCharacters;
	}
	,_numLines: null
	,get_numLines: function() {
		return this._numLines;
	}
	,set_numLines: function(value) {
		if(this._numLines == value) {
			return this._numLines;
		}
		this._numLines = value;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		return this._numLines;
	}
	,_tabWidth: null
	,get_tabWidth: function() {
		return this._tabWidth;
	}
	,set_tabWidth: function(value) {
		if(this._tabWidth == value) {
			return this._tabWidth;
		}
		this._tabWidth = value;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		return this._tabWidth;
	}
	,_styleRanges: null
	,get_styleRanges: function() {
		return this._styleRanges;
	}
	,set_styleRanges: function(value) {
		if(this._styleRanges == value) {
			return this._styleRanges;
		}
		this._styleRanges = value;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		return this._styleRanges;
	}
	,_breakpoint: null
	,get_breakpoint: function() {
		return this._breakpoint;
	}
	,set_breakpoint: function(value) {
		if(this._breakpoint == value) {
			return this._breakpoint;
		}
		this._breakpoint = value;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		return this._breakpoint;
	}
	,_breakpointVerified: null
	,get_breakpointVerified: function() {
		return this._breakpointVerified;
	}
	,set_breakpointVerified: function(value) {
		if(this._breakpointVerified == value) {
			return this._breakpointVerified;
		}
		this._breakpointVerified = value;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		return this._breakpointVerified;
	}
	,_renderTabsWithSpaces: null
	,_debuggerStopped: null
	,get_debuggerStopped: function() {
		return this._debuggerStopped;
	}
	,set_debuggerStopped: function(value) {
		if(this._debuggerStopped == value) {
			return this._debuggerStopped;
		}
		this._debuggerStopped = value;
		this.setInvalid(feathers_core_InvalidationFlag.STATE);
		return this._debuggerStopped;
	}
	,_caretX: null
	,get_caretX: function() {
		return this._caretX;
	}
	,_gutterWidth: null
	,get_gutterWidth: function() {
		return this._gutterWidth;
	}
	,_lineNumberWidth: null
	,get_lineNumberWidth: function() {
		return this._lineNumberWidth;
	}
	,set_lineNumberWidth: function(value) {
		if(this._lineNumberWidth == value) {
			return this._lineNumberWidth;
		}
		this._lineNumberWidth = value;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		return this._lineNumberWidth;
	}
	,_showLineNumbers: null
	,get_showLineNumbers: function() {
		return this._showLineNumbers;
	}
	,set_showLineNumbers: function(value) {
		if(this._showLineNumbers == value) {
			return this._showLineNumbers;
		}
		this._showLineNumbers = value;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		return this._showLineNumbers;
	}
	,_allowToggleBreakpoints: null
	,get_allowToggleBreakpoints: function() {
		return this._allowToggleBreakpoints;
	}
	,set_allowToggleBreakpoints: function(value) {
		if(this._allowToggleBreakpoints == value) {
			return this._allowToggleBreakpoints;
		}
		this._allowToggleBreakpoints = value;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		return this._allowToggleBreakpoints;
	}
	,_oldScrollX: null
	,_caretTimer: null
	,_caretSkin: null
	,_wordWrap: null
	,get_wordWrap: function() {
		return this._wordWrap;
	}
	,set_wordWrap: function(value) {
		if(this._wordWrap == value) {
			return this._wordWrap;
		}
		this._wordWrap = value;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		return this._wordWrap;
	}
	,_currentGutterBackgroundSkin: null
	,_currentBackgroundSkin: null
	,_selectedTextSkinsAreFocused: null
	,_selectedTextBackgroundSkins: null
	,_defaultTextStyleContext: null
	,get_defaultTextStyleContext: function() {
		return this._defaultTextStyleContext;
	}
	,set_defaultTextStyleContext: function(value) {
		if(this._defaultTextStyleContext == value) {
			return this._defaultTextStyleContext;
		}
		this._defaultTextStyleContext = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this._defaultTextStyleContext;
	}
	,_currentBreakpointSkin: null
	,_caretIndex: null
	,get_caretIndex: function() {
		return this._caretIndex;
	}
	,set_caretIndex: function(value) {
		if(this._caretIndex == value) {
			return this._caretIndex;
		}
		this._caretIndex = value;
		this.refreshCaretTimer();
		this.setInvalid(feathers_core_InvalidationFlag.STATE);
		return this._caretIndex;
	}
	,_textEditorHasFocus: null
	,get_textEditorHasFocus: function() {
		return this._textEditorHasFocus;
	}
	,set_textEditorHasFocus: function(value) {
		if(this._textEditorHasFocus == value) {
			return this._textEditorHasFocus;
		}
		this._textEditorHasFocus = value;
		this.refreshCaretTimer();
		this.setInvalid(feathers_core_InvalidationFlag.STATE);
		return this._textEditorHasFocus;
	}
	,_selectionStartIndex: null
	,get_selectionStartIndex: function() {
		return this._selectionStartIndex;
	}
	,set_selectionStartIndex: function(value) {
		if(this._selectionStartIndex == value) {
			return this._selectionStartIndex;
		}
		this._selectionStartIndex = value;
		this.setInvalid(feathers_core_InvalidationFlag.STATE);
		return this._selectionStartIndex;
	}
	,_selectionEndIndex: null
	,get_selectionEndIndex: function() {
		return this._selectionEndIndex;
	}
	,set_selectionEndIndex: function(value) {
		if(this._selectionEndIndex == value) {
			return this._selectionEndIndex;
		}
		this._selectionEndIndex = value;
		this.setInvalid(feathers_core_InvalidationFlag.STATE);
		return this._selectionEndIndex;
	}
	,_linkStartChar: null
	,get_linkStartChar: function() {
		return this._linkStartChar;
	}
	,set_linkStartChar: function(value) {
		if(this._linkStartChar == value) {
			return this._linkStartChar;
		}
		this._linkStartChar = value;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		return this._linkStartChar;
	}
	,_linkEndChar: null
	,get_linkEndChar: function() {
		return this._linkEndChar;
	}
	,set_linkEndChar: function(value) {
		if(this._linkEndChar == value) {
			return this._linkEndChar;
		}
		this._linkEndChar = value;
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		return this._linkEndChar;
	}
	,_searchResultBackgroundSkins: null
	,_currentSearchResults: null
	,_searchResult: null
	,get_searchResult: function() {
		return this._searchResult;
	}
	,set_searchResult: function(value) {
		if(this._searchResult == value) {
			return this._searchResult;
		}
		this._searchResult = value;
		this.setInvalid(feathers_core_InvalidationFlag.STATE);
		return this._searchResult;
	}
	,_textEditorOwner: null
	,get_textEditorOwner: function() {
		return this._textEditorOwner;
	}
	,set_textEditorOwner: function(value) {
		if(this._textEditorOwner == value) {
			return this._textEditorOwner;
		}
		if(this._textEditorOwner != null) {
			this._textEditorOwner.removeEventListener("scroll",$bind(this,this.textLineRenderer_textEditorOwner_scrollHandler));
		}
		this._textEditorOwner = value;
		if(this._textEditorOwner != null) {
			this._textEditorOwner.addEventListener("scroll",$bind(this,this.textLineRenderer_textEditorOwner_scrollHandler),false,0,true);
		}
		this.setInvalid(feathers_core_InvalidationFlag.DATA);
		return this._textEditorOwner;
	}
	,getCharBoundaries: function(charIndex) {
		this.validateNow();
		if(this._mainTextField == null) {
			return null;
		}
		var renderedCharIndex = this.textIndexToRenderedIndex(charIndex);
		var end = renderedCharIndex == this._mainTextField.get_text().length;
		if(end) {
			if(renderedCharIndex == 0) {
				return new openfl_geom_Rectangle(this._mainTextField.get_x(),this._mainTextField.get_y(),0.0,this._mainTextField.get_textHeight());
			}
			--renderedCharIndex;
		}
		var bounds = this._mainTextField.getCharBoundaries(renderedCharIndex);
		if(bounds == null) {
			return null;
		}
		bounds.x += this._mainTextField.get_x();
		bounds.y += this._mainTextField.get_y();
		if(end) {
			bounds.x += bounds.width;
			bounds.width = 0.0;
		}
		return bounds;
	}
	,getCharIndexAtPoint: function(localX,localY) {
		this.validateNow();
		if(this._mainTextField == null) {
			return -1;
		}
		var renderedIndex = this._mainTextField.getCharIndexAtPoint(localX - this._mainTextField.get_x(),localY - this._mainTextField.get_y());
		if(renderedIndex == -1) {
			return renderedIndex;
		}
		return this.renderedIndexToTextIndex(renderedIndex);
	}
	,getSelectionCharIndexAtPoint: function(localX,localY,returnNextAfterCenter) {
		if(returnNextAfterCenter == null) {
			returnNextAfterCenter = true;
		}
		this.validateNow();
		if(this._mainTextField == null) {
			return 0;
		}
		if(localX < this._gutterWidth) {
			return 0;
		} else if(localX >= this._mainTextField.get_x() + this._mainTextField.get_width()) {
			return this._mainTextField.get_text().length;
		}
		var mainTextFieldX = localX - this._mainTextField.get_x();
		var mainTextFieldY = localY - this._mainTextField.get_y();
		if(mainTextFieldX < 3.0) {
			mainTextFieldX = 3.0;
		} else {
			var maxMainTextFieldX = this._mainTextField.get_width() - 3.0;
			if(mainTextFieldX > maxMainTextFieldX) {
				mainTextFieldX = maxMainTextFieldX;
			}
		}
		if(mainTextFieldY < 2.0) {
			mainTextFieldY = 2.0;
		} else {
			var maxMainTextFieldY = this._mainTextField.get_height() - 2.0;
			if(mainTextFieldY > maxMainTextFieldY) {
				mainTextFieldY = maxMainTextFieldY;
			}
		}
		var renderedCharIndexAtPoint = this._mainTextField.getCharIndexAtPoint(mainTextFieldX,mainTextFieldY);
		if(renderedCharIndexAtPoint != -1 && returnNextAfterCenter) {
			var bounds = this._mainTextField.getCharBoundaries(renderedCharIndexAtPoint);
			if(bounds != null) {
				var center = this._gutterWidth + bounds.x + bounds.width / 2.0;
				if(localX >= center) {
					++renderedCharIndexAtPoint;
				}
			}
		}
		return this.renderedIndexToTextIndex(renderedCharIndexAtPoint);
	}
	,initialize: function() {
		if(this._mainTextField == null) {
			this._mainTextField = new openfl_text_TextField();
			this._mainTextField.set_autoSize(1);
			this._mainTextField.set_selectable(false);
			this._mainTextField.set_mouseWheelEnabled(false);
			this._mainTextField.addEventListener("rollOver",$bind(this,this.textLineRenderer_mainTextField_rollOverHandler));
			this._mainTextField.addEventListener("rollOut",$bind(this,this.textLineRenderer_mainTextField_rollOutHandler));
			this.addChild(this._mainTextField);
		}
		if(this._lineNumberTextField == null) {
			this._lineNumberTextField = new openfl_text_TextField();
			this._lineNumberTextField.set_autoSize(1);
			this._lineNumberTextField.set_selectable(false);
			this._lineNumberTextField.set_mouseWheelEnabled(false);
			this._lineNumberTextField.addEventListener("mouseDown",$bind(this,this.textLineRenderer_lineNumberTextField_mouseDownHandler));
			this.addChild(this._lineNumberTextField);
		}
	}
	,update: function() {
		var dataInvalid = this.isInvalid(feathers_core_InvalidationFlag.DATA);
		var scrollInvalid = this.isInvalid(feathers_core_InvalidationFlag.SCROLL);
		var sizeInvalid = this.isInvalid(feathers_core_InvalidationFlag.SIZE);
		var stateInvalid = this.isInvalid(feathers_core_InvalidationFlag.STATE);
		var stylesInvalid = this.isInvalid(feathers_core_InvalidationFlag.STYLES);
		if(stateInvalid || stylesInvalid || dataInvalid) {
			this.refreshCurrentSearchResults();
		}
		if(stateInvalid || stylesInvalid) {
			this.refreshBackgroundSkin();
		}
		if(dataInvalid || stylesInvalid) {
			this.refreshGutterBackgroundSkin();
			this.refreshBreakpointSkin();
		}
		if(stylesInvalid) {
			this.refreshCaretSkin();
		}
		if(dataInvalid || stylesInvalid) {
			this.refreshLineNumber();
			this.refreshText();
		}
		if(dataInvalid || stylesInvalid) {
			this.refreshLineNumberTextStyles();
		}
		if(dataInvalid || stylesInvalid) {
			this.refreshGutterWidth();
		}
		if(dataInvalid || stylesInvalid || sizeInvalid) {
			this.refreshWordWrap();
		}
		this.measure();
		this.layoutContent();
	}
	,measure: function() {
		var needsWidth = this.get_explicitWidth() == null;
		var needsHeight = this.get_explicitHeight() == null;
		var needsMinWidth = this.get_explicitMinWidth() == null;
		var needsMinHeight = this.get_explicitMinHeight() == null;
		var needsMaxWidth = this.get_explicitMaxWidth() == null;
		var needsMaxHeight = this.get_explicitMaxHeight() == null;
		if(!needsWidth && !needsHeight && !needsMinWidth && !needsMinHeight && !needsMaxWidth && !needsMaxHeight) {
			return false;
		}
		var newWidth = this.get_explicitWidth();
		if(needsWidth) {
			newWidth = this._gutterWidth + this._mainTextField.get_width();
		}
		var newHeight = this.get_explicitHeight();
		if(needsHeight) {
			newHeight = this._mainTextField.get_height();
			if(this._showLineNumbers) {
				newHeight = Math.max(newHeight,this._lineNumberTextField.get_height());
			}
		}
		return this.saveMeasurements(newWidth,newHeight);
	}
	,refreshLineNumber: function() {
		var lineNumberText = Std.string(this.get_lineIndex() + 1);
		var minNumChars = Math.max(this._minLineNumberCharacters,Std.string(this.get_numLines()).length) | 0;
		lineNumberText = StringTools.lpad(lineNumberText," ",minNumChars);
		this._lineNumberTextField.set_text(lineNumberText);
	}
	,refreshLineNumberTextStyles: function() {
		var tf = this.get_lineNumberTextFormat();
		if(tf == null) {
			if(this.get_textStyles() == null) {
				return;
			}
			tf = this.get_textStyles().h[this._defaultTextStyleContext];
		}
		if(tf == null) {
			return;
		}
		this._lineNumberTextField.setTextFormat(tf);
		this._lineNumberTextField.set_embedFonts(this.get_embedFonts());
	}
	,refreshTabOffsets: function() {
		this._tabToSpaceOffsets.length = 0;
		this._spaceToTabOffsets.length = 0;
		if(this._text == null || this._text.length == 0 || !this._renderTabsWithSpaces) {
			return;
		}
		var renderedCurrent = 0;
		var previous = 0;
		var current = 0;
		while(true) {
			current = this._text.indexOf("\t",current);
			if(!(current != -1)) {
				break;
			}
			renderedCurrent += current - previous;
			var spacesCount = renderedCurrent % this._tabWidth;
			if(spacesCount == 0) {
				spacesCount = 4;
			}
			this._tabToSpaceOffsets.push(current);
			this._tabToSpaceOffsets.push(spacesCount);
			var _g = renderedCurrent + 1;
			var _g1 = renderedCurrent + spacesCount;
			while(_g < _g1) {
				var i = _g++;
				this._spaceToTabOffsets.push(i);
				this._spaceToTabOffsets.push(-1);
			}
			++current;
			renderedCurrent += spacesCount;
			previous = current;
		}
	}
	,refreshRenderedText: function() {
		if(this._text == null || this._text.length == 0) {
			this._renderedText = " ";
			return;
		}
		if(!this._renderTabsWithSpaces) {
			this._renderedText = this._text;
			return;
		}
		this._renderedText = "";
		var i = 0;
		var previous = 0;
		while(i < this._tabToSpaceOffsets.length) {
			var current = this._tabToSpaceOffsets[i];
			++i;
			var spacesCount = this._tabToSpaceOffsets[i];
			++i;
			var startSubstr = this._text.substring(previous,current);
			var spaces = StringTools.rpad(""," ",spacesCount);
			this._renderedText += startSubstr + spaces;
			previous = current + 1;
		}
		this._renderedText += this._text.substring(previous);
	}
	,textIndexToRenderedIndex: function(textIndex) {
		if(!this._renderTabsWithSpaces) {
			return textIndex;
		}
		var renderedIndex = textIndex;
		var i = 0;
		while(i < this._tabToSpaceOffsets.length) {
			var current = this._tabToSpaceOffsets[i];
			++i;
			if(current >= textIndex) {
				break;
			}
			var spacesCount = this._tabToSpaceOffsets[i];
			++i;
			renderedIndex += spacesCount - 1;
		}
		return renderedIndex;
	}
	,renderedIndexToTextIndex: function(renderedIndex) {
		if(!this._renderTabsWithSpaces) {
			return renderedIndex;
		}
		var textIndex = renderedIndex;
		var i = 0;
		while(i < this._spaceToTabOffsets.length) {
			var current = this._spaceToTabOffsets[i];
			++i;
			if(current > renderedIndex) {
				break;
			}
			var spacesCount = this._spaceToTabOffsets[i];
			++i;
			textIndex += spacesCount;
		}
		return textIndex;
	}
	,refreshText: function() {
		this._mainTextField.set_text(this._renderedText);
		if(this.get_textStyles() == null) {
			return;
		}
		var lineTextLength = this._text.length;
		var linkStartChar = this._linkStartChar;
		if(linkStartChar > lineTextLength) {
			linkStartChar = lineTextLength;
		}
		var linkEndChar = this._linkEndChar;
		if(linkEndChar > lineTextLength) {
			linkEndChar = lineTextLength;
		}
		var i = 0;
		while(true) {
			var current = 0;
			var next = lineTextLength;
			var style = this._defaultTextStyleContext;
			if(this._styleRanges != null && i < this._styleRanges.length) {
				current = this._styleRanges[i];
				++i;
				if(i < this._styleRanges.length) {
					style = this._styleRanges[i];
				}
				++i;
				next = lineTextLength;
				if(i < this._styleRanges.length) {
					next = this._styleRanges[i];
				}
			}
			if(current >= lineTextLength) {
				break;
			}
			if(next > lineTextLength) {
				next = lineTextLength;
			}
			if(current == next) {
				if(!(this._styleRanges != null && i < this._styleRanges.length)) {
					break;
				} else {
					continue;
				}
			}
			var format = this.get_textStyles().h[style];
			if(format == null) {
				format = this.get_textStyles().h[this._defaultTextStyleContext];
			}
			if(linkStartChar != -1 && linkStartChar >= current && linkStartChar < next) {
				var linkStartRendered = this.textIndexToRenderedIndex(linkStartChar);
				var linkEndRendered = this.textIndexToRenderedIndex(linkEndChar);
				var currentRendered = this.textIndexToRenderedIndex(current);
				var nextRendered = this.textIndexToRenderedIndex(next);
				var linkFormat = feathers_utils_TextFormatUtil.clone(format);
				linkFormat.underline = true;
				if(linkStartRendered > currentRendered) {
					this._mainTextField.setTextFormat(format,currentRendered,linkStartRendered);
				}
				this._mainTextField.setTextFormat(linkFormat,linkStartRendered,linkEndRendered);
				if(linkEndRendered < nextRendered) {
					this._mainTextField.setTextFormat(format,linkEndRendered,nextRendered);
				}
			} else {
				if(format.underline == null) {
					format.underline = false;
				}
				current = this.textIndexToRenderedIndex(current);
				next = this.textIndexToRenderedIndex(next);
				this._mainTextField.setTextFormat(format,current,next);
			}
			if(!(this._styleRanges != null && i < this._styleRanges.length)) {
				break;
			}
		}
		if(this._text == null || this._text.length == 0) {
			var format = this.get_textStyles().h[this._defaultTextStyleContext];
			this._mainTextField.setTextFormat(format);
		}
		this._mainTextField.set_embedFonts(this.get_embedFonts());
	}
	,refreshBackgroundSkin: function() {
		var oldSkin = this._currentBackgroundSkin;
		this._currentBackgroundSkin = this.getCurrentBackgroundSkin();
		if(oldSkin == this._currentBackgroundSkin) {
			return;
		}
		if(oldSkin != null) {
			if(js_Boot.__implements(oldSkin,feathers_skins_IProgrammaticSkin)) {
				(js_Boot.__cast(oldSkin , feathers_skins_IProgrammaticSkin)).set_uiContext(null);
			}
			this.removeChild(oldSkin);
		}
		if(this._currentBackgroundSkin == null) {
			return;
		}
		this.addChildAt(this._currentBackgroundSkin,0);
		if(js_Boot.__implements(this._currentBackgroundSkin,feathers_skins_IProgrammaticSkin)) {
			(js_Boot.__cast(this._currentBackgroundSkin , feathers_skins_IProgrammaticSkin)).set_uiContext(this);
		}
	}
	,getCurrentBackgroundSkin: function() {
		if(this._debuggerStopped && this.get_debuggerStoppedBackgroundSkin() != null) {
			return this.get_debuggerStoppedBackgroundSkin();
		}
		if(this._textEditorHasFocus && this._caretIndex != -1 && this._selectionStartIndex == -1 && this._selectionEndIndex == -1 && this.get_focusedBackgroundSkin() != null) {
			return this.get_focusedBackgroundSkin();
		}
		return this.get_backgroundSkin();
	}
	,refreshGutterWidth: function() {
		this._gutterWidth = 0.0;
		if(this._allowToggleBreakpoints && this._currentBreakpointSkin != null) {
			if(js_Boot.__implements(this._currentBreakpointSkin,feathers_core_IValidating)) {
				(js_Boot.__cast(this._currentBreakpointSkin , feathers_core_IValidating)).validateNow();
			}
			this._gutterWidth += this._currentBreakpointSkin.get_width();
		}
		if(this._showLineNumbers) {
			if(this._gutterWidth > 0.0) {
				this._gutterWidth += this.get_gutterGap();
			}
			if(this.get_lineNumberWidth() != null) {
				this._gutterWidth += this.get_lineNumberWidth();
			} else {
				this._gutterWidth += this._lineNumberTextField.get_width();
			}
		}
		this._gutterWidth += this.get_gutterPaddingLeft() + this.get_gutterPaddingRight();
	}
	,refreshGutterBackgroundSkin: function() {
		var oldSkin = this._currentGutterBackgroundSkin;
		this._currentGutterBackgroundSkin = this.getCurrentGutterBackgroundSkin();
		if(oldSkin == this._currentGutterBackgroundSkin) {
			return;
		}
		if(oldSkin != null) {
			if(js_Boot.__implements(oldSkin,feathers_skins_IProgrammaticSkin)) {
				(js_Boot.__cast(oldSkin , feathers_skins_IProgrammaticSkin)).set_uiContext(null);
			}
			this.removeChild(oldSkin);
		}
		if(this._currentGutterBackgroundSkin == null) {
			return;
		}
		this.addChildAt(this._currentGutterBackgroundSkin,this.getChildIndex(this._lineNumberTextField));
		if(js_Boot.__implements(this._currentGutterBackgroundSkin,feathers_skins_IProgrammaticSkin)) {
			(js_Boot.__cast(this._currentGutterBackgroundSkin , feathers_skins_IProgrammaticSkin)).set_uiContext(this);
		}
	}
	,getCurrentGutterBackgroundSkin: function() {
		if(this._breakpoint && this.get_breakpointGutterBackgroundSkin() != null) {
			return this.get_breakpointGutterBackgroundSkin();
		}
		return this.get_gutterBackgroundSkin();
	}
	,refreshCaretSkin: function() {
		var caretColor = 0;
		if(this.get_textStyles() != null) {
			caretColor = this.get_textStyles().h[this._defaultTextStyleContext].color;
		}
		if(this._caretSkin == null) {
			this._caretSkin = new feathers_skins_RectangleSkin(feathers_graphics_FillStyle.SolidColor(caretColor));
			this._caretSkin.set_width(2.0);
			this._caretSkin.set_height(2.0);
			this.addChildAt(this._caretSkin,this.getChildIndex(this._mainTextField) + 1);
		}
		this._caretSkin.mouseChildren = false;
		this._caretSkin.mouseEnabled = false;
		this._caretSkin.set_fill(feathers_graphics_FillStyle.SolidColor(caretColor));
	}
	,refreshBreakpointSkin: function() {
		var oldSkin = this._currentBreakpointSkin;
		this._currentBreakpointSkin = this.getCurrentBreakpointSkin();
		if(oldSkin == this._currentBreakpointSkin) {
			return;
		}
		if(oldSkin != null) {
			if(js_Boot.__implements(oldSkin,feathers_skins_IProgrammaticSkin)) {
				(js_Boot.__cast(oldSkin , feathers_skins_IProgrammaticSkin)).set_uiContext(null);
			}
			this.removeChild(oldSkin);
		}
		if(this._currentBreakpointSkin == null) {
			return;
		}
		this.addChild(this._currentBreakpointSkin);
		if(js_Boot.__implements(this._currentBreakpointSkin,feathers_skins_IProgrammaticSkin)) {
			(js_Boot.__cast(this._currentBreakpointSkin , feathers_skins_IProgrammaticSkin)).set_uiContext(this);
		}
	}
	,getCurrentBreakpointSkin: function() {
		if(!this.get_breakpointVerified() && this.get_unverifiedBreakpointSkin() != null) {
			return this.get_unverifiedBreakpointSkin();
		}
		return this.get_breakpointSkin();
	}
	,refreshSearchResultBackgroundSkins: function() {
		var skinsCount = this._currentSearchResults.length;
		var difference = skinsCount - this._searchResultBackgroundSkins.length;
		if(difference < 0) {
			var _g = 0;
			var _g1 = -difference;
			while(_g < _g1) {
				var i = _g++;
				var skin = this._searchResultBackgroundSkins.pop();
				if(js_Boot.__implements(skin,feathers_skins_IProgrammaticSkin)) {
					(js_Boot.__cast(skin , feathers_skins_IProgrammaticSkin)).set_uiContext(null);
				}
				this.removeChild(skin);
			}
		}
		if(skinsCount == 0 || this.get_searchResultBackgroundSkinFactory() == null) {
			return;
		}
		var index = this.getChildIndex(this._mainTextField);
		if(this._selectedTextBackgroundSkins.length > 0) {
			++index;
		}
		var _g = 0;
		var _g1 = skinsCount;
		while(_g < _g1) {
			var i = _g++;
			var result = this._currentSearchResults[i];
			var startBounds = this._mainTextField.getCharBoundaries(result.startChar);
			var endBounds = this._mainTextField.getCharBoundaries(result.endChar - 1);
			if(startBounds == null || endBounds == null) {
				continue;
			}
			var skin = null;
			if(i < this._searchResultBackgroundSkins.length) {
				skin = this._searchResultBackgroundSkins[i];
			} else {
				skin = (this.get_searchResultBackgroundSkinFactory())();
				this._searchResultBackgroundSkins[i] = skin;
				this.addChildAt(skin,index);
				if(js_Boot.__implements(skin,feathers_skins_IProgrammaticSkin)) {
					(js_Boot.__cast(skin , feathers_skins_IProgrammaticSkin)).set_uiContext(this);
				}
			}
			skin.set_x(this._mainTextField.get_x() + startBounds.x);
			skin.set_y(this._mainTextField.get_y() + startBounds.y);
			skin.set_width(endBounds.x + endBounds.width - startBounds.x);
			skin.set_height(endBounds.y + endBounds.height - startBounds.y);
		}
	}
	,refreshSelectedTextBackgroundSkins: function() {
		if(this._selectedTextSkinsAreFocused != this._textEditorHasFocus) {
			var _g = 0;
			var _g1 = this._selectedTextBackgroundSkins.length;
			while(_g < _g1) {
				var i = _g++;
				var skin = this._selectedTextBackgroundSkins.shift();
				if(js_Boot.__implements(skin,feathers_skins_IProgrammaticSkin)) {
					(js_Boot.__cast(skin , feathers_skins_IProgrammaticSkin)).set_uiContext(null);
				}
				this.removeChild(skin);
			}
		}
		this._selectedTextSkinsAreFocused = this._textEditorHasFocus;
		var selectedTextBackgroundSkinForCurrentFocusState = this.get_selectedTextBackgroundSkin();
		if(!this._textEditorHasFocus && this.get_selectedTextUnfocusedBackgroundSkin() != null) {
			selectedTextBackgroundSkinForCurrentFocusState = this.get_selectedTextUnfocusedBackgroundSkin();
		}
		var selectedTextBackgroundSkinFactoryForCurrentFocusState = this.get_selectedTextBackgroundSkinFactory();
		if(!this._textEditorHasFocus && this.get_selectedTextUnfocusedBackgroundSkinFactory() != null) {
			selectedTextBackgroundSkinFactoryForCurrentFocusState = this.get_selectedTextUnfocusedBackgroundSkinFactory();
		}
		var renderedStartIndex = -1;
		var renderedEndIndex = -1;
		var startSubLineIndex = 0;
		var endSubLineIndex = 0;
		var skinsCount = 0;
		var renderedTextLength = this._mainTextField.get_text().length;
		var textLength = this._text != null ? this._text.length : 0;
		if(this._selectionStartIndex != -1 && this._selectionEndIndex != -1 && (selectedTextBackgroundSkinFactoryForCurrentFocusState != null || selectedTextBackgroundSkinForCurrentFocusState != null)) {
			var adjustedStartIndex = this._selectionStartIndex < this._selectionEndIndex ? this._selectionStartIndex : this._selectionEndIndex;
			if(adjustedStartIndex > textLength) {
				adjustedStartIndex = textLength;
			}
			var adjustedEndIndex = this._selectionStartIndex < this._selectionEndIndex ? this._selectionEndIndex : this._selectionStartIndex;
			if(adjustedEndIndex > textLength) {
				adjustedEndIndex = textLength;
			}
			renderedStartIndex = this.textIndexToRenderedIndex(adjustedStartIndex);
			renderedEndIndex = this.textIndexToRenderedIndex(adjustedEndIndex);
			if(this._wordWrap) {
				if(renderedStartIndex == renderedTextLength) {
					startSubLineIndex = this._mainTextField.getLineIndexOfChar(renderedStartIndex - 1);
				} else {
					startSubLineIndex = this._mainTextField.getLineIndexOfChar(renderedStartIndex);
				}
				if(renderedEndIndex == renderedTextLength) {
					endSubLineIndex = this._mainTextField.getLineIndexOfChar(renderedEndIndex - 1);
				} else {
					endSubLineIndex = this._mainTextField.getLineIndexOfChar(renderedEndIndex);
				}
				skinsCount = endSubLineIndex - startSubLineIndex + 1;
			} else {
				skinsCount = 1;
			}
		}
		var difference = skinsCount - this._selectedTextBackgroundSkins.length;
		if(difference < 0) {
			var _g = 0;
			var _g1 = -difference;
			while(_g < _g1) {
				var i = _g++;
				var skin = this._selectedTextBackgroundSkins.pop();
				if(js_Boot.__implements(skin,feathers_skins_IProgrammaticSkin)) {
					(js_Boot.__cast(skin , feathers_skins_IProgrammaticSkin)).set_uiContext(null);
				}
				this.removeChild(skin);
			}
		}
		if(skinsCount == 0) {
			return;
		}
		var index = this.getChildIndex(this._mainTextField);
		var currentSubLineStartIndex = startSubLineIndex > 0 ? this._mainTextField.getLineOffset(startSubLineIndex) : startSubLineIndex;
		var _g = 0;
		var _g1 = skinsCount;
		while(_g < _g1) {
			var i = _g++;
			var skin = null;
			if(i < this._selectedTextBackgroundSkins.length) {
				skin = this._selectedTextBackgroundSkins[i];
			} else if(selectedTextBackgroundSkinFactoryForCurrentFocusState != null) {
				skin = selectedTextBackgroundSkinFactoryForCurrentFocusState();
				this._selectedTextBackgroundSkins[i] = skin;
				this.addChildAt(skin,index);
				if(js_Boot.__implements(skin,feathers_skins_IProgrammaticSkin)) {
					(js_Boot.__cast(skin , feathers_skins_IProgrammaticSkin)).set_uiContext(this);
				}
			} else if(selectedTextBackgroundSkinForCurrentFocusState.parent == null) {
				skin = selectedTextBackgroundSkinForCurrentFocusState;
				this._selectedTextBackgroundSkins[i] = skin;
				this.addChildAt(skin,index);
				if(js_Boot.__implements(skin,feathers_skins_IProgrammaticSkin)) {
					(js_Boot.__cast(skin , feathers_skins_IProgrammaticSkin)).set_uiContext(this);
				}
			} else {
				continue;
			}
			var currentSubLineLength = textLength > 0 ? renderedTextLength : 0;
			if(this._wordWrap && textLength > 0) {
				currentSubLineLength = this._mainTextField.getLineLength(startSubLineIndex + i);
			}
			var currentSubLineRenderedStartIndex = renderedStartIndex;
			if(currentSubLineRenderedStartIndex < currentSubLineStartIndex) {
				currentSubLineRenderedStartIndex = currentSubLineStartIndex;
			}
			var currentSubLineMaxRenderedIndex = currentSubLineStartIndex + currentSubLineLength;
			var currentSubLineRenderedEndIndex = renderedEndIndex;
			if(currentSubLineRenderedEndIndex > currentSubLineMaxRenderedIndex) {
				currentSubLineRenderedEndIndex = currentSubLineMaxRenderedIndex;
			}
			var needsEndOffset = false;
			if(currentSubLineRenderedEndIndex >= currentSubLineMaxRenderedIndex) {
				needsEndOffset = true;
				if(currentSubLineLength > 0) {
					currentSubLineRenderedEndIndex = currentSubLineMaxRenderedIndex - 1;
				} else {
					currentSubLineRenderedEndIndex = 0;
				}
			}
			var startBounds = this._mainTextField.getCharBoundaries(currentSubLineRenderedStartIndex);
			if(startBounds == null && currentSubLineRenderedStartIndex > 0) {
				startBounds = this._mainTextField.getCharBoundaries(currentSubLineRenderedStartIndex - 1);
				if(startBounds != null) {
					startBounds.x += startBounds.width;
					startBounds.width = 0.0;
				}
			}
			var endBounds = this._mainTextField.getCharBoundaries(currentSubLineRenderedEndIndex);
			if(endBounds == null && currentSubLineRenderedEndIndex > 0) {
				endBounds = this._mainTextField.getCharBoundaries(currentSubLineRenderedEndIndex - 1);
				if(endBounds != null) {
					endBounds.x += endBounds.width;
					endBounds.width = 0.0;
				}
			}
			if(startBounds == null || endBounds == null) {
				skin.set_visible(false);
				currentSubLineStartIndex += currentSubLineLength;
				continue;
			}
			var endOffsetX = needsEndOffset ? endBounds.width : 0.0;
			skin.set_x(this._gutterWidth + startBounds.x);
			skin.set_y(this._mainTextField.get_y() + startBounds.y);
			var selectionWidth = endBounds.x + endOffsetX - startBounds.x;
			if(currentSubLineLength == 0 && currentSubLineRenderedStartIndex == currentSubLineRenderedEndIndex) {
				selectionWidth = this._mainTextField.get_width();
			}
			skin.set_width(selectionWidth);
			skin.set_height(endBounds.y + endBounds.height - startBounds.y);
			skin.set_visible(true);
			currentSubLineStartIndex += currentSubLineLength;
		}
	}
	,refreshCaretPosition: function() {
		if(this._caretSkin == null) {
			this._caretX = 0.0;
			return;
		}
		if(!this._textEditorHasFocus || this._caretIndex == -1) {
			this._caretSkin.set_visible(false);
			this._caretX = 0.0;
			return;
		}
		var textLength = this._text != null ? this._text.length : 0;
		var adjustedCaretIndex = this._caretIndex;
		if(this._caretIndex >= textLength) {
			if(textLength > 0) {
				adjustedCaretIndex = textLength - 1;
			} else {
				adjustedCaretIndex = 0;
			}
		}
		var renderedCaretIndex = this.textIndexToRenderedIndex(adjustedCaretIndex);
		var caretX = this._gutterWidth;
		var caretY = this._mainTextField.get_y();
		var caretHeight = 0.0;
		var bounds = this._mainTextField.getCharBoundaries(renderedCaretIndex);
		if(bounds == null && renderedCaretIndex > 0) {
			bounds = this._mainTextField.getCharBoundaries(renderedCaretIndex - 1);
			if(bounds != null) {
				bounds.x += bounds.width;
				bounds.width = 0.0;
			}
		}
		if(bounds != null) {
			caretX += bounds.x;
			caretY += bounds.y;
			caretHeight = bounds.height;
			if(textLength > 0 && this._caretIndex > adjustedCaretIndex) {
				if(this._renderTabsWithSpaces && this._text.charAt(adjustedCaretIndex) == "\t") {
					caretX += bounds.width * this._tabWidth;
				} else {
					caretX += bounds.width;
				}
			}
		} else {
			caretHeight = this._mainTextField.getLineMetrics(0).height;
		}
		this._caretSkin.set_x(caretX);
		this._caretSkin.set_y(caretY);
		this._caretSkin.set_height(caretHeight);
		this._caretSkin.set_visible(true);
		this._caretX = this._caretSkin.get_x();
	}
	,refreshWordWrap: function() {
		if(this.get_explicitWidth() != null && this._wordWrap && this._text.length > 0) {
			this._mainTextField.set_width(this.get_explicitWidth() - this._gutterWidth);
			this._mainTextField.set_wordWrap(this._wordWrap);
		} else {
			this._mainTextField.set_wordWrap(false);
		}
	}
	,layoutContent: function() {
		var scrollX = this._textEditorOwner != null ? this._textEditorOwner.get_scrollX() : 0.0;
		this._oldScrollX = scrollX;
		var gutterStartX = scrollX;
		if(this._currentGutterBackgroundSkin != null) {
			this._currentGutterBackgroundSkin.set_width(this._gutterWidth);
			this._currentGutterBackgroundSkin.set_height(this.actualHeight);
			this._currentGutterBackgroundSkin.set_x(gutterStartX);
			this._currentGutterBackgroundSkin.set_y(0.0);
		}
		if(this._currentBackgroundSkin != null) {
			this._currentBackgroundSkin.set_height(this.actualHeight);
			if(this._currentGutterBackgroundSkin != null) {
				this._currentBackgroundSkin.set_width(this.actualWidth - this._gutterWidth);
				this._currentBackgroundSkin.set_x(this._gutterWidth);
			} else {
				this._currentBackgroundSkin.set_width(this.actualWidth);
				this._currentBackgroundSkin.set_x(0.0);
			}
			this._currentBackgroundSkin.set_y(0.0);
		}
		if(this._currentBreakpointSkin != null) {
			this._currentBreakpointSkin.set_visible(this._allowToggleBreakpoints && this._breakpoint);
			if(js_Boot.__implements(this._currentBreakpointSkin,feathers_core_IValidating)) {
				(js_Boot.__cast(this._currentBreakpointSkin , feathers_core_IValidating)).validateNow();
			}
			this._currentBreakpointSkin.set_x(gutterStartX + this.get_gutterPaddingLeft());
			this._currentBreakpointSkin.set_y((this.actualHeight - this._currentBreakpointSkin.get_height()) / 2.0);
		}
		this._lineNumberTextField.set_visible(this._showLineNumbers);
		this._lineNumberTextField.set_x(gutterStartX + this._gutterWidth - this._lineNumberTextField.get_width() - this.get_gutterPaddingRight());
		this._mainTextField.set_x(this._gutterWidth);
		this._mainTextField.set_width(this.actualWidth - this._gutterWidth);
		var mainTextFieldHeight = this._mainTextField.get_height();
		var lineNumberTextFieldHeight = this._lineNumberTextField.get_height();
		if(mainTextFieldHeight == lineNumberTextFieldHeight) {
			this._mainTextField.set_y((this.actualHeight - mainTextFieldHeight) / 2.0);
			this._lineNumberTextField.set_y(this._mainTextField.get_y());
		} else if(mainTextFieldHeight > lineNumberTextFieldHeight) {
			this._mainTextField.set_y((this.actualHeight - mainTextFieldHeight) / 2.0);
			this._lineNumberTextField.set_y(this._mainTextField.get_y() + this._mainTextField.getLineMetrics(0).ascent - this._lineNumberTextField.getLineMetrics(0).ascent);
		} else {
			this._lineNumberTextField.set_y((this.actualHeight - this._lineNumberTextField.get_height()) / 2.0);
			this._mainTextField.set_y(this._lineNumberTextField.get_y() + this._lineNumberTextField.getLineMetrics(0).ascent - this._mainTextField.getLineMetrics(0).ascent);
		}
		this.refreshCaretPosition();
		this.refreshSelectedTextBackgroundSkins();
		this.refreshSearchResultBackgroundSkins();
	}
	,refreshCaretTimer: function() {
		this._caretTimer.reset();
		if(this._textEditorHasFocus && this._caretIndex != -1) {
			this._caretTimer.start();
		}
	}
	,refreshCurrentSearchResults: function() {
		this._currentSearchResults.length = 0;
		if(this.get_highlightAllFindResults() && this._searchResult != null) {
			var _g = 0;
			var _g1 = this._searchResult.results;
			while(_g < _g1.length) {
				var result = _g1[_g];
				++_g;
				if(this.get_lineIndex() < result.startLine || this.get_lineIndex() > result.endLine) {
					continue;
				}
				this._currentSearchResults.push(result);
			}
		}
	}
	,textLineRenderer_mainTextField_rollOverHandler: function(event) {
		this._oldMouseCursor = openfl_ui_Mouse.get_cursor();
		openfl_ui_Mouse.set_cursor("ibeam");
	}
	,textLineRenderer_mainTextField_rollOutHandler: function(event) {
		openfl_ui_Mouse.set_cursor(this._oldMouseCursor);
		this._oldMouseCursor = null;
	}
	,textLineRenderer_mouseDownHandler: function(event) {
		if(!this._allowToggleBreakpoints) {
			return;
		}
		if(this.get_mouseX() > this._lineNumberTextField.get_x()) {
			return;
		}
		this.dispatchEvent(new moonshine_editor_text_events_TextEditorLineEvent(moonshine_editor_text_events_TextEditorLineEvent.TOGGLE_BREAKPOINT,this.get_lineIndex()));
	}
	,textLineRenderer_caretTimer_timerHandler: function(event) {
		if(this._caretSkin == null) {
			return;
		}
		this._caretSkin.set_visible(!this._caretSkin.get_visible());
	}
	,textLineRenderer_lineNumberTextField_mouseDownHandler: function(event) {
		this.dispatchEvent(new moonshine_editor_text_events_TextEditorLineEvent(moonshine_editor_text_events_TextEditorLineEvent.SELECT_LINE,this.get_lineIndex()));
	}
	,textLineRenderer_textEditorOwner_scrollHandler: function(event) {
		var textEditor = js_Boot.__cast(event.currentTarget , moonshine_editor_text_TextEditor);
		if(this._oldScrollX == textEditor.get_scrollX()) {
			return;
		}
		this.setInvalid(feathers_core_InvalidationFlag.SCROLL);
	}
	,__embedFonts: null
	,get_embedFonts: function() {
		return this.__embedFonts;
	}
	,set_embedFonts: function(value) {
		if(!this.setStyle("embedFonts")) {
			return this.__embedFonts;
		}
		if(this.__embedFonts == value) {
			return this.__embedFonts;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_embedFonts);
		this.__embedFonts = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__embedFonts;
	}
	,clearStyle_embedFonts: function() {
		this.set_embedFonts(false);
		return this.get_embedFonts();
	}
	,__lineNumberTextFormat: null
	,get_lineNumberTextFormat: function() {
		return this.__lineNumberTextFormat;
	}
	,set_lineNumberTextFormat: function(value) {
		if(!this.setStyle("lineNumberTextFormat")) {
			return this.__lineNumberTextFormat;
		}
		if(this.__lineNumberTextFormat == value) {
			return this.__lineNumberTextFormat;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_lineNumberTextFormat);
		this.__lineNumberTextFormat = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__lineNumberTextFormat;
	}
	,clearStyle_lineNumberTextFormat: function() {
		this.set_lineNumberTextFormat(null);
		return this.get_lineNumberTextFormat();
	}
	,__gutterBackgroundSkin: null
	,get_gutterBackgroundSkin: function() {
		return this.__gutterBackgroundSkin;
	}
	,set_gutterBackgroundSkin: function(value) {
		if(!this.setStyle("gutterBackgroundSkin")) {
			return this.__gutterBackgroundSkin;
		}
		if(this.__gutterBackgroundSkin == value) {
			return this.__gutterBackgroundSkin;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_gutterBackgroundSkin);
		this.__gutterBackgroundSkin = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__gutterBackgroundSkin;
	}
	,clearStyle_gutterBackgroundSkin: function() {
		this.set_gutterBackgroundSkin(null);
		return this.get_gutterBackgroundSkin();
	}
	,__breakpointGutterBackgroundSkin: null
	,get_breakpointGutterBackgroundSkin: function() {
		return this.__breakpointGutterBackgroundSkin;
	}
	,set_breakpointGutterBackgroundSkin: function(value) {
		if(!this.setStyle("breakpointGutterBackgroundSkin")) {
			return this.__breakpointGutterBackgroundSkin;
		}
		if(this.__breakpointGutterBackgroundSkin == value) {
			return this.__breakpointGutterBackgroundSkin;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_breakpointGutterBackgroundSkin);
		this.__breakpointGutterBackgroundSkin = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__breakpointGutterBackgroundSkin;
	}
	,clearStyle_breakpointGutterBackgroundSkin: function() {
		this.set_breakpointGutterBackgroundSkin(null);
		return this.get_breakpointGutterBackgroundSkin();
	}
	,__backgroundSkin: null
	,get_backgroundSkin: function() {
		return this.__backgroundSkin;
	}
	,set_backgroundSkin: function(value) {
		if(!this.setStyle("backgroundSkin")) {
			return this.__backgroundSkin;
		}
		if(this.__backgroundSkin == value) {
			return this.__backgroundSkin;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_backgroundSkin);
		this.__backgroundSkin = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__backgroundSkin;
	}
	,clearStyle_backgroundSkin: function() {
		this.set_backgroundSkin(null);
		return this.get_backgroundSkin();
	}
	,__focusedBackgroundSkin: null
	,get_focusedBackgroundSkin: function() {
		return this.__focusedBackgroundSkin;
	}
	,set_focusedBackgroundSkin: function(value) {
		if(!this.setStyle("focusedBackgroundSkin")) {
			return this.__focusedBackgroundSkin;
		}
		if(this.__focusedBackgroundSkin == value) {
			return this.__focusedBackgroundSkin;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_focusedBackgroundSkin);
		this.__focusedBackgroundSkin = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__focusedBackgroundSkin;
	}
	,clearStyle_focusedBackgroundSkin: function() {
		this.set_focusedBackgroundSkin(null);
		return this.get_focusedBackgroundSkin();
	}
	,__debuggerStoppedBackgroundSkin: null
	,get_debuggerStoppedBackgroundSkin: function() {
		return this.__debuggerStoppedBackgroundSkin;
	}
	,set_debuggerStoppedBackgroundSkin: function(value) {
		if(!this.setStyle("debuggerStoppedBackgroundSkin")) {
			return this.__debuggerStoppedBackgroundSkin;
		}
		if(this.__debuggerStoppedBackgroundSkin == value) {
			return this.__debuggerStoppedBackgroundSkin;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_debuggerStoppedBackgroundSkin);
		this.__debuggerStoppedBackgroundSkin = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__debuggerStoppedBackgroundSkin;
	}
	,clearStyle_debuggerStoppedBackgroundSkin: function() {
		this.set_debuggerStoppedBackgroundSkin(null);
		return this.get_debuggerStoppedBackgroundSkin();
	}
	,__selectedTextBackgroundSkin: null
	,get_selectedTextBackgroundSkin: function() {
		return this.__selectedTextBackgroundSkin;
	}
	,set_selectedTextBackgroundSkin: function(value) {
		if(!this.setStyle("selectedTextBackgroundSkin")) {
			return this.__selectedTextBackgroundSkin;
		}
		if(this.__selectedTextBackgroundSkin == value) {
			return this.__selectedTextBackgroundSkin;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_selectedTextBackgroundSkin);
		this.__selectedTextBackgroundSkin = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__selectedTextBackgroundSkin;
	}
	,clearStyle_selectedTextBackgroundSkin: function() {
		this.set_selectedTextBackgroundSkin(null);
		return this.get_selectedTextBackgroundSkin();
	}
	,__selectedTextBackgroundSkinFactory: null
	,get_selectedTextBackgroundSkinFactory: function() {
		return this.__selectedTextBackgroundSkinFactory;
	}
	,set_selectedTextBackgroundSkinFactory: function(value) {
		if(!this.setStyle("selectedTextBackgroundSkinFactory")) {
			return this.__selectedTextBackgroundSkinFactory;
		}
		if(this.__selectedTextBackgroundSkinFactory == value) {
			return this.__selectedTextBackgroundSkinFactory;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_selectedTextBackgroundSkinFactory);
		this.__selectedTextBackgroundSkinFactory = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__selectedTextBackgroundSkinFactory;
	}
	,clearStyle_selectedTextBackgroundSkinFactory: function() {
		this.set_selectedTextBackgroundSkinFactory(null);
		return this.get_selectedTextBackgroundSkinFactory();
	}
	,__selectedTextUnfocusedBackgroundSkin: null
	,get_selectedTextUnfocusedBackgroundSkin: function() {
		return this.__selectedTextUnfocusedBackgroundSkin;
	}
	,set_selectedTextUnfocusedBackgroundSkin: function(value) {
		if(!this.setStyle("selectedTextUnfocusedBackgroundSkin")) {
			return this.__selectedTextUnfocusedBackgroundSkin;
		}
		if(this.__selectedTextUnfocusedBackgroundSkin == value) {
			return this.__selectedTextUnfocusedBackgroundSkin;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_selectedTextUnfocusedBackgroundSkin);
		this.__selectedTextUnfocusedBackgroundSkin = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__selectedTextUnfocusedBackgroundSkin;
	}
	,clearStyle_selectedTextUnfocusedBackgroundSkin: function() {
		this.set_selectedTextUnfocusedBackgroundSkin(null);
		return this.get_selectedTextUnfocusedBackgroundSkin();
	}
	,__selectedTextUnfocusedBackgroundSkinFactory: null
	,get_selectedTextUnfocusedBackgroundSkinFactory: function() {
		return this.__selectedTextUnfocusedBackgroundSkinFactory;
	}
	,set_selectedTextUnfocusedBackgroundSkinFactory: function(value) {
		if(!this.setStyle("selectedTextUnfocusedBackgroundSkinFactory")) {
			return this.__selectedTextUnfocusedBackgroundSkinFactory;
		}
		if(this.__selectedTextUnfocusedBackgroundSkinFactory == value) {
			return this.__selectedTextUnfocusedBackgroundSkinFactory;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_selectedTextUnfocusedBackgroundSkinFactory);
		this.__selectedTextUnfocusedBackgroundSkinFactory = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__selectedTextUnfocusedBackgroundSkinFactory;
	}
	,clearStyle_selectedTextUnfocusedBackgroundSkinFactory: function() {
		this.set_selectedTextUnfocusedBackgroundSkinFactory(null);
		return this.get_selectedTextUnfocusedBackgroundSkinFactory();
	}
	,__searchResultBackgroundSkinFactory: null
	,get_searchResultBackgroundSkinFactory: function() {
		return this.__searchResultBackgroundSkinFactory;
	}
	,set_searchResultBackgroundSkinFactory: function(value) {
		if(!this.setStyle("searchResultBackgroundSkinFactory")) {
			return this.__searchResultBackgroundSkinFactory;
		}
		if(this.__searchResultBackgroundSkinFactory == value) {
			return this.__searchResultBackgroundSkinFactory;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_searchResultBackgroundSkinFactory);
		this.__searchResultBackgroundSkinFactory = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__searchResultBackgroundSkinFactory;
	}
	,clearStyle_searchResultBackgroundSkinFactory: function() {
		this.set_searchResultBackgroundSkinFactory(null);
		return this.get_searchResultBackgroundSkinFactory();
	}
	,__textStyles: null
	,get_textStyles: function() {
		return this.__textStyles;
	}
	,set_textStyles: function(value) {
		if(!this.setStyle("textStyles")) {
			return this.__textStyles;
		}
		if(this.__textStyles == value) {
			return this.__textStyles;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_textStyles);
		this.__textStyles = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__textStyles;
	}
	,clearStyle_textStyles: function() {
		this.set_textStyles(null);
		return this.get_textStyles();
	}
	,__breakpointSkin: null
	,get_breakpointSkin: function() {
		return this.__breakpointSkin;
	}
	,set_breakpointSkin: function(value) {
		if(!this.setStyle("breakpointSkin")) {
			return this.__breakpointSkin;
		}
		if(this.__breakpointSkin == value) {
			return this.__breakpointSkin;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_breakpointSkin);
		this.__breakpointSkin = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__breakpointSkin;
	}
	,clearStyle_breakpointSkin: function() {
		this.set_breakpointSkin(null);
		return this.get_breakpointSkin();
	}
	,__unverifiedBreakpointSkin: null
	,get_unverifiedBreakpointSkin: function() {
		return this.__unverifiedBreakpointSkin;
	}
	,set_unverifiedBreakpointSkin: function(value) {
		if(!this.setStyle("unverifiedBreakpointSkin")) {
			return this.__unverifiedBreakpointSkin;
		}
		if(this.__unverifiedBreakpointSkin == value) {
			return this.__unverifiedBreakpointSkin;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_unverifiedBreakpointSkin);
		this.__unverifiedBreakpointSkin = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__unverifiedBreakpointSkin;
	}
	,clearStyle_unverifiedBreakpointSkin: function() {
		this.set_unverifiedBreakpointSkin(null);
		return this.get_unverifiedBreakpointSkin();
	}
	,__gutterGap: null
	,get_gutterGap: function() {
		return this.__gutterGap;
	}
	,set_gutterGap: function(value) {
		if(!this.setStyle("gutterGap")) {
			return this.__gutterGap;
		}
		if(this.__gutterGap == value) {
			return this.__gutterGap;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_gutterGap);
		this.__gutterGap = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__gutterGap;
	}
	,clearStyle_gutterGap: function() {
		this.set_gutterGap(0.0);
		return this.get_gutterGap();
	}
	,__gutterPaddingLeft: null
	,get_gutterPaddingLeft: function() {
		return this.__gutterPaddingLeft;
	}
	,set_gutterPaddingLeft: function(value) {
		if(!this.setStyle("gutterPaddingLeft")) {
			return this.__gutterPaddingLeft;
		}
		if(this.__gutterPaddingLeft == value) {
			return this.__gutterPaddingLeft;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_gutterPaddingLeft);
		this.__gutterPaddingLeft = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__gutterPaddingLeft;
	}
	,clearStyle_gutterPaddingLeft: function() {
		this.set_gutterPaddingLeft(0.0);
		return this.get_gutterPaddingLeft();
	}
	,__gutterPaddingRight: null
	,get_gutterPaddingRight: function() {
		return this.__gutterPaddingRight;
	}
	,set_gutterPaddingRight: function(value) {
		if(!this.setStyle("gutterPaddingRight")) {
			return this.__gutterPaddingRight;
		}
		if(this.__gutterPaddingRight == value) {
			return this.__gutterPaddingRight;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_gutterPaddingRight);
		this.__gutterPaddingRight = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__gutterPaddingRight;
	}
	,clearStyle_gutterPaddingRight: function() {
		this.set_gutterPaddingRight(0.0);
		return this.get_gutterPaddingRight();
	}
	,__highlightAllFindResults: null
	,get_highlightAllFindResults: function() {
		return this.__highlightAllFindResults;
	}
	,set_highlightAllFindResults: function(value) {
		if(!this.setStyle("highlightAllFindResults")) {
			return this.__highlightAllFindResults;
		}
		if(this.__highlightAllFindResults == value) {
			return this.__highlightAllFindResults;
		}
		this._previousClearStyle = $bind(this,this.clearStyle_highlightAllFindResults);
		this.__highlightAllFindResults = value;
		this.setInvalid(feathers_core_InvalidationFlag.STYLES);
		return this.__highlightAllFindResults;
	}
	,clearStyle_highlightAllFindResults: function() {
		this.set_highlightAllFindResults(false);
		return this.get_highlightAllFindResults();
	}
	,get_styleContext: function() {
		return moonshine_editor_text_lines_TextLineRenderer;
	}
	,__class__: moonshine_editor_text_lines_TextLineRenderer
	,__properties__: $extend(feathers_core_FeathersControl.prototype.__properties__,{set_textEditorOwner:"set_textEditorOwner",get_textEditorOwner:"get_textEditorOwner",set_searchResult:"set_searchResult",get_searchResult:"get_searchResult",set_highlightAllFindResults:"set_highlightAllFindResults",get_highlightAllFindResults:"get_highlightAllFindResults",set_linkEndChar:"set_linkEndChar",get_linkEndChar:"get_linkEndChar",set_linkStartChar:"set_linkStartChar",get_linkStartChar:"get_linkStartChar",set_selectionEndIndex:"set_selectionEndIndex",get_selectionEndIndex:"get_selectionEndIndex",set_selectionStartIndex:"set_selectionStartIndex",get_selectionStartIndex:"get_selectionStartIndex",set_textEditorHasFocus:"set_textEditorHasFocus",get_textEditorHasFocus:"get_textEditorHasFocus",set_caretIndex:"set_caretIndex",get_caretIndex:"get_caretIndex",set_gutterPaddingRight:"set_gutterPaddingRight",get_gutterPaddingRight:"get_gutterPaddingRight",set_gutterPaddingLeft:"set_gutterPaddingLeft",get_gutterPaddingLeft:"get_gutterPaddingLeft",set_gutterGap:"set_gutterGap",get_gutterGap:"get_gutterGap",set_unverifiedBreakpointSkin:"set_unverifiedBreakpointSkin",get_unverifiedBreakpointSkin:"get_unverifiedBreakpointSkin",set_breakpointSkin:"set_breakpointSkin",get_breakpointSkin:"get_breakpointSkin",set_defaultTextStyleContext:"set_defaultTextStyleContext",get_defaultTextStyleContext:"get_defaultTextStyleContext",set_textStyles:"set_textStyles",get_textStyles:"get_textStyles",set_searchResultBackgroundSkinFactory:"set_searchResultBackgroundSkinFactory",get_searchResultBackgroundSkinFactory:"get_searchResultBackgroundSkinFactory",set_selectedTextUnfocusedBackgroundSkinFactory:"set_selectedTextUnfocusedBackgroundSkinFactory",get_selectedTextUnfocusedBackgroundSkinFactory:"get_selectedTextUnfocusedBackgroundSkinFactory",set_selectedTextUnfocusedBackgroundSkin:"set_selectedTextUnfocusedBackgroundSkin",get_selectedTextUnfocusedBackgroundSkin:"get_selectedTextUnfocusedBackgroundSkin",set_selectedTextBackgroundSkinFactory:"set_selectedTextBackgroundSkinFactory",get_selectedTextBackgroundSkinFactory:"get_selectedTextBackgroundSkinFactory",set_selectedTextBackgroundSkin:"set_selectedTextBackgroundSkin",get_selectedTextBackgroundSkin:"get_selectedTextBackgroundSkin",set_debuggerStoppedBackgroundSkin:"set_debuggerStoppedBackgroundSkin",get_debuggerStoppedBackgroundSkin:"get_debuggerStoppedBackgroundSkin",set_focusedBackgroundSkin:"set_focusedBackgroundSkin",get_focusedBackgroundSkin:"get_focusedBackgroundSkin",set_backgroundSkin:"set_backgroundSkin",get_backgroundSkin:"get_backgroundSkin",set_breakpointGutterBackgroundSkin:"set_breakpointGutterBackgroundSkin",get_breakpointGutterBackgroundSkin:"get_breakpointGutterBackgroundSkin",set_gutterBackgroundSkin:"set_gutterBackgroundSkin",get_gutterBackgroundSkin:"get_gutterBackgroundSkin",set_lineNumberTextFormat:"set_lineNumberTextFormat",get_lineNumberTextFormat:"get_lineNumberTextFormat",set_embedFonts:"set_embedFonts",get_embedFonts:"get_embedFonts",set_wordWrap:"set_wordWrap",get_wordWrap:"get_wordWrap",set_allowToggleBreakpoints:"set_allowToggleBreakpoints",get_allowToggleBreakpoints:"get_allowToggleBreakpoints",set_showLineNumbers:"set_showLineNumbers",get_showLineNumbers:"get_showLineNumbers",set_lineNumberWidth:"set_lineNumberWidth",get_lineNumberWidth:"get_lineNumberWidth",get_gutterWidth:"get_gutterWidth",get_caretX:"get_caretX",set_debuggerStopped:"set_debuggerStopped",get_debuggerStopped:"get_debuggerStopped",set_breakpointVerified:"set_breakpointVerified",get_breakpointVerified:"get_breakpointVerified",set_breakpoint:"set_breakpoint",get_breakpoint:"get_breakpoint",set_styleRanges:"set_styleRanges",get_styleRanges:"get_styleRanges",set_tabWidth:"set_tabWidth",get_tabWidth:"get_tabWidth",set_numLines:"set_numLines",get_numLines:"get_numLines",set_minLineNumberCharacters:"set_minLineNumberCharacters",get_minLineNumberCharacters:"get_minLineNumberCharacters",set_lineIndex:"set_lineIndex",get_lineIndex:"get_lineIndex",set_text:"set_text",get_text:"get_text"})
});
var moonshine_editor_text_managers_ClipboardManager = function(textEditor) {
	this._textEditor = textEditor;
	this._textEditor.addEventListener("copy",$bind(this,this.clipboardManager_textEditor_copyHandler),false,0,true);
	this._textEditor.addEventListener("cut",$bind(this,this.clipboardManager_textEditor_cutHandler),false,0,true);
};
$hxClasses["moonshine.editor.text.managers.ClipboardManager"] = moonshine_editor_text_managers_ClipboardManager;
moonshine_editor_text_managers_ClipboardManager.__name__ = "moonshine.editor.text.managers.ClipboardManager";
moonshine_editor_text_managers_ClipboardManager.prototype = {
	_textEditor: null
	,copy: function() {
		if(!this._textEditor.get_hasSelection()) {
			return;
		}
		openfl_desktop_Clipboard.get_generalClipboard().setData(2,this._textEditor.get_selectedText(),false);
	}
	,cut: function() {
		if(this._textEditor.get_readOnly()) {
			throw new openfl_errors_IllegalOperationError("Cannot cut when editor is read-only");
		}
		this.copy();
		if(this._textEditor.get_hasSelection()) {
			var change = moonshine_editor_text_utils_TextEditorUtil.deleteSelection(this._textEditor);
			if(change != null) {
				this._textEditor.dispatchEvent(new moonshine_editor_text_events_TextEditorChangeEvent(moonshine_editor_text_events_TextEditorChangeEvent.TEXT_CHANGE,[change]));
			}
		}
	}
	,paste: function() {
		if(this._textEditor.get_readOnly()) {
			throw new openfl_errors_IllegalOperationError("Cannot paste when editor is read-only");
		}
		if(!openfl_desktop_Clipboard.get_generalClipboard().hasFormat(2)) {
			return;
		}
		var newText = openfl_desktop_Clipboard.get_generalClipboard().getData(2);
		var this1 = newText;
		var change = moonshine_editor_text_utils_TextEditorUtil.deleteSelection(this._textEditor,this1 == null ? null : Std.string(this1));
		if(change != null) {
			this._textEditor.dispatchEvent(new moonshine_editor_text_events_TextEditorChangeEvent(moonshine_editor_text_events_TextEditorChangeEvent.TEXT_CHANGE,[change]));
		}
	}
	,clipboardManager_textEditor_cutHandler: function(event) {
		if(this._textEditor.get_readOnly() || event.isDefaultPrevented()) {
			return;
		}
		this.cut();
	}
	,clipboardManager_textEditor_copyHandler: function(event) {
		if(event.isDefaultPrevented()) {
			return;
		}
		this.copy();
	}
	,clipboardManager_textEditor_pasteHandler: function(event) {
		if(this._textEditor.get_readOnly() || event.isDefaultPrevented()) {
			return;
		}
		this.paste();
	}
	,__class__: moonshine_editor_text_managers_ClipboardManager
};
var moonshine_editor_text_managers_ColorManager = function(textEditor) {
	this._listening = false;
	this._ranges = [];
	this._textEditor = textEditor;
	this._textEditor.addEventListener(moonshine_editor_text_events_TextEditorChangeEvent.TEXT_CHANGE,$bind(this,this.colorManager_textEditor_textChangeHandler),false,0,true);
};
$hxClasses["moonshine.editor.text.managers.ColorManager"] = moonshine_editor_text_managers_ColorManager;
moonshine_editor_text_managers_ColorManager.__name__ = "moonshine.editor.text.managers.ColorManager";
moonshine_editor_text_managers_ColorManager.prototype = {
	_textEditor: null
	,_parser: null
	,get_parser: function() {
		return this._parser;
	}
	,set_parser: function(value) {
		if(this._parser == value) {
			return this._parser;
		}
		this._parser = value;
		this.reset();
		return this._parser;
	}
	,_ranges: null
	,_listening: null
	,reset: function() {
		this._ranges.length = 0;
		this.invalidate(0,this._textEditor.get_lines().get_length() - 1);
	}
	,invalidate: function(line,addCount,silent) {
		if(silent == null) {
			silent = false;
		}
		if(addCount == null) {
			addCount = 0;
		}
		var merged = false;
		var r = this._ranges.length - 1;
		while(r >= 0) {
			var range = this._ranges[r];
			if(range.end < line) {
				break;
			}
			if(range.start > line) {
				range.start += addCount;
				range.end += addCount;
			} else {
				merged = true;
				range.end += addCount;
				break;
			}
			--r;
		}
		if(!merged) {
			var _this = this._ranges;
			var x = new moonshine_editor_text_managers__$ColorManager_LineRange(line,line + addCount);
			_this.splice(r + 1,0,x);
		}
		if(!this._listening && !silent) {
			this.startListening();
			this.process();
		}
	}
	,process: function() {
		var count = this._textEditor.get_lines().get_length();
		var timeLimit = openfl_Lib.getTimer() + moonshine_editor_text_managers_ColorManager.CHUNK_TIMESPAN;
		while(this._ranges.length > 0) {
			var range = this._ranges[0];
			var rangeStart = range.start;
			var rangeEnd = range.end;
			if(this._parser != null) {
				var prevLine = rangeStart > 0 ? this._textEditor.get_lines().get(rangeStart - 1) : null;
				var prevEndContext = this.getEndContext(prevLine != null ? prevLine.styleRanges : null);
				this._parser.setContext(prevEndContext);
			}
			var _g = rangeStart;
			var _g1 = rangeEnd + 1;
			while(_g < _g1) {
				var i = _g++;
				var line = this._textEditor.get_lines().get(i);
				var oldMeta = line.styleRanges;
				var newMeta = this._parser != null ? this._parser.parse(line.text + "\n",i,0,i,line.text.length) : null;
				if(oldMeta == null || newMeta == null || oldMeta.join(",") != newMeta.join(",")) {
					line.styleRanges = newMeta;
					this._textEditor.get_lines().updateAt(i);
				}
				if(i == rangeEnd && i < count - 1) {
					var endContext = this.getEndContext(line.styleRanges);
					var nextLine = this._textEditor.get_lines().get(i + 1);
					var startContext = this.getStartContext(nextLine.styleRanges);
					if(endContext != startContext) {
						this.invalidate(i + 1);
					}
				}
				if(openfl_Lib.getTimer() > timeLimit) {
					if(i == rangeEnd) {
						this._ranges.shift();
					} else {
						range.start = i + 1;
					}
					return;
				}
			}
			this._ranges.shift();
		}
		this.stopListening();
	}
	,getStartContext: function(styleRanges) {
		if(styleRanges != null && styleRanges.length > 1) {
			return styleRanges[1];
		}
		if(this._parser != null) {
			return this._parser.get_defaultContext();
		}
		return 0;
	}
	,getEndContext: function(styleRanges) {
		if(styleRanges != null && styleRanges.length > 1) {
			return styleRanges[styleRanges.length - 1];
		}
		if(this._parser != null) {
			return this._parser.get_defaultContext();
		}
		return 0;
	}
	,applyChange: function(change) {
		this.applyChangeRemove(change);
		if(change.get_newText() != null) {
			this.applyChangeInsert(change);
		}
		if(this._ranges.length == 0) {
			this.stopListening();
		} else if(!this._listening) {
			this.startListening();
			this.process();
		}
	}
	,applyChangeInsert: function(change) {
		var numLines = new EReg("\r?\n|\r","g").split(change.get_newText()).length;
		this.invalidate(change.get_startLine(),numLines - 1,true);
	}
	,applyChangeRemove: function(change) {
		var r = this._ranges.length - 1;
		while(r >= 0) {
			var range = this._ranges[r];
			if(change.get_startLine() > range.end) {
				break;
			} else {
				var lines = (Math.min(change.get_endLine(),range.end) | 0) - change.get_startLine();
				range.start = Math.min(range.start,change.get_startLine()) | 0;
				range.end -= lines;
				if(range.end < range.start) {
					this._ranges.splice(r,1);
				}
			}
			--r;
		}
		if(change.get_startLine() != change.get_endLine() || change.get_startChar() != change.get_endChar()) {
			this.invalidate(change.get_startLine(),0,true);
		}
	}
	,startListening: function() {
		if(this._listening) {
			return;
		}
		this._listening = true;
		this._textEditor.addEventListener("enterFrame",$bind(this,this.colorManager_textEditor_enterFrameHandler),false,0,true);
	}
	,stopListening: function() {
		if(!this._listening) {
			return;
		}
		this._listening = false;
		this._textEditor.removeEventListener("enterFrame",$bind(this,this.colorManager_textEditor_enterFrameHandler));
	}
	,colorManager_textEditor_textChangeHandler: function(event) {
		if(this._ranges.length == 0) {
			this.stopListening();
		} else if(!this._listening) {
			this.startListening();
			this.process();
		}
		var _g = 0;
		var _g1 = event.changes;
		while(_g < _g1.length) {
			var change = _g1[_g];
			++_g;
			this.applyChange(change);
		}
	}
	,colorManager_textEditor_enterFrameHandler: function(event) {
		this.process();
	}
	,__class__: moonshine_editor_text_managers_ColorManager
	,__properties__: {set_parser:"set_parser",get_parser:"get_parser"}
};
var moonshine_editor_text_managers__$ColorManager_LineRange = function(start,end) {
	this.start = start;
	this.end = end;
};
$hxClasses["moonshine.editor.text.managers._ColorManager.LineRange"] = moonshine_editor_text_managers__$ColorManager_LineRange;
moonshine_editor_text_managers__$ColorManager_LineRange.__name__ = "moonshine.editor.text.managers._ColorManager.LineRange";
moonshine_editor_text_managers__$ColorManager_LineRange.prototype = {
	start: null
	,end: null
	,__class__: moonshine_editor_text_managers__$ColorManager_LineRange
};
var moonshine_editor_text_managers_EditManager = function(textEditor) {
	this._activeAutoClosingPairEndCharIndex = -1;
	this._activeAutoClosingPairStartCharIndex = -1;
	this._activeAutoClosingPairLineIndex = -1;
	this._textEditor = textEditor;
	this._textEditor.addEventListener("keyDown",$bind(this,this.editManager_textEditor_keyDownHandler),false,0,true);
	this._textEditor.addEventListener("textInput",$bind(this,this.editManager_textEditor_textInputHandler),false,0,true);
	this._textEditor.addEventListener(moonshine_editor_text_events_TextEditorChangeEvent.TEXT_CHANGE,$bind(this,this.editManager_textEditor_textChangePriorityHandler),false,100,true);
	this._textEditor.addEventListener(moonshine_editor_text_events_TextEditorChangeEvent.TEXT_CHANGE,$bind(this,this.editManager_textEditor_textChangeHandler),false,0,true);
	this._textEditor.addEventListener(moonshine_editor_text_events_TextEditorEvent.SELECTION_CHANGE,$bind(this,this.editManager_textEditor_selectionChangeHandler),false,0,true);
	this._textEditor.addEventListener("clear",$bind(this,this.editManager_textEditor_clearHandler),false,0,true);
};
$hxClasses["moonshine.editor.text.managers.EditManager"] = moonshine_editor_text_managers_EditManager;
moonshine_editor_text_managers_EditManager.__name__ = "moonshine.editor.text.managers.EditManager";
moonshine_editor_text_managers_EditManager.prototype = {
	_textEditor: null
	,_activeAutoClosingPair: null
	,_activeAutoClosingPairLineIndex: null
	,_activeAutoClosingPairStartCharIndex: null
	,_activeAutoClosingPairEndCharIndex: null
	,toggleLineComment: function() {
		var lineComment = this._textEditor.lineComment;
		var endLineComment = null;
		if(lineComment == null || lineComment.length == 0) {
			var blockComment = this._textEditor.blockComment;
			if(blockComment == null || blockComment.length < 2) {
				return;
			}
			lineComment = blockComment[0];
			endLineComment = blockComment[1];
		}
		var startLine = this._textEditor.get_caretLineIndex();
		var endLine = startLine;
		if(this._textEditor.get_selectionStartLineIndex() != this._textEditor.get_selectionEndLineIndex()) {
			startLine = this._textEditor.get_selectionStartLineIndex();
			endLine = this._textEditor.get_selectionEndLineIndex();
		}
		if(endLine < startLine) {
			var temp = startLine;
			startLine = endLine;
			endLine = temp;
		}
		var removeComment = true;
		var endCommentIndex = -1;
		var startsWithComment = new EReg("^\\s*" + lineComment.replace(EReg.escapeRe,"\\$&"),"");
		var _g = startLine;
		var _g1 = endLine + 1;
		while(_g < _g1) {
			var i = _g++;
			var lineText = this._textEditor.get_lines().get(i).text;
			if(!startsWithComment.match(lineText)) {
				removeComment = false;
			} else if(endLineComment != null) {
				endCommentIndex = lineText.lastIndexOf(endLineComment);
				if(endCommentIndex == -1) {
					removeComment = false;
				}
			}
		}
		var newSelectionStartLineIndex = this._textEditor.get_selectionStartLineIndex();
		var newSelectionStartCharIndex = this._textEditor.get_selectionStartCharIndex();
		var newSelectionEndLineIndex = this._textEditor.get_selectionEndLineIndex();
		var newSelectionEndCharIndex = this._textEditor.get_selectionEndCharIndex();
		if(newSelectionStartCharIndex == -1) {
			newSelectionStartLineIndex = this._textEditor.get_caretLineIndex();
			newSelectionStartCharIndex = this._textEditor.get_caretCharIndex();
			newSelectionEndLineIndex = newSelectionStartLineIndex;
			newSelectionEndCharIndex = newSelectionStartCharIndex;
		}
		var minIndent = 2147483647;
		var _g = startLine;
		var _g1 = endLine + 1;
		while(_g < _g1) {
			var i = _g++;
			var lineText = this._textEditor.get_lines().get(i).text;
			var indent = moonshine_editor_text_utils_TextUtil.getIndentCountAtStartOfLine(lineText,this._textEditor.get_tabWidth());
			if(minIndent > indent) {
				minIndent = indent;
			}
		}
		var startingWhitespace = new EReg("^\\s*","");
		var changes = [];
		var _g = startLine;
		var _g1 = endLine + 1;
		while(_g < _g1) {
			var i = _g++;
			var lineText = this._textEditor.get_lines().get(i).text;
			if(!startingWhitespace.match(lineText)) {
				continue;
			}
			var whitespaceSize = startingWhitespace.matched(0).length;
			if(removeComment) {
				var commentSize = lineComment.length;
				if(lineText.charAt(whitespaceSize + commentSize) == " ") {
					++commentSize;
				}
				changes.push(new moonshine_editor_text_changes_TextEditorChange(i,whitespaceSize,i,whitespaceSize + commentSize));
				if(endLineComment != null) {
					changes.push(new moonshine_editor_text_changes_TextEditorChange(i,endCommentIndex,i,endCommentIndex + endLineComment.length));
				}
				if(i == newSelectionStartLineIndex) {
					newSelectionStartCharIndex -= commentSize;
				}
				if(i == newSelectionEndLineIndex) {
					newSelectionEndCharIndex -= commentSize;
				}
			} else {
				var indent = moonshine_editor_text_utils_TextUtil.getIndentCountAtStartOfLine(lineText,this._textEditor.get_tabWidth());
				if(indent > minIndent) {
					var i1 = whitespaceSize - 1;
					var spaceCount = 0;
					while(i1 >= 0 && indent > minIndent) {
						var char = lineText.charAt(i1);
						if(char == "\t") {
							--indent;
							--whitespaceSize;
							continue;
						}
						++spaceCount;
						if(spaceCount == this._textEditor.get_tabWidth()) {
							--indent;
							whitespaceSize -= spaceCount;
							spaceCount = 0;
						}
						--i1;
					}
				}
				changes.push(new moonshine_editor_text_changes_TextEditorChange(i,whitespaceSize,i,whitespaceSize,lineComment + " "));
				if(endLineComment != null) {
					changes.push(new moonshine_editor_text_changes_TextEditorChange(i,lineText.length,i,lineText.length," " + endLineComment));
				}
				var commentSize1 = lineComment.length + 1;
				if(i == newSelectionStartLineIndex) {
					newSelectionStartCharIndex += commentSize1;
				}
				if(i == newSelectionEndLineIndex) {
					newSelectionEndCharIndex += commentSize1;
				}
			}
		}
		this.dispatchChanges(changes);
		this._textEditor.setSelection(newSelectionStartLineIndex,newSelectionStartCharIndex,newSelectionEndLineIndex,newSelectionEndCharIndex);
	}
	,toggleBlockComment: function() {
		var blockComment = this._textEditor.blockComment;
		if(blockComment == null || blockComment.length < 2) {
			return;
		}
		var startLine = this._textEditor.get_caretLineIndex();
		var startChar = this._textEditor.get_caretCharIndex();
		var endLine = startLine;
		var endChar = startChar;
		if(this._textEditor.get_selectionStartLineIndex() != this._textEditor.get_selectionEndLineIndex() || this._textEditor.get_selectionStartCharIndex() != this._textEditor.get_selectionEndCharIndex()) {
			startLine = this._textEditor.get_selectionStartLineIndex();
			startChar = this._textEditor.get_selectionStartCharIndex();
			endLine = this._textEditor.get_selectionEndLineIndex();
			endChar = this._textEditor.get_selectionEndCharIndex();
		}
		if(endLine < startLine || endLine == startLine && endChar < startChar) {
			var temp = startLine;
			startLine = endLine;
			endLine = temp;
			temp = startChar;
			startChar = endChar;
			endChar = temp;
		}
		var blockStart = blockComment[0];
		var blockEnd = blockComment[1];
		var removeStartChar = -1;
		var removeEndChar = -1;
		var startLineText = this._textEditor.get_lines().get(startLine).text;
		var endLineText = this._textEditor.get_lines().get(endLine).text;
		var startIndex = startLineText.lastIndexOf(blockStart,startChar);
		if(startIndex != -1) {
			var endIndex = endLineText.indexOf(blockEnd,endChar);
			if(endIndex != -1) {
				removeStartChar = startIndex;
				removeEndChar = endIndex + blockEnd.length;
			}
		}
		var newSelectionStartChar = startChar;
		var newSelectionEndChar = endChar;
		var changes = [];
		if(removeStartChar != -1 && removeEndChar != -1) {
			var endCommentSize = blockEnd.length;
			if(endLineText.charAt(removeEndChar - blockEnd.length - 1) == " ") {
				++endCommentSize;
			}
			changes.push(new moonshine_editor_text_changes_TextEditorChange(endLine,removeEndChar - endCommentSize,endLine,removeEndChar));
			var startCommentSize = blockStart.length;
			if(startLineText.charAt(removeStartChar + blockEnd.length) == " ") {
				++startCommentSize;
			}
			changes.push(new moonshine_editor_text_changes_TextEditorChange(startLine,removeStartChar,startLine,removeStartChar + startCommentSize));
			newSelectionStartChar -= startCommentSize;
			if(startLine == endLine) {
				newSelectionEndChar -= startCommentSize;
			}
		} else {
			newSelectionStartChar += blockStart.length + 1;
			newSelectionEndChar += blockStart.length + 1;
			if(startLine == endLine && startChar == endChar) {
				changes.push(new moonshine_editor_text_changes_TextEditorChange(startLine,startChar,startLine,startChar,blockStart + "  " + blockEnd));
			} else {
				changes.push(new moonshine_editor_text_changes_TextEditorChange(endLine,endChar,endLine,endChar," " + blockEnd));
				changes.push(new moonshine_editor_text_changes_TextEditorChange(startLine,startChar,startLine,startChar,blockStart + " "));
			}
		}
		this.dispatchChanges(changes);
		this._textEditor.setSelection(startLine,newSelectionStartChar,endLine,newSelectionEndChar);
	}
	,indent: function(reverse) {
		if(this._textEditor.get_selectionStartLineIndex() != this._textEditor.get_selectionEndLineIndex()) {
			var changes = [];
			var startLine;
			var endLine;
			var startChar;
			var endChar;
			if(this._textEditor.get_selectionStartLineIndex() < this._textEditor.get_caretLineIndex()) {
				startLine = this._textEditor.get_selectionStartLineIndex();
				endLine = this._textEditor.get_caretLineIndex();
				startChar = this._textEditor.get_selectionStartCharIndex();
				endChar = this._textEditor.get_caretCharIndex();
			} else {
				startLine = this._textEditor.get_caretLineIndex();
				endLine = this._textEditor.get_selectionStartLineIndex();
				startChar = this._textEditor.get_caretCharIndex();
				endChar = this._textEditor.get_selectionStartCharIndex();
			}
			if(startChar == this._textEditor.get_lines().get(startLine).text.length) {
				++startLine;
			}
			if(endChar == 0) {
				--endLine;
			}
			var findStartingWhitespace = new EReg("^[ \t]+","");
			var newSelectedStartCharIndex = startChar;
			var newSelectedEndCharIndex = endChar;
			var line = startLine;
			while(line <= endLine) {
				var lineText = this._textEditor.get_lines().get(line).text;
				var startingWhitespace = "";
				if(findStartingWhitespace.match(lineText)) {
					startingWhitespace = findStartingWhitespace.matched(0);
				}
				if(reverse) {
					var currentIndentSize = moonshine_editor_text_utils_TextUtil.getIndentCountAtStartOfLine(startingWhitespace,this._textEditor.get_tabWidth(),true);
					if(currentIndentSize > 0) {
						var indentString = this.getIndentString();
						var newIndent = "";
						var _g = 0;
						var _g1 = currentIndentSize - 1;
						while(_g < _g1) {
							var i = _g++;
							newIndent += indentString;
						}
						changes.push(new moonshine_editor_text_changes_TextEditorChange(line,0,line,startingWhitespace.length,newIndent));
						if(line == startLine) {
							newSelectedStartCharIndex -= startingWhitespace.length;
							if(newSelectedStartCharIndex < 0) {
								newSelectedStartCharIndex = 0;
							}
							newSelectedStartCharIndex += newIndent.length;
						}
						if(line == endLine) {
							newSelectedEndCharIndex -= startingWhitespace.length;
							if(newSelectedEndCharIndex < 0) {
								newSelectedEndCharIndex = 0;
							}
							newSelectedEndCharIndex += newIndent.length;
						}
					}
				} else {
					var currentIndentSize1 = moonshine_editor_text_utils_TextUtil.getIndentCountAtStartOfLine(startingWhitespace,this._textEditor.get_tabWidth());
					var newIndentSize = Math.ceil(currentIndentSize1);
					if(newIndentSize == currentIndentSize1) {
						++newIndentSize;
					}
					var indentString1 = this.getIndentString();
					var newIndent1 = "";
					var _g2 = 0;
					var _g3 = newIndentSize;
					while(_g2 < _g3) {
						var i1 = _g2++;
						newIndent1 += indentString1;
					}
					changes.push(new moonshine_editor_text_changes_TextEditorChange(line,0,line,startingWhitespace.length,newIndent1));
					if(line == startLine) {
						newSelectedStartCharIndex -= startingWhitespace.length;
						if(newSelectedStartCharIndex < 0) {
							newSelectedStartCharIndex = 0;
						}
						newSelectedStartCharIndex += newIndent1.length;
					}
					if(line == endLine) {
						newSelectedEndCharIndex -= startingWhitespace.length;
						if(newSelectedEndCharIndex < 0) {
							newSelectedEndCharIndex = 0;
						}
						newSelectedEndCharIndex += newIndent1.length;
					}
				}
				++line;
			}
			if(changes.length > 0) {
				this.dispatchChanges(changes);
				this._textEditor.setSelection(startLine,newSelectedStartCharIndex,endLine,newSelectedEndCharIndex);
			}
		} else if(reverse) {
			var lineIndex = this._textEditor.get_caretLineIndex();
			var newSelectionStartCharIndex = this._textEditor.get_selectionStartCharIndex();
			var newSelectionEndCharIndex = this._textEditor.get_selectionEndCharIndex();
			if(newSelectionStartCharIndex == -1) {
				newSelectionStartCharIndex = this._textEditor.get_caretCharIndex();
				newSelectionEndCharIndex = this._textEditor.get_caretCharIndex();
			}
			var reverseChange = this.createDecreaseIndentTextEditorChange(lineIndex);
			if(reverseChange != null) {
				var difference = reverseChange.get_endChar() - reverseChange.get_startChar();
				newSelectionStartCharIndex -= difference;
				newSelectionEndCharIndex -= difference;
				if(newSelectionStartCharIndex < 0) {
					newSelectionStartCharIndex = 0;
				}
				if(newSelectionEndCharIndex < 0) {
					newSelectionEndCharIndex = 0;
				}
				this.dispatchChanges([reverseChange]);
				this._textEditor.setSelection(lineIndex,newSelectionStartCharIndex,lineIndex,newSelectionEndCharIndex);
			}
		} else {
			this.insertText(this.getIndentString());
		}
	}
	,isBetweenBrackets: function() {
		if(this._textEditor.brackets == null) {
			return false;
		}
		var line = this._textEditor.get_lines().get(this._textEditor.get_caretLineIndex());
		var charIndex = this._textEditor.get_caretCharIndex();
		if(charIndex == 0 || charIndex >= line.text.length) {
			return false;
		}
		var prevChar = line.text.charAt(charIndex - 1);
		var _g = 0;
		var _g1 = this._textEditor.brackets;
		while(_g < _g1.length) {
			var brackets = _g1[_g];
			++_g;
			if(brackets[0] == prevChar) {
				var nextChar = line.text.charAt(charIndex);
				if(brackets[1] == nextChar) {
					return true;
				}
			}
		}
		return false;
	}
	,findFullIndentForNewLine: function(currentLineIndex) {
		var findFullIndent = new EReg("^\\s*","");
		var i = currentLineIndex;
		while(i >= 0) {
			var line = this._textEditor.get_lines().get(i);
			var lineText = line.text;
			if(!findFullIndent.match(lineText)) {
				continue;
			}
			var indent = findFullIndent.matched(0);
			if(StringTools.trim(lineText).length > 0 || i == 0) {
				if(this._textEditor.brackets != null) {
					var _g = 0;
					var _g1 = this._textEditor.brackets;
					while(_g < _g1.length) {
						var brackets = _g1[_g];
						++_g;
						var open = brackets[0];
						var openIndex = lineText.lastIndexOf(open);
						if(openIndex != -1) {
							var close = brackets[1];
							var closeIndex = lineText.lastIndexOf(close);
							if(closeIndex == -1 || closeIndex < openIndex) {
								indent += this.getIndentString();
								break;
							}
						}
					}
				}
				return indent;
			}
			--i;
		}
		return "";
	}
	,getIndentString: function() {
		if(this._textEditor.insertSpacesForTabs) {
			return moonshine_editor_text_utils_TextUtil.repeatStr(" ",this._textEditor.get_tabWidth());
		}
		return "\t";
	}
	,textEndsInUnterminatedStringOrComment: function(text) {
		var lineComment = this._textEditor.lineComment;
		var blockCommentStart = this._textEditor.blockComment != null ? this._textEditor.blockComment[0] : null;
		var blockCommentEnd = this._textEditor.blockComment != null ? this._textEditor.blockComment[1] : null;
		var stringTerminators = ["'","\""];
		var stringStart = null;
		var pendingLineComment = "";
		var pendingBlockComment = "";
		var i = 0;
		while(i < text.length) {
			var char = text.charAt(i);
			if(stringStart != null) {
				if(char == stringStart) {
					stringStart = null;
				}
			} else if(stringTerminators.indexOf(char) != -1) {
				stringStart = char;
				pendingLineComment = "";
				pendingBlockComment = "";
			} else {
				if(lineComment != null) {
					var lineCommentChar = lineComment.charAt(pendingLineComment.length);
					if(char == lineCommentChar) {
						pendingLineComment += char;
						if(pendingLineComment == lineComment) {
							return true;
						}
					} else {
						pendingLineComment = "";
					}
				}
				if(blockCommentStart != null) {
					var blockCommentChar = blockCommentStart.charAt(pendingBlockComment.length);
					if(char == blockCommentChar) {
						pendingBlockComment += char;
						if(pendingBlockComment == blockCommentStart) {
							var blockCommentEndIndex = text.indexOf(blockCommentEnd,i + blockCommentStart.length);
							if(blockCommentEndIndex == -1) {
								return true;
							}
							i += blockCommentEndIndex + blockCommentEnd.length;
							pendingLineComment = "";
							pendingBlockComment = "";
						}
					} else {
						pendingBlockComment = "";
					}
				}
			}
			++i;
		}
		return stringStart != null;
	}
	,insertText: function(text) {
		if(this._textEditor.get_hasSelection()) {
			var change = moonshine_editor_text_utils_TextEditorUtil.deleteSelection(this._textEditor,text);
			if(change != null) {
				this.dispatchChanges([change]);
			}
			return;
		}
		if(this._textEditor.autoClosingPairs != null) {
			var _g = 0;
			var _g1 = this._textEditor.autoClosingPairs;
			while(_g < _g1.length) {
				var autoClosingPair = _g1[_g];
				++_g;
				var lineIndex = this._textEditor.get_caretLineIndex();
				var charIndex = this._textEditor.get_caretCharIndex();
				if(this._activeAutoClosingPair != null && charIndex == this._activeAutoClosingPairEndCharIndex && this._activeAutoClosingPair.open == autoClosingPair.open && autoClosingPair.close == text) {
					var newCaretCharIndex = charIndex + autoClosingPair.open.length;
					this._textEditor.setSelection(lineIndex,newCaretCharIndex,lineIndex,newCaretCharIndex);
					return;
				}
				var expandedText = text;
				if(autoClosingPair.open.length > 1) {
					var lineText = this._textEditor.get_caretLine().text;
					var numChars = autoClosingPair.open.length - expandedText.length;
					if(numChars > 0 && charIndex >= numChars) {
						expandedText = HxOverrides.substr(lineText,charIndex - numChars,numChars) + expandedText;
					}
				}
				if(autoClosingPair.open == expandedText) {
					var startLineText = HxOverrides.substr(this._textEditor.get_caretLine().text,0,charIndex);
					var needsClose = !this.textEndsInUnterminatedStringOrComment(startLineText);
					if(needsClose) {
						text += autoClosingPair.close;
						this.dispatchChanges([new moonshine_editor_text_changes_TextEditorChange(lineIndex,charIndex,lineIndex,charIndex,text)]);
						var newCaretCharIndex1 = charIndex + text.length - autoClosingPair.close.length;
						this._textEditor.setSelection(lineIndex,newCaretCharIndex1,lineIndex,newCaretCharIndex1);
						this._activeAutoClosingPair = autoClosingPair;
						this._activeAutoClosingPairLineIndex = lineIndex;
						this._activeAutoClosingPairStartCharIndex = newCaretCharIndex1;
						this._activeAutoClosingPairEndCharIndex = newCaretCharIndex1;
						return;
					}
				}
			}
		}
		var decreaseIndent = null;
		if(this._textEditor.brackets != null) {
			var trimmed = StringTools.trim(this._textEditor.get_caretLine().text);
			if(trimmed.length == 0) {
				var _g = 0;
				var _g1 = this._textEditor.brackets;
				while(_g < _g1.length) {
					var brackets = _g1[_g];
					++_g;
					var close = brackets[1];
					if(text == close) {
						decreaseIndent = this.createDecreaseIndentTextEditorChange(this._textEditor.get_caretLineIndex());
					}
				}
			}
		}
		if(decreaseIndent != null) {
			if(this._textEditor.get_caretCharIndex() == decreaseIndent.get_endChar()) {
				this.dispatchChanges([new moonshine_editor_text_changes_TextEditorChange(decreaseIndent.get_startLine(),decreaseIndent.get_startChar(),decreaseIndent.get_endLine(),decreaseIndent.get_endChar(),text)]);
				return;
			}
			this.dispatchChanges([decreaseIndent]);
		}
		var line = this._textEditor.get_caretLineIndex();
		var char = this._textEditor.get_caretCharIndex();
		this.dispatchChanges([new moonshine_editor_text_changes_TextEditorChange(line,char,line,char,text)]);
	}
	,createRemoveAtCursorTextEditorChange: function(afterCaret,isWord) {
		if(this._textEditor.get_hasSelection()) {
			return moonshine_editor_text_utils_TextEditorUtil.deleteSelection(this._textEditor);
		}
		var startLine = this._textEditor.get_caretLineIndex();
		var endLine = startLine;
		var startChar = this._textEditor.get_caretCharIndex();
		var endChar = startChar;
		if(startChar == 0 && !afterCaret) {
			if(startLine == 0) {
				return null;
			}
			--startLine;
			startChar = this._textEditor.get_lines().get(startLine).text.length;
			endChar = 0;
		} else if(startChar == this._textEditor.get_lines().get(startLine).text.length && afterCaret) {
			if(startLine == this._textEditor.get_lines().get_length() - 1) {
				return null;
			}
			++endLine;
			startChar = this._textEditor.get_lines().get(startLine).text.length;
			endChar = 0;
		} else if(afterCaret) {
			endChar += isWord ? moonshine_editor_text_utils_TextUtil.wordBoundaryForward(this._textEditor.get_lines().get(startLine).text.substring(startChar)) : 1;
		} else {
			startChar -= isWord ? moonshine_editor_text_utils_TextUtil.wordBoundaryBackward(this._textEditor.get_lines().get(startLine).text.substring(0,endChar)) : 1;
		}
		return new moonshine_editor_text_changes_TextEditorChange(startLine,startChar,endLine,endChar);
	}
	,createDecreaseIndentTextEditorChange: function(lineIndex) {
		var indent = moonshine_editor_text_utils_TextUtil.getFirstIndentAtStartOfLine(this._textEditor.get_lines().get(lineIndex).text,this._textEditor.get_tabWidth());
		if(indent.length == 0) {
			return null;
		}
		return new moonshine_editor_text_changes_TextEditorChange(lineIndex,0,lineIndex,indent.length);
	}
	,dispatchChanges: function(changes) {
		this._textEditor.dispatchEvent(new moonshine_editor_text_events_TextEditorChangeEvent(moonshine_editor_text_events_TextEditorChangeEvent.TEXT_CHANGE,changes));
	}
	,editManager_textEditor_keyDownHandler: function(event) {
		if(event.isDefaultPrevented()) {
			return;
		}
		switch(event.keyCode) {
		case 8:
			var change = this.createRemoveAtCursorTextEditorChange(false,event.altKey);
			if(change != null) {
				if(this._activeAutoClosingPair != null && change.get_startLine() == this._activeAutoClosingPairLineIndex && change.get_endChar() == this._activeAutoClosingPairEndCharIndex && this._activeAutoClosingPairStartCharIndex == this._activeAutoClosingPairEndCharIndex) {
					change = new moonshine_editor_text_changes_TextEditorChange(change.get_startLine(),change.get_startChar(),change.get_endLine(),change.get_endChar() + this._activeAutoClosingPair.close.length);
				}
				this.dispatchChanges([change]);
			}
			break;
		case 9:
			this.indent(event.shiftKey);
			event.preventDefault();
			break;
		case 13:
			var indent = this.findFullIndentForNewLine(this._textEditor.get_caretLineIndex());
			if(this.isBetweenBrackets()) {
				var extendedIndent = indent + this.getIndentString();
				var newCaretLineIndex = this._textEditor.get_caretLineIndex() + 1;
				var newCaretCharIndex = extendedIndent.length;
				this.insertText(this._textEditor.get_lineDelimiter() + extendedIndent + this._textEditor.get_lineDelimiter() + indent);
				this._textEditor.setSelection(newCaretLineIndex,newCaretCharIndex,newCaretLineIndex,newCaretCharIndex);
			} else {
				this.insertText(this._textEditor.get_lineDelimiter() + indent);
			}
			break;
		case 46:
			var change = this.createRemoveAtCursorTextEditorChange(true,event.altKey);
			if(change != null) {
				if(!this._textEditor.get_hasSelection()) {
					this.checkForClearActiveAutoClosingPair(change.get_startLine(),change.get_startChar());
					this.checkForClearActiveAutoClosingPair(change.get_endLine(),change.get_endChar());
				}
				this.dispatchChanges([change]);
			}
			break;
		case 111:case 191:
			if(event.ctrlKey && event.altKey) {
				this.toggleBlockComment();
				event.preventDefault();
			} else if(event.ctrlKey) {
				this.toggleLineComment();
				event.preventDefault();
			}
			break;
		}
		if(event.keyCode == 25) {
			event.preventDefault();
		}
	}
	,editManager_textEditor_textInputHandler: function(event) {
		var newText = event.text;
		if(!new EReg("[^\\x00-\\x1F\\x7F\\x80-\\x9F]","").match(newText)) {
			return;
		}
		this.insertText(newText);
	}
	,applyChange: function(change) {
		var startLine = change.get_startLine();
		var startChar = change.get_startChar();
		var endLine = change.get_endLine();
		var endChar = change.get_endChar();
		var newText = change.get_newText();
		if(this._activeAutoClosingPair != null) {
			if(startChar <= this._activeAutoClosingPairEndCharIndex && endChar <= this._activeAutoClosingPairEndCharIndex) {
				this._activeAutoClosingPairEndCharIndex -= endChar - startChar;
				if(newText != null) {
					this._activeAutoClosingPairEndCharIndex += newText.length;
				}
			}
		}
		var insertedLines = null;
		if(newText != null && newText.length > 0) {
			insertedLines = new EReg("\r?\n|\r","g").split(newText);
		}
		var targetStartLine = this._textEditor.get_lines().get(startLine);
		var targetEndLine = this._textEditor.get_lines().get(endLine);
		var startTextToKeep = targetStartLine.text.substring(0,startChar);
		var endTextToKeep = targetEndLine.text.substring(endChar);
		if(startLine != endLine) {
			var removeFrom = startLine + 1;
			var removeOffset = startLine - endLine;
			var _g = removeOffset;
			var _g1 = 0;
			while(_g < _g1) {
				var _ = _g++;
				this._textEditor.get_lines().removeAt(removeFrom);
			}
			this.updateLineIndices(this._textEditor,removeFrom,removeOffset);
		}
		if(insertedLines == null) {
			targetStartLine.text = startTextToKeep + endTextToKeep;
			this._textEditor.get_lines().updateAt(startLine);
		} else {
			if(insertedLines.length > 1) {
				this.updateLineIndices(this._textEditor,startLine + 1,insertedLines.length - 1);
			}
			var _g = 0;
			var _g1 = insertedLines.length;
			while(_g < _g1) {
				var i = _g++;
				var updatedText = "";
				if(i == 0) {
					updatedText = startTextToKeep;
				}
				updatedText += insertedLines[i];
				if(i == insertedLines.length - 1) {
					updatedText += endTextToKeep;
				}
				var lineIndex = startLine + i;
				if(lineIndex == startLine) {
					targetStartLine.text = updatedText;
					this._textEditor.get_lines().updateAt(lineIndex);
				} else {
					this._textEditor.get_lines().addAt(new moonshine_editor_text_lines_TextLineModel(updatedText,lineIndex),lineIndex);
				}
			}
		}
	}
	,updateLineIndices: function(textEditor,startIndex,offset) {
		var lines = textEditor.get_lines();
		var _g = startIndex;
		var _g1 = lines.get_length();
		while(_g < _g1) {
			var i = _g++;
			var line = lines.get(i);
			line.lineIndex += offset;
			lines.updateAt(i);
		}
	}
	,sortTextChanges: function(change1,change2) {
		if(change1.get_startLine() < change2.get_startLine()) {
			return 1;
		}
		if(change2.get_startLine() < change1.get_startLine()) {
			return -1;
		}
		if(change1.get_startChar() < change2.get_startChar()) {
			return 1;
		}
		if(change2.get_startChar() < change1.get_startChar()) {
			return -1;
		}
		return 0;
	}
	,mergeChanges: function(changes) {
		var i = 0;
		var prevChange = null;
		while(i < changes.length) {
			var change = changes[i];
			if(change.get_startLine() == change.get_endLine() && change.get_startChar() == change.get_endChar() && (change.get_newText() == null || change.get_newText().length == 0)) {
				changes.splice(i,1);
				continue;
			}
			if(change.get_startLine() < 0 || change.get_startChar() < 0 || change.get_endLine() < 0 || change.get_endChar() < 0 || change.get_startLine() > change.get_endLine() || change.get_startLine() == change.get_endLine() && change.get_startChar() > change.get_endChar()) {
				throw new openfl_errors_RangeError("Invalid text editor change. Start: (" + change.get_startLine() + ", " + change.get_startChar() + "), End: (" + change.get_endLine() + ", " + change.get_endChar() + ")");
			}
			if(prevChange == null) {
				prevChange = change;
				++i;
				continue;
			}
			var changesOverlap = change.get_endLine() > prevChange.get_startLine() || change.get_endLine() == prevChange.get_startLine() && (change.get_endChar() > prevChange.get_startChar() || change.get_startChar() == prevChange.get_startChar());
			if(changesOverlap) {
				var prevIsInsertOnly = prevChange.get_startLine() == prevChange.get_endLine() && prevChange.get_startChar() == prevChange.get_endChar() && prevChange.get_newText() != null;
				var canMerge = prevIsInsertOnly && prevChange.get_startLine() == change.get_startLine() && prevChange.get_startChar() == change.get_startChar();
				if(canMerge) {
					var combinedText = "";
					if(prevChange.get_newText() != null) {
						combinedText += prevChange.get_newText();
					}
					if(change.get_newText() != null) {
						combinedText += change.get_newText();
					}
					prevChange = new moonshine_editor_text_changes_TextEditorChange(change.get_startLine(),change.get_startChar(),change.get_endLine(),change.get_endChar(),combinedText);
					changes[i - 1] = prevChange;
					changes.splice(i,1);
					continue;
				}
				throw new openfl_errors_ArgumentError("TextEditorChanges must not overlap. { startLine: " + prevChange.get_startLine() + ", startChar: " + prevChange.get_startChar() + ", endLine: " + prevChange.get_endLine() + ", endChar: " + prevChange.get_endChar() + " } overlaps with { startLine: " + change.get_startLine() + ", startChar: " + change.get_startChar() + ", endLine: " + change.get_endLine() + ", endChar: " + change.get_endChar() + "}.");
			}
			++i;
		}
	}
	,editManager_textEditor_textChangePriorityHandler: function(event) {
		if(event.origin != moonshine_editor_text_events_TextEditorChangeEvent.ORIGIN_UNDO) {
			haxe_ds_ArraySort.sort(event.changes,$bind(this,this.sortTextChanges));
			this.mergeChanges(event.changes);
		}
	}
	,editManager_textEditor_textChangeHandler: function(event) {
		var _g = 0;
		var _g1 = event.changes;
		while(_g < _g1.length) {
			var change = _g1[_g];
			++_g;
			this.applyChange(change);
		}
	}
	,checkForClearActiveAutoClosingPair: function(line,char) {
		if(this._activeAutoClosingPair == null) {
			return;
		}
		var clearActivePair = false;
		if(line != this._activeAutoClosingPairLineIndex) {
			clearActivePair = true;
		} else if(char < this._activeAutoClosingPairStartCharIndex || char > this._activeAutoClosingPairEndCharIndex) {
			clearActivePair = true;
		}
		if(!clearActivePair) {
			return;
		}
		this._activeAutoClosingPair = null;
		this._activeAutoClosingPairLineIndex = -1;
		this._activeAutoClosingPairStartCharIndex = -1;
		this._activeAutoClosingPairEndCharIndex = -1;
	}
	,editManager_textEditor_selectionChangeHandler: function(event) {
		this.checkForClearActiveAutoClosingPair(this._textEditor.get_caretLineIndex(),this._textEditor.get_caretCharIndex());
	}
	,editManager_textEditor_clearHandler: function(event) {
		var change = moonshine_editor_text_utils_TextEditorUtil.deleteSelection(this._textEditor);
		if(change != null) {
			this._textEditor.dispatchEvent(new moonshine_editor_text_events_TextEditorChangeEvent(moonshine_editor_text_events_TextEditorChangeEvent.TEXT_CHANGE,[change]));
		}
	}
	,__class__: moonshine_editor_text_managers_EditManager
};
var moonshine_editor_text_managers_FindReplaceManager = function(textEditor) {
	this._textEditor = textEditor;
	this._textEditor.addEventListener(moonshine_editor_text_events_TextEditorChangeEvent.TEXT_CHANGE,$bind(this,this.findReplaceManager_textEditor_textChangeHandler));
};
$hxClasses["moonshine.editor.text.managers.FindReplaceManager"] = moonshine_editor_text_managers_FindReplaceManager;
moonshine_editor_text_managers_FindReplaceManager.__name__ = "moonshine.editor.text.managers.FindReplaceManager";
moonshine_editor_text_managers_FindReplaceManager.prototype = {
	_textEditor: null
	,_findResult: null
	,find: function(search,backwards,allowWrap,updateSelection) {
		if(updateSelection == null) {
			updateSelection = true;
		}
		if(allowWrap == null) {
			allowWrap = true;
		}
		if(backwards == null) {
			backwards = false;
		}
		var str = this._textEditor.get_text();
		var searchRegExp = ((search) instanceof EReg) ? search : null;
		if(searchRegExp == null && search != null) {
			var searchStr = search == null ? "null" : Std.string(search);
			if(searchStr.length > 0) {
				searchRegExp = new EReg(searchStr.replace(EReg.escapeRe,"\\$&"),"i");
			}
		}
		var results = this.findInternal(str,searchRegExp);
		this._findResult = new moonshine_editor_text_TextEditorSearchResult(searchRegExp,backwards,allowWrap,results);
		if(results.length == 0) {
			if(updateSelection) {
				this._textEditor.removeSelection();
			}
			return this._findResult;
		}
		this._findResult = this.findNextInternal(this._findResult,backwards,true,allowWrap);
		if(updateSelection) {
			this.applySearch(this._findResult);
		}
		return this._findResult;
	}
	,findNext: function(backwards,allowWrap) {
		if(allowWrap == null) {
			allowWrap = true;
		}
		if(backwards == null) {
			backwards = false;
		}
		if(this._findResult == null) {
			return new moonshine_editor_text_TextEditorSearchResult(null,backwards,allowWrap);
		}
		this._findResult = this.findNextInternal(this._findResult,backwards,false,allowWrap);
		this.applySearch(this._findResult);
		return this._findResult;
	}
	,replace: function(replaceText,all,backwards,allowWrap) {
		if(allowWrap == null) {
			allowWrap = true;
		}
		if(backwards == null) {
			backwards = false;
		}
		if(all == null) {
			all = false;
		}
		if(this._findResult == null) {
			return new moonshine_editor_text_TextEditorSearchResult(null,backwards,allowWrap);
		}
		var str = this._textEditor.get_text();
		var changes = [];
		if(all) {
			var _g = 0;
			var _g1 = this._findResult.results;
			while(_g < _g1.length) {
				var result = _g1[_g];
				++_g;
				this.addChangesForReplace(str,replaceText,result,changes);
			}
			var tmp = this._findResult.results.slice();
			this._findResult.replaced = tmp;
			this._findResult.results.length = 0;
		} else {
			var replaced = this._findResult.results.splice(this._findResult.selectedIndex,1);
			this._findResult.replaced = replaced;
			this.addChangesForReplace(str,replaceText,replaced[0],changes);
		}
		this._textEditor.dispatchEvent(new moonshine_editor_text_events_TextEditorChangeEvent(moonshine_editor_text_events_TextEditorChangeEvent.TEXT_CHANGE,changes));
		this.applySearch(this._findResult);
		return this._findResult;
	}
	,findInternal: function(str,searchRegExp) {
		var results = [];
		if(searchRegExp != null) {
			var startIndex = 0;
			while(searchRegExp.matchSub(str,startIndex)) if(searchRegExp.matched(0) != null) {
				var match = searchRegExp.matchedPos();
				startIndex = match.pos + match.len;
				var start = moonshine_editor_text_utils_TextUtil.charIdx2LineCharIdx(str,match.pos,this._textEditor.get_lineDelimiter());
				results.push(new moonshine_editor_text_SearchResultItem(match.pos,match.len,start.line,start.character,start.line,start.character + match.len));
			} else {
				break;
			}
		}
		return results;
	}
	,findNextInternal: function(res,backwards,includeCurrent,allowWrap) {
		if(allowWrap == null) {
			allowWrap = true;
		}
		if(includeCurrent == null) {
			includeCurrent = false;
		}
		if(backwards == null) {
			backwards = false;
		}
		var str = this._textEditor.get_text();
		var startLine = this._textEditor.get_hasSelection() ? this._textEditor.get_selectionStartLineIndex() : this._textEditor.get_caretLineIndex();
		var startChar = this._textEditor.get_hasSelection() ? this._textEditor.get_selectionStartCharIndex() : this._textEditor.get_caretCharIndex();
		var startPos = moonshine_editor_text_utils_TextUtil.lineCharIdx2charIdx(str,startLine,startChar,this._textEditor.get_lineDelimiter());
		var results = res.results;
		var newSelectedIndex = -1;
		var wrapped = false;
		if(backwards) {
			var i = Math.min(results.length - 1,res.selectedIndex - 1) | 0;
			while(i >= 0) {
				var current = results[i];
				if(current.index < startPos) {
					newSelectedIndex = i;
					break;
				}
				--i;
			}
		} else {
			var _g = res.selectedIndex + 1;
			var _g1 = results.length;
			while(_g < _g1) {
				var i = _g++;
				var current = results[i];
				if(includeCurrent) {
					if(current.index >= startPos) {
						newSelectedIndex = i;
						break;
					}
				} else if(current.index > startPos) {
					newSelectedIndex = i;
					break;
				}
			}
		}
		if(allowWrap) {
			if(newSelectedIndex == -1 && results.length != 0) {
				if(backwards) {
					newSelectedIndex = results.length - 1;
				} else {
					newSelectedIndex = 0;
				}
				wrapped = true;
			}
		}
		res.replaced.length = 0;
		if(newSelectedIndex == -1) {
			return res;
		}
		res.selectedIndex = newSelectedIndex;
		if(res.selectedIndex == -1) {
			res.current = null;
		} else {
			res.current = res.results[res.selectedIndex];
		}
		return res;
	}
	,addChangesForReplace: function(str,replace,result,changes) {
		changes.push(new moonshine_editor_text_changes_TextEditorChange(result.startLine,result.startChar,result.endLine,result.endChar,replace));
	}
	,applySearch: function(result) {
		var startLine = -1;
		var startChar = -1;
		var endLine = -1;
		var endChar = -1;
		var current = result.current;
		if(current != null) {
			startLine = current.startLine;
			startChar = current.startChar;
			endLine = current.endLine;
			endChar = current.endChar;
		}
		this._textEditor.setSelection(startLine,startChar,endLine,endChar);
		this._textEditor.scrollToCaret();
	}
	,findReplaceManager_textEditor_textChangeHandler: function(event) {
		if(this._findResult == null) {
			return;
		}
		this.find(this._findResult.search,this._findResult.backwards,this._findResult.allowWrap,false);
	}
	,__class__: moonshine_editor_text_managers_FindReplaceManager
};
var moonshine_editor_text_managers_SelectionManager = function(textEditor) {
	this.macHomeAndEndEnabled = false;
	this._lastClickTime = 0;
	this._clickCount = 0;
	this._dragScrollDeltaY = 0;
	this._dragScrollDeltaX = 0;
	this._dragEndChar = -1;
	this._dragStartChar = -1;
	this._dragStartLine = -1;
	this._savedCaretCharIndex = -1;
	this._savedCaretLineIndex = -1;
	this._textEditor = textEditor;
	this._textEditor.addEventListener("keyDown",$bind(this,this.selectionManager_textEditor_keyDownHandler),false,0,true);
	this._textEditor.addEventListener("keyDown",$bind(this,this.selectionManager_textEditor_keyDownCaptureHandler),true,0,true);
	this._textEditor.addEventListener(moonshine_editor_text_events_TextEditorChangeEvent.TEXT_CHANGE,$bind(this,this.selectionManager_textEditor_textChangePriorityHandler),false,100,true);
	this._textEditor.addEventListener(moonshine_editor_text_events_TextEditorChangeEvent.TEXT_CHANGE,$bind(this,this.selectionManager_textEditor_textChangeHandler),false,0,true);
	this._textEditor.addEventListener("selectAll",$bind(this,this.selectionManager_textEditor_selectAllHandler),false,0,true);
	this._textEditor.addEventListener("mouseDown",$bind(this,this.selectionManager_textEditor_mouseDownHandler),false,0,true);
};
$hxClasses["moonshine.editor.text.managers.SelectionManager"] = moonshine_editor_text_managers_SelectionManager;
moonshine_editor_text_managers_SelectionManager.__name__ = "moonshine.editor.text.managers.SelectionManager";
moonshine_editor_text_managers_SelectionManager.prototype = {
	_textEditor: null
	,_savedCaretLineIndex: null
	,_savedCaretCharIndex: null
	,_dragStartLine: null
	,_dragStartChar: null
	,_dragEndChar: null
	,_dragScrollDeltaX: null
	,_dragScrollDeltaY: null
	,_dragLocalPoint: null
	,_dragScrollTimer: null
	,_clickCount: null
	,_lastClickTime: null
	,_lastClickPos: null
	,macHomeAndEndEnabled: null
	,applyChanges: function(changes) {
		var line = this._savedCaretLineIndex;
		var char = this._savedCaretCharIndex;
		var _g = 0;
		while(_g < changes.length) {
			var change = changes[_g];
			++_g;
			if(line > change.get_startLine() && line < change.get_endLine() || line == change.get_startLine() && line == change.get_endLine() && char > change.get_startChar() && char < change.get_endChar() || line == change.get_startLine() && line < change.get_endLine() && char >= change.get_startChar() || line > change.get_startLine() && line == change.get_endLine() && char <= change.get_endChar()) {
				line = change.get_endLine();
				char = change.get_endChar();
			}
			if(change.get_endLine() == line && change.get_endChar() <= char) {
				var offset = change.get_endChar();
				if(change.get_startLine() == line) {
					offset -= change.get_startChar();
				}
				char -= offset;
			}
			if(line >= change.get_endLine()) {
				line -= change.get_endLine() - change.get_startLine();
				if(line != change.get_endLine() && line == change.get_startLine()) {
					char += change.get_startChar();
				}
			}
			var newText = change.get_newText();
			if(newText != null && newText.length > 0) {
				var insertedLines = new EReg("\r?\n|\r","g").split(newText);
				if(line == change.get_startLine() && char >= change.get_startChar()) {
					if(insertedLines.length > 1) {
						char -= change.get_startChar();
					}
					char += insertedLines[insertedLines.length - 1].length;
				}
				if(line >= change.get_startLine()) {
					line += insertedLines.length - 1;
				}
			}
		}
		this._textEditor.setSelection(line,char,line,char);
	}
	,focusSelectionStart: function() {
		var newLineIndex = this._textEditor.get_selectionStartLineIndex();
		var newCharIndex = this._textEditor.get_selectionStartCharIndex();
		this._textEditor.setSelection(newLineIndex,newCharIndex,newLineIndex,newCharIndex);
	}
	,updateDragSelect: function() {
		var localPoint = this._dragLocalPoint;
		var startLine = this._dragStartLine;
		var startChar = this._dragEndChar;
		var endLine = this._dragStartLine;
		var endChar = this._dragEndChar;
		this._textEditor.validateNow();
		var textEditorPosition = this._textEditor.localToTextEditorPosition(localPoint,true);
		if(textEditorPosition == null) {
			return;
		}
		var newCaretPosition = textEditorPosition.character;
		if(newCaretPosition < this._dragStartChar && textEditorPosition.line <= this._dragStartLine) {
			startChar = this._dragEndChar;
		} else if(newCaretPosition > this._dragEndChar && textEditorPosition.line >= this._dragStartLine) {
			startChar = this._dragStartChar;
		} else if(textEditorPosition.line < this._dragStartLine) {
			startChar = this._dragEndChar;
		} else if(textEditorPosition.line > this._dragStartLine) {
			startChar = this._dragStartChar;
		}
		if(newCaretPosition != -1) {
			if(this._clickCount == 1) {
				endLine = textEditorPosition.line;
				endChar = newCaretPosition;
			} else if(this._clickCount == 2) {
				endLine = textEditorPosition.line;
				if(endLine < startLine || endLine == startLine && newCaretPosition < startChar) {
					endChar = newCaretPosition - moonshine_editor_text_utils_TextUtil.wordBoundaryBackward(this._textEditor.get_lines().get(endLine).text.substring(0,newCaretPosition));
				} else {
					endChar = newCaretPosition + moonshine_editor_text_utils_TextUtil.wordBoundaryForward(this._textEditor.get_lines().get(endLine).text.substring(newCaretPosition));
					if(this._textEditor.get_lines().get(endLine).text.charAt(endChar - 1) == " ") {
						--endChar;
					}
				}
			} else if(this._clickCount == 3) {
				endLine = textEditorPosition.line;
				endChar = this._textEditor.get_lines().get(endLine).text.length;
			}
		} else if(localPoint.x < this._textEditor.get_gutterWidth()) {
			endLine = textEditorPosition.line + (startLine > textEditorPosition.line || startLine == textEditorPosition.line && startChar > 0 ? 0 : 1);
			endChar = 0;
			if(endLine >= this._textEditor.get_lines().get_length()) {
				endLine = this._textEditor.get_lines().get_length() - 1;
				endChar = this._textEditor.get_lines().get(endLine).text.length;
			}
		} else {
			return;
		}
		this._textEditor.setSelection(startLine,startChar,endLine,endChar);
	}
	,startDragScroll: function() {
		this._dragScrollTimer = new openfl_utils_Timer(moonshine_editor_text_managers_SelectionManager.SCROLL_INTERVAL);
		this._dragScrollTimer.addEventListener("timer",$bind(this,this.selectionManager_dragScrollTimer_timerHandler));
		this._dragScrollTimer.start();
	}
	,stopDragScroll: function() {
		if(this._dragScrollTimer != null) {
			this._dragScrollTimer.stop();
			this._dragScrollTimer = null;
		}
	}
	,keyboardHome: function(event) {
		var selectionStartLineIndex = this._textEditor.get_hasSelection() ? this._textEditor.get_selectionStartLineIndex() : this._textEditor.get_caretLineIndex();
		var selectionStartCharIndex = this._textEditor.get_hasSelection() ? this._textEditor.get_selectionStartCharIndex() : this._textEditor.get_caretCharIndex();
		if(this._textEditor.get_hasSelection() && !event.shiftKey) {
			this._textEditor.removeSelection();
		}
		if(event.ctrlKey) {
			var newLineIndex = 0;
			var newCaretIndex = 0;
			if(event.shiftKey) {
				this._textEditor.setSelection(selectionStartLineIndex,selectionStartCharIndex,newLineIndex,newCaretIndex);
			} else {
				this._textEditor.setSelection(0,0,0,0);
			}
			this._textEditor.set_lineScrollY(0);
		} else {
			var caretLine = this._textEditor.get_lines().get(this._textEditor.get_caretLineIndex());
			var tabIndex = moonshine_editor_text_utils_TextUtil.indentAmount(caretLine.text);
			var newCaretIndex = this._textEditor.get_caretCharIndex() == tabIndex ? 0 : tabIndex;
			if(event.shiftKey) {
				this._textEditor.setSelection(selectionStartLineIndex,selectionStartCharIndex,this._textEditor.get_caretLineIndex(),newCaretIndex);
			} else {
				this._textEditor.setSelection(this._textEditor.get_caretLineIndex(),newCaretIndex,this._textEditor.get_caretLineIndex(),newCaretIndex);
			}
		}
	}
	,keyboardEnd: function(event) {
		var selectionStartLineIndex = this._textEditor.get_hasSelection() ? this._textEditor.get_selectionStartLineIndex() : this._textEditor.get_caretLineIndex();
		var selectionStartCharIndex = this._textEditor.get_hasSelection() ? this._textEditor.get_selectionStartCharIndex() : this._textEditor.get_caretCharIndex();
		if(this._textEditor.get_hasSelection() && !event.shiftKey) {
			this._textEditor.removeSelection();
		}
		if(event.ctrlKey) {
			var newLineIndex = this._textEditor.get_lines().get_length() - 1;
			var newCaretIndex = this._textEditor.get_lines().get(newLineIndex).text.length;
			if(event.shiftKey) {
				this._textEditor.setSelection(selectionStartLineIndex,selectionStartCharIndex,newLineIndex,newCaretIndex);
			} else {
				this._textEditor.setSelection(newLineIndex,newCaretIndex,newLineIndex,newCaretIndex);
			}
			this._textEditor.set_lineScrollY(this._textEditor.get_maxLineScrollY());
		} else {
			var caretLine = this._textEditor.get_lines().get(this._textEditor.get_caretLineIndex());
			var newCaretIndex = caretLine.text.length;
			if(event.shiftKey) {
				this._textEditor.setSelection(selectionStartLineIndex,selectionStartCharIndex,this._textEditor.get_caretLineIndex(),newCaretIndex);
			} else {
				this._textEditor.setSelection(this._textEditor.get_caretLineIndex(),newCaretIndex,this._textEditor.get_caretLineIndex(),newCaretIndex);
			}
		}
	}
	,keyboardPageUp: function(event) {
		var selectionStartLineIndex = this._textEditor.get_hasSelection() ? this._textEditor.get_selectionStartLineIndex() : this._textEditor.get_caretLineIndex();
		var selectionStartCharIndex = this._textEditor.get_hasSelection() ? this._textEditor.get_selectionStartCharIndex() : this._textEditor.get_caretCharIndex();
		if(this._textEditor.get_hasSelection() && !event.shiftKey) {
			this._textEditor.removeSelection();
		}
		if(event.ctrlKey) {
			var newLineIndex = this._textEditor.get_lineScrollY();
			if(event.shiftKey) {
				this._textEditor.setSelection(selectionStartLineIndex,selectionStartCharIndex,newLineIndex,this._textEditor.get_caretCharIndex());
			} else {
				this._textEditor.setSelectionAdvanced(newLineIndex,this._textEditor.get_expandedCaretCharIndex(),newLineIndex,this._textEditor.get_expandedCaretCharIndex(),false);
			}
		} else {
			var newLineIndex = Math.max(this._textEditor.get_caretLineIndex() - this._textEditor.get_visibleLines(),0) | 0;
			if(event.shiftKey) {
				this._textEditor.setSelection(selectionStartLineIndex,selectionStartCharIndex,newLineIndex,this._textEditor.get_caretCharIndex());
			} else {
				this._textEditor.setSelectionAdvanced(newLineIndex,this._textEditor.get_expandedCaretCharIndex(),newLineIndex,this._textEditor.get_expandedCaretCharIndex(),false);
			}
			this._textEditor.set_lineScrollY(this._textEditor.get_lineScrollY() - this._textEditor.get_visibleLines());
		}
	}
	,keyboardPageDown: function(event) {
		var selectionStartLineIndex = this._textEditor.get_hasSelection() ? this._textEditor.get_selectionStartLineIndex() : this._textEditor.get_caretLineIndex();
		var selectionStartCharIndex = this._textEditor.get_hasSelection() ? this._textEditor.get_selectionStartCharIndex() : this._textEditor.get_caretCharIndex();
		if(this._textEditor.get_hasSelection() && !event.shiftKey) {
			this._textEditor.removeSelection();
		}
		if(event.ctrlKey) {
			var newLineIndex = this._textEditor.get_lineScrollY() + this._textEditor.get_visibleLines() - 2;
			if(event.shiftKey) {
				this._textEditor.setSelection(selectionStartLineIndex,selectionStartCharIndex,newLineIndex,this._textEditor.get_caretCharIndex());
			} else {
				this._textEditor.setSelectionAdvanced(newLineIndex,this._textEditor.get_expandedCaretCharIndex(),newLineIndex,this._textEditor.get_expandedCaretCharIndex(),false);
			}
		} else {
			var newLineIndex = Math.min(this._textEditor.get_caretLineIndex() + this._textEditor.get_visibleLines(),this._textEditor.get_lines().get_length() - 1) | 0;
			if(event.shiftKey) {
				this._textEditor.setSelection(selectionStartLineIndex,selectionStartCharIndex,newLineIndex,this._textEditor.get_caretCharIndex());
			} else {
				this._textEditor.setSelectionAdvanced(newLineIndex,this._textEditor.get_expandedCaretCharIndex(),newLineIndex,this._textEditor.get_expandedCaretCharIndex(),false);
			}
			var fh = this._textEditor;
			fh.set_lineScrollY(fh.get_lineScrollY() + this._textEditor.get_visibleLines());
		}
	}
	,keyboardLeft: function(event) {
		var selectionStartLineIndex = this._textEditor.get_hasSelection() ? this._textEditor.get_selectionStartLineIndex() : this._textEditor.get_caretLineIndex();
		var selectionStartCharIndex = this._textEditor.get_hasSelection() ? this._textEditor.get_selectionStartCharIndex() : this._textEditor.get_caretCharIndex();
		var chars = 1;
		var caretLine = this._textEditor.get_lines().get(this._textEditor.get_caretLineIndex());
		if(event.commandKey) {
			if(!event.shiftKey && this._textEditor.get_hasSelection()) {
				this._textEditor.removeSelection();
			}
			var tabIndex = moonshine_editor_text_utils_TextUtil.indentAmount(caretLine.text);
			var newCaretIndex = this._textEditor.get_caretCharIndex() == tabIndex ? 0 : tabIndex;
			if(event.shiftKey) {
				this._textEditor.setSelection(selectionStartLineIndex,selectionStartCharIndex,this._textEditor.get_caretLineIndex(),newCaretIndex);
			} else {
				this._textEditor.setSelection(this._textEditor.get_caretLineIndex(),newCaretIndex,this._textEditor.get_caretLineIndex(),newCaretIndex);
			}
		} else if(this._textEditor.get_hasSelection() && !event.shiftKey) {
			if(this._textEditor.get_caretLineIndex() > this._textEditor.get_selectionStartLineIndex() || this._textEditor.get_caretCharIndex() > this._textEditor.get_selectionStartCharIndex()) {
				this.focusSelectionStart();
			}
			this._textEditor.removeSelection();
		} else if(this._textEditor.get_caretCharIndex() > 0) {
			if(event.altKey) {
				chars = moonshine_editor_text_utils_TextUtil.wordBoundaryBackward(caretLine.text.substring(0,this._textEditor.get_caretCharIndex()));
			}
			var newCaretIndex = this._textEditor.get_caretCharIndex() - chars;
			if(event.shiftKey) {
				this._textEditor.setSelection(selectionStartLineIndex,selectionStartCharIndex,this._textEditor.get_caretLineIndex(),newCaretIndex);
			} else {
				this._textEditor.setSelection(this._textEditor.get_caretLineIndex(),newCaretIndex,this._textEditor.get_caretLineIndex(),newCaretIndex);
			}
		} else {
			var newLineIndex = this._textEditor.get_caretLineIndex() - 1;
			if(newLineIndex >= 0) {
				var newCaretIndex = this._textEditor.get_lines().get(newLineIndex).text.length;
				if(event.shiftKey) {
					this._textEditor.setSelection(selectionStartLineIndex,selectionStartCharIndex,newLineIndex,newCaretIndex);
				} else {
					this._textEditor.setSelection(newLineIndex,newCaretIndex,newLineIndex,newCaretIndex);
				}
			}
		}
	}
	,keyboardRight: function(event) {
		var selectionStartLineIndex = this._textEditor.get_hasSelection() ? this._textEditor.get_selectionStartLineIndex() : this._textEditor.get_caretLineIndex();
		var selectionStartCharIndex = this._textEditor.get_hasSelection() ? this._textEditor.get_selectionStartCharIndex() : this._textEditor.get_caretCharIndex();
		var chars = 1;
		var caretLine = this._textEditor.get_lines().get(this._textEditor.get_caretLineIndex());
		if(event.commandKey) {
			if(!event.shiftKey && this._textEditor.get_hasSelection()) {
				this._textEditor.removeSelection();
			}
			var newCaretIndex = caretLine.text.length;
			if(event.shiftKey) {
				this._textEditor.setSelection(selectionStartLineIndex,selectionStartCharIndex,this._textEditor.get_caretLineIndex(),newCaretIndex);
			} else {
				this._textEditor.setSelection(this._textEditor.get_caretLineIndex(),newCaretIndex,this._textEditor.get_caretLineIndex(),newCaretIndex);
			}
		} else if(this._textEditor.get_hasSelection() && !event.shiftKey) {
			if(this._textEditor.get_caretLineIndex() < this._textEditor.get_selectionStartLineIndex() || this._textEditor.get_caretCharIndex() < this._textEditor.get_selectionStartCharIndex()) {
				this.focusSelectionStart();
			}
			this._textEditor.removeSelection();
		} else if(this._textEditor.get_caretCharIndex() < caretLine.text.length) {
			if(event.altKey) {
				chars = moonshine_editor_text_utils_TextUtil.wordBoundaryForward(caretLine.text.substring(this._textEditor.get_caretCharIndex()));
			}
			var newCaretIndex = this._textEditor.get_caretCharIndex() + chars;
			if(event.shiftKey) {
				this._textEditor.setSelection(selectionStartLineIndex,selectionStartCharIndex,this._textEditor.get_caretLineIndex(),newCaretIndex);
			} else {
				this._textEditor.setSelection(this._textEditor.get_caretLineIndex(),newCaretIndex,this._textEditor.get_caretLineIndex(),newCaretIndex);
			}
		} else {
			var newLineIndex = this._textEditor.get_caretLineIndex() + 1;
			if(newLineIndex < this._textEditor.get_lines().get_length()) {
				var newCaretIndex = 0;
				if(event.shiftKey) {
					this._textEditor.setSelection(selectionStartLineIndex,selectionStartCharIndex,newLineIndex,newCaretIndex);
				} else {
					this._textEditor.setSelection(newLineIndex,newCaretIndex,newLineIndex,newCaretIndex);
				}
			}
		}
	}
	,keyboardUp: function(event) {
		var selectionStartLineIndex = this._textEditor.get_hasSelection() ? this._textEditor.get_selectionStartLineIndex() : this._textEditor.get_caretLineIndex();
		var selectionStartCharIndex = this._textEditor.get_hasSelection() ? this._textEditor.get_selectionStartCharIndex() : this._textEditor.get_caretCharIndex();
		if(event.commandKey) {
			if(!event.shiftKey && this._textEditor.get_hasSelection()) {
				this._textEditor.removeSelection();
			}
			if(event.shiftKey) {
				this._textEditor.setSelection(selectionStartLineIndex,selectionStartCharIndex,0,0);
			} else {
				this._textEditor.setSelection(0,0,0,0);
			}
		} else if(event.ctrlKey) {
			if(this._textEditor.get_lineScrollY() > 0) {
				if(!this._textEditor.get_hasSelection() && this._textEditor.get_caretLineIndex() > this._textEditor.get_lineScrollY() + this._textEditor.get_visibleLines() - 2) {
					var newLineIndex = this._textEditor.get_lineScrollY() + this._textEditor.get_visibleLines() - 2;
					this._textEditor.setSelectionAdvanced(newLineIndex,this._textEditor.get_expandedCaretCharIndex(),newLineIndex,this._textEditor.get_expandedCaretCharIndex(),false);
				}
				this._textEditor.set_lineScrollY(this._textEditor.get_lineScrollY() - 1);
			}
		} else {
			if(this._textEditor.get_hasSelection() && !event.shiftKey) {
				this._textEditor.removeSelection();
			}
			var newLineIndex = this._textEditor.get_caretLineIndex() - 1;
			var newCaretIndex = event.shiftKey ? this._textEditor.get_caretCharIndex() : this._textEditor.get_expandedCaretCharIndex();
			if(newLineIndex < 0) {
				newLineIndex = 0;
				newCaretIndex = 0;
			}
			if(event.shiftKey) {
				this._textEditor.setSelection(selectionStartLineIndex,selectionStartCharIndex,newLineIndex,newCaretIndex);
			} else {
				this._textEditor.setSelectionAdvanced(newLineIndex,newCaretIndex,newLineIndex,newCaretIndex,false);
			}
		}
	}
	,keyboardDown: function(event) {
		var selectionStartLineIndex = this._textEditor.get_hasSelection() ? this._textEditor.get_selectionStartLineIndex() : this._textEditor.get_caretLineIndex();
		var selectionStartCharIndex = this._textEditor.get_hasSelection() ? this._textEditor.get_selectionStartCharIndex() : this._textEditor.get_caretCharIndex();
		if(event.commandKey) {
			if(!event.shiftKey && this._textEditor.get_hasSelection()) {
				this._textEditor.removeSelection();
			}
			var newLineIndex = this._textEditor.get_lines().get_length() - 1;
			var newCaretIndex = this._textEditor.get_lines().get(newLineIndex).text.length;
			if(event.shiftKey) {
				this._textEditor.setSelection(selectionStartLineIndex,selectionStartCharIndex,newLineIndex,newCaretIndex);
			} else {
				this._textEditor.setSelection(newLineIndex,newCaretIndex,newLineIndex,newCaretIndex);
			}
		} else if(event.ctrlKey) {
			if(this._textEditor.get_lineScrollY() < this._textEditor.get_maxLineScrollY()) {
				if(!this._textEditor.get_hasSelection() && this._textEditor.get_caretLineIndex() < this._textEditor.get_lineScrollY() + 1) {
					var newLineIndex = this._textEditor.get_lineScrollY() + 1;
					this._textEditor.setSelectionAdvanced(newLineIndex,this._textEditor.get_expandedCaretCharIndex(),newLineIndex,this._textEditor.get_expandedCaretCharIndex(),false);
				}
				this._textEditor.set_lineScrollY(this._textEditor.get_lineScrollY() + 1);
			}
		} else {
			if(this._textEditor.get_hasSelection() && !event.shiftKey) {
				this._textEditor.removeSelection();
			}
			var newLineIndex = this._textEditor.get_caretLineIndex() + 1;
			var newCaretIndex = event.shiftKey ? this._textEditor.get_caretCharIndex() : this._textEditor.get_expandedCaretCharIndex();
			if(newLineIndex >= this._textEditor.get_lines().get_length()) {
				newLineIndex = this._textEditor.get_lines().get_length() - 1;
				newCaretIndex = this._textEditor.get_lines().get(this._textEditor.get_lines().get_length() - 1).text.length;
			}
			if(event.shiftKey) {
				this._textEditor.setSelection(selectionStartLineIndex,selectionStartCharIndex,newLineIndex,newCaretIndex);
			} else {
				this._textEditor.setSelectionAdvanced(newLineIndex,newCaretIndex,newLineIndex,newCaretIndex,false);
			}
		}
	}
	,selectionManager_textEditor_keyDownHandler: function(event) {
		if(event.isDefaultPrevented()) {
			return;
		}
		if(event.keyCode == 65) {
			if(event.ctrlKey && !event.altKey) {
				var lastLineIndex = this._textEditor.get_lines().get_length() - 1;
				this._textEditor.setSelection(0,0,lastLineIndex,this._textEditor.get_lines().get(lastLineIndex).text.length);
				this._textEditor.scrollToCaret();
				event.preventDefault();
			}
		}
	}
	,selectionManager_textEditor_keyDownCaptureHandler: function(event) {
		if(event.isDefaultPrevented()) {
			return;
		}
		var processed = true;
		switch(event.keyCode) {
		case 33:
			this.keyboardPageUp(event);
			break;
		case 34:
			this.keyboardPageDown(event);
			break;
		case 35:
			if(this.macHomeAndEndEnabled && StringTools.startsWith(openfl_system_Capabilities.get_version(),"MAC")) {
				this._textEditor.set_lineScrollY(this._textEditor.get_maxLineScrollY());
				event.preventDefault();
				return;
			} else {
				this.keyboardEnd(event);
			}
			break;
		case 36:
			if(this.macHomeAndEndEnabled && StringTools.startsWith(openfl_system_Capabilities.get_version(),"MAC")) {
				this._textEditor.set_lineScrollY(0);
				event.preventDefault();
				return;
			} else {
				this.keyboardHome(event);
			}
			break;
		case 37:
			this.keyboardLeft(event);
			break;
		case 38:
			this.keyboardUp(event);
			break;
		case 39:
			this.keyboardRight(event);
			break;
		case 40:
			this.keyboardDown(event);
			break;
		default:
			processed = false;
		}
		if(processed) {
			event.preventDefault();
			this._textEditor.scrollToCaret();
		}
	}
	,selectionManager_textEditor_textChangePriorityHandler: function(event) {
		if(event.origin == moonshine_editor_text_events_TextEditorChangeEvent.ORIGIN_REMOTE) {
			return;
		}
		this._savedCaretLineIndex = this._textEditor.get_caretLineIndex();
		this._savedCaretCharIndex = this._textEditor.get_caretCharIndex();
	}
	,selectionManager_textEditor_textChangeHandler: function(event) {
		if(event.origin == moonshine_editor_text_events_TextEditorChangeEvent.ORIGIN_REMOTE) {
			return;
		}
		this._textEditor.removeSelection();
		this.applyChanges(event.changes);
		this._textEditor.scrollToCaret();
	}
	,selectionManager_textEditor_selectAllHandler: function(event) {
		var lastLineIndex = this._textEditor.get_lines().get_length() - 1;
		this._textEditor.setSelection(0,0,lastLineIndex,this._textEditor.get_lines().get(lastLineIndex).text.length);
		this._textEditor.scrollToCaret();
	}
	,selectionManager_textEditor_mouseDownHandler: function(event) {
		this._textEditor.validateNow();
		var localPoint = new openfl_geom_Point(this._textEditor.get_mouseX(),this._textEditor.get_mouseY());
		var viewPortVisibleBounds = this._textEditor.getViewPortVisibleBounds();
		if(!viewPortVisibleBounds.containsPoint(localPoint)) {
			return;
		}
		if(this._clickCount > 0 && openfl_Lib.getTimer() - this._lastClickTime < 300 && openfl_geom_Point.distance(localPoint,this._lastClickPos) < 10) {
			this._clickCount = this._clickCount % 3 + 1;
		} else {
			this._clickCount = 1;
		}
		var startLine = 0;
		var startChar = 0;
		var endLine = 0;
		var endChar = 0;
		var pos = this._textEditor.localToTextEditorPosition(localPoint,true);
		if(pos == null) {
			return;
		}
		if(pos.character != -1) {
			var updateSelection = true;
			if(localPoint.x < this._textEditor.get_gutterWidth()) {
				if(this._textEditor.get_selectionStartLineIndex() != pos.line && this._textEditor.get_selectionEndLineIndex() != pos.line) {
					return;
				}
				startLine = this._textEditor.get_selectionStartLineIndex();
				startChar = this._textEditor.get_selectionStartCharIndex();
				endLine = this._textEditor.get_selectionEndLineIndex();
				endChar = this._textEditor.get_selectionEndCharIndex();
				updateSelection = false;
			} else if(this._clickCount == 1) {
				startLine = event.shiftKey ? this._textEditor.get_hasSelection() ? this._textEditor.get_selectionStartLineIndex() : this._textEditor.get_caretLineIndex() : pos.line;
				startChar = event.shiftKey ? this._textEditor.get_hasSelection() ? this._textEditor.get_selectionStartCharIndex() : this._textEditor.get_caretCharIndex() : pos.character;
				endLine = pos.line;
				endChar = pos.character;
			} else if(this._clickCount == 2) {
				endLine = pos.line;
				startLine = endLine;
				startChar = pos.character - moonshine_editor_text_utils_TextUtil.wordBoundaryBackward(this._textEditor.get_lines().get(startLine).text.substring(0,pos.character));
				endChar = pos.character + moonshine_editor_text_utils_TextUtil.wordBoundaryForward(this._textEditor.get_lines().get(endLine).text.substring(pos.character));
				if(this._textEditor.get_lines().get(endLine).text.charAt(endChar - 1) == " ") {
					--endChar;
				}
			} else if(this._clickCount == 3) {
				endLine = pos.line;
				startLine = endLine;
				startChar = 0;
				endChar = this._textEditor.get_lines().get(startLine).text.length;
			} else {
				return;
			}
			if(updateSelection) {
				this._textEditor.setSelection(startLine,startChar,endLine,endChar);
			}
		} else {
			return;
		}
		this._dragStartLine = startLine;
		this._dragStartChar = startChar;
		this._dragEndChar = endChar;
		this._dragLocalPoint = localPoint;
		this._textEditor.stage.addEventListener("mouseMove",$bind(this,this.selectionManager_stage_mouseMoveHandler),false,0,true);
		this._textEditor.stage.addEventListener("mouseUp",$bind(this,this.selectionManager_stage_mouseUpHandler),false,0,true);
		this._lastClickPos = localPoint;
		this._lastClickTime = openfl_Lib.getTimer();
	}
	,selectionManager_stage_mouseMoveHandler: function(event) {
		var localPoint = new openfl_geom_Point(this._textEditor.get_mouseX(),this._textEditor.get_mouseY());
		this._dragLocalPoint = localPoint;
		this._dragScrollDeltaX = 0;
		this._dragScrollDeltaY = 0;
		var bounds = this._textEditor.getViewPortVisibleBounds();
		var minX = bounds.x + this._textEditor.get_gutterWidth();
		var maxX = bounds.x + bounds.width;
		var maxY = bounds.y + bounds.height;
		if(localPoint.x <= minX + moonshine_editor_text_managers_SelectionManager.SCROLL_THRESHOLD) {
			this._dragScrollDeltaX = Math.ceil(localPoint.x - (minX + moonshine_editor_text_managers_SelectionManager.SCROLL_THRESHOLD));
		} else if(localPoint.x >= maxX - moonshine_editor_text_managers_SelectionManager.SCROLL_THRESHOLD) {
			this._dragScrollDeltaX = Math.ceil(localPoint.x - (maxX - moonshine_editor_text_managers_SelectionManager.SCROLL_THRESHOLD));
		}
		if(localPoint.y <= moonshine_editor_text_managers_SelectionManager.SCROLL_THRESHOLD) {
			this._dragScrollDeltaY = Math.ceil((localPoint.y - moonshine_editor_text_managers_SelectionManager.SCROLL_THRESHOLD) / moonshine_editor_text_managers_SelectionManager.SCROLL_THRESHOLD);
		} else if(localPoint.y >= maxY - moonshine_editor_text_managers_SelectionManager.SCROLL_THRESHOLD) {
			this._dragScrollDeltaY = Math.ceil((localPoint.y - (maxY - moonshine_editor_text_managers_SelectionManager.SCROLL_THRESHOLD)) / moonshine_editor_text_managers_SelectionManager.SCROLL_THRESHOLD);
		}
		if(this._dragScrollDeltaX == 0 && this._dragScrollDeltaY == 0) {
			this.stopDragScroll();
			this.updateDragSelect();
		} else if(this._dragScrollTimer == null) {
			this.startDragScroll();
		}
	}
	,selectionManager_stage_mouseUpHandler: function(event) {
		var stage = js_Boot.__cast(event.currentTarget , openfl_display_Stage);
		stage.removeEventListener("mouseMove",$bind(this,this.selectionManager_stage_mouseMoveHandler));
		stage.removeEventListener("mouseUp",$bind(this,this.selectionManager_stage_mouseUpHandler));
		this.stopDragScroll();
		this._dragStartLine = -1;
		this._dragStartChar = -1;
		this._dragEndChar = -1;
	}
	,selectionManager_dragScrollTimer_timerHandler: function(event) {
		var newScrollX = this._textEditor.get_scrollX() + this._dragScrollDeltaX;
		if(newScrollX < 0) {
			newScrollX = 0;
		} else if(newScrollX > this._textEditor.get_maxScrollX()) {
			newScrollX = this._textEditor.get_maxScrollX();
		}
		this._textEditor.set_scrollX(newScrollX);
		var newLineScrollY = this._textEditor.get_lineScrollY() + this._dragScrollDeltaY;
		if(newLineScrollY < 0) {
			newLineScrollY = 0;
		} else if(newLineScrollY > this._textEditor.get_maxLineScrollY()) {
			newLineScrollY = this._textEditor.get_maxLineScrollY();
		}
		this._textEditor.set_lineScrollY(newLineScrollY);
		this.updateDragSelect();
	}
	,__class__: moonshine_editor_text_managers_SelectionManager
};
var moonshine_editor_text_managers_UndoManager = function(textEditor) {
	this._savedAt = 0;
	this._redoStack = [];
	this._undoStack = [];
	this._textEditor = textEditor;
	this._textEditor.addEventListener("keyDown",$bind(this,this.undoManager_textEditor_keyDownHandler),false,0,true);
	this._textEditor.addEventListener(moonshine_editor_text_events_TextEditorChangeEvent.TEXT_CHANGE,$bind(this,this.undoManager_textEditor_textChangeHandler),false,10,true);
};
$hxClasses["moonshine.editor.text.managers.UndoManager"] = moonshine_editor_text_managers_UndoManager;
moonshine_editor_text_managers_UndoManager.__name__ = "moonshine.editor.text.managers.UndoManager";
moonshine_editor_text_managers_UndoManager.prototype = {
	_undoStack: null
	,_redoStack: null
	,_textEditor: null
	,_savedAt: null
	,get_edited: function() {
		return this._savedAt != this._undoStack.length;
	}
	,save: function() {
		this._savedAt = this._undoStack.length;
	}
	,clear: function() {
		this._undoStack.length = 0;
		this._redoStack.length = 0;
		this._savedAt = 0;
	}
	,undo: function() {
		if(this._undoStack.length == 0) {
			return;
		}
		var changes = this._undoStack.pop();
		this._redoStack.push(changes);
		this._textEditor.dispatchEvent(new moonshine_editor_text_events_TextEditorChangeEvent(moonshine_editor_text_events_TextEditorChangeEvent.TEXT_CHANGE,changes.undo,moonshine_editor_text_events_TextEditorChangeEvent.ORIGIN_UNDO));
	}
	,redo: function() {
		if(this._redoStack.length == 0) {
			return;
		}
		var changes = this._redoStack.pop();
		this._undoStack.push(changes);
		this._textEditor.dispatchEvent(new moonshine_editor_text_events_TextEditorChangeEvent(moonshine_editor_text_events_TextEditorChangeEvent.TEXT_CHANGE,changes.redo,moonshine_editor_text_events_TextEditorChangeEvent.ORIGIN_UNDO));
	}
	,isOneLineRemoveOnly: function(changes) {
		if(changes.length != 1) {
			return false;
		}
		var change = changes[0];
		if((change.get_newText() == null || change.get_newText().length == 0) && change.get_startLine() == change.get_endLine()) {
			return change.get_startChar() != change.get_endChar();
		} else {
			return false;
		}
	}
	,isOneLineInsertOnly: function(changes) {
		if(changes.length != 1) {
			return false;
		}
		var change = changes[0];
		if(change.get_startLine() == change.get_endLine() && change.get_startChar() == change.get_endChar()) {
			return this.isOneLineOfNotEmptyText(change.get_newText());
		} else {
			return false;
		}
	}
	,isOneLineOfNotEmptyText: function(text) {
		if(text == null || text.length == 0) {
			return false;
		}
		return !new EReg("\r?\n|\r","g").match(text);
	}
	,collectChanges: function(changes) {
		var _gthis = this;
		var redoChanges = changes.slice();
		if(this._undoStack.length > 0 && this._undoStack.length != this._savedAt) {
			var previousRedoChanges = this._undoStack[this._undoStack.length - 1].redo;
			if(this.isOneLineInsertOnly(redoChanges) && this.isOneLineInsertOnly(previousRedoChanges)) {
				var newChangeInsert = redoChanges[0];
				var previousChangeInsert = previousRedoChanges[0];
				if(newChangeInsert.get_startLine() == previousChangeInsert.get_startLine() && newChangeInsert.get_startChar() == previousChangeInsert.get_startChar() + previousChangeInsert.get_newText().length) {
					var newText = previousChangeInsert.get_newText() + newChangeInsert.get_newText();
					redoChanges[0] = new moonshine_editor_text_changes_TextEditorChange(previousChangeInsert.get_startLine(),previousChangeInsert.get_startChar(),previousChangeInsert.get_endLine(),previousChangeInsert.get_endChar(),newText);
					this._undoStack.pop();
				}
			}
		}
		var reversedRedoChanges = redoChanges.slice();
		reversedRedoChanges.reverse();
		var result = new Array(reversedRedoChanges.length);
		var _g = 0;
		var _g1 = reversedRedoChanges.length;
		while(_g < _g1) {
			var i = _g++;
			var change = reversedRedoChanges[i];
			var oldText = null;
			var oldLinesCount = 1;
			if(change.get_startLine() != change.get_endLine() || change.get_startChar() != change.get_endChar()) {
				oldText = "";
				var _g2 = change.get_startLine();
				var _g3 = change.get_endLine() + 1;
				while(_g2 < _g3) {
					var i1 = _g2++;
					var line = _gthis._textEditor.get_lines().get(i1);
					var startChar = i1 == change.get_startLine() ? change.get_startChar() : 0;
					var endChar = i1 == change.get_endLine() ? change.get_endChar() : line.text.length;
					if(i1 > change.get_startLine()) {
						oldText += "\n";
						++oldLinesCount;
					}
					oldText += line.text.substring(startChar,endChar);
				}
			}
			var startLine = change.get_startLine();
			var startChar1 = change.get_startChar();
			var endLine = change.get_endLine();
			var endChar1 = change.get_endChar();
			var newLines = change.get_newText() != null ? new EReg("\r?\n|\r","g").split(change.get_newText()) : [""];
			if(oldText != null) {
				if(oldLinesCount == 1) {
					endChar1 -= oldText.length;
				} else {
					endLine -= oldLinesCount - newLines.length;
				}
			}
			if(newLines.length > 0) {
				endLine = startLine + newLines.length - 1;
				endChar1 = newLines[newLines.length - 1].length;
				if(endLine == startLine) {
					endChar1 += startChar1;
				}
			}
			result[i] = new moonshine_editor_text_changes_TextEditorChange(startLine,startChar1,endLine,endChar1,oldText);
		}
		var undoChanges = result;
		if(this._undoStack.length < this._savedAt) {
			this._savedAt = -1;
		}
		this._redoStack.length = 0;
		this._undoStack.push(new moonshine_editor_text_managers__$UndoManager_UndoRedoChanges(undoChanges,redoChanges));
	}
	,undoManager_textEditor_keyDownHandler: function(event) {
		if(event.ctrlKey && !event.altKey) {
			switch(event.keyCode) {
			case 89:
				if(event.isDefaultPrevented()) {
					return;
				}
				event.preventDefault();
				this.redo();
				break;
			case 90:
				if(event.isDefaultPrevented()) {
					return;
				}
				event.preventDefault();
				if(event.shiftKey) {
					this.redo();
				} else {
					this.undo();
				}
				break;
			}
		}
	}
	,undoManager_textEditor_textChangeHandler: function(event) {
		if(event.changes == null || event.changes.length == 0 || event.origin != moonshine_editor_text_events_TextEditorChangeEvent.ORIGIN_LOCAL) {
			return;
		}
		this.collectChanges(event.changes);
	}
	,__class__: moonshine_editor_text_managers_UndoManager
	,__properties__: {get_edited:"get_edited"}
};
var moonshine_editor_text_managers__$UndoManager_UndoRedoChanges = function(undo,redo) {
	this.undo = undo;
	this.redo = redo;
};
$hxClasses["moonshine.editor.text.managers._UndoManager.UndoRedoChanges"] = moonshine_editor_text_managers__$UndoManager_UndoRedoChanges;
moonshine_editor_text_managers__$UndoManager_UndoRedoChanges.__name__ = "moonshine.editor.text.managers._UndoManager.UndoRedoChanges";
moonshine_editor_text_managers__$UndoManager_UndoRedoChanges.prototype = {
	undo: null
	,redo: null
	,__class__: moonshine_editor_text_managers__$UndoManager_UndoRedoChanges
};
var moonshine_editor_text_syntax_format_CSSSyntaxFormatBuilder = function() {
};
$hxClasses["moonshine.editor.text.syntax.format.CSSSyntaxFormatBuilder"] = moonshine_editor_text_syntax_format_CSSSyntaxFormatBuilder;
moonshine_editor_text_syntax_format_CSSSyntaxFormatBuilder.__name__ = "moonshine.editor.text.syntax.format.CSSSyntaxFormatBuilder";
moonshine_editor_text_syntax_format_CSSSyntaxFormatBuilder.prototype = {
	_colorSettings: null
	,_fontSettings: null
	,setColorSettings: function(settings) {
		this._colorSettings = settings;
		return this;
	}
	,setFontSettings: function(settings) {
		this._fontSettings = settings;
		return this;
	}
	,build: function() {
		if(this._colorSettings == null) {
			this._colorSettings = new moonshine_editor_text_syntax_format_SyntaxColorSettings();
		}
		if(this._fontSettings == null) {
			this._fontSettings = new moonshine_editor_text_syntax_format_SyntaxFontSettings();
		}
		var formats = new haxe_ds_IntMap();
		var value = this.getTextFormat(this._colorSettings.typeNameColor);
		formats.h[moonshine_editor_text_syntax_parser_CSSLineParser.CSS_TEXT] = value;
		var value = this.getTextFormat(this._colorSettings.fieldNameColor);
		formats.h[moonshine_editor_text_syntax_parser_CSSLineParser.CSS_PROPERTY] = value;
		var value = this.getTextFormat(this._colorSettings.valueColor);
		formats.h[moonshine_editor_text_syntax_parser_CSSLineParser.CSS_VALUE] = value;
		var value = this.getTextFormat(this._colorSettings.colorColor);
		formats.h[moonshine_editor_text_syntax_parser_CSSLineParser.CSS_COLOR] = value;
		var value = this.getTextFormat(this._colorSettings.numberColor);
		formats.h[moonshine_editor_text_syntax_parser_CSSLineParser.CSS_NUMBER] = value;
		var value = this.getTextFormat(this._colorSettings.keywordColor);
		formats.h[moonshine_editor_text_syntax_parser_CSSLineParser.CSS_MEDIA] = value;
		var value = this.getTextFormat(this._colorSettings.foregroundColor);
		formats.h[moonshine_editor_text_syntax_parser_CSSLineParser.CSS_BRACEOPEN] = value;
		var value = this.getTextFormat(this._colorSettings.foregroundColor);
		formats.h[moonshine_editor_text_syntax_parser_CSSLineParser.CSS_BRACECLOSE] = value;
		var value = this.getTextFormat(this._colorSettings.foregroundColor);
		formats.h[moonshine_editor_text_syntax_parser_CSSLineParser.CSS_COLON1] = value;
		var value = this.getTextFormat(this._colorSettings.foregroundColor);
		formats.h[moonshine_editor_text_syntax_parser_CSSLineParser.CSS_COLON2] = value;
		var value = this.getTextFormat(this._colorSettings.foregroundColor);
		formats.h[moonshine_editor_text_syntax_parser_CSSLineParser.CSS_COLON3] = value;
		var value = this.getTextFormat(this._colorSettings.stringColor);
		formats.h[moonshine_editor_text_syntax_parser_CSSLineParser.CSS_STRING1] = value;
		var value = this.getTextFormat(this._colorSettings.stringColor);
		formats.h[moonshine_editor_text_syntax_parser_CSSLineParser.CSS_STRING2] = value;
		var value = this.getTextFormat(this._colorSettings.stringColor);
		formats.h[moonshine_editor_text_syntax_parser_CSSLineParser.CSS_STRING3] = value;
		var value = this.getTextFormat(this._colorSettings.stringColor);
		formats.h[moonshine_editor_text_syntax_parser_CSSLineParser.CSS_STRING4] = value;
		var value = this.getTextFormat(this._colorSettings.commentColor);
		formats.h[moonshine_editor_text_syntax_parser_CSSLineParser.CSS_COMMENT1] = value;
		var value = this.getTextFormat(this._colorSettings.commentColor);
		formats.h[moonshine_editor_text_syntax_parser_CSSLineParser.CSS_COMMENT2] = value;
		var value = this.getTextFormat(this._colorSettings.commentColor);
		formats.h[moonshine_editor_text_syntax_parser_CSSLineParser.CSS_COMMENT3] = value;
		return formats;
	}
	,getTextFormat: function(fontColor) {
		var format = new openfl_text_TextFormat(this._fontSettings.fontFamily,this._fontSettings.fontSize,fontColor);
		format.tabStops = this._fontSettings.tabStops;
		return format;
	}
	,__class__: moonshine_editor_text_syntax_format_CSSSyntaxFormatBuilder
};
var moonshine_editor_text_syntax_format_JSSyntaxFormatBuilder = function() {
};
$hxClasses["moonshine.editor.text.syntax.format.JSSyntaxFormatBuilder"] = moonshine_editor_text_syntax_format_JSSyntaxFormatBuilder;
moonshine_editor_text_syntax_format_JSSyntaxFormatBuilder.__name__ = "moonshine.editor.text.syntax.format.JSSyntaxFormatBuilder";
moonshine_editor_text_syntax_format_JSSyntaxFormatBuilder.prototype = {
	_colorSettings: null
	,_fontSettings: null
	,setColorSettings: function(settings) {
		this._colorSettings = settings;
		return this;
	}
	,setFontSettings: function(settings) {
		this._fontSettings = settings;
		return this;
	}
	,build: function() {
		if(this._colorSettings == null) {
			this._colorSettings = new moonshine_editor_text_syntax_format_SyntaxColorSettings();
		}
		if(this._fontSettings == null) {
			this._fontSettings = new moonshine_editor_text_syntax_format_SyntaxFontSettings();
		}
		var formats = new haxe_ds_IntMap();
		var value = this.getTextFormat(this._colorSettings.invalidColor);
		formats.h[0] = value;
		var value = this.getTextFormat(this._colorSettings.foregroundColor);
		formats.h[moonshine_editor_text_syntax_parser_JSLineParser.JS_CODE] = value;
		var value = this.getTextFormat(this._colorSettings.stringColor);
		formats.h[moonshine_editor_text_syntax_parser_JSLineParser.JS_STRING1] = value;
		var value = this.getTextFormat(this._colorSettings.stringColor);
		formats.h[moonshine_editor_text_syntax_parser_JSLineParser.JS_STRING2] = value;
		var value = this.getTextFormat(this._colorSettings.commentColor);
		formats.h[moonshine_editor_text_syntax_parser_JSLineParser.JS_COMMENT] = value;
		var value = this.getTextFormat(this._colorSettings.commentColor);
		formats.h[moonshine_editor_text_syntax_parser_JSLineParser.JS_MULTILINE_COMMENT] = value;
		var value = this.getTextFormat(this._colorSettings.regExpColor);
		formats.h[moonshine_editor_text_syntax_parser_JSLineParser.JS_REGULAR_EXPRESSION] = value;
		var value = this.getTextFormat(this._colorSettings.keywordColor);
		formats.h[moonshine_editor_text_syntax_parser_JSLineParser.JS_BOOLEAN_KEYWORD] = value;
		var value = this.getTextFormat(this._colorSettings.keywordColor);
		formats.h[moonshine_editor_text_syntax_parser_JSLineParser.JS_UNDEFINED_KEYWORD] = value;
		var value = this.getTextFormat(this._colorSettings.keywordColor);
		formats.h[moonshine_editor_text_syntax_parser_JSLineParser.JS_NULL_KEYWORD] = value;
		var value = this.getTextFormat(this._colorSettings.keywordColor);
		formats.h[moonshine_editor_text_syntax_parser_JSLineParser.JS_KEYWORD] = value;
		var value = this.getTextFormat(this._colorSettings.fieldKeywordColor);
		formats.h[moonshine_editor_text_syntax_parser_JSLineParser.JS_VAR_KEYWORD] = value;
		var value = this.getTextFormat(this._colorSettings.methodKeywordColor);
		formats.h[moonshine_editor_text_syntax_parser_JSLineParser.JS_FUNCTION_KEYWORD] = value;
		var value = this.getTextFormat(this._colorSettings.typeKeywordColor);
		formats.h[moonshine_editor_text_syntax_parser_JSLineParser.JS_TYPE_KEYWORD] = value;
		return formats;
	}
	,getTextFormat: function(fontColor) {
		var format = new openfl_text_TextFormat(this._fontSettings.fontFamily,this._fontSettings.fontSize,fontColor);
		format.tabStops = this._fontSettings.tabStops;
		return format;
	}
	,__class__: moonshine_editor_text_syntax_format_JSSyntaxFormatBuilder
};
var moonshine_editor_text_syntax_format_PlainTextFormatBuilder = function() {
};
$hxClasses["moonshine.editor.text.syntax.format.PlainTextFormatBuilder"] = moonshine_editor_text_syntax_format_PlainTextFormatBuilder;
moonshine_editor_text_syntax_format_PlainTextFormatBuilder.__name__ = "moonshine.editor.text.syntax.format.PlainTextFormatBuilder";
moonshine_editor_text_syntax_format_PlainTextFormatBuilder.prototype = {
	_colorSettings: null
	,_fontSettings: null
	,setColorSettings: function(settings) {
		this._colorSettings = settings;
		return this;
	}
	,setFontSettings: function(settings) {
		this._fontSettings = settings;
		return this;
	}
	,build: function() {
		if(this._colorSettings == null) {
			this._colorSettings = new moonshine_editor_text_syntax_format_SyntaxColorSettings();
		}
		if(this._fontSettings == null) {
			this._fontSettings = new moonshine_editor_text_syntax_format_SyntaxFontSettings();
		}
		var formats = new haxe_ds_IntMap();
		var value = this.getTextFormat(this._colorSettings.foregroundColor);
		formats.h[moonshine_editor_text_syntax_parser_PlainTextLineParser.TEXT] = value;
		return formats;
	}
	,getTextFormat: function(fontColor) {
		var format = new openfl_text_TextFormat(this._fontSettings.fontFamily,this._fontSettings.fontSize,fontColor);
		format.tabStops = this._fontSettings.tabStops;
		return format;
	}
	,__class__: moonshine_editor_text_syntax_format_PlainTextFormatBuilder
};
var moonshine_editor_text_syntax_format_SyntaxColorSettings = function() {
	this.unverifiedBreakpointColor = 8684676;
	this.breakpointColor = 15012864;
	this.searchResultBackgroundColor = 11054228;
	this.debuggerStoppedLineBackgroundColor = 16777164;
	this.focusedLineBackgroundColor = 15596539;
	this.selectionUnfocusedBackgroundAlpha = 0.5;
	this.selectionUnfocusedBackgroundColor = 11392767;
	this.selectionBackgroundAlpha = 1.0;
	this.selectionBackgroundColor = 11392767;
	this.preprocessorColor = 10687765;
	this.annotationColor = 8421376;
	this.punctuationTagBrackets = 8388608;
	this.tagAttributeNameColor = 16711680;
	this.tagNameColor = 8388608;
	this.languageConstantNameColor = 2523033;
	this.typeNameColor = 2523033;
	this.parameterNameColor = 4224;
	this.methodNameColor = 7953958;
	this.fieldNameColor = 4224;
	this.thisSelfKeywordColor = 255;
	this.moduleKeywordColor = 255;
	this.typeKeywordColor = 255;
	this.methodKeywordColor = 255;
	this.fieldKeywordColor = 255;
	this.keywordColor = 255;
	this.valueColor = 283045;
	this.colorColor = 283045;
	this.regExpColor = 8462143;
	this.commentColor = 32768;
	this.numberColor = 624216;
	this.stringColor = 10687765;
	this.invalidColor = 13447473;
	this.foregroundColor = 1250067;
	this.backgroundColor = 16777214;
};
$hxClasses["moonshine.editor.text.syntax.format.SyntaxColorSettings"] = moonshine_editor_text_syntax_format_SyntaxColorSettings;
moonshine_editor_text_syntax_format_SyntaxColorSettings.__name__ = "moonshine.editor.text.syntax.format.SyntaxColorSettings";
moonshine_editor_text_syntax_format_SyntaxColorSettings.monokai = function() {
	var settings = new moonshine_editor_text_syntax_format_SyntaxColorSettings();
	settings.backgroundColor = 2566178;
	settings.foregroundColor = 16316658;
	settings.invalidColor = 16009031;
	settings.stringColor = 15129460;
	settings.numberColor = 11436543;
	settings.commentColor = 8946799;
	settings.regExpColor = 11436543;
	settings.colorColor = 11436543;
	settings.valueColor = 11436543;
	settings.keywordColor = 16328306;
	settings.fieldKeywordColor = 6740463;
	settings.methodKeywordColor = 6740463;
	settings.typeKeywordColor = 6740463;
	settings.moduleKeywordColor = 16328306;
	settings.thisSelfKeywordColor = 16619295;
	settings.fieldNameColor = 16316658;
	settings.methodNameColor = 10936878;
	settings.parameterNameColor = 16619295;
	settings.typeNameColor = 6740463;
	settings.languageConstantNameColor = 2523033;
	settings.tagNameColor = 16328306;
	settings.tagAttributeNameColor = 10936878;
	settings.punctuationTagBrackets = 16316658;
	settings.annotationColor = 11053218;
	settings.preprocessorColor = 11053218;
	settings.selectionBackgroundColor = 8883089;
	settings.selectionBackgroundAlpha = 0.50196078431372548;
	settings.selectionUnfocusedBackgroundColor = 8883089;
	settings.selectionUnfocusedBackgroundAlpha = 0.50196078431372548;
	settings.focusedLineBackgroundColor = 3618093;
	settings.debuggerStoppedLineBackgroundColor = 6776141;
	settings.searchResultBackgroundColor = 5332074;
	settings.breakpointColor = 15012864;
	settings.unverifiedBreakpointColor = 8684676;
	return settings;
};
moonshine_editor_text_syntax_format_SyntaxColorSettings.defaultDark = function() {
	var settings = new moonshine_editor_text_syntax_format_SyntaxColorSettings();
	settings.backgroundColor = 1973790;
	settings.foregroundColor = 12303291;
	settings.invalidColor = 16009031;
	settings.stringColor = 13537656;
	settings.numberColor = 11914920;
	settings.commentColor = 6986069;
	settings.regExpColor = 6579861;
	settings.colorColor = 13537656;
	settings.valueColor = 13537656;
	settings.keywordColor = 5676246;
	settings.fieldKeywordColor = 5676246;
	settings.methodKeywordColor = 5676246;
	settings.typeKeywordColor = 5676246;
	settings.moduleKeywordColor = 5676246;
	settings.thisSelfKeywordColor = 5676246;
	settings.fieldNameColor = 9230588;
	settings.methodNameColor = 14276516;
	settings.parameterNameColor = 10280190;
	settings.typeNameColor = 5163440;
	settings.languageConstantNameColor = 2523033;
	settings.tagNameColor = 5676246;
	settings.tagAttributeNameColor = 9230588;
	settings.punctuationTagBrackets = 8421504;
	settings.annotationColor = 10526784;
	settings.preprocessorColor = 8355711;
	settings.selectionBackgroundColor = 2510712;
	settings.selectionBackgroundAlpha = 1.0;
	settings.selectionUnfocusedBackgroundColor = 2510712;
	settings.selectionUnfocusedBackgroundAlpha = 0.5;
	settings.focusedLineBackgroundColor = 2371632;
	settings.debuggerStoppedLineBackgroundColor = 5591104;
	settings.searchResultBackgroundColor = 5332074;
	settings.breakpointColor = 15012864;
	settings.unverifiedBreakpointColor = 8684676;
	return settings;
};
moonshine_editor_text_syntax_format_SyntaxColorSettings.defaultLight = function() {
	return new moonshine_editor_text_syntax_format_SyntaxColorSettings();
};
moonshine_editor_text_syntax_format_SyntaxColorSettings.prototype = {
	backgroundColor: null
	,foregroundColor: null
	,invalidColor: null
	,stringColor: null
	,numberColor: null
	,commentColor: null
	,regExpColor: null
	,colorColor: null
	,valueColor: null
	,keywordColor: null
	,fieldKeywordColor: null
	,methodKeywordColor: null
	,typeKeywordColor: null
	,moduleKeywordColor: null
	,thisSelfKeywordColor: null
	,fieldNameColor: null
	,methodNameColor: null
	,parameterNameColor: null
	,typeNameColor: null
	,languageConstantNameColor: null
	,tagNameColor: null
	,tagAttributeNameColor: null
	,punctuationTagBrackets: null
	,annotationColor: null
	,preprocessorColor: null
	,selectionBackgroundColor: null
	,selectionBackgroundAlpha: null
	,selectionUnfocusedBackgroundColor: null
	,selectionUnfocusedBackgroundAlpha: null
	,focusedLineBackgroundColor: null
	,debuggerStoppedLineBackgroundColor: null
	,searchResultBackgroundColor: null
	,breakpointColor: null
	,unverifiedBreakpointColor: null
	,__class__: moonshine_editor_text_syntax_format_SyntaxColorSettings
};
var moonshine_editor_text_syntax_format_SyntaxFontSettings = function(fontFamily,fontSize) {
	if(fontSize == null) {
		fontSize = 14;
	}
	if(fontFamily == null) {
		fontFamily = "_typewriter";
	}
	var stops = [];
	var value = 0;
	var _g = 0;
	while(_g < 100) {
		var i = _g++;
		value += 32;
		stops.push(value);
	}
	this.tabStops = stops;
	this.fontFamily = fontFamily;
	this.fontSize = fontSize;
};
$hxClasses["moonshine.editor.text.syntax.format.SyntaxFontSettings"] = moonshine_editor_text_syntax_format_SyntaxFontSettings;
moonshine_editor_text_syntax_format_SyntaxFontSettings.__name__ = "moonshine.editor.text.syntax.format.SyntaxFontSettings";
moonshine_editor_text_syntax_format_SyntaxFontSettings.prototype = {
	fontFamily: null
	,fontSize: null
	,tabStops: null
	,__class__: moonshine_editor_text_syntax_format_SyntaxFontSettings
};
var moonshine_editor_text_syntax_parser_ILineParser = function() { };
$hxClasses["moonshine.editor.text.syntax.parser.ILineParser"] = moonshine_editor_text_syntax_parser_ILineParser;
moonshine_editor_text_syntax_parser_ILineParser.__name__ = "moonshine.editor.text.syntax.parser.ILineParser";
moonshine_editor_text_syntax_parser_ILineParser.__isInterface__ = true;
moonshine_editor_text_syntax_parser_ILineParser.prototype = {
	get_defaultContext: null
	,setContext: null
	,parse: null
	,__class__: moonshine_editor_text_syntax_parser_ILineParser
	,__properties__: {get_defaultContext:"get_defaultContext"}
};
var moonshine_editor_text_syntax_parser_context_ContextSwitchLineParser = function() {
	this._defaultContext = 0;
	this.context = 0;
	openfl_events_EventDispatcher.call(this);
};
$hxClasses["moonshine.editor.text.syntax.parser.context.ContextSwitchLineParser"] = moonshine_editor_text_syntax_parser_context_ContextSwitchLineParser;
moonshine_editor_text_syntax_parser_context_ContextSwitchLineParser.__name__ = "moonshine.editor.text.syntax.parser.context.ContextSwitchLineParser";
moonshine_editor_text_syntax_parser_context_ContextSwitchLineParser.__interfaces__ = [moonshine_editor_text_syntax_parser_ILineParser];
moonshine_editor_text_syntax_parser_context_ContextSwitchLineParser.__super__ = openfl_events_EventDispatcher;
moonshine_editor_text_syntax_parser_context_ContextSwitchLineParser.prototype = $extend(openfl_events_EventDispatcher.prototype,{
	switchManager: null
	,parserManager: null
	,context: null
	,_defaultContext: null
	,get_defaultContext: function() {
		return this._defaultContext;
	}
	,setContext: function(newContext) {
		this.context = newContext;
	}
	,parse: function(sourceCode,startLine,startChar,endLine,endChar) {
		var result = [];
		var tail = sourceCode;
		var pos = 0;
		var curContext = 0;
		var curParser;
		if(this.switchManager != null) {
			while(tail.length > 0) {
				var firstMatch = null;
				var whiteSpacePattern = new EReg("^\\s+","");
				if(whiteSpacePattern.match(tail)) {
					var whiteSpacePos = whiteSpacePattern.matchedPos();
					if(whiteSpacePos.len == tail.length) {
						break;
					}
					pos += whiteSpacePos.len;
					tail = HxOverrides.substr(sourceCode,pos,null);
				}
				curContext = this.context != 0 ? this.context : this._defaultContext;
				if(this.parserManager != null) {
					curParser = this.parserManager.getParser(curContext);
					if(curParser != null) {
						curContext = curParser.contextMask;
					}
				}
				var curSwitches = this.switchManager.getSwitches(curContext);
				if(curSwitches != null) {
					var _g = 0;
					while(_g < curSwitches.length) {
						var swtch = curSwitches[_g];
						++_g;
						if(swtch.pattern != null) {
							if(swtch.pattern.match(tail)) {
								var matchPos = swtch.pattern.matchedPos();
								if(firstMatch == null || matchPos.pos < firstMatch.index) {
									firstMatch = { swtch : swtch, index : matchPos.pos, length : matchPos.len};
								}
							}
						} else {
							firstMatch = { swtch : swtch, index : 0, length : 0};
						}
						if(firstMatch != null && firstMatch.index == 0) {
							break;
						}
					}
				}
				if(firstMatch != null) {
					var firstSwitch = firstMatch.swtch;
					var matchPos1 = firstMatch.index;
					var matchLen = firstMatch.length;
					var contextPos = pos + matchPos1 + (firstSwitch.post ? matchLen : 0);
					if(result.length == 0 && contextPos > 0) {
						result.push(0);
						result.push(this.context != 0 ? this.context : this._defaultContext);
					}
					this.context = firstSwitch.to;
					if(result.length > 0 && result[result.length - 1] != this.context) {
						if(result[result.length - 2] == contextPos) {
							result[result.length - 1] = this.context;
						} else {
							result.push(contextPos);
							result.push(this.context);
						}
					}
					pos += matchPos1 + matchLen;
					tail = HxOverrides.substr(sourceCode,pos,null);
				} else {
					break;
				}
			}
		}
		if(result.length == 0) {
			result.push(0);
			result.push(this.context != 0 ? this.context : this._defaultContext);
		}
		if(this.parserManager != null) {
			var i = result.length - 1;
			while(i > 0) {
				curContext = result[i];
				curParser = this.parserManager.getParser(curContext);
				if(curParser != null) {
					var inlinePos = result[i - 1];
					var inlineMask = curParser.contextMask;
					var inlineCutoff = i < result.length - 1 ? result[i + 1] : sourceCode.length;
					tail = sourceCode.substring(inlinePos,inlineCutoff) + "\n";
					curParser.parser.setContext(curContext & ~inlineMask);
					var inlineResult = curParser.parser.parse(tail,startLine,startChar,endLine,endChar);
					result.splice(i - 1,2);
					var n = 0;
					while(n < inlineResult.length) {
						pos = inlineResult[n] + inlinePos;
						if(inlineCutoff < 0 || pos < inlineCutoff) {
							var index = i - 1 + n;
							result.splice(index,0,pos);
							++index;
							result.splice(index,0,inlineResult[n + 1] | inlineMask);
						}
						n += 2;
					}
					this.context = result[result.length - 1];
				}
				i -= 2;
			}
		}
		return result;
	}
	,__class__: moonshine_editor_text_syntax_parser_context_ContextSwitchLineParser
	,__properties__: {get_defaultContext:"get_defaultContext"}
});
var moonshine_editor_text_syntax_parser_CSSLineParser = function() {
	moonshine_editor_text_syntax_parser_context_ContextSwitchLineParser.call(this);
	this.context = moonshine_editor_text_syntax_parser_CSSLineParser.CSS_TEXT;
	this._defaultContext = moonshine_editor_text_syntax_parser_CSSLineParser.CSS_TEXT;
	this.switchManager = new moonshine_editor_text_syntax_parser_context_ContextSwitchManager([new moonshine_editor_text_syntax_parser_context_ContextSwitch([moonshine_editor_text_syntax_parser_CSSLineParser.CSS_TEXT],moonshine_editor_text_syntax_parser_CSSLineParser.CSS_COMMENT1,new EReg("/\\*","")),new moonshine_editor_text_syntax_parser_context_ContextSwitch([moonshine_editor_text_syntax_parser_CSSLineParser.CSS_COMMENT1],moonshine_editor_text_syntax_parser_CSSLineParser.CSS_TEXT,new EReg("\\*/",""),true),new moonshine_editor_text_syntax_parser_context_ContextSwitch([moonshine_editor_text_syntax_parser_CSSLineParser.CSS_PROPERTY],moonshine_editor_text_syntax_parser_CSSLineParser.CSS_COMMENT2,new EReg("/\\*","")),new moonshine_editor_text_syntax_parser_context_ContextSwitch([moonshine_editor_text_syntax_parser_CSSLineParser.CSS_COMMENT2],moonshine_editor_text_syntax_parser_CSSLineParser.CSS_PROPERTY,new EReg("\\*/",""),true),new moonshine_editor_text_syntax_parser_context_ContextSwitch([moonshine_editor_text_syntax_parser_CSSLineParser.CSS_VALUE],moonshine_editor_text_syntax_parser_CSSLineParser.CSS_COMMENT3,new EReg("/\\*","")),new moonshine_editor_text_syntax_parser_context_ContextSwitch([moonshine_editor_text_syntax_parser_CSSLineParser.CSS_COMMENT3],moonshine_editor_text_syntax_parser_CSSLineParser.CSS_VALUE,new EReg("\\*/",""),true),new moonshine_editor_text_syntax_parser_context_ContextSwitch([moonshine_editor_text_syntax_parser_CSSLineParser.CSS_TEXT],moonshine_editor_text_syntax_parser_CSSLineParser.CSS_MEDIA,new EReg("@media(?=[;{\\s])",""),true),new moonshine_editor_text_syntax_parser_context_ContextSwitch([moonshine_editor_text_syntax_parser_CSSLineParser.CSS_MEDIA],moonshine_editor_text_syntax_parser_CSSLineParser.CSS_TEXT,new EReg("[{\r\n]","")),new moonshine_editor_text_syntax_parser_context_ContextSwitch([moonshine_editor_text_syntax_parser_CSSLineParser.CSS_TEXT,moonshine_editor_text_syntax_parser_CSSLineParser.CSS_MEDIA],moonshine_editor_text_syntax_parser_CSSLineParser.CSS_COLON1,new EReg(";","")),new moonshine_editor_text_syntax_parser_context_ContextSwitch([moonshine_editor_text_syntax_parser_CSSLineParser.CSS_COLON1],moonshine_editor_text_syntax_parser_CSSLineParser.CSS_TEXT),new moonshine_editor_text_syntax_parser_context_ContextSwitch([moonshine_editor_text_syntax_parser_CSSLineParser.CSS_TEXT],moonshine_editor_text_syntax_parser_CSSLineParser.CSS_BRACEOPEN,new EReg("\\{","")),new moonshine_editor_text_syntax_parser_context_ContextSwitch([moonshine_editor_text_syntax_parser_CSSLineParser.CSS_BRACEOPEN],moonshine_editor_text_syntax_parser_CSSLineParser.CSS_PROPERTY),new moonshine_editor_text_syntax_parser_context_ContextSwitch([moonshine_editor_text_syntax_parser_CSSLineParser.CSS_PROPERTY,moonshine_editor_text_syntax_parser_CSSLineParser.CSS_VALUE],moonshine_editor_text_syntax_parser_CSSLineParser.CSS_BRACECLOSE,new EReg("\\}","")),new moonshine_editor_text_syntax_parser_context_ContextSwitch([moonshine_editor_text_syntax_parser_CSSLineParser.CSS_BRACECLOSE],moonshine_editor_text_syntax_parser_CSSLineParser.CSS_TEXT,new EReg("(?=.)","")),new moonshine_editor_text_syntax_parser_context_ContextSwitch([moonshine_editor_text_syntax_parser_CSSLineParser.CSS_PROPERTY],moonshine_editor_text_syntax_parser_CSSLineParser.CSS_COLON2,new EReg(":","")),new moonshine_editor_text_syntax_parser_context_ContextSwitch([moonshine_editor_text_syntax_parser_CSSLineParser.CSS_COLON2],moonshine_editor_text_syntax_parser_CSSLineParser.CSS_VALUE),new moonshine_editor_text_syntax_parser_context_ContextSwitch([moonshine_editor_text_syntax_parser_CSSLineParser.CSS_VALUE],moonshine_editor_text_syntax_parser_CSSLineParser.CSS_PROPERTY,new EReg("[\r\n]","")),new moonshine_editor_text_syntax_parser_context_ContextSwitch([moonshine_editor_text_syntax_parser_CSSLineParser.CSS_VALUE],moonshine_editor_text_syntax_parser_CSSLineParser.CSS_COLON3,new EReg(";","")),new moonshine_editor_text_syntax_parser_context_ContextSwitch([moonshine_editor_text_syntax_parser_CSSLineParser.CSS_COLON3],moonshine_editor_text_syntax_parser_CSSLineParser.CSS_PROPERTY),new moonshine_editor_text_syntax_parser_context_ContextSwitch([moonshine_editor_text_syntax_parser_CSSLineParser.CSS_VALUE],moonshine_editor_text_syntax_parser_CSSLineParser.CSS_COLOR,new EReg("#[0-9a-fA-F]{3,8}","")),new moonshine_editor_text_syntax_parser_context_ContextSwitch([moonshine_editor_text_syntax_parser_CSSLineParser.CSS_COLOR],moonshine_editor_text_syntax_parser_CSSLineParser.CSS_VALUE),new moonshine_editor_text_syntax_parser_context_ContextSwitch([moonshine_editor_text_syntax_parser_CSSLineParser.CSS_VALUE],moonshine_editor_text_syntax_parser_CSSLineParser.CSS_NUMBER,new EReg("\\-?((\\.[0-9]+)|([0-9]+(\\.[0-9]+)?))","")),new moonshine_editor_text_syntax_parser_context_ContextSwitch([moonshine_editor_text_syntax_parser_CSSLineParser.CSS_NUMBER],moonshine_editor_text_syntax_parser_CSSLineParser.CSS_VALUE),new moonshine_editor_text_syntax_parser_context_ContextSwitch([moonshine_editor_text_syntax_parser_CSSLineParser.CSS_TEXT],moonshine_editor_text_syntax_parser_CSSLineParser.CSS_STRING1,new EReg("\"","")),new moonshine_editor_text_syntax_parser_context_ContextSwitch([moonshine_editor_text_syntax_parser_CSSLineParser.CSS_TEXT],moonshine_editor_text_syntax_parser_CSSLineParser.CSS_STRING2,new EReg("'","")),new moonshine_editor_text_syntax_parser_context_ContextSwitch([moonshine_editor_text_syntax_parser_CSSLineParser.CSS_STRING1],moonshine_editor_text_syntax_parser_CSSLineParser.CSS_STRING1,new EReg("\\\\[\"\r\n]","")),new moonshine_editor_text_syntax_parser_context_ContextSwitch([moonshine_editor_text_syntax_parser_CSSLineParser.CSS_STRING2],moonshine_editor_text_syntax_parser_CSSLineParser.CSS_STRING2,new EReg("\\\\['\r\n]","")),new moonshine_editor_text_syntax_parser_context_ContextSwitch([moonshine_editor_text_syntax_parser_CSSLineParser.CSS_STRING1],moonshine_editor_text_syntax_parser_CSSLineParser.CSS_TEXT,new EReg("\"|(?=[\r\n])",""),true),new moonshine_editor_text_syntax_parser_context_ContextSwitch([moonshine_editor_text_syntax_parser_CSSLineParser.CSS_STRING2],moonshine_editor_text_syntax_parser_CSSLineParser.CSS_TEXT,new EReg("'|(?=[\r\n])",""),true),new moonshine_editor_text_syntax_parser_context_ContextSwitch([moonshine_editor_text_syntax_parser_CSSLineParser.CSS_VALUE],moonshine_editor_text_syntax_parser_CSSLineParser.CSS_STRING3,new EReg("\"","")),new moonshine_editor_text_syntax_parser_context_ContextSwitch([moonshine_editor_text_syntax_parser_CSSLineParser.CSS_VALUE],moonshine_editor_text_syntax_parser_CSSLineParser.CSS_STRING4,new EReg("'","")),new moonshine_editor_text_syntax_parser_context_ContextSwitch([moonshine_editor_text_syntax_parser_CSSLineParser.CSS_STRING3],moonshine_editor_text_syntax_parser_CSSLineParser.CSS_STRING3,new EReg("\\\\[\"\r\n]","")),new moonshine_editor_text_syntax_parser_context_ContextSwitch([moonshine_editor_text_syntax_parser_CSSLineParser.CSS_STRING4],moonshine_editor_text_syntax_parser_CSSLineParser.CSS_STRING4,new EReg("\\\\['\r\n]","")),new moonshine_editor_text_syntax_parser_context_ContextSwitch([moonshine_editor_text_syntax_parser_CSSLineParser.CSS_STRING3],moonshine_editor_text_syntax_parser_CSSLineParser.CSS_VALUE,new EReg("\"|(?=[\r\n])",""),true),new moonshine_editor_text_syntax_parser_context_ContextSwitch([moonshine_editor_text_syntax_parser_CSSLineParser.CSS_STRING4],moonshine_editor_text_syntax_parser_CSSLineParser.CSS_VALUE,new EReg("'|(?=[\r\n])",""),true)]);
};
$hxClasses["moonshine.editor.text.syntax.parser.CSSLineParser"] = moonshine_editor_text_syntax_parser_CSSLineParser;
moonshine_editor_text_syntax_parser_CSSLineParser.__name__ = "moonshine.editor.text.syntax.parser.CSSLineParser";
moonshine_editor_text_syntax_parser_CSSLineParser.__super__ = moonshine_editor_text_syntax_parser_context_ContextSwitchLineParser;
moonshine_editor_text_syntax_parser_CSSLineParser.prototype = $extend(moonshine_editor_text_syntax_parser_context_ContextSwitchLineParser.prototype,{
	__class__: moonshine_editor_text_syntax_parser_CSSLineParser
});
var moonshine_editor_text_syntax_parser_InlineParser = function(contextMask,parser) {
	this.contextMask = contextMask;
	this.parser = parser;
};
$hxClasses["moonshine.editor.text.syntax.parser.InlineParser"] = moonshine_editor_text_syntax_parser_InlineParser;
moonshine_editor_text_syntax_parser_InlineParser.__name__ = "moonshine.editor.text.syntax.parser.InlineParser";
moonshine_editor_text_syntax_parser_InlineParser.prototype = {
	contextMask: null
	,parser: null
	,__class__: moonshine_editor_text_syntax_parser_InlineParser
};
var moonshine_editor_text_syntax_parser_LineParser = function() {
	this._defaultContext = 1;
	this.context = 1;
	this.keywordSet = new haxe_ds_StringMap();
	this.caseSensitiveKeywords = true;
	openfl_events_EventDispatcher.call(this);
};
$hxClasses["moonshine.editor.text.syntax.parser.LineParser"] = moonshine_editor_text_syntax_parser_LineParser;
moonshine_editor_text_syntax_parser_LineParser.__name__ = "moonshine.editor.text.syntax.parser.LineParser";
moonshine_editor_text_syntax_parser_LineParser.__interfaces__ = [moonshine_editor_text_syntax_parser_ILineParser];
moonshine_editor_text_syntax_parser_LineParser.__super__ = openfl_events_EventDispatcher;
moonshine_editor_text_syntax_parser_LineParser.prototype = $extend(openfl_events_EventDispatcher.prototype,{
	wordBoundaries: null
	,patterns: null
	,endPatterns: null
	,keywords: null
	,caseSensitiveKeywords: null
	,keywordSet: null
	,context: null
	,_defaultContext: null
	,get_defaultContext: function() {
		return this._defaultContext;
	}
	,result: null
	,setContext: function(newContext) {
		this.context = newContext;
	}
	,parse: function(sourceCode,startLine,startChar,endLine,endChar) {
		this.initializeKeywordSet();
		this.result = [];
		if(this.endPatterns != null) {
			var _g = 0;
			var _g1 = this.endPatterns;
			while(_g < _g1.length) {
				var endPattern = _g1[_g];
				++_g;
				if(endPattern.type == this.context) {
					this.result.push(0);
					this.result.push(this.context);
					this.findContextEnd(sourceCode,endPattern.expression);
					break;
				}
			}
		}
		if(this.result.length == 0) {
			this.splitOnContext(sourceCode);
		}
		this.context = this.result[this.result.length - 1];
		return this.result;
	}
	,findContextEnd: function(source,endPattern) {
		if(endPattern.match(source)) {
			var matchPos = endPattern.matchedPos();
			var matchLen = matchPos.len;
			var matchIndex = matchPos.pos;
			this.splitOnContext(HxOverrides.substr(source,matchIndex + matchLen,null),matchIndex + matchLen);
		}
	}
	,initializeKeywordSet: function() {
		this.keywordSet.h = Object.create(null);
		if(this.keywords == null) {
			return;
		}
		var keywordType = this.keywords.keys();
		while(keywordType.hasNext()) {
			var keywordType1 = keywordType.next();
			var keywordsOfType = this.keywords.h[keywordType1];
			var _g = 0;
			while(_g < keywordsOfType.length) {
				var keyword = keywordsOfType[_g];
				++_g;
				if(!this.caseSensitiveKeywords) {
					keyword = keyword.toLowerCase();
				}
				this.keywordSet.h[keyword] = keywordType1;
			}
		}
	}
	,splitOnContext: function(tail,pos) {
		if(pos == null) {
			pos = 0;
		}
		var style = 0;
		var lastStyle = -1;
		var head = "";
		while(tail.length > 0) {
			var token = 0;
			if(this.patterns != null) {
				var _g = 0;
				var _g1 = this.patterns;
				while(_g < _g1.length) {
					var pattern = _g1[_g];
					++_g;
					var expression = pattern.expression;
					if(expression.match(tail)) {
						token = expression.matched(0).length;
						lastStyle = style;
						style = pattern.type;
						break;
					}
				}
			}
			if(token == 0) {
				token = 1;
				head += tail.charAt(0);
				lastStyle = style;
				style = this._defaultContext;
			} else if(style != lastStyle && lastStyle == this._defaultContext) {
				this.splitOnKeywords(head,pos - head.length);
				head = "";
			}
			if(style != lastStyle && head.length == 0) {
				this.result.push(pos);
				this.result.push(style);
			}
			pos += token;
			tail = tail.substring(token);
		}
		if(head.length > 0) {
			this.splitOnKeywords(head,pos - head.length);
		}
	}
	,splitOnKeywords: function(source,posOffset) {
		var pos = 0;
		var style = 0;
		var lastStyle = -1;
		var sourceLen = source.length;
		while(true) {
			var startPos = pos;
			var endPos = sourceLen;
			var matched = false;
			if(this.wordBoundaries != null) {
				matched = this.wordBoundaries.matchSub(source,pos);
			}
			if(matched) {
				var currentPos = this.wordBoundaries.matchedPos();
				endPos = currentPos.pos;
				pos = endPos + currentPos.len;
			} else {
				pos = sourceLen;
			}
			var currentKeyword = source.substring(startPos,endPos);
			if(!this.caseSensitiveKeywords) {
				currentKeyword = currentKeyword.toLowerCase();
			}
			if(Object.prototype.hasOwnProperty.call(this.keywordSet.h,currentKeyword)) {
				style = this.keywordSet.h[currentKeyword];
			} else if(!new EReg("^\\s+$","m").match(currentKeyword)) {
				style = this._defaultContext;
			}
			if(style != lastStyle) {
				this.result.push(posOffset + startPos);
				this.result.push(style);
			}
			style = this._defaultContext;
			if(style != lastStyle) {
				this.result.push(posOffset + endPos);
				this.result.push(style);
			}
			if(!matched || pos >= sourceLen) {
				break;
			}
		}
	}
	,__class__: moonshine_editor_text_syntax_parser_LineParser
	,__properties__: {get_defaultContext:"get_defaultContext"}
});
var moonshine_editor_text_syntax_parser_JSLineParser = function() {
	moonshine_editor_text_syntax_parser_LineParser.call(this);
	this.context = moonshine_editor_text_syntax_parser_JSLineParser.JS_CODE;
	this._defaultContext = moonshine_editor_text_syntax_parser_JSLineParser.JS_CODE;
	this.wordBoundaries = new EReg("([\\s,(){}\\[\\]\\-+*%/=\"'~!&|<>?:;.]+)","g");
	this.patterns = [new moonshine_editor_text_syntax_parser_LineParserPattern(moonshine_editor_text_syntax_parser_JSLineParser.JS_STRING1,new EReg("^\"(?:\\\\\\\\|\\\\\"|[^\n])*?(?:\"|\\\\\n|(?=\n))","")),new moonshine_editor_text_syntax_parser_LineParserPattern(moonshine_editor_text_syntax_parser_JSLineParser.JS_STRING2,new EReg("^'(?:\\\\\\\\|\\\\'|[^\n])*?(?:'|\\\\\n|(?=\n))","")),new moonshine_editor_text_syntax_parser_LineParserPattern(moonshine_editor_text_syntax_parser_JSLineParser.JS_COMMENT,new EReg("^//.*","")),new moonshine_editor_text_syntax_parser_LineParserPattern(moonshine_editor_text_syntax_parser_JSLineParser.JS_MULTILINE_COMMENT,new EReg("^/\\*.*?(?:\\*/|\n)","")),new moonshine_editor_text_syntax_parser_LineParserPattern(moonshine_editor_text_syntax_parser_JSLineParser.JS_REGULAR_EXPRESSION,new EReg("^/(?:\\\\\\\\|\\\\/|\\[(?:\\\\\\\\|\\\\\\]|.)+?\\]|[^*/])(?:\\\\\\\\|\\\\/|\\[(?:\\\\\\\\|\\\\\\]|.)+?\\]|.)*?/[gismx]*",""))];
	this.endPatterns = [new moonshine_editor_text_syntax_parser_LineParserPattern(moonshine_editor_text_syntax_parser_JSLineParser.JS_STRING1,new EReg("(?:^|[^\\\\])(\"|(?=\n))","")),new moonshine_editor_text_syntax_parser_LineParserPattern(moonshine_editor_text_syntax_parser_JSLineParser.JS_STRING2,new EReg("(?:^|[^\\\\])('|(?=\n))","")),new moonshine_editor_text_syntax_parser_LineParserPattern(moonshine_editor_text_syntax_parser_JSLineParser.JS_MULTILINE_COMMENT,new EReg("\\*/",""))];
	var _g = new haxe_ds_IntMap();
	_g.h[moonshine_editor_text_syntax_parser_JSLineParser.JS_NULL_KEYWORD] = ["null"];
	_g.h[moonshine_editor_text_syntax_parser_JSLineParser.JS_UNDEFINED_KEYWORD] = ["undefined"];
	_g.h[moonshine_editor_text_syntax_parser_JSLineParser.JS_BOOLEAN_KEYWORD] = ["true","false"];
	_g.h[moonshine_editor_text_syntax_parser_JSLineParser.JS_VAR_KEYWORD] = ["var","const","let"];
	_g.h[moonshine_editor_text_syntax_parser_JSLineParser.JS_FUNCTION_KEYWORD] = ["function"];
	_g.h[moonshine_editor_text_syntax_parser_JSLineParser.JS_TYPE_KEYWORD] = ["class"];
	_g.h[moonshine_editor_text_syntax_parser_JSLineParser.JS_KEYWORD] = ["break","case","catch","continue","debugger","default","delete","do","else","export","extends","finally","for","if","import","in","instanceof","new","return","super","switch","this","throw","try","typeof","void","while","with","yield","enum","implements","interface","package","private","protected","public","static"];
	this.keywords = _g;
};
$hxClasses["moonshine.editor.text.syntax.parser.JSLineParser"] = moonshine_editor_text_syntax_parser_JSLineParser;
moonshine_editor_text_syntax_parser_JSLineParser.__name__ = "moonshine.editor.text.syntax.parser.JSLineParser";
moonshine_editor_text_syntax_parser_JSLineParser.__super__ = moonshine_editor_text_syntax_parser_LineParser;
moonshine_editor_text_syntax_parser_JSLineParser.prototype = $extend(moonshine_editor_text_syntax_parser_LineParser.prototype,{
	__class__: moonshine_editor_text_syntax_parser_JSLineParser
});
var moonshine_editor_text_syntax_parser_LineParserPattern = function(type,expression) {
	this.type = type;
	this.expression = expression;
};
$hxClasses["moonshine.editor.text.syntax.parser.LineParserPattern"] = moonshine_editor_text_syntax_parser_LineParserPattern;
moonshine_editor_text_syntax_parser_LineParserPattern.__name__ = "moonshine.editor.text.syntax.parser.LineParserPattern";
moonshine_editor_text_syntax_parser_LineParserPattern.prototype = {
	type: null
	,expression: null
	,__class__: moonshine_editor_text_syntax_parser_LineParserPattern
};
var moonshine_editor_text_syntax_parser_PlainTextLineParser = function() {
};
$hxClasses["moonshine.editor.text.syntax.parser.PlainTextLineParser"] = moonshine_editor_text_syntax_parser_PlainTextLineParser;
moonshine_editor_text_syntax_parser_PlainTextLineParser.__name__ = "moonshine.editor.text.syntax.parser.PlainTextLineParser";
moonshine_editor_text_syntax_parser_PlainTextLineParser.__interfaces__ = [moonshine_editor_text_syntax_parser_ILineParser];
moonshine_editor_text_syntax_parser_PlainTextLineParser.prototype = {
	get_defaultContext: function() {
		return 0;
	}
	,setContext: function(newContext) {
	}
	,parse: function(sourceCode,startLine,startChar,endLine,endChar) {
		return [0,0,sourceCode.length];
	}
	,__class__: moonshine_editor_text_syntax_parser_PlainTextLineParser
	,__properties__: {get_defaultContext:"get_defaultContext"}
};
var moonshine_editor_text_syntax_parser_context_ContextSwitch = function(from,to,pattern,post) {
	if(post == null) {
		post = false;
	}
	this.from = from;
	this.to = to;
	this.pattern = pattern;
	this.post = post;
};
$hxClasses["moonshine.editor.text.syntax.parser.context.ContextSwitch"] = moonshine_editor_text_syntax_parser_context_ContextSwitch;
moonshine_editor_text_syntax_parser_context_ContextSwitch.__name__ = "moonshine.editor.text.syntax.parser.context.ContextSwitch";
moonshine_editor_text_syntax_parser_context_ContextSwitch.prototype = {
	from: null
	,to: null
	,pattern: null
	,post: null
	,__class__: moonshine_editor_text_syntax_parser_context_ContextSwitch
};
var moonshine_editor_text_syntax_parser_context_ContextSwitchManager = function(switches) {
	this.switches = new haxe_ds_IntMap();
	var _g = 0;
	while(_g < switches.length) {
		var swtch = switches[_g];
		++_g;
		this.addSwitch(swtch);
	}
};
$hxClasses["moonshine.editor.text.syntax.parser.context.ContextSwitchManager"] = moonshine_editor_text_syntax_parser_context_ContextSwitchManager;
moonshine_editor_text_syntax_parser_context_ContextSwitchManager.__name__ = "moonshine.editor.text.syntax.parser.context.ContextSwitchManager";
moonshine_editor_text_syntax_parser_context_ContextSwitchManager.prototype = {
	switches: null
	,addSwitch: function(swtch,highPriority) {
		if(highPriority == null) {
			highPriority = false;
		}
		var _g = 0;
		var _g1 = swtch.from;
		while(_g < _g1.length) {
			var from = _g1[_g];
			++_g;
			if(!this.switches.h.hasOwnProperty(from)) {
				this.switches.h[from] = [];
			}
			if(highPriority) {
				this.switches.h[from].unshift(swtch);
			} else {
				this.switches.h[from].push(swtch);
			}
		}
	}
	,getSwitches: function(from) {
		return this.switches.h[from];
	}
	,__class__: moonshine_editor_text_syntax_parser_context_ContextSwitchManager
};
var moonshine_editor_text_syntax_parser_context_InlineParserManager = function(parsers) {
	this.parsers = new haxe_ds_IntMap();
	var _g = 0;
	while(_g < parsers.length) {
		var parser = parsers[_g];
		++_g;
		this.addParser(parser);
	}
};
$hxClasses["moonshine.editor.text.syntax.parser.context.InlineParserManager"] = moonshine_editor_text_syntax_parser_context_InlineParserManager;
moonshine_editor_text_syntax_parser_context_InlineParserManager.__name__ = "moonshine.editor.text.syntax.parser.context.InlineParserManager";
moonshine_editor_text_syntax_parser_context_InlineParserManager.prototype = {
	parsers: null
	,addParser: function(parser) {
		this.parsers.h[parser.contextMask] = parser;
	}
	,getParser: function(context) {
		return this.parsers.h[context & 61440];
	}
	,__class__: moonshine_editor_text_syntax_parser_context_InlineParserManager
};
var moonshine_editor_text_theme_TextEditorStyles = function() { };
$hxClasses["moonshine.editor.text.theme.TextEditorStyles"] = moonshine_editor_text_theme_TextEditorStyles;
moonshine_editor_text_theme_TextEditorStyles.__name__ = "moonshine.editor.text.theme.TextEditorStyles";
moonshine_editor_text_theme_TextEditorStyles.initialize = function(theme) {
	if(theme == null) {
		var value = feathers_style_Theme.get_fallbackTheme();
		theme = ((value) instanceof feathers_themes_steel_BaseSteelTheme) ? value : null;
	}
	if(theme == null) {
		return;
	}
	var styleProvider = theme.styleProvider;
	if(styleProvider.getStyleFunction(moonshine_editor_text_TextEditor,null) == null) {
		styleProvider.setStyleFunction(moonshine_editor_text_TextEditor,null,function(textEditor) {
			var darkMode = theme.get_darkMode();
			if(textEditor.get_backgroundSkin() == null) {
				var backgroundSkin = new feathers_skins_RectangleSkin(feathers_graphics_FillStyle.SolidColor(darkMode ? 1973790 : 16777214));
				backgroundSkin.set_width(10.0);
				backgroundSkin.set_height(10.0);
				textEditor.set_backgroundSkin(backgroundSkin);
			}
		});
	}
	if(styleProvider.getStyleFunction(feathers_controls_ListView,moonshine_editor_text_TextEditor.CHILD_VARIANT_LIST_VIEW) == null) {
		styleProvider.setStyleFunction(feathers_controls_ListView,moonshine_editor_text_TextEditor.CHILD_VARIANT_LIST_VIEW,function(listView) {
			(styleProvider.getStyleFunction(feathers_controls_ListView,null))(listView);
		});
	}
};
var moonshine_editor_text_theme_TextLineRendererStyles = function() { };
$hxClasses["moonshine.editor.text.theme.TextLineRendererStyles"] = moonshine_editor_text_theme_TextLineRendererStyles;
moonshine_editor_text_theme_TextLineRendererStyles.__name__ = "moonshine.editor.text.theme.TextLineRendererStyles";
moonshine_editor_text_theme_TextLineRendererStyles.initialize = function(theme) {
	if(theme == null) {
		var value = feathers_style_Theme.get_fallbackTheme();
		theme = ((value) instanceof feathers_themes_steel_BaseSteelTheme) ? value : null;
	}
	if(theme == null) {
		return;
	}
	var styleProvider = theme.styleProvider;
	if(styleProvider.getStyleFunction(moonshine_editor_text_lines_TextLineRenderer,null) == null) {
		styleProvider.setStyleFunction(moonshine_editor_text_lines_TextLineRenderer,null,function(view) {
			var darkMode = theme.get_darkMode();
			view.set_gutterPaddingLeft(6.0);
			view.set_gutterPaddingRight(8.0);
			view.set_gutterGap(2.0);
			if(view.get_backgroundSkin() == null) {
				var backgroundSkin = new feathers_skins_RectangleSkin(feathers_graphics_FillStyle.SolidColor(darkMode ? 1973790 : 16777214));
				backgroundSkin.set_height(16.0);
				view.set_backgroundSkin(backgroundSkin);
			}
			if(view.get_focusedBackgroundSkin() == null) {
				view.set_focusedBackgroundSkin(new feathers_skins_RectangleSkin(feathers_graphics_FillStyle.SolidColor(darkMode ? 3026478 : 15596539)));
			}
			if(view.get_debuggerStoppedBackgroundSkin() == null) {
				view.set_debuggerStoppedBackgroundSkin(new feathers_skins_RectangleSkin(feathers_graphics_FillStyle.SolidColor(darkMode ? 5131822 : 16777164)));
			}
			if(view.get_selectedTextBackgroundSkinFactory() == null) {
				view.set_selectedTextBackgroundSkinFactory(function() {
					return new feathers_skins_RectangleSkin(feathers_graphics_FillStyle.SolidColor(darkMode ? 5131886 : 13623799,0.85));
				});
			}
			if(view.get_selectedTextUnfocusedBackgroundSkinFactory() == null) {
				view.set_selectedTextUnfocusedBackgroundSkinFactory(function() {
					return new feathers_skins_RectangleSkin(feathers_graphics_FillStyle.SolidColor(darkMode ? 5131886 : 13623799,0.75));
				});
			}
			if(view.get_gutterBackgroundSkin() == null) {
				var gutterBackgroundSkin = new feathers_skins_RectangleSkin(feathers_graphics_FillStyle.SolidColor(darkMode ? 1973790 : 16777214));
				gutterBackgroundSkin.set_height(16.0);
				view.set_gutterBackgroundSkin(gutterBackgroundSkin);
			}
			if(view.get_searchResultBackgroundSkinFactory() == null) {
				view.set_searchResultBackgroundSkinFactory(function() {
					return new feathers_skins_RectangleSkin(feathers_graphics_FillStyle.SolidColor(16378290,0.75),feathers_graphics_LineStyle.SolidColor(1.0,16378290,0.95));
				});
			}
			if(view.get_breakpointSkin() == null) {
				var breakpointSkin = new feathers_skins_CircleSkin(feathers_graphics_FillStyle.SolidColor(15012864));
				breakpointSkin.set_width(10.0);
				breakpointSkin.set_height(10.0);
				view.set_breakpointSkin(breakpointSkin);
			}
			if(view.get_unverifiedBreakpointSkin() == null) {
				var unverifiedBreakpointSkin = new feathers_skins_CircleSkin(feathers_graphics_FillStyle.SolidColor(8684676));
				unverifiedBreakpointSkin.set_width(10.0);
				unverifiedBreakpointSkin.set_height(10.0);
				view.set_unverifiedBreakpointSkin(unverifiedBreakpointSkin);
			}
		});
	}
};
var moonshine_editor_text_utils_AutoClosingPair = function(open,close) {
	this.open = open;
	this.close = close;
};
$hxClasses["moonshine.editor.text.utils.AutoClosingPair"] = moonshine_editor_text_utils_AutoClosingPair;
moonshine_editor_text_utils_AutoClosingPair.__name__ = "moonshine.editor.text.utils.AutoClosingPair";
moonshine_editor_text_utils_AutoClosingPair.prototype = {
	open: null
	,close: null
	,__class__: moonshine_editor_text_utils_AutoClosingPair
};
var moonshine_editor_text_utils_TextEditorUtil = function() { };
$hxClasses["moonshine.editor.text.utils.TextEditorUtil"] = moonshine_editor_text_utils_TextEditorUtil;
moonshine_editor_text_utils_TextEditorUtil.__name__ = "moonshine.editor.text.utils.TextEditorUtil";
moonshine_editor_text_utils_TextEditorUtil.deleteSelection = function(textEditor,newText) {
	if(!textEditor.get_hasSelection() && (newText == null || newText.length == 0)) {
		return null;
	}
	var startLine = textEditor.get_caretLineIndex();
	var startChar = textEditor.get_caretCharIndex();
	var endLine = startLine;
	var endChar = startChar;
	if(textEditor.get_hasSelection()) {
		startLine = textEditor.get_selectionStartLineIndex();
		startChar = textEditor.get_selectionStartCharIndex();
		endLine = textEditor.get_selectionEndLineIndex();
		endChar = textEditor.get_selectionEndCharIndex();
		if(startLine > endLine || startLine == endLine && startChar > endChar) {
			startLine = textEditor.get_selectionEndLineIndex();
			startChar = textEditor.get_selectionEndCharIndex();
			endLine = textEditor.get_selectionStartLineIndex();
			endChar = textEditor.get_selectionStartCharIndex();
		}
	}
	return new moonshine_editor_text_changes_TextEditorChange(startLine,startChar,endLine,endChar,newText);
};
moonshine_editor_text_utils_TextEditorUtil.applyTextChangeToLines = function(lines,change) {
	var result = lines.slice();
	var startLine = change.get_startLine();
	var startChar = change.get_startChar();
	var endLine = change.get_endLine();
	var endChar = change.get_endChar();
	var newText = change.get_newText();
	var insertedLines = null;
	if(newText != null && newText.length > 0) {
		insertedLines = new EReg("\r?\n|\r","g").split(newText);
	}
	var startTextToKeep = result[startLine].substring(0,startChar);
	var endTextToKeep = result[endLine].substring(endChar);
	if(startLine != endLine) {
		result.splice(startLine + 1,endLine - startLine);
	}
	if(insertedLines == null) {
		result[startLine] = startTextToKeep + endTextToKeep;
	} else {
		var _g = 0;
		var _g1 = insertedLines.length;
		while(_g < _g1) {
			var i = _g++;
			var updatedText = "";
			if(i == 0) {
				updatedText = startTextToKeep;
			}
			updatedText += insertedLines[i];
			if(i == insertedLines.length - 1) {
				updatedText += endTextToKeep;
			}
			result[startLine + i] = updatedText;
		}
	}
	return result;
};
var moonshine_editor_text_utils_TextUtil = function() { };
$hxClasses["moonshine.editor.text.utils.TextUtil"] = moonshine_editor_text_utils_TextUtil;
moonshine_editor_text_utils_TextUtil.__name__ = "moonshine.editor.text.utils.TextUtil";
moonshine_editor_text_utils_TextUtil.isWordCharacter = function(char,nonWordCharacters) {
	if(char.length != 1) {
		throw new openfl_errors_ArgumentError("Length of character must be 1");
	}
	if(nonWordCharacters == null) {
		nonWordCharacters = moonshine_editor_text_utils_TextUtil.DEFAULT_NON_WORD_CHARACTERS;
	}
	return nonWordCharacters.indexOf(char) == -1;
};
moonshine_editor_text_utils_TextUtil.startOfWord = function(line,charIndex,nonWordCharacters) {
	if(nonWordCharacters == null) {
		nonWordCharacters = moonshine_editor_text_utils_TextUtil.DEFAULT_NON_WORD_CHARACTERS;
	}
	var i = charIndex;
	while(i >= 0) {
		var char = line.charAt(i);
		if(nonWordCharacters.indexOf(char) != -1) {
			if(i == charIndex) {
				return i;
			}
			return i + 1;
		}
		--i;
	}
	return 0;
};
moonshine_editor_text_utils_TextUtil.endOfWord = function(line,charIndex,nonWordCharacters) {
	if(nonWordCharacters == null) {
		nonWordCharacters = moonshine_editor_text_utils_TextUtil.DEFAULT_NON_WORD_CHARACTERS;
	}
	var _g = charIndex;
	var _g1 = line.length;
	while(_g < _g1) {
		var i = _g++;
		var char = line.charAt(i);
		if(nonWordCharacters.indexOf(char) != -1) {
			if(i == charIndex) {
				return i + 1;
			}
			return i;
		}
	}
	return line.length;
};
moonshine_editor_text_utils_TextUtil.wordBoundaryForward = function(line) {
	var line1 = line.length;
	var _this_r = new RegExp("^(?:\\s+|[^\\s,(){}\\[\\]\\-+*%/=\"'~!&|<>?:;.]+\\s*|[,(){}\\[\\]\\-+*%/=\"'~!&|<>?:;.]+\\s*)","".split("u").join(""));
	return line1 - line.replace(_this_r,"").length;
};
moonshine_editor_text_utils_TextUtil.wordBoundaryBackward = function(line) {
	var line1 = line.length;
	var _this_r = new RegExp("(?:\\s+|[^\\s,(){}\\[\\]\\-+*%/=\"'~!&|<>?:;.]+\\s*|[,(){}\\[\\]\\-+*%/=\"'~!&|<>?:;.]+\\s*)$","".split("u").join(""));
	return line1 - line.replace(_this_r,"").length;
};
moonshine_editor_text_utils_TextUtil.indentAmount = function(line) {
	var line1 = line.length;
	var _this_r = new RegExp("^\t+","".split("u").join(""));
	var indent = line1 - line.replace(_this_r,"").length;
	if(indent > 0) {
		return indent;
	}
	return 0;
};
moonshine_editor_text_utils_TextUtil.indentAmountBySpaceAndTab = function(line) {
	var _this_r = new RegExp("^(\\s+).*$","".split("u").join(""));
	var tmpLine = line.replace(_this_r,"$1");
	var tmpLine1 = tmpLine.length;
	var _this_r = new RegExp("[ ]","g".split("u").join(""));
	var num_spaces = tmpLine1 - tmpLine.replace(_this_r,"").length;
	var tmpLine1 = tmpLine.length;
	var _this_r = new RegExp("\t","g".split("u").join(""));
	var num_tabs = tmpLine1 - tmpLine.replace(_this_r,"").length;
	return { space : num_spaces, tab : num_tabs};
};
moonshine_editor_text_utils_TextUtil.repeatStr = function(str,count) {
	var array = [];
	array.length = count + 1;
	return array.join(str);
};
moonshine_editor_text_utils_TextUtil.charIdx2LineCharIdx = function(str,charIdx,lineDelim) {
	var line = HxOverrides.substr(str,0,charIdx).split(lineDelim).length - 1;
	var chr = line > 0 ? charIdx - str.lastIndexOf(lineDelim,charIdx - 1) - lineDelim.length : charIdx;
	return new moonshine_editor_text_TextEditorPosition(line,chr);
};
moonshine_editor_text_utils_TextUtil.lineCharIdx2charIdx = function(str,lineIdx,charIdx,lineDelim) {
	return str.split(lineDelim).slice(0,lineIdx).join("").length + lineIdx * lineDelim.length + charIdx;
};
moonshine_editor_text_utils_TextUtil.getFirstIndentAtStartOfLine = function(line,tabSize,includePartial) {
	if(includePartial == null) {
		includePartial = false;
	}
	var firstChar = line.charAt(0);
	if(firstChar == "\t") {
		return firstChar;
	}
	if(firstChar == " ") {
		var indent = firstChar;
		var _g = 1;
		var _g1 = tabSize;
		while(_g < _g1) {
			var i = _g++;
			var char = line.charAt(i);
			if(char == "\t") {
				indent += char;
				return indent;
			}
			if(char != " ") {
				if(includePartial) {
					return indent;
				}
				return "";
			}
			indent += char;
		}
		return indent;
	}
	return "";
};
moonshine_editor_text_utils_TextUtil.getIndentAtStartOfLine = function(line,tabSize,includePartial) {
	if(includePartial == null) {
		includePartial = false;
	}
	var indent = "";
	var spaces = "";
	var _g = 0;
	var _g1 = line.length;
	while(_g < _g1) {
		var i = _g++;
		var char = line.charAt(i);
		if(char == "\t") {
			if(spaces.length > 0) {
				indent += spaces;
				spaces = "";
			}
			indent += char;
			continue;
		} else if(char == " ") {
			spaces += char;
			if(spaces.length == tabSize) {
				indent += spaces;
				spaces = "";
			}
		} else {
			break;
		}
	}
	if(includePartial && spaces.length > 0) {
		indent += spaces;
	}
	return indent;
};
moonshine_editor_text_utils_TextUtil.getIndentCountAtStartOfLine = function(line,tabSize,includePartial) {
	if(includePartial == null) {
		includePartial = false;
	}
	var indentCount = 0;
	var spaceCount = 0;
	var _g = 0;
	var _g1 = line.length;
	while(_g < _g1) {
		var i = _g++;
		var char = line.charAt(i);
		if(char == "\t") {
			++indentCount;
			spaceCount = 0;
			continue;
		} else if(char == " ") {
			++spaceCount;
			if(spaceCount == tabSize) {
				++indentCount;
				spaceCount = 0;
			}
		} else {
			break;
		}
	}
	if(includePartial && spaceCount > 0) {
		++indentCount;
	}
	return indentCount;
};
var motion_easing_IEasing = function() { };
$hxClasses["motion.easing.IEasing"] = motion_easing_IEasing;
motion_easing_IEasing.__name__ = "motion.easing.IEasing";
motion_easing_IEasing.__isInterface__ = true;
motion_easing_IEasing.prototype = {
	calculate: null
	,ease: null
	,__class__: motion_easing_IEasing
};
var motion_easing__$Expo_ExpoEaseIn = function() {
};
$hxClasses["motion.easing._Expo.ExpoEaseIn"] = motion_easing__$Expo_ExpoEaseIn;
motion_easing__$Expo_ExpoEaseIn.__name__ = "motion.easing._Expo.ExpoEaseIn";
motion_easing__$Expo_ExpoEaseIn.__interfaces__ = [motion_easing_IEasing];
motion_easing__$Expo_ExpoEaseIn.prototype = {
	calculate: function(k) {
		if(k == 0) {
			return 0;
		} else {
			return Math.exp(6.931471805599453 * (k - 1));
		}
	}
	,ease: function(t,b,c,d) {
		if(t == 0) {
			return b;
		} else {
			return c * Math.exp(6.931471805599453 * (t / d - 1)) + b;
		}
	}
	,__class__: motion_easing__$Expo_ExpoEaseIn
};
var motion_easing__$Expo_ExpoEaseInOut = function() {
};
$hxClasses["motion.easing._Expo.ExpoEaseInOut"] = motion_easing__$Expo_ExpoEaseInOut;
motion_easing__$Expo_ExpoEaseInOut.__name__ = "motion.easing._Expo.ExpoEaseInOut";
motion_easing__$Expo_ExpoEaseInOut.__interfaces__ = [motion_easing_IEasing];
motion_easing__$Expo_ExpoEaseInOut.prototype = {
	calculate: function(k) {
		if(k == 0) {
			return 0;
		}
		if(k == 1) {
			return 1;
		}
		if((k /= 0.5) < 1.0) {
			return 0.5 * Math.exp(6.931471805599453 * (k - 1));
		}
		return 0.5 * (2 - Math.exp(-6.931471805599453 * --k));
	}
	,ease: function(t,b,c,d) {
		if(t == 0) {
			return b;
		}
		if(t == d) {
			return b + c;
		}
		if((t /= d / 2.0) < 1.0) {
			return c / 2 * Math.exp(6.931471805599453 * (t - 1)) + b;
		}
		return c / 2 * (2 - Math.exp(-6.931471805599453 * --t)) + b;
	}
	,__class__: motion_easing__$Expo_ExpoEaseInOut
};
var motion_easing__$Expo_ExpoEaseOut = function() {
};
$hxClasses["motion.easing._Expo.ExpoEaseOut"] = motion_easing__$Expo_ExpoEaseOut;
motion_easing__$Expo_ExpoEaseOut.__name__ = "motion.easing._Expo.ExpoEaseOut";
motion_easing__$Expo_ExpoEaseOut.__interfaces__ = [motion_easing_IEasing];
motion_easing__$Expo_ExpoEaseOut.prototype = {
	calculate: function(k) {
		if(k == 1) {
			return 1;
		} else {
			return 1 - Math.exp(-6.931471805599453 * k);
		}
	}
	,ease: function(t,b,c,d) {
		if(t == d) {
			return b + c;
		} else {
			return c * (1 - Math.exp(-6.931471805599453 * t / d)) + b;
		}
	}
	,__class__: motion_easing__$Expo_ExpoEaseOut
};
var motion_easing_Expo = function() { };
$hxClasses["motion.easing.Expo"] = motion_easing_Expo;
motion_easing_Expo.__name__ = "motion.easing.Expo";
var motion_Actuate = function() { };
$hxClasses["motion.Actuate"] = motion_Actuate;
motion_Actuate.__name__ = "motion.Actuate";
motion_Actuate.apply = function(target,properties,customActuator) {
	motion_Actuate.stop(target,properties);
	if(customActuator == null) {
		customActuator = motion_Actuate.defaultActuator;
	}
	var actuator = Type.createInstance(customActuator,[target,0,properties]);
	actuator.apply();
	return actuator;
};
motion_Actuate.effects = function(target,duration,overwrite) {
	if(overwrite == null) {
		overwrite = true;
	}
	return new motion__$Actuate_EffectsOptions(target,duration,overwrite);
};
motion_Actuate.getLibrary = function(target,allowCreation) {
	if(allowCreation == null) {
		allowCreation = true;
	}
	if(motion_Actuate.targetLibraries.h.__keys__[target.__id__] == null && allowCreation) {
		motion_Actuate.targetLibraries.set(target,[]);
	}
	return motion_Actuate.targetLibraries.h[target.__id__];
};
motion_Actuate.isActive = function() {
	var result = false;
	var library = motion_Actuate.targetLibraries.iterator();
	while(library.hasNext()) {
		var library1 = library.next();
		result = true;
		break;
	}
	return result;
};
motion_Actuate.motionPath = function(target,duration,properties,overwrite) {
	if(overwrite == null) {
		overwrite = true;
	}
	return motion_Actuate.tween(target,duration,properties,overwrite,motion_actuators_MotionPathActuator);
};
motion_Actuate.pause = function(target) {
	if(js_Boot.__implements(target,motion_actuators_IGenericActuator)) {
		var actuator = target;
		actuator.pause();
	} else {
		var library = motion_Actuate.getLibrary(target,false);
		if(library != null) {
			var _g = 0;
			while(_g < library.length) {
				var actuator = library[_g];
				++_g;
				actuator.pause();
			}
		}
	}
};
motion_Actuate.pauseAll = function() {
	var library = motion_Actuate.targetLibraries.iterator();
	while(library.hasNext()) {
		var library1 = library.next();
		var _g = 0;
		while(_g < library1.length) {
			var actuator = library1[_g];
			++_g;
			actuator.pause();
		}
	}
};
motion_Actuate.reset = function() {
	var library = motion_Actuate.targetLibraries.iterator();
	while(library.hasNext()) {
		var library1 = library.next();
		var i = library1.length - 1;
		while(i >= 0) {
			library1[i].stop(null,false,false);
			--i;
		}
	}
	motion_Actuate.targetLibraries = new haxe_ds_ObjectMap();
};
motion_Actuate.resume = function(target) {
	if(js_Boot.__implements(target,motion_actuators_IGenericActuator)) {
		var actuator = target;
		actuator.resume();
	} else {
		var library = motion_Actuate.getLibrary(target,false);
		if(library != null) {
			var _g = 0;
			while(_g < library.length) {
				var actuator = library[_g];
				++_g;
				actuator.resume();
			}
		}
	}
};
motion_Actuate.resumeAll = function() {
	var library = motion_Actuate.targetLibraries.iterator();
	while(library.hasNext()) {
		var library1 = library.next();
		var _g = 0;
		while(_g < library1.length) {
			var actuator = library1[_g];
			++_g;
			actuator.resume();
		}
	}
};
motion_Actuate.stop = function(target,properties,complete,sendEvent) {
	if(sendEvent == null) {
		sendEvent = true;
	}
	if(complete == null) {
		complete = false;
	}
	if(target != null) {
		if(js_Boot.__implements(target,motion_actuators_IGenericActuator)) {
			var actuator = target;
			actuator.stop(null,complete,sendEvent);
		} else {
			var library = motion_Actuate.getLibrary(target,false);
			if(library != null) {
				if(typeof(properties) == "string") {
					var temp = { };
					temp[properties] = null;
					properties = temp;
				} else if(((properties) instanceof Array)) {
					var temp = { };
					var _g = 0;
					var _g1 = js_Boot.__cast(properties , Array);
					while(_g < _g1.length) {
						var property = _g1[_g];
						++_g;
						temp[property] = null;
					}
					properties = temp;
				}
				var i = library.length - 1;
				while(i >= 0) {
					library[i].stop(properties,complete,sendEvent);
					--i;
				}
			}
		}
	}
};
motion_Actuate.timer = function(duration,customActuator) {
	return motion_Actuate.tween(new motion__$Actuate_TweenTimer(0),duration,new motion__$Actuate_TweenTimer(1),false,customActuator);
};
motion_Actuate.transform = function(target,duration,overwrite) {
	if(overwrite == null) {
		overwrite = true;
	}
	if(duration == null) {
		duration = 0;
	}
	return new motion__$Actuate_TransformOptions(target,duration,overwrite);
};
motion_Actuate.tween = function(target,duration,properties,overwrite,customActuator) {
	if(overwrite == null) {
		overwrite = true;
	}
	if(target != null) {
		if(duration > 0) {
			if(customActuator == null) {
				customActuator = motion_Actuate.defaultActuator;
			}
			var actuator = Type.createInstance(customActuator,[target,duration,properties]);
			var library = motion_Actuate.getLibrary(actuator.target);
			if(overwrite) {
				var i = library.length - 1;
				while(i >= 0) {
					library[i].stop(actuator.properties,false,false);
					--i;
				}
				library = motion_Actuate.getLibrary(actuator.target);
			}
			library.push(actuator);
			actuator.move();
			return actuator;
		} else {
			return motion_Actuate.apply(target,properties,customActuator);
		}
	}
	return null;
};
motion_Actuate.unload = function(actuator) {
	var target = actuator.target;
	if(motion_Actuate.targetLibraries.h.__keys__[target.__id__] != null) {
		HxOverrides.remove(motion_Actuate.targetLibraries.h[target.__id__],actuator);
		if(motion_Actuate.targetLibraries.h[target.__id__].length == 0) {
			motion_Actuate.targetLibraries.remove(target);
		}
	}
};
motion_Actuate.update = function(target,duration,start,end,overwrite) {
	if(overwrite == null) {
		overwrite = true;
	}
	var properties = { start : start, end : end};
	return motion_Actuate.tween(target,duration,properties,overwrite,motion_actuators_MethodActuator);
};
var motion__$Actuate_EffectsOptions = function(target,duration,overwrite) {
	this.target = target;
	this.duration = duration;
	this.overwrite = overwrite;
};
$hxClasses["motion._Actuate.EffectsOptions"] = motion__$Actuate_EffectsOptions;
motion__$Actuate_EffectsOptions.__name__ = "motion._Actuate.EffectsOptions";
motion__$Actuate_EffectsOptions.prototype = {
	duration: null
	,overwrite: null
	,target: null
	,filter: function(reference,properties) {
		properties.filter = reference;
		return motion_Actuate.tween(this.target,this.duration,properties,this.overwrite,motion_actuators_FilterActuator);
	}
	,__class__: motion__$Actuate_EffectsOptions
};
var motion__$Actuate_TransformOptions = function(target,duration,overwrite) {
	this.target = target;
	this.duration = duration;
	this.overwrite = overwrite;
};
$hxClasses["motion._Actuate.TransformOptions"] = motion__$Actuate_TransformOptions;
motion__$Actuate_TransformOptions.__name__ = "motion._Actuate.TransformOptions";
motion__$Actuate_TransformOptions.prototype = {
	duration: null
	,overwrite: null
	,target: null
	,color: function(value,strength,alpha) {
		if(strength == null) {
			strength = 1;
		}
		if(value == null) {
			value = 0;
		}
		var properties = { colorValue : value, colorStrength : strength};
		if(alpha != null) {
			properties.colorAlpha = alpha;
		}
		return motion_Actuate.tween(this.target,this.duration,properties,this.overwrite,motion_actuators_TransformActuator);
	}
	,sound: function(volume,pan) {
		var properties = { };
		if(volume != null) {
			properties.soundVolume = volume;
		}
		if(pan != null) {
			properties.soundPan = pan;
		}
		return motion_Actuate.tween(this.target,this.duration,properties,this.overwrite,motion_actuators_TransformActuator);
	}
	,__class__: motion__$Actuate_TransformOptions
};
var motion__$Actuate_TweenTimer = function(progress) {
	this.progress = progress;
};
$hxClasses["motion._Actuate.TweenTimer"] = motion__$Actuate_TweenTimer;
motion__$Actuate_TweenTimer.__name__ = "motion._Actuate.TweenTimer";
motion__$Actuate_TweenTimer.prototype = {
	progress: null
	,__class__: motion__$Actuate_TweenTimer
};
var motion_MotionPath = function() {
	this._x = new motion__$MotionPath_ComponentPath();
	this._y = new motion__$MotionPath_ComponentPath();
	this._rotation = null;
};
$hxClasses["motion.MotionPath"] = motion_MotionPath;
motion_MotionPath.__name__ = "motion.MotionPath";
motion_MotionPath.prototype = {
	_rotation: null
	,_x: null
	,_y: null
	,bezier: function(x,y,controlX,controlY,strength) {
		if(strength == null) {
			strength = 1;
		}
		return this.bezierN(x,y,[controlX],[controlY],strength);
	}
	,bezierN: function(x,y,controlX,controlY,strength) {
		if(strength == null) {
			strength = 1;
		}
		this._x.addPath(new motion__$MotionPath_BezierPath(x,controlX,strength));
		this._y.addPath(new motion__$MotionPath_BezierPath(y,controlY,strength));
		return this;
	}
	,bezierSpline: function(x,y,strength) {
		if(strength == null) {
			strength = 1;
		}
		this._x.addPath(new motion__$MotionPath_BezierSplinePath(x,strength));
		this._y.addPath(new motion__$MotionPath_BezierSplinePath(y,strength));
		return this;
	}
	,line: function(x,y,strength) {
		if(strength == null) {
			strength = 1;
		}
		return this.bezierN(x,y,[],[],strength);
	}
	,get_rotation: function() {
		if(this._rotation == null) {
			this._rotation = new motion__$MotionPath_RotationPath(this._x,this._y);
		}
		return this._rotation;
	}
	,get_x: function() {
		return this._x;
	}
	,get_y: function() {
		return this._y;
	}
	,__class__: motion_MotionPath
	,__properties__: {get_y:"get_y",get_x:"get_x",get_rotation:"get_rotation"}
};
var motion_IComponentPath = function() { };
$hxClasses["motion.IComponentPath"] = motion_IComponentPath;
motion_IComponentPath.__name__ = "motion.IComponentPath";
motion_IComponentPath.__isInterface__ = true;
motion_IComponentPath.prototype = {
	get_start: null
	,set_start: null
	,get_end: null
	,end: null
	,strength: null
	,calculate: null
	,__class__: motion_IComponentPath
	,__properties__: {get_end:"get_end",set_start:"set_start",get_start:"get_start"}
};
var motion__$MotionPath_ComponentPath = function() {
	this.paths = [];
	this.strength = 0;
};
$hxClasses["motion._MotionPath.ComponentPath"] = motion__$MotionPath_ComponentPath;
motion__$MotionPath_ComponentPath.__name__ = "motion._MotionPath.ComponentPath";
motion__$MotionPath_ComponentPath.__interfaces__ = [motion_IComponentPath];
motion__$MotionPath_ComponentPath.prototype = {
	strength: null
	,paths: null
	,addPath: function(path) {
		if(this.paths.length > 0) {
			path.set_start(this.paths[this.paths.length - 1].get_end());
		}
		this.paths.push(path);
		this.strength += path.strength;
	}
	,calculate: function(k) {
		if(this.paths.length == 1) {
			return this.paths[0].calculate(k);
		} else {
			var ratio = k * this.strength;
			var _g = 0;
			var _g1 = this.paths;
			while(_g < _g1.length) {
				var path = _g1[_g];
				++_g;
				if(ratio - path.strength > 1e-7) {
					ratio -= path.strength;
				} else {
					return path.calculate(ratio / path.strength);
				}
			}
		}
		return 0;
	}
	,get_start: function() {
		if(this.paths.length > 0) {
			return this.paths[0].get_start();
		} else {
			return 0;
		}
	}
	,set_start: function(value) {
		if(this.paths.length > 0) {
			return this.paths[0].set_start(value);
		} else {
			return 0;
		}
	}
	,get_end: function() {
		if(this.paths.length > 0) {
			var path = this.paths[this.paths.length - 1];
			return path.get_end();
		} else {
			return this.get_start();
		}
	}
	,__class__: motion__$MotionPath_ComponentPath
	,__properties__: {get_end:"get_end",set_start:"set_start",get_start:"get_start"}
};
var motion__$MotionPath_BezierPath = function(end,control,strength) {
	this._end = end;
	this.control = control;
	this.strength = strength;
};
$hxClasses["motion._MotionPath.BezierPath"] = motion__$MotionPath_BezierPath;
motion__$MotionPath_BezierPath.__name__ = "motion._MotionPath.BezierPath";
motion__$MotionPath_BezierPath.__interfaces__ = [motion_IComponentPath];
motion__$MotionPath_BezierPath.prototype = {
	control: null
	,end: null
	,strength: null
	,_start: null
	,_end: null
	,calculate: function(k) {
		var l = 1 - k;
		switch(this.control.length) {
		case 0:
			return l * this._start + k * this._end;
		case 1:
			return l * l * this._start + 2 * l * k * this.control[0] + k * k * this._end;
		case 2:
			return l * l * l * this._start + 3 * l * l * k * this.control[0] + 3 * l * k * k * this.control[1] + k * k * k * this._end;
		default:
			if(l < 1e-7) {
				return this._end;
			}
			var r = k / l;
			var n = this.control.length + 1;
			var coeff = Math.pow(l,n);
			var res = coeff * this._start;
			var _g = 1;
			var _g1 = n;
			while(_g < _g1) {
				var i = _g++;
				coeff *= r * (n + 1 - i) / i;
				res += coeff * this.control[i - 1];
			}
			coeff *= r / n;
			return res + coeff * this._end;
		}
	}
	,get_start: function() {
		return this._start;
	}
	,set_start: function(value) {
		return this._start = value;
	}
	,get_end: function() {
		return this._end;
	}
	,__class__: motion__$MotionPath_BezierPath
	,__properties__: {get_end:"get_end",set_start:"set_start",get_start:"get_start"}
};
var motion__$MotionPath_BezierSplinePath = function(through,strength) {
	motion__$MotionPath_ComponentPath.call(this);
	this.through = through;
	this.strength = strength;
};
$hxClasses["motion._MotionPath.BezierSplinePath"] = motion__$MotionPath_BezierSplinePath;
motion__$MotionPath_BezierSplinePath.__name__ = "motion._MotionPath.BezierSplinePath";
motion__$MotionPath_BezierSplinePath.__super__ = motion__$MotionPath_ComponentPath;
motion__$MotionPath_BezierSplinePath.prototype = $extend(motion__$MotionPath_ComponentPath.prototype,{
	through: null
	,computeControlPoints: function(start) {
		var K = [start].concat(this.through);
		var n = K.length;
		var _g = [];
		var _g1 = 0;
		var _g2 = n;
		while(_g1 < _g2) {
			var _ = _g1++;
			_g.push([0.0,0.0]);
		}
		var control = _g;
		var a = [];
		var b = [];
		var c = [];
		var r = [];
		a[0] = 0;
		b[0] = 2;
		c[0] = 1;
		r[0] = K[0] + 2 * K[1];
		var _g = 1;
		var _g1 = n - 1;
		while(_g < _g1) {
			var i = _g++;
			a[i] = 1;
			b[i] = 4;
			c[i] = 1;
			r[i] = 4 * K[i] + 2 * K[i + 1];
		}
		a[n - 1] = 1;
		b[n - 1] = 2;
		c[n - 1] = 0;
		r[n - 1] = 3 * K[n - 1];
		var _g = 1;
		var _g1 = n;
		while(_g < _g1) {
			var i = _g++;
			var m = a[i] / b[i - 1];
			b[i] -= m * c[i - 1];
			r[i] -= m * r[i - 1];
		}
		control[n - 1][0] = r[n - 1] / b[n - 1];
		var i = n - 2;
		while(i >= 0) {
			control[i][0] = (r[i] - c[i] * control[i + 1][0]) / b[i];
			--i;
		}
		var _g = 0;
		var _g1 = n - 1;
		while(_g < _g1) {
			var i = _g++;
			control[i][1] = 2 * K[i + 1] - control[i + 1][0];
		}
		control[n - 1][1] = 0.5 * (K[n] + control[n - 1][0]);
		control.pop();
		return control;
	}
	,set_start: function(value) {
		if(this.paths.length == 0 || Math.abs(value - this.get_start()) > 1e-7) {
			var control = this.computeControlPoints(value);
			var pathStrength = this.strength / control.length;
			this.strength = 0;
			this.paths.splice(0,this.paths.length);
			var _g = 0;
			var _g1 = control.length;
			while(_g < _g1) {
				var i = _g++;
				this.addPath(new motion__$MotionPath_BezierPath(this.through[i],control[i],pathStrength));
			}
		}
		return motion__$MotionPath_ComponentPath.prototype.set_start.call(this,value);
	}
	,get_end: function() {
		return this.through[this.through.length - 1];
	}
	,__class__: motion__$MotionPath_BezierSplinePath
});
var motion__$MotionPath_RotationPath = function(x,y) {
	this.step = 0.01;
	this._x = x;
	this._y = y;
	this.offset = 0;
	this.set_start(this.calculate(0.0));
};
$hxClasses["motion._MotionPath.RotationPath"] = motion__$MotionPath_RotationPath;
motion__$MotionPath_RotationPath.__name__ = "motion._MotionPath.RotationPath";
motion__$MotionPath_RotationPath.__interfaces__ = [motion_IComponentPath];
motion__$MotionPath_RotationPath.prototype = {
	offset: null
	,strength: null
	,_start: null
	,step: null
	,_x: null
	,_y: null
	,calculate: function(k) {
		var dX = this._x.calculate(k) - this._x.calculate(k + this.step);
		var dY = this._y.calculate(k) - this._y.calculate(k + this.step);
		var angle = Math.atan2(dY,dX) * (180 / Math.PI);
		angle = (angle + this.offset) % 360;
		return angle;
	}
	,get_start: function() {
		return this._start;
	}
	,set_start: function(value) {
		return this._start;
	}
	,get_end: function() {
		return this.calculate(1.0);
	}
	,__class__: motion__$MotionPath_RotationPath
	,__properties__: {set_start:"set_start",get_start:"get_start",get_end:"get_end"}
};
var motion_actuators_FilterActuator = function(target,duration,properties) {
	this.filterIndex = -1;
	motion_actuators_SimpleActuator.call(this,target,duration,properties);
	if(js_Boot.__instanceof(properties.filter,Class)) {
		this.filterClass = properties.filter;
		if(target.get_filters().length == 0) {
			target.set_filters([Type.createInstance(this.filterClass,[])]);
		}
		var _g = 0;
		var _g1 = target.get_filters();
		while(_g < _g1.length) {
			var filter = _g1[_g];
			++_g;
			if(js_Boot.__instanceof(filter,this.filterClass)) {
				this.filter = filter;
			}
		}
	} else {
		this.filterIndex = properties.filter;
		this.filter = target.get_filters()[this.filterIndex];
	}
};
$hxClasses["motion.actuators.FilterActuator"] = motion_actuators_FilterActuator;
motion_actuators_FilterActuator.__name__ = "motion.actuators.FilterActuator";
motion_actuators_FilterActuator.__super__ = motion_actuators_SimpleActuator;
motion_actuators_FilterActuator.prototype = $extend(motion_actuators_SimpleActuator.prototype,{
	filter: null
	,filterClass: null
	,filterIndex: null
	,apply: function() {
		var _g = 0;
		var _g1 = Reflect.fields(this.properties);
		while(_g < _g1.length) {
			var propertyName = _g1[_g];
			++_g;
			if(propertyName != "filter") {
				Reflect.setProperty(this.filter,propertyName,Reflect.field(this.properties,propertyName));
			}
		}
		this.setFilter();
	}
	,initialize: function() {
		var details;
		var start;
		var _g = 0;
		var _g1 = Reflect.fields(this.properties);
		while(_g < _g1.length) {
			var propertyName = _g1[_g];
			++_g;
			if(propertyName != "filter") {
				var target = this.filter;
				var value = null;
				if(Object.prototype.hasOwnProperty.call(target,propertyName)) {
					value = Reflect.field(target,propertyName);
				} else {
					value = Reflect.getProperty(target,propertyName);
				}
				start = value;
				details = new motion_actuators_PropertyDetails(this.filter,propertyName,start,Reflect.field(this.properties,propertyName) - start,Object.prototype.hasOwnProperty.call(this.filter,"set_" + propertyName));
				this.propertyDetails.push(details);
			}
		}
		this.detailsLength = this.propertyDetails.length;
		this.initialized = true;
	}
	,setFilter: function() {
		var filters = this.target.get_filters();
		if(this.filterIndex > -1) {
			filters[this.filterIndex] = this.filter;
		} else {
			var _g = 0;
			var _g1 = filters.length;
			while(_g < _g1) {
				var i = _g++;
				if(js_Boot.__instanceof(filters[i],this.filterClass)) {
					filters[i] = this.filter;
				}
			}
		}
		var target = this.target;
		var value = filters;
		if(Object.prototype.hasOwnProperty.call(target,"filters") && !(target.__properties__ && target.__properties__["set_" + "filters"])) {
			target["filters"] = value;
		} else {
			Reflect.setProperty(target,"filters",value);
		}
	}
	,update: function(currentTime) {
		motion_actuators_SimpleActuator.prototype.update.call(this,currentTime);
		this.setFilter();
	}
	,__class__: motion_actuators_FilterActuator
});
var motion_actuators_MotionPathActuator = function(target,duration,properties) {
	motion_actuators_SimpleActuator.call(this,target,duration,properties);
};
$hxClasses["motion.actuators.MotionPathActuator"] = motion_actuators_MotionPathActuator;
motion_actuators_MotionPathActuator.__name__ = "motion.actuators.MotionPathActuator";
motion_actuators_MotionPathActuator.__super__ = motion_actuators_SimpleActuator;
motion_actuators_MotionPathActuator.prototype = $extend(motion_actuators_SimpleActuator.prototype,{
	apply: function() {
		var _g = 0;
		var _g1 = Reflect.fields(this.properties);
		while(_g < _g1.length) {
			var propertyName = _g1[_g];
			++_g;
			if(Object.prototype.hasOwnProperty.call(this.target,propertyName)) {
				this.target[propertyName] = (js_Boot.__cast(Reflect.field(this.properties,propertyName) , motion_IComponentPath)).get_end();
			} else {
				Reflect.setProperty(this.target,propertyName,(js_Boot.__cast(Reflect.field(this.properties,propertyName) , motion_IComponentPath)).get_end());
			}
		}
	}
	,initialize: function() {
		var details;
		var path;
		var _g = 0;
		var _g1 = Reflect.fields(this.properties);
		while(_g < _g1.length) {
			var propertyName = _g1[_g];
			++_g;
			path = js_Boot.__cast(Reflect.field(this.properties,propertyName) , motion_IComponentPath);
			if(path != null) {
				var isField = true;
				if(Object.prototype.hasOwnProperty.call(this.target,propertyName)) {
					path.set_start(Reflect.field(this.target,propertyName));
				} else {
					isField = false;
					path.set_start(Reflect.getProperty(this.target,propertyName));
				}
				details = new motion_actuators_PropertyPathDetails(this.target,propertyName,path,isField);
				this.propertyDetails.push(details);
			}
		}
		this.detailsLength = this.propertyDetails.length;
		this.initialized = true;
	}
	,update: function(currentTime) {
		if(!this.paused) {
			var details;
			var easing;
			var tweenPosition = (currentTime - this.timeOffset) / this.duration;
			if(tweenPosition > 1) {
				tweenPosition = 1;
			}
			if(!this.initialized) {
				this.initialize();
			}
			if(!this.special) {
				easing = this._ease.calculate(tweenPosition);
				var _g = 0;
				var _g1 = this.propertyDetails;
				while(_g < _g1.length) {
					var details = _g1[_g];
					++_g;
					if(details.isField) {
						details.target[details.propertyName] = (js_Boot.__cast(details , motion_actuators_PropertyPathDetails)).path.calculate(easing);
					} else {
						Reflect.setProperty(details.target,details.propertyName,(js_Boot.__cast(details , motion_actuators_PropertyPathDetails)).path.calculate(easing));
					}
				}
			} else {
				if(!this._reverse) {
					easing = this._ease.calculate(tweenPosition);
				} else {
					easing = this._ease.calculate(1 - tweenPosition);
				}
				var endValue;
				var _g = 0;
				var _g1 = this.propertyDetails;
				while(_g < _g1.length) {
					var details = _g1[_g];
					++_g;
					if(!this._snapping) {
						if(details.isField) {
							details.target[details.propertyName] = (js_Boot.__cast(details , motion_actuators_PropertyPathDetails)).path.calculate(easing);
						} else {
							Reflect.setProperty(details.target,details.propertyName,(js_Boot.__cast(details , motion_actuators_PropertyPathDetails)).path.calculate(easing));
						}
					} else if(details.isField) {
						details.target[details.propertyName] = Math.round((js_Boot.__cast(details , motion_actuators_PropertyPathDetails)).path.calculate(easing));
					} else {
						Reflect.setProperty(details.target,details.propertyName,Math.round((js_Boot.__cast(details , motion_actuators_PropertyPathDetails)).path.calculate(easing)));
					}
				}
			}
			if(tweenPosition == 1) {
				if(this._repeat == 0) {
					this.active = false;
					var tmp;
					if(this.toggleVisible) {
						var target = this.target;
						var value = null;
						if(Object.prototype.hasOwnProperty.call(target,"alpha")) {
							value = Reflect.field(target,"alpha");
						} else {
							value = Reflect.getProperty(target,"alpha");
						}
						tmp = value == 0;
					} else {
						tmp = false;
					}
					if(tmp) {
						var target = this.target;
						var value = false;
						if(Object.prototype.hasOwnProperty.call(target,"visible") && !(target.__properties__ && target.__properties__["set_" + "visible"])) {
							target["visible"] = value;
						} else {
							Reflect.setProperty(target,"visible",value);
						}
					}
					this.complete(true);
					return;
				} else {
					if(this._onRepeat != null) {
						var method = this._onRepeat;
						var params = this._onRepeatParams;
						if(params == null) {
							params = [];
						}
						method.apply(method,params);
					}
					if(this._reflect) {
						this._reverse = !this._reverse;
					}
					this.startTime = currentTime;
					this.timeOffset = this.startTime + this._delay;
					if(this._repeat > 0) {
						this._repeat--;
					}
				}
			}
			if(this.sendChange) {
				this.change();
			}
		}
	}
	,__class__: motion_actuators_MotionPathActuator
});
var motion_actuators_PropertyDetails = function(target,propertyName,start,change,isField) {
	if(isField == null) {
		isField = true;
	}
	this.target = target;
	this.propertyName = propertyName;
	this.start = start;
	this.change = change;
	this.isField = isField;
};
$hxClasses["motion.actuators.PropertyDetails"] = motion_actuators_PropertyDetails;
motion_actuators_PropertyDetails.__name__ = "motion.actuators.PropertyDetails";
motion_actuators_PropertyDetails.prototype = {
	change: null
	,isField: null
	,propertyName: null
	,start: null
	,target: null
	,__class__: motion_actuators_PropertyDetails
};
var motion_actuators_PropertyPathDetails = function(target,propertyName,path,isField) {
	if(isField == null) {
		isField = true;
	}
	motion_actuators_PropertyDetails.call(this,target,propertyName,0,0,isField);
	this.path = path;
};
$hxClasses["motion.actuators.PropertyPathDetails"] = motion_actuators_PropertyPathDetails;
motion_actuators_PropertyPathDetails.__name__ = "motion.actuators.PropertyPathDetails";
motion_actuators_PropertyPathDetails.__super__ = motion_actuators_PropertyDetails;
motion_actuators_PropertyPathDetails.prototype = $extend(motion_actuators_PropertyDetails.prototype,{
	path: null
	,__class__: motion_actuators_PropertyPathDetails
});
var motion_actuators_TransformActuator = function(target,duration,properties) {
	motion_actuators_SimpleActuator.call(this,target,duration,properties);
};
$hxClasses["motion.actuators.TransformActuator"] = motion_actuators_TransformActuator;
motion_actuators_TransformActuator.__name__ = "motion.actuators.TransformActuator";
motion_actuators_TransformActuator.__super__ = motion_actuators_SimpleActuator;
motion_actuators_TransformActuator.prototype = $extend(motion_actuators_SimpleActuator.prototype,{
	endColorTransform: null
	,endSoundTransform: null
	,tweenColorTransform: null
	,tweenSoundTransform: null
	,apply: function() {
		this.initialize();
		if(this.endColorTransform != null) {
			var target = this.target;
			var value = null;
			if(Object.prototype.hasOwnProperty.call(target,"transform")) {
				value = Reflect.field(target,"transform");
			} else {
				value = Reflect.getProperty(target,"transform");
			}
			var transform = value;
			var value = this.endColorTransform;
			if(Object.prototype.hasOwnProperty.call(transform,"colorTransform") && !(transform.__properties__ && transform.__properties__["set_" + "colorTransform"])) {
				transform["colorTransform"] = value;
			} else {
				Reflect.setProperty(transform,"colorTransform",value);
			}
		}
		if(this.endSoundTransform != null) {
			var target = this.target;
			var value = this.endSoundTransform;
			if(Object.prototype.hasOwnProperty.call(target,"soundTransform") && !(target.__properties__ && target.__properties__["set_" + "soundTransform"])) {
				target["soundTransform"] = value;
			} else {
				Reflect.setProperty(target,"soundTransform",value);
			}
		}
	}
	,initialize: function() {
		if(Object.prototype.hasOwnProperty.call(this.properties,"colorValue") && ((this.target) instanceof openfl_display_DisplayObject)) {
			this.initializeColor();
		}
		if(Object.prototype.hasOwnProperty.call(this.properties,"soundVolume") || Object.prototype.hasOwnProperty.call(this.properties,"soundPan")) {
			this.initializeSound();
		}
		this.detailsLength = this.propertyDetails.length;
		this.initialized = true;
	}
	,initializeColor: function() {
		this.endColorTransform = new openfl_geom_ColorTransform();
		var color = this.properties.colorValue;
		var strength = this.properties.colorStrength;
		if(strength < 1) {
			var multiplier;
			var offset;
			if(strength < 0.5) {
				multiplier = 1;
				offset = strength * 2;
			} else {
				multiplier = 1 - (strength - 0.5) * 2;
				offset = 1;
			}
			this.endColorTransform.redMultiplier = multiplier;
			this.endColorTransform.greenMultiplier = multiplier;
			this.endColorTransform.blueMultiplier = multiplier;
			this.endColorTransform.redOffset = offset * (color >> 16 & 255);
			this.endColorTransform.greenOffset = offset * (color >> 8 & 255);
			this.endColorTransform.blueOffset = offset * (color & 255);
		} else {
			this.endColorTransform.redMultiplier = 0;
			this.endColorTransform.greenMultiplier = 0;
			this.endColorTransform.blueMultiplier = 0;
			this.endColorTransform.redOffset = color >> 16 & 255;
			this.endColorTransform.greenOffset = color >> 8 & 255;
			this.endColorTransform.blueOffset = color & 255;
		}
		var propertyNames = ["redMultiplier","greenMultiplier","blueMultiplier","redOffset","greenOffset","blueOffset"];
		if(Object.prototype.hasOwnProperty.call(this.properties,"colorAlpha")) {
			this.endColorTransform.alphaMultiplier = this.properties.colorAlpha;
			propertyNames.push("alphaMultiplier");
		} else {
			var target = this.target;
			var value = null;
			if(Object.prototype.hasOwnProperty.call(target,"alpha")) {
				value = Reflect.field(target,"alpha");
			} else {
				value = Reflect.getProperty(target,"alpha");
			}
			this.endColorTransform.alphaMultiplier = value;
		}
		var target = this.target;
		var value = null;
		if(Object.prototype.hasOwnProperty.call(target,"transform")) {
			value = Reflect.field(target,"transform");
		} else {
			value = Reflect.getProperty(target,"transform");
		}
		var transform = value;
		var value = null;
		if(Object.prototype.hasOwnProperty.call(transform,"colorTransform")) {
			value = Reflect.field(transform,"colorTransform");
		} else {
			value = Reflect.getProperty(transform,"colorTransform");
		}
		var begin = value;
		this.tweenColorTransform = new openfl_geom_ColorTransform();
		var details;
		var start;
		var _g = 0;
		while(_g < propertyNames.length) {
			var propertyName = propertyNames[_g];
			++_g;
			var value = null;
			if(Object.prototype.hasOwnProperty.call(begin,propertyName)) {
				value = Reflect.field(begin,propertyName);
			} else {
				value = Reflect.getProperty(begin,propertyName);
			}
			start = value;
			var details1 = this.tweenColorTransform;
			var target = this.endColorTransform;
			var value1 = null;
			if(Object.prototype.hasOwnProperty.call(target,propertyName)) {
				value1 = Reflect.field(target,propertyName);
			} else {
				value1 = Reflect.getProperty(target,propertyName);
			}
			details = new motion_actuators_PropertyDetails(details1,propertyName,start,value1 - start);
			this.propertyDetails.push(details);
		}
	}
	,initializeSound: function() {
		var target = this.target;
		var value = null;
		if(Object.prototype.hasOwnProperty.call(target,"soundTransform")) {
			value = Reflect.field(target,"soundTransform");
		} else {
			value = Reflect.getProperty(target,"soundTransform");
		}
		if(value == null) {
			var target = this.target;
			var value = new openfl_media_SoundTransform();
			if(Object.prototype.hasOwnProperty.call(target,"soundTransform") && !(target.__properties__ && target.__properties__["set_" + "soundTransform"])) {
				target["soundTransform"] = value;
			} else {
				Reflect.setProperty(target,"soundTransform",value);
			}
		}
		var target = this.target;
		var value = null;
		if(Object.prototype.hasOwnProperty.call(target,"soundTransform")) {
			value = Reflect.field(target,"soundTransform");
		} else {
			value = Reflect.getProperty(target,"soundTransform");
		}
		var start = value;
		var target = this.target;
		var value = null;
		if(Object.prototype.hasOwnProperty.call(target,"soundTransform")) {
			value = Reflect.field(target,"soundTransform");
		} else {
			value = Reflect.getProperty(target,"soundTransform");
		}
		this.endSoundTransform = value;
		this.tweenSoundTransform = new openfl_media_SoundTransform();
		if(Object.prototype.hasOwnProperty.call(this.properties,"soundVolume")) {
			this.endSoundTransform.volume = this.properties.soundVolume;
			this.propertyDetails.push(new motion_actuators_PropertyDetails(this.tweenSoundTransform,"volume",start.volume,this.endSoundTransform.volume - start.volume));
		}
		if(Object.prototype.hasOwnProperty.call(this.properties,"soundPan")) {
			this.endSoundTransform.pan = this.properties.soundPan;
			this.propertyDetails.push(new motion_actuators_PropertyDetails(this.tweenSoundTransform,"pan",start.pan,this.endSoundTransform.pan - start.pan));
		}
	}
	,update: function(currentTime) {
		motion_actuators_SimpleActuator.prototype.update.call(this,currentTime);
		if(this.endColorTransform != null) {
			var target = this.target;
			var value = null;
			if(Object.prototype.hasOwnProperty.call(target,"transform")) {
				value = Reflect.field(target,"transform");
			} else {
				value = Reflect.getProperty(target,"transform");
			}
			var transform = value;
			var value = this.tweenColorTransform;
			if(Object.prototype.hasOwnProperty.call(transform,"colorTransform") && !(transform.__properties__ && transform.__properties__["set_" + "colorTransform"])) {
				transform["colorTransform"] = value;
			} else {
				Reflect.setProperty(transform,"colorTransform",value);
			}
		}
		if(this.endSoundTransform != null) {
			var target = this.target;
			var value = this.tweenSoundTransform;
			if(Object.prototype.hasOwnProperty.call(target,"soundTransform") && !(target.__properties__ && target.__properties__["set_" + "soundTransform"])) {
				target["soundTransform"] = value;
			} else {
				Reflect.setProperty(target,"soundTransform",value);
			}
		}
	}
	,__class__: motion_actuators_TransformActuator
});
var motion_easing__$Bounce_BounceEaseIn = function() {
};
$hxClasses["motion.easing._Bounce.BounceEaseIn"] = motion_easing__$Bounce_BounceEaseIn;
motion_easing__$Bounce_BounceEaseIn.__name__ = "motion.easing._Bounce.BounceEaseIn";
motion_easing__$Bounce_BounceEaseIn.__interfaces__ = [motion_easing_IEasing];
motion_easing__$Bounce_BounceEaseIn._ease = function(t,b,c,d) {
	var t1 = d - t;
	return c - ((t1 /= d) < 0.36363636363636365 ? c * (7.5625 * t1 * t1) : t1 < 0.72727272727272729 ? c * (7.5625 * (t1 -= 0.54545454545454541) * t1 + .75) : t1 < 0.90909090909090906 ? c * (7.5625 * (t1 -= 0.81818181818181823) * t1 + .9375) : c * (7.5625 * (t1 -= 0.95454545454545459) * t1 + .984375)) + b;
};
motion_easing__$Bounce_BounceEaseIn.prototype = {
	calculate: function(k) {
		var t = 1 - k;
		return 1 - ((t /= 1) < 0.36363636363636365 ? 7.5625 * t * t : t < 0.72727272727272729 ? 7.5625 * (t -= 0.54545454545454541) * t + .75 : t < 0.90909090909090906 ? 7.5625 * (t -= 0.81818181818181823) * t + .9375 : 7.5625 * (t -= 0.95454545454545459) * t + .984375);
	}
	,ease: function(t,b,c,d) {
		var t1 = d - t;
		return c - ((t1 /= d) < 0.36363636363636365 ? c * (7.5625 * t1 * t1) : t1 < 0.72727272727272729 ? c * (7.5625 * (t1 -= 0.54545454545454541) * t1 + .75) : t1 < 0.90909090909090906 ? c * (7.5625 * (t1 -= 0.81818181818181823) * t1 + .9375) : c * (7.5625 * (t1 -= 0.95454545454545459) * t1 + .984375)) + b;
	}
	,__class__: motion_easing__$Bounce_BounceEaseIn
};
var motion_easing__$Bounce_BounceEaseInOut = function() {
};
$hxClasses["motion.easing._Bounce.BounceEaseInOut"] = motion_easing__$Bounce_BounceEaseInOut;
motion_easing__$Bounce_BounceEaseInOut.__name__ = "motion.easing._Bounce.BounceEaseInOut";
motion_easing__$Bounce_BounceEaseInOut.__interfaces__ = [motion_easing_IEasing];
motion_easing__$Bounce_BounceEaseInOut.prototype = {
	calculate: function(k) {
		if(k < .5) {
			var t = 1 - k * 2;
			return (1 - ((t /= 1) < 0.36363636363636365 ? 7.5625 * t * t : t < 0.72727272727272729 ? 7.5625 * (t -= 0.54545454545454541) * t + .75 : t < 0.90909090909090906 ? 7.5625 * (t -= 0.81818181818181823) * t + .9375 : 7.5625 * (t -= 0.95454545454545459) * t + .984375)) * .5;
		} else {
			var t = k * 2 - 1;
			return ((t /= 1) < 0.36363636363636365 ? 7.5625 * t * t : t < 0.72727272727272729 ? 7.5625 * (t -= 0.54545454545454541) * t + .75 : t < 0.90909090909090906 ? 7.5625 * (t -= 0.81818181818181823) * t + .9375 : 7.5625 * (t -= 0.95454545454545459) * t + .984375) * .5 + .5;
		}
	}
	,ease: function(t,b,c,d) {
		if(t < d / 2) {
			var t1 = d - t * 2;
			return (c - ((t1 /= d) < 0.36363636363636365 ? c * (7.5625 * t1 * t1) : t1 < 0.72727272727272729 ? c * (7.5625 * (t1 -= 0.54545454545454541) * t1 + .75) : t1 < 0.90909090909090906 ? c * (7.5625 * (t1 -= 0.81818181818181823) * t1 + .9375) : c * (7.5625 * (t1 -= 0.95454545454545459) * t1 + .984375))) * .5 + b;
		} else {
			var t1 = t * 2 - d;
			return ((t1 /= d) < 0.36363636363636365 ? c * (7.5625 * t1 * t1) : t1 < 0.72727272727272729 ? c * (7.5625 * (t1 -= 0.54545454545454541) * t1 + .75) : t1 < 0.90909090909090906 ? c * (7.5625 * (t1 -= 0.81818181818181823) * t1 + .9375) : c * (7.5625 * (t1 -= 0.95454545454545459) * t1 + .984375)) * .5 + c * .5 + b;
		}
	}
	,__class__: motion_easing__$Bounce_BounceEaseInOut
};
var motion_easing__$Bounce_BounceEaseOut = function() {
};
$hxClasses["motion.easing._Bounce.BounceEaseOut"] = motion_easing__$Bounce_BounceEaseOut;
motion_easing__$Bounce_BounceEaseOut.__name__ = "motion.easing._Bounce.BounceEaseOut";
motion_easing__$Bounce_BounceEaseOut.__interfaces__ = [motion_easing_IEasing];
motion_easing__$Bounce_BounceEaseOut._ease = function(t,b,c,d) {
	if((t /= d) < 0.36363636363636365) {
		return c * (7.5625 * t * t) + b;
	} else if(t < 0.72727272727272729) {
		return c * (7.5625 * (t -= 0.54545454545454541) * t + .75) + b;
	} else if(t < 0.90909090909090906) {
		return c * (7.5625 * (t -= 0.81818181818181823) * t + .9375) + b;
	} else {
		return c * (7.5625 * (t -= 0.95454545454545459) * t + .984375) + b;
	}
};
motion_easing__$Bounce_BounceEaseOut.prototype = {
	calculate: function(k) {
		var t = k;
		if((t /= 1) < 0.36363636363636365) {
			return 7.5625 * t * t;
		} else if(t < 0.72727272727272729) {
			return 7.5625 * (t -= 0.54545454545454541) * t + .75;
		} else if(t < 0.90909090909090906) {
			return 7.5625 * (t -= 0.81818181818181823) * t + .9375;
		} else {
			return 7.5625 * (t -= 0.95454545454545459) * t + .984375;
		}
	}
	,ease: function(t,b,c,d) {
		var t1 = t;
		if((t1 /= d) < 0.36363636363636365) {
			return c * (7.5625 * t1 * t1) + b;
		} else if(t1 < 0.72727272727272729) {
			return c * (7.5625 * (t1 -= 0.54545454545454541) * t1 + .75) + b;
		} else if(t1 < 0.90909090909090906) {
			return c * (7.5625 * (t1 -= 0.81818181818181823) * t1 + .9375) + b;
		} else {
			return c * (7.5625 * (t1 -= 0.95454545454545459) * t1 + .984375) + b;
		}
	}
	,__class__: motion_easing__$Bounce_BounceEaseOut
};
var motion_easing_Bounce = function() { };
$hxClasses["motion.easing.Bounce"] = motion_easing_Bounce;
motion_easing_Bounce.__name__ = "motion.easing.Bounce";
var motion_easing__$Cubic_CubicEaseIn = function() {
};
$hxClasses["motion.easing._Cubic.CubicEaseIn"] = motion_easing__$Cubic_CubicEaseIn;
motion_easing__$Cubic_CubicEaseIn.__name__ = "motion.easing._Cubic.CubicEaseIn";
motion_easing__$Cubic_CubicEaseIn.__interfaces__ = [motion_easing_IEasing];
motion_easing__$Cubic_CubicEaseIn.prototype = {
	calculate: function(k) {
		return k * k * k;
	}
	,ease: function(t,b,c,d) {
		return c * (t /= d) * t * t + b;
	}
	,__class__: motion_easing__$Cubic_CubicEaseIn
};
var motion_easing__$Cubic_CubicEaseInOut = function() {
};
$hxClasses["motion.easing._Cubic.CubicEaseInOut"] = motion_easing__$Cubic_CubicEaseInOut;
motion_easing__$Cubic_CubicEaseInOut.__name__ = "motion.easing._Cubic.CubicEaseInOut";
motion_easing__$Cubic_CubicEaseInOut.__interfaces__ = [motion_easing_IEasing];
motion_easing__$Cubic_CubicEaseInOut.prototype = {
	calculate: function(k) {
		if((k /= 0.5) < 1) {
			return 0.5 * k * k * k;
		} else {
			return 0.5 * ((k -= 2) * k * k + 2);
		}
	}
	,ease: function(t,b,c,d) {
		if((t /= d / 2) < 1) {
			return c / 2 * t * t * t + b;
		} else {
			return c / 2 * ((t -= 2) * t * t + 2) + b;
		}
	}
	,__class__: motion_easing__$Cubic_CubicEaseInOut
};
var motion_easing__$Cubic_CubicEaseOut = function() {
};
$hxClasses["motion.easing._Cubic.CubicEaseOut"] = motion_easing__$Cubic_CubicEaseOut;
motion_easing__$Cubic_CubicEaseOut.__name__ = "motion.easing._Cubic.CubicEaseOut";
motion_easing__$Cubic_CubicEaseOut.__interfaces__ = [motion_easing_IEasing];
motion_easing__$Cubic_CubicEaseOut.prototype = {
	calculate: function(k) {
		return --k * k * k + 1;
	}
	,ease: function(t,b,c,d) {
		t = t / d - 1;
		return c * (t * t * t + 1) + b;
	}
	,__class__: motion_easing__$Cubic_CubicEaseOut
};
var motion_easing_Cubic = function() { };
$hxClasses["motion.easing.Cubic"] = motion_easing_Cubic;
motion_easing_Cubic.__name__ = "motion.easing.Cubic";
var motion_easing__$Elastic_ElasticEaseIn = function(a,p) {
	this.a = a;
	this.p = p;
};
$hxClasses["motion.easing._Elastic.ElasticEaseIn"] = motion_easing__$Elastic_ElasticEaseIn;
motion_easing__$Elastic_ElasticEaseIn.__name__ = "motion.easing._Elastic.ElasticEaseIn";
motion_easing__$Elastic_ElasticEaseIn.__interfaces__ = [motion_easing_IEasing];
motion_easing__$Elastic_ElasticEaseIn.prototype = {
	a: null
	,p: null
	,calculate: function(k) {
		if(k == 0) {
			return 0;
		}
		if(k == 1) {
			return 1;
		}
		var s;
		if(this.a < 1) {
			this.a = 1;
			s = this.p / 4;
		} else {
			s = this.p / (2 * Math.PI) * Math.asin(1 / this.a);
		}
		return -(this.a * Math.exp(6.931471805599453 * --k) * Math.sin((k - s) * (2 * Math.PI) / this.p));
	}
	,ease: function(t,b,c,d) {
		if(t == 0) {
			return b;
		}
		if((t /= d) == 1) {
			return b + c;
		}
		var s;
		if(this.a < Math.abs(c)) {
			this.a = c;
			s = this.p / 4;
		} else {
			s = this.p / (2 * Math.PI) * Math.asin(c / this.a);
		}
		return -(this.a * Math.exp(6.931471805599453 * --t) * Math.sin((t * d - s) * (2 * Math.PI) / this.p)) + b;
	}
	,__class__: motion_easing__$Elastic_ElasticEaseIn
};
var motion_easing__$Elastic_ElasticEaseInOut = function(a,p) {
	this.a = a;
	this.p = p;
};
$hxClasses["motion.easing._Elastic.ElasticEaseInOut"] = motion_easing__$Elastic_ElasticEaseInOut;
motion_easing__$Elastic_ElasticEaseInOut.__name__ = "motion.easing._Elastic.ElasticEaseInOut";
motion_easing__$Elastic_ElasticEaseInOut.__interfaces__ = [motion_easing_IEasing];
motion_easing__$Elastic_ElasticEaseInOut.prototype = {
	a: null
	,p: null
	,calculate: function(k) {
		if(k == 0) {
			return 0;
		}
		if((k /= 0.5) == 2) {
			return 1;
		}
		var p = 0.44999999999999996;
		var a = 1;
		var s = p / 4;
		if(k < 1) {
			return -0.5 * (Math.exp(6.931471805599453 * --k) * Math.sin((k - s) * (2 * Math.PI) / p));
		}
		return Math.exp(-6.931471805599453 * --k) * Math.sin((k - s) * (2 * Math.PI) / p) * 0.5 + 1;
	}
	,ease: function(t,b,c,d) {
		if(t == 0) {
			return b;
		}
		if((t /= d / 2) == 2) {
			return b + c;
		}
		var s;
		if(this.a < Math.abs(c)) {
			this.a = c;
			s = this.p / 4;
		} else {
			s = this.p / (2 * Math.PI) * Math.asin(c / this.a);
		}
		if(t < 1) {
			return -0.5 * (this.a * Math.exp(6.931471805599453 * --t) * Math.sin((t * d - s) * (2 * Math.PI) / this.p)) + b;
		}
		return this.a * Math.exp(-6.931471805599453 * --t) * Math.sin((t * d - s) * (2 * Math.PI) / this.p) * 0.5 + c + b;
	}
	,__class__: motion_easing__$Elastic_ElasticEaseInOut
};
var motion_easing__$Elastic_ElasticEaseOut = function(a,p) {
	this.a = a;
	this.p = p;
};
$hxClasses["motion.easing._Elastic.ElasticEaseOut"] = motion_easing__$Elastic_ElasticEaseOut;
motion_easing__$Elastic_ElasticEaseOut.__name__ = "motion.easing._Elastic.ElasticEaseOut";
motion_easing__$Elastic_ElasticEaseOut.__interfaces__ = [motion_easing_IEasing];
motion_easing__$Elastic_ElasticEaseOut.prototype = {
	a: null
	,p: null
	,calculate: function(k) {
		if(k == 0) {
			return 0;
		}
		if(k == 1) {
			return 1;
		}
		var s;
		if(this.a < 1) {
			this.a = 1;
			s = this.p / 4;
		} else {
			s = this.p / (2 * Math.PI) * Math.asin(1 / this.a);
		}
		return this.a * Math.exp(-6.931471805599453 * k) * Math.sin((k - s) * (2 * Math.PI) / this.p) + 1;
	}
	,ease: function(t,b,c,d) {
		if(t == 0) {
			return b;
		}
		if((t /= d) == 1) {
			return b + c;
		}
		var s;
		if(this.a < Math.abs(c)) {
			this.a = c;
			s = this.p / 4;
		} else {
			s = this.p / (2 * Math.PI) * Math.asin(c / this.a);
		}
		return this.a * Math.exp(-6.931471805599453 * t) * Math.sin((t * d - s) * (2 * Math.PI) / this.p) + c + b;
	}
	,__class__: motion_easing__$Elastic_ElasticEaseOut
};
var motion_easing_Elastic = function() { };
$hxClasses["motion.easing.Elastic"] = motion_easing_Elastic;
motion_easing_Elastic.__name__ = "motion.easing.Elastic";
motion_easing_Elastic.easeInWith = function(a,p) {
	return new motion_easing__$Elastic_ElasticEaseIn(a,p);
};
motion_easing_Elastic.easeInOutWith = function(a,p) {
	return new motion_easing__$Elastic_ElasticEaseInOut(a,p);
};
motion_easing_Elastic.easeOutWith = function(a,p) {
	return new motion_easing__$Elastic_ElasticEaseOut(a,p);
};
var motion_easing_Linear = function() { };
$hxClasses["motion.easing.Linear"] = motion_easing_Linear;
motion_easing_Linear.__name__ = "motion.easing.Linear";
motion_easing_Linear.__properties__ = {get_easeNone:"get_easeNone"};
motion_easing_Linear.get_easeNone = function() {
	return new motion_easing_LinearEaseNone();
};
var motion_easing_LinearEaseNone = function() {
};
$hxClasses["motion.easing.LinearEaseNone"] = motion_easing_LinearEaseNone;
motion_easing_LinearEaseNone.__name__ = "motion.easing.LinearEaseNone";
motion_easing_LinearEaseNone.__interfaces__ = [motion_easing_IEasing];
motion_easing_LinearEaseNone.prototype = {
	calculate: function(k) {
		return k;
	}
	,ease: function(t,b,c,d) {
		return c * t / d + b;
	}
	,__class__: motion_easing_LinearEaseNone
};
var motion_easing__$Quad_QuadEaseIn = function() {
};
$hxClasses["motion.easing._Quad.QuadEaseIn"] = motion_easing__$Quad_QuadEaseIn;
motion_easing__$Quad_QuadEaseIn.__name__ = "motion.easing._Quad.QuadEaseIn";
motion_easing__$Quad_QuadEaseIn.__interfaces__ = [motion_easing_IEasing];
motion_easing__$Quad_QuadEaseIn.prototype = {
	calculate: function(k) {
		return k * k;
	}
	,ease: function(t,b,c,d) {
		return c * (t /= d) * t + b;
	}
	,__class__: motion_easing__$Quad_QuadEaseIn
};
var motion_easing__$Quad_QuadEaseInOut = function() {
};
$hxClasses["motion.easing._Quad.QuadEaseInOut"] = motion_easing__$Quad_QuadEaseInOut;
motion_easing__$Quad_QuadEaseInOut.__name__ = "motion.easing._Quad.QuadEaseInOut";
motion_easing__$Quad_QuadEaseInOut.__interfaces__ = [motion_easing_IEasing];
motion_easing__$Quad_QuadEaseInOut.prototype = {
	calculate: function(k) {
		if((k *= 2) < 1) {
			return 0.5 * k * k;
		}
		return -0.5 * ((k - 1) * (k - 3) - 1);
	}
	,ease: function(t,b,c,d) {
		if((t /= d / 2) < 1) {
			return c / 2 * t * t + b;
		}
		return -c / 2 * ((t - 1) * (t - 3) - 1) + b;
	}
	,__class__: motion_easing__$Quad_QuadEaseInOut
};
var motion_easing__$Quad_QuadEaseOut = function() {
};
$hxClasses["motion.easing._Quad.QuadEaseOut"] = motion_easing__$Quad_QuadEaseOut;
motion_easing__$Quad_QuadEaseOut.__name__ = "motion.easing._Quad.QuadEaseOut";
motion_easing__$Quad_QuadEaseOut.__interfaces__ = [motion_easing_IEasing];
motion_easing__$Quad_QuadEaseOut.prototype = {
	calculate: function(k) {
		return -k * (k - 2);
	}
	,ease: function(t,b,c,d) {
		return -c * (t /= d) * (t - 2) + b;
	}
	,__class__: motion_easing__$Quad_QuadEaseOut
};
var motion_easing_Quad = function() { };
$hxClasses["motion.easing.Quad"] = motion_easing_Quad;
motion_easing_Quad.__name__ = "motion.easing.Quad";
var motion_easing__$Quart_QuartEaseIn = function() {
};
$hxClasses["motion.easing._Quart.QuartEaseIn"] = motion_easing__$Quart_QuartEaseIn;
motion_easing__$Quart_QuartEaseIn.__name__ = "motion.easing._Quart.QuartEaseIn";
motion_easing__$Quart_QuartEaseIn.__interfaces__ = [motion_easing_IEasing];
motion_easing__$Quart_QuartEaseIn.prototype = {
	calculate: function(k) {
		return k * k * k * k;
	}
	,ease: function(t,b,c,d) {
		return c * (t /= d) * t * t * t + b;
	}
	,__class__: motion_easing__$Quart_QuartEaseIn
};
var motion_easing__$Quart_QuartEaseInOut = function() {
};
$hxClasses["motion.easing._Quart.QuartEaseInOut"] = motion_easing__$Quart_QuartEaseInOut;
motion_easing__$Quart_QuartEaseInOut.__name__ = "motion.easing._Quart.QuartEaseInOut";
motion_easing__$Quart_QuartEaseInOut.__interfaces__ = [motion_easing_IEasing];
motion_easing__$Quart_QuartEaseInOut.prototype = {
	calculate: function(k) {
		if((k *= 2) < 1) {
			return 0.5 * k * k * k * k;
		}
		return -0.5 * ((k -= 2) * k * k * k - 2);
	}
	,ease: function(t,b,c,d) {
		if((t /= d / 2) < 1) {
			return c / 2 * t * t * t * t + b;
		}
		return -c / 2 * ((t -= 2) * t * t * t - 2) + b;
	}
	,__class__: motion_easing__$Quart_QuartEaseInOut
};
var motion_easing__$Quart_QuartEaseOut = function() {
};
$hxClasses["motion.easing._Quart.QuartEaseOut"] = motion_easing__$Quart_QuartEaseOut;
motion_easing__$Quart_QuartEaseOut.__name__ = "motion.easing._Quart.QuartEaseOut";
motion_easing__$Quart_QuartEaseOut.__interfaces__ = [motion_easing_IEasing];
motion_easing__$Quart_QuartEaseOut.prototype = {
	calculate: function(k) {
		return -(--k * k * k * k - 1);
	}
	,ease: function(t,b,c,d) {
		t = t / d - 1;
		return -c * (t * t * t * t - 1) + b;
	}
	,__class__: motion_easing__$Quart_QuartEaseOut
};
var motion_easing_Quart = function() { };
$hxClasses["motion.easing.Quart"] = motion_easing_Quart;
motion_easing_Quart.__name__ = "motion.easing.Quart";
var motion_easing__$Quint_QuintEaseIn = function() {
};
$hxClasses["motion.easing._Quint.QuintEaseIn"] = motion_easing__$Quint_QuintEaseIn;
motion_easing__$Quint_QuintEaseIn.__name__ = "motion.easing._Quint.QuintEaseIn";
motion_easing__$Quint_QuintEaseIn.__interfaces__ = [motion_easing_IEasing];
motion_easing__$Quint_QuintEaseIn.prototype = {
	calculate: function(k) {
		return k * k * k * k * k;
	}
	,ease: function(t,b,c,d) {
		return c * (t /= d) * t * t * t * t + b;
	}
	,__class__: motion_easing__$Quint_QuintEaseIn
};
var motion_easing__$Quint_QuintEaseInOut = function() {
};
$hxClasses["motion.easing._Quint.QuintEaseInOut"] = motion_easing__$Quint_QuintEaseInOut;
motion_easing__$Quint_QuintEaseInOut.__name__ = "motion.easing._Quint.QuintEaseInOut";
motion_easing__$Quint_QuintEaseInOut.__interfaces__ = [motion_easing_IEasing];
motion_easing__$Quint_QuintEaseInOut.prototype = {
	calculate: function(k) {
		if((k *= 2) < 1) {
			return 0.5 * k * k * k * k * k;
		}
		return 0.5 * ((k -= 2) * k * k * k * k + 2);
	}
	,ease: function(t,b,c,d) {
		if((t /= d / 2) < 1) {
			return c / 2 * t * t * t * t * t + b;
		}
		return c / 2 * ((t -= 2) * t * t * t * t + 2) + b;
	}
	,__class__: motion_easing__$Quint_QuintEaseInOut
};
var motion_easing__$Quint_QuintEaseOut = function() {
};
$hxClasses["motion.easing._Quint.QuintEaseOut"] = motion_easing__$Quint_QuintEaseOut;
motion_easing__$Quint_QuintEaseOut.__name__ = "motion.easing._Quint.QuintEaseOut";
motion_easing__$Quint_QuintEaseOut.__interfaces__ = [motion_easing_IEasing];
motion_easing__$Quint_QuintEaseOut.prototype = {
	calculate: function(k) {
		return --k * k * k * k * k + 1;
	}
	,ease: function(t,b,c,d) {
		t = t / d - 1;
		return c * (t * t * t * t * t + 1) + b;
	}
	,__class__: motion_easing__$Quint_QuintEaseOut
};
var motion_easing_Quint = function() { };
$hxClasses["motion.easing.Quint"] = motion_easing_Quint;
motion_easing_Quint.__name__ = "motion.easing.Quint";
var motion_easing__$Sine_SineEaseIn = function() {
};
$hxClasses["motion.easing._Sine.SineEaseIn"] = motion_easing__$Sine_SineEaseIn;
motion_easing__$Sine_SineEaseIn.__name__ = "motion.easing._Sine.SineEaseIn";
motion_easing__$Sine_SineEaseIn.__interfaces__ = [motion_easing_IEasing];
motion_easing__$Sine_SineEaseIn.prototype = {
	calculate: function(k) {
		return 1 - Math.cos(k * (Math.PI / 2));
	}
	,ease: function(t,b,c,d) {
		return -c * Math.cos(t / d * (Math.PI / 2)) + c + b;
	}
	,__class__: motion_easing__$Sine_SineEaseIn
};
var motion_easing__$Sine_SineEaseInOut = function() {
};
$hxClasses["motion.easing._Sine.SineEaseInOut"] = motion_easing__$Sine_SineEaseInOut;
motion_easing__$Sine_SineEaseInOut.__name__ = "motion.easing._Sine.SineEaseInOut";
motion_easing__$Sine_SineEaseInOut.__interfaces__ = [motion_easing_IEasing];
motion_easing__$Sine_SineEaseInOut.prototype = {
	calculate: function(k) {
		return -(Math.cos(Math.PI * k) - 1) / 2;
	}
	,ease: function(t,b,c,d) {
		return -c / 2 * (Math.cos(Math.PI * t / d) - 1) + b;
	}
	,__class__: motion_easing__$Sine_SineEaseInOut
};
var motion_easing__$Sine_SineEaseOut = function() {
};
$hxClasses["motion.easing._Sine.SineEaseOut"] = motion_easing__$Sine_SineEaseOut;
motion_easing__$Sine_SineEaseOut.__name__ = "motion.easing._Sine.SineEaseOut";
motion_easing__$Sine_SineEaseOut.__interfaces__ = [motion_easing_IEasing];
motion_easing__$Sine_SineEaseOut.prototype = {
	calculate: function(k) {
		return Math.sin(k * (Math.PI / 2));
	}
	,ease: function(t,b,c,d) {
		return c * Math.sin(t / d * (Math.PI / 2)) + b;
	}
	,__class__: motion_easing__$Sine_SineEaseOut
};
var motion_easing_Sine = function() { };
$hxClasses["motion.easing.Sine"] = motion_easing_Sine;
motion_easing_Sine.__name__ = "motion.easing.Sine";
var openfl_utils_Dictionary = {};
openfl_utils_Dictionary.exists = function(this1,key) {
	return this1.exists(key);
};
openfl_utils_Dictionary.get = function(this1,key) {
	return this1.get(key);
};
openfl_utils_Dictionary.keyValueIterator = function(this1) {
	return this1.keyValueIterator();
};
openfl_utils_Dictionary.remove = function(this1,key) {
	return this1.remove(key);
};
openfl_utils_Dictionary.set = function(this1,key,value) {
	this1.set(key,value);
	return value;
};
openfl_utils_Dictionary.iterator = function(this1) {
	return this1.keys();
};
openfl_utils_Dictionary.each = function(this1) {
	return this1.iterator();
};
openfl_utils_Dictionary.toStringMap = function(t,weakKeys) {
	return new haxe_ds_StringMap();
};
openfl_utils_Dictionary.toIntMap = function(t,weakKeys) {
	return new haxe_ds_IntMap();
};
openfl_utils_Dictionary.toFloatMap = function(t,weakKeys) {
	return new openfl_utils__$Dictionary_FloatMap();
};
openfl_utils_Dictionary.toEnumValueMapMap = function(t,weakKeys) {
	return new haxe_ds_EnumValueMap();
};
openfl_utils_Dictionary.toObjectMap = function(t,weakKeys) {
	return new haxe_ds_ObjectMap();
};
openfl_utils_Dictionary.toUtilsObjectMap = function(t,weakKeys) {
	return new openfl_utils__$Dictionary_UtilsObjectMap();
};
openfl_utils_Dictionary.toClassMap = function(t,weakKeys) {
	return new openfl_utils__$Dictionary_ClassMap();
};
openfl_utils_Dictionary.fromStringMap = function(map) {
	return map;
};
openfl_utils_Dictionary.fromIntMap = function(map) {
	return map;
};
openfl_utils_Dictionary.fromFloatMap = function(map) {
	return map;
};
openfl_utils_Dictionary.fromObjectMap = function(map) {
	return map;
};
openfl_utils_Dictionary.fromUtilsObjectMap = function(map) {
	return map;
};
openfl_utils_Dictionary.fromClassMap = function(map) {
	return map;
};
var openfl_Lib = function() { };
$hxClasses["openfl.Lib"] = openfl_Lib;
openfl_Lib.__name__ = "openfl.Lib";
openfl_Lib.__properties__ = {get_current:"get_current",get_application:"get_application"};
openfl_Lib.as = function(v,c) {
	if(js_Boot.__instanceof(v,c)) {
		return v;
	} else {
		return null;
	}
};
openfl_Lib.attach = function(name) {
	return new openfl_display_MovieClip();
};
openfl_Lib.clearInterval = function(id) {
	if(openfl_Lib.__timers.h.hasOwnProperty(id)) {
		var timer = openfl_Lib.__timers.h[id];
		timer.stop();
		openfl_Lib.__timers.remove(id);
	}
};
openfl_Lib.clearTimeout = function(id) {
	if(openfl_Lib.__timers.h.hasOwnProperty(id)) {
		var timer = openfl_Lib.__timers.h[id];
		timer.stop();
		openfl_Lib.__timers.remove(id);
	}
};
openfl_Lib.getDefinitionByName = function(name) {
	if(name == null) {
		return null;
	}
	name = StringTools.replace(name,"::",".");
	return $hxClasses[name];
};
openfl_Lib.getQualifiedClassName = function(value) {
	if(value == null) {
		return null;
	}
	var ref = js_Boot.__instanceof(value,Class) ? value : js_Boot.getClass(value);
	if(ref == null) {
		if(typeof(value) == "boolean" || value == Bool) {
			return "Bool";
		} else if(typeof(value) == "number" && ((value | 0) === value) || value == Int) {
			return "Int";
		} else if(typeof(value) == "number" || value == Float) {
			return "Float";
		} else {
			return null;
		}
	}
	return ref.__name__;
};
openfl_Lib.getQualifiedSuperclassName = function(value) {
	if(value == null) {
		return null;
	}
	var ref = js_Boot.__instanceof(value,Class) ? value : js_Boot.getClass(value);
	if(ref == null) {
		return null;
	}
	var parentRef = ref.__super__;
	if(parentRef == null) {
		return null;
	}
	return parentRef.__name__;
};
openfl_Lib.getTimer = function() {
	return lime_system_System.getTimer();
};
openfl_Lib.describeType = function(value) {
	openfl_Lib.notImplemented({ fileName : "openfl/Lib.hx", lineNumber : 272, className : "openfl.Lib", methodName : "describeType"});
	return null;
};
openfl_Lib.getURL = function(request,target) {
	openfl_Lib.navigateToURL(request,target);
};
openfl_Lib.navigateToURL = function(request,window1) {
	if(window1 == null) {
		window1 = "_blank";
	}
	var uri = request.url;
	if(Type.typeof(request.data) == ValueType.TObject) {
		var query = "";
		var fields = Reflect.fields(request.data);
		var _g = 0;
		while(_g < fields.length) {
			var field = fields[_g];
			++_g;
			if(query.length > 0) {
				query += "&";
			}
			var query1 = encodeURIComponent(field) + "=";
			var s = Std.string(Reflect.field(request.data,field));
			query += query1 + encodeURIComponent(s);
		}
		if(uri.indexOf("?") > -1) {
			uri += "&" + query;
		} else {
			uri += "?" + query;
		}
	}
	lime_system_System.openURL(uri,window1);
};
openfl_Lib.encodeURIComponent = function(value) {
	return encodeURIComponent(value);
};
openfl_Lib.decodeURIComponent = function(value) {
	return decodeURIComponent(value.split("+").join(" "));
};
openfl_Lib.notImplemented = function(posInfo) {
	var api = posInfo.className + "." + posInfo.methodName;
	if(!Object.prototype.hasOwnProperty.call(openfl_Lib.__sentWarnings.h,api)) {
		openfl_Lib.__sentWarnings.h[api] = true;
		lime_utils_Log.warn(posInfo.methodName + " is not implemented",posInfo);
	}
};
openfl_Lib.preventDefaultTouchMove = function() {
	window.document.addEventListener("touchmove",function(evt) {
		evt.preventDefault();
	},false);
};
openfl_Lib.sendToURL = function(request) {
	var urlLoader = new openfl_net_URLLoader();
	urlLoader.load(request);
};
openfl_Lib.setInterval = function(closure,delay,args) {
	var id = ++openfl_Lib.__lastTimerID;
	var timer = new haxe_Timer(delay);
	openfl_Lib.__timers.h[id] = timer;
	timer.run = function() {
		if(openfl_Lib.get_current() != null && openfl_Lib.get_current().stage != null && openfl_Lib.get_current().stage.__uncaughtErrorEvents.__enabled) {
			try {
				closure.apply(closure,args == null ? [] : args);
			} catch( _g ) {
				haxe_NativeStackTrace.lastError = _g;
				var e = haxe_Exception.caught(_g).unwrap();
				openfl_Lib.get_current().stage.__handleError(e);
			}
		} else {
			closure.apply(closure,args == null ? [] : args);
		}
	};
	return id;
};
openfl_Lib.setTimeout = function(closure,delay,args) {
	var id = ++openfl_Lib.__lastTimerID;
	var this1 = openfl_Lib.__timers;
	var v = haxe_Timer.delay(function() {
		openfl_Lib.__timers.remove(id);
		if(openfl_Lib.get_current() != null && openfl_Lib.get_current().stage != null && openfl_Lib.get_current().stage.__uncaughtErrorEvents.__enabled) {
			try {
				closure.apply(closure,args == null ? [] : args);
			} catch( _g ) {
				haxe_NativeStackTrace.lastError = _g;
				var e = haxe_Exception.caught(_g).unwrap();
				openfl_Lib.get_current().stage.__handleError(e);
			}
		} else {
			closure.apply(closure,args == null ? [] : args);
		}
	},delay);
	this1.h[id] = v;
	return id;
};
openfl_Lib.trace = function(arg) {
	haxe_Log.trace(arg,{ fileName : "openfl/Lib.hx", lineNumber : 672, className : "openfl.Lib", methodName : "trace"});
};
openfl_Lib.isXMLName = function(name) {
	if(name == null) {
		return false;
	}
	if(!new EReg("^[a-zA-Z_]","").match(name)) {
		return false;
	}
	if(new EReg("^[xX][mM][lL]","").match(name)) {
		return false;
	}
	if(!new EReg("^[a-zA-Z0-9_\\-\\.]+$","").match(name)) {
		return false;
	}
	return true;
};
openfl_Lib.getClassByAlias = function(aliasName) {
	if(!Object.prototype.hasOwnProperty.call(openfl_Lib.__registeredClassAliases.h,aliasName)) {
		throw new openfl_errors_Error("Class " + aliasName + " could not be found.");
	}
	return openfl_Lib.__registeredClassAliases.h[aliasName];
};
openfl_Lib.registerClassAlias = function(aliasName,classObject) {
	if(classObject == null) {
		throw new openfl_errors_TypeError("Parameter classObject must be non-null");
	}
	if(aliasName == null) {
		throw new openfl_errors_TypeError("Parameter aliasName must be non-null");
	}
	openfl_Lib.__registeredClassAliases.h[aliasName] = classObject;
	openfl_Lib.__registeredClasses.set(classObject,aliasName);
};
openfl_Lib.get_application = function() {
	return openfl_utils__$internal_Lib.application;
};
openfl_Lib.get_current = function() {
	if(openfl_utils__$internal_Lib.current == null) {
		openfl_utils__$internal_Lib.current = new openfl_display_MovieClip();
	}
	return openfl_utils__$internal_Lib.current;
};
var openfl__$Vector_IVector = function() { };
$hxClasses["openfl._Vector.IVector"] = openfl__$Vector_IVector;
openfl__$Vector_IVector.__name__ = "openfl._Vector.IVector";
openfl__$Vector_IVector.__isInterface__ = true;
openfl__$Vector_IVector.prototype = {
	get_length: null
	,set_length: null
	,fixed: null
	,concat: null
	,copy: null
	,filter: null
	,get: null
	,indexOf: null
	,insertAt: null
	,iterator: null
	,join: null
	,lastIndexOf: null
	,pop: null
	,push: null
	,removeAt: null
	,reverse: null
	,set: null
	,shift: null
	,slice: null
	,sort: null
	,splice: null
	,toString: null
	,unshift: null
	,__tempIndex: null
	,__class__: openfl__$Vector_IVector
	,__properties__: {set_length:"set_length",get_length:"get_length"}
};
var openfl__$Vector_BoolVector = function(length,fixed,array) {
	if(fixed == null) {
		fixed = false;
	}
	if(length == null) {
		length = 0;
	}
	if(array == null) {
		array = [];
	}
	this.__array = array;
	if(length > 0) {
		this.set_length(length);
	}
	this.fixed = fixed;
};
$hxClasses["openfl._Vector.BoolVector"] = openfl__$Vector_BoolVector;
openfl__$Vector_BoolVector.__name__ = "openfl._Vector.BoolVector";
openfl__$Vector_BoolVector.__interfaces__ = [openfl__$Vector_IVector];
openfl__$Vector_BoolVector.prototype = {
	fixed: null
	,__array: null
	,__tempIndex: null
	,concat: function(a) {
		if(a == null) {
			return new openfl__$Vector_BoolVector(0,false,this.__array.slice());
		} else {
			var other = a;
			if(other.__array.length > 0) {
				return new openfl__$Vector_BoolVector(0,false,this.__array.concat(other.__array));
			} else {
				return new openfl__$Vector_BoolVector(0,false,this.__array.slice());
			}
		}
	}
	,copy: function() {
		return new openfl__$Vector_BoolVector(0,this.fixed,this.__array.slice());
	}
	,filter: function(callback) {
		var tmp = this.fixed;
		var _g = [];
		var _g1 = 0;
		var _g2 = this.__array;
		while(_g1 < _g2.length) {
			var v = _g2[_g1];
			++_g1;
			if(callback(v)) {
				_g.push(v);
			}
		}
		return new openfl__$Vector_BoolVector(0,tmp,_g);
	}
	,get: function(index) {
		if(index >= this.__array.length) {
			return false;
		} else {
			return this.__array[index];
		}
	}
	,indexOf: function(x,from) {
		if(from == null) {
			from = 0;
		}
		var _g = from;
		var _g1 = this.__array.length;
		while(_g < _g1) {
			var i = _g++;
			if(this.__array[i] == x) {
				return i;
			}
		}
		return -1;
	}
	,insertAt: function(index,element) {
		if(!this.fixed || index < this.__array.length) {
			this.__array.splice(index,0,element);
		}
	}
	,iterator: function() {
		return new haxe_iterators_ArrayIterator(this.__array);
	}
	,join: function(sep) {
		if(sep == null) {
			sep = ",";
		}
		return this.__array.join(sep);
	}
	,lastIndexOf: function(x,from) {
		var i = from == null || from >= this.__array.length ? this.__array.length - 1 : from;
		while(i >= 0) {
			if(this.__array[i] == x) {
				return i;
			}
			--i;
		}
		return -1;
	}
	,pop: function() {
		if(!this.fixed) {
			return this.__array.pop();
		} else {
			return null;
		}
	}
	,push: function(x) {
		if(!this.fixed) {
			return this.__array.push(x);
		} else {
			return this.__array.length;
		}
	}
	,removeAt: function(index) {
		if(!this.fixed || index < this.__array.length) {
			return this.__array.splice(index,1)[0];
		}
		return false;
	}
	,reverse: function() {
		this.__array.reverse();
		return this;
	}
	,set: function(index,value) {
		if(!this.fixed || index < this.__array.length) {
			return this.__array[index] = value;
		} else {
			return value;
		}
	}
	,shift: function() {
		if(!this.fixed) {
			return this.__array.shift();
		} else {
			return null;
		}
	}
	,slice: function(startIndex,endIndex) {
		if(startIndex == null) {
			startIndex = 0;
		}
		if(endIndex == null) {
			endIndex = 16777215;
		}
		return new openfl__$Vector_BoolVector(0,false,this.__array.slice(startIndex,endIndex));
	}
	,sort: function(f) {
		this.__array.sort(f);
	}
	,splice: function(pos,len) {
		return new openfl__$Vector_BoolVector(0,false,this.__array.splice(pos,len));
	}
	,toJSON: function() {
		return this.__array;
	}
	,toString: function() {
		if(this.__array != null) {
			return this.__array.toString();
		} else {
			return null;
		}
	}
	,unshift: function(x) {
		if(!this.fixed) {
			this.__array.unshift(x);
		}
	}
	,get_length: function() {
		return this.__array.length;
	}
	,set_length: function(value) {
		if(!this.fixed) {
			var currentLength = this.__array.length;
			if(value < 0) {
				value = 0;
			}
			if(value > currentLength) {
				var _g = currentLength;
				var _g1 = value;
				while(_g < _g1) {
					var i = _g++;
					this.__array[i] = false;
				}
			} else {
				while(this.__array.length > value) this.__array.pop();
			}
		}
		return this.__array.length;
	}
	,__class__: openfl__$Vector_BoolVector
	,__properties__: {set_length:"set_length",get_length:"get_length"}
};
var openfl__$Vector_FloatVector = function(length,fixed,array,forceCopy) {
	if(forceCopy == null) {
		forceCopy = false;
	}
	if(fixed == null) {
		fixed = false;
	}
	if(length == null) {
		length = 0;
	}
	if(forceCopy) {
		this.__array = [];
		if(array != null) {
			var _g = 0;
			var _g1 = array.length;
			while(_g < _g1) {
				var i = _g++;
				this.__array[i] = array[i];
			}
		}
	} else {
		if(array == null) {
			array = [];
		}
		this.__array = array;
	}
	if(length > 0) {
		this.set_length(length);
	}
	this.fixed = fixed;
};
$hxClasses["openfl._Vector.FloatVector"] = openfl__$Vector_FloatVector;
openfl__$Vector_FloatVector.__name__ = "openfl._Vector.FloatVector";
openfl__$Vector_FloatVector.__interfaces__ = [openfl__$Vector_IVector];
openfl__$Vector_FloatVector.prototype = {
	fixed: null
	,__array: null
	,__tempIndex: null
	,concat: function(a) {
		if(a == null) {
			return new openfl__$Vector_FloatVector(0,false,this.__array.slice());
		} else {
			var other = a;
			if(other.__array.length > 0) {
				return new openfl__$Vector_FloatVector(0,false,this.__array.concat(other.__array));
			} else {
				return new openfl__$Vector_FloatVector(0,false,this.__array.slice());
			}
		}
	}
	,copy: function() {
		return new openfl__$Vector_FloatVector(0,this.fixed,this.__array.slice());
	}
	,filter: function(callback) {
		var tmp = this.fixed;
		var _g = [];
		var _g1 = 0;
		var _g2 = this.__array;
		while(_g1 < _g2.length) {
			var v = _g2[_g1];
			++_g1;
			if(callback(v)) {
				_g.push(v);
			}
		}
		return new openfl__$Vector_FloatVector(0,tmp,_g);
	}
	,get: function(index) {
		return this.__array[index];
	}
	,indexOf: function(x,from) {
		if(from == null) {
			from = 0;
		}
		var _g = from;
		var _g1 = this.__array.length;
		while(_g < _g1) {
			var i = _g++;
			if(this.__array[i] == x) {
				return i;
			}
		}
		return -1;
	}
	,insertAt: function(index,element) {
		if(!this.fixed || index < this.__array.length) {
			this.__array.splice(index,0,element);
		}
	}
	,iterator: function() {
		return new haxe_iterators_ArrayIterator(this.__array);
	}
	,join: function(sep) {
		if(sep == null) {
			sep = ",";
		}
		return this.__array.join(sep);
	}
	,lastIndexOf: function(x,from) {
		var i = from == null || from >= this.__array.length ? this.__array.length - 1 : from;
		while(i >= 0) {
			if(this.__array[i] == x) {
				return i;
			}
			--i;
		}
		return -1;
	}
	,pop: function() {
		if(!this.fixed) {
			return this.__array.pop();
		} else {
			return null;
		}
	}
	,push: function(x) {
		if(!this.fixed) {
			return this.__array.push(x);
		} else {
			return this.__array.length;
		}
	}
	,removeAt: function(index) {
		if(!this.fixed || index < this.__array.length) {
			return this.__array.splice(index,1)[0];
		}
		return 0;
	}
	,reverse: function() {
		this.__array.reverse();
		return this;
	}
	,set: function(index,value) {
		if(!this.fixed || index < this.__array.length) {
			return this.__array[index] = value;
		} else {
			return value;
		}
	}
	,shift: function() {
		if(!this.fixed) {
			return this.__array.shift();
		} else {
			return null;
		}
	}
	,slice: function(startIndex,endIndex) {
		if(startIndex == null) {
			startIndex = 0;
		}
		if(endIndex == null) {
			endIndex = 16777215;
		}
		return new openfl__$Vector_FloatVector(0,false,this.__array.slice(startIndex,endIndex));
	}
	,sort: function(f) {
		this.__array.sort(f);
	}
	,splice: function(pos,len) {
		return new openfl__$Vector_FloatVector(0,false,this.__array.splice(pos,len));
	}
	,toJSON: function() {
		return this.__array;
	}
	,toString: function() {
		if(this.__array != null) {
			return this.__array.toString();
		} else {
			return null;
		}
	}
	,unshift: function(x) {
		if(!this.fixed) {
			this.__array.unshift(x);
		}
	}
	,get_length: function() {
		return this.__array.length;
	}
	,set_length: function(value) {
		if(value != this.__array.length && !this.fixed) {
			var currentLength = this.__array.length;
			if(value < 0) {
				value = 0;
			}
			if(value > currentLength) {
				var _g = currentLength;
				var _g1 = value;
				while(_g < _g1) {
					var i = _g++;
					this.__array[i] = 0;
				}
			} else {
				while(this.__array.length > value) this.__array.pop();
			}
		}
		return this.__array.length;
	}
	,__class__: openfl__$Vector_FloatVector
	,__properties__: {set_length:"set_length",get_length:"get_length"}
};
var openfl__$Vector_FunctionVector = function(length,fixed,array) {
	if(fixed == null) {
		fixed = false;
	}
	if(length == null) {
		length = 0;
	}
	if(array == null) {
		array = [];
	}
	this.__array = array;
	if(length > 0) {
		this.set_length(length);
	}
	this.fixed = fixed;
};
$hxClasses["openfl._Vector.FunctionVector"] = openfl__$Vector_FunctionVector;
openfl__$Vector_FunctionVector.__name__ = "openfl._Vector.FunctionVector";
openfl__$Vector_FunctionVector.__interfaces__ = [openfl__$Vector_IVector];
openfl__$Vector_FunctionVector.prototype = {
	fixed: null
	,__array: null
	,__tempIndex: null
	,concat: function(a) {
		if(a == null) {
			return new openfl__$Vector_FunctionVector(0,false,this.__array.slice());
		} else {
			var other = a;
			if(other.__array.length > 0) {
				return new openfl__$Vector_FunctionVector(0,false,this.__array.concat(other.__array));
			} else {
				return new openfl__$Vector_FunctionVector(0,false,this.__array.slice());
			}
		}
	}
	,copy: function() {
		return new openfl__$Vector_FunctionVector(0,this.fixed,this.__array.slice());
	}
	,filter: function(callback) {
		var tmp = this.fixed;
		var _g = [];
		var _g1 = 0;
		var _g2 = this.__array;
		while(_g1 < _g2.length) {
			var v = _g2[_g1];
			++_g1;
			if(callback(v)) {
				_g.push(v);
			}
		}
		return new openfl__$Vector_FunctionVector(0,tmp,_g);
	}
	,get: function(index) {
		if(index >= this.__array.length) {
			return null;
		} else {
			return this.__array[index];
		}
	}
	,indexOf: function(x,from) {
		if(from == null) {
			from = 0;
		}
		var _g = from;
		var _g1 = this.__array.length;
		while(_g < _g1) {
			var i = _g++;
			if(this.__array[i] == x) {
				return i;
			}
		}
		return -1;
	}
	,insertAt: function(index,element) {
		if(!this.fixed || index < this.__array.length) {
			this.__array.splice(index,0,element);
		}
	}
	,iterator: function() {
		return new haxe_iterators_ArrayIterator(this.__array);
	}
	,join: function(sep) {
		if(sep == null) {
			sep = ",";
		}
		return this.__array.join(sep);
	}
	,lastIndexOf: function(x,from) {
		var i = from == null || from >= this.__array.length ? this.__array.length - 1 : from;
		while(i >= 0) {
			if(this.__array[i] == x) {
				return i;
			}
			--i;
		}
		return -1;
	}
	,pop: function() {
		if(!this.fixed) {
			return this.__array.pop();
		} else {
			return null;
		}
	}
	,push: function(x) {
		if(!this.fixed) {
			return this.__array.push(x);
		} else {
			return this.__array.length;
		}
	}
	,removeAt: function(index) {
		if(!this.fixed || index < this.__array.length) {
			return this.__array.splice(index,1)[0];
		}
		return null;
	}
	,reverse: function() {
		this.__array.reverse();
		return this;
	}
	,set: function(index,value) {
		if(!this.fixed || index < this.__array.length) {
			return this.__array[index] = value;
		} else {
			return value;
		}
	}
	,shift: function() {
		if(!this.fixed) {
			return this.__array.shift();
		} else {
			return null;
		}
	}
	,slice: function(startIndex,endIndex) {
		if(startIndex == null) {
			startIndex = 0;
		}
		if(endIndex == null) {
			endIndex = 16777215;
		}
		return new openfl__$Vector_FunctionVector(0,false,this.__array.slice(startIndex,endIndex));
	}
	,sort: function(f) {
		this.__array.sort(f);
	}
	,splice: function(pos,len) {
		return new openfl__$Vector_FunctionVector(0,false,this.__array.splice(pos,len));
	}
	,toJSON: function() {
		return this.__array;
	}
	,toString: function() {
		if(this.__array != null) {
			return this.__array.toString();
		} else {
			return null;
		}
	}
	,unshift: function(x) {
		if(!this.fixed) {
			this.__array.unshift(x);
		}
	}
	,get_length: function() {
		return this.__array.length;
	}
	,set_length: function(value) {
		if(!this.fixed) {
			var currentLength = this.__array.length;
			if(value < 0) {
				value = 0;
			}
			if(value > currentLength) {
				var _g = currentLength;
				var _g1 = value;
				while(_g < _g1) {
					var i = _g++;
					this.__array[i] = null;
				}
			} else {
				while(this.__array.length > value) this.__array.pop();
			}
		}
		return this.__array.length;
	}
	,__class__: openfl__$Vector_FunctionVector
	,__properties__: {set_length:"set_length",get_length:"get_length"}
};
var openfl__$Vector_IntVector = function(length,fixed,array) {
	if(fixed == null) {
		fixed = false;
	}
	if(length == null) {
		length = 0;
	}
	if(array == null) {
		array = [];
	}
	this.__array = array;
	if(length > 0) {
		this.set_length(length);
	}
	this.fixed = fixed;
};
$hxClasses["openfl._Vector.IntVector"] = openfl__$Vector_IntVector;
openfl__$Vector_IntVector.__name__ = "openfl._Vector.IntVector";
openfl__$Vector_IntVector.__interfaces__ = [openfl__$Vector_IVector];
openfl__$Vector_IntVector.prototype = {
	fixed: null
	,__array: null
	,__tempIndex: null
	,concat: function(a) {
		if(a == null) {
			return new openfl__$Vector_IntVector(0,false,this.__array.slice());
		} else {
			var other = a;
			if(other.__array.length > 0) {
				return new openfl__$Vector_IntVector(0,false,this.__array.concat(other.__array));
			} else {
				return new openfl__$Vector_IntVector(0,false,this.__array.slice());
			}
		}
	}
	,copy: function() {
		return new openfl__$Vector_IntVector(0,this.fixed,this.__array.slice());
	}
	,filter: function(callback) {
		var tmp = this.fixed;
		var _g = [];
		var _g1 = 0;
		var _g2 = this.__array;
		while(_g1 < _g2.length) {
			var v = _g2[_g1];
			++_g1;
			if(callback(v)) {
				_g.push(v);
			}
		}
		return new openfl__$Vector_IntVector(0,tmp,_g);
	}
	,get: function(index) {
		return this.__array[index];
	}
	,indexOf: function(x,from) {
		if(from == null) {
			from = 0;
		}
		var _g = from;
		var _g1 = this.__array.length;
		while(_g < _g1) {
			var i = _g++;
			if(this.__array[i] == x) {
				return i;
			}
		}
		return -1;
	}
	,insertAt: function(index,element) {
		if(!this.fixed || index < this.__array.length) {
			this.__array.splice(index,0,element);
		}
	}
	,iterator: function() {
		return new haxe_iterators_ArrayIterator(this.__array);
	}
	,join: function(sep) {
		if(sep == null) {
			sep = ",";
		}
		return this.__array.join(sep);
	}
	,lastIndexOf: function(x,from) {
		var i = from == null || from >= this.__array.length ? this.__array.length - 1 : from;
		while(i >= 0) {
			if(this.__array[i] == x) {
				return i;
			}
			--i;
		}
		return -1;
	}
	,pop: function() {
		if(!this.fixed) {
			return this.__array.pop();
		} else {
			return null;
		}
	}
	,push: function(x) {
		if(!this.fixed) {
			return this.__array.push(x);
		} else {
			return this.__array.length;
		}
	}
	,removeAt: function(index) {
		if(!this.fixed || index < this.__array.length) {
			return this.__array.splice(index,1)[0];
		}
		return 0;
	}
	,reverse: function() {
		this.__array.reverse();
		return this;
	}
	,set: function(index,value) {
		if(!this.fixed || index < this.__array.length) {
			return this.__array[index] = value;
		} else {
			return value;
		}
	}
	,shift: function() {
		if(!this.fixed) {
			return this.__array.shift();
		} else {
			return null;
		}
	}
	,slice: function(startIndex,endIndex) {
		if(startIndex == null) {
			startIndex = 0;
		}
		if(endIndex == null) {
			endIndex = 16777215;
		}
		return new openfl__$Vector_IntVector(0,false,this.__array.slice(startIndex,endIndex));
	}
	,sort: function(f) {
		this.__array.sort(f);
	}
	,splice: function(pos,len) {
		return new openfl__$Vector_IntVector(0,false,this.__array.splice(pos,len));
	}
	,toJSON: function() {
		return this.__array;
	}
	,toString: function() {
		if(this.__array != null) {
			return this.__array.toString();
		} else {
			return null;
		}
	}
	,unshift: function(x) {
		if(!this.fixed) {
			this.__array.unshift(x);
		}
	}
	,get_length: function() {
		return this.__array.length;
	}
	,set_length: function(value) {
		if(!this.fixed) {
			var currentLength = this.__array.length;
			if(value < 0) {
				value = 0;
			}
			if(value > currentLength) {
				var _g = currentLength;
				var _g1 = value;
				while(_g < _g1) {
					var i = _g++;
					this.__array[i] = 0;
				}
			} else {
				while(this.__array.length > value) this.__array.pop();
			}
		}
		return this.__array.length;
	}
	,__class__: openfl__$Vector_IntVector
	,__properties__: {set_length:"set_length",get_length:"get_length"}
};
var openfl__$Vector_ObjectVector = function(length,fixed,array,forceCopy) {
	if(forceCopy == null) {
		forceCopy = false;
	}
	if(fixed == null) {
		fixed = false;
	}
	if(length == null) {
		length = 0;
	}
	if(forceCopy) {
		this.__array = [];
		if(array != null) {
			var _g = 0;
			var _g1 = array.length;
			while(_g < _g1) {
				var i = _g++;
				this.__array[i] = array[i];
			}
		}
	} else {
		if(array == null) {
			array = [];
		}
		this.__array = array;
	}
	if(length > 0) {
		this.set_length(length);
	}
	this.fixed = fixed;
};
$hxClasses["openfl._Vector.ObjectVector"] = openfl__$Vector_ObjectVector;
openfl__$Vector_ObjectVector.__name__ = "openfl._Vector.ObjectVector";
openfl__$Vector_ObjectVector.__interfaces__ = [openfl__$Vector_IVector];
openfl__$Vector_ObjectVector.prototype = {
	fixed: null
	,__array: null
	,__tempIndex: null
	,concat: function(a) {
		if(a == null) {
			return new openfl__$Vector_ObjectVector(0,false,this.__array.slice());
		} else {
			var other = a;
			if(other.__array.length > 0) {
				return new openfl__$Vector_ObjectVector(0,false,this.__array.concat(other.__array));
			} else {
				return new openfl__$Vector_ObjectVector(0,false,this.__array.slice());
			}
		}
	}
	,copy: function() {
		return new openfl__$Vector_ObjectVector(0,this.fixed,this.__array.slice());
	}
	,filter: function(callback) {
		var tmp = this.fixed;
		var _g = [];
		var _g1 = 0;
		var _g2 = this.__array;
		while(_g1 < _g2.length) {
			var v = _g2[_g1];
			++_g1;
			if(callback(v)) {
				_g.push(v);
			}
		}
		return new openfl__$Vector_ObjectVector(0,tmp,_g);
	}
	,get: function(index) {
		return this.__array[index];
	}
	,indexOf: function(x,from) {
		if(from == null) {
			from = 0;
		}
		var _g = from;
		var _g1 = this.__array.length;
		while(_g < _g1) {
			var i = _g++;
			if(this.__array[i] == x) {
				return i;
			}
		}
		return -1;
	}
	,insertAt: function(index,element) {
		if(!this.fixed || index < this.__array.length) {
			this.__array.splice(index,0,element);
		}
	}
	,iterator: function() {
		return new haxe_iterators_ArrayIterator(this.__array);
	}
	,join: function(sep) {
		if(sep == null) {
			sep = ",";
		}
		return this.__array.join(sep);
	}
	,lastIndexOf: function(x,from) {
		var i = from == null || from >= this.__array.length ? this.__array.length - 1 : from;
		while(i >= 0) {
			if(this.__array[i] == x) {
				return i;
			}
			--i;
		}
		return -1;
	}
	,pop: function() {
		if(!this.fixed) {
			return this.__array.pop();
		} else {
			return null;
		}
	}
	,push: function(x) {
		if(!this.fixed) {
			return this.__array.push(x);
		} else {
			return this.__array.length;
		}
	}
	,removeAt: function(index) {
		if(!this.fixed || index < this.__array.length) {
			return this.__array.splice(index,1)[0];
		}
		return null;
	}
	,reverse: function() {
		this.__array.reverse();
		return this;
	}
	,set: function(index,value) {
		if(!this.fixed || index < this.__array.length) {
			return this.__array[index] = value;
		} else {
			return value;
		}
	}
	,shift: function() {
		if(!this.fixed) {
			return this.__array.shift();
		} else {
			return null;
		}
	}
	,slice: function(startIndex,endIndex) {
		if(startIndex == null) {
			startIndex = 0;
		}
		if(endIndex == null) {
			endIndex = 16777215;
		}
		return new openfl__$Vector_ObjectVector(0,false,this.__array.slice(startIndex,endIndex));
	}
	,sort: function(f) {
		this.__array.sort(f);
	}
	,splice: function(pos,len) {
		return new openfl__$Vector_ObjectVector(0,false,this.__array.splice(pos,len));
	}
	,toJSON: function() {
		return this.__array;
	}
	,toString: function() {
		if(this.__array != null) {
			return this.__array.toString();
		} else {
			return null;
		}
	}
	,unshift: function(x) {
		if(!this.fixed) {
			this.__array.unshift(x);
		}
	}
	,get_length: function() {
		return this.__array.length;
	}
	,set_length: function(value) {
		if(!this.fixed) {
			var currentLength = this.__array.length;
			if(value < 0) {
				value = 0;
			}
			if(value > currentLength) {
				var _g = currentLength;
				var _g1 = value;
				while(_g < _g1) {
					var i = _g++;
					this.__array.push(null);
				}
			} else {
				while(this.__array.length > value) this.__array.pop();
			}
		}
		return this.__array.length;
	}
	,__class__: openfl__$Vector_ObjectVector
	,__properties__: {set_length:"set_length",get_length:"get_length"}
};
var openfl_desktop_Clipboard = function() {
};
$hxClasses["openfl.desktop.Clipboard"] = openfl_desktop_Clipboard;
openfl_desktop_Clipboard.__name__ = "openfl.desktop.Clipboard";
openfl_desktop_Clipboard.__properties__ = {get_generalClipboard:"get_generalClipboard"};
openfl_desktop_Clipboard.get_generalClipboard = function() {
	if(openfl_desktop_Clipboard.__generalClipboard == null) {
		openfl_desktop_Clipboard.__generalClipboard = new openfl_desktop_Clipboard();
		openfl_desktop_Clipboard.__generalClipboard.__systemClipboard = true;
	}
	return openfl_desktop_Clipboard.__generalClipboard;
};
openfl_desktop_Clipboard.prototype = {
	__htmlText: null
	,__richText: null
	,__systemClipboard: null
	,__text: null
	,clear: function() {
		if(this.__systemClipboard) {
			lime_system_Clipboard.set_text(null);
			return;
		}
		this.__htmlText = null;
		this.__richText = null;
		this.__text = null;
	}
	,clearData: function(format) {
		if(this.__systemClipboard) {
			switch(format) {
			case 0:case 1:case 2:
				lime_system_Clipboard.set_text(null);
				break;
			default:
			}
			return;
		}
		switch(format) {
		case 0:
			this.__htmlText = null;
			break;
		case 1:
			this.__richText = null;
			break;
		case 2:
			this.__text = null;
			break;
		default:
		}
	}
	,getData: function(format,transferMode) {
		if(transferMode == null) {
			transferMode = 3;
		}
		if(this.__systemClipboard) {
			switch(format) {
			case 0:case 1:case 2:
				return lime_system_Clipboard.get_text();
			default:
				return null;
			}
		}
		switch(format) {
		case 0:
			return this.__htmlText;
		case 1:
			return this.__richText;
		case 2:
			return this.__text;
		default:
			return null;
		}
	}
	,hasFormat: function(format) {
		if(this.__systemClipboard) {
			switch(format) {
			case 0:case 1:case 2:
				return lime_system_Clipboard.get_text() != null;
			default:
				return false;
			}
		}
		switch(format) {
		case 0:
			return this.__htmlText != null;
		case 1:
			return this.__richText != null;
		case 2:
			return this.__text != null;
		default:
			return false;
		}
	}
	,setData: function(format,data,serializable) {
		if(serializable == null) {
			serializable = true;
		}
		if(this.__systemClipboard) {
			switch(format) {
			case 0:case 1:case 2:
				var this1 = data;
				lime_system_Clipboard.set_text(this1 == null ? null : Std.string(this1));
				return true;
			default:
				return false;
			}
		}
		switch(format) {
		case 0:
			var this1 = data;
			this.__htmlText = this1 == null ? null : Std.string(this1);
			return true;
		case 1:
			var this1 = data;
			this.__richText = this1 == null ? null : Std.string(this1);
			return true;
		case 2:
			var this1 = data;
			this.__text = this1 == null ? null : Std.string(this1);
			return true;
		default:
			return false;
		}
	}
	,setDataHandler: function(format,handler,serializable) {
		if(serializable == null) {
			serializable = true;
		}
		openfl_utils__$internal_Lib.notImplemented({ fileName : "openfl/desktop/Clipboard.hx", lineNumber : 514, className : "openfl.desktop.Clipboard", methodName : "setDataHandler"});
		return false;
	}
	,get_formats: function() {
		var formats = [];
		if(this.hasFormat(0)) {
			formats.push(0);
		}
		if(this.hasFormat(1)) {
			formats.push(1);
		}
		if(this.hasFormat(2)) {
			formats.push(2);
		}
		return formats;
	}
	,__class__: openfl_desktop_Clipboard
	,__properties__: {get_formats:"get_formats"}
};
var openfl_desktop_ClipboardFormats = {};
openfl_desktop_ClipboardFormats.fromString = function(value) {
	switch(value) {
	case "air:html":
		return 0;
	case "air:rtf":
		return 1;
	case "air:text":
		return 2;
	default:
		return null;
	}
};
openfl_desktop_ClipboardFormats.toString = function(this1) {
	switch(this1) {
	case 0:
		return "air:html";
	case 1:
		return "air:rtf";
	case 2:
		return "air:text";
	default:
		return null;
	}
};
var openfl_desktop_ClipboardTransferMode = {};
openfl_desktop_ClipboardTransferMode.fromString = function(value) {
	switch(value) {
	case "cloneOnly":
		return 0;
	case "clonePreferred":
		return 1;
	case "originalOnly":
		return 2;
	case "originalPreferred":
		return 3;
	default:
		return null;
	}
};
openfl_desktop_ClipboardTransferMode.toString = function(this1) {
	switch(this1) {
	case 0:
		return "cloneOnly";
	case 1:
		return "clonePreferred";
	case 2:
		return "originalOnly";
	case 3:
		return "originalPreferred";
	default:
		return null;
	}
};
var openfl_display_Application = function() {
	lime_app_Application.call(this);
	if(openfl_utils__$internal_Lib.application == null) {
		openfl_utils__$internal_Lib.application = this;
	}
	if(openfl_utils__$internal_Lib.current == null) {
		openfl_utils__$internal_Lib.current = new openfl_display_MovieClip();
	}
	openfl_utils__$internal_Lib.current.__loaderInfo = openfl_display_LoaderInfo.create(null);
	openfl_utils__$internal_Lib.current.__loaderInfo.content = openfl_utils__$internal_Lib.current;
};
$hxClasses["openfl.display.Application"] = openfl_display_Application;
openfl_display_Application.__name__ = "openfl.display.Application";
openfl_display_Application.__super__ = lime_app_Application;
openfl_display_Application.prototype = $extend(lime_app_Application.prototype,{
	createWindow: function(attributes) {
		var window1 = new openfl_display_Window(this,attributes);
		if(openfl_utils__$internal_Lib.current.__loaderInfo.width == -1) {
			openfl_utils__$internal_Lib.current.__loaderInfo.width = window1.__width;
			openfl_utils__$internal_Lib.current.__loaderInfo.height = window1.__height;
		}
		this.__windows.push(window1);
		this.__windowByID.h[window1.id] = window1;
		var _g = this;
		var window2 = window1;
		var tmp = function() {
			_g.__onWindowClose(window2);
		};
		window1.onClose.add(tmp,false,-10000);
		if(this.__window == null) {
			this.__window = window1;
			window1.onActivate.add($bind(this,this.onWindowActivate));
			window1.onRenderContextLost.add($bind(this,this.onRenderContextLost));
			window1.onRenderContextRestored.add($bind(this,this.onRenderContextRestored));
			window1.onDeactivate.add($bind(this,this.onWindowDeactivate));
			window1.onDropFile.add($bind(this,this.onWindowDropFile));
			window1.onEnter.add($bind(this,this.onWindowEnter));
			window1.onExpose.add($bind(this,this.onWindowExpose));
			window1.onFocusIn.add($bind(this,this.onWindowFocusIn));
			window1.onFocusOut.add($bind(this,this.onWindowFocusOut));
			window1.onFullscreen.add($bind(this,this.onWindowFullscreen));
			window1.onKeyDown.add($bind(this,this.onKeyDown));
			window1.onKeyUp.add($bind(this,this.onKeyUp));
			window1.onLeave.add($bind(this,this.onWindowLeave));
			window1.onMinimize.add($bind(this,this.onWindowMinimize));
			window1.onMouseDown.add($bind(this,this.onMouseDown));
			window1.onMouseMove.add($bind(this,this.onMouseMove));
			window1.onMouseMoveRelative.add($bind(this,this.onMouseMoveRelative));
			window1.onMouseUp.add($bind(this,this.onMouseUp));
			window1.onMouseWheel.add($bind(this,this.onMouseWheel));
			window1.onMove.add($bind(this,this.onWindowMove));
			window1.onRender.add($bind(this,this.render));
			window1.onResize.add($bind(this,this.onWindowResize));
			window1.onRestore.add($bind(this,this.onWindowRestore));
			window1.onTextEdit.add($bind(this,this.onTextEdit));
			window1.onTextInput.add($bind(this,this.onTextInput));
			this.onWindowCreate();
		}
		this.onCreateWindow.dispatch(window1);
		return window1;
	}
	,exec: function() {
		return lime_app_Application.prototype.exec.call(this);
	}
	,__checkForAllWindowsClosed: function() {
		if(this.__windows.length > 0) {
			return;
		}
		lime_app_Application.prototype.__checkForAllWindowsClosed.call(this);
	}
	,__onModuleExit: function(code) {
		if(this.onExit.canceled) {
			return;
		}
		if(openfl_utils__$internal_Lib.application == this) {
			openfl_utils__$internal_Lib.application = null;
		}
		lime_app_Application.prototype.__onModuleExit.call(this,code);
	}
	,__class__: openfl_display_Application
});
var openfl_display_Bitmap = function(bitmapData,pixelSnapping,smoothing) {
	if(smoothing == null) {
		smoothing = false;
	}
	openfl_display_DisplayObject.call(this);
	this.__drawableType = 2;
	this.__bitmapData = bitmapData;
	this.pixelSnapping = pixelSnapping;
	this.smoothing = smoothing;
	if(pixelSnapping == null) {
		this.pixelSnapping = 1;
	}
};
$hxClasses["openfl.display.Bitmap"] = openfl_display_Bitmap;
openfl_display_Bitmap.__name__ = "openfl.display.Bitmap";
openfl_display_Bitmap.__super__ = openfl_display_DisplayObject;
openfl_display_Bitmap.prototype = $extend(openfl_display_DisplayObject.prototype,{
	pixelSnapping: null
	,smoothing: null
	,__image: null
	,__bitmapData: null
	,__imageVersion: null
	,__enterFrame: function(deltaTime) {
		if(this.__bitmapData != null && this.__bitmapData.image != null && this.__bitmapData.image.version != this.__imageVersion) {
			if(!this.__renderDirty) {
				this.__renderDirty = true;
				this.__setParentRenderDirty();
			}
		}
	}
	,__getBounds: function(rect,matrix) {
		var bounds = openfl_geom_Rectangle.__pool.get();
		if(this.__bitmapData != null) {
			bounds.setTo(0,0,this.__bitmapData.width,this.__bitmapData.height);
		} else {
			bounds.setTo(0,0,0,0);
		}
		bounds.__transform(bounds,matrix);
		rect.__expand(bounds.x,bounds.y,bounds.width,bounds.height);
		openfl_geom_Rectangle.__pool.release(bounds);
	}
	,__hitTest: function(x,y,shapeFlag,stack,interactiveOnly,hitObject) {
		if(!hitObject.get_visible() || this.__isMask || this.__bitmapData == null) {
			return false;
		}
		if(this.get_mask() != null && !this.get_mask().__hitTestMask(x,y)) {
			return false;
		}
		this.__getRenderTransform();
		var _this = this.__renderTransform;
		var norm = _this.a * _this.d - _this.b * _this.c;
		var px = norm == 0 ? -_this.tx : 1.0 / norm * (_this.c * (_this.ty - y) + _this.d * (x - _this.tx));
		var _this = this.__renderTransform;
		var norm = _this.a * _this.d - _this.b * _this.c;
		var py = norm == 0 ? -_this.ty : 1.0 / norm * (_this.a * (y - _this.ty) + _this.b * (_this.tx - x));
		if(px > 0 && py > 0 && px <= this.__bitmapData.width && py <= this.__bitmapData.height) {
			if(this.__scrollRect != null && !this.__scrollRect.contains(px,py)) {
				return false;
			}
			if(stack != null && !interactiveOnly) {
				stack.push(hitObject);
			}
			return true;
		}
		return false;
	}
	,__hitTestMask: function(x,y) {
		if(this.__bitmapData == null) {
			return false;
		}
		this.__getRenderTransform();
		var _this = this.__renderTransform;
		var norm = _this.a * _this.d - _this.b * _this.c;
		var px = norm == 0 ? -_this.tx : 1.0 / norm * (_this.c * (_this.ty - y) + _this.d * (x - _this.tx));
		var _this = this.__renderTransform;
		var norm = _this.a * _this.d - _this.b * _this.c;
		var py = norm == 0 ? -_this.ty : 1.0 / norm * (_this.a * (y - _this.ty) + _this.b * (_this.tx - x));
		if(px > 0 && py > 0 && px <= this.__bitmapData.width && py <= this.__bitmapData.height) {
			return true;
		}
		return false;
	}
	,get_bitmapData: function() {
		return this.__bitmapData;
	}
	,set_bitmapData: function(value) {
		this.__bitmapData = value;
		this.smoothing = false;
		if(!this.__renderDirty) {
			this.__renderDirty = true;
			this.__setParentRenderDirty();
		}
		var tmp = this.__filters != null;
		this.__imageVersion = -1;
		return this.__bitmapData;
	}
	,set_height: function(value) {
		if(this.__bitmapData != null) {
			this.set_scaleY(value / this.__bitmapData.height);
		} else {
			this.set_scaleY(0);
		}
		return value;
	}
	,set_width: function(value) {
		if(this.__bitmapData != null) {
			this.set_scaleX(value / this.__bitmapData.width);
		} else {
			this.set_scaleX(0);
		}
		return value;
	}
	,__class__: openfl_display_Bitmap
	,__properties__: $extend(openfl_display_DisplayObject.prototype.__properties__,{set_bitmapData:"set_bitmapData",get_bitmapData:"get_bitmapData"})
});
var openfl_geom_Rectangle = function(x,y,width,height) {
	if(height == null) {
		height = 0;
	}
	if(width == null) {
		width = 0;
	}
	if(y == null) {
		y = 0;
	}
	if(x == null) {
		x = 0;
	}
	this.x = x;
	this.y = y;
	this.width = width;
	this.height = height;
};
$hxClasses["openfl.geom.Rectangle"] = openfl_geom_Rectangle;
openfl_geom_Rectangle.__name__ = "openfl.geom.Rectangle";
openfl_geom_Rectangle.prototype = {
	height: null
	,width: null
	,x: null
	,y: null
	,clone: function() {
		return new openfl_geom_Rectangle(this.x,this.y,this.width,this.height);
	}
	,contains: function(x,y) {
		if(x >= this.x && y >= this.y && x < this.get_right()) {
			return y < this.get_bottom();
		} else {
			return false;
		}
	}
	,containsPoint: function(point) {
		return this.contains(point.x,point.y);
	}
	,containsRect: function(rect) {
		if(rect.width <= 0 || rect.height <= 0) {
			if(rect.x > this.x && rect.y > this.y && rect.get_right() < this.get_right()) {
				return rect.get_bottom() < this.get_bottom();
			} else {
				return false;
			}
		} else if(rect.x >= this.x && rect.y >= this.y && rect.get_right() <= this.get_right()) {
			return rect.get_bottom() <= this.get_bottom();
		} else {
			return false;
		}
	}
	,copyFrom: function(sourceRect) {
		this.x = sourceRect.x;
		this.y = sourceRect.y;
		this.width = sourceRect.width;
		this.height = sourceRect.height;
	}
	,equals: function(toCompare) {
		if(toCompare == this) {
			return true;
		} else if(toCompare != null && this.x == toCompare.x && this.y == toCompare.y && this.width == toCompare.width) {
			return this.height == toCompare.height;
		} else {
			return false;
		}
	}
	,inflate: function(dx,dy) {
		this.x -= dx;
		this.width += dx * 2;
		this.y -= dy;
		this.height += dy * 2;
	}
	,inflatePoint: function(point) {
		this.inflate(point.x,point.y);
	}
	,intersection: function(toIntersect) {
		var x0 = this.x < toIntersect.x ? toIntersect.x : this.x;
		var x1 = this.get_right() > toIntersect.get_right() ? toIntersect.get_right() : this.get_right();
		if(x1 <= x0) {
			return new openfl_geom_Rectangle();
		}
		var y0 = this.y < toIntersect.y ? toIntersect.y : this.y;
		var y1 = this.get_bottom() > toIntersect.get_bottom() ? toIntersect.get_bottom() : this.get_bottom();
		if(y1 <= y0) {
			return new openfl_geom_Rectangle();
		}
		return new openfl_geom_Rectangle(x0,y0,x1 - x0,y1 - y0);
	}
	,intersectionToOutput: function(toIntersect,output) {
		if(output == null) {
			output = new openfl_geom_Rectangle();
		}
		var x0 = this.x < toIntersect.x ? toIntersect.x : this.x;
		var x1 = this.get_right() > toIntersect.get_right() ? toIntersect.get_right() : this.get_right();
		if(x1 <= x0) {
			output.setTo(0.0,0.0,0.0,0.0);
			return output;
		}
		var y0 = this.y < toIntersect.y ? toIntersect.y : this.y;
		var y1 = this.get_bottom() > toIntersect.get_bottom() ? toIntersect.get_bottom() : this.get_bottom();
		if(y1 <= y0) {
			output.setTo(0.0,0.0,0.0,0.0);
			return output;
		}
		output.setTo(x0,y0,x1 - x0,y1 - y0);
		return output;
	}
	,intersects: function(toIntersect) {
		var x0 = this.x < toIntersect.x ? toIntersect.x : this.x;
		var x1 = this.get_right() > toIntersect.get_right() ? toIntersect.get_right() : this.get_right();
		if(x1 <= x0) {
			return false;
		}
		var y0 = this.y < toIntersect.y ? toIntersect.y : this.y;
		var y1 = this.get_bottom() > toIntersect.get_bottom() ? toIntersect.get_bottom() : this.get_bottom();
		return y1 > y0;
	}
	,isEmpty: function() {
		if(!(this.width <= 0)) {
			return this.height <= 0;
		} else {
			return true;
		}
	}
	,offset: function(dx,dy) {
		this.x += dx;
		this.y += dy;
	}
	,offsetPoint: function(point) {
		this.x += point.x;
		this.y += point.y;
	}
	,setEmpty: function() {
		this.x = this.y = this.width = this.height = 0;
	}
	,setTo: function(xa,ya,widtha,heighta) {
		this.x = xa;
		this.y = ya;
		this.width = widtha;
		this.height = heighta;
	}
	,toString: function() {
		return "(x=" + this.x + ", y=" + this.y + ", width=" + this.width + ", height=" + this.height + ")";
	}
	,union: function(toUnion) {
		if(this.width == 0 || this.height == 0) {
			return toUnion.clone();
		} else if(toUnion.width == 0 || toUnion.height == 0) {
			return this.clone();
		}
		var x0 = this.x > toUnion.x ? toUnion.x : this.x;
		var x1 = this.get_right() < toUnion.get_right() ? toUnion.get_right() : this.get_right();
		var y0 = this.y > toUnion.y ? toUnion.y : this.y;
		var y1 = this.get_bottom() < toUnion.get_bottom() ? toUnion.get_bottom() : this.get_bottom();
		return new openfl_geom_Rectangle(x0,y0,x1 - x0,y1 - y0);
	}
	,unionToOutput: function(toUnion,output) {
		if(output == null) {
			output = new openfl_geom_Rectangle();
		}
		if(this.width == 0 || this.height == 0) {
			output.setTo(toUnion.x,toUnion.y,toUnion.width,toUnion.height);
			return output;
		} else if(toUnion.width == 0 || toUnion.height == 0) {
			output.setTo(this.x,this.y,this.width,this.height);
			return output;
		}
		var x0 = this.x > toUnion.x ? toUnion.x : this.x;
		var x1 = this.get_right() < toUnion.get_right() ? toUnion.get_right() : this.get_right();
		var y0 = this.y > toUnion.y ? toUnion.y : this.y;
		var y1 = this.get_bottom() < toUnion.get_bottom() ? toUnion.get_bottom() : this.get_bottom();
		output.setTo(x0,y0,x1 - x0,y1 - y0);
		return output;
	}
	,__contract: function(x,y,width,height) {
		if(this.width == 0 && this.height == 0) {
			return;
		}
		var offsetX = 0.0;
		var offsetY = 0.0;
		var offsetRight = 0.0;
		var offsetBottom = 0.0;
		if(this.x < x) {
			offsetX = x - this.x;
		}
		if(this.y < y) {
			offsetY = y - this.y;
		}
		if(this.get_right() > x + width) {
			offsetRight = x + width - this.get_right();
		}
		if(this.get_bottom() > y + height) {
			offsetBottom = y + height - this.get_bottom();
		}
		this.x += offsetX;
		this.y += offsetY;
		this.width += offsetRight - offsetX;
		this.height += offsetBottom - offsetY;
	}
	,__expand: function(x,y,width,height) {
		if(this.width == 0 && this.height == 0) {
			this.x = x;
			this.y = y;
			this.width = width;
			this.height = height;
			return;
		}
		var cacheRight = this.get_right();
		var cacheBottom = this.get_bottom();
		if(this.x > x) {
			this.x = x;
			this.width = cacheRight - x;
		}
		if(this.y > y) {
			this.y = y;
			this.height = cacheBottom - y;
		}
		if(cacheRight < x + width) {
			this.width = x + width - this.x;
		}
		if(cacheBottom < y + height) {
			this.height = y + height - this.y;
		}
	}
	,__toLimeRectangle: function() {
		if(openfl_geom_Rectangle.__limeRectangle == null) {
			openfl_geom_Rectangle.__limeRectangle = new lime_math_Rectangle();
		}
		openfl_geom_Rectangle.__limeRectangle.setTo(this.x,this.y,this.width,this.height);
		return openfl_geom_Rectangle.__limeRectangle;
	}
	,__transform: function(rect,m) {
		var tx0 = m.a * this.x + m.c * this.y;
		var tx1 = tx0;
		var ty0 = m.b * this.x + m.d * this.y;
		var ty1 = ty0;
		var tx = m.a * (this.x + this.width) + m.c * this.y;
		var ty = m.b * (this.x + this.width) + m.d * this.y;
		if(tx < tx0) {
			tx0 = tx;
		}
		if(ty < ty0) {
			ty0 = ty;
		}
		if(tx > tx1) {
			tx1 = tx;
		}
		if(ty > ty1) {
			ty1 = ty;
		}
		tx = m.a * (this.x + this.width) + m.c * (this.y + this.height);
		ty = m.b * (this.x + this.width) + m.d * (this.y + this.height);
		if(tx < tx0) {
			tx0 = tx;
		}
		if(ty < ty0) {
			ty0 = ty;
		}
		if(tx > tx1) {
			tx1 = tx;
		}
		if(ty > ty1) {
			ty1 = ty;
		}
		tx = m.a * this.x + m.c * (this.y + this.height);
		ty = m.b * this.x + m.d * (this.y + this.height);
		if(tx < tx0) {
			tx0 = tx;
		}
		if(ty < ty0) {
			ty0 = ty;
		}
		if(tx > tx1) {
			tx1 = tx;
		}
		if(ty > ty1) {
			ty1 = ty;
		}
		rect.setTo(tx0 + m.tx,ty0 + m.ty,tx1 - tx0,ty1 - ty0);
	}
	,get_bottom: function() {
		return this.y + this.height;
	}
	,set_bottom: function(b) {
		this.height = b - this.y;
		return b;
	}
	,get_bottomRight: function() {
		return new openfl_geom_Point(this.x + this.width,this.y + this.height);
	}
	,set_bottomRight: function(p) {
		this.width = p.x - this.x;
		this.height = p.y - this.y;
		return p.clone();
	}
	,get_left: function() {
		return this.x;
	}
	,set_left: function(l) {
		this.width -= l - this.x;
		this.x = l;
		return l;
	}
	,get_right: function() {
		return this.x + this.width;
	}
	,set_right: function(r) {
		this.width = r - this.x;
		return r;
	}
	,get_size: function() {
		return new openfl_geom_Point(this.width,this.height);
	}
	,set_size: function(p) {
		this.width = p.x;
		this.height = p.y;
		return p.clone();
	}
	,get_top: function() {
		return this.y;
	}
	,set_top: function(t) {
		this.height -= t - this.y;
		this.y = t;
		return t;
	}
	,get_topLeft: function() {
		return new openfl_geom_Point(this.x,this.y);
	}
	,set_topLeft: function(p) {
		this.x = p.x;
		this.y = p.y;
		return p.clone();
	}
	,__class__: openfl_geom_Rectangle
	,__properties__: {set_topLeft:"set_topLeft",get_topLeft:"get_topLeft",set_top:"set_top",get_top:"get_top",set_size:"set_size",get_size:"get_size",set_right:"set_right",get_right:"get_right",set_left:"set_left",get_left:"get_left",set_bottomRight:"set_bottomRight",get_bottomRight:"get_bottomRight",set_bottom:"set_bottom",get_bottom:"get_bottom"}
};
var openfl_display_BitmapData = function(width,height,transparent,fillColor) {
	if(fillColor == null) {
		fillColor = -1;
	}
	if(transparent == null) {
		transparent = true;
	}
	this.__drawableType = 0;
	this.transparent = transparent;
	if(width == null) {
		width = 0;
	}
	if(height == null) {
		height = 0;
	}
	if(width < 0) {
		width = 0;
	}
	if(height < 0) {
		height = 0;
	}
	this.width = width;
	this.height = height;
	this.rect = new openfl_geom_Rectangle(0,0,width,height);
	this.__textureWidth = width;
	this.__textureHeight = height;
	if(width > 0 && height > 0) {
		if(transparent) {
			if((fillColor & -16777216) == 0) {
				fillColor = 0;
			}
		} else {
			fillColor = -16777216 | fillColor & 16777215;
		}
		fillColor = fillColor << 8 | fillColor >>> 24 & 255;
		this.image = new lime_graphics_Image(null,0,0,width,height,fillColor);
		this.image.set_transparent(transparent);
		this.__isValid = true;
		this.readable = true;
	}
	this.__renderTransform = new openfl_geom_Matrix();
	this.__worldAlpha = 1;
	this.__worldTransform = new openfl_geom_Matrix();
	this.__worldColorTransform = new openfl_geom_ColorTransform();
	this.__renderable = true;
	this.__asset = false;
};
$hxClasses["openfl.display.BitmapData"] = openfl_display_BitmapData;
openfl_display_BitmapData.__name__ = "openfl.display.BitmapData";
openfl_display_BitmapData.__interfaces__ = [openfl_display_IBitmapDrawable];
openfl_display_BitmapData.fromBase64 = function(base64,type) {
	return null;
};
openfl_display_BitmapData.fromBytes = function(bytes,rawAlpha) {
	return null;
};
openfl_display_BitmapData.fromCanvas = function(canvas,transparent) {
	if(transparent == null) {
		transparent = true;
	}
	if(canvas == null) {
		return null;
	}
	var bitmapData = new openfl_display_BitmapData(0,0,transparent,0);
	bitmapData.__fromImage(lime_graphics_Image.fromCanvas(canvas));
	bitmapData.image.set_transparent(transparent);
	return bitmapData;
};
openfl_display_BitmapData.fromFile = function(path) {
	return null;
};
openfl_display_BitmapData.fromImage = function(image,transparent) {
	if(transparent == null) {
		transparent = true;
	}
	if(image == null || image.buffer == null) {
		return null;
	}
	var bitmapData = new openfl_display_BitmapData(0,0,transparent,0);
	bitmapData.__fromImage(image);
	bitmapData.image.set_transparent(transparent);
	if(bitmapData.image != null) {
		return bitmapData;
	} else {
		return null;
	}
};
openfl_display_BitmapData.fromTexture = function(texture) {
	if(texture == null) {
		return null;
	}
	var bitmapData = new openfl_display_BitmapData(texture.__width,texture.__height,true,0);
	bitmapData.readable = false;
	bitmapData.__texture = texture;
	bitmapData.__textureContext = texture.__textureContext;
	bitmapData.image = null;
	return bitmapData;
};
openfl_display_BitmapData.loadFromBase64 = function(base64,type) {
	return lime_graphics_Image.loadFromBase64(base64,type).then(function(image) {
		return lime_app_Future.withValue(openfl_display_BitmapData.fromImage(image));
	});
};
openfl_display_BitmapData.loadFromBytes = function(bytes,rawAlpha) {
	return lime_graphics_Image.loadFromBytes(openfl_utils_ByteArray.toBytes(bytes)).then(function(image) {
		var bitmapData = openfl_display_BitmapData.fromImage(image);
		if(rawAlpha != null) {
			bitmapData.__applyAlpha(rawAlpha);
		}
		return lime_app_Future.withValue(bitmapData);
	});
};
openfl_display_BitmapData.loadFromFile = function(path) {
	return lime_graphics_Image.loadFromFile(path).then(function(image) {
		return lime_app_Future.withValue(openfl_display_BitmapData.fromImage(image));
	});
};
openfl_display_BitmapData.prototype = {
	height: null
	,image: null
	,readable: null
	,rect: null
	,transparent: null
	,width: null
	,__blendMode: null
	,__drawableType: null
	,__framebuffer: null
	,__framebufferContext: null
	,__indexBuffer: null
	,__indexBufferContext: null
	,__indexBufferData: null
	,__indexBufferGrid: null
	,__isMask: null
	,__isValid: null
	,__mask: null
	,__renderable: null
	,__renderTransform: null
	,__scrollRect: null
	,__stencilBuffer: null
	,__surface: null
	,__texture: null
	,__textureContext: null
	,__textureHeight: null
	,__textureVersion: null
	,__textureWidth: null
	,__transform: null
	,__uvRect: null
	,__vertexBuffer: null
	,__vertexBufferContext: null
	,__vertexBufferData: null
	,__vertexBufferGrid: null
	,__vertexBufferHeight: null
	,__vertexBufferScaleX: null
	,__vertexBufferScaleY: null
	,__vertexBufferWidth: null
	,__worldAlpha: null
	,__worldColorTransform: null
	,__worldTransform: null
	,__asset: null
	,applyFilter: function(sourceBitmapData,sourceRect,destPoint,filter) {
		if(!this.readable || sourceBitmapData == null || !sourceBitmapData.readable) {
			return;
		}
		var needSecondBitmapData = filter.__needSecondBitmapData;
		var needCopyOfOriginal = filter.__preserveObject;
		var bitmapData2 = null;
		var bitmapData3 = null;
		if(needSecondBitmapData) {
			bitmapData2 = new openfl_display_BitmapData(this.width,this.height,true,0);
		} else {
			bitmapData2 = this;
		}
		if(needCopyOfOriginal) {
			bitmapData3 = new openfl_display_BitmapData(this.width,this.height,true,0);
		}
		if(filter.__preserveObject) {
			bitmapData3.copyPixels(this,this.rect,destPoint);
		}
		var lastBitmap = filter.__applyFilter(bitmapData2,this,sourceRect,destPoint);
		if(filter.__preserveObject) {
			lastBitmap.draw(bitmapData3,null,null);
		}
		if(needSecondBitmapData && lastBitmap == bitmapData2) {
			bitmapData2.image.version = this.image.version;
			this.image = bitmapData2.image;
		}
		this.image.dirty = true;
		this.image.version++;
	}
	,clone: function() {
		var bitmapData;
		if(!this.__isValid) {
			bitmapData = new openfl_display_BitmapData(this.width,this.height,this.transparent,0);
		} else if(!this.readable && this.image == null) {
			bitmapData = new openfl_display_BitmapData(0,0,this.transparent,0);
			bitmapData.width = this.width;
			bitmapData.height = this.height;
			bitmapData.__textureWidth = this.__textureWidth;
			bitmapData.__textureHeight = this.__textureHeight;
			bitmapData.rect.copyFrom(this.rect);
			bitmapData.__framebuffer = this.__framebuffer;
			bitmapData.__framebufferContext = this.__framebufferContext;
			bitmapData.__texture = this.__texture;
			bitmapData.__textureContext = this.__textureContext;
			bitmapData.__isValid = true;
		} else {
			bitmapData = openfl_display_BitmapData.fromImage(this.image.clone(),this.transparent);
		}
		bitmapData.__worldTransform.copyFrom(this.__worldTransform);
		bitmapData.__renderTransform.copyFrom(this.__renderTransform);
		return bitmapData;
	}
	,colorTransform: function(rect,colorTransform) {
		if(!this.readable) {
			return;
		}
		this.image.colorTransform(rect.__toLimeRectangle(),colorTransform.__toLimeColorMatrix());
	}
	,compare: function(otherBitmapData) {
		if(otherBitmapData == this) {
			return 0;
		} else if(otherBitmapData == null) {
			return -1;
		} else if(this.readable == false || otherBitmapData.readable == false) {
			return -2;
		} else if(this.width != otherBitmapData.width) {
			return -3;
		} else if(this.height != otherBitmapData.height) {
			return -4;
		}
		if(this.image != null && otherBitmapData.image != null && this.image.get_format() == otherBitmapData.image.get_format()) {
			var bytes = this.image.get_data();
			var otherBytes = otherBitmapData.image.get_data();
			var equal = true;
			var _g = 0;
			var _g1 = bytes.length;
			while(_g < _g1) {
				var i = _g++;
				if(bytes[i] != otherBytes[i]) {
					equal = false;
					break;
				}
			}
			if(equal) {
				return 0;
			}
		}
		var bitmapData = null;
		var foundDifference = false;
		var pixel;
		var otherPixel;
		var comparePixel;
		var _g = 0;
		var _g1 = this.height;
		while(_g < _g1) {
			var y = _g++;
			var _g2 = 0;
			var _g3 = this.width;
			while(_g2 < _g3) {
				var x = _g2++;
				foundDifference = false;
				pixel = this.getPixel32(x,y);
				otherPixel = otherBitmapData.getPixel32(x,y);
				comparePixel = 0;
				if(pixel != otherPixel) {
					var r = (pixel >>> 16 & 255) - (otherPixel >>> 16 & 255);
					var g = (pixel >>> 8 & 255) - (otherPixel >>> 8 & 255);
					var b = (pixel & 255) - (otherPixel & 255);
					if(r < 0) {
						r *= -1;
					}
					if(g < 0) {
						g *= -1;
					}
					if(b < 0) {
						b *= -1;
					}
					if(r == 0 && g == 0 && b == 0) {
						var a = (pixel >>> 24 & 255) - (otherPixel >>> 24 & 255);
						if(a != 0) {
							comparePixel = (comparePixel >>> 24 & 255 & 255) << 24 | 16711680 | (comparePixel >>> 8 & 255 & 255) << 8 | comparePixel & 255 & 255;
							comparePixel = (comparePixel >>> 24 & 255 & 255) << 24 | (comparePixel >>> 16 & 255 & 255) << 16 | 65280 | comparePixel & 255 & 255;
							comparePixel = (comparePixel >>> 24 & 255 & 255) << 24 | (comparePixel >>> 16 & 255 & 255) << 16 | (comparePixel >>> 8 & 255 & 255) << 8 | 255;
							comparePixel = (a & 255) << 24 | (comparePixel >>> 16 & 255 & 255) << 16 | (comparePixel >>> 8 & 255 & 255) << 8 | comparePixel & 255 & 255;
							foundDifference = true;
						}
					} else {
						comparePixel = (comparePixel >>> 24 & 255 & 255) << 24 | (r & 255) << 16 | (comparePixel >>> 8 & 255 & 255) << 8 | comparePixel & 255 & 255;
						comparePixel = (comparePixel >>> 24 & 255 & 255) << 24 | (comparePixel >>> 16 & 255 & 255) << 16 | (g & 255) << 8 | comparePixel & 255 & 255;
						comparePixel = (comparePixel >>> 24 & 255 & 255) << 24 | (comparePixel >>> 16 & 255 & 255) << 16 | (comparePixel >>> 8 & 255 & 255) << 8 | b & 255;
						comparePixel = -16777216 | (comparePixel >>> 16 & 255 & 255) << 16 | (comparePixel >>> 8 & 255 & 255) << 8 | comparePixel & 255 & 255;
						foundDifference = true;
					}
				}
				if(foundDifference) {
					if(bitmapData == null) {
						bitmapData = new openfl_display_BitmapData(this.width,this.height,this.transparent || otherBitmapData.transparent,0);
					}
					bitmapData.setPixel32(x,y,comparePixel);
				}
			}
		}
		if(bitmapData == null) {
			return 0;
		}
		return bitmapData;
	}
	,copyChannel: function(sourceBitmapData,sourceRect,destPoint,sourceChannel,destChannel) {
		if(!this.readable) {
			return;
		}
		var sourceChannel1;
		switch(sourceChannel) {
		case 1:
			sourceChannel1 = lime_graphics_ImageChannel.RED;
			break;
		case 2:
			sourceChannel1 = lime_graphics_ImageChannel.GREEN;
			break;
		case 4:
			sourceChannel1 = lime_graphics_ImageChannel.BLUE;
			break;
		case 8:
			sourceChannel1 = lime_graphics_ImageChannel.ALPHA;
			break;
		default:
			return;
		}
		var destChannel1;
		switch(destChannel) {
		case 1:
			destChannel1 = lime_graphics_ImageChannel.RED;
			break;
		case 2:
			destChannel1 = lime_graphics_ImageChannel.GREEN;
			break;
		case 4:
			destChannel1 = lime_graphics_ImageChannel.BLUE;
			break;
		case 8:
			destChannel1 = lime_graphics_ImageChannel.ALPHA;
			break;
		default:
			return;
		}
		this.image.copyChannel(sourceBitmapData.image,sourceRect.__toLimeRectangle(),destPoint.__toLimeVector2(),sourceChannel1,destChannel1);
	}
	,copyPixels: function(sourceBitmapData,sourceRect,destPoint,alphaBitmapData,alphaPoint,mergeAlpha) {
		if(mergeAlpha == null) {
			mergeAlpha = false;
		}
		if(!this.readable || sourceBitmapData == null) {
			return;
		}
		if(alphaPoint != null) {
			openfl_display_BitmapData.__tempVector.x = alphaPoint.x;
			openfl_display_BitmapData.__tempVector.y = alphaPoint.y;
		}
		this.image.copyPixels(sourceBitmapData.image,sourceRect.__toLimeRectangle(),destPoint.__toLimeVector2(),alphaBitmapData != null ? alphaBitmapData.image : null,alphaPoint != null ? openfl_display_BitmapData.__tempVector : null,mergeAlpha);
	}
	,dispose: function() {
		if(this.image != null && this.image.type == lime_graphics_ImageType.CANVAS && !this.__asset) {
			var canvas = this.image.buffer.__srcCanvas;
			var context = this.image.buffer.__srcContext;
			if(canvas != null) {
				canvas.width = 0;
				canvas.height = 0;
				canvas = null;
			}
			if(context != null) {
				context.clearRect(0,0,0,0);
				context = null;
			}
		}
		this.image = null;
		this.width = 0;
		this.height = 0;
		this.rect = null;
		this.__isValid = false;
		this.readable = false;
		this.__surface = null;
		this.__vertexBuffer = null;
		this.__framebuffer = null;
		this.__framebufferContext = null;
		this.__texture = null;
		this.__textureContext = null;
	}
	,disposeImage: function() {
		this.readable = false;
	}
	,draw: function(source,matrix,colorTransform,blendMode,clipRect,smoothing) {
		if(smoothing == null) {
			smoothing = false;
		}
		if(source == null) {
			return;
		}
		var wasVisible = true;
		var sourceAsDisplayObject = null;
		if(((source) instanceof openfl_display_DisplayObject)) {
			sourceAsDisplayObject = js_Boot.__cast(source , openfl_display_DisplayObject);
			if(!sourceAsDisplayObject.get_visible()) {
				wasVisible = false;
				sourceAsDisplayObject.set_visible(true);
			}
		}
		source.__update(false,true);
		var transform = openfl_geom_Matrix.__pool.get();
		transform.copyFrom(source.__renderTransform);
		transform.invert();
		if(matrix != null) {
			transform.concat(matrix);
		}
		var clipMatrix = null;
		if(clipRect != null) {
			clipMatrix = openfl_geom_Matrix.__pool.get();
			clipMatrix.copyFrom(transform);
			clipMatrix.invert();
		}
		var _colorTransform = new openfl_geom_ColorTransform();
		_colorTransform.__copyFrom(source.__worldColorTransform);
		_colorTransform.__invert();
		if(!this.readable && openfl_Lib.get_current().stage.context3D != null) {
			if(this.__textureContext == null) {
				this.__textureContext = lime_app_Application.current.__window.context;
			}
			if(colorTransform != null) {
				_colorTransform.__combine(colorTransform);
			}
			var renderer = new openfl_display_OpenGLRenderer(openfl_Lib.get_current().stage.context3D,this);
			renderer.__allowSmoothing = smoothing;
			renderer.__pixelRatio = openfl_Lib.get_current().stage.window.__scale;
			renderer.__overrideBlendMode = blendMode;
			renderer.__worldTransform = transform;
			renderer.__worldAlpha = 1 / source.__worldAlpha;
			renderer.__worldColorTransform = _colorTransform;
			renderer.__resize(this.width,this.height);
			if(clipRect != null) {
				renderer.__pushMaskRect(clipRect,clipMatrix);
			}
			this.__drawGL(source,renderer);
			if(clipRect != null) {
				renderer.__popMaskRect();
				openfl_geom_Matrix.__pool.release(clipMatrix);
			}
		} else {
			if(colorTransform != null) {
				var bounds = openfl_geom_Rectangle.__pool.get();
				var boundsMatrix = openfl_geom_Matrix.__pool.get();
				source.__getBounds(bounds,boundsMatrix);
				var width = Math.ceil(bounds.width);
				var height = Math.ceil(bounds.height);
				boundsMatrix.tx = -bounds.x;
				boundsMatrix.ty = -bounds.y;
				var copy = new openfl_display_BitmapData(width,height,true,0);
				copy.draw(source,boundsMatrix);
				copy.colorTransform(copy.rect,colorTransform);
				copy.__renderTransform.identity();
				copy.__renderTransform.tx = bounds.x;
				copy.__renderTransform.ty = bounds.y;
				copy.__renderTransform.concat(source.__renderTransform);
				copy.__worldAlpha = source.__worldAlpha;
				copy.__worldColorTransform.__copyFrom(source.__worldColorTransform);
				source = copy;
				openfl_geom_Rectangle.__pool.release(bounds);
				openfl_geom_Matrix.__pool.release(boundsMatrix);
			}
			lime__$internal_graphics_ImageCanvasUtil.convertToCanvas(this.image);
			var renderer = new openfl_display_CanvasRenderer(this.image.buffer.__srcContext);
			renderer.__allowSmoothing = smoothing;
			renderer.__overrideBlendMode = blendMode;
			renderer.__worldTransform = transform;
			renderer.__worldAlpha = 1 / source.__worldAlpha;
			renderer.__worldColorTransform = _colorTransform;
			if(clipRect != null) {
				renderer.__pushMaskRect(clipRect,clipMatrix);
			}
			this.__drawCanvas(source,renderer);
			if(clipRect != null) {
				renderer.__popMaskRect();
				openfl_geom_Matrix.__pool.release(clipMatrix);
			}
		}
		openfl_geom_Matrix.__pool.release(transform);
		if(sourceAsDisplayObject != null && !wasVisible) {
			sourceAsDisplayObject.set_visible(false);
		}
	}
	,drawWithQuality: function(source,matrix,colorTransform,blendMode,clipRect,smoothing,quality) {
		if(smoothing == null) {
			smoothing = false;
		}
		this.draw(source,matrix,colorTransform,blendMode,clipRect,quality != 2 && smoothing);
	}
	,encode: function(rect,compressor,byteArray) {
		if(!this.readable || rect == null) {
			byteArray = null;
			return byteArray;
		}
		if(byteArray == null) {
			byteArray = new openfl_utils_ByteArrayData(0);
		}
		var image = this.image;
		if(!rect.equals(this.rect)) {
			var matrix = openfl_geom_Matrix.__pool.get();
			matrix.tx = Math.round(-rect.x);
			matrix.ty = Math.round(-rect.y);
			var bitmapData = new openfl_display_BitmapData(Math.ceil(rect.width),Math.ceil(rect.height),true,0);
			bitmapData.draw(this,matrix);
			image = bitmapData.image;
			openfl_geom_Matrix.__pool.release(matrix);
		}
		if(((compressor) instanceof openfl_display_PNGEncoderOptions)) {
			byteArray.writeBytes(openfl_utils_ByteArray.fromBytes(image.encode(lime_graphics_ImageFileFormat.PNG)),0,0);
			return byteArray;
		} else if(((compressor) instanceof openfl_display_JPEGEncoderOptions)) {
			byteArray.writeBytes(openfl_utils_ByteArray.fromBytes(image.encode(lime_graphics_ImageFileFormat.JPEG,(js_Boot.__cast(compressor , openfl_display_JPEGEncoderOptions)).quality)),0,0);
			return byteArray;
		}
		byteArray = null;
		return byteArray;
	}
	,fillRect: function(rect,color) {
		this.__fillRect(rect,color,true);
	}
	,floodFill: function(x,y,color) {
		if(!this.readable) {
			return;
		}
		this.image.floodFill(x,y,color,1);
	}
	,generateFilterRect: function(sourceRect,filter) {
		return sourceRect.clone();
	}
	,getIndexBuffer: function(context,scale9Grid) {
		var gl = context.gl;
		if(this.__indexBuffer == null || this.__indexBufferContext != context.__context || scale9Grid != null && this.__indexBufferGrid == null || this.__indexBufferGrid != null && !this.__indexBufferGrid.equals(scale9Grid)) {
			this.__indexBufferContext = context.__context;
			this.__indexBuffer = null;
			if(scale9Grid != null) {
				if(this.__indexBufferGrid == null) {
					this.__indexBufferGrid = new openfl_geom_Rectangle();
				}
				this.__indexBufferGrid.copyFrom(scale9Grid);
				var centerX = scale9Grid.width;
				var centerY = scale9Grid.height;
				if(centerX != 0 && centerY != 0) {
					var array = null;
					var vector = null;
					var view = null;
					var buffer = null;
					var len = null;
					this.__indexBufferData = new Uint16Array(54);
					this.__indexBufferData[0] = 0;
					this.__indexBufferData[1] = 1;
					this.__indexBufferData[2] = 2;
					this.__indexBufferData[3] = 2;
					this.__indexBufferData[4] = 1;
					this.__indexBufferData[5] = 3;
					this.__indexBufferData[6] = 4;
					this.__indexBufferData[7] = 0;
					this.__indexBufferData[8] = 5;
					this.__indexBufferData[9] = 5;
					this.__indexBufferData[10] = 0;
					this.__indexBufferData[11] = 2;
					this.__indexBufferData[12] = 6;
					this.__indexBufferData[13] = 4;
					this.__indexBufferData[14] = 7;
					this.__indexBufferData[15] = 7;
					this.__indexBufferData[16] = 4;
					this.__indexBufferData[17] = 5;
					this.__indexBufferData[18] = 8;
					this.__indexBufferData[19] = 9;
					this.__indexBufferData[20] = 0;
					this.__indexBufferData[21] = 0;
					this.__indexBufferData[22] = 9;
					this.__indexBufferData[23] = 1;
					this.__indexBufferData[24] = 10;
					this.__indexBufferData[25] = 8;
					this.__indexBufferData[26] = 4;
					this.__indexBufferData[27] = 4;
					this.__indexBufferData[28] = 8;
					this.__indexBufferData[29] = 0;
					this.__indexBufferData[30] = 11;
					this.__indexBufferData[31] = 10;
					this.__indexBufferData[32] = 6;
					this.__indexBufferData[33] = 6;
					this.__indexBufferData[34] = 10;
					this.__indexBufferData[35] = 4;
					this.__indexBufferData[36] = 12;
					this.__indexBufferData[37] = 13;
					this.__indexBufferData[38] = 8;
					this.__indexBufferData[39] = 8;
					this.__indexBufferData[40] = 13;
					this.__indexBufferData[41] = 9;
					this.__indexBufferData[42] = 14;
					this.__indexBufferData[43] = 12;
					this.__indexBufferData[44] = 10;
					this.__indexBufferData[45] = 10;
					this.__indexBufferData[46] = 12;
					this.__indexBufferData[47] = 8;
					this.__indexBufferData[48] = 15;
					this.__indexBufferData[49] = 14;
					this.__indexBufferData[50] = 11;
					this.__indexBufferData[51] = 11;
					this.__indexBufferData[52] = 14;
					this.__indexBufferData[53] = 10;
					this.__indexBuffer = context.createIndexBuffer(54);
				} else if(centerX == 0 && centerY != 0) {
					var array = null;
					var vector = null;
					var view = null;
					var buffer = null;
					var len = null;
					this.__indexBufferData = new Uint16Array(18);
					this.__indexBufferData[0] = 0;
					this.__indexBufferData[1] = 1;
					this.__indexBufferData[2] = 2;
					this.__indexBufferData[3] = 2;
					this.__indexBufferData[4] = 1;
					this.__indexBufferData[5] = 3;
					this.__indexBufferData[6] = 4;
					this.__indexBufferData[7] = 5;
					this.__indexBufferData[8] = 0;
					this.__indexBufferData[9] = 0;
					this.__indexBufferData[10] = 5;
					this.__indexBufferData[11] = 1;
					this.__indexBufferData[12] = 6;
					this.__indexBufferData[13] = 7;
					this.__indexBufferData[14] = 4;
					this.__indexBufferData[15] = 4;
					this.__indexBufferData[16] = 7;
					this.__indexBufferData[17] = 5;
					this.__indexBuffer = context.createIndexBuffer(18);
				} else if(centerX != 0 && centerY == 0) {
					var array = null;
					var vector = null;
					var view = null;
					var buffer = null;
					var len = null;
					this.__indexBufferData = new Uint16Array(18);
					this.__indexBufferData[0] = 0;
					this.__indexBufferData[1] = 1;
					this.__indexBufferData[2] = 2;
					this.__indexBufferData[3] = 2;
					this.__indexBufferData[4] = 1;
					this.__indexBufferData[5] = 3;
					this.__indexBufferData[6] = 4;
					this.__indexBufferData[7] = 0;
					this.__indexBufferData[8] = 5;
					this.__indexBufferData[9] = 5;
					this.__indexBufferData[10] = 0;
					this.__indexBufferData[11] = 2;
					this.__indexBufferData[12] = 6;
					this.__indexBufferData[13] = 4;
					this.__indexBufferData[14] = 7;
					this.__indexBufferData[15] = 7;
					this.__indexBufferData[16] = 4;
					this.__indexBufferData[17] = 5;
					this.__indexBuffer = context.createIndexBuffer(18);
				}
			} else {
				this.__indexBufferGrid = null;
			}
			if(this.__indexBuffer == null) {
				var array = null;
				var vector = null;
				var view = null;
				var buffer = null;
				var len = null;
				this.__indexBufferData = new Uint16Array(6);
				this.__indexBufferData[0] = 0;
				this.__indexBufferData[1] = 1;
				this.__indexBufferData[2] = 2;
				this.__indexBufferData[3] = 2;
				this.__indexBufferData[4] = 1;
				this.__indexBufferData[5] = 3;
				this.__indexBuffer = context.createIndexBuffer(6);
			}
			this.__indexBuffer.uploadFromTypedArray(this.__indexBufferData);
		}
		return this.__indexBuffer;
	}
	,getVertexBuffer: function(context,scale9Grid,targetObject) {
		var gl = context.gl;
		if(this.__vertexBuffer == null || this.__vertexBufferContext != context.__context || scale9Grid != null && this.__vertexBufferGrid == null || this.__vertexBufferGrid != null && !this.__vertexBufferGrid.equals(scale9Grid) || targetObject != null && (this.__vertexBufferWidth != targetObject.get_width() || this.__vertexBufferHeight != targetObject.get_height() || this.__vertexBufferScaleX != targetObject.get_scaleX() || this.__vertexBufferScaleY != targetObject.get_scaleY())) {
			this.__uvRect = new openfl_geom_Rectangle(0,0,this.width,this.height);
			var uvWidth = 1;
			var uvHeight = 1;
			this.__vertexBufferContext = context.__context;
			this.__vertexBuffer = null;
			if(targetObject != null) {
				this.__vertexBufferWidth = targetObject.get_width();
				this.__vertexBufferHeight = targetObject.get_height();
				this.__vertexBufferScaleX = targetObject.get_scaleX();
				this.__vertexBufferScaleY = targetObject.get_scaleY();
			}
			if(scale9Grid != null && targetObject != null) {
				if(this.__vertexBufferGrid == null) {
					this.__vertexBufferGrid = new openfl_geom_Rectangle();
				}
				this.__vertexBufferGrid.copyFrom(scale9Grid);
				this.__vertexBufferWidth = targetObject.get_width();
				this.__vertexBufferHeight = targetObject.get_height();
				this.__vertexBufferScaleX = targetObject.get_scaleX();
				this.__vertexBufferScaleY = targetObject.get_scaleY();
				var centerX = scale9Grid.width;
				var centerY = scale9Grid.height;
				if(centerX != 0 && centerY != 0) {
					var array = null;
					var vector = null;
					var view = null;
					var buffer = null;
					var len = null;
					this.__vertexBufferData = new Float32Array(224);
					var left = scale9Grid.x;
					var top = scale9Grid.y;
					var right = this.width - centerX - left;
					var bottom = this.height - centerY - top;
					var uvLeft = left / this.width;
					var uvTop = top / this.height;
					var uvCenterX = centerX / this.width;
					var uvCenterY = centerY / this.height;
					var uvRight = right / this.width;
					var uvBottom = bottom / this.height;
					var renderedLeft = left / targetObject.get_scaleX();
					var renderedTop = top / targetObject.get_scaleY();
					var renderedRight = right / targetObject.get_scaleX();
					var renderedBottom = bottom / targetObject.get_scaleY();
					var renderedCenterX = targetObject.get_width() / targetObject.get_scaleX() - renderedLeft - renderedRight;
					var renderedCenterY = targetObject.get_height() / targetObject.get_scaleY() - renderedTop - renderedBottom;
					this.__vertexBufferData[0] = renderedLeft;
					this.__vertexBufferData[1] = renderedTop;
					this.__vertexBufferData[3] = uvWidth * uvLeft;
					this.__vertexBufferData[4] = uvHeight * uvTop;
					this.__vertexBufferData[15] = renderedTop;
					this.__vertexBufferData[18] = uvHeight * uvTop;
					this.__vertexBufferData[28] = renderedLeft;
					this.__vertexBufferData[31] = uvWidth * uvLeft;
					this.__vertexBufferData[56] = renderedLeft + renderedCenterX;
					this.__vertexBufferData[57] = renderedTop;
					this.__vertexBufferData[59] = uvWidth * (uvLeft + uvCenterX);
					this.__vertexBufferData[60] = uvHeight * uvTop;
					this.__vertexBufferData[70] = renderedLeft + renderedCenterX;
					this.__vertexBufferData[73] = uvWidth * (uvLeft + uvCenterX);
					this.__vertexBufferData[84] = this.width;
					this.__vertexBufferData[85] = renderedTop;
					this.__vertexBufferData[87] = uvWidth;
					this.__vertexBufferData[88] = uvHeight * uvTop;
					this.__vertexBufferData[98] = this.width;
					this.__vertexBufferData[101] = uvWidth;
					this.__vertexBufferData[112] = renderedLeft;
					this.__vertexBufferData[113] = renderedTop + renderedCenterY;
					this.__vertexBufferData[115] = uvWidth * uvLeft;
					this.__vertexBufferData[116] = uvHeight * (uvTop + uvCenterY);
					this.__vertexBufferData[127] = renderedTop + renderedCenterY;
					this.__vertexBufferData[130] = uvHeight * (uvTop + uvCenterY);
					this.__vertexBufferData[140] = renderedLeft + renderedCenterX;
					this.__vertexBufferData[141] = renderedTop + renderedCenterY;
					this.__vertexBufferData[143] = uvWidth * (uvLeft + uvCenterX);
					this.__vertexBufferData[144] = uvHeight * (uvTop + uvCenterY);
					this.__vertexBufferData[154] = this.width;
					this.__vertexBufferData[155] = renderedTop + renderedCenterY;
					this.__vertexBufferData[157] = uvWidth;
					this.__vertexBufferData[158] = uvHeight * (uvTop + uvCenterY);
					this.__vertexBufferData[168] = renderedLeft;
					this.__vertexBufferData[169] = this.height;
					this.__vertexBufferData[171] = uvWidth * uvLeft;
					this.__vertexBufferData[172] = uvHeight;
					this.__vertexBufferData[183] = this.height;
					this.__vertexBufferData[186] = uvHeight;
					this.__vertexBufferData[196] = renderedLeft + renderedCenterX;
					this.__vertexBufferData[197] = this.height;
					this.__vertexBufferData[199] = uvWidth * (uvLeft + uvCenterX);
					this.__vertexBufferData[200] = uvHeight;
					this.__vertexBufferData[210] = this.width;
					this.__vertexBufferData[211] = this.height;
					this.__vertexBufferData[213] = uvWidth;
					this.__vertexBufferData[214] = uvHeight;
					this.__vertexBuffer = context.createVertexBuffer(16,14);
				} else if(centerX == 0 && centerY != 0) {
					var array = null;
					var vector = null;
					var view = null;
					var buffer = null;
					var len = null;
					this.__vertexBufferData = new Float32Array(112);
					var top = scale9Grid.y;
					var bottom = this.height - centerY - top;
					var uvTop = top / this.height;
					var uvCenterY = centerY / this.height;
					var uvBottom = bottom / this.height;
					var renderedTop = top / targetObject.get_scaleY();
					var renderedBottom = bottom / targetObject.get_scaleY();
					var renderedCenterY = targetObject.get_height() / targetObject.get_scaleY() - renderedTop - renderedBottom;
					var renderedWidth = targetObject.get_width() / targetObject.get_scaleX();
					this.__vertexBufferData[0] = renderedWidth;
					this.__vertexBufferData[1] = renderedTop;
					this.__vertexBufferData[3] = uvWidth;
					this.__vertexBufferData[4] = uvHeight * uvTop;
					this.__vertexBufferData[15] = renderedTop;
					this.__vertexBufferData[18] = uvHeight * uvTop;
					this.__vertexBufferData[28] = renderedWidth;
					this.__vertexBufferData[31] = uvWidth;
					this.__vertexBufferData[56] = renderedWidth;
					this.__vertexBufferData[57] = renderedTop + renderedCenterY;
					this.__vertexBufferData[59] = uvWidth;
					this.__vertexBufferData[60] = uvHeight * (uvTop + uvCenterY);
					this.__vertexBufferData[71] = renderedTop + renderedCenterY;
					this.__vertexBufferData[74] = uvHeight * (uvTop + uvCenterY);
					this.__vertexBufferData[84] = renderedWidth;
					this.__vertexBufferData[85] = this.height;
					this.__vertexBufferData[87] = uvWidth;
					this.__vertexBufferData[88] = uvHeight;
					this.__vertexBufferData[99] = this.height;
					this.__vertexBufferData[102] = uvHeight;
					this.__vertexBuffer = context.createVertexBuffer(8,14);
				} else if(centerY == 0 && centerX != 0) {
					var array = null;
					var vector = null;
					var view = null;
					var buffer = null;
					var len = null;
					this.__vertexBufferData = new Float32Array(112);
					var left = scale9Grid.x;
					var right = this.width - centerX - left;
					var uvLeft = left / this.width;
					var uvCenterX = centerX / this.width;
					var uvRight = right / this.width;
					var renderedLeft = left / targetObject.get_scaleX();
					var renderedRight = right / targetObject.get_scaleX();
					var renderedCenterX = targetObject.get_width() / targetObject.get_scaleX() - renderedLeft - renderedRight;
					var renderedHeight = targetObject.get_height() / targetObject.get_scaleY();
					this.__vertexBufferData[0] = renderedLeft;
					this.__vertexBufferData[1] = renderedHeight;
					this.__vertexBufferData[3] = uvWidth * uvLeft;
					this.__vertexBufferData[4] = uvHeight;
					this.__vertexBufferData[15] = renderedHeight;
					this.__vertexBufferData[18] = uvHeight;
					this.__vertexBufferData[28] = renderedLeft;
					this.__vertexBufferData[31] = uvWidth * uvLeft;
					this.__vertexBufferData[56] = renderedLeft + renderedCenterX;
					this.__vertexBufferData[57] = renderedHeight;
					this.__vertexBufferData[59] = uvWidth * (uvLeft + uvCenterX);
					this.__vertexBufferData[60] = uvHeight;
					this.__vertexBufferData[70] = renderedLeft + renderedCenterX;
					this.__vertexBufferData[73] = uvWidth * (uvLeft + uvCenterX);
					this.__vertexBufferData[84] = this.width;
					this.__vertexBufferData[85] = renderedHeight;
					this.__vertexBufferData[87] = uvWidth;
					this.__vertexBufferData[88] = uvHeight;
					this.__vertexBufferData[98] = this.width;
					this.__vertexBufferData[101] = uvWidth;
					this.__vertexBuffer = context.createVertexBuffer(8,14);
				}
			} else {
				this.__vertexBufferGrid = null;
			}
			if(this.__vertexBuffer == null) {
				var array = null;
				var vector = null;
				var view = null;
				var buffer = null;
				var len = null;
				this.__vertexBufferData = new Float32Array(56);
				this.__vertexBufferData[0] = this.width;
				this.__vertexBufferData[1] = this.height;
				this.__vertexBufferData[3] = uvWidth;
				this.__vertexBufferData[4] = uvHeight;
				this.__vertexBufferData[15] = this.height;
				this.__vertexBufferData[18] = uvHeight;
				this.__vertexBufferData[28] = this.width;
				this.__vertexBufferData[31] = uvWidth;
				this.__vertexBuffer = context.createVertexBuffer(3,14);
			}
			this.__vertexBuffer.uploadFromTypedArray(lime_utils_Float32Array.toArrayBufferView(this.__vertexBufferData));
		}
		return this.__vertexBuffer;
	}
	,getColorBoundsRect: function(mask,color,findColor) {
		if(findColor == null) {
			findColor = true;
		}
		if(!this.readable) {
			return new openfl_geom_Rectangle(0,0,this.width,this.height);
		}
		if(!this.transparent || (mask >> 24 & 255) > 0) {
			var color1 = color;
			if((color1 >>> 24 & 255) == 0) {
				color1 = 0;
			}
		}
		var rect = this.image.getColorBoundsRect(mask,color,findColor,1);
		return new openfl_geom_Rectangle(rect.x,rect.y,rect.width,rect.height);
	}
	,getPixel: function(x,y) {
		if(!this.readable) {
			return 0;
		}
		return this.image.getPixel(x,y,1);
	}
	,getPixel32: function(x,y) {
		if(!this.readable) {
			return 0;
		}
		return this.image.getPixel32(x,y,1);
	}
	,getPixels: function(rect) {
		if(!this.readable) {
			return null;
		}
		if(rect == null) {
			rect = this.rect;
		}
		var byteArray = openfl_utils_ByteArray.fromBytes(this.image.getPixels(rect.__toLimeRectangle(),1));
		byteArray.__endian = 0;
		return byteArray;
	}
	,getSurface: function() {
		if(!this.readable) {
			return null;
		}
		if(this.__surface == null) {
			this.__surface = lime_graphics_cairo_CairoImageSurface.fromImage(this.image);
		}
		return this.__surface;
	}
	,getTexture: function(context) {
		if(!this.__isValid) {
			return null;
		}
		if(this.__texture == null || this.__textureContext != context.__context) {
			this.__textureContext = context.__context;
			this.__texture = context.createRectangleTexture(this.width,this.height,1,false);
			this.__textureVersion = -1;
		}
		lime__$internal_graphics_ImageCanvasUtil.sync(this.image,false);
		if(this.image != null && this.image.version > this.__textureVersion) {
			if(this.__surface != null) {
				lime_graphics_cairo_CairoSurface.flush(this.__surface);
			}
			var textureImage = this.image;
			if(!openfl_display3D_textures_TextureBase.__supportsBGRA && textureImage.get_format() != 0) {
				textureImage = textureImage.clone();
				textureImage.set_format(0);
			}
			this.__texture.__uploadFromImage(textureImage);
			this.__textureVersion = this.image.version;
			this.__textureWidth = textureImage.buffer.width;
			this.__textureHeight = textureImage.buffer.height;
		}
		if(!this.readable && this.image != null) {
			this.__surface = null;
			this.image = null;
		}
		return this.__texture;
	}
	,getVector: function(rect) {
		var pixels = this.getPixels(rect);
		var length = UInt.toFloat(openfl_utils_ByteArray.get_length(pixels)) / UInt.toFloat(4) | 0;
		var result = openfl_Vector.toIntVector(null,length,true);
		var _g = 0;
		var _g1 = length;
		while(_g < _g1) {
			var i = _g++;
			result.set(i,pixels.readUnsignedInt());
		}
		return result;
	}
	,histogram: function(hRect) {
		var rect = hRect != null ? hRect : new openfl_geom_Rectangle(0,0,this.width,this.height);
		var pixels = this.getPixels(rect);
		var _g = [];
		var _g1 = [];
		var _g2 = 0;
		while(_g2 < 256) {
			var j = _g2++;
			_g1.push(0);
		}
		_g.push(_g1);
		var _g1 = [];
		var _g2 = 0;
		while(_g2 < 256) {
			var j = _g2++;
			_g1.push(0);
		}
		_g.push(_g1);
		var _g1 = [];
		var _g2 = 0;
		while(_g2 < 256) {
			var j = _g2++;
			_g1.push(0);
		}
		_g.push(_g1);
		var _g1 = [];
		var _g2 = 0;
		while(_g2 < 256) {
			var j = _g2++;
			_g1.push(0);
		}
		_g.push(_g1);
		var result = _g;
		var _g = 0;
		var _g1 = openfl_utils_ByteArray.get_length(pixels);
		while(_g < _g1) {
			var i = _g++;
			var result1 = result[i % 4];
			++result1[pixels.readUnsignedByte()];
		}
		return result;
	}
	,hitTest: function(firstPoint,firstAlphaThreshold,secondObject,secondBitmapDataPoint,secondAlphaThreshold) {
		if(secondAlphaThreshold == null) {
			secondAlphaThreshold = 1;
		}
		if(!this.readable) {
			return false;
		}
		if(((secondObject) instanceof openfl_display_Bitmap)) {
			secondObject = (js_Boot.__cast(secondObject , openfl_display_Bitmap)).__bitmapData;
		}
		if(((secondObject) instanceof openfl_geom_Point)) {
			var secondPoint = secondObject;
			var x = secondPoint.x - firstPoint.x | 0;
			var y = secondPoint.y - firstPoint.y | 0;
			if(this.rect.contains(x,y)) {
				var pixel = this.getPixel32(x,y);
				if((pixel >> 24 & 255) > firstAlphaThreshold) {
					return true;
				}
			}
		} else if(((secondObject) instanceof openfl_display_BitmapData)) {
			var secondBitmapData = secondObject;
			var x;
			var y;
			if(secondBitmapDataPoint == null) {
				x = 0;
				y = 0;
			} else {
				x = Math.round(secondBitmapDataPoint.x - firstPoint.x);
				y = Math.round(secondBitmapDataPoint.y - firstPoint.y);
			}
			var hitRect = openfl_geom_Rectangle.__pool.get();
			hitRect.setTo(x,y,secondBitmapData.width,secondBitmapData.height);
			if(this.rect.intersects(hitRect)) {
				if(x < 0) {
					hitRect.x = 0;
					hitRect.width = Math.min(secondBitmapData.width + x,this.width);
				} else {
					hitRect.width = Math.min(secondBitmapData.width,this.width - x);
				}
				if(y < 0) {
					hitRect.y = 0;
					hitRect.height = Math.min(secondBitmapData.height + y,this.height);
				} else {
					hitRect.height = Math.min(secondBitmapData.height,this.height - y);
				}
				var pixels = this.getPixels(hitRect);
				hitRect.x = x < 0 ? -x : 0;
				hitRect.y = y < 0 ? -y : 0;
				var testPixels = secondBitmapData.getPixels(hitRect);
				var length = hitRect.width * hitRect.height | 0;
				var pixel;
				var testPixel;
				var _g = 0;
				var _g1 = length;
				while(_g < _g1) {
					var i = _g++;
					pixel = pixels.readUnsignedInt();
					testPixel = testPixels.readUnsignedInt();
					if(UInt.gt(pixel >>> 24 & 255,firstAlphaThreshold) && UInt.gt(testPixel >>> 24 & 255,secondAlphaThreshold)) {
						openfl_geom_Rectangle.__pool.release(hitRect);
						return true;
					}
				}
			}
			openfl_geom_Rectangle.__pool.release(hitRect);
		} else if(((secondObject) instanceof openfl_geom_Rectangle)) {
			var secondRectangle = openfl_geom_Rectangle.__pool.get();
			secondRectangle.copyFrom(secondObject);
			secondRectangle.offset(-firstPoint.x,-firstPoint.y);
			secondRectangle.__contract(0,0,this.width,this.height);
			if(secondRectangle.width > 0 && secondRectangle.height > 0) {
				var pixels = this.getPixels(secondRectangle);
				var length = UInt.toFloat(openfl_utils_ByteArray.get_length(pixels)) / UInt.toFloat(4) | 0;
				var pixel;
				var _g = 0;
				var _g1 = length;
				while(_g < _g1) {
					var i = _g++;
					pixel = pixels.readUnsignedInt();
					if(UInt.gt(pixel >>> 24 & 255,firstAlphaThreshold)) {
						openfl_geom_Rectangle.__pool.release(secondRectangle);
						return true;
					}
				}
			}
			openfl_geom_Rectangle.__pool.release(secondRectangle);
		}
		return false;
	}
	,lock: function() {
	}
	,merge: function(sourceBitmapData,sourceRect,destPoint,redMultiplier,greenMultiplier,blueMultiplier,alphaMultiplier) {
		if(!this.readable || sourceBitmapData == null || !sourceBitmapData.readable || sourceRect == null || destPoint == null) {
			return;
		}
		this.image.merge(sourceBitmapData.image,sourceRect.__toLimeRectangle(),destPoint.__toLimeVector2(),redMultiplier,greenMultiplier,blueMultiplier,alphaMultiplier);
	}
	,noise: function(randomSeed,low,high,channelOptions,grayScale) {
		if(grayScale == null) {
			grayScale = false;
		}
		if(channelOptions == null) {
			channelOptions = 7;
		}
		if(high == null) {
			high = 255;
		}
		if(low == null) {
			low = 0;
		}
		if(!this.readable) {
			return;
		}
		var func = function() {
			randomSeed = randomSeed * 1103515245 + 12345;
			return (Math.abs(randomSeed / 65536) | 0) % 32768;
		};
		var rand = func;
		rand();
		var range = high - low;
		var redChannel = (channelOptions & 1) == 1;
		var greenChannel = (channelOptions & 2) >> 1 == 1;
		var blueChannel = (channelOptions & 4) >> 2 == 1;
		var alphaChannel = (channelOptions & 8) >> 3 == 1;
		var _g = 0;
		var _g1 = this.height;
		while(_g < _g1) {
			var y = _g++;
			var _g2 = 0;
			var _g3 = this.width;
			while(_g2 < _g3) {
				var x = _g2++;
				var red = 0;
				var blue = 0;
				var green = 0;
				var alpha = 255;
				if(grayScale) {
					blue = low + rand() % range;
					green = blue;
					red = green;
					alpha = 255;
				} else {
					if(redChannel) {
						red = low + rand() % range;
					}
					if(greenChannel) {
						green = low + rand() % range;
					}
					if(blueChannel) {
						blue = low + rand() % range;
					}
					if(alphaChannel) {
						alpha = low + rand() % range;
					}
				}
				var rgb = alpha;
				rgb = (rgb << 8) + red;
				rgb = (rgb << 8) + green;
				rgb = (rgb << 8) + blue;
				this.setPixel32(x,y,rgb);
			}
		}
	}
	,paletteMap: function(sourceBitmapData,sourceRect,destPoint,redArray,greenArray,blueArray,alphaArray) {
		var sw = sourceRect.width | 0;
		var sh = sourceRect.height | 0;
		var pixels = sourceBitmapData.getPixels(sourceRect);
		var pixelValue;
		var r;
		var g;
		var b;
		var a;
		var color;
		var _g = 0;
		var _g1 = sh * sw;
		while(_g < _g1) {
			var i = _g++;
			pixelValue = pixels.readUnsignedInt();
			a = alphaArray == null ? pixelValue & -16777216 : alphaArray[pixelValue >> 24 & 255];
			r = redArray == null ? pixelValue & 16711680 : redArray[pixelValue >> 16 & 255];
			g = greenArray == null ? pixelValue & 65280 : greenArray[pixelValue >> 8 & 255];
			b = blueArray == null ? pixelValue & 255 : blueArray[pixelValue & 255];
			color = a + r + g + b;
			pixels.position = i * 4;
			pixels.writeUnsignedInt(color);
		}
		pixels.position = 0;
		var destRect = openfl_geom_Rectangle.__pool.get();
		destRect.setTo(destPoint.x,destPoint.y,sw,sh);
		this.setPixels(destRect,pixels);
		openfl_geom_Rectangle.__pool.release(destRect);
	}
	,perlinNoise: function(baseX,baseY,numOctaves,randomSeed,stitch,fractalNoise,channelOptions,grayScale,offsets) {
		if(grayScale == null) {
			grayScale = false;
		}
		if(channelOptions == null) {
			channelOptions = 7;
		}
		if(!this.readable) {
			return;
		}
		var noise = new openfl_display__$internal_PerlinNoise(randomSeed,numOctaves,channelOptions,grayScale,0.5,stitch,0.15);
		noise.fill(this,baseX,baseY,0);
	}
	,scroll: function(x,y) {
		if(!this.readable) {
			return;
		}
		this.image.scroll(x,y);
	}
	,setPixel: function(x,y,color) {
		if(!this.readable) {
			return;
		}
		this.image.setPixel(x,y,color,1);
	}
	,setPixel32: function(x,y,color) {
		if(!this.readable) {
			return;
		}
		this.image.setPixel32(x,y,color,1);
	}
	,setPixels: function(rect,byteArray) {
		if(!this.readable || rect == null) {
			return;
		}
		var length = rect.width * rect.height * 4;
		if(UInt.toFloat(byteArray.length - byteArray.position) < length) {
			throw new openfl_errors_Error("End of file was encountered.",2030);
		}
		this.image.setPixels(rect.__toLimeRectangle(),openfl_utils_ByteArray.toBytePointer(byteArray),1,openfl_utils_Endian.toLimeEndian(byteArray.__endian));
	}
	,setVector: function(rect,inputVector) {
		var byteArray = new openfl_utils_ByteArrayData(0);
		openfl_utils_ByteArray.set_length(byteArray,inputVector.get_length() * 4);
		var color = inputVector.iterator();
		while(color.hasNext()) {
			var color1 = color.next();
			byteArray.writeUnsignedInt(color1);
		}
		byteArray.position = 0;
		this.setPixels(rect,byteArray);
	}
	,threshold: function(sourceBitmapData,sourceRect,destPoint,operation,threshold,color,mask,copySource) {
		if(copySource == null) {
			copySource = false;
		}
		if(mask == null) {
			mask = -1;
		}
		if(color == null) {
			color = 0;
		}
		if(sourceBitmapData == null || sourceRect == null || destPoint == null || sourceRect.x > sourceBitmapData.width || sourceRect.y > sourceBitmapData.height || destPoint.x > this.width || destPoint.y > this.height) {
			return 0;
		}
		return this.image.threshold(sourceBitmapData.image,sourceRect.__toLimeRectangle(),destPoint.__toLimeVector2(),operation,threshold,color,mask,copySource,1);
	}
	,unlock: function(changeRect) {
	}
	,__applyAlpha: function(alpha) {
		lime__$internal_graphics_ImageCanvasUtil.convertToCanvas(this.image);
		lime__$internal_graphics_ImageCanvasUtil.createImageData(this.image);
		var data = this.image.buffer.data;
		var _g = 0;
		var _g1 = openfl_utils_ByteArray.get_length(alpha);
		while(_g < _g1) {
			var i = _g++;
			data[i * 4 + 3] = alpha.readUnsignedByte();
		}
		this.image.version++;
	}
	,__drawCairo: function(source,renderer) {
	}
	,__drawCanvas: function(source,renderer) {
		var buffer = this.image.buffer;
		if(!renderer.__allowSmoothing) {
			renderer.applySmoothing(buffer.__srcContext,false);
		}
		renderer.__render(source);
		if(!renderer.__allowSmoothing) {
			renderer.applySmoothing(buffer.__srcContext,true);
		}
		buffer.__srcContext.setTransform(1,0,0,1,0,0);
		buffer.__srcImageData = null;
		buffer.data = null;
		this.image.dirty = true;
		this.image.version++;
	}
	,__drawGL: function(source,renderer) {
		var context = renderer.__context3D;
		var cacheRTT = context.__state.renderToTexture;
		var cacheRTTDepthStencil = context.__state.renderToTextureDepthStencil;
		var cacheRTTAntiAlias = context.__state.renderToTextureAntiAlias;
		var cacheRTTSurfaceSelector = context.__state.renderToTextureSurfaceSelector;
		context.setRenderToTexture(this.getTexture(context),true);
		renderer.__render(source);
		if(cacheRTT != null) {
			context.setRenderToTexture(cacheRTT,cacheRTTDepthStencil,cacheRTTAntiAlias,cacheRTTSurfaceSelector);
		} else {
			context.setRenderToBackBuffer();
		}
	}
	,__fillRect: function(rect,color,allowFramebuffer) {
		if(rect == null) {
			return;
		}
		if(this.transparent && (color & -16777216) == 0) {
			color = 0;
		}
		if(allowFramebuffer && this.__texture != null && this.__texture.__glFramebuffer != null && openfl_Lib.get_current().stage.__renderer.__type == "opengl") {
			var renderer = openfl_Lib.get_current().stage.__renderer;
			var context = renderer.__context3D;
			var color1 = color;
			var useScissor = !this.rect.equals(rect);
			var cacheRTT = context.__state.renderToTexture;
			var cacheRTTDepthStencil = context.__state.renderToTextureDepthStencil;
			var cacheRTTAntiAlias = context.__state.renderToTextureAntiAlias;
			var cacheRTTSurfaceSelector = context.__state.renderToTextureSurfaceSelector;
			context.setRenderToTexture(this.__texture);
			if(useScissor) {
				var x = Math.floor(rect.x);
				var y = Math.floor(rect.y);
				var width = rect.width > 0 ? Math.ceil(rect.get_right()) - x : 0;
				var height = rect.height > 0 ? Math.ceil(rect.get_bottom()) - y : 0;
				if(context.__backBufferWantsBestResolution) {
					x = Math.floor(rect.x / context.__stage.window.__scale);
					y = Math.floor(rect.y / context.__stage.window.__scale);
					width = rect.width > 0 ? Math.ceil(rect.get_right() / context.__stage.window.__scale) - x : 0;
					height = rect.height > 0 ? Math.ceil(rect.get_bottom() / context.__stage.window.__scale) - y : 0;
				}
				openfl_display_BitmapData.__fillRectRectangle.setTo(x,y,width,height);
				context.setScissorRectangle(openfl_display_BitmapData.__fillRectRectangle);
			}
			context.__clear(useScissor,(color1 >>> 16 & 255) / 255,(color1 >>> 8 & 255) / 255,(color1 & 255) / 255,this.transparent ? (color1 >>> 24 & 255) / 255 : 1,0,0,1);
			if(useScissor) {
				context.setScissorRectangle(null);
			}
			if(cacheRTT != null) {
				context.setRenderToTexture(cacheRTT,cacheRTTDepthStencil,cacheRTTAntiAlias,cacheRTTSurfaceSelector);
			} else {
				context.setRenderToBackBuffer();
			}
		} else if(this.readable) {
			this.image.fillRect(rect.__toLimeRectangle(),color,1);
		}
	}
	,__fromBase64: function(base64,type) {
		var image = lime_graphics_Image.fromBase64(base64,type);
		this.__fromImage(image);
	}
	,__fromBytes: function(bytes,rawAlpha) {
		var image = lime_graphics_Image.fromBytes(openfl_utils_ByteArray.toBytes(bytes));
		this.__fromImage(image);
		if(rawAlpha != null) {
			this.__applyAlpha(rawAlpha);
		}
	}
	,__fromFile: function(path) {
		var image = lime_graphics_Image.fromFile(path);
		this.__fromImage(image);
	}
	,__fromImage: function(image) {
		if(image != null && image.buffer != null) {
			this.image = image;
			this.width = image.width;
			this.height = image.height;
			this.rect = new openfl_geom_Rectangle(0,0,image.width,image.height);
			this.__textureWidth = this.width;
			this.__textureHeight = this.height;
			this.readable = true;
			this.__isValid = true;
		}
	}
	,__getBounds: function(rect,matrix) {
		var bounds = openfl_geom_Rectangle.__pool.get();
		this.rect.__transform(bounds,matrix);
		rect.__expand(bounds.x,bounds.y,bounds.width,bounds.height);
		openfl_geom_Rectangle.__pool.release(bounds);
	}
	,__loadFromBase64: function(base64,type) {
		var _gthis = this;
		return lime_graphics_Image.loadFromBase64(base64,type).then(function(image) {
			_gthis.__fromImage(image);
			return lime_app_Future.withValue(_gthis);
		});
	}
	,__loadFromBytes: function(bytes,rawAlpha) {
		var _gthis = this;
		return lime_graphics_Image.loadFromBytes(openfl_utils_ByteArray.toBytes(bytes)).then(function(image) {
			_gthis.__fromImage(image);
			if(rawAlpha != null) {
				_gthis.__applyAlpha(rawAlpha);
			}
			return lime_app_Future.withValue(_gthis);
		});
	}
	,__loadFromFile: function(path) {
		var _gthis = this;
		return lime_graphics_Image.loadFromFile(path).then(function(image) {
			_gthis.__fromImage(image);
			return lime_app_Future.withValue(_gthis);
		});
	}
	,__resize: function(width,height) {
		this.width = width;
		this.height = height;
		this.rect.width = width;
		this.rect.height = height;
		this.__textureWidth = width;
		this.__textureHeight = height;
	}
	,__setUVRect: function(context,x,y,width,height) {
		var buffer = this.getVertexBuffer(context);
		if(buffer != null && (width != this.__uvRect.width || height != this.__uvRect.height || x != this.__uvRect.x || y != this.__uvRect.y)) {
			var gl = context.gl;
			if(this.__uvRect == null) {
				this.__uvRect = new openfl_geom_Rectangle();
			}
			this.__uvRect.setTo(x,y,width,height);
			var uvX = this.__textureWidth > 0 ? x / this.__textureWidth : 0;
			var uvY = this.__textureHeight > 0 ? y / this.__textureHeight : 0;
			var uvWidth = this.__textureWidth > 0 ? width / this.__textureWidth : 0;
			var uvHeight = this.__textureHeight > 0 ? height / this.__textureHeight : 0;
			this.__vertexBufferData[0] = width;
			this.__vertexBufferData[1] = height;
			this.__vertexBufferData[3] = uvX + uvWidth;
			this.__vertexBufferData[4] = uvY + uvHeight;
			this.__vertexBufferData[15] = height;
			this.__vertexBufferData[17] = uvX;
			this.__vertexBufferData[18] = uvY + uvHeight;
			this.__vertexBufferData[28] = width;
			this.__vertexBufferData[31] = uvX + uvWidth;
			this.__vertexBufferData[32] = uvY;
			this.__vertexBufferData[45] = uvX;
			this.__vertexBufferData[46] = uvY;
			this.__vertexBuffer.uploadFromTypedArray(lime_utils_Float32Array.toArrayBufferView(this.__vertexBufferData));
		}
	}
	,__sync: function() {
		lime__$internal_graphics_ImageCanvasUtil.sync(this.image,false);
	}
	,__update: function(transformOnly,updateChildren) {
		this.__updateTransforms();
	}
	,__updateTransforms: function(overrideTransform) {
		if(overrideTransform == null) {
			this.__worldTransform.identity();
		} else {
			this.__worldTransform.copyFrom(overrideTransform);
		}
		this.__renderTransform.copyFrom(this.__worldTransform);
	}
	,__class__: openfl_display_BitmapData
};
var openfl_display_BlendMode = {};
openfl_display_BlendMode.fromString = function(value) {
	switch(value) {
	case "add":
		return 0;
	case "alpha":
		return 1;
	case "darken":
		return 2;
	case "difference":
		return 3;
	case "erase":
		return 4;
	case "hardlight":
		return 5;
	case "invert":
		return 6;
	case "layer":
		return 7;
	case "lighten":
		return 8;
	case "multiply":
		return 9;
	case "normal":
		return 10;
	case "overlay":
		return 11;
	case "screen":
		return 12;
	case "shader":
		return 13;
	case "subtract":
		return 14;
	default:
		return null;
	}
};
openfl_display_BlendMode.toString = function(this1) {
	switch(this1) {
	case 0:
		return "add";
	case 1:
		return "alpha";
	case 2:
		return "darken";
	case 3:
		return "difference";
	case 4:
		return "erase";
	case 5:
		return "hardlight";
	case 6:
		return "invert";
	case 7:
		return "layer";
	case 8:
		return "lighten";
	case 9:
		return "multiply";
	case 10:
		return "normal";
	case 11:
		return "overlay";
	case 12:
		return "screen";
	case 13:
		return "shader";
	case 14:
		return "subtract";
	default:
		return null;
	}
};
var openfl_display_DisplayObjectRenderer = function() {
	openfl_events_EventDispatcher.call(this);
	this.__allowSmoothing = true;
	this.__pixelRatio = 1;
	this.__tempColorTransform = new openfl_geom_ColorTransform();
	this.__worldAlpha = 1;
	this.__blendMode = 10;
};
$hxClasses["openfl.display.DisplayObjectRenderer"] = openfl_display_DisplayObjectRenderer;
openfl_display_DisplayObjectRenderer.__name__ = "openfl.display.DisplayObjectRenderer";
openfl_display_DisplayObjectRenderer.__super__ = openfl_events_EventDispatcher;
openfl_display_DisplayObjectRenderer.prototype = $extend(openfl_events_EventDispatcher.prototype,{
	__allowSmoothing: null
	,__blendMode: null
	,__cleared: null
	,__context: null
	,__overrideBlendMode: null
	,__pixelRatio: null
	,__roundPixels: null
	,__stage: null
	,__tempColorTransform: null
	,__transparent: null
	,__type: null
	,__worldAlpha: null
	,__worldColorTransform: null
	,__worldTransform: null
	,__clear: function() {
	}
	,__getAlpha: function(value) {
		return value * this.__worldAlpha;
	}
	,__getColorTransform: function(value) {
		if(this.__worldColorTransform != null) {
			this.__tempColorTransform.__copyFrom(this.__worldColorTransform);
			this.__tempColorTransform.__combine(value);
			return this.__tempColorTransform;
		} else {
			return value;
		}
	}
	,__popMask: function() {
	}
	,__popMaskObject: function(object,handleScrollRect) {
		if(handleScrollRect == null) {
			handleScrollRect = true;
		}
	}
	,__popMaskRect: function() {
	}
	,__pushMask: function(mask) {
	}
	,__pushMaskObject: function(object,handleScrollRect) {
		if(handleScrollRect == null) {
			handleScrollRect = true;
		}
	}
	,__pushMaskRect: function(rect,transform) {
	}
	,__render: function(object) {
	}
	,__renderEvent: function(displayObject) {
		var renderer = this;
		if(displayObject.__customRenderEvent != null && displayObject.__renderable) {
			displayObject.__customRenderEvent.allowSmoothing = renderer.__allowSmoothing;
			displayObject.__customRenderEvent.objectMatrix.copyFrom(displayObject.__renderTransform);
			displayObject.__customRenderEvent.objectColorTransform.__copyFrom(displayObject.__worldColorTransform);
			displayObject.__customRenderEvent.renderer = renderer;
			switch(renderer.__type) {
			case "cairo":
				displayObject.__customRenderEvent.type = "renderCairo";
				break;
			case "canvas":
				displayObject.__customRenderEvent.type = "renderCanvas";
				break;
			case "dom":
				if(displayObject.stage != null && displayObject.__worldVisible) {
					displayObject.__customRenderEvent.type = "renderDOM";
				} else {
					displayObject.__customRenderEvent.type = "clearDOM";
				}
				break;
			case "opengl":
				if(!renderer.__cleared) {
					renderer.__clear();
				}
				var renderer1 = renderer;
				renderer1.setShader(displayObject.__worldShader);
				renderer1.__context3D.__flushGL();
				displayObject.__customRenderEvent.type = "renderOpenGL";
				break;
			default:
				return;
			}
			renderer.__setBlendMode(displayObject.__worldBlendMode);
			renderer.__pushMaskObject(displayObject);
			displayObject.dispatchEvent(displayObject.__customRenderEvent);
			renderer.__popMaskObject(displayObject);
			if(renderer.__type == "opengl") {
				var renderer1 = renderer;
				renderer1.setViewport();
			}
		}
	}
	,__resize: function(width,height) {
	}
	,__setBlendMode: function(value) {
	}
	,__shouldCacheHardware: function(displayObject,value) {
		if(displayObject == null) {
			return null;
		}
		switch(displayObject.__drawableType) {
		case 4:case 5:
			if(value == true) {
				return true;
			}
			value = this.__shouldCacheHardware_DisplayObject(displayObject,value);
			if(value == true) {
				return true;
			}
			if(displayObject.__children != null) {
				var _g = 0;
				var _g1 = displayObject.__children;
				while(_g < _g1.length) {
					var child = _g1[_g];
					++_g;
					value = this.__shouldCacheHardware_DisplayObject(child,value);
					if(value == true) {
						return true;
					}
				}
			}
			return value;
		case 7:
			if(value == true) {
				return true;
			} else {
				return false;
			}
			break;
		case 9:
			return true;
		default:
			return this.__shouldCacheHardware_DisplayObject(displayObject,value);
		}
	}
	,__shouldCacheHardware_DisplayObject: function(displayObject,value) {
		if(value == true || displayObject.__filters != null) {
			return true;
		}
		if(value == false || displayObject.__graphics != null && !openfl_display__$internal_Context3DGraphics.isCompatible(displayObject.__graphics)) {
			return false;
		}
		return null;
	}
	,__updateCacheBitmap: function(displayObject,force) {
		if(displayObject == null) {
			return false;
		}
		var renderer = this;
		switch(displayObject.__drawableType) {
		case 2:
			var bitmap = displayObject;
			if(bitmap.__bitmapData == null || bitmap.__filters == null && renderer.__type == "opengl" && bitmap.__cacheBitmap == null) {
				return false;
			}
			force = bitmap.__bitmapData.image != null && bitmap.__bitmapData.image.version != bitmap.__imageVersion;
			break;
		case 7:
			var textField = displayObject;
			if(textField.__filters == null && renderer.__type == "opengl" && textField.__cacheBitmap == null && !textField.__domRender) {
				return false;
			}
			if(force) {
				textField.__renderDirty = true;
			}
			force = force || textField.__dirty;
			break;
		case 9:
			var tilemap = displayObject;
			if(tilemap.__filters == null && renderer.__type == "opengl" && tilemap.__cacheBitmap == null) {
				return false;
			}
			break;
		default:
		}
		if(displayObject.__isCacheBitmapRender) {
			return false;
		}
		var colorTransform = openfl_geom_ColorTransform.__pool.get();
		colorTransform.__copyFrom(displayObject.__worldColorTransform);
		if(renderer.__worldColorTransform != null) {
			colorTransform.__combine(renderer.__worldColorTransform);
		}
		var updated = false;
		if(displayObject.get_cacheAsBitmap() || renderer.__type != "opengl" && !colorTransform.__isDefault(true)) {
			var rect = null;
			var needRender = displayObject.__cacheBitmap == null || displayObject.__renderDirty && (force || displayObject.__children != null && displayObject.__children.length > 0) || displayObject.opaqueBackground != displayObject.__cacheBitmapBackground;
			var softwareDirty = needRender || displayObject.__graphics != null && displayObject.__graphics.__softwareDirty || !displayObject.__cacheBitmapColorTransform.__equals(colorTransform,true);
			var hardwareDirty = needRender || displayObject.__graphics != null && displayObject.__graphics.__hardwareDirty;
			var renderType = renderer.__type;
			if(softwareDirty || hardwareDirty) {
				if(renderType == "opengl") {
					if(this.__shouldCacheHardware(displayObject,null) == false) {
						renderType = "canvas";
					}
				}
				if(softwareDirty && (renderType == "canvas" || renderType == "cairo")) {
					needRender = true;
				}
				if(hardwareDirty && renderType == "opengl") {
					needRender = true;
				}
			}
			var updateTransform = needRender || !displayObject.__cacheBitmap.__worldTransform.equals(displayObject.__worldTransform);
			var hasFilters = displayObject.__filters != null;
			if(renderer.__type == "dom" && !hasFilters) {
				return false;
			}
			if(hasFilters && !needRender) {
				var affineChanged;
				if(updateTransform) {
					var a = displayObject.__cacheBitmap.__worldTransform;
					var b = displayObject.__worldTransform;
					affineChanged = Math.abs(a.a - b.a) > 1e-4 || Math.abs(a.b - b.b) > 1e-4 || Math.abs(a.c - b.c) > 1e-4 || Math.abs(a.d - b.d) > 1e-4;
				} else {
					affineChanged = false;
				}
				var _g = 0;
				var _g1 = displayObject.__filters;
				while(_g < _g1.length) {
					var filter = _g1[_g];
					++_g;
					if(filter.__renderDirty) {
						needRender = true;
						break;
					}
					if(affineChanged && ((filter) instanceof openfl_filters_ShaderFilter)) {
						displayObject.__cacheBitmapData = null;
						needRender = true;
						break;
					}
				}
			}
			if(displayObject.__cacheBitmapMatrix == null) {
				displayObject.__cacheBitmapMatrix = new openfl_geom_Matrix();
			}
			var bitmapMatrix = displayObject.__cacheAsBitmapMatrix != null ? displayObject.__cacheAsBitmapMatrix : displayObject.__renderTransform;
			if(!needRender && (bitmapMatrix.a != displayObject.__cacheBitmapMatrix.a || bitmapMatrix.b != displayObject.__cacheBitmapMatrix.b || bitmapMatrix.c != displayObject.__cacheBitmapMatrix.c || bitmapMatrix.d != displayObject.__cacheBitmapMatrix.d)) {
				needRender = true;
			}
			if(!needRender && renderer.__type != "opengl" && displayObject.__cacheBitmapData != null && displayObject.__cacheBitmapData.image != null && displayObject.__cacheBitmapData.image.version < displayObject.__cacheBitmapData.__textureVersion) {
				needRender = true;
			}
			if(!needRender) {
				var current = displayObject;
				while(current != null) {
					if(current.get_scrollRect() != null) {
						updateTransform = true;
						break;
					}
					current = current.parent;
				}
			}
			displayObject.__cacheBitmapMatrix.copyFrom(bitmapMatrix);
			displayObject.__cacheBitmapMatrix.tx = 0;
			displayObject.__cacheBitmapMatrix.ty = 0;
			var bitmapWidth = 0;
			var bitmapHeight = 0;
			var filterWidth = 0;
			var filterHeight = 0;
			var offsetX = 0.;
			var offsetY = 0.;
			var pixelRatio = this.__pixelRatio;
			if(updateTransform || needRender) {
				rect = openfl_geom_Rectangle.__pool.get();
				displayObject.__getFilterBounds(rect,displayObject.__cacheBitmapMatrix);
				filterWidth = rect.width > 0 ? Math.ceil((rect.width + 1) * pixelRatio) : 0;
				filterHeight = rect.height > 0 ? Math.ceil((rect.height + 1) * pixelRatio) : 0;
				offsetX = rect.x > 0 ? Math.ceil(rect.x) : Math.floor(rect.x);
				offsetY = rect.y > 0 ? Math.ceil(rect.y) : Math.floor(rect.y);
				if(displayObject.__cacheBitmapData != null) {
					if(filterWidth > displayObject.__cacheBitmapData.width || filterHeight > displayObject.__cacheBitmapData.height) {
						bitmapWidth = Math.ceil(Math.max(filterWidth * 1.25,displayObject.__cacheBitmapData.width));
						bitmapHeight = Math.ceil(Math.max(filterHeight * 1.25,displayObject.__cacheBitmapData.height));
						needRender = true;
					} else {
						bitmapWidth = displayObject.__cacheBitmapData.width;
						bitmapHeight = displayObject.__cacheBitmapData.height;
					}
				} else {
					bitmapWidth = filterWidth;
					bitmapHeight = filterHeight;
				}
			}
			if(needRender) {
				updateTransform = true;
				displayObject.__cacheBitmapBackground = displayObject.opaqueBackground;
				if(filterWidth >= 0.5 && filterHeight >= 0.5) {
					var needsFill = displayObject.opaqueBackground != null && (bitmapWidth != filterWidth || bitmapHeight != filterHeight);
					var fillColor = displayObject.opaqueBackground != null ? -16777216 | displayObject.opaqueBackground : 0;
					var bitmapColor = needsFill ? 0 : fillColor;
					var allowFramebuffer = renderer.__type == "opengl";
					if(displayObject.__cacheBitmapData == null || bitmapWidth > displayObject.__cacheBitmapData.width || bitmapHeight > displayObject.__cacheBitmapData.height) {
						displayObject.__cacheBitmapData = new openfl_display_BitmapData(bitmapWidth,bitmapHeight,true,bitmapColor);
						if(displayObject.__cacheBitmap == null) {
							displayObject.__cacheBitmap = new openfl_display_Bitmap();
						}
						displayObject.__cacheBitmap.__bitmapData = displayObject.__cacheBitmapData;
						displayObject.__cacheBitmapRenderer = null;
					} else {
						displayObject.__cacheBitmapData.__fillRect(displayObject.__cacheBitmapData.rect,bitmapColor,allowFramebuffer);
					}
					if(needsFill) {
						rect.setTo(0,0,filterWidth,filterHeight);
						displayObject.__cacheBitmapData.__fillRect(rect,fillColor,allowFramebuffer);
					}
				} else {
					openfl_geom_ColorTransform.__pool.release(colorTransform);
					displayObject.__cacheBitmap = null;
					displayObject.__cacheBitmapData = null;
					displayObject.__cacheBitmapData2 = null;
					displayObject.__cacheBitmapData3 = null;
					displayObject.__cacheBitmapRenderer = null;
					if(displayObject.__drawableType == 7) {
						var textField = displayObject;
						if(textField.__cacheBitmap != null) {
							textField.__cacheBitmap.__renderTransform.tx -= textField.__offsetX * pixelRatio;
							textField.__cacheBitmap.__renderTransform.ty -= textField.__offsetY * pixelRatio;
						}
					}
					return true;
				}
			} else {
				displayObject.__cacheBitmapData = displayObject.__cacheBitmap.get_bitmapData();
				displayObject.__cacheBitmapData2 = null;
				displayObject.__cacheBitmapData3 = null;
			}
			if(updateTransform || needRender) {
				displayObject.__cacheBitmap.__worldTransform.copyFrom(displayObject.__worldTransform);
				if(bitmapMatrix == displayObject.__renderTransform) {
					displayObject.__cacheBitmap.__renderTransform.identity();
					displayObject.__cacheBitmap.__renderTransform.scale(1 / pixelRatio,1 / pixelRatio);
					displayObject.__cacheBitmap.__renderTransform.tx = displayObject.__renderTransform.tx + offsetX;
					displayObject.__cacheBitmap.__renderTransform.ty = displayObject.__renderTransform.ty + offsetY;
				} else {
					displayObject.__cacheBitmap.__renderTransform.copyFrom(displayObject.__cacheBitmapMatrix);
					displayObject.__cacheBitmap.__renderTransform.invert();
					displayObject.__cacheBitmap.__renderTransform.concat(displayObject.__renderTransform);
					displayObject.__cacheBitmap.__renderTransform.a *= 1 / pixelRatio;
					displayObject.__cacheBitmap.__renderTransform.d *= 1 / pixelRatio;
					displayObject.__cacheBitmap.__renderTransform.tx += offsetX;
					displayObject.__cacheBitmap.__renderTransform.ty += offsetY;
				}
			}
			displayObject.__cacheBitmap.smoothing = renderer.__allowSmoothing;
			displayObject.__cacheBitmap.__renderable = displayObject.__renderable;
			displayObject.__cacheBitmap.__worldAlpha = displayObject.__worldAlpha;
			displayObject.__cacheBitmap.__worldBlendMode = displayObject.__worldBlendMode;
			displayObject.__cacheBitmap.__worldShader = displayObject.__worldShader;
			displayObject.__cacheBitmap.set_clippingLayer(displayObject.__mask);
			if(needRender) {
				if(displayObject.__cacheBitmapRenderer == null || renderType != displayObject.__cacheBitmapRenderer.__type) {
					if(renderType == "opengl") {
						displayObject.__cacheBitmapRenderer = new openfl_display_OpenGLRenderer((js_Boot.__cast(renderer , openfl_display_OpenGLRenderer)).__context3D,displayObject.__cacheBitmapData);
					} else {
						if(displayObject.__cacheBitmapData.image == null) {
							var color = displayObject.opaqueBackground != null ? -16777216 | displayObject.opaqueBackground : 0;
							displayObject.__cacheBitmapData = new openfl_display_BitmapData(bitmapWidth,bitmapHeight,true,color);
							displayObject.__cacheBitmap.__bitmapData = displayObject.__cacheBitmapData;
						}
						lime__$internal_graphics_ImageCanvasUtil.convertToCanvas(displayObject.__cacheBitmapData.image);
						displayObject.__cacheBitmapRenderer = new openfl_display_CanvasRenderer(displayObject.__cacheBitmapData.image.buffer.__srcContext);
					}
					displayObject.__cacheBitmapRenderer.__worldTransform = new openfl_geom_Matrix();
					displayObject.__cacheBitmapRenderer.__worldColorTransform = new openfl_geom_ColorTransform();
				}
				if(displayObject.__cacheBitmapColorTransform == null) {
					displayObject.__cacheBitmapColorTransform = new openfl_geom_ColorTransform();
				}
				displayObject.__cacheBitmapRenderer.__stage = displayObject.stage;
				displayObject.__cacheBitmapRenderer.__allowSmoothing = renderer.__allowSmoothing;
				displayObject.__cacheBitmapRenderer.__setBlendMode(10);
				displayObject.__cacheBitmapRenderer.__worldAlpha = 1 / displayObject.__worldAlpha;
				displayObject.__cacheBitmapRenderer.__worldTransform.copyFrom(displayObject.__renderTransform);
				displayObject.__cacheBitmapRenderer.__worldTransform.invert();
				displayObject.__cacheBitmapRenderer.__worldTransform.concat(displayObject.__cacheBitmapMatrix);
				displayObject.__cacheBitmapRenderer.__worldTransform.tx -= offsetX;
				displayObject.__cacheBitmapRenderer.__worldTransform.ty -= offsetY;
				displayObject.__cacheBitmapRenderer.__worldTransform.scale(pixelRatio,pixelRatio);
				displayObject.__cacheBitmapRenderer.__pixelRatio = pixelRatio;
				displayObject.__cacheBitmapRenderer.__worldColorTransform.__copyFrom(colorTransform);
				displayObject.__cacheBitmapRenderer.__worldColorTransform.__invert();
				displayObject.__isCacheBitmapRender = true;
				if(displayObject.__cacheBitmapRenderer.__type == "opengl") {
					var parentRenderer = renderer;
					var childRenderer = displayObject.__cacheBitmapRenderer;
					var context = childRenderer.__context3D;
					var cacheRTT = context.__state.renderToTexture;
					var cacheRTTDepthStencil = context.__state.renderToTextureDepthStencil;
					var cacheRTTAntiAlias = context.__state.renderToTextureAntiAlias;
					var cacheRTTSurfaceSelector = context.__state.renderToTextureSurfaceSelector;
					var cacheBlendMode = parentRenderer.__blendMode;
					parentRenderer.__suspendClipAndMask();
					childRenderer.__copyShader(parentRenderer);
					displayObject.__cacheBitmapData.__setUVRect(context,0,0,filterWidth,filterHeight);
					childRenderer.__setRenderTarget(displayObject.__cacheBitmapData);
					if(displayObject.__cacheBitmapData.image != null) {
						displayObject.__cacheBitmapData.__textureVersion = displayObject.__cacheBitmapData.image.version + 1;
					}
					displayObject.__cacheBitmapData.__drawGL(displayObject,childRenderer);
					if(hasFilters) {
						var needSecondBitmapData = true;
						var needCopyOfOriginal = false;
						var _g = 0;
						var _g1 = displayObject.__filters;
						while(_g < _g1.length) {
							var filter = _g1[_g];
							++_g;
							if(filter.__preserveObject) {
								needCopyOfOriginal = true;
							}
						}
						var bitmap = displayObject.__cacheBitmapData;
						var bitmap2 = null;
						var bitmap3 = null;
						if(displayObject.__cacheBitmapData2 == null || bitmapWidth > displayObject.__cacheBitmapData2.width || bitmapHeight > displayObject.__cacheBitmapData2.height) {
							displayObject.__cacheBitmapData2 = new openfl_display_BitmapData(bitmapWidth,bitmapHeight,true,0);
						} else {
							displayObject.__cacheBitmapData2.fillRect(displayObject.__cacheBitmapData2.rect,0);
							if(displayObject.__cacheBitmapData2.image != null) {
								displayObject.__cacheBitmapData2.__textureVersion = displayObject.__cacheBitmapData2.image.version + 1;
							}
						}
						displayObject.__cacheBitmapData2.__setUVRect(context,0,0,filterWidth,filterHeight);
						bitmap2 = displayObject.__cacheBitmapData2;
						if(needCopyOfOriginal) {
							if(displayObject.__cacheBitmapData3 == null || bitmapWidth > displayObject.__cacheBitmapData3.width || bitmapHeight > displayObject.__cacheBitmapData3.height) {
								displayObject.__cacheBitmapData3 = new openfl_display_BitmapData(bitmapWidth,bitmapHeight,true,0);
							} else {
								displayObject.__cacheBitmapData3.fillRect(displayObject.__cacheBitmapData3.rect,0);
								if(displayObject.__cacheBitmapData3.image != null) {
									displayObject.__cacheBitmapData3.__textureVersion = displayObject.__cacheBitmapData3.image.version + 1;
								}
							}
							displayObject.__cacheBitmapData3.__setUVRect(context,0,0,filterWidth,filterHeight);
							bitmap3 = displayObject.__cacheBitmapData3;
						}
						childRenderer.__setBlendMode(10);
						childRenderer.__worldAlpha = 1;
						childRenderer.__worldTransform.identity();
						childRenderer.__worldColorTransform.__identity();
						var shader;
						var cacheBitmap;
						var _g = 0;
						var _g1 = displayObject.__filters;
						while(_g < _g1.length) {
							var filter = _g1[_g];
							++_g;
							if(filter.__preserveObject) {
								childRenderer.__setRenderTarget(bitmap3);
								childRenderer.__renderFilterPass(bitmap,childRenderer.__defaultDisplayShader,filter.__smooth);
							}
							var _g2 = 0;
							var _g3 = filter.__numShaderPasses;
							while(_g2 < _g3) {
								var i = _g2++;
								shader = filter.__initShader(childRenderer,i,filter.__preserveObject ? bitmap3 : null);
								childRenderer.__setBlendMode(filter.__shaderBlendMode);
								childRenderer.__setRenderTarget(bitmap2);
								childRenderer.__renderFilterPass(bitmap,shader,filter.__smooth);
								cacheBitmap = bitmap;
								bitmap = bitmap2;
								bitmap2 = cacheBitmap;
							}
							filter.__renderDirty = false;
						}
						displayObject.__cacheBitmap.__bitmapData = bitmap;
					}
					parentRenderer.__blendMode = 10;
					parentRenderer.__setBlendMode(cacheBlendMode);
					parentRenderer.__copyShader(childRenderer);
					if(cacheRTT != null) {
						context.setRenderToTexture(cacheRTT,cacheRTTDepthStencil,cacheRTTAntiAlias,cacheRTTSurfaceSelector);
					} else {
						context.setRenderToBackBuffer();
					}
					parentRenderer.__resumeClipAndMask(childRenderer);
					parentRenderer.setViewport();
					displayObject.__cacheBitmapColorTransform.__copyFrom(colorTransform);
				} else {
					displayObject.__cacheBitmapData.__drawCanvas(displayObject,displayObject.__cacheBitmapRenderer);
					if(hasFilters) {
						var needSecondBitmapData = false;
						var needCopyOfOriginal = false;
						var _g = 0;
						var _g1 = displayObject.__filters;
						while(_g < _g1.length) {
							var filter = _g1[_g];
							++_g;
							if(filter.__needSecondBitmapData) {
								needSecondBitmapData = true;
							}
							if(filter.__preserveObject) {
								needCopyOfOriginal = true;
							}
						}
						var bitmap = displayObject.__cacheBitmapData;
						var bitmap2 = null;
						var bitmap3 = null;
						if(needSecondBitmapData) {
							if(displayObject.__cacheBitmapData2 == null || displayObject.__cacheBitmapData2.image == null || bitmapWidth > displayObject.__cacheBitmapData2.width || bitmapHeight > displayObject.__cacheBitmapData2.height) {
								displayObject.__cacheBitmapData2 = new openfl_display_BitmapData(bitmapWidth,bitmapHeight,true,0);
							} else {
								displayObject.__cacheBitmapData2.fillRect(displayObject.__cacheBitmapData2.rect,0);
							}
							bitmap2 = displayObject.__cacheBitmapData2;
						} else {
							bitmap2 = bitmap;
						}
						if(needCopyOfOriginal) {
							if(displayObject.__cacheBitmapData3 == null || displayObject.__cacheBitmapData3.image == null || bitmapWidth > displayObject.__cacheBitmapData3.width || bitmapHeight > displayObject.__cacheBitmapData3.height) {
								displayObject.__cacheBitmapData3 = new openfl_display_BitmapData(bitmapWidth,bitmapHeight,true,0);
							} else {
								displayObject.__cacheBitmapData3.fillRect(displayObject.__cacheBitmapData3.rect,0);
							}
							bitmap3 = displayObject.__cacheBitmapData3;
						}
						if(displayObject.__tempPoint == null) {
							displayObject.__tempPoint = new openfl_geom_Point();
						}
						var destPoint = displayObject.__tempPoint;
						var cacheBitmap;
						var lastBitmap;
						var _g = 0;
						var _g1 = displayObject.__filters;
						while(_g < _g1.length) {
							var filter = _g1[_g];
							++_g;
							if(filter.__preserveObject) {
								bitmap3.copyPixels(bitmap,bitmap.rect,destPoint);
							}
							lastBitmap = filter.__applyFilter(bitmap2,bitmap,bitmap.rect,destPoint);
							if(filter.__preserveObject) {
								lastBitmap.draw(bitmap3,null,displayObject.__objectTransform != null ? displayObject.__objectTransform.__colorTransform : null);
							}
							filter.__renderDirty = false;
							if(needSecondBitmapData && lastBitmap == bitmap2) {
								cacheBitmap = bitmap;
								bitmap = bitmap2;
								bitmap2 = cacheBitmap;
							}
						}
						if(displayObject.__cacheBitmapData != bitmap) {
							cacheBitmap = displayObject.__cacheBitmapData;
							displayObject.__cacheBitmapData = bitmap;
							displayObject.__cacheBitmapData2 = cacheBitmap;
							displayObject.__cacheBitmap.__bitmapData = displayObject.__cacheBitmapData;
							displayObject.__cacheBitmapRenderer = null;
						}
						displayObject.__cacheBitmap.__imageVersion = displayObject.__cacheBitmapData.__textureVersion;
					}
					displayObject.__cacheBitmapColorTransform.__copyFrom(colorTransform);
					if(!displayObject.__cacheBitmapColorTransform.__isDefault(true)) {
						displayObject.__cacheBitmapColorTransform.alphaMultiplier = 1;
						displayObject.__cacheBitmapData.colorTransform(displayObject.__cacheBitmapData.rect,displayObject.__cacheBitmapColorTransform);
					}
				}
				displayObject.__isCacheBitmapRender = false;
			}
			if(updateTransform || needRender) {
				openfl_geom_Rectangle.__pool.release(rect);
			}
			updated = updateTransform;
		} else if(displayObject.__cacheBitmap != null) {
			if(renderer.__type == "dom") {
				var domRenderer = renderer;
				domRenderer.__renderDrawableClear(displayObject.__cacheBitmap);
			}
			displayObject.__cacheBitmap = null;
			displayObject.__cacheBitmapData = null;
			displayObject.__cacheBitmapData2 = null;
			displayObject.__cacheBitmapData3 = null;
			displayObject.__cacheBitmapColorTransform = null;
			displayObject.__cacheBitmapRenderer = null;
			updated = true;
		}
		openfl_geom_ColorTransform.__pool.release(colorTransform);
		if(updated && displayObject.__drawableType == 7) {
			var textField = displayObject;
			if(textField.__cacheBitmap != null) {
				textField.__cacheBitmap.__renderTransform.tx -= textField.__offsetX;
				textField.__cacheBitmap.__renderTransform.ty -= textField.__offsetY;
			}
		}
		return updated;
	}
	,__affineChanged: function(a,b,eps) {
		if(eps == null) {
			eps = 1e-4;
		}
		if(!(Math.abs(a.a - b.a) > eps || Math.abs(a.b - b.b) > eps || Math.abs(a.c - b.c) > eps)) {
			return Math.abs(a.d - b.d) > eps;
		} else {
			return true;
		}
	}
	,__isShaderFilter: function(f) {
		return ((f) instanceof openfl_filters_ShaderFilter);
	}
	,__class__: openfl_display_DisplayObjectRenderer
});
var openfl_display_CairoRenderer = function(cairo) {
	openfl_display_DisplayObjectRenderer.call(this);
};
$hxClasses["openfl.display.CairoRenderer"] = openfl_display_CairoRenderer;
openfl_display_CairoRenderer.__name__ = "openfl.display.CairoRenderer";
openfl_display_CairoRenderer.__super__ = openfl_display_DisplayObjectRenderer;
openfl_display_CairoRenderer.prototype = $extend(openfl_display_DisplayObjectRenderer.prototype,{
	cairo: null
	,__matrix: null
	,__matrix3: null
	,applyMatrix: function(transform,cairo) {
		if(cairo == null) {
			cairo = this.cairo;
		}
		this.__matrix.copyFrom(transform);
		if(this.cairo == cairo && this.__worldTransform != null) {
			this.__matrix.concat(this.__worldTransform);
		}
		this.__matrix3[0] = this.__matrix.a;
		this.__matrix3[1] = this.__matrix.b;
		this.__matrix3[3] = this.__matrix.c;
		this.__matrix3[4] = this.__matrix.d;
		if(this.__roundPixels) {
			this.__matrix3[6] = Math.round(this.__matrix.tx);
			this.__matrix3[7] = Math.round(this.__matrix.ty);
		} else {
			this.__matrix3[6] = this.__matrix.tx;
			this.__matrix3[7] = this.__matrix.ty;
		}
		cairo.set_matrix(this.__matrix3);
	}
	,__clear: function() {
		if(this.cairo == null) {
			return;
		}
		this.cairo.identityMatrix();
		if(this.__stage != null && this.__stage.__clearBeforeRender) {
			var cacheBlendMode = this.__blendMode;
			this.__setBlendMode(10);
			this.cairo.setSourceRGB(this.__stage.__colorSplit[0],this.__stage.__colorSplit[1],this.__stage.__colorSplit[2]);
			this.cairo.paint();
			this.__setBlendMode(cacheBlendMode);
		}
	}
	,__popMask: function() {
		this.cairo.restore();
	}
	,__popMaskObject: function(object,handleScrollRect) {
		if(handleScrollRect == null) {
			handleScrollRect = true;
		}
		if(!object.__isCacheBitmapRender && object.__mask != null) {
			this.__popMask();
		}
		if(handleScrollRect && object.__scrollRect != null) {
			this.__popMaskRect();
		}
	}
	,__popMaskRect: function() {
		this.cairo.restore();
	}
	,__pushMask: function(mask) {
		this.cairo.save();
		this.applyMatrix(mask.__renderTransform,this.cairo);
		this.cairo.newPath();
		this.__renderDrawableMask(mask);
		this.cairo.clip();
	}
	,__pushMaskObject: function(object,handleScrollRect) {
		if(handleScrollRect == null) {
			handleScrollRect = true;
		}
		if(handleScrollRect && object.__scrollRect != null) {
			this.__pushMaskRect(object.__scrollRect,object.__renderTransform);
		}
		if(!object.__isCacheBitmapRender && object.__mask != null) {
			this.__pushMask(object.__mask);
		}
	}
	,__pushMaskRect: function(rect,transform) {
		this.cairo.save();
		this.applyMatrix(transform,this.cairo);
		this.cairo.newPath();
		this.cairo.rectangle(rect.x,rect.y,rect.width,rect.height);
		this.cairo.clip();
	}
	,__render: function(object) {
		if(this.cairo == null) {
			return;
		}
		this.__renderDrawable(object);
	}
	,__renderDrawable: function(object) {
		if(object == null) {
			return;
		}
		switch(object.__drawableType) {
		case 0:
			break;
		case 2:
			break;
		case 3:
			break;
		case 4:case 5:
			break;
		case 6:
			var simpleButton = object;
			if(!(!simpleButton.__renderable || simpleButton.__worldAlpha <= 0 || simpleButton.__currentState == null)) {
				this.__pushMaskObject(simpleButton);
				this.__renderDrawable(simpleButton.__currentState);
				this.__popMaskObject(simpleButton);
				this.__renderEvent(simpleButton);
			}
			break;
		case 7:
			break;
		case 8:
			break;
		case 9:
			break;
		default:
		}
	}
	,__renderDrawableMask: function(object) {
		if(object == null) {
			return;
		}
		switch(object.__drawableType) {
		case 0:
			break;
		case 2:
			var bitmap = object;
			this.cairo.rectangle(0,0,bitmap.get_width(),bitmap.get_height());
			break;
		case 3:
			break;
		case 4:case 5:
			break;
		case 6:
			this.__renderDrawableMask(object.__currentState);
			break;
		case 7:
			break;
		case 8:
			break;
		case 9:
			break;
		default:
		}
	}
	,__setBlendMode: function(value) {
		if(this.__overrideBlendMode != null) {
			value = this.__overrideBlendMode;
		}
		if(this.__blendMode == value) {
			return;
		}
		this.__blendMode = value;
		this.__setBlendModeCairo(this.cairo,value);
	}
	,__setBlendModeCairo: function(cairo,value) {
		switch(value) {
		case 0:
			cairo.setOperator(12);
			break;
		case 2:
			cairo.setOperator(17);
			break;
		case 3:
			cairo.setOperator(23);
			break;
		case 5:
			cairo.setOperator(21);
			break;
		case 7:
			cairo.setOperator(2);
			break;
		case 8:
			cairo.setOperator(18);
			break;
		case 9:
			cairo.setOperator(14);
			break;
		case 11:
			cairo.setOperator(16);
			break;
		case 12:
			cairo.setOperator(15);
			break;
		default:
			cairo.setOperator(2);
		}
	}
	,__class__: openfl_display_CairoRenderer
});
var openfl_display_CanvasRenderer = function(context) {
	openfl_display_DisplayObjectRenderer.call(this);
	this.context = context;
	this.__tempMatrix = new openfl_geom_Matrix();
	this.__type = "canvas";
};
$hxClasses["openfl.display.CanvasRenderer"] = openfl_display_CanvasRenderer;
openfl_display_CanvasRenderer.__name__ = "openfl.display.CanvasRenderer";
openfl_display_CanvasRenderer.__super__ = openfl_display_DisplayObjectRenderer;
openfl_display_CanvasRenderer.prototype = $extend(openfl_display_DisplayObjectRenderer.prototype,{
	context: null
	,__isDOM: null
	,__tempMatrix: null
	,applySmoothing: function(context,value) {
		context.imageSmoothingEnabled = value;
	}
	,setTransform: function(transform,context) {
		if(context == null) {
			context = this.context;
		} else if(this.context == context && this.__worldTransform != null) {
			this.__tempMatrix.copyFrom(transform);
			this.__tempMatrix.concat(this.__worldTransform);
			transform = this.__tempMatrix;
		}
		if(this.__roundPixels) {
			context.setTransform(transform.a,transform.b,transform.c,transform.d,transform.tx | 0,transform.ty | 0);
		} else {
			context.setTransform(transform.a,transform.b,transform.c,transform.d,transform.tx,transform.ty);
		}
	}
	,__clear: function() {
		if(this.__stage != null) {
			var cacheBlendMode = this.__blendMode;
			this.__blendMode = null;
			this.__setBlendMode(10);
			this.context.setTransform(1,0,0,1,0,0);
			this.context.globalAlpha = 1;
			if(!this.__stage.__transparent && this.__stage.__clearBeforeRender) {
				this.context.fillStyle = this.__stage.__colorString;
				this.context.fillRect(0,0,this.__stage.stageWidth * this.__stage.window.__scale,this.__stage.stageHeight * this.__stage.window.__scale);
			} else if(this.__stage.__transparent && this.__stage.__clearBeforeRender) {
				this.context.clearRect(0,0,this.__stage.stageWidth * this.__stage.window.__scale,this.__stage.stageHeight * this.__stage.window.__scale);
			}
			this.__setBlendMode(cacheBlendMode);
		}
	}
	,__popMask: function() {
		this.context.restore();
	}
	,__popMaskObject: function(object,handleScrollRect) {
		if(handleScrollRect == null) {
			handleScrollRect = true;
		}
		if(!object.__isCacheBitmapRender && object.__mask != null) {
			this.__popMask();
		}
		if(handleScrollRect && object.__scrollRect != null) {
			this.__popMaskRect();
		}
	}
	,__popMaskRect: function() {
		this.context.restore();
	}
	,__pushMask: function(mask) {
		this.context.save();
		this.setTransform(mask.__renderTransform,this.context);
		this.context.beginPath();
		this.__renderDrawableMask(mask);
		this.context.closePath();
		this.context.clip();
	}
	,__pushMaskObject: function(object,handleScrollRect) {
		if(handleScrollRect == null) {
			handleScrollRect = true;
		}
		if(handleScrollRect && object.__scrollRect != null) {
			this.__pushMaskRect(object.__scrollRect,object.__renderTransform);
		}
		if(!object.__isCacheBitmapRender && object.__mask != null) {
			this.__pushMask(object.__mask);
		}
	}
	,__pushMaskRect: function(rect,transform) {
		this.context.save();
		this.setTransform(transform,this.context);
		this.context.beginPath();
		this.context.rect(rect.x,rect.y,rect.width,rect.height);
		this.context.clip();
	}
	,__render: function(object) {
		this.__renderDrawable(object);
	}
	,__renderDrawable: function(object) {
		if(object == null) {
			return;
		}
		switch(object.__drawableType) {
		case 0:
			openfl_display__$internal_CanvasBitmapData.renderDrawable(object,this);
			break;
		case 2:
			openfl_display__$internal_CanvasBitmap.renderDrawable(object,this);
			break;
		case 3:
			openfl_display__$internal_CanvasDisplayObject.renderDrawable(object,this);
			break;
		case 4:case 5:
			openfl_display__$internal_CanvasDisplayObjectContainer.renderDrawable(object,this);
			break;
		case 6:
			openfl_display__$internal_CanvasSimpleButton.renderDrawable(object,this);
			break;
		case 7:
			openfl_display__$internal_CanvasTextField.renderDrawable(object,this);
			break;
		case 8:
			openfl_display__$internal_CanvasVideo.renderDrawable(object,this);
			break;
		case 9:
			openfl_display__$internal_CanvasTilemap.renderDrawable(object,this);
			break;
		default:
		}
	}
	,__renderDrawableMask: function(object) {
		if(object == null) {
			return;
		}
		switch(object.__drawableType) {
		case 0:
			openfl_display__$internal_CanvasBitmapData.renderDrawableMask(object,this);
			break;
		case 2:
			openfl_display__$internal_CanvasBitmap.renderDrawableMask(object,this);
			break;
		case 3:
			openfl_display__$internal_CanvasDisplayObject.renderDrawableMask(object,this);
			break;
		case 4:case 5:
			openfl_display__$internal_CanvasDisplayObjectContainer.renderDrawableMask(object,this);
			break;
		case 6:
			openfl_display__$internal_CanvasSimpleButton.renderDrawableMask(object,this);
			break;
		case 7:
			openfl_display__$internal_CanvasTextField.renderDrawableMask(object,this);
			break;
		case 8:
			openfl_display__$internal_CanvasVideo.renderDrawableMask(object,this);
			break;
		case 9:
			openfl_display__$internal_CanvasTilemap.renderDrawableMask(object,this);
			break;
		default:
		}
	}
	,__setBlendMode: function(value) {
		if(this.__overrideBlendMode != null) {
			value = this.__overrideBlendMode;
		}
		if(this.__blendMode == value) {
			return;
		}
		this.__blendMode = value;
		this.__setBlendModeContext(this.context,value);
	}
	,__setBlendModeContext: function(context,value) {
		switch(value) {
		case 0:
			context.globalCompositeOperation = "lighter";
			break;
		case 2:
			context.globalCompositeOperation = "darken";
			break;
		case 3:
			context.globalCompositeOperation = "difference";
			break;
		case 5:
			context.globalCompositeOperation = "hard-light";
			break;
		case 8:
			context.globalCompositeOperation = "lighten";
			break;
		case 9:
			context.globalCompositeOperation = "multiply";
			break;
		case 11:
			context.globalCompositeOperation = "overlay";
			break;
		case 12:
			context.globalCompositeOperation = "screen";
			break;
		default:
			context.globalCompositeOperation = "source-over";
		}
	}
	,__class__: openfl_display_CanvasRenderer
});
var openfl_display_CapsStyle = {};
openfl_display_CapsStyle.fromInt = function(value) {
	return value;
};
openfl_display_CapsStyle.fromString = function(value) {
	switch(value) {
	case "none":
		return 0;
	case "round":
		return 1;
	case "square":
		return 2;
	default:
		return null;
	}
};
openfl_display_CapsStyle.toInt = function(this1) {
	return this1;
};
openfl_display_CapsStyle.toString = function(this1) {
	switch(this1) {
	case 0:
		return "none";
	case 1:
		return "round";
	case 2:
		return "square";
	default:
		return null;
	}
};
var openfl_display_DOMElement = function(element) {
	openfl_display_DisplayObject.call(this);
	this.__drawableType = 10;
	this.__element = element;
};
$hxClasses["openfl.display.DOMElement"] = openfl_display_DOMElement;
openfl_display_DOMElement.__name__ = "openfl.display.DOMElement";
openfl_display_DOMElement.__super__ = openfl_display_DisplayObject;
openfl_display_DOMElement.prototype = $extend(openfl_display_DisplayObject.prototype,{
	__active: null
	,__element: null
	,__class__: openfl_display_DOMElement
});
var openfl_display_DOMRenderer = function(element) {
	openfl_display_DisplayObjectRenderer.call(this);
	this.element = element;
	openfl_display_DisplayObject.__supportDOM = true;
	var prefix = (function () {
		  var styles = window.getComputedStyle(document.documentElement, ''),
			pre = (Array.prototype.slice
			  .call(styles)
			  .join('')
			  .match(/-(moz|webkit|ms)-/) || (styles.OLink === '' && ['', 'o'])
			)[1],
			dom = ('WebKit|Moz|MS|O').match(new RegExp('(' + pre + ')', 'i'))[1];
		  return {
			dom: dom,
			lowercase: pre,
			css: '-' + pre + '-',
			js: pre[0].toUpperCase() + pre.substr(1)
		  };
		})();
	this.__vendorPrefix = prefix.lowercase;
	this.__transformProperty = prefix.lowercase == "webkit" ? "-webkit-transform" : "transform";
	this.__transformOriginProperty = prefix.lowercase == "webkit" ? "-webkit-transform-origin" : "transform-origin";
	this.__clipRects = [];
	this.__numClipRects = 0;
	this.__z = 0;
	this.__type = "dom";
	this.__canvasRenderer = new openfl_display_CanvasRenderer(null);
	this.__canvasRenderer.__isDOM = true;
};
$hxClasses["openfl.display.DOMRenderer"] = openfl_display_DOMRenderer;
openfl_display_DOMRenderer.__name__ = "openfl.display.DOMRenderer";
openfl_display_DOMRenderer.__super__ = openfl_display_DisplayObjectRenderer;
openfl_display_DOMRenderer.prototype = $extend(openfl_display_DisplayObjectRenderer.prototype,{
	element: null
	,__canvasRenderer: null
	,__clipRects: null
	,__currentClipRect: null
	,__numClipRects: null
	,__transformOriginProperty: null
	,__transformProperty: null
	,__vendorPrefix: null
	,__z: null
	,applyStyle: function(parent,childElement) {
		if(parent != null && childElement != null) {
			if(parent.__style == null || childElement.parentElement != this.element) {
				this.__initializeElement(parent,childElement);
			}
			parent.__style = childElement.style;
			this.__updateClip(parent);
			this.__applyStyle(parent,true,true,true);
		}
	}
	,clearStyle: function(childElement) {
		if(childElement != null && childElement.parentElement == this.element) {
			this.element.removeChild(childElement);
		}
	}
	,__applyStyle: function(displayObject,setTransform,setAlpha,setClip) {
		var style = displayObject.__style;
		if(setTransform && displayObject.__renderTransformChanged) {
			var _this = displayObject.__renderTransform;
			var roundPixels = this.__roundPixels;
			if(roundPixels == null) {
				roundPixels = false;
			}
			style.setProperty(this.__transformProperty,roundPixels ? "matrix3d(" + _this.a + ", " + _this.b + ", 0, 0, " + _this.c + ", " + _this.d + ", 0, 0, 0, 0, 1, 0, " + (_this.tx | 0) + ", " + (_this.ty | 0) + ", 0, 1)" : "matrix3d(" + _this.a + ", " + _this.b + ", 0, 0, " + _this.c + ", " + _this.d + ", 0, 0, 0, 0, 1, 0, " + _this.tx + ", " + _this.ty + ", 0, 1)",null);
		}
		if(displayObject.__worldZ != ++this.__z) {
			displayObject.__worldZ = this.__z;
			style.setProperty("z-index",displayObject.__worldZ == null ? "null" : "" + displayObject.__worldZ,null);
		}
		if(setAlpha && displayObject.__worldAlphaChanged) {
			if(displayObject.__worldAlpha < 1) {
				style.setProperty("opacity",displayObject.__worldAlpha == null ? "null" : "" + displayObject.__worldAlpha,null);
			} else {
				style.removeProperty("opacity");
			}
		}
		if(setClip && displayObject.__worldClipChanged) {
			if(displayObject.__worldClip == null) {
				style.removeProperty("clip");
			} else {
				var clip = displayObject.__worldClip;
				style.setProperty("clip","rect(" + clip.y + "px, " + clip.get_right() + "px, " + clip.get_bottom() + "px, " + clip.x + "px)",null);
			}
		}
	}
	,__initializeElement: function(displayObject,element) {
		var style = displayObject.__style = element.style;
		style.setProperty("position","absolute",null);
		style.setProperty("top","0",null);
		style.setProperty("left","0",null);
		style.setProperty(this.__transformOriginProperty,"0 0 0",null);
		this.element.appendChild(element);
		displayObject.__worldAlphaChanged = true;
		displayObject.__renderTransformChanged = true;
		displayObject.__worldVisibleChanged = true;
		displayObject.__worldClipChanged = true;
		displayObject.__worldClip = null;
		displayObject.__worldZ = -1;
	}
	,__popMask: function() {
		this.__popMaskRect();
	}
	,__popMaskObject: function(object,handleScrollRect) {
		if(handleScrollRect == null) {
			handleScrollRect = true;
		}
		if(object.__mask != null) {
			this.__popMask();
		}
		if(handleScrollRect && object.__scrollRect != null) {
			this.__popMaskRect();
		}
	}
	,__popMaskRect: function() {
		if(this.__numClipRects > 0) {
			this.__numClipRects--;
			if(this.__numClipRects > 0) {
				this.__currentClipRect = this.__clipRects[this.__numClipRects - 1];
			} else {
				this.__currentClipRect = null;
			}
		}
	}
	,__pushMask: function(mask) {
		this.__pushMaskRect(mask.getBounds(mask),mask.__renderTransform);
	}
	,__pushMaskObject: function(object,handleScrollRect) {
		if(handleScrollRect == null) {
			handleScrollRect = true;
		}
		if(handleScrollRect && object.__scrollRect != null) {
			this.__pushMaskRect(object.__scrollRect,object.__renderTransform);
		}
		if(object.__mask != null) {
			this.__pushMask(object.__mask);
		}
	}
	,__pushMaskRect: function(rect,transform) {
		if(this.__numClipRects == this.__clipRects.length) {
			this.__clipRects[this.__numClipRects] = new openfl_geom_Rectangle();
		}
		var clipRect = this.__clipRects[this.__numClipRects];
		rect.__transform(clipRect,transform);
		if(this.__numClipRects > 0) {
			var parentClipRect = this.__clipRects[this.__numClipRects - 1];
			clipRect.__contract(parentClipRect.x,parentClipRect.y,parentClipRect.width,parentClipRect.height);
		}
		if(clipRect.height < 0) {
			clipRect.height = 0;
		}
		if(clipRect.width < 0) {
			clipRect.width = 0;
		}
		this.__currentClipRect = clipRect;
		this.__numClipRects++;
	}
	,__render: function(object) {
		if(!this.__stage.__transparent) {
			this.element.style.background = this.__stage.__colorString;
		} else {
			this.element.style.background = "none";
		}
		this.__z = 1;
		this.__renderDrawable(object);
	}
	,__renderDrawable: function(object) {
		if(object == null) {
			return;
		}
		switch(object.__drawableType) {
		case 0:
			break;
		case 2:
			openfl_display__$internal_DOMBitmap.renderDrawable(object,this);
			break;
		case 3:
			openfl_display__$internal_DOMDisplayObject.renderDrawable(object,this);
			break;
		case 4:case 5:
			openfl_display__$internal_DOMDisplayObjectContainer.renderDrawable(object,this);
			break;
		case 6:
			openfl_display__$internal_DOMSimpleButton.renderDrawable(object,this);
			break;
		case 7:
			openfl_display__$internal_DOMTextField.renderDrawable(object,this);
			break;
		case 8:
			openfl_display__$internal_DOMVideo.renderDrawable(object,this);
			break;
		case 9:
			openfl_display__$internal_DOMTilemap.renderDrawable(object,this);
			break;
		case 10:
			var domElement = object;
			if(domElement.stage != null && domElement.__worldVisible && domElement.__renderable) {
				if(!domElement.__active) {
					this.__initializeElement(domElement,domElement.__element);
					domElement.__active = true;
				}
				this.__updateClip(domElement);
				this.__applyStyle(domElement,true,true,true);
			} else if(domElement.__active) {
				this.element.removeChild(domElement.__element);
				domElement.__active = false;
			}
			openfl_display__$internal_DOMDisplayObject.renderDrawable(domElement,this);
			break;
		default:
		}
	}
	,__renderDrawableClear: function(object) {
		if(object == null) {
			return;
		}
		switch(object.__drawableType) {
		case 0:
			break;
		case 2:
			openfl_display__$internal_DOMBitmap.renderDrawableClear(object,this);
			break;
		case 3:
			openfl_display__$internal_DOMDisplayObject.renderDrawableClear(object,this);
			break;
		case 4:case 5:
			openfl_display__$internal_DOMDisplayObjectContainer.renderDrawableClear(object,this);
			break;
		case 6:
			openfl_display__$internal_DOMSimpleButton.renderDrawableClear(object,this);
			break;
		case 7:
			openfl_display__$internal_DOMTextField.renderDrawableClear(object,this);
			break;
		case 8:
			openfl_display__$internal_DOMVideo.renderDrawableClear(object,this);
			break;
		case 9:
			openfl_display__$internal_DOMTilemap.renderDrawableClear(object,this);
			break;
		default:
		}
	}
	,__setBlendMode: function(value) {
		if(this.__overrideBlendMode != null) {
			value = this.__overrideBlendMode;
		}
		if(this.__blendMode == value) {
			return;
		}
		this.__blendMode = value;
	}
	,__updateClip: function(displayObject) {
		if(this.__currentClipRect == null) {
			displayObject.__worldClipChanged = displayObject.__worldClip != null;
			displayObject.__worldClip = null;
		} else {
			if(displayObject.__worldClip == null) {
				displayObject.__worldClip = new openfl_geom_Rectangle();
			}
			var clip = openfl_geom_Rectangle.__pool.get();
			var matrix = openfl_geom_Matrix.__pool.get();
			matrix.copyFrom(displayObject.__renderTransform);
			matrix.invert();
			this.__currentClipRect.__transform(clip,matrix);
			if(clip.equals(displayObject.__worldClip)) {
				displayObject.__worldClipChanged = false;
			} else {
				displayObject.__worldClip.copyFrom(clip);
				displayObject.__worldClipChanged = true;
			}
			openfl_geom_Rectangle.__pool.release(clip);
			openfl_geom_Matrix.__pool.release(matrix);
		}
	}
	,__class__: openfl_display_DOMRenderer
});
var openfl_display_Shader = function(code) {
	this.byteCode = code;
	this.precisionHint = 1;
	this.__glSourceDirty = true;
	this.__numPasses = 1;
	this.__data = openfl_display_ShaderData._new(code);
};
$hxClasses["openfl.display.Shader"] = openfl_display_Shader;
openfl_display_Shader.__name__ = "openfl.display.Shader";
openfl_display_Shader.prototype = {
	byteCode: null
	,glProgram: null
	,precisionHint: null
	,program: null
	,__alpha: null
	,__bitmap: null
	,__colorMultiplier: null
	,__colorOffset: null
	,__context: null
	,__data: null
	,__glFragmentSource: null
	,__glSourceDirty: null
	,__glVertexSource: null
	,__hasColorTransform: null
	,__inputBitmapData: null
	,__isGenerated: null
	,__matrix: null
	,__numPasses: null
	,__paramBool: null
	,__paramFloat: null
	,__paramInt: null
	,__position: null
	,__textureCoord: null
	,__texture: null
	,__textureSize: null
	,__clearUseArray: function() {
		var _g = 0;
		var _g1 = this.__paramBool;
		while(_g < _g1.length) {
			var parameter = _g1[_g];
			++_g;
			parameter.__useArray = false;
		}
		var _g = 0;
		var _g1 = this.__paramFloat;
		while(_g < _g1.length) {
			var parameter = _g1[_g];
			++_g;
			parameter.__useArray = false;
		}
		var _g = 0;
		var _g1 = this.__paramInt;
		while(_g < _g1.length) {
			var parameter = _g1[_g];
			++_g;
			parameter.__useArray = false;
		}
	}
	,__createGLShader: function(source,type) {
		var gl = this.__context.gl;
		var shader = gl.createShader(type);
		gl.shaderSource(shader,source);
		gl.compileShader(shader);
		var shaderInfoLog = gl.getShaderInfoLog(shader);
		var hasInfoLog = shaderInfoLog != null && StringTools.trim(shaderInfoLog) != "";
		var compileStatus = gl.getShaderParameter(shader,gl.COMPILE_STATUS);
		if(hasInfoLog || compileStatus == 0) {
			var message = compileStatus == 0 ? "Error" : "Info";
			message += type == gl.VERTEX_SHADER ? " compiling vertex shader" : " compiling fragment shader";
			message += "\n" + shaderInfoLog;
			message += "\n" + source;
			if(compileStatus == 0) {
				lime_utils_Log.error(message,{ fileName : "openfl/display/Shader.hx", lineNumber : 336, className : "openfl.display.Shader", methodName : "__createGLShader"});
			} else if(hasInfoLog) {
				lime_utils_Log.debug(message,{ fileName : "openfl/display/Shader.hx", lineNumber : 337, className : "openfl.display.Shader", methodName : "__createGLShader"});
			}
		}
		return shader;
	}
	,__createGLProgram: function(vertexSource,fragmentSource) {
		var gl = this.__context.gl;
		var vertexShader = this.__createGLShader(vertexSource,gl.VERTEX_SHADER);
		var fragmentShader = this.__createGLShader(fragmentSource,gl.FRAGMENT_SHADER);
		var program = gl.createProgram();
		var _g = 0;
		var _g1 = this.__paramFloat;
		while(_g < _g1.length) {
			var param = _g1[_g];
			++_g;
			if(param.name.indexOf("Position") > -1 && StringTools.startsWith(param.name,"openfl_")) {
				gl.bindAttribLocation(program,0,param.name);
				break;
			}
		}
		gl.attachShader(program,vertexShader);
		gl.attachShader(program,fragmentShader);
		gl.linkProgram(program);
		if(gl.getProgramParameter(program,gl.LINK_STATUS) == 0) {
			var message = "Unable to initialize the shader program";
			message += "\n" + gl.getProgramInfoLog(program);
			lime_utils_Log.error(message,{ fileName : "openfl/display/Shader.hx", lineNumber : 370, className : "openfl.display.Shader", methodName : "__createGLProgram"});
		}
		return program;
	}
	,__disable: function() {
		if(this.program != null) {
			this.__disableGL();
		}
	}
	,__disableGL: function() {
		var gl = this.__context.gl;
		var textureCount = 0;
		var _g = 0;
		var _g1 = this.__inputBitmapData;
		while(_g < _g1.length) {
			var input = _g1[_g];
			++_g;
			input.__disableGL(this.__context,textureCount);
			++textureCount;
			if(textureCount == gl.MAX_TEXTURE_IMAGE_UNITS) {
				break;
			}
		}
		var _g = 0;
		var _g1 = this.__paramBool;
		while(_g < _g1.length) {
			var parameter = _g1[_g];
			++_g;
			parameter.__disableGL(this.__context);
		}
		var _g = 0;
		var _g1 = this.__paramFloat;
		while(_g < _g1.length) {
			var parameter = _g1[_g];
			++_g;
			parameter.__disableGL(this.__context);
		}
		var _g = 0;
		var _g1 = this.__paramInt;
		while(_g < _g1.length) {
			var parameter = _g1[_g];
			++_g;
			parameter.__disableGL(this.__context);
		}
		this.__context.__bindGLArrayBuffer(null);
		if(this.__context.__context.type == "opengl") {
			gl.disable(gl.TEXTURE_2D);
		}
	}
	,__enable: function() {
		this.__init();
		if(this.program != null) {
			this.__enableGL();
		}
	}
	,__enableGL: function() {
		var textureCount = 0;
		var gl = this.__context.gl;
		var _g = 0;
		var _g1 = this.__inputBitmapData;
		while(_g < _g1.length) {
			var input = _g1[_g];
			++_g;
			gl.uniform1i(input.index,textureCount);
			++textureCount;
		}
		if(this.__context.__context.type == "opengl" && textureCount > 0) {
			gl.enable(gl.TEXTURE_2D);
		}
	}
	,__init: function() {
		if(this.__data == null) {
			this.__data = openfl_display_ShaderData._new(null);
		}
		if(this.__glFragmentSource != null && this.__glVertexSource != null && (this.program == null || this.__glSourceDirty)) {
			this.__initGL();
		}
	}
	,__initGL: function() {
		if(this.__glSourceDirty || this.__paramBool == null) {
			this.__glSourceDirty = false;
			this.program = null;
			this.__inputBitmapData = [];
			this.__paramBool = [];
			this.__paramFloat = [];
			this.__paramInt = [];
			this.__processGLData(this.get_glVertexSource(),"attribute");
			this.__processGLData(this.get_glVertexSource(),"uniform");
			this.__processGLData(this.get_glFragmentSource(),"uniform");
		}
		if(this.__context != null && this.program == null) {
			var gl = this.__context.gl;
			var prefix = this.precisionHint == 1 ? "precision mediump float;\n" : "precision lowp float;\n";
			var vertex = prefix + this.get_glVertexSource();
			var fragment = prefix + this.get_glFragmentSource();
			var id = vertex + fragment;
			if(Object.prototype.hasOwnProperty.call(this.__context.__programs.h,id)) {
				this.program = this.__context.__programs.h[id];
			} else {
				this.program = this.__context.createProgram(1);
				this.program.__glProgram = this.__createGLProgram(vertex,fragment);
				this.__context.__programs.h[id] = this.program;
			}
			if(this.program != null) {
				this.glProgram = this.program.__glProgram;
				var _g = 0;
				var _g1 = this.__inputBitmapData;
				while(_g < _g1.length) {
					var input = _g1[_g];
					++_g;
					if(input.__isUniform) {
						input.index = gl.getUniformLocation(this.glProgram,input.name);
					} else {
						input.index = gl.getAttribLocation(this.glProgram,input.name);
					}
				}
				var _g = 0;
				var _g1 = this.__paramBool;
				while(_g < _g1.length) {
					var parameter = _g1[_g];
					++_g;
					if(parameter.__isUniform) {
						parameter.index = gl.getUniformLocation(this.glProgram,parameter.name);
					} else {
						parameter.index = gl.getAttribLocation(this.glProgram,parameter.name);
					}
				}
				var _g = 0;
				var _g1 = this.__paramFloat;
				while(_g < _g1.length) {
					var parameter = _g1[_g];
					++_g;
					if(parameter.__isUniform) {
						parameter.index = gl.getUniformLocation(this.glProgram,parameter.name);
					} else {
						parameter.index = gl.getAttribLocation(this.glProgram,parameter.name);
					}
				}
				var _g = 0;
				var _g1 = this.__paramInt;
				while(_g < _g1.length) {
					var parameter = _g1[_g];
					++_g;
					if(parameter.__isUniform) {
						parameter.index = gl.getUniformLocation(this.glProgram,parameter.name);
					} else {
						parameter.index = gl.getAttribLocation(this.glProgram,parameter.name);
					}
				}
			}
		}
	}
	,__processGLData: function(source,storageType) {
		var lastMatch = 0;
		var position;
		var regex;
		var name;
		var type;
		if(storageType == "uniform") {
			regex = new EReg("uniform ([A-Za-z0-9]+) ([A-Za-z0-9_]+)","");
		} else {
			regex = new EReg("attribute ([A-Za-z0-9]+) ([A-Za-z0-9_]+)","");
		}
		while(regex.matchSub(source,lastMatch)) {
			type = regex.matched(1);
			name = regex.matched(2);
			if(StringTools.startsWith(name,"gl_")) {
				continue;
			}
			var isUniform = storageType == "uniform";
			if(StringTools.startsWith(type,"sampler")) {
				var input = new openfl_display_ShaderInput();
				input.name = name;
				input.__isUniform = isUniform;
				this.__inputBitmapData.push(input);
				switch(name) {
				case "bitmap":
					this.__bitmap = input;
					break;
				case "openfl_Texture":
					this.__texture = input;
					break;
				default:
				}
				this.__data[name] = input;
				if(this.__isGenerated) {
					this[name] = input;
				}
			} else if(!Object.prototype.hasOwnProperty.call(this.__data,name) || Reflect.field(this.__data,name) == null) {
				var parameterType;
				switch(type) {
				case "bool":
					parameterType = 0;
					break;
				case "bvec2":
					parameterType = 1;
					break;
				case "bvec3":
					parameterType = 2;
					break;
				case "bvec4":
					parameterType = 3;
					break;
				case "dvec2":case "vec2":
					parameterType = 5;
					break;
				case "dvec3":case "vec3":
					parameterType = 6;
					break;
				case "dvec4":case "vec4":
					parameterType = 7;
					break;
				case "double":case "float":
					parameterType = 4;
					break;
				case "mat2":case "mat2x2":
					parameterType = 12;
					break;
				case "mat2x3":
					parameterType = 13;
					break;
				case "mat2x4":
					parameterType = 14;
					break;
				case "mat3x2":
					parameterType = 15;
					break;
				case "mat3":case "mat3x3":
					parameterType = 16;
					break;
				case "mat3x4":
					parameterType = 17;
					break;
				case "mat4x2":
					parameterType = 18;
					break;
				case "mat4x3":
					parameterType = 19;
					break;
				case "mat4":case "mat4x4":
					parameterType = 20;
					break;
				case "int":case "uint":
					parameterType = 8;
					break;
				case "ivec2":case "uvec2":
					parameterType = 9;
					break;
				case "ivec3":case "uvec3":
					parameterType = 10;
					break;
				case "ivec4":case "uvec4":
					parameterType = 11;
					break;
				default:
					parameterType = null;
				}
				var length;
				switch(parameterType) {
				case 1:case 5:case 9:
					length = 2;
					break;
				case 2:case 6:case 10:
					length = 3;
					break;
				case 3:case 7:case 11:case 12:
					length = 4;
					break;
				case 16:
					length = 9;
					break;
				case 20:
					length = 16;
					break;
				default:
					length = 1;
				}
				var arrayLength;
				switch(parameterType) {
				case 12:
					arrayLength = 2;
					break;
				case 16:
					arrayLength = 3;
					break;
				case 20:
					arrayLength = 4;
					break;
				default:
					arrayLength = 1;
				}
				switch(parameterType) {
				case 0:case 1:case 2:case 3:
					var parameter = new openfl_display_ShaderParameter();
					parameter.set_name(name);
					parameter.type = parameterType;
					parameter.__arrayLength = arrayLength;
					parameter.__isBool = true;
					parameter.__isUniform = isUniform;
					parameter.__length = length;
					this.__paramBool.push(parameter);
					if(name == "openfl_HasColorTransform") {
						this.__hasColorTransform = parameter;
					}
					this.__data[name] = parameter;
					if(this.__isGenerated) {
						this[name] = parameter;
					}
					break;
				case 8:case 9:case 10:case 11:
					var parameter1 = new openfl_display_ShaderParameter();
					parameter1.set_name(name);
					parameter1.type = parameterType;
					parameter1.__arrayLength = arrayLength;
					parameter1.__isInt = true;
					parameter1.__isUniform = isUniform;
					parameter1.__length = length;
					this.__paramInt.push(parameter1);
					this.__data[name] = parameter1;
					if(this.__isGenerated) {
						this[name] = parameter1;
					}
					break;
				default:
					var parameter2 = new openfl_display_ShaderParameter();
					parameter2.set_name(name);
					parameter2.type = parameterType;
					parameter2.__arrayLength = arrayLength;
					if(arrayLength > 0) {
						var elements = arrayLength * arrayLength;
						var array = null;
						var vector = null;
						var view = null;
						var buffer = null;
						var len = null;
						var this1;
						if(elements != null) {
							this1 = new Float32Array(elements);
						} else if(array != null) {
							this1 = new Float32Array(array);
						} else if(vector != null) {
							this1 = new Float32Array(vector.__array);
						} else if(view != null) {
							this1 = new Float32Array(view);
						} else if(buffer != null) {
							if(len == null) {
								this1 = new Float32Array(buffer,0);
							} else {
								this1 = new Float32Array(buffer,0,len);
							}
						} else {
							this1 = null;
						}
						parameter2.__uniformMatrix = this1;
					}
					parameter2.__isFloat = true;
					parameter2.__isUniform = isUniform;
					parameter2.__length = length;
					this.__paramFloat.push(parameter2);
					if(StringTools.startsWith(name,"openfl_")) {
						switch(name) {
						case "openfl_Alpha":
							this.__alpha = parameter2;
							break;
						case "openfl_ColorMultiplier":
							this.__colorMultiplier = parameter2;
							break;
						case "openfl_ColorOffset":
							this.__colorOffset = parameter2;
							break;
						case "openfl_Matrix":
							this.__matrix = parameter2;
							break;
						case "openfl_Position":
							this.__position = parameter2;
							break;
						case "openfl_TextureCoord":
							this.__textureCoord = parameter2;
							break;
						case "openfl_TextureSize":
							this.__textureSize = parameter2;
							break;
						default:
						}
					}
					this.__data[name] = parameter2;
					if(this.__isGenerated) {
						this[name] = parameter2;
					}
				}
			}
			position = regex.matchedPos();
			lastMatch = position.pos + position.len;
		}
	}
	,__update: function() {
		if(this.program != null) {
			this.__updateGL();
		}
	}
	,__updateFromBuffer: function(shaderBuffer,bufferOffset) {
		if(this.program != null) {
			this.__updateGLFromBuffer(shaderBuffer,bufferOffset);
		}
	}
	,__updateGL: function() {
		var textureCount = 0;
		var _g = 0;
		var _g1 = this.__inputBitmapData;
		while(_g < _g1.length) {
			var input = _g1[_g];
			++_g;
			input.__updateGL(this.__context,textureCount);
			++textureCount;
		}
		var _g = 0;
		var _g1 = this.__paramBool;
		while(_g < _g1.length) {
			var parameter = _g1[_g];
			++_g;
			parameter.__updateGL(this.__context);
		}
		var _g = 0;
		var _g1 = this.__paramFloat;
		while(_g < _g1.length) {
			var parameter = _g1[_g];
			++_g;
			parameter.__updateGL(this.__context);
		}
		var _g = 0;
		var _g1 = this.__paramInt;
		while(_g < _g1.length) {
			var parameter = _g1[_g];
			++_g;
			parameter.__updateGL(this.__context);
		}
	}
	,__updateGLFromBuffer: function(shaderBuffer,bufferOffset) {
		var textureCount = 0;
		var input;
		var inputData;
		var inputFilter;
		var inputMipFilter;
		var inputWrap;
		var _g = 0;
		var _g1 = shaderBuffer.inputCount;
		while(_g < _g1) {
			var i = _g++;
			input = shaderBuffer.inputRefs[i];
			inputData = shaderBuffer.inputs[i];
			inputFilter = shaderBuffer.inputFilter[i];
			inputMipFilter = shaderBuffer.inputMipFilter[i];
			inputWrap = shaderBuffer.inputWrap[i];
			if(inputData != null) {
				input.__updateGL(this.__context,textureCount,inputData,inputFilter,inputMipFilter,inputWrap);
				++textureCount;
			}
		}
		var gl = this.__context.gl;
		if(shaderBuffer.paramDataLength > 0) {
			if(shaderBuffer.paramDataBuffer == null) {
				shaderBuffer.paramDataBuffer = gl.createBuffer();
			}
			this.__context.__bindGLArrayBuffer(shaderBuffer.paramDataBuffer);
			lime_graphics_WebGLRenderContext.bufferData(gl,gl.ARRAY_BUFFER,shaderBuffer.paramData,gl.DYNAMIC_DRAW);
		} else {
			this.__context.__bindGLArrayBuffer(null);
		}
		var boolIndex = 0;
		var floatIndex = 0;
		var intIndex = 0;
		var boolCount = shaderBuffer.paramBoolCount;
		var floatCount = shaderBuffer.paramFloatCount;
		var paramData = shaderBuffer.paramData;
		var boolRef;
		var floatRef;
		var intRef;
		var hasOverride;
		var overrideBoolValue = null;
		var overrideFloatValue = null;
		var overrideIntValue = null;
		var _g = 0;
		var _g1 = shaderBuffer.paramCount;
		while(_g < _g1) {
			var i = _g++;
			hasOverride = false;
			if(i < boolCount) {
				boolRef = shaderBuffer.paramRefs_Bool[boolIndex];
				var _g2 = 0;
				var _g3 = shaderBuffer.overrideBoolCount;
				while(_g2 < _g3) {
					var j = _g2++;
					if(boolRef.name == shaderBuffer.overrideBoolNames[j]) {
						overrideBoolValue = shaderBuffer.overrideBoolValues[j];
						hasOverride = true;
						break;
					}
				}
				if(hasOverride) {
					boolRef.__updateGL(this.__context,overrideBoolValue);
				} else {
					boolRef.__updateGLFromBuffer(this.__context,paramData,shaderBuffer.paramPositions[i],shaderBuffer.paramLengths[i],bufferOffset);
				}
				++boolIndex;
			} else if(i < boolCount + floatCount) {
				floatRef = shaderBuffer.paramRefs_Float[floatIndex];
				var _g4 = 0;
				var _g5 = shaderBuffer.overrideFloatCount;
				while(_g4 < _g5) {
					var j1 = _g4++;
					if(floatRef.name == shaderBuffer.overrideFloatNames[j1]) {
						overrideFloatValue = shaderBuffer.overrideFloatValues[j1];
						hasOverride = true;
						break;
					}
				}
				if(hasOverride) {
					floatRef.__updateGL(this.__context,overrideFloatValue);
				} else {
					floatRef.__updateGLFromBuffer(this.__context,paramData,shaderBuffer.paramPositions[i],shaderBuffer.paramLengths[i],bufferOffset);
				}
				++floatIndex;
			} else {
				intRef = shaderBuffer.paramRefs_Int[intIndex];
				var _g6 = 0;
				var _g7 = shaderBuffer.overrideIntCount;
				while(_g6 < _g7) {
					var j2 = _g6++;
					if(intRef.name == shaderBuffer.overrideIntNames[j2]) {
						overrideIntValue = shaderBuffer.overrideIntValues[j2];
						hasOverride = true;
						break;
					}
				}
				if(hasOverride) {
					intRef.__updateGL(this.__context,overrideIntValue);
				} else {
					intRef.__updateGLFromBuffer(this.__context,paramData,shaderBuffer.paramPositions[i],shaderBuffer.paramLengths[i],bufferOffset);
				}
				++intIndex;
			}
		}
	}
	,get_data: function() {
		if(this.__glSourceDirty || this.__data == null) {
			this.__init();
		}
		return this.__data;
	}
	,set_data: function(value) {
		return this.__data = value;
	}
	,get_glFragmentSource: function() {
		return this.__glFragmentSource;
	}
	,set_glFragmentSource: function(value) {
		if(value != this.__glFragmentSource) {
			this.__glSourceDirty = true;
		}
		return this.__glFragmentSource = value;
	}
	,get_glVertexSource: function() {
		return this.__glVertexSource;
	}
	,set_glVertexSource: function(value) {
		if(value != this.__glVertexSource) {
			this.__glSourceDirty = true;
		}
		return this.__glVertexSource = value;
	}
	,__class__: openfl_display_Shader
	,__properties__: {set_glVertexSource:"set_glVertexSource",get_glVertexSource:"get_glVertexSource",set_glFragmentSource:"set_glFragmentSource",get_glFragmentSource:"get_glFragmentSource",set_data:"set_data",get_data:"get_data"}
};
var openfl_display_DisplayObjectShader = function(code) {
	if(this.__glFragmentSource == null) {
		this.__glFragmentSource = "varying float openfl_Alphav;\n\t\tvarying vec4 openfl_ColorMultiplierv;\n\t\tvarying vec4 openfl_ColorOffsetv;\n\t\tvarying vec2 openfl_TextureCoordv;\n\n\t\tuniform bool openfl_HasColorTransform;\n\t\tuniform sampler2D openfl_Texture;\n\t\tuniform vec2 openfl_TextureSize;\n\n\t\tvoid main(void) {\n\n\t\t\tvec4 color = texture2D (openfl_Texture, openfl_TextureCoordv);\n\n\t\tif (color.a == 0.0) {\n\n\t\t\tgl_FragColor = vec4 (0.0, 0.0, 0.0, 0.0);\n\n\t\t} else if (openfl_HasColorTransform) {\n\n\t\t\tcolor = vec4 (color.rgb / color.a, color.a);\n\n\t\t\tmat4 colorMultiplier = mat4 (0);\n\t\t\tcolorMultiplier[0][0] = openfl_ColorMultiplierv.x;\n\t\t\tcolorMultiplier[1][1] = openfl_ColorMultiplierv.y;\n\t\t\tcolorMultiplier[2][2] = openfl_ColorMultiplierv.z;\n\t\t\tcolorMultiplier[3][3] = 1.0; // openfl_ColorMultiplierv.w;\n\n\t\t\tcolor = clamp (openfl_ColorOffsetv + (color * colorMultiplier), 0.0, 1.0);\n\n\t\t\tif (color.a > 0.0) {\n\n\t\t\t\tgl_FragColor = vec4 (color.rgb * color.a * openfl_Alphav, color.a * openfl_Alphav);\n\n\t\t\t} else {\n\n\t\t\t\tgl_FragColor = vec4 (0.0, 0.0, 0.0, 0.0);\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\tgl_FragColor = color * openfl_Alphav;\n\n\t\t}\n\n\t\t}";
	}
	if(this.__glVertexSource == null) {
		this.__glVertexSource = "attribute float openfl_Alpha;\n\t\tattribute vec4 openfl_ColorMultiplier;\n\t\tattribute vec4 openfl_ColorOffset;\n\t\tattribute vec4 openfl_Position;\n\t\tattribute vec2 openfl_TextureCoord;\n\n\t\tvarying float openfl_Alphav;\n\t\tvarying vec4 openfl_ColorMultiplierv;\n\t\tvarying vec4 openfl_ColorOffsetv;\n\t\tvarying vec2 openfl_TextureCoordv;\n\n\t\tuniform mat4 openfl_Matrix;\n\t\tuniform bool openfl_HasColorTransform;\n\t\tuniform vec2 openfl_TextureSize;\n\n\t\tvoid main(void) {\n\n\t\t\topenfl_Alphav = openfl_Alpha;\n\t\topenfl_TextureCoordv = openfl_TextureCoord;\n\n\t\tif (openfl_HasColorTransform) {\n\n\t\t\topenfl_ColorMultiplierv = openfl_ColorMultiplier;\n\t\t\topenfl_ColorOffsetv = openfl_ColorOffset / 255.0;\n\n\t\t}\n\n\t\tgl_Position = openfl_Matrix * openfl_Position;\n\n\t\t}";
	}
	openfl_display_Shader.call(this,code);
	this.__isGenerated = true;
	this.__initGL();
};
$hxClasses["openfl.display.DisplayObjectShader"] = openfl_display_DisplayObjectShader;
openfl_display_DisplayObjectShader.__name__ = "openfl.display.DisplayObjectShader";
openfl_display_DisplayObjectShader.__super__ = openfl_display_Shader;
openfl_display_DisplayObjectShader.prototype = $extend(openfl_display_Shader.prototype,{
	openfl_Alpha: null
	,openfl_ColorMultiplier: null
	,openfl_ColorOffset: null
	,openfl_Position: null
	,openfl_TextureCoord: null
	,openfl_Matrix: null
	,openfl_HasColorTransform: null
	,openfl_TextureSize: null
	,openfl_Texture: null
	,__class__: openfl_display_DisplayObjectShader
});
var openfl_text_TextField = function() {
	this.__forceCachedBitmapUpdate = false;
	this.__renderedOnCanvasWhileOnDOM = false;
	this.__mouseScrollVCounter = 0;
	this.condenseWhite = false;
	openfl_display_InteractiveObject.call(this);
	this.__wordSelection = false;
	this.__drawableType = 7;
	this.__caretIndex = 0;
	this.__selectionIndex = 0;
	this.__displayAsPassword = false;
	this.__passwordChar = "*";
	this.__graphics = new openfl_display_Graphics(this);
	this.__graphics.__commands.clear();
	this.__textEngine = new openfl_text__$internal_TextEngine(this);
	this.__layoutDirty = true;
	this.__offsetX = 0;
	this.__offsetY = 0;
	this.__mouseWheelEnabled = true;
	this.__text = "";
	if(openfl_text_TextField.__defaultTextFormat == null) {
		openfl_text_TextField.__defaultTextFormat = new openfl_text_TextFormat("Times New Roman",12,0,false,false,false,"","",3,0,0,0,0);
		openfl_text_TextField.__defaultTextFormat.blockIndent = 0;
		openfl_text_TextField.__defaultTextFormat.bullet = false;
		openfl_text_TextField.__defaultTextFormat.letterSpacing = 0;
		openfl_text_TextField.__defaultTextFormat.kerning = false;
	}
	this.__textFormat = openfl_text_TextField.__defaultTextFormat.clone();
	this.__textEngine.textFormatRanges.push(new openfl_text__$internal_TextFormatRange(this.__textFormat,0,0));
	this.addEventListener("mouseDown",$bind(this,this.this_onMouseDown));
	this.addEventListener("focusIn",$bind(this,this.this_onFocusIn));
	this.addEventListener("focusOut",$bind(this,this.this_onFocusOut));
	this.addEventListener("keyDown",$bind(this,this.this_onKeyDown));
	this.addEventListener("mouseWheel",$bind(this,this.this_onMouseWheel));
};
$hxClasses["openfl.text.TextField"] = openfl_text_TextField;
openfl_text_TextField.__name__ = "openfl.text.TextField";
openfl_text_TextField.__super__ = openfl_display_InteractiveObject;
openfl_text_TextField.prototype = $extend(openfl_display_InteractiveObject.prototype,{
	condenseWhite: null
	,__wordSelection: null
	,__lineSelection: null
	,__specialSelectionInitialIndex: null
	,__bounds: null
	,__caretIndex: null
	,__cursorTimer: null
	,__dirty: null
	,__displayAsPassword: null
	,__passwordChar: null
	,__domRender: null
	,__inputEnabled: null
	,__isHTML: null
	,__layoutDirty: null
	,__mouseScrollVCounter: null
	,__mouseWheelEnabled: null
	,__offsetX: null
	,__offsetY: null
	,__selectionIndex: null
	,__showCursor: null
	,__styleSheet: null
	,__text: null
	,__htmlText: null
	,__textEngine: null
	,__textFormat: null
	,__div: null
	,__renderedOnCanvasWhileOnDOM: null
	,__forceCachedBitmapUpdate: null
	,appendText: function(text) {
		if(text == null || text == "") {
			return;
		}
		this.__dirty = true;
		this.__layoutDirty = true;
		if(!this.__renderDirty) {
			this.__renderDirty = true;
			this.__setParentRenderDirty();
		}
		this.__updateText(this.__text + text);
		this.__textEngine.textFormatRanges.get(this.__textEngine.textFormatRanges.get_length() - 1).end = this.__text.length;
		this.__selectionIndex = this.__caretIndex = this.__text.length;
	}
	,getCharBoundaries: function(charIndex) {
		if(charIndex < 0 || charIndex > this.__text.length - 1) {
			return null;
		}
		var rect = new openfl_geom_Rectangle();
		if(this.__getCharBoundaries(charIndex,rect)) {
			return rect;
		} else {
			return null;
		}
	}
	,getCharIndexAtPoint: function(x,y) {
		if(x <= 2 || x > this.get_width() + 4 || y <= 0 || y > this.get_height() + 4) {
			return -1;
		}
		this.__updateLayout();
		x += this.get_scrollH();
		var _g = 0;
		var _g1 = this.get_scrollV() - 1;
		while(_g < _g1) {
			var i = _g++;
			y += this.__textEngine.lineHeights.get(i);
		}
		var group = this.__textEngine.layoutGroups.iterator();
		while(group.hasNext()) {
			var group1 = group.next();
			if(y >= group1.offsetY && y <= group1.offsetY + group1.height) {
				if(x >= group1.offsetX && x <= group1.offsetX + group1.width) {
					var advance = 0.0;
					var _g = 0;
					var _g1 = group1.positions.length;
					while(_g < _g1) {
						var i = _g++;
						advance += group1.positions[i];
						if(x <= group1.offsetX + advance) {
							return group1.startIndex + i;
						}
					}
					return group1.endIndex;
				}
			}
		}
		return -1;
	}
	,getFirstCharInParagraph: function(charIndex) {
		if(charIndex < 0 || charIndex > this.get_text().length) {
			return -1;
		}
		if(this.__textEngine.lineBreaks.get_length() == 0) {
			return 0;
		}
		var _g = 0;
		var _g1 = this.__textEngine.lineBreaks.get_length();
		while(_g < _g1) {
			var i = _g++;
			if(charIndex <= this.__textEngine.lineBreaks.get(i)) {
				if(i == 0) {
					return 0;
				} else {
					return this.__textEngine.lineBreaks.get(i - 1) + 1;
				}
			}
		}
		return this.__textEngine.lineBreaks.get(this.__textEngine.lineBreaks.get_length() - 1) + 1;
	}
	,getLineIndexAtPoint: function(x,y) {
		this.__updateLayout();
		if(x <= 2 || x > this.get_width() + 4 || y <= 0 || y > this.get_height() + 4) {
			return -1;
		}
		var _g = 0;
		var _g1 = this.get_scrollV() - 1;
		while(_g < _g1) {
			var i = _g++;
			y += this.__textEngine.lineHeights.get(i);
		}
		var group = this.__textEngine.layoutGroups.iterator();
		while(group.hasNext()) {
			var group1 = group.next();
			if(y >= group1.offsetY && y <= group1.offsetY + group1.height) {
				return group1.lineIndex;
			}
		}
		return -1;
	}
	,getLineIndexOfChar: function(charIndex) {
		if(charIndex < 0 || charIndex > this.__text.length) {
			return -1;
		}
		this.__updateLayout();
		var group = this.__textEngine.layoutGroups.iterator();
		while(group.hasNext()) {
			var group1 = group.next();
			if(group1.startIndex <= charIndex && group1.endIndex >= charIndex) {
				return group1.lineIndex;
			}
		}
		return -1;
	}
	,getLineLength: function(lineIndex) {
		this.__updateLayout();
		if(lineIndex < 0 || lineIndex > this.__textEngine.numLines - 1) {
			return 0;
		}
		var startIndex = -1;
		var endIndex = -1;
		var group = this.__textEngine.layoutGroups.iterator();
		while(group.hasNext()) {
			var group1 = group.next();
			if(group1.lineIndex == lineIndex) {
				if(startIndex == -1) {
					startIndex = group1.startIndex;
				}
			} else if(group1.lineIndex == lineIndex + 1) {
				endIndex = group1.startIndex;
				break;
			}
		}
		if(endIndex == -1) {
			endIndex = this.__text.length;
		}
		return endIndex - startIndex;
	}
	,getLineMetrics: function(lineIndex) {
		this.__updateLayout();
		var ascender = this.__textEngine.lineAscents.get(lineIndex);
		var descender = this.__textEngine.lineDescents.get(lineIndex);
		var leading = this.__textEngine.lineLeadings.get(lineIndex);
		var lineHeight = this.__textEngine.lineHeights.get(lineIndex);
		var lineWidth = this.__textEngine.lineWidths.get(lineIndex);
		var margin;
		switch(this.__textFormat.align) {
		case 0:
			margin = (this.__textEngine.width - lineWidth) / 2;
			break;
		case 1:case 4:
			margin = this.__textEngine.width - lineWidth - 2;
			break;
		case 2:case 3:case 5:
			margin = 2;
			break;
		}
		return new openfl_text_TextLineMetrics(margin,lineWidth,lineHeight,ascender,descender,leading);
	}
	,getLineOffset: function(lineIndex) {
		this.__updateLayout();
		if(lineIndex < 0) {
			throw new openfl_errors_RangeError();
		}
		if(lineIndex > this.__textEngine.numLines - 1) {
			return -1;
		}
		var group = this.__textEngine.layoutGroups.iterator();
		while(group.hasNext()) {
			var group1 = group.next();
			if(group1.lineIndex == lineIndex) {
				return group1.startIndex;
			}
		}
		return 0;
	}
	,getLineText: function(lineIndex) {
		this.__updateLayout();
		if(lineIndex < 0) {
			throw new openfl_errors_RangeError();
		}
		if(lineIndex > this.__textEngine.numLines - 1) {
			return null;
		}
		var startIndex = -1;
		var endIndex = -1;
		var group = this.__textEngine.layoutGroups.iterator();
		while(group.hasNext()) {
			var group1 = group.next();
			if(group1.lineIndex == lineIndex) {
				if(startIndex == -1) {
					startIndex = group1.startIndex;
				}
			} else if(group1.lineIndex == lineIndex + 1) {
				endIndex = group1.startIndex;
				break;
			}
		}
		if(endIndex == -1) {
			endIndex = this.__text.length;
		}
		return this.__textEngine.text.substring(startIndex,endIndex);
	}
	,getParagraphLength: function(charIndex) {
		if(charIndex < 0 || charIndex > this.get_text().length) {
			return -1;
		}
		var startIndex = this.getFirstCharInParagraph(charIndex);
		if(charIndex >= this.get_text().length) {
			return this.get_text().length - startIndex + 1;
		}
		var endIndex = this.__textEngine.getLineBreakIndex(charIndex) + 1;
		if(endIndex == 0) {
			endIndex = this.__text.length;
		}
		return endIndex - startIndex;
	}
	,getTextFormat: function(beginIndex,endIndex) {
		if(endIndex == null) {
			endIndex = -1;
		}
		if(beginIndex == null) {
			beginIndex = -1;
		}
		var format = null;
		if(beginIndex >= this.get_text().length || beginIndex < -1 || endIndex > this.get_text().length || endIndex < -1) {
			throw new openfl_errors_RangeError("The supplied index is out of bounds");
		}
		if(beginIndex == -1) {
			beginIndex = 0;
		}
		if(endIndex == -1) {
			endIndex = this.get_text().length;
		}
		if(beginIndex >= endIndex) {
			return new openfl_text_TextFormat();
		}
		var group = this.__textEngine.textFormatRanges.iterator();
		while(group.hasNext()) {
			var group1 = group.next();
			if(group1.start <= beginIndex && group1.end > beginIndex || group1.start < endIndex && group1.end >= endIndex) {
				if(format == null) {
					format = group1.format.clone();
				} else {
					if(group1.format.font != format.font) {
						format.set_font(null);
					}
					if(group1.format.size != format.size) {
						format.set_size(null);
					}
					if(group1.format.color != format.color) {
						format.color = null;
					}
					if(group1.format.bold != format.bold) {
						format.set_bold(null);
					}
					if(group1.format.italic != format.italic) {
						format.set_italic(null);
					}
					if(group1.format.underline != format.underline) {
						format.underline = null;
					}
					if(group1.format.url != format.url) {
						format.url = null;
					}
					if(group1.format.target != format.target) {
						format.target = null;
					}
					if(group1.format.align != format.align) {
						format.align = null;
					}
					if(group1.format.leftMargin != format.leftMargin) {
						format.leftMargin = null;
					}
					if(group1.format.rightMargin != format.rightMargin) {
						format.rightMargin = null;
					}
					if(group1.format.indent != format.indent) {
						format.indent = null;
					}
					if(group1.format.leading != format.leading) {
						format.leading = null;
					}
					if(group1.format.blockIndent != format.blockIndent) {
						format.blockIndent = null;
					}
					if(group1.format.bullet != format.bullet) {
						format.bullet = null;
					}
					if(group1.format.kerning != format.kerning) {
						format.kerning = null;
					}
					if(group1.format.letterSpacing != format.letterSpacing) {
						format.letterSpacing = null;
					}
					if(group1.format.tabStops != format.tabStops) {
						format.tabStops = null;
					}
				}
			}
		}
		if(format == null) {
			format = new openfl_text_TextFormat();
		}
		return format;
	}
	,replaceSelectedText: function(value) {
		this.__replaceSelectedText(value,false);
	}
	,replaceText: function(beginIndex,endIndex,newText) {
		this.__replaceText(beginIndex,endIndex,newText,false);
	}
	,setSelection: function(beginIndex,endIndex) {
		this.__selectionIndex = beginIndex;
		this.__caretIndex = endIndex;
		this.__updateScrollV();
		this.__updateScrollH();
		if(this.stage != null && this.stage.get_focus() == this) {
			this.__stopCursorTimer();
			this.__startCursorTimer();
		}
	}
	,setTextFormat: function(format,beginIndex,endIndex) {
		if(endIndex == null) {
			endIndex = -1;
		}
		if(beginIndex == null) {
			beginIndex = -1;
		}
		var max = this.get_text().length;
		var range;
		if(beginIndex == -1) {
			if(endIndex == -1) {
				endIndex = max;
			}
			beginIndex = 0;
		} else if(endIndex == -1) {
			endIndex = beginIndex + 1;
		}
		if(beginIndex == endIndex) {
			return;
		}
		if(beginIndex < 0 || endIndex <= 0 || endIndex < beginIndex || beginIndex >= max || endIndex > max) {
			throw new openfl_errors_RangeError();
		}
		if(beginIndex == 0 && endIndex == max) {
			this.__textEngine.textFormatRanges.set_length(1);
			range = this.__textEngine.textFormatRanges.get(0);
			range.start = 0;
			range.end = max;
			range.format.__merge(format);
		} else {
			var index = 0;
			var newRange;
			while(index < this.__textEngine.textFormatRanges.get_length()) {
				range = this.__textEngine.textFormatRanges.get(index);
				if(range.end <= beginIndex) {
					++index;
				} else if(range.start >= endIndex) {
					break;
				} else if(range.start <= beginIndex && range.end >= endIndex) {
					if(range.start == beginIndex && range.end == endIndex) {
						range.format = range.format.clone();
						range.format.__merge(format);
						break;
					} else if(range.start == beginIndex) {
						newRange = new openfl_text__$internal_TextFormatRange(range.format.clone(),beginIndex,endIndex);
						newRange.format.__merge(format);
						this.__textEngine.textFormatRanges.insertAt(index,newRange);
						range.start = endIndex;
						index += 2;
					} else if(range.end == endIndex) {
						newRange = new openfl_text__$internal_TextFormatRange(range.format.clone(),beginIndex,endIndex);
						newRange.format.__merge(format);
						this.__textEngine.textFormatRanges.insertAt(index + 1,newRange);
						range.end = beginIndex;
						break;
					} else {
						newRange = new openfl_text__$internal_TextFormatRange(range.format.clone(),beginIndex,endIndex);
						newRange.format.__merge(format);
						this.__textEngine.textFormatRanges.insertAt(index + 1,newRange);
						newRange = new openfl_text__$internal_TextFormatRange(range.format.clone(),endIndex,range.end);
						this.__textEngine.textFormatRanges.insertAt(index + 2,newRange);
						range.end = beginIndex;
						break;
					}
				} else if(range.start >= beginIndex && range.end <= endIndex) {
					if(range.start == beginIndex) {
						range.format = range.format.clone();
						range.format.__merge(format);
						range.end = endIndex;
					} else {
						this.__textEngine.textFormatRanges.removeAt(index);
					}
				} else if(range.start > beginIndex && range.end > beginIndex) {
					range.start = endIndex;
					break;
				} else if(range.start < beginIndex && range.end <= endIndex) {
					newRange = new openfl_text__$internal_TextFormatRange(range.format.clone(),beginIndex,endIndex);
					newRange.format.__merge(format);
					this.__textEngine.textFormatRanges.insertAt(index + 1,newRange);
					range.end = beginIndex;
					index += 2;
				} else {
					++index;
					lime_utils_Log.warn("You found a bug in OpenFL's text code! Please save a copy of your project and create an issue on GitHub so we can fix this.",{ fileName : "openfl/text/TextField.hx", lineNumber : 1630, className : "openfl.text.TextField", methodName : "setTextFormat"});
				}
			}
		}
		this.__dirty = true;
		this.__layoutDirty = true;
		if(!this.__renderDirty) {
			this.__renderDirty = true;
			this.__setParentRenderDirty();
		}
	}
	,__setStageReference: function(stage) {
		this.__stopTextInput();
		openfl_display_InteractiveObject.prototype.__setStageReference.call(this,stage);
	}
	,__allowMouseFocus: function() {
		return this.mouseEnabled;
	}
	,__caretBeginningOfLine: function() {
		this.__caretIndex = this.getLineOffset(this.getLineIndexOfChar(this.__caretIndex));
	}
	,__caretBeginningOfNextLine: function() {
		var lineIndex = this.getLineIndexOfChar(this.__caretIndex);
		if(lineIndex < this.__textEngine.numLines - 1) {
			this.__caretIndex = this.getLineOffset(lineIndex + 1);
		} else {
			this.__caretIndex = this.__text.length;
		}
	}
	,__caretBeginningOfPreviousLine: function() {
		var lineIndex = this.getLineIndexOfChar(this.__caretIndex);
		if(lineIndex > 0) {
			var index = this.getLineOffset(this.getLineIndexOfChar(this.__caretIndex));
			if(this.__caretIndex == index) {
				this.__caretIndex = this.getLineOffset(lineIndex - 1);
			} else {
				this.__caretIndex = index;
			}
		}
	}
	,__caretEndOfLine: function() {
		var lineIndex = this.getLineIndexOfChar(this.__caretIndex);
		if(lineIndex < this.__textEngine.numLines - 1) {
			this.__caretIndex = this.getLineOffset(lineIndex + 1) - 1;
		} else {
			this.__caretIndex = this.__text.length;
		}
	}
	,__caretNextCharacter: function() {
		if(this.__caretIndex < this.__text.length) {
			this.__caretIndex++;
		}
	}
	,__caretNextLine: function() {
		var lineIndex = this.getLineIndexOfChar(this.__caretIndex);
		if(lineIndex < this.__textEngine.numLines - 1) {
			this.__caretIndex = this.__getCharIndexOnDifferentLine(this.get_caretIndex(),lineIndex + 1);
		}
	}
	,__caretPreviousCharacter: function() {
		if(this.__caretIndex > 0) {
			this.__caretIndex--;
		}
	}
	,__caretPreviousLine: function() {
		var lineIndex = this.getLineIndexOfChar(this.__caretIndex);
		if(lineIndex > 0) {
			this.__caretIndex = this.__getCharIndexOnDifferentLine(this.get_caretIndex(),lineIndex - 1);
		}
	}
	,__disableInput: function() {
		if(this.__inputEnabled && this.stage != null) {
			this.stage.window.__backend.setTextInputEnabled(false);
			this.stage.window.onTextInput.remove($bind(this,this.window_onTextInput));
			this.stage.window.onKeyDown.remove($bind(this,this.window_onKeyDown));
			this.__inputEnabled = false;
			this.__stopCursorTimer();
		}
	}
	,__dispatch: function(event) {
		if(event.eventPhase == 2 && event.type == "mouseUp") {
			var event1 = event;
			var group = this.__getGroup(this.get_mouseX(),this.get_mouseY(),true);
			if(group != null) {
				var url = group.format.url;
				if(url != null && url != "") {
					if(StringTools.startsWith(url,"event:")) {
						this.dispatchEvent(new openfl_events_TextEvent("link",true,false,HxOverrides.substr(url,6,null)));
					} else {
						openfl_Lib.getURL(new openfl_net_URLRequest(url));
					}
				}
			}
		}
		return openfl_display_InteractiveObject.prototype.__dispatch.call(this,event);
	}
	,__enableInput: function() {
		if(this.stage != null) {
			this.stage.window.__backend.setTextInputEnabled(true);
			var bounds = this.getBounds(this.stage);
			var limeRect = new lime_math_Rectangle(bounds.x,bounds.y,bounds.width,bounds.height);
			this.stage.window.setTextInputRect(limeRect);
			if(!this.__inputEnabled) {
				this.stage.window.__backend.setTextInputEnabled(true);
				if(!this.stage.window.onTextInput.has($bind(this,this.window_onTextInput))) {
					this.stage.window.onTextInput.add($bind(this,this.window_onTextInput));
					this.stage.window.onKeyDown.add($bind(this,this.window_onKeyDown));
				}
				this.__inputEnabled = true;
				this.__stopCursorTimer();
				this.__startCursorTimer();
			}
		}
	}
	,__getAdvance: function(position) {
		return position;
	}
	,__getBounds: function(rect,matrix) {
		this.__updateLayout();
		var bounds = openfl_geom_Rectangle.__pool.get();
		bounds.copyFrom(this.__textEngine.bounds);
		bounds.offset(this.__offsetX,this.__offsetY);
		bounds.__transform(bounds,matrix);
		rect.__expand(bounds.x,bounds.y,bounds.width,bounds.height);
		openfl_geom_Rectangle.__pool.release(bounds);
	}
	,__getCharBoundaries: function(charIndex,rect) {
		if(charIndex < 0 || charIndex > this.__text.length - 1) {
			return false;
		}
		this.__updateLayout();
		var group = this.__textEngine.layoutGroups.iterator();
		while(group.hasNext()) {
			var group1 = group.next();
			if(charIndex >= group1.startIndex && charIndex < group1.endIndex) {
				try {
					var x = group1.offsetX;
					var _g = 0;
					var _g1 = charIndex - group1.startIndex;
					while(_g < _g1) {
						var i = _g++;
						x += group1.positions[i];
					}
					var lastPosition = group1.positions[charIndex - group1.startIndex];
					rect.setTo(x,group1.offsetY,lastPosition,group1.ascent + group1.descent);
					return true;
				} catch( _g2 ) {
					haxe_NativeStackTrace.lastError = _g2;
				}
			}
		}
		return false;
	}
	,__getCharIndexOnDifferentLine: function(charIndex,lineIndex) {
		if(charIndex < 0 || charIndex > this.__text.length) {
			return -1;
		}
		if(lineIndex < 0 || lineIndex > this.__textEngine.numLines - 1) {
			return -1;
		}
		var x = null;
		var y = null;
		var group = this.__textEngine.layoutGroups.iterator();
		while(group.hasNext()) {
			var group1 = group.next();
			if(charIndex >= group1.startIndex && charIndex <= group1.endIndex) {
				x = group1.offsetX;
				var _g = 0;
				var _g1 = charIndex - group1.startIndex;
				while(_g < _g1) {
					var i = _g++;
					x += group1.positions[i];
				}
				if(y != null) {
					return this.__getPosition(x,y);
				}
			}
			if(group1.lineIndex == lineIndex) {
				y = group1.offsetY + group1.height / 2;
				var _g2 = 0;
				var _g3 = this.get_scrollV() - 1;
				while(_g2 < _g3) {
					var i1 = _g2++;
					y -= this.__textEngine.lineHeights.get(i1);
				}
				if(x != null) {
					return this.__getPosition(x,y);
				}
			}
		}
		return -1;
	}
	,__getCursor: function() {
		var group = this.__getGroup(this.get_mouseX(),this.get_mouseY(),true);
		if(group != null && group.format.url != "") {
			return "button";
		} else if(this.__textEngine.selectable) {
			return "ibeam";
		}
		return null;
	}
	,__getGroup: function(x,y,precise) {
		if(precise == null) {
			precise = false;
		}
		this.__updateLayout();
		x += this.get_scrollH();
		var _g = 0;
		var _g1 = this.get_scrollV() - 1;
		while(_g < _g1) {
			var i = _g++;
			y += this.__textEngine.lineHeights.get(i);
		}
		if(!precise && y > this.__textEngine.textHeight) {
			y = this.__textEngine.textHeight;
		}
		var firstGroup = true;
		var group;
		var nextGroup;
		var _g = 0;
		var _g1 = this.__textEngine.layoutGroups.get_length();
		while(_g < _g1) {
			var i = _g++;
			group = this.__textEngine.layoutGroups.get(i);
			if(i < this.__textEngine.layoutGroups.get_length() - 1) {
				nextGroup = this.__textEngine.layoutGroups.get(i + 1);
			} else {
				nextGroup = null;
			}
			if(firstGroup) {
				if(y < group.offsetY) {
					y = group.offsetY;
				}
				if(x < group.offsetX) {
					x = group.offsetX;
				}
				firstGroup = false;
			}
			if(y >= group.offsetY && y <= group.offsetY + group.height || !precise && nextGroup == null) {
				if(x >= group.offsetX && x <= group.offsetX + group.width || !precise && (nextGroup == null || nextGroup.lineIndex != group.lineIndex)) {
					return group;
				}
			}
		}
		return null;
	}
	,__getPosition: function(x,y) {
		var group = this.__getGroup(x,y);
		if(group == null) {
			return this.__text.length;
		}
		var advance = 0.0;
		var _g = 0;
		var _g1 = group.positions.length;
		while(_g < _g1) {
			var i = _g++;
			advance += group.positions[i];
			if(x <= group.offsetX + advance) {
				if(x <= group.offsetX + (advance - group.positions[i]) + group.positions[i] / 2) {
					return group.startIndex + i;
				} else if(group.startIndex + i < group.endIndex) {
					return group.startIndex + i + 1;
				} else {
					return group.endIndex;
				}
			}
		}
		return group.endIndex;
	}
	,__getPositionByIdentifier: function(x,y,line) {
		var position = this.__getPosition(x,y);
		var delimiters = line ? "\n" : " .,;:!?()[]{}<>/\\|-=+*&^%$#@~`'\"\n";
		var char = this.__text.charAt(position);
		if(this.__specialSelectionInitialIndex <= position) {
			while(delimiters.indexOf(char) == -1 && position < this.__text.length) {
				++position;
				char = this.__text.charAt(position);
			}
		} else {
			while(delimiters.indexOf(char) == -1 && position > 0) {
				--position;
				char = this.__text.charAt(position);
			}
			if(position == 0) {
				return position;
			}
			++position;
		}
		return position;
	}
	,__getOppositeIdentifierBound: function(charIndex,line) {
		var position = charIndex;
		var delimiters = line ? "\n" : " .,;:!?()[]{}<>/\\|-=+*&^%$#@~`'\"\n";
		var char = this.__text.charAt(position);
		if(position <= this.__caretIndex) {
			if(position == 0) {
				return position;
			}
			do {
				--position;
				char = this.__text.charAt(position);
			} while(delimiters.indexOf(char) == -1 && position > 0);
			if(position == 0) {
				return position;
			}
			++position;
		} else {
			while(delimiters.indexOf(char) == -1 && position < this.__text.length) {
				++position;
				char = this.__text.charAt(position);
			}
		}
		return position;
	}
	,__hitTest: function(x,y,shapeFlag,stack,interactiveOnly,hitObject) {
		if(!hitObject.get_visible() || this.__isMask || interactiveOnly && !this.mouseEnabled) {
			return false;
		}
		if(this.get_mask() != null && !this.get_mask().__hitTestMask(x,y)) {
			return false;
		}
		this.__getRenderTransform();
		this.__updateLayout();
		var _this = this.__renderTransform;
		var norm = _this.a * _this.d - _this.b * _this.c;
		var px = norm == 0 ? -_this.tx : 1.0 / norm * (_this.c * (_this.ty - y) + _this.d * (x - _this.tx));
		var _this = this.__renderTransform;
		var norm = _this.a * _this.d - _this.b * _this.c;
		var py = norm == 0 ? -_this.ty : 1.0 / norm * (_this.a * (y - _this.ty) + _this.b * (_this.tx - x));
		if(this.__textEngine.bounds.contains(px,py)) {
			if(stack != null) {
				stack.push(hitObject);
			}
			return true;
		}
		return false;
	}
	,__hitTestMask: function(x,y) {
		this.__getRenderTransform();
		this.__updateLayout();
		var _this = this.__renderTransform;
		var norm = _this.a * _this.d - _this.b * _this.c;
		var px = norm == 0 ? -_this.tx : 1.0 / norm * (_this.c * (_this.ty - y) + _this.d * (x - _this.tx));
		var _this = this.__renderTransform;
		var norm = _this.a * _this.d - _this.b * _this.c;
		var py = norm == 0 ? -_this.ty : 1.0 / norm * (_this.a * (y - _this.ty) + _this.b * (_this.tx - x));
		if(this.__textEngine.bounds.contains(px,py)) {
			return true;
		}
		return false;
	}
	,__replaceSelectedText: function(value,restrict) {
		if(restrict == null) {
			restrict = true;
		}
		if(value == null) {
			value = "";
		}
		if(value == "" && this.__selectionIndex == this.__caretIndex) {
			return;
		}
		var startIndex = this.__caretIndex < this.__selectionIndex ? this.__caretIndex : this.__selectionIndex;
		var endIndex = this.__caretIndex > this.__selectionIndex ? this.__caretIndex : this.__selectionIndex;
		if(startIndex == endIndex && this.__textEngine.maxChars > 0 && this.__text.length == this.__textEngine.maxChars) {
			return;
		}
		if(startIndex > this.__text.length) {
			startIndex = this.__text.length;
		}
		if(endIndex > this.__text.length) {
			endIndex = this.__text.length;
		}
		if(endIndex < startIndex) {
			var cache = endIndex;
			endIndex = startIndex;
			startIndex = cache;
		}
		if(startIndex < 0) {
			startIndex = 0;
		}
		this.__replaceText(startIndex,endIndex,value,restrict);
	}
	,__replaceText: function(beginIndex,endIndex,newText,restrict) {
		if(endIndex < beginIndex || beginIndex < 0 || endIndex > this.__text.length || newText == null) {
			return;
		}
		if(restrict) {
			newText = this.__textEngine.restrictText(newText);
			if(this.__textEngine.maxChars > 0) {
				var removeLength = endIndex - beginIndex;
				var maxLength = this.__textEngine.maxChars - this.__text.length + removeLength;
				if(maxLength <= 0) {
					newText = "";
				} else if(maxLength < newText.length) {
					newText = HxOverrides.substr(newText,0,maxLength);
				}
			}
		}
		this.__updateText(this.__text.substring(0,beginIndex) + newText + this.__text.substring(endIndex));
		var offset = newText.length - (endIndex - beginIndex);
		var i = 0;
		var range;
		while(i < this.__textEngine.textFormatRanges.get_length()) {
			range = this.__textEngine.textFormatRanges.get(i);
			if(beginIndex == endIndex) {
				if(range.start == range.end) {
					if(range.start != 0) {
						lime_utils_Log.warn("You found a bug in OpenFL's text code! Please save a copy of your project and create an issue on GitHub so we can fix this.",{ fileName : "openfl/text/TextField.hx", lineNumber : 2211, className : "openfl.text.TextField", methodName : "__replaceText"});
					} else {
						range.end += offset;
					}
				} else if(range.end >= beginIndex) {
					if(range.start >= beginIndex) {
						range.start += offset;
						range.end += offset;
					} else if(range.start < beginIndex && range.end >= endIndex) {
						range.end += offset;
					}
				}
			} else if(range.end > beginIndex) {
				if(range.start > endIndex) {
					range.start += offset;
					range.end += offset;
				} else if(range.start <= beginIndex && range.end > endIndex) {
					range.end += offset;
				} else if(range.start >= beginIndex && range.end <= endIndex) {
					var this1 = this.__textEngine.textFormatRanges;
					this1.__tempIndex = i--;
					var _g_current = 0;
					var _g_args = [];
					while(_g_current < _g_args.length) {
						var item = _g_args[_g_current++];
						this1.insertAt(this1.__tempIndex,item);
						this1.__tempIndex++;
					}
					this1.splice(this1.__tempIndex,1);
				} else if(range.end > endIndex && range.start > beginIndex && range.start <= endIndex) {
					range.start = beginIndex;
					range.end += offset;
				} else if(range.start < beginIndex && range.end > beginIndex && range.end <= endIndex) {
					range.end = beginIndex;
				}
			}
			++i;
		}
		if(this.__textEngine.textFormatRanges.get_length() == 0) {
			this.__textEngine.textFormatRanges.push(new openfl_text__$internal_TextFormatRange(this.get_defaultTextFormat().clone(),0,newText.length));
		} else if(beginIndex == endIndex && this.__textEngine.textFormatRanges.get(0).start > 0) {
			this.__textEngine.textFormatRanges.unshift(new openfl_text__$internal_TextFormatRange(this.get_defaultTextFormat().clone(),0,this.__textEngine.textFormatRanges.get(0).start));
		} else if(beginIndex != endIndex && this.__textEngine.textFormatRanges.get(this.__textEngine.textFormatRanges.get_length() - 1).end < this.__text.length) {
			this.__textEngine.textFormatRanges.push(new openfl_text__$internal_TextFormatRange(this.get_defaultTextFormat().clone(),this.__textEngine.textFormatRanges.get(this.__textEngine.textFormatRanges.get_length() - 1).end,this.__text.length));
		}
		this.__selectionIndex = this.__caretIndex = beginIndex + newText.length;
		this.__dirty = true;
		this.__layoutDirty = true;
		if(!this.__renderDirty) {
			this.__renderDirty = true;
			this.__setParentRenderDirty();
		}
	}
	,__startCursorTimer: function() {
		if(this.get_type() == 1) {
			if(this.__inputEnabled) {
				this.__cursorTimer = haxe_Timer.delay($bind(this,this.__startCursorTimer),600);
				this.__showCursor = !this.__showCursor;
			}
			this.__dirty = true;
			if(!this.__renderDirty) {
				this.__renderDirty = true;
				this.__setParentRenderDirty();
			}
		} else if(this.get_selectable()) {
			this.__dirty = true;
			if(!this.__renderDirty) {
				this.__renderDirty = true;
				this.__setParentRenderDirty();
			}
		}
	}
	,__startTextInput: function() {
		if(this.__caretIndex < 0) {
			this.__caretIndex = this.__text.length;
			this.__selectionIndex = this.__caretIndex;
		}
		var enableInput = openfl_display_DisplayObject.__supportDOM ? this.__renderedOnCanvasWhileOnDOM : true;
		if(enableInput) {
			this.__enableInput();
		}
	}
	,__stopCursorTimer: function() {
		if(this.__cursorTimer != null) {
			this.__cursorTimer.stop();
			this.__cursorTimer = null;
		}
		if(this.__showCursor) {
			this.__showCursor = false;
			this.__dirty = true;
			if(!this.__renderDirty) {
				this.__renderDirty = true;
				this.__setParentRenderDirty();
			}
		}
	}
	,__stopTextInput: function() {
		var disableInput = openfl_display_DisplayObject.__supportDOM ? this.__renderedOnCanvasWhileOnDOM : true;
		if(disableInput) {
			this.__disableInput();
		}
	}
	,__updateLayout: function() {
		if(this.__layoutDirty) {
			var cacheWidth = this.__textEngine.width;
			this.__textEngine.update();
			if(this.__textEngine.autoSize != 2) {
				if(this.__textEngine.width != cacheWidth) {
					switch(this.__textEngine.autoSize) {
					case 0:
						this.set_x(this.get_x() + (cacheWidth - this.__textEngine.width) / 2);
						break;
					case 3:
						this.set_x(this.get_x() + (cacheWidth - this.__textEngine.width));
						break;
					default:
					}
				}
				this.__textEngine.getBounds();
			}
			this.__layoutDirty = false;
			this.setSelection(this.__selectionIndex,this.__caretIndex);
		}
	}
	,__updateMouseDrag: function() {
		if(this.stage == null) {
			return;
		}
		var oldScrollH = this.get_scrollH();
		var oldScrollV = this.get_scrollV();
		var bounds = this.getBounds(this);
		if(this.get_mouseX() > bounds.width - 1) {
			this.set_scrollH(this.get_scrollH() + (Math.max(Math.min((this.get_mouseX() - bounds.width) * .1,10),1) | 0));
		} else if(this.get_mouseX() < 1) {
			this.set_scrollH(this.get_scrollH() - (Math.max(Math.min(this.get_mouseX() * -.1,10),1) | 0));
		}
		this.__mouseScrollVCounter++;
		if(this.__mouseScrollVCounter > this.stage.get_frameRate() / 10) {
			if(this.get_mouseY() > bounds.height - 2) {
				this.set_scrollV(Math.min(this.get_scrollV() + Math.max(Math.min((this.get_mouseY() - bounds.height) * .03,5),1),this.get_maxScrollV()) | 0);
			} else if(this.get_mouseY() < 2) {
				this.set_scrollV(this.get_scrollV() - (Math.max(Math.min(this.get_mouseY() * -.03,5),1) | 0));
			}
			this.__mouseScrollVCounter = 0;
		}
		if(this.get_scrollH() != oldScrollH || this.get_scrollV() != oldScrollV) {
			this.stage_onMouseMove(null);
		}
	}
	,__updateScrollH: function() {
		this.__updateLayout();
		var bounds = this.getBounds(this);
		if(this.get_textWidth() <= bounds.width - 4) {
			this.set_scrollH(0);
			return;
		}
		var tempScrollH = this.get_scrollH();
		if(this.__caretIndex == 0 || this.getLineOffset(this.getLineIndexOfChar(this.__caretIndex)) == this.__caretIndex) {
			tempScrollH = 0;
		} else {
			var caret = openfl_geom_Rectangle.__pool.get();
			var written = false;
			if(this.__caretIndex < this.__text.length) {
				written = this.__getCharBoundaries(this.__caretIndex,caret);
			}
			if(!written) {
				this.__getCharBoundaries(this.__caretIndex - 1,caret);
				caret.x += caret.width;
			}
			while(caret.x < tempScrollH && tempScrollH > 0) tempScrollH -= 24;
			while(caret.x > tempScrollH + bounds.width - 4) tempScrollH += 24;
			openfl_geom_Rectangle.__pool.release(caret);
		}
		if(tempScrollH > 0 && this.get_type() != 1) {
			var lineLength = this.getLineLength(this.getLineIndexOfChar(this.__caretIndex));
			if(this.get_scrollH() + bounds.width - 4 > lineLength) {
				this.set_scrollH(Math.ceil(lineLength - bounds.width + 4));
			}
		}
		if(tempScrollH < 0) {
			this.set_scrollH(0);
		} else if(tempScrollH > this.get_maxScrollH()) {
			this.set_scrollH(this.get_maxScrollH());
		} else {
			this.set_scrollH(tempScrollH);
		}
	}
	,__updateScrollV: function() {
		this.__updateLayout();
		if(this.get_textHeight() <= this.get_height() - 4) {
			this.set_scrollV(1);
			return;
		}
		var lineIndex = this.getLineIndexOfChar(this.__caretIndex);
		if(lineIndex == -1 && this.__caretIndex > 0) {
			lineIndex = this.getLineIndexOfChar(this.__caretIndex - 1) + 1;
		}
		if(lineIndex + 1 < this.get_scrollV()) {
			this.set_scrollV(lineIndex + 1);
		} else if(lineIndex + 1 > this.get_bottomScrollV()) {
			var i = lineIndex;
			var tempHeight = 0.0;
			if(i >= this.__textEngine.lineHeights.get_length()) {
				i = this.__textEngine.lineHeights.get_length() - 1;
			}
			while(i >= 0) {
				tempHeight += this.__textEngine.lineHeights.get(i);
				if(tempHeight > this.get_height() - 4) {
					i += tempHeight - this.get_height() < 0 ? 1 : 2;
					break;
				}
				--i;
			}
			this.set_scrollV(i);
		} else {
			this.set_scrollV(this.get_scrollV());
		}
	}
	,__updateText: function(value) {
		if(openfl_display_DisplayObject.__supportDOM && this.__renderedOnCanvasWhileOnDOM) {
			this.__forceCachedBitmapUpdate = this.__text != value;
		}
		this.__textEngine.set_text(value);
		this.__text = this.__textEngine.text;
		if(this.stage != null && this.stage.get_focus() == this) {
			if(this.__text.length < this.__selectionIndex) {
				this.__selectionIndex = this.__text.length;
			}
			if(this.__text.length < this.__caretIndex) {
				this.__caretIndex = this.__text.length;
			}
		} else if(this.__isHTML) {
			this.__selectionIndex = this.__caretIndex = this.__text.length;
		} else {
			this.__selectionIndex = 0;
			this.__caretIndex = 0;
		}
		if(!this.__displayAsPassword || openfl_display_DisplayObject.__supportDOM && !this.__renderedOnCanvasWhileOnDOM) {
			this.__textEngine.set_text(this.__text);
		} else {
			var length = this.get_text().length;
			var mask = "";
			var _g = 0;
			var _g1 = length;
			while(_g < _g1) {
				var i = _g++;
				mask += this.__passwordChar;
			}
			this.__textEngine.set_text(mask);
		}
	}
	,__updateTransforms: function(overrideTransform) {
		openfl_display_InteractiveObject.prototype.__updateTransforms.call(this,overrideTransform);
		var _this = this.__renderTransform;
		var px = this.__offsetX;
		var py = this.__offsetY;
		_this.tx = px * _this.a + py * _this.c + _this.tx;
		_this.ty = px * _this.b + py * _this.d + _this.ty;
	}
	,get_antiAliasType: function() {
		return this.__textEngine.antiAliasType;
	}
	,set_antiAliasType: function(value) {
		var tmp = value != this.__textEngine.antiAliasType;
		return this.__textEngine.antiAliasType = value;
	}
	,get_autoSize: function() {
		return this.__textEngine.autoSize;
	}
	,set_autoSize: function(value) {
		if(value != this.__textEngine.autoSize) {
			this.__dirty = true;
			this.__layoutDirty = true;
			if(!this.__renderDirty) {
				this.__renderDirty = true;
				this.__setParentRenderDirty();
			}
		}
		return this.__textEngine.autoSize = value;
	}
	,get_background: function() {
		return this.__textEngine.background;
	}
	,set_background: function(value) {
		if(value != this.__textEngine.background) {
			this.__dirty = true;
			if(!this.__renderDirty) {
				this.__renderDirty = true;
				this.__setParentRenderDirty();
			}
		}
		return this.__textEngine.background = value;
	}
	,get_backgroundColor: function() {
		return this.__textEngine.backgroundColor;
	}
	,set_backgroundColor: function(value) {
		if(value != this.__textEngine.backgroundColor) {
			this.__dirty = true;
			if(!this.__renderDirty) {
				this.__renderDirty = true;
				this.__setParentRenderDirty();
			}
		}
		return this.__textEngine.backgroundColor = value;
	}
	,get_border: function() {
		return this.__textEngine.border;
	}
	,set_border: function(value) {
		if(value != this.__textEngine.border) {
			this.__dirty = true;
			if(!this.__renderDirty) {
				this.__renderDirty = true;
				this.__setParentRenderDirty();
			}
		}
		return this.__textEngine.border = value;
	}
	,get_borderColor: function() {
		return this.__textEngine.borderColor;
	}
	,set_borderColor: function(value) {
		if(value != this.__textEngine.borderColor) {
			this.__dirty = true;
			if(!this.__renderDirty) {
				this.__renderDirty = true;
				this.__setParentRenderDirty();
			}
		}
		return this.__textEngine.borderColor = value;
	}
	,get_bottomScrollV: function() {
		this.__updateLayout();
		return this.__textEngine.get_bottomScrollV();
	}
	,get_caretIndex: function() {
		return this.__caretIndex;
	}
	,get_defaultTextFormat: function() {
		return this.__textFormat.clone();
	}
	,set_defaultTextFormat: function(value) {
		this.__textFormat.__merge(value);
		this.__layoutDirty = true;
		this.__dirty = true;
		if(!this.__renderDirty) {
			this.__renderDirty = true;
			this.__setParentRenderDirty();
		}
		return value;
	}
	,get_displayAsPassword: function() {
		return this.__displayAsPassword;
	}
	,set_displayAsPassword: function(value) {
		if(value != this.__displayAsPassword) {
			this.__dirty = true;
			this.__layoutDirty = true;
			if(!this.__renderDirty) {
				this.__renderDirty = true;
				this.__setParentRenderDirty();
			}
			this.__displayAsPassword = value;
			this.__updateText(this.__text);
		}
		return value;
	}
	,get_embedFonts: function() {
		return this.__textEngine.embedFonts;
	}
	,set_embedFonts: function(value) {
		return this.__textEngine.embedFonts = value;
	}
	,get_gridFitType: function() {
		return this.__textEngine.gridFitType;
	}
	,set_gridFitType: function(value) {
		return this.__textEngine.gridFitType = value;
	}
	,get_height: function() {
		this.__updateLayout();
		return this.__textEngine.height * Math.abs(this.get_scaleY());
	}
	,set_height: function(value) {
		if(value != this.__textEngine.height) {
			this.__setTransformDirty();
			this.__dirty = true;
			this.__layoutDirty = true;
			if(!this.__renderDirty) {
				this.__renderDirty = true;
				this.__setParentRenderDirty();
			}
			this.__textEngine.height = value;
		}
		return this.__textEngine.height * Math.abs(this.get_scaleY());
	}
	,get_htmlText: function() {
		if(this.__isHTML) {
			return this.__htmlText;
		} else {
			return this.__text;
		}
	}
	,set_htmlText: function(value) {
		if(value == null) {
			var error = new openfl_errors_TypeError("Error #2007: Parameter text must be non-null.");
			error.errorID = 2007;
			throw error;
		}
		if(!this.__isHTML || this.__text != value) {
			this.__dirty = true;
			this.__layoutDirty = true;
			if(!this.__renderDirty) {
				this.__renderDirty = true;
				this.__setParentRenderDirty();
			}
		}
		this.__isHTML = true;
		if(this.condenseWhite) {
			var _this_r = new RegExp("\\s+","g".split("u").join(""));
			value = value.replace(_this_r," ");
		}
		this.__htmlText = value;
		value = openfl_text__$internal_HTMLParser.parse(value,this.get_multiline(),this.__styleSheet,this.__textFormat,this.__textEngine.textFormatRanges);
		this.__updateText(value);
		return value;
	}
	,get_length: function() {
		if(this.__text != null) {
			return this.__text.length;
		}
		return 0;
	}
	,get_maxChars: function() {
		return this.__textEngine.maxChars;
	}
	,set_maxChars: function(value) {
		if(value != this.__textEngine.maxChars) {
			this.__textEngine.maxChars = value;
			this.__dirty = true;
			this.__layoutDirty = true;
			if(!this.__renderDirty) {
				this.__renderDirty = true;
				this.__setParentRenderDirty();
			}
		}
		return value;
	}
	,get_maxScrollH: function() {
		this.__updateLayout();
		return this.__textEngine.maxScrollH;
	}
	,get_maxScrollV: function() {
		this.__updateLayout();
		return this.__textEngine.get_maxScrollV();
	}
	,get_mouseWheelEnabled: function() {
		return this.__mouseWheelEnabled;
	}
	,set_mouseWheelEnabled: function(value) {
		return this.__mouseWheelEnabled = value;
	}
	,get_multiline: function() {
		return this.__textEngine.multiline;
	}
	,set_multiline: function(value) {
		return this.__textEngine.multiline = value;
	}
	,get_numLines: function() {
		this.__updateLayout();
		return this.__textEngine.numLines;
	}
	,get_restrict: function() {
		return this.__textEngine.restrict;
	}
	,set_restrict: function(value) {
		if(this.__textEngine.restrict != value) {
			this.__textEngine.set_restrict(value);
			this.__updateText(this.__text);
		}
		return value;
	}
	,get_scrollH: function() {
		return this.__textEngine.scrollH;
	}
	,set_scrollH: function(value) {
		this.__updateLayout();
		if(value > this.__textEngine.maxScrollH) {
			value = this.__textEngine.maxScrollH;
		}
		if(value < 0) {
			value = 0;
		}
		if(value != this.__textEngine.scrollH) {
			this.__dirty = true;
			if(!this.__renderDirty) {
				this.__renderDirty = true;
				this.__setParentRenderDirty();
			}
			this.__textEngine.scrollH = value;
			this.dispatchEvent(new openfl_events_Event("scroll"));
		}
		return this.__textEngine.scrollH;
	}
	,get_scrollV: function() {
		return this.__textEngine.get_scrollV();
	}
	,set_scrollV: function(value) {
		this.__updateLayout();
		if(value > this.__textEngine.get_maxScrollV()) {
			value = this.__textEngine.get_maxScrollV();
		}
		if(value < 1) {
			value = 1;
		}
		if(value != this.__textEngine.get_scrollV() || this.__textEngine.get_scrollV() == 0) {
			this.__dirty = true;
			if(!this.__renderDirty) {
				this.__renderDirty = true;
				this.__setParentRenderDirty();
			}
			this.__textEngine.set_scrollV(value);
			this.dispatchEvent(new openfl_events_Event("scroll"));
		}
		return this.__textEngine.get_scrollV();
	}
	,get_selectable: function() {
		return this.__textEngine.selectable;
	}
	,set_selectable: function(value) {
		if(value != this.__textEngine.selectable && this.get_type() == 1) {
			if(this.stage != null && this.stage.get_focus() == this) {
				this.__startTextInput();
			} else if(!value) {
				this.__stopTextInput();
			}
		}
		return this.__textEngine.selectable = value;
	}
	,get_selectionBeginIndex: function() {
		return Math.min(this.__caretIndex,this.__selectionIndex) | 0;
	}
	,get_selectionEndIndex: function() {
		return Math.max(this.__caretIndex,this.__selectionIndex) | 0;
	}
	,get_sharpness: function() {
		return this.__textEngine.sharpness;
	}
	,set_sharpness: function(value) {
		if(value != this.__textEngine.sharpness) {
			this.__dirty = true;
			if(!this.__renderDirty) {
				this.__renderDirty = true;
				this.__setParentRenderDirty();
			}
		}
		return this.__textEngine.sharpness = value;
	}
	,get_styleSheet: function() {
		return this.__styleSheet;
	}
	,set_styleSheet: function(value) {
		if(!(this.__styleSheet != null && value == null)) {
			if(value != null) {
				if(this.__isHTML && value != this.__styleSheet) {
					this.__dirty = true;
					this.__layoutDirty = true;
					if(!this.__renderDirty) {
						this.__renderDirty = true;
						this.__setParentRenderDirty();
					}
					this.set_htmlText(this.__htmlText);
				}
				this.set_type(0);
			}
		}
		return this.__styleSheet = value;
	}
	,get_tabEnabled: function() {
		if(this.__tabEnabled == null) {
			return this.__textEngine.type == 1;
		} else {
			return this.__tabEnabled;
		}
	}
	,get_text: function() {
		return this.__text;
	}
	,set_text: function(value) {
		if(value == null) {
			var error = new openfl_errors_TypeError("Error #2007: Parameter text must be non-null.");
			error.errorID = 2007;
			throw error;
		}
		if(this.__styleSheet != null) {
			return this.set_htmlText(value);
		}
		if(this.__isHTML || this.__text != value) {
			this.__dirty = true;
			this.__layoutDirty = true;
			if(!this.__renderDirty) {
				this.__renderDirty = true;
				this.__setParentRenderDirty();
			}
		} else {
			return value;
		}
		if(this.__textEngine.textFormatRanges.get_length() > 1) {
			var this1 = this.__textEngine.textFormatRanges;
			var deleteCount = this.__textEngine.textFormatRanges.get_length() - 1;
			this1.__tempIndex = 1;
			var _g_current = 0;
			var _g_args = [];
			while(_g_current < _g_args.length) {
				var item = _g_args[_g_current++];
				this1.insertAt(this1.__tempIndex,item);
				this1.__tempIndex++;
			}
			this1.splice(this1.__tempIndex,deleteCount);
		}
		var utfValue = value;
		var range = this.__textEngine.textFormatRanges.get(0);
		range.format = this.__textFormat;
		range.start = 0;
		range.end = utfValue.length;
		this.__isHTML = false;
		this.__updateText(value);
		return value;
	}
	,get_textColor: function() {
		return this.__textFormat.color;
	}
	,set_textColor: function(value) {
		if(value != this.__textFormat.color) {
			this.__dirty = true;
			if(!this.__renderDirty) {
				this.__renderDirty = true;
				this.__setParentRenderDirty();
			}
		}
		var range = this.__textEngine.textFormatRanges.iterator();
		while(range.hasNext()) {
			var range1 = range.next();
			range1.format.color = value;
		}
		return this.__textFormat.color = value;
	}
	,get_textWidth: function() {
		this.__updateLayout();
		return this.__textEngine.textWidth;
	}
	,get_textHeight: function() {
		this.__updateLayout();
		return this.__textEngine.textHeight;
	}
	,get_type: function() {
		return this.__textEngine.type;
	}
	,set_type: function(value) {
		if(this.__styleSheet != null) {
			value = 0;
		}
		if(value != this.__textEngine.type) {
			this.__textEngine.type = value;
			if(value == 1) {
				this.addEventListener("addedToStage",$bind(this,this.this_onAddedToStage));
				this.this_onFocusIn(null);
				this.__textEngine.__useIntAdvances = true;
			} else {
				this.removeEventListener("addedToStage",$bind(this,this.this_onAddedToStage));
				this.__stopTextInput();
				this.__textEngine.__useIntAdvances = null;
			}
			this.__dirty = true;
			this.__layoutDirty = true;
			if(!this.__renderDirty) {
				this.__renderDirty = true;
				this.__setParentRenderDirty();
			}
		}
		return this.__textEngine.type;
	}
	,get_width: function() {
		this.__updateLayout();
		return this.__textEngine.width * Math.abs(this.__scaleX);
	}
	,set_width: function(value) {
		if(value != this.__textEngine.width) {
			this.__setTransformDirty();
			this.__dirty = true;
			this.__layoutDirty = true;
			if(!this.__renderDirty) {
				this.__renderDirty = true;
				this.__setParentRenderDirty();
			}
			this.__textEngine.width = value;
		}
		return this.__textEngine.width * Math.abs(this.__scaleX);
	}
	,get_wordWrap: function() {
		return this.__textEngine.wordWrap;
	}
	,set_wordWrap: function(value) {
		if(value != this.__textEngine.wordWrap) {
			this.__dirty = true;
			this.__layoutDirty = true;
			if(!this.__renderDirty) {
				this.__renderDirty = true;
				this.__setParentRenderDirty();
			}
		}
		return this.__textEngine.wordWrap = value;
	}
	,get_passwordChar: function() {
		return this.__passwordChar;
	}
	,set_passwordChar: function(value) {
		if(value != this.__passwordChar) {
			this.__passwordChar = value;
			if(!this.__renderDirty) {
				this.__renderDirty = true;
				this.__setParentRenderDirty();
			}
			this.__updateText(this.__text);
		}
		return value;
	}
	,get_x: function() {
		return this.__transform.tx + this.__offsetX;
	}
	,set_x: function(value) {
		if(value != this.__transform.tx + this.__offsetX) {
			this.__setTransformDirty();
		}
		this.__transform.tx = value - this.__offsetX;
		return value;
	}
	,get_y: function() {
		return this.__transform.ty + this.__offsetY;
	}
	,set_y: function(value) {
		if(value != this.__transform.ty + this.__offsetY) {
			this.__setTransformDirty();
		}
		this.__transform.ty = value - this.__offsetY;
		return value;
	}
	,stage_onMouseMove: function(event) {
		if(this.stage == null) {
			return;
		}
		if(this.get_selectable() && this.__selectionIndex >= 0) {
			this.__updateLayout();
			var position;
			if(this.__lineSelection) {
				position = this.__getPositionByIdentifier(this.get_mouseX() + this.get_scrollH(),this.get_mouseY(),true);
			} else if(this.__wordSelection) {
				position = this.__getPositionByIdentifier(this.get_mouseX() + this.get_scrollH(),this.get_mouseY(),false);
			} else {
				position = this.__getPosition(this.get_mouseX() + this.get_scrollH(),this.get_mouseY());
			}
			if(position != this.__caretIndex) {
				this.__caretIndex = position;
				if(this.__wordSelection || this.__lineSelection) {
					this.__selectionIndex = this.__getOppositeIdentifierBound(this.__specialSelectionInitialIndex,this.__lineSelection);
				}
				var setDirty = true;
				if(openfl_display_DisplayObject.__supportDOM) {
					if(this.__renderedOnCanvasWhileOnDOM) {
						this.__forceCachedBitmapUpdate = true;
					}
					setDirty = false;
				}
				if(setDirty) {
					this.__dirty = true;
					if(!this.__renderDirty) {
						this.__renderDirty = true;
						this.__setParentRenderDirty();
					}
				}
			}
		}
	}
	,stage_onMouseUp: function(event) {
		var stage = event.currentTarget;
		stage.removeEventListener("enterFrame",$bind(this,this.this_onEnterFrame));
		stage.removeEventListener("mouseMove",$bind(this,this.stage_onMouseMove));
		stage.removeEventListener("mouseUp",$bind(this,this.stage_onMouseUp));
		if(this.stage != stage) {
			return;
		}
		if(stage.get_focus() == this) {
			this.__getWorldTransform();
			this.__updateLayout();
			if(this.__lineSelection || this.__wordSelection) {
				var upPos = 0;
				if(this.__lineSelection) {
					upPos = this.__getPositionByIdentifier(this.get_mouseX() + this.get_scrollH(),this.get_mouseY(),true);
				} else if(this.__wordSelection) {
					upPos = this.__getPositionByIdentifier(this.get_mouseX() + this.get_scrollH(),this.get_mouseY(),false);
				}
				var leftPos = Math.min(this.__selectionIndex,upPos) | 0;
				var rightPos = Math.max(this.__selectionIndex,upPos) | 0;
				this.__selectionIndex = leftPos;
				this.__caretIndex = rightPos;
			}
			this.__wordSelection = false;
			this.__lineSelection = false;
			if(this.__inputEnabled) {
				this.this_onFocusIn(null);
				this.__stopCursorTimer();
				this.__startCursorTimer();
				if(openfl_display_DisplayObject.__supportDOM && this.__renderedOnCanvasWhileOnDOM) {
					this.__forceCachedBitmapUpdate = true;
				}
			}
		}
	}
	,this_onAddedToStage: function(event) {
		this.this_onFocusIn(null);
	}
	,this_onEnterFrame: function(e) {
		this.__updateMouseDrag();
	}
	,this_onFocusIn: function(event) {
		if(this.get_type() == 1 && this.stage != null && this.stage.get_focus() == this) {
			this.__startTextInput();
		} else if(this.get_type() != 1 && this.get_selectable() && this.stage != null && this.stage.get_focus() == this) {
			this.__startCursorTimer();
		}
	}
	,this_onFocusOut: function(event) {
		this.__stopCursorTimer();
		this.__stopTextInput();
		if(this.__selectionIndex != this.__caretIndex) {
			this.__selectionIndex = this.__caretIndex;
			this.__dirty = true;
			if(!this.__renderDirty) {
				this.__renderDirty = true;
				this.__setParentRenderDirty();
			}
		}
	}
	,this_onKeyDown: function(event) {
		if(this.get_selectable() && this.get_type() != 1 && event.keyCode == 67 && (event.commandKey || event.ctrlKey)) {
			if(this.__caretIndex != this.__selectionIndex && !this.get_displayAsPassword()) {
				lime_system_Clipboard.set_text(this.__text.substring(this.__caretIndex,this.__selectionIndex));
			}
		}
	}
	,this_onMouseDown: function(event) {
		if(!this.get_selectable() && this.get_type() != 1) {
			return;
		}
		this.__lineSelection = event.clickCount == 3;
		this.__wordSelection = event.clickCount == 2;
		if(this.__lineSelection) {
			var prevCaretIndex = this.__caretIndex;
			this.__caretIndex = this.__getPositionByIdentifier(this.get_mouseX() + this.get_scrollH(),this.get_mouseY(),true);
			this.__selectionIndex = this.__getOppositeIdentifierBound(prevCaretIndex,true);
			this.setSelection(this.__caretIndex,this.__selectionIndex);
		} else if(this.__wordSelection) {
			var prevCaretIndex = this.__caretIndex;
			this.__caretIndex = this.__getPositionByIdentifier(this.get_mouseX() + this.get_scrollH(),this.get_mouseY(),false);
			this.__selectionIndex = this.__getOppositeIdentifierBound(prevCaretIndex,false);
			this.__specialSelectionInitialIndex = prevCaretIndex;
			this.setSelection(this.__caretIndex,this.__selectionIndex);
		} else {
			this.__caretIndex = this.__getPosition(this.get_mouseX() + this.get_scrollH(),this.get_mouseY());
			this.__selectionIndex = this.__caretIndex;
			this.setSelection(this.__caretIndex,this.__selectionIndex);
		}
		this.__updateLayout();
		if(!openfl_display_DisplayObject.__supportDOM) {
			this.__dirty = true;
			if(!this.__renderDirty) {
				this.__renderDirty = true;
				this.__setParentRenderDirty();
			}
		}
		if(this.stage == null) {
			return;
		}
		this.stage.addEventListener("enterFrame",$bind(this,this.this_onEnterFrame));
		this.stage.addEventListener("mouseMove",$bind(this,this.stage_onMouseMove));
		this.stage.addEventListener("mouseUp",$bind(this,this.stage_onMouseUp));
	}
	,this_onMouseWheel: function(event) {
		if(this.get_mouseWheelEnabled()) {
			this.set_scrollV(Math.min(this.get_scrollV() - event.delta,this.get_maxScrollV()) | 0);
		}
	}
	,window_onKeyDown: function(key,modifier) {
		switch(key) {
		case 8:
			if(this.__selectionIndex == this.__caretIndex && this.__caretIndex > 0) {
				this.__selectionIndex = this.__caretIndex - 1;
			}
			if(this.__selectionIndex != this.__caretIndex) {
				this.replaceSelectedText("");
				this.__selectionIndex = this.__caretIndex;
				this.dispatchEvent(new openfl_events_Event("change",true));
			} else {
				this.__stopCursorTimer();
				this.__startCursorTimer();
			}
			break;
		case 97:
			if(this.get_selectable()) {
				if(lime_ui_KeyModifier.get_metaKey(modifier) || lime_ui_KeyModifier.get_ctrlKey(modifier)) {
					this.setSelection(0,this.__text.length);
				}
			}
			break;
		case 99:
			if(lime_ui_KeyModifier.get_metaKey(modifier) || lime_ui_KeyModifier.get_ctrlKey(modifier)) {
				if(this.__caretIndex != this.__selectionIndex && !this.get_displayAsPassword()) {
					lime_system_Clipboard.set_text(this.__text.substring(this.__caretIndex,this.__selectionIndex));
				}
			}
			break;
		case 120:
			if(lime_ui_KeyModifier.get_metaKey(modifier) || lime_ui_KeyModifier.get_ctrlKey(modifier)) {
				if(this.__caretIndex != this.__selectionIndex && !this.get_displayAsPassword()) {
					lime_system_Clipboard.set_text(this.__text.substring(this.__caretIndex,this.__selectionIndex));
					this.replaceSelectedText("");
					this.dispatchEvent(new openfl_events_Event("change",true));
				}
			}
			break;
		case 127:
			if(this.__selectionIndex == this.__caretIndex && this.__caretIndex < this.__text.length) {
				this.__selectionIndex = this.__caretIndex + 1;
			}
			if(this.__selectionIndex != this.__caretIndex) {
				this.replaceSelectedText("");
				this.__selectionIndex = this.__caretIndex;
				this.dispatchEvent(new openfl_events_Event("change",true));
			} else {
				this.__stopCursorTimer();
				this.__startCursorTimer();
			}
			break;
		case 1073741898:
			if(this.get_selectable()) {
				if(lime_ui_KeyModifier.get_metaKey(modifier) || lime_ui_KeyModifier.get_ctrlKey(modifier)) {
					this.__caretIndex = 0;
				} else {
					this.__caretBeginningOfLine();
				}
				if(!lime_ui_KeyModifier.get_shiftKey(modifier)) {
					this.__selectionIndex = this.__caretIndex;
				}
				this.setSelection(this.__selectionIndex,this.__caretIndex);
			}
			break;
		case 1073741901:
			if(this.get_selectable()) {
				if(lime_ui_KeyModifier.get_metaKey(modifier) || lime_ui_KeyModifier.get_ctrlKey(modifier)) {
					this.__caretIndex = this.__text.length;
				} else {
					this.__caretEndOfLine();
				}
				if(!lime_ui_KeyModifier.get_shiftKey(modifier)) {
					this.__selectionIndex = this.__caretIndex;
				}
				this.setSelection(this.__selectionIndex,this.__caretIndex);
			}
			break;
		case 1073741903:
			if(this.get_selectable()) {
				if(lime_ui_KeyModifier.get_metaKey(modifier) || lime_ui_KeyModifier.get_ctrlKey(modifier)) {
					this.__caretBeginningOfNextLine();
				} else {
					this.__caretNextCharacter();
				}
				if(!lime_ui_KeyModifier.get_shiftKey(modifier)) {
					this.__selectionIndex = this.__caretIndex;
				}
				this.setSelection(this.__selectionIndex,this.__caretIndex);
			}
			break;
		case 1073741904:
			if(this.get_selectable()) {
				if(lime_ui_KeyModifier.get_metaKey(modifier) || lime_ui_KeyModifier.get_ctrlKey(modifier)) {
					this.__caretBeginningOfPreviousLine();
				} else {
					this.__caretPreviousCharacter();
				}
				if(!lime_ui_KeyModifier.get_shiftKey(modifier)) {
					this.__selectionIndex = this.__caretIndex;
				}
				this.setSelection(this.__selectionIndex,this.__caretIndex);
			}
			break;
		case 1073741905:
			if(this.get_selectable()) {
				if(lime_ui_KeyModifier.get_metaKey(modifier) || lime_ui_KeyModifier.get_ctrlKey(modifier)) {
					this.__caretIndex = this.__text.length;
				} else {
					this.__caretNextLine();
				}
				if(!lime_ui_KeyModifier.get_shiftKey(modifier)) {
					this.__selectionIndex = this.__caretIndex;
				}
				this.setSelection(this.__selectionIndex,this.__caretIndex);
			}
			break;
		case 1073741906:
			if(this.get_selectable()) {
				if(lime_ui_KeyModifier.get_metaKey(modifier) || lime_ui_KeyModifier.get_ctrlKey(modifier)) {
					this.__caretIndex = 0;
				} else {
					this.__caretPreviousLine();
				}
				if(!lime_ui_KeyModifier.get_shiftKey(modifier)) {
					this.__selectionIndex = this.__caretIndex;
				}
				this.setSelection(this.__selectionIndex,this.__caretIndex);
			}
			break;
		case 13:case 1073741912:
			if(this.__textEngine.multiline) {
				var te = new openfl_events_TextEvent("textInput",true,true,"\n");
				this.dispatchEvent(te);
				if(!te.isDefaultPrevented()) {
					this.__replaceSelectedText("\n",true);
					this.dispatchEvent(new openfl_events_Event("change",true));
				}
			} else {
				this.__stopCursorTimer();
				this.__startCursorTimer();
			}
			break;
		default:
		}
	}
	,window_onTextInput: function(value) {
		this.__replaceSelectedText(value,true);
		this.dispatchEvent(new openfl_events_Event("change",true));
	}
	,__class__: openfl_text_TextField
	,__properties__: $extend(openfl_display_InteractiveObject.prototype.__properties__,{set_passwordChar:"set_passwordChar",get_passwordChar:"get_passwordChar",set_wordWrap:"set_wordWrap",get_wordWrap:"get_wordWrap",set_type:"set_type",get_type:"get_type",get_textWidth:"get_textWidth",get_textHeight:"get_textHeight",set_textColor:"set_textColor",get_textColor:"get_textColor",set_text:"set_text",get_text:"get_text",set_styleSheet:"set_styleSheet",get_styleSheet:"get_styleSheet",set_sharpness:"set_sharpness",get_sharpness:"get_sharpness",get_selectionEndIndex:"get_selectionEndIndex",get_selectionBeginIndex:"get_selectionBeginIndex",set_selectable:"set_selectable",get_selectable:"get_selectable",set_scrollV:"set_scrollV",get_scrollV:"get_scrollV",set_scrollH:"set_scrollH",get_scrollH:"get_scrollH",set_restrict:"set_restrict",get_restrict:"get_restrict",get_numLines:"get_numLines",set_multiline:"set_multiline",get_multiline:"get_multiline",set_mouseWheelEnabled:"set_mouseWheelEnabled",get_mouseWheelEnabled:"get_mouseWheelEnabled",get_maxScrollV:"get_maxScrollV",get_maxScrollH:"get_maxScrollH",set_maxChars:"set_maxChars",get_maxChars:"get_maxChars",get_length:"get_length",set_htmlText:"set_htmlText",get_htmlText:"get_htmlText",set_gridFitType:"set_gridFitType",get_gridFitType:"get_gridFitType",set_embedFonts:"set_embedFonts",get_embedFonts:"get_embedFonts",set_displayAsPassword:"set_displayAsPassword",get_displayAsPassword:"get_displayAsPassword",set_defaultTextFormat:"set_defaultTextFormat",get_defaultTextFormat:"get_defaultTextFormat",get_caretIndex:"get_caretIndex",get_bottomScrollV:"get_bottomScrollV",set_borderColor:"set_borderColor",get_borderColor:"get_borderColor",set_border:"set_border",get_border:"get_border",set_backgroundColor:"set_backgroundColor",get_backgroundColor:"get_backgroundColor",set_background:"set_background",get_background:"get_background",set_autoSize:"set_autoSize",get_autoSize:"get_autoSize",set_antiAliasType:"set_antiAliasType",get_antiAliasType:"get_antiAliasType"})
});
var openfl_display_FPS = function(x,y,color) {
	if(color == null) {
		color = 0;
	}
	if(y == null) {
		y = 10;
	}
	if(x == null) {
		x = 10;
	}
	this.lastText = null;
	openfl_text_TextField.call(this);
	this.set_x(x);
	this.set_y(y);
	this.currentFPS = 0;
	this.set_selectable(false);
	this.mouseEnabled = false;
	this.set_defaultTextFormat(new openfl_text_TextFormat("_sans",12,color));
	this.set_text("FPS: ");
	this.cacheCount = 0;
	this.currentTime = 0;
	this.times = [];
};
$hxClasses["openfl.display.FPS"] = openfl_display_FPS;
openfl_display_FPS.__name__ = "openfl.display.FPS";
openfl_display_FPS.__super__ = openfl_text_TextField;
openfl_display_FPS.prototype = $extend(openfl_text_TextField.prototype,{
	currentFPS: null
	,cacheCount: null
	,currentTime: null
	,times: null
	,lastText: null
	,__enterFrame: function(deltaTime) {
		this.currentTime += deltaTime;
		this.times.push(this.currentTime);
		while(this.times[0] < this.currentTime - 1000) this.times.shift();
		var currentCount = this.times.length;
		this.currentFPS = Math.round((currentCount + this.cacheCount) / 2);
		if(currentCount != this.cacheCount) {
			var newText = "FPS: " + this.currentFPS;
			if(newText != this.lastText) {
				this.set_text(newText);
				this.lastText = newText;
			}
		}
		this.cacheCount = currentCount;
	}
	,__class__: openfl_display_FPS
});
var openfl_display_FrameLabel = function(name,frame) {
	openfl_events_EventDispatcher.call(this);
	this.name = name;
	this.frame = frame;
};
$hxClasses["openfl.display.FrameLabel"] = openfl_display_FrameLabel;
openfl_display_FrameLabel.__name__ = "openfl.display.FrameLabel";
openfl_display_FrameLabel.__super__ = openfl_events_EventDispatcher;
openfl_display_FrameLabel.prototype = $extend(openfl_events_EventDispatcher.prototype,{
	frame: null
	,name: null
	,__class__: openfl_display_FrameLabel
});
var openfl_display_FrameScript = function(script,frame) {
	this.script = script;
	this.frame = frame;
};
$hxClasses["openfl.display.FrameScript"] = openfl_display_FrameScript;
openfl_display_FrameScript.__name__ = "openfl.display.FrameScript";
openfl_display_FrameScript.prototype = {
	frame: null
	,script: null
	,__class__: openfl_display_FrameScript
};
var openfl_display_GradientType = {};
openfl_display_GradientType.fromInt = function(value) {
	return value;
};
openfl_display_GradientType.fromString = function(value) {
	switch(value) {
	case "linear":
		return 0;
	case "radial":
		return 1;
	default:
		return null;
	}
};
openfl_display_GradientType.toInt = function(this1) {
	return this1;
};
openfl_display_GradientType.toString = function(this1) {
	switch(this1) {
	case 0:
		return "linear";
	case 1:
		return "radial";
	default:
		return null;
	}
};
var openfl_display_Graphics = function(owner) {
	this.__dirty = true;
	this.__owner = owner;
	this.__commands = new openfl_display__$internal_DrawCommandBuffer();
	this.__strokePadding = 0;
	this.__positionX = 0;
	this.__positionY = 0;
	this.__renderTransform = new openfl_geom_Matrix();
	this.__usedShaderBuffers = new haxe_ds_List();
	this.__worldTransform = new openfl_geom_Matrix();
	this.__width = 0;
	this.__height = 0;
	this.__bitmapScaleX = 1;
	this.__bitmapScaleY = 1;
	this.__shaderBufferPool = new lime_utils_ObjectPool(function() {
		return new openfl_display__$internal_ShaderBuffer();
	});
	this.moveTo(0,0);
};
$hxClasses["openfl.display.Graphics"] = openfl_display_Graphics;
openfl_display_Graphics.__name__ = "openfl.display.Graphics";
openfl_display_Graphics.prototype = {
	__bounds: null
	,__commands: null
	,__dirty: null
	,__hardwareDirty: null
	,__height: null
	,__managed: null
	,__positionX: null
	,__positionY: null
	,__quadBuffer: null
	,__renderTransform: null
	,__shaderBufferPool: null
	,__softwareDirty: null
	,__strokePadding: null
	,__transformDirty: null
	,__triangleIndexBuffer: null
	,__triangleIndexBufferCount: null
	,__triangleIndexBufferData: null
	,__usedShaderBuffers: null
	,__vertexBuffer: null
	,__vertexBufferCount: null
	,__vertexBufferCountUVT: null
	,__vertexBufferData: null
	,__vertexBufferDataUVT: null
	,__vertexBufferUVT: null
	,__visible: null
	,__owner: null
	,__width: null
	,__worldTransform: null
	,__canvas: null
	,__context: null
	,__bitmap: null
	,__bitmapScaleX: null
	,__bitmapScaleY: null
	,beginBitmapFill: function(bitmap,matrix,repeat,smooth) {
		if(smooth == null) {
			smooth = false;
		}
		if(repeat == null) {
			repeat = true;
		}
		this.__commands.beginBitmapFill(bitmap,matrix != null ? matrix.clone() : null,repeat,smooth);
		this.__visible = true;
	}
	,beginFill: function(color,alpha) {
		if(alpha == null) {
			alpha = 1;
		}
		if(color == null) {
			color = 0;
		}
		this.__commands.beginFill(color & 16777215,alpha);
		if(alpha > 0) {
			this.__visible = true;
		}
	}
	,beginGradientFill: function(type,colors,alphas,ratios,matrix,spreadMethod,interpolationMethod,focalPointRatio) {
		if(focalPointRatio == null) {
			focalPointRatio = 0;
		}
		if(interpolationMethod == null) {
			interpolationMethod = 1;
		}
		if(spreadMethod == null) {
			spreadMethod = 0;
		}
		if(colors == null || colors.length == 0) {
			return;
		}
		if(alphas == null) {
			alphas = [];
			var _g = 0;
			var _g1 = colors.length;
			while(_g < _g1) {
				var i = _g++;
				alphas.push(1);
			}
		}
		if(ratios == null) {
			ratios = [];
			var _g = 0;
			var _g1 = colors.length;
			while(_g < _g1) {
				var i = _g++;
				ratios.push(Math.ceil(i / (colors.length - 1) * 255));
			}
		}
		if(alphas.length < colors.length || ratios.length < colors.length) {
			return;
		}
		this.__commands.beginGradientFill(type,colors,alphas,ratios,matrix,spreadMethod,interpolationMethod,focalPointRatio);
		var _g = 0;
		while(_g < alphas.length) {
			var alpha = alphas[_g];
			++_g;
			if(alpha > 0) {
				this.__visible = true;
				break;
			}
		}
	}
	,beginShaderFill: function(shader,matrix) {
		if(shader != null) {
			var shaderBuffer = this.__shaderBufferPool.get();
			this.__usedShaderBuffers.add(shaderBuffer);
			shaderBuffer.update(shader);
			this.__commands.beginShaderFill(shaderBuffer);
		}
	}
	,clear: function() {
		var _g_head = this.__usedShaderBuffers.h;
		while(_g_head != null) {
			var val = _g_head.item;
			_g_head = _g_head.next;
			var shaderBuffer = val;
			this.__shaderBufferPool.release(shaderBuffer);
		}
		this.__usedShaderBuffers.clear();
		this.__commands.clear();
		this.__strokePadding = 0;
		if(this.__bounds != null) {
			this.set___dirty(true);
			this.__transformDirty = true;
			this.__bounds = null;
		}
		this.__visible = false;
		this.__positionX = 0;
		this.__positionY = 0;
		this.moveTo(0,0);
	}
	,copyFrom: function(sourceGraphics) {
		this.__bounds = sourceGraphics.__bounds != null ? sourceGraphics.__bounds.clone() : null;
		this.__commands = sourceGraphics.__commands.copy();
		this.set___dirty(true);
		this.__strokePadding = sourceGraphics.__strokePadding;
		this.__positionX = sourceGraphics.__positionX;
		this.__positionY = sourceGraphics.__positionY;
		this.__transformDirty = true;
		this.__visible = sourceGraphics.__visible;
	}
	,cubicCurveTo: function(controlX1,controlY1,controlX2,controlY2,anchorX,anchorY) {
		var xs = this.__findExtrema(this.__positionX,controlX1,controlX2,anchorX);
		var ys = this.__findExtrema(this.__positionY,controlY1,controlY2,anchorY);
		this.__inflateBounds(xs.min - this.__strokePadding,ys.min - this.__strokePadding);
		this.__inflateBounds(xs.max + this.__strokePadding,ys.max + this.__strokePadding);
		this.__positionX = anchorX;
		this.__positionY = anchorY;
		this.__commands.cubicCurveTo(controlX1,controlY1,controlX2,controlY2,anchorX,anchorY);
		this.set___dirty(true);
	}
	,curveTo: function(controlX,controlY,anchorX,anchorY) {
		this.__inflateBounds(this.__positionX - this.__strokePadding,this.__positionY - this.__strokePadding);
		this.__inflateBounds(this.__positionX + this.__strokePadding,this.__positionY + this.__strokePadding);
		var ix;
		var iy;
		if(controlX < anchorX && controlX > this.__positionX || controlX > anchorX && controlX < this.__positionX) {
			ix = anchorX;
		} else {
			var tx = (this.__positionX - controlX) / (this.__positionX - 2 * controlX + anchorX);
			ix = this.__calculateBezierQuadPoint(tx,this.__positionX,controlX,anchorX);
		}
		if(controlY < anchorY && controlY > this.__positionY || controlY > anchorY && controlY < this.__positionY) {
			iy = anchorY;
		} else {
			var ty = (this.__positionY - controlY) / (this.__positionY - 2 * controlY + anchorY);
			iy = this.__calculateBezierQuadPoint(ty,this.__positionY,controlY,anchorY);
		}
		this.__inflateBounds(ix - this.__strokePadding,iy - this.__strokePadding);
		this.__inflateBounds(ix + this.__strokePadding,iy + this.__strokePadding);
		this.__positionX = anchorX;
		this.__positionY = anchorY;
		this.__inflateBounds(this.__positionX - this.__strokePadding,this.__positionY - this.__strokePadding);
		this.__inflateBounds(this.__positionX + this.__strokePadding,this.__positionY + this.__strokePadding);
		this.__commands.curveTo(controlX,controlY,anchorX,anchorY);
		this.set___dirty(true);
	}
	,drawCircle: function(x,y,radius) {
		if(radius <= 0) {
			return;
		}
		this.__inflateBounds(x - radius - this.__strokePadding,y - radius - this.__strokePadding);
		this.__inflateBounds(x + radius + this.__strokePadding,y + radius + this.__strokePadding);
		this.__commands.drawCircle(x,y,radius);
		this.set___dirty(true);
	}
	,drawEllipse: function(x,y,width,height) {
		if(width <= 0 || height <= 0) {
			return;
		}
		this.__inflateBounds(x - this.__strokePadding,y - this.__strokePadding);
		this.__inflateBounds(x + width + this.__strokePadding,y + height + this.__strokePadding);
		this.__commands.drawEllipse(x,y,width,height);
		this.set___dirty(true);
	}
	,drawGraphicsData: function(graphicsData) {
		var fill;
		var bitmapFill;
		var gradientFill;
		var shaderFill;
		var stroke;
		var path;
		var trianglePath;
		var quadPath;
		var graphics = graphicsData.iterator();
		while(graphics.hasNext()) {
			var graphics1 = graphics.next();
			switch(graphics1.__graphicsDataType) {
			case 0:
				stroke = graphics1;
				if(stroke.fill != null) {
					var thickness = stroke.thickness;
					if(isNaN(thickness)) {
						thickness = null;
					}
					switch(stroke.fill.__graphicsFillType) {
					case 0:
						fill = stroke.fill;
						this.lineStyle(thickness,fill.color,fill.alpha,stroke.pixelHinting,stroke.scaleMode,stroke.caps,stroke.joints,stroke.miterLimit);
						break;
					case 1:
						gradientFill = stroke.fill;
						this.lineStyle(thickness,0,1,stroke.pixelHinting,stroke.scaleMode,stroke.caps,stroke.joints,stroke.miterLimit);
						this.lineGradientStyle(gradientFill.type,gradientFill.colors,gradientFill.alphas,gradientFill.ratios,gradientFill.matrix,gradientFill.spreadMethod,gradientFill.interpolationMethod,gradientFill.focalPointRatio);
						break;
					case 2:
						bitmapFill = stroke.fill;
						this.lineStyle(thickness,0,1,stroke.pixelHinting,stroke.scaleMode,stroke.caps,stroke.joints,stroke.miterLimit);
						this.lineBitmapStyle(bitmapFill.bitmapData,bitmapFill.matrix,bitmapFill.repeat,bitmapFill.smooth);
						break;
					default:
					}
				} else {
					this.lineStyle();
				}
				break;
			case 1:
				fill = graphics1;
				this.beginFill(fill.color,fill.alpha);
				break;
			case 2:
				gradientFill = graphics1;
				this.beginGradientFill(gradientFill.type,gradientFill.colors,gradientFill.alphas,gradientFill.ratios,gradientFill.matrix,gradientFill.spreadMethod,gradientFill.interpolationMethod,gradientFill.focalPointRatio);
				break;
			case 3:
				path = graphics1;
				this.drawPath(path.commands,path.data,path.winding);
				break;
			case 4:
				bitmapFill = graphics1;
				this.beginBitmapFill(bitmapFill.bitmapData,bitmapFill.matrix,bitmapFill.repeat,bitmapFill.smooth);
				break;
			case 5:
				this.endFill();
				break;
			case 6:
				quadPath = graphics1;
				this.drawQuads(quadPath.rects,quadPath.indices,quadPath.transforms);
				break;
			case 7:
				trianglePath = graphics1;
				this.drawTriangles(trianglePath.vertices,trianglePath.indices,trianglePath.uvtData,trianglePath.culling);
				break;
			case 8:
				shaderFill = graphics1;
				this.beginShaderFill(shaderFill.shader,shaderFill.matrix);
				break;
			}
		}
	}
	,drawPath: function(commands,data,winding) {
		if(winding == null) {
			winding = 0;
		}
		var dataIndex = 0;
		if(winding == 1) {
			this.__commands.windingNonZero();
		}
		var command = commands.iterator();
		_hx_loop1: while(command.hasNext()) {
			var command1 = command.next();
			switch(command1) {
			case 1:
				this.moveTo(data.get(dataIndex),data.get(dataIndex + 1));
				dataIndex += 2;
				break;
			case 2:
				this.lineTo(data.get(dataIndex),data.get(dataIndex + 1));
				dataIndex += 2;
				break;
			case 3:
				this.curveTo(data.get(dataIndex),data.get(dataIndex + 1),data.get(dataIndex + 2),data.get(dataIndex + 3));
				dataIndex += 4;
				break;
			case 4:
				this.moveTo(data.get(dataIndex + 2),data.get(dataIndex + 3));
				break _hx_loop1;
			case 5:
				this.lineTo(data.get(dataIndex + 2),data.get(dataIndex + 3));
				break _hx_loop1;
			case 6:
				this.cubicCurveTo(data.get(dataIndex),data.get(dataIndex + 1),data.get(dataIndex + 2),data.get(dataIndex + 3),data.get(dataIndex + 4),data.get(dataIndex + 5));
				dataIndex += 6;
				break;
			default:
			}
		}
	}
	,drawQuads: function(rects,indices,transforms) {
		if(rects == null) {
			return;
		}
		var hasIndices = indices != null;
		var transformABCD = false;
		var transformXY = false;
		var length = hasIndices ? indices.get_length() : Math.floor(rects.get_length() / 4);
		if(length == 0) {
			return;
		}
		if(transforms != null) {
			if(transforms.get_length() >= length * 6) {
				transformABCD = true;
				transformXY = true;
			} else if(transforms.get_length() >= length * 4) {
				transformABCD = true;
			} else if(transforms.get_length() >= length * 2) {
				transformXY = true;
			}
		}
		var tileRect = openfl_geom_Rectangle.__pool.get();
		var tileTransform = openfl_geom_Matrix.__pool.get();
		var minX = Infinity;
		var minY = Infinity;
		var maxX = -Infinity;
		var maxY = -Infinity;
		var ri;
		var ti;
		var _g = 0;
		var _g1 = length;
		while(_g < _g1) {
			var i = _g++;
			ri = hasIndices ? indices.get(i) * 4 : i * 4;
			if(ri < 0) {
				continue;
			}
			tileRect.setTo(0,0,rects.get(ri + 2),rects.get(ri + 3));
			if(tileRect.width <= 0 || tileRect.height <= 0) {
				continue;
			}
			if(transformABCD && transformXY) {
				ti = i * 6;
				tileTransform.setTo(transforms.get(ti),transforms.get(ti + 1),transforms.get(ti + 2),transforms.get(ti + 3),transforms.get(ti + 4),transforms.get(ti + 5));
			} else if(transformABCD) {
				ti = i * 4;
				tileTransform.setTo(transforms.get(ti),transforms.get(ti + 1),transforms.get(ti + 2),transforms.get(ti + 3),tileRect.x,tileRect.y);
			} else if(transformXY) {
				ti = i * 2;
				tileTransform.tx = transforms.get(ti);
				tileTransform.ty = transforms.get(ti + 1);
			} else {
				tileTransform.tx = tileRect.x;
				tileTransform.ty = tileRect.y;
			}
			tileRect.__transform(tileRect,tileTransform);
			if(minX > tileRect.x) {
				minX = tileRect.x;
			}
			if(minY > tileRect.y) {
				minY = tileRect.y;
			}
			if(maxX < tileRect.get_right()) {
				maxX = tileRect.get_right();
			}
			if(maxY < tileRect.get_bottom()) {
				maxY = tileRect.get_bottom();
			}
		}
		this.__inflateBounds(minX,minY);
		this.__inflateBounds(maxX,maxY);
		this.__commands.drawQuads(rects,indices,transforms);
		this.set___dirty(true);
		this.__visible = true;
		openfl_geom_Rectangle.__pool.release(tileRect);
		openfl_geom_Matrix.__pool.release(tileTransform);
	}
	,drawRect: function(x,y,width,height) {
		if(width == 0 && height == 0) {
			return;
		}
		var xSign = width < 0 ? -1 : 1;
		var ySign = height < 0 ? -1 : 1;
		this.__inflateBounds(x - this.__strokePadding * xSign,y - this.__strokePadding * ySign);
		this.__inflateBounds(x + width + this.__strokePadding * xSign,y + height + this.__strokePadding * ySign);
		this.__commands.drawRect(x,y,width,height);
		this.set___dirty(true);
	}
	,drawRoundRect: function(x,y,width,height,ellipseWidth,ellipseHeight) {
		if(width == 0 && height == 0) {
			return;
		}
		var xSign = width < 0 ? -1 : 1;
		var ySign = height < 0 ? -1 : 1;
		this.__inflateBounds(x - this.__strokePadding * xSign,y - this.__strokePadding * ySign);
		this.__inflateBounds(x + width + this.__strokePadding * xSign,y + height + this.__strokePadding * ySign);
		this.__commands.drawRoundRect(x,y,width,height,ellipseWidth,ellipseHeight);
		this.set___dirty(true);
	}
	,drawRoundRectComplex: function(x,y,width,height,topLeftRadius,topRightRadius,bottomLeftRadius,bottomRightRadius) {
		if(width <= 0 || height <= 0) {
			return;
		}
		this.__inflateBounds(x - this.__strokePadding,y - this.__strokePadding);
		this.__inflateBounds(x + width + this.__strokePadding,y + height + this.__strokePadding);
		var xw = x + width;
		var yh = y + height;
		var minSize = width < height ? width * 2 : height * 2;
		if(!(topLeftRadius < minSize)) {
			topLeftRadius = minSize;
		}
		if(!(topRightRadius < minSize)) {
			topRightRadius = minSize;
		}
		if(!(bottomLeftRadius < minSize)) {
			bottomLeftRadius = minSize;
		}
		if(!(bottomRightRadius < minSize)) {
			bottomRightRadius = minSize;
		}
		var anchor = 1 - Math.sin(45 * (Math.PI / 180));
		var control = 1 - Math.tan(22.5 * (Math.PI / 180));
		var a = bottomRightRadius * anchor;
		var s = bottomRightRadius * control;
		this.moveTo(xw,yh - bottomRightRadius);
		this.curveTo(xw,yh - s,xw - a,yh - a);
		this.curveTo(xw - s,yh,xw - bottomRightRadius,yh);
		a = bottomLeftRadius * anchor;
		s = bottomLeftRadius * control;
		this.lineTo(x + bottomLeftRadius,yh);
		this.curveTo(x + s,yh,x + a,yh - a);
		this.curveTo(x,yh - s,x,yh - bottomLeftRadius);
		a = topLeftRadius * anchor;
		s = topLeftRadius * control;
		this.lineTo(x,y + topLeftRadius);
		this.curveTo(x,y + s,x + a,y + a);
		this.curveTo(x + s,y,x + topLeftRadius,y);
		a = topRightRadius * anchor;
		s = topRightRadius * control;
		this.lineTo(xw - topRightRadius,y);
		this.curveTo(xw - s,y,xw - a,y + a);
		this.curveTo(xw,y + s,xw,y + topRightRadius);
		this.lineTo(xw,yh - bottomRightRadius);
		this.set___dirty(true);
	}
	,drawTriangles: function(vertices,indices,uvtData,culling) {
		if(culling == null) {
			culling = 1;
		}
		if(vertices == null || vertices.get_length() == 0) {
			return;
		}
		var vertLength = vertices.get_length() / 2 | 0;
		if(indices == null) {
			if(vertLength % 3 != 0) {
				throw new openfl_errors_ArgumentError("Not enough vertices to close a triangle.");
			}
			indices = openfl_Vector.toIntVector(null);
			var _g = 0;
			var _g1 = vertLength;
			while(_g < _g1) {
				var i = _g++;
				indices.push(i);
			}
		}
		if(culling == null) {
			culling = 1;
		}
		var x;
		var y;
		var minX = Infinity;
		var minY = Infinity;
		var maxX = -Infinity;
		var maxY = -Infinity;
		var _g = 0;
		var _g1 = vertLength;
		while(_g < _g1) {
			var i = _g++;
			x = vertices.get(i * 2);
			y = vertices.get(i * 2 + 1);
			if(minX > x) {
				minX = x;
			}
			if(minY > y) {
				minY = y;
			}
			if(maxX < x) {
				maxX = x;
			}
			if(maxY < y) {
				maxY = y;
			}
		}
		this.__inflateBounds(minX,minY);
		this.__inflateBounds(maxX,maxY);
		this.__commands.drawTriangles(vertices,indices,uvtData,culling);
		this.set___dirty(true);
		this.__visible = true;
	}
	,endFill: function() {
		this.__commands.endFill();
	}
	,lineBitmapStyle: function(bitmap,matrix,repeat,smooth) {
		if(smooth == null) {
			smooth = false;
		}
		if(repeat == null) {
			repeat = true;
		}
		this.__commands.lineBitmapStyle(bitmap,matrix != null ? matrix.clone() : null,repeat,smooth);
	}
	,lineGradientStyle: function(type,colors,alphas,ratios,matrix,spreadMethod,interpolationMethod,focalPointRatio) {
		if(focalPointRatio == null) {
			focalPointRatio = 0;
		}
		if(interpolationMethod == null) {
			interpolationMethod = 1;
		}
		if(spreadMethod == null) {
			spreadMethod = 0;
		}
		if(alphas == null) {
			alphas = [];
			var _g = 0;
			var _g1 = colors.length;
			while(_g < _g1) {
				var i = _g++;
				alphas.push(1);
			}
		}
		if(ratios == null) {
			ratios = [];
			var _g = 0;
			var _g1 = colors.length;
			while(_g < _g1) {
				var i = _g++;
				ratios.push(Math.ceil(i / (colors.length - 1) * 255));
			}
		}
		this.__commands.lineGradientStyle(type,colors,alphas,ratios,matrix,spreadMethod,interpolationMethod,focalPointRatio);
	}
	,lineStyle: function(thickness,color,alpha,pixelHinting,scaleMode,caps,joints,miterLimit) {
		if(miterLimit == null) {
			miterLimit = 3;
		}
		if(scaleMode == null) {
			scaleMode = 2;
		}
		if(pixelHinting == null) {
			pixelHinting = false;
		}
		if(alpha == null) {
			alpha = 1;
		}
		if(color == null) {
			color = 0;
		}
		if(caps == null) {
			caps = 1;
		}
		if(joints == null) {
			joints = 2;
		}
		if(thickness != null) {
			if(joints == 1) {
				if(thickness > this.__strokePadding) {
					this.__strokePadding = Math.ceil(thickness);
				}
			} else if(thickness / 2 > this.__strokePadding) {
				this.__strokePadding = Math.ceil(thickness / 2);
			}
		}
		this.__commands.lineStyle(thickness,color,alpha,pixelHinting,scaleMode,caps,joints,miterLimit);
		if(thickness != null) {
			this.__visible = true;
		}
	}
	,lineTo: function(x,y) {
		if(!isFinite(x) || !isFinite(y)) {
			return;
		}
		this.__inflateBounds(this.__positionX - this.__strokePadding,this.__positionY - this.__strokePadding);
		this.__inflateBounds(this.__positionX + this.__strokePadding,this.__positionY + this.__strokePadding);
		this.__positionX = x;
		this.__positionY = y;
		this.__inflateBounds(this.__positionX - this.__strokePadding,this.__positionY - this.__strokePadding);
		this.__inflateBounds(this.__positionX + this.__strokePadding * 2,this.__positionY + this.__strokePadding);
		this.__commands.lineTo(x,y);
		this.set___dirty(true);
	}
	,moveTo: function(x,y) {
		this.__positionX = x;
		this.__positionY = y;
		this.__commands.moveTo(x,y);
	}
	,overrideBlendMode: function(blendMode) {
		if(blendMode == null) {
			blendMode = 10;
		}
		this.__commands.overrideBlendMode(blendMode);
	}
	,readGraphicsData: function(recurse) {
		if(recurse == null) {
			recurse = true;
		}
		var graphicsData = openfl_Vector.toObjectVector(null);
		this.__owner.__readGraphicsData(graphicsData,recurse);
		return graphicsData;
	}
	,__calculateBezierCubicPoint: function(t,p1,p2,p3,p4) {
		var iT = 1 - t;
		return p1 * (iT * iT * iT) + 3 * p2 * t * (iT * iT) + 3 * p3 * iT * (t * t) + p4 * (t * t * t);
	}
	,__calculateBezierQuadPoint: function(t,p1,p2,p3) {
		var iT = 1 - t;
		return iT * iT * p1 + 2 * iT * t * p2 + t * t * p3;
	}
	,__cleanup: function() {
		if(this.__bounds != null && this.__canvas != null) {
			this.set___dirty(true);
			this.__transformDirty = true;
		}
		this.__bitmap = null;
		if(this.__canvas != null) {
			this.__canvas.width = 0;
			this.__canvas.height = 0;
			this.__canvas = null;
		}
		if(this.__context != null) {
			this.__context.clearRect(0,0,0,0);
			this.__context = null;
		}
	}
	,__getBounds: function(rect,matrix) {
		if(this.__bounds == null) {
			return;
		}
		var bounds = openfl_geom_Rectangle.__pool.get();
		this.__bounds.__transform(bounds,matrix);
		rect.__expand(bounds.x,bounds.y,bounds.width,bounds.height);
		openfl_geom_Rectangle.__pool.release(bounds);
	}
	,__hitTest: function(x,y,shapeFlag,matrix) {
		if(this.__bounds == null) {
			return false;
		}
		var norm = matrix.a * matrix.d - matrix.b * matrix.c;
		var px = norm == 0 ? -matrix.tx : 1.0 / norm * (matrix.c * (matrix.ty - y) + matrix.d * (x - matrix.tx));
		var norm = matrix.a * matrix.d - matrix.b * matrix.c;
		var py = norm == 0 ? -matrix.ty : 1.0 / norm * (matrix.a * (y - matrix.ty) + matrix.b * (matrix.tx - x));
		if(px > this.__bounds.x && py > this.__bounds.y && this.__bounds.contains(px,py)) {
			if(shapeFlag) {
				return openfl_display__$internal_CanvasGraphics.hitTest(this,px,py);
			}
			return true;
		}
		return false;
	}
	,__findExtrema: function(p1,p2,p3,p4) {
		var solutions = [];
		if(!((p2 < p4 && p2 > p1 || p2 > p4 && p2 < p1) && (p3 < p4 && p3 > p1 || p3 > p4 && p3 < p1))) {
			var a = -p1 + 3 * p2 + p4 - 3 * p3;
			var b = 2 * p1 - 4 * p2 + 2 * p3;
			var c = p2 - p1;
			var d = b * b - 4 * a * c;
			if(a == 0) {
				var t = -c / b;
				if(t > 0 && t < 1) {
					solutions.push(this.__calculateBezierCubicPoint(t,p1,p2,p3,p4));
				}
			} else if(d >= 0) {
				var t1 = (-b + Math.sqrt(d)) / (2 * a);
				var t2 = (-b - Math.sqrt(d)) / (2 * a);
				if(t1 > 0 && t1 < 1) {
					solutions.push(this.__calculateBezierCubicPoint(t1,p1,p2,p3,p4));
				}
				if(t2 > 0 && t2 < 1) {
					solutions.push(this.__calculateBezierCubicPoint(t2,p1,p2,p3,p4));
				}
			}
		}
		var min = p1;
		var max = p1;
		solutions.push(p4);
		var _g = 0;
		while(_g < solutions.length) {
			var val = solutions[_g];
			++_g;
			if(val < min) {
				min = val;
			}
			if(val > max) {
				max = val;
			}
		}
		return { min : min, max : max};
	}
	,__inflateBounds: function(x,y) {
		if(this.__bounds == null) {
			this.__bounds = new openfl_geom_Rectangle(x,y,0,0);
			this.__transformDirty = true;
			return;
		}
		if(x < this.__bounds.x) {
			this.__bounds.width += this.__bounds.x - x;
			this.__bounds.x = x;
			this.__transformDirty = true;
		}
		if(y < this.__bounds.y) {
			this.__bounds.height += this.__bounds.y - y;
			this.__bounds.y = y;
			this.__transformDirty = true;
		}
		if(x > this.__bounds.x + this.__bounds.width) {
			this.__bounds.width = x - this.__bounds.x;
		}
		if(y > this.__bounds.y + this.__bounds.height) {
			this.__bounds.height = y - this.__bounds.y;
		}
	}
	,__readGraphicsData: function(graphicsData) {
		var data = new openfl_display__$internal_DrawCommandReader(this.__commands);
		var path = null;
		var stroke;
		var _g = 0;
		var _g1 = this.__commands.types;
		while(_g < _g1.length) {
			var type = _g1[_g];
			++_g;
			switch(type._hx_index) {
			case 4:case 5:case 6:case 7:case 9:case 10:case 17:case 18:
				if(path == null) {
					path = new openfl_display_GraphicsPath();
				}
				break;
			default:
				if(path != null) {
					graphicsData.push(path);
					path = null;
				}
			}
			switch(type._hx_index) {
			case 0:
				switch(data.prev._hx_index) {
				case 0:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 1:
					data.iPos += 1;
					data.fPos += 1;
					break;
				case 2:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 3:
					data.oPos += 1;
					break;
				case 4:
					data.fPos += 6;
					break;
				case 5:
					data.fPos += 4;
					break;
				case 6:
					data.fPos += 3;
					break;
				case 7:
					data.fPos += 4;
					break;
				case 8:
					data.oPos += 3;
					break;
				case 9:
					data.fPos += 4;
					break;
				case 10:
					data.fPos += 5;
					data.oPos += 1;
					break;
				case 12:
					data.oPos += 4;
					break;
				case 13:
					break;
				case 14:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 15:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 16:
					data.oPos += 4;
					data.iPos += 1;
					data.fPos += 2;
					data.bPos += 1;
					break;
				case 17:
					data.fPos += 2;
					break;
				case 18:
					data.fPos += 2;
					break;
				case 19:
					data.oPos += 1;
					break;
				case 20:
					data.oPos += 1;
					break;
				case 21:case 22:
					break;
				default:
				}
				data.prev = openfl_display__$internal_DrawCommandType.BEGIN_BITMAP_FILL;
				var c = data;
				graphicsData.push(new openfl_display_GraphicsBitmapFill(c.buffer.o[c.oPos],c.buffer.o[c.oPos + 1],c.buffer.b[c.bPos],c.buffer.b[c.bPos + 1]));
				break;
			case 1:
				switch(data.prev._hx_index) {
				case 0:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 1:
					data.iPos += 1;
					data.fPos += 1;
					break;
				case 2:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 3:
					data.oPos += 1;
					break;
				case 4:
					data.fPos += 6;
					break;
				case 5:
					data.fPos += 4;
					break;
				case 6:
					data.fPos += 3;
					break;
				case 7:
					data.fPos += 4;
					break;
				case 8:
					data.oPos += 3;
					break;
				case 9:
					data.fPos += 4;
					break;
				case 10:
					data.fPos += 5;
					data.oPos += 1;
					break;
				case 12:
					data.oPos += 4;
					break;
				case 13:
					break;
				case 14:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 15:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 16:
					data.oPos += 4;
					data.iPos += 1;
					data.fPos += 2;
					data.bPos += 1;
					break;
				case 17:
					data.fPos += 2;
					break;
				case 18:
					data.fPos += 2;
					break;
				case 19:
					data.oPos += 1;
					break;
				case 20:
					data.oPos += 1;
					break;
				case 21:case 22:
					break;
				default:
				}
				data.prev = openfl_display__$internal_DrawCommandType.BEGIN_FILL;
				var c1 = data;
				graphicsData.push(new openfl_display_GraphicsSolidFill(c1.buffer.i[c1.iPos],c1.buffer.f[c1.fPos]));
				break;
			case 2:
				switch(data.prev._hx_index) {
				case 0:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 1:
					data.iPos += 1;
					data.fPos += 1;
					break;
				case 2:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 3:
					data.oPos += 1;
					break;
				case 4:
					data.fPos += 6;
					break;
				case 5:
					data.fPos += 4;
					break;
				case 6:
					data.fPos += 3;
					break;
				case 7:
					data.fPos += 4;
					break;
				case 8:
					data.oPos += 3;
					break;
				case 9:
					data.fPos += 4;
					break;
				case 10:
					data.fPos += 5;
					data.oPos += 1;
					break;
				case 12:
					data.oPos += 4;
					break;
				case 13:
					break;
				case 14:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 15:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 16:
					data.oPos += 4;
					data.iPos += 1;
					data.fPos += 2;
					data.bPos += 1;
					break;
				case 17:
					data.fPos += 2;
					break;
				case 18:
					data.fPos += 2;
					break;
				case 19:
					data.oPos += 1;
					break;
				case 20:
					data.oPos += 1;
					break;
				case 21:case 22:
					break;
				default:
				}
				data.prev = openfl_display__$internal_DrawCommandType.BEGIN_GRADIENT_FILL;
				var c2 = data;
				graphicsData.push(new openfl_display_GraphicsGradientFill(c2.buffer.o[c2.oPos],c2.buffer.ii[c2.iiPos],c2.buffer.ff[c2.ffPos],c2.buffer.ii[c2.iiPos + 1],c2.buffer.o[c2.oPos + 1],c2.buffer.o[c2.oPos + 2],c2.buffer.o[c2.oPos + 3],c2.buffer.f[c2.fPos]));
				break;
			case 3:
				break;
			case 4:
				switch(data.prev._hx_index) {
				case 0:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 1:
					data.iPos += 1;
					data.fPos += 1;
					break;
				case 2:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 3:
					data.oPos += 1;
					break;
				case 4:
					data.fPos += 6;
					break;
				case 5:
					data.fPos += 4;
					break;
				case 6:
					data.fPos += 3;
					break;
				case 7:
					data.fPos += 4;
					break;
				case 8:
					data.oPos += 3;
					break;
				case 9:
					data.fPos += 4;
					break;
				case 10:
					data.fPos += 5;
					data.oPos += 1;
					break;
				case 12:
					data.oPos += 4;
					break;
				case 13:
					break;
				case 14:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 15:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 16:
					data.oPos += 4;
					data.iPos += 1;
					data.fPos += 2;
					data.bPos += 1;
					break;
				case 17:
					data.fPos += 2;
					break;
				case 18:
					data.fPos += 2;
					break;
				case 19:
					data.oPos += 1;
					break;
				case 20:
					data.oPos += 1;
					break;
				case 21:case 22:
					break;
				default:
				}
				data.prev = openfl_display__$internal_DrawCommandType.CUBIC_CURVE_TO;
				var c3 = data;
				path.cubicCurveTo(c3.buffer.f[c3.fPos],c3.buffer.f[c3.fPos + 1],c3.buffer.f[c3.fPos + 2],c3.buffer.f[c3.fPos + 3],c3.buffer.f[c3.fPos + 4],c3.buffer.f[c3.fPos + 5]);
				break;
			case 5:
				switch(data.prev._hx_index) {
				case 0:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 1:
					data.iPos += 1;
					data.fPos += 1;
					break;
				case 2:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 3:
					data.oPos += 1;
					break;
				case 4:
					data.fPos += 6;
					break;
				case 5:
					data.fPos += 4;
					break;
				case 6:
					data.fPos += 3;
					break;
				case 7:
					data.fPos += 4;
					break;
				case 8:
					data.oPos += 3;
					break;
				case 9:
					data.fPos += 4;
					break;
				case 10:
					data.fPos += 5;
					data.oPos += 1;
					break;
				case 12:
					data.oPos += 4;
					break;
				case 13:
					break;
				case 14:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 15:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 16:
					data.oPos += 4;
					data.iPos += 1;
					data.fPos += 2;
					data.bPos += 1;
					break;
				case 17:
					data.fPos += 2;
					break;
				case 18:
					data.fPos += 2;
					break;
				case 19:
					data.oPos += 1;
					break;
				case 20:
					data.oPos += 1;
					break;
				case 21:case 22:
					break;
				default:
				}
				data.prev = openfl_display__$internal_DrawCommandType.CURVE_TO;
				var c4 = data;
				path.curveTo(c4.buffer.f[c4.fPos],c4.buffer.f[c4.fPos + 1],c4.buffer.f[c4.fPos + 2],c4.buffer.f[c4.fPos + 3]);
				break;
			case 6:
				switch(data.prev._hx_index) {
				case 0:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 1:
					data.iPos += 1;
					data.fPos += 1;
					break;
				case 2:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 3:
					data.oPos += 1;
					break;
				case 4:
					data.fPos += 6;
					break;
				case 5:
					data.fPos += 4;
					break;
				case 6:
					data.fPos += 3;
					break;
				case 7:
					data.fPos += 4;
					break;
				case 8:
					data.oPos += 3;
					break;
				case 9:
					data.fPos += 4;
					break;
				case 10:
					data.fPos += 5;
					data.oPos += 1;
					break;
				case 12:
					data.oPos += 4;
					break;
				case 13:
					break;
				case 14:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 15:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 16:
					data.oPos += 4;
					data.iPos += 1;
					data.fPos += 2;
					data.bPos += 1;
					break;
				case 17:
					data.fPos += 2;
					break;
				case 18:
					data.fPos += 2;
					break;
				case 19:
					data.oPos += 1;
					break;
				case 20:
					data.oPos += 1;
					break;
				case 21:case 22:
					break;
				default:
				}
				data.prev = openfl_display__$internal_DrawCommandType.DRAW_CIRCLE;
				var c5 = data;
				path.__drawCircle(c5.buffer.f[c5.fPos],c5.buffer.f[c5.fPos + 1],c5.buffer.f[c5.fPos + 2]);
				break;
			case 7:
				switch(data.prev._hx_index) {
				case 0:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 1:
					data.iPos += 1;
					data.fPos += 1;
					break;
				case 2:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 3:
					data.oPos += 1;
					break;
				case 4:
					data.fPos += 6;
					break;
				case 5:
					data.fPos += 4;
					break;
				case 6:
					data.fPos += 3;
					break;
				case 7:
					data.fPos += 4;
					break;
				case 8:
					data.oPos += 3;
					break;
				case 9:
					data.fPos += 4;
					break;
				case 10:
					data.fPos += 5;
					data.oPos += 1;
					break;
				case 12:
					data.oPos += 4;
					break;
				case 13:
					break;
				case 14:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 15:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 16:
					data.oPos += 4;
					data.iPos += 1;
					data.fPos += 2;
					data.bPos += 1;
					break;
				case 17:
					data.fPos += 2;
					break;
				case 18:
					data.fPos += 2;
					break;
				case 19:
					data.oPos += 1;
					break;
				case 20:
					data.oPos += 1;
					break;
				case 21:case 22:
					break;
				default:
				}
				data.prev = openfl_display__$internal_DrawCommandType.DRAW_ELLIPSE;
				var c6 = data;
				path.__drawEllipse(c6.buffer.f[c6.fPos],c6.buffer.f[c6.fPos + 1],c6.buffer.f[c6.fPos + 2],c6.buffer.f[c6.fPos + 3]);
				break;
			case 9:
				switch(data.prev._hx_index) {
				case 0:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 1:
					data.iPos += 1;
					data.fPos += 1;
					break;
				case 2:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 3:
					data.oPos += 1;
					break;
				case 4:
					data.fPos += 6;
					break;
				case 5:
					data.fPos += 4;
					break;
				case 6:
					data.fPos += 3;
					break;
				case 7:
					data.fPos += 4;
					break;
				case 8:
					data.oPos += 3;
					break;
				case 9:
					data.fPos += 4;
					break;
				case 10:
					data.fPos += 5;
					data.oPos += 1;
					break;
				case 12:
					data.oPos += 4;
					break;
				case 13:
					break;
				case 14:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 15:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 16:
					data.oPos += 4;
					data.iPos += 1;
					data.fPos += 2;
					data.bPos += 1;
					break;
				case 17:
					data.fPos += 2;
					break;
				case 18:
					data.fPos += 2;
					break;
				case 19:
					data.oPos += 1;
					break;
				case 20:
					data.oPos += 1;
					break;
				case 21:case 22:
					break;
				default:
				}
				data.prev = openfl_display__$internal_DrawCommandType.DRAW_RECT;
				var c7 = data;
				path.__drawRect(c7.buffer.f[c7.fPos],c7.buffer.f[c7.fPos + 1],c7.buffer.f[c7.fPos + 2],c7.buffer.f[c7.fPos + 3]);
				break;
			case 10:
				switch(data.prev._hx_index) {
				case 0:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 1:
					data.iPos += 1;
					data.fPos += 1;
					break;
				case 2:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 3:
					data.oPos += 1;
					break;
				case 4:
					data.fPos += 6;
					break;
				case 5:
					data.fPos += 4;
					break;
				case 6:
					data.fPos += 3;
					break;
				case 7:
					data.fPos += 4;
					break;
				case 8:
					data.oPos += 3;
					break;
				case 9:
					data.fPos += 4;
					break;
				case 10:
					data.fPos += 5;
					data.oPos += 1;
					break;
				case 12:
					data.oPos += 4;
					break;
				case 13:
					break;
				case 14:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 15:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 16:
					data.oPos += 4;
					data.iPos += 1;
					data.fPos += 2;
					data.bPos += 1;
					break;
				case 17:
					data.fPos += 2;
					break;
				case 18:
					data.fPos += 2;
					break;
				case 19:
					data.oPos += 1;
					break;
				case 20:
					data.oPos += 1;
					break;
				case 21:case 22:
					break;
				default:
				}
				data.prev = openfl_display__$internal_DrawCommandType.DRAW_ROUND_RECT;
				var c8 = data;
				path.__drawRoundRect(c8.buffer.f[c8.fPos],c8.buffer.f[c8.fPos + 1],c8.buffer.f[c8.fPos + 2],c8.buffer.f[c8.fPos + 3],c8.buffer.f[c8.fPos + 4],c8.buffer.o[c8.oPos] != null ? c8.buffer.o[c8.oPos] : c8.buffer.f[c8.fPos + 4]);
				break;
			case 13:
				switch(data.prev._hx_index) {
				case 0:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 1:
					data.iPos += 1;
					data.fPos += 1;
					break;
				case 2:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 3:
					data.oPos += 1;
					break;
				case 4:
					data.fPos += 6;
					break;
				case 5:
					data.fPos += 4;
					break;
				case 6:
					data.fPos += 3;
					break;
				case 7:
					data.fPos += 4;
					break;
				case 8:
					data.oPos += 3;
					break;
				case 9:
					data.fPos += 4;
					break;
				case 10:
					data.fPos += 5;
					data.oPos += 1;
					break;
				case 12:
					data.oPos += 4;
					break;
				case 13:
					break;
				case 14:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 15:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 16:
					data.oPos += 4;
					data.iPos += 1;
					data.fPos += 2;
					data.bPos += 1;
					break;
				case 17:
					data.fPos += 2;
					break;
				case 18:
					data.fPos += 2;
					break;
				case 19:
					data.oPos += 1;
					break;
				case 20:
					data.oPos += 1;
					break;
				case 21:case 22:
					break;
				default:
				}
				data.prev = openfl_display__$internal_DrawCommandType.END_FILL;
				var this1 = data;
				graphicsData.push(new openfl_display_GraphicsEndFill());
				break;
			case 14:
				switch(data.prev._hx_index) {
				case 0:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 1:
					data.iPos += 1;
					data.fPos += 1;
					break;
				case 2:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 3:
					data.oPos += 1;
					break;
				case 4:
					data.fPos += 6;
					break;
				case 5:
					data.fPos += 4;
					break;
				case 6:
					data.fPos += 3;
					break;
				case 7:
					data.fPos += 4;
					break;
				case 8:
					data.oPos += 3;
					break;
				case 9:
					data.fPos += 4;
					break;
				case 10:
					data.fPos += 5;
					data.oPos += 1;
					break;
				case 12:
					data.oPos += 4;
					break;
				case 13:
					break;
				case 14:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 15:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 16:
					data.oPos += 4;
					data.iPos += 1;
					data.fPos += 2;
					data.bPos += 1;
					break;
				case 17:
					data.fPos += 2;
					break;
				case 18:
					data.fPos += 2;
					break;
				case 19:
					data.oPos += 1;
					break;
				case 20:
					data.oPos += 1;
					break;
				case 21:case 22:
					break;
				default:
				}
				data.prev = openfl_display__$internal_DrawCommandType.LINE_BITMAP_STYLE;
				var c9 = data;
				path = null;
				break;
			case 15:
				switch(data.prev._hx_index) {
				case 0:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 1:
					data.iPos += 1;
					data.fPos += 1;
					break;
				case 2:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 3:
					data.oPos += 1;
					break;
				case 4:
					data.fPos += 6;
					break;
				case 5:
					data.fPos += 4;
					break;
				case 6:
					data.fPos += 3;
					break;
				case 7:
					data.fPos += 4;
					break;
				case 8:
					data.oPos += 3;
					break;
				case 9:
					data.fPos += 4;
					break;
				case 10:
					data.fPos += 5;
					data.oPos += 1;
					break;
				case 12:
					data.oPos += 4;
					break;
				case 13:
					break;
				case 14:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 15:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 16:
					data.oPos += 4;
					data.iPos += 1;
					data.fPos += 2;
					data.bPos += 1;
					break;
				case 17:
					data.fPos += 2;
					break;
				case 18:
					data.fPos += 2;
					break;
				case 19:
					data.oPos += 1;
					break;
				case 20:
					data.oPos += 1;
					break;
				case 21:case 22:
					break;
				default:
				}
				data.prev = openfl_display__$internal_DrawCommandType.LINE_GRADIENT_STYLE;
				var c10 = data;
				break;
			case 16:
				switch(data.prev._hx_index) {
				case 0:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 1:
					data.iPos += 1;
					data.fPos += 1;
					break;
				case 2:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 3:
					data.oPos += 1;
					break;
				case 4:
					data.fPos += 6;
					break;
				case 5:
					data.fPos += 4;
					break;
				case 6:
					data.fPos += 3;
					break;
				case 7:
					data.fPos += 4;
					break;
				case 8:
					data.oPos += 3;
					break;
				case 9:
					data.fPos += 4;
					break;
				case 10:
					data.fPos += 5;
					data.oPos += 1;
					break;
				case 12:
					data.oPos += 4;
					break;
				case 13:
					break;
				case 14:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 15:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 16:
					data.oPos += 4;
					data.iPos += 1;
					data.fPos += 2;
					data.bPos += 1;
					break;
				case 17:
					data.fPos += 2;
					break;
				case 18:
					data.fPos += 2;
					break;
				case 19:
					data.oPos += 1;
					break;
				case 20:
					data.oPos += 1;
					break;
				case 21:case 22:
					break;
				default:
				}
				data.prev = openfl_display__$internal_DrawCommandType.LINE_STYLE;
				var c11 = data;
				stroke = new openfl_display_GraphicsStroke(c11.buffer.o[c11.oPos],c11.buffer.b[c11.bPos],c11.buffer.o[c11.oPos + 1],c11.buffer.o[c11.oPos + 2],c11.buffer.o[c11.oPos + 3],c11.buffer.f[c11.fPos + 1]);
				stroke.fill = new openfl_display_GraphicsSolidFill(c11.buffer.i[c11.iPos],c11.buffer.f[c11.fPos]);
				graphicsData.push(stroke);
				break;
			case 17:
				switch(data.prev._hx_index) {
				case 0:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 1:
					data.iPos += 1;
					data.fPos += 1;
					break;
				case 2:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 3:
					data.oPos += 1;
					break;
				case 4:
					data.fPos += 6;
					break;
				case 5:
					data.fPos += 4;
					break;
				case 6:
					data.fPos += 3;
					break;
				case 7:
					data.fPos += 4;
					break;
				case 8:
					data.oPos += 3;
					break;
				case 9:
					data.fPos += 4;
					break;
				case 10:
					data.fPos += 5;
					data.oPos += 1;
					break;
				case 12:
					data.oPos += 4;
					break;
				case 13:
					break;
				case 14:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 15:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 16:
					data.oPos += 4;
					data.iPos += 1;
					data.fPos += 2;
					data.bPos += 1;
					break;
				case 17:
					data.fPos += 2;
					break;
				case 18:
					data.fPos += 2;
					break;
				case 19:
					data.oPos += 1;
					break;
				case 20:
					data.oPos += 1;
					break;
				case 21:case 22:
					break;
				default:
				}
				data.prev = openfl_display__$internal_DrawCommandType.LINE_TO;
				var c12 = data;
				path.lineTo(c12.buffer.f[c12.fPos],c12.buffer.f[c12.fPos + 1]);
				break;
			case 18:
				switch(data.prev._hx_index) {
				case 0:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 1:
					data.iPos += 1;
					data.fPos += 1;
					break;
				case 2:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 3:
					data.oPos += 1;
					break;
				case 4:
					data.fPos += 6;
					break;
				case 5:
					data.fPos += 4;
					break;
				case 6:
					data.fPos += 3;
					break;
				case 7:
					data.fPos += 4;
					break;
				case 8:
					data.oPos += 3;
					break;
				case 9:
					data.fPos += 4;
					break;
				case 10:
					data.fPos += 5;
					data.oPos += 1;
					break;
				case 12:
					data.oPos += 4;
					break;
				case 13:
					break;
				case 14:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 15:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 16:
					data.oPos += 4;
					data.iPos += 1;
					data.fPos += 2;
					data.bPos += 1;
					break;
				case 17:
					data.fPos += 2;
					break;
				case 18:
					data.fPos += 2;
					break;
				case 19:
					data.oPos += 1;
					break;
				case 20:
					data.oPos += 1;
					break;
				case 21:case 22:
					break;
				default:
				}
				data.prev = openfl_display__$internal_DrawCommandType.MOVE_TO;
				var c13 = data;
				path.moveTo(c13.buffer.f[c13.fPos],c13.buffer.f[c13.fPos + 1]);
				break;
			default:
				switch(data.prev._hx_index) {
				case 0:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 1:
					data.iPos += 1;
					data.fPos += 1;
					break;
				case 2:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 3:
					data.oPos += 1;
					break;
				case 4:
					data.fPos += 6;
					break;
				case 5:
					data.fPos += 4;
					break;
				case 6:
					data.fPos += 3;
					break;
				case 7:
					data.fPos += 4;
					break;
				case 8:
					data.oPos += 3;
					break;
				case 9:
					data.fPos += 4;
					break;
				case 10:
					data.fPos += 5;
					data.oPos += 1;
					break;
				case 12:
					data.oPos += 4;
					break;
				case 13:
					break;
				case 14:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 15:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 16:
					data.oPos += 4;
					data.iPos += 1;
					data.fPos += 2;
					data.bPos += 1;
					break;
				case 17:
					data.fPos += 2;
					break;
				case 18:
					data.fPos += 2;
					break;
				case 19:
					data.oPos += 1;
					break;
				case 20:
					data.oPos += 1;
					break;
				case 21:case 22:
					break;
				default:
				}
				data.prev = type;
			}
		}
		if(path != null) {
			graphicsData.push(path);
		}
	}
	,__update: function(displayMatrix,pixelRatio) {
		if(this.__bounds == null || this.__bounds.width <= 0 || this.__bounds.height <= 0) {
			if(this.__width >= 1 || this.__height >= 1) {
				this.set___dirty(true);
			}
			this.__width = 0;
			this.__height = 0;
			return;
		}
		var parentTransform = this.__owner.__renderTransform;
		if(parentTransform == null) {
			return;
		}
		var scaleX = pixelRatio;
		var scaleY = pixelRatio;
		var calculateScale = true;
		if(calculateScale) {
			if(parentTransform.b == 0) {
				scaleX = Math.abs(parentTransform.a);
			} else {
				scaleX = Math.sqrt(parentTransform.a * parentTransform.a + parentTransform.b * parentTransform.b);
			}
			if(parentTransform.c == 0) {
				scaleY = Math.abs(parentTransform.d);
			} else {
				scaleY = Math.sqrt(parentTransform.c * parentTransform.c + parentTransform.d * parentTransform.d);
			}
			if(displayMatrix != null) {
				if(displayMatrix.b == 0) {
					scaleX *= displayMatrix.a;
				} else {
					scaleX *= Math.sqrt(displayMatrix.a * displayMatrix.a + displayMatrix.b * displayMatrix.b);
				}
				if(displayMatrix.c == 0) {
					scaleY *= displayMatrix.d;
				} else {
					scaleY *= Math.sqrt(displayMatrix.c * displayMatrix.c + displayMatrix.d * displayMatrix.d);
				}
			}
		}
		var width = Math.abs(this.__bounds.width * scaleX);
		var height = Math.abs(this.__bounds.height * scaleY);
		if(width < 1 || height < 1) {
			if(this.__width >= 1 || this.__height >= 1) {
				this.set___dirty(true);
			}
			this.__width = 0;
			this.__height = 0;
			return;
		}
		if(openfl_display_Graphics.maxTextureWidth != null && width > openfl_display_Graphics.maxTextureWidth) {
			width = openfl_display_Graphics.maxTextureWidth;
			scaleX = openfl_display_Graphics.maxTextureWidth / this.__bounds.width;
		}
		if(openfl_display_Graphics.maxTextureWidth != null && height > openfl_display_Graphics.maxTextureHeight) {
			height = openfl_display_Graphics.maxTextureHeight;
			scaleY = openfl_display_Graphics.maxTextureHeight / this.__bounds.height;
		}
		var newWidth = Math.ceil(width + 1.0);
		var newHeight = Math.ceil(height + 1.0);
		var inverseA;
		var inverseD;
		if(this.__owner.__worldScale9Grid != null) {
			this.__renderTransform.a = pixelRatio;
			this.__renderTransform.d = pixelRatio;
			inverseA = 1 / pixelRatio;
			inverseD = 1 / pixelRatio;
		} else {
			this.__renderTransform.a = newWidth / this.__bounds.width;
			this.__renderTransform.d = newHeight / this.__bounds.height;
			inverseA = 1 / this.__renderTransform.a;
			inverseD = 1 / this.__renderTransform.d;
		}
		this.__worldTransform.a = inverseA * parentTransform.a;
		this.__worldTransform.b = inverseA * parentTransform.b;
		this.__worldTransform.c = inverseD * parentTransform.c;
		this.__worldTransform.d = inverseD * parentTransform.d;
		var x = this.__bounds.x;
		var y = this.__bounds.y;
		var tx = x * parentTransform.a + y * parentTransform.c + parentTransform.tx;
		var ty = x * parentTransform.b + y * parentTransform.d + parentTransform.ty;
		if(pixelRatio > 1.0) {
			var nativePixelSize = 1 / pixelRatio;
			this.__worldTransform.tx = Math.round(tx / nativePixelSize) * nativePixelSize;
			this.__worldTransform.ty = Math.round(ty / nativePixelSize) * nativePixelSize;
		} else {
			this.__worldTransform.tx = Math.round(tx);
			this.__worldTransform.ty = Math.round(ty);
		}
		var _this = this.__worldTransform;
		var norm = _this.a * _this.d - _this.b * _this.c;
		this.__renderTransform.tx = norm == 0 ? -_this.tx : 1.0 / norm * (_this.c * (_this.ty - ty) + _this.d * (tx - _this.tx));
		var _this = this.__worldTransform;
		var norm = _this.a * _this.d - _this.b * _this.c;
		this.__renderTransform.ty = norm == 0 ? -_this.ty : 1.0 / norm * (_this.a * (ty - _this.ty) + _this.b * (_this.tx - tx));
		if(newWidth != this.__width || newHeight != this.__height) {
			this.set___dirty(true);
		}
		this.__width = newWidth;
		this.__height = newHeight;
	}
	,set___dirty: function(value) {
		if(value && this.__owner != null) {
			var _this = this.__owner;
			if(!_this.__renderDirty) {
				_this.__renderDirty = true;
				_this.__setParentRenderDirty();
			}
		}
		if(value) {
			this.__softwareDirty = true;
			this.__hardwareDirty = true;
		}
		return this.__dirty = value;
	}
	,__class__: openfl_display_Graphics
	,__properties__: {set___dirty:"set___dirty"}
};
var openfl_display_IGraphicsFill = function() { };
$hxClasses["openfl.display.IGraphicsFill"] = openfl_display_IGraphicsFill;
openfl_display_IGraphicsFill.__name__ = "openfl.display.IGraphicsFill";
openfl_display_IGraphicsFill.__isInterface__ = true;
openfl_display_IGraphicsFill.prototype = {
	__graphicsFillType: null
	,__class__: openfl_display_IGraphicsFill
};
var openfl_display_IGraphicsData = function() { };
$hxClasses["openfl.display.IGraphicsData"] = openfl_display_IGraphicsData;
openfl_display_IGraphicsData.__name__ = "openfl.display.IGraphicsData";
openfl_display_IGraphicsData.__isInterface__ = true;
openfl_display_IGraphicsData.prototype = {
	__graphicsDataType: null
	,__class__: openfl_display_IGraphicsData
};
var openfl_display_GraphicsBitmapFill = function(bitmapData,matrix,repeat,smooth) {
	if(smooth == null) {
		smooth = false;
	}
	if(repeat == null) {
		repeat = true;
	}
	this.bitmapData = bitmapData;
	this.matrix = matrix;
	this.repeat = repeat;
	this.smooth = smooth;
	this.__graphicsDataType = 4;
	this.__graphicsFillType = 2;
};
$hxClasses["openfl.display.GraphicsBitmapFill"] = openfl_display_GraphicsBitmapFill;
openfl_display_GraphicsBitmapFill.__name__ = "openfl.display.GraphicsBitmapFill";
openfl_display_GraphicsBitmapFill.__interfaces__ = [openfl_display_IGraphicsFill,openfl_display_IGraphicsData];
openfl_display_GraphicsBitmapFill.prototype = {
	bitmapData: null
	,matrix: null
	,repeat: null
	,smooth: null
	,__graphicsDataType: null
	,__graphicsFillType: null
	,__class__: openfl_display_GraphicsBitmapFill
};
var openfl_display_GraphicsEndFill = function() {
	this.__graphicsDataType = 5;
	this.__graphicsFillType = 3;
};
$hxClasses["openfl.display.GraphicsEndFill"] = openfl_display_GraphicsEndFill;
openfl_display_GraphicsEndFill.__name__ = "openfl.display.GraphicsEndFill";
openfl_display_GraphicsEndFill.__interfaces__ = [openfl_display_IGraphicsFill,openfl_display_IGraphicsData];
openfl_display_GraphicsEndFill.prototype = {
	__graphicsDataType: null
	,__graphicsFillType: null
	,__class__: openfl_display_GraphicsEndFill
};
var openfl_display_GraphicsGradientFill = function(type,colors,alphas,ratios,matrix,spreadMethod,interpolationMethod,focalPointRatio) {
	if(focalPointRatio == null) {
		focalPointRatio = 0;
	}
	if(type == null) {
		type = 0;
	}
	if(spreadMethod == null) {
		spreadMethod = 0;
	}
	if(interpolationMethod == null) {
		interpolationMethod = 1;
	}
	this.type = type;
	this.colors = colors;
	this.alphas = alphas;
	this.ratios = ratios;
	this.matrix = matrix;
	this.spreadMethod = spreadMethod;
	this.interpolationMethod = interpolationMethod;
	this.focalPointRatio = focalPointRatio;
	this.__graphicsDataType = 2;
	this.__graphicsFillType = 1;
};
$hxClasses["openfl.display.GraphicsGradientFill"] = openfl_display_GraphicsGradientFill;
openfl_display_GraphicsGradientFill.__name__ = "openfl.display.GraphicsGradientFill";
openfl_display_GraphicsGradientFill.__interfaces__ = [openfl_display_IGraphicsFill,openfl_display_IGraphicsData];
openfl_display_GraphicsGradientFill.prototype = {
	alphas: null
	,colors: null
	,focalPointRatio: null
	,interpolationMethod: null
	,matrix: null
	,ratios: null
	,spreadMethod: null
	,type: null
	,__graphicsDataType: null
	,__graphicsFillType: null
	,__class__: openfl_display_GraphicsGradientFill
};
var openfl_display_IGraphicsPath = function() { };
$hxClasses["openfl.display.IGraphicsPath"] = openfl_display_IGraphicsPath;
openfl_display_IGraphicsPath.__name__ = "openfl.display.IGraphicsPath";
openfl_display_IGraphicsPath.__isInterface__ = true;
var openfl_display_GraphicsPath = function(commands,data,winding) {
	if(winding == null) {
		winding = 0;
	}
	this.commands = commands;
	this.data = data;
	this.winding = winding;
	this.__graphicsDataType = 3;
};
$hxClasses["openfl.display.GraphicsPath"] = openfl_display_GraphicsPath;
openfl_display_GraphicsPath.__name__ = "openfl.display.GraphicsPath";
openfl_display_GraphicsPath.__interfaces__ = [openfl_display_IGraphicsPath,openfl_display_IGraphicsData];
openfl_display_GraphicsPath.prototype = {
	commands: null
	,data: null
	,winding: null
	,__graphicsDataType: null
	,cubicCurveTo: function(controlX1,controlY1,controlX2,controlY2,anchorX,anchorY) {
		if(this.commands == null) {
			this.commands = openfl_Vector.toIntVector(null);
		}
		if(this.data == null) {
			this.data = openfl_Vector.toFloatVector(null);
		}
		this.commands.push(6);
		this.data.push(controlX1);
		this.data.push(controlY1);
		this.data.push(controlX2);
		this.data.push(controlY2);
		this.data.push(anchorX);
		this.data.push(anchorY);
	}
	,curveTo: function(controlX,controlY,anchorX,anchorY) {
		if(this.commands == null) {
			this.commands = openfl_Vector.toIntVector(null);
		}
		if(this.data == null) {
			this.data = openfl_Vector.toFloatVector(null);
		}
		this.commands.push(3);
		this.data.push(controlX);
		this.data.push(controlY);
		this.data.push(anchorX);
		this.data.push(anchorY);
	}
	,lineTo: function(x,y) {
		if(this.commands == null) {
			this.commands = openfl_Vector.toIntVector(null);
		}
		if(this.data == null) {
			this.data = openfl_Vector.toFloatVector(null);
		}
		this.commands.push(2);
		this.data.push(x);
		this.data.push(y);
	}
	,moveTo: function(x,y) {
		if(this.commands == null) {
			this.commands = openfl_Vector.toIntVector(null);
		}
		if(this.data == null) {
			this.data = openfl_Vector.toFloatVector(null);
		}
		this.commands.push(1);
		this.data.push(x);
		this.data.push(y);
	}
	,wideLineTo: function(x,y) {
		if(this.commands == null) {
			this.commands = openfl_Vector.toIntVector(null);
		}
		if(this.data == null) {
			this.data = openfl_Vector.toFloatVector(null);
		}
		this.commands.push(2);
		this.data.push(x);
		this.data.push(y);
	}
	,wideMoveTo: function(x,y) {
		if(this.commands == null) {
			this.commands = openfl_Vector.toIntVector(null);
		}
		if(this.data == null) {
			this.data = openfl_Vector.toFloatVector(null);
		}
		this.commands.push(1);
		this.data.push(x);
		this.data.push(y);
	}
	,__drawCircle: function(x,y,radius) {
		this.__drawRoundRect(x - radius,y - radius,radius * 2,radius * 2,radius * 2,radius * 2);
	}
	,__drawEllipse: function(x,y,width,height) {
		this.__drawRoundRect(x,y,width,height,width,height);
	}
	,__drawRect: function(x,y,width,height) {
		this.moveTo(x,y);
		this.lineTo(x + width,y);
		this.lineTo(x + width,y + height);
		this.lineTo(x,y + height);
		this.lineTo(x,y);
	}
	,__drawRoundRect: function(x,y,width,height,ellipseWidth,ellipseHeight) {
		ellipseWidth *= 0.5;
		ellipseHeight *= 0.5;
		if(ellipseWidth > width / 2) {
			ellipseWidth = width / 2;
		}
		if(ellipseHeight > height / 2) {
			ellipseHeight = height / 2;
		}
		var xe = x + width;
		var ye = y + height;
		var cx1 = -ellipseWidth + ellipseWidth * 0.70710678118654752440084436210485;
		var cx2 = -ellipseWidth + ellipseWidth * 0.4142135623730950488016887242097;
		var cy1 = -ellipseHeight + ellipseHeight * 0.70710678118654752440084436210485;
		var cy2 = -ellipseHeight + ellipseHeight * 0.4142135623730950488016887242097;
		this.moveTo(xe,ye - ellipseHeight);
		this.curveTo(xe,ye + cy2,xe + cx1,ye + cy1);
		this.curveTo(xe + cx2,ye,xe - ellipseWidth,ye);
		this.lineTo(x + ellipseWidth,ye);
		this.curveTo(x - cx2,ye,x - cx1,ye + cy1);
		this.curveTo(x,ye + cy2,x,ye - ellipseHeight);
		this.lineTo(x,y + ellipseHeight);
		this.curveTo(x,y - cy2,x - cx1,y - cy1);
		this.curveTo(x - cx2,y,x + ellipseWidth,y);
		this.lineTo(xe - ellipseWidth,y);
		this.curveTo(xe + cx2,y,xe + cx1,y - cy1);
		this.curveTo(xe,y - cy2,xe,y + ellipseHeight);
		this.lineTo(xe,ye - ellipseHeight);
	}
	,__class__: openfl_display_GraphicsPath
};
var openfl_display_GraphicsPathWinding = {};
openfl_display_GraphicsPathWinding.fromString = function(value) {
	switch(value) {
	case "evenOdd":
		return 0;
	case "nonZero":
		return 1;
	default:
		return null;
	}
};
openfl_display_GraphicsPathWinding.toString = function(this1) {
	switch(this1) {
	case 0:
		return "evenOdd";
	case 1:
		return "nonZero";
	default:
		return null;
	}
};
var openfl_display_GraphicsQuadPath = function(rects,indices,transforms) {
	this.rects = rects;
	this.indices = indices;
	this.transforms = transforms;
	this.__graphicsDataType = 6;
};
$hxClasses["openfl.display.GraphicsQuadPath"] = openfl_display_GraphicsQuadPath;
openfl_display_GraphicsQuadPath.__name__ = "openfl.display.GraphicsQuadPath";
openfl_display_GraphicsQuadPath.__interfaces__ = [openfl_display_IGraphicsPath,openfl_display_IGraphicsData];
openfl_display_GraphicsQuadPath.prototype = {
	indices: null
	,rects: null
	,transforms: null
	,__graphicsDataType: null
	,__class__: openfl_display_GraphicsQuadPath
};
var openfl_display_GraphicsShader = function(code) {
	if(this.__glFragmentSource == null) {
		this.__glFragmentSource = "varying float openfl_Alphav;\n\t\tvarying vec4 openfl_ColorMultiplierv;\n\t\tvarying vec4 openfl_ColorOffsetv;\n\t\tvarying vec2 openfl_TextureCoordv;\n\n\t\tuniform bool openfl_HasColorTransform;\n\t\tuniform vec2 openfl_TextureSize;\n\t\tuniform sampler2D bitmap;\n\n\t\tvoid main(void) {\n\n\t\t\tvec4 color = texture2D (bitmap, openfl_TextureCoordv);\n\n\t\tif (color.a == 0.0) {\n\n\t\t\tgl_FragColor = vec4 (0.0, 0.0, 0.0, 0.0);\n\n\t\t} else if (openfl_HasColorTransform) {\n\n\t\t\tcolor = vec4 (color.rgb / color.a, color.a);\n\n\t\t\tmat4 colorMultiplier = mat4 (0);\n\t\t\tcolorMultiplier[0][0] = openfl_ColorMultiplierv.x;\n\t\t\tcolorMultiplier[1][1] = openfl_ColorMultiplierv.y;\n\t\t\tcolorMultiplier[2][2] = openfl_ColorMultiplierv.z;\n\t\t\tcolorMultiplier[3][3] = 1.0; // openfl_ColorMultiplierv.w;\n\n\t\t\tcolor = clamp (openfl_ColorOffsetv + (color * colorMultiplier), 0.0, 1.0);\n\n\t\t\tif (color.a > 0.0) {\n\n\t\t\t\tgl_FragColor = vec4 (color.rgb * color.a * openfl_Alphav, color.a * openfl_Alphav);\n\n\t\t\t} else {\n\n\t\t\t\tgl_FragColor = vec4 (0.0, 0.0, 0.0, 0.0);\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\tgl_FragColor = color * openfl_Alphav;\n\n\t\t}\n\n\t\t}";
	}
	if(this.__glVertexSource == null) {
		this.__glVertexSource = "attribute float openfl_Alpha;\n\t\tattribute vec4 openfl_ColorMultiplier;\n\t\tattribute vec4 openfl_ColorOffset;\n\t\tattribute vec4 openfl_Position;\n\t\tattribute vec2 openfl_TextureCoord;\n\n\t\tvarying float openfl_Alphav;\n\t\tvarying vec4 openfl_ColorMultiplierv;\n\t\tvarying vec4 openfl_ColorOffsetv;\n\t\tvarying vec2 openfl_TextureCoordv;\n\n\t\tuniform mat4 openfl_Matrix;\n\t\tuniform bool openfl_HasColorTransform;\n\t\tuniform vec2 openfl_TextureSize;\n\n\t\tvoid main(void) {\n\n\t\t\topenfl_Alphav = openfl_Alpha;\n\t\topenfl_TextureCoordv = openfl_TextureCoord;\n\n\t\tif (openfl_HasColorTransform) {\n\n\t\t\topenfl_ColorMultiplierv = openfl_ColorMultiplier;\n\t\t\topenfl_ColorOffsetv = openfl_ColorOffset / 255.0;\n\n\t\t}\n\n\t\tgl_Position = openfl_Matrix * openfl_Position;\n\n\t\t}";
	}
	openfl_display_Shader.call(this,code);
	this.__isGenerated = true;
	this.__initGL();
};
$hxClasses["openfl.display.GraphicsShader"] = openfl_display_GraphicsShader;
openfl_display_GraphicsShader.__name__ = "openfl.display.GraphicsShader";
openfl_display_GraphicsShader.__super__ = openfl_display_Shader;
openfl_display_GraphicsShader.prototype = $extend(openfl_display_Shader.prototype,{
	openfl_Alpha: null
	,openfl_ColorMultiplier: null
	,openfl_ColorOffset: null
	,openfl_Position: null
	,openfl_TextureCoord: null
	,openfl_Matrix: null
	,openfl_HasColorTransform: null
	,openfl_TextureSize: null
	,bitmap: null
	,__class__: openfl_display_GraphicsShader
});
var openfl_display_GraphicsShaderFill = function(shader,matrix) {
	this.shader = shader;
	this.matrix = matrix;
	this.__graphicsDataType = 8;
	this.__graphicsFillType = 4;
};
$hxClasses["openfl.display.GraphicsShaderFill"] = openfl_display_GraphicsShaderFill;
openfl_display_GraphicsShaderFill.__name__ = "openfl.display.GraphicsShaderFill";
openfl_display_GraphicsShaderFill.__interfaces__ = [openfl_display_IGraphicsFill,openfl_display_IGraphicsData];
openfl_display_GraphicsShaderFill.prototype = {
	matrix: null
	,shader: null
	,__graphicsDataType: null
	,__graphicsFillType: null
	,__class__: openfl_display_GraphicsShaderFill
};
var openfl_display_GraphicsSolidFill = function(color,alpha) {
	if(alpha == null) {
		alpha = 1;
	}
	if(color == null) {
		color = 0;
	}
	this.alpha = alpha;
	this.color = color;
	this.__graphicsDataType = 1;
	this.__graphicsFillType = 0;
};
$hxClasses["openfl.display.GraphicsSolidFill"] = openfl_display_GraphicsSolidFill;
openfl_display_GraphicsSolidFill.__name__ = "openfl.display.GraphicsSolidFill";
openfl_display_GraphicsSolidFill.__interfaces__ = [openfl_display_IGraphicsFill,openfl_display_IGraphicsData];
openfl_display_GraphicsSolidFill.prototype = {
	alpha: null
	,color: null
	,__graphicsDataType: null
	,__graphicsFillType: null
	,__class__: openfl_display_GraphicsSolidFill
};
var openfl_display_IGraphicsStroke = function() { };
$hxClasses["openfl.display.IGraphicsStroke"] = openfl_display_IGraphicsStroke;
openfl_display_IGraphicsStroke.__name__ = "openfl.display.IGraphicsStroke";
openfl_display_IGraphicsStroke.__isInterface__ = true;
var openfl_display_GraphicsStroke = function(thickness,pixelHinting,scaleMode,caps,joints,miterLimit,fill) {
	if(miterLimit == null) {
		miterLimit = 3;
	}
	if(joints == null) {
		joints = 2;
	}
	if(caps == null) {
		caps = 0;
	}
	if(scaleMode == null) {
		scaleMode = 2;
	}
	if(pixelHinting == null) {
		pixelHinting = false;
	}
	if(thickness == null) {
		thickness = NaN;
	}
	this.caps = caps;
	this.fill = fill;
	this.joints = joints;
	this.miterLimit = miterLimit;
	this.pixelHinting = pixelHinting;
	this.scaleMode = scaleMode;
	this.thickness = thickness;
	this.__graphicsDataType = 0;
};
$hxClasses["openfl.display.GraphicsStroke"] = openfl_display_GraphicsStroke;
openfl_display_GraphicsStroke.__name__ = "openfl.display.GraphicsStroke";
openfl_display_GraphicsStroke.__interfaces__ = [openfl_display_IGraphicsStroke,openfl_display_IGraphicsData];
openfl_display_GraphicsStroke.prototype = {
	caps: null
	,fill: null
	,joints: null
	,miterLimit: null
	,pixelHinting: null
	,scaleMode: null
	,thickness: null
	,__graphicsDataType: null
	,__class__: openfl_display_GraphicsStroke
};
var openfl_display_GraphicsTrianglePath = function(vertices,indices,uvtData,culling) {
	if(culling == null) {
		culling = 1;
	}
	this.vertices = vertices;
	this.indices = indices;
	this.uvtData = uvtData;
	this.culling = culling;
	this.__graphicsDataType = 7;
};
$hxClasses["openfl.display.GraphicsTrianglePath"] = openfl_display_GraphicsTrianglePath;
openfl_display_GraphicsTrianglePath.__name__ = "openfl.display.GraphicsTrianglePath";
openfl_display_GraphicsTrianglePath.__interfaces__ = [openfl_display_IGraphicsPath,openfl_display_IGraphicsData];
openfl_display_GraphicsTrianglePath.prototype = {
	culling: null
	,indices: null
	,uvtData: null
	,vertices: null
	,__graphicsDataType: null
	,__class__: openfl_display_GraphicsTrianglePath
};
var openfl_display_IDisplayObjectLoader = function() { };
$hxClasses["openfl.display.IDisplayObjectLoader"] = openfl_display_IDisplayObjectLoader;
openfl_display_IDisplayObjectLoader.__name__ = "openfl.display.IDisplayObjectLoader";
openfl_display_IDisplayObjectLoader.__isInterface__ = true;
openfl_display_IDisplayObjectLoader.prototype = {
	load: null
	,loadBytes: null
	,__class__: openfl_display_IDisplayObjectLoader
};
var openfl_display_ITileContainer = function() { };
$hxClasses["openfl.display.ITileContainer"] = openfl_display_ITileContainer;
openfl_display_ITileContainer.__name__ = "openfl.display.ITileContainer";
openfl_display_ITileContainer.__isInterface__ = true;
openfl_display_ITileContainer.prototype = {
	get_numTiles: null
	,addTile: null
	,addTileAt: null
	,addTiles: null
	,contains: null
	,getTileAt: null
	,getTileIndex: null
	,removeTile: null
	,removeTileAt: null
	,removeTiles: null
	,setTileIndex: null
	,sortTiles: null
	,swapTiles: null
	,swapTilesAt: null
	,__class__: openfl_display_ITileContainer
	,__properties__: {get_numTiles:"get_numTiles"}
};
var openfl_display_InterpolationMethod = {};
openfl_display_InterpolationMethod.fromInt = function(value) {
	return value;
};
openfl_display_InterpolationMethod.fromString = function(value) {
	switch(value) {
	case "linearRGB":
		return 0;
	case "rgb":
		return 1;
	default:
		return null;
	}
};
openfl_display_InterpolationMethod.toInt = function(this1) {
	return this1;
};
openfl_display_InterpolationMethod.toString = function(this1) {
	switch(this1) {
	case 0:
		return "linearRGB";
	case 1:
		return "rgb";
	default:
		return null;
	}
};
var openfl_display_JPEGEncoderOptions = function(quality) {
	if(quality == null) {
		quality = 80;
	}
	this.quality = quality;
};
$hxClasses["openfl.display.JPEGEncoderOptions"] = openfl_display_JPEGEncoderOptions;
openfl_display_JPEGEncoderOptions.__name__ = "openfl.display.JPEGEncoderOptions";
openfl_display_JPEGEncoderOptions.prototype = {
	quality: null
	,__class__: openfl_display_JPEGEncoderOptions
};
var openfl_display_JointStyle = {};
openfl_display_JointStyle.fromInt = function(value) {
	return value;
};
openfl_display_JointStyle.fromString = function(value) {
	switch(value) {
	case "bevel":
		return 0;
	case "miter":
		return 1;
	case "round":
		return 2;
	default:
		return null;
	}
};
openfl_display_JointStyle.toInt = function(this1) {
	return this1;
};
openfl_display_JointStyle.toString = function(this1) {
	switch(this1) {
	case 0:
		return "bevel";
	case 1:
		return "miter";
	case 2:
		return "round";
	default:
		return null;
	}
};
var openfl_display_LineScaleMode = {};
openfl_display_LineScaleMode.fromInt = function(value) {
	return value;
};
openfl_display_LineScaleMode.fromString = function(value) {
	switch(value) {
	case "horizontal":
		return 0;
	case "none":
		return 1;
	case "normal":
		return 2;
	case "vertical":
		return 3;
	default:
		return null;
	}
};
openfl_display_LineScaleMode.toInt = function(this1) {
	return this1;
};
openfl_display_LineScaleMode.toString = function(this1) {
	switch(this1) {
	case 0:
		return "horizontal";
	case 1:
		return "none";
	case 2:
		return "normal";
	case 3:
		return "vertical";
	default:
		return null;
	}
};
var openfl_display__$internal_BitmapDataLoader = function() {
};
$hxClasses["openfl.display._internal.BitmapDataLoader"] = openfl_display__$internal_BitmapDataLoader;
openfl_display__$internal_BitmapDataLoader.__name__ = "openfl.display._internal.BitmapDataLoader";
openfl_display__$internal_BitmapDataLoader.__interfaces__ = [openfl_display_IDisplayObjectLoader];
openfl_display__$internal_BitmapDataLoader.prototype = {
	load: function(request,context,contentLoaderInfo) {
		var _gthis = this;
		if(contentLoaderInfo.contentType.indexOf("image/") > -1 && request.method == "GET" && (request.requestHeaders == null || request.requestHeaders.length == 0) && request.userAgent == null) {
			return openfl_display_BitmapData.loadFromFile(request.url).then(function(bitmapData) {
				var content = new openfl_display_Bitmap(bitmapData);
				return lime_app_Future.withValue(content);
			});
		}
		var promise = new lime_app_Promise();
		var loader = new openfl_net_URLLoader();
		loader.dataFormat = 0;
		loader.addEventListener("complete",function(event) {
			promise.completeWith(_gthis.loadBytes(loader.data,context,contentLoaderInfo));
		});
		loader.addEventListener("ioError",function(event) {
			promise.error(event);
		});
		loader.addEventListener("progress",function(event) {
			promise.progress(event.bytesLoaded | 0,event.bytesTotal | 0);
		});
		loader.load(request);
		return promise.future;
	}
	,loadBytes: function(buffer,context,contentLoaderInfo) {
		return openfl_display_BitmapData.loadFromBytes(buffer).then(function(bitmapData) {
			var content = new openfl_display_Bitmap(bitmapData);
			return lime_app_Future.withValue(content);
		});
	}
	,__class__: openfl_display__$internal_BitmapDataLoader
};
var openfl_display__$internal_ScriptLoader = function() {
};
$hxClasses["openfl.display._internal.ScriptLoader"] = openfl_display__$internal_ScriptLoader;
openfl_display__$internal_ScriptLoader.__name__ = "openfl.display._internal.ScriptLoader";
openfl_display__$internal_ScriptLoader.__interfaces__ = [openfl_display_IDisplayObjectLoader];
openfl_display__$internal_ScriptLoader.prototype = {
	load: function(request,context,contentLoaderInfo) {
		if(contentLoaderInfo.contentType != null && (contentLoaderInfo.contentType.indexOf("/javascript") > -1 || contentLoaderInfo.contentType.indexOf("/ecmascript") > -1)) {
			var promise = new lime_app_Promise();
			var loader = new openfl_net_URLLoader();
			loader.dataFormat = 1;
			loader.addEventListener("complete",function(event) {
				eval("(function () {" + Std.string(loader.data) + "})()");
				promise.complete(new openfl_display_Sprite());
			});
			loader.addEventListener("ioError",function(event) {
				promise.error(event);
			});
			loader.addEventListener("progress",function(event) {
				promise.progress(event.bytesLoaded | 0,event.bytesTotal | 0);
			});
			loader.load(request);
			return promise.future;
		} else {
			return null;
		}
	}
	,loadBytes: function(buffer,context,contentLoaderInfo) {
		return null;
	}
	,__class__: openfl_display__$internal_ScriptLoader
};
var openfl_display__$internal_AssetManifestLoader = function() {
};
$hxClasses["openfl.display._internal.AssetManifestLoader"] = openfl_display__$internal_AssetManifestLoader;
openfl_display__$internal_AssetManifestLoader.__name__ = "openfl.display._internal.AssetManifestLoader";
openfl_display__$internal_AssetManifestLoader.__interfaces__ = [openfl_display_IDisplayObjectLoader];
openfl_display__$internal_AssetManifestLoader.prototype = {
	load: function(request,context,contentLoaderInfo) {
		if(contentLoaderInfo.contentType != null && contentLoaderInfo.contentType.indexOf("/json") > -1) {
			var promise = new lime_app_Promise();
			var loader = new openfl_net_URLLoader();
			loader.dataFormat = 1;
			loader.addEventListener("complete",function(event) {
				var path = request.url;
				var queryIndex = path.indexOf("?");
				if(queryIndex > -1) {
					path = path.substring(0,queryIndex);
				}
				var manifest = lime_utils_AssetManifest.parse(loader.data,haxe_io_Path.directory(path));
				if(manifest == null) {
					promise.error("Cannot parse asset manifest");
					return;
				}
				var library = lime_utils_AssetLibrary.fromManifest(manifest);
				if(library == null) {
					promise.error("Cannot open library");
					return;
				}
				if(((library) instanceof openfl_utils_AssetLibrary)) {
					library.load().onComplete(function(_) {
						var library1 = library;
						contentLoaderInfo.assetLibrary = library1;
						openfl_utils_Assets.registerLibrary(contentLoaderInfo.url,library1);
						if(manifest.name != null && !openfl_utils_Assets.hasLibrary(manifest.name)) {
							openfl_utils_Assets.registerLibrary(manifest.name,library1);
						}
						var clip = library1.getMovieClip("");
						promise.complete(clip);
					}).onProgress($bind(promise,promise.progress)).onError($bind(promise,promise.error));
				} else {
					promise.error("Library is not an OpenFL AssetLibrary");
				}
			});
			loader.addEventListener("ioError",function(event) {
				promise.error(event);
			});
			loader.addEventListener("progress",function(event) {
				promise.progress(event.bytesLoaded | 0,event.bytesTotal | 0);
			});
			loader.load(request);
			return promise.future;
		} else {
			return null;
		}
	}
	,loadBytes: function(buffer,context,contentLoaderInfo) {
		return null;
	}
	,__class__: openfl_display__$internal_AssetManifestLoader
};
var openfl_display_Loader = function() {
	openfl_display_DisplayObjectContainer.call(this);
	this.__drawableType = 4;
	this.contentLoaderInfo = openfl_display_LoaderInfo.create(this);
	this.uncaughtErrorEvents = this.contentLoaderInfo.uncaughtErrorEvents;
	this.__unloaded = true;
};
$hxClasses["openfl.display.Loader"] = openfl_display_Loader;
openfl_display_Loader.__name__ = "openfl.display.Loader";
openfl_display_Loader.__registerDefaultLoaders = function() {
	var loaders = [new openfl_display__$internal_BitmapDataLoader(),new openfl_display__$internal_ScriptLoader(),new openfl_display__$internal_AssetManifestLoader()];
	if(openfl_display_Loader.__registeredLoaders == null) {
		openfl_display_Loader.__registeredLoaders = loaders;
	} else {
		openfl_display_Loader.__registeredLoaders = loaders.concat(openfl_display_Loader.__registeredLoaders);
	}
};
openfl_display_Loader.registerLoader = function(loader) {
	if(loader == null) {
		return;
	}
	if(openfl_display_Loader.__registeredLoaders == null) {
		openfl_display_Loader.__registeredLoaders = [];
	}
	HxOverrides.remove(openfl_display_Loader.__registeredLoaders,loader);
	openfl_display_Loader.__registeredLoaders.push(loader);
};
openfl_display_Loader.__super__ = openfl_display_DisplayObjectContainer;
openfl_display_Loader.prototype = $extend(openfl_display_DisplayObjectContainer.prototype,{
	content: null
	,contentLoaderInfo: null
	,uncaughtErrorEvents: null
	,__library: null
	,__unloaded: null
	,addChild: function(child) {
		throw new openfl_errors_Error("Error #2069: The Loader class does not implement this method.",2069);
	}
	,addChildAt: function(child,index) {
		throw new openfl_errors_Error("Error #2069: The Loader class does not implement this method.",2069);
	}
	,close: function() {
		openfl_utils__$internal_Lib.notImplemented({ fileName : "openfl/display/Loader.hx", lineNumber : 245, className : "openfl.display.Loader", methodName : "close"});
	}
	,load: function(request,context) {
		this.unload();
		var openEvent = new openfl_events_Event("open");
		this.contentLoaderInfo.dispatchEvent(openEvent);
		this.contentLoaderInfo.loaderURL = openfl_Lib.get_current().get_loaderInfo().url;
		this.contentLoaderInfo.url = request.url;
		this.__unloaded = false;
		if(request.contentType == null || request.contentType == "") {
			var extension = "";
			var path = request.url;
			var queryIndex = path.indexOf("?");
			if(queryIndex > -1) {
				path = path.substring(0,queryIndex);
			}
			while(StringTools.endsWith(path,"/")) path = path.substring(0,path.length - 1);
			if(StringTools.endsWith(path,".bundle")) {
				path += "/library.json";
				if(queryIndex > -1) {
					request.url = path + request.url.substring(queryIndex);
				} else {
					request.url = path;
				}
			}
			var extIndex = path.lastIndexOf(".");
			if(extIndex > -1) {
				extension = path.substring(extIndex + 1);
			}
			var tmp;
			switch(extension) {
			case "gif":
				tmp = "image/gif";
				break;
			case "jpeg":case "jpg":
				tmp = "image/jpeg";
				break;
			case "js":
				tmp = "application/javascript";
				break;
			case "json":
				tmp = "application/json";
				break;
			case "png":
				tmp = "image/png";
				break;
			case "swf":
				tmp = "application/x-shockwave-flash";
				break;
			default:
				tmp = "application/x-www-form-urlencoded";
			}
			this.contentLoaderInfo.contentType = tmp;
		} else {
			this.contentLoaderInfo.contentType = request.contentType;
		}
		var future = null;
		var i = openfl_display_Loader.__registeredLoaders.length;
		var loader = null;
		while(i > 0) {
			--i;
			loader = openfl_display_Loader.__registeredLoaders[i];
			future = loader.load(request,context,this.contentLoaderInfo);
			if(future != null) {
				break;
			}
		}
		if(future != null) {
			future.onComplete($bind(this,this.Loader_onComplete));
			future.onProgress($bind(this,this.Loader_onProgress));
			future.onError($bind(this,this.Loader_onError));
		} else {
			this.__dispatchError("No DisplayObject loader found");
		}
	}
	,loadBytes: function(buffer,context) {
		var future = null;
		var i = openfl_display_Loader.__registeredLoaders.length;
		var loader = null;
		while(i > 0) {
			--i;
			loader = openfl_display_Loader.__registeredLoaders[i];
			future = loader.loadBytes(buffer,context,this.contentLoaderInfo);
			if(future != null) {
				break;
			}
		}
		if(future != null) {
			future.onComplete($bind(this,this.Loader_onComplete));
			future.onProgress($bind(this,this.Loader_onProgress));
			future.onError($bind(this,this.Loader_onError));
		} else {
			this.__dispatchError("No DisplayObject loader found");
		}
	}
	,removeChild: function(child) {
		if(child == this.content) {
			return openfl_display_DisplayObjectContainer.prototype.removeChild.call(this,this.content);
		} else {
			throw new openfl_errors_Error("Error #2069: The Loader class does not implement this method.",2069);
		}
	}
	,removeChildAt: function(index) {
		throw new openfl_errors_Error("Error #2069: The Loader class does not implement this method.",2069);
	}
	,setChildIndex: function(child,index) {
		throw new openfl_errors_Error("Error #2069: The Loader class does not implement this method.",2069);
	}
	,unload: function() {
		if(!this.__unloaded) {
			if(this.content != null && this.content.parent == this) {
				openfl_display_DisplayObjectContainer.prototype.removeChild.call(this,this.content);
			}
			if(this.__library != null) {
				openfl_utils_Assets.unloadLibrary(this.contentLoaderInfo.url);
				this.__library = null;
			}
			this.content = null;
			this.contentLoaderInfo.url = null;
			this.contentLoaderInfo.contentType = null;
			this.contentLoaderInfo.content = null;
			this.contentLoaderInfo.bytesLoaded = 0;
			this.contentLoaderInfo.bytesTotal = 0;
			this.contentLoaderInfo.width = 0;
			this.contentLoaderInfo.height = 0;
			this.__unloaded = true;
			this.contentLoaderInfo.dispatchEvent(new openfl_events_Event("unload"));
		}
	}
	,unloadAndStop: function(gc) {
		if(gc == null) {
			gc = true;
		}
		if(this.content != null) {
			this.content.__stopAllMovieClips();
		}
		var _g = 0;
		var _g1 = this.get_numChildren();
		while(_g < _g1) {
			var i = _g++;
			this.getChildAt(i).__stopAllMovieClips();
		}
		this.unload();
		var gc1 = gc;
	}
	,__dispatchError: function(error) {
		if(((error) instanceof openfl_events_Event)) {
			this.contentLoaderInfo.dispatchEvent(error);
		} else {
			var event = new openfl_events_IOErrorEvent("ioError");
			event.text = Std.string(error);
			this.contentLoaderInfo.dispatchEvent(event);
		}
	}
	,Loader_onComplete: function(content) {
		if(content == null) {
			this.__dispatchError("Unknown error");
			return;
		}
		this.content = content;
		this.contentLoaderInfo.content = content;
		if(this.contentLoaderInfo.width == -1 || this.contentLoaderInfo.height == -1) {
			var tmp = content.get_width() | 0;
			this.contentLoaderInfo.width = tmp;
			var tmp = content.get_height() | 0;
			this.contentLoaderInfo.height = tmp;
		}
		openfl_display_DisplayObjectContainer.prototype.addChildAt.call(this,content,0);
		this.contentLoaderInfo.dispatchEvent(new openfl_events_Event("complete"));
	}
	,Loader_onError: function(error) {
		this.__dispatchError(error);
	}
	,Loader_onProgress: function(bytesLoaded,bytesTotal) {
		var event = new openfl_events_ProgressEvent("progress");
		event.bytesLoaded = bytesLoaded;
		event.bytesTotal = bytesTotal;
		this.contentLoaderInfo.dispatchEvent(event);
	}
	,__class__: openfl_display_Loader
});
var openfl_display_LoaderInfo = function() {
	this.width = -1;
	this.height = -1;
	this.frameRate = -1;
	openfl_events_EventDispatcher.call(this);
	this.applicationDomain = openfl_system_ApplicationDomain.currentDomain;
	this.bytesLoaded = 0;
	this.bytesTotal = 0;
	this.childAllowsParent = true;
	this.parameters = { };
};
$hxClasses["openfl.display.LoaderInfo"] = openfl_display_LoaderInfo;
openfl_display_LoaderInfo.__name__ = "openfl.display.LoaderInfo";
openfl_display_LoaderInfo.create = function(loader) {
	var loaderInfo = new openfl_display_LoaderInfo();
	loaderInfo.uncaughtErrorEvents = new openfl_events_UncaughtErrorEvents();
	if(loader != null) {
		loaderInfo.loader = loader;
	} else {
		loaderInfo.url = openfl_display_LoaderInfo.__rootURL;
	}
	return loaderInfo;
};
openfl_display_LoaderInfo.__super__ = openfl_events_EventDispatcher;
openfl_display_LoaderInfo.prototype = $extend(openfl_events_EventDispatcher.prototype,{
	applicationDomain: null
	,assetLibrary: null
	,bytes: null
	,bytesLoaded: null
	,bytesTotal: null
	,childAllowsParent: null
	,content: null
	,contentType: null
	,frameRate: null
	,height: null
	,loader: null
	,loaderURL: null
	,parameters: null
	,parentAllowsChild: null
	,sameDomain: null
	,sharedEvents: null
	,uncaughtErrorEvents: null
	,url: null
	,width: null
	,__completed: null
	,__complete: function() {
		if(!this.__completed) {
			if(this.bytesLoaded < this.bytesTotal) {
				this.bytesLoaded = this.bytesTotal;
			}
			this.__update(this.bytesLoaded,this.bytesTotal);
			this.__completed = true;
			this.dispatchEvent(new openfl_events_Event("complete"));
		}
	}
	,__update: function(bytesLoaded,bytesTotal) {
		this.bytesLoaded = bytesLoaded;
		this.bytesTotal = bytesTotal;
		this.dispatchEvent(new openfl_events_ProgressEvent("progress",false,false,bytesLoaded,bytesTotal));
	}
	,__class__: openfl_display_LoaderInfo
});
var openfl_display_MovieClip = function() {
	openfl_display_Sprite.call(this);
	this.__enabled = true;
};
$hxClasses["openfl.display.MovieClip"] = openfl_display_MovieClip;
openfl_display_MovieClip.__name__ = "openfl.display.MovieClip";
openfl_display_MovieClip.fromTimeline = function(timeline) {
	var movieClip = new openfl_display_MovieClip();
	movieClip.attachTimeline(timeline);
	return movieClip;
};
openfl_display_MovieClip.__super__ = openfl_display_Sprite;
openfl_display_MovieClip.prototype = $extend(openfl_display_Sprite.prototype,{
	__enabled: null
	,__hasDown: null
	,__hasOver: null
	,__hasUp: null
	,__mouseIsDown: null
	,__scene: null
	,__timeline: null
	,addFrameScript: function(index,method) {
		if(this.__timeline != null) {
			this.__timeline.__addFrameScript(index,method);
		}
	}
	,attachTimeline: function(timeline) {
		this.__timeline = timeline;
		if(timeline != null) {
			timeline.__attachMovieClip(this);
			this.play();
		}
	}
	,gotoAndPlay: function(frame,scene) {
		if(this.__timeline != null) {
			this.__timeline.__gotoAndPlay(frame,scene);
		}
	}
	,gotoAndStop: function(frame,scene) {
		if(this.__timeline != null) {
			this.__timeline.__gotoAndStop(frame,scene);
		}
	}
	,nextFrame: function() {
		if(this.__timeline != null) {
			this.__timeline.__nextFrame();
		}
	}
	,nextScene: function() {
		if(this.__timeline != null) {
			this.__timeline.__nextScene();
		}
	}
	,play: function() {
		if(this.__timeline != null) {
			this.__timeline.__play();
		}
	}
	,prevFrame: function() {
		if(this.__timeline != null) {
			this.__timeline.__prevFrame();
		}
	}
	,prevScene: function() {
		if(this.__timeline != null) {
			this.__timeline.__prevScene();
		}
	}
	,stop: function() {
		if(this.__timeline != null) {
			this.__timeline.__stop();
		}
	}
	,__enterFrame: function(deltaTime) {
		if(this.__timeline != null) {
			this.__timeline.__enterFrame(deltaTime);
		}
		var _g = 0;
		var _g1 = this.__children;
		while(_g < _g1.length) {
			var child = _g1[_g];
			++_g;
			child.__enterFrame(deltaTime);
		}
	}
	,__stopAllMovieClips: function() {
		openfl_display_Sprite.prototype.__stopAllMovieClips.call(this);
		this.stop();
	}
	,__tabTest: function(stack) {
		if(!this.__enabled) {
			return;
		}
		openfl_display_Sprite.prototype.__tabTest.call(this,stack);
	}
	,__onMouseDown: function(event) {
		if(this.__enabled && this.__hasDown) {
			this.gotoAndStop("_down");
		}
		this.__mouseIsDown = true;
		if(this.stage != null) {
			this.stage.addEventListener("mouseUp",$bind(this,this.__onMouseUp),true);
		}
	}
	,__onMouseUp: function(event) {
		this.__mouseIsDown = false;
		if(this.stage != null) {
			this.stage.removeEventListener("mouseUp",$bind(this,this.__onMouseUp));
		}
		if(!this.__buttonMode) {
			return;
		}
		if(openfl_utils_Object.__eq(event.target,this) && this.__enabled && this.__hasOver) {
			this.gotoAndStop("_over");
		} else if(this.__enabled && this.__hasUp) {
			this.gotoAndStop("_up");
		}
	}
	,__onRollOut: function(event) {
		if(!this.__enabled) {
			return;
		}
		if(this.__mouseIsDown && this.__hasOver) {
			this.gotoAndStop("_over");
		} else if(this.__hasUp) {
			this.gotoAndStop("_up");
		}
	}
	,__onRollOver: function(event) {
		if(this.__enabled && this.__hasOver) {
			this.gotoAndStop("_over");
		}
	}
	,set_buttonMode: function(value) {
		if(this.__buttonMode != value) {
			if(value) {
				this.__hasDown = false;
				this.__hasOver = false;
				this.__hasUp = false;
				var _g = 0;
				var _g1 = this.get_currentLabels();
				while(_g < _g1.length) {
					var frameLabel = _g1[_g];
					++_g;
					switch(frameLabel.name) {
					case "_down":
						this.__hasDown = true;
						break;
					case "_over":
						this.__hasOver = true;
						break;
					case "_up":
						this.__hasUp = true;
						break;
					default:
					}
				}
				if(this.__hasDown || this.__hasOver || this.__hasUp) {
					this.addEventListener("rollOver",$bind(this,this.__onRollOver));
					this.addEventListener("rollOut",$bind(this,this.__onRollOut));
					this.addEventListener("mouseDown",$bind(this,this.__onMouseDown));
				}
			} else {
				this.removeEventListener("rollOver",$bind(this,this.__onRollOver));
				this.removeEventListener("rollOut",$bind(this,this.__onRollOut));
				this.removeEventListener("mouseDown",$bind(this,this.__onMouseDown));
			}
			this.__buttonMode = value;
		}
		return value;
	}
	,get_currentFrame: function() {
		if(this.__timeline != null) {
			return this.__timeline.__currentFrame;
		} else {
			return 1;
		}
	}
	,get_currentFrameLabel: function() {
		if(this.__timeline != null) {
			return this.__timeline.__currentFrameLabel;
		} else {
			return null;
		}
	}
	,get_currentLabel: function() {
		if(this.__timeline != null) {
			return this.__timeline.__currentLabel;
		} else {
			return null;
		}
	}
	,get_currentLabels: function() {
		if(this.__timeline != null) {
			return this.__timeline.__currentLabels.slice();
		} else {
			return [];
		}
	}
	,get_currentScene: function() {
		if(this.__timeline != null) {
			return this.__timeline.__currentScene;
		} else {
			if(this.__scene == null) {
				this.__scene = new openfl_display_Scene("",[],1);
			}
			return this.__scene;
		}
	}
	,get_enabled: function() {
		return this.__enabled;
	}
	,set_enabled: function(value) {
		return this.__enabled = value;
	}
	,get_framesLoaded: function() {
		if(this.__timeline != null) {
			return this.__timeline.__framesLoaded;
		} else {
			return 1;
		}
	}
	,get_isPlaying: function() {
		if(this.__timeline != null) {
			return this.__timeline.__isPlaying;
		} else {
			return false;
		}
	}
	,get_scenes: function() {
		if(this.__timeline != null) {
			return this.__timeline.scenes.slice();
		} else {
			return [this.get_currentScene()];
		}
	}
	,get_totalFrames: function() {
		if(this.__timeline != null) {
			return this.__timeline.__totalFrames;
		} else {
			return 1;
		}
	}
	,__class__: openfl_display_MovieClip
	,__properties__: $extend(openfl_display_Sprite.prototype.__properties__,{get_totalFrames:"get_totalFrames",get_scenes:"get_scenes",get_isPlaying:"get_isPlaying",get_framesLoaded:"get_framesLoaded",set_enabled:"set_enabled",get_enabled:"get_enabled",get_currentScene:"get_currentScene",get_currentLabels:"get_currentLabels",get_currentLabel:"get_currentLabel",get_currentFrameLabel:"get_currentFrameLabel",get_currentFrame:"get_currentFrame"})
});
var openfl_display_OpenGLRenderer = function(context,defaultRenderTarget) {
	openfl_display_DisplayObjectRenderer.call(this);
	this.__context3D = context;
	this.__context = context.__context;
	this.gl = context.__context.webgl;
	this.__gl = this.gl;
	this.__defaultRenderTarget = defaultRenderTarget;
	this.__flipped = this.__defaultRenderTarget == null;
	if(openfl_display_Graphics.maxTextureWidth == null) {
		openfl_display_Graphics.maxTextureWidth = openfl_display_Graphics.maxTextureHeight = this.__gl.getParameter(this.__gl.MAX_TEXTURE_SIZE);
	}
	this.__matrix = lime_math_Matrix4._new();
	this.__values = [];
	this.__softwareRenderer = new openfl_display_CanvasRenderer(null);
	this.__type = "opengl";
	this.__setBlendMode(10);
	this.__context3D.__setGLBlend(true);
	this.__clipRects = [];
	this.__maskObjects = [];
	this.__numClipRects = 0;
	this.__projection = lime_math_Matrix4._new();
	this.__projectionFlipped = lime_math_Matrix4._new();
	this.__stencilReference = 0;
	this.__tempRect = new openfl_geom_Rectangle();
	if(openfl_display_OpenGLRenderer.__staticDefaultDisplayShader == null) {
		openfl_display_OpenGLRenderer.__staticDefaultDisplayShader = new openfl_display_DisplayObjectShader();
	}
	if(openfl_display_OpenGLRenderer.__staticDefaultGraphicsShader == null) {
		openfl_display_OpenGLRenderer.__staticDefaultGraphicsShader = new openfl_display_GraphicsShader();
	}
	if(openfl_display_OpenGLRenderer.__staticMaskShader == null) {
		openfl_display_OpenGLRenderer.__staticMaskShader = new openfl_display__$internal_Context3DMaskShader();
	}
	this.__defaultDisplayShader = openfl_display_OpenGLRenderer.__staticDefaultDisplayShader;
	this.__defaultGraphicsShader = openfl_display_OpenGLRenderer.__staticDefaultGraphicsShader;
	this.__defaultShader = this.__defaultDisplayShader;
	this.__initShader(this.__defaultShader);
	this.__scrollRectMasks = new lime_utils_ObjectPool(function() {
		return new openfl_display_Shape();
	});
	this.__maskShader = openfl_display_OpenGLRenderer.__staticMaskShader;
};
$hxClasses["openfl.display.OpenGLRenderer"] = openfl_display_OpenGLRenderer;
openfl_display_OpenGLRenderer.__name__ = "openfl.display.OpenGLRenderer";
openfl_display_OpenGLRenderer.__super__ = openfl_display_DisplayObjectRenderer;
openfl_display_OpenGLRenderer.prototype = $extend(openfl_display_DisplayObjectRenderer.prototype,{
	gl: null
	,__context3D: null
	,__clipRects: null
	,__currentDisplayShader: null
	,__currentGraphicsShader: null
	,__currentRenderTarget: null
	,__currentShader: null
	,__currentShaderBuffer: null
	,__defaultDisplayShader: null
	,__defaultGraphicsShader: null
	,__defaultRenderTarget: null
	,__defaultShader: null
	,__displayHeight: null
	,__displayWidth: null
	,__flipped: null
	,__gl: null
	,__height: null
	,__maskShader: null
	,__matrix: null
	,__maskObjects: null
	,__numClipRects: null
	,__offsetX: null
	,__offsetY: null
	,__projection: null
	,__projectionFlipped: null
	,__scrollRectMasks: null
	,__softwareRenderer: null
	,__stencilReference: null
	,__tempRect: null
	,__updatedStencil: null
	,__upscaled: null
	,__values: null
	,__width: null
	,applyAlpha: function(alpha) {
		openfl_display_OpenGLRenderer.__alphaValue[0] = alpha * this.__worldAlpha;
		if(this.__currentShaderBuffer != null) {
			this.__currentShaderBuffer.addFloatOverride("openfl_Alpha",openfl_display_OpenGLRenderer.__alphaValue);
		} else if(this.__currentShader != null) {
			if(this.__currentShader.__alpha != null) {
				this.__currentShader.__alpha.value = openfl_display_OpenGLRenderer.__alphaValue;
			}
		}
	}
	,applyBitmapData: function(bitmapData,smooth,repeat) {
		if(repeat == null) {
			repeat = false;
		}
		if(this.__currentShaderBuffer != null) {
			if(bitmapData != null) {
				openfl_display_OpenGLRenderer.__textureSizeValue[0] = bitmapData.__textureWidth;
				openfl_display_OpenGLRenderer.__textureSizeValue[1] = bitmapData.__textureHeight;
				this.__currentShaderBuffer.addFloatOverride("openfl_TextureSize",openfl_display_OpenGLRenderer.__textureSizeValue);
			}
		} else if(this.__currentShader != null) {
			if(this.__currentShader.__bitmap != null) {
				this.__currentShader.__bitmap.input = bitmapData;
				this.__currentShader.__bitmap.filter = smooth && this.__allowSmoothing ? 4 : 5;
				this.__currentShader.__bitmap.mipFilter = 2;
				this.__currentShader.__bitmap.wrap = repeat ? 2 : 0;
			}
			if(this.__currentShader.__texture != null) {
				this.__currentShader.__texture.input = bitmapData;
				this.__currentShader.__texture.filter = smooth && this.__allowSmoothing ? 4 : 5;
				this.__currentShader.__texture.mipFilter = 2;
				this.__currentShader.__texture.wrap = repeat ? 2 : 0;
			}
			if(this.__currentShader.__textureSize != null) {
				if(bitmapData != null) {
					openfl_display_OpenGLRenderer.__textureSizeValue[0] = bitmapData.__textureWidth;
					openfl_display_OpenGLRenderer.__textureSizeValue[1] = bitmapData.__textureHeight;
					this.__currentShader.__textureSize.value = openfl_display_OpenGLRenderer.__textureSizeValue;
				} else {
					this.__currentShader.__textureSize.value = null;
				}
			}
		}
	}
	,applyColorTransform: function(colorTransform) {
		var enabled = colorTransform != null && !colorTransform.__isDefault(true);
		this.applyHasColorTransform(enabled);
		if(enabled) {
			colorTransform.__setArrays(openfl_display_OpenGLRenderer.__colorMultipliersValue,openfl_display_OpenGLRenderer.__colorOffsetsValue);
			if(this.__currentShaderBuffer != null) {
				this.__currentShaderBuffer.addFloatOverride("openfl_ColorMultiplier",openfl_display_OpenGLRenderer.__colorMultipliersValue);
				this.__currentShaderBuffer.addFloatOverride("openfl_ColorOffset",openfl_display_OpenGLRenderer.__colorOffsetsValue);
			} else if(this.__currentShader != null) {
				if(this.__currentShader.__colorMultiplier != null) {
					this.__currentShader.__colorMultiplier.value = openfl_display_OpenGLRenderer.__colorMultipliersValue;
				}
				if(this.__currentShader.__colorOffset != null) {
					this.__currentShader.__colorOffset.value = openfl_display_OpenGLRenderer.__colorOffsetsValue;
				}
			}
		} else if(this.__currentShaderBuffer != null) {
			this.__currentShaderBuffer.addFloatOverride("openfl_ColorMultiplier",openfl_display_OpenGLRenderer.__emptyColorValue);
			this.__currentShaderBuffer.addFloatOverride("openfl_ColorOffset",openfl_display_OpenGLRenderer.__emptyColorValue);
		} else if(this.__currentShader != null) {
			if(this.__currentShader.__colorMultiplier != null) {
				this.__currentShader.__colorMultiplier.value = openfl_display_OpenGLRenderer.__emptyColorValue;
			}
			if(this.__currentShader.__colorOffset != null) {
				this.__currentShader.__colorOffset.value = openfl_display_OpenGLRenderer.__emptyColorValue;
			}
		}
	}
	,applyHasColorTransform: function(enabled) {
		openfl_display_OpenGLRenderer.__hasColorTransformValue[0] = enabled;
		if(this.__currentShaderBuffer != null) {
			this.__currentShaderBuffer.addBoolOverride("openfl_HasColorTransform",openfl_display_OpenGLRenderer.__hasColorTransformValue);
		} else if(this.__currentShader != null) {
			if(this.__currentShader.__hasColorTransform != null) {
				this.__currentShader.__hasColorTransform.value = openfl_display_OpenGLRenderer.__hasColorTransformValue;
			}
		}
	}
	,applyMatrix: function(matrix) {
		if(this.__currentShaderBuffer != null) {
			this.__currentShaderBuffer.addFloatOverride("openfl_Matrix",matrix);
		} else if(this.__currentShader != null) {
			if(this.__currentShader.__matrix != null) {
				this.__currentShader.__matrix.value = matrix;
			}
		}
	}
	,getMatrix: function(transform) {
		if(this.gl != null) {
			var values = this.__getMatrix(transform,1);
			lime_math_Matrix4.set(this.__matrix,0,values[0]);
			lime_math_Matrix4.set(this.__matrix,1,values[1]);
			lime_math_Matrix4.set(this.__matrix,2,values[2]);
			lime_math_Matrix4.set(this.__matrix,3,values[3]);
			lime_math_Matrix4.set(this.__matrix,4,values[4]);
			lime_math_Matrix4.set(this.__matrix,5,values[5]);
			lime_math_Matrix4.set(this.__matrix,6,values[6]);
			lime_math_Matrix4.set(this.__matrix,7,values[7]);
			lime_math_Matrix4.set(this.__matrix,8,values[8]);
			lime_math_Matrix4.set(this.__matrix,9,values[9]);
			lime_math_Matrix4.set(this.__matrix,10,values[10]);
			lime_math_Matrix4.set(this.__matrix,11,values[11]);
			lime_math_Matrix4.set(this.__matrix,12,values[12]);
			lime_math_Matrix4.set(this.__matrix,13,values[13]);
			lime_math_Matrix4.set(this.__matrix,14,values[14]);
			lime_math_Matrix4.set(this.__matrix,15,values[15]);
			return this.__matrix;
		} else {
			lime_math_Matrix4.identity(this.__matrix);
			lime_math_Matrix4.set(this.__matrix,0,transform.a);
			lime_math_Matrix4.set(this.__matrix,1,transform.b);
			lime_math_Matrix4.set(this.__matrix,4,transform.c);
			lime_math_Matrix4.set(this.__matrix,5,transform.d);
			lime_math_Matrix4.set(this.__matrix,12,transform.tx);
			lime_math_Matrix4.set(this.__matrix,13,transform.ty);
			return this.__matrix;
		}
	}
	,setShader: function(shader) {
		this.__currentShaderBuffer = null;
		if(this.__currentShader == shader) {
			return;
		}
		var tmp = this.__currentShader != null;
		if(shader == null) {
			this.__currentShader = null;
			this.__context3D.setProgram(null);
			return;
		} else {
			this.__currentShader = shader;
			this.__initShader(shader);
			this.__context3D.setProgram(shader.program);
			this.__context3D.__flushGLProgram();
			this.__currentShader.__enable();
			this.__context3D.__state.shader = shader;
		}
	}
	,setViewport: function() {
		this.__gl.viewport(this.__offsetX,this.__offsetY,this.__displayWidth,this.__displayHeight);
	}
	,updateShader: function() {
		if(this.__currentShader != null) {
			if(this.__currentShader.__position != null) {
				this.__currentShader.__position.__useArray = true;
			}
			if(this.__currentShader.__textureCoord != null) {
				this.__currentShader.__textureCoord.__useArray = true;
			}
			this.__context3D.setProgram(this.__currentShader.program);
			this.__context3D.__flushGLProgram();
			this.__context3D.__flushGLTextures();
			this.__currentShader.__update();
		}
	}
	,useAlphaArray: function() {
		if(this.__currentShader != null) {
			if(this.__currentShader.__alpha != null) {
				this.__currentShader.__alpha.__useArray = true;
			}
		}
	}
	,useColorTransformArray: function() {
		if(this.__currentShader != null) {
			if(this.__currentShader.__colorMultiplier != null) {
				this.__currentShader.__colorMultiplier.__useArray = true;
			}
			if(this.__currentShader.__colorOffset != null) {
				this.__currentShader.__colorOffset.__useArray = true;
			}
		}
	}
	,__cleanup: function() {
		if(this.__stencilReference > 0) {
			this.__stencilReference = 0;
			this.__context3D.setStencilActions();
			this.__context3D.setStencilReferenceValue(0,0,0);
		}
		if(this.__numClipRects > 0) {
			this.__numClipRects = 0;
			this.__scissorRect();
		}
	}
	,__clear: function() {
		if(this.__stage == null || this.__stage.__transparent) {
			this.__context3D.clear(0,0,0,0,0,0,1);
		} else {
			this.__context3D.clear(this.__stage.__colorSplit[0],this.__stage.__colorSplit[1],this.__stage.__colorSplit[2],1,0,0,1);
		}
		this.__cleared = true;
	}
	,__clearShader: function() {
		if(this.__currentShader != null) {
			if(this.__currentShaderBuffer == null) {
				if(this.__currentShader.__bitmap != null) {
					this.__currentShader.__bitmap.input = null;
				}
			} else {
				this.__currentShaderBuffer.clearOverride();
			}
			if(this.__currentShader.__texture != null) {
				this.__currentShader.__texture.input = null;
			}
			if(this.__currentShader.__textureSize != null) {
				this.__currentShader.__textureSize.value = null;
			}
			if(this.__currentShader.__hasColorTransform != null) {
				this.__currentShader.__hasColorTransform.value = null;
			}
			if(this.__currentShader.__position != null) {
				this.__currentShader.__position.value = null;
			}
			if(this.__currentShader.__matrix != null) {
				this.__currentShader.__matrix.value = null;
			}
			this.__currentShader.__clearUseArray();
		}
	}
	,__copyShader: function(other) {
		this.__currentShader = other.__currentShader;
		this.__currentShaderBuffer = other.__currentShaderBuffer;
		this.__currentDisplayShader = other.__currentDisplayShader;
		this.__currentGraphicsShader = other.__currentGraphicsShader;
	}
	,__getMatrix: function(transform,pixelSnapping) {
		var _matrix = openfl_geom_Matrix.__pool.get();
		_matrix.copyFrom(transform);
		_matrix.concat(this.__worldTransform);
		if(pixelSnapping == 0 || pixelSnapping == 1 && _matrix.b == 0 && _matrix.c == 0 && (_matrix.a < 1.001 && _matrix.a > 0.999) && (_matrix.d < 1.001 && _matrix.d > 0.999)) {
			_matrix.tx = Math.round(_matrix.tx);
			_matrix.ty = Math.round(_matrix.ty);
		}
		lime_math_Matrix4.identity(this.__matrix);
		lime_math_Matrix4.set(this.__matrix,0,_matrix.a);
		lime_math_Matrix4.set(this.__matrix,1,_matrix.b);
		lime_math_Matrix4.set(this.__matrix,4,_matrix.c);
		lime_math_Matrix4.set(this.__matrix,5,_matrix.d);
		lime_math_Matrix4.set(this.__matrix,12,_matrix.tx);
		lime_math_Matrix4.set(this.__matrix,13,_matrix.ty);
		lime_math_Matrix4.append(this.__matrix,this.__flipped ? this.__projectionFlipped : this.__projection);
		this.__values[0] = lime_math_Matrix4.get(this.__matrix,0);
		this.__values[1] = lime_math_Matrix4.get(this.__matrix,1);
		this.__values[2] = lime_math_Matrix4.get(this.__matrix,2);
		this.__values[3] = lime_math_Matrix4.get(this.__matrix,3);
		this.__values[4] = lime_math_Matrix4.get(this.__matrix,4);
		this.__values[5] = lime_math_Matrix4.get(this.__matrix,5);
		this.__values[6] = lime_math_Matrix4.get(this.__matrix,6);
		this.__values[7] = lime_math_Matrix4.get(this.__matrix,7);
		this.__values[8] = lime_math_Matrix4.get(this.__matrix,8);
		this.__values[9] = lime_math_Matrix4.get(this.__matrix,9);
		this.__values[10] = lime_math_Matrix4.get(this.__matrix,10);
		this.__values[11] = lime_math_Matrix4.get(this.__matrix,11);
		this.__values[12] = lime_math_Matrix4.get(this.__matrix,12);
		this.__values[13] = lime_math_Matrix4.get(this.__matrix,13);
		this.__values[14] = lime_math_Matrix4.get(this.__matrix,14);
		this.__values[15] = lime_math_Matrix4.get(this.__matrix,15);
		openfl_geom_Matrix.__pool.release(_matrix);
		return this.__values;
	}
	,__initShader: function(shader) {
		if(shader != null) {
			if(shader.__context == null) {
				shader.__context = this.__context3D;
				shader.__init();
			}
			return shader;
		}
		return this.__defaultShader;
	}
	,__initDisplayShader: function(shader) {
		if(shader != null) {
			if(shader.__context == null) {
				shader.__context = this.__context3D;
				shader.__init();
			}
			return shader;
		}
		return this.__defaultDisplayShader;
	}
	,__initGraphicsShader: function(shader) {
		if(shader != null) {
			if(shader.__context == null) {
				shader.__context = this.__context3D;
				shader.__init();
			}
			return shader;
		}
		return this.__defaultGraphicsShader;
	}
	,__initShaderBuffer: function(shaderBuffer) {
		if(shaderBuffer != null) {
			return this.__initGraphicsShader(shaderBuffer.shader);
		}
		return this.__defaultGraphicsShader;
	}
	,__popMask: function() {
		if(this.__stencilReference == 0) {
			return;
		}
		var mask = this.__maskObjects.pop();
		if(this.__stencilReference > 1) {
			this.__context3D.setStencilActions(2,1,0,0,5);
			this.__context3D.setStencilReferenceValue(this.__stencilReference,255,255);
			this.__context3D.setColorMask(false,false,false,false);
			this.__renderDrawableMask(mask);
			this.__stencilReference--;
			this.__context3D.setStencilActions(2,1,5,5,5);
			this.__context3D.setStencilReferenceValue(this.__stencilReference,255,0);
			this.__context3D.setColorMask(true,true,true,true);
		} else {
			this.__stencilReference = 0;
			this.__context3D.setStencilActions();
			this.__context3D.setStencilReferenceValue(0,0,0);
		}
	}
	,__popMaskObject: function(object,handleScrollRect) {
		if(handleScrollRect == null) {
			handleScrollRect = true;
		}
		if(object.__mask != null) {
			this.__popMask();
		}
		if(handleScrollRect && object.__scrollRect != null) {
			if(object.__renderTransform.b != 0 || object.__renderTransform.c != 0) {
				this.__scrollRectMasks.release(this.__maskObjects[this.__maskObjects.length - 1]);
				this.__popMask();
			} else {
				this.__popMaskRect();
			}
		}
	}
	,__popMaskRect: function() {
		if(this.__numClipRects > 0) {
			this.__numClipRects--;
			if(this.__numClipRects > 0) {
				this.__scissorRect(this.__clipRects[this.__numClipRects - 1]);
			} else {
				this.__scissorRect();
			}
		}
	}
	,__pushMask: function(mask) {
		if(this.__stencilReference == 0) {
			this.__context3D.clear(0,0,0,0,0,0,4);
			this.__updatedStencil = true;
		}
		this.__context3D.setStencilActions(2,1,2,5,5);
		this.__context3D.setStencilReferenceValue(this.__stencilReference,255,255);
		this.__context3D.setColorMask(false,false,false,false);
		this.__renderDrawableMask(mask);
		this.__maskObjects.push(mask);
		this.__stencilReference++;
		this.__context3D.setStencilActions(2,1,5,5,5);
		this.__context3D.setStencilReferenceValue(this.__stencilReference,255,0);
		this.__context3D.setColorMask(true,true,true,true);
	}
	,__pushMaskObject: function(object,handleScrollRect) {
		if(handleScrollRect == null) {
			handleScrollRect = true;
		}
		if(handleScrollRect && object.__scrollRect != null) {
			if(object.__renderTransform.b != 0 || object.__renderTransform.c != 0) {
				var shape = this.__scrollRectMasks.get();
				shape.get_graphics().clear();
				shape.get_graphics().beginFill(65280);
				shape.get_graphics().drawRect(object.__scrollRect.x,object.__scrollRect.y,object.__scrollRect.width,object.__scrollRect.height);
				shape.__renderTransform.copyFrom(object.__renderTransform);
				this.__pushMask(shape);
			} else {
				this.__pushMaskRect(object.__scrollRect,object.__renderTransform);
			}
		}
		if(object.__mask != null) {
			this.__pushMask(object.__mask);
		}
	}
	,__pushMaskRect: function(rect,transform) {
		if(this.__numClipRects == this.__clipRects.length) {
			this.__clipRects[this.__numClipRects] = new openfl_geom_Rectangle();
		}
		var _matrix = openfl_geom_Matrix.__pool.get();
		_matrix.copyFrom(transform);
		_matrix.concat(this.__worldTransform);
		var clipRect = this.__clipRects[this.__numClipRects];
		rect.__transform(clipRect,_matrix);
		if(this.__numClipRects > 0) {
			var parentClipRect = this.__clipRects[this.__numClipRects - 1];
			clipRect.__contract(parentClipRect.x,parentClipRect.y,parentClipRect.width,parentClipRect.height);
		}
		if(clipRect.height < 0) {
			clipRect.height = 0;
		}
		if(clipRect.width < 0) {
			clipRect.width = 0;
		}
		openfl_geom_Matrix.__pool.release(_matrix);
		this.__scissorRect(clipRect);
		this.__numClipRects++;
	}
	,__render: function(object) {
		this.__context3D.setColorMask(true,true,true,true);
		this.__context3D.setCulling(3);
		this.__context3D.setDepthTest(false,0);
		this.__context3D.setStencilActions();
		this.__context3D.setStencilReferenceValue(0,0,0);
		this.__context3D.setScissorRectangle(null);
		this.__blendMode = null;
		this.__setBlendMode(10);
		if(this.__defaultRenderTarget == null) {
			if(this.__context3D.__backBufferWantsBestResolution) {
				openfl_display_OpenGLRenderer.__scissorRectangle.setTo(this.__offsetX / this.__pixelRatio,this.__offsetY / this.__pixelRatio,this.__displayWidth / this.__pixelRatio,this.__displayHeight / this.__pixelRatio);
			} else {
				openfl_display_OpenGLRenderer.__scissorRectangle.setTo(this.__offsetX,this.__offsetY,this.__displayWidth,this.__displayHeight);
			}
			this.__context3D.setScissorRectangle(openfl_display_OpenGLRenderer.__scissorRectangle);
			this.__upscaled = this.__worldTransform.a != 1 || this.__worldTransform.d != 1;
			this.__renderDrawable(object);
			if(this.__offsetX > 0 || this.__offsetY > 0) {
				if(this.__offsetX > 0) {
					openfl_display_OpenGLRenderer.__scissorRectangle.setTo(0,0,this.__offsetX,this.__height);
					this.__context3D.setScissorRectangle(openfl_display_OpenGLRenderer.__scissorRectangle);
					this.__context3D.__flushGL();
					this.__gl.clearColor(0,0,0,1);
					this.__gl.clear(this.__gl.COLOR_BUFFER_BIT);
					openfl_display_OpenGLRenderer.__scissorRectangle.setTo(this.__offsetX + this.__displayWidth,0,this.__width,this.__height);
					this.__context3D.setScissorRectangle(openfl_display_OpenGLRenderer.__scissorRectangle);
					this.__context3D.__flushGL();
					this.__gl.clearColor(0,0,0,1);
					this.__gl.clear(this.__gl.COLOR_BUFFER_BIT);
				}
				if(this.__offsetY > 0) {
					openfl_display_OpenGLRenderer.__scissorRectangle.setTo(0,0,this.__width,this.__offsetY);
					this.__context3D.setScissorRectangle(openfl_display_OpenGLRenderer.__scissorRectangle);
					this.__context3D.__flushGL();
					this.__gl.clearColor(0,0,0,1);
					this.__gl.clear(this.__gl.COLOR_BUFFER_BIT);
					openfl_display_OpenGLRenderer.__scissorRectangle.setTo(0,this.__offsetY + this.__displayHeight,this.__width,this.__height);
					this.__context3D.setScissorRectangle(openfl_display_OpenGLRenderer.__scissorRectangle);
					this.__context3D.__flushGL();
					this.__gl.clearColor(0,0,0,1);
					this.__gl.clear(this.__gl.COLOR_BUFFER_BIT);
				}
				this.__context3D.setScissorRectangle(null);
			}
		} else {
			if(this.__context3D.__backBufferWantsBestResolution) {
				openfl_display_OpenGLRenderer.__scissorRectangle.setTo(this.__offsetX / this.__pixelRatio,this.__offsetY / this.__pixelRatio,this.__displayWidth / this.__pixelRatio,this.__displayHeight / this.__pixelRatio);
			} else {
				openfl_display_OpenGLRenderer.__scissorRectangle.setTo(this.__offsetX,this.__offsetY,this.__displayWidth,this.__displayHeight);
			}
			this.__context3D.setScissorRectangle(openfl_display_OpenGLRenderer.__scissorRectangle);
			var cacheMask = object.__mask;
			var cacheScrollRect = object.__scrollRect;
			object.__mask = null;
			object.__scrollRect = null;
			this.__renderDrawable(object);
			object.__mask = cacheMask;
			object.__scrollRect = cacheScrollRect;
		}
		this.__context3D.present();
	}
	,__renderDrawable: function(object) {
		if(object == null) {
			return;
		}
		switch(object.__drawableType) {
		case 0:
			openfl_display__$internal_Context3DBitmapData.renderDrawable(object,this);
			break;
		case 2:
			openfl_display__$internal_Context3DBitmap.renderDrawable(object,this);
			break;
		case 3:
			openfl_display__$internal_Context3DDisplayObject.renderDrawable(object,this);
			break;
		case 4:case 5:
			openfl_display__$internal_Context3DDisplayObjectContainer.renderDrawable(object,this);
			break;
		case 6:
			openfl_display__$internal_Context3DSimpleButton.renderDrawable(object,this);
			break;
		case 7:
			openfl_display__$internal_Context3DTextField.renderDrawable(object,this);
			break;
		case 8:
			openfl_display__$internal_Context3DVideo.renderDrawable(object,this);
			break;
		case 9:
			openfl_display__$internal_Context3DTilemap.renderDrawable(object,this);
			break;
		default:
		}
	}
	,__renderDrawableMask: function(object) {
		if(object == null) {
			return;
		}
		switch(object.__drawableType) {
		case 0:
			openfl_display__$internal_Context3DBitmapData.renderDrawableMask(object,this);
			break;
		case 2:
			openfl_display__$internal_Context3DBitmap.renderDrawableMask(object,this);
			break;
		case 3:
			openfl_display__$internal_Context3DDisplayObject.renderDrawableMask(object,this);
			break;
		case 4:case 5:
			openfl_display__$internal_Context3DDisplayObjectContainer.renderDrawableMask(object,this);
			break;
		case 6:
			openfl_display__$internal_Context3DSimpleButton.renderDrawableMask(object,this);
			break;
		case 7:
			openfl_display__$internal_Context3DTextField.renderDrawableMask(object,this);
			break;
		case 8:
			openfl_display__$internal_Context3DVideo.renderDrawableMask(object,this);
			break;
		case 9:
			openfl_display__$internal_Context3DTilemap.renderDrawableMask(object,this);
			break;
		default:
		}
	}
	,__renderFilterPass: function(source,shader,smooth,clear) {
		if(clear == null) {
			clear = true;
		}
		if(source == null || shader == null) {
			return;
		}
		if(this.__defaultRenderTarget == null) {
			return;
		}
		var cacheRTT = this.__context3D.__state.renderToTexture;
		var cacheRTTDepthStencil = this.__context3D.__state.renderToTextureDepthStencil;
		var cacheRTTAntiAlias = this.__context3D.__state.renderToTextureAntiAlias;
		var cacheRTTSurfaceSelector = this.__context3D.__state.renderToTextureSurfaceSelector;
		this.__context3D.setRenderToTexture(this.__defaultRenderTarget.getTexture(this.__context3D),false);
		if(clear) {
			this.__context3D.clear(0,0,0,0,0,0,1);
		}
		var shader1 = this.__initShader(shader);
		this.setShader(shader1);
		this.applyAlpha(1);
		this.applyBitmapData(source,smooth);
		this.applyColorTransform(null);
		this.applyMatrix(this.__getMatrix(source.__renderTransform,1));
		this.updateShader();
		var vertexBuffer = source.getVertexBuffer(this.__context3D);
		if(shader1.__position != null) {
			this.__context3D.setVertexBufferAt(shader1.__position.index,vertexBuffer,0,3);
		}
		if(shader1.__textureCoord != null) {
			this.__context3D.setVertexBufferAt(shader1.__textureCoord.index,vertexBuffer,3,2);
		}
		var indexBuffer = source.getIndexBuffer(this.__context3D);
		this.__context3D.drawTriangles(indexBuffer);
		if(cacheRTT != null) {
			this.__context3D.setRenderToTexture(cacheRTT,cacheRTTDepthStencil,cacheRTTAntiAlias,cacheRTTSurfaceSelector);
		} else {
			this.__context3D.setRenderToBackBuffer();
		}
		this.__clearShader();
	}
	,__resize: function(width,height) {
		this.__width = width;
		this.__height = height;
		var w = this.__defaultRenderTarget == null ? this.__stage.stageWidth : this.__defaultRenderTarget.width;
		var h = this.__defaultRenderTarget == null ? this.__stage.stageHeight : this.__defaultRenderTarget.height;
		var tmp;
		if(this.__defaultRenderTarget == null) {
			var _this = this.__worldTransform;
			tmp = Math.round(0 * _this.a + 0 * _this.c + _this.tx);
		} else {
			tmp = 0;
		}
		this.__offsetX = tmp;
		var tmp;
		if(this.__defaultRenderTarget == null) {
			var _this = this.__worldTransform;
			tmp = Math.round(0 * _this.b + 0 * _this.d + _this.ty);
		} else {
			tmp = 0;
		}
		this.__offsetY = tmp;
		var tmp;
		if(this.__defaultRenderTarget == null) {
			var _this = this.__worldTransform;
			tmp = Math.round(w * _this.a + 0 * _this.c + _this.tx - this.__offsetX);
		} else {
			tmp = w;
		}
		this.__displayWidth = tmp;
		var tmp;
		if(this.__defaultRenderTarget == null) {
			var _this = this.__worldTransform;
			tmp = Math.round(0 * _this.b + h * _this.d + _this.ty - this.__offsetY);
		} else {
			tmp = h;
		}
		this.__displayHeight = tmp;
		lime_math_Matrix4.createOrtho(this.__projection,0,this.__displayWidth + this.__offsetX * 2,0,this.__displayHeight + this.__offsetY * 2,-1000,1000);
		lime_math_Matrix4.createOrtho(this.__projectionFlipped,0,this.__displayWidth + this.__offsetX * 2,this.__displayHeight + this.__offsetY * 2,0,-1000,1000);
	}
	,__resumeClipAndMask: function(childRenderer) {
		if(this.__stencilReference > 0) {
			this.__context3D.setStencilActions(2,1,5,5,5);
			this.__context3D.setStencilReferenceValue(this.__stencilReference,255,0);
		} else {
			this.__context3D.setStencilActions();
			this.__context3D.setStencilReferenceValue(0,0,0);
		}
		if(this.__numClipRects > 0) {
			this.__scissorRect(this.__clipRects[this.__numClipRects - 1]);
		} else {
			this.__scissorRect();
		}
	}
	,__scissorRect: function(clipRect) {
		if(clipRect != null) {
			var x = Math.floor(clipRect.x);
			var y = Math.floor(clipRect.y);
			var width = clipRect.width > 0 ? Math.ceil(clipRect.get_right()) - x : 0;
			var height = clipRect.height > 0 ? Math.ceil(clipRect.get_bottom()) - y : 0;
			if(this.__context3D.__backBufferWantsBestResolution) {
				var uv = 1.5 / this.__pixelRatio;
				x = clipRect.x / this.__pixelRatio;
				y = clipRect.y / this.__pixelRatio;
				width = clipRect.width > 0 ? clipRect.get_right() / this.__pixelRatio - x + uv : 0;
				height = clipRect.height > 0 ? clipRect.get_bottom() / this.__pixelRatio - y + uv : 0;
			}
			if(width < 0) {
				width = 0;
			}
			if(height < 0) {
				height = 0;
			}
			openfl_display_OpenGLRenderer.__scissorRectangle.setTo(x,y,width,height);
			this.__context3D.setScissorRectangle(openfl_display_OpenGLRenderer.__scissorRectangle);
		} else {
			this.__context3D.setScissorRectangle(null);
		}
	}
	,__setBlendMode: function(value) {
		if(this.__overrideBlendMode != null) {
			value = this.__overrideBlendMode;
		}
		if(this.__blendMode == value) {
			return;
		}
		this.__blendMode = value;
		switch(value) {
		case 0:
			this.__context3D.setBlendFactors(2,2);
			break;
		case 9:
			this.__context3D.setBlendFactors(1,5);
			break;
		case 12:
			this.__context3D.setBlendFactors(2,6);
			break;
		case 14:
			this.__context3D.setBlendFactors(2,2);
			this.__context3D.__setGLBlendEquation(this.__gl.FUNC_REVERSE_SUBTRACT);
			break;
		default:
			this.__context3D.setBlendFactors(2,5);
		}
	}
	,__setRenderTarget: function(renderTarget) {
		this.__defaultRenderTarget = renderTarget;
		this.__flipped = renderTarget == null;
		if(renderTarget != null) {
			this.__resize(renderTarget.width,renderTarget.height);
		}
	}
	,__setShaderBuffer: function(shaderBuffer) {
		this.setShader(shaderBuffer.shader);
		this.__currentShaderBuffer = shaderBuffer;
	}
	,__suspendClipAndMask: function() {
		if(this.__stencilReference > 0) {
			this.__context3D.setStencilActions();
			this.__context3D.setStencilReferenceValue(0,0,0);
		}
		if(this.__numClipRects > 0) {
			this.__scissorRect();
		}
	}
	,__updateShaderBuffer: function(bufferOffset) {
		if(this.__currentShader != null && this.__currentShaderBuffer != null) {
			this.__currentShader.__updateFromBuffer(this.__currentShaderBuffer,bufferOffset);
		}
	}
	,__class__: openfl_display_OpenGLRenderer
});
var openfl_display_PNGEncoderOptions = function(fastCompression) {
	if(fastCompression == null) {
		fastCompression = false;
	}
	this.fastCompression = fastCompression;
};
$hxClasses["openfl.display.PNGEncoderOptions"] = openfl_display_PNGEncoderOptions;
openfl_display_PNGEncoderOptions.__name__ = "openfl.display.PNGEncoderOptions";
openfl_display_PNGEncoderOptions.prototype = {
	fastCompression: null
	,__class__: openfl_display_PNGEncoderOptions
};
var openfl_display_PixelSnapping = {};
openfl_display_PixelSnapping.fromString = function(value) {
	switch(value) {
	case "always":
		return 0;
	case "auto":
		return 1;
	case "never":
		return 2;
	default:
		return null;
	}
};
openfl_display_PixelSnapping.toString = function(this1) {
	switch(this1) {
	case 0:
		return "always";
	case 1:
		return "auto";
	case 2:
		return "never";
	default:
		return null;
	}
};
var openfl_display_Preloader = function(display) {
	this.onComplete = new lime_app__$Event_$Void_$Void();
	this.display = display;
	if(display != null) {
		display.addEventListener("unload",$bind(this,this.display_onUnload));
		openfl_Lib.get_current().addChild(display);
	}
};
$hxClasses["openfl.display.Preloader"] = openfl_display_Preloader;
openfl_display_Preloader.__name__ = "openfl.display.Preloader";
openfl_display_Preloader.prototype = {
	onComplete: null
	,complete: null
	,display: null
	,ready: null
	,start: function() {
		this.ready = true;
		openfl_Lib.get_current().get_loaderInfo().__complete();
		if(this.display != null) {
			var complete = new openfl_events_Event("complete",true,true);
			this.display.dispatchEvent(complete);
			if(!complete.isDefaultPrevented()) {
				this.display.dispatchEvent(new openfl_events_Event("unload"));
			}
		} else if(!this.complete) {
			this.complete = true;
			this.onComplete.dispatch();
		}
	}
	,update: function(loaded,total) {
		openfl_Lib.get_current().get_loaderInfo().__update(loaded,total);
		if(this.display != null) {
			this.display.dispatchEvent(new openfl_events_ProgressEvent("progress",true,true,loaded,total));
		}
	}
	,display_onUnload: function(event) {
		if(this.display != null) {
			this.display.removeEventListener("unload",$bind(this,this.display_onUnload));
			if(this.display.parent == openfl_Lib.get_current()) {
				openfl_Lib.get_current().removeChild(this.display);
			}
			openfl_Lib.get_current().stage.set_focus(null);
			this.display = null;
		}
		if(this.ready) {
			if(!this.complete) {
				this.complete = true;
				this.onComplete.dispatch();
			}
		}
	}
	,__class__: openfl_display_Preloader
};
var openfl_display_DefaultPreloader = function() {
	openfl_display_Sprite.call(this);
	var backgroundColor = this.getBackgroundColor();
	var r = backgroundColor >> 16 & 255;
	var g = backgroundColor >> 8 & 255;
	var b = backgroundColor & 255;
	var perceivedLuminosity = 0.299 * r + 0.587 * g + 0.114 * b;
	var color = 0;
	if(perceivedLuminosity < 70) {
		color = 16777215;
	}
	var x = 30;
	var height = 7;
	var y = this.getHeight() / 2 - height / 2;
	var width = this.getWidth() - x * 2;
	var padding = 2;
	this.outline = new openfl_display_Shape();
	this.outline.get_graphics().beginFill(color,0.07);
	this.outline.get_graphics().drawRect(0,0,width,height);
	this.outline.set_x(x);
	this.outline.set_y(y);
	this.outline.set_alpha(0);
	this.addChild(this.outline);
	this.progress = new openfl_display_Shape();
	this.progress.get_graphics().beginFill(color,0.35);
	this.progress.get_graphics().drawRect(0,0,width - padding * 2,height - padding * 2);
	this.progress.set_x(x + padding);
	this.progress.set_y(y + padding);
	this.progress.set_scaleX(0);
	this.progress.set_alpha(0);
	this.addChild(this.progress);
	this.startAnimation = openfl_Lib.getTimer() + 100;
	this.endAnimation = this.startAnimation + 1000;
	this.addEventListener("addedToStage",$bind(this,this.this_onAddedToStage));
};
$hxClasses["openfl.display.DefaultPreloader"] = openfl_display_DefaultPreloader;
openfl_display_DefaultPreloader.__name__ = "openfl.display.DefaultPreloader";
openfl_display_DefaultPreloader.__super__ = openfl_display_Sprite;
openfl_display_DefaultPreloader.prototype = $extend(openfl_display_Sprite.prototype,{
	endAnimation: null
	,outline: null
	,progress: null
	,startAnimation: null
	,getBackgroundColor: function() {
		var attributes = openfl_Lib.get_current().stage.window.context.attributes;
		if(Object.prototype.hasOwnProperty.call(attributes,"background") && attributes.background != null) {
			return attributes.background;
		} else {
			return 0;
		}
	}
	,getHeight: function() {
		var height = openfl_Lib.get_current().stage.window.__height;
		if(height > 0) {
			return height;
		} else {
			return openfl_Lib.get_current().stage.stageHeight;
		}
	}
	,getWidth: function() {
		var width = openfl_Lib.get_current().stage.window.__width;
		if(width > 0) {
			return width;
		} else {
			return openfl_Lib.get_current().stage.stageWidth;
		}
	}
	,onInit: function() {
		this.addEventListener("enterFrame",$bind(this,this.this_onEnterFrame));
	}
	,onLoaded: function() {
		this.removeEventListener("enterFrame",$bind(this,this.this_onEnterFrame));
		this.dispatchEvent(new openfl_events_Event("unload"));
	}
	,onUpdate: function(bytesLoaded,bytesTotal) {
		var percentLoaded = 0.0;
		if(bytesTotal > 0) {
			percentLoaded = bytesLoaded / bytesTotal;
			if(percentLoaded > 1) {
				percentLoaded = 1;
			}
		}
		this.progress.set_scaleX(percentLoaded);
	}
	,this_onAddedToStage: function(event) {
		this.removeEventListener("addedToStage",$bind(this,this.this_onAddedToStage));
		this.onInit();
		this.onUpdate(this.get_loaderInfo().bytesLoaded,this.get_loaderInfo().bytesTotal);
		this.addEventListener("progress",$bind(this,this.this_onProgress));
		this.addEventListener("complete",$bind(this,this.this_onComplete));
	}
	,this_onComplete: function(event) {
		event.preventDefault();
		this.removeEventListener("progress",$bind(this,this.this_onProgress));
		this.removeEventListener("complete",$bind(this,this.this_onComplete));
		this.onLoaded();
	}
	,this_onEnterFrame: function(event) {
		var elapsed = openfl_Lib.getTimer() - this.startAnimation;
		var total = this.endAnimation - this.startAnimation;
		var percent = elapsed / total;
		if(percent < 0) {
			percent = 0;
		}
		if(percent > 1) {
			percent = 1;
		}
		this.outline.set_alpha(this.progress.set_alpha(percent));
	}
	,this_onProgress: function(event) {
		this.onUpdate(event.bytesLoaded | 0,event.bytesTotal | 0);
	}
	,__class__: openfl_display_DefaultPreloader
});
var openfl_display_Scene = function(name,labels,numFrames) {
	this.name = name;
	this.labels = labels;
	this.numFrames = numFrames;
};
$hxClasses["openfl.display.Scene"] = openfl_display_Scene;
openfl_display_Scene.__name__ = "openfl.display.Scene";
openfl_display_Scene.prototype = {
	labels: null
	,name: null
	,numFrames: null
	,__class__: openfl_display_Scene
};
var openfl_display_ShaderData = {};
openfl_display_ShaderData._new = function(byteArray) {
	return { };
};
var openfl_display_ShaderInput = function() {
	this.channels = 0;
	this.filter = 5;
	this.height = 0;
	this.index = 0;
	this.mipFilter = 2;
	this.width = 0;
	this.wrap = 0;
};
$hxClasses["openfl.display.ShaderInput"] = openfl_display_ShaderInput;
openfl_display_ShaderInput.__name__ = "openfl.display.ShaderInput";
openfl_display_ShaderInput.prototype = {
	channels: null
	,filter: null
	,height: null
	,index: null
	,input: null
	,mipFilter: null
	,name: null
	,width: null
	,wrap: null
	,__isUniform: null
	,__disableGL: function(context,id) {
		if(id < 0) {
			return;
		}
		var gl = context.gl;
		context.setTextureAt(id,null);
	}
	,__updateGL: function(context,id,overrideInput,overrideFilter,overrideMipFilter,overrideWrap) {
		var gl = context.gl;
		var input = overrideInput != null ? overrideInput : this.input;
		var filter = overrideFilter != null ? overrideFilter : this.filter;
		var mipFilter = overrideMipFilter != null ? overrideMipFilter : this.mipFilter;
		var wrap = overrideWrap != null ? overrideWrap : this.wrap;
		if(input != null) {
			var bitmapData = input;
			context.setTextureAt(id,bitmapData.getTexture(context));
			context.setSamplerStateAt(id,wrap,filter,mipFilter);
		} else {
			context.setTextureAt(id,null);
		}
	}
	,__class__: openfl_display_ShaderInput
};
var openfl_display_ShaderParameter = function() {
	this.index = 0;
};
$hxClasses["openfl.display.ShaderParameter"] = openfl_display_ShaderParameter;
openfl_display_ShaderParameter.__name__ = "openfl.display.ShaderParameter";
openfl_display_ShaderParameter.prototype = {
	index: null
	,name: null
	,type: null
	,value: null
	,__arrayLength: null
	,__internal: null
	,__isBool: null
	,__isFloat: null
	,__isInt: null
	,__isUniform: null
	,__length: null
	,__uniformMatrix: null
	,__useArray: null
	,__disableGL: function(context) {
		if(this.index < 0) {
			return;
		}
		var gl = context.gl;
		if(!this.__isUniform) {
			var _g = 0;
			var _g1 = this.__arrayLength;
			while(_g < _g1) {
				var i = _g++;
				gl.disableVertexAttribArray(this.index + i);
			}
		}
	}
	,__updateGL: function(context,overrideValue) {
		if(this.index < 0) {
			return;
		}
		var gl = context.gl;
		var value = overrideValue != null ? overrideValue : this.value;
		var boolValue = this.__isBool ? value : null;
		var floatValue = this.__isFloat ? value : null;
		var intValue = this.__isInt ? value : null;
		if(this.__isUniform) {
			if(value != null && value.length >= this.__length) {
				switch(this.type) {
				case 0:
					gl.uniform1i(this.index,boolValue[0] ? 1 : 0);
					break;
				case 1:
					gl.uniform2i(this.index,boolValue[0] ? 1 : 0,boolValue[1] ? 1 : 0);
					break;
				case 2:
					gl.uniform3i(this.index,boolValue[0] ? 1 : 0,boolValue[1] ? 1 : 0,boolValue[2] ? 1 : 0);
					break;
				case 3:
					gl.uniform4i(this.index,boolValue[0] ? 1 : 0,boolValue[1] ? 1 : 0,boolValue[2] ? 1 : 0,boolValue[3] ? 1 : 0);
					break;
				case 4:
					gl.uniform1f(this.index,floatValue[0]);
					break;
				case 5:
					gl.uniform2f(this.index,floatValue[0],floatValue[1]);
					break;
				case 6:
					gl.uniform3f(this.index,floatValue[0],floatValue[1],floatValue[2]);
					break;
				case 7:
					gl.uniform4f(this.index,floatValue[0],floatValue[1],floatValue[2],floatValue[3]);
					break;
				case 8:
					gl.uniform1i(this.index,intValue[0]);
					break;
				case 9:
					gl.uniform2i(this.index,intValue[0],intValue[1]);
					break;
				case 10:
					gl.uniform3i(this.index,intValue[0],intValue[1],intValue[2]);
					break;
				case 11:
					gl.uniform4i(this.index,intValue[0],intValue[1],intValue[2],intValue[3]);
					break;
				case 12:
					this.__uniformMatrix[0] = floatValue[0];
					this.__uniformMatrix[1] = floatValue[1];
					this.__uniformMatrix[2] = floatValue[2];
					this.__uniformMatrix[3] = floatValue[3];
					lime_graphics_WebGLRenderContext.uniformMatrix2fv(gl,this.index,false,this.__uniformMatrix);
					break;
				case 16:
					this.__uniformMatrix[0] = floatValue[0];
					this.__uniformMatrix[1] = floatValue[1];
					this.__uniformMatrix[2] = floatValue[2];
					this.__uniformMatrix[3] = floatValue[3];
					this.__uniformMatrix[4] = floatValue[4];
					this.__uniformMatrix[5] = floatValue[5];
					this.__uniformMatrix[6] = floatValue[6];
					this.__uniformMatrix[7] = floatValue[7];
					this.__uniformMatrix[8] = floatValue[8];
					lime_graphics_WebGLRenderContext.uniformMatrix3fv(gl,this.index,false,this.__uniformMatrix);
					break;
				case 20:
					this.__uniformMatrix[0] = floatValue[0];
					this.__uniformMatrix[1] = floatValue[1];
					this.__uniformMatrix[2] = floatValue[2];
					this.__uniformMatrix[3] = floatValue[3];
					this.__uniformMatrix[4] = floatValue[4];
					this.__uniformMatrix[5] = floatValue[5];
					this.__uniformMatrix[6] = floatValue[6];
					this.__uniformMatrix[7] = floatValue[7];
					this.__uniformMatrix[8] = floatValue[8];
					this.__uniformMatrix[9] = floatValue[9];
					this.__uniformMatrix[10] = floatValue[10];
					this.__uniformMatrix[11] = floatValue[11];
					this.__uniformMatrix[12] = floatValue[12];
					this.__uniformMatrix[13] = floatValue[13];
					this.__uniformMatrix[14] = floatValue[14];
					this.__uniformMatrix[15] = floatValue[15];
					lime_graphics_WebGLRenderContext.uniformMatrix4fv(gl,this.index,false,this.__uniformMatrix);
					break;
				default:
				}
			} else {
				switch(this.type) {
				case 4:
					gl.uniform1f(this.index,0);
					break;
				case 5:
					gl.uniform2f(this.index,0,0);
					break;
				case 6:
					gl.uniform3f(this.index,0,0,0);
					break;
				case 7:
					gl.uniform4f(this.index,0,0,0,0);
					break;
				case 0:case 8:
					gl.uniform1i(this.index,0);
					break;
				case 1:case 9:
					gl.uniform2i(this.index,0,0);
					break;
				case 2:case 10:
					gl.uniform3i(this.index,0,0,0);
					break;
				case 3:case 11:
					gl.uniform4i(this.index,0,0,0,0);
					break;
				case 12:
					this.__uniformMatrix[0] = 0;
					this.__uniformMatrix[1] = 0;
					this.__uniformMatrix[2] = 0;
					this.__uniformMatrix[3] = 0;
					lime_graphics_WebGLRenderContext.uniformMatrix2fv(gl,this.index,false,this.__uniformMatrix);
					break;
				case 16:
					this.__uniformMatrix[0] = 0;
					this.__uniformMatrix[1] = 0;
					this.__uniformMatrix[2] = 0;
					this.__uniformMatrix[3] = 0;
					this.__uniformMatrix[4] = 0;
					this.__uniformMatrix[5] = 0;
					this.__uniformMatrix[6] = 0;
					this.__uniformMatrix[7] = 0;
					this.__uniformMatrix[8] = 0;
					lime_graphics_WebGLRenderContext.uniformMatrix3fv(gl,this.index,false,this.__uniformMatrix);
					break;
				case 20:
					this.__uniformMatrix[0] = 0;
					this.__uniformMatrix[1] = 0;
					this.__uniformMatrix[2] = 0;
					this.__uniformMatrix[3] = 0;
					this.__uniformMatrix[4] = 0;
					this.__uniformMatrix[5] = 0;
					this.__uniformMatrix[6] = 0;
					this.__uniformMatrix[7] = 0;
					this.__uniformMatrix[8] = 0;
					this.__uniformMatrix[9] = 0;
					this.__uniformMatrix[10] = 0;
					this.__uniformMatrix[11] = 0;
					this.__uniformMatrix[12] = 0;
					this.__uniformMatrix[13] = 0;
					this.__uniformMatrix[14] = 0;
					this.__uniformMatrix[15] = 0;
					lime_graphics_WebGLRenderContext.uniformMatrix4fv(gl,this.index,false,this.__uniformMatrix);
					break;
				default:
				}
			}
		} else if(!this.__useArray && (value == null || value.length == this.__length)) {
			var _g = 0;
			var _g1 = this.__arrayLength;
			while(_g < _g1) {
				var i = _g++;
				gl.disableVertexAttribArray(this.index + i);
			}
			if(value != null) {
				switch(this.type) {
				case 0:
					gl.vertexAttrib1f(this.index,boolValue[0] ? 1 : 0);
					break;
				case 1:
					gl.vertexAttrib2f(this.index,boolValue[0] ? 1 : 0,boolValue[1] ? 1 : 0);
					break;
				case 2:
					gl.vertexAttrib3f(this.index,boolValue[0] ? 1 : 0,boolValue[1] ? 1 : 0,boolValue[2] ? 1 : 0);
					break;
				case 3:
					gl.vertexAttrib4f(this.index,boolValue[0] ? 1 : 0,boolValue[1] ? 1 : 0,boolValue[2] ? 1 : 0,boolValue[3] ? 1 : 0);
					break;
				case 4:
					gl.vertexAttrib1f(this.index,floatValue[0]);
					break;
				case 5:
					gl.vertexAttrib2f(this.index,floatValue[0],floatValue[1]);
					break;
				case 6:
					gl.vertexAttrib3f(this.index,floatValue[0],floatValue[1],floatValue[2]);
					break;
				case 7:
					gl.vertexAttrib4f(this.index,floatValue[0],floatValue[1],floatValue[2],floatValue[3]);
					break;
				case 8:
					gl.vertexAttrib1f(this.index,intValue[0]);
					break;
				case 9:
					gl.vertexAttrib2f(this.index,intValue[0],intValue[1]);
					break;
				case 10:
					gl.vertexAttrib3f(this.index,intValue[0],intValue[1],intValue[2]);
					break;
				case 11:
					gl.vertexAttrib4f(this.index,intValue[0],intValue[1],intValue[2],intValue[3]);
					break;
				case 12:
					gl.vertexAttrib2f(this.index + 0,floatValue[0],floatValue[1]);
					gl.vertexAttrib2f(this.index + 1,floatValue[2],floatValue[3]);
					break;
				case 16:
					gl.vertexAttrib3f(this.index + 0,floatValue[0],floatValue[1],floatValue[2]);
					gl.vertexAttrib3f(this.index + 1,floatValue[3],floatValue[4],floatValue[5]);
					gl.vertexAttrib3f(this.index + 2,floatValue[6],floatValue[7],floatValue[8]);
					break;
				case 20:
					gl.vertexAttrib4f(this.index + 0,floatValue[0],floatValue[1],floatValue[2],floatValue[3]);
					gl.vertexAttrib4f(this.index + 1,floatValue[4],floatValue[5],floatValue[6],floatValue[7]);
					gl.vertexAttrib4f(this.index + 2,floatValue[8],floatValue[9],floatValue[10],floatValue[11]);
					gl.vertexAttrib4f(this.index + 3,floatValue[12],floatValue[13],floatValue[14],floatValue[15]);
					break;
				default:
				}
			} else {
				switch(this.type) {
				case 0:case 4:case 8:
					gl.vertexAttrib1f(this.index,0);
					break;
				case 1:case 5:case 9:
					gl.vertexAttrib2f(this.index,0,0);
					break;
				case 2:case 6:case 10:
					gl.vertexAttrib3f(this.index,0,0,0);
					break;
				case 3:case 7:case 11:
					gl.vertexAttrib4f(this.index,0,0,0,0);
					break;
				case 12:
					gl.vertexAttrib2f(this.index + 0,0,0);
					gl.vertexAttrib2f(this.index + 1,0,0);
					break;
				case 16:
					gl.vertexAttrib3f(this.index + 0,0,0,0);
					gl.vertexAttrib3f(this.index + 1,0,0,0);
					gl.vertexAttrib3f(this.index + 2,0,0,0);
					break;
				case 20:
					gl.vertexAttrib4f(this.index + 0,0,0,0,0);
					gl.vertexAttrib4f(this.index + 1,0,0,0,0);
					gl.vertexAttrib4f(this.index + 2,0,0,0,0);
					gl.vertexAttrib4f(this.index + 3,0,0,0,0);
					break;
				default:
				}
			}
		} else {
			var _g = 0;
			var _g1 = this.__arrayLength;
			while(_g < _g1) {
				var i = _g++;
				gl.enableVertexAttribArray(this.index + i);
			}
		}
	}
	,__updateGLFromBuffer: function(context,buffer,position,length,bufferOffset) {
		if(this.index < 0) {
			return;
		}
		var gl = context.gl;
		if(this.__isUniform) {
			if(length >= this.__length) {
				switch(this.type) {
				case 4:
					gl.uniform1f(this.index,buffer[position]);
					break;
				case 5:
					gl.uniform2f(this.index,buffer[position],buffer[position + 1]);
					break;
				case 6:
					gl.uniform3f(this.index,buffer[position],buffer[position + 1],buffer[position + 2]);
					break;
				case 7:
					gl.uniform4f(this.index,buffer[position],buffer[position + 1],buffer[position + 2],buffer[position + 3]);
					break;
				case 0:case 8:
					gl.uniform1i(this.index,buffer[position] | 0);
					break;
				case 1:case 9:
					gl.uniform2i(this.index,buffer[position] | 0,buffer[position + 1] | 0);
					break;
				case 2:case 10:
					gl.uniform3i(this.index,buffer[position] | 0,buffer[position + 1] | 0,buffer[position + 2] | 0);
					break;
				case 3:case 11:
					gl.uniform4i(this.index,buffer[position] | 0,buffer[position + 1] | 0,buffer[position + 2] | 0,buffer[position + 3] | 0);
					break;
				case 12:
					this.__uniformMatrix[0] = buffer[position];
					this.__uniformMatrix[1] = buffer[position + 1];
					this.__uniformMatrix[2] = buffer[position + 2];
					this.__uniformMatrix[3] = buffer[position + 3];
					lime_graphics_WebGLRenderContext.uniformMatrix2fv(gl,this.index,false,this.__uniformMatrix);
					break;
				case 16:
					this.__uniformMatrix[0] = buffer[position];
					this.__uniformMatrix[1] = buffer[position + 1];
					this.__uniformMatrix[2] = buffer[position + 2];
					this.__uniformMatrix[3] = buffer[position + 3];
					this.__uniformMatrix[4] = buffer[position + 4];
					this.__uniformMatrix[5] = buffer[position + 5];
					this.__uniformMatrix[6] = buffer[position + 6];
					this.__uniformMatrix[7] = buffer[position + 7];
					this.__uniformMatrix[8] = buffer[position + 8];
					lime_graphics_WebGLRenderContext.uniformMatrix3fv(gl,this.index,false,this.__uniformMatrix);
					break;
				case 20:
					this.__uniformMatrix[0] = buffer[position];
					this.__uniformMatrix[1] = buffer[position + 1];
					this.__uniformMatrix[2] = buffer[position + 2];
					this.__uniformMatrix[3] = buffer[position + 3];
					this.__uniformMatrix[4] = buffer[position + 4];
					this.__uniformMatrix[5] = buffer[position + 5];
					this.__uniformMatrix[6] = buffer[position + 6];
					this.__uniformMatrix[7] = buffer[position + 7];
					this.__uniformMatrix[8] = buffer[position + 8];
					this.__uniformMatrix[9] = buffer[position + 9];
					this.__uniformMatrix[10] = buffer[position + 10];
					this.__uniformMatrix[11] = buffer[position + 11];
					this.__uniformMatrix[12] = buffer[position + 12];
					this.__uniformMatrix[13] = buffer[position + 13];
					this.__uniformMatrix[14] = buffer[position + 14];
					this.__uniformMatrix[15] = buffer[position + 15];
					lime_graphics_WebGLRenderContext.uniformMatrix4fv(gl,this.index,false,this.__uniformMatrix);
					break;
				default:
				}
			}
		} else if(!this.__internal && (length == 0 || length == this.__length)) {
			var _g = 0;
			var _g1 = this.__arrayLength;
			while(_g < _g1) {
				var i = _g++;
				gl.disableVertexAttribArray(this.index + i);
			}
			if(length > 0) {
				switch(this.type) {
				case 0:case 4:case 8:
					gl.vertexAttrib1f(this.index,buffer[position]);
					break;
				case 1:case 5:case 9:
					gl.vertexAttrib2f(this.index,buffer[position],buffer[position + 1]);
					break;
				case 2:case 6:case 10:
					gl.vertexAttrib3f(this.index,buffer[position],buffer[position + 1],buffer[position + 2]);
					break;
				case 3:case 7:case 11:
					gl.vertexAttrib4f(this.index,buffer[position],buffer[position + 1],buffer[position + 2],buffer[position + 3]);
					break;
				case 12:
					gl.vertexAttrib2f(this.index + 0,buffer[position],buffer[position + 1]);
					gl.vertexAttrib2f(this.index + 1,buffer[position + 2],buffer[position + 2 + 1]);
					break;
				case 16:
					gl.vertexAttrib3f(this.index + 0,buffer[position],buffer[position + 1],buffer[position + 2]);
					gl.vertexAttrib3f(this.index + 1,buffer[position + 3],buffer[position + 3 + 1],buffer[position + 3 + 2]);
					gl.vertexAttrib3f(this.index + 2,buffer[position + 6],buffer[position + 6 + 1],buffer[position + 6 + 2]);
					break;
				case 20:
					gl.vertexAttrib4f(this.index + 0,buffer[position],buffer[position + 1],buffer[position + 2],buffer[position + 3]);
					gl.vertexAttrib4f(this.index + 1,buffer[position + 4],buffer[position + 4 + 1],buffer[position + 4 + 2],buffer[position + 4 + 3]);
					gl.vertexAttrib4f(this.index + 2,buffer[position + 8],buffer[position + 8 + 1],buffer[position + 8 + 2],buffer[position + 8 + 3]);
					gl.vertexAttrib4f(this.index + 3,buffer[position + 12],buffer[position + 12 + 1],buffer[position + 12 + 2],buffer[position + 12 + 3]);
					break;
				default:
				}
			} else {
				switch(this.type) {
				case 0:case 4:case 8:
					gl.vertexAttrib1f(this.index,0);
					break;
				case 1:case 5:case 9:
					gl.vertexAttrib2f(this.index,0,0);
					break;
				case 2:case 6:case 10:
					gl.vertexAttrib3f(this.index,0,0,0);
					break;
				case 3:case 7:case 11:
					gl.vertexAttrib4f(this.index,0,0,0,0);
					break;
				case 12:
					gl.vertexAttrib2f(this.index + 0,0,0);
					gl.vertexAttrib2f(this.index + 1,0,0);
					break;
				case 16:
					gl.vertexAttrib3f(this.index + 0,0,0,0);
					gl.vertexAttrib3f(this.index + 1,0,0,0);
					gl.vertexAttrib3f(this.index + 2,0,0,0);
					break;
				case 20:
					gl.vertexAttrib4f(this.index + 0,0,0,0,0);
					gl.vertexAttrib4f(this.index + 1,0,0,0,0);
					gl.vertexAttrib4f(this.index + 2,0,0,0,0);
					gl.vertexAttrib4f(this.index + 3,0,0,0,0);
					break;
				default:
				}
			}
		} else {
			var type = gl.FLOAT;
			if(this.__isBool) {
				type = gl.INT;
			} else if(this.__isInt) {
				type = gl.INT;
			}
			var _g = 0;
			var _g1 = this.__arrayLength;
			while(_g < _g1) {
				var i = _g++;
				gl.enableVertexAttribArray(this.index + i);
			}
			if(length > 0) {
				var _g = 0;
				var _g1 = this.__arrayLength;
				while(_g < _g1) {
					var i = _g++;
					gl.vertexAttribPointer(this.index + i,this.__length,type,false,this.__length * 4,(position + bufferOffset * this.__length + i * this.__arrayLength) * 4);
				}
			}
		}
	}
	,set_name: function(value) {
		this.__internal = StringTools.startsWith(value,"openfl_");
		return this.name = value;
	}
	,__class__: openfl_display_ShaderParameter
	,__properties__: {set_name:"set_name"}
};
var openfl_display_ShaderParameterType = {};
openfl_display_ShaderParameterType.fromString = function(value) {
	switch(value) {
	case "bool":
		return 0;
	case "bool2":
		return 1;
	case "bool3":
		return 1;
	case "bool4":
		return 1;
	case "float":
		return 4;
	case "float2":
		return 5;
	case "float3":
		return 6;
	case "float4":
		return 7;
	case "int":
		return 8;
	case "int2":
		return 9;
	case "int3":
		return 10;
	case "int4":
		return 11;
	case "matrix2x2":
		return 12;
	case "matrix2x3":
		return 13;
	case "matrix2x4":
		return 14;
	case "matrix3x2":
		return 15;
	case "matrix3x3":
		return 16;
	case "matrix3x4":
		return 17;
	case "matrix4x2":
		return 18;
	case "matrix4x3":
		return 19;
	case "matrix4x4":
		return 20;
	default:
		return null;
	}
};
openfl_display_ShaderParameterType.toString = function(this1) {
	switch(this1) {
	case 0:
		return "bool";
	case 1:
		return "bool2";
	case 2:
		return "bool3";
	case 3:
		return "bool4";
	case 4:
		return "float";
	case 5:
		return "float2";
	case 6:
		return "float3";
	case 7:
		return "float4";
	case 8:
		return "int";
	case 9:
		return "int2";
	case 10:
		return "int3";
	case 11:
		return "int4";
	case 12:
		return "matrix2x2";
	case 13:
		return "matrix2x3";
	case 14:
		return "matrix2x4";
	case 15:
		return "matrix3x2";
	case 16:
		return "matrix3x3";
	case 17:
		return "matrix3x4";
	case 18:
		return "matrix4x2";
	case 19:
		return "matrix4x3";
	case 20:
		return "matrix4x4";
	default:
		return null;
	}
};
var openfl_display_ShaderPrecision = {};
openfl_display_ShaderPrecision.fromString = function(value) {
	switch(value) {
	case "fast":
		return 0;
	case "full":
		return 1;
	default:
		return null;
	}
};
openfl_display_ShaderPrecision.toString = function(this1) {
	switch(this1) {
	case 0:
		return "fast";
	case 1:
		return "full";
	default:
		return null;
	}
};
var openfl_display_Shape = function() {
	openfl_display_DisplayObject.call(this);
	this.__drawableType = 3;
};
$hxClasses["openfl.display.Shape"] = openfl_display_Shape;
openfl_display_Shape.__name__ = "openfl.display.Shape";
openfl_display_Shape.__super__ = openfl_display_DisplayObject;
openfl_display_Shape.prototype = $extend(openfl_display_DisplayObject.prototype,{
	get_graphics: function() {
		if(this.__graphics == null) {
			this.__graphics = new openfl_display_Graphics(this);
		}
		return this.__graphics;
	}
	,__class__: openfl_display_Shape
	,__properties__: $extend(openfl_display_DisplayObject.prototype.__properties__,{get_graphics:"get_graphics"})
});
var openfl_display_SimpleButton = function(upState,overState,downState,hitTestState) {
	openfl_display_InteractiveObject.call(this);
	this.__drawableType = 6;
	this.enabled = true;
	this.trackAsMenu = false;
	this.useHandCursor = true;
	this.__upState = upState != null ? upState : new openfl_display_DisplayObject();
	this.__overState = overState;
	this.__downState = downState;
	this.set_hitTestState(hitTestState != null ? hitTestState : new openfl_display_DisplayObject());
	this.addEventListener("mouseDown",$bind(this,this.__this_onMouseDown));
	this.addEventListener("mouseOut",$bind(this,this.__this_onMouseOut));
	this.addEventListener("mouseOver",$bind(this,this.__this_onMouseOver));
	this.addEventListener("mouseUp",$bind(this,this.__this_onMouseUp));
	this.__tabEnabled = true;
	this.set___currentState(this.__upState);
	if(openfl_display_SimpleButton.__constructor != null) {
		var method = openfl_display_SimpleButton.__constructor;
		openfl_display_SimpleButton.__constructor = null;
		method(this);
	}
};
$hxClasses["openfl.display.SimpleButton"] = openfl_display_SimpleButton;
openfl_display_SimpleButton.__name__ = "openfl.display.SimpleButton";
openfl_display_SimpleButton.__super__ = openfl_display_InteractiveObject;
openfl_display_SimpleButton.prototype = $extend(openfl_display_InteractiveObject.prototype,{
	enabled: null
	,trackAsMenu: null
	,useHandCursor: null
	,__currentState: null
	,__downState: null
	,__hitTestState: null
	,__ignoreEvent: null
	,__overState: null
	,__previousStates: null
	,__soundTransform: null
	,__upState: null
	,__getBounds: function(rect,matrix) {
		openfl_display_InteractiveObject.prototype.__getBounds.call(this,rect,matrix);
		var childWorldTransform = openfl_geom_Matrix.__pool.get();
		var local = this.__currentState.__transform;
		childWorldTransform.a = local.a * matrix.a + local.b * matrix.c;
		childWorldTransform.b = local.a * matrix.b + local.b * matrix.d;
		childWorldTransform.c = local.c * matrix.a + local.d * matrix.c;
		childWorldTransform.d = local.c * matrix.b + local.d * matrix.d;
		childWorldTransform.tx = local.tx * matrix.a + local.ty * matrix.c + matrix.tx;
		childWorldTransform.ty = local.tx * matrix.b + local.ty * matrix.d + matrix.ty;
		this.__currentState.__getBounds(rect,childWorldTransform);
		openfl_geom_Matrix.__pool.release(childWorldTransform);
	}
	,__getRenderBounds: function(rect,matrix) {
		if(this.__scrollRect != null) {
			openfl_display_InteractiveObject.prototype.__getRenderBounds.call(this,rect,matrix);
			return;
		} else {
			openfl_display_InteractiveObject.prototype.__getBounds.call(this,rect,matrix);
		}
		if(this.__currentState == null) {
			return;
		}
		var childWorldTransform = openfl_geom_Matrix.__pool.get();
		var local = this.__currentState.__transform;
		childWorldTransform.a = local.a * matrix.a + local.b * matrix.c;
		childWorldTransform.b = local.a * matrix.b + local.b * matrix.d;
		childWorldTransform.c = local.c * matrix.a + local.d * matrix.c;
		childWorldTransform.d = local.c * matrix.b + local.d * matrix.d;
		childWorldTransform.tx = local.tx * matrix.a + local.ty * matrix.c + matrix.tx;
		childWorldTransform.ty = local.tx * matrix.b + local.ty * matrix.d + matrix.ty;
		this.__currentState.__getRenderBounds(rect,childWorldTransform);
		openfl_geom_Matrix.__pool.release(childWorldTransform);
	}
	,__getCursor: function() {
		if(this.useHandCursor && !this.__ignoreEvent && this.enabled) {
			return "button";
		} else {
			return null;
		}
	}
	,__hitTest: function(x,y,shapeFlag,stack,interactiveOnly,hitObject) {
		var hitTest = false;
		if(this.get_hitTestState() != null) {
			if(this.get_hitTestState().__hitTest(x,y,shapeFlag,stack,interactiveOnly,hitObject)) {
				if(stack != null) {
					if(stack.length == 0) {
						stack[0] = hitObject;
					} else {
						stack[stack.length - 1] = hitObject;
					}
				}
				hitTest = !interactiveOnly || this.mouseEnabled;
			}
		} else if(this.__currentState != null) {
			if(!hitObject.get_visible() || this.__isMask || interactiveOnly && !this.mouseEnabled || this.get_mask() != null && !this.get_mask().__hitTestMask(x,y)) {
				hitTest = false;
			} else if(this.__currentState.__hitTest(x,y,shapeFlag,stack,interactiveOnly,hitObject)) {
				hitTest = interactiveOnly;
			}
		}
		if(stack != null) {
			while(stack.length > 1 && stack[stack.length - 1] == stack[stack.length - 2]) stack.pop();
		}
		return hitTest;
	}
	,__hitTestMask: function(x,y) {
		var hitTest = false;
		if(this.__currentState.__hitTestMask(x,y)) {
			hitTest = true;
		}
		return hitTest;
	}
	,__setStageReference: function(stage) {
		openfl_display_InteractiveObject.prototype.__setStageReference.call(this,stage);
		if(this.__currentState != null) {
			this.__currentState.__setStageReference(stage);
		}
		if(this.get_hitTestState() != null && this.get_hitTestState() != this.__currentState) {
			this.get_hitTestState().__setStageReference(stage);
		}
	}
	,__setTransformDirty: function() {
		openfl_display_InteractiveObject.prototype.__setTransformDirty.call(this);
		if(this.__currentState != null) {
			this.__currentState.__setTransformDirty();
		}
		if(this.get_hitTestState() != null && this.get_hitTestState() != this.__currentState) {
			this.get_hitTestState().__setTransformDirty();
		}
	}
	,__update: function(transformOnly,updateChildren) {
		openfl_display_InteractiveObject.prototype.__update.call(this,transformOnly,updateChildren);
		if(updateChildren) {
			if(this.__currentState != null) {
				this.__currentState.__update(transformOnly,true);
			}
			if(this.get_hitTestState() != null && this.get_hitTestState() != this.__currentState) {
				this.get_hitTestState().__update(transformOnly,true);
			}
		}
	}
	,__updateTransforms: function(overrideTransform) {
		openfl_display_InteractiveObject.prototype.__updateTransforms.call(this,overrideTransform);
		if(this.__currentState != null) {
			this.__currentState.__updateTransforms();
		}
		if(this.get_hitTestState() != null && this.get_hitTestState() != this.__currentState) {
			this.get_hitTestState().__updateTransforms();
		}
	}
	,get_downState: function() {
		return this.__downState;
	}
	,set_downState: function(downState) {
		if(this.__downState != null && this.__currentState == this.__downState) {
			this.set___currentState(downState);
		}
		return this.__downState = downState;
	}
	,get_hitTestState: function() {
		return this.__hitTestState;
	}
	,set_hitTestState: function(hitTestState) {
		if(this.__hitTestState != null && this.__hitTestState != hitTestState) {
			if(this.__hitTestState != this.get_downState() && this.__hitTestState != this.get_upState() && this.__hitTestState != this.get_overState()) {
				this.__hitTestState.__renderParent = null;
			}
		}
		if(hitTestState != null) {
			hitTestState.__renderParent = this;
			if(!hitTestState.__renderDirty) {
				hitTestState.__renderDirty = true;
				hitTestState.__setParentRenderDirty();
			}
		}
		return this.__hitTestState = hitTestState;
	}
	,get_overState: function() {
		return this.__overState;
	}
	,set_overState: function(overState) {
		if(this.__overState != null && this.__currentState == this.__overState) {
			this.set___currentState(overState);
		}
		return this.__overState = overState;
	}
	,get_soundTransform: function() {
		if(this.__soundTransform == null) {
			this.__soundTransform = new openfl_media_SoundTransform();
		}
		return new openfl_media_SoundTransform(this.__soundTransform.volume,this.__soundTransform.pan);
	}
	,set_soundTransform: function(value) {
		this.__soundTransform = new openfl_media_SoundTransform(value.volume,value.pan);
		return value;
	}
	,get_upState: function() {
		return this.__upState;
	}
	,set_upState: function(upState) {
		if(this.__upState != null && this.__currentState == this.__upState) {
			this.set___currentState(upState);
		}
		return this.__upState = upState;
	}
	,set___currentState: function(value) {
		if(this.__currentState != null && this.__currentState != this.get_hitTestState()) {
			this.__currentState.__renderParent = null;
		}
		if(value != null && value.parent != null) {
			value.parent.removeChild(value);
		}
		if(openfl_display_DisplayObject.__supportDOM && this.__previousStates == null) {
			this.__previousStates = openfl_Vector.toObjectVector(null);
		}
		if(value != this.__currentState) {
			if(openfl_display_DisplayObject.__supportDOM) {
				if(this.__currentState != null) {
					this.__currentState.__setStageReference(null);
					this.__previousStates.push(this.__currentState);
				}
				var index = this.__previousStates.indexOf(value,0);
				if(index > -1) {
					var this1 = this.__previousStates;
					this1.__tempIndex = index;
					var _g_current = 0;
					var _g_args = [];
					while(_g_current < _g_args.length) {
						var item = _g_args[_g_current++];
						this1.insertAt(this1.__tempIndex,item);
						this1.__tempIndex++;
					}
					this1.splice(this1.__tempIndex,1);
				}
			}
			if(value != null) {
				value.__renderParent = this;
				if(!value.__renderDirty) {
					value.__renderDirty = true;
					value.__setParentRenderDirty();
				}
			}
			if(!this.__renderDirty) {
				this.__renderDirty = true;
				this.__setParentRenderDirty();
			}
		}
		this.__currentState = value;
		return value;
	}
	,__this_onMouseDown: function(event) {
		if(this.enabled) {
			this.set___currentState(this.get_downState());
		}
	}
	,__this_onMouseOut: function(event) {
		this.__ignoreEvent = false;
		if(this.get_upState() != this.__currentState) {
			this.set___currentState(this.get_upState());
		}
	}
	,__this_onMouseOver: function(event) {
		if(event.buttonDown) {
			this.__ignoreEvent = true;
		}
		if(this.get_overState() != this.__currentState && this.get_overState() != null && !this.__ignoreEvent && this.enabled) {
			this.set___currentState(this.get_overState());
		}
	}
	,__this_onMouseUp: function(event) {
		this.__ignoreEvent = false;
		if(this.enabled && this.get_overState() != null) {
			this.set___currentState(this.get_overState());
		} else {
			this.set___currentState(this.get_upState());
		}
	}
	,__class__: openfl_display_SimpleButton
	,__properties__: $extend(openfl_display_InteractiveObject.prototype.__properties__,{set___currentState:"set___currentState",set_upState:"set_upState",get_upState:"get_upState",set_soundTransform:"set_soundTransform",get_soundTransform:"get_soundTransform",set_overState:"set_overState",get_overState:"get_overState",set_hitTestState:"set_hitTestState",get_hitTestState:"get_hitTestState",set_downState:"set_downState",get_downState:"get_downState"})
});
var openfl_display_SpreadMethod = {};
openfl_display_SpreadMethod.fromInt = function(value) {
	return value;
};
openfl_display_SpreadMethod.fromString = function(value) {
	switch(value) {
	case "pad":
		return 0;
	case "reflect":
		return 1;
	case "repeat":
		return 2;
	default:
		return null;
	}
};
openfl_display_SpreadMethod.toInt = function(this1) {
	return this1;
};
openfl_display_SpreadMethod.toString = function(this1) {
	switch(this1) {
	case 0:
		return "pad";
	case 1:
		return "reflect";
	case 2:
		return "repeat";
	default:
		return null;
	}
};
var openfl_display_Stage = function(window1,color) {
	this.__oldStageOrientation = 3;
	openfl_display_DisplayObjectContainer.call(this);
	this.__drawableType = 5;
	this.set_name(null);
	this.__color = -1;
	this.__colorSplit = [255,255,255];
	this.__colorString = "#FFFFFF";
	this.__contentsScaleFactor = 1;
	this.__currentTabOrderIndex = 0;
	this.__deltaTime = 0;
	this.__displayState = 2;
	this.__mouseX = 0;
	this.__mouseY = 0;
	this.__untransformedMouseX = 0;
	this.__untransformedMouseY = 0;
	this.__lastClickTime = 0;
	this.__logicalWidth = 0;
	this.__logicalHeight = 0;
	this.__displayMatrix = new openfl_geom_Matrix();
	this.__displayRect = new openfl_geom_Rectangle();
	this.__renderDirty = true;
	this.stage3Ds = openfl_Vector.toObjectVector(null);
	this.stage3Ds.push(new openfl_display_Stage3D(this));
	this.stage3Ds.push(new openfl_display_Stage3D(this));
	this.stage3Ds.push(new openfl_display_Stage3D(this));
	this.stage3Ds.push(new openfl_display_Stage3D(this));
	this.stage = this;
	this.align = 6;
	this.allowsFullScreen = true;
	this.allowsFullScreenInteractive = true;
	this.__quality = 1;
	this.__scaleMode = 2;
	this.showDefaultContextMenu = true;
	this.softKeyboardRect = new openfl_geom_Rectangle();
	this.stageFocusRect = true;
	this.__macKeyboard = /AppleWebKit/.test (navigator.userAgent) && /Mobile\/\w+/.test (navigator.userAgent) || /Mac/.test (navigator.platform);
	this.__clearBeforeRender = true;
	this.__forceRender = false;
	this.__stack = [];
	this.__rollOutStack = [];
	this.__mouseOutStack = [];
	this.__touchData = new haxe_ds_IntMap();
	if(openfl_Lib.get_current().__loaderInfo == null) {
		openfl_Lib.get_current().__loaderInfo = openfl_display_LoaderInfo.create(null);
		openfl_Lib.get_current().__loaderInfo.content = openfl_Lib.get_current();
	}
	this.__uncaughtErrorEvents = openfl_Lib.get_current().__loaderInfo.uncaughtErrorEvents;
	this.application = window1.application;
	this.window = window1;
	this.set_color(color);
	this.__contentsScaleFactor = window1.__scale;
	this.__wasFullscreen = window1.__fullscreen;
	this.__resize();
	if(openfl_Lib.get_current().stage == null) {
		this.stage.addChild(openfl_Lib.get_current());
	}
};
$hxClasses["openfl.display.Stage"] = openfl_display_Stage;
openfl_display_Stage.__name__ = "openfl.display.Stage";
openfl_display_Stage.__interfaces__ = [lime_app_IModule];
openfl_display_Stage.__properties__ = {get_supportsOrientationChange:"get_supportsOrientationChange"};
openfl_display_Stage.get_supportsOrientationChange = function() {
	return false;
};
openfl_display_Stage.__super__ = openfl_display_DisplayObjectContainer;
openfl_display_Stage.prototype = $extend(openfl_display_DisplayObjectContainer.prototype,{
	align: null
	,allowsFullScreen: null
	,allowsFullScreenInteractive: null
	,application: null
	,context3D: null
	,showDefaultContextMenu: null
	,softKeyboardRect: null
	,stage3Ds: null
	,stageFocusRect: null
	,stageHeight: null
	,stageWidth: null
	,window: null
	,__cacheFocus: null
	,__clearBeforeRender: null
	,__color: null
	,__colorSplit: null
	,__colorString: null
	,__contentsScaleFactor: null
	,__currentTabOrderIndex: null
	,__deltaTime: null
	,__dirty: null
	,__displayMatrix: null
	,__displayRect: null
	,__displayState: null
	,__dragBounds: null
	,__dragObject: null
	,__dragOffsetX: null
	,__dragOffsetY: null
	,__focus: null
	,__forceRender: null
	,__fullscreen: null
	,__fullScreenSourceRect: null
	,__invalidated: null
	,__lastClickTime: null
	,__lastClickTarget: null
	,__logicalWidth: null
	,__logicalHeight: null
	,__macKeyboard: null
	,__mouseDownLeft: null
	,__mouseDownMiddle: null
	,__mouseDownRight: null
	,__mouseOutStack: null
	,__mouseOverTarget: null
	,__mouseX: null
	,__mouseY: null
	,__untransformedMouseX: null
	,__untransformedMouseY: null
	,__pendingMouseEvent: null
	,__pendingMouseX: null
	,__pendingMouseY: null
	,__quality: null
	,__renderer: null
	,__rendering: null
	,__rollOutStack: null
	,__scaleMode: null
	,__stack: null
	,__touchData: null
	,__transparent: null
	,__uncaughtErrorEvents: null
	,__wasDirty: null
	,__wasFullscreen: null
	,__primaryTouch: null
	,__oldStageOrientation: null
	,invalidate: function() {
		this.__invalidated = true;
		this.__renderDirty = true;
	}
	,localToGlobal: function(pos) {
		return pos.clone();
	}
	,setOrientation: function(newOrientation) {
	}
	,__broadcastEvent: function(event) {
		if(Object.prototype.hasOwnProperty.call(openfl_display_DisplayObject.__broadcastEvents.h,event.type)) {
			var dispatchers = openfl_display_DisplayObject.__broadcastEvents.h[event.type];
			var _g = 0;
			while(_g < dispatchers.length) {
				var dispatcher = dispatchers[_g];
				++_g;
				if(dispatcher.stage == this || dispatcher.stage == null) {
					if(this.__uncaughtErrorEvents.__enabled) {
						try {
							dispatcher.__dispatch(event);
						} catch( _g1 ) {
							haxe_NativeStackTrace.lastError = _g1;
							var e = haxe_Exception.caught(_g1).unwrap();
							this.__handleError(e);
						}
					} else {
						dispatcher.__dispatch(event);
					}
				}
			}
		}
	}
	,__createRenderer: function() {
		var windowWidth = this.window.__width * this.window.__scale | 0;
		var windowHeight = this.window.__height * this.window.__scale | 0;
		switch(this.window.context.type) {
		case "cairo":
			break;
		case "canvas":
			this.__renderer = new openfl_display_CanvasRenderer(this.window.context.canvas2D);
			break;
		case "dom":
			this.__renderer = new openfl_display_DOMRenderer(this.window.context.dom);
			break;
		case "opengl":case "opengles":case "webgl":
			this.context3D = new openfl_display3D_Context3D(this);
			this.context3D.configureBackBuffer(this.stageWidth,this.stageHeight,0,true,true,true);
			this.context3D.present();
			this.__renderer = new openfl_display_OpenGLRenderer(this.context3D);
			break;
		default:
		}
		if(this.__renderer != null) {
			var tmp = this.get_quality();
			this.__renderer.__allowSmoothing = tmp != 2;
			this.__renderer.__pixelRatio = this.window.__scale;
			this.__renderer.__worldTransform = this.__displayMatrix;
			this.__renderer.__stage = this;
			this.__renderer.__resize(windowWidth,windowHeight);
		}
	}
	,__dispatchEvent: function(event) {
		var result;
		if(this.__uncaughtErrorEvents.__enabled) {
			try {
				result = openfl_display_DisplayObjectContainer.prototype.__dispatchEvent.call(this,event);
			} catch( _g ) {
				haxe_NativeStackTrace.lastError = _g;
				var e = haxe_Exception.caught(_g).unwrap();
				this.__handleError(e);
				result = false;
			}
		} else {
			result = openfl_display_DisplayObjectContainer.prototype.__dispatchEvent.call(this,event);
		}
		return result;
	}
	,__dispatchPendingMouseEvent: function() {
		if(this.__pendingMouseEvent) {
			this.__onMouse("mouseMove",this.__pendingMouseX,this.__pendingMouseY,0);
			this.__pendingMouseEvent = false;
		} else if(this.__mouseOverTarget != null) {
			if(this.__mouseOverTarget.__transformDirty || this.__mouseOverTarget.stage == null || !this.__mouseOverTarget.get_visible() || !this.__mouseOverTarget.mouseEnabled) {
				this.__onMouse(null,this.__untransformedMouseX,this.__untransformedMouseY,0);
			} else {
				var current = this.__mouseOverTarget.parent;
				while(current != null) {
					if(current.__transformDirty || current.stage == null || !current.get_visible() || !current.mouseChildren) {
						this.__onMouse(null,this.__untransformedMouseX,this.__untransformedMouseY,0);
						break;
					}
					current = current.parent;
				}
			}
		}
	}
	,__dispatchStack: function(event,stack) {
		if(this.__uncaughtErrorEvents.__enabled) {
			try {
				var target;
				var length = stack.length;
				if(length == 0) {
					event.eventPhase = 2;
					target = event.target;
					target.__dispatch(event);
				} else {
					event.eventPhase = 1;
					event.target = stack[stack.length - 1];
					var _g = 0;
					var _g1 = length - 1;
					while(_g < _g1) {
						var i = _g++;
						stack[i].__dispatch(event);
						if(event.__isCanceled) {
							return;
						}
					}
					event.eventPhase = 2;
					target = event.target;
					target.__dispatch(event);
					if(event.__isCanceled) {
						return;
					}
					if(event.bubbles) {
						event.eventPhase = 3;
						var i = length - 2;
						while(i >= 0) {
							stack[i].__dispatch(event);
							if(event.__isCanceled) {
								return;
							}
							--i;
						}
					}
				}
			} catch( _g ) {
				haxe_NativeStackTrace.lastError = _g;
				var e = haxe_Exception.caught(_g).unwrap();
				this.__handleError(e);
			}
		} else {
			var target;
			var length = stack.length;
			if(length == 0) {
				event.eventPhase = 2;
				target = event.target;
				target.__dispatch(event);
			} else {
				event.eventPhase = 1;
				event.target = stack[stack.length - 1];
				var _g = 0;
				var _g1 = length - 1;
				while(_g < _g1) {
					var i = _g++;
					stack[i].__dispatch(event);
					if(event.__isCanceled) {
						return;
					}
				}
				event.eventPhase = 2;
				target = event.target;
				target.__dispatch(event);
				if(event.__isCanceled) {
					return;
				}
				if(event.bubbles) {
					event.eventPhase = 3;
					var i = length - 2;
					while(i >= 0) {
						stack[i].__dispatch(event);
						if(event.__isCanceled) {
							return;
						}
						--i;
					}
				}
			}
		}
	}
	,__dispatchTarget: function(target,event) {
		if(this.__uncaughtErrorEvents.__enabled) {
			try {
				return target.__dispatchEvent(event);
			} catch( _g ) {
				haxe_NativeStackTrace.lastError = _g;
				var e = haxe_Exception.caught(_g).unwrap();
				this.__handleError(e);
				return false;
			}
		} else {
			return target.__dispatchEvent(event);
		}
	}
	,__drag: function(mouse) {
		var parent = this.__dragObject.parent;
		if(parent != null) {
			var _this = parent.__getWorldTransform();
			var norm = _this.a * _this.d - _this.b * _this.c;
			if(norm == 0) {
				mouse.x = -_this.tx;
				mouse.y = -_this.ty;
			} else {
				var px = 1.0 / norm * (_this.c * (_this.ty - mouse.y) + _this.d * (mouse.x - _this.tx));
				mouse.y = 1.0 / norm * (_this.a * (mouse.y - _this.ty) + _this.b * (_this.tx - mouse.x));
				mouse.x = px;
			}
		}
		var x = mouse.x + this.__dragOffsetX;
		var y = mouse.y + this.__dragOffsetY;
		if(this.__dragBounds != null) {
			if(x < this.__dragBounds.x) {
				x = this.__dragBounds.x;
			} else if(x > this.__dragBounds.get_right()) {
				x = this.__dragBounds.get_right();
			}
			if(y < this.__dragBounds.y) {
				y = this.__dragBounds.y;
			} else if(y > this.__dragBounds.get_bottom()) {
				y = this.__dragBounds.get_bottom();
			}
		}
		this.__dragObject.set_x(x);
		this.__dragObject.set_y(y);
	}
	,__getInteractive: function(stack) {
		if(stack != null) {
			stack.push(this);
		}
		return true;
	}
	,__globalToLocal: function(global,local) {
		if(global != local) {
			local.copyFrom(global);
		}
		return local;
	}
	,__handleError: function(e) {
		var event = new openfl_events_UncaughtErrorEvent("uncaughtError",true,true,e);
		openfl_Lib.get_current().__loaderInfo.uncaughtErrorEvents.dispatchEvent(event);
		if(!event.__preventDefault) {
			var message = haxe_CallStack.toString(haxe_CallStack.exceptionStack());
			console.log(message);
			var message = Std.string(e);
			console.log(message);
			try {
				var exc = e;
				if(exc != null && Object.prototype.hasOwnProperty.call(exc,"stack") && exc.stack != null && exc.stack != "") {
					console.log(exc.stack);
					e.stack = exc.stack;
				} else {
					var msg = haxe_CallStack.toString(haxe_CallStack.callStack());
					console.log(msg);
				}
			} catch( _g ) {
				haxe_NativeStackTrace.lastError = _g;
			}
			throw e;
		}
	}
	,__onKey: function(type,keyCode,modifier) {
		this.__dispatchPendingMouseEvent();
		openfl_events_MouseEvent.__altKey = lime_ui_KeyModifier.get_altKey(modifier);
		openfl_events_MouseEvent.__commandKey = lime_ui_KeyModifier.get_metaKey(modifier);
		openfl_events_MouseEvent.__controlKey = lime_ui_KeyModifier.get_ctrlKey(modifier);
		openfl_events_MouseEvent.__ctrlKey = this.__macKeyboard ? lime_ui_KeyModifier.get_ctrlKey(modifier) || lime_ui_KeyModifier.get_metaKey(modifier) : lime_ui_KeyModifier.get_ctrlKey(modifier);
		openfl_events_MouseEvent.__shiftKey = lime_ui_KeyModifier.get_shiftKey(modifier);
		var stack = [];
		if(this.__focus == null) {
			this.__getInteractive(stack);
		} else {
			this.__focus.__getInteractive(stack);
		}
		if(stack.length > 0) {
			var keyLocation;
			switch(keyCode) {
			case 1073741908:case 1073741909:case 1073741910:case 1073741911:case 1073741912:case 1073741913:case 1073741914:case 1073741915:case 1073741916:case 1073741917:case 1073741918:case 1073741919:case 1073741920:case 1073741921:case 1073741922:case 1073741923:case 1073742044:
				keyLocation = 3;
				break;
			case 1073742048:case 1073742049:case 1073742050:case 1073742051:
				keyLocation = 1;
				break;
			case 1073742052:case 1073742053:case 1073742054:case 1073742055:
				keyLocation = 2;
				break;
			default:
				keyLocation = 0;
			}
			var keyCode1;
			switch(keyCode) {
			case 8:
				keyCode1 = 8;
				break;
			case 9:
				keyCode1 = 9;
				break;
			case 13:
				keyCode1 = 13;
				break;
			case 27:
				keyCode1 = 27;
				break;
			case 32:
				keyCode1 = 32;
				break;
			case 33:
				keyCode1 = 49;
				break;
			case 34:
				keyCode1 = 222;
				break;
			case 35:
				keyCode1 = 51;
				break;
			case 36:
				keyCode1 = 52;
				break;
			case 37:
				keyCode1 = 53;
				break;
			case 38:
				keyCode1 = 55;
				break;
			case 39:
				keyCode1 = 222;
				break;
			case 40:
				keyCode1 = 57;
				break;
			case 41:
				keyCode1 = 48;
				break;
			case 42:
				keyCode1 = 56;
				break;
			case 44:
				keyCode1 = 188;
				break;
			case 45:
				keyCode1 = 189;
				break;
			case 46:
				keyCode1 = 190;
				break;
			case 47:
				keyCode1 = 191;
				break;
			case 48:
				keyCode1 = 48;
				break;
			case 49:
				keyCode1 = 49;
				break;
			case 50:
				keyCode1 = 50;
				break;
			case 51:
				keyCode1 = 51;
				break;
			case 52:
				keyCode1 = 52;
				break;
			case 53:
				keyCode1 = 53;
				break;
			case 54:
				keyCode1 = 54;
				break;
			case 55:
				keyCode1 = 55;
				break;
			case 56:
				keyCode1 = 56;
				break;
			case 57:
				keyCode1 = 57;
				break;
			case 58:
				keyCode1 = 186;
				break;
			case 59:
				keyCode1 = 186;
				break;
			case 60:
				keyCode1 = 60;
				break;
			case 61:
				keyCode1 = 187;
				break;
			case 62:
				keyCode1 = 190;
				break;
			case 63:
				keyCode1 = 191;
				break;
			case 64:
				keyCode1 = 50;
				break;
			case 91:
				keyCode1 = 219;
				break;
			case 92:
				keyCode1 = 220;
				break;
			case 93:
				keyCode1 = 221;
				break;
			case 94:
				keyCode1 = 54;
				break;
			case 95:
				keyCode1 = 189;
				break;
			case 96:
				keyCode1 = 192;
				break;
			case 97:
				keyCode1 = 65;
				break;
			case 98:
				keyCode1 = 66;
				break;
			case 99:
				keyCode1 = 67;
				break;
			case 100:
				keyCode1 = 68;
				break;
			case 101:
				keyCode1 = 69;
				break;
			case 102:
				keyCode1 = 70;
				break;
			case 103:
				keyCode1 = 71;
				break;
			case 104:
				keyCode1 = 72;
				break;
			case 105:
				keyCode1 = 73;
				break;
			case 106:
				keyCode1 = 74;
				break;
			case 107:
				keyCode1 = 75;
				break;
			case 108:
				keyCode1 = 76;
				break;
			case 109:
				keyCode1 = 77;
				break;
			case 110:
				keyCode1 = 78;
				break;
			case 111:
				keyCode1 = 79;
				break;
			case 112:
				keyCode1 = 80;
				break;
			case 113:
				keyCode1 = 81;
				break;
			case 114:
				keyCode1 = 82;
				break;
			case 115:
				keyCode1 = 83;
				break;
			case 116:
				keyCode1 = 84;
				break;
			case 117:
				keyCode1 = 85;
				break;
			case 118:
				keyCode1 = 86;
				break;
			case 119:
				keyCode1 = 87;
				break;
			case 120:
				keyCode1 = 88;
				break;
			case 121:
				keyCode1 = 89;
				break;
			case 122:
				keyCode1 = 90;
				break;
			case 127:
				keyCode1 = 46;
				break;
			case 1073741881:
				keyCode1 = 20;
				break;
			case 1073741882:
				keyCode1 = 112;
				break;
			case 1073741883:
				keyCode1 = 113;
				break;
			case 1073741884:
				keyCode1 = 114;
				break;
			case 1073741885:
				keyCode1 = 115;
				break;
			case 1073741886:
				keyCode1 = 116;
				break;
			case 1073741887:
				keyCode1 = 117;
				break;
			case 1073741888:
				keyCode1 = 118;
				break;
			case 1073741889:
				keyCode1 = 119;
				break;
			case 1073741890:
				keyCode1 = 120;
				break;
			case 1073741891:
				keyCode1 = 121;
				break;
			case 1073741892:
				keyCode1 = 122;
				break;
			case 1073741893:
				keyCode1 = 123;
				break;
			case 1073741894:
				keyCode1 = 301;
				break;
			case 1073741895:
				keyCode1 = 145;
				break;
			case 1073741896:
				keyCode1 = 19;
				break;
			case 1073741897:
				keyCode1 = 45;
				break;
			case 1073741898:
				keyCode1 = 36;
				break;
			case 1073741899:
				keyCode1 = 33;
				break;
			case 1073741901:
				keyCode1 = 35;
				break;
			case 1073741902:
				keyCode1 = 34;
				break;
			case 1073741903:
				keyCode1 = 39;
				break;
			case 1073741904:
				keyCode1 = 37;
				break;
			case 1073741905:
				keyCode1 = 40;
				break;
			case 1073741906:
				keyCode1 = 38;
				break;
			case 1073741907:
				keyCode1 = 144;
				break;
			case 1073741908:
				keyCode1 = 111;
				break;
			case 1073741909:
				keyCode1 = 106;
				break;
			case 1073741910:
				keyCode1 = 109;
				break;
			case 1073741911:
				keyCode1 = 107;
				break;
			case 1073741912:
				keyCode1 = 13;
				break;
			case 1073741913:
				keyCode1 = 97;
				break;
			case 1073741914:
				keyCode1 = 98;
				break;
			case 1073741915:
				keyCode1 = 99;
				break;
			case 1073741916:
				keyCode1 = 100;
				break;
			case 1073741917:
				keyCode1 = 101;
				break;
			case 1073741918:
				keyCode1 = 102;
				break;
			case 1073741919:
				keyCode1 = 103;
				break;
			case 1073741920:
				keyCode1 = 104;
				break;
			case 1073741921:
				keyCode1 = 105;
				break;
			case 1073741922:
				keyCode1 = 96;
				break;
			case 1073741923:
				keyCode1 = 110;
				break;
			case 1073741925:
				keyCode1 = 302;
				break;
			case 1073741928:
				keyCode1 = 124;
				break;
			case 1073741929:
				keyCode1 = 125;
				break;
			case 1073741930:
				keyCode1 = 126;
				break;
			case 1073741982:
				keyCode1 = 13;
				break;
			case 1073742044:
				keyCode1 = 110;
				break;
			case 1073742048:
				keyCode1 = 17;
				break;
			case 1073742049:
				keyCode1 = 16;
				break;
			case 1073742050:
				keyCode1 = 18;
				break;
			case 1073742051:
				keyCode1 = 15;
				break;
			case 1073742052:
				keyCode1 = 17;
				break;
			case 1073742053:
				keyCode1 = 16;
				break;
			case 1073742054:
				keyCode1 = 18;
				break;
			case 1073742055:
				keyCode1 = 15;
				break;
			default:
				keyCode1 = keyCode;
			}
			var charCode = openfl_ui_Keyboard.__getCharCode(keyCode1,lime_ui_KeyModifier.get_shiftKey(modifier),lime_ui_KeyModifier.get_capsLock(modifier));
			if(type == "keyUp" && (keyCode1 == 32 || keyCode1 == 13) && ((this.__focus) instanceof openfl_display_Sprite)) {
				var sprite = js_Boot.__cast(this.__focus , openfl_display_Sprite);
				if(sprite.get_buttonMode() && sprite.focusRect == true) {
					var localPoint = openfl_geom_Point.__pool.get();
					var targetPoint = openfl_geom_Point.__pool.get();
					targetPoint.x = this.__mouseX;
					targetPoint.y = this.__mouseY;
					var clickEvent = openfl_events_MouseEvent.__create("click",0,0,this.__mouseX,this.__mouseY,sprite.__globalToLocal(targetPoint,localPoint),sprite);
					this.__dispatchStack(clickEvent,stack);
					if(clickEvent.__updateAfterEventFlag) {
						this.__renderAfterEvent();
					}
					openfl_geom_Point.__pool.release(targetPoint);
					openfl_geom_Point.__pool.release(localPoint);
				}
			}
			var event = new openfl_events_KeyboardEvent(type,true,true,charCode,keyCode1,keyLocation,this.__macKeyboard ? lime_ui_KeyModifier.get_ctrlKey(modifier) || lime_ui_KeyModifier.get_metaKey(modifier) : lime_ui_KeyModifier.get_ctrlKey(modifier),lime_ui_KeyModifier.get_altKey(modifier),lime_ui_KeyModifier.get_shiftKey(modifier),lime_ui_KeyModifier.get_ctrlKey(modifier),lime_ui_KeyModifier.get_metaKey(modifier));
			stack.reverse();
			this.__dispatchStack(event,stack);
			if(event.__preventDefault) {
				if(type == "keyDown") {
					this.window.onKeyDown.cancel();
				} else {
					this.window.onKeyUp.cancel();
				}
			} else if(type == "keyDown" && keyCode1 == 9) {
				var tabStack = [];
				this.__tabTest(tabStack);
				var nextIndex = -1;
				var nextObject = null;
				var nextOffset = lime_ui_KeyModifier.get_shiftKey(modifier) ? -1 : 1;
				if(tabStack.length > 1) {
					haxe_ds_ArraySort.sort(tabStack,function(a,b) {
						return a.get_tabIndex() - b.get_tabIndex();
					});
					if(tabStack[tabStack.length - 1].get_tabIndex() != -1) {
						var i = 0;
						while(i < tabStack.length) {
							if(tabStack[i].get_tabIndex() > -1) {
								if(i > 0) {
									tabStack.splice(0,i);
								}
								break;
							}
							++i;
						}
					}
					if(this.get_focus() != null) {
						var current = this.get_focus();
						var index = tabStack.indexOf(current);
						while(index == -1 && current != null) {
							var currentParent = current.parent;
							if(currentParent != null && currentParent.get_tabChildren()) {
								var currentIndex = currentParent.getChildIndex(current);
								if(currentIndex == -1) {
									current = currentParent;
									continue;
								}
								var i = currentIndex + nextOffset;
								while(lime_ui_KeyModifier.get_shiftKey(modifier) ? i >= 0 : i < currentParent.get_numChildren()) {
									var sibling = currentParent.getChildAt(i);
									if(((sibling) instanceof openfl_display_InteractiveObject)) {
										var interactiveSibling = js_Boot.__cast(sibling , openfl_display_InteractiveObject);
										index = tabStack.indexOf(interactiveSibling);
										if(index != -1) {
											nextOffset = 0;
											break;
										}
									}
									i += nextOffset;
								}
							} else if(lime_ui_KeyModifier.get_shiftKey(modifier)) {
								index = tabStack.indexOf(currentParent);
								if(index != -1) {
									nextOffset = 0;
								}
							}
							current = currentParent;
						}
						if(index < 0) {
							nextIndex = 0;
						} else {
							nextIndex = index + nextOffset;
						}
					} else {
						nextIndex = this.__currentTabOrderIndex;
					}
				} else if(tabStack.length == 1) {
					nextObject = tabStack[0];
					if(this.get_focus() == nextObject) {
						nextObject = null;
					}
				}
				var cancelTab = nextIndex >= 0 && nextIndex < tabStack.length;
				if(tabStack.length == 1 || tabStack.length == 0 && this.get_focus() != null) {
					nextIndex = 0;
				} else if(tabStack.length > 1) {
					if(nextIndex < 0) {
						nextIndex += tabStack.length;
					}
					nextIndex %= tabStack.length;
					nextObject = tabStack[nextIndex];
					if(nextObject == this.get_focus()) {
						nextIndex += nextOffset;
						if(nextIndex < 0) {
							nextIndex += tabStack.length;
						}
						nextIndex %= tabStack.length;
						nextObject = tabStack[nextIndex];
					}
				}
				var focusEvent = null;
				if(this.get_focus() != null) {
					focusEvent = new openfl_events_FocusEvent("keyFocusChange",true,true,nextObject,lime_ui_KeyModifier.get_shiftKey(modifier),0);
					stack = [];
					this.get_focus().__getInteractive(stack);
					stack.reverse();
					this.__dispatchStack(focusEvent,stack);
					if(focusEvent.isDefaultPrevented()) {
						this.window.onKeyDown.cancel();
					}
				}
				if(focusEvent == null || !focusEvent.isDefaultPrevented()) {
					this.__currentTabOrderIndex = nextIndex;
					if(nextObject != null) {
						this.set_focus(nextObject);
					}
					if(cancelTab) {
						this.window.onKeyDown.cancel();
					}
				}
			} else if(type == "keyDown" && this.get_focus() != null && !((this.get_focus()) instanceof openfl_text_TextField)) {
				var ctrlKey = this.__macKeyboard ? lime_ui_KeyModifier.get_ctrlKey(modifier) || lime_ui_KeyModifier.get_metaKey(modifier) : lime_ui_KeyModifier.get_ctrlKey(modifier);
				if(ctrlKey && !lime_ui_KeyModifier.get_altKey(modifier) && !lime_ui_KeyModifier.get_shiftKey(modifier)) {
					switch(keyCode1) {
					case 65:
						var selectAllEvent = new openfl_events_Event("selectAll",true,true);
						this.get_focus().dispatchEvent(selectAllEvent);
						break;
					case 67:
						var copyEvent = new openfl_events_Event("copy",true,true);
						this.get_focus().dispatchEvent(copyEvent);
						break;
					case 86:
						var pasteEvent = new openfl_events_Event("paste",true,true);
						this.get_focus().dispatchEvent(pasteEvent);
						break;
					case 88:
						var cutEvent = new openfl_events_Event("cut",true,true);
						this.get_focus().dispatchEvent(cutEvent);
						break;
					}
				}
			}
			if(event.__updateAfterEventFlag) {
				this.__renderAfterEvent();
			}
		}
	}
	,__onLimeCreateWindow: function(window1) {
		if(this.window != window1) {
			return;
		}
		var _g = this;
		var window2 = window1;
		var tmp = function() {
			_g.__onLimeWindowActivate(window2);
		};
		window1.onActivate.add(tmp);
		var _g1 = this;
		var window3 = window1;
		var tmp = function() {
			_g1.__onLimeWindowClose(window3);
		};
		window1.onClose.add(tmp,false,-9000);
		var _g2 = this;
		var window4 = window1;
		var tmp = function() {
			_g2.__onLimeWindowDeactivate(window4);
		};
		window1.onDeactivate.add(tmp);
		var _g3 = this;
		var window5 = window1;
		var tmp = function(file) {
			_g3.__onLimeWindowDropFile(window5,file);
		};
		window1.onDropFile.add(tmp);
		var _g4 = this;
		var window6 = window1;
		var tmp = function() {
			_g4.__onLimeWindowEnter(window6);
		};
		window1.onEnter.add(tmp);
		var _g5 = this;
		var window7 = window1;
		var tmp = function() {
			_g5.__onLimeWindowExpose(window7);
		};
		window1.onExpose.add(tmp);
		var _g6 = this;
		var window8 = window1;
		var tmp = function() {
			_g6.__onLimeWindowFocusIn(window8);
		};
		window1.onFocusIn.add(tmp);
		var _g7 = this;
		var window9 = window1;
		var tmp = function() {
			_g7.__onLimeWindowFocusOut(window9);
		};
		window1.onFocusOut.add(tmp);
		var _g8 = this;
		var window10 = window1;
		var tmp = function() {
			_g8.__onLimeWindowFullscreen(window10);
		};
		window1.onFullscreen.add(tmp);
		var _g9 = this;
		var window11 = window1;
		var tmp = function(keyCode,modifier) {
			_g9.__onLimeKeyDown(window11,keyCode,modifier);
		};
		window1.onKeyDown.add(tmp);
		var _g10 = this;
		var window12 = window1;
		var tmp = function(keyCode,modifier) {
			_g10.__onLimeKeyUp(window12,keyCode,modifier);
		};
		window1.onKeyUp.add(tmp);
		var _g11 = this;
		var window13 = window1;
		var tmp = function() {
			_g11.__onLimeWindowLeave(window13);
		};
		window1.onLeave.add(tmp);
		var _g12 = this;
		var window14 = window1;
		var tmp = function() {
			_g12.__onLimeWindowMinimize(window14);
		};
		window1.onMinimize.add(tmp);
		var _g13 = this;
		var window15 = window1;
		var tmp = function(x,y,button) {
			_g13.__onLimeMouseDown(window15,x,y,button);
		};
		window1.onMouseDown.add(tmp);
		var _g14 = this;
		var window16 = window1;
		var tmp = function(x,y) {
			_g14.__onLimeMouseMove(window16,x,y);
		};
		window1.onMouseMove.add(tmp);
		var _g15 = this;
		var window17 = window1;
		var tmp = function(x,y) {
			_g15.__onLimeMouseMoveRelative(window17,x,y);
		};
		window1.onMouseMoveRelative.add(tmp);
		var _g16 = this;
		var window18 = window1;
		var tmp = function(x,y,button) {
			_g16.__onLimeMouseUp(window18,x,y,button);
		};
		window1.onMouseUp.add(tmp);
		var _g17 = this;
		var window19 = window1;
		var tmp = function(deltaX,deltaY,deltaMode) {
			_g17.__onLimeMouseWheel(window19,deltaX,deltaY,deltaMode);
		};
		window1.onMouseWheel.add(tmp);
		var _g18 = this;
		var window20 = window1;
		var tmp = function(x,y) {
			_g18.__onLimeWindowMove(window20,x,y);
		};
		window1.onMove.add(tmp);
		window1.onRender.add($bind(this,this.__onLimeRender));
		window1.onRenderContextLost.add($bind(this,this.__onLimeRenderContextLost));
		window1.onRenderContextRestored.add($bind(this,this.__onLimeRenderContextRestored));
		var _g19 = this;
		var window21 = window1;
		var tmp = function(width,height) {
			_g19.__onLimeWindowResize(window21,width,height);
		};
		window1.onResize.add(tmp);
		var _g20 = this;
		var window22 = window1;
		var tmp = function() {
			_g20.__onLimeWindowRestore(window22);
		};
		window1.onRestore.add(tmp);
		var _g21 = this;
		var window23 = window1;
		var tmp = function(text,start,length) {
			_g21.__onLimeTextEdit(window23,text,start,length);
		};
		window1.onTextEdit.add(tmp);
		var _g22 = this;
		var window24 = window1;
		var tmp = function(text) {
			_g22.__onLimeTextInput(window24,text);
		};
		window1.onTextInput.add(tmp);
		this.__onLimeWindowCreate(window1);
	}
	,__onLimeGamepadAxisMove: function(gamepad,axis,value) {
		if(this.__uncaughtErrorEvents.__enabled) {
			try {
				openfl_ui_GameInput.__onGamepadAxisMove(gamepad,axis,value);
			} catch( _g ) {
				haxe_NativeStackTrace.lastError = _g;
				var e = haxe_Exception.caught(_g).unwrap();
				this.__handleError(e);
			}
		} else {
			openfl_ui_GameInput.__onGamepadAxisMove(gamepad,axis,value);
		}
	}
	,__onLimeGamepadButtonDown: function(gamepad,button) {
		if(this.__uncaughtErrorEvents.__enabled) {
			try {
				openfl_ui_GameInput.__onGamepadButtonDown(gamepad,button);
			} catch( _g ) {
				haxe_NativeStackTrace.lastError = _g;
				var e = haxe_Exception.caught(_g).unwrap();
				this.__handleError(e);
			}
		} else {
			openfl_ui_GameInput.__onGamepadButtonDown(gamepad,button);
		}
	}
	,__onLimeGamepadButtonUp: function(gamepad,button) {
		if(this.__uncaughtErrorEvents.__enabled) {
			try {
				openfl_ui_GameInput.__onGamepadButtonUp(gamepad,button);
			} catch( _g ) {
				haxe_NativeStackTrace.lastError = _g;
				var e = haxe_Exception.caught(_g).unwrap();
				this.__handleError(e);
			}
		} else {
			openfl_ui_GameInput.__onGamepadButtonUp(gamepad,button);
		}
	}
	,__onLimeGamepadConnect: function(gamepad) {
		if(this.__uncaughtErrorEvents.__enabled) {
			try {
				openfl_ui_GameInput.__onGamepadConnect(gamepad);
			} catch( _g ) {
				haxe_NativeStackTrace.lastError = _g;
				var e = haxe_Exception.caught(_g).unwrap();
				this.__handleError(e);
			}
		} else {
			openfl_ui_GameInput.__onGamepadConnect(gamepad);
		}
		var _g = this;
		var gamepad1 = gamepad;
		var tmp = function(axis,value) {
			_g.__onLimeGamepadAxisMove(gamepad1,axis,value);
		};
		gamepad.onAxisMove.add(tmp);
		var _g1 = this;
		var gamepad2 = gamepad;
		var tmp = function(button) {
			_g1.__onLimeGamepadButtonDown(gamepad2,button);
		};
		gamepad.onButtonDown.add(tmp);
		var _g2 = this;
		var gamepad3 = gamepad;
		var tmp = function(button) {
			_g2.__onLimeGamepadButtonUp(gamepad3,button);
		};
		gamepad.onButtonUp.add(tmp);
		var _g3 = this;
		var gamepad4 = gamepad;
		var tmp = function() {
			_g3.__onLimeGamepadDisconnect(gamepad4);
		};
		gamepad.onDisconnect.add(tmp);
	}
	,__onLimeGamepadDisconnect: function(gamepad) {
		if(this.__uncaughtErrorEvents.__enabled) {
			try {
				openfl_ui_GameInput.__onGamepadDisconnect(gamepad);
			} catch( _g ) {
				haxe_NativeStackTrace.lastError = _g;
				var e = haxe_Exception.caught(_g).unwrap();
				this.__handleError(e);
			}
		} else {
			openfl_ui_GameInput.__onGamepadDisconnect(gamepad);
		}
	}
	,__onLimeKeyDown: function(window1,keyCode,modifier) {
		if(this.window == null || this.window != window1) {
			return;
		}
		this.__onKey("keyDown",keyCode,modifier);
	}
	,__onLimeKeyUp: function(window1,keyCode,modifier) {
		if(this.window == null || this.window != window1) {
			return;
		}
		this.__onKey("keyUp",keyCode,modifier);
	}
	,__onLimeModuleExit: function(code) {
		if(this.window != null) {
			var event = null;
			event = new openfl_events_Event("deactivate");
			this.__broadcastEvent(event);
		}
	}
	,__onLimeMouseDown: function(window1,x,y,button) {
		if(this.window == null || this.window != window1) {
			return;
		}
		this.__dispatchPendingMouseEvent();
		var type;
		switch(button) {
		case 1:
			type = "middleMouseDown";
			break;
		case 2:
			type = "rightMouseDown";
			break;
		default:
			type = "mouseDown";
		}
		this.__onMouse(type,x * window1.__scale | 0,y * window1.__scale | 0,button);
		if(!this.showDefaultContextMenu && button == 2) {
			window1.onMouseDown.cancel();
		}
	}
	,__onLimeMouseMove: function(window1,x,y) {
		if(this.window == null || this.window != window1) {
			return;
		}
		this.__pendingMouseEvent = true;
		this.__pendingMouseX = x * window1.__scale | 0;
		this.__pendingMouseY = y * window1.__scale | 0;
	}
	,__onLimeMouseMoveRelative: function(window1,x,y) {
	}
	,__onLimeMouseUp: function(window1,x,y,button) {
		if(this.window == null || this.window != window1) {
			return;
		}
		this.__dispatchPendingMouseEvent();
		var type;
		switch(button) {
		case 1:
			type = "middleMouseUp";
			break;
		case 2:
			type = "rightMouseUp";
			break;
		default:
			type = "mouseUp";
		}
		this.__onMouse(type,x * window1.__scale | 0,y * window1.__scale | 0,button);
		if(!this.showDefaultContextMenu && button == 2) {
			window1.onMouseUp.cancel();
		}
	}
	,__onLimeMouseWheel: function(window1,deltaX,deltaY,deltaMode) {
		if(this.window == null || this.window != window1) {
			return;
		}
		this.__dispatchPendingMouseEvent();
		if(deltaMode == lime_ui_MouseWheelMode.PIXELS) {
			this.__onMouseWheel(deltaX * window1.__scale | 0,deltaY * window1.__scale | 0,deltaMode);
		} else {
			this.__onMouseWheel(deltaX | 0,deltaY | 0,deltaMode);
		}
	}
	,__onLimeDisplayOrientationChange: function(display,orientation) {
		var newStageOrientation;
		switch(orientation) {
		case 1:
			newStageOrientation = 1;
			break;
		case 2:
			newStageOrientation = 2;
			break;
		case 3:
			newStageOrientation = 0;
			break;
		case 4:
			newStageOrientation = 4;
			break;
		default:
			newStageOrientation = 3;
		}
		var oldStageOrientation = this.__oldStageOrientation;
		this.__oldStageOrientation = newStageOrientation;
		this.dispatchEvent(new openfl_events_StageOrientationEvent("orientationChange",true,false,oldStageOrientation,newStageOrientation));
	}
	,__renderAfterEvent: function() {
		var cancelled = this.__render(this.window.context);
	}
	,__render: function(context) {
		var cancelled = false;
		var event = null;
		var shouldRender = this.__renderer != null && (this.__renderDirty || this.__forceRender);
		if(this.__invalidated && shouldRender) {
			this.__invalidated = false;
			event = new openfl_events_Event("render");
			this.__broadcastEvent(event);
		}
		this.__update(false,true);
		if(this.__renderer != null) {
			if(this.context3D != null) {
				var stage3D = this.stage3Ds.iterator();
				while(stage3D.hasNext()) {
					var stage3D1 = stage3D.next();
					this.context3D.__renderStage3D(stage3D1);
				}
				if(this.context3D.__present) {
					shouldRender = true;
				}
			}
			if(shouldRender) {
				var tmp = this.__renderer.__type == "cairo";
				if(this.context3D == null) {
					this.__renderer.__clear();
				}
				this.__renderer.__render(this);
			} else if(this.context3D == null) {
				cancelled = true;
			}
			if(this.context3D != null) {
				if(!this.context3D.__present) {
					cancelled = true;
				} else {
					if(!this.__renderer.__cleared) {
						this.__renderer.__clear();
					}
					this.context3D.__present = false;
					this.context3D.__cleared = false;
				}
			}
			this.__renderer.__cleared = false;
		}
		return cancelled;
	}
	,__onLimeRender: function(context) {
		if(this.__rendering) {
			return;
		}
		this.__rendering = true;
		var event = null;
		this.__broadcastEvent(new openfl_events_Event("enterFrame"));
		this.__broadcastEvent(new openfl_events_Event("frameConstructed"));
		this.__broadcastEvent(new openfl_events_Event("exitFrame"));
		this.__renderable = true;
		this.__enterFrame(this.__deltaTime);
		this.__deltaTime = 0;
		var cancelled = this.__render(context);
		if(cancelled) {
			this.window.onRender.cancel();
		}
		this.__rendering = false;
	}
	,__onLimeRenderContextLost: function() {
		this.__renderer = null;
		this.context3D = null;
		var stage3D = this.stage3Ds.iterator();
		while(stage3D.hasNext()) {
			var stage3D1 = stage3D.next();
			stage3D1.__lostContext();
		}
	}
	,__onLimeRenderContextRestored: function(context) {
		this.__createRenderer();
		var stage3D = this.stage3Ds.iterator();
		while(stage3D.hasNext()) {
			var stage3D1 = stage3D.next();
			stage3D1.__restoreContext();
		}
	}
	,__onLimeTextEdit: function(window1,text,start,length) {
	}
	,__onLimeTextInput: function(window1,text) {
		if(this.window == null || this.window != window1) {
			return;
		}
		var stack = [];
		if(this.__focus == null) {
			this.__getInteractive(stack);
		} else {
			this.__focus.__getInteractive(stack);
		}
		var event = new openfl_events_TextEvent("textInput",true,true,text);
		if(stack.length > 0) {
			stack.reverse();
			this.__dispatchStack(event,stack);
		} else {
			this.__dispatchEvent(event);
		}
		if(event.isDefaultPrevented()) {
			window1.onTextInput.cancel();
		}
	}
	,__onLimeTouchCancel: function(touch) {
		var isPrimaryTouchPoint = this.__primaryTouch == touch;
		if(isPrimaryTouchPoint) {
			this.__primaryTouch = null;
		}
		this.__onTouch("touchEnd",touch,isPrimaryTouchPoint);
	}
	,__onLimeTouchMove: function(touch) {
		this.__onTouch("touchMove",touch,this.__primaryTouch == touch);
	}
	,__onLimeTouchEnd: function(touch) {
		var isPrimaryTouchPoint = this.__primaryTouch == touch;
		if(isPrimaryTouchPoint) {
			this.__primaryTouch = null;
		}
		this.__onTouch("touchEnd",touch,isPrimaryTouchPoint);
	}
	,__onLimeTouchStart: function(touch) {
		if(this.__primaryTouch == null) {
			this.__primaryTouch = touch;
		}
		this.__onTouch("touchBegin",touch,this.__primaryTouch == touch);
	}
	,__onLimeUpdate: function(deltaTime) {
		this.__deltaTime = deltaTime;
		this.__dispatchPendingMouseEvent();
	}
	,__onLimeWindowActivate: function(window1) {
		if(this.window == null || this.window != window1) {
			return;
		}
	}
	,__onLimeWindowClose: function(window1) {
		if(this.window == window1) {
			this.window = null;
		}
		this.__primaryTouch = null;
		var event = null;
		event = new openfl_events_Event("deactivate");
		this.__broadcastEvent(event);
	}
	,__onLimeWindowCreate: function(window1) {
		if(this.window == null || this.window != window1) {
			return;
		}
		if(window1.context != null) {
			this.__createRenderer();
		}
		if(window1.get_display() != null) {
			switch(window1.get_display().orientation) {
			case 1:
				this.__oldStageOrientation = 1;
				break;
			case 2:
				this.__oldStageOrientation = 2;
				break;
			case 3:
				this.__oldStageOrientation = 0;
				break;
			case 4:
				this.__oldStageOrientation = 4;
				break;
			default:
				this.__oldStageOrientation = 3;
			}
		}
	}
	,__onLimeWindowDeactivate: function(window1) {
		if(this.window == null || this.window != window1) {
			return;
		}
	}
	,__onLimeWindowDropFile: function(window1,file) {
	}
	,__onLimeWindowEnter: function(window1) {
	}
	,__onLimeWindowExpose: function(window1) {
		if(this.window == null || this.window != window1) {
			return;
		}
		this.__renderDirty = true;
	}
	,__onLimeWindowFocusIn: function(window1) {
		if(this.window == null || this.window != window1) {
			return;
		}
		this.__renderDirty = true;
		var event = null;
		event = new openfl_events_Event("activate");
		this.__broadcastEvent(event);
		this.set_focus(this.__cacheFocus);
	}
	,__onLimeWindowFocusOut: function(window1) {
		if(this.window == null || this.window != window1) {
			return;
		}
		this.__primaryTouch = null;
		var event = null;
		event = new openfl_events_Event("deactivate");
		this.__broadcastEvent(event);
		var currentFocus = this.get_focus();
		this.set_focus(null);
		this.__cacheFocus = currentFocus;
		openfl_events_MouseEvent.__altKey = false;
		openfl_events_MouseEvent.__commandKey = false;
		openfl_events_MouseEvent.__ctrlKey = false;
		openfl_events_MouseEvent.__shiftKey = false;
	}
	,__onLimeWindowFullscreen: function(window1) {
		if(this.window == null || this.window != window1) {
			return;
		}
		this.__resize();
		if(!this.__wasFullscreen) {
			this.__wasFullscreen = true;
			if(this.__displayState == 2) {
				this.__displayState = 1;
			}
			this.__dispatchEvent(new openfl_events_FullScreenEvent("fullScreen",false,false,true,true));
		}
	}
	,__onLimeWindowLeave: function(window1) {
		if(this.window == null || this.window != window1 || openfl_events_MouseEvent.__buttonDown) {
			return;
		}
		this.__dispatchPendingMouseEvent();
		var event = null;
		event = new openfl_events_Event("mouseLeave");
		this.__dispatchEvent(event);
	}
	,__onLimeWindowMinimize: function(window1) {
		if(this.window == null || this.window != window1) {
			return;
		}
	}
	,__onLimeWindowMove: function(window1,x,y) {
	}
	,__onLimeWindowResize: function(window1,width,height) {
		if(this.window == null || this.window != window1) {
			return;
		}
		this.__resize();
		if(this.__wasFullscreen && !window1.__fullscreen) {
			this.__wasFullscreen = false;
			this.__displayState = 2;
			this.__dispatchEvent(new openfl_events_FullScreenEvent("fullScreen",false,false,false,true));
		}
	}
	,__onLimeWindowRestore: function(window1) {
		if(this.window == null || this.window != window1) {
			return;
		}
		if(this.__wasFullscreen && !window1.__fullscreen) {
			this.__wasFullscreen = false;
			this.__displayState = 2;
			this.__dispatchEvent(new openfl_events_FullScreenEvent("fullScreen",false,false,false,true));
		}
	}
	,__onMouse: function(type,x,y,button) {
		if(button > 2) {
			return;
		}
		this.__untransformedMouseX = x;
		this.__untransformedMouseY = y;
		var targetPoint = openfl_geom_Point.__pool.get();
		targetPoint.setTo(x,y);
		var _this = this.__displayMatrix;
		var norm = _this.a * _this.d - _this.b * _this.c;
		if(norm == 0) {
			targetPoint.x = -_this.tx;
			targetPoint.y = -_this.ty;
		} else {
			var px = 1.0 / norm * (_this.c * (_this.ty - targetPoint.y) + _this.d * (targetPoint.x - _this.tx));
			targetPoint.y = 1.0 / norm * (_this.a * (targetPoint.y - _this.ty) + _this.b * (_this.tx - targetPoint.x));
			targetPoint.x = px;
		}
		this.__mouseX = targetPoint.x;
		this.__mouseY = targetPoint.y;
		var stack = [];
		var target = null;
		if(this.__hitTest(this.__mouseX,this.__mouseY,true,stack,true,this)) {
			target = stack[stack.length - 1];
		} else {
			target = this;
			stack = [this];
		}
		if(target == null) {
			target = this;
		}
		var clickType = null;
		var supportsClickCount = false;
		if(type != null) {
			switch(type) {
			case "middleMouseDown":
				this.__mouseDownMiddle = target;
				supportsClickCount = true;
				break;
			case "middleMouseUp":
				if(this.__mouseDownMiddle == target) {
					clickType = "middleClick";
				}
				this.__mouseDownMiddle = null;
				supportsClickCount = true;
				break;
			case "mouseDown":
				if(this.get_focus() != null) {
					if(this.get_focus() != target) {
						var focusEvent = new openfl_events_FocusEvent("mouseFocusChange",true,true,target,false,0);
						this.get_focus().dispatchEvent(focusEvent);
						if(!focusEvent.isDefaultPrevented()) {
							if(target.__allowMouseFocus()) {
								this.set_focus(target);
							} else {
								this.set_focus(null);
							}
						}
					}
				} else if(target.__allowMouseFocus()) {
					this.set_focus(target);
				} else {
					this.set_focus(null);
				}
				this.__mouseDownLeft = target;
				if(this.__lastClickTarget != target) {
					this.__lastClickTarget = null;
					this.__lastClickTime = 0;
				}
				openfl_events_MouseEvent.__buttonDown = true;
				supportsClickCount = true;
				break;
			case "mouseUp":
				if(this.__mouseDownLeft != null) {
					openfl_events_MouseEvent.__buttonDown = false;
					if(this.__mouseDownLeft == target) {
						clickType = "click";
					} else {
						var event = null;
						event = openfl_events_MouseEvent.__create("releaseOutside",1,0,this.__mouseX,this.__mouseY,new openfl_geom_Point(this.__mouseX,this.__mouseY),this);
						this.__mouseDownLeft.dispatchEvent(event);
					}
					this.__mouseDownLeft = null;
				}
				supportsClickCount = true;
				break;
			case "rightMouseDown":
				this.__mouseDownRight = target;
				supportsClickCount = true;
				break;
			case "rightMouseUp":
				if(this.__mouseDownRight == target) {
					clickType = "rightClick";
				}
				this.__mouseDownRight = null;
				supportsClickCount = true;
				break;
			default:
			}
		}
		var localPoint = openfl_geom_Point.__pool.get();
		if(type != null) {
			var event = null;
			var clickCount = supportsClickCount ? this.window.clickCount : 0;
			event = openfl_events_MouseEvent.__create(type,button,clickCount,this.__mouseX,this.__mouseY,target.__globalToLocal(targetPoint,localPoint),target);
			this.__dispatchStack(event,stack);
			if(event.__updateAfterEventFlag) {
				this.__renderAfterEvent();
			}
		}
		if(clickType != null) {
			var event = null;
			event = openfl_events_MouseEvent.__create(clickType,button,0,this.__mouseX,this.__mouseY,target.__globalToLocal(targetPoint,localPoint),target);
			this.__dispatchStack(event,stack);
			if(event.__updateAfterEventFlag) {
				this.__renderAfterEvent();
			}
			if(type == "mouseUp") {
				if(target.doubleClickEnabled) {
					var currentTime = openfl_Lib.getTimer();
					if(currentTime - this.__lastClickTime < 500 && target == this.__lastClickTarget) {
						event = openfl_events_MouseEvent.__create("doubleClick",button,0,this.__mouseX,this.__mouseY,target.__globalToLocal(targetPoint,localPoint),target);
						this.__dispatchStack(event,stack);
						if(event.__updateAfterEventFlag) {
							this.__renderAfterEvent();
						}
						this.__lastClickTime = 0;
						this.__lastClickTarget = null;
					} else {
						this.__lastClickTarget = target;
						this.__lastClickTime = currentTime;
					}
				} else {
					this.__lastClickTarget = null;
					this.__lastClickTime = 0;
				}
			}
		}
		if(openfl_ui_Mouse.__cursor == "auto" && !openfl_ui_Mouse.__hidden) {
			var cursor = null;
			if(this.__mouseDownLeft != null) {
				cursor = this.__mouseDownLeft.__getCursor();
			} else {
				var _g = 0;
				while(_g < stack.length) {
					var target1 = stack[_g];
					++_g;
					cursor = target1.__getCursor();
					if(cursor != null && this.window != null) {
						this.window.set_cursor(openfl_ui_MouseCursor.toLimeCursor(cursor));
						break;
					}
				}
			}
			if(cursor == null && this.window != null) {
				this.window.set_cursor(lime_ui_MouseCursor.ARROW);
			}
		}
		if(target != this.__mouseOverTarget) {
			if(this.__mouseOverTarget != null) {
				var event = null;
				event = openfl_events_MouseEvent.__create("mouseOut",button,0,this.__mouseX,this.__mouseY,this.__mouseOverTarget.__globalToLocal(targetPoint,localPoint),this.__mouseOverTarget);
				this.__dispatchStack(event,this.__mouseOutStack);
				if(event.__updateAfterEventFlag) {
					this.__renderAfterEvent();
				}
			}
		}
		var item;
		var i = 0;
		while(i < this.__rollOutStack.length) {
			item = this.__rollOutStack[i];
			if(stack.indexOf(item) == -1) {
				HxOverrides.remove(this.__rollOutStack,item);
				if(item.hasEventListener("rollOut")) {
					var event = null;
					event = openfl_events_MouseEvent.__create("rollOut",button,0,this.__mouseX,this.__mouseY,this.__mouseOverTarget.__globalToLocal(targetPoint,localPoint),item);
					event.bubbles = false;
					this.__dispatchTarget(item,event);
					if(event.__updateAfterEventFlag) {
						this.__renderAfterEvent();
					}
				}
			} else {
				++i;
			}
		}
		var newMouseOverTarget = null;
		if(target != this.__mouseOverTarget) {
			newMouseOverTarget = target;
			this.__mouseOverTarget = target;
			this.__mouseOutStack = stack;
		}
		var _g = 0;
		while(_g < stack.length) {
			var item = stack[_g];
			++_g;
			if(this.__rollOutStack.indexOf(item) == -1 && this.__mouseOverTarget != null) {
				if(item.hasEventListener("rollOver")) {
					var event = null;
					event = openfl_events_MouseEvent.__create("rollOver",button,0,this.__mouseX,this.__mouseY,this.__mouseOverTarget.__globalToLocal(targetPoint,localPoint),item);
					event.bubbles = false;
					this.__dispatchTarget(item,event);
					if(event.__updateAfterEventFlag) {
						this.__renderAfterEvent();
					}
				}
				this.__rollOutStack.push(item);
			}
		}
		if(newMouseOverTarget != null) {
			var event = null;
			event = openfl_events_MouseEvent.__create("mouseOver",button,0,this.__mouseX,this.__mouseY,newMouseOverTarget.__globalToLocal(targetPoint,localPoint),newMouseOverTarget);
			this.__dispatchStack(event,stack);
			if(event.__updateAfterEventFlag) {
				this.__renderAfterEvent();
			}
		}
		if(this.__dragObject != null) {
			this.__drag(targetPoint);
			var dropTarget = null;
			if(this.__mouseOverTarget == this.__dragObject) {
				var cacheMouseEnabled = this.__dragObject.mouseEnabled;
				var cacheMouseChildren = this.__dragObject.mouseChildren;
				this.__dragObject.mouseEnabled = false;
				this.__dragObject.mouseChildren = false;
				var stack = [];
				if(this.__hitTest(this.__mouseX,this.__mouseY,true,stack,true,this)) {
					dropTarget = stack[stack.length - 1];
				}
				this.__dragObject.mouseEnabled = cacheMouseEnabled;
				this.__dragObject.mouseChildren = cacheMouseChildren;
			} else if(this.__mouseOverTarget != this) {
				dropTarget = this.__mouseOverTarget;
			}
			this.__dragObject.dropTarget = dropTarget;
		}
		openfl_geom_Point.__pool.release(targetPoint);
		openfl_geom_Point.__pool.release(localPoint);
	}
	,__onMouseWheel: function(deltaX,deltaY,deltaMode) {
		var x = this.__mouseX;
		var y = this.__mouseY;
		var stack = [];
		var target = null;
		if(this.__hitTest(this.__mouseX,this.__mouseY,true,stack,true,this)) {
			target = stack[stack.length - 1];
		} else {
			target = this;
			stack = [this];
		}
		if(target == null) {
			target = this;
		}
		var targetPoint = openfl_geom_Point.__pool.get();
		targetPoint.setTo(x,y);
		var _this = this.__displayMatrix;
		var norm = _this.a * _this.d - _this.b * _this.c;
		if(norm == 0) {
			targetPoint.x = -_this.tx;
			targetPoint.y = -_this.ty;
		} else {
			var px = 1.0 / norm * (_this.c * (_this.ty - targetPoint.y) + _this.d * (targetPoint.x - _this.tx));
			targetPoint.y = 1.0 / norm * (_this.a * (targetPoint.y - _this.ty) + _this.b * (_this.tx - targetPoint.x));
			targetPoint.x = px;
		}
		var delta = deltaY | 0;
		var event = openfl_events_MouseEvent.__create("mouseWheel",0,0,this.__mouseX,this.__mouseY,target.__globalToLocal(targetPoint,targetPoint),target,delta);
		event.cancelable = true;
		this.__dispatchStack(event,stack);
		if(event.isDefaultPrevented()) {
			this.window.onMouseWheel.cancel();
		}
		if(event.__updateAfterEventFlag) {
			this.__renderAfterEvent();
		}
		openfl_geom_Point.__pool.release(targetPoint);
	}
	,__onTouch: function(type,touch,isPrimaryTouchPoint) {
		var targetPoint = openfl_geom_Point.__pool.get();
		targetPoint.setTo(Math.round(touch.x * this.window.__width * this.window.__scale),Math.round(touch.y * this.window.__height * this.window.__scale));
		var _this = this.__displayMatrix;
		var norm = _this.a * _this.d - _this.b * _this.c;
		if(norm == 0) {
			targetPoint.x = -_this.tx;
			targetPoint.y = -_this.ty;
		} else {
			var px = 1.0 / norm * (_this.c * (_this.ty - targetPoint.y) + _this.d * (targetPoint.x - _this.tx));
			targetPoint.y = 1.0 / norm * (_this.a * (targetPoint.y - _this.ty) + _this.b * (_this.tx - targetPoint.x));
			targetPoint.x = px;
		}
		var touchX = targetPoint.x;
		var touchY = targetPoint.y;
		var stack = [];
		var target = null;
		if(this.__hitTest(touchX,touchY,false,stack,true,this)) {
			target = stack[stack.length - 1];
		} else {
			target = this;
			stack = [this];
		}
		if(target == null) {
			target = this;
		}
		var touchId = touch.id;
		var touchData = null;
		if(this.__touchData.h.hasOwnProperty(touchId)) {
			touchData = this.__touchData.h[touchId];
		} else {
			touchData = openfl_utils__$internal_TouchData.__pool.get();
			touchData.reset();
			touchData.touch = touch;
			this.__touchData.h[touchId] = touchData;
		}
		var touchType = null;
		var releaseTouchData = false;
		switch(type) {
		case "touchBegin":
			touchData.touchDownTarget = target;
			break;
		case "touchEnd":
			if(touchData.touchDownTarget == target) {
				touchType = "touchTap";
			}
			touchData.touchDownTarget = null;
			releaseTouchData = true;
			break;
		default:
		}
		var localPoint = openfl_geom_Point.__pool.get();
		var touchEvent = openfl_events_TouchEvent.__create(type,null,touchX,touchY,target.__globalToLocal(targetPoint,localPoint),target);
		touchEvent.touchPointID = touchId;
		touchEvent.isPrimaryTouchPoint = isPrimaryTouchPoint;
		touchEvent.pressure = touch.pressure;
		this.__dispatchStack(touchEvent,stack);
		if(touchEvent.__updateAfterEventFlag) {
			this.__renderAfterEvent();
		}
		if(touchType != null) {
			touchEvent = openfl_events_TouchEvent.__create(touchType,null,touchX,touchY,target.__globalToLocal(targetPoint,localPoint),target);
			touchEvent.touchPointID = touchId;
			touchEvent.isPrimaryTouchPoint = isPrimaryTouchPoint;
			touchEvent.pressure = touch.pressure;
			this.__dispatchStack(touchEvent,stack);
			if(touchEvent.__updateAfterEventFlag) {
				this.__renderAfterEvent();
			}
		}
		var touchOverTarget = touchData.touchOverTarget;
		if(target != touchOverTarget && touchOverTarget != null) {
			touchEvent = openfl_events_TouchEvent.__create("touchOut",null,touchX,touchY,touchOverTarget.__globalToLocal(targetPoint,localPoint),touchOverTarget);
			touchEvent.touchPointID = touchId;
			touchEvent.isPrimaryTouchPoint = isPrimaryTouchPoint;
			touchEvent.pressure = touch.pressure;
			this.__dispatchTarget(touchOverTarget,touchEvent);
			if(touchEvent.__updateAfterEventFlag) {
				this.__renderAfterEvent();
			}
		}
		var touchOutStack = touchData.rollOutStack;
		var item;
		var i = 0;
		while(i < touchOutStack.length) {
			item = touchOutStack[i];
			if(stack.indexOf(item) == -1) {
				HxOverrides.remove(touchOutStack,item);
				touchEvent = openfl_events_TouchEvent.__create("touchRollOut",null,touchX,touchY,touchOverTarget.__globalToLocal(targetPoint,localPoint),touchOverTarget);
				touchEvent.touchPointID = touchId;
				touchEvent.isPrimaryTouchPoint = isPrimaryTouchPoint;
				touchEvent.bubbles = false;
				touchEvent.pressure = touch.pressure;
				this.__dispatchTarget(item,touchEvent);
				if(touchEvent.__updateAfterEventFlag) {
					this.__renderAfterEvent();
				}
			} else {
				++i;
			}
		}
		var _g = 0;
		while(_g < stack.length) {
			var item = stack[_g];
			++_g;
			if(touchOutStack.indexOf(item) == -1) {
				if(item.hasEventListener("touchRollOver")) {
					touchEvent = openfl_events_TouchEvent.__create("touchRollOver",null,touchX,touchY,touchOverTarget.__globalToLocal(targetPoint,localPoint),item);
					touchEvent.touchPointID = touchId;
					touchEvent.isPrimaryTouchPoint = isPrimaryTouchPoint;
					touchEvent.bubbles = false;
					touchEvent.pressure = touch.pressure;
					this.__dispatchTarget(item,touchEvent);
					if(touchEvent.__updateAfterEventFlag) {
						this.__renderAfterEvent();
					}
				}
				if(item.hasEventListener("touchRollOut")) {
					touchOutStack.push(item);
				}
			}
		}
		if(target != touchOverTarget) {
			if(target != null) {
				touchEvent = openfl_events_TouchEvent.__create("touchOver",null,touchX,touchY,target.__globalToLocal(targetPoint,localPoint),target);
				touchEvent.touchPointID = touchId;
				touchEvent.isPrimaryTouchPoint = isPrimaryTouchPoint;
				touchEvent.bubbles = true;
				touchEvent.pressure = touch.pressure;
				this.__dispatchTarget(target,touchEvent);
				if(touchEvent.__updateAfterEventFlag) {
					this.__renderAfterEvent();
				}
			}
			touchData.touchOverTarget = target;
		}
		openfl_geom_Point.__pool.release(targetPoint);
		openfl_geom_Point.__pool.release(localPoint);
		if(releaseTouchData) {
			this.__touchData.remove(touchId);
			touchData.reset();
			openfl_utils__$internal_TouchData.__pool.release(touchData);
		}
	}
	,__registerLimeModule: function(application) {
		application.onCreateWindow.add($bind(this,this.__onLimeCreateWindow));
		application.onUpdate.add($bind(this,this.__onLimeUpdate));
		application.onExit.add($bind(this,this.__onLimeModuleExit),false,0);
		application.onDisplayOrientationChange.add($bind(this,this.__onLimeDisplayOrientationChange));
		var gamepad = lime_ui_Gamepad.devices.iterator();
		while(gamepad.hasNext()) {
			var gamepad1 = gamepad.next();
			this.__onLimeGamepadConnect(gamepad1);
		}
		lime_ui_Gamepad.onConnect.add($bind(this,this.__onLimeGamepadConnect));
		lime_ui_Touch.onStart.add($bind(this,this.__onLimeTouchStart));
		lime_ui_Touch.onMove.add($bind(this,this.__onLimeTouchMove));
		lime_ui_Touch.onEnd.add($bind(this,this.__onLimeTouchEnd));
		lime_ui_Touch.onCancel.add($bind(this,this.__onLimeTouchCancel));
	}
	,__applyScaleAndAlign: function(windowWidth,windowHeight,scaleX,scaleY) {
		var scaledWidth = this.__logicalWidth * scaleX;
		var scaledHeight = this.__logicalHeight * scaleY;
		var visibleWidth = this.__logicalWidth - Math.round((scaledWidth - windowWidth) / scaleX);
		var visibleHeight = this.__logicalHeight - Math.round((scaledHeight - windowHeight) / scaleY);
		var visibleX = 0.0;
		var visibleY = 0.0;
		switch(this.align) {
		case 0:
			visibleX = Math.round((this.__logicalWidth - visibleWidth) / 2);
			visibleY = Math.round(this.__logicalHeight - visibleHeight);
			break;
		case 1:
			visibleY = Math.round(this.__logicalHeight - visibleHeight);
			break;
		case 2:
			visibleX = Math.round(this.__logicalWidth - visibleWidth);
			visibleY = Math.round(this.__logicalHeight - visibleHeight);
			break;
		case 3:
			visibleY = Math.round((this.__logicalHeight - visibleHeight) / 2);
			break;
		case 4:
			visibleX = Math.round(this.__logicalWidth - visibleWidth);
			visibleY = Math.round((this.__logicalHeight - visibleHeight) / 2);
			break;
		case 5:
			visibleX = Math.round((this.__logicalWidth - visibleWidth) / 2);
			break;
		case 7:
			visibleX = Math.round(this.__logicalWidth - visibleWidth);
			break;
		default:
		}
		this.__displayMatrix.translate(-visibleX,-visibleY);
		this.__displayMatrix.scale(scaleX,scaleY);
		this.__displayRect.setTo(visibleX,visibleY,visibleWidth,visibleHeight);
	}
	,__resize: function() {
		var cacheWidth = this.stageWidth;
		var cacheHeight = this.stageHeight;
		var windowWidth = this.window.__width * this.window.__scale | 0;
		var windowHeight = this.window.__height * this.window.__scale | 0;
		this.__displayMatrix.identity();
		if(this.get_fullScreenSourceRect() != null && this.window.__fullscreen) {
			this.stageWidth = this.get_fullScreenSourceRect().width | 0;
			this.stageHeight = this.get_fullScreenSourceRect().height | 0;
			var displayScaleX = windowWidth / this.stageWidth;
			var displayScaleY = windowHeight / this.stageHeight;
			this.__displayMatrix.translate(-this.get_fullScreenSourceRect().x,-this.get_fullScreenSourceRect().y);
			this.__displayMatrix.scale(displayScaleX,displayScaleY);
			this.__displayRect.setTo(this.get_fullScreenSourceRect().get_left(),this.get_fullScreenSourceRect().get_right(),this.get_fullScreenSourceRect().get_top(),this.get_fullScreenSourceRect().get_bottom());
		} else if(this.__logicalWidth == 0 || this.__logicalHeight == 0 || this.get_scaleMode() == 2 || windowWidth == 0 || windowHeight == 0) {
			this.stageWidth = Math.round(windowWidth / this.window.__scale);
			this.stageHeight = Math.round(windowHeight / this.window.__scale);
			this.__displayMatrix.scale(this.window.__scale,this.window.__scale);
			this.__displayRect.setTo(0,0,this.stageWidth,this.stageHeight);
		} else {
			this.stageWidth = this.__logicalWidth;
			this.stageHeight = this.__logicalHeight;
			switch(this.get_scaleMode()) {
			case 0:
				var displayScaleX = windowWidth / this.__logicalWidth;
				var displayScaleY = windowHeight / this.__logicalHeight;
				this.__displayMatrix.scale(displayScaleX,displayScaleY);
				this.__displayRect.setTo(0,0,this.__logicalWidth,this.__logicalHeight);
				break;
			case 1:
				var scaleX = windowWidth / this.__logicalWidth;
				var scaleY = windowHeight / this.__logicalHeight;
				var scale = Math.max(scaleX,scaleY);
				this.__applyScaleAndAlign(windowWidth,windowHeight,scale,scale);
				break;
			default:
				var scaleX = windowWidth / this.__logicalWidth;
				var scaleY = windowHeight / this.__logicalHeight;
				var scale = Math.min(scaleX,scaleY);
				this.__applyScaleAndAlign(windowWidth,windowHeight,scale,scale);
			}
		}
		if(this.context3D != null) {
			this.context3D.configureBackBuffer(this.stageWidth,this.stageHeight,0,true,true,true);
		}
		var stage3D = this.stage3Ds.iterator();
		while(stage3D.hasNext()) {
			var stage3D1 = stage3D.next();
			stage3D1.__resize(windowWidth,windowHeight);
		}
		if(this.__renderer != null) {
			this.__renderer.__resize(windowWidth,windowHeight);
		}
		this.__renderDirty = true;
		if(this.stageWidth != cacheWidth || this.stageHeight != cacheHeight) {
			this.__setTransformDirty();
			var event = null;
			event = new openfl_events_Event("resize");
			this.__dispatchEvent(event);
		}
	}
	,__setLogicalSize: function(width,height) {
		this.__logicalWidth = width;
		this.__logicalHeight = height;
		this.__resize();
	}
	,__startDrag: function(sprite,lockCenter,bounds) {
		if(bounds == null) {
			this.__dragBounds = null;
		} else {
			this.__dragBounds = new openfl_geom_Rectangle();
			var right = bounds.get_right();
			var bottom = bounds.get_bottom();
			this.__dragBounds.x = right < bounds.x ? right : bounds.x;
			this.__dragBounds.y = bottom < bounds.y ? bottom : bounds.y;
			this.__dragBounds.width = Math.abs(bounds.width);
			this.__dragBounds.height = Math.abs(bounds.height);
		}
		this.__dragObject = sprite;
		if(this.__dragObject != null) {
			if(lockCenter) {
				this.__dragOffsetX = 0;
				this.__dragOffsetY = 0;
			} else {
				var mouse = openfl_geom_Point.__pool.get();
				mouse.setTo(this.get_mouseX(),this.get_mouseY());
				var parent = this.__dragObject.parent;
				if(parent != null) {
					var _this = parent.__getWorldTransform();
					var norm = _this.a * _this.d - _this.b * _this.c;
					if(norm == 0) {
						mouse.x = -_this.tx;
						mouse.y = -_this.ty;
					} else {
						var px = 1.0 / norm * (_this.c * (_this.ty - mouse.y) + _this.d * (mouse.x - _this.tx));
						mouse.y = 1.0 / norm * (_this.a * (mouse.y - _this.ty) + _this.b * (_this.tx - mouse.x));
						mouse.x = px;
					}
				}
				this.__dragOffsetX = this.__dragObject.get_x() - mouse.x;
				this.__dragOffsetY = this.__dragObject.get_y() - mouse.y;
				openfl_geom_Point.__pool.release(mouse);
			}
		}
	}
	,__stopDrag: function(sprite) {
		this.__dragBounds = null;
		this.__dragObject = null;
	}
	,__unregisterLimeModule: function(application) {
		application.onCreateWindow.remove($bind(this,this.__onLimeCreateWindow));
		application.onUpdate.remove($bind(this,this.__onLimeUpdate));
		application.onExit.remove($bind(this,this.__onLimeModuleExit));
		application.onDisplayOrientationChange.remove($bind(this,this.__onLimeDisplayOrientationChange));
		lime_ui_Gamepad.onConnect.remove($bind(this,this.__onLimeGamepadConnect));
		lime_ui_Touch.onStart.remove($bind(this,this.__onLimeTouchStart));
		lime_ui_Touch.onMove.remove($bind(this,this.__onLimeTouchMove));
		lime_ui_Touch.onEnd.remove($bind(this,this.__onLimeTouchEnd));
		lime_ui_Touch.onCancel.remove($bind(this,this.__onLimeTouchCancel));
	}
	,__update: function(transformOnly,updateChildren) {
		if(transformOnly) {
			if(this.__transformDirty) {
				openfl_display_DisplayObjectContainer.prototype.__update.call(this,true,updateChildren);
				if(updateChildren) {
					this.__transformDirty = false;
				}
			}
		} else if(this.__transformDirty || this.__renderDirty) {
			openfl_display_DisplayObjectContainer.prototype.__update.call(this,false,updateChildren);
			if(updateChildren) {
				if(openfl_display_DisplayObject.__supportDOM) {
					this.__wasDirty = true;
				}
			}
		} else if(!this.__renderDirty && this.__wasDirty) {
			openfl_display_DisplayObjectContainer.prototype.__update.call(this,false,updateChildren);
			if(updateChildren) {
				this.__wasDirty = false;
			}
		}
	}
	,get_autoOrients: function() {
		return false;
	}
	,set_autoOrients: function(value) {
		return false;
	}
	,get_color: function() {
		return this.__color;
	}
	,set_color: function(value) {
		if(value == null) {
			this.__transparent = true;
			value = 0;
		} else {
			this.__transparent = false;
		}
		if(this.__color != value) {
			var r = (value & 16711680) >>> 16;
			var g = (value & 65280) >>> 8;
			var b = value & 255;
			this.__colorSplit[0] = r / 255;
			this.__colorSplit[1] = g / 255;
			this.__colorSplit[2] = b / 255;
			this.__colorString = "#" + StringTools.hex(value & 16777215,6);
			this.__renderDirty = true;
			this.__color = -16777216 | value & 16777215;
		}
		return value;
	}
	,get_contentsScaleFactor: function() {
		return this.__contentsScaleFactor;
	}
	,get_deviceOrientation: function() {
		switch(this.application.get_deviceOrientation()) {
		case 1:
			return 1;
		case 2:
			return 2;
		case 3:
			return 0;
		case 4:
			return 4;
		default:
			return 3;
		}
	}
	,get_displayState: function() {
		return this.__displayState;
	}
	,set_displayState: function(value) {
		if(this.window != null) {
			if(value == 2) {
				if(this.window.__fullscreen) {
					this.window.set_fullscreen(false);
				}
			} else if(!this.window.__fullscreen) {
				this.window.set_fullscreen(true);
			}
		}
		return this.__displayState = value;
	}
	,get_focus: function() {
		return this.__focus;
	}
	,set_focus: function(value) {
		if(value != this.__focus || value == null && this.__cacheFocus != null) {
			var oldFocus = this.__focus;
			this.__focus = value;
			this.__cacheFocus = value;
			if(oldFocus != null) {
				var event = new openfl_events_FocusEvent("focusOut",true,false,value,false,0);
				var stack = [];
				oldFocus.__getInteractive(stack);
				stack.reverse();
				this.__dispatchStack(event,stack);
			}
			if(value != null) {
				var event = new openfl_events_FocusEvent("focusIn",true,false,oldFocus,false,0);
				var stack = [];
				value.__getInteractive(stack);
				stack.reverse();
				this.__dispatchStack(event,stack);
			}
		}
		return value;
	}
	,get_frameRate: function() {
		if(this.window != null) {
			return this.window.__backend.getFrameRate();
		}
		return 0;
	}
	,set_frameRate: function(value) {
		if(this.window != null) {
			return this.window.__backend.setFrameRate(value);
		}
		return value;
	}
	,get_fullScreenHeight: function() {
		return Math.ceil(this.window.get_display().currentMode.height * this.window.__scale);
	}
	,get_fullScreenSourceRect: function() {
		if(this.__fullScreenSourceRect == null) {
			return null;
		} else {
			return this.__fullScreenSourceRect.clone();
		}
	}
	,set_fullScreenSourceRect: function(value) {
		if(value == null) {
			if(this.__fullScreenSourceRect != null) {
				this.__fullScreenSourceRect = null;
				this.__resize();
			}
		} else if(!value.equals(this.__fullScreenSourceRect)) {
			this.__fullScreenSourceRect = value.clone();
			this.__resize();
		}
		return value;
	}
	,get_fullScreenWidth: function() {
		return Math.ceil(this.window.get_display().currentMode.width * this.window.__scale);
	}
	,set_height: function(value) {
		return this.get_height();
	}
	,get_mouseX: function() {
		return this.__mouseX;
	}
	,get_mouseY: function() {
		return this.__mouseY;
	}
	,get_orientation: function() {
		var display = this.window.get_display();
		if(display != null) {
			switch(display.orientation) {
			case 1:
				return 2;
			case 2:
				return 1;
			case 3:
				return 0;
			case 4:
				return 4;
			default:
				return 3;
			}
		}
		return 3;
	}
	,get_quality: function() {
		return this.__quality;
	}
	,set_quality: function(value) {
		this.__quality = value;
		if(this.__renderer != null) {
			var tmp = this.get_quality();
			this.__renderer.__allowSmoothing = tmp != 2;
		}
		return value;
	}
	,set_rotation: function(value) {
		return 0;
	}
	,get_scaleMode: function() {
		return this.__scaleMode;
	}
	,set_scaleMode: function(value) {
		if(value != this.__scaleMode) {
			this.__scaleMode = value;
			this.__resize();
		}
		return value;
	}
	,set_scaleX: function(value) {
		return 0;
	}
	,set_scaleY: function(value) {
		return 0;
	}
	,get_supportedOrientations: function() {
		return openfl_Vector.toNullVector(null);
	}
	,get_tabEnabled: function() {
		return false;
	}
	,set_tabEnabled: function(value) {
		throw new openfl_errors_IllegalOperationError("Error: The Stage class does not implement this property or method.");
	}
	,get_tabIndex: function() {
		return -1;
	}
	,set_tabIndex: function(value) {
		throw new openfl_errors_IllegalOperationError("Error: The Stage class does not implement this property or method.");
	}
	,set_transform: function(value) {
		return this.get_transform();
	}
	,set_width: function(value) {
		return this.get_width();
	}
	,set_x: function(value) {
		return 0;
	}
	,set_y: function(value) {
		return 0;
	}
	,__class__: openfl_display_Stage
	,__properties__: $extend(openfl_display_DisplayObjectContainer.prototype.__properties__,{get_supportedOrientations:"get_supportedOrientations",set_scaleMode:"set_scaleMode",get_scaleMode:"get_scaleMode",set_quality:"set_quality",get_quality:"get_quality",get_orientation:"get_orientation",get_fullScreenWidth:"get_fullScreenWidth",set_fullScreenSourceRect:"set_fullScreenSourceRect",get_fullScreenSourceRect:"get_fullScreenSourceRect",get_fullScreenHeight:"get_fullScreenHeight",set_frameRate:"set_frameRate",get_frameRate:"get_frameRate",set_focus:"set_focus",get_focus:"get_focus",set_displayState:"set_displayState",get_displayState:"get_displayState",get_deviceOrientation:"get_deviceOrientation",get_contentsScaleFactor:"get_contentsScaleFactor",set_color:"set_color",get_color:"get_color",set_autoOrients:"set_autoOrients",get_autoOrients:"get_autoOrients"})
});
var openfl_display_Stage3D = function(stage) {
	openfl_events_EventDispatcher.call(this);
	this.__stage = stage;
	this.__height = 0;
	this.__projectionTransform = new openfl_geom_Matrix3D();
	this.__renderTransform = new openfl_geom_Matrix3D();
	this.__width = 0;
	this.__x = 0;
	this.__y = 0;
	this.visible = true;
	if(stage.stageWidth > 0 && stage.stageHeight > 0) {
		this.__resize(stage.stageWidth,stage.stageHeight);
	}
};
$hxClasses["openfl.display.Stage3D"] = openfl_display_Stage3D;
openfl_display_Stage3D.__name__ = "openfl.display.Stage3D";
openfl_display_Stage3D.__super__ = openfl_events_EventDispatcher;
openfl_display_Stage3D.prototype = $extend(openfl_events_EventDispatcher.prototype,{
	context3D: null
	,visible: null
	,__contextLost: null
	,__contextRequested: null
	,__height: null
	,__indexBuffer: null
	,__projectionTransform: null
	,__renderTransform: null
	,__stage: null
	,__vertexBuffer: null
	,__width: null
	,__x: null
	,__y: null
	,__canvas: null
	,__renderContext: null
	,__style: null
	,__webgl: null
	,requestContext3D: function(context3DRenderMode,profile) {
		if(profile == null) {
			profile = 0;
		}
		if(context3DRenderMode == null) {
			context3DRenderMode = 0;
		}
		if(this.__contextLost) {
			this.__contextRequested = true;
			return;
		}
		if(this.context3D != null) {
			this.__contextRequested = true;
			haxe_Timer.delay($bind(this,this.__dispatchCreate),1);
		} else if(!this.__contextRequested) {
			this.__contextRequested = true;
			haxe_Timer.delay($bind(this,this.__createContext),1);
		}
	}
	,requestContext3DMatchingProfiles: function(profiles) {
		this.requestContext3D();
	}
	,__createContext: function() {
		var stage = this.__stage;
		var renderer = stage.__renderer;
		if(renderer.__type == "cairo" || renderer.__type == "canvas") {
			this.__dispatchError();
			return;
		}
		if(renderer.__type == "opengl") {
			this.context3D = new openfl_display3D_Context3D(stage,stage.context3D.__contextState,this);
			this.__dispatchCreate();
		} else if(renderer.__type == "dom") {
			if(stage.context3D == null) {
				this.__canvas = window.document.createElement("canvas");
				this.__canvas.width = stage.stageWidth;
				this.__canvas.height = stage.stageHeight;
				var window1 = stage.window;
				var attributes = stage.window.context.attributes;
				var transparentBackground = Object.prototype.hasOwnProperty.call(attributes,"background") && attributes.background == null;
				var colorDepth = Object.prototype.hasOwnProperty.call(attributes,"colorDepth") ? attributes.colorDepth : 32;
				var options = Object.prototype.hasOwnProperty.call(attributes,"antialiasing") && attributes.antialiasing > 0;
				var options1 = { alpha : transparentBackground || colorDepth > 16, antialias : options, depth : true, premultipliedAlpha : true, stencil : true, preserveDrawingBuffer : false};
				this.__webgl = js_html__$CanvasElement_CanvasUtil.getContextWebGL(this.__canvas,options1);
				if(this.__webgl != null) {
					if(lime_graphics_opengl_GL.context == null) {
						lime_graphics_opengl_GL.context = this.__webgl;
						lime_graphics_opengl_GL.type = "webgl";
						lime_graphics_opengl_GL.version = 1;
					}
					stage.context3D = new openfl_display3D_Context3D(stage);
					stage.context3D.configureBackBuffer(stage.window.__width,stage.window.__height,0,true,true,true);
					stage.context3D.present();
					var renderer1 = renderer;
					renderer1.element.appendChild(this.__canvas);
					this.__style = this.__canvas.style;
					this.__style.setProperty("position","absolute",null);
					this.__style.setProperty("top","0",null);
					this.__style.setProperty("left","0",null);
					this.__style.setProperty(renderer1.__transformOriginProperty,"0 0 0",null);
					this.__style.setProperty("z-index","-1",null);
				}
				if(stage.context3D != null) {
					this.context3D = new openfl_display3D_Context3D(stage,stage.context3D.__contextState,this);
				}
				this.__dispatchCreate();
			} else {
				this.__dispatchError();
			}
		}
	}
	,__dispatchError: function() {
		this.__contextRequested = false;
		this.dispatchEvent(new openfl_events_ErrorEvent("error",false,false,"Context3D not available"));
	}
	,__dispatchCreate: function() {
		if(this.__contextRequested) {
			this.__contextRequested = false;
			this.dispatchEvent(new openfl_events_Event("context3DCreate"));
		}
	}
	,__lostContext: function() {
		this.__contextLost = true;
		if(this.context3D != null) {
			this.context3D.__dispose();
			this.__contextRequested = true;
		}
	}
	,__resize: function(width,height) {
		if(width != this.__width || height != this.__height) {
			if(this.__canvas != null) {
				this.__canvas.width = width;
				this.__canvas.height = height;
			}
			this.__projectionTransform.copyRawDataFrom(openfl_Vector.toFloatVector(null,null,null,[2.0 / (width > 0 ? width : 1),0.0,0.0,0.0,0.0,-2.0 / (height > 0 ? height : 1),0.0,0.0,0.0,0.0,-0.001,0.0,-1.0,1.0,0.0,1.0]));
			var pixelRatio = this.__stage.window.__scale;
			this.__renderTransform.identity();
			this.__renderTransform.appendTranslation(this.__x * pixelRatio,this.__y * pixelRatio,0);
			this.__renderTransform.append(this.__projectionTransform);
			this.__width = width;
			this.__height = height;
		}
	}
	,__restoreContext: function() {
		this.__contextLost = false;
		this.__createContext();
	}
	,get_x: function() {
		return this.__x;
	}
	,set_x: function(value) {
		if(this.__x == value) {
			return value;
		}
		this.__x = value;
		var pixelRatio = this.__stage.window.__scale;
		this.__renderTransform.identity();
		this.__renderTransform.appendTranslation(this.__x * pixelRatio,this.__y * pixelRatio,0);
		this.__renderTransform.append(this.__projectionTransform);
		return value;
	}
	,get_y: function() {
		return this.__y;
	}
	,set_y: function(value) {
		if(this.__y == value) {
			return value;
		}
		this.__y = value;
		var pixelRatio = this.__stage.window.__scale;
		this.__renderTransform.identity();
		this.__renderTransform.appendTranslation(this.__x * pixelRatio,this.__y * pixelRatio,0);
		this.__renderTransform.append(this.__projectionTransform);
		return value;
	}
	,__class__: openfl_display_Stage3D
	,__properties__: {set_y:"set_y",get_y:"get_y",set_x:"set_x",get_x:"get_x"}
});
var openfl_display_StageAlign = {};
openfl_display_StageAlign.fromString = function(value) {
	switch(value) {
	case "bottom":
		return 0;
	case "bottomLeft":
		return 1;
	case "bottomRight":
		return 2;
	case "left":
		return 3;
	case "right":
		return 4;
	case "top":
		return 5;
	case "topLeft":
		return 6;
	case "topRight":
		return 7;
	default:
		return null;
	}
};
openfl_display_StageAlign.toString = function(this1) {
	switch(this1) {
	case 0:
		return "bottom";
	case 1:
		return "bottomLeft";
	case 2:
		return "bottomRight";
	case 3:
		return "left";
	case 4:
		return "right";
	case 5:
		return "top";
	case 6:
		return "topLeft";
	case 7:
		return "topRight";
	default:
		return null;
	}
};
var openfl_display_StageDisplayState = {};
openfl_display_StageDisplayState.fromString = function(value) {
	switch(value) {
	case "fullScreen":
		return 0;
	case "fullScreenInteractive":
		return 1;
	case "normal":
		return 2;
	default:
		return null;
	}
};
openfl_display_StageDisplayState.toString = function(this1) {
	switch(this1) {
	case 0:
		return "fullScreen";
	case 1:
		return "fullScreenInteractive";
	case 2:
		return "normal";
	default:
		return null;
	}
};
var openfl_display_StageOrientation = {};
openfl_display_StageOrientation.fromInt = function(value) {
	return value;
};
openfl_display_StageOrientation.fromString = function(value) {
	switch(value) {
	case "default":
		return 0;
	case "rotatedLeft":
		return 1;
	case "rotatedRight":
		return 2;
	case "unknown":
		return 3;
	case "upsideDown":
		return 4;
	default:
		return null;
	}
};
openfl_display_StageOrientation.toInt = function(this1) {
	return this1;
};
openfl_display_StageOrientation.toString = function(this1) {
	switch(this1) {
	case 0:
		return "default";
	case 1:
		return "rotatedLeft";
	case 2:
		return "rotatedRight";
	case 3:
		return "unknown";
	case 4:
		return "upsideDown";
	default:
		return null;
	}
};
var openfl_display_StageQuality = {};
openfl_display_StageQuality.fromString = function(value) {
	switch(value) {
	case "best":
		return 0;
	case "high":
		return 1;
	case "low":
		return 2;
	case "medium":
		return 3;
	default:
		return null;
	}
};
openfl_display_StageQuality.toString = function(this1) {
	switch(this1) {
	case 0:
		return "best";
	case 1:
		return "high";
	case 2:
		return "low";
	case 3:
		return "medium";
	default:
		return null;
	}
};
var openfl_display_StageScaleMode = {};
openfl_display_StageScaleMode.fromString = function(value) {
	switch(value) {
	case "exactFit":
		return 0;
	case "noBorder":
		return 1;
	case "noScale":
		return 2;
	case "showAll":
		return 3;
	default:
		return null;
	}
};
openfl_display_StageScaleMode.toString = function(this1) {
	switch(this1) {
	case 0:
		return "exactFit";
	case 1:
		return "noBorder";
	case 2:
		return "noScale";
	case 3:
		return "showAll";
	default:
		return null;
	}
};
var openfl_display_Tile = function(id,x,y,scaleX,scaleY,rotation,originX,originY) {
	if(originY == null) {
		originY = 0;
	}
	if(originX == null) {
		originX = 0;
	}
	if(rotation == null) {
		rotation = 0;
	}
	if(scaleY == null) {
		scaleY = 1;
	}
	if(scaleX == null) {
		scaleX = 1;
	}
	if(y == null) {
		y = 0;
	}
	if(x == null) {
		x = 0;
	}
	if(id == null) {
		id = 0;
	}
	this.__id = id;
	this.__matrix = new openfl_geom_Matrix();
	if(x != 0) {
		this.set_x(x);
	}
	if(y != 0) {
		this.set_y(y);
	}
	if(scaleX != 1) {
		this.set_scaleX(scaleX);
	}
	if(scaleY != 1) {
		this.set_scaleY(scaleY);
	}
	if(rotation != 0) {
		this.set_rotation(rotation);
	}
	this.__dirty = true;
	this.__length = 0;
	this.__originX = originX;
	this.__originY = originY;
	this.__alpha = 1;
	this.__blendMode = null;
	this.__visible = true;
};
$hxClasses["openfl.display.Tile"] = openfl_display_Tile;
openfl_display_Tile.__name__ = "openfl.display.Tile";
openfl_display_Tile.prototype = {
	data: null
	,parent: null
	,__alpha: null
	,__blendMode: null
	,__colorTransform: null
	,__dirty: null
	,__id: null
	,__length: null
	,__matrix: null
	,__originX: null
	,__originY: null
	,__rect: null
	,__rotation: null
	,__rotationCosine: null
	,__rotationSine: null
	,__scaleX: null
	,__scaleY: null
	,__shader: null
	,__tileset: null
	,__visible: null
	,clone: function() {
		var tile = new openfl_display_Tile(this.__id);
		tile.__alpha = this.__alpha;
		tile.__blendMode = this.__blendMode;
		tile.__originX = this.__originX;
		tile.__originY = this.__originY;
		if(this.__rect != null) {
			tile.__rect = this.__rect.clone();
		}
		tile.set_matrix(this.__matrix.clone());
		tile.__shader = this.__shader;
		tile.set_tileset(this.__tileset);
		if(this.__colorTransform != null) {
			tile.__colorTransform = this.__colorTransform.__clone();
		}
		return tile;
	}
	,getBounds: function(targetCoordinateSpace) {
		var result = new openfl_geom_Rectangle();
		this.__findTileRect(result);
		var matrix = openfl_geom_Matrix.__pool.get();
		if(targetCoordinateSpace != null && targetCoordinateSpace != this) {
			matrix.copyFrom(this.__getWorldTransform());
			var targetMatrix = openfl_geom_Matrix.__pool.get();
			targetMatrix.copyFrom(targetCoordinateSpace.__getWorldTransform());
			targetMatrix.invert();
			matrix.concat(targetMatrix);
			openfl_geom_Matrix.__pool.release(targetMatrix);
		} else {
			matrix.identity();
		}
		this.__getBounds(result,matrix);
		openfl_geom_Matrix.__pool.release(matrix);
		return result;
	}
	,__getBounds: function(result,matrix) {
		result.__transform(result,matrix);
	}
	,hitTestTile: function(obj) {
		if(obj != null && obj.parent != null && this.parent != null) {
			var currentBounds = this.getBounds(this);
			var targetBounds = obj.getBounds(this);
			return currentBounds.intersects(targetBounds);
		}
		return false;
	}
	,invalidate: function() {
		this.__setRenderDirty();
	}
	,__findTileRect: function(result) {
		if(this.get_tileset() == null) {
			if(this.parent != null) {
				var parentTileset = this.parent.__findTileset();
				if(parentTileset == null) {
					result.setTo(0,0,0,0);
				} else {
					var _g = parentTileset.getRect(this.get_id());
					if(_g == null) {
						result.setTo(0,0,0,0);
					} else {
						var not_null = _g;
						result.copyFrom(not_null);
					}
				}
			} else {
				result.setTo(0,0,0,0);
			}
		} else {
			result.copyFrom(this.get_tileset().getRect(this.get_id()));
		}
		result.x = 0;
		result.y = 0;
	}
	,__findTileset: function() {
		if(this.get_tileset() != null) {
			return this.get_tileset();
		}
		if(((this.parent) instanceof openfl_display_Tilemap)) {
			return this.parent.get_tileset();
		}
		if(this.parent == null) {
			return null;
		}
		return this.parent.__findTileset();
	}
	,__getWorldTransform: function() {
		var retval = this.get_matrix().clone();
		if(this.parent != null) {
			retval.concat(this.parent.__getWorldTransform());
		}
		return retval;
	}
	,__setRenderDirty: function() {
		if(!this.__dirty) {
			this.__dirty = true;
			if(this.parent != null) {
				this.parent.__setRenderDirty();
			}
		}
	}
	,get_alpha: function() {
		return this.__alpha;
	}
	,set_alpha: function(value) {
		if(value != this.__alpha) {
			this.__alpha = value;
			this.__setRenderDirty();
		}
		return value;
	}
	,get_blendMode: function() {
		return this.__blendMode;
	}
	,set_blendMode: function(value) {
		if(value != this.__blendMode) {
			this.__blendMode = value;
			this.__setRenderDirty();
		}
		return value;
	}
	,get_colorTransform: function() {
		return this.__colorTransform;
	}
	,set_colorTransform: function(value) {
		if(value != this.__colorTransform) {
			this.__colorTransform = value;
			this.__setRenderDirty();
		}
		return value;
	}
	,get_height: function() {
		var result = openfl_geom_Rectangle.__pool.get();
		this.__findTileRect(result);
		this.__getBounds(result,this.get_matrix());
		var h = result.height;
		openfl_geom_Rectangle.__pool.release(result);
		return h;
	}
	,set_height: function(value) {
		var result = openfl_geom_Rectangle.__pool.get();
		this.__findTileRect(result);
		if(result.height != 0) {
			this.set_scaleY(value / result.height);
		}
		openfl_geom_Rectangle.__pool.release(result);
		return value;
	}
	,get_id: function() {
		return this.__id;
	}
	,set_id: function(value) {
		if(value != this.__id) {
			this.__id = value;
			this.__setRenderDirty();
		}
		return value;
	}
	,get_matrix: function() {
		return this.__matrix;
	}
	,set_matrix: function(value) {
		if(value != this.__matrix) {
			this.__rotation = null;
			this.__scaleX = null;
			this.__scaleY = null;
			this.__matrix = value;
			this.__setRenderDirty();
		}
		return value;
	}
	,get_originX: function() {
		return this.__originX;
	}
	,set_originX: function(value) {
		if(value != this.__originX) {
			this.__originX = value;
			this.__setRenderDirty();
		}
		return value;
	}
	,get_originY: function() {
		return this.__originY;
	}
	,set_originY: function(value) {
		if(value != this.__originY) {
			this.__originY = value;
			this.__setRenderDirty();
		}
		return value;
	}
	,get_rect: function() {
		return this.__rect;
	}
	,set_rect: function(value) {
		if(value != this.__rect) {
			this.__rect = value;
			this.__setRenderDirty();
		}
		return value;
	}
	,get_rotation: function() {
		if(this.__rotation == null) {
			if(this.__matrix.b == 0 && this.__matrix.c == 0) {
				this.__rotation = 0;
				this.__rotationSine = 0;
				this.__rotationCosine = 1;
			} else {
				var radians = Math.atan2(this.__matrix.d,this.__matrix.c) - Math.PI / 2;
				this.__rotation = radians * (180 / Math.PI);
				this.__rotationSine = Math.sin(radians);
				this.__rotationCosine = Math.cos(radians);
			}
		}
		return this.__rotation;
	}
	,set_rotation: function(value) {
		if(value != this.__rotation) {
			this.__rotation = value;
			var radians = value * (Math.PI / 180);
			this.__rotationSine = Math.sin(radians);
			this.__rotationCosine = Math.cos(radians);
			var __scaleX = this.get_scaleX();
			var __scaleY = this.get_scaleY();
			this.__matrix.a = this.__rotationCosine * __scaleX;
			this.__matrix.b = this.__rotationSine * __scaleX;
			this.__matrix.c = -this.__rotationSine * __scaleY;
			this.__matrix.d = this.__rotationCosine * __scaleY;
			this.__setRenderDirty();
		}
		return value;
	}
	,get_scaleX: function() {
		if(this.__scaleX == null) {
			if(this.get_matrix().b == 0) {
				this.__scaleX = this.__matrix.a;
			} else {
				this.__scaleX = Math.sqrt(this.__matrix.a * this.__matrix.a + this.__matrix.b * this.__matrix.b);
			}
		}
		return this.__scaleX;
	}
	,set_scaleX: function(value) {
		if(value != this.__scaleX) {
			this.__scaleX = value;
			if(this.__matrix.b == 0) {
				this.__matrix.a = value;
			} else {
				var rotation = this.get_rotation();
				var a = this.__rotationCosine * value;
				var b = this.__rotationSine * value;
				this.__matrix.a = a;
				this.__matrix.b = b;
			}
			this.__setRenderDirty();
		}
		return value;
	}
	,get_scaleY: function() {
		if(this.__scaleY == null) {
			if(this.__matrix.c == 0) {
				this.__scaleY = this.get_matrix().d;
			} else {
				this.__scaleY = Math.sqrt(this.__matrix.c * this.__matrix.c + this.__matrix.d * this.__matrix.d);
			}
		}
		return this.__scaleY;
	}
	,set_scaleY: function(value) {
		if(value != this.__scaleY) {
			this.__scaleY = value;
			if(this.__matrix.c == 0) {
				this.__matrix.d = value;
			} else {
				var rotation = this.get_rotation();
				var c = -this.__rotationSine * value;
				var d = this.__rotationCosine * value;
				this.__matrix.c = c;
				this.__matrix.d = d;
			}
			this.__setRenderDirty();
		}
		return value;
	}
	,get_shader: function() {
		return this.__shader;
	}
	,set_shader: function(value) {
		if(value != this.__shader) {
			this.__shader = value;
			this.__setRenderDirty();
		}
		return value;
	}
	,get_tileset: function() {
		return this.__tileset;
	}
	,set_tileset: function(value) {
		if(value != this.__tileset) {
			this.__tileset = value;
			this.__setRenderDirty();
		}
		return value;
	}
	,get_visible: function() {
		return this.__visible;
	}
	,set_visible: function(value) {
		if(value != this.__visible) {
			this.__visible = value;
			this.__setRenderDirty();
		}
		return value;
	}
	,get_width: function() {
		var result = openfl_geom_Rectangle.__pool.get();
		this.__findTileRect(result);
		this.__getBounds(result,this.get_matrix());
		var w = result.width;
		openfl_geom_Rectangle.__pool.release(result);
		return w;
	}
	,set_width: function(value) {
		var result = openfl_geom_Rectangle.__pool.get();
		this.__findTileRect(result);
		if(result.width != 0) {
			this.set_scaleX(value / result.width);
		}
		openfl_geom_Rectangle.__pool.release(result);
		return value;
	}
	,get_x: function() {
		return this.__matrix.tx;
	}
	,set_x: function(value) {
		if(value != this.__matrix.tx) {
			this.__matrix.tx = value;
			this.__setRenderDirty();
		}
		return value;
	}
	,get_y: function() {
		return this.__matrix.ty;
	}
	,set_y: function(value) {
		if(value != this.__matrix.ty) {
			this.__matrix.ty = value;
			this.__setRenderDirty();
		}
		return value;
	}
	,__class__: openfl_display_Tile
	,__properties__: {set_y:"set_y",get_y:"get_y",set_x:"set_x",get_x:"get_x",set_width:"set_width",get_width:"get_width",set_visible:"set_visible",get_visible:"get_visible",set_tileset:"set_tileset",get_tileset:"get_tileset",set_shader:"set_shader",get_shader:"get_shader",set_scaleY:"set_scaleY",get_scaleY:"get_scaleY",set_scaleX:"set_scaleX",get_scaleX:"get_scaleX",set_rotation:"set_rotation",get_rotation:"get_rotation",set_rect:"set_rect",get_rect:"get_rect",set_originY:"set_originY",get_originY:"get_originY",set_originX:"set_originX",get_originX:"get_originX",set_matrix:"set_matrix",get_matrix:"get_matrix",set_id:"set_id",get_id:"get_id",set_height:"set_height",get_height:"get_height",set_colorTransform:"set_colorTransform",get_colorTransform:"get_colorTransform",set_blendMode:"set_blendMode",get_blendMode:"get_blendMode",set_alpha:"set_alpha",get_alpha:"get_alpha"}
};
var openfl_display_TileContainer = function(x,y,scaleX,scaleY,rotation,originX,originY) {
	if(originY == null) {
		originY = 0;
	}
	if(originX == null) {
		originX = 0;
	}
	if(rotation == null) {
		rotation = 0;
	}
	if(scaleY == null) {
		scaleY = 1;
	}
	if(scaleX == null) {
		scaleX = 1;
	}
	if(y == null) {
		y = 0;
	}
	if(x == null) {
		x = 0;
	}
	openfl_display_Tile.call(this,-1,x,y,scaleX,scaleY,rotation,originX,originY);
	this.__tiles = [];
	this.__length = 0;
};
$hxClasses["openfl.display.TileContainer"] = openfl_display_TileContainer;
openfl_display_TileContainer.__name__ = "openfl.display.TileContainer";
openfl_display_TileContainer.__interfaces__ = [openfl_display_ITileContainer];
openfl_display_TileContainer.__super__ = openfl_display_Tile;
openfl_display_TileContainer.prototype = $extend(openfl_display_Tile.prototype,{
	__tiles: null
	,addTile: function(tile) {
		if(tile == null) {
			return null;
		}
		if(tile.parent == this) {
			HxOverrides.remove(this.__tiles,tile);
			this.__length--;
		}
		this.__tiles[this.get_numTiles()] = tile;
		tile.parent = this;
		this.__length++;
		this.__setRenderDirty();
		return tile;
	}
	,addTileAt: function(tile,index) {
		if(tile == null) {
			return null;
		}
		if(tile.parent == this) {
			HxOverrides.remove(this.__tiles,tile);
			this.__length--;
		}
		this.__tiles.splice(index,0,tile);
		tile.parent = this;
		this.__length++;
		this.__setRenderDirty();
		return tile;
	}
	,addTiles: function(tiles) {
		var _g = 0;
		while(_g < tiles.length) {
			var tile = tiles[_g];
			++_g;
			this.addTile(tile);
		}
		return tiles;
	}
	,clone: function() {
		var group = new openfl_display_TileContainer();
		var _g = 0;
		var _g1 = this.__tiles;
		while(_g < _g1.length) {
			var tile = _g1[_g];
			++_g;
			group.addTile(tile.clone());
		}
		return group;
	}
	,contains: function(tile) {
		return this.__tiles.indexOf(tile) > -1;
	}
	,getBounds: function(targetCoordinateSpace) {
		var result = new openfl_geom_Rectangle();
		var rect = null;
		var _g = 0;
		var _g1 = this.__tiles;
		while(_g < _g1.length) {
			var tile = _g1[_g];
			++_g;
			rect = tile.getBounds(targetCoordinateSpace);
			result.__expand(rect.x,rect.y,rect.width,rect.height);
		}
		return result;
	}
	,getTileAt: function(index) {
		if(index >= 0 && index < this.get_numTiles()) {
			return this.__tiles[index];
		}
		return null;
	}
	,getTileIndex: function(tile) {
		var _g = 0;
		var _g1 = this.__tiles.length;
		while(_g < _g1) {
			var i = _g++;
			if(this.__tiles[i] == tile) {
				return i;
			}
		}
		return -1;
	}
	,removeTile: function(tile) {
		if(tile != null && tile.parent == this) {
			tile.parent = null;
			HxOverrides.remove(this.__tiles,tile);
			this.__length--;
			this.__setRenderDirty();
		}
		return tile;
	}
	,removeTileAt: function(index) {
		if(index >= 0 && index < this.get_numTiles()) {
			return this.removeTile(this.__tiles[index]);
		}
		return null;
	}
	,removeTiles: function(beginIndex,endIndex) {
		if(endIndex == null) {
			endIndex = 2147483647;
		}
		if(beginIndex == null) {
			beginIndex = 0;
		}
		if(beginIndex < 0) {
			beginIndex = 0;
		}
		if(endIndex > this.__tiles.length - 1) {
			endIndex = this.__tiles.length - 1;
		}
		var removed = this.__tiles.splice(beginIndex,endIndex - beginIndex + 1);
		var _g = 0;
		while(_g < removed.length) {
			var tile = removed[_g];
			++_g;
			tile.parent = null;
		}
		this.__length = this.__tiles.length;
		this.__setRenderDirty();
	}
	,setTileIndex: function(tile,index) {
		if(index >= 0 && index <= this.get_numTiles() && tile.parent == this) {
			HxOverrides.remove(this.__tiles,tile);
			this.__tiles.splice(index,0,tile);
			this.__setRenderDirty();
		}
	}
	,sortTiles: function(compareFunction) {
		this.__tiles.sort(compareFunction);
		this.__setRenderDirty();
	}
	,swapTiles: function(tile1,tile2) {
		if(tile1.parent == this && tile2.parent == this) {
			var index1 = this.__tiles.indexOf(tile1);
			var index2 = this.__tiles.indexOf(tile2);
			this.__tiles[index1] = tile2;
			this.__tiles[index2] = tile1;
			this.__setRenderDirty();
		}
	}
	,swapTilesAt: function(index1,index2) {
		var swap = this.__tiles[index1];
		this.__tiles[index1] = this.__tiles[index2];
		this.__tiles[index2] = swap;
		swap = null;
		this.__setRenderDirty();
	}
	,get_numTiles: function() {
		return this.__length;
	}
	,get_height: function() {
		var result = openfl_geom_Rectangle.__pool.get();
		var rect = null;
		var _g = 0;
		var _g1 = this.__tiles;
		while(_g < _g1.length) {
			var tile = _g1[_g];
			++_g;
			rect = tile.getBounds(this);
			result.__expand(rect.x,rect.y,rect.width,rect.height);
		}
		this.__getBounds(result,this.get_matrix());
		var h = result.height;
		openfl_geom_Rectangle.__pool.release(result);
		return h;
	}
	,set_height: function(value) {
		var result = openfl_geom_Rectangle.__pool.get();
		var rect = null;
		var _g = 0;
		var _g1 = this.__tiles;
		while(_g < _g1.length) {
			var tile = _g1[_g];
			++_g;
			rect = tile.getBounds(this);
			result.__expand(rect.x,rect.y,rect.width,rect.height);
		}
		if(result.height != 0) {
			this.set_scaleY(value / result.height);
		}
		openfl_geom_Rectangle.__pool.release(result);
		return value;
	}
	,get_width: function() {
		var result = openfl_geom_Rectangle.__pool.get();
		var rect = null;
		var _g = 0;
		var _g1 = this.__tiles;
		while(_g < _g1.length) {
			var tile = _g1[_g];
			++_g;
			rect = tile.getBounds(this);
			result.__expand(rect.x,rect.y,rect.width,rect.height);
		}
		this.__getBounds(result,this.get_matrix());
		var w = result.width;
		openfl_geom_Rectangle.__pool.release(result);
		return w;
	}
	,set_width: function(value) {
		var result = openfl_geom_Rectangle.__pool.get();
		var rect = null;
		var _g = 0;
		var _g1 = this.__tiles;
		while(_g < _g1.length) {
			var tile = _g1[_g];
			++_g;
			rect = tile.getBounds(this);
			result.__expand(rect.x,rect.y,rect.width,rect.height);
		}
		if(result.width != 0) {
			this.set_scaleX(value / result.width);
		}
		openfl_geom_Rectangle.__pool.release(result);
		return value;
	}
	,__class__: openfl_display_TileContainer
	,__properties__: $extend(openfl_display_Tile.prototype.__properties__,{get_numTiles:"get_numTiles"})
});
var openfl_display_Tilemap = function(width,height,tileset,smoothing) {
	if(smoothing == null) {
		smoothing = true;
	}
	openfl_display_DisplayObject.call(this);
	this.__drawableType = 9;
	this.__tileset = tileset;
	this.smoothing = smoothing;
	this.tileAlphaEnabled = true;
	this.tileBlendModeEnabled = true;
	this.tileColorTransformEnabled = true;
	this.__group = new openfl_display_TileContainer();
	this.__group.set_tileset(tileset);
	this.__width = width;
	this.__height = height;
};
$hxClasses["openfl.display.Tilemap"] = openfl_display_Tilemap;
openfl_display_Tilemap.__name__ = "openfl.display.Tilemap";
openfl_display_Tilemap.__interfaces__ = [openfl_display_ITileContainer];
openfl_display_Tilemap.__super__ = openfl_display_DisplayObject;
openfl_display_Tilemap.prototype = $extend(openfl_display_DisplayObject.prototype,{
	tileAlphaEnabled: null
	,tileBlendModeEnabled: null
	,tileColorTransformEnabled: null
	,smoothing: null
	,__group: null
	,__tileset: null
	,__buffer: null
	,__bufferDirty: null
	,__height: null
	,__width: null
	,addTile: function(tile) {
		return this.__group.addTile(tile);
	}
	,addTileAt: function(tile,index) {
		return this.__group.addTileAt(tile,index);
	}
	,addTiles: function(tiles) {
		return this.__group.addTiles(tiles);
	}
	,contains: function(tile) {
		return this.__group.contains(tile);
	}
	,getTileAt: function(index) {
		return this.__group.getTileAt(index);
	}
	,getTileIndex: function(tile) {
		return this.__group.getTileIndex(tile);
	}
	,getTiles: function() {
		return this.__group.clone();
	}
	,removeTile: function(tile) {
		return this.__group.removeTile(tile);
	}
	,removeTileAt: function(index) {
		return this.__group.removeTileAt(index);
	}
	,removeTiles: function(beginIndex,endIndex) {
		if(endIndex == null) {
			endIndex = 2147483647;
		}
		if(beginIndex == null) {
			beginIndex = 0;
		}
		this.__group.removeTiles(beginIndex,endIndex);
	}
	,setTileIndex: function(tile,index) {
		this.__group.setTileIndex(tile,index);
	}
	,setTiles: function(group) {
		var _g = 0;
		var _g1 = this.__group.__tiles;
		while(_g < _g1.length) {
			var tile = _g1[_g];
			++_g;
			this.removeTile(tile);
		}
		var _g = 0;
		var _g1 = group.__tiles;
		while(_g < _g1.length) {
			var tile = _g1[_g];
			++_g;
			this.addTile(tile);
		}
	}
	,sortTiles: function(compareFunction) {
		this.__group.sortTiles(compareFunction);
	}
	,swapTiles: function(tile1,tile2) {
		this.__group.swapTiles(tile1,tile2);
	}
	,swapTilesAt: function(index1,index2) {
		this.__group.swapTilesAt(index1,index2);
	}
	,__enterFrame: function(deltaTime) {
		if(this.__group.__dirty) {
			if(!this.__renderDirty) {
				this.__renderDirty = true;
				this.__setParentRenderDirty();
			}
		}
	}
	,__getBounds: function(rect,matrix) {
		var bounds = openfl_geom_Rectangle.__pool.get();
		bounds.setTo(0,0,this.__width,this.__height);
		bounds.__transform(bounds,matrix);
		rect.__expand(bounds.x,bounds.y,bounds.width,bounds.height);
		openfl_geom_Rectangle.__pool.release(bounds);
	}
	,__hitTest: function(x,y,shapeFlag,stack,interactiveOnly,hitObject) {
		if(!hitObject.get_visible() || this.__isMask) {
			return false;
		}
		if(this.get_mask() != null && !this.get_mask().__hitTestMask(x,y)) {
			return false;
		}
		this.__getRenderTransform();
		var _this = this.__renderTransform;
		var norm = _this.a * _this.d - _this.b * _this.c;
		var px = norm == 0 ? -_this.tx : 1.0 / norm * (_this.c * (_this.ty - y) + _this.d * (x - _this.tx));
		var _this = this.__renderTransform;
		var norm = _this.a * _this.d - _this.b * _this.c;
		var py = norm == 0 ? -_this.ty : 1.0 / norm * (_this.a * (y - _this.ty) + _this.b * (_this.tx - x));
		if(px > 0 && py > 0 && px <= this.__width && py <= this.__height) {
			if(stack != null && !interactiveOnly) {
				stack.push(hitObject);
			}
			return true;
		}
		return false;
	}
	,__renderFlash: function() {
	}
	,get_height: function() {
		return this.__height * Math.abs(this.get_scaleY());
	}
	,set_height: function(value) {
		this.__height = value | 0;
		return this.__height * Math.abs(this.get_scaleY());
	}
	,get_numTiles: function() {
		return this.__group.__length;
	}
	,get_tileset: function() {
		return this.__tileset;
	}
	,set_tileset: function(value) {
		if(value != this.__tileset) {
			this.__tileset = value;
			this.__group.set_tileset(value);
			this.__group.__dirty = true;
			if(!this.__renderDirty) {
				this.__renderDirty = true;
				this.__setParentRenderDirty();
			}
		}
		return value;
	}
	,get_width: function() {
		return this.__width * Math.abs(this.__scaleX);
	}
	,set_width: function(value) {
		this.__width = value | 0;
		return this.__width * Math.abs(this.__scaleX);
	}
	,__class__: openfl_display_Tilemap
	,__properties__: $extend(openfl_display_DisplayObject.prototype.__properties__,{set_tileset:"set_tileset",get_tileset:"get_tileset",get_numTiles:"get_numTiles"})
});
var openfl_display_Tileset = function(bitmapData,rects) {
	this.__bitmapData = bitmapData;
	this.rectData = openfl_Vector.toFloatVector(null);
	this.__data = [];
	if(rects != null) {
		var _g = 0;
		while(_g < rects.length) {
			var rect = rects[_g];
			++_g;
			this.addRect(rect);
		}
	}
};
$hxClasses["openfl.display.Tileset"] = openfl_display_Tileset;
openfl_display_Tileset.__name__ = "openfl.display.Tileset";
openfl_display_Tileset.prototype = {
	rectData: null
	,__bitmapData: null
	,__data: null
	,addRect: function(rect) {
		if(rect == null) {
			return -1;
		}
		this.rectData.push(rect.x);
		this.rectData.push(rect.y);
		this.rectData.push(rect.width);
		this.rectData.push(rect.height);
		var tileData = new openfl_display_TileData(rect);
		tileData.__update(this.__bitmapData);
		this.__data.push(tileData);
		return this.__data.length - 1;
	}
	,clone: function() {
		var tileset = new openfl_display_Tileset(this.__bitmapData,null);
		var rect = openfl_geom_Rectangle.__pool.get();
		var _g = 0;
		var _g1 = this.__data;
		while(_g < _g1.length) {
			var tileData = _g1[_g];
			++_g;
			rect.setTo(tileData.x,tileData.y,tileData.width,tileData.height);
			tileset.addRect(rect);
		}
		openfl_geom_Rectangle.__pool.release(rect);
		return tileset;
	}
	,hasRect: function(rect) {
		var _g = 0;
		var _g1 = this.__data;
		while(_g < _g1.length) {
			var tileData = _g1[_g];
			++_g;
			if(rect.x == tileData.x && rect.y == tileData.y && rect.width == tileData.width && rect.height == tileData.height) {
				return true;
			}
		}
		return false;
	}
	,getRect: function(id) {
		if(id < this.__data.length && id >= 0) {
			return new openfl_geom_Rectangle(this.__data[id].x,this.__data[id].y,this.__data[id].width,this.__data[id].height);
		}
		return null;
	}
	,getRectID: function(rect) {
		var tileData;
		var _g = 0;
		var _g1 = this.__data.length;
		while(_g < _g1) {
			var i = _g++;
			tileData = this.__data[i];
			if(rect.x == tileData.x && rect.y == tileData.y && rect.width == tileData.width && rect.height == tileData.height) {
				return i;
			}
		}
		return null;
	}
	,get_bitmapData: function() {
		return this.__bitmapData;
	}
	,set_bitmapData: function(value) {
		this.__bitmapData = value;
		var _g = 0;
		var _g1 = this.__data;
		while(_g < _g1.length) {
			var data = _g1[_g];
			++_g;
			data.__update(this.__bitmapData);
		}
		return value;
	}
	,get_numRects: function() {
		return this.__data.length;
	}
	,__class__: openfl_display_Tileset
	,__properties__: {get_numRects:"get_numRects",set_bitmapData:"set_bitmapData",get_bitmapData:"get_bitmapData"}
};
var openfl_display_TileData = function(rect) {
	if(rect != null) {
		this.x = rect.x | 0;
		this.y = rect.y | 0;
		this.width = rect.width | 0;
		this.height = rect.height | 0;
	}
};
$hxClasses["openfl.display.TileData"] = openfl_display_TileData;
openfl_display_TileData.__name__ = "openfl.display.TileData";
openfl_display_TileData.prototype = {
	height: null
	,width: null
	,x: null
	,y: null
	,__bitmapData: null
	,__uvHeight: null
	,__uvWidth: null
	,__uvX: null
	,__uvY: null
	,__update: function(bitmapData) {
		if(bitmapData != null) {
			var bitmapWidth = bitmapData.width;
			var bitmapHeight = bitmapData.height;
			this.__uvX = this.x / bitmapWidth;
			this.__uvY = this.y / bitmapHeight;
			this.__uvWidth = (this.x + this.width) / bitmapWidth;
			this.__uvHeight = (this.y + this.height) / bitmapHeight;
		}
	}
	,__class__: openfl_display_TileData
};
var openfl_display_Timeline = function() {
	this.__framesLoaded = 1;
	this.__totalFrames = 1;
	this.__currentLabels = [];
	this.__currentFrame = 1;
	this.__lastFrameScriptEval = -1;
	this.__lastFrameUpdate = -1;
};
$hxClasses["openfl.display.Timeline"] = openfl_display_Timeline;
openfl_display_Timeline.__name__ = "openfl.display.Timeline";
openfl_display_Timeline.prototype = {
	frameRate: null
	,scenes: null
	,scripts: null
	,__currentFrame: null
	,__currentFrameLabel: null
	,__currentLabel: null
	,__currentLabels: null
	,__currentScene: null
	,__frameScripts: null
	,__framesLoaded: null
	,__frameTime: null
	,__isPlaying: null
	,__lastFrameScriptEval: null
	,__lastFrameUpdate: null
	,__scope: null
	,__timeElapsed: null
	,__totalFrames: null
	,attachMovieClip: function(movieClip) {
	}
	,enterFrame: function(frame) {
	}
	,initializeSprite: function(sprite) {
	}
	,__addFrameScript: function(index,method) {
		if(index < 0) {
			return;
		}
		var frame = index + 1;
		if(method != null) {
			if(this.__frameScripts == null) {
				this.__frameScripts = new haxe_ds_IntMap();
			}
			this.__frameScripts.h[frame] = function(scope) {
				method();
			};
		} else if(this.__frameScripts != null) {
			this.__frameScripts.remove(frame);
		}
	}
	,__attachMovieClip: function(movieClip) {
		this.__scope = movieClip;
		this.__totalFrames = 0;
		this.__framesLoaded = 0;
		if(this.scenes != null && this.scenes.length > 0) {
			var _g = 0;
			var _g1 = this.scenes;
			while(_g < _g1.length) {
				var scene = _g1[_g];
				++_g;
				this.__totalFrames += scene.numFrames;
				this.__framesLoaded += scene.numFrames;
				if(scene.labels != null) {
					this.__currentLabels = this.__currentLabels.concat(scene.labels);
				}
			}
			this.__currentScene = this.scenes[0];
		}
		if(this.scripts != null && this.scripts.length > 0) {
			this.__frameScripts = new haxe_ds_IntMap();
			var _g = 0;
			var _g1 = this.scripts;
			while(_g < _g1.length) {
				var script = _g1[_g];
				++_g;
				if(this.__frameScripts.h.hasOwnProperty(script.frame)) {
					var existing = [this.__frameScripts.h[script.frame]];
					var append = [script.script];
					this.__frameScripts.h[script.frame] = (function(append,existing) {
						return function(clip) {
							existing[0](clip);
							append[0](clip);
						};
					})(append,existing);
				} else {
					this.__frameScripts.h[script.frame] = script.script;
				}
			}
		}
		this.attachMovieClip(movieClip);
	}
	,__enterFrame: function(deltaTime) {
		if(this.__isPlaying) {
			var nextFrame = this.__getNextFrame(deltaTime);
			if(this.__lastFrameScriptEval == nextFrame) {
				return;
			}
			if(this.__frameScripts != null) {
				if(nextFrame < this.__currentFrame) {
					if(!this.__evaluateFrameScripts(this.__totalFrames)) {
						return;
					}
					this.__currentFrame = 1;
				}
				if(!this.__evaluateFrameScripts(nextFrame)) {
					return;
				}
			} else {
				this.__currentFrame = nextFrame;
			}
		}
		this.__updateSymbol(this.__currentFrame);
	}
	,__evaluateFrameScripts: function(advanceToFrame) {
		if(this.__frameScripts == null) {
			return true;
		}
		var _g = this.__currentFrame;
		var _g1 = advanceToFrame + 1;
		while(_g < _g1) {
			var frame = _g++;
			if(frame == this.__lastFrameScriptEval) {
				continue;
			}
			this.__lastFrameScriptEval = frame;
			this.__currentFrame = frame;
			if(this.__frameScripts.h.hasOwnProperty(frame)) {
				this.__updateSymbol(frame);
				var script = this.__frameScripts.h[frame];
				script(this.__scope);
				if(this.__currentFrame != frame) {
					return false;
				}
			}
			if(!this.__isPlaying) {
				return false;
			}
		}
		return true;
	}
	,__getNextFrame: function(deltaTime) {
		var nextFrame = 0;
		if(this.frameRate != null) {
			this.__timeElapsed += deltaTime;
			nextFrame = this.__currentFrame + Math.floor(this.__timeElapsed / this.__frameTime);
			if(nextFrame < 1) {
				nextFrame = 1;
			}
			if(nextFrame > this.__totalFrames) {
				nextFrame = Math.floor((nextFrame - 1) % this.__totalFrames) + 1;
			}
			this.__timeElapsed %= this.__frameTime;
		} else {
			nextFrame = this.__currentFrame + 1;
			if(nextFrame > this.__totalFrames) {
				nextFrame = 1;
			}
		}
		return nextFrame;
	}
	,__goto: function(frame) {
		if(frame < 1) {
			frame = 1;
		} else if(frame > this.__totalFrames) {
			frame = this.__totalFrames;
		}
		this.__lastFrameScriptEval = -1;
		this.__currentFrame = frame;
		this.__updateSymbol(this.__currentFrame);
		this.__evaluateFrameScripts(this.__currentFrame);
	}
	,__gotoAndPlay: function(frame,scene) {
		this.__play();
		this.__goto(this.__resolveFrameReference(frame));
	}
	,__gotoAndStop: function(frame,scene) {
		this.__stop();
		this.__goto(this.__resolveFrameReference(frame));
	}
	,__nextFrame: function() {
		this.__stop();
		this.__goto(this.__currentFrame + 1);
	}
	,__nextScene: function() {
	}
	,__play: function() {
		if(this.__isPlaying || this.__totalFrames < 2) {
			return;
		}
		this.__isPlaying = true;
		if(this.frameRate != null) {
			this.__frameTime = 1000 / this.frameRate | 0;
			this.__timeElapsed = 0;
		}
	}
	,__prevFrame: function() {
		this.__stop();
		this.__goto(this.__currentFrame - 1);
	}
	,__prevScene: function() {
	}
	,__stop: function() {
		this.__isPlaying = false;
	}
	,__resolveFrameReference: function(frame) {
		if(typeof(frame) == "number" && ((frame | 0) === frame)) {
			return frame;
		} else if(typeof(frame) == "string") {
			var label = frame;
			var _g = 0;
			var _g1 = this.__currentLabels;
			while(_g < _g1.length) {
				var frameLabel = _g1[_g];
				++_g;
				if(frameLabel.name == label) {
					return frameLabel.frame;
				}
			}
			throw new openfl_errors_ArgumentError("Error #2109: Frame label " + label + " not found in scene.");
		} else {
			throw haxe_Exception.thrown("Invalid type for frame " + frame.__name__);
		}
	}
	,__updateFrameLabel: function() {
		this.__currentLabel = null;
		this.__currentFrameLabel = null;
		var _g = 0;
		var _g1 = this.__currentLabels;
		while(_g < _g1.length) {
			var label = _g1[_g];
			++_g;
			if(label.frame < this.__currentFrame) {
				this.__currentLabel = label.name;
			} else if(label.frame == this.__currentFrame) {
				this.__currentLabel = label.name;
				this.__currentFrameLabel = label.name;
			} else {
				break;
			}
		}
	}
	,__updateSymbol: function(targetFrame) {
		if(this.__currentFrame != this.__lastFrameUpdate) {
			this.__updateFrameLabel();
			this.enterFrame(targetFrame);
			this.__lastFrameUpdate = this.__currentFrame;
		}
	}
	,__class__: openfl_display_Timeline
};
var openfl_display_TriangleCulling = {};
openfl_display_TriangleCulling.fromString = function(value) {
	switch(value) {
	case "negative":
		return 0;
	case "none":
		return 1;
	case "positive":
		return 2;
	default:
		return null;
	}
};
openfl_display_TriangleCulling.toString = function(this1) {
	switch(this1) {
	case 0:
		return "negative";
	case 1:
		return "none";
	case 2:
		return "positive";
	default:
		return null;
	}
};
var openfl_display_Window = function(application,attributes) {
	lime_ui_Window.call(this,application,attributes);
	this.stage = new openfl_display_Stage(this,Object.prototype.hasOwnProperty.call(attributes.context,"background") ? attributes.context.background : 16777215);
	if(Object.prototype.hasOwnProperty.call(attributes,"parameters")) {
		try {
			this.stage.get_loaderInfo().parameters = attributes.parameters;
		} catch( _g ) {
			haxe_NativeStackTrace.lastError = _g;
		}
	}
	this.stage.__setLogicalSize(attributes.width,attributes.height);
	if(Object.prototype.hasOwnProperty.call(attributes,"resizable") && !attributes.resizable) {
		this.stage.set_scaleMode(3);
	}
	application.addModule(this.stage);
};
$hxClasses["openfl.display.Window"] = openfl_display_Window;
openfl_display_Window.__name__ = "openfl.display.Window";
openfl_display_Window.__super__ = lime_ui_Window;
openfl_display_Window.prototype = $extend(lime_ui_Window.prototype,{
	close: function() {
		lime_ui_Window.prototype.close.call(this);
		if(this.onClose.canceled) {
			return;
		}
		if(this.stage == null) {
			return;
		}
		this.application.removeModule(this.stage);
		this.stage = null;
	}
	,__class__: openfl_display_Window
});
var openfl_display__$internal_AbstractNoise = function(seed,octaves,channels,grayScale,falloff,stitch,stitch_threshold) {
	if(stitch_threshold == null) {
		stitch_threshold = 0.05;
	}
	if(stitch == null) {
		stitch = false;
	}
	this.stitch = stitch;
	this.stitch_threshold = stitch_threshold;
	this.octaves = octaves;
	this.channels = channels;
	this.grayscale = grayScale;
	this.calculateOctaves(falloff);
};
$hxClasses["openfl.display._internal.AbstractNoise"] = openfl_display__$internal_AbstractNoise;
openfl_display__$internal_AbstractNoise.__name__ = "openfl.display._internal.AbstractNoise";
openfl_display__$internal_AbstractNoise.prototype = {
	octaves: null
	,stitch: null
	,stitch_threshold: null
	,channels: null
	,grayscale: null
	,octaves_frequencies: null
	,octaves_persistences: null
	,persistence_max: null
	,fill: function(bitmap,_scale_x,_scale_y,_scale_z) {
	}
	,stitching: function(bitmap,color,px,py,stitch_w,stitch_h,width,height) {
		var r = color >> 16 & 255;
		var g = color >> 8 & 255;
		var b = color & 255;
		if(width - stitch_w < px) {
			var dest = bitmap.getPixel32(width - px,py);
			var dest_r = dest >> 16 & 255;
			var dest_g = dest >> 8 & 255;
			var dest_b = dest & 255;
			var u = (width - px) / stitch_w;
			var uu = u * u;
			r = this.mixI(dest_r,r,u);
			g = this.mixI(dest_g,g,u);
			b = this.mixI(dest_b,b,u);
		}
		if(height - stitch_h < py) {
			var dest = bitmap.getPixel32(px,height - py);
			var dest_r = dest >> 16 & 255;
			var dest_g = dest >> 8 & 255;
			var dest_b = dest & 255;
			var u = (height - py) / stitch_h;
			var uu = u * u;
			r = this.mixI(dest_r,r,u);
			g = this.mixI(dest_g,g,u);
			b = this.mixI(dest_b,b,u);
		}
		return -16777216 | r << 16 | g << 8 | b;
	}
	,color: function(r_noise,g_noise,b_noise) {
		var color_r = 0;
		var color_g = 0;
		var color_b = 0;
		if(null != r_noise) {
			color_r = this.noiseToColor(r_noise);
		}
		if(null != g_noise) {
			color_g = this.noiseToColor(g_noise);
		}
		if(null != b_noise) {
			color_b = this.noiseToColor(b_noise);
		}
		return -16777216 | color_r << 16 | color_g << 8 | color_b;
	}
	,noiseToColor: function(noise) {
		return (noise * this.persistence_max + 1.0) * 128 | 0;
	}
	,fade: function(t) {
		return t * t * t * (t * (t * 6.0 - 15.0) + 10.0);
	}
	,mixI: function(x,y,t) {
		return (1.0 - t) * x + t * y | 0;
	}
	,mix: function(x,y,t) {
		return (1.0 - t) * x + t * y;
	}
	,fastfloor: function(x) {
		if(x > 0) {
			return x | 0;
		} else {
			return x - 1 | 0;
		}
	}
	,dot2d: function(grad,x,y) {
		return grad[0] * x + grad[1] * y;
	}
	,dot: function(grad,x,y,z) {
		return grad[0] * x + grad[1] * y + grad[2] * z;
	}
	,calculateOctaves: function(fPersistence) {
		var fFreq;
		var fPers;
		this.octaves_frequencies = [];
		this.octaves_persistences = [];
		this.persistence_max = 0;
		var _g = 0;
		var _g1 = this.octaves;
		while(_g < _g1) {
			var i = _g++;
			fFreq = Math.pow(2.0,i);
			fPers = Math.pow(fPersistence,i);
			this.persistence_max += fPers;
			this.octaves_frequencies.push(fFreq);
			this.octaves_persistences.push(fPers);
		}
		this.persistence_max = 1.0 / this.persistence_max;
	}
	,__class__: openfl_display__$internal_AbstractNoise
};
var openfl_display__$internal_CairoBitmap = function() { };
$hxClasses["openfl.display._internal.CairoBitmap"] = openfl_display__$internal_CairoBitmap;
openfl_display__$internal_CairoBitmap.__name__ = "openfl.display._internal.CairoBitmap";
openfl_display__$internal_CairoBitmap.render = function(bitmap,renderer) {
	if(!bitmap.__renderable) {
		return;
	}
	var alpha = renderer.__getAlpha(bitmap.__worldAlpha);
	if(alpha > 0 && bitmap.__bitmapData != null && bitmap.__bitmapData.__isValid) {
		var cairo = renderer.cairo;
		renderer.__setBlendMode(bitmap.__worldBlendMode);
		renderer.__pushMaskObject(bitmap);
		renderer.applyMatrix(bitmap.__renderTransform,cairo);
		var surface = bitmap.__bitmapData.getSurface();
		if(surface != null) {
			var pattern = lime_graphics_cairo_CairoPattern.createForSurface(surface);
			lime_graphics_cairo_CairoPattern.set_filter(pattern,renderer.__allowSmoothing && bitmap.smoothing ? 1 : 3);
			cairo.set_source(pattern);
			if(alpha == 1) {
				cairo.paint();
			} else {
				cairo.paintWithAlpha(alpha);
			}
		}
		renderer.__popMaskObject(bitmap);
		renderer.__setBlendMode(10);
	}
};
openfl_display__$internal_CairoBitmap.renderDrawable = function(bitmap,renderer) {
};
openfl_display__$internal_CairoBitmap.renderDrawableMask = function(bitmap,renderer) {
	renderer.cairo.rectangle(0,0,bitmap.get_width(),bitmap.get_height());
};
var openfl_display__$internal_CairoBitmapData = function() { };
$hxClasses["openfl.display._internal.CairoBitmapData"] = openfl_display__$internal_CairoBitmapData;
openfl_display__$internal_CairoBitmapData.__name__ = "openfl.display._internal.CairoBitmapData";
openfl_display__$internal_CairoBitmapData.renderDrawable = function(bitmapData,renderer) {
};
openfl_display__$internal_CairoBitmapData.renderDrawableMask = function(tilemap,renderer) {
};
var openfl_display__$internal_CairoDisplayObject = function() { };
$hxClasses["openfl.display._internal.CairoDisplayObject"] = openfl_display__$internal_CairoDisplayObject;
openfl_display__$internal_CairoDisplayObject.__name__ = "openfl.display._internal.CairoDisplayObject";
openfl_display__$internal_CairoDisplayObject.render = function(displayObject,renderer) {
};
openfl_display__$internal_CairoDisplayObject.renderDrawable = function(displayObject,renderer) {
};
openfl_display__$internal_CairoDisplayObject.renderDrawableMask = function(displayObject,renderer) {
};
var openfl_display__$internal_CairoDisplayObjectContainer = function() { };
$hxClasses["openfl.display._internal.CairoDisplayObjectContainer"] = openfl_display__$internal_CairoDisplayObjectContainer;
openfl_display__$internal_CairoDisplayObjectContainer.__name__ = "openfl.display._internal.CairoDisplayObjectContainer";
openfl_display__$internal_CairoDisplayObjectContainer.renderDrawable = function(displayObjectContainer,renderer) {
};
openfl_display__$internal_CairoDisplayObjectContainer.renderDrawableMask = function(displayObjectContainer,renderer) {
};
var openfl_display__$internal_CairoGraphics = function() { };
$hxClasses["openfl.display._internal.CairoGraphics"] = openfl_display__$internal_CairoGraphics;
openfl_display__$internal_CairoGraphics.__name__ = "openfl.display._internal.CairoGraphics";
openfl_display__$internal_CairoGraphics.hitTest = function(graphics,x,y) {
	return false;
};
openfl_display__$internal_CairoGraphics.render = function(graphics,renderer) {
};
openfl_display__$internal_CairoGraphics.renderMask = function(graphics,renderer) {
};
var openfl_display__$internal__$CairoGraphics_Scale9GridBounds = function() {
	this.unscaledMaxY = null;
	this.unscaledMaxX = null;
	this.unscaledMinY = null;
	this.unscaledMinX = null;
	this.scale9MaxY = null;
	this.scale9MaxX = null;
	this.scale9MinY = null;
	this.scale9MinX = null;
};
$hxClasses["openfl.display._internal._CairoGraphics.Scale9GridBounds"] = openfl_display__$internal__$CairoGraphics_Scale9GridBounds;
openfl_display__$internal__$CairoGraphics_Scale9GridBounds.__name__ = "openfl.display._internal._CairoGraphics.Scale9GridBounds";
openfl_display__$internal__$CairoGraphics_Scale9GridBounds.prototype = {
	scale9MinX: null
	,scale9MinY: null
	,scale9MaxX: null
	,scale9MaxY: null
	,unscaledMinX: null
	,unscaledMinY: null
	,unscaledMaxX: null
	,unscaledMaxY: null
	,getScaleX: function() {
		if(this.scale9MaxX == null || this.unscaledMaxX == null) {
			return 1.0;
		}
		var unscaledWidth = this.unscaledMaxX - this.unscaledMinX;
		if(unscaledWidth == 0.0) {
			return 1.0;
		}
		return (this.scale9MaxX - this.scale9MinX) / unscaledWidth;
	}
	,getScaleY: function() {
		if(this.scale9MaxY == null || this.unscaledMaxY == null) {
			return 1.0;
		}
		var unscaledHeight = this.unscaledMaxY - this.unscaledMinY;
		if(unscaledHeight == 0.0) {
			return 1.0;
		}
		return (this.scale9MaxY - this.scale9MinY) / unscaledHeight;
	}
	,clear: function() {
		this.unscaledMinX = null;
		this.unscaledMaxX = null;
		this.unscaledMinY = null;
		this.unscaledMaxY = null;
		this.scale9MinX = null;
		this.scale9MaxX = null;
		this.scale9MinY = null;
		this.scale9MaxY = null;
	}
	,applyUnscaledX: function(value) {
		if(this.unscaledMinX == null || this.unscaledMinX > value) {
			this.unscaledMinX = value;
		}
		if(this.unscaledMaxX == null || this.unscaledMaxX < value) {
			this.unscaledMaxX = value;
		}
	}
	,applyUnscaledY: function(value) {
		if(this.unscaledMinY == null || this.unscaledMinY > value) {
			this.unscaledMinY = value;
		}
		if(this.unscaledMaxY == null || this.unscaledMaxY < value) {
			this.unscaledMaxY = value;
		}
	}
	,applyScaledX: function(value) {
		if(this.scale9MinX == null || this.scale9MinX > value) {
			this.scale9MinX = value;
		}
		if(this.scale9MaxX == null || this.scale9MaxX < value) {
			this.scale9MaxX = value;
		}
	}
	,applyScaledY: function(value) {
		if(this.scale9MinY == null || this.scale9MinY > value) {
			this.scale9MinY = value;
		}
		if(this.scale9MaxY == null || this.scale9MaxY < value) {
			this.scale9MaxY = value;
		}
	}
	,__class__: openfl_display__$internal__$CairoGraphics_Scale9GridBounds
};
var openfl_display__$internal_CairoShape = function() { };
$hxClasses["openfl.display._internal.CairoShape"] = openfl_display__$internal_CairoShape;
openfl_display__$internal_CairoShape.__name__ = "openfl.display._internal.CairoShape";
openfl_display__$internal_CairoShape.render = function(shape,renderer) {
};
openfl_display__$internal_CairoShape.renderDrawable = function(shape,renderer) {
};
openfl_display__$internal_CairoShape.renderDrawableMask = function(shape,renderer) {
};
var openfl_display__$internal_CairoSimpleButton = function() { };
$hxClasses["openfl.display._internal.CairoSimpleButton"] = openfl_display__$internal_CairoSimpleButton;
openfl_display__$internal_CairoSimpleButton.__name__ = "openfl.display._internal.CairoSimpleButton";
openfl_display__$internal_CairoSimpleButton.renderDrawable = function(simpleButton,renderer) {
	if(!simpleButton.__renderable || simpleButton.__worldAlpha <= 0 || simpleButton.__currentState == null) {
		return;
	}
	renderer.__pushMaskObject(simpleButton);
	renderer.__renderDrawable(simpleButton.__currentState);
	renderer.__popMaskObject(simpleButton);
	renderer.__renderEvent(simpleButton);
};
openfl_display__$internal_CairoSimpleButton.renderDrawableMask = function(simpleButton,renderer) {
	renderer.__renderDrawableMask(simpleButton.__currentState);
};
var openfl_display__$internal_CairoTextField = function() { };
$hxClasses["openfl.display._internal.CairoTextField"] = openfl_display__$internal_CairoTextField;
openfl_display__$internal_CairoTextField.__name__ = "openfl.display._internal.CairoTextField";
openfl_display__$internal_CairoTextField.render = function(textField,renderer,transform) {
};
openfl_display__$internal_CairoTextField.renderDrawable = function(textField,renderer) {
};
openfl_display__$internal_CairoTextField.renderDrawableMask = function(textField,renderer) {
};
var openfl_display__$internal_CairoTilemap = function() { };
$hxClasses["openfl.display._internal.CairoTilemap"] = openfl_display__$internal_CairoTilemap;
openfl_display__$internal_CairoTilemap.__name__ = "openfl.display._internal.CairoTilemap";
openfl_display__$internal_CairoTilemap.render = function(tilemap,renderer) {
	if(!tilemap.__renderable || tilemap.__group.__tiles.length == 0) {
		return;
	}
	var alpha = renderer.__getAlpha(tilemap.__worldAlpha);
	if(alpha <= 0) {
		return;
	}
	renderer.__setBlendMode(tilemap.__worldBlendMode);
	renderer.__pushMaskObject(tilemap);
	var rect = openfl_geom_Rectangle.__pool.get();
	rect.setTo(0,0,tilemap.__width,tilemap.__height);
	renderer.__pushMaskRect(rect,tilemap.__renderTransform);
	openfl_display__$internal_CairoTilemap.renderTileContainer(tilemap.__group,renderer,tilemap.__renderTransform,tilemap.__tileset,renderer.__allowSmoothing && tilemap.smoothing,tilemap.tileAlphaEnabled,alpha,tilemap.tileBlendModeEnabled,tilemap.__worldBlendMode,null,null,null,rect,lime_math_Matrix3._new());
	renderer.__popMaskRect();
	renderer.__popMaskObject(tilemap);
	openfl_geom_Rectangle.__pool.release(rect);
};
openfl_display__$internal_CairoTilemap.renderTileContainer = function(group,renderer,parentTransform,defaultTileset,smooth,alphaEnabled,worldAlpha,blendModeEnabled,defaultBlendMode,cacheBitmapData,surface,pattern,rect,matrix) {
	var cairo = renderer.cairo;
	var tileTransform = openfl_geom_Matrix.__pool.get();
	var tiles = group.__tiles;
	var tileset;
	var alpha;
	var visible;
	var blendMode = null;
	var id;
	var tileData;
	var tileRect;
	var bitmapData;
	var _g = 0;
	while(_g < tiles.length) {
		var tile = tiles[_g];
		++_g;
		tileTransform.setTo(1,0,0,1,-tile.get_originX(),-tile.get_originY());
		tileTransform.concat(tile.get_matrix());
		tileTransform.concat(parentTransform);
		tileset = tile.get_tileset() != null ? tile.get_tileset() : defaultTileset;
		alpha = tile.get_alpha() * worldAlpha;
		visible = tile.get_visible();
		if(!visible || alpha <= 0) {
			continue;
		}
		if(!alphaEnabled) {
			alpha = 1;
		}
		if(blendModeEnabled) {
			blendMode = tile.__blendMode != null ? tile.__blendMode : defaultBlendMode;
		}
		if(tile.__length > 0) {
			openfl_display__$internal_CairoTilemap.renderTileContainer(tile,renderer,tileTransform,tileset,smooth,alphaEnabled,alpha,blendModeEnabled,blendMode,cacheBitmapData,surface,pattern,rect,matrix);
		} else {
			if(tileset == null) {
				continue;
			}
			id = tile.get_id();
			if(id == -1) {
				tileRect = tile.__rect;
				if(tileRect == null || tileRect.width <= 0 || tileRect.height <= 0) {
					continue;
				}
			} else {
				tileData = tileset.__data[id];
				if(tileData == null) {
					continue;
				}
				rect.setTo(tileData.x,tileData.y,tileData.width,tileData.height);
				tileRect = rect;
			}
			bitmapData = tileset.__bitmapData;
			if(bitmapData == null || bitmapData.image == null) {
				continue;
			}
			if(bitmapData != cacheBitmapData) {
				surface = bitmapData.getSurface();
				pattern = lime_graphics_cairo_CairoPattern.createForSurface(surface);
				lime_graphics_cairo_CairoPattern.set_filter(pattern,smooth ? 1 : 3);
				cairo.set_source(pattern);
				cacheBitmapData = bitmapData;
			}
			if(blendModeEnabled) {
				renderer.__setBlendMode(blendMode);
			}
			renderer.applyMatrix(tileTransform,cairo);
			matrix[6] = tileRect.x;
			matrix[7] = tileRect.y;
			lime_graphics_cairo_CairoPattern.set_matrix(pattern,matrix);
			cairo.set_source(pattern);
			cairo.save();
			cairo.newPath();
			cairo.rectangle(0,0,tileRect.width,tileRect.height);
			cairo.clip();
			if(alpha == 1) {
				cairo.paint();
			} else {
				cairo.paintWithAlpha(alpha);
			}
			cairo.restore();
		}
	}
	openfl_geom_Matrix.__pool.release(tileTransform);
};
openfl_display__$internal_CairoTilemap.renderDrawable = function(tilemap,renderer) {
};
openfl_display__$internal_CairoTilemap.renderDrawableMask = function(tilemap,renderer) {
};
var openfl_display__$internal_CanvasBitmap = function() { };
$hxClasses["openfl.display._internal.CanvasBitmap"] = openfl_display__$internal_CanvasBitmap;
openfl_display__$internal_CanvasBitmap.__name__ = "openfl.display._internal.CanvasBitmap";
openfl_display__$internal_CanvasBitmap.render = function(bitmap,renderer) {
	if(!bitmap.__renderable) {
		return;
	}
	var alpha = renderer.__getAlpha(bitmap.__worldAlpha);
	if(alpha > 0 && bitmap.__bitmapData != null && bitmap.__bitmapData.__isValid && bitmap.__bitmapData.readable) {
		var context = renderer.context;
		renderer.__setBlendMode(bitmap.__worldBlendMode);
		renderer.__pushMaskObject(bitmap,false);
		lime__$internal_graphics_ImageCanvasUtil.convertToCanvas(bitmap.__bitmapData.image);
		context.globalAlpha = alpha;
		var scrollRect = bitmap.__scrollRect;
		renderer.setTransform(bitmap.__renderTransform,context);
		if(!renderer.__allowSmoothing || !bitmap.smoothing) {
			context.imageSmoothingEnabled = false;
		}
		if(scrollRect == null) {
			context.drawImage(bitmap.__bitmapData.image.get_src(),0,0,bitmap.__bitmapData.image.width,bitmap.__bitmapData.image.height);
		} else {
			context.drawImage(bitmap.__bitmapData.image.get_src(),scrollRect.x,scrollRect.y,scrollRect.width,scrollRect.height,scrollRect.x,scrollRect.y,scrollRect.width,scrollRect.height);
		}
		if(!renderer.__allowSmoothing || !bitmap.smoothing) {
			context.imageSmoothingEnabled = true;
		}
		renderer.__popMaskObject(bitmap,false);
	}
};
openfl_display__$internal_CanvasBitmap.renderDrawable = function(bitmap,renderer) {
	renderer.__updateCacheBitmap(bitmap,false);
	if(bitmap.__bitmapData != null && bitmap.__bitmapData.image != null) {
		bitmap.__imageVersion = bitmap.__bitmapData.image.version;
	}
	if(bitmap.__cacheBitmap != null && !bitmap.__isCacheBitmapRender) {
		var bitmap1 = bitmap.__cacheBitmap;
		if(bitmap1.__renderable) {
			var alpha = renderer.__getAlpha(bitmap1.__worldAlpha);
			if(alpha > 0 && bitmap1.__bitmapData != null && bitmap1.__bitmapData.__isValid && bitmap1.__bitmapData.readable) {
				var context = renderer.context;
				renderer.__setBlendMode(bitmap1.__worldBlendMode);
				renderer.__pushMaskObject(bitmap1,false);
				lime__$internal_graphics_ImageCanvasUtil.convertToCanvas(bitmap1.__bitmapData.image);
				context.globalAlpha = alpha;
				var scrollRect = bitmap1.__scrollRect;
				renderer.setTransform(bitmap1.__renderTransform,context);
				if(!renderer.__allowSmoothing || !bitmap1.smoothing) {
					context.imageSmoothingEnabled = false;
				}
				if(scrollRect == null) {
					context.drawImage(bitmap1.__bitmapData.image.get_src(),0,0,bitmap1.__bitmapData.image.width,bitmap1.__bitmapData.image.height);
				} else {
					context.drawImage(bitmap1.__bitmapData.image.get_src(),scrollRect.x,scrollRect.y,scrollRect.width,scrollRect.height,scrollRect.x,scrollRect.y,scrollRect.width,scrollRect.height);
				}
				if(!renderer.__allowSmoothing || !bitmap1.smoothing) {
					context.imageSmoothingEnabled = true;
				}
				renderer.__popMaskObject(bitmap1,false);
			}
		}
	} else {
		if(!(bitmap.opaqueBackground == null && bitmap.__graphics == null)) {
			if(bitmap.__renderable) {
				var alpha = renderer.__getAlpha(bitmap.__worldAlpha);
				if(!(alpha <= 0)) {
					if(bitmap.opaqueBackground != null && !bitmap.__isCacheBitmapRender && bitmap.get_width() > 0 && bitmap.get_height() > 0) {
						renderer.__setBlendMode(bitmap.__worldBlendMode);
						renderer.__pushMaskObject(bitmap);
						var context = renderer.context;
						renderer.setTransform(bitmap.__renderTransform,context);
						var color = bitmap.opaqueBackground;
						context.fillStyle = "rgb(" + (color >>> 16 & 255) + "," + (color >>> 8 & 255) + "," + (color & 255) + ")";
						context.fillRect(0,0,bitmap.get_width(),bitmap.get_height());
						renderer.__popMaskObject(bitmap);
					}
					if(bitmap.__graphics != null) {
						if(bitmap.__renderable) {
							var alpha = renderer.__getAlpha(bitmap.__worldAlpha);
							if(!(alpha <= 0)) {
								var graphics = bitmap.__graphics;
								if(graphics != null) {
									openfl_display__$internal_CanvasGraphics.render(graphics,renderer);
									var width = graphics.__width;
									var height = graphics.__height;
									var canvas = graphics.__canvas;
									if(canvas != null && graphics.__visible && width >= 1 && height >= 1) {
										var transform = graphics.__worldTransform;
										var context = renderer.context;
										var scrollRect = bitmap.__scrollRect;
										if(scrollRect == null || scrollRect.width > 0 && scrollRect.height > 0) {
											renderer.__setBlendMode(bitmap.__worldBlendMode);
											renderer.__pushMaskObject(bitmap);
											context.globalAlpha = alpha;
											var renderTransform = openfl_geom_Matrix.__pool.get();
											renderTransform.scale(1 / graphics.__bitmapScaleX,1 / graphics.__bitmapScaleY);
											renderTransform.concat(transform);
											renderer.setTransform(renderTransform,context);
											context.drawImage(canvas,0,0,width,height);
											openfl_geom_Matrix.__pool.release(renderTransform);
											renderer.__popMaskObject(bitmap);
										}
									}
								}
							}
						}
					}
				}
			}
		}
		if(bitmap.__renderable) {
			var alpha = renderer.__getAlpha(bitmap.__worldAlpha);
			if(alpha > 0 && bitmap.__bitmapData != null && bitmap.__bitmapData.__isValid && bitmap.__bitmapData.readable) {
				var context = renderer.context;
				renderer.__setBlendMode(bitmap.__worldBlendMode);
				renderer.__pushMaskObject(bitmap,false);
				lime__$internal_graphics_ImageCanvasUtil.convertToCanvas(bitmap.__bitmapData.image);
				context.globalAlpha = alpha;
				var scrollRect = bitmap.__scrollRect;
				renderer.setTransform(bitmap.__renderTransform,context);
				if(!renderer.__allowSmoothing || !bitmap.smoothing) {
					context.imageSmoothingEnabled = false;
				}
				if(scrollRect == null) {
					context.drawImage(bitmap.__bitmapData.image.get_src(),0,0,bitmap.__bitmapData.image.width,bitmap.__bitmapData.image.height);
				} else {
					context.drawImage(bitmap.__bitmapData.image.get_src(),scrollRect.x,scrollRect.y,scrollRect.width,scrollRect.height,scrollRect.x,scrollRect.y,scrollRect.width,scrollRect.height);
				}
				if(!renderer.__allowSmoothing || !bitmap.smoothing) {
					context.imageSmoothingEnabled = true;
				}
				renderer.__popMaskObject(bitmap,false);
			}
		}
	}
	renderer.__renderEvent(bitmap);
};
openfl_display__$internal_CanvasBitmap.renderDrawableMask = function(bitmap,renderer) {
	renderer.context.rect(0,0,bitmap.get_width(),bitmap.get_height());
};
var openfl_display__$internal_CanvasBitmapData = function() { };
$hxClasses["openfl.display._internal.CanvasBitmapData"] = openfl_display__$internal_CanvasBitmapData;
openfl_display__$internal_CanvasBitmapData.__name__ = "openfl.display._internal.CanvasBitmapData";
openfl_display__$internal_CanvasBitmapData.renderDrawable = function(bitmapData,renderer) {
	if(!bitmapData.readable) {
		return;
	}
	var image = bitmapData.image;
	if(image.type == lime_graphics_ImageType.DATA) {
		lime__$internal_graphics_ImageCanvasUtil.convertToCanvas(image);
	}
	var context = renderer.context;
	context.globalAlpha = 1;
	renderer.setTransform(bitmapData.__renderTransform,context);
	context.drawImage(image.get_src(),0,0,image.width,image.height);
};
openfl_display__$internal_CanvasBitmapData.renderDrawableMask = function(bitmapData,renderer) {
};
var openfl_display__$internal_CanvasDisplayObject = function() { };
$hxClasses["openfl.display._internal.CanvasDisplayObject"] = openfl_display__$internal_CanvasDisplayObject;
openfl_display__$internal_CanvasDisplayObject.__name__ = "openfl.display._internal.CanvasDisplayObject";
openfl_display__$internal_CanvasDisplayObject.render = function(displayObject,renderer) {
	if(displayObject.opaqueBackground == null && displayObject.__graphics == null) {
		return;
	}
	if(!displayObject.__renderable) {
		return;
	}
	var alpha = renderer.__getAlpha(displayObject.__worldAlpha);
	if(alpha <= 0) {
		return;
	}
	if(displayObject.opaqueBackground != null && !displayObject.__isCacheBitmapRender && displayObject.get_width() > 0 && displayObject.get_height() > 0) {
		renderer.__setBlendMode(displayObject.__worldBlendMode);
		renderer.__pushMaskObject(displayObject);
		var context = renderer.context;
		renderer.setTransform(displayObject.__renderTransform,context);
		var color = displayObject.opaqueBackground;
		context.fillStyle = "rgb(" + (color >>> 16 & 255) + "," + (color >>> 8 & 255) + "," + (color & 255) + ")";
		context.fillRect(0,0,displayObject.get_width(),displayObject.get_height());
		renderer.__popMaskObject(displayObject);
	}
	if(displayObject.__graphics != null) {
		if(displayObject.__renderable) {
			var alpha = renderer.__getAlpha(displayObject.__worldAlpha);
			if(!(alpha <= 0)) {
				var graphics = displayObject.__graphics;
				if(graphics != null) {
					openfl_display__$internal_CanvasGraphics.render(graphics,renderer);
					var width = graphics.__width;
					var height = graphics.__height;
					var canvas = graphics.__canvas;
					if(canvas != null && graphics.__visible && width >= 1 && height >= 1) {
						var transform = graphics.__worldTransform;
						var context = renderer.context;
						var scrollRect = displayObject.__scrollRect;
						if(scrollRect == null || scrollRect.width > 0 && scrollRect.height > 0) {
							renderer.__setBlendMode(displayObject.__worldBlendMode);
							renderer.__pushMaskObject(displayObject);
							context.globalAlpha = alpha;
							var renderTransform = openfl_geom_Matrix.__pool.get();
							renderTransform.scale(1 / graphics.__bitmapScaleX,1 / graphics.__bitmapScaleY);
							renderTransform.concat(transform);
							renderer.setTransform(renderTransform,context);
							context.drawImage(canvas,0,0,width,height);
							openfl_geom_Matrix.__pool.release(renderTransform);
							renderer.__popMaskObject(displayObject);
						}
					}
				}
			}
		}
	}
};
openfl_display__$internal_CanvasDisplayObject.renderDrawable = function(displayObject,renderer) {
	if(displayObject.get_mask() == null || displayObject.get_mask().get_width() > 0 && displayObject.get_mask().get_height() > 0) {
		renderer.__updateCacheBitmap(displayObject,false);
		if(displayObject.__cacheBitmap != null && !displayObject.__isCacheBitmapRender) {
			var bitmap = displayObject.__cacheBitmap;
			if(bitmap.__renderable) {
				var alpha = renderer.__getAlpha(bitmap.__worldAlpha);
				if(alpha > 0 && bitmap.__bitmapData != null && bitmap.__bitmapData.__isValid && bitmap.__bitmapData.readable) {
					var context = renderer.context;
					renderer.__setBlendMode(bitmap.__worldBlendMode);
					renderer.__pushMaskObject(bitmap,false);
					lime__$internal_graphics_ImageCanvasUtil.convertToCanvas(bitmap.__bitmapData.image);
					context.globalAlpha = alpha;
					var scrollRect = bitmap.__scrollRect;
					renderer.setTransform(bitmap.__renderTransform,context);
					if(!renderer.__allowSmoothing || !bitmap.smoothing) {
						context.imageSmoothingEnabled = false;
					}
					if(scrollRect == null) {
						context.drawImage(bitmap.__bitmapData.image.get_src(),0,0,bitmap.__bitmapData.image.width,bitmap.__bitmapData.image.height);
					} else {
						context.drawImage(bitmap.__bitmapData.image.get_src(),scrollRect.x,scrollRect.y,scrollRect.width,scrollRect.height,scrollRect.x,scrollRect.y,scrollRect.width,scrollRect.height);
					}
					if(!renderer.__allowSmoothing || !bitmap.smoothing) {
						context.imageSmoothingEnabled = true;
					}
					renderer.__popMaskObject(bitmap,false);
				}
			}
		} else if(!(displayObject.opaqueBackground == null && displayObject.__graphics == null)) {
			if(displayObject.__renderable) {
				var alpha = renderer.__getAlpha(displayObject.__worldAlpha);
				if(!(alpha <= 0)) {
					if(displayObject.opaqueBackground != null && !displayObject.__isCacheBitmapRender && displayObject.get_width() > 0 && displayObject.get_height() > 0) {
						renderer.__setBlendMode(displayObject.__worldBlendMode);
						renderer.__pushMaskObject(displayObject);
						var context = renderer.context;
						renderer.setTransform(displayObject.__renderTransform,context);
						var color = displayObject.opaqueBackground;
						context.fillStyle = "rgb(" + (color >>> 16 & 255) + "," + (color >>> 8 & 255) + "," + (color & 255) + ")";
						context.fillRect(0,0,displayObject.get_width(),displayObject.get_height());
						renderer.__popMaskObject(displayObject);
					}
					if(displayObject.__graphics != null) {
						if(displayObject.__renderable) {
							var alpha = renderer.__getAlpha(displayObject.__worldAlpha);
							if(!(alpha <= 0)) {
								var graphics = displayObject.__graphics;
								if(graphics != null) {
									openfl_display__$internal_CanvasGraphics.render(graphics,renderer);
									var width = graphics.__width;
									var height = graphics.__height;
									var canvas = graphics.__canvas;
									if(canvas != null && graphics.__visible && width >= 1 && height >= 1) {
										var transform = graphics.__worldTransform;
										var context = renderer.context;
										var scrollRect = displayObject.__scrollRect;
										if(scrollRect == null || scrollRect.width > 0 && scrollRect.height > 0) {
											renderer.__setBlendMode(displayObject.__worldBlendMode);
											renderer.__pushMaskObject(displayObject);
											context.globalAlpha = alpha;
											var renderTransform = openfl_geom_Matrix.__pool.get();
											renderTransform.scale(1 / graphics.__bitmapScaleX,1 / graphics.__bitmapScaleY);
											renderTransform.concat(transform);
											renderer.setTransform(renderTransform,context);
											context.drawImage(canvas,0,0,width,height);
											openfl_geom_Matrix.__pool.release(renderTransform);
											renderer.__popMaskObject(displayObject);
										}
									}
								}
							}
						}
					}
				}
			}
		}
	}
	renderer.__renderEvent(displayObject);
};
openfl_display__$internal_CanvasDisplayObject.renderDrawableMask = function(displayObject,renderer) {
	if(displayObject.__graphics != null) {
		openfl_display__$internal_CanvasGraphics.renderMask(displayObject.__graphics,renderer);
	}
};
var openfl_display__$internal_CanvasDisplayObjectContainer = function() { };
$hxClasses["openfl.display._internal.CanvasDisplayObjectContainer"] = openfl_display__$internal_CanvasDisplayObjectContainer;
openfl_display__$internal_CanvasDisplayObjectContainer.__name__ = "openfl.display._internal.CanvasDisplayObjectContainer";
openfl_display__$internal_CanvasDisplayObjectContainer.renderDrawable = function(displayObjectContainer,renderer) {
	var orphan = displayObjectContainer.__removedChildren.iterator();
	while(orphan.hasNext()) {
		var orphan1 = orphan.next();
		if(orphan1.stage == null) {
			orphan1.__cleanup();
		}
	}
	displayObjectContainer.__removedChildren.set_length(0);
	if(!displayObjectContainer.__renderable || displayObjectContainer.__worldAlpha <= 0 || displayObjectContainer.get_mask() != null && (displayObjectContainer.get_mask().get_width() <= 0 || displayObjectContainer.get_mask().get_height() <= 0)) {
		return;
	}
	openfl_display__$internal_CanvasDisplayObject.renderDrawable(displayObjectContainer,renderer);
	if(displayObjectContainer.__cacheBitmap != null && !displayObjectContainer.__isCacheBitmapRender) {
		return;
	}
	renderer.__pushMaskObject(displayObjectContainer);
	if(renderer.__stage != null) {
		var _g = 0;
		var _g1 = displayObjectContainer.__children;
		while(_g < _g1.length) {
			var child = _g1[_g];
			++_g;
			renderer.__renderDrawable(child);
			child.__renderDirty = false;
		}
		displayObjectContainer.__renderDirty = false;
	} else {
		var _g = 0;
		var _g1 = displayObjectContainer.__children;
		while(_g < _g1.length) {
			var child = _g1[_g];
			++_g;
			renderer.__renderDrawable(child);
		}
	}
	renderer.__popMaskObject(displayObjectContainer);
};
openfl_display__$internal_CanvasDisplayObjectContainer.renderDrawableMask = function(displayObjectContainer,renderer) {
	var orphan = displayObjectContainer.__removedChildren.iterator();
	while(orphan.hasNext()) {
		var orphan1 = orphan.next();
		if(orphan1.stage == null) {
			orphan1.__cleanup();
		}
	}
	displayObjectContainer.__removedChildren.set_length(0);
	if(displayObjectContainer.__graphics != null) {
		openfl_display__$internal_CanvasGraphics.renderMask(displayObjectContainer.__graphics,renderer);
	}
	var _g = 0;
	var _g1 = displayObjectContainer.__children;
	while(_g < _g1.length) {
		var child = _g1[_g];
		++_g;
		renderer.__renderDrawableMask(child);
	}
};
var openfl_display__$internal_DrawCommandBuffer = function() {
	if(openfl_display__$internal_DrawCommandBuffer.empty == null) {
		this.types = [];
		this.b = [];
		this.i = [];
		this.f = [];
		this.o = [];
		this.ff = [];
		this.ii = [];
		this.copyOnWrite = true;
	} else {
		this.clear();
	}
};
$hxClasses["openfl.display._internal.DrawCommandBuffer"] = openfl_display__$internal_DrawCommandBuffer;
openfl_display__$internal_DrawCommandBuffer.__name__ = "openfl.display._internal.DrawCommandBuffer";
openfl_display__$internal_DrawCommandBuffer.prototype = {
	types: null
	,b: null
	,copyOnWrite: null
	,f: null
	,ff: null
	,i: null
	,ii: null
	,o: null
	,append: function(other) {
		if(this.get_length() == 0) {
			this.types = other.types;
			this.b = other.b;
			this.i = other.i;
			this.f = other.f;
			this.o = other.o;
			this.ff = other.ff;
			this.ii = other.ii;
			this.copyOnWrite = other.copyOnWrite = true;
			return other;
		}
		var data = new openfl_display__$internal_DrawCommandReader(other);
		var _g = 0;
		var _g1 = other.types;
		while(_g < _g1.length) {
			var type = _g1[_g];
			++_g;
			switch(type._hx_index) {
			case 0:
				switch(data.prev._hx_index) {
				case 0:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 1:
					data.iPos += 1;
					data.fPos += 1;
					break;
				case 2:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 3:
					data.oPos += 1;
					break;
				case 4:
					data.fPos += 6;
					break;
				case 5:
					data.fPos += 4;
					break;
				case 6:
					data.fPos += 3;
					break;
				case 7:
					data.fPos += 4;
					break;
				case 8:
					data.oPos += 3;
					break;
				case 9:
					data.fPos += 4;
					break;
				case 10:
					data.fPos += 5;
					data.oPos += 1;
					break;
				case 12:
					data.oPos += 4;
					break;
				case 13:
					break;
				case 14:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 15:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 16:
					data.oPos += 4;
					data.iPos += 1;
					data.fPos += 2;
					data.bPos += 1;
					break;
				case 17:
					data.fPos += 2;
					break;
				case 18:
					data.fPos += 2;
					break;
				case 19:
					data.oPos += 1;
					break;
				case 20:
					data.oPos += 1;
					break;
				case 21:case 22:
					break;
				default:
				}
				data.prev = openfl_display__$internal_DrawCommandType.BEGIN_BITMAP_FILL;
				var c = data;
				this.beginBitmapFill(c.buffer.o[c.oPos],c.buffer.o[c.oPos + 1],c.buffer.b[c.bPos],c.buffer.b[c.bPos + 1]);
				break;
			case 1:
				switch(data.prev._hx_index) {
				case 0:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 1:
					data.iPos += 1;
					data.fPos += 1;
					break;
				case 2:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 3:
					data.oPos += 1;
					break;
				case 4:
					data.fPos += 6;
					break;
				case 5:
					data.fPos += 4;
					break;
				case 6:
					data.fPos += 3;
					break;
				case 7:
					data.fPos += 4;
					break;
				case 8:
					data.oPos += 3;
					break;
				case 9:
					data.fPos += 4;
					break;
				case 10:
					data.fPos += 5;
					data.oPos += 1;
					break;
				case 12:
					data.oPos += 4;
					break;
				case 13:
					break;
				case 14:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 15:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 16:
					data.oPos += 4;
					data.iPos += 1;
					data.fPos += 2;
					data.bPos += 1;
					break;
				case 17:
					data.fPos += 2;
					break;
				case 18:
					data.fPos += 2;
					break;
				case 19:
					data.oPos += 1;
					break;
				case 20:
					data.oPos += 1;
					break;
				case 21:case 22:
					break;
				default:
				}
				data.prev = openfl_display__$internal_DrawCommandType.BEGIN_FILL;
				var c1 = data;
				this.beginFill(c1.buffer.i[c1.iPos],c1.buffer.f[c1.fPos]);
				break;
			case 2:
				switch(data.prev._hx_index) {
				case 0:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 1:
					data.iPos += 1;
					data.fPos += 1;
					break;
				case 2:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 3:
					data.oPos += 1;
					break;
				case 4:
					data.fPos += 6;
					break;
				case 5:
					data.fPos += 4;
					break;
				case 6:
					data.fPos += 3;
					break;
				case 7:
					data.fPos += 4;
					break;
				case 8:
					data.oPos += 3;
					break;
				case 9:
					data.fPos += 4;
					break;
				case 10:
					data.fPos += 5;
					data.oPos += 1;
					break;
				case 12:
					data.oPos += 4;
					break;
				case 13:
					break;
				case 14:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 15:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 16:
					data.oPos += 4;
					data.iPos += 1;
					data.fPos += 2;
					data.bPos += 1;
					break;
				case 17:
					data.fPos += 2;
					break;
				case 18:
					data.fPos += 2;
					break;
				case 19:
					data.oPos += 1;
					break;
				case 20:
					data.oPos += 1;
					break;
				case 21:case 22:
					break;
				default:
				}
				data.prev = openfl_display__$internal_DrawCommandType.BEGIN_GRADIENT_FILL;
				var c2 = data;
				this.beginGradientFill(c2.buffer.o[c2.oPos],c2.buffer.ii[c2.iiPos],c2.buffer.ff[c2.ffPos],c2.buffer.ii[c2.iiPos + 1],c2.buffer.o[c2.oPos + 1],c2.buffer.o[c2.oPos + 2],c2.buffer.o[c2.oPos + 3],c2.buffer.f[c2.fPos]);
				break;
			case 3:
				switch(data.prev._hx_index) {
				case 0:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 1:
					data.iPos += 1;
					data.fPos += 1;
					break;
				case 2:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 3:
					data.oPos += 1;
					break;
				case 4:
					data.fPos += 6;
					break;
				case 5:
					data.fPos += 4;
					break;
				case 6:
					data.fPos += 3;
					break;
				case 7:
					data.fPos += 4;
					break;
				case 8:
					data.oPos += 3;
					break;
				case 9:
					data.fPos += 4;
					break;
				case 10:
					data.fPos += 5;
					data.oPos += 1;
					break;
				case 12:
					data.oPos += 4;
					break;
				case 13:
					break;
				case 14:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 15:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 16:
					data.oPos += 4;
					data.iPos += 1;
					data.fPos += 2;
					data.bPos += 1;
					break;
				case 17:
					data.fPos += 2;
					break;
				case 18:
					data.fPos += 2;
					break;
				case 19:
					data.oPos += 1;
					break;
				case 20:
					data.oPos += 1;
					break;
				case 21:case 22:
					break;
				default:
				}
				data.prev = openfl_display__$internal_DrawCommandType.BEGIN_SHADER_FILL;
				var c3 = data;
				this.beginShaderFill(c3.buffer.o[c3.oPos]);
				break;
			case 4:
				switch(data.prev._hx_index) {
				case 0:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 1:
					data.iPos += 1;
					data.fPos += 1;
					break;
				case 2:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 3:
					data.oPos += 1;
					break;
				case 4:
					data.fPos += 6;
					break;
				case 5:
					data.fPos += 4;
					break;
				case 6:
					data.fPos += 3;
					break;
				case 7:
					data.fPos += 4;
					break;
				case 8:
					data.oPos += 3;
					break;
				case 9:
					data.fPos += 4;
					break;
				case 10:
					data.fPos += 5;
					data.oPos += 1;
					break;
				case 12:
					data.oPos += 4;
					break;
				case 13:
					break;
				case 14:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 15:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 16:
					data.oPos += 4;
					data.iPos += 1;
					data.fPos += 2;
					data.bPos += 1;
					break;
				case 17:
					data.fPos += 2;
					break;
				case 18:
					data.fPos += 2;
					break;
				case 19:
					data.oPos += 1;
					break;
				case 20:
					data.oPos += 1;
					break;
				case 21:case 22:
					break;
				default:
				}
				data.prev = openfl_display__$internal_DrawCommandType.CUBIC_CURVE_TO;
				var c4 = data;
				this.cubicCurveTo(c4.buffer.f[c4.fPos],c4.buffer.f[c4.fPos + 1],c4.buffer.f[c4.fPos + 2],c4.buffer.f[c4.fPos + 3],c4.buffer.f[c4.fPos + 4],c4.buffer.f[c4.fPos + 5]);
				break;
			case 5:
				switch(data.prev._hx_index) {
				case 0:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 1:
					data.iPos += 1;
					data.fPos += 1;
					break;
				case 2:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 3:
					data.oPos += 1;
					break;
				case 4:
					data.fPos += 6;
					break;
				case 5:
					data.fPos += 4;
					break;
				case 6:
					data.fPos += 3;
					break;
				case 7:
					data.fPos += 4;
					break;
				case 8:
					data.oPos += 3;
					break;
				case 9:
					data.fPos += 4;
					break;
				case 10:
					data.fPos += 5;
					data.oPos += 1;
					break;
				case 12:
					data.oPos += 4;
					break;
				case 13:
					break;
				case 14:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 15:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 16:
					data.oPos += 4;
					data.iPos += 1;
					data.fPos += 2;
					data.bPos += 1;
					break;
				case 17:
					data.fPos += 2;
					break;
				case 18:
					data.fPos += 2;
					break;
				case 19:
					data.oPos += 1;
					break;
				case 20:
					data.oPos += 1;
					break;
				case 21:case 22:
					break;
				default:
				}
				data.prev = openfl_display__$internal_DrawCommandType.CURVE_TO;
				var c5 = data;
				this.curveTo(c5.buffer.f[c5.fPos],c5.buffer.f[c5.fPos + 1],c5.buffer.f[c5.fPos + 2],c5.buffer.f[c5.fPos + 3]);
				break;
			case 6:
				switch(data.prev._hx_index) {
				case 0:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 1:
					data.iPos += 1;
					data.fPos += 1;
					break;
				case 2:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 3:
					data.oPos += 1;
					break;
				case 4:
					data.fPos += 6;
					break;
				case 5:
					data.fPos += 4;
					break;
				case 6:
					data.fPos += 3;
					break;
				case 7:
					data.fPos += 4;
					break;
				case 8:
					data.oPos += 3;
					break;
				case 9:
					data.fPos += 4;
					break;
				case 10:
					data.fPos += 5;
					data.oPos += 1;
					break;
				case 12:
					data.oPos += 4;
					break;
				case 13:
					break;
				case 14:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 15:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 16:
					data.oPos += 4;
					data.iPos += 1;
					data.fPos += 2;
					data.bPos += 1;
					break;
				case 17:
					data.fPos += 2;
					break;
				case 18:
					data.fPos += 2;
					break;
				case 19:
					data.oPos += 1;
					break;
				case 20:
					data.oPos += 1;
					break;
				case 21:case 22:
					break;
				default:
				}
				data.prev = openfl_display__$internal_DrawCommandType.DRAW_CIRCLE;
				var c6 = data;
				this.drawCircle(c6.buffer.f[c6.fPos],c6.buffer.f[c6.fPos + 1],c6.buffer.f[c6.fPos + 2]);
				break;
			case 7:
				switch(data.prev._hx_index) {
				case 0:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 1:
					data.iPos += 1;
					data.fPos += 1;
					break;
				case 2:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 3:
					data.oPos += 1;
					break;
				case 4:
					data.fPos += 6;
					break;
				case 5:
					data.fPos += 4;
					break;
				case 6:
					data.fPos += 3;
					break;
				case 7:
					data.fPos += 4;
					break;
				case 8:
					data.oPos += 3;
					break;
				case 9:
					data.fPos += 4;
					break;
				case 10:
					data.fPos += 5;
					data.oPos += 1;
					break;
				case 12:
					data.oPos += 4;
					break;
				case 13:
					break;
				case 14:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 15:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 16:
					data.oPos += 4;
					data.iPos += 1;
					data.fPos += 2;
					data.bPos += 1;
					break;
				case 17:
					data.fPos += 2;
					break;
				case 18:
					data.fPos += 2;
					break;
				case 19:
					data.oPos += 1;
					break;
				case 20:
					data.oPos += 1;
					break;
				case 21:case 22:
					break;
				default:
				}
				data.prev = openfl_display__$internal_DrawCommandType.DRAW_ELLIPSE;
				var c7 = data;
				this.drawEllipse(c7.buffer.f[c7.fPos],c7.buffer.f[c7.fPos + 1],c7.buffer.f[c7.fPos + 2],c7.buffer.f[c7.fPos + 3]);
				break;
			case 8:
				switch(data.prev._hx_index) {
				case 0:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 1:
					data.iPos += 1;
					data.fPos += 1;
					break;
				case 2:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 3:
					data.oPos += 1;
					break;
				case 4:
					data.fPos += 6;
					break;
				case 5:
					data.fPos += 4;
					break;
				case 6:
					data.fPos += 3;
					break;
				case 7:
					data.fPos += 4;
					break;
				case 8:
					data.oPos += 3;
					break;
				case 9:
					data.fPos += 4;
					break;
				case 10:
					data.fPos += 5;
					data.oPos += 1;
					break;
				case 12:
					data.oPos += 4;
					break;
				case 13:
					break;
				case 14:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 15:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 16:
					data.oPos += 4;
					data.iPos += 1;
					data.fPos += 2;
					data.bPos += 1;
					break;
				case 17:
					data.fPos += 2;
					break;
				case 18:
					data.fPos += 2;
					break;
				case 19:
					data.oPos += 1;
					break;
				case 20:
					data.oPos += 1;
					break;
				case 21:case 22:
					break;
				default:
				}
				data.prev = openfl_display__$internal_DrawCommandType.DRAW_QUADS;
				var c8 = data;
				this.drawQuads(c8.buffer.o[c8.oPos],c8.buffer.o[c8.oPos + 1],c8.buffer.o[c8.oPos + 2]);
				break;
			case 9:
				switch(data.prev._hx_index) {
				case 0:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 1:
					data.iPos += 1;
					data.fPos += 1;
					break;
				case 2:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 3:
					data.oPos += 1;
					break;
				case 4:
					data.fPos += 6;
					break;
				case 5:
					data.fPos += 4;
					break;
				case 6:
					data.fPos += 3;
					break;
				case 7:
					data.fPos += 4;
					break;
				case 8:
					data.oPos += 3;
					break;
				case 9:
					data.fPos += 4;
					break;
				case 10:
					data.fPos += 5;
					data.oPos += 1;
					break;
				case 12:
					data.oPos += 4;
					break;
				case 13:
					break;
				case 14:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 15:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 16:
					data.oPos += 4;
					data.iPos += 1;
					data.fPos += 2;
					data.bPos += 1;
					break;
				case 17:
					data.fPos += 2;
					break;
				case 18:
					data.fPos += 2;
					break;
				case 19:
					data.oPos += 1;
					break;
				case 20:
					data.oPos += 1;
					break;
				case 21:case 22:
					break;
				default:
				}
				data.prev = openfl_display__$internal_DrawCommandType.DRAW_RECT;
				var c9 = data;
				this.drawRect(c9.buffer.f[c9.fPos],c9.buffer.f[c9.fPos + 1],c9.buffer.f[c9.fPos + 2],c9.buffer.f[c9.fPos + 3]);
				break;
			case 10:
				switch(data.prev._hx_index) {
				case 0:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 1:
					data.iPos += 1;
					data.fPos += 1;
					break;
				case 2:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 3:
					data.oPos += 1;
					break;
				case 4:
					data.fPos += 6;
					break;
				case 5:
					data.fPos += 4;
					break;
				case 6:
					data.fPos += 3;
					break;
				case 7:
					data.fPos += 4;
					break;
				case 8:
					data.oPos += 3;
					break;
				case 9:
					data.fPos += 4;
					break;
				case 10:
					data.fPos += 5;
					data.oPos += 1;
					break;
				case 12:
					data.oPos += 4;
					break;
				case 13:
					break;
				case 14:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 15:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 16:
					data.oPos += 4;
					data.iPos += 1;
					data.fPos += 2;
					data.bPos += 1;
					break;
				case 17:
					data.fPos += 2;
					break;
				case 18:
					data.fPos += 2;
					break;
				case 19:
					data.oPos += 1;
					break;
				case 20:
					data.oPos += 1;
					break;
				case 21:case 22:
					break;
				default:
				}
				data.prev = openfl_display__$internal_DrawCommandType.DRAW_ROUND_RECT;
				var c10 = data;
				this.drawRoundRect(c10.buffer.f[c10.fPos],c10.buffer.f[c10.fPos + 1],c10.buffer.f[c10.fPos + 2],c10.buffer.f[c10.fPos + 3],c10.buffer.f[c10.fPos + 4],c10.buffer.o[c10.oPos]);
				break;
			case 12:
				switch(data.prev._hx_index) {
				case 0:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 1:
					data.iPos += 1;
					data.fPos += 1;
					break;
				case 2:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 3:
					data.oPos += 1;
					break;
				case 4:
					data.fPos += 6;
					break;
				case 5:
					data.fPos += 4;
					break;
				case 6:
					data.fPos += 3;
					break;
				case 7:
					data.fPos += 4;
					break;
				case 8:
					data.oPos += 3;
					break;
				case 9:
					data.fPos += 4;
					break;
				case 10:
					data.fPos += 5;
					data.oPos += 1;
					break;
				case 12:
					data.oPos += 4;
					break;
				case 13:
					break;
				case 14:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 15:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 16:
					data.oPos += 4;
					data.iPos += 1;
					data.fPos += 2;
					data.bPos += 1;
					break;
				case 17:
					data.fPos += 2;
					break;
				case 18:
					data.fPos += 2;
					break;
				case 19:
					data.oPos += 1;
					break;
				case 20:
					data.oPos += 1;
					break;
				case 21:case 22:
					break;
				default:
				}
				data.prev = openfl_display__$internal_DrawCommandType.DRAW_TRIANGLES;
				var c11 = data;
				this.drawTriangles(c11.buffer.o[c11.oPos],c11.buffer.o[c11.oPos + 1],c11.buffer.o[c11.oPos + 2],c11.buffer.o[c11.oPos + 3]);
				break;
			case 13:
				switch(data.prev._hx_index) {
				case 0:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 1:
					data.iPos += 1;
					data.fPos += 1;
					break;
				case 2:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 3:
					data.oPos += 1;
					break;
				case 4:
					data.fPos += 6;
					break;
				case 5:
					data.fPos += 4;
					break;
				case 6:
					data.fPos += 3;
					break;
				case 7:
					data.fPos += 4;
					break;
				case 8:
					data.oPos += 3;
					break;
				case 9:
					data.fPos += 4;
					break;
				case 10:
					data.fPos += 5;
					data.oPos += 1;
					break;
				case 12:
					data.oPos += 4;
					break;
				case 13:
					break;
				case 14:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 15:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 16:
					data.oPos += 4;
					data.iPos += 1;
					data.fPos += 2;
					data.bPos += 1;
					break;
				case 17:
					data.fPos += 2;
					break;
				case 18:
					data.fPos += 2;
					break;
				case 19:
					data.oPos += 1;
					break;
				case 20:
					data.oPos += 1;
					break;
				case 21:case 22:
					break;
				default:
				}
				data.prev = openfl_display__$internal_DrawCommandType.END_FILL;
				var c12 = data;
				this.endFill();
				break;
			case 14:
				switch(data.prev._hx_index) {
				case 0:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 1:
					data.iPos += 1;
					data.fPos += 1;
					break;
				case 2:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 3:
					data.oPos += 1;
					break;
				case 4:
					data.fPos += 6;
					break;
				case 5:
					data.fPos += 4;
					break;
				case 6:
					data.fPos += 3;
					break;
				case 7:
					data.fPos += 4;
					break;
				case 8:
					data.oPos += 3;
					break;
				case 9:
					data.fPos += 4;
					break;
				case 10:
					data.fPos += 5;
					data.oPos += 1;
					break;
				case 12:
					data.oPos += 4;
					break;
				case 13:
					break;
				case 14:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 15:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 16:
					data.oPos += 4;
					data.iPos += 1;
					data.fPos += 2;
					data.bPos += 1;
					break;
				case 17:
					data.fPos += 2;
					break;
				case 18:
					data.fPos += 2;
					break;
				case 19:
					data.oPos += 1;
					break;
				case 20:
					data.oPos += 1;
					break;
				case 21:case 22:
					break;
				default:
				}
				data.prev = openfl_display__$internal_DrawCommandType.LINE_BITMAP_STYLE;
				var c13 = data;
				this.lineBitmapStyle(c13.buffer.o[c13.oPos],c13.buffer.o[c13.oPos + 1],c13.buffer.b[c13.bPos],c13.buffer.b[c13.bPos + 1]);
				break;
			case 15:
				switch(data.prev._hx_index) {
				case 0:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 1:
					data.iPos += 1;
					data.fPos += 1;
					break;
				case 2:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 3:
					data.oPos += 1;
					break;
				case 4:
					data.fPos += 6;
					break;
				case 5:
					data.fPos += 4;
					break;
				case 6:
					data.fPos += 3;
					break;
				case 7:
					data.fPos += 4;
					break;
				case 8:
					data.oPos += 3;
					break;
				case 9:
					data.fPos += 4;
					break;
				case 10:
					data.fPos += 5;
					data.oPos += 1;
					break;
				case 12:
					data.oPos += 4;
					break;
				case 13:
					break;
				case 14:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 15:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 16:
					data.oPos += 4;
					data.iPos += 1;
					data.fPos += 2;
					data.bPos += 1;
					break;
				case 17:
					data.fPos += 2;
					break;
				case 18:
					data.fPos += 2;
					break;
				case 19:
					data.oPos += 1;
					break;
				case 20:
					data.oPos += 1;
					break;
				case 21:case 22:
					break;
				default:
				}
				data.prev = openfl_display__$internal_DrawCommandType.LINE_GRADIENT_STYLE;
				var c14 = data;
				this.lineGradientStyle(c14.buffer.o[c14.oPos],c14.buffer.ii[c14.iiPos],c14.buffer.ff[c14.ffPos],c14.buffer.ii[c14.iiPos + 1],c14.buffer.o[c14.oPos + 1],c14.buffer.o[c14.oPos + 2],c14.buffer.o[c14.oPos + 3],c14.buffer.f[c14.fPos]);
				break;
			case 16:
				switch(data.prev._hx_index) {
				case 0:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 1:
					data.iPos += 1;
					data.fPos += 1;
					break;
				case 2:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 3:
					data.oPos += 1;
					break;
				case 4:
					data.fPos += 6;
					break;
				case 5:
					data.fPos += 4;
					break;
				case 6:
					data.fPos += 3;
					break;
				case 7:
					data.fPos += 4;
					break;
				case 8:
					data.oPos += 3;
					break;
				case 9:
					data.fPos += 4;
					break;
				case 10:
					data.fPos += 5;
					data.oPos += 1;
					break;
				case 12:
					data.oPos += 4;
					break;
				case 13:
					break;
				case 14:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 15:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 16:
					data.oPos += 4;
					data.iPos += 1;
					data.fPos += 2;
					data.bPos += 1;
					break;
				case 17:
					data.fPos += 2;
					break;
				case 18:
					data.fPos += 2;
					break;
				case 19:
					data.oPos += 1;
					break;
				case 20:
					data.oPos += 1;
					break;
				case 21:case 22:
					break;
				default:
				}
				data.prev = openfl_display__$internal_DrawCommandType.LINE_STYLE;
				var c15 = data;
				this.lineStyle(c15.buffer.o[c15.oPos],c15.buffer.i[c15.iPos],c15.buffer.f[c15.fPos],c15.buffer.b[c15.bPos],c15.buffer.o[c15.oPos + 1],c15.buffer.o[c15.oPos + 2],c15.buffer.o[c15.oPos + 3],c15.buffer.f[c15.fPos + 1]);
				break;
			case 17:
				switch(data.prev._hx_index) {
				case 0:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 1:
					data.iPos += 1;
					data.fPos += 1;
					break;
				case 2:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 3:
					data.oPos += 1;
					break;
				case 4:
					data.fPos += 6;
					break;
				case 5:
					data.fPos += 4;
					break;
				case 6:
					data.fPos += 3;
					break;
				case 7:
					data.fPos += 4;
					break;
				case 8:
					data.oPos += 3;
					break;
				case 9:
					data.fPos += 4;
					break;
				case 10:
					data.fPos += 5;
					data.oPos += 1;
					break;
				case 12:
					data.oPos += 4;
					break;
				case 13:
					break;
				case 14:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 15:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 16:
					data.oPos += 4;
					data.iPos += 1;
					data.fPos += 2;
					data.bPos += 1;
					break;
				case 17:
					data.fPos += 2;
					break;
				case 18:
					data.fPos += 2;
					break;
				case 19:
					data.oPos += 1;
					break;
				case 20:
					data.oPos += 1;
					break;
				case 21:case 22:
					break;
				default:
				}
				data.prev = openfl_display__$internal_DrawCommandType.LINE_TO;
				var c16 = data;
				this.lineTo(c16.buffer.f[c16.fPos],c16.buffer.f[c16.fPos + 1]);
				break;
			case 18:
				switch(data.prev._hx_index) {
				case 0:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 1:
					data.iPos += 1;
					data.fPos += 1;
					break;
				case 2:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 3:
					data.oPos += 1;
					break;
				case 4:
					data.fPos += 6;
					break;
				case 5:
					data.fPos += 4;
					break;
				case 6:
					data.fPos += 3;
					break;
				case 7:
					data.fPos += 4;
					break;
				case 8:
					data.oPos += 3;
					break;
				case 9:
					data.fPos += 4;
					break;
				case 10:
					data.fPos += 5;
					data.oPos += 1;
					break;
				case 12:
					data.oPos += 4;
					break;
				case 13:
					break;
				case 14:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 15:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 16:
					data.oPos += 4;
					data.iPos += 1;
					data.fPos += 2;
					data.bPos += 1;
					break;
				case 17:
					data.fPos += 2;
					break;
				case 18:
					data.fPos += 2;
					break;
				case 19:
					data.oPos += 1;
					break;
				case 20:
					data.oPos += 1;
					break;
				case 21:case 22:
					break;
				default:
				}
				data.prev = openfl_display__$internal_DrawCommandType.MOVE_TO;
				var c17 = data;
				this.moveTo(c17.buffer.f[c17.fPos],c17.buffer.f[c17.fPos + 1]);
				break;
			case 20:
				switch(data.prev._hx_index) {
				case 0:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 1:
					data.iPos += 1;
					data.fPos += 1;
					break;
				case 2:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 3:
					data.oPos += 1;
					break;
				case 4:
					data.fPos += 6;
					break;
				case 5:
					data.fPos += 4;
					break;
				case 6:
					data.fPos += 3;
					break;
				case 7:
					data.fPos += 4;
					break;
				case 8:
					data.oPos += 3;
					break;
				case 9:
					data.fPos += 4;
					break;
				case 10:
					data.fPos += 5;
					data.oPos += 1;
					break;
				case 12:
					data.oPos += 4;
					break;
				case 13:
					break;
				case 14:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 15:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 16:
					data.oPos += 4;
					data.iPos += 1;
					data.fPos += 2;
					data.bPos += 1;
					break;
				case 17:
					data.fPos += 2;
					break;
				case 18:
					data.fPos += 2;
					break;
				case 19:
					data.oPos += 1;
					break;
				case 20:
					data.oPos += 1;
					break;
				case 21:case 22:
					break;
				default:
				}
				data.prev = openfl_display__$internal_DrawCommandType.OVERRIDE_MATRIX;
				var c18 = data;
				this.overrideMatrix(c18.buffer.o[c18.oPos]);
				break;
			case 21:
				switch(data.prev._hx_index) {
				case 0:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 1:
					data.iPos += 1;
					data.fPos += 1;
					break;
				case 2:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 3:
					data.oPos += 1;
					break;
				case 4:
					data.fPos += 6;
					break;
				case 5:
					data.fPos += 4;
					break;
				case 6:
					data.fPos += 3;
					break;
				case 7:
					data.fPos += 4;
					break;
				case 8:
					data.oPos += 3;
					break;
				case 9:
					data.fPos += 4;
					break;
				case 10:
					data.fPos += 5;
					data.oPos += 1;
					break;
				case 12:
					data.oPos += 4;
					break;
				case 13:
					break;
				case 14:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 15:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 16:
					data.oPos += 4;
					data.iPos += 1;
					data.fPos += 2;
					data.bPos += 1;
					break;
				case 17:
					data.fPos += 2;
					break;
				case 18:
					data.fPos += 2;
					break;
				case 19:
					data.oPos += 1;
					break;
				case 20:
					data.oPos += 1;
					break;
				case 21:case 22:
					break;
				default:
				}
				data.prev = openfl_display__$internal_DrawCommandType.WINDING_EVEN_ODD;
				var c19 = data;
				this.windingEvenOdd();
				break;
			case 22:
				switch(data.prev._hx_index) {
				case 0:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 1:
					data.iPos += 1;
					data.fPos += 1;
					break;
				case 2:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 3:
					data.oPos += 1;
					break;
				case 4:
					data.fPos += 6;
					break;
				case 5:
					data.fPos += 4;
					break;
				case 6:
					data.fPos += 3;
					break;
				case 7:
					data.fPos += 4;
					break;
				case 8:
					data.oPos += 3;
					break;
				case 9:
					data.fPos += 4;
					break;
				case 10:
					data.fPos += 5;
					data.oPos += 1;
					break;
				case 12:
					data.oPos += 4;
					break;
				case 13:
					break;
				case 14:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 15:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 16:
					data.oPos += 4;
					data.iPos += 1;
					data.fPos += 2;
					data.bPos += 1;
					break;
				case 17:
					data.fPos += 2;
					break;
				case 18:
					data.fPos += 2;
					break;
				case 19:
					data.oPos += 1;
					break;
				case 20:
					data.oPos += 1;
					break;
				case 21:case 22:
					break;
				default:
				}
				data.prev = openfl_display__$internal_DrawCommandType.WINDING_NON_ZERO;
				var c20 = data;
				this.windingNonZero();
				break;
			default:
			}
		}
		data.destroy();
		return other;
	}
	,beginBitmapFill: function(bitmap,matrix,repeat,smooth) {
		this.prepareWrite();
		this.types.push(openfl_display__$internal_DrawCommandType.BEGIN_BITMAP_FILL);
		this.o.push(bitmap);
		this.o.push(matrix);
		this.b.push(repeat);
		this.b.push(smooth);
	}
	,beginFill: function(color,alpha) {
		this.prepareWrite();
		this.types.push(openfl_display__$internal_DrawCommandType.BEGIN_FILL);
		this.i.push(color);
		this.f.push(alpha);
	}
	,beginGradientFill: function(type,colors,alphas,ratios,matrix,spreadMethod,interpolationMethod,focalPointRatio) {
		this.prepareWrite();
		this.types.push(openfl_display__$internal_DrawCommandType.BEGIN_GRADIENT_FILL);
		this.o.push(type);
		this.ii.push(colors);
		this.ff.push(alphas);
		this.ii.push(ratios);
		this.o.push(matrix);
		this.o.push(spreadMethod);
		this.o.push(interpolationMethod);
		this.f.push(focalPointRatio);
	}
	,beginShaderFill: function(shaderBuffer) {
		this.prepareWrite();
		this.types.push(openfl_display__$internal_DrawCommandType.BEGIN_SHADER_FILL);
		this.o.push(shaderBuffer);
	}
	,clear: function() {
		this.types = openfl_display__$internal_DrawCommandBuffer.empty.types;
		this.b = openfl_display__$internal_DrawCommandBuffer.empty.b;
		this.i = openfl_display__$internal_DrawCommandBuffer.empty.i;
		this.f = openfl_display__$internal_DrawCommandBuffer.empty.f;
		this.o = openfl_display__$internal_DrawCommandBuffer.empty.o;
		this.ff = openfl_display__$internal_DrawCommandBuffer.empty.ff;
		this.ii = openfl_display__$internal_DrawCommandBuffer.empty.ii;
		this.copyOnWrite = true;
	}
	,copy: function() {
		var copy = new openfl_display__$internal_DrawCommandBuffer();
		copy.append(this);
		return copy;
	}
	,cubicCurveTo: function(controlX1,controlY1,controlX2,controlY2,anchorX,anchorY) {
		this.prepareWrite();
		this.types.push(openfl_display__$internal_DrawCommandType.CUBIC_CURVE_TO);
		this.f.push(controlX1);
		this.f.push(controlY1);
		this.f.push(controlX2);
		this.f.push(controlY2);
		this.f.push(anchorX);
		this.f.push(anchorY);
	}
	,curveTo: function(controlX,controlY,anchorX,anchorY) {
		this.prepareWrite();
		this.types.push(openfl_display__$internal_DrawCommandType.CURVE_TO);
		this.f.push(controlX);
		this.f.push(controlY);
		this.f.push(anchorX);
		this.f.push(anchorY);
	}
	,destroy: function() {
		this.clear();
		this.types = null;
		this.b = null;
		this.i = null;
		this.f = null;
		this.o = null;
		this.ff = null;
		this.ii = null;
	}
	,drawCircle: function(x,y,radius) {
		this.prepareWrite();
		this.types.push(openfl_display__$internal_DrawCommandType.DRAW_CIRCLE);
		this.f.push(x);
		this.f.push(y);
		this.f.push(radius);
	}
	,drawEllipse: function(x,y,width,height) {
		this.prepareWrite();
		this.types.push(openfl_display__$internal_DrawCommandType.DRAW_ELLIPSE);
		this.f.push(x);
		this.f.push(y);
		this.f.push(width);
		this.f.push(height);
	}
	,drawQuads: function(rects,indices,transforms) {
		this.prepareWrite();
		this.types.push(openfl_display__$internal_DrawCommandType.DRAW_QUADS);
		this.o.push(rects);
		this.o.push(indices);
		this.o.push(transforms);
	}
	,drawRect: function(x,y,width,height) {
		this.prepareWrite();
		this.types.push(openfl_display__$internal_DrawCommandType.DRAW_RECT);
		this.f.push(x);
		this.f.push(y);
		this.f.push(width);
		this.f.push(height);
	}
	,drawRoundRect: function(x,y,width,height,ellipseWidth,ellipseHeight) {
		this.prepareWrite();
		this.types.push(openfl_display__$internal_DrawCommandType.DRAW_ROUND_RECT);
		this.f.push(x);
		this.f.push(y);
		this.f.push(width);
		this.f.push(height);
		this.f.push(ellipseWidth);
		this.o.push(ellipseHeight);
	}
	,drawTriangles: function(vertices,indices,uvtData,culling) {
		this.prepareWrite();
		this.types.push(openfl_display__$internal_DrawCommandType.DRAW_TRIANGLES);
		this.o.push(vertices);
		this.o.push(indices);
		this.o.push(uvtData);
		this.o.push(culling);
	}
	,endFill: function() {
		this.prepareWrite();
		this.types.push(openfl_display__$internal_DrawCommandType.END_FILL);
	}
	,lineBitmapStyle: function(bitmap,matrix,repeat,smooth) {
		this.prepareWrite();
		this.types.push(openfl_display__$internal_DrawCommandType.LINE_BITMAP_STYLE);
		this.o.push(bitmap);
		this.o.push(matrix);
		this.b.push(repeat);
		this.b.push(smooth);
	}
	,lineGradientStyle: function(type,colors,alphas,ratios,matrix,spreadMethod,interpolationMethod,focalPointRatio) {
		this.prepareWrite();
		this.types.push(openfl_display__$internal_DrawCommandType.LINE_GRADIENT_STYLE);
		this.o.push(type);
		this.ii.push(colors);
		this.ff.push(alphas);
		this.ii.push(ratios);
		this.o.push(matrix);
		this.o.push(spreadMethod);
		this.o.push(interpolationMethod);
		this.f.push(focalPointRatio);
	}
	,lineStyle: function(thickness,color,alpha,pixelHinting,scaleMode,caps,joints,miterLimit) {
		this.prepareWrite();
		this.types.push(openfl_display__$internal_DrawCommandType.LINE_STYLE);
		this.o.push(thickness);
		this.i.push(color);
		this.f.push(alpha);
		this.b.push(pixelHinting);
		this.o.push(scaleMode);
		this.o.push(caps);
		this.o.push(joints);
		this.f.push(miterLimit);
	}
	,lineTo: function(x,y) {
		this.prepareWrite();
		this.types.push(openfl_display__$internal_DrawCommandType.LINE_TO);
		this.f.push(x);
		this.f.push(y);
	}
	,moveTo: function(x,y) {
		this.prepareWrite();
		this.types.push(openfl_display__$internal_DrawCommandType.MOVE_TO);
		this.f.push(x);
		this.f.push(y);
	}
	,prepareWrite: function() {
		if(this.copyOnWrite) {
			this.types = this.types.slice();
			this.b = this.b.slice();
			this.i = this.i.slice();
			this.f = this.f.slice();
			this.o = this.o.slice();
			this.ff = this.ff.slice();
			this.ii = this.ii.slice();
			this.copyOnWrite = false;
		}
	}
	,overrideBlendMode: function(blendMode) {
		this.prepareWrite();
		this.types.push(openfl_display__$internal_DrawCommandType.OVERRIDE_BLEND_MODE);
		this.o.push(blendMode);
	}
	,overrideMatrix: function(matrix) {
		this.prepareWrite();
		this.types.push(openfl_display__$internal_DrawCommandType.OVERRIDE_MATRIX);
		this.o.push(matrix);
	}
	,windingEvenOdd: function() {
		this.prepareWrite();
		this.types.push(openfl_display__$internal_DrawCommandType.WINDING_EVEN_ODD);
	}
	,windingNonZero: function() {
		this.prepareWrite();
		this.types.push(openfl_display__$internal_DrawCommandType.WINDING_NON_ZERO);
	}
	,get_length: function() {
		return this.types.length;
	}
	,__class__: openfl_display__$internal_DrawCommandBuffer
	,__properties__: {get_length:"get_length"}
};
var openfl_display__$internal_CanvasGraphics = function() { };
$hxClasses["openfl.display._internal.CanvasGraphics"] = openfl_display__$internal_CanvasGraphics;
openfl_display__$internal_CanvasGraphics.__name__ = "openfl.display._internal.CanvasGraphics";
openfl_display__$internal_CanvasGraphics.closePath = function(strokeBefore) {
	if(strokeBefore == null) {
		strokeBefore = false;
	}
	if(openfl_display__$internal_CanvasGraphics.context.strokeStyle == null) {
		return;
	}
	if(!strokeBefore) {
		openfl_display__$internal_CanvasGraphics.context.closePath();
	}
	if(!openfl_display__$internal_CanvasGraphics.hitTesting && openfl_display__$internal_CanvasGraphics.strokePattern != null) {
		var scale9Grid = openfl_display__$internal_CanvasGraphics.graphics.__owner.__scale9Grid;
		var hasScale9Grid = scale9Grid != null && !openfl_display__$internal_CanvasGraphics.graphics.__owner.__isMask && openfl_display__$internal_CanvasGraphics.graphics.__worldTransform.b == 0 && openfl_display__$internal_CanvasGraphics.graphics.__worldTransform.c == 0;
		if(openfl_display__$internal_CanvasGraphics.bitmapStrokeMatrix != null || hasScale9Grid && openfl_display__$internal_CanvasGraphics.strokeScale9Bounds != null && openfl_display__$internal_CanvasGraphics.bitmapStroke != null) {
			var matrix = openfl_geom_Matrix.__pool.get();
			if(openfl_display__$internal_CanvasGraphics.bitmapStrokeMatrix != null) {
				matrix.copyFrom(openfl_display__$internal_CanvasGraphics.bitmapStrokeMatrix);
			} else {
				matrix.identity();
			}
			if(hasScale9Grid && openfl_display__$internal_CanvasGraphics.strokeScale9Bounds != null && openfl_display__$internal_CanvasGraphics.bitmapStroke != null) {
				var scaleX = openfl_display__$internal_CanvasGraphics.strokeScale9Bounds.getScaleX();
				var scaleY = openfl_display__$internal_CanvasGraphics.strokeScale9Bounds.getScaleY();
				if(scaleX > 0.0 && scaleY > 0.0) {
					matrix.scale(scaleX,scaleY);
				}
			}
			var strokePatternMatrix = new DOMMatrix([matrix.a,matrix.b,matrix.c,matrix.d,matrix.tx,matrix.ty]);
			openfl_display__$internal_CanvasGraphics.strokePattern.setTransform(strokePatternMatrix);
			openfl_geom_Matrix.__pool.release(matrix);
		}
	}
	openfl_display__$internal_CanvasGraphics.context.stroke();
	if(strokeBefore) {
		openfl_display__$internal_CanvasGraphics.context.closePath();
	}
	openfl_display__$internal_CanvasGraphics.context.beginPath();
};
openfl_display__$internal_CanvasGraphics.createBitmapFill = function(bitmap,bitmapRepeat,smooth) {
	lime__$internal_graphics_ImageCanvasUtil.convertToCanvas(bitmap.image);
	openfl_display__$internal_CanvasGraphics.setSmoothing(smooth);
	return openfl_display__$internal_CanvasGraphics.context.createPattern(bitmap.image.get_src(),bitmapRepeat ? "repeat" : "no-repeat");
};
openfl_display__$internal_CanvasGraphics.createGradientPattern = function(type,colors,alphas,ratios,matrix,spreadMethod,interpolationMethod,focalPointRatio) {
	var gradientFill = null;
	var point = null;
	var point2 = null;
	var releaseMatrix = false;
	var ratio = 0.0;
	if(matrix == null) {
		matrix = openfl_geom_Matrix.__pool.get();
		matrix.identity();
		releaseMatrix = true;
	}
	switch(type) {
	case 0:
		if(spreadMethod == 0) {
			point = openfl_geom_Point.__pool.get();
			point.setTo(-819.2,0);
			var px = point.x;
			var py = point.y;
			point.x = px * matrix.a + py * matrix.c + matrix.tx;
			point.y = px * matrix.b + py * matrix.d + matrix.ty;
			point2 = openfl_geom_Point.__pool.get();
			point2.setTo(819.2,0);
			var px = point2.x;
			var py = point2.y;
			point2.x = px * matrix.a + py * matrix.c + matrix.tx;
			point2.y = px * matrix.b + py * matrix.d + matrix.ty;
			var scale9Grid = openfl_display__$internal_CanvasGraphics.graphics.__owner.__scale9Grid;
			var hasScale9Grid = scale9Grid != null && !openfl_display__$internal_CanvasGraphics.graphics.__owner.__isMask && openfl_display__$internal_CanvasGraphics.graphics.__worldTransform.b == 0 && openfl_display__$internal_CanvasGraphics.graphics.__worldTransform.c == 0;
			if(hasScale9Grid) {
				point.x = openfl_display__$internal_CanvasGraphics.toScale9Position(point.x,scale9Grid.x,scale9Grid.width,openfl_display__$internal_CanvasGraphics.bounds.width,openfl_display__$internal_CanvasGraphics.graphics.__owner.get_scaleX());
				point.y = openfl_display__$internal_CanvasGraphics.toScale9Position(point.y,scale9Grid.y,scale9Grid.height,openfl_display__$internal_CanvasGraphics.bounds.height,openfl_display__$internal_CanvasGraphics.graphics.__owner.get_scaleY());
				point2.x = openfl_display__$internal_CanvasGraphics.toScale9Position(point2.x,scale9Grid.x,scale9Grid.width,openfl_display__$internal_CanvasGraphics.bounds.width,openfl_display__$internal_CanvasGraphics.graphics.__owner.get_scaleX());
				point2.y = openfl_display__$internal_CanvasGraphics.toScale9Position(point2.y,scale9Grid.y,scale9Grid.height,openfl_display__$internal_CanvasGraphics.bounds.height,openfl_display__$internal_CanvasGraphics.graphics.__owner.get_scaleY());
			}
			gradientFill = openfl_display__$internal_CanvasGraphics.context.createLinearGradient(point.x,point.y,point2.x,point2.y);
			openfl_display__$internal_CanvasGraphics.pendingMatrix = null;
			openfl_display__$internal_CanvasGraphics.inversePendingMatrix = null;
			var _g = 0;
			var _g1 = colors.length;
			while(_g < _g1) {
				var i = _g++;
				ratio = ratios[i] / 255;
				if(ratio < 0) {
					ratio = 0;
				} else if(ratio > 1) {
					ratio = 1;
				}
				gradientFill.addColorStop(ratio,openfl_display__$internal_CanvasGraphics.getRGBA(colors[i],alphas[i]));
			}
			if(point != null) {
				openfl_geom_Point.__pool.release(point);
			}
			if(point2 != null) {
				openfl_geom_Point.__pool.release(point2);
			}
			if(releaseMatrix) {
				openfl_geom_Matrix.__pool.release(matrix);
			}
			return gradientFill;
		}
		var gradientScale = spreadMethod == 0 ? 1.0 : 25.0;
		var dx = 0.5 * (gradientScale - 1.0) * 1638.4;
		var canvas = window.document.createElement("canvas");
		var context2 = canvas.getContext("2d");
		var dimensions = openfl_display__$internal_CanvasGraphics.getDimensions(matrix);
		canvas.width = openfl_display__$internal_CanvasGraphics.context.canvas.width;
		canvas.height = openfl_display__$internal_CanvasGraphics.context.canvas.height;
		gradientFill = openfl_display__$internal_CanvasGraphics.context.createLinearGradient(-819.2 - dx,0,819.2 + dx,0);
		if(spreadMethod == 1) {
			var t = 0;
			var step = 0.04;
			var a;
			while(t < 1) {
				var _g = 0;
				var _g1 = colors.length;
				while(_g < _g1) {
					var i = _g++;
					ratio = ratios[i] / 255;
					ratio = t + ratio * step;
					if(ratio < 0) {
						ratio = 0;
					} else if(ratio > 1) {
						ratio = 1;
					}
					gradientFill.addColorStop(ratio,openfl_display__$internal_CanvasGraphics.getRGBA(colors[i],alphas[i]));
				}
				t += step;
				a = colors.length - 1;
				while(a >= 0) {
					ratio = ratios[a] / 255;
					ratio = t + (1.0 - ratio) * step;
					if(ratio < 0) {
						ratio = 0;
					} else if(ratio > 1) {
						ratio = 1;
					}
					gradientFill.addColorStop(ratio,openfl_display__$internal_CanvasGraphics.getRGBA(colors[a],alphas[a]));
					--a;
				}
				t += step;
			}
		} else if(spreadMethod == 2) {
			var t = 0;
			var step = 0.04;
			var a;
			while(t < 1) {
				var _g = 0;
				var _g1 = colors.length;
				while(_g < _g1) {
					var i = _g++;
					ratio = ratios[i] / 255;
					ratio = t + ratio * step;
					if(ratio < 0) {
						ratio = 0;
					} else if(ratio > 1) {
						ratio = 0.999;
					}
					gradientFill.addColorStop(ratio,openfl_display__$internal_CanvasGraphics.getRGBA(colors[i],alphas[i]));
				}
				ratio = t + 0.001;
				if(ratio < 0) {
					ratio = 0;
				} else if(ratio > 1) {
					ratio = 1;
				}
				gradientFill.addColorStop(ratio - 0.001,openfl_display__$internal_CanvasGraphics.getRGBA(colors[colors.length - 1],alphas[alphas.length - 1]));
				gradientFill.addColorStop(ratio,openfl_display__$internal_CanvasGraphics.getRGBA(colors[0],alphas[0]));
				t += step;
			}
		}
		openfl_display__$internal_CanvasGraphics.pendingMatrix = new openfl_geom_Matrix();
		openfl_display__$internal_CanvasGraphics.pendingMatrix.tx = matrix.tx - dimensions.width / 2;
		openfl_display__$internal_CanvasGraphics.pendingMatrix.ty = matrix.ty - dimensions.height / 2;
		openfl_display__$internal_CanvasGraphics.inversePendingMatrix = openfl_display__$internal_CanvasGraphics.pendingMatrix.clone();
		openfl_display__$internal_CanvasGraphics.inversePendingMatrix.invert();
		var path = new Path2D();
		path.rect(0,0,canvas.width,canvas.height);
		path.closePath();
		var gradientMatrix = new DOMMatrix([matrix.a,matrix.b,matrix.c,matrix.d,matrix.tx,matrix.ty]);
		var inverseMatrix = gradientMatrix.inverse();
		var untransformedPath = new Path2D();
		untransformedPath.addPath(path,inverseMatrix);
		context2.fillStyle = gradientFill;
		context2.setTransform(gradientMatrix.a,gradientMatrix.b,gradientMatrix.c,gradientMatrix.d,gradientMatrix.e,gradientMatrix.f);
		context2.fill(untransformedPath);
		return openfl_display__$internal_CanvasGraphics.context.createPattern(canvas,"no-repeat");
	case 1:
		if(focalPointRatio > 1.0) {
			focalPointRatio = 1.0;
		} else if(focalPointRatio < -1.0) {
			focalPointRatio = -1.0;
		}
		point = openfl_geom_Point.__pool.get();
		point.x = focalPointRatio * 819.2;
		point.y = 0.0;
		var px = point.x;
		var py = point.y;
		point.x = px * matrix.a + py * matrix.c + matrix.tx;
		point.y = px * matrix.b + py * matrix.d + matrix.ty;
		point2 = openfl_geom_Point.__pool.get();
		point2.setTo(0.0,0.0);
		var px = point2.x;
		var py = point2.y;
		point2.x = px * matrix.a + py * matrix.c + matrix.tx;
		point2.y = px * matrix.b + py * matrix.d + matrix.ty;
		var point3 = openfl_geom_Point.__pool.get();
		point3.x = 819.2;
		point3.y = 0.0;
		var px = point3.x;
		var py = point3.y;
		point3.x = px * matrix.a + py * matrix.c + matrix.tx;
		point3.y = px * matrix.b + py * matrix.d + matrix.ty;
		var scale9Grid = openfl_display__$internal_CanvasGraphics.graphics.__owner.__scale9Grid;
		var hasScale9Grid = scale9Grid != null && !openfl_display__$internal_CanvasGraphics.graphics.__owner.__isMask && openfl_display__$internal_CanvasGraphics.graphics.__worldTransform.b == 0 && openfl_display__$internal_CanvasGraphics.graphics.__worldTransform.c == 0;
		if(hasScale9Grid) {
			point.x = openfl_display__$internal_CanvasGraphics.toScale9Position(point.x,scale9Grid.x,scale9Grid.width,openfl_display__$internal_CanvasGraphics.bounds.width,openfl_display__$internal_CanvasGraphics.graphics.__owner.get_scaleX());
			point.y = openfl_display__$internal_CanvasGraphics.toScale9Position(point.y,scale9Grid.y,scale9Grid.height,openfl_display__$internal_CanvasGraphics.bounds.height,openfl_display__$internal_CanvasGraphics.graphics.__owner.get_scaleY());
			point2.x = openfl_display__$internal_CanvasGraphics.toScale9Position(point2.x,scale9Grid.x,scale9Grid.width,openfl_display__$internal_CanvasGraphics.bounds.width,openfl_display__$internal_CanvasGraphics.graphics.__owner.get_scaleX());
			point2.y = openfl_display__$internal_CanvasGraphics.toScale9Position(point2.y,scale9Grid.y,scale9Grid.height,openfl_display__$internal_CanvasGraphics.bounds.height,openfl_display__$internal_CanvasGraphics.graphics.__owner.get_scaleY());
			point3.x = openfl_display__$internal_CanvasGraphics.toScale9Position(point3.x,scale9Grid.x,scale9Grid.width,openfl_display__$internal_CanvasGraphics.bounds.width,openfl_display__$internal_CanvasGraphics.graphics.__owner.get_scaleX());
			point3.y = openfl_display__$internal_CanvasGraphics.toScale9Position(point3.y,scale9Grid.y,scale9Grid.height,openfl_display__$internal_CanvasGraphics.bounds.height,openfl_display__$internal_CanvasGraphics.graphics.__owner.get_scaleY());
		}
		var dx = point3.x - point2.x;
		var dy = point3.y - point2.y;
		openfl_geom_Point.__pool.release(point3);
		var radius = Math.sqrt(dx * dx + dy * dy);
		gradientFill = openfl_display__$internal_CanvasGraphics.context.createRadialGradient(point.x,point.y,0.0,point2.x,point2.y,radius);
		openfl_display__$internal_CanvasGraphics.pendingMatrix = null;
		openfl_display__$internal_CanvasGraphics.inversePendingMatrix = null;
		var _g = 0;
		var _g1 = colors.length;
		while(_g < _g1) {
			var i = _g++;
			ratio = ratios[i] / 255;
			if(ratio < 0) {
				ratio = 0;
			} else if(ratio > 1) {
				ratio = 1;
			}
			gradientFill.addColorStop(ratio,openfl_display__$internal_CanvasGraphics.getRGBA(colors[i],alphas[i]));
		}
		if(point != null) {
			openfl_geom_Point.__pool.release(point);
		}
		if(point2 != null) {
			openfl_geom_Point.__pool.release(point2);
		}
		if(releaseMatrix) {
			openfl_geom_Matrix.__pool.release(matrix);
		}
		return gradientFill;
	}
};
openfl_display__$internal_CanvasGraphics.getRGBA = function(color,alpha) {
	var r = (color & 16711680) >>> 16;
	var g = (color & 65280) >>> 8;
	var b = color & 255;
	return "rgba(" + (r == null ? "null" : Std.string(UInt.toFloat(r))) + ", " + (g == null ? "null" : Std.string(UInt.toFloat(g))) + ", " + (b == null ? "null" : Std.string(UInt.toFloat(b))) + ", " + alpha + ")";
};
openfl_display__$internal_CanvasGraphics.getDimensions = function(matrix) {
	var angle = Math.atan2(matrix.c,matrix.a);
	var cos = Math.cos(angle);
	var w = matrix.a / cos * 1638.4;
	var h = matrix.d / cos * 1638.4;
	if(w == 0 && h == 0) {
		h = 819.2;
		w = h;
	}
	return { width : w, height : h};
};
openfl_display__$internal_CanvasGraphics.createTempPatternCanvas = function(bitmap,repeat,width,height) {
	var canvas = window.document.createElement("canvas");
	var context = canvas.getContext("2d");
	canvas.width = width;
	canvas.height = height;
	var tmp = bitmap.image.get_src();
	context.fillStyle = context.createPattern(tmp,repeat ? "repeat" : "no-repeat");
	context.beginPath();
	context.moveTo(0,0);
	context.lineTo(0,height);
	context.lineTo(width,height);
	context.lineTo(width,0);
	context.lineTo(0,0);
	context.closePath();
	if(!openfl_display__$internal_CanvasGraphics.hitTesting) {
		context.fill(openfl_display__$internal_CanvasGraphics.windingRule);
	}
	return canvas;
};
openfl_display__$internal_CanvasGraphics.drawRoundRect = function(x,y,width,height,ellipseWidth,ellipseHeight,scale9Grid,scale9UnscaledWidth,scale9UnscaledHeight,scaleX,scaleY) {
	if(ellipseHeight == null) {
		ellipseHeight = ellipseWidth;
	}
	ellipseWidth *= 0.5;
	ellipseHeight *= 0.5;
	if(ellipseWidth > width / 2) {
		ellipseWidth = width / 2;
	}
	if(ellipseHeight > height / 2) {
		ellipseHeight = height / 2;
	}
	if(scale9Grid != null) {
		var scaledLeft = openfl_display__$internal_CanvasGraphics.toScale9Position(x,scale9Grid.x,scale9Grid.width,scale9UnscaledWidth,scaleX);
		var scaledTop = openfl_display__$internal_CanvasGraphics.toScale9Position(y,scale9Grid.y,scale9Grid.height,scale9UnscaledHeight,scaleY);
		var scaledRight = openfl_display__$internal_CanvasGraphics.toScale9Position(x + width,scale9Grid.x,scale9Grid.width,scale9UnscaledWidth,scaleX);
		var scaledBottom = openfl_display__$internal_CanvasGraphics.toScale9Position(y + height,scale9Grid.y,scale9Grid.height,scale9UnscaledHeight,scaleY);
		if(openfl_display__$internal_CanvasGraphics.fillScale9Bounds != null && openfl_display__$internal_CanvasGraphics.bitmapFill != null || openfl_display__$internal_CanvasGraphics.strokeScale9Bounds != null && openfl_display__$internal_CanvasGraphics.bitmapStroke != null) {
			openfl_display__$internal_CanvasGraphics.applyScale9GridUnscaledX(x);
			openfl_display__$internal_CanvasGraphics.applyScale9GridUnscaledY(y);
			openfl_display__$internal_CanvasGraphics.applyScale9GridUnscaledX(x + width);
			openfl_display__$internal_CanvasGraphics.applyScale9GridUnscaledY(y + height);
			openfl_display__$internal_CanvasGraphics.applyScale9GridScaledX(scaledLeft);
			openfl_display__$internal_CanvasGraphics.applyScale9GridScaledY(scaledTop);
			openfl_display__$internal_CanvasGraphics.applyScale9GridScaledX(scaledRight);
			openfl_display__$internal_CanvasGraphics.applyScale9GridScaledY(scaledBottom);
		}
		var scaledLeftX = openfl_display__$internal_CanvasGraphics.toScale9Position(x + ellipseWidth,scale9Grid.x,scale9Grid.width,scale9UnscaledWidth,scaleX);
		var scaledTopY = openfl_display__$internal_CanvasGraphics.toScale9Position(y + ellipseHeight,scale9Grid.y,scale9Grid.height,scale9UnscaledHeight,scaleY);
		var scaledRightX = openfl_display__$internal_CanvasGraphics.toScale9Position(x + width - ellipseWidth,scale9Grid.x,scale9Grid.width,scale9UnscaledWidth,scaleX);
		var scaledBottomY = openfl_display__$internal_CanvasGraphics.toScale9Position(y + height - ellipseHeight,scale9Grid.y,scale9Grid.height,scale9UnscaledHeight,scaleY);
		openfl_display__$internal_CanvasGraphics.context.moveTo(scaledLeftX,scaledTop);
		openfl_display__$internal_CanvasGraphics.context.lineTo(scaledRightX,scaledTop);
		openfl_display__$internal_CanvasGraphics.context.quadraticCurveTo(scaledRight,scaledTop,scaledRight,scaledTopY);
		openfl_display__$internal_CanvasGraphics.context.lineTo(scaledRight,scaledBottomY);
		openfl_display__$internal_CanvasGraphics.context.quadraticCurveTo(scaledRight,scaledBottom,scaledRightX,scaledBottom);
		openfl_display__$internal_CanvasGraphics.context.lineTo(scaledLeftX,scaledBottom);
		openfl_display__$internal_CanvasGraphics.context.quadraticCurveTo(scaledLeft,scaledBottom,scaledLeft,scaledBottomY);
		openfl_display__$internal_CanvasGraphics.context.lineTo(scaledLeft,scaledTopY);
		openfl_display__$internal_CanvasGraphics.context.quadraticCurveTo(scaledLeft,scaledTop,scaledLeftX,scaledTop);
	} else {
		var xe = x + width;
		var ye = y + height;
		var cx1 = -ellipseWidth + ellipseWidth * 0.70710678118654752440084436210485;
		var cx2 = -ellipseWidth + ellipseWidth * 0.4142135623730950488016887242097;
		var cy1 = -ellipseHeight + ellipseHeight * 0.70710678118654752440084436210485;
		var cy2 = -ellipseHeight + ellipseHeight * 0.4142135623730950488016887242097;
		openfl_display__$internal_CanvasGraphics.context.moveTo(xe,ye - ellipseHeight);
		openfl_display__$internal_CanvasGraphics.context.quadraticCurveTo(xe,ye + cy2,xe + cx1,ye + cy1);
		openfl_display__$internal_CanvasGraphics.context.quadraticCurveTo(xe + cx2,ye,xe - ellipseWidth,ye);
		openfl_display__$internal_CanvasGraphics.context.lineTo(x + ellipseWidth,ye);
		openfl_display__$internal_CanvasGraphics.context.quadraticCurveTo(x - cx2,ye,x - cx1,ye + cy1);
		openfl_display__$internal_CanvasGraphics.context.quadraticCurveTo(x,ye + cy2,x,ye - ellipseHeight);
		openfl_display__$internal_CanvasGraphics.context.lineTo(x,y + ellipseHeight);
		openfl_display__$internal_CanvasGraphics.context.quadraticCurveTo(x,y - cy2,x - cx1,y - cy1);
		openfl_display__$internal_CanvasGraphics.context.quadraticCurveTo(x - cx2,y,x + ellipseWidth,y);
		openfl_display__$internal_CanvasGraphics.context.lineTo(xe - ellipseWidth,y);
		openfl_display__$internal_CanvasGraphics.context.quadraticCurveTo(xe + cx2,y,xe + cx1,y - cy1);
		openfl_display__$internal_CanvasGraphics.context.quadraticCurveTo(xe,y - cy2,xe,y + ellipseHeight);
		openfl_display__$internal_CanvasGraphics.context.lineTo(xe,ye - ellipseHeight);
	}
};
openfl_display__$internal_CanvasGraphics.endFill = function() {
	openfl_display__$internal_CanvasGraphics.context.beginPath();
	openfl_display__$internal_CanvasGraphics.playCommands(openfl_display__$internal_CanvasGraphics.fillCommands,false);
	openfl_display__$internal_CanvasGraphics.fillCommands.clear();
};
openfl_display__$internal_CanvasGraphics.endStroke = function() {
	openfl_display__$internal_CanvasGraphics.context.beginPath();
	openfl_display__$internal_CanvasGraphics.playCommands(openfl_display__$internal_CanvasGraphics.strokeCommands,true);
	openfl_display__$internal_CanvasGraphics.context.closePath();
	openfl_display__$internal_CanvasGraphics.strokeCommands.clear();
};
openfl_display__$internal_CanvasGraphics.toScale9Position = function(pos,scale9Start,scale9Center,unscaledSize,scale) {
	if(scale <= 0.0) {
		return 0.0;
	}
	var scale9End = unscaledSize - scale9Center - scale9Start;
	var size = unscaledSize * scale;
	var center = size - scale9Start - scale9End;
	if(pos <= scale9Start) {
		if(center < 0.0) {
			return pos * (scale9Start + scale9End + center) / (scale9Start + scale9End);
		}
		return pos;
	}
	if(pos >= scale9Start + scale9Center) {
		if(center < 0.0) {
			return (scale9Start + (pos - scale9Start - scale9Center)) * (scale9Start + scale9End + center) / (scale9Start + scale9End);
		}
		return scale9Start + center + (pos - scale9Start - scale9Center);
	}
	if(center < 0.0) {
		return scale9Start * (scale9Start + scale9End + center) / (scale9Start + scale9End);
	}
	return scale9Start + center * (pos - scale9Start) / scale9Center;
};
openfl_display__$internal_CanvasGraphics.applyScale9GridUnscaledX = function(x) {
	if(openfl_display__$internal_CanvasGraphics.fillScale9Bounds != null && openfl_display__$internal_CanvasGraphics.bitmapFill != null) {
		openfl_display__$internal_CanvasGraphics.fillScale9Bounds.applyUnscaledX(x);
	}
	if(openfl_display__$internal_CanvasGraphics.strokeScale9Bounds != null && openfl_display__$internal_CanvasGraphics.bitmapStroke != null) {
		openfl_display__$internal_CanvasGraphics.strokeScale9Bounds.applyUnscaledX(x);
	}
};
openfl_display__$internal_CanvasGraphics.applyScale9GridUnscaledY = function(y) {
	if(openfl_display__$internal_CanvasGraphics.fillScale9Bounds != null && openfl_display__$internal_CanvasGraphics.bitmapFill != null) {
		openfl_display__$internal_CanvasGraphics.fillScale9Bounds.applyUnscaledY(y);
	}
	if(openfl_display__$internal_CanvasGraphics.strokeScale9Bounds != null && openfl_display__$internal_CanvasGraphics.bitmapStroke != null) {
		openfl_display__$internal_CanvasGraphics.strokeScale9Bounds.applyUnscaledY(y);
	}
};
openfl_display__$internal_CanvasGraphics.applyScale9GridScaledX = function(x) {
	if(openfl_display__$internal_CanvasGraphics.fillScale9Bounds != null && openfl_display__$internal_CanvasGraphics.bitmapFill != null) {
		openfl_display__$internal_CanvasGraphics.fillScale9Bounds.applyScaledX(x);
	}
	if(openfl_display__$internal_CanvasGraphics.strokeScale9Bounds != null && openfl_display__$internal_CanvasGraphics.bitmapStroke != null) {
		openfl_display__$internal_CanvasGraphics.strokeScale9Bounds.applyScaledX(x);
	}
};
openfl_display__$internal_CanvasGraphics.applyScale9GridScaledY = function(y) {
	if(openfl_display__$internal_CanvasGraphics.fillScale9Bounds != null && openfl_display__$internal_CanvasGraphics.bitmapFill != null) {
		openfl_display__$internal_CanvasGraphics.fillScale9Bounds.applyScaledY(y);
	}
	if(openfl_display__$internal_CanvasGraphics.strokeScale9Bounds != null && openfl_display__$internal_CanvasGraphics.bitmapStroke != null) {
		openfl_display__$internal_CanvasGraphics.strokeScale9Bounds.applyScaledY(y);
	}
};
openfl_display__$internal_CanvasGraphics.hitTest = function(graphics,x,y) {
	openfl_display__$internal_CanvasGraphics.bounds = graphics.__bounds;
	openfl_display__$internal_CanvasGraphics.graphics = graphics;
	if(graphics.__commands.get_length() == 0 || openfl_display__$internal_CanvasGraphics.bounds == null || openfl_display__$internal_CanvasGraphics.bounds.width <= 0 || openfl_display__$internal_CanvasGraphics.bounds.height <= 0) {
		openfl_display__$internal_CanvasGraphics.graphics = null;
		return false;
	} else {
		openfl_display__$internal_CanvasGraphics.hitTesting = true;
		var transform = graphics.__renderTransform;
		var px = x * transform.a + y * transform.c + transform.tx;
		var py = x * transform.b + y * transform.d + transform.ty;
		x = px;
		y = py;
		x -= openfl_display__$internal_CanvasGraphics.bounds.x * transform.a + openfl_display__$internal_CanvasGraphics.bounds.y * transform.c + transform.tx;
		y -= openfl_display__$internal_CanvasGraphics.bounds.x * transform.b + openfl_display__$internal_CanvasGraphics.bounds.y * transform.d + transform.ty;
		var cacheCanvas = graphics.__canvas;
		var cacheContext = graphics.__context;
		graphics.__canvas = openfl_display__$internal_CanvasGraphics.hitTestCanvas;
		graphics.__context = openfl_display__$internal_CanvasGraphics.hitTestContext;
		openfl_display__$internal_CanvasGraphics.context = graphics.__context;
		openfl_display__$internal_CanvasGraphics.context.setTransform(transform.a,transform.b,transform.c,transform.d,transform.tx,transform.ty);
		openfl_display__$internal_CanvasGraphics.fillCommands.clear();
		openfl_display__$internal_CanvasGraphics.strokeCommands.clear();
		openfl_display__$internal_CanvasGraphics.hasFill = false;
		openfl_display__$internal_CanvasGraphics.hasStroke = false;
		openfl_display__$internal_CanvasGraphics.bitmapFill = null;
		openfl_display__$internal_CanvasGraphics.bitmapRepeat = false;
		openfl_display__$internal_CanvasGraphics.windingRule = "evenodd";
		var data = new openfl_display__$internal_DrawCommandReader(graphics.__commands);
		var _g = 0;
		var _g1 = graphics.__commands.types;
		while(_g < _g1.length) {
			var type = _g1[_g];
			++_g;
			switch(type._hx_index) {
			case 0:case 1:case 2:case 3:
				openfl_display__$internal_CanvasGraphics.endFill();
				if(openfl_display__$internal_CanvasGraphics.hasFill && openfl_display__$internal_CanvasGraphics.context.isPointInPath(x,y,openfl_display__$internal_CanvasGraphics.windingRule)) {
					data.destroy();
					graphics.__canvas = cacheCanvas;
					graphics.__context = cacheContext;
					openfl_display__$internal_CanvasGraphics.graphics = null;
					return true;
				}
				openfl_display__$internal_CanvasGraphics.endStroke();
				if(openfl_display__$internal_CanvasGraphics.hasStroke && openfl_display__$internal_CanvasGraphics.context.isPointInStroke(x,y)) {
					data.destroy();
					graphics.__canvas = cacheCanvas;
					graphics.__context = cacheContext;
					openfl_display__$internal_CanvasGraphics.graphics = null;
					return true;
				}
				if(type == openfl_display__$internal_DrawCommandType.BEGIN_BITMAP_FILL) {
					switch(data.prev._hx_index) {
					case 0:
						data.oPos += 2;
						data.bPos += 2;
						break;
					case 1:
						data.iPos += 1;
						data.fPos += 1;
						break;
					case 2:
						data.oPos += 4;
						data.iiPos += 2;
						data.ffPos += 1;
						data.fPos += 1;
						break;
					case 3:
						data.oPos += 1;
						break;
					case 4:
						data.fPos += 6;
						break;
					case 5:
						data.fPos += 4;
						break;
					case 6:
						data.fPos += 3;
						break;
					case 7:
						data.fPos += 4;
						break;
					case 8:
						data.oPos += 3;
						break;
					case 9:
						data.fPos += 4;
						break;
					case 10:
						data.fPos += 5;
						data.oPos += 1;
						break;
					case 12:
						data.oPos += 4;
						break;
					case 13:
						break;
					case 14:
						data.oPos += 2;
						data.bPos += 2;
						break;
					case 15:
						data.oPos += 4;
						data.iiPos += 2;
						data.ffPos += 1;
						data.fPos += 1;
						break;
					case 16:
						data.oPos += 4;
						data.iPos += 1;
						data.fPos += 2;
						data.bPos += 1;
						break;
					case 17:
						data.fPos += 2;
						break;
					case 18:
						data.fPos += 2;
						break;
					case 19:
						data.oPos += 1;
						break;
					case 20:
						data.oPos += 1;
						break;
					case 21:case 22:
						break;
					default:
					}
					data.prev = openfl_display__$internal_DrawCommandType.BEGIN_BITMAP_FILL;
					var c = data;
					openfl_display__$internal_CanvasGraphics.fillCommands.beginBitmapFill(c.buffer.o[c.oPos],c.buffer.o[c.oPos + 1],c.buffer.b[c.bPos],c.buffer.b[c.bPos + 1]);
					openfl_display__$internal_CanvasGraphics.strokeCommands.beginBitmapFill(c.buffer.o[c.oPos],c.buffer.o[c.oPos + 1],c.buffer.b[c.bPos],c.buffer.b[c.bPos + 1]);
				} else if(type == openfl_display__$internal_DrawCommandType.BEGIN_GRADIENT_FILL) {
					switch(data.prev._hx_index) {
					case 0:
						data.oPos += 2;
						data.bPos += 2;
						break;
					case 1:
						data.iPos += 1;
						data.fPos += 1;
						break;
					case 2:
						data.oPos += 4;
						data.iiPos += 2;
						data.ffPos += 1;
						data.fPos += 1;
						break;
					case 3:
						data.oPos += 1;
						break;
					case 4:
						data.fPos += 6;
						break;
					case 5:
						data.fPos += 4;
						break;
					case 6:
						data.fPos += 3;
						break;
					case 7:
						data.fPos += 4;
						break;
					case 8:
						data.oPos += 3;
						break;
					case 9:
						data.fPos += 4;
						break;
					case 10:
						data.fPos += 5;
						data.oPos += 1;
						break;
					case 12:
						data.oPos += 4;
						break;
					case 13:
						break;
					case 14:
						data.oPos += 2;
						data.bPos += 2;
						break;
					case 15:
						data.oPos += 4;
						data.iiPos += 2;
						data.ffPos += 1;
						data.fPos += 1;
						break;
					case 16:
						data.oPos += 4;
						data.iPos += 1;
						data.fPos += 2;
						data.bPos += 1;
						break;
					case 17:
						data.fPos += 2;
						break;
					case 18:
						data.fPos += 2;
						break;
					case 19:
						data.oPos += 1;
						break;
					case 20:
						data.oPos += 1;
						break;
					case 21:case 22:
						break;
					default:
					}
					data.prev = openfl_display__$internal_DrawCommandType.BEGIN_GRADIENT_FILL;
					var c1 = data;
					openfl_display__$internal_CanvasGraphics.fillCommands.beginGradientFill(c1.buffer.o[c1.oPos],c1.buffer.ii[c1.iiPos],c1.buffer.ff[c1.ffPos],c1.buffer.ii[c1.iiPos + 1],c1.buffer.o[c1.oPos + 1],c1.buffer.o[c1.oPos + 2],c1.buffer.o[c1.oPos + 3],c1.buffer.f[c1.fPos]);
					openfl_display__$internal_CanvasGraphics.strokeCommands.beginGradientFill(c1.buffer.o[c1.oPos],c1.buffer.ii[c1.iiPos],c1.buffer.ff[c1.ffPos],c1.buffer.ii[c1.iiPos + 1],c1.buffer.o[c1.oPos + 1],c1.buffer.o[c1.oPos + 2],c1.buffer.o[c1.oPos + 3],c1.buffer.f[c1.fPos]);
				} else if(type == openfl_display__$internal_DrawCommandType.BEGIN_SHADER_FILL) {
					switch(data.prev._hx_index) {
					case 0:
						data.oPos += 2;
						data.bPos += 2;
						break;
					case 1:
						data.iPos += 1;
						data.fPos += 1;
						break;
					case 2:
						data.oPos += 4;
						data.iiPos += 2;
						data.ffPos += 1;
						data.fPos += 1;
						break;
					case 3:
						data.oPos += 1;
						break;
					case 4:
						data.fPos += 6;
						break;
					case 5:
						data.fPos += 4;
						break;
					case 6:
						data.fPos += 3;
						break;
					case 7:
						data.fPos += 4;
						break;
					case 8:
						data.oPos += 3;
						break;
					case 9:
						data.fPos += 4;
						break;
					case 10:
						data.fPos += 5;
						data.oPos += 1;
						break;
					case 12:
						data.oPos += 4;
						break;
					case 13:
						break;
					case 14:
						data.oPos += 2;
						data.bPos += 2;
						break;
					case 15:
						data.oPos += 4;
						data.iiPos += 2;
						data.ffPos += 1;
						data.fPos += 1;
						break;
					case 16:
						data.oPos += 4;
						data.iPos += 1;
						data.fPos += 2;
						data.bPos += 1;
						break;
					case 17:
						data.fPos += 2;
						break;
					case 18:
						data.fPos += 2;
						break;
					case 19:
						data.oPos += 1;
						break;
					case 20:
						data.oPos += 1;
						break;
					case 21:case 22:
						break;
					default:
					}
					data.prev = openfl_display__$internal_DrawCommandType.BEGIN_SHADER_FILL;
					var c2 = data;
					openfl_display__$internal_CanvasGraphics.fillCommands.beginShaderFill(c2.buffer.o[c2.oPos]);
					openfl_display__$internal_CanvasGraphics.strokeCommands.beginShaderFill(c2.buffer.o[c2.oPos]);
				} else {
					switch(data.prev._hx_index) {
					case 0:
						data.oPos += 2;
						data.bPos += 2;
						break;
					case 1:
						data.iPos += 1;
						data.fPos += 1;
						break;
					case 2:
						data.oPos += 4;
						data.iiPos += 2;
						data.ffPos += 1;
						data.fPos += 1;
						break;
					case 3:
						data.oPos += 1;
						break;
					case 4:
						data.fPos += 6;
						break;
					case 5:
						data.fPos += 4;
						break;
					case 6:
						data.fPos += 3;
						break;
					case 7:
						data.fPos += 4;
						break;
					case 8:
						data.oPos += 3;
						break;
					case 9:
						data.fPos += 4;
						break;
					case 10:
						data.fPos += 5;
						data.oPos += 1;
						break;
					case 12:
						data.oPos += 4;
						break;
					case 13:
						break;
					case 14:
						data.oPos += 2;
						data.bPos += 2;
						break;
					case 15:
						data.oPos += 4;
						data.iiPos += 2;
						data.ffPos += 1;
						data.fPos += 1;
						break;
					case 16:
						data.oPos += 4;
						data.iPos += 1;
						data.fPos += 2;
						data.bPos += 1;
						break;
					case 17:
						data.fPos += 2;
						break;
					case 18:
						data.fPos += 2;
						break;
					case 19:
						data.oPos += 1;
						break;
					case 20:
						data.oPos += 1;
						break;
					case 21:case 22:
						break;
					default:
					}
					data.prev = openfl_display__$internal_DrawCommandType.BEGIN_FILL;
					var c3 = data;
					openfl_display__$internal_CanvasGraphics.fillCommands.beginFill(c3.buffer.i[c3.iPos],1);
					openfl_display__$internal_CanvasGraphics.strokeCommands.beginFill(c3.buffer.i[c3.iPos],1);
				}
				break;
			case 4:
				switch(data.prev._hx_index) {
				case 0:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 1:
					data.iPos += 1;
					data.fPos += 1;
					break;
				case 2:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 3:
					data.oPos += 1;
					break;
				case 4:
					data.fPos += 6;
					break;
				case 5:
					data.fPos += 4;
					break;
				case 6:
					data.fPos += 3;
					break;
				case 7:
					data.fPos += 4;
					break;
				case 8:
					data.oPos += 3;
					break;
				case 9:
					data.fPos += 4;
					break;
				case 10:
					data.fPos += 5;
					data.oPos += 1;
					break;
				case 12:
					data.oPos += 4;
					break;
				case 13:
					break;
				case 14:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 15:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 16:
					data.oPos += 4;
					data.iPos += 1;
					data.fPos += 2;
					data.bPos += 1;
					break;
				case 17:
					data.fPos += 2;
					break;
				case 18:
					data.fPos += 2;
					break;
				case 19:
					data.oPos += 1;
					break;
				case 20:
					data.oPos += 1;
					break;
				case 21:case 22:
					break;
				default:
				}
				data.prev = openfl_display__$internal_DrawCommandType.CUBIC_CURVE_TO;
				var c4 = data;
				openfl_display__$internal_CanvasGraphics.fillCommands.cubicCurveTo(c4.buffer.f[c4.fPos],c4.buffer.f[c4.fPos + 1],c4.buffer.f[c4.fPos + 2],c4.buffer.f[c4.fPos + 3],c4.buffer.f[c4.fPos + 4],c4.buffer.f[c4.fPos + 5]);
				openfl_display__$internal_CanvasGraphics.strokeCommands.cubicCurveTo(c4.buffer.f[c4.fPos],c4.buffer.f[c4.fPos + 1],c4.buffer.f[c4.fPos + 2],c4.buffer.f[c4.fPos + 3],c4.buffer.f[c4.fPos + 4],c4.buffer.f[c4.fPos + 5]);
				break;
			case 5:
				switch(data.prev._hx_index) {
				case 0:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 1:
					data.iPos += 1;
					data.fPos += 1;
					break;
				case 2:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 3:
					data.oPos += 1;
					break;
				case 4:
					data.fPos += 6;
					break;
				case 5:
					data.fPos += 4;
					break;
				case 6:
					data.fPos += 3;
					break;
				case 7:
					data.fPos += 4;
					break;
				case 8:
					data.oPos += 3;
					break;
				case 9:
					data.fPos += 4;
					break;
				case 10:
					data.fPos += 5;
					data.oPos += 1;
					break;
				case 12:
					data.oPos += 4;
					break;
				case 13:
					break;
				case 14:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 15:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 16:
					data.oPos += 4;
					data.iPos += 1;
					data.fPos += 2;
					data.bPos += 1;
					break;
				case 17:
					data.fPos += 2;
					break;
				case 18:
					data.fPos += 2;
					break;
				case 19:
					data.oPos += 1;
					break;
				case 20:
					data.oPos += 1;
					break;
				case 21:case 22:
					break;
				default:
				}
				data.prev = openfl_display__$internal_DrawCommandType.CURVE_TO;
				var c5 = data;
				openfl_display__$internal_CanvasGraphics.fillCommands.curveTo(c5.buffer.f[c5.fPos],c5.buffer.f[c5.fPos + 1],c5.buffer.f[c5.fPos + 2],c5.buffer.f[c5.fPos + 3]);
				openfl_display__$internal_CanvasGraphics.strokeCommands.curveTo(c5.buffer.f[c5.fPos],c5.buffer.f[c5.fPos + 1],c5.buffer.f[c5.fPos + 2],c5.buffer.f[c5.fPos + 3]);
				break;
			case 6:
				switch(data.prev._hx_index) {
				case 0:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 1:
					data.iPos += 1;
					data.fPos += 1;
					break;
				case 2:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 3:
					data.oPos += 1;
					break;
				case 4:
					data.fPos += 6;
					break;
				case 5:
					data.fPos += 4;
					break;
				case 6:
					data.fPos += 3;
					break;
				case 7:
					data.fPos += 4;
					break;
				case 8:
					data.oPos += 3;
					break;
				case 9:
					data.fPos += 4;
					break;
				case 10:
					data.fPos += 5;
					data.oPos += 1;
					break;
				case 12:
					data.oPos += 4;
					break;
				case 13:
					break;
				case 14:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 15:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 16:
					data.oPos += 4;
					data.iPos += 1;
					data.fPos += 2;
					data.bPos += 1;
					break;
				case 17:
					data.fPos += 2;
					break;
				case 18:
					data.fPos += 2;
					break;
				case 19:
					data.oPos += 1;
					break;
				case 20:
					data.oPos += 1;
					break;
				case 21:case 22:
					break;
				default:
				}
				data.prev = openfl_display__$internal_DrawCommandType.DRAW_CIRCLE;
				var c6 = data;
				openfl_display__$internal_CanvasGraphics.fillCommands.drawCircle(c6.buffer.f[c6.fPos],c6.buffer.f[c6.fPos + 1],c6.buffer.f[c6.fPos + 2]);
				openfl_display__$internal_CanvasGraphics.strokeCommands.drawCircle(c6.buffer.f[c6.fPos],c6.buffer.f[c6.fPos + 1],c6.buffer.f[c6.fPos + 2]);
				break;
			case 7:
				switch(data.prev._hx_index) {
				case 0:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 1:
					data.iPos += 1;
					data.fPos += 1;
					break;
				case 2:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 3:
					data.oPos += 1;
					break;
				case 4:
					data.fPos += 6;
					break;
				case 5:
					data.fPos += 4;
					break;
				case 6:
					data.fPos += 3;
					break;
				case 7:
					data.fPos += 4;
					break;
				case 8:
					data.oPos += 3;
					break;
				case 9:
					data.fPos += 4;
					break;
				case 10:
					data.fPos += 5;
					data.oPos += 1;
					break;
				case 12:
					data.oPos += 4;
					break;
				case 13:
					break;
				case 14:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 15:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 16:
					data.oPos += 4;
					data.iPos += 1;
					data.fPos += 2;
					data.bPos += 1;
					break;
				case 17:
					data.fPos += 2;
					break;
				case 18:
					data.fPos += 2;
					break;
				case 19:
					data.oPos += 1;
					break;
				case 20:
					data.oPos += 1;
					break;
				case 21:case 22:
					break;
				default:
				}
				data.prev = openfl_display__$internal_DrawCommandType.DRAW_ELLIPSE;
				var c7 = data;
				openfl_display__$internal_CanvasGraphics.fillCommands.drawEllipse(c7.buffer.f[c7.fPos],c7.buffer.f[c7.fPos + 1],c7.buffer.f[c7.fPos + 2],c7.buffer.f[c7.fPos + 3]);
				openfl_display__$internal_CanvasGraphics.strokeCommands.drawEllipse(c7.buffer.f[c7.fPos],c7.buffer.f[c7.fPos + 1],c7.buffer.f[c7.fPos + 2],c7.buffer.f[c7.fPos + 3]);
				break;
			case 9:
				switch(data.prev._hx_index) {
				case 0:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 1:
					data.iPos += 1;
					data.fPos += 1;
					break;
				case 2:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 3:
					data.oPos += 1;
					break;
				case 4:
					data.fPos += 6;
					break;
				case 5:
					data.fPos += 4;
					break;
				case 6:
					data.fPos += 3;
					break;
				case 7:
					data.fPos += 4;
					break;
				case 8:
					data.oPos += 3;
					break;
				case 9:
					data.fPos += 4;
					break;
				case 10:
					data.fPos += 5;
					data.oPos += 1;
					break;
				case 12:
					data.oPos += 4;
					break;
				case 13:
					break;
				case 14:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 15:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 16:
					data.oPos += 4;
					data.iPos += 1;
					data.fPos += 2;
					data.bPos += 1;
					break;
				case 17:
					data.fPos += 2;
					break;
				case 18:
					data.fPos += 2;
					break;
				case 19:
					data.oPos += 1;
					break;
				case 20:
					data.oPos += 1;
					break;
				case 21:case 22:
					break;
				default:
				}
				data.prev = openfl_display__$internal_DrawCommandType.DRAW_RECT;
				var c8 = data;
				openfl_display__$internal_CanvasGraphics.fillCommands.drawRect(c8.buffer.f[c8.fPos],c8.buffer.f[c8.fPos + 1],c8.buffer.f[c8.fPos + 2],c8.buffer.f[c8.fPos + 3]);
				openfl_display__$internal_CanvasGraphics.strokeCommands.drawRect(c8.buffer.f[c8.fPos],c8.buffer.f[c8.fPos + 1],c8.buffer.f[c8.fPos + 2],c8.buffer.f[c8.fPos + 3]);
				break;
			case 10:
				switch(data.prev._hx_index) {
				case 0:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 1:
					data.iPos += 1;
					data.fPos += 1;
					break;
				case 2:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 3:
					data.oPos += 1;
					break;
				case 4:
					data.fPos += 6;
					break;
				case 5:
					data.fPos += 4;
					break;
				case 6:
					data.fPos += 3;
					break;
				case 7:
					data.fPos += 4;
					break;
				case 8:
					data.oPos += 3;
					break;
				case 9:
					data.fPos += 4;
					break;
				case 10:
					data.fPos += 5;
					data.oPos += 1;
					break;
				case 12:
					data.oPos += 4;
					break;
				case 13:
					break;
				case 14:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 15:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 16:
					data.oPos += 4;
					data.iPos += 1;
					data.fPos += 2;
					data.bPos += 1;
					break;
				case 17:
					data.fPos += 2;
					break;
				case 18:
					data.fPos += 2;
					break;
				case 19:
					data.oPos += 1;
					break;
				case 20:
					data.oPos += 1;
					break;
				case 21:case 22:
					break;
				default:
				}
				data.prev = openfl_display__$internal_DrawCommandType.DRAW_ROUND_RECT;
				var c9 = data;
				openfl_display__$internal_CanvasGraphics.fillCommands.drawRoundRect(c9.buffer.f[c9.fPos],c9.buffer.f[c9.fPos + 1],c9.buffer.f[c9.fPos + 2],c9.buffer.f[c9.fPos + 3],c9.buffer.f[c9.fPos + 4],c9.buffer.o[c9.oPos]);
				openfl_display__$internal_CanvasGraphics.strokeCommands.drawRoundRect(c9.buffer.f[c9.fPos],c9.buffer.f[c9.fPos + 1],c9.buffer.f[c9.fPos + 2],c9.buffer.f[c9.fPos + 3],c9.buffer.f[c9.fPos + 4],c9.buffer.o[c9.oPos]);
				break;
			case 13:
				switch(data.prev._hx_index) {
				case 0:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 1:
					data.iPos += 1;
					data.fPos += 1;
					break;
				case 2:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 3:
					data.oPos += 1;
					break;
				case 4:
					data.fPos += 6;
					break;
				case 5:
					data.fPos += 4;
					break;
				case 6:
					data.fPos += 3;
					break;
				case 7:
					data.fPos += 4;
					break;
				case 8:
					data.oPos += 3;
					break;
				case 9:
					data.fPos += 4;
					break;
				case 10:
					data.fPos += 5;
					data.oPos += 1;
					break;
				case 12:
					data.oPos += 4;
					break;
				case 13:
					break;
				case 14:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 15:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 16:
					data.oPos += 4;
					data.iPos += 1;
					data.fPos += 2;
					data.bPos += 1;
					break;
				case 17:
					data.fPos += 2;
					break;
				case 18:
					data.fPos += 2;
					break;
				case 19:
					data.oPos += 1;
					break;
				case 20:
					data.oPos += 1;
					break;
				case 21:case 22:
					break;
				default:
				}
				data.prev = openfl_display__$internal_DrawCommandType.END_FILL;
				var this1 = data;
				openfl_display__$internal_CanvasGraphics.endFill();
				if(openfl_display__$internal_CanvasGraphics.hasFill && openfl_display__$internal_CanvasGraphics.context.isPointInPath(x,y,openfl_display__$internal_CanvasGraphics.windingRule)) {
					data.destroy();
					graphics.__canvas = cacheCanvas;
					graphics.__context = cacheContext;
					openfl_display__$internal_CanvasGraphics.graphics = null;
					return true;
				}
				openfl_display__$internal_CanvasGraphics.endStroke();
				if(openfl_display__$internal_CanvasGraphics.hasStroke && openfl_display__$internal_CanvasGraphics.context.isPointInStroke(x,y)) {
					data.destroy();
					graphics.__canvas = cacheCanvas;
					graphics.__context = cacheContext;
					openfl_display__$internal_CanvasGraphics.graphics = null;
					return true;
				}
				openfl_display__$internal_CanvasGraphics.hasFill = false;
				openfl_display__$internal_CanvasGraphics.bitmapFill = null;
				break;
			case 14:
				switch(data.prev._hx_index) {
				case 0:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 1:
					data.iPos += 1;
					data.fPos += 1;
					break;
				case 2:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 3:
					data.oPos += 1;
					break;
				case 4:
					data.fPos += 6;
					break;
				case 5:
					data.fPos += 4;
					break;
				case 6:
					data.fPos += 3;
					break;
				case 7:
					data.fPos += 4;
					break;
				case 8:
					data.oPos += 3;
					break;
				case 9:
					data.fPos += 4;
					break;
				case 10:
					data.fPos += 5;
					data.oPos += 1;
					break;
				case 12:
					data.oPos += 4;
					break;
				case 13:
					break;
				case 14:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 15:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 16:
					data.oPos += 4;
					data.iPos += 1;
					data.fPos += 2;
					data.bPos += 1;
					break;
				case 17:
					data.fPos += 2;
					break;
				case 18:
					data.fPos += 2;
					break;
				case 19:
					data.oPos += 1;
					break;
				case 20:
					data.oPos += 1;
					break;
				case 21:case 22:
					break;
				default:
				}
				data.prev = openfl_display__$internal_DrawCommandType.LINE_BITMAP_STYLE;
				var c10 = data;
				openfl_display__$internal_CanvasGraphics.strokeCommands.lineBitmapStyle(c10.buffer.o[c10.oPos],c10.buffer.o[c10.oPos + 1],c10.buffer.b[c10.bPos],c10.buffer.b[c10.bPos + 1]);
				break;
			case 15:
				switch(data.prev._hx_index) {
				case 0:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 1:
					data.iPos += 1;
					data.fPos += 1;
					break;
				case 2:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 3:
					data.oPos += 1;
					break;
				case 4:
					data.fPos += 6;
					break;
				case 5:
					data.fPos += 4;
					break;
				case 6:
					data.fPos += 3;
					break;
				case 7:
					data.fPos += 4;
					break;
				case 8:
					data.oPos += 3;
					break;
				case 9:
					data.fPos += 4;
					break;
				case 10:
					data.fPos += 5;
					data.oPos += 1;
					break;
				case 12:
					data.oPos += 4;
					break;
				case 13:
					break;
				case 14:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 15:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 16:
					data.oPos += 4;
					data.iPos += 1;
					data.fPos += 2;
					data.bPos += 1;
					break;
				case 17:
					data.fPos += 2;
					break;
				case 18:
					data.fPos += 2;
					break;
				case 19:
					data.oPos += 1;
					break;
				case 20:
					data.oPos += 1;
					break;
				case 21:case 22:
					break;
				default:
				}
				data.prev = openfl_display__$internal_DrawCommandType.LINE_GRADIENT_STYLE;
				var c11 = data;
				openfl_display__$internal_CanvasGraphics.strokeCommands.lineGradientStyle(c11.buffer.o[c11.oPos],c11.buffer.ii[c11.iiPos],c11.buffer.ff[c11.ffPos],c11.buffer.ii[c11.iiPos + 1],c11.buffer.o[c11.oPos + 1],c11.buffer.o[c11.oPos + 2],c11.buffer.o[c11.oPos + 3],c11.buffer.f[c11.fPos]);
				break;
			case 16:
				openfl_display__$internal_CanvasGraphics.endStroke();
				if(openfl_display__$internal_CanvasGraphics.hasStroke && openfl_display__$internal_CanvasGraphics.context.isPointInStroke(x,y)) {
					data.destroy();
					graphics.__canvas = cacheCanvas;
					graphics.__context = cacheContext;
					openfl_display__$internal_CanvasGraphics.graphics = null;
					return true;
				}
				switch(data.prev._hx_index) {
				case 0:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 1:
					data.iPos += 1;
					data.fPos += 1;
					break;
				case 2:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 3:
					data.oPos += 1;
					break;
				case 4:
					data.fPos += 6;
					break;
				case 5:
					data.fPos += 4;
					break;
				case 6:
					data.fPos += 3;
					break;
				case 7:
					data.fPos += 4;
					break;
				case 8:
					data.oPos += 3;
					break;
				case 9:
					data.fPos += 4;
					break;
				case 10:
					data.fPos += 5;
					data.oPos += 1;
					break;
				case 12:
					data.oPos += 4;
					break;
				case 13:
					break;
				case 14:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 15:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 16:
					data.oPos += 4;
					data.iPos += 1;
					data.fPos += 2;
					data.bPos += 1;
					break;
				case 17:
					data.fPos += 2;
					break;
				case 18:
					data.fPos += 2;
					break;
				case 19:
					data.oPos += 1;
					break;
				case 20:
					data.oPos += 1;
					break;
				case 21:case 22:
					break;
				default:
				}
				data.prev = openfl_display__$internal_DrawCommandType.LINE_STYLE;
				var c12 = data;
				openfl_display__$internal_CanvasGraphics.strokeCommands.lineStyle(c12.buffer.o[c12.oPos],c12.buffer.i[c12.iPos],1,c12.buffer.b[c12.bPos],c12.buffer.o[c12.oPos + 1],c12.buffer.o[c12.oPos + 2],c12.buffer.o[c12.oPos + 3],c12.buffer.f[c12.fPos + 1]);
				break;
			case 17:
				switch(data.prev._hx_index) {
				case 0:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 1:
					data.iPos += 1;
					data.fPos += 1;
					break;
				case 2:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 3:
					data.oPos += 1;
					break;
				case 4:
					data.fPos += 6;
					break;
				case 5:
					data.fPos += 4;
					break;
				case 6:
					data.fPos += 3;
					break;
				case 7:
					data.fPos += 4;
					break;
				case 8:
					data.oPos += 3;
					break;
				case 9:
					data.fPos += 4;
					break;
				case 10:
					data.fPos += 5;
					data.oPos += 1;
					break;
				case 12:
					data.oPos += 4;
					break;
				case 13:
					break;
				case 14:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 15:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 16:
					data.oPos += 4;
					data.iPos += 1;
					data.fPos += 2;
					data.bPos += 1;
					break;
				case 17:
					data.fPos += 2;
					break;
				case 18:
					data.fPos += 2;
					break;
				case 19:
					data.oPos += 1;
					break;
				case 20:
					data.oPos += 1;
					break;
				case 21:case 22:
					break;
				default:
				}
				data.prev = openfl_display__$internal_DrawCommandType.LINE_TO;
				var c13 = data;
				openfl_display__$internal_CanvasGraphics.fillCommands.lineTo(c13.buffer.f[c13.fPos],c13.buffer.f[c13.fPos + 1]);
				openfl_display__$internal_CanvasGraphics.strokeCommands.lineTo(c13.buffer.f[c13.fPos],c13.buffer.f[c13.fPos + 1]);
				break;
			case 18:
				switch(data.prev._hx_index) {
				case 0:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 1:
					data.iPos += 1;
					data.fPos += 1;
					break;
				case 2:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 3:
					data.oPos += 1;
					break;
				case 4:
					data.fPos += 6;
					break;
				case 5:
					data.fPos += 4;
					break;
				case 6:
					data.fPos += 3;
					break;
				case 7:
					data.fPos += 4;
					break;
				case 8:
					data.oPos += 3;
					break;
				case 9:
					data.fPos += 4;
					break;
				case 10:
					data.fPos += 5;
					data.oPos += 1;
					break;
				case 12:
					data.oPos += 4;
					break;
				case 13:
					break;
				case 14:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 15:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 16:
					data.oPos += 4;
					data.iPos += 1;
					data.fPos += 2;
					data.bPos += 1;
					break;
				case 17:
					data.fPos += 2;
					break;
				case 18:
					data.fPos += 2;
					break;
				case 19:
					data.oPos += 1;
					break;
				case 20:
					data.oPos += 1;
					break;
				case 21:case 22:
					break;
				default:
				}
				data.prev = openfl_display__$internal_DrawCommandType.MOVE_TO;
				var c14 = data;
				openfl_display__$internal_CanvasGraphics.fillCommands.moveTo(c14.buffer.f[c14.fPos],c14.buffer.f[c14.fPos + 1]);
				openfl_display__$internal_CanvasGraphics.strokeCommands.moveTo(c14.buffer.f[c14.fPos],c14.buffer.f[c14.fPos + 1]);
				break;
			case 21:
				openfl_display__$internal_CanvasGraphics.windingRule = "evenodd";
				break;
			case 22:
				openfl_display__$internal_CanvasGraphics.windingRule = "nonzero";
				break;
			default:
				switch(data.prev._hx_index) {
				case 0:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 1:
					data.iPos += 1;
					data.fPos += 1;
					break;
				case 2:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 3:
					data.oPos += 1;
					break;
				case 4:
					data.fPos += 6;
					break;
				case 5:
					data.fPos += 4;
					break;
				case 6:
					data.fPos += 3;
					break;
				case 7:
					data.fPos += 4;
					break;
				case 8:
					data.oPos += 3;
					break;
				case 9:
					data.fPos += 4;
					break;
				case 10:
					data.fPos += 5;
					data.oPos += 1;
					break;
				case 12:
					data.oPos += 4;
					break;
				case 13:
					break;
				case 14:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 15:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 16:
					data.oPos += 4;
					data.iPos += 1;
					data.fPos += 2;
					data.bPos += 1;
					break;
				case 17:
					data.fPos += 2;
					break;
				case 18:
					data.fPos += 2;
					break;
				case 19:
					data.oPos += 1;
					break;
				case 20:
					data.oPos += 1;
					break;
				case 21:case 22:
					break;
				default:
				}
				data.prev = type;
			}
		}
		var hitTest = false;
		if(openfl_display__$internal_CanvasGraphics.fillCommands.get_length() > 0) {
			openfl_display__$internal_CanvasGraphics.endFill();
		}
		if(openfl_display__$internal_CanvasGraphics.hasFill && openfl_display__$internal_CanvasGraphics.context.isPointInPath(x,y,openfl_display__$internal_CanvasGraphics.windingRule)) {
			hitTest = true;
		}
		if(openfl_display__$internal_CanvasGraphics.strokeCommands.get_length() > 0) {
			openfl_display__$internal_CanvasGraphics.endStroke();
		}
		if(openfl_display__$internal_CanvasGraphics.hasStroke && openfl_display__$internal_CanvasGraphics.context.isPointInStroke(x,y)) {
			hitTest = true;
		}
		data.destroy();
		graphics.__canvas = cacheCanvas;
		graphics.__context = cacheContext;
		openfl_display__$internal_CanvasGraphics.graphics = null;
		return hitTest;
	}
};
openfl_display__$internal_CanvasGraphics.isCCW = function(x1,y1,x2,y2,x3,y3) {
	return (x2 - x1) * (y3 - y1) - (y2 - y1) * (x3 - x1) < 0;
};
openfl_display__$internal_CanvasGraphics.normalizeUVT = function(uvt,skipT) {
	if(skipT == null) {
		skipT = false;
	}
	var max = -Infinity;
	var tmp = -Infinity;
	var len = uvt.get_length();
	var _g = 1;
	var _g1 = len + 1;
	while(_g < _g1) {
		var t = _g++;
		if(skipT && t % 3 == 0) {
			continue;
		}
		tmp = uvt.get(t - 1);
		if(max < tmp) {
			max = tmp;
		}
	}
	if(!skipT) {
		return { max : max, uvt : uvt};
	}
	var result = openfl_Vector.toFloatVector(null);
	var _g = 1;
	var _g1 = len + 1;
	while(_g < _g1) {
		var t = _g++;
		if(skipT && t % 3 == 0) {
			continue;
		}
		result.push(uvt.get(t - 1));
	}
	return { max : max, uvt : result};
};
openfl_display__$internal_CanvasGraphics.playCommands = function(commands,stroke) {
	if(stroke == null) {
		stroke = false;
	}
	openfl_display__$internal_CanvasGraphics.bounds = openfl_display__$internal_CanvasGraphics.graphics.__bounds;
	var offsetX = openfl_display__$internal_CanvasGraphics.bounds.x;
	var offsetY = openfl_display__$internal_CanvasGraphics.bounds.y;
	var positionX = 0.0;
	var positionY = 0.0;
	var closeGap = false;
	var startX = 0.0;
	var startY = 0.0;
	var setStart = false;
	openfl_display__$internal_CanvasGraphics.windingRule = "evenodd";
	openfl_display__$internal_CanvasGraphics.setSmoothing(true);
	var hasPath = false;
	var scale9Grid = openfl_display__$internal_CanvasGraphics.graphics.__owner.__scale9Grid;
	var hasScale9Grid = scale9Grid != null && !openfl_display__$internal_CanvasGraphics.graphics.__owner.__isMask && openfl_display__$internal_CanvasGraphics.graphics.__worldTransform.b == 0 && openfl_display__$internal_CanvasGraphics.graphics.__worldTransform.c == 0;
	if(!hasScale9Grid) {
		scale9Grid = null;
		if(openfl_display__$internal_CanvasGraphics.fillScale9Bounds != null) {
			openfl_display__$internal_CanvasGraphics.fillScale9Bounds.clear();
		}
		if(openfl_display__$internal_CanvasGraphics.strokeScale9Bounds != null) {
			openfl_display__$internal_CanvasGraphics.strokeScale9Bounds.clear();
		}
	}
	var data = new openfl_display__$internal_DrawCommandReader(commands);
	var x;
	var y;
	var width;
	var height;
	var kappa = 0.5522848;
	var ox;
	var oy;
	var xe;
	var ye;
	var xm;
	var ym;
	var r;
	var g;
	var b;
	var optimizationUsed;
	var canOptimizeMatrix;
	var st;
	var sr;
	var sb;
	var sl;
	var stl = null;
	var sbr = null;
	var _g = 0;
	var _g1 = commands.types;
	_hx_loop1: while(_g < _g1.length) {
		var type = _g1[_g];
		++_g;
		switch(type._hx_index) {
		case 0:
			switch(data.prev._hx_index) {
			case 0:
				data.oPos += 2;
				data.bPos += 2;
				break;
			case 1:
				data.iPos += 1;
				data.fPos += 1;
				break;
			case 2:
				data.oPos += 4;
				data.iiPos += 2;
				data.ffPos += 1;
				data.fPos += 1;
				break;
			case 3:
				data.oPos += 1;
				break;
			case 4:
				data.fPos += 6;
				break;
			case 5:
				data.fPos += 4;
				break;
			case 6:
				data.fPos += 3;
				break;
			case 7:
				data.fPos += 4;
				break;
			case 8:
				data.oPos += 3;
				break;
			case 9:
				data.fPos += 4;
				break;
			case 10:
				data.fPos += 5;
				data.oPos += 1;
				break;
			case 12:
				data.oPos += 4;
				break;
			case 13:
				break;
			case 14:
				data.oPos += 2;
				data.bPos += 2;
				break;
			case 15:
				data.oPos += 4;
				data.iiPos += 2;
				data.ffPos += 1;
				data.fPos += 1;
				break;
			case 16:
				data.oPos += 4;
				data.iPos += 1;
				data.fPos += 2;
				data.bPos += 1;
				break;
			case 17:
				data.fPos += 2;
				break;
			case 18:
				data.fPos += 2;
				break;
			case 19:
				data.oPos += 1;
				break;
			case 20:
				data.oPos += 1;
				break;
			case 21:case 22:
				break;
			default:
			}
			data.prev = openfl_display__$internal_DrawCommandType.BEGIN_BITMAP_FILL;
			var c = data;
			if(c.buffer.o[c.oPos].readable) {
				openfl_display__$internal_CanvasGraphics.context.fillStyle = openfl_display__$internal_CanvasGraphics.createBitmapFill(c.buffer.o[c.oPos],c.buffer.b[c.bPos],c.buffer.b[c.bPos + 1]);
				openfl_display__$internal_CanvasGraphics.bitmapFill = c.buffer.o[c.oPos];
			} else {
				var tmp = StringTools.hex(0,6);
				openfl_display__$internal_CanvasGraphics.context.fillStyle = "#" + tmp;
				openfl_display__$internal_CanvasGraphics.bitmapFill = null;
			}
			openfl_display__$internal_CanvasGraphics.bitmapRepeat = c.buffer.b[c.bPos];
			openfl_display__$internal_CanvasGraphics.hasFill = true;
			if(openfl_display__$internal_CanvasGraphics.fillScale9Bounds != null) {
				openfl_display__$internal_CanvasGraphics.fillScale9Bounds.clear();
			} else if(hasScale9Grid && openfl_display__$internal_CanvasGraphics.bitmapFill != null) {
				openfl_display__$internal_CanvasGraphics.fillScale9Bounds = new openfl_display__$internal__$CanvasGraphics_Scale9GridBounds();
			}
			if(c.buffer.o[c.oPos + 1] != null) {
				openfl_display__$internal_CanvasGraphics.pendingMatrix = c.buffer.o[c.oPos + 1];
				openfl_display__$internal_CanvasGraphics.inversePendingMatrix = c.buffer.o[c.oPos + 1].clone();
				openfl_display__$internal_CanvasGraphics.inversePendingMatrix.invert();
			} else {
				openfl_display__$internal_CanvasGraphics.pendingMatrix = null;
				openfl_display__$internal_CanvasGraphics.inversePendingMatrix = null;
			}
			break;
		case 1:
			switch(data.prev._hx_index) {
			case 0:
				data.oPos += 2;
				data.bPos += 2;
				break;
			case 1:
				data.iPos += 1;
				data.fPos += 1;
				break;
			case 2:
				data.oPos += 4;
				data.iiPos += 2;
				data.ffPos += 1;
				data.fPos += 1;
				break;
			case 3:
				data.oPos += 1;
				break;
			case 4:
				data.fPos += 6;
				break;
			case 5:
				data.fPos += 4;
				break;
			case 6:
				data.fPos += 3;
				break;
			case 7:
				data.fPos += 4;
				break;
			case 8:
				data.oPos += 3;
				break;
			case 9:
				data.fPos += 4;
				break;
			case 10:
				data.fPos += 5;
				data.oPos += 1;
				break;
			case 12:
				data.oPos += 4;
				break;
			case 13:
				break;
			case 14:
				data.oPos += 2;
				data.bPos += 2;
				break;
			case 15:
				data.oPos += 4;
				data.iiPos += 2;
				data.ffPos += 1;
				data.fPos += 1;
				break;
			case 16:
				data.oPos += 4;
				data.iPos += 1;
				data.fPos += 2;
				data.bPos += 1;
				break;
			case 17:
				data.fPos += 2;
				break;
			case 18:
				data.fPos += 2;
				break;
			case 19:
				data.oPos += 1;
				break;
			case 20:
				data.oPos += 1;
				break;
			case 21:case 22:
				break;
			default:
			}
			data.prev = openfl_display__$internal_DrawCommandType.BEGIN_FILL;
			var c1 = data;
			if(c1.buffer.f[c1.fPos] < 0.005) {
				openfl_display__$internal_CanvasGraphics.hasFill = false;
			} else {
				if(c1.buffer.f[c1.fPos] == 1) {
					var tmp1 = StringTools.hex(c1.buffer.i[c1.iPos] & 16777215,6);
					openfl_display__$internal_CanvasGraphics.context.fillStyle = "#" + tmp1;
				} else {
					r = (c1.buffer.i[c1.iPos] & 16711680) >>> 16;
					g = (c1.buffer.i[c1.iPos] & 65280) >>> 8;
					b = c1.buffer.i[c1.iPos] & 255;
					openfl_display__$internal_CanvasGraphics.context.fillStyle = "rgba(" + r + ", " + g + ", " + b + ", " + c1.buffer.f[c1.fPos] + ")";
				}
				openfl_display__$internal_CanvasGraphics.hasFill = true;
				openfl_display__$internal_CanvasGraphics.setSmoothing(true);
			}
			openfl_display__$internal_CanvasGraphics.bitmapFill = null;
			if(openfl_display__$internal_CanvasGraphics.fillScale9Bounds != null) {
				openfl_display__$internal_CanvasGraphics.fillScale9Bounds.clear();
			}
			break;
		case 2:
			switch(data.prev._hx_index) {
			case 0:
				data.oPos += 2;
				data.bPos += 2;
				break;
			case 1:
				data.iPos += 1;
				data.fPos += 1;
				break;
			case 2:
				data.oPos += 4;
				data.iiPos += 2;
				data.ffPos += 1;
				data.fPos += 1;
				break;
			case 3:
				data.oPos += 1;
				break;
			case 4:
				data.fPos += 6;
				break;
			case 5:
				data.fPos += 4;
				break;
			case 6:
				data.fPos += 3;
				break;
			case 7:
				data.fPos += 4;
				break;
			case 8:
				data.oPos += 3;
				break;
			case 9:
				data.fPos += 4;
				break;
			case 10:
				data.fPos += 5;
				data.oPos += 1;
				break;
			case 12:
				data.oPos += 4;
				break;
			case 13:
				break;
			case 14:
				data.oPos += 2;
				data.bPos += 2;
				break;
			case 15:
				data.oPos += 4;
				data.iiPos += 2;
				data.ffPos += 1;
				data.fPos += 1;
				break;
			case 16:
				data.oPos += 4;
				data.iPos += 1;
				data.fPos += 2;
				data.bPos += 1;
				break;
			case 17:
				data.fPos += 2;
				break;
			case 18:
				data.fPos += 2;
				break;
			case 19:
				data.oPos += 1;
				break;
			case 20:
				data.oPos += 1;
				break;
			case 21:case 22:
				break;
			default:
			}
			data.prev = openfl_display__$internal_DrawCommandType.BEGIN_GRADIENT_FILL;
			var c2 = data;
			openfl_display__$internal_CanvasGraphics.context.fillStyle = openfl_display__$internal_CanvasGraphics.createGradientPattern(c2.buffer.o[c2.oPos],c2.buffer.ii[c2.iiPos],c2.buffer.ff[c2.ffPos],c2.buffer.ii[c2.iiPos + 1],c2.buffer.o[c2.oPos + 1],c2.buffer.o[c2.oPos + 2],c2.buffer.o[c2.oPos + 3],c2.buffer.f[c2.fPos]);
			openfl_display__$internal_CanvasGraphics.hasFill = true;
			openfl_display__$internal_CanvasGraphics.bitmapFill = null;
			openfl_display__$internal_CanvasGraphics.setSmoothing(true);
			if(openfl_display__$internal_CanvasGraphics.fillScale9Bounds != null) {
				openfl_display__$internal_CanvasGraphics.fillScale9Bounds.clear();
			}
			break;
		case 3:
			switch(data.prev._hx_index) {
			case 0:
				data.oPos += 2;
				data.bPos += 2;
				break;
			case 1:
				data.iPos += 1;
				data.fPos += 1;
				break;
			case 2:
				data.oPos += 4;
				data.iiPos += 2;
				data.ffPos += 1;
				data.fPos += 1;
				break;
			case 3:
				data.oPos += 1;
				break;
			case 4:
				data.fPos += 6;
				break;
			case 5:
				data.fPos += 4;
				break;
			case 6:
				data.fPos += 3;
				break;
			case 7:
				data.fPos += 4;
				break;
			case 8:
				data.oPos += 3;
				break;
			case 9:
				data.fPos += 4;
				break;
			case 10:
				data.fPos += 5;
				data.oPos += 1;
				break;
			case 12:
				data.oPos += 4;
				break;
			case 13:
				break;
			case 14:
				data.oPos += 2;
				data.bPos += 2;
				break;
			case 15:
				data.oPos += 4;
				data.iiPos += 2;
				data.ffPos += 1;
				data.fPos += 1;
				break;
			case 16:
				data.oPos += 4;
				data.iPos += 1;
				data.fPos += 2;
				data.bPos += 1;
				break;
			case 17:
				data.fPos += 2;
				break;
			case 18:
				data.fPos += 2;
				break;
			case 19:
				data.oPos += 1;
				break;
			case 20:
				data.oPos += 1;
				break;
			case 21:case 22:
				break;
			default:
			}
			data.prev = openfl_display__$internal_DrawCommandType.BEGIN_SHADER_FILL;
			var c3 = data;
			var shaderBuffer = c3.buffer.o[c3.oPos];
			if(shaderBuffer.inputCount > 0) {
				openfl_display__$internal_CanvasGraphics.bitmapFill = shaderBuffer.inputs[0];
				if(openfl_display__$internal_CanvasGraphics.bitmapFill.readable) {
					openfl_display__$internal_CanvasGraphics.context.fillStyle = openfl_display__$internal_CanvasGraphics.createBitmapFill(openfl_display__$internal_CanvasGraphics.bitmapFill,shaderBuffer.inputWrap[0] != 0,shaderBuffer.inputFilter[0] != 5);
				} else {
					var tmp2 = StringTools.hex(0,6);
					openfl_display__$internal_CanvasGraphics.context.fillStyle = "#" + tmp2;
				}
				openfl_display__$internal_CanvasGraphics.hasFill = true;
				openfl_display__$internal_CanvasGraphics.pendingMatrix = null;
				openfl_display__$internal_CanvasGraphics.inversePendingMatrix = null;
			}
			if(openfl_display__$internal_CanvasGraphics.fillScale9Bounds != null) {
				openfl_display__$internal_CanvasGraphics.fillScale9Bounds.clear();
			}
			break;
		case 4:
			switch(data.prev._hx_index) {
			case 0:
				data.oPos += 2;
				data.bPos += 2;
				break;
			case 1:
				data.iPos += 1;
				data.fPos += 1;
				break;
			case 2:
				data.oPos += 4;
				data.iiPos += 2;
				data.ffPos += 1;
				data.fPos += 1;
				break;
			case 3:
				data.oPos += 1;
				break;
			case 4:
				data.fPos += 6;
				break;
			case 5:
				data.fPos += 4;
				break;
			case 6:
				data.fPos += 3;
				break;
			case 7:
				data.fPos += 4;
				break;
			case 8:
				data.oPos += 3;
				break;
			case 9:
				data.fPos += 4;
				break;
			case 10:
				data.fPos += 5;
				data.oPos += 1;
				break;
			case 12:
				data.oPos += 4;
				break;
			case 13:
				break;
			case 14:
				data.oPos += 2;
				data.bPos += 2;
				break;
			case 15:
				data.oPos += 4;
				data.iiPos += 2;
				data.ffPos += 1;
				data.fPos += 1;
				break;
			case 16:
				data.oPos += 4;
				data.iPos += 1;
				data.fPos += 2;
				data.bPos += 1;
				break;
			case 17:
				data.fPos += 2;
				break;
			case 18:
				data.fPos += 2;
				break;
			case 19:
				data.oPos += 1;
				break;
			case 20:
				data.oPos += 1;
				break;
			case 21:case 22:
				break;
			default:
			}
			data.prev = openfl_display__$internal_DrawCommandType.CUBIC_CURVE_TO;
			var c4 = data;
			hasPath = true;
			if(hasScale9Grid) {
				var scaledControlX1 = openfl_display__$internal_CanvasGraphics.toScale9Position(c4.buffer.f[c4.fPos],scale9Grid.x,scale9Grid.width,openfl_display__$internal_CanvasGraphics.bounds.width,openfl_display__$internal_CanvasGraphics.graphics.__owner.get_scaleX());
				var scaledControlY1 = openfl_display__$internal_CanvasGraphics.toScale9Position(c4.buffer.f[c4.fPos + 1],scale9Grid.y,scale9Grid.height,openfl_display__$internal_CanvasGraphics.bounds.height,openfl_display__$internal_CanvasGraphics.graphics.__owner.get_scaleY());
				var scaledControlX2 = openfl_display__$internal_CanvasGraphics.toScale9Position(c4.buffer.f[c4.fPos + 2],scale9Grid.x,scale9Grid.width,openfl_display__$internal_CanvasGraphics.bounds.width,openfl_display__$internal_CanvasGraphics.graphics.__owner.get_scaleX());
				var scaledControlY2 = openfl_display__$internal_CanvasGraphics.toScale9Position(c4.buffer.f[c4.fPos + 3],scale9Grid.y,scale9Grid.height,openfl_display__$internal_CanvasGraphics.bounds.height,openfl_display__$internal_CanvasGraphics.graphics.__owner.get_scaleY());
				var scaledAnchorX = openfl_display__$internal_CanvasGraphics.toScale9Position(c4.buffer.f[c4.fPos + 4],scale9Grid.x,scale9Grid.width,openfl_display__$internal_CanvasGraphics.bounds.width,openfl_display__$internal_CanvasGraphics.graphics.__owner.get_scaleX());
				var scaledAnchorY = openfl_display__$internal_CanvasGraphics.toScale9Position(c4.buffer.f[c4.fPos + 5],scale9Grid.y,scale9Grid.height,openfl_display__$internal_CanvasGraphics.bounds.height,openfl_display__$internal_CanvasGraphics.graphics.__owner.get_scaleY());
				if(openfl_display__$internal_CanvasGraphics.fillScale9Bounds != null && openfl_display__$internal_CanvasGraphics.bitmapFill != null || openfl_display__$internal_CanvasGraphics.strokeScale9Bounds != null && openfl_display__$internal_CanvasGraphics.bitmapStroke != null) {
					openfl_display__$internal_CanvasGraphics.applyScale9GridUnscaledX(c4.buffer.f[c4.fPos + 4]);
					openfl_display__$internal_CanvasGraphics.applyScale9GridUnscaledY(c4.buffer.f[c4.fPos + 5]);
					openfl_display__$internal_CanvasGraphics.applyScale9GridScaledX(scaledAnchorX);
					openfl_display__$internal_CanvasGraphics.applyScale9GridScaledY(scaledAnchorY);
				}
				openfl_display__$internal_CanvasGraphics.context.bezierCurveTo(scaledControlX1 - offsetX,scaledControlY1 - offsetY,scaledControlX2 - offsetX,scaledControlY2 - offsetY,scaledAnchorX - offsetX,scaledAnchorY - offsetY);
				positionX = scaledAnchorX;
				positionY = scaledAnchorY;
			} else {
				openfl_display__$internal_CanvasGraphics.context.bezierCurveTo(c4.buffer.f[c4.fPos] - offsetX,c4.buffer.f[c4.fPos + 1] - offsetY,c4.buffer.f[c4.fPos + 2] - offsetX,c4.buffer.f[c4.fPos + 3] - offsetY,c4.buffer.f[c4.fPos + 4] - offsetX,c4.buffer.f[c4.fPos + 5] - offsetY);
				positionX = c4.buffer.f[c4.fPos + 4];
				positionY = c4.buffer.f[c4.fPos + 5];
			}
			break;
		case 5:
			switch(data.prev._hx_index) {
			case 0:
				data.oPos += 2;
				data.bPos += 2;
				break;
			case 1:
				data.iPos += 1;
				data.fPos += 1;
				break;
			case 2:
				data.oPos += 4;
				data.iiPos += 2;
				data.ffPos += 1;
				data.fPos += 1;
				break;
			case 3:
				data.oPos += 1;
				break;
			case 4:
				data.fPos += 6;
				break;
			case 5:
				data.fPos += 4;
				break;
			case 6:
				data.fPos += 3;
				break;
			case 7:
				data.fPos += 4;
				break;
			case 8:
				data.oPos += 3;
				break;
			case 9:
				data.fPos += 4;
				break;
			case 10:
				data.fPos += 5;
				data.oPos += 1;
				break;
			case 12:
				data.oPos += 4;
				break;
			case 13:
				break;
			case 14:
				data.oPos += 2;
				data.bPos += 2;
				break;
			case 15:
				data.oPos += 4;
				data.iiPos += 2;
				data.ffPos += 1;
				data.fPos += 1;
				break;
			case 16:
				data.oPos += 4;
				data.iPos += 1;
				data.fPos += 2;
				data.bPos += 1;
				break;
			case 17:
				data.fPos += 2;
				break;
			case 18:
				data.fPos += 2;
				break;
			case 19:
				data.oPos += 1;
				break;
			case 20:
				data.oPos += 1;
				break;
			case 21:case 22:
				break;
			default:
			}
			data.prev = openfl_display__$internal_DrawCommandType.CURVE_TO;
			var c5 = data;
			hasPath = true;
			if(hasScale9Grid) {
				var scaledControlX = openfl_display__$internal_CanvasGraphics.toScale9Position(c5.buffer.f[c5.fPos],scale9Grid.x,scale9Grid.width,openfl_display__$internal_CanvasGraphics.bounds.width,openfl_display__$internal_CanvasGraphics.graphics.__owner.get_scaleX());
				var scaledControlY = openfl_display__$internal_CanvasGraphics.toScale9Position(c5.buffer.f[c5.fPos + 1],scale9Grid.y,scale9Grid.height,openfl_display__$internal_CanvasGraphics.bounds.height,openfl_display__$internal_CanvasGraphics.graphics.__owner.get_scaleY());
				var scaledAnchorX1 = openfl_display__$internal_CanvasGraphics.toScale9Position(c5.buffer.f[c5.fPos + 2],scale9Grid.x,scale9Grid.width,openfl_display__$internal_CanvasGraphics.bounds.width,openfl_display__$internal_CanvasGraphics.graphics.__owner.get_scaleX());
				var scaledAnchorY1 = openfl_display__$internal_CanvasGraphics.toScale9Position(c5.buffer.f[c5.fPos + 3],scale9Grid.y,scale9Grid.height,openfl_display__$internal_CanvasGraphics.bounds.height,openfl_display__$internal_CanvasGraphics.graphics.__owner.get_scaleY());
				if(openfl_display__$internal_CanvasGraphics.fillScale9Bounds != null && openfl_display__$internal_CanvasGraphics.bitmapFill != null || openfl_display__$internal_CanvasGraphics.strokeScale9Bounds != null && openfl_display__$internal_CanvasGraphics.bitmapStroke != null) {
					openfl_display__$internal_CanvasGraphics.applyScale9GridUnscaledX(c5.buffer.f[c5.fPos + 2]);
					openfl_display__$internal_CanvasGraphics.applyScale9GridUnscaledY(c5.buffer.f[c5.fPos + 3]);
					openfl_display__$internal_CanvasGraphics.applyScale9GridScaledX(scaledAnchorX1);
					openfl_display__$internal_CanvasGraphics.applyScale9GridScaledY(scaledAnchorY1);
				}
				openfl_display__$internal_CanvasGraphics.context.quadraticCurveTo(scaledControlX - offsetX,scaledControlY - offsetY,scaledAnchorX1 - offsetX,scaledAnchorY1 - offsetY);
				positionX = scaledAnchorX1;
				positionY = scaledAnchorY1;
			} else {
				openfl_display__$internal_CanvasGraphics.context.quadraticCurveTo(c5.buffer.f[c5.fPos] - offsetX,c5.buffer.f[c5.fPos + 1] - offsetY,c5.buffer.f[c5.fPos + 2] - offsetX,c5.buffer.f[c5.fPos + 3] - offsetY);
				positionX = c5.buffer.f[c5.fPos + 2];
				positionY = c5.buffer.f[c5.fPos + 3];
			}
			break;
		case 6:
			switch(data.prev._hx_index) {
			case 0:
				data.oPos += 2;
				data.bPos += 2;
				break;
			case 1:
				data.iPos += 1;
				data.fPos += 1;
				break;
			case 2:
				data.oPos += 4;
				data.iiPos += 2;
				data.ffPos += 1;
				data.fPos += 1;
				break;
			case 3:
				data.oPos += 1;
				break;
			case 4:
				data.fPos += 6;
				break;
			case 5:
				data.fPos += 4;
				break;
			case 6:
				data.fPos += 3;
				break;
			case 7:
				data.fPos += 4;
				break;
			case 8:
				data.oPos += 3;
				break;
			case 9:
				data.fPos += 4;
				break;
			case 10:
				data.fPos += 5;
				data.oPos += 1;
				break;
			case 12:
				data.oPos += 4;
				break;
			case 13:
				break;
			case 14:
				data.oPos += 2;
				data.bPos += 2;
				break;
			case 15:
				data.oPos += 4;
				data.iiPos += 2;
				data.ffPos += 1;
				data.fPos += 1;
				break;
			case 16:
				data.oPos += 4;
				data.iPos += 1;
				data.fPos += 2;
				data.bPos += 1;
				break;
			case 17:
				data.fPos += 2;
				break;
			case 18:
				data.fPos += 2;
				break;
			case 19:
				data.oPos += 1;
				break;
			case 20:
				data.oPos += 1;
				break;
			case 21:case 22:
				break;
			default:
			}
			data.prev = openfl_display__$internal_DrawCommandType.DRAW_CIRCLE;
			var c6 = data;
			hasPath = true;
			if(hasScale9Grid) {
				var scaledLeft = openfl_display__$internal_CanvasGraphics.toScale9Position(c6.buffer.f[c6.fPos] - c6.buffer.f[c6.fPos + 2],scale9Grid.x,scale9Grid.width,openfl_display__$internal_CanvasGraphics.bounds.width,openfl_display__$internal_CanvasGraphics.graphics.__owner.get_scaleX());
				var scaledTop = openfl_display__$internal_CanvasGraphics.toScale9Position(c6.buffer.f[c6.fPos + 1] - c6.buffer.f[c6.fPos + 2],scale9Grid.y,scale9Grid.height,openfl_display__$internal_CanvasGraphics.bounds.height,openfl_display__$internal_CanvasGraphics.graphics.__owner.get_scaleY());
				var scaledRight = openfl_display__$internal_CanvasGraphics.toScale9Position(c6.buffer.f[c6.fPos] + c6.buffer.f[c6.fPos + 2],scale9Grid.x,scale9Grid.width,openfl_display__$internal_CanvasGraphics.bounds.width,openfl_display__$internal_CanvasGraphics.graphics.__owner.get_scaleX());
				var scaledBottom = openfl_display__$internal_CanvasGraphics.toScale9Position(c6.buffer.f[c6.fPos + 1] + c6.buffer.f[c6.fPos + 2],scale9Grid.y,scale9Grid.height,openfl_display__$internal_CanvasGraphics.bounds.height,openfl_display__$internal_CanvasGraphics.graphics.__owner.get_scaleY());
				if(openfl_display__$internal_CanvasGraphics.fillScale9Bounds != null && openfl_display__$internal_CanvasGraphics.bitmapFill != null || openfl_display__$internal_CanvasGraphics.strokeScale9Bounds != null && openfl_display__$internal_CanvasGraphics.bitmapStroke != null) {
					openfl_display__$internal_CanvasGraphics.applyScale9GridUnscaledX(c6.buffer.f[c6.fPos] - c6.buffer.f[c6.fPos + 2]);
					openfl_display__$internal_CanvasGraphics.applyScale9GridUnscaledY(c6.buffer.f[c6.fPos + 1] - c6.buffer.f[c6.fPos + 2]);
					openfl_display__$internal_CanvasGraphics.applyScale9GridUnscaledX(c6.buffer.f[c6.fPos] + c6.buffer.f[c6.fPos + 2]);
					openfl_display__$internal_CanvasGraphics.applyScale9GridUnscaledY(c6.buffer.f[c6.fPos + 1] + c6.buffer.f[c6.fPos + 2]);
					openfl_display__$internal_CanvasGraphics.applyScale9GridScaledX(scaledLeft);
					openfl_display__$internal_CanvasGraphics.applyScale9GridScaledY(scaledTop);
					openfl_display__$internal_CanvasGraphics.applyScale9GridScaledX(scaledRight);
					openfl_display__$internal_CanvasGraphics.applyScale9GridScaledY(scaledBottom);
				}
				x = scaledLeft - offsetX;
				y = scaledTop - offsetY;
				width = scaledRight - scaledLeft;
				height = scaledBottom - scaledTop;
				if(width != 0.0 || height != 0.0) {
					ox = width / 2 * kappa;
					oy = height / 2 * kappa;
					xe = x + width;
					ye = y + height;
					xm = x + width / 2;
					ym = y + height / 2;
					openfl_display__$internal_CanvasGraphics.context.moveTo(x,ym);
					openfl_display__$internal_CanvasGraphics.context.bezierCurveTo(x,ym - oy,xm - ox,y,xm,y);
					openfl_display__$internal_CanvasGraphics.context.bezierCurveTo(xm + ox,y,xe,ym - oy,xe,ym);
					openfl_display__$internal_CanvasGraphics.context.bezierCurveTo(xe,ym + oy,xm + ox,ye,xm,ye);
					openfl_display__$internal_CanvasGraphics.context.bezierCurveTo(xm - ox,ye,x,ym + oy,x,ym);
				}
			} else if(c6.buffer.f[c6.fPos + 2] != 0.0) {
				openfl_display__$internal_CanvasGraphics.context.moveTo(c6.buffer.f[c6.fPos] - offsetX + c6.buffer.f[c6.fPos + 2],c6.buffer.f[c6.fPos + 1] - offsetY);
				openfl_display__$internal_CanvasGraphics.context.arc(c6.buffer.f[c6.fPos] - offsetX,c6.buffer.f[c6.fPos + 1] - offsetY,c6.buffer.f[c6.fPos + 2],0,Math.PI * 2,true);
			}
			break;
		case 7:
			switch(data.prev._hx_index) {
			case 0:
				data.oPos += 2;
				data.bPos += 2;
				break;
			case 1:
				data.iPos += 1;
				data.fPos += 1;
				break;
			case 2:
				data.oPos += 4;
				data.iiPos += 2;
				data.ffPos += 1;
				data.fPos += 1;
				break;
			case 3:
				data.oPos += 1;
				break;
			case 4:
				data.fPos += 6;
				break;
			case 5:
				data.fPos += 4;
				break;
			case 6:
				data.fPos += 3;
				break;
			case 7:
				data.fPos += 4;
				break;
			case 8:
				data.oPos += 3;
				break;
			case 9:
				data.fPos += 4;
				break;
			case 10:
				data.fPos += 5;
				data.oPos += 1;
				break;
			case 12:
				data.oPos += 4;
				break;
			case 13:
				break;
			case 14:
				data.oPos += 2;
				data.bPos += 2;
				break;
			case 15:
				data.oPos += 4;
				data.iiPos += 2;
				data.ffPos += 1;
				data.fPos += 1;
				break;
			case 16:
				data.oPos += 4;
				data.iPos += 1;
				data.fPos += 2;
				data.bPos += 1;
				break;
			case 17:
				data.fPos += 2;
				break;
			case 18:
				data.fPos += 2;
				break;
			case 19:
				data.oPos += 1;
				break;
			case 20:
				data.oPos += 1;
				break;
			case 21:case 22:
				break;
			default:
			}
			data.prev = openfl_display__$internal_DrawCommandType.DRAW_ELLIPSE;
			var c7 = data;
			hasPath = true;
			if(hasScale9Grid) {
				var scaledLeft1 = openfl_display__$internal_CanvasGraphics.toScale9Position(c7.buffer.f[c7.fPos],scale9Grid.x,scale9Grid.width,openfl_display__$internal_CanvasGraphics.bounds.width,openfl_display__$internal_CanvasGraphics.graphics.__owner.get_scaleX());
				var scaledTop1 = openfl_display__$internal_CanvasGraphics.toScale9Position(c7.buffer.f[c7.fPos + 1],scale9Grid.y,scale9Grid.height,openfl_display__$internal_CanvasGraphics.bounds.height,openfl_display__$internal_CanvasGraphics.graphics.__owner.get_scaleY());
				var scaledRight1 = openfl_display__$internal_CanvasGraphics.toScale9Position(c7.buffer.f[c7.fPos] + c7.buffer.f[c7.fPos + 2],scale9Grid.x,scale9Grid.width,openfl_display__$internal_CanvasGraphics.bounds.width,openfl_display__$internal_CanvasGraphics.graphics.__owner.get_scaleX());
				var scaledBottom1 = openfl_display__$internal_CanvasGraphics.toScale9Position(c7.buffer.f[c7.fPos + 1] + c7.buffer.f[c7.fPos + 3],scale9Grid.y,scale9Grid.height,openfl_display__$internal_CanvasGraphics.bounds.height,openfl_display__$internal_CanvasGraphics.graphics.__owner.get_scaleY());
				if(openfl_display__$internal_CanvasGraphics.fillScale9Bounds != null && openfl_display__$internal_CanvasGraphics.bitmapFill != null || openfl_display__$internal_CanvasGraphics.strokeScale9Bounds != null && openfl_display__$internal_CanvasGraphics.bitmapStroke != null) {
					openfl_display__$internal_CanvasGraphics.applyScale9GridUnscaledX(c7.buffer.f[c7.fPos]);
					openfl_display__$internal_CanvasGraphics.applyScale9GridUnscaledY(c7.buffer.f[c7.fPos + 1]);
					openfl_display__$internal_CanvasGraphics.applyScale9GridUnscaledX(c7.buffer.f[c7.fPos] + c7.buffer.f[c7.fPos + 2]);
					openfl_display__$internal_CanvasGraphics.applyScale9GridUnscaledY(c7.buffer.f[c7.fPos + 1] + c7.buffer.f[c7.fPos + 3]);
					openfl_display__$internal_CanvasGraphics.applyScale9GridScaledX(scaledLeft1);
					openfl_display__$internal_CanvasGraphics.applyScale9GridScaledY(scaledTop1);
					openfl_display__$internal_CanvasGraphics.applyScale9GridScaledX(scaledRight1);
					openfl_display__$internal_CanvasGraphics.applyScale9GridScaledY(scaledBottom1);
				}
				x = scaledLeft1;
				y = scaledTop1;
				width = scaledRight1 - scaledLeft1;
				height = scaledBottom1 - scaledTop1;
			} else {
				x = c7.buffer.f[c7.fPos];
				y = c7.buffer.f[c7.fPos + 1];
				width = c7.buffer.f[c7.fPos + 2];
				height = c7.buffer.f[c7.fPos + 3];
			}
			if(width != 0.0 || height != 0.0) {
				x -= offsetX;
				y -= offsetY;
				ox = width / 2 * kappa;
				oy = height / 2 * kappa;
				xe = x + width;
				ye = y + height;
				xm = x + width / 2;
				ym = y + height / 2;
				openfl_display__$internal_CanvasGraphics.context.moveTo(x,ym);
				openfl_display__$internal_CanvasGraphics.context.bezierCurveTo(x,ym - oy,xm - ox,y,xm,y);
				openfl_display__$internal_CanvasGraphics.context.bezierCurveTo(xm + ox,y,xe,ym - oy,xe,ym);
				openfl_display__$internal_CanvasGraphics.context.bezierCurveTo(xe,ym + oy,xm + ox,ye,xm,ye);
				openfl_display__$internal_CanvasGraphics.context.bezierCurveTo(xm - ox,ye,x,ym + oy,x,ym);
			}
			break;
		case 8:
			switch(data.prev._hx_index) {
			case 0:
				data.oPos += 2;
				data.bPos += 2;
				break;
			case 1:
				data.iPos += 1;
				data.fPos += 1;
				break;
			case 2:
				data.oPos += 4;
				data.iiPos += 2;
				data.ffPos += 1;
				data.fPos += 1;
				break;
			case 3:
				data.oPos += 1;
				break;
			case 4:
				data.fPos += 6;
				break;
			case 5:
				data.fPos += 4;
				break;
			case 6:
				data.fPos += 3;
				break;
			case 7:
				data.fPos += 4;
				break;
			case 8:
				data.oPos += 3;
				break;
			case 9:
				data.fPos += 4;
				break;
			case 10:
				data.fPos += 5;
				data.oPos += 1;
				break;
			case 12:
				data.oPos += 4;
				break;
			case 13:
				break;
			case 14:
				data.oPos += 2;
				data.bPos += 2;
				break;
			case 15:
				data.oPos += 4;
				data.iiPos += 2;
				data.ffPos += 1;
				data.fPos += 1;
				break;
			case 16:
				data.oPos += 4;
				data.iPos += 1;
				data.fPos += 2;
				data.bPos += 1;
				break;
			case 17:
				data.fPos += 2;
				break;
			case 18:
				data.fPos += 2;
				break;
			case 19:
				data.oPos += 1;
				break;
			case 20:
				data.oPos += 1;
				break;
			case 21:case 22:
				break;
			default:
			}
			data.prev = openfl_display__$internal_DrawCommandType.DRAW_QUADS;
			var c8 = data;
			var rects = c8.buffer.o[c8.oPos];
			var indices = c8.buffer.o[c8.oPos + 1];
			var transforms = c8.buffer.o[c8.oPos + 2];
			var hasIndices = indices != null;
			var transformABCD = false;
			var transformXY = false;
			var length = hasIndices ? indices.get_length() : Math.floor(rects.get_length() / 4);
			if(length == 0) {
				return;
			}
			if(transforms != null) {
				if(transforms.get_length() >= length * 6) {
					transformABCD = true;
					transformXY = true;
				} else if(transforms.get_length() >= length * 4) {
					transformABCD = true;
				} else if(transforms.get_length() >= length * 2) {
					transformXY = true;
				}
			}
			var tileRect = openfl_geom_Rectangle.__pool.get();
			var tileTransform = openfl_geom_Matrix.__pool.get();
			var transform = openfl_display__$internal_CanvasGraphics.graphics.__renderTransform;
			var alpha = openfl_display__$internal_CanvasGraphics.worldAlpha;
			var ri;
			var ti;
			openfl_display__$internal_CanvasGraphics.context.save();
			var _g2 = 0;
			var _g3 = length;
			while(_g2 < _g3) {
				var i = _g2++;
				ri = hasIndices ? indices.get(i) * 4 : i * 4;
				if(ri < 0) {
					continue;
				}
				tileRect.setTo(rects.get(ri),rects.get(ri + 1),rects.get(ri + 2),rects.get(ri + 3));
				if(tileRect.width <= 0 || tileRect.height <= 0) {
					continue;
				}
				if(transformABCD && transformXY) {
					ti = i * 6;
					tileTransform.setTo(transforms.get(ti),transforms.get(ti + 1),transforms.get(ti + 2),transforms.get(ti + 3),transforms.get(ti + 4),transforms.get(ti + 5));
				} else if(transformABCD) {
					ti = i * 4;
					tileTransform.setTo(transforms.get(ti),transforms.get(ti + 1),transforms.get(ti + 2),transforms.get(ti + 3),tileRect.x,tileRect.y);
				} else if(transformXY) {
					ti = i * 2;
					tileTransform.tx = transforms.get(ti);
					tileTransform.ty = transforms.get(ti + 1);
				} else {
					tileTransform.tx = tileRect.x;
					tileTransform.ty = tileRect.y;
				}
				tileTransform.tx += positionX - offsetX;
				tileTransform.ty += positionY - offsetY;
				tileTransform.concat(transform);
				openfl_display__$internal_CanvasGraphics.context.setTransform(tileTransform.a,tileTransform.b,tileTransform.c,tileTransform.d,tileTransform.tx,tileTransform.ty);
				if(openfl_display__$internal_CanvasGraphics.bitmapFill != null && openfl_display__$internal_CanvasGraphics.bitmapFill.readable) {
					openfl_display__$internal_CanvasGraphics.context.drawImage(openfl_display__$internal_CanvasGraphics.bitmapFill.image.get_src(),tileRect.x,tileRect.y,tileRect.width,tileRect.height,0,0,tileRect.width,tileRect.height);
				} else {
					openfl_display__$internal_CanvasGraphics.context.fillRect(0,0,tileRect.width,tileRect.height);
				}
			}
			openfl_geom_Rectangle.__pool.release(tileRect);
			openfl_geom_Matrix.__pool.release(tileTransform);
			openfl_display__$internal_CanvasGraphics.context.restore();
			break;
		case 9:
			switch(data.prev._hx_index) {
			case 0:
				data.oPos += 2;
				data.bPos += 2;
				break;
			case 1:
				data.iPos += 1;
				data.fPos += 1;
				break;
			case 2:
				data.oPos += 4;
				data.iiPos += 2;
				data.ffPos += 1;
				data.fPos += 1;
				break;
			case 3:
				data.oPos += 1;
				break;
			case 4:
				data.fPos += 6;
				break;
			case 5:
				data.fPos += 4;
				break;
			case 6:
				data.fPos += 3;
				break;
			case 7:
				data.fPos += 4;
				break;
			case 8:
				data.oPos += 3;
				break;
			case 9:
				data.fPos += 4;
				break;
			case 10:
				data.fPos += 5;
				data.oPos += 1;
				break;
			case 12:
				data.oPos += 4;
				break;
			case 13:
				break;
			case 14:
				data.oPos += 2;
				data.bPos += 2;
				break;
			case 15:
				data.oPos += 4;
				data.iiPos += 2;
				data.ffPos += 1;
				data.fPos += 1;
				break;
			case 16:
				data.oPos += 4;
				data.iPos += 1;
				data.fPos += 2;
				data.bPos += 1;
				break;
			case 17:
				data.fPos += 2;
				break;
			case 18:
				data.fPos += 2;
				break;
			case 19:
				data.oPos += 1;
				break;
			case 20:
				data.oPos += 1;
				break;
			case 21:case 22:
				break;
			default:
			}
			data.prev = openfl_display__$internal_DrawCommandType.DRAW_RECT;
			var c9 = data;
			optimizationUsed = false;
			if(openfl_display__$internal_CanvasGraphics.bitmapFill != null && openfl_display__$internal_CanvasGraphics.bitmapFill.readable && !openfl_display__$internal_CanvasGraphics.hitTesting && !hasScale9Grid) {
				st = 0;
				sr = 0;
				sb = 0;
				sl = 0;
				canOptimizeMatrix = true;
				if(openfl_display__$internal_CanvasGraphics.pendingMatrix != null) {
					if(openfl_display__$internal_CanvasGraphics.pendingMatrix.b != 0 || openfl_display__$internal_CanvasGraphics.pendingMatrix.c != 0) {
						canOptimizeMatrix = false;
					} else {
						if(stl == null) {
							stl = openfl_geom_Point.__pool.get();
						}
						if(sbr == null) {
							sbr = openfl_geom_Point.__pool.get();
						}
						stl.setTo(c9.buffer.f[c9.fPos],c9.buffer.f[c9.fPos + 1]);
						var _this = openfl_display__$internal_CanvasGraphics.inversePendingMatrix;
						var px = stl.x;
						var py = stl.y;
						stl.x = px * _this.a + py * _this.c + _this.tx;
						stl.y = px * _this.b + py * _this.d + _this.ty;
						sbr.setTo(c9.buffer.f[c9.fPos] + c9.buffer.f[c9.fPos + 2],c9.buffer.f[c9.fPos + 1] + c9.buffer.f[c9.fPos + 3]);
						var _this1 = openfl_display__$internal_CanvasGraphics.inversePendingMatrix;
						var px1 = sbr.x;
						var py1 = sbr.y;
						sbr.x = px1 * _this1.a + py1 * _this1.c + _this1.tx;
						sbr.y = px1 * _this1.b + py1 * _this1.d + _this1.ty;
						st = stl.y;
						sl = stl.x;
						sb = sbr.y;
						sr = sbr.x;
					}
				} else {
					st = c9.buffer.f[c9.fPos + 1];
					sl = c9.buffer.f[c9.fPos];
					sb = c9.buffer.f[c9.fPos + 1] + c9.buffer.f[c9.fPos + 3];
					sr = c9.buffer.f[c9.fPos] + c9.buffer.f[c9.fPos + 2];
				}
				if(canOptimizeMatrix && st >= 0 && sl >= 0 && sr <= openfl_display__$internal_CanvasGraphics.bitmapFill.width && sb <= openfl_display__$internal_CanvasGraphics.bitmapFill.height) {
					optimizationUsed = true;
					if(!openfl_display__$internal_CanvasGraphics.hitTesting) {
						openfl_display__$internal_CanvasGraphics.context.drawImage(openfl_display__$internal_CanvasGraphics.bitmapFill.image.get_src(),sl,st,sr - sl,sb - st,c9.buffer.f[c9.fPos] - offsetX,c9.buffer.f[c9.fPos + 1] - offsetY,c9.buffer.f[c9.fPos + 2],c9.buffer.f[c9.fPos + 3]);
					}
				}
			}
			if(!optimizationUsed) {
				hasPath = true;
				if(hasScale9Grid) {
					var scaledLeft2 = openfl_display__$internal_CanvasGraphics.toScale9Position(c9.buffer.f[c9.fPos],scale9Grid.x,scale9Grid.width,openfl_display__$internal_CanvasGraphics.bounds.width,openfl_display__$internal_CanvasGraphics.graphics.__owner.get_scaleX());
					var scaledTop2 = openfl_display__$internal_CanvasGraphics.toScale9Position(c9.buffer.f[c9.fPos + 1],scale9Grid.y,scale9Grid.height,openfl_display__$internal_CanvasGraphics.bounds.height,openfl_display__$internal_CanvasGraphics.graphics.__owner.get_scaleY());
					var scaledRight2 = openfl_display__$internal_CanvasGraphics.toScale9Position(c9.buffer.f[c9.fPos] + c9.buffer.f[c9.fPos + 2],scale9Grid.x,scale9Grid.width,openfl_display__$internal_CanvasGraphics.bounds.width,openfl_display__$internal_CanvasGraphics.graphics.__owner.get_scaleX());
					var scaledBottom2 = openfl_display__$internal_CanvasGraphics.toScale9Position(c9.buffer.f[c9.fPos + 1] + c9.buffer.f[c9.fPos + 3],scale9Grid.y,scale9Grid.height,openfl_display__$internal_CanvasGraphics.bounds.height,openfl_display__$internal_CanvasGraphics.graphics.__owner.get_scaleY());
					if(openfl_display__$internal_CanvasGraphics.fillScale9Bounds != null && openfl_display__$internal_CanvasGraphics.bitmapFill != null || openfl_display__$internal_CanvasGraphics.strokeScale9Bounds != null && openfl_display__$internal_CanvasGraphics.bitmapStroke != null) {
						openfl_display__$internal_CanvasGraphics.applyScale9GridUnscaledX(c9.buffer.f[c9.fPos]);
						openfl_display__$internal_CanvasGraphics.applyScale9GridUnscaledY(c9.buffer.f[c9.fPos + 1]);
						openfl_display__$internal_CanvasGraphics.applyScale9GridUnscaledX(c9.buffer.f[c9.fPos] + c9.buffer.f[c9.fPos + 2]);
						openfl_display__$internal_CanvasGraphics.applyScale9GridUnscaledY(c9.buffer.f[c9.fPos + 1] + c9.buffer.f[c9.fPos + 3]);
						openfl_display__$internal_CanvasGraphics.applyScale9GridScaledX(scaledLeft2);
						openfl_display__$internal_CanvasGraphics.applyScale9GridScaledY(scaledTop2);
						openfl_display__$internal_CanvasGraphics.applyScale9GridScaledX(scaledRight2);
						openfl_display__$internal_CanvasGraphics.applyScale9GridScaledY(scaledBottom2);
					}
					var scaledWidth = scaledRight2 - scaledLeft2;
					var scaledHeight = scaledBottom2 - scaledTop2;
					if(scaledWidth != 0.0 || scaledHeight != 0.0) {
						openfl_display__$internal_CanvasGraphics.context.rect(scaledLeft2 - offsetX,scaledTop2 - offsetY,scaledWidth,scaledHeight);
					}
				} else if(c9.buffer.f[c9.fPos + 2] != 0.0 || c9.buffer.f[c9.fPos + 3] != 0.0) {
					openfl_display__$internal_CanvasGraphics.context.rect(c9.buffer.f[c9.fPos] - offsetX,c9.buffer.f[c9.fPos + 1] - offsetY,c9.buffer.f[c9.fPos + 2],c9.buffer.f[c9.fPos + 3]);
				}
			}
			break;
		case 10:
			switch(data.prev._hx_index) {
			case 0:
				data.oPos += 2;
				data.bPos += 2;
				break;
			case 1:
				data.iPos += 1;
				data.fPos += 1;
				break;
			case 2:
				data.oPos += 4;
				data.iiPos += 2;
				data.ffPos += 1;
				data.fPos += 1;
				break;
			case 3:
				data.oPos += 1;
				break;
			case 4:
				data.fPos += 6;
				break;
			case 5:
				data.fPos += 4;
				break;
			case 6:
				data.fPos += 3;
				break;
			case 7:
				data.fPos += 4;
				break;
			case 8:
				data.oPos += 3;
				break;
			case 9:
				data.fPos += 4;
				break;
			case 10:
				data.fPos += 5;
				data.oPos += 1;
				break;
			case 12:
				data.oPos += 4;
				break;
			case 13:
				break;
			case 14:
				data.oPos += 2;
				data.bPos += 2;
				break;
			case 15:
				data.oPos += 4;
				data.iiPos += 2;
				data.ffPos += 1;
				data.fPos += 1;
				break;
			case 16:
				data.oPos += 4;
				data.iPos += 1;
				data.fPos += 2;
				data.bPos += 1;
				break;
			case 17:
				data.fPos += 2;
				break;
			case 18:
				data.fPos += 2;
				break;
			case 19:
				data.oPos += 1;
				break;
			case 20:
				data.oPos += 1;
				break;
			case 21:case 22:
				break;
			default:
			}
			data.prev = openfl_display__$internal_DrawCommandType.DRAW_ROUND_RECT;
			var c10 = data;
			hasPath = true;
			openfl_display__$internal_CanvasGraphics.drawRoundRect(c10.buffer.f[c10.fPos] - offsetX,c10.buffer.f[c10.fPos + 1] - offsetY,c10.buffer.f[c10.fPos + 2],c10.buffer.f[c10.fPos + 3],c10.buffer.f[c10.fPos + 4],c10.buffer.o[c10.oPos],scale9Grid,openfl_display__$internal_CanvasGraphics.bounds.width,openfl_display__$internal_CanvasGraphics.bounds.height,openfl_display__$internal_CanvasGraphics.graphics.__owner.get_scaleX(),openfl_display__$internal_CanvasGraphics.graphics.__owner.get_scaleY());
			break;
		case 12:
			switch(data.prev._hx_index) {
			case 0:
				data.oPos += 2;
				data.bPos += 2;
				break;
			case 1:
				data.iPos += 1;
				data.fPos += 1;
				break;
			case 2:
				data.oPos += 4;
				data.iiPos += 2;
				data.ffPos += 1;
				data.fPos += 1;
				break;
			case 3:
				data.oPos += 1;
				break;
			case 4:
				data.fPos += 6;
				break;
			case 5:
				data.fPos += 4;
				break;
			case 6:
				data.fPos += 3;
				break;
			case 7:
				data.fPos += 4;
				break;
			case 8:
				data.oPos += 3;
				break;
			case 9:
				data.fPos += 4;
				break;
			case 10:
				data.fPos += 5;
				data.oPos += 1;
				break;
			case 12:
				data.oPos += 4;
				break;
			case 13:
				break;
			case 14:
				data.oPos += 2;
				data.bPos += 2;
				break;
			case 15:
				data.oPos += 4;
				data.iiPos += 2;
				data.ffPos += 1;
				data.fPos += 1;
				break;
			case 16:
				data.oPos += 4;
				data.iPos += 1;
				data.fPos += 2;
				data.bPos += 1;
				break;
			case 17:
				data.fPos += 2;
				break;
			case 18:
				data.fPos += 2;
				break;
			case 19:
				data.oPos += 1;
				break;
			case 20:
				data.oPos += 1;
				break;
			case 21:case 22:
				break;
			default:
			}
			data.prev = openfl_display__$internal_DrawCommandType.DRAW_TRIANGLES;
			var c11 = data;
			var v = c11.buffer.o[c11.oPos];
			var ind = c11.buffer.o[c11.oPos + 1];
			var uvt = c11.buffer.o[c11.oPos + 2];
			var pattern = null;
			var colorFill = openfl_display__$internal_CanvasGraphics.bitmapFill == null;
			if(colorFill && uvt != null) {
				break _hx_loop1;
			}
			if(!colorFill && uvt != null) {
				var skipT = uvt.get_length() != v.get_length();
				var normalizedUVT = openfl_display__$internal_CanvasGraphics.normalizeUVT(uvt,skipT);
				var maxUVT = normalizedUVT.max;
				uvt = normalizedUVT.uvt;
				if(maxUVT > 1) {
					pattern = openfl_display__$internal_CanvasGraphics.createTempPatternCanvas(openfl_display__$internal_CanvasGraphics.bitmapFill,openfl_display__$internal_CanvasGraphics.bitmapRepeat,openfl_display__$internal_CanvasGraphics.bounds.width | 0,openfl_display__$internal_CanvasGraphics.bounds.height | 0);
				} else {
					pattern = openfl_display__$internal_CanvasGraphics.createTempPatternCanvas(openfl_display__$internal_CanvasGraphics.bitmapFill,openfl_display__$internal_CanvasGraphics.bitmapRepeat,openfl_display__$internal_CanvasGraphics.bitmapFill.width,openfl_display__$internal_CanvasGraphics.bitmapFill.height);
				}
			}
			var i1 = 0;
			var l = ind.get_length();
			var a_;
			var b_;
			var c_;
			var iax;
			var iay;
			var ibx;
			var iby;
			var icx;
			var icy;
			var x1;
			var y1;
			var x2;
			var y2;
			var x3;
			var y3;
			var uvx1;
			var uvy1;
			var uvx2;
			var uvy2;
			var uvx3;
			var uvy3;
			var denom;
			var t1;
			var t2;
			var t3;
			var t4;
			var dx;
			var dy;
			while(i1 < l) {
				a_ = i1;
				b_ = i1 + 1;
				c_ = i1 + 2;
				iax = ind.get(a_) * 2;
				iay = ind.get(a_) * 2 + 1;
				ibx = ind.get(b_) * 2;
				iby = ind.get(b_) * 2 + 1;
				icx = ind.get(c_) * 2;
				icy = ind.get(c_) * 2 + 1;
				if(hasScale9Grid) {
					var scaledX1 = openfl_display__$internal_CanvasGraphics.toScale9Position(v.get(iax),scale9Grid.x,scale9Grid.width,openfl_display__$internal_CanvasGraphics.bounds.width,openfl_display__$internal_CanvasGraphics.graphics.__owner.get_scaleX());
					var scaledY1 = openfl_display__$internal_CanvasGraphics.toScale9Position(v.get(iay),scale9Grid.y,scale9Grid.height,openfl_display__$internal_CanvasGraphics.bounds.height,openfl_display__$internal_CanvasGraphics.graphics.__owner.get_scaleY());
					var scaledX2 = openfl_display__$internal_CanvasGraphics.toScale9Position(v.get(ibx),scale9Grid.x,scale9Grid.width,openfl_display__$internal_CanvasGraphics.bounds.width,openfl_display__$internal_CanvasGraphics.graphics.__owner.get_scaleX());
					var scaledY2 = openfl_display__$internal_CanvasGraphics.toScale9Position(v.get(iby),scale9Grid.y,scale9Grid.height,openfl_display__$internal_CanvasGraphics.bounds.height,openfl_display__$internal_CanvasGraphics.graphics.__owner.get_scaleY());
					var scaledX3 = openfl_display__$internal_CanvasGraphics.toScale9Position(v.get(icx),scale9Grid.x,scale9Grid.width,openfl_display__$internal_CanvasGraphics.bounds.width,openfl_display__$internal_CanvasGraphics.graphics.__owner.get_scaleX());
					var scaledY3 = openfl_display__$internal_CanvasGraphics.toScale9Position(v.get(icy),scale9Grid.y,scale9Grid.height,openfl_display__$internal_CanvasGraphics.bounds.height,openfl_display__$internal_CanvasGraphics.graphics.__owner.get_scaleY());
					if(openfl_display__$internal_CanvasGraphics.fillScale9Bounds != null && openfl_display__$internal_CanvasGraphics.bitmapFill != null || openfl_display__$internal_CanvasGraphics.strokeScale9Bounds != null && openfl_display__$internal_CanvasGraphics.bitmapStroke != null) {
						openfl_display__$internal_CanvasGraphics.applyScale9GridUnscaledX(v.get(iax));
						openfl_display__$internal_CanvasGraphics.applyScale9GridUnscaledY(v.get(iay));
						openfl_display__$internal_CanvasGraphics.applyScale9GridUnscaledX(v.get(ibx));
						openfl_display__$internal_CanvasGraphics.applyScale9GridUnscaledY(v.get(iby));
						openfl_display__$internal_CanvasGraphics.applyScale9GridUnscaledX(v.get(icx));
						openfl_display__$internal_CanvasGraphics.applyScale9GridUnscaledY(v.get(icy));
						openfl_display__$internal_CanvasGraphics.applyScale9GridScaledX(scaledX1);
						openfl_display__$internal_CanvasGraphics.applyScale9GridScaledY(scaledY1);
						openfl_display__$internal_CanvasGraphics.applyScale9GridScaledX(scaledX2);
						openfl_display__$internal_CanvasGraphics.applyScale9GridScaledY(scaledY2);
						openfl_display__$internal_CanvasGraphics.applyScale9GridScaledX(scaledX3);
						openfl_display__$internal_CanvasGraphics.applyScale9GridScaledY(scaledY3);
					}
					x1 = scaledX1 - offsetX;
					y1 = scaledY1 - offsetY;
					x2 = scaledX2 - offsetX;
					y2 = scaledY2 - offsetY;
					x3 = scaledX3 - offsetX;
					y3 = scaledY3 - offsetY;
				} else {
					x1 = v.get(iax) - offsetX;
					y1 = v.get(iay) - offsetY;
					x2 = v.get(ibx) - offsetX;
					y2 = v.get(iby) - offsetY;
					x3 = v.get(icx) - offsetX;
					y3 = v.get(icy) - offsetY;
				}
				switch(c11.buffer.o[c11.oPos + 3]) {
				case 0:
					if((x2 - x1) * (y3 - y1) - (y2 - y1) * (x3 - x1) < 0) {
						i1 += 3;
						continue;
					}
					break;
				case 2:
					if(!((x2 - x1) * (y3 - y1) - (y2 - y1) * (x3 - x1) < 0)) {
						i1 += 3;
						continue;
					}
					break;
				default:
				}
				if(colorFill || uvt == null) {
					openfl_display__$internal_CanvasGraphics.context.beginPath();
					openfl_display__$internal_CanvasGraphics.context.moveTo(x1,y1);
					openfl_display__$internal_CanvasGraphics.context.lineTo(x2,y2);
					openfl_display__$internal_CanvasGraphics.context.lineTo(x3,y3);
					openfl_display__$internal_CanvasGraphics.context.closePath();
					var inverseTranslateX = 0.0;
					var inverseTranslateY = 0.0;
					var inverseScaleX = 1.0;
					var inverseScaleY = 1.0;
					if(!openfl_display__$internal_CanvasGraphics.hitTesting && hasScale9Grid && openfl_display__$internal_CanvasGraphics.fillScale9Bounds != null && openfl_display__$internal_CanvasGraphics.bitmapFill != null) {
						var scaleX = openfl_display__$internal_CanvasGraphics.fillScale9Bounds.getScaleX();
						var scaleY = openfl_display__$internal_CanvasGraphics.fillScale9Bounds.getScaleY();
						if(scaleX > 0.0 && scaleY > 0.0) {
							openfl_display__$internal_CanvasGraphics.context.scale(scaleX,scaleY);
							inverseScaleX = 1.0 / scaleX;
							inverseScaleY = 1.0 / scaleY;
							var remX = openfl_display__$internal_CanvasGraphics.fillScale9Bounds.unscaledMinX % openfl_display__$internal_CanvasGraphics.bitmapFill.width;
							var remY = openfl_display__$internal_CanvasGraphics.fillScale9Bounds.unscaledMinY % openfl_display__$internal_CanvasGraphics.bitmapFill.height;
							var adjustedRemX = openfl_display__$internal_CanvasGraphics.fillScale9Bounds.scale9MinX % (openfl_display__$internal_CanvasGraphics.bitmapFill.width * scaleX) / scaleX;
							var adjustedRemY = openfl_display__$internal_CanvasGraphics.fillScale9Bounds.scale9MinY % (openfl_display__$internal_CanvasGraphics.bitmapFill.height * scaleY) / scaleY;
							var translateX = adjustedRemX - remX;
							var translateY = adjustedRemY - remY;
							openfl_display__$internal_CanvasGraphics.context.translate(translateX,translateY);
							inverseTranslateX = -translateX;
							inverseTranslateY = -translateY;
						}
					}
					if(!openfl_display__$internal_CanvasGraphics.hitTesting) {
						openfl_display__$internal_CanvasGraphics.context.fill(openfl_display__$internal_CanvasGraphics.windingRule);
					}
					if(!openfl_display__$internal_CanvasGraphics.hitTesting && hasScale9Grid && openfl_display__$internal_CanvasGraphics.fillScale9Bounds != null && openfl_display__$internal_CanvasGraphics.bitmapFill != null) {
						openfl_display__$internal_CanvasGraphics.context.translate(inverseTranslateX,inverseTranslateY);
						openfl_display__$internal_CanvasGraphics.context.scale(inverseScaleX,inverseScaleY);
					}
					i1 += 3;
					continue;
				}
				uvx1 = uvt.get(iax) * pattern.width;
				uvx2 = uvt.get(ibx) * pattern.width;
				uvx3 = uvt.get(icx) * pattern.width;
				uvy1 = uvt.get(iay) * pattern.height;
				uvy2 = uvt.get(iby) * pattern.height;
				uvy3 = uvt.get(icy) * pattern.height;
				denom = uvx1 * (uvy3 - uvy2) - uvx2 * uvy3 + uvx3 * uvy2 + (uvx2 - uvx3) * uvy1;
				if(denom == 0) {
					i1 += 3;
					openfl_display__$internal_CanvasGraphics.context.restore();
					continue;
				}
				openfl_display__$internal_CanvasGraphics.context.save();
				openfl_display__$internal_CanvasGraphics.context.beginPath();
				openfl_display__$internal_CanvasGraphics.context.moveTo(x1,y1);
				openfl_display__$internal_CanvasGraphics.context.lineTo(x2,y2);
				openfl_display__$internal_CanvasGraphics.context.lineTo(x3,y3);
				openfl_display__$internal_CanvasGraphics.context.closePath();
				openfl_display__$internal_CanvasGraphics.context.clip();
				t1 = -(uvy1 * (x3 - x2) - uvy2 * x3 + uvy3 * x2 + (uvy2 - uvy3) * x1) / denom;
				t2 = (uvy2 * y3 + uvy1 * (y2 - y3) - uvy3 * y2 + (uvy3 - uvy2) * y1) / denom;
				t3 = (uvx1 * (x3 - x2) - uvx2 * x3 + uvx3 * x2 + (uvx2 - uvx3) * x1) / denom;
				t4 = -(uvx2 * y3 + uvx1 * (y2 - y3) - uvx3 * y2 + (uvx3 - uvx2) * y1) / denom;
				dx = (uvx1 * (uvy3 * x2 - uvy2 * x3) + uvy1 * (uvx2 * x3 - uvx3 * x2) + (uvx3 * uvy2 - uvx2 * uvy3) * x1) / denom;
				dy = (uvx1 * (uvy3 * y2 - uvy2 * y3) + uvy1 * (uvx2 * y3 - uvx3 * y2) + (uvx3 * uvy2 - uvx2 * uvy3) * y1) / denom;
				openfl_display__$internal_CanvasGraphics.context.transform(t1,t2,t3,t4,dx,dy);
				openfl_display__$internal_CanvasGraphics.context.drawImage(pattern,0,0,pattern.width,pattern.height);
				openfl_display__$internal_CanvasGraphics.context.restore();
				i1 += 3;
			}
			break;
		case 14:
			switch(data.prev._hx_index) {
			case 0:
				data.oPos += 2;
				data.bPos += 2;
				break;
			case 1:
				data.iPos += 1;
				data.fPos += 1;
				break;
			case 2:
				data.oPos += 4;
				data.iiPos += 2;
				data.ffPos += 1;
				data.fPos += 1;
				break;
			case 3:
				data.oPos += 1;
				break;
			case 4:
				data.fPos += 6;
				break;
			case 5:
				data.fPos += 4;
				break;
			case 6:
				data.fPos += 3;
				break;
			case 7:
				data.fPos += 4;
				break;
			case 8:
				data.oPos += 3;
				break;
			case 9:
				data.fPos += 4;
				break;
			case 10:
				data.fPos += 5;
				data.oPos += 1;
				break;
			case 12:
				data.oPos += 4;
				break;
			case 13:
				break;
			case 14:
				data.oPos += 2;
				data.bPos += 2;
				break;
			case 15:
				data.oPos += 4;
				data.iiPos += 2;
				data.ffPos += 1;
				data.fPos += 1;
				break;
			case 16:
				data.oPos += 4;
				data.iPos += 1;
				data.fPos += 2;
				data.bPos += 1;
				break;
			case 17:
				data.fPos += 2;
				break;
			case 18:
				data.fPos += 2;
				break;
			case 19:
				data.oPos += 1;
				break;
			case 20:
				data.oPos += 1;
				break;
			case 21:case 22:
				break;
			default:
			}
			data.prev = openfl_display__$internal_DrawCommandType.LINE_BITMAP_STYLE;
			var c12 = data;
			if(stroke && openfl_display__$internal_CanvasGraphics.hasStroke) {
				openfl_display__$internal_CanvasGraphics.closePath(true);
			}
			openfl_display__$internal_CanvasGraphics.context.moveTo(positionX - offsetX,positionY - offsetY);
			if(c12.buffer.o[c12.oPos].readable) {
				openfl_display__$internal_CanvasGraphics.strokePattern = openfl_display__$internal_CanvasGraphics.createBitmapFill(c12.buffer.o[c12.oPos],c12.buffer.b[c12.bPos],c12.buffer.b[c12.bPos + 1]);
				openfl_display__$internal_CanvasGraphics.context.strokeStyle = openfl_display__$internal_CanvasGraphics.strokePattern;
				openfl_display__$internal_CanvasGraphics.bitmapStroke = c12.buffer.o[c12.oPos];
				openfl_display__$internal_CanvasGraphics.bitmapStrokeMatrix = c12.buffer.o[c12.oPos + 1];
			} else {
				var tmp3 = StringTools.hex(0,6);
				openfl_display__$internal_CanvasGraphics.context.strokeStyle = "#" + tmp3;
				openfl_display__$internal_CanvasGraphics.strokePattern = null;
				openfl_display__$internal_CanvasGraphics.bitmapStroke = null;
				openfl_display__$internal_CanvasGraphics.bitmapStrokeMatrix = null;
			}
			if(openfl_display__$internal_CanvasGraphics.strokeScale9Bounds != null) {
				openfl_display__$internal_CanvasGraphics.strokeScale9Bounds.clear();
			} else if(hasScale9Grid && openfl_display__$internal_CanvasGraphics.bitmapStroke != null) {
				openfl_display__$internal_CanvasGraphics.strokeScale9Bounds = new openfl_display__$internal__$CanvasGraphics_Scale9GridBounds();
			}
			openfl_display__$internal_CanvasGraphics.hasStroke = true;
			break;
		case 15:
			switch(data.prev._hx_index) {
			case 0:
				data.oPos += 2;
				data.bPos += 2;
				break;
			case 1:
				data.iPos += 1;
				data.fPos += 1;
				break;
			case 2:
				data.oPos += 4;
				data.iiPos += 2;
				data.ffPos += 1;
				data.fPos += 1;
				break;
			case 3:
				data.oPos += 1;
				break;
			case 4:
				data.fPos += 6;
				break;
			case 5:
				data.fPos += 4;
				break;
			case 6:
				data.fPos += 3;
				break;
			case 7:
				data.fPos += 4;
				break;
			case 8:
				data.oPos += 3;
				break;
			case 9:
				data.fPos += 4;
				break;
			case 10:
				data.fPos += 5;
				data.oPos += 1;
				break;
			case 12:
				data.oPos += 4;
				break;
			case 13:
				break;
			case 14:
				data.oPos += 2;
				data.bPos += 2;
				break;
			case 15:
				data.oPos += 4;
				data.iiPos += 2;
				data.ffPos += 1;
				data.fPos += 1;
				break;
			case 16:
				data.oPos += 4;
				data.iPos += 1;
				data.fPos += 2;
				data.bPos += 1;
				break;
			case 17:
				data.fPos += 2;
				break;
			case 18:
				data.fPos += 2;
				break;
			case 19:
				data.oPos += 1;
				break;
			case 20:
				data.oPos += 1;
				break;
			case 21:case 22:
				break;
			default:
			}
			data.prev = openfl_display__$internal_DrawCommandType.LINE_GRADIENT_STYLE;
			var c13 = data;
			if(stroke && openfl_display__$internal_CanvasGraphics.hasStroke) {
				openfl_display__$internal_CanvasGraphics.closePath(true);
			}
			openfl_display__$internal_CanvasGraphics.context.moveTo(positionX - offsetX,positionY - offsetY);
			openfl_display__$internal_CanvasGraphics.strokePattern = openfl_display__$internal_CanvasGraphics.createGradientPattern(c13.buffer.o[c13.oPos],c13.buffer.ii[c13.iiPos],c13.buffer.ff[c13.ffPos],c13.buffer.ii[c13.iiPos + 1],c13.buffer.o[c13.oPos + 1],c13.buffer.o[c13.oPos + 2],c13.buffer.o[c13.oPos + 3],c13.buffer.f[c13.fPos]);
			openfl_display__$internal_CanvasGraphics.context.strokeStyle = openfl_display__$internal_CanvasGraphics.strokePattern;
			openfl_display__$internal_CanvasGraphics.setSmoothing(true);
			openfl_display__$internal_CanvasGraphics.hasStroke = true;
			openfl_display__$internal_CanvasGraphics.bitmapStroke = null;
			openfl_display__$internal_CanvasGraphics.bitmapStrokeMatrix = null;
			break;
		case 16:
			switch(data.prev._hx_index) {
			case 0:
				data.oPos += 2;
				data.bPos += 2;
				break;
			case 1:
				data.iPos += 1;
				data.fPos += 1;
				break;
			case 2:
				data.oPos += 4;
				data.iiPos += 2;
				data.ffPos += 1;
				data.fPos += 1;
				break;
			case 3:
				data.oPos += 1;
				break;
			case 4:
				data.fPos += 6;
				break;
			case 5:
				data.fPos += 4;
				break;
			case 6:
				data.fPos += 3;
				break;
			case 7:
				data.fPos += 4;
				break;
			case 8:
				data.oPos += 3;
				break;
			case 9:
				data.fPos += 4;
				break;
			case 10:
				data.fPos += 5;
				data.oPos += 1;
				break;
			case 12:
				data.oPos += 4;
				break;
			case 13:
				break;
			case 14:
				data.oPos += 2;
				data.bPos += 2;
				break;
			case 15:
				data.oPos += 4;
				data.iiPos += 2;
				data.ffPos += 1;
				data.fPos += 1;
				break;
			case 16:
				data.oPos += 4;
				data.iPos += 1;
				data.fPos += 2;
				data.bPos += 1;
				break;
			case 17:
				data.fPos += 2;
				break;
			case 18:
				data.fPos += 2;
				break;
			case 19:
				data.oPos += 1;
				break;
			case 20:
				data.oPos += 1;
				break;
			case 21:case 22:
				break;
			default:
			}
			data.prev = openfl_display__$internal_DrawCommandType.LINE_STYLE;
			var c14 = data;
			if(stroke && openfl_display__$internal_CanvasGraphics.hasStroke) {
				openfl_display__$internal_CanvasGraphics.closePath(true);
			}
			openfl_display__$internal_CanvasGraphics.context.moveTo(positionX - offsetX,positionY - offsetY);
			if(c14.buffer.o[c14.oPos] == null) {
				openfl_display__$internal_CanvasGraphics.hasStroke = false;
			} else {
				openfl_display__$internal_CanvasGraphics.hasStroke = true;
				openfl_display__$internal_CanvasGraphics.context.lineWidth = c14.buffer.o[c14.oPos] > 0 ? c14.buffer.o[c14.oPos] : 1;
				var tmp4 = c14.buffer.o[c14.oPos + 3] == null ? "round" : (c14.buffer.o[c14.oPos + 3] == null ? "null" : openfl_display_JointStyle.toString(c14.buffer.o[c14.oPos + 3])).toLowerCase();
				openfl_display__$internal_CanvasGraphics.context.lineJoin = tmp4;
				var tmp5 = c14.buffer.o[c14.oPos + 2] == null ? "round" : c14.buffer.o[c14.oPos + 2] == 0 ? "butt" : (c14.buffer.o[c14.oPos + 2] == null ? "null" : openfl_display_CapsStyle.toString(c14.buffer.o[c14.oPos + 2])).toLowerCase();
				openfl_display__$internal_CanvasGraphics.context.lineCap = tmp5;
				openfl_display__$internal_CanvasGraphics.context.miterLimit = c14.buffer.f[c14.fPos + 1];
				if(c14.buffer.f[c14.fPos] == 1) {
					var tmp6 = StringTools.hex(c14.buffer.i[c14.iPos] & 16777215,6);
					openfl_display__$internal_CanvasGraphics.context.strokeStyle = "#" + tmp6;
				} else {
					r = (c14.buffer.i[c14.iPos] & 16711680) >>> 16;
					g = (c14.buffer.i[c14.iPos] & 65280) >>> 8;
					b = c14.buffer.i[c14.iPos] & 255;
					openfl_display__$internal_CanvasGraphics.context.strokeStyle = "rgba(" + r + ", " + g + ", " + b + ", " + c14.buffer.f[c14.fPos] + ")";
				}
				openfl_display__$internal_CanvasGraphics.setSmoothing(true);
			}
			openfl_display__$internal_CanvasGraphics.strokePattern = null;
			openfl_display__$internal_CanvasGraphics.bitmapStroke = null;
			openfl_display__$internal_CanvasGraphics.bitmapStrokeMatrix = null;
			break;
		case 17:
			switch(data.prev._hx_index) {
			case 0:
				data.oPos += 2;
				data.bPos += 2;
				break;
			case 1:
				data.iPos += 1;
				data.fPos += 1;
				break;
			case 2:
				data.oPos += 4;
				data.iiPos += 2;
				data.ffPos += 1;
				data.fPos += 1;
				break;
			case 3:
				data.oPos += 1;
				break;
			case 4:
				data.fPos += 6;
				break;
			case 5:
				data.fPos += 4;
				break;
			case 6:
				data.fPos += 3;
				break;
			case 7:
				data.fPos += 4;
				break;
			case 8:
				data.oPos += 3;
				break;
			case 9:
				data.fPos += 4;
				break;
			case 10:
				data.fPos += 5;
				data.oPos += 1;
				break;
			case 12:
				data.oPos += 4;
				break;
			case 13:
				break;
			case 14:
				data.oPos += 2;
				data.bPos += 2;
				break;
			case 15:
				data.oPos += 4;
				data.iiPos += 2;
				data.ffPos += 1;
				data.fPos += 1;
				break;
			case 16:
				data.oPos += 4;
				data.iPos += 1;
				data.fPos += 2;
				data.bPos += 1;
				break;
			case 17:
				data.fPos += 2;
				break;
			case 18:
				data.fPos += 2;
				break;
			case 19:
				data.oPos += 1;
				break;
			case 20:
				data.oPos += 1;
				break;
			case 21:case 22:
				break;
			default:
			}
			data.prev = openfl_display__$internal_DrawCommandType.LINE_TO;
			var c15 = data;
			hasPath = true;
			if(hasScale9Grid) {
				var scaledX = openfl_display__$internal_CanvasGraphics.toScale9Position(c15.buffer.f[c15.fPos],scale9Grid.x,scale9Grid.width,openfl_display__$internal_CanvasGraphics.bounds.width,openfl_display__$internal_CanvasGraphics.graphics.__owner.get_scaleX());
				var scaledY = openfl_display__$internal_CanvasGraphics.toScale9Position(c15.buffer.f[c15.fPos + 1],scale9Grid.y,scale9Grid.height,openfl_display__$internal_CanvasGraphics.bounds.height,openfl_display__$internal_CanvasGraphics.graphics.__owner.get_scaleY());
				if(openfl_display__$internal_CanvasGraphics.fillScale9Bounds != null && openfl_display__$internal_CanvasGraphics.bitmapFill != null || openfl_display__$internal_CanvasGraphics.strokeScale9Bounds != null && openfl_display__$internal_CanvasGraphics.bitmapStroke != null) {
					openfl_display__$internal_CanvasGraphics.applyScale9GridUnscaledX(c15.buffer.f[c15.fPos]);
					openfl_display__$internal_CanvasGraphics.applyScale9GridUnscaledY(c15.buffer.f[c15.fPos + 1]);
					openfl_display__$internal_CanvasGraphics.applyScale9GridScaledX(scaledX);
					openfl_display__$internal_CanvasGraphics.applyScale9GridScaledY(scaledY);
				}
				if(positionX != scaledX || positionY != scaledY) {
					openfl_display__$internal_CanvasGraphics.context.lineTo(scaledX - offsetX,scaledY - offsetY);
				}
				positionX = scaledX;
				positionY = scaledY;
			} else {
				if(positionX != c15.buffer.f[c15.fPos] || positionY != c15.buffer.f[c15.fPos + 1]) {
					openfl_display__$internal_CanvasGraphics.context.lineTo(c15.buffer.f[c15.fPos] - offsetX,c15.buffer.f[c15.fPos + 1] - offsetY);
				}
				positionX = c15.buffer.f[c15.fPos];
				positionY = c15.buffer.f[c15.fPos + 1];
			}
			if(positionX == startX && positionY == startY) {
				closeGap = true;
			}
			break;
		case 18:
			switch(data.prev._hx_index) {
			case 0:
				data.oPos += 2;
				data.bPos += 2;
				break;
			case 1:
				data.iPos += 1;
				data.fPos += 1;
				break;
			case 2:
				data.oPos += 4;
				data.iiPos += 2;
				data.ffPos += 1;
				data.fPos += 1;
				break;
			case 3:
				data.oPos += 1;
				break;
			case 4:
				data.fPos += 6;
				break;
			case 5:
				data.fPos += 4;
				break;
			case 6:
				data.fPos += 3;
				break;
			case 7:
				data.fPos += 4;
				break;
			case 8:
				data.oPos += 3;
				break;
			case 9:
				data.fPos += 4;
				break;
			case 10:
				data.fPos += 5;
				data.oPos += 1;
				break;
			case 12:
				data.oPos += 4;
				break;
			case 13:
				break;
			case 14:
				data.oPos += 2;
				data.bPos += 2;
				break;
			case 15:
				data.oPos += 4;
				data.iiPos += 2;
				data.ffPos += 1;
				data.fPos += 1;
				break;
			case 16:
				data.oPos += 4;
				data.iPos += 1;
				data.fPos += 2;
				data.bPos += 1;
				break;
			case 17:
				data.fPos += 2;
				break;
			case 18:
				data.fPos += 2;
				break;
			case 19:
				data.oPos += 1;
				break;
			case 20:
				data.oPos += 1;
				break;
			case 21:case 22:
				break;
			default:
			}
			data.prev = openfl_display__$internal_DrawCommandType.MOVE_TO;
			var c16 = data;
			if(hasScale9Grid) {
				var scaledX4 = openfl_display__$internal_CanvasGraphics.toScale9Position(c16.buffer.f[c16.fPos],scale9Grid.x,scale9Grid.width,openfl_display__$internal_CanvasGraphics.bounds.width,openfl_display__$internal_CanvasGraphics.graphics.__owner.get_scaleX());
				var scaledY4 = openfl_display__$internal_CanvasGraphics.toScale9Position(c16.buffer.f[c16.fPos + 1],scale9Grid.y,scale9Grid.height,openfl_display__$internal_CanvasGraphics.bounds.height,openfl_display__$internal_CanvasGraphics.graphics.__owner.get_scaleY());
				if(openfl_display__$internal_CanvasGraphics.fillScale9Bounds != null && openfl_display__$internal_CanvasGraphics.bitmapFill != null || openfl_display__$internal_CanvasGraphics.strokeScale9Bounds != null && openfl_display__$internal_CanvasGraphics.bitmapStroke != null) {
					openfl_display__$internal_CanvasGraphics.applyScale9GridUnscaledX(c16.buffer.f[c16.fPos]);
					openfl_display__$internal_CanvasGraphics.applyScale9GridUnscaledY(c16.buffer.f[c16.fPos + 1]);
					openfl_display__$internal_CanvasGraphics.applyScale9GridScaledX(scaledX4);
					openfl_display__$internal_CanvasGraphics.applyScale9GridScaledY(scaledY4);
				}
				openfl_display__$internal_CanvasGraphics.context.moveTo(scaledX4 - offsetX,scaledY4 - offsetY);
				positionX = scaledX4;
				positionY = scaledY4;
			} else {
				openfl_display__$internal_CanvasGraphics.context.moveTo(c16.buffer.f[c16.fPos] - offsetX,c16.buffer.f[c16.fPos + 1] - offsetY);
				positionX = c16.buffer.f[c16.fPos];
				positionY = c16.buffer.f[c16.fPos + 1];
			}
			if(setStart && positionX != startX && positionY != startY) {
				closeGap = true;
			}
			startX = positionX;
			startY = positionY;
			setStart = true;
			break;
		case 21:
			openfl_display__$internal_CanvasGraphics.windingRule = "evenodd";
			break;
		case 22:
			openfl_display__$internal_CanvasGraphics.windingRule = "nonzero";
			break;
		default:
			switch(data.prev._hx_index) {
			case 0:
				data.oPos += 2;
				data.bPos += 2;
				break;
			case 1:
				data.iPos += 1;
				data.fPos += 1;
				break;
			case 2:
				data.oPos += 4;
				data.iiPos += 2;
				data.ffPos += 1;
				data.fPos += 1;
				break;
			case 3:
				data.oPos += 1;
				break;
			case 4:
				data.fPos += 6;
				break;
			case 5:
				data.fPos += 4;
				break;
			case 6:
				data.fPos += 3;
				break;
			case 7:
				data.fPos += 4;
				break;
			case 8:
				data.oPos += 3;
				break;
			case 9:
				data.fPos += 4;
				break;
			case 10:
				data.fPos += 5;
				data.oPos += 1;
				break;
			case 12:
				data.oPos += 4;
				break;
			case 13:
				break;
			case 14:
				data.oPos += 2;
				data.bPos += 2;
				break;
			case 15:
				data.oPos += 4;
				data.iiPos += 2;
				data.ffPos += 1;
				data.fPos += 1;
				break;
			case 16:
				data.oPos += 4;
				data.iPos += 1;
				data.fPos += 2;
				data.bPos += 1;
				break;
			case 17:
				data.fPos += 2;
				break;
			case 18:
				data.fPos += 2;
				break;
			case 19:
				data.oPos += 1;
				break;
			case 20:
				data.oPos += 1;
				break;
			case 21:case 22:
				break;
			default:
			}
			data.prev = type;
		}
	}
	if(stl != null) {
		openfl_geom_Point.__pool.release(stl);
	}
	if(sbr != null) {
		openfl_geom_Point.__pool.release(sbr);
	}
	data.destroy();
	if(hasPath) {
		if(stroke && openfl_display__$internal_CanvasGraphics.hasStroke) {
			if(openfl_display__$internal_CanvasGraphics.hasFill) {
				if(positionX != startX || positionY != startY) {
					openfl_display__$internal_CanvasGraphics.context.lineTo(startX - offsetX,startY - offsetY);
					closeGap = true;
				}
				if(closeGap) {
					openfl_display__$internal_CanvasGraphics.closePath(true);
				}
			} else if(closeGap && positionX == startX && positionY == startY) {
				openfl_display__$internal_CanvasGraphics.closePath(true);
			}
			if(!openfl_display__$internal_CanvasGraphics.hitTesting && openfl_display__$internal_CanvasGraphics.strokePattern != null && (openfl_display__$internal_CanvasGraphics.bitmapStrokeMatrix != null || hasScale9Grid && openfl_display__$internal_CanvasGraphics.strokeScale9Bounds != null && openfl_display__$internal_CanvasGraphics.bitmapStroke != null)) {
				var matrix = openfl_geom_Matrix.__pool.get();
				if(openfl_display__$internal_CanvasGraphics.bitmapStrokeMatrix != null) {
					matrix.copyFrom(openfl_display__$internal_CanvasGraphics.bitmapStrokeMatrix);
				} else {
					matrix.identity();
				}
				if(hasScale9Grid && openfl_display__$internal_CanvasGraphics.strokeScale9Bounds != null && openfl_display__$internal_CanvasGraphics.bitmapStroke != null) {
					var scaleX = openfl_display__$internal_CanvasGraphics.strokeScale9Bounds.getScaleX();
					var scaleY = openfl_display__$internal_CanvasGraphics.strokeScale9Bounds.getScaleY();
					if(scaleX > 0.0 && scaleY > 0.0) {
						matrix.scale(scaleX,scaleY);
					}
				}
				var strokePatternMatrix = new DOMMatrix([matrix.a,matrix.b,matrix.c,matrix.d,matrix.tx,matrix.ty]);
				openfl_display__$internal_CanvasGraphics.strokePattern.setTransform(strokePatternMatrix);
				openfl_geom_Matrix.__pool.release(matrix);
			}
			if(!openfl_display__$internal_CanvasGraphics.hitTesting) {
				openfl_display__$internal_CanvasGraphics.context.stroke();
			}
		}
		if(!stroke) {
			if(openfl_display__$internal_CanvasGraphics.hasFill || openfl_display__$internal_CanvasGraphics.bitmapFill != null) {
				openfl_display__$internal_CanvasGraphics.context.translate(-openfl_display__$internal_CanvasGraphics.bounds.x,-openfl_display__$internal_CanvasGraphics.bounds.y);
				var inverseTranslateX = 0.0;
				var inverseTranslateY = 0.0;
				var inverseScaleX = 1.0;
				var inverseScaleY = 1.0;
				if(!openfl_display__$internal_CanvasGraphics.hitTesting && hasScale9Grid && openfl_display__$internal_CanvasGraphics.fillScale9Bounds != null && openfl_display__$internal_CanvasGraphics.bitmapFill != null) {
					var scaleX = openfl_display__$internal_CanvasGraphics.fillScale9Bounds.getScaleX();
					var scaleY = openfl_display__$internal_CanvasGraphics.fillScale9Bounds.getScaleY();
					if(scaleX > 0.0 && scaleY > 0.0) {
						openfl_display__$internal_CanvasGraphics.context.scale(scaleX,scaleY);
						inverseScaleX = 1.0 / scaleX;
						inverseScaleY = 1.0 / scaleY;
						var remX = openfl_display__$internal_CanvasGraphics.fillScale9Bounds.unscaledMinX % openfl_display__$internal_CanvasGraphics.bitmapFill.width;
						var remY = openfl_display__$internal_CanvasGraphics.fillScale9Bounds.unscaledMinY % openfl_display__$internal_CanvasGraphics.bitmapFill.height;
						var adjustedRemX = openfl_display__$internal_CanvasGraphics.fillScale9Bounds.scale9MinX % (openfl_display__$internal_CanvasGraphics.bitmapFill.width * scaleX) / scaleX;
						var adjustedRemY = openfl_display__$internal_CanvasGraphics.fillScale9Bounds.scale9MinY % (openfl_display__$internal_CanvasGraphics.bitmapFill.height * scaleY) / scaleY;
						var translateX = adjustedRemX - remX;
						var translateY = adjustedRemY - remY;
						openfl_display__$internal_CanvasGraphics.context.translate(translateX,translateY);
						inverseTranslateX = -translateX;
						inverseTranslateY = -translateY;
					}
				}
				if(openfl_display__$internal_CanvasGraphics.pendingMatrix != null) {
					openfl_display__$internal_CanvasGraphics.context.transform(openfl_display__$internal_CanvasGraphics.pendingMatrix.a,openfl_display__$internal_CanvasGraphics.pendingMatrix.b,openfl_display__$internal_CanvasGraphics.pendingMatrix.c,openfl_display__$internal_CanvasGraphics.pendingMatrix.d,openfl_display__$internal_CanvasGraphics.pendingMatrix.tx,openfl_display__$internal_CanvasGraphics.pendingMatrix.ty);
					if(!openfl_display__$internal_CanvasGraphics.hitTesting) {
						openfl_display__$internal_CanvasGraphics.context.fill(openfl_display__$internal_CanvasGraphics.windingRule);
					}
					openfl_display__$internal_CanvasGraphics.context.transform(openfl_display__$internal_CanvasGraphics.inversePendingMatrix.a,openfl_display__$internal_CanvasGraphics.inversePendingMatrix.b,openfl_display__$internal_CanvasGraphics.inversePendingMatrix.c,openfl_display__$internal_CanvasGraphics.inversePendingMatrix.d,openfl_display__$internal_CanvasGraphics.inversePendingMatrix.tx,openfl_display__$internal_CanvasGraphics.inversePendingMatrix.ty);
				} else if(!openfl_display__$internal_CanvasGraphics.hitTesting) {
					openfl_display__$internal_CanvasGraphics.context.fill(openfl_display__$internal_CanvasGraphics.windingRule);
				}
				if(!openfl_display__$internal_CanvasGraphics.hitTesting && hasScale9Grid && openfl_display__$internal_CanvasGraphics.fillScale9Bounds != null && openfl_display__$internal_CanvasGraphics.bitmapFill != null) {
					openfl_display__$internal_CanvasGraphics.context.translate(inverseTranslateX,inverseTranslateY);
					openfl_display__$internal_CanvasGraphics.context.scale(inverseScaleX,inverseScaleY);
				}
				openfl_display__$internal_CanvasGraphics.context.translate(openfl_display__$internal_CanvasGraphics.bounds.x,openfl_display__$internal_CanvasGraphics.bounds.y);
				openfl_display__$internal_CanvasGraphics.context.closePath();
			}
		}
	}
};
openfl_display__$internal_CanvasGraphics.render = function(graphics,renderer) {
	var pixelRatio = renderer.__pixelRatio;
	var scale9Grid = graphics.__owner.__scale9Grid;
	var hasScale9Grid = scale9Grid != null && !graphics.__owner.__isMask && graphics.__worldTransform.b == 0 && graphics.__worldTransform.c == 0;
	if(hasScale9Grid) {
		graphics.__bitmapScaleX = graphics.__owner.get_scaleX();
		graphics.__bitmapScaleY = graphics.__owner.get_scaleY();
	} else {
		graphics.__bitmapScaleX = 1;
		graphics.__bitmapScaleY = 1;
	}
	graphics.__update(renderer.__worldTransform,pixelRatio);
	if(graphics.__softwareDirty) {
		openfl_display__$internal_CanvasGraphics.hitTesting = false;
		openfl_display__$internal_CanvasGraphics.graphics = graphics;
		openfl_display__$internal_CanvasGraphics.allowSmoothing = renderer.__allowSmoothing;
		openfl_display__$internal_CanvasGraphics.worldAlpha = renderer.__getAlpha(graphics.__owner.__worldAlpha);
		openfl_display__$internal_CanvasGraphics.bounds = graphics.__bounds;
		var width = graphics.__width;
		var height = graphics.__height;
		if(!graphics.__visible || graphics.__commands.get_length() == 0 || openfl_display__$internal_CanvasGraphics.bounds == null || width < 1 || height < 1) {
			graphics.__canvas = null;
			graphics.__context = null;
			graphics.__bitmap = null;
		} else {
			if(graphics.__canvas == null) {
				graphics.__canvas = window.document.createElement("canvas");
				graphics.__context = graphics.__canvas.getContext("2d");
			}
			openfl_display__$internal_CanvasGraphics.context = graphics.__context;
			var transform = graphics.__renderTransform;
			var canvas = graphics.__canvas;
			var scale = renderer.__pixelRatio;
			var scaledWidth = width * scale | 0;
			var scaledHeight = height * scale | 0;
			renderer.__setBlendModeContext(openfl_display__$internal_CanvasGraphics.context,10);
			if(renderer.__isDOM) {
				if(canvas.width == scaledWidth && canvas.height == scaledHeight) {
					openfl_display__$internal_CanvasGraphics.context.clearRect(0,0,scaledWidth,scaledHeight);
				} else {
					canvas.width = scaledWidth;
					canvas.height = scaledHeight;
					canvas.style.width = width + "px";
					canvas.style.height = height + "px";
				}
				var transform1 = graphics.__renderTransform;
				openfl_display__$internal_CanvasGraphics.context.setTransform(transform1.a * scale,transform1.b * scale,transform1.c * scale,transform1.d * scale,transform1.tx * scale,transform1.ty * scale);
			} else {
				if(canvas.width == scaledWidth && canvas.height == scaledHeight) {
					openfl_display__$internal_CanvasGraphics.context.closePath();
					openfl_display__$internal_CanvasGraphics.context.setTransform(1,0,0,1,0,0);
					openfl_display__$internal_CanvasGraphics.context.clearRect(0,0,scaledWidth,scaledHeight);
				} else {
					canvas.width = width;
					canvas.height = height;
				}
				openfl_display__$internal_CanvasGraphics.context.setTransform(transform.a,transform.b,transform.c,transform.d,transform.tx,transform.ty);
			}
			openfl_display__$internal_CanvasGraphics.fillCommands.clear();
			openfl_display__$internal_CanvasGraphics.strokeCommands.clear();
			openfl_display__$internal_CanvasGraphics.hasFill = false;
			openfl_display__$internal_CanvasGraphics.hasStroke = false;
			openfl_display__$internal_CanvasGraphics.bitmapFill = null;
			openfl_display__$internal_CanvasGraphics.bitmapRepeat = false;
			var hasLineStyle = false;
			var initStrokeX = 0.0;
			var initStrokeY = 0.0;
			openfl_display__$internal_CanvasGraphics.windingRule = "evenodd";
			var data = new openfl_display__$internal_DrawCommandReader(graphics.__commands);
			var _g = 0;
			var _g1 = graphics.__commands.types;
			while(_g < _g1.length) {
				var type = _g1[_g];
				++_g;
				switch(type._hx_index) {
				case 0:case 1:case 2:case 3:
					openfl_display__$internal_CanvasGraphics.endFill();
					openfl_display__$internal_CanvasGraphics.endStroke();
					if(type == openfl_display__$internal_DrawCommandType.BEGIN_BITMAP_FILL) {
						switch(data.prev._hx_index) {
						case 0:
							data.oPos += 2;
							data.bPos += 2;
							break;
						case 1:
							data.iPos += 1;
							data.fPos += 1;
							break;
						case 2:
							data.oPos += 4;
							data.iiPos += 2;
							data.ffPos += 1;
							data.fPos += 1;
							break;
						case 3:
							data.oPos += 1;
							break;
						case 4:
							data.fPos += 6;
							break;
						case 5:
							data.fPos += 4;
							break;
						case 6:
							data.fPos += 3;
							break;
						case 7:
							data.fPos += 4;
							break;
						case 8:
							data.oPos += 3;
							break;
						case 9:
							data.fPos += 4;
							break;
						case 10:
							data.fPos += 5;
							data.oPos += 1;
							break;
						case 12:
							data.oPos += 4;
							break;
						case 13:
							break;
						case 14:
							data.oPos += 2;
							data.bPos += 2;
							break;
						case 15:
							data.oPos += 4;
							data.iiPos += 2;
							data.ffPos += 1;
							data.fPos += 1;
							break;
						case 16:
							data.oPos += 4;
							data.iPos += 1;
							data.fPos += 2;
							data.bPos += 1;
							break;
						case 17:
							data.fPos += 2;
							break;
						case 18:
							data.fPos += 2;
							break;
						case 19:
							data.oPos += 1;
							break;
						case 20:
							data.oPos += 1;
							break;
						case 21:case 22:
							break;
						default:
						}
						data.prev = openfl_display__$internal_DrawCommandType.BEGIN_BITMAP_FILL;
						var c = data;
						openfl_display__$internal_CanvasGraphics.fillCommands.beginBitmapFill(c.buffer.o[c.oPos],c.buffer.o[c.oPos + 1],c.buffer.b[c.bPos],c.buffer.b[c.bPos + 1]);
						openfl_display__$internal_CanvasGraphics.strokeCommands.beginBitmapFill(c.buffer.o[c.oPos],c.buffer.o[c.oPos + 1],c.buffer.b[c.bPos],c.buffer.b[c.bPos + 1]);
					} else if(type == openfl_display__$internal_DrawCommandType.BEGIN_GRADIENT_FILL) {
						switch(data.prev._hx_index) {
						case 0:
							data.oPos += 2;
							data.bPos += 2;
							break;
						case 1:
							data.iPos += 1;
							data.fPos += 1;
							break;
						case 2:
							data.oPos += 4;
							data.iiPos += 2;
							data.ffPos += 1;
							data.fPos += 1;
							break;
						case 3:
							data.oPos += 1;
							break;
						case 4:
							data.fPos += 6;
							break;
						case 5:
							data.fPos += 4;
							break;
						case 6:
							data.fPos += 3;
							break;
						case 7:
							data.fPos += 4;
							break;
						case 8:
							data.oPos += 3;
							break;
						case 9:
							data.fPos += 4;
							break;
						case 10:
							data.fPos += 5;
							data.oPos += 1;
							break;
						case 12:
							data.oPos += 4;
							break;
						case 13:
							break;
						case 14:
							data.oPos += 2;
							data.bPos += 2;
							break;
						case 15:
							data.oPos += 4;
							data.iiPos += 2;
							data.ffPos += 1;
							data.fPos += 1;
							break;
						case 16:
							data.oPos += 4;
							data.iPos += 1;
							data.fPos += 2;
							data.bPos += 1;
							break;
						case 17:
							data.fPos += 2;
							break;
						case 18:
							data.fPos += 2;
							break;
						case 19:
							data.oPos += 1;
							break;
						case 20:
							data.oPos += 1;
							break;
						case 21:case 22:
							break;
						default:
						}
						data.prev = openfl_display__$internal_DrawCommandType.BEGIN_GRADIENT_FILL;
						var c1 = data;
						openfl_display__$internal_CanvasGraphics.fillCommands.beginGradientFill(c1.buffer.o[c1.oPos],c1.buffer.ii[c1.iiPos],c1.buffer.ff[c1.ffPos],c1.buffer.ii[c1.iiPos + 1],c1.buffer.o[c1.oPos + 1],c1.buffer.o[c1.oPos + 2],c1.buffer.o[c1.oPos + 3],c1.buffer.f[c1.fPos]);
						openfl_display__$internal_CanvasGraphics.strokeCommands.beginGradientFill(c1.buffer.o[c1.oPos],c1.buffer.ii[c1.iiPos],c1.buffer.ff[c1.ffPos],c1.buffer.ii[c1.iiPos + 1],c1.buffer.o[c1.oPos + 1],c1.buffer.o[c1.oPos + 2],c1.buffer.o[c1.oPos + 3],c1.buffer.f[c1.fPos]);
					} else if(type == openfl_display__$internal_DrawCommandType.BEGIN_SHADER_FILL) {
						switch(data.prev._hx_index) {
						case 0:
							data.oPos += 2;
							data.bPos += 2;
							break;
						case 1:
							data.iPos += 1;
							data.fPos += 1;
							break;
						case 2:
							data.oPos += 4;
							data.iiPos += 2;
							data.ffPos += 1;
							data.fPos += 1;
							break;
						case 3:
							data.oPos += 1;
							break;
						case 4:
							data.fPos += 6;
							break;
						case 5:
							data.fPos += 4;
							break;
						case 6:
							data.fPos += 3;
							break;
						case 7:
							data.fPos += 4;
							break;
						case 8:
							data.oPos += 3;
							break;
						case 9:
							data.fPos += 4;
							break;
						case 10:
							data.fPos += 5;
							data.oPos += 1;
							break;
						case 12:
							data.oPos += 4;
							break;
						case 13:
							break;
						case 14:
							data.oPos += 2;
							data.bPos += 2;
							break;
						case 15:
							data.oPos += 4;
							data.iiPos += 2;
							data.ffPos += 1;
							data.fPos += 1;
							break;
						case 16:
							data.oPos += 4;
							data.iPos += 1;
							data.fPos += 2;
							data.bPos += 1;
							break;
						case 17:
							data.fPos += 2;
							break;
						case 18:
							data.fPos += 2;
							break;
						case 19:
							data.oPos += 1;
							break;
						case 20:
							data.oPos += 1;
							break;
						case 21:case 22:
							break;
						default:
						}
						data.prev = openfl_display__$internal_DrawCommandType.BEGIN_SHADER_FILL;
						var c2 = data;
						openfl_display__$internal_CanvasGraphics.fillCommands.beginShaderFill(c2.buffer.o[c2.oPos]);
						openfl_display__$internal_CanvasGraphics.strokeCommands.beginShaderFill(c2.buffer.o[c2.oPos]);
					} else {
						switch(data.prev._hx_index) {
						case 0:
							data.oPos += 2;
							data.bPos += 2;
							break;
						case 1:
							data.iPos += 1;
							data.fPos += 1;
							break;
						case 2:
							data.oPos += 4;
							data.iiPos += 2;
							data.ffPos += 1;
							data.fPos += 1;
							break;
						case 3:
							data.oPos += 1;
							break;
						case 4:
							data.fPos += 6;
							break;
						case 5:
							data.fPos += 4;
							break;
						case 6:
							data.fPos += 3;
							break;
						case 7:
							data.fPos += 4;
							break;
						case 8:
							data.oPos += 3;
							break;
						case 9:
							data.fPos += 4;
							break;
						case 10:
							data.fPos += 5;
							data.oPos += 1;
							break;
						case 12:
							data.oPos += 4;
							break;
						case 13:
							break;
						case 14:
							data.oPos += 2;
							data.bPos += 2;
							break;
						case 15:
							data.oPos += 4;
							data.iiPos += 2;
							data.ffPos += 1;
							data.fPos += 1;
							break;
						case 16:
							data.oPos += 4;
							data.iPos += 1;
							data.fPos += 2;
							data.bPos += 1;
							break;
						case 17:
							data.fPos += 2;
							break;
						case 18:
							data.fPos += 2;
							break;
						case 19:
							data.oPos += 1;
							break;
						case 20:
							data.oPos += 1;
							break;
						case 21:case 22:
							break;
						default:
						}
						data.prev = openfl_display__$internal_DrawCommandType.BEGIN_FILL;
						var c3 = data;
						openfl_display__$internal_CanvasGraphics.fillCommands.beginFill(c3.buffer.i[c3.iPos],c3.buffer.f[c3.fPos]);
						openfl_display__$internal_CanvasGraphics.strokeCommands.beginFill(c3.buffer.i[c3.iPos],c3.buffer.f[c3.fPos]);
					}
					break;
				case 4:
					switch(data.prev._hx_index) {
					case 0:
						data.oPos += 2;
						data.bPos += 2;
						break;
					case 1:
						data.iPos += 1;
						data.fPos += 1;
						break;
					case 2:
						data.oPos += 4;
						data.iiPos += 2;
						data.ffPos += 1;
						data.fPos += 1;
						break;
					case 3:
						data.oPos += 1;
						break;
					case 4:
						data.fPos += 6;
						break;
					case 5:
						data.fPos += 4;
						break;
					case 6:
						data.fPos += 3;
						break;
					case 7:
						data.fPos += 4;
						break;
					case 8:
						data.oPos += 3;
						break;
					case 9:
						data.fPos += 4;
						break;
					case 10:
						data.fPos += 5;
						data.oPos += 1;
						break;
					case 12:
						data.oPos += 4;
						break;
					case 13:
						break;
					case 14:
						data.oPos += 2;
						data.bPos += 2;
						break;
					case 15:
						data.oPos += 4;
						data.iiPos += 2;
						data.ffPos += 1;
						data.fPos += 1;
						break;
					case 16:
						data.oPos += 4;
						data.iPos += 1;
						data.fPos += 2;
						data.bPos += 1;
						break;
					case 17:
						data.fPos += 2;
						break;
					case 18:
						data.fPos += 2;
						break;
					case 19:
						data.oPos += 1;
						break;
					case 20:
						data.oPos += 1;
						break;
					case 21:case 22:
						break;
					default:
					}
					data.prev = openfl_display__$internal_DrawCommandType.CUBIC_CURVE_TO;
					var c4 = data;
					openfl_display__$internal_CanvasGraphics.fillCommands.cubicCurveTo(c4.buffer.f[c4.fPos],c4.buffer.f[c4.fPos + 1],c4.buffer.f[c4.fPos + 2],c4.buffer.f[c4.fPos + 3],c4.buffer.f[c4.fPos + 4],c4.buffer.f[c4.fPos + 5]);
					if(hasLineStyle) {
						openfl_display__$internal_CanvasGraphics.strokeCommands.cubicCurveTo(c4.buffer.f[c4.fPos],c4.buffer.f[c4.fPos + 1],c4.buffer.f[c4.fPos + 2],c4.buffer.f[c4.fPos + 3],c4.buffer.f[c4.fPos + 4],c4.buffer.f[c4.fPos + 5]);
					} else {
						initStrokeX = c4.buffer.f[c4.fPos + 4];
						initStrokeY = c4.buffer.f[c4.fPos + 5];
					}
					break;
				case 5:
					switch(data.prev._hx_index) {
					case 0:
						data.oPos += 2;
						data.bPos += 2;
						break;
					case 1:
						data.iPos += 1;
						data.fPos += 1;
						break;
					case 2:
						data.oPos += 4;
						data.iiPos += 2;
						data.ffPos += 1;
						data.fPos += 1;
						break;
					case 3:
						data.oPos += 1;
						break;
					case 4:
						data.fPos += 6;
						break;
					case 5:
						data.fPos += 4;
						break;
					case 6:
						data.fPos += 3;
						break;
					case 7:
						data.fPos += 4;
						break;
					case 8:
						data.oPos += 3;
						break;
					case 9:
						data.fPos += 4;
						break;
					case 10:
						data.fPos += 5;
						data.oPos += 1;
						break;
					case 12:
						data.oPos += 4;
						break;
					case 13:
						break;
					case 14:
						data.oPos += 2;
						data.bPos += 2;
						break;
					case 15:
						data.oPos += 4;
						data.iiPos += 2;
						data.ffPos += 1;
						data.fPos += 1;
						break;
					case 16:
						data.oPos += 4;
						data.iPos += 1;
						data.fPos += 2;
						data.bPos += 1;
						break;
					case 17:
						data.fPos += 2;
						break;
					case 18:
						data.fPos += 2;
						break;
					case 19:
						data.oPos += 1;
						break;
					case 20:
						data.oPos += 1;
						break;
					case 21:case 22:
						break;
					default:
					}
					data.prev = openfl_display__$internal_DrawCommandType.CURVE_TO;
					var c5 = data;
					openfl_display__$internal_CanvasGraphics.fillCommands.curveTo(c5.buffer.f[c5.fPos],c5.buffer.f[c5.fPos + 1],c5.buffer.f[c5.fPos + 2],c5.buffer.f[c5.fPos + 3]);
					if(hasLineStyle) {
						openfl_display__$internal_CanvasGraphics.strokeCommands.curveTo(c5.buffer.f[c5.fPos],c5.buffer.f[c5.fPos + 1],c5.buffer.f[c5.fPos + 2],c5.buffer.f[c5.fPos + 3]);
					} else {
						initStrokeX = c5.buffer.f[c5.fPos + 2];
						initStrokeY = c5.buffer.f[c5.fPos + 3];
					}
					break;
				case 6:
					switch(data.prev._hx_index) {
					case 0:
						data.oPos += 2;
						data.bPos += 2;
						break;
					case 1:
						data.iPos += 1;
						data.fPos += 1;
						break;
					case 2:
						data.oPos += 4;
						data.iiPos += 2;
						data.ffPos += 1;
						data.fPos += 1;
						break;
					case 3:
						data.oPos += 1;
						break;
					case 4:
						data.fPos += 6;
						break;
					case 5:
						data.fPos += 4;
						break;
					case 6:
						data.fPos += 3;
						break;
					case 7:
						data.fPos += 4;
						break;
					case 8:
						data.oPos += 3;
						break;
					case 9:
						data.fPos += 4;
						break;
					case 10:
						data.fPos += 5;
						data.oPos += 1;
						break;
					case 12:
						data.oPos += 4;
						break;
					case 13:
						break;
					case 14:
						data.oPos += 2;
						data.bPos += 2;
						break;
					case 15:
						data.oPos += 4;
						data.iiPos += 2;
						data.ffPos += 1;
						data.fPos += 1;
						break;
					case 16:
						data.oPos += 4;
						data.iPos += 1;
						data.fPos += 2;
						data.bPos += 1;
						break;
					case 17:
						data.fPos += 2;
						break;
					case 18:
						data.fPos += 2;
						break;
					case 19:
						data.oPos += 1;
						break;
					case 20:
						data.oPos += 1;
						break;
					case 21:case 22:
						break;
					default:
					}
					data.prev = openfl_display__$internal_DrawCommandType.DRAW_CIRCLE;
					var c6 = data;
					openfl_display__$internal_CanvasGraphics.fillCommands.drawCircle(c6.buffer.f[c6.fPos],c6.buffer.f[c6.fPos + 1],c6.buffer.f[c6.fPos + 2]);
					if(hasLineStyle) {
						openfl_display__$internal_CanvasGraphics.strokeCommands.drawCircle(c6.buffer.f[c6.fPos],c6.buffer.f[c6.fPos + 1],c6.buffer.f[c6.fPos + 2]);
					}
					break;
				case 7:
					switch(data.prev._hx_index) {
					case 0:
						data.oPos += 2;
						data.bPos += 2;
						break;
					case 1:
						data.iPos += 1;
						data.fPos += 1;
						break;
					case 2:
						data.oPos += 4;
						data.iiPos += 2;
						data.ffPos += 1;
						data.fPos += 1;
						break;
					case 3:
						data.oPos += 1;
						break;
					case 4:
						data.fPos += 6;
						break;
					case 5:
						data.fPos += 4;
						break;
					case 6:
						data.fPos += 3;
						break;
					case 7:
						data.fPos += 4;
						break;
					case 8:
						data.oPos += 3;
						break;
					case 9:
						data.fPos += 4;
						break;
					case 10:
						data.fPos += 5;
						data.oPos += 1;
						break;
					case 12:
						data.oPos += 4;
						break;
					case 13:
						break;
					case 14:
						data.oPos += 2;
						data.bPos += 2;
						break;
					case 15:
						data.oPos += 4;
						data.iiPos += 2;
						data.ffPos += 1;
						data.fPos += 1;
						break;
					case 16:
						data.oPos += 4;
						data.iPos += 1;
						data.fPos += 2;
						data.bPos += 1;
						break;
					case 17:
						data.fPos += 2;
						break;
					case 18:
						data.fPos += 2;
						break;
					case 19:
						data.oPos += 1;
						break;
					case 20:
						data.oPos += 1;
						break;
					case 21:case 22:
						break;
					default:
					}
					data.prev = openfl_display__$internal_DrawCommandType.DRAW_ELLIPSE;
					var c7 = data;
					openfl_display__$internal_CanvasGraphics.fillCommands.drawEllipse(c7.buffer.f[c7.fPos],c7.buffer.f[c7.fPos + 1],c7.buffer.f[c7.fPos + 2],c7.buffer.f[c7.fPos + 3]);
					if(hasLineStyle) {
						openfl_display__$internal_CanvasGraphics.strokeCommands.drawEllipse(c7.buffer.f[c7.fPos],c7.buffer.f[c7.fPos + 1],c7.buffer.f[c7.fPos + 2],c7.buffer.f[c7.fPos + 3]);
					}
					break;
				case 8:
					switch(data.prev._hx_index) {
					case 0:
						data.oPos += 2;
						data.bPos += 2;
						break;
					case 1:
						data.iPos += 1;
						data.fPos += 1;
						break;
					case 2:
						data.oPos += 4;
						data.iiPos += 2;
						data.ffPos += 1;
						data.fPos += 1;
						break;
					case 3:
						data.oPos += 1;
						break;
					case 4:
						data.fPos += 6;
						break;
					case 5:
						data.fPos += 4;
						break;
					case 6:
						data.fPos += 3;
						break;
					case 7:
						data.fPos += 4;
						break;
					case 8:
						data.oPos += 3;
						break;
					case 9:
						data.fPos += 4;
						break;
					case 10:
						data.fPos += 5;
						data.oPos += 1;
						break;
					case 12:
						data.oPos += 4;
						break;
					case 13:
						break;
					case 14:
						data.oPos += 2;
						data.bPos += 2;
						break;
					case 15:
						data.oPos += 4;
						data.iiPos += 2;
						data.ffPos += 1;
						data.fPos += 1;
						break;
					case 16:
						data.oPos += 4;
						data.iPos += 1;
						data.fPos += 2;
						data.bPos += 1;
						break;
					case 17:
						data.fPos += 2;
						break;
					case 18:
						data.fPos += 2;
						break;
					case 19:
						data.oPos += 1;
						break;
					case 20:
						data.oPos += 1;
						break;
					case 21:case 22:
						break;
					default:
					}
					data.prev = openfl_display__$internal_DrawCommandType.DRAW_QUADS;
					var c8 = data;
					openfl_display__$internal_CanvasGraphics.fillCommands.drawQuads(c8.buffer.o[c8.oPos],c8.buffer.o[c8.oPos + 1],c8.buffer.o[c8.oPos + 2]);
					break;
				case 9:
					switch(data.prev._hx_index) {
					case 0:
						data.oPos += 2;
						data.bPos += 2;
						break;
					case 1:
						data.iPos += 1;
						data.fPos += 1;
						break;
					case 2:
						data.oPos += 4;
						data.iiPos += 2;
						data.ffPos += 1;
						data.fPos += 1;
						break;
					case 3:
						data.oPos += 1;
						break;
					case 4:
						data.fPos += 6;
						break;
					case 5:
						data.fPos += 4;
						break;
					case 6:
						data.fPos += 3;
						break;
					case 7:
						data.fPos += 4;
						break;
					case 8:
						data.oPos += 3;
						break;
					case 9:
						data.fPos += 4;
						break;
					case 10:
						data.fPos += 5;
						data.oPos += 1;
						break;
					case 12:
						data.oPos += 4;
						break;
					case 13:
						break;
					case 14:
						data.oPos += 2;
						data.bPos += 2;
						break;
					case 15:
						data.oPos += 4;
						data.iiPos += 2;
						data.ffPos += 1;
						data.fPos += 1;
						break;
					case 16:
						data.oPos += 4;
						data.iPos += 1;
						data.fPos += 2;
						data.bPos += 1;
						break;
					case 17:
						data.fPos += 2;
						break;
					case 18:
						data.fPos += 2;
						break;
					case 19:
						data.oPos += 1;
						break;
					case 20:
						data.oPos += 1;
						break;
					case 21:case 22:
						break;
					default:
					}
					data.prev = openfl_display__$internal_DrawCommandType.DRAW_RECT;
					var c9 = data;
					openfl_display__$internal_CanvasGraphics.fillCommands.drawRect(c9.buffer.f[c9.fPos],c9.buffer.f[c9.fPos + 1],c9.buffer.f[c9.fPos + 2],c9.buffer.f[c9.fPos + 3]);
					if(hasLineStyle) {
						openfl_display__$internal_CanvasGraphics.strokeCommands.drawRect(c9.buffer.f[c9.fPos],c9.buffer.f[c9.fPos + 1],c9.buffer.f[c9.fPos + 2],c9.buffer.f[c9.fPos + 3]);
					}
					break;
				case 10:
					switch(data.prev._hx_index) {
					case 0:
						data.oPos += 2;
						data.bPos += 2;
						break;
					case 1:
						data.iPos += 1;
						data.fPos += 1;
						break;
					case 2:
						data.oPos += 4;
						data.iiPos += 2;
						data.ffPos += 1;
						data.fPos += 1;
						break;
					case 3:
						data.oPos += 1;
						break;
					case 4:
						data.fPos += 6;
						break;
					case 5:
						data.fPos += 4;
						break;
					case 6:
						data.fPos += 3;
						break;
					case 7:
						data.fPos += 4;
						break;
					case 8:
						data.oPos += 3;
						break;
					case 9:
						data.fPos += 4;
						break;
					case 10:
						data.fPos += 5;
						data.oPos += 1;
						break;
					case 12:
						data.oPos += 4;
						break;
					case 13:
						break;
					case 14:
						data.oPos += 2;
						data.bPos += 2;
						break;
					case 15:
						data.oPos += 4;
						data.iiPos += 2;
						data.ffPos += 1;
						data.fPos += 1;
						break;
					case 16:
						data.oPos += 4;
						data.iPos += 1;
						data.fPos += 2;
						data.bPos += 1;
						break;
					case 17:
						data.fPos += 2;
						break;
					case 18:
						data.fPos += 2;
						break;
					case 19:
						data.oPos += 1;
						break;
					case 20:
						data.oPos += 1;
						break;
					case 21:case 22:
						break;
					default:
					}
					data.prev = openfl_display__$internal_DrawCommandType.DRAW_ROUND_RECT;
					var c10 = data;
					openfl_display__$internal_CanvasGraphics.fillCommands.drawRoundRect(c10.buffer.f[c10.fPos],c10.buffer.f[c10.fPos + 1],c10.buffer.f[c10.fPos + 2],c10.buffer.f[c10.fPos + 3],c10.buffer.f[c10.fPos + 4],c10.buffer.o[c10.oPos]);
					if(hasLineStyle) {
						openfl_display__$internal_CanvasGraphics.strokeCommands.drawRoundRect(c10.buffer.f[c10.fPos],c10.buffer.f[c10.fPos + 1],c10.buffer.f[c10.fPos + 2],c10.buffer.f[c10.fPos + 3],c10.buffer.f[c10.fPos + 4],c10.buffer.o[c10.oPos]);
					}
					break;
				case 12:
					switch(data.prev._hx_index) {
					case 0:
						data.oPos += 2;
						data.bPos += 2;
						break;
					case 1:
						data.iPos += 1;
						data.fPos += 1;
						break;
					case 2:
						data.oPos += 4;
						data.iiPos += 2;
						data.ffPos += 1;
						data.fPos += 1;
						break;
					case 3:
						data.oPos += 1;
						break;
					case 4:
						data.fPos += 6;
						break;
					case 5:
						data.fPos += 4;
						break;
					case 6:
						data.fPos += 3;
						break;
					case 7:
						data.fPos += 4;
						break;
					case 8:
						data.oPos += 3;
						break;
					case 9:
						data.fPos += 4;
						break;
					case 10:
						data.fPos += 5;
						data.oPos += 1;
						break;
					case 12:
						data.oPos += 4;
						break;
					case 13:
						break;
					case 14:
						data.oPos += 2;
						data.bPos += 2;
						break;
					case 15:
						data.oPos += 4;
						data.iiPos += 2;
						data.ffPos += 1;
						data.fPos += 1;
						break;
					case 16:
						data.oPos += 4;
						data.iPos += 1;
						data.fPos += 2;
						data.bPos += 1;
						break;
					case 17:
						data.fPos += 2;
						break;
					case 18:
						data.fPos += 2;
						break;
					case 19:
						data.oPos += 1;
						break;
					case 20:
						data.oPos += 1;
						break;
					case 21:case 22:
						break;
					default:
					}
					data.prev = openfl_display__$internal_DrawCommandType.DRAW_TRIANGLES;
					var c11 = data;
					openfl_display__$internal_CanvasGraphics.fillCommands.drawTriangles(c11.buffer.o[c11.oPos],c11.buffer.o[c11.oPos + 1],c11.buffer.o[c11.oPos + 2],c11.buffer.o[c11.oPos + 3]);
					break;
				case 13:
					switch(data.prev._hx_index) {
					case 0:
						data.oPos += 2;
						data.bPos += 2;
						break;
					case 1:
						data.iPos += 1;
						data.fPos += 1;
						break;
					case 2:
						data.oPos += 4;
						data.iiPos += 2;
						data.ffPos += 1;
						data.fPos += 1;
						break;
					case 3:
						data.oPos += 1;
						break;
					case 4:
						data.fPos += 6;
						break;
					case 5:
						data.fPos += 4;
						break;
					case 6:
						data.fPos += 3;
						break;
					case 7:
						data.fPos += 4;
						break;
					case 8:
						data.oPos += 3;
						break;
					case 9:
						data.fPos += 4;
						break;
					case 10:
						data.fPos += 5;
						data.oPos += 1;
						break;
					case 12:
						data.oPos += 4;
						break;
					case 13:
						break;
					case 14:
						data.oPos += 2;
						data.bPos += 2;
						break;
					case 15:
						data.oPos += 4;
						data.iiPos += 2;
						data.ffPos += 1;
						data.fPos += 1;
						break;
					case 16:
						data.oPos += 4;
						data.iPos += 1;
						data.fPos += 2;
						data.bPos += 1;
						break;
					case 17:
						data.fPos += 2;
						break;
					case 18:
						data.fPos += 2;
						break;
					case 19:
						data.oPos += 1;
						break;
					case 20:
						data.oPos += 1;
						break;
					case 21:case 22:
						break;
					default:
					}
					data.prev = openfl_display__$internal_DrawCommandType.END_FILL;
					var this1 = data;
					openfl_display__$internal_CanvasGraphics.endFill();
					openfl_display__$internal_CanvasGraphics.endStroke();
					openfl_display__$internal_CanvasGraphics.hasFill = false;
					openfl_display__$internal_CanvasGraphics.bitmapFill = null;
					initStrokeX = 0;
					initStrokeY = 0;
					break;
				case 14:
					switch(data.prev._hx_index) {
					case 0:
						data.oPos += 2;
						data.bPos += 2;
						break;
					case 1:
						data.iPos += 1;
						data.fPos += 1;
						break;
					case 2:
						data.oPos += 4;
						data.iiPos += 2;
						data.ffPos += 1;
						data.fPos += 1;
						break;
					case 3:
						data.oPos += 1;
						break;
					case 4:
						data.fPos += 6;
						break;
					case 5:
						data.fPos += 4;
						break;
					case 6:
						data.fPos += 3;
						break;
					case 7:
						data.fPos += 4;
						break;
					case 8:
						data.oPos += 3;
						break;
					case 9:
						data.fPos += 4;
						break;
					case 10:
						data.fPos += 5;
						data.oPos += 1;
						break;
					case 12:
						data.oPos += 4;
						break;
					case 13:
						break;
					case 14:
						data.oPos += 2;
						data.bPos += 2;
						break;
					case 15:
						data.oPos += 4;
						data.iiPos += 2;
						data.ffPos += 1;
						data.fPos += 1;
						break;
					case 16:
						data.oPos += 4;
						data.iPos += 1;
						data.fPos += 2;
						data.bPos += 1;
						break;
					case 17:
						data.fPos += 2;
						break;
					case 18:
						data.fPos += 2;
						break;
					case 19:
						data.oPos += 1;
						break;
					case 20:
						data.oPos += 1;
						break;
					case 21:case 22:
						break;
					default:
					}
					data.prev = openfl_display__$internal_DrawCommandType.LINE_BITMAP_STYLE;
					var c12 = data;
					if(!hasLineStyle && (initStrokeX != 0 || initStrokeY != 0)) {
						openfl_display__$internal_CanvasGraphics.strokeCommands.moveTo(initStrokeX,initStrokeY);
						initStrokeX = 0;
						initStrokeY = 0;
					}
					hasLineStyle = true;
					openfl_display__$internal_CanvasGraphics.strokeCommands.lineBitmapStyle(c12.buffer.o[c12.oPos],c12.buffer.o[c12.oPos + 1],c12.buffer.b[c12.bPos],c12.buffer.b[c12.bPos + 1]);
					break;
				case 15:
					switch(data.prev._hx_index) {
					case 0:
						data.oPos += 2;
						data.bPos += 2;
						break;
					case 1:
						data.iPos += 1;
						data.fPos += 1;
						break;
					case 2:
						data.oPos += 4;
						data.iiPos += 2;
						data.ffPos += 1;
						data.fPos += 1;
						break;
					case 3:
						data.oPos += 1;
						break;
					case 4:
						data.fPos += 6;
						break;
					case 5:
						data.fPos += 4;
						break;
					case 6:
						data.fPos += 3;
						break;
					case 7:
						data.fPos += 4;
						break;
					case 8:
						data.oPos += 3;
						break;
					case 9:
						data.fPos += 4;
						break;
					case 10:
						data.fPos += 5;
						data.oPos += 1;
						break;
					case 12:
						data.oPos += 4;
						break;
					case 13:
						break;
					case 14:
						data.oPos += 2;
						data.bPos += 2;
						break;
					case 15:
						data.oPos += 4;
						data.iiPos += 2;
						data.ffPos += 1;
						data.fPos += 1;
						break;
					case 16:
						data.oPos += 4;
						data.iPos += 1;
						data.fPos += 2;
						data.bPos += 1;
						break;
					case 17:
						data.fPos += 2;
						break;
					case 18:
						data.fPos += 2;
						break;
					case 19:
						data.oPos += 1;
						break;
					case 20:
						data.oPos += 1;
						break;
					case 21:case 22:
						break;
					default:
					}
					data.prev = openfl_display__$internal_DrawCommandType.LINE_GRADIENT_STYLE;
					var c13 = data;
					if(!hasLineStyle && (initStrokeX != 0 || initStrokeY != 0)) {
						openfl_display__$internal_CanvasGraphics.strokeCommands.moveTo(initStrokeX,initStrokeY);
						initStrokeX = 0;
						initStrokeY = 0;
					}
					hasLineStyle = true;
					openfl_display__$internal_CanvasGraphics.strokeCommands.lineGradientStyle(c13.buffer.o[c13.oPos],c13.buffer.ii[c13.iiPos],c13.buffer.ff[c13.ffPos],c13.buffer.ii[c13.iiPos + 1],c13.buffer.o[c13.oPos + 1],c13.buffer.o[c13.oPos + 2],c13.buffer.o[c13.oPos + 3],c13.buffer.f[c13.fPos]);
					break;
				case 16:
					switch(data.prev._hx_index) {
					case 0:
						data.oPos += 2;
						data.bPos += 2;
						break;
					case 1:
						data.iPos += 1;
						data.fPos += 1;
						break;
					case 2:
						data.oPos += 4;
						data.iiPos += 2;
						data.ffPos += 1;
						data.fPos += 1;
						break;
					case 3:
						data.oPos += 1;
						break;
					case 4:
						data.fPos += 6;
						break;
					case 5:
						data.fPos += 4;
						break;
					case 6:
						data.fPos += 3;
						break;
					case 7:
						data.fPos += 4;
						break;
					case 8:
						data.oPos += 3;
						break;
					case 9:
						data.fPos += 4;
						break;
					case 10:
						data.fPos += 5;
						data.oPos += 1;
						break;
					case 12:
						data.oPos += 4;
						break;
					case 13:
						break;
					case 14:
						data.oPos += 2;
						data.bPos += 2;
						break;
					case 15:
						data.oPos += 4;
						data.iiPos += 2;
						data.ffPos += 1;
						data.fPos += 1;
						break;
					case 16:
						data.oPos += 4;
						data.iPos += 1;
						data.fPos += 2;
						data.bPos += 1;
						break;
					case 17:
						data.fPos += 2;
						break;
					case 18:
						data.fPos += 2;
						break;
					case 19:
						data.oPos += 1;
						break;
					case 20:
						data.oPos += 1;
						break;
					case 21:case 22:
						break;
					default:
					}
					data.prev = openfl_display__$internal_DrawCommandType.LINE_STYLE;
					var c14 = data;
					if(!hasLineStyle && c14.buffer.o[c14.oPos] != null) {
						if(initStrokeX != 0 || initStrokeY != 0) {
							openfl_display__$internal_CanvasGraphics.strokeCommands.moveTo(initStrokeX,initStrokeY);
							initStrokeX = 0;
							initStrokeY = 0;
						}
					}
					hasLineStyle = c14.buffer.o[c14.oPos] != null;
					openfl_display__$internal_CanvasGraphics.strokeCommands.lineStyle(c14.buffer.o[c14.oPos],c14.buffer.i[c14.iPos],c14.buffer.f[c14.fPos],c14.buffer.b[c14.bPos],c14.buffer.o[c14.oPos + 1],c14.buffer.o[c14.oPos + 2],c14.buffer.o[c14.oPos + 3],c14.buffer.f[c14.fPos + 1]);
					break;
				case 17:
					switch(data.prev._hx_index) {
					case 0:
						data.oPos += 2;
						data.bPos += 2;
						break;
					case 1:
						data.iPos += 1;
						data.fPos += 1;
						break;
					case 2:
						data.oPos += 4;
						data.iiPos += 2;
						data.ffPos += 1;
						data.fPos += 1;
						break;
					case 3:
						data.oPos += 1;
						break;
					case 4:
						data.fPos += 6;
						break;
					case 5:
						data.fPos += 4;
						break;
					case 6:
						data.fPos += 3;
						break;
					case 7:
						data.fPos += 4;
						break;
					case 8:
						data.oPos += 3;
						break;
					case 9:
						data.fPos += 4;
						break;
					case 10:
						data.fPos += 5;
						data.oPos += 1;
						break;
					case 12:
						data.oPos += 4;
						break;
					case 13:
						break;
					case 14:
						data.oPos += 2;
						data.bPos += 2;
						break;
					case 15:
						data.oPos += 4;
						data.iiPos += 2;
						data.ffPos += 1;
						data.fPos += 1;
						break;
					case 16:
						data.oPos += 4;
						data.iPos += 1;
						data.fPos += 2;
						data.bPos += 1;
						break;
					case 17:
						data.fPos += 2;
						break;
					case 18:
						data.fPos += 2;
						break;
					case 19:
						data.oPos += 1;
						break;
					case 20:
						data.oPos += 1;
						break;
					case 21:case 22:
						break;
					default:
					}
					data.prev = openfl_display__$internal_DrawCommandType.LINE_TO;
					var c15 = data;
					openfl_display__$internal_CanvasGraphics.fillCommands.lineTo(c15.buffer.f[c15.fPos],c15.buffer.f[c15.fPos + 1]);
					if(hasLineStyle) {
						openfl_display__$internal_CanvasGraphics.strokeCommands.lineTo(c15.buffer.f[c15.fPos],c15.buffer.f[c15.fPos + 1]);
					} else {
						initStrokeX = c15.buffer.f[c15.fPos];
						initStrokeY = c15.buffer.f[c15.fPos + 1];
					}
					break;
				case 18:
					switch(data.prev._hx_index) {
					case 0:
						data.oPos += 2;
						data.bPos += 2;
						break;
					case 1:
						data.iPos += 1;
						data.fPos += 1;
						break;
					case 2:
						data.oPos += 4;
						data.iiPos += 2;
						data.ffPos += 1;
						data.fPos += 1;
						break;
					case 3:
						data.oPos += 1;
						break;
					case 4:
						data.fPos += 6;
						break;
					case 5:
						data.fPos += 4;
						break;
					case 6:
						data.fPos += 3;
						break;
					case 7:
						data.fPos += 4;
						break;
					case 8:
						data.oPos += 3;
						break;
					case 9:
						data.fPos += 4;
						break;
					case 10:
						data.fPos += 5;
						data.oPos += 1;
						break;
					case 12:
						data.oPos += 4;
						break;
					case 13:
						break;
					case 14:
						data.oPos += 2;
						data.bPos += 2;
						break;
					case 15:
						data.oPos += 4;
						data.iiPos += 2;
						data.ffPos += 1;
						data.fPos += 1;
						break;
					case 16:
						data.oPos += 4;
						data.iPos += 1;
						data.fPos += 2;
						data.bPos += 1;
						break;
					case 17:
						data.fPos += 2;
						break;
					case 18:
						data.fPos += 2;
						break;
					case 19:
						data.oPos += 1;
						break;
					case 20:
						data.oPos += 1;
						break;
					case 21:case 22:
						break;
					default:
					}
					data.prev = openfl_display__$internal_DrawCommandType.MOVE_TO;
					var c16 = data;
					openfl_display__$internal_CanvasGraphics.fillCommands.moveTo(c16.buffer.f[c16.fPos],c16.buffer.f[c16.fPos + 1]);
					if(hasLineStyle) {
						openfl_display__$internal_CanvasGraphics.strokeCommands.moveTo(c16.buffer.f[c16.fPos],c16.buffer.f[c16.fPos + 1]);
					} else {
						initStrokeX = c16.buffer.f[c16.fPos];
						initStrokeY = c16.buffer.f[c16.fPos + 1];
					}
					break;
				case 19:
					switch(data.prev._hx_index) {
					case 0:
						data.oPos += 2;
						data.bPos += 2;
						break;
					case 1:
						data.iPos += 1;
						data.fPos += 1;
						break;
					case 2:
						data.oPos += 4;
						data.iiPos += 2;
						data.ffPos += 1;
						data.fPos += 1;
						break;
					case 3:
						data.oPos += 1;
						break;
					case 4:
						data.fPos += 6;
						break;
					case 5:
						data.fPos += 4;
						break;
					case 6:
						data.fPos += 3;
						break;
					case 7:
						data.fPos += 4;
						break;
					case 8:
						data.oPos += 3;
						break;
					case 9:
						data.fPos += 4;
						break;
					case 10:
						data.fPos += 5;
						data.oPos += 1;
						break;
					case 12:
						data.oPos += 4;
						break;
					case 13:
						break;
					case 14:
						data.oPos += 2;
						data.bPos += 2;
						break;
					case 15:
						data.oPos += 4;
						data.iiPos += 2;
						data.ffPos += 1;
						data.fPos += 1;
						break;
					case 16:
						data.oPos += 4;
						data.iPos += 1;
						data.fPos += 2;
						data.bPos += 1;
						break;
					case 17:
						data.fPos += 2;
						break;
					case 18:
						data.fPos += 2;
						break;
					case 19:
						data.oPos += 1;
						break;
					case 20:
						data.oPos += 1;
						break;
					case 21:case 22:
						break;
					default:
					}
					data.prev = openfl_display__$internal_DrawCommandType.OVERRIDE_BLEND_MODE;
					var c17 = data;
					renderer.__setBlendModeContext(openfl_display__$internal_CanvasGraphics.context,c17.buffer.o[c17.oPos]);
					break;
				case 21:
					switch(data.prev._hx_index) {
					case 0:
						data.oPos += 2;
						data.bPos += 2;
						break;
					case 1:
						data.iPos += 1;
						data.fPos += 1;
						break;
					case 2:
						data.oPos += 4;
						data.iiPos += 2;
						data.ffPos += 1;
						data.fPos += 1;
						break;
					case 3:
						data.oPos += 1;
						break;
					case 4:
						data.fPos += 6;
						break;
					case 5:
						data.fPos += 4;
						break;
					case 6:
						data.fPos += 3;
						break;
					case 7:
						data.fPos += 4;
						break;
					case 8:
						data.oPos += 3;
						break;
					case 9:
						data.fPos += 4;
						break;
					case 10:
						data.fPos += 5;
						data.oPos += 1;
						break;
					case 12:
						data.oPos += 4;
						break;
					case 13:
						break;
					case 14:
						data.oPos += 2;
						data.bPos += 2;
						break;
					case 15:
						data.oPos += 4;
						data.iiPos += 2;
						data.ffPos += 1;
						data.fPos += 1;
						break;
					case 16:
						data.oPos += 4;
						data.iPos += 1;
						data.fPos += 2;
						data.bPos += 1;
						break;
					case 17:
						data.fPos += 2;
						break;
					case 18:
						data.fPos += 2;
						break;
					case 19:
						data.oPos += 1;
						break;
					case 20:
						data.oPos += 1;
						break;
					case 21:case 22:
						break;
					default:
					}
					data.prev = openfl_display__$internal_DrawCommandType.WINDING_EVEN_ODD;
					var this2 = data;
					openfl_display__$internal_CanvasGraphics.fillCommands.windingEvenOdd();
					openfl_display__$internal_CanvasGraphics.windingRule = "evenodd";
					break;
				case 22:
					switch(data.prev._hx_index) {
					case 0:
						data.oPos += 2;
						data.bPos += 2;
						break;
					case 1:
						data.iPos += 1;
						data.fPos += 1;
						break;
					case 2:
						data.oPos += 4;
						data.iiPos += 2;
						data.ffPos += 1;
						data.fPos += 1;
						break;
					case 3:
						data.oPos += 1;
						break;
					case 4:
						data.fPos += 6;
						break;
					case 5:
						data.fPos += 4;
						break;
					case 6:
						data.fPos += 3;
						break;
					case 7:
						data.fPos += 4;
						break;
					case 8:
						data.oPos += 3;
						break;
					case 9:
						data.fPos += 4;
						break;
					case 10:
						data.fPos += 5;
						data.oPos += 1;
						break;
					case 12:
						data.oPos += 4;
						break;
					case 13:
						break;
					case 14:
						data.oPos += 2;
						data.bPos += 2;
						break;
					case 15:
						data.oPos += 4;
						data.iiPos += 2;
						data.ffPos += 1;
						data.fPos += 1;
						break;
					case 16:
						data.oPos += 4;
						data.iPos += 1;
						data.fPos += 2;
						data.bPos += 1;
						break;
					case 17:
						data.fPos += 2;
						break;
					case 18:
						data.fPos += 2;
						break;
					case 19:
						data.oPos += 1;
						break;
					case 20:
						data.oPos += 1;
						break;
					case 21:case 22:
						break;
					default:
					}
					data.prev = openfl_display__$internal_DrawCommandType.WINDING_NON_ZERO;
					var this3 = data;
					openfl_display__$internal_CanvasGraphics.fillCommands.windingNonZero();
					openfl_display__$internal_CanvasGraphics.windingRule = "nonzero";
					break;
				default:
					switch(data.prev._hx_index) {
					case 0:
						data.oPos += 2;
						data.bPos += 2;
						break;
					case 1:
						data.iPos += 1;
						data.fPos += 1;
						break;
					case 2:
						data.oPos += 4;
						data.iiPos += 2;
						data.ffPos += 1;
						data.fPos += 1;
						break;
					case 3:
						data.oPos += 1;
						break;
					case 4:
						data.fPos += 6;
						break;
					case 5:
						data.fPos += 4;
						break;
					case 6:
						data.fPos += 3;
						break;
					case 7:
						data.fPos += 4;
						break;
					case 8:
						data.oPos += 3;
						break;
					case 9:
						data.fPos += 4;
						break;
					case 10:
						data.fPos += 5;
						data.oPos += 1;
						break;
					case 12:
						data.oPos += 4;
						break;
					case 13:
						break;
					case 14:
						data.oPos += 2;
						data.bPos += 2;
						break;
					case 15:
						data.oPos += 4;
						data.iiPos += 2;
						data.ffPos += 1;
						data.fPos += 1;
						break;
					case 16:
						data.oPos += 4;
						data.iPos += 1;
						data.fPos += 2;
						data.bPos += 1;
						break;
					case 17:
						data.fPos += 2;
						break;
					case 18:
						data.fPos += 2;
						break;
					case 19:
						data.oPos += 1;
						break;
					case 20:
						data.oPos += 1;
						break;
					case 21:case 22:
						break;
					default:
					}
					data.prev = type;
				}
			}
			if(openfl_display__$internal_CanvasGraphics.fillCommands.get_length() > 0) {
				openfl_display__$internal_CanvasGraphics.endFill();
			}
			if(openfl_display__$internal_CanvasGraphics.strokeCommands.get_length() > 0) {
				openfl_display__$internal_CanvasGraphics.endStroke();
			}
			data.destroy();
			if(graphics.__bitmap == null) {
				graphics.__bitmap = openfl_display_BitmapData.fromCanvas(graphics.__canvas);
			} else if(graphics.__bitmap.width != graphics.__canvas.width || graphics.__bitmap.height != graphics.__canvas.height) {
				var texture = graphics.__bitmap.__texture;
				if(texture != null) {
					texture.dispose();
				}
				graphics.__bitmap = openfl_display_BitmapData.fromCanvas(graphics.__canvas);
			} else {
				graphics.__bitmap.image.version++;
			}
		}
		graphics.__softwareDirty = false;
		graphics.set___dirty(false);
		openfl_display__$internal_CanvasGraphics.graphics = null;
	}
};
openfl_display__$internal_CanvasGraphics.renderMask = function(graphics,renderer) {
	if(graphics.__commands.get_length() != 0) {
		openfl_display__$internal_CanvasGraphics.context = renderer.context;
		var positionX = 0.0;
		var positionY = 0.0;
		var offsetX = 0;
		var offsetY = 0;
		var data = new openfl_display__$internal_DrawCommandReader(graphics.__commands);
		var x;
		var y;
		var width;
		var height;
		var kappa = 0.5522848;
		var ox;
		var oy;
		var xe;
		var ye;
		var xm;
		var ym;
		var _g = 0;
		var _g1 = graphics.__commands.types;
		while(_g < _g1.length) {
			var type = _g1[_g];
			++_g;
			switch(type._hx_index) {
			case 4:
				switch(data.prev._hx_index) {
				case 0:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 1:
					data.iPos += 1;
					data.fPos += 1;
					break;
				case 2:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 3:
					data.oPos += 1;
					break;
				case 4:
					data.fPos += 6;
					break;
				case 5:
					data.fPos += 4;
					break;
				case 6:
					data.fPos += 3;
					break;
				case 7:
					data.fPos += 4;
					break;
				case 8:
					data.oPos += 3;
					break;
				case 9:
					data.fPos += 4;
					break;
				case 10:
					data.fPos += 5;
					data.oPos += 1;
					break;
				case 12:
					data.oPos += 4;
					break;
				case 13:
					break;
				case 14:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 15:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 16:
					data.oPos += 4;
					data.iPos += 1;
					data.fPos += 2;
					data.bPos += 1;
					break;
				case 17:
					data.fPos += 2;
					break;
				case 18:
					data.fPos += 2;
					break;
				case 19:
					data.oPos += 1;
					break;
				case 20:
					data.oPos += 1;
					break;
				case 21:case 22:
					break;
				default:
				}
				data.prev = openfl_display__$internal_DrawCommandType.CUBIC_CURVE_TO;
				var c = data;
				openfl_display__$internal_CanvasGraphics.context.bezierCurveTo(c.buffer.f[c.fPos] - offsetX,c.buffer.f[c.fPos + 1] - offsetY,c.buffer.f[c.fPos + 2] - offsetX,c.buffer.f[c.fPos + 3] - offsetY,c.buffer.f[c.fPos + 4] - offsetX,c.buffer.f[c.fPos + 5] - offsetY);
				positionX = c.buffer.f[c.fPos + 4];
				positionY = c.buffer.f[c.fPos + 5];
				break;
			case 5:
				switch(data.prev._hx_index) {
				case 0:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 1:
					data.iPos += 1;
					data.fPos += 1;
					break;
				case 2:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 3:
					data.oPos += 1;
					break;
				case 4:
					data.fPos += 6;
					break;
				case 5:
					data.fPos += 4;
					break;
				case 6:
					data.fPos += 3;
					break;
				case 7:
					data.fPos += 4;
					break;
				case 8:
					data.oPos += 3;
					break;
				case 9:
					data.fPos += 4;
					break;
				case 10:
					data.fPos += 5;
					data.oPos += 1;
					break;
				case 12:
					data.oPos += 4;
					break;
				case 13:
					break;
				case 14:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 15:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 16:
					data.oPos += 4;
					data.iPos += 1;
					data.fPos += 2;
					data.bPos += 1;
					break;
				case 17:
					data.fPos += 2;
					break;
				case 18:
					data.fPos += 2;
					break;
				case 19:
					data.oPos += 1;
					break;
				case 20:
					data.oPos += 1;
					break;
				case 21:case 22:
					break;
				default:
				}
				data.prev = openfl_display__$internal_DrawCommandType.CURVE_TO;
				var c1 = data;
				openfl_display__$internal_CanvasGraphics.context.quadraticCurveTo(c1.buffer.f[c1.fPos] - offsetX,c1.buffer.f[c1.fPos + 1] - offsetY,c1.buffer.f[c1.fPos + 2] - offsetX,c1.buffer.f[c1.fPos + 3] - offsetY);
				positionX = c1.buffer.f[c1.fPos + 2];
				positionY = c1.buffer.f[c1.fPos + 3];
				break;
			case 6:
				switch(data.prev._hx_index) {
				case 0:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 1:
					data.iPos += 1;
					data.fPos += 1;
					break;
				case 2:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 3:
					data.oPos += 1;
					break;
				case 4:
					data.fPos += 6;
					break;
				case 5:
					data.fPos += 4;
					break;
				case 6:
					data.fPos += 3;
					break;
				case 7:
					data.fPos += 4;
					break;
				case 8:
					data.oPos += 3;
					break;
				case 9:
					data.fPos += 4;
					break;
				case 10:
					data.fPos += 5;
					data.oPos += 1;
					break;
				case 12:
					data.oPos += 4;
					break;
				case 13:
					break;
				case 14:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 15:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 16:
					data.oPos += 4;
					data.iPos += 1;
					data.fPos += 2;
					data.bPos += 1;
					break;
				case 17:
					data.fPos += 2;
					break;
				case 18:
					data.fPos += 2;
					break;
				case 19:
					data.oPos += 1;
					break;
				case 20:
					data.oPos += 1;
					break;
				case 21:case 22:
					break;
				default:
				}
				data.prev = openfl_display__$internal_DrawCommandType.DRAW_CIRCLE;
				var c2 = data;
				openfl_display__$internal_CanvasGraphics.context.arc(c2.buffer.f[c2.fPos] - offsetX,c2.buffer.f[c2.fPos + 1] - offsetY,c2.buffer.f[c2.fPos + 2],0,Math.PI * 2,true);
				break;
			case 7:
				switch(data.prev._hx_index) {
				case 0:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 1:
					data.iPos += 1;
					data.fPos += 1;
					break;
				case 2:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 3:
					data.oPos += 1;
					break;
				case 4:
					data.fPos += 6;
					break;
				case 5:
					data.fPos += 4;
					break;
				case 6:
					data.fPos += 3;
					break;
				case 7:
					data.fPos += 4;
					break;
				case 8:
					data.oPos += 3;
					break;
				case 9:
					data.fPos += 4;
					break;
				case 10:
					data.fPos += 5;
					data.oPos += 1;
					break;
				case 12:
					data.oPos += 4;
					break;
				case 13:
					break;
				case 14:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 15:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 16:
					data.oPos += 4;
					data.iPos += 1;
					data.fPos += 2;
					data.bPos += 1;
					break;
				case 17:
					data.fPos += 2;
					break;
				case 18:
					data.fPos += 2;
					break;
				case 19:
					data.oPos += 1;
					break;
				case 20:
					data.oPos += 1;
					break;
				case 21:case 22:
					break;
				default:
				}
				data.prev = openfl_display__$internal_DrawCommandType.DRAW_ELLIPSE;
				var c3 = data;
				x = c3.buffer.f[c3.fPos];
				y = c3.buffer.f[c3.fPos + 1];
				width = c3.buffer.f[c3.fPos + 2];
				height = c3.buffer.f[c3.fPos + 3];
				x -= offsetX;
				y -= offsetY;
				ox = width / 2 * kappa;
				oy = height / 2 * kappa;
				xe = x + width;
				ye = y + height;
				xm = x + width / 2;
				ym = y + height / 2;
				openfl_display__$internal_CanvasGraphics.context.moveTo(x,ym);
				openfl_display__$internal_CanvasGraphics.context.bezierCurveTo(x,ym - oy,xm - ox,y,xm,y);
				openfl_display__$internal_CanvasGraphics.context.bezierCurveTo(xm + ox,y,xe,ym - oy,xe,ym);
				openfl_display__$internal_CanvasGraphics.context.bezierCurveTo(xe,ym + oy,xm + ox,ye,xm,ye);
				openfl_display__$internal_CanvasGraphics.context.bezierCurveTo(xm - ox,ye,x,ym + oy,x,ym);
				break;
			case 9:
				switch(data.prev._hx_index) {
				case 0:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 1:
					data.iPos += 1;
					data.fPos += 1;
					break;
				case 2:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 3:
					data.oPos += 1;
					break;
				case 4:
					data.fPos += 6;
					break;
				case 5:
					data.fPos += 4;
					break;
				case 6:
					data.fPos += 3;
					break;
				case 7:
					data.fPos += 4;
					break;
				case 8:
					data.oPos += 3;
					break;
				case 9:
					data.fPos += 4;
					break;
				case 10:
					data.fPos += 5;
					data.oPos += 1;
					break;
				case 12:
					data.oPos += 4;
					break;
				case 13:
					break;
				case 14:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 15:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 16:
					data.oPos += 4;
					data.iPos += 1;
					data.fPos += 2;
					data.bPos += 1;
					break;
				case 17:
					data.fPos += 2;
					break;
				case 18:
					data.fPos += 2;
					break;
				case 19:
					data.oPos += 1;
					break;
				case 20:
					data.oPos += 1;
					break;
				case 21:case 22:
					break;
				default:
				}
				data.prev = openfl_display__$internal_DrawCommandType.DRAW_RECT;
				var c4 = data;
				openfl_display__$internal_CanvasGraphics.context.beginPath();
				openfl_display__$internal_CanvasGraphics.context.rect(c4.buffer.f[c4.fPos] - offsetX,c4.buffer.f[c4.fPos + 1] - offsetY,c4.buffer.f[c4.fPos + 2],c4.buffer.f[c4.fPos + 3]);
				openfl_display__$internal_CanvasGraphics.context.closePath();
				break;
			case 10:
				switch(data.prev._hx_index) {
				case 0:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 1:
					data.iPos += 1;
					data.fPos += 1;
					break;
				case 2:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 3:
					data.oPos += 1;
					break;
				case 4:
					data.fPos += 6;
					break;
				case 5:
					data.fPos += 4;
					break;
				case 6:
					data.fPos += 3;
					break;
				case 7:
					data.fPos += 4;
					break;
				case 8:
					data.oPos += 3;
					break;
				case 9:
					data.fPos += 4;
					break;
				case 10:
					data.fPos += 5;
					data.oPos += 1;
					break;
				case 12:
					data.oPos += 4;
					break;
				case 13:
					break;
				case 14:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 15:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 16:
					data.oPos += 4;
					data.iPos += 1;
					data.fPos += 2;
					data.bPos += 1;
					break;
				case 17:
					data.fPos += 2;
					break;
				case 18:
					data.fPos += 2;
					break;
				case 19:
					data.oPos += 1;
					break;
				case 20:
					data.oPos += 1;
					break;
				case 21:case 22:
					break;
				default:
				}
				data.prev = openfl_display__$internal_DrawCommandType.DRAW_ROUND_RECT;
				var c5 = data;
				openfl_display__$internal_CanvasGraphics.drawRoundRect(c5.buffer.f[c5.fPos] - offsetX,c5.buffer.f[c5.fPos + 1] - offsetY,c5.buffer.f[c5.fPos + 2],c5.buffer.f[c5.fPos + 3],c5.buffer.f[c5.fPos + 4],c5.buffer.o[c5.oPos]);
				break;
			case 17:
				switch(data.prev._hx_index) {
				case 0:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 1:
					data.iPos += 1;
					data.fPos += 1;
					break;
				case 2:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 3:
					data.oPos += 1;
					break;
				case 4:
					data.fPos += 6;
					break;
				case 5:
					data.fPos += 4;
					break;
				case 6:
					data.fPos += 3;
					break;
				case 7:
					data.fPos += 4;
					break;
				case 8:
					data.oPos += 3;
					break;
				case 9:
					data.fPos += 4;
					break;
				case 10:
					data.fPos += 5;
					data.oPos += 1;
					break;
				case 12:
					data.oPos += 4;
					break;
				case 13:
					break;
				case 14:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 15:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 16:
					data.oPos += 4;
					data.iPos += 1;
					data.fPos += 2;
					data.bPos += 1;
					break;
				case 17:
					data.fPos += 2;
					break;
				case 18:
					data.fPos += 2;
					break;
				case 19:
					data.oPos += 1;
					break;
				case 20:
					data.oPos += 1;
					break;
				case 21:case 22:
					break;
				default:
				}
				data.prev = openfl_display__$internal_DrawCommandType.LINE_TO;
				var c6 = data;
				openfl_display__$internal_CanvasGraphics.context.lineTo(c6.buffer.f[c6.fPos] - offsetX,c6.buffer.f[c6.fPos + 1] - offsetY);
				positionX = c6.buffer.f[c6.fPos];
				positionY = c6.buffer.f[c6.fPos + 1];
				break;
			case 18:
				switch(data.prev._hx_index) {
				case 0:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 1:
					data.iPos += 1;
					data.fPos += 1;
					break;
				case 2:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 3:
					data.oPos += 1;
					break;
				case 4:
					data.fPos += 6;
					break;
				case 5:
					data.fPos += 4;
					break;
				case 6:
					data.fPos += 3;
					break;
				case 7:
					data.fPos += 4;
					break;
				case 8:
					data.oPos += 3;
					break;
				case 9:
					data.fPos += 4;
					break;
				case 10:
					data.fPos += 5;
					data.oPos += 1;
					break;
				case 12:
					data.oPos += 4;
					break;
				case 13:
					break;
				case 14:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 15:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 16:
					data.oPos += 4;
					data.iPos += 1;
					data.fPos += 2;
					data.bPos += 1;
					break;
				case 17:
					data.fPos += 2;
					break;
				case 18:
					data.fPos += 2;
					break;
				case 19:
					data.oPos += 1;
					break;
				case 20:
					data.oPos += 1;
					break;
				case 21:case 22:
					break;
				default:
				}
				data.prev = openfl_display__$internal_DrawCommandType.MOVE_TO;
				var c7 = data;
				openfl_display__$internal_CanvasGraphics.context.moveTo(c7.buffer.f[c7.fPos] - offsetX,c7.buffer.f[c7.fPos + 1] - offsetY);
				positionX = c7.buffer.f[c7.fPos];
				positionY = c7.buffer.f[c7.fPos + 1];
				break;
			default:
				switch(data.prev._hx_index) {
				case 0:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 1:
					data.iPos += 1;
					data.fPos += 1;
					break;
				case 2:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 3:
					data.oPos += 1;
					break;
				case 4:
					data.fPos += 6;
					break;
				case 5:
					data.fPos += 4;
					break;
				case 6:
					data.fPos += 3;
					break;
				case 7:
					data.fPos += 4;
					break;
				case 8:
					data.oPos += 3;
					break;
				case 9:
					data.fPos += 4;
					break;
				case 10:
					data.fPos += 5;
					data.oPos += 1;
					break;
				case 12:
					data.oPos += 4;
					break;
				case 13:
					break;
				case 14:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 15:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 16:
					data.oPos += 4;
					data.iPos += 1;
					data.fPos += 2;
					data.bPos += 1;
					break;
				case 17:
					data.fPos += 2;
					break;
				case 18:
					data.fPos += 2;
					break;
				case 19:
					data.oPos += 1;
					break;
				case 20:
					data.oPos += 1;
					break;
				case 21:case 22:
					break;
				default:
				}
				data.prev = type;
			}
		}
		data.destroy();
	}
};
openfl_display__$internal_CanvasGraphics.setSmoothing = function(smooth) {
	if(!openfl_display__$internal_CanvasGraphics.allowSmoothing) {
		smooth = false;
	}
	if(openfl_display__$internal_CanvasGraphics.context.imageSmoothingEnabled != smooth) {
		openfl_display__$internal_CanvasGraphics.context.imageSmoothingEnabled = smooth;
	}
};
var openfl_display__$internal__$CanvasGraphics_Scale9GridBounds = function() {
	this.unscaledMaxY = null;
	this.unscaledMaxX = null;
	this.unscaledMinY = null;
	this.unscaledMinX = null;
	this.scale9MaxY = null;
	this.scale9MaxX = null;
	this.scale9MinY = null;
	this.scale9MinX = null;
};
$hxClasses["openfl.display._internal._CanvasGraphics.Scale9GridBounds"] = openfl_display__$internal__$CanvasGraphics_Scale9GridBounds;
openfl_display__$internal__$CanvasGraphics_Scale9GridBounds.__name__ = "openfl.display._internal._CanvasGraphics.Scale9GridBounds";
openfl_display__$internal__$CanvasGraphics_Scale9GridBounds.prototype = {
	scale9MinX: null
	,scale9MinY: null
	,scale9MaxX: null
	,scale9MaxY: null
	,unscaledMinX: null
	,unscaledMinY: null
	,unscaledMaxX: null
	,unscaledMaxY: null
	,getScaleX: function() {
		if(this.scale9MaxX == null || this.unscaledMaxX == null) {
			return 1.0;
		}
		var unscaledWidth = this.unscaledMaxX - this.unscaledMinX;
		if(unscaledWidth == 0.0) {
			return 1.0;
		}
		return (this.scale9MaxX - this.scale9MinX) / unscaledWidth;
	}
	,getScaleY: function() {
		if(this.scale9MaxY == null || this.unscaledMaxY == null) {
			return 1.0;
		}
		var unscaledHeight = this.unscaledMaxY - this.unscaledMinY;
		if(unscaledHeight == 0.0) {
			return 1.0;
		}
		return (this.scale9MaxY - this.scale9MinY) / unscaledHeight;
	}
	,clear: function() {
		this.unscaledMinX = null;
		this.unscaledMaxX = null;
		this.unscaledMinY = null;
		this.unscaledMaxY = null;
		this.scale9MinX = null;
		this.scale9MaxX = null;
		this.scale9MinY = null;
		this.scale9MaxY = null;
	}
	,applyUnscaledX: function(value) {
		if(this.unscaledMinX == null || this.unscaledMinX > value) {
			this.unscaledMinX = value;
		}
		if(this.unscaledMaxX == null || this.unscaledMaxX < value) {
			this.unscaledMaxX = value;
		}
	}
	,applyUnscaledY: function(value) {
		if(this.unscaledMinY == null || this.unscaledMinY > value) {
			this.unscaledMinY = value;
		}
		if(this.unscaledMaxY == null || this.unscaledMaxY < value) {
			this.unscaledMaxY = value;
		}
	}
	,applyScaledX: function(value) {
		if(this.scale9MinX == null || this.scale9MinX > value) {
			this.scale9MinX = value;
		}
		if(this.scale9MaxX == null || this.scale9MaxX < value) {
			this.scale9MaxX = value;
		}
	}
	,applyScaledY: function(value) {
		if(this.scale9MinY == null || this.scale9MinY > value) {
			this.scale9MinY = value;
		}
		if(this.scale9MaxY == null || this.scale9MaxY < value) {
			this.scale9MaxY = value;
		}
	}
	,__class__: openfl_display__$internal__$CanvasGraphics_Scale9GridBounds
};
var openfl_display__$internal_CanvasShape = function() { };
$hxClasses["openfl.display._internal.CanvasShape"] = openfl_display__$internal_CanvasShape;
openfl_display__$internal_CanvasShape.__name__ = "openfl.display._internal.CanvasShape";
openfl_display__$internal_CanvasShape.render = function(shape,renderer) {
	if(!shape.__renderable) {
		return;
	}
	var alpha = renderer.__getAlpha(shape.__worldAlpha);
	if(alpha <= 0) {
		return;
	}
	var graphics = shape.__graphics;
	if(graphics != null) {
		openfl_display__$internal_CanvasGraphics.render(graphics,renderer);
		var width = graphics.__width;
		var height = graphics.__height;
		var canvas = graphics.__canvas;
		if(canvas != null && graphics.__visible && width >= 1 && height >= 1) {
			var transform = graphics.__worldTransform;
			var context = renderer.context;
			var scrollRect = shape.__scrollRect;
			if(scrollRect == null || scrollRect.width > 0 && scrollRect.height > 0) {
				renderer.__setBlendMode(shape.__worldBlendMode);
				renderer.__pushMaskObject(shape);
				context.globalAlpha = alpha;
				var renderTransform = openfl_geom_Matrix.__pool.get();
				renderTransform.scale(1 / graphics.__bitmapScaleX,1 / graphics.__bitmapScaleY);
				renderTransform.concat(transform);
				renderer.setTransform(renderTransform,context);
				context.drawImage(canvas,0,0,width,height);
				openfl_geom_Matrix.__pool.release(renderTransform);
				renderer.__popMaskObject(shape);
			}
		}
	}
};
var openfl_display__$internal_CanvasSimpleButton = function() { };
$hxClasses["openfl.display._internal.CanvasSimpleButton"] = openfl_display__$internal_CanvasSimpleButton;
openfl_display__$internal_CanvasSimpleButton.__name__ = "openfl.display._internal.CanvasSimpleButton";
openfl_display__$internal_CanvasSimpleButton.renderDrawable = function(simpleButton,renderer) {
	if(!simpleButton.__renderable || simpleButton.__worldAlpha <= 0 || simpleButton.__currentState == null) {
		return;
	}
	renderer.__pushMaskObject(simpleButton);
	renderer.__renderDrawable(simpleButton.__currentState);
	renderer.__popMaskObject(simpleButton);
	renderer.__renderEvent(simpleButton);
};
openfl_display__$internal_CanvasSimpleButton.renderDrawableMask = function(simpleButton,renderer) {
	renderer.__renderDrawableMask(simpleButton.__currentState);
};
var openfl_display__$internal_CanvasTextField = function() { };
$hxClasses["openfl.display._internal.CanvasTextField"] = openfl_display__$internal_CanvasTextField;
openfl_display__$internal_CanvasTextField.__name__ = "openfl.display._internal.CanvasTextField";
openfl_display__$internal_CanvasTextField.render = function(textField,renderer,transform) {
	var textEngine = textField.__textEngine;
	var useTextBounds = !(textEngine.background || textEngine.border);
	var bounds = useTextBounds ? textEngine.textBounds : textEngine.bounds;
	var graphics = textField.__graphics;
	var cursorOffsetX = 0.0;
	if(textField.__dirty) {
		textField.__updateLayout();
		if(graphics.__bounds == null) {
			graphics.__bounds = new openfl_geom_Rectangle();
		}
		if(textField.get_text().length == 0) {
			var boundsWidth = textEngine.bounds.width - 4;
			var align = textField.get_defaultTextFormat().align;
			cursorOffsetX = align == 3 ? 0 : align == 4 ? boundsWidth : boundsWidth / 2;
			switch(align) {
			case 0:
				cursorOffsetX += textField.get_defaultTextFormat().leftMargin / 2;
				cursorOffsetX -= textField.get_defaultTextFormat().rightMargin / 2;
				cursorOffsetX += textField.get_defaultTextFormat().indent / 2;
				cursorOffsetX += textField.get_defaultTextFormat().blockIndent / 2;
				break;
			case 1:
				break;
			case 2:
				cursorOffsetX += textField.get_defaultTextFormat().leftMargin;
				cursorOffsetX += textField.get_defaultTextFormat().indent;
				cursorOffsetX += textField.get_defaultTextFormat().blockIndent;
				break;
			case 3:
				cursorOffsetX += textField.get_defaultTextFormat().leftMargin;
				cursorOffsetX += textField.get_defaultTextFormat().indent;
				cursorOffsetX += textField.get_defaultTextFormat().blockIndent;
				break;
			case 4:
				cursorOffsetX -= textField.get_defaultTextFormat().rightMargin;
				break;
			case 5:
				break;
			}
			if(useTextBounds) {
				bounds.y = textEngine.bounds.y;
				bounds.x = cursorOffsetX;
			}
		}
		graphics.__bounds.copyFrom(bounds);
	}
	var pixelRatio = renderer.__pixelRatio;
	if(graphics.__bitmapScaleX != pixelRatio || graphics.__bitmapScaleY != pixelRatio) {
		graphics.__softwareDirty = true;
	}
	graphics.__update(renderer.__worldTransform,pixelRatio);
	if(textField.__dirty || graphics.__softwareDirty) {
		var width = Math.round(graphics.__width * pixelRatio);
		var height = Math.round(graphics.__height * pixelRatio);
		if((textEngine.text == null || textEngine.text == "") && !textEngine.background && !textEngine.border && !textEngine.__hasFocus && (textEngine.type != 1 || !textEngine.selectable) || (textEngine.width <= 0 || textEngine.height <= 0) && textEngine.autoSize != 2) {
			textField.__graphics.__canvas = null;
			textField.__graphics.__context = null;
			textField.__graphics.__bitmap = null;
			textField.__graphics.__softwareDirty = false;
			textField.__graphics.set___dirty(false);
			textField.__dirty = false;
		} else {
			if(textField.__graphics.__canvas == null) {
				textField.__graphics.__canvas = window.document.createElement("canvas");
				textField.__graphics.__context = textField.__graphics.__canvas.getContext("2d");
			}
			openfl_display__$internal_CanvasTextField.context = graphics.__context;
			graphics.__canvas.width = width;
			graphics.__canvas.height = height;
			if(renderer.__isDOM) {
				graphics.__canvas.style.width = Math.round(width / pixelRatio) + "px";
				graphics.__canvas.style.height = Math.round(height / pixelRatio) + "px";
			}
			var matrix = openfl_geom_Matrix.__pool.get();
			matrix.scale(pixelRatio,pixelRatio);
			matrix.concat(graphics.__renderTransform);
			openfl_display__$internal_CanvasTextField.context.setTransform(matrix.a,matrix.b,matrix.c,matrix.d,matrix.tx,matrix.ty);
			openfl_geom_Matrix.__pool.release(matrix);
			if(openfl_display__$internal_CanvasTextField.clearRect == null) {
				openfl_display__$internal_CanvasTextField.clearRect = (typeof navigator !== 'undefined' && typeof navigator['isCocoonJS'] !== 'undefined');
			}
			if(openfl_display__$internal_CanvasTextField.clearRect) {
				openfl_display__$internal_CanvasTextField.context.clearRect(0,0,graphics.__canvas.width,graphics.__canvas.height);
			}
			if(textEngine.text != null && textEngine.text != "" || textEngine.__hasFocus) {
				var text = textEngine.text;
				if(!renderer.__allowSmoothing || textEngine.antiAliasType == 0 && textEngine.sharpness == 400) {
					graphics.__context.imageSmoothingEnabled = false;
				} else {
					graphics.__context.imageSmoothingEnabled = true;
				}
				if(textEngine.border || textEngine.background) {
					openfl_display__$internal_CanvasTextField.context.rect(0.5,0.5,bounds.width - 1,bounds.height - 1);
					if(textEngine.background) {
						var tmp = StringTools.hex(textEngine.backgroundColor & 16777215,6);
						openfl_display__$internal_CanvasTextField.context.fillStyle = "#" + tmp;
						openfl_display__$internal_CanvasTextField.context.fill();
					}
					if(textEngine.border) {
						openfl_display__$internal_CanvasTextField.context.lineWidth = 1;
						var tmp = StringTools.hex(textEngine.borderColor & 16777215,6);
						openfl_display__$internal_CanvasTextField.context.strokeStyle = "#" + tmp;
						openfl_display__$internal_CanvasTextField.context.stroke();
					}
				}
				openfl_display__$internal_CanvasTextField.context.textBaseline = "alphabetic";
				openfl_display__$internal_CanvasTextField.context.textAlign = "start";
				var scrollX = -textField.get_scrollH();
				var scrollY = 0.0;
				var _g = 0;
				var _g1 = textField.get_scrollV() - 1;
				while(_g < _g1) {
					var i = _g++;
					scrollY -= textEngine.lineHeights.get(i);
				}
				var advance;
				var group = textEngine.layoutGroups.iterator();
				while(group.hasNext()) {
					var group1 = group.next();
					if(group1.lineIndex < textField.get_scrollV() - 1) {
						continue;
					}
					if(group1.lineIndex > textEngine.get_bottomScrollV() - 1) {
						break;
					}
					var color = "#" + StringTools.hex(group1.format.color & 16777215,6);
					openfl_display__$internal_CanvasTextField.context.font = openfl_text__$internal_TextEngine.getFont(group1.format);
					openfl_display__$internal_CanvasTextField.context.fillStyle = color;
					openfl_display__$internal_CanvasTextField.context.fillText(text.substring(group1.startIndex,group1.endIndex),group1.offsetX + scrollX - bounds.x,group1.offsetY + group1.ascent + scrollY - bounds.y);
					if(textField.__caretIndex > -1 && textEngine.selectable) {
						if(textField.__selectionIndex == textField.__caretIndex) {
							if(textField.__showCursor && group1.startIndex <= textField.__caretIndex && group1.endIndex >= textField.__caretIndex) {
								advance = 0.0;
								var _g = 0;
								var _g1 = textField.__caretIndex - group1.startIndex;
								while(_g < _g1) {
									var i = _g++;
									if(group1.positions.length <= i) {
										break;
									}
									advance += group1.positions[i];
								}
								var scrollY1 = 0.0;
								var _g2 = textField.get_scrollV();
								var _g3 = group1.lineIndex + 1;
								while(_g2 < _g3) {
									var i1 = _g2++;
									scrollY1 += textEngine.lineHeights.get(i1 - 1);
								}
								openfl_display__$internal_CanvasTextField.context.beginPath();
								var tmp = StringTools.hex(group1.format.color & 16777215,6);
								openfl_display__$internal_CanvasTextField.context.strokeStyle = "#" + tmp;
								openfl_display__$internal_CanvasTextField.context.moveTo(group1.offsetX + advance - textField.get_scrollH() - bounds.x,scrollY1 + 2 - bounds.y);
								openfl_display__$internal_CanvasTextField.context.lineWidth = 1;
								openfl_display__$internal_CanvasTextField.context.lineTo(group1.offsetX + advance - textField.get_scrollH() - bounds.x,scrollY1 + openfl_text__$internal_TextEngine.getFormatHeight(textField.get_defaultTextFormat()) - 1 - bounds.y);
								openfl_display__$internal_CanvasTextField.context.stroke();
								openfl_display__$internal_CanvasTextField.context.closePath();
							}
						} else if(group1.startIndex <= textField.__caretIndex && group1.endIndex >= textField.__caretIndex || group1.startIndex <= textField.__selectionIndex && group1.endIndex >= textField.__selectionIndex || group1.startIndex > textField.__caretIndex && group1.endIndex < textField.__selectionIndex || group1.startIndex > textField.__selectionIndex && group1.endIndex < textField.__caretIndex) {
							var selectionStart = Math.min(textField.__selectionIndex,textField.__caretIndex) | 0;
							var selectionEnd = Math.max(textField.__selectionIndex,textField.__caretIndex) | 0;
							if(group1.startIndex > selectionStart) {
								selectionStart = group1.startIndex;
							}
							if(group1.endIndex < selectionEnd) {
								selectionEnd = group1.endIndex;
							}
							var end;
							var start = textField.getCharBoundaries(selectionStart);
							if(selectionEnd >= group1.endIndex) {
								end = textField.getCharBoundaries(group1.endIndex - 1);
								if(end != null) {
									end.x += end.width + 2;
								}
							} else {
								end = textField.getCharBoundaries(selectionEnd);
							}
							if(start != null && end != null) {
								openfl_display__$internal_CanvasTextField.context.fillStyle = "#000000";
								openfl_display__$internal_CanvasTextField.context.fillRect(start.x + scrollX - bounds.x,start.y + scrollY,end.x - start.x,group1.height);
								openfl_display__$internal_CanvasTextField.context.fillStyle = "#FFFFFF";
								openfl_display__$internal_CanvasTextField.context.fillText(text.substring(selectionStart,selectionEnd),scrollX + start.x - bounds.x,group1.offsetY + group1.ascent + scrollY);
							}
						}
					}
					if(group1.format.underline) {
						openfl_display__$internal_CanvasTextField.context.beginPath();
						openfl_display__$internal_CanvasTextField.context.strokeStyle = color;
						openfl_display__$internal_CanvasTextField.context.lineWidth = 1;
						var descent = Math.floor(group1.ascent * 0.185);
						var x = group1.offsetX + scrollX - bounds.x;
						var y = Math.ceil(group1.offsetY + scrollY + group1.ascent - bounds.y) + descent + 0.5;
						openfl_display__$internal_CanvasTextField.context.moveTo(x,y);
						openfl_display__$internal_CanvasTextField.context.lineTo(x + group1.width,y);
						openfl_display__$internal_CanvasTextField.context.stroke();
						openfl_display__$internal_CanvasTextField.context.closePath();
					}
					if(group1.format.strikethrough) {
						openfl_display__$internal_CanvasTextField.context.beginPath();
						openfl_display__$internal_CanvasTextField.context.strokeStyle = color;
						openfl_display__$internal_CanvasTextField.context.lineWidth = 1;
						var x1 = group1.offsetX + scrollX - bounds.x;
						var y1 = Math.ceil(group1.offsetY + scrollY + 2.0 * group1.ascent / 3.0 - bounds.y);
						openfl_display__$internal_CanvasTextField.context.moveTo(x1,y1);
						openfl_display__$internal_CanvasTextField.context.lineTo(x1 + group1.width,y1);
						openfl_display__$internal_CanvasTextField.context.stroke();
						openfl_display__$internal_CanvasTextField.context.closePath();
					}
				}
			} else {
				if(textEngine.border || textEngine.background) {
					if(textEngine.border) {
						openfl_display__$internal_CanvasTextField.context.rect(0.5,0.5,bounds.width - 1,bounds.height - 1);
					} else {
						openfl_display__$internal_CanvasTextField.context.rect(0,0,bounds.width,bounds.height);
					}
					if(textEngine.background) {
						var tmp = StringTools.hex(textEngine.backgroundColor & 16777215,6);
						openfl_display__$internal_CanvasTextField.context.fillStyle = "#" + tmp;
						openfl_display__$internal_CanvasTextField.context.fill();
					}
					if(textEngine.border) {
						openfl_display__$internal_CanvasTextField.context.lineWidth = 1;
						openfl_display__$internal_CanvasTextField.context.lineCap = "square";
						var tmp = StringTools.hex(textEngine.borderColor & 16777215,6);
						openfl_display__$internal_CanvasTextField.context.strokeStyle = "#" + tmp;
						openfl_display__$internal_CanvasTextField.context.stroke();
					}
				}
				if(textField.__caretIndex > -1 && textEngine.selectable && textField.__showCursor) {
					var scrollX = -textField.get_scrollH() + (useTextBounds ? 0 : cursorOffsetX);
					var scrollY = 0.0;
					var _g = 0;
					var _g1 = textField.get_scrollV() - 1;
					while(_g < _g1) {
						var i = _g++;
						scrollY += textEngine.lineHeights.get(i);
					}
					openfl_display__$internal_CanvasTextField.context.beginPath();
					var tmp = StringTools.hex(textField.get_defaultTextFormat().color & 16777215,6);
					openfl_display__$internal_CanvasTextField.context.strokeStyle = "#" + tmp;
					openfl_display__$internal_CanvasTextField.context.moveTo(scrollX + 2.5,scrollY + 2.5);
					openfl_display__$internal_CanvasTextField.context.lineWidth = 1;
					openfl_display__$internal_CanvasTextField.context.lineTo(scrollX + 2.5,scrollY + openfl_text__$internal_TextEngine.getFormatHeight(textField.get_defaultTextFormat()) - 1);
					openfl_display__$internal_CanvasTextField.context.stroke();
					openfl_display__$internal_CanvasTextField.context.closePath();
				}
			}
			if(graphics.__bitmap == null) {
				graphics.__bitmap = openfl_display_BitmapData.fromCanvas(graphics.__canvas);
			} else if(graphics.__bitmap.width != graphics.__canvas.width || graphics.__bitmap.height != graphics.__canvas.height) {
				var texture = graphics.__bitmap.__texture;
				if(texture != null) {
					texture.dispose();
				}
				graphics.__bitmap = openfl_display_BitmapData.fromCanvas(graphics.__canvas);
			} else {
				graphics.__bitmap.image.version++;
			}
			graphics.__bitmapScaleX = pixelRatio;
			graphics.__bitmapScaleY = pixelRatio;
			graphics.__visible = true;
			textField.__dirty = false;
			graphics.__softwareDirty = false;
			graphics.set___dirty(false);
		}
	}
};
openfl_display__$internal_CanvasTextField.renderDrawable = function(textField,renderer) {
	if(renderer.__isDOM && !textField.__renderedOnCanvasWhileOnDOM) {
		textField.__renderedOnCanvasWhileOnDOM = true;
		if(textField.get_type() == 1) {
			textField.replaceText(0,textField.__text.length,textField.__text);
		}
		if(textField.__isHTML) {
			textField.__updateText(openfl_text__$internal_HTMLParser.parse(textField.__text,textField.get_multiline(),textField.__styleSheet,textField.__textFormat,textField.__textEngine.textFormatRanges));
		}
		textField.__dirty = true;
		textField.__layoutDirty = true;
		if(!textField.__renderDirty) {
			textField.__renderDirty = true;
			textField.__setParentRenderDirty();
		}
	}
	if(textField.get_mask() == null || textField.get_mask().get_width() > 0 && textField.get_mask().get_height() > 0) {
		renderer.__updateCacheBitmap(textField,textField.__dirty);
		if(textField.__cacheBitmap != null && !textField.__isCacheBitmapRender) {
			var bitmap = textField.__cacheBitmap;
			if(bitmap.__renderable) {
				var alpha = renderer.__getAlpha(bitmap.__worldAlpha);
				if(alpha > 0 && bitmap.__bitmapData != null && bitmap.__bitmapData.__isValid && bitmap.__bitmapData.readable) {
					var context = renderer.context;
					renderer.__setBlendMode(bitmap.__worldBlendMode);
					renderer.__pushMaskObject(bitmap,false);
					lime__$internal_graphics_ImageCanvasUtil.convertToCanvas(bitmap.__bitmapData.image);
					context.globalAlpha = alpha;
					var scrollRect = bitmap.__scrollRect;
					renderer.setTransform(bitmap.__renderTransform,context);
					if(!renderer.__allowSmoothing || !bitmap.smoothing) {
						context.imageSmoothingEnabled = false;
					}
					if(scrollRect == null) {
						context.drawImage(bitmap.__bitmapData.image.get_src(),0,0,bitmap.__bitmapData.image.width,bitmap.__bitmapData.image.height);
					} else {
						context.drawImage(bitmap.__bitmapData.image.get_src(),scrollRect.x,scrollRect.y,scrollRect.width,scrollRect.height,scrollRect.x,scrollRect.y,scrollRect.width,scrollRect.height);
					}
					if(!renderer.__allowSmoothing || !bitmap.smoothing) {
						context.imageSmoothingEnabled = true;
					}
					renderer.__popMaskObject(bitmap,false);
				}
			}
		} else {
			var transform = textField.__worldTransform;
			var textEngine = textField.__textEngine;
			var useTextBounds = !(textEngine.background || textEngine.border);
			var bounds = useTextBounds ? textEngine.textBounds : textEngine.bounds;
			var graphics = textField.__graphics;
			var cursorOffsetX = 0.0;
			if(textField.__dirty) {
				textField.__updateLayout();
				if(graphics.__bounds == null) {
					graphics.__bounds = new openfl_geom_Rectangle();
				}
				if(textField.get_text().length == 0) {
					var boundsWidth = textEngine.bounds.width - 4;
					var align = textField.get_defaultTextFormat().align;
					cursorOffsetX = align == 3 ? 0 : align == 4 ? boundsWidth : boundsWidth / 2;
					switch(align) {
					case 0:
						cursorOffsetX += textField.get_defaultTextFormat().leftMargin / 2;
						cursorOffsetX -= textField.get_defaultTextFormat().rightMargin / 2;
						cursorOffsetX += textField.get_defaultTextFormat().indent / 2;
						cursorOffsetX += textField.get_defaultTextFormat().blockIndent / 2;
						break;
					case 1:
						break;
					case 2:
						cursorOffsetX += textField.get_defaultTextFormat().leftMargin;
						cursorOffsetX += textField.get_defaultTextFormat().indent;
						cursorOffsetX += textField.get_defaultTextFormat().blockIndent;
						break;
					case 3:
						cursorOffsetX += textField.get_defaultTextFormat().leftMargin;
						cursorOffsetX += textField.get_defaultTextFormat().indent;
						cursorOffsetX += textField.get_defaultTextFormat().blockIndent;
						break;
					case 4:
						cursorOffsetX -= textField.get_defaultTextFormat().rightMargin;
						break;
					case 5:
						break;
					}
					if(useTextBounds) {
						bounds.y = textEngine.bounds.y;
						bounds.x = cursorOffsetX;
					}
				}
				graphics.__bounds.copyFrom(bounds);
			}
			var pixelRatio = renderer.__pixelRatio;
			if(graphics.__bitmapScaleX != pixelRatio || graphics.__bitmapScaleY != pixelRatio) {
				graphics.__softwareDirty = true;
			}
			graphics.__update(renderer.__worldTransform,pixelRatio);
			if(textField.__dirty || graphics.__softwareDirty) {
				var width = Math.round(graphics.__width * pixelRatio);
				var height = Math.round(graphics.__height * pixelRatio);
				if((textEngine.text == null || textEngine.text == "") && !textEngine.background && !textEngine.border && !textEngine.__hasFocus && (textEngine.type != 1 || !textEngine.selectable) || (textEngine.width <= 0 || textEngine.height <= 0) && textEngine.autoSize != 2) {
					textField.__graphics.__canvas = null;
					textField.__graphics.__context = null;
					textField.__graphics.__bitmap = null;
					textField.__graphics.__softwareDirty = false;
					textField.__graphics.set___dirty(false);
					textField.__dirty = false;
				} else {
					if(textField.__graphics.__canvas == null) {
						textField.__graphics.__canvas = window.document.createElement("canvas");
						textField.__graphics.__context = textField.__graphics.__canvas.getContext("2d");
					}
					openfl_display__$internal_CanvasTextField.context = graphics.__context;
					graphics.__canvas.width = width;
					graphics.__canvas.height = height;
					if(renderer.__isDOM) {
						graphics.__canvas.style.width = Math.round(width / pixelRatio) + "px";
						graphics.__canvas.style.height = Math.round(height / pixelRatio) + "px";
					}
					var matrix = openfl_geom_Matrix.__pool.get();
					matrix.scale(pixelRatio,pixelRatio);
					matrix.concat(graphics.__renderTransform);
					openfl_display__$internal_CanvasTextField.context.setTransform(matrix.a,matrix.b,matrix.c,matrix.d,matrix.tx,matrix.ty);
					openfl_geom_Matrix.__pool.release(matrix);
					if(openfl_display__$internal_CanvasTextField.clearRect == null) {
						openfl_display__$internal_CanvasTextField.clearRect = (typeof navigator !== 'undefined' && typeof navigator['isCocoonJS'] !== 'undefined');
					}
					if(openfl_display__$internal_CanvasTextField.clearRect) {
						openfl_display__$internal_CanvasTextField.context.clearRect(0,0,graphics.__canvas.width,graphics.__canvas.height);
					}
					if(textEngine.text != null && textEngine.text != "" || textEngine.__hasFocus) {
						var text = textEngine.text;
						if(!renderer.__allowSmoothing || textEngine.antiAliasType == 0 && textEngine.sharpness == 400) {
							graphics.__context.imageSmoothingEnabled = false;
						} else {
							graphics.__context.imageSmoothingEnabled = true;
						}
						if(textEngine.border || textEngine.background) {
							openfl_display__$internal_CanvasTextField.context.rect(0.5,0.5,bounds.width - 1,bounds.height - 1);
							if(textEngine.background) {
								var tmp = StringTools.hex(textEngine.backgroundColor & 16777215,6);
								openfl_display__$internal_CanvasTextField.context.fillStyle = "#" + tmp;
								openfl_display__$internal_CanvasTextField.context.fill();
							}
							if(textEngine.border) {
								openfl_display__$internal_CanvasTextField.context.lineWidth = 1;
								var tmp = StringTools.hex(textEngine.borderColor & 16777215,6);
								openfl_display__$internal_CanvasTextField.context.strokeStyle = "#" + tmp;
								openfl_display__$internal_CanvasTextField.context.stroke();
							}
						}
						openfl_display__$internal_CanvasTextField.context.textBaseline = "alphabetic";
						openfl_display__$internal_CanvasTextField.context.textAlign = "start";
						var scrollX = -textField.get_scrollH();
						var scrollY = 0.0;
						var _g = 0;
						var _g1 = textField.get_scrollV() - 1;
						while(_g < _g1) {
							var i = _g++;
							scrollY -= textEngine.lineHeights.get(i);
						}
						var advance;
						var group = textEngine.layoutGroups.iterator();
						while(group.hasNext()) {
							var group1 = group.next();
							if(group1.lineIndex < textField.get_scrollV() - 1) {
								continue;
							}
							if(group1.lineIndex > textEngine.get_bottomScrollV() - 1) {
								break;
							}
							var color = "#" + StringTools.hex(group1.format.color & 16777215,6);
							openfl_display__$internal_CanvasTextField.context.font = openfl_text__$internal_TextEngine.getFont(group1.format);
							openfl_display__$internal_CanvasTextField.context.fillStyle = color;
							openfl_display__$internal_CanvasTextField.context.fillText(text.substring(group1.startIndex,group1.endIndex),group1.offsetX + scrollX - bounds.x,group1.offsetY + group1.ascent + scrollY - bounds.y);
							if(textField.__caretIndex > -1 && textEngine.selectable) {
								if(textField.__selectionIndex == textField.__caretIndex) {
									if(textField.__showCursor && group1.startIndex <= textField.__caretIndex && group1.endIndex >= textField.__caretIndex) {
										advance = 0.0;
										var _g = 0;
										var _g1 = textField.__caretIndex - group1.startIndex;
										while(_g < _g1) {
											var i = _g++;
											if(group1.positions.length <= i) {
												break;
											}
											advance += group1.positions[i];
										}
										var scrollY1 = 0.0;
										var _g2 = textField.get_scrollV();
										var _g3 = group1.lineIndex + 1;
										while(_g2 < _g3) {
											var i1 = _g2++;
											scrollY1 += textEngine.lineHeights.get(i1 - 1);
										}
										openfl_display__$internal_CanvasTextField.context.beginPath();
										var tmp = StringTools.hex(group1.format.color & 16777215,6);
										openfl_display__$internal_CanvasTextField.context.strokeStyle = "#" + tmp;
										openfl_display__$internal_CanvasTextField.context.moveTo(group1.offsetX + advance - textField.get_scrollH() - bounds.x,scrollY1 + 2 - bounds.y);
										openfl_display__$internal_CanvasTextField.context.lineWidth = 1;
										openfl_display__$internal_CanvasTextField.context.lineTo(group1.offsetX + advance - textField.get_scrollH() - bounds.x,scrollY1 + openfl_text__$internal_TextEngine.getFormatHeight(textField.get_defaultTextFormat()) - 1 - bounds.y);
										openfl_display__$internal_CanvasTextField.context.stroke();
										openfl_display__$internal_CanvasTextField.context.closePath();
									}
								} else if(group1.startIndex <= textField.__caretIndex && group1.endIndex >= textField.__caretIndex || group1.startIndex <= textField.__selectionIndex && group1.endIndex >= textField.__selectionIndex || group1.startIndex > textField.__caretIndex && group1.endIndex < textField.__selectionIndex || group1.startIndex > textField.__selectionIndex && group1.endIndex < textField.__caretIndex) {
									var selectionStart = Math.min(textField.__selectionIndex,textField.__caretIndex) | 0;
									var selectionEnd = Math.max(textField.__selectionIndex,textField.__caretIndex) | 0;
									if(group1.startIndex > selectionStart) {
										selectionStart = group1.startIndex;
									}
									if(group1.endIndex < selectionEnd) {
										selectionEnd = group1.endIndex;
									}
									var end;
									var start = textField.getCharBoundaries(selectionStart);
									if(selectionEnd >= group1.endIndex) {
										end = textField.getCharBoundaries(group1.endIndex - 1);
										if(end != null) {
											end.x += end.width + 2;
										}
									} else {
										end = textField.getCharBoundaries(selectionEnd);
									}
									if(start != null && end != null) {
										openfl_display__$internal_CanvasTextField.context.fillStyle = "#000000";
										openfl_display__$internal_CanvasTextField.context.fillRect(start.x + scrollX - bounds.x,start.y + scrollY,end.x - start.x,group1.height);
										openfl_display__$internal_CanvasTextField.context.fillStyle = "#FFFFFF";
										openfl_display__$internal_CanvasTextField.context.fillText(text.substring(selectionStart,selectionEnd),scrollX + start.x - bounds.x,group1.offsetY + group1.ascent + scrollY);
									}
								}
							}
							if(group1.format.underline) {
								openfl_display__$internal_CanvasTextField.context.beginPath();
								openfl_display__$internal_CanvasTextField.context.strokeStyle = color;
								openfl_display__$internal_CanvasTextField.context.lineWidth = 1;
								var descent = Math.floor(group1.ascent * 0.185);
								var x = group1.offsetX + scrollX - bounds.x;
								var y = Math.ceil(group1.offsetY + scrollY + group1.ascent - bounds.y) + descent + 0.5;
								openfl_display__$internal_CanvasTextField.context.moveTo(x,y);
								openfl_display__$internal_CanvasTextField.context.lineTo(x + group1.width,y);
								openfl_display__$internal_CanvasTextField.context.stroke();
								openfl_display__$internal_CanvasTextField.context.closePath();
							}
							if(group1.format.strikethrough) {
								openfl_display__$internal_CanvasTextField.context.beginPath();
								openfl_display__$internal_CanvasTextField.context.strokeStyle = color;
								openfl_display__$internal_CanvasTextField.context.lineWidth = 1;
								var x1 = group1.offsetX + scrollX - bounds.x;
								var y1 = Math.ceil(group1.offsetY + scrollY + 2.0 * group1.ascent / 3.0 - bounds.y);
								openfl_display__$internal_CanvasTextField.context.moveTo(x1,y1);
								openfl_display__$internal_CanvasTextField.context.lineTo(x1 + group1.width,y1);
								openfl_display__$internal_CanvasTextField.context.stroke();
								openfl_display__$internal_CanvasTextField.context.closePath();
							}
						}
					} else {
						if(textEngine.border || textEngine.background) {
							if(textEngine.border) {
								openfl_display__$internal_CanvasTextField.context.rect(0.5,0.5,bounds.width - 1,bounds.height - 1);
							} else {
								openfl_display__$internal_CanvasTextField.context.rect(0,0,bounds.width,bounds.height);
							}
							if(textEngine.background) {
								var tmp = StringTools.hex(textEngine.backgroundColor & 16777215,6);
								openfl_display__$internal_CanvasTextField.context.fillStyle = "#" + tmp;
								openfl_display__$internal_CanvasTextField.context.fill();
							}
							if(textEngine.border) {
								openfl_display__$internal_CanvasTextField.context.lineWidth = 1;
								openfl_display__$internal_CanvasTextField.context.lineCap = "square";
								var tmp = StringTools.hex(textEngine.borderColor & 16777215,6);
								openfl_display__$internal_CanvasTextField.context.strokeStyle = "#" + tmp;
								openfl_display__$internal_CanvasTextField.context.stroke();
							}
						}
						if(textField.__caretIndex > -1 && textEngine.selectable && textField.__showCursor) {
							var scrollX = -textField.get_scrollH() + (useTextBounds ? 0 : cursorOffsetX);
							var scrollY = 0.0;
							var _g = 0;
							var _g1 = textField.get_scrollV() - 1;
							while(_g < _g1) {
								var i = _g++;
								scrollY += textEngine.lineHeights.get(i);
							}
							openfl_display__$internal_CanvasTextField.context.beginPath();
							var tmp = StringTools.hex(textField.get_defaultTextFormat().color & 16777215,6);
							openfl_display__$internal_CanvasTextField.context.strokeStyle = "#" + tmp;
							openfl_display__$internal_CanvasTextField.context.moveTo(scrollX + 2.5,scrollY + 2.5);
							openfl_display__$internal_CanvasTextField.context.lineWidth = 1;
							openfl_display__$internal_CanvasTextField.context.lineTo(scrollX + 2.5,scrollY + openfl_text__$internal_TextEngine.getFormatHeight(textField.get_defaultTextFormat()) - 1);
							openfl_display__$internal_CanvasTextField.context.stroke();
							openfl_display__$internal_CanvasTextField.context.closePath();
						}
					}
					if(graphics.__bitmap == null) {
						graphics.__bitmap = openfl_display_BitmapData.fromCanvas(graphics.__canvas);
					} else if(graphics.__bitmap.width != graphics.__canvas.width || graphics.__bitmap.height != graphics.__canvas.height) {
						var texture = graphics.__bitmap.__texture;
						if(texture != null) {
							texture.dispose();
						}
						graphics.__bitmap = openfl_display_BitmapData.fromCanvas(graphics.__canvas);
					} else {
						graphics.__bitmap.image.version++;
					}
					graphics.__bitmapScaleX = pixelRatio;
					graphics.__bitmapScaleY = pixelRatio;
					graphics.__visible = true;
					textField.__dirty = false;
					graphics.__softwareDirty = false;
					graphics.set___dirty(false);
				}
			}
			var smoothingEnabled = false;
			if(textField.__textEngine.antiAliasType == 0 && textField.__textEngine.gridFitType == 1) {
				smoothingEnabled = renderer.context.imageSmoothingEnabled;
				if(smoothingEnabled) {
					renderer.context.imageSmoothingEnabled = false;
				}
			}
			if(!(textField.opaqueBackground == null && textField.__graphics == null)) {
				if(textField.__renderable) {
					var alpha = renderer.__getAlpha(textField.__worldAlpha);
					if(!(alpha <= 0)) {
						if(textField.opaqueBackground != null && !textField.__isCacheBitmapRender && textField.get_width() > 0 && textField.get_height() > 0) {
							renderer.__setBlendMode(textField.__worldBlendMode);
							renderer.__pushMaskObject(textField);
							var context = renderer.context;
							renderer.setTransform(textField.__renderTransform,context);
							var color = textField.opaqueBackground;
							context.fillStyle = "rgb(" + (color >>> 16 & 255) + "," + (color >>> 8 & 255) + "," + (color & 255) + ")";
							context.fillRect(0,0,textField.get_width(),textField.get_height());
							renderer.__popMaskObject(textField);
						}
						if(textField.__graphics != null) {
							if(textField.__renderable) {
								var alpha = renderer.__getAlpha(textField.__worldAlpha);
								if(!(alpha <= 0)) {
									var graphics = textField.__graphics;
									if(graphics != null) {
										openfl_display__$internal_CanvasGraphics.render(graphics,renderer);
										var width = graphics.__width;
										var height = graphics.__height;
										var canvas = graphics.__canvas;
										if(canvas != null && graphics.__visible && width >= 1 && height >= 1) {
											var transform = graphics.__worldTransform;
											var context = renderer.context;
											var scrollRect = textField.__scrollRect;
											if(scrollRect == null || scrollRect.width > 0 && scrollRect.height > 0) {
												renderer.__setBlendMode(textField.__worldBlendMode);
												renderer.__pushMaskObject(textField);
												context.globalAlpha = alpha;
												var renderTransform = openfl_geom_Matrix.__pool.get();
												renderTransform.scale(1 / graphics.__bitmapScaleX,1 / graphics.__bitmapScaleY);
												renderTransform.concat(transform);
												renderer.setTransform(renderTransform,context);
												context.drawImage(canvas,0,0,width,height);
												openfl_geom_Matrix.__pool.release(renderTransform);
												renderer.__popMaskObject(textField);
											}
										}
									}
								}
							}
						}
					}
				}
			}
			if(smoothingEnabled) {
				renderer.context.imageSmoothingEnabled = true;
			}
		}
	}
};
openfl_display__$internal_CanvasTextField.renderDrawableMask = function(textField,renderer) {
	openfl_display__$internal_CanvasDisplayObject.renderDrawableMask(textField,renderer);
};
var openfl_display__$internal_CanvasTilemap = function() { };
$hxClasses["openfl.display._internal.CanvasTilemap"] = openfl_display__$internal_CanvasTilemap;
openfl_display__$internal_CanvasTilemap.__name__ = "openfl.display._internal.CanvasTilemap";
openfl_display__$internal_CanvasTilemap.render = function(tilemap,renderer) {
	if(!tilemap.__renderable || tilemap.__group.__tiles.length == 0) {
		return;
	}
	var alpha = renderer.__getAlpha(tilemap.__worldAlpha);
	if(alpha <= 0) {
		return;
	}
	var context = renderer.context;
	renderer.__setBlendMode(tilemap.__worldBlendMode);
	renderer.__pushMaskObject(tilemap);
	var rect = openfl_geom_Rectangle.__pool.get();
	rect.setTo(0,0,tilemap.__width,tilemap.__height);
	renderer.__pushMaskRect(rect,tilemap.__renderTransform);
	if(!renderer.__allowSmoothing || !tilemap.smoothing) {
		context.imageSmoothingEnabled = false;
	}
	openfl_display__$internal_CanvasTilemap.renderTileContainer(tilemap.__group,renderer,tilemap.__renderTransform,tilemap.__tileset,renderer.__allowSmoothing && tilemap.smoothing,tilemap.tileAlphaEnabled,alpha,tilemap.tileBlendModeEnabled,tilemap.__worldBlendMode,null,null,rect);
	if(!renderer.__allowSmoothing || !tilemap.smoothing) {
		context.imageSmoothingEnabled = true;
	}
	renderer.__popMaskRect();
	renderer.__popMaskObject(tilemap);
	openfl_geom_Rectangle.__pool.release(rect);
};
openfl_display__$internal_CanvasTilemap.renderTileContainer = function(group,renderer,parentTransform,defaultTileset,smooth,alphaEnabled,worldAlpha,blendModeEnabled,defaultBlendMode,cacheBitmapData,source,rect) {
	var context = renderer.context;
	var roundPixels = renderer.__roundPixels;
	var tileTransform = openfl_geom_Matrix.__pool.get();
	var tiles = group.__tiles;
	var length = group.__length;
	var tile;
	var tileset;
	var alpha;
	var visible;
	var blendMode = null;
	var id;
	var tileData;
	var tileRect;
	var bitmapData;
	var _g = 0;
	var _g1 = length;
	while(_g < _g1) {
		var i = _g++;
		tile = tiles[i];
		tileTransform.setTo(1,0,0,1,-tile.get_originX(),-tile.get_originY());
		tileTransform.concat(tile.get_matrix());
		tileTransform.concat(parentTransform);
		if(roundPixels) {
			tileTransform.tx = Math.round(tileTransform.tx);
			tileTransform.ty = Math.round(tileTransform.ty);
		}
		tileset = tile.get_tileset() != null ? tile.get_tileset() : defaultTileset;
		alpha = tile.get_alpha() * worldAlpha;
		visible = tile.get_visible();
		if(!visible || alpha <= 0) {
			continue;
		}
		if(!alphaEnabled) {
			alpha = 1;
		}
		if(blendModeEnabled) {
			blendMode = tile.__blendMode != null ? tile.__blendMode : defaultBlendMode;
		}
		if(tile.__length > 0) {
			openfl_display__$internal_CanvasTilemap.renderTileContainer(tile,renderer,tileTransform,tileset,smooth,alphaEnabled,alpha,blendModeEnabled,blendMode,cacheBitmapData,source,rect);
		} else {
			if(tileset == null) {
				continue;
			}
			id = tile.get_id();
			if(id == -1) {
				tileRect = tile.__rect;
				if(tileRect == null || tileRect.width <= 0 || tileRect.height <= 0) {
					continue;
				}
			} else {
				tileData = tileset.__data[id];
				if(tileData == null) {
					continue;
				}
				rect.setTo(tileData.x,tileData.y,tileData.width,tileData.height);
				tileRect = rect;
			}
			bitmapData = tileset.__bitmapData;
			if(bitmapData == null || bitmapData.image == null) {
				continue;
			}
			if(bitmapData != cacheBitmapData) {
				if(bitmapData.image.buffer.__srcImage == null) {
					lime__$internal_graphics_ImageCanvasUtil.convertToCanvas(bitmapData.image);
				}
				source = bitmapData.image.get_src();
				cacheBitmapData = bitmapData;
			}
			context.globalAlpha = alpha;
			if(blendModeEnabled) {
				renderer.__setBlendMode(blendMode);
			}
			renderer.setTransform(tileTransform,context);
			context.drawImage(source,tileRect.x,tileRect.y,tileRect.width,tileRect.height,0,0,tileRect.width,tileRect.height);
		}
	}
	openfl_geom_Matrix.__pool.release(tileTransform);
};
openfl_display__$internal_CanvasTilemap.renderDrawable = function(tilemap,renderer) {
	renderer.__updateCacheBitmap(tilemap,false);
	if(tilemap.__cacheBitmap != null && !tilemap.__isCacheBitmapRender) {
		var bitmap = tilemap.__cacheBitmap;
		if(bitmap.__renderable) {
			var alpha = renderer.__getAlpha(bitmap.__worldAlpha);
			if(alpha > 0 && bitmap.__bitmapData != null && bitmap.__bitmapData.__isValid && bitmap.__bitmapData.readable) {
				var context = renderer.context;
				renderer.__setBlendMode(bitmap.__worldBlendMode);
				renderer.__pushMaskObject(bitmap,false);
				lime__$internal_graphics_ImageCanvasUtil.convertToCanvas(bitmap.__bitmapData.image);
				context.globalAlpha = alpha;
				var scrollRect = bitmap.__scrollRect;
				renderer.setTransform(bitmap.__renderTransform,context);
				if(!renderer.__allowSmoothing || !bitmap.smoothing) {
					context.imageSmoothingEnabled = false;
				}
				if(scrollRect == null) {
					context.drawImage(bitmap.__bitmapData.image.get_src(),0,0,bitmap.__bitmapData.image.width,bitmap.__bitmapData.image.height);
				} else {
					context.drawImage(bitmap.__bitmapData.image.get_src(),scrollRect.x,scrollRect.y,scrollRect.width,scrollRect.height,scrollRect.x,scrollRect.y,scrollRect.width,scrollRect.height);
				}
				if(!renderer.__allowSmoothing || !bitmap.smoothing) {
					context.imageSmoothingEnabled = true;
				}
				renderer.__popMaskObject(bitmap,false);
			}
		}
	} else {
		if(!(tilemap.opaqueBackground == null && tilemap.__graphics == null)) {
			if(tilemap.__renderable) {
				var alpha = renderer.__getAlpha(tilemap.__worldAlpha);
				if(!(alpha <= 0)) {
					if(tilemap.opaqueBackground != null && !tilemap.__isCacheBitmapRender && tilemap.get_width() > 0 && tilemap.get_height() > 0) {
						renderer.__setBlendMode(tilemap.__worldBlendMode);
						renderer.__pushMaskObject(tilemap);
						var context = renderer.context;
						renderer.setTransform(tilemap.__renderTransform,context);
						var color = tilemap.opaqueBackground;
						context.fillStyle = "rgb(" + (color >>> 16 & 255) + "," + (color >>> 8 & 255) + "," + (color & 255) + ")";
						context.fillRect(0,0,tilemap.get_width(),tilemap.get_height());
						renderer.__popMaskObject(tilemap);
					}
					if(tilemap.__graphics != null) {
						if(tilemap.__renderable) {
							var alpha = renderer.__getAlpha(tilemap.__worldAlpha);
							if(!(alpha <= 0)) {
								var graphics = tilemap.__graphics;
								if(graphics != null) {
									openfl_display__$internal_CanvasGraphics.render(graphics,renderer);
									var width = graphics.__width;
									var height = graphics.__height;
									var canvas = graphics.__canvas;
									if(canvas != null && graphics.__visible && width >= 1 && height >= 1) {
										var transform = graphics.__worldTransform;
										var context = renderer.context;
										var scrollRect = tilemap.__scrollRect;
										if(scrollRect == null || scrollRect.width > 0 && scrollRect.height > 0) {
											renderer.__setBlendMode(tilemap.__worldBlendMode);
											renderer.__pushMaskObject(tilemap);
											context.globalAlpha = alpha;
											var renderTransform = openfl_geom_Matrix.__pool.get();
											renderTransform.scale(1 / graphics.__bitmapScaleX,1 / graphics.__bitmapScaleY);
											renderTransform.concat(transform);
											renderer.setTransform(renderTransform,context);
											context.drawImage(canvas,0,0,width,height);
											openfl_geom_Matrix.__pool.release(renderTransform);
											renderer.__popMaskObject(tilemap);
										}
									}
								}
							}
						}
					}
				}
			}
		}
		if(!(!tilemap.__renderable || tilemap.__group.__tiles.length == 0)) {
			var alpha = renderer.__getAlpha(tilemap.__worldAlpha);
			if(!(alpha <= 0)) {
				var context = renderer.context;
				renderer.__setBlendMode(tilemap.__worldBlendMode);
				renderer.__pushMaskObject(tilemap);
				var rect = openfl_geom_Rectangle.__pool.get();
				rect.setTo(0,0,tilemap.__width,tilemap.__height);
				renderer.__pushMaskRect(rect,tilemap.__renderTransform);
				if(!renderer.__allowSmoothing || !tilemap.smoothing) {
					context.imageSmoothingEnabled = false;
				}
				openfl_display__$internal_CanvasTilemap.renderTileContainer(tilemap.__group,renderer,tilemap.__renderTransform,tilemap.__tileset,renderer.__allowSmoothing && tilemap.smoothing,tilemap.tileAlphaEnabled,alpha,tilemap.tileBlendModeEnabled,tilemap.__worldBlendMode,null,null,rect);
				if(!renderer.__allowSmoothing || !tilemap.smoothing) {
					context.imageSmoothingEnabled = true;
				}
				renderer.__popMaskRect();
				renderer.__popMaskObject(tilemap);
				openfl_geom_Rectangle.__pool.release(rect);
			}
		}
	}
	renderer.__renderEvent(tilemap);
};
openfl_display__$internal_CanvasTilemap.renderDrawableMask = function(tilemap,renderer) {
};
var openfl_display__$internal_CanvasVideo = function() { };
$hxClasses["openfl.display._internal.CanvasVideo"] = openfl_display__$internal_CanvasVideo;
openfl_display__$internal_CanvasVideo.__name__ = "openfl.display._internal.CanvasVideo";
openfl_display__$internal_CanvasVideo.render = function(video,renderer) {
	if(!video.__renderable || video.__stream == null) {
		return;
	}
	var alpha = renderer.__getAlpha(video.__worldAlpha);
	if(alpha <= 0) {
		return;
	}
	var context = renderer.context;
	if(video.__stream.__video != null) {
		renderer.__setBlendMode(video.__worldBlendMode);
		renderer.__pushMaskObject(video);
		context.globalAlpha = alpha;
		var scrollRect = video.__scrollRect;
		var smoothing = video.smoothing;
		renderer.setTransform(video.__worldTransform,context);
		if(!smoothing) {
			context.imageSmoothingEnabled = false;
		}
		if(scrollRect == null) {
			context.drawImage(video.__stream.__video,0,0,video.get_width(),video.get_height());
		} else {
			context.drawImage(video.__stream.__video,scrollRect.x,scrollRect.y,scrollRect.width,scrollRect.height,scrollRect.x,scrollRect.y,scrollRect.width,scrollRect.height);
		}
		if(!smoothing) {
			context.imageSmoothingEnabled = true;
		}
		renderer.__popMaskObject(video);
	}
};
openfl_display__$internal_CanvasVideo.renderDrawable = function(video,renderer) {
	openfl_display__$internal_CanvasVideo.render(video,renderer);
	renderer.__renderEvent(video);
};
openfl_display__$internal_CanvasVideo.renderDrawableMask = function(video,renderer) {
};
var openfl_display__$internal_Context3DBitmap = function() { };
$hxClasses["openfl.display._internal.Context3DBitmap"] = openfl_display__$internal_Context3DBitmap;
openfl_display__$internal_Context3DBitmap.__name__ = "openfl.display._internal.Context3DBitmap";
openfl_display__$internal_Context3DBitmap.render = function(bitmap,renderer) {
	if(!bitmap.__renderable || bitmap.__worldAlpha <= 0) {
		return;
	}
	if(bitmap.__bitmapData != null && bitmap.__bitmapData.__isValid) {
		var context = renderer.__context3D;
		renderer.__setBlendMode(bitmap.__worldBlendMode);
		renderer.__pushMaskObject(bitmap);
		var shader = renderer.__initDisplayShader(bitmap.__worldShader);
		renderer.setShader(shader);
		renderer.applyBitmapData(bitmap.__bitmapData,renderer.__allowSmoothing && (bitmap.smoothing || renderer.__upscaled));
		renderer.applyMatrix(renderer.__getMatrix(bitmap.__renderTransform,bitmap.pixelSnapping));
		renderer.applyAlpha(bitmap.__worldAlpha);
		renderer.applyColorTransform(bitmap.__worldColorTransform);
		renderer.updateShader();
		var vertexBuffer = bitmap.__bitmapData.getVertexBuffer(context);
		if(shader.__position != null) {
			context.setVertexBufferAt(shader.__position.index,vertexBuffer,0,3);
		}
		if(shader.__textureCoord != null) {
			context.setVertexBufferAt(shader.__textureCoord.index,vertexBuffer,3,2);
		}
		var indexBuffer = bitmap.__bitmapData.getIndexBuffer(context);
		context.drawTriangles(indexBuffer);
		renderer.__clearShader();
		renderer.__popMaskObject(bitmap);
	}
};
openfl_display__$internal_Context3DBitmap.renderDrawable = function(bitmap,renderer) {
	renderer.__updateCacheBitmap(bitmap,false);
	if(bitmap.__bitmapData != null && bitmap.__bitmapData.image != null) {
		bitmap.__imageVersion = bitmap.__bitmapData.image.version;
	}
	if(bitmap.__cacheBitmap != null && !bitmap.__isCacheBitmapRender) {
		openfl_display__$internal_Context3DBitmap.render(bitmap.__cacheBitmap,renderer);
	} else {
		if(!(bitmap.opaqueBackground == null && bitmap.__graphics == null)) {
			if(!(!bitmap.__renderable || bitmap.__worldAlpha <= 0)) {
				if(bitmap.opaqueBackground != null && !bitmap.__isCacheBitmapRender && bitmap.get_width() > 0 && bitmap.get_height() > 0) {
					renderer.__setBlendMode(bitmap.__worldBlendMode);
					renderer.__pushMaskObject(bitmap);
					var context = renderer.__context3D;
					var rect = openfl_geom_Rectangle.__pool.get();
					rect.setTo(0,0,bitmap.get_width(),bitmap.get_height());
					renderer.__pushMaskRect(rect,bitmap.__renderTransform);
					var color = bitmap.opaqueBackground;
					context.__clear(true,(color >>> 16 & 255) / 255,(color >>> 8 & 255) / 255,(color & 255) / 255,1,0,0,1);
					renderer.__popMaskRect();
					renderer.__popMaskObject(bitmap);
					openfl_geom_Rectangle.__pool.release(rect);
				}
				if(bitmap.__graphics != null) {
					openfl_display__$internal_Context3DShape.render(bitmap,renderer);
				}
			}
		}
		openfl_display__$internal_Context3DBitmap.render(bitmap,renderer);
	}
	renderer.__renderEvent(bitmap);
};
openfl_display__$internal_Context3DBitmap.renderDrawableMask = function(bitmap,renderer) {
	openfl_display__$internal_Context3DBitmap.renderMask(bitmap,renderer);
};
openfl_display__$internal_Context3DBitmap.renderMask = function(bitmap,renderer) {
	if(bitmap.__bitmapData != null && bitmap.__bitmapData.__isValid) {
		var context = renderer.__context3D;
		var shader = renderer.__maskShader;
		renderer.setShader(shader);
		renderer.applyBitmapData(openfl_display__$internal_Context3DMaskShader.opaqueBitmapData,true);
		renderer.applyMatrix(renderer.__getMatrix(bitmap.__renderTransform,bitmap.pixelSnapping));
		renderer.updateShader();
		var vertexBuffer = bitmap.__bitmapData.getVertexBuffer(context);
		if(shader.__position != null) {
			context.setVertexBufferAt(shader.__position.index,vertexBuffer,0,3);
		}
		if(shader.__textureCoord != null) {
			context.setVertexBufferAt(shader.__textureCoord.index,vertexBuffer,3,2);
		}
		var indexBuffer = bitmap.__bitmapData.getIndexBuffer(context);
		context.drawTriangles(indexBuffer);
		renderer.__clearShader();
	}
};
var openfl_display__$internal_Context3DBitmapData = function() { };
$hxClasses["openfl.display._internal.Context3DBitmapData"] = openfl_display__$internal_Context3DBitmapData;
openfl_display__$internal_Context3DBitmapData.__name__ = "openfl.display._internal.Context3DBitmapData";
openfl_display__$internal_Context3DBitmapData.renderDrawable = function(bitmapData,renderer) {
	var context = renderer.__context3D;
	var gl = context.gl;
	renderer.__setBlendMode(10);
	var shader = renderer.__defaultDisplayShader;
	renderer.setShader(shader);
	renderer.applyBitmapData(bitmapData,renderer.__upscaled);
	renderer.applyMatrix(renderer.__getMatrix(bitmapData.__worldTransform,1));
	renderer.applyAlpha(bitmapData.__worldAlpha);
	renderer.applyColorTransform(bitmapData.__worldColorTransform);
	renderer.updateShader();
	var vertexBuffer = bitmapData.getVertexBuffer(context);
	if(shader.__position != null) {
		context.setVertexBufferAt(shader.__position.index,vertexBuffer,0,3);
	}
	if(shader.__textureCoord != null) {
		context.setVertexBufferAt(shader.__textureCoord.index,vertexBuffer,3,2);
	}
	var indexBuffer = bitmapData.getIndexBuffer(context);
	context.drawTriangles(indexBuffer);
	renderer.__clearShader();
};
openfl_display__$internal_Context3DBitmapData.renderDrawableMask = function(bitmapData,renderer) {
	var context = renderer.__context3D;
	var gl = context.gl;
	var shader = renderer.__maskShader;
	renderer.setShader(shader);
	renderer.applyBitmapData(bitmapData,renderer.__upscaled);
	renderer.applyMatrix(renderer.__getMatrix(bitmapData.__worldTransform,1));
	renderer.updateShader();
	var vertexBuffer = bitmapData.getVertexBuffer(context);
	if(shader.__position != null) {
		context.setVertexBufferAt(shader.__position.index,vertexBuffer,0,3);
	}
	if(shader.__textureCoord != null) {
		context.setVertexBufferAt(shader.__textureCoord.index,vertexBuffer,3,2);
	}
	var indexBuffer = bitmapData.getIndexBuffer(context);
	context.drawTriangles(indexBuffer);
	renderer.__clearShader();
};
var openfl_display__$internal_Context3DBuffer = function(context3D,elementType,elementCount,dataPerVertex) {
	this.context3D = context3D;
	this.elementType = elementType;
	this.dataPerVertex = dataPerVertex;
	this.indexCount = 0;
	this.vertexCount = 0;
	this.resize(elementCount);
};
$hxClasses["openfl.display._internal.Context3DBuffer"] = openfl_display__$internal_Context3DBuffer;
openfl_display__$internal_Context3DBuffer.__name__ = "openfl.display._internal.Context3DBuffer";
openfl_display__$internal_Context3DBuffer.prototype = {
	dataPerVertex: null
	,elementCount: null
	,elementType: null
	,indexBufferData: null
	,indexBuffers: null
	,indexCount: null
	,vertexBuffer: null
	,vertexBufferData: null
	,vertexCount: null
	,context3D: null
	,drawElements: function(start,length) {
		if(length == null) {
			length = -1;
		}
		if(this.indexCount == 0 || this.vertexCount == 0) {
			return;
		}
		if(this.elementType._hx_index == 0) {
			if(length == -1) {
				length = this.elementCount * 2;
			}
			if(start < 10922 && length - start < 10922) {
				this.context3D.drawTriangles(this.indexBuffers[0],start,length * 2);
			} else {
				var end = start + length;
				while(start < end) {
					var arrayBufferIndex = Math.floor(start / 10922);
					length = Math.min(end - start,10922) | 0;
					if(length <= 0) {
						break;
					}
					this.context3D.drawTriangles(this.indexBuffers[arrayBufferIndex],(start - arrayBufferIndex * 10922) * 3,length * 2);
					start += length;
				}
			}
		}
	}
	,flushVertexBufferData: function() {
		if(this.vertexBufferData.length > this.vertexCount) {
			this.vertexCount = this.vertexBufferData.length;
			this.vertexBuffer = this.context3D.createVertexBuffer(this.vertexCount,this.dataPerVertex,0);
		}
		this.vertexBuffer.uploadFromTypedArray(lime_utils_Float32Array.toArrayBufferView(this.vertexBufferData));
	}
	,resize: function(elementCount,dataPerVertex) {
		if(dataPerVertex == null) {
			dataPerVertex = -1;
		}
		this.elementCount = elementCount;
		if(dataPerVertex == -1) {
			dataPerVertex = this.dataPerVertex;
		}
		if(dataPerVertex != this.dataPerVertex) {
			this.vertexBuffer = null;
			this.vertexCount = 0;
			this.dataPerVertex = dataPerVertex;
		}
		var numVertices = 0;
		switch(this.elementType._hx_index) {
		case 0:
			numVertices = elementCount * 4;
			break;
		case 1:
			numVertices = elementCount * 3;
			break;
		case 2:
			numVertices = elementCount * 3;
			break;
		}
		var vertexLength = numVertices * dataPerVertex;
		if(this.vertexBufferData == null) {
			var array = null;
			var vector = null;
			var view = null;
			var buffer = null;
			var len = null;
			var this1;
			if(vertexLength != null) {
				this1 = new Float32Array(vertexLength);
			} else if(array != null) {
				this1 = new Float32Array(array);
			} else if(vector != null) {
				this1 = new Float32Array(vector.__array);
			} else if(view != null) {
				this1 = new Float32Array(view);
			} else if(buffer != null) {
				if(len == null) {
					this1 = new Float32Array(buffer,0);
				} else {
					this1 = new Float32Array(buffer,0,len);
				}
			} else {
				this1 = null;
			}
			this.vertexBufferData = this1;
		} else if(vertexLength > this.vertexBufferData.length) {
			var cacheBufferData = this.vertexBufferData;
			var array = null;
			var vector = null;
			var view = null;
			var buffer = null;
			var len = null;
			var this1;
			if(vertexLength != null) {
				this1 = new Float32Array(vertexLength);
			} else if(array != null) {
				this1 = new Float32Array(array);
			} else if(vector != null) {
				this1 = new Float32Array(vector.__array);
			} else if(view != null) {
				this1 = new Float32Array(view);
			} else if(buffer != null) {
				if(len == null) {
					this1 = new Float32Array(buffer,0);
				} else {
					this1 = new Float32Array(buffer,0,len);
				}
			} else {
				this1 = null;
			}
			this.vertexBufferData = this1;
			this.vertexBufferData.set(cacheBufferData);
		}
	}
	,__class__: openfl_display__$internal_Context3DBuffer
};
var openfl_display__$internal_Context3DElementType = $hxEnums["openfl.display._internal.Context3DElementType"] = { __ename__:"openfl.display._internal.Context3DElementType",__constructs__:null
	,QUADS: {_hx_name:"QUADS",_hx_index:0,__enum__:"openfl.display._internal.Context3DElementType",toString:$estr}
	,TRIANGLES: {_hx_name:"TRIANGLES",_hx_index:1,__enum__:"openfl.display._internal.Context3DElementType",toString:$estr}
	,TRIANGLE_INDICES: {_hx_name:"TRIANGLE_INDICES",_hx_index:2,__enum__:"openfl.display._internal.Context3DElementType",toString:$estr}
};
openfl_display__$internal_Context3DElementType.__constructs__ = [openfl_display__$internal_Context3DElementType.QUADS,openfl_display__$internal_Context3DElementType.TRIANGLES,openfl_display__$internal_Context3DElementType.TRIANGLE_INDICES];
var openfl_display__$internal_Context3DDisplayObject = function() { };
$hxClasses["openfl.display._internal.Context3DDisplayObject"] = openfl_display__$internal_Context3DDisplayObject;
openfl_display__$internal_Context3DDisplayObject.__name__ = "openfl.display._internal.Context3DDisplayObject";
openfl_display__$internal_Context3DDisplayObject.render = function(displayObject,renderer) {
	if(displayObject.opaqueBackground == null && displayObject.__graphics == null) {
		return;
	}
	if(!displayObject.__renderable || displayObject.__worldAlpha <= 0) {
		return;
	}
	if(displayObject.opaqueBackground != null && !displayObject.__isCacheBitmapRender && displayObject.get_width() > 0 && displayObject.get_height() > 0) {
		renderer.__setBlendMode(displayObject.__worldBlendMode);
		renderer.__pushMaskObject(displayObject);
		var context = renderer.__context3D;
		var rect = openfl_geom_Rectangle.__pool.get();
		rect.setTo(0,0,displayObject.get_width(),displayObject.get_height());
		renderer.__pushMaskRect(rect,displayObject.__renderTransform);
		var color = displayObject.opaqueBackground;
		context.__clear(true,(color >>> 16 & 255) / 255,(color >>> 8 & 255) / 255,(color & 255) / 255,1,0,0,1);
		renderer.__popMaskRect();
		renderer.__popMaskObject(displayObject);
		openfl_geom_Rectangle.__pool.release(rect);
	}
	if(displayObject.__graphics != null) {
		openfl_display__$internal_Context3DShape.render(displayObject,renderer);
	}
};
openfl_display__$internal_Context3DDisplayObject.renderDrawable = function(displayObject,renderer) {
	renderer.__updateCacheBitmap(displayObject,false);
	if(displayObject.__cacheBitmap != null && !displayObject.__isCacheBitmapRender) {
		openfl_display__$internal_Context3DBitmap.render(displayObject.__cacheBitmap,renderer);
	} else if(!(displayObject.opaqueBackground == null && displayObject.__graphics == null)) {
		if(!(!displayObject.__renderable || displayObject.__worldAlpha <= 0)) {
			if(displayObject.opaqueBackground != null && !displayObject.__isCacheBitmapRender && displayObject.get_width() > 0 && displayObject.get_height() > 0) {
				renderer.__setBlendMode(displayObject.__worldBlendMode);
				renderer.__pushMaskObject(displayObject);
				var context = renderer.__context3D;
				var rect = openfl_geom_Rectangle.__pool.get();
				rect.setTo(0,0,displayObject.get_width(),displayObject.get_height());
				renderer.__pushMaskRect(rect,displayObject.__renderTransform);
				var color = displayObject.opaqueBackground;
				context.__clear(true,(color >>> 16 & 255) / 255,(color >>> 8 & 255) / 255,(color & 255) / 255,1,0,0,1);
				renderer.__popMaskRect();
				renderer.__popMaskObject(displayObject);
				openfl_geom_Rectangle.__pool.release(rect);
			}
			if(displayObject.__graphics != null) {
				openfl_display__$internal_Context3DShape.render(displayObject,renderer);
			}
		}
	}
	renderer.__renderEvent(displayObject);
};
openfl_display__$internal_Context3DDisplayObject.renderDrawableMask = function(displayObject,renderer) {
	if(displayObject.__graphics != null) {
		openfl_display__$internal_Context3DShape.renderMask(displayObject,renderer);
	}
};
openfl_display__$internal_Context3DDisplayObject.renderMask = function(displayObject,renderer) {
	if(displayObject.opaqueBackground == null && displayObject.__graphics == null) {
		return;
	}
	var tmp = displayObject.opaqueBackground != null && !displayObject.__isCacheBitmapRender && displayObject.get_width() > 0 && displayObject.get_height() > 0;
	if(displayObject.__graphics != null) {
		openfl_display__$internal_Context3DShape.renderMask(displayObject,renderer);
	}
};
var openfl_display__$internal_Context3DDisplayObjectContainer = function() { };
$hxClasses["openfl.display._internal.Context3DDisplayObjectContainer"] = openfl_display__$internal_Context3DDisplayObjectContainer;
openfl_display__$internal_Context3DDisplayObjectContainer.__name__ = "openfl.display._internal.Context3DDisplayObjectContainer";
openfl_display__$internal_Context3DDisplayObjectContainer.renderDrawable = function(displayObjectContainer,renderer) {
	var orphan = displayObjectContainer.__removedChildren.iterator();
	while(orphan.hasNext()) {
		var orphan1 = orphan.next();
		if(orphan1.stage == null) {
			orphan1.__cleanup();
		}
	}
	displayObjectContainer.__removedChildren.set_length(0);
	if(!displayObjectContainer.__renderable || displayObjectContainer.__worldAlpha <= 0) {
		return;
	}
	openfl_display__$internal_Context3DDisplayObject.renderDrawable(displayObjectContainer,renderer);
	if(displayObjectContainer.__cacheBitmap != null && !displayObjectContainer.__isCacheBitmapRender) {
		return;
	}
	if(displayObjectContainer.__children.length > 0) {
		renderer.__pushMaskObject(displayObjectContainer);
		if(renderer.__stage != null) {
			var _g = 0;
			var _g1 = displayObjectContainer.__children;
			while(_g < _g1.length) {
				var child = _g1[_g];
				++_g;
				renderer.__renderDrawable(child);
				child.__renderDirty = false;
			}
			displayObjectContainer.__renderDirty = false;
		} else {
			var _g = 0;
			var _g1 = displayObjectContainer.__children;
			while(_g < _g1.length) {
				var child = _g1[_g];
				++_g;
				renderer.__renderDrawable(child);
			}
		}
	}
	if(displayObjectContainer.__children.length > 0) {
		renderer.__popMaskObject(displayObjectContainer);
	}
};
openfl_display__$internal_Context3DDisplayObjectContainer.renderDrawableMask = function(displayObjectContainer,renderer) {
	var orphan = displayObjectContainer.__removedChildren.iterator();
	while(orphan.hasNext()) {
		var orphan1 = orphan.next();
		if(orphan1.stage == null) {
			orphan1.__cleanup();
		}
	}
	displayObjectContainer.__removedChildren.set_length(0);
	if(displayObjectContainer.__graphics != null) {
		openfl_display__$internal_Context3DShape.renderMask(displayObjectContainer,renderer);
	}
	var _g = 0;
	var _g1 = displayObjectContainer.__children;
	while(_g < _g1.length) {
		var child = _g1[_g];
		++_g;
		renderer.__renderDrawableMask(child);
	}
};
var openfl_display__$internal_Context3DGraphics = function() { };
$hxClasses["openfl.display._internal.Context3DGraphics"] = openfl_display__$internal_Context3DGraphics;
openfl_display__$internal_Context3DGraphics.__name__ = "openfl.display._internal.Context3DGraphics";
openfl_display__$internal_Context3DGraphics.buildBuffer = function(graphics,renderer) {
	var quadBufferPosition = 0;
	var triangleIndexBufferPosition = 0;
	var vertexBufferPosition = 0;
	var vertexBufferPositionUVT = 0;
	var bounds = graphics.__bounds;
	var data = new openfl_display__$internal_DrawCommandReader(graphics.__commands);
	var context = renderer.__context3D;
	var tileRect = openfl_geom_Rectangle.__pool.get();
	var tileTransform = openfl_geom_Matrix.__pool.get();
	var bitmap = null;
	var bitmapMatrix = null;
	var scale9Grid = graphics.__owner.__scale9Grid;
	var hasScale9Grid = scale9Grid != null && !graphics.__owner.__isMask && graphics.__worldTransform.b == 0 && graphics.__worldTransform.c == 0;
	if(!hasScale9Grid) {
		scale9Grid = null;
	}
	var _g = 0;
	var _g1 = graphics.__commands.types;
	while(_g < _g1.length) {
		var type = _g1[_g];
		++_g;
		switch(type._hx_index) {
		case 0:
			switch(data.prev._hx_index) {
			case 0:
				data.oPos += 2;
				data.bPos += 2;
				break;
			case 1:
				data.iPos += 1;
				data.fPos += 1;
				break;
			case 2:
				data.oPos += 4;
				data.iiPos += 2;
				data.ffPos += 1;
				data.fPos += 1;
				break;
			case 3:
				data.oPos += 1;
				break;
			case 4:
				data.fPos += 6;
				break;
			case 5:
				data.fPos += 4;
				break;
			case 6:
				data.fPos += 3;
				break;
			case 7:
				data.fPos += 4;
				break;
			case 8:
				data.oPos += 3;
				break;
			case 9:
				data.fPos += 4;
				break;
			case 10:
				data.fPos += 5;
				data.oPos += 1;
				break;
			case 12:
				data.oPos += 4;
				break;
			case 13:
				break;
			case 14:
				data.oPos += 2;
				data.bPos += 2;
				break;
			case 15:
				data.oPos += 4;
				data.iiPos += 2;
				data.ffPos += 1;
				data.fPos += 1;
				break;
			case 16:
				data.oPos += 4;
				data.iPos += 1;
				data.fPos += 2;
				data.bPos += 1;
				break;
			case 17:
				data.fPos += 2;
				break;
			case 18:
				data.fPos += 2;
				break;
			case 19:
				data.oPos += 1;
				break;
			case 20:
				data.oPos += 1;
				break;
			case 21:case 22:
				break;
			default:
			}
			data.prev = openfl_display__$internal_DrawCommandType.BEGIN_BITMAP_FILL;
			var c = data;
			bitmap = c.buffer.o[c.oPos];
			bitmapMatrix = c.buffer.o[c.oPos + 1];
			break;
		case 1:
			bitmap = null;
			bitmapMatrix = null;
			switch(data.prev._hx_index) {
			case 0:
				data.oPos += 2;
				data.bPos += 2;
				break;
			case 1:
				data.iPos += 1;
				data.fPos += 1;
				break;
			case 2:
				data.oPos += 4;
				data.iiPos += 2;
				data.ffPos += 1;
				data.fPos += 1;
				break;
			case 3:
				data.oPos += 1;
				break;
			case 4:
				data.fPos += 6;
				break;
			case 5:
				data.fPos += 4;
				break;
			case 6:
				data.fPos += 3;
				break;
			case 7:
				data.fPos += 4;
				break;
			case 8:
				data.oPos += 3;
				break;
			case 9:
				data.fPos += 4;
				break;
			case 10:
				data.fPos += 5;
				data.oPos += 1;
				break;
			case 12:
				data.oPos += 4;
				break;
			case 13:
				break;
			case 14:
				data.oPos += 2;
				data.bPos += 2;
				break;
			case 15:
				data.oPos += 4;
				data.iiPos += 2;
				data.ffPos += 1;
				data.fPos += 1;
				break;
			case 16:
				data.oPos += 4;
				data.iPos += 1;
				data.fPos += 2;
				data.bPos += 1;
				break;
			case 17:
				data.fPos += 2;
				break;
			case 18:
				data.fPos += 2;
				break;
			case 19:
				data.oPos += 1;
				break;
			case 20:
				data.oPos += 1;
				break;
			case 21:case 22:
				break;
			default:
			}
			data.prev = type;
			break;
		case 2:
			bitmap = null;
			bitmapMatrix = null;
			switch(data.prev._hx_index) {
			case 0:
				data.oPos += 2;
				data.bPos += 2;
				break;
			case 1:
				data.iPos += 1;
				data.fPos += 1;
				break;
			case 2:
				data.oPos += 4;
				data.iiPos += 2;
				data.ffPos += 1;
				data.fPos += 1;
				break;
			case 3:
				data.oPos += 1;
				break;
			case 4:
				data.fPos += 6;
				break;
			case 5:
				data.fPos += 4;
				break;
			case 6:
				data.fPos += 3;
				break;
			case 7:
				data.fPos += 4;
				break;
			case 8:
				data.oPos += 3;
				break;
			case 9:
				data.fPos += 4;
				break;
			case 10:
				data.fPos += 5;
				data.oPos += 1;
				break;
			case 12:
				data.oPos += 4;
				break;
			case 13:
				break;
			case 14:
				data.oPos += 2;
				data.bPos += 2;
				break;
			case 15:
				data.oPos += 4;
				data.iiPos += 2;
				data.ffPos += 1;
				data.fPos += 1;
				break;
			case 16:
				data.oPos += 4;
				data.iPos += 1;
				data.fPos += 2;
				data.bPos += 1;
				break;
			case 17:
				data.fPos += 2;
				break;
			case 18:
				data.fPos += 2;
				break;
			case 19:
				data.oPos += 1;
				break;
			case 20:
				data.oPos += 1;
				break;
			case 21:case 22:
				break;
			default:
			}
			data.prev = type;
			break;
		case 3:
			switch(data.prev._hx_index) {
			case 0:
				data.oPos += 2;
				data.bPos += 2;
				break;
			case 1:
				data.iPos += 1;
				data.fPos += 1;
				break;
			case 2:
				data.oPos += 4;
				data.iiPos += 2;
				data.ffPos += 1;
				data.fPos += 1;
				break;
			case 3:
				data.oPos += 1;
				break;
			case 4:
				data.fPos += 6;
				break;
			case 5:
				data.fPos += 4;
				break;
			case 6:
				data.fPos += 3;
				break;
			case 7:
				data.fPos += 4;
				break;
			case 8:
				data.oPos += 3;
				break;
			case 9:
				data.fPos += 4;
				break;
			case 10:
				data.fPos += 5;
				data.oPos += 1;
				break;
			case 12:
				data.oPos += 4;
				break;
			case 13:
				break;
			case 14:
				data.oPos += 2;
				data.bPos += 2;
				break;
			case 15:
				data.oPos += 4;
				data.iiPos += 2;
				data.ffPos += 1;
				data.fPos += 1;
				break;
			case 16:
				data.oPos += 4;
				data.iPos += 1;
				data.fPos += 2;
				data.bPos += 1;
				break;
			case 17:
				data.fPos += 2;
				break;
			case 18:
				data.fPos += 2;
				break;
			case 19:
				data.oPos += 1;
				break;
			case 20:
				data.oPos += 1;
				break;
			case 21:case 22:
				break;
			default:
			}
			data.prev = openfl_display__$internal_DrawCommandType.BEGIN_SHADER_FILL;
			var c1 = data;
			var shaderBuffer = c1.buffer.o[c1.oPos];
			bitmap = null;
			bitmapMatrix = null;
			if(shaderBuffer != null) {
				var _g2 = 0;
				var _g3 = shaderBuffer.inputCount;
				while(_g2 < _g3) {
					var i = _g2++;
					if(shaderBuffer.inputRefs[i].name == "bitmap") {
						bitmap = shaderBuffer.inputs[i];
						break;
					}
				}
			}
			break;
		case 6:
			switch(data.prev._hx_index) {
			case 0:
				data.oPos += 2;
				data.bPos += 2;
				break;
			case 1:
				data.iPos += 1;
				data.fPos += 1;
				break;
			case 2:
				data.oPos += 4;
				data.iiPos += 2;
				data.ffPos += 1;
				data.fPos += 1;
				break;
			case 3:
				data.oPos += 1;
				break;
			case 4:
				data.fPos += 6;
				break;
			case 5:
				data.fPos += 4;
				break;
			case 6:
				data.fPos += 3;
				break;
			case 7:
				data.fPos += 4;
				break;
			case 8:
				data.oPos += 3;
				break;
			case 9:
				data.fPos += 4;
				break;
			case 10:
				data.fPos += 5;
				data.oPos += 1;
				break;
			case 12:
				data.oPos += 4;
				break;
			case 13:
				break;
			case 14:
				data.oPos += 2;
				data.bPos += 2;
				break;
			case 15:
				data.oPos += 4;
				data.iiPos += 2;
				data.ffPos += 1;
				data.fPos += 1;
				break;
			case 16:
				data.oPos += 4;
				data.iPos += 1;
				data.fPos += 2;
				data.bPos += 1;
				break;
			case 17:
				data.fPos += 2;
				break;
			case 18:
				data.fPos += 2;
				break;
			case 19:
				data.oPos += 1;
				break;
			case 20:
				data.oPos += 1;
				break;
			case 21:case 22:
				break;
			default:
			}
			data.prev = openfl_display__$internal_DrawCommandType.DRAW_CIRCLE;
			var c2 = data;
			var x = c2.buffer.f[c2.fPos];
			var y = c2.buffer.f[c2.fPos + 1];
			var radius = c2.buffer.f[c2.fPos + 2];
			var scaleX = graphics.__owner.get_scaleX();
			var scaleY = graphics.__owner.get_scaleY();
			openfl_display__$internal__$Context3DGraphics_PolygonFunctions.buildEllipseVerticesAndIndices(x - radius,y - radius,radius,radius,scaleX,scaleY,openfl_display__$internal_Context3DGraphics.tempVerticesVector,openfl_display__$internal_Context3DGraphics.tempIndicesVector);
			var vertices = openfl_display__$internal_Context3DGraphics.tempVerticesVector;
			var indices = openfl_display__$internal_Context3DGraphics.tempIndicesVector;
			var uvtData = null;
			if(hasScale9Grid) {
				if(openfl_display__$internal_Context3DGraphics.tempScale9VerticesVector == null) {
					openfl_display__$internal_Context3DGraphics.tempScale9VerticesVector = openfl_Vector.toFloatVector(null,vertices.get_length());
				} else {
					openfl_display__$internal_Context3DGraphics.tempScale9VerticesVector.set_length(vertices.get_length());
				}
				var i1 = 0;
				var length = vertices.get_length();
				var isX = true;
				while(i1 < length) {
					if(isX) {
						openfl_display__$internal_Context3DGraphics.tempScale9VerticesVector.set(i1,openfl_display__$internal_Context3DGraphics.toScale9Position(vertices.get(i1),scale9Grid.x,scale9Grid.width,bounds.width,graphics.__owner.get_scaleX()) / graphics.__owner.get_scaleX());
					} else {
						openfl_display__$internal_Context3DGraphics.tempScale9VerticesVector.set(i1,openfl_display__$internal_Context3DGraphics.toScale9Position(vertices.get(i1),scale9Grid.y,scale9Grid.height,bounds.height,graphics.__owner.get_scaleY()) / graphics.__owner.get_scaleY());
					}
					++i1;
					isX = !isX;
				}
				vertices = openfl_display__$internal_Context3DGraphics.tempScale9VerticesVector;
			}
			if(bitmap != null && uvtData == null) {
				uvtData = openfl_display__$internal_Context3DGraphics.tempUvtVector;
				openfl_display__$internal_Context3DGraphics.populateUvtVector(vertices,bitmap,uvtData);
			}
			var hasIndices = indices != null;
			var numVertices = Math.floor(vertices.get_length() / 2);
			var length1 = hasIndices ? indices.get_length() : numVertices;
			var hasUVData = uvtData != null;
			var hasUVTData = hasUVData && uvtData.get_length() >= numVertices * 3;
			var vertLength = hasUVTData ? 4 : 2;
			var uvStride = hasUVTData ? 3 : 2;
			var dataPerVertex = vertLength + 2;
			var vertexOffset = hasUVTData ? vertexBufferPositionUVT : vertexBufferPosition;
			openfl_display__$internal_Context3DGraphics.resizeVertexBuffer(graphics,hasUVTData,vertexOffset + length1 * dataPerVertex);
			var vertexBufferData = hasUVTData ? graphics.__vertexBufferDataUVT : graphics.__vertexBufferData;
			var offset;
			var vertOffset;
			var uvOffset;
			var t;
			var _g4 = 0;
			var _g5 = length1;
			while(_g4 < _g5) {
				var i2 = _g4++;
				offset = vertexOffset + i2 * dataPerVertex;
				vertOffset = hasIndices ? indices.get(i2) * 2 : i2 * 2;
				uvOffset = hasIndices ? indices.get(i2) * uvStride : i2 * uvStride;
				if(hasUVTData) {
					t = uvtData.get(uvOffset + 2);
					vertexBufferData[offset] = vertices.get(vertOffset) / t;
					vertexBufferData[offset + 1] = vertices.get(vertOffset + 1) / t;
					vertexBufferData[offset + 2] = 0;
					vertexBufferData[offset + 3] = 1 / t;
				} else {
					vertexBufferData[offset] = vertices.get(vertOffset);
					vertexBufferData[offset + 1] = vertices.get(vertOffset + 1);
				}
				vertexBufferData[offset + vertLength] = hasUVData ? uvtData.get(uvOffset) : 0;
				vertexBufferData[offset + vertLength + 1] = hasUVData ? uvtData.get(uvOffset + 1) : 0;
			}
			if(hasUVTData) {
				vertexBufferPositionUVT += length1 * dataPerVertex;
			} else {
				vertexBufferPosition += length1 * dataPerVertex;
			}
			break;
		case 7:
			switch(data.prev._hx_index) {
			case 0:
				data.oPos += 2;
				data.bPos += 2;
				break;
			case 1:
				data.iPos += 1;
				data.fPos += 1;
				break;
			case 2:
				data.oPos += 4;
				data.iiPos += 2;
				data.ffPos += 1;
				data.fPos += 1;
				break;
			case 3:
				data.oPos += 1;
				break;
			case 4:
				data.fPos += 6;
				break;
			case 5:
				data.fPos += 4;
				break;
			case 6:
				data.fPos += 3;
				break;
			case 7:
				data.fPos += 4;
				break;
			case 8:
				data.oPos += 3;
				break;
			case 9:
				data.fPos += 4;
				break;
			case 10:
				data.fPos += 5;
				data.oPos += 1;
				break;
			case 12:
				data.oPos += 4;
				break;
			case 13:
				break;
			case 14:
				data.oPos += 2;
				data.bPos += 2;
				break;
			case 15:
				data.oPos += 4;
				data.iiPos += 2;
				data.ffPos += 1;
				data.fPos += 1;
				break;
			case 16:
				data.oPos += 4;
				data.iPos += 1;
				data.fPos += 2;
				data.bPos += 1;
				break;
			case 17:
				data.fPos += 2;
				break;
			case 18:
				data.fPos += 2;
				break;
			case 19:
				data.oPos += 1;
				break;
			case 20:
				data.oPos += 1;
				break;
			case 21:case 22:
				break;
			default:
			}
			data.prev = openfl_display__$internal_DrawCommandType.DRAW_ELLIPSE;
			var c3 = data;
			var x1 = c3.buffer.f[c3.fPos];
			var y1 = c3.buffer.f[c3.fPos + 1];
			var radiusX = c3.buffer.f[c3.fPos + 2] / 2.0;
			var radiusY = c3.buffer.f[c3.fPos + 3] / 2.0;
			var scaleX1 = graphics.__owner.get_scaleX();
			var scaleY1 = graphics.__owner.get_scaleY();
			openfl_display__$internal__$Context3DGraphics_PolygonFunctions.buildEllipseVerticesAndIndices(x1,y1,radiusX,radiusY,scaleX1,scaleY1,openfl_display__$internal_Context3DGraphics.tempVerticesVector,openfl_display__$internal_Context3DGraphics.tempIndicesVector);
			var vertices1 = openfl_display__$internal_Context3DGraphics.tempVerticesVector;
			var indices1 = openfl_display__$internal_Context3DGraphics.tempIndicesVector;
			var uvtData1 = null;
			if(hasScale9Grid) {
				if(openfl_display__$internal_Context3DGraphics.tempScale9VerticesVector == null) {
					openfl_display__$internal_Context3DGraphics.tempScale9VerticesVector = openfl_Vector.toFloatVector(null,vertices1.get_length());
				} else {
					openfl_display__$internal_Context3DGraphics.tempScale9VerticesVector.set_length(vertices1.get_length());
				}
				var i3 = 0;
				var length2 = vertices1.get_length();
				var isX1 = true;
				while(i3 < length2) {
					if(isX1) {
						openfl_display__$internal_Context3DGraphics.tempScale9VerticesVector.set(i3,openfl_display__$internal_Context3DGraphics.toScale9Position(vertices1.get(i3),scale9Grid.x,scale9Grid.width,bounds.width,graphics.__owner.get_scaleX()) / graphics.__owner.get_scaleX());
					} else {
						openfl_display__$internal_Context3DGraphics.tempScale9VerticesVector.set(i3,openfl_display__$internal_Context3DGraphics.toScale9Position(vertices1.get(i3),scale9Grid.y,scale9Grid.height,bounds.height,graphics.__owner.get_scaleY()) / graphics.__owner.get_scaleY());
					}
					++i3;
					isX1 = !isX1;
				}
				vertices1 = openfl_display__$internal_Context3DGraphics.tempScale9VerticesVector;
			}
			if(bitmap != null && uvtData1 == null) {
				uvtData1 = openfl_display__$internal_Context3DGraphics.tempUvtVector;
				openfl_display__$internal_Context3DGraphics.populateUvtVector(vertices1,bitmap,uvtData1);
			}
			var hasIndices1 = indices1 != null;
			var numVertices1 = Math.floor(vertices1.get_length() / 2);
			var length3 = hasIndices1 ? indices1.get_length() : numVertices1;
			var hasUVData1 = uvtData1 != null;
			var hasUVTData1 = hasUVData1 && uvtData1.get_length() >= numVertices1 * 3;
			var vertLength1 = hasUVTData1 ? 4 : 2;
			var uvStride1 = hasUVTData1 ? 3 : 2;
			var dataPerVertex1 = vertLength1 + 2;
			var vertexOffset1 = hasUVTData1 ? vertexBufferPositionUVT : vertexBufferPosition;
			openfl_display__$internal_Context3DGraphics.resizeVertexBuffer(graphics,hasUVTData1,vertexOffset1 + length3 * dataPerVertex1);
			var vertexBufferData1 = hasUVTData1 ? graphics.__vertexBufferDataUVT : graphics.__vertexBufferData;
			var offset1;
			var vertOffset1;
			var uvOffset1;
			var t1;
			var _g6 = 0;
			var _g7 = length3;
			while(_g6 < _g7) {
				var i4 = _g6++;
				offset1 = vertexOffset1 + i4 * dataPerVertex1;
				vertOffset1 = hasIndices1 ? indices1.get(i4) * 2 : i4 * 2;
				uvOffset1 = hasIndices1 ? indices1.get(i4) * uvStride1 : i4 * uvStride1;
				if(hasUVTData1) {
					t1 = uvtData1.get(uvOffset1 + 2);
					vertexBufferData1[offset1] = vertices1.get(vertOffset1) / t1;
					vertexBufferData1[offset1 + 1] = vertices1.get(vertOffset1 + 1) / t1;
					vertexBufferData1[offset1 + 2] = 0;
					vertexBufferData1[offset1 + 3] = 1 / t1;
				} else {
					vertexBufferData1[offset1] = vertices1.get(vertOffset1);
					vertexBufferData1[offset1 + 1] = vertices1.get(vertOffset1 + 1);
				}
				vertexBufferData1[offset1 + vertLength1] = hasUVData1 ? uvtData1.get(uvOffset1) : 0;
				vertexBufferData1[offset1 + vertLength1 + 1] = hasUVData1 ? uvtData1.get(uvOffset1 + 1) : 0;
			}
			if(hasUVTData1) {
				vertexBufferPositionUVT += length3 * dataPerVertex1;
			} else {
				vertexBufferPosition += length3 * dataPerVertex1;
			}
			break;
		case 8:
			switch(data.prev._hx_index) {
			case 0:
				data.oPos += 2;
				data.bPos += 2;
				break;
			case 1:
				data.iPos += 1;
				data.fPos += 1;
				break;
			case 2:
				data.oPos += 4;
				data.iiPos += 2;
				data.ffPos += 1;
				data.fPos += 1;
				break;
			case 3:
				data.oPos += 1;
				break;
			case 4:
				data.fPos += 6;
				break;
			case 5:
				data.fPos += 4;
				break;
			case 6:
				data.fPos += 3;
				break;
			case 7:
				data.fPos += 4;
				break;
			case 8:
				data.oPos += 3;
				break;
			case 9:
				data.fPos += 4;
				break;
			case 10:
				data.fPos += 5;
				data.oPos += 1;
				break;
			case 12:
				data.oPos += 4;
				break;
			case 13:
				break;
			case 14:
				data.oPos += 2;
				data.bPos += 2;
				break;
			case 15:
				data.oPos += 4;
				data.iiPos += 2;
				data.ffPos += 1;
				data.fPos += 1;
				break;
			case 16:
				data.oPos += 4;
				data.iPos += 1;
				data.fPos += 2;
				data.bPos += 1;
				break;
			case 17:
				data.fPos += 2;
				break;
			case 18:
				data.fPos += 2;
				break;
			case 19:
				data.oPos += 1;
				break;
			case 20:
				data.oPos += 1;
				break;
			case 21:case 22:
				break;
			default:
			}
			data.prev = openfl_display__$internal_DrawCommandType.DRAW_QUADS;
			var c4 = data;
			var rects = c4.buffer.o[c4.oPos];
			var indices2 = c4.buffer.o[c4.oPos + 1];
			var transforms = c4.buffer.o[c4.oPos + 2];
			var hasIndices2 = indices2 != null;
			var transformABCD = false;
			var transformXY = false;
			var length4 = hasIndices2 ? indices2.get_length() : Math.floor(rects.get_length() / 4);
			if(length4 == 0) {
				return;
			}
			if(transforms != null) {
				if(transforms.get_length() >= length4 * 6) {
					transformABCD = true;
					transformXY = true;
				} else if(transforms.get_length() >= length4 * 4) {
					transformABCD = true;
				} else if(transforms.get_length() >= length4 * 2) {
					transformXY = true;
				}
			}
			var dataPerVertex2 = 4;
			var stride = dataPerVertex2 * 4;
			if(graphics.__quadBuffer == null) {
				graphics.__quadBuffer = new openfl_display__$internal_Context3DBuffer(context,openfl_display__$internal_Context3DElementType.QUADS,length4,dataPerVertex2);
			} else {
				graphics.__quadBuffer.resize(quadBufferPosition + length4,dataPerVertex2);
			}
			var vertexOffset2;
			var tileWidth;
			var tileHeight;
			var uvX;
			var uvY;
			var uvWidth;
			var uvHeight;
			var x2;
			var y2;
			var x21;
			var y21;
			var x3;
			var y3;
			var x4;
			var y4;
			var ri;
			var ti;
			var vertexBufferData2 = graphics.__quadBuffer.vertexBufferData;
			var bitmapWidth = 1;
			var bitmapHeight = 1;
			if(bitmap != null) {
				bitmapWidth = bitmap.width;
				bitmapHeight = bitmap.height;
			}
			var _g8 = 0;
			var _g9 = length4;
			while(_g8 < _g9) {
				var i5 = _g8++;
				vertexOffset2 = (quadBufferPosition + i5) * stride;
				ri = hasIndices2 ? indices2.get(i5) * 4 : i5 * 4;
				if(ri < 0) {
					continue;
				}
				tileRect.setTo(rects.get(ri),rects.get(ri + 1),rects.get(ri + 2),rects.get(ri + 3));
				tileWidth = tileRect.width;
				tileHeight = tileRect.height;
				if(tileWidth <= 0 || tileHeight <= 0) {
					continue;
				}
				if(transformABCD && transformXY) {
					ti = i5 * 6;
					tileTransform.setTo(transforms.get(ti),transforms.get(ti + 1),transforms.get(ti + 2),transforms.get(ti + 3),transforms.get(ti + 4),transforms.get(ti + 5));
				} else if(transformABCD) {
					ti = i5 * 4;
					tileTransform.setTo(transforms.get(ti),transforms.get(ti + 1),transforms.get(ti + 2),transforms.get(ti + 3),tileRect.x,tileRect.y);
				} else if(transformXY) {
					ti = i5 * 2;
					tileTransform.tx = transforms.get(ti);
					tileTransform.ty = transforms.get(ti + 1);
				} else {
					tileTransform.tx = tileRect.x;
					tileTransform.ty = tileRect.y;
				}
				uvX = tileRect.x / bitmapWidth;
				uvY = tileRect.y / bitmapHeight;
				uvWidth = tileRect.get_right() / bitmapWidth;
				uvHeight = tileRect.get_bottom() / bitmapHeight;
				x2 = 0 * tileTransform.a + 0 * tileTransform.c + tileTransform.tx;
				y2 = 0 * tileTransform.b + 0 * tileTransform.d + tileTransform.ty;
				x21 = tileWidth * tileTransform.a + 0 * tileTransform.c + tileTransform.tx;
				y21 = tileWidth * tileTransform.b + 0 * tileTransform.d + tileTransform.ty;
				x3 = 0 * tileTransform.a + tileHeight * tileTransform.c + tileTransform.tx;
				y3 = 0 * tileTransform.b + tileHeight * tileTransform.d + tileTransform.ty;
				x4 = tileWidth * tileTransform.a + tileHeight * tileTransform.c + tileTransform.tx;
				y4 = tileWidth * tileTransform.b + tileHeight * tileTransform.d + tileTransform.ty;
				vertexBufferData2[vertexOffset2] = x2;
				vertexBufferData2[vertexOffset2 + 1] = y2;
				vertexBufferData2[vertexOffset2 + 2] = uvX;
				vertexBufferData2[vertexOffset2 + 3] = uvY;
				vertexBufferData2[vertexOffset2 + dataPerVertex2] = x21;
				vertexBufferData2[vertexOffset2 + dataPerVertex2 + 1] = y21;
				vertexBufferData2[vertexOffset2 + dataPerVertex2 + 2] = uvWidth;
				vertexBufferData2[vertexOffset2 + dataPerVertex2 + 3] = uvY;
				vertexBufferData2[vertexOffset2 + dataPerVertex2 * 2] = x3;
				vertexBufferData2[vertexOffset2 + dataPerVertex2 * 2 + 1] = y3;
				vertexBufferData2[vertexOffset2 + dataPerVertex2 * 2 + 2] = uvX;
				vertexBufferData2[vertexOffset2 + dataPerVertex2 * 2 + 3] = uvHeight;
				vertexBufferData2[vertexOffset2 + dataPerVertex2 * 3] = x4;
				vertexBufferData2[vertexOffset2 + dataPerVertex2 * 3 + 1] = y4;
				vertexBufferData2[vertexOffset2 + dataPerVertex2 * 3 + 2] = uvWidth;
				vertexBufferData2[vertexOffset2 + dataPerVertex2 * 3 + 3] = uvHeight;
			}
			quadBufferPosition += length4;
			break;
		case 9:
			if(bitmap != null) {
				switch(data.prev._hx_index) {
				case 0:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 1:
					data.iPos += 1;
					data.fPos += 1;
					break;
				case 2:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 3:
					data.oPos += 1;
					break;
				case 4:
					data.fPos += 6;
					break;
				case 5:
					data.fPos += 4;
					break;
				case 6:
					data.fPos += 3;
					break;
				case 7:
					data.fPos += 4;
					break;
				case 8:
					data.oPos += 3;
					break;
				case 9:
					data.fPos += 4;
					break;
				case 10:
					data.fPos += 5;
					data.oPos += 1;
					break;
				case 12:
					data.oPos += 4;
					break;
				case 13:
					break;
				case 14:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 15:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 16:
					data.oPos += 4;
					data.iPos += 1;
					data.fPos += 2;
					data.bPos += 1;
					break;
				case 17:
					data.fPos += 2;
					break;
				case 18:
					data.fPos += 2;
					break;
				case 19:
					data.oPos += 1;
					break;
				case 20:
					data.oPos += 1;
					break;
				case 21:case 22:
					break;
				default:
				}
				data.prev = openfl_display__$internal_DrawCommandType.DRAW_RECT;
				var c5 = data;
				openfl_display__$internal_Context3DGraphics.tempVerticesVector.set_length(8);
				openfl_display__$internal_Context3DGraphics.tempVerticesVector.set(0,c5.buffer.f[c5.fPos]);
				openfl_display__$internal_Context3DGraphics.tempVerticesVector.set(1,c5.buffer.f[c5.fPos + 1]);
				openfl_display__$internal_Context3DGraphics.tempVerticesVector.set(2,c5.buffer.f[c5.fPos] + c5.buffer.f[c5.fPos + 2]);
				openfl_display__$internal_Context3DGraphics.tempVerticesVector.set(3,c5.buffer.f[c5.fPos + 1]);
				openfl_display__$internal_Context3DGraphics.tempVerticesVector.set(4,c5.buffer.f[c5.fPos]);
				openfl_display__$internal_Context3DGraphics.tempVerticesVector.set(5,c5.buffer.f[c5.fPos + 1] + c5.buffer.f[c5.fPos + 3]);
				openfl_display__$internal_Context3DGraphics.tempVerticesVector.set(6,c5.buffer.f[c5.fPos] + c5.buffer.f[c5.fPos + 2]);
				openfl_display__$internal_Context3DGraphics.tempVerticesVector.set(7,c5.buffer.f[c5.fPos + 1] + c5.buffer.f[c5.fPos + 3]);
				openfl_display__$internal_Context3DGraphics.tempIndicesVector.set_length(6);
				openfl_display__$internal_Context3DGraphics.tempIndicesVector.set(0,0);
				openfl_display__$internal_Context3DGraphics.tempIndicesVector.set(1,1);
				openfl_display__$internal_Context3DGraphics.tempIndicesVector.set(2,2);
				openfl_display__$internal_Context3DGraphics.tempIndicesVector.set(3,1);
				openfl_display__$internal_Context3DGraphics.tempIndicesVector.set(4,2);
				openfl_display__$internal_Context3DGraphics.tempIndicesVector.set(5,3);
				var vertices2 = openfl_display__$internal_Context3DGraphics.tempVerticesVector;
				var indices3 = openfl_display__$internal_Context3DGraphics.tempIndicesVector;
				var uvtData2 = null;
				if(hasScale9Grid) {
					if(openfl_display__$internal_Context3DGraphics.tempScale9VerticesVector == null) {
						openfl_display__$internal_Context3DGraphics.tempScale9VerticesVector = openfl_Vector.toFloatVector(null,vertices2.get_length());
					} else {
						openfl_display__$internal_Context3DGraphics.tempScale9VerticesVector.set_length(vertices2.get_length());
					}
					var i6 = 0;
					var length5 = vertices2.get_length();
					var isX2 = true;
					while(i6 < length5) {
						if(isX2) {
							openfl_display__$internal_Context3DGraphics.tempScale9VerticesVector.set(i6,openfl_display__$internal_Context3DGraphics.toScale9Position(vertices2.get(i6),scale9Grid.x,scale9Grid.width,bounds.width,graphics.__owner.get_scaleX()) / graphics.__owner.get_scaleX());
						} else {
							openfl_display__$internal_Context3DGraphics.tempScale9VerticesVector.set(i6,openfl_display__$internal_Context3DGraphics.toScale9Position(vertices2.get(i6),scale9Grid.y,scale9Grid.height,bounds.height,graphics.__owner.get_scaleY()) / graphics.__owner.get_scaleY());
						}
						++i6;
						isX2 = !isX2;
					}
					vertices2 = openfl_display__$internal_Context3DGraphics.tempScale9VerticesVector;
				}
				if(bitmap != null && uvtData2 == null) {
					uvtData2 = openfl_display__$internal_Context3DGraphics.tempUvtVector;
					openfl_display__$internal_Context3DGraphics.populateUvtVector(vertices2,bitmap,uvtData2);
				}
				var hasIndices3 = indices3 != null;
				var numVertices2 = Math.floor(vertices2.get_length() / 2);
				var length6 = hasIndices3 ? indices3.get_length() : numVertices2;
				var hasUVData2 = uvtData2 != null;
				var hasUVTData2 = hasUVData2 && uvtData2.get_length() >= numVertices2 * 3;
				var vertLength2 = hasUVTData2 ? 4 : 2;
				var uvStride2 = hasUVTData2 ? 3 : 2;
				var dataPerVertex3 = vertLength2 + 2;
				var vertexOffset3 = hasUVTData2 ? vertexBufferPositionUVT : vertexBufferPosition;
				openfl_display__$internal_Context3DGraphics.resizeVertexBuffer(graphics,hasUVTData2,vertexOffset3 + length6 * dataPerVertex3);
				var vertexBufferData3 = hasUVTData2 ? graphics.__vertexBufferDataUVT : graphics.__vertexBufferData;
				var offset2;
				var vertOffset2;
				var uvOffset2;
				var t2;
				var _g10 = 0;
				var _g11 = length6;
				while(_g10 < _g11) {
					var i7 = _g10++;
					offset2 = vertexOffset3 + i7 * dataPerVertex3;
					vertOffset2 = hasIndices3 ? indices3.get(i7) * 2 : i7 * 2;
					uvOffset2 = hasIndices3 ? indices3.get(i7) * uvStride2 : i7 * uvStride2;
					if(hasUVTData2) {
						t2 = uvtData2.get(uvOffset2 + 2);
						vertexBufferData3[offset2] = vertices2.get(vertOffset2) / t2;
						vertexBufferData3[offset2 + 1] = vertices2.get(vertOffset2 + 1) / t2;
						vertexBufferData3[offset2 + 2] = 0;
						vertexBufferData3[offset2 + 3] = 1 / t2;
					} else {
						vertexBufferData3[offset2] = vertices2.get(vertOffset2);
						vertexBufferData3[offset2 + 1] = vertices2.get(vertOffset2 + 1);
					}
					vertexBufferData3[offset2 + vertLength2] = hasUVData2 ? uvtData2.get(uvOffset2) : 0;
					vertexBufferData3[offset2 + vertLength2 + 1] = hasUVData2 ? uvtData2.get(uvOffset2 + 1) : 0;
				}
				if(hasUVTData2) {
					vertexBufferPositionUVT += length6 * dataPerVertex3;
				} else {
					vertexBufferPosition += length6 * dataPerVertex3;
				}
			}
			break;
		case 10:
			switch(data.prev._hx_index) {
			case 0:
				data.oPos += 2;
				data.bPos += 2;
				break;
			case 1:
				data.iPos += 1;
				data.fPos += 1;
				break;
			case 2:
				data.oPos += 4;
				data.iiPos += 2;
				data.ffPos += 1;
				data.fPos += 1;
				break;
			case 3:
				data.oPos += 1;
				break;
			case 4:
				data.fPos += 6;
				break;
			case 5:
				data.fPos += 4;
				break;
			case 6:
				data.fPos += 3;
				break;
			case 7:
				data.fPos += 4;
				break;
			case 8:
				data.oPos += 3;
				break;
			case 9:
				data.fPos += 4;
				break;
			case 10:
				data.fPos += 5;
				data.oPos += 1;
				break;
			case 12:
				data.oPos += 4;
				break;
			case 13:
				break;
			case 14:
				data.oPos += 2;
				data.bPos += 2;
				break;
			case 15:
				data.oPos += 4;
				data.iiPos += 2;
				data.ffPos += 1;
				data.fPos += 1;
				break;
			case 16:
				data.oPos += 4;
				data.iPos += 1;
				data.fPos += 2;
				data.bPos += 1;
				break;
			case 17:
				data.fPos += 2;
				break;
			case 18:
				data.fPos += 2;
				break;
			case 19:
				data.oPos += 1;
				break;
			case 20:
				data.oPos += 1;
				break;
			case 21:case 22:
				break;
			default:
			}
			data.prev = openfl_display__$internal_DrawCommandType.DRAW_ROUND_RECT;
			var c6 = data;
			var x5 = c6.buffer.f[c6.fPos];
			var y5 = c6.buffer.f[c6.fPos + 1];
			var width = c6.buffer.f[c6.fPos + 2];
			var height = c6.buffer.f[c6.fPos + 3];
			var radiusX1 = c6.buffer.f[c6.fPos + 4] / 2.0;
			var radiusY1 = (c6.buffer.o[c6.oPos] != null ? c6.buffer.o[c6.oPos] : c6.buffer.f[c6.fPos + 4]) / 2.0;
			var scaleX2 = hasScale9Grid && c6.buffer.f[c6.fPos] + radiusX1 <= scale9Grid.x && c6.buffer.f[c6.fPos] + c6.buffer.f[c6.fPos + 2] - radiusX1 >= scale9Grid.x + scale9Grid.width ? 1.0 : graphics.__owner.get_scaleX();
			var scaleY2 = hasScale9Grid && c6.buffer.f[c6.fPos + 1] + radiusY1 <= scale9Grid.y && c6.buffer.f[c6.fPos + 1] + c6.buffer.f[c6.fPos + 3] - radiusX1 >= scale9Grid.y + scale9Grid.height ? 1.0 : graphics.__owner.get_scaleY();
			openfl_display__$internal__$Context3DGraphics_PolygonFunctions.buildRoundRectVerticesAndIndices(x5,y5,width,height,radiusX1,radiusY1,scaleX2,scaleY2,openfl_display__$internal_Context3DGraphics.tempVerticesVector,openfl_display__$internal_Context3DGraphics.tempIndicesVector);
			var vertices3 = openfl_display__$internal_Context3DGraphics.tempVerticesVector;
			var indices4 = openfl_display__$internal_Context3DGraphics.tempIndicesVector;
			var uvtData3 = null;
			if(hasScale9Grid) {
				if(openfl_display__$internal_Context3DGraphics.tempScale9VerticesVector == null) {
					openfl_display__$internal_Context3DGraphics.tempScale9VerticesVector = openfl_Vector.toFloatVector(null,vertices3.get_length());
				} else {
					openfl_display__$internal_Context3DGraphics.tempScale9VerticesVector.set_length(vertices3.get_length());
				}
				var i8 = 0;
				var length7 = vertices3.get_length();
				var isX3 = true;
				while(i8 < length7) {
					if(isX3) {
						openfl_display__$internal_Context3DGraphics.tempScale9VerticesVector.set(i8,openfl_display__$internal_Context3DGraphics.toScale9Position(vertices3.get(i8),scale9Grid.x,scale9Grid.width,bounds.width,graphics.__owner.get_scaleX()) / graphics.__owner.get_scaleX());
					} else {
						openfl_display__$internal_Context3DGraphics.tempScale9VerticesVector.set(i8,openfl_display__$internal_Context3DGraphics.toScale9Position(vertices3.get(i8),scale9Grid.y,scale9Grid.height,bounds.height,graphics.__owner.get_scaleY()) / graphics.__owner.get_scaleY());
					}
					++i8;
					isX3 = !isX3;
				}
				vertices3 = openfl_display__$internal_Context3DGraphics.tempScale9VerticesVector;
			}
			if(bitmap != null && uvtData3 == null) {
				uvtData3 = openfl_display__$internal_Context3DGraphics.tempUvtVector;
				openfl_display__$internal_Context3DGraphics.populateUvtVector(vertices3,bitmap,uvtData3);
			}
			var hasIndices4 = indices4 != null;
			var numVertices3 = Math.floor(vertices3.get_length() / 2);
			var length8 = hasIndices4 ? indices4.get_length() : numVertices3;
			var hasUVData3 = uvtData3 != null;
			var hasUVTData3 = hasUVData3 && uvtData3.get_length() >= numVertices3 * 3;
			var vertLength3 = hasUVTData3 ? 4 : 2;
			var uvStride3 = hasUVTData3 ? 3 : 2;
			var dataPerVertex4 = vertLength3 + 2;
			var vertexOffset4 = hasUVTData3 ? vertexBufferPositionUVT : vertexBufferPosition;
			openfl_display__$internal_Context3DGraphics.resizeVertexBuffer(graphics,hasUVTData3,vertexOffset4 + length8 * dataPerVertex4);
			var vertexBufferData4 = hasUVTData3 ? graphics.__vertexBufferDataUVT : graphics.__vertexBufferData;
			var offset3;
			var vertOffset3;
			var uvOffset3;
			var t3;
			var _g12 = 0;
			var _g13 = length8;
			while(_g12 < _g13) {
				var i9 = _g12++;
				offset3 = vertexOffset4 + i9 * dataPerVertex4;
				vertOffset3 = hasIndices4 ? indices4.get(i9) * 2 : i9 * 2;
				uvOffset3 = hasIndices4 ? indices4.get(i9) * uvStride3 : i9 * uvStride3;
				if(hasUVTData3) {
					t3 = uvtData3.get(uvOffset3 + 2);
					vertexBufferData4[offset3] = vertices3.get(vertOffset3) / t3;
					vertexBufferData4[offset3 + 1] = vertices3.get(vertOffset3 + 1) / t3;
					vertexBufferData4[offset3 + 2] = 0;
					vertexBufferData4[offset3 + 3] = 1 / t3;
				} else {
					vertexBufferData4[offset3] = vertices3.get(vertOffset3);
					vertexBufferData4[offset3 + 1] = vertices3.get(vertOffset3 + 1);
				}
				vertexBufferData4[offset3 + vertLength3] = hasUVData3 ? uvtData3.get(uvOffset3) : 0;
				vertexBufferData4[offset3 + vertLength3 + 1] = hasUVData3 ? uvtData3.get(uvOffset3 + 1) : 0;
			}
			if(hasUVTData3) {
				vertexBufferPositionUVT += length8 * dataPerVertex4;
			} else {
				vertexBufferPosition += length8 * dataPerVertex4;
			}
			break;
		case 12:
			switch(data.prev._hx_index) {
			case 0:
				data.oPos += 2;
				data.bPos += 2;
				break;
			case 1:
				data.iPos += 1;
				data.fPos += 1;
				break;
			case 2:
				data.oPos += 4;
				data.iiPos += 2;
				data.ffPos += 1;
				data.fPos += 1;
				break;
			case 3:
				data.oPos += 1;
				break;
			case 4:
				data.fPos += 6;
				break;
			case 5:
				data.fPos += 4;
				break;
			case 6:
				data.fPos += 3;
				break;
			case 7:
				data.fPos += 4;
				break;
			case 8:
				data.oPos += 3;
				break;
			case 9:
				data.fPos += 4;
				break;
			case 10:
				data.fPos += 5;
				data.oPos += 1;
				break;
			case 12:
				data.oPos += 4;
				break;
			case 13:
				break;
			case 14:
				data.oPos += 2;
				data.bPos += 2;
				break;
			case 15:
				data.oPos += 4;
				data.iiPos += 2;
				data.ffPos += 1;
				data.fPos += 1;
				break;
			case 16:
				data.oPos += 4;
				data.iPos += 1;
				data.fPos += 2;
				data.bPos += 1;
				break;
			case 17:
				data.fPos += 2;
				break;
			case 18:
				data.fPos += 2;
				break;
			case 19:
				data.oPos += 1;
				break;
			case 20:
				data.oPos += 1;
				break;
			case 21:case 22:
				break;
			default:
			}
			data.prev = openfl_display__$internal_DrawCommandType.DRAW_TRIANGLES;
			var c7 = data;
			var vertices4 = c7.buffer.o[c7.oPos];
			var indices5 = c7.buffer.o[c7.oPos + 1];
			var uvtData4 = c7.buffer.o[c7.oPos + 2];
			var culling = c7.buffer.o[c7.oPos + 3];
			var vertices5 = vertices4;
			var uvtData5 = uvtData4;
			if(hasScale9Grid) {
				if(openfl_display__$internal_Context3DGraphics.tempScale9VerticesVector == null) {
					openfl_display__$internal_Context3DGraphics.tempScale9VerticesVector = openfl_Vector.toFloatVector(null,vertices5.get_length());
				} else {
					openfl_display__$internal_Context3DGraphics.tempScale9VerticesVector.set_length(vertices5.get_length());
				}
				var i10 = 0;
				var length9 = vertices5.get_length();
				var isX4 = true;
				while(i10 < length9) {
					if(isX4) {
						openfl_display__$internal_Context3DGraphics.tempScale9VerticesVector.set(i10,openfl_display__$internal_Context3DGraphics.toScale9Position(vertices5.get(i10),scale9Grid.x,scale9Grid.width,bounds.width,graphics.__owner.get_scaleX()) / graphics.__owner.get_scaleX());
					} else {
						openfl_display__$internal_Context3DGraphics.tempScale9VerticesVector.set(i10,openfl_display__$internal_Context3DGraphics.toScale9Position(vertices5.get(i10),scale9Grid.y,scale9Grid.height,bounds.height,graphics.__owner.get_scaleY()) / graphics.__owner.get_scaleY());
					}
					++i10;
					isX4 = !isX4;
				}
				vertices5 = openfl_display__$internal_Context3DGraphics.tempScale9VerticesVector;
			}
			if(bitmap != null && uvtData5 == null) {
				uvtData5 = openfl_display__$internal_Context3DGraphics.tempUvtVector;
				openfl_display__$internal_Context3DGraphics.populateUvtVector(vertices5,bitmap,uvtData5);
			}
			var hasIndices5 = indices5 != null;
			var numVertices4 = Math.floor(vertices5.get_length() / 2);
			var length10 = hasIndices5 ? indices5.get_length() : numVertices4;
			var hasUVData4 = uvtData5 != null;
			var hasUVTData4 = hasUVData4 && uvtData5.get_length() >= numVertices4 * 3;
			var vertLength4 = hasUVTData4 ? 4 : 2;
			var uvStride4 = hasUVTData4 ? 3 : 2;
			var dataPerVertex5 = vertLength4 + 2;
			var vertexOffset5 = hasUVTData4 ? vertexBufferPositionUVT : vertexBufferPosition;
			openfl_display__$internal_Context3DGraphics.resizeVertexBuffer(graphics,hasUVTData4,vertexOffset5 + length10 * dataPerVertex5);
			var vertexBufferData5 = hasUVTData4 ? graphics.__vertexBufferDataUVT : graphics.__vertexBufferData;
			var offset4;
			var vertOffset4;
			var uvOffset4;
			var t4;
			var _g14 = 0;
			var _g15 = length10;
			while(_g14 < _g15) {
				var i11 = _g14++;
				offset4 = vertexOffset5 + i11 * dataPerVertex5;
				vertOffset4 = hasIndices5 ? indices5.get(i11) * 2 : i11 * 2;
				uvOffset4 = hasIndices5 ? indices5.get(i11) * uvStride4 : i11 * uvStride4;
				if(hasUVTData4) {
					t4 = uvtData5.get(uvOffset4 + 2);
					vertexBufferData5[offset4] = vertices5.get(vertOffset4) / t4;
					vertexBufferData5[offset4 + 1] = vertices5.get(vertOffset4 + 1) / t4;
					vertexBufferData5[offset4 + 2] = 0;
					vertexBufferData5[offset4 + 3] = 1 / t4;
				} else {
					vertexBufferData5[offset4] = vertices5.get(vertOffset4);
					vertexBufferData5[offset4 + 1] = vertices5.get(vertOffset4 + 1);
				}
				vertexBufferData5[offset4 + vertLength4] = hasUVData4 ? uvtData5.get(uvOffset4) : 0;
				vertexBufferData5[offset4 + vertLength4 + 1] = hasUVData4 ? uvtData5.get(uvOffset4 + 1) : 0;
			}
			if(hasUVTData4) {
				vertexBufferPositionUVT += length10 * dataPerVertex5;
			} else {
				vertexBufferPosition += length10 * dataPerVertex5;
			}
			break;
		case 13:
			bitmap = null;
			bitmapMatrix = null;
			break;
		default:
			switch(data.prev._hx_index) {
			case 0:
				data.oPos += 2;
				data.bPos += 2;
				break;
			case 1:
				data.iPos += 1;
				data.fPos += 1;
				break;
			case 2:
				data.oPos += 4;
				data.iiPos += 2;
				data.ffPos += 1;
				data.fPos += 1;
				break;
			case 3:
				data.oPos += 1;
				break;
			case 4:
				data.fPos += 6;
				break;
			case 5:
				data.fPos += 4;
				break;
			case 6:
				data.fPos += 3;
				break;
			case 7:
				data.fPos += 4;
				break;
			case 8:
				data.oPos += 3;
				break;
			case 9:
				data.fPos += 4;
				break;
			case 10:
				data.fPos += 5;
				data.oPos += 1;
				break;
			case 12:
				data.oPos += 4;
				break;
			case 13:
				break;
			case 14:
				data.oPos += 2;
				data.bPos += 2;
				break;
			case 15:
				data.oPos += 4;
				data.iiPos += 2;
				data.ffPos += 1;
				data.fPos += 1;
				break;
			case 16:
				data.oPos += 4;
				data.iPos += 1;
				data.fPos += 2;
				data.bPos += 1;
				break;
			case 17:
				data.fPos += 2;
				break;
			case 18:
				data.fPos += 2;
				break;
			case 19:
				data.oPos += 1;
				break;
			case 20:
				data.oPos += 1;
				break;
			case 21:case 22:
				break;
			default:
			}
			data.prev = type;
		}
	}
	if(quadBufferPosition > 0) {
		graphics.__quadBuffer.flushVertexBufferData();
	}
	if(triangleIndexBufferPosition > 0) {
		var buffer = graphics.__triangleIndexBuffer;
		if(buffer == null || triangleIndexBufferPosition > graphics.__triangleIndexBufferCount) {
			buffer = context.createIndexBuffer(triangleIndexBufferPosition,0);
			graphics.__triangleIndexBuffer = buffer;
			graphics.__triangleIndexBufferCount = triangleIndexBufferPosition;
		}
		buffer.uploadFromTypedArray(graphics.__triangleIndexBufferData);
	}
	if(vertexBufferPosition > 0) {
		var buffer = graphics.__vertexBuffer;
		if(buffer == null || vertexBufferPosition > graphics.__vertexBufferCount) {
			buffer = context.createVertexBuffer(vertexBufferPosition,4,0);
			graphics.__vertexBuffer = buffer;
			graphics.__vertexBufferCount = vertexBufferPosition;
		}
		buffer.uploadFromTypedArray(lime_utils_Float32Array.toArrayBufferView(graphics.__vertexBufferData));
	}
	if(vertexBufferPositionUVT > 0) {
		var buffer = graphics.__vertexBufferUVT;
		if(buffer == null || vertexBufferPositionUVT > graphics.__vertexBufferCountUVT) {
			buffer = context.createVertexBuffer(vertexBufferPositionUVT,6,0);
			graphics.__vertexBufferUVT = buffer;
			graphics.__vertexBufferCountUVT = vertexBufferPositionUVT;
		}
		buffer.uploadFromTypedArray(lime_utils_Float32Array.toArrayBufferView(graphics.__vertexBufferDataUVT));
	}
	openfl_geom_Rectangle.__pool.release(tileRect);
	openfl_geom_Matrix.__pool.release(tileTransform);
};
openfl_display__$internal_Context3DGraphics.isCompatible = function(graphics) {
	if(graphics.__owner.__worldScale9Grid != null) {
		return false;
	}
	var data = new openfl_display__$internal_DrawCommandReader(graphics.__commands);
	var hasColorFill = false;
	var hasBitmapFill = false;
	var hasShaderFill = false;
	var _g = 0;
	var _g1 = graphics.__commands.types;
	while(_g < _g1.length) {
		var type = _g1[_g];
		++_g;
		switch(type._hx_index) {
		case 0:
			switch(data.prev._hx_index) {
			case 0:
				data.oPos += 2;
				data.bPos += 2;
				break;
			case 1:
				data.iPos += 1;
				data.fPos += 1;
				break;
			case 2:
				data.oPos += 4;
				data.iiPos += 2;
				data.ffPos += 1;
				data.fPos += 1;
				break;
			case 3:
				data.oPos += 1;
				break;
			case 4:
				data.fPos += 6;
				break;
			case 5:
				data.fPos += 4;
				break;
			case 6:
				data.fPos += 3;
				break;
			case 7:
				data.fPos += 4;
				break;
			case 8:
				data.oPos += 3;
				break;
			case 9:
				data.fPos += 4;
				break;
			case 10:
				data.fPos += 5;
				data.oPos += 1;
				break;
			case 12:
				data.oPos += 4;
				break;
			case 13:
				break;
			case 14:
				data.oPos += 2;
				data.bPos += 2;
				break;
			case 15:
				data.oPos += 4;
				data.iiPos += 2;
				data.ffPos += 1;
				data.fPos += 1;
				break;
			case 16:
				data.oPos += 4;
				data.iPos += 1;
				data.fPos += 2;
				data.bPos += 1;
				break;
			case 17:
				data.fPos += 2;
				break;
			case 18:
				data.fPos += 2;
				break;
			case 19:
				data.oPos += 1;
				break;
			case 20:
				data.oPos += 1;
				break;
			case 21:case 22:
				break;
			default:
			}
			data.prev = openfl_display__$internal_DrawCommandType.BEGIN_BITMAP_FILL;
			var c = data;
			if(c.buffer.o[c.oPos + 1] != null) {
				data.destroy();
				return false;
			}
			hasBitmapFill = true;
			hasColorFill = false;
			hasShaderFill = false;
			switch(data.prev._hx_index) {
			case 0:
				data.oPos += 2;
				data.bPos += 2;
				break;
			case 1:
				data.iPos += 1;
				data.fPos += 1;
				break;
			case 2:
				data.oPos += 4;
				data.iiPos += 2;
				data.ffPos += 1;
				data.fPos += 1;
				break;
			case 3:
				data.oPos += 1;
				break;
			case 4:
				data.fPos += 6;
				break;
			case 5:
				data.fPos += 4;
				break;
			case 6:
				data.fPos += 3;
				break;
			case 7:
				data.fPos += 4;
				break;
			case 8:
				data.oPos += 3;
				break;
			case 9:
				data.fPos += 4;
				break;
			case 10:
				data.fPos += 5;
				data.oPos += 1;
				break;
			case 12:
				data.oPos += 4;
				break;
			case 13:
				break;
			case 14:
				data.oPos += 2;
				data.bPos += 2;
				break;
			case 15:
				data.oPos += 4;
				data.iiPos += 2;
				data.ffPos += 1;
				data.fPos += 1;
				break;
			case 16:
				data.oPos += 4;
				data.iPos += 1;
				data.fPos += 2;
				data.bPos += 1;
				break;
			case 17:
				data.fPos += 2;
				break;
			case 18:
				data.fPos += 2;
				break;
			case 19:
				data.oPos += 1;
				break;
			case 20:
				data.oPos += 1;
				break;
			case 21:case 22:
				break;
			default:
			}
			data.prev = type;
			break;
		case 1:
			hasBitmapFill = false;
			hasColorFill = true;
			hasShaderFill = false;
			switch(data.prev._hx_index) {
			case 0:
				data.oPos += 2;
				data.bPos += 2;
				break;
			case 1:
				data.iPos += 1;
				data.fPos += 1;
				break;
			case 2:
				data.oPos += 4;
				data.iiPos += 2;
				data.ffPos += 1;
				data.fPos += 1;
				break;
			case 3:
				data.oPos += 1;
				break;
			case 4:
				data.fPos += 6;
				break;
			case 5:
				data.fPos += 4;
				break;
			case 6:
				data.fPos += 3;
				break;
			case 7:
				data.fPos += 4;
				break;
			case 8:
				data.oPos += 3;
				break;
			case 9:
				data.fPos += 4;
				break;
			case 10:
				data.fPos += 5;
				data.oPos += 1;
				break;
			case 12:
				data.oPos += 4;
				break;
			case 13:
				break;
			case 14:
				data.oPos += 2;
				data.bPos += 2;
				break;
			case 15:
				data.oPos += 4;
				data.iiPos += 2;
				data.ffPos += 1;
				data.fPos += 1;
				break;
			case 16:
				data.oPos += 4;
				data.iPos += 1;
				data.fPos += 2;
				data.bPos += 1;
				break;
			case 17:
				data.fPos += 2;
				break;
			case 18:
				data.fPos += 2;
				break;
			case 19:
				data.oPos += 1;
				break;
			case 20:
				data.oPos += 1;
				break;
			case 21:case 22:
				break;
			default:
			}
			data.prev = type;
			break;
		case 3:
			hasBitmapFill = false;
			hasColorFill = false;
			hasShaderFill = true;
			switch(data.prev._hx_index) {
			case 0:
				data.oPos += 2;
				data.bPos += 2;
				break;
			case 1:
				data.iPos += 1;
				data.fPos += 1;
				break;
			case 2:
				data.oPos += 4;
				data.iiPos += 2;
				data.ffPos += 1;
				data.fPos += 1;
				break;
			case 3:
				data.oPos += 1;
				break;
			case 4:
				data.fPos += 6;
				break;
			case 5:
				data.fPos += 4;
				break;
			case 6:
				data.fPos += 3;
				break;
			case 7:
				data.fPos += 4;
				break;
			case 8:
				data.oPos += 3;
				break;
			case 9:
				data.fPos += 4;
				break;
			case 10:
				data.fPos += 5;
				data.oPos += 1;
				break;
			case 12:
				data.oPos += 4;
				break;
			case 13:
				break;
			case 14:
				data.oPos += 2;
				data.bPos += 2;
				break;
			case 15:
				data.oPos += 4;
				data.iiPos += 2;
				data.ffPos += 1;
				data.fPos += 1;
				break;
			case 16:
				data.oPos += 4;
				data.iPos += 1;
				data.fPos += 2;
				data.bPos += 1;
				break;
			case 17:
				data.fPos += 2;
				break;
			case 18:
				data.fPos += 2;
				break;
			case 19:
				data.oPos += 1;
				break;
			case 20:
				data.oPos += 1;
				break;
			case 21:case 22:
				break;
			default:
			}
			data.prev = type;
			break;
		case 8:
			if(hasColorFill || hasBitmapFill || hasShaderFill) {
				switch(data.prev._hx_index) {
				case 0:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 1:
					data.iPos += 1;
					data.fPos += 1;
					break;
				case 2:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 3:
					data.oPos += 1;
					break;
				case 4:
					data.fPos += 6;
					break;
				case 5:
					data.fPos += 4;
					break;
				case 6:
					data.fPos += 3;
					break;
				case 7:
					data.fPos += 4;
					break;
				case 8:
					data.oPos += 3;
					break;
				case 9:
					data.fPos += 4;
					break;
				case 10:
					data.fPos += 5;
					data.oPos += 1;
					break;
				case 12:
					data.oPos += 4;
					break;
				case 13:
					break;
				case 14:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 15:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 16:
					data.oPos += 4;
					data.iPos += 1;
					data.fPos += 2;
					data.bPos += 1;
					break;
				case 17:
					data.fPos += 2;
					break;
				case 18:
					data.fPos += 2;
					break;
				case 19:
					data.oPos += 1;
					break;
				case 20:
					data.oPos += 1;
					break;
				case 21:case 22:
					break;
				default:
				}
				data.prev = type;
			} else {
				data.destroy();
				return false;
			}
			break;
		case 9:
			if(hasColorFill || hasBitmapFill || hasShaderFill) {
				switch(data.prev._hx_index) {
				case 0:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 1:
					data.iPos += 1;
					data.fPos += 1;
					break;
				case 2:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 3:
					data.oPos += 1;
					break;
				case 4:
					data.fPos += 6;
					break;
				case 5:
					data.fPos += 4;
					break;
				case 6:
					data.fPos += 3;
					break;
				case 7:
					data.fPos += 4;
					break;
				case 8:
					data.oPos += 3;
					break;
				case 9:
					data.fPos += 4;
					break;
				case 10:
					data.fPos += 5;
					data.oPos += 1;
					break;
				case 12:
					data.oPos += 4;
					break;
				case 13:
					break;
				case 14:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 15:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 16:
					data.oPos += 4;
					data.iPos += 1;
					data.fPos += 2;
					data.bPos += 1;
					break;
				case 17:
					data.fPos += 2;
					break;
				case 18:
					data.fPos += 2;
					break;
				case 19:
					data.oPos += 1;
					break;
				case 20:
					data.oPos += 1;
					break;
				case 21:case 22:
					break;
				default:
				}
				data.prev = type;
			} else {
				data.destroy();
				return false;
			}
			break;
		case 12:
			if(hasColorFill || hasBitmapFill || hasShaderFill) {
				switch(data.prev._hx_index) {
				case 0:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 1:
					data.iPos += 1;
					data.fPos += 1;
					break;
				case 2:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 3:
					data.oPos += 1;
					break;
				case 4:
					data.fPos += 6;
					break;
				case 5:
					data.fPos += 4;
					break;
				case 6:
					data.fPos += 3;
					break;
				case 7:
					data.fPos += 4;
					break;
				case 8:
					data.oPos += 3;
					break;
				case 9:
					data.fPos += 4;
					break;
				case 10:
					data.fPos += 5;
					data.oPos += 1;
					break;
				case 12:
					data.oPos += 4;
					break;
				case 13:
					break;
				case 14:
					data.oPos += 2;
					data.bPos += 2;
					break;
				case 15:
					data.oPos += 4;
					data.iiPos += 2;
					data.ffPos += 1;
					data.fPos += 1;
					break;
				case 16:
					data.oPos += 4;
					data.iPos += 1;
					data.fPos += 2;
					data.bPos += 1;
					break;
				case 17:
					data.fPos += 2;
					break;
				case 18:
					data.fPos += 2;
					break;
				case 19:
					data.oPos += 1;
					break;
				case 20:
					data.oPos += 1;
					break;
				case 21:case 22:
					break;
				default:
				}
				data.prev = type;
			} else {
				data.destroy();
				return false;
			}
			break;
		case 13:
			hasBitmapFill = false;
			hasColorFill = false;
			hasShaderFill = false;
			switch(data.prev._hx_index) {
			case 0:
				data.oPos += 2;
				data.bPos += 2;
				break;
			case 1:
				data.iPos += 1;
				data.fPos += 1;
				break;
			case 2:
				data.oPos += 4;
				data.iiPos += 2;
				data.ffPos += 1;
				data.fPos += 1;
				break;
			case 3:
				data.oPos += 1;
				break;
			case 4:
				data.fPos += 6;
				break;
			case 5:
				data.fPos += 4;
				break;
			case 6:
				data.fPos += 3;
				break;
			case 7:
				data.fPos += 4;
				break;
			case 8:
				data.oPos += 3;
				break;
			case 9:
				data.fPos += 4;
				break;
			case 10:
				data.fPos += 5;
				data.oPos += 1;
				break;
			case 12:
				data.oPos += 4;
				break;
			case 13:
				break;
			case 14:
				data.oPos += 2;
				data.bPos += 2;
				break;
			case 15:
				data.oPos += 4;
				data.iiPos += 2;
				data.ffPos += 1;
				data.fPos += 1;
				break;
			case 16:
				data.oPos += 4;
				data.iPos += 1;
				data.fPos += 2;
				data.bPos += 1;
				break;
			case 17:
				data.fPos += 2;
				break;
			case 18:
				data.fPos += 2;
				break;
			case 19:
				data.oPos += 1;
				break;
			case 20:
				data.oPos += 1;
				break;
			case 21:case 22:
				break;
			default:
			}
			data.prev = type;
			break;
		case 18:
			switch(data.prev._hx_index) {
			case 0:
				data.oPos += 2;
				data.bPos += 2;
				break;
			case 1:
				data.iPos += 1;
				data.fPos += 1;
				break;
			case 2:
				data.oPos += 4;
				data.iiPos += 2;
				data.ffPos += 1;
				data.fPos += 1;
				break;
			case 3:
				data.oPos += 1;
				break;
			case 4:
				data.fPos += 6;
				break;
			case 5:
				data.fPos += 4;
				break;
			case 6:
				data.fPos += 3;
				break;
			case 7:
				data.fPos += 4;
				break;
			case 8:
				data.oPos += 3;
				break;
			case 9:
				data.fPos += 4;
				break;
			case 10:
				data.fPos += 5;
				data.oPos += 1;
				break;
			case 12:
				data.oPos += 4;
				break;
			case 13:
				break;
			case 14:
				data.oPos += 2;
				data.bPos += 2;
				break;
			case 15:
				data.oPos += 4;
				data.iiPos += 2;
				data.ffPos += 1;
				data.fPos += 1;
				break;
			case 16:
				data.oPos += 4;
				data.iPos += 1;
				data.fPos += 2;
				data.bPos += 1;
				break;
			case 17:
				data.fPos += 2;
				break;
			case 18:
				data.fPos += 2;
				break;
			case 19:
				data.oPos += 1;
				break;
			case 20:
				data.oPos += 1;
				break;
			case 21:case 22:
				break;
			default:
			}
			data.prev = type;
			break;
		case 19:
			switch(data.prev._hx_index) {
			case 0:
				data.oPos += 2;
				data.bPos += 2;
				break;
			case 1:
				data.iPos += 1;
				data.fPos += 1;
				break;
			case 2:
				data.oPos += 4;
				data.iiPos += 2;
				data.ffPos += 1;
				data.fPos += 1;
				break;
			case 3:
				data.oPos += 1;
				break;
			case 4:
				data.fPos += 6;
				break;
			case 5:
				data.fPos += 4;
				break;
			case 6:
				data.fPos += 3;
				break;
			case 7:
				data.fPos += 4;
				break;
			case 8:
				data.oPos += 3;
				break;
			case 9:
				data.fPos += 4;
				break;
			case 10:
				data.fPos += 5;
				data.oPos += 1;
				break;
			case 12:
				data.oPos += 4;
				break;
			case 13:
				break;
			case 14:
				data.oPos += 2;
				data.bPos += 2;
				break;
			case 15:
				data.oPos += 4;
				data.iiPos += 2;
				data.ffPos += 1;
				data.fPos += 1;
				break;
			case 16:
				data.oPos += 4;
				data.iPos += 1;
				data.fPos += 2;
				data.bPos += 1;
				break;
			case 17:
				data.fPos += 2;
				break;
			case 18:
				data.fPos += 2;
				break;
			case 19:
				data.oPos += 1;
				break;
			case 20:
				data.oPos += 1;
				break;
			case 21:case 22:
				break;
			default:
			}
			data.prev = type;
			break;
		default:
			data.destroy();
			return false;
		}
	}
	data.destroy();
	return true;
};
openfl_display__$internal_Context3DGraphics.render = function(graphics,renderer) {
	if(!graphics.__visible || graphics.__commands.get_length() == 0) {
		return;
	}
	if(graphics.__bitmap != null && !graphics.__dirty || !openfl_display__$internal_Context3DGraphics.isCompatible(graphics)) {
		renderer.__softwareRenderer.__pixelRatio = renderer.__pixelRatio;
		var cacheTransform = renderer.__softwareRenderer.__worldTransform;
		if(graphics.__owner.__drawableType == 7) {
			renderer.__softwareRenderer.__worldTransform = openfl_geom_Matrix.__identity;
		} else {
			renderer.__softwareRenderer.__worldTransform = renderer.__worldTransform;
		}
		openfl_display__$internal_CanvasGraphics.render(graphics,renderer.__softwareRenderer);
		renderer.__softwareRenderer.__worldTransform = cacheTransform;
	} else {
		graphics.__bitmap = null;
		var pixelRatio = renderer.__pixelRatio;
		graphics.__update(renderer.__worldTransform,pixelRatio);
		var bounds = graphics.__bounds;
		var width = graphics.__width;
		var height = graphics.__height;
		if(bounds != null && width >= 1 && height >= 1) {
			if(graphics.__hardwareDirty || graphics.__quadBuffer == null && graphics.__vertexBuffer == null && graphics.__vertexBufferUVT == null) {
				openfl_display__$internal_Context3DGraphics.buildBuffer(graphics,renderer);
			}
			var scale9Grid = graphics.__owner.__scale9Grid;
			var hasScale9Grid = scale9Grid != null && !graphics.__owner.__isMask && graphics.__worldTransform.b == 0 && graphics.__worldTransform.c == 0;
			if(!hasScale9Grid) {
				scale9Grid = null;
			}
			var data = new openfl_display__$internal_DrawCommandReader(graphics.__commands);
			var context = renderer.__context3D;
			var gl = context.gl;
			var matrix = openfl_geom_Matrix.__pool.get();
			var shaderBuffer = null;
			var bitmap = null;
			var bitmapMatrix = null;
			var repeat = false;
			var smooth = false;
			var fill = null;
			var positionX = 0.0;
			var positionY = 0.0;
			var quadBufferPosition = 0;
			var shaderBufferOffset = 0;
			var triangleIndexBufferPosition = 0;
			var vertexBufferPosition = 0;
			var vertexBufferPositionUVT = 0;
			var _g = 0;
			var _g1 = graphics.__commands.types;
			while(_g < _g1.length) {
				var type = _g1[_g];
				++_g;
				switch(type._hx_index) {
				case 0:
					switch(data.prev._hx_index) {
					case 0:
						data.oPos += 2;
						data.bPos += 2;
						break;
					case 1:
						data.iPos += 1;
						data.fPos += 1;
						break;
					case 2:
						data.oPos += 4;
						data.iiPos += 2;
						data.ffPos += 1;
						data.fPos += 1;
						break;
					case 3:
						data.oPos += 1;
						break;
					case 4:
						data.fPos += 6;
						break;
					case 5:
						data.fPos += 4;
						break;
					case 6:
						data.fPos += 3;
						break;
					case 7:
						data.fPos += 4;
						break;
					case 8:
						data.oPos += 3;
						break;
					case 9:
						data.fPos += 4;
						break;
					case 10:
						data.fPos += 5;
						data.oPos += 1;
						break;
					case 12:
						data.oPos += 4;
						break;
					case 13:
						break;
					case 14:
						data.oPos += 2;
						data.bPos += 2;
						break;
					case 15:
						data.oPos += 4;
						data.iiPos += 2;
						data.ffPos += 1;
						data.fPos += 1;
						break;
					case 16:
						data.oPos += 4;
						data.iPos += 1;
						data.fPos += 2;
						data.bPos += 1;
						break;
					case 17:
						data.fPos += 2;
						break;
					case 18:
						data.fPos += 2;
						break;
					case 19:
						data.oPos += 1;
						break;
					case 20:
						data.oPos += 1;
						break;
					case 21:case 22:
						break;
					default:
					}
					data.prev = openfl_display__$internal_DrawCommandType.BEGIN_BITMAP_FILL;
					var c = data;
					bitmap = c.buffer.o[c.oPos];
					bitmapMatrix = c.buffer.o[c.oPos + 1];
					repeat = c.buffer.b[c.bPos];
					smooth = c.buffer.b[c.bPos + 1];
					shaderBuffer = null;
					fill = null;
					break;
				case 1:
					switch(data.prev._hx_index) {
					case 0:
						data.oPos += 2;
						data.bPos += 2;
						break;
					case 1:
						data.iPos += 1;
						data.fPos += 1;
						break;
					case 2:
						data.oPos += 4;
						data.iiPos += 2;
						data.ffPos += 1;
						data.fPos += 1;
						break;
					case 3:
						data.oPos += 1;
						break;
					case 4:
						data.fPos += 6;
						break;
					case 5:
						data.fPos += 4;
						break;
					case 6:
						data.fPos += 3;
						break;
					case 7:
						data.fPos += 4;
						break;
					case 8:
						data.oPos += 3;
						break;
					case 9:
						data.fPos += 4;
						break;
					case 10:
						data.fPos += 5;
						data.oPos += 1;
						break;
					case 12:
						data.oPos += 4;
						break;
					case 13:
						break;
					case 14:
						data.oPos += 2;
						data.bPos += 2;
						break;
					case 15:
						data.oPos += 4;
						data.iiPos += 2;
						data.ffPos += 1;
						data.fPos += 1;
						break;
					case 16:
						data.oPos += 4;
						data.iPos += 1;
						data.fPos += 2;
						data.bPos += 1;
						break;
					case 17:
						data.fPos += 2;
						break;
					case 18:
						data.fPos += 2;
						break;
					case 19:
						data.oPos += 1;
						break;
					case 20:
						data.oPos += 1;
						break;
					case 21:case 22:
						break;
					default:
					}
					data.prev = openfl_display__$internal_DrawCommandType.BEGIN_FILL;
					var c1 = data;
					var color = c1.buffer.i[c1.iPos] | 0;
					var alpha = c1.buffer.f[c1.fPos] * 255 | 0;
					fill = color & 16777215 | alpha << 24;
					shaderBuffer = null;
					bitmap = null;
					bitmapMatrix = null;
					break;
				case 2:
					switch(data.prev._hx_index) {
					case 0:
						data.oPos += 2;
						data.bPos += 2;
						break;
					case 1:
						data.iPos += 1;
						data.fPos += 1;
						break;
					case 2:
						data.oPos += 4;
						data.iiPos += 2;
						data.ffPos += 1;
						data.fPos += 1;
						break;
					case 3:
						data.oPos += 1;
						break;
					case 4:
						data.fPos += 6;
						break;
					case 5:
						data.fPos += 4;
						break;
					case 6:
						data.fPos += 3;
						break;
					case 7:
						data.fPos += 4;
						break;
					case 8:
						data.oPos += 3;
						break;
					case 9:
						data.fPos += 4;
						break;
					case 10:
						data.fPos += 5;
						data.oPos += 1;
						break;
					case 12:
						data.oPos += 4;
						break;
					case 13:
						break;
					case 14:
						data.oPos += 2;
						data.bPos += 2;
						break;
					case 15:
						data.oPos += 4;
						data.iiPos += 2;
						data.ffPos += 1;
						data.fPos += 1;
						break;
					case 16:
						data.oPos += 4;
						data.iPos += 1;
						data.fPos += 2;
						data.bPos += 1;
						break;
					case 17:
						data.fPos += 2;
						break;
					case 18:
						data.fPos += 2;
						break;
					case 19:
						data.oPos += 1;
						break;
					case 20:
						data.oPos += 1;
						break;
					case 21:case 22:
						break;
					default:
					}
					data.prev = type;
					fill = 0;
					shaderBuffer = null;
					bitmap = null;
					bitmapMatrix = null;
					break;
				case 3:
					switch(data.prev._hx_index) {
					case 0:
						data.oPos += 2;
						data.bPos += 2;
						break;
					case 1:
						data.iPos += 1;
						data.fPos += 1;
						break;
					case 2:
						data.oPos += 4;
						data.iiPos += 2;
						data.ffPos += 1;
						data.fPos += 1;
						break;
					case 3:
						data.oPos += 1;
						break;
					case 4:
						data.fPos += 6;
						break;
					case 5:
						data.fPos += 4;
						break;
					case 6:
						data.fPos += 3;
						break;
					case 7:
						data.fPos += 4;
						break;
					case 8:
						data.oPos += 3;
						break;
					case 9:
						data.fPos += 4;
						break;
					case 10:
						data.fPos += 5;
						data.oPos += 1;
						break;
					case 12:
						data.oPos += 4;
						break;
					case 13:
						break;
					case 14:
						data.oPos += 2;
						data.bPos += 2;
						break;
					case 15:
						data.oPos += 4;
						data.iiPos += 2;
						data.ffPos += 1;
						data.fPos += 1;
						break;
					case 16:
						data.oPos += 4;
						data.iPos += 1;
						data.fPos += 2;
						data.bPos += 1;
						break;
					case 17:
						data.fPos += 2;
						break;
					case 18:
						data.fPos += 2;
						break;
					case 19:
						data.oPos += 1;
						break;
					case 20:
						data.oPos += 1;
						break;
					case 21:case 22:
						break;
					default:
					}
					data.prev = openfl_display__$internal_DrawCommandType.BEGIN_SHADER_FILL;
					var c2 = data;
					shaderBuffer = c2.buffer.o[c2.oPos];
					shaderBufferOffset = 0;
					if(shaderBuffer == null || shaderBuffer.shader == null || shaderBuffer.shader.__bitmap == null) {
						bitmap = null;
					} else {
						bitmap = shaderBuffer.shader.__bitmap.input;
					}
					fill = null;
					bitmapMatrix = null;
					break;
				case 6:
					switch(data.prev._hx_index) {
					case 0:
						data.oPos += 2;
						data.bPos += 2;
						break;
					case 1:
						data.iPos += 1;
						data.fPos += 1;
						break;
					case 2:
						data.oPos += 4;
						data.iiPos += 2;
						data.ffPos += 1;
						data.fPos += 1;
						break;
					case 3:
						data.oPos += 1;
						break;
					case 4:
						data.fPos += 6;
						break;
					case 5:
						data.fPos += 4;
						break;
					case 6:
						data.fPos += 3;
						break;
					case 7:
						data.fPos += 4;
						break;
					case 8:
						data.oPos += 3;
						break;
					case 9:
						data.fPos += 4;
						break;
					case 10:
						data.fPos += 5;
						data.oPos += 1;
						break;
					case 12:
						data.oPos += 4;
						break;
					case 13:
						break;
					case 14:
						data.oPos += 2;
						data.bPos += 2;
						break;
					case 15:
						data.oPos += 4;
						data.iiPos += 2;
						data.ffPos += 1;
						data.fPos += 1;
						break;
					case 16:
						data.oPos += 4;
						data.iPos += 1;
						data.fPos += 2;
						data.bPos += 1;
						break;
					case 17:
						data.fPos += 2;
						break;
					case 18:
						data.fPos += 2;
						break;
					case 19:
						data.oPos += 1;
						break;
					case 20:
						data.oPos += 1;
						break;
					case 21:case 22:
						break;
					default:
					}
					data.prev = openfl_display__$internal_DrawCommandType.DRAW_CIRCLE;
					var c3 = data;
					var radius = c3.buffer.f[c3.fPos + 2];
					var numVertices = Math.PI * (radius + radius) / 4.0 | 0;
					if(numVertices < 6) {
						numVertices = 6;
					}
					var numVertices1 = numVertices;
					var verticesLength = numVertices1 * 2;
					var indicesLength = (numVertices1 - 2) * 3;
					var uvDataLength = 0;
					var culling = 1;
					if(bitmap != null && uvDataLength == 0) {
						uvDataLength = verticesLength;
					}
					if(bitmap != null || shaderBuffer != null || uvDataLength == 0 && fill != null) {
						var numVertices2 = Math.floor(verticesLength / 2);
						var length = indicesLength > 0 ? indicesLength : numVertices2;
						var hasUVTData = uvDataLength >= numVertices2 * 3;
						var vertLength = hasUVTData ? 4 : 2;
						var uvStride = hasUVTData ? 3 : 2;
						var dataPerVertex = vertLength + 2;
						var vertexBuffer = hasUVTData ? graphics.__vertexBufferUVT : graphics.__vertexBuffer;
						var bufferPosition = hasUVTData ? vertexBufferPositionUVT : vertexBufferPosition;
						var uMatrix = renderer.__getMatrix(graphics.__owner.__renderTransform,1);
						var shader;
						if(shaderBuffer != null && !openfl_display__$internal_Context3DGraphics.maskRender) {
							shader = renderer.__initShaderBuffer(shaderBuffer);
							renderer.__setShaderBuffer(shaderBuffer);
							renderer.applyMatrix(uMatrix);
							renderer.applyBitmapData(bitmap,false,repeat);
							renderer.applyAlpha(1);
							renderer.applyColorTransform(null);
							renderer.__updateShaderBuffer(shaderBufferOffset);
						} else if(bitmap != null) {
							shader = openfl_display__$internal_Context3DGraphics.maskRender ? renderer.__maskShader : renderer.__initGraphicsShader(null);
							renderer.setShader(shader);
							renderer.applyMatrix(uMatrix);
							renderer.applyBitmapData(bitmap,smooth,repeat);
							renderer.applyAlpha(graphics.__owner.__worldAlpha);
							renderer.applyColorTransform(graphics.__owner.__worldColorTransform);
							renderer.updateShader();
						} else {
							shader = openfl_display__$internal_Context3DGraphics.maskRender ? renderer.__maskShader : renderer.__initGraphicsShader(null);
							renderer.setShader(shader);
							renderer.applyMatrix(uMatrix);
							renderer.applyBitmapData(openfl_display__$internal_Context3DGraphics.blankBitmapData,true,repeat);
							var color1 = fill;
							openfl_display__$internal_Context3DGraphics.tempColorTransform.redOffset = color1 >>> 16 & 255;
							openfl_display__$internal_Context3DGraphics.tempColorTransform.greenOffset = color1 >>> 8 & 255;
							openfl_display__$internal_Context3DGraphics.tempColorTransform.blueOffset = color1 & 255;
							openfl_display__$internal_Context3DGraphics.tempColorTransform.__combine(graphics.__owner.__worldColorTransform);
							renderer.applyAlpha((color1 >>> 24 & 255) / 255 * graphics.__owner.__worldAlpha);
							renderer.applyColorTransform(openfl_display__$internal_Context3DGraphics.tempColorTransform);
							renderer.updateShader();
						}
						if(shader.__position != null) {
							context.setVertexBufferAt(shader.__position.index,vertexBuffer,bufferPosition,hasUVTData ? 4 : 2);
						}
						if(shader.__textureCoord != null) {
							context.setVertexBufferAt(shader.__textureCoord.index,vertexBuffer,bufferPosition + vertLength,2);
						}
						switch(culling) {
						case 0:
							context.setCulling(0);
							break;
						case 1:
							context.setCulling(3);
							break;
						case 2:
							context.setCulling(1);
							break;
						default:
						}
						context.__drawTriangles(0,length);
						shaderBufferOffset += length;
						if(hasUVTData) {
							vertexBufferPositionUVT += dataPerVertex * length;
						} else {
							vertexBufferPosition += dataPerVertex * length;
						}
						switch(culling) {
						case 1:case 2:
							context.setCulling(0);
							break;
						default:
						}
						renderer.__clearShader();
					}
					break;
				case 7:
					switch(data.prev._hx_index) {
					case 0:
						data.oPos += 2;
						data.bPos += 2;
						break;
					case 1:
						data.iPos += 1;
						data.fPos += 1;
						break;
					case 2:
						data.oPos += 4;
						data.iiPos += 2;
						data.ffPos += 1;
						data.fPos += 1;
						break;
					case 3:
						data.oPos += 1;
						break;
					case 4:
						data.fPos += 6;
						break;
					case 5:
						data.fPos += 4;
						break;
					case 6:
						data.fPos += 3;
						break;
					case 7:
						data.fPos += 4;
						break;
					case 8:
						data.oPos += 3;
						break;
					case 9:
						data.fPos += 4;
						break;
					case 10:
						data.fPos += 5;
						data.oPos += 1;
						break;
					case 12:
						data.oPos += 4;
						break;
					case 13:
						break;
					case 14:
						data.oPos += 2;
						data.bPos += 2;
						break;
					case 15:
						data.oPos += 4;
						data.iiPos += 2;
						data.ffPos += 1;
						data.fPos += 1;
						break;
					case 16:
						data.oPos += 4;
						data.iPos += 1;
						data.fPos += 2;
						data.bPos += 1;
						break;
					case 17:
						data.fPos += 2;
						break;
					case 18:
						data.fPos += 2;
						break;
					case 19:
						data.oPos += 1;
						break;
					case 20:
						data.oPos += 1;
						break;
					case 21:case 22:
						break;
					default:
					}
					data.prev = openfl_display__$internal_DrawCommandType.DRAW_ELLIPSE;
					var c4 = data;
					var radiusX = c4.buffer.f[c4.fPos + 2] / 2.0;
					var radiusY = c4.buffer.f[c4.fPos + 3] / 2.0;
					var scaleX = graphics.__owner.get_scaleX();
					var scaleY = graphics.__owner.get_scaleY();
					var numVertices3 = Math.PI * (radiusX * scaleX + radiusY * scaleY) / 4.0 | 0;
					if(numVertices3 < 6) {
						numVertices3 = 6;
					}
					var numVertices4 = numVertices3;
					var verticesLength1 = numVertices4 * 2;
					var indicesLength1 = (numVertices4 - 2) * 3;
					var uvDataLength1 = 0;
					var culling1 = 1;
					if(bitmap != null && uvDataLength1 == 0) {
						uvDataLength1 = verticesLength1;
					}
					if(bitmap != null || shaderBuffer != null || uvDataLength1 == 0 && fill != null) {
						var numVertices5 = Math.floor(verticesLength1 / 2);
						var length1 = indicesLength1 > 0 ? indicesLength1 : numVertices5;
						var hasUVTData1 = uvDataLength1 >= numVertices5 * 3;
						var vertLength1 = hasUVTData1 ? 4 : 2;
						var uvStride1 = hasUVTData1 ? 3 : 2;
						var dataPerVertex1 = vertLength1 + 2;
						var vertexBuffer1 = hasUVTData1 ? graphics.__vertexBufferUVT : graphics.__vertexBuffer;
						var bufferPosition1 = hasUVTData1 ? vertexBufferPositionUVT : vertexBufferPosition;
						var uMatrix1 = renderer.__getMatrix(graphics.__owner.__renderTransform,1);
						var shader1;
						if(shaderBuffer != null && !openfl_display__$internal_Context3DGraphics.maskRender) {
							shader1 = renderer.__initShaderBuffer(shaderBuffer);
							renderer.__setShaderBuffer(shaderBuffer);
							renderer.applyMatrix(uMatrix1);
							renderer.applyBitmapData(bitmap,false,repeat);
							renderer.applyAlpha(1);
							renderer.applyColorTransform(null);
							renderer.__updateShaderBuffer(shaderBufferOffset);
						} else if(bitmap != null) {
							shader1 = openfl_display__$internal_Context3DGraphics.maskRender ? renderer.__maskShader : renderer.__initGraphicsShader(null);
							renderer.setShader(shader1);
							renderer.applyMatrix(uMatrix1);
							renderer.applyBitmapData(bitmap,smooth,repeat);
							renderer.applyAlpha(graphics.__owner.__worldAlpha);
							renderer.applyColorTransform(graphics.__owner.__worldColorTransform);
							renderer.updateShader();
						} else {
							shader1 = openfl_display__$internal_Context3DGraphics.maskRender ? renderer.__maskShader : renderer.__initGraphicsShader(null);
							renderer.setShader(shader1);
							renderer.applyMatrix(uMatrix1);
							renderer.applyBitmapData(openfl_display__$internal_Context3DGraphics.blankBitmapData,true,repeat);
							var color2 = fill;
							openfl_display__$internal_Context3DGraphics.tempColorTransform.redOffset = color2 >>> 16 & 255;
							openfl_display__$internal_Context3DGraphics.tempColorTransform.greenOffset = color2 >>> 8 & 255;
							openfl_display__$internal_Context3DGraphics.tempColorTransform.blueOffset = color2 & 255;
							openfl_display__$internal_Context3DGraphics.tempColorTransform.__combine(graphics.__owner.__worldColorTransform);
							renderer.applyAlpha((color2 >>> 24 & 255) / 255 * graphics.__owner.__worldAlpha);
							renderer.applyColorTransform(openfl_display__$internal_Context3DGraphics.tempColorTransform);
							renderer.updateShader();
						}
						if(shader1.__position != null) {
							context.setVertexBufferAt(shader1.__position.index,vertexBuffer1,bufferPosition1,hasUVTData1 ? 4 : 2);
						}
						if(shader1.__textureCoord != null) {
							context.setVertexBufferAt(shader1.__textureCoord.index,vertexBuffer1,bufferPosition1 + vertLength1,2);
						}
						switch(culling1) {
						case 0:
							context.setCulling(0);
							break;
						case 1:
							context.setCulling(3);
							break;
						case 2:
							context.setCulling(1);
							break;
						default:
						}
						context.__drawTriangles(0,length1);
						shaderBufferOffset += length1;
						if(hasUVTData1) {
							vertexBufferPositionUVT += dataPerVertex1 * length1;
						} else {
							vertexBufferPosition += dataPerVertex1 * length1;
						}
						switch(culling1) {
						case 1:case 2:
							context.setCulling(0);
							break;
						default:
						}
						renderer.__clearShader();
					}
					break;
				case 8:
					if(bitmap != null || fill != null) {
						switch(data.prev._hx_index) {
						case 0:
							data.oPos += 2;
							data.bPos += 2;
							break;
						case 1:
							data.iPos += 1;
							data.fPos += 1;
							break;
						case 2:
							data.oPos += 4;
							data.iiPos += 2;
							data.ffPos += 1;
							data.fPos += 1;
							break;
						case 3:
							data.oPos += 1;
							break;
						case 4:
							data.fPos += 6;
							break;
						case 5:
							data.fPos += 4;
							break;
						case 6:
							data.fPos += 3;
							break;
						case 7:
							data.fPos += 4;
							break;
						case 8:
							data.oPos += 3;
							break;
						case 9:
							data.fPos += 4;
							break;
						case 10:
							data.fPos += 5;
							data.oPos += 1;
							break;
						case 12:
							data.oPos += 4;
							break;
						case 13:
							break;
						case 14:
							data.oPos += 2;
							data.bPos += 2;
							break;
						case 15:
							data.oPos += 4;
							data.iiPos += 2;
							data.ffPos += 1;
							data.fPos += 1;
							break;
						case 16:
							data.oPos += 4;
							data.iPos += 1;
							data.fPos += 2;
							data.bPos += 1;
							break;
						case 17:
							data.fPos += 2;
							break;
						case 18:
							data.fPos += 2;
							break;
						case 19:
							data.oPos += 1;
							break;
						case 20:
							data.oPos += 1;
							break;
						case 21:case 22:
							break;
						default:
						}
						data.prev = openfl_display__$internal_DrawCommandType.DRAW_QUADS;
						var c5 = data;
						var rects = c5.buffer.o[c5.oPos];
						var indices = c5.buffer.o[c5.oPos + 1];
						var transforms = c5.buffer.o[c5.oPos + 2];
						var hasIndices = indices != null;
						var length2 = hasIndices ? indices.get_length() : Math.floor(rects.get_length() / 4);
						var uMatrix2 = renderer.__getMatrix(graphics.__owner.__renderTransform,1);
						var shader2;
						if(shaderBuffer != null && !openfl_display__$internal_Context3DGraphics.maskRender) {
							shader2 = renderer.__initShaderBuffer(shaderBuffer);
							renderer.__setShaderBuffer(shaderBuffer);
							renderer.applyMatrix(uMatrix2);
							renderer.applyBitmapData(bitmap,false,repeat);
							renderer.applyAlpha(graphics.__owner.__worldAlpha);
							renderer.applyColorTransform(graphics.__owner.__worldColorTransform);
						} else if(bitmap != null) {
							shader2 = openfl_display__$internal_Context3DGraphics.maskRender ? renderer.__maskShader : renderer.__initGraphicsShader(null);
							renderer.setShader(shader2);
							renderer.applyMatrix(uMatrix2);
							renderer.applyBitmapData(bitmap,smooth,repeat);
							renderer.applyAlpha(graphics.__owner.__worldAlpha);
							renderer.applyColorTransform(graphics.__owner.__worldColorTransform);
							renderer.updateShader();
						} else {
							shader2 = openfl_display__$internal_Context3DGraphics.maskRender ? renderer.__maskShader : renderer.__initGraphicsShader(null);
							renderer.setShader(shader2);
							renderer.applyMatrix(uMatrix2);
							renderer.applyBitmapData(openfl_display__$internal_Context3DGraphics.blankBitmapData,true,repeat);
							var color3 = fill;
							openfl_display__$internal_Context3DGraphics.tempColorTransform.redOffset = color3 >>> 16 & 255;
							openfl_display__$internal_Context3DGraphics.tempColorTransform.greenOffset = color3 >>> 8 & 255;
							openfl_display__$internal_Context3DGraphics.tempColorTransform.blueOffset = color3 & 255;
							openfl_display__$internal_Context3DGraphics.tempColorTransform.__combine(graphics.__owner.__worldColorTransform);
							renderer.applyAlpha((color3 >>> 24 & 255) / 255 * graphics.__owner.__worldAlpha);
							renderer.applyColorTransform(openfl_display__$internal_Context3DGraphics.tempColorTransform);
							renderer.updateShader();
						}
						var end = quadBufferPosition + length2;
						while(quadBufferPosition < end) {
							length2 = Math.min(end - quadBufferPosition,context.__quadIndexBufferElements) | 0;
							if(length2 <= 0) {
								break;
							}
							if(shaderBuffer != null && !openfl_display__$internal_Context3DGraphics.maskRender) {
								renderer.__updateShaderBuffer(shaderBufferOffset);
							}
							if(shader2.__position != null) {
								context.setVertexBufferAt(shader2.__position.index,graphics.__quadBuffer.vertexBuffer,quadBufferPosition * 16,2);
							}
							if(shader2.__textureCoord != null) {
								context.setVertexBufferAt(shader2.__textureCoord.index,graphics.__quadBuffer.vertexBuffer,quadBufferPosition * 16 + 2,2);
							}
							context.drawTriangles(context.__quadIndexBuffer,0,length2 * 2);
							shaderBufferOffset += length2 * 4;
							quadBufferPosition += length2;
						}
						renderer.__clearShader();
					}
					break;
				case 9:
					switch(data.prev._hx_index) {
					case 0:
						data.oPos += 2;
						data.bPos += 2;
						break;
					case 1:
						data.iPos += 1;
						data.fPos += 1;
						break;
					case 2:
						data.oPos += 4;
						data.iiPos += 2;
						data.ffPos += 1;
						data.fPos += 1;
						break;
					case 3:
						data.oPos += 1;
						break;
					case 4:
						data.fPos += 6;
						break;
					case 5:
						data.fPos += 4;
						break;
					case 6:
						data.fPos += 3;
						break;
					case 7:
						data.fPos += 4;
						break;
					case 8:
						data.oPos += 3;
						break;
					case 9:
						data.fPos += 4;
						break;
					case 10:
						data.fPos += 5;
						data.oPos += 1;
						break;
					case 12:
						data.oPos += 4;
						break;
					case 13:
						break;
					case 14:
						data.oPos += 2;
						data.bPos += 2;
						break;
					case 15:
						data.oPos += 4;
						data.iiPos += 2;
						data.ffPos += 1;
						data.fPos += 1;
						break;
					case 16:
						data.oPos += 4;
						data.iPos += 1;
						data.fPos += 2;
						data.bPos += 1;
						break;
					case 17:
						data.fPos += 2;
						break;
					case 18:
						data.fPos += 2;
						break;
					case 19:
						data.oPos += 1;
						break;
					case 20:
						data.oPos += 1;
						break;
					case 21:case 22:
						break;
					default:
					}
					data.prev = openfl_display__$internal_DrawCommandType.DRAW_RECT;
					var c6 = data;
					if(bitmap != null) {
						var uvDataLength2 = 0;
						var culling2 = 1;
						if(bitmap != null && uvDataLength2 == 0) {
							uvDataLength2 = 8;
						}
						if(bitmap != null || shaderBuffer != null || uvDataLength2 == 0 && fill != null) {
							var numVertices6 = 4;
							var length3 = 6;
							var hasUVTData2 = uvDataLength2 >= numVertices6 * 3;
							var vertLength2 = hasUVTData2 ? 4 : 2;
							var uvStride2 = hasUVTData2 ? 3 : 2;
							var dataPerVertex2 = vertLength2 + 2;
							var vertexBuffer2 = hasUVTData2 ? graphics.__vertexBufferUVT : graphics.__vertexBuffer;
							var bufferPosition2 = hasUVTData2 ? vertexBufferPositionUVT : vertexBufferPosition;
							var uMatrix3 = renderer.__getMatrix(graphics.__owner.__renderTransform,1);
							var shader3;
							if(shaderBuffer != null && !openfl_display__$internal_Context3DGraphics.maskRender) {
								shader3 = renderer.__initShaderBuffer(shaderBuffer);
								renderer.__setShaderBuffer(shaderBuffer);
								renderer.applyMatrix(uMatrix3);
								renderer.applyBitmapData(bitmap,false,repeat);
								renderer.applyAlpha(1);
								renderer.applyColorTransform(null);
								renderer.__updateShaderBuffer(shaderBufferOffset);
							} else if(bitmap != null) {
								shader3 = openfl_display__$internal_Context3DGraphics.maskRender ? renderer.__maskShader : renderer.__initGraphicsShader(null);
								renderer.setShader(shader3);
								renderer.applyMatrix(uMatrix3);
								renderer.applyBitmapData(bitmap,smooth,repeat);
								renderer.applyAlpha(graphics.__owner.__worldAlpha);
								renderer.applyColorTransform(graphics.__owner.__worldColorTransform);
								renderer.updateShader();
							} else {
								shader3 = openfl_display__$internal_Context3DGraphics.maskRender ? renderer.__maskShader : renderer.__initGraphicsShader(null);
								renderer.setShader(shader3);
								renderer.applyMatrix(uMatrix3);
								renderer.applyBitmapData(openfl_display__$internal_Context3DGraphics.blankBitmapData,true,repeat);
								var color4 = fill;
								openfl_display__$internal_Context3DGraphics.tempColorTransform.redOffset = color4 >>> 16 & 255;
								openfl_display__$internal_Context3DGraphics.tempColorTransform.greenOffset = color4 >>> 8 & 255;
								openfl_display__$internal_Context3DGraphics.tempColorTransform.blueOffset = color4 & 255;
								openfl_display__$internal_Context3DGraphics.tempColorTransform.__combine(graphics.__owner.__worldColorTransform);
								renderer.applyAlpha((color4 >>> 24 & 255) / 255 * graphics.__owner.__worldAlpha);
								renderer.applyColorTransform(openfl_display__$internal_Context3DGraphics.tempColorTransform);
								renderer.updateShader();
							}
							if(shader3.__position != null) {
								context.setVertexBufferAt(shader3.__position.index,vertexBuffer2,bufferPosition2,hasUVTData2 ? 4 : 2);
							}
							if(shader3.__textureCoord != null) {
								context.setVertexBufferAt(shader3.__textureCoord.index,vertexBuffer2,bufferPosition2 + vertLength2,2);
							}
							switch(culling2) {
							case 0:
								context.setCulling(0);
								break;
							case 1:
								context.setCulling(3);
								break;
							case 2:
								context.setCulling(1);
								break;
							default:
							}
							context.__drawTriangles(0,length3);
							shaderBufferOffset += length3;
							if(hasUVTData2) {
								vertexBufferPositionUVT += dataPerVertex2 * length3;
							} else {
								vertexBufferPosition += dataPerVertex2 * length3;
							}
							switch(culling2) {
							case 1:case 2:
								context.setCulling(0);
								break;
							default:
							}
							renderer.__clearShader();
						}
					} else if(fill != null) {
						var x = c6.buffer.f[c6.fPos];
						var y = c6.buffer.f[c6.fPos + 1];
						var width = c6.buffer.f[c6.fPos + 2];
						var height = c6.buffer.f[c6.fPos + 3];
						if(hasScale9Grid) {
							var scaledLeft = openfl_display__$internal_Context3DGraphics.toScale9Position(c6.buffer.f[c6.fPos],scale9Grid.x,scale9Grid.width,bounds.width,graphics.__owner.get_scaleX());
							var scaledTop = openfl_display__$internal_Context3DGraphics.toScale9Position(c6.buffer.f[c6.fPos + 1],scale9Grid.y,scale9Grid.height,bounds.height,graphics.__owner.get_scaleY());
							var scaledRight = openfl_display__$internal_Context3DGraphics.toScale9Position(c6.buffer.f[c6.fPos] + c6.buffer.f[c6.fPos + 2],scale9Grid.x,scale9Grid.width,bounds.width,graphics.__owner.get_scaleX());
							var scaledBottom = openfl_display__$internal_Context3DGraphics.toScale9Position(c6.buffer.f[c6.fPos + 1] + c6.buffer.f[c6.fPos + 3],scale9Grid.y,scale9Grid.height,bounds.height,graphics.__owner.get_scaleY());
							x = scaledLeft / graphics.__owner.get_scaleX();
							y = scaledTop / graphics.__owner.get_scaleY();
							width = (scaledRight - scaledLeft) / graphics.__owner.get_scaleX();
							height = (scaledBottom - scaledTop) / graphics.__owner.get_scaleY();
						}
						matrix.identity();
						matrix.scale(width,height);
						matrix.tx = x;
						matrix.ty = y;
						matrix.concat(graphics.__owner.__renderTransform);
						var shader4 = openfl_display__$internal_Context3DGraphics.maskRender ? renderer.__maskShader : renderer.__initGraphicsShader(null);
						renderer.setShader(shader4);
						renderer.applyMatrix(renderer.__getMatrix(matrix,1));
						renderer.applyBitmapData(openfl_display__$internal_Context3DGraphics.blankBitmapData,true,repeat);
						var color5 = fill;
						openfl_display__$internal_Context3DGraphics.tempColorTransform.redOffset = color5 >>> 16 & 255;
						openfl_display__$internal_Context3DGraphics.tempColorTransform.greenOffset = color5 >>> 8 & 255;
						openfl_display__$internal_Context3DGraphics.tempColorTransform.blueOffset = color5 & 255;
						openfl_display__$internal_Context3DGraphics.tempColorTransform.__combine(graphics.__owner.__worldColorTransform);
						renderer.applyAlpha((color5 >>> 24 & 255) / 255 * graphics.__owner.__worldAlpha);
						renderer.applyColorTransform(openfl_display__$internal_Context3DGraphics.tempColorTransform);
						renderer.updateShader();
						var vertexBuffer3 = openfl_display__$internal_Context3DGraphics.blankBitmapData.getVertexBuffer(context);
						if(shader4.__position != null) {
							context.setVertexBufferAt(shader4.__position.index,vertexBuffer3,0,3);
						}
						if(shader4.__textureCoord != null) {
							context.setVertexBufferAt(shader4.__textureCoord.index,vertexBuffer3,3,2);
						}
						var indexBuffer = openfl_display__$internal_Context3DGraphics.blankBitmapData.getIndexBuffer(context);
						context.drawTriangles(indexBuffer);
						shaderBufferOffset += 4;
						renderer.__clearShader();
					}
					break;
				case 10:
					switch(data.prev._hx_index) {
					case 0:
						data.oPos += 2;
						data.bPos += 2;
						break;
					case 1:
						data.iPos += 1;
						data.fPos += 1;
						break;
					case 2:
						data.oPos += 4;
						data.iiPos += 2;
						data.ffPos += 1;
						data.fPos += 1;
						break;
					case 3:
						data.oPos += 1;
						break;
					case 4:
						data.fPos += 6;
						break;
					case 5:
						data.fPos += 4;
						break;
					case 6:
						data.fPos += 3;
						break;
					case 7:
						data.fPos += 4;
						break;
					case 8:
						data.oPos += 3;
						break;
					case 9:
						data.fPos += 4;
						break;
					case 10:
						data.fPos += 5;
						data.oPos += 1;
						break;
					case 12:
						data.oPos += 4;
						break;
					case 13:
						break;
					case 14:
						data.oPos += 2;
						data.bPos += 2;
						break;
					case 15:
						data.oPos += 4;
						data.iiPos += 2;
						data.ffPos += 1;
						data.fPos += 1;
						break;
					case 16:
						data.oPos += 4;
						data.iPos += 1;
						data.fPos += 2;
						data.bPos += 1;
						break;
					case 17:
						data.fPos += 2;
						break;
					case 18:
						data.fPos += 2;
						break;
					case 19:
						data.oPos += 1;
						break;
					case 20:
						data.oPos += 1;
						break;
					case 21:case 22:
						break;
					default:
					}
					data.prev = openfl_display__$internal_DrawCommandType.DRAW_ROUND_RECT;
					var c7 = data;
					var radiusX1 = c7.buffer.f[c7.fPos + 4] / 2.0;
					var radiusY1 = (c7.buffer.o[c7.oPos] != null ? c7.buffer.o[c7.oPos] : c7.buffer.f[c7.fPos + 4]) / 2.0;
					var scaleX1 = hasScale9Grid && c7.buffer.f[c7.fPos] + radiusX1 <= scale9Grid.x && c7.buffer.f[c7.fPos] + c7.buffer.f[c7.fPos + 2] - radiusX1 >= scale9Grid.x + scale9Grid.width ? 1.0 : graphics.__owner.get_scaleX();
					var scaleY1 = hasScale9Grid && c7.buffer.f[c7.fPos + 1] + radiusY1 <= scale9Grid.y && c7.buffer.f[c7.fPos + 1] + c7.buffer.f[c7.fPos + 3] - radiusX1 >= scale9Grid.y + scale9Grid.height ? 1.0 : graphics.__owner.get_scaleY();
					var numVerticesPerCorner = Math.ceil(Math.PI * (radiusX1 * scaleX1 + radiusY1 * scaleY1) / 8.0);
					if(numVerticesPerCorner < 3) {
						numVerticesPerCorner = 3;
					}
					var numVertices7 = numVerticesPerCorner * 4;
					var verticesLength2 = numVertices7 * 2;
					var indicesLength2 = (numVertices7 - 2) * 3;
					var uvDataLength3 = 0;
					var culling3 = 1;
					if(bitmap != null && uvDataLength3 == 0) {
						uvDataLength3 = verticesLength2;
					}
					if(bitmap != null || shaderBuffer != null || uvDataLength3 == 0 && fill != null) {
						var numVertices8 = Math.floor(verticesLength2 / 2);
						var length4 = indicesLength2 > 0 ? indicesLength2 : numVertices8;
						var hasUVTData3 = uvDataLength3 >= numVertices8 * 3;
						var vertLength3 = hasUVTData3 ? 4 : 2;
						var uvStride3 = hasUVTData3 ? 3 : 2;
						var dataPerVertex3 = vertLength3 + 2;
						var vertexBuffer4 = hasUVTData3 ? graphics.__vertexBufferUVT : graphics.__vertexBuffer;
						var bufferPosition3 = hasUVTData3 ? vertexBufferPositionUVT : vertexBufferPosition;
						var uMatrix4 = renderer.__getMatrix(graphics.__owner.__renderTransform,1);
						var shader5;
						if(shaderBuffer != null && !openfl_display__$internal_Context3DGraphics.maskRender) {
							shader5 = renderer.__initShaderBuffer(shaderBuffer);
							renderer.__setShaderBuffer(shaderBuffer);
							renderer.applyMatrix(uMatrix4);
							renderer.applyBitmapData(bitmap,false,repeat);
							renderer.applyAlpha(1);
							renderer.applyColorTransform(null);
							renderer.__updateShaderBuffer(shaderBufferOffset);
						} else if(bitmap != null) {
							shader5 = openfl_display__$internal_Context3DGraphics.maskRender ? renderer.__maskShader : renderer.__initGraphicsShader(null);
							renderer.setShader(shader5);
							renderer.applyMatrix(uMatrix4);
							renderer.applyBitmapData(bitmap,smooth,repeat);
							renderer.applyAlpha(graphics.__owner.__worldAlpha);
							renderer.applyColorTransform(graphics.__owner.__worldColorTransform);
							renderer.updateShader();
						} else {
							shader5 = openfl_display__$internal_Context3DGraphics.maskRender ? renderer.__maskShader : renderer.__initGraphicsShader(null);
							renderer.setShader(shader5);
							renderer.applyMatrix(uMatrix4);
							renderer.applyBitmapData(openfl_display__$internal_Context3DGraphics.blankBitmapData,true,repeat);
							var color6 = fill;
							openfl_display__$internal_Context3DGraphics.tempColorTransform.redOffset = color6 >>> 16 & 255;
							openfl_display__$internal_Context3DGraphics.tempColorTransform.greenOffset = color6 >>> 8 & 255;
							openfl_display__$internal_Context3DGraphics.tempColorTransform.blueOffset = color6 & 255;
							openfl_display__$internal_Context3DGraphics.tempColorTransform.__combine(graphics.__owner.__worldColorTransform);
							renderer.applyAlpha((color6 >>> 24 & 255) / 255 * graphics.__owner.__worldAlpha);
							renderer.applyColorTransform(openfl_display__$internal_Context3DGraphics.tempColorTransform);
							renderer.updateShader();
						}
						if(shader5.__position != null) {
							context.setVertexBufferAt(shader5.__position.index,vertexBuffer4,bufferPosition3,hasUVTData3 ? 4 : 2);
						}
						if(shader5.__textureCoord != null) {
							context.setVertexBufferAt(shader5.__textureCoord.index,vertexBuffer4,bufferPosition3 + vertLength3,2);
						}
						switch(culling3) {
						case 0:
							context.setCulling(0);
							break;
						case 1:
							context.setCulling(3);
							break;
						case 2:
							context.setCulling(1);
							break;
						default:
						}
						context.__drawTriangles(0,length4);
						shaderBufferOffset += length4;
						if(hasUVTData3) {
							vertexBufferPositionUVT += dataPerVertex3 * length4;
						} else {
							vertexBufferPosition += dataPerVertex3 * length4;
						}
						switch(culling3) {
						case 1:case 2:
							context.setCulling(0);
							break;
						default:
						}
						renderer.__clearShader();
					}
					break;
				case 12:
					switch(data.prev._hx_index) {
					case 0:
						data.oPos += 2;
						data.bPos += 2;
						break;
					case 1:
						data.iPos += 1;
						data.fPos += 1;
						break;
					case 2:
						data.oPos += 4;
						data.iiPos += 2;
						data.ffPos += 1;
						data.fPos += 1;
						break;
					case 3:
						data.oPos += 1;
						break;
					case 4:
						data.fPos += 6;
						break;
					case 5:
						data.fPos += 4;
						break;
					case 6:
						data.fPos += 3;
						break;
					case 7:
						data.fPos += 4;
						break;
					case 8:
						data.oPos += 3;
						break;
					case 9:
						data.fPos += 4;
						break;
					case 10:
						data.fPos += 5;
						data.oPos += 1;
						break;
					case 12:
						data.oPos += 4;
						break;
					case 13:
						break;
					case 14:
						data.oPos += 2;
						data.bPos += 2;
						break;
					case 15:
						data.oPos += 4;
						data.iiPos += 2;
						data.ffPos += 1;
						data.fPos += 1;
						break;
					case 16:
						data.oPos += 4;
						data.iPos += 1;
						data.fPos += 2;
						data.bPos += 1;
						break;
					case 17:
						data.fPos += 2;
						break;
					case 18:
						data.fPos += 2;
						break;
					case 19:
						data.oPos += 1;
						break;
					case 20:
						data.oPos += 1;
						break;
					case 21:case 22:
						break;
					default:
					}
					data.prev = openfl_display__$internal_DrawCommandType.DRAW_TRIANGLES;
					var c8 = data;
					var vertices = c8.buffer.o[c8.oPos];
					var indices1 = c8.buffer.o[c8.oPos + 1];
					var uvtData = c8.buffer.o[c8.oPos + 2];
					var culling4 = c8.buffer.o[c8.oPos + 3];
					var verticesLength3 = vertices.get_length();
					var indicesLength3 = indices1 != null ? indices1.get_length() : 0;
					var uvDataLength4 = uvtData != null ? uvtData.get_length() : 0;
					if(bitmap != null && uvDataLength4 == 0) {
						uvDataLength4 = verticesLength3;
					}
					if(bitmap != null || shaderBuffer != null || uvDataLength4 == 0 && fill != null) {
						var numVertices9 = Math.floor(verticesLength3 / 2);
						var length5 = indicesLength3 > 0 ? indicesLength3 : numVertices9;
						var hasUVTData4 = uvDataLength4 >= numVertices9 * 3;
						var vertLength4 = hasUVTData4 ? 4 : 2;
						var uvStride4 = hasUVTData4 ? 3 : 2;
						var dataPerVertex4 = vertLength4 + 2;
						var vertexBuffer5 = hasUVTData4 ? graphics.__vertexBufferUVT : graphics.__vertexBuffer;
						var bufferPosition4 = hasUVTData4 ? vertexBufferPositionUVT : vertexBufferPosition;
						var uMatrix5 = renderer.__getMatrix(graphics.__owner.__renderTransform,1);
						var shader6;
						if(shaderBuffer != null && !openfl_display__$internal_Context3DGraphics.maskRender) {
							shader6 = renderer.__initShaderBuffer(shaderBuffer);
							renderer.__setShaderBuffer(shaderBuffer);
							renderer.applyMatrix(uMatrix5);
							renderer.applyBitmapData(bitmap,false,repeat);
							renderer.applyAlpha(1);
							renderer.applyColorTransform(null);
							renderer.__updateShaderBuffer(shaderBufferOffset);
						} else if(bitmap != null) {
							shader6 = openfl_display__$internal_Context3DGraphics.maskRender ? renderer.__maskShader : renderer.__initGraphicsShader(null);
							renderer.setShader(shader6);
							renderer.applyMatrix(uMatrix5);
							renderer.applyBitmapData(bitmap,smooth,repeat);
							renderer.applyAlpha(graphics.__owner.__worldAlpha);
							renderer.applyColorTransform(graphics.__owner.__worldColorTransform);
							renderer.updateShader();
						} else {
							shader6 = openfl_display__$internal_Context3DGraphics.maskRender ? renderer.__maskShader : renderer.__initGraphicsShader(null);
							renderer.setShader(shader6);
							renderer.applyMatrix(uMatrix5);
							renderer.applyBitmapData(openfl_display__$internal_Context3DGraphics.blankBitmapData,true,repeat);
							var color7 = fill;
							openfl_display__$internal_Context3DGraphics.tempColorTransform.redOffset = color7 >>> 16 & 255;
							openfl_display__$internal_Context3DGraphics.tempColorTransform.greenOffset = color7 >>> 8 & 255;
							openfl_display__$internal_Context3DGraphics.tempColorTransform.blueOffset = color7 & 255;
							openfl_display__$internal_Context3DGraphics.tempColorTransform.__combine(graphics.__owner.__worldColorTransform);
							renderer.applyAlpha((color7 >>> 24 & 255) / 255 * graphics.__owner.__worldAlpha);
							renderer.applyColorTransform(openfl_display__$internal_Context3DGraphics.tempColorTransform);
							renderer.updateShader();
						}
						if(shader6.__position != null) {
							context.setVertexBufferAt(shader6.__position.index,vertexBuffer5,bufferPosition4,hasUVTData4 ? 4 : 2);
						}
						if(shader6.__textureCoord != null) {
							context.setVertexBufferAt(shader6.__textureCoord.index,vertexBuffer5,bufferPosition4 + vertLength4,2);
						}
						switch(culling4) {
						case 0:
							context.setCulling(0);
							break;
						case 1:
							context.setCulling(3);
							break;
						case 2:
							context.setCulling(1);
							break;
						default:
						}
						context.__drawTriangles(0,length5);
						shaderBufferOffset += length5;
						if(hasUVTData4) {
							vertexBufferPositionUVT += dataPerVertex4 * length5;
						} else {
							vertexBufferPosition += dataPerVertex4 * length5;
						}
						switch(culling4) {
						case 1:case 2:
							context.setCulling(0);
							break;
						default:
						}
						renderer.__clearShader();
					}
					break;
				case 13:
					bitmap = null;
					bitmapMatrix = null;
					fill = null;
					shaderBuffer = null;
					switch(data.prev._hx_index) {
					case 0:
						data.oPos += 2;
						data.bPos += 2;
						break;
					case 1:
						data.iPos += 1;
						data.fPos += 1;
						break;
					case 2:
						data.oPos += 4;
						data.iiPos += 2;
						data.ffPos += 1;
						data.fPos += 1;
						break;
					case 3:
						data.oPos += 1;
						break;
					case 4:
						data.fPos += 6;
						break;
					case 5:
						data.fPos += 4;
						break;
					case 6:
						data.fPos += 3;
						break;
					case 7:
						data.fPos += 4;
						break;
					case 8:
						data.oPos += 3;
						break;
					case 9:
						data.fPos += 4;
						break;
					case 10:
						data.fPos += 5;
						data.oPos += 1;
						break;
					case 12:
						data.oPos += 4;
						break;
					case 13:
						break;
					case 14:
						data.oPos += 2;
						data.bPos += 2;
						break;
					case 15:
						data.oPos += 4;
						data.iiPos += 2;
						data.ffPos += 1;
						data.fPos += 1;
						break;
					case 16:
						data.oPos += 4;
						data.iPos += 1;
						data.fPos += 2;
						data.bPos += 1;
						break;
					case 17:
						data.fPos += 2;
						break;
					case 18:
						data.fPos += 2;
						break;
					case 19:
						data.oPos += 1;
						break;
					case 20:
						data.oPos += 1;
						break;
					case 21:case 22:
						break;
					default:
					}
					data.prev = type;
					context.setCulling(3);
					break;
				case 18:
					switch(data.prev._hx_index) {
					case 0:
						data.oPos += 2;
						data.bPos += 2;
						break;
					case 1:
						data.iPos += 1;
						data.fPos += 1;
						break;
					case 2:
						data.oPos += 4;
						data.iiPos += 2;
						data.ffPos += 1;
						data.fPos += 1;
						break;
					case 3:
						data.oPos += 1;
						break;
					case 4:
						data.fPos += 6;
						break;
					case 5:
						data.fPos += 4;
						break;
					case 6:
						data.fPos += 3;
						break;
					case 7:
						data.fPos += 4;
						break;
					case 8:
						data.oPos += 3;
						break;
					case 9:
						data.fPos += 4;
						break;
					case 10:
						data.fPos += 5;
						data.oPos += 1;
						break;
					case 12:
						data.oPos += 4;
						break;
					case 13:
						break;
					case 14:
						data.oPos += 2;
						data.bPos += 2;
						break;
					case 15:
						data.oPos += 4;
						data.iiPos += 2;
						data.ffPos += 1;
						data.fPos += 1;
						break;
					case 16:
						data.oPos += 4;
						data.iPos += 1;
						data.fPos += 2;
						data.bPos += 1;
						break;
					case 17:
						data.fPos += 2;
						break;
					case 18:
						data.fPos += 2;
						break;
					case 19:
						data.oPos += 1;
						break;
					case 20:
						data.oPos += 1;
						break;
					case 21:case 22:
						break;
					default:
					}
					data.prev = openfl_display__$internal_DrawCommandType.MOVE_TO;
					var c9 = data;
					positionX = c9.buffer.f[c9.fPos];
					positionY = c9.buffer.f[c9.fPos + 1];
					break;
				case 19:
					switch(data.prev._hx_index) {
					case 0:
						data.oPos += 2;
						data.bPos += 2;
						break;
					case 1:
						data.iPos += 1;
						data.fPos += 1;
						break;
					case 2:
						data.oPos += 4;
						data.iiPos += 2;
						data.ffPos += 1;
						data.fPos += 1;
						break;
					case 3:
						data.oPos += 1;
						break;
					case 4:
						data.fPos += 6;
						break;
					case 5:
						data.fPos += 4;
						break;
					case 6:
						data.fPos += 3;
						break;
					case 7:
						data.fPos += 4;
						break;
					case 8:
						data.oPos += 3;
						break;
					case 9:
						data.fPos += 4;
						break;
					case 10:
						data.fPos += 5;
						data.oPos += 1;
						break;
					case 12:
						data.oPos += 4;
						break;
					case 13:
						break;
					case 14:
						data.oPos += 2;
						data.bPos += 2;
						break;
					case 15:
						data.oPos += 4;
						data.iiPos += 2;
						data.ffPos += 1;
						data.fPos += 1;
						break;
					case 16:
						data.oPos += 4;
						data.iPos += 1;
						data.fPos += 2;
						data.bPos += 1;
						break;
					case 17:
						data.fPos += 2;
						break;
					case 18:
						data.fPos += 2;
						break;
					case 19:
						data.oPos += 1;
						break;
					case 20:
						data.oPos += 1;
						break;
					case 21:case 22:
						break;
					default:
					}
					data.prev = openfl_display__$internal_DrawCommandType.OVERRIDE_BLEND_MODE;
					var c10 = data;
					renderer.__setBlendMode(c10.buffer.o[c10.oPos]);
					break;
				default:
					switch(data.prev._hx_index) {
					case 0:
						data.oPos += 2;
						data.bPos += 2;
						break;
					case 1:
						data.iPos += 1;
						data.fPos += 1;
						break;
					case 2:
						data.oPos += 4;
						data.iiPos += 2;
						data.ffPos += 1;
						data.fPos += 1;
						break;
					case 3:
						data.oPos += 1;
						break;
					case 4:
						data.fPos += 6;
						break;
					case 5:
						data.fPos += 4;
						break;
					case 6:
						data.fPos += 3;
						break;
					case 7:
						data.fPos += 4;
						break;
					case 8:
						data.oPos += 3;
						break;
					case 9:
						data.fPos += 4;
						break;
					case 10:
						data.fPos += 5;
						data.oPos += 1;
						break;
					case 12:
						data.oPos += 4;
						break;
					case 13:
						break;
					case 14:
						data.oPos += 2;
						data.bPos += 2;
						break;
					case 15:
						data.oPos += 4;
						data.iiPos += 2;
						data.ffPos += 1;
						data.fPos += 1;
						break;
					case 16:
						data.oPos += 4;
						data.iPos += 1;
						data.fPos += 2;
						data.bPos += 1;
						break;
					case 17:
						data.fPos += 2;
						break;
					case 18:
						data.fPos += 2;
						break;
					case 19:
						data.oPos += 1;
						break;
					case 20:
						data.oPos += 1;
						break;
					case 21:case 22:
						break;
					default:
					}
					data.prev = type;
				}
			}
			openfl_geom_Matrix.__pool.release(matrix);
		}
		graphics.set___dirty(false);
	}
	graphics.__hardwareDirty = false;
};
openfl_display__$internal_Context3DGraphics.renderMask = function(graphics,renderer) {
	openfl_display__$internal_Context3DGraphics.maskRender = true;
	openfl_display__$internal_Context3DGraphics.render(graphics,renderer);
	openfl_display__$internal_Context3DGraphics.maskRender = false;
};
openfl_display__$internal_Context3DGraphics.resizeIndexBuffer = function(graphics,isQuad,length) {
	if(isQuad) {
		return;
	}
	var buffer = isQuad ? null : graphics.__triangleIndexBufferData;
	var position = 0;
	var newBuffer = null;
	if(buffer == null) {
		var array = null;
		var vector = null;
		var view = null;
		var buffer1 = null;
		var len = null;
		var this1;
		if(length != null) {
			this1 = new Uint16Array(length);
		} else if(array != null) {
			this1 = new Uint16Array(array);
		} else if(vector != null) {
			this1 = new Uint16Array(vector.__array);
		} else if(view != null) {
			this1 = new Uint16Array(view);
		} else if(buffer1 != null) {
			if(len == null) {
				this1 = new Uint16Array(buffer1,0);
			} else {
				this1 = new Uint16Array(buffer1,0,len);
			}
		} else {
			this1 = null;
		}
		newBuffer = this1;
	} else if(length > buffer.length) {
		var array = null;
		var vector = null;
		var view = null;
		var buffer1 = null;
		var len = null;
		var this1;
		if(length != null) {
			this1 = new Uint16Array(length);
		} else if(array != null) {
			this1 = new Uint16Array(array);
		} else if(vector != null) {
			this1 = new Uint16Array(vector.__array);
		} else if(view != null) {
			this1 = new Uint16Array(view);
		} else if(buffer1 != null) {
			if(len == null) {
				this1 = new Uint16Array(buffer1,0);
			} else {
				this1 = new Uint16Array(buffer1,0,len);
			}
		} else {
			this1 = null;
		}
		newBuffer = this1;
		newBuffer.set(buffer);
		position = buffer.length;
	}
	if(newBuffer != null) {
		if(!isQuad) {
			graphics.__triangleIndexBufferData = newBuffer;
		}
	}
};
openfl_display__$internal_Context3DGraphics.resizeVertexBuffer = function(graphics,hasUVTData,length) {
	var buffer = hasUVTData ? graphics.__vertexBufferDataUVT : graphics.__vertexBufferData;
	var newBuffer = null;
	if(buffer == null) {
		var array = null;
		var vector = null;
		var view = null;
		var buffer1 = null;
		var len = null;
		var this1;
		if(length != null) {
			this1 = new Float32Array(length);
		} else if(array != null) {
			this1 = new Float32Array(array);
		} else if(vector != null) {
			this1 = new Float32Array(vector.__array);
		} else if(view != null) {
			this1 = new Float32Array(view);
		} else if(buffer1 != null) {
			if(len == null) {
				this1 = new Float32Array(buffer1,0);
			} else {
				this1 = new Float32Array(buffer1,0,len);
			}
		} else {
			this1 = null;
		}
		newBuffer = this1;
	} else if(length > buffer.length) {
		var array = null;
		var vector = null;
		var view = null;
		var buffer1 = null;
		var len = null;
		var this1;
		if(length != null) {
			this1 = new Float32Array(length);
		} else if(array != null) {
			this1 = new Float32Array(array);
		} else if(vector != null) {
			this1 = new Float32Array(vector.__array);
		} else if(view != null) {
			this1 = new Float32Array(view);
		} else if(buffer1 != null) {
			if(len == null) {
				this1 = new Float32Array(buffer1,0);
			} else {
				this1 = new Float32Array(buffer1,0,len);
			}
		} else {
			this1 = null;
		}
		newBuffer = this1;
		newBuffer.set(buffer);
	}
	if(newBuffer != null) {
		if(hasUVTData) {
			graphics.__vertexBufferDataUVT = newBuffer;
		} else {
			graphics.__vertexBufferData = newBuffer;
		}
	}
};
openfl_display__$internal_Context3DGraphics.populateUvtVector = function(vertices,bitmap,result) {
	var minX = vertices.get(0);
	var maxX = minX;
	var minY = vertices.get(1);
	var maxY = minY;
	var i = 2;
	var length = vertices.get_length();
	while(i < length) {
		var x = vertices.get(i);
		if(minX > x) {
			minX = x;
		} else if(maxX < x) {
			maxX = x;
		}
		var y = vertices.get(i + 1);
		if(minY > y) {
			minY = y;
		} else if(maxY < y) {
			maxY = y;
		}
		i += 2;
	}
	var trianglesWidth = maxX - minX;
	var trianglesHeight = maxY - minY;
	result.set_length(length);
	i = 0;
	while(i < length) {
		result.set(i,trianglesWidth * (vertices.get(i) / trianglesWidth) / bitmap.width);
		result.set(i + 1,trianglesHeight * (vertices.get(i + 1) / trianglesHeight) / bitmap.height);
		i += 2;
	}
};
openfl_display__$internal_Context3DGraphics.toScale9Position = function(pos,scale9Start,scale9Center,unscaledSize,scale) {
	if(scale <= 0.0) {
		return 0.0;
	}
	var scale9End = unscaledSize - scale9Center - scale9Start;
	var size = unscaledSize * scale;
	var center = size - scale9Start - scale9End;
	if(pos <= scale9Start) {
		if(center < 0.0) {
			return pos * (scale9Start + scale9End + center) / (scale9Start + scale9End);
		}
		return pos;
	}
	if(pos >= scale9Start + scale9Center) {
		if(center < 0.0) {
			return (scale9Start + (pos - scale9Start - scale9Center)) * (scale9Start + scale9End + center) / (scale9Start + scale9End);
		}
		return scale9Start + center + (pos - scale9Start - scale9Center);
	}
	if(center < 0.0) {
		return scale9Start * (scale9Start + scale9End + center) / (scale9Start + scale9End);
	}
	return scale9Start + center * (pos - scale9Start) / scale9Center;
};
var openfl_display__$internal__$Context3DGraphics_PolygonFunctions = function() { };
$hxClasses["openfl.display._internal._Context3DGraphics.PolygonFunctions"] = openfl_display__$internal__$Context3DGraphics_PolygonFunctions;
openfl_display__$internal__$Context3DGraphics_PolygonFunctions.__name__ = "openfl.display._internal._Context3DGraphics.PolygonFunctions";
openfl_display__$internal__$Context3DGraphics_PolygonFunctions.getEllipseNumVertices = function(radiusX,radiusY) {
	var numVertices = Math.PI * (radiusX + radiusY) / 4.0 | 0;
	if(numVertices < 6) {
		numVertices = 6;
	}
	return numVertices;
};
openfl_display__$internal__$Context3DGraphics_PolygonFunctions.buildEllipseVerticesAndIndices = function(x,y,radiusX,radiusY,scaleX,scaleY,vertices,indices) {
	var numVertices = Math.PI * (radiusX * scaleX + radiusY * scaleY) / 4.0 | 0;
	if(numVertices < 6) {
		numVertices = 6;
	}
	var numVertices1 = numVertices;
	var angleDelta = 2.0 * Math.PI / numVertices1;
	var angle = 0.0;
	vertices.set_length(numVertices1 * 2);
	var _g = 0;
	var _g1 = numVertices1;
	while(_g < _g1) {
		var i = _g++;
		vertices.set(i * 2,Math.cos(angle) * radiusX + x + radiusX);
		vertices.set(i * 2 + 1,Math.sin(angle) * radiusY + y + radiusY);
		angle += angleDelta;
	}
	indices.set_length((numVertices1 - 2) * 3);
	var from = 0;
	var to = numVertices1 - 2;
	var _g = from;
	var _g1 = to;
	while(_g < _g1) {
		var i = _g++;
		indices.set(i * 3,0);
		indices.set(i * 3 + 1,i + 1);
		indices.set(i * 3 + 2,i + 2);
	}
};
openfl_display__$internal__$Context3DGraphics_PolygonFunctions.getRoundRectNumVertices = function(radiusX,radiusY) {
	var numVerticesPerCorner = Math.ceil(Math.PI * (radiusX + radiusY) / 8.0);
	if(numVerticesPerCorner < 3) {
		numVerticesPerCorner = 3;
	}
	return numVerticesPerCorner * 4;
};
openfl_display__$internal__$Context3DGraphics_PolygonFunctions.buildRoundRectVerticesAndIndices = function(x,y,width,height,radiusX,radiusY,scaleX,scaleY,vertices,indices) {
	var numVerticesPerCorner = Math.ceil(Math.PI * (radiusX * scaleX + radiusY * scaleY) / 8.0);
	if(numVerticesPerCorner < 3) {
		numVerticesPerCorner = 3;
	}
	var numVertices = numVerticesPerCorner * 4;
	var verticesPerCorner = numVertices / 4 | 0;
	var angleDelta = Math.PI / 2.0 / (verticesPerCorner - 1);
	var angle = 0.0;
	var offsetX = width - radiusX - radiusX;
	var offsetY = height - radiusY - radiusY;
	var horizontal = true;
	vertices.set_length(numVertices * 2);
	var j = 0;
	var len = verticesPerCorner;
	var _g = 0;
	while(_g < 4) {
		var i = _g++;
		while(j < len) {
			vertices.set(j * 2,offsetX + Math.cos(angle) * radiusX + x + radiusX);
			vertices.set(j * 2 + 1,offsetY + Math.sin(angle) * radiusY + y + radiusY);
			angle += angleDelta;
			++j;
		}
		angle -= angleDelta;
		if(horizontal) {
			if(offsetX == 0.0) {
				offsetX = width - radiusX - radiusX;
			} else {
				offsetX = 0.0;
			}
		} else if(offsetY == 0.0) {
			offsetY = height - radiusY - radiusY;
		} else {
			offsetY = 0.0;
		}
		horizontal = !horizontal;
		len += verticesPerCorner;
	}
	indices.set_length((numVertices - 2) * 3);
	var from = 0;
	var to = numVertices - 2;
	var _g = from;
	var _g1 = to;
	while(_g < _g1) {
		var i = _g++;
		indices.set(i * 3,0);
		indices.set(i * 3 + 1,i + 1);
		indices.set(i * 3 + 2,i + 2);
	}
};
var openfl_display__$internal_Context3DMaskShader = function() {
	if(this.__glFragmentSource == null) {
		this.__glFragmentSource = "varying vec2 openfl_TextureCoordv;\n\n\t\tuniform sampler2D openfl_Texture;\n\n\t\tvoid main(void) {\n\n\t\t\tvec4 color = texture2D (openfl_Texture, openfl_TextureCoordv);\n\n\t\t\tif (color.a == 0.0) {\n\n\t\t\t\tdiscard;\n\n\t\t\t} else {\n\n\t\t\t\tgl_FragColor = color;\n\n\t\t\t}\n\n\t\t}";
	}
	if(this.__glVertexSource == null) {
		this.__glVertexSource = "attribute vec4 openfl_Position;\n\t\tattribute vec2 openfl_TextureCoord;\n\t\tvarying vec2 openfl_TextureCoordv;\n\n\t\tuniform mat4 openfl_Matrix;\n\n\t\tvoid main(void) {\n\n\t\t\topenfl_TextureCoordv = openfl_TextureCoord;\n\n\t\t\tgl_Position = openfl_Matrix * openfl_Position;\n\n\t\t}";
	}
	openfl_display_Shader.call(this);
	this.__isGenerated = true;
	this.__initGL();
};
$hxClasses["openfl.display._internal.Context3DMaskShader"] = openfl_display__$internal_Context3DMaskShader;
openfl_display__$internal_Context3DMaskShader.__name__ = "openfl.display._internal.Context3DMaskShader";
openfl_display__$internal_Context3DMaskShader.__super__ = openfl_display_Shader;
openfl_display__$internal_Context3DMaskShader.prototype = $extend(openfl_display_Shader.prototype,{
	openfl_Position: null
	,openfl_TextureCoord: null
	,openfl_Matrix: null
	,openfl_Texture: null
	,__class__: openfl_display__$internal_Context3DMaskShader
});
var openfl_display__$internal_Context3DShape = function() { };
$hxClasses["openfl.display._internal.Context3DShape"] = openfl_display__$internal_Context3DShape;
openfl_display__$internal_Context3DShape.__name__ = "openfl.display._internal.Context3DShape";
openfl_display__$internal_Context3DShape.render = function(shape,renderer) {
	if(!shape.__renderable || shape.__worldAlpha <= 0) {
		return;
	}
	var graphics = shape.__graphics;
	if(graphics != null) {
		renderer.__setBlendMode(shape.__worldBlendMode);
		renderer.__pushMaskObject(shape);
		openfl_display__$internal_Context3DGraphics.render(graphics,renderer);
		if(graphics.__bitmap != null && graphics.__visible) {
			var context = renderer.__context3D;
			var shader = renderer.__initDisplayShader(shape.__worldShader);
			renderer.setShader(shader);
			renderer.applyBitmapData(graphics.__bitmap,true);
			var matrix = openfl_geom_Matrix.__pool.get();
			matrix.scale(1 / graphics.__bitmapScaleX,1 / graphics.__bitmapScaleY);
			matrix.concat(graphics.__worldTransform);
			renderer.applyMatrix(renderer.__getMatrix(matrix,1));
			openfl_geom_Matrix.__pool.release(matrix);
			renderer.applyAlpha(shape.__worldAlpha);
			renderer.applyColorTransform(shape.__worldColorTransform);
			renderer.updateShader();
			var vertexBuffer = graphics.__bitmap.getVertexBuffer(context);
			if(shader.__position != null) {
				context.setVertexBufferAt(shader.__position.index,vertexBuffer,0,3);
			}
			if(shader.__textureCoord != null) {
				context.setVertexBufferAt(shader.__textureCoord.index,vertexBuffer,3,2);
			}
			var indexBuffer = graphics.__bitmap.getIndexBuffer(context);
			context.drawTriangles(indexBuffer);
			renderer.__clearShader();
		}
		renderer.__popMaskObject(shape);
	}
};
openfl_display__$internal_Context3DShape.renderMask = function(shape,renderer) {
	var graphics = shape.__graphics;
	if(graphics != null) {
		openfl_display__$internal_Context3DGraphics.renderMask(graphics,renderer);
		if(graphics.__bitmap != null) {
			var context = renderer.__context3D;
			var shader = renderer.__maskShader;
			renderer.setShader(shader);
			renderer.applyBitmapData(graphics.__bitmap,true);
			renderer.applyMatrix(renderer.__getMatrix(graphics.__worldTransform,1));
			renderer.updateShader();
			var vertexBuffer = graphics.__bitmap.getVertexBuffer(context);
			if(shader.__position != null) {
				context.setVertexBufferAt(shader.__position.index,vertexBuffer,0,3);
			}
			if(shader.__textureCoord != null) {
				context.setVertexBufferAt(shader.__textureCoord.index,vertexBuffer,3,2);
			}
			var indexBuffer = graphics.__bitmap.getIndexBuffer(context);
			context.drawTriangles(indexBuffer);
			renderer.__clearShader();
		}
	}
};
var openfl_display__$internal_Context3DSimpleButton = function() { };
$hxClasses["openfl.display._internal.Context3DSimpleButton"] = openfl_display__$internal_Context3DSimpleButton;
openfl_display__$internal_Context3DSimpleButton.__name__ = "openfl.display._internal.Context3DSimpleButton";
openfl_display__$internal_Context3DSimpleButton.renderDrawable = function(simpleButton,renderer) {
	if(!simpleButton.__renderable || simpleButton.__worldAlpha <= 0 || simpleButton.__currentState == null) {
		return;
	}
	renderer.__pushMaskObject(simpleButton);
	renderer.__renderDrawable(simpleButton.__currentState);
	renderer.__popMaskObject(simpleButton);
	renderer.__renderEvent(simpleButton);
};
openfl_display__$internal_Context3DSimpleButton.renderDrawableMask = function(simpleButton,renderer) {
	if(simpleButton.__currentState == null) {
		return;
	}
	renderer.__renderDrawableMask(simpleButton.__currentState);
};
var openfl_display__$internal_Context3DTextField = function() { };
$hxClasses["openfl.display._internal.Context3DTextField"] = openfl_display__$internal_Context3DTextField;
openfl_display__$internal_Context3DTextField.__name__ = "openfl.display._internal.Context3DTextField";
openfl_display__$internal_Context3DTextField.render = function(textField,renderer) {
	renderer.__softwareRenderer.__pixelRatio = renderer.__pixelRatio;
	var renderer1 = renderer.__softwareRenderer;
	var transform = textField.__worldTransform;
	var textEngine = textField.__textEngine;
	var useTextBounds = !(textEngine.background || textEngine.border);
	var bounds = useTextBounds ? textEngine.textBounds : textEngine.bounds;
	var graphics = textField.__graphics;
	var cursorOffsetX = 0.0;
	if(textField.__dirty) {
		textField.__updateLayout();
		if(graphics.__bounds == null) {
			graphics.__bounds = new openfl_geom_Rectangle();
		}
		if(textField.get_text().length == 0) {
			var boundsWidth = textEngine.bounds.width - 4;
			var align = textField.get_defaultTextFormat().align;
			cursorOffsetX = align == 3 ? 0 : align == 4 ? boundsWidth : boundsWidth / 2;
			switch(align) {
			case 0:
				cursorOffsetX += textField.get_defaultTextFormat().leftMargin / 2;
				cursorOffsetX -= textField.get_defaultTextFormat().rightMargin / 2;
				cursorOffsetX += textField.get_defaultTextFormat().indent / 2;
				cursorOffsetX += textField.get_defaultTextFormat().blockIndent / 2;
				break;
			case 1:
				break;
			case 2:
				cursorOffsetX += textField.get_defaultTextFormat().leftMargin;
				cursorOffsetX += textField.get_defaultTextFormat().indent;
				cursorOffsetX += textField.get_defaultTextFormat().blockIndent;
				break;
			case 3:
				cursorOffsetX += textField.get_defaultTextFormat().leftMargin;
				cursorOffsetX += textField.get_defaultTextFormat().indent;
				cursorOffsetX += textField.get_defaultTextFormat().blockIndent;
				break;
			case 4:
				cursorOffsetX -= textField.get_defaultTextFormat().rightMargin;
				break;
			case 5:
				break;
			}
			if(useTextBounds) {
				bounds.y = textEngine.bounds.y;
				bounds.x = cursorOffsetX;
			}
		}
		graphics.__bounds.copyFrom(bounds);
	}
	var pixelRatio = renderer1.__pixelRatio;
	if(graphics.__bitmapScaleX != pixelRatio || graphics.__bitmapScaleY != pixelRatio) {
		graphics.__softwareDirty = true;
	}
	graphics.__update(renderer1.__worldTransform,pixelRatio);
	if(textField.__dirty || graphics.__softwareDirty) {
		var width = Math.round(graphics.__width * pixelRatio);
		var height = Math.round(graphics.__height * pixelRatio);
		if((textEngine.text == null || textEngine.text == "") && !textEngine.background && !textEngine.border && !textEngine.__hasFocus && (textEngine.type != 1 || !textEngine.selectable) || (textEngine.width <= 0 || textEngine.height <= 0) && textEngine.autoSize != 2) {
			textField.__graphics.__canvas = null;
			textField.__graphics.__context = null;
			textField.__graphics.__bitmap = null;
			textField.__graphics.__softwareDirty = false;
			textField.__graphics.set___dirty(false);
			textField.__dirty = false;
		} else {
			if(textField.__graphics.__canvas == null) {
				textField.__graphics.__canvas = window.document.createElement("canvas");
				textField.__graphics.__context = textField.__graphics.__canvas.getContext("2d");
			}
			openfl_display__$internal_CanvasTextField.context = graphics.__context;
			graphics.__canvas.width = width;
			graphics.__canvas.height = height;
			if(renderer1.__isDOM) {
				graphics.__canvas.style.width = Math.round(width / pixelRatio) + "px";
				graphics.__canvas.style.height = Math.round(height / pixelRatio) + "px";
			}
			var matrix = openfl_geom_Matrix.__pool.get();
			matrix.scale(pixelRatio,pixelRatio);
			matrix.concat(graphics.__renderTransform);
			openfl_display__$internal_CanvasTextField.context.setTransform(matrix.a,matrix.b,matrix.c,matrix.d,matrix.tx,matrix.ty);
			openfl_geom_Matrix.__pool.release(matrix);
			if(openfl_display__$internal_CanvasTextField.clearRect == null) {
				openfl_display__$internal_CanvasTextField.clearRect = (typeof navigator !== 'undefined' && typeof navigator['isCocoonJS'] !== 'undefined');
			}
			if(openfl_display__$internal_CanvasTextField.clearRect) {
				openfl_display__$internal_CanvasTextField.context.clearRect(0,0,graphics.__canvas.width,graphics.__canvas.height);
			}
			if(textEngine.text != null && textEngine.text != "" || textEngine.__hasFocus) {
				var text = textEngine.text;
				if(!renderer1.__allowSmoothing || textEngine.antiAliasType == 0 && textEngine.sharpness == 400) {
					graphics.__context.imageSmoothingEnabled = false;
				} else {
					graphics.__context.imageSmoothingEnabled = true;
				}
				if(textEngine.border || textEngine.background) {
					openfl_display__$internal_CanvasTextField.context.rect(0.5,0.5,bounds.width - 1,bounds.height - 1);
					if(textEngine.background) {
						var tmp = StringTools.hex(textEngine.backgroundColor & 16777215,6);
						openfl_display__$internal_CanvasTextField.context.fillStyle = "#" + tmp;
						openfl_display__$internal_CanvasTextField.context.fill();
					}
					if(textEngine.border) {
						openfl_display__$internal_CanvasTextField.context.lineWidth = 1;
						var tmp = StringTools.hex(textEngine.borderColor & 16777215,6);
						openfl_display__$internal_CanvasTextField.context.strokeStyle = "#" + tmp;
						openfl_display__$internal_CanvasTextField.context.stroke();
					}
				}
				openfl_display__$internal_CanvasTextField.context.textBaseline = "alphabetic";
				openfl_display__$internal_CanvasTextField.context.textAlign = "start";
				var scrollX = -textField.get_scrollH();
				var scrollY = 0.0;
				var _g = 0;
				var _g1 = textField.get_scrollV() - 1;
				while(_g < _g1) {
					var i = _g++;
					scrollY -= textEngine.lineHeights.get(i);
				}
				var advance;
				var group = textEngine.layoutGroups.iterator();
				while(group.hasNext()) {
					var group1 = group.next();
					if(group1.lineIndex < textField.get_scrollV() - 1) {
						continue;
					}
					if(group1.lineIndex > textEngine.get_bottomScrollV() - 1) {
						break;
					}
					var color = "#" + StringTools.hex(group1.format.color & 16777215,6);
					openfl_display__$internal_CanvasTextField.context.font = openfl_text__$internal_TextEngine.getFont(group1.format);
					openfl_display__$internal_CanvasTextField.context.fillStyle = color;
					openfl_display__$internal_CanvasTextField.context.fillText(text.substring(group1.startIndex,group1.endIndex),group1.offsetX + scrollX - bounds.x,group1.offsetY + group1.ascent + scrollY - bounds.y);
					if(textField.__caretIndex > -1 && textEngine.selectable) {
						if(textField.__selectionIndex == textField.__caretIndex) {
							if(textField.__showCursor && group1.startIndex <= textField.__caretIndex && group1.endIndex >= textField.__caretIndex) {
								advance = 0.0;
								var _g = 0;
								var _g1 = textField.__caretIndex - group1.startIndex;
								while(_g < _g1) {
									var i = _g++;
									if(group1.positions.length <= i) {
										break;
									}
									advance += group1.positions[i];
								}
								var scrollY1 = 0.0;
								var _g2 = textField.get_scrollV();
								var _g3 = group1.lineIndex + 1;
								while(_g2 < _g3) {
									var i1 = _g2++;
									scrollY1 += textEngine.lineHeights.get(i1 - 1);
								}
								openfl_display__$internal_CanvasTextField.context.beginPath();
								var tmp = StringTools.hex(group1.format.color & 16777215,6);
								openfl_display__$internal_CanvasTextField.context.strokeStyle = "#" + tmp;
								openfl_display__$internal_CanvasTextField.context.moveTo(group1.offsetX + advance - textField.get_scrollH() - bounds.x,scrollY1 + 2 - bounds.y);
								openfl_display__$internal_CanvasTextField.context.lineWidth = 1;
								openfl_display__$internal_CanvasTextField.context.lineTo(group1.offsetX + advance - textField.get_scrollH() - bounds.x,scrollY1 + openfl_text__$internal_TextEngine.getFormatHeight(textField.get_defaultTextFormat()) - 1 - bounds.y);
								openfl_display__$internal_CanvasTextField.context.stroke();
								openfl_display__$internal_CanvasTextField.context.closePath();
							}
						} else if(group1.startIndex <= textField.__caretIndex && group1.endIndex >= textField.__caretIndex || group1.startIndex <= textField.__selectionIndex && group1.endIndex >= textField.__selectionIndex || group1.startIndex > textField.__caretIndex && group1.endIndex < textField.__selectionIndex || group1.startIndex > textField.__selectionIndex && group1.endIndex < textField.__caretIndex) {
							var selectionStart = Math.min(textField.__selectionIndex,textField.__caretIndex) | 0;
							var selectionEnd = Math.max(textField.__selectionIndex,textField.__caretIndex) | 0;
							if(group1.startIndex > selectionStart) {
								selectionStart = group1.startIndex;
							}
							if(group1.endIndex < selectionEnd) {
								selectionEnd = group1.endIndex;
							}
							var end;
							var start = textField.getCharBoundaries(selectionStart);
							if(selectionEnd >= group1.endIndex) {
								end = textField.getCharBoundaries(group1.endIndex - 1);
								if(end != null) {
									end.x += end.width + 2;
								}
							} else {
								end = textField.getCharBoundaries(selectionEnd);
							}
							if(start != null && end != null) {
								openfl_display__$internal_CanvasTextField.context.fillStyle = "#000000";
								openfl_display__$internal_CanvasTextField.context.fillRect(start.x + scrollX - bounds.x,start.y + scrollY,end.x - start.x,group1.height);
								openfl_display__$internal_CanvasTextField.context.fillStyle = "#FFFFFF";
								openfl_display__$internal_CanvasTextField.context.fillText(text.substring(selectionStart,selectionEnd),scrollX + start.x - bounds.x,group1.offsetY + group1.ascent + scrollY);
							}
						}
					}
					if(group1.format.underline) {
						openfl_display__$internal_CanvasTextField.context.beginPath();
						openfl_display__$internal_CanvasTextField.context.strokeStyle = color;
						openfl_display__$internal_CanvasTextField.context.lineWidth = 1;
						var descent = Math.floor(group1.ascent * 0.185);
						var x = group1.offsetX + scrollX - bounds.x;
						var y = Math.ceil(group1.offsetY + scrollY + group1.ascent - bounds.y) + descent + 0.5;
						openfl_display__$internal_CanvasTextField.context.moveTo(x,y);
						openfl_display__$internal_CanvasTextField.context.lineTo(x + group1.width,y);
						openfl_display__$internal_CanvasTextField.context.stroke();
						openfl_display__$internal_CanvasTextField.context.closePath();
					}
					if(group1.format.strikethrough) {
						openfl_display__$internal_CanvasTextField.context.beginPath();
						openfl_display__$internal_CanvasTextField.context.strokeStyle = color;
						openfl_display__$internal_CanvasTextField.context.lineWidth = 1;
						var x1 = group1.offsetX + scrollX - bounds.x;
						var y1 = Math.ceil(group1.offsetY + scrollY + 2.0 * group1.ascent / 3.0 - bounds.y);
						openfl_display__$internal_CanvasTextField.context.moveTo(x1,y1);
						openfl_display__$internal_CanvasTextField.context.lineTo(x1 + group1.width,y1);
						openfl_display__$internal_CanvasTextField.context.stroke();
						openfl_display__$internal_CanvasTextField.context.closePath();
					}
				}
			} else {
				if(textEngine.border || textEngine.background) {
					if(textEngine.border) {
						openfl_display__$internal_CanvasTextField.context.rect(0.5,0.5,bounds.width - 1,bounds.height - 1);
					} else {
						openfl_display__$internal_CanvasTextField.context.rect(0,0,bounds.width,bounds.height);
					}
					if(textEngine.background) {
						var tmp = StringTools.hex(textEngine.backgroundColor & 16777215,6);
						openfl_display__$internal_CanvasTextField.context.fillStyle = "#" + tmp;
						openfl_display__$internal_CanvasTextField.context.fill();
					}
					if(textEngine.border) {
						openfl_display__$internal_CanvasTextField.context.lineWidth = 1;
						openfl_display__$internal_CanvasTextField.context.lineCap = "square";
						var tmp = StringTools.hex(textEngine.borderColor & 16777215,6);
						openfl_display__$internal_CanvasTextField.context.strokeStyle = "#" + tmp;
						openfl_display__$internal_CanvasTextField.context.stroke();
					}
				}
				if(textField.__caretIndex > -1 && textEngine.selectable && textField.__showCursor) {
					var scrollX = -textField.get_scrollH() + (useTextBounds ? 0 : cursorOffsetX);
					var scrollY = 0.0;
					var _g = 0;
					var _g1 = textField.get_scrollV() - 1;
					while(_g < _g1) {
						var i = _g++;
						scrollY += textEngine.lineHeights.get(i);
					}
					openfl_display__$internal_CanvasTextField.context.beginPath();
					var tmp = StringTools.hex(textField.get_defaultTextFormat().color & 16777215,6);
					openfl_display__$internal_CanvasTextField.context.strokeStyle = "#" + tmp;
					openfl_display__$internal_CanvasTextField.context.moveTo(scrollX + 2.5,scrollY + 2.5);
					openfl_display__$internal_CanvasTextField.context.lineWidth = 1;
					openfl_display__$internal_CanvasTextField.context.lineTo(scrollX + 2.5,scrollY + openfl_text__$internal_TextEngine.getFormatHeight(textField.get_defaultTextFormat()) - 1);
					openfl_display__$internal_CanvasTextField.context.stroke();
					openfl_display__$internal_CanvasTextField.context.closePath();
				}
			}
			if(graphics.__bitmap == null) {
				graphics.__bitmap = openfl_display_BitmapData.fromCanvas(graphics.__canvas);
			} else if(graphics.__bitmap.width != graphics.__canvas.width || graphics.__bitmap.height != graphics.__canvas.height) {
				var texture = graphics.__bitmap.__texture;
				if(texture != null) {
					texture.dispose();
				}
				graphics.__bitmap = openfl_display_BitmapData.fromCanvas(graphics.__canvas);
			} else {
				graphics.__bitmap.image.version++;
			}
			graphics.__bitmapScaleX = pixelRatio;
			graphics.__bitmapScaleY = pixelRatio;
			graphics.__visible = true;
			textField.__dirty = false;
			graphics.__softwareDirty = false;
			graphics.set___dirty(false);
		}
	}
	textField.__graphics.__hardwareDirty = false;
};
openfl_display__$internal_Context3DTextField.renderDrawable = function(textField,renderer) {
	renderer.__updateCacheBitmap(textField,false);
	if(textField.__cacheBitmap != null && !textField.__isCacheBitmapRender) {
		openfl_display__$internal_Context3DBitmap.render(textField.__cacheBitmap,renderer);
	} else {
		openfl_display__$internal_Context3DTextField.render(textField,renderer);
		if(!(textField.opaqueBackground == null && textField.__graphics == null)) {
			if(!(!textField.__renderable || textField.__worldAlpha <= 0)) {
				if(textField.opaqueBackground != null && !textField.__isCacheBitmapRender && textField.get_width() > 0 && textField.get_height() > 0) {
					renderer.__setBlendMode(textField.__worldBlendMode);
					renderer.__pushMaskObject(textField);
					var context = renderer.__context3D;
					var rect = openfl_geom_Rectangle.__pool.get();
					rect.setTo(0,0,textField.get_width(),textField.get_height());
					renderer.__pushMaskRect(rect,textField.__renderTransform);
					var color = textField.opaqueBackground;
					context.__clear(true,(color >>> 16 & 255) / 255,(color >>> 8 & 255) / 255,(color & 255) / 255,1,0,0,1);
					renderer.__popMaskRect();
					renderer.__popMaskObject(textField);
					openfl_geom_Rectangle.__pool.release(rect);
				}
				if(textField.__graphics != null) {
					openfl_display__$internal_Context3DShape.render(textField,renderer);
				}
			}
		}
	}
	renderer.__renderEvent(textField);
};
openfl_display__$internal_Context3DTextField.renderDrawableMask = function(textField,renderer) {
	openfl_display__$internal_Context3DTextField.renderMask(textField,renderer);
	openfl_display__$internal_Context3DDisplayObject.renderDrawableMask(textField,renderer);
};
openfl_display__$internal_Context3DTextField.renderMask = function(textField,renderer) {
	var renderer1 = renderer.__softwareRenderer;
	var transform = textField.__worldTransform;
	var textEngine = textField.__textEngine;
	var useTextBounds = !(textEngine.background || textEngine.border);
	var bounds = useTextBounds ? textEngine.textBounds : textEngine.bounds;
	var graphics = textField.__graphics;
	var cursorOffsetX = 0.0;
	if(textField.__dirty) {
		textField.__updateLayout();
		if(graphics.__bounds == null) {
			graphics.__bounds = new openfl_geom_Rectangle();
		}
		if(textField.get_text().length == 0) {
			var boundsWidth = textEngine.bounds.width - 4;
			var align = textField.get_defaultTextFormat().align;
			cursorOffsetX = align == 3 ? 0 : align == 4 ? boundsWidth : boundsWidth / 2;
			switch(align) {
			case 0:
				cursorOffsetX += textField.get_defaultTextFormat().leftMargin / 2;
				cursorOffsetX -= textField.get_defaultTextFormat().rightMargin / 2;
				cursorOffsetX += textField.get_defaultTextFormat().indent / 2;
				cursorOffsetX += textField.get_defaultTextFormat().blockIndent / 2;
				break;
			case 1:
				break;
			case 2:
				cursorOffsetX += textField.get_defaultTextFormat().leftMargin;
				cursorOffsetX += textField.get_defaultTextFormat().indent;
				cursorOffsetX += textField.get_defaultTextFormat().blockIndent;
				break;
			case 3:
				cursorOffsetX += textField.get_defaultTextFormat().leftMargin;
				cursorOffsetX += textField.get_defaultTextFormat().indent;
				cursorOffsetX += textField.get_defaultTextFormat().blockIndent;
				break;
			case 4:
				cursorOffsetX -= textField.get_defaultTextFormat().rightMargin;
				break;
			case 5:
				break;
			}
			if(useTextBounds) {
				bounds.y = textEngine.bounds.y;
				bounds.x = cursorOffsetX;
			}
		}
		graphics.__bounds.copyFrom(bounds);
	}
	var pixelRatio = renderer1.__pixelRatio;
	if(graphics.__bitmapScaleX != pixelRatio || graphics.__bitmapScaleY != pixelRatio) {
		graphics.__softwareDirty = true;
	}
	graphics.__update(renderer1.__worldTransform,pixelRatio);
	if(textField.__dirty || graphics.__softwareDirty) {
		var width = Math.round(graphics.__width * pixelRatio);
		var height = Math.round(graphics.__height * pixelRatio);
		if((textEngine.text == null || textEngine.text == "") && !textEngine.background && !textEngine.border && !textEngine.__hasFocus && (textEngine.type != 1 || !textEngine.selectable) || (textEngine.width <= 0 || textEngine.height <= 0) && textEngine.autoSize != 2) {
			textField.__graphics.__canvas = null;
			textField.__graphics.__context = null;
			textField.__graphics.__bitmap = null;
			textField.__graphics.__softwareDirty = false;
			textField.__graphics.set___dirty(false);
			textField.__dirty = false;
		} else {
			if(textField.__graphics.__canvas == null) {
				textField.__graphics.__canvas = window.document.createElement("canvas");
				textField.__graphics.__context = textField.__graphics.__canvas.getContext("2d");
			}
			openfl_display__$internal_CanvasTextField.context = graphics.__context;
			graphics.__canvas.width = width;
			graphics.__canvas.height = height;
			if(renderer1.__isDOM) {
				graphics.__canvas.style.width = Math.round(width / pixelRatio) + "px";
				graphics.__canvas.style.height = Math.round(height / pixelRatio) + "px";
			}
			var matrix = openfl_geom_Matrix.__pool.get();
			matrix.scale(pixelRatio,pixelRatio);
			matrix.concat(graphics.__renderTransform);
			openfl_display__$internal_CanvasTextField.context.setTransform(matrix.a,matrix.b,matrix.c,matrix.d,matrix.tx,matrix.ty);
			openfl_geom_Matrix.__pool.release(matrix);
			if(openfl_display__$internal_CanvasTextField.clearRect == null) {
				openfl_display__$internal_CanvasTextField.clearRect = (typeof navigator !== 'undefined' && typeof navigator['isCocoonJS'] !== 'undefined');
			}
			if(openfl_display__$internal_CanvasTextField.clearRect) {
				openfl_display__$internal_CanvasTextField.context.clearRect(0,0,graphics.__canvas.width,graphics.__canvas.height);
			}
			if(textEngine.text != null && textEngine.text != "" || textEngine.__hasFocus) {
				var text = textEngine.text;
				if(!renderer1.__allowSmoothing || textEngine.antiAliasType == 0 && textEngine.sharpness == 400) {
					graphics.__context.imageSmoothingEnabled = false;
				} else {
					graphics.__context.imageSmoothingEnabled = true;
				}
				if(textEngine.border || textEngine.background) {
					openfl_display__$internal_CanvasTextField.context.rect(0.5,0.5,bounds.width - 1,bounds.height - 1);
					if(textEngine.background) {
						var tmp = StringTools.hex(textEngine.backgroundColor & 16777215,6);
						openfl_display__$internal_CanvasTextField.context.fillStyle = "#" + tmp;
						openfl_display__$internal_CanvasTextField.context.fill();
					}
					if(textEngine.border) {
						openfl_display__$internal_CanvasTextField.context.lineWidth = 1;
						var tmp = StringTools.hex(textEngine.borderColor & 16777215,6);
						openfl_display__$internal_CanvasTextField.context.strokeStyle = "#" + tmp;
						openfl_display__$internal_CanvasTextField.context.stroke();
					}
				}
				openfl_display__$internal_CanvasTextField.context.textBaseline = "alphabetic";
				openfl_display__$internal_CanvasTextField.context.textAlign = "start";
				var scrollX = -textField.get_scrollH();
				var scrollY = 0.0;
				var _g = 0;
				var _g1 = textField.get_scrollV() - 1;
				while(_g < _g1) {
					var i = _g++;
					scrollY -= textEngine.lineHeights.get(i);
				}
				var advance;
				var group = textEngine.layoutGroups.iterator();
				while(group.hasNext()) {
					var group1 = group.next();
					if(group1.lineIndex < textField.get_scrollV() - 1) {
						continue;
					}
					if(group1.lineIndex > textEngine.get_bottomScrollV() - 1) {
						break;
					}
					var color = "#" + StringTools.hex(group1.format.color & 16777215,6);
					openfl_display__$internal_CanvasTextField.context.font = openfl_text__$internal_TextEngine.getFont(group1.format);
					openfl_display__$internal_CanvasTextField.context.fillStyle = color;
					openfl_display__$internal_CanvasTextField.context.fillText(text.substring(group1.startIndex,group1.endIndex),group1.offsetX + scrollX - bounds.x,group1.offsetY + group1.ascent + scrollY - bounds.y);
					if(textField.__caretIndex > -1 && textEngine.selectable) {
						if(textField.__selectionIndex == textField.__caretIndex) {
							if(textField.__showCursor && group1.startIndex <= textField.__caretIndex && group1.endIndex >= textField.__caretIndex) {
								advance = 0.0;
								var _g = 0;
								var _g1 = textField.__caretIndex - group1.startIndex;
								while(_g < _g1) {
									var i = _g++;
									if(group1.positions.length <= i) {
										break;
									}
									advance += group1.positions[i];
								}
								var scrollY1 = 0.0;
								var _g2 = textField.get_scrollV();
								var _g3 = group1.lineIndex + 1;
								while(_g2 < _g3) {
									var i1 = _g2++;
									scrollY1 += textEngine.lineHeights.get(i1 - 1);
								}
								openfl_display__$internal_CanvasTextField.context.beginPath();
								var tmp = StringTools.hex(group1.format.color & 16777215,6);
								openfl_display__$internal_CanvasTextField.context.strokeStyle = "#" + tmp;
								openfl_display__$internal_CanvasTextField.context.moveTo(group1.offsetX + advance - textField.get_scrollH() - bounds.x,scrollY1 + 2 - bounds.y);
								openfl_display__$internal_CanvasTextField.context.lineWidth = 1;
								openfl_display__$internal_CanvasTextField.context.lineTo(group1.offsetX + advance - textField.get_scrollH() - bounds.x,scrollY1 + openfl_text__$internal_TextEngine.getFormatHeight(textField.get_defaultTextFormat()) - 1 - bounds.y);
								openfl_display__$internal_CanvasTextField.context.stroke();
								openfl_display__$internal_CanvasTextField.context.closePath();
							}
						} else if(group1.startIndex <= textField.__caretIndex && group1.endIndex >= textField.__caretIndex || group1.startIndex <= textField.__selectionIndex && group1.endIndex >= textField.__selectionIndex || group1.startIndex > textField.__caretIndex && group1.endIndex < textField.__selectionIndex || group1.startIndex > textField.__selectionIndex && group1.endIndex < textField.__caretIndex) {
							var selectionStart = Math.min(textField.__selectionIndex,textField.__caretIndex) | 0;
							var selectionEnd = Math.max(textField.__selectionIndex,textField.__caretIndex) | 0;
							if(group1.startIndex > selectionStart) {
								selectionStart = group1.startIndex;
							}
							if(group1.endIndex < selectionEnd) {
								selectionEnd = group1.endIndex;
							}
							var end;
							var start = textField.getCharBoundaries(selectionStart);
							if(selectionEnd >= group1.endIndex) {
								end = textField.getCharBoundaries(group1.endIndex - 1);
								if(end != null) {
									end.x += end.width + 2;
								}
							} else {
								end = textField.getCharBoundaries(selectionEnd);
							}
							if(start != null && end != null) {
								openfl_display__$internal_CanvasTextField.context.fillStyle = "#000000";
								openfl_display__$internal_CanvasTextField.context.fillRect(start.x + scrollX - bounds.x,start.y + scrollY,end.x - start.x,group1.height);
								openfl_display__$internal_CanvasTextField.context.fillStyle = "#FFFFFF";
								openfl_display__$internal_CanvasTextField.context.fillText(text.substring(selectionStart,selectionEnd),scrollX + start.x - bounds.x,group1.offsetY + group1.ascent + scrollY);
							}
						}
					}
					if(group1.format.underline) {
						openfl_display__$internal_CanvasTextField.context.beginPath();
						openfl_display__$internal_CanvasTextField.context.strokeStyle = color;
						openfl_display__$internal_CanvasTextField.context.lineWidth = 1;
						var descent = Math.floor(group1.ascent * 0.185);
						var x = group1.offsetX + scrollX - bounds.x;
						var y = Math.ceil(group1.offsetY + scrollY + group1.ascent - bounds.y) + descent + 0.5;
						openfl_display__$internal_CanvasTextField.context.moveTo(x,y);
						openfl_display__$internal_CanvasTextField.context.lineTo(x + group1.width,y);
						openfl_display__$internal_CanvasTextField.context.stroke();
						openfl_display__$internal_CanvasTextField.context.closePath();
					}
					if(group1.format.strikethrough) {
						openfl_display__$internal_CanvasTextField.context.beginPath();
						openfl_display__$internal_CanvasTextField.context.strokeStyle = color;
						openfl_display__$internal_CanvasTextField.context.lineWidth = 1;
						var x1 = group1.offsetX + scrollX - bounds.x;
						var y1 = Math.ceil(group1.offsetY + scrollY + 2.0 * group1.ascent / 3.0 - bounds.y);
						openfl_display__$internal_CanvasTextField.context.moveTo(x1,y1);
						openfl_display__$internal_CanvasTextField.context.lineTo(x1 + group1.width,y1);
						openfl_display__$internal_CanvasTextField.context.stroke();
						openfl_display__$internal_CanvasTextField.context.closePath();
					}
				}
			} else {
				if(textEngine.border || textEngine.background) {
					if(textEngine.border) {
						openfl_display__$internal_CanvasTextField.context.rect(0.5,0.5,bounds.width - 1,bounds.height - 1);
					} else {
						openfl_display__$internal_CanvasTextField.context.rect(0,0,bounds.width,bounds.height);
					}
					if(textEngine.background) {
						var tmp = StringTools.hex(textEngine.backgroundColor & 16777215,6);
						openfl_display__$internal_CanvasTextField.context.fillStyle = "#" + tmp;
						openfl_display__$internal_CanvasTextField.context.fill();
					}
					if(textEngine.border) {
						openfl_display__$internal_CanvasTextField.context.lineWidth = 1;
						openfl_display__$internal_CanvasTextField.context.lineCap = "square";
						var tmp = StringTools.hex(textEngine.borderColor & 16777215,6);
						openfl_display__$internal_CanvasTextField.context.strokeStyle = "#" + tmp;
						openfl_display__$internal_CanvasTextField.context.stroke();
					}
				}
				if(textField.__caretIndex > -1 && textEngine.selectable && textField.__showCursor) {
					var scrollX = -textField.get_scrollH() + (useTextBounds ? 0 : cursorOffsetX);
					var scrollY = 0.0;
					var _g = 0;
					var _g1 = textField.get_scrollV() - 1;
					while(_g < _g1) {
						var i = _g++;
						scrollY += textEngine.lineHeights.get(i);
					}
					openfl_display__$internal_CanvasTextField.context.beginPath();
					var tmp = StringTools.hex(textField.get_defaultTextFormat().color & 16777215,6);
					openfl_display__$internal_CanvasTextField.context.strokeStyle = "#" + tmp;
					openfl_display__$internal_CanvasTextField.context.moveTo(scrollX + 2.5,scrollY + 2.5);
					openfl_display__$internal_CanvasTextField.context.lineWidth = 1;
					openfl_display__$internal_CanvasTextField.context.lineTo(scrollX + 2.5,scrollY + openfl_text__$internal_TextEngine.getFormatHeight(textField.get_defaultTextFormat()) - 1);
					openfl_display__$internal_CanvasTextField.context.stroke();
					openfl_display__$internal_CanvasTextField.context.closePath();
				}
			}
			if(graphics.__bitmap == null) {
				graphics.__bitmap = openfl_display_BitmapData.fromCanvas(graphics.__canvas);
			} else if(graphics.__bitmap.width != graphics.__canvas.width || graphics.__bitmap.height != graphics.__canvas.height) {
				var texture = graphics.__bitmap.__texture;
				if(texture != null) {
					texture.dispose();
				}
				graphics.__bitmap = openfl_display_BitmapData.fromCanvas(graphics.__canvas);
			} else {
				graphics.__bitmap.image.version++;
			}
			graphics.__bitmapScaleX = pixelRatio;
			graphics.__bitmapScaleY = pixelRatio;
			graphics.__visible = true;
			textField.__dirty = false;
			graphics.__softwareDirty = false;
			graphics.set___dirty(false);
		}
	}
	textField.__graphics.__hardwareDirty = false;
};
var openfl_display__$internal_Context3DTilemap = function() { };
$hxClasses["openfl.display._internal.Context3DTilemap"] = openfl_display__$internal_Context3DTilemap;
openfl_display__$internal_Context3DTilemap.__name__ = "openfl.display._internal.Context3DTilemap";
openfl_display__$internal_Context3DTilemap.buildBuffer = function(tilemap,renderer) {
	if(!tilemap.__renderable || tilemap.__group.__tiles.length == 0 || tilemap.__worldAlpha <= 0) {
		tilemap.__group.__dirty = false;
		return;
	}
	openfl_display__$internal_Context3DTilemap.numTiles = 0;
	openfl_display__$internal_Context3DTilemap.vertexBufferData = tilemap.__buffer != null ? tilemap.__buffer.vertexBufferData : null;
	openfl_display__$internal_Context3DTilemap.vertexDataPosition = 0;
	var rect = openfl_geom_Rectangle.__pool.get();
	var matrix = openfl_geom_Matrix.__pool.get();
	var parentTransform = openfl_geom_Matrix.__pool.get();
	openfl_display__$internal_Context3DTilemap.dataPerVertex = 4;
	if(tilemap.tileAlphaEnabled) {
		openfl_display__$internal_Context3DTilemap.dataPerVertex++;
	}
	if(tilemap.tileColorTransformEnabled) {
		openfl_display__$internal_Context3DTilemap.dataPerVertex += 8;
	}
	openfl_display__$internal_Context3DTilemap.buildBufferTileContainer(tilemap,tilemap.__group,renderer,parentTransform,tilemap.__tileset,tilemap.tileAlphaEnabled,tilemap.__worldAlpha,tilemap.tileColorTransformEnabled,tilemap.__worldColorTransform,null,rect,matrix);
	tilemap.__buffer.flushVertexBufferData();
	openfl_geom_Rectangle.__pool.release(rect);
	openfl_geom_Matrix.__pool.release(matrix);
	openfl_geom_Matrix.__pool.release(parentTransform);
};
openfl_display__$internal_Context3DTilemap.buildBufferTileContainer = function(tilemap,group,renderer,parentTransform,defaultTileset,alphaEnabled,worldAlpha,colorTransformEnabled,defaultColorTransform,cacheBitmapData,rect,matrix,isTopLevel) {
	if(isTopLevel == null) {
		isTopLevel = true;
	}
	var tileTransform = openfl_geom_Matrix.__pool.get();
	var roundPixels = renderer.__roundPixels;
	var tiles = group.__tiles;
	var length = group.__length;
	if(isTopLevel) {
		openfl_display__$internal_Context3DTilemap.resizeBuffer(tilemap,openfl_display__$internal_Context3DTilemap.numTiles + openfl_display__$internal_Context3DTilemap.getRecursiveLength(group));
	}
	var tileset;
	var alpha;
	var visible;
	var colorTransform = null;
	var id;
	var tileData;
	var tileRect;
	var bitmapData;
	var tileWidth;
	var tileHeight;
	var uvX;
	var uvY;
	var uvHeight;
	var uvWidth;
	var vertexOffset;
	var x;
	var y;
	var x2;
	var y2;
	var x3;
	var y3;
	var x4;
	var y4;
	var alphaPosition = 4;
	var ctPosition = alphaEnabled ? 5 : 4;
	var _g = 0;
	while(_g < tiles.length) {
		var tile = tiles[_g];
		++_g;
		tileTransform.setTo(1,0,0,1,-tile.get_originX(),-tile.get_originY());
		tileTransform.concat(tile.get_matrix());
		tileTransform.concat(parentTransform);
		if(roundPixels) {
			tileTransform.tx = Math.round(tileTransform.tx);
			tileTransform.ty = Math.round(tileTransform.ty);
		}
		tileset = tile.get_tileset() != null ? tile.get_tileset() : defaultTileset;
		alpha = tile.get_alpha() * worldAlpha;
		visible = tile.get_visible();
		tile.__dirty = false;
		if(!visible || alpha <= 0) {
			continue;
		}
		if(colorTransformEnabled) {
			if(tile.get_colorTransform() != null) {
				if(defaultColorTransform == null) {
					colorTransform = tile.get_colorTransform();
				} else {
					if(openfl_display__$internal_Context3DTilemap.cacheColorTransform == null) {
						openfl_display__$internal_Context3DTilemap.cacheColorTransform = new openfl_geom_ColorTransform();
					}
					colorTransform = openfl_display__$internal_Context3DTilemap.cacheColorTransform;
					colorTransform.redMultiplier = defaultColorTransform.redMultiplier * tile.get_colorTransform().redMultiplier;
					colorTransform.greenMultiplier = defaultColorTransform.greenMultiplier * tile.get_colorTransform().greenMultiplier;
					colorTransform.blueMultiplier = defaultColorTransform.blueMultiplier * tile.get_colorTransform().blueMultiplier;
					colorTransform.alphaMultiplier = defaultColorTransform.alphaMultiplier * tile.get_colorTransform().alphaMultiplier;
					colorTransform.redOffset = defaultColorTransform.redOffset + tile.get_colorTransform().redOffset;
					colorTransform.greenOffset = defaultColorTransform.greenOffset + tile.get_colorTransform().greenOffset;
					colorTransform.blueOffset = defaultColorTransform.blueOffset + tile.get_colorTransform().blueOffset;
					colorTransform.alphaOffset = defaultColorTransform.alphaOffset + tile.get_colorTransform().alphaOffset;
				}
			} else {
				colorTransform = defaultColorTransform;
			}
		}
		if(!alphaEnabled) {
			alpha = 1;
		}
		if(tile.__length > 0) {
			openfl_display__$internal_Context3DTilemap.buildBufferTileContainer(tilemap,tile,renderer,tileTransform,tileset,alphaEnabled,alpha,colorTransformEnabled,colorTransform,cacheBitmapData,rect,matrix,false);
		} else {
			if(tileset == null) {
				continue;
			}
			id = tile.get_id();
			bitmapData = tileset.__bitmapData;
			if(bitmapData == null) {
				continue;
			}
			if(id == -1) {
				tileRect = tile.__rect;
				if(tileRect == null || tileRect.width <= 0 || tileRect.height <= 0) {
					continue;
				}
				uvX = tileRect.x / bitmapData.width;
				uvY = tileRect.y / bitmapData.height;
				uvWidth = tileRect.get_right() / bitmapData.width;
				uvHeight = tileRect.get_bottom() / bitmapData.height;
			} else {
				tileData = tileset.__data[id];
				if(tileData == null) {
					continue;
				}
				rect.setTo(tileData.x,tileData.y,tileData.width,tileData.height);
				tileRect = rect;
				uvX = tileData.__uvX;
				uvY = tileData.__uvY;
				uvWidth = tileData.__uvWidth;
				uvHeight = tileData.__uvHeight;
			}
			tileWidth = tileRect.width;
			tileHeight = tileRect.height;
			x = 0 * tileTransform.a + 0 * tileTransform.c + tileTransform.tx;
			y = 0 * tileTransform.b + 0 * tileTransform.d + tileTransform.ty;
			x2 = tileWidth * tileTransform.a + 0 * tileTransform.c + tileTransform.tx;
			y2 = tileWidth * tileTransform.b + 0 * tileTransform.d + tileTransform.ty;
			x3 = 0 * tileTransform.a + tileHeight * tileTransform.c + tileTransform.tx;
			y3 = 0 * tileTransform.b + tileHeight * tileTransform.d + tileTransform.ty;
			x4 = tileWidth * tileTransform.a + tileHeight * tileTransform.c + tileTransform.tx;
			y4 = tileWidth * tileTransform.b + tileHeight * tileTransform.d + tileTransform.ty;
			vertexOffset = openfl_display__$internal_Context3DTilemap.vertexDataPosition;
			openfl_display__$internal_Context3DTilemap.vertexBufferData[vertexOffset] = x;
			openfl_display__$internal_Context3DTilemap.vertexBufferData[vertexOffset + 1] = y;
			openfl_display__$internal_Context3DTilemap.vertexBufferData[vertexOffset + 2] = uvX;
			openfl_display__$internal_Context3DTilemap.vertexBufferData[vertexOffset + 3] = uvY;
			openfl_display__$internal_Context3DTilemap.vertexBufferData[vertexOffset + openfl_display__$internal_Context3DTilemap.dataPerVertex] = x2;
			openfl_display__$internal_Context3DTilemap.vertexBufferData[vertexOffset + openfl_display__$internal_Context3DTilemap.dataPerVertex + 1] = y2;
			openfl_display__$internal_Context3DTilemap.vertexBufferData[vertexOffset + openfl_display__$internal_Context3DTilemap.dataPerVertex + 2] = uvWidth;
			openfl_display__$internal_Context3DTilemap.vertexBufferData[vertexOffset + openfl_display__$internal_Context3DTilemap.dataPerVertex + 3] = uvY;
			openfl_display__$internal_Context3DTilemap.vertexBufferData[vertexOffset + openfl_display__$internal_Context3DTilemap.dataPerVertex * 2] = x3;
			openfl_display__$internal_Context3DTilemap.vertexBufferData[vertexOffset + openfl_display__$internal_Context3DTilemap.dataPerVertex * 2 + 1] = y3;
			openfl_display__$internal_Context3DTilemap.vertexBufferData[vertexOffset + openfl_display__$internal_Context3DTilemap.dataPerVertex * 2 + 2] = uvX;
			openfl_display__$internal_Context3DTilemap.vertexBufferData[vertexOffset + openfl_display__$internal_Context3DTilemap.dataPerVertex * 2 + 3] = uvHeight;
			openfl_display__$internal_Context3DTilemap.vertexBufferData[vertexOffset + openfl_display__$internal_Context3DTilemap.dataPerVertex * 3] = x4;
			openfl_display__$internal_Context3DTilemap.vertexBufferData[vertexOffset + openfl_display__$internal_Context3DTilemap.dataPerVertex * 3 + 1] = y4;
			openfl_display__$internal_Context3DTilemap.vertexBufferData[vertexOffset + openfl_display__$internal_Context3DTilemap.dataPerVertex * 3 + 2] = uvWidth;
			openfl_display__$internal_Context3DTilemap.vertexBufferData[vertexOffset + openfl_display__$internal_Context3DTilemap.dataPerVertex * 3 + 3] = uvHeight;
			if(alphaEnabled) {
				openfl_display__$internal_Context3DTilemap.vertexBufferData[vertexOffset + openfl_display__$internal_Context3DTilemap.dataPerVertex * 0 + alphaPosition] = alpha;
				openfl_display__$internal_Context3DTilemap.vertexBufferData[vertexOffset + openfl_display__$internal_Context3DTilemap.dataPerVertex + alphaPosition] = alpha;
				openfl_display__$internal_Context3DTilemap.vertexBufferData[vertexOffset + openfl_display__$internal_Context3DTilemap.dataPerVertex * 2 + alphaPosition] = alpha;
				openfl_display__$internal_Context3DTilemap.vertexBufferData[vertexOffset + openfl_display__$internal_Context3DTilemap.dataPerVertex * 3 + alphaPosition] = alpha;
			}
			if(colorTransformEnabled) {
				if(colorTransform != null) {
					var _g1 = 0;
					while(_g1 < 4) {
						var i = _g1++;
						openfl_display__$internal_Context3DTilemap.vertexBufferData[vertexOffset + openfl_display__$internal_Context3DTilemap.dataPerVertex * i + ctPosition] = colorTransform.redMultiplier;
						openfl_display__$internal_Context3DTilemap.vertexBufferData[vertexOffset + openfl_display__$internal_Context3DTilemap.dataPerVertex * i + ctPosition + 1] = colorTransform.greenMultiplier;
						openfl_display__$internal_Context3DTilemap.vertexBufferData[vertexOffset + openfl_display__$internal_Context3DTilemap.dataPerVertex * i + ctPosition + 2] = colorTransform.blueMultiplier;
						openfl_display__$internal_Context3DTilemap.vertexBufferData[vertexOffset + openfl_display__$internal_Context3DTilemap.dataPerVertex * i + ctPosition + 3] = colorTransform.alphaMultiplier;
						openfl_display__$internal_Context3DTilemap.vertexBufferData[vertexOffset + openfl_display__$internal_Context3DTilemap.dataPerVertex * i + ctPosition + 4] = colorTransform.redOffset;
						openfl_display__$internal_Context3DTilemap.vertexBufferData[vertexOffset + openfl_display__$internal_Context3DTilemap.dataPerVertex * i + ctPosition + 5] = colorTransform.greenOffset;
						openfl_display__$internal_Context3DTilemap.vertexBufferData[vertexOffset + openfl_display__$internal_Context3DTilemap.dataPerVertex * i + ctPosition + 6] = colorTransform.blueOffset;
						openfl_display__$internal_Context3DTilemap.vertexBufferData[vertexOffset + openfl_display__$internal_Context3DTilemap.dataPerVertex * i + ctPosition + 7] = colorTransform.alphaOffset;
					}
				} else {
					var _g2 = 0;
					while(_g2 < 4) {
						var i1 = _g2++;
						openfl_display__$internal_Context3DTilemap.vertexBufferData[vertexOffset + openfl_display__$internal_Context3DTilemap.dataPerVertex * i1 + ctPosition] = 1;
						openfl_display__$internal_Context3DTilemap.vertexBufferData[vertexOffset + openfl_display__$internal_Context3DTilemap.dataPerVertex * i1 + ctPosition + 1] = 1;
						openfl_display__$internal_Context3DTilemap.vertexBufferData[vertexOffset + openfl_display__$internal_Context3DTilemap.dataPerVertex * i1 + ctPosition + 2] = 1;
						openfl_display__$internal_Context3DTilemap.vertexBufferData[vertexOffset + openfl_display__$internal_Context3DTilemap.dataPerVertex * i1 + ctPosition + 3] = 1;
						openfl_display__$internal_Context3DTilemap.vertexBufferData[vertexOffset + openfl_display__$internal_Context3DTilemap.dataPerVertex * i1 + ctPosition + 4] = 0;
						openfl_display__$internal_Context3DTilemap.vertexBufferData[vertexOffset + openfl_display__$internal_Context3DTilemap.dataPerVertex * i1 + ctPosition + 5] = 0;
						openfl_display__$internal_Context3DTilemap.vertexBufferData[vertexOffset + openfl_display__$internal_Context3DTilemap.dataPerVertex * i1 + ctPosition + 6] = 0;
						openfl_display__$internal_Context3DTilemap.vertexBufferData[vertexOffset + openfl_display__$internal_Context3DTilemap.dataPerVertex * i1 + ctPosition + 7] = 0;
					}
				}
			}
			openfl_display__$internal_Context3DTilemap.vertexDataPosition += openfl_display__$internal_Context3DTilemap.dataPerVertex * 4;
		}
	}
	group.__dirty = false;
	openfl_geom_Matrix.__pool.release(tileTransform);
};
openfl_display__$internal_Context3DTilemap.flush = function(tilemap,renderer,blendMode) {
	if(openfl_display__$internal_Context3DTilemap.currentShader == null) {
		openfl_display__$internal_Context3DTilemap.currentShader = renderer.__defaultDisplayShader;
	}
	if(openfl_display__$internal_Context3DTilemap.bufferPosition > openfl_display__$internal_Context3DTilemap.lastFlushedPosition && openfl_display__$internal_Context3DTilemap.currentBitmapData != null && openfl_display__$internal_Context3DTilemap.currentShader != null) {
		var shader = renderer.__initDisplayShader(openfl_display__$internal_Context3DTilemap.currentShader);
		renderer.setShader(shader);
		renderer.applyBitmapData(openfl_display__$internal_Context3DTilemap.currentBitmapData,tilemap.smoothing);
		renderer.applyMatrix(renderer.__getMatrix(tilemap.__renderTransform,1));
		if(tilemap.tileAlphaEnabled) {
			renderer.useAlphaArray();
		} else {
			renderer.applyAlpha(tilemap.__worldAlpha);
		}
		if(tilemap.tileBlendModeEnabled) {
			renderer.__setBlendMode(blendMode);
		}
		if(tilemap.tileColorTransformEnabled) {
			renderer.applyHasColorTransform(true);
			renderer.useColorTransformArray();
		} else {
			renderer.applyColorTransform(tilemap.__worldColorTransform);
		}
		renderer.updateShader();
		var vertexBuffer = tilemap.__buffer.vertexBuffer;
		var vertexBufferPosition = openfl_display__$internal_Context3DTilemap.lastFlushedPosition * openfl_display__$internal_Context3DTilemap.dataPerVertex * 4;
		var length = openfl_display__$internal_Context3DTilemap.bufferPosition - openfl_display__$internal_Context3DTilemap.lastFlushedPosition;
		while(openfl_display__$internal_Context3DTilemap.lastFlushedPosition < openfl_display__$internal_Context3DTilemap.bufferPosition) {
			length = Math.min(openfl_display__$internal_Context3DTilemap.bufferPosition - openfl_display__$internal_Context3DTilemap.lastFlushedPosition,openfl_display__$internal_Context3DTilemap.context.__quadIndexBufferElements) | 0;
			if(length <= 0) {
				break;
			}
			if(shader.__position != null) {
				openfl_display__$internal_Context3DTilemap.context.setVertexBufferAt(shader.__position.index,vertexBuffer,vertexBufferPosition,2);
			}
			if(shader.__textureCoord != null) {
				openfl_display__$internal_Context3DTilemap.context.setVertexBufferAt(shader.__textureCoord.index,vertexBuffer,vertexBufferPosition + 2,2);
			}
			if(tilemap.tileAlphaEnabled) {
				if(shader.__alpha != null) {
					openfl_display__$internal_Context3DTilemap.context.setVertexBufferAt(shader.__alpha.index,vertexBuffer,vertexBufferPosition + 4,1);
				}
			}
			if(tilemap.tileColorTransformEnabled) {
				var position = tilemap.tileAlphaEnabled ? 5 : 4;
				if(shader.__colorMultiplier != null) {
					openfl_display__$internal_Context3DTilemap.context.setVertexBufferAt(shader.__colorMultiplier.index,vertexBuffer,vertexBufferPosition + position,4);
				}
				if(shader.__colorOffset != null) {
					openfl_display__$internal_Context3DTilemap.context.setVertexBufferAt(shader.__colorOffset.index,vertexBuffer,vertexBufferPosition + position + 4,4);
				}
			}
			openfl_display__$internal_Context3DTilemap.context.drawTriangles(openfl_display__$internal_Context3DTilemap.context.__quadIndexBuffer,0,length * 2);
			openfl_display__$internal_Context3DTilemap.lastFlushedPosition += length;
		}
		renderer.__clearShader();
	}
	openfl_display__$internal_Context3DTilemap.lastUsedBitmapData = openfl_display__$internal_Context3DTilemap.currentBitmapData;
	openfl_display__$internal_Context3DTilemap.lastUsedShader = openfl_display__$internal_Context3DTilemap.currentShader;
};
openfl_display__$internal_Context3DTilemap.getRecursiveLength = function(tileContainer) {
	var tiles = tileContainer.__tiles;
	var totalLength = 0;
	var _g = 0;
	while(_g < tiles.length) {
		var tile = tiles[_g];
		++_g;
		if(tile.__length > 0) {
			totalLength += openfl_display__$internal_Context3DTilemap.getRecursiveLength(tile);
		} else {
			++totalLength;
		}
	}
	return totalLength;
};
openfl_display__$internal_Context3DTilemap.render = function(tilemap,renderer) {
	if(!tilemap.__renderable || tilemap.__worldAlpha <= 0) {
		return;
	}
	openfl_display__$internal_Context3DTilemap.context = renderer.__context3D;
	openfl_display__$internal_Context3DTilemap.buildBuffer(tilemap,renderer);
	if(openfl_display__$internal_Context3DTilemap.numTiles == 0) {
		return;
	}
	openfl_display__$internal_Context3DTilemap.bufferPosition = 0;
	openfl_display__$internal_Context3DTilemap.lastFlushedPosition = 0;
	openfl_display__$internal_Context3DTilemap.lastUsedBitmapData = null;
	openfl_display__$internal_Context3DTilemap.lastUsedShader = null;
	openfl_display__$internal_Context3DTilemap.currentBitmapData = null;
	openfl_display__$internal_Context3DTilemap.currentShader = null;
	openfl_display__$internal_Context3DTilemap.currentBlendMode = tilemap.__worldBlendMode;
	if(!tilemap.tileBlendModeEnabled) {
		renderer.__setBlendMode(openfl_display__$internal_Context3DTilemap.currentBlendMode);
	}
	renderer.__pushMaskObject(tilemap);
	var rect = openfl_geom_Rectangle.__pool.get();
	rect.setTo(0,0,tilemap.__width,tilemap.__height);
	renderer.__pushMaskRect(rect,tilemap.__renderTransform);
	openfl_display__$internal_Context3DTilemap.renderTileContainer(tilemap,renderer,tilemap.__group,tilemap.__worldShader,tilemap.__tileset,tilemap.__worldAlpha,tilemap.tileBlendModeEnabled,openfl_display__$internal_Context3DTilemap.currentBlendMode,null);
	openfl_display__$internal_Context3DTilemap.flush(tilemap,renderer,openfl_display__$internal_Context3DTilemap.currentBlendMode);
	renderer.__popMaskRect();
	renderer.__popMaskObject(tilemap);
	openfl_geom_Rectangle.__pool.release(rect);
};
openfl_display__$internal_Context3DTilemap.renderDrawable = function(tilemap,renderer) {
	renderer.__updateCacheBitmap(tilemap,false);
	if(tilemap.__cacheBitmap != null && !tilemap.__isCacheBitmapRender) {
		openfl_display__$internal_Context3DBitmap.render(tilemap.__cacheBitmap,renderer);
	} else {
		if(!(tilemap.opaqueBackground == null && tilemap.__graphics == null)) {
			if(!(!tilemap.__renderable || tilemap.__worldAlpha <= 0)) {
				if(tilemap.opaqueBackground != null && !tilemap.__isCacheBitmapRender && tilemap.get_width() > 0 && tilemap.get_height() > 0) {
					renderer.__setBlendMode(tilemap.__worldBlendMode);
					renderer.__pushMaskObject(tilemap);
					var context = renderer.__context3D;
					var rect = openfl_geom_Rectangle.__pool.get();
					rect.setTo(0,0,tilemap.get_width(),tilemap.get_height());
					renderer.__pushMaskRect(rect,tilemap.__renderTransform);
					var color = tilemap.opaqueBackground;
					context.__clear(true,(color >>> 16 & 255) / 255,(color >>> 8 & 255) / 255,(color & 255) / 255,1,0,0,1);
					renderer.__popMaskRect();
					renderer.__popMaskObject(tilemap);
					openfl_geom_Rectangle.__pool.release(rect);
				}
				if(tilemap.__graphics != null) {
					openfl_display__$internal_Context3DShape.render(tilemap,renderer);
				}
			}
		}
		openfl_display__$internal_Context3DTilemap.render(tilemap,renderer);
	}
	renderer.__renderEvent(tilemap);
};
openfl_display__$internal_Context3DTilemap.renderDrawableMask = function(tilemap,renderer) {
	if(!(tilemap.opaqueBackground == null && tilemap.__graphics == null)) {
		var tmp = tilemap.opaqueBackground != null && !tilemap.__isCacheBitmapRender && tilemap.get_width() > 0 && tilemap.get_height() > 0;
		if(tilemap.__graphics != null) {
			openfl_display__$internal_Context3DShape.renderMask(tilemap,renderer);
		}
	}
	openfl_display__$internal_Context3DTilemap.renderMask(tilemap,renderer);
};
openfl_display__$internal_Context3DTilemap.renderTileContainer = function(tilemap,renderer,group,defaultShader,defaultTileset,worldAlpha,blendModeEnabled,defaultBlendMode,cacheBitmapData) {
	var tiles = group.__tiles;
	var tileset;
	var alpha;
	var visible;
	var blendMode = null;
	var id;
	var tileData;
	var tileRect;
	var shader;
	var bitmapData;
	var _g = 0;
	while(_g < tiles.length) {
		var tile = tiles[_g];
		++_g;
		tileset = tile.get_tileset() != null ? tile.get_tileset() : defaultTileset;
		alpha = tile.get_alpha() * worldAlpha;
		visible = tile.get_visible();
		if(!visible || alpha <= 0) {
			continue;
		}
		shader = tile.get_shader() != null ? tile.get_shader() : defaultShader;
		if(blendModeEnabled) {
			blendMode = tile.__blendMode != null ? tile.__blendMode : defaultBlendMode;
		}
		if(tile.__length > 0) {
			openfl_display__$internal_Context3DTilemap.renderTileContainer(tilemap,renderer,tile,shader,tileset,alpha,blendModeEnabled,blendMode,cacheBitmapData);
		} else {
			if(tileset == null) {
				continue;
			}
			id = tile.get_id();
			bitmapData = tileset.__bitmapData;
			if(bitmapData == null) {
				continue;
			}
			if(id == -1) {
				tileRect = tile.__rect;
				if(tileRect == null || tileRect.width <= 0 || tileRect.height <= 0) {
					continue;
				}
			} else {
				tileData = tileset.__data[id];
				if(tileData == null) {
					continue;
				}
			}
			var numBuffer = openfl_display__$internal_Context3DTilemap.bufferPosition - openfl_display__$internal_Context3DTilemap.lastFlushedPosition;
			var forceFlush = numBuffer >= 16383;
			if(forceFlush || shader != openfl_display__$internal_Context3DTilemap.currentShader || bitmapData != openfl_display__$internal_Context3DTilemap.currentBitmapData && openfl_display__$internal_Context3DTilemap.currentBitmapData != null || openfl_display__$internal_Context3DTilemap.currentBlendMode != blendMode) {
				openfl_display__$internal_Context3DTilemap.flush(tilemap,renderer,openfl_display__$internal_Context3DTilemap.currentBlendMode);
			}
			openfl_display__$internal_Context3DTilemap.currentBitmapData = bitmapData;
			openfl_display__$internal_Context3DTilemap.currentShader = shader;
			openfl_display__$internal_Context3DTilemap.currentBlendMode = blendMode;
			openfl_display__$internal_Context3DTilemap.bufferPosition++;
		}
	}
};
openfl_display__$internal_Context3DTilemap.renderMask = function(tilemap,renderer) {
};
openfl_display__$internal_Context3DTilemap.resizeBuffer = function(tilemap,count) {
	openfl_display__$internal_Context3DTilemap.numTiles = count;
	if(tilemap.__buffer == null) {
		tilemap.__buffer = new openfl_display__$internal_Context3DBuffer(openfl_display__$internal_Context3DTilemap.context,openfl_display__$internal_Context3DElementType.QUADS,openfl_display__$internal_Context3DTilemap.numTiles,openfl_display__$internal_Context3DTilemap.dataPerVertex);
	} else {
		tilemap.__buffer.resize(openfl_display__$internal_Context3DTilemap.numTiles,openfl_display__$internal_Context3DTilemap.dataPerVertex);
	}
	openfl_display__$internal_Context3DTilemap.vertexBufferData = tilemap.__buffer.vertexBufferData;
};
var openfl_display__$internal_Context3DVideo = function() { };
$hxClasses["openfl.display._internal.Context3DVideo"] = openfl_display__$internal_Context3DVideo;
openfl_display__$internal_Context3DVideo.__name__ = "openfl.display._internal.Context3DVideo";
openfl_display__$internal_Context3DVideo.render = function(video,renderer) {
	if(!video.__renderable || video.__worldAlpha <= 0 || video.__stream == null) {
		return;
	}
	if(video.__stream.__video != null) {
		var context = renderer.__context3D;
		var gl = context.gl;
		var texture = video.__getTexture(context);
		if(texture == null) {
			return;
		}
		renderer.__setBlendMode(video.__worldBlendMode);
		renderer.__pushMaskObject(video);
		var shader = renderer.__initDisplayShader(video.__worldShader);
		renderer.setShader(shader);
		renderer.applyBitmapData(null,true,false);
		renderer.applyMatrix(renderer.__getMatrix(video.__renderTransform,1));
		renderer.applyAlpha(video.__worldAlpha);
		renderer.applyColorTransform(video.__worldColorTransform);
		if(shader.__textureSize != null) {
			openfl_display__$internal_Context3DVideo.__textureSizeValue[0] = video.__stream != null ? video.__stream.__video.videoWidth : 0;
			openfl_display__$internal_Context3DVideo.__textureSizeValue[1] = video.__stream != null ? video.__stream.__video.videoHeight : 0;
			shader.__textureSize.value = openfl_display__$internal_Context3DVideo.__textureSizeValue;
		}
		renderer.updateShader();
		context.setTextureAt(0,video.__getTexture(context));
		context.__flushGLTextures();
		gl.uniform1i(shader.__texture.index,0);
		if(video.smoothing) {
			gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_MAG_FILTER,gl.LINEAR);
			gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_MIN_FILTER,gl.LINEAR);
		} else {
			gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_MAG_FILTER,gl.NEAREST);
			gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_MIN_FILTER,gl.NEAREST);
		}
		var vertexBuffer = video.__getVertexBuffer(context);
		if(shader.__position != null) {
			context.setVertexBufferAt(shader.__position.index,vertexBuffer,0,3);
		}
		if(shader.__textureCoord != null) {
			context.setVertexBufferAt(shader.__textureCoord.index,vertexBuffer,3,2);
		}
		var indexBuffer = video.__getIndexBuffer(context);
		context.drawTriangles(indexBuffer);
		renderer.__clearShader();
		renderer.__popMaskObject(video);
	}
};
openfl_display__$internal_Context3DVideo.renderDrawable = function(video,renderer) {
	openfl_display__$internal_Context3DVideo.render(video,renderer);
	renderer.__renderEvent(video);
};
openfl_display__$internal_Context3DVideo.renderDrawableMask = function(video,renderer) {
	openfl_display__$internal_Context3DVideo.renderMask(video,renderer);
};
openfl_display__$internal_Context3DVideo.renderMask = function(video,renderer) {
	if(video.__stream == null) {
		return;
	}
	if(video.__stream.__video != null) {
		var context = renderer.__context3D;
		var gl = context.gl;
		var shader = renderer.__maskShader;
		renderer.setShader(shader);
		renderer.applyBitmapData(openfl_display__$internal_Context3DMaskShader.opaqueBitmapData,true);
		renderer.applyMatrix(renderer.__getMatrix(video.__renderTransform,1));
		renderer.updateShader();
		var vertexBuffer = video.__getVertexBuffer(context);
		if(shader.__position != null) {
			context.setVertexBufferAt(shader.__position.index,vertexBuffer,0,3);
		}
		if(shader.__textureCoord != null) {
			context.setVertexBufferAt(shader.__textureCoord.index,vertexBuffer,3,2);
		}
		var indexBuffer = video.__getIndexBuffer(context);
		context.drawTriangles(indexBuffer);
		renderer.__clearShader();
	}
};
var openfl_display__$internal_DOMBitmap = function() { };
$hxClasses["openfl.display._internal.DOMBitmap"] = openfl_display__$internal_DOMBitmap;
openfl_display__$internal_DOMBitmap.__name__ = "openfl.display._internal.DOMBitmap";
openfl_display__$internal_DOMBitmap.clear = function(bitmap,renderer) {
	openfl_display__$internal_DOMDisplayObject.clear(bitmap,renderer);
	if(bitmap.__image != null) {
		renderer.element.removeChild(bitmap.__image);
		bitmap.__image = null;
		bitmap.__style = null;
	}
	if(bitmap.__canvas != null) {
		renderer.element.removeChild(bitmap.__canvas);
		bitmap.__canvas = null;
		bitmap.__style = null;
	}
};
openfl_display__$internal_DOMBitmap.render = function(bitmap,renderer) {
	if(bitmap.stage != null && bitmap.__worldVisible && bitmap.__renderable && bitmap.__bitmapData != null && bitmap.__bitmapData.__isValid && bitmap.__bitmapData.readable) {
		renderer.__pushMaskObject(bitmap);
		if(bitmap.__bitmapData.image.buffer.__srcImage != null) {
			var src = bitmap.__bitmapData.image.buffer.__srcImage.src;
			if(StringTools.startsWith(src,"data:") || StringTools.startsWith(src,"blob:")) {
				openfl_display__$internal_DOMBitmap.renderCanvas(bitmap,renderer);
			} else {
				openfl_display__$internal_DOMBitmap.renderImage(bitmap,renderer);
			}
		} else {
			openfl_display__$internal_DOMBitmap.renderCanvas(bitmap,renderer);
		}
		renderer.__popMaskObject(bitmap);
	} else {
		openfl_display__$internal_DOMBitmap.clear(bitmap,renderer);
	}
};
openfl_display__$internal_DOMBitmap.renderCanvas = function(bitmap,renderer) {
	if(bitmap.__image != null) {
		renderer.element.removeChild(bitmap.__image);
		bitmap.__image = null;
	}
	if(bitmap.__canvas == null) {
		bitmap.__canvas = window.document.createElement("canvas");
		bitmap.__context = bitmap.__canvas.getContext("2d");
		bitmap.__imageVersion = -1;
		if(!renderer.__allowSmoothing || !bitmap.smoothing) {
			bitmap.__context.imageSmoothingEnabled = false;
		}
		renderer.__initializeElement(bitmap,bitmap.__canvas);
	}
	if(bitmap.__imageVersion != bitmap.__bitmapData.image.version) {
		lime__$internal_graphics_ImageCanvasUtil.convertToCanvas(bitmap.__bitmapData.image);
		bitmap.__canvas.width = bitmap.__bitmapData.width + 1;
		bitmap.__canvas.width = bitmap.__bitmapData.width;
		bitmap.__canvas.height = bitmap.__bitmapData.height;
		bitmap.__context.drawImage(bitmap.__bitmapData.image.buffer.__srcCanvas,0,0);
		bitmap.__imageVersion = bitmap.__bitmapData.image.version;
	}
	renderer.__updateClip(bitmap);
	renderer.__applyStyle(bitmap,true,true,true);
};
openfl_display__$internal_DOMBitmap.renderDrawable = function(bitmap,renderer) {
	renderer.__updateCacheBitmap(bitmap,false);
	if(bitmap.__cacheBitmap != null && !bitmap.__isCacheBitmapRender) {
		renderer.__renderDrawableClear(bitmap);
		bitmap.__cacheBitmap.stage = bitmap.stage;
		var bitmap1 = bitmap.__cacheBitmap;
		if(bitmap1.stage != null && bitmap1.__worldVisible && bitmap1.__renderable && bitmap1.__bitmapData != null && bitmap1.__bitmapData.__isValid && bitmap1.__bitmapData.readable) {
			renderer.__pushMaskObject(bitmap1);
			if(bitmap1.__bitmapData.image.buffer.__srcImage != null) {
				var src = bitmap1.__bitmapData.image.buffer.__srcImage.src;
				if(StringTools.startsWith(src,"data:") || StringTools.startsWith(src,"blob:")) {
					openfl_display__$internal_DOMBitmap.renderCanvas(bitmap1,renderer);
				} else {
					openfl_display__$internal_DOMBitmap.renderImage(bitmap1,renderer);
				}
			} else {
				openfl_display__$internal_DOMBitmap.renderCanvas(bitmap1,renderer);
			}
			renderer.__popMaskObject(bitmap1);
		} else {
			openfl_display__$internal_DOMBitmap.clear(bitmap1,renderer);
		}
	} else {
		var tmp = bitmap.opaqueBackground != null && !bitmap.__isCacheBitmapRender && bitmap.get_width() > 0 && bitmap.get_height() > 0;
		var graphics = bitmap.__graphics;
		if(bitmap.stage != null && bitmap.__worldVisible && bitmap.__renderable && graphics != null) {
			openfl_display__$internal_CanvasGraphics.render(graphics,renderer.__canvasRenderer);
			if(graphics.__softwareDirty || bitmap.__worldAlphaChanged || bitmap.__canvas != graphics.__canvas) {
				if(graphics.__canvas != null) {
					if(bitmap.__canvas != graphics.__canvas) {
						if(bitmap.__canvas != null) {
							renderer.element.removeChild(bitmap.__canvas);
						}
						bitmap.__canvas = graphics.__canvas;
						bitmap.__context = graphics.__context;
						renderer.__initializeElement(bitmap,bitmap.__canvas);
					}
				} else {
					openfl_display__$internal_DOMShape.clear(bitmap,renderer);
				}
			}
			if(bitmap.__canvas != null) {
				renderer.__pushMaskObject(bitmap);
				var cacheTransform = bitmap.__renderTransform;
				bitmap.__renderTransform = graphics.__worldTransform;
				if(graphics.__transformDirty) {
					graphics.__transformDirty = false;
					bitmap.__renderTransformChanged = true;
				}
				renderer.__updateClip(bitmap);
				renderer.__applyStyle(bitmap,true,true,true);
				bitmap.__renderTransform = cacheTransform;
				renderer.__popMaskObject(bitmap);
			}
		} else {
			openfl_display__$internal_DOMShape.clear(bitmap,renderer);
		}
		if(bitmap.stage != null && bitmap.__worldVisible && bitmap.__renderable && bitmap.__bitmapData != null && bitmap.__bitmapData.__isValid && bitmap.__bitmapData.readable) {
			renderer.__pushMaskObject(bitmap);
			if(bitmap.__bitmapData.image.buffer.__srcImage != null) {
				var src = bitmap.__bitmapData.image.buffer.__srcImage.src;
				if(StringTools.startsWith(src,"data:") || StringTools.startsWith(src,"blob:")) {
					openfl_display__$internal_DOMBitmap.renderCanvas(bitmap,renderer);
				} else {
					openfl_display__$internal_DOMBitmap.renderImage(bitmap,renderer);
				}
			} else {
				openfl_display__$internal_DOMBitmap.renderCanvas(bitmap,renderer);
			}
			renderer.__popMaskObject(bitmap);
		} else {
			openfl_display__$internal_DOMBitmap.clear(bitmap,renderer);
		}
	}
	renderer.__renderEvent(bitmap);
};
openfl_display__$internal_DOMBitmap.renderDrawableClear = function(bitmap,renderer) {
	openfl_display__$internal_DOMBitmap.clear(bitmap,renderer);
};
openfl_display__$internal_DOMBitmap.renderImage = function(bitmap,renderer) {
	if(bitmap.__canvas != null) {
		renderer.element.removeChild(bitmap.__canvas);
		bitmap.__canvas = null;
	}
	if(bitmap.__image == null) {
		bitmap.__image = window.document.createElement("img");
		bitmap.__image.crossOrigin = "Anonymous";
		bitmap.__image.src = bitmap.__bitmapData.image.buffer.__srcImage.src;
		renderer.__initializeElement(bitmap,bitmap.__image);
	}
	renderer.__updateClip(bitmap);
	renderer.__applyStyle(bitmap,true,true,true);
};
var openfl_display__$internal_DOMDisplayObject = function() { };
$hxClasses["openfl.display._internal.DOMDisplayObject"] = openfl_display__$internal_DOMDisplayObject;
openfl_display__$internal_DOMDisplayObject.__name__ = "openfl.display._internal.DOMDisplayObject";
openfl_display__$internal_DOMDisplayObject.clear = function(displayObject,renderer) {
	if(displayObject.__cacheBitmap != null) {
		openfl_display__$internal_DOMBitmap.clear(displayObject.__cacheBitmap,renderer);
	}
	openfl_display__$internal_DOMShape.clear(displayObject,renderer);
};
openfl_display__$internal_DOMDisplayObject.render = function(displayObject,renderer) {
	var tmp = displayObject.opaqueBackground != null && !displayObject.__isCacheBitmapRender && displayObject.get_width() > 0 && displayObject.get_height() > 0;
	var graphics = displayObject.__graphics;
	if(displayObject.stage != null && displayObject.__worldVisible && displayObject.__renderable && graphics != null) {
		openfl_display__$internal_CanvasGraphics.render(graphics,renderer.__canvasRenderer);
		if(graphics.__softwareDirty || displayObject.__worldAlphaChanged || displayObject.__canvas != graphics.__canvas) {
			if(graphics.__canvas != null) {
				if(displayObject.__canvas != graphics.__canvas) {
					if(displayObject.__canvas != null) {
						renderer.element.removeChild(displayObject.__canvas);
					}
					displayObject.__canvas = graphics.__canvas;
					displayObject.__context = graphics.__context;
					renderer.__initializeElement(displayObject,displayObject.__canvas);
				}
			} else {
				openfl_display__$internal_DOMShape.clear(displayObject,renderer);
			}
		}
		if(displayObject.__canvas != null) {
			renderer.__pushMaskObject(displayObject);
			var cacheTransform = displayObject.__renderTransform;
			displayObject.__renderTransform = graphics.__worldTransform;
			if(graphics.__transformDirty) {
				graphics.__transformDirty = false;
				displayObject.__renderTransformChanged = true;
			}
			renderer.__updateClip(displayObject);
			renderer.__applyStyle(displayObject,true,true,true);
			displayObject.__renderTransform = cacheTransform;
			renderer.__popMaskObject(displayObject);
		}
	} else {
		openfl_display__$internal_DOMShape.clear(displayObject,renderer);
	}
};
openfl_display__$internal_DOMDisplayObject.renderDrawable = function(displayObject,renderer) {
	renderer.__updateCacheBitmap(displayObject,false);
	if(displayObject.__cacheBitmap != null && !displayObject.__isCacheBitmapRender) {
		renderer.__renderDrawableClear(displayObject);
		displayObject.__cacheBitmap.stage = displayObject.stage;
		var bitmap = displayObject.__cacheBitmap;
		if(bitmap.stage != null && bitmap.__worldVisible && bitmap.__renderable && bitmap.__bitmapData != null && bitmap.__bitmapData.__isValid && bitmap.__bitmapData.readable) {
			renderer.__pushMaskObject(bitmap);
			if(bitmap.__bitmapData.image.buffer.__srcImage != null) {
				var src = bitmap.__bitmapData.image.buffer.__srcImage.src;
				if(StringTools.startsWith(src,"data:") || StringTools.startsWith(src,"blob:")) {
					openfl_display__$internal_DOMBitmap.renderCanvas(bitmap,renderer);
				} else {
					openfl_display__$internal_DOMBitmap.renderImage(bitmap,renderer);
				}
			} else {
				openfl_display__$internal_DOMBitmap.renderCanvas(bitmap,renderer);
			}
			renderer.__popMaskObject(bitmap);
		} else {
			openfl_display__$internal_DOMBitmap.clear(bitmap,renderer);
		}
	} else {
		var tmp = displayObject.opaqueBackground != null && !displayObject.__isCacheBitmapRender && displayObject.get_width() > 0 && displayObject.get_height() > 0;
		var graphics = displayObject.__graphics;
		if(displayObject.stage != null && displayObject.__worldVisible && displayObject.__renderable && graphics != null) {
			openfl_display__$internal_CanvasGraphics.render(graphics,renderer.__canvasRenderer);
			if(graphics.__softwareDirty || displayObject.__worldAlphaChanged || displayObject.__canvas != graphics.__canvas) {
				if(graphics.__canvas != null) {
					if(displayObject.__canvas != graphics.__canvas) {
						if(displayObject.__canvas != null) {
							renderer.element.removeChild(displayObject.__canvas);
						}
						displayObject.__canvas = graphics.__canvas;
						displayObject.__context = graphics.__context;
						renderer.__initializeElement(displayObject,displayObject.__canvas);
					}
				} else {
					openfl_display__$internal_DOMShape.clear(displayObject,renderer);
				}
			}
			if(displayObject.__canvas != null) {
				renderer.__pushMaskObject(displayObject);
				var cacheTransform = displayObject.__renderTransform;
				displayObject.__renderTransform = graphics.__worldTransform;
				if(graphics.__transformDirty) {
					graphics.__transformDirty = false;
					displayObject.__renderTransformChanged = true;
				}
				renderer.__updateClip(displayObject);
				renderer.__applyStyle(displayObject,true,true,true);
				displayObject.__renderTransform = cacheTransform;
				renderer.__popMaskObject(displayObject);
			}
		} else {
			openfl_display__$internal_DOMShape.clear(displayObject,renderer);
		}
	}
	renderer.__renderEvent(displayObject);
};
openfl_display__$internal_DOMDisplayObject.renderDrawableClear = function(displayObject,renderer) {
	openfl_display__$internal_DOMDisplayObject.clear(displayObject,renderer);
};
var openfl_display__$internal_DOMDisplayObjectContainer = function() { };
$hxClasses["openfl.display._internal.DOMDisplayObjectContainer"] = openfl_display__$internal_DOMDisplayObjectContainer;
openfl_display__$internal_DOMDisplayObjectContainer.__name__ = "openfl.display._internal.DOMDisplayObjectContainer";
openfl_display__$internal_DOMDisplayObjectContainer.renderDrawable = function(displayObjectContainer,renderer) {
	var orphan = displayObjectContainer.__removedChildren.iterator();
	while(orphan.hasNext()) {
		var orphan1 = orphan.next();
		if(orphan1.stage == null) {
			renderer.__renderDrawable(orphan1);
		}
	}
	var orphan = displayObjectContainer.__removedChildren.iterator();
	while(orphan.hasNext()) {
		var orphan1 = orphan.next();
		if(orphan1.stage == null) {
			orphan1.__cleanup();
		}
	}
	displayObjectContainer.__removedChildren.set_length(0);
	openfl_display__$internal_DOMDisplayObject.renderDrawable(displayObjectContainer,renderer);
	if(displayObjectContainer.__cacheBitmap != null && !displayObjectContainer.__isCacheBitmapRender) {
		var _g = 0;
		var _g1 = displayObjectContainer.__children;
		while(_g < _g1.length) {
			var child = _g1[_g];
			++_g;
			renderer.__renderDrawableClear(child);
		}
		openfl_display__$internal_DOMShape.clear(displayObjectContainer,renderer);
		displayObjectContainer.__cacheBitmap.stage = displayObjectContainer.stage;
		return;
	}
	renderer.__pushMaskObject(displayObjectContainer);
	if(renderer.__stage != null) {
		var _g = 0;
		var _g1 = displayObjectContainer.__children;
		while(_g < _g1.length) {
			var child = _g1[_g];
			++_g;
			renderer.__renderDrawable(child);
			child.__renderDirty = false;
		}
		displayObjectContainer.__renderDirty = false;
	} else {
		var _g = 0;
		var _g1 = displayObjectContainer.__children;
		while(_g < _g1.length) {
			var child = _g1[_g];
			++_g;
			renderer.__renderDrawable(child);
		}
	}
	renderer.__popMaskObject(displayObjectContainer);
};
openfl_display__$internal_DOMDisplayObjectContainer.renderDrawableClear = function(displayObjectContainer,renderer) {
	var orphan = displayObjectContainer.__removedChildren.iterator();
	while(orphan.hasNext()) {
		var orphan1 = orphan.next();
		if(orphan1.stage == null) {
			renderer.__renderDrawableClear(orphan1);
		}
	}
	var orphan = displayObjectContainer.__removedChildren.iterator();
	while(orphan.hasNext()) {
		var orphan1 = orphan.next();
		if(orphan1.stage == null) {
			orphan1.__cleanup();
		}
	}
	displayObjectContainer.__removedChildren.set_length(0);
	var _g = 0;
	var _g1 = displayObjectContainer.__children;
	while(_g < _g1.length) {
		var child = _g1[_g];
		++_g;
		renderer.__renderDrawableClear(child);
	}
	openfl_display__$internal_DOMDisplayObject.clear(displayObjectContainer,renderer);
};
var openfl_display__$internal_DOMShape = function() { };
$hxClasses["openfl.display._internal.DOMShape"] = openfl_display__$internal_DOMShape;
openfl_display__$internal_DOMShape.__name__ = "openfl.display._internal.DOMShape";
openfl_display__$internal_DOMShape.clear = function(shape,renderer) {
	if(shape.__canvas != null) {
		renderer.element.removeChild(shape.__canvas);
		shape.__canvas = null;
		shape.__style = null;
	}
};
openfl_display__$internal_DOMShape.render = function(shape,renderer) {
	var graphics = shape.__graphics;
	if(shape.stage != null && shape.__worldVisible && shape.__renderable && graphics != null) {
		openfl_display__$internal_CanvasGraphics.render(graphics,renderer.__canvasRenderer);
		if(graphics.__softwareDirty || shape.__worldAlphaChanged || shape.__canvas != graphics.__canvas) {
			if(graphics.__canvas != null) {
				if(shape.__canvas != graphics.__canvas) {
					if(shape.__canvas != null) {
						renderer.element.removeChild(shape.__canvas);
					}
					shape.__canvas = graphics.__canvas;
					shape.__context = graphics.__context;
					renderer.__initializeElement(shape,shape.__canvas);
				}
			} else {
				openfl_display__$internal_DOMShape.clear(shape,renderer);
			}
		}
		if(shape.__canvas != null) {
			renderer.__pushMaskObject(shape);
			var cacheTransform = shape.__renderTransform;
			shape.__renderTransform = graphics.__worldTransform;
			if(graphics.__transformDirty) {
				graphics.__transformDirty = false;
				shape.__renderTransformChanged = true;
			}
			renderer.__updateClip(shape);
			renderer.__applyStyle(shape,true,true,true);
			shape.__renderTransform = cacheTransform;
			renderer.__popMaskObject(shape);
		}
	} else {
		openfl_display__$internal_DOMShape.clear(shape,renderer);
	}
};
var openfl_display__$internal_DOMSimpleButton = function() { };
$hxClasses["openfl.display._internal.DOMSimpleButton"] = openfl_display__$internal_DOMSimpleButton;
openfl_display__$internal_DOMSimpleButton.__name__ = "openfl.display._internal.DOMSimpleButton";
openfl_display__$internal_DOMSimpleButton.renderDrawable = function(simpleButton,renderer) {
	renderer.__pushMaskObject(simpleButton);
	var previousState = simpleButton.__previousStates.iterator();
	while(previousState.hasNext()) {
		var previousState1 = previousState.next();
		renderer.__renderDrawable(previousState1);
	}
	simpleButton.__previousStates.set_length(0);
	if(simpleButton.__currentState != null) {
		if(simpleButton.__currentState.stage != simpleButton.stage) {
			simpleButton.__currentState.__setStageReference(simpleButton.stage);
		}
		renderer.__renderDrawable(simpleButton.__currentState);
	}
	renderer.__popMaskObject(simpleButton);
	renderer.__renderEvent(simpleButton);
};
openfl_display__$internal_DOMSimpleButton.renderDrawableClear = function(simpleButton,renderer) {
	openfl_display__$internal_DOMDisplayObject.renderDrawableClear(simpleButton,renderer);
};
var openfl_display__$internal_DOMTextField = function() { };
$hxClasses["openfl.display._internal.DOMTextField"] = openfl_display__$internal_DOMTextField;
openfl_display__$internal_DOMTextField.__name__ = "openfl.display._internal.DOMTextField";
openfl_display__$internal_DOMTextField.clear = function(textField,renderer) {
	openfl_display__$internal_DOMDisplayObject.clear(textField,renderer);
	if(textField.__div != null) {
		renderer.element.removeChild(textField.__div);
		textField.__div = null;
		textField.__style = null;
	}
};
openfl_display__$internal_DOMTextField.measureText = function(textField) {
	var textEngine = textField.__textEngine;
	var div = textField.__div;
	if(div == null) {
		div = window.document.createElement("div");
		var _this_r = new RegExp("\n","g".split("u").join(""));
		div.innerHTML = textEngine.text.replace(_this_r,"<br>");
		div.style.setProperty("font",openfl_text__$internal_TextEngine.getFont(textField.__textFormat),null);
		div.style.setProperty("pointer-events","none",null);
		div.style.position = "absolute";
		div.style.top = "110%";
		window.document.body.appendChild(div);
	}
	textEngine.__measuredWidth = div.clientWidth;
	if(textField.__div == null) {
		div.style.width = Std.string(textEngine.width - 4) + "px";
	}
	textEngine.__measuredHeight = div.clientHeight;
	if(textField.__div == null) {
		window.document.body.removeChild(div);
	}
};
openfl_display__$internal_DOMTextField.render = function(textField,renderer) {
	var textEngine = textField.__textEngine;
	if(textField.stage != null && textField.__worldVisible && textField.__renderable) {
		if(textField.__dirty || textField.__renderTransformChanged || textField.__div == null) {
			if(textEngine.text != "" || textEngine.background || textEngine.border || textEngine.type == 1) {
				textField.__updateLayout();
				if(textField.__div == null) {
					textField.__div = window.document.createElement("div");
					renderer.__initializeElement(textField,textField.__div);
					textField.__style.setProperty("outline","none",null);
					textField.__div.addEventListener("input",function(event) {
						event.preventDefault();
						if(textField.get_htmlText() != textField.__div.innerHTML) {
							textField.set_htmlText(textField.__div.innerHTML);
							var textField1 = textField.__displayAsPassword;
							textField.__dirty = false;
							textField.dispatchEvent(new openfl_events_TextEvent("textInput",false,false,textField.get_htmlText()));
						}
					},true);
				}
				if(!textEngine.wordWrap) {
					textField.__style.setProperty("white-space","nowrap",null);
				} else {
					textField.__style.setProperty("word-wrap","break-word",null);
				}
				textField.__style.setProperty("overflow","hidden",null);
				if(textEngine.selectable) {
					textField.__style.setProperty("cursor","text",null);
					textField.__style.setProperty("-webkit-user-select","text",null);
					textField.__style.setProperty("-moz-user-select","text",null);
					textField.__style.setProperty("-ms-user-select","text",null);
					textField.__style.setProperty("-o-user-select","text",null);
				} else {
					textField.__style.setProperty("cursor","inherit",null);
				}
				var div = textField.__div;
				div.contentEditable = textEngine.type == 1;
				var style = textField.__style;
				if(textEngine.background) {
					style.setProperty("background-color","#" + StringTools.hex(textEngine.backgroundColor & 16777215,6),null);
				} else {
					style.removeProperty("background-color");
				}
				var w = textEngine.width;
				var h = textEngine.height;
				var scale = 1;
				var text = "";
				if(textField.__isHTML) {
					textField.__updateText(openfl_text__$internal_HTMLParser.parse(textField.__text,textField.get_multiline(),textField.__styleSheet,textField.__textFormat,textField.__textEngine.textFormatRanges));
				}
				var useTextBounds = !(textEngine.background || textEngine.border);
				var bounds = useTextBounds ? textEngine.textBounds : textEngine.bounds;
				var scrollX = -textField.get_scrollH();
				var scrollY = 0.0;
				var group = textEngine.layoutGroups.iterator();
				while(group.hasNext()) {
					var group1 = group.next();
					if(group1.lineIndex < textField.get_scrollV() - 1) {
						continue;
					}
					if(group1.lineIndex > textEngine.get_bottomScrollV() - 1) {
						break;
					}
					text += "<div style=\"";
					if(group1.format.font != null) {
						text += "font: " + openfl_text__$internal_TextEngine.getFont(group1.format) + "; ";
					}
					if(group1.format.color != null) {
						text += "color: #" + StringTools.hex(group1.format.color & 16777215,6) + "; ";
					}
					if(group1.format.underline == true) {
						text += "text-decoration: underline; ";
					}
					if(group1.format.align != null) {
						switch(group1.format.align) {
						case 0:
							text += "text-align: center; ";
							break;
						case 2:
							text += "text-align: justify; ";
							break;
						case 4:
							text += "text-align: right; ";
							break;
						default:
							text += "text-align: left; ";
						}
					}
					if(group1.format.leftMargin != null) {
						text += "padding-left: " + group1.format.leftMargin * scale + "px; ";
					}
					if(group1.format.rightMargin != null) {
						text += "padding-right: " + group1.format.rightMargin * scale + "px; ";
					}
					if(group1.format.indent != null) {
						text += "text-indent: " + group1.format.indent * scale + "px; ";
					}
					var tmp = group1.format.leading != null;
					var x = group1.offsetX + scrollX;
					var y = group1.offsetY + scrollY + 3;
					text += "left: " + x + "px; top: " + y + "px; vertical-align: top; position: absolute;\">";
					if(group1.format.url != null && group1.format.url != "") {
						var anchorStyle = "text-decoration: underline; ";
						if(group1.format.color != null) {
							anchorStyle += "color: #" + StringTools.hex(group1.format.color & 16777215,6) + "; ";
						}
						text += "<a style='" + anchorStyle + "' href='" + group1.format.url + "' target='" + group1.format.target + "'>";
					}
					if(!textField.__isHTML) {
						text += StringTools.replace(StringTools.htmlEscape(textEngine.text.substring(group1.startIndex,group1.endIndex))," ","&nbsp;");
					} else {
						text += StringTools.replace(textEngine.text.substring(group1.startIndex,group1.endIndex)," ","&nbsp;");
					}
					if(group1.format.url != null && group1.format.url != "") {
						text += "</a>";
					}
					text += "</div>";
				}
				if(textEngine.border) {
					style.setProperty("border","solid 1px #" + StringTools.hex(textEngine.borderColor & 16777215,6),null);
					textField.__renderTransform.translate(-1,-1);
					textField.__renderTransformChanged = true;
					textField.__transformDirty = true;
				} else if(style.border != "") {
					style.removeProperty("border");
					textField.__renderTransformChanged = true;
				}
				style.setProperty("width",w + "px",null);
				style.setProperty("height",h + "px",null);
				textField.__div.innerHTML = text;
				textField.__dirty = false;
			} else if(textField.__div != null) {
				renderer.element.removeChild(textField.__div);
				textField.__div = null;
			}
		}
		if(textField.__div != null) {
			var old = renderer.__roundPixels;
			renderer.__roundPixels = true;
			renderer.__updateClip(textField);
			renderer.__applyStyle(textField,true,true,true);
			renderer.__roundPixels = old;
		}
	} else {
		openfl_display__$internal_DOMTextField.clear(textField,renderer);
	}
};
openfl_display__$internal_DOMTextField.renderDrawable = function(textField,renderer) {
	textField.__domRender = true;
	renderer.__updateCacheBitmap(textField,textField.__forceCachedBitmapUpdate);
	textField.__forceCachedBitmapUpdate = false;
	textField.__domRender = false;
	if(textField.__cacheBitmap != null && !textField.__isCacheBitmapRender) {
		renderer.__renderDrawableClear(textField);
		textField.__cacheBitmap.stage = textField.stage;
		var bitmap = textField.__cacheBitmap;
		if(bitmap.stage != null && bitmap.__worldVisible && bitmap.__renderable && bitmap.__bitmapData != null && bitmap.__bitmapData.__isValid && bitmap.__bitmapData.readable) {
			renderer.__pushMaskObject(bitmap);
			if(bitmap.__bitmapData.image.buffer.__srcImage != null) {
				var src = bitmap.__bitmapData.image.buffer.__srcImage.src;
				if(StringTools.startsWith(src,"data:") || StringTools.startsWith(src,"blob:")) {
					openfl_display__$internal_DOMBitmap.renderCanvas(bitmap,renderer);
				} else {
					openfl_display__$internal_DOMBitmap.renderImage(bitmap,renderer);
				}
			} else {
				openfl_display__$internal_DOMBitmap.renderCanvas(bitmap,renderer);
			}
			renderer.__popMaskObject(bitmap);
		} else {
			openfl_display__$internal_DOMBitmap.clear(bitmap,renderer);
		}
	} else {
		if(textField.__renderedOnCanvasWhileOnDOM) {
			textField.__renderedOnCanvasWhileOnDOM = false;
			if(textField.__isHTML && textField.__htmlText != null) {
				textField.__updateText(textField.__htmlText);
				textField.__dirty = true;
				textField.__layoutDirty = true;
				if(!textField.__renderDirty) {
					textField.__renderDirty = true;
					textField.__setParentRenderDirty();
				}
			}
		}
		var textField1 = textField;
		var textEngine = textField1.__textEngine;
		if(textField1.stage != null && textField1.__worldVisible && textField1.__renderable) {
			if(textField1.__dirty || textField1.__renderTransformChanged || textField1.__div == null) {
				if(textEngine.text != "" || textEngine.background || textEngine.border || textEngine.type == 1) {
					textField1.__updateLayout();
					if(textField1.__div == null) {
						textField1.__div = window.document.createElement("div");
						renderer.__initializeElement(textField1,textField1.__div);
						textField1.__style.setProperty("outline","none",null);
						textField1.__div.addEventListener("input",function(event) {
							event.preventDefault();
							if(textField1.get_htmlText() != textField1.__div.innerHTML) {
								textField1.set_htmlText(textField1.__div.innerHTML);
								var textField = textField1.__displayAsPassword;
								textField1.__dirty = false;
								textField1.dispatchEvent(new openfl_events_TextEvent("textInput",false,false,textField1.get_htmlText()));
							}
						},true);
					}
					if(!textEngine.wordWrap) {
						textField1.__style.setProperty("white-space","nowrap",null);
					} else {
						textField1.__style.setProperty("word-wrap","break-word",null);
					}
					textField1.__style.setProperty("overflow","hidden",null);
					if(textEngine.selectable) {
						textField1.__style.setProperty("cursor","text",null);
						textField1.__style.setProperty("-webkit-user-select","text",null);
						textField1.__style.setProperty("-moz-user-select","text",null);
						textField1.__style.setProperty("-ms-user-select","text",null);
						textField1.__style.setProperty("-o-user-select","text",null);
					} else {
						textField1.__style.setProperty("cursor","inherit",null);
					}
					var div = textField1.__div;
					div.contentEditable = textEngine.type == 1;
					var style = textField1.__style;
					if(textEngine.background) {
						style.setProperty("background-color","#" + StringTools.hex(textEngine.backgroundColor & 16777215,6),null);
					} else {
						style.removeProperty("background-color");
					}
					var w = textEngine.width;
					var h = textEngine.height;
					var scale = 1;
					var text = "";
					if(textField1.__isHTML) {
						textField1.__updateText(openfl_text__$internal_HTMLParser.parse(textField1.__text,textField1.get_multiline(),textField1.__styleSheet,textField1.__textFormat,textField1.__textEngine.textFormatRanges));
					}
					var useTextBounds = !(textEngine.background || textEngine.border);
					var bounds = useTextBounds ? textEngine.textBounds : textEngine.bounds;
					var scrollX = -textField1.get_scrollH();
					var scrollY = 0.0;
					var group = textEngine.layoutGroups.iterator();
					while(group.hasNext()) {
						var group1 = group.next();
						if(group1.lineIndex < textField1.get_scrollV() - 1) {
							continue;
						}
						if(group1.lineIndex > textEngine.get_bottomScrollV() - 1) {
							break;
						}
						text += "<div style=\"";
						if(group1.format.font != null) {
							text += "font: " + openfl_text__$internal_TextEngine.getFont(group1.format) + "; ";
						}
						if(group1.format.color != null) {
							text += "color: #" + StringTools.hex(group1.format.color & 16777215,6) + "; ";
						}
						if(group1.format.underline == true) {
							text += "text-decoration: underline; ";
						}
						if(group1.format.align != null) {
							switch(group1.format.align) {
							case 0:
								text += "text-align: center; ";
								break;
							case 2:
								text += "text-align: justify; ";
								break;
							case 4:
								text += "text-align: right; ";
								break;
							default:
								text += "text-align: left; ";
							}
						}
						if(group1.format.leftMargin != null) {
							text += "padding-left: " + group1.format.leftMargin * scale + "px; ";
						}
						if(group1.format.rightMargin != null) {
							text += "padding-right: " + group1.format.rightMargin * scale + "px; ";
						}
						if(group1.format.indent != null) {
							text += "text-indent: " + group1.format.indent * scale + "px; ";
						}
						var tmp = group1.format.leading != null;
						var x = group1.offsetX + scrollX;
						var y = group1.offsetY + scrollY + 3;
						text += "left: " + x + "px; top: " + y + "px; vertical-align: top; position: absolute;\">";
						if(group1.format.url != null && group1.format.url != "") {
							var anchorStyle = "text-decoration: underline; ";
							if(group1.format.color != null) {
								anchorStyle += "color: #" + StringTools.hex(group1.format.color & 16777215,6) + "; ";
							}
							text += "<a style='" + anchorStyle + "' href='" + group1.format.url + "' target='" + group1.format.target + "'>";
						}
						if(!textField1.__isHTML) {
							text += StringTools.replace(StringTools.htmlEscape(textEngine.text.substring(group1.startIndex,group1.endIndex))," ","&nbsp;");
						} else {
							text += StringTools.replace(textEngine.text.substring(group1.startIndex,group1.endIndex)," ","&nbsp;");
						}
						if(group1.format.url != null && group1.format.url != "") {
							text += "</a>";
						}
						text += "</div>";
					}
					if(textEngine.border) {
						style.setProperty("border","solid 1px #" + StringTools.hex(textEngine.borderColor & 16777215,6),null);
						textField1.__renderTransform.translate(-1,-1);
						textField1.__renderTransformChanged = true;
						textField1.__transformDirty = true;
					} else if(style.border != "") {
						style.removeProperty("border");
						textField1.__renderTransformChanged = true;
					}
					style.setProperty("width",w + "px",null);
					style.setProperty("height",h + "px",null);
					textField1.__div.innerHTML = text;
					textField1.__dirty = false;
				} else if(textField1.__div != null) {
					renderer.element.removeChild(textField1.__div);
					textField1.__div = null;
				}
			}
			if(textField1.__div != null) {
				var old = renderer.__roundPixels;
				renderer.__roundPixels = true;
				renderer.__updateClip(textField1);
				renderer.__applyStyle(textField1,true,true,true);
				renderer.__roundPixels = old;
			}
		} else {
			openfl_display__$internal_DOMTextField.clear(textField1,renderer);
		}
	}
	renderer.__renderEvent(textField);
};
openfl_display__$internal_DOMTextField.renderDrawableClear = function(textField,renderer) {
	openfl_display__$internal_DOMTextField.clear(textField,renderer);
};
openfl_display__$internal_DOMTextField.__getAttributeMatch = function(regex) {
	if(regex.matched(2) != null) {
		return regex.matched(2);
	} else {
		return regex.matched(3);
	}
};
var openfl_display__$internal_DOMTilemap = function() { };
$hxClasses["openfl.display._internal.DOMTilemap"] = openfl_display__$internal_DOMTilemap;
openfl_display__$internal_DOMTilemap.__name__ = "openfl.display._internal.DOMTilemap";
openfl_display__$internal_DOMTilemap.clear = function(tilemap,renderer) {
	openfl_display__$internal_DOMDisplayObject.clear(tilemap,renderer);
	if(tilemap.__canvas != null) {
		renderer.element.removeChild(tilemap.__canvas);
		tilemap.__canvas = null;
		tilemap.__style = null;
	}
};
openfl_display__$internal_DOMTilemap.render = function(tilemap,renderer) {
	if(tilemap.stage != null && tilemap.__worldVisible && tilemap.__renderable && tilemap.__group.__tiles.length > 0) {
		if(tilemap.__canvas == null) {
			tilemap.__canvas = window.document.createElement("canvas");
			tilemap.__context = tilemap.__canvas.getContext("2d");
			renderer.__initializeElement(tilemap,tilemap.__canvas);
		}
		tilemap.__canvas.width = tilemap.__width;
		tilemap.__canvas.height = tilemap.__height;
		renderer.__canvasRenderer.context = tilemap.__context;
		var cacheRenderTransform = tilemap.__renderTransform;
		tilemap.__renderTransform = openfl_geom_Matrix.__identity;
		var renderer1 = renderer.__canvasRenderer;
		if(!(tilemap.opaqueBackground == null && tilemap.__graphics == null)) {
			if(tilemap.__renderable) {
				var alpha = renderer1.__getAlpha(tilemap.__worldAlpha);
				if(!(alpha <= 0)) {
					if(tilemap.opaqueBackground != null && !tilemap.__isCacheBitmapRender && tilemap.get_width() > 0 && tilemap.get_height() > 0) {
						renderer1.__setBlendMode(tilemap.__worldBlendMode);
						renderer1.__pushMaskObject(tilemap);
						var context = renderer1.context;
						renderer1.setTransform(tilemap.__renderTransform,context);
						var color = tilemap.opaqueBackground;
						context.fillStyle = "rgb(" + (color >>> 16 & 255) + "," + (color >>> 8 & 255) + "," + (color & 255) + ")";
						context.fillRect(0,0,tilemap.get_width(),tilemap.get_height());
						renderer1.__popMaskObject(tilemap);
					}
					if(tilemap.__graphics != null) {
						if(tilemap.__renderable) {
							var alpha = renderer1.__getAlpha(tilemap.__worldAlpha);
							if(!(alpha <= 0)) {
								var graphics = tilemap.__graphics;
								if(graphics != null) {
									openfl_display__$internal_CanvasGraphics.render(graphics,renderer1);
									var width = graphics.__width;
									var height = graphics.__height;
									var canvas = graphics.__canvas;
									if(canvas != null && graphics.__visible && width >= 1 && height >= 1) {
										var transform = graphics.__worldTransform;
										var context = renderer1.context;
										var scrollRect = tilemap.__scrollRect;
										if(scrollRect == null || scrollRect.width > 0 && scrollRect.height > 0) {
											renderer1.__setBlendMode(tilemap.__worldBlendMode);
											renderer1.__pushMaskObject(tilemap);
											context.globalAlpha = alpha;
											var renderTransform = openfl_geom_Matrix.__pool.get();
											renderTransform.scale(1 / graphics.__bitmapScaleX,1 / graphics.__bitmapScaleY);
											renderTransform.concat(transform);
											renderer1.setTransform(renderTransform,context);
											context.drawImage(canvas,0,0,width,height);
											openfl_geom_Matrix.__pool.release(renderTransform);
											renderer1.__popMaskObject(tilemap);
										}
									}
								}
							}
						}
					}
				}
			}
		}
		var renderer1 = renderer.__canvasRenderer;
		if(!(!tilemap.__renderable || tilemap.__group.__tiles.length == 0)) {
			var alpha = renderer1.__getAlpha(tilemap.__worldAlpha);
			if(!(alpha <= 0)) {
				var context = renderer1.context;
				renderer1.__setBlendMode(tilemap.__worldBlendMode);
				renderer1.__pushMaskObject(tilemap);
				var rect = openfl_geom_Rectangle.__pool.get();
				rect.setTo(0,0,tilemap.__width,tilemap.__height);
				renderer1.__pushMaskRect(rect,tilemap.__renderTransform);
				if(!renderer1.__allowSmoothing || !tilemap.smoothing) {
					context.imageSmoothingEnabled = false;
				}
				openfl_display__$internal_CanvasTilemap.renderTileContainer(tilemap.__group,renderer1,tilemap.__renderTransform,tilemap.__tileset,renderer1.__allowSmoothing && tilemap.smoothing,tilemap.tileAlphaEnabled,alpha,tilemap.tileBlendModeEnabled,tilemap.__worldBlendMode,null,null,rect);
				if(!renderer1.__allowSmoothing || !tilemap.smoothing) {
					context.imageSmoothingEnabled = true;
				}
				renderer1.__popMaskRect();
				renderer1.__popMaskObject(tilemap);
				openfl_geom_Rectangle.__pool.release(rect);
			}
		}
		tilemap.__renderTransform = cacheRenderTransform;
		renderer.__canvasRenderer.context = null;
		renderer.__updateClip(tilemap);
		renderer.__applyStyle(tilemap,true,false,true);
	} else {
		openfl_display__$internal_DOMTilemap.clear(tilemap,renderer);
	}
};
openfl_display__$internal_DOMTilemap.renderDrawable = function(tilemap,renderer) {
	renderer.__updateCacheBitmap(tilemap,false);
	if(tilemap.__cacheBitmap != null && !tilemap.__isCacheBitmapRender) {
		renderer.__renderDrawableClear(tilemap);
		tilemap.__cacheBitmap.stage = tilemap.stage;
		var bitmap = tilemap.__cacheBitmap;
		if(bitmap.stage != null && bitmap.__worldVisible && bitmap.__renderable && bitmap.__bitmapData != null && bitmap.__bitmapData.__isValid && bitmap.__bitmapData.readable) {
			renderer.__pushMaskObject(bitmap);
			if(bitmap.__bitmapData.image.buffer.__srcImage != null) {
				var src = bitmap.__bitmapData.image.buffer.__srcImage.src;
				if(StringTools.startsWith(src,"data:") || StringTools.startsWith(src,"blob:")) {
					openfl_display__$internal_DOMBitmap.renderCanvas(bitmap,renderer);
				} else {
					openfl_display__$internal_DOMBitmap.renderImage(bitmap,renderer);
				}
			} else {
				openfl_display__$internal_DOMBitmap.renderCanvas(bitmap,renderer);
			}
			renderer.__popMaskObject(bitmap);
		} else {
			openfl_display__$internal_DOMBitmap.clear(bitmap,renderer);
		}
	} else if(tilemap.stage != null && tilemap.__worldVisible && tilemap.__renderable && tilemap.__group.__tiles.length > 0) {
		if(tilemap.__canvas == null) {
			tilemap.__canvas = window.document.createElement("canvas");
			tilemap.__context = tilemap.__canvas.getContext("2d");
			renderer.__initializeElement(tilemap,tilemap.__canvas);
		}
		tilemap.__canvas.width = tilemap.__width;
		tilemap.__canvas.height = tilemap.__height;
		renderer.__canvasRenderer.context = tilemap.__context;
		var cacheRenderTransform = tilemap.__renderTransform;
		tilemap.__renderTransform = openfl_geom_Matrix.__identity;
		var renderer1 = renderer.__canvasRenderer;
		if(!(tilemap.opaqueBackground == null && tilemap.__graphics == null)) {
			if(tilemap.__renderable) {
				var alpha = renderer1.__getAlpha(tilemap.__worldAlpha);
				if(!(alpha <= 0)) {
					if(tilemap.opaqueBackground != null && !tilemap.__isCacheBitmapRender && tilemap.get_width() > 0 && tilemap.get_height() > 0) {
						renderer1.__setBlendMode(tilemap.__worldBlendMode);
						renderer1.__pushMaskObject(tilemap);
						var context = renderer1.context;
						renderer1.setTransform(tilemap.__renderTransform,context);
						var color = tilemap.opaqueBackground;
						context.fillStyle = "rgb(" + (color >>> 16 & 255) + "," + (color >>> 8 & 255) + "," + (color & 255) + ")";
						context.fillRect(0,0,tilemap.get_width(),tilemap.get_height());
						renderer1.__popMaskObject(tilemap);
					}
					if(tilemap.__graphics != null) {
						if(tilemap.__renderable) {
							var alpha = renderer1.__getAlpha(tilemap.__worldAlpha);
							if(!(alpha <= 0)) {
								var graphics = tilemap.__graphics;
								if(graphics != null) {
									openfl_display__$internal_CanvasGraphics.render(graphics,renderer1);
									var width = graphics.__width;
									var height = graphics.__height;
									var canvas = graphics.__canvas;
									if(canvas != null && graphics.__visible && width >= 1 && height >= 1) {
										var transform = graphics.__worldTransform;
										var context = renderer1.context;
										var scrollRect = tilemap.__scrollRect;
										if(scrollRect == null || scrollRect.width > 0 && scrollRect.height > 0) {
											renderer1.__setBlendMode(tilemap.__worldBlendMode);
											renderer1.__pushMaskObject(tilemap);
											context.globalAlpha = alpha;
											var renderTransform = openfl_geom_Matrix.__pool.get();
											renderTransform.scale(1 / graphics.__bitmapScaleX,1 / graphics.__bitmapScaleY);
											renderTransform.concat(transform);
											renderer1.setTransform(renderTransform,context);
											context.drawImage(canvas,0,0,width,height);
											openfl_geom_Matrix.__pool.release(renderTransform);
											renderer1.__popMaskObject(tilemap);
										}
									}
								}
							}
						}
					}
				}
			}
		}
		var renderer1 = renderer.__canvasRenderer;
		if(!(!tilemap.__renderable || tilemap.__group.__tiles.length == 0)) {
			var alpha = renderer1.__getAlpha(tilemap.__worldAlpha);
			if(!(alpha <= 0)) {
				var context = renderer1.context;
				renderer1.__setBlendMode(tilemap.__worldBlendMode);
				renderer1.__pushMaskObject(tilemap);
				var rect = openfl_geom_Rectangle.__pool.get();
				rect.setTo(0,0,tilemap.__width,tilemap.__height);
				renderer1.__pushMaskRect(rect,tilemap.__renderTransform);
				if(!renderer1.__allowSmoothing || !tilemap.smoothing) {
					context.imageSmoothingEnabled = false;
				}
				openfl_display__$internal_CanvasTilemap.renderTileContainer(tilemap.__group,renderer1,tilemap.__renderTransform,tilemap.__tileset,renderer1.__allowSmoothing && tilemap.smoothing,tilemap.tileAlphaEnabled,alpha,tilemap.tileBlendModeEnabled,tilemap.__worldBlendMode,null,null,rect);
				if(!renderer1.__allowSmoothing || !tilemap.smoothing) {
					context.imageSmoothingEnabled = true;
				}
				renderer1.__popMaskRect();
				renderer1.__popMaskObject(tilemap);
				openfl_geom_Rectangle.__pool.release(rect);
			}
		}
		tilemap.__renderTransform = cacheRenderTransform;
		renderer.__canvasRenderer.context = null;
		renderer.__updateClip(tilemap);
		renderer.__applyStyle(tilemap,true,false,true);
	} else {
		openfl_display__$internal_DOMTilemap.clear(tilemap,renderer);
	}
	renderer.__renderEvent(tilemap);
};
openfl_display__$internal_DOMTilemap.renderDrawableClear = function(tilemap,renderer) {
	openfl_display__$internal_DOMTilemap.clear(tilemap,renderer);
};
var openfl_display__$internal_DOMVideo = function() { };
$hxClasses["openfl.display._internal.DOMVideo"] = openfl_display__$internal_DOMVideo;
openfl_display__$internal_DOMVideo.__name__ = "openfl.display._internal.DOMVideo";
openfl_display__$internal_DOMVideo.clear = function(video,renderer) {
	openfl_display__$internal_DOMDisplayObject.clear(video,renderer);
	if(video.__active) {
		renderer.element.removeChild(video.__stream.__video);
		video.__active = false;
	}
};
openfl_display__$internal_DOMVideo.render = function(video,renderer) {
	if(video.stage != null && video.__stream != null && video.__worldVisible && video.__renderable) {
		if(!video.__active) {
			renderer.__initializeElement(video,video.__stream.__video);
			video.__active = true;
			video.__dirty = true;
		}
		if(video.__dirty) {
			video.__stream.__video.width = video.__width | 0;
			video.__stream.__video.height = video.__height | 0;
			video.__dirty = false;
		}
		renderer.__updateClip(video);
		renderer.__applyStyle(video,true,true,true);
	} else {
		openfl_display__$internal_DOMVideo.clear(video,renderer);
	}
};
openfl_display__$internal_DOMVideo.renderDrawable = function(video,renderer) {
	openfl_display__$internal_DOMVideo.render(video,renderer);
	renderer.__renderEvent(video);
};
openfl_display__$internal_DOMVideo.renderDrawableClear = function(video,renderer) {
	openfl_display__$internal_DOMDisplayObject.renderDrawableClear(video,renderer);
};
var openfl_display__$internal_DrawCommandReader = function(buffer) {
	this.buffer = buffer;
	this.bPos = this.iPos = this.fPos = this.oPos = this.ffPos = this.iiPos = this.tsPos = 0;
	this.prev = openfl_display__$internal_DrawCommandType.UNKNOWN;
};
$hxClasses["openfl.display._internal.DrawCommandReader"] = openfl_display__$internal_DrawCommandReader;
openfl_display__$internal_DrawCommandReader.__name__ = "openfl.display._internal.DrawCommandReader";
openfl_display__$internal_DrawCommandReader.prototype = {
	buffer: null
	,bPos: null
	,iiPos: null
	,iPos: null
	,ffPos: null
	,fPos: null
	,oPos: null
	,prev: null
	,tsPos: null
	,advance: function() {
		switch(this.prev._hx_index) {
		case 0:
			this.oPos += 2;
			this.bPos += 2;
			break;
		case 1:
			this.iPos += 1;
			this.fPos += 1;
			break;
		case 2:
			this.oPos += 4;
			this.iiPos += 2;
			this.ffPos += 1;
			this.fPos += 1;
			break;
		case 3:
			this.oPos += 1;
			break;
		case 4:
			this.fPos += 6;
			break;
		case 5:
			this.fPos += 4;
			break;
		case 6:
			this.fPos += 3;
			break;
		case 7:
			this.fPos += 4;
			break;
		case 8:
			this.oPos += 3;
			break;
		case 9:
			this.fPos += 4;
			break;
		case 10:
			this.fPos += 5;
			this.oPos += 1;
			break;
		case 12:
			this.oPos += 4;
			break;
		case 13:
			break;
		case 14:
			this.oPos += 2;
			this.bPos += 2;
			break;
		case 15:
			this.oPos += 4;
			this.iiPos += 2;
			this.ffPos += 1;
			this.fPos += 1;
			break;
		case 16:
			this.oPos += 4;
			this.iPos += 1;
			this.fPos += 2;
			this.bPos += 1;
			break;
		case 17:
			this.fPos += 2;
			break;
		case 18:
			this.fPos += 2;
			break;
		case 19:
			this.oPos += 1;
			break;
		case 20:
			this.oPos += 1;
			break;
		case 21:case 22:
			break;
		default:
		}
	}
	,bool: function(index) {
		return this.buffer.b[this.bPos + index];
	}
	,destroy: function() {
		this.buffer = null;
		this.reset();
	}
	,fArr: function(index) {
		return this.buffer.ff[this.ffPos + index];
	}
	,float: function(index) {
		return this.buffer.f[this.fPos + index];
	}
	,iArr: function(index) {
		return this.buffer.ii[this.iiPos + index];
	}
	,int: function(index) {
		return this.buffer.i[this.iPos + index];
	}
	,obj: function(index) {
		return this.buffer.o[this.oPos + index];
	}
	,readBeginBitmapFill: function() {
		switch(this.prev._hx_index) {
		case 0:
			this.oPos += 2;
			this.bPos += 2;
			break;
		case 1:
			this.iPos += 1;
			this.fPos += 1;
			break;
		case 2:
			this.oPos += 4;
			this.iiPos += 2;
			this.ffPos += 1;
			this.fPos += 1;
			break;
		case 3:
			this.oPos += 1;
			break;
		case 4:
			this.fPos += 6;
			break;
		case 5:
			this.fPos += 4;
			break;
		case 6:
			this.fPos += 3;
			break;
		case 7:
			this.fPos += 4;
			break;
		case 8:
			this.oPos += 3;
			break;
		case 9:
			this.fPos += 4;
			break;
		case 10:
			this.fPos += 5;
			this.oPos += 1;
			break;
		case 12:
			this.oPos += 4;
			break;
		case 13:
			break;
		case 14:
			this.oPos += 2;
			this.bPos += 2;
			break;
		case 15:
			this.oPos += 4;
			this.iiPos += 2;
			this.ffPos += 1;
			this.fPos += 1;
			break;
		case 16:
			this.oPos += 4;
			this.iPos += 1;
			this.fPos += 2;
			this.bPos += 1;
			break;
		case 17:
			this.fPos += 2;
			break;
		case 18:
			this.fPos += 2;
			break;
		case 19:
			this.oPos += 1;
			break;
		case 20:
			this.oPos += 1;
			break;
		case 21:case 22:
			break;
		default:
		}
		this.prev = openfl_display__$internal_DrawCommandType.BEGIN_BITMAP_FILL;
		return this;
	}
	,readBeginFill: function() {
		switch(this.prev._hx_index) {
		case 0:
			this.oPos += 2;
			this.bPos += 2;
			break;
		case 1:
			this.iPos += 1;
			this.fPos += 1;
			break;
		case 2:
			this.oPos += 4;
			this.iiPos += 2;
			this.ffPos += 1;
			this.fPos += 1;
			break;
		case 3:
			this.oPos += 1;
			break;
		case 4:
			this.fPos += 6;
			break;
		case 5:
			this.fPos += 4;
			break;
		case 6:
			this.fPos += 3;
			break;
		case 7:
			this.fPos += 4;
			break;
		case 8:
			this.oPos += 3;
			break;
		case 9:
			this.fPos += 4;
			break;
		case 10:
			this.fPos += 5;
			this.oPos += 1;
			break;
		case 12:
			this.oPos += 4;
			break;
		case 13:
			break;
		case 14:
			this.oPos += 2;
			this.bPos += 2;
			break;
		case 15:
			this.oPos += 4;
			this.iiPos += 2;
			this.ffPos += 1;
			this.fPos += 1;
			break;
		case 16:
			this.oPos += 4;
			this.iPos += 1;
			this.fPos += 2;
			this.bPos += 1;
			break;
		case 17:
			this.fPos += 2;
			break;
		case 18:
			this.fPos += 2;
			break;
		case 19:
			this.oPos += 1;
			break;
		case 20:
			this.oPos += 1;
			break;
		case 21:case 22:
			break;
		default:
		}
		this.prev = openfl_display__$internal_DrawCommandType.BEGIN_FILL;
		return this;
	}
	,readBeginGradientFill: function() {
		switch(this.prev._hx_index) {
		case 0:
			this.oPos += 2;
			this.bPos += 2;
			break;
		case 1:
			this.iPos += 1;
			this.fPos += 1;
			break;
		case 2:
			this.oPos += 4;
			this.iiPos += 2;
			this.ffPos += 1;
			this.fPos += 1;
			break;
		case 3:
			this.oPos += 1;
			break;
		case 4:
			this.fPos += 6;
			break;
		case 5:
			this.fPos += 4;
			break;
		case 6:
			this.fPos += 3;
			break;
		case 7:
			this.fPos += 4;
			break;
		case 8:
			this.oPos += 3;
			break;
		case 9:
			this.fPos += 4;
			break;
		case 10:
			this.fPos += 5;
			this.oPos += 1;
			break;
		case 12:
			this.oPos += 4;
			break;
		case 13:
			break;
		case 14:
			this.oPos += 2;
			this.bPos += 2;
			break;
		case 15:
			this.oPos += 4;
			this.iiPos += 2;
			this.ffPos += 1;
			this.fPos += 1;
			break;
		case 16:
			this.oPos += 4;
			this.iPos += 1;
			this.fPos += 2;
			this.bPos += 1;
			break;
		case 17:
			this.fPos += 2;
			break;
		case 18:
			this.fPos += 2;
			break;
		case 19:
			this.oPos += 1;
			break;
		case 20:
			this.oPos += 1;
			break;
		case 21:case 22:
			break;
		default:
		}
		this.prev = openfl_display__$internal_DrawCommandType.BEGIN_GRADIENT_FILL;
		return this;
	}
	,readBeginShaderFill: function() {
		switch(this.prev._hx_index) {
		case 0:
			this.oPos += 2;
			this.bPos += 2;
			break;
		case 1:
			this.iPos += 1;
			this.fPos += 1;
			break;
		case 2:
			this.oPos += 4;
			this.iiPos += 2;
			this.ffPos += 1;
			this.fPos += 1;
			break;
		case 3:
			this.oPos += 1;
			break;
		case 4:
			this.fPos += 6;
			break;
		case 5:
			this.fPos += 4;
			break;
		case 6:
			this.fPos += 3;
			break;
		case 7:
			this.fPos += 4;
			break;
		case 8:
			this.oPos += 3;
			break;
		case 9:
			this.fPos += 4;
			break;
		case 10:
			this.fPos += 5;
			this.oPos += 1;
			break;
		case 12:
			this.oPos += 4;
			break;
		case 13:
			break;
		case 14:
			this.oPos += 2;
			this.bPos += 2;
			break;
		case 15:
			this.oPos += 4;
			this.iiPos += 2;
			this.ffPos += 1;
			this.fPos += 1;
			break;
		case 16:
			this.oPos += 4;
			this.iPos += 1;
			this.fPos += 2;
			this.bPos += 1;
			break;
		case 17:
			this.fPos += 2;
			break;
		case 18:
			this.fPos += 2;
			break;
		case 19:
			this.oPos += 1;
			break;
		case 20:
			this.oPos += 1;
			break;
		case 21:case 22:
			break;
		default:
		}
		this.prev = openfl_display__$internal_DrawCommandType.BEGIN_SHADER_FILL;
		return this;
	}
	,readCubicCurveTo: function() {
		switch(this.prev._hx_index) {
		case 0:
			this.oPos += 2;
			this.bPos += 2;
			break;
		case 1:
			this.iPos += 1;
			this.fPos += 1;
			break;
		case 2:
			this.oPos += 4;
			this.iiPos += 2;
			this.ffPos += 1;
			this.fPos += 1;
			break;
		case 3:
			this.oPos += 1;
			break;
		case 4:
			this.fPos += 6;
			break;
		case 5:
			this.fPos += 4;
			break;
		case 6:
			this.fPos += 3;
			break;
		case 7:
			this.fPos += 4;
			break;
		case 8:
			this.oPos += 3;
			break;
		case 9:
			this.fPos += 4;
			break;
		case 10:
			this.fPos += 5;
			this.oPos += 1;
			break;
		case 12:
			this.oPos += 4;
			break;
		case 13:
			break;
		case 14:
			this.oPos += 2;
			this.bPos += 2;
			break;
		case 15:
			this.oPos += 4;
			this.iiPos += 2;
			this.ffPos += 1;
			this.fPos += 1;
			break;
		case 16:
			this.oPos += 4;
			this.iPos += 1;
			this.fPos += 2;
			this.bPos += 1;
			break;
		case 17:
			this.fPos += 2;
			break;
		case 18:
			this.fPos += 2;
			break;
		case 19:
			this.oPos += 1;
			break;
		case 20:
			this.oPos += 1;
			break;
		case 21:case 22:
			break;
		default:
		}
		this.prev = openfl_display__$internal_DrawCommandType.CUBIC_CURVE_TO;
		return this;
	}
	,readCurveTo: function() {
		switch(this.prev._hx_index) {
		case 0:
			this.oPos += 2;
			this.bPos += 2;
			break;
		case 1:
			this.iPos += 1;
			this.fPos += 1;
			break;
		case 2:
			this.oPos += 4;
			this.iiPos += 2;
			this.ffPos += 1;
			this.fPos += 1;
			break;
		case 3:
			this.oPos += 1;
			break;
		case 4:
			this.fPos += 6;
			break;
		case 5:
			this.fPos += 4;
			break;
		case 6:
			this.fPos += 3;
			break;
		case 7:
			this.fPos += 4;
			break;
		case 8:
			this.oPos += 3;
			break;
		case 9:
			this.fPos += 4;
			break;
		case 10:
			this.fPos += 5;
			this.oPos += 1;
			break;
		case 12:
			this.oPos += 4;
			break;
		case 13:
			break;
		case 14:
			this.oPos += 2;
			this.bPos += 2;
			break;
		case 15:
			this.oPos += 4;
			this.iiPos += 2;
			this.ffPos += 1;
			this.fPos += 1;
			break;
		case 16:
			this.oPos += 4;
			this.iPos += 1;
			this.fPos += 2;
			this.bPos += 1;
			break;
		case 17:
			this.fPos += 2;
			break;
		case 18:
			this.fPos += 2;
			break;
		case 19:
			this.oPos += 1;
			break;
		case 20:
			this.oPos += 1;
			break;
		case 21:case 22:
			break;
		default:
		}
		this.prev = openfl_display__$internal_DrawCommandType.CURVE_TO;
		return this;
	}
	,readDrawCircle: function() {
		switch(this.prev._hx_index) {
		case 0:
			this.oPos += 2;
			this.bPos += 2;
			break;
		case 1:
			this.iPos += 1;
			this.fPos += 1;
			break;
		case 2:
			this.oPos += 4;
			this.iiPos += 2;
			this.ffPos += 1;
			this.fPos += 1;
			break;
		case 3:
			this.oPos += 1;
			break;
		case 4:
			this.fPos += 6;
			break;
		case 5:
			this.fPos += 4;
			break;
		case 6:
			this.fPos += 3;
			break;
		case 7:
			this.fPos += 4;
			break;
		case 8:
			this.oPos += 3;
			break;
		case 9:
			this.fPos += 4;
			break;
		case 10:
			this.fPos += 5;
			this.oPos += 1;
			break;
		case 12:
			this.oPos += 4;
			break;
		case 13:
			break;
		case 14:
			this.oPos += 2;
			this.bPos += 2;
			break;
		case 15:
			this.oPos += 4;
			this.iiPos += 2;
			this.ffPos += 1;
			this.fPos += 1;
			break;
		case 16:
			this.oPos += 4;
			this.iPos += 1;
			this.fPos += 2;
			this.bPos += 1;
			break;
		case 17:
			this.fPos += 2;
			break;
		case 18:
			this.fPos += 2;
			break;
		case 19:
			this.oPos += 1;
			break;
		case 20:
			this.oPos += 1;
			break;
		case 21:case 22:
			break;
		default:
		}
		this.prev = openfl_display__$internal_DrawCommandType.DRAW_CIRCLE;
		return this;
	}
	,readDrawEllipse: function() {
		switch(this.prev._hx_index) {
		case 0:
			this.oPos += 2;
			this.bPos += 2;
			break;
		case 1:
			this.iPos += 1;
			this.fPos += 1;
			break;
		case 2:
			this.oPos += 4;
			this.iiPos += 2;
			this.ffPos += 1;
			this.fPos += 1;
			break;
		case 3:
			this.oPos += 1;
			break;
		case 4:
			this.fPos += 6;
			break;
		case 5:
			this.fPos += 4;
			break;
		case 6:
			this.fPos += 3;
			break;
		case 7:
			this.fPos += 4;
			break;
		case 8:
			this.oPos += 3;
			break;
		case 9:
			this.fPos += 4;
			break;
		case 10:
			this.fPos += 5;
			this.oPos += 1;
			break;
		case 12:
			this.oPos += 4;
			break;
		case 13:
			break;
		case 14:
			this.oPos += 2;
			this.bPos += 2;
			break;
		case 15:
			this.oPos += 4;
			this.iiPos += 2;
			this.ffPos += 1;
			this.fPos += 1;
			break;
		case 16:
			this.oPos += 4;
			this.iPos += 1;
			this.fPos += 2;
			this.bPos += 1;
			break;
		case 17:
			this.fPos += 2;
			break;
		case 18:
			this.fPos += 2;
			break;
		case 19:
			this.oPos += 1;
			break;
		case 20:
			this.oPos += 1;
			break;
		case 21:case 22:
			break;
		default:
		}
		this.prev = openfl_display__$internal_DrawCommandType.DRAW_ELLIPSE;
		return this;
	}
	,readDrawQuads: function() {
		switch(this.prev._hx_index) {
		case 0:
			this.oPos += 2;
			this.bPos += 2;
			break;
		case 1:
			this.iPos += 1;
			this.fPos += 1;
			break;
		case 2:
			this.oPos += 4;
			this.iiPos += 2;
			this.ffPos += 1;
			this.fPos += 1;
			break;
		case 3:
			this.oPos += 1;
			break;
		case 4:
			this.fPos += 6;
			break;
		case 5:
			this.fPos += 4;
			break;
		case 6:
			this.fPos += 3;
			break;
		case 7:
			this.fPos += 4;
			break;
		case 8:
			this.oPos += 3;
			break;
		case 9:
			this.fPos += 4;
			break;
		case 10:
			this.fPos += 5;
			this.oPos += 1;
			break;
		case 12:
			this.oPos += 4;
			break;
		case 13:
			break;
		case 14:
			this.oPos += 2;
			this.bPos += 2;
			break;
		case 15:
			this.oPos += 4;
			this.iiPos += 2;
			this.ffPos += 1;
			this.fPos += 1;
			break;
		case 16:
			this.oPos += 4;
			this.iPos += 1;
			this.fPos += 2;
			this.bPos += 1;
			break;
		case 17:
			this.fPos += 2;
			break;
		case 18:
			this.fPos += 2;
			break;
		case 19:
			this.oPos += 1;
			break;
		case 20:
			this.oPos += 1;
			break;
		case 21:case 22:
			break;
		default:
		}
		this.prev = openfl_display__$internal_DrawCommandType.DRAW_QUADS;
		return this;
	}
	,readDrawRect: function() {
		switch(this.prev._hx_index) {
		case 0:
			this.oPos += 2;
			this.bPos += 2;
			break;
		case 1:
			this.iPos += 1;
			this.fPos += 1;
			break;
		case 2:
			this.oPos += 4;
			this.iiPos += 2;
			this.ffPos += 1;
			this.fPos += 1;
			break;
		case 3:
			this.oPos += 1;
			break;
		case 4:
			this.fPos += 6;
			break;
		case 5:
			this.fPos += 4;
			break;
		case 6:
			this.fPos += 3;
			break;
		case 7:
			this.fPos += 4;
			break;
		case 8:
			this.oPos += 3;
			break;
		case 9:
			this.fPos += 4;
			break;
		case 10:
			this.fPos += 5;
			this.oPos += 1;
			break;
		case 12:
			this.oPos += 4;
			break;
		case 13:
			break;
		case 14:
			this.oPos += 2;
			this.bPos += 2;
			break;
		case 15:
			this.oPos += 4;
			this.iiPos += 2;
			this.ffPos += 1;
			this.fPos += 1;
			break;
		case 16:
			this.oPos += 4;
			this.iPos += 1;
			this.fPos += 2;
			this.bPos += 1;
			break;
		case 17:
			this.fPos += 2;
			break;
		case 18:
			this.fPos += 2;
			break;
		case 19:
			this.oPos += 1;
			break;
		case 20:
			this.oPos += 1;
			break;
		case 21:case 22:
			break;
		default:
		}
		this.prev = openfl_display__$internal_DrawCommandType.DRAW_RECT;
		return this;
	}
	,readDrawRoundRect: function() {
		switch(this.prev._hx_index) {
		case 0:
			this.oPos += 2;
			this.bPos += 2;
			break;
		case 1:
			this.iPos += 1;
			this.fPos += 1;
			break;
		case 2:
			this.oPos += 4;
			this.iiPos += 2;
			this.ffPos += 1;
			this.fPos += 1;
			break;
		case 3:
			this.oPos += 1;
			break;
		case 4:
			this.fPos += 6;
			break;
		case 5:
			this.fPos += 4;
			break;
		case 6:
			this.fPos += 3;
			break;
		case 7:
			this.fPos += 4;
			break;
		case 8:
			this.oPos += 3;
			break;
		case 9:
			this.fPos += 4;
			break;
		case 10:
			this.fPos += 5;
			this.oPos += 1;
			break;
		case 12:
			this.oPos += 4;
			break;
		case 13:
			break;
		case 14:
			this.oPos += 2;
			this.bPos += 2;
			break;
		case 15:
			this.oPos += 4;
			this.iiPos += 2;
			this.ffPos += 1;
			this.fPos += 1;
			break;
		case 16:
			this.oPos += 4;
			this.iPos += 1;
			this.fPos += 2;
			this.bPos += 1;
			break;
		case 17:
			this.fPos += 2;
			break;
		case 18:
			this.fPos += 2;
			break;
		case 19:
			this.oPos += 1;
			break;
		case 20:
			this.oPos += 1;
			break;
		case 21:case 22:
			break;
		default:
		}
		this.prev = openfl_display__$internal_DrawCommandType.DRAW_ROUND_RECT;
		return this;
	}
	,readDrawTriangles: function() {
		switch(this.prev._hx_index) {
		case 0:
			this.oPos += 2;
			this.bPos += 2;
			break;
		case 1:
			this.iPos += 1;
			this.fPos += 1;
			break;
		case 2:
			this.oPos += 4;
			this.iiPos += 2;
			this.ffPos += 1;
			this.fPos += 1;
			break;
		case 3:
			this.oPos += 1;
			break;
		case 4:
			this.fPos += 6;
			break;
		case 5:
			this.fPos += 4;
			break;
		case 6:
			this.fPos += 3;
			break;
		case 7:
			this.fPos += 4;
			break;
		case 8:
			this.oPos += 3;
			break;
		case 9:
			this.fPos += 4;
			break;
		case 10:
			this.fPos += 5;
			this.oPos += 1;
			break;
		case 12:
			this.oPos += 4;
			break;
		case 13:
			break;
		case 14:
			this.oPos += 2;
			this.bPos += 2;
			break;
		case 15:
			this.oPos += 4;
			this.iiPos += 2;
			this.ffPos += 1;
			this.fPos += 1;
			break;
		case 16:
			this.oPos += 4;
			this.iPos += 1;
			this.fPos += 2;
			this.bPos += 1;
			break;
		case 17:
			this.fPos += 2;
			break;
		case 18:
			this.fPos += 2;
			break;
		case 19:
			this.oPos += 1;
			break;
		case 20:
			this.oPos += 1;
			break;
		case 21:case 22:
			break;
		default:
		}
		this.prev = openfl_display__$internal_DrawCommandType.DRAW_TRIANGLES;
		return this;
	}
	,readEndFill: function() {
		switch(this.prev._hx_index) {
		case 0:
			this.oPos += 2;
			this.bPos += 2;
			break;
		case 1:
			this.iPos += 1;
			this.fPos += 1;
			break;
		case 2:
			this.oPos += 4;
			this.iiPos += 2;
			this.ffPos += 1;
			this.fPos += 1;
			break;
		case 3:
			this.oPos += 1;
			break;
		case 4:
			this.fPos += 6;
			break;
		case 5:
			this.fPos += 4;
			break;
		case 6:
			this.fPos += 3;
			break;
		case 7:
			this.fPos += 4;
			break;
		case 8:
			this.oPos += 3;
			break;
		case 9:
			this.fPos += 4;
			break;
		case 10:
			this.fPos += 5;
			this.oPos += 1;
			break;
		case 12:
			this.oPos += 4;
			break;
		case 13:
			break;
		case 14:
			this.oPos += 2;
			this.bPos += 2;
			break;
		case 15:
			this.oPos += 4;
			this.iiPos += 2;
			this.ffPos += 1;
			this.fPos += 1;
			break;
		case 16:
			this.oPos += 4;
			this.iPos += 1;
			this.fPos += 2;
			this.bPos += 1;
			break;
		case 17:
			this.fPos += 2;
			break;
		case 18:
			this.fPos += 2;
			break;
		case 19:
			this.oPos += 1;
			break;
		case 20:
			this.oPos += 1;
			break;
		case 21:case 22:
			break;
		default:
		}
		this.prev = openfl_display__$internal_DrawCommandType.END_FILL;
		return this;
	}
	,readLineBitmapStyle: function() {
		switch(this.prev._hx_index) {
		case 0:
			this.oPos += 2;
			this.bPos += 2;
			break;
		case 1:
			this.iPos += 1;
			this.fPos += 1;
			break;
		case 2:
			this.oPos += 4;
			this.iiPos += 2;
			this.ffPos += 1;
			this.fPos += 1;
			break;
		case 3:
			this.oPos += 1;
			break;
		case 4:
			this.fPos += 6;
			break;
		case 5:
			this.fPos += 4;
			break;
		case 6:
			this.fPos += 3;
			break;
		case 7:
			this.fPos += 4;
			break;
		case 8:
			this.oPos += 3;
			break;
		case 9:
			this.fPos += 4;
			break;
		case 10:
			this.fPos += 5;
			this.oPos += 1;
			break;
		case 12:
			this.oPos += 4;
			break;
		case 13:
			break;
		case 14:
			this.oPos += 2;
			this.bPos += 2;
			break;
		case 15:
			this.oPos += 4;
			this.iiPos += 2;
			this.ffPos += 1;
			this.fPos += 1;
			break;
		case 16:
			this.oPos += 4;
			this.iPos += 1;
			this.fPos += 2;
			this.bPos += 1;
			break;
		case 17:
			this.fPos += 2;
			break;
		case 18:
			this.fPos += 2;
			break;
		case 19:
			this.oPos += 1;
			break;
		case 20:
			this.oPos += 1;
			break;
		case 21:case 22:
			break;
		default:
		}
		this.prev = openfl_display__$internal_DrawCommandType.LINE_BITMAP_STYLE;
		return this;
	}
	,readLineGradientStyle: function() {
		switch(this.prev._hx_index) {
		case 0:
			this.oPos += 2;
			this.bPos += 2;
			break;
		case 1:
			this.iPos += 1;
			this.fPos += 1;
			break;
		case 2:
			this.oPos += 4;
			this.iiPos += 2;
			this.ffPos += 1;
			this.fPos += 1;
			break;
		case 3:
			this.oPos += 1;
			break;
		case 4:
			this.fPos += 6;
			break;
		case 5:
			this.fPos += 4;
			break;
		case 6:
			this.fPos += 3;
			break;
		case 7:
			this.fPos += 4;
			break;
		case 8:
			this.oPos += 3;
			break;
		case 9:
			this.fPos += 4;
			break;
		case 10:
			this.fPos += 5;
			this.oPos += 1;
			break;
		case 12:
			this.oPos += 4;
			break;
		case 13:
			break;
		case 14:
			this.oPos += 2;
			this.bPos += 2;
			break;
		case 15:
			this.oPos += 4;
			this.iiPos += 2;
			this.ffPos += 1;
			this.fPos += 1;
			break;
		case 16:
			this.oPos += 4;
			this.iPos += 1;
			this.fPos += 2;
			this.bPos += 1;
			break;
		case 17:
			this.fPos += 2;
			break;
		case 18:
			this.fPos += 2;
			break;
		case 19:
			this.oPos += 1;
			break;
		case 20:
			this.oPos += 1;
			break;
		case 21:case 22:
			break;
		default:
		}
		this.prev = openfl_display__$internal_DrawCommandType.LINE_GRADIENT_STYLE;
		return this;
	}
	,readLineStyle: function() {
		switch(this.prev._hx_index) {
		case 0:
			this.oPos += 2;
			this.bPos += 2;
			break;
		case 1:
			this.iPos += 1;
			this.fPos += 1;
			break;
		case 2:
			this.oPos += 4;
			this.iiPos += 2;
			this.ffPos += 1;
			this.fPos += 1;
			break;
		case 3:
			this.oPos += 1;
			break;
		case 4:
			this.fPos += 6;
			break;
		case 5:
			this.fPos += 4;
			break;
		case 6:
			this.fPos += 3;
			break;
		case 7:
			this.fPos += 4;
			break;
		case 8:
			this.oPos += 3;
			break;
		case 9:
			this.fPos += 4;
			break;
		case 10:
			this.fPos += 5;
			this.oPos += 1;
			break;
		case 12:
			this.oPos += 4;
			break;
		case 13:
			break;
		case 14:
			this.oPos += 2;
			this.bPos += 2;
			break;
		case 15:
			this.oPos += 4;
			this.iiPos += 2;
			this.ffPos += 1;
			this.fPos += 1;
			break;
		case 16:
			this.oPos += 4;
			this.iPos += 1;
			this.fPos += 2;
			this.bPos += 1;
			break;
		case 17:
			this.fPos += 2;
			break;
		case 18:
			this.fPos += 2;
			break;
		case 19:
			this.oPos += 1;
			break;
		case 20:
			this.oPos += 1;
			break;
		case 21:case 22:
			break;
		default:
		}
		this.prev = openfl_display__$internal_DrawCommandType.LINE_STYLE;
		return this;
	}
	,readLineTo: function() {
		switch(this.prev._hx_index) {
		case 0:
			this.oPos += 2;
			this.bPos += 2;
			break;
		case 1:
			this.iPos += 1;
			this.fPos += 1;
			break;
		case 2:
			this.oPos += 4;
			this.iiPos += 2;
			this.ffPos += 1;
			this.fPos += 1;
			break;
		case 3:
			this.oPos += 1;
			break;
		case 4:
			this.fPos += 6;
			break;
		case 5:
			this.fPos += 4;
			break;
		case 6:
			this.fPos += 3;
			break;
		case 7:
			this.fPos += 4;
			break;
		case 8:
			this.oPos += 3;
			break;
		case 9:
			this.fPos += 4;
			break;
		case 10:
			this.fPos += 5;
			this.oPos += 1;
			break;
		case 12:
			this.oPos += 4;
			break;
		case 13:
			break;
		case 14:
			this.oPos += 2;
			this.bPos += 2;
			break;
		case 15:
			this.oPos += 4;
			this.iiPos += 2;
			this.ffPos += 1;
			this.fPos += 1;
			break;
		case 16:
			this.oPos += 4;
			this.iPos += 1;
			this.fPos += 2;
			this.bPos += 1;
			break;
		case 17:
			this.fPos += 2;
			break;
		case 18:
			this.fPos += 2;
			break;
		case 19:
			this.oPos += 1;
			break;
		case 20:
			this.oPos += 1;
			break;
		case 21:case 22:
			break;
		default:
		}
		this.prev = openfl_display__$internal_DrawCommandType.LINE_TO;
		return this;
	}
	,readMoveTo: function() {
		switch(this.prev._hx_index) {
		case 0:
			this.oPos += 2;
			this.bPos += 2;
			break;
		case 1:
			this.iPos += 1;
			this.fPos += 1;
			break;
		case 2:
			this.oPos += 4;
			this.iiPos += 2;
			this.ffPos += 1;
			this.fPos += 1;
			break;
		case 3:
			this.oPos += 1;
			break;
		case 4:
			this.fPos += 6;
			break;
		case 5:
			this.fPos += 4;
			break;
		case 6:
			this.fPos += 3;
			break;
		case 7:
			this.fPos += 4;
			break;
		case 8:
			this.oPos += 3;
			break;
		case 9:
			this.fPos += 4;
			break;
		case 10:
			this.fPos += 5;
			this.oPos += 1;
			break;
		case 12:
			this.oPos += 4;
			break;
		case 13:
			break;
		case 14:
			this.oPos += 2;
			this.bPos += 2;
			break;
		case 15:
			this.oPos += 4;
			this.iiPos += 2;
			this.ffPos += 1;
			this.fPos += 1;
			break;
		case 16:
			this.oPos += 4;
			this.iPos += 1;
			this.fPos += 2;
			this.bPos += 1;
			break;
		case 17:
			this.fPos += 2;
			break;
		case 18:
			this.fPos += 2;
			break;
		case 19:
			this.oPos += 1;
			break;
		case 20:
			this.oPos += 1;
			break;
		case 21:case 22:
			break;
		default:
		}
		this.prev = openfl_display__$internal_DrawCommandType.MOVE_TO;
		return this;
	}
	,readOverrideBlendMode: function() {
		switch(this.prev._hx_index) {
		case 0:
			this.oPos += 2;
			this.bPos += 2;
			break;
		case 1:
			this.iPos += 1;
			this.fPos += 1;
			break;
		case 2:
			this.oPos += 4;
			this.iiPos += 2;
			this.ffPos += 1;
			this.fPos += 1;
			break;
		case 3:
			this.oPos += 1;
			break;
		case 4:
			this.fPos += 6;
			break;
		case 5:
			this.fPos += 4;
			break;
		case 6:
			this.fPos += 3;
			break;
		case 7:
			this.fPos += 4;
			break;
		case 8:
			this.oPos += 3;
			break;
		case 9:
			this.fPos += 4;
			break;
		case 10:
			this.fPos += 5;
			this.oPos += 1;
			break;
		case 12:
			this.oPos += 4;
			break;
		case 13:
			break;
		case 14:
			this.oPos += 2;
			this.bPos += 2;
			break;
		case 15:
			this.oPos += 4;
			this.iiPos += 2;
			this.ffPos += 1;
			this.fPos += 1;
			break;
		case 16:
			this.oPos += 4;
			this.iPos += 1;
			this.fPos += 2;
			this.bPos += 1;
			break;
		case 17:
			this.fPos += 2;
			break;
		case 18:
			this.fPos += 2;
			break;
		case 19:
			this.oPos += 1;
			break;
		case 20:
			this.oPos += 1;
			break;
		case 21:case 22:
			break;
		default:
		}
		this.prev = openfl_display__$internal_DrawCommandType.OVERRIDE_BLEND_MODE;
		return this;
	}
	,readOverrideMatrix: function() {
		switch(this.prev._hx_index) {
		case 0:
			this.oPos += 2;
			this.bPos += 2;
			break;
		case 1:
			this.iPos += 1;
			this.fPos += 1;
			break;
		case 2:
			this.oPos += 4;
			this.iiPos += 2;
			this.ffPos += 1;
			this.fPos += 1;
			break;
		case 3:
			this.oPos += 1;
			break;
		case 4:
			this.fPos += 6;
			break;
		case 5:
			this.fPos += 4;
			break;
		case 6:
			this.fPos += 3;
			break;
		case 7:
			this.fPos += 4;
			break;
		case 8:
			this.oPos += 3;
			break;
		case 9:
			this.fPos += 4;
			break;
		case 10:
			this.fPos += 5;
			this.oPos += 1;
			break;
		case 12:
			this.oPos += 4;
			break;
		case 13:
			break;
		case 14:
			this.oPos += 2;
			this.bPos += 2;
			break;
		case 15:
			this.oPos += 4;
			this.iiPos += 2;
			this.ffPos += 1;
			this.fPos += 1;
			break;
		case 16:
			this.oPos += 4;
			this.iPos += 1;
			this.fPos += 2;
			this.bPos += 1;
			break;
		case 17:
			this.fPos += 2;
			break;
		case 18:
			this.fPos += 2;
			break;
		case 19:
			this.oPos += 1;
			break;
		case 20:
			this.oPos += 1;
			break;
		case 21:case 22:
			break;
		default:
		}
		this.prev = openfl_display__$internal_DrawCommandType.OVERRIDE_MATRIX;
		return this;
	}
	,readWindingEvenOdd: function() {
		switch(this.prev._hx_index) {
		case 0:
			this.oPos += 2;
			this.bPos += 2;
			break;
		case 1:
			this.iPos += 1;
			this.fPos += 1;
			break;
		case 2:
			this.oPos += 4;
			this.iiPos += 2;
			this.ffPos += 1;
			this.fPos += 1;
			break;
		case 3:
			this.oPos += 1;
			break;
		case 4:
			this.fPos += 6;
			break;
		case 5:
			this.fPos += 4;
			break;
		case 6:
			this.fPos += 3;
			break;
		case 7:
			this.fPos += 4;
			break;
		case 8:
			this.oPos += 3;
			break;
		case 9:
			this.fPos += 4;
			break;
		case 10:
			this.fPos += 5;
			this.oPos += 1;
			break;
		case 12:
			this.oPos += 4;
			break;
		case 13:
			break;
		case 14:
			this.oPos += 2;
			this.bPos += 2;
			break;
		case 15:
			this.oPos += 4;
			this.iiPos += 2;
			this.ffPos += 1;
			this.fPos += 1;
			break;
		case 16:
			this.oPos += 4;
			this.iPos += 1;
			this.fPos += 2;
			this.bPos += 1;
			break;
		case 17:
			this.fPos += 2;
			break;
		case 18:
			this.fPos += 2;
			break;
		case 19:
			this.oPos += 1;
			break;
		case 20:
			this.oPos += 1;
			break;
		case 21:case 22:
			break;
		default:
		}
		this.prev = openfl_display__$internal_DrawCommandType.WINDING_EVEN_ODD;
		return this;
	}
	,readWindingNonZero: function() {
		switch(this.prev._hx_index) {
		case 0:
			this.oPos += 2;
			this.bPos += 2;
			break;
		case 1:
			this.iPos += 1;
			this.fPos += 1;
			break;
		case 2:
			this.oPos += 4;
			this.iiPos += 2;
			this.ffPos += 1;
			this.fPos += 1;
			break;
		case 3:
			this.oPos += 1;
			break;
		case 4:
			this.fPos += 6;
			break;
		case 5:
			this.fPos += 4;
			break;
		case 6:
			this.fPos += 3;
			break;
		case 7:
			this.fPos += 4;
			break;
		case 8:
			this.oPos += 3;
			break;
		case 9:
			this.fPos += 4;
			break;
		case 10:
			this.fPos += 5;
			this.oPos += 1;
			break;
		case 12:
			this.oPos += 4;
			break;
		case 13:
			break;
		case 14:
			this.oPos += 2;
			this.bPos += 2;
			break;
		case 15:
			this.oPos += 4;
			this.iiPos += 2;
			this.ffPos += 1;
			this.fPos += 1;
			break;
		case 16:
			this.oPos += 4;
			this.iPos += 1;
			this.fPos += 2;
			this.bPos += 1;
			break;
		case 17:
			this.fPos += 2;
			break;
		case 18:
			this.fPos += 2;
			break;
		case 19:
			this.oPos += 1;
			break;
		case 20:
			this.oPos += 1;
			break;
		case 21:case 22:
			break;
		default:
		}
		this.prev = openfl_display__$internal_DrawCommandType.WINDING_NON_ZERO;
		return this;
	}
	,reset: function() {
		this.bPos = this.iPos = this.fPos = this.oPos = this.ffPos = this.iiPos = this.tsPos = 0;
	}
	,skip: function(type) {
		switch(this.prev._hx_index) {
		case 0:
			this.oPos += 2;
			this.bPos += 2;
			break;
		case 1:
			this.iPos += 1;
			this.fPos += 1;
			break;
		case 2:
			this.oPos += 4;
			this.iiPos += 2;
			this.ffPos += 1;
			this.fPos += 1;
			break;
		case 3:
			this.oPos += 1;
			break;
		case 4:
			this.fPos += 6;
			break;
		case 5:
			this.fPos += 4;
			break;
		case 6:
			this.fPos += 3;
			break;
		case 7:
			this.fPos += 4;
			break;
		case 8:
			this.oPos += 3;
			break;
		case 9:
			this.fPos += 4;
			break;
		case 10:
			this.fPos += 5;
			this.oPos += 1;
			break;
		case 12:
			this.oPos += 4;
			break;
		case 13:
			break;
		case 14:
			this.oPos += 2;
			this.bPos += 2;
			break;
		case 15:
			this.oPos += 4;
			this.iiPos += 2;
			this.ffPos += 1;
			this.fPos += 1;
			break;
		case 16:
			this.oPos += 4;
			this.iPos += 1;
			this.fPos += 2;
			this.bPos += 1;
			break;
		case 17:
			this.fPos += 2;
			break;
		case 18:
			this.fPos += 2;
			break;
		case 19:
			this.oPos += 1;
			break;
		case 20:
			this.oPos += 1;
			break;
		case 21:case 22:
			break;
		default:
		}
		this.prev = type;
	}
	,__class__: openfl_display__$internal_DrawCommandReader
};
var openfl_display__$internal_BeginBitmapFillView = {};
openfl_display__$internal_BeginBitmapFillView.__properties__ = {get_smooth:"get_smooth",get_repeat:"get_repeat",get_matrix:"get_matrix",get_bitmap:"get_bitmap"};
openfl_display__$internal_BeginBitmapFillView._new = function(d) {
	return d;
};
openfl_display__$internal_BeginBitmapFillView.get_bitmap = function(this1) {
	return this1.buffer.o[this1.oPos];
};
openfl_display__$internal_BeginBitmapFillView.get_matrix = function(this1) {
	return this1.buffer.o[this1.oPos + 1];
};
openfl_display__$internal_BeginBitmapFillView.get_repeat = function(this1) {
	return this1.buffer.b[this1.bPos];
};
openfl_display__$internal_BeginBitmapFillView.get_smooth = function(this1) {
	return this1.buffer.b[this1.bPos + 1];
};
var openfl_display__$internal_BeginFillView = {};
openfl_display__$internal_BeginFillView.__properties__ = {get_alpha:"get_alpha",get_color:"get_color"};
openfl_display__$internal_BeginFillView._new = function(d) {
	return d;
};
openfl_display__$internal_BeginFillView.get_color = function(this1) {
	return this1.buffer.i[this1.iPos];
};
openfl_display__$internal_BeginFillView.get_alpha = function(this1) {
	return this1.buffer.f[this1.fPos];
};
var openfl_display__$internal_BeginGradientFillView = {};
openfl_display__$internal_BeginGradientFillView.__properties__ = {get_focalPointRatio:"get_focalPointRatio",get_interpolationMethod:"get_interpolationMethod",get_spreadMethod:"get_spreadMethod",get_matrix:"get_matrix",get_ratios:"get_ratios",get_alphas:"get_alphas",get_colors:"get_colors",get_type:"get_type"};
openfl_display__$internal_BeginGradientFillView._new = function(d) {
	return d;
};
openfl_display__$internal_BeginGradientFillView.get_type = function(this1) {
	return this1.buffer.o[this1.oPos];
};
openfl_display__$internal_BeginGradientFillView.get_colors = function(this1) {
	return this1.buffer.ii[this1.iiPos];
};
openfl_display__$internal_BeginGradientFillView.get_alphas = function(this1) {
	return this1.buffer.ff[this1.ffPos];
};
openfl_display__$internal_BeginGradientFillView.get_ratios = function(this1) {
	return this1.buffer.ii[this1.iiPos + 1];
};
openfl_display__$internal_BeginGradientFillView.get_matrix = function(this1) {
	return this1.buffer.o[this1.oPos + 1];
};
openfl_display__$internal_BeginGradientFillView.get_spreadMethod = function(this1) {
	return this1.buffer.o[this1.oPos + 2];
};
openfl_display__$internal_BeginGradientFillView.get_interpolationMethod = function(this1) {
	return this1.buffer.o[this1.oPos + 3];
};
openfl_display__$internal_BeginGradientFillView.get_focalPointRatio = function(this1) {
	return this1.buffer.f[this1.fPos];
};
var openfl_display__$internal_BeginShaderFillView = {};
openfl_display__$internal_BeginShaderFillView.__properties__ = {get_shaderBuffer:"get_shaderBuffer"};
openfl_display__$internal_BeginShaderFillView._new = function(d) {
	return d;
};
openfl_display__$internal_BeginShaderFillView.get_shaderBuffer = function(this1) {
	return this1.buffer.o[this1.oPos];
};
var openfl_display__$internal_CubicCurveToView = {};
openfl_display__$internal_CubicCurveToView.__properties__ = {get_anchorY:"get_anchorY",get_anchorX:"get_anchorX",get_controlY2:"get_controlY2",get_controlX2:"get_controlX2",get_controlY1:"get_controlY1",get_controlX1:"get_controlX1"};
openfl_display__$internal_CubicCurveToView._new = function(d) {
	return d;
};
openfl_display__$internal_CubicCurveToView.get_controlX1 = function(this1) {
	return this1.buffer.f[this1.fPos];
};
openfl_display__$internal_CubicCurveToView.get_controlY1 = function(this1) {
	return this1.buffer.f[this1.fPos + 1];
};
openfl_display__$internal_CubicCurveToView.get_controlX2 = function(this1) {
	return this1.buffer.f[this1.fPos + 2];
};
openfl_display__$internal_CubicCurveToView.get_controlY2 = function(this1) {
	return this1.buffer.f[this1.fPos + 3];
};
openfl_display__$internal_CubicCurveToView.get_anchorX = function(this1) {
	return this1.buffer.f[this1.fPos + 4];
};
openfl_display__$internal_CubicCurveToView.get_anchorY = function(this1) {
	return this1.buffer.f[this1.fPos + 5];
};
var openfl_display__$internal_CurveToView = {};
openfl_display__$internal_CurveToView.__properties__ = {get_anchorY:"get_anchorY",get_anchorX:"get_anchorX",get_controlY:"get_controlY",get_controlX:"get_controlX"};
openfl_display__$internal_CurveToView._new = function(d) {
	return d;
};
openfl_display__$internal_CurveToView.get_controlX = function(this1) {
	return this1.buffer.f[this1.fPos];
};
openfl_display__$internal_CurveToView.get_controlY = function(this1) {
	return this1.buffer.f[this1.fPos + 1];
};
openfl_display__$internal_CurveToView.get_anchorX = function(this1) {
	return this1.buffer.f[this1.fPos + 2];
};
openfl_display__$internal_CurveToView.get_anchorY = function(this1) {
	return this1.buffer.f[this1.fPos + 3];
};
var openfl_display__$internal_DrawCircleView = {};
openfl_display__$internal_DrawCircleView.__properties__ = {get_radius:"get_radius",get_y:"get_y",get_x:"get_x"};
openfl_display__$internal_DrawCircleView._new = function(d) {
	return d;
};
openfl_display__$internal_DrawCircleView.get_x = function(this1) {
	return this1.buffer.f[this1.fPos];
};
openfl_display__$internal_DrawCircleView.get_y = function(this1) {
	return this1.buffer.f[this1.fPos + 1];
};
openfl_display__$internal_DrawCircleView.get_radius = function(this1) {
	return this1.buffer.f[this1.fPos + 2];
};
var openfl_display__$internal_DrawEllipseView = {};
openfl_display__$internal_DrawEllipseView.__properties__ = {get_height:"get_height",get_width:"get_width",get_y:"get_y",get_x:"get_x"};
openfl_display__$internal_DrawEllipseView._new = function(d) {
	return d;
};
openfl_display__$internal_DrawEllipseView.get_x = function(this1) {
	return this1.buffer.f[this1.fPos];
};
openfl_display__$internal_DrawEllipseView.get_y = function(this1) {
	return this1.buffer.f[this1.fPos + 1];
};
openfl_display__$internal_DrawEllipseView.get_width = function(this1) {
	return this1.buffer.f[this1.fPos + 2];
};
openfl_display__$internal_DrawEllipseView.get_height = function(this1) {
	return this1.buffer.f[this1.fPos + 3];
};
var openfl_display__$internal_DrawQuadsView = {};
openfl_display__$internal_DrawQuadsView.__properties__ = {get_transforms:"get_transforms",get_indices:"get_indices",get_rects:"get_rects"};
openfl_display__$internal_DrawQuadsView._new = function(d) {
	return d;
};
openfl_display__$internal_DrawQuadsView.get_rects = function(this1) {
	return this1.buffer.o[this1.oPos];
};
openfl_display__$internal_DrawQuadsView.get_indices = function(this1) {
	return this1.buffer.o[this1.oPos + 1];
};
openfl_display__$internal_DrawQuadsView.get_transforms = function(this1) {
	return this1.buffer.o[this1.oPos + 2];
};
var openfl_display__$internal_DrawRectView = {};
openfl_display__$internal_DrawRectView.__properties__ = {get_height:"get_height",get_width:"get_width",get_y:"get_y",get_x:"get_x"};
openfl_display__$internal_DrawRectView._new = function(d) {
	return d;
};
openfl_display__$internal_DrawRectView.get_x = function(this1) {
	return this1.buffer.f[this1.fPos];
};
openfl_display__$internal_DrawRectView.get_y = function(this1) {
	return this1.buffer.f[this1.fPos + 1];
};
openfl_display__$internal_DrawRectView.get_width = function(this1) {
	return this1.buffer.f[this1.fPos + 2];
};
openfl_display__$internal_DrawRectView.get_height = function(this1) {
	return this1.buffer.f[this1.fPos + 3];
};
var openfl_display__$internal_DrawRoundRectView = {};
openfl_display__$internal_DrawRoundRectView.__properties__ = {get_ellipseHeight:"get_ellipseHeight",get_ellipseWidth:"get_ellipseWidth",get_height:"get_height",get_width:"get_width",get_y:"get_y",get_x:"get_x"};
openfl_display__$internal_DrawRoundRectView._new = function(d) {
	return d;
};
openfl_display__$internal_DrawRoundRectView.get_x = function(this1) {
	return this1.buffer.f[this1.fPos];
};
openfl_display__$internal_DrawRoundRectView.get_y = function(this1) {
	return this1.buffer.f[this1.fPos + 1];
};
openfl_display__$internal_DrawRoundRectView.get_width = function(this1) {
	return this1.buffer.f[this1.fPos + 2];
};
openfl_display__$internal_DrawRoundRectView.get_height = function(this1) {
	return this1.buffer.f[this1.fPos + 3];
};
openfl_display__$internal_DrawRoundRectView.get_ellipseWidth = function(this1) {
	return this1.buffer.f[this1.fPos + 4];
};
openfl_display__$internal_DrawRoundRectView.get_ellipseHeight = function(this1) {
	return this1.buffer.o[this1.oPos];
};
var openfl_display__$internal_DrawTrianglesView = {};
openfl_display__$internal_DrawTrianglesView.__properties__ = {get_culling:"get_culling",get_uvtData:"get_uvtData",get_indices:"get_indices",get_vertices:"get_vertices"};
openfl_display__$internal_DrawTrianglesView._new = function(d) {
	return d;
};
openfl_display__$internal_DrawTrianglesView.get_vertices = function(this1) {
	return this1.buffer.o[this1.oPos];
};
openfl_display__$internal_DrawTrianglesView.get_indices = function(this1) {
	return this1.buffer.o[this1.oPos + 1];
};
openfl_display__$internal_DrawTrianglesView.get_uvtData = function(this1) {
	return this1.buffer.o[this1.oPos + 2];
};
openfl_display__$internal_DrawTrianglesView.get_culling = function(this1) {
	return this1.buffer.o[this1.oPos + 3];
};
var openfl_display__$internal_EndFillView = {};
openfl_display__$internal_EndFillView._new = function(d) {
	return d;
};
var openfl_display__$internal_LineBitmapStyleView = {};
openfl_display__$internal_LineBitmapStyleView.__properties__ = {get_smooth:"get_smooth",get_repeat:"get_repeat",get_matrix:"get_matrix",get_bitmap:"get_bitmap"};
openfl_display__$internal_LineBitmapStyleView._new = function(d) {
	return d;
};
openfl_display__$internal_LineBitmapStyleView.get_bitmap = function(this1) {
	return this1.buffer.o[this1.oPos];
};
openfl_display__$internal_LineBitmapStyleView.get_matrix = function(this1) {
	return this1.buffer.o[this1.oPos + 1];
};
openfl_display__$internal_LineBitmapStyleView.get_repeat = function(this1) {
	return this1.buffer.b[this1.bPos];
};
openfl_display__$internal_LineBitmapStyleView.get_smooth = function(this1) {
	return this1.buffer.b[this1.bPos + 1];
};
var openfl_display__$internal_LineGradientStyleView = {};
openfl_display__$internal_LineGradientStyleView.__properties__ = {get_focalPointRatio:"get_focalPointRatio",get_interpolationMethod:"get_interpolationMethod",get_spreadMethod:"get_spreadMethod",get_matrix:"get_matrix",get_ratios:"get_ratios",get_alphas:"get_alphas",get_colors:"get_colors",get_type:"get_type"};
openfl_display__$internal_LineGradientStyleView._new = function(d) {
	return d;
};
openfl_display__$internal_LineGradientStyleView.get_type = function(this1) {
	return this1.buffer.o[this1.oPos];
};
openfl_display__$internal_LineGradientStyleView.get_colors = function(this1) {
	return this1.buffer.ii[this1.iiPos];
};
openfl_display__$internal_LineGradientStyleView.get_alphas = function(this1) {
	return this1.buffer.ff[this1.ffPos];
};
openfl_display__$internal_LineGradientStyleView.get_ratios = function(this1) {
	return this1.buffer.ii[this1.iiPos + 1];
};
openfl_display__$internal_LineGradientStyleView.get_matrix = function(this1) {
	return this1.buffer.o[this1.oPos + 1];
};
openfl_display__$internal_LineGradientStyleView.get_spreadMethod = function(this1) {
	return this1.buffer.o[this1.oPos + 2];
};
openfl_display__$internal_LineGradientStyleView.get_interpolationMethod = function(this1) {
	return this1.buffer.o[this1.oPos + 3];
};
openfl_display__$internal_LineGradientStyleView.get_focalPointRatio = function(this1) {
	return this1.buffer.f[this1.fPos];
};
var openfl_display__$internal_LineStyleView = {};
openfl_display__$internal_LineStyleView.__properties__ = {get_miterLimit:"get_miterLimit",get_joints:"get_joints",get_caps:"get_caps",get_scaleMode:"get_scaleMode",get_pixelHinting:"get_pixelHinting",get_alpha:"get_alpha",get_color:"get_color",get_thickness:"get_thickness"};
openfl_display__$internal_LineStyleView._new = function(d) {
	return d;
};
openfl_display__$internal_LineStyleView.get_thickness = function(this1) {
	return this1.buffer.o[this1.oPos];
};
openfl_display__$internal_LineStyleView.get_color = function(this1) {
	return this1.buffer.i[this1.iPos];
};
openfl_display__$internal_LineStyleView.get_alpha = function(this1) {
	return this1.buffer.f[this1.fPos];
};
openfl_display__$internal_LineStyleView.get_pixelHinting = function(this1) {
	return this1.buffer.b[this1.bPos];
};
openfl_display__$internal_LineStyleView.get_scaleMode = function(this1) {
	return this1.buffer.o[this1.oPos + 1];
};
openfl_display__$internal_LineStyleView.get_caps = function(this1) {
	return this1.buffer.o[this1.oPos + 2];
};
openfl_display__$internal_LineStyleView.get_joints = function(this1) {
	return this1.buffer.o[this1.oPos + 3];
};
openfl_display__$internal_LineStyleView.get_miterLimit = function(this1) {
	return this1.buffer.f[this1.fPos + 1];
};
var openfl_display__$internal_LineToView = {};
openfl_display__$internal_LineToView.__properties__ = {get_y:"get_y",get_x:"get_x"};
openfl_display__$internal_LineToView._new = function(d) {
	return d;
};
openfl_display__$internal_LineToView.get_x = function(this1) {
	return this1.buffer.f[this1.fPos];
};
openfl_display__$internal_LineToView.get_y = function(this1) {
	return this1.buffer.f[this1.fPos + 1];
};
var openfl_display__$internal_MoveToView = {};
openfl_display__$internal_MoveToView.__properties__ = {get_y:"get_y",get_x:"get_x"};
openfl_display__$internal_MoveToView._new = function(d) {
	return d;
};
openfl_display__$internal_MoveToView.get_x = function(this1) {
	return this1.buffer.f[this1.fPos];
};
openfl_display__$internal_MoveToView.get_y = function(this1) {
	return this1.buffer.f[this1.fPos + 1];
};
var openfl_display__$internal_OverrideBlendModeView = {};
openfl_display__$internal_OverrideBlendModeView.__properties__ = {get_blendMode:"get_blendMode"};
openfl_display__$internal_OverrideBlendModeView._new = function(d) {
	return d;
};
openfl_display__$internal_OverrideBlendModeView.get_blendMode = function(this1) {
	return this1.buffer.o[this1.oPos];
};
var openfl_display__$internal_OverrideMatrixView = {};
openfl_display__$internal_OverrideMatrixView.__properties__ = {get_matrix:"get_matrix"};
openfl_display__$internal_OverrideMatrixView._new = function(d) {
	return d;
};
openfl_display__$internal_OverrideMatrixView.get_matrix = function(this1) {
	return this1.buffer.o[this1.oPos];
};
var openfl_display__$internal_WindingEvenOddView = {};
openfl_display__$internal_WindingEvenOddView._new = function(d) {
	return d;
};
var openfl_display__$internal_WindingNonZeroView = {};
openfl_display__$internal_WindingNonZeroView._new = function(d) {
	return d;
};
var openfl_display__$internal_DrawCommandType = $hxEnums["openfl.display._internal.DrawCommandType"] = { __ename__:"openfl.display._internal.DrawCommandType",__constructs__:null
	,BEGIN_BITMAP_FILL: {_hx_name:"BEGIN_BITMAP_FILL",_hx_index:0,__enum__:"openfl.display._internal.DrawCommandType",toString:$estr}
	,BEGIN_FILL: {_hx_name:"BEGIN_FILL",_hx_index:1,__enum__:"openfl.display._internal.DrawCommandType",toString:$estr}
	,BEGIN_GRADIENT_FILL: {_hx_name:"BEGIN_GRADIENT_FILL",_hx_index:2,__enum__:"openfl.display._internal.DrawCommandType",toString:$estr}
	,BEGIN_SHADER_FILL: {_hx_name:"BEGIN_SHADER_FILL",_hx_index:3,__enum__:"openfl.display._internal.DrawCommandType",toString:$estr}
	,CUBIC_CURVE_TO: {_hx_name:"CUBIC_CURVE_TO",_hx_index:4,__enum__:"openfl.display._internal.DrawCommandType",toString:$estr}
	,CURVE_TO: {_hx_name:"CURVE_TO",_hx_index:5,__enum__:"openfl.display._internal.DrawCommandType",toString:$estr}
	,DRAW_CIRCLE: {_hx_name:"DRAW_CIRCLE",_hx_index:6,__enum__:"openfl.display._internal.DrawCommandType",toString:$estr}
	,DRAW_ELLIPSE: {_hx_name:"DRAW_ELLIPSE",_hx_index:7,__enum__:"openfl.display._internal.DrawCommandType",toString:$estr}
	,DRAW_QUADS: {_hx_name:"DRAW_QUADS",_hx_index:8,__enum__:"openfl.display._internal.DrawCommandType",toString:$estr}
	,DRAW_RECT: {_hx_name:"DRAW_RECT",_hx_index:9,__enum__:"openfl.display._internal.DrawCommandType",toString:$estr}
	,DRAW_ROUND_RECT: {_hx_name:"DRAW_ROUND_RECT",_hx_index:10,__enum__:"openfl.display._internal.DrawCommandType",toString:$estr}
	,DRAW_TILES: {_hx_name:"DRAW_TILES",_hx_index:11,__enum__:"openfl.display._internal.DrawCommandType",toString:$estr}
	,DRAW_TRIANGLES: {_hx_name:"DRAW_TRIANGLES",_hx_index:12,__enum__:"openfl.display._internal.DrawCommandType",toString:$estr}
	,END_FILL: {_hx_name:"END_FILL",_hx_index:13,__enum__:"openfl.display._internal.DrawCommandType",toString:$estr}
	,LINE_BITMAP_STYLE: {_hx_name:"LINE_BITMAP_STYLE",_hx_index:14,__enum__:"openfl.display._internal.DrawCommandType",toString:$estr}
	,LINE_GRADIENT_STYLE: {_hx_name:"LINE_GRADIENT_STYLE",_hx_index:15,__enum__:"openfl.display._internal.DrawCommandType",toString:$estr}
	,LINE_STYLE: {_hx_name:"LINE_STYLE",_hx_index:16,__enum__:"openfl.display._internal.DrawCommandType",toString:$estr}
	,LINE_TO: {_hx_name:"LINE_TO",_hx_index:17,__enum__:"openfl.display._internal.DrawCommandType",toString:$estr}
	,MOVE_TO: {_hx_name:"MOVE_TO",_hx_index:18,__enum__:"openfl.display._internal.DrawCommandType",toString:$estr}
	,OVERRIDE_BLEND_MODE: {_hx_name:"OVERRIDE_BLEND_MODE",_hx_index:19,__enum__:"openfl.display._internal.DrawCommandType",toString:$estr}
	,OVERRIDE_MATRIX: {_hx_name:"OVERRIDE_MATRIX",_hx_index:20,__enum__:"openfl.display._internal.DrawCommandType",toString:$estr}
	,WINDING_EVEN_ODD: {_hx_name:"WINDING_EVEN_ODD",_hx_index:21,__enum__:"openfl.display._internal.DrawCommandType",toString:$estr}
	,WINDING_NON_ZERO: {_hx_name:"WINDING_NON_ZERO",_hx_index:22,__enum__:"openfl.display._internal.DrawCommandType",toString:$estr}
	,UNKNOWN: {_hx_name:"UNKNOWN",_hx_index:23,__enum__:"openfl.display._internal.DrawCommandType",toString:$estr}
};
openfl_display__$internal_DrawCommandType.__constructs__ = [openfl_display__$internal_DrawCommandType.BEGIN_BITMAP_FILL,openfl_display__$internal_DrawCommandType.BEGIN_FILL,openfl_display__$internal_DrawCommandType.BEGIN_GRADIENT_FILL,openfl_display__$internal_DrawCommandType.BEGIN_SHADER_FILL,openfl_display__$internal_DrawCommandType.CUBIC_CURVE_TO,openfl_display__$internal_DrawCommandType.CURVE_TO,openfl_display__$internal_DrawCommandType.DRAW_CIRCLE,openfl_display__$internal_DrawCommandType.DRAW_ELLIPSE,openfl_display__$internal_DrawCommandType.DRAW_QUADS,openfl_display__$internal_DrawCommandType.DRAW_RECT,openfl_display__$internal_DrawCommandType.DRAW_ROUND_RECT,openfl_display__$internal_DrawCommandType.DRAW_TILES,openfl_display__$internal_DrawCommandType.DRAW_TRIANGLES,openfl_display__$internal_DrawCommandType.END_FILL,openfl_display__$internal_DrawCommandType.LINE_BITMAP_STYLE,openfl_display__$internal_DrawCommandType.LINE_GRADIENT_STYLE,openfl_display__$internal_DrawCommandType.LINE_STYLE,openfl_display__$internal_DrawCommandType.LINE_TO,openfl_display__$internal_DrawCommandType.MOVE_TO,openfl_display__$internal_DrawCommandType.OVERRIDE_BLEND_MODE,openfl_display__$internal_DrawCommandType.OVERRIDE_MATRIX,openfl_display__$internal_DrawCommandType.WINDING_EVEN_ODD,openfl_display__$internal_DrawCommandType.WINDING_NON_ZERO,openfl_display__$internal_DrawCommandType.UNKNOWN];
var openfl_display__$internal_FlashRenderer = function() { };
$hxClasses["openfl.display._internal.FlashRenderer"] = openfl_display__$internal_FlashRenderer;
openfl_display__$internal_FlashRenderer.__name__ = "openfl.display._internal.FlashRenderer";
openfl_display__$internal_FlashRenderer.register = function(renderObject) {
	if(openfl_display__$internal_FlashRenderer.instances == null) {
		openfl_display__$internal_FlashRenderer.instances = openfl_utils_Dictionary.toObjectMap(null,true);
		openfl_Lib.get_current().stage.addEventListener("enterFrame",openfl_display__$internal_FlashRenderer.render,false,-2147483648);
	}
	openfl_display__$internal_FlashRenderer.instances.set(renderObject,true);
};
openfl_display__$internal_FlashRenderer.render = function(_) {
	var instance = openfl_display__$internal_FlashRenderer.instances.keys();
	while(instance.hasNext()) {
		var instance1 = instance.next();
		instance1.__renderFlash();
	}
};
var openfl_display__$internal_IDisplayObject = function() { };
$hxClasses["openfl.display._internal.IDisplayObject"] = openfl_display__$internal_IDisplayObject;
openfl_display__$internal_IDisplayObject.__name__ = "openfl.display._internal.IDisplayObject";
openfl_display__$internal_IDisplayObject.__isInterface__ = true;
openfl_display__$internal_IDisplayObject.prototype = {
	__renderFlash: null
	,__class__: openfl_display__$internal_IDisplayObject
};
var openfl_display__$internal_FlashTilemap = function() { };
$hxClasses["openfl.display._internal.FlashTilemap"] = openfl_display__$internal_FlashTilemap;
openfl_display__$internal_FlashTilemap.__name__ = "openfl.display._internal.FlashTilemap";
openfl_display__$internal_FlashTilemap.render = function(tilemap) {
};
openfl_display__$internal_FlashTilemap.renderTileContainer = function(group,bitmapData,parentTransform,defaultTileset,smooth,alphaEnabled,worldAlpha,colorTransformEnabled,defaultColorTransform,blendModeEnabled,defaultBlendMode,cacheBitmapData) {
};
var openfl_display__$internal_PerlinNoise = function(seed,octaves,channels,grayScale,falloff,stitch,stitch_threshold) {
	if(stitch_threshold == null) {
		stitch_threshold = 0.05;
	}
	if(stitch == null) {
		stitch = false;
	}
	openfl_display__$internal_AbstractNoise.call(this,seed,octaves,channels,grayScale,falloff,stitch,stitch_threshold);
	this.p_perm = [];
	var _g = 0;
	while(_g < 512) {
		var i = _g++;
		this.p_perm[i] = openfl_display__$internal_PerlinNoise.P[i & 255];
	}
	this.base_factor = 0.03125;
	this.setSeed(seed);
};
$hxClasses["openfl.display._internal.PerlinNoise"] = openfl_display__$internal_PerlinNoise;
openfl_display__$internal_PerlinNoise.__name__ = "openfl.display._internal.PerlinNoise";
openfl_display__$internal_PerlinNoise.__super__ = openfl_display__$internal_AbstractNoise;
openfl_display__$internal_PerlinNoise.prototype = $extend(openfl_display__$internal_AbstractNoise.prototype,{
	p_perm: null
	,x_offset: null
	,y_offset: null
	,z_offset: null
	,base_factor: null
	,fill: function(bitmap,_scale_x,_scale_y,_scale_z) {
		var width = bitmap.width;
		var height = bitmap.height;
		var octaves = this.octaves;
		var octaves_frequencies = this.octaves_frequencies;
		var octaves_persistences = this.octaves_persistences;
		var isRed = (1 & this.channels) == 1;
		var isGreen = (2 & this.channels) == 2;
		var isBlue = (4 & this.channels) == 4;
		var channels = 0;
		if(isRed) {
			++channels;
		}
		if(isGreen) {
			++channels;
		}
		if(isBlue) {
			++channels;
		}
		var grayscale = this.grayscale;
		var stitch_w = this.stitch_threshold * width | 0;
		var stitch_h = this.stitch_threshold * height | 0;
		var base_x = _scale_x * this.base_factor + this.x_offset;
		_scale_y = _scale_y * this.base_factor + this.y_offset;
		_scale_z = _scale_z * this.base_factor + this.z_offset;
		var g_offset = 1.0;
		var b_offset = 2.0;
		var _g = 0;
		var _g1 = height;
		while(_g < _g1) {
			var py = _g++;
			_scale_x = base_x;
			var _g2 = 0;
			var _g3 = width;
			while(_g2 < _g3) {
				var px = _g2++;
				var color1 = 0.0;
				var color2 = 0.0;
				var color3 = 0.0;
				var _g4 = 0;
				var _g5 = octaves;
				while(_g4 < _g5) {
					var i = _g4++;
					var frequency = octaves_frequencies[i];
					var persistence = octaves_persistences[i];
					color1 += this.noise(_scale_x * frequency,_scale_y * frequency,_scale_z * frequency) * persistence;
					if(!grayscale) {
						if(1 < channels) {
							color2 += this.noise((_scale_x + g_offset) * frequency,(_scale_y + g_offset) * frequency,_scale_z * frequency) * persistence;
						}
						if(2 < channels) {
							color3 += this.noise((_scale_x + b_offset) * frequency,(_scale_y + b_offset) * frequency,_scale_z * frequency) * persistence;
						}
					}
				}
				var color = 0;
				if(grayscale) {
					color = this.color(color1,color1,color1);
				} else if(isRed && isGreen && isBlue) {
					color = this.color(color1,color2,color3);
				} else if(isRed && isGreen) {
					color = this.color(color1,color2,null);
				} else if(isRed && isBlue) {
					color = this.color(color1,null,color2);
				} else if(isGreen && isBlue) {
					color = this.color(null,color1,color2);
				} else if(isRed) {
					color = this.color(color1,null,null);
				} else if(isGreen) {
					color = this.color(null,color1,null);
				} else if(isBlue) {
					color = this.color(null,null,color1);
				}
				if(this.stitch) {
					color = this.stitching(bitmap,color,px,py,stitch_w,stitch_h,width,height);
				}
				bitmap.setPixel32(px,py,color);
				_scale_x += this.base_factor;
			}
			_scale_y += this.base_factor;
		}
	}
	,noise: function(x,y,z) {
		var xf = x - x % 1;
		var yf = y - y % 1;
		var zf = z - z % 1;
		x -= xf;
		y -= yf;
		z -= zf;
		var X = (xf | 0) & 255;
		var Y = (yf | 0) & 255;
		var Z = (zf | 0) & 255;
		var u = this.fade(x);
		var v = this.fade(y);
		var w = this.fade(z);
		var A = this.p_perm[X] + Y;
		var AA = this.p_perm[A] + Z;
		var AB = this.p_perm[A + 1] + Z;
		var B = this.p_perm[X + 1] + Y;
		var BA = this.p_perm[B] + Z;
		var BB = this.p_perm[B + 1] + Z;
		var x1 = x - 1;
		var y1 = y - 1;
		var z1 = z - 1;
		var hash = this.p_perm[BB + 1] & 15;
		var g1 = ((hash & 1) == 0 ? hash < 8 ? x1 : y1 : hash < 8 ? -x1 : -y1) + ((hash & 2) == 0 ? hash < 4 ? y1 : hash == 12 ? x1 : z1 : hash < 4 ? -y1 : hash == 14 ? -x1 : -z1);
		hash = this.p_perm[AB + 1] & 15;
		var g2 = ((hash & 1) == 0 ? hash < 8 ? x : y1 : hash < 8 ? -x : -y1) + ((hash & 2) == 0 ? hash < 4 ? y1 : hash == 12 ? x : z1 : hash < 4 ? -y1 : hash == 14 ? -x : -z1);
		hash = this.p_perm[BA + 1] & 15;
		var g3 = ((hash & 1) == 0 ? hash < 8 ? x1 : y : hash < 8 ? -x1 : -y) + ((hash & 2) == 0 ? hash < 4 ? y : hash == 12 ? x1 : z1 : hash < 4 ? -y : hash == 14 ? -x1 : -z1);
		hash = this.p_perm[AA + 1] & 15;
		var g4 = ((hash & 1) == 0 ? hash < 8 ? x : y : hash < 8 ? -x : -y) + ((hash & 2) == 0 ? hash < 4 ? y : hash == 12 ? x : z1 : hash < 4 ? -y : hash == 14 ? -x : -z1);
		hash = this.p_perm[BB] & 15;
		var g5 = ((hash & 1) == 0 ? hash < 8 ? x1 : y1 : hash < 8 ? -x1 : -y1) + ((hash & 2) == 0 ? hash < 4 ? y1 : hash == 12 ? x1 : z : hash < 4 ? -y1 : hash == 14 ? -x1 : -z);
		hash = this.p_perm[AB] & 15;
		var g6 = ((hash & 1) == 0 ? hash < 8 ? x : y1 : hash < 8 ? -x : -y1) + ((hash & 2) == 0 ? hash < 4 ? y1 : hash == 12 ? x : z : hash < 4 ? -y1 : hash == 14 ? -x : -z);
		hash = this.p_perm[BA] & 15;
		var g7 = ((hash & 1) == 0 ? hash < 8 ? x1 : y : hash < 8 ? -x1 : -y) + ((hash & 2) == 0 ? hash < 4 ? y : hash == 12 ? x1 : z : hash < 4 ? -y : hash == 14 ? -x1 : -z);
		hash = this.p_perm[AA] & 15;
		var g8 = ((hash & 1) == 0 ? hash < 8 ? x : y : hash < 8 ? -x : -y) + ((hash & 2) == 0 ? hash < 4 ? y : hash == 12 ? x : z : hash < 4 ? -y : hash == 14 ? -x : -z);
		g2 += u * (g1 - g2);
		g4 += u * (g3 - g4);
		g6 += u * (g5 - g6);
		g8 += u * (g7 - g8);
		g4 += v * (g2 - g4);
		g8 += v * (g6 - g8);
		return g8 + w * (g4 - g8);
	}
	,setSeed: function(seed) {
		seed = seed * 16807.0 % 2147483647 | 0;
		this.x_offset = seed;
		seed = seed * 16807.0 % 2147483647 | 0;
		this.y_offset = seed;
		seed = seed * 16807.0 % 2147483647 | 0;
		this.z_offset = seed;
	}
	,__class__: openfl_display__$internal_PerlinNoise
});
var openfl_display__$internal_SamplerState = function(wrap,filter,mipfilter,lodBias,ignoreSampler,centroid,textureAlpha) {
	if(textureAlpha == null) {
		textureAlpha = false;
	}
	if(centroid == null) {
		centroid = false;
	}
	if(ignoreSampler == null) {
		ignoreSampler = false;
	}
	if(lodBias == null) {
		lodBias = 0.0;
	}
	if(mipfilter == null) {
		mipfilter = 2;
	}
	if(filter == null) {
		filter = 5;
	}
	if(wrap == null) {
		wrap = 0;
	}
	this.wrap = wrap;
	this.filter = filter;
	this.mipfilter = mipfilter;
	this.lodBias = lodBias;
	this.ignoreSampler = ignoreSampler;
	this.centroid = centroid;
	this.textureAlpha = textureAlpha;
};
$hxClasses["openfl.display._internal.SamplerState"] = openfl_display__$internal_SamplerState;
openfl_display__$internal_SamplerState.__name__ = "openfl.display._internal.SamplerState";
openfl_display__$internal_SamplerState.prototype = {
	centroid: null
	,filter: null
	,ignoreSampler: null
	,lodBias: null
	,mipfilter: null
	,mipmapGenerated: null
	,textureAlpha: null
	,wrap: null
	,clone: function() {
		var copy = new openfl_display__$internal_SamplerState(this.wrap,this.filter,this.mipfilter,this.lodBias,this.ignoreSampler,this.centroid,this.textureAlpha);
		copy.mipmapGenerated = this.mipmapGenerated;
		return copy;
	}
	,copyFrom: function(other) {
		if(other == null || other.ignoreSampler) {
			return;
		}
		this.wrap = other.wrap;
		this.filter = other.filter;
		this.mipfilter = other.mipfilter;
		this.lodBias = other.lodBias;
		this.centroid = other.centroid;
		this.textureAlpha = other.textureAlpha;
	}
	,equals: function(other) {
		if(other == null) {
			return false;
		}
		if(this.wrap == other.wrap && this.filter == other.filter && this.mipfilter == other.mipfilter && this.lodBias == other.lodBias) {
			return this.textureAlpha == other.textureAlpha;
		} else {
			return false;
		}
	}
	,__class__: openfl_display__$internal_SamplerState
};
var openfl_display__$internal_ShaderBuffer = function() {
	this.inputRefs = [];
	this.inputFilter = [];
	this.inputMipFilter = [];
	this.inputs = [];
	this.inputWrap = [];
	this.overrideIntNames = [];
	this.overrideIntValues = [];
	this.overrideFloatNames = [];
	this.overrideFloatValues = [];
	this.overrideBoolNames = [];
	this.overrideBoolValues = [];
	this.paramLengths = [];
	this.paramPositions = [];
	this.paramRefs_Bool = [];
	this.paramRefs_Float = [];
	this.paramRefs_Int = [];
	this.paramTypes = [];
};
$hxClasses["openfl.display._internal.ShaderBuffer"] = openfl_display__$internal_ShaderBuffer;
openfl_display__$internal_ShaderBuffer.__name__ = "openfl.display._internal.ShaderBuffer";
openfl_display__$internal_ShaderBuffer.prototype = {
	inputCount: null
	,inputRefs: null
	,inputFilter: null
	,inputMipFilter: null
	,inputs: null
	,inputWrap: null
	,overrideBoolCount: null
	,overrideBoolNames: null
	,overrideBoolValues: null
	,overrideFloatCount: null
	,overrideFloatNames: null
	,overrideFloatValues: null
	,overrideIntCount: null
	,overrideIntNames: null
	,overrideIntValues: null
	,paramBoolCount: null
	,paramCount: null
	,paramData: null
	,paramDataBuffer: null
	,paramDataLength: null
	,paramFloatCount: null
	,paramIntCount: null
	,paramLengths: null
	,paramPositions: null
	,paramRefs_Bool: null
	,paramRefs_Float: null
	,paramRefs_Int: null
	,paramTypes: null
	,shader: null
	,addBoolOverride: function(name,values) {
		this.overrideBoolNames[this.overrideBoolCount] = name;
		this.overrideBoolValues[this.overrideBoolCount] = values;
		this.overrideBoolCount++;
	}
	,addFloatOverride: function(name,values) {
		this.overrideFloatNames[this.overrideFloatCount] = name;
		this.overrideFloatValues[this.overrideFloatCount] = values;
		this.overrideFloatCount++;
	}
	,addIntOverride: function(name,values) {
		this.overrideIntNames[this.overrideIntCount] = name;
		this.overrideIntValues[this.overrideIntCount] = values;
		this.overrideIntCount++;
	}
	,clearOverride: function() {
		this.overrideIntCount = 0;
		this.overrideFloatCount = 0;
		this.overrideBoolCount = 0;
	}
	,update: function(shader) {
		this.inputCount = 0;
		this.overrideIntCount = 0;
		this.overrideFloatCount = 0;
		this.overrideBoolCount = 0;
		this.paramBoolCount = 0;
		this.paramCount = 0;
		this.paramDataLength = 0;
		this.paramFloatCount = 0;
		this.paramIntCount = 0;
		this.shader = null;
		if(shader == null) {
			return;
		}
		shader.__init();
		this.inputCount = shader.__inputBitmapData.length;
		var input;
		var _g = 0;
		var _g1 = this.inputCount;
		while(_g < _g1) {
			var i = _g++;
			input = shader.__inputBitmapData[i];
			this.inputs[i] = input.input;
			this.inputFilter[i] = input.filter;
			this.inputMipFilter[i] = input.mipFilter;
			this.inputRefs[i] = input;
			this.inputWrap[i] = input.wrap;
		}
		var boolCount = shader.__paramBool.length;
		var floatCount = shader.__paramFloat.length;
		var intCount = shader.__paramInt.length;
		this.paramCount = boolCount + floatCount + intCount;
		this.paramBoolCount = boolCount;
		this.paramFloatCount = floatCount;
		this.paramIntCount = intCount;
		var length = 0;
		var p = 0;
		var param;
		var _g = 0;
		var _g1 = boolCount;
		while(_g < _g1) {
			var i = _g++;
			param = shader.__paramBool[i];
			this.paramPositions[p] = this.paramDataLength;
			length = param.value != null ? param.value.length : 0;
			this.paramLengths[p] = length;
			this.paramDataLength += length;
			this.paramTypes[p] = 0;
			this.paramRefs_Bool[i] = param;
			++p;
		}
		var param;
		var _g = 0;
		var _g1 = floatCount;
		while(_g < _g1) {
			var i = _g++;
			param = shader.__paramFloat[i];
			this.paramPositions[p] = this.paramDataLength;
			length = param.value != null ? param.value.length : 0;
			this.paramLengths[p] = length;
			this.paramDataLength += length;
			this.paramTypes[p] = 1;
			this.paramRefs_Float[i] = param;
			++p;
		}
		var param;
		var _g = 0;
		var _g1 = intCount;
		while(_g < _g1) {
			var i = _g++;
			param = shader.__paramInt[i];
			this.paramPositions[p] = this.paramDataLength;
			length = param.value != null ? param.value.length : 0;
			this.paramLengths[p] = length;
			this.paramDataLength += length;
			this.paramTypes[p] = 2;
			this.paramRefs_Int[i] = param;
			++p;
		}
		if(this.paramDataLength > 0) {
			if(this.paramData == null) {
				var elements = this.paramDataLength;
				var array = null;
				var vector = null;
				var view = null;
				var buffer = null;
				var len = null;
				var this1;
				if(elements != null) {
					this1 = new Float32Array(elements);
				} else if(array != null) {
					this1 = new Float32Array(array);
				} else if(vector != null) {
					this1 = new Float32Array(vector.__array);
				} else if(view != null) {
					this1 = new Float32Array(view);
				} else if(buffer != null) {
					if(len == null) {
						this1 = new Float32Array(buffer,0);
					} else {
						this1 = new Float32Array(buffer,0,len);
					}
				} else {
					this1 = null;
				}
				this.paramData = this1;
			} else if(this.paramDataLength > this.paramData.length) {
				var elements = this.paramDataLength;
				var array = null;
				var vector = null;
				var view = null;
				var buffer = null;
				var len = null;
				var this1;
				if(elements != null) {
					this1 = new Float32Array(elements);
				} else if(array != null) {
					this1 = new Float32Array(array);
				} else if(vector != null) {
					this1 = new Float32Array(vector.__array);
				} else if(view != null) {
					this1 = new Float32Array(view);
				} else if(buffer != null) {
					if(len == null) {
						this1 = new Float32Array(buffer,0);
					} else {
						this1 = new Float32Array(buffer,0,len);
					}
				} else {
					this1 = null;
				}
				var data = this1;
				data.set(this.paramData);
				this.paramData = data;
			}
		}
		var boolIndex = 0;
		var floatIndex = 0;
		var intIndex = 0;
		var paramPosition = 0;
		var boolParam;
		var floatParam;
		var intParam;
		var length;
		var _g = 0;
		var _g1 = this.paramCount;
		while(_g < _g1) {
			var i = _g++;
			length = this.paramLengths[i];
			if(i < boolCount) {
				boolParam = this.paramRefs_Bool[boolIndex];
				++boolIndex;
				var _g2 = 0;
				var _g3 = length;
				while(_g2 < _g3) {
					var j = _g2++;
					this.paramData[paramPosition] = boolParam.value[j] ? 1 : 0;
					++paramPosition;
				}
			} else if(i < boolCount + floatCount) {
				floatParam = this.paramRefs_Float[floatIndex];
				++floatIndex;
				var _g4 = 0;
				var _g5 = length;
				while(_g4 < _g5) {
					var j1 = _g4++;
					this.paramData[paramPosition] = floatParam.value[j1];
					++paramPosition;
				}
			} else {
				intParam = this.paramRefs_Int[intIndex];
				++intIndex;
				var _g6 = 0;
				var _g7 = length;
				while(_g6 < _g7) {
					var j2 = _g6++;
					this.paramData[paramPosition] = intParam.value[j2];
					++paramPosition;
				}
			}
		}
		this.shader = shader;
	}
	,__class__: openfl_display__$internal_ShaderBuffer
};
var openfl_display__$internal_stats_DrawCallCounter = function() {
	this.drawCallsCounter = 0;
	this.currentDrawCallsNum = 0;
	this.currentDrawCallsNum = 0;
	this.drawCallsCounter = 0;
};
$hxClasses["openfl.display._internal.stats.DrawCallCounter"] = openfl_display__$internal_stats_DrawCallCounter;
openfl_display__$internal_stats_DrawCallCounter.__name__ = "openfl.display._internal.stats.DrawCallCounter";
openfl_display__$internal_stats_DrawCallCounter.prototype = {
	currentDrawCallsNum: null
	,drawCallsCounter: null
	,increment: function() {
		this.drawCallsCounter++;
	}
	,reset: function() {
		this.currentDrawCallsNum = this.drawCallsCounter;
		this.drawCallsCounter = 0;
	}
	,__class__: openfl_display__$internal_stats_DrawCallCounter
};
var openfl_display__$internal_stats_Context3DStats = function() { };
$hxClasses["openfl.display._internal.stats.Context3DStats"] = openfl_display__$internal_stats_Context3DStats;
openfl_display__$internal_stats_Context3DStats.__name__ = "openfl.display._internal.stats.Context3DStats";
openfl_display__$internal_stats_Context3DStats.incrementDrawCall = function(context) {
	openfl_display__$internal_stats_Context3DStats.drawCallsCounters.h[context].increment();
};
openfl_display__$internal_stats_Context3DStats.resetDrawCalls = function() {
	var dcCounter = openfl_display__$internal_stats_Context3DStats.drawCallsCounters.iterator();
	while(dcCounter.hasNext()) {
		var dcCounter1 = dcCounter.next();
		dcCounter1.reset();
	}
};
openfl_display__$internal_stats_Context3DStats.totalDrawCalls = function() {
	var total = 0;
	var dcCounter = openfl_display__$internal_stats_Context3DStats.drawCallsCounters.iterator();
	while(dcCounter.hasNext()) {
		var dcCounter1 = dcCounter.next();
		total += dcCounter1.currentDrawCallsNum;
	}
	return total;
};
openfl_display__$internal_stats_Context3DStats.contextDrawCalls = function(context) {
	return openfl_display__$internal_stats_Context3DStats.drawCallsCounters.h[context].currentDrawCallsNum;
};
var openfl_display3D_Context3D = function(stage,contextState,stage3D) {
	this.profile = 3;
	this.driverInfo = "OpenGL (Direct blitting)";
	this.backBufferWidth = 0;
	this.backBufferHeight = 0;
	openfl_events_EventDispatcher.call(this);
	this.__stage = stage;
	this.__contextState = contextState;
	this.__stage3D = stage3D;
	this.__context = stage.window.context;
	this.gl = this.__context.webgl;
	if(this.__contextState == null) {
		this.__contextState = new openfl_display3D__$internal_Context3DState();
	}
	this.__state = new openfl_display3D__$internal_Context3DState();
	var array = null;
	var vector = null;
	var view = null;
	var buffer = null;
	var len = null;
	this.__vertexConstants = new Float32Array(512);
	var array = null;
	var vector = null;
	var view = null;
	var buffer = null;
	var len = null;
	this.__fragmentConstants = new Float32Array(512);
	var elements = null;
	var array = [1.0,1.0,1.0,1.0];
	var vector = null;
	var view = null;
	var buffer = null;
	var len = null;
	var this1;
	if(elements != null) {
		this1 = new Float32Array(elements);
	} else if(array != null) {
		this1 = new Float32Array(array);
	} else if(vector != null) {
		this1 = new Float32Array(vector.__array);
	} else if(view != null) {
		this1 = new Float32Array(view);
	} else if(buffer != null) {
		if(len == null) {
			this1 = new Float32Array(buffer,0);
		} else {
			this1 = new Float32Array(buffer,0,len);
		}
	} else {
		this1 = null;
	}
	this.__positionScale = this1;
	this.__programs = new haxe_ds_StringMap();
	if(openfl_display3D_Context3D.__glMaxViewportDims == -1) {
		openfl_display3D_Context3D.__glMaxViewportDims = this.gl.getParameter(this.gl.MAX_VIEWPORT_DIMS);
	}
	this.maxBackBufferWidth = openfl_display3D_Context3D.__glMaxViewportDims;
	this.maxBackBufferHeight = openfl_display3D_Context3D.__glMaxViewportDims;
	if(openfl_display3D_Context3D.__glMaxTextureMaxAnisotropy == -1) {
		var extension = this.gl.getExtension("EXT_texture_filter_anisotropic");
		if(extension == null || !Object.prototype.hasOwnProperty.call(extension,"MAX_TEXTURE_MAX_ANISOTROPY_EXT")) {
			extension = this.gl.getExtension("MOZ_EXT_texture_filter_anisotropic");
		}
		if(extension == null || !Object.prototype.hasOwnProperty.call(extension,"MAX_TEXTURE_MAX_ANISOTROPY_EXT")) {
			extension = this.gl.getExtension("WEBKIT_EXT_texture_filter_anisotropic");
		}
		if(extension != null) {
			openfl_display3D_Context3D.__glTextureMaxAnisotropy = extension.TEXTURE_MAX_ANISOTROPY_EXT;
			openfl_display3D_Context3D.__glMaxTextureMaxAnisotropy = this.gl.getParameter(extension.MAX_TEXTURE_MAX_ANISOTROPY_EXT);
		} else {
			openfl_display3D_Context3D.__glTextureMaxAnisotropy = 0;
			openfl_display3D_Context3D.__glMaxTextureMaxAnisotropy = 0;
		}
	}
	if(openfl_display3D_Context3D.__glDepthStencil == -1) {
		openfl_display3D_Context3D.__glDepthStencil = this.gl.DEPTH_STENCIL;
	}
	if(openfl_display3D_Context3D.__glMemoryTotalAvailable == -1) {
		var extension = this.gl.getExtension("NVX_gpu_memory_info");
		if(extension != null) {
			openfl_display3D_Context3D.__glMemoryTotalAvailable = extension.GPU_MEMORY_INFO_DEDICATED_VIDMEM_NVX;
			openfl_display3D_Context3D.__glMemoryCurrentAvailable = extension.GPU_MEMORY_INFO_CURRENT_AVAILABLE_VIDMEM_NVX;
		}
	}
	if(openfl_display3D_Context3D.__driverInfo == null) {
		var vendor = this.gl.getParameter(this.gl.VENDOR);
		var version = this.gl.getParameter(this.gl.VERSION);
		var renderer = this.gl.getParameter(this.gl.RENDERER);
		var glslVersion = this.gl.getParameter(this.gl.SHADING_LANGUAGE_VERSION);
		openfl_display3D_Context3D.__driverInfo = "OpenGL Vendor=" + vendor + " Version=" + version + " Renderer=" + renderer + " GLSL=" + glslVersion;
	}
	this.driverInfo = openfl_display3D_Context3D.__driverInfo;
	this.__quadIndexBufferElements = 16383;
	this.__quadIndexBufferCount = this.__quadIndexBufferElements * 6;
	var elements = this.__quadIndexBufferCount;
	var array = null;
	var vector = null;
	var view = null;
	var buffer = null;
	var len = null;
	var this1;
	if(elements != null) {
		this1 = new Uint16Array(elements);
	} else if(array != null) {
		this1 = new Uint16Array(array);
	} else if(vector != null) {
		this1 = new Uint16Array(vector.__array);
	} else if(view != null) {
		this1 = new Uint16Array(view);
	} else if(buffer != null) {
		if(len == null) {
			this1 = new Uint16Array(buffer,0);
		} else {
			this1 = new Uint16Array(buffer,0,len);
		}
	} else {
		this1 = null;
	}
	var data = this1;
	var index = 0;
	var vertex = 0;
	var _g = 0;
	var _g1 = this.__quadIndexBufferElements;
	while(_g < _g1) {
		var i = _g++;
		data[index] = vertex;
		data[index + 1] = vertex + 1;
		data[index + 2] = vertex + 2;
		data[index + 3] = vertex + 2;
		data[index + 4] = vertex + 1;
		data[index + 5] = vertex + 3;
		index = index + 6;
		vertex = vertex + 4;
	}
	this.__quadIndexBuffer = this.createIndexBuffer(this.__quadIndexBufferCount);
	this.__quadIndexBuffer.uploadFromTypedArray(data);
};
$hxClasses["openfl.display3D.Context3D"] = openfl_display3D_Context3D;
openfl_display3D_Context3D.__name__ = "openfl.display3D.Context3D";
openfl_display3D_Context3D.__super__ = openfl_events_EventDispatcher;
openfl_display3D_Context3D.prototype = $extend(openfl_events_EventDispatcher.prototype,{
	backBufferHeight: null
	,backBufferWidth: null
	,driverInfo: null
	,maxBackBufferHeight: null
	,maxBackBufferWidth: null
	,profile: null
	,gl: null
	,__backBufferAntiAlias: null
	,__backBufferTexture: null
	,__backBufferWantsBestResolution: null
	,__backBufferWantsBestResolutionOnBrowserZoom: null
	,__cleared: null
	,__context: null
	,__contextState: null
	,__renderStage3DProgram: null
	,__enableErrorChecking: null
	,__fragmentConstants: null
	,__frontBufferTexture: null
	,__positionScale: null
	,__present: null
	,__programs: null
	,__quadIndexBuffer: null
	,__quadIndexBufferCount: null
	,__quadIndexBufferElements: null
	,__stage: null
	,__stage3D: null
	,__state: null
	,__vertexConstants: null
	,clear: function(red,green,blue,alpha,depth,stencil,mask) {
		if(mask == null) {
			mask = 7;
		}
		if(stencil == null) {
			stencil = 0;
		}
		if(depth == null) {
			depth = 1;
		}
		if(alpha == null) {
			alpha = 1;
		}
		if(blue == null) {
			blue = 0;
		}
		if(green == null) {
			green = 0;
		}
		if(red == null) {
			red = 0;
		}
		this.__clear(false,red,green,blue,alpha,depth,stencil,mask);
	}
	,__clear: function(useScissor,red,green,blue,alpha,depth,stencil,mask) {
		if(mask == null) {
			mask = 7;
		}
		if(stencil == null) {
			stencil = 0;
		}
		if(depth == null) {
			depth = 1;
		}
		if(alpha == null) {
			alpha = 1;
		}
		if(blue == null) {
			blue = 0;
		}
		if(green == null) {
			green = 0;
		}
		if(red == null) {
			red = 0;
		}
		this.__flushGLFramebuffer();
		this.__flushGLViewport();
		var clearMask = 0;
		if((mask & 1) != 0) {
			if(this.__state.renderToTexture == null) {
				if(this.__stage.context3D == this && !this.__stage.__renderer.__cleared) {
					this.__stage.__renderer.__cleared = true;
				}
				this.__cleared = true;
			}
			clearMask |= this.gl.COLOR_BUFFER_BIT;
			if(this.__contextState.colorMaskRed != true || this.__contextState.colorMaskGreen != true || this.__contextState.colorMaskBlue != true || this.__contextState.colorMaskAlpha != true) {
				this.gl.colorMask(true,true,true,true);
				this.__contextState.colorMaskRed = true;
				this.__contextState.colorMaskGreen = true;
				this.__contextState.colorMaskBlue = true;
				this.__contextState.colorMaskAlpha = true;
			}
			this.gl.clearColor(red,green,blue,alpha);
		}
		if((mask & 2) != 0) {
			clearMask |= this.gl.DEPTH_BUFFER_BIT;
			if(this.__contextState.depthMask != true) {
				this.gl.depthMask(true);
				this.__contextState.depthMask = true;
			}
			this.gl.clearDepth(depth);
		}
		if((mask & 4) != 0) {
			clearMask |= this.gl.STENCIL_BUFFER_BIT;
			if(this.__contextState.stencilWriteMask != 255) {
				this.gl.stencilMask(255);
				this.__contextState.stencilWriteMask = 255;
			}
			this.gl.clearStencil(stencil);
			this.__contextState.stencilWriteMask = 255;
		}
		if(clearMask == 0) {
			return;
		}
		if(useScissor) {
			this.__flushGLScissor();
		} else {
			this.__setGLScissorTest(false);
		}
		this.gl.clear(clearMask);
	}
	,configureBackBuffer: function(width,height,antiAlias,enableDepthAndStencil,wantsBestResolution,wantsBestResolutionOnBrowserZoom) {
		if(wantsBestResolutionOnBrowserZoom == null) {
			wantsBestResolutionOnBrowserZoom = false;
		}
		if(wantsBestResolution == null) {
			wantsBestResolution = false;
		}
		if(enableDepthAndStencil == null) {
			enableDepthAndStencil = true;
		}
		if(wantsBestResolution) {
			width = width * this.__stage.window.__scale | 0;
			height = height * this.__stage.window.__scale | 0;
		}
		if(this.__stage3D == null) {
			this.backBufferWidth = width;
			this.backBufferHeight = height;
			this.__backBufferAntiAlias = antiAlias;
			this.__state.backBufferEnableDepthAndStencil = enableDepthAndStencil;
			this.__backBufferWantsBestResolution = wantsBestResolution;
			this.__backBufferWantsBestResolutionOnBrowserZoom = wantsBestResolutionOnBrowserZoom;
		} else {
			if(this.__backBufferTexture == null || this.backBufferWidth != width || this.backBufferHeight != height) {
				if(this.__backBufferTexture != null) {
					this.__backBufferTexture.dispose();
				}
				if(this.__frontBufferTexture != null) {
					this.__frontBufferTexture.dispose();
				}
				this.__backBufferTexture = this.createRectangleTexture(width,height,1,true);
				this.__frontBufferTexture = this.createRectangleTexture(width,height,1,true);
				if(this.__stage3D.__vertexBuffer == null) {
					this.__stage3D.__vertexBuffer = this.createVertexBuffer(4,5);
				}
				var scaledWidth = wantsBestResolution ? width : width * this.__stage.window.__scale | 0;
				var scaledHeight = wantsBestResolution ? height : height * this.__stage.window.__scale | 0;
				var vertexData = openfl_Vector.toFloatVector(null,null,null,[scaledWidth,scaledHeight,0,1,1,0,scaledHeight,0,0,1,scaledWidth,0,0,1,0,0,0,0,0,0.0]);
				this.__stage3D.__vertexBuffer.uploadFromVector(vertexData,0,20);
				if(this.__stage3D.__indexBuffer == null) {
					this.__stage3D.__indexBuffer = this.createIndexBuffer(6);
					var indexData = openfl_Vector.toIntVector(null,null,null,[0,1,2,2,1,3]);
					this.__stage3D.__indexBuffer.uploadFromVector(indexData,0,6);
				}
			}
			this.backBufferWidth = width;
			this.backBufferHeight = height;
			this.__backBufferAntiAlias = antiAlias;
			this.__state.backBufferEnableDepthAndStencil = enableDepthAndStencil;
			this.__backBufferWantsBestResolution = wantsBestResolution;
			this.__backBufferWantsBestResolutionOnBrowserZoom = wantsBestResolutionOnBrowserZoom;
			this.__state.__primaryGLFramebuffer = this.__backBufferTexture.__getGLFramebuffer(enableDepthAndStencil,antiAlias,0);
			this.__frontBufferTexture.__getGLFramebuffer(enableDepthAndStencil,antiAlias,0);
		}
	}
	,createCubeTexture: function(size,format,optimizeForRenderToTexture,streamingLevels) {
		if(streamingLevels == null) {
			streamingLevels = 0;
		}
		return new openfl_display3D_textures_CubeTexture(this,size,format,optimizeForRenderToTexture,streamingLevels);
	}
	,createIndexBuffer: function(numIndices,bufferUsage) {
		if(bufferUsage == null) {
			bufferUsage = 1;
		}
		return new openfl_display3D_IndexBuffer3D(this,numIndices,bufferUsage);
	}
	,createProgram: function(format) {
		if(format == null) {
			format = 0;
		}
		return new openfl_display3D_Program3D(this,format);
	}
	,createRectangleTexture: function(width,height,format,optimizeForRenderToTexture) {
		return new openfl_display3D_textures_RectangleTexture(this,width,height,openfl_display3D_Context3DTextureFormat.toString(format),optimizeForRenderToTexture);
	}
	,createTexture: function(width,height,format,optimizeForRenderToTexture,streamingLevels) {
		if(streamingLevels == null) {
			streamingLevels = 0;
		}
		return new openfl_display3D_textures_Texture(this,width,height,format,optimizeForRenderToTexture,streamingLevels);
	}
	,createVertexBuffer: function(numVertices,data32PerVertex,bufferUsage) {
		if(bufferUsage == null) {
			bufferUsage = 1;
		}
		return new openfl_display3D_VertexBuffer3D(this,numVertices,data32PerVertex,openfl_display3D_Context3DBufferUsage.toString(bufferUsage));
	}
	,createVideoTexture: function() {
		return new openfl_display3D_textures_VideoTexture(this);
	}
	,dispose: function(recreate) {
		if(recreate == null) {
			recreate = true;
		}
		this.gl = null;
		this.__dispose();
	}
	,drawToBitmapData: function(destination,srcRect,destPoint) {
		if(destination == null) {
			return;
		}
		var sourceRect = srcRect != null ? srcRect.__toLimeRectangle() : new lime_math_Rectangle(0,0,this.backBufferWidth,this.backBufferHeight);
		var destVector = destPoint != null ? destPoint.__toLimeVector2() : new lime_math_Vector2();
		if(this.__stage.context3D == this) {
			if(this.__stage.window != null) {
				if(this.__stage3D != null) {
					var xa = -this.__stage3D.get_x() | 0;
					var ya = -this.__stage3D.get_y() | 0;
					destVector.x = xa;
					destVector.y = ya;
				}
				var image = this.__stage.window.readPixels();
				destination.image.copyPixels(image,sourceRect,destVector);
			}
		} else if(this.__backBufferTexture != null) {
			var cacheRenderToTexture = this.__state.renderToTexture;
			this.setRenderToBackBuffer();
			this.__flushGLFramebuffer();
			this.__flushGLViewport();
			var elements = this.backBufferWidth * this.backBufferHeight * 4;
			var array = null;
			var vector = null;
			var view = null;
			var buffer = null;
			var len = null;
			var this1;
			if(elements != null) {
				this1 = new Uint8Array(elements);
			} else if(array != null) {
				this1 = new Uint8Array(array);
			} else if(vector != null) {
				this1 = new Uint8Array(vector.__array);
			} else if(view != null) {
				this1 = new Uint8Array(view);
			} else if(buffer != null) {
				if(len == null) {
					this1 = new Uint8Array(buffer,0);
				} else {
					this1 = new Uint8Array(buffer,0,len);
				}
			} else {
				this1 = null;
			}
			var data = this1;
			var this1 = this.gl;
			var width = this.backBufferWidth;
			var height = this.backBufferHeight;
			var format = this.__backBufferTexture.__format;
			var type = this.gl.UNSIGNED_BYTE;
			var pixels = data;
			var dstOffset = null;
			if(dstOffset != null) {
				this1.readPixels(0,0,width,height,format,type,pixels,dstOffset);
			} else {
				this1.readPixels(0,0,width,height,format,type,pixels);
			}
			var image = new lime_graphics_Image(new lime_graphics_ImageBuffer(data,this.backBufferWidth,this.backBufferHeight,32,2));
			destination.image.copyPixels(image,sourceRect,destVector);
			if(cacheRenderToTexture != null) {
				this.setRenderToTexture(cacheRenderToTexture,this.__state.renderToTextureDepthStencil,this.__state.renderToTextureAntiAlias,this.__state.renderToTextureSurfaceSelector);
			}
		}
	}
	,drawTriangles: function(indexBuffer,firstIndex,numTriangles) {
		if(numTriangles == null) {
			numTriangles = -1;
		}
		if(firstIndex == null) {
			firstIndex = 0;
		}
		if(this.__state.renderToTexture == null) {
			if(this.__stage.context3D == this && !this.__stage.__renderer.__cleared) {
				this.__stage.__renderer.__clear();
			} else if(!this.__cleared) {
				this.clear(0,0,0,0,1,0,1);
			}
		}
		this.__flushGL();
		if(this.__state.program != null) {
			this.__state.program.__flush();
		}
		var count = numTriangles == -1 ? indexBuffer.__numIndices : numTriangles * 3;
		this.__bindGLElementArrayBuffer(indexBuffer.__id);
		this.gl.drawElements(this.gl.TRIANGLES,count,this.gl.UNSIGNED_SHORT,firstIndex * 2);
	}
	,present: function() {
		this.setRenderToBackBuffer();
		if(this.__stage3D != null && this.__backBufferTexture != null) {
			if(!this.__cleared) {
				this.clear(0,0,0,0,1,0,1);
			}
			var cacheBuffer = this.__backBufferTexture;
			this.__backBufferTexture = this.__frontBufferTexture;
			this.__frontBufferTexture = cacheBuffer;
			this.__state.__primaryGLFramebuffer = this.__backBufferTexture.__getGLFramebuffer(this.__state.backBufferEnableDepthAndStencil,this.__backBufferAntiAlias,0);
			this.__cleared = false;
		}
		this.__present = true;
	}
	,setBlendFactors: function(sourceFactor,destinationFactor) {
		this.setBlendFactorsSeparate(sourceFactor,destinationFactor,sourceFactor,destinationFactor);
	}
	,setBlendFactorsSeparate: function(sourceRGBFactor,destinationRGBFactor,sourceAlphaFactor,destinationAlphaFactor) {
		this.__state.blendSourceRGBFactor = sourceRGBFactor;
		this.__state.blendDestinationRGBFactor = destinationRGBFactor;
		this.__state.blendSourceAlphaFactor = sourceAlphaFactor;
		this.__state.blendDestinationAlphaFactor = destinationAlphaFactor;
		this.__setGLBlendEquation(this.gl.FUNC_ADD);
	}
	,setColorMask: function(red,green,blue,alpha) {
		this.__state.colorMaskRed = red;
		this.__state.colorMaskGreen = green;
		this.__state.colorMaskBlue = blue;
		this.__state.colorMaskAlpha = alpha;
	}
	,setCulling: function(triangleFaceToCull) {
		this.__state.culling = triangleFaceToCull;
	}
	,setDepthTest: function(depthMask,passCompareMode) {
		this.__state.depthMask = depthMask;
		this.__state.depthCompareMode = passCompareMode;
	}
	,setProgram: function(program) {
		this.__state.program = program;
		this.__state.shader = null;
		if(program != null) {
			var _g = 0;
			var _g1 = program.__samplerStates.length;
			while(_g < _g1) {
				var i = _g++;
				if(this.__state.samplerStates[i] == null) {
					this.__state.samplerStates[i] = program.__samplerStates[i].clone();
				} else {
					this.__state.samplerStates[i].copyFrom(program.__samplerStates[i]);
				}
			}
		}
	}
	,setProgramConstantsFromByteArray: function(programType,firstRegister,numRegisters,data,byteArrayOffset) {
		if(numRegisters == 0 || this.__state.program == null) {
			return;
		}
		if(!(this.__state.program != null && this.__state.program.__format == 1)) {
			if(numRegisters == -1) {
				numRegisters = (openfl_utils_ByteArray.get_length(data) >>> 2) - byteArrayOffset;
			}
			var isVertex = programType == 1;
			var dest = isVertex ? this.__vertexConstants : this.__fragmentConstants;
			var bytes = openfl_utils_ByteArray.toBytes(data);
			var byteOffset = 0;
			var len = null;
			if(byteOffset == null) {
				byteOffset = 0;
			}
			var floatData = byteOffset == null ? new Float32Array(bytes.b.bufferValue) : len == null ? new Float32Array(bytes.b.bufferValue,byteOffset) : new Float32Array(bytes.b.bufferValue,byteOffset,len);
			var outOffset = firstRegister * 4;
			var inOffset = UInt.toFloat(byteArrayOffset) / UInt.toFloat(4) | 0;
			var _g = 0;
			var _g1 = numRegisters * 4;
			while(_g < _g1) {
				var i = _g++;
				dest[outOffset + i] = floatData[inOffset + i];
			}
			if(this.__state.program != null) {
				this.__state.program.__markDirty(isVertex,firstRegister,numRegisters);
			}
		}
	}
	,setProgramConstantsFromMatrix: function(programType,firstRegister,matrix,transposedMatrix) {
		if(transposedMatrix == null) {
			transposedMatrix = false;
		}
		if(this.__state.program != null && this.__state.program.__format == 1) {
			this.__flushGLProgram();
			var array = null;
			var vector = null;
			var view = null;
			var buffer = null;
			var len = null;
			var data = new Float32Array(16);
			data[0] = matrix.rawData.get(0);
			data[1] = matrix.rawData.get(1);
			data[2] = matrix.rawData.get(2);
			data[3] = matrix.rawData.get(3);
			data[4] = matrix.rawData.get(4);
			data[5] = matrix.rawData.get(5);
			data[6] = matrix.rawData.get(6);
			data[7] = matrix.rawData.get(7);
			data[8] = matrix.rawData.get(8);
			data[9] = matrix.rawData.get(9);
			data[10] = matrix.rawData.get(10);
			data[11] = matrix.rawData.get(11);
			data[12] = matrix.rawData.get(12);
			data[13] = matrix.rawData.get(13);
			data[14] = matrix.rawData.get(14);
			data[15] = matrix.rawData.get(15);
			lime_graphics_WebGLRenderContext.uniformMatrix4fv(this.gl,firstRegister,transposedMatrix,data);
		} else {
			var isVertex = programType == 1;
			var dest = isVertex ? this.__vertexConstants : this.__fragmentConstants;
			var source = matrix.rawData;
			var i = firstRegister * 4;
			if(transposedMatrix) {
				dest[i++] = source.get(0);
				dest[i++] = source.get(4);
				dest[i++] = source.get(8);
				dest[i++] = source.get(12);
				dest[i++] = source.get(1);
				dest[i++] = source.get(5);
				dest[i++] = source.get(9);
				dest[i++] = source.get(13);
				dest[i++] = source.get(2);
				dest[i++] = source.get(6);
				dest[i++] = source.get(10);
				dest[i++] = source.get(14);
				dest[i++] = source.get(3);
				dest[i++] = source.get(7);
				dest[i++] = source.get(11);
				dest[i++] = source.get(15);
			} else {
				dest[i++] = source.get(0);
				dest[i++] = source.get(1);
				dest[i++] = source.get(2);
				dest[i++] = source.get(3);
				dest[i++] = source.get(4);
				dest[i++] = source.get(5);
				dest[i++] = source.get(6);
				dest[i++] = source.get(7);
				dest[i++] = source.get(8);
				dest[i++] = source.get(9);
				dest[i++] = source.get(10);
				dest[i++] = source.get(11);
				dest[i++] = source.get(12);
				dest[i++] = source.get(13);
				dest[i++] = source.get(14);
				dest[i++] = source.get(15);
			}
			if(this.__state.program != null) {
				this.__state.program.__markDirty(isVertex,firstRegister,4);
			}
		}
	}
	,setProgramConstantsFromVector: function(programType,firstRegister,data,numRegisters) {
		if(numRegisters == null) {
			numRegisters = -1;
		}
		if(numRegisters == 0) {
			return;
		}
		if(!(this.__state.program != null && this.__state.program.__format == 1)) {
			if(numRegisters == -1) {
				numRegisters = data.get_length() >> 2;
			}
			var isVertex = programType == 1;
			var dest = isVertex ? this.__vertexConstants : this.__fragmentConstants;
			var source = data;
			var sourceIndex = 0;
			var destIndex = firstRegister * 4;
			var _g = 0;
			var _g1 = numRegisters;
			while(_g < _g1) {
				var i = _g++;
				dest[destIndex++] = source.get(sourceIndex++);
				dest[destIndex++] = source.get(sourceIndex++);
				dest[destIndex++] = source.get(sourceIndex++);
				dest[destIndex++] = source.get(sourceIndex++);
			}
			if(this.__state.program != null) {
				this.__state.program.__markDirty(isVertex,firstRegister,numRegisters);
			}
		}
	}
	,setRenderToBackBuffer: function() {
		this.__state.renderToTexture = null;
	}
	,setRenderToTexture: function(texture,enableDepthAndStencil,antiAlias,surfaceSelector) {
		if(surfaceSelector == null) {
			surfaceSelector = 0;
		}
		if(antiAlias == null) {
			antiAlias = 0;
		}
		if(enableDepthAndStencil == null) {
			enableDepthAndStencil = false;
		}
		this.__state.renderToTexture = texture;
		this.__state.renderToTextureDepthStencil = enableDepthAndStencil;
		this.__state.renderToTextureAntiAlias = antiAlias;
		this.__state.renderToTextureSurfaceSelector = surfaceSelector;
	}
	,setSamplerStateAt: function(sampler,wrap,filter,mipfilter) {
		if(this.__state.samplerStates[sampler] == null) {
			this.__state.samplerStates[sampler] = new openfl_display__$internal_SamplerState();
		}
		var state = this.__state.samplerStates[sampler];
		state.wrap = wrap;
		state.filter = filter;
		state.mipfilter = mipfilter;
	}
	,setScissorRectangle: function(rectangle) {
		if(rectangle != null) {
			this.__state.scissorEnabled = true;
			this.__state.scissorRectangle.copyFrom(rectangle);
		} else {
			this.__state.scissorEnabled = false;
		}
	}
	,setStencilActions: function(triangleFace,compareMode,actionOnBothPass,actionOnDepthFail,actionOnDepthPassStencilFail) {
		if(actionOnDepthPassStencilFail == null) {
			actionOnDepthPassStencilFail = 5;
		}
		if(actionOnDepthFail == null) {
			actionOnDepthFail = 5;
		}
		if(actionOnBothPass == null) {
			actionOnBothPass = 5;
		}
		if(compareMode == null) {
			compareMode = 0;
		}
		if(triangleFace == null) {
			triangleFace = 2;
		}
		this.__state.stencilTriangleFace = triangleFace;
		this.__state.stencilCompareMode = compareMode;
		this.__state.stencilPass = actionOnBothPass;
		this.__state.stencilDepthFail = actionOnDepthFail;
		this.__state.stencilFail = actionOnDepthPassStencilFail;
	}
	,setStencilReferenceValue: function(referenceValue,readMask,writeMask) {
		if(writeMask == null) {
			writeMask = 255;
		}
		if(readMask == null) {
			readMask = 255;
		}
		this.__state.stencilReferenceValue = referenceValue;
		this.__state.stencilReadMask = readMask;
		this.__state.stencilWriteMask = writeMask;
	}
	,setTextureAt: function(sampler,texture) {
		this.__state.textures[sampler] = texture;
	}
	,setVertexBufferAt: function(index,buffer,bufferOffset,format) {
		if(format == null) {
			format = 4;
		}
		if(bufferOffset == null) {
			bufferOffset = 0;
		}
		if(index < 0) {
			return;
		}
		if(buffer == null) {
			this.gl.disableVertexAttribArray(index);
			this.__bindGLArrayBuffer(null);
			return;
		}
		this.__bindGLArrayBuffer(buffer.__id);
		this.gl.enableVertexAttribArray(index);
		var byteOffset = bufferOffset * 4;
		switch(format) {
		case 0:
			this.gl.vertexAttribPointer(index,4,this.gl.UNSIGNED_BYTE,true,buffer.__stride,byteOffset);
			break;
		case 1:
			this.gl.vertexAttribPointer(index,1,this.gl.FLOAT,false,buffer.__stride,byteOffset);
			break;
		case 2:
			this.gl.vertexAttribPointer(index,2,this.gl.FLOAT,false,buffer.__stride,byteOffset);
			break;
		case 3:
			this.gl.vertexAttribPointer(index,3,this.gl.FLOAT,false,buffer.__stride,byteOffset);
			break;
		case 4:
			this.gl.vertexAttribPointer(index,4,this.gl.FLOAT,false,buffer.__stride,byteOffset);
			break;
		default:
			throw new openfl_errors_IllegalOperationError();
		}
	}
	,__bindGLArrayBuffer: function(buffer) {
		if(this.__contextState.__currentGLArrayBuffer != buffer) {
			this.gl.bindBuffer(this.gl.ARRAY_BUFFER,buffer);
			this.__contextState.__currentGLArrayBuffer = buffer;
		}
	}
	,__bindGLElementArrayBuffer: function(buffer) {
		if(this.__contextState.__currentGLElementArrayBuffer != buffer) {
			this.gl.bindBuffer(this.gl.ELEMENT_ARRAY_BUFFER,buffer);
			this.__contextState.__currentGLElementArrayBuffer = buffer;
		}
	}
	,__bindGLFramebuffer: function(framebuffer) {
		if(this.__contextState.__currentGLFramebuffer != framebuffer) {
			this.gl.bindFramebuffer(this.gl.FRAMEBUFFER,framebuffer);
			this.__contextState.__currentGLFramebuffer = framebuffer;
		}
	}
	,__bindGLTexture2D: function(texture) {
		this.gl.bindTexture(this.gl.TEXTURE_2D,texture);
		this.__contextState.__currentGLTexture2D = texture;
	}
	,__bindGLTextureCubeMap: function(texture) {
		this.gl.bindTexture(this.gl.TEXTURE_CUBE_MAP,texture);
		this.__contextState.__currentGLTextureCubeMap = texture;
	}
	,__dispose: function() {
		this.driverInfo += " (Disposed)";
		if(this.__stage3D != null) {
			this.__stage3D.__indexBuffer = null;
			this.__stage3D.__vertexBuffer = null;
			this.__stage3D.context3D = null;
			this.__stage3D = null;
		}
		this.__backBufferTexture = null;
		this.__context = null;
		this.__renderStage3DProgram = null;
		this.__fragmentConstants = null;
		this.__frontBufferTexture = null;
		this.__positionScale = null;
		this.__present = false;
		this.__quadIndexBuffer = null;
		this.__stage = null;
		this.__vertexConstants = null;
	}
	,__drawTriangles: function(firstIndex,count) {
		if(firstIndex == null) {
			firstIndex = 0;
		}
		if(this.__state.renderToTexture == null) {
			if(this.__stage.context3D == this && !this.__stage.__renderer.__cleared) {
				this.__stage.__renderer.__clear();
			} else if(!this.__cleared) {
				this.clear(0,0,0,0,1,0,1);
			}
		}
		this.__flushGL();
		if(this.__state.program != null) {
			this.__state.program.__flush();
		}
		this.gl.drawArrays(this.gl.TRIANGLES,firstIndex,count);
	}
	,__flushGL: function() {
		this.__flushGLProgram();
		this.__flushGLFramebuffer();
		this.__flushGLViewport();
		this.__flushGLBlend();
		if(this.__contextState.colorMaskRed != this.__state.colorMaskRed || this.__contextState.colorMaskGreen != this.__state.colorMaskGreen || this.__contextState.colorMaskBlue != this.__state.colorMaskBlue || this.__contextState.colorMaskAlpha != this.__state.colorMaskAlpha) {
			this.gl.colorMask(this.__state.colorMaskRed,this.__state.colorMaskGreen,this.__state.colorMaskBlue,this.__state.colorMaskAlpha);
			this.__contextState.colorMaskRed = this.__state.colorMaskRed;
			this.__contextState.colorMaskGreen = this.__state.colorMaskGreen;
			this.__contextState.colorMaskBlue = this.__state.colorMaskBlue;
			this.__contextState.colorMaskAlpha = this.__state.colorMaskAlpha;
		}
		this.__flushGLCulling();
		this.__flushGLDepth();
		this.__flushGLScissor();
		this.__flushGLStencil();
		this.__flushGLTextures();
	}
	,__flushGLBlend: function() {
		if(this.__contextState.blendDestinationRGBFactor != this.__state.blendDestinationRGBFactor || this.__contextState.blendSourceRGBFactor != this.__state.blendSourceRGBFactor || this.__contextState.blendDestinationAlphaFactor != this.__state.blendDestinationAlphaFactor || this.__contextState.blendSourceAlphaFactor != this.__state.blendSourceAlphaFactor) {
			this.__setGLBlend(true);
			if(this.__state.blendDestinationRGBFactor == this.__state.blendDestinationAlphaFactor && this.__state.blendSourceRGBFactor == this.__state.blendSourceAlphaFactor) {
				this.gl.blendFunc(this.__getGLBlend(this.__state.blendSourceRGBFactor),this.__getGLBlend(this.__state.blendDestinationRGBFactor));
			} else {
				this.gl.blendFuncSeparate(this.__getGLBlend(this.__state.blendSourceRGBFactor),this.__getGLBlend(this.__state.blendDestinationRGBFactor),this.__getGLBlend(this.__state.blendSourceAlphaFactor),this.__getGLBlend(this.__state.blendDestinationAlphaFactor));
			}
			this.__contextState.blendDestinationRGBFactor = this.__state.blendDestinationRGBFactor;
			this.__contextState.blendSourceRGBFactor = this.__state.blendSourceRGBFactor;
			this.__contextState.blendDestinationAlphaFactor = this.__state.blendDestinationAlphaFactor;
			this.__contextState.blendSourceAlphaFactor = this.__state.blendSourceAlphaFactor;
		}
	}
	,__flushGLColor: function() {
		if(this.__contextState.colorMaskRed != this.__state.colorMaskRed || this.__contextState.colorMaskGreen != this.__state.colorMaskGreen || this.__contextState.colorMaskBlue != this.__state.colorMaskBlue || this.__contextState.colorMaskAlpha != this.__state.colorMaskAlpha) {
			this.gl.colorMask(this.__state.colorMaskRed,this.__state.colorMaskGreen,this.__state.colorMaskBlue,this.__state.colorMaskAlpha);
			this.__contextState.colorMaskRed = this.__state.colorMaskRed;
			this.__contextState.colorMaskGreen = this.__state.colorMaskGreen;
			this.__contextState.colorMaskBlue = this.__state.colorMaskBlue;
			this.__contextState.colorMaskAlpha = this.__state.colorMaskAlpha;
		}
	}
	,__flushGLCulling: function() {
		if(this.__contextState.culling != this.__state.culling) {
			if(this.__state.culling == 3) {
				this.__setGLCullFace(false);
			} else {
				this.__setGLCullFace(true);
				switch(this.__state.culling) {
				case 0:
					this.gl.cullFace(this.gl.BACK);
					break;
				case 1:
					this.gl.cullFace(this.gl.FRONT);
					break;
				case 2:
					this.gl.cullFace(this.gl.FRONT_AND_BACK);
					break;
				case 3:
					break;
				default:
					throw new openfl_errors_IllegalOperationError();
				}
			}
			this.__contextState.culling = this.__state.culling;
		}
	}
	,__flushGLDepth: function() {
		var depthMask = this.__state.depthMask && (this.__state.renderToTexture != null ? this.__state.renderToTextureDepthStencil : this.__state.backBufferEnableDepthAndStencil);
		if(this.__contextState.depthMask != depthMask) {
			this.gl.depthMask(depthMask);
			this.__contextState.depthMask = depthMask;
		}
		if(this.__contextState.depthCompareMode != this.__state.depthCompareMode) {
			switch(this.__state.depthCompareMode) {
			case 0:
				this.gl.depthFunc(this.gl.ALWAYS);
				break;
			case 1:
				this.gl.depthFunc(this.gl.EQUAL);
				break;
			case 2:
				this.gl.depthFunc(this.gl.GREATER);
				break;
			case 3:
				this.gl.depthFunc(this.gl.GEQUAL);
				break;
			case 4:
				this.gl.depthFunc(this.gl.LESS);
				break;
			case 5:
				this.gl.depthFunc(this.gl.LEQUAL);
				break;
			case 6:
				this.gl.depthFunc(this.gl.NEVER);
				break;
			case 7:
				this.gl.depthFunc(this.gl.NOTEQUAL);
				break;
			default:
				throw new openfl_errors_IllegalOperationError();
			}
			this.__contextState.depthCompareMode = this.__state.depthCompareMode;
		}
	}
	,__flushGLFramebuffer: function() {
		if(this.__state.renderToTexture != null) {
			if(this.__contextState.renderToTexture != this.__state.renderToTexture || this.__contextState.renderToTextureSurfaceSelector != this.__state.renderToTextureSurfaceSelector) {
				var framebuffer = this.__state.renderToTexture.__getGLFramebuffer(this.__state.renderToTextureDepthStencil,this.__state.renderToTextureAntiAlias,this.__state.renderToTextureSurfaceSelector);
				this.__bindGLFramebuffer(framebuffer);
				this.__contextState.renderToTexture = this.__state.renderToTexture;
				this.__contextState.renderToTextureAntiAlias = this.__state.renderToTextureAntiAlias;
				this.__contextState.renderToTextureDepthStencil = this.__state.renderToTextureDepthStencil;
				this.__contextState.renderToTextureSurfaceSelector = this.__state.renderToTextureSurfaceSelector;
			}
			this.__setGLDepthTest(this.__state.renderToTextureDepthStencil);
			this.__setGLStencilTest(this.__state.renderToTextureDepthStencil);
			this.__setGLFrontFace(true);
		} else {
			if(this.__stage == null && this.backBufferWidth == 0 && this.backBufferHeight == 0) {
				throw new openfl_errors_Error("Context3D backbuffer has not been configured");
			}
			if(this.__contextState.renderToTexture != null || this.__contextState.__currentGLFramebuffer != this.__state.__primaryGLFramebuffer || this.__contextState.backBufferEnableDepthAndStencil != this.__state.backBufferEnableDepthAndStencil) {
				this.__bindGLFramebuffer(this.__state.__primaryGLFramebuffer);
				this.__contextState.renderToTexture = null;
				this.__contextState.backBufferEnableDepthAndStencil = this.__state.backBufferEnableDepthAndStencil;
			}
			this.__setGLDepthTest(this.__state.backBufferEnableDepthAndStencil);
			this.__setGLStencilTest(this.__state.backBufferEnableDepthAndStencil);
			this.__setGLFrontFace(this.__stage.context3D != this);
		}
	}
	,__flushGLProgram: function() {
		var shader = this.__state.shader;
		var program = this.__state.program;
		if(this.__contextState.shader != shader) {
			if(this.__contextState.shader != null) {
				this.__contextState.shader.__disable();
			}
			if(shader != null) {
				shader.__enable();
			}
			this.__contextState.shader = shader;
		}
		if(this.__contextState.program != program) {
			if(this.__contextState.program != null) {
				this.__contextState.program.__disable();
			}
			if(program != null) {
				program.__enable();
			}
			this.__contextState.program = program;
		}
		if(program != null && program.__format == 0) {
			this.__positionScale[1] = this.__stage.context3D == this && this.__state.renderToTexture == null ? 1.0 : -1.0;
			program.__setPositionScale(this.__positionScale);
		}
	}
	,__flushGLScissor: function() {
		if(!this.__state.scissorEnabled) {
			if(this.__contextState.scissorEnabled != this.__state.scissorEnabled) {
				this.__setGLScissorTest(false);
				this.__contextState.scissorEnabled = false;
			}
		} else {
			this.__setGLScissorTest(true);
			this.__contextState.scissorEnabled = true;
			var scissorX = this.__state.scissorRectangle.x | 0;
			var scissorY = this.__state.scissorRectangle.y | 0;
			var scissorWidth = this.__state.scissorRectangle.width | 0;
			var scissorHeight = this.__state.scissorRectangle.height | 0;
			if(this.__backBufferWantsBestResolution) {
				scissorX = this.__state.scissorRectangle.x * this.__stage.window.__scale | 0;
				scissorY = this.__state.scissorRectangle.y * this.__stage.window.__scale | 0;
				scissorWidth = this.__state.scissorRectangle.width * this.__stage.window.__scale | 0;
				scissorHeight = this.__state.scissorRectangle.height * this.__stage.window.__scale | 0;
			}
			if(this.__state.renderToTexture == null && this.__stage3D == null) {
				var contextHeight = this.__stage.window.__height * this.__stage.window.__scale | 0;
				scissorY = contextHeight - scissorHeight - scissorY;
			}
			if(this.__contextState.scissorRectangle.x != scissorX || this.__contextState.scissorRectangle.y != scissorY || this.__contextState.scissorRectangle.width != scissorWidth || this.__contextState.scissorRectangle.height != scissorHeight) {
				this.gl.scissor(scissorX,scissorY,scissorWidth,scissorHeight);
				this.__contextState.scissorRectangle.setTo(scissorX,scissorY,scissorWidth,scissorHeight);
			}
		}
	}
	,__flushGLStencil: function() {
		if(this.__contextState.stencilTriangleFace != this.__state.stencilTriangleFace || this.__contextState.stencilPass != this.__state.stencilPass || this.__contextState.stencilDepthFail != this.__state.stencilDepthFail || this.__contextState.stencilFail != this.__state.stencilFail) {
			this.gl.stencilOpSeparate(this.__getGLTriangleFace(this.__state.stencilTriangleFace),this.__getGLStencilAction(this.__state.stencilFail),this.__getGLStencilAction(this.__state.stencilDepthFail),this.__getGLStencilAction(this.__state.stencilPass));
			this.__contextState.stencilTriangleFace = this.__state.stencilTriangleFace;
			this.__contextState.stencilPass = this.__state.stencilPass;
			this.__contextState.stencilDepthFail = this.__state.stencilDepthFail;
			this.__contextState.stencilFail = this.__state.stencilFail;
		}
		if(this.__contextState.stencilWriteMask != this.__state.stencilWriteMask) {
			this.gl.stencilMask(this.__state.stencilWriteMask);
			this.__contextState.stencilWriteMask = this.__state.stencilWriteMask;
		}
		if(this.__contextState.stencilCompareMode != this.__state.stencilCompareMode || this.__contextState.stencilReferenceValue != this.__state.stencilReferenceValue || this.__contextState.stencilReadMask != this.__state.stencilReadMask) {
			this.gl.stencilFunc(this.__getGLCompareMode(this.__state.stencilCompareMode),this.__state.stencilReferenceValue,this.__state.stencilReadMask);
			this.__contextState.stencilCompareMode = this.__state.stencilCompareMode;
			this.__contextState.stencilReferenceValue = this.__state.stencilReferenceValue;
			this.__contextState.stencilReadMask = this.__state.stencilReadMask;
		}
	}
	,__flushGLTextures: function() {
		var sampler = 0;
		var texture;
		var samplerState;
		var _g = 0;
		var _g1 = this.__state.textures.length;
		while(_g < _g1) {
			var i = _g++;
			texture = this.__state.textures[i];
			samplerState = this.__state.samplerStates[i];
			if(samplerState == null) {
				this.__state.samplerStates[i] = new openfl_display__$internal_SamplerState();
				samplerState = this.__state.samplerStates[i];
			}
			this.gl.activeTexture(this.gl.TEXTURE0 + sampler);
			if(texture != null) {
				if(texture.__textureTarget == this.gl.TEXTURE_2D) {
					this.__bindGLTexture2D(texture.__getTexture());
				} else {
					this.__bindGLTextureCubeMap(texture.__getTexture());
				}
				this.__contextState.textures[i] = texture;
				texture.__setSamplerState(samplerState);
			} else {
				this.__bindGLTexture2D(null);
			}
			if(this.__state.program != null && this.__state.program.__format == 0 && samplerState.textureAlpha) {
				this.gl.activeTexture(this.gl.TEXTURE0 + sampler + 4);
				if(texture != null && texture.__alphaTexture != null) {
					if(texture.__alphaTexture.__textureTarget == this.gl.TEXTURE_2D) {
						this.__bindGLTexture2D(texture.__alphaTexture.__getTexture());
					} else {
						this.__bindGLTextureCubeMap(texture.__alphaTexture.__getTexture());
					}
					texture.__alphaTexture.__setSamplerState(samplerState);
					this.gl.uniform1i(this.__state.program.__agalAlphaSamplerEnabled[sampler].location,1);
				} else {
					this.__bindGLTexture2D(null);
					if(this.__state.program.__agalAlphaSamplerEnabled[sampler] != null) {
						this.gl.uniform1i(this.__state.program.__agalAlphaSamplerEnabled[sampler].location,0);
					}
				}
			}
			++sampler;
		}
	}
	,__flushGLViewport: function() {
		if(this.__state.renderToTexture == null) {
			if(this.__stage.context3D == this) {
				var scaledBackBufferWidth = this.backBufferWidth;
				var scaledBackBufferHeight = this.backBufferHeight;
				if(this.__stage3D == null && !this.__backBufferWantsBestResolution) {
					scaledBackBufferWidth = this.backBufferWidth * this.__stage.window.__scale | 0;
					scaledBackBufferHeight = this.backBufferHeight * this.__stage.window.__scale | 0;
				}
				var x = this.__stage3D == null ? 0 : this.__stage3D.get_x() | 0;
				var y = this.__stage.window.__height * this.__stage.window.__scale - scaledBackBufferHeight - (this.__stage3D == null ? 0 : this.__stage3D.get_y()) | 0;
				this.gl.viewport(x,y,scaledBackBufferWidth,scaledBackBufferHeight);
			} else {
				this.gl.viewport(0,0,this.backBufferWidth,this.backBufferHeight);
			}
		} else {
			var width = 0;
			var height = 0;
			if(((this.__state.renderToTexture) instanceof openfl_display3D_textures_Texture)) {
				var texture2D = this.__state.renderToTexture;
				width = texture2D.__width;
				height = texture2D.__height;
			} else if(((this.__state.renderToTexture) instanceof openfl_display3D_textures_RectangleTexture)) {
				var rectTexture = this.__state.renderToTexture;
				width = rectTexture.__width;
				height = rectTexture.__height;
			} else if(((this.__state.renderToTexture) instanceof openfl_display3D_textures_CubeTexture)) {
				var cubeTexture = this.__state.renderToTexture;
				width = cubeTexture.__size;
				height = cubeTexture.__size;
			}
			this.gl.viewport(0,0,width,height);
		}
	}
	,__getGLBlend: function(blendFactor) {
		switch(blendFactor) {
		case 0:
			return this.gl.DST_ALPHA;
		case 1:
			return this.gl.DST_COLOR;
		case 2:
			return this.gl.ONE;
		case 3:
			return this.gl.ONE_MINUS_DST_ALPHA;
		case 4:
			return this.gl.ONE_MINUS_DST_COLOR;
		case 5:
			return this.gl.ONE_MINUS_SRC_ALPHA;
		case 6:
			return this.gl.ONE_MINUS_SRC_COLOR;
		case 7:
			return this.gl.SRC_ALPHA;
		case 8:
			return this.gl.SRC_COLOR;
		case 9:
			return this.gl.ZERO;
		default:
			throw new openfl_errors_IllegalOperationError();
		}
	}
	,__getGLCompareMode: function(mode) {
		switch(mode) {
		case 0:
			return this.gl.ALWAYS;
		case 1:
			return this.gl.EQUAL;
		case 2:
			return this.gl.GREATER;
		case 3:
			return this.gl.GEQUAL;
		case 4:
			return this.gl.LESS;
		case 5:
			return this.gl.LEQUAL;
		case 6:
			return this.gl.NEVER;
		case 7:
			return this.gl.NOTEQUAL;
		default:
			return this.gl.EQUAL;
		}
	}
	,__getGLStencilAction: function(action) {
		switch(action) {
		case 0:
			return this.gl.DECR;
		case 1:
			return this.gl.DECR_WRAP;
		case 2:
			return this.gl.INCR;
		case 3:
			return this.gl.INCR_WRAP;
		case 4:
			return this.gl.INVERT;
		case 5:
			return this.gl.KEEP;
		case 6:
			return this.gl.REPLACE;
		case 7:
			return this.gl.ZERO;
		default:
			return this.gl.KEEP;
		}
	}
	,__getGLTriangleFace: function(face) {
		switch(face) {
		case 0:
			return this.gl.BACK;
		case 1:
			return this.gl.FRONT;
		case 2:
			return this.gl.FRONT_AND_BACK;
		case 3:
			return this.gl.NONE;
		default:
			return this.gl.FRONT_AND_BACK;
		}
	}
	,__renderStage3D: function(stage3D) {
		var context = stage3D.context3D;
		if(context != null && context != this && context.__frontBufferTexture != null && stage3D.visible && this.backBufferHeight > 0 && this.backBufferWidth > 0) {
			if(this.__renderStage3DProgram == null) {
				var vertexAssembler = new openfl_utils_AGALMiniAssembler();
				vertexAssembler.assemble(openfl_display3D_Context3DProgramType.toString(1),"m44 op, va0, vc0\n" + "mov v0, va1");
				var fragmentAssembler = new openfl_utils_AGALMiniAssembler();
				fragmentAssembler.assemble(openfl_display3D_Context3DProgramType.toString(0),"tex ft1, v0, fs0 <2d,nearest,nomip>\n" + "mov oc, ft1");
				this.__renderStage3DProgram = this.createProgram();
				this.__renderStage3DProgram.upload(vertexAssembler.agalcode,fragmentAssembler.agalcode);
			}
			this.setProgram(this.__renderStage3DProgram);
			this.setBlendFactors(2,9);
			this.setColorMask(true,true,true,true);
			this.setCulling(3);
			this.setDepthTest(false,0);
			this.setStencilActions();
			this.setStencilReferenceValue(0,0,0);
			this.setScissorRectangle(null);
			this.setTextureAt(0,context.__frontBufferTexture);
			this.setVertexBufferAt(0,stage3D.__vertexBuffer,0,3);
			this.setVertexBufferAt(1,stage3D.__vertexBuffer,3,2);
			this.setProgramConstantsFromMatrix(1,0,stage3D.__renderTransform,true);
			this.drawTriangles(stage3D.__indexBuffer);
			this.__present = true;
		}
	}
	,__setGLBlend: function(enable) {
		if(this.__contextState.__enableGLBlend != enable) {
			if(enable) {
				this.gl.enable(this.gl.BLEND);
			} else {
				this.gl.disable(this.gl.BLEND);
			}
			this.__contextState.__enableGLBlend = enable;
		}
	}
	,__setGLBlendEquation: function(value) {
		if(this.__contextState.__glBlendEquation != value) {
			this.gl.blendEquation(value);
			this.__contextState.__glBlendEquation = value;
		}
	}
	,__setGLCullFace: function(enable) {
		if(this.__contextState.__enableGLCullFace != enable) {
			if(enable) {
				this.gl.enable(this.gl.CULL_FACE);
			} else {
				this.gl.disable(this.gl.CULL_FACE);
			}
			this.__contextState.__enableGLCullFace = enable;
		}
	}
	,__setGLDepthTest: function(enable) {
		if(this.__contextState.__enableGLDepthTest != enable) {
			if(enable) {
				this.gl.enable(this.gl.DEPTH_TEST);
			} else {
				this.gl.disable(this.gl.DEPTH_TEST);
			}
			this.__contextState.__enableGLDepthTest = enable;
		}
	}
	,__setGLFrontFace: function(counterClockWise) {
		if(this.__contextState.__frontFaceGLCCW != counterClockWise) {
			this.gl.frontFace(counterClockWise ? this.gl.CCW : this.gl.CW);
			this.__contextState.__frontFaceGLCCW = counterClockWise;
		}
	}
	,__setGLScissorTest: function(enable) {
		if(this.__contextState.__enableGLScissorTest != enable) {
			if(enable) {
				this.gl.enable(this.gl.SCISSOR_TEST);
			} else {
				this.gl.disable(this.gl.SCISSOR_TEST);
			}
			this.__contextState.__enableGLScissorTest = enable;
		}
	}
	,__setGLStencilTest: function(enable) {
		if(this.__contextState.__enableGLStencilTest != enable) {
			if(enable) {
				this.gl.enable(this.gl.STENCIL_TEST);
			} else {
				this.gl.disable(this.gl.STENCIL_TEST);
			}
			this.__contextState.__enableGLStencilTest = enable;
		}
	}
	,get_enableErrorChecking: function() {
		return this.__enableErrorChecking;
	}
	,set_enableErrorChecking: function(value) {
		return this.__enableErrorChecking = value;
	}
	,get_totalGPUMemory: function() {
		if(openfl_display3D_Context3D.__glMemoryCurrentAvailable != -1) {
			var current = this.gl.getParameter(openfl_display3D_Context3D.__glMemoryCurrentAvailable);
			var total = this.gl.getParameter(openfl_display3D_Context3D.__glMemoryTotalAvailable);
			if(total > 0) {
				return (total - current) * 1024;
			}
		}
		return 0;
	}
	,__class__: openfl_display3D_Context3D
	,__properties__: {get_totalGPUMemory:"get_totalGPUMemory",set_enableErrorChecking:"set_enableErrorChecking",get_enableErrorChecking:"get_enableErrorChecking"}
});
var openfl_display3D_Context3DBlendFactor = {};
openfl_display3D_Context3DBlendFactor.fromString = function(value) {
	switch(value) {
	case "destinationAlpha":
		return 0;
	case "destinationColor":
		return 1;
	case "one":
		return 2;
	case "oneMinusDestinationAlpha":
		return 3;
	case "oneMinusDestinationColor":
		return 4;
	case "oneMinusSourceAlpha":
		return 5;
	case "oneMinusSourceColor":
		return 6;
	case "sourceAlpha":
		return 7;
	case "sourceColor":
		return 8;
	case "zero":
		return 9;
	default:
		return null;
	}
};
openfl_display3D_Context3DBlendFactor.toString = function(this1) {
	switch(this1) {
	case 0:
		return "destinationAlpha";
	case 1:
		return "destinationColor";
	case 2:
		return "one";
	case 3:
		return "oneMinusDestinationAlpha";
	case 4:
		return "oneMinusDestinationColor";
	case 5:
		return "oneMinusSourceAlpha";
	case 6:
		return "oneMinusSourceColor";
	case 7:
		return "sourceAlpha";
	case 8:
		return "sourceColor";
	case 9:
		return "zero";
	default:
		return null;
	}
};
var openfl_display3D_Context3DBufferUsage = {};
openfl_display3D_Context3DBufferUsage.fromString = function(value) {
	switch(value) {
	case "dynamicDraw":
		return 0;
	case "staticDraw":
		return 1;
	default:
		return null;
	}
};
openfl_display3D_Context3DBufferUsage.toString = function(this1) {
	switch(this1) {
	case 0:
		return "dynamicDraw";
	case 1:
		return "staticDraw";
	default:
		return null;
	}
};
var openfl_display3D_Context3DCompareMode = {};
openfl_display3D_Context3DCompareMode.fromString = function(value) {
	switch(value) {
	case "always":
		return 0;
	case "equal":
		return 1;
	case "greater":
		return 2;
	case "greaterEqual":
		return 3;
	case "less":
		return 4;
	case "lessEqual":
		return 5;
	case "never":
		return 6;
	case "notEqual":
		return 7;
	default:
		return null;
	}
};
openfl_display3D_Context3DCompareMode.toString = function(this1) {
	switch(this1) {
	case 0:
		return "always";
	case 1:
		return "equal";
	case 2:
		return "greater";
	case 3:
		return "greaterEqual";
	case 4:
		return "less";
	case 5:
		return "lessEqual";
	case 6:
		return "never";
	case 7:
		return "notEqual";
	default:
		return null;
	}
};
var openfl_display3D_Context3DMipFilter = {};
openfl_display3D_Context3DMipFilter.fromString = function(value) {
	switch(value) {
	case "miplinear":
		return 0;
	case "mipnearest":
		return 1;
	case "mipnone":
		return 2;
	default:
		return null;
	}
};
openfl_display3D_Context3DMipFilter.toString = function(this1) {
	switch(this1) {
	case 0:
		return "miplinear";
	case 1:
		return "mipnearest";
	case 2:
		return "mipnone";
	default:
		return null;
	}
};
var openfl_display3D_Context3DProfile = {};
openfl_display3D_Context3DProfile.fromString = function(value) {
	switch(value) {
	case "baseline":
		return 0;
	case "baselineConstrained":
		return 1;
	case "baselineExtended":
		return 2;
	case "standard":
		return 3;
	case "standardConstrained":
		return 4;
	case "standardExtended":
		return 5;
	default:
		return null;
	}
};
openfl_display3D_Context3DProfile.toString = function(this1) {
	switch(this1) {
	case 0:
		return "baseline";
	case 1:
		return "baselineConstrained";
	case 2:
		return "baselineExtended";
	case 3:
		return "standard";
	case 4:
		return "standardConstrained";
	case 5:
		return "standardExtended";
	default:
		return null;
	}
};
var openfl_display3D_Context3DProgramFormat = {};
openfl_display3D_Context3DProgramFormat.fromString = function(value) {
	switch(value) {
	case "agal":
		return 0;
	case "glsl":
		return 1;
	default:
		return null;
	}
};
openfl_display3D_Context3DProgramFormat.toString = function(this1) {
	switch(this1) {
	case 0:
		return "agal";
	case 1:
		return "glsl";
	default:
		return null;
	}
};
var openfl_display3D_Context3DProgramType = {};
openfl_display3D_Context3DProgramType.fromString = function(value) {
	switch(value) {
	case "fragment":
		return 0;
	case "vertex":
		return 1;
	default:
		return null;
	}
};
openfl_display3D_Context3DProgramType.toString = function(this1) {
	switch(this1) {
	case 0:
		return "fragment";
	case 1:
		return "vertex";
	default:
		return null;
	}
};
var openfl_display3D_Context3DRenderMode = {};
openfl_display3D_Context3DRenderMode.fromString = function(value) {
	switch(value) {
	case "auto":
		return 0;
	case "software":
		return 1;
	default:
		return null;
	}
};
openfl_display3D_Context3DRenderMode.toString = function(this1) {
	switch(this1) {
	case 0:
		return "auto";
	case 1:
		return "software";
	default:
		return null;
	}
};
var openfl_display3D_Context3DStencilAction = {};
openfl_display3D_Context3DStencilAction.fromString = function(value) {
	switch(value) {
	case "decrementSaturate":
		return 0;
	case "decrementWrap":
		return 1;
	case "incrementSaturate":
		return 2;
	case "incrementWrap":
		return 3;
	case "invert":
		return 4;
	case "keep":
		return 5;
	case "set":
		return 6;
	case "zero":
		return 7;
	default:
		return null;
	}
};
openfl_display3D_Context3DStencilAction.toString = function(this1) {
	switch(this1) {
	case 0:
		return "decrementSaturate";
	case 1:
		return "decrementWrap";
	case 2:
		return "incrementSaturate";
	case 3:
		return "incrementWrap";
	case 4:
		return "invert";
	case 5:
		return "keep";
	case 6:
		return "set";
	case 7:
		return "zero";
	default:
		return null;
	}
};
var openfl_display3D_Context3DTextureFilter = {};
openfl_display3D_Context3DTextureFilter.fromString = function(value) {
	switch(value) {
	case "anisotropic16x":
		return 0;
	case "anisotropic2x":
		return 1;
	case "anisotropic4x":
		return 2;
	case "anisotropic8x":
		return 3;
	case "linear":
		return 4;
	case "nearest":
		return 5;
	default:
		return null;
	}
};
openfl_display3D_Context3DTextureFilter.toString = function(this1) {
	switch(this1) {
	case 0:
		return "anisotropic16x";
	case 1:
		return "anisotropic2x";
	case 2:
		return "anisotropic4x";
	case 3:
		return "anisotropic8x";
	case 4:
		return "linear";
	case 5:
		return "nearest";
	default:
		return null;
	}
};
var openfl_display3D_Context3DTextureFormat = {};
openfl_display3D_Context3DTextureFormat.fromString = function(value) {
	switch(value) {
	case "bgrPacked565":
		return 0;
	case "bgra":
		return 1;
	case "bgraPacked4444":
		return 2;
	case "compressed":
		return 3;
	case "compressedAlpha":
		return 4;
	case "rgbaHalfFloat":
		return 5;
	default:
		return null;
	}
};
openfl_display3D_Context3DTextureFormat.toString = function(this1) {
	switch(this1) {
	case 0:
		return "bgrPacked565";
	case 1:
		return "bgra";
	case 2:
		return "bgraPacked4444";
	case 3:
		return "compressed";
	case 4:
		return "compressedAlpha";
	case 5:
		return "rgbaHalfFloat";
	default:
		return null;
	}
};
var openfl_display3D_Context3DTriangleFace = {};
openfl_display3D_Context3DTriangleFace.fromString = function(value) {
	switch(value) {
	case "back":
		return 0;
	case "front":
		return 1;
	case "frontAndBack":
		return 2;
	case "none":
		return 3;
	default:
		return null;
	}
};
openfl_display3D_Context3DTriangleFace.toString = function(this1) {
	switch(this1) {
	case 0:
		return "back";
	case 1:
		return "front";
	case 2:
		return "frontAndBack";
	case 3:
		return "none";
	default:
		return null;
	}
};
var openfl_display3D_Context3DVertexBufferFormat = {};
openfl_display3D_Context3DVertexBufferFormat.fromString = function(value) {
	switch(value) {
	case "bytes4":
		return 0;
	case "float1":
		return 1;
	case "float2":
		return 2;
	case "float3":
		return 3;
	case "float4":
		return 4;
	default:
		return null;
	}
};
openfl_display3D_Context3DVertexBufferFormat.toString = function(this1) {
	switch(this1) {
	case 0:
		return "bytes4";
	case 1:
		return "float1";
	case 2:
		return "float2";
	case 3:
		return "float3";
	case 4:
		return "float4";
	default:
		return null;
	}
};
var openfl_display3D_Context3DWrapMode = {};
openfl_display3D_Context3DWrapMode.fromString = function(value) {
	switch(value) {
	case "clamp":
		return 0;
	case "clamp_u_repeat_v":
		return 1;
	case "repeat":
		return 2;
	case "repeat_u_clamp_v":
		return 3;
	default:
		return null;
	}
};
openfl_display3D_Context3DWrapMode.toString = function(this1) {
	switch(this1) {
	case 0:
		return "clamp";
	case 1:
		return "clamp_u_repeat_v";
	case 2:
		return "repeat";
	case 3:
		return "repeat_u_clamp_v";
	default:
		return null;
	}
};
var openfl_display3D_IndexBuffer3D = function(context3D,numIndices,bufferUsage) {
	this.__context = context3D;
	this.__numIndices = numIndices;
	var gl = this.__context.gl;
	this.__id = gl.createBuffer();
	this.__usage = bufferUsage == 0 ? gl.DYNAMIC_DRAW : gl.STATIC_DRAW;
};
$hxClasses["openfl.display3D.IndexBuffer3D"] = openfl_display3D_IndexBuffer3D;
openfl_display3D_IndexBuffer3D.__name__ = "openfl.display3D.IndexBuffer3D";
openfl_display3D_IndexBuffer3D.prototype = {
	__context: null
	,__id: null
	,__memoryUsage: null
	,__numIndices: null
	,__tempUInt16Array: null
	,__usage: null
	,dispose: function() {
		var gl = this.__context.gl;
		gl.deleteBuffer(this.__id);
	}
	,uploadFromByteArray: function(data,byteArrayOffset,startOffset,count) {
		var offset = byteArrayOffset + startOffset * 2;
		var elements = null;
		var array = null;
		var vector = null;
		var view = null;
		var buffer = openfl_utils_ByteArray.toArrayBuffer(data);
		var byteoffset = offset;
		if(byteoffset == null) {
			byteoffset = 0;
		}
		var this1;
		if(elements != null) {
			this1 = new Uint16Array(elements);
		} else if(array != null) {
			this1 = new Uint16Array(array);
		} else if(vector != null) {
			this1 = new Uint16Array(vector.__array);
		} else if(view != null) {
			this1 = new Uint16Array(view);
		} else if(buffer != null) {
			if(count == null) {
				this1 = new Uint16Array(buffer,byteoffset);
			} else {
				this1 = new Uint16Array(buffer,byteoffset,count);
			}
		} else {
			this1 = null;
		}
		this.uploadFromTypedArray(this1);
	}
	,uploadFromTypedArray: function(data,byteLength) {
		if(byteLength == null) {
			byteLength = -1;
		}
		if(data == null) {
			return;
		}
		var gl = this.__context.gl;
		this.__context.__bindGLElementArrayBuffer(this.__id);
		lime_graphics_WebGLRenderContext.bufferData(gl,gl.ELEMENT_ARRAY_BUFFER,data,this.__usage);
	}
	,uploadFromVector: function(data,startOffset,count) {
		if(data == null) {
			return;
		}
		var gl = this.__context.gl;
		var length = startOffset + count;
		var existingUInt16Array = this.__tempUInt16Array;
		if(this.__tempUInt16Array == null || this.__tempUInt16Array.length < count) {
			var array = null;
			var vector = null;
			var view = null;
			var buffer = null;
			var len = null;
			var this1;
			if(count != null) {
				this1 = new Uint16Array(count);
			} else if(array != null) {
				this1 = new Uint16Array(array);
			} else if(vector != null) {
				this1 = new Uint16Array(vector.__array);
			} else if(view != null) {
				this1 = new Uint16Array(view);
			} else if(buffer != null) {
				if(len == null) {
					this1 = new Uint16Array(buffer,0);
				} else {
					this1 = new Uint16Array(buffer,0,len);
				}
			} else {
				this1 = null;
			}
			this.__tempUInt16Array = this1;
			if(existingUInt16Array != null) {
				this.__tempUInt16Array.set(existingUInt16Array);
			}
		}
		var _g = startOffset;
		var _g1 = length;
		while(_g < _g1) {
			var i = _g++;
			this.__tempUInt16Array[i - startOffset] = data.get(i);
		}
		this.uploadFromTypedArray(this.__tempUInt16Array);
	}
	,__class__: openfl_display3D_IndexBuffer3D
};
var openfl_display3D_Program3D = function(context3D,format) {
	this.__context = context3D;
	this.__format = format;
	if(this.__format == 0) {
		this.__agalSamplerUsageMask = 0;
		this.__agalUniforms = new haxe_ds_List();
		this.__agalSamplerUniforms = new haxe_ds_List();
		this.__agalAlphaSamplerUniforms = new haxe_ds_List();
		this.__agalAlphaSamplerEnabled = [];
	} else {
		this.__glslAttribNames = [];
		this.__glslAttribTypes = [];
		this.__glslSamplerNames = [];
		this.__glslUniformLocations = [];
		this.__glslUniformNames = [];
		this.__glslUniformTypes = [];
	}
	this.__samplerStates = [];
};
$hxClasses["openfl.display3D.Program3D"] = openfl_display3D_Program3D;
openfl_display3D_Program3D.__name__ = "openfl.display3D.Program3D";
openfl_display3D_Program3D.prototype = {
	__agalAlphaSamplerEnabled: null
	,__agalAlphaSamplerUniforms: null
	,__agalFragmentUniformMap: null
	,__agalPositionScale: null
	,__agalSamplerUniforms: null
	,__agalSamplerUsageMask: null
	,__agalUniforms: null
	,__agalVertexUniformMap: null
	,__context: null
	,__format: null
	,__glFragmentShader: null
	,__glFragmentSource: null
	,__glProgram: null
	,__glslAttribNames: null
	,__glslAttribTypes: null
	,__glslSamplerNames: null
	,__glslUniformLocations: null
	,__glslUniformNames: null
	,__glslUniformTypes: null
	,__glVertexShader: null
	,__glVertexSource: null
	,__samplerStates: null
	,dispose: function() {
		this.__deleteShaders();
	}
	,getAttributeIndex: function(name) {
		if(this.__format == 0) {
			if(StringTools.startsWith(name,"va")) {
				return Std.parseInt(name.substring(2));
			} else {
				return -1;
			}
		} else {
			var _g = 0;
			var _g1 = this.__glslAttribNames.length;
			while(_g < _g1) {
				var i = _g++;
				if(this.__glslAttribNames[i] == name) {
					return i;
				}
			}
			return -1;
		}
	}
	,getConstantIndex: function(name) {
		if(this.__format == 0) {
			if(StringTools.startsWith(name,"vc")) {
				return Std.parseInt(name.substring(2));
			} else if(StringTools.startsWith(name,"fc")) {
				return Std.parseInt(name.substring(2));
			} else {
				return -1;
			}
		} else {
			var _g = 0;
			var _g1 = this.__glslUniformNames.length;
			while(_g < _g1) {
				var i = _g++;
				if(this.__glslUniformNames[i] == name) {
					return this.__glslUniformLocations[i];
				}
			}
			return -1;
		}
	}
	,upload: function(vertexProgram,fragmentProgram) {
		if(this.__format != 0) {
			return;
		}
		var samplerStates = [];
		var glslVertex = openfl_display3D__$internal_AGALConverter.convertToGLSL(vertexProgram,null);
		var glslFragment = openfl_display3D__$internal_AGALConverter.convertToGLSL(fragmentProgram,samplerStates);
		if(lime_utils_Log.level == 5) {
			lime_utils_Log.info(glslVertex,{ fileName : "openfl/display3D/Program3D.hx", lineNumber : 399, className : "openfl.display3D.Program3D", methodName : "upload"});
			lime_utils_Log.info(glslFragment,{ fileName : "openfl/display3D/Program3D.hx", lineNumber : 400, className : "openfl.display3D.Program3D", methodName : "upload"});
		}
		this.__deleteShaders();
		this.__uploadFromGLSL(glslVertex,glslFragment);
		this.__buildAGALUniformList();
		var _g = 0;
		var _g1 = samplerStates.length;
		while(_g < _g1) {
			var i = _g++;
			this.__samplerStates[i] = samplerStates[i];
		}
	}
	,uploadSources: function(vertexSource,fragmentSource) {
		if(this.__format != 1) {
			return;
		}
		var prefix = "#ifdef GL_ES\n\t\t\t#ifdef GL_FRAGMENT_PRECISION_HIGH\n\t\t\tprecision highp float;\n\t\t\t#else\n\t\t\tprecision mediump float;\n\t\t\t#endif\n\t\t\t#endif\n\t\t\t";
		var vertex = prefix + vertexSource;
		var fragment = prefix + fragmentSource;
		if(vertex == this.__glVertexSource && fragment == this.__glFragmentSource) {
			return;
		}
		this.__processGLSLData(vertexSource,"attribute");
		this.__processGLSLData(vertexSource,"uniform");
		this.__processGLSLData(fragmentSource,"uniform");
		this.__deleteShaders();
		this.__uploadFromGLSL(vertex,fragment);
		var samplerNames = this.__glslSamplerNames;
		var attribNames = this.__glslAttribNames;
		var attribTypes = this.__glslAttribTypes;
		var uniformNames = this.__glslUniformNames;
		this.__glslSamplerNames = [];
		this.__glslAttribNames = [];
		this.__glslAttribTypes = [];
		this.__glslUniformLocations = [];
		var gl = this.__context.gl;
		var index;
		var location;
		var _g = 0;
		while(_g < samplerNames.length) {
			var name = samplerNames[_g];
			++_g;
			index = gl.getUniformLocation(this.__glProgram,name);
			this.__glslSamplerNames[index] = name;
		}
		var _g = 0;
		var _g1 = attribNames.length;
		while(_g < _g1) {
			var i = _g++;
			index = gl.getAttribLocation(this.__glProgram,attribNames[i]);
			this.__glslAttribNames[index] = attribNames[i];
			this.__glslAttribTypes[index] = attribTypes[i];
		}
		var _g = 0;
		var _g1 = uniformNames.length;
		while(_g < _g1) {
			var i = _g++;
			location = gl.getUniformLocation(this.__glProgram,uniformNames[i]);
			this.__glslUniformLocations[i] = location;
		}
	}
	,__buildAGALUniformList: function() {
		if(this.__format == 1) {
			return;
		}
		var gl = this.__context.gl;
		this.__agalUniforms.clear();
		this.__agalSamplerUniforms.clear();
		this.__agalAlphaSamplerUniforms.clear();
		this.__agalAlphaSamplerEnabled = [];
		this.__agalSamplerUsageMask = 0;
		var numActive = 0;
		numActive = gl.getProgramParameter(this.__glProgram,gl.ACTIVE_UNIFORMS);
		var vertexUniforms = new haxe_ds_List();
		var fragmentUniforms = new haxe_ds_List();
		var _g = 0;
		var _g1 = numActive;
		while(_g < _g1) {
			var i = _g++;
			var info = gl.getActiveUniform(this.__glProgram,i);
			var name = info.name;
			var size = info.size;
			var uniformType = info.type;
			var uniform = new openfl_display3D_Uniform(this.__context);
			uniform.name = name;
			uniform.size = size;
			uniform.type = uniformType;
			uniform.location = gl.getUniformLocation(this.__glProgram,uniform.name);
			var indexBracket = uniform.name.indexOf("[");
			if(indexBracket >= 0) {
				uniform.name = uniform.name.substring(0,indexBracket);
			}
			switch(uniform.type) {
			case 35674:
				uniform.regCount = 2;
				break;
			case 35675:
				uniform.regCount = 3;
				break;
			case 35676:
				uniform.regCount = 4;
				break;
			default:
				uniform.regCount = 1;
			}
			uniform.regCount *= uniform.size;
			this.__agalUniforms.add(uniform);
			if(uniform.name == "vcPositionScale") {
				this.__agalPositionScale = uniform;
			} else if(StringTools.startsWith(uniform.name,"vc")) {
				uniform.regIndex = Std.parseInt(uniform.name.substring(2));
				uniform.regData = this.__context.__vertexConstants;
				vertexUniforms.add(uniform);
			} else if(StringTools.startsWith(uniform.name,"fc")) {
				uniform.regIndex = Std.parseInt(uniform.name.substring(2));
				uniform.regData = this.__context.__fragmentConstants;
				fragmentUniforms.add(uniform);
			} else if(StringTools.startsWith(uniform.name,"sampler") && uniform.name.indexOf("alpha") == -1) {
				uniform.regIndex = Std.parseInt(uniform.name.substring(7));
				this.__agalSamplerUniforms.add(uniform);
				var _g2 = 0;
				var _g3 = uniform.regCount;
				while(_g2 < _g3) {
					var reg = _g2++;
					this.__agalSamplerUsageMask |= 1 << uniform.regIndex + reg;
				}
			} else if(StringTools.startsWith(uniform.name,"sampler") && StringTools.endsWith(uniform.name,"_alpha")) {
				var len = uniform.name.indexOf("_") - 7;
				uniform.regIndex = Std.parseInt(uniform.name.substring(7,7 + len)) + 4;
				this.__agalAlphaSamplerUniforms.add(uniform);
			} else if(StringTools.startsWith(uniform.name,"sampler") && StringTools.endsWith(uniform.name,"_alphaEnabled")) {
				uniform.regIndex = Std.parseInt(uniform.name.substring(7));
				this.__agalAlphaSamplerEnabled[uniform.regIndex] = uniform;
			}
			if(lime_utils_Log.level == 5) {
				lime_utils_Log.verbose("" + i + " name:" + uniform.name + " type:" + uniform.type + " size:" + uniform.size + " location:" + Std.string(uniform.location),{ fileName : "openfl/display3D/Program3D.hx", lineNumber : 577, className : "openfl.display3D.Program3D", methodName : "__buildAGALUniformList"});
			}
		}
		this.__agalVertexUniformMap = new openfl_display3D_UniformMap(Lambda.array(vertexUniforms));
		this.__agalFragmentUniformMap = new openfl_display3D_UniformMap(Lambda.array(fragmentUniforms));
	}
	,__deleteShaders: function() {
		var gl = this.__context.gl;
		if(this.__glProgram != null) {
			this.__glProgram = null;
		}
		if(this.__glVertexShader != null) {
			gl.deleteShader(this.__glVertexShader);
			this.__glVertexShader = null;
		}
		if(this.__glFragmentShader != null) {
			gl.deleteShader(this.__glFragmentShader);
			this.__glFragmentShader = null;
		}
	}
	,__disable: function() {
		var tmp = this.__format == 1;
	}
	,__enable: function() {
		var gl = this.__context.gl;
		gl.useProgram(this.__glProgram);
		if(this.__format == 0) {
			this.__agalVertexUniformMap.markAllDirty();
			this.__agalFragmentUniformMap.markAllDirty();
			var _g_head = this.__agalSamplerUniforms.h;
			while(_g_head != null) {
				var val = _g_head.item;
				_g_head = _g_head.next;
				var sampler = val;
				if(sampler.regCount == 1) {
					gl.uniform1i(sampler.location,sampler.regIndex);
				} else {
					throw new openfl_errors_IllegalOperationError("!!! TODO: uniform location on webgl");
				}
			}
			var _g_head = this.__agalAlphaSamplerUniforms.h;
			while(_g_head != null) {
				var val = _g_head.item;
				_g_head = _g_head.next;
				var sampler = val;
				if(sampler.regCount == 1) {
					gl.uniform1i(sampler.location,sampler.regIndex);
				} else {
					throw new openfl_errors_IllegalOperationError("!!! TODO: uniform location on webgl");
				}
			}
		}
	}
	,__flush: function() {
		if(this.__format == 0) {
			this.__agalVertexUniformMap.flush();
			this.__agalFragmentUniformMap.flush();
		} else {
			return;
		}
	}
	,__getSamplerState: function(sampler) {
		return this.__samplerStates[sampler];
	}
	,__markDirty: function(isVertex,index,count) {
		if(this.__format == 1) {
			return;
		}
		if(isVertex) {
			this.__agalVertexUniformMap.markDirty(index,count);
		} else {
			this.__agalFragmentUniformMap.markDirty(index,count);
		}
	}
	,__processGLSLData: function(source,storageType) {
		var lastMatch = 0;
		var position;
		var regex;
		var name;
		var type;
		if(storageType == "uniform") {
			regex = new EReg("uniform ([A-Za-z0-9]+) ([A-Za-z0-9_]+)","");
		} else {
			regex = new EReg("attribute ([A-Za-z0-9]+) ([A-Za-z0-9_]+)","");
		}
		while(regex.matchSub(source,lastMatch)) {
			type = regex.matched(1);
			name = regex.matched(2);
			if(StringTools.startsWith(name,"gl_")) {
				continue;
			}
			if(StringTools.startsWith(type,"sampler")) {
				this.__glslSamplerNames.push(name);
			} else {
				var parameterType;
				switch(type) {
				case "bool":
					parameterType = 0;
					break;
				case "bvec2":
					parameterType = 1;
					break;
				case "bvec3":
					parameterType = 2;
					break;
				case "bvec4":
					parameterType = 3;
					break;
				case "dvec2":case "vec2":
					parameterType = 5;
					break;
				case "dvec3":case "vec3":
					parameterType = 6;
					break;
				case "dvec4":case "vec4":
					parameterType = 7;
					break;
				case "double":case "float":
					parameterType = 4;
					break;
				case "mat2":case "mat2x2":
					parameterType = 12;
					break;
				case "mat2x3":
					parameterType = 13;
					break;
				case "mat2x4":
					parameterType = 14;
					break;
				case "mat3x2":
					parameterType = 15;
					break;
				case "mat3":case "mat3x3":
					parameterType = 16;
					break;
				case "mat3x4":
					parameterType = 17;
					break;
				case "mat4x2":
					parameterType = 18;
					break;
				case "mat4x3":
					parameterType = 19;
					break;
				case "mat4":case "mat4x4":
					parameterType = 20;
					break;
				case "int":case "uint":
					parameterType = 8;
					break;
				case "ivec2":case "uvec2":
					parameterType = 9;
					break;
				case "ivec3":case "uvec3":
					parameterType = 10;
					break;
				case "ivec4":case "uvec4":
					parameterType = 11;
					break;
				default:
					parameterType = null;
				}
				if(storageType == "uniform") {
					this.__glslUniformNames.push(name);
					this.__glslUniformTypes.push(parameterType);
				} else {
					this.__glslAttribNames.push(name);
					this.__glslAttribTypes.push(parameterType);
				}
			}
			position = regex.matchedPos();
			lastMatch = position.pos + position.len;
		}
	}
	,__setPositionScale: function(positionScale) {
		if(this.__format == 1) {
			return;
		}
		if(this.__agalPositionScale != null) {
			var gl = this.__context.gl;
			var location = this.__agalPositionScale.location;
			var data = positionScale;
			var srcOffset = null;
			if(srcOffset != null) {
				gl.uniform4fv(location,data,srcOffset,null);
			} else {
				gl.uniform4fv(location,data);
			}
		}
	}
	,__setSamplerState: function(sampler,state) {
		this.__samplerStates[sampler] = state;
	}
	,__uploadFromGLSL: function(vertexShaderSource,fragmentShaderSource) {
		var gl = this.__context.gl;
		this.__glVertexSource = vertexShaderSource;
		this.__glFragmentSource = fragmentShaderSource;
		this.__glVertexShader = gl.createShader(gl.VERTEX_SHADER);
		gl.shaderSource(this.__glVertexShader,vertexShaderSource);
		gl.compileShader(this.__glVertexShader);
		if(gl.getShaderParameter(this.__glVertexShader,gl.COMPILE_STATUS) == 0) {
			var message = "Error compiling vertex shader";
			message += "\n" + gl.getShaderInfoLog(this.__glVertexShader);
			message += "\n" + vertexShaderSource;
			lime_utils_Log.error(message,{ fileName : "openfl/display3D/Program3D.hx", lineNumber : 869, className : "openfl.display3D.Program3D", methodName : "__uploadFromGLSL"});
		}
		this.__glFragmentShader = gl.createShader(gl.FRAGMENT_SHADER);
		gl.shaderSource(this.__glFragmentShader,fragmentShaderSource);
		gl.compileShader(this.__glFragmentShader);
		if(gl.getShaderParameter(this.__glFragmentShader,gl.COMPILE_STATUS) == 0) {
			var message = "Error compiling fragment shader";
			message += "\n" + gl.getShaderInfoLog(this.__glFragmentShader);
			message += "\n" + fragmentShaderSource;
			lime_utils_Log.error(message,{ fileName : "openfl/display3D/Program3D.hx", lineNumber : 881, className : "openfl.display3D.Program3D", methodName : "__uploadFromGLSL"});
		}
		this.__glProgram = gl.createProgram();
		if(this.__format == 0) {
			var _g = 0;
			while(_g < 16) {
				var i = _g++;
				var name = "va" + i;
				if(vertexShaderSource.indexOf(" " + name) != -1) {
					gl.bindAttribLocation(this.__glProgram,i,name);
				}
			}
		} else {
			var _g = 0;
			var _g1 = this.__glslAttribNames;
			while(_g < _g1.length) {
				var name = _g1[_g];
				++_g;
				if(name.indexOf("Position") > -1 && StringTools.startsWith(name,"openfl_")) {
					gl.bindAttribLocation(this.__glProgram,0,name);
					break;
				}
			}
		}
		gl.attachShader(this.__glProgram,this.__glVertexShader);
		gl.attachShader(this.__glProgram,this.__glFragmentShader);
		gl.linkProgram(this.__glProgram);
		if(gl.getProgramParameter(this.__glProgram,gl.LINK_STATUS) == 0) {
			var message = "Unable to initialize the shader program";
			message += "\n" + gl.getProgramInfoLog(this.__glProgram);
			lime_utils_Log.error(message,{ fileName : "openfl/display3D/Program3D.hx", lineNumber : 922, className : "openfl.display3D.Program3D", methodName : "__uploadFromGLSL"});
		}
	}
	,__class__: openfl_display3D_Program3D
};
var openfl_display3D_Uniform = function(context) {
	this.context = context;
	this.isDirty = true;
	this.regDataPointer = new lime_utils_BytePointerData(null,0);
};
$hxClasses["openfl.display3D.Uniform"] = openfl_display3D_Uniform;
openfl_display3D_Uniform.__name__ = "openfl.display3D.Uniform";
openfl_display3D_Uniform.prototype = {
	name: null
	,location: null
	,type: null
	,size: null
	,regData: null
	,regIndex: null
	,regCount: null
	,isDirty: null
	,context: null
	,regDataPointer: null
	,flush: function() {
		var gl = this.context.gl;
		var index = this.regIndex * 4;
		switch(this.type) {
		case 35664:
			lime_graphics_WebGL2RenderContext.uniform2fv(gl,this.location,this.regData.subarray(index,index + this.regCount * 2));
			break;
		case 35665:
			var location = this.location;
			var data = this.regData.subarray(index,index + this.regCount * 3);
			var srcOffset = null;
			if(srcOffset != null) {
				gl.uniform3fv(location,data,srcOffset,null);
			} else {
				gl.uniform3fv(location,data);
			}
			break;
		case 35666:
			var location = this.location;
			var data = this.regData.subarray(index,index + this.regCount * 4);
			var srcOffset = null;
			if(srcOffset != null) {
				gl.uniform4fv(location,data,srcOffset,null);
			} else {
				gl.uniform4fv(location,data);
			}
			break;
		case 35674:
			lime_graphics_WebGLRenderContext.uniformMatrix2fv(gl,this.location,false,this.regData.subarray(index,index + this.size * 2 * 2));
			break;
		case 35675:
			lime_graphics_WebGLRenderContext.uniformMatrix3fv(gl,this.location,false,this.regData.subarray(index,index + this.size * 3 * 3));
			break;
		case 35676:
			lime_graphics_WebGLRenderContext.uniformMatrix4fv(gl,this.location,false,this.regData.subarray(index,index + this.size * 4 * 4));
			break;
		default:
			var location = this.location;
			var data = this.regData.subarray(index,index + this.regCount * 4);
			var srcOffset = null;
			if(srcOffset != null) {
				gl.uniform4fv(location,data,srcOffset,null);
			} else {
				gl.uniform4fv(location,data);
			}
		}
	}
	,__getUniformRegisters: function(index,size) {
		return this.regData.subarray(index,index + size);
	}
	,__class__: openfl_display3D_Uniform
};
var openfl_display3D_UniformMap = function(list) {
	this.__uniforms = list;
	this.__uniforms.sort(function(a,b) {
		return Reflect.compare(a.regIndex,b.regIndex);
	});
	var total = 0;
	var _g = 0;
	var _g1 = this.__uniforms;
	while(_g < _g1.length) {
		var uniform = _g1[_g];
		++_g;
		if(uniform.regIndex + uniform.regCount > total) {
			total = uniform.regIndex + uniform.regCount;
		}
	}
	this.__registerLookup = openfl_Vector.toObjectVector(null,total);
	var _g = 0;
	var _g1 = this.__uniforms;
	while(_g < _g1.length) {
		var uniform = _g1[_g];
		++_g;
		var _g2 = 0;
		var _g3 = uniform.regCount;
		while(_g2 < _g3) {
			var i = _g2++;
			this.__registerLookup.set(uniform.regIndex + i,uniform);
		}
	}
	this.__anyDirty = this.__allDirty = true;
};
$hxClasses["openfl.display3D.UniformMap"] = openfl_display3D_UniformMap;
openfl_display3D_UniformMap.__name__ = "openfl.display3D.UniformMap";
openfl_display3D_UniformMap.prototype = {
	__allDirty: null
	,__anyDirty: null
	,__registerLookup: null
	,__uniforms: null
	,flush: function() {
		if(this.__anyDirty) {
			var _g = 0;
			var _g1 = this.__uniforms;
			while(_g < _g1.length) {
				var uniform = _g1[_g];
				++_g;
				if(this.__allDirty || uniform.isDirty) {
					uniform.flush();
					uniform.isDirty = false;
				}
			}
			this.__anyDirty = this.__allDirty = false;
		}
	}
	,markAllDirty: function() {
		this.__allDirty = true;
		this.__anyDirty = true;
	}
	,markDirty: function(start,count) {
		if(this.__allDirty) {
			return;
		}
		var end = start + count;
		if(end > this.__registerLookup.get_length()) {
			end = this.__registerLookup.get_length();
		}
		var index = start;
		while(index < end) {
			var uniform = this.__registerLookup.get(index);
			if(uniform != null) {
				uniform.isDirty = true;
				this.__anyDirty = true;
				index = uniform.regIndex + uniform.regCount;
			} else {
				++index;
			}
		}
	}
	,__class__: openfl_display3D_UniformMap
};
var openfl_display3D_VertexBuffer3D = function(context3D,numVertices,dataPerVertex,bufferUsage) {
	this.__context = context3D;
	this.__numVertices = numVertices;
	this.__vertexSize = dataPerVertex;
	var gl = this.__context.gl;
	this.__id = gl.createBuffer();
	this.__stride = this.__vertexSize * 4;
	this.__usage = openfl_display3D_Context3DBufferUsage.fromString(bufferUsage) == 0 ? gl.DYNAMIC_DRAW : gl.STATIC_DRAW;
};
$hxClasses["openfl.display3D.VertexBuffer3D"] = openfl_display3D_VertexBuffer3D;
openfl_display3D_VertexBuffer3D.__name__ = "openfl.display3D.VertexBuffer3D";
openfl_display3D_VertexBuffer3D.prototype = {
	__context: null
	,__data: null
	,__id: null
	,__memoryUsage: null
	,__numVertices: null
	,__stride: null
	,__tempFloat32Array: null
	,__usage: null
	,__vertexSize: null
	,dispose: function() {
		var gl = this.__context.gl;
		gl.deleteBuffer(this.__id);
	}
	,uploadFromByteArray: function(data,byteArrayOffset,startVertex,numVertices) {
		var offset = byteArrayOffset + startVertex * this.__stride;
		var length = numVertices * this.__vertexSize;
		var elements = null;
		var array = null;
		var vector = null;
		var view = null;
		var buffer = openfl_utils_ByteArray.toArrayBuffer(data);
		var byteoffset = offset;
		if(byteoffset == null) {
			byteoffset = 0;
		}
		var this1;
		if(elements != null) {
			this1 = new Float32Array(elements);
		} else if(array != null) {
			this1 = new Float32Array(array);
		} else if(vector != null) {
			this1 = new Float32Array(vector.__array);
		} else if(view != null) {
			this1 = new Float32Array(view);
		} else if(buffer != null) {
			if(length == null) {
				this1 = new Float32Array(buffer,byteoffset);
			} else {
				this1 = new Float32Array(buffer,byteoffset,length);
			}
		} else {
			this1 = null;
		}
		this.uploadFromTypedArray(lime_utils_Float32Array.toArrayBufferView(this1));
	}
	,uploadFromTypedArray: function(data,byteLength) {
		if(byteLength == null) {
			byteLength = -1;
		}
		if(data == null) {
			return;
		}
		var gl = this.__context.gl;
		this.__context.__bindGLArrayBuffer(this.__id);
		lime_graphics_WebGLRenderContext.bufferData(gl,gl.ARRAY_BUFFER,data,this.__usage);
	}
	,uploadFromVector: function(data,startVertex,numVertices) {
		if(data == null) {
			return;
		}
		var gl = this.__context.gl;
		var start = startVertex * this.__vertexSize;
		var count = numVertices * this.__vertexSize;
		var length = start + count;
		var existingFloat32Array = this.__tempFloat32Array;
		if(this.__tempFloat32Array == null || this.__tempFloat32Array.length < count) {
			var array = null;
			var vector = null;
			var view = null;
			var buffer = null;
			var len = null;
			var this1;
			if(count != null) {
				this1 = new Float32Array(count);
			} else if(array != null) {
				this1 = new Float32Array(array);
			} else if(vector != null) {
				this1 = new Float32Array(vector.__array);
			} else if(view != null) {
				this1 = new Float32Array(view);
			} else if(buffer != null) {
				if(len == null) {
					this1 = new Float32Array(buffer,0);
				} else {
					this1 = new Float32Array(buffer,0,len);
				}
			} else {
				this1 = null;
			}
			this.__tempFloat32Array = this1;
			if(existingFloat32Array != null) {
				this.__tempFloat32Array.set(existingFloat32Array);
			}
		}
		var _g = start;
		var _g1 = length;
		while(_g < _g1) {
			var i = _g++;
			this.__tempFloat32Array[i - start] = data.get(i);
		}
		this.uploadFromTypedArray(lime_utils_Float32Array.toArrayBufferView(this.__tempFloat32Array));
	}
	,__class__: openfl_display3D_VertexBuffer3D
};
var openfl_display3D__$internal_AGALConverter = function() { };
$hxClasses["openfl.display3D._internal.AGALConverter"] = openfl_display3D__$internal_AGALConverter;
openfl_display3D__$internal_AGALConverter.__name__ = "openfl.display3D._internal.AGALConverter";
openfl_display3D__$internal_AGALConverter.prefixFromType = function(regType,programType) {
	switch(regType) {
	case 0:
		return "va";
	case 1:
		if(programType == openfl_display3D__$internal__$AGALConverter_ProgramType.VERTEX) {
			return "vc";
		} else {
			return "fc";
		}
		break;
	case 2:
		if(programType == openfl_display3D__$internal__$AGALConverter_ProgramType.VERTEX) {
			return "vt";
		} else {
			return "ft";
		}
		break;
	case 3:
		return "output_";
	case 4:
		return "v";
	case 5:
		return "sampler";
	default:
		throw new openfl_errors_IllegalOperationError("Invalid data!");
	}
};
openfl_display3D__$internal_AGALConverter.readUInt64 = function(byteArray) {
	var low = byteArray.readInt();
	var high = byteArray.readInt();
	return new haxe__$Int64__$_$_$Int64(high,low);
};
openfl_display3D__$internal_AGALConverter.convertToGLSL = function(agal,samplerState) {
	agal.position = 0;
	agal.__endian = 1;
	var magic = agal.readByte() & 255;
	if(magic == 176) {
		return agal.readUTF();
	}
	if(magic != 160) {
		throw new openfl_errors_IllegalOperationError("Magic value must be 0xA0, may not be AGAL");
	}
	var version = agal.readInt();
	var shaderTypeID = agal.readByte() & 255;
	if(shaderTypeID != 161) {
		throw new openfl_errors_IllegalOperationError("Shader type ID must be 0xA1");
	}
	var programType = (agal.readByte() & 255) == 0 ? openfl_display3D__$internal__$AGALConverter_ProgramType.VERTEX : openfl_display3D__$internal__$AGALConverter_ProgramType.FRAGMENT;
	var map = new openfl_display3D__$internal_RegisterMap();
	var sb_b = "";
	while(true) {
		var a = agal.position;
		if(!UInt.gt(openfl_utils_ByteArray.get_length(agal),a)) {
			break;
		}
		var opcode = agal.readInt();
		var dest = agal.readUnsignedInt();
		var source1 = openfl_display3D__$internal_AGALConverter.readUInt64(agal);
		var source2 = openfl_display3D__$internal_AGALConverter.readUInt64(agal);
		var dr = openfl_display3D__$internal__$AGALConverter_DestRegister.parse(dest,programType);
		var sr1 = openfl_display3D__$internal__$AGALConverter_SourceRegister.parse(source1,programType,dr.mask);
		var sr2 = openfl_display3D__$internal__$AGALConverter_SourceRegister.parse(source2,programType,dr.mask);
		sb_b += "\t";
		switch(opcode) {
		case 0:
			sb_b += Std.string(dr.toGLSL() + " = " + sr1.toGLSL() + "; // mov");
			map.addDR(dr,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4);
			map.addSR(sr1,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4);
			break;
		case 1:
			sb_b += Std.string(dr.toGLSL() + " = " + sr1.toGLSL() + " + " + sr2.toGLSL() + "; // add");
			map.addDR(dr,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4);
			map.addSR(sr1,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4);
			map.addSR(sr2,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4);
			break;
		case 2:
			sb_b += Std.string(dr.toGLSL() + " = " + sr1.toGLSL() + " - " + sr2.toGLSL() + "; // sub");
			map.addDR(dr,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4);
			map.addSR(sr1,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4);
			map.addSR(sr2,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4);
			break;
		case 3:
			sb_b += Std.string(dr.toGLSL() + " = " + sr1.toGLSL() + " * " + sr2.toGLSL() + "; // mul");
			map.addDR(dr,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4);
			map.addSR(sr1,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4);
			map.addSR(sr2,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4);
			break;
		case 4:
			sb_b += Std.string(dr.toGLSL() + " = " + sr1.toGLSL() + " / " + sr2.toGLSL() + "; // div");
			map.addDR(dr,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4);
			map.addSR(sr1,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4);
			map.addSR(sr2,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4);
			break;
		case 5:
			var sr = sr1.toGLSL();
			if(sr.indexOf(".") > -1) {
				sb_b += Std.string(dr.toGLSL() + " = 1.0 / " + sr1.toGLSL() + "; // rcp");
			} else {
				sb_b += Std.string(dr.toGLSL() + " = vec4(1) / " + sr1.toGLSL() + "; // rcp");
			}
			map.addDR(dr,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4);
			map.addSR(sr1,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4);
			break;
		case 6:
			sb_b += Std.string(dr.toGLSL() + " = min(" + sr1.toGLSL() + ", " + sr2.toGLSL() + "); // min");
			map.addDR(dr,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4);
			map.addSR(sr1,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4);
			map.addSR(sr2,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4);
			break;
		case 7:
			sb_b += Std.string(dr.toGLSL() + " = max(" + sr1.toGLSL() + ", " + sr2.toGLSL() + "); // max");
			map.addDR(dr,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4);
			map.addSR(sr1,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4);
			map.addSR(sr2,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4);
			break;
		case 8:
			sb_b += Std.string(dr.toGLSL() + " = fract(" + sr1.toGLSL() + "); // frc");
			map.addDR(dr,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4);
			map.addSR(sr1,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4);
			break;
		case 9:
			sb_b += Std.string(dr.toGLSL() + " = sqrt(" + sr1.toGLSL() + "); // sqrt");
			map.addDR(dr,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4);
			map.addSR(sr1,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4);
			break;
		case 10:
			sb_b += Std.string(dr.toGLSL() + " = inversesqrt(" + sr1.toGLSL() + "); // rsq");
			map.addDR(dr,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4);
			map.addSR(sr1,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4);
			break;
		case 11:
			sb_b += Std.string(dr.toGLSL() + " = pow(" + sr1.toGLSL() + ", " + sr2.toGLSL() + "); // pow");
			map.addDR(dr,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4);
			map.addSR(sr1,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4);
			map.addSR(sr2,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4);
			break;
		case 12:
			sb_b += Std.string(dr.toGLSL() + " = log2(" + sr1.toGLSL() + "); // log");
			map.addDR(dr,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4);
			map.addSR(sr1,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4);
			break;
		case 13:
			sb_b += Std.string(dr.toGLSL() + " = exp2(" + sr1.toGLSL() + "); // exp");
			map.addDR(dr,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4);
			map.addSR(sr1,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4);
			break;
		case 14:
			sb_b += Std.string(dr.toGLSL() + " = normalize(" + sr1.toGLSL() + "); // normalize");
			map.addDR(dr,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4);
			map.addSR(sr1,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4);
			break;
		case 15:
			sb_b += Std.string(dr.toGLSL() + " = sin(" + sr1.toGLSL() + "); // sin");
			map.addDR(dr,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4);
			map.addSR(sr1,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4);
			break;
		case 16:
			sb_b += Std.string(dr.toGLSL() + " = cos(" + sr1.toGLSL() + "); // cos");
			map.addDR(dr,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4);
			map.addSR(sr1,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4);
			break;
		case 17:
			sr1.sourceMask = sr2.sourceMask = 7;
			sb_b += Std.string(dr.toGLSL() + " = cross(vec3(" + sr1.toGLSL() + "), vec3(" + sr2.toGLSL() + ")); // crs");
			map.addDR(dr,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4);
			map.addSR(sr1,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4);
			map.addSR(sr2,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4);
			break;
		case 18:
			sr1.sourceMask = sr2.sourceMask = 7;
			sb_b += Std.string(dr.toGLSL() + " = vec4(dot(vec3(" + sr1.toGLSL() + "), vec3(" + sr2.toGLSL() + ")))" + dr.getWriteMask() + "; // dp3");
			map.addDR(dr,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4);
			map.addSR(sr1,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4);
			map.addSR(sr2,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4);
			break;
		case 19:
			sr1.sourceMask = sr2.sourceMask = 15;
			sb_b += Std.string(dr.toGLSL() + " = vec4(dot(vec4(" + sr1.toGLSL() + "), vec4(" + sr2.toGLSL() + ")))" + dr.getWriteMask() + "; // dp4");
			map.addDR(dr,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4);
			map.addSR(sr1,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4);
			map.addSR(sr2,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4);
			break;
		case 20:
			sb_b += Std.string(dr.toGLSL() + " = abs(" + sr1.toGLSL() + "); // abs");
			map.addDR(dr,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4);
			map.addSR(sr1,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4);
			break;
		case 21:
			sb_b += Std.string(dr.toGLSL() + " = -" + sr1.toGLSL() + "; // neg");
			map.addDR(dr,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4);
			map.addSR(sr1,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4);
			break;
		case 22:
			sb_b += Std.string(dr.toGLSL() + " = clamp(" + sr1.toGLSL() + ", 0.0, 1.0); // saturate");
			map.addDR(dr,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4);
			map.addSR(sr1,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4);
			break;
		case 23:
			var existingUsage = map.getRegisterUsage(sr2);
			if(existingUsage != openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4 && existingUsage != openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4_ARRAY) {
				sb_b += Std.string(dr.toGLSL() + " = " + sr1.toGLSL() + " * mat3(" + sr2.toGLSL(false) + "); // m33");
				map.addDR(dr,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4);
				map.addSR(sr1,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4);
				map.addSR(sr2,openfl_display3D__$internal__$AGALConverter_RegisterUsage.MATRIX_4_4);
			} else {
				sr1.sourceMask = sr2.sourceMask = 7;
				sb_b += Std.string(dr.toGLSL() + " = vec3(" + "dot(" + sr1.toGLSL(true) + "," + sr2.toGLSL(true,0) + "), " + "dot(" + sr1.toGLSL(true) + "," + sr2.toGLSL(true,1) + ")," + "dot(" + sr1.toGLSL(true) + "," + sr2.toGLSL(true,2) + ")); // m33");
				map.addDR(dr,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4);
				map.addSR(sr1,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4);
				map.addSR(sr2,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4,0);
				map.addSR(sr2,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4,1);
				map.addSR(sr2,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4,2);
			}
			break;
		case 24:
			var existingUsage1 = map.getRegisterUsage(sr2);
			if(existingUsage1 != openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4 && existingUsage1 != openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4_ARRAY) {
				sb_b += Std.string(dr.toGLSL() + " = " + sr1.toGLSL() + " * " + sr2.toGLSL(false) + "; // m44");
				map.addDR(dr,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4);
				map.addSR(sr1,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4);
				map.addSR(sr2,openfl_display3D__$internal__$AGALConverter_RegisterUsage.MATRIX_4_4);
			} else {
				sr1.sourceMask = sr2.sourceMask = 15;
				sb_b += Std.string(dr.toGLSL() + " = vec4(" + "dot(" + sr1.toGLSL(true) + "," + sr2.toGLSL(true,0) + "), " + "dot(" + sr1.toGLSL(true) + "," + sr2.toGLSL(true,1) + "), " + "dot(" + sr1.toGLSL(true) + "," + sr2.toGLSL(true,2) + "), " + "dot(" + sr1.toGLSL(true) + "," + sr2.toGLSL(true,3) + ")); // m44");
				map.addDR(dr,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4);
				map.addSR(sr1,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4);
				map.addSR(sr2,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4,0);
				map.addSR(sr2,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4,1);
				map.addSR(sr2,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4,2);
				map.addSR(sr2,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4,3);
			}
			break;
		case 25:
			dr.mask &= 7;
			var existingUsage2 = map.getRegisterUsage(sr2);
			if(existingUsage2 != openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4 && existingUsage2 != openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4_ARRAY) {
				sb_b += Std.string(dr.toGLSL() + " = " + sr1.toGLSL() + " * " + sr2.toGLSL(false) + "; // m34");
				map.addDR(dr,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4);
				map.addSR(sr1,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4);
				map.addSR(sr2,openfl_display3D__$internal__$AGALConverter_RegisterUsage.MATRIX_4_4);
			} else {
				sr1.sourceMask = sr2.sourceMask = 15;
				sb_b += Std.string(dr.toGLSL() + " = vec3(" + "dot(" + sr1.toGLSL(true) + "," + sr2.toGLSL(true,0) + "), " + "dot(" + sr1.toGLSL(true) + "," + sr2.toGLSL(true,1) + ")," + "dot(" + sr1.toGLSL(true) + "," + sr2.toGLSL(true,2) + ")); // m34");
				map.addDR(dr,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4);
				map.addSR(sr1,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4);
				map.addSR(sr2,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4,0);
				map.addSR(sr2,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4,1);
				map.addSR(sr2,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4,2);
			}
			break;
		case 26:
			if(version < 2) {
				throw new openfl_errors_IllegalOperationError("Version must be 2");
			}
			sb_b += Std.string(dr.toGLSL() + " = ddx(" + sr1.toGLSL() + "); // ddx");
			map.addDR(dr,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4);
			map.addSR(sr1,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4);
			break;
		case 27:
			if(version < 2) {
				throw new openfl_errors_IllegalOperationError("Version must be 2");
			}
			sb_b += Std.string(dr.toGLSL() + " = ddy(" + sr1.toGLSL() + "); // ddy");
			map.addDR(dr,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4);
			map.addSR(sr1,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4);
			break;
		case 28:
			if(version < 2) {
				throw new openfl_errors_IllegalOperationError("Version must be 2");
			}
			sr1.sourceMask = sr2.sourceMask = 1;
			sb_b += Std.string("if (" + sr1.toGLSL() + " == " + sr2.toGLSL() + ") { // ife");
			map.addSR(sr1,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4);
			map.addSR(sr2,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4);
			break;
		case 29:
			if(version < 2) {
				throw new openfl_errors_IllegalOperationError("Version must be 2");
			}
			sr1.sourceMask = sr2.sourceMask = 1;
			sb_b += Std.string("if (" + sr1.toGLSL() + " != " + sr2.toGLSL() + ") { // ine");
			map.addSR(sr1,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4);
			map.addSR(sr2,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4);
			break;
		case 30:
			if(version < 2) {
				throw new openfl_errors_IllegalOperationError("Version must be 2");
			}
			sr1.sourceMask = sr2.sourceMask = 1;
			sb_b += Std.string("if (" + sr1.toGLSL() + " >= " + sr2.toGLSL() + ") { // ifg");
			map.addSR(sr1,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4);
			map.addSR(sr2,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4);
			break;
		case 31:
			if(version < 2) {
				throw new openfl_errors_IllegalOperationError("Version must be 2");
			}
			sr1.sourceMask = sr2.sourceMask = 1;
			sb_b += Std.string("if (" + sr1.toGLSL() + " < " + sr2.toGLSL() + ") { // ifl");
			map.addSR(sr1,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4);
			map.addSR(sr2,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4);
			break;
		case 32:
			if(version < 2) {
				throw new openfl_errors_IllegalOperationError("Version must be 2");
			}
			sb_b += "} else { // els";
			break;
		case 33:
			if(version < 2) {
				throw new openfl_errors_IllegalOperationError("Version must be 2");
			}
			sb_b += "} // eif";
			break;
		case 39:
			sr1.sourceMask = 15;
			sb_b += Std.string("if (any(lessThan(" + sr1.toGLSL() + ", vec4(0)))) discard;");
			map.addSR(sr1,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4);
			break;
		case 40:
			var sampler = openfl_display3D__$internal__$AGALConverter_SamplerRegister.parse(source2,programType);
			switch(sampler.d) {
			case 0:
				if(sampler.t == 2) {
					sr1.sourceMask = 3;
					map.addSaR(sampler,openfl_display3D__$internal__$AGALConverter_RegisterUsage.SAMPLER_2D_ALPHA);
					sb_b += Std.string("if (" + sampler.toGLSL() + "_alphaEnabled) {\n");
					sb_b += Std.string("\t\t" + dr.toGLSL() + " = vec4(texture2D(" + sampler.toGLSL() + ", " + sr1.toGLSL() + ").xyz, texture2D(" + sampler.toGLSL() + "_alpha, " + sr1.toGLSL() + ").x); // tex + alpha\n");
					sb_b += "\t} else {\n";
					sb_b += Std.string("\t\t" + dr.toGLSL() + " = texture2D(" + sampler.toGLSL() + ", " + sr1.toGLSL() + "); // tex\n");
					sb_b += "\t}";
				} else {
					sr1.sourceMask = 3;
					map.addSaR(sampler,openfl_display3D__$internal__$AGALConverter_RegisterUsage.SAMPLER_2D);
					sb_b += Std.string(dr.toGLSL() + " = texture2D(" + sampler.toGLSL() + ", " + sr1.toGLSL() + "); // tex");
				}
				break;
			case 1:
				if(sampler.t == 2) {
					sr1.sourceMask = 7;
					map.addSaR(sampler,openfl_display3D__$internal__$AGALConverter_RegisterUsage.SAMPLER_CUBE_ALPHA);
					sb_b += Std.string("if (" + sampler.toGLSL() + "_alphaEnabled) {\n");
					sb_b += Std.string("\t\t" + dr.toGLSL() + " = vec4(textureCube(" + sampler.toGLSL() + ", " + sr1.toGLSL() + ").xyz, textureCube(" + sampler.toGLSL() + "_alpha, " + sr1.toGLSL() + ").x); // tex + alpha\n");
					sb_b += "\t} else {\n";
					sb_b += Std.string("\t\t" + dr.toGLSL() + " = textureCube(" + sampler.toGLSL() + ", " + sr1.toGLSL() + "); // tex");
					sb_b += "\t}";
				} else {
					sr1.sourceMask = 7;
					sb_b += Std.string(dr.toGLSL() + " = textureCube(" + sampler.toGLSL() + ", " + sr1.toGLSL() + "); // tex");
					map.addSaR(sampler,openfl_display3D__$internal__$AGALConverter_RegisterUsage.SAMPLER_CUBE);
				}
				break;
			}
			map.addDR(dr,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4);
			map.addSR(sr1,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4);
			if(samplerState != null) {
				samplerState[sampler.n] = sampler.toSamplerState();
			}
			break;
		case 41:
			sr1.sourceMask = sr2.sourceMask = 15;
			sb_b += Std.string(dr.toGLSL() + " = vec4(greaterThanEqual(" + sr1.toGLSL() + ", " + sr2.toGLSL() + "))" + dr.getWriteMask() + "; // ste");
			map.addDR(dr,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4);
			map.addSR(sr1,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4);
			map.addSR(sr2,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4);
			break;
		case 42:
			sr1.sourceMask = sr2.sourceMask = 15;
			sb_b += Std.string(dr.toGLSL() + " = vec4(lessThan(" + sr1.toGLSL() + ", " + sr2.toGLSL() + "))" + dr.getWriteMask() + "; // slt");
			map.addDR(dr,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4);
			map.addSR(sr1,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4);
			map.addSR(sr2,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4);
			break;
		case 44:
			sr1.sourceMask = sr2.sourceMask = 15;
			sb_b += Std.string(dr.toGLSL() + " = vec4(equal(" + sr1.toGLSL() + ", " + sr2.toGLSL() + "))" + dr.getWriteMask() + "; // seq");
			map.addDR(dr,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4);
			map.addSR(sr1,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4);
			map.addSR(sr2,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4);
			break;
		case 45:
			sr1.sourceMask = sr2.sourceMask = 15;
			sb_b += Std.string(dr.toGLSL() + " = vec4(notEqual(" + sr1.toGLSL() + ", " + sr2.toGLSL() + "))" + dr.getWriteMask() + "; // sne");
			map.addDR(dr,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4);
			map.addSR(sr1,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4);
			map.addSR(sr2,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4);
			break;
		default:
			throw new openfl_errors_IllegalOperationError("Opcode " + opcode);
		}
		sb_b += "\n";
	}
	if(openfl_display3D__$internal_AGALConverter.limitedProfile == null) {
		var version = lime_graphics_opengl_GL.context.getParameter(7938);
		openfl_display3D__$internal_AGALConverter.limitedProfile = version.indexOf("OpenGL ES") > -1 || version.indexOf("WebGL") > -1;
	}
	var glsl_b = "";
	glsl_b += Std.string("// AGAL " + (programType == openfl_display3D__$internal__$AGALConverter_ProgramType.VERTEX ? "vertex" : "fragment") + " shader\n");
	if(openfl_display3D__$internal_AGALConverter.limitedProfile) {
		glsl_b += "#version 100\n";
		glsl_b += "#ifdef GL_FRAGMENT_PRECISION_HIGH\n";
		glsl_b += "precision highp float;\n";
		glsl_b += "#else\n";
		glsl_b += "precision mediump float;\n";
		glsl_b += "#endif\n";
	} else {
		glsl_b += "#version 120\n";
	}
	glsl_b += Std.string(map.toGLSL(false));
	if(programType == openfl_display3D__$internal__$AGALConverter_ProgramType.VERTEX) {
		glsl_b += "uniform vec4 vcPositionScale;\n";
	}
	glsl_b += "void main() {\n";
	glsl_b += Std.string(map.toGLSL(true));
	glsl_b += Std.string(sb_b);
	if(programType == openfl_display3D__$internal__$AGALConverter_ProgramType.VERTEX) {
		glsl_b += "\tgl_Position *= vcPositionScale;\n";
	}
	glsl_b += "}\n";
	return glsl_b;
};
var openfl_display3D__$internal__$AGALConverter_DestRegister = function() {
};
$hxClasses["openfl.display3D._internal._AGALConverter.DestRegister"] = openfl_display3D__$internal__$AGALConverter_DestRegister;
openfl_display3D__$internal__$AGALConverter_DestRegister.__name__ = "openfl.display3D._internal._AGALConverter.DestRegister";
openfl_display3D__$internal__$AGALConverter_DestRegister.parse = function(v,programType) {
	var dr = new openfl_display3D__$internal__$AGALConverter_DestRegister();
	dr.programType = programType;
	dr.type = v >>> 24 & 15;
	dr.mask = v >>> 16 & 15;
	dr.n = v & 65535;
	return dr;
};
openfl_display3D__$internal__$AGALConverter_DestRegister.prototype = {
	mask: null
	,n: null
	,programType: null
	,type: null
	,getWriteMask: function() {
		var str = ".";
		if((this.mask & 1) != 0) {
			str += "x";
		}
		if((this.mask & 2) != 0) {
			str += "y";
		}
		if((this.mask & 4) != 0) {
			str += "z";
		}
		if((this.mask & 8) != 0) {
			str += "w";
		}
		return str;
	}
	,toGLSL: function(useMask) {
		if(useMask == null) {
			useMask = true;
		}
		var str;
		if(this.type == 3) {
			str = this.programType == openfl_display3D__$internal__$AGALConverter_ProgramType.VERTEX ? "gl_Position" : "gl_FragColor";
		} else {
			str = openfl_display3D__$internal_AGALConverter.prefixFromType(this.type,this.programType) + this.n;
		}
		if(useMask && this.mask != 15) {
			str += this.getWriteMask();
		}
		return str;
	}
	,__class__: openfl_display3D__$internal__$AGALConverter_DestRegister
};
var openfl_display3D__$internal__$AGALConverter_ProgramType = $hxEnums["openfl.display3D._internal._AGALConverter.ProgramType"] = { __ename__:"openfl.display3D._internal._AGALConverter.ProgramType",__constructs__:null
	,VERTEX: {_hx_name:"VERTEX",_hx_index:0,__enum__:"openfl.display3D._internal._AGALConverter.ProgramType",toString:$estr}
	,FRAGMENT: {_hx_name:"FRAGMENT",_hx_index:1,__enum__:"openfl.display3D._internal._AGALConverter.ProgramType",toString:$estr}
};
openfl_display3D__$internal__$AGALConverter_ProgramType.__constructs__ = [openfl_display3D__$internal__$AGALConverter_ProgramType.VERTEX,openfl_display3D__$internal__$AGALConverter_ProgramType.FRAGMENT];
var openfl_display3D__$internal_RegisterMap = function() {
	this.mEntries = [];
};
$hxClasses["openfl.display3D._internal.RegisterMap"] = openfl_display3D__$internal_RegisterMap;
openfl_display3D__$internal_RegisterMap.__name__ = "openfl.display3D._internal.RegisterMap";
openfl_display3D__$internal_RegisterMap.prototype = {
	mEntries: null
	,add: function(type,name,number,usage) {
		var _g = 0;
		var _g1 = this.mEntries;
		while(_g < _g1.length) {
			var entry = _g1[_g];
			++_g;
			if(entry.type == type && entry.name == name && entry.number == number) {
				if(entry.usage != usage) {
					throw new openfl_errors_IllegalOperationError("Cannot use register in multiple ways yet (mat4/vec4)");
				}
				return;
			}
		}
		var entry = new openfl_display3D__$internal__$AGALConverter_RegisterMapEntry();
		entry.type = type;
		entry.name = name;
		entry.number = number;
		entry.usage = usage;
		this.mEntries.push(entry);
	}
	,addDR: function(dr,usage) {
		this.add(dr.type,dr.toGLSL(false),dr.n,usage);
	}
	,addSaR: function(sr,usage) {
		this.add(sr.type,sr.toGLSL(),sr.n,usage);
	}
	,addSR: function(sr,usage,offset) {
		if(offset == null) {
			offset = 0;
		}
		if(sr.d != 0) {
			this.add(sr.itype,openfl_display3D__$internal_AGALConverter.prefixFromType(sr.itype,sr.programType) + sr.n,sr.n,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4);
			this.add(sr.type,openfl_display3D__$internal_AGALConverter.prefixFromType(sr.type,sr.programType) + sr.o,sr.o,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4_ARRAY);
			return;
		}
		this.add(sr.type,sr.toGLSL(false,offset),sr.n + offset,usage);
	}
	,getRegisterUsage: function(sr) {
		if(sr.d != 0) {
			return openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4_ARRAY;
		}
		return this.getUsage(sr.type,sr.toGLSL(false),sr.n);
	}
	,getUsage: function(type,name,number) {
		var _g = 0;
		var _g1 = this.mEntries;
		while(_g < _g1.length) {
			var entry = _g1[_g];
			++_g;
			if(entry.type == type && entry.name == name && entry.number == number) {
				return entry.usage;
			}
		}
		return openfl_display3D__$internal__$AGALConverter_RegisterUsage.UNUSED;
	}
	,toGLSL: function(tempRegistersOnly) {
		this.mEntries.sort(function(a,b) {
			return a.number - b.number;
		});
		var entry;
		this.mEntries.sort(function(a,b) {
			return js_Boot.__cast(a.type , Int) - js_Boot.__cast(b.type , Int);
		});
		var sb_b = "";
		var _g = 0;
		var _g1 = this.mEntries.length;
		while(_g < _g1) {
			var i = _g++;
			entry = this.mEntries[i];
			if(tempRegistersOnly && entry.type != 2 || !tempRegistersOnly && entry.type == 2) {
				continue;
			}
			if(entry.type == 3) {
				continue;
			}
			switch(entry.type) {
			case 0:
				sb_b += "attribute ";
				break;
			case 1:
				sb_b += "uniform ";
				break;
			case 2:
				sb_b += "\t";
				break;
			case 3:
				break;
			case 4:
				sb_b += "varying ";
				break;
			case 5:
				sb_b += "uniform ";
				break;
			default:
				throw new openfl_errors_IllegalOperationError();
			}
			switch(entry.usage._hx_index) {
			case 0:
				lime_utils_Log.info("Missing switch patten: RegisterUsage.UNUSED",{ fileName : "openfl/display3D/_internal/AGALConverter.hx", lineNumber : 825, className : "openfl.display3D._internal.RegisterMap", methodName : "toGLSL"});
				break;
			case 1:
				sb_b += "vec4 ";
				break;
			case 2:
				sb_b += "mat4 ";
				break;
			case 3:
				sb_b += "sampler2D ";
				break;
			case 4:
				break;
			case 5:
				sb_b += "samplerCube ";
				break;
			case 6:
				break;
			case 7:
				sb_b += "vec4 ";
				break;
			}
			if(entry.usage == openfl_display3D__$internal__$AGALConverter_RegisterUsage.SAMPLER_2D_ALPHA) {
				sb_b += "sampler2D ";
				sb_b += Std.string(entry.name);
				sb_b += ";\n";
				sb_b += "uniform ";
				sb_b += "sampler2D ";
				sb_b += Std.string(entry.name + "_alpha");
				sb_b += ";\n";
				sb_b += "uniform ";
				sb_b += "bool ";
				sb_b += Std.string(entry.name + "_alphaEnabled");
				sb_b += ";\n";
			} else if(entry.usage == openfl_display3D__$internal__$AGALConverter_RegisterUsage.SAMPLER_CUBE_ALPHA) {
				sb_b += "samplerCube ";
				sb_b += Std.string(entry.name);
				sb_b += ";\n";
				sb_b += "uniform ";
				sb_b += "samplerCube ";
				sb_b += Std.string(entry.name + "_alpha");
				sb_b += ";\n";
				sb_b += "uniform ";
				sb_b += "bool ";
				sb_b += Std.string(entry.name + "_alphaEnabled");
				sb_b += ";\n";
			} else if(entry.usage == openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4_ARRAY) {
				sb_b += Std.string(entry.name + "[128]");
				sb_b += ";\n";
			} else {
				sb_b += Std.string(entry.name);
				sb_b += ";\n";
			}
		}
		return sb_b;
	}
	,__class__: openfl_display3D__$internal_RegisterMap
};
var openfl_display3D__$internal__$AGALConverter_RegisterMapEntry = function() {
};
$hxClasses["openfl.display3D._internal._AGALConverter.RegisterMapEntry"] = openfl_display3D__$internal__$AGALConverter_RegisterMapEntry;
openfl_display3D__$internal__$AGALConverter_RegisterMapEntry.__name__ = "openfl.display3D._internal._AGALConverter.RegisterMapEntry";
openfl_display3D__$internal__$AGALConverter_RegisterMapEntry.prototype = {
	name: null
	,number: null
	,type: null
	,usage: null
	,__class__: openfl_display3D__$internal__$AGALConverter_RegisterMapEntry
};
var openfl_display3D__$internal__$AGALConverter_RegisterUsage = $hxEnums["openfl.display3D._internal._AGALConverter.RegisterUsage"] = { __ename__:"openfl.display3D._internal._AGALConverter.RegisterUsage",__constructs__:null
	,UNUSED: {_hx_name:"UNUSED",_hx_index:0,__enum__:"openfl.display3D._internal._AGALConverter.RegisterUsage",toString:$estr}
	,VECTOR_4: {_hx_name:"VECTOR_4",_hx_index:1,__enum__:"openfl.display3D._internal._AGALConverter.RegisterUsage",toString:$estr}
	,MATRIX_4_4: {_hx_name:"MATRIX_4_4",_hx_index:2,__enum__:"openfl.display3D._internal._AGALConverter.RegisterUsage",toString:$estr}
	,SAMPLER_2D: {_hx_name:"SAMPLER_2D",_hx_index:3,__enum__:"openfl.display3D._internal._AGALConverter.RegisterUsage",toString:$estr}
	,SAMPLER_2D_ALPHA: {_hx_name:"SAMPLER_2D_ALPHA",_hx_index:4,__enum__:"openfl.display3D._internal._AGALConverter.RegisterUsage",toString:$estr}
	,SAMPLER_CUBE: {_hx_name:"SAMPLER_CUBE",_hx_index:5,__enum__:"openfl.display3D._internal._AGALConverter.RegisterUsage",toString:$estr}
	,SAMPLER_CUBE_ALPHA: {_hx_name:"SAMPLER_CUBE_ALPHA",_hx_index:6,__enum__:"openfl.display3D._internal._AGALConverter.RegisterUsage",toString:$estr}
	,VECTOR_4_ARRAY: {_hx_name:"VECTOR_4_ARRAY",_hx_index:7,__enum__:"openfl.display3D._internal._AGALConverter.RegisterUsage",toString:$estr}
};
openfl_display3D__$internal__$AGALConverter_RegisterUsage.__constructs__ = [openfl_display3D__$internal__$AGALConverter_RegisterUsage.UNUSED,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4,openfl_display3D__$internal__$AGALConverter_RegisterUsage.MATRIX_4_4,openfl_display3D__$internal__$AGALConverter_RegisterUsage.SAMPLER_2D,openfl_display3D__$internal__$AGALConverter_RegisterUsage.SAMPLER_2D_ALPHA,openfl_display3D__$internal__$AGALConverter_RegisterUsage.SAMPLER_CUBE,openfl_display3D__$internal__$AGALConverter_RegisterUsage.SAMPLER_CUBE_ALPHA,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4_ARRAY];
var openfl_display3D__$internal__$AGALConverter_SamplerRegister = function() {
};
$hxClasses["openfl.display3D._internal._AGALConverter.SamplerRegister"] = openfl_display3D__$internal__$AGALConverter_SamplerRegister;
openfl_display3D__$internal__$AGALConverter_SamplerRegister.__name__ = "openfl.display3D._internal._AGALConverter.SamplerRegister";
openfl_display3D__$internal__$AGALConverter_SamplerRegister.parse = function(v,programType) {
	var sr = new openfl_display3D__$internal__$AGALConverter_SamplerRegister();
	sr.programType = programType;
	var b = 60;
	b &= 63;
	var a = b == 0 ? new haxe__$Int64__$_$_$Int64(v.high,v.low) : b < 32 ? new haxe__$Int64__$_$_$Int64(v.high >> b,v.high << 32 - b | v.low >>> b) : new haxe__$Int64__$_$_$Int64(v.high >> 31,v.high >> b - 32);
	var b_high = 0;
	var b_low = 15;
	var this_high = a.high & b_high;
	var this_low = a.low & b_low;
	sr.f = this_low;
	var b = 56;
	b &= 63;
	var a = b == 0 ? new haxe__$Int64__$_$_$Int64(v.high,v.low) : b < 32 ? new haxe__$Int64__$_$_$Int64(v.high >> b,v.high << 32 - b | v.low >>> b) : new haxe__$Int64__$_$_$Int64(v.high >> 31,v.high >> b - 32);
	var b_high = 0;
	var b_low = 15;
	var this_high = a.high & b_high;
	var this_low = a.low & b_low;
	sr.m = this_low;
	var b = 52;
	b &= 63;
	var a = b == 0 ? new haxe__$Int64__$_$_$Int64(v.high,v.low) : b < 32 ? new haxe__$Int64__$_$_$Int64(v.high >> b,v.high << 32 - b | v.low >>> b) : new haxe__$Int64__$_$_$Int64(v.high >> 31,v.high >> b - 32);
	var b_high = 0;
	var b_low = 15;
	var this_high = a.high & b_high;
	var this_low = a.low & b_low;
	sr.w = this_low;
	var b = 48;
	b &= 63;
	var a = b == 0 ? new haxe__$Int64__$_$_$Int64(v.high,v.low) : b < 32 ? new haxe__$Int64__$_$_$Int64(v.high >> b,v.high << 32 - b | v.low >>> b) : new haxe__$Int64__$_$_$Int64(v.high >> 31,v.high >> b - 32);
	var b_high = 0;
	var b_low = 15;
	var this_high = a.high & b_high;
	var this_low = a.low & b_low;
	sr.s = this_low;
	var b = 44;
	b &= 63;
	var a = b == 0 ? new haxe__$Int64__$_$_$Int64(v.high,v.low) : b < 32 ? new haxe__$Int64__$_$_$Int64(v.high >> b,v.high << 32 - b | v.low >>> b) : new haxe__$Int64__$_$_$Int64(v.high >> 31,v.high >> b - 32);
	var b_high = 0;
	var b_low = 15;
	var this_high = a.high & b_high;
	var this_low = a.low & b_low;
	sr.d = this_low;
	var b = 40;
	b &= 63;
	var a = b == 0 ? new haxe__$Int64__$_$_$Int64(v.high,v.low) : b < 32 ? new haxe__$Int64__$_$_$Int64(v.high >> b,v.high << 32 - b | v.low >>> b) : new haxe__$Int64__$_$_$Int64(v.high >> 31,v.high >> b - 32);
	var b_high = 0;
	var b_low = 15;
	var this_high = a.high & b_high;
	var this_low = a.low & b_low;
	sr.t = this_low;
	var b = 32;
	b &= 63;
	var a = b == 0 ? new haxe__$Int64__$_$_$Int64(v.high,v.low) : b < 32 ? new haxe__$Int64__$_$_$Int64(v.high >> b,v.high << 32 - b | v.low >>> b) : new haxe__$Int64__$_$_$Int64(v.high >> 31,v.high >> b - 32);
	var b_high = 0;
	var b_low = 15;
	var this_high = a.high & b_high;
	var this_low = a.low & b_low;
	sr.type = this_low;
	var b = 16;
	b &= 63;
	var a = b == 0 ? new haxe__$Int64__$_$_$Int64(v.high,v.low) : b < 32 ? new haxe__$Int64__$_$_$Int64(v.high >> b,v.high << 32 - b | v.low >>> b) : new haxe__$Int64__$_$_$Int64(v.high >> 31,v.high >> b - 32);
	var b_high = 0;
	var b_low = 255;
	var this_high = a.high & b_high;
	var this_low = a.low & b_low;
	sr.b = this_low;
	var b_high = 0;
	var b_low = 65535;
	var this_high = v.high & b_high;
	var this_low = v.low & b_low;
	sr.n = this_low;
	return sr;
};
openfl_display3D__$internal__$AGALConverter_SamplerRegister.prototype = {
	b: null
	,d: null
	,f: null
	,m: null
	,n: null
	,programType: null
	,s: null
	,t: null
	,type: null
	,w: null
	,toGLSL: function() {
		var str = openfl_display3D__$internal_AGALConverter.prefixFromType(this.type,this.programType) + this.n;
		return str;
	}
	,toSamplerState: function() {
		var wrap;
		var filter;
		var mipfilter;
		switch(this.f) {
		case 0:
			filter = 5;
			break;
		case 1:
			filter = 4;
			break;
		default:
			throw new openfl_errors_IllegalOperationError();
		}
		switch(this.m) {
		case 0:
			mipfilter = 2;
			break;
		case 1:
			mipfilter = 1;
			break;
		case 2:
			mipfilter = 0;
			break;
		default:
			throw new openfl_errors_IllegalOperationError();
		}
		switch(this.w) {
		case 0:
			wrap = 0;
			break;
		case 1:
			wrap = 2;
			break;
		default:
			throw new openfl_errors_IllegalOperationError();
		}
		var ignoreSampler = (this.s & 4) == 4;
		var centroid = (this.s & 1) == 1;
		var textureAlpha = this.t == 2;
		var lodBias = (this.b << 24 >> 24) / 8.0;
		return new openfl_display__$internal_SamplerState(wrap,filter,mipfilter,lodBias,ignoreSampler,centroid,textureAlpha);
	}
	,__class__: openfl_display3D__$internal__$AGALConverter_SamplerRegister
};
var openfl_display3D__$internal__$AGALConverter_SourceRegister = function() {
};
$hxClasses["openfl.display3D._internal._AGALConverter.SourceRegister"] = openfl_display3D__$internal__$AGALConverter_SourceRegister;
openfl_display3D__$internal__$AGALConverter_SourceRegister.__name__ = "openfl.display3D._internal._AGALConverter.SourceRegister";
openfl_display3D__$internal__$AGALConverter_SourceRegister.parse = function(v,programType,sourceMask) {
	var sr = new openfl_display3D__$internal__$AGALConverter_SourceRegister();
	sr.programType = programType;
	var b = 63;
	b &= 63;
	var a = b == 0 ? new haxe__$Int64__$_$_$Int64(v.high,v.low) : b < 32 ? new haxe__$Int64__$_$_$Int64(v.high >> b,v.high << 32 - b | v.low >>> b) : new haxe__$Int64__$_$_$Int64(v.high >> 31,v.high >> b - 32);
	var b_high = 0;
	var b_low = 1;
	var this_high = a.high & b_high;
	var this_low = a.low & b_low;
	sr.d = this_low;
	var b = 48;
	b &= 63;
	var a = b == 0 ? new haxe__$Int64__$_$_$Int64(v.high,v.low) : b < 32 ? new haxe__$Int64__$_$_$Int64(v.high >> b,v.high << 32 - b | v.low >>> b) : new haxe__$Int64__$_$_$Int64(v.high >> 31,v.high >> b - 32);
	var b_high = 0;
	var b_low = 3;
	var this_high = a.high & b_high;
	var this_low = a.low & b_low;
	sr.q = this_low;
	var b = 40;
	b &= 63;
	var a = b == 0 ? new haxe__$Int64__$_$_$Int64(v.high,v.low) : b < 32 ? new haxe__$Int64__$_$_$Int64(v.high >> b,v.high << 32 - b | v.low >>> b) : new haxe__$Int64__$_$_$Int64(v.high >> 31,v.high >> b - 32);
	var b_high = 0;
	var b_low = 15;
	var this_high = a.high & b_high;
	var this_low = a.low & b_low;
	sr.itype = this_low;
	var b = 32;
	b &= 63;
	var a = b == 0 ? new haxe__$Int64__$_$_$Int64(v.high,v.low) : b < 32 ? new haxe__$Int64__$_$_$Int64(v.high >> b,v.high << 32 - b | v.low >>> b) : new haxe__$Int64__$_$_$Int64(v.high >> 31,v.high >> b - 32);
	var b_high = 0;
	var b_low = 15;
	var this_high = a.high & b_high;
	var this_low = a.low & b_low;
	sr.type = this_low;
	var b = 24;
	b &= 63;
	var a = b == 0 ? new haxe__$Int64__$_$_$Int64(v.high,v.low) : b < 32 ? new haxe__$Int64__$_$_$Int64(v.high >> b,v.high << 32 - b | v.low >>> b) : new haxe__$Int64__$_$_$Int64(v.high >> 31,v.high >> b - 32);
	var b_high = 0;
	var b_low = 255;
	var this_high = a.high & b_high;
	var this_low = a.low & b_low;
	sr.s = this_low;
	var b = 16;
	b &= 63;
	var a = b == 0 ? new haxe__$Int64__$_$_$Int64(v.high,v.low) : b < 32 ? new haxe__$Int64__$_$_$Int64(v.high >> b,v.high << 32 - b | v.low >>> b) : new haxe__$Int64__$_$_$Int64(v.high >> 31,v.high >> b - 32);
	var b_high = 0;
	var b_low = 255;
	var this_high = a.high & b_high;
	var this_low = a.low & b_low;
	sr.o = this_low;
	var b_high = 0;
	var b_low = 65535;
	var this_high = v.high & b_high;
	var this_low = v.low & b_low;
	sr.n = this_low;
	sr.sourceMask = sourceMask;
	return sr;
};
openfl_display3D__$internal__$AGALConverter_SourceRegister.prototype = {
	d: null
	,itype: null
	,n: null
	,o: null
	,programType: null
	,q: null
	,s: null
	,sourceMask: null
	,type: null
	,toGLSL: function(emitSwizzle,offset) {
		if(offset == null) {
			offset = 0;
		}
		if(emitSwizzle == null) {
			emitSwizzle = true;
		}
		if(this.type == 3) {
			if(this.programType == openfl_display3D__$internal__$AGALConverter_ProgramType.VERTEX) {
				return "gl_Position";
			} else {
				return "gl_FragColor";
			}
		}
		var fullxyzw = this.s == 228 && this.sourceMask == 15;
		var swizzle = "";
		if(this.type != 5 && !fullxyzw) {
			if((this.sourceMask & 1) != 0) {
				switch(this.s & 3) {
				case 0:
					swizzle += "x";
					break;
				case 1:
					swizzle += "y";
					break;
				case 2:
					swizzle += "z";
					break;
				case 3:
					swizzle += "w";
					break;
				}
			}
			if((this.sourceMask & 2) != 0) {
				switch(this.s >> 2 & 3) {
				case 0:
					swizzle += "x";
					break;
				case 1:
					swizzle += "y";
					break;
				case 2:
					swizzle += "z";
					break;
				case 3:
					swizzle += "w";
					break;
				}
			}
			if((this.sourceMask & 4) != 0) {
				switch(this.s >> 4 & 3) {
				case 0:
					swizzle += "x";
					break;
				case 1:
					swizzle += "y";
					break;
				case 2:
					swizzle += "z";
					break;
				case 3:
					swizzle += "w";
					break;
				}
			}
			if((this.sourceMask & 8) != 0) {
				switch(this.s >> 6 & 3) {
				case 0:
					swizzle += "x";
					break;
				case 1:
					swizzle += "y";
					break;
				case 2:
					swizzle += "z";
					break;
				case 3:
					swizzle += "w";
					break;
				}
			}
		}
		var str = openfl_display3D__$internal_AGALConverter.prefixFromType(this.type,this.programType);
		if(this.d == 0) {
			str += this.n + offset;
		} else {
			str += this.o;
			var indexComponent = "";
			switch(this.q) {
			case 0:
				indexComponent = "x";
				break;
			case 1:
				indexComponent = "y";
				break;
			case 2:
				indexComponent = "z";
				break;
			case 3:
				indexComponent = "w";
				break;
			}
			var indexRegister = openfl_display3D__$internal_AGALConverter.prefixFromType(this.itype,this.programType) + this.n + "." + indexComponent;
			str += "[ int(" + indexRegister + ") +" + offset + "]";
		}
		if(emitSwizzle && swizzle != "") {
			str += "." + swizzle;
		}
		return str;
	}
	,__class__: openfl_display3D__$internal__$AGALConverter_SourceRegister
};
var openfl_display3D__$internal_ATFReader = function(data,byteArrayOffset) {
	this.version = 0;
	data.position = byteArrayOffset;
	var signature = data.readUTFBytes(3);
	data.position = byteArrayOffset;
	if(signature != "ATF") {
		throw new openfl_errors_IllegalOperationError("ATF signature not found");
	}
	var length = 0;
	if(data.b[byteArrayOffset + 6] == 255) {
		this.version = data.b[byteArrayOffset + 7];
		data.position = byteArrayOffset + 8;
		length = this.__readUInt32(data);
	} else {
		this.version = 0;
		data.position = byteArrayOffset + 3;
		length = this.__readUInt24(data);
	}
	if(UInt.gt(js_Boot.__cast(byteArrayOffset + length , Int),openfl_utils_ByteArray.get_length(data))) {
		throw new openfl_errors_IllegalOperationError("ATF length exceeds byte array length");
	}
	this.data = data;
};
$hxClasses["openfl.display3D._internal.ATFReader"] = openfl_display3D__$internal_ATFReader;
openfl_display3D__$internal_ATFReader.__name__ = "openfl.display3D._internal.ATFReader";
openfl_display3D__$internal_ATFReader.prototype = {
	atfFormat: null
	,cubeMap: null
	,data: null
	,height: null
	,mipCount: null
	,version: null
	,width: null
	,readHeader: function(__width,__height,cubeMap) {
		var tdata = this.data.readUnsignedByte();
		var type = tdata >>> 7;
		if(!cubeMap && type != 0) {
			throw new openfl_errors_IllegalOperationError("ATF Cube map not expected");
		}
		if(cubeMap && type != 1) {
			throw new openfl_errors_IllegalOperationError("ATF Cube map expected");
		}
		this.cubeMap = cubeMap;
		this.atfFormat = tdata & 127;
		if(this.atfFormat != 3 && this.atfFormat != 5) {
			lime_utils_Log.warn("Only ATF block compressed textures without JPEG-XR+LZMA are supported",{ fileName : "openfl/display3D/_internal/ATFReader.hx", lineNumber : 97, className : "openfl.display3D._internal.ATFReader", methodName : "readHeader"});
		}
		this.width = 1 << this.data.readUnsignedByte();
		this.height = 1 << this.data.readUnsignedByte();
		if(this.width != __width || this.height != __height) {
			throw new openfl_errors_IllegalOperationError("ATF width and height dont match");
		}
		this.mipCount = this.data.readUnsignedByte();
		return this.atfFormat == 5;
	}
	,readTextures: function(uploadCallback) {
		var gpuFormats = this.version < 3 ? 3 : 4;
		var sideCount = this.cubeMap ? 6 : 1;
		var _g = 0;
		var _g1 = sideCount;
		while(_g < _g1) {
			var side = _g++;
			var _g2 = 0;
			var _g3 = this.mipCount;
			while(_g2 < _g3) {
				var level = _g2++;
				var _g4 = 0;
				var _g5 = gpuFormats;
				while(_g4 < _g5) {
					var gpuFormat = _g4++;
					var blockLength = this.version == 0 ? this.__readUInt24(this.data) : this.__readUInt32(this.data);
					if(UInt.gt(this.data.position + blockLength,openfl_utils_ByteArray.get_length(this.data))) {
						throw new openfl_errors_IllegalOperationError("Block length exceeds ATF file length");
					}
					if(UInt.gt(blockLength,0)) {
						var bytes = new haxe_io_Bytes(new ArrayBuffer(blockLength));
						var this1 = this.data;
						var bytes1 = openfl_utils_ByteArray.fromBytes(bytes);
						var offset = 0;
						var length = blockLength;
						if(length == null) {
							length = 0;
						}
						if(offset == null) {
							offset = 0;
						}
						this1.readBytes(bytes1,offset,length);
						uploadCallback(side,level,gpuFormat,this.width >> level,this.height >> level,blockLength,bytes);
					}
				}
			}
		}
	}
	,__readUInt24: function(data) {
		var value = data.readUnsignedByte() << 16;
		value = value | data.readUnsignedByte() << 8;
		value = value | data.readUnsignedByte();
		return value;
	}
	,__readUInt32: function(data) {
		var value = data.readUnsignedByte() << 24;
		value = value | data.readUnsignedByte() << 16;
		value = value | data.readUnsignedByte() << 8;
		value = value | data.readUnsignedByte();
		return value;
	}
	,__class__: openfl_display3D__$internal_ATFReader
};
var openfl_display3D__$internal_Context3DState = function() {
	this.backBufferEnableDepthAndStencil = false;
	this.blendDestinationAlphaFactor = 9;
	this.blendSourceAlphaFactor = 2;
	this.blendDestinationRGBFactor = 9;
	this.blendSourceRGBFactor = 2;
	this.colorMaskRed = true;
	this.colorMaskGreen = true;
	this.colorMaskBlue = true;
	this.colorMaskAlpha = true;
	this.culling = 3;
	this.depthCompareMode = 4;
	this.depthMask = true;
	this.samplerStates = [];
	this.scissorRectangle = new openfl_geom_Rectangle();
	this.stencilCompareMode = 0;
	this.stencilDepthFail = 5;
	this.stencilFail = 5;
	this.stencilPass = 5;
	this.stencilReadMask = 255;
	this.stencilReferenceValue = 0;
	this.stencilTriangleFace = 2;
	this.stencilWriteMask = 255;
	this.textures = [];
	this.__frontFaceGLCCW = true;
	this.__glBlendEquation = 32774;
};
$hxClasses["openfl.display3D._internal.Context3DState"] = openfl_display3D__$internal_Context3DState;
openfl_display3D__$internal_Context3DState.__name__ = "openfl.display3D._internal.Context3DState";
openfl_display3D__$internal_Context3DState.prototype = {
	backBufferEnableDepthAndStencil: null
	,blendDestinationAlphaFactor: null
	,blendSourceAlphaFactor: null
	,blendDestinationRGBFactor: null
	,blendSourceRGBFactor: null
	,colorMaskRed: null
	,colorMaskGreen: null
	,colorMaskBlue: null
	,colorMaskAlpha: null
	,culling: null
	,depthCompareMode: null
	,depthMask: null
	,program: null
	,renderToTexture: null
	,renderToTextureAntiAlias: null
	,renderToTextureDepthStencil: null
	,renderToTextureSurfaceSelector: null
	,samplerStates: null
	,scissorEnabled: null
	,scissorRectangle: null
	,stencilCompareMode: null
	,stencilDepthFail: null
	,stencilFail: null
	,stencilPass: null
	,stencilReadMask: null
	,stencilReferenceValue: null
	,stencilTriangleFace: null
	,stencilWriteMask: null
	,textures: null
	,shader: null
	,__currentGLArrayBuffer: null
	,__currentGLElementArrayBuffer: null
	,__currentGLFramebuffer: null
	,__currentGLTexture2D: null
	,__currentGLTextureCubeMap: null
	,__enableGLBlend: null
	,__enableGLCullFace: null
	,__enableGLDepthTest: null
	,__enableGLScissorTest: null
	,__enableGLStencilTest: null
	,__frontFaceGLCCW: null
	,__glBlendEquation: null
	,__primaryGLFramebuffer: null
	,__rttDepthGLRenderbuffer: null
	,__rttGLFramebuffer: null
	,__rttGLRenderbuffer: null
	,__rttStencilGLRenderbuffer: null
	,__class__: openfl_display3D__$internal_Context3DState
};
var openfl_display3D_textures_TextureBase = function(context) {
	openfl_events_EventDispatcher.call(this);
	this.__context = context;
	var gl = this.__context.gl;
	this.__textureID = gl.createTexture();
	this.__textureContext = this.__context.__context;
	if(openfl_display3D_textures_TextureBase.__supportsBGRA == null) {
		openfl_display3D_textures_TextureBase.__textureInternalFormat = gl.RGBA;
		var bgraExtension = null;
		if(bgraExtension != null) {
			openfl_display3D_textures_TextureBase.__supportsBGRA = true;
			openfl_display3D_textures_TextureBase.__textureFormat = bgraExtension.BGRA_EXT;
			if(context.__context.type == "opengles") {
				openfl_display3D_textures_TextureBase.__textureInternalFormat = bgraExtension.BGRA_EXT;
			}
		} else {
			openfl_display3D_textures_TextureBase.__supportsBGRA = false;
			openfl_display3D_textures_TextureBase.__textureFormat = gl.RGBA;
		}
		openfl_display3D_textures_TextureBase.__compressedFormats = new haxe_ds_IntMap();
		openfl_display3D_textures_TextureBase.__compressedFormatsAlpha = new haxe_ds_IntMap();
		var dxtExtension = gl.getExtension("WEBGL_compressed_texture_s3tc");
		var etc1Extension = gl.getExtension("WEBGL_compressed_texture_etc1");
		var pvrtcExtension = gl.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");
		if(dxtExtension != null) {
			var v = dxtExtension.COMPRESSED_RGBA_S3TC_DXT1_EXT;
			openfl_display3D_textures_TextureBase.__compressedFormats.h[0] = v;
			var v = dxtExtension.COMPRESSED_RGBA_S3TC_DXT5_EXT;
			openfl_display3D_textures_TextureBase.__compressedFormatsAlpha.h[0] = v;
		}
		if(etc1Extension != null) {
			var v = etc1Extension.COMPRESSED_RGB_ETC1_WEBGL;
			openfl_display3D_textures_TextureBase.__compressedFormats.h[2] = v;
			var v = etc1Extension.COMPRESSED_RGB_ETC1_WEBGL;
			openfl_display3D_textures_TextureBase.__compressedFormatsAlpha.h[2] = v;
		}
		if(pvrtcExtension != null) {
			var v = pvrtcExtension.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;
			openfl_display3D_textures_TextureBase.__compressedFormats.h[1] = v;
			var v = pvrtcExtension.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;
			openfl_display3D_textures_TextureBase.__compressedFormatsAlpha.h[1] = v;
		}
	}
	this.__internalFormat = openfl_display3D_textures_TextureBase.__textureInternalFormat;
	this.__format = openfl_display3D_textures_TextureBase.__textureFormat;
};
$hxClasses["openfl.display3D.textures.TextureBase"] = openfl_display3D_textures_TextureBase;
openfl_display3D_textures_TextureBase.__name__ = "openfl.display3D.textures.TextureBase";
openfl_display3D_textures_TextureBase.__super__ = openfl_events_EventDispatcher;
openfl_display3D_textures_TextureBase.prototype = $extend(openfl_events_EventDispatcher.prototype,{
	__alphaTexture: null
	,__context: null
	,__format: null
	,__glDepthRenderbuffer: null
	,__glFramebuffer: null
	,__glStencilRenderbuffer: null
	,__height: null
	,__internalFormat: null
	,__optimizeForRenderToTexture: null
	,__samplerState: null
	,__streamingLevels: null
	,__textureContext: null
	,__textureID: null
	,__textureTarget: null
	,__width: null
	,dispose: function() {
		var gl = this.__context.gl;
		if(this.__alphaTexture != null) {
			this.__alphaTexture.dispose();
			this.__alphaTexture = null;
		}
		if(this.__textureID != null) {
			gl.deleteTexture(this.__textureID);
			this.__textureID = null;
		}
		if(this.__glFramebuffer != null) {
			gl.deleteFramebuffer(this.__glFramebuffer);
			this.__glFramebuffer = null;
		}
		if(this.__glDepthRenderbuffer != null) {
			gl.deleteRenderbuffer(this.__glDepthRenderbuffer);
			this.__glDepthRenderbuffer = null;
		}
		if(this.__glStencilRenderbuffer != null) {
			gl.deleteRenderbuffer(this.__glStencilRenderbuffer);
			this.__glStencilRenderbuffer = null;
		}
	}
	,__getGLFramebuffer: function(enableDepthAndStencil,antiAlias,surfaceSelector) {
		var gl = this.__context.gl;
		if(this.__glFramebuffer == null) {
			this.__glFramebuffer = gl.createFramebuffer();
			this.__context.__bindGLFramebuffer(this.__glFramebuffer);
			gl.framebufferTexture2D(gl.FRAMEBUFFER,gl.COLOR_ATTACHMENT0,gl.TEXTURE_2D,this.__textureID,0);
			if(this.__context.__enableErrorChecking) {
				var code = gl.checkFramebufferStatus(gl.FRAMEBUFFER);
				if(code != gl.FRAMEBUFFER_COMPLETE) {
					lime_utils_Log.warn("Error: Context3D.setRenderToTexture status:" + code + " width:" + this.__width + " height:" + this.__height,{ fileName : "openfl/display3D/textures/TextureBase.hx", lineNumber : 201, className : "openfl.display3D.textures.TextureBase", methodName : "__getGLFramebuffer"});
				}
			}
		}
		if(enableDepthAndStencil && this.__glDepthRenderbuffer == null) {
			this.__context.__bindGLFramebuffer(this.__glFramebuffer);
			if(openfl_display3D_Context3D.__glDepthStencil != 0) {
				this.__glDepthRenderbuffer = gl.createRenderbuffer();
				this.__glStencilRenderbuffer = this.__glDepthRenderbuffer;
				gl.bindRenderbuffer(gl.RENDERBUFFER,this.__glDepthRenderbuffer);
				gl.renderbufferStorage(gl.RENDERBUFFER,openfl_display3D_Context3D.__glDepthStencil,this.__width,this.__height);
				gl.framebufferRenderbuffer(gl.FRAMEBUFFER,gl.DEPTH_STENCIL_ATTACHMENT,gl.RENDERBUFFER,this.__glDepthRenderbuffer);
			} else {
				this.__glDepthRenderbuffer = gl.createRenderbuffer();
				this.__glStencilRenderbuffer = gl.createRenderbuffer();
				gl.bindRenderbuffer(gl.RENDERBUFFER,this.__glDepthRenderbuffer);
				gl.renderbufferStorage(gl.RENDERBUFFER,gl.DEPTH_COMPONENT16,this.__width,this.__height);
				gl.bindRenderbuffer(gl.RENDERBUFFER,this.__glStencilRenderbuffer);
				gl.renderbufferStorage(gl.RENDERBUFFER,gl.STENCIL_INDEX8,this.__width,this.__height);
				gl.framebufferRenderbuffer(gl.FRAMEBUFFER,gl.DEPTH_ATTACHMENT,gl.RENDERBUFFER,this.__glDepthRenderbuffer);
				gl.framebufferRenderbuffer(gl.FRAMEBUFFER,gl.STENCIL_ATTACHMENT,gl.RENDERBUFFER,this.__glStencilRenderbuffer);
			}
			if(this.__context.__enableErrorChecking) {
				var code = gl.checkFramebufferStatus(gl.FRAMEBUFFER);
				if(code != gl.FRAMEBUFFER_COMPLETE) {
					lime_utils_Log.warn("Error: Context3D.setRenderToTexture status:" + code + " width:" + this.__width + " height:" + this.__height,{ fileName : "openfl/display3D/textures/TextureBase.hx", lineNumber : 239, className : "openfl.display3D.textures.TextureBase", methodName : "__getGLFramebuffer"});
				}
			}
			gl.bindRenderbuffer(gl.RENDERBUFFER,null);
		}
		return this.__glFramebuffer;
	}
	,__getImage: function(bitmapData) {
		var image = bitmapData.image;
		if(!bitmapData.__isValid || image == null) {
			return null;
		}
		lime__$internal_graphics_ImageCanvasUtil.sync(image,false);
		var gl = this.__context.gl;
		if(image.type != lime_graphics_ImageType.DATA && !image.get_premultiplied()) {
			gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL,1);
		} else if(!image.get_premultiplied() && image.get_transparent()) {
			gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL,0);
			image = image.clone();
			image.set_premultiplied(true);
		}
		if(image.get_format() != 0) {
			image = image.clone();
			image.set_format(0);
			image.buffer.premultiplied = true;
		}
		return image;
	}
	,__getTexture: function() {
		return this.__textureID;
	}
	,__setSamplerState: function(state) {
		if(!state.equals(this.__samplerState)) {
			var gl = this.__context.gl;
			if(this.__textureTarget == this.__context.gl.TEXTURE_CUBE_MAP) {
				this.__context.__bindGLTextureCubeMap(this.__textureID);
			} else {
				this.__context.__bindGLTexture2D(this.__textureID);
			}
			var wrapModeS = 0;
			var wrapModeT = 0;
			switch(state.wrap) {
			case 0:
				wrapModeS = gl.CLAMP_TO_EDGE;
				wrapModeT = gl.CLAMP_TO_EDGE;
				break;
			case 1:
				wrapModeS = gl.CLAMP_TO_EDGE;
				wrapModeT = gl.REPEAT;
				break;
			case 2:
				wrapModeS = gl.REPEAT;
				wrapModeT = gl.REPEAT;
				break;
			case 3:
				wrapModeS = gl.REPEAT;
				wrapModeT = gl.CLAMP_TO_EDGE;
				break;
			default:
				throw new openfl_errors_Error("wrap bad enum");
			}
			var magFilter = 0;
			var minFilter = 0;
			if(state.filter == 5) {
				magFilter = gl.NEAREST;
			} else {
				magFilter = gl.LINEAR;
			}
			switch(state.mipfilter) {
			case 0:
				minFilter = state.filter == 5 ? gl.NEAREST_MIPMAP_LINEAR : gl.LINEAR_MIPMAP_LINEAR;
				break;
			case 1:
				minFilter = state.filter == 5 ? gl.NEAREST_MIPMAP_NEAREST : gl.LINEAR_MIPMAP_NEAREST;
				break;
			case 2:
				minFilter = state.filter == 5 ? gl.NEAREST : gl.LINEAR;
				break;
			default:
				throw new openfl_errors_Error("mipfiter bad enum");
			}
			gl.texParameteri(this.__textureTarget,gl.TEXTURE_MIN_FILTER,minFilter);
			gl.texParameteri(this.__textureTarget,gl.TEXTURE_MAG_FILTER,magFilter);
			gl.texParameteri(this.__textureTarget,gl.TEXTURE_WRAP_S,wrapModeS);
			gl.texParameteri(this.__textureTarget,gl.TEXTURE_WRAP_T,wrapModeT);
			var tmp = state.lodBias != 0.0;
			if(this.__samplerState == null) {
				this.__samplerState = state.clone();
			}
			this.__samplerState.copyFrom(state);
			return true;
		}
		return false;
	}
	,__uploadFromImage: function(image) {
		var gl = this.__context.gl;
		var internalFormat;
		var format;
		if(this.__textureTarget != gl.TEXTURE_2D) {
			return;
		}
		if(image.buffer.bitsPerPixel == 1) {
			internalFormat = gl.ALPHA;
			format = gl.ALPHA;
		} else {
			internalFormat = openfl_display3D_textures_TextureBase.__textureInternalFormat;
			format = openfl_display3D_textures_TextureBase.__textureFormat;
		}
		this.__context.__bindGLTexture2D(this.__textureID);
		if(image.type != lime_graphics_ImageType.DATA && !image.get_premultiplied()) {
			gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL,1);
		} else if(!image.get_premultiplied() && image.get_transparent()) {
			gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL,1);
		}
		if(image.type == lime_graphics_ImageType.DATA) {
			lime_graphics_WebGLRenderContext.texImage2D(gl,gl.TEXTURE_2D,0,internalFormat,image.buffer.width,image.buffer.height,0,format,gl.UNSIGNED_BYTE,image.get_data());
		} else {
			lime_graphics_WebGLRenderContext.texImage2D(gl,gl.TEXTURE_2D,0,internalFormat,format,gl.UNSIGNED_BYTE,image.get_src());
		}
		this.__context.__bindGLTexture2D(null);
	}
	,__class__: openfl_display3D_textures_TextureBase
});
var openfl_display3D_textures_CubeTexture = function(context,size,format,optimizeForRenderToTexture,streamingLevels) {
	openfl_display3D_textures_TextureBase.call(this,context);
	this.__size = size;
	this.__width = this.__height = this.__size;
	this.__optimizeForRenderToTexture = optimizeForRenderToTexture;
	this.__streamingLevels = streamingLevels;
	this.__textureTarget = this.__context.gl.TEXTURE_CUBE_MAP;
	this.__uploadedSides = 0;
};
$hxClasses["openfl.display3D.textures.CubeTexture"] = openfl_display3D_textures_CubeTexture;
openfl_display3D_textures_CubeTexture.__name__ = "openfl.display3D.textures.CubeTexture";
openfl_display3D_textures_CubeTexture.__super__ = openfl_display3D_textures_TextureBase;
openfl_display3D_textures_CubeTexture.prototype = $extend(openfl_display3D_textures_TextureBase.prototype,{
	__framebufferSurface: null
	,__size: null
	,__uploadedSides: null
	,uploadCompressedTextureFromByteArray: function(data,byteArrayOffset,async) {
		if(async == null) {
			async = false;
		}
		var _gthis = this;
		if(!async) {
			this.__uploadCompressedTextureFromByteArray(data,byteArrayOffset);
		} else {
			haxe_Timer.delay(function() {
				_gthis.__uploadCompressedTextureFromByteArray(data,byteArrayOffset);
				var event = null;
				event = new openfl_events_Event("textureReady");
				_gthis.dispatchEvent(event);
			},1);
		}
	}
	,uploadFromBitmapData: function(source,side,miplevel,generateMipmap) {
		if(generateMipmap == null) {
			generateMipmap = false;
		}
		if(miplevel == null) {
			miplevel = 0;
		}
		if(source == null) {
			return;
		}
		var size = this.__size >> miplevel;
		if(size == 0) {
			return;
		}
		var image = this.__getImage(source);
		if(image == null) {
			return;
		}
		if(miplevel == 0 && image.buffer != null && image.buffer.data == null && image.buffer.get_src() != null) {
			var gl = this.__context.gl;
			var size = this.__size >> miplevel;
			if(size == 0) {
				return;
			}
			var target = this.__sideToTarget(side);
			this.__context.__bindGLTextureCubeMap(this.__textureID);
			lime_graphics_WebGLRenderContext.texImage2D(gl,target,miplevel,this.__internalFormat,this.__format,gl.UNSIGNED_BYTE,image.buffer.get_src());
			this.__context.__bindGLTextureCubeMap(null);
			this.__uploadedSides |= 1 << side;
			return;
		}
		this.uploadFromTypedArray(image.get_data(),side,miplevel);
	}
	,uploadFromByteArray: function(data,byteArrayOffset,side,miplevel) {
		if(miplevel == null) {
			miplevel = 0;
		}
		if(byteArrayOffset == 0) {
			this.uploadFromTypedArray(data.b,side,miplevel);
			return;
		}
		var elements = null;
		var array = null;
		var vector = null;
		var view = null;
		var buffer = openfl_utils_ByteArray.toArrayBuffer(data);
		var byteoffset = byteArrayOffset;
		var len = null;
		if(byteoffset == null) {
			byteoffset = 0;
		}
		var this1;
		if(elements != null) {
			this1 = new Uint8Array(elements);
		} else if(array != null) {
			this1 = new Uint8Array(array);
		} else if(vector != null) {
			this1 = new Uint8Array(vector.__array);
		} else if(view != null) {
			this1 = new Uint8Array(view);
		} else if(buffer != null) {
			if(len == null) {
				this1 = new Uint8Array(buffer,byteoffset);
			} else {
				this1 = new Uint8Array(buffer,byteoffset,len);
			}
		} else {
			this1 = null;
		}
		this.uploadFromTypedArray(this1,side,miplevel);
	}
	,uploadFromTypedArray: function(data,side,miplevel) {
		if(miplevel == null) {
			miplevel = 0;
		}
		if(data == null) {
			return;
		}
		var gl = this.__context.gl;
		var size = this.__size >> miplevel;
		if(size == 0) {
			return;
		}
		var target = this.__sideToTarget(side);
		this.__context.__bindGLTextureCubeMap(this.__textureID);
		lime_graphics_WebGLRenderContext.texImage2D(gl,target,miplevel,this.__internalFormat,size,size,0,this.__format,gl.UNSIGNED_BYTE,data);
		this.__context.__bindGLTextureCubeMap(null);
		this.__uploadedSides |= 1 << side;
	}
	,__getGLFramebuffer: function(enableDepthAndStencil,antiAlias,surfaceSelector) {
		var gl = this.__context.gl;
		if(this.__glFramebuffer == null) {
			this.__glFramebuffer = gl.createFramebuffer();
			this.__framebufferSurface = -1;
		}
		if(this.__framebufferSurface != surfaceSelector) {
			this.__framebufferSurface = surfaceSelector;
			this.__context.__bindGLFramebuffer(this.__glFramebuffer);
			gl.framebufferTexture2D(gl.FRAMEBUFFER,gl.COLOR_ATTACHMENT0,gl.TEXTURE_CUBE_MAP_POSITIVE_X + surfaceSelector,this.__textureID,0);
			if(this.__context.__enableErrorChecking) {
				var code = gl.checkFramebufferStatus(gl.FRAMEBUFFER);
				if(code != gl.FRAMEBUFFER_COMPLETE) {
					lime_utils_Log.error("Error: Context3D.setRenderToTexture status:" + code + " width:" + this.__width + " height:" + this.__height,{ fileName : "openfl/display3D/textures/CubeTexture.hx", lineNumber : 279, className : "openfl.display3D.textures.CubeTexture", methodName : "__getGLFramebuffer"});
				}
			}
		}
		return openfl_display3D_textures_TextureBase.prototype.__getGLFramebuffer.call(this,enableDepthAndStencil,antiAlias,surfaceSelector);
	}
	,__setSamplerState: function(state) {
		if(openfl_display3D_textures_TextureBase.prototype.__setSamplerState.call(this,state)) {
			var gl = this.__context.gl;
			if(state.mipfilter != 2 && !this.__samplerState.mipmapGenerated) {
				gl.generateMipmap(gl.TEXTURE_CUBE_MAP);
				this.__samplerState.mipmapGenerated = true;
			}
			if(openfl_display3D_Context3D.__glMaxTextureMaxAnisotropy != 0) {
				var aniso;
				switch(state.filter) {
				case 0:
					aniso = 16;
					break;
				case 1:
					aniso = 2;
					break;
				case 2:
					aniso = 4;
					break;
				case 3:
					aniso = 8;
					break;
				default:
					aniso = 1;
				}
				if(aniso > openfl_display3D_Context3D.__glMaxTextureMaxAnisotropy) {
					aniso = openfl_display3D_Context3D.__glMaxTextureMaxAnisotropy;
				}
				gl.texParameterf(gl.TEXTURE_CUBE_MAP,openfl_display3D_Context3D.__glTextureMaxAnisotropy,aniso);
			}
			return true;
		}
		return false;
	}
	,__sideToTarget: function(side) {
		var gl = this.__context.gl;
		switch(side) {
		case 0:
			return gl.TEXTURE_CUBE_MAP_POSITIVE_X;
		case 1:
			return gl.TEXTURE_CUBE_MAP_NEGATIVE_X;
		case 2:
			return gl.TEXTURE_CUBE_MAP_POSITIVE_Y;
		case 3:
			return gl.TEXTURE_CUBE_MAP_NEGATIVE_Y;
		case 4:
			return gl.TEXTURE_CUBE_MAP_POSITIVE_Z;
		case 5:
			return gl.TEXTURE_CUBE_MAP_NEGATIVE_Z;
		default:
			throw new openfl_errors_IllegalOperationError();
		}
	}
	,__uploadCompressedTextureFromByteArray: function(data,byteArrayOffset) {
		var _gthis = this;
		var reader = new openfl_display3D__$internal_ATFReader(data,byteArrayOffset);
		var alpha = reader.readHeader(this.__size,this.__size,true);
		var gl = this.__context.gl;
		this.__context.__bindGLTextureCubeMap(this.__textureID);
		var hasTexture = false;
		reader.readTextures(function(side,level,gpuFormat,width,height,blockLength,bytes) {
			var format = alpha ? openfl_display3D_textures_TextureBase.__compressedFormatsAlpha.h[gpuFormat] : openfl_display3D_textures_TextureBase.__compressedFormats.h[gpuFormat];
			if(format == 0) {
				return;
			}
			hasTexture = true;
			var target = _gthis.__sideToTarget(side);
			_gthis.__format = format;
			_gthis.__internalFormat = format;
			if(alpha && gpuFormat == 2) {
				var size = blockLength / 2 | 0;
				var elements = null;
				var array = null;
				var vector = null;
				var view = null;
				var buffer = bytes.b.buffer;
				var byteoffset = 0;
				if(byteoffset == null) {
					byteoffset = 0;
				}
				var this1;
				if(elements != null) {
					this1 = new Uint8Array(elements);
				} else if(array != null) {
					this1 = new Uint8Array(array);
				} else if(vector != null) {
					this1 = new Uint8Array(vector.__array);
				} else if(view != null) {
					this1 = new Uint8Array(view);
				} else if(buffer != null) {
					if(size == null) {
						this1 = new Uint8Array(buffer,byteoffset);
					} else {
						this1 = new Uint8Array(buffer,byteoffset,size);
					}
				} else {
					this1 = null;
				}
				lime_graphics_WebGLRenderContext.compressedTexImage2D(gl,target,level,_gthis.__internalFormat,width,height,0,this1);
				var alphaTexture = new openfl_display3D_textures_CubeTexture(_gthis.__context,_gthis.__size,3,_gthis.__optimizeForRenderToTexture,_gthis.__streamingLevels);
				alphaTexture.__format = format;
				alphaTexture.__internalFormat = format;
				_gthis.__context.__bindGLTextureCubeMap(alphaTexture.__textureID);
				var elements = null;
				var array = null;
				var vector = null;
				var view = null;
				var buffer = bytes.b.buffer;
				var byteoffset = size;
				if(byteoffset == null) {
					byteoffset = 0;
				}
				var this1;
				if(elements != null) {
					this1 = new Uint8Array(elements);
				} else if(array != null) {
					this1 = new Uint8Array(array);
				} else if(vector != null) {
					this1 = new Uint8Array(vector.__array);
				} else if(view != null) {
					this1 = new Uint8Array(view);
				} else if(buffer != null) {
					if(size == null) {
						this1 = new Uint8Array(buffer,byteoffset);
					} else {
						this1 = new Uint8Array(buffer,byteoffset,size);
					}
				} else {
					this1 = null;
				}
				lime_graphics_WebGLRenderContext.compressedTexImage2D(gl,target,level,alphaTexture.__internalFormat,width,height,0,this1);
				_gthis.__alphaTexture = alphaTexture;
			} else {
				var elements = null;
				var array = null;
				var vector = null;
				var view = null;
				var buffer = bytes.b.buffer;
				var byteoffset = 0;
				if(byteoffset == null) {
					byteoffset = 0;
				}
				var this1;
				if(elements != null) {
					this1 = new Uint8Array(elements);
				} else if(array != null) {
					this1 = new Uint8Array(array);
				} else if(vector != null) {
					this1 = new Uint8Array(vector.__array);
				} else if(view != null) {
					this1 = new Uint8Array(view);
				} else if(buffer != null) {
					if(blockLength == null) {
						this1 = new Uint8Array(buffer,byteoffset);
					} else {
						this1 = new Uint8Array(buffer,byteoffset,blockLength);
					}
				} else {
					this1 = null;
				}
				lime_graphics_WebGLRenderContext.compressedTexImage2D(gl,target,level,_gthis.__internalFormat,width,height,0,this1);
			}
		});
		if(!hasTexture) {
			var elements = this.__size * this.__size * 4;
			var array = null;
			var vector = null;
			var view = null;
			var buffer = null;
			var len = null;
			var this1;
			if(elements != null) {
				this1 = new Uint8Array(elements);
			} else if(array != null) {
				this1 = new Uint8Array(array);
			} else if(vector != null) {
				this1 = new Uint8Array(vector.__array);
			} else if(view != null) {
				this1 = new Uint8Array(view);
			} else if(buffer != null) {
				if(len == null) {
					this1 = new Uint8Array(buffer,0);
				} else {
					this1 = new Uint8Array(buffer,0,len);
				}
			} else {
				this1 = null;
			}
			var data = this1;
			lime_graphics_WebGLRenderContext.texImage2D(gl,this.__sideToTarget(0),0,this.__internalFormat,this.__size,this.__size,0,this.__format,gl.UNSIGNED_BYTE,data);
			var elements = this.__size * this.__size * 4;
			var array = null;
			var vector = null;
			var view = null;
			var buffer = null;
			var len = null;
			var this1;
			if(elements != null) {
				this1 = new Uint8Array(elements);
			} else if(array != null) {
				this1 = new Uint8Array(array);
			} else if(vector != null) {
				this1 = new Uint8Array(vector.__array);
			} else if(view != null) {
				this1 = new Uint8Array(view);
			} else if(buffer != null) {
				if(len == null) {
					this1 = new Uint8Array(buffer,0);
				} else {
					this1 = new Uint8Array(buffer,0,len);
				}
			} else {
				this1 = null;
			}
			var data = this1;
			lime_graphics_WebGLRenderContext.texImage2D(gl,this.__sideToTarget(1),0,this.__internalFormat,this.__size,this.__size,0,this.__format,gl.UNSIGNED_BYTE,data);
			var elements = this.__size * this.__size * 4;
			var array = null;
			var vector = null;
			var view = null;
			var buffer = null;
			var len = null;
			var this1;
			if(elements != null) {
				this1 = new Uint8Array(elements);
			} else if(array != null) {
				this1 = new Uint8Array(array);
			} else if(vector != null) {
				this1 = new Uint8Array(vector.__array);
			} else if(view != null) {
				this1 = new Uint8Array(view);
			} else if(buffer != null) {
				if(len == null) {
					this1 = new Uint8Array(buffer,0);
				} else {
					this1 = new Uint8Array(buffer,0,len);
				}
			} else {
				this1 = null;
			}
			var data = this1;
			lime_graphics_WebGLRenderContext.texImage2D(gl,this.__sideToTarget(2),0,this.__internalFormat,this.__size,this.__size,0,this.__format,gl.UNSIGNED_BYTE,data);
			var elements = this.__size * this.__size * 4;
			var array = null;
			var vector = null;
			var view = null;
			var buffer = null;
			var len = null;
			var this1;
			if(elements != null) {
				this1 = new Uint8Array(elements);
			} else if(array != null) {
				this1 = new Uint8Array(array);
			} else if(vector != null) {
				this1 = new Uint8Array(vector.__array);
			} else if(view != null) {
				this1 = new Uint8Array(view);
			} else if(buffer != null) {
				if(len == null) {
					this1 = new Uint8Array(buffer,0);
				} else {
					this1 = new Uint8Array(buffer,0,len);
				}
			} else {
				this1 = null;
			}
			var data = this1;
			lime_graphics_WebGLRenderContext.texImage2D(gl,this.__sideToTarget(3),0,this.__internalFormat,this.__size,this.__size,0,this.__format,gl.UNSIGNED_BYTE,data);
			var elements = this.__size * this.__size * 4;
			var array = null;
			var vector = null;
			var view = null;
			var buffer = null;
			var len = null;
			var this1;
			if(elements != null) {
				this1 = new Uint8Array(elements);
			} else if(array != null) {
				this1 = new Uint8Array(array);
			} else if(vector != null) {
				this1 = new Uint8Array(vector.__array);
			} else if(view != null) {
				this1 = new Uint8Array(view);
			} else if(buffer != null) {
				if(len == null) {
					this1 = new Uint8Array(buffer,0);
				} else {
					this1 = new Uint8Array(buffer,0,len);
				}
			} else {
				this1 = null;
			}
			var data = this1;
			lime_graphics_WebGLRenderContext.texImage2D(gl,this.__sideToTarget(4),0,this.__internalFormat,this.__size,this.__size,0,this.__format,gl.UNSIGNED_BYTE,data);
			var elements = this.__size * this.__size * 4;
			var array = null;
			var vector = null;
			var view = null;
			var buffer = null;
			var len = null;
			var this1;
			if(elements != null) {
				this1 = new Uint8Array(elements);
			} else if(array != null) {
				this1 = new Uint8Array(array);
			} else if(vector != null) {
				this1 = new Uint8Array(vector.__array);
			} else if(view != null) {
				this1 = new Uint8Array(view);
			} else if(buffer != null) {
				if(len == null) {
					this1 = new Uint8Array(buffer,0);
				} else {
					this1 = new Uint8Array(buffer,0,len);
				}
			} else {
				this1 = null;
			}
			var data = this1;
			lime_graphics_WebGLRenderContext.texImage2D(gl,this.__sideToTarget(5),0,this.__internalFormat,this.__size,this.__size,0,this.__format,gl.UNSIGNED_BYTE,data);
		}
		this.__context.__bindGLTextureCubeMap(null);
	}
	,__class__: openfl_display3D_textures_CubeTexture
});
var openfl_display3D_textures_RectangleTexture = function(context,width,height,format,optimizeForRenderToTexture) {
	openfl_display3D_textures_TextureBase.call(this,context);
	this.__width = width;
	this.__height = height;
	this.__optimizeForRenderToTexture = optimizeForRenderToTexture;
	this.__textureTarget = this.__context.gl.TEXTURE_2D;
	this.uploadFromTypedArray(null);
	if(optimizeForRenderToTexture) {
		this.__getGLFramebuffer(true,0,0);
	}
};
$hxClasses["openfl.display3D.textures.RectangleTexture"] = openfl_display3D_textures_RectangleTexture;
openfl_display3D_textures_RectangleTexture.__name__ = "openfl.display3D.textures.RectangleTexture";
openfl_display3D_textures_RectangleTexture.__super__ = openfl_display3D_textures_TextureBase;
openfl_display3D_textures_RectangleTexture.prototype = $extend(openfl_display3D_textures_TextureBase.prototype,{
	uploadFromBitmapData: function(source) {
		if(source == null) {
			return;
		}
		var image = this.__getImage(source);
		if(image == null) {
			return;
		}
		if(image.buffer != null && image.buffer.data == null && image.buffer.get_src() != null) {
			var gl = this.__context.gl;
			this.__context.__bindGLTexture2D(this.__textureID);
			lime_graphics_WebGLRenderContext.texImage2D(gl,this.__textureTarget,0,this.__internalFormat,this.__format,gl.UNSIGNED_BYTE,image.buffer.get_src());
			this.__context.__bindGLTexture2D(null);
			return;
		}
		this.uploadFromTypedArray(image.get_data());
	}
	,uploadFromByteArray: function(data,byteArrayOffset) {
		if(byteArrayOffset == 0) {
			this.uploadFromTypedArray(data.b);
			return;
		}
		var elements = null;
		var array = null;
		var vector = null;
		var view = null;
		var buffer = openfl_utils_ByteArray.toArrayBuffer(data);
		var byteoffset = byteArrayOffset;
		var len = null;
		if(byteoffset == null) {
			byteoffset = 0;
		}
		var this1;
		if(elements != null) {
			this1 = new Uint8Array(elements);
		} else if(array != null) {
			this1 = new Uint8Array(array);
		} else if(vector != null) {
			this1 = new Uint8Array(vector.__array);
		} else if(view != null) {
			this1 = new Uint8Array(view);
		} else if(buffer != null) {
			if(len == null) {
				this1 = new Uint8Array(buffer,byteoffset);
			} else {
				this1 = new Uint8Array(buffer,byteoffset,len);
			}
		} else {
			this1 = null;
		}
		this.uploadFromTypedArray(this1);
	}
	,uploadFromTypedArray: function(data) {
		var gl = this.__context.gl;
		this.__context.__bindGLTexture2D(this.__textureID);
		lime_graphics_WebGLRenderContext.texImage2D(gl,this.__textureTarget,0,this.__internalFormat,this.__width,this.__height,0,this.__format,gl.UNSIGNED_BYTE,data);
		this.__context.__bindGLTexture2D(null);
	}
	,__setSamplerState: function(state) {
		if(openfl_display3D_textures_TextureBase.prototype.__setSamplerState.call(this,state)) {
			var gl = this.__context.gl;
			if(openfl_display3D_Context3D.__glMaxTextureMaxAnisotropy != 0) {
				var aniso;
				switch(state.filter) {
				case 0:
					aniso = 16;
					break;
				case 1:
					aniso = 2;
					break;
				case 2:
					aniso = 4;
					break;
				case 3:
					aniso = 8;
					break;
				default:
					aniso = 1;
				}
				if(aniso > openfl_display3D_Context3D.__glMaxTextureMaxAnisotropy) {
					aniso = openfl_display3D_Context3D.__glMaxTextureMaxAnisotropy;
				}
				gl.texParameterf(gl.TEXTURE_2D,openfl_display3D_Context3D.__glTextureMaxAnisotropy,aniso);
			}
			return true;
		}
		return false;
	}
	,__class__: openfl_display3D_textures_RectangleTexture
});
var openfl_display3D_textures_Texture = function(context,width,height,format,optimizeForRenderToTexture,streamingLevels) {
	openfl_display3D_textures_TextureBase.call(this,context);
	this.__width = width;
	this.__height = height;
	this.__optimizeForRenderToTexture = optimizeForRenderToTexture;
	this.__streamingLevels = streamingLevels;
	var gl = this.__context.gl;
	this.__textureTarget = gl.TEXTURE_2D;
	this.__context.__bindGLTexture2D(this.__textureID);
	lime_graphics_WebGLRenderContext.texImage2D(gl,this.__textureTarget,0,this.__internalFormat,this.__width,this.__height,0,this.__format,gl.UNSIGNED_BYTE,null);
	this.__context.__bindGLTexture2D(null);
	if(optimizeForRenderToTexture) {
		this.__getGLFramebuffer(true,0,0);
	}
};
$hxClasses["openfl.display3D.textures.Texture"] = openfl_display3D_textures_Texture;
openfl_display3D_textures_Texture.__name__ = "openfl.display3D.textures.Texture";
openfl_display3D_textures_Texture.__super__ = openfl_display3D_textures_TextureBase;
openfl_display3D_textures_Texture.prototype = $extend(openfl_display3D_textures_TextureBase.prototype,{
	uploadCompressedTextureFromByteArray: function(data,byteArrayOffset,async) {
		if(async == null) {
			async = false;
		}
		var _gthis = this;
		if(!async) {
			this.__uploadCompressedTextureFromByteArray(data,byteArrayOffset);
		} else {
			haxe_Timer.delay(function() {
				_gthis.__uploadCompressedTextureFromByteArray(data,byteArrayOffset);
				var event = null;
				event = new openfl_events_Event("textureReady");
				_gthis.dispatchEvent(event);
			},1);
		}
	}
	,uploadFromBitmapData: function(source,miplevel,generateMipmap) {
		if(generateMipmap == null) {
			generateMipmap = false;
		}
		if(miplevel == null) {
			miplevel = 0;
		}
		if(source == null) {
			return;
		}
		var width = this.__width >> miplevel;
		var height = this.__height >> miplevel;
		if(width == 0 && height == 0) {
			return;
		}
		if(width == 0) {
			width = 1;
		}
		if(height == 0) {
			height = 1;
		}
		if(source.width != width || source.height != height) {
			var copy = new openfl_display_BitmapData(width,height,true,0);
			copy.draw(source);
			source = copy;
		}
		var image = this.__getImage(source);
		if(image == null) {
			return;
		}
		if(miplevel == 0 && image.buffer != null && image.buffer.data == null && image.buffer.get_src() != null) {
			var gl = this.__context.gl;
			var width = this.__width >> miplevel;
			var height = this.__height >> miplevel;
			if(width == 0 && height == 0) {
				return;
			}
			if(width == 0) {
				width = 1;
			}
			if(height == 0) {
				height = 1;
			}
			this.__context.__bindGLTexture2D(this.__textureID);
			lime_graphics_WebGLRenderContext.texImage2D(gl,this.__textureTarget,miplevel,this.__internalFormat,this.__format,gl.UNSIGNED_BYTE,image.buffer.get_src());
			this.__context.__bindGLTexture2D(null);
			return;
		}
		this.uploadFromTypedArray(image.get_data(),miplevel);
	}
	,uploadFromByteArray: function(data,byteArrayOffset,miplevel) {
		if(miplevel == null) {
			miplevel = 0;
		}
		if(byteArrayOffset == 0) {
			this.uploadFromTypedArray(data.b,miplevel);
			return;
		}
		var elements = null;
		var array = null;
		var vector = null;
		var view = null;
		var buffer = openfl_utils_ByteArray.toArrayBuffer(data);
		var byteoffset = byteArrayOffset;
		var len = null;
		if(byteoffset == null) {
			byteoffset = 0;
		}
		var this1;
		if(elements != null) {
			this1 = new Uint8Array(elements);
		} else if(array != null) {
			this1 = new Uint8Array(array);
		} else if(vector != null) {
			this1 = new Uint8Array(vector.__array);
		} else if(view != null) {
			this1 = new Uint8Array(view);
		} else if(buffer != null) {
			if(len == null) {
				this1 = new Uint8Array(buffer,byteoffset);
			} else {
				this1 = new Uint8Array(buffer,byteoffset,len);
			}
		} else {
			this1 = null;
		}
		this.uploadFromTypedArray(this1,miplevel);
	}
	,uploadFromTypedArray: function(data,miplevel) {
		if(miplevel == null) {
			miplevel = 0;
		}
		if(data == null) {
			return;
		}
		var gl = this.__context.gl;
		var width = this.__width >> miplevel;
		var height = this.__height >> miplevel;
		if(width == 0 && height == 0) {
			return;
		}
		if(width == 0) {
			width = 1;
		}
		if(height == 0) {
			height = 1;
		}
		this.__context.__bindGLTexture2D(this.__textureID);
		lime_graphics_WebGLRenderContext.texImage2D(gl,this.__textureTarget,miplevel,this.__internalFormat,width,height,0,this.__format,gl.UNSIGNED_BYTE,data);
		this.__context.__bindGLTexture2D(null);
	}
	,__setSamplerState: function(state) {
		if(openfl_display3D_textures_TextureBase.prototype.__setSamplerState.call(this,state)) {
			var gl = this.__context.gl;
			if(state.mipfilter != 2 && !this.__samplerState.mipmapGenerated) {
				gl.generateMipmap(gl.TEXTURE_2D);
				this.__samplerState.mipmapGenerated = true;
			}
			if(openfl_display3D_Context3D.__glMaxTextureMaxAnisotropy != 0) {
				var aniso;
				switch(state.filter) {
				case 0:
					aniso = 16;
					break;
				case 1:
					aniso = 2;
					break;
				case 2:
					aniso = 4;
					break;
				case 3:
					aniso = 8;
					break;
				default:
					aniso = 1;
				}
				if(aniso > openfl_display3D_Context3D.__glMaxTextureMaxAnisotropy) {
					aniso = openfl_display3D_Context3D.__glMaxTextureMaxAnisotropy;
				}
				gl.texParameterf(gl.TEXTURE_2D,openfl_display3D_Context3D.__glTextureMaxAnisotropy,aniso);
			}
			return true;
		}
		return false;
	}
	,__uploadCompressedTextureFromByteArray: function(data,byteArrayOffset) {
		var _gthis = this;
		var reader = new openfl_display3D__$internal_ATFReader(data,byteArrayOffset);
		var alpha = reader.readHeader(this.__width,this.__height,false);
		var context = this.__context;
		var gl = context.gl;
		this.__context.__bindGLTexture2D(this.__textureID);
		var hasTexture = false;
		reader.readTextures(function(target,level,gpuFormat,width,height,blockLength,bytes) {
			var format = alpha ? openfl_display3D_textures_TextureBase.__compressedFormatsAlpha.h[gpuFormat] : openfl_display3D_textures_TextureBase.__compressedFormats.h[gpuFormat];
			if(format == 0) {
				return;
			}
			hasTexture = true;
			_gthis.__format = format;
			_gthis.__internalFormat = format;
			if(alpha && gpuFormat == 2) {
				var size = blockLength / 2 | 0;
				var elements = null;
				var array = null;
				var vector = null;
				var view = null;
				var buffer = bytes.b.buffer;
				var byteoffset = 0;
				if(byteoffset == null) {
					byteoffset = 0;
				}
				var this1;
				if(elements != null) {
					this1 = new Uint8Array(elements);
				} else if(array != null) {
					this1 = new Uint8Array(array);
				} else if(vector != null) {
					this1 = new Uint8Array(vector.__array);
				} else if(view != null) {
					this1 = new Uint8Array(view);
				} else if(buffer != null) {
					if(size == null) {
						this1 = new Uint8Array(buffer,byteoffset);
					} else {
						this1 = new Uint8Array(buffer,byteoffset,size);
					}
				} else {
					this1 = null;
				}
				lime_graphics_WebGLRenderContext.compressedTexImage2D(gl,_gthis.__textureTarget,level,_gthis.__internalFormat,width,height,0,this1);
				var alphaTexture = new openfl_display3D_textures_Texture(_gthis.__context,_gthis.__width,_gthis.__height,3,_gthis.__optimizeForRenderToTexture,_gthis.__streamingLevels);
				alphaTexture.__format = format;
				alphaTexture.__internalFormat = format;
				_gthis.__context.__bindGLTexture2D(alphaTexture.__textureID);
				var elements = null;
				var array = null;
				var vector = null;
				var view = null;
				var buffer = bytes.b.buffer;
				var byteoffset = size;
				if(byteoffset == null) {
					byteoffset = 0;
				}
				var this1;
				if(elements != null) {
					this1 = new Uint8Array(elements);
				} else if(array != null) {
					this1 = new Uint8Array(array);
				} else if(vector != null) {
					this1 = new Uint8Array(vector.__array);
				} else if(view != null) {
					this1 = new Uint8Array(view);
				} else if(buffer != null) {
					if(size == null) {
						this1 = new Uint8Array(buffer,byteoffset);
					} else {
						this1 = new Uint8Array(buffer,byteoffset,size);
					}
				} else {
					this1 = null;
				}
				lime_graphics_WebGLRenderContext.compressedTexImage2D(gl,alphaTexture.__textureTarget,level,alphaTexture.__internalFormat,width,height,0,this1);
				_gthis.__alphaTexture = alphaTexture;
			} else {
				var elements = null;
				var array = null;
				var vector = null;
				var view = null;
				var buffer = bytes.b.buffer;
				var byteoffset = 0;
				if(byteoffset == null) {
					byteoffset = 0;
				}
				var this1;
				if(elements != null) {
					this1 = new Uint8Array(elements);
				} else if(array != null) {
					this1 = new Uint8Array(array);
				} else if(vector != null) {
					this1 = new Uint8Array(vector.__array);
				} else if(view != null) {
					this1 = new Uint8Array(view);
				} else if(buffer != null) {
					if(blockLength == null) {
						this1 = new Uint8Array(buffer,byteoffset);
					} else {
						this1 = new Uint8Array(buffer,byteoffset,blockLength);
					}
				} else {
					this1 = null;
				}
				lime_graphics_WebGLRenderContext.compressedTexImage2D(gl,_gthis.__textureTarget,level,_gthis.__internalFormat,width,height,0,this1);
			}
		});
		if(!hasTexture) {
			var elements = this.__width * this.__height * 4;
			var array = null;
			var vector = null;
			var view = null;
			var buffer = null;
			var len = null;
			var this1;
			if(elements != null) {
				this1 = new Uint8Array(elements);
			} else if(array != null) {
				this1 = new Uint8Array(array);
			} else if(vector != null) {
				this1 = new Uint8Array(vector.__array);
			} else if(view != null) {
				this1 = new Uint8Array(view);
			} else if(buffer != null) {
				if(len == null) {
					this1 = new Uint8Array(buffer,0);
				} else {
					this1 = new Uint8Array(buffer,0,len);
				}
			} else {
				this1 = null;
			}
			var data = this1;
			lime_graphics_WebGLRenderContext.texImage2D(gl,this.__textureTarget,0,this.__internalFormat,this.__width,this.__height,0,this.__format,gl.UNSIGNED_BYTE,data);
		}
		this.__context.__bindGLTexture2D(null);
	}
	,__class__: openfl_display3D_textures_Texture
});
var openfl_display3D_textures_VideoTexture = function(context) {
	openfl_display3D_textures_TextureBase.call(this,context);
	this.__textureTarget = this.__context.gl.TEXTURE_2D;
};
$hxClasses["openfl.display3D.textures.VideoTexture"] = openfl_display3D_textures_VideoTexture;
openfl_display3D_textures_VideoTexture.__name__ = "openfl.display3D.textures.VideoTexture";
openfl_display3D_textures_VideoTexture.__super__ = openfl_display3D_textures_TextureBase;
openfl_display3D_textures_VideoTexture.prototype = $extend(openfl_display3D_textures_TextureBase.prototype,{
	videoHeight: null
	,videoWidth: null
	,__cacheTime: null
	,__netStream: null
	,attachNetStream: function(netStream) {
		var _gthis = this;
		if(this.__netStream != null) {
			this.__netStream.__video.removeEventListener("canplay",$bind(this,this.__onCanPlay),false);
		}
		this.__cacheTime = -1;
		this.__netStream = netStream;
		if(this.__netStream != null) {
			if(this.__netStream.__video.readyState >= 2) {
				haxe_Timer.delay(function() {
					_gthis.__textureReady();
				},0);
			} else {
				this.__netStream.__video.addEventListener("canplay",$bind(this,this.__onCanPlay),false);
			}
		}
	}
	,dispose: function() {
		if(this.__netStream != null && this.__netStream.__video != null) {
			this.__netStream.__video.removeEventListener("timeupdate",$bind(this,this.__onTimeUpdate));
		}
		openfl_display3D_textures_TextureBase.prototype.dispose.call(this);
	}
	,__onCanPlay: function(_) {
		this.__netStream.__video.addEventListener("timeupdate",$bind(this,this.__onTimeUpdate));
		this.__textureReady();
	}
	,__onTimeUpdate: function(_) {
		if(this.__netStream != null && this.__netStream.__video.currentTime != this.__cacheTime && this.__netStream.__video.readyState >= 2) {
			this.__textureReady();
		}
	}
	,__getTexture: function() {
		if(this.__netStream.__video.currentTime != this.__cacheTime && this.__netStream.__video.readyState >= 2) {
			var gl = this.__context.gl;
			this.__context.__bindGLTexture2D(this.__textureID);
			lime_graphics_WebGLRenderContext.texImage2D(gl,gl.TEXTURE_2D,0,gl.RGBA,gl.RGBA,gl.UNSIGNED_BYTE,this.__netStream.__video);
			this.__cacheTime = this.__netStream.__video.currentTime;
		}
		return this.__textureID;
	}
	,__textureReady: function() {
		this.videoWidth = this.__netStream.__video.videoWidth;
		this.videoHeight = this.__netStream.__video.videoHeight;
		var event = null;
		event = new openfl_events_Event("textureReady");
		this.dispatchEvent(event);
	}
	,__class__: openfl_display3D_textures_VideoTexture
});
var openfl_errors_Error = function(message,id) {
	if(id == null) {
		id = 0;
	}
	if(message == null) {
		message = "";
	}
	haxe_Exception.call(this,message);
	this.errorID = id;
	this.name = "Error";
	this.__skipStack++;
};
$hxClasses["openfl.errors.Error"] = openfl_errors_Error;
openfl_errors_Error.__name__ = "openfl.errors.Error";
openfl_errors_Error.__super__ = haxe_Exception;
openfl_errors_Error.prototype = $extend(haxe_Exception.prototype,{
	errorID: null
	,name: null
	,getStackTrace: function() {
		return haxe_CallStack.toString(haxe_CallStack.exceptionStack());
	}
	,toString: function() {
		if(this.get_message() != null) {
			return this.get_message();
		} else {
			return "Error";
		}
	}
	,__class__: openfl_errors_Error
});
var openfl_errors_ArgumentError = function(message) {
	if(message == null) {
		message = "";
	}
	openfl_errors_Error.call(this,message);
	this.name = "ArgumentError";
	this.__skipStack++;
};
$hxClasses["openfl.errors.ArgumentError"] = openfl_errors_ArgumentError;
openfl_errors_ArgumentError.__name__ = "openfl.errors.ArgumentError";
openfl_errors_ArgumentError.__super__ = openfl_errors_Error;
openfl_errors_ArgumentError.prototype = $extend(openfl_errors_Error.prototype,{
	__class__: openfl_errors_ArgumentError
});
var openfl_errors_IOError = function(message) {
	if(message == null) {
		message = "";
	}
	openfl_errors_Error.call(this,message);
	this.name = "IOError";
	this.__skipStack++;
};
$hxClasses["openfl.errors.IOError"] = openfl_errors_IOError;
openfl_errors_IOError.__name__ = "openfl.errors.IOError";
openfl_errors_IOError.__super__ = openfl_errors_Error;
openfl_errors_IOError.prototype = $extend(openfl_errors_Error.prototype,{
	__class__: openfl_errors_IOError
});
var openfl_errors_EOFError = function(message,id) {
	if(id == null) {
		id = 0;
	}
	openfl_errors_IOError.call(this,"End of file was encountered");
	this.name = "EOFError";
	this.errorID = 2030;
	this.__skipStack++;
};
$hxClasses["openfl.errors.EOFError"] = openfl_errors_EOFError;
openfl_errors_EOFError.__name__ = "openfl.errors.EOFError";
openfl_errors_EOFError.__super__ = openfl_errors_IOError;
openfl_errors_EOFError.prototype = $extend(openfl_errors_IOError.prototype,{
	__class__: openfl_errors_EOFError
});
var openfl_errors_IllegalOperationError = function(message) {
	if(message == null) {
		message = "";
	}
	openfl_errors_Error.call(this,message,0);
	this.name = "IllegalOperationError";
	this.__skipStack++;
};
$hxClasses["openfl.errors.IllegalOperationError"] = openfl_errors_IllegalOperationError;
openfl_errors_IllegalOperationError.__name__ = "openfl.errors.IllegalOperationError";
openfl_errors_IllegalOperationError.__super__ = openfl_errors_Error;
openfl_errors_IllegalOperationError.prototype = $extend(openfl_errors_Error.prototype,{
	__class__: openfl_errors_IllegalOperationError
});
var openfl_errors_RangeError = function(message) {
	if(message == null) {
		message = "";
	}
	openfl_errors_Error.call(this,message,0);
	this.name = "RangeError";
	this.__skipStack++;
};
$hxClasses["openfl.errors.RangeError"] = openfl_errors_RangeError;
openfl_errors_RangeError.__name__ = "openfl.errors.RangeError";
openfl_errors_RangeError.__super__ = openfl_errors_Error;
openfl_errors_RangeError.prototype = $extend(openfl_errors_Error.prototype,{
	__class__: openfl_errors_RangeError
});
var openfl_errors_SecurityError = function(message) {
	if(message == null) {
		message = "";
	}
	openfl_errors_Error.call(this,message,0);
	this.name = "SecurityError";
	this.__skipStack++;
};
$hxClasses["openfl.errors.SecurityError"] = openfl_errors_SecurityError;
openfl_errors_SecurityError.__name__ = "openfl.errors.SecurityError";
openfl_errors_SecurityError.__super__ = openfl_errors_Error;
openfl_errors_SecurityError.prototype = $extend(openfl_errors_Error.prototype,{
	__class__: openfl_errors_SecurityError
});
var openfl_errors_TypeError = function(message) {
	if(message == null) {
		message = "";
	}
	openfl_errors_Error.call(this,message,0);
	this.name = "TypeError";
	this.__skipStack++;
};
$hxClasses["openfl.errors.TypeError"] = openfl_errors_TypeError;
openfl_errors_TypeError.__name__ = "openfl.errors.TypeError";
openfl_errors_TypeError.__super__ = openfl_errors_Error;
openfl_errors_TypeError.prototype = $extend(openfl_errors_Error.prototype,{
	__class__: openfl_errors_TypeError
});
var openfl_events_ActivityEvent = function(type,bubbles,cancelable,activating) {
	if(activating == null) {
		activating = false;
	}
	if(cancelable == null) {
		cancelable = false;
	}
	if(bubbles == null) {
		bubbles = false;
	}
	openfl_events_Event.call(this,type,bubbles,cancelable);
	this.activating = activating;
};
$hxClasses["openfl.events.ActivityEvent"] = openfl_events_ActivityEvent;
openfl_events_ActivityEvent.__name__ = "openfl.events.ActivityEvent";
openfl_events_ActivityEvent.__super__ = openfl_events_Event;
openfl_events_ActivityEvent.prototype = $extend(openfl_events_Event.prototype,{
	activating: null
	,clone: function() {
		var event = new openfl_events_ActivityEvent(this.type,this.bubbles,this.cancelable,this.activating);
		event.target = this.target;
		event.currentTarget = this.currentTarget;
		event.eventPhase = this.eventPhase;
		return event;
	}
	,toString: function() {
		return this.__formatToString("ActivityEvent",["type","bubbles","cancelable","activating"]);
	}
	,__init: function() {
		openfl_events_Event.prototype.__init.call(this);
		this.activating = false;
	}
	,__class__: openfl_events_ActivityEvent
});
var openfl_events_TextEvent = function(type,bubbles,cancelable,text) {
	if(text == null) {
		text = "";
	}
	if(cancelable == null) {
		cancelable = false;
	}
	if(bubbles == null) {
		bubbles = false;
	}
	openfl_events_Event.call(this,type,bubbles,cancelable);
	this.text = text;
};
$hxClasses["openfl.events.TextEvent"] = openfl_events_TextEvent;
openfl_events_TextEvent.__name__ = "openfl.events.TextEvent";
openfl_events_TextEvent.__super__ = openfl_events_Event;
openfl_events_TextEvent.prototype = $extend(openfl_events_Event.prototype,{
	text: null
	,clone: function() {
		var event = new openfl_events_TextEvent(this.type,this.bubbles,this.cancelable,this.text);
		event.target = this.target;
		event.currentTarget = this.currentTarget;
		event.eventPhase = this.eventPhase;
		return event;
	}
	,toString: function() {
		return this.__formatToString("TextEvent",["type","bubbles","cancelable","text"]);
	}
	,__init: function() {
		openfl_events_Event.prototype.__init.call(this);
		this.text = "";
	}
	,__class__: openfl_events_TextEvent
});
var openfl_events_ErrorEvent = function(type,bubbles,cancelable,text,id) {
	if(id == null) {
		id = 0;
	}
	if(text == null) {
		text = "";
	}
	if(cancelable == null) {
		cancelable = false;
	}
	if(bubbles == null) {
		bubbles = false;
	}
	openfl_events_TextEvent.call(this,type,bubbles,cancelable,text);
	this.errorID = id;
};
$hxClasses["openfl.events.ErrorEvent"] = openfl_events_ErrorEvent;
openfl_events_ErrorEvent.__name__ = "openfl.events.ErrorEvent";
openfl_events_ErrorEvent.__super__ = openfl_events_TextEvent;
openfl_events_ErrorEvent.prototype = $extend(openfl_events_TextEvent.prototype,{
	errorID: null
	,clone: function() {
		var event = new openfl_events_ErrorEvent(this.type,this.bubbles,this.cancelable,this.text,this.errorID);
		event.target = this.target;
		event.currentTarget = this.currentTarget;
		event.eventPhase = this.eventPhase;
		return event;
	}
	,toString: function() {
		return this.__formatToString("ErrorEvent",["type","bubbles","cancelable","text","errorID"]);
	}
	,__init: function() {
		openfl_events_TextEvent.prototype.__init.call(this);
		this.errorID = 0;
	}
	,__class__: openfl_events_ErrorEvent
});
var openfl_events_AsyncErrorEvent = function(type,bubbles,cancelable,text,error) {
	if(text == null) {
		text = "";
	}
	if(cancelable == null) {
		cancelable = false;
	}
	if(bubbles == null) {
		bubbles = false;
	}
	openfl_events_ErrorEvent.call(this,type,bubbles,cancelable);
	this.text = text;
	this.error = error;
};
$hxClasses["openfl.events.AsyncErrorEvent"] = openfl_events_AsyncErrorEvent;
openfl_events_AsyncErrorEvent.__name__ = "openfl.events.AsyncErrorEvent";
openfl_events_AsyncErrorEvent.__super__ = openfl_events_ErrorEvent;
openfl_events_AsyncErrorEvent.prototype = $extend(openfl_events_ErrorEvent.prototype,{
	error: null
	,clone: function() {
		var event = new openfl_events_AsyncErrorEvent(this.type,this.bubbles,this.cancelable,this.text,this.error);
		event.target = this.target;
		event.currentTarget = this.currentTarget;
		event.eventPhase = this.eventPhase;
		return event;
	}
	,toString: function() {
		return this.__formatToString("AsyncErrorEvent",["type","bubbles","cancelable","text","error"]);
	}
	,__init: function() {
		openfl_events_ErrorEvent.prototype.__init.call(this);
		this.text = "";
		this.error = null;
	}
	,__class__: openfl_events_AsyncErrorEvent
});
var openfl_events_DataEvent = function(type,bubbles,cancelable,data) {
	if(data == null) {
		data = "";
	}
	if(cancelable == null) {
		cancelable = false;
	}
	if(bubbles == null) {
		bubbles = false;
	}
	openfl_events_TextEvent.call(this,type,bubbles,cancelable);
	this.data = data;
};
$hxClasses["openfl.events.DataEvent"] = openfl_events_DataEvent;
openfl_events_DataEvent.__name__ = "openfl.events.DataEvent";
openfl_events_DataEvent.__super__ = openfl_events_TextEvent;
openfl_events_DataEvent.prototype = $extend(openfl_events_TextEvent.prototype,{
	data: null
	,clone: function() {
		var event = new openfl_events_DataEvent(this.type,this.bubbles,this.cancelable,this.data);
		event.target = this.target;
		event.currentTarget = this.currentTarget;
		event.eventPhase = this.eventPhase;
		return event;
	}
	,toString: function() {
		return this.__formatToString("DataEvent",["type","bubbles","cancelable","data"]);
	}
	,__init: function() {
		openfl_events_TextEvent.prototype.__init.call(this);
		this.data = "";
	}
	,__class__: openfl_events_DataEvent
});
var openfl_events__$EventDispatcher_DispatchIterator = function(list) {
	this.active = false;
	this.reset(list);
};
$hxClasses["openfl.events._EventDispatcher.DispatchIterator"] = openfl_events__$EventDispatcher_DispatchIterator;
openfl_events__$EventDispatcher_DispatchIterator.__name__ = "openfl.events._EventDispatcher.DispatchIterator";
openfl_events__$EventDispatcher_DispatchIterator.prototype = {
	active: null
	,index: null
	,isCopy: null
	,list: null
	,copy: function() {
		if(!this.isCopy) {
			this.list = this.list.slice();
			this.isCopy = true;
		}
	}
	,hasNext: function() {
		return this.index < this.list.length;
	}
	,next: function() {
		return this.list[this.index++];
	}
	,remove: function(listener,listIndex) {
		if(this.active) {
			if(!this.isCopy) {
				if(listIndex < this.index) {
					this.index--;
				}
			} else {
				var _g = this.index;
				var _g1 = this.list.length;
				while(_g < _g1) {
					var i = _g++;
					if(this.list[i] == listener) {
						this.list.splice(i,1);
						break;
					}
				}
			}
		}
	}
	,reset: function(list) {
		this.list = list;
		this.isCopy = false;
		this.index = 0;
	}
	,start: function() {
		this.active = true;
	}
	,stop: function() {
		this.active = false;
	}
	,__class__: openfl_events__$EventDispatcher_DispatchIterator
};
var openfl_events__$EventDispatcher_Listener = function(callback,useCapture,priority,useWeakReference) {
	if(useWeakReference && openfl_events__$EventDispatcher_Listener.supportsWeakReference) {
		this.weakRefCallback = new WeakRef(callback);
	} else {
		this.callback = callback;
	}
	this.useCapture = useCapture;
	this.priority = priority;
	this.useWeakReference = useWeakReference;
};
$hxClasses["openfl.events._EventDispatcher.Listener"] = openfl_events__$EventDispatcher_Listener;
openfl_events__$EventDispatcher_Listener.__name__ = "openfl.events._EventDispatcher.Listener";
openfl_events__$EventDispatcher_Listener.prototype = {
	callback: null
	,weakRefCallback: null
	,priority: null
	,useCapture: null
	,useWeakReference: null
	,match: function(callback,useCapture) {
		var resolvedCallback = this.callback;
		if(this.weakRefCallback != null) {
			resolvedCallback = this.weakRefCallback.deref();
			if(resolvedCallback == null) {
				return false;
			}
		}
		if(resolvedCallback == callback) {
			return this.useCapture == useCapture;
		} else {
			return false;
		}
	}
	,__class__: openfl_events__$EventDispatcher_Listener
};
var openfl_events_EventType = {};
openfl_events_EventType.equals = function(a,b) {
	return a == b;
};
openfl_events_EventType.notEquals = function(a,b) {
	return a != b;
};
var openfl_events_FocusEvent = function(type,bubbles,cancelable,relatedObject,shiftKey,keyCode) {
	if(keyCode == null) {
		keyCode = 0;
	}
	if(shiftKey == null) {
		shiftKey = false;
	}
	if(cancelable == null) {
		cancelable = false;
	}
	if(bubbles == null) {
		bubbles = false;
	}
	openfl_events_Event.call(this,type,bubbles,cancelable);
	this.keyCode = keyCode;
	this.shiftKey = shiftKey;
	this.relatedObject = relatedObject;
};
$hxClasses["openfl.events.FocusEvent"] = openfl_events_FocusEvent;
openfl_events_FocusEvent.__name__ = "openfl.events.FocusEvent";
openfl_events_FocusEvent.__super__ = openfl_events_Event;
openfl_events_FocusEvent.prototype = $extend(openfl_events_Event.prototype,{
	keyCode: null
	,relatedObject: null
	,shiftKey: null
	,clone: function() {
		var event = new openfl_events_FocusEvent(this.type,this.bubbles,this.cancelable,this.relatedObject,this.shiftKey,this.keyCode);
		event.target = this.target;
		event.currentTarget = this.currentTarget;
		event.eventPhase = this.eventPhase;
		return event;
	}
	,toString: function() {
		return this.__formatToString("FocusEvent",["type","bubbles","cancelable","relatedObject","shiftKey","keyCode"]);
	}
	,__init: function() {
		openfl_events_Event.prototype.__init.call(this);
		this.keyCode = 0;
		this.shiftKey = false;
		this.relatedObject = null;
	}
	,__class__: openfl_events_FocusEvent
});
var openfl_events_FullScreenEvent = function(type,bubbles,cancelable,fullScreen,interactive) {
	if(interactive == null) {
		interactive = false;
	}
	if(fullScreen == null) {
		fullScreen = false;
	}
	if(cancelable == null) {
		cancelable = false;
	}
	if(bubbles == null) {
		bubbles = false;
	}
	openfl_events_ActivityEvent.call(this,type,bubbles,cancelable);
	this.fullScreen = fullScreen;
	this.interactive = interactive;
};
$hxClasses["openfl.events.FullScreenEvent"] = openfl_events_FullScreenEvent;
openfl_events_FullScreenEvent.__name__ = "openfl.events.FullScreenEvent";
openfl_events_FullScreenEvent.__super__ = openfl_events_ActivityEvent;
openfl_events_FullScreenEvent.prototype = $extend(openfl_events_ActivityEvent.prototype,{
	fullScreen: null
	,interactive: null
	,clone: function() {
		var event = new openfl_events_FullScreenEvent(this.type,this.bubbles,this.cancelable,this.fullScreen,this.interactive);
		event.target = this.target;
		event.currentTarget = this.currentTarget;
		event.eventPhase = this.eventPhase;
		return event;
	}
	,toString: function() {
		return this.__formatToString("FullscreenEvent",["type","bubbles","cancelable","fullscreen","interactive"]);
	}
	,__init: function() {
		openfl_events_ActivityEvent.prototype.__init.call(this);
		this.fullScreen = false;
		this.interactive = false;
	}
	,__class__: openfl_events_FullScreenEvent
});
var openfl_events_GameInputEvent = function(type,bubbles,cancelable,device) {
	if(cancelable == null) {
		cancelable = false;
	}
	if(bubbles == null) {
		bubbles = true;
	}
	openfl_events_Event.call(this,type,bubbles,cancelable);
	this.device = device;
};
$hxClasses["openfl.events.GameInputEvent"] = openfl_events_GameInputEvent;
openfl_events_GameInputEvent.__name__ = "openfl.events.GameInputEvent";
openfl_events_GameInputEvent.__super__ = openfl_events_Event;
openfl_events_GameInputEvent.prototype = $extend(openfl_events_Event.prototype,{
	device: null
	,clone: function() {
		var event = new openfl_events_GameInputEvent(this.type,this.bubbles,this.cancelable,this.device);
		event.target = this.target;
		event.currentTarget = this.currentTarget;
		event.eventPhase = this.eventPhase;
		return event;
	}
	,toString: function() {
		return this.__formatToString("GameInputEvent",["type","bubbles","cancelable","device"]);
	}
	,__init: function() {
		openfl_events_Event.prototype.__init.call(this);
		this.bubbles = true;
		this.device = null;
	}
	,__class__: openfl_events_GameInputEvent
});
var openfl_events_HTTPStatusEvent = function(type,bubbles,cancelable,status,redirected) {
	if(redirected == null) {
		redirected = false;
	}
	if(status == null) {
		status = 0;
	}
	if(cancelable == null) {
		cancelable = false;
	}
	if(bubbles == null) {
		bubbles = false;
	}
	this.responseHeaders = [];
	this.status = status;
	this.redirected = redirected;
	openfl_events_Event.call(this,type,bubbles,cancelable);
};
$hxClasses["openfl.events.HTTPStatusEvent"] = openfl_events_HTTPStatusEvent;
openfl_events_HTTPStatusEvent.__name__ = "openfl.events.HTTPStatusEvent";
openfl_events_HTTPStatusEvent.__super__ = openfl_events_Event;
openfl_events_HTTPStatusEvent.prototype = $extend(openfl_events_Event.prototype,{
	redirected: null
	,responseHeaders: null
	,responseURL: null
	,status: null
	,clone: function() {
		var event = new openfl_events_HTTPStatusEvent(this.type,this.bubbles,this.cancelable,this.status,this.redirected);
		event.target = this.target;
		event.currentTarget = this.currentTarget;
		event.eventPhase = this.eventPhase;
		return event;
	}
	,toString: function() {
		return this.__formatToString("HTTPStatusEvent",["type","bubbles","cancelable","status","redirected"]);
	}
	,__init: function() {
		openfl_events_Event.prototype.__init.call(this);
		this.status = 0;
		this.redirected = false;
	}
	,__class__: openfl_events_HTTPStatusEvent
});
var openfl_events_IOErrorEvent = function(type,bubbles,cancelable,text,id) {
	if(id == null) {
		id = 0;
	}
	if(text == null) {
		text = "";
	}
	if(cancelable == null) {
		cancelable = false;
	}
	if(bubbles == null) {
		bubbles = true;
	}
	openfl_events_ErrorEvent.call(this,type,bubbles,cancelable,text,id);
};
$hxClasses["openfl.events.IOErrorEvent"] = openfl_events_IOErrorEvent;
openfl_events_IOErrorEvent.__name__ = "openfl.events.IOErrorEvent";
openfl_events_IOErrorEvent.__super__ = openfl_events_ErrorEvent;
openfl_events_IOErrorEvent.prototype = $extend(openfl_events_ErrorEvent.prototype,{
	clone: function() {
		var event = new openfl_events_IOErrorEvent(this.type,this.bubbles,this.cancelable,this.text,this.errorID);
		event.target = this.target;
		event.currentTarget = this.currentTarget;
		event.eventPhase = this.eventPhase;
		return event;
	}
	,toString: function() {
		return this.__formatToString("IOErrorEvent",["type","bubbles","cancelable","text","errorID"]);
	}
	,__class__: openfl_events_IOErrorEvent
});
var openfl_events_KeyboardEvent = function(type,bubbles,cancelable,charCodeValue,keyCodeValue,keyLocationValue,ctrlKeyValue,altKeyValue,shiftKeyValue,controlKeyValue,commandKeyValue) {
	if(commandKeyValue == null) {
		commandKeyValue = false;
	}
	if(controlKeyValue == null) {
		controlKeyValue = false;
	}
	if(shiftKeyValue == null) {
		shiftKeyValue = false;
	}
	if(altKeyValue == null) {
		altKeyValue = false;
	}
	if(ctrlKeyValue == null) {
		ctrlKeyValue = false;
	}
	if(keyCodeValue == null) {
		keyCodeValue = 0;
	}
	if(charCodeValue == null) {
		charCodeValue = 0;
	}
	if(cancelable == null) {
		cancelable = false;
	}
	if(bubbles == null) {
		bubbles = false;
	}
	openfl_events_Event.call(this,type,bubbles,cancelable);
	this.charCode = charCodeValue;
	this.keyCode = keyCodeValue;
	this.keyLocation = keyLocationValue != null ? keyLocationValue : 0;
	this.ctrlKey = ctrlKeyValue;
	this.altKey = altKeyValue;
	this.shiftKey = shiftKeyValue;
	this.controlKey = controlKeyValue;
	this.commandKey = commandKeyValue;
	this.__updateAfterEventFlag = false;
};
$hxClasses["openfl.events.KeyboardEvent"] = openfl_events_KeyboardEvent;
openfl_events_KeyboardEvent.__name__ = "openfl.events.KeyboardEvent";
openfl_events_KeyboardEvent.__super__ = openfl_events_Event;
openfl_events_KeyboardEvent.prototype = $extend(openfl_events_Event.prototype,{
	altKey: null
	,charCode: null
	,commandKey: null
	,controlKey: null
	,ctrlKey: null
	,keyCode: null
	,keyLocation: null
	,shiftKey: null
	,__updateAfterEventFlag: null
	,clone: function() {
		var event = new openfl_events_KeyboardEvent(this.type,this.bubbles,this.cancelable,this.charCode,this.keyCode,this.keyLocation,this.ctrlKey,this.altKey,this.shiftKey,this.controlKey,this.commandKey);
		event.target = this.target;
		event.currentTarget = this.currentTarget;
		event.eventPhase = this.eventPhase;
		return event;
	}
	,toString: function() {
		return this.__formatToString("KeyboardEvent",["type","bubbles","cancelable","charCode","keyCode","keyLocation","ctrlKey","altKey","shiftKey"]);
	}
	,updateAfterEvent: function() {
		this.__updateAfterEventFlag = true;
	}
	,__init: function() {
		openfl_events_Event.prototype.__init.call(this);
		this.charCode = 0;
		this.keyCode = 0;
		this.keyLocation = 0;
		this.ctrlKey = false;
		this.altKey = false;
		this.shiftKey = false;
		this.controlKey = false;
		this.commandKey = false;
		this.__updateAfterEventFlag = false;
	}
	,__class__: openfl_events_KeyboardEvent
});
var openfl_events_MouseEvent = function(type,bubbles,cancelable,localX,localY,relatedObject,ctrlKey,altKey,shiftKey,buttonDown,delta,commandKey,controlKey,clickCount) {
	if(clickCount == null) {
		clickCount = 0;
	}
	if(controlKey == null) {
		controlKey = false;
	}
	if(commandKey == null) {
		commandKey = false;
	}
	if(delta == null) {
		delta = 0;
	}
	if(buttonDown == null) {
		buttonDown = false;
	}
	if(shiftKey == null) {
		shiftKey = false;
	}
	if(altKey == null) {
		altKey = false;
	}
	if(ctrlKey == null) {
		ctrlKey = false;
	}
	if(localY == null) {
		localY = 0;
	}
	if(localX == null) {
		localX = 0;
	}
	if(cancelable == null) {
		cancelable = false;
	}
	if(bubbles == null) {
		bubbles = true;
	}
	openfl_events_Event.call(this,type,bubbles,cancelable);
	this.shiftKey = shiftKey;
	this.altKey = altKey;
	this.ctrlKey = ctrlKey;
	this.bubbles = bubbles;
	this.relatedObject = relatedObject;
	this.delta = delta;
	this.localX = localX;
	this.localY = localY;
	this.buttonDown = buttonDown;
	this.commandKey = commandKey;
	this.controlKey = controlKey;
	this.clickCount = clickCount;
	this.isRelatedObjectInaccessible = false;
	this.stageX = NaN;
	this.stageY = NaN;
	this.__updateAfterEventFlag = false;
};
$hxClasses["openfl.events.MouseEvent"] = openfl_events_MouseEvent;
openfl_events_MouseEvent.__name__ = "openfl.events.MouseEvent";
openfl_events_MouseEvent.__create = function(type,button,clickCount,stageX,stageY,local,target,delta) {
	if(delta == null) {
		delta = 0;
	}
	var event = new openfl_events_MouseEvent(type,true,false,local.x,local.y,null,openfl_events_MouseEvent.__ctrlKey,openfl_events_MouseEvent.__altKey,openfl_events_MouseEvent.__shiftKey,openfl_events_MouseEvent.__buttonDown,delta,openfl_events_MouseEvent.__commandKey,openfl_events_MouseEvent.__controlKey,clickCount);
	event.stageX = stageX;
	event.stageY = stageY;
	event.target = target;
	return event;
};
openfl_events_MouseEvent.__super__ = openfl_events_Event;
openfl_events_MouseEvent.prototype = $extend(openfl_events_Event.prototype,{
	altKey: null
	,buttonDown: null
	,commandKey: null
	,controlKey: null
	,clickCount: null
	,ctrlKey: null
	,delta: null
	,isRelatedObjectInaccessible: null
	,localX: null
	,localY: null
	,relatedObject: null
	,shiftKey: null
	,stageX: null
	,stageY: null
	,__updateAfterEventFlag: null
	,clone: function() {
		var event = new openfl_events_MouseEvent(this.type,this.bubbles,this.cancelable,this.localX,this.localY,this.relatedObject,this.ctrlKey,this.altKey,this.shiftKey,this.buttonDown,this.delta,this.commandKey,this.controlKey,this.clickCount);
		event.target = this.target;
		event.currentTarget = this.currentTarget;
		event.eventPhase = this.eventPhase;
		return event;
	}
	,toString: function() {
		return this.__formatToString("MouseEvent",["type","bubbles","cancelable","localX","localY","relatedObject","ctrlKey","altKey","shiftKey","buttonDown","delta"]);
	}
	,updateAfterEvent: function() {
		this.__updateAfterEventFlag = true;
	}
	,__init: function() {
		openfl_events_Event.prototype.__init.call(this);
		this.bubbles = true;
		this.shiftKey = false;
		this.altKey = false;
		this.ctrlKey = false;
		this.relatedObject = null;
		this.delta = 0;
		this.localX = 0;
		this.localY = 0;
		this.buttonDown = false;
		this.commandKey = false;
		this.controlKey = false;
		this.clickCount = 0;
		this.isRelatedObjectInaccessible = false;
		this.stageX = NaN;
		this.stageY = NaN;
		this.__updateAfterEventFlag = false;
	}
	,__class__: openfl_events_MouseEvent
});
var openfl_events_NetStatusEvent = function(type,bubbles,cancelable,info) {
	if(cancelable == null) {
		cancelable = false;
	}
	if(bubbles == null) {
		bubbles = false;
	}
	this.info = info;
	openfl_events_Event.call(this,type,bubbles,cancelable);
};
$hxClasses["openfl.events.NetStatusEvent"] = openfl_events_NetStatusEvent;
openfl_events_NetStatusEvent.__name__ = "openfl.events.NetStatusEvent";
openfl_events_NetStatusEvent.__super__ = openfl_events_Event;
openfl_events_NetStatusEvent.prototype = $extend(openfl_events_Event.prototype,{
	info: null
	,clone: function() {
		var event = new openfl_events_NetStatusEvent(this.type,this.bubbles,this.cancelable,this.info);
		event.target = this.target;
		event.currentTarget = this.currentTarget;
		event.eventPhase = this.eventPhase;
		return event;
	}
	,toString: function() {
		return this.__formatToString("NetStatusEvent",["type","bubbles","cancelable","info"]);
	}
	,__init: function() {
		openfl_events_Event.prototype.__init.call(this);
		this.info = null;
	}
	,__class__: openfl_events_NetStatusEvent
});
var openfl_events_ProgressEvent = function(type,bubbles,cancelable,bytesLoaded,bytesTotal) {
	if(bytesTotal == null) {
		bytesTotal = 0;
	}
	if(bytesLoaded == null) {
		bytesLoaded = 0;
	}
	if(cancelable == null) {
		cancelable = false;
	}
	if(bubbles == null) {
		bubbles = false;
	}
	openfl_events_Event.call(this,type,bubbles,cancelable);
	this.bytesLoaded = bytesLoaded;
	this.bytesTotal = bytesTotal;
};
$hxClasses["openfl.events.ProgressEvent"] = openfl_events_ProgressEvent;
openfl_events_ProgressEvent.__name__ = "openfl.events.ProgressEvent";
openfl_events_ProgressEvent.__super__ = openfl_events_Event;
openfl_events_ProgressEvent.prototype = $extend(openfl_events_Event.prototype,{
	bytesLoaded: null
	,bytesTotal: null
	,clone: function() {
		var event = new openfl_events_ProgressEvent(this.type,this.bubbles,this.cancelable,this.bytesLoaded,this.bytesTotal);
		event.target = this.target;
		event.currentTarget = this.currentTarget;
		event.eventPhase = this.eventPhase;
		return event;
	}
	,toString: function() {
		return this.__formatToString("ProgressEvent",["type","bubbles","cancelable","bytesLoaded","bytesTotal"]);
	}
	,__init: function() {
		openfl_events_Event.prototype.__init.call(this);
		this.bytesLoaded = 0;
		this.bytesTotal = 0;
	}
	,__class__: openfl_events_ProgressEvent
});
var openfl_events_RenderEvent = function(type,bubbles,cancelable,objectMatrix,objectColorTransform,allowSmoothing) {
	if(allowSmoothing == null) {
		allowSmoothing = true;
	}
	if(cancelable == null) {
		cancelable = false;
	}
	if(bubbles == null) {
		bubbles = false;
	}
	openfl_events_Event.call(this,type,bubbles,cancelable);
	this.objectMatrix = objectMatrix;
	this.objectColorTransform = objectColorTransform;
	this.allowSmoothing = allowSmoothing;
};
$hxClasses["openfl.events.RenderEvent"] = openfl_events_RenderEvent;
openfl_events_RenderEvent.__name__ = "openfl.events.RenderEvent";
openfl_events_RenderEvent.__super__ = openfl_events_Event;
openfl_events_RenderEvent.prototype = $extend(openfl_events_Event.prototype,{
	allowSmoothing: null
	,objectColorTransform: null
	,objectMatrix: null
	,renderer: null
	,clone: function() {
		var event = new openfl_events_RenderEvent(this.type,this.bubbles,this.cancelable,this.objectMatrix.clone(),this.objectColorTransform.__clone(),this.allowSmoothing);
		event.target = this.target;
		event.currentTarget = this.currentTarget;
		event.eventPhase = this.eventPhase;
		return event;
	}
	,toString: function() {
		return this.__formatToString("RenderEvent",["type","bubbles","cancelable"]);
	}
	,__init: function() {
		openfl_events_Event.prototype.__init.call(this);
		this.objectMatrix = null;
		this.objectColorTransform = null;
		this.allowSmoothing = false;
		this.renderer = null;
	}
	,__class__: openfl_events_RenderEvent
});
var openfl_events_SampleDataEvent = function(type,bubbles,cancelable) {
	if(cancelable == null) {
		cancelable = false;
	}
	if(bubbles == null) {
		bubbles = false;
	}
	openfl_events_Event.call(this,type,bubbles,cancelable);
	this.data = new openfl_utils_ByteArrayData(0);
	this.data.__endian = 1;
	this.position = 0.0;
};
$hxClasses["openfl.events.SampleDataEvent"] = openfl_events_SampleDataEvent;
openfl_events_SampleDataEvent.__name__ = "openfl.events.SampleDataEvent";
openfl_events_SampleDataEvent.__super__ = openfl_events_Event;
openfl_events_SampleDataEvent.prototype = $extend(openfl_events_Event.prototype,{
	data: null
	,position: null
	,tempBuffer: null
	,leftChannel: null
	,rightChannel: null
	,clone: function() {
		var event = new openfl_events_SampleDataEvent(this.type,this.bubbles,this.cancelable);
		event.target = this.target;
		event.currentTarget = this.currentTarget;
		event.eventPhase = this.eventPhase;
		event.data = this.data;
		event.position = this.position;
		return event;
	}
	,toString: function() {
		return this.__formatToString("SampleDataEvent",["type","bubbles","cancelable"]);
	}
	,__init: function() {
		openfl_events_Event.prototype.__init.call(this);
		this.data = new openfl_utils_ByteArrayData(0);
		this.data.__endian = 1;
		this.position = 0.0;
	}
	,getBufferSize: function() {
		var bufferSize = UInt.toFloat(openfl_utils_ByteArray.get_length(this.data)) / UInt.toFloat(4) / 2 | 0;
		if(bufferSize > 0) {
			if(bufferSize != 0 && (bufferSize & bufferSize - 1) == 0 && bufferSize >= 2048 && bufferSize <= 8192) {
				this.tempBuffer = new Float32Array(bufferSize * 2);
				return bufferSize;
			} else {
				throw new openfl_errors_Error("To be consistent with flash the listener function registered to SampleDataEvent has to provide 2048, 4096 or 8192 samples if targeting HTML5.");
			}
		}
		return 0;
	}
	,getSamples: function(event) {
		this.data.position = 0;
		this.tempBuffer = haxe_io_Float32Array.fromBytes(openfl_utils_ByteArray.toBytes(this.data));
		this.leftChannel = event.outputBuffer.getChannelData(0);
		this.rightChannel = event.outputBuffer.getChannelData(1);
		var pos = 0;
		var bufferLength = UInt.toFloat(openfl_utils_ByteArray.get_length(this.data)) / UInt.toFloat(2) | 0;
		var _g = 0;
		var _g1 = bufferLength;
		while(_g < _g1) {
			var i = _g++;
			this.leftChannel[i] = this.tempBuffer[pos++];
			this.rightChannel[i] = this.tempBuffer[pos++];
		}
	}
	,__class__: openfl_events_SampleDataEvent
});
var openfl_events_SecurityErrorEvent = function(type,bubbles,cancelable,text,id) {
	if(id == null) {
		id = 0;
	}
	if(text == null) {
		text = "";
	}
	if(cancelable == null) {
		cancelable = false;
	}
	if(bubbles == null) {
		bubbles = false;
	}
	openfl_events_ErrorEvent.call(this,type,bubbles,cancelable,text,id);
};
$hxClasses["openfl.events.SecurityErrorEvent"] = openfl_events_SecurityErrorEvent;
openfl_events_SecurityErrorEvent.__name__ = "openfl.events.SecurityErrorEvent";
openfl_events_SecurityErrorEvent.__super__ = openfl_events_ErrorEvent;
openfl_events_SecurityErrorEvent.prototype = $extend(openfl_events_ErrorEvent.prototype,{
	clone: function() {
		var event = new openfl_events_SecurityErrorEvent(this.type,this.bubbles,this.cancelable,this.text,this.errorID);
		event.target = this.target;
		event.currentTarget = this.currentTarget;
		event.eventPhase = this.eventPhase;
		return event;
	}
	,toString: function() {
		return this.__formatToString("SecurityErrorEvent",["type","bubbles","cancelable","text","errorID"]);
	}
	,__class__: openfl_events_SecurityErrorEvent
});
var openfl_events_StageOrientationEvent = function(type,bubbles,cancelable,beforeOrientation,afterOrientation) {
	if(afterOrientation == null) {
		afterOrientation = 3;
	}
	if(beforeOrientation == null) {
		beforeOrientation = 3;
	}
	if(cancelable == null) {
		cancelable = false;
	}
	if(bubbles == null) {
		bubbles = false;
	}
	openfl_events_Event.call(this,type,bubbles,cancelable);
	this.beforeOrientation = beforeOrientation;
	this.afterOrientation = afterOrientation;
};
$hxClasses["openfl.events.StageOrientationEvent"] = openfl_events_StageOrientationEvent;
openfl_events_StageOrientationEvent.__name__ = "openfl.events.StageOrientationEvent";
openfl_events_StageOrientationEvent.__super__ = openfl_events_Event;
openfl_events_StageOrientationEvent.prototype = $extend(openfl_events_Event.prototype,{
	beforeOrientation: null
	,afterOrientation: null
	,clone: function() {
		var event = new openfl_events_StageOrientationEvent(this.type,this.bubbles,this.cancelable,this.beforeOrientation,this.afterOrientation);
		event.target = this.target;
		event.currentTarget = this.currentTarget;
		event.eventPhase = this.eventPhase;
		return event;
	}
	,toString: function() {
		return this.__formatToString("StageOrientationEvent",["type","bubbles","cancelable","beforeOrientation","afterOrientation"]);
	}
	,__class__: openfl_events_StageOrientationEvent
});
var openfl_events_TimerEvent = function(type,bubbles,cancelable) {
	if(cancelable == null) {
		cancelable = false;
	}
	if(bubbles == null) {
		bubbles = false;
	}
	openfl_events_Event.call(this,type,bubbles,cancelable);
	this.__updateAfterEventFlag = false;
};
$hxClasses["openfl.events.TimerEvent"] = openfl_events_TimerEvent;
openfl_events_TimerEvent.__name__ = "openfl.events.TimerEvent";
openfl_events_TimerEvent.__super__ = openfl_events_Event;
openfl_events_TimerEvent.prototype = $extend(openfl_events_Event.prototype,{
	__updateAfterEventFlag: null
	,clone: function() {
		var event = new openfl_events_TimerEvent(this.type,this.bubbles,this.cancelable);
		event.target = this.target;
		event.currentTarget = this.currentTarget;
		event.eventPhase = this.eventPhase;
		return event;
	}
	,toString: function() {
		return this.__formatToString("TimerEvent",["type","bubbles","cancelable"]);
	}
	,updateAfterEvent: function() {
		this.__updateAfterEventFlag = true;
	}
	,__class__: openfl_events_TimerEvent
});
var openfl_events_TouchEvent = function(type,bubbles,cancelable,touchPointID,isPrimaryTouchPoint,localX,localY,sizeX,sizeY,pressure,relatedObject,ctrlKey,altKey,shiftKey,commandKey,controlKey,timestamp,touchIntent,samples,isTouchPointCanceled) {
	if(isTouchPointCanceled == null) {
		isTouchPointCanceled = false;
	}
	if(timestamp == null) {
		timestamp = 0;
	}
	if(controlKey == null) {
		controlKey = false;
	}
	if(commandKey == null) {
		commandKey = false;
	}
	if(shiftKey == null) {
		shiftKey = false;
	}
	if(altKey == null) {
		altKey = false;
	}
	if(ctrlKey == null) {
		ctrlKey = false;
	}
	if(pressure == null) {
		pressure = 0;
	}
	if(sizeY == null) {
		sizeY = 0;
	}
	if(sizeX == null) {
		sizeX = 0;
	}
	if(localY == null) {
		localY = 0;
	}
	if(localX == null) {
		localX = 0;
	}
	if(isPrimaryTouchPoint == null) {
		isPrimaryTouchPoint = false;
	}
	if(touchPointID == null) {
		touchPointID = 0;
	}
	if(cancelable == null) {
		cancelable = false;
	}
	if(bubbles == null) {
		bubbles = true;
	}
	openfl_events_Event.call(this,type,bubbles,cancelable);
	this.touchPointID = touchPointID;
	this.isPrimaryTouchPoint = isPrimaryTouchPoint;
	this.localX = localX;
	this.localY = localY;
	this.sizeX = sizeX;
	this.sizeY = sizeY;
	this.pressure = pressure;
	this.relatedObject = relatedObject;
	this.ctrlKey = ctrlKey;
	this.altKey = altKey;
	this.shiftKey = shiftKey;
	this.commandKey = commandKey;
	this.controlKey = controlKey;
	this.stageX = NaN;
	this.stageY = NaN;
	this.__updateAfterEventFlag = false;
};
$hxClasses["openfl.events.TouchEvent"] = openfl_events_TouchEvent;
openfl_events_TouchEvent.__name__ = "openfl.events.TouchEvent";
openfl_events_TouchEvent.__create = function(type,touch,stageX,stageY,local,target) {
	var evt = new openfl_events_TouchEvent(type,true,false,0,true,local.x,local.y,1,1,1);
	evt.stageX = stageX;
	evt.stageY = stageY;
	evt.target = target;
	return evt;
};
openfl_events_TouchEvent.__super__ = openfl_events_Event;
openfl_events_TouchEvent.prototype = $extend(openfl_events_Event.prototype,{
	altKey: null
	,commandKey: null
	,controlKey: null
	,ctrlKey: null
	,delta: null
	,isPrimaryTouchPoint: null
	,localX: null
	,localY: null
	,pressure: null
	,relatedObject: null
	,shiftKey: null
	,sizeX: null
	,sizeY: null
	,stageX: null
	,stageY: null
	,touchPointID: null
	,__updateAfterEventFlag: null
	,clone: function() {
		var event = new openfl_events_TouchEvent(this.type,this.bubbles,this.cancelable,this.touchPointID,this.isPrimaryTouchPoint,this.localX,this.localY,this.sizeX,this.sizeY,this.pressure,this.relatedObject,this.ctrlKey,this.altKey,this.shiftKey,this.commandKey,this.controlKey);
		event.target = this.target;
		event.currentTarget = this.currentTarget;
		event.eventPhase = this.eventPhase;
		return event;
	}
	,toString: function() {
		return this.__formatToString("TouchEvent",["type","bubbles","cancelable","touchPointID","isPrimaryTouchPoint","localX","localY","sizeX","sizeY","pressure","relatedObject","ctrlKey","altKey","shiftKey","commandKey","controlKey"]);
	}
	,updateAfterEvent: function() {
		this.__updateAfterEventFlag = true;
	}
	,__init: function() {
		openfl_events_Event.prototype.__init.call(this);
		this.bubbles = true;
		this.touchPointID = 0;
		this.isPrimaryTouchPoint = false;
		this.localX = 0;
		this.localY = 0;
		this.sizeX = 0;
		this.sizeY = 0;
		this.pressure = 0;
		this.relatedObject = null;
		this.ctrlKey = false;
		this.altKey = false;
		this.shiftKey = false;
		this.commandKey = false;
		this.controlKey = false;
		this.stageX = NaN;
		this.stageY = NaN;
		this.__updateAfterEventFlag = false;
	}
	,__class__: openfl_events_TouchEvent
});
var openfl_events_UncaughtErrorEvent = function(type,bubbles,cancelable,error) {
	if(cancelable == null) {
		cancelable = true;
	}
	if(bubbles == null) {
		bubbles = true;
	}
	openfl_events_ErrorEvent.call(this,type,bubbles,cancelable);
	this.error = error;
};
$hxClasses["openfl.events.UncaughtErrorEvent"] = openfl_events_UncaughtErrorEvent;
openfl_events_UncaughtErrorEvent.__name__ = "openfl.events.UncaughtErrorEvent";
openfl_events_UncaughtErrorEvent.__super__ = openfl_events_ErrorEvent;
openfl_events_UncaughtErrorEvent.prototype = $extend(openfl_events_ErrorEvent.prototype,{
	error: null
	,clone: function() {
		var event = new openfl_events_UncaughtErrorEvent(this.type,this.bubbles,this.cancelable,this.error);
		event.target = this.target;
		event.currentTarget = this.currentTarget;
		event.eventPhase = this.eventPhase;
		return event;
	}
	,toString: function() {
		return this.__formatToString("UncaughtErrorEvent",["type","bubbles","cancelable","error"]);
	}
	,__init: function() {
		openfl_events_ErrorEvent.prototype.__init.call(this);
		this.bubbles = true;
		this.cancelable = true;
		this.error = null;
	}
	,__class__: openfl_events_UncaughtErrorEvent
});
var openfl_events_UncaughtErrorEvents = function() {
	this.__enabled = true;
	openfl_events_EventDispatcher.call(this);
};
$hxClasses["openfl.events.UncaughtErrorEvents"] = openfl_events_UncaughtErrorEvents;
openfl_events_UncaughtErrorEvents.__name__ = "openfl.events.UncaughtErrorEvents";
openfl_events_UncaughtErrorEvents.__super__ = openfl_events_EventDispatcher;
openfl_events_UncaughtErrorEvents.prototype = $extend(openfl_events_EventDispatcher.prototype,{
	__enabled: null
	,addEventListener: function(type,listener,useCapture,priority,useWeakReference) {
		if(useWeakReference == null) {
			useWeakReference = false;
		}
		if(priority == null) {
			priority = 0;
		}
		if(useCapture == null) {
			useCapture = false;
		}
		openfl_events_EventDispatcher.prototype.addEventListener.call(this,type,listener,useCapture,priority,useWeakReference);
		if(Object.prototype.hasOwnProperty.call(this.__eventMap.h,"uncaughtError")) {
			this.__enabled = true;
		}
	}
	,removeEventListener: function(type,listener,useCapture) {
		if(useCapture == null) {
			useCapture = false;
		}
		openfl_events_EventDispatcher.prototype.removeEventListener.call(this,type,listener,useCapture);
		if(!Object.prototype.hasOwnProperty.call(this.__eventMap.h,"uncaughtError")) {
			this.__enabled = false;
		}
	}
	,__class__: openfl_events_UncaughtErrorEvents
});
var openfl_external_ExternalInterface = function() { };
$hxClasses["openfl.external.ExternalInterface"] = openfl_external_ExternalInterface;
openfl_external_ExternalInterface.__name__ = "openfl.external.ExternalInterface";
openfl_external_ExternalInterface.__properties__ = {get_objectID:"get_objectID"};
openfl_external_ExternalInterface.addCallback = function(functionName,closure) {
	if(openfl_utils__$internal_Lib.application.__window.element != null) {
		openfl_utils__$internal_Lib.application.__window.element[functionName] = closure;
	}
};
openfl_external_ExternalInterface.call = function(functionName,p1,p2,p3,p4,p5) {
	var callResponse = null;
	if(!new EReg("^\\(.+\\)$","").match(functionName)) {
		var thisArg = functionName.split(".").slice(0,-1).join(".");
		if(thisArg.length > 0) {
			functionName += ".bind(" + thisArg + ")";
		}
	}
	var fn;
	try {
		fn = eval(functionName);
	} catch( _g ) {
		haxe_NativeStackTrace.lastError = _g;
		return null;
	}
	if(Type.typeof(fn) != ValueType.TFunction) {
		return null;
	}
	if(p1 == null) {
		callResponse = fn();
	} else if(p2 == null) {
		callResponse = fn(p1);
	} else if(p3 == null) {
		callResponse = fn(p1,p2);
	} else if(p4 == null) {
		callResponse = fn(p1,p2,p3);
	} else if(p5 == null) {
		callResponse = fn(p1,p2,p3,p4);
	} else {
		callResponse = fn(p1,p2,p3,p4,p5);
	}
	return callResponse;
};
openfl_external_ExternalInterface.get_objectID = function() {
	if(openfl_utils__$internal_Lib.application != null && openfl_utils__$internal_Lib.application.__window != null && openfl_utils__$internal_Lib.application.__window.element != null) {
		return openfl_utils__$internal_Lib.application.__window.element.id;
	}
	return null;
};
var openfl_filters_BitmapFilter = function() {
	this.__bottomExtension = 0;
	this.__leftExtension = 0;
	this.__needSecondBitmapData = true;
	this.__numShaderPasses = 0;
	this.__preserveObject = false;
	this.__rightExtension = 0;
	this.__shaderBlendMode = 10;
	this.__topExtension = 0;
	this.__smooth = true;
};
$hxClasses["openfl.filters.BitmapFilter"] = openfl_filters_BitmapFilter;
openfl_filters_BitmapFilter.__name__ = "openfl.filters.BitmapFilter";
openfl_filters_BitmapFilter.prototype = {
	__bottomExtension: null
	,__leftExtension: null
	,__needSecondBitmapData: null
	,__numShaderPasses: null
	,__preserveObject: null
	,__renderDirty: null
	,__rightExtension: null
	,__shaderBlendMode: null
	,__smooth: null
	,__topExtension: null
	,clone: function() {
		return new openfl_filters_BitmapFilter();
	}
	,__applyFilter: function(bitmapData,sourceBitmapData,sourceRect,destPoint) {
		return sourceBitmapData;
	}
	,__initShader: function(renderer,pass,sourceBitmapData) {
		return null;
	}
	,__class__: openfl_filters_BitmapFilter
};
var openfl_filters_BitmapFilterShader = function(code) {
	if(this.__glFragmentSource == null) {
		this.__glFragmentSource = "varying vec2 openfl_TextureCoordv;\n\n\t\tuniform sampler2D openfl_Texture;\n\t\tuniform vec2 openfl_TextureSize;\n\n\t\tvoid main(void) {\n\n\t\t\tgl_FragColor = texture2D (openfl_Texture, openfl_TextureCoordv);\n\n\t\t}";
	}
	if(this.__glVertexSource == null) {
		this.__glVertexSource = "attribute vec4 openfl_Position;\n\t\tattribute vec2 openfl_TextureCoord;\n\n\t\tvarying vec2 openfl_TextureCoordv;\n\n\t\tuniform mat4 openfl_Matrix;\n\t\tuniform vec2 openfl_TextureSize;\n\n\t\tvoid main(void) {\n\n\t\t\topenfl_TextureCoordv = openfl_TextureCoord;\n\n\t\tgl_Position = openfl_Matrix * openfl_Position;\n\n\t\t}";
	}
	openfl_display_Shader.call(this,code);
	this.__isGenerated = true;
	this.__initGL();
};
$hxClasses["openfl.filters.BitmapFilterShader"] = openfl_filters_BitmapFilterShader;
openfl_filters_BitmapFilterShader.__name__ = "openfl.filters.BitmapFilterShader";
openfl_filters_BitmapFilterShader.__super__ = openfl_display_Shader;
openfl_filters_BitmapFilterShader.prototype = $extend(openfl_display_Shader.prototype,{
	openfl_Position: null
	,openfl_TextureCoord: null
	,openfl_Matrix: null
	,openfl_TextureSize: null
	,openfl_Texture: null
	,__class__: openfl_filters_BitmapFilterShader
});
var openfl_filters__$BlurFilter_BlurShader = function() {
	if(this.__glFragmentSource == null) {
		this.__glFragmentSource = "uniform sampler2D openfl_Texture;\n\n\t\tvarying vec2 vBlurCoords[7];\n\n\t\tvoid main(void) {\n\n\t\t\tvec4 sum = vec4(0.0);\n\t\t\tsum += texture2D(openfl_Texture, vBlurCoords[0]) * 0.00443;\n\t\t\tsum += texture2D(openfl_Texture, vBlurCoords[1]) * 0.05399;\n\t\t\tsum += texture2D(openfl_Texture, vBlurCoords[2]) * 0.24197;\n\t\t\tsum += texture2D(openfl_Texture, vBlurCoords[3]) * 0.39894;\n\t\t\tsum += texture2D(openfl_Texture, vBlurCoords[4]) * 0.24197;\n\t\t\tsum += texture2D(openfl_Texture, vBlurCoords[5]) * 0.05399;\n\t\t\tsum += texture2D(openfl_Texture, vBlurCoords[6]) * 0.00443;\n\n\t\t\tgl_FragColor = sum;\n\n\t\t}";
	}
	if(this.__glVertexSource == null) {
		this.__glVertexSource = "attribute vec4 openfl_Position;\n\t\tattribute vec2 openfl_TextureCoord;\n\n\t\tuniform mat4 openfl_Matrix;\n\n\t\tuniform vec2 uRadius;\n\t\tvarying vec2 vBlurCoords[7];\n\t\tuniform vec2 uTextureSize;\n\n\t\tvoid main(void) {\n\n\t\t\tgl_Position = openfl_Matrix * openfl_Position;\n\n\t\t\tvec2 r = uRadius / uTextureSize;\n\t\t\tvBlurCoords[0] = openfl_TextureCoord - r;\n\t\t\tvBlurCoords[1] = openfl_TextureCoord - r * 0.75;\n\t\t\tvBlurCoords[2] = openfl_TextureCoord - r * 0.5;\n\t\t\tvBlurCoords[3] = openfl_TextureCoord;\n\t\t\tvBlurCoords[4] = openfl_TextureCoord + r * 0.5;\n\t\t\tvBlurCoords[5] = openfl_TextureCoord + r * 0.75;\n\t\t\tvBlurCoords[6] = openfl_TextureCoord + r;\n\n\t\t}";
	}
	openfl_filters_BitmapFilterShader.call(this);
	this.uRadius.value = [0,0];
	this.__isGenerated = true;
	this.__initGL();
};
$hxClasses["openfl.filters._BlurFilter.BlurShader"] = openfl_filters__$BlurFilter_BlurShader;
openfl_filters__$BlurFilter_BlurShader.__name__ = "openfl.filters._BlurFilter.BlurShader";
openfl_filters__$BlurFilter_BlurShader.__super__ = openfl_filters_BitmapFilterShader;
openfl_filters__$BlurFilter_BlurShader.prototype = $extend(openfl_filters_BitmapFilterShader.prototype,{
	__update: function() {
		this.uTextureSize.value = [this.__texture.input.width,this.__texture.input.height];
		openfl_filters_BitmapFilterShader.prototype.__update.call(this);
	}
	,uRadius: null
	,uTextureSize: null
	,__class__: openfl_filters__$BlurFilter_BlurShader
});
var openfl_filters_BlurFilter = function(blurX,blurY,quality) {
	if(quality == null) {
		quality = 1;
	}
	if(blurY == null) {
		blurY = 4;
	}
	if(blurX == null) {
		blurX = 4;
	}
	openfl_filters_BitmapFilter.call(this);
	this.set_blurX(blurX);
	this.set_blurY(blurY);
	this.set_quality(quality);
	this.__needSecondBitmapData = true;
	this.__preserveObject = false;
	this.__renderDirty = true;
};
$hxClasses["openfl.filters.BlurFilter"] = openfl_filters_BlurFilter;
openfl_filters_BlurFilter.__name__ = "openfl.filters.BlurFilter";
openfl_filters_BlurFilter.__super__ = openfl_filters_BitmapFilter;
openfl_filters_BlurFilter.prototype = $extend(openfl_filters_BitmapFilter.prototype,{
	__blurX: null
	,__blurY: null
	,__horizontalPasses: null
	,__quality: null
	,__verticalPasses: null
	,clone: function() {
		return new openfl_filters_BlurFilter(this.__blurX,this.__blurY,this.__quality);
	}
	,__applyFilter: function(bitmapData,sourceBitmapData,sourceRect,destPoint) {
		var time = new Date().getTime() / 1000;
		var finalImage = lime__$internal_graphics_ImageDataUtil.gaussianBlur(bitmapData.image,sourceBitmapData.image,sourceRect.__toLimeRectangle(),destPoint.__toLimeVector2(),this.__blurX,this.__blurY,this.__quality);
		var elapsed = new Date().getTime() / 1000 - time;
		if(finalImage == bitmapData.image) {
			return bitmapData;
		}
		return sourceBitmapData;
	}
	,__initShader: function(renderer,pass,sourceBitmapData) {
		if(pass < this.__horizontalPasses) {
			var scale = Math.pow(0.5,pass >> 1);
			openfl_filters_BlurFilter.__blurShader.uRadius.value[0] = this.get_blurX() * scale;
			openfl_filters_BlurFilter.__blurShader.uRadius.value[1] = 0;
		} else {
			var scale = Math.pow(0.5,pass - this.__horizontalPasses >> 1);
			openfl_filters_BlurFilter.__blurShader.uRadius.value[0] = 0;
			openfl_filters_BlurFilter.__blurShader.uRadius.value[1] = this.get_blurY() * scale;
		}
		return openfl_filters_BlurFilter.__blurShader;
	}
	,__padFor: function(value) {
		if(value <= 0) {
			return 0;
		}
		var passes = this.__quality > 0 ? this.__quality : 1;
		var reach = value * passes * 3.0;
		return (Math.ceil(reach) | 0) + 2;
	}
	,get_blurX: function() {
		return this.__blurX;
	}
	,set_blurX: function(value) {
		if(value != this.__blurX) {
			this.__blurX = value;
			this.__renderDirty = true;
			var p;
			if(value <= 0) {
				p = 0;
			} else {
				var passes = this.__quality > 0 ? this.__quality : 1;
				var reach = value * passes * 3.0;
				p = (Math.ceil(reach) | 0) + 2;
			}
			this.__leftExtension = p;
			this.__rightExtension = p;
		}
		return value;
	}
	,get_blurY: function() {
		return this.__blurY;
	}
	,set_blurY: function(value) {
		if(value != this.__blurY) {
			this.__blurY = value;
			this.__renderDirty = true;
			var p;
			if(value <= 0) {
				p = 0;
			} else {
				var passes = this.__quality > 0 ? this.__quality : 1;
				var reach = value * passes * 3.0;
				p = (Math.ceil(reach) | 0) + 2;
			}
			this.__topExtension = p;
			this.__bottomExtension = p;
		}
		return value;
	}
	,get_quality: function() {
		return this.__quality;
	}
	,set_quality: function(value) {
		this.__horizontalPasses = this.__blurX <= 0 ? 0 : Math.round(this.__blurX * (value / 4)) + 1;
		this.__verticalPasses = this.__blurY <= 0 ? 0 : Math.round(this.__blurY * (value / 4)) + 1;
		this.__numShaderPasses = this.__horizontalPasses + this.__verticalPasses;
		if(value != this.__quality) {
			this.__renderDirty = true;
		}
		this.__quality = value;
		this.set_blurX(this.__blurX);
		this.set_blurY(this.__blurY);
		return this.__quality;
	}
	,__class__: openfl_filters_BlurFilter
	,__properties__: {set_quality:"set_quality",get_quality:"get_quality",set_blurY:"set_blurY",get_blurY:"get_blurY",set_blurX:"set_blurX",get_blurX:"get_blurX"}
});
var openfl_filters__$DropShadowFilter_HideShader = function() {
	if(this.__glFragmentSource == null) {
		this.__glFragmentSource = "\n\t\tuniform sampler2D openfl_Texture;\n\t\tuniform sampler2D sourceBitmap;\n\t\tvarying vec4 textureCoords;\n\n\t\tvoid main(void) {\n\t\t\tgl_FragColor = texture2D(openfl_Texture, textureCoords.zw);\n\t\t}\n\t";
	}
	if(this.__glVertexSource == null) {
		this.__glVertexSource = "attribute vec4 openfl_Position;\n\t\tattribute vec2 openfl_TextureCoord;\n\t\tuniform mat4 openfl_Matrix;\n\t\tuniform vec2 openfl_TextureSize;\n\t\tuniform vec2 offset;\n\t\tvarying vec4 textureCoords;\n\n\t\tvoid main(void) {\n\t\t\tgl_Position = openfl_Matrix * openfl_Position;\n\t\t\ttextureCoords = vec4(openfl_TextureCoord, openfl_TextureCoord - offset / openfl_TextureSize);\n\t\t}\n\t";
	}
	openfl_filters_BitmapFilterShader.call(this);
	this.offset.value = [0,0];
	this.__isGenerated = true;
	this.__initGL();
};
$hxClasses["openfl.filters._DropShadowFilter.HideShader"] = openfl_filters__$DropShadowFilter_HideShader;
openfl_filters__$DropShadowFilter_HideShader.__name__ = "openfl.filters._DropShadowFilter.HideShader";
openfl_filters__$DropShadowFilter_HideShader.__super__ = openfl_filters_BitmapFilterShader;
openfl_filters__$DropShadowFilter_HideShader.prototype = $extend(openfl_filters_BitmapFilterShader.prototype,{
	offset: null
	,sourceBitmap: null
	,__class__: openfl_filters__$DropShadowFilter_HideShader
});
var openfl_filters_DropShadowFilter = function(distance,angle,color,alpha,blurX,blurY,strength,quality,inner,knockout,hideObject) {
	if(hideObject == null) {
		hideObject = false;
	}
	if(knockout == null) {
		knockout = false;
	}
	if(inner == null) {
		inner = false;
	}
	if(quality == null) {
		quality = 1;
	}
	if(strength == null) {
		strength = 1;
	}
	if(blurY == null) {
		blurY = 4;
	}
	if(blurX == null) {
		blurX = 4;
	}
	if(alpha == null) {
		alpha = 1;
	}
	if(color == null) {
		color = 0;
	}
	if(angle == null) {
		angle = 45;
	}
	if(distance == null) {
		distance = 4;
	}
	openfl_filters_BitmapFilter.call(this);
	this.__offsetX = 0;
	this.__offsetY = 0;
	this.__distance = distance;
	this.__angle = angle;
	this.__color = color;
	this.__alpha = alpha;
	this.__blurX = blurX;
	this.__blurY = blurY;
	this.__strength = strength;
	this.__quality = quality;
	this.__inner = inner;
	this.__knockout = knockout;
	this.__hideObject = hideObject;
	this.__updateSize();
	this.__needSecondBitmapData = true;
	this.__preserveObject = true;
	this.__renderDirty = true;
};
$hxClasses["openfl.filters.DropShadowFilter"] = openfl_filters_DropShadowFilter;
openfl_filters_DropShadowFilter.__name__ = "openfl.filters.DropShadowFilter";
openfl_filters_DropShadowFilter.__super__ = openfl_filters_BitmapFilter;
openfl_filters_DropShadowFilter.prototype = $extend(openfl_filters_BitmapFilter.prototype,{
	__alpha: null
	,__angle: null
	,__blurX: null
	,__blurY: null
	,__color: null
	,__distance: null
	,__hideObject: null
	,__horizontalPasses: null
	,__inner: null
	,__knockout: null
	,__offsetX: null
	,__offsetY: null
	,__quality: null
	,__strength: null
	,__verticalPasses: null
	,clone: function() {
		return new openfl_filters_DropShadowFilter(this.__distance,this.__angle,this.__color,this.__alpha,this.__blurX,this.__blurY,this.__strength,this.__quality,this.__inner,this.__knockout,this.__hideObject);
	}
	,__applyFilter: function(bitmapData,sourceBitmapData,sourceRect,destPoint) {
		var r = this.__color >> 16 & 255;
		var g = this.__color >> 8 & 255;
		var b = this.__color & 255;
		var point = new openfl_geom_Point(destPoint.x + this.__offsetX,destPoint.y + this.__offsetY);
		var finalImage = lime__$internal_graphics_ImageDataUtil.gaussianBlur(bitmapData.image,sourceBitmapData.image,sourceRect.__toLimeRectangle(),point.__toLimeVector2(),this.__blurX,this.__blurY,this.__quality,this.__strength);
		finalImage.colorTransform(finalImage.get_rect(),new openfl_geom_ColorTransform(0,0,0,this.__alpha,r,g,b,0).__toLimeColorMatrix());
		if(finalImage == bitmapData.image) {
			return bitmapData;
		}
		return sourceBitmapData;
	}
	,__initShader: function(renderer,pass,sourceBitmapData) {
		if(this.__inner && pass == 0) {
			return openfl_filters_GlowFilter.__invertAlphaShader;
		}
		var blurPass = pass - (this.__inner ? 1 : 0);
		var numBlurPasses = this.__horizontalPasses + this.__verticalPasses;
		if(blurPass < numBlurPasses) {
			var shader = openfl_filters_GlowFilter.__blurAlphaShader;
			if(blurPass < this.__horizontalPasses) {
				var scale = Math.pow(0.5,blurPass >> 1) * 0.5;
				shader.uRadius.value[0] = this.get_blurX() * scale;
				shader.uRadius.value[1] = 0;
			} else {
				var scale = Math.pow(0.5,blurPass - this.__horizontalPasses >> 1) * 0.5;
				shader.uRadius.value[0] = 0;
				shader.uRadius.value[1] = this.get_blurY() * scale;
			}
			shader.uColor.value[0] = (this.get_color() >> 16 & 255) / 255;
			shader.uColor.value[1] = (this.get_color() >> 8 & 255) / 255;
			shader.uColor.value[2] = (this.get_color() & 255) / 255;
			shader.uColor.value[3] = this.get_alpha();
			shader.uStrength.value[0] = blurPass == numBlurPasses - 1 ? this.__strength : 1.0;
			return shader;
		}
		if(this.__inner) {
			if(this.__knockout || this.__hideObject) {
				var shader = openfl_filters_GlowFilter.__innerCombineKnockoutShader;
				shader.sourceBitmap.input = sourceBitmapData;
				shader.offset.value[0] = this.__offsetX;
				shader.offset.value[1] = this.__offsetY;
				return shader;
			}
			var shader = openfl_filters_GlowFilter.__innerCombineShader;
			shader.sourceBitmap.input = sourceBitmapData;
			shader.offset.value[0] = this.__offsetX;
			shader.offset.value[1] = this.__offsetY;
			return shader;
		} else {
			if(this.__knockout) {
				var shader = openfl_filters_GlowFilter.__combineKnockoutShader;
				shader.sourceBitmap.input = sourceBitmapData;
				shader.offset.value[0] = this.__offsetX;
				shader.offset.value[1] = this.__offsetY;
				return shader;
			} else if(this.__hideObject) {
				var shader = openfl_filters_DropShadowFilter.__hideShader;
				shader.sourceBitmap.input = sourceBitmapData;
				shader.offset.value[0] = this.__offsetX;
				shader.offset.value[1] = this.__offsetY;
				return shader;
			}
			var shader = openfl_filters_GlowFilter.__combineShader;
			shader.sourceBitmap.input = sourceBitmapData;
			shader.offset.value[0] = this.__offsetX;
			shader.offset.value[1] = this.__offsetY;
			return shader;
		}
	}
	,__updateSize: function() {
		this.__offsetX = this.__distance * Math.cos(this.__angle * Math.PI / 180) | 0;
		this.__offsetY = this.__distance * Math.sin(this.__angle * Math.PI / 180) | 0;
		this.__topExtension = Math.ceil((this.__offsetY < 0 ? -this.__offsetY : 0) + this.__blurY);
		this.__bottomExtension = Math.ceil((this.__offsetY > 0 ? this.__offsetY : 0) + this.__blurY);
		this.__leftExtension = Math.ceil((this.__offsetX < 0 ? -this.__offsetX : 0) + this.__blurX);
		this.__rightExtension = Math.ceil((this.__offsetX > 0 ? this.__offsetX : 0) + this.__blurX);
		this.__calculateNumShaderPasses();
	}
	,__calculateNumShaderPasses: function() {
		this.__horizontalPasses = this.__blurX <= 0 ? 0 : Math.round(this.__blurX * (this.__quality / 4)) + 1;
		this.__verticalPasses = this.__blurY <= 0 ? 0 : Math.round(this.__blurY * (this.__quality / 4)) + 1;
		this.__numShaderPasses = this.__horizontalPasses + this.__verticalPasses + (this.__inner ? 2 : 1);
	}
	,get_alpha: function() {
		return this.__alpha;
	}
	,set_alpha: function(value) {
		if(value != this.__alpha) {
			this.__renderDirty = true;
		}
		return this.__alpha = value;
	}
	,get_angle: function() {
		return this.__angle;
	}
	,set_angle: function(value) {
		if(value != this.__angle) {
			this.__angle = value;
			this.__renderDirty = true;
			this.__updateSize();
		}
		return value;
	}
	,get_blurX: function() {
		return this.__blurX;
	}
	,set_blurX: function(value) {
		if(value != this.__blurX) {
			this.__blurX = value;
			this.__renderDirty = true;
			this.__updateSize();
		}
		return value;
	}
	,get_blurY: function() {
		return this.__blurY;
	}
	,set_blurY: function(value) {
		if(value != this.__blurY) {
			this.__blurY = value;
			this.__renderDirty = true;
			this.__updateSize();
		}
		return value;
	}
	,get_color: function() {
		return this.__color;
	}
	,set_color: function(value) {
		if(value != this.__color) {
			this.__renderDirty = true;
		}
		return this.__color = value;
	}
	,get_distance: function() {
		return this.__distance;
	}
	,set_distance: function(value) {
		if(value != this.__distance) {
			this.__distance = value;
			this.__renderDirty = true;
			this.__updateSize();
		}
		return value;
	}
	,get_hideObject: function() {
		return this.__hideObject;
	}
	,set_hideObject: function(value) {
		if(value != this.__hideObject) {
			this.__renderDirty = true;
		}
		return this.__hideObject = value;
	}
	,get_inner: function() {
		return this.__inner;
	}
	,set_inner: function(value) {
		if(value != this.__inner) {
			this.__renderDirty = true;
		}
		return this.__inner = value;
	}
	,get_knockout: function() {
		return this.__knockout;
	}
	,set_knockout: function(value) {
		if(value != this.__knockout) {
			this.__renderDirty = true;
		}
		return this.__knockout = value;
	}
	,get_quality: function() {
		return this.__quality;
	}
	,set_quality: function(value) {
		if(value != this.__quality) {
			this.__renderDirty = true;
		}
		return this.__quality = value;
	}
	,get_strength: function() {
		return this.__strength;
	}
	,set_strength: function(value) {
		if(value != this.__strength) {
			this.__renderDirty = true;
		}
		return this.__strength = value;
	}
	,__class__: openfl_filters_DropShadowFilter
	,__properties__: {set_strength:"set_strength",get_strength:"get_strength",set_quality:"set_quality",get_quality:"get_quality",set_knockout:"set_knockout",get_knockout:"get_knockout",set_inner:"set_inner",get_inner:"get_inner",set_hideObject:"set_hideObject",get_hideObject:"get_hideObject",set_distance:"set_distance",get_distance:"get_distance",set_color:"set_color",get_color:"get_color",set_blurY:"set_blurY",get_blurY:"get_blurY",set_blurX:"set_blurX",get_blurX:"get_blurX",set_angle:"set_angle",get_angle:"get_angle",set_alpha:"set_alpha",get_alpha:"get_alpha"}
});
var openfl_filters__$GlowFilter_BlurAlphaShader = function() {
	if(this.__glFragmentSource == null) {
		this.__glFragmentSource = "\n\t\tuniform sampler2D openfl_Texture;\n\t\tuniform vec4 uColor;\n\t\tuniform float uStrength;\n\t\tvarying vec2 vTexCoord;\n\t\tvarying vec2 vBlurCoords[6];\n\n\t\tvoid main(void)\n\t\t{\n            vec4 texel = texture2D(openfl_Texture, vTexCoord);\n\n            vec3 contributions = vec3(0.00443, 0.05399, 0.24197);\n            vec3 top = vec3(\n                texture2D(openfl_Texture, vBlurCoords[0]).a,\n                texture2D(openfl_Texture, vBlurCoords[1]).a,\n                texture2D(openfl_Texture, vBlurCoords[2]).a\n            );\n            vec3 bottom = vec3(\n                texture2D(openfl_Texture, vBlurCoords[3]).a,\n                texture2D(openfl_Texture, vBlurCoords[4]).a,\n                texture2D(openfl_Texture, vBlurCoords[5]).a\n            );\n\n            float a = texel.a * 0.39894;\n\t\t\ta += dot(top, contributions.xyz);\n            a += dot(bottom, contributions.zyx);\n\n\t\t\tgl_FragColor = uColor * clamp(a * uStrength, 0.0, 1.0);\n\t\t}\n\t";
	}
	if(this.__glVertexSource == null) {
		this.__glVertexSource = "\n\t\tattribute vec4 openfl_Position;\n\t\tattribute vec2 openfl_TextureCoord;\n\n\t\tuniform mat4 openfl_Matrix;\n\t\tuniform vec2 openfl_TextureSize;\n\n\t\tuniform vec2 uRadius;\n\t\tvarying vec2 vTexCoord;\n\t\tvarying vec2 vBlurCoords[6];\n\n\t\tvoid main(void) {\n\n\t\t\tgl_Position = openfl_Matrix * openfl_Position;\n\t\t\tvTexCoord = openfl_TextureCoord;\n\n\t\t\tvec3 offset = vec3(0.5, 0.75, 1.0);\n\t\t\tvec2 r = uRadius / openfl_TextureSize;\n\t\t\tvBlurCoords[0] = openfl_TextureCoord - r * offset.z;\n\t\t\tvBlurCoords[1] = openfl_TextureCoord - r * offset.y;\n\t\t\tvBlurCoords[2] = openfl_TextureCoord - r * offset.x;\n\t\t\tvBlurCoords[3] = openfl_TextureCoord + r * offset.x;\n\t\t\tvBlurCoords[4] = openfl_TextureCoord + r * offset.y;\n\t\t\tvBlurCoords[5] = openfl_TextureCoord + r * offset.z;\n\t\t}\n\t";
	}
	openfl_filters_BitmapFilterShader.call(this);
	this.uRadius.value = [0,0];
	this.uColor.value = [0,0,0,0];
	this.uStrength.value = [1];
	this.__isGenerated = true;
	this.__initGL();
};
$hxClasses["openfl.filters._GlowFilter.BlurAlphaShader"] = openfl_filters__$GlowFilter_BlurAlphaShader;
openfl_filters__$GlowFilter_BlurAlphaShader.__name__ = "openfl.filters._GlowFilter.BlurAlphaShader";
openfl_filters__$GlowFilter_BlurAlphaShader.__super__ = openfl_filters_BitmapFilterShader;
openfl_filters__$GlowFilter_BlurAlphaShader.prototype = $extend(openfl_filters_BitmapFilterShader.prototype,{
	uRadius: null
	,uColor: null
	,uStrength: null
	,__class__: openfl_filters__$GlowFilter_BlurAlphaShader
});
var openfl_filters__$GlowFilter_CombineKnockoutShader = function() {
	if(this.__glFragmentSource == null) {
		this.__glFragmentSource = "\n\t\tuniform sampler2D openfl_Texture;\n\t\tuniform sampler2D sourceBitmap;\n\t\tvarying vec4 textureCoords;\n\n\t\tvoid main(void) {\n\t\t\tvec4 src = texture2D(sourceBitmap, textureCoords.xy);\n\t\t\tvec4 glow = texture2D(openfl_Texture, textureCoords.zw);\n\n\t\t\tgl_FragColor = glow * (1.0 - src.a);\n\t\t}\n\t";
	}
	if(this.__glVertexSource == null) {
		this.__glVertexSource = "attribute vec4 openfl_Position;\n\t\tattribute vec2 openfl_TextureCoord;\n\t\tuniform mat4 openfl_Matrix;\n\t\tuniform vec2 openfl_TextureSize;\n\t\tuniform vec2 offset;\n\t\tvarying vec4 textureCoords;\n\n\t\tvoid main(void) {\n\t\t\tgl_Position = openfl_Matrix * openfl_Position;\n\t\t\ttextureCoords = vec4(openfl_TextureCoord, openfl_TextureCoord - offset / openfl_TextureSize);\n\t\t}\n\t";
	}
	openfl_filters_BitmapFilterShader.call(this);
	this.offset.value = [0,0];
	this.__isGenerated = true;
	this.__initGL();
};
$hxClasses["openfl.filters._GlowFilter.CombineKnockoutShader"] = openfl_filters__$GlowFilter_CombineKnockoutShader;
openfl_filters__$GlowFilter_CombineKnockoutShader.__name__ = "openfl.filters._GlowFilter.CombineKnockoutShader";
openfl_filters__$GlowFilter_CombineKnockoutShader.__super__ = openfl_filters_BitmapFilterShader;
openfl_filters__$GlowFilter_CombineKnockoutShader.prototype = $extend(openfl_filters_BitmapFilterShader.prototype,{
	offset: null
	,sourceBitmap: null
	,__class__: openfl_filters__$GlowFilter_CombineKnockoutShader
});
var openfl_filters__$GlowFilter_CombineShader = function() {
	if(this.__glFragmentSource == null) {
		this.__glFragmentSource = "\n\t\tuniform sampler2D openfl_Texture;\n\t\tuniform sampler2D sourceBitmap;\n\t\tvarying vec4 textureCoords;\n\n\t\tvoid main(void) {\n\t\t\tvec4 src = texture2D(sourceBitmap, textureCoords.xy);\n\t\t\tvec4 glow = texture2D(openfl_Texture, textureCoords.zw);\n\n\t\t\tgl_FragColor = src + glow * (1.0 - src.a);\n\t\t}\n\t";
	}
	if(this.__glVertexSource == null) {
		this.__glVertexSource = "attribute vec4 openfl_Position;\n\t\tattribute vec2 openfl_TextureCoord;\n\t\tuniform mat4 openfl_Matrix;\n\t\tuniform vec2 openfl_TextureSize;\n\t\tuniform vec2 offset;\n\t\tvarying vec4 textureCoords;\n\n\t\tvoid main(void) {\n\t\t\tgl_Position = openfl_Matrix * openfl_Position;\n\t\t\ttextureCoords = vec4(openfl_TextureCoord, openfl_TextureCoord - offset / openfl_TextureSize);\n\t\t}\n\t";
	}
	openfl_filters_BitmapFilterShader.call(this);
	this.offset.value = [0,0];
	this.__isGenerated = true;
	this.__initGL();
};
$hxClasses["openfl.filters._GlowFilter.CombineShader"] = openfl_filters__$GlowFilter_CombineShader;
openfl_filters__$GlowFilter_CombineShader.__name__ = "openfl.filters._GlowFilter.CombineShader";
openfl_filters__$GlowFilter_CombineShader.__super__ = openfl_filters_BitmapFilterShader;
openfl_filters__$GlowFilter_CombineShader.prototype = $extend(openfl_filters_BitmapFilterShader.prototype,{
	offset: null
	,sourceBitmap: null
	,__class__: openfl_filters__$GlowFilter_CombineShader
});
var openfl_filters__$GlowFilter_InnerCombineKnockoutShader = function() {
	if(this.__glFragmentSource == null) {
		this.__glFragmentSource = "\n\t\tuniform sampler2D openfl_Texture;\n\t\tuniform sampler2D sourceBitmap;\n\t\tvarying vec4 textureCoords;\n\n\t\tvoid main(void) {\n\t\t\tvec4 src = texture2D(sourceBitmap, textureCoords.xy);\n\t\t\tvec4 glow = texture2D(openfl_Texture, textureCoords.zw);\n\n\t\t\tgl_FragColor = glow * src.a;\n\t\t}\n\t";
	}
	if(this.__glVertexSource == null) {
		this.__glVertexSource = "attribute vec4 openfl_Position;\n\t\tattribute vec2 openfl_TextureCoord;\n\t\tuniform mat4 openfl_Matrix;\n\t\tuniform vec2 openfl_TextureSize;\n\t\tuniform vec2 offset;\n\t\tvarying vec4 textureCoords;\n\n\t\tvoid main(void) {\n\t\t\tgl_Position = openfl_Matrix * openfl_Position;\n\t\t\ttextureCoords = vec4(openfl_TextureCoord, openfl_TextureCoord - offset / openfl_TextureSize);\n\t\t}\n\t";
	}
	openfl_filters_BitmapFilterShader.call(this);
	this.offset.value = [0,0];
	this.__isGenerated = true;
	this.__initGL();
};
$hxClasses["openfl.filters._GlowFilter.InnerCombineKnockoutShader"] = openfl_filters__$GlowFilter_InnerCombineKnockoutShader;
openfl_filters__$GlowFilter_InnerCombineKnockoutShader.__name__ = "openfl.filters._GlowFilter.InnerCombineKnockoutShader";
openfl_filters__$GlowFilter_InnerCombineKnockoutShader.__super__ = openfl_filters_BitmapFilterShader;
openfl_filters__$GlowFilter_InnerCombineKnockoutShader.prototype = $extend(openfl_filters_BitmapFilterShader.prototype,{
	offset: null
	,sourceBitmap: null
	,__class__: openfl_filters__$GlowFilter_InnerCombineKnockoutShader
});
var openfl_filters__$GlowFilter_InnerCombineShader = function() {
	if(this.__glFragmentSource == null) {
		this.__glFragmentSource = "\n\t\tuniform sampler2D openfl_Texture;\n\t\tuniform sampler2D sourceBitmap;\n\t\tvarying vec4 textureCoords;\n\n\t\tvoid main(void) {\n\t\t\tvec4 src = texture2D(sourceBitmap, textureCoords.xy);\n\t\t\tvec4 glow = texture2D(openfl_Texture, textureCoords.zw);\n\n\t\t\tgl_FragColor = vec4((src.rgb * (1.0 - glow.a)) + (glow.rgb * src.a), src.a);\n\t\t}\n\t";
	}
	if(this.__glVertexSource == null) {
		this.__glVertexSource = "attribute vec4 openfl_Position;\n\t\tattribute vec2 openfl_TextureCoord;\n\t\tuniform mat4 openfl_Matrix;\n\t\tuniform vec2 openfl_TextureSize;\n\t\tuniform vec2 offset;\n\t\tvarying vec4 textureCoords;\n\n\t\tvoid main(void) {\n\t\t\tgl_Position = openfl_Matrix * openfl_Position;\n\t\t\ttextureCoords = vec4(openfl_TextureCoord, openfl_TextureCoord - offset / openfl_TextureSize);\n\t\t}\n\t";
	}
	openfl_filters_BitmapFilterShader.call(this);
	this.offset.value = [0,0];
	this.__isGenerated = true;
	this.__initGL();
};
$hxClasses["openfl.filters._GlowFilter.InnerCombineShader"] = openfl_filters__$GlowFilter_InnerCombineShader;
openfl_filters__$GlowFilter_InnerCombineShader.__name__ = "openfl.filters._GlowFilter.InnerCombineShader";
openfl_filters__$GlowFilter_InnerCombineShader.__super__ = openfl_filters_BitmapFilterShader;
openfl_filters__$GlowFilter_InnerCombineShader.prototype = $extend(openfl_filters_BitmapFilterShader.prototype,{
	offset: null
	,sourceBitmap: null
	,__class__: openfl_filters__$GlowFilter_InnerCombineShader
});
var openfl_filters__$GlowFilter_InvertAlphaShader = function() {
	if(this.__glFragmentSource == null) {
		this.__glFragmentSource = "\n\t\tuniform sampler2D openfl_Texture;\n\t\tvarying vec2 vTexCoord;\n\n\t\tvoid main(void) {\n\t\t\tvec4 texel = texture2D(openfl_Texture, vTexCoord);\n\t\t\tgl_FragColor = vec4(texel.rgb, 1.0 - texel.a);\n\t\t}\n\t";
	}
	if(this.__glVertexSource == null) {
		this.__glVertexSource = "\n\t\tattribute vec4 openfl_Position;\n\t\tattribute vec2 openfl_TextureCoord;\n\t\tuniform mat4 openfl_Matrix;\n\t\tvarying vec2 vTexCoord;\n\n\t\tvoid main(void) {\n\t\t\tgl_Position = openfl_Matrix * openfl_Position;\n\t\t\tvTexCoord = openfl_TextureCoord;\n\t\t}\n\t";
	}
	openfl_filters_BitmapFilterShader.call(this);
	this.__isGenerated = true;
	this.__initGL();
};
$hxClasses["openfl.filters._GlowFilter.InvertAlphaShader"] = openfl_filters__$GlowFilter_InvertAlphaShader;
openfl_filters__$GlowFilter_InvertAlphaShader.__name__ = "openfl.filters._GlowFilter.InvertAlphaShader";
openfl_filters__$GlowFilter_InvertAlphaShader.__super__ = openfl_filters_BitmapFilterShader;
openfl_filters__$GlowFilter_InvertAlphaShader.prototype = $extend(openfl_filters_BitmapFilterShader.prototype,{
	__class__: openfl_filters__$GlowFilter_InvertAlphaShader
});
var openfl_filters_GlowFilter = function(color,alpha,blurX,blurY,strength,quality,inner,knockout) {
	if(knockout == null) {
		knockout = false;
	}
	if(inner == null) {
		inner = false;
	}
	if(quality == null) {
		quality = 1;
	}
	if(strength == null) {
		strength = 2;
	}
	if(blurY == null) {
		blurY = 6;
	}
	if(blurX == null) {
		blurX = 6;
	}
	if(alpha == null) {
		alpha = 1;
	}
	if(color == null) {
		color = 16711680;
	}
	openfl_filters_BitmapFilter.call(this);
	this.__color = color;
	this.__alpha = alpha;
	this.__blurX = blurX;
	this.__blurY = blurY;
	this.__strength = strength;
	this.__inner = inner;
	this.__knockout = knockout;
	this.__quality = quality;
	this.__updateSize();
	this.__needSecondBitmapData = true;
	this.__preserveObject = true;
	this.__renderDirty = true;
};
$hxClasses["openfl.filters.GlowFilter"] = openfl_filters_GlowFilter;
openfl_filters_GlowFilter.__name__ = "openfl.filters.GlowFilter";
openfl_filters_GlowFilter.__super__ = openfl_filters_BitmapFilter;
openfl_filters_GlowFilter.prototype = $extend(openfl_filters_BitmapFilter.prototype,{
	__alpha: null
	,__blurX: null
	,__blurY: null
	,__color: null
	,__horizontalPasses: null
	,__inner: null
	,__knockout: null
	,__quality: null
	,__strength: null
	,__verticalPasses: null
	,clone: function() {
		return new openfl_filters_GlowFilter(this.__color,this.__alpha,this.__blurX,this.__blurY,this.__strength,this.__quality,this.__inner,this.__knockout);
	}
	,__applyFilter: function(bitmapData,sourceBitmapData,sourceRect,destPoint) {
		var r = this.__color >> 16 & 255;
		var g = this.__color >> 8 & 255;
		var b = this.__color & 255;
		var finalImage = lime__$internal_graphics_ImageDataUtil.gaussianBlur(bitmapData.image,sourceBitmapData.image,sourceRect.__toLimeRectangle(),destPoint.__toLimeVector2(),this.__blurX,this.__blurY,this.__quality,this.__strength);
		finalImage.colorTransform(finalImage.get_rect(),new openfl_geom_ColorTransform(0,0,0,this.__alpha,r,g,b,0).__toLimeColorMatrix());
		if(finalImage == bitmapData.image) {
			return bitmapData;
		}
		return sourceBitmapData;
	}
	,__initShader: function(renderer,pass,sourceBitmapData) {
		if(this.__inner && pass == 0) {
			return openfl_filters_GlowFilter.__invertAlphaShader;
		}
		var blurPass = pass - (this.__inner ? 1 : 0);
		var numBlurPasses = this.__horizontalPasses + this.__verticalPasses;
		if(blurPass < numBlurPasses) {
			var shader = openfl_filters_GlowFilter.__blurAlphaShader;
			if(blurPass < this.__horizontalPasses) {
				var scale = Math.pow(0.5,blurPass >> 1) * 0.5;
				shader.uRadius.value[0] = this.get_blurX() * scale;
				shader.uRadius.value[1] = 0;
			} else {
				var scale = Math.pow(0.5,blurPass - this.__horizontalPasses >> 1) * 0.5;
				shader.uRadius.value[0] = 0;
				shader.uRadius.value[1] = this.get_blurY() * scale;
			}
			shader.uColor.value[0] = (this.get_color() >> 16 & 255) / 255;
			shader.uColor.value[1] = (this.get_color() >> 8 & 255) / 255;
			shader.uColor.value[2] = (this.get_color() & 255) / 255;
			shader.uColor.value[3] = this.get_alpha();
			shader.uStrength.value[0] = blurPass == numBlurPasses - 1 ? this.__strength : 1.0;
			return shader;
		}
		if(this.__inner) {
			if(this.__knockout) {
				var shader = openfl_filters_GlowFilter.__innerCombineKnockoutShader;
				shader.sourceBitmap.input = sourceBitmapData;
				shader.offset.value[0] = 0.0;
				shader.offset.value[1] = 0.0;
				return shader;
			}
			var shader = openfl_filters_GlowFilter.__innerCombineShader;
			shader.sourceBitmap.input = sourceBitmapData;
			shader.offset.value[0] = 0.0;
			shader.offset.value[1] = 0.0;
			return shader;
		} else {
			if(this.__knockout) {
				var shader = openfl_filters_GlowFilter.__combineKnockoutShader;
				shader.sourceBitmap.input = sourceBitmapData;
				shader.offset.value[0] = 0.0;
				shader.offset.value[1] = 0.0;
				return shader;
			}
			var shader = openfl_filters_GlowFilter.__combineShader;
			shader.sourceBitmap.input = sourceBitmapData;
			shader.offset.value[0] = 0.0;
			shader.offset.value[1] = 0.0;
			return shader;
		}
	}
	,__updateSize: function() {
		this.__leftExtension = this.__blurX > 0 ? Math.ceil(this.__blurX * 1.5) : 0;
		this.__rightExtension = this.__leftExtension;
		this.__topExtension = this.__blurY > 0 ? Math.ceil(this.__blurY * 1.5) : 0;
		this.__bottomExtension = this.__topExtension;
		this.__calculateNumShaderPasses();
	}
	,__calculateNumShaderPasses: function() {
		this.__horizontalPasses = this.__blurX <= 0 ? 0 : Math.round(this.__blurX * (this.__quality / 4)) + 1;
		this.__verticalPasses = this.__blurY <= 0 ? 0 : Math.round(this.__blurY * (this.__quality / 4)) + 1;
		this.__numShaderPasses = this.__horizontalPasses + this.__verticalPasses + (this.__inner ? 2 : 1);
	}
	,get_alpha: function() {
		return this.__alpha;
	}
	,set_alpha: function(value) {
		if(value != this.__alpha) {
			this.__renderDirty = true;
		}
		return this.__alpha = value;
	}
	,get_blurX: function() {
		return this.__blurX;
	}
	,set_blurX: function(value) {
		if(value != this.__blurX) {
			this.__blurX = value;
			this.__renderDirty = true;
			this.__updateSize();
		}
		return value;
	}
	,get_blurY: function() {
		return this.__blurY;
	}
	,set_blurY: function(value) {
		if(value != this.__blurY) {
			this.__blurY = value;
			this.__renderDirty = true;
			this.__updateSize();
		}
		return value;
	}
	,get_color: function() {
		return this.__color;
	}
	,set_color: function(value) {
		if(value != this.__color) {
			this.__renderDirty = true;
		}
		return this.__color = value;
	}
	,get_inner: function() {
		return this.__inner;
	}
	,set_inner: function(value) {
		if(value != this.__inner) {
			this.__renderDirty = true;
			this.__calculateNumShaderPasses();
		}
		return this.__inner = value;
	}
	,get_knockout: function() {
		return this.__knockout;
	}
	,set_knockout: function(value) {
		if(value != this.__knockout) {
			this.__renderDirty = true;
			this.__calculateNumShaderPasses();
		}
		return this.__knockout = value;
	}
	,get_quality: function() {
		return this.__quality;
	}
	,set_quality: function(value) {
		if(value != this.__quality) {
			this.__renderDirty = true;
			this.__calculateNumShaderPasses();
		}
		return this.__quality = value;
	}
	,get_strength: function() {
		return this.__strength;
	}
	,set_strength: function(value) {
		if(value != this.__strength) {
			this.__renderDirty = true;
		}
		return this.__strength = value;
	}
	,__class__: openfl_filters_GlowFilter
	,__properties__: {set_strength:"set_strength",get_strength:"get_strength",set_quality:"set_quality",get_quality:"get_quality",set_knockout:"set_knockout",get_knockout:"get_knockout",set_inner:"set_inner",get_inner:"get_inner",set_color:"set_color",get_color:"get_color",set_blurY:"set_blurY",get_blurY:"get_blurY",set_blurX:"set_blurX",get_blurX:"get_blurX",set_alpha:"set_alpha",get_alpha:"get_alpha"}
});
var openfl_filters_ShaderFilter = function(shader) {
	this.blendMode = 10;
	openfl_filters_BitmapFilter.call(this);
	this.shader = shader;
	this.__numShaderPasses = 1;
};
$hxClasses["openfl.filters.ShaderFilter"] = openfl_filters_ShaderFilter;
openfl_filters_ShaderFilter.__name__ = "openfl.filters.ShaderFilter";
openfl_filters_ShaderFilter.__super__ = openfl_filters_BitmapFilter;
openfl_filters_ShaderFilter.prototype = $extend(openfl_filters_BitmapFilter.prototype,{
	blendMode: null
	,shader: null
	,clone: function() {
		var filter = new openfl_filters_ShaderFilter(this.shader);
		filter.set_bottomExtension(this.get_bottomExtension());
		filter.set_leftExtension(this.get_leftExtension());
		filter.set_rightExtension(this.get_rightExtension());
		filter.set_topExtension(this.get_topExtension());
		filter.blendMode = this.blendMode;
		return filter;
	}
	,invalidate: function() {
		this.__renderDirty = true;
	}
	,get_topExtension: function() {
		return this.__topExtension;
	}
	,set_topExtension: function(value) {
		this.__topExtension = value;
		return this.__topExtension;
	}
	,get_bottomExtension: function() {
		return this.__bottomExtension;
	}
	,set_bottomExtension: function(value) {
		this.__bottomExtension = value;
		return this.__bottomExtension;
	}
	,get_leftExtension: function() {
		return this.__leftExtension;
	}
	,set_leftExtension: function(value) {
		this.__leftExtension = value;
		return this.__leftExtension;
	}
	,get_rightExtension: function() {
		return this.__rightExtension;
	}
	,set_rightExtension: function(value) {
		this.__rightExtension = value;
		return this.__rightExtension;
	}
	,__initShader: function(renderer,pass,sourceBitmapData) {
		this.__shaderBlendMode = this.blendMode;
		return this.shader;
	}
	,__class__: openfl_filters_ShaderFilter
	,__properties__: {set_topExtension:"set_topExtension",get_topExtension:"get_topExtension",set_rightExtension:"set_rightExtension",get_rightExtension:"get_rightExtension",set_leftExtension:"set_leftExtension",get_leftExtension:"get_leftExtension",set_bottomExtension:"set_bottomExtension",get_bottomExtension:"get_bottomExtension"}
});
var openfl_geom_Matrix3D = function(v) {
	if(v != null && v.get_length() == 16) {
		this.rawData = v.concat(null);
	} else {
		this.rawData = openfl_Vector.toFloatVector(null,null,null,[1.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,1.0]);
	}
};
$hxClasses["openfl.geom.Matrix3D"] = openfl_geom_Matrix3D;
openfl_geom_Matrix3D.__name__ = "openfl.geom.Matrix3D";
openfl_geom_Matrix3D.create2D = function(x,y,scale,rotation) {
	if(rotation == null) {
		rotation = 0;
	}
	if(scale == null) {
		scale = 1;
	}
	var theta = rotation * Math.PI / 180.0;
	var c = Math.cos(theta);
	var s = Math.sin(theta);
	return new openfl_geom_Matrix3D(openfl_Vector.toFloatVector(null,null,null,[c * scale,-s * scale,0,0,s * scale,c * scale,0,0,0,0,1,0,x,y,0,1]));
};
openfl_geom_Matrix3D.createABCD = function(a,b,c,d,tx,ty) {
	return new openfl_geom_Matrix3D(openfl_Vector.toFloatVector(null,null,null,[a,b,0,0,c,d,0,0,0,0,1,0,tx,ty,0,1]));
};
openfl_geom_Matrix3D.createOrtho = function(x0,x1,y0,y1,zNear,zFar) {
	var sx = 1.0 / (x1 - x0);
	var sy = 1.0 / (y1 - y0);
	var sz = 1.0 / (zFar - zNear);
	return new openfl_geom_Matrix3D(openfl_Vector.toFloatVector(null,null,null,[2.0 * sx,0,0,0,0,2.0 * sy,0,0,0,0,-2.0 * sz,0,-(x0 + x1) * sx,-(y0 + y1) * sy,-(zNear + zFar) * sz,1]));
};
openfl_geom_Matrix3D.interpolate = function(thisMat,toMat,percent) {
	var m = new openfl_geom_Matrix3D();
	var _g = 0;
	while(_g < 16) {
		var i = _g++;
		m.rawData.set(i,thisMat.rawData.get(i) + (toMat.rawData.get(i) - thisMat.rawData.get(i)) * percent);
	}
	return m;
};
openfl_geom_Matrix3D.interpolateToOutput = function(thisMat,toMat,percent,output) {
	if(output == null) {
		output = new openfl_geom_Matrix3D();
	}
	var _g = 0;
	while(_g < 16) {
		var i = _g++;
		output.rawData.set(i,thisMat.rawData.get(i) + (toMat.rawData.get(i) - thisMat.rawData.get(i)) * percent);
	}
	return output;
};
openfl_geom_Matrix3D.__getAxisRotation = function(x,y,z,degrees) {
	var m = new openfl_geom_Matrix3D();
	var a1 = new openfl_geom_Vector3D(x,y,z);
	var rad = -degrees * (Math.PI / 180);
	var c = Math.cos(rad);
	var s = Math.sin(rad);
	var t = 1.0 - c;
	m.rawData.set(0,c + a1.x * a1.x * t);
	m.rawData.set(5,c + a1.y * a1.y * t);
	m.rawData.set(10,c + a1.z * a1.z * t);
	var tmp1 = a1.x * a1.y * t;
	var tmp2 = a1.z * s;
	m.rawData.set(4,tmp1 + tmp2);
	m.rawData.set(1,tmp1 - tmp2);
	tmp1 = a1.x * a1.z * t;
	tmp2 = a1.y * s;
	m.rawData.set(8,tmp1 - tmp2);
	m.rawData.set(2,tmp1 + tmp2);
	tmp1 = a1.y * a1.z * t;
	tmp2 = a1.x * s;
	m.rawData.set(9,tmp1 + tmp2);
	m.rawData.set(6,tmp1 - tmp2);
	return m;
};
openfl_geom_Matrix3D.prototype = {
	rawData: null
	,append: function(lhs) {
		var m111 = this.rawData.get(0);
		var m121 = this.rawData.get(4);
		var m131 = this.rawData.get(8);
		var m141 = this.rawData.get(12);
		var m112 = this.rawData.get(1);
		var m122 = this.rawData.get(5);
		var m132 = this.rawData.get(9);
		var m142 = this.rawData.get(13);
		var m113 = this.rawData.get(2);
		var m123 = this.rawData.get(6);
		var m133 = this.rawData.get(10);
		var m143 = this.rawData.get(14);
		var m114 = this.rawData.get(3);
		var m124 = this.rawData.get(7);
		var m134 = this.rawData.get(11);
		var m144 = this.rawData.get(15);
		var m211 = lhs.rawData.get(0);
		var m221 = lhs.rawData.get(4);
		var m231 = lhs.rawData.get(8);
		var m241 = lhs.rawData.get(12);
		var m212 = lhs.rawData.get(1);
		var m222 = lhs.rawData.get(5);
		var m232 = lhs.rawData.get(9);
		var m242 = lhs.rawData.get(13);
		var m213 = lhs.rawData.get(2);
		var m223 = lhs.rawData.get(6);
		var m233 = lhs.rawData.get(10);
		var m243 = lhs.rawData.get(14);
		var m214 = lhs.rawData.get(3);
		var m224 = lhs.rawData.get(7);
		var m234 = lhs.rawData.get(11);
		var m244 = lhs.rawData.get(15);
		this.rawData.set(0,m111 * m211 + m112 * m221 + m113 * m231 + m114 * m241);
		this.rawData.set(1,m111 * m212 + m112 * m222 + m113 * m232 + m114 * m242);
		this.rawData.set(2,m111 * m213 + m112 * m223 + m113 * m233 + m114 * m243);
		this.rawData.set(3,m111 * m214 + m112 * m224 + m113 * m234 + m114 * m244);
		this.rawData.set(4,m121 * m211 + m122 * m221 + m123 * m231 + m124 * m241);
		this.rawData.set(5,m121 * m212 + m122 * m222 + m123 * m232 + m124 * m242);
		this.rawData.set(6,m121 * m213 + m122 * m223 + m123 * m233 + m124 * m243);
		this.rawData.set(7,m121 * m214 + m122 * m224 + m123 * m234 + m124 * m244);
		this.rawData.set(8,m131 * m211 + m132 * m221 + m133 * m231 + m134 * m241);
		this.rawData.set(9,m131 * m212 + m132 * m222 + m133 * m232 + m134 * m242);
		this.rawData.set(10,m131 * m213 + m132 * m223 + m133 * m233 + m134 * m243);
		this.rawData.set(11,m131 * m214 + m132 * m224 + m133 * m234 + m134 * m244);
		this.rawData.set(12,m141 * m211 + m142 * m221 + m143 * m231 + m144 * m241);
		this.rawData.set(13,m141 * m212 + m142 * m222 + m143 * m232 + m144 * m242);
		this.rawData.set(14,m141 * m213 + m142 * m223 + m143 * m233 + m144 * m243);
		this.rawData.set(15,m141 * m214 + m142 * m224 + m143 * m234 + m144 * m244);
	}
	,appendRotation: function(degrees,axis,pivotPoint) {
		var tz = 0;
		var ty = tz;
		var tx = ty;
		if(pivotPoint != null) {
			tx = pivotPoint.x;
			ty = pivotPoint.y;
			tz = pivotPoint.z;
		}
		var radian = degrees * Math.PI / 180;
		var cos = Math.cos(radian);
		var sin = Math.sin(radian);
		var x = axis.x;
		var y = axis.y;
		var z = axis.z;
		var x2 = x * x;
		var y2 = y * y;
		var z2 = z * z;
		var ls = x2 + y2 + z2;
		if(ls != 0) {
			var l = Math.sqrt(ls);
			x /= l;
			y /= l;
			z /= l;
			x2 /= ls;
			y2 /= ls;
			z2 /= ls;
		}
		var ccos = 1 - cos;
		var m = new openfl_geom_Matrix3D();
		var d = m.rawData;
		d.set(0,x2 + (y2 + z2) * cos);
		d.set(1,x * y * ccos + z * sin);
		d.set(2,x * z * ccos - y * sin);
		d.set(4,x * y * ccos - z * sin);
		d.set(5,y2 + (x2 + z2) * cos);
		d.set(6,y * z * ccos + x * sin);
		d.set(8,x * z * ccos + y * sin);
		d.set(9,y * z * ccos - x * sin);
		d.set(10,z2 + (x2 + y2) * cos);
		d.set(12,(tx * (y2 + z2) - x * (ty * y + tz * z)) * ccos + (ty * z - tz * y) * sin);
		d.set(13,(ty * (x2 + z2) - y * (tx * x + tz * z)) * ccos + (tz * x - tx * z) * sin);
		d.set(14,(tz * (x2 + y2) - z * (tx * x + ty * y)) * ccos + (tx * y - ty * x) * sin);
		this.append(m);
	}
	,appendScale: function(xScale,yScale,zScale) {
		this.append(new openfl_geom_Matrix3D(openfl_Vector.toFloatVector(null,null,null,[xScale,0.0,0.0,0.0,0.0,yScale,0.0,0.0,0.0,0.0,zScale,0.0,0.0,0.0,0.0,1.0])));
	}
	,appendTranslation: function(x,y,z) {
		var _g = this.rawData;
		_g.set(12,_g.get(12) + x);
		var _g = this.rawData;
		_g.set(13,_g.get(13) + y);
		var _g = this.rawData;
		_g.set(14,_g.get(14) + z);
	}
	,clone: function() {
		return new openfl_geom_Matrix3D(this.rawData.copy());
	}
	,copyColumnFrom: function(column,vector3D) {
		switch(column) {
		case 0:
			this.rawData.set(0,vector3D.x);
			this.rawData.set(1,vector3D.y);
			this.rawData.set(2,vector3D.z);
			this.rawData.set(3,vector3D.w);
			break;
		case 1:
			this.rawData.set(4,vector3D.x);
			this.rawData.set(5,vector3D.y);
			this.rawData.set(6,vector3D.z);
			this.rawData.set(7,vector3D.w);
			break;
		case 2:
			this.rawData.set(8,vector3D.x);
			this.rawData.set(9,vector3D.y);
			this.rawData.set(10,vector3D.z);
			this.rawData.set(11,vector3D.w);
			break;
		case 3:
			this.rawData.set(12,vector3D.x);
			this.rawData.set(13,vector3D.y);
			this.rawData.set(14,vector3D.z);
			this.rawData.set(15,vector3D.w);
			break;
		default:
		}
	}
	,copyColumnTo: function(column,vector3D) {
		switch(column) {
		case 0:
			vector3D.x = this.rawData.get(0);
			vector3D.y = this.rawData.get(1);
			vector3D.z = this.rawData.get(2);
			vector3D.w = this.rawData.get(3);
			break;
		case 1:
			vector3D.x = this.rawData.get(4);
			vector3D.y = this.rawData.get(5);
			vector3D.z = this.rawData.get(6);
			vector3D.w = this.rawData.get(7);
			break;
		case 2:
			vector3D.x = this.rawData.get(8);
			vector3D.y = this.rawData.get(9);
			vector3D.z = this.rawData.get(10);
			vector3D.w = this.rawData.get(11);
			break;
		case 3:
			vector3D.x = this.rawData.get(12);
			vector3D.y = this.rawData.get(13);
			vector3D.z = this.rawData.get(14);
			vector3D.w = this.rawData.get(15);
			break;
		default:
		}
	}
	,copyFrom: function(other) {
		this.rawData = other.rawData.copy();
	}
	,copyRawDataFrom: function(vector,index,transpose) {
		if(transpose == null) {
			transpose = false;
		}
		if(index == null) {
			index = 0;
		}
		if(transpose) {
			this.transpose();
		}
		var length = vector.get_length() - index;
		var _g = 0;
		var _g1 = length;
		while(_g < _g1) {
			var i = _g++;
			this.rawData.set(i,vector.get(i + index));
		}
		if(transpose) {
			this.transpose();
		}
	}
	,copyRawDataTo: function(vector,index,transpose) {
		if(transpose == null) {
			transpose = false;
		}
		if(index == null) {
			index = 0;
		}
		if(transpose) {
			this.transpose();
		}
		var _g = 0;
		var _g1 = this.rawData.get_length();
		while(_g < _g1) {
			var i = _g++;
			vector.set(i + index,this.rawData.get(i));
		}
		if(transpose) {
			this.transpose();
		}
	}
	,copyRowFrom: function(row,vector3D) {
		switch(row) {
		case 0:
			this.rawData.set(0,vector3D.x);
			this.rawData.set(4,vector3D.y);
			this.rawData.set(8,vector3D.z);
			this.rawData.set(12,vector3D.w);
			break;
		case 1:
			this.rawData.set(1,vector3D.x);
			this.rawData.set(5,vector3D.y);
			this.rawData.set(9,vector3D.z);
			this.rawData.set(13,vector3D.w);
			break;
		case 2:
			this.rawData.set(2,vector3D.x);
			this.rawData.set(6,vector3D.y);
			this.rawData.set(10,vector3D.z);
			this.rawData.set(14,vector3D.w);
			break;
		case 3:
			this.rawData.set(3,vector3D.x);
			this.rawData.set(7,vector3D.y);
			this.rawData.set(11,vector3D.z);
			this.rawData.set(15,vector3D.w);
			break;
		default:
		}
	}
	,copyRowTo: function(row,vector3D) {
		switch(row) {
		case 0:
			vector3D.x = this.rawData.get(0);
			vector3D.y = this.rawData.get(4);
			vector3D.z = this.rawData.get(8);
			vector3D.w = this.rawData.get(12);
			break;
		case 1:
			vector3D.x = this.rawData.get(1);
			vector3D.y = this.rawData.get(5);
			vector3D.z = this.rawData.get(9);
			vector3D.w = this.rawData.get(13);
			break;
		case 2:
			vector3D.x = this.rawData.get(2);
			vector3D.y = this.rawData.get(6);
			vector3D.z = this.rawData.get(10);
			vector3D.w = this.rawData.get(14);
			break;
		case 3:
			vector3D.x = this.rawData.get(3);
			vector3D.y = this.rawData.get(7);
			vector3D.z = this.rawData.get(11);
			vector3D.w = this.rawData.get(15);
			break;
		default:
		}
	}
	,copyToMatrix3D: function(other) {
		other.rawData = this.rawData.copy();
	}
	,decompose: function(orientationStyle) {
		if(orientationStyle == null) {
			orientationStyle = 1;
		}
		var vec = openfl_Vector.toObjectVector(null);
		var m = this.clone();
		var mr = m.rawData.copy();
		var pos = new openfl_geom_Vector3D(mr.get(12),mr.get(13),mr.get(14));
		mr.set(12,0);
		mr.set(13,0);
		mr.set(14,0);
		var scale = new openfl_geom_Vector3D();
		scale.x = Math.sqrt(mr.get(0) * mr.get(0) + mr.get(1) * mr.get(1) + mr.get(2) * mr.get(2));
		scale.y = Math.sqrt(mr.get(4) * mr.get(4) + mr.get(5) * mr.get(5) + mr.get(6) * mr.get(6));
		scale.z = Math.sqrt(mr.get(8) * mr.get(8) + mr.get(9) * mr.get(9) + mr.get(10) * mr.get(10));
		if(mr.get(0) * (mr.get(5) * mr.get(10) - mr.get(6) * mr.get(9)) - mr.get(1) * (mr.get(4) * mr.get(10) - mr.get(6) * mr.get(8)) + mr.get(2) * (mr.get(4) * mr.get(9) - mr.get(5) * mr.get(8)) < 0) {
			scale.z = -scale.z;
		}
		var _g = mr;
		_g.set(0,_g.get(0) / scale.x);
		var _g = mr;
		_g.set(1,_g.get(1) / scale.x);
		var _g = mr;
		_g.set(2,_g.get(2) / scale.x);
		var _g = mr;
		_g.set(4,_g.get(4) / scale.y);
		var _g = mr;
		_g.set(5,_g.get(5) / scale.y);
		var _g = mr;
		_g.set(6,_g.get(6) / scale.y);
		var _g = mr;
		_g.set(8,_g.get(8) / scale.z);
		var _g = mr;
		_g.set(9,_g.get(9) / scale.z);
		var _g = mr;
		_g.set(10,_g.get(10) / scale.z);
		var rot = new openfl_geom_Vector3D();
		switch(orientationStyle) {
		case 0:
			rot.w = Math.acos((mr.get(0) + mr.get(5) + mr.get(10) - 1) / 2);
			var len = Math.sqrt((mr.get(6) - mr.get(9)) * (mr.get(6) - mr.get(9)) + (mr.get(8) - mr.get(2)) * (mr.get(8) - mr.get(2)) + (mr.get(1) - mr.get(4)) * (mr.get(1) - mr.get(4)));
			if(len != 0) {
				rot.x = (mr.get(6) - mr.get(9)) / len;
				rot.y = (mr.get(8) - mr.get(2)) / len;
				rot.z = (mr.get(1) - mr.get(4)) / len;
			} else {
				rot.x = rot.y = rot.z = 0;
			}
			break;
		case 1:
			rot.y = Math.asin(-mr.get(2));
			if(mr.get(2) != 1 && mr.get(2) != -1) {
				rot.x = Math.atan2(mr.get(6),mr.get(10));
				rot.z = Math.atan2(mr.get(1),mr.get(0));
			} else {
				rot.z = 0;
				rot.x = Math.atan2(mr.get(4),mr.get(5));
			}
			break;
		case 2:
			var tr = mr.get(0) + mr.get(5) + mr.get(10);
			if(tr > 0) {
				rot.w = Math.sqrt(1 + tr) / 2;
				rot.x = (mr.get(6) - mr.get(9)) / (4 * rot.w);
				rot.y = (mr.get(8) - mr.get(2)) / (4 * rot.w);
				rot.z = (mr.get(1) - mr.get(4)) / (4 * rot.w);
			} else if(mr.get(0) > mr.get(5) && mr.get(0) > mr.get(10)) {
				rot.x = Math.sqrt(1 + mr.get(0) - mr.get(5) - mr.get(10)) / 2;
				rot.w = (mr.get(6) - mr.get(9)) / (4 * rot.x);
				rot.y = (mr.get(1) + mr.get(4)) / (4 * rot.x);
				rot.z = (mr.get(8) + mr.get(2)) / (4 * rot.x);
			} else if(mr.get(5) > mr.get(10)) {
				rot.y = Math.sqrt(1 + mr.get(5) - mr.get(0) - mr.get(10)) / 2;
				rot.x = (mr.get(1) + mr.get(4)) / (4 * rot.y);
				rot.w = (mr.get(8) - mr.get(2)) / (4 * rot.y);
				rot.z = (mr.get(6) + mr.get(9)) / (4 * rot.y);
			} else {
				rot.z = Math.sqrt(1 + mr.get(10) - mr.get(0) - mr.get(5)) / 2;
				rot.x = (mr.get(8) + mr.get(2)) / (4 * rot.z);
				rot.y = (mr.get(6) + mr.get(9)) / (4 * rot.z);
				rot.w = (mr.get(1) - mr.get(4)) / (4 * rot.z);
			}
			break;
		}
		vec.push(pos);
		vec.push(rot);
		vec.push(scale);
		return vec;
	}
	,decomposeToOutput: function(orientationStyle,output) {
		if(orientationStyle == null) {
			orientationStyle = 1;
		}
		if(output == null) {
			output = openfl_Vector.toObjectVector(null);
		}
		var m = this.clone();
		var mr = m.rawData.copy();
		var pos = output.get(0);
		if(pos == null) {
			pos = new openfl_geom_Vector3D(mr.get(12),mr.get(13),mr.get(14));
		} else {
			pos.setTo(mr.get(12),mr.get(13),mr.get(14));
		}
		mr.set(12,0);
		mr.set(13,0);
		mr.set(14,0);
		var scale = output.get(1);
		if(scale == null) {
			scale = new openfl_geom_Vector3D();
		}
		scale.x = Math.sqrt(mr.get(0) * mr.get(0) + mr.get(1) * mr.get(1) + mr.get(2) * mr.get(2));
		scale.y = Math.sqrt(mr.get(4) * mr.get(4) + mr.get(5) * mr.get(5) + mr.get(6) * mr.get(6));
		scale.z = Math.sqrt(mr.get(8) * mr.get(8) + mr.get(9) * mr.get(9) + mr.get(10) * mr.get(10));
		if(mr.get(0) * (mr.get(5) * mr.get(10) - mr.get(6) * mr.get(9)) - mr.get(1) * (mr.get(4) * mr.get(10) - mr.get(6) * mr.get(8)) + mr.get(2) * (mr.get(4) * mr.get(9) - mr.get(5) * mr.get(8)) < 0) {
			scale.z = -scale.z;
		}
		var _g = mr;
		_g.set(0,_g.get(0) / scale.x);
		var _g = mr;
		_g.set(1,_g.get(1) / scale.x);
		var _g = mr;
		_g.set(2,_g.get(2) / scale.x);
		var _g = mr;
		_g.set(4,_g.get(4) / scale.y);
		var _g = mr;
		_g.set(5,_g.get(5) / scale.y);
		var _g = mr;
		_g.set(6,_g.get(6) / scale.y);
		var _g = mr;
		_g.set(8,_g.get(8) / scale.z);
		var _g = mr;
		_g.set(9,_g.get(9) / scale.z);
		var _g = mr;
		_g.set(10,_g.get(10) / scale.z);
		var rot = output.get(2);
		if(rot == null) {
			rot = new openfl_geom_Vector3D();
		}
		switch(orientationStyle) {
		case 0:
			rot.w = Math.acos((mr.get(0) + mr.get(5) + mr.get(10) - 1) / 2);
			var len = Math.sqrt((mr.get(6) - mr.get(9)) * (mr.get(6) - mr.get(9)) + (mr.get(8) - mr.get(2)) * (mr.get(8) - mr.get(2)) + (mr.get(1) - mr.get(4)) * (mr.get(1) - mr.get(4)));
			if(len != 0) {
				rot.x = (mr.get(6) - mr.get(9)) / len;
				rot.y = (mr.get(8) - mr.get(2)) / len;
				rot.z = (mr.get(1) - mr.get(4)) / len;
			} else {
				rot.x = rot.y = rot.z = 0;
			}
			break;
		case 1:
			rot.y = Math.asin(-mr.get(2));
			if(mr.get(2) != 1 && mr.get(2) != -1) {
				rot.x = Math.atan2(mr.get(6),mr.get(10));
				rot.z = Math.atan2(mr.get(1),mr.get(0));
			} else {
				rot.z = 0;
				rot.x = Math.atan2(mr.get(4),mr.get(5));
			}
			break;
		case 2:
			var tr = mr.get(0) + mr.get(5) + mr.get(10);
			if(tr > 0) {
				rot.w = Math.sqrt(1 + tr) / 2;
				rot.x = (mr.get(6) - mr.get(9)) / (4 * rot.w);
				rot.y = (mr.get(8) - mr.get(2)) / (4 * rot.w);
				rot.z = (mr.get(1) - mr.get(4)) / (4 * rot.w);
			} else if(mr.get(0) > mr.get(5) && mr.get(0) > mr.get(10)) {
				rot.x = Math.sqrt(1 + mr.get(0) - mr.get(5) - mr.get(10)) / 2;
				rot.w = (mr.get(6) - mr.get(9)) / (4 * rot.x);
				rot.y = (mr.get(1) + mr.get(4)) / (4 * rot.x);
				rot.z = (mr.get(8) + mr.get(2)) / (4 * rot.x);
			} else if(mr.get(5) > mr.get(10)) {
				rot.y = Math.sqrt(1 + mr.get(5) - mr.get(0) - mr.get(10)) / 2;
				rot.x = (mr.get(1) + mr.get(4)) / (4 * rot.y);
				rot.w = (mr.get(8) - mr.get(2)) / (4 * rot.y);
				rot.z = (mr.get(6) + mr.get(9)) / (4 * rot.y);
			} else {
				rot.z = Math.sqrt(1 + mr.get(10) - mr.get(0) - mr.get(5)) / 2;
				rot.x = (mr.get(8) + mr.get(2)) / (4 * rot.z);
				rot.y = (mr.get(6) + mr.get(9)) / (4 * rot.z);
				rot.w = (mr.get(1) - mr.get(4)) / (4 * rot.z);
			}
			break;
		}
		output.set(0,pos);
		output.set(1,rot);
		output.set(2,scale);
		return output;
	}
	,deltaTransformVector: function(v) {
		var x = v.x;
		var y = v.y;
		var z = v.z;
		return new openfl_geom_Vector3D(x * this.rawData.get(0) + y * this.rawData.get(4) + z * this.rawData.get(8),x * this.rawData.get(1) + y * this.rawData.get(5) + z * this.rawData.get(9),x * this.rawData.get(2) + y * this.rawData.get(6) + z * this.rawData.get(10),x * this.rawData.get(3) + y * this.rawData.get(7) + z * this.rawData.get(11));
	}
	,deltaTransformVectorToOutput: function(v,output) {
		var x = v.x;
		var y = v.y;
		var z = v.z;
		if(output != null) {
			output.setTo(x * this.rawData.get(0) + y * this.rawData.get(4) + z * this.rawData.get(8),x * this.rawData.get(1) + y * this.rawData.get(5) + z * this.rawData.get(9),x * this.rawData.get(2) + y * this.rawData.get(6) + z * this.rawData.get(10));
			output.w = x * this.rawData.get(3) + y * this.rawData.get(7) + z * this.rawData.get(11);
			return output;
		}
		return new openfl_geom_Vector3D(x * this.rawData.get(0) + y * this.rawData.get(4) + z * this.rawData.get(8),x * this.rawData.get(1) + y * this.rawData.get(5) + z * this.rawData.get(9),x * this.rawData.get(2) + y * this.rawData.get(6) + z * this.rawData.get(10),x * this.rawData.get(3) + y * this.rawData.get(7) + z * this.rawData.get(11));
	}
	,identity: function() {
		this.rawData = openfl_Vector.toFloatVector(null,null,null,[1.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,1.0]);
	}
	,interpolateTo: function(toMat,percent) {
		var _g = 0;
		while(_g < 16) {
			var i = _g++;
			this.rawData.set(i,this.rawData.get(i) + (toMat.rawData.get(i) - this.rawData.get(i)) * percent);
		}
	}
	,invert: function() {
		var d = this.get_determinant();
		var invertable = Math.abs(d) > 0.00000000001;
		if(invertable) {
			d = 1 / d;
			var m11 = this.rawData.get(0);
			var m21 = this.rawData.get(4);
			var m31 = this.rawData.get(8);
			var m41 = this.rawData.get(12);
			var m12 = this.rawData.get(1);
			var m22 = this.rawData.get(5);
			var m32 = this.rawData.get(9);
			var m42 = this.rawData.get(13);
			var m13 = this.rawData.get(2);
			var m23 = this.rawData.get(6);
			var m33 = this.rawData.get(10);
			var m43 = this.rawData.get(14);
			var m14 = this.rawData.get(3);
			var m24 = this.rawData.get(7);
			var m34 = this.rawData.get(11);
			var m44 = this.rawData.get(15);
			this.rawData.set(0,d * (m22 * (m33 * m44 - m43 * m34) - m32 * (m23 * m44 - m43 * m24) + m42 * (m23 * m34 - m33 * m24)));
			this.rawData.set(1,-d * (m12 * (m33 * m44 - m43 * m34) - m32 * (m13 * m44 - m43 * m14) + m42 * (m13 * m34 - m33 * m14)));
			this.rawData.set(2,d * (m12 * (m23 * m44 - m43 * m24) - m22 * (m13 * m44 - m43 * m14) + m42 * (m13 * m24 - m23 * m14)));
			this.rawData.set(3,-d * (m12 * (m23 * m34 - m33 * m24) - m22 * (m13 * m34 - m33 * m14) + m32 * (m13 * m24 - m23 * m14)));
			this.rawData.set(4,-d * (m21 * (m33 * m44 - m43 * m34) - m31 * (m23 * m44 - m43 * m24) + m41 * (m23 * m34 - m33 * m24)));
			this.rawData.set(5,d * (m11 * (m33 * m44 - m43 * m34) - m31 * (m13 * m44 - m43 * m14) + m41 * (m13 * m34 - m33 * m14)));
			this.rawData.set(6,-d * (m11 * (m23 * m44 - m43 * m24) - m21 * (m13 * m44 - m43 * m14) + m41 * (m13 * m24 - m23 * m14)));
			this.rawData.set(7,d * (m11 * (m23 * m34 - m33 * m24) - m21 * (m13 * m34 - m33 * m14) + m31 * (m13 * m24 - m23 * m14)));
			this.rawData.set(8,d * (m21 * (m32 * m44 - m42 * m34) - m31 * (m22 * m44 - m42 * m24) + m41 * (m22 * m34 - m32 * m24)));
			this.rawData.set(9,-d * (m11 * (m32 * m44 - m42 * m34) - m31 * (m12 * m44 - m42 * m14) + m41 * (m12 * m34 - m32 * m14)));
			this.rawData.set(10,d * (m11 * (m22 * m44 - m42 * m24) - m21 * (m12 * m44 - m42 * m14) + m41 * (m12 * m24 - m22 * m14)));
			this.rawData.set(11,-d * (m11 * (m22 * m34 - m32 * m24) - m21 * (m12 * m34 - m32 * m14) + m31 * (m12 * m24 - m22 * m14)));
			this.rawData.set(12,-d * (m21 * (m32 * m43 - m42 * m33) - m31 * (m22 * m43 - m42 * m23) + m41 * (m22 * m33 - m32 * m23)));
			this.rawData.set(13,d * (m11 * (m32 * m43 - m42 * m33) - m31 * (m12 * m43 - m42 * m13) + m41 * (m12 * m33 - m32 * m13)));
			this.rawData.set(14,-d * (m11 * (m22 * m43 - m42 * m23) - m21 * (m12 * m43 - m42 * m13) + m41 * (m12 * m23 - m22 * m13)));
			this.rawData.set(15,d * (m11 * (m22 * m33 - m32 * m23) - m21 * (m12 * m33 - m32 * m13) + m31 * (m12 * m23 - m22 * m13)));
		}
		return invertable;
	}
	,pointAt: function(pos,at,up) {
		if(at == null) {
			at = new openfl_geom_Vector3D(0,0,-1);
		}
		if(up == null) {
			up = new openfl_geom_Vector3D(0,-1,0);
		}
		var dir = at.subtract(pos);
		var vup = up.clone();
		dir.normalize();
		vup.normalize();
		var dir2 = dir.clone();
		dir2.scaleBy(vup.dotProduct(dir));
		vup = vup.subtract(dir2);
		if(vup.get_length() > 0) {
			vup.normalize();
		} else if(dir.x != 0) {
			vup = new openfl_geom_Vector3D(-dir.y,dir.x,0);
		} else {
			vup = new openfl_geom_Vector3D(1,0,0);
		}
		var right = vup.crossProduct(dir);
		right.normalize();
		this.rawData.set(0,right.x);
		this.rawData.set(4,right.y);
		this.rawData.set(8,right.z);
		this.rawData.set(12,0.0);
		this.rawData.set(1,vup.x);
		this.rawData.set(5,vup.y);
		this.rawData.set(9,vup.z);
		this.rawData.set(13,0.0);
		this.rawData.set(2,dir.x);
		this.rawData.set(6,dir.y);
		this.rawData.set(10,dir.z);
		this.rawData.set(14,0.0);
		this.rawData.set(3,pos.x);
		this.rawData.set(7,pos.y);
		this.rawData.set(11,pos.z);
		this.rawData.set(15,1.0);
	}
	,prepend: function(rhs) {
		var m111 = rhs.rawData.get(0);
		var m121 = rhs.rawData.get(4);
		var m131 = rhs.rawData.get(8);
		var m141 = rhs.rawData.get(12);
		var m112 = rhs.rawData.get(1);
		var m122 = rhs.rawData.get(5);
		var m132 = rhs.rawData.get(9);
		var m142 = rhs.rawData.get(13);
		var m113 = rhs.rawData.get(2);
		var m123 = rhs.rawData.get(6);
		var m133 = rhs.rawData.get(10);
		var m143 = rhs.rawData.get(14);
		var m114 = rhs.rawData.get(3);
		var m124 = rhs.rawData.get(7);
		var m134 = rhs.rawData.get(11);
		var m144 = rhs.rawData.get(15);
		var m211 = this.rawData.get(0);
		var m221 = this.rawData.get(4);
		var m231 = this.rawData.get(8);
		var m241 = this.rawData.get(12);
		var m212 = this.rawData.get(1);
		var m222 = this.rawData.get(5);
		var m232 = this.rawData.get(9);
		var m242 = this.rawData.get(13);
		var m213 = this.rawData.get(2);
		var m223 = this.rawData.get(6);
		var m233 = this.rawData.get(10);
		var m243 = this.rawData.get(14);
		var m214 = this.rawData.get(3);
		var m224 = this.rawData.get(7);
		var m234 = this.rawData.get(11);
		var m244 = this.rawData.get(15);
		this.rawData.set(0,m111 * m211 + m112 * m221 + m113 * m231 + m114 * m241);
		this.rawData.set(1,m111 * m212 + m112 * m222 + m113 * m232 + m114 * m242);
		this.rawData.set(2,m111 * m213 + m112 * m223 + m113 * m233 + m114 * m243);
		this.rawData.set(3,m111 * m214 + m112 * m224 + m113 * m234 + m114 * m244);
		this.rawData.set(4,m121 * m211 + m122 * m221 + m123 * m231 + m124 * m241);
		this.rawData.set(5,m121 * m212 + m122 * m222 + m123 * m232 + m124 * m242);
		this.rawData.set(6,m121 * m213 + m122 * m223 + m123 * m233 + m124 * m243);
		this.rawData.set(7,m121 * m214 + m122 * m224 + m123 * m234 + m124 * m244);
		this.rawData.set(8,m131 * m211 + m132 * m221 + m133 * m231 + m134 * m241);
		this.rawData.set(9,m131 * m212 + m132 * m222 + m133 * m232 + m134 * m242);
		this.rawData.set(10,m131 * m213 + m132 * m223 + m133 * m233 + m134 * m243);
		this.rawData.set(11,m131 * m214 + m132 * m224 + m133 * m234 + m134 * m244);
		this.rawData.set(12,m141 * m211 + m142 * m221 + m143 * m231 + m144 * m241);
		this.rawData.set(13,m141 * m212 + m142 * m222 + m143 * m232 + m144 * m242);
		this.rawData.set(14,m141 * m213 + m142 * m223 + m143 * m233 + m144 * m243);
		this.rawData.set(15,m141 * m214 + m142 * m224 + m143 * m234 + m144 * m244);
	}
	,prependRotation: function(degrees,axis,pivotPoint) {
		var tz = 0;
		var ty = tz;
		var tx = ty;
		if(pivotPoint != null) {
			tx = pivotPoint.x;
			ty = pivotPoint.y;
			tz = pivotPoint.z;
		}
		var radian = degrees * Math.PI / 180;
		var cos = Math.cos(radian);
		var sin = Math.sin(radian);
		var x = axis.x;
		var y = axis.y;
		var z = axis.z;
		var x2 = x * x;
		var y2 = y * y;
		var z2 = z * z;
		var ls = x2 + y2 + z2;
		if(ls != 0) {
			var l = Math.sqrt(ls);
			x /= l;
			y /= l;
			z /= l;
			x2 /= ls;
			y2 /= ls;
			z2 /= ls;
		}
		var ccos = 1 - cos;
		var m = new openfl_geom_Matrix3D();
		var d = m.rawData;
		d.set(0,x2 + (y2 + z2) * cos);
		d.set(1,x * y * ccos + z * sin);
		d.set(2,x * z * ccos - y * sin);
		d.set(4,x * y * ccos - z * sin);
		d.set(5,y2 + (x2 + z2) * cos);
		d.set(6,y * z * ccos + x * sin);
		d.set(8,x * z * ccos + y * sin);
		d.set(9,y * z * ccos - x * sin);
		d.set(10,z2 + (x2 + y2) * cos);
		d.set(12,(tx * (y2 + z2) - x * (ty * y + tz * z)) * ccos + (ty * z - tz * y) * sin);
		d.set(13,(ty * (x2 + z2) - y * (tx * x + tz * z)) * ccos + (tz * x - tx * z) * sin);
		d.set(14,(tz * (x2 + y2) - z * (tx * x + ty * y)) * ccos + (tx * y - ty * x) * sin);
		this.prepend(m);
	}
	,prependScale: function(xScale,yScale,zScale) {
		this.prepend(new openfl_geom_Matrix3D(openfl_Vector.toFloatVector(null,null,null,[xScale,0.0,0.0,0.0,0.0,yScale,0.0,0.0,0.0,0.0,zScale,0.0,0.0,0.0,0.0,1.0])));
	}
	,prependTranslation: function(x,y,z) {
		var m = new openfl_geom_Matrix3D();
		m.set_position(new openfl_geom_Vector3D(x,y,z));
		this.prepend(m);
	}
	,recompose: function(components,orientationStyle) {
		if(orientationStyle == null) {
			orientationStyle = 1;
		}
		if(components.get_length() < 3 || components.get(2).x == 0 || components.get(2).y == 0 || components.get(2).z == 0) {
			return false;
		}
		this.identity();
		var scale = [];
		scale[0] = scale[1] = scale[2] = components.get(2).x;
		scale[4] = scale[5] = scale[6] = components.get(2).y;
		scale[8] = scale[9] = scale[10] = components.get(2).z;
		if(orientationStyle == 1) {
			var cx = Math.cos(components.get(1).x);
			var cy = Math.cos(components.get(1).y);
			var cz = Math.cos(components.get(1).z);
			var sx = Math.sin(components.get(1).x);
			var sy = Math.sin(components.get(1).y);
			var sz = Math.sin(components.get(1).z);
			this.rawData.set(0,cy * cz * scale[0]);
			this.rawData.set(1,cy * sz * scale[1]);
			this.rawData.set(2,-sy * scale[2]);
			this.rawData.set(3,0);
			this.rawData.set(4,(sx * sy * cz - cx * sz) * scale[4]);
			this.rawData.set(5,(sx * sy * sz + cx * cz) * scale[5]);
			this.rawData.set(6,sx * cy * scale[6]);
			this.rawData.set(7,0);
			this.rawData.set(8,(cx * sy * cz + sx * sz) * scale[8]);
			this.rawData.set(9,(cx * sy * sz - sx * cz) * scale[9]);
			this.rawData.set(10,cx * cy * scale[10]);
			this.rawData.set(11,0);
			this.rawData.set(12,components.get(0).x);
			this.rawData.set(13,components.get(0).y);
			this.rawData.set(14,components.get(0).z);
			this.rawData.set(15,1);
		} else {
			var x = components.get(1).x;
			var y = components.get(1).y;
			var z = components.get(1).z;
			var w = components.get(1).w;
			if(orientationStyle == 0) {
				x *= Math.sin(w / 2);
				y *= Math.sin(w / 2);
				z *= Math.sin(w / 2);
				w = Math.cos(w / 2);
			}
			this.rawData.set(0,(1 - 2 * y * y - 2 * z * z) * scale[0]);
			this.rawData.set(1,(2 * x * y + 2 * w * z) * scale[1]);
			this.rawData.set(2,(2 * x * z - 2 * w * y) * scale[2]);
			this.rawData.set(3,0);
			this.rawData.set(4,(2 * x * y - 2 * w * z) * scale[4]);
			this.rawData.set(5,(1 - 2 * x * x - 2 * z * z) * scale[5]);
			this.rawData.set(6,(2 * y * z + 2 * w * x) * scale[6]);
			this.rawData.set(7,0);
			this.rawData.set(8,(2 * x * z + 2 * w * y) * scale[8]);
			this.rawData.set(9,(2 * y * z - 2 * w * x) * scale[9]);
			this.rawData.set(10,(1 - 2 * x * x - 2 * y * y) * scale[10]);
			this.rawData.set(11,0);
			this.rawData.set(12,components.get(0).x);
			this.rawData.set(13,components.get(0).y);
			this.rawData.set(14,components.get(0).z);
			this.rawData.set(15,1);
		}
		if(components.get(2).x == 0) {
			this.rawData.set(0,1e-15);
		}
		if(components.get(2).y == 0) {
			this.rawData.set(5,1e-15);
		}
		if(components.get(2).z == 0) {
			this.rawData.set(10,1e-15);
		}
		return !(components.get(2).x == 0 || components.get(2).y == 0 || components.get(2).y == 0);
	}
	,transformVector: function(v) {
		var x = v.x;
		var y = v.y;
		var z = v.z;
		return new openfl_geom_Vector3D(x * this.rawData.get(0) + y * this.rawData.get(4) + z * this.rawData.get(8) + this.rawData.get(12),x * this.rawData.get(1) + y * this.rawData.get(5) + z * this.rawData.get(9) + this.rawData.get(13),x * this.rawData.get(2) + y * this.rawData.get(6) + z * this.rawData.get(10) + this.rawData.get(14),x * this.rawData.get(3) + y * this.rawData.get(7) + z * this.rawData.get(11) + this.rawData.get(15));
	}
	,transformVectorToOutput: function(v,output) {
		var x = v.x;
		var y = v.y;
		var z = v.z;
		if(output != null) {
			output.setTo(x * this.rawData.get(0) + y * this.rawData.get(4) + z * this.rawData.get(8) + this.rawData.get(12),x * this.rawData.get(1) + y * this.rawData.get(5) + z * this.rawData.get(9) + this.rawData.get(13),x * this.rawData.get(2) + y * this.rawData.get(6) + z * this.rawData.get(10) + this.rawData.get(14));
			output.w = x * this.rawData.get(3) + y * this.rawData.get(7) + z * this.rawData.get(11) + this.rawData.get(15);
			return output;
		}
		return new openfl_geom_Vector3D(x * this.rawData.get(0) + y * this.rawData.get(4) + z * this.rawData.get(8) + this.rawData.get(12),x * this.rawData.get(1) + y * this.rawData.get(5) + z * this.rawData.get(9) + this.rawData.get(13),x * this.rawData.get(2) + y * this.rawData.get(6) + z * this.rawData.get(10) + this.rawData.get(14),x * this.rawData.get(3) + y * this.rawData.get(7) + z * this.rawData.get(11) + this.rawData.get(15));
	}
	,transformVectors: function(vin,vout) {
		var i = 0;
		var x;
		var y;
		var z;
		while(i + 3 <= vin.get_length()) {
			x = vin.get(i);
			y = vin.get(i + 1);
			z = vin.get(i + 2);
			vout.set(i,x * this.rawData.get(0) + y * this.rawData.get(4) + z * this.rawData.get(8) + this.rawData.get(12));
			vout.set(i + 1,x * this.rawData.get(1) + y * this.rawData.get(5) + z * this.rawData.get(9) + this.rawData.get(13));
			vout.set(i + 2,x * this.rawData.get(2) + y * this.rawData.get(6) + z * this.rawData.get(10) + this.rawData.get(14));
			i += 3;
		}
	}
	,transpose: function() {
		var oRawData = this.rawData.copy();
		this.rawData.set(1,oRawData.get(4));
		this.rawData.set(2,oRawData.get(8));
		this.rawData.set(3,oRawData.get(12));
		this.rawData.set(4,oRawData.get(1));
		this.rawData.set(6,oRawData.get(9));
		this.rawData.set(7,oRawData.get(13));
		this.rawData.set(8,oRawData.get(2));
		this.rawData.set(9,oRawData.get(6));
		this.rawData.set(11,oRawData.get(14));
		this.rawData.set(12,oRawData.get(3));
		this.rawData.set(13,oRawData.get(7));
		this.rawData.set(14,oRawData.get(11));
	}
	,get_determinant: function() {
		return (this.rawData.get(0) * this.rawData.get(5) - this.rawData.get(4) * this.rawData.get(1)) * (this.rawData.get(10) * this.rawData.get(15) - this.rawData.get(14) * this.rawData.get(11)) - (this.rawData.get(0) * this.rawData.get(9) - this.rawData.get(8) * this.rawData.get(1)) * (this.rawData.get(6) * this.rawData.get(15) - this.rawData.get(14) * this.rawData.get(7)) + (this.rawData.get(0) * this.rawData.get(13) - this.rawData.get(12) * this.rawData.get(1)) * (this.rawData.get(6) * this.rawData.get(11) - this.rawData.get(10) * this.rawData.get(7)) + (this.rawData.get(4) * this.rawData.get(9) - this.rawData.get(8) * this.rawData.get(5)) * (this.rawData.get(2) * this.rawData.get(15) - this.rawData.get(14) * this.rawData.get(3)) - (this.rawData.get(4) * this.rawData.get(13) - this.rawData.get(12) * this.rawData.get(5)) * (this.rawData.get(2) * this.rawData.get(11) - this.rawData.get(10) * this.rawData.get(3)) + (this.rawData.get(8) * this.rawData.get(13) - this.rawData.get(12) * this.rawData.get(9)) * (this.rawData.get(2) * this.rawData.get(7) - this.rawData.get(6) * this.rawData.get(3));
	}
	,get_position: function() {
		return new openfl_geom_Vector3D(this.rawData.get(12),this.rawData.get(13),this.rawData.get(14));
	}
	,set_position: function(val) {
		this.rawData.set(12,val.x);
		this.rawData.set(13,val.y);
		this.rawData.set(14,val.z);
		return val;
	}
	,__class__: openfl_geom_Matrix3D
	,__properties__: {set_position:"set_position",get_position:"get_position",get_determinant:"get_determinant"}
};
var openfl_geom_Orientation3D = {};
openfl_geom_Orientation3D.fromString = function(value) {
	switch(value) {
	case "axisAngle":
		return 0;
	case "eulerAngles":
		return 1;
	case "quaternion":
		return 2;
	default:
		return null;
	}
};
openfl_geom_Orientation3D.toString = function(this1) {
	switch(this1) {
	case 0:
		return "axisAngle";
	case 1:
		return "eulerAngles";
	case 2:
		return "quaternion";
	default:
		return null;
	}
};
var openfl_geom_Transform = function(displayObject) {
	this.__colorTransform = new openfl_geom_ColorTransform();
	this.concatenatedColorTransform = new openfl_geom_ColorTransform();
	this.pixelBounds = new openfl_geom_Rectangle();
	this.__displayObject = displayObject;
	this.__hasMatrix = true;
};
$hxClasses["openfl.geom.Transform"] = openfl_geom_Transform;
openfl_geom_Transform.__name__ = "openfl.geom.Transform";
openfl_geom_Transform.prototype = {
	concatenatedColorTransform: null
	,pixelBounds: null
	,__colorTransform: null
	,__displayObject: null
	,__hasMatrix: null
	,__hasMatrix3D: null
	,get_colorTransform: function() {
		return this.__colorTransform.__clone();
	}
	,set_colorTransform: function(value) {
		if(!this.__colorTransform.__equals(value,false)) {
			this.__colorTransform.__copyFrom(value);
			if(value != null) {
				this.__displayObject.set_alpha(value.alphaMultiplier);
			}
			var _this = this.__displayObject;
			if(!_this.__renderDirty) {
				_this.__renderDirty = true;
				_this.__setParentRenderDirty();
			}
		}
		return this.__colorTransform;
	}
	,get_concatenatedMatrix: function() {
		if(this.__hasMatrix) {
			return this.__displayObject.__getWorldTransform().clone();
		}
		return null;
	}
	,get_matrix: function() {
		if(this.__hasMatrix) {
			return this.__displayObject.__transform.clone();
		}
		return null;
	}
	,set_matrix: function(value) {
		if(value == null) {
			this.__hasMatrix = false;
			return null;
		}
		this.__hasMatrix = true;
		this.__hasMatrix3D = false;
		if(this.__displayObject != null) {
			this.__setTransform(value.a,value.b,value.c,value.d,value.tx,value.ty);
		}
		return value;
	}
	,get_matrix3D: function() {
		if(this.__hasMatrix3D) {
			var matrix = this.__displayObject.__transform;
			return new openfl_geom_Matrix3D(openfl_Vector.toFloatVector(null,null,null,[matrix.a,matrix.b,0.0,0.0,matrix.c,matrix.d,0.0,0.0,0.0,0.0,1.0,0.0,matrix.tx,matrix.ty,0.0,1.0]));
		}
		return null;
	}
	,set_matrix3D: function(value) {
		if(value == null) {
			this.__hasMatrix3D = false;
			return null;
		}
		this.__hasMatrix = false;
		this.__hasMatrix3D = true;
		this.__setTransform(value.rawData.get(0),value.rawData.get(1),value.rawData.get(4),value.rawData.get(5),value.rawData.get(12),value.rawData.get(13));
		return value;
	}
	,__setTransform: function(a,b,c,d,tx,ty) {
		if(this.__displayObject != null) {
			var transform = this.__displayObject.__transform;
			if(transform.a == a && transform.b == b && transform.c == c && transform.d == d && transform.tx == tx && transform.ty == ty) {
				return;
			}
			var scaleX = 0.0;
			var scaleY = 0.0;
			if(b == 0) {
				scaleX = a;
			} else {
				scaleX = Math.sqrt(a * a + b * b);
			}
			if(c == 0) {
				scaleY = d;
			} else {
				scaleY = Math.sqrt(c * c + d * d);
			}
			this.__displayObject.__scaleX = scaleX;
			this.__displayObject.__scaleY = scaleY;
			var rotation = 180 / Math.PI * Math.atan2(d,c) - 90;
			if(rotation != this.__displayObject.__rotation) {
				this.__displayObject.__rotation = rotation;
				var radians = rotation * (Math.PI / 180);
				this.__displayObject.__rotationSine = Math.sin(radians);
				this.__displayObject.__rotationCosine = Math.cos(radians);
			}
			transform.a = a;
			transform.b = b;
			transform.c = c;
			transform.d = d;
			transform.tx = tx;
			transform.ty = ty;
			this.__displayObject.__setTransformDirty();
		}
	}
	,__class__: openfl_geom_Transform
	,__properties__: {set_matrix3D:"set_matrix3D",get_matrix3D:"get_matrix3D",set_matrix:"set_matrix",get_matrix:"get_matrix",get_concatenatedMatrix:"get_concatenatedMatrix",set_colorTransform:"set_colorTransform",get_colorTransform:"get_colorTransform"}
};
var openfl_geom_Vector3D = function(x,y,z,w) {
	if(w == null) {
		w = 0;
	}
	if(z == null) {
		z = 0;
	}
	if(y == null) {
		y = 0;
	}
	if(x == null) {
		x = 0;
	}
	this.w = w;
	this.x = x;
	this.y = y;
	this.z = z;
};
$hxClasses["openfl.geom.Vector3D"] = openfl_geom_Vector3D;
openfl_geom_Vector3D.__name__ = "openfl.geom.Vector3D";
openfl_geom_Vector3D.__properties__ = {get_Z_AXIS:"get_Z_AXIS",get_Y_AXIS:"get_Y_AXIS",get_X_AXIS:"get_X_AXIS"};
openfl_geom_Vector3D.angleBetween = function(a,b) {
	var la = a.get_length();
	var lb = b.get_length();
	var dot = a.dotProduct(b);
	if(la != 0) {
		dot /= la;
	}
	if(lb != 0) {
		dot /= lb;
	}
	return Math.acos(dot);
};
openfl_geom_Vector3D.distance = function(pt1,pt2) {
	var x = pt2.x - pt1.x;
	var y = pt2.y - pt1.y;
	var z = pt2.z - pt1.z;
	return Math.sqrt(x * x + y * y + z * z);
};
openfl_geom_Vector3D.get_X_AXIS = function() {
	return new openfl_geom_Vector3D(1,0,0);
};
openfl_geom_Vector3D.get_Y_AXIS = function() {
	return new openfl_geom_Vector3D(0,1,0);
};
openfl_geom_Vector3D.get_Z_AXIS = function() {
	return new openfl_geom_Vector3D(0,0,1);
};
openfl_geom_Vector3D.prototype = {
	w: null
	,x: null
	,y: null
	,z: null
	,add: function(a) {
		return new openfl_geom_Vector3D(this.x + a.x,this.y + a.y,this.z + a.z);
	}
	,addToOutput: function(a,output) {
		if(output != null) {
			output.setTo(this.x + a.x,this.y + a.y,this.z + a.z);
			return output;
		}
		return new openfl_geom_Vector3D(this.x + a.x,this.y + a.y,this.z + a.z);
	}
	,clone: function() {
		return new openfl_geom_Vector3D(this.x,this.y,this.z,this.w);
	}
	,copyFrom: function(sourceVector3D) {
		this.x = sourceVector3D.x;
		this.y = sourceVector3D.y;
		this.z = sourceVector3D.z;
	}
	,crossProduct: function(a) {
		return new openfl_geom_Vector3D(this.y * a.z - this.z * a.y,this.z * a.x - this.x * a.z,this.x * a.y - this.y * a.x,1);
	}
	,crossProductToOutput: function(a,output) {
		if(output != null) {
			output.setTo(this.y * a.z - this.z * a.y,this.z * a.x - this.x * a.z,this.x * a.y - this.y * a.x);
			output.w = 1;
			return output;
		}
		return new openfl_geom_Vector3D(this.y * a.z - this.z * a.y,this.z * a.x - this.x * a.z,this.x * a.y - this.y * a.x,1);
	}
	,decrementBy: function(a) {
		this.x -= a.x;
		this.y -= a.y;
		this.z -= a.z;
	}
	,dotProduct: function(a) {
		return this.x * a.x + this.y * a.y + this.z * a.z;
	}
	,equals: function(toCompare,allFour) {
		if(allFour == null) {
			allFour = false;
		}
		if(this.x == toCompare.x && this.y == toCompare.y && this.z == toCompare.z) {
			if(allFour) {
				return this.w == toCompare.w;
			} else {
				return true;
			}
		} else {
			return false;
		}
	}
	,incrementBy: function(a) {
		this.x += a.x;
		this.y += a.y;
		this.z += a.z;
	}
	,nearEquals: function(toCompare,tolerance,allFour) {
		if(allFour == null) {
			allFour = false;
		}
		if(Math.abs(this.x - toCompare.x) < tolerance && Math.abs(this.y - toCompare.y) < tolerance && Math.abs(this.z - toCompare.z) < tolerance) {
			if(!(!allFour)) {
				return Math.abs(this.w - toCompare.w) < tolerance;
			} else {
				return true;
			}
		} else {
			return false;
		}
	}
	,negate: function() {
		this.x *= -1;
		this.y *= -1;
		this.z *= -1;
	}
	,normalize: function() {
		var l = this.get_length();
		if(l != 0) {
			this.x /= l;
			this.y /= l;
			this.z /= l;
		}
		return l;
	}
	,project: function() {
		this.x /= this.w;
		this.y /= this.w;
		this.z /= this.w;
	}
	,scaleBy: function(s) {
		this.x *= s;
		this.y *= s;
		this.z *= s;
	}
	,setTo: function(xa,ya,za) {
		this.x = xa;
		this.y = ya;
		this.z = za;
	}
	,subtract: function(a) {
		return new openfl_geom_Vector3D(this.x - a.x,this.y - a.y,this.z - a.z);
	}
	,subtractToOutput: function(a,output) {
		if(output != null) {
			output.setTo(this.x - a.x,this.y - a.y,this.z - a.z);
			return output;
		}
		return new openfl_geom_Vector3D(this.x - a.x,this.y - a.y,this.z - a.z);
	}
	,toString: function() {
		return "Vector3D(" + this.x + ", " + this.y + ", " + this.z + ")";
	}
	,get_length: function() {
		return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z);
	}
	,get_lengthSquared: function() {
		return this.x * this.x + this.y * this.y + this.z * this.z;
	}
	,__class__: openfl_geom_Vector3D
	,__properties__: {get_lengthSquared:"get_lengthSquared",get_length:"get_length"}
};
var openfl_globalization_DateTimeFormatter = function(requestedLocaleIDName,dateStyle,timeStyle) {
	if(timeStyle == null) {
		timeStyle = 1;
	}
	if(dateStyle == null) {
		dateStyle = 1;
	}
	this.requestedLocaleIDName = requestedLocaleIDName;
	this._normalizedRequestedLocaleIDName = openfl_globalization_LocaleID.normalizeRequestedLocaleIDName(requestedLocaleIDName);
	this.setDateTimeStyles(dateStyle,timeStyle);
	this.actualLocaleIDName = this.intlDateTimeFormat.resolvedOptions().locale;
	this.lastOperationStatus = 7;
};
$hxClasses["openfl.globalization.DateTimeFormatter"] = openfl_globalization_DateTimeFormatter;
openfl_globalization_DateTimeFormatter.__name__ = "openfl.globalization.DateTimeFormatter";
openfl_globalization_DateTimeFormatter.getAvailableLocaleIDNames = function() {
	return openfl_Vector.toObjectVector(null);
};
openfl_globalization_DateTimeFormatter.prototype = {
	intlDateTimeFormat: null
	,intlDateTimeFormatUTC: null
	,dateStyle: null
	,timeStyle: null
	,dateTimePattern: null
	,getDateStyle: function() {
		this.lastOperationStatus = 7;
		return this.dateStyle;
	}
	,getTimeStyle: function() {
		this.lastOperationStatus = 7;
		return this.timeStyle;
	}
	,getDateTimePattern: function() {
		this.lastOperationStatus = 7;
		return this.dateTimePattern;
	}
	,getFirstWeekday: function() {
		this.lastOperationStatus = 11;
		return 0;
	}
	,actualLocaleIDName: null
	,requestedLocaleIDName: null
	,_normalizedRequestedLocaleIDName: null
	,lastOperationStatus: null
	,format: function(date) {
		var jsDate = date;
		if(this.dateStyle == 0 || this.timeStyle == 0) {
			var result = this.formatPatternJS(jsDate,false);
			this.lastOperationStatus = 7;
			return result;
		} else {
			try {
				var result = this.intlDateTimeFormat.format(jsDate);
				this.lastOperationStatus = 7;
				return result;
			} catch( _g ) {
				haxe_NativeStackTrace.lastError = _g;
				this.lastOperationStatus = 1;
				return null;
			}
		}
	}
	,formatUTC: function(date) {
		var jsDate = date;
		if(this.dateTimePattern != null) {
			var result = this.formatPatternJS(jsDate,true);
			this.lastOperationStatus = 7;
			return result;
		} else {
			try {
				var result = this.intlDateTimeFormatUTC.format(jsDate);
				this.lastOperationStatus = 7;
				return result;
			} catch( _g ) {
				haxe_NativeStackTrace.lastError = _g;
				this.lastOperationStatus = 1;
				return null;
			}
		}
	}
	,formatPatternJS: function(date,utc) {
		var result = "";
		var tokens = openfl_globalization__$DateTimeFormatter_DateTimeFormatTokenizer.tokenize(this.dateTimePattern);
		var timeZone = utc ? "UTC" : undefined;
		var _g = 0;
		while(_g < tokens.length) {
			var token = tokens[_g];
			++_g;
			var result1;
			switch(token._hx_index) {
			case 0:
				var text = token.text;
				result1 = text;
				break;
			case 1:
				var _g1 = token.text;
				result1 = "";
				break;
			case 2:
				var length = token.length;
				var result2;
				switch(length) {
				case 4:
					result2 = new Intl.DateTimeFormat(this._normalizedRequestedLocaleIDName,{ weekday : "long", timeZone : timeZone}).formatToParts(date);
					break;
				case 5:
					result2 = new Intl.DateTimeFormat(this._normalizedRequestedLocaleIDName,{ weekday : "narrow", timeZone : timeZone}).formatToParts(date);
					break;
				default:
					result2 = new Intl.DateTimeFormat(this._normalizedRequestedLocaleIDName,{ weekday : "short", timeZone : timeZone}).formatToParts(date);
				}
				result1 = this.getDateFormatPart("weekday",result2);
				break;
			case 3:
				var length1 = token.length;
				var result3;
				switch(length1) {
				case 4:
					result3 = new Intl.DateTimeFormat(this._normalizedRequestedLocaleIDName,{ era : "long", timeZone : timeZone}).formatToParts(date);
					break;
				case 5:
					result3 = new Intl.DateTimeFormat(this._normalizedRequestedLocaleIDName,{ era : "narrow", timeZone : timeZone}).formatToParts(date);
					break;
				default:
					result3 = new Intl.DateTimeFormat(this._normalizedRequestedLocaleIDName,{ era : "short", timeZone : timeZone}).formatToParts(date);
				}
				result1 = this.getDateFormatPart("era",result3);
				break;
			case 4:
				var length2 = token.length;
				switch(length2) {
				case 1:
					result1 = new Intl.DateTimeFormat(this._normalizedRequestedLocaleIDName,{ year : "numeric", timeZone : timeZone}).formatToParts(date)[0].value;
					break;
				case 2:
					result1 = new Intl.DateTimeFormat(this._normalizedRequestedLocaleIDName,{ year : "2-digit", timeZone : timeZone}).formatToParts(date)[0].value;
					break;
				default:
					result1 = StringTools.lpad(new Intl.DateTimeFormat(this._normalizedRequestedLocaleIDName,{ year : "numeric", timeZone : timeZone}).formatToParts(date)[0].value,"0",Math.min(4,length2) | 0);
				}
				break;
			case 5:
				var length3 = token.length;
				var result4;
				switch(length3) {
				case 1:
					result4 = new Intl.DateTimeFormat(this._normalizedRequestedLocaleIDName,{ month : "numeric", timeZone : timeZone}).formatToParts(date);
					break;
				case 2:
					result4 = new Intl.DateTimeFormat(this._normalizedRequestedLocaleIDName,{ month : "2-digit", timeZone : timeZone}).formatToParts(date);
					break;
				case 3:
					result4 = new Intl.DateTimeFormat(this._normalizedRequestedLocaleIDName,{ month : "short", timeZone : timeZone}).formatToParts(date);
					break;
				case 4:
					result4 = new Intl.DateTimeFormat(this._normalizedRequestedLocaleIDName,{ month : "long", timeZone : timeZone}).formatToParts(date);
					break;
				default:
					result4 = new Intl.DateTimeFormat(this._normalizedRequestedLocaleIDName,{ month : "narrow", timeZone : timeZone}).formatToParts(date);
				}
				result1 = this.getDateFormatPart("month",result4);
				break;
			case 6:
				var length4 = token.length;
				result1 = this.getDateFormatPart("day",length4 == 1 ? new Intl.DateTimeFormat(this._normalizedRequestedLocaleIDName,{ day : "numeric", timeZone : timeZone}).formatToParts(date) : new Intl.DateTimeFormat(this._normalizedRequestedLocaleIDName,{ day : "2-digit", timeZone : timeZone}).formatToParts(date));
				break;
			case 7:
				var _g2 = token.length;
				result1 = "";
				break;
			case 8:
				var _g3 = token.length;
				result1 = "";
				break;
			case 9:
				result1 = "";
				break;
			case 10:
				var _g4 = token.length;
				result1 = "";
				break;
			case 11:
				result1 = "";
				break;
			case 12:
				result1 = this.getDateFormatPart("dayPeriod",new Intl.DateTimeFormat(this._normalizedRequestedLocaleIDName,{ hour : "numeric", hour12 : true, timeZone : timeZone}).formatToParts(date));
				break;
			case 13:
				var length5 = token.length;
				result1 = this.getDateFormatPart("hour",length5 == 1 ? new Intl.DateTimeFormat(this._normalizedRequestedLocaleIDName,{ hour : "numeric", hourCycle : "h11", timeZone : timeZone}).formatToParts(date) : new Intl.DateTimeFormat(this._normalizedRequestedLocaleIDName,{ hour : "2-digit", hourCycle : "h11", timeZone : timeZone}).formatToParts(date));
				break;
			case 14:
				var length6 = token.length;
				result1 = this.getDateFormatPart("hour",length6 == 1 ? new Intl.DateTimeFormat(this._normalizedRequestedLocaleIDName,{ hour : "numeric", hourCycle : "h12", timeZone : timeZone}).formatToParts(date) : new Intl.DateTimeFormat(this._normalizedRequestedLocaleIDName,{ hour : "2-digit", hourCycle : "h12", timeZone : timeZone}).formatToParts(date));
				break;
			case 15:
				var length7 = token.length;
				result1 = this.getDateFormatPart("hour",length7 == 1 ? new Intl.DateTimeFormat(this._normalizedRequestedLocaleIDName,{ hour : "numeric", hourCycle : "h23", timeZone : timeZone}).formatToParts(date) : new Intl.DateTimeFormat(this._normalizedRequestedLocaleIDName,{ hour : "2-digit", hourCycle : "h23", timeZone : timeZone}).formatToParts(date));
				break;
			case 16:
				var length8 = token.length;
				result1 = this.getDateFormatPart("hour",length8 == 1 ? new Intl.DateTimeFormat(this._normalizedRequestedLocaleIDName,{ hour : "numeric", hourCycle : "h24", timeZone : timeZone}).formatToParts(date) : new Intl.DateTimeFormat(this._normalizedRequestedLocaleIDName,{ hour : "2-digit", hourCycle : "h24", timeZone : timeZone}).formatToParts(date));
				break;
			case 17:
				var length9 = token.length;
				result1 = this.getDateFormatPart("minute",length9 == 1 ? new Intl.DateTimeFormat(this._normalizedRequestedLocaleIDName,{ minute : "numeric", timeZone : timeZone}).formatToParts(date) : new Intl.DateTimeFormat(this._normalizedRequestedLocaleIDName,{ minute : "2-digit", timeZone : timeZone}).formatToParts(date));
				break;
			case 18:
				var length10 = token.length;
				result1 = this.getDateFormatPart("second",length10 == 1 ? new Intl.DateTimeFormat(this._normalizedRequestedLocaleIDName,{ second : "numeric", timeZone : timeZone}).formatToParts(date) : new Intl.DateTimeFormat(this._normalizedRequestedLocaleIDName,{ second : "2-digit", timeZone : timeZone}).formatToParts(date));
				break;
			case 19:
				var length11 = token.length;
				result1 = "";
				break;
			case 20:
				var length12 = token.length;
				result1 = "";
				break;
			case 21:
				var length13 = token.length;
				result1 = this.getDateFormatPart("timeZoneName",length13 == 4 ? new Intl.DateTimeFormat(this._normalizedRequestedLocaleIDName,{ timeZoneName : "long", timeZone : timeZone}).formatToParts(date) : new Intl.DateTimeFormat(this._normalizedRequestedLocaleIDName,{ timeZoneName : "short", timeZone : timeZone}).formatToParts(date));
				break;
			case 22:
				var length14 = token.length;
				result1 = "";
				break;
			}
			result += result1;
		}
		return result;
	}
	,getDateFormatPart: function(partName,parts) {
		var result = "";
		var _g = 0;
		while(_g < parts.length) {
			var part = parts[_g];
			++_g;
			var typeAsString = Std.string(part.type);
			if(typeAsString != partName) {
				continue;
			}
			result = part.value;
		}
		return result;
	}
	,getMonthNames: function(nameStyle,context) {
		if(context == null) {
			context = 1;
		}
		if(nameStyle == null) {
			nameStyle = 0;
		}
		try {
			var monthStyle = nameStyle == 0 ? "long" : "short";
			var intlDateTimeFormat = new Intl.DateTimeFormat(this.actualLocaleIDName,{ month : monthStyle});
			var monthNames = [];
			var _g = 0;
			while(_g < 12) {
				var i = _g++;
				var date = new Date(2000,i,1,0,0,0);
				monthNames[i] = intlDateTimeFormat.format(date);
			}
			this.lastOperationStatus = 7;
			return openfl_Vector.toObjectVector(null,monthNames.length,true,monthNames);
		} catch( _g ) {
			haxe_NativeStackTrace.lastError = _g;
			this.lastOperationStatus = 1;
			return null;
		}
	}
	,getWeekdayNames: function(nameStyle,context) {
		if(context == null) {
			context = 1;
		}
		if(nameStyle == null) {
			nameStyle = 0;
		}
		try {
			var weekdayStyle;
			switch(nameStyle) {
			case 0:
				weekdayStyle = "long";
				break;
			case 2:
				weekdayStyle = "narrow";
				break;
			default:
				weekdayStyle = "short";
			}
			var intlDateTimeFormat = new Intl.DateTimeFormat(this.actualLocaleIDName,{ weekday : weekdayStyle});
			var weekdayNames = [];
			var date = new Date(2006,0,1,0,0,0);
			weekdayNames[0] = intlDateTimeFormat.format(date);
			var date = new Date(2006,0,2,0,0,0);
			weekdayNames[1] = intlDateTimeFormat.format(date);
			var date = new Date(2006,0,3,0,0,0);
			weekdayNames[2] = intlDateTimeFormat.format(date);
			var date = new Date(2006,0,4,0,0,0);
			weekdayNames[3] = intlDateTimeFormat.format(date);
			var date = new Date(2006,0,5,0,0,0);
			weekdayNames[4] = intlDateTimeFormat.format(date);
			var date = new Date(2006,0,6,0,0,0);
			weekdayNames[5] = intlDateTimeFormat.format(date);
			var date = new Date(2006,0,7,0,0,0);
			weekdayNames[6] = intlDateTimeFormat.format(date);
			this.lastOperationStatus = 7;
			return openfl_Vector.toObjectVector(null,weekdayNames.length,true,weekdayNames);
		} catch( _g ) {
			haxe_NativeStackTrace.lastError = _g;
			this.lastOperationStatus = 1;
			return null;
		}
	}
	,setDateTimeStyles: function(dateStyle,timeStyle) {
		if(timeStyle == null) {
			timeStyle = 1;
		}
		if(dateStyle == null) {
			dateStyle = 1;
		}
		if(dateStyle == 0 || timeStyle == 0) {
			this.lastOperationStatus = 2;
			return;
		}
		this.dateStyle = dateStyle;
		this.timeStyle = timeStyle;
		this.dateTimePattern = null;
		var options = { };
		if(dateStyle != 3) {
			var tmp;
			switch(dateStyle) {
			case 1:
				tmp = "full";
				break;
			case 2:
				tmp = "long";
				break;
			default:
				tmp = "short";
			}
			options.dateStyle = tmp;
		}
		if(timeStyle != 3) {
			var tmp;
			switch(timeStyle) {
			case 1:
				tmp = "medium";
				break;
			case 2:
				tmp = "medium";
				break;
			default:
				tmp = "short";
			}
			options.timeStyle = tmp;
		}
		try {
			this.intlDateTimeFormat = new Intl.DateTimeFormat(this._normalizedRequestedLocaleIDName,options);
			options.timeZone = "UTC";
			this.intlDateTimeFormatUTC = new Intl.DateTimeFormat(this._normalizedRequestedLocaleIDName,options);
			this.resolveDateTimePattern();
			this.lastOperationStatus = 7;
		} catch( _g ) {
			haxe_NativeStackTrace.lastError = _g;
			this.lastOperationStatus = 1;
		}
	}
	,setDateTimePattern: function(pattern) {
		if(pattern == null || pattern.length > 255) {
			this.lastOperationStatus = 10;
			return;
		}
		this.dateStyle = 0;
		this.timeStyle = 0;
		this.dateTimePattern = pattern;
		try {
			var tokens = openfl_globalization__$DateTimeFormatter_DateTimeFormatTokenizer.tokenize(this.dateTimePattern);
			this.lastOperationStatus = 7;
			var _g = 0;
			while(_g < tokens.length) {
				var token = tokens[_g];
				++_g;
				switch(token._hx_index) {
				case 1:
					var text = token.text;
					this.lastOperationStatus = 10;
					return;
				case 7:
					var _g1 = token.length;
					this.lastOperationStatus = 14;
					return;
				case 8:
					var _g2 = token.length;
					this.lastOperationStatus = 14;
					return;
				case 9:
					this.lastOperationStatus = 14;
					return;
				case 10:
					var _g3 = token.length;
					this.lastOperationStatus = 14;
					return;
				case 11:
					this.lastOperationStatus = 14;
					return;
				case 19:
					var _g4 = token.length;
					this.lastOperationStatus = 14;
					break;
				case 20:
					var _g5 = token.length;
					this.lastOperationStatus = 14;
					return;
				case 22:
					var _g6 = token.length;
					this.lastOperationStatus = 14;
					return;
				default:
				}
			}
		} catch( _g ) {
			haxe_NativeStackTrace.lastError = _g;
			var e = haxe_Exception.caught(_g).unwrap();
			haxe_Log.trace("Date time tokenization error: " + Std.string(e),{ fileName : "openfl/globalization/DateTimeFormatter.hx", lineNumber : 830, className : "openfl.globalization.DateTimeFormatter", methodName : "setDateTimePattern"});
			this.dateTimePattern = "";
			this.lastOperationStatus = 10;
			return;
		}
	}
	,resolveDateTimePattern: function() {
		var pattern = "";
		var parts = this.intlDateTimeFormat.formatToParts(new Date(2021,9,12,0,0,0));
		var _g = 0;
		while(_g < parts.length) {
			var part = parts[_g];
			++_g;
			var pattern1;
			switch(part.type) {
			case "day":
				pattern1 = "d";
				break;
			case "dayPeriod":
				pattern1 = "a";
				break;
			case "era":
				pattern1 = "G";
				break;
			case "hour":
				pattern1 = "h";
				break;
			case "literal":
				pattern1 = part.value;
				break;
			case "minute":
				pattern1 = "m";
				break;
			case "month":
				pattern1 = "M";
				break;
			case "second":
				pattern1 = "s";
				break;
			case "timeZoneName":
				pattern1 = "z";
				break;
			case "weekday":
				pattern1 = "E";
				break;
			case "year":
				pattern1 = "y";
				break;
			default:
				pattern1 = "";
			}
			pattern += pattern1;
		}
		this.dateTimePattern = pattern;
	}
	,__class__: openfl_globalization_DateTimeFormatter
};
var openfl_globalization__$DateTimeFormatter_DateTimeFormatTokenizer = function() { };
$hxClasses["openfl.globalization._DateTimeFormatter.DateTimeFormatTokenizer"] = openfl_globalization__$DateTimeFormatter_DateTimeFormatTokenizer;
openfl_globalization__$DateTimeFormatter_DateTimeFormatTokenizer.__name__ = "openfl.globalization._DateTimeFormatter.DateTimeFormatTokenizer";
openfl_globalization__$DateTimeFormatter_DateTimeFormatTokenizer.tokenize = function(format) {
	var tokens = [];
	var unquotedText = "";
	var currentToken = null;
	var i = 0;
	while(i < format.length) {
		var char = format.charAt(i);
		++i;
		if(currentToken != null) {
			if(currentToken._hx_index == 0) {
				var text = currentToken.text;
				if(char == "'") {
					var nextChar = i < format.length ? format.charAt(i) : null;
					if(nextChar == "'") {
						currentToken = openfl_globalization__$DateTimeFormatter_DateTimeFormatToken.Text(text + char);
						++i;
					} else {
						tokens.push(currentToken);
						currentToken = null;
					}
				} else {
					currentToken = openfl_globalization__$DateTimeFormatter_DateTimeFormatToken.Text(text + char);
				}
				continue;
			}
		}
		var newToken;
		switch(char) {
		case "'":
			newToken = openfl_globalization__$DateTimeFormatter_DateTimeFormatToken.Text("");
			break;
		case "D":
			newToken = openfl_globalization__$DateTimeFormatter_DateTimeFormatToken.DayOfYear(1);
			break;
		case "E":
			newToken = openfl_globalization__$DateTimeFormatter_DateTimeFormatToken.Weekday(1);
			break;
		case "F":
			newToken = openfl_globalization__$DateTimeFormatter_DateTimeFormatToken.DayOfWeekOccurence;
			break;
		case "G":
			newToken = openfl_globalization__$DateTimeFormatter_DateTimeFormatToken.Era(1);
			break;
		case "H":
			newToken = openfl_globalization__$DateTimeFormatter_DateTimeFormatToken.Hour23(1);
			break;
		case "K":
			newToken = openfl_globalization__$DateTimeFormatter_DateTimeFormatToken.Hour11(1);
			break;
		case "M":
			newToken = openfl_globalization__$DateTimeFormatter_DateTimeFormatToken.Month(1);
			break;
		case "Q":
			newToken = openfl_globalization__$DateTimeFormatter_DateTimeFormatToken.Quarter(1);
			break;
		case "S":
			newToken = openfl_globalization__$DateTimeFormatter_DateTimeFormatToken.Millisecond(1);
			break;
		case "W":
			newToken = openfl_globalization__$DateTimeFormatter_DateTimeFormatToken.WeekOfMonth;
			break;
		case "Z":
			newToken = openfl_globalization__$DateTimeFormatter_DateTimeFormatToken.TimeZoneOffset(1);
			break;
		case "a":
			newToken = openfl_globalization__$DateTimeFormatter_DateTimeFormatToken.AMPM;
			break;
		case "d":
			newToken = openfl_globalization__$DateTimeFormatter_DateTimeFormatToken.Date(1);
			break;
		case "h":
			newToken = openfl_globalization__$DateTimeFormatter_DateTimeFormatToken.Hour12(1);
			break;
		case "k":
			newToken = openfl_globalization__$DateTimeFormatter_DateTimeFormatToken.Hour24(1);
			break;
		case "m":
			newToken = openfl_globalization__$DateTimeFormatter_DateTimeFormatToken.Minute(1);
			break;
		case "s":
			newToken = openfl_globalization__$DateTimeFormatter_DateTimeFormatToken.Second(1);
			break;
		case "v":
			newToken = openfl_globalization__$DateTimeFormatter_DateTimeFormatToken.TimeZone(1);
			break;
		case "w":
			newToken = openfl_globalization__$DateTimeFormatter_DateTimeFormatToken.WeekOfYear(1);
			break;
		case "y":
			newToken = openfl_globalization__$DateTimeFormatter_DateTimeFormatToken.Year(1);
			break;
		case "z":
			newToken = openfl_globalization__$DateTimeFormatter_DateTimeFormatToken.TimeZoneDST(1);
			break;
		default:
			if(new EReg("^[A-Za-z]$","").match(char)) {
				newToken = openfl_globalization__$DateTimeFormatter_DateTimeFormatToken.Invalid(char);
			} else {
				unquotedText += char;
				newToken = null;
			}
		}
		if(newToken != null && unquotedText.length > 0) {
			tokens.push(openfl_globalization__$DateTimeFormatter_DateTimeFormatToken.Text(unquotedText));
			unquotedText = "";
		}
		if(currentToken != null && newToken != null && $hxEnums[newToken.__enum__].__constructs__[newToken._hx_index]._hx_name == $hxEnums[currentToken.__enum__].__constructs__[currentToken._hx_index]._hx_name) {
			switch(currentToken._hx_index) {
			case 0:
				var text1 = currentToken.text;
				currentToken = openfl_globalization__$DateTimeFormatter_DateTimeFormatToken.Invalid(text1);
				break;
			case 1:
				var text2 = currentToken.text;
				currentToken = openfl_globalization__$DateTimeFormatter_DateTimeFormatToken.Invalid(text2);
				break;
			case 2:
				var length = currentToken.length;
				currentToken = openfl_globalization__$DateTimeFormatter_DateTimeFormatToken.Weekday(Math.min(5,length + 1) | 0);
				break;
			case 3:
				var length1 = currentToken.length;
				currentToken = openfl_globalization__$DateTimeFormatter_DateTimeFormatToken.Era(Math.min(5,length1 + 1) | 0);
				break;
			case 4:
				var length2 = currentToken.length;
				currentToken = openfl_globalization__$DateTimeFormatter_DateTimeFormatToken.Year(Math.min(5,length2 + 1) | 0);
				break;
			case 5:
				var length3 = currentToken.length;
				currentToken = openfl_globalization__$DateTimeFormatter_DateTimeFormatToken.Month(Math.min(5,length3 + 1) | 0);
				break;
			case 6:
				var length4 = currentToken.length;
				currentToken = openfl_globalization__$DateTimeFormatter_DateTimeFormatToken.Date(Math.min(2,length4 + 1) | 0);
				break;
			case 7:
				var length5 = currentToken.length;
				currentToken = openfl_globalization__$DateTimeFormatter_DateTimeFormatToken.Quarter(Math.min(4,length5 + 1) | 0);
				break;
			case 8:
				var length6 = currentToken.length;
				currentToken = openfl_globalization__$DateTimeFormatter_DateTimeFormatToken.WeekOfYear(Math.min(2,length6 + 1) | 0);
				break;
			case 9:
				currentToken = openfl_globalization__$DateTimeFormatter_DateTimeFormatToken.WeekOfMonth;
				break;
			case 10:
				var length7 = currentToken.length;
				currentToken = openfl_globalization__$DateTimeFormatter_DateTimeFormatToken.DayOfYear(Math.min(3,length7 + 1) | 0);
				break;
			case 11:
				currentToken = openfl_globalization__$DateTimeFormatter_DateTimeFormatToken.DayOfWeekOccurence;
				break;
			case 12:
				currentToken = openfl_globalization__$DateTimeFormatter_DateTimeFormatToken.AMPM;
				break;
			case 13:
				var length8 = currentToken.length;
				currentToken = openfl_globalization__$DateTimeFormatter_DateTimeFormatToken.Hour11(Math.min(2,length8 + 1) | 0);
				break;
			case 14:
				var length9 = currentToken.length;
				currentToken = openfl_globalization__$DateTimeFormatter_DateTimeFormatToken.Hour12(Math.min(2,length9 + 1) | 0);
				break;
			case 15:
				var length10 = currentToken.length;
				currentToken = openfl_globalization__$DateTimeFormatter_DateTimeFormatToken.Hour23(Math.min(2,length10 + 1) | 0);
				break;
			case 16:
				var length11 = currentToken.length;
				currentToken = openfl_globalization__$DateTimeFormatter_DateTimeFormatToken.Hour24(Math.min(2,length11 + 1) | 0);
				break;
			case 17:
				var length12 = currentToken.length;
				currentToken = openfl_globalization__$DateTimeFormatter_DateTimeFormatToken.Minute(Math.min(2,length12 + 1) | 0);
				break;
			case 18:
				var length13 = currentToken.length;
				currentToken = openfl_globalization__$DateTimeFormatter_DateTimeFormatToken.Second(Math.min(2,length13 + 1) | 0);
				break;
			case 19:
				var length14 = currentToken.length;
				currentToken = openfl_globalization__$DateTimeFormatter_DateTimeFormatToken.Millisecond(Math.min(5,length14 + 1) | 0);
				break;
			case 20:
				var length15 = currentToken.length;
				currentToken = openfl_globalization__$DateTimeFormatter_DateTimeFormatToken.TimeZone(Math.min(4,length15 + 1) | 0);
				break;
			case 21:
				var length16 = currentToken.length;
				currentToken = openfl_globalization__$DateTimeFormatter_DateTimeFormatToken.TimeZoneDST(Math.min(4,length16 + 1) | 0);
				break;
			case 22:
				var length17 = currentToken.length;
				currentToken = openfl_globalization__$DateTimeFormatter_DateTimeFormatToken.TimeZoneOffset(Math.min(4,length17 + 1) | 0);
				break;
			}
		} else {
			if(currentToken != null) {
				tokens.push(currentToken);
			}
			currentToken = newToken;
		}
	}
	if(currentToken != null) {
		tokens.push(currentToken);
		currentToken = null;
	}
	if(unquotedText.length > 0) {
		tokens.push(openfl_globalization__$DateTimeFormatter_DateTimeFormatToken.Text(unquotedText));
		unquotedText = "";
	}
	return tokens;
};
var openfl_globalization__$DateTimeFormatter_DateTimeFormatToken = $hxEnums["openfl.globalization._DateTimeFormatter.DateTimeFormatToken"] = { __ename__:"openfl.globalization._DateTimeFormatter.DateTimeFormatToken",__constructs__:null
	,Text: ($_=function(text) { return {_hx_index:0,text:text,__enum__:"openfl.globalization._DateTimeFormatter.DateTimeFormatToken",toString:$estr}; },$_._hx_name="Text",$_.__params__ = ["text"],$_)
	,Invalid: ($_=function(text) { return {_hx_index:1,text:text,__enum__:"openfl.globalization._DateTimeFormatter.DateTimeFormatToken",toString:$estr}; },$_._hx_name="Invalid",$_.__params__ = ["text"],$_)
	,Weekday: ($_=function(length) { return {_hx_index:2,length:length,__enum__:"openfl.globalization._DateTimeFormatter.DateTimeFormatToken",toString:$estr}; },$_._hx_name="Weekday",$_.__params__ = ["length"],$_)
	,Era: ($_=function(length) { return {_hx_index:3,length:length,__enum__:"openfl.globalization._DateTimeFormatter.DateTimeFormatToken",toString:$estr}; },$_._hx_name="Era",$_.__params__ = ["length"],$_)
	,Year: ($_=function(length) { return {_hx_index:4,length:length,__enum__:"openfl.globalization._DateTimeFormatter.DateTimeFormatToken",toString:$estr}; },$_._hx_name="Year",$_.__params__ = ["length"],$_)
	,Month: ($_=function(length) { return {_hx_index:5,length:length,__enum__:"openfl.globalization._DateTimeFormatter.DateTimeFormatToken",toString:$estr}; },$_._hx_name="Month",$_.__params__ = ["length"],$_)
	,Date: ($_=function(length) { return {_hx_index:6,length:length,__enum__:"openfl.globalization._DateTimeFormatter.DateTimeFormatToken",toString:$estr}; },$_._hx_name="Date",$_.__params__ = ["length"],$_)
	,Quarter: ($_=function(length) { return {_hx_index:7,length:length,__enum__:"openfl.globalization._DateTimeFormatter.DateTimeFormatToken",toString:$estr}; },$_._hx_name="Quarter",$_.__params__ = ["length"],$_)
	,WeekOfYear: ($_=function(length) { return {_hx_index:8,length:length,__enum__:"openfl.globalization._DateTimeFormatter.DateTimeFormatToken",toString:$estr}; },$_._hx_name="WeekOfYear",$_.__params__ = ["length"],$_)
	,WeekOfMonth: {_hx_name:"WeekOfMonth",_hx_index:9,__enum__:"openfl.globalization._DateTimeFormatter.DateTimeFormatToken",toString:$estr}
	,DayOfYear: ($_=function(length) { return {_hx_index:10,length:length,__enum__:"openfl.globalization._DateTimeFormatter.DateTimeFormatToken",toString:$estr}; },$_._hx_name="DayOfYear",$_.__params__ = ["length"],$_)
	,DayOfWeekOccurence: {_hx_name:"DayOfWeekOccurence",_hx_index:11,__enum__:"openfl.globalization._DateTimeFormatter.DateTimeFormatToken",toString:$estr}
	,AMPM: {_hx_name:"AMPM",_hx_index:12,__enum__:"openfl.globalization._DateTimeFormatter.DateTimeFormatToken",toString:$estr}
	,Hour11: ($_=function(length) { return {_hx_index:13,length:length,__enum__:"openfl.globalization._DateTimeFormatter.DateTimeFormatToken",toString:$estr}; },$_._hx_name="Hour11",$_.__params__ = ["length"],$_)
	,Hour12: ($_=function(length) { return {_hx_index:14,length:length,__enum__:"openfl.globalization._DateTimeFormatter.DateTimeFormatToken",toString:$estr}; },$_._hx_name="Hour12",$_.__params__ = ["length"],$_)
	,Hour23: ($_=function(length) { return {_hx_index:15,length:length,__enum__:"openfl.globalization._DateTimeFormatter.DateTimeFormatToken",toString:$estr}; },$_._hx_name="Hour23",$_.__params__ = ["length"],$_)
	,Hour24: ($_=function(length) { return {_hx_index:16,length:length,__enum__:"openfl.globalization._DateTimeFormatter.DateTimeFormatToken",toString:$estr}; },$_._hx_name="Hour24",$_.__params__ = ["length"],$_)
	,Minute: ($_=function(length) { return {_hx_index:17,length:length,__enum__:"openfl.globalization._DateTimeFormatter.DateTimeFormatToken",toString:$estr}; },$_._hx_name="Minute",$_.__params__ = ["length"],$_)
	,Second: ($_=function(length) { return {_hx_index:18,length:length,__enum__:"openfl.globalization._DateTimeFormatter.DateTimeFormatToken",toString:$estr}; },$_._hx_name="Second",$_.__params__ = ["length"],$_)
	,Millisecond: ($_=function(length) { return {_hx_index:19,length:length,__enum__:"openfl.globalization._DateTimeFormatter.DateTimeFormatToken",toString:$estr}; },$_._hx_name="Millisecond",$_.__params__ = ["length"],$_)
	,TimeZone: ($_=function(length) { return {_hx_index:20,length:length,__enum__:"openfl.globalization._DateTimeFormatter.DateTimeFormatToken",toString:$estr}; },$_._hx_name="TimeZone",$_.__params__ = ["length"],$_)
	,TimeZoneDST: ($_=function(length) { return {_hx_index:21,length:length,__enum__:"openfl.globalization._DateTimeFormatter.DateTimeFormatToken",toString:$estr}; },$_._hx_name="TimeZoneDST",$_.__params__ = ["length"],$_)
	,TimeZoneOffset: ($_=function(length) { return {_hx_index:22,length:length,__enum__:"openfl.globalization._DateTimeFormatter.DateTimeFormatToken",toString:$estr}; },$_._hx_name="TimeZoneOffset",$_.__params__ = ["length"],$_)
};
openfl_globalization__$DateTimeFormatter_DateTimeFormatToken.__constructs__ = [openfl_globalization__$DateTimeFormatter_DateTimeFormatToken.Text,openfl_globalization__$DateTimeFormatter_DateTimeFormatToken.Invalid,openfl_globalization__$DateTimeFormatter_DateTimeFormatToken.Weekday,openfl_globalization__$DateTimeFormatter_DateTimeFormatToken.Era,openfl_globalization__$DateTimeFormatter_DateTimeFormatToken.Year,openfl_globalization__$DateTimeFormatter_DateTimeFormatToken.Month,openfl_globalization__$DateTimeFormatter_DateTimeFormatToken.Date,openfl_globalization__$DateTimeFormatter_DateTimeFormatToken.Quarter,openfl_globalization__$DateTimeFormatter_DateTimeFormatToken.WeekOfYear,openfl_globalization__$DateTimeFormatter_DateTimeFormatToken.WeekOfMonth,openfl_globalization__$DateTimeFormatter_DateTimeFormatToken.DayOfYear,openfl_globalization__$DateTimeFormatter_DateTimeFormatToken.DayOfWeekOccurence,openfl_globalization__$DateTimeFormatter_DateTimeFormatToken.AMPM,openfl_globalization__$DateTimeFormatter_DateTimeFormatToken.Hour11,openfl_globalization__$DateTimeFormatter_DateTimeFormatToken.Hour12,openfl_globalization__$DateTimeFormatter_DateTimeFormatToken.Hour23,openfl_globalization__$DateTimeFormatter_DateTimeFormatToken.Hour24,openfl_globalization__$DateTimeFormatter_DateTimeFormatToken.Minute,openfl_globalization__$DateTimeFormatter_DateTimeFormatToken.Second,openfl_globalization__$DateTimeFormatter_DateTimeFormatToken.Millisecond,openfl_globalization__$DateTimeFormatter_DateTimeFormatToken.TimeZone,openfl_globalization__$DateTimeFormatter_DateTimeFormatToken.TimeZoneDST,openfl_globalization__$DateTimeFormatter_DateTimeFormatToken.TimeZoneOffset];
var openfl_globalization_DateTimeNameContext = {};
openfl_globalization_DateTimeNameContext.fromInt = function(value) {
	return value;
};
openfl_globalization_DateTimeNameContext.fromString = function(value) {
	switch(value) {
	case "format":
		return 0;
	case "standalone":
		return 1;
	default:
		return null;
	}
};
openfl_globalization_DateTimeNameContext.toInt = function(this1) {
	return this1;
};
openfl_globalization_DateTimeNameContext.toString = function(this1) {
	switch(this1) {
	case 0:
		return "format";
	case 1:
		return "standalone";
	default:
		return null;
	}
};
var openfl_globalization_DateTimeNameStyle = {};
openfl_globalization_DateTimeNameStyle.fromInt = function(value) {
	return value;
};
openfl_globalization_DateTimeNameStyle.fromString = function(value) {
	switch(value) {
	case "full":
		return 0;
	case "longAbbreviation":
		return 1;
	case "shortAbbreviation":
		return 2;
	default:
		return null;
	}
};
openfl_globalization_DateTimeNameStyle.toInt = function(this1) {
	return this1;
};
openfl_globalization_DateTimeNameStyle.toString = function(this1) {
	switch(this1) {
	case 0:
		return "full";
	case 1:
		return "longAbbreviation";
	case 2:
		return "shortAbbreviation";
	default:
		return null;
	}
};
var openfl_globalization_DateTimeStyle = {};
openfl_globalization_DateTimeStyle.fromInt = function(value) {
	return value;
};
openfl_globalization_DateTimeStyle.fromString = function(value) {
	switch(value) {
	case "custom":
		return 0;
	case "long":
		return 1;
	case "medium":
		return 2;
	case "none":
		return 3;
	case "short":
		return 4;
	default:
		return null;
	}
};
openfl_globalization_DateTimeStyle.toInt = function(this1) {
	return this1;
};
openfl_globalization_DateTimeStyle.toString = function(this1) {
	switch(this1) {
	case 0:
		return "custom";
	case 1:
		return "long";
	case 2:
		return "medium";
	case 3:
		return "none";
	case 4:
		return "short";
	default:
		return null;
	}
};
var openfl_globalization_LastOperationStatus = {};
openfl_globalization_LastOperationStatus.fromInt = function(value) {
	return value;
};
openfl_globalization_LastOperationStatus.fromString = function(value) {
	switch(value) {
	case "bufferOverflowError":
		return 0;
	case "errorCodeUnknown":
		return 1;
	case "illegalArgumentError":
		return 2;
	case "indexOutOfBoundsError":
		return 3;
	case "invalidAttrValue":
		return 4;
	case "invalidCharFound":
		return 5;
	case "memoryAllocationError":
		return 6;
	case "noError":
		return 7;
	case "numberOverflowError":
		return 8;
	case "parseError":
		return 9;
	case "patternSyntaxError":
		return 10;
	case "platformAPIFailed":
		return 11;
	case "truncatedCharFound":
		return 12;
	case "unexpectedToken":
		return 13;
	case "unsupportedError":
		return 14;
	case "usingDefaultWarning":
		return 15;
	case "usingFallbackWarning":
		return 16;
	default:
		return null;
	}
};
openfl_globalization_LastOperationStatus.toInt = function(this1) {
	return this1;
};
openfl_globalization_LastOperationStatus.toString = function(this1) {
	switch(this1) {
	case 0:
		return "bufferOverflowError";
	case 1:
		return "errorCodeUnknown";
	case 2:
		return "illegalArgumentError";
	case 3:
		return "indexOutOfBoundsError";
	case 4:
		return "invalidAttrValue";
	case 5:
		return "invalidCharFound";
	case 6:
		return "memoryAllocationError";
	case 7:
		return "noError";
	case 8:
		return "numberOverflowError";
	case 9:
		return "parseError";
	case 10:
		return "patternSyntaxError";
	case 11:
		return "platformAPIFailed";
	case 12:
		return "truncatedCharFound";
	case 13:
		return "unexpectedToken";
	case 14:
		return "unsupportedError";
	case 15:
		return "usingDefaultWarning";
	case 16:
		return "usingFallbackWarning";
	default:
		return null;
	}
};
var openfl_globalization_LocaleID = function(name) {
	if(name == "i-default") {
		this.name = name;
		this.language = name;
		this.region = "";
		this.script = "";
		this.rtl = false;
		this.lastOperationStatus = 7;
	} else {
		try {
			var intlLocale = new Intl.Locale(name).maximize();
			this.name = Reflect.field(intlLocale,"baseName");
			this.language = Reflect.field(intlLocale,"language");
			this.region = Reflect.field(intlLocale,"region");
			this.script = Reflect.field(intlLocale,"script");
			this.rtl = openfl_globalization_LocaleID.RTL_LANGUAGES.indexOf(this.language) != -1;
			this.lastOperationStatus = 7;
		} catch( _g ) {
			haxe_NativeStackTrace.lastError = _g;
			this.lastOperationStatus = 1;
		}
	}
};
$hxClasses["openfl.globalization.LocaleID"] = openfl_globalization_LocaleID;
openfl_globalization_LocaleID.__name__ = "openfl.globalization.LocaleID";
openfl_globalization_LocaleID.normalizeRequestedLocaleIDName = function(requestedLocaleIDName) {
	if(requestedLocaleIDName == null) {
		return null;
	}
	if(requestedLocaleIDName == "i-default") {
		requestedLocaleIDName = Intl.DateTimeFormat().resolvedOptions().locale;
	}
	var _this_r = new RegExp("_","g".split("u").join(""));
	requestedLocaleIDName = requestedLocaleIDName.replace(_this_r,"-");
	var parts = requestedLocaleIDName.split("-");
	var language = parts.shift();
	language = language.toLowerCase();
	if(language == "root") {
		language = "und";
	}
	var script = null;
	var region = null;
	if(parts.length > 0) {
		var next = parts.shift();
		if(next != null && next.length == 4) {
			script = next.charAt(0).toUpperCase() + HxOverrides.substr(next,1,null).toLowerCase();
			next = parts.shift();
		}
		if(next != null && (next.length == 2 || next.length == 3)) {
			region = next.toUpperCase();
			next = parts.shift();
		}
	}
	var result = language;
	if(script != null) {
		result += "-" + script;
	}
	if(region != null) {
		result += "-" + region;
	}
	return result;
};
openfl_globalization_LocaleID.prototype = {
	name: null
	,lastOperationStatus: null
	,language: null
	,region: null
	,script: null
	,rtl: null
	,getLanguage: function() {
		return this.language;
	}
	,getRegion: function() {
		return this.region;
	}
	,getScript: function() {
		return this.script;
	}
	,getVariant: function() {
		return "";
	}
	,isRightToLeft: function() {
		return this.rtl;
	}
	,__class__: openfl_globalization_LocaleID
};
var openfl_media_ID3Info = function() {
};
$hxClasses["openfl.media.ID3Info"] = openfl_media_ID3Info;
openfl_media_ID3Info.__name__ = "openfl.media.ID3Info";
openfl_media_ID3Info.prototype = {
	album: null
	,artist: null
	,comment: null
	,genre: null
	,songName: null
	,track: null
	,year: null
	,__class__: openfl_media_ID3Info
};
var openfl_media_SoundChannel = function(sound,audioSource,soundTransform) {
	this.__firstRun = true;
	openfl_events_EventDispatcher.call(this,this);
	this.__sound = sound;
	this.leftPeak = 1;
	this.rightPeak = 1;
	if(soundTransform != null) {
		this.__soundTransform = soundTransform;
	} else {
		this.__soundTransform = new openfl_media_SoundTransform();
	}
	this.__initAudioSource(audioSource);
	openfl_media_SoundMixer.__registerSoundChannel(this);
};
$hxClasses["openfl.media.SoundChannel"] = openfl_media_SoundChannel;
openfl_media_SoundChannel.__name__ = "openfl.media.SoundChannel";
openfl_media_SoundChannel.__super__ = openfl_events_EventDispatcher;
openfl_media_SoundChannel.prototype = $extend(openfl_events_EventDispatcher.prototype,{
	leftPeak: null
	,rightPeak: null
	,__sound: null
	,__isValid: null
	,__soundTransform: null
	,__audioSource: null
	,__sampleDataEvent: null
	,__processor: null
	,__firstRun: null
	,stop: function() {
		openfl_media_SoundMixer.__unregisterSoundChannel(this);
		if(!this.__isValid) {
			return;
		}
		if(this.__processor != null) {
			this.__processor.disconnect();
			this.__processor.onaudioprocess = null;
			this.__processor = null;
		}
		this.__audioSource.stop();
		this.__dispose();
	}
	,__dispose: function() {
		if(!this.__isValid) {
			return;
		}
		this.__audioSource.onComplete.remove($bind(this,this.audioSource_onComplete));
		this.__audioSource.dispose();
		this.__audioSource = null;
		this.__isValid = false;
	}
	,__startSampleData: function() {
		var _gthis = this;
		var webAudioContext = this.__sound.__webAudioContext;
		if(webAudioContext != null) {
			this.__sampleDataEvent = new openfl_events_SampleDataEvent("sampleData");
			this.__sound.dispatchEvent(this.__sampleDataEvent);
			var bufferSize = this.__sampleDataEvent.getBufferSize();
			if(bufferSize == 0) {
				openfl_Lib.setTimeout(function() {
					_gthis.stop();
					_gthis.dispatchEvent(new openfl_events_Event("soundComplete"));
				},1);
			} else {
				this.__processor = webAudioContext.createScriptProcessor(bufferSize,0,2);
				this.__processor.connect(webAudioContext.destination);
				this.__processor.onaudioprocess = $bind(this,this.onSample);
				webAudioContext.resume();
			}
		}
	}
	,__updateTransform: function() {
		this.set_soundTransform(this.get_soundTransform());
	}
	,__initAudioSource: function(audioSource) {
		this.__audioSource = audioSource;
		if(this.__audioSource == null) {
			return;
		}
		this.__audioSource.onComplete.add($bind(this,this.audioSource_onComplete));
		this.__isValid = true;
		this.__audioSource.play();
	}
	,get_position: function() {
		if(!this.__isValid) {
			return 0;
		}
		return this.__audioSource.get_currentTime() + this.__audioSource.offset;
	}
	,set_position: function(value) {
		if(!this.__isValid) {
			return 0;
		}
		this.__audioSource.set_currentTime((value | 0) - this.__audioSource.offset);
		return value;
	}
	,get_soundTransform: function() {
		return this.__soundTransform.clone();
	}
	,set_soundTransform: function(value) {
		if(value != null) {
			this.__soundTransform.pan = value.pan;
			this.__soundTransform.volume = value.volume;
			var pan = openfl_media_SoundMixer.__soundTransform.pan + this.__soundTransform.pan;
			if(pan < -1) {
				pan = -1;
			}
			if(pan > 1) {
				pan = 1;
			}
			var volume = openfl_media_SoundMixer.__soundTransform.volume * this.__soundTransform.volume;
			if(this.__isValid) {
				this.__audioSource.set_gain(volume);
				var position = this.__audioSource.get_position();
				position.x = pan;
				position.z = -1 * Math.sqrt(1 - Math.pow(pan,2));
				this.__audioSource.set_position(position);
				return value;
			}
		}
		return value;
	}
	,audioSource_onComplete: function() {
		openfl_media_SoundMixer.__unregisterSoundChannel(this);
		this.__dispose();
		this.dispatchEvent(new openfl_events_Event("soundComplete"));
	}
	,onSample: function(event) {
		var hasSampleData = false;
		if(this.__firstRun) {
			hasSampleData = true;
			this.__firstRun = false;
		} else {
			openfl_utils_ByteArray.set_length(this.__sampleDataEvent.data,0);
			this.__sound.dispatchEvent(this.__sampleDataEvent);
			hasSampleData = UInt.gt(openfl_utils_ByteArray.get_length(this.__sampleDataEvent.data),0);
		}
		if(hasSampleData) {
			this.__sampleDataEvent.getSamples(event);
		} else {
			this.stop();
			this.dispatchEvent(new openfl_events_Event("soundComplete"));
		}
	}
	,__class__: openfl_media_SoundChannel
	,__properties__: {set_soundTransform:"set_soundTransform",get_soundTransform:"get_soundTransform",set_position:"set_position",get_position:"get_position"}
});
var openfl_media_SoundLoaderContext = function(bufferTime,checkPolicyFile) {
	if(checkPolicyFile == null) {
		checkPolicyFile = false;
	}
	if(bufferTime == null) {
		bufferTime = 1000;
	}
	this.bufferTime = bufferTime;
	this.checkPolicyFile = checkPolicyFile;
};
$hxClasses["openfl.media.SoundLoaderContext"] = openfl_media_SoundLoaderContext;
openfl_media_SoundLoaderContext.__name__ = "openfl.media.SoundLoaderContext";
openfl_media_SoundLoaderContext.prototype = {
	bufferTime: null
	,checkPolicyFile: null
	,__class__: openfl_media_SoundLoaderContext
};
var openfl_media_SoundTransform = function(vol,panning) {
	if(panning == null) {
		panning = 0;
	}
	if(vol == null) {
		vol = 1;
	}
	this.volume = vol;
	this.pan = panning;
	this.leftToLeft = 0;
	this.leftToRight = 0;
	this.rightToLeft = 0;
	this.rightToRight = 0;
};
$hxClasses["openfl.media.SoundTransform"] = openfl_media_SoundTransform;
openfl_media_SoundTransform.__name__ = "openfl.media.SoundTransform";
openfl_media_SoundTransform.prototype = {
	leftToLeft: null
	,leftToRight: null
	,pan: null
	,rightToLeft: null
	,rightToRight: null
	,volume: null
	,clone: function() {
		return new openfl_media_SoundTransform(this.volume,this.pan);
	}
	,__class__: openfl_media_SoundTransform
};
var openfl_media_SoundMixer = function() { };
$hxClasses["openfl.media.SoundMixer"] = openfl_media_SoundMixer;
openfl_media_SoundMixer.__name__ = "openfl.media.SoundMixer";
openfl_media_SoundMixer.__properties__ = {set_soundTransform:"set_soundTransform",get_soundTransform:"get_soundTransform"};
openfl_media_SoundMixer.areSoundsInaccessible = function() {
	return false;
};
openfl_media_SoundMixer.stopAll = function() {
	var i = openfl_media_SoundMixer.__soundChannels.length;
	while(i > 0) {
		--i;
		openfl_media_SoundMixer.__soundChannels[i].stop();
	}
};
openfl_media_SoundMixer.__registerSoundChannel = function(soundChannel) {
	openfl_media_SoundMixer.__soundChannels.push(soundChannel);
};
openfl_media_SoundMixer.__unregisterSoundChannel = function(soundChannel) {
	HxOverrides.remove(openfl_media_SoundMixer.__soundChannels,soundChannel);
};
openfl_media_SoundMixer.get_soundTransform = function() {
	return openfl_media_SoundMixer.__soundTransform;
};
openfl_media_SoundMixer.__unregisterSoundChannelByBuffer = function(buffer) {
	var i = openfl_media_SoundMixer.__soundChannels.length;
	while(i > 0) {
		--i;
		var channel = openfl_media_SoundMixer.__soundChannels[i];
		if(channel.__audioSource.buffer == buffer) {
			channel.stop();
		}
	}
};
openfl_media_SoundMixer.set_soundTransform = function(value) {
	openfl_media_SoundMixer.__soundTransform = value.clone();
	var _g = 0;
	var _g1 = openfl_media_SoundMixer.__soundChannels;
	while(_g < _g1.length) {
		var channel = _g1[_g];
		++_g;
		channel.__updateTransform();
	}
	return value;
};
var openfl_media_Video = function(width,height) {
	if(height == null) {
		height = 240;
	}
	if(width == null) {
		width = 320;
	}
	openfl_display_DisplayObject.call(this);
	this.__drawableType = 8;
	this.__width = width;
	this.__height = height;
	this.__textureTime = -1;
	this.smoothing = false;
	this.deblocking = 0;
};
$hxClasses["openfl.media.Video"] = openfl_media_Video;
openfl_media_Video.__name__ = "openfl.media.Video";
openfl_media_Video.__super__ = openfl_display_DisplayObject;
openfl_media_Video.prototype = $extend(openfl_display_DisplayObject.prototype,{
	deblocking: null
	,smoothing: null
	,__active: null
	,__buffer: null
	,__bufferAlpha: null
	,__bufferColorTransform: null
	,__bufferContext: null
	,__bufferData: null
	,__currentWidth: null
	,__currentHeight: null
	,__dirty: null
	,__height: null
	,__indexBuffer: null
	,__indexBufferContext: null
	,__indexBufferData: null
	,__stream: null
	,__texture: null
	,__textureTime: null
	,__uvRect: null
	,__vertexBuffer: null
	,__vertexBufferContext: null
	,__vertexBufferData: null
	,__width: null
	,attachNetStream: function(netStream) {
		this.__stream = netStream;
		if(this.__stream != null && this.__stream.__video != null && !this.__stream.__closed) {
			this.__stream.__video.play();
		}
	}
	,clear: function() {
	}
	,__enterFrame: function(deltaTime) {
		if(this.__renderable && this.__stream != null) {
			if(!this.__renderDirty) {
				this.__renderDirty = true;
				this.__setParentRenderDirty();
			}
		}
	}
	,__getBounds: function(rect,matrix) {
		var bounds = openfl_geom_Rectangle.__pool.get();
		bounds.setTo(0,0,this.__width,this.__height);
		bounds.__transform(bounds,matrix);
		rect.__expand(bounds.x,bounds.y,bounds.width,bounds.height);
		openfl_geom_Rectangle.__pool.release(bounds);
	}
	,__getIndexBuffer: function(context) {
		var gl = context.gl;
		if(this.__indexBuffer == null || this.__indexBufferContext != context.__context) {
			var array = null;
			var vector = null;
			var view = null;
			var buffer = null;
			var len = null;
			this.__indexBufferData = new Uint16Array(6);
			this.__indexBufferData[0] = 0;
			this.__indexBufferData[1] = 1;
			this.__indexBufferData[2] = 2;
			this.__indexBufferData[3] = 2;
			this.__indexBufferData[4] = 1;
			this.__indexBufferData[5] = 3;
			this.__indexBufferContext = context.__context;
			this.__indexBuffer = context.createIndexBuffer(6);
			this.__indexBuffer.uploadFromTypedArray(this.__indexBufferData);
		}
		return this.__indexBuffer;
	}
	,__getTexture: function(context) {
		if(this.__stream == null || this.__stream.__video == null) {
			return null;
		}
		var gl = context.__context.webgl;
		var internalFormat = gl.RGBA;
		var format = gl.RGBA;
		if(!this.__stream.__closed && this.__stream.__video.currentTime != this.__textureTime) {
			if(this.__texture == null) {
				this.__texture = context.createRectangleTexture(this.__stream.__video.videoWidth,this.__stream.__video.videoHeight,1,false);
			}
			context.__bindGLTexture2D(this.__texture.__textureID);
			lime_graphics_WebGLRenderContext.texImage2D(gl,gl.TEXTURE_2D,0,internalFormat,format,gl.UNSIGNED_BYTE,this.__stream.__video);
			this.__textureTime = this.__stream.__video.currentTime;
		}
		return this.__texture;
	}
	,__getVertexBuffer: function(context) {
		var gl = context.gl;
		if(this.__vertexBuffer == null || this.__vertexBufferContext != context.__context || this.__currentWidth != this.get_width() || this.__currentHeight != this.get_height()) {
			this.__currentWidth = this.get_width();
			this.__currentHeight = this.get_height();
			var uvWidth = 1;
			var uvHeight = 1;
			var array = null;
			var vector = null;
			var view = null;
			var buffer = null;
			var len = null;
			this.__vertexBufferData = new Float32Array(20);
			this.__vertexBufferData[0] = this.get_width();
			this.__vertexBufferData[1] = this.get_height();
			this.__vertexBufferData[3] = uvWidth;
			this.__vertexBufferData[4] = uvHeight;
			this.__vertexBufferData[6] = this.get_height();
			this.__vertexBufferData[9] = uvHeight;
			this.__vertexBufferData[10] = this.get_width();
			this.__vertexBufferData[13] = uvWidth;
			this.__vertexBufferContext = context.__context;
			this.__vertexBuffer = context.createVertexBuffer(3,5);
			this.__vertexBuffer.uploadFromTypedArray(lime_utils_Float32Array.toArrayBufferView(this.__vertexBufferData));
		}
		return this.__vertexBuffer;
	}
	,__hitTest: function(x,y,shapeFlag,stack,interactiveOnly,hitObject) {
		if(!hitObject.get_visible() || this.__isMask) {
			return false;
		}
		if(this.get_mask() != null && !this.get_mask().__hitTestMask(x,y)) {
			return false;
		}
		this.__getRenderTransform();
		var _this = this.__renderTransform;
		var norm = _this.a * _this.d - _this.b * _this.c;
		var px = norm == 0 ? -_this.tx : 1.0 / norm * (_this.c * (_this.ty - y) + _this.d * (x - _this.tx));
		var _this = this.__renderTransform;
		var norm = _this.a * _this.d - _this.b * _this.c;
		var py = norm == 0 ? -_this.ty : 1.0 / norm * (_this.a * (y - _this.ty) + _this.b * (_this.tx - x));
		if(px > 0 && py > 0 && px <= this.__width && py <= this.__height) {
			if(stack != null && !interactiveOnly) {
				stack.push(hitObject);
			}
			return true;
		}
		return false;
	}
	,__hitTestMask: function(x,y) {
		var point = openfl_geom_Point.__pool.get();
		point.setTo(x,y);
		this.__globalToLocal(point,point);
		var hit = point.x > 0 && point.y > 0 && point.x <= this.__width && point.y <= this.__height;
		openfl_geom_Point.__pool.release(point);
		return hit;
	}
	,get_height: function() {
		return this.__height * this.get_scaleY();
	}
	,set_height: function(value) {
		if(this.get_scaleY() != 1 || value != this.__height) {
			this.__setTransformDirty();
			this.__dirty = true;
		}
		this.set_scaleY(1);
		return this.__height = value;
	}
	,get_videoHeight: function() {
		if(this.__stream != null && this.__stream.__video != null) {
			return this.__stream.__video.videoHeight | 0;
		}
		return 0;
	}
	,get_videoWidth: function() {
		if(this.__stream != null && this.__stream.__video != null) {
			return this.__stream.__video.videoWidth | 0;
		}
		return 0;
	}
	,get_width: function() {
		return this.__width * this.__scaleX;
	}
	,set_width: function(value) {
		if(this.__scaleX != 1 || this.__width != value) {
			this.__setTransformDirty();
			this.__dirty = true;
		}
		this.set_scaleX(1);
		return this.__width = value;
	}
	,__class__: openfl_media_Video
	,__properties__: $extend(openfl_display_DisplayObject.prototype.__properties__,{get_videoWidth:"get_videoWidth",get_videoHeight:"get_videoHeight"})
});
var openfl_net_FileFilter = function(description,extension,macType) {
	this.description = description;
	this.extension = extension;
	this.macType = macType;
};
$hxClasses["openfl.net.FileFilter"] = openfl_net_FileFilter;
openfl_net_FileFilter.__name__ = "openfl.net.FileFilter";
openfl_net_FileFilter.prototype = {
	description: null
	,extension: null
	,macType: null
	,__class__: openfl_net_FileFilter
};
var openfl_net_FileReference = function() {
	this.__pendingDownload = false;
	openfl_events_EventDispatcher.call(this);
	this.__inputControl = window.document.createElement("input");
	this.__inputControl.setAttribute("type","file");
	this.__inputControl.onclick = function(e) {
		e.cancelBubble = true;
		e.stopPropagation();
	};
};
$hxClasses["openfl.net.FileReference"] = openfl_net_FileReference;
openfl_net_FileReference.__name__ = "openfl.net.FileReference";
openfl_net_FileReference.__super__ = openfl_events_EventDispatcher;
openfl_net_FileReference.prototype = $extend(openfl_events_EventDispatcher.prototype,{
	creationDate: null
	,creator: null
	,data: null
	,modificationDate: null
	,name: null
	,size: null
	,type: null
	,extension: null
	,__data: null
	,__path: null
	,__urlLoader: null
	,__inputControl: null
	,__pendingDownload: null
	,__pendingDefaultFileName: null
	,browse: function(typeFilter) {
		var _gthis = this;
		this.__data = null;
		this.__path = null;
		var filter = null;
		if(typeFilter != null) {
			var filters = [];
			var _g = 0;
			while(_g < typeFilter.length) {
				var type = typeFilter[_g];
				++_g;
				filters.push(StringTools.replace(StringTools.replace(type.extension,"*.","."),";",","));
			}
			filter = filters.join(",");
		}
		if(filter != null) {
			this.__inputControl.setAttribute("accept",filter);
		} else {
			this.__inputControl.removeAttribute("accept");
		}
		this.__inputControl.onchange = function() {
			if(_gthis.__inputControl.files.length == 0) {
				_gthis.dispatchEvent(new openfl_events_Event("cancel"));
				return;
			}
			var file = _gthis.__inputControl.files[0];
			var tmp = new Date(file.lastModified);
			_gthis.modificationDate = tmp;
			_gthis.creationDate = _gthis.get_modificationDate();
			_gthis.size = file.size;
			var tmp = haxe_io_Path.extension(file.name);
			_gthis.type = "." + tmp;
			_gthis.name = haxe_io_Path.withoutDirectory(file.name);
			_gthis.__path = file.name;
			_gthis.dispatchEvent(new openfl_events_Event("select"));
		};
		this.__inputControl.click();
		return true;
	}
	,cancel: function() {
		if(this.__urlLoader != null) {
			this.__urlLoader.close();
		}
	}
	,download: function(request,defaultFileName) {
		this.__data = null;
		this.__path = null;
		this.__urlLoader = new openfl_net_URLLoader();
		this.__urlLoader.dataFormat = 0;
		this.__urlLoader.addEventListener("open",$bind(this,this.urlLoader_onOpen));
		this.__urlLoader.addEventListener("complete",$bind(this,this.urlLoader_download_onComplete));
		this.__urlLoader.addEventListener("ioError",$bind(this,this.urlLoader_onIOError));
		this.__urlLoader.addEventListener("progress",$bind(this,this.urlLoader_onProgress));
		this.__urlLoader.load(request);
		var saveFileDialog = new lime_ui_FileDialog();
		saveFileDialog.onCancel.add($bind(this,this.saveFileDialog_onCancel));
		saveFileDialog.onSelect.add($bind(this,this.saveFileDialog_onSelect));
		saveFileDialog.browse(lime_ui_FileDialogType.SAVE,defaultFileName != null ? haxe_io_Path.extension(defaultFileName) : null,defaultFileName);
		this.__pendingDownload = true;
		this.__pendingDefaultFileName = defaultFileName;
	}
	,load: function() {
		var _gthis = this;
		var file = this.__inputControl.files[0];
		var reader = new FileReader();
		reader.onload = function(evt) {
			_gthis.data = openfl_utils_ByteArray.fromArrayBuffer(evt.target.result);
			_gthis.openFileDialog_onComplete();
		};
		reader.onerror = function(evt) {
			_gthis.dispatchEvent(new openfl_events_IOErrorEvent("ioError"));
		};
		reader.readAsArrayBuffer(file);
	}
	,save: function(data,defaultFileName) {
		this.__data = null;
		this.__path = null;
		if(data == null) {
			return;
		}
		if(((data) instanceof openfl_utils_ByteArrayData)) {
			this.__data = data;
		} else {
			this.__data = new openfl_utils_ByteArrayData(0);
			this.__data.writeUTFBytes(Std.string(data));
		}
		var saveFileDialog = new lime_ui_FileDialog();
		saveFileDialog.onCancel.add($bind(this,this.saveFileDialog_onCancel));
		saveFileDialog.onSave.add($bind(this,this.saveFileDialog_onSave));
		saveFileDialog.save(this.__data,defaultFileName != null ? haxe_io_Path.extension(defaultFileName) : null,defaultFileName);
	}
	,upload: function(request,uploadDataFieldName,testUpload) {
		if(testUpload == null) {
			testUpload = false;
		}
		if(uploadDataFieldName == null) {
			uploadDataFieldName = "Filedata";
		}
		var _gthis = this;
		var file = this.__inputControl.files[0];
		var reader = new FileReader();
		reader.onload = function(evt) {
			var fileBytes = openfl_utils_ByteArray.fromArrayBuffer(evt.target.result);
			_gthis.__uploadFileBytes(request,uploadDataFieldName,fileBytes);
		};
		reader.onerror = function(evt) {
			_gthis.dispatchEvent(new openfl_events_IOErrorEvent("ioError"));
		};
	}
	,__uploadFileBytes: function(request,uploadDataFieldName,fileBytes) {
		var hasUrlVars = Type.typeof(request.data) == ValueType.TObject;
		if(hasUrlVars && request.method == "GET") {
			var getVariables = "";
			var fields = Reflect.fields(request.data);
			var startsWith = request.url.lastIndexOf("?") == -1 ? "?" : "&";
			var _g = 0;
			while(_g < fields.length) {
				var field = fields[_g];
				++_g;
				var value = Reflect.field(request.data,field);
				getVariables += getVariables.length == 0 ? startsWith : "&";
				getVariables += field + "=" + value;
			}
			request.url += getVariables;
		}
		var boundary = "----------KM7GI3GI3ae0GI3ae0cH2KM7Ef1cH2";
		var requestData = new openfl_utils_ByteArrayData(0);
		if(hasUrlVars && request.method == "POST") {
			var fields = Reflect.fields(request.data);
			var _g = 0;
			while(_g < fields.length) {
				var field = fields[_g];
				++_g;
				var value = Reflect.field(request.data,field);
				requestData.writeUTFBytes("--" + boundary + "\r\n");
				requestData.writeUTFBytes("Content-Disposition: form-data; name=\"" + field + "\"\r\n\r\n");
				requestData.writeUTFBytes(Std.string(value));
				requestData.writeUTFBytes("\r\n");
			}
		}
		requestData.writeUTFBytes("--" + boundary + "\r\n");
		requestData.writeUTFBytes("Content-Disposition: form-data; name=\"Filename\"\r\n\r\n");
		requestData.writeUTFBytes(this.get_name());
		requestData.writeUTFBytes("\r\n");
		requestData.writeUTFBytes("--" + boundary + "\r\n");
		requestData.writeUTFBytes("Content-Disposition: form-data; name=\"" + uploadDataFieldName + "\"; ");
		requestData.writeUTFBytes("filename=\"" + this.get_name() + "\"\r\n");
		requestData.writeUTFBytes("Content-Type: application/octet-stream\r\n\r\n");
		requestData.writeBytes(fileBytes,0,0);
		requestData.writeUTFBytes("\r\n");
		requestData.writeUTFBytes("--" + boundary + "\r\n");
		requestData.writeUTFBytes("Content-Disposition: form-data; name=\"Upload\"\r\n\r\n");
		requestData.writeUTFBytes("Submit Query");
		requestData.writeUTFBytes("\r\n");
		requestData.writeUTFBytes("--" + boundary + "--\r\n");
		request.data = requestData;
		request.method = "POST";
		request.contentType = "multipart/form-data; boundary=" + boundary;
		request.requestHeaders = [new openfl_net_URLRequestHeader("Accept","text/*"),new openfl_net_URLRequestHeader("Cache-Control","no-cache")];
		var urlLoader = new openfl_net_URLLoader();
		urlLoader.dataFormat = 0;
		urlLoader.addEventListener("open",$bind(this,this.urlLoader_onOpen));
		urlLoader.addEventListener("complete",$bind(this,this.urlLoader_upload_onComplete));
		urlLoader.addEventListener("httpResponseStatus",$bind(this,this.urlLoader_upload_onHttpResponseStatus));
		urlLoader.addEventListener("httpStatus",$bind(this,this.urlLoader_upload_onHttpStatus));
		urlLoader.addEventListener("progress",$bind(this,this.urlLoader_onProgress));
		urlLoader.addEventListener("ioError",$bind(this,this.urlLoader_onIOError));
		urlLoader.load(request);
	}
	,openFileDialog_onCancel: function() {
		this.dispatchEvent(new openfl_events_Event("cancel"));
	}
	,openFileDialog_onComplete: function() {
		this.dispatchEvent(new openfl_events_Event("complete"));
	}
	,openFileDialog_onSelect: function(path) {
		this.name = haxe_io_Path.withoutDirectory(path);
		this.__path = path;
		this.dispatchEvent(new openfl_events_Event("select"));
	}
	,saveFileDialog_onCancel: function() {
		this.dispatchEvent(new openfl_events_Event("cancel"));
	}
	,saveFileDialog_onSave: function(path) {
		var _gthis = this;
		haxe_Timer.delay(function() {
			_gthis.dispatchEvent(new openfl_events_Event("complete"));
		},1);
	}
	,saveFileDialog_onSelect: function(path) {
		this.dispatchEvent(new openfl_events_Event("select"));
	}
	,urlLoader_download_onComplete: function(event) {
		if(((this.__urlLoader.data) instanceof openfl_utils_ByteArrayData)) {
			this.__data = this.__urlLoader.data;
		} else {
			this.__data = new openfl_utils_ByteArrayData(0);
			this.__data.writeUTFBytes(Std.string(this.__urlLoader.data));
		}
		if(this.__pendingDownload) {
			var saveFileDialog = new lime_ui_FileDialog();
			saveFileDialog.save(this.__data,this.__pendingDefaultFileName != null ? haxe_io_Path.extension(this.__pendingDefaultFileName) : null,this.__pendingDefaultFileName);
			this.__pendingDownload = false;
			this.__pendingDefaultFileName = null;
		}
		this.dispatchEvent(event);
	}
	,urlLoader_upload_onHttpResponseStatus: function(event) {
		this.dispatchEvent(event);
	}
	,urlLoader_upload_onHttpStatus: function(event) {
		if(event.status == 200) {
			this.dispatchEvent(new openfl_events_Event("complete"));
		} else if(event.status != 0) {
			this.dispatchEvent(event);
		}
	}
	,urlLoader_upload_onComplete: function(event) {
		var urlLoader = event.currentTarget;
		this.dispatchEvent(new openfl_events_DataEvent("uploadCompleteData",false,false,urlLoader.data));
	}
	,urlLoader_onIOError: function(event) {
		if(this.__pendingDownload) {
			this.__pendingDownload = false;
			this.__pendingDefaultFileName = null;
		}
		this.dispatchEvent(event);
	}
	,urlLoader_onProgress: function(event) {
		this.dispatchEvent(event);
	}
	,urlLoader_onOpen: function(event) {
		this.dispatchEvent(event);
	}
	,get_creationDate: function() {
		return this.creationDate;
	}
	,get_modificationDate: function() {
		return this.modificationDate;
	}
	,get_name: function() {
		return this.name;
	}
	,get_size: function() {
		return this.size;
	}
	,get_type: function() {
		return this.type;
	}
	,get_extension: function() {
		return this.extension;
	}
	,__class__: openfl_net_FileReference
	,__properties__: {get_extension:"get_extension",get_type:"get_type",get_size:"get_size",get_name:"get_name",get_modificationDate:"get_modificationDate",get_creationDate:"get_creationDate"}
});
var openfl_net_IDynamicPropertyOutput = function() { };
$hxClasses["openfl.net.IDynamicPropertyOutput"] = openfl_net_IDynamicPropertyOutput;
openfl_net_IDynamicPropertyOutput.__name__ = "openfl.net.IDynamicPropertyOutput";
openfl_net_IDynamicPropertyOutput.__isInterface__ = true;
openfl_net_IDynamicPropertyOutput.prototype = {
	writeDynamicProperty: null
	,__class__: openfl_net_IDynamicPropertyOutput
};
var openfl_net_IDynamicPropertyWriter = function() { };
$hxClasses["openfl.net.IDynamicPropertyWriter"] = openfl_net_IDynamicPropertyWriter;
openfl_net_IDynamicPropertyWriter.__name__ = "openfl.net.IDynamicPropertyWriter";
openfl_net_IDynamicPropertyWriter.__isInterface__ = true;
openfl_net_IDynamicPropertyWriter.prototype = {
	writeDynamicProperties: null
	,__class__: openfl_net_IDynamicPropertyWriter
};
var openfl_net_NetConnection = function() {
	openfl_events_EventDispatcher.call(this);
};
$hxClasses["openfl.net.NetConnection"] = openfl_net_NetConnection;
openfl_net_NetConnection.__name__ = "openfl.net.NetConnection";
openfl_net_NetConnection.__super__ = openfl_events_EventDispatcher;
openfl_net_NetConnection.prototype = $extend(openfl_events_EventDispatcher.prototype,{
	connect: function(command,p1,p2,p3,p4,p5) {
		if(command != null) {
			throw haxe_Exception.thrown("Error: Can only connect in \"HTTP streaming\" mode");
		}
		this.dispatchEvent(new openfl_events_NetStatusEvent("netStatus",false,true,{ code : "NetConnection.Connect.Success"}));
	}
	,__class__: openfl_net_NetConnection
});
var openfl_net_NetStream = function(connection,peerID) {
	openfl_events_EventDispatcher.call(this);
	this.__connection = connection;
	this.__soundTransform = new openfl_media_SoundTransform();
	this.__video = window.document.createElement("video");
	this.__video.setAttribute("playsinline","");
	this.__video.setAttribute("webkit-playsinline","");
	this.__video.setAttribute("crossorigin","anonymous");
	this.__video.addEventListener("error",$bind(this,this.video_onError),false);
	this.__video.addEventListener("waiting",$bind(this,this.video_onWaiting),false);
	this.__video.addEventListener("ended",$bind(this,this.video_onEnd),false);
	this.__video.addEventListener("pause",$bind(this,this.video_onPause),false);
	this.__video.addEventListener("seeking",$bind(this,this.video_onSeeking),false);
	this.__video.addEventListener("playing",$bind(this,this.video_onPlaying),false);
	this.__video.addEventListener("timeupdate",$bind(this,this.video_onTimeUpdate),false);
	this.__video.addEventListener("loadstart",$bind(this,this.video_onLoadStart),false);
	this.__video.addEventListener("stalled",$bind(this,this.video_onStalled),false);
	this.__video.addEventListener("durationchange",$bind(this,this.video_onDurationChange),false);
	this.__video.addEventListener("canplay",$bind(this,this.video_onCanPlay),false);
	this.__video.addEventListener("canplaythrough",$bind(this,this.video_onCanPlayThrough),false);
	this.__video.addEventListener("loadedmetadata",$bind(this,this.video_onLoadMetaData),false);
};
$hxClasses["openfl.net.NetStream"] = openfl_net_NetStream;
openfl_net_NetStream.__name__ = "openfl.net.NetStream";
openfl_net_NetStream.__super__ = openfl_events_EventDispatcher;
openfl_net_NetStream.prototype = $extend(openfl_events_EventDispatcher.prototype,{
	audioCodec: null
	,bufferLength: null
	,bufferTime: null
	,bytesLoaded: null
	,bytesTotal: null
	,checkPolicyFile: null
	,client: null
	,currentFPS: null
	,decodedFrames: null
	,liveDelay: null
	,objectEncoding: null
	,time: null
	,videoCode: null
	,__closed: null
	,__connection: null
	,__soundTransform: null
	,__timer: null
	,__video: null
	,close: function() {
		if(this.__video == null) {
			return;
		}
		this.__closed = true;
		this.__video.pause();
		this.__video.src = "";
		this.time = 0;
	}
	,dispose: function() {
		this.close();
		this.__video = null;
	}
	,pause: function() {
		if(this.__video != null) {
			this.__video.pause();
		}
	}
	,play: function(url,p1,p2,p3,p4,p5) {
		if(this.__video == null) {
			return;
		}
		this.__video.volume = openfl_media_SoundMixer.__soundTransform.volume * this.__soundTransform.volume;
		if(typeof(url) == "string") {
			this.__video.src = url;
		} else {
			this.__video.srcObject = url;
		}
		this.__video.play();
	}
	,requestVideoStatus: function() {
		var _gthis = this;
		if(this.__video == null) {
			return;
		}
		if(this.__timer == null) {
			this.__timer = new haxe_Timer(1);
		}
		this.__timer.run = function() {
			if(_gthis.__video.paused) {
				_gthis.__playStatus("NetStream.Play.pause");
			} else {
				_gthis.__playStatus("NetStream.Play.playing");
			}
			_gthis.__timer.stop();
		};
	}
	,resume: function() {
		if(this.__video != null) {
			this.__video.play();
		}
	}
	,seek: function(time) {
		if(this.__video == null) {
			return;
		}
		if(time < 0) {
			time = 0;
		} else if(time > this.__video.duration) {
			time = this.__video.duration;
		}
		this.__dispatchStatus("NetStream.SeekStart.Notify");
		this.__video.currentTime = time;
	}
	,togglePause: function() {
		if(this.__video == null) {
			return;
		}
		if(this.__video.paused) {
			this.__video.play();
		} else {
			this.__video.pause();
		}
	}
	,__dispatchStatus: function(code) {
		var event = new openfl_events_NetStatusEvent("netStatus",false,false,{ code : code});
		this.__connection.dispatchEvent(event);
		this.dispatchEvent(event);
	}
	,__playStatus: function(code) {
		if(this.__video == null) {
			return;
		}
		if(this.client != null) {
			try {
				var handler = this.client.onPlayStatus;
				handler({ code : code, duration : this.__video.duration, position : this.__video.currentTime, speed : this.__video.playbackRate, start : this.__video.startTime});
			} catch( _g ) {
				haxe_NativeStackTrace.lastError = _g;
			}
		}
	}
	,video_onCanPlay: function(event) {
		this.__playStatus("NetStream.Play.canplay");
	}
	,video_onCanPlayThrough: function(event) {
		this.__playStatus("NetStream.Play.canplaythrough");
	}
	,video_onDurationChange: function(event) {
		this.__playStatus("NetStream.Play.durationchange");
	}
	,video_onEnd: function(event) {
		this.__dispatchStatus("NetStream.Play.Stop");
		this.__dispatchStatus("NetStream.Play.Complete");
		this.__playStatus("NetStream.Play.Complete");
	}
	,video_onError: function(event) {
		this.__dispatchStatus("NetStream.Play.Stop");
		this.__playStatus("NetStream.Play.error");
	}
	,video_onLoadMetaData: function(event) {
		if(this.__video == null) {
			return;
		}
		if(this.client != null) {
			try {
				var handler = this.client.onMetaData;
				handler({ width : this.__video.videoWidth, height : this.__video.videoHeight, duration : this.__video.duration});
			} catch( _g ) {
				haxe_NativeStackTrace.lastError = _g;
			}
		}
	}
	,video_onLoadStart: function(event) {
		this.__playStatus("NetStream.Play.loadstart");
	}
	,video_onPause: function(event) {
		this.__playStatus("NetStream.Play.pause");
	}
	,video_onPlaying: function(event) {
		this.__dispatchStatus("NetStream.Play.Start");
		this.__playStatus("NetStream.Play.playing");
	}
	,video_onSeeking: function(event) {
		this.__playStatus("NetStream.Play.seeking");
		this.__dispatchStatus("NetStream.Seek.Complete");
	}
	,video_onStalled: function(event) {
		this.__playStatus("NetStream.Play.stalled");
	}
	,video_onTimeUpdate: function(event) {
		if(this.__video == null) {
			return;
		}
		this.time = this.__video.currentTime;
		this.__playStatus("NetStream.Play.timeupdate");
	}
	,video_onWaiting: function(event) {
		this.__playStatus("NetStream.Play.waiting");
	}
	,get_soundTransform: function() {
		return this.__soundTransform.clone();
	}
	,set_soundTransform: function(value) {
		if(value != null) {
			this.__soundTransform.pan = value.pan;
			this.__soundTransform.volume = value.volume;
			if(this.__video != null) {
				this.__video.volume = openfl_media_SoundMixer.__soundTransform.volume * this.__soundTransform.volume;
			}
		}
		return value;
	}
	,get_speed: function() {
		if(this.__video != null) {
			return this.__video.playbackRate;
		} else {
			return 1;
		}
	}
	,set_speed: function(value) {
		if(this.__video != null) {
			return this.__video.playbackRate = value;
		} else {
			return value;
		}
	}
	,__class__: openfl_net_NetStream
	,__properties__: {set_speed:"set_speed",get_speed:"get_speed",set_soundTransform:"set_soundTransform",get_soundTransform:"get_soundTransform"}
});
var openfl_net_ObjectEncoding = {};
var openfl_net_SharedObject = function() {
	openfl_events_EventDispatcher.call(this);
	this.client = this;
	this.objectEncoding = openfl_net_SharedObject.defaultObjectEncoding;
};
$hxClasses["openfl.net.SharedObject"] = openfl_net_SharedObject;
openfl_net_SharedObject.__name__ = "openfl.net.SharedObject";
openfl_net_SharedObject.getLocal = function(name,localPath,secure) {
	if(secure == null) {
		secure = false;
	}
	var illegalValues = [" ","~","%","&","\\",";",":","\"","'",",","<",">","?","#"];
	var allowed = true;
	if(name == null || name == "") {
		allowed = false;
	} else {
		var _g = 0;
		while(_g < illegalValues.length) {
			var value = illegalValues[_g];
			++_g;
			if(name.indexOf(value) > -1) {
				allowed = false;
				break;
			}
		}
	}
	if(!allowed) {
		throw new openfl_errors_Error("Error #2134: Cannot create SharedObject.");
	}
	if(openfl_net_SharedObject.__sharedObjects == null) {
		openfl_net_SharedObject.__sharedObjects = new haxe_ds_StringMap();
		if(lime_app_Application.current != null) {
			lime_app_Application.current.onExit.add(openfl_net_SharedObject.application_onExit);
		}
	}
	var id = localPath + "/" + name;
	if(!Object.prototype.hasOwnProperty.call(openfl_net_SharedObject.__sharedObjects.h,id)) {
		var encodedData = null;
		try {
			var storage = js_Browser.getLocalStorage();
			if(localPath == null) {
				if(storage != null) {
					encodedData = storage.getItem(window.location.href + ":" + name);
					storage.removeItem(window.location.href + ":" + name);
				}
				localPath = window.location.pathname;
			}
			if(storage != null && encodedData == null) {
				encodedData = storage.getItem(localPath + ":" + name);
			}
		} catch( _g ) {
			haxe_NativeStackTrace.lastError = _g;
		}
		var sharedObject = new openfl_net_SharedObject();
		sharedObject.data = { };
		sharedObject.__localPath = localPath;
		sharedObject.__name = name;
		if(encodedData != null && encodedData != "") {
			try {
				var unserializer = new haxe_Unserializer(encodedData);
				unserializer.setResolver({ resolveEnum : Type.resolveEnum, resolveClass : openfl_net_SharedObject.__resolveClass});
				sharedObject.data = unserializer.unserialize();
			} catch( _g ) {
				haxe_NativeStackTrace.lastError = _g;
			}
		}
		openfl_net_SharedObject.__sharedObjects.h[id] = sharedObject;
	}
	return openfl_net_SharedObject.__sharedObjects.h[id];
};
openfl_net_SharedObject.getRemote = function(name,remotePath,persistence,secure) {
	if(secure == null) {
		secure = false;
	}
	if(persistence == null) {
		persistence = false;
	}
	openfl_utils__$internal_Lib.notImplemented({ fileName : "openfl/net/SharedObject.hx", lineNumber : 808, className : "openfl.net.SharedObject", methodName : "getRemote"});
	return null;
};
openfl_net_SharedObject.__getPath = function(localPath,name) {
	var path = lime_system_System.get_applicationStorageDirectory() + "/" + localPath + "/";
	name = StringTools.replace(name,"//","/");
	name = StringTools.replace(name,"//","/");
	if(StringTools.startsWith(name,"/")) {
		name = HxOverrides.substr(name,1,null);
	}
	if(StringTools.endsWith(name,"/")) {
		name = name.substring(0,name.length - 1);
	}
	if(name.indexOf("/") > -1) {
		var split = name.split("/");
		name = "";
		var _g = 0;
		var _g1 = split.length - 1;
		while(_g < _g1) {
			var i = _g++;
			name += "#" + split[i] + "/";
		}
		name += split[split.length - 1];
	}
	return path + name + ".sol";
};
openfl_net_SharedObject.__mkdir = function(directory) {
};
openfl_net_SharedObject.__resolveClass = function(name) {
	if(name != null) {
		if(StringTools.startsWith(name,"neash.")) {
			name = StringTools.replace(name,"neash.","openfl.");
		}
		if(StringTools.startsWith(name,"native.")) {
			name = StringTools.replace(name,"native.","openfl.");
		}
		if(StringTools.startsWith(name,"flash.")) {
			name = StringTools.replace(name,"flash.","openfl.");
		}
		if(StringTools.startsWith(name,"openfl._v2.")) {
			name = StringTools.replace(name,"openfl._v2.","openfl.");
		}
		if(StringTools.startsWith(name,"openfl._legacy.")) {
			name = StringTools.replace(name,"openfl._legacy.","openfl.");
		}
		return $hxClasses[name];
	}
	return null;
};
openfl_net_SharedObject.application_onExit = function(_) {
	var h = openfl_net_SharedObject.__sharedObjects.h;
	var sharedObject_h = h;
	var sharedObject_keys = Object.keys(h);
	var sharedObject_length = sharedObject_keys.length;
	var sharedObject_current = 0;
	while(sharedObject_current < sharedObject_length) {
		var sharedObject = sharedObject_h[sharedObject_keys[sharedObject_current++]];
		sharedObject.flush();
	}
};
openfl_net_SharedObject.__super__ = openfl_events_EventDispatcher;
openfl_net_SharedObject.prototype = $extend(openfl_events_EventDispatcher.prototype,{
	client: null
	,data: null
	,fps: null
	,objectEncoding: null
	,__localPath: null
	,__name: null
	,clear: function() {
		this.data = { };
		try {
			var storage = js_Browser.getLocalStorage();
			if(storage != null) {
				storage.removeItem(this.__localPath + ":" + this.__name);
			}
		} catch( _g ) {
			haxe_NativeStackTrace.lastError = _g;
		}
	}
	,close: function() {
	}
	,connect: function(myConnection,params) {
		openfl_utils__$internal_Lib.notImplemented({ fileName : "openfl/net/SharedObject.hx", lineNumber : 392, className : "openfl.net.SharedObject", methodName : "connect"});
	}
	,flush: function(minDiskSpace) {
		if(minDiskSpace == null) {
			minDiskSpace = 0;
		}
		if(Reflect.fields(this.data).length == 0) {
			return 0;
		}
		var encodedData = haxe_Serializer.run(this.data);
		try {
			var storage = js_Browser.getLocalStorage();
			if(storage != null) {
				storage.removeItem(this.__localPath + ":" + this.__name);
				storage.setItem(this.__localPath + ":" + this.__name,encodedData);
			}
		} catch( _g ) {
			haxe_NativeStackTrace.lastError = _g;
			return 1;
		}
		return 0;
	}
	,send: function(args) {
		openfl_utils__$internal_Lib.notImplemented({ fileName : "openfl/net/SharedObject.hx", lineNumber : 824, className : "openfl.net.SharedObject", methodName : "send"});
	}
	,setDirty: function(propertyName) {
	}
	,setProperty: function(propertyName,value) {
		if(this.data != null) {
			this.data[propertyName] = value;
		}
	}
	,get_size: function() {
		try {
			var d = haxe_Serializer.run(this.data);
			return haxe_io_Bytes.ofString(d).length;
		} catch( _g ) {
			haxe_NativeStackTrace.lastError = _g;
			return 0;
		}
	}
	,__class__: openfl_net_SharedObject
	,__properties__: {get_size:"get_size"}
});
var openfl_net_SharedObjectFlushStatus = {};
openfl_net_SharedObjectFlushStatus.fromString = function(value) {
	switch(value) {
	case "flushed":
		return 0;
	case "pending":
		return 1;
	default:
		return null;
	}
};
openfl_net_SharedObjectFlushStatus.toString = function(this1) {
	switch(this1) {
	case 0:
		return "flushed";
	case 1:
		return "pending";
	default:
		return null;
	}
};
var openfl_net_URLLoader = function(request) {
	openfl_events_EventDispatcher.call(this);
	this.bytesLoaded = 0;
	this.bytesTotal = 0;
	this.dataFormat = 1;
	if(request != null) {
		this.load(request);
	}
};
$hxClasses["openfl.net.URLLoader"] = openfl_net_URLLoader;
openfl_net_URLLoader.__name__ = "openfl.net.URLLoader";
openfl_net_URLLoader.__super__ = openfl_events_EventDispatcher;
openfl_net_URLLoader.prototype = $extend(openfl_events_EventDispatcher.prototype,{
	bytesLoaded: null
	,bytesTotal: null
	,data: null
	,dataFormat: null
	,__httpRequest: null
	,close: function() {
		if(this.__httpRequest != null) {
			this.__httpRequest.cancel();
		}
	}
	,load: function(request) {
		var _gthis = this;
		var openEvent = new openfl_events_Event("open");
		this.dispatchEvent(openEvent);
		if(this.dataFormat == 0) {
			var httpRequest = new lime_net__$HTTPRequest_$openfl_$utils_$ByteArray();
			this.__prepareRequest(httpRequest,request);
			httpRequest.load().onProgress($bind(this,this.httpRequest_onProgress)).onError($bind(this,this.httpRequest_onError)).onComplete(function(data) {
				_gthis.__dispatchResponseStatus();
				_gthis.__dispatchStatus();
				_gthis.data = data;
				var event = new openfl_events_Event("complete");
				_gthis.dispatchEvent(event);
			});
		} else {
			var httpRequest = new lime_net__$HTTPRequest_$String();
			this.__prepareRequest(httpRequest,request);
			httpRequest.load().onProgress($bind(this,this.httpRequest_onProgress)).onError($bind(this,this.httpRequest_onError)).onComplete(function(data) {
				_gthis.__dispatchResponseStatus();
				_gthis.__dispatchStatus();
				if(_gthis.dataFormat == 2) {
					_gthis.data = openfl_net_URLVariables._new(data);
				} else {
					_gthis.data = data;
				}
				var event = new openfl_events_Event("complete");
				_gthis.dispatchEvent(event);
			});
		}
	}
	,__dispatchResponseStatus: function() {
		var responseStatusEvent = new openfl_events_HTTPStatusEvent("httpResponseStatus",false,false,this.__httpRequest.responseStatus);
		responseStatusEvent.responseURL = this.__httpRequest.uri;
		var headers = [];
		if(this.__httpRequest.enableResponseHeaders && this.__httpRequest.responseHeaders != null) {
			var _g = 0;
			var _g1 = this.__httpRequest.responseHeaders;
			while(_g < _g1.length) {
				var header = _g1[_g];
				++_g;
				headers.push(new openfl_net_URLRequestHeader(header.name,header.value));
			}
		}
		responseStatusEvent.responseHeaders = headers;
		this.dispatchEvent(responseStatusEvent);
	}
	,__dispatchStatus: function() {
		var statusEvent = new openfl_events_HTTPStatusEvent("httpStatus",false,false,this.__httpRequest.responseStatus);
		this.dispatchEvent(statusEvent);
	}
	,__prepareRequest: function(httpRequest,request) {
		this.__httpRequest = httpRequest;
		this.__httpRequest.uri = request.url;
		this.__httpRequest.method = request.method;
		if(request.data != null) {
			if(Type.typeof(request.data) == ValueType.TObject) {
				var fields = Reflect.fields(request.data);
				var _g = 0;
				while(_g < fields.length) {
					var field = fields[_g];
					++_g;
					this.__httpRequest.formData.h[field] = Reflect.field(request.data,field);
				}
			} else if(((request.data) instanceof haxe_io_Bytes)) {
				this.__httpRequest.data = request.data;
			} else {
				this.__httpRequest.data = haxe_io_Bytes.ofString(Std.string(request.data));
			}
		}
		this.__httpRequest.contentType = request.contentType;
		if(request.requestHeaders != null) {
			var _g = 0;
			var _g1 = request.requestHeaders;
			while(_g < _g1.length) {
				var header = _g1[_g];
				++_g;
				this.__httpRequest.headers.push(new lime_net_HTTPRequestHeader(header.name,header.value));
			}
		}
		this.__httpRequest.followRedirects = request.followRedirects;
		this.__httpRequest.timeout = request.idleTimeout | 0;
		this.__httpRequest.manageCookies = request.manageCookies;
		this.__httpRequest.withCredentials = request.withCredentials;
		var userAgent = request.userAgent;
		if(userAgent == null) {
			userAgent = "Mozilla/5.0 (Windows; U; en) AppleWebKit/420+ (KHTML, like Gecko) OpenFL/1.0";
		}
		this.__httpRequest.userAgent = request.userAgent;
		this.__httpRequest.enableResponseHeaders = true;
	}
	,httpRequest_onError: function(error) {
		this.__dispatchResponseStatus();
		this.__dispatchStatus();
		if(((this.__httpRequest) instanceof lime_net__$HTTPRequest_$Bytes)) {
			var bytesRequest = this.__httpRequest;
			this.data = bytesRequest.responseData;
		} else if(((this.__httpRequest) instanceof lime_net__$HTTPRequest_$String)) {
			var stringRequest = this.__httpRequest;
			this.data = stringRequest.responseData;
		}
		if(error == 403) {
			var event = new openfl_events_SecurityErrorEvent("securityError");
			event.text = Std.string(error);
			this.dispatchEvent(event);
		} else {
			var event = new openfl_events_IOErrorEvent("ioError");
			event.text = Std.string(error);
			this.dispatchEvent(event);
		}
	}
	,httpRequest_onProgress: function(bytesLoaded,bytesTotal) {
		var event = new openfl_events_ProgressEvent("progress");
		event.bytesLoaded = bytesLoaded;
		event.bytesTotal = bytesTotal;
		this.dispatchEvent(event);
	}
	,__class__: openfl_net_URLLoader
});
var openfl_net_URLLoaderDataFormat = {};
openfl_net_URLLoaderDataFormat.fromString = function(value) {
	switch(value) {
	case "binary":
		return 0;
	case "text":
		return 1;
	case "variables":
		return 2;
	default:
		return null;
	}
};
openfl_net_URLLoaderDataFormat.toString = function(this1) {
	switch(this1) {
	case 0:
		return "binary";
	case 1:
		return "text";
	case 2:
		return "variables";
	default:
		return null;
	}
};
var openfl_net_URLRequest = function(url) {
	this.withCredentials = false;
	if(url != null) {
		this.url = url;
	}
	this.contentType = null;
	this.followRedirects = openfl_net_URLRequestDefaults.followRedirects;
	if(openfl_net_URLRequestDefaults.idleTimeout > 0) {
		this.idleTimeout = openfl_net_URLRequestDefaults.idleTimeout;
	} else {
		this.idleTimeout = 30000;
	}
	this.manageCookies = openfl_net_URLRequestDefaults.manageCookies;
	this.method = "GET";
	this.requestHeaders = [];
	this.userAgent = openfl_net_URLRequestDefaults.userAgent;
};
$hxClasses["openfl.net.URLRequest"] = openfl_net_URLRequest;
openfl_net_URLRequest.__name__ = "openfl.net.URLRequest";
openfl_net_URLRequest.prototype = {
	contentType: null
	,data: null
	,followRedirects: null
	,idleTimeout: null
	,manageCookies: null
	,withCredentials: null
	,method: null
	,requestHeaders: null
	,url: null
	,userAgent: null
	,__class__: openfl_net_URLRequest
};
var openfl_net_URLRequestDefaults = function() { };
$hxClasses["openfl.net.URLRequestDefaults"] = openfl_net_URLRequestDefaults;
openfl_net_URLRequestDefaults.__name__ = "openfl.net.URLRequestDefaults";
var openfl_net_URLRequestHeader = function(name,value) {
	if(value == null) {
		value = "";
	}
	if(name == null) {
		name = "";
	}
	this.name = name;
	this.value = value;
};
$hxClasses["openfl.net.URLRequestHeader"] = openfl_net_URLRequestHeader;
openfl_net_URLRequestHeader.__name__ = "openfl.net.URLRequestHeader";
openfl_net_URLRequestHeader.prototype = {
	name: null
	,value: null
	,__class__: openfl_net_URLRequestHeader
};
var openfl_net_URLVariables = {};
openfl_net_URLVariables._new = function(source) {
	var this1 = { };
	if(source != null) {
		openfl_net_URLVariables.decode(this1,source);
	}
	return this1;
};
openfl_net_URLVariables.decode = function(this1,source) {
	var fields = Reflect.fields(this1);
	var _g = 0;
	while(_g < fields.length) {
		var f = fields[_g];
		++_g;
		Reflect.deleteField(this1,f);
	}
	var fields = source.split("&");
	var _g = 0;
	while(_g < fields.length) {
		var f = fields[_g];
		++_g;
		var eq = f.indexOf("=");
		if(eq > 0) {
			var s = HxOverrides.substr(f,0,eq);
			var field = decodeURIComponent(s.split("+").join(" "));
			var s1 = HxOverrides.substr(f,eq + 1,null);
			this1[field] = decodeURIComponent(s1.split("+").join(" "));
		} else if(eq != 0) {
			this1[decodeURIComponent(f.split("+").join(" "))] = "";
		}
	}
};
openfl_net_URLVariables.toString = function(this1) {
	var result = [];
	var fields = Reflect.fields(this1);
	var _g = 0;
	while(_g < fields.length) {
		var f = fields[_g];
		++_g;
		var value = Reflect.field(this1,f);
		if(f.indexOf("[]") > -1 && ((value) instanceof Array)) {
			var _g1 = [];
			var x = $getIterator(value);
			while(x.hasNext()) {
				var x1 = x.next();
				_g1.push(encodeURIComponent(x1));
			}
			var arrayValue = _g1.join("&amp;" + f + "=");
			result.push(encodeURIComponent(f) + "=" + arrayValue);
		} else {
			var tmp = encodeURIComponent(f) + "=";
			var s = Std.string(value);
			result.push(tmp + encodeURIComponent(s));
		}
	}
	return result.join("&");
};
openfl_net_URLVariables.__get = function(this1,key) {
	return Reflect.field(this1,key);
};
openfl_net_URLVariables.__set = function(this1,key,value) {
	this1[key] = value;
};
var openfl_system_ApplicationDomain = function(parentDomain) {
	if(parentDomain != null) {
		this.parentDomain = parentDomain;
	} else {
		this.parentDomain = openfl_system_ApplicationDomain.currentDomain;
	}
};
$hxClasses["openfl.system.ApplicationDomain"] = openfl_system_ApplicationDomain;
openfl_system_ApplicationDomain.__name__ = "openfl.system.ApplicationDomain";
openfl_system_ApplicationDomain.prototype = {
	parentDomain: null
	,getDefinition: function(name) {
		return $hxClasses[name];
	}
	,hasDefinition: function(name) {
		return $hxClasses[name] != null;
	}
	,__class__: openfl_system_ApplicationDomain
};
var openfl_system_Capabilities = function() { };
$hxClasses["openfl.system.Capabilities"] = openfl_system_Capabilities;
openfl_system_Capabilities.__name__ = "openfl.system.Capabilities";
openfl_system_Capabilities.__properties__ = {get_version:"get_version",get_screenResolutionY:"get_screenResolutionY",get_screenResolutionX:"get_screenResolutionX",get_screenDPI:"get_screenDPI",get_pixelAspectRatio:"get_pixelAspectRatio",get_os:"get_os",get_manufacturer:"get_manufacturer",get_language:"get_language",get_cpuArchitecture:"get_cpuArchitecture"};
openfl_system_Capabilities.hasMultiChannelAudio = function(type) {
	return false;
};
openfl_system_Capabilities.get_cpuArchitecture = function() {
	return "x86";
};
openfl_system_Capabilities.get_language = function() {
	var language = lime_system_Locale.get_language(lime_system_Locale.get_currentLocale());
	if(language != null) {
		language = language.toLowerCase();
		switch(language) {
		case "cs":case "da":case "de":case "en":case "es":case "fi":case "fr":case "hu":case "it":case "ja":case "ko":case "nb":case "nl":case "pl":case "pt":case "ru":case "sv":case "tr":
			return language;
		case "zh":
			var region = lime_system_Locale.get_region(lime_system_Locale.get_currentLocale());
			if(region != null) {
				switch(region.toUpperCase()) {
				case "HANT":case "TW":
					return "zh-TW";
				default:
				}
			}
			return "zh-CN";
		default:
			return "xu";
		}
	}
	return "en";
};
openfl_system_Capabilities.get_manufacturer = function() {
	var name = lime_system_System.get_platformName();
	return "OpenFL" + (name != null ? " " + name : "");
};
openfl_system_Capabilities.get_os = function() {
	var label = lime_system_System.get_platformLabel();
	if(label != null) {
		return label;
	} else {
		return "";
	}
};
openfl_system_Capabilities.get_pixelAspectRatio = function() {
	return 1;
};
openfl_system_Capabilities.get_screenDPI = function() {
	var window1 = openfl_utils__$internal_Lib.application != null ? openfl_utils__$internal_Lib.application.__window : null;
	var screenDPI = 72;
	if(window1 != null) {
		screenDPI *= window1.__scale;
	}
	return screenDPI;
};
openfl_system_Capabilities.get_screenResolutionX = function() {
	var stage = openfl_utils__$internal_Lib.current.stage;
	var resolutionX = 0;
	if(stage == null) {
		return 0;
	}
	if(stage.window != null) {
		var display = stage.window.get_display();
		if(display != null) {
			resolutionX = Math.ceil(display.currentMode.width * stage.window.__scale);
		}
	}
	if(resolutionX > 0) {
		return resolutionX;
	}
	return stage.stageWidth;
};
openfl_system_Capabilities.get_screenResolutionY = function() {
	var stage = openfl_utils__$internal_Lib.current.stage;
	var resolutionY = 0;
	if(stage == null) {
		return 0;
	}
	if(stage.window != null) {
		var display = stage.window.get_display();
		if(display != null) {
			resolutionY = Math.ceil(display.currentMode.height * stage.window.__scale);
		}
	}
	if(resolutionY > 0) {
		return resolutionY;
	}
	return stage.stageHeight;
};
openfl_system_Capabilities.get_version = function() {
	var value = "WEB";
	value += " " + StringTools.replace("9.5.1",".",",") + ",0";
	return value;
};
var openfl_system_LoaderContext = function(checkPolicyFile,applicationDomain,securityDomain) {
	if(checkPolicyFile == null) {
		checkPolicyFile = false;
	}
	this.checkPolicyFile = checkPolicyFile;
	this.securityDomain = securityDomain;
	this.applicationDomain = applicationDomain;
	this.allowCodeImport = true;
	this.allowLoadBytesCodeExecution = true;
};
$hxClasses["openfl.system.LoaderContext"] = openfl_system_LoaderContext;
openfl_system_LoaderContext.__name__ = "openfl.system.LoaderContext";
openfl_system_LoaderContext.prototype = {
	allowCodeImport: null
	,allowLoadBytesCodeExecution: null
	,applicationDomain: null
	,checkPolicyFile: null
	,securityDomain: null
	,__class__: openfl_system_LoaderContext
};
var openfl_system_SecurityDomain = function() {
};
$hxClasses["openfl.system.SecurityDomain"] = openfl_system_SecurityDomain;
openfl_system_SecurityDomain.__name__ = "openfl.system.SecurityDomain";
openfl_system_SecurityDomain.prototype = {
	__class__: openfl_system_SecurityDomain
};
var openfl_system_TouchscreenType = {};
openfl_system_TouchscreenType.fromString = function(value) {
	switch(value) {
	case "finger":
		return 0;
	case "none":
		return 1;
	case "stylus":
		return 2;
	default:
		return null;
	}
};
openfl_system_TouchscreenType.toString = function(this1) {
	switch(this1) {
	case 0:
		return "finger";
	case 1:
		return "none";
	case 2:
		return "stylus";
	default:
		return null;
	}
};
var openfl_text_AntiAliasType = {};
openfl_text_AntiAliasType.fromString = function(value) {
	switch(value) {
	case "advanced":
		return 0;
	case "normal":
		return 1;
	default:
		return null;
	}
};
openfl_text_AntiAliasType.toString = function(this1) {
	switch(this1) {
	case 0:
		return "advanced";
	case 1:
		return "normal";
	default:
		return null;
	}
};
var openfl_text_Font = function(name) {
	lime_text_Font.call(this,name);
};
$hxClasses["openfl.text.Font"] = openfl_text_Font;
openfl_text_Font.__name__ = "openfl.text.Font";
openfl_text_Font.enumerateFonts = function(enumerateDeviceFonts) {
	if(enumerateDeviceFonts == null) {
		enumerateDeviceFonts = false;
	}
	return openfl_text_Font.__registeredFonts;
};
openfl_text_Font.fromBytes = function(bytes) {
	var font = new openfl_text_Font();
	font.__fromBytes(openfl_utils_ByteArray.toBytes(bytes));
	return font;
};
openfl_text_Font.fromFile = function(path) {
	if(path == null) {
		return null;
	}
	var font = new openfl_text_Font();
	font.__fromFile(path);
	return font;
};
openfl_text_Font.loadFromBytes = function(bytes) {
	return lime_text_Font.loadFromBytes(openfl_utils_ByteArray.toBytes(bytes)).then(function(limeFont) {
		var font = new openfl_text_Font();
		font.__fromLimeFont(limeFont);
		return lime_app_Future.withValue(font);
	});
};
openfl_text_Font.loadFromFile = function(path) {
	return lime_text_Font.loadFromFile(path).then(function(limeFont) {
		var font = new openfl_text_Font();
		font.__fromLimeFont(limeFont);
		return lime_app_Future.withValue(font);
	});
};
openfl_text_Font.loadFromName = function(path) {
	return lime_text_Font.loadFromName(path).then(function(limeFont) {
		var font = new openfl_text_Font();
		font.__fromLimeFont(limeFont);
		return lime_app_Future.withValue(font);
	});
};
openfl_text_Font.registerFont = function(font) {
	var instance = null;
	if(js_Boot.getClass(font) == null) {
		instance = js_Boot.__cast(Type.createInstance(font,[]) , openfl_text_Font);
	} else {
		instance = js_Boot.__cast(font , openfl_text_Font);
	}
	if(instance != null) {
		openfl_text_Font.__registeredFonts.push(instance);
		openfl_text_Font.__fontByName.h[instance.name] = instance;
	}
};
openfl_text_Font.__super__ = lime_text_Font;
openfl_text_Font.prototype = $extend(lime_text_Font.prototype,{
	fontStyle: null
	,fontType: null
	,__initialized: null
	,__fromLimeFont: function(font) {
		this.__copyFrom(font);
	}
	,__initialize: function() {
		return this.__initialized;
	}
	,get_fontName: function() {
		return this.name;
	}
	,set_fontName: function(value) {
		return this.name = value;
	}
	,__class__: openfl_text_Font
	,__properties__: {set_fontName:"set_fontName",get_fontName:"get_fontName"}
});
var openfl_text_FontStyle = {};
openfl_text_FontStyle.fromString = function(value) {
	switch(value) {
	case "bold":
		return 0;
	case "boldItalic":
		return 1;
	case "italic":
		return 2;
	case "regular":
		return 3;
	default:
		return null;
	}
};
openfl_text_FontStyle.toString = function(this1) {
	switch(this1) {
	case 0:
		return "bold";
	case 1:
		return "boldItalic";
	case 2:
		return "italic";
	case 3:
		return "regular";
	default:
		return null;
	}
};
var openfl_text_FontType = {};
openfl_text_FontType.fromString = function(value) {
	switch(value) {
	case "device":
		return 0;
	case "embedded":
		return 1;
	case "embeddedCFF":
		return 2;
	default:
		return null;
	}
};
openfl_text_FontType.toString = function(this1) {
	switch(this1) {
	case 0:
		return "device";
	case 1:
		return "embedded";
	case 2:
		return "embeddedCFF";
	default:
		return null;
	}
};
var openfl_text_GridFitType = {};
openfl_text_GridFitType.fromString = function(value) {
	switch(value) {
	case "none":
		return 0;
	case "pixel":
		return 1;
	case "subpixel":
		return 2;
	default:
		return null;
	}
};
openfl_text_GridFitType.toString = function(this1) {
	switch(this1) {
	case 0:
		return "none";
	case 1:
		return "pixel";
	case 2:
		return "subpixel";
	default:
		return null;
	}
};
var openfl_text_TextFieldAutoSize = {};
openfl_text_TextFieldAutoSize.fromString = function(value) {
	switch(value) {
	case "center":
		return 0;
	case "left":
		return 1;
	case "none":
		return 2;
	case "right":
		return 3;
	default:
		return null;
	}
};
openfl_text_TextFieldAutoSize.toString = function(this1) {
	switch(this1) {
	case 0:
		return "center";
	case 1:
		return "left";
	case 2:
		return "none";
	case 3:
		return "right";
	default:
		return null;
	}
};
var openfl_text_TextFieldType = {};
openfl_text_TextFieldType.fromString = function(value) {
	switch(value) {
	case "dynamic":
		return 0;
	case "input":
		return 1;
	default:
		return null;
	}
};
openfl_text_TextFieldType.toString = function(this1) {
	switch(this1) {
	case 0:
		return "dynamic";
	case 1:
		return "input";
	default:
		return null;
	}
};
var openfl_text_TextFormat = function(font,size,color,bold,italic,underline,url,target,align,leftMargin,rightMargin,indent,leading) {
	this.set_font(font);
	this.set_size(size);
	this.color = color;
	this.set_bold(bold);
	this.set_italic(italic);
	this.underline = underline;
	this.url = url;
	this.target = target;
	this.align = align;
	this.leftMargin = leftMargin;
	this.rightMargin = rightMargin;
	this.indent = indent;
	this.leading = leading;
};
$hxClasses["openfl.text.TextFormat"] = openfl_text_TextFormat;
openfl_text_TextFormat.__name__ = "openfl.text.TextFormat";
openfl_text_TextFormat.prototype = {
	align: null
	,blockIndent: null
	,bold: null
	,bullet: null
	,color: null
	,font: null
	,indent: null
	,italic: null
	,kerning: null
	,leading: null
	,leftMargin: null
	,letterSpacing: null
	,rightMargin: null
	,size: null
	,strikethrough: null
	,tabStops: null
	,target: null
	,underline: null
	,url: null
	,__ascent: null
	,__descent: null
	,__cacheKey: null
	,clone: function() {
		var newFormat = new openfl_text_TextFormat(this.font,this.size,this.color,this.bold,this.italic,this.underline,this.url,this.target);
		newFormat.align = this.align;
		newFormat.leftMargin = this.leftMargin;
		newFormat.rightMargin = this.rightMargin;
		newFormat.indent = this.indent;
		newFormat.leading = this.leading;
		newFormat.blockIndent = this.blockIndent;
		newFormat.bullet = this.bullet;
		newFormat.kerning = this.kerning;
		newFormat.letterSpacing = this.letterSpacing;
		newFormat.tabStops = this.tabStops;
		newFormat.strikethrough = this.strikethrough;
		newFormat.__ascent = this.__ascent;
		newFormat.__descent = this.__descent;
		newFormat.__cacheKey = this.__toCacheKey();
		return newFormat;
	}
	,__merge: function(format) {
		if(format.font != null) {
			this.set_font(format.font);
		}
		if(format.size != null) {
			this.set_size(format.size);
		}
		if(format.color != null) {
			this.color = format.color;
		}
		if(format.bold != null) {
			this.set_bold(format.bold);
		}
		if(format.italic != null) {
			this.set_italic(format.italic);
		}
		if(format.underline != null) {
			this.underline = format.underline;
		}
		if(format.url != null) {
			this.url = format.url;
		}
		if(format.target != null) {
			this.target = format.target;
		}
		if(format.align != null) {
			this.align = format.align;
		}
		if(format.leftMargin != null) {
			this.leftMargin = format.leftMargin;
		}
		if(format.rightMargin != null) {
			this.rightMargin = format.rightMargin;
		}
		if(format.indent != null) {
			this.indent = format.indent;
		}
		if(format.leading != null) {
			this.leading = format.leading;
		}
		if(format.blockIndent != null) {
			this.blockIndent = format.blockIndent;
		}
		if(format.bullet != null) {
			this.bullet = format.bullet;
		}
		if(format.kerning != null) {
			this.kerning = format.kerning;
		}
		if(format.letterSpacing != null) {
			this.letterSpacing = format.letterSpacing;
		}
		if(format.tabStops != null) {
			this.tabStops = format.tabStops;
		}
		if(format.strikethrough != null) {
			this.strikethrough = format.strikethrough;
		}
		if(format.__ascent != null) {
			this.__ascent = format.__ascent;
		}
		if(format.__descent != null) {
			this.__descent = format.__descent;
		}
		this.__toCacheKey();
	}
	,__toCacheKey: function() {
		return this.__cacheKey = "" + this.font + this.size + Std.string(this.bold) + Std.string(this.italic);
	}
	,set_font: function(value) {
		if(this.font != value) {
			this.font = value;
			this.__toCacheKey();
		}
		return this.font;
	}
	,set_size: function(value) {
		if(this.size != value) {
			this.size = value;
			this.__toCacheKey();
		}
		return this.size;
	}
	,set_bold: function(value) {
		if(this.bold != value) {
			this.bold = value;
			this.__toCacheKey();
		}
		return this.bold;
	}
	,set_italic: function(value) {
		if(this.italic != value) {
			this.italic = value;
			this.__toCacheKey();
		}
		return this.italic;
	}
	,__class__: openfl_text_TextFormat
	,__properties__: {set_size:"set_size",set_italic:"set_italic",set_font:"set_font",set_bold:"set_bold"}
};
var openfl_text_TextFormatAlign = {};
openfl_text_TextFormatAlign.fromString = function(value) {
	switch(value) {
	case "center":
		return 0;
	case "end":
		return 1;
	case "justify":
		return 2;
	case "left":
		return 3;
	case "right":
		return 4;
	case "start":
		return 5;
	default:
		return null;
	}
};
openfl_text_TextFormatAlign.toString = function(this1) {
	switch(this1) {
	case 0:
		return "center";
	case 1:
		return "end";
	case 2:
		return "justify";
	case 3:
		return "left";
	case 4:
		return "right";
	case 5:
		return "start";
	default:
		return null;
	}
};
var openfl_text_TextLineMetrics = function(x,width,height,ascent,descent,leading) {
	this.x = x;
	this.width = width;
	this.height = height;
	this.ascent = ascent;
	this.descent = descent;
	this.leading = leading;
};
$hxClasses["openfl.text.TextLineMetrics"] = openfl_text_TextLineMetrics;
openfl_text_TextLineMetrics.__name__ = "openfl.text.TextLineMetrics";
openfl_text_TextLineMetrics.prototype = {
	ascent: null
	,descent: null
	,height: null
	,leading: null
	,width: null
	,x: null
	,__class__: openfl_text_TextLineMetrics
};
var openfl_text__$internal_CSSParser = function(options) {
	this.importRegex = new EReg("@import .*?;","ig");
	this.commentRegex = "(\\/\\*[\\s\\S]*?\\*\\/)";
	this.combinedCSSRegex = "((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)*?})";
	this.keyframeRegex = "((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})";
	this.mediaQueryRegex = "((@media [\\s\\S]*?){([\\s\\S]*?}\\s*?)})";
	this.cssRegex = new EReg("([\\s\\S]*?){([\\s\\S]*?)*}","ig");
	this.keyframeStatements = [];
	this.importStatements = [];
};
$hxClasses["openfl.text._internal.CSSParser"] = openfl_text__$internal_CSSParser;
openfl_text__$internal_CSSParser.__name__ = "openfl.text._internal.CSSParser";
openfl_text__$internal_CSSParser.prototype = {
	source: null
	,options: null
	,importStatements: null
	,keyframeStatements: null
	,cssRegex: null
	,mediaQueryRegex: null
	,keyframeRegex: null
	,combinedCSSRegex: null
	,commentRegex: null
	,importRegex: null
	,stripComments: function(css) {
		var regex_r = new RegExp(this.commentRegex,"ig".split("u").join(""));
		return css.replace(regex_r,"");
	}
	,parseRules: function(rules) {
		var rulesReg = new EReg("(\\*?[-#/\\*\\\\\\w]+(\\[[0-9a-z_-]+\\])?)+((?:'(?:\\\\'|.)*?'|\"(?:\\\\\"|.)*?\"|\\([^\\)]*?\\)|[^};])+)","g");
		var arr = this.getMatches(rulesReg,rules);
		var ret = [];
		var _g = 0;
		var _g1 = arr.length;
		while(_g < _g1) {
			var i = _g++;
			if(!rulesReg.match(arr[i])) {
				return null;
			}
			rules = rulesReg.matched(0).split("\r\n").join("\n");
			var line = rules;
			line = StringTools.trim(line);
			if(line.indexOf(":") != -1) {
				var directive = StringTools.trim(line.split(":")[0]);
				var value = StringTools.trim(line.split(":")[1]);
				if(directive.length < 1 || value.length < 1) {
					continue;
				}
				var _g2 = new haxe_ds_StringMap();
				_g2.h["type"] = "declaration";
				_g2.h["property"] = directive;
				_g2.h["value"] = value;
				ret.push(_g2);
			} else if(HxOverrides.substr(StringTools.trim(line),0,7) == "base64,") {
				var _line = line + StringTools.trim(line);
				ret[ret.length - 1].h["value"] = _line;
			} else if(line.length > 0) {
				var _g3 = new haxe_ds_StringMap();
				_g3.h["type"] = "declaration";
				_g3.h["property"] = "";
				_g3.h["value"] = line;
				_g3.h["defective"] = true;
				ret.push(_g3);
			}
		}
		return ret;
	}
	,findCorrespondingRule: function(rules,directive,value) {
		var ret = null;
		var _g = 0;
		var _g1 = rules.length;
		while(_g < _g1) {
			var i = _g++;
			if(rules[i].h["directive"] == directive) {
				ret = rules[i];
				if(value == rules[i].h["value"]) {
					break;
				}
			}
		}
		return ret;
	}
	,findBySelector: function(objectArray,selector,contains) {
		if(contains == null) {
			contains = false;
		}
		var found = [];
		var _g = 0;
		var _g1 = objectArray.length;
		while(_g < _g1) {
			var i = _g++;
			if(contains == false) {
				if(objectArray[i].h["selector"] == selector) {
					found.push(objectArray[i]);
				}
			} else if((js_Boot.__cast(objectArray[i].h["selector"] , String)).indexOf(selector) != -1) {
				found.push(objectArray[i]);
			}
		}
		if(selector == "@imports" || found.length < 2) {
			return found;
		} else {
			var base = found[0];
			var _g = 0;
			var _g1 = found.length;
			while(_g < _g1) {
				var i = _g++;
				this.intelligentCSSPush([base],found[i]);
			}
			return [base];
		}
	}
	,deleteBySelector: function(objectArray,selector) {
		var ret = [];
		var _g = 0;
		var _g1 = objectArray.length;
		while(_g < _g1) {
			var i = _g++;
			if(objectArray[i].h["selector"] != selector) {
				ret.push(objectArray[i]);
			}
		}
		return ret;
	}
	,compress: function(objectArray) {
		var compressed = [];
		var done_h = Object.create(null);
		var _g = 0;
		var _g1 = objectArray.length;
		while(_g < _g1) {
			var i = _g++;
			var obj = objectArray[i];
			if(done_h[obj.h["selector"]] == true) {
				continue;
			}
			var found = this.findBySelector(objectArray,obj.h["selector"]);
			if(found.length != 0) {
				compressed = compressed.concat(found);
				done_h["selector"] = true;
			}
		}
		return compressed;
	}
	,diff: function(object1,object2) {
		if(object1.h["selector"] == object2.h["selector"]) {
			return null;
		}
		if(object1.h["type"] == "media" || object2.h["type"] == "media") {
			return null;
		}
		var _g = new haxe_ds_StringMap();
		_g.h["selector"] = object1.h["selector"];
		var value = [];
		_g.h["rules"] = value;
		var diff = _g;
		var rule1 = new haxe_ds_StringMap();
		var rule2 = new haxe_ds_StringMap();
		var _length = (js_Boot.__cast(object1.h["rules"] , Array)).length;
		var _length2 = (js_Boot.__cast(object2.h["rules"] , Array)).length;
		var _g = 0;
		var _g1 = _length;
		while(_g < _g1) {
			var i = _g++;
			rule1 = (js_Boot.__cast(object1.h["rules"] , Array))[1];
			rule2 = this.findCorrespondingRule(object2.h["rules"],object1.h["directive"],object1.h["value"]);
			if(rule2 == null) {
				(js_Boot.__cast(diff.h["rules"] , Array)).push(rule1);
			} else if(rule1.h["value"] != rule2.h["value"]) {
				(js_Boot.__cast(diff.h["rules"] , Array)).push(rule1);
			}
		}
		var _g = 0;
		var _g1 = _length2;
		while(_g < _g1) {
			var i = _g++;
			rule2 = (js_Boot.__cast(object1.h["rules"] , Array))[1];
			rule1 = this.findCorrespondingRule(object1.h["rules"],object2.h["directive"]);
			if(rule1 == null) {
				rule2.h["type"] = "DELETED";
				(js_Boot.__cast(diff.h["rules"] , Array)).push(rule2);
			}
		}
		if((js_Boot.__cast(diff.h["rules"] , Array)).length == 0) {
			return null;
		}
		return diff;
	}
	,intelligentMerge: function(objectArray,newArray,reverse) {
		if(reverse == null) {
			reverse = false;
		}
		var _g = 0;
		var _g1 = newArray.length;
		while(_g < _g1) {
			var i = _g++;
			this.intelligentCSSPush(objectArray,newArray[i],reverse);
		}
		var _g = 0;
		var _g1 = objectArray.length;
		while(_g < _g1) {
			var i = _g++;
			var cobj = objectArray[i];
			if(cobj.h["type"] == "media" || cobj.h["type"] == "keyframes") {
				continue;
			}
			var value = this.compactRules(cobj.h["rules"]);
			cobj.h["rules"] = value;
		}
	}
	,intelligentCSSPush: function(objectArray,minimalObject,reverse) {
		if(reverse == null) {
			reverse = false;
		}
		var pushSelector = minimalObject.h["selector"];
		var cssObject = null;
		if(reverse == false) {
			var _g = 0;
			var _g1 = objectArray.length;
			while(_g < _g1) {
				var i = _g++;
				if(objectArray[i].h["selector"] == minimalObject.h["selector"]) {
					cssObject = objectArray[i];
					break;
				}
			}
		} else {
			var j = objectArray.length - 1;
			while(j > -1) {
				if(objectArray[j].h["selector"] == minimalObject.h["selector"]) {
					cssObject = objectArray[j];
					break;
				}
				--j;
			}
		}
		if(cssObject == null) {
			objectArray.push(minimalObject);
		} else if(minimalObject.h["type"] != "media") {
			var mRules = minimalObject.h["rules"];
			var _g = 0;
			var _g1 = mRules.length;
			while(_g < _g1) {
				var i = _g++;
				var rule = mRules[i];
				var oldRule = this.findCorrespondingRule(cssObject.h["rules"],rule.h["directive"]);
				if(oldRule == null) {
					var cRules = cssObject.h["rules"];
					cRules.push(rule);
				} else if(rule.h["type"] == "DELETED") {
					oldRule.h["type"] = "DELETED";
				} else {
					oldRule.h["value"] = rule.h["value"];
				}
			}
		} else {
			var value = (js_Boot.__cast(cssObject.h["subStyles"] , Array)).concat(minimalObject.h["subStyles"]);
			cssObject.h["value"] = value;
		}
	}
	,compactRules: function(rules) {
		var newRules = [];
		var _g = 0;
		var _g1 = rules.length;
		while(_g < _g1) {
			var i = _g++;
			if(rules[i].h["type"] != "DELETED") {
				newRules.push(rules[i]);
			}
		}
		return newRules;
	}
	,getImports: function(objectArray) {
		var imps = [];
		var _g = 0;
		var _g1 = objectArray.length;
		while(_g < _g1) {
			var i = _g++;
			if(objectArray[i].h["type"] == "imports") {
				imps.push(objectArray[i].h["styles"]);
			}
		}
		return imps;
	}
	,parse: function(source) {
		if(source == null) {
			return null;
		}
		var _this_r = new RegExp("^\\s+|\\s+$","g".split("u").join(""));
		source = source.replace(_this_r,"");
		var css = [];
		var m = this.importRegex.match(source);
		while(m) {
			var imports = this.importRegex.matched(0);
			if(imports != null) {
				this.importStatements.push(imports);
				var _g = new haxe_ds_StringMap();
				_g.h["selector"] = "@imports";
				_g.h["type"] = "imports";
				_g.h["styles"] = imports;
				css.push(_g);
			} else {
				break;
			}
		}
		source = source.replace(this.importRegex.r,"");
		var keyframesRegex = new EReg(this.keyframeRegex,"gi");
		var arr = null;
		while(keyframesRegex.match(source)) {
			arr = this.getMatches(keyframesRegex,source);
			if(arr == null) {
				break;
			}
			var _g = new haxe_ds_StringMap();
			_g.h["selectors"] = "@keyframes";
			_g.h["type"] = "keyframes";
			var value = keyframesRegex.matchedRight();
			_g.h["styles"] = value;
			css.push(_g);
		}
		source = source.replace(keyframesRegex.r,"");
		var unified = new EReg(this.combinedCSSRegex,"gi");
		while(unified.match(source)) {
			arr = this.getMatches(unified,source);
			if(arr == null) {
				break;
			}
			var selector = "";
			var _g = 0;
			var _g1 = arr.length;
			while(_g < _g1) {
				var i = _g++;
				var selReg = new EReg("^([^{]+)","");
				if(selReg.match(arr[i])) {
					if(selReg.matched(0) != null) {
						selector = StringTools.trim(selReg.matched(0).split("\r\n").join("\n"));
					}
					var commentsRegex = new EReg(this.commentRegex,"gi");
					var comments = this.getMatches(commentsRegex,selector);
					if(comments != null) {
						selector = StringTools.trim(selector.replace(commentsRegex.r,""));
					}
					var _this_r = new RegExp("\n+","".split("u").join(""));
					selector = selector.replace(_this_r,"\n");
					if(selector.indexOf("@media") != -1) {
						var _g2 = new haxe_ds_StringMap();
						_g2.h["selectors"] = selector;
						_g2.h["type"] = "media";
						var value = this.parse(selReg.matchedRight() + "\n}");
						_g2.h["subStyles"] = value;
						var object = _g2;
						if(comments != null) {
							object.h["comments"] = comments[0];
						}
						css.push(object);
					} else if(selReg.matchedRight() != null) {
						var rules = this.parseRules(selReg.matchedRight());
						var _g3 = new haxe_ds_StringMap();
						_g3.h["selectors"] = selector;
						_g3.h["type"] = "rule";
						_g3.h["declarations"] = rules;
						var styleObject = _g3;
						if(selector == "@font-face") {
							styleObject.h["type"] = "font-face";
						}
						if(comments != null) {
							styleObject.h["comments"] = comments[0];
						}
						css.push(styleObject);
					}
				} else {
					break;
				}
			}
			break;
		}
		var _g = new haxe_ds_StringMap();
		_g.h["type"] = "stylesheet";
		_g.h["rules"] = css;
		_g.h["parsingErrors"] = [];
		var ret = _g;
		return ret;
	}
	,getMatches: function(ereg,input,index) {
		if(index == null) {
			index = 0;
		}
		var matches = [];
		while(ereg.match(input)) {
			var match = StringTools.trim(ereg.matched(index));
			matches.push(match);
			input = StringTools.trim(ereg.matchedRight());
		}
		if(matches.length == 0) {
			return null;
		}
		return matches;
	}
	,__class__: openfl_text__$internal_CSSParser
};
var openfl_text__$internal_CacheMeasurement = function(wordKey,positions) {
	this.__collisions = [];
	this.__wordMap = new haxe_ds_IntMap();
	this.set(wordKey,positions);
};
$hxClasses["openfl.text._internal.CacheMeasurement"] = openfl_text__$internal_CacheMeasurement;
openfl_text__$internal_CacheMeasurement.__name__ = "openfl.text._internal.CacheMeasurement";
openfl_text__$internal_CacheMeasurement.prototype = {
	__collisions: null
	,__wordMap: null
	,hash: null
	,set: function(wordKey,positions) {
		this.__addCollision(wordKey,positions);
	}
	,get: function(wordKey) {
		if(this.__collisions.length > 1) {
			return this.__wordMap.h[this.__collisions.indexOf(wordKey)];
		}
		return this.__wordMap.h[0];
	}
	,__addCollision: function(wordKey,positions) {
		if(!this.exists(wordKey)) {
			var _this = this.__wordMap;
			var key = this.__collisions.push(wordKey) - 1;
			_this.h[key] = positions;
		}
	}
	,exists: function(wordKey) {
		if(this.__collisions.length == 0) {
			return false;
		}
		return this.__collisions.indexOf(wordKey) > -1;
	}
	,__class__: openfl_text__$internal_CacheMeasurement
};
var openfl_text__$internal_GlyphPosition = function(glyph,advance,offset) {
	this.glyph = glyph;
	this.advance = advance;
	if(offset != null) {
		this.offset = offset;
	} else {
		this.offset = new lime_math_Vector2();
	}
};
$hxClasses["openfl.text._internal.GlyphPosition"] = openfl_text__$internal_GlyphPosition;
openfl_text__$internal_GlyphPosition.__name__ = "openfl.text._internal.GlyphPosition";
openfl_text__$internal_GlyphPosition.prototype = {
	advance: null
	,glyph: null
	,offset: null
	,__class__: openfl_text__$internal_GlyphPosition
};
var openfl_text__$internal_HTMLParser = function() { };
$hxClasses["openfl.text._internal.HTMLParser"] = openfl_text__$internal_HTMLParser;
openfl_text__$internal_HTMLParser.__name__ = "openfl.text._internal.HTMLParser";
openfl_text__$internal_HTMLParser.parse = function(value,multiline,styleSheet,textFormat,textFormatRanges) {
	if(multiline) {
		value = value.replace(openfl_text__$internal_HTMLParser.__regexBreakTag.r,"\n");
	} else {
		value = value.replace(openfl_text__$internal_HTMLParser.__regexBreakTag.r,"");
	}
	value = value.replace(openfl_text__$internal_HTMLParser.__regexEntityNbsp.r," ");
	value = openfl_text__$internal_HTMLParser.__regexCharEntity.map(value,function(ereg) {
		var decimalStr = ereg.matched(1);
		var hexStr = ereg.matched(2);
		if(decimalStr != null) {
			var decimal = Std.parseInt(decimalStr);
			if(decimal != null) {
				return String.fromCodePoint(decimal);
			}
		}
		if(hexStr != null) {
			var hex = Std.parseInt("0" + hexStr);
			if(hex != null) {
				return String.fromCodePoint(hex);
			}
		}
		return ereg.matched(0);
	});
	var segments = value.split("<");
	if(segments.length == 1) {
		value = openfl_text__$internal_HTMLParser.__htmlUnescape(value.replace(openfl_text__$internal_HTMLParser.__regexHTMLTag.r,""));
		if(textFormatRanges.get_length() > 1) {
			var deleteCount = textFormatRanges.get_length() - 1;
			textFormatRanges.__tempIndex = 1;
			var _g_current = 0;
			var _g_args = [];
			while(_g_current < _g_args.length) {
				var item = _g_args[_g_current++];
				textFormatRanges.insertAt(textFormatRanges.__tempIndex,item);
				textFormatRanges.__tempIndex++;
			}
			textFormatRanges.splice(textFormatRanges.__tempIndex,deleteCount);
		}
		var range = textFormatRanges.get(0);
		range.format = textFormat;
		range.start = 0;
		range.end = value.length;
		return value;
	} else {
		var deleteCount = textFormatRanges.get_length();
		textFormatRanges.__tempIndex = 0;
		var _g_current = 0;
		var _g_args = [];
		while(_g_current < _g_args.length) {
			var item = _g_args[_g_current++];
			textFormatRanges.insertAt(textFormatRanges.__tempIndex,item);
			textFormatRanges.__tempIndex++;
		}
		textFormatRanges.splice(textFormatRanges.__tempIndex,deleteCount);
		value = "";
		var formatStack = [textFormat.clone()];
		var tagStack = [];
		var sub;
		var noLineBreak = false;
		var _g = 0;
		while(_g < segments.length) {
			var segment = segments[_g];
			++_g;
			if(segment == "") {
				continue;
			}
			var isClosingTag = HxOverrides.substr(segment,0,1) == "/";
			var tagEndIndex = segment.indexOf(">");
			var start = tagEndIndex + 1;
			var spaceIndex = segment.indexOf(" ");
			var tagName = segment.substring(isClosingTag ? 1 : 0,spaceIndex > -1 && spaceIndex < tagEndIndex ? spaceIndex : tagEndIndex).toLowerCase();
			var format;
			if(isClosingTag) {
				if(tagStack.length == 0 || tagName != tagStack[tagStack.length - 1]) {
					continue;
				}
				tagStack.pop();
				formatStack.pop();
				format = formatStack[formatStack.length - 1].clone();
				if((tagName == "p" || tagName == "li") && textFormatRanges.get_length() > 0) {
					if(multiline) {
						value += "\n";
					}
					noLineBreak = true;
				}
				if(start < segment.length) {
					sub = openfl_text__$internal_HTMLParser.__htmlUnescape(HxOverrides.substr(segment,start,null));
					textFormatRanges.push(new openfl_text__$internal_TextFormatRange(format,value.length,value.length + sub.length));
					value += sub;
					noLineBreak = false;
				}
			} else {
				format = formatStack[formatStack.length - 1].clone();
				if(tagEndIndex > -1) {
					if(styleSheet != null) {
						styleSheet.__applyStyle(tagName,format);
						if(openfl_text__$internal_HTMLParser.__regexClass.match(segment)) {
							styleSheet.__applyStyle("." + openfl_text__$internal_HTMLParser.__getAttributeMatch(openfl_text__$internal_HTMLParser.__regexClass),format);
							styleSheet.__applyStyle(tagName + "." + openfl_text__$internal_HTMLParser.__getAttributeMatch(openfl_text__$internal_HTMLParser.__regexClass),format);
						}
					}
					switch(tagName) {
					case "a":
						if(styleSheet != null) {
							styleSheet.__applyStyle("a:link",format);
						}
						if(openfl_text__$internal_HTMLParser.__regexHref.match(segment)) {
							format.url = openfl_text__$internal_HTMLParser.__getAttributeMatch(openfl_text__$internal_HTMLParser.__regexHref);
						}
						break;
					case "b":
						format.set_bold(true);
						break;
					case "em":case "i":
						format.set_italic(true);
						break;
					case "font":
						if(openfl_text__$internal_HTMLParser.__regexFace.match(segment)) {
							format.set_font(openfl_text__$internal_HTMLParser.__getAttributeMatch(openfl_text__$internal_HTMLParser.__regexFace));
						}
						if(openfl_text__$internal_HTMLParser.__regexColor.match(segment)) {
							format.color = Std.parseInt("0x" + openfl_text__$internal_HTMLParser.__getAttributeMatch(openfl_text__$internal_HTMLParser.__regexColor));
						}
						if(openfl_text__$internal_HTMLParser.__regexSize.match(segment)) {
							var sizeAttr = openfl_text__$internal_HTMLParser.__getAttributeMatch(openfl_text__$internal_HTMLParser.__regexSize);
							var firstChar = HxOverrides.cca(sizeAttr,0);
							if(firstChar == 43 || firstChar == 45) {
								var parentFormat = formatStack.length >= 2 ? formatStack[formatStack.length - 2] : textFormat;
								format.set_size(parentFormat.size + Std.parseInt(sizeAttr));
							} else {
								format.set_size(Std.parseInt(sizeAttr));
							}
						}
						break;
					case "li":
						if(textFormatRanges.get_length() > 0 && !noLineBreak) {
							value += "\n";
						}
						var bullet = "• ";
						var bulletFormat = format.clone();
						bulletFormat.underline = false;
						textFormatRanges.push(new openfl_text__$internal_TextFormatRange(bulletFormat,value.length,value.length + bullet.length));
						value += bullet;
						break;
					case "p":
						if(textFormatRanges.get_length() > 0 && !noLineBreak) {
							value += "\n";
						}
						if(openfl_text__$internal_HTMLParser.__regexAlign.match(segment)) {
							var align = openfl_text__$internal_HTMLParser.__getAttributeMatch(openfl_text__$internal_HTMLParser.__regexAlign).toLowerCase();
							format.align = openfl_text_TextFormatAlign.fromString(align);
						}
						break;
					case "textformat":
						if(openfl_text__$internal_HTMLParser.__regexBlockIndent.match(segment)) {
							format.blockIndent = Std.parseInt(openfl_text__$internal_HTMLParser.__getAttributeMatch(openfl_text__$internal_HTMLParser.__regexBlockIndent));
						}
						if(openfl_text__$internal_HTMLParser.__regexIndent.match(segment)) {
							format.indent = Std.parseInt(openfl_text__$internal_HTMLParser.__getAttributeMatch(openfl_text__$internal_HTMLParser.__regexIndent));
						}
						if(openfl_text__$internal_HTMLParser.__regexLeading.match(segment)) {
							format.leading = Std.parseInt(openfl_text__$internal_HTMLParser.__getAttributeMatch(openfl_text__$internal_HTMLParser.__regexLeading));
						}
						if(openfl_text__$internal_HTMLParser.__regexLeftMargin.match(segment)) {
							format.leftMargin = Std.parseInt(openfl_text__$internal_HTMLParser.__getAttributeMatch(openfl_text__$internal_HTMLParser.__regexLeftMargin));
						}
						if(openfl_text__$internal_HTMLParser.__regexRightMargin.match(segment)) {
							format.rightMargin = Std.parseInt(openfl_text__$internal_HTMLParser.__getAttributeMatch(openfl_text__$internal_HTMLParser.__regexRightMargin));
						}
						if(openfl_text__$internal_HTMLParser.__regexTabStops.match(segment)) {
							var values = openfl_text__$internal_HTMLParser.__getAttributeMatch(openfl_text__$internal_HTMLParser.__regexTabStops).split(" ");
							var tabStops = [];
							var _g1 = 0;
							while(_g1 < values.length) {
								var stop = values[_g1];
								++_g1;
								tabStops.push(Std.parseInt(stop));
							}
							format.tabStops = tabStops;
						}
						break;
					case "u":
						format.underline = true;
						break;
					}
					formatStack.push(format);
					tagStack.push(tagName);
					if(start < segment.length) {
						sub = openfl_text__$internal_HTMLParser.__htmlUnescape(segment.substring(start));
						textFormatRanges.push(new openfl_text__$internal_TextFormatRange(format,value.length,value.length + sub.length));
						value += sub;
						noLineBreak = false;
					}
				} else {
					sub = openfl_text__$internal_HTMLParser.__htmlUnescape(segment);
					textFormatRanges.push(new openfl_text__$internal_TextFormatRange(format,value.length,value.length + sub.length));
					value += sub;
					noLineBreak = false;
				}
			}
		}
		if(textFormatRanges.get_length() == 0) {
			textFormatRanges.push(new openfl_text__$internal_TextFormatRange(formatStack[0],0,0));
		}
	}
	return value;
};
openfl_text__$internal_HTMLParser.__getAttributeMatch = function(regex) {
	if(regex.matched(2) != null) {
		return regex.matched(2);
	} else {
		return regex.matched(3);
	}
};
openfl_text__$internal_HTMLParser.__htmlUnescape = function(s) {
	s = s.replace(openfl_text__$internal_HTMLParser.__regexEntityApos.r,"'");
	return StringTools.htmlUnescape(s);
};
var openfl_text__$internal_ShapeCache = function() {
	this.__shortWordMap = new haxe_ds_StringMap();
	this.__longWordMap = new haxe_ds_StringMap();
};
$hxClasses["openfl.text._internal.ShapeCache"] = openfl_text__$internal_ShapeCache;
openfl_text__$internal_ShapeCache.__name__ = "openfl.text._internal.ShapeCache";
openfl_text__$internal_ShapeCache.hashFunction = function(key) {
	var hash = 0;
	var i;
	var chr;
	var _g = 0;
	var _g1 = key.length;
	while(_g < _g1) {
		var i = _g++;
		chr = HxOverrides.cca(key,i);
		hash = (hash << 5) - hash + chr;
		hash |= 0;
	}
	return hash;
};
openfl_text__$internal_ShapeCache.prototype = {
	__shortWordMap: null
	,__longWordMap: null
	,cache: function(formatRange,getPositions,wordKey) {
		var formatKey = formatRange.format.__cacheKey;
		if(wordKey.length > 15) {
			return this.__cacheLongWord(wordKey,formatKey,getPositions);
		} else {
			return this.__cacheShortWord(wordKey,formatKey,getPositions);
		}
	}
	,__cacheShortWord: function(wordKey,formatKey,getPositions) {
		if(Object.prototype.hasOwnProperty.call(this.__shortWordMap.h,formatKey)) {
			var formatMap = this.__shortWordMap.h[formatKey];
			if(Object.prototype.hasOwnProperty.call(formatMap.h,wordKey)) {
				return formatMap.h[wordKey];
			} else {
				var value = getPositions();
				formatMap.h[wordKey] = value;
			}
		} else {
			var formatMap = new haxe_ds_StringMap();
			var value = getPositions();
			formatMap.h[wordKey] = value;
			this.__shortWordMap.h[formatKey] = formatMap;
		}
		return getPositions();
	}
	,__cacheLongWord: function(wordKey,formatKey,getPositions) {
		var hash = openfl_text__$internal_ShapeCache.hashFunction(wordKey);
		if(Object.prototype.hasOwnProperty.call(this.__longWordMap.h,formatKey)) {
			var formatMap = this.__longWordMap.h[formatKey];
			if(formatMap.h.hasOwnProperty(hash)) {
				var measurement = formatMap.h[hash];
				if(measurement.exists(wordKey)) {
					return measurement.get(wordKey);
				} else {
					measurement.set(wordKey,getPositions());
				}
			} else {
				var measurement = new openfl_text__$internal_CacheMeasurement(wordKey,getPositions());
				formatMap.h[hash] = measurement;
			}
		} else {
			var formatMap = new haxe_ds_IntMap();
			var measurement = new openfl_text__$internal_CacheMeasurement(wordKey,getPositions());
			measurement.hash = hash;
			formatMap.h[hash] = measurement;
			this.__longWordMap.h[formatKey] = formatMap;
		}
		return getPositions();
	}
	,__class__: openfl_text__$internal_ShapeCache
};
var openfl_text__$internal_TextEngine = function(textField) {
	this.__shapeCache = new openfl_text__$internal_ShapeCache();
	this.textField = textField;
	this.width = 100;
	this.height = 100;
	this.set_text("");
	this.bounds = new openfl_geom_Rectangle(0,0,0,0);
	this.textBounds = new openfl_geom_Rectangle(0,0,0,0);
	this.type = 0;
	this.autoSize = 2;
	this.embedFonts = false;
	this.selectable = true;
	this.borderColor = 0;
	this.border = false;
	this.backgroundColor = 16777215;
	this.background = false;
	this.gridFitType = 1;
	this.maxChars = 0;
	this.multiline = false;
	this.numLines = 1;
	this.sharpness = 0;
	this.scrollH = 0;
	this.set_scrollV(1);
	this.wordWrap = false;
	this.lineAscents = openfl_Vector.toFloatVector(null);
	this.lineBreaks = openfl_Vector.toIntVector(null);
	this.lineDescents = openfl_Vector.toFloatVector(null);
	this.lineLeadings = openfl_Vector.toFloatVector(null);
	this.lineHeights = openfl_Vector.toFloatVector(null);
	this.lineWidths = openfl_Vector.toFloatVector(null);
	this.layoutGroups = openfl_Vector.toObjectVector(null);
	this.textFormatRanges = openfl_Vector.toObjectVector(null);
	if(openfl_text__$internal_TextEngine.__context == null) {
		openfl_text__$internal_TextEngine.__context = window.document.createElement("canvas").getContext("2d");
	}
};
$hxClasses["openfl.text._internal.TextEngine"] = openfl_text__$internal_TextEngine;
openfl_text__$internal_TextEngine.__name__ = "openfl.text._internal.TextEngine";
openfl_text__$internal_TextEngine.findFont = function(name) {
	return openfl_text_Font.__fontByName.h[name];
};
openfl_text__$internal_TextEngine.findFontVariant = function(format) {
	var fontName = format.font;
	var bold = format.bold;
	var italic = format.italic;
	if(fontName == null) {
		fontName = "_serif";
	}
	var fontNamePrefix = StringTools.replace(StringTools.replace(fontName," Normal","")," Regular","");
	if(bold && italic && Object.prototype.hasOwnProperty.call(openfl_text_Font.__fontByName.h,fontNamePrefix + " Bold Italic")) {
		return openfl_text__$internal_TextEngine.findFont(fontNamePrefix + " Bold Italic");
	} else if(bold && Object.prototype.hasOwnProperty.call(openfl_text_Font.__fontByName.h,fontNamePrefix + " Bold")) {
		return openfl_text__$internal_TextEngine.findFont(fontNamePrefix + " Bold");
	} else if(italic && Object.prototype.hasOwnProperty.call(openfl_text_Font.__fontByName.h,fontNamePrefix + " Italic")) {
		return openfl_text__$internal_TextEngine.findFont(fontNamePrefix + " Italic");
	}
	return openfl_text__$internal_TextEngine.findFont(fontName);
};
openfl_text__$internal_TextEngine.getDefaultFont = function(name,bold,italic) {
	if(openfl_text__$internal_TextEngine.__defaultFonts == null) {
		openfl_text__$internal_TextEngine.__defaultFonts = new haxe_ds_StringMap();
	}
	var fontSet = openfl_text__$internal_TextEngine.__defaultFonts.h[name];
	if(fontSet == null) {
		return null;
	}
	if(bold && italic && fontSet.boldItalic != null) {
		return fontSet.boldItalic;
	} else if(italic && fontSet.italic != null) {
		return fontSet.italic;
	} else if(bold && fontSet.bold != null) {
		return fontSet.bold;
	} else {
		return fontSet.normal;
	}
};
openfl_text__$internal_TextEngine.getFormatHeight = function(format) {
	var ascent;
	var descent;
	var font = openfl_text__$internal_TextEngine.getFont(format);
	openfl_text__$internal_TextEngine.__context.font = font;
	var font = openfl_text__$internal_TextEngine.getFontInstance(format);
	if(format.__ascent != null) {
		ascent = format.size * format.__ascent;
		descent = format.size * format.__descent;
	} else if(font != null && font.unitsPerEM != 0) {
		ascent = font.ascender / font.unitsPerEM * format.size;
		descent = Math.abs(font.descender / font.unitsPerEM * format.size);
	} else {
		ascent = format.size;
		descent = format.size * 0.185;
	}
	var leading = format.leading;
	return ascent + descent + leading;
};
openfl_text__$internal_TextEngine.getFont = function(format) {
	var fontName = format.font;
	var bold = format.bold;
	var italic = format.italic;
	if(fontName == null) {
		fontName = "_serif";
	}
	var fontNamePrefix = StringTools.replace(StringTools.replace(fontName," Normal","")," Regular","");
	if(bold && italic && Object.prototype.hasOwnProperty.call(openfl_text_Font.__fontByName.h,fontNamePrefix + " Bold Italic")) {
		fontName = fontNamePrefix + " Bold Italic";
		bold = false;
		italic = false;
	} else if(bold && Object.prototype.hasOwnProperty.call(openfl_text_Font.__fontByName.h,fontNamePrefix + " Bold")) {
		fontName = fontNamePrefix + " Bold";
		bold = false;
	} else if(italic && Object.prototype.hasOwnProperty.call(openfl_text_Font.__fontByName.h,fontNamePrefix + " Italic")) {
		fontName = fontNamePrefix + " Italic";
		italic = false;
	} else {
		if(bold && (fontName.indexOf(" Bold ") > -1 || StringTools.endsWith(fontName," Bold"))) {
			bold = false;
		}
		if(italic && (fontName.indexOf(" Italic ") > -1 || StringTools.endsWith(fontName," Italic"))) {
			italic = false;
		}
	}
	var font = italic ? "italic " : "normal ";
	font += "normal ";
	font += bold ? "bold " : "normal ";
	font += format.size + "px";
	font += "/" + (format.size + 3) + "px ";
	var font1;
	switch(fontName) {
	case "_sans":
		font1 = "sans-serif";
		break;
	case "_serif":
		font1 = "serif";
		break;
	case "_typewriter":
		font1 = "monospace";
		break;
	default:
		var _this_r = new RegExp("^[\\s'\"]+(.*)[\\s'\"]+$","".split("u").join(""));
		font1 = "'" + fontName.replace(_this_r,"$1") + "'";
	}
	font += "" + font1;
	return font;
};
openfl_text__$internal_TextEngine.getFontInstance = function(format) {
	return openfl_text__$internal_TextEngine.findFontVariant(format);
};
openfl_text__$internal_TextEngine.prototype = {
	antiAliasType: null
	,autoSize: null
	,background: null
	,backgroundColor: null
	,border: null
	,borderColor: null
	,bottomScrollV: null
	,bounds: null
	,caretIndex: null
	,embedFonts: null
	,gridFitType: null
	,height: null
	,layoutGroups: null
	,lineAscents: null
	,lineBreaks: null
	,lineDescents: null
	,lineLeadings: null
	,lineHeights: null
	,lineWidths: null
	,maxChars: null
	,maxScrollH: null
	,maxScrollV: null
	,multiline: null
	,numLines: null
	,restrict: null
	,scrollH: null
	,scrollV: null
	,selectable: null
	,sharpness: null
	,text: null
	,textBounds: null
	,textHeight: null
	,textFormatRanges: null
	,textWidth: null
	,type: null
	,width: null
	,wordWrap: null
	,textField: null
	,__cursorTimer: null
	,__hasFocus: null
	,__isKeyDown: null
	,__measuredHeight: null
	,__measuredWidth: null
	,__restrictRegexp: null
	,__selectionStart: null
	,__shapeCache: null
	,__showCursor: null
	,__textFormat: null
	,__textLayout: null
	,__texture: null
	,__useIntAdvances: null
	,__cairoFont: null
	,__font: null
	,createRestrictRegexp: function(restrict) {
		var declinedRange = new EReg("\\^([^\\^]+)","gu");
		var declined = "";
		var accepting = false;
		var accepted = declinedRange.map(restrict,function(ereg) {
			if(accepting) {
				accepting = !accepting;
				return ereg.matched(1);
			}
			declined += ereg.matched(1);
			accepting = !accepting;
			return "";
		});
		var testRegexpParts = [];
		if(accepted.length > 0) {
			testRegexpParts.push("[^" + accepted + "]");
		}
		if(declined.length > 0) {
			testRegexpParts.push("[" + declined + "]");
		}
		return new EReg("(" + testRegexpParts.join("|") + ")","g");
	}
	,getBounds: function() {
		var padding = this.border ? 1 : 0;
		this.bounds.width = this.width + padding;
		this.bounds.height = this.height + padding;
		var x = this.width;
		var y = this.height;
		var lastIndex = this.layoutGroups.get_length() - 1;
		var _g = 0;
		var _g1 = this.layoutGroups.get_length();
		while(_g < _g1) {
			var i = _g++;
			var group = this.layoutGroups.get(i);
			if(i == lastIndex && group.startIndex == group.endIndex && this.type != 1) {
				continue;
			}
			if(group.offsetX < x) {
				x = group.offsetX;
			}
			if(group.offsetY < y) {
				y = group.offsetY;
			}
		}
		if(x >= this.width) {
			x = 2;
		}
		if(y >= this.height) {
			y = 2;
		}
		var textHeight = this.textHeight * 1.185;
		this.textBounds.setTo(Math.max(x - 2,0),Math.max(y - 2,0),Math.min(this.textWidth + 4,this.bounds.width),Math.min(textHeight + 4,this.bounds.height));
	}
	,getLine: function(index) {
		if(index < 0 || index > this.lineBreaks.get_length() + 1) {
			return null;
		}
		if(this.lineBreaks.get_length() == 0) {
			return this.text;
		} else {
			return this.text.substring(index > 0 ? this.lineBreaks.get(index - 1) : 0,this.lineBreaks.get(index));
		}
	}
	,getLineBreaks: function() {
		this.lineBreaks.set_length(0);
		var index = -1;
		var cr = -1;
		var lf = -1;
		while(index < this.text.length) {
			lf = this.text.indexOf("\n",index + 1);
			cr = this.text.indexOf("\r",index + 1);
			index = cr == -1 ? lf : lf == -1 ? cr : cr < lf ? cr : lf;
			if(index > -1) {
				this.lineBreaks.push(index);
			} else {
				break;
			}
		}
	}
	,getLineBreakIndex: function(startIndex) {
		if(startIndex == null) {
			startIndex = 0;
		}
		var lineBreak = this.lineBreaks.iterator();
		while(lineBreak.hasNext()) {
			var lineBreak1 = lineBreak.next();
			if(lineBreak1 >= startIndex) {
				return lineBreak1;
			}
		}
		return -1;
	}
	,getLineMeasurements: function() {
		this.lineAscents.set_length(0);
		this.lineDescents.set_length(0);
		this.lineLeadings.set_length(0);
		this.lineHeights.set_length(0);
		this.lineWidths.set_length(0);
		var currentLineAscent = 0.0;
		var currentLineDescent = 0.0;
		var currentLineLeading = null;
		var currentLineHeight = 0.0;
		var currentLineWidth = 0.0;
		var currentTextHeight = 0.0;
		this.textWidth = 0;
		this.textHeight = 0;
		this.numLines = 1;
		this.maxScrollH = 0;
		var lastIndex = this.layoutGroups.get_length() - 1;
		var _g = 0;
		var _g1 = this.layoutGroups.get_length();
		while(_g < _g1) {
			var i = _g++;
			var group = this.layoutGroups.get(i);
			if(i == lastIndex && group.startIndex == group.endIndex && this.type != 1) {
				continue;
			}
			while(group.lineIndex > this.numLines - 1) {
				this.lineAscents.push(currentLineAscent);
				this.lineDescents.push(currentLineDescent);
				this.lineLeadings.push(currentLineLeading != null ? currentLineLeading : 0);
				this.lineHeights.push(currentLineHeight);
				this.lineWidths.push(currentLineWidth);
				currentLineAscent = 0;
				currentLineDescent = 0;
				currentLineLeading = null;
				currentLineHeight = 0;
				currentLineWidth = 0;
				this.numLines++;
			}
			currentLineAscent = Math.max(currentLineAscent,group.ascent);
			currentLineDescent = Math.max(currentLineDescent,group.descent);
			if(currentLineLeading == null) {
				currentLineLeading = group.leading;
			} else {
				currentLineLeading = Math.max(currentLineLeading,group.leading) | 0;
			}
			currentLineHeight = Math.max(currentLineHeight,group.height);
			currentLineWidth = group.offsetX - 2 + group.width;
			if(currentLineWidth > this.textWidth) {
				this.textWidth = currentLineWidth;
			}
			currentTextHeight = Math.ceil(group.offsetY - 2 + group.ascent + group.descent);
			if(currentTextHeight > this.textHeight) {
				this.textHeight = currentTextHeight;
			}
		}
		if(this.textHeight == 0 && this.textField != null && this.type == 1) {
			var currentFormat = this.textField.__textFormat;
			var ascent;
			var descent;
			var font = openfl_text__$internal_TextEngine.getFontInstance(currentFormat);
			if(currentFormat.__ascent != null) {
				ascent = currentFormat.size * currentFormat.__ascent;
				descent = currentFormat.size * currentFormat.__descent;
			} else if(font != null && font.unitsPerEM != 0) {
				ascent = font.ascender / font.unitsPerEM * currentFormat.size;
				descent = Math.abs(font.descender / font.unitsPerEM * currentFormat.size);
			} else {
				ascent = currentFormat.size;
				descent = currentFormat.size * 0.185;
			}
			var leading = currentFormat.leading;
			var heightValue = Math.ceil(ascent + descent + leading);
			currentLineAscent = ascent;
			currentLineDescent = descent;
			currentLineLeading = leading;
			currentTextHeight = Math.ceil(ascent + descent);
			this.textHeight = currentTextHeight;
		}
		this.lineAscents.push(currentLineAscent);
		this.lineDescents.push(currentLineDescent);
		this.lineLeadings.push(currentLineLeading != null ? currentLineLeading : 0);
		this.lineHeights.push(currentLineHeight);
		this.lineWidths.push(currentLineWidth);
		if(this.numLines == 1) {
			if(currentLineLeading > 0) {
				this.textHeight += currentLineLeading;
			}
		}
		if(this.autoSize != 2) {
			switch(this.autoSize) {
			case 0:case 1:case 3:
				if(!this.wordWrap) {
					this.width = this.textWidth + 4;
				}
				this.height = this.textHeight + 4;
				this.bottomScrollV = this.numLines;
				break;
			default:
			}
		}
		if(this.textWidth > this.width - 4) {
			this.maxScrollH = this.textWidth - this.width + 4 | 0;
		} else {
			this.maxScrollH = 0;
		}
		if(this.scrollH > this.maxScrollH) {
			this.scrollH = this.maxScrollH;
		}
	}
	,getLayoutGroups: function() {
		var _gthis = this;
		this.layoutGroups.set_length(0);
		if(this.text == null || this.text == "") {
			return;
		}
		var rangeIndex = -1;
		var formatRange = null;
		var font = null;
		var currentFormat = openfl_text_TextField.__defaultTextFormat.clone();
		var leading = 0;
		var ascent = 0.0;
		var maxAscent = 0.0;
		var descent = 0.0;
		var align = 3;
		var blockIndent = 0;
		var bullet = false;
		var indent = 0;
		var leftMargin = 0;
		var rightMargin = 0;
		var firstLineOfParagraph = true;
		var layoutGroup = null;
		var positions = null;
		var widthValue = 0.0;
		var heightValue = 0;
		var maxHeightValue = 0;
		var previousSpaceIndex = -2;
		var previousBreakIndex = -1;
		var spaceIndex = this.text.indexOf(" ");
		var breakCount = 0;
		var breakIndex = breakCount < this.lineBreaks.get_length() ? this.lineBreaks.get(breakCount) : -1;
		var offsetX = 0.0;
		var offsetY = 0.0;
		var textIndex = 0;
		var lineIndex = 0;
		var getPositions = function(text,startIndex,endIndex) {
			var letterSpacing = 0.0;
			if(formatRange.format.letterSpacing != null) {
				letterSpacing = formatRange.format.letterSpacing;
			}
			var html5Positions = function() {
				var positions = [];
				if(_gthis.__useIntAdvances == null) {
					var html5Positions = new EReg("Trident/7.0","");
					_gthis.__useIntAdvances = html5Positions.match($global.navigator.userAgent);
				}
				if(_gthis.__useIntAdvances) {
					var previousWidth = 0.0;
					var width;
					var _g = startIndex;
					var _g1 = endIndex;
					while(_g < _g1) {
						var i = _g++;
						width = _gthis.measureText(text.substring(startIndex,i + 1));
						positions.push(width - previousWidth);
						previousWidth = width;
					}
				} else {
					var _g = startIndex;
					var _g1 = endIndex;
					while(_g < _g1) {
						var i = _g++;
						var advance;
						if(i < text.length - 1) {
							var nextWidth = _gthis.measureText(text.charAt(i + 1));
							var twoWidths = _gthis.measureText(HxOverrides.substr(text,i,2));
							advance = twoWidths - nextWidth;
						} else {
							advance = openfl_text__$internal_TextEngine.__context.measureText(text.charAt(i)).width;
						}
						positions.push(advance);
					}
				}
				return positions;
			};
			if(currentFormat.align == 2) {
				return html5Positions();
			}
			return _gthis.__shapeCache.cache(formatRange,html5Positions,text.substring(startIndex,endIndex));
		};
		var getPositionsWidth = function(positions) {
			var width = 0.0;
			var _g = 0;
			while(_g < positions.length) {
				var position = positions[_g];
				++_g;
				width += position;
			}
			return width;
		};
		var getTextWidth = function(text) {
			return _gthis.measureText(text);
		};
		var getBaseX = function() {
			return 2 + leftMargin + blockIndent + (firstLineOfParagraph ? indent : 0);
		};
		var getWrapWidth = function() {
			return _gthis.width - 2 - rightMargin - getBaseX();
		};
		var nextLayoutGroup = function(startIndex,endIndex) {
			if(layoutGroup == null || layoutGroup.startIndex != layoutGroup.endIndex) {
				layoutGroup = new openfl_text__$internal_TextLayoutGroup(formatRange.format,startIndex,endIndex);
				_gthis.layoutGroups.push(layoutGroup);
			} else {
				layoutGroup.format = formatRange.format;
				layoutGroup.startIndex = startIndex;
				layoutGroup.endIndex = endIndex;
			}
		};
		var setLineMetrics = function() {
			if(currentFormat.__ascent != null) {
				ascent = currentFormat.size * currentFormat.__ascent;
				descent = currentFormat.size * currentFormat.__descent;
			} else if(font != null && font.unitsPerEM != 0) {
				ascent = font.ascender / font.unitsPerEM * currentFormat.size;
				descent = Math.abs(font.descender / font.unitsPerEM * currentFormat.size);
			} else {
				ascent = currentFormat.size;
				descent = currentFormat.size * 0.185;
			}
			leading = currentFormat.leading;
			heightValue = Math.ceil(ascent + descent + leading);
			if(heightValue > maxHeightValue) {
				maxHeightValue = heightValue;
			}
			if(ascent > maxAscent) {
				maxAscent = ascent;
			}
		};
		var setParagraphMetrics = function() {
			firstLineOfParagraph = true;
			align = currentFormat.align != null ? currentFormat.align : 3;
			blockIndent = currentFormat.blockIndent != null ? currentFormat.blockIndent : 0;
			indent = currentFormat.indent != null ? currentFormat.indent : 0;
			leftMargin = currentFormat.leftMargin != null ? currentFormat.leftMargin : 0;
			rightMargin = currentFormat.rightMargin != null ? currentFormat.rightMargin : 0;
			var setParagraphMetrics = currentFormat.bullet != null;
			var setParagraphMetrics = currentFormat.tabStops != null;
		};
		var nextFormatRange = function() {
			if(rangeIndex < _gthis.textFormatRanges.get_length() - 1) {
				rangeIndex += 1;
				formatRange = _gthis.textFormatRanges.get(rangeIndex);
				currentFormat.__merge(formatRange.format);
				var fontString = openfl_text__$internal_TextEngine.getFont(currentFormat);
				openfl_text__$internal_TextEngine.__context.font = fontString;
				font = openfl_text__$internal_TextEngine.getFontInstance(currentFormat);
				return true;
			}
			return false;
		};
		var setFormattedPositions = function(startIndex,endIndex) {
			if(startIndex >= endIndex) {
				positions = [];
				widthValue = 0;
			} else if(endIndex <= formatRange.end) {
				positions = getPositions(_gthis.text,startIndex,endIndex);
				widthValue = getPositionsWidth(positions);
			} else {
				var tempIndex = startIndex;
				var tempRangeEnd = formatRange.end;
				var countRanges = 0;
				positions = [];
				widthValue = 0;
				while(true) {
					if(tempIndex != tempRangeEnd) {
						var tempPositions = getPositions(_gthis.text,tempIndex,tempRangeEnd);
						positions = positions.concat(tempPositions);
					}
					if(tempRangeEnd != endIndex) {
						if(!nextFormatRange()) {
							lime_utils_Log.warn("You found a bug in OpenFL's text code! Please save a copy of your project and create an issue on GitHub so we can fix this.",{ fileName : "openfl/text/_internal/TextEngine.hx", lineNumber : 1186, className : "openfl.text._internal.TextEngine", methodName : "getLayoutGroups"});
							break;
						}
						tempIndex = tempRangeEnd;
						tempRangeEnd = endIndex < formatRange.end ? endIndex : formatRange.end;
						++countRanges;
					} else {
						widthValue = getPositionsWidth(positions);
						break;
					}
				}
				rangeIndex -= countRanges + 1;
				nextFormatRange();
			}
		};
		var placeFormattedText = function(endIndex) {
			if(endIndex <= formatRange.end) {
				positions = getPositions(_gthis.text,textIndex,endIndex);
				widthValue = getPositionsWidth(positions);
				nextLayoutGroup(textIndex,endIndex);
				layoutGroup.positions = positions;
				var offsetX1 = offsetX;
				var placeFormattedText = getBaseX();
				layoutGroup.offsetX = offsetX1 + placeFormattedText;
				layoutGroup.ascent = ascent;
				layoutGroup.descent = descent;
				layoutGroup.leading = leading;
				layoutGroup.lineIndex = lineIndex;
				layoutGroup.offsetY = offsetY + 2;
				layoutGroup.width = widthValue;
				layoutGroup.height = heightValue;
				offsetX += widthValue;
				if(endIndex == formatRange.end) {
					layoutGroup = null;
					nextFormatRange();
					setLineMetrics();
				}
			} else {
				while(true) {
					var tempRangeEnd = endIndex < formatRange.end ? endIndex : formatRange.end;
					if(textIndex != tempRangeEnd) {
						positions = getPositions(_gthis.text,textIndex,tempRangeEnd);
						widthValue = getPositionsWidth(positions);
						nextLayoutGroup(textIndex,tempRangeEnd);
						layoutGroup.positions = positions;
						var offsetX1 = offsetX;
						var placeFormattedText = getBaseX();
						layoutGroup.offsetX = offsetX1 + placeFormattedText;
						layoutGroup.ascent = ascent;
						layoutGroup.descent = descent;
						layoutGroup.leading = leading;
						layoutGroup.lineIndex = lineIndex;
						layoutGroup.offsetY = offsetY + 2;
						layoutGroup.width = widthValue;
						layoutGroup.height = heightValue;
						offsetX += widthValue;
						textIndex = tempRangeEnd;
					}
					if(tempRangeEnd == formatRange.end) {
						layoutGroup = null;
					}
					if(tempRangeEnd == endIndex) {
						break;
					}
					if(!nextFormatRange()) {
						lime_utils_Log.warn("You found a bug in OpenFL's text code! Please save a copy of your project and create an issue on GitHub so we can fix this.",{ fileName : "openfl/text/_internal/TextEngine.hx", lineNumber : 1274, className : "openfl.text._internal.TextEngine", methodName : "getLayoutGroups"});
						break;
					}
					setLineMetrics();
				}
			}
			textIndex = endIndex;
		};
		var alignBaseline = function() {
			setLineMetrics();
			var i = _gthis.layoutGroups.get_length();
			while(--i > -1) {
				var lg = _gthis.layoutGroups.get(i);
				if(lg.lineIndex < lineIndex) {
					break;
				}
				if(lg.lineIndex > lineIndex) {
					continue;
				}
				lg.ascent = maxAscent;
				lg.height = maxHeightValue;
			}
			offsetY += maxHeightValue;
			maxAscent = 0.0;
			maxHeightValue = 0;
			lineIndex += 1;
			offsetX = 0;
			firstLineOfParagraph = false;
		};
		var breakLongWords = function(endIndex) {
			var remainingPositions = positions;
			var bufferCount;
			var placeIndex;
			var positionWidth;
			var currentPosition;
			var tempWidth = getPositionsWidth(remainingPositions);
			var i = remainingPositions.length - 1;
			while(i >= 0) {
				var currentCharCode = HxOverrides.cca(_gthis.text,textIndex + i);
				if(currentCharCode != 32 && currentCharCode != 9) {
					break;
				}
				var position = remainingPositions[i];
				tempWidth -= position;
				--i;
			}
			while(remainingPositions.length > 0 && offsetX + tempWidth > getWrapWidth()) {
				bufferCount = 0;
				i = bufferCount;
				positionWidth = 0.0;
				while(offsetX + positionWidth < getWrapWidth()) {
					currentPosition = remainingPositions[i];
					if(currentPosition == 0.0) {
						++i;
						++bufferCount;
					} else {
						positionWidth += currentPosition;
						++i;
					}
				}
				if(i == bufferCount) {
					i = bufferCount + 1;
				} else {
					while(i > 1 && offsetX + positionWidth > getWrapWidth()) {
						--i;
						if(i - bufferCount > 0) {
							setFormattedPositions(textIndex,textIndex + i - bufferCount);
							positionWidth = widthValue;
						} else {
							i = 1;
							bufferCount = 0;
							setFormattedPositions(textIndex,textIndex + 1);
							positionWidth = 0;
						}
					}
				}
				placeIndex = textIndex + i - bufferCount;
				placeFormattedText(placeIndex);
				alignBaseline();
				setFormattedPositions(placeIndex,endIndex);
				remainingPositions = positions;
				tempWidth = widthValue;
			}
		};
		var placeText = function(endIndex) {
			if(_gthis.width >= 4 && _gthis.wordWrap) {
				breakLongWords(endIndex);
			}
			placeFormattedText(endIndex);
		};
		nextFormatRange();
		setParagraphMetrics();
		setLineMetrics();
		var wrap;
		var maxLoops = this.text.length + 1;
		while(textIndex < maxLoops) if(breakIndex > -1 && (spaceIndex == -1 || breakIndex < spaceIndex)) {
			if(textIndex <= breakIndex) {
				setFormattedPositions(textIndex,breakIndex);
				placeText(breakIndex);
				layoutGroup = null;
			} else if(layoutGroup != null && layoutGroup.startIndex != layoutGroup.endIndex) {
				if(layoutGroup.endIndex == spaceIndex) {
					layoutGroup.width -= layoutGroup.positions[layoutGroup.positions.length - 1];
				}
				layoutGroup = null;
			}
			alignBaseline();
			if(formatRange.end == breakIndex) {
				nextFormatRange();
				setLineMetrics();
			}
			textIndex = breakIndex + 1;
			previousBreakIndex = breakIndex;
			++breakCount;
			breakIndex = breakCount < this.lineBreaks.get_length() ? this.lineBreaks.get(breakCount) : -1;
			setParagraphMetrics();
		} else if(spaceIndex > -1) {
			if(layoutGroup != null && layoutGroup.startIndex != layoutGroup.endIndex) {
				layoutGroup = null;
			}
			wrap = false;
			while(textIndex < this.text.length) {
				var endIndex = -1;
				if(spaceIndex == -1) {
					endIndex = breakIndex;
				} else {
					endIndex = spaceIndex + 1;
					if(breakIndex > -1 && breakIndex < endIndex) {
						endIndex = breakIndex;
					}
				}
				if(endIndex == -1) {
					endIndex = this.text.length;
				}
				setFormattedPositions(textIndex,endIndex);
				if(align == 2) {
					if(positions.length > 0 && textIndex == previousSpaceIndex) {
						textIndex += 1;
						var spaceWidth = positions.shift();
						widthValue -= spaceWidth;
						offsetX += spaceWidth;
					}
					if(positions.length > 0 && endIndex == spaceIndex + 1) {
						--endIndex;
						var spaceWidth1 = positions.pop();
						widthValue -= spaceWidth1;
					}
				}
				if(this.wordWrap) {
					if(offsetX + widthValue > getWrapWidth()) {
						wrap = true;
						if(positions.length > 0 && endIndex == spaceIndex + 1) {
							var lastPosition = positions[positions.length - 1];
							var spaceWidth2 = lastPosition;
							if(offsetX + widthValue - spaceWidth2 <= getWrapWidth()) {
								wrap = false;
							}
						}
					}
				}
				if(wrap) {
					if(align != 2 && (layoutGroup != null || this.layoutGroups.get_length() > 0)) {
						var previous = layoutGroup;
						if(previous == null) {
							previous = this.layoutGroups.get(this.layoutGroups.get_length() - 1);
						}
						previous.width -= previous.positions[previous.positions.length - 1];
						previous.endIndex--;
					}
					var i = this.layoutGroups.get_length() - 1;
					var offsetCount = 0;
					while(i >= 0) {
						layoutGroup = this.layoutGroups.get(i);
						if(i > 0 && layoutGroup.startIndex > previousSpaceIndex) {
							++offsetCount;
						} else {
							break;
						}
						--i;
					}
					if(textIndex == previousSpaceIndex + 1) {
						alignBaseline();
					}
					offsetX = 0;
					if(offsetCount > 0) {
						var bumpX = this.layoutGroups.get(this.layoutGroups.get_length() - offsetCount).offsetX;
						var _g = this.layoutGroups.get_length() - offsetCount;
						var _g1 = this.layoutGroups.get_length();
						while(_g < _g1) {
							var i1 = _g++;
							layoutGroup = this.layoutGroups.get(i1);
							layoutGroup.offsetX -= bumpX;
							layoutGroup.offsetY = offsetY + 2;
							layoutGroup.lineIndex = lineIndex;
							offsetX += layoutGroup.width;
						}
					}
					placeText(endIndex);
					wrap = false;
				} else if(layoutGroup != null && textIndex == spaceIndex && previousSpaceIndex != spaceIndex - 1) {
					if(align != 2) {
						layoutGroup.endIndex = spaceIndex;
						layoutGroup.positions = layoutGroup.positions.concat(positions);
						layoutGroup.width += widthValue;
					}
					offsetX += widthValue;
					textIndex = endIndex;
				} else if(layoutGroup == null || align == 2) {
					placeText(endIndex);
					if(endIndex == this.text.length) {
						alignBaseline();
					}
				} else {
					var tempRangeEnd = endIndex < formatRange.end ? endIndex : formatRange.end;
					if(tempRangeEnd < endIndex) {
						positions = getPositions(this.text,textIndex,tempRangeEnd);
						widthValue = getPositionsWidth(positions);
					}
					layoutGroup.endIndex = tempRangeEnd;
					layoutGroup.positions = layoutGroup.positions.concat(positions);
					layoutGroup.width += widthValue;
					offsetX += widthValue;
					if(tempRangeEnd == formatRange.end) {
						layoutGroup = null;
						nextFormatRange();
						setLineMetrics();
						textIndex = tempRangeEnd;
						if(tempRangeEnd != endIndex) {
							placeFormattedText(endIndex);
						}
					}
					if(breakIndex == endIndex) {
						++endIndex;
					}
					textIndex = endIndex;
					if(endIndex == this.text.length) {
						alignBaseline();
						if(breakIndex != -1) {
							previousBreakIndex = breakIndex;
							++breakCount;
							breakIndex = breakCount < this.lineBreaks.get_length() ? this.lineBreaks.get(breakCount) : -1;
						}
					}
				}
				var nextSpaceIndex = this.text.indexOf(" ",textIndex);
				if(breakIndex == previousSpaceIndex) {
					layoutGroup.endIndex = breakIndex;
					if(breakIndex - layoutGroup.startIndex - layoutGroup.positions.length < 0) {
						layoutGroup.positions.push(0.0);
					}
					textIndex = breakIndex + 1;
				}
				previousSpaceIndex = spaceIndex;
				spaceIndex = nextSpaceIndex;
				if(breakIndex > -1 && breakIndex <= textIndex && (spaceIndex > breakIndex || spaceIndex == -1) || textIndex > this.text.length) {
					break;
				}
			}
		} else {
			if(textIndex < this.text.length) {
				setFormattedPositions(textIndex,this.text.length);
				placeText(this.text.length);
				alignBaseline();
			}
			textIndex += 1;
		}
		if(previousBreakIndex == textIndex - 2 && previousBreakIndex > -1) {
			nextLayoutGroup(textIndex - 1,textIndex - 1);
			layoutGroup.positions = [];
			layoutGroup.ascent = ascent;
			layoutGroup.descent = descent;
			layoutGroup.leading = leading;
			layoutGroup.lineIndex = lineIndex;
			layoutGroup.offsetX = getBaseX();
			layoutGroup.offsetY = offsetY + 2;
			layoutGroup.width = 0;
			layoutGroup.height = heightValue;
		}
	}
	,measureText: function(text) {
		return openfl_text__$internal_TextEngine.__context.measureText(text).width;
	}
	,restrictText: function(value) {
		if(value == null) {
			return value;
		}
		if(this.__restrictRegexp != null) {
			value = this.__restrictRegexp.split(value).join("");
		}
		return value;
	}
	,setTextAlignment: function() {
		var lineIndex = -1;
		var offsetX = 0.0;
		var totalWidth = this.width - 4;
		var group;
		var lineLength;
		var lineMeasurementsDirty = false;
		var _g = 0;
		var _g1 = this.layoutGroups.get_length();
		while(_g < _g1) {
			var i = _g++;
			group = this.layoutGroups.get(i);
			if(group.lineIndex != lineIndex) {
				lineIndex = group.lineIndex;
				totalWidth = this.width - 4 - group.format.rightMargin;
				switch(group.format.align) {
				case 0:
					if(this.lineWidths.get(lineIndex) < totalWidth) {
						offsetX = Math.round((totalWidth - this.lineWidths.get(lineIndex)) / 2);
					} else {
						offsetX = 0;
					}
					break;
				case 2:
					if(this.lineWidths.get(lineIndex) < totalWidth) {
						lineLength = 1;
						var _g2 = i + 1;
						var _g3 = this.layoutGroups.get_length();
						while(_g2 < _g3) {
							var j = _g2++;
							if(this.layoutGroups.get(j).lineIndex == lineIndex) {
								if(j == 0 || HxOverrides.cca(this.text,this.layoutGroups.get(j).startIndex - 1) == 32) {
									++lineLength;
								}
							} else {
								break;
							}
						}
						if(lineLength > 1) {
							group = this.layoutGroups.get(i + lineLength - 1);
							var endChar = HxOverrides.cca(this.text,group.endIndex);
							if(group.endIndex < this.text.length && endChar != 10 && endChar != 13) {
								offsetX = (totalWidth - this.lineWidths.get(lineIndex)) / (lineLength - 1);
								lineMeasurementsDirty = true;
								var j1 = 1;
								do this.layoutGroups.get(i + j1).offsetX += offsetX * j1; while(++j1 < lineLength);
							}
						}
					}
					offsetX = 0;
					break;
				case 4:
					if(this.lineWidths.get(lineIndex) < totalWidth) {
						offsetX = Math.round(totalWidth - this.lineWidths.get(lineIndex));
					} else {
						offsetX = 0;
					}
					break;
				default:
					offsetX = 0;
				}
			}
			if(offsetX > 0) {
				group.offsetX += offsetX;
			}
		}
		if(lineMeasurementsDirty) {
			this.getLineMeasurements();
		}
	}
	,trimText: function(value) {
		if(value == null) {
			return value;
		}
		if(this.maxChars > 0 && value.length > this.maxChars) {
			value = HxOverrides.substr(value,0,this.maxChars);
		}
		return value;
	}
	,update: function() {
		if(this.text == null || this.textFormatRanges.get_length() == 0) {
			this.lineAscents.set_length(0);
			this.lineBreaks.set_length(0);
			this.lineDescents.set_length(0);
			this.lineLeadings.set_length(0);
			this.lineHeights.set_length(0);
			this.lineWidths.set_length(0);
			this.layoutGroups.set_length(0);
			this.textWidth = 0;
			this.textHeight = 0;
			this.numLines = 1;
			this.maxScrollH = 0;
			this.maxScrollV = 1;
			this.bottomScrollV = 1;
		} else {
			this.getLineBreaks();
			this.getLayoutGroups();
			this.getLineMeasurements();
			this.setTextAlignment();
		}
		this.getBounds();
	}
	,get_bottomScrollV: function() {
		if(this.numLines == 1 || this.lineHeights == null) {
			return 1;
		} else {
			var ret = this.lineHeights.get_length();
			var tempHeight = this.lineLeadings.get_length() == ret ? -this.lineLeadings.get(ret - 1) : 0.0;
			var _g = (this.get_scrollV() > 0 ? this.get_scrollV() : 1) - 1;
			var _g1 = this.lineHeights.get_length();
			while(_g < _g1) {
				var i = _g++;
				var lineHeight = this.lineHeights.get(i);
				tempHeight += lineHeight;
				if(tempHeight > this.height - 4) {
					ret = i + (tempHeight - this.height >= 0 ? 0 : 1);
					break;
				}
			}
			if(ret < this.get_scrollV()) {
				return this.get_scrollV();
			}
			return ret;
		}
	}
	,get_maxScrollV: function() {
		if(this.numLines == 1 || this.lineHeights == null) {
			return 1;
		} else {
			var i = this.numLines - 1;
			var tempHeight = 0.0;
			var j = i;
			while(i >= 0) {
				tempHeight += this.lineHeights.get(i);
				if(tempHeight > this.height - 4) {
					i += tempHeight - this.height < 0 ? 1 : 2;
					break;
				}
				--i;
			}
			if(i < 1) {
				return 1;
			}
			return i;
		}
	}
	,set_restrict: function(value) {
		if(this.restrict == value) {
			return this.restrict;
		}
		this.restrict = value;
		if(this.restrict == null || this.restrict.length == 0) {
			this.__restrictRegexp = null;
		} else {
			this.__restrictRegexp = this.createRestrictRegexp(value);
		}
		return this.restrict;
	}
	,get_scrollV: function() {
		if(this.numLines == 1 || this.lineHeights == null) {
			return 1;
		}
		var max = this.get_maxScrollV();
		if(this.scrollV > max) {
			return max;
		}
		return this.scrollV;
	}
	,set_scrollV: function(value) {
		if(value < 1) {
			value = 1;
		} else if(value > this.get_maxScrollV()) {
			value = this.get_maxScrollV();
		}
		return this.scrollV = value;
	}
	,set_text: function(value) {
		return this.text = value;
	}
	,__class__: openfl_text__$internal_TextEngine
	,__properties__: {set_text:"set_text",set_scrollV:"set_scrollV",get_scrollV:"get_scrollV",set_restrict:"set_restrict",get_maxScrollV:"get_maxScrollV",get_bottomScrollV:"get_bottomScrollV"}
};
var openfl_text__$internal__$TextEngine_DefaultFontSet = function(normal,bold,italic,boldItalic) {
	this.normal = normal;
	this.bold = bold;
	this.italic = italic;
	this.boldItalic = boldItalic;
};
$hxClasses["openfl.text._internal._TextEngine.DefaultFontSet"] = openfl_text__$internal__$TextEngine_DefaultFontSet;
openfl_text__$internal__$TextEngine_DefaultFontSet.__name__ = "openfl.text._internal._TextEngine.DefaultFontSet";
openfl_text__$internal__$TextEngine_DefaultFontSet.prototype = {
	bold: null
	,boldItalic: null
	,italic: null
	,normal: null
	,getFont: function(isBold,isItalic) {
		if(isBold && isItalic && this.boldItalic != null) {
			return this.boldItalic;
		}
		if(isItalic && this.italic != null) {
			return this.italic;
		}
		if(isBold && this.bold != null) {
			return this.bold;
		}
		return this.normal;
	}
	,__class__: openfl_text__$internal__$TextEngine_DefaultFontSet
};
var openfl_text__$internal_TextFormatRange = function(format,start,end) {
	this.format = format;
	this.start = start;
	this.end = end;
};
$hxClasses["openfl.text._internal.TextFormatRange"] = openfl_text__$internal_TextFormatRange;
openfl_text__$internal_TextFormatRange.__name__ = "openfl.text._internal.TextFormatRange";
openfl_text__$internal_TextFormatRange.prototype = {
	end: null
	,format: null
	,start: null
	,__class__: openfl_text__$internal_TextFormatRange
};
var openfl_text__$internal_TextLayout = function(text,font,size,direction,script,language) {
	if(language == null) {
		language = "en";
	}
	if(script == null) {
		script = "Zyyy";
	}
	if(direction == null) {
		direction = 4;
	}
	if(size == null) {
		size = 12;
	}
	if(text == null) {
		text = "";
	}
	this.__hbFontSize = -1;
	this.letterSpacing = 0;
	this.set_text(text);
	this.set_font(font);
	this.set_size(size);
	this.__direction = direction;
	this.__script = script;
	this.__language = language;
	this.positions = [];
	this.__dirty = true;
	this.__create(this.__direction,this.__script,this.__language);
};
$hxClasses["openfl.text._internal.TextLayout"] = openfl_text__$internal_TextLayout;
openfl_text__$internal_TextLayout.__name__ = "openfl.text._internal.TextLayout";
openfl_text__$internal_TextLayout.prototype = {
	autoHint: null
	,font: null
	,glyphs: null
	,letterSpacing: null
	,positions: null
	,size: null
	,text: null
	,__buffer: null
	,__direction: null
	,__dirty: null
	,__handle: null
	,__language: null
	,__script: null
	,__font: null
	,__hbBuffer: null
	,__hbFont: null
	,__hbFontSize: null
	,__create: function(direction,script,language) {
		if(language.length != 4) {
			return;
		}
		this.__hbBuffer = lime_text_harfbuzz_HBBuffer._new();
		var direction1 = direction;
		var this1 = this.__hbBuffer;
		var value = lime_text_harfbuzz_HBLanguage._new(language);
	}
	,__position: function() {
		this.positions = [];
	}
	,get_positions: function() {
		if(this.__dirty) {
			this.__dirty = false;
			this.__position();
		}
		return this.positions;
	}
	,get_direction: function() {
		return this.__direction;
	}
	,set_direction: function(value) {
		if(value == this.__direction) {
			return value;
		}
		this.__direction = value;
		this.__dirty = true;
		return value;
	}
	,set_font: function(value) {
		if(value == this.font) {
			return value;
		}
		this.font = value;
		this.__dirty = true;
		return value;
	}
	,get_glyphs: function() {
		var glyphs = [];
		var _g = 0;
		var _g1 = this.get_positions();
		while(_g < _g1.length) {
			var position = _g1[_g];
			++_g;
			glyphs.push(position.glyph);
		}
		return glyphs;
	}
	,get_language: function() {
		return this.__language;
	}
	,set_language: function(value) {
		if(value == this.__language) {
			return value;
		}
		this.__language = value;
		this.__dirty = true;
		return value;
	}
	,get_script: function() {
		return this.__script;
	}
	,set_script: function(value) {
		if(value == this.__script) {
			return value;
		}
		this.__script = value;
		this.__dirty = true;
		return value;
	}
	,set_size: function(value) {
		if(value == this.size) {
			return value;
		}
		this.size = value;
		this.__dirty = true;
		return value;
	}
	,set_text: function(value) {
		if(value == this.text) {
			return value;
		}
		this.text = value;
		this.__dirty = true;
		return value;
	}
	,__class__: openfl_text__$internal_TextLayout
	,__properties__: {set_text:"set_text",set_size:"set_size",set_script:"set_script",get_script:"get_script",get_positions:"get_positions",set_language:"set_language",get_language:"get_language",get_glyphs:"get_glyphs",set_font:"set_font",set_direction:"set_direction",get_direction:"get_direction"}
};
var openfl_text__$internal_TextDirection = {};
openfl_text__$internal_TextDirection.__properties__ = {get_vertical:"get_vertical",get_horizontal:"get_horizontal",get_forward:"get_forward",get_backward:"get_backward"};
openfl_text__$internal_TextDirection.reverse = function(this1) {
	this1 ^= 1;
};
openfl_text__$internal_TextDirection.toString = function(this1) {
	switch(this1) {
	case 4:
		return "leftToRight";
	case 5:
		return "rightToLeft";
	case 6:
		return "topToBottom";
	case 7:
		return "bottomToTop";
	default:
		return "";
	}
};
openfl_text__$internal_TextDirection.toHBDirection = function(this1) {
	switch(this1) {
	case 4:
		return 4;
	case 5:
		return 5;
	case 6:
		return 6;
	case 7:
		return 7;
	default:
		return 0;
	}
};
openfl_text__$internal_TextDirection.get_backward = function(this1) {
	return (this1 & -3) == 5;
};
openfl_text__$internal_TextDirection.get_forward = function(this1) {
	return (this1 & -3) == 4;
};
openfl_text__$internal_TextDirection.get_horizontal = function(this1) {
	return (this1 & -2) == 4;
};
openfl_text__$internal_TextDirection.get_vertical = function(this1) {
	return (this1 & -2) == 6;
};
var openfl_text__$internal_TextScript = {};
openfl_text__$internal_TextScript.__properties__ = {get_rightToLeft:"get_rightToLeft"};
openfl_text__$internal_TextScript.toHBScript = function(this1) {
	return 1517910393;
};
openfl_text__$internal_TextScript.get_rightToLeft = function(this1) {
	switch(this1) {
	case "Arab":case "Armi":case "Avst":case "Cprt":case "Hebr":case "Khar":case "Lydi":case "Mand":case "Nkoo":case "Orkh":case "Phli":case "Phlp":case "Phnx":case "Samr":case "Sarb":case "Syrc":case "Thaa":
		return true;
	default:
		return false;
	}
};
var openfl_text__$internal_TextLayoutGroup = function(format,startIndex,endIndex) {
	this.format = format;
	this.startIndex = startIndex;
	this.endIndex = endIndex;
};
$hxClasses["openfl.text._internal.TextLayoutGroup"] = openfl_text__$internal_TextLayoutGroup;
openfl_text__$internal_TextLayoutGroup.__name__ = "openfl.text._internal.TextLayoutGroup";
openfl_text__$internal_TextLayoutGroup.prototype = {
	ascent: null
	,descent: null
	,endIndex: null
	,format: null
	,height: null
	,leading: null
	,lineIndex: null
	,offsetX: null
	,offsetY: null
	,positions: null
	,startIndex: null
	,width: null
	,getAdvance: function(index) {
		return this.positions[index];
	}
	,__class__: openfl_text__$internal_TextLayoutGroup
};
var openfl_ui_GameInput = function() {
	openfl_events_EventDispatcher.call(this);
	openfl_ui_GameInput.__instances.push(this);
};
$hxClasses["openfl.ui.GameInput"] = openfl_ui_GameInput;
openfl_ui_GameInput.__name__ = "openfl.ui.GameInput";
openfl_ui_GameInput.getDeviceAt = function(index) {
	if(index >= 0 && index < openfl_ui_GameInput.__deviceList.length) {
		return openfl_ui_GameInput.__deviceList[index];
	}
	return null;
};
openfl_ui_GameInput.__getDevice = function(gamepad) {
	if(gamepad == null) {
		return null;
	}
	if(openfl_ui_GameInput.__devices.h.__keys__[gamepad.__id__] == null) {
		var device = new openfl_ui_GameInputDevice(gamepad.__jsGamepad.id,gamepad.__jsGamepad.id);
		openfl_ui_GameInput.__deviceList.push(device);
		openfl_ui_GameInput.__devices.set(gamepad,device);
		openfl_ui_GameInput.numDevices = openfl_ui_GameInput.__deviceList.length;
	}
	return openfl_ui_GameInput.__devices.h[gamepad.__id__];
};
openfl_ui_GameInput.__onGamepadAxisMove = function(gamepad,axis,value) {
	var device = openfl_ui_GameInput.__getDevice(gamepad);
	if(device == null) {
		return;
	}
	if(device.enabled) {
		if(!device.__axis.h.hasOwnProperty(axis)) {
			var control;
			if(axis == null) {
				control = "null";
			} else {
				switch(axis) {
				case 0:
					control = "LEFT_X";
					break;
				case 1:
					control = "LEFT_Y";
					break;
				case 2:
					control = "RIGHT_X";
					break;
				case 3:
					control = "RIGHT_Y";
					break;
				case 4:
					control = "TRIGGER_LEFT";
					break;
				case 5:
					control = "TRIGGER_RIGHT";
					break;
				default:
					control = "UNKNOWN (" + axis + ")";
				}
			}
			var control1 = new openfl_ui_GameInputControl(device,"AXIS_" + control,-1,1);
			device.__axis.h[axis] = control1;
			device.__controls.push(control1);
		}
		var control = device.__axis.h[axis];
		control.value = value;
		control.dispatchEvent(new openfl_events_Event("change"));
	}
};
openfl_ui_GameInput.__onGamepadButtonDown = function(gamepad,button) {
	var device = openfl_ui_GameInput.__getDevice(gamepad);
	if(device == null) {
		return;
	}
	if(device.enabled) {
		if(!device.__button.h.hasOwnProperty(button)) {
			var control;
			if(button == null) {
				control = "null";
			} else {
				switch(button) {
				case 0:
					control = "A";
					break;
				case 1:
					control = "B";
					break;
				case 2:
					control = "X";
					break;
				case 3:
					control = "Y";
					break;
				case 4:
					control = "BACK";
					break;
				case 5:
					control = "GUIDE";
					break;
				case 6:
					control = "START";
					break;
				case 7:
					control = "LEFT_STICK";
					break;
				case 8:
					control = "RIGHT_STICK";
					break;
				case 9:
					control = "LEFT_SHOULDER";
					break;
				case 10:
					control = "RIGHT_SHOULDER";
					break;
				case 11:
					control = "DPAD_UP";
					break;
				case 12:
					control = "DPAD_DOWN";
					break;
				case 13:
					control = "DPAD_LEFT";
					break;
				case 14:
					control = "DPAD_RIGHT";
					break;
				default:
					control = "UNKNOWN (" + button + ")";
				}
			}
			var control1 = new openfl_ui_GameInputControl(device,"BUTTON_" + control,0,1);
			device.__button.h[button] = control1;
			device.__controls.push(control1);
		}
		var control = device.__button.h[button];
		control.value = 1;
		control.dispatchEvent(new openfl_events_Event("change"));
	}
};
openfl_ui_GameInput.__onGamepadButtonUp = function(gamepad,button) {
	var device = openfl_ui_GameInput.__getDevice(gamepad);
	if(device == null) {
		return;
	}
	if(device.enabled) {
		if(!device.__button.h.hasOwnProperty(button)) {
			var control;
			if(button == null) {
				control = "null";
			} else {
				switch(button) {
				case 0:
					control = "A";
					break;
				case 1:
					control = "B";
					break;
				case 2:
					control = "X";
					break;
				case 3:
					control = "Y";
					break;
				case 4:
					control = "BACK";
					break;
				case 5:
					control = "GUIDE";
					break;
				case 6:
					control = "START";
					break;
				case 7:
					control = "LEFT_STICK";
					break;
				case 8:
					control = "RIGHT_STICK";
					break;
				case 9:
					control = "LEFT_SHOULDER";
					break;
				case 10:
					control = "RIGHT_SHOULDER";
					break;
				case 11:
					control = "DPAD_UP";
					break;
				case 12:
					control = "DPAD_DOWN";
					break;
				case 13:
					control = "DPAD_LEFT";
					break;
				case 14:
					control = "DPAD_RIGHT";
					break;
				default:
					control = "UNKNOWN (" + button + ")";
				}
			}
			var control1 = new openfl_ui_GameInputControl(device,"BUTTON_" + control,0,1);
			device.__button.h[button] = control1;
			device.__controls.push(control1);
		}
		var control = device.__button.h[button];
		control.value = 0;
		control.dispatchEvent(new openfl_events_Event("change"));
	}
};
openfl_ui_GameInput.__onGamepadConnect = function(gamepad) {
	var device = openfl_ui_GameInput.__getDevice(gamepad);
	if(device == null) {
		return;
	}
	var _g = 0;
	var _g1 = openfl_ui_GameInput.__instances;
	while(_g < _g1.length) {
		var instance = _g1[_g];
		++_g;
		instance.dispatchEvent(new openfl_events_GameInputEvent("deviceAdded",true,false,device));
	}
};
openfl_ui_GameInput.__onGamepadDisconnect = function(gamepad) {
	var device = openfl_ui_GameInput.__devices.h[gamepad.__id__];
	if(device != null) {
		if(openfl_ui_GameInput.__devices.h.__keys__[gamepad.__id__] != null) {
			HxOverrides.remove(openfl_ui_GameInput.__deviceList,openfl_ui_GameInput.__devices.h[gamepad.__id__]);
			openfl_ui_GameInput.__devices.remove(gamepad);
		}
		openfl_ui_GameInput.numDevices = openfl_ui_GameInput.__deviceList.length;
		var _g = 0;
		var _g1 = openfl_ui_GameInput.__instances;
		while(_g < _g1.length) {
			var instance = _g1[_g];
			++_g;
			instance.dispatchEvent(new openfl_events_GameInputEvent("deviceRemoved",true,false,device));
		}
	}
};
openfl_ui_GameInput.__super__ = openfl_events_EventDispatcher;
openfl_ui_GameInput.prototype = $extend(openfl_events_EventDispatcher.prototype,{
	addEventListener: function(type,listener,useCapture,priority,useWeakReference) {
		if(useWeakReference == null) {
			useWeakReference = false;
		}
		if(priority == null) {
			priority = 0;
		}
		if(useCapture == null) {
			useCapture = false;
		}
		openfl_events_EventDispatcher.prototype.addEventListener.call(this,type,listener,useCapture,priority,useWeakReference);
		if(type == "deviceAdded") {
			var _g = 0;
			var _g1 = openfl_ui_GameInput.__deviceList;
			while(_g < _g1.length) {
				var device = _g1[_g];
				++_g;
				this.dispatchEvent(new openfl_events_GameInputEvent("deviceAdded",true,false,device));
			}
		}
	}
	,__class__: openfl_ui_GameInput
});
var openfl_ui_GameInputControl = function(device,id,minValue,maxValue,value) {
	if(value == null) {
		value = 0;
	}
	openfl_events_EventDispatcher.call(this);
	this.device = device;
	this.id = id;
	this.minValue = minValue;
	this.maxValue = maxValue;
	this.value = value;
};
$hxClasses["openfl.ui.GameInputControl"] = openfl_ui_GameInputControl;
openfl_ui_GameInputControl.__name__ = "openfl.ui.GameInputControl";
openfl_ui_GameInputControl.__super__ = openfl_events_EventDispatcher;
openfl_ui_GameInputControl.prototype = $extend(openfl_events_EventDispatcher.prototype,{
	device: null
	,id: null
	,maxValue: null
	,minValue: null
	,value: null
	,__class__: openfl_ui_GameInputControl
});
var openfl_ui_GameInputDevice = function(id,name) {
	this.__controls = [];
	this.__button = new haxe_ds_IntMap();
	this.__axis = new haxe_ds_IntMap();
	this.id = id;
	this.name = name;
	var control;
	control = new openfl_ui_GameInputControl(this,"AXIS_" + 0,-1,1);
	this.__axis.h[0] = control;
	this.__controls.push(control);
	control = new openfl_ui_GameInputControl(this,"AXIS_" + 1,-1,1);
	this.__axis.h[1] = control;
	this.__controls.push(control);
	control = new openfl_ui_GameInputControl(this,"AXIS_" + 2,-1,1);
	this.__axis.h[2] = control;
	this.__controls.push(control);
	control = new openfl_ui_GameInputControl(this,"AXIS_" + 3,-1,1);
	this.__axis.h[3] = control;
	this.__controls.push(control);
	control = new openfl_ui_GameInputControl(this,"AXIS_" + 4,-1,1);
	this.__axis.h[4] = control;
	this.__controls.push(control);
	control = new openfl_ui_GameInputControl(this,"AXIS_" + 5,-1,1);
	this.__axis.h[5] = control;
	this.__controls.push(control);
	var _g = 0;
	while(_g < 15) {
		var i = _g++;
		control = new openfl_ui_GameInputControl(this,"BUTTON_" + i,0,1);
		this.__button.h[i] = control;
		this.__controls.push(control);
	}
};
$hxClasses["openfl.ui.GameInputDevice"] = openfl_ui_GameInputDevice;
openfl_ui_GameInputDevice.__name__ = "openfl.ui.GameInputDevice";
openfl_ui_GameInputDevice.prototype = {
	enabled: null
	,id: null
	,name: null
	,sampleInterval: null
	,__axis: null
	,__button: null
	,__controls: null
	,__gamepad: null
	,getCachedSamples: function(data,append) {
		if(append == null) {
			append = false;
		}
		return 0;
	}
	,getControlAt: function(i) {
		if(i >= 0 && i < this.__controls.length) {
			return this.__controls[i];
		}
		return null;
	}
	,startCachingSamples: function(numSamples,controls) {
	}
	,stopCachingSamples: function() {
	}
	,get_numControls: function() {
		return this.__controls.length;
	}
	,__class__: openfl_ui_GameInputDevice
	,__properties__: {get_numControls:"get_numControls"}
};
var openfl_ui_Keyboard = function() { };
$hxClasses["openfl.ui.Keyboard"] = openfl_ui_Keyboard;
openfl_ui_Keyboard.__name__ = "openfl.ui.Keyboard";
openfl_ui_Keyboard.isAccessible = function() {
	return false;
};
openfl_ui_Keyboard.__convertKeyCode = function(key) {
	switch(key) {
	case 8:
		return 8;
	case 9:
		return 9;
	case 13:
		return 13;
	case 27:
		return 27;
	case 32:
		return 32;
	case 33:
		return 49;
	case 34:
		return 222;
	case 35:
		return 51;
	case 36:
		return 52;
	case 37:
		return 53;
	case 38:
		return 55;
	case 39:
		return 222;
	case 40:
		return 57;
	case 41:
		return 48;
	case 42:
		return 56;
	case 44:
		return 188;
	case 45:
		return 189;
	case 46:
		return 190;
	case 47:
		return 191;
	case 48:
		return 48;
	case 49:
		return 49;
	case 50:
		return 50;
	case 51:
		return 51;
	case 52:
		return 52;
	case 53:
		return 53;
	case 54:
		return 54;
	case 55:
		return 55;
	case 56:
		return 56;
	case 57:
		return 57;
	case 58:
		return 186;
	case 59:
		return 186;
	case 60:
		return 60;
	case 61:
		return 187;
	case 62:
		return 190;
	case 63:
		return 191;
	case 64:
		return 50;
	case 91:
		return 219;
	case 92:
		return 220;
	case 93:
		return 221;
	case 94:
		return 54;
	case 95:
		return 189;
	case 96:
		return 192;
	case 97:
		return 65;
	case 98:
		return 66;
	case 99:
		return 67;
	case 100:
		return 68;
	case 101:
		return 69;
	case 102:
		return 70;
	case 103:
		return 71;
	case 104:
		return 72;
	case 105:
		return 73;
	case 106:
		return 74;
	case 107:
		return 75;
	case 108:
		return 76;
	case 109:
		return 77;
	case 110:
		return 78;
	case 111:
		return 79;
	case 112:
		return 80;
	case 113:
		return 81;
	case 114:
		return 82;
	case 115:
		return 83;
	case 116:
		return 84;
	case 117:
		return 85;
	case 118:
		return 86;
	case 119:
		return 87;
	case 120:
		return 88;
	case 121:
		return 89;
	case 122:
		return 90;
	case 127:
		return 46;
	case 1073741881:
		return 20;
	case 1073741882:
		return 112;
	case 1073741883:
		return 113;
	case 1073741884:
		return 114;
	case 1073741885:
		return 115;
	case 1073741886:
		return 116;
	case 1073741887:
		return 117;
	case 1073741888:
		return 118;
	case 1073741889:
		return 119;
	case 1073741890:
		return 120;
	case 1073741891:
		return 121;
	case 1073741892:
		return 122;
	case 1073741893:
		return 123;
	case 1073741894:
		return 301;
	case 1073741895:
		return 145;
	case 1073741896:
		return 19;
	case 1073741897:
		return 45;
	case 1073741898:
		return 36;
	case 1073741899:
		return 33;
	case 1073741901:
		return 35;
	case 1073741902:
		return 34;
	case 1073741903:
		return 39;
	case 1073741904:
		return 37;
	case 1073741905:
		return 40;
	case 1073741906:
		return 38;
	case 1073741907:
		return 144;
	case 1073741908:
		return 111;
	case 1073741909:
		return 106;
	case 1073741910:
		return 109;
	case 1073741911:
		return 107;
	case 1073741912:
		return 13;
	case 1073741913:
		return 97;
	case 1073741914:
		return 98;
	case 1073741915:
		return 99;
	case 1073741916:
		return 100;
	case 1073741917:
		return 101;
	case 1073741918:
		return 102;
	case 1073741919:
		return 103;
	case 1073741920:
		return 104;
	case 1073741921:
		return 105;
	case 1073741922:
		return 96;
	case 1073741923:
		return 110;
	case 1073741925:
		return 302;
	case 1073741928:
		return 124;
	case 1073741929:
		return 125;
	case 1073741930:
		return 126;
	case 1073741982:
		return 13;
	case 1073742044:
		return 110;
	case 1073742048:
		return 17;
	case 1073742049:
		return 16;
	case 1073742050:
		return 18;
	case 1073742051:
		return 15;
	case 1073742052:
		return 17;
	case 1073742053:
		return 16;
	case 1073742054:
		return 18;
	case 1073742055:
		return 15;
	default:
		return key;
	}
};
openfl_ui_Keyboard.__getCharCode = function(key,shift,capsLock) {
	if(capsLock == null) {
		capsLock = false;
	}
	if(shift == null) {
		shift = false;
	}
	var effectiveShift = shift;
	if(key >= 65 && key <= 90) {
		effectiveShift = shift != capsLock;
	}
	if(!effectiveShift) {
		switch(key) {
		case 8:
			return 8;
		case 9:
			return 9;
		case 13:
			return 13;
		case 27:
			return 27;
		case 32:
			return 32;
		case 186:
			return 59;
		case 187:
			return 61;
		case 188:
			return 44;
		case 189:
			return 45;
		case 190:
			return 46;
		case 191:
			return 47;
		case 192:
			return 96;
		case 219:
			return 91;
		case 220:
			return 92;
		case 221:
			return 93;
		case 222:
			return 39;
		}
		if(key >= 48 && key <= 57) {
			return key - 48 + 48;
		}
		if(key >= 65 && key <= 90) {
			return key - 65 + 97;
		}
	} else {
		switch(key) {
		case 48:
			return 41;
		case 49:
			return 33;
		case 50:
			return 64;
		case 51:
			return 35;
		case 52:
			return 36;
		case 53:
			return 37;
		case 54:
			return 94;
		case 55:
			return 38;
		case 56:
			return 42;
		case 57:
			return 40;
		case 186:
			return 58;
		case 187:
			return 43;
		case 188:
			return 60;
		case 189:
			return 95;
		case 190:
			return 62;
		case 191:
			return 63;
		case 192:
			return 126;
		case 219:
			return 123;
		case 220:
			return 124;
		case 221:
			return 125;
		case 222:
			return 34;
		}
		if(key >= 65 && key <= 90) {
			return key - 65 + 65;
		}
	}
	if(key >= 96 && key <= 105) {
		return key - 96 + 48;
	}
	switch(key) {
	case 8:
		return 8;
	case 13:
		return 13;
	case 46:
		return 127;
	case 106:
		return 42;
	case 107:
		return 43;
	case 108:
		return 44;
	case 110:
		return 45;
	case 111:
		return 46;
	}
	return 0;
};
openfl_ui_Keyboard.__getKeyLocation = function(key) {
	switch(key) {
	case 1073741908:case 1073741909:case 1073741910:case 1073741911:case 1073741912:case 1073741913:case 1073741914:case 1073741915:case 1073741916:case 1073741917:case 1073741918:case 1073741919:case 1073741920:case 1073741921:case 1073741922:case 1073741923:case 1073742044:
		return 3;
	case 1073742048:case 1073742049:case 1073742050:case 1073742051:
		return 1;
	case 1073742052:case 1073742053:case 1073742054:case 1073742055:
		return 2;
	default:
		return 0;
	}
};
var openfl_ui_Mouse = function() { };
$hxClasses["openfl.ui.Mouse"] = openfl_ui_Mouse;
openfl_ui_Mouse.__name__ = "openfl.ui.Mouse";
openfl_ui_Mouse.__properties__ = {set_cursor:"set_cursor",get_cursor:"get_cursor"};
openfl_ui_Mouse.hide = function() {
	openfl_ui_Mouse.__hidden = true;
	var _g = 0;
	var _g1 = lime_app_Application.current.__windows;
	while(_g < _g1.length) {
		var window1 = _g1[_g];
		++_g;
		window1.set_cursor(null);
	}
};
openfl_ui_Mouse.show = function() {
	openfl_ui_Mouse.__hidden = false;
	var cacheCursor = openfl_ui_Mouse.__cursor;
	openfl_ui_Mouse.__cursor = null;
	openfl_ui_Mouse.set_cursor(cacheCursor);
};
openfl_ui_Mouse.get_cursor = function() {
	return openfl_ui_Mouse.__cursor;
};
openfl_ui_Mouse.set_cursor = function(value) {
	if(value == null) {
		value = "auto";
	}
	var setCursor = null;
	switch(value) {
	case "arrow":
		setCursor = lime_ui_MouseCursor.ARROW;
		break;
	case "button":
		setCursor = lime_ui_MouseCursor.POINTER;
		break;
	case "crosshair":
		setCursor = lime_ui_MouseCursor.CROSSHAIR;
		break;
	case "custom":
		setCursor = lime_ui_MouseCursor.CUSTOM;
		break;
	case "hand":
		setCursor = lime_ui_MouseCursor.MOVE;
		break;
	case "ibeam":
		setCursor = lime_ui_MouseCursor.TEXT;
		break;
	case "resize_nesw":
		setCursor = lime_ui_MouseCursor.RESIZE_NESW;
		break;
	case "resize_ns":
		setCursor = lime_ui_MouseCursor.RESIZE_NS;
		break;
	case "resize_nwse":
		setCursor = lime_ui_MouseCursor.RESIZE_NWSE;
		break;
	case "resize_we":
		setCursor = lime_ui_MouseCursor.RESIZE_WE;
		break;
	case "wait":
		setCursor = lime_ui_MouseCursor.WAIT;
		break;
	case "waitarrow":
		setCursor = lime_ui_MouseCursor.WAIT_ARROW;
		break;
	default:
	}
	if(setCursor != null && !openfl_ui_Mouse.__hidden) {
		var _g = 0;
		var _g1 = lime_app_Application.current.__windows;
		while(_g < _g1.length) {
			var window1 = _g1[_g];
			++_g;
			window1.set_cursor(setCursor);
		}
	}
	return openfl_ui_Mouse.__cursor = value;
};
var openfl_ui_MouseCursor = {};
openfl_ui_MouseCursor.fromLimeCursor = function(cursor) {
	switch(cursor._hx_index) {
	case 0:
		return "arrow";
	case 1:
		return "crosshair";
	case 2:
		return "auto";
	case 3:
		return "hand";
	case 4:
		return "button";
	case 5:
		return "resize_nesw";
	case 6:
		return "resize_ns";
	case 7:
		return "resize_nwse";
	case 8:
		return "resize_we";
	case 9:
		return "ibeam";
	case 10:
		return "wait";
	case 11:
		return "waitarrow";
	case 12:
		return "custom";
	}
};
openfl_ui_MouseCursor.toLimeCursor = function(this1) {
	switch(this1) {
	case "arrow":
		return lime_ui_MouseCursor.ARROW;
	case "auto":
		return lime_ui_MouseCursor.DEFAULT;
	case "button":
		return lime_ui_MouseCursor.POINTER;
	case "crosshair":
		return lime_ui_MouseCursor.CROSSHAIR;
	case "custom":
		return lime_ui_MouseCursor.CUSTOM;
	case "hand":
		return lime_ui_MouseCursor.MOVE;
	case "ibeam":
		return lime_ui_MouseCursor.TEXT;
	case "resize_nesw":
		return lime_ui_MouseCursor.RESIZE_NESW;
	case "resize_ns":
		return lime_ui_MouseCursor.RESIZE_NS;
	case "resize_nwse":
		return lime_ui_MouseCursor.RESIZE_NWSE;
	case "resize_we":
		return lime_ui_MouseCursor.RESIZE_WE;
	case "wait":
		return lime_ui_MouseCursor.WAIT;
	case "waitarrow":
		return lime_ui_MouseCursor.WAIT_ARROW;
	default:
		return lime_ui_MouseCursor.DEFAULT;
	}
};
var openfl_ui_Multitouch = function() { };
$hxClasses["openfl.ui.Multitouch"] = openfl_ui_Multitouch;
openfl_ui_Multitouch.__name__ = "openfl.ui.Multitouch";
openfl_ui_Multitouch.__properties__ = {get_supportsTouchEvents:"get_supportsTouchEvents"};
openfl_ui_Multitouch.get_supportsTouchEvents = function() {
	if(('ontouchstart' in document.documentElement) || (window.DocumentTouch && document instanceof DocumentTouch)) {
		return true;
	}
	return false;
};
var openfl_ui_MultitouchInputMode = {};
openfl_ui_MultitouchInputMode.fromString = function(value) {
	switch(value) {
	case "gesture":
		return 0;
	case "none":
		return 1;
	case "touchPoint":
		return 2;
	default:
		return null;
	}
};
openfl_ui_MultitouchInputMode.toString = function(this1) {
	switch(this1) {
	case 0:
		return "gesture";
	case 1:
		return "none";
	case 2:
		return "touchPoint";
	default:
		return null;
	}
};
var openfl_utils_AGALMiniAssembler = function(debugging) {
	if(debugging == null) {
		debugging = false;
	}
	this.debugEnabled = false;
	this.debugEnabled = debugging;
	if(!openfl_utils_AGALMiniAssembler.initialized) {
		openfl_utils_AGALMiniAssembler.init();
	}
};
$hxClasses["openfl.utils.AGALMiniAssembler"] = openfl_utils_AGALMiniAssembler;
openfl_utils_AGALMiniAssembler.__name__ = "openfl.utils.AGALMiniAssembler";
openfl_utils_AGALMiniAssembler.init = function() {
	openfl_utils_AGALMiniAssembler.initialized = true;
	var this1 = openfl_utils_AGALMiniAssembler.OPMAP;
	var v = new openfl_utils__$AGALMiniAssembler_OpCode("mov",2,0,0);
	this1.h["mov"] = v;
	var this1 = openfl_utils_AGALMiniAssembler.OPMAP;
	var v = new openfl_utils__$AGALMiniAssembler_OpCode("add",3,1,0);
	this1.h["add"] = v;
	var this1 = openfl_utils_AGALMiniAssembler.OPMAP;
	var v = new openfl_utils__$AGALMiniAssembler_OpCode("sub",3,2,0);
	this1.h["sub"] = v;
	var this1 = openfl_utils_AGALMiniAssembler.OPMAP;
	var v = new openfl_utils__$AGALMiniAssembler_OpCode("mul",3,3,0);
	this1.h["mul"] = v;
	var this1 = openfl_utils_AGALMiniAssembler.OPMAP;
	var v = new openfl_utils__$AGALMiniAssembler_OpCode("div",3,4,0);
	this1.h["div"] = v;
	var this1 = openfl_utils_AGALMiniAssembler.OPMAP;
	var v = new openfl_utils__$AGALMiniAssembler_OpCode("rcp",2,5,0);
	this1.h["rcp"] = v;
	var this1 = openfl_utils_AGALMiniAssembler.OPMAP;
	var v = new openfl_utils__$AGALMiniAssembler_OpCode("min",3,6,0);
	this1.h["min"] = v;
	var this1 = openfl_utils_AGALMiniAssembler.OPMAP;
	var v = new openfl_utils__$AGALMiniAssembler_OpCode("max",3,7,0);
	this1.h["max"] = v;
	var this1 = openfl_utils_AGALMiniAssembler.OPMAP;
	var v = new openfl_utils__$AGALMiniAssembler_OpCode("frc",2,8,0);
	this1.h["frc"] = v;
	var this1 = openfl_utils_AGALMiniAssembler.OPMAP;
	var v = new openfl_utils__$AGALMiniAssembler_OpCode("sqt",2,9,0);
	this1.h["sqt"] = v;
	var this1 = openfl_utils_AGALMiniAssembler.OPMAP;
	var v = new openfl_utils__$AGALMiniAssembler_OpCode("rsq",2,10,0);
	this1.h["rsq"] = v;
	var this1 = openfl_utils_AGALMiniAssembler.OPMAP;
	var v = new openfl_utils__$AGALMiniAssembler_OpCode("pow",3,11,0);
	this1.h["pow"] = v;
	var this1 = openfl_utils_AGALMiniAssembler.OPMAP;
	var v = new openfl_utils__$AGALMiniAssembler_OpCode("log",2,12,0);
	this1.h["log"] = v;
	var this1 = openfl_utils_AGALMiniAssembler.OPMAP;
	var v = new openfl_utils__$AGALMiniAssembler_OpCode("exp",2,13,0);
	this1.h["exp"] = v;
	var this1 = openfl_utils_AGALMiniAssembler.OPMAP;
	var v = new openfl_utils__$AGALMiniAssembler_OpCode("nrm",2,14,0);
	this1.h["nrm"] = v;
	var this1 = openfl_utils_AGALMiniAssembler.OPMAP;
	var v = new openfl_utils__$AGALMiniAssembler_OpCode("sin",2,15,0);
	this1.h["sin"] = v;
	var this1 = openfl_utils_AGALMiniAssembler.OPMAP;
	var v = new openfl_utils__$AGALMiniAssembler_OpCode("cos",2,16,0);
	this1.h["cos"] = v;
	var this1 = openfl_utils_AGALMiniAssembler.OPMAP;
	var v = new openfl_utils__$AGALMiniAssembler_OpCode("crs",3,17,0);
	this1.h["crs"] = v;
	var this1 = openfl_utils_AGALMiniAssembler.OPMAP;
	var v = new openfl_utils__$AGALMiniAssembler_OpCode("dp3",3,18,0);
	this1.h["dp3"] = v;
	var this1 = openfl_utils_AGALMiniAssembler.OPMAP;
	var v = new openfl_utils__$AGALMiniAssembler_OpCode("dp4",3,19,0);
	this1.h["dp4"] = v;
	var this1 = openfl_utils_AGALMiniAssembler.OPMAP;
	var v = new openfl_utils__$AGALMiniAssembler_OpCode("abs",2,20,0);
	this1.h["abs"] = v;
	var this1 = openfl_utils_AGALMiniAssembler.OPMAP;
	var v = new openfl_utils__$AGALMiniAssembler_OpCode("neg",2,21,0);
	this1.h["neg"] = v;
	var this1 = openfl_utils_AGALMiniAssembler.OPMAP;
	var v = new openfl_utils__$AGALMiniAssembler_OpCode("sat",2,22,0);
	this1.h["sat"] = v;
	var this1 = openfl_utils_AGALMiniAssembler.OPMAP;
	var v = new openfl_utils__$AGALMiniAssembler_OpCode("m33",3,23,16);
	this1.h["m33"] = v;
	var this1 = openfl_utils_AGALMiniAssembler.OPMAP;
	var v = new openfl_utils__$AGALMiniAssembler_OpCode("m44",3,24,16);
	this1.h["m44"] = v;
	var this1 = openfl_utils_AGALMiniAssembler.OPMAP;
	var v = new openfl_utils__$AGALMiniAssembler_OpCode("m34",3,25,16);
	this1.h["m34"] = v;
	var this1 = openfl_utils_AGALMiniAssembler.OPMAP;
	var v = new openfl_utils__$AGALMiniAssembler_OpCode("ddx",2,26,288);
	this1.h["ddx"] = v;
	var this1 = openfl_utils_AGALMiniAssembler.OPMAP;
	var v = new openfl_utils__$AGALMiniAssembler_OpCode("ddy",2,27,288);
	this1.h["ddy"] = v;
	var this1 = openfl_utils_AGALMiniAssembler.OPMAP;
	var v = new openfl_utils__$AGALMiniAssembler_OpCode("ife",2,28,897);
	this1.h["ife"] = v;
	var this1 = openfl_utils_AGALMiniAssembler.OPMAP;
	var v = new openfl_utils__$AGALMiniAssembler_OpCode("ine",2,29,897);
	this1.h["ine"] = v;
	var this1 = openfl_utils_AGALMiniAssembler.OPMAP;
	var v = new openfl_utils__$AGALMiniAssembler_OpCode("ifg",2,30,897);
	this1.h["ifg"] = v;
	var this1 = openfl_utils_AGALMiniAssembler.OPMAP;
	var v = new openfl_utils__$AGALMiniAssembler_OpCode("ifl",2,31,897);
	this1.h["ifl"] = v;
	var this1 = openfl_utils_AGALMiniAssembler.OPMAP;
	var v = new openfl_utils__$AGALMiniAssembler_OpCode("els",0,32,1921);
	this1.h["els"] = v;
	var this1 = openfl_utils_AGALMiniAssembler.OPMAP;
	var v = new openfl_utils__$AGALMiniAssembler_OpCode("eif",0,33,1409);
	this1.h["eif"] = v;
	var this1 = openfl_utils_AGALMiniAssembler.OPMAP;
	var v = new openfl_utils__$AGALMiniAssembler_OpCode("kil",1,39,160);
	this1.h["kil"] = v;
	var this1 = openfl_utils_AGALMiniAssembler.OPMAP;
	var v = new openfl_utils__$AGALMiniAssembler_OpCode("tex",3,40,40);
	this1.h["tex"] = v;
	var this1 = openfl_utils_AGALMiniAssembler.OPMAP;
	var v = new openfl_utils__$AGALMiniAssembler_OpCode("sge",3,41,0);
	this1.h["sge"] = v;
	var this1 = openfl_utils_AGALMiniAssembler.OPMAP;
	var v = new openfl_utils__$AGALMiniAssembler_OpCode("slt",3,42,0);
	this1.h["slt"] = v;
	var this1 = openfl_utils_AGALMiniAssembler.OPMAP;
	var v = new openfl_utils__$AGALMiniAssembler_OpCode("sgn",2,43,0);
	this1.h["sgn"] = v;
	var this1 = openfl_utils_AGALMiniAssembler.OPMAP;
	var v = new openfl_utils__$AGALMiniAssembler_OpCode("seq",3,44,0);
	this1.h["seq"] = v;
	var this1 = openfl_utils_AGALMiniAssembler.OPMAP;
	var v = new openfl_utils__$AGALMiniAssembler_OpCode("sne",3,45,0);
	this1.h["sne"] = v;
	var this1 = openfl_utils_AGALMiniAssembler.SAMPLEMAP;
	var v = new openfl_utils__$AGALMiniAssembler_Sampler("rgba",8,0);
	this1.h["rgba"] = v;
	var this1 = openfl_utils_AGALMiniAssembler.SAMPLEMAP;
	var v = new openfl_utils__$AGALMiniAssembler_Sampler("compressed",8,1);
	this1.h["compressed"] = v;
	var this1 = openfl_utils_AGALMiniAssembler.SAMPLEMAP;
	var v = new openfl_utils__$AGALMiniAssembler_Sampler("compressedalpha",8,2);
	this1.h["compressedalpha"] = v;
	var this1 = openfl_utils_AGALMiniAssembler.SAMPLEMAP;
	var v = new openfl_utils__$AGALMiniAssembler_Sampler("dxt1",8,1);
	this1.h["dxt1"] = v;
	var this1 = openfl_utils_AGALMiniAssembler.SAMPLEMAP;
	var v = new openfl_utils__$AGALMiniAssembler_Sampler("dxt5",8,2);
	this1.h["dxt5"] = v;
	var this1 = openfl_utils_AGALMiniAssembler.SAMPLEMAP;
	var v = new openfl_utils__$AGALMiniAssembler_Sampler("video",8,3);
	this1.h["video"] = v;
	var this1 = openfl_utils_AGALMiniAssembler.SAMPLEMAP;
	var v = new openfl_utils__$AGALMiniAssembler_Sampler("2d",12,0);
	this1.h["2d"] = v;
	var this1 = openfl_utils_AGALMiniAssembler.SAMPLEMAP;
	var v = new openfl_utils__$AGALMiniAssembler_Sampler("3d",12,2);
	this1.h["3d"] = v;
	var this1 = openfl_utils_AGALMiniAssembler.SAMPLEMAP;
	var v = new openfl_utils__$AGALMiniAssembler_Sampler("cube",12,1);
	this1.h["cube"] = v;
	var this1 = openfl_utils_AGALMiniAssembler.SAMPLEMAP;
	var v = new openfl_utils__$AGALMiniAssembler_Sampler("mipnearest",24,1);
	this1.h["mipnearest"] = v;
	var this1 = openfl_utils_AGALMiniAssembler.SAMPLEMAP;
	var v = new openfl_utils__$AGALMiniAssembler_Sampler("miplinear",24,2);
	this1.h["miplinear"] = v;
	var this1 = openfl_utils_AGALMiniAssembler.SAMPLEMAP;
	var v = new openfl_utils__$AGALMiniAssembler_Sampler("mipnone",24,0);
	this1.h["mipnone"] = v;
	var this1 = openfl_utils_AGALMiniAssembler.SAMPLEMAP;
	var v = new openfl_utils__$AGALMiniAssembler_Sampler("nomip",24,0);
	this1.h["nomip"] = v;
	var this1 = openfl_utils_AGALMiniAssembler.SAMPLEMAP;
	var v = new openfl_utils__$AGALMiniAssembler_Sampler("nearest",28,0);
	this1.h["nearest"] = v;
	var this1 = openfl_utils_AGALMiniAssembler.SAMPLEMAP;
	var v = new openfl_utils__$AGALMiniAssembler_Sampler("linear",28,1);
	this1.h["linear"] = v;
	var this1 = openfl_utils_AGALMiniAssembler.SAMPLEMAP;
	var v = new openfl_utils__$AGALMiniAssembler_Sampler("anisotropic2x",28,2);
	this1.h["anisotropic2x"] = v;
	var this1 = openfl_utils_AGALMiniAssembler.SAMPLEMAP;
	var v = new openfl_utils__$AGALMiniAssembler_Sampler("anisotropic4x",28,3);
	this1.h["anisotropic4x"] = v;
	var this1 = openfl_utils_AGALMiniAssembler.SAMPLEMAP;
	var v = new openfl_utils__$AGALMiniAssembler_Sampler("anisotropic8x",28,4);
	this1.h["anisotropic8x"] = v;
	var this1 = openfl_utils_AGALMiniAssembler.SAMPLEMAP;
	var v = new openfl_utils__$AGALMiniAssembler_Sampler("anisotropic16x",28,5);
	this1.h["anisotropic16x"] = v;
	var this1 = openfl_utils_AGALMiniAssembler.SAMPLEMAP;
	var v = new openfl_utils__$AGALMiniAssembler_Sampler("centroid",16,1);
	this1.h["centroid"] = v;
	var this1 = openfl_utils_AGALMiniAssembler.SAMPLEMAP;
	var v = new openfl_utils__$AGALMiniAssembler_Sampler("single",16,2);
	this1.h["single"] = v;
	var this1 = openfl_utils_AGALMiniAssembler.SAMPLEMAP;
	var v = new openfl_utils__$AGALMiniAssembler_Sampler("ignoresampler",16,4);
	this1.h["ignoresampler"] = v;
	var this1 = openfl_utils_AGALMiniAssembler.SAMPLEMAP;
	var v = new openfl_utils__$AGALMiniAssembler_Sampler("repeat",20,1);
	this1.h["repeat"] = v;
	var this1 = openfl_utils_AGALMiniAssembler.SAMPLEMAP;
	var v = new openfl_utils__$AGALMiniAssembler_Sampler("wrap",20,1);
	this1.h["wrap"] = v;
	var this1 = openfl_utils_AGALMiniAssembler.SAMPLEMAP;
	var v = new openfl_utils__$AGALMiniAssembler_Sampler("clamp",20,0);
	this1.h["clamp"] = v;
	var this1 = openfl_utils_AGALMiniAssembler.SAMPLEMAP;
	var v = new openfl_utils__$AGALMiniAssembler_Sampler("clamp_u_repeat_v",20,2);
	this1.h["clamp_u_repeat_v"] = v;
	var this1 = openfl_utils_AGALMiniAssembler.SAMPLEMAP;
	var v = new openfl_utils__$AGALMiniAssembler_Sampler("repeat_u_clamp_v",20,3);
	this1.h["repeat_u_clamp_v"] = v;
};
openfl_utils_AGALMiniAssembler.prototype = {
	agalcode: null
	,error: null
	,verbose: null
	,debugEnabled: null
	,assemble2: function(context3D,version,vertexSource,fragmentSource) {
		var agalVertex = this.assemble("vertex",vertexSource,version);
		var agalFragment = this.assemble("fragment",fragmentSource,version);
		var program = context3D.createProgram();
		program.upload(agalVertex,agalFragment);
		return program;
	}
	,assemble: function(mode,source,version,ignoreLimits) {
		if(ignoreLimits == null) {
			ignoreLimits = false;
		}
		if(version == null) {
			version = 1;
		}
		var start = openfl_Lib.getTimer();
		this.agalcode = new openfl_utils_ByteArrayData(0);
		this.error = "";
		var isFrag = false;
		if(mode == "fragment") {
			isFrag = true;
		} else if(mode != "vertex") {
			this.error = "ERROR: mode needs to be \"" + "fragment" + "\" or \"" + "vertex" + "\" but is \"" + mode + "\".";
		}
		this.agalcode.__endian = 1;
		this.agalcode.writeByte(160);
		this.agalcode.writeUnsignedInt(version);
		this.agalcode.writeByte(161);
		this.agalcode.writeByte(isFrag ? 1 : 0);
		this.initregmap(version,ignoreLimits);
		var lines = StringTools.replace(source,"\r","\n").split("\n");
		var nops = 0;
		var lng = lines.length;
		var reg1 = new EReg("<.*>","g");
		var reg2 = new EReg("([\\w\\.\\-\\+]+)","gi");
		var reg3 = new EReg("^\\w{3}","ig");
		var reg4 = new EReg("vc\\[([vofi][acostdip]?[d]?)(\\d*)?(\\.[xyzw](\\+\\d{1,3})?)?\\](\\.[xyzw]{1,4})?|([vofi][acostdip]?[d]?)(\\d*)?(\\.[xyzw]{1,4})?","gi");
		var reg5 = new EReg("\\[.*\\]","ig");
		var reg6 = new EReg("^\\b[A-Za-z]{1,3}","ig");
		var reg7 = new EReg("\\d+","");
		var reg8 = new EReg("(\\.[xyzw]{1,4})","");
		var reg9 = new EReg("[A-Za-z]{1,3}","ig");
		var reg10 = new EReg("(\\.[xyzw]{1,1})","");
		var reg11 = new EReg("\\+\\d{1,3}","ig");
		var i = 0;
		while(i < lng && this.error == "") {
			var line = StringTools.trim(lines[i]);
			var startcomment = line.indexOf("//");
			if(startcomment != -1) {
				line = HxOverrides.substr(line,0,startcomment);
			}
			var optsi = reg1.match(line) ? reg1.matchedPos().pos : -1;
			var opts = null;
			if(optsi != -1) {
				opts = this.match(HxOverrides.substr(line,optsi,null),reg2);
				line = HxOverrides.substr(line,0,optsi);
			}
			var opCode = null;
			var opFound = null;
			if(reg3.match(line)) {
				opCode = reg3.matched(0);
				opFound = openfl_utils_AGALMiniAssembler.OPMAP.h[opCode];
			}
			if(opFound == null) {
				if(line.length >= 3) {
					lime_utils_Log.warn("warning: bad line " + i + ": " + lines[i],{ fileName : "openfl/utils/AGALMiniAssembler.hx", lineNumber : 262, className : "openfl.utils.AGALMiniAssembler", methodName : "assemble"});
				}
				++i;
				continue;
			}
			if(this.debugEnabled) {
				lime_utils_Log.info(opFound,{ fileName : "openfl/utils/AGALMiniAssembler.hx", lineNumber : 272, className : "openfl.utils.AGALMiniAssembler", methodName : "assemble"});
			}
			if(opFound == null) {
				if(line.length >= 3) {
					lime_utils_Log.warn("warning: bad line " + i + ": " + lines[i],{ fileName : "openfl/utils/AGALMiniAssembler.hx", lineNumber : 279, className : "openfl.utils.AGALMiniAssembler", methodName : "assemble"});
				}
				++i;
				continue;
			}
			line = HxOverrides.substr(line,line.indexOf(opFound.name) + opFound.name.length,null);
			if((opFound.flags & 256) != 0 && version < 2) {
				this.error = "error: opcode requires version 2.";
				break;
			}
			if((opFound.flags & 64) != 0 && isFrag) {
				this.error = "error: opcode is only allowed in vertex programs.";
				break;
			}
			if((opFound.flags & 32) != 0 && !isFrag) {
				this.error = "error: opcode is only allowed in fragment programs.";
				break;
			}
			if(this.verbose) {
				lime_utils_Log.info("emit opcode=" + Std.string(opFound),{ fileName : "openfl/utils/AGALMiniAssembler.hx", lineNumber : 308, className : "openfl.utils.AGALMiniAssembler", methodName : "assemble"});
			}
			this.agalcode.writeUnsignedInt(opFound.emitCode);
			++nops;
			if(nops > 4096) {
				this.error = "error: too many opcodes. maximum is " + 4096 + ".";
				break;
			}
			var regs = this.match(line,reg4);
			if(regs.length != opFound.numRegister) {
				this.error = "error: wrong number of operands. found " + regs.length + " but expected " + opFound.numRegister + ".";
				break;
			}
			var badreg = false;
			var pad = 160;
			var regLength = regs.length;
			var _g = 0;
			var _g1 = regLength;
			while(_g < _g1) {
				var j = _g++;
				var isRelative = false;
				var relreg = this.match(regs[j],reg5);
				if(relreg.length > 0) {
					regs[j] = StringTools.replace(regs[j],relreg[0],"0");
					if(this.verbose) {
						lime_utils_Log.info("IS REL",{ fileName : "openfl/utils/AGALMiniAssembler.hx", lineNumber : 344, className : "openfl.utils.AGALMiniAssembler", methodName : "assemble"});
					}
					isRelative = true;
				}
				var res = this.match(regs[j],reg6);
				if(res.length == 0) {
					this.error = "error: could not parse operand " + j + " (" + regs[j] + ").";
					badreg = true;
					break;
				}
				var regFound = openfl_utils_AGALMiniAssembler.REGMAP.h[res[0]];
				if(this.debugEnabled) {
					lime_utils_Log.info(regFound,{ fileName : "openfl/utils/AGALMiniAssembler.hx", lineNumber : 363, className : "openfl.utils.AGALMiniAssembler", methodName : "assemble"});
				}
				if(regFound == null) {
					this.error = "error: could not find register name for operand " + j + " (" + regs[j] + ").";
					badreg = true;
					break;
				}
				if(isFrag) {
					if((regFound.flags & 32) == 0) {
						this.error = "error: register operand " + j + " (" + regs[j] + ") only allowed in vertex programs.";
						badreg = true;
						break;
					}
					if(isRelative) {
						this.error = "error: register operand " + j + " (" + regs[j] + ") relative adressing not allowed in fragment programs.";
						badreg = true;
						break;
					}
				} else if((regFound.flags & 64) == 0) {
					this.error = "error: register operand " + j + " (" + regs[j] + ") only allowed in fragment programs.";
					badreg = true;
					break;
				}
				regs[j] = HxOverrides.substr(regs[j],regs[j].indexOf(regFound.name) + regFound.name.length,null);
				var idxmatch = isRelative ? this.match(relreg[0],reg7) : this.match(regs[j],reg7);
				var regidx = 0;
				if(idxmatch.length > 0) {
					regidx = Std.parseInt(idxmatch[0]);
				}
				if(UInt.gt(regidx,regFound.range)) {
					var tmp = regFound.range + 1;
					this.error = "error: register operand " + j + " (" + regs[j] + ") index exceeds limit of " + (tmp == null ? "null" : Std.string(UInt.toFloat(tmp))) + ".";
					badreg = true;
					break;
				}
				var regmask = 0;
				var maskmatch = this.match(regs[j],reg8);
				var isDest = j == 0 && (opFound.flags & 128) == 0;
				var isSampler = j == 2 && (opFound.flags & 8) != 0;
				var reltype = 0;
				var relsel = 0;
				var reloffset = 0;
				if(isDest && isRelative) {
					this.error = "error: relative can not be destination";
					badreg = true;
					break;
				}
				if(maskmatch.length > 0) {
					regmask = 0;
					var cv = 0;
					var maskLength = maskmatch[0].length;
					var k = 1;
					while(k < maskLength) {
						cv = HxOverrides.cca(maskmatch[0],k) - 120;
						if(UInt.gt(cv,2)) {
							cv = 3;
						}
						if(isDest) {
							regmask |= 1 << cv;
						} else {
							regmask = regmask | cv << (k - 1 << 1);
						}
						++k;
					}
					if(!isDest) {
						while(k <= 4) {
							regmask = regmask | cv << (k - 1 << 1);
							++k;
						}
					}
				} else {
					regmask = isDest ? 15 : 228;
				}
				if(isRelative) {
					var relname = this.match(relreg[0],reg9);
					var regFoundRel = openfl_utils_AGALMiniAssembler.REGMAP.h[relname[0]];
					if(regFoundRel == null) {
						this.error = "error: bad index register";
						badreg = true;
						break;
					}
					reltype = regFoundRel.emitCode;
					var selmatch = this.match(relreg[0],reg10);
					if(selmatch.length == 0) {
						this.error = "error: bad index register select";
						badreg = true;
						break;
					}
					relsel = HxOverrides.cca(selmatch[0],1) - 120;
					if(UInt.gt(relsel,2)) {
						relsel = 3;
					}
					var relofs = this.match(relreg[0],reg11);
					if(relofs.length > 0) {
						reloffset = Std.parseInt(relofs[0]);
					}
					if(reloffset < 0 || reloffset > 255) {
						this.error = "error: index offset " + reloffset + " out of bounds. [0..255]";
						badreg = true;
						break;
					}
					if(this.verbose) {
						lime_utils_Log.info("RELATIVE: type=" + reltype + "==" + relname[0] + " sel=" + (relsel == null ? "null" : Std.string(UInt.toFloat(relsel))) + "==" + selmatch[0] + " idx=" + (regidx == null ? "null" : Std.string(UInt.toFloat(regidx))) + " offset=" + reloffset,{ fileName : "openfl/utils/AGALMiniAssembler.hx", lineNumber : 518, className : "openfl.utils.AGALMiniAssembler", methodName : "assemble"});
					}
				}
				if(this.verbose) {
					lime_utils_Log.info("  emit argcode=" + Std.string(regFound) + "[" + (regidx == null ? "null" : Std.string(UInt.toFloat(regidx))) + "][" + regmask + "]",{ fileName : "openfl/utils/AGALMiniAssembler.hx", lineNumber : 525, className : "openfl.utils.AGALMiniAssembler", methodName : "assemble"});
				}
				if(isDest) {
					this.agalcode.writeShort(regidx);
					this.agalcode.writeByte(regmask);
					this.agalcode.writeByte(regFound.emitCode);
					pad -= 32;
				} else if(isSampler) {
					if(this.verbose) {
						lime_utils_Log.info("  emit sampler",{ fileName : "openfl/utils/AGALMiniAssembler.hx", lineNumber : 541, className : "openfl.utils.AGALMiniAssembler", methodName : "assemble"});
					}
					var samplerbits = 5;
					var optsLength = opts == null ? 0 : opts.length;
					var bias = 0.0;
					var _g2 = 0;
					var _g3 = optsLength;
					while(_g2 < _g3) {
						var k1 = _g2++;
						if(this.verbose) {
							lime_utils_Log.info("    opt: " + opts[k1],{ fileName : "openfl/utils/AGALMiniAssembler.hx", lineNumber : 552, className : "openfl.utils.AGALMiniAssembler", methodName : "assemble"});
						}
						var optfound = openfl_utils_AGALMiniAssembler.SAMPLEMAP.h[opts[k1]];
						if(optfound == null) {
							bias = parseFloat(opts[k1]);
							if(this.verbose) {
								lime_utils_Log.info("    bias: " + bias,{ fileName : "openfl/utils/AGALMiniAssembler.hx", lineNumber : 565, className : "openfl.utils.AGALMiniAssembler", methodName : "assemble"});
							}
						} else {
							if(optfound.flag != 16) {
								samplerbits &= ~(15 << optfound.flag);
							}
							samplerbits = samplerbits | optfound.mask << optfound.flag;
						}
					}
					this.agalcode.writeShort(regidx);
					this.agalcode.writeByte(bias * 8.0 | 0);
					this.agalcode.writeByte(0);
					this.agalcode.writeUnsignedInt(samplerbits);
					if(this.verbose) {
						lime_utils_Log.info("    bits: " + (samplerbits - 5),{ fileName : "openfl/utils/AGALMiniAssembler.hx", lineNumber : 586, className : "openfl.utils.AGALMiniAssembler", methodName : "assemble"});
					}
					pad -= 64;
				} else {
					if(j == 0) {
						this.agalcode.writeUnsignedInt(0);
						pad -= 32;
					}
					this.agalcode.writeShort(regidx);
					this.agalcode.writeByte(reloffset);
					this.agalcode.writeByte(regmask);
					this.agalcode.writeByte(regFound.emitCode);
					this.agalcode.writeByte(reltype);
					this.agalcode.writeShort(isRelative ? relsel | 32768 : 0);
					pad -= 64;
				}
			}
			var j1 = 0;
			while(j1 < pad) {
				this.agalcode.writeByte(0);
				j1 += 8;
			}
			if(badreg) {
				break;
			}
			++i;
		}
		if(this.error != "") {
			this.error += "\n  at line " + i + " " + lines[i];
			openfl_utils_ByteArray.set_length(this.agalcode,0);
			lime_utils_Log.info(this.error,{ fileName : "openfl/utils/AGALMiniAssembler.hx", lineNumber : 631, className : "openfl.utils.AGALMiniAssembler", methodName : "assemble"});
		}
		if(this.debugEnabled) {
			var dbgLine = "generated bytecode:";
			var agalLength = openfl_utils_ByteArray.get_length(this.agalcode);
			var _g = 0;
			var _g1 = agalLength;
			while(_g < _g1) {
				var index = _g++;
				if(index % 16 == 0) {
					dbgLine += "\n";
				}
				if(index % 4 == 0) {
					dbgLine += " ";
				}
				var byteStr = StringTools.hex(this.agalcode.b[index],2);
				if(byteStr.length < 2) {
					byteStr = "0" + byteStr;
				}
				dbgLine += byteStr;
			}
			lime_utils_Log.info(dbgLine,{ fileName : "openfl/utils/AGALMiniAssembler.hx", lineNumber : 662, className : "openfl.utils.AGALMiniAssembler", methodName : "assemble"});
		}
		if(this.verbose) {
			lime_utils_Log.info("AGALMiniAssembler.assemble time: " + (openfl_Lib.getTimer() - start) / 1000 + "s",{ fileName : "openfl/utils/AGALMiniAssembler.hx", lineNumber : 667, className : "openfl.utils.AGALMiniAssembler", methodName : "assemble"});
		}
		return this.agalcode;
	}
	,initregmap: function(version,ignorelimits) {
		var this1 = openfl_utils_AGALMiniAssembler.REGMAP;
		var v = new openfl_utils__$AGALMiniAssembler_Register("va","vertex attribute",0,ignorelimits ? 1024 : version == 1 || version == 2 ? 7 : 15,66);
		this1.h["va"] = v;
		var this1 = openfl_utils_AGALMiniAssembler.REGMAP;
		var v = new openfl_utils__$AGALMiniAssembler_Register("vc","vertex constant",1,ignorelimits ? 1024 : version == 1 ? 127 : 249,66);
		this1.h["vc"] = v;
		var this1 = openfl_utils_AGALMiniAssembler.REGMAP;
		var v = new openfl_utils__$AGALMiniAssembler_Register("vt","vertex temporary",2,ignorelimits ? 1024 : version == 1 ? 7 : 25,67);
		this1.h["vt"] = v;
		var this1 = openfl_utils_AGALMiniAssembler.REGMAP;
		var v = new openfl_utils__$AGALMiniAssembler_Register("vo","vertex output",3,ignorelimits ? 1024 : 0,65);
		this1.h["vo"] = v;
		var this1 = openfl_utils_AGALMiniAssembler.REGMAP;
		var v = new openfl_utils__$AGALMiniAssembler_Register("vi","varying",4,ignorelimits ? 1024 : version == 1 ? 7 : 9,99);
		this1.h["vi"] = v;
		var this1 = openfl_utils_AGALMiniAssembler.REGMAP;
		var v = new openfl_utils__$AGALMiniAssembler_Register("fc","fragment constant",1,ignorelimits ? 1024 : version == 1 ? 27 : version == 2 ? 63 : 199,34);
		this1.h["fc"] = v;
		var this1 = openfl_utils_AGALMiniAssembler.REGMAP;
		var v = new openfl_utils__$AGALMiniAssembler_Register("ft","fragment temporary",2,ignorelimits ? 1024 : version == 1 ? 7 : 25,35);
		this1.h["ft"] = v;
		var this1 = openfl_utils_AGALMiniAssembler.REGMAP;
		var v = new openfl_utils__$AGALMiniAssembler_Register("fs","texture sampler",5,ignorelimits ? 1024 : 7,34);
		this1.h["fs"] = v;
		var this1 = openfl_utils_AGALMiniAssembler.REGMAP;
		var v = new openfl_utils__$AGALMiniAssembler_Register("fo","fragment output",3,ignorelimits ? 1024 : version == 1 ? 0 : 3,33);
		this1.h["fo"] = v;
		var this1 = openfl_utils_AGALMiniAssembler.REGMAP;
		var v = new openfl_utils__$AGALMiniAssembler_Register("fd","fragment depth output",6,ignorelimits ? 1024 : version == 1 ? -1 : 0,33);
		this1.h["fd"] = v;
		var this1 = openfl_utils_AGALMiniAssembler.REGMAP;
		var v = new openfl_utils__$AGALMiniAssembler_Register("iid","instance id",7,ignorelimits ? 1024 : 0,66);
		this1.h["iid"] = v;
		var v = openfl_utils_AGALMiniAssembler.REGMAP.h["vo"];
		openfl_utils_AGALMiniAssembler.REGMAP.h["op"] = v;
		var v = openfl_utils_AGALMiniAssembler.REGMAP.h["vi"];
		openfl_utils_AGALMiniAssembler.REGMAP.h["i"] = v;
		var v = openfl_utils_AGALMiniAssembler.REGMAP.h["vi"];
		openfl_utils_AGALMiniAssembler.REGMAP.h["v"] = v;
		var v = openfl_utils_AGALMiniAssembler.REGMAP.h["fo"];
		openfl_utils_AGALMiniAssembler.REGMAP.h["oc"] = v;
		var v = openfl_utils_AGALMiniAssembler.REGMAP.h["fd"];
		openfl_utils_AGALMiniAssembler.REGMAP.h["od"] = v;
		var v = openfl_utils_AGALMiniAssembler.REGMAP.h["vi"];
		openfl_utils_AGALMiniAssembler.REGMAP.h["fi"] = v;
	}
	,match: function(value,reg) {
		var matches = [];
		var index = 0;
		var match;
		while(reg.matchSub(value,index)) {
			match = reg.matched(0);
			matches.push(match);
			index = reg.matchedPos().pos + match.length;
		}
		return matches;
	}
	,__class__: openfl_utils_AGALMiniAssembler
};
var openfl_utils__$AGALMiniAssembler_OpCode = function(name,numRegister,emitCode,flags) {
	this.name = name;
	this.numRegister = numRegister;
	this.emitCode = emitCode;
	this.flags = flags;
};
$hxClasses["openfl.utils._AGALMiniAssembler.OpCode"] = openfl_utils__$AGALMiniAssembler_OpCode;
openfl_utils__$AGALMiniAssembler_OpCode.__name__ = "openfl.utils._AGALMiniAssembler.OpCode";
openfl_utils__$AGALMiniAssembler_OpCode.prototype = {
	emitCode: null
	,flags: null
	,name: null
	,numRegister: null
	,toString: function() {
		return "[OpCode name=\"" + this.name + "\", numRegister=" + this.numRegister + ", emitCode=" + this.emitCode + ", flags=" + this.flags + "]";
	}
	,__class__: openfl_utils__$AGALMiniAssembler_OpCode
};
var openfl_utils__$AGALMiniAssembler_Register = function(name,longName,emitCode,range,flags) {
	this.name = name;
	this.longName = longName;
	this.emitCode = emitCode;
	this.range = range;
	this.flags = flags;
};
$hxClasses["openfl.utils._AGALMiniAssembler.Register"] = openfl_utils__$AGALMiniAssembler_Register;
openfl_utils__$AGALMiniAssembler_Register.__name__ = "openfl.utils._AGALMiniAssembler.Register";
openfl_utils__$AGALMiniAssembler_Register.prototype = {
	emitCode: null
	,name: null
	,longName: null
	,flags: null
	,range: null
	,toString: function() {
		return "[Register name=\"" + this.name + "\", longName=\"" + this.longName + "\", emitCode=" + (this.emitCode == null ? "null" : Std.string(UInt.toFloat(this.emitCode))) + ", range=" + (this.range == null ? "null" : Std.string(UInt.toFloat(this.range))) + ", flags=" + (this.flags == null ? "null" : Std.string(UInt.toFloat(this.flags))) + "]";
	}
	,__class__: openfl_utils__$AGALMiniAssembler_Register
};
var openfl_utils__$AGALMiniAssembler_Sampler = function(name,flag,mask) {
	this.name = name;
	this.flag = flag;
	this.mask = mask;
};
$hxClasses["openfl.utils._AGALMiniAssembler.Sampler"] = openfl_utils__$AGALMiniAssembler_Sampler;
openfl_utils__$AGALMiniAssembler_Sampler.__name__ = "openfl.utils._AGALMiniAssembler.Sampler";
openfl_utils__$AGALMiniAssembler_Sampler.prototype = {
	flag: null
	,mask: null
	,name: null
	,toString: function() {
		return "[Sampler name=\"" + this.name + "\", flag=\"" + (this.flag == null ? "null" : Std.string(UInt.toFloat(this.flag))) + "\", mask=" + (this.mask == null ? "null" : Std.string(UInt.toFloat(this.mask))) + "]";
	}
	,__class__: openfl_utils__$AGALMiniAssembler_Sampler
};
var openfl_utils_IAssetCache = function() { };
$hxClasses["openfl.utils.IAssetCache"] = openfl_utils_IAssetCache;
openfl_utils_IAssetCache.__name__ = "openfl.utils.IAssetCache";
openfl_utils_IAssetCache.__isInterface__ = true;
openfl_utils_IAssetCache.prototype = {
	get_enabled: null
	,set_enabled: null
	,clear: null
	,getBitmapData: null
	,getFont: null
	,getSound: null
	,hasBitmapData: null
	,hasFont: null
	,hasSound: null
	,removeBitmapData: null
	,removeFont: null
	,removeSound: null
	,setBitmapData: null
	,setFont: null
	,setSound: null
	,__class__: openfl_utils_IAssetCache
	,__properties__: {set_enabled:"set_enabled",get_enabled:"get_enabled"}
};
var openfl_utils_AssetCache = function() {
	this.__enabled = true;
	this.bitmapData = new haxe_ds_StringMap();
	this.font = new haxe_ds_StringMap();
	this.sound = new haxe_ds_StringMap();
};
$hxClasses["openfl.utils.AssetCache"] = openfl_utils_AssetCache;
openfl_utils_AssetCache.__name__ = "openfl.utils.AssetCache";
openfl_utils_AssetCache.__interfaces__ = [openfl_utils_IAssetCache];
openfl_utils_AssetCache.prototype = {
	bitmapData: null
	,font: null
	,sound: null
	,__enabled: null
	,clear: function(prefix) {
		if(prefix == null) {
			this.bitmapData = new haxe_ds_StringMap();
			this.font = new haxe_ds_StringMap();
			this.sound = new haxe_ds_StringMap();
		} else {
			var h = this.bitmapData.h;
			var key_h = h;
			var key_keys = Object.keys(h);
			var key_length = key_keys.length;
			var key_current = 0;
			while(key_current < key_length) {
				var key = key_keys[key_current++];
				if(StringTools.startsWith(key,prefix)) {
					this.removeBitmapData(key);
				}
			}
			var h = this.font.h;
			var key_h = h;
			var key_keys = Object.keys(h);
			var key_length = key_keys.length;
			var key_current = 0;
			while(key_current < key_length) {
				var key = key_keys[key_current++];
				if(StringTools.startsWith(key,prefix)) {
					this.removeFont(key);
				}
			}
			var h = this.sound.h;
			var key_h = h;
			var key_keys = Object.keys(h);
			var key_length = key_keys.length;
			var key_current = 0;
			while(key_current < key_length) {
				var key = key_keys[key_current++];
				if(StringTools.startsWith(key,prefix)) {
					this.removeSound(key);
				}
			}
		}
	}
	,getBitmapData: function(id) {
		return this.bitmapData.h[id];
	}
	,getFont: function(id) {
		return this.font.h[id];
	}
	,getSound: function(id) {
		return this.sound.h[id];
	}
	,hasBitmapData: function(id) {
		return Object.prototype.hasOwnProperty.call(this.bitmapData.h,id);
	}
	,hasFont: function(id) {
		return Object.prototype.hasOwnProperty.call(this.font.h,id);
	}
	,hasSound: function(id) {
		return Object.prototype.hasOwnProperty.call(this.sound.h,id);
	}
	,removeBitmapData: function(id) {
		var _this = lime_utils_Assets.cache.image;
		if(Object.prototype.hasOwnProperty.call(_this.h,id)) {
			delete(_this.h[id]);
		}
		var _this = this.bitmapData;
		if(Object.prototype.hasOwnProperty.call(_this.h,id)) {
			delete(_this.h[id]);
			return true;
		} else {
			return false;
		}
	}
	,removeFont: function(id) {
		var _this = lime_utils_Assets.cache.font;
		if(Object.prototype.hasOwnProperty.call(_this.h,id)) {
			delete(_this.h[id]);
		}
		var _this = this.font;
		if(Object.prototype.hasOwnProperty.call(_this.h,id)) {
			delete(_this.h[id]);
			return true;
		} else {
			return false;
		}
	}
	,removeSound: function(id) {
		var _this = lime_utils_Assets.cache.audio;
		if(Object.prototype.hasOwnProperty.call(_this.h,id)) {
			delete(_this.h[id]);
		}
		var _this = this.sound;
		if(Object.prototype.hasOwnProperty.call(_this.h,id)) {
			delete(_this.h[id]);
			return true;
		} else {
			return false;
		}
	}
	,setBitmapData: function(id,bitmapData) {
		this.bitmapData.h[id] = bitmapData;
	}
	,setFont: function(id,font) {
		this.font.h[id] = font;
	}
	,setSound: function(id,sound) {
		this.sound.h[id] = sound;
	}
	,get_enabled: function() {
		return this.__enabled;
	}
	,set_enabled: function(value) {
		return this.__enabled = value;
	}
	,__class__: openfl_utils_AssetCache
	,__properties__: {set_enabled:"set_enabled",get_enabled:"get_enabled"}
};
var openfl_utils_AssetLibrary = function() {
	lime_utils_AssetLibrary.call(this);
};
$hxClasses["openfl.utils.AssetLibrary"] = openfl_utils_AssetLibrary;
openfl_utils_AssetLibrary.__name__ = "openfl.utils.AssetLibrary";
openfl_utils_AssetLibrary.fromBundle = function(bundle) {
	var library = lime_utils_AssetLibrary.fromBundle(bundle);
	if(library != null) {
		if(((library) instanceof openfl_utils_AssetLibrary)) {
			return library;
		} else {
			var _library = new openfl_utils_AssetLibrary();
			_library.__proxy = library;
			return _library;
		}
	} else {
		return null;
	}
};
openfl_utils_AssetLibrary.fromBytes = function(bytes,rootPath) {
	return openfl_utils_AssetLibrary.fromManifest(lime_utils_AssetManifest.fromBytes(openfl_utils_ByteArray.toLimeBytes(bytes),rootPath));
};
openfl_utils_AssetLibrary.fromFile = function(path,rootPath) {
	return openfl_utils_AssetLibrary.fromManifest(lime_utils_AssetManifest.fromFile(path,rootPath));
};
openfl_utils_AssetLibrary.fromManifest = function(manifest) {
	var library = lime_utils_AssetLibrary.fromManifest(manifest);
	if(library != null) {
		if(((library) instanceof openfl_utils_AssetLibrary)) {
			return library;
		} else {
			var _library = new openfl_utils_AssetLibrary();
			_library.__proxy = library;
			return _library;
		}
	} else {
		return null;
	}
};
openfl_utils_AssetLibrary.loadFromBytes = function(bytes,rootPath) {
	return lime_utils_AssetManifest.loadFromBytes(openfl_utils_ByteArray.toLimeBytes(bytes),rootPath).then(function(manifest) {
		return openfl_utils_AssetLibrary.loadFromManifest(manifest);
	});
};
openfl_utils_AssetLibrary.loadFromFile = function(path,rootPath) {
	return lime_utils_AssetManifest.loadFromFile(path,rootPath).then(function(manifest) {
		return openfl_utils_AssetLibrary.loadFromManifest(manifest);
	});
};
openfl_utils_AssetLibrary.loadFromManifest = function(manifest) {
	var library = openfl_utils_AssetLibrary.fromManifest(manifest);
	if(library != null) {
		return library.load().then(function(library) {
			return lime_app_Future.withValue(library);
		});
	} else {
		return lime_app_Future.withError("Could not load asset manifest");
	}
};
openfl_utils_AssetLibrary.__super__ = lime_utils_AssetLibrary;
openfl_utils_AssetLibrary.prototype = $extend(lime_utils_AssetLibrary.prototype,{
	__proxy: null
	,bind: function(className,instance) {
		return false;
	}
	,exists: function(id,type) {
		if(this.__proxy != null) {
			return this.__proxy.exists(id,type);
		} else {
			return lime_utils_AssetLibrary.prototype.exists.call(this,id,type);
		}
	}
	,getAsset: function(id,type) {
		if(this.__proxy != null) {
			return this.__proxy.getAsset(id,type);
		} else {
			return lime_utils_AssetLibrary.prototype.getAsset.call(this,id,type);
		}
	}
	,getAudioBuffer: function(id) {
		if(this.__proxy != null) {
			return this.__proxy.getAudioBuffer(id);
		} else {
			return lime_utils_AssetLibrary.prototype.getAudioBuffer.call(this,id);
		}
	}
	,getBytes: function(id) {
		if(this.__proxy != null) {
			return this.__proxy.getBytes(id);
		} else {
			return lime_utils_AssetLibrary.prototype.getBytes.call(this,id);
		}
	}
	,getFont: function(id) {
		if(this.__proxy != null) {
			return this.__proxy.getFont(id);
		} else {
			return lime_utils_AssetLibrary.prototype.getFont.call(this,id);
		}
	}
	,getImage: function(id) {
		if(this.__proxy != null) {
			return this.__proxy.getImage(id);
		} else {
			return lime_utils_AssetLibrary.prototype.getImage.call(this,id);
		}
	}
	,getMovieClip: function(id) {
		return null;
	}
	,getPath: function(id) {
		if(this.__proxy != null) {
			return this.__proxy.getPath(id);
		} else {
			return lime_utils_AssetLibrary.prototype.getPath.call(this,id);
		}
	}
	,getText: function(id) {
		if(this.__proxy != null) {
			return this.__proxy.getText(id);
		} else {
			return lime_utils_AssetLibrary.prototype.getText.call(this,id);
		}
	}
	,isLocal: function(id,type) {
		if(this.__proxy != null) {
			return this.__proxy.isLocal(id,type);
		} else {
			return lime_utils_AssetLibrary.prototype.isLocal.call(this,id,type);
		}
	}
	,list: function(type) {
		if(this.__proxy != null) {
			return this.__proxy.list(type);
		} else {
			return lime_utils_AssetLibrary.prototype.list.call(this,type);
		}
	}
	,loadAsset: function(id,type) {
		if(this.__proxy != null) {
			return this.__proxy.loadAsset(id,type);
		} else {
			return lime_utils_AssetLibrary.prototype.loadAsset.call(this,id,type);
		}
	}
	,load: function() {
		if(this.__proxy != null) {
			return this.__proxy.load();
		} else {
			return lime_utils_AssetLibrary.prototype.load.call(this);
		}
	}
	,loadAudioBuffer: function(id) {
		if(this.__proxy != null) {
			return this.__proxy.loadAudioBuffer(id);
		} else {
			return lime_utils_AssetLibrary.prototype.loadAudioBuffer.call(this,id);
		}
	}
	,loadBytes: function(id) {
		if(this.__proxy != null) {
			return this.__proxy.loadBytes(id);
		} else {
			return lime_utils_AssetLibrary.prototype.loadBytes.call(this,id);
		}
	}
	,loadFont: function(id) {
		if(this.__proxy != null) {
			return this.__proxy.loadFont(id);
		} else {
			return lime_utils_AssetLibrary.prototype.loadFont.call(this,id);
		}
	}
	,loadImage: function(id) {
		if(this.__proxy != null) {
			return this.__proxy.loadImage(id);
		} else {
			return lime_utils_AssetLibrary.prototype.loadImage.call(this,id);
		}
	}
	,loadMovieClip: function(id) {
		return lime_app_Future.withValue(this.getMovieClip(id));
	}
	,loadText: function(id) {
		if(this.__proxy != null) {
			return this.__proxy.loadText(id);
		} else {
			return lime_utils_AssetLibrary.prototype.loadText.call(this,id);
		}
	}
	,unload: function() {
		if(this.__proxy != null) {
			this.__proxy.unload();
			return;
		} else {
			lime_utils_AssetLibrary.prototype.unload.call(this);
			return;
		}
	}
	,__class__: openfl_utils_AssetLibrary
});
var openfl_utils_Assets = function() { };
$hxClasses["openfl.utils.Assets"] = openfl_utils_Assets;
openfl_utils_Assets.__name__ = "openfl.utils.Assets";
openfl_utils_Assets.addEventListener = function(type,listener,useCapture,priority,useWeakReference) {
	if(useWeakReference == null) {
		useWeakReference = false;
	}
	if(priority == null) {
		priority = 0;
	}
	if(useCapture == null) {
		useCapture = false;
	}
	if(!lime_utils_Assets.onChange.has(openfl_utils_Assets.LimeAssets_onChange)) {
		lime_utils_Assets.onChange.add(openfl_utils_Assets.LimeAssets_onChange);
	}
	openfl_utils_Assets.dispatcher.addEventListener(type,listener,useCapture,priority,useWeakReference);
};
openfl_utils_Assets.dispatchEvent = function(event) {
	return openfl_utils_Assets.dispatcher.dispatchEvent(event);
};
openfl_utils_Assets.exists = function(id,type) {
	return lime_utils_Assets.exists(id,type);
};
openfl_utils_Assets.getBitmapData = function(id,useCache) {
	if(useCache == null) {
		useCache = true;
	}
	if(useCache && openfl_utils_Assets.cache.get_enabled() && openfl_utils_Assets.cache.hasBitmapData(id)) {
		var bitmapData = openfl_utils_Assets.cache.getBitmapData(id);
		if(openfl_utils_Assets.isValidBitmapData(bitmapData)) {
			return bitmapData;
		}
	}
	var image = lime_utils_Assets.getImage(id,false);
	if(image != null) {
		var bitmapData = openfl_display_BitmapData.fromImage(image);
		bitmapData.__asset = true;
		if(useCache && openfl_utils_Assets.cache.get_enabled()) {
			openfl_utils_Assets.cache.setBitmapData(id,bitmapData);
		}
		return bitmapData;
	}
	return null;
};
openfl_utils_Assets.getBytes = function(id) {
	return openfl_utils_ByteArray.fromLimeBytes(lime_utils_Assets.getBytes(id));
};
openfl_utils_Assets.getFont = function(id,useCache) {
	if(useCache == null) {
		useCache = true;
	}
	if(useCache && openfl_utils_Assets.cache.get_enabled() && openfl_utils_Assets.cache.hasFont(id)) {
		return openfl_utils_Assets.cache.getFont(id);
	}
	var limeFont = lime_utils_Assets.getFont(id,false);
	if(limeFont != null) {
		var font = new openfl_text_Font();
		font.__fromLimeFont(limeFont);
		if(useCache && openfl_utils_Assets.cache.get_enabled()) {
			openfl_utils_Assets.cache.setFont(id,font);
		}
		return font;
	}
	return new openfl_text_Font();
};
openfl_utils_Assets.getLibrary = function(name) {
	return lime_utils_Assets.getLibrary(name);
};
openfl_utils_Assets.getMovieClip = function(id) {
	var libraryName = id.substring(0,id.indexOf(":"));
	var symbolName = HxOverrides.substr(id,id.indexOf(":") + 1,null);
	var limeLibrary = openfl_utils_Assets.getLibrary(libraryName);
	if(limeLibrary != null) {
		if(((limeLibrary) instanceof openfl_utils_AssetLibrary)) {
			var library = limeLibrary;
			if(library.exists(symbolName,"MOVIE_CLIP")) {
				if(library.isLocal(symbolName,"MOVIE_CLIP")) {
					return library.getMovieClip(symbolName);
				} else {
					lime_utils_Log.error("MovieClip asset \"" + id + "\" exists, but only asynchronously",{ fileName : "openfl/utils/Assets.hx", lineNumber : 261, className : "openfl.utils.Assets", methodName : "getMovieClip"});
					return null;
				}
			}
		}
		lime_utils_Log.error("There is no MovieClip asset with an ID of \"" + id + "\"",{ fileName : "openfl/utils/Assets.hx", lineNumber : 267, className : "openfl.utils.Assets", methodName : "getMovieClip"});
	} else {
		lime_utils_Log.error("There is no asset library named \"" + libraryName + "\"",{ fileName : "openfl/utils/Assets.hx", lineNumber : 271, className : "openfl.utils.Assets", methodName : "getMovieClip"});
	}
	return null;
};
openfl_utils_Assets.getMusic = function(id,useCache) {
	if(useCache == null) {
		useCache = true;
	}
	return openfl_utils_Assets.getSound(id,useCache);
};
openfl_utils_Assets.getPath = function(id) {
	return lime_utils_Assets.getPath(id);
};
openfl_utils_Assets.getSound = function(id,useCache) {
	if(useCache == null) {
		useCache = true;
	}
	if(useCache && openfl_utils_Assets.cache.get_enabled() && openfl_utils_Assets.cache.hasSound(id)) {
		var sound = openfl_utils_Assets.cache.getSound(id);
		if(openfl_utils_Assets.isValidSound(sound)) {
			return sound;
		}
	}
	var buffer = lime_utils_Assets.getAudioBuffer(id,false);
	if(buffer != null) {
		var sound = openfl_media_Sound.fromAudioBuffer(buffer);
		if(useCache && openfl_utils_Assets.cache.get_enabled()) {
			openfl_utils_Assets.cache.setSound(id,sound);
		}
		return sound;
	}
	return null;
};
openfl_utils_Assets.getText = function(id) {
	return lime_utils_Assets.getText(id);
};
openfl_utils_Assets.hasEventListener = function(type) {
	return openfl_utils_Assets.dispatcher.hasEventListener(type);
};
openfl_utils_Assets.hasLibrary = function(name) {
	return lime_utils_Assets.hasLibrary(name);
};
openfl_utils_Assets.initBinding = function(className,instance) {
	if(Object.prototype.hasOwnProperty.call(openfl_utils_Assets.libraryBindings.h,className)) {
		var library = openfl_utils_Assets.libraryBindings.h[className];
		if(instance == null) {
			openfl_display_Sprite.__constructor = function(instance) {
				instance.__bind(library,className);
			};
		} else {
			openfl_display_Sprite.__constructor = null;
			instance.__bind(library,className);
		}
	} else {
		lime_utils_Log.warn("No asset is registered as \"" + className + "\"",{ fileName : "openfl/utils/Assets.hx", lineNumber : 434, className : "openfl.utils.Assets", methodName : "initBinding"});
	}
};
openfl_utils_Assets.isLocal = function(id,type,useCache) {
	if(useCache == null) {
		useCache = true;
	}
	if(useCache && openfl_utils_Assets.cache.get_enabled()) {
		if(type == "IMAGE" || type == null) {
			if(openfl_utils_Assets.cache.hasBitmapData(id)) {
				return true;
			}
		}
		if(type == "FONT" || type == null) {
			if(openfl_utils_Assets.cache.hasFont(id)) {
				return true;
			}
		}
		if(type == "SOUND" || type == "MUSIC" || type == null) {
			if(openfl_utils_Assets.cache.hasSound(id)) {
				return true;
			}
		}
	}
	var libraryName = id.substring(0,id.indexOf(":"));
	var symbolName = HxOverrides.substr(id,id.indexOf(":") + 1,null);
	var library = openfl_utils_Assets.getLibrary(libraryName);
	if(library != null) {
		return library.isLocal(symbolName,type);
	}
	return false;
};
openfl_utils_Assets.isValidBitmapData = function(bitmapData) {
	return bitmapData != null && bitmapData.image != null;
};
openfl_utils_Assets.isValidSound = function(sound) {
	return true;
};
openfl_utils_Assets.list = function(type) {
	return lime_utils_Assets.list(type);
};
openfl_utils_Assets.loadBitmapData = function(id,useCache) {
	if(useCache == null) {
		useCache = true;
	}
	if(useCache == null) {
		useCache = true;
	}
	var promise = new lime_app_Promise();
	if(useCache && openfl_utils_Assets.cache.get_enabled() && openfl_utils_Assets.cache.hasBitmapData(id)) {
		var bitmapData = openfl_utils_Assets.cache.getBitmapData(id);
		if(openfl_utils_Assets.isValidBitmapData(bitmapData)) {
			promise.complete(bitmapData);
			return promise.future;
		}
	}
	lime_utils_Assets.loadImage(id,false).onComplete(function(image) {
		if(image != null) {
			var bitmapData = openfl_display_BitmapData.fromImage(image);
			bitmapData.__asset = true;
			if(useCache && openfl_utils_Assets.cache.get_enabled()) {
				openfl_utils_Assets.cache.setBitmapData(id,bitmapData);
			}
			promise.complete(bitmapData);
		} else {
			promise.error("[Assets] Could not load Image \"" + id + "\"");
		}
	}).onError($bind(promise,promise.error)).onProgress($bind(promise,promise.progress));
	return promise.future;
};
openfl_utils_Assets.loadBytes = function(id) {
	var promise = new lime_app_Promise();
	var future = lime_utils_Assets.loadBytes(id);
	future.onComplete(function(bytes) {
		promise.complete(openfl_utils_ByteArray.fromLimeBytes(bytes));
	});
	future.onProgress(function(progress,total) {
		promise.progress(progress,total);
	});
	future.onError(function(msg) {
		promise.error(msg);
	});
	return promise.future;
};
openfl_utils_Assets.loadFont = function(id,useCache) {
	if(useCache == null) {
		useCache = true;
	}
	if(useCache == null) {
		useCache = true;
	}
	var promise = new lime_app_Promise();
	if(useCache && openfl_utils_Assets.cache.get_enabled() && openfl_utils_Assets.cache.hasFont(id)) {
		promise.complete(openfl_utils_Assets.cache.getFont(id));
		return promise.future;
	}
	lime_utils_Assets.loadFont(id).onComplete(function(limeFont) {
		var font = new openfl_text_Font();
		font.__fromLimeFont(limeFont);
		if(useCache && openfl_utils_Assets.cache.get_enabled()) {
			openfl_utils_Assets.cache.setFont(id,font);
		}
		promise.complete(font);
	}).onError($bind(promise,promise.error)).onProgress($bind(promise,promise.progress));
	return promise.future;
};
openfl_utils_Assets.loadLibrary = function(name) {
	return lime_utils_Assets.loadLibrary(name).then(function(library) {
		var _library = null;
		if(library != null) {
			if(((library) instanceof openfl_utils_AssetLibrary)) {
				_library = library;
			} else {
				var _this = lime_utils_Assets.libraries;
				if(Object.prototype.hasOwnProperty.call(_this.h,name)) {
					delete(_this.h[name]);
				}
				_library = new openfl_utils_AssetLibrary();
				_library.__proxy = library;
				lime_utils_Assets.registerLibrary(name,_library);
			}
		}
		return lime_app_Future.withValue(_library);
	});
};
openfl_utils_Assets.loadMusic = function(id,useCache) {
	if(useCache == null) {
		useCache = true;
	}
	if(useCache == null) {
		useCache = true;
	}
	var future = new lime_app_Future(function() {
		return openfl_utils_Assets.getMusic(id,useCache);
	});
	return future;
};
openfl_utils_Assets.loadMovieClip = function(id) {
	var promise = new lime_app_Promise();
	var libraryName = id.substring(0,id.indexOf(":"));
	var symbolName = HxOverrides.substr(id,id.indexOf(":") + 1,null);
	var limeLibrary = openfl_utils_Assets.getLibrary(libraryName);
	if(limeLibrary != null) {
		if(((limeLibrary) instanceof openfl_utils_AssetLibrary)) {
			var library = limeLibrary;
			if(library.exists(symbolName,"MOVIE_CLIP")) {
				promise.completeWith(library.loadMovieClip(symbolName));
				return promise.future;
			}
		}
		promise.error("[Assets] There is no MovieClip asset with an ID of \"" + id + "\"");
	} else {
		promise.error("[Assets] There is no asset library named \"" + libraryName + "\"");
	}
	return promise.future;
};
openfl_utils_Assets.loadSound = function(id,useCache) {
	if(useCache == null) {
		useCache = true;
	}
	if(useCache == null) {
		useCache = true;
	}
	var promise = new lime_app_Promise();
	lime_utils_Assets.loadAudioBuffer(id,useCache).onComplete(function(buffer) {
		if(buffer != null) {
			var sound = openfl_media_Sound.fromAudioBuffer(buffer);
			if(useCache && openfl_utils_Assets.cache.get_enabled()) {
				openfl_utils_Assets.cache.setSound(id,sound);
			}
			promise.complete(sound);
		} else {
			promise.error("[Assets] Could not load Sound \"" + id + "\"");
		}
	}).onError($bind(promise,promise.error)).onProgress($bind(promise,promise.progress));
	return promise.future;
};
openfl_utils_Assets.loadText = function(id) {
	var future = lime_utils_Assets.loadText(id);
	return future;
};
openfl_utils_Assets.registerBinding = function(className,library) {
	openfl_utils_Assets.libraryBindings.h[className] = library;
};
openfl_utils_Assets.registerLibrary = function(name,library) {
	lime_utils_Assets.registerLibrary(name,library);
};
openfl_utils_Assets.removeEventListener = function(type,listener,capture) {
	if(capture == null) {
		capture = false;
	}
	openfl_utils_Assets.dispatcher.removeEventListener(type,listener,capture);
};
openfl_utils_Assets.resolveClass = function(name) {
	return $hxClasses[name];
};
openfl_utils_Assets.resolveEnum = function(name) {
	var value = $hxEnums[name];
	return value;
};
openfl_utils_Assets.unloadLibrary = function(name) {
	lime_utils_Assets.unloadLibrary(name);
};
openfl_utils_Assets.unregisterBinding = function(className,library) {
	if(Object.prototype.hasOwnProperty.call(openfl_utils_Assets.libraryBindings.h,className) && openfl_utils_Assets.libraryBindings.h[className] == library) {
		var _this = openfl_utils_Assets.libraryBindings;
		if(Object.prototype.hasOwnProperty.call(_this.h,className)) {
			delete(_this.h[className]);
		}
	}
};
openfl_utils_Assets.LimeAssets_onChange = function() {
	openfl_utils_Assets.dispatchEvent(new openfl_events_Event("change"));
};
var openfl_utils_ByteArray = {};
openfl_utils_ByteArray.__properties__ = {set_position:"set_position",get_position:"get_position",set_length:"set_length",get_length:"get_length",get_bytesAvailable:"get_bytesAvailable",set_defaultObjectEncoding:"set_defaultObjectEncoding",get_defaultObjectEncoding:"get_defaultObjectEncoding",set_defaultEndian:"set_defaultEndian",get_defaultEndian:"get_defaultEndian"};
openfl_utils_ByteArray._new = function(length) {
	if(length == null) {
		length = 0;
	}
	return new openfl_utils_ByteArrayData(length);
};
openfl_utils_ByteArray.clear = function(this1) {
	this1.clear();
};
openfl_utils_ByteArray.compress = function(this1,algorithm) {
	this1.compress(algorithm);
};
openfl_utils_ByteArray.deflate = function(this1) {
	this1.deflate();
};
openfl_utils_ByteArray.fromArrayBuffer = function(buffer) {
	if(buffer == null) {
		return null;
	}
	return openfl_utils_ByteArrayData.fromBytes(haxe_io_Bytes.ofData(buffer));
};
openfl_utils_ByteArray.fromBytes = function(bytes) {
	if(bytes == null) {
		return null;
	}
	if(((bytes) instanceof openfl_utils_ByteArrayData)) {
		return bytes;
	} else {
		return openfl_utils_ByteArrayData.fromBytes(bytes);
	}
};
openfl_utils_ByteArray.fromBytesData = function(bytesData) {
	if(bytesData == null) {
		return null;
	}
	return openfl_utils_ByteArrayData.fromBytes(haxe_io_Bytes.ofData(bytesData));
};
openfl_utils_ByteArray.fromFile = function(path) {
	return openfl_utils_ByteArray.fromLimeBytes(lime_utils_Bytes.fromFile(path));
};
openfl_utils_ByteArray.fromLimeBytes = function(bytes) {
	return openfl_utils_ByteArray.fromBytes(bytes);
};
openfl_utils_ByteArray.get = function(this1,index) {
	return this1.b[index];
};
openfl_utils_ByteArray.inflate = function(this1) {
	this1.inflate();
};
openfl_utils_ByteArray.loadFromBytes = function(bytes) {
	return lime_utils_Bytes.loadFromBytes(bytes).then(function(limeBytes) {
		var byteArray = openfl_utils_ByteArray.fromLimeBytes(limeBytes);
		return lime_app_Future.withValue(byteArray);
	});
};
openfl_utils_ByteArray.loadFromFile = function(path) {
	return lime_utils_Bytes.loadFromFile(path).then(function(limeBytes) {
		var byteArray = openfl_utils_ByteArray.fromLimeBytes(limeBytes);
		return lime_app_Future.withValue(byteArray);
	});
};
openfl_utils_ByteArray.readBoolean = function(this1) {
	return this1.readBoolean();
};
openfl_utils_ByteArray.readByte = function(this1) {
	return this1.readByte();
};
openfl_utils_ByteArray.readBytes = function(this1,bytes,offset,length) {
	if(length == null) {
		length = 0;
	}
	if(offset == null) {
		offset = 0;
	}
	this1.readBytes(bytes,offset,length);
};
openfl_utils_ByteArray.readDouble = function(this1) {
	return this1.readDouble();
};
openfl_utils_ByteArray.readFloat = function(this1) {
	return this1.readFloat();
};
openfl_utils_ByteArray.readInt = function(this1) {
	return this1.readInt();
};
openfl_utils_ByteArray.readInt64 = function(this1) {
	return this1.readInt64();
};
openfl_utils_ByteArray.readMultiByte = function(this1,length,charSet) {
	return this1.readMultiByte(length,charSet);
};
openfl_utils_ByteArray.readObject = function(this1) {
	return this1.readObject();
};
openfl_utils_ByteArray.readShort = function(this1) {
	return this1.readShort();
};
openfl_utils_ByteArray.readUTF = function(this1) {
	return this1.readUTF();
};
openfl_utils_ByteArray.readUTFBytes = function(this1,length) {
	return this1.readUTFBytes(length);
};
openfl_utils_ByteArray.readUnsignedByte = function(this1) {
	return this1.readUnsignedByte();
};
openfl_utils_ByteArray.readUnsignedInt = function(this1) {
	return this1.readUnsignedInt();
};
openfl_utils_ByteArray.readUnsignedShort = function(this1) {
	return this1.readUnsignedShort();
};
openfl_utils_ByteArray.set = function(this1,index,value) {
	this1.__resize(index + 1);
	this1.b[index] = value;
	return value;
};
openfl_utils_ByteArray.toArrayBuffer = function(byteArray) {
	return byteArray.b.bufferValue;
};
openfl_utils_ByteArray.toBytePointer = function(byteArray) {
	lime_utils_BytePointer.set(openfl_utils_ByteArray.__bytePointer,byteArray,null,null,byteArray.position);
	return openfl_utils_ByteArray.__bytePointer;
};
openfl_utils_ByteArray.toBytes = function(byteArray) {
	return byteArray;
};
openfl_utils_ByteArray.toBytesData = function(byteArray) {
	return byteArray.b.bufferValue;
};
openfl_utils_ByteArray.toLimeBytes = function(byteArray) {
	return byteArray;
};
openfl_utils_ByteArray.toString = function(this1) {
	return this1.toString();
};
openfl_utils_ByteArray.uncompress = function(this1,algorithm) {
	this1.uncompress(algorithm);
};
openfl_utils_ByteArray.writeBoolean = function(this1,value) {
	this1.writeBoolean(value);
};
openfl_utils_ByteArray.writeByte = function(this1,value) {
	this1.writeByte(value);
};
openfl_utils_ByteArray.writeBytes = function(this1,bytes,offset,length) {
	if(length == null) {
		length = 0;
	}
	if(offset == null) {
		offset = 0;
	}
	this1.writeBytes(bytes,offset,length);
};
openfl_utils_ByteArray.writeDouble = function(this1,value) {
	this1.writeDouble(value);
};
openfl_utils_ByteArray.writeFloat = function(this1,value) {
	this1.writeFloat(value);
};
openfl_utils_ByteArray.writeInt = function(this1,value) {
	this1.writeInt(value);
};
openfl_utils_ByteArray.writeInt64 = function(this1,value) {
	this1.writeInt64(value);
};
openfl_utils_ByteArray.writeMultiByte = function(this1,value,charSet) {
	this1.writeMultiByte(value,charSet);
};
openfl_utils_ByteArray.writeObject = function(this1,object) {
	this1.writeObject(object);
};
openfl_utils_ByteArray.writeShort = function(this1,value) {
	this1.writeShort(value);
};
openfl_utils_ByteArray.writeUTF = function(this1,value) {
	this1.writeUTF(value);
};
openfl_utils_ByteArray.writeUTFBytes = function(this1,value) {
	this1.writeUTFBytes(value);
};
openfl_utils_ByteArray.writeUnsignedInt = function(this1,value) {
	this1.writeUnsignedInt(value);
};
openfl_utils_ByteArray.get_bytesAvailable = function(this1) {
	return this1.length - this1.position;
};
openfl_utils_ByteArray.get_defaultEndian = function() {
	if(openfl_utils_ByteArrayData.__defaultEndian == null) {
		if(lime_system_System.get_endianness() == lime_system_Endian.LITTLE_ENDIAN) {
			openfl_utils_ByteArrayData.__defaultEndian = 1;
		} else {
			openfl_utils_ByteArrayData.__defaultEndian = 0;
		}
	}
	return openfl_utils_ByteArrayData.__defaultEndian;
};
openfl_utils_ByteArray.set_defaultEndian = function(value) {
	return openfl_utils_ByteArrayData.__defaultEndian = value;
};
openfl_utils_ByteArray.get_defaultObjectEncoding = function() {
	return openfl_utils_ByteArrayData.defaultObjectEncoding;
};
openfl_utils_ByteArray.set_defaultObjectEncoding = function(value) {
	return openfl_utils_ByteArrayData.defaultObjectEncoding = value;
};
openfl_utils_ByteArray.get_endian = function(this1) {
	return this1.__endian;
};
openfl_utils_ByteArray.set_endian = function(this1,value) {
	return this1.__endian = value;
};
openfl_utils_ByteArray.get_length = function(this1) {
	if(this1 == null) {
		return 0;
	} else {
		return this1.length;
	}
};
openfl_utils_ByteArray.set_length = function(this1,value) {
	if(value >= 0) {
		this1.__resize(value);
		if(value < this1.position) {
			this1.position = value;
		}
	}
	this1.length = value;
	return value;
};
openfl_utils_ByteArray.get_objectEncoding = function(this1) {
	return this1.objectEncoding;
};
openfl_utils_ByteArray.set_objectEncoding = function(this1,value) {
	return this1.objectEncoding = value;
};
openfl_utils_ByteArray.get_position = function(this1) {
	return this1.position;
};
openfl_utils_ByteArray.set_position = function(this1,value) {
	return this1.position = value;
};
var openfl_utils_IDataOutput = function() { };
$hxClasses["openfl.utils.IDataOutput"] = openfl_utils_IDataOutput;
openfl_utils_IDataOutput.__name__ = "openfl.utils.IDataOutput";
openfl_utils_IDataOutput.__isInterface__ = true;
openfl_utils_IDataOutput.prototype = {
	get_endian: null
	,set_endian: null
	,objectEncoding: null
	,writeBoolean: null
	,writeByte: null
	,writeBytes: null
	,writeDouble: null
	,writeFloat: null
	,writeInt: null
	,writeMultiByte: null
	,writeObject: null
	,writeShort: null
	,writeUnsignedInt: null
	,writeUTF: null
	,writeUTFBytes: null
	,__class__: openfl_utils_IDataOutput
	,__properties__: {set_endian:"set_endian",get_endian:"get_endian"}
};
var openfl_utils_IDataInput = function() { };
$hxClasses["openfl.utils.IDataInput"] = openfl_utils_IDataInput;
openfl_utils_IDataInput.__name__ = "openfl.utils.IDataInput";
openfl_utils_IDataInput.__isInterface__ = true;
openfl_utils_IDataInput.prototype = {
	get_bytesAvailable: null
	,get_endian: null
	,set_endian: null
	,objectEncoding: null
	,readBoolean: null
	,readByte: null
	,readBytes: null
	,readDouble: null
	,readFloat: null
	,readInt: null
	,readMultiByte: null
	,readObject: null
	,readShort: null
	,readUnsignedByte: null
	,readUnsignedInt: null
	,readUnsignedShort: null
	,readUTF: null
	,readUTFBytes: null
	,__class__: openfl_utils_IDataInput
	,__properties__: {set_endian:"set_endian",get_endian:"get_endian",get_bytesAvailable:"get_bytesAvailable"}
};
var openfl_utils_ByteArrayData = function(length) {
	if(length == null) {
		length = 0;
	}
	var bytes = new haxe_io_Bytes(new ArrayBuffer(length));
	haxe_io_Bytes.call(this,bytes.b.buffer);
	this.__allocated = length;
	if(openfl_utils_ByteArrayData.__defaultEndian == null) {
		if(lime_system_System.get_endianness() == lime_system_Endian.LITTLE_ENDIAN) {
			openfl_utils_ByteArrayData.__defaultEndian = 1;
		} else {
			openfl_utils_ByteArrayData.__defaultEndian = 0;
		}
	}
	this.__endian = openfl_utils_ByteArrayData.__defaultEndian;
	this.objectEncoding = openfl_utils_ByteArrayData.defaultObjectEncoding;
	this.position = 0;
};
$hxClasses["openfl.utils.ByteArrayData"] = openfl_utils_ByteArrayData;
openfl_utils_ByteArrayData.__name__ = "openfl.utils.ByteArrayData";
openfl_utils_ByteArrayData.__interfaces__ = [openfl_utils_IDataOutput,openfl_utils_IDataInput];
openfl_utils_ByteArrayData.__properties__ = {set_defaultEndian:"set_defaultEndian",get_defaultEndian:"get_defaultEndian"};
openfl_utils_ByteArrayData.fromBytes = function(bytes) {
	var result = new openfl_utils_ByteArrayData();
	result.__fromBytes(bytes);
	return result;
};
openfl_utils_ByteArrayData.get_defaultEndian = function() {
	if(openfl_utils_ByteArrayData.__defaultEndian == null) {
		if(lime_system_System.get_endianness() == lime_system_Endian.LITTLE_ENDIAN) {
			openfl_utils_ByteArrayData.__defaultEndian = 1;
		} else {
			openfl_utils_ByteArrayData.__defaultEndian = 0;
		}
	}
	return openfl_utils_ByteArrayData.__defaultEndian;
};
openfl_utils_ByteArrayData.set_defaultEndian = function(value) {
	return openfl_utils_ByteArrayData.__defaultEndian = value;
};
openfl_utils_ByteArrayData.__super__ = haxe_io_Bytes;
openfl_utils_ByteArrayData.prototype = $extend(haxe_io_Bytes.prototype,{
	objectEncoding: null
	,position: null
	,__endian: null
	,__allocated: null
	,__amf3Reader: null
	,clear: function() {
		this.length = 0;
		this.position = 0;
	}
	,compress: function(algorithm) {
		if(algorithm == null) {
			algorithm = 2;
		}
		if(this.__allocated > this.length) {
			var cacheLength = this.length;
			this.length = this.__allocated;
			var data = new haxe_io_Bytes(new ArrayBuffer(cacheLength));
			data.blit(0,this,0,cacheLength);
			this.b = data.b;
			this.__allocated = data.length;
			this.data = data.data;
			this.length = cacheLength;
		}
		var limeBytes = this;
		var bytes;
		switch(algorithm) {
		case 0:
			bytes = lime_utils_Bytes.compress(limeBytes,lime_utils_CompressionAlgorithm.DEFLATE);
			break;
		case 1:
			bytes = lime_utils_Bytes.compress(limeBytes,lime_utils_CompressionAlgorithm.LZMA);
			break;
		default:
			bytes = lime_utils_Bytes.compress(limeBytes,lime_utils_CompressionAlgorithm.ZLIB);
		}
		if(bytes != null) {
			this.b = bytes.b;
			this.__allocated = bytes.length;
			this.data = bytes.data;
			this.length = this.__allocated;
			this.position = this.length;
		}
	}
	,deflate: function() {
		this.compress(0);
	}
	,inflate: function() {
		this.uncompress(0);
	}
	,readBoolean: function() {
		if(this.position < this.length) {
			return this.b[this.position++] != 0;
		} else {
			throw new openfl_errors_EOFError();
		}
	}
	,readByte: function() {
		var value = this.readUnsignedByte();
		if((value & 128) != 0) {
			return value - 256;
		} else {
			return value;
		}
	}
	,readBytes: function(bytes,offset,length) {
		if(length == null) {
			length = 0;
		}
		if(offset == null) {
			offset = 0;
		}
		if(length == 0) {
			length = this.length - this.position;
		}
		if(this.position + length > this.length) {
			throw new openfl_errors_EOFError();
		}
		if(bytes.length < offset + length) {
			bytes.__resize(offset + length);
		}
		bytes.blit(offset,this,this.position,length);
		this.position += length;
	}
	,readDouble: function() {
		if(this.__endian == 1) {
			if(this.position + 8 > this.length) {
				throw new openfl_errors_EOFError();
			}
			this.position += 8;
			return this.getDouble(this.position - 8);
		} else {
			var ch1 = this.readInt();
			var ch2 = this.readInt();
			return haxe_io_FPHelper.i64ToDouble(ch2,ch1);
		}
	}
	,readFloat: function() {
		if(this.__endian == 1) {
			if(this.position + 4 > this.length) {
				throw new openfl_errors_EOFError();
			}
			this.position += 4;
			return this.getFloat(this.position - 4);
		} else {
			return haxe_io_FPHelper.i32ToFloat(this.readInt());
		}
	}
	,readInt: function() {
		var ch1 = this.readUnsignedByte();
		var ch2 = this.readUnsignedByte();
		var ch3 = this.readUnsignedByte();
		var ch4 = this.readUnsignedByte();
		if(this.__endian == 1) {
			return ch4 << 24 | ch3 << 16 | ch2 << 8 | ch1;
		} else {
			return ch1 << 24 | ch2 << 16 | ch3 << 8 | ch4;
		}
	}
	,readInt64: function() {
		if(this.position + 8 > this.length) {
			throw new openfl_errors_EOFError();
		}
		var high;
		var low;
		if(this.__endian == 1) {
			low = this.readUnsignedInt();
			high = this.readUnsignedInt();
		} else {
			high = this.readUnsignedInt();
			low = this.readUnsignedInt();
		}
		return new haxe__$Int64__$_$_$Int64(high,low);
	}
	,readMultiByte: function(length,charSet) {
		return this.readUTFBytes(length);
	}
	,readObject: function() {
		switch(this.objectEncoding) {
		case 0:
			var input = new haxe_io_BytesInput(this,this.position);
			var reader = new openfl_utils__$internal_format_amf_AMFReader(input);
			var data = openfl_utils__$internal_format_amf_AMFTools.unwrapValue(reader.read());
			this.position = input.pos;
			return data;
		case 3:
			var input = new haxe_io_BytesInput(this,this.position);
			var reader = new openfl_utils__$internal_format_amf3_AMF3Reader(input,this.__amf3Reader);
			var data = openfl_utils__$internal_format_amf3_AMF3Tools.decode(reader.read());
			this.position = input.pos;
			return data;
		case 10:
			var data = this.readUTF();
			return haxe_Unserializer.run(data);
		case 11:
			var data = this.readLargeUTF();
			return haxe_Unserializer.run(data);
		case 12:
			var data = this.readUTF();
			return new haxe_format_JsonParser(data).doParse();
		case 13:
			var data = this.readLargeUTF();
			return new haxe_format_JsonParser(data).doParse();
		default:
			return null;
		}
	}
	,readShort: function() {
		var ch1 = this.readUnsignedByte();
		var ch2 = this.readUnsignedByte();
		var value;
		if(this.__endian == 1) {
			value = ch2 << 8 | ch1;
		} else {
			value = ch1 << 8 | ch2;
		}
		if((value & 32768) != 0) {
			return value - 65536;
		} else {
			return value;
		}
	}
	,readUnsignedByte: function() {
		if(this.position < this.length) {
			return this.b[this.position++];
		} else {
			throw new openfl_errors_EOFError();
		}
	}
	,readUnsignedInt: function() {
		var ch1 = this.readUnsignedByte();
		var ch2 = this.readUnsignedByte();
		var ch3 = this.readUnsignedByte();
		var ch4 = this.readUnsignedByte();
		if(this.__endian == 1) {
			return ch4 << 24 | ch3 << 16 | ch2 << 8 | ch1;
		} else {
			return ch1 << 24 | ch2 << 16 | ch3 << 8 | ch4;
		}
	}
	,readUnsignedShort: function() {
		var ch1 = this.readUnsignedByte();
		var ch2 = this.readUnsignedByte();
		if(this.__endian == 1) {
			return (ch2 << 8) + ch1;
		} else {
			return ch1 << 8 | ch2;
		}
	}
	,readUTF: function() {
		var bytesCount = this.readUnsignedShort();
		return this.readUTFBytes(bytesCount);
	}
	,readLargeUTF: function() {
		var bytesCount = this.readUnsignedInt();
		return this.readUTFBytes(bytesCount);
	}
	,readUTFBytes: function(length) {
		if(this.position + length > this.length) {
			throw new openfl_errors_EOFError();
		}
		this.position += length;
		return this.getString(this.position - length,length);
	}
	,uncompress: function(algorithm) {
		if(algorithm == null) {
			algorithm = 2;
		}
		if(this.__allocated > this.length) {
			var cacheLength = this.length;
			this.length = this.__allocated;
			var data = new haxe_io_Bytes(new ArrayBuffer(cacheLength));
			data.blit(0,this,0,cacheLength);
			this.b = data.b;
			this.__allocated = data.length;
			this.data = data.data;
			this.length = cacheLength;
		}
		var limeBytes = this;
		var bytes;
		switch(algorithm) {
		case 0:
			bytes = lime_utils_Bytes.decompress(limeBytes,lime_utils_CompressionAlgorithm.DEFLATE);
			break;
		case 1:
			bytes = lime_utils_Bytes.decompress(limeBytes,lime_utils_CompressionAlgorithm.LZMA);
			break;
		default:
			bytes = lime_utils_Bytes.decompress(limeBytes,lime_utils_CompressionAlgorithm.ZLIB);
		}
		if(bytes != null) {
			this.b = bytes.b;
			this.__allocated = bytes.length;
			this.data = bytes.data;
			this.length = this.__allocated;
		}
		this.position = 0;
	}
	,writeBoolean: function(value) {
		this.writeByte(value ? 1 : 0);
	}
	,writeByte: function(value) {
		this.__resize(this.position + 1);
		this.b[this.position++] = value & 255;
	}
	,writeBytes: function(bytes,offset,length) {
		if(length == null) {
			length = 0;
		}
		if(offset == null) {
			offset = 0;
		}
		if(openfl_utils_ByteArray.get_length(bytes) == 0) {
			return;
		}
		if(length == 0) {
			length = openfl_utils_ByteArray.get_length(bytes) - offset;
		}
		this.__resize(this.position + length);
		this.blit(this.position,bytes,offset,length);
		this.position = this.position + length;
	}
	,writeDouble: function(value) {
		var int64 = haxe_io_FPHelper.doubleToI64(value);
		if(this.__endian == 1) {
			this.writeInt(int64.low);
			this.writeInt(int64.high);
		} else {
			this.writeInt(int64.high);
			this.writeInt(int64.low);
		}
	}
	,writeFloat: function(value) {
		if(this.__endian == 1) {
			this.__resize(this.position + 4);
			this.setFloat(this.position,value);
			this.position += 4;
		} else {
			var int = haxe_io_FPHelper.floatToI32(value);
			this.writeInt(int);
		}
	}
	,writeInt: function(value) {
		this.__resize(this.position + 4);
		if(this.__endian == 1) {
			this.b[this.position++] = value & 255;
			this.b[this.position++] = value >> 8 & 255;
			this.b[this.position++] = value >> 16 & 255;
			this.b[this.position++] = value >> 24 & 255;
		} else {
			this.b[this.position++] = value >> 24 & 255;
			this.b[this.position++] = value >> 16 & 255;
			this.b[this.position++] = value >> 8 & 255;
			this.b[this.position++] = value & 255;
		}
	}
	,writeInt64: function(value) {
		if(this.__endian == 1) {
			this.writeUnsignedInt(value.low);
			this.writeUnsignedInt(value.high);
		} else {
			this.writeUnsignedInt(value.high);
			this.writeUnsignedInt(value.low);
		}
	}
	,writeMultiByte: function(value,charSet) {
		this.writeUTFBytes(value);
	}
	,writeObject: function(object) {
		switch(this.objectEncoding) {
		case 0:
			var value = openfl_utils__$internal_format_amf_AMFTools.encode(object);
			var output = new haxe_io_BytesOutput();
			var writer = new openfl_utils__$internal_format_amf_AMFWriter(output);
			writer.write(value);
			this.writeBytes(openfl_utils_ByteArray.fromBytes(output.getBytes()));
			break;
		case 3:
			var output = new haxe_io_BytesOutput();
			var writer = new openfl_utils__$internal_format_amf3_AMF3Writer(output);
			if(((object) instanceof openfl_utils_ByteArrayData)) {
				writer.write(openfl_utils__$internal_format_amf3_AMF3Value.AByteArray(object));
			} else {
				var value = openfl_utils__$internal_format_amf3_AMF3Tools.encode(object);
				writer.write(value);
			}
			this.writeBytes(openfl_utils_ByteArray.fromBytes(output.getBytes()));
			break;
		case 10:
			var value = haxe_Serializer.run(object);
			this.writeUTF(value);
			break;
		case 11:
			var value = haxe_Serializer.run(object);
			this.writeLargeUTF(value);
			break;
		case 12:
			var value = haxe_format_JsonPrinter.print(object,null,null);
			this.writeUTF(value);
			break;
		case 13:
			var value = haxe_format_JsonPrinter.print(object,null,null);
			this.writeLargeUTF(value);
			break;
		default:
			return;
		}
	}
	,writeShort: function(value) {
		this.__resize(this.position + 2);
		if(this.__endian == 1) {
			this.b[this.position++] = value;
			this.b[this.position++] = value >> 8;
		} else {
			this.b[this.position++] = value >> 8;
			this.b[this.position++] = value;
		}
	}
	,writeUnsignedInt: function(value) {
		this.writeInt(value);
	}
	,writeUTF: function(value) {
		var bytes = haxe_io_Bytes.ofString(value);
		if(bytes.length > 65535) {
			throw new openfl_errors_RangeError("Length is out of range");
		}
		this.writeShort(bytes.length);
		this.writeBytes(openfl_utils_ByteArray.fromBytes(bytes));
	}
	,writeLargeUTF: function(value) {
		var bytes = haxe_io_Bytes.ofString(value);
		this.writeUnsignedInt(bytes.length);
		this.writeBytes(openfl_utils_ByteArray.fromBytes(bytes));
	}
	,writeUTFBytes: function(value) {
		var bytes = haxe_io_Bytes.ofString(value);
		this.writeBytes(openfl_utils_ByteArray.fromBytes(bytes));
	}
	,__fromBytes: function(bytes) {
		this.b = bytes.b;
		this.__allocated = bytes.length;
		this.data = bytes.data;
		this.length = bytes.length;
	}
	,__resize: function(size) {
		if(size > this.__allocated) {
			var bytes = new haxe_io_Bytes(new ArrayBuffer((size + 1) * 3 >> 1));
			if(this.__allocated > 0) {
				var cacheLength = this.length;
				this.length = this.__allocated;
				bytes.blit(0,this,0,this.__allocated);
				this.length = cacheLength;
			}
			this.b = bytes.b;
			this.__allocated = bytes.length;
			this.data = bytes.data;
		}
		if(this.length < size) {
			this.length = size;
		}
	}
	,__setData: function(bytes) {
		this.b = bytes.b;
		this.__allocated = bytes.length;
		this.data = bytes.data;
	}
	,get_bytesAvailable: function() {
		return this.length - this.position;
	}
	,get_endian: function() {
		return this.__endian;
	}
	,set_endian: function(value) {
		return this.__endian = value;
	}
	,get___length: function() {
		return this.length;
	}
	,set___length: function(value) {
		return this.length = value;
	}
	,__class__: openfl_utils_ByteArrayData
	,__properties__: {set___length:"set___length",get___length:"get___length",set_endian:"set_endian",get_endian:"get_endian",get_bytesAvailable:"get_bytesAvailable"}
});
var openfl_utils_CompressionAlgorithm = {};
openfl_utils_CompressionAlgorithm.fromString = function(value) {
	switch(value) {
	case "deflate":
		return 0;
	case "lzma":
		return 1;
	case "zlib":
		return 2;
	default:
		return null;
	}
};
openfl_utils_CompressionAlgorithm.toString = function(this1) {
	switch(this1) {
	case 0:
		return "deflate";
	case 1:
		return "lzma";
	case 2:
		return "zlib";
	default:
		return null;
	}
};
var openfl_utils__$Dictionary_ClassMap = function() {
	this.types = new haxe_ds_StringMap();
	this.values = new haxe_ds_StringMap();
};
$hxClasses["openfl.utils._Dictionary.ClassMap"] = openfl_utils__$Dictionary_ClassMap;
openfl_utils__$Dictionary_ClassMap.__name__ = "openfl.utils._Dictionary.ClassMap";
openfl_utils__$Dictionary_ClassMap.__interfaces__ = [haxe_IMap];
openfl_utils__$Dictionary_ClassMap.prototype = {
	types: null
	,values: null
	,clear: function() {
		this.types.h = Object.create(null);
		this.values.h = Object.create(null);
	}
	,copy: function() {
		var copied = new openfl_utils__$Dictionary_ClassMap();
		var key = this.keys();
		while(key.hasNext()) {
			var key1 = key.next();
			copied.set(key1,this.get(key1));
		}
		return copied;
	}
	,exists: function(key) {
		var this1 = this.types;
		var key1 = key.__name__;
		return Object.prototype.hasOwnProperty.call(this1.h,key1);
	}
	,get: function(key) {
		var this1 = this.values;
		var key1 = key.__name__;
		return this1.h[key1];
	}
	,keyValueIterator: function() {
		return new haxe_iterators_MapKeyValueIterator(this);
	}
	,keys: function() {
		return new haxe_ds__$StringMap_StringMapValueIterator(this.types.h);
	}
	,iterator: function() {
		return new haxe_ds__$StringMap_StringMapValueIterator(this.values.h);
	}
	,remove: function(key) {
		var name = key.__name__;
		var _this = this.types;
		var tmp;
		if(Object.prototype.hasOwnProperty.call(_this.h,name)) {
			delete(_this.h[name]);
			tmp = true;
		} else {
			tmp = false;
		}
		if(!tmp) {
			var _this = this.values;
			if(Object.prototype.hasOwnProperty.call(_this.h,name)) {
				delete(_this.h[name]);
				return true;
			} else {
				return false;
			}
		} else {
			return true;
		}
	}
	,set: function(key,value) {
		var name = key.__name__;
		this.types.h[name] = key;
		this.values.h[name] = value;
	}
	,toString: function() {
		return haxe_ds_StringMap.stringify(this.values.h);
	}
	,__class__: openfl_utils__$Dictionary_ClassMap
};
var openfl_utils__$Dictionary_FloatMap = function() {
	this.floatKeys = [];
	this.values = [];
};
$hxClasses["openfl.utils._Dictionary.FloatMap"] = openfl_utils__$Dictionary_FloatMap;
openfl_utils__$Dictionary_FloatMap.__name__ = "openfl.utils._Dictionary.FloatMap";
openfl_utils__$Dictionary_FloatMap.__interfaces__ = [haxe_IMap];
openfl_utils__$Dictionary_FloatMap.prototype = {
	floatKeys: null
	,values: null
	,clear: function() {
		this.floatKeys = [];
		this.values = [];
	}
	,copy: function() {
		var copied = new openfl_utils__$Dictionary_FloatMap();
		var key = this.keys();
		while(key.hasNext()) {
			var key1 = key.next();
			copied.set(key1,this.get(key1));
		}
		return copied;
	}
	,exists: function(key) {
		return this.indexOf(key) > -1;
	}
	,get: function(key) {
		var ind = this.indexOf(key);
		if(ind > -1) {
			return this.values[ind];
		} else {
			return null;
		}
	}
	,keyValueIterator: function() {
		return new haxe_iterators_MapKeyValueIterator(this);
	}
	,keys: function() {
		return new haxe_iterators_ArrayIterator(this.floatKeys.slice());
	}
	,iterator: function() {
		return new haxe_iterators_ArrayIterator(this.values.slice());
	}
	,remove: function(key) {
		var ind = this.indexOf(key);
		if(ind > -1) {
			this.floatKeys.splice(ind,1);
			this.values.splice(ind,1);
			return true;
		}
		return false;
	}
	,set: function(key,value) {
		this.insertSorted(key,value);
	}
	,indexOf: function(key) {
		var len = this.floatKeys.length;
		var startIndex = 0;
		var endIndex = len - 1;
		if(len == 0) {
			return -1;
		}
		var midIndex = 0;
		while(startIndex < endIndex) {
			midIndex = Math.floor((startIndex + endIndex) / 2);
			if(this.floatKeys[midIndex] == key) {
				return midIndex;
			} else if(this.floatKeys[midIndex] > key) {
				endIndex = midIndex - 1;
			} else {
				startIndex = midIndex + 1;
			}
		}
		if(this.floatKeys[startIndex] == key) {
			return startIndex;
		} else {
			return -1;
		}
	}
	,insertSorted: function(key,value) {
		var len = this.floatKeys.length;
		var startIndex = 0;
		var endIndex = len - 1;
		if(len == 0) {
			this.floatKeys.push(key);
			this.values.push(value);
			return;
		}
		var midIndex = 0;
		while(startIndex < endIndex) {
			midIndex = Math.floor((startIndex + endIndex) / 2);
			if(this.floatKeys[midIndex] == key) {
				this.values[midIndex] = value;
				return;
			} else if(this.floatKeys[midIndex] > key) {
				endIndex = midIndex - 1;
			} else {
				startIndex = midIndex + 1;
			}
		}
		if(this.floatKeys[startIndex] > key) {
			this.floatKeys.splice(startIndex,0,key);
			this.values.splice(startIndex,0,value);
		} else if(this.floatKeys[startIndex] < key) {
			this.floatKeys.splice(startIndex + 1,0,key);
			this.values.splice(startIndex + 1,0,value);
		} else {
			this.values[startIndex] = value;
		}
	}
	,toString: function() {
		return this.values.toString();
	}
	,__class__: openfl_utils__$Dictionary_FloatMap
};
var openfl_utils__$Dictionary_UtilsObjectMap = function() {
	this.map = new haxe_ds_ObjectMap();
};
$hxClasses["openfl.utils._Dictionary.UtilsObjectMap"] = openfl_utils__$Dictionary_UtilsObjectMap;
openfl_utils__$Dictionary_UtilsObjectMap.__name__ = "openfl.utils._Dictionary.UtilsObjectMap";
openfl_utils__$Dictionary_UtilsObjectMap.__interfaces__ = [haxe_IMap];
openfl_utils__$Dictionary_UtilsObjectMap.prototype = {
	map: null
	,clear: function() {
		this.map.h = { __keys__ : { }};
	}
	,copy: function() {
		var copied = new openfl_utils__$Dictionary_UtilsObjectMap();
		var key = this.keys();
		while(key.hasNext()) {
			var key1 = key.next();
			copied.set(key1,this.get(key1));
		}
		return copied;
	}
	,exists: function(key) {
		return this.map.h.__keys__[key.__id__] != null;
	}
	,get: function(key) {
		return this.map.h[key.__id__];
	}
	,keyValueIterator: function() {
		return new haxe_iterators_MapKeyValueIterator(this);
	}
	,keys: function() {
		return this.map.keys();
	}
	,iterator: function() {
		return this.map.iterator();
	}
	,remove: function(key) {
		return this.map.remove(key);
	}
	,set: function(key,value) {
		this.map.set(key,value);
	}
	,toString: function() {
		return this.map.toString();
	}
	,__class__: openfl_utils__$Dictionary_UtilsObjectMap
};
var openfl_utils_Endian = {};
openfl_utils_Endian.fromLimeEndian = function(value) {
	switch(value._hx_index) {
	case 0:
		return 1;
	case 1:
		return 0;
	}
};
openfl_utils_Endian.fromString = function(value) {
	switch(value) {
	case "bigEndian":
		return 0;
	case "littleEndian":
		return 1;
	default:
		return null;
	}
};
openfl_utils_Endian.toLimeEndian = function(this1) {
	switch(this1) {
	case 0:
		return lime_system_Endian.BIG_ENDIAN;
	case 1:
		return lime_system_Endian.LITTLE_ENDIAN;
	default:
		return null;
	}
};
openfl_utils_Endian.toString = function(this1) {
	switch(this1) {
	case 0:
		return "bigEndian";
	case 1:
		return "littleEndian";
	default:
		return null;
	}
};
var openfl_utils_Object = {};
openfl_utils_Object._new = function() {
	return { };
};
openfl_utils_Object.hasOwnProperty = function(this1,name) {
	if(this1 != null) {
		return Object.prototype.hasOwnProperty.call(this1,name);
	} else {
		return false;
	}
};
openfl_utils_Object.isPrototypeOf = function(this1,theClass) {
	if(this1 != null) {
		var c = js_Boot.getClass(this1);
		while(c != null) {
			if(c == theClass) {
				return true;
			}
			c = c.__super__;
		}
	}
	return false;
};
openfl_utils_Object.iterator = function(this1) {
	if(((this1) instanceof Array)) {
		var arr = this1;
		return new haxe_iterators_ArrayIterator(arr);
	} else {
		var fields = Reflect.fields(this1);
		if(fields == null) {
			fields = [];
		}
		if(((this1) instanceof openfl_display_DisplayObjectContainer)) {
			var container = this1;
			var _g = 0;
			var _g1 = container.get_numChildren();
			while(_g < _g1) {
				var i = _g++;
				var child = container.getChildAt(i);
				var name = child.get_name();
				if(name != null && fields.indexOf(name) == -1) {
					fields.push(name);
				}
			}
		}
		return new haxe_iterators_ArrayIterator(fields);
	}
};
openfl_utils_Object.propertyIsEnumerable = function(this1,name) {
	if(this1 != null && Object.prototype.hasOwnProperty.call(this1,name)) {
		return js_Boot.__implements(Reflect.field(this1,name),haxe_lang_Iterable);
	} else {
		return false;
	}
};
openfl_utils_Object.toLocaleString = function(this1) {
	if(this1 == null) {
		return null;
	} else {
		return Std.string(this1);
	}
};
openfl_utils_Object.toString = function(this1) {
	if(this1 == null) {
		return null;
	} else {
		return Std.string(this1);
	}
};
openfl_utils_Object.valueOf = function(this1) {
	return this1;
};
openfl_utils_Object.__fieldRead = function(this1,name) {
	return openfl_utils_Object.__get(this1,name);
};
openfl_utils_Object.__fieldWrite = function(this1,name,value) {
	var this2 = this1;
	if(this2 != null) {
		Reflect.setProperty(this2,name,value);
	}
	return value;
};
openfl_utils_Object.__get = function(this1,key) {
	if(this1 == null || key == null) {
		return null;
	}
	if(Object.prototype.hasOwnProperty.call(this1,key)) {
		return Reflect.field(this1,key);
	} else if(((this1) instanceof openfl_display_DisplayObjectContainer)) {
		var container = this1;
		var child = container.getChildByName(key);
		if(child != null) {
			return child;
		}
	}
	var result = Reflect.getProperty(this1,key);
	if(Reflect.isFunction(result)) {
		result = Function.prototype.bind.call(result,this1);
	}
	return result;
};
openfl_utils_Object.__set = function(this1,key,value) {
	if(this1 != null) {
		Reflect.setProperty(this1,key,value);
	}
	return value;
};
openfl_utils_Object.__getArray = function(this1,index) {
	if(this1 == null) {
		return null;
	}
	var arr = js_Boot.__cast(this1 , Array);
	return arr[index];
};
openfl_utils_Object.__setArray = function(this1,index,value) {
	if(this1 == null) {
		return value;
	}
	var arr = js_Boot.__cast(this1 , Array);
	return arr[index] = value;
};
openfl_utils_Object.toFunction = function(this1) {
	return this1;
};
openfl_utils_Object.toFloat = function(this1) {
	if(typeof(this1) == "number") {
		return this1;
	} else {
		return NaN;
	}
};
openfl_utils_Object.toInt = function(this1) {
	return this1;
};
openfl_utils_Object.toBool = function(this1) {
	if(typeof(this1) == "boolean") {
		return this1;
	} else if(typeof(this1) == "number") {
		return this1 != 0;
	} else {
		return this1 != null;
	}
};
openfl_utils_Object.__negate = function(this1) {
	var float = this1;
	return -float;
};
openfl_utils_Object.__preIncrement = function(this1) {
	var float = this1;
	return ++float;
};
openfl_utils_Object.__postIncrement = function(this1) {
	var float = this1;
	return float++;
};
openfl_utils_Object.__preDecrement = function(this1) {
	var float = this1;
	return --float;
};
openfl_utils_Object.__postDecrement = function(this1) {
	var float = this1;
	return float--;
};
openfl_utils_Object.__add = function(a,b) {
	if(typeof(a) == "string" || typeof(b) == "string") {
		var tmp;
		if(a == null) {
			tmp = "null";
		} else {
			var this1 = a;
			tmp = this1 == null ? null : Std.string(this1);
		}
		var tmp1;
		if(b == null) {
			tmp1 = "null";
		} else {
			var this1 = b;
			tmp1 = this1 == null ? null : Std.string(this1);
		}
		return tmp + tmp1;
	} else {
		var floatA = a;
		var floatB = b;
		return floatA + floatB;
	}
};
openfl_utils_Object.__addString = function(a,b) {
	var stringA;
	if(a == null) {
		stringA = "null";
	} else {
		var this1 = a;
		stringA = this1 == null ? null : Std.string(this1);
	}
	return stringA + b;
};
openfl_utils_Object.__addInt = function(a,b) {
	var floatA = a;
	return floatA + b;
};
openfl_utils_Object.__addFloat = function(a,b) {
	var floatA = a;
	return floatA + b;
};
openfl_utils_Object.__sub = function(a,b) {
	var floatA = a;
	var floatB = b;
	return floatA - floatB;
};
openfl_utils_Object.__subInt = function(a,b) {
	var floatA = a;
	return floatA - b;
};
openfl_utils_Object.__intSub = function(a,b) {
	var floatB = b;
	return a - floatB;
};
openfl_utils_Object.__subFloat = function(a,b) {
	var floatA = a;
	return floatA - b;
};
openfl_utils_Object.__floatSub = function(a,b) {
	var floatB = b;
	return a - floatB;
};
openfl_utils_Object.__mul = function(a,b) {
	var floatA = a;
	var floatB = b;
	return floatA * floatB;
};
openfl_utils_Object.__mulInt = function(a,b) {
	var floatA = a;
	return floatA * b;
};
openfl_utils_Object.__mulFloat = function(a,b) {
	var floatA = a;
	return floatA * b;
};
openfl_utils_Object.__div = function(a,b) {
	var floatA = a;
	var floatB = b;
	return floatA / floatB;
};
openfl_utils_Object.__divInt = function(a,b) {
	var floatA = a;
	return floatA / b;
};
openfl_utils_Object.__intDiv = function(a,b) {
	var floatB = b;
	return a / floatB;
};
openfl_utils_Object.__divFloat = function(a,b) {
	var floatA = a;
	return floatA / b;
};
openfl_utils_Object.__floatDiv = function(a,b) {
	var floatB = b;
	return a / floatB;
};
openfl_utils_Object.__mod = function(a,b) {
	var floatA = a;
	var floatB = b;
	return floatA % floatB;
};
openfl_utils_Object.__modInt = function(a,b) {
	var floatA = a;
	return floatA % b;
};
openfl_utils_Object.__intMod = function(a,b) {
	var floatB = b;
	return a % floatB;
};
openfl_utils_Object.__modFloat = function(a,b) {
	var floatA = a;
	return floatA % b;
};
openfl_utils_Object.__floatMod = function(a,b) {
	var floatB = b;
	return a % floatB;
};
openfl_utils_Object.__eq = function(a,b) {
	var dynamicA = a;
	var dynamicB = b;
	return dynamicA == dynamicB;
};
openfl_utils_Object.__eqDynamic = function(a,b) {
	var dynamicA = a;
	return dynamicA == b;
};
openfl_utils_Object.__neq = function(a,b) {
	var dynamicA = a;
	var dynamicB = b;
	return dynamicA != dynamicB;
};
openfl_utils_Object.__neqDynamic = function(a,b) {
	var dynamicA = a;
	return dynamicA != b;
};
openfl_utils_Object.__lt = function(a,b) {
	var floatA = a;
	var floatB = b;
	return floatA < floatB;
};
openfl_utils_Object.__ltInt = function(a,b) {
	var floatA = a;
	return floatA < b;
};
openfl_utils_Object.__intLt = function(a,b) {
	var floatB = b;
	return a < floatB;
};
openfl_utils_Object.__ltFloat = function(a,b) {
	var floatA = a;
	return floatA < b;
};
openfl_utils_Object.__floatLt = function(a,b) {
	var floatB = b;
	return a < floatB;
};
openfl_utils_Object.__lte = function(a,b) {
	var floatA = a;
	var floatB = b;
	return floatA <= floatB;
};
openfl_utils_Object.__lteInt = function(a,b) {
	var floatB = b;
	return openfl_utils_Object.__lte(a,floatB);
};
openfl_utils_Object.__intLte = function(a,b) {
	var floatA = a;
	return openfl_utils_Object.__lte(floatA,b);
};
openfl_utils_Object.__lteFloat = function(a,b) {
	var floatB = b;
	return openfl_utils_Object.__lte(a,floatB);
};
openfl_utils_Object.__floatLte = function(a,b) {
	var floatA = a;
	return openfl_utils_Object.__lte(floatA,b);
};
openfl_utils_Object.__gt = function(a,b) {
	var floatA = a;
	var floatB = b;
	return floatA > floatB;
};
openfl_utils_Object.__gtInt = function(a,b) {
	var floatB = b;
	return openfl_utils_Object.__gt(a,floatB);
};
openfl_utils_Object.__intGt = function(a,b) {
	var floatB = b;
	return a > floatB;
};
openfl_utils_Object.__gtFloat = function(a,b) {
	var floatB = b;
	return openfl_utils_Object.__gt(a,floatB);
};
openfl_utils_Object.__floatGt = function(a,b) {
	var floatB = b;
	return a > floatB;
};
openfl_utils_Object.__gte = function(a,b) {
	var floatA = a;
	var floatB = b;
	return floatA >= floatB;
};
openfl_utils_Object.__gteInt = function(a,b) {
	var floatB = b;
	return openfl_utils_Object.__gte(a,floatB);
};
openfl_utils_Object.__intGte = function(a,b) {
	var floatB = b;
	return a >= floatB;
};
openfl_utils_Object.__gteFloat = function(a,b) {
	var floatB = b;
	return openfl_utils_Object.__gte(a,floatB);
};
openfl_utils_Object.__floatGte = function(a,b) {
	var floatB = b;
	return a >= floatB;
};
openfl_utils_Object.__complement = function(this1) {
	var int = this1;
	return ~int;
};
openfl_utils_Object.__and = function(a,b) {
	var intA = a;
	var intB = b;
	return intA & intB;
};
openfl_utils_Object.__andInt = function(a,b) {
	var intA = a;
	return intA & b;
};
openfl_utils_Object.__or = function(a,b) {
	var intA = a;
	var intB = b;
	return intA | intB;
};
openfl_utils_Object.__orInt = function(a,b) {
	var intA = a;
	return intA | b;
};
openfl_utils_Object.__xor = function(a,b) {
	var intA = a;
	var intB = b;
	return intA ^ intB;
};
openfl_utils_Object.__xorInt = function(a,b) {
	var intA = a;
	return intA ^ b;
};
openfl_utils_Object.__shr = function(a,b) {
	var intA = a;
	var intB = b;
	return intA >> intB;
};
openfl_utils_Object.__shrInt = function(a,b) {
	var intA = a;
	return intA >> b;
};
openfl_utils_Object.__intShr = function(a,b) {
	var intB = b;
	return a >> intB;
};
openfl_utils_Object.__ushr = function(a,b) {
	var intA = a;
	var intB = b;
	return intA >>> intB;
};
openfl_utils_Object.__ushrInt = function(a,b) {
	var intA = a;
	return intA >>> b;
};
openfl_utils_Object.__intUshr = function(a,b) {
	var intB = b;
	return a >>> intB;
};
openfl_utils_Object.__shl = function(a,b) {
	var intA = a;
	var intB = b;
	return intA << intB;
};
openfl_utils_Object.__shlInt = function(a,b) {
	var intA = a;
	return intA << b;
};
openfl_utils_Object.__intShl = function(a,b) {
	var intB = b;
	return a << intB;
};
var haxe_lang_Iterator = function() { };
$hxClasses["haxe.lang.Iterator"] = haxe_lang_Iterator;
haxe_lang_Iterator.__name__ = "haxe.lang.Iterator";
haxe_lang_Iterator.__isInterface__ = true;
haxe_lang_Iterator.prototype = {
	hasNext: null
	,next: null
	,__class__: haxe_lang_Iterator
};
var haxe_lang_Iterable = function() { };
$hxClasses["haxe.lang.Iterable"] = haxe_lang_Iterable;
haxe_lang_Iterable.__name__ = "haxe.lang.Iterable";
haxe_lang_Iterable.__isInterface__ = true;
haxe_lang_Iterable.prototype = {
	iterator: null
	,__class__: haxe_lang_Iterable
};
var openfl_utils_Timer = function(delay,repeatCount) {
	if(repeatCount == null) {
		repeatCount = 0;
	}
	if(isNaN(delay) || delay < 0) {
		throw new openfl_errors_Error("The delay specified is negative or not a finite number");
	}
	openfl_events_EventDispatcher.call(this);
	this.__delay = delay;
	this.__repeatCount = repeatCount;
	this.running = false;
	this.currentCount = 0;
};
$hxClasses["openfl.utils.Timer"] = openfl_utils_Timer;
openfl_utils_Timer.__name__ = "openfl.utils.Timer";
openfl_utils_Timer.__super__ = openfl_events_EventDispatcher;
openfl_utils_Timer.prototype = $extend(openfl_events_EventDispatcher.prototype,{
	currentCount: null
	,running: null
	,__delay: null
	,__repeatCount: null
	,__timer: null
	,__timerID: null
	,reset: function() {
		if(this.running) {
			this.stop();
		}
		this.currentCount = 0;
	}
	,start: function() {
		if(!this.running) {
			this.running = true;
			this.__timerID = window.setInterval($bind(this,this.timer_onTimer),this.__delay | 0);
		}
	}
	,stop: function() {
		this.running = false;
		if(this.__timerID != null) {
			window.clearInterval(this.__timerID);
			this.__timerID = null;
		}
	}
	,get_delay: function() {
		return this.__delay;
	}
	,set_delay: function(value) {
		this.__delay = value;
		if(this.running) {
			this.stop();
			this.start();
		}
		return this.__delay;
	}
	,get_repeatCount: function() {
		return this.__repeatCount;
	}
	,set_repeatCount: function(v) {
		if(this.running && v != 0 && v <= this.currentCount) {
			this.stop();
		}
		return this.__repeatCount = v;
	}
	,__handleUpdateAfterEvent: function() {
		if(openfl_Lib.get_current() == null || openfl_Lib.get_current().stage == null) {
			return;
		}
		openfl_Lib.get_current().stage.__renderAfterEvent();
	}
	,timer_onTimer: function() {
		this.currentCount++;
		if(this.__repeatCount > 0 && this.currentCount >= this.__repeatCount) {
			this.stop();
			var event = new openfl_events_TimerEvent("timer");
			this.dispatchEvent(event);
			if(event.__updateAfterEventFlag) {
				this.__handleUpdateAfterEvent();
			}
			event = new openfl_events_TimerEvent("timerComplete");
			this.dispatchEvent(event);
			if(event.__updateAfterEventFlag) {
				this.__handleUpdateAfterEvent();
			}
		} else {
			var event = new openfl_events_TimerEvent("timer");
			this.dispatchEvent(event);
			if(event.__updateAfterEventFlag) {
				this.__handleUpdateAfterEvent();
			}
		}
	}
	,__class__: openfl_utils_Timer
	,__properties__: {set_repeatCount:"set_repeatCount",get_repeatCount:"get_repeatCount",set_delay:"set_delay",get_delay:"get_delay"}
});
var openfl_utils__$internal_Lib = function() { };
$hxClasses["openfl.utils._internal.Lib"] = openfl_utils__$internal_Lib;
openfl_utils__$internal_Lib.__name__ = "openfl.utils._internal.Lib";
openfl_utils__$internal_Lib.notImplemented = function(posInfo) {
	var api = posInfo.className + "." + posInfo.methodName;
	if(!Object.prototype.hasOwnProperty.call(openfl_utils__$internal_Lib.__sentWarnings.h,api)) {
		openfl_utils__$internal_Lib.__sentWarnings.h[api] = true;
		lime_utils_Log.warn(posInfo.methodName + " is not implemented",posInfo);
	}
};
var openfl_utils__$internal_TouchData = function() {
	this.rollOutStack = [];
};
$hxClasses["openfl.utils._internal.TouchData"] = openfl_utils__$internal_TouchData;
openfl_utils__$internal_TouchData.__name__ = "openfl.utils._internal.TouchData";
openfl_utils__$internal_TouchData.prototype = {
	rollOutStack: null
	,touch: null
	,touchDownTarget: null
	,touchOverTarget: null
	,reset: function() {
		this.touch = null;
		this.touchDownTarget = null;
		this.touchOverTarget = null;
		this.rollOutStack.splice(0,this.rollOutStack.length);
	}
	,__class__: openfl_utils__$internal_TouchData
};
var openfl_utils__$internal_format_amf_AMFReader = function(i) {
	this.i = i;
	i.set_bigEndian(true);
};
$hxClasses["openfl.utils._internal.format.amf.AMFReader"] = openfl_utils__$internal_format_amf_AMFReader;
openfl_utils__$internal_format_amf_AMFReader.__name__ = "openfl.utils._internal.format.amf.AMFReader";
openfl_utils__$internal_format_amf_AMFReader.prototype = {
	i: null
	,readObject: function() {
		var h = new haxe_ds_StringMap();
		while(true) {
			var c1 = this.i.readByte();
			var c2 = this.i.readByte();
			var name = this.i.readString(c1 << 8 | c2);
			var k = this.i.readByte();
			if(k == 9) {
				break;
			}
			var value = this.readWithCode(k);
			h.h[name] = value;
		}
		return h;
	}
	,readArray: function(n) {
		var a = [];
		var _g = 0;
		var _g1 = n;
		while(_g < _g1) {
			var i = _g++;
			a.push(this.read());
		}
		return a;
	}
	,readInt: function() {
		return this.i.readInt32();
	}
	,readWithCode: function(id) {
		var i = this.i;
		switch(id) {
		case 0:
			return openfl_utils__$internal_format_amf_AMFValue.ANumber(i.readDouble());
		case 1:
			var tmp;
			switch(i.readByte()) {
			case 0:
				tmp = false;
				break;
			case 1:
				tmp = true;
				break;
			default:
				throw haxe_Exception.thrown("Invalid AMF");
			}
			return openfl_utils__$internal_format_amf_AMFValue.ABool(tmp);
		case 2:
			return openfl_utils__$internal_format_amf_AMFValue.AString(i.readString(i.readUInt16()));
		case 5:
			return openfl_utils__$internal_format_amf_AMFValue.ANull;
		case 6:
			return openfl_utils__$internal_format_amf_AMFValue.AUndefined;
		case 7:
			throw haxe_Exception.thrown("Not supported : Reference");
		case 3:case 8:
			var ismixed = id == 8;
			var size = ismixed ? this.i.readInt32() : null;
			return openfl_utils__$internal_format_amf_AMFValue.AObject(this.readObject(),size);
		case 10:
			return openfl_utils__$internal_format_amf_AMFValue.AArray(this.readArray(this.i.readInt32()));
		case 11:
			var time_ms = i.readDouble();
			var tz_min = i.readUInt16();
			return openfl_utils__$internal_format_amf_AMFValue.ADate(new Date(time_ms + tz_min * 60 * 1000.0));
		case 12:
			return openfl_utils__$internal_format_amf_AMFValue.AString(i.readString(this.i.readInt32()));
		default:
			throw haxe_Exception.thrown("Unknown AMF " + id);
		}
	}
	,read: function() {
		return this.readWithCode(this.i.readByte());
	}
	,__class__: openfl_utils__$internal_format_amf_AMFReader
};
var openfl_utils__$internal_format_amf_AMFTools = function() { };
$hxClasses["openfl.utils._internal.format.amf.AMFTools"] = openfl_utils__$internal_format_amf_AMFTools;
openfl_utils__$internal_format_amf_AMFTools.__name__ = "openfl.utils._internal.format.amf.AMFTools";
openfl_utils__$internal_format_amf_AMFTools.encode = function(o) {
	var _g = Type.typeof(o);
	switch(_g._hx_index) {
	case 0:
		return openfl_utils__$internal_format_amf_AMFValue.ANull;
	case 1:
		return openfl_utils__$internal_format_amf_AMFValue.ANumber(o);
	case 2:
		return openfl_utils__$internal_format_amf_AMFValue.ANumber(o);
	case 3:
		return openfl_utils__$internal_format_amf_AMFValue.ABool(o);
	case 4:
		var h = new haxe_ds_StringMap();
		var _g1 = 0;
		var _g2 = Reflect.fields(o);
		while(_g1 < _g2.length) {
			var f = _g2[_g1];
			++_g1;
			var value = openfl_utils__$internal_format_amf_AMFTools.encode(Reflect.field(o,f));
			h.h[f] = value;
		}
		return openfl_utils__$internal_format_amf_AMFValue.AObject(h);
	case 6:
		var c = _g.c;
		switch(c) {
		case Array:
			var o1 = o;
			var a = [];
			var _g = 0;
			while(_g < o1.length) {
				var v = o1[_g];
				++_g;
				a.push(openfl_utils__$internal_format_amf_AMFTools.encode(v));
			}
			return openfl_utils__$internal_format_amf_AMFValue.AArray(a);
		case String:
			return openfl_utils__$internal_format_amf_AMFValue.AString(o);
		case haxe_ds_StringMap:
			var o1 = o;
			var h = new haxe_ds_StringMap();
			var h1 = o1.h;
			var f_h = h1;
			var f_keys = Object.keys(h1);
			var f_length = f_keys.length;
			var f_current = 0;
			while(f_current < f_length) {
				var f = f_keys[f_current++];
				var value = openfl_utils__$internal_format_amf_AMFTools.encode(o1.h[f]);
				h.h[f] = value;
			}
			return openfl_utils__$internal_format_amf_AMFValue.AObject(h);
		default:
			throw haxe_Exception.thrown("Can't encode instance of " + c.__name__);
		}
		break;
	default:
		throw haxe_Exception.thrown("Can't encode " + Std.string(o));
	}
};
openfl_utils__$internal_format_amf_AMFTools.number = function(a) {
	if(a == null) {
		return null;
	}
	if(a._hx_index == 0) {
		var n = a.f;
		return n;
	} else {
		return null;
	}
};
openfl_utils__$internal_format_amf_AMFTools.string = function(a) {
	if(a == null) {
		return null;
	}
	if(a._hx_index == 2) {
		var s = a.s;
		return s;
	} else {
		return null;
	}
};
openfl_utils__$internal_format_amf_AMFTools.object = function(a) {
	if(a == null) {
		return null;
	}
	if(a._hx_index == 3) {
		var _g = a.size;
		var o = a.fields;
		return o;
	} else {
		return null;
	}
};
openfl_utils__$internal_format_amf_AMFTools.abool = function(a) {
	if(a == null) {
		return null;
	}
	if(a._hx_index == 1) {
		var b = a.b;
		return b;
	} else {
		return null;
	}
};
openfl_utils__$internal_format_amf_AMFTools.array = function(a) {
	if(a == null) {
		return null;
	}
	if(a._hx_index == 7) {
		var a1 = a.values;
		return a1;
	} else {
		return null;
	}
};
openfl_utils__$internal_format_amf_AMFTools.unwrapValue = function(val) {
	switch(val._hx_index) {
	case 0:
		var f = val.f;
		return f;
	case 1:
		var b = val.b;
		return b;
	case 2:
		var s = val.s;
		return s;
	case 3:
		var _g = val.size;
		var vmap = val.fields;
		var obj = { };
		var h = vmap.h;
		var name_h = h;
		var name_keys = Object.keys(h);
		var name_length = name_keys.length;
		var name_current = 0;
		while(name_current < name_length) {
			var name = name_keys[name_current++];
			obj[name] = openfl_utils__$internal_format_amf_AMFTools.unwrapValue(vmap.h[name]);
		}
		return obj;
	case 4:
		var d = val.d;
		return d;
	case 5:
		return null;
	case 6:
		return null;
	case 7:
		var vals = val.values;
		var f = openfl_utils__$internal_format_amf_AMFTools.unwrapValue;
		var result = new Array(vals.length);
		var _g = 0;
		var _g1 = vals.length;
		while(_g < _g1) {
			var i = _g++;
			result[i] = f(vals[i]);
		}
		return result;
	}
};
var openfl_utils__$internal_format_amf_AMFValue = $hxEnums["openfl.utils._internal.format.amf.AMFValue"] = { __ename__:"openfl.utils._internal.format.amf.AMFValue",__constructs__:null
	,ANumber: ($_=function(f) { return {_hx_index:0,f:f,__enum__:"openfl.utils._internal.format.amf.AMFValue",toString:$estr}; },$_._hx_name="ANumber",$_.__params__ = ["f"],$_)
	,ABool: ($_=function(b) { return {_hx_index:1,b:b,__enum__:"openfl.utils._internal.format.amf.AMFValue",toString:$estr}; },$_._hx_name="ABool",$_.__params__ = ["b"],$_)
	,AString: ($_=function(s) { return {_hx_index:2,s:s,__enum__:"openfl.utils._internal.format.amf.AMFValue",toString:$estr}; },$_._hx_name="AString",$_.__params__ = ["s"],$_)
	,AObject: ($_=function(fields,size) { return {_hx_index:3,fields:fields,size:size,__enum__:"openfl.utils._internal.format.amf.AMFValue",toString:$estr}; },$_._hx_name="AObject",$_.__params__ = ["fields","size"],$_)
	,ADate: ($_=function(d) { return {_hx_index:4,d:d,__enum__:"openfl.utils._internal.format.amf.AMFValue",toString:$estr}; },$_._hx_name="ADate",$_.__params__ = ["d"],$_)
	,AUndefined: {_hx_name:"AUndefined",_hx_index:5,__enum__:"openfl.utils._internal.format.amf.AMFValue",toString:$estr}
	,ANull: {_hx_name:"ANull",_hx_index:6,__enum__:"openfl.utils._internal.format.amf.AMFValue",toString:$estr}
	,AArray: ($_=function(values) { return {_hx_index:7,values:values,__enum__:"openfl.utils._internal.format.amf.AMFValue",toString:$estr}; },$_._hx_name="AArray",$_.__params__ = ["values"],$_)
};
openfl_utils__$internal_format_amf_AMFValue.__constructs__ = [openfl_utils__$internal_format_amf_AMFValue.ANumber,openfl_utils__$internal_format_amf_AMFValue.ABool,openfl_utils__$internal_format_amf_AMFValue.AString,openfl_utils__$internal_format_amf_AMFValue.AObject,openfl_utils__$internal_format_amf_AMFValue.ADate,openfl_utils__$internal_format_amf_AMFValue.AUndefined,openfl_utils__$internal_format_amf_AMFValue.ANull,openfl_utils__$internal_format_amf_AMFValue.AArray];
var openfl_utils__$internal_format_amf_AMFWriter = function(o) {
	this.o = o;
	o.set_bigEndian(true);
};
$hxClasses["openfl.utils._internal.format.amf.AMFWriter"] = openfl_utils__$internal_format_amf_AMFWriter;
openfl_utils__$internal_format_amf_AMFWriter.__name__ = "openfl.utils._internal.format.amf.AMFWriter";
openfl_utils__$internal_format_amf_AMFWriter.prototype = {
	o: null
	,write: function(v) {
		var o = this.o;
		switch(v._hx_index) {
		case 0:
			var n = v.f;
			o.writeByte(0);
			o.writeDouble(n);
			break;
		case 1:
			var b = v.b;
			o.writeByte(1);
			o.writeByte(b ? 1 : 0);
			break;
		case 2:
			var s = v.s;
			if(s.length <= 65535) {
				o.writeByte(2);
				o.writeUInt16(s.length);
			} else {
				o.writeByte(12);
				o.writeInt32(s.length);
			}
			o.writeString(s);
			break;
		case 3:
			var h = v.fields;
			var size = v.size;
			if(size == null) {
				o.writeByte(3);
			} else {
				o.writeByte(8);
				o.writeInt32(size);
			}
			var h1 = h.h;
			var f_h = h1;
			var f_keys = Object.keys(h1);
			var f_length = f_keys.length;
			var f_current = 0;
			while(f_current < f_length) {
				var f = f_keys[f_current++];
				o.writeUInt16(f.length);
				o.writeString(f);
				this.write(h.h[f]);
			}
			o.writeByte(0);
			o.writeByte(0);
			o.writeByte(9);
			break;
		case 4:
			var d = v.d;
			o.writeByte(11);
			o.writeDouble(d.getTime());
			o.writeUInt16(0);
			break;
		case 5:
			o.writeByte(6);
			break;
		case 6:
			o.writeByte(5);
			break;
		case 7:
			var a = v.values;
			o.writeByte(10);
			o.writeInt32(a.length);
			var _g = 0;
			while(_g < a.length) {
				var f = a[_g];
				++_g;
				this.write(f);
			}
			break;
		}
	}
	,__class__: openfl_utils__$internal_format_amf_AMFWriter
};
var openfl_utils__$internal_format_amf3_AMF3Array = function(initA,initExtra) {
	this.a = initA;
	this.extra = initExtra;
};
$hxClasses["openfl.utils._internal.format.amf3.AMF3Array"] = openfl_utils__$internal_format_amf3_AMF3Array;
openfl_utils__$internal_format_amf3_AMF3Array.__name__ = "openfl.utils._internal.format.amf3.AMF3Array";
openfl_utils__$internal_format_amf3_AMF3Array.prototype = {
	a: null
	,extra: null
	,__class__: openfl_utils__$internal_format_amf3_AMF3Array
};
var openfl_utils__$internal_format_amf3_AMF3ObjectHeader = $hxEnums["openfl.utils._internal.format.amf3.AMF3ObjectHeader"] = { __ename__:"openfl.utils._internal.format.amf3.AMF3ObjectHeader",__constructs__:null
	,HReference: ($_=function(value) { return {_hx_index:0,value:value,__enum__:"openfl.utils._internal.format.amf3.AMF3ObjectHeader",toString:$estr}; },$_._hx_name="HReference",$_.__params__ = ["value"],$_)
	,HTraits: ($_=function(traits) { return {_hx_index:1,traits:traits,__enum__:"openfl.utils._internal.format.amf3.AMF3ObjectHeader",toString:$estr}; },$_._hx_name="HTraits",$_.__params__ = ["traits"],$_)
	,HExternal: ($_=function(className) { return {_hx_index:2,className:className,__enum__:"openfl.utils._internal.format.amf3.AMF3ObjectHeader",toString:$estr}; },$_._hx_name="HExternal",$_.__params__ = ["className"],$_)
};
openfl_utils__$internal_format_amf3_AMF3ObjectHeader.__constructs__ = [openfl_utils__$internal_format_amf3_AMF3ObjectHeader.HReference,openfl_utils__$internal_format_amf3_AMF3ObjectHeader.HTraits,openfl_utils__$internal_format_amf3_AMF3ObjectHeader.HExternal];
var openfl_utils__$internal_format_amf3_AMF3Reader = function(i,parent) {
	if(parent == null) {
		this.complexObjectsTable = [];
		this.objectTraitsTable = [];
		this.stringTable = [];
	} else {
		this.complexObjectsTable = parent.complexObjectsTable;
		this.objectTraitsTable = parent.objectTraitsTable;
		this.stringTable = parent.stringTable;
	}
	this.i = i;
	i.set_bigEndian(true);
};
$hxClasses["openfl.utils._internal.format.amf3.AMF3Reader"] = openfl_utils__$internal_format_amf3_AMF3Reader;
openfl_utils__$internal_format_amf3_AMF3Reader.__name__ = "openfl.utils._internal.format.amf3.AMF3Reader";
openfl_utils__$internal_format_amf3_AMF3Reader.prototype = {
	complexObjectsTable: null
	,objectTraitsTable: null
	,stringTable: null
	,i: null
	,readObject: function(header) {
		if(header == null) {
			header = this.readObjectHeader();
		}
		var ret = null;
		switch(header._hx_index) {
		case 0:
			var value = header.value;
			return value;
		case 1:
			var traits = header.traits;
			var h = new haxe_ds_StringMap();
			ret = openfl_utils__$internal_format_amf3_AMF3Value.AObject(h,null,traits.className != null ? traits.className : null);
			var _g = 0;
			var _g1 = traits.sealedMemberNames.length;
			while(_g < _g1) {
				var j = _g++;
				var key = traits.sealedMemberNames[j];
				var value = this.read();
				h.h[key] = value;
			}
			if(traits.isDynamic) {
				var s;
				while(true) {
					s = openfl_utils__$internal_format_amf3_AMF3Tools.decode(this.readString());
					if(s == "") {
						break;
					}
					var value = this.read();
					h.h[s] = value;
				}
			}
			break;
		case 2:
			var className = header.className;
			var o = openfl_utils__$internal_format_amf3_AMF3Tools.object(openfl_utils__$internal_format_amf3_AMF3Value.AObject(null,null,className));
			if(o != null && js_Boot.__implements(o,openfl_utils_IExternalizable)) {
				var external = o;
				external.readExternal(new openfl_utils__$internal_format_amf3_AMF3ReaderInput(this));
				ret = openfl_utils__$internal_format_amf3_AMF3Value.AExternal(external);
			} else {
				ret = openfl_utils__$internal_format_amf3_AMF3Value.ANull;
			}
			break;
		}
		this.complexObjectsTable.push(ret);
		return ret;
	}
	,readObjectHeader: function(className) {
		var n = this.readInt();
		if((n & 1) == 0) {
			return openfl_utils__$internal_format_amf3_AMF3ObjectHeader.HReference(this.complexObjectsTable[n >> 1]);
		} else if((n & 3) == 1) {
			n >>= 2;
			return openfl_utils__$internal_format_amf3_AMF3ObjectHeader.HTraits(this.objectTraitsTable[n]);
		} else if((n & 7) == 3) {
			var isDynamic = (n >> 3 & 1) == 1;
			var sealedMemberNames = [];
			var count = n >> 4;
			var traits = { isExternalizable : false, isDynamic : isDynamic, className : className != null ? className : openfl_utils__$internal_format_amf3_AMF3Tools.decode(this.readString()), sealedMemberNames : sealedMemberNames};
			var _g = 0;
			var _g1 = count;
			while(_g < _g1) {
				var i = _g++;
				sealedMemberNames.push(openfl_utils__$internal_format_amf3_AMF3Tools.decode(this.readString()));
			}
			this.objectTraitsTable.push(traits);
			return openfl_utils__$internal_format_amf3_AMF3ObjectHeader.HTraits(traits);
		} else if((n & 7) == 7) {
			return openfl_utils__$internal_format_amf3_AMF3ObjectHeader.HExternal(className != null ? className : openfl_utils__$internal_format_amf3_AMF3Tools.decode(this.readString()));
		} else {
			throw haxe_Exception.thrown("Invalid object traits");
		}
	}
	,readMap: function() {
		var n = this.readInt();
		if((n & 1) == 0) {
			return this.complexObjectsTable[n >> 1];
		}
		n >>= 1;
		var h = new haxe_ds_EnumValueMap();
		var ret = openfl_utils__$internal_format_amf3_AMF3Value.AMap(h);
		this.complexObjectsTable.push(ret);
		this.i.readByte();
		var _g = 0;
		var _g1 = n;
		while(_g < _g1) {
			var i = _g++;
			h.set(this.read(),this.read());
		}
		return ret;
	}
	,readArray: function() {
		var n = this.readInt();
		if((n & 1) == 0) {
			return this.complexObjectsTable[n >> 1];
		}
		n >>= 1;
		var a = [];
		var m = new haxe_ds_StringMap();
		var ret = openfl_utils__$internal_format_amf3_AMF3Value.AArray(a,m);
		this.complexObjectsTable.push(ret);
		var assocName = openfl_utils__$internal_format_amf3_AMF3Tools.decode(this.readString());
		while(assocName.length != 0) {
			var v = this.read();
			m.h[assocName] = v;
			assocName = openfl_utils__$internal_format_amf3_AMF3Tools.decode(this.readString());
		}
		var _g = 0;
		var _g1 = n;
		while(_g < _g1) {
			var i = _g++;
			a.push(this.read());
		}
		return ret;
	}
	,readIntVector: function() {
		var header = this.readInt();
		if((header & 1) == 0) {
			return this.complexObjectsTable[header >> 1];
		}
		var len = header >> 1;
		var fixed = this.i.readByte() != 0;
		var v = openfl_Vector.toIntVector(null,len);
		v.fixed = fixed;
		var _g = 0;
		var _g1 = len;
		while(_g < _g1) {
			var r = _g++;
			v.set(r,this.i.readInt32());
		}
		var ret = openfl_utils__$internal_format_amf3_AMF3Value.AIntVector(v);
		this.complexObjectsTable.push(ret);
		return ret;
	}
	,readFloatVector: function() {
		var header = this.readInt();
		if((header & 1) == 0) {
			return this.complexObjectsTable[header >> 1];
		}
		var len = header >> 1;
		var fixed = this.i.readByte() != 0;
		var v = openfl_Vector.toFloatVector(null,len);
		v.fixed = fixed;
		var _g = 0;
		var _g1 = len;
		while(_g < _g1) {
			var r = _g++;
			v.set(r,this.i.readDouble());
		}
		var ret = openfl_utils__$internal_format_amf3_AMF3Value.AFloatVector(v);
		this.complexObjectsTable.push(ret);
		return ret;
	}
	,readObjectVector: function() {
		var header = this.readInt();
		if((header & 1) == 0) {
			return this.complexObjectsTable[header >> 1];
		}
		var len = header >> 1;
		var fixed = this.i.readByte() != 0;
		var className = openfl_utils__$internal_format_amf3_AMF3Tools.decode(this.readString());
		var v = openfl_Vector.toNullVector(null,len);
		v.fixed = fixed;
		var ret = openfl_utils__$internal_format_amf3_AMF3Value.AObjectVector(v,className);
		this.complexObjectsTable.push(ret);
		var header = null;
		var _g = 0;
		var _g1 = len;
		while(_g < _g1) {
			var r = _g++;
			var code = this.i.readByte();
			switch(code) {
			case 1:
				v.set(r,null);
				break;
			case 10:
				if(header == null) {
					header = this.readObjectHeader(className);
				}
				v.set(r,this.readObject(header));
				break;
			default:
				haxe_Log.trace("Unhandled object vector code: 0x" + StringTools.hex(code),{ fileName : "openfl/utils/_internal/format/amf3/AMF3Reader.hx", lineNumber : 317, className : "openfl.utils._internal.format.amf3.AMF3Reader", methodName : "readObjectVector"});
			}
		}
		return ret;
	}
	,readByteArray: function() {
		var n = this.readInt();
		if((n & 1) == 0) {
			return this.complexObjectsTable[n >> 1];
		}
		n >>= 1;
		var b = new haxe_io_Bytes(new ArrayBuffer(n));
		var _g = 0;
		var _g1 = n;
		while(_g < _g1) {
			var j = _g++;
			var v = this.i.readByte();
			b.b[j] = v;
		}
		var ba = openfl_utils_ByteArray.fromBytes(b);
		ba.__endian = 0;
		ba.__amf3Reader = this;
		var ret = openfl_utils__$internal_format_amf3_AMF3Value.AByteArray(ba);
		this.complexObjectsTable.push(ret);
		return ret;
	}
	,readInt: function(signExtend,preShift) {
		if(preShift == null) {
			preShift = 0;
		}
		if(signExtend == null) {
			signExtend = false;
		}
		var c = this.i.readByte() & 255;
		if(c < 128) {
			return c >> preShift;
		}
		var ret = (c & 127) << 7;
		c = this.i.readByte() & 255;
		if(c < 128) {
			return (ret | c) >> preShift;
		}
		ret |= c & 127;
		ret <<= 7;
		c = this.i.readByte() & 255;
		if(c < 128) {
			return (ret | c) >> preShift;
		}
		ret |= c & 127;
		ret <<= 8;
		c = this.i.readByte() & 255;
		ret |= c;
		if(signExtend && (ret & 268435456) != 0) {
			ret |= -536870912;
		}
		return ret >> preShift;
	}
	,readString: function() {
		var header = this.readInt();
		if((header & 1) == 0) {
			var strRefIdx = header >> 1;
			return this.stringTable[strRefIdx];
		}
		var len = header >> 1;
		return this.readStringNoHeader(len);
	}
	,readStringNoHeader: function(len) {
		if(len == 0) {
			return openfl_utils__$internal_format_amf3_AMF3Value.AString("");
		}
		var ret = openfl_utils__$internal_format_amf3_AMF3Value.AString(this.i.readString(len,haxe_io_Encoding.UTF8));
		this.stringTable.push(ret);
		return ret;
	}
	,readDate: function() {
		var n = this.readInt();
		if((n & 1) == 0) {
			return this.complexObjectsTable[n >> 1];
		}
		var date = new Date(this.i.readDouble());
		var ret = openfl_utils__$internal_format_amf3_AMF3Value.ADate(date);
		this.complexObjectsTable.push(ret);
		return ret;
	}
	,readXml: function() {
		var n = this.readInt();
		if((n & 1) == 0) {
			return this.complexObjectsTable[n >> 1];
		}
		n >>= 1;
		var xml = Xml.parse(openfl_utils__$internal_format_amf3_AMF3Tools.decode(this.readStringNoHeader(n)));
		var ret = openfl_utils__$internal_format_amf3_AMF3Value.AXml(xml);
		this.complexObjectsTable.push(ret);
		return ret;
	}
	,readWithCode: function(id) {
		var i = this.i;
		switch(id) {
		case 0:
			return openfl_utils__$internal_format_amf3_AMF3Value.AUndefined;
		case 1:
			return openfl_utils__$internal_format_amf3_AMF3Value.ANull;
		case 2:
			return openfl_utils__$internal_format_amf3_AMF3Value.ABool(false);
		case 3:
			return openfl_utils__$internal_format_amf3_AMF3Value.ABool(true);
		case 4:
			return openfl_utils__$internal_format_amf3_AMF3Value.AInt(this.readInt(true));
		case 5:
			return openfl_utils__$internal_format_amf3_AMF3Value.ANumber(i.readDouble());
		case 6:
			return this.readString();
		case 7:
			throw haxe_Exception.thrown("XMLDocument unsupported");
		case 8:
			return this.readDate();
		case 9:
			return this.readArray();
		case 10:
			return this.readObject();
		case 11:
			return this.readXml();
		case 12:
			return this.readByteArray();
		case 13:case 14:
			return this.readIntVector();
		case 15:
			return this.readFloatVector();
		case 16:
			return this.readObjectVector();
		case 17:
			return this.readMap();
		default:
			throw haxe_Exception.thrown("Unknown AMF " + id);
		}
	}
	,read: function() {
		var byte = this.i.readByte();
		return this.readWithCode(byte);
	}
	,__class__: openfl_utils__$internal_format_amf3_AMF3Reader
};
var openfl_utils__$internal_format_amf3_AMF3ReaderInput = function(r) {
	this.i = r.i;
	this.r = r;
	this.objectEncoding = 3;
};
$hxClasses["openfl.utils._internal.format.amf3.AMF3ReaderInput"] = openfl_utils__$internal_format_amf3_AMF3ReaderInput;
openfl_utils__$internal_format_amf3_AMF3ReaderInput.__name__ = "openfl.utils._internal.format.amf3.AMF3ReaderInput";
openfl_utils__$internal_format_amf3_AMF3ReaderInput.__interfaces__ = [openfl_utils_IDataInput];
openfl_utils__$internal_format_amf3_AMF3ReaderInput.prototype = {
	objectEncoding: null
	,i: null
	,r: null
	,readBoolean: function() {
		return this.i.readByte() != 0;
	}
	,readByte: function() {
		return this.i.readByte();
	}
	,readBytes: function(bytes,offset,length) {
		if(length == null) {
			length = 0;
		}
		if(offset == null) {
			offset = 0;
		}
		this.i.readBytes(openfl_utils_ByteArray.toBytes(bytes),offset,length);
	}
	,readDouble: function() {
		return this.i.readDouble();
	}
	,readFloat: function() {
		return this.i.readFloat();
	}
	,readInt: function() {
		return this.i.readInt32();
	}
	,readMultiByte: function(length,charSet) {
		return this.i.readString(length);
	}
	,readObject: function() {
		switch(this.objectEncoding) {
		case 0:
			var reader = new openfl_utils__$internal_format_amf_AMFReader(this.i);
			var data = openfl_utils__$internal_format_amf_AMFTools.unwrapValue(reader.read());
			return data;
		case 3:
			var reader = new openfl_utils__$internal_format_amf3_AMF3Reader(this.i,this.r);
			var data = openfl_utils__$internal_format_amf3_AMF3Tools.decode(reader.read());
			return data;
		default:
			return null;
		}
	}
	,readShort: function() {
		return this.i.readInt16();
	}
	,readUnsignedByte: function() {
		return this.i.readByte();
	}
	,readUnsignedInt: function() {
		var ch1 = this.i.readByte();
		var ch2 = this.i.readByte();
		var ch3 = this.i.readByte();
		var ch4 = this.i.readByte();
		if(this.get_endian() == 1) {
			return ch4 << 24 | ch3 << 16 | ch2 << 8 | ch1;
		} else {
			return ch1 << 24 | ch2 << 16 | ch3 << 8 | ch4;
		}
	}
	,readUnsignedShort: function() {
		var ch1 = this.i.readByte();
		var ch2 = this.i.readByte();
		if(this.get_endian() == 1) {
			return (ch2 << 8) + ch1;
		} else {
			return ch1 << 8 | ch2;
		}
	}
	,readUTF: function() {
		var bytesCount = this.readUnsignedShort();
		return this.readUTFBytes(bytesCount);
	}
	,readUTFBytes: function(length) {
		return this.i.readString(length);
	}
	,get_bytesAvailable: function() {
		return -1;
	}
	,get_endian: function() {
		if(this.i.bigEndian) {
			return 0;
		} else {
			return 1;
		}
	}
	,set_endian: function(value) {
		return value;
	}
	,__class__: openfl_utils__$internal_format_amf3_AMF3ReaderInput
	,__properties__: {set_endian:"set_endian",get_endian:"get_endian",get_bytesAvailable:"get_bytesAvailable"}
};
var openfl_utils__$internal_format_amf3_AMF3Tools = function() { };
$hxClasses["openfl.utils._internal.format.amf3.AMF3Tools"] = openfl_utils__$internal_format_amf3_AMF3Tools;
openfl_utils__$internal_format_amf3_AMF3Tools.__name__ = "openfl.utils._internal.format.amf3.AMF3Tools";
openfl_utils__$internal_format_amf3_AMF3Tools.encode = function(o) {
	var _g = Type.typeof(o);
	switch(_g._hx_index) {
	case 0:
		return openfl_utils__$internal_format_amf3_AMF3Value.ANull;
	case 1:
		return openfl_utils__$internal_format_amf3_AMF3Value.AInt(o);
	case 2:
		return openfl_utils__$internal_format_amf3_AMF3Value.ANumber(o);
	case 3:
		return openfl_utils__$internal_format_amf3_AMF3Value.ABool(o);
	case 4:
		var h = new haxe_ds_StringMap();
		var _g1 = 0;
		var _g2 = Reflect.fields(o);
		while(_g1 < _g2.length) {
			var f = _g2[_g1];
			++_g1;
			var value = openfl_utils__$internal_format_amf3_AMF3Tools.encode(Reflect.field(o,f));
			h.h[f] = value;
		}
		return openfl_utils__$internal_format_amf3_AMF3Value.AObject(h,null,null);
	case 5:
		return openfl_utils__$internal_format_amf3_AMF3Value.ANull;
	case 6:
		var c = _g.c;
		switch(c) {
		case Array:
			var o1 = o;
			var a = [];
			var _g = 0;
			while(_g < o1.length) {
				var v = o1[_g];
				++_g;
				a.push(openfl_utils__$internal_format_amf3_AMF3Tools.encode(v));
			}
			return openfl_utils__$internal_format_amf3_AMF3Value.AArray(a);
		case Date:
			return openfl_utils__$internal_format_amf3_AMF3Value.ADate(o);
		case String:
			return openfl_utils__$internal_format_amf3_AMF3Value.AString(o);
		case Xml:
			return openfl_utils__$internal_format_amf3_AMF3Value.AXml(o);
		case haxe_ds_IntMap:case haxe_ds_ObjectMap:case haxe_ds_StringMap:
			var o1 = o;
			var h = new haxe_ds_EnumValueMap();
			var h1 = o1.h;
			var f_h = h1;
			var f_keys = Object.keys(h1);
			var f_length = f_keys.length;
			var f_current = 0;
			while(f_current < f_length) {
				var f = f_keys[f_current++];
				h.set(openfl_utils__$internal_format_amf3_AMF3Tools.encode(f),openfl_utils__$internal_format_amf3_AMF3Tools.encode(o1.h[f]));
			}
			return openfl_utils__$internal_format_amf3_AMF3Value.AMap(h);
		case haxe_io_Bytes:
			return openfl_utils__$internal_format_amf3_AMF3Value.AByteArray(openfl_utils_ByteArray.fromBytes(o));
		case openfl_utils_ByteArrayData:
			return openfl_utils__$internal_format_amf3_AMF3Value.AByteArray(o);
		case openfl_utils__$internal_format_amf3_AMF3Array:
			var o1 = o;
			var a = [];
			var m = new haxe_ds_StringMap();
			var _g = 0;
			var _g1 = o1.a;
			while(_g < _g1.length) {
				var v = _g1[_g];
				++_g;
				a.push(openfl_utils__$internal_format_amf3_AMF3Tools.encode(v));
			}
			var h = o1.extra.h;
			var k_h = h;
			var k_keys = Object.keys(h);
			var k_length = k_keys.length;
			var k_current = 0;
			while(k_current < k_length) {
				var k = k_h[k_keys[k_current++]];
				var v = openfl_utils__$internal_format_amf3_AMF3Tools.encode(o1.extra.h[k]);
				m.h[k] = v;
			}
			return openfl_utils__$internal_format_amf3_AMF3Value.AArray(a,m);
		default:
			if(js_Boot.__implements(o,openfl_utils_IExternalizable)) {
				return openfl_utils__$internal_format_amf3_AMF3Value.AExternal(o);
			} else {
				return openfl_utils__$internal_format_amf3_AMF3Value.ANull;
			}
		}
		break;
	default:
		throw haxe_Exception.thrown("Can't encode " + Std.string(o));
	}
};
openfl_utils__$internal_format_amf3_AMF3Tools.decode = function(a) {
	if(a == null) {
		return null;
	}
	switch(a._hx_index) {
	case 0:
		return openfl_utils__$internal_format_amf3_AMF3Tools.undefined(a);
	case 1:
		return openfl_utils__$internal_format_amf3_AMF3Tools.anull(a);
	case 2:
		var _g = a.b;
		return openfl_utils__$internal_format_amf3_AMF3Tools.bool(a);
	case 3:
		var _g = a.i;
		return openfl_utils__$internal_format_amf3_AMF3Tools.int(a);
	case 4:
		var _g = a.f;
		return openfl_utils__$internal_format_amf3_AMF3Tools.number(a);
	case 5:
		var _g = a.s;
		return openfl_utils__$internal_format_amf3_AMF3Tools.string(a);
	case 6:
		var _g = a.d;
		return openfl_utils__$internal_format_amf3_AMF3Tools.date(a);
	case 7:
		var _g = a.fields;
		var _g = a.size;
		var _g = a.className;
		return openfl_utils__$internal_format_amf3_AMF3Tools.object(a);
	case 8:
		var _g = a.o;
		return openfl_utils__$internal_format_amf3_AMF3Tools.external(a);
	case 9:
		var _g = a.values;
		var _g = a.extra;
		return openfl_utils__$internal_format_amf3_AMF3Tools.array(a);
	case 10:
		var _g = a.v;
		return openfl_utils__$internal_format_amf3_AMF3Tools.intVector(a);
	case 11:
		var _g = a.v;
		return openfl_utils__$internal_format_amf3_AMF3Tools.floatVector(a);
	case 12:
		var _g = a.v;
		var _g = a.type;
		return openfl_utils__$internal_format_amf3_AMF3Tools.objectVector(a);
	case 13:
		var _g = a.x;
		return openfl_utils__$internal_format_amf3_AMF3Tools.xml(a);
	case 14:
		var _g = a.ba;
		return openfl_utils__$internal_format_amf3_AMF3Tools.byteArray(a);
	case 15:
		var _g = a.m;
		return openfl_utils__$internal_format_amf3_AMF3Tools.map(a);
	}
};
openfl_utils__$internal_format_amf3_AMF3Tools.undefined = function(a) {
	return null;
};
openfl_utils__$internal_format_amf3_AMF3Tools.anull = function(a) {
	return null;
};
openfl_utils__$internal_format_amf3_AMF3Tools.bool = function(a) {
	if(a == null) {
		return null;
	}
	if(a._hx_index == 2) {
		var b = a.b;
		return b;
	} else {
		return null;
	}
};
openfl_utils__$internal_format_amf3_AMF3Tools.int = function(a) {
	if(a == null) {
		return null;
	}
	if(a._hx_index == 3) {
		var n = a.i;
		return n;
	} else {
		return null;
	}
};
openfl_utils__$internal_format_amf3_AMF3Tools.number = function(a) {
	if(a == null) {
		return null;
	}
	if(a._hx_index == 4) {
		var n = a.f;
		return n;
	} else {
		return null;
	}
};
openfl_utils__$internal_format_amf3_AMF3Tools.string = function(a) {
	if(a == null) {
		return null;
	}
	if(a._hx_index == 5) {
		var s = a.s;
		return s;
	} else {
		return null;
	}
};
openfl_utils__$internal_format_amf3_AMF3Tools.date = function(a) {
	if(a == null) {
		return null;
	}
	if(a._hx_index == 6) {
		var d = a.d;
		return d;
	} else {
		return null;
	}
};
openfl_utils__$internal_format_amf3_AMF3Tools.array = function(a) {
	if(a == null) {
		return null;
	}
	if(a._hx_index == 9) {
		var a1 = a.values;
		var m = a.extra;
		var b = [];
		var _g = 0;
		while(_g < a1.length) {
			var f = a1[_g];
			++_g;
			b.push(openfl_utils__$internal_format_amf3_AMF3Tools.decode(f));
		}
		return b;
	} else {
		return null;
	}
};
openfl_utils__$internal_format_amf3_AMF3Tools.intVector = function(a) {
	if(a == null) {
		return null;
	}
	if(a._hx_index == 10) {
		var v = a.v;
		return v;
	} else {
		return null;
	}
};
openfl_utils__$internal_format_amf3_AMF3Tools.floatVector = function(a) {
	if(a == null) {
		return null;
	}
	if(a._hx_index == 11) {
		var v = a.v;
		return v;
	} else {
		return null;
	}
};
openfl_utils__$internal_format_amf3_AMF3Tools.objectVector = function(a) {
	if(a == null) {
		return null;
	}
	if(a._hx_index == 12) {
		var v = a.v;
		var type = a.type;
		var ret = openfl_Vector.toObjectVector(null,v.get_length(),v.fixed);
		var _g = 0;
		var _g1 = v.get_length();
		while(_g < _g1) {
			var i = _g++;
			ret.set(i,openfl_utils__$internal_format_amf3_AMF3Tools.decode(v.get(i)));
		}
		return ret;
	} else {
		return null;
	}
};
openfl_utils__$internal_format_amf3_AMF3Tools.object = function(a) {
	if(a == null) {
		return null;
	}
	if(a._hx_index == 7) {
		var _g = a.size;
		var f = a.fields;
		var className = a.className;
		var o = null;
		if(className != null && className != "") {
			var cls = openfl_Lib.getClassByAlias(className);
			if(cls == null) {
				cls = $hxClasses[className];
			}
			if(cls != null) {
				o = Type.createInstance(cls,[]);
			}
		} else {
			o = { };
		}
		if(o != null && f != null) {
			var h = f.h;
			var name_h = h;
			var name_keys = Object.keys(h);
			var name_length = name_keys.length;
			var name_current = 0;
			while(name_current < name_length) {
				var name = name_keys[name_current++];
				Reflect.setProperty(o,name,openfl_utils__$internal_format_amf3_AMF3Tools.decode(f.h[name]));
			}
		}
		return o;
	} else {
		return null;
	}
};
openfl_utils__$internal_format_amf3_AMF3Tools.external = function(a) {
	if(a == null) {
		return null;
	}
	if(a._hx_index == 8) {
		var e = a.o;
		return e;
	} else {
		return null;
	}
};
openfl_utils__$internal_format_amf3_AMF3Tools.xml = function(a) {
	if(a == null) {
		return null;
	}
	if(a._hx_index == 13) {
		var x = a.x;
		return x;
	} else {
		return null;
	}
};
openfl_utils__$internal_format_amf3_AMF3Tools.byteArray = function(a) {
	if(a == null) {
		return null;
	}
	if(a._hx_index == 14) {
		var b = a.ba;
		return b;
	} else {
		return null;
	}
};
openfl_utils__$internal_format_amf3_AMF3Tools.map = function(a) {
	if(a == null) {
		return null;
	}
	if(a._hx_index == 15) {
		var m = a.m;
		var f = m.keys();
		while(f.hasNext()) {
			var f1 = f.next();
			if(typeof(f1) == "number" && ((f1 | 0) === f1)) {
				var p = new haxe_ds_IntMap();
				var f2 = m.keys();
				while(f2.hasNext()) {
					var f3 = f2.next();
					var key = openfl_utils__$internal_format_amf3_AMF3Tools.decode(f3);
					var value = openfl_utils__$internal_format_amf3_AMF3Tools.decode(m.get(f3));
					p.h[key] = value;
				}
			} else if(typeof(f1) == "string") {
				var p1 = new haxe_ds_StringMap();
				var f4 = m.keys();
				while(f4.hasNext()) {
					var f5 = f4.next();
					var key1 = openfl_utils__$internal_format_amf3_AMF3Tools.decode(f5);
					var value1 = openfl_utils__$internal_format_amf3_AMF3Tools.decode(m.get(f5));
					p1.h[key1] = value1;
				}
			} else {
				var p2 = new haxe_ds_ObjectMap();
				var f6 = m.keys();
				while(f6.hasNext()) {
					var f7 = f6.next();
					p2.set(openfl_utils__$internal_format_amf3_AMF3Tools.decode(f7),openfl_utils__$internal_format_amf3_AMF3Tools.decode(m.get(f7)));
				}
			}
			break;
		}
		return new haxe_ds_ObjectMap();
	} else {
		return null;
	}
};
var openfl_utils__$internal_format_amf3_AMF3Value = $hxEnums["openfl.utils._internal.format.amf3.AMF3Value"] = { __ename__:"openfl.utils._internal.format.amf3.AMF3Value",__constructs__:null
	,AUndefined: {_hx_name:"AUndefined",_hx_index:0,__enum__:"openfl.utils._internal.format.amf3.AMF3Value",toString:$estr}
	,ANull: {_hx_name:"ANull",_hx_index:1,__enum__:"openfl.utils._internal.format.amf3.AMF3Value",toString:$estr}
	,ABool: ($_=function(b) { return {_hx_index:2,b:b,__enum__:"openfl.utils._internal.format.amf3.AMF3Value",toString:$estr}; },$_._hx_name="ABool",$_.__params__ = ["b"],$_)
	,AInt: ($_=function(i) { return {_hx_index:3,i:i,__enum__:"openfl.utils._internal.format.amf3.AMF3Value",toString:$estr}; },$_._hx_name="AInt",$_.__params__ = ["i"],$_)
	,ANumber: ($_=function(f) { return {_hx_index:4,f:f,__enum__:"openfl.utils._internal.format.amf3.AMF3Value",toString:$estr}; },$_._hx_name="ANumber",$_.__params__ = ["f"],$_)
	,AString: ($_=function(s) { return {_hx_index:5,s:s,__enum__:"openfl.utils._internal.format.amf3.AMF3Value",toString:$estr}; },$_._hx_name="AString",$_.__params__ = ["s"],$_)
	,ADate: ($_=function(d) { return {_hx_index:6,d:d,__enum__:"openfl.utils._internal.format.amf3.AMF3Value",toString:$estr}; },$_._hx_name="ADate",$_.__params__ = ["d"],$_)
	,AObject: ($_=function(fields,size,className) { return {_hx_index:7,fields:fields,size:size,className:className,__enum__:"openfl.utils._internal.format.amf3.AMF3Value",toString:$estr}; },$_._hx_name="AObject",$_.__params__ = ["fields","size","className"],$_)
	,AExternal: ($_=function(o) { return {_hx_index:8,o:o,__enum__:"openfl.utils._internal.format.amf3.AMF3Value",toString:$estr}; },$_._hx_name="AExternal",$_.__params__ = ["o"],$_)
	,AArray: ($_=function(values,extra) { return {_hx_index:9,values:values,extra:extra,__enum__:"openfl.utils._internal.format.amf3.AMF3Value",toString:$estr}; },$_._hx_name="AArray",$_.__params__ = ["values","extra"],$_)
	,AIntVector: ($_=function(v) { return {_hx_index:10,v:v,__enum__:"openfl.utils._internal.format.amf3.AMF3Value",toString:$estr}; },$_._hx_name="AIntVector",$_.__params__ = ["v"],$_)
	,AFloatVector: ($_=function(v) { return {_hx_index:11,v:v,__enum__:"openfl.utils._internal.format.amf3.AMF3Value",toString:$estr}; },$_._hx_name="AFloatVector",$_.__params__ = ["v"],$_)
	,AObjectVector: ($_=function(v,type) { return {_hx_index:12,v:v,type:type,__enum__:"openfl.utils._internal.format.amf3.AMF3Value",toString:$estr}; },$_._hx_name="AObjectVector",$_.__params__ = ["v","type"],$_)
	,AXml: ($_=function(x) { return {_hx_index:13,x:x,__enum__:"openfl.utils._internal.format.amf3.AMF3Value",toString:$estr}; },$_._hx_name="AXml",$_.__params__ = ["x"],$_)
	,AByteArray: ($_=function(ba) { return {_hx_index:14,ba:ba,__enum__:"openfl.utils._internal.format.amf3.AMF3Value",toString:$estr}; },$_._hx_name="AByteArray",$_.__params__ = ["ba"],$_)
	,AMap: ($_=function(m) { return {_hx_index:15,m:m,__enum__:"openfl.utils._internal.format.amf3.AMF3Value",toString:$estr}; },$_._hx_name="AMap",$_.__params__ = ["m"],$_)
};
openfl_utils__$internal_format_amf3_AMF3Value.__constructs__ = [openfl_utils__$internal_format_amf3_AMF3Value.AUndefined,openfl_utils__$internal_format_amf3_AMF3Value.ANull,openfl_utils__$internal_format_amf3_AMF3Value.ABool,openfl_utils__$internal_format_amf3_AMF3Value.AInt,openfl_utils__$internal_format_amf3_AMF3Value.ANumber,openfl_utils__$internal_format_amf3_AMF3Value.AString,openfl_utils__$internal_format_amf3_AMF3Value.ADate,openfl_utils__$internal_format_amf3_AMF3Value.AObject,openfl_utils__$internal_format_amf3_AMF3Value.AExternal,openfl_utils__$internal_format_amf3_AMF3Value.AArray,openfl_utils__$internal_format_amf3_AMF3Value.AIntVector,openfl_utils__$internal_format_amf3_AMF3Value.AFloatVector,openfl_utils__$internal_format_amf3_AMF3Value.AObjectVector,openfl_utils__$internal_format_amf3_AMF3Value.AXml,openfl_utils__$internal_format_amf3_AMF3Value.AByteArray,openfl_utils__$internal_format_amf3_AMF3Value.AMap];
var openfl_utils__$internal_format_amf3_AMF3Writer = function(o) {
	this.o = o;
	o.set_bigEndian(true);
};
$hxClasses["openfl.utils._internal.format.amf3.AMF3Writer"] = openfl_utils__$internal_format_amf3_AMF3Writer;
openfl_utils__$internal_format_amf3_AMF3Writer.__name__ = "openfl.utils._internal.format.amf3.AMF3Writer";
openfl_utils__$internal_format_amf3_AMF3Writer.prototype = {
	o: null
	,writeInt: function(i) {
		if(i > 268435455 || i < -268435456) {
			this.o.writeByte(5);
			this.o.writeDouble(i);
		} else {
			this.o.writeByte(4);
			this.writeUInt(i);
		}
	}
	,writeUInt: function(u,shiftLeft) {
		if(shiftLeft == null) {
			shiftLeft = false;
		}
		if(shiftLeft) {
			u = u << 1 | 1;
		}
		if((u >>> 31 & 1) == 1) {
			u = u & 536870911;
		}
		var bits = 22;
		var started = false;
		var chunk = u >>> bits - 1;
		if(UInt.gt(chunk,0)) {
			chunk = chunk >>> 1;
			this.o.writeByte(chunk | 128);
			u = u - (chunk << bits);
			++bits;
			started = true;
		}
		bits -= 8;
		chunk = u >>> bits;
		if(started || UInt.gt(chunk,0)) {
			this.o.writeByte(chunk | 128);
			u = u - (chunk << bits);
			started = true;
		}
		bits -= 7;
		chunk = u >>> bits;
		if(started || UInt.gt(chunk,0)) {
			this.o.writeByte(chunk | 128);
			u = u - (chunk << bits);
			started = true;
		}
		this.o.writeByte(u);
	}
	,writeString: function(s) {
		var bytes = haxe_io_Bytes.ofString(s,haxe_io_Encoding.UTF8);
		this.writeUInt(bytes.length,true);
		this.o.writeBytes(bytes,0,bytes.length);
	}
	,writeIntVector: function(v) {
		this.writeUInt(v.get_length(),true);
		this.o.writeByte(v.fixed ? 1 : 0);
		var _g = 0;
		var _g1 = v.get_length();
		while(_g < _g1) {
			var r = _g++;
			this.o.writeInt32(v.get(r));
		}
	}
	,writeFloatVector: function(v) {
		this.writeUInt(v.get_length(),true);
		this.o.writeByte(v.fixed ? 1 : 0);
		var _g = 0;
		var _g1 = v.get_length();
		while(_g < _g1) {
			var r = _g++;
			this.o.writeDouble(v.get(r));
		}
	}
	,writeObjectVector: function(v,type) {
		this.writeUInt(v.get_length(),true);
		this.o.writeByte(v.fixed ? 1 : 0);
		this.o.writeString(type);
		var _g = 0;
		var _g1 = v.get_length();
		while(_g < _g1) {
			var r = _g++;
			this.write(v.get(r));
		}
	}
	,writeObject: function(h,size,className) {
		if(size == null) {
			this.o.writeByte(11);
		} else {
			this.writeUInt(size << 4 | 3);
		}
		this.o.writeByte(1);
		if(size == null) {
			var h1 = h.h;
			var f_h = h1;
			var f_keys = Object.keys(h1);
			var f_length = f_keys.length;
			var f_current = 0;
			while(f_current < f_length) {
				var f = f_keys[f_current++];
				this.writeString(f);
				this.write(h.h[f]);
			}
			this.o.writeByte(1);
		} else {
			var k = [];
			var h1 = h.h;
			var f_h = h1;
			var f_keys = Object.keys(h1);
			var f_length = f_keys.length;
			var f_current = 0;
			while(f_current < f_length) {
				var f = f_keys[f_current++];
				k.push(f);
				this.writeString(f);
			}
			var _g = 0;
			var _g1 = k.length;
			while(_g < _g1) {
				var i = _g++;
				this.write(h.h[k[i]]);
			}
		}
	}
	,writeExternal: function(external) {
		var isExternal = true;
		var isDynamic = false;
		var traitsCount = 0;
		this.writeUInt(3 | (isExternal ? 4 : 0) | (isDynamic ? 8 : 0) | traitsCount << 4);
		var cls = js_Boot.getClass(external);
		var className = null;
		if(openfl_Lib.__registeredClasses.exists(cls)) {
			className = openfl_Lib.__registeredClasses.get(cls);
		}
		if(className == null) {
			className = cls.__name__;
		}
		this.writeString(className);
		var ba = new openfl_utils_ByteArrayData(0);
		ba.__endian = 0;
		external.writeExternal(ba);
		this.o.writeBytes(openfl_utils_ByteArray.toBytes(ba),0,openfl_utils_ByteArray.get_length(ba));
	}
	,write: function(v) {
		var o = this.o;
		switch(v._hx_index) {
		case 0:
			o.writeByte(0);
			break;
		case 1:
			o.writeByte(1);
			break;
		case 2:
			var b = v.b;
			o.writeByte(b ? 3 : 2);
			break;
		case 3:
			var i = v.i;
			this.writeInt(i);
			break;
		case 4:
			var n = v.f;
			o.writeByte(5);
			o.writeDouble(n);
			break;
		case 5:
			var s = v.s;
			o.writeByte(6);
			this.writeString(s);
			break;
		case 6:
			var d = v.d;
			o.writeByte(8);
			o.writeByte(1);
			o.writeDouble(d.getTime());
			break;
		case 7:
			var h = v.fields;
			var n = v.size;
			var className = v.className;
			o.writeByte(10);
			this.writeObject(h,n,className);
			break;
		case 8:
			var e = v.o;
			o.writeByte(10);
			this.writeExternal(e);
			break;
		case 9:
			var a = v.values;
			var extra = v.extra;
			o.writeByte(9);
			this.writeUInt(a.length,true);
			if(extra != null) {
				var h = extra.h;
				var mk_h = h;
				var mk_keys = Object.keys(h);
				var mk_length = mk_keys.length;
				var mk_current = 0;
				while(mk_current < mk_length) {
					var mk = mk_keys[mk_current++];
					o.writeString(mk);
					this.write(extra.h[mk]);
				}
			}
			o.writeByte(1);
			var _g = 0;
			while(_g < a.length) {
				var f = a[_g];
				++_g;
				this.write(f);
			}
			break;
		case 10:
			var v1 = v.v;
			o.writeByte(13);
			this.writeIntVector(v1);
			break;
		case 11:
			var v1 = v.v;
			o.writeByte(15);
			this.writeFloatVector(v1);
			break;
		case 12:
			var _g = v.type;
			var v1 = v.v;
			o.writeByte(16);
			this.writeObjectVector(v1);
			break;
		case 13:
			var x = v.x;
			o.writeByte(11);
			this.writeString(haxe_xml_Printer.print(x));
			break;
		case 14:
			var b = v.ba;
			o.writeByte(12);
			this.writeUInt(openfl_utils_ByteArray.get_length(b),true);
			o.write(openfl_utils_ByteArray.toBytes(b));
			break;
		case 15:
			var m = v.m;
			o.writeByte(17);
			this.writeUInt(Lambda.count(m),true);
			o.writeByte(0);
			var f = m.keys();
			while(f.hasNext()) {
				var f1 = f.next();
				this.write(f1);
				this.write(m.get(f1));
			}
			break;
		}
	}
	,__class__: openfl_utils__$internal_format_amf3_AMF3Writer
};
var plugins_DebugPlugin = function() {
	this._useF8 = true;
	this._varType = "string";
	this._intPos = 3;
	com_tilbuci_plugin_Plugin.call(this,"original.debug","Debug");
	this._txFormat = new openfl_text_TextFormat("_sans",10,16777215,null,null,null,null,null,3);
	this._btFormat = new openfl_text_TextFormat("_sans",9,0,true,null,null,null,null,0);
	this._inFormat = new openfl_text_TextFormat("_sans",10,16777215,null,null,null,null,null,3);
	this._infoArea = new openfl_display_Sprite();
	this._infoArea.get_graphics().beginFill(0,0.5);
	this._infoArea.get_graphics().drawRect(0,0,350,110);
	this._infoArea.get_graphics().endFill();
	this._infoArea.set_x(this._infoArea.set_y(10));
	this._infoText = this.createTxInterface(true,"",5,5,this._infoArea.get_width() - 10,this._infoArea.get_height() - 19);
	this._infoArea.addChild(this._infoText);
	var wd = (this._infoArea.get_width() - 40) / 7;
	this._hideBt = this.createBtInterface("hide",$bind(this,this.onInterfaceHide));
	this._hideBt.set_x(5);
	this._hideBt.set_y(this._infoText.get_height() - 2);
	this._hideBt.set_width(wd);
	this._infoArea.addChild(this._hideBt);
	this._cycleBt = this.createBtInterface("cycle",$bind(this,this.onInterfaceCycle));
	this._cycleBt.set_x(this._hideBt.get_x() + wd + 5);
	this._cycleBt.set_y(this._hideBt.get_y());
	this._cycleBt.set_width(wd);
	this._infoArea.addChild(this._cycleBt);
	this._movieIBt = this.createBtInterface("movie",$bind(this,this.onInterfaceMovie));
	this._movieIBt.set_x(this._cycleBt.get_x() + wd + 5);
	this._movieIBt.set_y(this._hideBt.get_y());
	this._movieIBt.set_width(wd);
	this._infoArea.addChild(this._movieIBt);
	this._sceneIBt = this.createBtInterface("scene",$bind(this,this.onInterfaceScene));
	this._sceneIBt.set_x(this._movieIBt.get_x() + wd + 5);
	this._sceneIBt.set_y(this._hideBt.get_y());
	this._sceneIBt.set_width(wd);
	this._infoArea.addChild(this._sceneIBt);
	this._varIBt = this.createBtInterface("vars",$bind(this,this.onInterfaceVar));
	this._varIBt.set_x(this._sceneIBt.get_x() + wd + 5);
	this._varIBt.set_y(this._hideBt.get_y());
	this._varIBt.set_width(wd);
	this._infoArea.addChild(this._varIBt);
	this._actionIBt = this.createBtInterface("action",$bind(this,this.onInterfaceAction));
	this._actionIBt.set_x(this._varIBt.get_x() + wd + 5);
	this._actionIBt.set_y(this._hideBt.get_y());
	this._actionIBt.set_width(wd);
	this._infoArea.addChild(this._actionIBt);
	this._statsIBt = this.createBtInterface("stats",$bind(this,this.onInterfaceStats));
	this._statsIBt.set_x(this._actionIBt.get_x() + wd + 5);
	this._statsIBt.set_y(this._hideBt.get_y());
	this._statsIBt.set_width(wd);
	this._infoArea.addChild(this._statsIBt);
	this._interfaceMovie = new openfl_display_Sprite();
	this._interfaceMovie.get_graphics().beginFill(0,0.5);
	this._interfaceMovie.get_graphics().drawRect(0,0,this._infoArea.get_width(),75);
	this._interfaceMovie.get_graphics().endFill();
	this._interfaceMovie.set_x(0);
	this._interfaceMovie.set_y(this._infoArea.get_height() + 2);
	this._movieTxt = this.createTxInterface(true,"<b>New movie load:</b> enter the movie ID",5,5,this._interfaceMovie.get_width() - 10,24);
	this._interfaceMovie.addChild(this._movieTxt);
	this._movieInput = this.createInputInterface(this._interfaceMovie.get_width() - 10);
	this._movieInput.set_x(5);
	this._movieInput.set_y(this._movieTxt.get_y() + this._movieTxt.get_height());
	this._interfaceMovie.addChild(this._movieInput);
	this._movieBt = this.createBtInterface("load movie",$bind(this,this.onLoadMovie));
	this._movieBt.set_x(5);
	this._movieBt.set_y(this._movieInput.get_y() + this._movieInput.get_height() + 5);
	this._movieBt.set_width(this._movieInput.get_width());
	this._interfaceMovie.addChild(this._movieBt);
	this._interfaceScene = new openfl_display_Sprite();
	this._interfaceScene.get_graphics().beginFill(0,0.5);
	this._interfaceScene.get_graphics().drawRect(0,0,this._infoArea.get_width(),75);
	this._interfaceScene.get_graphics().endFill();
	this._interfaceScene.set_x(0);
	this._interfaceScene.set_y(this._infoArea.get_height() + 2);
	this._sceneTxt = this.createTxInterface(true,"<b>New scene load:</b> enter the scene ID",5,5,this._interfaceScene.get_width() - 10,24);
	this._interfaceScene.addChild(this._sceneTxt);
	this._sceneInput = this.createInputInterface(this._interfaceScene.get_width() - 10);
	this._sceneInput.set_x(5);
	this._sceneInput.set_y(this._sceneTxt.get_y() + this._sceneTxt.get_height());
	this._interfaceScene.addChild(this._sceneInput);
	this._sceneBt = this.createBtInterface("load scene",$bind(this,this.onLoadScene));
	this._sceneBt.set_x(5);
	this._sceneBt.set_y(this._sceneInput.get_y() + this._sceneInput.get_height() + 5);
	this._sceneBt.set_width(this._sceneInput.get_width());
	this._interfaceScene.addChild(this._sceneBt);
	this._interfaceVar = new openfl_display_Sprite();
	this._interfaceVar.get_graphics().beginFill(0,0.5);
	this._interfaceVar.get_graphics().drawRect(0,0,this._infoArea.get_width(),200);
	this._interfaceVar.get_graphics().endFill();
	this._interfaceVar.set_x(0);
	this._interfaceVar.set_y(this._infoArea.get_height() + 2);
	this._varTxt = this.createTxInterface(false,"<b>String variables</b>",5,5,this._interfaceVar.get_width() - 10,24);
	this._varTxt.set_defaultTextFormat(this._txFormat);
	this._interfaceVar.addChild(this._varTxt);
	this._varList = this.createTxInterface(true,"",5,this._varTxt.get_y() + this._varTxt.get_height(),this._varTxt.get_width(),100);
	this._varList.set_selectable(true);
	this._varList.set_type(1);
	this._varList.set_border(true);
	this._varList.set_borderColor(16777215);
	this._varList.addEventListener("click",$bind(this,this.onInputClick));
	this._interfaceVar.addChild(this._varList);
	this._setvarTxt = this.createTxInterface(false,"<b>Set string value (set to empty field to remove it)</b>",5,this._varList.get_y() + this._varList.get_height() + 5,this._interfaceVar.get_width() - 10,18);
	this._interfaceVar.addChild(this._setvarTxt);
	this._setVarName = this.createInputInterface(this._interfaceVar.get_width() / 3);
	this._setVarName.set_x(5);
	this._setVarName.set_y(this._setvarTxt.get_y() + this._setvarTxt.get_height() + 5);
	this._interfaceVar.addChild(this._setVarName);
	this._setVarEqual = this.createTxInterface(false,"=",this._setVarName.get_x() + this._setVarName.get_width() + 5,this._setVarName.get_y(),20,15);
	this._interfaceVar.addChild(this._setVarEqual);
	this._setVarValue = this.createInputInterface(this._interfaceVar.get_width() / 3);
	this._setVarValue.set_x(this._setVarEqual.get_x() + this._setVarEqual.get_width() + 2);
	this._setVarValue.set_y(this._setVarName.get_y());
	this._interfaceVar.addChild(this._setVarValue);
	this._setVarButton = this.createBtInterface("set",$bind(this,this.onSetVar));
	this._setVarButton.set_x(this._interfaceVar.get_width() - this._setVarButton.get_width() - 5);
	this._setVarButton.set_y(this._setVarName.get_y());
	this._interfaceVar.addChild(this._setVarButton);
	this._traceVarButton = this.createBtInterface("trace",$bind(this,this.onTraceVar));
	this._traceVarButton.set_x(this._interfaceVar.get_width() - this._traceVarButton.get_width() - 5);
	this._traceVarButton.set_y(this._setVarButton.get_y() + this._setVarButton.get_height() + 5);
	this._interfaceVar.addChild(this._traceVarButton);
	this._refreshVarButton = this.createBtInterface("refresh",$bind(this,this.onRefreshVar));
	this._refreshVarButton.set_x(this._traceVarButton.get_x() - this._refreshVarButton.get_width() - 5);
	this._refreshVarButton.set_y(this._traceVarButton.get_y());
	this._interfaceVar.addChild(this._refreshVarButton);
	this._setVarString = this.createBtInterface("string",$bind(this,this.onSetString));
	this._setVarString.set_x(5);
	this._setVarString.set_y(this._traceVarButton.get_y());
	this._interfaceVar.addChild(this._setVarString);
	this._setVarFloat = this.createBtInterface("float",$bind(this,this.onSetFloat));
	this._setVarFloat.set_x(this._setVarString.get_x() + this._setVarString.get_width() + 5);
	this._setVarFloat.set_y(this._traceVarButton.get_y());
	this._interfaceVar.addChild(this._setVarFloat);
	this._setVarInt = this.createBtInterface("int",$bind(this,this.onSetInt));
	this._setVarInt.set_x(this._setVarFloat.get_x() + this._setVarFloat.get_width() + 5);
	this._setVarInt.set_y(this._traceVarButton.get_y());
	this._interfaceVar.addChild(this._setVarInt);
	this._setVarBool = this.createBtInterface("bool",$bind(this,this.onSetBool));
	this._setVarBool.set_x(this._setVarInt.get_x() + this._setVarInt.get_width() + 5);
	this._setVarBool.set_y(this._traceVarButton.get_y());
	this._interfaceVar.addChild(this._setVarBool);
	this._intarfaceAction = new openfl_display_Sprite();
	this._intarfaceAction.get_graphics().beginFill(0,0.5);
	this._intarfaceAction.get_graphics().drawRect(0,0,this._infoArea.get_width(),200);
	this._intarfaceAction.get_graphics().endFill();
	this._intarfaceAction.set_x(0);
	this._intarfaceAction.set_y(this._infoArea.get_height() + 2);
	this._actionTxt = this.createTxInterface(true,"<b>Write/paste the action JSON below</b>",5,5,this._intarfaceAction.get_width() - 10,24);
	this._intarfaceAction.addChild(this._actionTxt);
	this._actionArea = this.createInputInterface(this._intarfaceAction.get_width() - 10);
	this._actionArea.set_x(5);
	this._actionArea.set_y(this._actionTxt.get_y() + this._actionTxt.get_height());
	this._actionArea.set_height(140);
	this._intarfaceAction.addChild(this._actionArea);
	this._actionRun = this.createBtInterface("run",$bind(this,this.onRunAction));
	this._actionRun.set_x(5);
	this._actionRun.set_y(this._actionArea.get_y() + this._actionArea.get_height() + 5);
	this._actionRun.set_width(this._actionArea.get_width());
	this._intarfaceAction.addChild(this._actionRun);
	this._fpsHolder = new openfl_display_Sprite();
	this._fpsHolder.get_graphics().beginFill(0,0.5);
	this._fpsHolder.get_graphics().drawRect(0,0,65,30);
	this._fpsHolder.get_graphics().endFill();
};
$hxClasses["plugins.DebugPlugin"] = plugins_DebugPlugin;
plugins_DebugPlugin.__name__ = "plugins.DebugPlugin";
plugins_DebugPlugin.__super__ = com_tilbuci_plugin_Plugin;
plugins_DebugPlugin.prototype = $extend(com_tilbuci_plugin_Plugin.prototype,{
	_overlay: null
	,_infoArea: null
	,_infoText: null
	,_txFormat: null
	,_btFormat: null
	,_inFormat: null
	,_hideBt: null
	,_cycleBt: null
	,_sceneIBt: null
	,_movieIBt: null
	,_varIBt: null
	,_actionIBt: null
	,_statsIBt: null
	,_intPos: null
	,_sceneBt: null
	,_interfaceScene: null
	,_sceneInput: null
	,_sceneTxt: null
	,_movieBt: null
	,_interfaceMovie: null
	,_movieInput: null
	,_movieTxt: null
	,_interfaceVar: null
	,_varTxt: null
	,_varList: null
	,_setvarTxt: null
	,_varType: null
	,_setVarName: null
	,_setVarEqual: null
	,_setVarValue: null
	,_setVarButton: null
	,_refreshVarButton: null
	,_traceVarButton: null
	,_setVarString: null
	,_setVarFloat: null
	,_setVarInt: null
	,_setVarBool: null
	,_intarfaceAction: null
	,_actionTxt: null
	,_actionArea: null
	,_actionRun: null
	,_fps: null
	,_fpsHolder: null
	,_useF8: null
	,initialize: function(ac) {
		com_tilbuci_plugin_Plugin.prototype.initialize.call(this,ac);
		this._overlay = this.getOverlay("original.debug");
		this.setAction("trace",$bind(this,this.acTrace));
		this.setAction("trace.strings",$bind(this,this.acTraceStrings));
		this.setAction("trace.floats",$bind(this,this.acTraceFloats));
		this.setAction("trace.ints",$bind(this,this.acTraceInts));
		this.setAction("trace.bools",$bind(this,this.acTraceBools));
		this.setAction("trace.vars",$bind(this,this.acTraceVars));
		this.setAction("debuginfo.show",$bind(this,this.acInfoShow));
		this.setAction("debuginfo.hide",$bind(this,this.acInfoHide));
		this.info.addEventListener("movieload",$bind(this,this.onMovieLoad));
		this.info.addEventListener("sceneload",$bind(this,this.onSceneLoad));
		this.info.addEventListener("keyframeload",$bind(this,this.onKeyframeLoad));
		this.info.addEventListener("displayresize",$bind(this,this.onDisplayResize));
		this.addActionGroupDescription({ n : "Original Debug", d : "Actions from the original debug plugin.", a : [{ n : "Trace", a : "trace", c : false, d : "Outputs text to the system console.", p : [{ n : "Text to output", t : "string", d : "The text to output.", o : false}]}]});
		this.addGlobalVarGroupDescription({ n : "Original Debug Variables", v : [{ d : "Is the debug area shown?", t : "bool", c : "?_DEBUGDISPLAY"}]});
	}
	,checkKeyboard: function(code) {
		if(this._useF8 && code == 119) {
			if(this._infoArea.parent == null) {
				this._overlay.addChild(this._infoArea);
				this.overlayTop("original.debug");
			} else {
				this._overlay.removeChild(this._infoArea);
			}
			return true;
		} else {
			return false;
		}
	}
	,parseBool: function(str) {
		if(str == "?_DEBUGDISPLAY") {
			return { found : true, value : this._infoArea.parent != null};
		} else {
			return { found : false, value : false};
		}
	}
	,kill: function() {
		this.info.removeEventListener("movieload",$bind(this,this.onMovieLoad));
		this.info.removeEventListener("sceneload",$bind(this,this.onSceneLoad));
		this.info.removeEventListener("keyframeload",$bind(this,this.onKeyframeLoad));
		this.info.removeEventListener("displayresize",$bind(this,this.onDisplayResize));
		this.acInfoHide([]);
		this._infoArea.get_graphics().clear();
		this._infoArea.removeChildren();
		this._infoArea = null;
		this._infoText = null;
		this.killBtInterface(this._hideBt,$bind(this,this.onInterfaceHide));
		this.killBtInterface(this._cycleBt,$bind(this,this.onInterfaceCycle));
		this.killBtInterface(this._sceneIBt,$bind(this,this.onInterfaceScene));
		this.killBtInterface(this._movieIBt,$bind(this,this.onInterfaceMovie));
		this.killBtInterface(this._varIBt,$bind(this,this.onInterfaceVar));
		this.killBtInterface(this._actionIBt,$bind(this,this.onInterfaceAction));
		this.killBtInterface(this._statsIBt,$bind(this,this.onInterfaceStats));
		this._hideBt = this._cycleBt = this._sceneIBt = this._movieIBt = this._varIBt = this._actionIBt = this._statsIBt = null;
		this._interfaceMovie.get_graphics().clear();
		this._interfaceMovie.removeChildren();
		this._interfaceMovie = null;
		this._movieTxt = null;
		this._movieInput.removeEventListener("click",$bind(this,this.onInputClick));
		this._movieInput = null;
		this.killBtInterface(this._movieBt,$bind(this,this.onLoadMovie));
		this._movieBt = null;
		this._interfaceScene.get_graphics().clear();
		this._interfaceScene.removeChildren();
		this._interfaceScene = null;
		this._sceneTxt = null;
		this._sceneInput.removeEventListener("click",$bind(this,this.onInputClick));
		this._sceneInput = null;
		this.killBtInterface(this._sceneBt,$bind(this,this.onLoadScene));
		this._sceneBt = null;
		this._interfaceVar.get_graphics().clear();
		this._interfaceVar.removeChildren();
		this._interfaceVar = null;
		this._varTxt = null;
		this._varList.removeEventListener("click",$bind(this,this.onInputClick));
		this._varList = null;
		this._setvarTxt = null;
		this._setVarName.removeEventListener("click",$bind(this,this.onInputClick));
		this._setVarName = null;
		this._setVarValue.removeEventListener("click",$bind(this,this.onInputClick));
		this._setVarValue = null;
		this._setVarEqual = null;
		this.killBtInterface(this._setVarButton,$bind(this,this.onSetVar));
		this._setVarButton = null;
		this.killBtInterface(this._traceVarButton,$bind(this,this.onTraceVar));
		this._traceVarButton = null;
		this.killBtInterface(this._refreshVarButton,$bind(this,this.onRefreshVar));
		this._refreshVarButton = null;
		this.killBtInterface(this._setVarString,$bind(this,this.onSetString));
		this._setVarString = null;
		this.killBtInterface(this._setVarFloat,$bind(this,this.onSetFloat));
		this._setVarFloat = null;
		this.killBtInterface(this._setVarInt,$bind(this,this.onSetInt));
		this._setVarInt = null;
		this.killBtInterface(this._setVarBool,$bind(this,this.onSetBool));
		this._setVarBool = null;
		this._intarfaceAction.get_graphics().clear();
		this._intarfaceAction.removeChildren();
		this._intarfaceAction = null;
		this._actionTxt = null;
		this._actionArea.removeEventListener("click",$bind(this,this.onInputClick));
		this._actionArea = null;
		this.killBtInterface(this._actionRun,$bind(this,this.onRunAction));
		this._actionRun = null;
		this._txFormat = this._btFormat = this._inFormat = null;
		this._fpsHolder.removeChildren();
		this._fpsHolder.get_graphics().clear();
		this._fpsHolder = null;
		this._fps = null;
		this.removeOverlay("original.debug");
		this._overlay = null;
		com_tilbuci_plugin_Plugin.prototype.kill.call(this);
	}
	,getConfig: function(interf) {
		if(interf == null) {
			interf = true;
		}
		if(interf) {
			this._useF8 = true;
		}
		return { usef8 : this._useF8};
	}
	,setConfig: function(to) {
		if(Object.prototype.hasOwnProperty.call(to,"usef8")) {
			this._useF8 = true;
		}
	}
	,acTrace: function(param) {
		var _g = 0;
		while(_g < param.length) {
			var i = param[_g];
			++_g;
			haxe_Log.trace(this._access.parser.parseString(i),{ fileName : "Source/plugins/DebugPlugin.hx", lineNumber : 642, className : "plugins.DebugPlugin", methodName : "acTrace"});
		}
		return true;
	}
	,acTraceStrings: function(param) {
		haxe_Log.trace(haxe_format_JsonPrinter.print({ string : this._access.varString},null,null),{ fileName : "Source/plugins/DebugPlugin.hx", lineNumber : 652, className : "plugins.DebugPlugin", methodName : "acTraceStrings"});
		return true;
	}
	,acTraceFloats: function(param) {
		haxe_Log.trace(haxe_format_JsonPrinter.print({ float : this._access.varFloat},null,null),{ fileName : "Source/plugins/DebugPlugin.hx", lineNumber : 664, className : "plugins.DebugPlugin", methodName : "acTraceFloats"});
		return true;
	}
	,acTraceInts: function(param) {
		haxe_Log.trace(haxe_format_JsonPrinter.print({ int : this._access.varInt},null,null),{ fileName : "Source/plugins/DebugPlugin.hx", lineNumber : 676, className : "plugins.DebugPlugin", methodName : "acTraceInts"});
		return true;
	}
	,acTraceBools: function(param) {
		haxe_Log.trace(haxe_format_JsonPrinter.print({ bool : this._access.varBool},null,null),{ fileName : "Source/plugins/DebugPlugin.hx", lineNumber : 688, className : "plugins.DebugPlugin", methodName : "acTraceBools"});
		return true;
	}
	,acTraceVars: function(param) {
		haxe_Log.trace(haxe_format_JsonPrinter.print({ string : this._access.varString, float : this._access.varFloat, int : this._access.varInt, bool : this._access.varBool},null,null),{ fileName : "Source/plugins/DebugPlugin.hx", lineNumber : 700, className : "plugins.DebugPlugin", methodName : "acTraceVars"});
		return true;
	}
	,acInfoShow: function(param) {
		this._overlay.addChild(this._infoArea);
		return true;
	}
	,acInfoHide: function(param) {
		if(this._infoArea.parent != null) {
			this._overlay.removeChild(this._infoArea);
		}
		return true;
	}
	,setInfoText: function() {
		this._infoText.set_htmlText("<b>Movie:</b> " + this.info.movieName + " (" + this.info.movieId + ")" + "<br><b>Scene:</b> " + this.info.sceneName + " (" + this.info.sceneId + ")" + "<br><b>Keyframe:</b> " + (this.info.keyframeCurrent + 1) + "/" + this.info.keyframeTotal + "<br><b>Asset multiply:</b> " + this.info.displayMultiply + "<br><b>Orientation:</b> " + this.info.orientation + "<br><b>Screen area:</b> ");
		if(this.info.orientation == "vertical") {
			var fh = this._infoText;
			fh.set_htmlText(fh.get_htmlText() + (this.info.displaySmaller + "x" + this.info.displayBigger));
		} else {
			var fh = this._infoText;
			fh.set_htmlText(fh.get_htmlText() + (this.info.displayBigger + "x" + this.info.displaySmaller));
		}
	}
	,setVarText: function() {
		this._varList.set_htmlText("");
		switch(this._varType) {
		case "bool":
			var h = this._access.varBool.h;
			var i_h = h;
			var i_keys = Object.keys(h);
			var i_length = i_keys.length;
			var i_current = 0;
			while(i_current < i_length) {
				var i = i_keys[i_current++];
				var fh = this._varList;
				fh.set_htmlText(fh.get_htmlText() + ("<b>" + i + "</b> => " + Std.string(this._access.varBool.h[i]) + "<br>"));
			}
			break;
		case "float":
			var h = this._access.varFloat.h;
			var i_h = h;
			var i_keys = Object.keys(h);
			var i_length = i_keys.length;
			var i_current = 0;
			while(i_current < i_length) {
				var i = i_keys[i_current++];
				var fh = this._varList;
				fh.set_htmlText(fh.get_htmlText() + ("<b>" + i + "</b> => " + this._access.varFloat.h[i] + "<br>"));
			}
			break;
		case "int":
			var h = this._access.varInt.h;
			var i_h = h;
			var i_keys = Object.keys(h);
			var i_length = i_keys.length;
			var i_current = 0;
			while(i_current < i_length) {
				var i = i_keys[i_current++];
				var fh = this._varList;
				fh.set_htmlText(fh.get_htmlText() + ("<b>" + i + "</b> => " + this._access.varInt.h[i] + "<br>"));
			}
			break;
		default:
			var h = this._access.varString.h;
			var i_h = h;
			var i_keys = Object.keys(h);
			var i_length = i_keys.length;
			var i_current = 0;
			while(i_current < i_length) {
				var i = i_keys[i_current++];
				var fh = this._varList;
				fh.set_htmlText(fh.get_htmlText() + ("<b>" + i + "</b> => " + this._access.varString.h[i] + "<br>"));
			}
		}
	}
	,createTxInterface: function(multi,txt,px,py,wd,ht) {
		var tx = new openfl_text_TextField();
		tx.set_defaultTextFormat(this._txFormat);
		tx.set_multiline(multi);
		tx.set_selectable(false);
		tx.set_htmlText(txt);
		tx.set_x(px);
		tx.set_y(py);
		tx.set_width(wd);
		tx.set_height(ht);
		return tx;
	}
	,createBtInterface: function(txt,ac) {
		var bt = new openfl_text_TextField();
		bt.set_defaultTextFormat(this._btFormat);
		bt.set_background(true);
		bt.set_backgroundColor(16777215);
		bt.set_border(true);
		bt.set_borderColor(16777215);
		bt.set_width(50);
		bt.set_height(15);
		bt.set_text(txt);
		bt.set_selectable(false);
		bt.addEventListener("click",ac);
		return bt;
	}
	,createInputInterface: function(wd) {
		var inp = new openfl_text_TextField();
		inp.set_type(1);
		inp.set_defaultTextFormat(this._inFormat);
		inp.set_background(true);
		inp.set_backgroundColor(0);
		inp.set_border(true);
		inp.set_borderColor(0);
		inp.set_width(wd);
		inp.set_height(15);
		inp.set_text("");
		inp.addEventListener("click",$bind(this,this.onInputClick));
		return inp;
	}
	,onInputClick: function(evt) {
		this._infoArea.stage.set_focus(evt.target);
	}
	,killBtInterface: function(bt,ac) {
		if(ac != null) {
			bt.removeEventListener("click",ac);
		}
		bt.set_text(null);
		bt.set_htmlText(null);
		bt.set_defaultTextFormat(null);
	}
	,onMovieLoad: function(evt) {
		this.setInfoText();
		this.placeInterface();
	}
	,onSceneLoad: function(evt) {
		this.setInfoText();
	}
	,onKeyframeLoad: function(evt) {
		this.setInfoText();
	}
	,onDisplayResize: function(evt) {
		this.setInfoText();
		this.placeInterface();
	}
	,onInterfaceHide: function(evt) {
		this.acInfoHide([]);
	}
	,onInterfaceCycle: function(evt) {
		this._intPos++;
		if(this._intPos > 3) {
			this._intPos = 0;
		}
		this.placeInterface();
		haxe_Log.trace(openfl_display__$internal_stats_Context3DStats.totalDrawCalls(),{ fileName : "Source/plugins/DebugPlugin.hx", lineNumber : 880, className : "plugins.DebugPlugin", methodName : "onInterfaceCycle"});
	}
	,onInterfaceMovie: function(evt) {
		if(this._interfaceScene.parent != null) {
			this._infoArea.removeChild(this._interfaceScene);
		}
		if(this._interfaceVar.parent != null) {
			this._infoArea.removeChild(this._interfaceVar);
		}
		if(this._intarfaceAction.parent != null) {
			this._infoArea.removeChild(this._intarfaceAction);
		}
		if(this._interfaceMovie.parent == null) {
			this._infoArea.addChild(this._interfaceMovie);
		} else {
			this._infoArea.removeChild(this._interfaceMovie);
		}
		this.placeInterface();
	}
	,onInterfaceScene: function(evt) {
		if(this._interfaceMovie.parent != null) {
			this._infoArea.removeChild(this._interfaceMovie);
		}
		if(this._interfaceVar.parent != null) {
			this._infoArea.removeChild(this._interfaceVar);
		}
		if(this._intarfaceAction.parent != null) {
			this._infoArea.removeChild(this._intarfaceAction);
		}
		if(this._interfaceScene.parent == null) {
			this._infoArea.addChild(this._interfaceScene);
		} else {
			this._infoArea.removeChild(this._interfaceScene);
		}
		this.placeInterface();
	}
	,onInterfaceVar: function(evt) {
		if(this._interfaceMovie.parent != null) {
			this._infoArea.removeChild(this._interfaceMovie);
		}
		if(this._interfaceScene.parent != null) {
			this._infoArea.removeChild(this._interfaceScene);
		}
		if(this._intarfaceAction.parent != null) {
			this._infoArea.removeChild(this._intarfaceAction);
		}
		if(this._interfaceVar.parent == null) {
			this.setVarText();
			this._infoArea.addChild(this._interfaceVar);
		} else {
			this._infoArea.removeChild(this._interfaceVar);
		}
		this.placeInterface();
	}
	,onInterfaceAction: function(evt) {
		if(this._interfaceMovie.parent != null) {
			this._infoArea.removeChild(this._interfaceMovie);
		}
		if(this._interfaceScene.parent != null) {
			this._infoArea.removeChild(this._interfaceScene);
		}
		if(this._interfaceVar.parent != null) {
			this._infoArea.removeChild(this._interfaceVar);
		}
		if(this._intarfaceAction.parent == null) {
			this._infoArea.addChild(this._intarfaceAction);
		} else {
			this._infoArea.removeChild(this._intarfaceAction);
		}
		this.placeInterface();
	}
	,onInterfaceStats: function(evt) {
		haxe_Log.trace("build with -D gl_stats to check out draw calls as well",{ fileName : "Source/plugins/DebugPlugin.hx", lineNumber : 949, className : "plugins.DebugPlugin", methodName : "onInterfaceStats"});
		if(this._fps == null) {
			this._fps = new openfl_display_FPS(5,5,16777215);
			this._fpsHolder.addChild(this._fps);
			this._overlay.addChild(this._fpsHolder);
			this.placeInterface();
		} else {
			this._overlay.removeChild(this._fpsHolder);
			this._fpsHolder.removeChild(this._fps);
			this._fps = null;
		}
	}
	,onLoadMovie: function(evt) {
		if(this._movieInput.get_text() != "") {
			this._access.parser.run(haxe_format_JsonPrinter.print({ ac : "movie.load", param : [this._movieInput.get_text()]},null,null));
		}
	}
	,onLoadScene: function(evt) {
		if(this._sceneInput.get_text() != "") {
			this._access.parser.run(haxe_format_JsonPrinter.print({ ac : "scene.load", param : [this._sceneInput.get_text()]},null,null));
		}
	}
	,onSetVar: function(evt) {
		if(this._setVarName.get_text() != "") {
			switch(this._varType) {
			case "bool":
				if(this._setVarValue.get_text() == "") {
					var this1 = this._access.varBool;
					var key = this._access.parser.parseString(this._setVarName.get_text());
					if(Object.prototype.hasOwnProperty.call(this1.h,key)) {
						var this1 = this._access.varBool;
						var key = this._access.parser.parseString(this._setVarName.get_text());
						var _this = this1;
						if(Object.prototype.hasOwnProperty.call(_this.h,key)) {
							delete(_this.h[key]);
						}
					}
				} else {
					var this1 = this._access.varBool;
					var k = this._access.parser.parseString(this._setVarName.get_text());
					var v = this._access.parser.parseBool(this._setVarValue.get_text());
					this1.h[k] = v;
				}
				break;
			case "float":
				if(this._setVarValue.get_text() == "") {
					var this1 = this._access.varFloat;
					var key = this._access.parser.parseString(this._setVarName.get_text());
					if(Object.prototype.hasOwnProperty.call(this1.h,key)) {
						var this1 = this._access.varFloat;
						var key = this._access.parser.parseString(this._setVarName.get_text());
						var _this = this1;
						if(Object.prototype.hasOwnProperty.call(_this.h,key)) {
							delete(_this.h[key]);
						}
					}
				} else {
					var this1 = this._access.varFloat;
					var k = this._access.parser.parseString(this._setVarName.get_text());
					var v = this._access.parser.parseFloat(this._setVarValue.get_text());
					this1.h[k] = v;
				}
				break;
			case "int":
				if(this._setVarValue.get_text() == "") {
					var this1 = this._access.varInt;
					var key = this._access.parser.parseString(this._setVarName.get_text());
					if(Object.prototype.hasOwnProperty.call(this1.h,key)) {
						var this1 = this._access.varInt;
						var key = this._access.parser.parseString(this._setVarName.get_text());
						var _this = this1;
						if(Object.prototype.hasOwnProperty.call(_this.h,key)) {
							delete(_this.h[key]);
						}
					}
				} else {
					var this1 = this._access.varInt;
					var k = this._access.parser.parseString(this._setVarName.get_text());
					var v = this._access.parser.parseInt(this._setVarValue.get_text());
					this1.h[k] = v;
				}
				break;
			default:
				if(this._setVarValue.get_text() == "") {
					var this1 = this._access.varString;
					var key = this._access.parser.parseString(this._setVarName.get_text());
					if(Object.prototype.hasOwnProperty.call(this1.h,key)) {
						var this1 = this._access.varString;
						var key = this._access.parser.parseString(this._setVarName.get_text());
						var _this = this1;
						if(Object.prototype.hasOwnProperty.call(_this.h,key)) {
							delete(_this.h[key]);
						}
					}
				} else {
					var this1 = this._access.varString;
					var k = this._access.parser.parseString(this._setVarName.get_text());
					var v = this._access.parser.parseString(this._setVarValue.get_text());
					this1.h[k] = v;
				}
			}
		}
		this.setVarText();
	}
	,onTraceVar: function(evt) {
		haxe_Log.trace(haxe_format_JsonPrinter.print({ string : this._access.varString, float : this._access.varFloat, int : this._access.varInt, bool : this._access.varBool},null,null),{ fileName : "Source/plugins/DebugPlugin.hx", lineNumber : 1034, className : "plugins.DebugPlugin", methodName : "onTraceVar"});
	}
	,onRefreshVar: function(evt) {
		this.setVarText();
	}
	,onSetString: function(evt) {
		this._varType = "string";
		this._varTxt.set_htmlText("<b>String variables</b>");
		this._setvarTxt.set_htmlText("<b>Set string value (set to empty field to remove it)</b>");
		this._setVarName.set_text("");
		this._setVarValue.set_text("");
		this.setVarText();
	}
	,onSetFloat: function(evt) {
		this._varType = "float";
		this._varTxt.set_htmlText("<b>Float variables</b>");
		this._setvarTxt.set_htmlText("<b>Set float value (set to empty field to remove it)</b>");
		this._setVarName.set_text("");
		this._setVarValue.set_text("");
		this.setVarText();
	}
	,onSetInt: function(evt) {
		this._varType = "int";
		this._varTxt.set_htmlText("<b>Int variables</b>");
		this._setvarTxt.set_htmlText("<b>Set int value (set to empty field to remove it)</b>");
		this._setVarName.set_text("");
		this._setVarValue.set_text("");
		this.setVarText();
	}
	,onSetBool: function(evt) {
		this._varType = "bool";
		this._varTxt.set_htmlText("<b>Bool variables</b>");
		this._setvarTxt.set_htmlText("<b>Set bool value (set to empty field to remove it)</b>");
		this._setVarName.set_text("");
		this._setVarValue.set_text("");
		this.setVarText();
	}
	,onRunAction: function(evt) {
		if(this._actionArea.get_text() != "") {
			this._access.parser.run(this._actionArea.get_text());
		}
	}
	,placeInterface: function() {
		switch(this._intPos) {
		case 0:
			this._infoArea.set_x(10);
			this._infoArea.set_y(10);
			if(this.info.orientation == "vertical") {
				this._fpsHolder.set_x(10);
				this._fpsHolder.set_y(this.info.displayBigger - 30 - 10);
			} else {
				this._fpsHolder.set_x(10);
				this._fpsHolder.set_y(this.info.displaySmaller - 30 - 10);
			}
			break;
		case 1:
			if(this.info.orientation == "vertical") {
				this._infoArea.set_x(this.info.displaySmaller - this._infoArea.get_width() - 10);
				this._infoArea.set_y(10);
			} else {
				this._infoArea.set_x(this.info.displayBigger - this._infoArea.get_width() - 10);
				this._infoArea.set_y(10);
			}
			this._fpsHolder.set_x(10);
			this._fpsHolder.set_y(10);
			break;
		case 2:
			if(this.info.orientation == "vertical") {
				this._infoArea.set_x(this.info.displaySmaller - this._infoArea.get_width() - 10);
				this._infoArea.set_y(this.info.displayBigger - this._infoArea.get_height() - 10);
				this._fpsHolder.set_x(this.info.displaySmaller - 65 - 10);
				this._fpsHolder.set_y(10);
			} else {
				this._infoArea.set_x(this.info.displayBigger - this._infoArea.get_width() - 10);
				this._infoArea.set_y(this.info.displaySmaller - this._infoArea.get_height() - 10);
				this._fpsHolder.set_x(this.info.displayBigger - 65 - 10);
				this._fpsHolder.set_y(10);
			}
			break;
		case 3:
			if(this.info.orientation == "vertical") {
				this._infoArea.set_x(10);
				this._infoArea.set_y(this.info.displayBigger - this._infoArea.get_height() - 10);
				this._fpsHolder.set_x(this.info.displaySmaller - 65 - 10);
				this._fpsHolder.set_y(this.info.displayBigger - 30 - 10);
			} else {
				this._infoArea.set_x(10);
				this._infoArea.set_y(this.info.displaySmaller - this._infoArea.get_height() - 10);
				this._fpsHolder.set_x(this.info.displayBigger - 65 - 10);
				this._fpsHolder.set_y(this.info.displaySmaller - 30 - 10);
			}
			break;
		}
	}
	,__class__: plugins_DebugPlugin
});
var plugins_GoogleAnalyticsPlugin = function() {
	this._firstsent = false;
	com_tilbuci_plugin_Plugin.call(this,"google-analytics","Google Analytics","GoogleAnalytics",true,false);
};
$hxClasses["plugins.GoogleAnalyticsPlugin"] = plugins_GoogleAnalyticsPlugin;
plugins_GoogleAnalyticsPlugin.__name__ = "plugins.GoogleAnalyticsPlugin";
plugins_GoogleAnalyticsPlugin.__super__ = com_tilbuci_plugin_Plugin;
plugins_GoogleAnalyticsPlugin.prototype = $extend(com_tilbuci_plugin_Plugin.prototype,{
	_confWindow: null
	,_firstsent: null
	,initialize: function(ac) {
		com_tilbuci_plugin_Plugin.prototype.initialize.call(this,ac);
		this.addMenu("Analytics",$bind(this,this.onAnalytics));
		this._confWindow = new com_tilbuci_plugin_PluginWindow("Google Analytics",500,150);
		this._confWindow.addForm("config",this._confWindow.ui.forge("config",[{ tp : "Label", id : "measurement", tx : "Measurement ID", vr : ""},{ tp : "TInput", id : "measurement", tx : "", vr : ""},{ tp : "Button", id : "measurement", tx : "Update configuration", ac : $bind(this,this.onUpdate)}]));
		this._confWindow.startInterface();
		this.info.addEventListener("movieload",$bind(this,this.onMovieLoad));
		this.info.addEventListener("sceneload",$bind(this,this.onSceneLoad));
		this.setAction("analytics.event",$bind(this,this.acEvent));
	}
	,kill: function() {
		com_tilbuci_plugin_Plugin.prototype.kill.call(this);
		this.info.removeEventListener("movieload",$bind(this,this.onMovieLoad));
		this.info.removeEventListener("sceneload",$bind(this,this.onSceneLoad));
		this._confWindow.kill();
		this._confWindow = null;
	}
	,acEvent: function(param) {
		if(param.length >= 2) {
			var ok = false;
			try {
				window.gtag("event",this._access.parser.parseString(param[0]),{ "movie_name" : com_tilbuci_data_GlobalPlayer.mdata.title, "scene_name" : com_tilbuci_data_GlobalPlayer.movie.scene.title, "movie_id" : com_tilbuci_data_GlobalPlayer.movie.get_mvId(), "scene_id" : com_tilbuci_data_GlobalPlayer.movie.get_scId(), "about" : this._access.parser.parseString(param[1])});
				ok = true;
			} catch( _g ) {
				ok = false;
			}
			return ok;
		} else {
			return false;
		}
	}
	,onAnalytics: function(evt) {
		if(com_tilbuci_data_Global.ws.get_level() == 0) {
			if(Object.prototype.hasOwnProperty.call(this.config.h,"measurementid")) {
				this._confWindow.ui.inputs.h["measurement"].set_text(this.config.h["measurementid"]);
			}
			this.showWindow(this._confWindow);
		} else {
			com_tilbuci_data_Global.showPopup("Google Analytics","This configuration is only available to system administrators.",320,180,"OK","warn");
		}
	}
	,onUpdate: function(evt) {
		var this1 = this.config;
		var v = this._confWindow.ui.inputs.h["measurement"].get_text();
		this1.h["measurementid"] = v;
		this.updateConfig($bind(this,this.onUpdateFinish));
	}
	,onUpdateFinish: function(ok,ld) {
		if(!ok) {
			com_tilbuci_data_Global.showPopup("Google Analytics","Error while saving the plugin configuration.",320,180,"OK");
		} else if(ld.map.h["e"] != 0) {
			com_tilbuci_data_Global.showPopup("Google Analytics","Error while saving the plugin configuration.",320,180,"OK");
		} else {
			com_tilbuci_data_Global.showMsg("The Google Analytics configuration was updated.");
			this.hideWindow(this._confWindow);
		}
	}
	,onMovieLoad: function(evt) {
		if(com_tilbuci_data_GlobalPlayer.mode == "player" && Object.prototype.hasOwnProperty.call(this.config.h,"measurementid")) {
			this._firstsent = true;
			try {
				window.gtag("set","campaign",{ "id" : com_tilbuci_data_GlobalPlayer.movie.get_mvId(), "name" : com_tilbuci_data_GlobalPlayer.mdata.title, "source" : com_tilbuci_data_GlobalPlayer.base});
				window.gtag("event","movie.load",{ "movie_id" : com_tilbuci_data_GlobalPlayer.movie.get_mvId(), "movie_name" : com_tilbuci_data_GlobalPlayer.mdata.title});
			} catch( _g ) {
			}
		}
	}
	,onSceneLoad: function(evt) {
		if(!this._firstsent) {
			this.onMovieLoad(null);
		}
		if(com_tilbuci_data_GlobalPlayer.mode == "player" && Object.prototype.hasOwnProperty.call(this.config.h,"measurementid")) {
			try {
				window.gtag("event","scene.load",{ "scene_id" : com_tilbuci_data_GlobalPlayer.movie.get_scId(), "scene_name" : com_tilbuci_data_GlobalPlayer.movie.scene.title, "movie_id" : com_tilbuci_data_GlobalPlayer.movie.get_mvId(), "movie_name" : com_tilbuci_data_GlobalPlayer.mdata.title});
			} catch( _g ) {
			}
		}
	}
	,__class__: plugins_GoogleAnalyticsPlugin
});
var plugins_OverlayPlugin = function() {
	com_tilbuci_plugin_Plugin.call(this,"overlay","Overlay","Overlay",true,true);
};
$hxClasses["plugins.OverlayPlugin"] = plugins_OverlayPlugin;
plugins_OverlayPlugin.__name__ = "plugins.OverlayPlugin";
plugins_OverlayPlugin.overlay_return = $hx_exports["overlay_return"] = function() {
	if(plugins_OverlayPlugin.overlayInfo != null) {
		var tmp = com_tilbuci_data_GlobalPlayer.ws;
		var _g = new haxe_ds_StringMap();
		_g.h["key"] = plugins_OverlayPlugin.overlayInfo.key;
		tmp.send("Overlay/LoadKey",_g,plugins_OverlayPlugin.onkeyLoaded);
	}
};
plugins_OverlayPlugin.onkeyLoaded = function(ok,ld) {
	if(ok) {
		if(ld.map.h["e"] == 0) {
			if(ld.map.h["key"] != "") {
				if(ld.map.h["ret"] != "") {
					var json = com_tilbuci_statictools_StringStatic.jsonParse(ld.map.h["ret"]);
					if(json == false) {
						if(plugins_OverlayPlugin.overlayInfo.onerror != null) {
							plugins_OverlayPlugin.overlayInfo.parser.run(plugins_OverlayPlugin.overlayInfo.onerror,true);
						}
					} else {
						var _g = 0;
						var _g1 = Reflect.fields(json);
						while(_g < _g1.length) {
							var k = _g1[_g];
							++_g;
							var vval = Reflect.field(json,k);
							if(Object.prototype.hasOwnProperty.call(vval,"t") && Object.prototype.hasOwnProperty.call(vval,"v")) {
								switch(Reflect.field(vval,"t")) {
								case "B":
									plugins_OverlayPlugin.overlayInfo.parser.setBool(k,Reflect.field(vval,"v"));
									break;
								case "F":
									plugins_OverlayPlugin.overlayInfo.parser.setFloat(k,Reflect.field(vval,"v"));
									break;
								case "I":
									plugins_OverlayPlugin.overlayInfo.parser.setInt(k,Reflect.field(vval,"v"));
									break;
								case "S":
									plugins_OverlayPlugin.overlayInfo.parser.setString(k,Reflect.field(vval,"v"));
									break;
								}
							}
						}
					}
				}
				if(plugins_OverlayPlugin.overlayInfo.onsuccess != null) {
					plugins_OverlayPlugin.overlayInfo.parser.run(plugins_OverlayPlugin.overlayInfo.onsuccess,true);
				}
			} else if(plugins_OverlayPlugin.overlayInfo.onerror != null) {
				plugins_OverlayPlugin.overlayInfo.parser.run(plugins_OverlayPlugin.overlayInfo.onerror,true);
			}
		} else if(plugins_OverlayPlugin.overlayInfo.onerror != null) {
			plugins_OverlayPlugin.overlayInfo.parser.run(plugins_OverlayPlugin.overlayInfo.onerror,true);
		}
	} else if(plugins_OverlayPlugin.overlayInfo.onerror != null) {
		plugins_OverlayPlugin.overlayInfo.parser.run(plugins_OverlayPlugin.overlayInfo.onerror,true);
	}
	plugins_OverlayPlugin.overlayInfo = null;
};
plugins_OverlayPlugin.__super__ = com_tilbuci_plugin_Plugin;
plugins_OverlayPlugin.prototype = $extend(com_tilbuci_plugin_Plugin.prototype,{
	_confWindow: null
	,initialize: function(ac) {
		com_tilbuci_plugin_Plugin.prototype.initialize.call(this,ac);
		this.addMenu("Overlay",$bind(this,this.onOverlay));
		this._confWindow = new com_tilbuci_plugin_PluginWindow("Overlay",500,150);
		this._confWindow.addForm("config",this._confWindow.ui.forge("config",[{ tp : "Label", id : "overlay", tx : "Secret KEY for server communication", vr : ""},{ tp : "TInput", id : "overlay", tx : "", vr : ""},{ tp : "Button", id : "overlay", tx : "Update configuration", ac : $bind(this,this.onUpdate)}]));
		this._confWindow.startInterface();
		this.setAction("overlay.show",$bind(this,this.getKey));
	}
	,kill: function() {
		com_tilbuci_plugin_Plugin.prototype.kill.call(this);
		this._confWindow.kill();
		this._confWindow = null;
	}
	,getKey: function(param,after) {
		if(param.length >= 2) {
			plugins_OverlayPlugin.overlayInfo = null;
			var addget = "0";
			if(param.length >= 3) {
				if(this._access.parser.parseBool(param[2])) {
					addget = "1";
				}
			}
			var data = new haxe_ds_StringMap();
			if(param.length >= 4) {
				var _g = 3;
				var _g1 = param.length;
				while(_g < _g1) {
					var p = _g++;
					var v = this._access.parser.parseString(param[p]);
					data.h["v" + (p - 2)] = v;
				}
			}
			var tmp = com_tilbuci_data_GlobalPlayer.ws;
			var _g = new haxe_ds_StringMap();
			var value = this._access.parser.parseString(param[0]);
			_g.h["url"] = value;
			var value = this._access.parser.parseString(param[1]);
			_g.h["title"] = value;
			_g.h["addget"] = addget;
			var value = com_tilbuci_statictools_StringStatic.jsonStringify(data);
			_g.h["data"] = value;
			tmp.send("Overlay/GetKey",_g,$bind(this,this.onKeyReturn),after);
			return true;
		} else {
			return false;
		}
	}
	,onKeyReturn: function(ok,ld) {
		var after = ld.extra;
		if(ok) {
			if(ld.map.h["e"] == 0) {
				if(ld.map.h["key"] != "") {
					plugins_OverlayPlugin.overlayInfo = { key : ld.map.h["key"], onerror : after.onerror, onsuccess : after.onsuccess, parser : this._access.parser};
					var url = Std.string(ld.map.h["url"]) + "?key=" + Std.string(ld.map.h["key"]);
					if(ld.map.h["addget"] == "1") {
						var dmap = com_tilbuci_statictools_StringStatic.jsonAsMap(ld.map.h["data"]);
						var h = dmap.h;
						var k_h = h;
						var k_keys = Object.keys(h);
						var k_length = k_keys.length;
						var k_current = 0;
						while(k_current < k_length) {
							var k = k_keys[k_current++];
							var s = dmap.h[k];
							url += "&" + k + "=" + encodeURIComponent(s);
						}
					}
					try {
						window.overlay_place(url,ld.map.h["title"]);
					} catch( _g ) {
					}
				} else if(after.onerror != null) {
					this._access.parser.run(after.onerror,true);
				}
			} else if(after.onerror != null) {
				this._access.parser.run(after.onerror,true);
			}
		} else if(after.onerror != null) {
			this._access.parser.run(after.onerror,true);
		}
	}
	,onOverlay: function(evt) {
		if(com_tilbuci_data_Global.ws.get_level() == 0) {
			if(Object.prototype.hasOwnProperty.call(this.config.h,"overlay")) {
				this._confWindow.ui.inputs.h["overlay"].set_text(this.config.h["overlay"]);
			}
			this.showWindow(this._confWindow);
		} else {
			com_tilbuci_data_Global.showPopup("Overlay","This configuration is only available to system administrators.",320,180,"OK","warn");
		}
	}
	,onUpdate: function(evt) {
		var this1 = this.config;
		var v = this._confWindow.ui.inputs.h["overlay"].get_text();
		this1.h["overlay"] = v;
		this.updateConfig($bind(this,this.onUpdateFinish));
	}
	,onUpdateFinish: function(ok,ld) {
		if(!ok) {
			com_tilbuci_data_Global.showPopup("Overlay","Error while saving the plugin configuration.",320,180,"OK");
		} else if(ld.map.h["e"] != 0) {
			com_tilbuci_data_Global.showPopup("Overlay","Error while saving the plugin configuration.",320,180,"OK");
		} else {
			com_tilbuci_data_Global.showMsg("The overlay configuration was updated.");
			this.hideWindow(this._confWindow);
		}
	}
	,__class__: plugins_OverlayPlugin
});
var plugins_ServerCallPlugin = function() {
	com_tilbuci_plugin_Plugin.call(this,"server-call","Server Call","ServerCall",false,true);
};
$hxClasses["plugins.ServerCallPlugin"] = plugins_ServerCallPlugin;
plugins_ServerCallPlugin.__name__ = "plugins.ServerCallPlugin";
plugins_ServerCallPlugin.__super__ = com_tilbuci_plugin_Plugin;
plugins_ServerCallPlugin.prototype = $extend(com_tilbuci_plugin_Plugin.prototype,{
	initialize: function(ac) {
		com_tilbuci_plugin_Plugin.prototype.initialize.call(this,ac);
		this.setAction("call.url",$bind(this,this.acUrl));
		this.setAction("call.process",$bind(this,this.acProcess));
		this.setAction("call.sdprocess",$bind(this,this.acSdProcess));
	}
	,kill: function() {
		com_tilbuci_plugin_Plugin.prototype.kill.call(this);
	}
	,acUrl: function(param,after) {
		if(param.length > 0) {
			var strvar = "";
			if(param.length > 1) {
				strvar = this._access.parser.parseString(param[1]);
			}
			var tmp = com_tilbuci_data_GlobalPlayer.ws;
			var _g = new haxe_ds_StringMap();
			var value = this._access.parser.parseString(param[0]);
			_g.h["url"] = value;
			_g.h["var"] = strvar;
			tmp.send("ServerCall/Url",_g,$bind(this,this.onCallReturn),after);
			return true;
		} else {
			return false;
		}
	}
	,onCallReturn: function(ok,ld) {
		var after = ld.extra;
		if(ok) {
			if(ld.map.h["e"] == 0) {
				if(ld.map.h["var"] != "") {
					this._access.parser.setString(ld.map.h["var"],ld.map.h["resp"]);
				}
				if(after.onsuccess != null) {
					this._access.parser.run(after.onsuccess,true);
				}
			} else if(after.onerror != null) {
				this._access.parser.run(after.onerror,true);
			}
		} else if(after.onerror != null) {
			this._access.parser.run(after.onerror,true);
		}
	}
	,acProcess: function(param,after) {
		if(param.length > 0) {
			var prData = [];
			if(param.length > 1) {
				var _g = 1;
				var _g1 = param.length;
				while(_g < _g1) {
					var i = _g++;
					prData.push(this._access.parser.parseString(param[i]));
				}
			}
			var tmp = com_tilbuci_data_GlobalPlayer.ws;
			var _g = new haxe_ds_StringMap();
			var value = this._access.parser.parseString(param[0]);
			_g.h["url"] = value;
			var value = com_tilbuci_statictools_StringStatic.jsonStringify(prData);
			_g.h["data"] = value;
			var value = com_tilbuci_data_GlobalPlayer.movie.get_mvId();
			_g.h["movieid"] = value;
			var value = com_tilbuci_data_GlobalPlayer.movie.get_scId();
			_g.h["sceneid"] = value;
			_g.h["movietitle"] = com_tilbuci_data_GlobalPlayer.mdata.title;
			_g.h["scenetitle"] = com_tilbuci_data_GlobalPlayer.movie.scene.title;
			var value = com_tilbuci_data_GlobalPlayer.ws.get_user();
			_g.h["visitor"] = value;
			tmp.send("ServerCall/Process",_g,$bind(this,this.onProcessReturn),after);
			return true;
		} else {
			return false;
		}
	}
	,acSdProcess: function(param,after) {
		if(param.length > 0) {
			var prData = [];
			if(param.length > 1) {
				var _g = 1;
				var _g1 = param.length;
				while(_g < _g1) {
					var i = _g++;
					prData.push(this._access.parser.parseString(param[i]));
				}
			}
			var tmp = this._access.parser.parseString(param[0]);
			var _g = new haxe_ds_StringMap();
			var value = com_tilbuci_statictools_StringStatic.jsonStringify(prData);
			_g.h["data"] = value;
			var value = com_tilbuci_data_GlobalPlayer.movie.get_mvId();
			_g.h["movieid"] = value;
			var value = com_tilbuci_data_GlobalPlayer.movie.get_scId();
			_g.h["sceneid"] = value;
			_g.h["movietitle"] = com_tilbuci_data_GlobalPlayer.mdata.title;
			_g.h["scenetitle"] = com_tilbuci_data_GlobalPlayer.movie.scene.title;
			var value = com_tilbuci_data_GlobalPlayer.ws.get_user();
			_g.h["visitor"] = value;
			new com_tilbuci_data_DataLoader(true,tmp,"POST",_g,3,$bind(this,this.onSdProcessReturn),null,null,null,null,after);
			return true;
		} else {
			return false;
		}
	}
	,onProcessReturn: function(ok,ld) {
		var after = ld.extra;
		if(ok) {
			if(ld.map.h["e"] == 0) {
				if(ld.map.h["resp"] != "") {
					var json = com_tilbuci_statictools_StringStatic.jsonParse(ld.map.h["resp"]);
					if(json == false) {
						if(after.onerror != null) {
							this._access.parser.run(after.onerror,true);
						}
					} else {
						var _g = 0;
						var _g1 = Reflect.fields(json);
						while(_g < _g1.length) {
							var k = _g1[_g];
							++_g;
							var vval = Reflect.field(json,k);
							if(Object.prototype.hasOwnProperty.call(vval,"t") && Object.prototype.hasOwnProperty.call(vval,"v")) {
								switch(Reflect.field(vval,"t")) {
								case "B":
									this._access.parser.setBool(k,Reflect.field(vval,"v"));
									break;
								case "F":
									this._access.parser.setFloat(k,Reflect.field(vval,"v"));
									break;
								case "I":
									this._access.parser.setInt(k,Reflect.field(vval,"v"));
									break;
								case "S":
									this._access.parser.setString(k,Reflect.field(vval,"v"));
									break;
								}
							}
						}
						if(after.onsuccess != null) {
							this._access.parser.run(after.onsuccess,true);
						}
					}
				}
			} else if(after.onerror != null) {
				this._access.parser.run(after.onerror,true);
			}
		} else if(after.onerror != null) {
			this._access.parser.run(after.onerror,true);
		}
	}
	,onSdProcessReturn: function(ok,ld) {
		var after = ld.extra;
		if(ok) {
			var _g = 0;
			var _g1 = Reflect.fields(ld.json);
			while(_g < _g1.length) {
				var k = _g1[_g];
				++_g;
				var vval = Reflect.field(ld.json,k);
				if(Object.prototype.hasOwnProperty.call(vval,"t") && Object.prototype.hasOwnProperty.call(vval,"v")) {
					switch(Reflect.field(vval,"t")) {
					case "B":
						this._access.parser.setBool(k,Reflect.field(vval,"v"));
						break;
					case "F":
						this._access.parser.setFloat(k,Reflect.field(vval,"v"));
						break;
					case "I":
						this._access.parser.setInt(k,Reflect.field(vval,"v"));
						break;
					case "S":
						this._access.parser.setString(k,Reflect.field(vval,"v"));
						break;
					}
				}
			}
			if(after.onsuccess != null) {
				this._access.parser.run(after.onsuccess,true);
			}
		} else if(after.onerror != null) {
			this._access.parser.run(after.onerror,true);
		}
	}
	,__class__: plugins_ServerCallPlugin
});
var plugins_SharePlugin = function() {
	com_tilbuci_plugin_Plugin.call(this,"original.share","Share");
};
$hxClasses["plugins.SharePlugin"] = plugins_SharePlugin;
plugins_SharePlugin.__name__ = "plugins.SharePlugin";
plugins_SharePlugin.__super__ = com_tilbuci_plugin_Plugin;
plugins_SharePlugin.prototype = $extend(com_tilbuci_plugin_Plugin.prototype,{
	_overlay: null
	,initialize: function(ac) {
		com_tilbuci_plugin_Plugin.prototype.initialize.call(this,ac);
		this._overlay = this.getOverlay("original.share");
		this.setAction("share.facebook",$bind(this,this.acFacebook));
		this.setAction("share.linkedin",$bind(this,this.acLinkedin));
		this.setAction("share.pinterest",$bind(this,this.acPinterest));
		this.setAction("share.reddit",$bind(this,this.acReddit));
		this.setAction("share.x",$bind(this,this.acX));
	}
	,kill: function() {
		this.removeOverlay("original.share");
		this._overlay = null;
		com_tilbuci_plugin_Plugin.prototype.kill.call(this);
	}
	,acFacebook: function(param,after) {
		if(param.length > 0 && this._access.parser.parseBool(param[0])) {
			var s = com_tilbuci_data_GlobalPlayer.base + "app/?mv=" + com_tilbuci_data_GlobalPlayer.movie.get_mvId();
			var req = new openfl_net_URLRequest("https://www.facebook.com/sharer/sharer.php?u=" + encodeURIComponent(s));
			req.method = "GET";
			openfl_Lib.getURL(req);
		} else if(com_tilbuci_data_GlobalPlayer.share == "scene") {
			var s = com_tilbuci_data_GlobalPlayer.base + "app/?mv=" + com_tilbuci_data_GlobalPlayer.movie.get_mvId() + "&sc=" + com_tilbuci_data_GlobalPlayer.movie.get_scId();
			var req = new openfl_net_URLRequest("https://www.facebook.com/sharer/sharer.php?u=" + encodeURIComponent(s));
			req.method = "GET";
			openfl_Lib.getURL(req);
		} else {
			var s = com_tilbuci_data_GlobalPlayer.base + "app/?mv=" + com_tilbuci_data_GlobalPlayer.movie.get_mvId();
			var req = new openfl_net_URLRequest("https://www.facebook.com/sharer/sharer.php?u=" + encodeURIComponent(s));
			req.method = "GET";
			openfl_Lib.getURL(req);
		}
		return true;
	}
	,acLinkedin: function(param,after) {
		if(param.length > 0 && this._access.parser.parseBool(param[0])) {
			var s = com_tilbuci_data_GlobalPlayer.base + "app/?mv=" + com_tilbuci_data_GlobalPlayer.movie.get_mvId();
			var req = new openfl_net_URLRequest("https://www.linkedin.com/shareArticle?mini=true&url=" + encodeURIComponent(s));
			req.method = "GET";
			openfl_Lib.getURL(req);
		} else if(com_tilbuci_data_GlobalPlayer.share == "scene") {
			var s = com_tilbuci_data_GlobalPlayer.base + "app/?mv=" + com_tilbuci_data_GlobalPlayer.movie.get_mvId() + "&sc=" + com_tilbuci_data_GlobalPlayer.movie.get_scId();
			var req = new openfl_net_URLRequest("https://www.linkedin.com/shareArticle?mini=true&url=" + encodeURIComponent(s));
			req.method = "GET";
			openfl_Lib.getURL(req);
		} else {
			var s = com_tilbuci_data_GlobalPlayer.base + "app/?mv=" + com_tilbuci_data_GlobalPlayer.movie.get_mvId();
			var req = new openfl_net_URLRequest("https://www.linkedin.com/shareArticle?mini=true&url=" + encodeURIComponent(s));
			req.method = "GET";
			openfl_Lib.getURL(req);
		}
		return true;
	}
	,acPinterest: function(param,after) {
		if(param.length > 0 && this._access.parser.parseBool(param[0])) {
			var s = com_tilbuci_data_GlobalPlayer.base + "app/?mv=" + com_tilbuci_data_GlobalPlayer.movie.get_mvId();
			var req = new openfl_net_URLRequest("https://pinterest.com/pin/create/button/?url=" + encodeURIComponent(s));
			req.method = "GET";
			openfl_Lib.getURL(req);
		} else if(com_tilbuci_data_GlobalPlayer.share == "scene") {
			var s = com_tilbuci_data_GlobalPlayer.base + "app/?mv=" + com_tilbuci_data_GlobalPlayer.movie.get_mvId() + "&sc=" + com_tilbuci_data_GlobalPlayer.movie.get_scId();
			var req = new openfl_net_URLRequest("https://pinterest.com/pin/create/button/?url=" + encodeURIComponent(s));
			req.method = "GET";
			openfl_Lib.getURL(req);
		} else {
			var s = com_tilbuci_data_GlobalPlayer.base + "app/?mv=" + com_tilbuci_data_GlobalPlayer.movie.get_mvId();
			var req = new openfl_net_URLRequest("https://pinterest.com/pin/create/button/?url=" + encodeURIComponent(s));
			req.method = "GET";
			openfl_Lib.getURL(req);
		}
		return true;
	}
	,acReddit: function(param,after) {
		if(param.length > 0 && this._access.parser.parseBool(param[0])) {
			var s = com_tilbuci_data_GlobalPlayer.base + "app/?mv=" + com_tilbuci_data_GlobalPlayer.movie.get_mvId();
			var req = new openfl_net_URLRequest("https://www.reddit.com/submit?url=" + encodeURIComponent(s));
			req.method = "GET";
			openfl_Lib.getURL(req);
		} else if(com_tilbuci_data_GlobalPlayer.share == "scene") {
			var s = com_tilbuci_data_GlobalPlayer.base + "app/?mv=" + com_tilbuci_data_GlobalPlayer.movie.get_mvId() + "&sc=" + com_tilbuci_data_GlobalPlayer.movie.get_scId();
			var req = new openfl_net_URLRequest("https://www.reddit.com/submit?url=" + encodeURIComponent(s));
			req.method = "GET";
			openfl_Lib.getURL(req);
		} else {
			var s = com_tilbuci_data_GlobalPlayer.base + "app/?mv=" + com_tilbuci_data_GlobalPlayer.movie.get_mvId();
			var req = new openfl_net_URLRequest("https://www.reddit.com/submit?url=" + encodeURIComponent(s));
			req.method = "GET";
			openfl_Lib.getURL(req);
		}
		return true;
	}
	,acX: function(param,after) {
		if(param.length > 0 && this._access.parser.parseBool(param[0])) {
			var s = com_tilbuci_data_GlobalPlayer.base + "app/?mv=" + com_tilbuci_data_GlobalPlayer.movie.get_mvId();
			var req = new openfl_net_URLRequest("https://twitter.com/intent/tweet?url=" + encodeURIComponent(s));
			req.method = "GET";
			openfl_Lib.getURL(req);
		} else if(com_tilbuci_data_GlobalPlayer.share == "scene") {
			var s = com_tilbuci_data_GlobalPlayer.base + "app/?mv=" + com_tilbuci_data_GlobalPlayer.movie.get_mvId() + "&sc=" + com_tilbuci_data_GlobalPlayer.movie.get_scId();
			var req = new openfl_net_URLRequest("https://twitter.com/intent/tweet?url=" + encodeURIComponent(s));
			req.method = "GET";
			openfl_Lib.getURL(req);
		} else {
			var s = com_tilbuci_data_GlobalPlayer.base + "app/?mv=" + com_tilbuci_data_GlobalPlayer.movie.get_mvId();
			var req = new openfl_net_URLRequest("https://twitter.com/intent/tweet?url=" + encodeURIComponent(s));
			req.method = "GET";
			openfl_Lib.getURL(req);
		}
		return true;
	}
	,__class__: plugins_SharePlugin
});
function $getIterator(o) { if( o instanceof Array ) return new haxe_iterators_ArrayIterator(o); else return o.iterator(); }
function $getKeyValueIterator(o) { if( o instanceof Array ) return HxOverrides.keyValueIter(o); else return o.keyValueIterator(); }
function $bind(o,m) { if( m == null ) return null; if( m.__id__ == null ) m.__id__ = $global.$haxeUID++; var f; if( o.hx__closures__ == null ) o.hx__closures__ = {}; else f = o.hx__closures__[m.__id__]; if( f == null ) { f = m.bind(o); o.hx__closures__[m.__id__] = f; } return f; }
$global.$haxeUID |= 0;
var _init = lime__$internal_backend_html5_HTML5Application;
var init = lime_app_Application;
if(typeof(performance) != "undefined" ? typeof(performance.now) == "function" : false) {
	HxOverrides.now = performance.now.bind(performance);
}
$hxClasses["Math"] = Math;
if( String.fromCodePoint == null ) String.fromCodePoint = function(c) { return c < 0x10000 ? String.fromCharCode(c) : String.fromCharCode((c>>10)+0xD7C0)+String.fromCharCode((c&0x3FF)+0xDC00); }
Object.defineProperty(String.prototype,"__class__",{ value : $hxClasses["String"] = String, enumerable : false, writable : true});
String.__name__ = "String";
$hxClasses["Array"] = Array;
Array.__name__ = "Array";
Date.prototype.__class__ = $hxClasses["Date"] = Date;
Date.__name__ = "Date";
var Int = { };
var Dynamic = { };
var Float = Number;
var Bool = Boolean;
var Class = { };
var Enum = { };
js_Boot.__toStr = ({ }).toString;
if(ArrayBuffer.prototype.slice == null) {
	ArrayBuffer.prototype.slice = js_lib__$ArrayBuffer_ArrayBufferCompat.sliceImpl;
}
if(typeof window == "undefined") {
	$global.onmessage = function(event) {
		var job = event.data;
		try {
			$global.onmessage = ($_=lime__$internal_backend_html5_HTML5Thread.__current,$bind($_,$_.dispatchMessage));
			(lime__$internal_backend_html5_WorkFunction.toFunction(job))();
		} catch( _g ) {
			haxe_NativeStackTrace.lastError = _g;
			lime__$internal_backend_html5_HTML5Thread.__current.destroy();
		}
	};
}
var array = null;
var vector = null;
var view = null;
var buffer = null;
var len = null;
lime_math_RGBA.__alpha16 = new Uint32Array(256);
var _g = 0;
while(_g < 256) {
	var i = _g++;
	lime_math_RGBA.__alpha16[i] = Math.ceil(i * 257.00392156862745);
}
var array = null;
var vector = null;
var view = null;
var buffer = null;
var len = null;
lime_math_RGBA.__clamp = new Uint8Array(511);
var _g = 0;
while(_g < 255) {
	var i = _g++;
	lime_math_RGBA.__clamp[i] = i;
}
var _g = 255;
var _g1 = 511;
while(_g < _g1) {
	var i = _g++;
	lime_math_RGBA.__clamp[i] = 255;
}
lime_system_CFFI.available = false;
lime_system_CFFI.enabled = false;
lime_utils_Log.level = 3;
if(typeof console == "undefined") {
	console = {}
}
if(console.log == null) {
	console.log = function() {
	};
}
openfl_display_Loader.__registerDefaultLoaders();
openfl_display__$internal_CanvasGraphics.hitTestCanvas = js_Browser.get_supported() ? window.document.createElement("canvas") : null;
openfl_display__$internal_CanvasGraphics.hitTestContext = js_Browser.get_supported() ? openfl_display__$internal_CanvasGraphics.hitTestCanvas.getContext("2d") : null;
openfl_ui_Multitouch.maxTouchPoints = 2;
openfl_ui_Multitouch.supportedGestures = null;
openfl_ui_Multitouch.supportsGestureEvents = false;
openfl_ui_Multitouch.inputMode = 2;
openfl_Vector.__meta__ = { statics : { toNullVector : { SuppressWarnings : ["checkstyle:Dynamic"]}}};
openfl_display_DisplayObject.__meta__ = { fields : { __cairo : { SuppressWarnings : ["checkstyle:Dynamic"]}, addEventListener : { SuppressWarnings : ["checkstyle:Dynamic"]}, removeEventListener : { SuppressWarnings : ["checkstyle:Dynamic"]}}};
openfl_display_DisplayObject.__broadcastEvents = new haxe_ds_StringMap();
openfl_display_DisplayObject.__instanceCount = 0;
openfl_display_DisplayObject.__tempStack = new lime_utils_ObjectPool(function() {
	return openfl_Vector.toObjectVector(null);
},function(stack) {
	stack.set_length(0);
});
feathers_core_FeathersControl.__meta__ = { fields : { layoutData : { style : null}, disabledAlpha : { style : null}, focusRectSkin : { style : null}, focusPaddingTop : { style : null}, focusPaddingRight : { style : null}, focusPaddingBottom : { style : null}, focusPaddingLeft : { style : null}}};
feathers_controls_LayoutGroup.__meta__ = { obj : { defaultXmlProperty : ["xmlContent"]}};
feathers_controls_LayoutGroup.VARIANT_TOOL_BAR = "toolBar";
DateTools.DAY_SHORT_NAMES = ["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];
DateTools.DAY_NAMES = ["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];
DateTools.MONTH_SHORT_NAMES = ["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];
DateTools.MONTH_NAMES = ["January","February","March","April","May","June","July","August","September","October","November","December"];
EReg.escapeRe = new RegExp("[.*+?^${}()|[\\]\\\\]","g");
Xml.Element = 0;
Xml.PCData = 1;
Xml.CData = 2;
Xml.Comment = 3;
Xml.DocType = 4;
Xml.ProcessingInstruction = 5;
Xml.Document = 6;
feathers_controls_Drawer.__meta__ = { obj : { defaultXmlProperty : ["content"]}};
feathers_controls_Drawer.MAX_CLICK_DISTANCE_FOR_CLOSE = 6.0;
com_tilbuci_Player.ORIENTATION_LANDSCAPE = "landscape";
com_tilbuci_Player.ORIENTATION_PORTRAIT = "portrait";
com_tilbuci_Player.MODE_PLAYER = "player";
com_tilbuci_Player.MODE_EDITOR = "editor";
com_tilbuci_Player.MODE_EDPLAYERWAIT = "editorplayerwait";
com_tilbuci_Player.MODE_EDPLAYER = "editorplayer";
com_tilbuci_data_DataLoader.MODEBINARY = 0;
com_tilbuci_data_DataLoader.MODETEXT = 1;
com_tilbuci_data_DataLoader.MODEJSON = 3;
com_tilbuci_data_DataLoader.MODEMAP = 4;
com_tilbuci_data_DataLoader.MODEBINTXT = 5;
com_tilbuci_data_DataLoader.MODEBINMAP = 6;
com_tilbuci_data_Global.AREASIZE_MAX = 3840;
com_tilbuci_data_Global.AREASIZE_MIN = 100;
com_tilbuci_data_Global.singleUser = false;
com_tilbuci_data_Global.userLevel = -1;
com_tilbuci_data_Global.validEmail = false;
com_tilbuci_data_Global.host = "";
com_tilbuci_data_Global.fonts = [];
com_tilbuci_data_Global.mvOwner = false;
com_tilbuci_data_Global.mvCollaborator = false;
com_tilbuci_data_Global.plugins = new haxe_ds_StringMap();
com_tilbuci_data_Global.temp = new haxe_ds_StringMap();
com_tilbuci_data_Global.displayType = "landscape";
com_tilbuci_data_Global.sceneToLoad = "";
com_tilbuci_data_Global.kfToLoad = -1;
com_tilbuci_data_Global.copy = new com_tilbuci_data_CopyData();
com_tilbuci_data_Global.testActions = "";
com_tilbuci_data_Global.testDelay = 0;
openfl_geom_Point.__pool = new lime_utils_ObjectPool(function() {
	return new openfl_geom_Point();
},function(p) {
	p.setTo(0,0);
});
openfl_geom_Matrix.__meta__ = { fields : { equals : { SuppressWarnings : ["checkstyle:FieldDocComment"]}, to3DString : { SuppressWarnings : ["checkstyle:FieldDocComment"]}, toMozString : { SuppressWarnings : ["checkstyle:FieldDocComment"]}}};
openfl_geom_Matrix.__identity = new openfl_geom_Matrix();
openfl_geom_Matrix.__pool = new lime_utils_ObjectPool(function() {
	return new openfl_geom_Matrix();
},function(m) {
	m.identity();
});
openfl_geom_Matrix.__matrix3 = lime_math_Matrix3._new();
openfl_geom_ColorTransform.__pool = new lime_utils_ObjectPool(function() {
	return new openfl_geom_ColorTransform();
},function(ct) {
	ct.__identity();
});
openfl_text_StyleSheet.__supportedStyles = ["color","display","font-family","font-size","font-style","font-weight","kerning","leading","letter-spacing","margin-left","margin-right","text-align","text-decoration","text-indent"];
com_tilbuci_data_GlobalPlayer.session = "";
com_tilbuci_data_GlobalPlayer.ready = false;
com_tilbuci_data_GlobalPlayer.mode = "player";
com_tilbuci_data_GlobalPlayer.render = "webgl";
com_tilbuci_data_GlobalPlayer.share = "scene";
com_tilbuci_data_GlobalPlayer.fps = "free";
com_tilbuci_data_GlobalPlayer.nocache = true;
com_tilbuci_data_GlobalPlayer.server = false;
com_tilbuci_data_GlobalPlayer.base = "";
com_tilbuci_data_GlobalPlayer.font = "";
com_tilbuci_data_GlobalPlayer.loadingMovie = "";
com_tilbuci_data_GlobalPlayer.multiply = 1;
com_tilbuci_data_GlobalPlayer.orientation = "horizontal";
com_tilbuci_data_GlobalPlayer.path = "";
com_tilbuci_data_GlobalPlayer.secretKey = "";
com_tilbuci_data_GlobalPlayer.plugins = new haxe_ds_StringMap();
com_tilbuci_data_GlobalPlayer.style = new openfl_text_StyleSheet();
com_tilbuci_data_GlobalPlayer.contraptions = new com_tilbuci_contraptions_Contraptions();
com_tilbuci_data_GlobalPlayer.narrative = new com_tilbuci_narrative_Narrative();
com_tilbuci_data_GlobalPlayer.mvActions = new haxe_ds_StringMap();
com_tilbuci_data_GlobalPlayer.contentPosition = new openfl_geom_Point();
com_tilbuci_data_GlobalPlayer.contentWidth = 0;
com_tilbuci_data_GlobalPlayer.contentHeight = 0;
com_tilbuci_data_GlobalPlayer.usingTarget = 0;
com_tilbuci_data_GlobalPlayer.cursorVisible = true;
com_tilbuci_data_GlobalPlayer.canTrigger = true;
com_tilbuci_data_GlobalPlayer.history = [];
openfl_events_Event.ACTIVATE = "activate";
openfl_events_Event.ADDED = "added";
openfl_events_Event.ADDED_TO_STAGE = "addedToStage";
openfl_events_Event.CANCEL = "cancel";
openfl_events_Event.CHANGE = "change";
openfl_events_Event.CLEAR = "clear";
openfl_events_Event.CLOSING = "closing";
openfl_events_Event.CLOSE = "close";
openfl_events_Event.COMPLETE = "complete";
openfl_events_Event.CONNECT = "connect";
openfl_events_Event.CONTEXT3D_CREATE = "context3DCreate";
openfl_events_Event.COPY = "copy";
openfl_events_Event.CUT = "cut";
openfl_events_Event.DEACTIVATE = "deactivate";
openfl_events_Event.ENTER_FRAME = "enterFrame";
openfl_events_Event.EXIT_FRAME = "exitFrame";
openfl_events_Event.EXITING = "exiting";
openfl_events_Event.FRAME_CONSTRUCTED = "frameConstructed";
openfl_events_Event.FRAME_LABEL = "frameLabel";
openfl_events_Event.FULLSCREEN = "fullScreen";
openfl_events_Event.ID3 = "id3";
openfl_events_Event.INIT = "init";
openfl_events_Event.MOUSE_LEAVE = "mouseLeave";
openfl_events_Event.OPEN = "open";
openfl_events_Event.PASTE = "paste";
openfl_events_Event.REMOVED = "removed";
openfl_events_Event.REMOVED_FROM_STAGE = "removedFromStage";
openfl_events_Event.RENDER = "render";
openfl_events_Event.RESIZE = "resize";
openfl_events_Event.SCROLL = "scroll";
openfl_events_Event.SELECT = "select";
openfl_events_Event.SELECT_ALL = "selectAll";
openfl_events_Event.SOUND_COMPLETE = "soundComplete";
openfl_events_Event.TAB_CHILDREN_CHANGE = "tabChildrenChange";
openfl_events_Event.TAB_ENABLED_CHANGE = "tabEnabledChange";
openfl_events_Event.TAB_INDEX_CHANGE = "tabIndexChange";
openfl_events_Event.TEXTURE_READY = "textureReady";
openfl_events_Event.UNLOAD = "unload";
com_tilbuci_event_TilBuciEvent.MOVIE_LOADED = "movie_loaded";
com_tilbuci_event_TilBuciEvent.SCENE_LOADED = "scene_loaded";
com_tilbuci_event_TilBuciEvent.EVENT = "event";
com_tilbuci_player_MovieArea.VORIENTATION = "vertical";
com_tilbuci_player_MovieArea.HORIENTATION = "horizontal";
com_tilbuci_player_MovieArea.SORIENTATION = "square";
com_tilbuci_plugin_PluginEvent.MOVIELOAD = "movieload";
com_tilbuci_plugin_PluginEvent.SCENELOAD = "sceneload";
com_tilbuci_plugin_PluginEvent.KEYFRAMELOAD = "keyframeload";
com_tilbuci_plugin_PluginEvent.DISPLAYRESIZE = "displayresize";
feathers_controls_BasicButton.__meta__ = { fields : { setSkinForState : { style : null}}};
feathers_controls_Button.__meta__ = { obj : { defaultXmlProperty : ["text"]}, fields : { setTextFormatForState : { style : null}, setIconForState : { style : null}}};
feathers_controls_Button.VARIANT_PRIMARY = "primary";
feathers_controls_Button.VARIANT_DANGER = "danger";
feathers_controls_supportClasses_BaseScrollBar.INVALIDATION_FLAG_DECREMENT_BUTTON_FACTORY = feathers_core_InvalidationFlag.CUSTOM("decrementButtonFactory");
feathers_controls_supportClasses_BaseScrollBar.INVALIDATION_FLAG_INCREMENT_BUTTON_FACTORY = feathers_core_InvalidationFlag.CUSTOM("incrementButtonFactory");
feathers_controls_supportClasses_BaseScrollBar.defaultDecrementButtonFactory = feathers_utils_DisplayObjectFactory.withClass(feathers_controls_Button);
feathers_controls_supportClasses_BaseScrollBar.defaultIncrementButtonFactory = feathers_utils_DisplayObjectFactory.withClass(feathers_controls_Button);
feathers_controls_HScrollBar.CHILD_VARIANT_DECREMENT_BUTTON = "hScrollBar_decrementButton";
feathers_controls_HScrollBar.CHILD_VARIANT_INCREMENT_BUTTON = "hScrollBar_incrementButton";
feathers_controls_VScrollBar.CHILD_VARIANT_DECREMENT_BUTTON = "vScrollBar_decrementButton";
feathers_controls_VScrollBar.CHILD_VARIANT_INCREMENT_BUTTON = "vScrollBar_incrementButton";
feathers_controls_supportClasses_BaseScrollContainer.INVALIDATION_FLAG_SCROLLER_FACTORY = feathers_core_InvalidationFlag.CUSTOM("scrollerFactory");
feathers_controls_supportClasses_BaseScrollContainer.INVALIDATION_FLAG_SCROLL_BAR_FACTORY = feathers_core_InvalidationFlag.CUSTOM("scrollBarFactory");
feathers_controls_supportClasses_BaseScrollContainer.defaultScrollBarXFactory = feathers_utils_DisplayObjectFactory.withClass(feathers_controls_HScrollBar);
feathers_controls_supportClasses_BaseScrollContainer.defaultScrollBarYFactory = feathers_utils_DisplayObjectFactory.withClass(feathers_controls_VScrollBar);
feathers_controls_ScrollContainer.__meta__ = { obj : { defaultXmlProperty : ["xmlContent"]}};
feathers_controls_supportClasses_BaseDividedBox.__meta__ = { obj : { defaultXmlProperty : ["xmlContent"]}};
feathers_controls_supportClasses_BaseDividedBox.POINTER_ID_MOUSE = -1000;
feathers_controls_supportClasses_BaseDividedBox.defaultDividerFactory = feathers_utils_DisplayObjectFactory.withFunction(function() {
	var divider = new openfl_display_Sprite();
	divider.get_graphics().beginFill(16711935,0.0);
	divider.get_graphics().drawRect(0.0,0.0,6.0,6.0);
	divider.get_graphics().endFill();
	return divider;
});
com_tilbuci_ui_base_ConfirmWindow.MODEWARN = "warn";
com_tilbuci_ui_base_ConfirmWindow.MODECONFIRM = "confirm";
moonshine_editor_text_TextEditor.CHILD_VARIANT_LIST_VIEW = "textEditor_listView";
feathers_controls_Label.__meta__ = { obj : { defaultXmlProperty : ["text"]}};
feathers_controls_Label.VARIANT_HEADING = "heading";
feathers_controls_Label.VARIANT_DETAIL = "detail";
feathers_controls_Label.VARIANT_DANGER = "danger";
feathers_controls_ListView.__meta__ = { obj : { defaultXmlProperty : ["dataProvider"]}};
feathers_controls_ListView.VARIANT_BORDERLESS = "borderless";
feathers_controls_ListView.VARIANT_BORDER = "border";
feathers_controls_ListView.VARIANT_POP_UP = "popUp";
feathers_controls_ListView.CHILD_VARIANT_ITEM_RENDERER = "listView_itemRenderer";
feathers_controls_ListView.DEFAULT_DRAG_FORMAT_ITEMS = "items";
feathers_controls_ListView.INVALIDATION_FLAG_ITEM_RENDERER_FACTORY = feathers_core_InvalidationFlag.CUSTOM("itemRendererFactory");
feathers_controls_ListView.RESET_ITEM_STATE = new feathers_data_ListViewItemState();
feathers_controls_PopUpListView.__meta__ = { obj : { defaultXmlProperty : ["dataProvider"]}};
feathers_controls_PopUpListView.INVALIDATION_FLAG_BUTTON_FACTORY = feathers_core_InvalidationFlag.CUSTOM("buttonFactory");
feathers_controls_PopUpListView.INVALIDATION_FLAG_LIST_VIEW_FACTORY = feathers_core_InvalidationFlag.CUSTOM("listViewFactory");
feathers_controls_PopUpListView.CHILD_VARIANT_BUTTON = "popUpListView_button";
feathers_controls_PopUpListView.CHILD_VARIANT_LIST_VIEW = "popUpListView_listView";
feathers_controls_PopUpListView.defaultButtonFactory = feathers_utils_DisplayObjectFactory.withClass(feathers_controls_Button);
feathers_controls_PopUpListView.defaultListViewFactory = feathers_utils_DisplayObjectFactory.withClass(feathers_controls_ListView);
feathers_controls_Callout.__meta__ = { obj : { defaultXmlProperty : ["content"]}};
feathers_controls_Callout.INVALIDATION_FLAG_ORIGIN = feathers_core_InvalidationFlag.CUSTOM("origin");
feathers_controls_TextCallout.__meta__ = { obj : { defaultXmlProperty : ["text"]}};
feathers_controls_TextCallout.VARIANT_DANGER = "danger";
feathers_controls_TextInput.__meta__ = { obj : { defaultXmlProperty : ["text"]}, fields : { setSkinForState : { style : null}, setTextFormatForState : { style : null}}};
feathers_controls_TextInput.INVALIDATION_FLAG_ERROR_CALLOUT_FACTORY = feathers_core_InvalidationFlag.CUSTOM("errorCalloutFactory");
feathers_controls_TextInput.VARIANT_SEARCH = "search";
feathers_controls_TextInput.CHILD_VARIANT_ERROR_CALLOUT = "textInput_errorCallout";
feathers_controls_TextInput.defaultErrorCalloutFactory = feathers_utils_DisplayObjectFactory.withClass(feathers_controls_TextCallout);
feathers_controls_ButtonBar.__meta__ = { obj : { defaultXmlProperty : ["dataProvider"]}};
feathers_controls_ButtonBar.INVALIDATION_FLAG_BUTTON_FACTORY = feathers_core_InvalidationFlag.CUSTOM("buttonFactory");
feathers_controls_ButtonBar.CHILD_VARIANT_BUTTON = "buttonBar_button";
feathers_controls_ButtonBar.RESET_BUTTON_STATE = new feathers_data_ButtonBarItemState();
feathers_controls_Alert.INVALIDATION_FLAG_BUTTON_BAR_FACTORY = feathers_core_InvalidationFlag.CUSTOM("buttonBarFactory");
feathers_controls_Alert.INVALIDATION_FLAG_HEADER_FACTORY = feathers_core_InvalidationFlag.CUSTOM("headerFactory");
feathers_controls_Alert.INVALIDATION_FLAG_MESSAGE_LABEL_FACTORY = feathers_core_InvalidationFlag.CUSTOM("messageLabelFactory");
feathers_controls_Alert.CHILD_VARIANT_HEADER = "alert_header";
feathers_controls_Alert.CHILD_VARIANT_MESSAGE_LABEL = "alert_messageLabel";
feathers_controls_Alert.CHILD_VARIANT_BUTTON_BAR = "alert_buttonBar";
feathers_controls_Alert.defaultButtonBarFactory = feathers_utils_DisplayObjectFactory.withClass(feathers_controls_ButtonBar);
feathers_controls_Alert.defaultHeaderFactory = feathers_utils_DisplayObjectFactory.withClass(feathers_controls_Header);
feathers_controls_Alert.defaultMessageLabelFactory = feathers_utils_DisplayObjectFactory.withClass(feathers_controls_Label);
feathers_controls_BasicToggleButton.__meta__ = { fields : { setSkinForState : { style : null}}};
feathers_controls_ToggleButton.__meta__ = { obj : { defaultXmlProperty : ["text"]}, fields : { setTextFormatForState : { style : null}, setIconForState : { style : null}}};
feathers_controls_Collapsible.__meta__ = { obj : { defaultXmlProperty : ["content"]}};
feathers_controls_Collapsible.INVALIDATION_FLAG_HEADER_FACTORY = feathers_core_InvalidationFlag.CUSTOM("headerFactory");
feathers_controls_Collapsible.CHILD_VARIANT_HEADER = "collapsible_header";
feathers_controls_Collapsible.defaultHeaderFactory = feathers_utils_DisplayObjectFactory.withClass(feathers_controls_ToggleButton);
feathers_controls_ComboBox.__meta__ = { obj : { defaultXmlProperty : ["dataProvider"]}};
feathers_controls_ComboBox.INVALIDATION_FLAG_BUTTON_FACTORY = feathers_core_InvalidationFlag.CUSTOM("buttonFactory");
feathers_controls_ComboBox.INVALIDATION_FLAG_TEXT_INPUT_FACTORY = feathers_core_InvalidationFlag.CUSTOM("textInputFactory");
feathers_controls_ComboBox.INVALIDATION_FLAG_LIST_VIEW_FACTORY = feathers_core_InvalidationFlag.CUSTOM("listViewFactory");
feathers_controls_ComboBox.CHILD_VARIANT_BUTTON = "comboBox_button";
feathers_controls_ComboBox.CHILD_VARIANT_TEXT_INPUT = "comboBox_textInput";
feathers_controls_ComboBox.CHILD_VARIANT_LIST_VIEW = "comboBox_listView";
feathers_controls_ComboBox.defaultButtonFactory = feathers_utils_DisplayObjectFactory.withClass(feathers_controls_Button);
feathers_controls_ComboBox.defaultTextInputFactory = feathers_utils_DisplayObjectFactory.withClass(feathers_controls_TextInput);
feathers_controls_ComboBox.defaultListViewFactory = feathers_utils_DisplayObjectFactory.withClass(feathers_controls_ListView);
feathers_controls_DatePicker.INVALIDATION_FLAG_MONTH_TITLE_VIEW_FACTORY = feathers_core_InvalidationFlag.CUSTOM("monthTitleViewFactory");
feathers_controls_DatePicker.INVALIDATION_FLAG_DECREMENT_MONTH_BUTTON_FACTORY = feathers_core_InvalidationFlag.CUSTOM("decrementMonthButtonFactory");
feathers_controls_DatePicker.INVALIDATION_FLAG_INCREMENT_MONTH_BUTTON_FACTORY = feathers_core_InvalidationFlag.CUSTOM("incrementMonthButtonFactory");
feathers_controls_DatePicker.INVALIDATION_FLAG_DECREMENT_YEAR_BUTTON_FACTORY = feathers_core_InvalidationFlag.CUSTOM("decrementYearButtonFactory");
feathers_controls_DatePicker.INVALIDATION_FLAG_INCREMENT_YEAR_BUTTON_FACTORY = feathers_core_InvalidationFlag.CUSTOM("incrementYearButtonFactory");
feathers_controls_DatePicker.INVALIDATION_FLAG_DATE_RENDERER_FACTORY = feathers_core_InvalidationFlag.CUSTOM("dateRendererFactory");
feathers_controls_DatePicker.INVALIDATION_FLAG_WEEKDAY_LABEL_FACTORY = feathers_core_InvalidationFlag.CUSTOM("weekdayLabelFactory");
feathers_controls_DatePicker.RESET_ITEM_STATE = new feathers_data_DatePickerItemState();
feathers_controls_DatePicker.CHILD_VARIANT_DATE_RENDERER = "datePicker_dateRenderer";
feathers_controls_DatePicker.CHILD_VARIANT_MUTED_DATE_RENDERER = "datePicker_mutedDateRenderer";
feathers_controls_DatePicker.CHILD_VARIANT_DECREMENT_MONTH_BUTTON = "datePicker_decrementMonthButton";
feathers_controls_DatePicker.CHILD_VARIANT_INCREMENT_MONTH_BUTTON = "datePicker_incrementMonthButton";
feathers_controls_DatePicker.CHILD_VARIANT_DECREMENT_YEAR_BUTTON = "datePicker_decrementYearButton";
feathers_controls_DatePicker.CHILD_VARIANT_INCREMENT_YEAR_BUTTON = "datePicker_incrementYearButton";
feathers_controls_DatePicker.CHILD_VARIANT_MONTH_TITLE_VIEW = "datePicker_monthTitleView";
feathers_controls_DatePicker.CHILD_VARIANT_WEEKDAY_LABEL = "datePicker_weekdayLabel";
feathers_controls_DatePicker.defaultDecrementMonthButtonFactory = feathers_utils_DisplayObjectFactory.withClass(feathers_controls_Button);
feathers_controls_DatePicker.defaultIncrementMonthButtonFactory = feathers_utils_DisplayObjectFactory.withClass(feathers_controls_Button);
feathers_controls_DatePicker.defaultDecrementYearButtonFactory = feathers_utils_DisplayObjectFactory.withClass(feathers_controls_Button);
feathers_controls_DatePicker.defaultIncrementYearButtonFactory = feathers_utils_DisplayObjectFactory.withClass(feathers_controls_Button);
feathers_controls_DatePicker.defaultMonthTitleViewFactory = feathers_utils_DisplayObjectFactory.withClass(feathers_controls_Label);
feathers_controls_DatePicker.defaultWeekdayLabelFactory = feathers_utils_DisplayObjectFactory.withClass(feathers_controls_Label);
feathers_controls_FormItem.__meta__ = { obj : { defaultXmlProperty : ["content"]}};
feathers_controls_GridView.__meta__ = { obj : { defaultXmlProperty : ["dataProvider"]}};
feathers_controls_GridView.VARIANT_BORDERLESS = "borderless";
feathers_controls_GridView.VARIANT_BORDER = "border";
feathers_controls_GridView.CHILD_VARIANT_CELL_RENDERER = "gridView_cellRenderer";
feathers_controls_GridView.CHILD_VARIANT_HEADER_RENDERER = "gridView_headerRenderer";
feathers_controls_GridView.CHILD_VARIANT_HEADER_DIVIDER = "gridView_headerDivider";
feathers_controls_GridView.CHILD_VARIANT_COLUMN_DIVIDER = "gridView_columnDivider";
feathers_controls_GridView.DEFAULT_DRAG_FORMAT_ITEMS = "items";
feathers_controls_GridView.INVALIDATION_FLAG_ROW_RENDERER_FACTORY = feathers_core_InvalidationFlag.CUSTOM("rowRendererFactory");
feathers_controls_GridView.INVALIDATION_FLAG_HEADER_RENDERER_FACTORY = feathers_core_InvalidationFlag.CUSTOM("headerRendererFactory");
feathers_controls_GridView.INVALIDATION_FLAG_HEADER_DIVIDER_FACTORY = feathers_core_InvalidationFlag.CUSTOM("headerDividerFactory");
feathers_controls_GridView.INVALIDATION_FLAG_COLUMN_DIVIDER_FACTORY = feathers_core_InvalidationFlag.CUSTOM("columnDividerFactory");
feathers_controls_GridView.RESET_HEADER_STATE = new feathers_data_GridViewHeaderState();
feathers_controls_GridView.RESET_ROW_STATE = new feathers_controls__$GridView_GridViewRowState();
feathers_controls_GridView.POINTER_ID_MOUSE = -1000;
feathers_controls_GroupListView.__meta__ = { obj : { defaultXmlProperty : ["dataProvider"]}};
feathers_controls_GroupListView.CHILD_VARIANT_HEADER_RENDERER = "groupListView_headerRenderer";
feathers_controls_GroupListView.CHILD_VARIANT_ITEM_RENDERER = "groupListView_itemRenderer";
feathers_controls_GroupListView.VARIANT_BORDERLESS = "borderless";
feathers_controls_GroupListView.VARIANT_BORDER = "border";
feathers_controls_GroupListView.INVALIDATION_FLAG_ITEM_RENDERER_FACTORY = feathers_core_InvalidationFlag.CUSTOM("itemRendererFactory");
feathers_controls_GroupListView.INVALIDATION_FLAG_HEADER_RENDERER_FACTORY = feathers_core_InvalidationFlag.CUSTOM("headerRendererFactory");
feathers_controls_GroupListView.RESET_ITEM_STATE = new feathers_data_GroupListViewItemState();
feathers_controls_NumericStepper.INVALIDATION_FLAG_DECREMENT_BUTTON_FACTORY = feathers_core_InvalidationFlag.CUSTOM("decrementButtonFactory");
feathers_controls_NumericStepper.INVALIDATION_FLAG_INCREMENT_BUTTON_FACTORY = feathers_core_InvalidationFlag.CUSTOM("incrementButtonFactory");
feathers_controls_NumericStepper.INVALIDATION_FLAG_TEXT_INPUT_FACTORY = feathers_core_InvalidationFlag.CUSTOM("textInputFactory");
feathers_controls_NumericStepper.CHILD_VARIANT_DECREMENT_BUTTON = "numericStepper_decrementButton";
feathers_controls_NumericStepper.CHILD_VARIANT_INCREMENT_BUTTON = "numericStepper_incrementButton";
feathers_controls_NumericStepper.CHILD_VARIANT_TEXT_INPUT = "numericStepper_textInput";
feathers_controls_NumericStepper.defaultDecrementButtonFactory = feathers_utils_DisplayObjectFactory.withClass(feathers_controls_Button);
feathers_controls_NumericStepper.defaultIncrementButtonFactory = feathers_utils_DisplayObjectFactory.withClass(feathers_controls_Button);
feathers_controls_NumericStepper.defaultTextInputFactory = feathers_utils_DisplayObjectFactory.withClass(feathers_controls_TextInput);
feathers_controls_PageIndicator.INVALIDATION_FLAG_TOGGLE_BUTTON_FACTORY = feathers_core_InvalidationFlag.CUSTOM("toggleButtonFactory");
feathers_controls_PageIndicator.CHILD_VARIANT_TOGGLE_BUTTON = "pageIndicator_toggleButton";
feathers_controls_PopUpDatePicker.INVALIDATION_FLAG_BUTTON_FACTORY = feathers_core_InvalidationFlag.CUSTOM("buttonFactory");
feathers_controls_PopUpDatePicker.INVALIDATION_FLAG_TEXT_INPUT_FACTORY = feathers_core_InvalidationFlag.CUSTOM("textInputFactory");
feathers_controls_PopUpDatePicker.INVALIDATION_FLAG_DATE_PICKER_FACTORY = feathers_core_InvalidationFlag.CUSTOM("datePickerFactory");
feathers_controls_PopUpDatePicker.CHILD_VARIANT_BUTTON = "popUpDatePicker_button";
feathers_controls_PopUpDatePicker.CHILD_VARIANT_TEXT_INPUT = "popUpDatePicker_textInput";
feathers_controls_PopUpDatePicker.CHILD_VARIANT_DATE_PICKER = "popUpDatePicker_datePicker";
feathers_controls_PopUpDatePicker.defaultButtonFactory = feathers_utils_DisplayObjectFactory.withClass(feathers_controls_Button);
feathers_controls_PopUpDatePicker.defaultTextInputFactory = feathers_utils_DisplayObjectFactory.withClass(feathers_controls_TextInput);
feathers_controls_PopUpDatePicker.defaultDatePickerFactory = feathers_utils_DisplayObjectFactory.withClass(feathers_controls_DatePicker);
feathers_controls_Radio.defaultRadioGroup = new feathers_core_ToggleGroup();
feathers_controls_TabBar.__meta__ = { obj : { defaultXmlProperty : ["dataProvider"]}};
feathers_controls_TabBar.INVALIDATION_FLAG_TAB_FACTORY = feathers_core_InvalidationFlag.CUSTOM("tabFactory");
feathers_controls_TabBar.CHILD_VARIANT_TAB = "tabBar_tab";
feathers_controls_TabBar.RESET_TAB_STATE = new feathers_data_TabBarItemState();
feathers_controls_TextArea.__meta__ = { obj : { defaultXmlProperty : ["text"]}, fields : { setSkinForState : { style : null}, setTextFormatForState : { style : null}}};
feathers_controls_TextArea.INVALIDATION_FLAG_ERROR_CALLOUT_FACTORY = feathers_core_InvalidationFlag.CUSTOM("errorCalloutFactory");
feathers_controls_TextArea.CHILD_VARIANT_ERROR_CALLOUT = "textArea_errorCallout";
feathers_controls_TextArea.defaultErrorCalloutFactory = feathers_utils_DisplayObjectFactory.withClass(feathers_controls_TextCallout);
feathers_controls_TreeGridView.__meta__ = { obj : { defaultXmlProperty : ["dataProvider"]}};
feathers_controls_TreeGridView.VARIANT_BORDERLESS = "borderless";
feathers_controls_TreeGridView.VARIANT_BORDER = "border";
feathers_controls_TreeGridView.CHILD_VARIANT_CELL_RENDERER = "treeGridView_cellRenderer";
feathers_controls_TreeGridView.CHILD_VARIANT_HEADER_RENDERER = "treeGridView_headerRenderer";
feathers_controls_TreeGridView.CHILD_VARIANT_HEADER_DIVIDER = "treeGridView_headerDivider";
feathers_controls_TreeGridView.CHILD_VARIANT_COLUMN_DIVIDER = "treeGridView_columnDivider";
feathers_controls_TreeGridView.INVALIDATION_FLAG_ROW_RENDERER_FACTORY = feathers_core_InvalidationFlag.CUSTOM("rowRendererFactory");
feathers_controls_TreeGridView.INVALIDATION_FLAG_HEADER_RENDERER_FACTORY = feathers_core_InvalidationFlag.CUSTOM("headerRendererFactory");
feathers_controls_TreeGridView.INVALIDATION_FLAG_HEADER_DIVIDER_FACTORY = feathers_core_InvalidationFlag.CUSTOM("headerDividerFactory");
feathers_controls_TreeGridView.INVALIDATION_FLAG_COLUMN_DIVIDER_FACTORY = feathers_core_InvalidationFlag.CUSTOM("columnDividerFactory");
feathers_controls_TreeGridView.RESET_HEADER_STATE = new feathers_data_TreeGridViewHeaderState();
feathers_controls_TreeGridView.RESET_ROW_STATE = new feathers_controls__$TreeGridView_TreeGridViewRowState();
feathers_controls_TreeGridView.POINTER_ID_MOUSE = -1000;
feathers_controls_TreeView.__meta__ = { obj : { defaultXmlProperty : ["dataProvider"]}};
feathers_controls_TreeView.VARIANT_BORDERLESS = "borderless";
feathers_controls_TreeView.VARIANT_BORDER = "border";
feathers_controls_TreeView.CHILD_VARIANT_ITEM_RENDERER = "treeView_itemRenderer";
feathers_controls_TreeView.INVALIDATION_FLAG_ITEM_RENDERER_FACTORY = feathers_core_InvalidationFlag.CUSTOM("itemRendererFactory");
feathers_controls_TreeView.RESET_ITEM_STATE = new feathers_data_TreeViewItemState();
feathers_controls_dataRenderers_GridViewRowRenderer.INVALIDATION_FLAG_CELL_RENDERER_FACTORY = feathers_core_InvalidationFlag.CUSTOM("cellRendererFactory");
feathers_controls_dataRenderers_GridViewRowRenderer.RESET_CELL_STATE = new feathers_data_GridViewCellState();
feathers_controls_dataRenderers_ItemRenderer.__meta__ = { fields : { setSecondaryTextFormatForState : { style : null}}};
feathers_controls_dataRenderers_HierarchicalItemRenderer.INVALIDATION_FLAG_DISCLOSURE_BUTTON_FACTORY = feathers_core_InvalidationFlag.CUSTOM("disclosureButtonFactory");
feathers_controls_dataRenderers_HierarchicalItemRenderer.defaultDisclosureButtonFactory = feathers_utils_DisplayObjectFactory.withClass(feathers_controls_ToggleButton);
feathers_controls_dataRenderers_HierarchicalItemRenderer.VARIANT_FILE_SYSTEM = "fileSystem";
feathers_controls_dataRenderers_HierarchicalItemRenderer.CHILD_VARIANT_DISCLOSURE_BUTTON = "hierarchicalItemRenderer_disclosureButton";
feathers_controls_dataRenderers_LayoutGroupItemRenderer.__meta__ = { fields : { setSkinForState : { style : null}}};
feathers_controls_dataRenderers_TreeGridViewRowRenderer.INVALIDATION_FLAG_CELL_RENDERER_FACTORY = feathers_core_InvalidationFlag.CUSTOM("cellRendererFactory");
feathers_controls_dataRenderers_TreeGridViewRowRenderer.RESET_CELL_STATE = new feathers_data_TreeGridViewCellState();
feathers_controls_navigators_PageItem.internalIDCounter = 0;
feathers_controls_navigators_PageNavigator.__meta__ = { obj : { defaultXmlProperty : ["dataProvider"]}};
feathers_controls_navigators_PageNavigator.INVALIDATION_FLAG_PAGE_INDICATOR_FACTORY = feathers_core_InvalidationFlag.CUSTOM("pageIndicatorFactory");
feathers_controls_navigators_PageNavigator.CHILD_VARIANT_PAGE_INDICATOR = "pageNavigator_pageIndicator";
feathers_controls_navigators_PageNavigator.defaultPageIndicatorFactory = feathers_utils_DisplayObjectFactory.withClass(feathers_controls_PageIndicator);
feathers_controls_navigators_TabItem.internalIDCounter = 0;
feathers_controls_navigators_TabNavigator.__meta__ = { obj : { defaultXmlProperty : ["dataProvider"]}};
feathers_controls_navigators_TabNavigator.INVALIDATION_FLAG_TAB_BAR_FACTORY = feathers_core_InvalidationFlag.CUSTOM("tabBarFactory");
feathers_controls_navigators_TabNavigator.CHILD_VARIANT_TAB_BAR = "tabNavigator_tabBar";
feathers_controls_navigators_TabNavigator.defaultTabBarFactory = feathers_utils_DisplayObjectFactory.withClass(feathers_controls_TabBar);
feathers_core_DefaultFocusManager.WRAP_OBJECT_HIGH_TAB_INDEX = 2147483647;
feathers_core_DefaultToolTipManager.CHILD_VARIANT_TOOL_TIP = "toolTip";
feathers_core_FocusManager.stageToManager = new haxe_ds_ObjectMap();
feathers_core_FocusManager._focusManagerFactory = feathers_core_FocusManager.defaultFocusManagerFactory;
feathers_core_PopUpManager.stageToManager = new haxe_ds_ObjectMap();
feathers_core_ToolTipManager._toolTipManagerFactory = feathers_core_ToolTipManager.defaultToolTipManagerFactory;
feathers_core_ToolTipManager.stageToManager = new haxe_ds_ObjectMap();
feathers_core_ValidationQueue.STAGE_TO_VALIDATION_QUEUE = new haxe_ds_ObjectMap();
feathers_data_ArrayCollection.__meta__ = { obj : { defaultXmlProperty : ["array"]}};
feathers_dragDrop_DragDropManager._dropTargetLocalX = 0.0;
feathers_dragDrop_DragDropManager._dropTargetLocalY = 0.0;
feathers_dragDrop_DragDropManager._dragAvatarOffsetX = 0.0;
feathers_dragDrop_DragDropManager.dragAvatarOffsetX = 1.0;
feathers_dragDrop_DragDropManager.dragAvatarOffsetY = 1.0;
feathers_dragDrop_DragDropManager.dropAccepted = false;
feathers_dragDrop_DragDropManager._oldDragAvatarMouseEnabled = false;
feathers_dragDrop_DragDropManager._oldDragAvatarMouseChildren = false;
feathers_events_ButtonBarEvent.ITEM_TRIGGER = "itemTrigger";
feathers_events_ButtonBarEvent._pool = new lime_utils_ObjectPool(function() {
	return new feathers_events_ButtonBarEvent(null,null);
},function(event) {
	event.target = null;
	event.currentTarget = null;
	event.__preventDefault = false;
	event.__isCanceled = false;
	event.__isCanceledNow = false;
	event.state = null;
});
feathers_events_DatePickerEvent.ITEM_TRIGGER = "itemTrigger";
feathers_events_DatePickerEvent._pool = new lime_utils_ObjectPool(function() {
	return new feathers_events_DatePickerEvent(null,null);
},function(event) {
	event.target = null;
	event.currentTarget = null;
	event.__preventDefault = false;
	event.__isCanceled = false;
	event.__isCanceledNow = false;
	event.state = null;
});
feathers_events_DragDropEvent.DRAG_START = "dragStart";
feathers_events_DragDropEvent.DRAG_COMPLETE = "dragComplete";
feathers_events_DragDropEvent.DRAG_ENTER = "dragEnter";
feathers_events_DragDropEvent.DRAG_MOVE = "dragMove";
feathers_events_DragDropEvent.DRAG_EXIT = "dragExit";
feathers_events_DragDropEvent.DRAG_DROP = "dragDrop";
feathers_events_DragDropEvent._pool = new lime_utils_ObjectPool(function() {
	return new feathers_events_DragDropEvent(null,null,false);
},function(event) {
	event.target = null;
	event.currentTarget = null;
	event.__preventDefault = false;
	event.__isCanceled = false;
	event.__isCanceledNow = false;
});
feathers_events_FeathersEvent.INITIALIZE = "initialize";
feathers_events_FeathersEvent.CREATION_COMPLETE = "creationComplete";
feathers_events_FeathersEvent.LAYOUT_DATA_CHANGE = "layoutDataChange";
feathers_events_FeathersEvent.STATE_CHANGE = "stateChange";
feathers_events_FeathersEvent.OPENING = "opening";
feathers_events_FeathersEvent.CLOSING = "closing";
feathers_events_FeathersEvent.ENABLE = "enable";
feathers_events_FeathersEvent.DISABLE = "disable";
feathers_events_FeathersEvent._pool = new lime_utils_ObjectPool(function() {
	return new feathers_events_FeathersEvent(null,false,false);
},function(event) {
	event.target = null;
	event.currentTarget = null;
	event.__preventDefault = false;
	event.__isCanceled = false;
	event.__isCanceledNow = false;
});
feathers_events_FlatCollectionEvent.ADD_ITEM = "addItem";
feathers_events_FlatCollectionEvent.REMOVE_ITEM = "removeItem";
feathers_events_FlatCollectionEvent.REPLACE_ITEM = "replaceItem";
feathers_events_FlatCollectionEvent.UPDATE_ITEM = "updateItem";
feathers_events_FlatCollectionEvent.UPDATE_ALL = "updateAll";
feathers_events_FlatCollectionEvent.RESET = "reset";
feathers_events_FlatCollectionEvent.REMOVE_ALL = "removeAll";
feathers_events_FlatCollectionEvent.FILTER_CHANGE = "filterChange";
feathers_events_FlatCollectionEvent.SORT_CHANGE = "sortChange";
feathers_events_FlatCollectionEvent._pool = new lime_utils_ObjectPool(function() {
	return new feathers_events_FlatCollectionEvent(null,-1,false,false);
},function(event) {
	event.target = null;
	event.currentTarget = null;
	event.__preventDefault = false;
	event.__isCanceled = false;
	event.__isCanceledNow = false;
	event.addedItem = null;
	event.removedItem = null;
});
feathers_events_FormEvent.SUBMIT = "submit";
feathers_events_FormEvent._pool = new lime_utils_ObjectPool(function() {
	return new feathers_events_FormEvent(null);
},function(event) {
	event.target = null;
	event.currentTarget = null;
	event.__preventDefault = false;
	event.__isCanceled = false;
	event.__isCanceledNow = false;
});
feathers_events_GridViewEvent.CELL_TRIGGER = "cellTrigger";
feathers_events_GridViewEvent.HEADER_TRIGGER = "headerTrigger";
feathers_events_GridViewEvent._cellPool = new lime_utils_ObjectPool(function() {
	return new feathers_events_GridViewEvent(null,null);
},function(event) {
	event.target = null;
	event.currentTarget = null;
	event.__preventDefault = false;
	event.__isCanceled = false;
	event.__isCanceledNow = false;
	event.state = null;
});
feathers_events_GridViewEvent._headerPool = new lime_utils_ObjectPool(function() {
	return new feathers_events_GridViewEvent(null,null);
},function(event) {
	event.target = null;
	event.currentTarget = null;
	event.__preventDefault = false;
	event.__isCanceled = false;
	event.__isCanceledNow = false;
	event.state = null;
});
feathers_events_GroupListViewEvent.ITEM_TRIGGER = "itemTrigger";
feathers_events_GroupListViewEvent._pool = new lime_utils_ObjectPool(function() {
	return new feathers_events_GroupListViewEvent(null,null);
},function(event) {
	event.target = null;
	event.currentTarget = null;
	event.__preventDefault = false;
	event.__isCanceled = false;
	event.__isCanceledNow = false;
	event.state = null;
});
feathers_events_HierarchicalCollectionEvent.ADD_ITEM = "addItem";
feathers_events_HierarchicalCollectionEvent.REMOVE_ITEM = "removeItem";
feathers_events_HierarchicalCollectionEvent.REPLACE_ITEM = "replaceItem";
feathers_events_HierarchicalCollectionEvent.UPDATE_ITEM = "updateItem";
feathers_events_HierarchicalCollectionEvent.UPDATE_ALL = "updateAll";
feathers_events_HierarchicalCollectionEvent.RESET = "reset";
feathers_events_HierarchicalCollectionEvent.REMOVE_ALL = "removeAll";
feathers_events_HierarchicalCollectionEvent.FILTER_CHANGE = "filterChange";
feathers_events_HierarchicalCollectionEvent.SORT_CHANGE = "sortChange";
feathers_events_HierarchicalCollectionEvent._pool = new lime_utils_ObjectPool(function() {
	return new feathers_events_HierarchicalCollectionEvent(null,null,false,false);
},function(event) {
	event.target = null;
	event.currentTarget = null;
	event.__preventDefault = false;
	event.__isCanceled = false;
	event.__isCanceledNow = false;
	event.addedItem = null;
	event.removedItem = null;
	event.location = null;
});
feathers_events_ListViewEvent.ITEM_TRIGGER = "itemTrigger";
feathers_events_ListViewEvent._pool = new lime_utils_ObjectPool(function() {
	return new feathers_events_ListViewEvent(null,null);
},function(event) {
	event.target = null;
	event.currentTarget = null;
	event.__preventDefault = false;
	event.__isCanceled = false;
	event.__isCanceledNow = false;
	event.state = null;
});
feathers_events_ScrollEvent.SCROLL_START = "scrollStart";
feathers_events_ScrollEvent.SCROLL_COMPLETE = "scrollComplete";
feathers_events_ScrollEvent.SCROLL = "scroll";
feathers_events_ScrollEvent._pool = new lime_utils_ObjectPool(function() {
	return new feathers_events_ScrollEvent(null,false,false);
},function(event) {
	event.target = null;
	event.currentTarget = null;
	event.__preventDefault = false;
	event.__isCanceled = false;
	event.__isCanceledNow = false;
});
feathers_events_StyleProviderEvent.STYLES_CHANGE = "stylesChange";
feathers_events_StyleProviderEvent._pool = new lime_utils_ObjectPool(function() {
	return new feathers_events_StyleProviderEvent(null,null);
},function(event) {
	event.target = null;
	event.currentTarget = null;
	event.__preventDefault = false;
	event.__isCanceled = false;
	event.__isCanceledNow = false;
	event.affectsTarget = null;
});
feathers_events_TabBarEvent.ITEM_TRIGGER = "itemTrigger";
feathers_events_TabBarEvent._pool = new lime_utils_ObjectPool(function() {
	return new feathers_events_TabBarEvent(null,null);
},function(event) {
	event.target = null;
	event.currentTarget = null;
	event.__preventDefault = false;
	event.__isCanceled = false;
	event.__isCanceledNow = false;
	event.state = null;
});
feathers_events_TransitionEvent.TRANSITION_START = "transitionStart";
feathers_events_TransitionEvent.TRANSITION_COMPLETE = "transitionComplete";
feathers_events_TransitionEvent.TRANSITION_CANCEL = "transitionCancel";
feathers_events_TransitionEvent._pool = new lime_utils_ObjectPool(function() {
	return new feathers_events_TransitionEvent(null,null,null,null,null);
},function(event) {
	event.previousViewID = null;
	event.previousView = null;
	event.nextViewID = null;
	event.nextView = null;
	event.target = null;
	event.currentTarget = null;
	event.__preventDefault = false;
	event.__isCanceled = false;
	event.__isCanceledNow = false;
});
feathers_events_TreeGridViewEvent.CELL_TRIGGER = "cellTrigger";
feathers_events_TreeGridViewEvent.HEADER_TRIGGER = "headerTrigger";
feathers_events_TreeGridViewEvent.BRANCH_OPEN = "branchOpen";
feathers_events_TreeGridViewEvent.BRANCH_CLOSE = "branchClose";
feathers_events_TreeGridViewEvent._cellPool = new lime_utils_ObjectPool(function() {
	return new feathers_events_TreeGridViewEvent(null,null);
},function(event) {
	event.target = null;
	event.currentTarget = null;
	event.__preventDefault = false;
	event.__isCanceled = false;
	event.__isCanceledNow = false;
	event.state = null;
});
feathers_events_TreeGridViewEvent._headerPool = new lime_utils_ObjectPool(function() {
	return new feathers_events_TreeGridViewEvent(null,null);
},function(event) {
	event.target = null;
	event.currentTarget = null;
	event.__preventDefault = false;
	event.__isCanceled = false;
	event.__isCanceledNow = false;
	event.state = null;
});
feathers_events_TreeViewEvent.ITEM_TRIGGER = "itemTrigger";
feathers_events_TreeViewEvent.BRANCH_OPEN = "branchOpen";
feathers_events_TreeViewEvent.BRANCH_CLOSE = "branchClose";
feathers_events_TreeViewEvent._pool = new lime_utils_ObjectPool(function() {
	return new feathers_events_TreeViewEvent(null,null);
},function(event) {
	event.target = null;
	event.currentTarget = null;
	event.__preventDefault = false;
	event.__isCanceled = false;
	event.__isCanceledNow = false;
	event.state = null;
});
feathers_events_TriggerEvent.TRIGGER = "trigger";
feathers_events_TriggerEvent._pool = new lime_utils_ObjectPool(function() {
	return new feathers_events_TriggerEvent(null);
},function(event) {
	event.target = null;
	event.currentTarget = null;
	event.__preventDefault = false;
	event.__isCanceled = false;
	event.__isCanceledNow = false;
	event.relatedObject = null;
});
motion_actuators_SimpleActuator.actuators = [];
motion_actuators_SimpleActuator.actuatorsLength = 0;
motion_actuators_SimpleActuator.addedEvent = false;
feathers_motion_transitions_SlideTransitionBuilder.VIEW_REQUIRED_ERROR = "Cannot transition if both old view and new view are null.";
feathers_utils_DateUtil.MONTH_NUMBER_OF_DAYS = [31,28,31,30,31,30,31,31,30,31,30,31];
feathers_utils_DateUtil.FEBRUARY_NUMBER_OF_DAYS_LEAP_YEAR = 29;
feathers_utils_DeviceUtil.MEDIA_QUERY_DESKTOP = "screen and (hover: hover) and (pointer: fine)";
feathers_utils_DeviceUtil.MEDIA_QUERY_MOBILE = "screen and (hover: none) and (pointer: coarse)";
feathers_utils_EdgePuller.MINIMUM_VELOCITY = 0.02;
feathers_utils_EdgePuller.POINTER_ID_MOUSE = -1000;
feathers_utils_ExclusivePointer.stageToObject = new haxe_ds_ObjectMap();
feathers_utils_Scroller.MINIMUM_VELOCITY = 0.02;
feathers_utils_Scroller.POINTER_ID_MOUSE = -1000;
haxe_Int32._mul = Math.imul != null ? Math.imul : function(a,b) {
	return a * (b & 65535) + (a * (b >>> 16) << 16 | 0) | 0;
};
haxe_Serializer.USE_CACHE = false;
haxe_Serializer.USE_ENUM_INDEX = false;
haxe_Serializer.BASE64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789%:";
haxe_Unserializer.DEFAULT_RESOLVER = new haxe__$Unserializer_DefaultResolver();
haxe_Unserializer.BASE64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789%:";
haxe_crypto_Aes.BLOCK_SIZE = 16;
haxe_crypto_Base64.CHARS = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
haxe_crypto_Base64.BYTES = haxe_io_Bytes.ofString(haxe_crypto_Base64.CHARS);
haxe_crypto_mode_EAX.BLOCK_SIZE = 16;
haxe_crypto_mode_GCMSIV.AES_BLOCK_SIZE = 16;
haxe_crypto_mode_GCMSIV.NONCE_SIZE = 12;
haxe_crypto_mode_GCMSIV.E = new haxe__$Int64__$_$_$Int64(-520093696,0);
haxe_io_FPHelper.i64tmp = new haxe__$Int64__$_$_$Int64(0,0);
haxe_io_FPHelper.helper = new DataView(new ArrayBuffer(8));
haxe_xml_Parser.escapes = (function($this) {
	var $r;
	var h = new haxe_ds_StringMap();
	h.h["lt"] = "<";
	h.h["gt"] = ">";
	h.h["amp"] = "&";
	h.h["quot"] = "\"";
	h.h["apos"] = "'";
	$r = h;
	return $r;
}(this));
haxe_zip_InflateImpl.LEN_EXTRA_BITS_TBL = [0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,-1,-1];
haxe_zip_InflateImpl.LEN_BASE_VAL_TBL = [3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258];
haxe_zip_InflateImpl.DIST_EXTRA_BITS_TBL = [0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,-1,-1];
haxe_zip_InflateImpl.DIST_BASE_VAL_TBL = [1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577];
haxe_zip_InflateImpl.CODE_LENGTHS_POS = [16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];
hscript_Parser.p1 = 0;
hscript_Parser.tokenMin = 0;
hscript_Parser.tokenMax = 0;
lime__$internal_backend_html5_HTML5HTTPRequest.OPTION_REVOKE_URL = 1;
lime__$internal_backend_html5_HTML5HTTPRequest.activeRequests = 0;
lime__$internal_backend_html5_HTML5HTTPRequest.requestLimit = 17;
lime__$internal_backend_html5_HTML5HTTPRequest.requestQueue = new haxe_ds_List();
lime__$internal_backend_html5_Message.PROTOTYPE_FIELD = "__prototype__";
lime__$internal_backend_html5_Message.SKIP_FIELD = "__skipPrototype__";
lime__$internal_backend_html5_Message.RESTORE_FIELD = "__restoreFlag__";
lime__$internal_backend_html5_HTML5Thread.__current = new lime__$internal_backend_html5_HTML5Thread($global.location.href);
lime__$internal_backend_html5_HTML5Thread.__isWorker = typeof window == "undefined";
lime__$internal_backend_html5_HTML5Thread.__messages = new haxe_ds_List();
lime__$internal_backend_html5_HTML5Thread.__resolveMethods = new haxe_ds_List();
lime__$internal_backend_html5_HTML5Thread.__workerCount = 0;
lime__$internal_backend_html5_HTML5Window.dummyCharacter = "";
lime__$internal_backend_html5_HTML5Window.windowID = 0;
lime__$internal_format_Base64.DICTIONARY = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");
lime__$internal_format_Base64.EXTENDED_DICTIONARY = (function($this) {
	var $r;
	var result = [];
	{
		var _g = 0;
		var _g1 = lime__$internal_format_Base64.DICTIONARY;
		while(_g < _g1.length) {
			var a = _g1[_g];
			++_g;
			var _g2 = 0;
			var _g3 = lime__$internal_format_Base64.DICTIONARY;
			while(_g2 < _g3.length) {
				var b = _g3[_g2];
				++_g2;
				result.push(a + b);
			}
		}
	}
	$r = result;
	return $r;
}(this));
lime__$internal_graphics_StackBlur.MUL_TABLE = [1,171,205,293,57,373,79,137,241,27,391,357,41,19,283,265,497,469,443,421,25,191,365,349,335,161,155,149,9,278,269,261,505,245,475,231,449,437,213,415,405,395,193,377,369,361,353,345,169,331,325,319,313,307,301,37,145,285,281,69,271,267,263,259,509,501,493,243,479,118,465,459,113,446,55,435,429,423,209,413,51,403,199,393,97,3,379,375,371,367,363,359,355,351,347,43,85,337,333,165,327,323,5,317,157,311,77,305,303,75,297,294,73,289,287,71,141,279,277,275,68,135,67,133,33,262,260,129,511,507,503,499,495,491,61,121,481,477,237,235,467,232,115,457,227,451,7,445,221,439,218,433,215,427,425,211,419,417,207,411,409,203,202,401,399,396,197,49,389,387,385,383,95,189,47,187,93,185,23,183,91,181,45,179,89,177,11,175,87,173,345,343,341,339,337,21,167,83,331,329,327,163,81,323,321,319,159,79,315,313,39,155,309,307,153,305,303,151,75,299,149,37,295,147,73,291,145,289,287,143,285,71,141,281,35,279,139,69,275,137,273,17,271,135,269,267,133,265,33,263,131,261,130,259,129,257,1];
lime__$internal_graphics_StackBlur.SHG_TABLE = [0,9,10,11,9,12,10,11,12,9,13,13,10,9,13,13,14,14,14,14,10,13,14,14,14,13,13,13,9,14,14,14,15,14,15,14,15,15,14,15,15,15,14,15,15,15,15,15,14,15,15,15,15,15,15,12,14,15,15,13,15,15,15,15,16,16,16,15,16,14,16,16,14,16,13,16,16,16,15,16,13,16,15,16,14,9,16,16,16,16,16,16,16,16,16,13,14,16,16,15,16,16,10,16,15,16,14,16,16,14,16,16,14,16,16,14,15,16,16,16,14,15,14,15,13,16,16,15,17,17,17,17,17,17,14,15,17,17,16,16,17,16,15,17,16,17,11,17,16,17,16,17,16,17,17,16,17,17,16,17,17,16,16,17,17,17,16,14,17,17,17,17,15,16,14,16,15,16,13,16,15,16,14,16,15,16,12,16,15,16,17,17,17,17,17,13,16,15,17,17,17,16,15,17,17,17,16,15,17,17,14,16,17,17,16,17,17,16,15,17,16,14,17,16,15,17,16,17,17,16,17,15,16,17,14,17,16,15,17,16,17,13,17,16,17,17,16,17,14,17,16,17,16,17,16,17,9];
lime_graphics_cairo_CairoFTFontFace.FT_LOAD_FORCE_AUTOHINT = 32;
lime_graphics_opengl_GL.DEPTH_BUFFER_BIT = 256;
lime_graphics_opengl_GL.STENCIL_BUFFER_BIT = 1024;
lime_graphics_opengl_GL.COLOR_BUFFER_BIT = 16384;
lime_graphics_opengl_GL.POINTS = 0;
lime_graphics_opengl_GL.LINES = 1;
lime_graphics_opengl_GL.LINE_LOOP = 2;
lime_graphics_opengl_GL.LINE_STRIP = 3;
lime_graphics_opengl_GL.TRIANGLES = 4;
lime_graphics_opengl_GL.TRIANGLE_STRIP = 5;
lime_graphics_opengl_GL.TRIANGLE_FAN = 6;
lime_graphics_opengl_GL.ZERO = 0;
lime_graphics_opengl_GL.ONE = 1;
lime_graphics_opengl_GL.SRC_COLOR = 768;
lime_graphics_opengl_GL.ONE_MINUS_SRC_COLOR = 769;
lime_graphics_opengl_GL.SRC_ALPHA = 770;
lime_graphics_opengl_GL.ONE_MINUS_SRC_ALPHA = 771;
lime_graphics_opengl_GL.DST_ALPHA = 772;
lime_graphics_opengl_GL.ONE_MINUS_DST_ALPHA = 773;
lime_graphics_opengl_GL.DST_COLOR = 774;
lime_graphics_opengl_GL.ONE_MINUS_DST_COLOR = 775;
lime_graphics_opengl_GL.SRC_ALPHA_SATURATE = 776;
lime_graphics_opengl_GL.FUNC_ADD = 32774;
lime_graphics_opengl_GL.BLEND_EQUATION = 32777;
lime_graphics_opengl_GL.BLEND_EQUATION_RGB = 32777;
lime_graphics_opengl_GL.BLEND_EQUATION_ALPHA = 34877;
lime_graphics_opengl_GL.FUNC_SUBTRACT = 32778;
lime_graphics_opengl_GL.FUNC_REVERSE_SUBTRACT = 32779;
lime_graphics_opengl_GL.BLEND_DST_RGB = 32968;
lime_graphics_opengl_GL.BLEND_SRC_RGB = 32969;
lime_graphics_opengl_GL.BLEND_DST_ALPHA = 32970;
lime_graphics_opengl_GL.BLEND_SRC_ALPHA = 32971;
lime_graphics_opengl_GL.CONSTANT_COLOR = 32769;
lime_graphics_opengl_GL.ONE_MINUS_CONSTANT_COLOR = 32770;
lime_graphics_opengl_GL.CONSTANT_ALPHA = 32771;
lime_graphics_opengl_GL.ONE_MINUS_CONSTANT_ALPHA = 32772;
lime_graphics_opengl_GL.BLEND_COLOR = 32773;
lime_graphics_opengl_GL.ARRAY_BUFFER = 34962;
lime_graphics_opengl_GL.ELEMENT_ARRAY_BUFFER = 34963;
lime_graphics_opengl_GL.ARRAY_BUFFER_BINDING = 34964;
lime_graphics_opengl_GL.ELEMENT_ARRAY_BUFFER_BINDING = 34965;
lime_graphics_opengl_GL.STREAM_DRAW = 35040;
lime_graphics_opengl_GL.STATIC_DRAW = 35044;
lime_graphics_opengl_GL.DYNAMIC_DRAW = 35048;
lime_graphics_opengl_GL.BUFFER_SIZE = 34660;
lime_graphics_opengl_GL.BUFFER_USAGE = 34661;
lime_graphics_opengl_GL.CURRENT_VERTEX_ATTRIB = 34342;
lime_graphics_opengl_GL.FRONT = 1028;
lime_graphics_opengl_GL.BACK = 1029;
lime_graphics_opengl_GL.FRONT_AND_BACK = 1032;
lime_graphics_opengl_GL.CULL_FACE = 2884;
lime_graphics_opengl_GL.BLEND = 3042;
lime_graphics_opengl_GL.DITHER = 3024;
lime_graphics_opengl_GL.STENCIL_TEST = 2960;
lime_graphics_opengl_GL.DEPTH_TEST = 2929;
lime_graphics_opengl_GL.SCISSOR_TEST = 3089;
lime_graphics_opengl_GL.POLYGON_OFFSET_FILL = 32823;
lime_graphics_opengl_GL.SAMPLE_ALPHA_TO_COVERAGE = 32926;
lime_graphics_opengl_GL.SAMPLE_COVERAGE = 32928;
lime_graphics_opengl_GL.NO_ERROR = 0;
lime_graphics_opengl_GL.INVALID_ENUM = 1280;
lime_graphics_opengl_GL.INVALID_VALUE = 1281;
lime_graphics_opengl_GL.INVALID_OPERATION = 1282;
lime_graphics_opengl_GL.OUT_OF_MEMORY = 1285;
lime_graphics_opengl_GL.CW = 2304;
lime_graphics_opengl_GL.CCW = 2305;
lime_graphics_opengl_GL.LINE_WIDTH = 2849;
lime_graphics_opengl_GL.ALIASED_POINT_SIZE_RANGE = 33901;
lime_graphics_opengl_GL.ALIASED_LINE_WIDTH_RANGE = 33902;
lime_graphics_opengl_GL.CULL_FACE_MODE = 2885;
lime_graphics_opengl_GL.FRONT_FACE = 2886;
lime_graphics_opengl_GL.DEPTH_RANGE = 2928;
lime_graphics_opengl_GL.DEPTH_WRITEMASK = 2930;
lime_graphics_opengl_GL.DEPTH_CLEAR_VALUE = 2931;
lime_graphics_opengl_GL.DEPTH_FUNC = 2932;
lime_graphics_opengl_GL.STENCIL_CLEAR_VALUE = 2961;
lime_graphics_opengl_GL.STENCIL_FUNC = 2962;
lime_graphics_opengl_GL.STENCIL_FAIL = 2964;
lime_graphics_opengl_GL.STENCIL_PASS_DEPTH_FAIL = 2965;
lime_graphics_opengl_GL.STENCIL_PASS_DEPTH_PASS = 2966;
lime_graphics_opengl_GL.STENCIL_REF = 2967;
lime_graphics_opengl_GL.STENCIL_VALUE_MASK = 2963;
lime_graphics_opengl_GL.STENCIL_WRITEMASK = 2968;
lime_graphics_opengl_GL.STENCIL_BACK_FUNC = 34816;
lime_graphics_opengl_GL.STENCIL_BACK_FAIL = 34817;
lime_graphics_opengl_GL.STENCIL_BACK_PASS_DEPTH_FAIL = 34818;
lime_graphics_opengl_GL.STENCIL_BACK_PASS_DEPTH_PASS = 34819;
lime_graphics_opengl_GL.STENCIL_BACK_REF = 36003;
lime_graphics_opengl_GL.STENCIL_BACK_VALUE_MASK = 36004;
lime_graphics_opengl_GL.STENCIL_BACK_WRITEMASK = 36005;
lime_graphics_opengl_GL.VIEWPORT = 2978;
lime_graphics_opengl_GL.SCISSOR_BOX = 3088;
lime_graphics_opengl_GL.COLOR_CLEAR_VALUE = 3106;
lime_graphics_opengl_GL.COLOR_WRITEMASK = 3107;
lime_graphics_opengl_GL.UNPACK_ALIGNMENT = 3317;
lime_graphics_opengl_GL.PACK_ALIGNMENT = 3333;
lime_graphics_opengl_GL.MAX_TEXTURE_SIZE = 3379;
lime_graphics_opengl_GL.MAX_VIEWPORT_DIMS = 3386;
lime_graphics_opengl_GL.SUBPIXEL_BITS = 3408;
lime_graphics_opengl_GL.RED_BITS = 3410;
lime_graphics_opengl_GL.GREEN_BITS = 3411;
lime_graphics_opengl_GL.BLUE_BITS = 3412;
lime_graphics_opengl_GL.ALPHA_BITS = 3413;
lime_graphics_opengl_GL.DEPTH_BITS = 3414;
lime_graphics_opengl_GL.STENCIL_BITS = 3415;
lime_graphics_opengl_GL.POLYGON_OFFSET_UNITS = 10752;
lime_graphics_opengl_GL.POLYGON_OFFSET_FACTOR = 32824;
lime_graphics_opengl_GL.TEXTURE_BINDING_2D = 32873;
lime_graphics_opengl_GL.SAMPLE_BUFFERS = 32936;
lime_graphics_opengl_GL.SAMPLES = 32937;
lime_graphics_opengl_GL.SAMPLE_COVERAGE_VALUE = 32938;
lime_graphics_opengl_GL.SAMPLE_COVERAGE_INVERT = 32939;
lime_graphics_opengl_GL.NUM_COMPRESSED_TEXTURE_FORMATS = 34466;
lime_graphics_opengl_GL.COMPRESSED_TEXTURE_FORMATS = 34467;
lime_graphics_opengl_GL.DONT_CARE = 4352;
lime_graphics_opengl_GL.FASTEST = 4353;
lime_graphics_opengl_GL.NICEST = 4354;
lime_graphics_opengl_GL.GENERATE_MIPMAP_HINT = 33170;
lime_graphics_opengl_GL.BYTE = 5120;
lime_graphics_opengl_GL.UNSIGNED_BYTE = 5121;
lime_graphics_opengl_GL.SHORT = 5122;
lime_graphics_opengl_GL.UNSIGNED_SHORT = 5123;
lime_graphics_opengl_GL.INT = 5124;
lime_graphics_opengl_GL.UNSIGNED_INT = 5125;
lime_graphics_opengl_GL.FLOAT = 5126;
lime_graphics_opengl_GL.DEPTH_COMPONENT = 6402;
lime_graphics_opengl_GL.ALPHA = 6406;
lime_graphics_opengl_GL.RGB = 6407;
lime_graphics_opengl_GL.RGBA = 6408;
lime_graphics_opengl_GL.LUMINANCE = 6409;
lime_graphics_opengl_GL.LUMINANCE_ALPHA = 6410;
lime_graphics_opengl_GL.UNSIGNED_SHORT_4_4_4_4 = 32819;
lime_graphics_opengl_GL.UNSIGNED_SHORT_5_5_5_1 = 32820;
lime_graphics_opengl_GL.UNSIGNED_SHORT_5_6_5 = 33635;
lime_graphics_opengl_GL.FRAGMENT_SHADER = 35632;
lime_graphics_opengl_GL.VERTEX_SHADER = 35633;
lime_graphics_opengl_GL.MAX_VERTEX_ATTRIBS = 34921;
lime_graphics_opengl_GL.MAX_VERTEX_UNIFORM_VECTORS = 36347;
lime_graphics_opengl_GL.MAX_VARYING_VECTORS = 36348;
lime_graphics_opengl_GL.MAX_COMBINED_TEXTURE_IMAGE_UNITS = 35661;
lime_graphics_opengl_GL.MAX_VERTEX_TEXTURE_IMAGE_UNITS = 35660;
lime_graphics_opengl_GL.MAX_TEXTURE_IMAGE_UNITS = 34930;
lime_graphics_opengl_GL.MAX_FRAGMENT_UNIFORM_VECTORS = 36349;
lime_graphics_opengl_GL.SHADER_TYPE = 35663;
lime_graphics_opengl_GL.DELETE_STATUS = 35712;
lime_graphics_opengl_GL.LINK_STATUS = 35714;
lime_graphics_opengl_GL.VALIDATE_STATUS = 35715;
lime_graphics_opengl_GL.ATTACHED_SHADERS = 35717;
lime_graphics_opengl_GL.ACTIVE_UNIFORMS = 35718;
lime_graphics_opengl_GL.ACTIVE_ATTRIBUTES = 35721;
lime_graphics_opengl_GL.SHADING_LANGUAGE_VERSION = 35724;
lime_graphics_opengl_GL.CURRENT_PROGRAM = 35725;
lime_graphics_opengl_GL.NEVER = 512;
lime_graphics_opengl_GL.LESS = 513;
lime_graphics_opengl_GL.EQUAL = 514;
lime_graphics_opengl_GL.LEQUAL = 515;
lime_graphics_opengl_GL.GREATER = 516;
lime_graphics_opengl_GL.NOTEQUAL = 517;
lime_graphics_opengl_GL.GEQUAL = 518;
lime_graphics_opengl_GL.ALWAYS = 519;
lime_graphics_opengl_GL.KEEP = 7680;
lime_graphics_opengl_GL.REPLACE = 7681;
lime_graphics_opengl_GL.INCR = 7682;
lime_graphics_opengl_GL.DECR = 7683;
lime_graphics_opengl_GL.INVERT = 5386;
lime_graphics_opengl_GL.INCR_WRAP = 34055;
lime_graphics_opengl_GL.DECR_WRAP = 34056;
lime_graphics_opengl_GL.VENDOR = 7936;
lime_graphics_opengl_GL.RENDERER = 7937;
lime_graphics_opengl_GL.VERSION = 7938;
lime_graphics_opengl_GL.EXTENSIONS = 7939;
lime_graphics_opengl_GL.NEAREST = 9728;
lime_graphics_opengl_GL.LINEAR = 9729;
lime_graphics_opengl_GL.NEAREST_MIPMAP_NEAREST = 9984;
lime_graphics_opengl_GL.LINEAR_MIPMAP_NEAREST = 9985;
lime_graphics_opengl_GL.NEAREST_MIPMAP_LINEAR = 9986;
lime_graphics_opengl_GL.LINEAR_MIPMAP_LINEAR = 9987;
lime_graphics_opengl_GL.TEXTURE_MAG_FILTER = 10240;
lime_graphics_opengl_GL.TEXTURE_MIN_FILTER = 10241;
lime_graphics_opengl_GL.TEXTURE_WRAP_S = 10242;
lime_graphics_opengl_GL.TEXTURE_WRAP_T = 10243;
lime_graphics_opengl_GL.TEXTURE_2D = 3553;
lime_graphics_opengl_GL.TEXTURE = 5890;
lime_graphics_opengl_GL.TEXTURE_CUBE_MAP = 34067;
lime_graphics_opengl_GL.TEXTURE_BINDING_CUBE_MAP = 34068;
lime_graphics_opengl_GL.TEXTURE_CUBE_MAP_POSITIVE_X = 34069;
lime_graphics_opengl_GL.TEXTURE_CUBE_MAP_NEGATIVE_X = 34070;
lime_graphics_opengl_GL.TEXTURE_CUBE_MAP_POSITIVE_Y = 34071;
lime_graphics_opengl_GL.TEXTURE_CUBE_MAP_NEGATIVE_Y = 34072;
lime_graphics_opengl_GL.TEXTURE_CUBE_MAP_POSITIVE_Z = 34073;
lime_graphics_opengl_GL.TEXTURE_CUBE_MAP_NEGATIVE_Z = 34074;
lime_graphics_opengl_GL.MAX_CUBE_MAP_TEXTURE_SIZE = 34076;
lime_graphics_opengl_GL.TEXTURE0 = 33984;
lime_graphics_opengl_GL.TEXTURE1 = 33985;
lime_graphics_opengl_GL.TEXTURE2 = 33986;
lime_graphics_opengl_GL.TEXTURE3 = 33987;
lime_graphics_opengl_GL.TEXTURE4 = 33988;
lime_graphics_opengl_GL.TEXTURE5 = 33989;
lime_graphics_opengl_GL.TEXTURE6 = 33990;
lime_graphics_opengl_GL.TEXTURE7 = 33991;
lime_graphics_opengl_GL.TEXTURE8 = 33992;
lime_graphics_opengl_GL.TEXTURE9 = 33993;
lime_graphics_opengl_GL.TEXTURE10 = 33994;
lime_graphics_opengl_GL.TEXTURE11 = 33995;
lime_graphics_opengl_GL.TEXTURE12 = 33996;
lime_graphics_opengl_GL.TEXTURE13 = 33997;
lime_graphics_opengl_GL.TEXTURE14 = 33998;
lime_graphics_opengl_GL.TEXTURE15 = 33999;
lime_graphics_opengl_GL.TEXTURE16 = 34000;
lime_graphics_opengl_GL.TEXTURE17 = 34001;
lime_graphics_opengl_GL.TEXTURE18 = 34002;
lime_graphics_opengl_GL.TEXTURE19 = 34003;
lime_graphics_opengl_GL.TEXTURE20 = 34004;
lime_graphics_opengl_GL.TEXTURE21 = 34005;
lime_graphics_opengl_GL.TEXTURE22 = 34006;
lime_graphics_opengl_GL.TEXTURE23 = 34007;
lime_graphics_opengl_GL.TEXTURE24 = 34008;
lime_graphics_opengl_GL.TEXTURE25 = 34009;
lime_graphics_opengl_GL.TEXTURE26 = 34010;
lime_graphics_opengl_GL.TEXTURE27 = 34011;
lime_graphics_opengl_GL.TEXTURE28 = 34012;
lime_graphics_opengl_GL.TEXTURE29 = 34013;
lime_graphics_opengl_GL.TEXTURE30 = 34014;
lime_graphics_opengl_GL.TEXTURE31 = 34015;
lime_graphics_opengl_GL.ACTIVE_TEXTURE = 34016;
lime_graphics_opengl_GL.REPEAT = 10497;
lime_graphics_opengl_GL.CLAMP_TO_EDGE = 33071;
lime_graphics_opengl_GL.MIRRORED_REPEAT = 33648;
lime_graphics_opengl_GL.FLOAT_VEC2 = 35664;
lime_graphics_opengl_GL.FLOAT_VEC3 = 35665;
lime_graphics_opengl_GL.FLOAT_VEC4 = 35666;
lime_graphics_opengl_GL.INT_VEC2 = 35667;
lime_graphics_opengl_GL.INT_VEC3 = 35668;
lime_graphics_opengl_GL.INT_VEC4 = 35669;
lime_graphics_opengl_GL.BOOL = 35670;
lime_graphics_opengl_GL.BOOL_VEC2 = 35671;
lime_graphics_opengl_GL.BOOL_VEC3 = 35672;
lime_graphics_opengl_GL.BOOL_VEC4 = 35673;
lime_graphics_opengl_GL.FLOAT_MAT2 = 35674;
lime_graphics_opengl_GL.FLOAT_MAT3 = 35675;
lime_graphics_opengl_GL.FLOAT_MAT4 = 35676;
lime_graphics_opengl_GL.SAMPLER_2D = 35678;
lime_graphics_opengl_GL.SAMPLER_CUBE = 35680;
lime_graphics_opengl_GL.VERTEX_ATTRIB_ARRAY_ENABLED = 34338;
lime_graphics_opengl_GL.VERTEX_ATTRIB_ARRAY_SIZE = 34339;
lime_graphics_opengl_GL.VERTEX_ATTRIB_ARRAY_STRIDE = 34340;
lime_graphics_opengl_GL.VERTEX_ATTRIB_ARRAY_TYPE = 34341;
lime_graphics_opengl_GL.VERTEX_ATTRIB_ARRAY_NORMALIZED = 34922;
lime_graphics_opengl_GL.VERTEX_ATTRIB_ARRAY_POINTER = 34373;
lime_graphics_opengl_GL.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING = 34975;
lime_graphics_opengl_GL.IMPLEMENTATION_COLOR_READ_TYPE = 35738;
lime_graphics_opengl_GL.IMPLEMENTATION_COLOR_READ_FORMAT = 35739;
lime_graphics_opengl_GL.VERTEX_PROGRAM_POINT_SIZE = 34370;
lime_graphics_opengl_GL.POINT_SPRITE = 34913;
lime_graphics_opengl_GL.COMPILE_STATUS = 35713;
lime_graphics_opengl_GL.LOW_FLOAT = 36336;
lime_graphics_opengl_GL.MEDIUM_FLOAT = 36337;
lime_graphics_opengl_GL.HIGH_FLOAT = 36338;
lime_graphics_opengl_GL.LOW_INT = 36339;
lime_graphics_opengl_GL.MEDIUM_INT = 36340;
lime_graphics_opengl_GL.HIGH_INT = 36341;
lime_graphics_opengl_GL.FRAMEBUFFER = 36160;
lime_graphics_opengl_GL.RENDERBUFFER = 36161;
lime_graphics_opengl_GL.RGBA4 = 32854;
lime_graphics_opengl_GL.RGB5_A1 = 32855;
lime_graphics_opengl_GL.RGB565 = 36194;
lime_graphics_opengl_GL.DEPTH_COMPONENT16 = 33189;
lime_graphics_opengl_GL.STENCIL_INDEX = 6401;
lime_graphics_opengl_GL.STENCIL_INDEX8 = 36168;
lime_graphics_opengl_GL.DEPTH_STENCIL = 34041;
lime_graphics_opengl_GL.RENDERBUFFER_WIDTH = 36162;
lime_graphics_opengl_GL.RENDERBUFFER_HEIGHT = 36163;
lime_graphics_opengl_GL.RENDERBUFFER_INTERNAL_FORMAT = 36164;
lime_graphics_opengl_GL.RENDERBUFFER_RED_SIZE = 36176;
lime_graphics_opengl_GL.RENDERBUFFER_GREEN_SIZE = 36177;
lime_graphics_opengl_GL.RENDERBUFFER_BLUE_SIZE = 36178;
lime_graphics_opengl_GL.RENDERBUFFER_ALPHA_SIZE = 36179;
lime_graphics_opengl_GL.RENDERBUFFER_DEPTH_SIZE = 36180;
lime_graphics_opengl_GL.RENDERBUFFER_STENCIL_SIZE = 36181;
lime_graphics_opengl_GL.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE = 36048;
lime_graphics_opengl_GL.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME = 36049;
lime_graphics_opengl_GL.FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL = 36050;
lime_graphics_opengl_GL.FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE = 36051;
lime_graphics_opengl_GL.COLOR_ATTACHMENT0 = 36064;
lime_graphics_opengl_GL.DEPTH_ATTACHMENT = 36096;
lime_graphics_opengl_GL.STENCIL_ATTACHMENT = 36128;
lime_graphics_opengl_GL.DEPTH_STENCIL_ATTACHMENT = 33306;
lime_graphics_opengl_GL.NONE = 0;
lime_graphics_opengl_GL.FRAMEBUFFER_COMPLETE = 36053;
lime_graphics_opengl_GL.FRAMEBUFFER_INCOMPLETE_ATTACHMENT = 36054;
lime_graphics_opengl_GL.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT = 36055;
lime_graphics_opengl_GL.FRAMEBUFFER_INCOMPLETE_DIMENSIONS = 36057;
lime_graphics_opengl_GL.FRAMEBUFFER_UNSUPPORTED = 36061;
lime_graphics_opengl_GL.FRAMEBUFFER_BINDING = 36006;
lime_graphics_opengl_GL.RENDERBUFFER_BINDING = 36007;
lime_graphics_opengl_GL.MAX_RENDERBUFFER_SIZE = 34024;
lime_graphics_opengl_GL.INVALID_FRAMEBUFFER_OPERATION = 1286;
lime_graphics_opengl_GL.UNPACK_FLIP_Y_WEBGL = 37440;
lime_graphics_opengl_GL.UNPACK_PREMULTIPLY_ALPHA_WEBGL = 37441;
lime_graphics_opengl_GL.CONTEXT_LOST_WEBGL = 37442;
lime_graphics_opengl_GL.UNPACK_COLORSPACE_CONVERSION_WEBGL = 37443;
lime_graphics_opengl_GL.BROWSER_DEFAULT_WEBGL = 37444;
lime_graphics_opengl_GL.READ_BUFFER = 3074;
lime_graphics_opengl_GL.UNPACK_ROW_LENGTH = 3314;
lime_graphics_opengl_GL.UNPACK_SKIP_ROWS = 3315;
lime_graphics_opengl_GL.UNPACK_SKIP_PIXELS = 3316;
lime_graphics_opengl_GL.PACK_ROW_LENGTH = 3330;
lime_graphics_opengl_GL.PACK_SKIP_ROWS = 3331;
lime_graphics_opengl_GL.PACK_SKIP_PIXELS = 3332;
lime_graphics_opengl_GL.TEXTURE_BINDING_3D = 32874;
lime_graphics_opengl_GL.UNPACK_SKIP_IMAGES = 32877;
lime_graphics_opengl_GL.UNPACK_IMAGE_HEIGHT = 32878;
lime_graphics_opengl_GL.MAX_3D_TEXTURE_SIZE = 32883;
lime_graphics_opengl_GL.MAX_ELEMENTS_VERTICES = 33000;
lime_graphics_opengl_GL.MAX_ELEMENTS_INDICES = 33001;
lime_graphics_opengl_GL.MAX_TEXTURE_LOD_BIAS = 34045;
lime_graphics_opengl_GL.MAX_FRAGMENT_UNIFORM_COMPONENTS = 35657;
lime_graphics_opengl_GL.MAX_VERTEX_UNIFORM_COMPONENTS = 35658;
lime_graphics_opengl_GL.MAX_ARRAY_TEXTURE_LAYERS = 35071;
lime_graphics_opengl_GL.MIN_PROGRAM_TEXEL_OFFSET = 35076;
lime_graphics_opengl_GL.MAX_PROGRAM_TEXEL_OFFSET = 35077;
lime_graphics_opengl_GL.MAX_VARYING_COMPONENTS = 35659;
lime_graphics_opengl_GL.FRAGMENT_SHADER_DERIVATIVE_HINT = 35723;
lime_graphics_opengl_GL.RASTERIZER_DISCARD = 35977;
lime_graphics_opengl_GL.VERTEX_ARRAY_BINDING = 34229;
lime_graphics_opengl_GL.MAX_VERTEX_OUTPUT_COMPONENTS = 37154;
lime_graphics_opengl_GL.MAX_FRAGMENT_INPUT_COMPONENTS = 37157;
lime_graphics_opengl_GL.MAX_SERVER_WAIT_TIMEOUT = 37137;
lime_graphics_opengl_GL.MAX_ELEMENT_INDEX = 36203;
lime_graphics_opengl_GL.RED = 6403;
lime_graphics_opengl_GL.RGB8 = 32849;
lime_graphics_opengl_GL.RGBA8 = 32856;
lime_graphics_opengl_GL.RGB10_A2 = 32857;
lime_graphics_opengl_GL.TEXTURE_3D = 32879;
lime_graphics_opengl_GL.TEXTURE_WRAP_R = 32882;
lime_graphics_opengl_GL.TEXTURE_MIN_LOD = 33082;
lime_graphics_opengl_GL.TEXTURE_MAX_LOD = 33083;
lime_graphics_opengl_GL.TEXTURE_BASE_LEVEL = 33084;
lime_graphics_opengl_GL.TEXTURE_MAX_LEVEL = 33085;
lime_graphics_opengl_GL.TEXTURE_COMPARE_MODE = 34892;
lime_graphics_opengl_GL.TEXTURE_COMPARE_FUNC = 34893;
lime_graphics_opengl_GL.SRGB = 35904;
lime_graphics_opengl_GL.SRGB8 = 35905;
lime_graphics_opengl_GL.SRGB8_ALPHA8 = 35907;
lime_graphics_opengl_GL.COMPARE_REF_TO_TEXTURE = 34894;
lime_graphics_opengl_GL.RGBA32F = 34836;
lime_graphics_opengl_GL.RGB32F = 34837;
lime_graphics_opengl_GL.RGBA16F = 34842;
lime_graphics_opengl_GL.RGB16F = 34843;
lime_graphics_opengl_GL.TEXTURE_2D_ARRAY = 35866;
lime_graphics_opengl_GL.TEXTURE_BINDING_2D_ARRAY = 35869;
lime_graphics_opengl_GL.R11F_G11F_B10F = 35898;
lime_graphics_opengl_GL.RGB9_E5 = 35901;
lime_graphics_opengl_GL.RGBA32UI = 36208;
lime_graphics_opengl_GL.RGB32UI = 36209;
lime_graphics_opengl_GL.RGBA16UI = 36214;
lime_graphics_opengl_GL.RGB16UI = 36215;
lime_graphics_opengl_GL.RGBA8UI = 36220;
lime_graphics_opengl_GL.RGB8UI = 36221;
lime_graphics_opengl_GL.RGBA32I = 36226;
lime_graphics_opengl_GL.RGB32I = 36227;
lime_graphics_opengl_GL.RGBA16I = 36232;
lime_graphics_opengl_GL.RGB16I = 36233;
lime_graphics_opengl_GL.RGBA8I = 36238;
lime_graphics_opengl_GL.RGB8I = 36239;
lime_graphics_opengl_GL.RED_INTEGER = 36244;
lime_graphics_opengl_GL.RGB_INTEGER = 36248;
lime_graphics_opengl_GL.RGBA_INTEGER = 36249;
lime_graphics_opengl_GL.R8 = 33321;
lime_graphics_opengl_GL.RG8 = 33323;
lime_graphics_opengl_GL.R16F = 33325;
lime_graphics_opengl_GL.R32F = 33326;
lime_graphics_opengl_GL.RG16F = 33327;
lime_graphics_opengl_GL.RG32F = 33328;
lime_graphics_opengl_GL.R8I = 33329;
lime_graphics_opengl_GL.R8UI = 33330;
lime_graphics_opengl_GL.R16I = 33331;
lime_graphics_opengl_GL.R16UI = 33332;
lime_graphics_opengl_GL.R32I = 33333;
lime_graphics_opengl_GL.R32UI = 33334;
lime_graphics_opengl_GL.RG8I = 33335;
lime_graphics_opengl_GL.RG8UI = 33336;
lime_graphics_opengl_GL.RG16I = 33337;
lime_graphics_opengl_GL.RG16UI = 33338;
lime_graphics_opengl_GL.RG32I = 33339;
lime_graphics_opengl_GL.RG32UI = 33340;
lime_graphics_opengl_GL.R8_SNORM = 36756;
lime_graphics_opengl_GL.RG8_SNORM = 36757;
lime_graphics_opengl_GL.RGB8_SNORM = 36758;
lime_graphics_opengl_GL.RGBA8_SNORM = 36759;
lime_graphics_opengl_GL.RGB10_A2UI = 36975;
lime_graphics_opengl_GL.TEXTURE_IMMUTABLE_FORMAT = 37167;
lime_graphics_opengl_GL.TEXTURE_IMMUTABLE_LEVELS = 33503;
lime_graphics_opengl_GL.UNSIGNED_INT_2_10_10_10_REV = 33640;
lime_graphics_opengl_GL.UNSIGNED_INT_10F_11F_11F_REV = 35899;
lime_graphics_opengl_GL.UNSIGNED_INT_5_9_9_9_REV = 35902;
lime_graphics_opengl_GL.FLOAT_32_UNSIGNED_INT_24_8_REV = 36269;
lime_graphics_opengl_GL.UNSIGNED_INT_24_8 = 34042;
lime_graphics_opengl_GL.HALF_FLOAT = 5131;
lime_graphics_opengl_GL.RG = 33319;
lime_graphics_opengl_GL.RG_INTEGER = 33320;
lime_graphics_opengl_GL.INT_2_10_10_10_REV = 36255;
lime_graphics_opengl_GL.CURRENT_QUERY = 34917;
lime_graphics_opengl_GL.QUERY_RESULT = 34918;
lime_graphics_opengl_GL.QUERY_RESULT_AVAILABLE = 34919;
lime_graphics_opengl_GL.ANY_SAMPLES_PASSED = 35887;
lime_graphics_opengl_GL.ANY_SAMPLES_PASSED_CONSERVATIVE = 36202;
lime_graphics_opengl_GL.MAX_DRAW_BUFFERS = 34852;
lime_graphics_opengl_GL.DRAW_BUFFER0 = 34853;
lime_graphics_opengl_GL.DRAW_BUFFER1 = 34854;
lime_graphics_opengl_GL.DRAW_BUFFER2 = 34855;
lime_graphics_opengl_GL.DRAW_BUFFER3 = 34856;
lime_graphics_opengl_GL.DRAW_BUFFER4 = 34857;
lime_graphics_opengl_GL.DRAW_BUFFER5 = 34858;
lime_graphics_opengl_GL.DRAW_BUFFER6 = 34859;
lime_graphics_opengl_GL.DRAW_BUFFER7 = 34860;
lime_graphics_opengl_GL.DRAW_BUFFER8 = 34861;
lime_graphics_opengl_GL.DRAW_BUFFER9 = 34862;
lime_graphics_opengl_GL.DRAW_BUFFER10 = 34863;
lime_graphics_opengl_GL.DRAW_BUFFER11 = 34864;
lime_graphics_opengl_GL.DRAW_BUFFER12 = 34865;
lime_graphics_opengl_GL.DRAW_BUFFER13 = 34866;
lime_graphics_opengl_GL.DRAW_BUFFER14 = 34867;
lime_graphics_opengl_GL.DRAW_BUFFER15 = 34868;
lime_graphics_opengl_GL.MAX_COLOR_ATTACHMENTS = 36063;
lime_graphics_opengl_GL.COLOR_ATTACHMENT1 = 36065;
lime_graphics_opengl_GL.COLOR_ATTACHMENT2 = 36066;
lime_graphics_opengl_GL.COLOR_ATTACHMENT3 = 36067;
lime_graphics_opengl_GL.COLOR_ATTACHMENT4 = 36068;
lime_graphics_opengl_GL.COLOR_ATTACHMENT5 = 36069;
lime_graphics_opengl_GL.COLOR_ATTACHMENT6 = 36070;
lime_graphics_opengl_GL.COLOR_ATTACHMENT7 = 36071;
lime_graphics_opengl_GL.COLOR_ATTACHMENT8 = 36072;
lime_graphics_opengl_GL.COLOR_ATTACHMENT9 = 36073;
lime_graphics_opengl_GL.COLOR_ATTACHMENT10 = 36074;
lime_graphics_opengl_GL.COLOR_ATTACHMENT11 = 36075;
lime_graphics_opengl_GL.COLOR_ATTACHMENT12 = 36076;
lime_graphics_opengl_GL.COLOR_ATTACHMENT13 = 36077;
lime_graphics_opengl_GL.COLOR_ATTACHMENT14 = 36078;
lime_graphics_opengl_GL.COLOR_ATTACHMENT15 = 36079;
lime_graphics_opengl_GL.SAMPLER_3D = 35679;
lime_graphics_opengl_GL.SAMPLER_2D_SHADOW = 35682;
lime_graphics_opengl_GL.SAMPLER_2D_ARRAY = 36289;
lime_graphics_opengl_GL.SAMPLER_2D_ARRAY_SHADOW = 36292;
lime_graphics_opengl_GL.SAMPLER_CUBE_SHADOW = 36293;
lime_graphics_opengl_GL.INT_SAMPLER_2D = 36298;
lime_graphics_opengl_GL.INT_SAMPLER_3D = 36299;
lime_graphics_opengl_GL.INT_SAMPLER_CUBE = 36300;
lime_graphics_opengl_GL.INT_SAMPLER_2D_ARRAY = 36303;
lime_graphics_opengl_GL.UNSIGNED_INT_SAMPLER_2D = 36306;
lime_graphics_opengl_GL.UNSIGNED_INT_SAMPLER_3D = 36307;
lime_graphics_opengl_GL.UNSIGNED_INT_SAMPLER_CUBE = 36308;
lime_graphics_opengl_GL.UNSIGNED_INT_SAMPLER_2D_ARRAY = 36311;
lime_graphics_opengl_GL.MAX_SAMPLES = 36183;
lime_graphics_opengl_GL.SAMPLER_BINDING = 35097;
lime_graphics_opengl_GL.PIXEL_PACK_BUFFER = 35051;
lime_graphics_opengl_GL.PIXEL_UNPACK_BUFFER = 35052;
lime_graphics_opengl_GL.PIXEL_PACK_BUFFER_BINDING = 35053;
lime_graphics_opengl_GL.PIXEL_UNPACK_BUFFER_BINDING = 35055;
lime_graphics_opengl_GL.COPY_READ_BUFFER = 36662;
lime_graphics_opengl_GL.COPY_WRITE_BUFFER = 36663;
lime_graphics_opengl_GL.COPY_READ_BUFFER_BINDING = 36662;
lime_graphics_opengl_GL.COPY_WRITE_BUFFER_BINDING = 36663;
lime_graphics_opengl_GL.FLOAT_MAT2x3 = 35685;
lime_graphics_opengl_GL.FLOAT_MAT2x4 = 35686;
lime_graphics_opengl_GL.FLOAT_MAT3x2 = 35687;
lime_graphics_opengl_GL.FLOAT_MAT3x4 = 35688;
lime_graphics_opengl_GL.FLOAT_MAT4x2 = 35689;
lime_graphics_opengl_GL.FLOAT_MAT4x3 = 35690;
lime_graphics_opengl_GL.UNSIGNED_INT_VEC2 = 36294;
lime_graphics_opengl_GL.UNSIGNED_INT_VEC3 = 36295;
lime_graphics_opengl_GL.UNSIGNED_INT_VEC4 = 36296;
lime_graphics_opengl_GL.UNSIGNED_NORMALIZED = 35863;
lime_graphics_opengl_GL.SIGNED_NORMALIZED = 36764;
lime_graphics_opengl_GL.VERTEX_ATTRIB_ARRAY_INTEGER = 35069;
lime_graphics_opengl_GL.VERTEX_ATTRIB_ARRAY_DIVISOR = 35070;
lime_graphics_opengl_GL.TRANSFORM_FEEDBACK_BUFFER_MODE = 35967;
lime_graphics_opengl_GL.MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS = 35968;
lime_graphics_opengl_GL.TRANSFORM_FEEDBACK_VARYINGS = 35971;
lime_graphics_opengl_GL.TRANSFORM_FEEDBACK_BUFFER_START = 35972;
lime_graphics_opengl_GL.TRANSFORM_FEEDBACK_BUFFER_SIZE = 35973;
lime_graphics_opengl_GL.TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN = 35976;
lime_graphics_opengl_GL.MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS = 35978;
lime_graphics_opengl_GL.MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS = 35979;
lime_graphics_opengl_GL.INTERLEAVED_ATTRIBS = 35980;
lime_graphics_opengl_GL.SEPARATE_ATTRIBS = 35981;
lime_graphics_opengl_GL.TRANSFORM_FEEDBACK_BUFFER = 35982;
lime_graphics_opengl_GL.TRANSFORM_FEEDBACK_BUFFER_BINDING = 35983;
lime_graphics_opengl_GL.TRANSFORM_FEEDBACK = 36386;
lime_graphics_opengl_GL.TRANSFORM_FEEDBACK_PAUSED = 36387;
lime_graphics_opengl_GL.TRANSFORM_FEEDBACK_ACTIVE = 36388;
lime_graphics_opengl_GL.TRANSFORM_FEEDBACK_BINDING = 36389;
lime_graphics_opengl_GL.FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING = 33296;
lime_graphics_opengl_GL.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE = 33297;
lime_graphics_opengl_GL.FRAMEBUFFER_ATTACHMENT_RED_SIZE = 33298;
lime_graphics_opengl_GL.FRAMEBUFFER_ATTACHMENT_GREEN_SIZE = 33299;
lime_graphics_opengl_GL.FRAMEBUFFER_ATTACHMENT_BLUE_SIZE = 33300;
lime_graphics_opengl_GL.FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE = 33301;
lime_graphics_opengl_GL.FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE = 33302;
lime_graphics_opengl_GL.FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE = 33303;
lime_graphics_opengl_GL.FRAMEBUFFER_DEFAULT = 33304;
lime_graphics_opengl_GL.DEPTH24_STENCIL8 = 35056;
lime_graphics_opengl_GL.DRAW_FRAMEBUFFER_BINDING = 36006;
lime_graphics_opengl_GL.READ_FRAMEBUFFER = 36008;
lime_graphics_opengl_GL.DRAW_FRAMEBUFFER = 36009;
lime_graphics_opengl_GL.READ_FRAMEBUFFER_BINDING = 36010;
lime_graphics_opengl_GL.RENDERBUFFER_SAMPLES = 36011;
lime_graphics_opengl_GL.FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER = 36052;
lime_graphics_opengl_GL.FRAMEBUFFER_INCOMPLETE_MULTISAMPLE = 36182;
lime_graphics_opengl_GL.UNIFORM_BUFFER = 35345;
lime_graphics_opengl_GL.UNIFORM_BUFFER_BINDING = 35368;
lime_graphics_opengl_GL.UNIFORM_BUFFER_START = 35369;
lime_graphics_opengl_GL.UNIFORM_BUFFER_SIZE = 35370;
lime_graphics_opengl_GL.MAX_VERTEX_UNIFORM_BLOCKS = 35371;
lime_graphics_opengl_GL.MAX_FRAGMENT_UNIFORM_BLOCKS = 35373;
lime_graphics_opengl_GL.MAX_COMBINED_UNIFORM_BLOCKS = 35374;
lime_graphics_opengl_GL.MAX_UNIFORM_BUFFER_BINDINGS = 35375;
lime_graphics_opengl_GL.MAX_UNIFORM_BLOCK_SIZE = 35376;
lime_graphics_opengl_GL.MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS = 35377;
lime_graphics_opengl_GL.MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS = 35379;
lime_graphics_opengl_GL.UNIFORM_BUFFER_OFFSET_ALIGNMENT = 35380;
lime_graphics_opengl_GL.ACTIVE_UNIFORM_BLOCKS = 35382;
lime_graphics_opengl_GL.UNIFORM_TYPE = 35383;
lime_graphics_opengl_GL.UNIFORM_SIZE = 35384;
lime_graphics_opengl_GL.UNIFORM_BLOCK_INDEX = 35386;
lime_graphics_opengl_GL.UNIFORM_OFFSET = 35387;
lime_graphics_opengl_GL.UNIFORM_ARRAY_STRIDE = 35388;
lime_graphics_opengl_GL.UNIFORM_MATRIX_STRIDE = 35389;
lime_graphics_opengl_GL.UNIFORM_IS_ROW_MAJOR = 35390;
lime_graphics_opengl_GL.UNIFORM_BLOCK_BINDING = 35391;
lime_graphics_opengl_GL.UNIFORM_BLOCK_DATA_SIZE = 35392;
lime_graphics_opengl_GL.UNIFORM_BLOCK_ACTIVE_UNIFORMS = 35394;
lime_graphics_opengl_GL.UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES = 35395;
lime_graphics_opengl_GL.UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER = 35396;
lime_graphics_opengl_GL.UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER = 35398;
lime_graphics_opengl_GL.OBJECT_TYPE = 37138;
lime_graphics_opengl_GL.SYNC_CONDITION = 37139;
lime_graphics_opengl_GL.SYNC_STATUS = 37140;
lime_graphics_opengl_GL.SYNC_FLAGS = 37141;
lime_graphics_opengl_GL.SYNC_FENCE = 37142;
lime_graphics_opengl_GL.SYNC_GPU_COMMANDS_COMPLETE = 37143;
lime_graphics_opengl_GL.UNSIGNALED = 37144;
lime_graphics_opengl_GL.SIGNALED = 37145;
lime_graphics_opengl_GL.ALREADY_SIGNALED = 37146;
lime_graphics_opengl_GL.TIMEOUT_EXPIRED = 37147;
lime_graphics_opengl_GL.CONDITION_SATISFIED = 37148;
lime_graphics_opengl_GL.WAIT_FAILED = 37149;
lime_graphics_opengl_GL.SYNC_FLUSH_COMMANDS_BIT = 1;
lime_graphics_opengl_GL.COLOR = 6144;
lime_graphics_opengl_GL.DEPTH = 6145;
lime_graphics_opengl_GL.STENCIL = 6146;
lime_graphics_opengl_GL.MIN = 32775;
lime_graphics_opengl_GL.MAX = 32776;
lime_graphics_opengl_GL.DEPTH_COMPONENT24 = 33190;
lime_graphics_opengl_GL.STREAM_READ = 35041;
lime_graphics_opengl_GL.STREAM_COPY = 35042;
lime_graphics_opengl_GL.STATIC_READ = 35045;
lime_graphics_opengl_GL.STATIC_COPY = 35046;
lime_graphics_opengl_GL.DYNAMIC_READ = 35049;
lime_graphics_opengl_GL.DYNAMIC_COPY = 35050;
lime_graphics_opengl_GL.DEPTH_COMPONENT32F = 36012;
lime_graphics_opengl_GL.DEPTH32F_STENCIL8 = 36013;
lime_graphics_opengl_GL.INVALID_INDEX = -1;
lime_graphics_opengl_GL.TIMEOUT_IGNORED = -1;
lime_graphics_opengl_GL.MAX_CLIENT_WAIT_TIMEOUT_WEBGL = 37447;
lime_math_ColorMatrix.__identity = [1.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0];
lime_math_Matrix4.__identity = [1.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,1.0];
lime_media_openal_AL.NONE = 0;
lime_media_openal_AL.FALSE = 0;
lime_media_openal_AL.TRUE = 1;
lime_media_openal_AL.SOURCE_RELATIVE = 514;
lime_media_openal_AL.CONE_INNER_ANGLE = 4097;
lime_media_openal_AL.CONE_OUTER_ANGLE = 4098;
lime_media_openal_AL.PITCH = 4099;
lime_media_openal_AL.POSITION = 4100;
lime_media_openal_AL.DIRECTION = 4101;
lime_media_openal_AL.VELOCITY = 4102;
lime_media_openal_AL.LOOPING = 4103;
lime_media_openal_AL.BUFFER = 4105;
lime_media_openal_AL.GAIN = 4106;
lime_media_openal_AL.MIN_GAIN = 4109;
lime_media_openal_AL.MAX_GAIN = 4110;
lime_media_openal_AL.ORIENTATION = 4111;
lime_media_openal_AL.SOURCE_STATE = 4112;
lime_media_openal_AL.INITIAL = 4113;
lime_media_openal_AL.PLAYING = 4114;
lime_media_openal_AL.PAUSED = 4115;
lime_media_openal_AL.STOPPED = 4116;
lime_media_openal_AL.BUFFERS_QUEUED = 4117;
lime_media_openal_AL.BUFFERS_PROCESSED = 4118;
lime_media_openal_AL.REFERENCE_DISTANCE = 4128;
lime_media_openal_AL.ROLLOFF_FACTOR = 4129;
lime_media_openal_AL.CONE_OUTER_GAIN = 4130;
lime_media_openal_AL.MAX_DISTANCE = 4131;
lime_media_openal_AL.SEC_OFFSET = 4132;
lime_media_openal_AL.SAMPLE_OFFSET = 4133;
lime_media_openal_AL.BYTE_OFFSET = 4134;
lime_media_openal_AL.SOURCE_TYPE = 4135;
lime_media_openal_AL.STATIC = 4136;
lime_media_openal_AL.STREAMING = 4137;
lime_media_openal_AL.UNDETERMINED = 4144;
lime_media_openal_AL.FORMAT_MONO8 = 4352;
lime_media_openal_AL.FORMAT_MONO16 = 4353;
lime_media_openal_AL.FORMAT_STEREO8 = 4354;
lime_media_openal_AL.FORMAT_STEREO16 = 4355;
lime_media_openal_AL.FREQUENCY = 8193;
lime_media_openal_AL.BITS = 8194;
lime_media_openal_AL.CHANNELS = 8195;
lime_media_openal_AL.SIZE = 8196;
lime_media_openal_AL.NO_ERROR = 0;
lime_media_openal_AL.INVALID_NAME = 40961;
lime_media_openal_AL.INVALID_ENUM = 40962;
lime_media_openal_AL.INVALID_VALUE = 40963;
lime_media_openal_AL.INVALID_OPERATION = 40964;
lime_media_openal_AL.OUT_OF_MEMORY = 40965;
lime_media_openal_AL.VENDOR = 45057;
lime_media_openal_AL.VERSION = 45058;
lime_media_openal_AL.RENDERER = 45059;
lime_media_openal_AL.EXTENSIONS = 45060;
lime_media_openal_AL.DOPPLER_FACTOR = 49152;
lime_media_openal_AL.SPEED_OF_SOUND = 49155;
lime_media_openal_AL.DOPPLER_VELOCITY = 49153;
lime_media_openal_AL.DISTANCE_MODEL = 53248;
lime_media_openal_AL.INVERSE_DISTANCE = 53249;
lime_media_openal_AL.INVERSE_DISTANCE_CLAMPED = 53250;
lime_media_openal_AL.LINEAR_DISTANCE = 53251;
lime_media_openal_AL.LINEAR_DISTANCE_CLAMPED = 53252;
lime_media_openal_AL.EXPONENT_DISTANCE = 53253;
lime_media_openal_AL.EXPONENT_DISTANCE_CLAMPED = 53254;
lime_media_openal_AL.METERS_PER_UNIT = 131076;
lime_media_openal_AL.DIRECT_FILTER = 131077;
lime_media_openal_AL.AUXILIARY_SEND_FILTER = 131078;
lime_media_openal_AL.AIR_ABSORPTION_FACTOR = 131079;
lime_media_openal_AL.ROOM_ROLLOFF_FACTOR = 131080;
lime_media_openal_AL.CONE_OUTER_GAINHF = 131081;
lime_media_openal_AL.DIRECT_FILTER_GAINHF_AUTO = 131082;
lime_media_openal_AL.AUXILIARY_SEND_FILTER_GAIN_AUTO = 131083;
lime_media_openal_AL.AUXILIARY_SEND_FILTER_GAINHF_AUTO = 131084;
lime_media_openal_AL.REVERB_DENSITY = 1;
lime_media_openal_AL.REVERB_DIFFUSION = 2;
lime_media_openal_AL.REVERB_GAIN = 3;
lime_media_openal_AL.REVERB_GAINHF = 4;
lime_media_openal_AL.REVERB_DECAY_TIME = 5;
lime_media_openal_AL.REVERB_DECAY_HFRATIO = 6;
lime_media_openal_AL.REVERB_REFLECTIONS_GAIN = 7;
lime_media_openal_AL.REVERB_REFLECTIONS_DELAY = 8;
lime_media_openal_AL.REVERB_LATE_REVERB_GAIN = 9;
lime_media_openal_AL.REVERB_LATE_REVERB_DELAY = 10;
lime_media_openal_AL.REVERB_AIR_ABSORPTION_GAINHF = 11;
lime_media_openal_AL.REVERB_ROOM_ROLLOFF_FACTOR = 12;
lime_media_openal_AL.REVERB_DECAY_HFLIMIT = 13;
lime_media_openal_AL.EAXREVERB_DENSITY = 1;
lime_media_openal_AL.EAXREVERB_DIFFUSION = 2;
lime_media_openal_AL.EAXREVERB_GAIN = 3;
lime_media_openal_AL.EAXREVERB_GAINHF = 4;
lime_media_openal_AL.EAXREVERB_GAINLF = 5;
lime_media_openal_AL.EAXREVERB_DECAY_TIME = 6;
lime_media_openal_AL.EAXREVERB_DECAY_HFRATIO = 7;
lime_media_openal_AL.EAXREVERB_DECAY_LFRATIO = 8;
lime_media_openal_AL.EAXREVERB_REFLECTIONS_GAIN = 9;
lime_media_openal_AL.EAXREVERB_REFLECTIONS_DELAY = 10;
lime_media_openal_AL.EAXREVERB_REFLECTIONS_PAN = 11;
lime_media_openal_AL.EAXREVERB_LATE_REVERB_GAIN = 12;
lime_media_openal_AL.EAXREVERB_LATE_REVERB_DELAY = 13;
lime_media_openal_AL.EAXREVERB_LATE_REVERB_PAN = 14;
lime_media_openal_AL.EAXREVERB_ECHO_TIME = 15;
lime_media_openal_AL.EAXREVERB_ECHO_DEPTH = 16;
lime_media_openal_AL.EAXREVERB_MODULATION_TIME = 17;
lime_media_openal_AL.EAXREVERB_MODULATION_DEPTH = 18;
lime_media_openal_AL.EAXREVERB_AIR_ABSORPTION_GAINHF = 19;
lime_media_openal_AL.EAXREVERB_HFREFERENCE = 20;
lime_media_openal_AL.EAXREVERB_LFREFERENCE = 21;
lime_media_openal_AL.EAXREVERB_ROOM_ROLLOFF_FACTOR = 22;
lime_media_openal_AL.EAXREVERB_DECAY_HFLIMIT = 23;
lime_media_openal_AL.CHORUS_WAVEFORM = 1;
lime_media_openal_AL.CHORUS_PHASE = 2;
lime_media_openal_AL.CHORUS_RATE = 3;
lime_media_openal_AL.CHORUS_DEPTH = 4;
lime_media_openal_AL.CHORUS_FEEDBACK = 5;
lime_media_openal_AL.CHORUS_DELAY = 6;
lime_media_openal_AL.DISTORTION_EDGE = 1;
lime_media_openal_AL.DISTORTION_GAIN = 2;
lime_media_openal_AL.DISTORTION_LOWPASS_CUTOFF = 3;
lime_media_openal_AL.DISTORTION_EQCENTER = 4;
lime_media_openal_AL.DISTORTION_EQBANDWIDTH = 5;
lime_media_openal_AL.ECHO_DELAY = 1;
lime_media_openal_AL.ECHO_LRDELAY = 2;
lime_media_openal_AL.ECHO_DAMPING = 3;
lime_media_openal_AL.ECHO_FEEDBACK = 4;
lime_media_openal_AL.ECHO_SPREAD = 5;
lime_media_openal_AL.FLANGER_WAVEFORM = 1;
lime_media_openal_AL.FLANGER_PHASE = 2;
lime_media_openal_AL.FLANGER_RATE = 3;
lime_media_openal_AL.FLANGER_DEPTH = 4;
lime_media_openal_AL.FLANGER_FEEDBACK = 5;
lime_media_openal_AL.FLANGER_DELAY = 6;
lime_media_openal_AL.FREQUENCY_SHIFTER_FREQUENCY = 1;
lime_media_openal_AL.FREQUENCY_SHIFTER_LEFT_DIRECTION = 2;
lime_media_openal_AL.FREQUENCY_SHIFTER_RIGHT_DIRECTION = 3;
lime_media_openal_AL.VOCAL_MORPHER_PHONEMEA = 1;
lime_media_openal_AL.VOCAL_MORPHER_PHONEMEA_COARSE_TUNING = 2;
lime_media_openal_AL.VOCAL_MORPHER_PHONEMEB = 3;
lime_media_openal_AL.VOCAL_MORPHER_PHONEMEB_COARSE_TUNING = 4;
lime_media_openal_AL.VOCAL_MORPHER_WAVEFORM = 5;
lime_media_openal_AL.VOCAL_MORPHER_RATE = 6;
lime_media_openal_AL.PITCH_SHIFTER_COARSE_TUNE = 1;
lime_media_openal_AL.PITCH_SHIFTER_FINE_TUNE = 2;
lime_media_openal_AL.RING_MODULATOR_FREQUENCY = 1;
lime_media_openal_AL.RING_MODULATOR_HIGHPASS_CUTOFF = 2;
lime_media_openal_AL.RING_MODULATOR_WAVEFORM = 3;
lime_media_openal_AL.AUTOWAH_ATTACK_TIME = 1;
lime_media_openal_AL.AUTOWAH_RELEASE_TIME = 2;
lime_media_openal_AL.AUTOWAH_RESONANCE = 3;
lime_media_openal_AL.AUTOWAH_PEAK_GAIN = 4;
lime_media_openal_AL.COMPRESSOR_ONOFF = 1;
lime_media_openal_AL.EQUALIZER_LOW_GAIN = 1;
lime_media_openal_AL.EQUALIZER_LOW_CUTOFF = 2;
lime_media_openal_AL.EQUALIZER_MID1_GAIN = 3;
lime_media_openal_AL.EQUALIZER_MID1_CENTER = 4;
lime_media_openal_AL.EQUALIZER_MID1_WIDTH = 5;
lime_media_openal_AL.EQUALIZER_MID2_GAIN = 6;
lime_media_openal_AL.EQUALIZER_MID2_CENTER = 7;
lime_media_openal_AL.EQUALIZER_MID2_WIDTH = 8;
lime_media_openal_AL.EQUALIZER_HIGH_GAIN = 9;
lime_media_openal_AL.EQUALIZER_HIGH_CUTOFF = 10;
lime_media_openal_AL.EFFECT_FIRST_PARAMETER = 0;
lime_media_openal_AL.EFFECT_LAST_PARAMETER = 32768;
lime_media_openal_AL.EFFECT_TYPE = 32769;
lime_media_openal_AL.EFFECT_NULL = 0;
lime_media_openal_AL.EFFECT_EAXREVERB = 32768;
lime_media_openal_AL.EFFECT_REVERB = 1;
lime_media_openal_AL.EFFECT_CHORUS = 2;
lime_media_openal_AL.EFFECT_DISTORTION = 3;
lime_media_openal_AL.EFFECT_ECHO = 4;
lime_media_openal_AL.EFFECT_FLANGER = 5;
lime_media_openal_AL.EFFECT_FREQUENCY_SHIFTER = 6;
lime_media_openal_AL.EFFECT_VOCAL_MORPHER = 7;
lime_media_openal_AL.EFFECT_PITCH_SHIFTER = 8;
lime_media_openal_AL.EFFECT_RING_MODULATOR = 9;
lime_media_openal_AL.FFECT_AUTOWAH = 10;
lime_media_openal_AL.EFFECT_AUTOWAH = 10;
lime_media_openal_AL.EFFECT_COMPRESSOR = 11;
lime_media_openal_AL.EFFECT_EQUALIZER = 12;
lime_media_openal_AL.EFFECTSLOT_EFFECT = 1;
lime_media_openal_AL.EFFECTSLOT_GAIN = 2;
lime_media_openal_AL.EFFECTSLOT_AUXILIARY_SEND_AUTO = 3;
lime_media_openal_AL.LOWPASS_GAIN = 1;
lime_media_openal_AL.LOWPASS_GAINHF = 2;
lime_media_openal_AL.HIGHPASS_GAIN = 1;
lime_media_openal_AL.HIGHPASS_GAINLF = 2;
lime_media_openal_AL.BANDPASS_GAIN = 1;
lime_media_openal_AL.BANDPASS_GAINLF = 2;
lime_media_openal_AL.BANDPASS_GAINHF = 3;
lime_media_openal_AL.FILTER_FIRST_PARAMETER = 0;
lime_media_openal_AL.FILTER_LAST_PARAMETER = 32768;
lime_media_openal_AL.FILTER_TYPE = 32769;
lime_media_openal_AL.FILTER_NULL = 0;
lime_media_openal_AL.FILTER_LOWPASS = 1;
lime_media_openal_AL.FILTER_HIGHPASS = 2;
lime_media_openal_AL.FILTER_BANDPASS = 3;
lime_media_openal_ALC.FALSE = 0;
lime_media_openal_ALC.TRUE = 1;
lime_media_openal_ALC.FREQUENCY = 4103;
lime_media_openal_ALC.REFRESH = 4104;
lime_media_openal_ALC.SYNC = 4105;
lime_media_openal_ALC.MONO_SOURCES = 4112;
lime_media_openal_ALC.STEREO_SOURCES = 4113;
lime_media_openal_ALC.NO_ERROR = 0;
lime_media_openal_ALC.INVALID_DEVICE = 40961;
lime_media_openal_ALC.INVALID_CONTEXT = 40962;
lime_media_openal_ALC.INVALID_ENUM = 40963;
lime_media_openal_ALC.INVALID_VALUE = 40964;
lime_media_openal_ALC.OUT_OF_MEMORY = 40965;
lime_media_openal_ALC.ATTRIBUTES_SIZE = 4098;
lime_media_openal_ALC.ALL_ATTRIBUTES = 4099;
lime_media_openal_ALC.DEFAULT_DEVICE_SPECIFIER = 4100;
lime_media_openal_ALC.DEVICE_SPECIFIER = 4101;
lime_media_openal_ALC.EXTENSIONS = 4102;
lime_media_openal_ALC.ENUMERATE_ALL_EXT = 1;
lime_media_openal_ALC.DEFAULT_ALL_DEVICES_SPECIFIER = 4114;
lime_media_openal_ALC.ALL_DEVICES_SPECIFIER = 4115;
lime_system_Clipboard.onUpdate = new lime_app__$Event_$Void_$Void();
lime_system_Clipboard.__updated = false;
lime_system_JNI.alreadyCreated = new haxe_ds_StringMap();
lime_system_JNI.initialized = false;
lime_system_Sensor.sensorByID = new haxe_ds_IntMap();
lime_system_Sensor.sensors = [];
lime_system_System.__directories = new haxe_ds_IntMap();
lime_system_ThreadPool.workLoad = 0.5;
lime_system_ThreadPool.__totalWorkPriority = 0;
lime_system_JobData.nextID = 0;
lime_ui_Gamepad.devices = new haxe_ds_IntMap();
lime_ui_Gamepad.onConnect = new lime_app__$Event_$lime_$ui_$Gamepad_$Void();
lime_ui_GamepadAxis.LEFT_X = 0;
lime_ui_GamepadAxis.LEFT_Y = 1;
lime_ui_GamepadAxis.RIGHT_X = 2;
lime_ui_GamepadAxis.RIGHT_Y = 3;
lime_ui_GamepadAxis.TRIGGER_LEFT = 4;
lime_ui_GamepadAxis.TRIGGER_RIGHT = 5;
lime_ui_GamepadButton.A = 0;
lime_ui_GamepadButton.B = 1;
lime_ui_GamepadButton.X = 2;
lime_ui_GamepadButton.Y = 3;
lime_ui_GamepadButton.BACK = 4;
lime_ui_GamepadButton.GUIDE = 5;
lime_ui_GamepadButton.START = 6;
lime_ui_GamepadButton.LEFT_STICK = 7;
lime_ui_GamepadButton.RIGHT_STICK = 8;
lime_ui_GamepadButton.LEFT_SHOULDER = 9;
lime_ui_GamepadButton.RIGHT_SHOULDER = 10;
lime_ui_GamepadButton.DPAD_UP = 11;
lime_ui_GamepadButton.DPAD_DOWN = 12;
lime_ui_GamepadButton.DPAD_LEFT = 13;
lime_ui_GamepadButton.DPAD_RIGHT = 14;
lime_ui_Joystick.devices = new haxe_ds_IntMap();
lime_ui_Joystick.onConnect = new lime_app__$Event_$lime_$ui_$Joystick_$Void();
lime_ui_JoystickHatPosition.CENTER = 0;
lime_ui_JoystickHatPosition.DOWN = 4;
lime_ui_JoystickHatPosition.LEFT = 8;
lime_ui_JoystickHatPosition.RIGHT = 2;
lime_ui_JoystickHatPosition.UP = 1;
lime_ui_JoystickHatPosition.DOWN_LEFT = 12;
lime_ui_JoystickHatPosition.DOWN_RIGHT = 6;
lime_ui_JoystickHatPosition.UP_LEFT = 9;
lime_ui_JoystickHatPosition.UP_RIGHT = 3;
lime_ui_KeyCode.UNKNOWN = 0;
lime_ui_KeyCode.BACKSPACE = 8;
lime_ui_KeyCode.TAB = 9;
lime_ui_KeyCode.RETURN = 13;
lime_ui_KeyCode.ESCAPE = 27;
lime_ui_KeyCode.SPACE = 32;
lime_ui_KeyCode.EXCLAMATION = 33;
lime_ui_KeyCode.QUOTE = 34;
lime_ui_KeyCode.HASH = 35;
lime_ui_KeyCode.DOLLAR = 36;
lime_ui_KeyCode.PERCENT = 37;
lime_ui_KeyCode.AMPERSAND = 38;
lime_ui_KeyCode.SINGLE_QUOTE = 39;
lime_ui_KeyCode.LEFT_PARENTHESIS = 40;
lime_ui_KeyCode.RIGHT_PARENTHESIS = 41;
lime_ui_KeyCode.ASTERISK = 42;
lime_ui_KeyCode.PLUS = 43;
lime_ui_KeyCode.COMMA = 44;
lime_ui_KeyCode.MINUS = 45;
lime_ui_KeyCode.PERIOD = 46;
lime_ui_KeyCode.SLASH = 47;
lime_ui_KeyCode.NUMBER_0 = 48;
lime_ui_KeyCode.NUMBER_1 = 49;
lime_ui_KeyCode.NUMBER_2 = 50;
lime_ui_KeyCode.NUMBER_3 = 51;
lime_ui_KeyCode.NUMBER_4 = 52;
lime_ui_KeyCode.NUMBER_5 = 53;
lime_ui_KeyCode.NUMBER_6 = 54;
lime_ui_KeyCode.NUMBER_7 = 55;
lime_ui_KeyCode.NUMBER_8 = 56;
lime_ui_KeyCode.NUMBER_9 = 57;
lime_ui_KeyCode.COLON = 58;
lime_ui_KeyCode.SEMICOLON = 59;
lime_ui_KeyCode.LESS_THAN = 60;
lime_ui_KeyCode.EQUALS = 61;
lime_ui_KeyCode.GREATER_THAN = 62;
lime_ui_KeyCode.QUESTION = 63;
lime_ui_KeyCode.AT = 64;
lime_ui_KeyCode.LEFT_BRACKET = 91;
lime_ui_KeyCode.BACKSLASH = 92;
lime_ui_KeyCode.RIGHT_BRACKET = 93;
lime_ui_KeyCode.CARET = 94;
lime_ui_KeyCode.UNDERSCORE = 95;
lime_ui_KeyCode.GRAVE = 96;
lime_ui_KeyCode.A = 97;
lime_ui_KeyCode.B = 98;
lime_ui_KeyCode.C = 99;
lime_ui_KeyCode.D = 100;
lime_ui_KeyCode.E = 101;
lime_ui_KeyCode.F = 102;
lime_ui_KeyCode.G = 103;
lime_ui_KeyCode.H = 104;
lime_ui_KeyCode.I = 105;
lime_ui_KeyCode.J = 106;
lime_ui_KeyCode.K = 107;
lime_ui_KeyCode.L = 108;
lime_ui_KeyCode.M = 109;
lime_ui_KeyCode.N = 110;
lime_ui_KeyCode.O = 111;
lime_ui_KeyCode.P = 112;
lime_ui_KeyCode.Q = 113;
lime_ui_KeyCode.R = 114;
lime_ui_KeyCode.S = 115;
lime_ui_KeyCode.T = 116;
lime_ui_KeyCode.U = 117;
lime_ui_KeyCode.V = 118;
lime_ui_KeyCode.W = 119;
lime_ui_KeyCode.X = 120;
lime_ui_KeyCode.Y = 121;
lime_ui_KeyCode.Z = 122;
lime_ui_KeyCode.DELETE = 127;
lime_ui_KeyCode.CAPS_LOCK = 1073741881;
lime_ui_KeyCode.F1 = 1073741882;
lime_ui_KeyCode.F2 = 1073741883;
lime_ui_KeyCode.F3 = 1073741884;
lime_ui_KeyCode.F4 = 1073741885;
lime_ui_KeyCode.F5 = 1073741886;
lime_ui_KeyCode.F6 = 1073741887;
lime_ui_KeyCode.F7 = 1073741888;
lime_ui_KeyCode.F8 = 1073741889;
lime_ui_KeyCode.F9 = 1073741890;
lime_ui_KeyCode.F10 = 1073741891;
lime_ui_KeyCode.F11 = 1073741892;
lime_ui_KeyCode.F12 = 1073741893;
lime_ui_KeyCode.PRINT_SCREEN = 1073741894;
lime_ui_KeyCode.SCROLL_LOCK = 1073741895;
lime_ui_KeyCode.PAUSE = 1073741896;
lime_ui_KeyCode.INSERT = 1073741897;
lime_ui_KeyCode.HOME = 1073741898;
lime_ui_KeyCode.PAGE_UP = 1073741899;
lime_ui_KeyCode.END = 1073741901;
lime_ui_KeyCode.PAGE_DOWN = 1073741902;
lime_ui_KeyCode.RIGHT = 1073741903;
lime_ui_KeyCode.LEFT = 1073741904;
lime_ui_KeyCode.DOWN = 1073741905;
lime_ui_KeyCode.UP = 1073741906;
lime_ui_KeyCode.NUM_LOCK = 1073741907;
lime_ui_KeyCode.NUMPAD_DIVIDE = 1073741908;
lime_ui_KeyCode.NUMPAD_MULTIPLY = 1073741909;
lime_ui_KeyCode.NUMPAD_MINUS = 1073741910;
lime_ui_KeyCode.NUMPAD_PLUS = 1073741911;
lime_ui_KeyCode.NUMPAD_ENTER = 1073741912;
lime_ui_KeyCode.NUMPAD_1 = 1073741913;
lime_ui_KeyCode.NUMPAD_2 = 1073741914;
lime_ui_KeyCode.NUMPAD_3 = 1073741915;
lime_ui_KeyCode.NUMPAD_4 = 1073741916;
lime_ui_KeyCode.NUMPAD_5 = 1073741917;
lime_ui_KeyCode.NUMPAD_6 = 1073741918;
lime_ui_KeyCode.NUMPAD_7 = 1073741919;
lime_ui_KeyCode.NUMPAD_8 = 1073741920;
lime_ui_KeyCode.NUMPAD_9 = 1073741921;
lime_ui_KeyCode.NUMPAD_0 = 1073741922;
lime_ui_KeyCode.NUMPAD_PERIOD = 1073741923;
lime_ui_KeyCode.APPLICATION = 1073741925;
lime_ui_KeyCode.POWER = 1073741926;
lime_ui_KeyCode.NUMPAD_EQUALS = 1073741927;
lime_ui_KeyCode.F13 = 1073741928;
lime_ui_KeyCode.F14 = 1073741929;
lime_ui_KeyCode.F15 = 1073741930;
lime_ui_KeyCode.F16 = 1073741931;
lime_ui_KeyCode.F17 = 1073741932;
lime_ui_KeyCode.F18 = 1073741933;
lime_ui_KeyCode.F19 = 1073741934;
lime_ui_KeyCode.F20 = 1073741935;
lime_ui_KeyCode.F21 = 1073741936;
lime_ui_KeyCode.F22 = 1073741937;
lime_ui_KeyCode.F23 = 1073741938;
lime_ui_KeyCode.F24 = 1073741939;
lime_ui_KeyCode.EXECUTE = 1073741940;
lime_ui_KeyCode.HELP = 1073741941;
lime_ui_KeyCode.MENU = 1073741942;
lime_ui_KeyCode.SELECT = 1073741943;
lime_ui_KeyCode.STOP = 1073741944;
lime_ui_KeyCode.AGAIN = 1073741945;
lime_ui_KeyCode.UNDO = 1073741946;
lime_ui_KeyCode.CUT = 1073741947;
lime_ui_KeyCode.COPY = 1073741948;
lime_ui_KeyCode.PASTE = 1073741949;
lime_ui_KeyCode.FIND = 1073741950;
lime_ui_KeyCode.MUTE = 1073741951;
lime_ui_KeyCode.VOLUME_UP = 1073741952;
lime_ui_KeyCode.VOLUME_DOWN = 1073741953;
lime_ui_KeyCode.NUMPAD_COMMA = 1073741957;
lime_ui_KeyCode.ALT_ERASE = 1073741977;
lime_ui_KeyCode.SYSTEM_REQUEST = 1073741978;
lime_ui_KeyCode.CANCEL = 1073741979;
lime_ui_KeyCode.CLEAR = 1073741980;
lime_ui_KeyCode.PRIOR = 1073741981;
lime_ui_KeyCode.RETURN2 = 1073741982;
lime_ui_KeyCode.SEPARATOR = 1073741983;
lime_ui_KeyCode.OUT = 1073741984;
lime_ui_KeyCode.OPER = 1073741985;
lime_ui_KeyCode.CLEAR_AGAIN = 1073741986;
lime_ui_KeyCode.CRSEL = 1073741987;
lime_ui_KeyCode.EXSEL = 1073741988;
lime_ui_KeyCode.NUMPAD_00 = 1073742000;
lime_ui_KeyCode.NUMPAD_000 = 1073742001;
lime_ui_KeyCode.THOUSAND_SEPARATOR = 1073742002;
lime_ui_KeyCode.DECIMAL_SEPARATOR = 1073742003;
lime_ui_KeyCode.CURRENCY_UNIT = 1073742004;
lime_ui_KeyCode.CURRENCY_SUBUNIT = 1073742005;
lime_ui_KeyCode.NUMPAD_LEFT_PARENTHESIS = 1073742006;
lime_ui_KeyCode.NUMPAD_RIGHT_PARENTHESIS = 1073742007;
lime_ui_KeyCode.NUMPAD_LEFT_BRACE = 1073742008;
lime_ui_KeyCode.NUMPAD_RIGHT_BRACE = 1073742009;
lime_ui_KeyCode.NUMPAD_TAB = 1073742010;
lime_ui_KeyCode.NUMPAD_BACKSPACE = 1073742011;
lime_ui_KeyCode.NUMPAD_A = 1073742012;
lime_ui_KeyCode.NUMPAD_B = 1073742013;
lime_ui_KeyCode.NUMPAD_C = 1073742014;
lime_ui_KeyCode.NUMPAD_D = 1073742015;
lime_ui_KeyCode.NUMPAD_E = 1073742016;
lime_ui_KeyCode.NUMPAD_F = 1073742017;
lime_ui_KeyCode.NUMPAD_XOR = 1073742018;
lime_ui_KeyCode.NUMPAD_POWER = 1073742019;
lime_ui_KeyCode.NUMPAD_PERCENT = 1073742020;
lime_ui_KeyCode.NUMPAD_LESS_THAN = 1073742021;
lime_ui_KeyCode.NUMPAD_GREATER_THAN = 1073742022;
lime_ui_KeyCode.NUMPAD_AMPERSAND = 1073742023;
lime_ui_KeyCode.NUMPAD_DOUBLE_AMPERSAND = 1073742024;
lime_ui_KeyCode.NUMPAD_VERTICAL_BAR = 1073742025;
lime_ui_KeyCode.NUMPAD_DOUBLE_VERTICAL_BAR = 1073742026;
lime_ui_KeyCode.NUMPAD_COLON = 1073742027;
lime_ui_KeyCode.NUMPAD_HASH = 1073742028;
lime_ui_KeyCode.NUMPAD_SPACE = 1073742029;
lime_ui_KeyCode.NUMPAD_AT = 1073742030;
lime_ui_KeyCode.NUMPAD_EXCLAMATION = 1073742031;
lime_ui_KeyCode.NUMPAD_MEM_STORE = 1073742032;
lime_ui_KeyCode.NUMPAD_MEM_RECALL = 1073742033;
lime_ui_KeyCode.NUMPAD_MEM_CLEAR = 1073742034;
lime_ui_KeyCode.NUMPAD_MEM_ADD = 1073742035;
lime_ui_KeyCode.NUMPAD_MEM_SUBTRACT = 1073742036;
lime_ui_KeyCode.NUMPAD_MEM_MULTIPLY = 1073742037;
lime_ui_KeyCode.NUMPAD_MEM_DIVIDE = 1073742038;
lime_ui_KeyCode.NUMPAD_PLUS_MINUS = 1073742039;
lime_ui_KeyCode.NUMPAD_CLEAR = 1073742040;
lime_ui_KeyCode.NUMPAD_CLEAR_ENTRY = 1073742041;
lime_ui_KeyCode.NUMPAD_BINARY = 1073742042;
lime_ui_KeyCode.NUMPAD_OCTAL = 1073742043;
lime_ui_KeyCode.NUMPAD_DECIMAL = 1073742044;
lime_ui_KeyCode.NUMPAD_HEXADECIMAL = 1073742045;
lime_ui_KeyCode.LEFT_CTRL = 1073742048;
lime_ui_KeyCode.LEFT_SHIFT = 1073742049;
lime_ui_KeyCode.LEFT_ALT = 1073742050;
lime_ui_KeyCode.LEFT_META = 1073742051;
lime_ui_KeyCode.RIGHT_CTRL = 1073742052;
lime_ui_KeyCode.RIGHT_SHIFT = 1073742053;
lime_ui_KeyCode.RIGHT_ALT = 1073742054;
lime_ui_KeyCode.RIGHT_META = 1073742055;
lime_ui_KeyCode.MODE = 1073742081;
lime_ui_KeyCode.AUDIO_NEXT = 1073742082;
lime_ui_KeyCode.AUDIO_PREVIOUS = 1073742083;
lime_ui_KeyCode.AUDIO_STOP = 1073742084;
lime_ui_KeyCode.AUDIO_PLAY = 1073742085;
lime_ui_KeyCode.AUDIO_MUTE = 1073742086;
lime_ui_KeyCode.MEDIA_SELECT = 1073742087;
lime_ui_KeyCode.WWW = 1073742088;
lime_ui_KeyCode.MAIL = 1073742089;
lime_ui_KeyCode.CALCULATOR = 1073742090;
lime_ui_KeyCode.COMPUTER = 1073742091;
lime_ui_KeyCode.APP_CONTROL_SEARCH = 1073742092;
lime_ui_KeyCode.APP_CONTROL_HOME = 1073742093;
lime_ui_KeyCode.APP_CONTROL_BACK = 1073742094;
lime_ui_KeyCode.APP_CONTROL_FORWARD = 1073742095;
lime_ui_KeyCode.APP_CONTROL_STOP = 1073742096;
lime_ui_KeyCode.APP_CONTROL_REFRESH = 1073742097;
lime_ui_KeyCode.APP_CONTROL_BOOKMARKS = 1073742098;
lime_ui_KeyCode.BRIGHTNESS_DOWN = 1073742099;
lime_ui_KeyCode.BRIGHTNESS_UP = 1073742100;
lime_ui_KeyCode.DISPLAY_SWITCH = 1073742101;
lime_ui_KeyCode.BACKLIGHT_TOGGLE = 1073742102;
lime_ui_KeyCode.BACKLIGHT_DOWN = 1073742103;
lime_ui_KeyCode.BACKLIGHT_UP = 1073742104;
lime_ui_KeyCode.EJECT = 1073742105;
lime_ui_KeyCode.SLEEP = 1073742106;
lime_ui_KeyModifier.NONE = 0;
lime_ui_KeyModifier.LEFT_SHIFT = 1;
lime_ui_KeyModifier.RIGHT_SHIFT = 2;
lime_ui_KeyModifier.LEFT_CTRL = 64;
lime_ui_KeyModifier.RIGHT_CTRL = 128;
lime_ui_KeyModifier.LEFT_ALT = 256;
lime_ui_KeyModifier.RIGHT_ALT = 512;
lime_ui_KeyModifier.LEFT_META = 1024;
lime_ui_KeyModifier.RIGHT_META = 2048;
lime_ui_KeyModifier.NUM_LOCK = 4096;
lime_ui_KeyModifier.CAPS_LOCK = 8192;
lime_ui_KeyModifier.MODE = 16384;
lime_ui_KeyModifier.CTRL = 192;
lime_ui_KeyModifier.SHIFT = 3;
lime_ui_KeyModifier.ALT = 768;
lime_ui_KeyModifier.META = 3072;
lime_ui_ScanCode.UNKNOWN = 0;
lime_ui_ScanCode.BACKSPACE = 42;
lime_ui_ScanCode.TAB = 43;
lime_ui_ScanCode.RETURN = 40;
lime_ui_ScanCode.ESCAPE = 41;
lime_ui_ScanCode.SPACE = 44;
lime_ui_ScanCode.SINGLE_QUOTE = 52;
lime_ui_ScanCode.COMMA = 54;
lime_ui_ScanCode.MINUS = 45;
lime_ui_ScanCode.PERIOD = 55;
lime_ui_ScanCode.SLASH = 56;
lime_ui_ScanCode.NUMBER_0 = 39;
lime_ui_ScanCode.NUMBER_1 = 30;
lime_ui_ScanCode.NUMBER_2 = 31;
lime_ui_ScanCode.NUMBER_3 = 32;
lime_ui_ScanCode.NUMBER_4 = 33;
lime_ui_ScanCode.NUMBER_5 = 34;
lime_ui_ScanCode.NUMBER_6 = 35;
lime_ui_ScanCode.NUMBER_7 = 36;
lime_ui_ScanCode.NUMBER_8 = 37;
lime_ui_ScanCode.NUMBER_9 = 38;
lime_ui_ScanCode.SEMICOLON = 51;
lime_ui_ScanCode.EQUALS = 46;
lime_ui_ScanCode.LEFT_BRACKET = 47;
lime_ui_ScanCode.BACKSLASH = 49;
lime_ui_ScanCode.RIGHT_BRACKET = 48;
lime_ui_ScanCode.GRAVE = 53;
lime_ui_ScanCode.A = 4;
lime_ui_ScanCode.B = 5;
lime_ui_ScanCode.C = 6;
lime_ui_ScanCode.D = 7;
lime_ui_ScanCode.E = 8;
lime_ui_ScanCode.F = 9;
lime_ui_ScanCode.G = 10;
lime_ui_ScanCode.H = 11;
lime_ui_ScanCode.I = 12;
lime_ui_ScanCode.J = 13;
lime_ui_ScanCode.K = 14;
lime_ui_ScanCode.L = 15;
lime_ui_ScanCode.M = 16;
lime_ui_ScanCode.N = 17;
lime_ui_ScanCode.O = 18;
lime_ui_ScanCode.P = 19;
lime_ui_ScanCode.Q = 20;
lime_ui_ScanCode.R = 21;
lime_ui_ScanCode.S = 22;
lime_ui_ScanCode.T = 23;
lime_ui_ScanCode.U = 24;
lime_ui_ScanCode.V = 25;
lime_ui_ScanCode.W = 26;
lime_ui_ScanCode.X = 27;
lime_ui_ScanCode.Y = 28;
lime_ui_ScanCode.Z = 29;
lime_ui_ScanCode.DELETE = 76;
lime_ui_ScanCode.CAPS_LOCK = 57;
lime_ui_ScanCode.F1 = 58;
lime_ui_ScanCode.F2 = 59;
lime_ui_ScanCode.F3 = 60;
lime_ui_ScanCode.F4 = 61;
lime_ui_ScanCode.F5 = 62;
lime_ui_ScanCode.F6 = 63;
lime_ui_ScanCode.F7 = 64;
lime_ui_ScanCode.F8 = 65;
lime_ui_ScanCode.F9 = 66;
lime_ui_ScanCode.F10 = 67;
lime_ui_ScanCode.F11 = 68;
lime_ui_ScanCode.F12 = 69;
lime_ui_ScanCode.PRINT_SCREEN = 70;
lime_ui_ScanCode.SCROLL_LOCK = 71;
lime_ui_ScanCode.PAUSE = 72;
lime_ui_ScanCode.INSERT = 73;
lime_ui_ScanCode.HOME = 74;
lime_ui_ScanCode.PAGE_UP = 75;
lime_ui_ScanCode.END = 77;
lime_ui_ScanCode.PAGE_DOWN = 78;
lime_ui_ScanCode.RIGHT = 79;
lime_ui_ScanCode.LEFT = 80;
lime_ui_ScanCode.DOWN = 81;
lime_ui_ScanCode.UP = 82;
lime_ui_ScanCode.NUM_LOCK = 83;
lime_ui_ScanCode.NUMPAD_DIVIDE = 84;
lime_ui_ScanCode.NUMPAD_MULTIPLY = 85;
lime_ui_ScanCode.NUMPAD_MINUS = 86;
lime_ui_ScanCode.NUMPAD_PLUS = 87;
lime_ui_ScanCode.NUMPAD_ENTER = 88;
lime_ui_ScanCode.NUMPAD_1 = 89;
lime_ui_ScanCode.NUMPAD_2 = 90;
lime_ui_ScanCode.NUMPAD_3 = 91;
lime_ui_ScanCode.NUMPAD_4 = 92;
lime_ui_ScanCode.NUMPAD_5 = 93;
lime_ui_ScanCode.NUMPAD_6 = 94;
lime_ui_ScanCode.NUMPAD_7 = 95;
lime_ui_ScanCode.NUMPAD_8 = 96;
lime_ui_ScanCode.NUMPAD_9 = 97;
lime_ui_ScanCode.NUMPAD_0 = 98;
lime_ui_ScanCode.NUMPAD_PERIOD = 99;
lime_ui_ScanCode.APPLICATION = 101;
lime_ui_ScanCode.POWER = 102;
lime_ui_ScanCode.NUMPAD_EQUALS = 103;
lime_ui_ScanCode.F13 = 104;
lime_ui_ScanCode.F14 = 105;
lime_ui_ScanCode.F15 = 106;
lime_ui_ScanCode.F16 = 107;
lime_ui_ScanCode.F17 = 108;
lime_ui_ScanCode.F18 = 109;
lime_ui_ScanCode.F19 = 110;
lime_ui_ScanCode.F20 = 111;
lime_ui_ScanCode.F21 = 112;
lime_ui_ScanCode.F22 = 113;
lime_ui_ScanCode.F23 = 114;
lime_ui_ScanCode.F24 = 115;
lime_ui_ScanCode.EXECUTE = 116;
lime_ui_ScanCode.HELP = 117;
lime_ui_ScanCode.MENU = 118;
lime_ui_ScanCode.SELECT = 119;
lime_ui_ScanCode.STOP = 120;
lime_ui_ScanCode.AGAIN = 121;
lime_ui_ScanCode.UNDO = 122;
lime_ui_ScanCode.CUT = 123;
lime_ui_ScanCode.COPY = 124;
lime_ui_ScanCode.PASTE = 125;
lime_ui_ScanCode.FIND = 126;
lime_ui_ScanCode.MUTE = 127;
lime_ui_ScanCode.VOLUME_UP = 128;
lime_ui_ScanCode.VOLUME_DOWN = 129;
lime_ui_ScanCode.NUMPAD_COMMA = 133;
lime_ui_ScanCode.ALT_ERASE = 153;
lime_ui_ScanCode.SYSTEM_REQUEST = 154;
lime_ui_ScanCode.CANCEL = 155;
lime_ui_ScanCode.CLEAR = 156;
lime_ui_ScanCode.PRIOR = 157;
lime_ui_ScanCode.RETURN2 = 158;
lime_ui_ScanCode.SEPARATOR = 159;
lime_ui_ScanCode.OUT = 160;
lime_ui_ScanCode.OPER = 161;
lime_ui_ScanCode.CLEAR_AGAIN = 162;
lime_ui_ScanCode.CRSEL = 163;
lime_ui_ScanCode.EXSEL = 164;
lime_ui_ScanCode.NUMPAD_00 = 176;
lime_ui_ScanCode.NUMPAD_000 = 177;
lime_ui_ScanCode.THOUSAND_SEPARATOR = 178;
lime_ui_ScanCode.DECIMAL_SEPARATOR = 179;
lime_ui_ScanCode.CURRENCY_UNIT = 180;
lime_ui_ScanCode.CURRENCY_SUBUNIT = 181;
lime_ui_ScanCode.NUMPAD_LEFT_PARENTHESIS = 182;
lime_ui_ScanCode.NUMPAD_RIGHT_PARENTHESIS = 183;
lime_ui_ScanCode.NUMPAD_LEFT_BRACE = 184;
lime_ui_ScanCode.NUMPAD_RIGHT_BRACE = 185;
lime_ui_ScanCode.NUMPAD_TAB = 186;
lime_ui_ScanCode.NUMPAD_BACKSPACE = 187;
lime_ui_ScanCode.NUMPAD_A = 188;
lime_ui_ScanCode.NUMPAD_B = 189;
lime_ui_ScanCode.NUMPAD_C = 190;
lime_ui_ScanCode.NUMPAD_D = 191;
lime_ui_ScanCode.NUMPAD_E = 192;
lime_ui_ScanCode.NUMPAD_F = 193;
lime_ui_ScanCode.NUMPAD_XOR = 194;
lime_ui_ScanCode.NUMPAD_POWER = 195;
lime_ui_ScanCode.NUMPAD_PERCENT = 196;
lime_ui_ScanCode.NUMPAD_LESS_THAN = 197;
lime_ui_ScanCode.NUMPAD_GREATER_THAN = 198;
lime_ui_ScanCode.NUMPAD_AMPERSAND = 199;
lime_ui_ScanCode.NUMPAD_DOUBLE_AMPERSAND = 200;
lime_ui_ScanCode.NUMPAD_VERTICAL_BAR = 201;
lime_ui_ScanCode.NUMPAD_DOUBLE_VERTICAL_BAR = 202;
lime_ui_ScanCode.NUMPAD_COLON = 203;
lime_ui_ScanCode.NUMPAD_HASH = 204;
lime_ui_ScanCode.NUMPAD_SPACE = 205;
lime_ui_ScanCode.NUMPAD_AT = 206;
lime_ui_ScanCode.NUMPAD_EXCLAMATION = 207;
lime_ui_ScanCode.NUMPAD_MEM_STORE = 208;
lime_ui_ScanCode.NUMPAD_MEM_RECALL = 209;
lime_ui_ScanCode.NUMPAD_MEM_CLEAR = 210;
lime_ui_ScanCode.NUMPAD_MEM_ADD = 211;
lime_ui_ScanCode.NUMPAD_MEM_SUBTRACT = 212;
lime_ui_ScanCode.NUMPAD_MEM_MULTIPLY = 213;
lime_ui_ScanCode.NUMPAD_MEM_DIVIDE = 214;
lime_ui_ScanCode.NUMPAD_PLUS_MINUS = 215;
lime_ui_ScanCode.NUMPAD_CLEAR = 216;
lime_ui_ScanCode.NUMPAD_CLEAR_ENTRY = 217;
lime_ui_ScanCode.NUMPAD_BINARY = 218;
lime_ui_ScanCode.NUMPAD_OCTAL = 219;
lime_ui_ScanCode.NUMPAD_DECIMAL = 220;
lime_ui_ScanCode.NUMPAD_HEXADECIMAL = 221;
lime_ui_ScanCode.LEFT_CTRL = 224;
lime_ui_ScanCode.LEFT_SHIFT = 225;
lime_ui_ScanCode.LEFT_ALT = 226;
lime_ui_ScanCode.LEFT_META = 227;
lime_ui_ScanCode.RIGHT_CTRL = 228;
lime_ui_ScanCode.RIGHT_SHIFT = 229;
lime_ui_ScanCode.RIGHT_ALT = 230;
lime_ui_ScanCode.RIGHT_META = 231;
lime_ui_ScanCode.MODE = 257;
lime_ui_ScanCode.AUDIO_NEXT = 258;
lime_ui_ScanCode.AUDIO_PREVIOUS = 259;
lime_ui_ScanCode.AUDIO_STOP = 260;
lime_ui_ScanCode.AUDIO_PLAY = 261;
lime_ui_ScanCode.AUDIO_MUTE = 262;
lime_ui_ScanCode.MEDIA_SELECT = 263;
lime_ui_ScanCode.WWW = 264;
lime_ui_ScanCode.MAIL = 265;
lime_ui_ScanCode.CALCULATOR = 266;
lime_ui_ScanCode.COMPUTER = 267;
lime_ui_ScanCode.APP_CONTROL_SEARCH = 268;
lime_ui_ScanCode.APP_CONTROL_HOME = 269;
lime_ui_ScanCode.APP_CONTROL_BACK = 270;
lime_ui_ScanCode.APP_CONTROL_FORWARD = 271;
lime_ui_ScanCode.APP_CONTROL_STOP = 272;
lime_ui_ScanCode.APP_CONTROL_REFRESH = 273;
lime_ui_ScanCode.APP_CONTROL_BOOKMARKS = 274;
lime_ui_ScanCode.BRIGHTNESS_DOWN = 275;
lime_ui_ScanCode.BRIGHTNESS_UP = 276;
lime_ui_ScanCode.DISPLAY_SWITCH = 277;
lime_ui_ScanCode.BACKLIGHT_TOGGLE = 278;
lime_ui_ScanCode.BACKLIGHT_DOWN = 279;
lime_ui_ScanCode.BACKLIGHT_UP = 280;
lime_ui_ScanCode.EJECT = 281;
lime_ui_ScanCode.SLEEP = 282;
lime_ui_Touch.onCancel = new lime_app__$Event_$lime_$ui_$Touch_$Void();
lime_ui_Touch.onEnd = new lime_app__$Event_$lime_$ui_$Touch_$Void();
lime_ui_Touch.onMove = new lime_app__$Event_$lime_$ui_$Touch_$Void();
lime_ui_Touch.onStart = new lime_app__$Event_$lime_$ui_$Touch_$Void();
lime_utils_Assets.cache = new lime_utils_AssetCache();
lime_utils_Assets.onChange = new lime_app__$Event_$Void_$Void();
lime_utils_Assets.bundlePaths = new haxe_ds_StringMap();
lime_utils_Assets.libraries = new haxe_ds_StringMap();
lime_utils_Assets.libraryPaths = new haxe_ds_StringMap();
lime_utils_Float32Array.BYTES_PER_ELEMENT = 4;
lime_utils_Float64Array.BYTES_PER_ELEMENT = 8;
lime_utils_Int16Array.BYTES_PER_ELEMENT = 2;
lime_utils_Int32Array.BYTES_PER_ELEMENT = 4;
lime_utils_Int8Array.BYTES_PER_ELEMENT = 1;
lime_utils_Log.throwErrors = true;
lime_utils_LogLevel.NONE = 0;
lime_utils_LogLevel.ERROR = 1;
lime_utils_LogLevel.WARN = 2;
lime_utils_LogLevel.INFO = 3;
lime_utils_LogLevel.DEBUG = 4;
lime_utils_LogLevel.VERBOSE = 5;
lime_utils_UInt16Array.BYTES_PER_ELEMENT = 2;
lime_utils_UInt32Array.BYTES_PER_ELEMENT = 4;
lime_utils_UInt8Array.BYTES_PER_ELEMENT = 1;
lime_utils_UInt8ClampedArray.BYTES_PER_ELEMENT = 1;
moonshine_editor_text_events_TextEditorChangeEvent.TEXT_CHANGE = "textChange";
moonshine_editor_text_events_TextEditorChangeEvent.ORIGIN_LOCAL = "local";
moonshine_editor_text_events_TextEditorChangeEvent.ORIGIN_UNDO = "undo";
moonshine_editor_text_events_TextEditorChangeEvent.ORIGIN_REMOTE = "remote";
moonshine_editor_text_events_TextEditorEvent.SELECTION_CHANGE = "selectionChange";
moonshine_editor_text_events_TextEditorLineEvent.TOGGLE_BREAKPOINT = "toggleBreakpoint";
moonshine_editor_text_events_TextEditorLineEvent.SELECT_LINE = "selectLine";
moonshine_editor_text_managers_ColorManager.CHUNK_TIMESPAN = 16;
moonshine_editor_text_managers_SelectionManager.SCROLL_THRESHOLD = 10;
moonshine_editor_text_managers_SelectionManager.SCROLL_INTERVAL = 60;
moonshine_editor_text_syntax_parser_CSSLineParser.CSS_TEXT = 0;
moonshine_editor_text_syntax_parser_CSSLineParser.CSS_PROPERTY = 1;
moonshine_editor_text_syntax_parser_CSSLineParser.CSS_VALUE = 2;
moonshine_editor_text_syntax_parser_CSSLineParser.CSS_STRING1 = 3;
moonshine_editor_text_syntax_parser_CSSLineParser.CSS_STRING2 = 4;
moonshine_editor_text_syntax_parser_CSSLineParser.CSS_STRING3 = 5;
moonshine_editor_text_syntax_parser_CSSLineParser.CSS_STRING4 = 6;
moonshine_editor_text_syntax_parser_CSSLineParser.CSS_COMMENT1 = 7;
moonshine_editor_text_syntax_parser_CSSLineParser.CSS_COMMENT2 = 8;
moonshine_editor_text_syntax_parser_CSSLineParser.CSS_COMMENT3 = 9;
moonshine_editor_text_syntax_parser_CSSLineParser.CSS_MEDIA = 10;
moonshine_editor_text_syntax_parser_CSSLineParser.CSS_BRACEOPEN = 11;
moonshine_editor_text_syntax_parser_CSSLineParser.CSS_BRACECLOSE = 12;
moonshine_editor_text_syntax_parser_CSSLineParser.CSS_COLON1 = 13;
moonshine_editor_text_syntax_parser_CSSLineParser.CSS_COLON2 = 14;
moonshine_editor_text_syntax_parser_CSSLineParser.CSS_COLON3 = 15;
moonshine_editor_text_syntax_parser_CSSLineParser.CSS_COLOR = 16;
moonshine_editor_text_syntax_parser_CSSLineParser.CSS_NUMBER = 17;
moonshine_editor_text_syntax_parser_JSLineParser.JS_CODE = 1;
moonshine_editor_text_syntax_parser_JSLineParser.JS_STRING1 = 2;
moonshine_editor_text_syntax_parser_JSLineParser.JS_STRING2 = 3;
moonshine_editor_text_syntax_parser_JSLineParser.JS_COMMENT = 4;
moonshine_editor_text_syntax_parser_JSLineParser.JS_MULTILINE_COMMENT = 5;
moonshine_editor_text_syntax_parser_JSLineParser.JS_REGULAR_EXPRESSION = 6;
moonshine_editor_text_syntax_parser_JSLineParser.JS_NULL_KEYWORD = 7;
moonshine_editor_text_syntax_parser_JSLineParser.JS_UNDEFINED_KEYWORD = 8;
moonshine_editor_text_syntax_parser_JSLineParser.JS_BOOLEAN_KEYWORD = 7;
moonshine_editor_text_syntax_parser_JSLineParser.JS_KEYWORD = 10;
moonshine_editor_text_syntax_parser_JSLineParser.JS_VAR_KEYWORD = 11;
moonshine_editor_text_syntax_parser_JSLineParser.JS_FUNCTION_KEYWORD = 12;
moonshine_editor_text_syntax_parser_JSLineParser.JS_TYPE_KEYWORD = 13;
moonshine_editor_text_syntax_parser_PlainTextLineParser.TEXT = 0;
moonshine_editor_text_utils_TextUtil.DEFAULT_NON_WORD_CHARACTERS = [" ","\t",".",":",";",",","?","+","-","*","/","%","=","!","&","|","(",")","[","]","{","}","<",">"];
motion_easing_Expo.easeIn = new motion_easing__$Expo_ExpoEaseIn();
motion_easing_Expo.easeInOut = new motion_easing__$Expo_ExpoEaseInOut();
motion_easing_Expo.easeOut = new motion_easing__$Expo_ExpoEaseOut();
motion_Actuate.defaultActuator = motion_actuators_SimpleActuator;
motion_Actuate.defaultEase = motion_easing_Expo.easeOut;
motion_Actuate.targetLibraries = new haxe_ds_ObjectMap();
motion_easing_Bounce.easeIn = new motion_easing__$Bounce_BounceEaseIn();
motion_easing_Bounce.easeInOut = new motion_easing__$Bounce_BounceEaseInOut();
motion_easing_Bounce.easeOut = new motion_easing__$Bounce_BounceEaseOut();
motion_easing_Cubic.easeIn = new motion_easing__$Cubic_CubicEaseIn();
motion_easing_Cubic.easeInOut = new motion_easing__$Cubic_CubicEaseInOut();
motion_easing_Cubic.easeOut = new motion_easing__$Cubic_CubicEaseOut();
motion_easing_Elastic.easeIn = new motion_easing__$Elastic_ElasticEaseIn(0.1,0.4);
motion_easing_Elastic.easeInOut = new motion_easing__$Elastic_ElasticEaseInOut(0.1,0.4);
motion_easing_Elastic.easeOut = new motion_easing__$Elastic_ElasticEaseOut(0.1,0.4);
motion_easing_Quad.easeIn = new motion_easing__$Quad_QuadEaseIn();
motion_easing_Quad.easeInOut = new motion_easing__$Quad_QuadEaseInOut();
motion_easing_Quad.easeOut = new motion_easing__$Quad_QuadEaseOut();
motion_easing_Quart.easeIn = new motion_easing__$Quart_QuartEaseIn();
motion_easing_Quart.easeInOut = new motion_easing__$Quart_QuartEaseInOut();
motion_easing_Quart.easeOut = new motion_easing__$Quart_QuartEaseOut();
motion_easing_Quint.easeIn = new motion_easing__$Quint_QuintEaseIn();
motion_easing_Quint.easeInOut = new motion_easing__$Quint_QuintEaseInOut();
motion_easing_Quint.easeOut = new motion_easing__$Quint_QuintEaseOut();
motion_easing_Sine.easeIn = new motion_easing__$Sine_SineEaseIn();
motion_easing_Sine.easeInOut = new motion_easing__$Sine_SineEaseInOut();
motion_easing_Sine.easeOut = new motion_easing__$Sine_SineEaseOut();
openfl_Lib.__lastTimerID = 0;
openfl_Lib.__sentWarnings = new haxe_ds_StringMap();
openfl_Lib.__timers = new haxe_ds_IntMap();
openfl_Lib.__registeredClassAliases = new haxe_ds_StringMap();
openfl_Lib.__registeredClasses = openfl_utils_Dictionary.toUtilsObjectMap(null);
openfl__$Vector_IVector.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}};
openfl__$Vector_BoolVector.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}, fields : { toJSON : { SuppressWarnings : ["checkstyle:Dynamic"]}}};
openfl__$Vector_FloatVector.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}, fields : { toJSON : { SuppressWarnings : ["checkstyle:Dynamic"]}, _ : { SuppressWarnings : ["checkstyle:Dynamic"]}}};
openfl__$Vector_FunctionVector.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}, fields : { toJSON : { SuppressWarnings : ["checkstyle:Dynamic"]}}};
openfl__$Vector_IntVector.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}, fields : { toJSON : { SuppressWarnings : ["checkstyle:Dynamic"]}}};
openfl__$Vector_ObjectVector.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}, fields : { concat : { SuppressWarnings : ["checkstyle:Dynamic"]}, toJSON : { SuppressWarnings : ["checkstyle:Dynamic"]}, _ : { SuppressWarnings : ["checkstyle:Dynamic"]}}};
openfl_desktop_Clipboard.__meta__ = { fields : { setDataHandler : { SuppressWarnings : ["checkstyle:Dynamic"]}}};
openfl_desktop_ClipboardFormats.HTML_FORMAT = 0;
openfl_desktop_ClipboardFormats.RICH_TEXT_FORMAT = 1;
openfl_desktop_ClipboardFormats.TEXT_FORMAT = 2;
openfl_desktop_ClipboardTransferMode.CLONE_ONLY = 0;
openfl_desktop_ClipboardTransferMode.CLONE_PREFERRED = 1;
openfl_desktop_ClipboardTransferMode.ORIGINAL_ONLY = 2;
openfl_desktop_ClipboardTransferMode.ORIGINAL_PREFERRED = 3;
openfl_display_Application.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}};
openfl_geom_Rectangle.__pool = new lime_utils_ObjectPool(function() {
	return new openfl_geom_Rectangle();
},function(r) {
	r.setTo(0,0,0,0);
});
openfl_display_BitmapData.__meta__ = { fields : { image : { SuppressWarnings : ["checkstyle:Dynamic"]}, __framebufferContext : { SuppressWarnings : ["checkstyle:Dynamic"]}, __indexBufferContext : { SuppressWarnings : ["checkstyle:Dynamic"]}, __surface : { SuppressWarnings : ["checkstyle:Dynamic"]}, __textureContext : { SuppressWarnings : ["checkstyle:Dynamic"]}, __vertexBufferContext : { SuppressWarnings : ["checkstyle:Dynamic"]}, compare : { SuppressWarnings : ["checkstyle:Dynamic"]}, getSurface : { SuppressWarnings : ["checkstyle:Dynamic"]}, __fromImage : { SuppressWarnings : ["checkstyle:Dynamic"]}}};
openfl_display_BitmapData.VERTEX_BUFFER_STRIDE = 14;
openfl_display_BitmapData.__tempVector = new lime_math_Vector2();
openfl_display_BitmapData.__fillRectRectangle = new openfl_geom_Rectangle();
openfl_display_BlendMode.ADD = 0;
openfl_display_BlendMode.ALPHA = 1;
openfl_display_BlendMode.DARKEN = 2;
openfl_display_BlendMode.DIFFERENCE = 3;
openfl_display_BlendMode.ERASE = 4;
openfl_display_BlendMode.HARDLIGHT = 5;
openfl_display_BlendMode.INVERT = 6;
openfl_display_BlendMode.LAYER = 7;
openfl_display_BlendMode.LIGHTEN = 8;
openfl_display_BlendMode.MULTIPLY = 9;
openfl_display_BlendMode.NORMAL = 10;
openfl_display_BlendMode.OVERLAY = 11;
openfl_display_BlendMode.SCREEN = 12;
openfl_display_BlendMode.SHADER = 13;
openfl_display_BlendMode.SUBTRACT = 14;
openfl_display_DisplayObjectRenderer.__meta__ = { fields : { __context : { SuppressWarnings : ["checkstyle:Dynamic"]}, __type : { SuppressWarnings : ["checkstyle:Dynamic"]}}};
openfl_display_CairoRenderer.__meta__ = { fields : { cairo : { SuppressWarnings : ["checkstyle:Dynamic"]}, __matrix3 : { SuppressWarnings : ["checkstyle:Dynamic"]}, applyMatrix : { SuppressWarnings : ["checkstyle:Dynamic"]}, __setBlendModeCairo : { SuppressWarnings : ["checkstyle:Dynamic"]}, _ : { SuppressWarnings : ["checkstyle:Dynamic"]}}};
openfl_display_CanvasRenderer.__meta__ = { fields : { context : { SuppressWarnings : ["checkstyle:Dynamic"]}, applySmoothing : { SuppressWarnings : ["checkstyle:Dynamic"]}, setTransform : { SuppressWarnings : ["checkstyle:Dynamic"]}, __setBlendModeContext : { SuppressWarnings : ["checkstyle:Dynamic"]}, _ : { SuppressWarnings : ["checkstyle:Dynamic"]}}};
openfl_display_CapsStyle.NONE = 0;
openfl_display_CapsStyle.ROUND = 1;
openfl_display_CapsStyle.SQUARE = 2;
openfl_display_DOMElement.__meta__ = { fields : { __element : { SuppressWarnings : ["checkstyle:Dynamic"]}, _ : { SuppressWarnings : ["checkstyle:Dynamic"]}}};
openfl_display_DOMRenderer.__meta__ = { fields : { element : { SuppressWarnings : ["checkstyle:Dynamic"]}, applyStyle : { SuppressWarnings : ["checkstyle:Dynamic"]}, clearStyle : { SuppressWarnings : ["checkstyle:Dynamic"]}, _ : { SuppressWarnings : ["checkstyle:Dynamic"]}}};
openfl_display_Shader.__meta__ = { fields : { glProgram : { SuppressWarnings : ["checkstyle:Dynamic"]}}};
openfl_text_TextField.__missingFontWarning = new haxe_ds_StringMap();
openfl_display_GradientType.LINEAR = 0;
openfl_display_GradientType.RADIAL = 1;
openfl_display_Graphics.__meta__ = { fields : { overrideBlendMode : { SuppressWarnings : ["checkstyle:FieldDocComment"]}}};
openfl_display_GraphicsPath.SIN45 = 0.70710678118654752440084436210485;
openfl_display_GraphicsPath.TAN22 = 0.4142135623730950488016887242097;
openfl_display_GraphicsPathWinding.EVEN_ODD = 0;
openfl_display_GraphicsPathWinding.NON_ZERO = 1;
openfl_display_InterpolationMethod.LINEAR_RGB = 0;
openfl_display_InterpolationMethod.RGB = 1;
openfl_display_JointStyle.BEVEL = 0;
openfl_display_JointStyle.MITER = 1;
openfl_display_JointStyle.ROUND = 2;
openfl_display_LineScaleMode.HORIZONTAL = 0;
openfl_display_LineScaleMode.NONE = 1;
openfl_display_LineScaleMode.NORMAL = 2;
openfl_display_LineScaleMode.VERTICAL = 3;
openfl_display_Loader.__meta__ = { fields : { __dispatchError : { SuppressWarnings : ["checkstyle:Dynamic"]}, Loader_onError : { SuppressWarnings : ["checkstyle:Dynamic"]}}};
openfl_display_LoaderInfo.__meta__ = { statics : { create : { SuppressWarnings : ["checkstyle:FieldDocComment"]}}, fields : { parameters : { SuppressWarnings : ["checkstyle:Dynamic"]}}};
openfl_display_LoaderInfo.__rootURL = js_Browser.get_supported() ? window.document.URL : "";
openfl_display_OpenGLRenderer.__meta__ = { fields : { gl : { SuppressWarnings : ["checkstyle:Dynamic"]}, __gl : { SuppressWarnings : ["checkstyle:Dynamic"]}, __matrix : { SuppressWarnings : ["checkstyle:Dynamic"]}, __projection : { SuppressWarnings : ["checkstyle:Dynamic"]}, __projectionFlipped : { SuppressWarnings : ["checkstyle:Dynamic"]}, getMatrix : { SuppressWarnings : ["checkstyle:Dynamic"]}}};
openfl_display_OpenGLRenderer.__alphaValue = [1];
openfl_display_OpenGLRenderer.__colorMultipliersValue = [0,0,0,0];
openfl_display_OpenGLRenderer.__colorOffsetsValue = [0,0,0,0];
openfl_display_OpenGLRenderer.__defaultColorMultipliersValue = [1,1,1,1];
openfl_display_OpenGLRenderer.__emptyColorValue = [0,0,0,0];
openfl_display_OpenGLRenderer.__emptyAlphaValue = [1];
openfl_display_OpenGLRenderer.__hasColorTransformValue = [false];
openfl_display_OpenGLRenderer.__scissorRectangle = new openfl_geom_Rectangle();
openfl_display_OpenGLRenderer.__textureSizeValue = [0,0];
openfl_display_PixelSnapping.ALWAYS = 0;
openfl_display_PixelSnapping.AUTO = 1;
openfl_display_PixelSnapping.NEVER = 2;
openfl_display_Preloader.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}, fields : { onComplete : { SuppressWarnings : ["checkstyle:Dynamic"]}}};
openfl_display_DefaultPreloader.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}};
openfl_display_ShaderInput.__meta__ = { fields : { index : { SuppressWarnings : ["checkstyle:Dynamic"]}, name : { SuppressWarnings : ["checkstyle:FieldDocComment"]}}};
openfl_display_ShaderParameter.__meta__ = { fields : { index : { SuppressWarnings : ["checkstyle:Dynamic"]}, name : { SuppressWarnings : ["checkstyle:FieldDocComment"]}}};
openfl_display_ShaderParameterType.BOOL = 0;
openfl_display_ShaderParameterType.BOOL2 = 1;
openfl_display_ShaderParameterType.BOOL3 = 2;
openfl_display_ShaderParameterType.BOOL4 = 3;
openfl_display_ShaderParameterType.FLOAT = 4;
openfl_display_ShaderParameterType.FLOAT2 = 5;
openfl_display_ShaderParameterType.FLOAT3 = 6;
openfl_display_ShaderParameterType.FLOAT4 = 7;
openfl_display_ShaderParameterType.INT = 8;
openfl_display_ShaderParameterType.INT2 = 9;
openfl_display_ShaderParameterType.INT3 = 10;
openfl_display_ShaderParameterType.INT4 = 11;
openfl_display_ShaderParameterType.MATRIX2X2 = 12;
openfl_display_ShaderParameterType.MATRIX2X3 = 13;
openfl_display_ShaderParameterType.MATRIX2X4 = 14;
openfl_display_ShaderParameterType.MATRIX3X2 = 15;
openfl_display_ShaderParameterType.MATRIX3X3 = 16;
openfl_display_ShaderParameterType.MATRIX3X4 = 17;
openfl_display_ShaderParameterType.MATRIX4X2 = 18;
openfl_display_ShaderParameterType.MATRIX4X3 = 19;
openfl_display_ShaderParameterType.MATRIX4X4 = 20;
openfl_display_ShaderPrecision.FAST = 0;
openfl_display_ShaderPrecision.FULL = 1;
openfl_display_SpreadMethod.PAD = 0;
openfl_display_SpreadMethod.REFLECT = 1;
openfl_display_SpreadMethod.REPEAT = 2;
openfl_display_Stage.__meta__ = { fields : { __broadcastEvent : { SuppressWarnings : ["checkstyle:Dynamic"]}, __dispatchEvent : { SuppressWarnings : [["checkstyle:Dynamic","checkstyle:LeftCurly"]]}, __dispatchStack : { SuppressWarnings : [["checkstyle:Dynamic","checkstyle:LeftCurly"]]}, __dispatchTarget : { SuppressWarnings : ["checkstyle:Dynamic"]}, __handleError : { SuppressWarnings : ["checkstyle:Dynamic"]}}};
openfl_display_StageAlign.BOTTOM = 0;
openfl_display_StageAlign.BOTTOM_LEFT = 1;
openfl_display_StageAlign.BOTTOM_RIGHT = 2;
openfl_display_StageAlign.LEFT = 3;
openfl_display_StageAlign.RIGHT = 4;
openfl_display_StageAlign.TOP = 5;
openfl_display_StageAlign.TOP_LEFT = 6;
openfl_display_StageAlign.TOP_RIGHT = 7;
openfl_display_StageDisplayState.FULL_SCREEN = 0;
openfl_display_StageDisplayState.FULL_SCREEN_INTERACTIVE = 1;
openfl_display_StageDisplayState.NORMAL = 2;
openfl_display_StageOrientation.DEFAULT = 0;
openfl_display_StageOrientation.ROTATED_LEFT = 1;
openfl_display_StageOrientation.ROTATED_RIGHT = 2;
openfl_display_StageOrientation.UNKNOWN = 3;
openfl_display_StageOrientation.UPSIDE_DOWN = 4;
openfl_display_StageQuality.BEST = 0;
openfl_display_StageQuality.HIGH = 1;
openfl_display_StageQuality.LOW = 2;
openfl_display_StageQuality.MEDIUM = 3;
openfl_display_StageScaleMode.EXACT_FIT = 0;
openfl_display_StageScaleMode.NO_BORDER = 1;
openfl_display_StageScaleMode.NO_SCALE = 2;
openfl_display_StageScaleMode.SHOW_ALL = 3;
openfl_display_Tile.__meta__ = { fields : { data : { SuppressWarnings : ["checkstyle:Dynamic"]}}};
openfl_display_TileData.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}};
openfl_display_TriangleCulling.NEGATIVE = 0;
openfl_display_TriangleCulling.NONE = 1;
openfl_display_TriangleCulling.POSITIVE = 2;
openfl_display_Window.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}, fields : { _ : { SuppressWarnings : ["checkstyle:Dynamic"]}}};
openfl_display__$internal_AbstractNoise.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}};
openfl_display__$internal_CairoBitmap.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}};
openfl_display__$internal_CairoDisplayObject.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}};
openfl_display__$internal_CairoGraphics.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}};
openfl_display__$internal_CairoShape.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}};
openfl_display__$internal_CairoTextField.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}};
openfl_display__$internal_CairoTilemap.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}, statics : { renderTileContainer : { SuppressWarnings : ["checkstyle:Dynamic"]}}};
openfl_display__$internal_CanvasBitmap.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}};
openfl_display__$internal_CanvasDisplayObject.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}};
openfl_display__$internal_DrawCommandBuffer.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}, fields : { o : { SuppressWarnings : ["checkstyle:Dynamic"]}}};
openfl_display__$internal_DrawCommandBuffer.empty = new openfl_display__$internal_DrawCommandBuffer();
openfl_display__$internal_CanvasGraphics.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}, statics : { windingRule : { SuppressWarnings : ["checkstyle:Dynamic"]}, createBitmapFill : { SuppressWarnings : ["checkstyle:Dynamic"]}, createGradientPattern : { SuppressWarnings : ["checkstyle:Dynamic"]}}};
openfl_display__$internal_CanvasGraphics.SIN45 = 0.70710678118654752440084436210485;
openfl_display__$internal_CanvasGraphics.TAN22 = 0.4142135623730950488016887242097;
openfl_display__$internal_CanvasGraphics.fillCommands = new openfl_display__$internal_DrawCommandBuffer();
openfl_display__$internal_CanvasGraphics.strokeCommands = new openfl_display__$internal_DrawCommandBuffer();
openfl_display__$internal_CanvasShape.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}};
openfl_display__$internal_CanvasTextField.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}};
openfl_display__$internal_CanvasTilemap.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}, statics : { renderTileContainer : { SuppressWarnings : ["checkstyle:Dynamic"]}}};
openfl_display__$internal_CanvasVideo.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}};
openfl_display__$internal_Context3DBitmap.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}};
openfl_display__$internal_Context3DBuffer.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}};
openfl_display__$internal_Context3DBuffer.MAX_INDEX_BUFFER_LENGTH = 65535;
openfl_display__$internal_Context3DBuffer.MAX_QUADS_PER_INDEX_BUFFER = 10922;
openfl_display__$internal_Context3DBuffer.MAX_QUAD_INDEX_BUFFER_LENGTH = 65532;
openfl_display__$internal_Context3DDisplayObject.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}};
openfl_display__$internal_Context3DGraphics.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}};
openfl_display__$internal_Context3DGraphics.blankBitmapData = new openfl_display_BitmapData(1,1,false,0);
openfl_display__$internal_Context3DGraphics.tempColorTransform = new openfl_geom_ColorTransform(1,1,1,1,0,0,0,0);
openfl_display__$internal_Context3DGraphics.tempVerticesVector = openfl_Vector.toFloatVector(null);
openfl_display__$internal_Context3DGraphics.tempIndicesVector = openfl_Vector.toIntVector(null);
openfl_display__$internal_Context3DGraphics.tempUvtVector = openfl_Vector.toFloatVector(null);
openfl_display__$internal_Context3DMaskShader.opaqueBitmapData = new openfl_display_BitmapData(1,1,false,0);
openfl_display__$internal_Context3DShape.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}};
openfl_display__$internal_Context3DTextField.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}};
openfl_display__$internal_Context3DTilemap.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}};
openfl_display__$internal_Context3DVideo.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}};
openfl_display__$internal_Context3DVideo.__textureSizeValue = [0,0.];
openfl_display__$internal_DOMBitmap.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}};
openfl_display__$internal_DOMDisplayObject.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}};
openfl_display__$internal_DOMShape.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}};
openfl_display__$internal_DOMTextField.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}};
openfl_display__$internal_DOMTextField.__regexColor = new EReg("color=(\"#([^\"]+)\"|'#([^']+)')","i");
openfl_display__$internal_DOMTextField.__regexFace = new EReg("face=(\"([^\"]+)\"|'([^']+)')","i");
openfl_display__$internal_DOMTextField.__regexFont = new EReg("<font ([^>]+)>","gi");
openfl_display__$internal_DOMTextField.__regexCloseFont = new EReg("</font>","gi");
openfl_display__$internal_DOMTextField.__regexSize = new EReg("size=(\"([^\"]+)\"|'([^']+)')","i");
openfl_display__$internal_DOMTilemap.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}};
openfl_display__$internal_DOMVideo.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}};
openfl_display__$internal_DrawCommandReader.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}, fields : { obj : { SuppressWarnings : ["checkstyle:Dynamic"]}}};
openfl_display__$internal_FlashRenderer.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}};
openfl_display__$internal_FlashTilemap.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}};
openfl_display__$internal_FlashTilemap.alphaColorTransform = new openfl_geom_ColorTransform();
openfl_display__$internal_FlashTilemap.bitmap = new openfl_display_Bitmap();
openfl_display__$internal_FlashTilemap.destPoint = new openfl_geom_Point();
openfl_display__$internal_FlashTilemap.sourceRect = new openfl_geom_Rectangle();
openfl_display__$internal_PerlinNoise.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}, statics : { P : { SuppressWarnings : ["checkstyle:ConstantName"]}}};
openfl_display__$internal_PerlinNoise.P = [151,160,137,91,90,15,131,13,201,95,96,53,194,233,7,225,140,36,103,30,69,142,8,99,37,240,21,10,23,190,6,148,247,120,234,75,0,26,197,62,94,252,219,203,117,35,11,32,57,177,33,88,237,149,56,87,174,20,125,136,171,168,68,175,74,165,71,134,139,48,27,166,77,146,158,231,83,111,229,122,60,211,133,230,220,105,92,41,55,46,245,40,244,102,143,54,65,25,63,161,1,216,80,73,209,76,132,187,208,89,18,169,200,196,135,130,116,188,159,86,164,100,109,198,173,186,3,64,52,217,226,250,124,123,5,202,38,147,118,126,255,82,85,212,207,206,59,227,47,16,58,17,182,189,28,42,223,183,170,213,119,248,152,2,44,154,163,70,221,153,101,155,167,43,172,9,129,22,39,253,19,98,108,110,79,113,224,232,178,185,112,104,218,246,97,228,251,34,242,193,238,210,144,12,191,179,162,241,81,51,145,235,249,14,239,107,49,192,214,31,181,199,106,157,184,84,204,176,115,121,50,45,127,4,150,254,138,236,205,93,222,114,67,29,24,72,243,141,128,195,78,66,215,61,156,180,151,160,137,91,90,15,131,13,201,95,96,53,194,233,7,225,140,36,103,30,69,142,8,99,37,240,21,10,23,190,6,148,247,120,234,75,0,26,197,62,94,252,219,203,117,35,11,32,57,177,33,88,237,149,56,87,174,20,125,136,171,168,68,175,74,165,71,134,139,48,27,166,77,146,158,231,83,111,229,122,60,211,133,230,220,105,92,41,55,46,245,40,244,102,143,54,65,25,63,161,1,216,80,73,209,76,132,187,208,89,18,169,200,196,135,130,116,188,159,86,164,100,109,198,173,186,3,64,52,217,226,250,124,123,5,202,38,147,118,126,255,82,85,212,207,206,59,227,47,16,58,17,182,189,28,42,223,183,170,213,119,248,152,2,44,154,163,70,221,153,101,155,167,43,172,9,129,22,39,253,19,98,108,110,79,113,224,232,178,185,112,104,218,246,97,228,251,34,242,193,238,210,144,12,191,179,162,241,81,51,145,235,249,14,239,107,49,192,214,31,181,199,106,157,184,84,204,176,115,121,50,45,127,4,150,254,138,236,205,93,222,114,67,29,24,72,243,141,128,195,78,66,215,61,156,180];
openfl_display__$internal_SamplerState.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}};
openfl_display__$internal_ShaderBuffer.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}, fields : { overrideIntValues : { SuppressWarnings : ["checkstyle:Dynamic"]}}};
openfl_display__$internal_stats_DrawCallCounter.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}};
openfl_display__$internal_stats_Context3DStats.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}};
openfl_display__$internal_stats_Context3DStats.drawCallsCounters = (function($this) {
	var $r;
	var _g = new haxe_ds_IntMap();
	{
		var value = new openfl_display__$internal_stats_DrawCallCounter();
		_g.h[0] = value;
	}
	{
		var value = new openfl_display__$internal_stats_DrawCallCounter();
		_g.h[1] = value;
	}
	$r = _g;
	return $r;
}(this));
openfl_display3D_Context3D.supportsVideoTexture = true;
openfl_display3D_Context3D.__glDepthStencil = -1;
openfl_display3D_Context3D.__glMaxTextureMaxAnisotropy = -1;
openfl_display3D_Context3D.__glMaxViewportDims = -1;
openfl_display3D_Context3D.__glMemoryCurrentAvailable = -1;
openfl_display3D_Context3D.__glMemoryTotalAvailable = -1;
openfl_display3D_Context3D.__glTextureMaxAnisotropy = -1;
openfl_display3D_Context3DBlendFactor.DESTINATION_ALPHA = 0;
openfl_display3D_Context3DBlendFactor.DESTINATION_COLOR = 1;
openfl_display3D_Context3DBlendFactor.ONE = 2;
openfl_display3D_Context3DBlendFactor.ONE_MINUS_DESTINATION_ALPHA = 3;
openfl_display3D_Context3DBlendFactor.ONE_MINUS_DESTINATION_COLOR = 4;
openfl_display3D_Context3DBlendFactor.ONE_MINUS_SOURCE_ALPHA = 5;
openfl_display3D_Context3DBlendFactor.ONE_MINUS_SOURCE_COLOR = 6;
openfl_display3D_Context3DBlendFactor.SOURCE_ALPHA = 7;
openfl_display3D_Context3DBlendFactor.SOURCE_COLOR = 8;
openfl_display3D_Context3DBlendFactor.ZERO = 9;
openfl_display3D_Context3DBufferUsage.DYNAMIC_DRAW = 0;
openfl_display3D_Context3DBufferUsage.STATIC_DRAW = 1;
openfl_display3D_Context3DCompareMode.ALWAYS = 0;
openfl_display3D_Context3DCompareMode.EQUAL = 1;
openfl_display3D_Context3DCompareMode.GREATER = 2;
openfl_display3D_Context3DCompareMode.GREATER_EQUAL = 3;
openfl_display3D_Context3DCompareMode.LESS = 4;
openfl_display3D_Context3DCompareMode.LESS_EQUAL = 5;
openfl_display3D_Context3DCompareMode.NEVER = 6;
openfl_display3D_Context3DCompareMode.NOT_EQUAL = 7;
openfl_display3D_Context3DMipFilter.MIPLINEAR = 0;
openfl_display3D_Context3DMipFilter.MIPNEAREST = 1;
openfl_display3D_Context3DMipFilter.MIPNONE = 2;
openfl_display3D_Context3DProfile.BASELINE = 0;
openfl_display3D_Context3DProfile.BASELINE_CONSTRAINED = 1;
openfl_display3D_Context3DProfile.BASELINE_EXTENDED = 2;
openfl_display3D_Context3DProfile.STANDARD = 3;
openfl_display3D_Context3DProfile.STANDARD_CONSTRAINED = 4;
openfl_display3D_Context3DProfile.STANDARD_EXTENDED = 5;
openfl_display3D_Context3DProgramFormat.AGAL = 0;
openfl_display3D_Context3DProgramFormat.GLSL = 1;
openfl_display3D_Context3DProgramType.FRAGMENT = 0;
openfl_display3D_Context3DProgramType.VERTEX = 1;
openfl_display3D_Context3DRenderMode.AUTO = 0;
openfl_display3D_Context3DRenderMode.SOFTWARE = 1;
openfl_display3D_Context3DStencilAction.DECREMENT_SATURATE = 0;
openfl_display3D_Context3DStencilAction.DECREMENT_WRAP = 1;
openfl_display3D_Context3DStencilAction.INCREMENT_SATURATE = 2;
openfl_display3D_Context3DStencilAction.INCREMENT_WRAP = 3;
openfl_display3D_Context3DStencilAction.INVERT = 4;
openfl_display3D_Context3DStencilAction.KEEP = 5;
openfl_display3D_Context3DStencilAction.SET = 6;
openfl_display3D_Context3DStencilAction.ZERO = 7;
openfl_display3D_Context3DTextureFilter.ANISOTROPIC16X = 0;
openfl_display3D_Context3DTextureFilter.ANISOTROPIC2X = 1;
openfl_display3D_Context3DTextureFilter.ANISOTROPIC4X = 2;
openfl_display3D_Context3DTextureFilter.ANISOTROPIC8X = 3;
openfl_display3D_Context3DTextureFilter.LINEAR = 4;
openfl_display3D_Context3DTextureFilter.NEAREST = 5;
openfl_display3D_Context3DTextureFormat.BGR_PACKED = 0;
openfl_display3D_Context3DTextureFormat.BGRA = 1;
openfl_display3D_Context3DTextureFormat.BGRA_PACKED = 2;
openfl_display3D_Context3DTextureFormat.COMPRESSED = 3;
openfl_display3D_Context3DTextureFormat.COMPRESSED_ALPHA = 4;
openfl_display3D_Context3DTextureFormat.RGBA_HALF_FLOAT = 5;
openfl_display3D_Context3DTriangleFace.BACK = 0;
openfl_display3D_Context3DTriangleFace.FRONT = 1;
openfl_display3D_Context3DTriangleFace.FRONT_AND_BACK = 2;
openfl_display3D_Context3DTriangleFace.NONE = 3;
openfl_display3D_Context3DVertexBufferFormat.BYTES_4 = 0;
openfl_display3D_Context3DVertexBufferFormat.FLOAT_1 = 1;
openfl_display3D_Context3DVertexBufferFormat.FLOAT_2 = 2;
openfl_display3D_Context3DVertexBufferFormat.FLOAT_3 = 3;
openfl_display3D_Context3DVertexBufferFormat.FLOAT_4 = 4;
openfl_display3D_Context3DWrapMode.CLAMP = 0;
openfl_display3D_Context3DWrapMode.CLAMP_U_REPEAT_V = 1;
openfl_display3D_Context3DWrapMode.REPEAT = 2;
openfl_display3D_Context3DWrapMode.REPEAT_U_CLAMP_V = 3;
openfl_display3D_Uniform.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}};
openfl_display3D_UniformMap.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}};
openfl_display3D__$internal_AGALConverter.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}};
openfl_display3D__$internal_AGALConverter.limitedProfile = true;
openfl_display3D__$internal__$AGALConverter_DestRegister.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}};
openfl_display3D__$internal_RegisterMap.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}};
openfl_display3D__$internal__$AGALConverter_SamplerRegister.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}};
openfl_display3D__$internal__$AGALConverter_SourceRegister.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}};
openfl_display3D__$internal_ATFReader.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}};
openfl_display3D__$internal_Context3DState.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}};
openfl_display3D_textures_TextureBase.__meta__ = { fields : { __textureContext : { SuppressWarnings : ["checkstyle:Dynamic"]}, __getGLFramebuffer : { SuppressWarnings : ["checkstyle:Dynamic"]}}};
openfl_display3D_textures_Texture.__lowMemoryMode = false;
openfl_errors_Error.DEFAULT_TO_STRING = "Error";
openfl_events_ActivityEvent.ACTIVITY = "activity";
openfl_events_TextEvent.LINK = "link";
openfl_events_TextEvent.TEXT_INPUT = "textInput";
openfl_events_ErrorEvent.ERROR = "error";
openfl_events_AsyncErrorEvent.ASYNC_ERROR = "asyncError";
openfl_events_DataEvent.DATA = "data";
openfl_events_DataEvent.UPLOAD_COMPLETE_DATA = "uploadCompleteData";
openfl_events__$EventDispatcher_DispatchIterator.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}};
openfl_events__$EventDispatcher_Listener.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}};
openfl_events__$EventDispatcher_Listener.supportsWeakReference = (function($this) {
	var $r;
	var o = $global;
	$r = Object.prototype.hasOwnProperty.call(o,"WeakRef");
	return $r;
}(this));
openfl_events_FocusEvent.FOCUS_IN = "focusIn";
openfl_events_FocusEvent.FOCUS_OUT = "focusOut";
openfl_events_FocusEvent.KEY_FOCUS_CHANGE = "keyFocusChange";
openfl_events_FocusEvent.MOUSE_FOCUS_CHANGE = "mouseFocusChange";
openfl_events_FullScreenEvent.FULL_SCREEN = "fullScreen";
openfl_events_FullScreenEvent.FULL_SCREEN_INTERACTIVE_ACCEPTED = "fullScreenInteractiveAccepted";
openfl_events_GameInputEvent.DEVICE_ADDED = "deviceAdded";
openfl_events_GameInputEvent.DEVICE_REMOVED = "deviceRemoved";
openfl_events_GameInputEvent.DEVICE_UNUSABLE = "deviceUnusable";
openfl_events_HTTPStatusEvent.HTTP_RESPONSE_STATUS = "httpResponseStatus";
openfl_events_HTTPStatusEvent.HTTP_STATUS = "httpStatus";
openfl_events_IOErrorEvent.IO_ERROR = "ioError";
openfl_events_KeyboardEvent.KEY_DOWN = "keyDown";
openfl_events_KeyboardEvent.KEY_UP = "keyUp";
openfl_events_MouseEvent.CLICK = "click";
openfl_events_MouseEvent.DOUBLE_CLICK = "doubleClick";
openfl_events_MouseEvent.MIDDLE_CLICK = "middleClick";
openfl_events_MouseEvent.MIDDLE_MOUSE_DOWN = "middleMouseDown";
openfl_events_MouseEvent.MIDDLE_MOUSE_UP = "middleMouseUp";
openfl_events_MouseEvent.MOUSE_DOWN = "mouseDown";
openfl_events_MouseEvent.MOUSE_MOVE = "mouseMove";
openfl_events_MouseEvent.MOUSE_OUT = "mouseOut";
openfl_events_MouseEvent.MOUSE_OVER = "mouseOver";
openfl_events_MouseEvent.MOUSE_UP = "mouseUp";
openfl_events_MouseEvent.MOUSE_WHEEL = "mouseWheel";
openfl_events_MouseEvent.RELEASE_OUTSIDE = "releaseOutside";
openfl_events_MouseEvent.RIGHT_CLICK = "rightClick";
openfl_events_MouseEvent.RIGHT_MOUSE_DOWN = "rightMouseDown";
openfl_events_MouseEvent.RIGHT_MOUSE_UP = "rightMouseUp";
openfl_events_MouseEvent.ROLL_OUT = "rollOut";
openfl_events_MouseEvent.ROLL_OVER = "rollOver";
openfl_events_NetStatusEvent.NET_STATUS = "netStatus";
openfl_events_ProgressEvent.PROGRESS = "progress";
openfl_events_ProgressEvent.SOCKET_DATA = "socketData";
openfl_events_RenderEvent.CLEAR_DOM = "clearDOM";
openfl_events_RenderEvent.RENDER_CAIRO = "renderCairo";
openfl_events_RenderEvent.RENDER_CANVAS = "renderCanvas";
openfl_events_RenderEvent.RENDER_DOM = "renderDOM";
openfl_events_RenderEvent.RENDER_OPENGL = "renderOpenGL";
openfl_events_SampleDataEvent.SAMPLE_DATA = "sampleData";
openfl_events_SecurityErrorEvent.SECURITY_ERROR = "securityError";
openfl_events_StageOrientationEvent.ORIENTATION_CHANGE = "orientationChange";
openfl_events_StageOrientationEvent.ORIENTATION_CHANGING = "orientationChanging";
openfl_events_TimerEvent.TIMER = "timer";
openfl_events_TimerEvent.TIMER_COMPLETE = "timerComplete";
openfl_events_TouchEvent.__meta__ = { fields : { delta : { SuppressWarnings : ["checkstyle:FieldDocComment"]}}};
openfl_events_TouchEvent.TOUCH_BEGIN = "touchBegin";
openfl_events_TouchEvent.TOUCH_END = "touchEnd";
openfl_events_TouchEvent.TOUCH_MOVE = "touchMove";
openfl_events_TouchEvent.TOUCH_OUT = "touchOut";
openfl_events_TouchEvent.TOUCH_OVER = "touchOver";
openfl_events_TouchEvent.TOUCH_ROLL_OUT = "touchRollOut";
openfl_events_TouchEvent.TOUCH_ROLL_OVER = "touchRollOver";
openfl_events_TouchEvent.TOUCH_TAP = "touchTap";
openfl_events_UncaughtErrorEvent.UNCAUGHT_ERROR = "uncaughtError";
openfl_external_ExternalInterface.available = true;
openfl_external_ExternalInterface.marshallExceptions = false;
openfl_filters_BlurFilter.__blurShader = new openfl_filters__$BlurFilter_BlurShader();
openfl_filters_DropShadowFilter.__hideShader = new openfl_filters__$DropShadowFilter_HideShader();
openfl_filters_GlowFilter.__invertAlphaShader = new openfl_filters__$GlowFilter_InvertAlphaShader();
openfl_filters_GlowFilter.__blurAlphaShader = new openfl_filters__$GlowFilter_BlurAlphaShader();
openfl_filters_GlowFilter.__combineShader = new openfl_filters__$GlowFilter_CombineShader();
openfl_filters_GlowFilter.__innerCombineShader = new openfl_filters__$GlowFilter_InnerCombineShader();
openfl_filters_GlowFilter.__combineKnockoutShader = new openfl_filters__$GlowFilter_CombineKnockoutShader();
openfl_filters_GlowFilter.__innerCombineKnockoutShader = new openfl_filters__$GlowFilter_InnerCombineKnockoutShader();
openfl_filters_ShaderFilter.__meta__ = { fields : { blendMode : { SuppressWarnings : ["checkstyle:FieldDocComment"]}}};
openfl_geom_Matrix3D.__meta__ = { statics : { create2D : { SuppressWarnings : ["checkstyle:FieldDocComment"]}, createABCD : { SuppressWarnings : ["checkstyle:FieldDocComment"]}, createOrtho : { SuppressWarnings : ["checkstyle:FieldDocComment"]}}};
openfl_geom_Orientation3D.AXIS_ANGLE = 0;
openfl_geom_Orientation3D.EULER_ANGLES = 1;
openfl_geom_Orientation3D.QUATERNION = 2;
openfl_globalization_DateTimeNameContext.FORMAT = 0;
openfl_globalization_DateTimeNameContext.STANDALONE = 1;
openfl_globalization_DateTimeNameStyle.FULL = 0;
openfl_globalization_DateTimeNameStyle.LONG_ABBREVIATION = 1;
openfl_globalization_DateTimeNameStyle.SHORT_ABBREVIATION = 2;
openfl_globalization_DateTimeStyle.CUSTOM = 0;
openfl_globalization_DateTimeStyle.LONG = 1;
openfl_globalization_DateTimeStyle.MEDIUM = 2;
openfl_globalization_DateTimeStyle.NONE = 3;
openfl_globalization_DateTimeStyle.SHORT = 4;
openfl_globalization_LastOperationStatus.BUFFER_OVERFLOW_ERROR = 0;
openfl_globalization_LastOperationStatus.ERROR_CODE_UNKNOWN = 1;
openfl_globalization_LastOperationStatus.ILLEGAL_ARGUMENT_ERROR = 2;
openfl_globalization_LastOperationStatus.INDEX_OUT_OF_BOUNDS_ERROR = 3;
openfl_globalization_LastOperationStatus.INVALID_ATTR_VALUE = 4;
openfl_globalization_LastOperationStatus.INVALID_CHAR_FOUND = 5;
openfl_globalization_LastOperationStatus.MEMORY_ALLOCATION_ERROR = 6;
openfl_globalization_LastOperationStatus.NO_ERROR = 7;
openfl_globalization_LastOperationStatus.NUMBER_OVERFLOW_ERROR = 8;
openfl_globalization_LastOperationStatus.PARSE_ERROR = 9;
openfl_globalization_LastOperationStatus.PATTERN_SYNTAX_ERROR = 10;
openfl_globalization_LastOperationStatus.PLATFORM_API_FAILED = 11;
openfl_globalization_LastOperationStatus.TRUNCATED_CHAR_FOUND = 12;
openfl_globalization_LastOperationStatus.UNEXPECTED_TOKEN = 13;
openfl_globalization_LastOperationStatus.UNSUPPORTED_ERROR = 14;
openfl_globalization_LastOperationStatus.USING_DEFAULT_WARNING = 15;
openfl_globalization_LastOperationStatus.USING_FALLBACK_WARNING = 16;
openfl_globalization_LocaleID.DEFAULT = "i-default";
openfl_globalization_LocaleID.RTL_LANGUAGES = ["ae","ar","arc","bcc","bqi","ckb","dv","fa","glk","he","ku","mzn","nqo","pnb","ps","sd","ug","ur","yi"];
openfl_media_SoundTransform.__meta__ = { fields : { clone : { SuppressWarnings : ["checkstyle:FieldDocComment"]}}};
openfl_media_SoundMixer.MAX_ACTIVE_CHANNELS = 32;
openfl_media_SoundMixer.__soundChannels = [];
openfl_media_SoundMixer.__soundTransform = new openfl_media_SoundTransform();
openfl_media_Video.VERTEX_BUFFER_STRIDE = 5;
openfl_net_NetConnection.__meta__ = { statics : { CONNECT_SUCCESS : { SuppressWarnings : ["checkstyle:FieldDocComment"]}}};
openfl_net_NetConnection.CONNECT_SUCCESS = "NetConnection.Connect.Success";
openfl_net_NetStream.__meta__ = { fields : { audioCodec : { SuppressWarnings : ["checkstyle:FieldDocComment"]}, decodedFrames : { SuppressWarnings : ["checkstyle:FieldDocComment"]}, speed : { SuppressWarnings : ["checkstyle:FieldDocComment"]}, requestVideoStatus : { SuppressWarnings : ["checkstyle:FieldDocComment"]}}};
openfl_net_ObjectEncoding.AMF0 = 0;
openfl_net_ObjectEncoding.AMF3 = 3;
openfl_net_ObjectEncoding.HXSF = 10;
openfl_net_ObjectEncoding.LARGE_HXSF = 11;
openfl_net_ObjectEncoding.JSON = 12;
openfl_net_ObjectEncoding.LARGE_JSON = 13;
openfl_net_ObjectEncoding.DEFAULT = 10;
openfl_net_SharedObject.defaultObjectEncoding = 10;
openfl_net_SharedObjectFlushStatus.FLUSHED = 0;
openfl_net_SharedObjectFlushStatus.PENDING = 1;
openfl_net_URLLoaderDataFormat.BINARY = 0;
openfl_net_URLLoaderDataFormat.TEXT = 1;
openfl_net_URLLoaderDataFormat.VARIABLES = 2;
openfl_net_URLRequestDefaults.followRedirects = true;
openfl_net_URLRequestDefaults.idleTimeout = 0;
openfl_net_URLRequestDefaults.manageCookies = true;
openfl_net_URLVariables.__meta__ = { statics : { __get : { SuppressWarnings : ["checkstyle:FieldDocComment"]}, __set : { SuppressWarnings : ["checkstyle:FieldDocComment"]}}};
openfl_system_ApplicationDomain.currentDomain = new openfl_system_ApplicationDomain(null);
openfl_system_Capabilities.avHardwareDisable = true;
openfl_system_Capabilities.hasAccessibility = false;
openfl_system_Capabilities.hasAudio = true;
openfl_system_Capabilities.hasAudioEncoder = false;
openfl_system_Capabilities.hasEmbeddedVideo = false;
openfl_system_Capabilities.hasIME = false;
openfl_system_Capabilities.hasMP3 = false;
openfl_system_Capabilities.hasPrinting = true;
openfl_system_Capabilities.hasScreenBroadcast = false;
openfl_system_Capabilities.hasScreenPlayback = false;
openfl_system_Capabilities.hasStreamingAudio = false;
openfl_system_Capabilities.hasStreamingVideo = false;
openfl_system_Capabilities.hasTLS = true;
openfl_system_Capabilities.hasVideoEncoder = true;
openfl_system_Capabilities.isDebugger = false;
openfl_system_Capabilities.isEmbeddedInAcrobat = false;
openfl_system_Capabilities.localFileReadDisable = true;
openfl_system_Capabilities.maxLevelIDC = 0;
openfl_system_Capabilities.playerType = "PlugIn";
openfl_system_Capabilities.screenColor = "color";
openfl_system_Capabilities.serverString = "";
openfl_system_Capabilities.supports32BitProcesses = false;
openfl_system_Capabilities.supports64BitProcesses = false;
openfl_system_Capabilities.touchscreenType = 0;
openfl_system_Capabilities.__standardDensities = [120,160,240,320,480,640,800,960];
openfl_system_SecurityDomain.__meta__ = { obj : { SuppressWarnings : ["checkstyle:UnnecessaryConstructor"]}};
openfl_system_SecurityDomain.currentDomain = new openfl_system_SecurityDomain();
openfl_system_TouchscreenType.FINGER = 0;
openfl_system_TouchscreenType.NONE = 1;
openfl_system_TouchscreenType.STYLUS = 2;
openfl_text_AntiAliasType.ADVANCED = 0;
openfl_text_AntiAliasType.NORMAL = 1;
openfl_text_Font.__fontByName = new haxe_ds_StringMap();
openfl_text_Font.__registeredFonts = [];
openfl_text_FontStyle.BOLD = 0;
openfl_text_FontStyle.BOLD_ITALIC = 1;
openfl_text_FontStyle.ITALIC = 2;
openfl_text_FontStyle.REGULAR = 3;
openfl_text_FontType.DEVICE = 0;
openfl_text_FontType.EMBEDDED = 1;
openfl_text_FontType.EMBEDDED_CFF = 2;
openfl_text_GridFitType.NONE = 0;
openfl_text_GridFitType.PIXEL = 1;
openfl_text_GridFitType.SUBPIXEL = 2;
openfl_text_TextFieldAutoSize.CENTER = 0;
openfl_text_TextFieldAutoSize.LEFT = 1;
openfl_text_TextFieldAutoSize.NONE = 2;
openfl_text_TextFieldAutoSize.RIGHT = 3;
openfl_text_TextFieldType.DYNAMIC = 0;
openfl_text_TextFieldType.INPUT = 1;
openfl_text_TextFormat.__meta__ = { fields : { clone : { SuppressWarnings : ["checkstyle:FieldDocComment"]}}};
openfl_text_TextFormatAlign.CENTER = 0;
openfl_text_TextFormatAlign.END = 1;
openfl_text_TextFormatAlign.JUSTIFY = 2;
openfl_text_TextFormatAlign.LEFT = 3;
openfl_text_TextFormatAlign.RIGHT = 4;
openfl_text_TextFormatAlign.START = 5;
openfl_text__$internal_CacheMeasurement.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}};
openfl_text__$internal_GlyphPosition.__meta__ = { obj : { SuppressWarnings : [["checkstyle:FieldDocComment","checkstyle:Dynamic"]]}};
openfl_text__$internal_HTMLParser.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}};
openfl_text__$internal_HTMLParser.__regexAlign = new EReg("align\\s?=\\s?(\"([^\"]+)\"|'([^']+)')","i");
openfl_text__$internal_HTMLParser.__regexBreakTag = new EReg("<br\\s*/?>","gi");
openfl_text__$internal_HTMLParser.__regexBlockIndent = new EReg("blockindent\\s?=\\s?(\"([^\"]+)\"|'([^']+)')","i");
openfl_text__$internal_HTMLParser.__regexClass = new EReg("class\\s?=\\s?(\"([^\"]+)\"|'([^']+)')","i");
openfl_text__$internal_HTMLParser.__regexColor = new EReg("color\\s?=\\s?(\"#([^\"]+)\"|'#([^']+)')","i");
openfl_text__$internal_HTMLParser.__regexEntityApos = new EReg("&apos;","g");
openfl_text__$internal_HTMLParser.__regexEntityNbsp = new EReg("&nbsp;","g");
openfl_text__$internal_HTMLParser.__regexCharEntity = new EReg("&#(?:([0-9]+)|(x[0-9a-fA-F]+));","g");
openfl_text__$internal_HTMLParser.__regexFace = new EReg("face\\s?=\\s?(\"([^\"]+)\"|'([^']+)')","i");
openfl_text__$internal_HTMLParser.__regexHTMLTag = new EReg("<.*?>","g");
openfl_text__$internal_HTMLParser.__regexHref = new EReg("href\\s?=\\s?(\"([^\"]+)\"|'([^']+)')","i");
openfl_text__$internal_HTMLParser.__regexIndent = new EReg(" indent\\s?=\\s?(\"([^\"]+)\"|'([^']+)')","i");
openfl_text__$internal_HTMLParser.__regexLeading = new EReg("leading\\s?=\\s?(\"([^\"]+)\"|'([^']+)')","i");
openfl_text__$internal_HTMLParser.__regexLeftMargin = new EReg("leftmargin\\s?=\\s?(\"([^\"]+)\"|'([^']+)')","i");
openfl_text__$internal_HTMLParser.__regexRightMargin = new EReg("rightmargin\\s?=\\s?(\"([^\"]+)\"|'([^']+)')","i");
openfl_text__$internal_HTMLParser.__regexSize = new EReg("size\\s?=\\s?(\"([^\"]+)\"|'([^']+)')","i");
openfl_text__$internal_HTMLParser.__regexTabStops = new EReg("tabstops\\s?=\\s?(\"([^\"]+)\"|'([^']+)')","i");
openfl_text__$internal_ShapeCache.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}};
openfl_text__$internal_TextEngine.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}, fields : { __cairoFont : { SuppressWarnings : ["checkstyle:Dynamic"]}}};
openfl_text__$internal_TextEngine.GUTTER = 2;
openfl_text__$internal_TextEngine.UTF8_TAB = 9;
openfl_text__$internal_TextEngine.UTF8_ENDLINE = 10;
openfl_text__$internal_TextEngine.UTF8_SPACE = 32;
openfl_text__$internal_TextEngine.UTF8_HYPHEN = 45;
openfl_text__$internal_TextLayout.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}, fields : { glyphs : { SuppressWarnings : ["checkstyle:Dynamic"]}, __handle : { SuppressWarnings : ["checkstyle:Dynamic"]}, __hbBuffer : { SuppressWarnings : ["checkstyle:Dynamic"]}, __hbFont : { SuppressWarnings : ["checkstyle:Dynamic"]}, get_glyphs : { SuppressWarnings : ["checkstyle:Dynamic"]}}};
openfl_text__$internal_TextLayout.FT_LOAD_DEFAULT = 0;
openfl_text__$internal_TextLayout.FT_LOAD_NO_SCALE = 1;
openfl_text__$internal_TextLayout.FT_LOAD_NO_HINTING = 2;
openfl_text__$internal_TextLayout.FT_LOAD_RENDER = 4;
openfl_text__$internal_TextLayout.FT_LOAD_NO_BITMAP = 8;
openfl_text__$internal_TextLayout.FT_LOAD_VERTICAL_LAYOUT = 16;
openfl_text__$internal_TextLayout.FT_LOAD_FORCE_AUTOHINT = 32;
openfl_text__$internal_TextLayout.FT_LOAD_CROP_BITMAP = 64;
openfl_text__$internal_TextLayout.FT_LOAD_PEDANTIC = 128;
openfl_text__$internal_TextLayout.FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH = 256;
openfl_text__$internal_TextLayout.FT_LOAD_NO_RECURSE = 512;
openfl_text__$internal_TextLayout.FT_LOAD_IGNORE_TRANSFORM = 1024;
openfl_text__$internal_TextLayout.FT_LOAD_MONOCHROME = 2048;
openfl_text__$internal_TextLayout.FT_LOAD_LINEAR_DESIGN = 4096;
openfl_text__$internal_TextLayout.FT_LOAD_NO_AUTOHINT = 8192;
openfl_text__$internal_TextLayout.FT_LOAD_COLOR = 16384;
openfl_text__$internal_TextLayout.FT_LOAD_COMPUTE_METRICS = 32768;
openfl_text__$internal_TextLayout.FT_LOAD_BITMAP_METRICS_ONLY = 65536;
openfl_text__$internal_TextLayout.FT_LOAD_TARGET_NORMAL = 0;
openfl_text__$internal_TextLayout.FT_LOAD_TARGET_LIGHT = 0;
openfl_text__$internal_TextDirection.INVALID = 0;
openfl_text__$internal_TextDirection.LEFT_TO_RIGHT = 4;
openfl_text__$internal_TextDirection.RIGHT_TO_LEFT = 5;
openfl_text__$internal_TextDirection.TOP_TO_BOTTOM = 6;
openfl_text__$internal_TextDirection.BOTTOM_TO_TOP = 7;
openfl_text__$internal_TextScript.COMMON = "Zyyy";
openfl_text__$internal_TextScript.INHERITED = "Zinh";
openfl_text__$internal_TextScript.UNKNOWN = "Zzzz";
openfl_text__$internal_TextScript.ARABIC = "Arab";
openfl_text__$internal_TextScript.ARMENIAN = "Armn";
openfl_text__$internal_TextScript.BENGALI = "Beng";
openfl_text__$internal_TextScript.CYRILLIC = "Cyrl";
openfl_text__$internal_TextScript.DEVANAGARI = "Deva";
openfl_text__$internal_TextScript.GEORGIAN = "Geor";
openfl_text__$internal_TextScript.GREEK = "Grek";
openfl_text__$internal_TextScript.GUJARATI = "Gujr";
openfl_text__$internal_TextScript.GURMUKHI = "Guru";
openfl_text__$internal_TextScript.HANGUL = "Hang";
openfl_text__$internal_TextScript.HAN = "Hani";
openfl_text__$internal_TextScript.HEBREW = "Hebr";
openfl_text__$internal_TextScript.HIRAGANA = "Hira";
openfl_text__$internal_TextScript.KANNADA = "Knda";
openfl_text__$internal_TextScript.KATAKANA = "Kana";
openfl_text__$internal_TextScript.LAO = "Laoo";
openfl_text__$internal_TextScript.LATIN = "Latn";
openfl_text__$internal_TextScript.MALAYALAM = "Mlym";
openfl_text__$internal_TextScript.ORIYA = "Orya";
openfl_text__$internal_TextScript.TAMIL = "Taml";
openfl_text__$internal_TextScript.TELUGA = "Telu";
openfl_text__$internal_TextScript.THAI = "Thai";
openfl_text__$internal_TextScript.TIBETAN = "Tibt";
openfl_text__$internal_TextScript.BOPOMOFO = "Bopo";
openfl_text__$internal_TextScript.BRAILLE = "Brai";
openfl_text__$internal_TextScript.CANADIAN_SYLLABICS = "Cans";
openfl_text__$internal_TextScript.CHEROKEE = "Cher";
openfl_text__$internal_TextScript.ETHIOPIC = "Ethi";
openfl_text__$internal_TextScript.KHMER = "Khmr";
openfl_text__$internal_TextScript.MONGOLIAN = "Mong";
openfl_text__$internal_TextScript.MYANMAR = "Mymr";
openfl_text__$internal_TextScript.OGHAM = "Ogam";
openfl_text__$internal_TextScript.RUNIC = "Runr";
openfl_text__$internal_TextScript.SINHALA = "Sinh";
openfl_text__$internal_TextScript.SYRIAC = "Syrc";
openfl_text__$internal_TextScript.THAANA = "Thaa";
openfl_text__$internal_TextScript.YI = "Yiii";
openfl_text__$internal_TextScript.DESERET = "Dsrt";
openfl_text__$internal_TextScript.GOTHIC = "Goth";
openfl_text__$internal_TextScript.OLD_ITALIC = "Ital";
openfl_text__$internal_TextScript.BUHID = "Buhd";
openfl_text__$internal_TextScript.HANUNOO = "Hano";
openfl_text__$internal_TextScript.TAGALOG = "Tglg";
openfl_text__$internal_TextScript.TAGBANWA = "Tagb";
openfl_text__$internal_TextScript.CYPRIOT = "Cprt";
openfl_text__$internal_TextScript.LIMBU = "Limb";
openfl_text__$internal_TextScript.LINEAR_B = "Linb";
openfl_text__$internal_TextScript.OSMANYA = "Osma";
openfl_text__$internal_TextScript.SHAVIAN = "Shaw";
openfl_text__$internal_TextScript.TAI_LE = "Tale";
openfl_text__$internal_TextScript.UGARITIC = "Ugar";
openfl_text__$internal_TextScript.BUGINESE = "Bugi";
openfl_text__$internal_TextScript.COPTIC = "Copt";
openfl_text__$internal_TextScript.GLAGOLITIC = "Glag";
openfl_text__$internal_TextScript.KHAROSHTHI = "Khar";
openfl_text__$internal_TextScript.NEW_TAI_LUE = "Talu";
openfl_text__$internal_TextScript.OLD_PERSIAN = "Xpeo";
openfl_text__$internal_TextScript.SYLOTI_NAGRI = "Sylo";
openfl_text__$internal_TextScript.TIFINAGH = "Tfng";
openfl_text__$internal_TextScript.BALINESE = "Bali";
openfl_text__$internal_TextScript.CUNEIFORM = "Xsux";
openfl_text__$internal_TextScript.NKO = "Nkoo";
openfl_text__$internal_TextScript.PHAGS_PA = "Phag";
openfl_text__$internal_TextScript.PHOENICIAN = "Phnx";
openfl_text__$internal_TextScript.CARIAN = "Cari";
openfl_text__$internal_TextScript.CHAM = "Cham";
openfl_text__$internal_TextScript.KAYAH_LI = "Kali";
openfl_text__$internal_TextScript.LEPCHA = "Lepc";
openfl_text__$internal_TextScript.LYCIAN = "Lyci";
openfl_text__$internal_TextScript.LYDIAN = "Lydi";
openfl_text__$internal_TextScript.OL_CHIKI = "Olck";
openfl_text__$internal_TextScript.REJANG = "Rjng";
openfl_text__$internal_TextScript.SAURASHTRA = "Saur";
openfl_text__$internal_TextScript.SUNDANESE = "Sund";
openfl_text__$internal_TextScript.VAI = "Vaii";
openfl_text__$internal_TextScript.AVESTAN = "Avst";
openfl_text__$internal_TextScript.BAMUM = "Bamu";
openfl_text__$internal_TextScript.EGYPTIAN_HIEROGLYPHS = "Egyp";
openfl_text__$internal_TextScript.IMPERIAL_ARAMAIC = "Armi";
openfl_text__$internal_TextScript.INSCRIPTIONAL_PAHLAVI = "Phli";
openfl_text__$internal_TextScript.INSCRIPTIONAL_PARTHIAN = "Prti";
openfl_text__$internal_TextScript.JAVANESE = "Java";
openfl_text__$internal_TextScript.KAITHI = "Kthi";
openfl_text__$internal_TextScript.LISU = "Lisu";
openfl_text__$internal_TextScript.MEETEI_MAYEK = "Mtei";
openfl_text__$internal_TextScript.OLD_SOUTH_ARABIAN = "Sarb";
openfl_text__$internal_TextScript.OLD_TURKIC = "Orkh";
openfl_text__$internal_TextScript.SAMARITAN = "Samr";
openfl_text__$internal_TextScript.TAI_THAM = "Lana";
openfl_text__$internal_TextScript.TAI_VIET = "Tavt";
openfl_text__$internal_TextScript.BATAK = "Batk";
openfl_text__$internal_TextScript.BRAHMI = "Brah";
openfl_text__$internal_TextScript.MANDAIC = "Mand";
openfl_text__$internal_TextScript.CHAKMA = "Cakm";
openfl_text__$internal_TextScript.MEROITIC_CURSIVE = "Merc";
openfl_text__$internal_TextScript.MEROITIC_HIEROGLYPHS = "Mero";
openfl_text__$internal_TextScript.MIAO = "Plrd";
openfl_text__$internal_TextScript.SHARADA = "Shrd";
openfl_text__$internal_TextScript.SORA_SOMPENG = "Sora";
openfl_text__$internal_TextScript.TAKRI = "Takr";
openfl_text__$internal_TextScript.BASSA_VAH = "Bass";
openfl_text__$internal_TextScript.CAUCASIAN_ALBANIAN = "Aghb";
openfl_text__$internal_TextScript.DUPLOYAN = "Dupl";
openfl_text__$internal_TextScript.ELBASAN = "Elba";
openfl_text__$internal_TextScript.GRANTHA = "Gran";
openfl_text__$internal_TextScript.KHOJKI = "Khoj";
openfl_text__$internal_TextScript.KHUDAWADI = "Sind";
openfl_text__$internal_TextScript.LINEAR_A = "Lina";
openfl_text__$internal_TextScript.MAHAJANI = "Mahj";
openfl_text__$internal_TextScript.MANICHAEAN = "Mani";
openfl_text__$internal_TextScript.MENDE_KIKAKUI = "Mend";
openfl_text__$internal_TextScript.MODI = "Modi";
openfl_text__$internal_TextScript.MRO = "Mroo";
openfl_text__$internal_TextScript.NABATAEAN = "Nbat";
openfl_text__$internal_TextScript.OLD_NORTH_ARABIAN = "Narb";
openfl_text__$internal_TextScript.OLD_PERMIC = "Perm";
openfl_text__$internal_TextScript.PAHAWH_HMONG = "Hmng";
openfl_text__$internal_TextScript.PALMYRENE = "Palm";
openfl_text__$internal_TextScript.PAU_CIN_HAU = "Pauc";
openfl_text__$internal_TextScript.PSALTER_PAHLAVI = "Phlp";
openfl_text__$internal_TextScript.SIDDHAM = "Sidd";
openfl_text__$internal_TextScript.TIRHUTA = "Tirh";
openfl_text__$internal_TextScript.WARANG_CITI = "Wara";
openfl_text__$internal_TextLayoutGroup.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}};
openfl_ui_GameInput.__meta__ = { fields : { addEventListener : { SuppressWarnings : ["checkstyle:Dynamic"]}}};
openfl_ui_GameInput.isSupported = true;
openfl_ui_GameInput.numDevices = 0;
openfl_ui_GameInput.__deviceList = [];
openfl_ui_GameInput.__instances = [];
openfl_ui_GameInput.__devices = new haxe_ds_ObjectMap();
openfl_ui_GameInputDevice.MAX_BUFFER_SIZE = 32000;
openfl_ui_Keyboard.__meta__ = { statics : { BREAK : { SuppressWarnings : ["checkstyle:FieldDocComment"]}, NUMLOCK : { SuppressWarnings : ["checkstyle:FieldDocComment"]}}};
openfl_ui_Keyboard.NUMBER_0 = 48;
openfl_ui_Keyboard.NUMBER_1 = 49;
openfl_ui_Keyboard.NUMBER_2 = 50;
openfl_ui_Keyboard.NUMBER_3 = 51;
openfl_ui_Keyboard.NUMBER_4 = 52;
openfl_ui_Keyboard.NUMBER_5 = 53;
openfl_ui_Keyboard.NUMBER_6 = 54;
openfl_ui_Keyboard.NUMBER_7 = 55;
openfl_ui_Keyboard.NUMBER_8 = 56;
openfl_ui_Keyboard.NUMBER_9 = 57;
openfl_ui_Keyboard.A = 65;
openfl_ui_Keyboard.B = 66;
openfl_ui_Keyboard.C = 67;
openfl_ui_Keyboard.D = 68;
openfl_ui_Keyboard.E = 69;
openfl_ui_Keyboard.F = 70;
openfl_ui_Keyboard.G = 71;
openfl_ui_Keyboard.H = 72;
openfl_ui_Keyboard.I = 73;
openfl_ui_Keyboard.J = 74;
openfl_ui_Keyboard.K = 75;
openfl_ui_Keyboard.L = 76;
openfl_ui_Keyboard.M = 77;
openfl_ui_Keyboard.N = 78;
openfl_ui_Keyboard.O = 79;
openfl_ui_Keyboard.P = 80;
openfl_ui_Keyboard.Q = 81;
openfl_ui_Keyboard.R = 82;
openfl_ui_Keyboard.S = 83;
openfl_ui_Keyboard.T = 84;
openfl_ui_Keyboard.U = 85;
openfl_ui_Keyboard.V = 86;
openfl_ui_Keyboard.W = 87;
openfl_ui_Keyboard.X = 88;
openfl_ui_Keyboard.Y = 89;
openfl_ui_Keyboard.Z = 90;
openfl_ui_Keyboard.NUMPAD_0 = 96;
openfl_ui_Keyboard.NUMPAD_1 = 97;
openfl_ui_Keyboard.NUMPAD_2 = 98;
openfl_ui_Keyboard.NUMPAD_3 = 99;
openfl_ui_Keyboard.NUMPAD_4 = 100;
openfl_ui_Keyboard.NUMPAD_5 = 101;
openfl_ui_Keyboard.NUMPAD_6 = 102;
openfl_ui_Keyboard.NUMPAD_7 = 103;
openfl_ui_Keyboard.NUMPAD_8 = 104;
openfl_ui_Keyboard.NUMPAD_9 = 105;
openfl_ui_Keyboard.NUMPAD_MULTIPLY = 106;
openfl_ui_Keyboard.NUMPAD_ADD = 107;
openfl_ui_Keyboard.NUMPAD_ENTER = 108;
openfl_ui_Keyboard.NUMPAD_SUBTRACT = 109;
openfl_ui_Keyboard.NUMPAD_DECIMAL = 110;
openfl_ui_Keyboard.NUMPAD_DIVIDE = 111;
openfl_ui_Keyboard.F1 = 112;
openfl_ui_Keyboard.F2 = 113;
openfl_ui_Keyboard.F3 = 114;
openfl_ui_Keyboard.F4 = 115;
openfl_ui_Keyboard.F5 = 116;
openfl_ui_Keyboard.F6 = 117;
openfl_ui_Keyboard.F7 = 118;
openfl_ui_Keyboard.F8 = 119;
openfl_ui_Keyboard.F9 = 120;
openfl_ui_Keyboard.F10 = 121;
openfl_ui_Keyboard.F11 = 122;
openfl_ui_Keyboard.F12 = 123;
openfl_ui_Keyboard.F13 = 124;
openfl_ui_Keyboard.F14 = 125;
openfl_ui_Keyboard.F15 = 126;
openfl_ui_Keyboard.BACKSPACE = 8;
openfl_ui_Keyboard.TAB = 9;
openfl_ui_Keyboard.ALTERNATE = 18;
openfl_ui_Keyboard.ENTER = 13;
openfl_ui_Keyboard.COMMAND = 15;
openfl_ui_Keyboard.SHIFT = 16;
openfl_ui_Keyboard.CONTROL = 17;
openfl_ui_Keyboard.BREAK = 19;
openfl_ui_Keyboard.CAPS_LOCK = 20;
openfl_ui_Keyboard.NUMPAD = 21;
openfl_ui_Keyboard.ESCAPE = 27;
openfl_ui_Keyboard.SPACE = 32;
openfl_ui_Keyboard.PAGE_UP = 33;
openfl_ui_Keyboard.PAGE_DOWN = 34;
openfl_ui_Keyboard.END = 35;
openfl_ui_Keyboard.HOME = 36;
openfl_ui_Keyboard.LEFT = 37;
openfl_ui_Keyboard.RIGHT = 39;
openfl_ui_Keyboard.UP = 38;
openfl_ui_Keyboard.DOWN = 40;
openfl_ui_Keyboard.INSERT = 45;
openfl_ui_Keyboard.DELETE = 46;
openfl_ui_Keyboard.NUMLOCK = 144;
openfl_ui_Keyboard.SEMICOLON = 186;
openfl_ui_Keyboard.EQUAL = 187;
openfl_ui_Keyboard.COMMA = 188;
openfl_ui_Keyboard.MINUS = 189;
openfl_ui_Keyboard.PERIOD = 190;
openfl_ui_Keyboard.SLASH = 191;
openfl_ui_Keyboard.BACKQUOTE = 192;
openfl_ui_Keyboard.LEFTBRACKET = 219;
openfl_ui_Keyboard.BACKSLASH = 220;
openfl_ui_Keyboard.RIGHTBRACKET = 221;
openfl_ui_Keyboard.QUOTE = 222;
openfl_ui_Mouse.supportsCursor = true;
openfl_ui_Mouse.supportsNativeCursor = true;
openfl_ui_Mouse.__cursor = "auto";
openfl_ui_MouseCursor.ARROW = "arrow";
openfl_ui_MouseCursor.AUTO = "auto";
openfl_ui_MouseCursor.BUTTON = "button";
openfl_ui_MouseCursor.HAND = "hand";
openfl_ui_MouseCursor.IBEAM = "ibeam";
openfl_ui_MouseCursor.__CROSSHAIR = "crosshair";
openfl_ui_MouseCursor.__CUSTOM = "custom";
openfl_ui_MouseCursor.__MOVE = "move";
openfl_ui_MouseCursor.__RESIZE_NESW = "resize_nesw";
openfl_ui_MouseCursor.__RESIZE_NS = "resize_ns";
openfl_ui_MouseCursor.__RESIZE_NWSE = "resize_nwse";
openfl_ui_MouseCursor.__RESIZE_WE = "resize_we";
openfl_ui_MouseCursor.__WAIT = "wait";
openfl_ui_MouseCursor.__WAIT_ARROW = "waitarrow";
openfl_ui_MultitouchInputMode.GESTURE = 0;
openfl_ui_MultitouchInputMode.NONE = 1;
openfl_ui_MultitouchInputMode.TOUCH_POINT = 2;
openfl_utils_AGALMiniAssembler.__meta__ = { obj : { SuppressWarnings : [["checkstyle:ConstantName","checkstyle:FieldDocComment"]]}};
openfl_utils_AGALMiniAssembler.OPMAP = new haxe_ds_StringMap();
openfl_utils_AGALMiniAssembler.REGMAP = new haxe_ds_StringMap();
openfl_utils_AGALMiniAssembler.SAMPLEMAP = new haxe_ds_StringMap();
openfl_utils_AGALMiniAssembler.MAX_NESTING = 4;
openfl_utils_AGALMiniAssembler.MAX_OPCODES = 4096;
openfl_utils_AGALMiniAssembler.FRAGMENT = "fragment";
openfl_utils_AGALMiniAssembler.VERTEX = "vertex";
openfl_utils_AGALMiniAssembler.SAMPLER_TYPE_SHIFT = 8;
openfl_utils_AGALMiniAssembler.SAMPLER_DIM_SHIFT = 12;
openfl_utils_AGALMiniAssembler.SAMPLER_SPECIAL_SHIFT = 16;
openfl_utils_AGALMiniAssembler.SAMPLER_REPEAT_SHIFT = 20;
openfl_utils_AGALMiniAssembler.SAMPLER_MIPMAP_SHIFT = 24;
openfl_utils_AGALMiniAssembler.SAMPLER_FILTER_SHIFT = 28;
openfl_utils_AGALMiniAssembler.REG_WRITE = 1;
openfl_utils_AGALMiniAssembler.REG_READ = 2;
openfl_utils_AGALMiniAssembler.REG_FRAG = 32;
openfl_utils_AGALMiniAssembler.REG_VERT = 64;
openfl_utils_AGALMiniAssembler.OP_SCALAR = 1;
openfl_utils_AGALMiniAssembler.OP_SPECIAL_TEX = 8;
openfl_utils_AGALMiniAssembler.OP_SPECIAL_MATRIX = 16;
openfl_utils_AGALMiniAssembler.OP_FRAG_ONLY = 32;
openfl_utils_AGALMiniAssembler.OP_VERT_ONLY = 64;
openfl_utils_AGALMiniAssembler.OP_NO_DEST = 128;
openfl_utils_AGALMiniAssembler.OP_VERSION2 = 256;
openfl_utils_AGALMiniAssembler.OP_INCNEST = 512;
openfl_utils_AGALMiniAssembler.OP_DECNEST = 1024;
openfl_utils_AGALMiniAssembler.MOV = "mov";
openfl_utils_AGALMiniAssembler.ADD = "add";
openfl_utils_AGALMiniAssembler.SUB = "sub";
openfl_utils_AGALMiniAssembler.MUL = "mul";
openfl_utils_AGALMiniAssembler.DIV = "div";
openfl_utils_AGALMiniAssembler.RCP = "rcp";
openfl_utils_AGALMiniAssembler.MIN = "min";
openfl_utils_AGALMiniAssembler.MAX = "max";
openfl_utils_AGALMiniAssembler.FRC = "frc";
openfl_utils_AGALMiniAssembler.SQT = "sqt";
openfl_utils_AGALMiniAssembler.RSQ = "rsq";
openfl_utils_AGALMiniAssembler.POW = "pow";
openfl_utils_AGALMiniAssembler.LOG = "log";
openfl_utils_AGALMiniAssembler.EXP = "exp";
openfl_utils_AGALMiniAssembler.NRM = "nrm";
openfl_utils_AGALMiniAssembler.SIN = "sin";
openfl_utils_AGALMiniAssembler.COS = "cos";
openfl_utils_AGALMiniAssembler.CRS = "crs";
openfl_utils_AGALMiniAssembler.DP3 = "dp3";
openfl_utils_AGALMiniAssembler.DP4 = "dp4";
openfl_utils_AGALMiniAssembler.ABS = "abs";
openfl_utils_AGALMiniAssembler.NEG = "neg";
openfl_utils_AGALMiniAssembler.SAT = "sat";
openfl_utils_AGALMiniAssembler.M33 = "m33";
openfl_utils_AGALMiniAssembler.M44 = "m44";
openfl_utils_AGALMiniAssembler.M34 = "m34";
openfl_utils_AGALMiniAssembler.DDX = "ddx";
openfl_utils_AGALMiniAssembler.DDY = "ddy";
openfl_utils_AGALMiniAssembler.IFE = "ife";
openfl_utils_AGALMiniAssembler.INE = "ine";
openfl_utils_AGALMiniAssembler.IFG = "ifg";
openfl_utils_AGALMiniAssembler.IFL = "ifl";
openfl_utils_AGALMiniAssembler.IEG = "ieg";
openfl_utils_AGALMiniAssembler.IEL = "iel";
openfl_utils_AGALMiniAssembler.ELS = "els";
openfl_utils_AGALMiniAssembler.EIF = "eif";
openfl_utils_AGALMiniAssembler.TED = "ted";
openfl_utils_AGALMiniAssembler.KIL = "kil";
openfl_utils_AGALMiniAssembler.TEX = "tex";
openfl_utils_AGALMiniAssembler.SGE = "sge";
openfl_utils_AGALMiniAssembler.SLT = "slt";
openfl_utils_AGALMiniAssembler.SGN = "sgn";
openfl_utils_AGALMiniAssembler.SEQ = "seq";
openfl_utils_AGALMiniAssembler.SNE = "sne";
openfl_utils_AGALMiniAssembler.VA = "va";
openfl_utils_AGALMiniAssembler.VC = "vc";
openfl_utils_AGALMiniAssembler.VT = "vt";
openfl_utils_AGALMiniAssembler.VO = "vo";
openfl_utils_AGALMiniAssembler.VI = "vi";
openfl_utils_AGALMiniAssembler.FC = "fc";
openfl_utils_AGALMiniAssembler.FT = "ft";
openfl_utils_AGALMiniAssembler.FS = "fs";
openfl_utils_AGALMiniAssembler.FO = "fo";
openfl_utils_AGALMiniAssembler.FD = "fd";
openfl_utils_AGALMiniAssembler.IID = "iid";
openfl_utils_AGALMiniAssembler.D2 = "2d";
openfl_utils_AGALMiniAssembler.D3 = "3d";
openfl_utils_AGALMiniAssembler.CUBE = "cube";
openfl_utils_AGALMiniAssembler.MIPNEAREST = "mipnearest";
openfl_utils_AGALMiniAssembler.MIPLINEAR = "miplinear";
openfl_utils_AGALMiniAssembler.MIPNONE = "mipnone";
openfl_utils_AGALMiniAssembler.NOMIP = "nomip";
openfl_utils_AGALMiniAssembler.NEAREST = "nearest";
openfl_utils_AGALMiniAssembler.LINEAR = "linear";
openfl_utils_AGALMiniAssembler.ANISOTROPIC2X = "anisotropic2x";
openfl_utils_AGALMiniAssembler.ANISOTROPIC4X = "anisotropic4x";
openfl_utils_AGALMiniAssembler.ANISOTROPIC8X = "anisotropic8x";
openfl_utils_AGALMiniAssembler.ANISOTROPIC16X = "anisotropic16x";
openfl_utils_AGALMiniAssembler.CENTROID = "centroid";
openfl_utils_AGALMiniAssembler.SINGLE = "single";
openfl_utils_AGALMiniAssembler.IGNORESAMPLER = "ignoresampler";
openfl_utils_AGALMiniAssembler.REPEAT = "repeat";
openfl_utils_AGALMiniAssembler.WRAP = "wrap";
openfl_utils_AGALMiniAssembler.CLAMP = "clamp";
openfl_utils_AGALMiniAssembler.REPEAT_U_CLAMP_V = "repeat_u_clamp_v";
openfl_utils_AGALMiniAssembler.CLAMP_U_REPEAT_V = "clamp_u_repeat_v";
openfl_utils_AGALMiniAssembler.RGBA = "rgba";
openfl_utils_AGALMiniAssembler.COMPRESSED = "compressed";
openfl_utils_AGALMiniAssembler.COMPRESSEDALPHA = "compressedalpha";
openfl_utils_AGALMiniAssembler.DXT1 = "dxt1";
openfl_utils_AGALMiniAssembler.DXT5 = "dxt5";
openfl_utils_AGALMiniAssembler.VIDEO = "video";
openfl_utils_AGALMiniAssembler.initialized = false;
openfl_utils__$AGALMiniAssembler_OpCode.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}};
openfl_utils__$AGALMiniAssembler_Register.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}};
openfl_utils__$AGALMiniAssembler_Sampler.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}};
openfl_utils_Assets.cache = new openfl_utils_AssetCache();
openfl_utils_Assets.dispatcher = new openfl_events_EventDispatcher();
openfl_utils_Assets.libraryBindings = new haxe_ds_StringMap();
openfl_utils_ByteArray.__bytePointer = new lime_utils_BytePointerData(null,0);
openfl_utils_ByteArrayData.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}};
openfl_utils_ByteArrayData.defaultObjectEncoding = 10;
openfl_utils_CompressionAlgorithm.DEFLATE = 0;
openfl_utils_CompressionAlgorithm.LZMA = 1;
openfl_utils_CompressionAlgorithm.ZLIB = 2;
openfl_utils__$Dictionary_ClassMap.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}};
openfl_utils__$Dictionary_FloatMap.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}};
openfl_utils__$Dictionary_UtilsObjectMap.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}};
openfl_utils_Endian.BIG_ENDIAN = 0;
openfl_utils_Endian.LITTLE_ENDIAN = 1;
openfl_utils_Object.__meta__ = { statics : { iterator : { SuppressWarnings : ["checkstyle:FieldDocComment"]}, __get : { SuppressWarnings : ["checkstyle:FieldDocComment"]}, __set : { SuppressWarnings : ["checkstyle:FieldDocComment"]}, __getArray : { SuppressWarnings : ["checkstyle:FieldDocComment"]}, __setArray : { SuppressWarnings : ["checkstyle:FieldDocComment"]}}};
haxe_lang_Iterator.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}};
haxe_lang_Iterable.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}};
openfl_utils__$internal_Lib.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}, statics : { notImplemented : { SuppressWarnings : ["checkstyle:NullableParameter"]}}};
openfl_utils__$internal_Lib.__sentWarnings = new haxe_ds_StringMap();
openfl_utils__$internal_TouchData.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}, fields : { touch : { SuppressWarnings : ["checkstyle:Dynamic"]}}};
openfl_utils__$internal_TouchData.__pool = new lime_utils_ObjectPool(function() {
	return new openfl_utils__$internal_TouchData();
},function(data) {
	data.reset();
});
openfl_utils__$internal_format_amf3_AMF3Array.__meta__ = { fields : { extra : { optional : null}}};
ApplicationMain.main();
})(typeof exports != "undefined" ? exports : typeof window != "undefined" ? window : typeof self != "undefined" ? self : this, typeof window != "undefined" ? window : typeof global != "undefined" ? global : typeof self != "undefined" ? self : this);

});
	if (typeof self !== "undefined" && self.constructor.name.includes("Worker")) {
		// No need for exports in a worker context, just initialize statics.
		$hx_script({}, $global);
	} else {
		$hx_exports.lime = $hx_exports.lime || {};
		$hx_exports.lime.$scripts = $hx_exports.lime.$scripts || {};
		$hx_exports.lime.$scripts["TilBuci"] = $hx_script;
		$hx_exports.lime.embed = function (projectName) {
			var exports = {};
			var script = $hx_exports.lime.$scripts[projectName];
			if (!script) throw Error("Cannot find project name \"" + projectName + "\"");
			script(exports, $global);
			for (var key in exports) $hx_exports[key] = $hx_exports[key] || exports[key];
			var lime = exports.lime || window.lime;
			if (lime && lime.embed && this !== lime.embed) lime.embed.apply(lime, arguments);
			return exports;
		};
	}

	if (typeof define === "function" && define.amd) {
		define([], function () { return $hx_exports.lime; });
		define.__amd = define.amd;
		define.amd = null;
	}
})

$lime_init(typeof exports !== "undefined" ? exports : typeof define === "function" && define.amd ? {} : typeof window !== "undefined" ? window : typeof self !== "undefined" ? self : this,
typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : this);


if(typeof self === "undefined" || !self.constructor.name.includes("Worker")) { /*! howler.js v2.2.4 | (c) 2013-2020, James Simpson of GoldFire Studios | MIT License | howlerjs.com */
!function(){"use strict";var e=function(){this.init()};e.prototype={init:function(){var e=this||n;return e._counter=1e3,e._html5AudioPool=[],e.html5PoolSize=10,e._codecs={},e._howls=[],e._muted=!1,e._volume=1,e._canPlayEvent="canplaythrough",e._navigator="undefined"!=typeof window&&window.navigator?window.navigator:null,e.masterGain=null,e.noAudio=!1,e.usingWebAudio=!0,e.autoSuspend=!0,e.ctx=null,e.autoUnlock=!0,e._setup(),e},volume:function(e){var o=this||n;if(e=parseFloat(e),o.ctx||_(),void 0!==e&&e>=0&&e<=1){if(o._volume=e,o._muted)return o;o.usingWebAudio&&o.masterGain.gain.setValueAtTime(e,n.ctx.currentTime);for(var t=0;t<o._howls.length;t++)if(!o._howls[t]._webAudio)for(var r=o._howls[t]._getSoundIds(),a=0;a<r.length;a++){var u=o._howls[t]._soundById(r[a]);u&&u._node&&(u._node.volume=u._volume*e)}return o}return o._volume},mute:function(e){var o=this||n;o.ctx||_(),o._muted=e,o.usingWebAudio&&o.masterGain.gain.setValueAtTime(e?0:o._volume,n.ctx.currentTime);for(var t=0;t<o._howls.length;t++)if(!o._howls[t]._webAudio)for(var r=o._howls[t]._getSoundIds(),a=0;a<r.length;a++){var u=o._howls[t]._soundById(r[a]);u&&u._node&&(u._node.muted=!!e||u._muted)}return o},stop:function(){for(var e=this||n,o=0;o<e._howls.length;o++)e._howls[o].stop();return e},unload:function(){for(var e=this||n,o=e._howls.length-1;o>=0;o--)e._howls[o].unload();return e.usingWebAudio&&e.ctx&&void 0!==e.ctx.close&&(e.ctx.close(),e.ctx=null,_()),e},codecs:function(e){return(this||n)._codecs[e.replace(/^x-/,"")]},_setup:function(){var e=this||n;if(e.state=e.ctx?e.ctx.state||"suspended":"suspended",e._autoSuspend(),!e.usingWebAudio)if("undefined"!=typeof Audio)try{var o=new Audio;void 0===o.oncanplaythrough&&(e._canPlayEvent="canplay")}catch(n){e.noAudio=!0}else e.noAudio=!0;try{var o=new Audio;o.muted&&(e.noAudio=!0)}catch(e){}return e.noAudio||e._setupCodecs(),e},_setupCodecs:function(){var e=this||n,o=null;try{o="undefined"!=typeof Audio?new Audio:null}catch(n){return e}if(!o||"function"!=typeof o.canPlayType)return e;var t=o.canPlayType("audio/mpeg;").replace(/^no$/,""),r=e._navigator?e._navigator.userAgent:"",a=r.match(/OPR\/(\d+)/g),u=a&&parseInt(a[0].split("/")[1],10)<33,d=-1!==r.indexOf("Safari")&&-1===r.indexOf("Chrome"),i=r.match(/Version\/(.*?) /),_=d&&i&&parseInt(i[1],10)<15;return e._codecs={mp3:!(u||!t&&!o.canPlayType("audio/mp3;").replace(/^no$/,"")),mpeg:!!t,opus:!!o.canPlayType('audio/ogg; codecs="opus"').replace(/^no$/,""),ogg:!!o.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),oga:!!o.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),wav:!!(o.canPlayType('audio/wav; codecs="1"')||o.canPlayType("audio/wav")).replace(/^no$/,""),aac:!!o.canPlayType("audio/aac;").replace(/^no$/,""),caf:!!o.canPlayType("audio/x-caf;").replace(/^no$/,""),m4a:!!(o.canPlayType("audio/x-m4a;")||o.canPlayType("audio/m4a;")||o.canPlayType("audio/aac;")).replace(/^no$/,""),m4b:!!(o.canPlayType("audio/x-m4b;")||o.canPlayType("audio/m4b;")||o.canPlayType("audio/aac;")).replace(/^no$/,""),mp4:!!(o.canPlayType("audio/x-mp4;")||o.canPlayType("audio/mp4;")||o.canPlayType("audio/aac;")).replace(/^no$/,""),weba:!(_||!o.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")),webm:!(_||!o.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")),dolby:!!o.canPlayType('audio/mp4; codecs="ec-3"').replace(/^no$/,""),flac:!!(o.canPlayType("audio/x-flac;")||o.canPlayType("audio/flac;")).replace(/^no$/,"")},e},_unlockAudio:function(){var e=this||n;if(!e._audioUnlocked&&e.ctx){e._audioUnlocked=!1,e.autoUnlock=!1,e._mobileUnloaded||44100===e.ctx.sampleRate||(e._mobileUnloaded=!0,e.unload()),e._scratchBuffer=e.ctx.createBuffer(1,1,22050);var o=function(n){for(;e._html5AudioPool.length<e.html5PoolSize;)try{var t=new Audio;t._unlocked=!0,e._releaseHtml5Audio(t)}catch(n){e.noAudio=!0;break}for(var r=0;r<e._howls.length;r++)if(!e._howls[r]._webAudio)for(var a=e._howls[r]._getSoundIds(),u=0;u<a.length;u++){var d=e._howls[r]._soundById(a[u]);d&&d._node&&!d._node._unlocked&&(d._node._unlocked=!0,d._node.load())}e._autoResume();var i=e.ctx.createBufferSource();i.buffer=e._scratchBuffer,i.connect(e.ctx.destination),void 0===i.start?i.noteOn(0):i.start(0),"function"==typeof e.ctx.resume&&e.ctx.resume(),i.onended=function(){i.disconnect(0),e._audioUnlocked=!0,document.removeEventListener("touchstart",o,!0),document.removeEventListener("touchend",o,!0),document.removeEventListener("click",o,!0),document.removeEventListener("keydown",o,!0);for(var n=0;n<e._howls.length;n++)e._howls[n]._emit("unlock")}};return document.addEventListener("touchstart",o,!0),document.addEventListener("touchend",o,!0),document.addEventListener("click",o,!0),document.addEventListener("keydown",o,!0),e}},_obtainHtml5Audio:function(){var e=this||n;if(e._html5AudioPool.length)return e._html5AudioPool.pop();var o=(new Audio).play();return o&&"undefined"!=typeof Promise&&(o instanceof Promise||"function"==typeof o.then)&&o.catch(function(){console.warn("HTML5 Audio pool exhausted, returning potentially locked audio object.")}),new Audio},_releaseHtml5Audio:function(e){var o=this||n;return e._unlocked&&o._html5AudioPool.push(e),o},_autoSuspend:function(){var e=this;if(e.autoSuspend&&e.ctx&&void 0!==e.ctx.suspend&&n.usingWebAudio){for(var o=0;o<e._howls.length;o++)if(e._howls[o]._webAudio)for(var t=0;t<e._howls[o]._sounds.length;t++)if(!e._howls[o]._sounds[t]._paused)return e;return e._suspendTimer&&clearTimeout(e._suspendTimer),e._suspendTimer=setTimeout(function(){if(e.autoSuspend){e._suspendTimer=null,e.state="suspending";var n=function(){e.state="suspended",e._resumeAfterSuspend&&(delete e._resumeAfterSuspend,e._autoResume())};e.ctx.suspend().then(n,n)}},3e4),e}},_autoResume:function(){var e=this;if(e.ctx&&void 0!==e.ctx.resume&&n.usingWebAudio)return"running"===e.state&&"interrupted"!==e.ctx.state&&e._suspendTimer?(clearTimeout(e._suspendTimer),e._suspendTimer=null):"suspended"===e.state||"running"===e.state&&"interrupted"===e.ctx.state?(e.ctx.resume().then(function(){e.state="running";for(var n=0;n<e._howls.length;n++)e._howls[n]._emit("resume")}),e._suspendTimer&&(clearTimeout(e._suspendTimer),e._suspendTimer=null)):"suspending"===e.state&&(e._resumeAfterSuspend=!0),e}};var n=new e,o=function(e){var n=this;if(!e.src||0===e.src.length)return void console.error("An array of source files must be passed with any new Howl.");n.init(e)};o.prototype={init:function(e){var o=this;return n.ctx||_(),o._autoplay=e.autoplay||!1,o._format="string"!=typeof e.format?e.format:[e.format],o._html5=e.html5||!1,o._muted=e.mute||!1,o._loop=e.loop||!1,o._pool=e.pool||5,o._preload="boolean"!=typeof e.preload&&"metadata"!==e.preload||e.preload,o._rate=e.rate||1,o._sprite=e.sprite||{},o._src="string"!=typeof e.src?e.src:[e.src],o._volume=void 0!==e.volume?e.volume:1,o._xhr={method:e.xhr&&e.xhr.method?e.xhr.method:"GET",headers:e.xhr&&e.xhr.headers?e.xhr.headers:null,withCredentials:!(!e.xhr||!e.xhr.withCredentials)&&e.xhr.withCredentials},o._duration=0,o._state="unloaded",o._sounds=[],o._endTimers={},o._queue=[],o._playLock=!1,o._onend=e.onend?[{fn:e.onend}]:[],o._onfade=e.onfade?[{fn:e.onfade}]:[],o._onload=e.onload?[{fn:e.onload}]:[],o._onloaderror=e.onloaderror?[{fn:e.onloaderror}]:[],o._onplayerror=e.onplayerror?[{fn:e.onplayerror}]:[],o._onpause=e.onpause?[{fn:e.onpause}]:[],o._onplay=e.onplay?[{fn:e.onplay}]:[],o._onstop=e.onstop?[{fn:e.onstop}]:[],o._onmute=e.onmute?[{fn:e.onmute}]:[],o._onvolume=e.onvolume?[{fn:e.onvolume}]:[],o._onrate=e.onrate?[{fn:e.onrate}]:[],o._onseek=e.onseek?[{fn:e.onseek}]:[],o._onunlock=e.onunlock?[{fn:e.onunlock}]:[],o._onresume=[],o._webAudio=n.usingWebAudio&&!o._html5,void 0!==n.ctx&&n.ctx&&n.autoUnlock&&n._unlockAudio(),n._howls.push(o),o._autoplay&&o._queue.push({event:"play",action:function(){o.play()}}),o._preload&&"none"!==o._preload&&o.load(),o},load:function(){var e=this,o=null;if(n.noAudio)return void e._emit("loaderror",null,"No audio support.");"string"==typeof e._src&&(e._src=[e._src]);for(var r=0;r<e._src.length;r++){var u,d;if(e._format&&e._format[r])u=e._format[r];else{if("string"!=typeof(d=e._src[r])){e._emit("loaderror",null,"Non-string found in selected audio sources - ignoring.");continue}u=/^data:audio\/([^;,]+);/i.exec(d),u||(u=/\.([^.]+)$/.exec(d.split("?",1)[0])),u&&(u=u[1].toLowerCase())}if(u||console.warn('No file extension was found. Consider using the "format" property or specify an extension.'),u&&n.codecs(u)){o=e._src[r];break}}return o?(e._src=o,e._state="loading","https:"===window.location.protocol&&"http:"===o.slice(0,5)&&(e._html5=!0,e._webAudio=!1),new t(e),e._webAudio&&a(e),e):void e._emit("loaderror",null,"No codec support for selected audio sources.")},play:function(e,o){var t=this,r=null;if("number"==typeof e)r=e,e=null;else{if("string"==typeof e&&"loaded"===t._state&&!t._sprite[e])return null;if(void 0===e&&(e="__default",!t._playLock)){for(var a=0,u=0;u<t._sounds.length;u++)t._sounds[u]._paused&&!t._sounds[u]._ended&&(a++,r=t._sounds[u]._id);1===a?e=null:r=null}}var d=r?t._soundById(r):t._inactiveSound();if(!d)return null;if(r&&!e&&(e=d._sprite||"__default"),"loaded"!==t._state){d._sprite=e,d._ended=!1;var i=d._id;return t._queue.push({event:"play",action:function(){t.play(i)}}),i}if(r&&!d._paused)return o||t._loadQueue("play"),d._id;t._webAudio&&n._autoResume();var _=Math.max(0,d._seek>0?d._seek:t._sprite[e][0]/1e3),s=Math.max(0,(t._sprite[e][0]+t._sprite[e][1])/1e3-_),l=1e3*s/Math.abs(d._rate),c=t._sprite[e][0]/1e3,f=(t._sprite[e][0]+t._sprite[e][1])/1e3;d._sprite=e,d._ended=!1;var p=function(){d._paused=!1,d._seek=_,d._start=c,d._stop=f,d._loop=!(!d._loop&&!t._sprite[e][2])};if(_>=f)return void t._ended(d);var m=d._node;if(t._webAudio){var v=function(){t._playLock=!1,p(),t._refreshBuffer(d);var e=d._muted||t._muted?0:d._volume;m.gain.setValueAtTime(e,n.ctx.currentTime),d._playStart=n.ctx.currentTime,void 0===m.bufferSource.start?d._loop?m.bufferSource.noteGrainOn(0,_,86400):m.bufferSource.noteGrainOn(0,_,s):d._loop?m.bufferSource.start(0,_,86400):m.bufferSource.start(0,_,s),l!==1/0&&(t._endTimers[d._id]=setTimeout(t._ended.bind(t,d),l)),o||setTimeout(function(){t._emit("play",d._id),t._loadQueue()},0)};"running"===n.state&&"interrupted"!==n.ctx.state?v():(t._playLock=!0,t.once("resume",v),t._clearTimer(d._id))}else{var h=function(){m.currentTime=_,m.muted=d._muted||t._muted||n._muted||m.muted,m.volume=d._volume*n.volume(),m.playbackRate=d._rate;try{var r=m.play();if(r&&"undefined"!=typeof Promise&&(r instanceof Promise||"function"==typeof r.then)?(t._playLock=!0,p(),r.then(function(){t._playLock=!1,m._unlocked=!0,o?t._loadQueue():t._emit("play",d._id)}).catch(function(){t._playLock=!1,t._emit("playerror",d._id,"Playback was unable to start. This is most commonly an issue on mobile devices and Chrome where playback was not within a user interaction."),d._ended=!0,d._paused=!0})):o||(t._playLock=!1,p(),t._emit("play",d._id)),m.playbackRate=d._rate,m.paused)return void t._emit("playerror",d._id,"Playback was unable to start. This is most commonly an issue on mobile devices and Chrome where playback was not within a user interaction.");"__default"!==e||d._loop?t._endTimers[d._id]=setTimeout(t._ended.bind(t,d),l):(t._endTimers[d._id]=function(){t._ended(d),m.removeEventListener("ended",t._endTimers[d._id],!1)},m.addEventListener("ended",t._endTimers[d._id],!1))}catch(e){t._emit("playerror",d._id,e)}};"data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA"===m.src&&(m.src=t._src,m.load());var y=window&&window.ejecta||!m.readyState&&n._navigator.isCocoonJS;if(m.readyState>=3||y)h();else{t._playLock=!0,t._state="loading";var g=function(){t._state="loaded",h(),m.removeEventListener(n._canPlayEvent,g,!1)};m.addEventListener(n._canPlayEvent,g,!1),t._clearTimer(d._id)}}return d._id},pause:function(e){var n=this;if("loaded"!==n._state||n._playLock)return n._queue.push({event:"pause",action:function(){n.pause(e)}}),n;for(var o=n._getSoundIds(e),t=0;t<o.length;t++){n._clearTimer(o[t]);var r=n._soundById(o[t]);if(r&&!r._paused&&(r._seek=n.seek(o[t]),r._rateSeek=0,r._paused=!0,n._stopFade(o[t]),r._node))if(n._webAudio){if(!r._node.bufferSource)continue;void 0===r._node.bufferSource.stop?r._node.bufferSource.noteOff(0):r._node.bufferSource.stop(0),n._cleanBuffer(r._node)}else isNaN(r._node.duration)&&r._node.duration!==1/0||r._node.pause();arguments[1]||n._emit("pause",r?r._id:null)}return n},stop:function(e,n){var o=this;if("loaded"!==o._state||o._playLock)return o._queue.push({event:"stop",action:function(){o.stop(e)}}),o;for(var t=o._getSoundIds(e),r=0;r<t.length;r++){o._clearTimer(t[r]);var a=o._soundById(t[r]);a&&(a._seek=a._start||0,a._rateSeek=0,a._paused=!0,a._ended=!0,o._stopFade(t[r]),a._node&&(o._webAudio?a._node.bufferSource&&(void 0===a._node.bufferSource.stop?a._node.bufferSource.noteOff(0):a._node.bufferSource.stop(0),o._cleanBuffer(a._node)):isNaN(a._node.duration)&&a._node.duration!==1/0||(a._node.currentTime=a._start||0,a._node.pause(),a._node.duration===1/0&&o._clearSound(a._node))),n||o._emit("stop",a._id))}return o},mute:function(e,o){var t=this;if("loaded"!==t._state||t._playLock)return t._queue.push({event:"mute",action:function(){t.mute(e,o)}}),t;if(void 0===o){if("boolean"!=typeof e)return t._muted;t._muted=e}for(var r=t._getSoundIds(o),a=0;a<r.length;a++){var u=t._soundById(r[a]);u&&(u._muted=e,u._interval&&t._stopFade(u._id),t._webAudio&&u._node?u._node.gain.setValueAtTime(e?0:u._volume,n.ctx.currentTime):u._node&&(u._node.muted=!!n._muted||e),t._emit("mute",u._id))}return t},volume:function(){var e,o,t=this,r=arguments;if(0===r.length)return t._volume;if(1===r.length||2===r.length&&void 0===r[1]){t._getSoundIds().indexOf(r[0])>=0?o=parseInt(r[0],10):e=parseFloat(r[0])}else r.length>=2&&(e=parseFloat(r[0]),o=parseInt(r[1],10));var a;if(!(void 0!==e&&e>=0&&e<=1))return a=o?t._soundById(o):t._sounds[0],a?a._volume:0;if("loaded"!==t._state||t._playLock)return t._queue.push({event:"volume",action:function(){t.volume.apply(t,r)}}),t;void 0===o&&(t._volume=e),o=t._getSoundIds(o);for(var u=0;u<o.length;u++)(a=t._soundById(o[u]))&&(a._volume=e,r[2]||t._stopFade(o[u]),t._webAudio&&a._node&&!a._muted?a._node.gain.setValueAtTime(e,n.ctx.currentTime):a._node&&!a._muted&&(a._node.volume=e*n.volume()),t._emit("volume",a._id));return t},fade:function(e,o,t,r){var a=this;if("loaded"!==a._state||a._playLock)return a._queue.push({event:"fade",action:function(){a.fade(e,o,t,r)}}),a;e=Math.min(Math.max(0,parseFloat(e)),1),o=Math.min(Math.max(0,parseFloat(o)),1),t=parseFloat(t),a.volume(e,r);for(var u=a._getSoundIds(r),d=0;d<u.length;d++){var i=a._soundById(u[d]);if(i){if(r||a._stopFade(u[d]),a._webAudio&&!i._muted){var _=n.ctx.currentTime,s=_+t/1e3;i._volume=e,i._node.gain.setValueAtTime(e,_),i._node.gain.linearRampToValueAtTime(o,s)}a._startFadeInterval(i,e,o,t,u[d],void 0===r)}}return a},_startFadeInterval:function(e,n,o,t,r,a){var u=this,d=n,i=o-n,_=Math.abs(i/.01),s=Math.max(4,_>0?t/_:t),l=Date.now();e._fadeTo=o,e._interval=setInterval(function(){var r=(Date.now()-l)/t;l=Date.now(),d+=i*r,d=Math.round(100*d)/100,d=i<0?Math.max(o,d):Math.min(o,d),u._webAudio?e._volume=d:u.volume(d,e._id,!0),a&&(u._volume=d),(o<n&&d<=o||o>n&&d>=o)&&(clearInterval(e._interval),e._interval=null,e._fadeTo=null,u.volume(o,e._id),u._emit("fade",e._id))},s)},_stopFade:function(e){var o=this,t=o._soundById(e);return t&&t._interval&&(o._webAudio&&t._node.gain.cancelScheduledValues(n.ctx.currentTime),clearInterval(t._interval),t._interval=null,o.volume(t._fadeTo,e),t._fadeTo=null,o._emit("fade",e)),o},loop:function(){var e,n,o,t=this,r=arguments;if(0===r.length)return t._loop;if(1===r.length){if("boolean"!=typeof r[0])return!!(o=t._soundById(parseInt(r[0],10)))&&o._loop;e=r[0],t._loop=e}else 2===r.length&&(e=r[0],n=parseInt(r[1],10));for(var a=t._getSoundIds(n),u=0;u<a.length;u++)(o=t._soundById(a[u]))&&(o._loop=e,t._webAudio&&o._node&&o._node.bufferSource&&(o._node.bufferSource.loop=e,e&&(o._node.bufferSource.loopStart=o._start||0,o._node.bufferSource.loopEnd=o._stop,t.playing(a[u])&&(t.pause(a[u],!0),t.play(a[u],!0)))));return t},rate:function(){var e,o,t=this,r=arguments;if(0===r.length)o=t._sounds[0]._id;else if(1===r.length){var a=t._getSoundIds(),u=a.indexOf(r[0]);u>=0?o=parseInt(r[0],10):e=parseFloat(r[0])}else 2===r.length&&(e=parseFloat(r[0]),o=parseInt(r[1],10));var d;if("number"!=typeof e)return d=t._soundById(o),d?d._rate:t._rate;if("loaded"!==t._state||t._playLock)return t._queue.push({event:"rate",action:function(){t.rate.apply(t,r)}}),t;void 0===o&&(t._rate=e),o=t._getSoundIds(o);for(var i=0;i<o.length;i++)if(d=t._soundById(o[i])){t.playing(o[i])&&(d._rateSeek=t.seek(o[i]),d._playStart=t._webAudio?n.ctx.currentTime:d._playStart),d._rate=e,t._webAudio&&d._node&&d._node.bufferSource?d._node.bufferSource.playbackRate.setValueAtTime(e,n.ctx.currentTime):d._node&&(d._node.playbackRate=e);var _=t.seek(o[i]),s=(t._sprite[d._sprite][0]+t._sprite[d._sprite][1])/1e3-_,l=1e3*s/Math.abs(d._rate);!t._endTimers[o[i]]&&d._paused||(t._clearTimer(o[i]),t._endTimers[o[i]]=setTimeout(t._ended.bind(t,d),l)),t._emit("rate",d._id)}return t},seek:function(){var e,o,t=this,r=arguments;if(0===r.length)t._sounds.length&&(o=t._sounds[0]._id);else if(1===r.length){var a=t._getSoundIds(),u=a.indexOf(r[0]);u>=0?o=parseInt(r[0],10):t._sounds.length&&(o=t._sounds[0]._id,e=parseFloat(r[0]))}else 2===r.length&&(e=parseFloat(r[0]),o=parseInt(r[1],10));if(void 0===o)return 0;if("number"==typeof e&&("loaded"!==t._state||t._playLock))return t._queue.push({event:"seek",action:function(){t.seek.apply(t,r)}}),t;var d=t._soundById(o);if(d){if(!("number"==typeof e&&e>=0)){if(t._webAudio){var i=t.playing(o)?n.ctx.currentTime-d._playStart:0,_=d._rateSeek?d._rateSeek-d._seek:0;return d._seek+(_+i*Math.abs(d._rate))}return d._node.currentTime}var s=t.playing(o);s&&t.pause(o,!0),d._seek=e,d._ended=!1,t._clearTimer(o),t._webAudio||!d._node||isNaN(d._node.duration)||(d._node.currentTime=e);var l=function(){s&&t.play(o,!0),t._emit("seek",o)};if(s&&!t._webAudio){var c=function(){t._playLock?setTimeout(c,0):l()};setTimeout(c,0)}else l()}return t},playing:function(e){var n=this;if("number"==typeof e){var o=n._soundById(e);return!!o&&!o._paused}for(var t=0;t<n._sounds.length;t++)if(!n._sounds[t]._paused)return!0;return!1},duration:function(e){var n=this,o=n._duration,t=n._soundById(e);return t&&(o=n._sprite[t._sprite][1]/1e3),o},state:function(){return this._state},unload:function(){for(var e=this,o=e._sounds,t=0;t<o.length;t++)o[t]._paused||e.stop(o[t]._id),e._webAudio||(e._clearSound(o[t]._node),o[t]._node.removeEventListener("error",o[t]._errorFn,!1),o[t]._node.removeEventListener(n._canPlayEvent,o[t]._loadFn,!1),o[t]._node.removeEventListener("ended",o[t]._endFn,!1),n._releaseHtml5Audio(o[t]._node)),delete o[t]._node,e._clearTimer(o[t]._id);var a=n._howls.indexOf(e);a>=0&&n._howls.splice(a,1);var u=!0;for(t=0;t<n._howls.length;t++)if(n._howls[t]._src===e._src||e._src.indexOf(n._howls[t]._src)>=0){u=!1;break}return r&&u&&delete r[e._src],n.noAudio=!1,e._state="unloaded",e._sounds=[],e=null,null},on:function(e,n,o,t){var r=this,a=r["_on"+e];return"function"==typeof n&&a.push(t?{id:o,fn:n,once:t}:{id:o,fn:n}),r},off:function(e,n,o){var t=this,r=t["_on"+e],a=0;if("number"==typeof n&&(o=n,n=null),n||o)for(a=0;a<r.length;a++){var u=o===r[a].id;if(n===r[a].fn&&u||!n&&u){r.splice(a,1);break}}else if(e)t["_on"+e]=[];else{var d=Object.keys(t);for(a=0;a<d.length;a++)0===d[a].indexOf("_on")&&Array.isArray(t[d[a]])&&(t[d[a]]=[])}return t},once:function(e,n,o){var t=this;return t.on(e,n,o,1),t},_emit:function(e,n,o){for(var t=this,r=t["_on"+e],a=r.length-1;a>=0;a--)r[a].id&&r[a].id!==n&&"load"!==e||(setTimeout(function(e){e.call(this,n,o)}.bind(t,r[a].fn),0),r[a].once&&t.off(e,r[a].fn,r[a].id));return t._loadQueue(e),t},_loadQueue:function(e){var n=this;if(n._queue.length>0){var o=n._queue[0];o.event===e&&(n._queue.shift(),n._loadQueue()),e||o.action()}return n},_ended:function(e){var o=this,t=e._sprite;if(!o._webAudio&&e._node&&!e._node.paused&&!e._node.ended&&e._node.currentTime<e._stop)return setTimeout(o._ended.bind(o,e),100),o;var r=!(!e._loop&&!o._sprite[t][2]);if(o._emit("end",e._id),!o._webAudio&&r&&o.stop(e._id,!0).play(e._id),o._webAudio&&r){o._emit("play",e._id),e._seek=e._start||0,e._rateSeek=0,e._playStart=n.ctx.currentTime;var a=1e3*(e._stop-e._start)/Math.abs(e._rate);o._endTimers[e._id]=setTimeout(o._ended.bind(o,e),a)}return o._webAudio&&!r&&(e._paused=!0,e._ended=!0,e._seek=e._start||0,e._rateSeek=0,o._clearTimer(e._id),o._cleanBuffer(e._node),n._autoSuspend()),o._webAudio||r||o.stop(e._id,!0),o},_clearTimer:function(e){var n=this;if(n._endTimers[e]){if("function"!=typeof n._endTimers[e])clearTimeout(n._endTimers[e]);else{var o=n._soundById(e);o&&o._node&&o._node.removeEventListener("ended",n._endTimers[e],!1)}delete n._endTimers[e]}return n},_soundById:function(e){for(var n=this,o=0;o<n._sounds.length;o++)if(e===n._sounds[o]._id)return n._sounds[o];return null},_inactiveSound:function(){var e=this;e._drain();for(var n=0;n<e._sounds.length;n++)if(e._sounds[n]._ended)return e._sounds[n].reset();return new t(e)},_drain:function(){var e=this,n=e._pool,o=0,t=0;if(!(e._sounds.length<n)){for(t=0;t<e._sounds.length;t++)e._sounds[t]._ended&&o++;for(t=e._sounds.length-1;t>=0;t--){if(o<=n)return;e._sounds[t]._ended&&(e._webAudio&&e._sounds[t]._node&&e._sounds[t]._node.disconnect(0),e._sounds.splice(t,1),o--)}}},_getSoundIds:function(e){var n=this;if(void 0===e){for(var o=[],t=0;t<n._sounds.length;t++)o.push(n._sounds[t]._id);return o}return[e]},_refreshBuffer:function(e){var o=this;return e._node.bufferSource=n.ctx.createBufferSource(),e._node.bufferSource.buffer=r[o._src],e._panner?e._node.bufferSource.connect(e._panner):e._node.bufferSource.connect(e._node),e._node.bufferSource.loop=e._loop,e._loop&&(e._node.bufferSource.loopStart=e._start||0,e._node.bufferSource.loopEnd=e._stop||0),e._node.bufferSource.playbackRate.setValueAtTime(e._rate,n.ctx.currentTime),o},_cleanBuffer:function(e){var o=this,t=n._navigator&&n._navigator.vendor.indexOf("Apple")>=0;if(!e.bufferSource)return o;if(n._scratchBuffer&&e.bufferSource&&(e.bufferSource.onended=null,e.bufferSource.disconnect(0),t))try{e.bufferSource.buffer=n._scratchBuffer}catch(e){}return e.bufferSource=null,o},_clearSound:function(e){/MSIE |Trident\//.test(n._navigator&&n._navigator.userAgent)||(e.src="data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA")}};var t=function(e){this._parent=e,this.init()};t.prototype={init:function(){var e=this,o=e._parent;return e._muted=o._muted,e._loop=o._loop,e._volume=o._volume,e._rate=o._rate,e._seek=0,e._paused=!0,e._ended=!0,e._sprite="__default",e._id=++n._counter,o._sounds.push(e),e.create(),e},create:function(){var e=this,o=e._parent,t=n._muted||e._muted||e._parent._muted?0:e._volume;return o._webAudio?(e._node=void 0===n.ctx.createGain?n.ctx.createGainNode():n.ctx.createGain(),e._node.gain.setValueAtTime(t,n.ctx.currentTime),e._node.paused=!0,e._node.connect(n.masterGain)):n.noAudio||(e._node=n._obtainHtml5Audio(),e._errorFn=e._errorListener.bind(e),e._node.addEventListener("error",e._errorFn,!1),e._loadFn=e._loadListener.bind(e),e._node.addEventListener(n._canPlayEvent,e._loadFn,!1),e._endFn=e._endListener.bind(e),e._node.addEventListener("ended",e._endFn,!1),e._node.src=o._src,e._node.preload=!0===o._preload?"auto":o._preload,e._node.volume=t*n.volume(),e._node.load()),e},reset:function(){var e=this,o=e._parent;return e._muted=o._muted,e._loop=o._loop,e._volume=o._volume,e._rate=o._rate,e._seek=0,e._rateSeek=0,e._paused=!0,e._ended=!0,e._sprite="__default",e._id=++n._counter,e},_errorListener:function(){var e=this;e._parent._emit("loaderror",e._id,e._node.error?e._node.error.code:0),e._node.removeEventListener("error",e._errorFn,!1)},_loadListener:function(){var e=this,o=e._parent;o._duration=Math.ceil(10*e._node.duration)/10,0===Object.keys(o._sprite).length&&(o._sprite={__default:[0,1e3*o._duration]}),"loaded"!==o._state&&(o._state="loaded",o._emit("load"),o._loadQueue()),e._node.removeEventListener(n._canPlayEvent,e._loadFn,!1)},_endListener:function(){var e=this,n=e._parent;n._duration===1/0&&(n._duration=Math.ceil(10*e._node.duration)/10,n._sprite.__default[1]===1/0&&(n._sprite.__default[1]=1e3*n._duration),n._ended(e)),e._node.removeEventListener("ended",e._endFn,!1)}};var r={},a=function(e){var n=e._src;if(r[n])return e._duration=r[n].duration,void i(e);if(/^data:[^;]+;base64,/.test(n)){for(var o=atob(n.split(",")[1]),t=new Uint8Array(o.length),a=0;a<o.length;++a)t[a]=o.charCodeAt(a);d(t.buffer,e)}else{var _=new XMLHttpRequest;_.open(e._xhr.method,n,!0),_.withCredentials=e._xhr.withCredentials,_.responseType="arraybuffer",e._xhr.headers&&Object.keys(e._xhr.headers).forEach(function(n){_.setRequestHeader(n,e._xhr.headers[n])}),_.onload=function(){var n=(_.status+"")[0];if("0"!==n&&"2"!==n&&"3"!==n)return void e._emit("loaderror",null,"Failed loading audio file with status: "+_.status+".");d(_.response,e)},_.onerror=function(){e._webAudio&&(e._html5=!0,e._webAudio=!1,e._sounds=[],delete r[n],e.load())},u(_)}},u=function(e){try{e.send()}catch(n){e.onerror()}},d=function(e,o){var t=function(){o._emit("loaderror",null,"Decoding audio data failed.")},a=function(e){e&&o._sounds.length>0?(r[o._src]=e,i(o,e)):t()};"undefined"!=typeof Promise&&1===n.ctx.decodeAudioData.length?n.ctx.decodeAudioData(e).then(a).catch(t):n.ctx.decodeAudioData(e,a,t)},i=function(e,n){n&&!e._duration&&(e._duration=n.duration),0===Object.keys(e._sprite).length&&(e._sprite={__default:[0,1e3*e._duration]}),"loaded"!==e._state&&(e._state="loaded",e._emit("load"),e._loadQueue())},_=function(){if(n.usingWebAudio){try{"undefined"!=typeof AudioContext?n.ctx=new AudioContext:"undefined"!=typeof webkitAudioContext?n.ctx=new webkitAudioContext:n.usingWebAudio=!1}catch(e){n.usingWebAudio=!1}n.ctx||(n.usingWebAudio=!1);var e=/iP(hone|od|ad)/.test(n._navigator&&n._navigator.platform),o=n._navigator&&n._navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/),t=o?parseInt(o[1],10):null;if(e&&t&&t<9){var r=/safari/.test(n._navigator&&n._navigator.userAgent.toLowerCase());n._navigator&&!r&&(n.usingWebAudio=!1)}n.usingWebAudio&&(n.masterGain=void 0===n.ctx.createGain?n.ctx.createGainNode():n.ctx.createGain(),n.masterGain.gain.setValueAtTime(n._muted?0:n._volume,n.ctx.currentTime),n.masterGain.connect(n.ctx.destination)),n._setup()}};"function"==typeof define&&define.amd&&define([],function(){return{Howler:n,Howl:o}}),"undefined"!=typeof exports&&(exports.Howler=n,exports.Howl=o),"undefined"!=typeof global?(global.HowlerGlobal=e,global.Howler=n,global.Howl=o,global.Sound=t):"undefined"!=typeof window&&(window.HowlerGlobal=e,window.Howler=n,window.Howl=o,window.Sound=t)}();
/*! Spatial Plugin */
!function(){"use strict";HowlerGlobal.prototype._pos=[0,0,0],HowlerGlobal.prototype._orientation=[0,0,-1,0,1,0],HowlerGlobal.prototype.stereo=function(e){var n=this;if(!n.ctx||!n.ctx.listener)return n;for(var t=n._howls.length-1;t>=0;t--)n._howls[t].stereo(e);return n},HowlerGlobal.prototype.pos=function(e,n,t){var r=this;return r.ctx&&r.ctx.listener?(n="number"!=typeof n?r._pos[1]:n,t="number"!=typeof t?r._pos[2]:t,"number"!=typeof e?r._pos:(r._pos=[e,n,t],void 0!==r.ctx.listener.positionX?(r.ctx.listener.positionX.setTargetAtTime(r._pos[0],Howler.ctx.currentTime,.1),r.ctx.listener.positionY.setTargetAtTime(r._pos[1],Howler.ctx.currentTime,.1),r.ctx.listener.positionZ.setTargetAtTime(r._pos[2],Howler.ctx.currentTime,.1)):r.ctx.listener.setPosition(r._pos[0],r._pos[1],r._pos[2]),r)):r},HowlerGlobal.prototype.orientation=function(e,n,t,r,o,i){var a=this;if(!a.ctx||!a.ctx.listener)return a;var p=a._orientation;return n="number"!=typeof n?p[1]:n,t="number"!=typeof t?p[2]:t,r="number"!=typeof r?p[3]:r,o="number"!=typeof o?p[4]:o,i="number"!=typeof i?p[5]:i,"number"!=typeof e?p:(a._orientation=[e,n,t,r,o,i],void 0!==a.ctx.listener.forwardX?(a.ctx.listener.forwardX.setTargetAtTime(e,Howler.ctx.currentTime,.1),a.ctx.listener.forwardY.setTargetAtTime(n,Howler.ctx.currentTime,.1),a.ctx.listener.forwardZ.setTargetAtTime(t,Howler.ctx.currentTime,.1),a.ctx.listener.upX.setTargetAtTime(r,Howler.ctx.currentTime,.1),a.ctx.listener.upY.setTargetAtTime(o,Howler.ctx.currentTime,.1),a.ctx.listener.upZ.setTargetAtTime(i,Howler.ctx.currentTime,.1)):a.ctx.listener.setOrientation(e,n,t,r,o,i),a)},Howl.prototype.init=function(e){return function(n){var t=this;return t._orientation=n.orientation||[1,0,0],t._stereo=n.stereo||null,t._pos=n.pos||null,t._pannerAttr={coneInnerAngle:void 0!==n.coneInnerAngle?n.coneInnerAngle:360,coneOuterAngle:void 0!==n.coneOuterAngle?n.coneOuterAngle:360,coneOuterGain:void 0!==n.coneOuterGain?n.coneOuterGain:0,distanceModel:void 0!==n.distanceModel?n.distanceModel:"inverse",maxDistance:void 0!==n.maxDistance?n.maxDistance:1e4,panningModel:void 0!==n.panningModel?n.panningModel:"HRTF",refDistance:void 0!==n.refDistance?n.refDistance:1,rolloffFactor:void 0!==n.rolloffFactor?n.rolloffFactor:1},t._onstereo=n.onstereo?[{fn:n.onstereo}]:[],t._onpos=n.onpos?[{fn:n.onpos}]:[],t._onorientation=n.onorientation?[{fn:n.onorientation}]:[],e.call(this,n)}}(Howl.prototype.init),Howl.prototype.stereo=function(n,t){var r=this;if(!r._webAudio)return r;if("loaded"!==r._state)return r._queue.push({event:"stereo",action:function(){r.stereo(n,t)}}),r;var o=void 0===Howler.ctx.createStereoPanner?"spatial":"stereo";if(void 0===t){if("number"!=typeof n)return r._stereo;r._stereo=n,r._pos=[n,0,0]}for(var i=r._getSoundIds(t),a=0;a<i.length;a++){var p=r._soundById(i[a]);if(p){if("number"!=typeof n)return p._stereo;p._stereo=n,p._pos=[n,0,0],p._node&&(p._pannerAttr.panningModel="equalpower",p._panner&&p._panner.pan||e(p,o),"spatial"===o?void 0!==p._panner.positionX?(p._panner.positionX.setValueAtTime(n,Howler.ctx.currentTime),p._panner.positionY.setValueAtTime(0,Howler.ctx.currentTime),p._panner.positionZ.setValueAtTime(0,Howler.ctx.currentTime)):p._panner.setPosition(n,0,0):p._panner.pan.setValueAtTime(n,Howler.ctx.currentTime)),r._emit("stereo",p._id)}}return r},Howl.prototype.pos=function(n,t,r,o){var i=this;if(!i._webAudio)return i;if("loaded"!==i._state)return i._queue.push({event:"pos",action:function(){i.pos(n,t,r,o)}}),i;if(t="number"!=typeof t?0:t,r="number"!=typeof r?-.5:r,void 0===o){if("number"!=typeof n)return i._pos;i._pos=[n,t,r]}for(var a=i._getSoundIds(o),p=0;p<a.length;p++){var s=i._soundById(a[p]);if(s){if("number"!=typeof n)return s._pos;s._pos=[n,t,r],s._node&&(s._panner&&!s._panner.pan||e(s,"spatial"),void 0!==s._panner.positionX?(s._panner.positionX.setValueAtTime(n,Howler.ctx.currentTime),s._panner.positionY.setValueAtTime(t,Howler.ctx.currentTime),s._panner.positionZ.setValueAtTime(r,Howler.ctx.currentTime)):s._panner.setPosition(n,t,r)),i._emit("pos",s._id)}}return i},Howl.prototype.orientation=function(n,t,r,o){var i=this;if(!i._webAudio)return i;if("loaded"!==i._state)return i._queue.push({event:"orientation",action:function(){i.orientation(n,t,r,o)}}),i;if(t="number"!=typeof t?i._orientation[1]:t,r="number"!=typeof r?i._orientation[2]:r,void 0===o){if("number"!=typeof n)return i._orientation;i._orientation=[n,t,r]}for(var a=i._getSoundIds(o),p=0;p<a.length;p++){var s=i._soundById(a[p]);if(s){if("number"!=typeof n)return s._orientation;s._orientation=[n,t,r],s._node&&(s._panner||(s._pos||(s._pos=i._pos||[0,0,-.5]),e(s,"spatial")),void 0!==s._panner.orientationX?(s._panner.orientationX.setValueAtTime(n,Howler.ctx.currentTime),s._panner.orientationY.setValueAtTime(t,Howler.ctx.currentTime),s._panner.orientationZ.setValueAtTime(r,Howler.ctx.currentTime)):s._panner.setOrientation(n,t,r)),i._emit("orientation",s._id)}}return i},Howl.prototype.pannerAttr=function(){var n,t,r,o=this,i=arguments;if(!o._webAudio)return o;if(0===i.length)return o._pannerAttr;if(1===i.length){if("object"!=typeof i[0])return r=o._soundById(parseInt(i[0],10)),r?r._pannerAttr:o._pannerAttr;n=i[0],void 0===t&&(n.pannerAttr||(n.pannerAttr={coneInnerAngle:n.coneInnerAngle,coneOuterAngle:n.coneOuterAngle,coneOuterGain:n.coneOuterGain,distanceModel:n.distanceModel,maxDistance:n.maxDistance,refDistance:n.refDistance,rolloffFactor:n.rolloffFactor,panningModel:n.panningModel}),o._pannerAttr={coneInnerAngle:void 0!==n.pannerAttr.coneInnerAngle?n.pannerAttr.coneInnerAngle:o._coneInnerAngle,coneOuterAngle:void 0!==n.pannerAttr.coneOuterAngle?n.pannerAttr.coneOuterAngle:o._coneOuterAngle,coneOuterGain:void 0!==n.pannerAttr.coneOuterGain?n.pannerAttr.coneOuterGain:o._coneOuterGain,distanceModel:void 0!==n.pannerAttr.distanceModel?n.pannerAttr.distanceModel:o._distanceModel,maxDistance:void 0!==n.pannerAttr.maxDistance?n.pannerAttr.maxDistance:o._maxDistance,refDistance:void 0!==n.pannerAttr.refDistance?n.pannerAttr.refDistance:o._refDistance,rolloffFactor:void 0!==n.pannerAttr.rolloffFactor?n.pannerAttr.rolloffFactor:o._rolloffFactor,panningModel:void 0!==n.pannerAttr.panningModel?n.pannerAttr.panningModel:o._panningModel})}else 2===i.length&&(n=i[0],t=parseInt(i[1],10));for(var a=o._getSoundIds(t),p=0;p<a.length;p++)if(r=o._soundById(a[p])){var s=r._pannerAttr;s={coneInnerAngle:void 0!==n.coneInnerAngle?n.coneInnerAngle:s.coneInnerAngle,coneOuterAngle:void 0!==n.coneOuterAngle?n.coneOuterAngle:s.coneOuterAngle,coneOuterGain:void 0!==n.coneOuterGain?n.coneOuterGain:s.coneOuterGain,distanceModel:void 0!==n.distanceModel?n.distanceModel:s.distanceModel,maxDistance:void 0!==n.maxDistance?n.maxDistance:s.maxDistance,refDistance:void 0!==n.refDistance?n.refDistance:s.refDistance,rolloffFactor:void 0!==n.rolloffFactor?n.rolloffFactor:s.rolloffFactor,panningModel:void 0!==n.panningModel?n.panningModel:s.panningModel};var c=r._panner;c||(r._pos||(r._pos=o._pos||[0,0,-.5]),e(r,"spatial"),c=r._panner),c.coneInnerAngle=s.coneInnerAngle,c.coneOuterAngle=s.coneOuterAngle,c.coneOuterGain=s.coneOuterGain,c.distanceModel=s.distanceModel,c.maxDistance=s.maxDistance,c.refDistance=s.refDistance,c.rolloffFactor=s.rolloffFactor,c.panningModel=s.panningModel}return o},Sound.prototype.init=function(e){return function(){var n=this,t=n._parent;n._orientation=t._orientation,n._stereo=t._stereo,n._pos=t._pos,n._pannerAttr=t._pannerAttr,e.call(this),n._stereo?t.stereo(n._stereo):n._pos&&t.pos(n._pos[0],n._pos[1],n._pos[2],n._id)}}(Sound.prototype.init),Sound.prototype.reset=function(e){return function(){var n=this,t=n._parent;return n._orientation=t._orientation,n._stereo=t._stereo,n._pos=t._pos,n._pannerAttr=t._pannerAttr,n._stereo?t.stereo(n._stereo):n._pos?t.pos(n._pos[0],n._pos[1],n._pos[2],n._id):n._panner&&(n._panner.disconnect(0),n._panner=void 0,t._refreshBuffer(n)),e.call(this)}}(Sound.prototype.reset);var e=function(e,n){n=n||"spatial","spatial"===n?(e._panner=Howler.ctx.createPanner(),e._panner.coneInnerAngle=e._pannerAttr.coneInnerAngle,e._panner.coneOuterAngle=e._pannerAttr.coneOuterAngle,e._panner.coneOuterGain=e._pannerAttr.coneOuterGain,e._panner.distanceModel=e._pannerAttr.distanceModel,e._panner.maxDistance=e._pannerAttr.maxDistance,e._panner.refDistance=e._pannerAttr.refDistance,e._panner.rolloffFactor=e._pannerAttr.rolloffFactor,e._panner.panningModel=e._pannerAttr.panningModel,void 0!==e._panner.positionX?(e._panner.positionX.setValueAtTime(e._pos[0],Howler.ctx.currentTime),e._panner.positionY.setValueAtTime(e._pos[1],Howler.ctx.currentTime),e._panner.positionZ.setValueAtTime(e._pos[2],Howler.ctx.currentTime)):e._panner.setPosition(e._pos[0],e._pos[1],e._pos[2]),void 0!==e._panner.orientationX?(e._panner.orientationX.setValueAtTime(e._orientation[0],Howler.ctx.currentTime),e._panner.orientationY.setValueAtTime(e._orientation[1],Howler.ctx.currentTime),e._panner.orientationZ.setValueAtTime(e._orientation[2],Howler.ctx.currentTime)):e._panner.setOrientation(e._orientation[0],e._orientation[1],e._orientation[2])):(e._panner=Howler.ctx.createStereoPanner(),e._panner.pan.setValueAtTime(e._stereo,Howler.ctx.currentTime)),e._panner.connect(e._node),e._paused||e._parent.pause(e._id,!0).play(e._id,!0)}}();
 }
/* pako 1.0.2 nodeca/pako */
!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,e.pako=t()}}(function(){return function t(e,a,i){function n(s,o){if(!a[s]){if(!e[s]){var l="function"==typeof require&&require;if(!o&&l)return l(s,!0);if(r)return r(s,!0);var h=new Error("Cannot find module '"+s+"'");throw h.code="MODULE_NOT_FOUND",h}var d=a[s]={exports:{}};e[s][0].call(d.exports,function(t){var a=e[s][1][t];return n(a?a:t)},d,d.exports,t,e,a,i)}return a[s].exports}for(var r="function"==typeof require&&require,s=0;s<i.length;s++)n(i[s]);return n}({1:[function(t,e,a){"use strict";function i(t){if(!(this instanceof i))return new i(t);this.options=l.assign({level:w,method:v,chunkSize:16384,windowBits:15,memLevel:8,strategy:p,to:""},t||{});var e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new f,this.strm.avail_out=0;var a=o.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(a!==b)throw new Error(d[a]);if(e.header&&o.deflateSetHeader(this.strm,e.header),e.dictionary){var n;if(n="string"==typeof e.dictionary?h.string2buf(e.dictionary):"[object ArrayBuffer]"===_.call(e.dictionary)?new Uint8Array(e.dictionary):e.dictionary,a=o.deflateSetDictionary(this.strm,n),a!==b)throw new Error(d[a]);this._dict_set=!0}}function n(t,e){var a=new i(e);if(a.push(t,!0),a.err)throw a.msg;return a.result}function r(t,e){return e=e||{},e.raw=!0,n(t,e)}function s(t,e){return e=e||{},e.gzip=!0,n(t,e)}var o=t("./zlib/deflate"),l=t("./utils/common"),h=t("./utils/strings"),d=t("./zlib/messages"),f=t("./zlib/zstream"),_=Object.prototype.toString,u=0,c=4,b=0,g=1,m=2,w=-1,p=0,v=8;i.prototype.push=function(t,e){var a,i,n=this.strm,r=this.options.chunkSize;if(this.ended)return!1;i=e===~~e?e:e===!0?c:u,"string"==typeof t?n.input=h.string2buf(t):"[object ArrayBuffer]"===_.call(t)?n.input=new Uint8Array(t):n.input=t,n.next_in=0,n.avail_in=n.input.length;do{if(0===n.avail_out&&(n.output=new l.Buf8(r),n.next_out=0,n.avail_out=r),a=o.deflate(n,i),a!==g&&a!==b)return this.onEnd(a),this.ended=!0,!1;0!==n.avail_out&&(0!==n.avail_in||i!==c&&i!==m)||("string"===this.options.to?this.onData(h.buf2binstring(l.shrinkBuf(n.output,n.next_out))):this.onData(l.shrinkBuf(n.output,n.next_out)))}while((n.avail_in>0||0===n.avail_out)&&a!==g);return i===c?(a=o.deflateEnd(this.strm),this.onEnd(a),this.ended=!0,a===b):i!==m||(this.onEnd(b),n.avail_out=0,!0)},i.prototype.onData=function(t){this.chunks.push(t)},i.prototype.onEnd=function(t){t===b&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=l.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},a.Deflate=i,a.deflate=n,a.deflateRaw=r,a.gzip=s},{"./utils/common":3,"./utils/strings":4,"./zlib/deflate":8,"./zlib/messages":13,"./zlib/zstream":15}],2:[function(t,e,a){"use strict";function i(t){if(!(this instanceof i))return new i(t);this.options=o.assign({chunkSize:16384,windowBits:0,to:""},t||{});var e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,0===e.windowBits&&(e.windowBits=-15)),!(e.windowBits>=0&&e.windowBits<16)||t&&t.windowBits||(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&0===(15&e.windowBits)&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new f,this.strm.avail_out=0;var a=s.inflateInit2(this.strm,e.windowBits);if(a!==h.Z_OK)throw new Error(d[a]);this.header=new _,s.inflateGetHeader(this.strm,this.header)}function n(t,e){var a=new i(e);if(a.push(t,!0),a.err)throw a.msg;return a.result}function r(t,e){return e=e||{},e.raw=!0,n(t,e)}var s=t("./zlib/inflate"),o=t("./utils/common"),l=t("./utils/strings"),h=t("./zlib/constants"),d=t("./zlib/messages"),f=t("./zlib/zstream"),_=t("./zlib/gzheader"),u=Object.prototype.toString;i.prototype.push=function(t,e){var a,i,n,r,d,f,_=this.strm,c=this.options.chunkSize,b=this.options.dictionary,g=!1;if(this.ended)return!1;i=e===~~e?e:e===!0?h.Z_FINISH:h.Z_NO_FLUSH,"string"==typeof t?_.input=l.binstring2buf(t):"[object ArrayBuffer]"===u.call(t)?_.input=new Uint8Array(t):_.input=t,_.next_in=0,_.avail_in=_.input.length;do{if(0===_.avail_out&&(_.output=new o.Buf8(c),_.next_out=0,_.avail_out=c),a=s.inflate(_,h.Z_NO_FLUSH),a===h.Z_NEED_DICT&&b&&(f="string"==typeof b?l.string2buf(b):"[object ArrayBuffer]"===u.call(b)?new Uint8Array(b):b,a=s.inflateSetDictionary(this.strm,f)),a===h.Z_BUF_ERROR&&g===!0&&(a=h.Z_OK,g=!1),a!==h.Z_STREAM_END&&a!==h.Z_OK)return this.onEnd(a),this.ended=!0,!1;_.next_out&&(0!==_.avail_out&&a!==h.Z_STREAM_END&&(0!==_.avail_in||i!==h.Z_FINISH&&i!==h.Z_SYNC_FLUSH)||("string"===this.options.to?(n=l.utf8border(_.output,_.next_out),r=_.next_out-n,d=l.buf2string(_.output,n),_.next_out=r,_.avail_out=c-r,r&&o.arraySet(_.output,_.output,n,r,0),this.onData(d)):this.onData(o.shrinkBuf(_.output,_.next_out)))),0===_.avail_in&&0===_.avail_out&&(g=!0)}while((_.avail_in>0||0===_.avail_out)&&a!==h.Z_STREAM_END);return a===h.Z_STREAM_END&&(i=h.Z_FINISH),i===h.Z_FINISH?(a=s.inflateEnd(this.strm),this.onEnd(a),this.ended=!0,a===h.Z_OK):i!==h.Z_SYNC_FLUSH||(this.onEnd(h.Z_OK),_.avail_out=0,!0)},i.prototype.onData=function(t){this.chunks.push(t)},i.prototype.onEnd=function(t){t===h.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=o.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},a.Inflate=i,a.inflate=n,a.inflateRaw=r,a.ungzip=n},{"./utils/common":3,"./utils/strings":4,"./zlib/constants":6,"./zlib/gzheader":9,"./zlib/inflate":11,"./zlib/messages":13,"./zlib/zstream":15}],3:[function(t,e,a){"use strict";var i="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;a.assign=function(t){for(var e=Array.prototype.slice.call(arguments,1);e.length;){var a=e.shift();if(a){if("object"!=typeof a)throw new TypeError(a+"must be non-object");for(var i in a)a.hasOwnProperty(i)&&(t[i]=a[i])}}return t},a.shrinkBuf=function(t,e){return t.length===e?t:t.subarray?t.subarray(0,e):(t.length=e,t)};var n={arraySet:function(t,e,a,i,n){if(e.subarray&&t.subarray)return void t.set(e.subarray(a,a+i),n);for(var r=0;r<i;r++)t[n+r]=e[a+r]},flattenChunks:function(t){var e,a,i,n,r,s;for(i=0,e=0,a=t.length;e<a;e++)i+=t[e].length;for(s=new Uint8Array(i),n=0,e=0,a=t.length;e<a;e++)r=t[e],s.set(r,n),n+=r.length;return s}},r={arraySet:function(t,e,a,i,n){for(var r=0;r<i;r++)t[n+r]=e[a+r]},flattenChunks:function(t){return[].concat.apply([],t)}};a.setTyped=function(t){t?(a.Buf8=Uint8Array,a.Buf16=Uint16Array,a.Buf32=Int32Array,a.assign(a,n)):(a.Buf8=Array,a.Buf16=Array,a.Buf32=Array,a.assign(a,r))},a.setTyped(i)},{}],4:[function(t,e,a){"use strict";function i(t,e){if(e<65537&&(t.subarray&&s||!t.subarray&&r))return String.fromCharCode.apply(null,n.shrinkBuf(t,e));for(var a="",i=0;i<e;i++)a+=String.fromCharCode(t[i]);return a}var n=t("./common"),r=!0,s=!0;try{String.fromCharCode.apply(null,[0])}catch(t){r=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(t){s=!1}for(var o=new n.Buf8(256),l=0;l<256;l++)o[l]=l>=252?6:l>=248?5:l>=240?4:l>=224?3:l>=192?2:1;o[254]=o[254]=1,a.string2buf=function(t){var e,a,i,r,s,o=t.length,l=0;for(r=0;r<o;r++)a=t.charCodeAt(r),55296===(64512&a)&&r+1<o&&(i=t.charCodeAt(r+1),56320===(64512&i)&&(a=65536+(a-55296<<10)+(i-56320),r++)),l+=a<128?1:a<2048?2:a<65536?3:4;for(e=new n.Buf8(l),s=0,r=0;s<l;r++)a=t.charCodeAt(r),55296===(64512&a)&&r+1<o&&(i=t.charCodeAt(r+1),56320===(64512&i)&&(a=65536+(a-55296<<10)+(i-56320),r++)),a<128?e[s++]=a:a<2048?(e[s++]=192|a>>>6,e[s++]=128|63&a):a<65536?(e[s++]=224|a>>>12,e[s++]=128|a>>>6&63,e[s++]=128|63&a):(e[s++]=240|a>>>18,e[s++]=128|a>>>12&63,e[s++]=128|a>>>6&63,e[s++]=128|63&a);return e},a.buf2binstring=function(t){return i(t,t.length)},a.binstring2buf=function(t){for(var e=new n.Buf8(t.length),a=0,i=e.length;a<i;a++)e[a]=t.charCodeAt(a);return e},a.buf2string=function(t,e){var a,n,r,s,l=e||t.length,h=new Array(2*l);for(n=0,a=0;a<l;)if(r=t[a++],r<128)h[n++]=r;else if(s=o[r],s>4)h[n++]=65533,a+=s-1;else{for(r&=2===s?31:3===s?15:7;s>1&&a<l;)r=r<<6|63&t[a++],s--;s>1?h[n++]=65533:r<65536?h[n++]=r:(r-=65536,h[n++]=55296|r>>10&1023,h[n++]=56320|1023&r)}return i(h,n)},a.utf8border=function(t,e){var a;for(e=e||t.length,e>t.length&&(e=t.length),a=e-1;a>=0&&128===(192&t[a]);)a--;return a<0?e:0===a?e:a+o[t[a]]>e?a:e}},{"./common":3}],5:[function(t,e,a){"use strict";function i(t,e,a,i){for(var n=65535&t|0,r=t>>>16&65535|0,s=0;0!==a;){s=a>2e3?2e3:a,a-=s;do n=n+e[i++]|0,r=r+n|0;while(--s);n%=65521,r%=65521}return n|r<<16|0}e.exports=i},{}],6:[function(t,e,a){"use strict";e.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],7:[function(t,e,a){"use strict";function i(){for(var t,e=[],a=0;a<256;a++){t=a;for(var i=0;i<8;i++)t=1&t?3988292384^t>>>1:t>>>1;e[a]=t}return e}function n(t,e,a,i){var n=r,s=i+a;t^=-1;for(var o=i;o<s;o++)t=t>>>8^n[255&(t^e[o])];return t^-1}var r=i();e.exports=n},{}],8:[function(t,e,a){"use strict";function i(t,e){return t.msg=D[e],e}function n(t){return(t<<1)-(t>4?9:0)}function r(t){for(var e=t.length;--e>=0;)t[e]=0}function s(t){var e=t.state,a=e.pending;a>t.avail_out&&(a=t.avail_out),0!==a&&(R.arraySet(t.output,e.pending_buf,e.pending_out,a,t.next_out),t.next_out+=a,e.pending_out+=a,t.total_out+=a,t.avail_out-=a,e.pending-=a,0===e.pending&&(e.pending_out=0))}function o(t,e){C._tr_flush_block(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,s(t.strm)}function l(t,e){t.pending_buf[t.pending++]=e}function h(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e}function d(t,e,a,i){var n=t.avail_in;return n>i&&(n=i),0===n?0:(t.avail_in-=n,R.arraySet(e,t.input,t.next_in,n,a),1===t.state.wrap?t.adler=N(t.adler,e,n,a):2===t.state.wrap&&(t.adler=O(t.adler,e,n,a)),t.next_in+=n,t.total_in+=n,n)}function f(t,e){var a,i,n=t.max_chain_length,r=t.strstart,s=t.prev_length,o=t.nice_match,l=t.strstart>t.w_size-ft?t.strstart-(t.w_size-ft):0,h=t.window,d=t.w_mask,f=t.prev,_=t.strstart+dt,u=h[r+s-1],c=h[r+s];t.prev_length>=t.good_match&&(n>>=2),o>t.lookahead&&(o=t.lookahead);do if(a=e,h[a+s]===c&&h[a+s-1]===u&&h[a]===h[r]&&h[++a]===h[r+1]){r+=2,a++;do;while(h[++r]===h[++a]&&h[++r]===h[++a]&&h[++r]===h[++a]&&h[++r]===h[++a]&&h[++r]===h[++a]&&h[++r]===h[++a]&&h[++r]===h[++a]&&h[++r]===h[++a]&&r<_);if(i=dt-(_-r),r=_-dt,i>s){if(t.match_start=e,s=i,i>=o)break;u=h[r+s-1],c=h[r+s]}}while((e=f[e&d])>l&&0!==--n);return s<=t.lookahead?s:t.lookahead}function _(t){var e,a,i,n,r,s=t.w_size;do{if(n=t.window_size-t.lookahead-t.strstart,t.strstart>=s+(s-ft)){R.arraySet(t.window,t.window,s,s,0),t.match_start-=s,t.strstart-=s,t.block_start-=s,a=t.hash_size,e=a;do i=t.head[--e],t.head[e]=i>=s?i-s:0;while(--a);a=s,e=a;do i=t.prev[--e],t.prev[e]=i>=s?i-s:0;while(--a);n+=s}if(0===t.strm.avail_in)break;if(a=d(t.strm,t.window,t.strstart+t.lookahead,n),t.lookahead+=a,t.lookahead+t.insert>=ht)for(r=t.strstart-t.insert,t.ins_h=t.window[r],t.ins_h=(t.ins_h<<t.hash_shift^t.window[r+1])&t.hash_mask;t.insert&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[r+ht-1])&t.hash_mask,t.prev[r&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=r,r++,t.insert--,!(t.lookahead+t.insert<ht)););}while(t.lookahead<ft&&0!==t.strm.avail_in)}function u(t,e){var a=65535;for(a>t.pending_buf_size-5&&(a=t.pending_buf_size-5);;){if(t.lookahead<=1){if(_(t),0===t.lookahead&&e===I)return vt;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var i=t.block_start+a;if((0===t.strstart||t.strstart>=i)&&(t.lookahead=t.strstart-i,t.strstart=i,o(t,!1),0===t.strm.avail_out))return vt;if(t.strstart-t.block_start>=t.w_size-ft&&(o(t,!1),0===t.strm.avail_out))return vt}return t.insert=0,e===F?(o(t,!0),0===t.strm.avail_out?yt:xt):t.strstart>t.block_start&&(o(t,!1),0===t.strm.avail_out)?vt:vt}function c(t,e){for(var a,i;;){if(t.lookahead<ft){if(_(t),t.lookahead<ft&&e===I)return vt;if(0===t.lookahead)break}if(a=0,t.lookahead>=ht&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+ht-1])&t.hash_mask,a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==a&&t.strstart-a<=t.w_size-ft&&(t.match_length=f(t,a)),t.match_length>=ht)if(i=C._tr_tally(t,t.strstart-t.match_start,t.match_length-ht),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=ht){t.match_length--;do t.strstart++,t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+ht-1])&t.hash_mask,a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart;while(0!==--t.match_length);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+1])&t.hash_mask;else i=C._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(i&&(o(t,!1),0===t.strm.avail_out))return vt}return t.insert=t.strstart<ht-1?t.strstart:ht-1,e===F?(o(t,!0),0===t.strm.avail_out?yt:xt):t.last_lit&&(o(t,!1),0===t.strm.avail_out)?vt:kt}function b(t,e){for(var a,i,n;;){if(t.lookahead<ft){if(_(t),t.lookahead<ft&&e===I)return vt;if(0===t.lookahead)break}if(a=0,t.lookahead>=ht&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+ht-1])&t.hash_mask,a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=ht-1,0!==a&&t.prev_length<t.max_lazy_match&&t.strstart-a<=t.w_size-ft&&(t.match_length=f(t,a),t.match_length<=5&&(t.strategy===q||t.match_length===ht&&t.strstart-t.match_start>4096)&&(t.match_length=ht-1)),t.prev_length>=ht&&t.match_length<=t.prev_length){n=t.strstart+t.lookahead-ht,i=C._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-ht),t.lookahead-=t.prev_length-1,t.prev_length-=2;do++t.strstart<=n&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+ht-1])&t.hash_mask,a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart);while(0!==--t.prev_length);if(t.match_available=0,t.match_length=ht-1,t.strstart++,i&&(o(t,!1),0===t.strm.avail_out))return vt}else if(t.match_available){if(i=C._tr_tally(t,0,t.window[t.strstart-1]),i&&o(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return vt}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(i=C._tr_tally(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<ht-1?t.strstart:ht-1,e===F?(o(t,!0),0===t.strm.avail_out?yt:xt):t.last_lit&&(o(t,!1),0===t.strm.avail_out)?vt:kt}function g(t,e){for(var a,i,n,r,s=t.window;;){if(t.lookahead<=dt){if(_(t),t.lookahead<=dt&&e===I)return vt;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=ht&&t.strstart>0&&(n=t.strstart-1,i=s[n],i===s[++n]&&i===s[++n]&&i===s[++n])){r=t.strstart+dt;do;while(i===s[++n]&&i===s[++n]&&i===s[++n]&&i===s[++n]&&i===s[++n]&&i===s[++n]&&i===s[++n]&&i===s[++n]&&n<r);t.match_length=dt-(r-n),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=ht?(a=C._tr_tally(t,1,t.match_length-ht),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(a=C._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),a&&(o(t,!1),0===t.strm.avail_out))return vt}return t.insert=0,e===F?(o(t,!0),0===t.strm.avail_out?yt:xt):t.last_lit&&(o(t,!1),0===t.strm.avail_out)?vt:kt}function m(t,e){for(var a;;){if(0===t.lookahead&&(_(t),0===t.lookahead)){if(e===I)return vt;break}if(t.match_length=0,a=C._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,a&&(o(t,!1),0===t.strm.avail_out))return vt}return t.insert=0,e===F?(o(t,!0),0===t.strm.avail_out?yt:xt):t.last_lit&&(o(t,!1),0===t.strm.avail_out)?vt:kt}function w(t,e,a,i,n){this.good_length=t,this.max_lazy=e,this.nice_length=a,this.max_chain=i,this.func=n}function p(t){t.window_size=2*t.w_size,r(t.head),t.max_lazy_match=Z[t.level].max_lazy,t.good_match=Z[t.level].good_length,t.nice_match=Z[t.level].nice_length,t.max_chain_length=Z[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=ht-1,t.match_available=0,t.ins_h=0}function v(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=V,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new R.Buf16(2*ot),this.dyn_dtree=new R.Buf16(2*(2*rt+1)),this.bl_tree=new R.Buf16(2*(2*st+1)),r(this.dyn_ltree),r(this.dyn_dtree),r(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new R.Buf16(lt+1),this.heap=new R.Buf16(2*nt+1),r(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new R.Buf16(2*nt+1),r(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function k(t){var e;return t&&t.state?(t.total_in=t.total_out=0,t.data_type=Q,e=t.state,e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?ut:wt,t.adler=2===e.wrap?0:1,e.last_flush=I,C._tr_init(e),H):i(t,K)}function y(t){var e=k(t);return e===H&&p(t.state),e}function x(t,e){return t&&t.state?2!==t.state.wrap?K:(t.state.gzhead=e,H):K}function z(t,e,a,n,r,s){if(!t)return K;var o=1;if(e===Y&&(e=6),n<0?(o=0,n=-n):n>15&&(o=2,n-=16),r<1||r>$||a!==V||n<8||n>15||e<0||e>9||s<0||s>W)return i(t,K);8===n&&(n=9);var l=new v;return t.state=l,l.strm=t,l.wrap=o,l.gzhead=null,l.w_bits=n,l.w_size=1<<l.w_bits,l.w_mask=l.w_size-1,l.hash_bits=r+7,l.hash_size=1<<l.hash_bits,l.hash_mask=l.hash_size-1,l.hash_shift=~~((l.hash_bits+ht-1)/ht),l.window=new R.Buf8(2*l.w_size),l.head=new R.Buf16(l.hash_size),l.prev=new R.Buf16(l.w_size),l.lit_bufsize=1<<r+6,l.pending_buf_size=4*l.lit_bufsize,l.pending_buf=new R.Buf8(l.pending_buf_size),l.d_buf=1*l.lit_bufsize,l.l_buf=3*l.lit_bufsize,l.level=e,l.strategy=s,l.method=a,y(t)}function B(t,e){return z(t,e,V,tt,et,J)}function S(t,e){var a,o,d,f;if(!t||!t.state||e>L||e<0)return t?i(t,K):K;if(o=t.state,!t.output||!t.input&&0!==t.avail_in||o.status===pt&&e!==F)return i(t,0===t.avail_out?P:K);if(o.strm=t,a=o.last_flush,o.last_flush=e,o.status===ut)if(2===o.wrap)t.adler=0,l(o,31),l(o,139),l(o,8),o.gzhead?(l(o,(o.gzhead.text?1:0)+(o.gzhead.hcrc?2:0)+(o.gzhead.extra?4:0)+(o.gzhead.name?8:0)+(o.gzhead.comment?16:0)),l(o,255&o.gzhead.time),l(o,o.gzhead.time>>8&255),l(o,o.gzhead.time>>16&255),l(o,o.gzhead.time>>24&255),l(o,9===o.level?2:o.strategy>=G||o.level<2?4:0),l(o,255&o.gzhead.os),o.gzhead.extra&&o.gzhead.extra.length&&(l(o,255&o.gzhead.extra.length),l(o,o.gzhead.extra.length>>8&255)),o.gzhead.hcrc&&(t.adler=O(t.adler,o.pending_buf,o.pending,0)),o.gzindex=0,o.status=ct):(l(o,0),l(o,0),l(o,0),l(o,0),l(o,0),l(o,9===o.level?2:o.strategy>=G||o.level<2?4:0),l(o,zt),o.status=wt);else{var _=V+(o.w_bits-8<<4)<<8,u=-1;u=o.strategy>=G||o.level<2?0:o.level<6?1:6===o.level?2:3,_|=u<<6,0!==o.strstart&&(_|=_t),_+=31-_%31,o.status=wt,h(o,_),0!==o.strstart&&(h(o,t.adler>>>16),h(o,65535&t.adler)),t.adler=1}if(o.status===ct)if(o.gzhead.extra){for(d=o.pending;o.gzindex<(65535&o.gzhead.extra.length)&&(o.pending!==o.pending_buf_size||(o.gzhead.hcrc&&o.pending>d&&(t.adler=O(t.adler,o.pending_buf,o.pending-d,d)),s(t),d=o.pending,o.pending!==o.pending_buf_size));)l(o,255&o.gzhead.extra[o.gzindex]),o.gzindex++;o.gzhead.hcrc&&o.pending>d&&(t.adler=O(t.adler,o.pending_buf,o.pending-d,d)),o.gzindex===o.gzhead.extra.length&&(o.gzindex=0,o.status=bt)}else o.status=bt;if(o.status===bt)if(o.gzhead.name){d=o.pending;do{if(o.pending===o.pending_buf_size&&(o.gzhead.hcrc&&o.pending>d&&(t.adler=O(t.adler,o.pending_buf,o.pending-d,d)),s(t),d=o.pending,o.pending===o.pending_buf_size)){f=1;break}f=o.gzindex<o.gzhead.name.length?255&o.gzhead.name.charCodeAt(o.gzindex++):0,l(o,f)}while(0!==f);o.gzhead.hcrc&&o.pending>d&&(t.adler=O(t.adler,o.pending_buf,o.pending-d,d)),0===f&&(o.gzindex=0,o.status=gt)}else o.status=gt;if(o.status===gt)if(o.gzhead.comment){d=o.pending;do{if(o.pending===o.pending_buf_size&&(o.gzhead.hcrc&&o.pending>d&&(t.adler=O(t.adler,o.pending_buf,o.pending-d,d)),s(t),d=o.pending,o.pending===o.pending_buf_size)){f=1;break}f=o.gzindex<o.gzhead.comment.length?255&o.gzhead.comment.charCodeAt(o.gzindex++):0,l(o,f)}while(0!==f);o.gzhead.hcrc&&o.pending>d&&(t.adler=O(t.adler,o.pending_buf,o.pending-d,d)),0===f&&(o.status=mt)}else o.status=mt;if(o.status===mt&&(o.gzhead.hcrc?(o.pending+2>o.pending_buf_size&&s(t),o.pending+2<=o.pending_buf_size&&(l(o,255&t.adler),l(o,t.adler>>8&255),t.adler=0,o.status=wt)):o.status=wt),0!==o.pending){if(s(t),0===t.avail_out)return o.last_flush=-1,H}else if(0===t.avail_in&&n(e)<=n(a)&&e!==F)return i(t,P);if(o.status===pt&&0!==t.avail_in)return i(t,P);if(0!==t.avail_in||0!==o.lookahead||e!==I&&o.status!==pt){var c=o.strategy===G?m(o,e):o.strategy===X?g(o,e):Z[o.level].func(o,e);if(c!==yt&&c!==xt||(o.status=pt),c===vt||c===yt)return 0===t.avail_out&&(o.last_flush=-1),H;if(c===kt&&(e===U?C._tr_align(o):e!==L&&(C._tr_stored_block(o,0,0,!1),e===T&&(r(o.head),0===o.lookahead&&(o.strstart=0,o.block_start=0,o.insert=0))),s(t),0===t.avail_out))return o.last_flush=-1,H}return e!==F?H:o.wrap<=0?j:(2===o.wrap?(l(o,255&t.adler),l(o,t.adler>>8&255),l(o,t.adler>>16&255),l(o,t.adler>>24&255),l(o,255&t.total_in),l(o,t.total_in>>8&255),l(o,t.total_in>>16&255),l(o,t.total_in>>24&255)):(h(o,t.adler>>>16),h(o,65535&t.adler)),s(t),o.wrap>0&&(o.wrap=-o.wrap),0!==o.pending?H:j)}function E(t){var e;return t&&t.state?(e=t.state.status,e!==ut&&e!==ct&&e!==bt&&e!==gt&&e!==mt&&e!==wt&&e!==pt?i(t,K):(t.state=null,e===wt?i(t,M):H)):K}function A(t,e){var a,i,n,s,o,l,h,d,f=e.length;if(!t||!t.state)return K;if(a=t.state,s=a.wrap,2===s||1===s&&a.status!==ut||a.lookahead)return K;for(1===s&&(t.adler=N(t.adler,e,f,0)),a.wrap=0,f>=a.w_size&&(0===s&&(r(a.head),a.strstart=0,a.block_start=0,a.insert=0),d=new R.Buf8(a.w_size),R.arraySet(d,e,f-a.w_size,a.w_size,0),e=d,f=a.w_size),o=t.avail_in,l=t.next_in,h=t.input,t.avail_in=f,t.next_in=0,t.input=e,_(a);a.lookahead>=ht;){i=a.strstart,n=a.lookahead-(ht-1);do a.ins_h=(a.ins_h<<a.hash_shift^a.window[i+ht-1])&a.hash_mask,a.prev[i&a.w_mask]=a.head[a.ins_h],a.head[a.ins_h]=i,i++;while(--n);a.strstart=i,a.lookahead=ht-1,_(a)}return a.strstart+=a.lookahead,a.block_start=a.strstart,a.insert=a.lookahead,a.lookahead=0,a.match_length=a.prev_length=ht-1,a.match_available=0,t.next_in=l,t.input=h,t.avail_in=o,a.wrap=s,H}var Z,R=t("../utils/common"),C=t("./trees"),N=t("./adler32"),O=t("./crc32"),D=t("./messages"),I=0,U=1,T=3,F=4,L=5,H=0,j=1,K=-2,M=-3,P=-5,Y=-1,q=1,G=2,X=3,W=4,J=0,Q=2,V=8,$=9,tt=15,et=8,at=29,it=256,nt=it+1+at,rt=30,st=19,ot=2*nt+1,lt=15,ht=3,dt=258,ft=dt+ht+1,_t=32,ut=42,ct=69,bt=73,gt=91,mt=103,wt=113,pt=666,vt=1,kt=2,yt=3,xt=4,zt=3;Z=[new w(0,0,0,0,u),new w(4,4,8,4,c),new w(4,5,16,8,c),new w(4,6,32,32,c),new w(4,4,16,16,b),new w(8,16,32,32,b),new w(8,16,128,128,b),new w(8,32,128,256,b),new w(32,128,258,1024,b),new w(32,258,258,4096,b)],a.deflateInit=B,a.deflateInit2=z,a.deflateReset=y,a.deflateResetKeep=k,a.deflateSetHeader=x,a.deflate=S,a.deflateEnd=E,a.deflateSetDictionary=A,a.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":3,"./adler32":5,"./crc32":7,"./messages":13,"./trees":14}],9:[function(t,e,a){"use strict";function i(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}e.exports=i},{}],10:[function(t,e,a){"use strict";var i=30,n=12;e.exports=function(t,e){var a,r,s,o,l,h,d,f,_,u,c,b,g,m,w,p,v,k,y,x,z,B,S,E,A;a=t.state,r=t.next_in,E=t.input,s=r+(t.avail_in-5),o=t.next_out,A=t.output,l=o-(e-t.avail_out),h=o+(t.avail_out-257),d=a.dmax,f=a.wsize,_=a.whave,u=a.wnext,c=a.window,b=a.hold,g=a.bits,m=a.lencode,w=a.distcode,p=(1<<a.lenbits)-1,v=(1<<a.distbits)-1;t:do{g<15&&(b+=E[r++]<<g,g+=8,b+=E[r++]<<g,g+=8),k=m[b&p];e:for(;;){if(y=k>>>24,b>>>=y,g-=y,y=k>>>16&255,0===y)A[o++]=65535&k;else{if(!(16&y)){if(0===(64&y)){k=m[(65535&k)+(b&(1<<y)-1)];continue e}if(32&y){a.mode=n;break t}t.msg="invalid literal/length code",a.mode=i;break t}x=65535&k,y&=15,y&&(g<y&&(b+=E[r++]<<g,g+=8),x+=b&(1<<y)-1,b>>>=y,g-=y),g<15&&(b+=E[r++]<<g,g+=8,b+=E[r++]<<g,g+=8),k=w[b&v];a:for(;;){if(y=k>>>24,b>>>=y,g-=y,y=k>>>16&255,!(16&y)){if(0===(64&y)){k=w[(65535&k)+(b&(1<<y)-1)];continue a}t.msg="invalid distance code",a.mode=i;break t}if(z=65535&k,y&=15,g<y&&(b+=E[r++]<<g,g+=8,g<y&&(b+=E[r++]<<g,g+=8)),z+=b&(1<<y)-1,z>d){t.msg="invalid distance too far back",a.mode=i;break t}if(b>>>=y,g-=y,y=o-l,z>y){if(y=z-y,y>_&&a.sane){t.msg="invalid distance too far back",a.mode=i;break t}if(B=0,S=c,0===u){if(B+=f-y,y<x){x-=y;do A[o++]=c[B++];while(--y);B=o-z,S=A}}else if(u<y){if(B+=f+u-y,y-=u,y<x){x-=y;do A[o++]=c[B++];while(--y);if(B=0,u<x){y=u,x-=y;do A[o++]=c[B++];while(--y);B=o-z,S=A}}}else if(B+=u-y,y<x){x-=y;do A[o++]=c[B++];while(--y);B=o-z,S=A}for(;x>2;)A[o++]=S[B++],A[o++]=S[B++],A[o++]=S[B++],x-=3;x&&(A[o++]=S[B++],x>1&&(A[o++]=S[B++]))}else{B=o-z;do A[o++]=A[B++],A[o++]=A[B++],A[o++]=A[B++],x-=3;while(x>2);x&&(A[o++]=A[B++],x>1&&(A[o++]=A[B++]))}break}}break}}while(r<s&&o<h);x=g>>3,r-=x,g-=x<<3,b&=(1<<g)-1,t.next_in=r,t.next_out=o,t.avail_in=r<s?5+(s-r):5-(r-s),t.avail_out=o<h?257+(h-o):257-(o-h),a.hold=b,a.bits=g}},{}],11:[function(t,e,a){"use strict";function i(t){return(t>>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24)}function n(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new w.Buf16(320),this.work=new w.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function r(t){var e;return t&&t.state?(e=t.state,t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=T,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new w.Buf32(bt),e.distcode=e.distdyn=new w.Buf32(gt),e.sane=1,e.back=-1,Z):N}function s(t){var e;return t&&t.state?(e=t.state,e.wsize=0,e.whave=0,e.wnext=0,r(t)):N}function o(t,e){var a,i;return t&&t.state?(i=t.state,e<0?(a=0,e=-e):(a=(e>>4)+1,e<48&&(e&=15)),e&&(e<8||e>15)?N:(null!==i.window&&i.wbits!==e&&(i.window=null),i.wrap=a,i.wbits=e,s(t))):N}function l(t,e){var a,i;return t?(i=new n,t.state=i,i.window=null,a=o(t,e),a!==Z&&(t.state=null),a):N}function h(t){return l(t,wt)}function d(t){if(pt){var e;for(g=new w.Buf32(512),m=new w.Buf32(32),e=0;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(y(z,t.lens,0,288,g,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;y(B,t.lens,0,32,m,0,t.work,{bits:5}),pt=!1}t.lencode=g,t.lenbits=9,t.distcode=m,t.distbits=5}function f(t,e,a,i){var n,r=t.state;return null===r.window&&(r.wsize=1<<r.wbits,r.wnext=0,r.whave=0,r.window=new w.Buf8(r.wsize)),i>=r.wsize?(w.arraySet(r.window,e,a-r.wsize,r.wsize,0),r.wnext=0,r.whave=r.wsize):(n=r.wsize-r.wnext,n>i&&(n=i),w.arraySet(r.window,e,a-i,n,r.wnext),i-=n,i?(w.arraySet(r.window,e,a-i,i,0),r.wnext=i,r.whave=r.wsize):(r.wnext+=n,r.wnext===r.wsize&&(r.wnext=0),r.whave<r.wsize&&(r.whave+=n))),0}function _(t,e){var a,n,r,s,o,l,h,_,u,c,b,g,m,bt,gt,mt,wt,pt,vt,kt,yt,xt,zt,Bt,St=0,Et=new w.Buf8(4),At=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!t||!t.state||!t.output||!t.input&&0!==t.avail_in)return N;a=t.state,a.mode===X&&(a.mode=W),o=t.next_out,r=t.output,h=t.avail_out,s=t.next_in,n=t.input,l=t.avail_in,_=a.hold,u=a.bits,c=l,b=h,xt=Z;t:for(;;)switch(a.mode){case T:if(0===a.wrap){a.mode=W;break}for(;u<16;){if(0===l)break t;l--,_+=n[s++]<<u,u+=8}if(2&a.wrap&&35615===_){a.check=0,Et[0]=255&_,Et[1]=_>>>8&255,a.check=v(a.check,Et,2,0),_=0,u=0,a.mode=F;break}if(a.flags=0,a.head&&(a.head.done=!1),!(1&a.wrap)||(((255&_)<<8)+(_>>8))%31){t.msg="incorrect header check",a.mode=_t;break}if((15&_)!==U){t.msg="unknown compression method",a.mode=_t;break}if(_>>>=4,u-=4,yt=(15&_)+8,0===a.wbits)a.wbits=yt;else if(yt>a.wbits){t.msg="invalid window size",a.mode=_t;break}a.dmax=1<<yt,t.adler=a.check=1,a.mode=512&_?q:X,_=0,u=0;break;case F:for(;u<16;){if(0===l)break t;l--,_+=n[s++]<<u,u+=8}if(a.flags=_,(255&a.flags)!==U){t.msg="unknown compression method",a.mode=_t;break}if(57344&a.flags){t.msg="unknown header flags set",a.mode=_t;break}a.head&&(a.head.text=_>>8&1),512&a.flags&&(Et[0]=255&_,Et[1]=_>>>8&255,a.check=v(a.check,Et,2,0)),_=0,u=0,a.mode=L;case L:for(;u<32;){if(0===l)break t;l--,_+=n[s++]<<u,u+=8}a.head&&(a.head.time=_),512&a.flags&&(Et[0]=255&_,Et[1]=_>>>8&255,Et[2]=_>>>16&255,Et[3]=_>>>24&255,a.check=v(a.check,Et,4,0)),_=0,u=0,a.mode=H;case H:for(;u<16;){if(0===l)break t;l--,_+=n[s++]<<u,u+=8}a.head&&(a.head.xflags=255&_,a.head.os=_>>8),512&a.flags&&(Et[0]=255&_,Et[1]=_>>>8&255,a.check=v(a.check,Et,2,0)),_=0,u=0,a.mode=j;case j:if(1024&a.flags){for(;u<16;){if(0===l)break t;l--,_+=n[s++]<<u,u+=8}a.length=_,a.head&&(a.head.extra_len=_),512&a.flags&&(Et[0]=255&_,Et[1]=_>>>8&255,a.check=v(a.check,Et,2,0)),_=0,u=0}else a.head&&(a.head.extra=null);a.mode=K;case K:if(1024&a.flags&&(g=a.length,g>l&&(g=l),g&&(a.head&&(yt=a.head.extra_len-a.length,a.head.extra||(a.head.extra=new Array(a.head.extra_len)),w.arraySet(a.head.extra,n,s,g,yt)),512&a.flags&&(a.check=v(a.check,n,g,s)),l-=g,s+=g,a.length-=g),a.length))break t;a.length=0,a.mode=M;case M:if(2048&a.flags){if(0===l)break t;g=0;do yt=n[s+g++],a.head&&yt&&a.length<65536&&(a.head.name+=String.fromCharCode(yt));while(yt&&g<l);if(512&a.flags&&(a.check=v(a.check,n,g,s)),l-=g,s+=g,yt)break t}else a.head&&(a.head.name=null);a.length=0,a.mode=P;case P:if(4096&a.flags){if(0===l)break t;g=0;do yt=n[s+g++],a.head&&yt&&a.length<65536&&(a.head.comment+=String.fromCharCode(yt));while(yt&&g<l);if(512&a.flags&&(a.check=v(a.check,n,g,s)),l-=g,s+=g,yt)break t}else a.head&&(a.head.comment=null);a.mode=Y;case Y:if(512&a.flags){for(;u<16;){if(0===l)break t;l--,_+=n[s++]<<u,u+=8}if(_!==(65535&a.check)){t.msg="header crc mismatch",a.mode=_t;break}_=0,u=0}a.head&&(a.head.hcrc=a.flags>>9&1,a.head.done=!0),t.adler=a.check=0,a.mode=X;break;case q:for(;u<32;){if(0===l)break t;l--,_+=n[s++]<<u,u+=8}t.adler=a.check=i(_),_=0,u=0,a.mode=G;case G:if(0===a.havedict)return t.next_out=o,t.avail_out=h,t.next_in=s,t.avail_in=l,a.hold=_,a.bits=u,C;t.adler=a.check=1,a.mode=X;case X:if(e===E||e===A)break t;case W:if(a.last){_>>>=7&u,u-=7&u,a.mode=ht;break}for(;u<3;){if(0===l)break t;l--,_+=n[s++]<<u,u+=8}switch(a.last=1&_,_>>>=1,u-=1,3&_){case 0:a.mode=J;break;case 1:if(d(a),a.mode=at,e===A){_>>>=2,u-=2;break t}break;case 2:a.mode=$;break;case 3:t.msg="invalid block type",a.mode=_t}_>>>=2,u-=2;break;case J:for(_>>>=7&u,u-=7&u;u<32;){if(0===l)break t;l--,_+=n[s++]<<u,u+=8}if((65535&_)!==(_>>>16^65535)){t.msg="invalid stored block lengths",a.mode=_t;break}if(a.length=65535&_,_=0,u=0,a.mode=Q,e===A)break t;case Q:a.mode=V;case V:if(g=a.length){if(g>l&&(g=l),g>h&&(g=h),0===g)break t;w.arraySet(r,n,s,g,o),l-=g,s+=g,h-=g,o+=g,a.length-=g;break}a.mode=X;break;case $:for(;u<14;){if(0===l)break t;
l--,_+=n[s++]<<u,u+=8}if(a.nlen=(31&_)+257,_>>>=5,u-=5,a.ndist=(31&_)+1,_>>>=5,u-=5,a.ncode=(15&_)+4,_>>>=4,u-=4,a.nlen>286||a.ndist>30){t.msg="too many length or distance symbols",a.mode=_t;break}a.have=0,a.mode=tt;case tt:for(;a.have<a.ncode;){for(;u<3;){if(0===l)break t;l--,_+=n[s++]<<u,u+=8}a.lens[At[a.have++]]=7&_,_>>>=3,u-=3}for(;a.have<19;)a.lens[At[a.have++]]=0;if(a.lencode=a.lendyn,a.lenbits=7,zt={bits:a.lenbits},xt=y(x,a.lens,0,19,a.lencode,0,a.work,zt),a.lenbits=zt.bits,xt){t.msg="invalid code lengths set",a.mode=_t;break}a.have=0,a.mode=et;case et:for(;a.have<a.nlen+a.ndist;){for(;St=a.lencode[_&(1<<a.lenbits)-1],gt=St>>>24,mt=St>>>16&255,wt=65535&St,!(gt<=u);){if(0===l)break t;l--,_+=n[s++]<<u,u+=8}if(wt<16)_>>>=gt,u-=gt,a.lens[a.have++]=wt;else{if(16===wt){for(Bt=gt+2;u<Bt;){if(0===l)break t;l--,_+=n[s++]<<u,u+=8}if(_>>>=gt,u-=gt,0===a.have){t.msg="invalid bit length repeat",a.mode=_t;break}yt=a.lens[a.have-1],g=3+(3&_),_>>>=2,u-=2}else if(17===wt){for(Bt=gt+3;u<Bt;){if(0===l)break t;l--,_+=n[s++]<<u,u+=8}_>>>=gt,u-=gt,yt=0,g=3+(7&_),_>>>=3,u-=3}else{for(Bt=gt+7;u<Bt;){if(0===l)break t;l--,_+=n[s++]<<u,u+=8}_>>>=gt,u-=gt,yt=0,g=11+(127&_),_>>>=7,u-=7}if(a.have+g>a.nlen+a.ndist){t.msg="invalid bit length repeat",a.mode=_t;break}for(;g--;)a.lens[a.have++]=yt}}if(a.mode===_t)break;if(0===a.lens[256]){t.msg="invalid code -- missing end-of-block",a.mode=_t;break}if(a.lenbits=9,zt={bits:a.lenbits},xt=y(z,a.lens,0,a.nlen,a.lencode,0,a.work,zt),a.lenbits=zt.bits,xt){t.msg="invalid literal/lengths set",a.mode=_t;break}if(a.distbits=6,a.distcode=a.distdyn,zt={bits:a.distbits},xt=y(B,a.lens,a.nlen,a.ndist,a.distcode,0,a.work,zt),a.distbits=zt.bits,xt){t.msg="invalid distances set",a.mode=_t;break}if(a.mode=at,e===A)break t;case at:a.mode=it;case it:if(l>=6&&h>=258){t.next_out=o,t.avail_out=h,t.next_in=s,t.avail_in=l,a.hold=_,a.bits=u,k(t,b),o=t.next_out,r=t.output,h=t.avail_out,s=t.next_in,n=t.input,l=t.avail_in,_=a.hold,u=a.bits,a.mode===X&&(a.back=-1);break}for(a.back=0;St=a.lencode[_&(1<<a.lenbits)-1],gt=St>>>24,mt=St>>>16&255,wt=65535&St,!(gt<=u);){if(0===l)break t;l--,_+=n[s++]<<u,u+=8}if(mt&&0===(240&mt)){for(pt=gt,vt=mt,kt=wt;St=a.lencode[kt+((_&(1<<pt+vt)-1)>>pt)],gt=St>>>24,mt=St>>>16&255,wt=65535&St,!(pt+gt<=u);){if(0===l)break t;l--,_+=n[s++]<<u,u+=8}_>>>=pt,u-=pt,a.back+=pt}if(_>>>=gt,u-=gt,a.back+=gt,a.length=wt,0===mt){a.mode=lt;break}if(32&mt){a.back=-1,a.mode=X;break}if(64&mt){t.msg="invalid literal/length code",a.mode=_t;break}a.extra=15&mt,a.mode=nt;case nt:if(a.extra){for(Bt=a.extra;u<Bt;){if(0===l)break t;l--,_+=n[s++]<<u,u+=8}a.length+=_&(1<<a.extra)-1,_>>>=a.extra,u-=a.extra,a.back+=a.extra}a.was=a.length,a.mode=rt;case rt:for(;St=a.distcode[_&(1<<a.distbits)-1],gt=St>>>24,mt=St>>>16&255,wt=65535&St,!(gt<=u);){if(0===l)break t;l--,_+=n[s++]<<u,u+=8}if(0===(240&mt)){for(pt=gt,vt=mt,kt=wt;St=a.distcode[kt+((_&(1<<pt+vt)-1)>>pt)],gt=St>>>24,mt=St>>>16&255,wt=65535&St,!(pt+gt<=u);){if(0===l)break t;l--,_+=n[s++]<<u,u+=8}_>>>=pt,u-=pt,a.back+=pt}if(_>>>=gt,u-=gt,a.back+=gt,64&mt){t.msg="invalid distance code",a.mode=_t;break}a.offset=wt,a.extra=15&mt,a.mode=st;case st:if(a.extra){for(Bt=a.extra;u<Bt;){if(0===l)break t;l--,_+=n[s++]<<u,u+=8}a.offset+=_&(1<<a.extra)-1,_>>>=a.extra,u-=a.extra,a.back+=a.extra}if(a.offset>a.dmax){t.msg="invalid distance too far back",a.mode=_t;break}a.mode=ot;case ot:if(0===h)break t;if(g=b-h,a.offset>g){if(g=a.offset-g,g>a.whave&&a.sane){t.msg="invalid distance too far back",a.mode=_t;break}g>a.wnext?(g-=a.wnext,m=a.wsize-g):m=a.wnext-g,g>a.length&&(g=a.length),bt=a.window}else bt=r,m=o-a.offset,g=a.length;g>h&&(g=h),h-=g,a.length-=g;do r[o++]=bt[m++];while(--g);0===a.length&&(a.mode=it);break;case lt:if(0===h)break t;r[o++]=a.length,h--,a.mode=it;break;case ht:if(a.wrap){for(;u<32;){if(0===l)break t;l--,_|=n[s++]<<u,u+=8}if(b-=h,t.total_out+=b,a.total+=b,b&&(t.adler=a.check=a.flags?v(a.check,r,b,o-b):p(a.check,r,b,o-b)),b=h,(a.flags?_:i(_))!==a.check){t.msg="incorrect data check",a.mode=_t;break}_=0,u=0}a.mode=dt;case dt:if(a.wrap&&a.flags){for(;u<32;){if(0===l)break t;l--,_+=n[s++]<<u,u+=8}if(_!==(4294967295&a.total)){t.msg="incorrect length check",a.mode=_t;break}_=0,u=0}a.mode=ft;case ft:xt=R;break t;case _t:xt=O;break t;case ut:return D;case ct:default:return N}return t.next_out=o,t.avail_out=h,t.next_in=s,t.avail_in=l,a.hold=_,a.bits=u,(a.wsize||b!==t.avail_out&&a.mode<_t&&(a.mode<ht||e!==S))&&f(t,t.output,t.next_out,b-t.avail_out)?(a.mode=ut,D):(c-=t.avail_in,b-=t.avail_out,t.total_in+=c,t.total_out+=b,a.total+=b,a.wrap&&b&&(t.adler=a.check=a.flags?v(a.check,r,b,t.next_out-b):p(a.check,r,b,t.next_out-b)),t.data_type=a.bits+(a.last?64:0)+(a.mode===X?128:0)+(a.mode===at||a.mode===Q?256:0),(0===c&&0===b||e===S)&&xt===Z&&(xt=I),xt)}function u(t){if(!t||!t.state)return N;var e=t.state;return e.window&&(e.window=null),t.state=null,Z}function c(t,e){var a;return t&&t.state?(a=t.state,0===(2&a.wrap)?N:(a.head=e,e.done=!1,Z)):N}function b(t,e){var a,i,n,r=e.length;return t&&t.state?(a=t.state,0!==a.wrap&&a.mode!==G?N:a.mode===G&&(i=1,i=p(i,e,r,0),i!==a.check)?O:(n=f(t,e,r,r))?(a.mode=ut,D):(a.havedict=1,Z)):N}var g,m,w=t("../utils/common"),p=t("./adler32"),v=t("./crc32"),k=t("./inffast"),y=t("./inftrees"),x=0,z=1,B=2,S=4,E=5,A=6,Z=0,R=1,C=2,N=-2,O=-3,D=-4,I=-5,U=8,T=1,F=2,L=3,H=4,j=5,K=6,M=7,P=8,Y=9,q=10,G=11,X=12,W=13,J=14,Q=15,V=16,$=17,tt=18,et=19,at=20,it=21,nt=22,rt=23,st=24,ot=25,lt=26,ht=27,dt=28,ft=29,_t=30,ut=31,ct=32,bt=852,gt=592,mt=15,wt=mt,pt=!0;a.inflateReset=s,a.inflateReset2=o,a.inflateResetKeep=r,a.inflateInit=h,a.inflateInit2=l,a.inflate=_,a.inflateEnd=u,a.inflateGetHeader=c,a.inflateSetDictionary=b,a.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":3,"./adler32":5,"./crc32":7,"./inffast":10,"./inftrees":12}],12:[function(t,e,a){"use strict";var i=t("../utils/common"),n=15,r=852,s=592,o=0,l=1,h=2,d=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],f=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],_=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],u=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];e.exports=function(t,e,a,c,b,g,m,w){var p,v,k,y,x,z,B,S,E,A=w.bits,Z=0,R=0,C=0,N=0,O=0,D=0,I=0,U=0,T=0,F=0,L=null,H=0,j=new i.Buf16(n+1),K=new i.Buf16(n+1),M=null,P=0;for(Z=0;Z<=n;Z++)j[Z]=0;for(R=0;R<c;R++)j[e[a+R]]++;for(O=A,N=n;N>=1&&0===j[N];N--);if(O>N&&(O=N),0===N)return b[g++]=20971520,b[g++]=20971520,w.bits=1,0;for(C=1;C<N&&0===j[C];C++);for(O<C&&(O=C),U=1,Z=1;Z<=n;Z++)if(U<<=1,U-=j[Z],U<0)return-1;if(U>0&&(t===o||1!==N))return-1;for(K[1]=0,Z=1;Z<n;Z++)K[Z+1]=K[Z]+j[Z];for(R=0;R<c;R++)0!==e[a+R]&&(m[K[e[a+R]]++]=R);if(t===o?(L=M=m,z=19):t===l?(L=d,H-=257,M=f,P-=257,z=256):(L=_,M=u,z=-1),F=0,R=0,Z=C,x=g,D=O,I=0,k=-1,T=1<<O,y=T-1,t===l&&T>r||t===h&&T>s)return 1;for(var Y=0;;){Y++,B=Z-I,m[R]<z?(S=0,E=m[R]):m[R]>z?(S=M[P+m[R]],E=L[H+m[R]]):(S=96,E=0),p=1<<Z-I,v=1<<D,C=v;do v-=p,b[x+(F>>I)+v]=B<<24|S<<16|E|0;while(0!==v);for(p=1<<Z-1;F&p;)p>>=1;if(0!==p?(F&=p-1,F+=p):F=0,R++,0===--j[Z]){if(Z===N)break;Z=e[a+m[R]]}if(Z>O&&(F&y)!==k){for(0===I&&(I=O),x+=C,D=Z-I,U=1<<D;D+I<N&&(U-=j[D+I],!(U<=0));)D++,U<<=1;if(T+=1<<D,t===l&&T>r||t===h&&T>s)return 1;k=F&y,b[k]=O<<24|D<<16|x-g|0}}return 0!==F&&(b[x+F]=Z-I<<24|64<<16|0),w.bits=O,0}},{"../utils/common":3}],13:[function(t,e,a){"use strict";e.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],14:[function(t,e,a){"use strict";function i(t){for(var e=t.length;--e>=0;)t[e]=0}function n(t,e,a,i,n){this.static_tree=t,this.extra_bits=e,this.extra_base=a,this.elems=i,this.max_length=n,this.has_stree=t&&t.length}function r(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}function s(t){return t<256?lt[t]:lt[256+(t>>>7)]}function o(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255}function l(t,e,a){t.bi_valid>W-a?(t.bi_buf|=e<<t.bi_valid&65535,o(t,t.bi_buf),t.bi_buf=e>>W-t.bi_valid,t.bi_valid+=a-W):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=a)}function h(t,e,a){l(t,a[2*e],a[2*e+1])}function d(t,e){var a=0;do a|=1&t,t>>>=1,a<<=1;while(--e>0);return a>>>1}function f(t){16===t.bi_valid?(o(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}function _(t,e){var a,i,n,r,s,o,l=e.dyn_tree,h=e.max_code,d=e.stat_desc.static_tree,f=e.stat_desc.has_stree,_=e.stat_desc.extra_bits,u=e.stat_desc.extra_base,c=e.stat_desc.max_length,b=0;for(r=0;r<=X;r++)t.bl_count[r]=0;for(l[2*t.heap[t.heap_max]+1]=0,a=t.heap_max+1;a<G;a++)i=t.heap[a],r=l[2*l[2*i+1]+1]+1,r>c&&(r=c,b++),l[2*i+1]=r,i>h||(t.bl_count[r]++,s=0,i>=u&&(s=_[i-u]),o=l[2*i],t.opt_len+=o*(r+s),f&&(t.static_len+=o*(d[2*i+1]+s)));if(0!==b){do{for(r=c-1;0===t.bl_count[r];)r--;t.bl_count[r]--,t.bl_count[r+1]+=2,t.bl_count[c]--,b-=2}while(b>0);for(r=c;0!==r;r--)for(i=t.bl_count[r];0!==i;)n=t.heap[--a],n>h||(l[2*n+1]!==r&&(t.opt_len+=(r-l[2*n+1])*l[2*n],l[2*n+1]=r),i--)}}function u(t,e,a){var i,n,r=new Array(X+1),s=0;for(i=1;i<=X;i++)r[i]=s=s+a[i-1]<<1;for(n=0;n<=e;n++){var o=t[2*n+1];0!==o&&(t[2*n]=d(r[o]++,o))}}function c(){var t,e,a,i,r,s=new Array(X+1);for(a=0,i=0;i<K-1;i++)for(dt[i]=a,t=0;t<1<<et[i];t++)ht[a++]=i;for(ht[a-1]=i,r=0,i=0;i<16;i++)for(ft[i]=r,t=0;t<1<<at[i];t++)lt[r++]=i;for(r>>=7;i<Y;i++)for(ft[i]=r<<7,t=0;t<1<<at[i]-7;t++)lt[256+r++]=i;for(e=0;e<=X;e++)s[e]=0;for(t=0;t<=143;)st[2*t+1]=8,t++,s[8]++;for(;t<=255;)st[2*t+1]=9,t++,s[9]++;for(;t<=279;)st[2*t+1]=7,t++,s[7]++;for(;t<=287;)st[2*t+1]=8,t++,s[8]++;for(u(st,P+1,s),t=0;t<Y;t++)ot[2*t+1]=5,ot[2*t]=d(t,5);_t=new n(st,et,M+1,P,X),ut=new n(ot,at,0,Y,X),ct=new n(new Array(0),it,0,q,J)}function b(t){var e;for(e=0;e<P;e++)t.dyn_ltree[2*e]=0;for(e=0;e<Y;e++)t.dyn_dtree[2*e]=0;for(e=0;e<q;e++)t.bl_tree[2*e]=0;t.dyn_ltree[2*Q]=1,t.opt_len=t.static_len=0,t.last_lit=t.matches=0}function g(t){t.bi_valid>8?o(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0}function m(t,e,a,i){g(t),i&&(o(t,a),o(t,~a)),N.arraySet(t.pending_buf,t.window,e,a,t.pending),t.pending+=a}function w(t,e,a,i){var n=2*e,r=2*a;return t[n]<t[r]||t[n]===t[r]&&i[e]<=i[a]}function p(t,e,a){for(var i=t.heap[a],n=a<<1;n<=t.heap_len&&(n<t.heap_len&&w(e,t.heap[n+1],t.heap[n],t.depth)&&n++,!w(e,i,t.heap[n],t.depth));)t.heap[a]=t.heap[n],a=n,n<<=1;t.heap[a]=i}function v(t,e,a){var i,n,r,o,d=0;if(0!==t.last_lit)do i=t.pending_buf[t.d_buf+2*d]<<8|t.pending_buf[t.d_buf+2*d+1],n=t.pending_buf[t.l_buf+d],d++,0===i?h(t,n,e):(r=ht[n],h(t,r+M+1,e),o=et[r],0!==o&&(n-=dt[r],l(t,n,o)),i--,r=s(i),h(t,r,a),o=at[r],0!==o&&(i-=ft[r],l(t,i,o)));while(d<t.last_lit);h(t,Q,e)}function k(t,e){var a,i,n,r=e.dyn_tree,s=e.stat_desc.static_tree,o=e.stat_desc.has_stree,l=e.stat_desc.elems,h=-1;for(t.heap_len=0,t.heap_max=G,a=0;a<l;a++)0!==r[2*a]?(t.heap[++t.heap_len]=h=a,t.depth[a]=0):r[2*a+1]=0;for(;t.heap_len<2;)n=t.heap[++t.heap_len]=h<2?++h:0,r[2*n]=1,t.depth[n]=0,t.opt_len--,o&&(t.static_len-=s[2*n+1]);for(e.max_code=h,a=t.heap_len>>1;a>=1;a--)p(t,r,a);n=l;do a=t.heap[1],t.heap[1]=t.heap[t.heap_len--],p(t,r,1),i=t.heap[1],t.heap[--t.heap_max]=a,t.heap[--t.heap_max]=i,r[2*n]=r[2*a]+r[2*i],t.depth[n]=(t.depth[a]>=t.depth[i]?t.depth[a]:t.depth[i])+1,r[2*a+1]=r[2*i+1]=n,t.heap[1]=n++,p(t,r,1);while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],_(t,e),u(r,h,t.bl_count)}function y(t,e,a){var i,n,r=-1,s=e[1],o=0,l=7,h=4;for(0===s&&(l=138,h=3),e[2*(a+1)+1]=65535,i=0;i<=a;i++)n=s,s=e[2*(i+1)+1],++o<l&&n===s||(o<h?t.bl_tree[2*n]+=o:0!==n?(n!==r&&t.bl_tree[2*n]++,t.bl_tree[2*V]++):o<=10?t.bl_tree[2*$]++:t.bl_tree[2*tt]++,o=0,r=n,0===s?(l=138,h=3):n===s?(l=6,h=3):(l=7,h=4))}function x(t,e,a){var i,n,r=-1,s=e[1],o=0,d=7,f=4;for(0===s&&(d=138,f=3),i=0;i<=a;i++)if(n=s,s=e[2*(i+1)+1],!(++o<d&&n===s)){if(o<f){do h(t,n,t.bl_tree);while(0!==--o)}else 0!==n?(n!==r&&(h(t,n,t.bl_tree),o--),h(t,V,t.bl_tree),l(t,o-3,2)):o<=10?(h(t,$,t.bl_tree),l(t,o-3,3)):(h(t,tt,t.bl_tree),l(t,o-11,7));o=0,r=n,0===s?(d=138,f=3):n===s?(d=6,f=3):(d=7,f=4)}}function z(t){var e;for(y(t,t.dyn_ltree,t.l_desc.max_code),y(t,t.dyn_dtree,t.d_desc.max_code),k(t,t.bl_desc),e=q-1;e>=3&&0===t.bl_tree[2*nt[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}function B(t,e,a,i){var n;for(l(t,e-257,5),l(t,a-1,5),l(t,i-4,4),n=0;n<i;n++)l(t,t.bl_tree[2*nt[n]+1],3);x(t,t.dyn_ltree,e-1),x(t,t.dyn_dtree,a-1)}function S(t){var e,a=4093624447;for(e=0;e<=31;e++,a>>>=1)if(1&a&&0!==t.dyn_ltree[2*e])return D;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return I;for(e=32;e<M;e++)if(0!==t.dyn_ltree[2*e])return I;return D}function E(t){bt||(c(),bt=!0),t.l_desc=new r(t.dyn_ltree,_t),t.d_desc=new r(t.dyn_dtree,ut),t.bl_desc=new r(t.bl_tree,ct),t.bi_buf=0,t.bi_valid=0,b(t)}function A(t,e,a,i){l(t,(T<<1)+(i?1:0),3),m(t,e,a,!0)}function Z(t){l(t,F<<1,3),h(t,Q,st),f(t)}function R(t,e,a,i){var n,r,s=0;t.level>0?(t.strm.data_type===U&&(t.strm.data_type=S(t)),k(t,t.l_desc),k(t,t.d_desc),s=z(t),n=t.opt_len+3+7>>>3,r=t.static_len+3+7>>>3,r<=n&&(n=r)):n=r=a+5,a+4<=n&&e!==-1?A(t,e,a,i):t.strategy===O||r===n?(l(t,(F<<1)+(i?1:0),3),v(t,st,ot)):(l(t,(L<<1)+(i?1:0),3),B(t,t.l_desc.max_code+1,t.d_desc.max_code+1,s+1),v(t,t.dyn_ltree,t.dyn_dtree)),b(t),i&&g(t)}function C(t,e,a){return t.pending_buf[t.d_buf+2*t.last_lit]=e>>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&a,t.last_lit++,0===e?t.dyn_ltree[2*a]++:(t.matches++,e--,t.dyn_ltree[2*(ht[a]+M+1)]++,t.dyn_dtree[2*s(e)]++),t.last_lit===t.lit_bufsize-1}var N=t("../utils/common"),O=4,D=0,I=1,U=2,T=0,F=1,L=2,H=3,j=258,K=29,M=256,P=M+1+K,Y=30,q=19,G=2*P+1,X=15,W=16,J=7,Q=256,V=16,$=17,tt=18,et=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],at=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],it=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],nt=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],rt=512,st=new Array(2*(P+2));i(st);var ot=new Array(2*Y);i(ot);var lt=new Array(rt);i(lt);var ht=new Array(j-H+1);i(ht);var dt=new Array(K);i(dt);var ft=new Array(Y);i(ft);var _t,ut,ct,bt=!1;a._tr_init=E,a._tr_stored_block=A,a._tr_flush_block=R,a._tr_tally=C,a._tr_align=Z},{"../utils/common":3}],15:[function(t,e,a){"use strict";function i(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}e.exports=i},{}],"/":[function(t,e,a){"use strict";var i=t("./lib/utils/common").assign,n=t("./lib/deflate"),r=t("./lib/inflate"),s=t("./lib/zlib/constants"),o={};i(o,n,r,s),e.exports=o},{"./lib/deflate":1,"./lib/inflate":2,"./lib/utils/common":3,"./lib/zlib/constants":6}]},{},[])("/")});

if(typeof self === "undefined" || !self.constructor.name.includes("Worker")) { var e=function(){"use strict";function r(e,r){postMessage({action:xt,cbn:r,result:e})}function t(e){var r=[];return r[e-1]=void 0,r}function o(e,r){return i(e[0]+r[0],e[1]+r[1])}function n(e,r){return u(~~Math.max(Math.min(e[1]/Ot,2147483647),-2147483648)&~~Math.max(Math.min(r[1]/Ot,2147483647),-2147483648),c(e)&c(r))}function s(e,r){var t,o;return e[0]==r[0]&&e[1]==r[1]?0:(t=0>e[1],o=0>r[1],t&&!o?-1:!t&&o?1:h(e,r)[1]<0?-1:1)}function i(e,r){var t,o;for(r%=0x10000000000000000,e%=0x10000000000000000,t=r%Ot,o=Math.floor(e/Ot)*Ot,r=r-t+o,e=e-o+t;0>e;)e+=Ot,r-=Ot;for(;e>4294967295;)e-=Ot,r+=Ot;for(r%=0x10000000000000000;r>0x7fffffff00000000;)r-=0x10000000000000000;for(;-0x8000000000000000>r;)r+=0x10000000000000000;return[e,r]}function _(e,r){return e[0]==r[0]&&e[1]==r[1]}function a(e){return e>=0?[e,0]:[e+Ot,-Ot]}function c(e){return e[0]>=2147483648?~~Math.max(Math.min(e[0]-Ot,2147483647),-2147483648):~~Math.max(Math.min(e[0],2147483647),-2147483648)}function u(e,r){var t,o;return t=e*Ot,o=r,0>r&&(o+=Ot),[o,t]}function f(e){return 30>=e?1<<e:f(30)*f(e-30)}function m(e,r){var t,o,n,s;if(r&=63,_(e,Ht))return r?Gt:e;if(0>e[1])throw Error("Neg");return s=f(r),o=e[1]*s%0x10000000000000000,n=e[0]*s,t=n-n%Ot,o+=t,n-=t,o>=0x8000000000000000&&(o-=0x10000000000000000),[n,o]}function d(e,r){var t;return r&=63,t=f(r),i(Math.floor(e[0]/t),e[1]/t)}function p(e,r){var t;return r&=63,t=d(e,r),0>e[1]&&(t=o(t,m([2,0],63-r))),t}function h(e,r){return i(e[0]-r[0],e[1]-r[1])}function P(e,r){return e.Mc=r,e.Lc=0,e.Yb=r.length,e}function l(e){return e.Lc>=e.Yb?-1:255&e.Mc[e.Lc++]}function v(e,r,t,o){return e.Lc>=e.Yb?-1:(o=Math.min(o,e.Yb-e.Lc),M(e.Mc,e.Lc,r,t,o),e.Lc+=o,o)}function B(e){return e.Mc=t(32),e.Yb=0,e}function S(e){var r=e.Mc;return r.length=e.Yb,r}function g(e,r){e.Mc[e.Yb++]=r<<24>>24}function k(e,r,t,o){M(r,t,e.Mc,e.Yb,o),e.Yb+=o}function R(e,r,t,o,n){var s;for(s=r;t>s;++s)o[n++]=e.charCodeAt(s)}function M(e,r,t,o,n){for(var s=0;n>s;++s)t[o+s]=e[r+s]}function D(e,r){Ar(r,1<<e.s),r.n=e.f,Hr(r,e.m),r.eb=0,r.fb=3,r.Y=2,r.y=3}function b(r,t,o,n,i){var _,a;if(s(n,At)<0)throw Error("invalid length "+n);for(r.Tb=n,_=Dr({}),D(i,_),_.Gc=void 0===e.disableEndMark,Gr(_,o),a=0;64>a;a+=8)g(o,255&c(d(n,a)));r.yb=(_.W=0,_.oc=t,_.pc=0,Mr(_),_.d.Ab=o,Fr(_),wr(_),br(_),_.$.rb=_.n+1-2,Qr(_.$,1<<_.Y),_.i.rb=_.n+1-2,Qr(_.i,1<<_.Y),void(_.g=Gt),X({},_))}function w(e,r,t){return e.Nb=B({}),b(e,P({},r),e.Nb,a(r.length),t),e}function E(e,r,t){var o,n,s,i,_="",c=[];for(n=0;5>n;++n){if(s=l(r),-1==s)throw Error("truncated input");c[n]=s<<24>>24}if(o=ir({}),!ar(o,c))throw Error("corrupted input");for(n=0;64>n;n+=8){if(s=l(r),-1==s)throw Error("truncated input");s=s.toString(16),1==s.length&&(s="0"+s),_=s+""+_}/^0+$|^f+$/i.test(_)?e.Tb=At:(i=parseInt(_,16),e.Tb=i>4294967295?At:a(i)),e.yb=nr(o,r,t,e.Tb)}function L(e,r){return e.Nb=B({}),E(e,P({},r),e.Nb),e}function y(e,r,o,n){var s;e.Bc=r,e._b=o,s=r+o+n,(null==e.c||e.Kb!=s)&&(e.c=null,e.Kb=s,e.c=t(e.Kb)),e.H=e.Kb-o}function C(e,r){return e.c[e.f+e.o+r]}function z(e,r,t,o){var n,s;for(e.T&&e.o+r+o>e.h&&(o=e.h-(e.o+r)),++t,s=e.f+e.o+r,n=0;o>n&&e.c[s+n]==e.c[s+n-t];++n);return n}function F(e){return e.h-e.o}function I(e){var r,t,o;for(o=e.f+e.o-e.Bc,o>0&&--o,t=e.f+e.h-o,r=0;t>r;++r)e.c[r]=e.c[o+r];e.f-=o}function x(e){var r;++e.o,e.o>e.zb&&(r=e.f+e.o,r>e.H&&I(e),N(e))}function N(e){var r,t,o;if(!e.T)for(;;){if(o=-e.f+e.Kb-e.h,!o)return;if(r=v(e.cc,e.c,e.f+e.h,o),-1==r)return e.zb=e.h,t=e.f+e.zb,t>e.H&&(e.zb=e.H-e.f),void(e.T=1);e.h+=r,e.h>=e.o+e._b&&(e.zb=e.h-e._b)}}function O(e,r){e.f+=r,e.zb-=r,e.o-=r,e.h-=r}function A(e,r,o,n,s){var i,_,a;1073741567>r&&(e.Fc=16+(n>>1),a=~~((r+o+n+s)/2)+256,y(e,r+o,n+s,a),e.ob=n,i=r+1,e.p!=i&&(e.L=t(2*(e.p=i))),_=65536,e.qb&&(_=r-1,_|=_>>1,_|=_>>2,_|=_>>4,_|=_>>8,_>>=1,_|=65535,_>16777216&&(_>>=1),e.Ec=_,++_,_+=e.R),_!=e.rc&&(e.ub=t(e.rc=_)))}function H(e,r){var t,o,n,s,i,_,a,c,u,f,m,d,p,h,P,l,v,B,S,g,k;if(e.h>=e.o+e.ob)h=e.ob;else if(h=e.h-e.o,e.xb>h)return W(e),0;for(v=0,P=e.o>e.p?e.o-e.p:0,o=e.f+e.o,l=1,c=0,u=0,e.qb?(k=Tt[255&e.c[o]]^255&e.c[o+1],c=1023&k,k^=(255&e.c[o+2])<<8,u=65535&k,f=(k^Tt[255&e.c[o+3]]<<5)&e.Ec):f=255&e.c[o]^(255&e.c[o+1])<<8,n=e.ub[e.R+f]||0,e.qb&&(s=e.ub[c]||0,i=e.ub[1024+u]||0,e.ub[c]=e.o,e.ub[1024+u]=e.o,s>P&&e.c[e.f+s]==e.c[o]&&(r[v++]=l=2,r[v++]=e.o-s-1),i>P&&e.c[e.f+i]==e.c[o]&&(i==s&&(v-=2),r[v++]=l=3,r[v++]=e.o-i-1,s=i),0!=v&&s==n&&(v-=2,l=1)),e.ub[e.R+f]=e.o,S=(e.k<<1)+1,g=e.k<<1,d=p=e.w,0!=e.w&&n>P&&e.c[e.f+n+e.w]!=e.c[o+e.w]&&(r[v++]=l=e.w,r[v++]=e.o-n-1),t=e.Fc;;){if(P>=n||0==t--){e.L[S]=e.L[g]=0;break}if(a=e.o-n,_=(e.k>=a?e.k-a:e.k-a+e.p)<<1,B=e.f+n,m=p>d?d:p,e.c[B+m]==e.c[o+m]){for(;++m!=h&&e.c[B+m]==e.c[o+m];);if(m>l&&(r[v++]=l=m,r[v++]=a-1,m==h)){e.L[g]=e.L[_],e.L[S]=e.L[_+1];break}}(255&e.c[o+m])>(255&e.c[B+m])?(e.L[g]=n,g=_+1,n=e.L[g],p=m):(e.L[S]=n,S=_,n=e.L[S],d=m)}return W(e),v}function G(e){e.f=0,e.o=0,e.h=0,e.T=0,N(e),e.k=0,O(e,-1)}function W(e){var r;++e.k>=e.p&&(e.k=0),x(e),1073741823==e.o&&(r=e.o-e.p,T(e.L,2*e.p,r),T(e.ub,e.rc,r),O(e,r))}function T(e,r,t){var o,n;for(o=0;r>o;++o)n=e[o]||0,t>=n?n=0:n-=t,e[o]=n}function Z(e,r){e.qb=r>2,e.qb?(e.w=0,e.xb=4,e.R=66560):(e.w=2,e.xb=3,e.R=0)}function Y(e,r){var t,o,n,s,i,_,a,c,u,f,m,d,p,h,P,l,v;do{if(e.h>=e.o+e.ob)d=e.ob;else if(d=e.h-e.o,e.xb>d){W(e);continue}for(p=e.o>e.p?e.o-e.p:0,o=e.f+e.o,e.qb?(v=Tt[255&e.c[o]]^255&e.c[o+1],_=1023&v,e.ub[_]=e.o,v^=(255&e.c[o+2])<<8,a=65535&v,e.ub[1024+a]=e.o,c=(v^Tt[255&e.c[o+3]]<<5)&e.Ec):c=255&e.c[o]^(255&e.c[o+1])<<8,n=e.ub[e.R+c],e.ub[e.R+c]=e.o,P=(e.k<<1)+1,l=e.k<<1,f=m=e.w,t=e.Fc;;){if(p>=n||0==t--){e.L[P]=e.L[l]=0;break}if(i=e.o-n,s=(e.k>=i?e.k-i:e.k-i+e.p)<<1,h=e.f+n,u=m>f?f:m,e.c[h+u]==e.c[o+u]){for(;++u!=d&&e.c[h+u]==e.c[o+u];);if(u==d){e.L[l]=e.L[s],e.L[P]=e.L[s+1];break}}(255&e.c[o+u])>(255&e.c[h+u])?(e.L[l]=n,l=s+1,n=e.L[l],m=u):(e.L[P]=n,P=s,n=e.L[P],f=u)}W(e)}while(0!=--r)}function V(e,r,t){var o=e.o-r-1;for(0>o&&(o+=e.M);0!=t;--t)o>=e.M&&(o=0),e.Lb[e.o++]=e.Lb[o++],e.o>=e.M&&$(e)}function j(e,r){(null==e.Lb||e.M!=r)&&(e.Lb=t(r)),e.M=r,e.o=0,e.h=0}function $(e){var r=e.o-e.h;r&&(k(e.cc,e.Lb,e.h,r),e.o>=e.M&&(e.o=0),e.h=e.o)}function K(e,r){var t=e.o-r-1;return 0>t&&(t+=e.M),e.Lb[t]}function q(e,r){e.Lb[e.o++]=r,e.o>=e.M&&$(e)}function J(e){$(e),e.cc=null}function Q(e){return e-=2,4>e?e:3}function U(e){return 4>e?0:10>e?e-3:e-6}function X(e,r){return e.cb=r,e.Z=null,e.zc=1,e}function er(e,r){return e.Z=r,e.cb=null,e.zc=1,e}function rr(e){if(!e.zc)throw Error("bad state");return e.cb?or(e):tr(e),e.zc}function tr(e){var r=sr(e.Z);if(-1==r)throw Error("corrupted input");e.Pb=At,e.Pc=e.Z.g,(r||s(e.Z.Nc,Gt)>=0&&s(e.Z.g,e.Z.Nc)>=0)&&($(e.Z.B),J(e.Z.B),e.Z.e.Ab=null,e.zc=0)}function or(e){Rr(e.cb,e.cb.Xb,e.cb.uc,e.cb.Kc),e.Pb=e.cb.Xb[0],e.cb.Kc[0]&&(Or(e.cb),e.zc=0)}function nr(e,r,t,o){return e.e.Ab=r,J(e.B),e.B.cc=t,_r(e),e.U=0,e.ib=0,e.Jc=0,e.Ic=0,e.Qc=0,e.Nc=o,e.g=Gt,e.jc=0,er({},e)}function sr(e){var r,t,n,i,_,u;if(u=c(e.g)&e.Dc,vt(e.e,e.Gb,(e.U<<4)+u)){if(vt(e.e,e.Zb,e.U))n=0,vt(e.e,e.Cb,e.U)?(vt(e.e,e.Db,e.U)?(vt(e.e,e.Eb,e.U)?(t=e.Qc,e.Qc=e.Ic):t=e.Ic,e.Ic=e.Jc):t=e.Jc,e.Jc=e.ib,e.ib=t):vt(e.e,e.pb,(e.U<<4)+u)||(e.U=7>e.U?9:11,n=1),n||(n=mr(e.sb,e.e,u)+2,e.U=7>e.U?8:11);else if(e.Qc=e.Ic,e.Ic=e.Jc,e.Jc=e.ib,n=2+mr(e.Rb,e.e,u),e.U=7>e.U?7:10,_=at(e.kb[Q(n)],e.e),_>=4){if(i=(_>>1)-1,e.ib=(2|1&_)<<i,14>_)e.ib+=ut(e.kc,e.ib-_-1,e.e,i);else if(e.ib+=Bt(e.e,i-4)<<4,e.ib+=ct(e.Fb,e.e),0>e.ib)return-1==e.ib?1:-1}else e.ib=_;if(s(a(e.ib),e.g)>=0||e.ib>=e.nb)return-1;V(e.B,e.ib,n),e.g=o(e.g,a(n)),e.jc=K(e.B,0)}else r=Pr(e.gb,c(e.g),e.jc),e.jc=7>e.U?vr(r,e.e):Br(r,e.e,K(e.B,e.ib)),q(e.B,e.jc),e.U=U(e.U),e.g=o(e.g,Wt);return 0}function ir(e){e.B={},e.e={},e.Gb=t(192),e.Zb=t(12),e.Cb=t(12),e.Db=t(12),e.Eb=t(12),e.pb=t(192),e.kb=t(4),e.kc=t(114),e.Fb=_t({},4),e.Rb=dr({}),e.sb=dr({}),e.gb={};for(var r=0;4>r;++r)e.kb[r]=_t({},6);return e}function _r(e){e.B.h=0,e.B.o=0,gt(e.Gb),gt(e.pb),gt(e.Zb),gt(e.Cb),gt(e.Db),gt(e.Eb),gt(e.kc),lr(e.gb);for(var r=0;4>r;++r)gt(e.kb[r].G);pr(e.Rb),pr(e.sb),gt(e.Fb.G),St(e.e)}function ar(e,r){var t,o,n,s,i,_,a;if(5>r.length)return 0;for(a=255&r[0],n=a%9,_=~~(a/9),s=_%5,i=~~(_/5),t=0,o=0;4>o;++o)t+=(255&r[1+o])<<8*o;return t>99999999||!ur(e,n,s,i)?0:cr(e,t)}function cr(e,r){return 0>r?0:(e.Ob!=r&&(e.Ob=r,e.nb=Math.max(e.Ob,1),j(e.B,Math.max(e.nb,4096))),1)}function ur(e,r,t,o){if(r>8||t>4||o>4)return 0;hr(e.gb,t,r);var n=1<<o;return fr(e.Rb,n),fr(e.sb,n),e.Dc=n-1,1}function fr(e,r){for(;r>e.O;++e.O)e.ec[e.O]=_t({},3),e.hc[e.O]=_t({},3)}function mr(e,r,t){if(!vt(r,e.wc,0))return at(e.ec[t],r);var o=8;return o+=vt(r,e.wc,1)?8+at(e.tc,r):at(e.hc[t],r)}function dr(e){return e.wc=t(2),e.ec=t(16),e.hc=t(16),e.tc=_t({},8),e.O=0,e}function pr(e){gt(e.wc);for(var r=0;e.O>r;++r)gt(e.ec[r].G),gt(e.hc[r].G);gt(e.tc.G)}function hr(e,r,o){var n,s;if(null==e.V||e.u!=o||e.I!=r)for(e.I=r,e.qc=(1<<r)-1,e.u=o,s=1<<e.u+e.I,e.V=t(s),n=0;s>n;++n)e.V[n]=Sr({})}function Pr(e,r,t){return e.V[((r&e.qc)<<e.u)+((255&t)>>>8-e.u)]}function lr(e){var r,t;for(t=1<<e.u+e.I,r=0;t>r;++r)gt(e.V[r].Ib)}function vr(e,r){var t=1;do t=t<<1|vt(r,e.Ib,t);while(256>t);return t<<24>>24}function Br(e,r,t){var o,n,s=1;do if(n=t>>7&1,t<<=1,o=vt(r,e.Ib,(1+n<<8)+s),s=s<<1|o,n!=o){for(;256>s;)s=s<<1|vt(r,e.Ib,s);break}while(256>s);return s<<24>>24}function Sr(e){return e.Ib=t(768),e}function gr(e,r){var t,o,n,s;e.jb=r,n=e.a[r].r,o=e.a[r].j;do e.a[r].t&&(st(e.a[n]),e.a[n].r=n-1,e.a[r].Ac&&(e.a[n-1].t=0,e.a[n-1].r=e.a[r].r2,e.a[n-1].j=e.a[r].j2)),s=n,t=o,o=e.a[s].j,n=e.a[s].r,e.a[s].j=t,e.a[s].r=r,r=s;while(r>0);return e.mb=e.a[0].j,e.q=e.a[0].r}function kr(e){e.l=0,e.J=0;for(var r=0;4>r;++r)e.v[r]=0}function Rr(e,r,t,n){var i,u,f,m,d,p,P,l,v,B,S,g,k,R,M;if(r[0]=Gt,t[0]=Gt,n[0]=1,e.oc&&(e.b.cc=e.oc,G(e.b),e.W=1,e.oc=null),!e.pc){if(e.pc=1,R=e.g,_(e.g,Gt)){if(!F(e.b))return void Er(e,c(e.g));xr(e),k=c(e.g)&e.y,kt(e.d,e.C,(e.l<<4)+k,0),e.l=U(e.l),f=C(e.b,-e.s),rt(Xr(e.A,c(e.g),e.J),e.d,f),e.J=f,--e.s,e.g=o(e.g,Wt)}if(!F(e.b))return void Er(e,c(e.g));for(;;){if(P=Lr(e,c(e.g)),B=e.mb,k=c(e.g)&e.y,u=(e.l<<4)+k,1==P&&-1==B)kt(e.d,e.C,u,0),f=C(e.b,-e.s),M=Xr(e.A,c(e.g),e.J),7>e.l?rt(M,e.d,f):(v=C(e.b,-e.v[0]-1-e.s),tt(M,e.d,v,f)),e.J=f,e.l=U(e.l);else{if(kt(e.d,e.C,u,1),4>B){if(kt(e.d,e.bb,e.l,1),B?(kt(e.d,e.hb,e.l,1),1==B?kt(e.d,e.Ub,e.l,0):(kt(e.d,e.Ub,e.l,1),kt(e.d,e.vc,e.l,B-2))):(kt(e.d,e.hb,e.l,0),1==P?kt(e.d,e._,u,0):kt(e.d,e._,u,1)),1==P?e.l=7>e.l?9:11:(Kr(e.i,e.d,P-2,k),e.l=7>e.l?8:11),m=e.v[B],0!=B){for(p=B;p>=1;--p)e.v[p]=e.v[p-1];e.v[0]=m}}else{for(kt(e.d,e.bb,e.l,0),e.l=7>e.l?7:10,Kr(e.$,e.d,P-2,k),B-=4,g=Tr(B),l=Q(P),mt(e.K[l],e.d,g),g>=4&&(d=(g>>1)-1,i=(2|1&g)<<d,S=B-i,14>g?Pt(e.Sb,i-g-1,e.d,d,S):(Rt(e.d,S>>4,d-4),pt(e.S,e.d,15&S),++e.Qb)),m=B,p=3;p>=1;--p)e.v[p]=e.v[p-1];e.v[0]=m,++e.Mb}e.J=C(e.b,P-1-e.s)}if(e.s-=P,e.g=o(e.g,a(P)),!e.s){if(e.Mb>=128&&wr(e),e.Qb>=16&&br(e),r[0]=e.g,t[0]=Mt(e.d),!F(e.b))return void Er(e,c(e.g));if(s(h(e.g,R),[4096,0])>=0)return e.pc=0,void(n[0]=0)}}}}function Mr(e){var r,t;e.b||(r={},t=4,e.X||(t=2),Z(r,t),e.b=r),Ur(e.A,e.eb,e.fb),(e.ab!=e.wb||e.Hb!=e.n)&&(A(e.b,e.ab,4096,e.n,274),e.wb=e.ab,e.Hb=e.n)}function Dr(e){var r;for(e.v=t(4),e.a=[],e.d={},e.C=t(192),e.bb=t(12),e.hb=t(12),e.Ub=t(12),e.vc=t(12),e._=t(192),e.K=[],e.Sb=t(114),e.S=ft({},4),e.$=qr({}),e.i=qr({}),e.A={},e.m=[],e.P=[],e.lb=[],e.nc=t(16),e.x=t(4),e.Q=t(4),e.Xb=[Gt],e.uc=[Gt],e.Kc=[0],e.fc=t(5),e.yc=t(128),e.vb=0,e.X=1,e.D=0,e.Hb=-1,e.mb=0,r=0;4096>r;++r)e.a[r]={};for(r=0;4>r;++r)e.K[r]=ft({},6);return e}function br(e){for(var r=0;16>r;++r)e.nc[r]=ht(e.S,r);e.Qb=0}function wr(e){var r,t,o,n,s,i,_,a;for(n=4;128>n;++n)i=Tr(n),o=(i>>1)-1,r=(2|1&i)<<o,e.yc[n]=lt(e.Sb,r-i-1,o,n-r);for(s=0;4>s;++s){for(t=e.K[s],_=s<<6,i=0;e.$b>i;++i)e.P[_+i]=dt(t,i);for(i=14;e.$b>i;++i)e.P[_+i]+=(i>>1)-1-4<<6;for(a=128*s,n=0;4>n;++n)e.lb[a+n]=e.P[_+n];for(;128>n;++n)e.lb[a+n]=e.P[_+Tr(n)]+e.yc[n]}e.Mb=0}function Er(e,r){Nr(e),Wr(e,r&e.y);for(var t=0;5>t;++t)bt(e.d)}function Lr(e,r){var t,o,n,s,i,_,a,c,u,f,m,d,p,h,P,l,v,B,S,g,k,R,M,D,b,w,E,L,y,I,x,N,O,A,H,G,W,T,Z,Y,V,j,$,K,q,J,Q,X,er,rr;if(e.jb!=e.q)return p=e.a[e.q].r-e.q,e.mb=e.a[e.q].j,e.q=e.a[e.q].r,p;if(e.q=e.jb=0,e.N?(d=e.vb,e.N=0):d=xr(e),E=e.D,b=F(e.b)+1,2>b)return e.mb=-1,1;for(b>273&&(b=273),Y=0,u=0;4>u;++u)e.x[u]=e.v[u],e.Q[u]=z(e.b,-1,e.x[u],273),e.Q[u]>e.Q[Y]&&(Y=u);if(e.Q[Y]>=e.n)return e.mb=Y,p=e.Q[Y],Ir(e,p-1),p;if(d>=e.n)return e.mb=e.m[E-1]+4,Ir(e,d-1),d;if(a=C(e.b,-1),v=C(e.b,-e.v[0]-1-1),2>d&&a!=v&&2>e.Q[Y])return e.mb=-1,1;if(e.a[0].Hc=e.l,A=r&e.y,e.a[1].z=Yt[e.C[(e.l<<4)+A]>>>2]+nt(Xr(e.A,r,e.J),e.l>=7,v,a),st(e.a[1]),B=Yt[2048-e.C[(e.l<<4)+A]>>>2],Z=B+Yt[2048-e.bb[e.l]>>>2],v==a&&(V=Z+zr(e,e.l,A),e.a[1].z>V&&(e.a[1].z=V,it(e.a[1]))),m=d>=e.Q[Y]?d:e.Q[Y],2>m)return e.mb=e.a[1].j,1;e.a[1].r=0,e.a[0].bc=e.x[0],e.a[0].ac=e.x[1],e.a[0].dc=e.x[2],e.a[0].lc=e.x[3],f=m;do e.a[f--].z=268435455;while(f>=2);for(u=0;4>u;++u)if(T=e.Q[u],!(2>T)){G=Z+Cr(e,u,e.l,A);do s=G+Jr(e.i,T-2,A),x=e.a[T],x.z>s&&(x.z=s,x.r=0,x.j=u,x.t=0);while(--T>=2)}if(D=B+Yt[e.bb[e.l]>>>2],f=e.Q[0]>=2?e.Q[0]+1:2,d>=f){for(L=0;f>e.m[L];)L+=2;for(;c=e.m[L+1],s=D+yr(e,c,f,A),x=e.a[f],x.z>s&&(x.z=s,x.r=0,x.j=c+4,x.t=0),f!=e.m[L]||(L+=2,L!=E);++f);}for(t=0;;){if(++t,t==m)return gr(e,t);if(S=xr(e),E=e.D,S>=e.n)return e.vb=S,e.N=1,gr(e,t);if(++r,O=e.a[t].r,e.a[t].t?(--O,e.a[t].Ac?($=e.a[e.a[t].r2].Hc,$=4>e.a[t].j2?7>$?8:11:7>$?7:10):$=e.a[O].Hc,$=U($)):$=e.a[O].Hc,O==t-1?$=e.a[t].j?U($):7>$?9:11:(e.a[t].t&&e.a[t].Ac?(O=e.a[t].r2,N=e.a[t].j2,$=7>$?8:11):(N=e.a[t].j,$=4>N?7>$?8:11:7>$?7:10),I=e.a[O],4>N?N?1==N?(e.x[0]=I.ac,e.x[1]=I.bc,e.x[2]=I.dc,e.x[3]=I.lc):2==N?(e.x[0]=I.dc,e.x[1]=I.bc,e.x[2]=I.ac,e.x[3]=I.lc):(e.x[0]=I.lc,e.x[1]=I.bc,e.x[2]=I.ac,e.x[3]=I.dc):(e.x[0]=I.bc,e.x[1]=I.ac,e.x[2]=I.dc,e.x[3]=I.lc):(e.x[0]=N-4,e.x[1]=I.bc,e.x[2]=I.ac,e.x[3]=I.dc)),e.a[t].Hc=$,e.a[t].bc=e.x[0],e.a[t].ac=e.x[1],e.a[t].dc=e.x[2],e.a[t].lc=e.x[3],_=e.a[t].z,a=C(e.b,-1),v=C(e.b,-e.x[0]-1-1),A=r&e.y,o=_+Yt[e.C[($<<4)+A]>>>2]+nt(Xr(e.A,r,C(e.b,-2)),$>=7,v,a),R=e.a[t+1],g=0,R.z>o&&(R.z=o,R.r=t,R.j=-1,R.t=0,g=1),B=_+Yt[2048-e.C[($<<4)+A]>>>2],Z=B+Yt[2048-e.bb[$]>>>2],v!=a||t>R.r&&!R.j||(V=Z+(Yt[e.hb[$]>>>2]+Yt[e._[($<<4)+A]>>>2]),R.z>=V&&(R.z=V,R.r=t,R.j=0,R.t=0,g=1)),w=F(e.b)+1,w=w>4095-t?4095-t:w,b=w,!(2>b)){if(b>e.n&&(b=e.n),!g&&v!=a&&(q=Math.min(w-1,e.n),P=z(e.b,0,e.x[0],q),P>=2)){for(K=U($),H=r+1&e.y,M=o+Yt[2048-e.C[(K<<4)+H]>>>2]+Yt[2048-e.bb[K]>>>2],y=t+1+P;y>m;)e.a[++m].z=268435455;s=M+(J=Jr(e.i,P-2,H),J+Cr(e,0,K,H)),x=e.a[y],x.z>s&&(x.z=s,x.r=t+1,x.j=0,x.t=1,x.Ac=0)}for(j=2,W=0;4>W;++W)if(h=z(e.b,-1,e.x[W],b),!(2>h)){l=h;do{for(;t+h>m;)e.a[++m].z=268435455;s=Z+(Q=Jr(e.i,h-2,A),Q+Cr(e,W,$,A)),x=e.a[t+h],x.z>s&&(x.z=s,x.r=t,x.j=W,x.t=0)}while(--h>=2);if(h=l,W||(j=h+1),w>h&&(q=Math.min(w-1-h,e.n),P=z(e.b,h,e.x[W],q),P>=2)){for(K=7>$?8:11,H=r+h&e.y,n=Z+(X=Jr(e.i,h-2,A),X+Cr(e,W,$,A))+Yt[e.C[(K<<4)+H]>>>2]+nt(Xr(e.A,r+h,C(e.b,h-1-1)),1,C(e.b,h-1-(e.x[W]+1)),C(e.b,h-1)),K=U(K),H=r+h+1&e.y,k=n+Yt[2048-e.C[(K<<4)+H]>>>2],M=k+Yt[2048-e.bb[K]>>>2],y=h+1+P;t+y>m;)e.a[++m].z=268435455;s=M+(er=Jr(e.i,P-2,H),er+Cr(e,0,K,H)),x=e.a[t+y],x.z>s&&(x.z=s,x.r=t+h+1,x.j=0,x.t=1,x.Ac=1,x.r2=t,x.j2=W)}}if(S>b){for(S=b,E=0;S>e.m[E];E+=2);e.m[E]=S,E+=2}if(S>=j){for(D=B+Yt[e.bb[$]>>>2];t+S>m;)e.a[++m].z=268435455;for(L=0;j>e.m[L];)L+=2;for(h=j;;++h)if(i=e.m[L+1],s=D+yr(e,i,h,A),x=e.a[t+h],x.z>s&&(x.z=s,x.r=t,x.j=i+4,x.t=0),h==e.m[L]){if(w>h&&(q=Math.min(w-1-h,e.n),P=z(e.b,h,i,q),P>=2)){for(K=7>$?7:10,H=r+h&e.y,n=s+Yt[e.C[(K<<4)+H]>>>2]+nt(Xr(e.A,r+h,C(e.b,h-1-1)),1,C(e.b,h-(i+1)-1),C(e.b,h-1)),K=U(K),H=r+h+1&e.y,k=n+Yt[2048-e.C[(K<<4)+H]>>>2],M=k+Yt[2048-e.bb[K]>>>2],y=h+1+P;t+y>m;)e.a[++m].z=268435455;s=M+(rr=Jr(e.i,P-2,H),rr+Cr(e,0,K,H)),x=e.a[t+y],x.z>s&&(x.z=s,x.r=t+h+1,x.j=0,x.t=1,x.Ac=1,x.r2=t,x.j2=i+4)}if(L+=2,L==E)break}}}}}function yr(e,r,t,o){var n,s=Q(t);return n=128>r?e.lb[128*s+r]:e.P[(s<<6)+Zr(r)]+e.nc[15&r],n+Jr(e.$,t-2,o)}function Cr(e,r,t,o){var n;return r?(n=Yt[2048-e.hb[t]>>>2],1==r?n+=Yt[e.Ub[t]>>>2]:(n+=Yt[2048-e.Ub[t]>>>2],n+=wt(e.vc[t],r-2))):(n=Yt[e.hb[t]>>>2],n+=Yt[2048-e._[(t<<4)+o]>>>2]),n}function zr(e,r,t){return Yt[e.hb[r]>>>2]+Yt[e._[(r<<4)+t]>>>2]}function Fr(e){kr(e),Dt(e.d),gt(e.C),gt(e._),gt(e.bb),gt(e.hb),gt(e.Ub),gt(e.vc),gt(e.Sb),et(e.A);for(var r=0;4>r;++r)gt(e.K[r].G);jr(e.$,1<<e.Y),jr(e.i,1<<e.Y),gt(e.S.G),e.N=0,e.jb=0,e.q=0,e.s=0}function Ir(e,r){r>0&&(Y(e.b,r),e.s+=r)}function xr(e){var r=0;return e.D=H(e.b,e.m),e.D>0&&(r=e.m[e.D-2],r==e.n&&(r+=z(e.b,r-1,e.m[e.D-1],273-r))),++e.s,r}function Nr(e){e.b&&e.W&&(e.b.cc=null,e.W=0)}function Or(e){Nr(e),e.d.Ab=null}function Ar(e,r){e.ab=r;for(var t=0;r>1<<t;++t);e.$b=2*t}function Hr(e,r){var t=e.X;e.X=r,e.b&&t!=e.X&&(e.wb=-1,e.b=null)}function Gr(e,r){e.fc[0]=9*(5*e.Y+e.eb)+e.fb<<24>>24;for(var t=0;4>t;++t)e.fc[1+t]=e.ab>>8*t<<24>>24;k(r,e.fc,0,5)}function Wr(e,r){if(e.Gc){kt(e.d,e.C,(e.l<<4)+r,1),kt(e.d,e.bb,e.l,0),e.l=7>e.l?7:10,Kr(e.$,e.d,0,r);var t=Q(2);mt(e.K[t],e.d,63),Rt(e.d,67108863,26),pt(e.S,e.d,15)}}function Tr(e){return 2048>e?Zt[e]:2097152>e?Zt[e>>10]+20:Zt[e>>20]+40}function Zr(e){return 131072>e?Zt[e>>6]+12:134217728>e?Zt[e>>16]+32:Zt[e>>26]+52}function Yr(e,r,t,o){8>t?(kt(r,e.db,0,0),mt(e.Vb[o],r,t)):(t-=8,kt(r,e.db,0,1),8>t?(kt(r,e.db,1,0),mt(e.Wb[o],r,t)):(kt(r,e.db,1,1),mt(e.ic,r,t-8)))}function Vr(e){e.db=t(2),e.Vb=t(16),e.Wb=t(16),e.ic=ft({},8);for(var r=0;16>r;++r)e.Vb[r]=ft({},3),e.Wb[r]=ft({},3);return e}function jr(e,r){gt(e.db);for(var t=0;r>t;++t)gt(e.Vb[t].G),gt(e.Wb[t].G);gt(e.ic.G)}function $r(e,r,t,o,n){var s,i,_,a,c;for(s=Yt[e.db[0]>>>2],i=Yt[2048-e.db[0]>>>2],_=i+Yt[e.db[1]>>>2],a=i+Yt[2048-e.db[1]>>>2],c=0,c=0;8>c;++c){if(c>=t)return;o[n+c]=s+dt(e.Vb[r],c)}for(;16>c;++c){if(c>=t)return;o[n+c]=_+dt(e.Wb[r],c-8)}for(;t>c;++c)o[n+c]=a+dt(e.ic,c-8-8)}function Kr(e,r,t,o){Yr(e,r,t,o),0==--e.sc[o]&&($r(e,o,e.rb,e.Cc,272*o),e.sc[o]=e.rb)}function qr(e){return Vr(e),e.Cc=[],e.sc=[],e}function Jr(e,r,t){return e.Cc[272*t+r]}function Qr(e,r){for(var t=0;r>t;++t)$r(e,t,e.rb,e.Cc,272*t),e.sc[t]=e.rb}function Ur(e,r,o){var n,s;if(null==e.V||e.u!=o||e.I!=r)for(e.I=r,e.qc=(1<<r)-1,e.u=o,s=1<<e.u+e.I,e.V=t(s),n=0;s>n;++n)e.V[n]=ot({})}function Xr(e,r,t){return e.V[((r&e.qc)<<e.u)+((255&t)>>>8-e.u)]}function et(e){var r,t=1<<e.u+e.I;for(r=0;t>r;++r)gt(e.V[r].tb)}function rt(e,r,t){var o,n,s=1;for(n=7;n>=0;--n)o=t>>n&1,kt(r,e.tb,s,o),s=s<<1|o}function tt(e,r,t,o){var n,s,i,_,a=1,c=1;for(s=7;s>=0;--s)n=o>>s&1,_=c,a&&(i=t>>s&1,_+=1+i<<8,a=i==n),kt(r,e.tb,_,n),c=c<<1|n}function ot(e){return e.tb=t(768),e}function nt(e,r,t,o){var n,s,i=1,_=7,a=0;if(r)for(;_>=0;--_)if(s=t>>_&1,n=o>>_&1,a+=wt(e.tb[(1+s<<8)+i],n),i=i<<1|n,s!=n){--_;break}for(;_>=0;--_)n=o>>_&1,a+=wt(e.tb[i],n),i=i<<1|n;return a}function st(e){e.j=-1,e.t=0}function it(e){e.j=0,e.t=0}function _t(e,r){return e.F=r,e.G=t(1<<r),e}function at(e,r){var t,o=1;for(t=e.F;0!=t;--t)o=(o<<1)+vt(r,e.G,o);return o-(1<<e.F)}function ct(e,r){var t,o,n=1,s=0;for(o=0;e.F>o;++o)t=vt(r,e.G,n),n<<=1,n+=t,s|=t<<o;return s}function ut(e,r,t,o){var n,s,i=1,_=0;for(s=0;o>s;++s)n=vt(t,e,r+i),i<<=1,i+=n,_|=n<<s;return _}function ft(e,r){return e.F=r,e.G=t(1<<r),e}function mt(e,r,t){var o,n,s=1;for(n=e.F;0!=n;)--n,o=t>>>n&1,kt(r,e.G,s,o),s=s<<1|o}function dt(e,r){var t,o,n=1,s=0;for(o=e.F;0!=o;)--o,t=r>>>o&1,s+=wt(e.G[n],t),n=(n<<1)+t;return s}function pt(e,r,t){var o,n,s=1;for(n=0;e.F>n;++n)o=1&t,kt(r,e.G,s,o),s=s<<1|o,t>>=1}function ht(e,r){var t,o,n=1,s=0;for(o=e.F;0!=o;--o)t=1&r,r>>>=1,s+=wt(e.G[n],t),n=n<<1|t;return s}function Pt(e,r,t,o,n){var s,i,_=1;for(i=0;o>i;++i)s=1&n,kt(t,e,r+_,s),_=_<<1|s,n>>=1}function lt(e,r,t,o){var n,s,i=1,_=0;for(s=t;0!=s;--s)n=1&o,o>>>=1,_+=Yt[(2047&(e[r+i]-n^-n))>>>2],i=i<<1|n;return _}function vt(e,r,t){var o,n=r[t];return o=(e.E>>>11)*n,(-2147483648^o)>(-2147483648^e.Bb)?(e.E=o,r[t]=n+(2048-n>>>5)<<16>>16,-16777216&e.E||(e.Bb=e.Bb<<8|l(e.Ab),e.E<<=8),0):(e.E-=o,e.Bb-=o,r[t]=n-(n>>>5)<<16>>16,-16777216&e.E||(e.Bb=e.Bb<<8|l(e.Ab),e.E<<=8),1)}function Bt(e,r){var t,o,n=0;for(t=r;0!=t;--t)e.E>>>=1,o=e.Bb-e.E>>>31,e.Bb-=e.E&o-1,n=n<<1|1-o,-16777216&e.E||(e.Bb=e.Bb<<8|l(e.Ab),e.E<<=8);return n}function St(e){e.Bb=0,e.E=-1;for(var r=0;5>r;++r)e.Bb=e.Bb<<8|l(e.Ab)}function gt(e){for(var r=e.length-1;r>=0;--r)e[r]=1024}function kt(e,r,t,s){var i,_=r[t];i=(e.E>>>11)*_,s?(e.xc=o(e.xc,n(a(i),[4294967295,0])),e.E-=i,r[t]=_-(_>>>5)<<16>>16):(e.E=i,r[t]=_+(2048-_>>>5)<<16>>16),-16777216&e.E||(e.E<<=8,bt(e))}function Rt(e,r,t){for(var n=t-1;n>=0;--n)e.E>>>=1,1==(r>>>n&1)&&(e.xc=o(e.xc,a(e.E))),-16777216&e.E||(e.E<<=8,bt(e))}function Mt(e){return o(o(a(e.Jb),e.mc),[4,0])}function Dt(e){e.mc=Gt,e.xc=Gt,e.E=-1,e.Jb=1,e.Oc=0}function bt(e){var r,t=c(p(e.xc,32));if(0!=t||s(e.xc,[4278190080,0])<0){e.mc=o(e.mc,a(e.Jb)),r=e.Oc;do g(e.Ab,r+t),r=255;while(0!=--e.Jb);e.Oc=c(e.xc)>>>24}++e.Jb,e.xc=m(n(e.xc,[16777215,0]),8)}function wt(e,r){return Yt[(2047&(e-r^-r))>>>2]}function Et(e){for(var r,t,o,n=0,s=0,i=e.length,_=[],a=[];i>n;++n,++s){if(r=255&e[n],128&r)if(192==(224&r)){if(n+1>=i)return e;if(t=255&e[++n],128!=(192&t))return e;a[s]=(31&r)<<6|63&t}else{if(224!=(240&r))return e;
if(n+2>=i)return e;if(t=255&e[++n],128!=(192&t))return e;if(o=255&e[++n],128!=(192&o))return e;a[s]=(15&r)<<12|(63&t)<<6|63&o}else{if(!r)return e;a[s]=r}16383==s&&(_.push(String.fromCharCode.apply(String,a)),s=-1)}return s>0&&(a.length=s,_.push(String.fromCharCode.apply(String,a))),_.join("")}function Lt(e){var r,t,o,n=[],s=0,i=e.length;if("object"==typeof e)return e;for(R(e,0,i,n,0),o=0;i>o;++o)r=n[o],r>=1&&127>=r?++s:s+=!r||r>=128&&2047>=r?2:3;for(t=[],s=0,o=0;i>o;++o)r=n[o],r>=1&&127>=r?t[s++]=r<<24>>24:!r||r>=128&&2047>=r?(t[s++]=(192|r>>6&31)<<24>>24,t[s++]=(128|63&r)<<24>>24):(t[s++]=(224|r>>12&15)<<24>>24,t[s++]=(128|r>>6&63)<<24>>24,t[s++]=(128|63&r)<<24>>24);return t}function yt(e){return e[1]+e[0]}function Ct(e,t,o,n){function s(){try{for(var e,r=(new Date).getTime();rr(a.c.yb);)if(i=yt(a.c.yb.Pb)/yt(a.c.Tb),(new Date).getTime()-r>200)return n(i),Nt(s,0),0;n(1),e=S(a.c.Nb),Nt(o.bind(null,e),0)}catch(t){o(null,t)}}var i,_,a={},c=void 0===o&&void 0===n;if("function"!=typeof o&&(_=o,o=n=0),n=n||function(e){return void 0!==_?r(e,_):void 0},o=o||function(e,r){return void 0!==_?postMessage({action:Ft,cbn:_,result:e,error:r}):void 0},c){for(a.c=w({},Lt(e),Vt(t));rr(a.c.yb););return S(a.c.Nb)}try{a.c=w({},Lt(e),Vt(t)),n(0)}catch(u){return o(null,u)}Nt(s,0)}function zt(e,t,o){function n(){try{for(var e,r=0,i=(new Date).getTime();rr(c.d.yb);)if(++r%1e3==0&&(new Date).getTime()-i>200)return _&&(s=yt(c.d.yb.Z.g)/a,o(s)),Nt(n,0),0;o(1),e=Et(S(c.d.Nb)),Nt(t.bind(null,e),0)}catch(u){t(null,u)}}var s,i,_,a,c={},u=void 0===t&&void 0===o;if("function"!=typeof t&&(i=t,t=o=0),o=o||function(e){return void 0!==i?r(_?e:-1,i):void 0},t=t||function(e,r){return void 0!==i?postMessage({action:It,cbn:i,result:e,error:r}):void 0},u){for(c.d=L({},e);rr(c.d.yb););return Et(S(c.d.Nb))}try{c.d=L({},e),a=yt(c.d.Tb),_=a>-1,o(0)}catch(f){return t(null,f)}Nt(n,0)}var Ft=1,It=2,xt=3,Nt="function"==typeof setImmediate?setImmediate:setTimeout,Ot=4294967296,At=[4294967295,-Ot],Ht=[0,-0x8000000000000000],Gt=[0,0],Wt=[1,0],Tt=function(){var e,r,t,o=[];for(e=0;256>e;++e){for(t=e,r=0;8>r;++r)0!=(1&t)?t=t>>>1^-306674912:t>>>=1;o[e]=t}return o}(),Zt=function(){var e,r,t,o=2,n=[0,1];for(t=2;22>t;++t)for(r=1<<(t>>1)-1,e=0;r>e;++e,++o)n[o]=t<<24>>24;return n}(),Yt=function(){var e,r,t,o,n=[];for(r=8;r>=0;--r)for(o=1<<9-r-1,e=1<<9-r,t=o;e>t;++t)n[t]=(r<<6)+(e-t<<6>>>9-r-1);return n}(),Vt=function(){var e=[{s:16,f:64,m:0},{s:20,f:64,m:0},{s:19,f:64,m:1},{s:20,f:64,m:1},{s:21,f:128,m:1},{s:22,f:128,m:1},{s:23,f:128,m:1},{s:24,f:255,m:1},{s:25,f:255,m:1}];return function(r){return e[r-1]||e[6]}}();return"undefined"==typeof onmessage||"undefined"!=typeof window&&void 0!==window.document||!function(){onmessage=function(r){r&&r.gc&&(r.gc.action==It?e.decompress(r.gc.gc,r.gc.cbn):r.gc.action==Ft&&e.compress(r.gc.gc,r.gc.Rc,r.gc.cbn))}}(),{compress:Ct,decompress:zt}}();this.LZMA=this.LZMA_WORKER=e; }
if(typeof self === "undefined" || !self.constructor.name.includes("Worker")) { /*! @source http://purl.eligrey.com/github/FileSaver.js/blob/master/FileSaver.js */
var saveAs=saveAs||function(e){"use strict";if(typeof e==="undefined"||typeof navigator!=="undefined"&&/MSIE [1-9]\./.test(navigator.userAgent)){return}var t=e.document,n=function(){return e.URL||e.webkitURL||e},r=t.createElementNS("http://www.w3.org/1999/xhtml","a"),o="download"in r,a=function(e){var t=new MouseEvent("click");e.dispatchEvent(t)},i=/constructor/i.test(e.HTMLElement)||e.safari,f=/CriOS\/[\d]+/.test(navigator.userAgent),u=function(t){(e.setImmediate||e.setTimeout)(function(){throw t},0)},s="application/octet-stream",d=1e3*40,c=function(e){var t=function(){if(typeof e==="string"){n().revokeObjectURL(e)}else{e.remove()}};setTimeout(t,d)},l=function(e,t,n){t=[].concat(t);var r=t.length;while(r--){var o=e["on"+t[r]];if(typeof o==="function"){try{o.call(e,n||e)}catch(a){u(a)}}}},p=function(e){if(/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)){return new Blob([String.fromCharCode(65279),e],{type:e.type})}return e},v=function(t,u,d){if(!d){t=p(t)}var v=this,w=t.type,m=w===s,y,h=function(){l(v,"writestart progress write writeend".split(" "))},S=function(){if((f||m&&i)&&e.FileReader){var r=new FileReader;r.onloadend=function(){var t=f?r.result:r.result.replace(/^data:[^;]*;/,"data:attachment/file;");var n=e.open(t,"_blank");if(!n)e.location.href=t;t=undefined;v.readyState=v.DONE;h()};r.readAsDataURL(t);v.readyState=v.INIT;return}if(!y){y=n().createObjectURL(t)}if(m){e.location.href=y}else{var o=e.open(y,"_blank");if(!o){e.location.href=y}}v.readyState=v.DONE;h();c(y)};v.readyState=v.INIT;if(o){y=n().createObjectURL(t);setTimeout(function(){r.href=y;r.download=u;a(r);h();c(y);v.readyState=v.DONE});return}S()},w=v.prototype,m=function(e,t,n){return new v(e,t||e.name||"download",n)};if(typeof navigator!=="undefined"&&navigator.msSaveOrOpenBlob){return function(e,t,n){t=t||e.name||"download";if(!n){e=p(e)}return navigator.msSaveOrOpenBlob(e,t)}}w.abort=function(){};w.readyState=w.INIT=0;w.WRITING=1;w.DONE=2;w.error=w.onwritestart=w.onprogress=w.onwrite=w.onabort=w.onerror=w.onwriteend=null;return m}(typeof self!=="undefined"&&self||typeof window!=="undefined"&&window||this.content);if(typeof module!=="undefined"&&module.exports){module.exports.saveAs=saveAs}else if(typeof define!=="undefined"&&define!==null&&define.amd!==null){define("FileSaver.js",function(){return saveAs})}
 }
if(typeof self === "undefined" || !self.constructor.name.includes("Worker")) { /*
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at https://mozilla.org/MPL/2.0/.
 */

/**
 * Tilbuci javascript externs for browser handling.
 */

/**
 * tabs communication channel
 */
let tab_channel = null;

/**
 * Sets the browser address bar content.
 */
function TBB_setAddress(url, title) {
    window.history.pushState({
        "html": url, 
        "pageTitle": title
    }, title, url);
}

/**
 * Copies a content to the clipboard.
 */
function TBB_copyText(text) {
    navigator.clipboard.writeText(text);
}

/**
 * Shows the entire page on fullscreen.
 */
function TBB_fullscreen() {
    if (!document.fullscreenElement) {
        var elem = document.getElementById("TilBuciArea"); 
        if (elem.requestFullscreen) {
            elem.requestFullscreen();
        } else if (elem.webkitRequestFullscreen) {
            elem.webkitRequestFullscreen();
        } else if (elem.msRequestFullscreen) {
            elem.msRequestFullscreen();
        }
    } else {
        document.exitFullscreen();
    }
}

/**
 * Quits a desktop application.
 */
function TBB_appQuit() {
    window.electronAPI.quitApp();
}

/**
 * Enters kiosk mode on Electron app.
 */
function TBB_kioskStart() {
    window.electronAPI.kioskStart();
}

/**
 * Exits kiosk mode on Electron app.
 */
function TBB_kioskEnd() {
    window.electronAPI.kioskEnd();
}

/**
 * Checks if running from a mobile device.
 */
function TBB_isMobile() {
    let check = false;
    (function(a){if(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(a)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(a.substr(0,4))) check = true;})(navigator.userAgent||navigator.vendor||window.opera);
    return check;
}

/**
 * Checks if running from an iPhone or an iPad.
 */
function TBB_isIos() {
    if (TBB_isMobile()) {
        const userAgent = window.navigator.userAgent.toLowerCase();
        return (/iphone|ipad|ipod/.test(userAgent));
    } else {
        return (false);
    }
}

/**
    Saves a text file from browser.
    @param  name    the file name
    @param  content the file content
**/
function TBB_saveFile(name, content) {
    const blob = new Blob([content], { type: "text/plain" });
    const link = document.createElement("a");
    link.href = URL.createObjectURL(blob);
    link.download = name;
    link.click();
    URL.revokeObjectURL(link.href);
}

/**
    Saves a text file from electron runtime.
    @param  name    the file name
    @param  content the file content
**/
function TBB_saveFileElectron(name, content) {
    window.electronAPI.saveFile(name, content);
}

/**
    Saves a text file from capacitor runtime.
    @param  name    the file name
    @param  content the file content
**/
function TBB_saveFileCapacitor(name, content) {
    TBB_Capacitor_Save(name, content);
}

/**
    Loads a text file from browser.
    @param  ext     the file extension
    @param  callback    method to call on file load
**/
function TBB_loadFile(ext, callback) {
    const input = document.createElement('input');
    input.type = 'file';
    input.accept = '.' + ext;
    input.style.display = 'none';
    input.addEventListener('change', function () {
        if (input.files.length === 0) {
            callback(false, '');
        } else {
            const arquivo = input.files[0];
            if (!arquivo) {
                callback(false, '');
            }
            const leitor = new FileReader();
            leitor.onload = function (e) {
                callback(true, e.target.result);
            };
            leitor.readAsText(arquivo, 'UTF-8');
        }
    });
    document.body.appendChild(input);
    input.click();
    document.body.removeChild(input);
}

/**
    Loads a text file from electron runtime.
    @param  name     the file name
    @param  callback    method to call on file load
**/
function TBB_loadFileElectron(name, callback) {
    window.electronAPI.readFile(name).then(ret => {
        if (ret == "") {
            callback(false, "");
        } else {
            callback(true, ret);
        }
    });
}

/**
    Loads a text file from capacitor runtime.
    @param  name     the file name
    @param  callback    method to call on file load
**/
function TBB_loadFileCapacitor(name, callback) {
    TBB_Capacitor_Load(name).then(ret => {
        if (ret == "") {
            callback(false, "");
        } else {
            callback(true, ret);
        }
    });
}

/**
    Checks if a file exists in user folder on electron runtime.
    @param  name    the file name
**/
function TBB_existsFileElectron(name) {
    window.electronAPI.existsFile(name).then(ok => {
        return (ok);
    });
}

/**
    Checks if a file exists in user folder on electron runtime.
    @param  name    the file name
**/
function TBB_existsFileCapacitor(name) {
    TBB_Capacitor_FileExists(name).then(ok => {
        return (ok);
    });
}

function TBB_callJs(name, args) {
    if (typeof(window[name]) === 'function') {
        let callrags = new Array();
        if (args !== null) {
            if (Array.isArray(args)) {
                for (i=0; i<args.length; i++) callrags.push(args[i]);
            }
        }
        window[name].apply(null, callrags);
        return (true);
    } else {
        return (false);
    }
}

function TBB_startTabsChannel(callback) {
    tab_channel = new BroadcastChannel('tbb_tabschannel');
    tab_channel.onmessage = (event) => {
        callback(event.data.type, event.data.message);
    };
}

function TBB_sendTabsMessage(type, message) {
    if (tab_channel == null) TBB_startTabsChannel();
    tab_channel.postMessage({ type: type, message: message });
} }
if(typeof self === "undefined" || !self.constructor.name.includes("Worker")) { /*
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at https://mozilla.org/MPL/2.0/.
 */

/**
 * Tilbuci javascript externs for file upload.
 */

// preparing javascript api
window.BlobBuilder = window.MozBlobBuilder || window.WebKitBlobBuilder || window.BlobBuilder;

// upload variables
var TBU_filedata;				// selected file data
var TBU_piecesize = 524288;		// file "piece" size (512kb)
var TBU_originalsize;			// file original size
var TBU_start;					// file data start position
var TBU_end;					// file data end position
var TBU_part;					// file piece number
var TBU_total;					// file piece total number
var TBU_chunk;					// current file data piece
var TBU_xhr;					// uploader request
var TBU_info_a;					// Tilbuci upload information: action
var TBU_info_r;					// Tilbuci upload information: request
var TBU_info_u;					// Tilbuci upload information: user
var TBU_info_s;					// Tilbuci upload information: signature
var TBU_info_url				// upload script url
var TBU_uploading = false;		// currently uploading a file?


// creating the file input element
var TBU_input = document.createElement("input");
TBU_input.setAttribute("type", "file");
TBU_input.setAttribute("name", "TBU_input");
TBU_input.setAttribute("onChange", "TBU_fileSelected();");

/**
 * Start browsing for a file.
 * @param	accept	file extensions to accept
 */
function TBU_browse(accept) {
	TBU_input.accept = accept;
	TBU_input.click();
}

/**
 * A new file was selected.
 */
function TBU_fileSelected() {
	var file = TBU_input.files[0];
	if (file) {
		var fileSize = 0;
		if (file.size > 1024 * 1024) {
			fileSize = (Math.round(file.size * 100 / (1024 * 1024)) / 100).toString() + "MB";
		} else {
			fileSize = (Math.round(file.size * 100 / 1024) / 100).toString() + "KB";
		}
		TBU_total = Math.ceil(file.size / TBU_piecesize);
		TBU_setFile(file.name, fileSize, file.type, TBU_total);
	}
}

/**
 * Upload the selected file.
 */
function TBU_upload(a, r, u, s, url) {
	TBU_uploading = true;
	TBU_info_a = a;
	TBU_info_r = r;
	TBU_info_u = u;
	TBU_info_s = s;
	TBU_info_url = url;
    TBU_filedata = TBU_input.files[0];
	TBU_originalsize = TBU_filedata.size;
	TBU_start = 0;                
	TBU_part = 0;
	TBU_end = TBU_piecesize;
    TBU_chunk = TBU_filedata.slice(TBU_start, TBU_end);
    TBU_uploadFile(TBU_chunk, TBU_part);
    TBU_start = TBU_end;
    TBU_end = TBU_start + TBU_piecesize;
    TBU_part = TBU_part + 1;
}

/**
 * Upload a file piece.
 */
function TBU_uploadFile(fileData, part) {
	var file = TBU_input.files[0];  
	var fd = new FormData();
	fd.append("TBU_file", fileData);
	fd.append("a", TBU_info_a);
	fd.append("r", TBU_info_r);
	fd.append("u", TBU_info_u);
	fd.append("s", TBU_info_s);
	fd.append("p", TBU_part);
	fd.append("t", TBU_total);
	fd.append("b", TBU_piecesize);
	fd.append("remove", '0');
	TBU_xhr = new XMLHttpRequest();
	TBU_xhr.addEventListener("load", TBU_uploadComplete, false);
	TBU_xhr.addEventListener("error", TBU_uploadFailed, false);
	TBU_xhr.addEventListener("abort", TBU_uploadAborted, false);
	TBU_xhr.open("POST", TBU_info_url);
	TBU_xhr.onload = function(e) { /* nothing to do */ };
	TBU_xhr.setRequestHeader("Cache-Control", "no-cache");
	TBU_xhr.send(fd);
	return;
}

/**
 * File piece upload completed.
 */
function TBU_uploadComplete(evt) {
	TBU_xhr.removeEventListener("load", TBU_uploadComplete, false);
	TBU_xhr.removeEventListener("error", TBU_uploadFailed, false);
	TBU_xhr.removeEventListener("abort", TBU_uploadAborted, false);
	var e = 0;
	try {
		var json = JSON.parse(TBU_xhr.responseText);
		e = 0;
	} catch (error) {
		e = -1;
	}
	TBU_xhr = null;
	if (e == 0) {
		e = json.e;
	}
	if (e == 0) {
		if (TBU_uploading) {
			if (TBU_start < TBU_originalsize) {
				TBU_chunk = TBU_filedata.slice(TBU_start, TBU_end);
				TBU_uploadFile(TBU_chunk, TBU_part);
				TBU_start = TBU_end;
				TBU_end = TBU_start + TBU_piecesize;
				TBU_setProgress(TBU_part, TBU_total, false);
				TBU_part = TBU_part + 1;
			} else {
				TBU_uploading = false;
				TBU_setProgress(TBU_part, TBU_total, true, JSON.stringify(json));
			}
		}
	} else {
		TBU_removeIncomplete();
		TBU_setFailed();
	}
}

/**
 * Remove incomplete file uploads.
 */
function TBU_removeIncomplete() {
	TBU_uploading = false;
	var fd = new FormData();
	fd.append("a", TBU_info_a);
	fd.append("r", TBU_info_r);
	fd.append("u", TBU_info_u);
	fd.append("s", TBU_info_s);
	fd.append("remove", '1');
	xhr = new XMLHttpRequest();
	xhr.open("POST", TBU_info_url);
	xhr.onload = function(e) { /* nothing to do */ };
	xhr.setRequestHeader("Cache-Control", "no-cache");
	xhr.send(fd);
	return;
}

/**
 * File uploaded failed.
 */
function TBU_uploadFailed(evt) {
	TBU_uploading = false;
	TBU_xhr.removeEventListener("load", TBU_uploadComplete, false);
	TBU_xhr.removeEventListener("error", TBU_uploadFailed, false);
	TBU_xhr.removeEventListener("abort", TBU_uploadAborted, false);
	TBU_xhr = null;
	TBU_removeIncomplete();
	TBU_setFailed();
}

/**
 * File upload aborted.
 */
function TBU_uploadAborted(evt) {
	TBU_uploading = false;
	TBU_xhr.abort();
	TBU_xhr.removeEventListener("load", TBU_uploadComplete, false);
	TBU_xhr.removeEventListener("error", TBU_uploadFailed, false);
	TBU_xhr.removeEventListener("abort", TBU_uploadAborted, false);
	TBU_xhr = null;
	TBU_removeIncomplete();
	TBU_setAborted();
}

/**
 * Stops the current upload.
 */
function TBU_cancelUpload() {
	TBU_uploading = false;
	if (TBU_xhr != null) TBU_xhr.abort();
	TBU_removeIncomplete();
	TBU_setAborted();
} }
if(typeof self === "undefined" || !self.constructor.name.includes("Worker")) { /*
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at https://mozilla.org/MPL/2.0/.
 */

/**
 * Tilbuci javascript externs for HTML5 embed content.
 */

// embed variables
var embed_display = false;
var embed_area = null;
var embed_frame = null;
var tilbuci_resize = [ ];

/**
 * Places the embed area above the TilBuci player.
 * @param src URL to load on embed display
 */
function embed_place(src) {
	if (embed_area == null) embed_area = document.getElementById("embed_area");
	if (embed_frame == null) embed_frame = document.getElementById("embed_frame");
	if ((embed_area != null) && (embed_frame != null)) {
		embed_area.style.display = "block";
		embed_frame.style.width = (embed_area.clientWidth) + "px";
		embed_frame.style.height = (embed_area.clientHeight) + "px";
		embed_frame.style.display = "block";
		embed_frame.src = src;
		embed_display = true;
	}
}

/**
 * Sets the embed content position and size
 * @param {*} x x position
 * @param {*} y y position
 * @param {*} width new width
 * @param {*} height new height
 */
function embed_setposition(x, y, width, height) {
	if (embed_area == null) embed_area = document.getElementById("embed_area");
	if (embed_frame == null) embed_frame = document.getElementById("embed_frame");
	if ((embed_area != null) && (embed_frame != null)) {
		embed_area.style.marginLeft = (x + "px");
		embed_area.style.marginTop = (y + "px");
		embed_area.style.width = (width + "px");
		embed_area.style.height = (height + "px");
		embed_frame.style.width = (width + "px");
		embed_frame.style.height = (height + "px");
	}
}

/**
 * Sets the embed content in full area.
 */
function embed_setfull() {
	if (embed_area == null) embed_area = document.getElementById("embed_area");
	if (embed_frame == null) embed_frame = document.getElementById("embed_frame");
	if ((embed_area != null) && (embed_frame != null)) {
		embed_area.style.marginLeft = ("0px");
		embed_area.style.marginTop = ("0px");
		embed_area.style.width = ("100%");
		embed_area.style.height = ("100%");
		embed_frame.style.width = ("100%");
		embed_frame.style.height = ("100%");
	}
}

/**
 * Adjusts the embed area on stage resize.
 */
function embed_resize() {
	if (embed_display && (embed_area != null) && (embed_frame != null)) {
		embed_frame.style.width = (embed_area.clientWidth) + "px";
		embed_frame.style.height = (embed_area.clientHeight) + "px";
	}
}
tilbuci_resize.push(embed_resize);
window.onresize = function(e) {
    for (var i=0; i<tilbuci_resize.length; i++) {
        tilbuci_resize[i]();
    }
}

/**
 * Closes the overlay display.
 */
function embed_close() {
	if (embed_frame != null) {
		embed_frame.src = "about:blank";
        embed_frame.style.display = "none";
        embed_area.style.display = "none";
	}
} }
if(typeof self === "undefined" || !self.constructor.name.includes("Worker")) { /*
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at https://mozilla.org/MPL/2.0/.
 */

/**
 * Tilbuci javascript externs for overlay plugin.
 */

// overlay variables
var overlay_display = false;
var overlay_area = null;
var overlay_frame = null;
var overlay_title = null;

/**
 * Places the overlay area above the TilBuci player.
 * @param src URL to load on overlay display
 * @param title the title to show above the overlay content
 */
function overlay_place(src, title) {
	if (overlay_area == null) overlay_area = document.getElementById("overlay_area");
	if (overlay_frame == null) overlay_frame = document.getElementById("overlay_frame");
	if (overlay_title == null) overlay_title = document.getElementById("overlay_title");
	if ((overlay_area != null) && (overlay_frame != null) && (overlay_title != null)) {
		overlay_area.style.display = "block";
		overlay_frame.style.width = (overlay_area.clientWidth - 120) + "px";
		overlay_frame.style.height = (overlay_area.clientHeight - 100) + "px";
		overlay_frame.style.display = "block";
		overlay_frame.src = src;
		overlay_display = true;
		overlay_title.innerHTML = title;
	}
}

/**
 * Adjusts the overlay area on stage resize.
 */
function overlay_resize() {
	if (overlay_display && (overlay_area != null) && (overlay_frame != null)) {
		overlay_frame.style.width = (overlay_area.clientWidth - 120) + "px";
		overlay_frame.style.height = (overlay_area.clientHeight - 100) + "px";
	}
}
tilbuci_resize.push(overlay_resize);

/**
 * Closes the overlay display.
 */
function overlay_close() {
	if (overlay_frame != null) {
		overlay_frame.src = "about:blank";
        overlay_frame.style.display = "none";
        overlay_area.style.display = "none";
        overlay_return();
	}
} }

if (typeof define === "function" && define.__amd) {
	define.amd = define.__amd;
	delete define.__amd;
}
